Skip to content

Commit

Permalink
Merge branch 'main' into feature/tag-component
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgoud authored Oct 3, 2023
2 parents f9896da + 6c3518e commit 0a33c06
Show file tree
Hide file tree
Showing 17 changed files with 2,548 additions and 842 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ packages/puik/version.ts
*.local

# playground test file
playground/src/App.vue
playground/src/App.vue
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"cSpell.words": ["Puik", "puik"],
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll": false,
"source.fixAll.eslint": false
},
"npm.packageManager": "pnpm",
"eslint.probe": [
Expand All @@ -23,6 +24,7 @@
"vue",
"markdown"
],
"css.customData": [".vscode/tailwind.json"],
"vite.devCommand": "pnpm run dev -- --",
"i18n-ally.localesPaths": "packages/locale/lang",
"i18n-ally.enabledParsers": ["ts"],
Expand Down
55 changes: 55 additions & 0 deletions .vscode/tailwind.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"version": 1.1,
"atDirectives": [
{
"name": "@tailwind",
"description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#tailwind"
}
]
},
{
"name": "@apply",
"description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#apply"
}
]
},
{
"name": "@responsive",
"description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#responsive"
}
]
},
{
"name": "@screen",
"description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#screen"
}
]
},
{
"name": "@variants",
"description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#variants"
}
]
}
]
}
6 changes: 4 additions & 2 deletions build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"dependencies": {
"@pnpm/find-workspace-packages": "^6.0.5",
"@pnpm/logger": "^5.0.0",
"@rollup/plugin-commonjs": "^24.1.0",
"@rollup/plugin-commonjs": "^25.0.2",
"@rollup/plugin-node-resolve": "^15.0.2",
"@vitejs/plugin-vue": "^4.1.0",
"chalk": "^5.2.0",
"components-helper": "^2.1.4",
"consola": "^2.15.3",
"consola": "^3.2.3",
"esbuild": "^0.17.16",
"fast-glob": "^3.2.12",
"fs-extra": "^11.1.1",
Expand All @@ -37,6 +37,8 @@
"@esbuild-kit/cjs-loader": "^2.4.2",
"@pnpm/types": "^9.0.0",
"@types/rollup-plugin-css-only": "^3.1.0",
"rollup-plugin-postcss": "^4.0.2",
"sass": "^1.67.0",
"unbuild": "^1.2.0",
"vue": "^3.2.47"
}
Expand Down
25 changes: 17 additions & 8 deletions build/src/tasks/full-bundle.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import path from 'path'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import { rollup } from 'rollup'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import esbuild from 'rollup-plugin-esbuild'
import vue from '@vitejs/plugin-vue'
import DefineOptions from 'unplugin-vue-define-options/rollup'
import esbuild from 'rollup-plugin-esbuild'
import { parallel } from 'gulp'
import glob from 'fast-glob'
import postcss from 'rollup-plugin-postcss'
import { camelCase, upperFirst } from 'lodash-unified'
import { version } from '../../../packages/puik/version'
import { PuikAlias } from '../plugins/puik-alias'
import {
themeRoot,
puikRoot,
puikOutput,
localeRoot,
Expand All @@ -19,6 +19,8 @@ import {
writeBundles,
withTaskName,
} from '../utils'
import { version } from '../../../packages/puik/version'
import { PuikAlias } from '../plugins/puik-alias'
import { target } from '../build-info'

const banner = `/*! Puik v${version} */\n`
Expand All @@ -27,15 +29,22 @@ async function buildFullEntry(minify: boolean) {
const bundle = await rollup({
input: path.resolve(puikRoot, 'index.ts'),
plugins: [
nodeResolve({
extensions: ['.mjs', '.js', '.json', '.ts', '.scss'],
}),
commonjs(),
PuikAlias(),
vue({
isProduction: true,
customElement: true,
}),
DefineOptions(),
nodeResolve({
extensions: ['.mjs', '.js', '.json', '.ts'],
postcss({
config: {
path: `${themeRoot}/postcss.config.js`,
ctx: {},
},
}),
commonjs(),
DefineOptions(),
esbuild({
exclude: [],
minify,
Expand Down
19 changes: 14 additions & 5 deletions build/src/tasks/modules.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { rollup } from 'rollup'
import vue from '@vitejs/plugin-vue'
import DefineOptions from 'unplugin-vue-define-options/rollup'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import esbuild from 'rollup-plugin-esbuild'
import vue from '@vitejs/plugin-vue'
import DefineOptions from 'unplugin-vue-define-options/rollup'
import postcss from 'rollup-plugin-postcss'
import glob from 'fast-glob'
import {
puikRoot,
pkgRoot,
generateExternal,
writeBundles,
excludeFiles,
themeRoot,
} from '../utils'
import { PuikAlias } from '../plugins/puik-alias'
import { buildConfigEntries, target } from '../build-info'
Expand All @@ -28,15 +30,22 @@ export const buildModules = async () => {
const bundle = await rollup({
input,
plugins: [
commonjs(),
nodeResolve({
extensions: ['.mjs', '.js', '.json', '.ts', '.scss'],
}),
PuikAlias(),
DefineOptions(),
vue({
isProduction: false,
customElement: true,
}),
nodeResolve({
extensions: ['.mjs', '.js', '.json', '.ts'],
postcss({
config: {
path: `${themeRoot}/postcss.config.js`,
ctx: {},
},
}),
commonjs(),
esbuild({
sourceMap: true,
target,
Expand Down
68 changes: 34 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"vue": "^3.2.0"
},
"dependencies": {
"@headlessui/vue": "^1.7.13",
"@popperjs/core": "^2.11.7",
"@headlessui/vue": "^1.7.16",
"@popperjs/core": "^2.11.8",
"@puik/components": "workspace:*",
"@puik/hooks": "workspace:*",
"@puik/locale": "workspace:*",
Expand All @@ -63,53 +63,53 @@
"lodash-unified": "^1.0.3"
},
"devDependencies": {
"@commitlint/cli": "^17.5.1",
"@commitlint/config-conventional": "^17.4.4",
"@esbuild-kit/cjs-loader": "^2.4.2",
"@faker-js/faker": "^8.0.2",
"@pnpm/find-workspace-packages": "^6.0.5",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@esbuild-kit/cjs-loader": "^2.4.4",
"@faker-js/faker": "^8.1.0",
"@pnpm/find-workspace-packages": "^6.0.9",
"@pnpm/logger": "5.0.0",
"@pnpm/types": "^9.0.0",
"@puik/build": "workspace:^0.0.1",
"@types/fs-extra": "^11.0.1",
"@types/gulp": "^4.0.10",
"@types/lodash": "^4.14.192",
"@types/lodash-es": "^4.17.7",
"@types/node": "^18.15.11",
"@types/sass": "^1.43.1",
"@pnpm/types": "^9.2.0",
"@puik/build": "workspace:^",
"@types/fs-extra": "^11.0.2",
"@types/gulp": "^4.0.14",
"@types/lodash": "^4.14.198",
"@types/lodash-es": "^4.17.9",
"@types/node": "^18.17.18",
"@types/sass": "^1.45.0",
"@typescript-eslint/eslint-plugin": "5.58.0",
"@typescript-eslint/parser": "5.58.0",
"@vitejs/plugin-vue": "^4.1.0",
"@vitejs/plugin-vue": "^4.3.4",
"@vitest/coverage-v8": "^0.32.4",
"@vue/test-utils": "^2.3.2",
"@vue/test-utils": "^2.4.1",
"@vue/tsconfig": "^0.1.3",
"chalk": "^5.2.0",
"chromatic": "^6.17.3",
"consola": "^2.15.3",
"chalk": "^5.3.0",
"chromatic": "^6.24.1",
"consola": "^3.2.3",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.38.0",
"eslint": "^8.49.0",
"eslint-config-prettier": "8.8.0",
"eslint-define-config": "^1.17.0",
"eslint-define-config": "^1.23.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-vue": "9.10.0",
"fast-glob": "^3.2.12",
"fast-glob": "^3.3.1",
"husky": "^8.0.3",
"hygen": "^6.2.11",
"jsdom": "^21.1.1",
"lint-staged": "^13.2.1",
"prettier": "^2.8.7",
"jsdom": "^21.1.2",
"lint-staged": "^13.3.0",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"rimraf": "^5.0.0",
"sass": "^1.62.0",
"rimraf": "^5.0.1",
"sass": "^1.68.0",
"ts-morph": "^14.0.0",
"tsx": "^3.12.6",
"tsx": "^3.12.10",
"type-fest": "^2.19.0",
"typescript": "^5.0.4",
"unplugin-vue-define-options": "^1.3.3",
"typescript": "^5.2.2",
"unplugin-vue-define-options": "^1.3.18",
"vitest": "^0.32.4",
"vue": "^3.2.47",
"vue-router": "^4.1.6",
"vue-tsc": "^1.2.0"
"vue": "^3.3.4",
"vue-router": "^4.2.5",
"vue-tsc": "^1.8.13"
}
}
9 changes: 8 additions & 1 deletion packages/components/icon/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { defineCustomElement } from 'vue'
import { withInstall } from '@puik/utils'

import Icon from './src/icon.vue'

export const PuikIcon = withInstall(Icon)
export default PuikIcon
export const PuikIconCe = defineCustomElement(PuikIcon)

if (!customElements.get('puik-icon-ce')) {
customElements.define('puik-icon-ce', PuikIconCe)
}

export * from './src/icon'

export default PuikIcon
5 changes: 5 additions & 0 deletions packages/components/icon/src/icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ const style = {
color: props.color,
}
</script>

<style lang="scss">
@import '../../../theme/src/base';
@import '../../../theme/src/icon';
</style>
9 changes: 8 additions & 1 deletion packages/components/tooltip/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { defineCustomElement } from 'vue'
import { withInstall } from '@puik/utils'

import Tooltip from './src/tooltip.vue'

export const PuikTooltip = withInstall(Tooltip)
export default PuikTooltip
export const PuikTooltipCe = defineCustomElement(PuikTooltip)

if (!customElements.get('puik-tooltip-ce')) {
customElements.define('puik-tooltip-ce', PuikTooltipCe)
}

export * from './src/tooltip'

export default PuikTooltip
5 changes: 5 additions & 0 deletions packages/components/tooltip/src/tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,8 @@ onMounted(() => {
}
})
</script>

<style lang="scss">
@use '../../../theme/src/base';
@use '../../../theme/src/tooltip.scss';
</style>
6 changes: 4 additions & 2 deletions packages/puik/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
PuikMenuItemTitle,
} from '@puik/components/menu'
import { PuikProgressBar } from '@puik/components/progress-bar'
import { PuikIcon } from '@puik/components/icon'
import { PuikIcon, PuikIconCe } from '@puik/components/icon'
import { PuikLink } from '@puik/components/link'
import { PuikCard } from '@puik/components/card'
import { PuikSnackbar } from '@puik/components/snackbar'
Expand All @@ -40,7 +40,7 @@ import { PuikCheckbox } from '@puik/components/checkbox'
import { PuikRadio } from '@puik/components/radio'
import { PuikSelect, PuikOption } from '@puik/components/select'
import { PuikAlert } from '@puik/components/alert'
import { PuikTooltip } from '@puik/components/tooltip'
import { PuikTooltip, PuikTooltipCe } from '@puik/components/tooltip'
import { PuikSwitch } from '@puik/components/switch'
import { PuikButton } from '@puik/components/button'
import { PuikInput } from '@puik/components/input'
Expand Down Expand Up @@ -76,6 +76,7 @@ export default [
PuikMenuItemTitle,
PuikProgressBar,
PuikIcon,
PuikIconCe,
PuikLink,
PuikCard,
PuikSnackbar,
Expand All @@ -87,6 +88,7 @@ export default [
PuikSelect,
PuikAlert,
PuikTooltip,
PuikTooltipCe,
PuikSwitch,
PuikButton,
PuikConfigProvider,
Expand Down
Loading

0 comments on commit 0a33c06

Please sign in to comment.