From 99db4b3598f1e09a28fe9de722e60d1a7e6c4671 Mon Sep 17 00:00:00 2001 From: Mike Lebeau Date: Tue, 16 Jan 2024 15:31:48 +0100 Subject: [PATCH 01/12] feat: add disabled state to icon --- packages/components/icon/src/icon.ts | 5 +++++ packages/components/icon/src/icon.vue | 8 +++++++- packages/components/icon/test/icon.spec.ts | 13 +++++++++++++ packages/tailwind-preset/theme.js | 3 ++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/packages/components/icon/src/icon.ts b/packages/components/icon/src/icon.ts index 008b7611..171fc2c8 100644 --- a/packages/components/icon/src/icon.ts +++ b/packages/components/icon/src/icon.ts @@ -26,6 +26,11 @@ export const iconProps = buildProps({ default: '#00000', required: false, }, + isDisabled: { + type: Boolean, + default: false, + required: false, + }, } as const) export type IconProps = ExtractPropTypes diff --git a/packages/components/icon/src/icon.vue b/packages/components/icon/src/icon.vue index b758ed5d..58c7407c 100644 --- a/packages/components/icon/src/icon.vue +++ b/packages/components/icon/src/icon.vue @@ -11,11 +11,15 @@ diff --git a/packages/components/icon/test/icon.spec.ts b/packages/components/icon/test/icon.spec.ts index 2c872007..0b91801c 100644 --- a/packages/components/icon/test/icon.spec.ts +++ b/packages/components/icon/test/icon.spec.ts @@ -33,6 +33,16 @@ describe('Icon tests', () => { expect(findIcon().text()).toBe('check') }) + it('should set the icon disabled', async () => { + factory({ + icon: 'check', + color: 'red', + isDisabled: true, + }) + + expect(findIcon().element.style.color).toBe('rgb(187, 187, 187)') + }) + it('should set the color', async () => { factory({ icon: 'check', @@ -74,3 +84,6 @@ describe('Icon tests', () => { expect(findIcon().attributes('data-test')).toBe('test') }) }) +function resolveConfig(tailwindConfig: any) { + throw new Error('Function not implemented.') +} diff --git a/packages/tailwind-preset/theme.js b/packages/tailwind-preset/theme.js index 61568df3..7ebe549b 100644 --- a/packages/tailwind-preset/theme.js +++ b/packages/tailwind-preset/theme.js @@ -1,4 +1,5 @@ -module.exports = { +/** @type {import('tailwindcss').Config} */ +export default { extend: { colors: { primary: { From b1b0a42326c402cd195baf0eb8504d4c86c8e730 Mon Sep 17 00:00:00 2001 From: ClaraLpresta Date: Fri, 26 Jan 2024 19:27:18 +0400 Subject: [PATCH 02/12] feat: articles variant added to link component --- packages/components/link/src/link.ts | 5 +++++ packages/components/link/src/link.vue | 1 + .../components/link/stories/link.stories.ts | 11 ++++++++++- packages/components/link/test/link.spec.ts | 5 +++++ packages/theme/src/link.scss | 19 ++++++++++++++----- 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/packages/components/link/src/link.ts b/packages/components/link/src/link.ts index f0e53676..5bd2c74f 100644 --- a/packages/components/link/src/link.ts +++ b/packages/components/link/src/link.ts @@ -64,6 +64,11 @@ export const linkProps = buildProps({ required: false, default: false, }, + articles: { + type: Boolean, + required: false, + default: false, + }, } as const) export type LinkProps = ExtractPropTypes diff --git a/packages/components/link/src/link.vue b/packages/components/link/src/link.vue index e55b3a7b..fd7e762d 100644 --- a/packages/components/link/src/link.vue +++ b/packages/components/link/src/link.vue @@ -8,6 +8,7 @@ 'puik-link', `puik-link--${size}`, { 'puik-link--high-contrast': highContrast }, + { 'puik-link--articles': articles }, ]" :data-test="dataTest" > diff --git a/packages/components/link/stories/link.stories.ts b/packages/components/link/stories/link.stories.ts index b250803d..86f7208b 100644 --- a/packages/components/link/stories/link.stories.ts +++ b/packages/components/link/stories/link.stories.ts @@ -47,7 +47,16 @@ export default { }, highContrast: { description: - 'Sets the link in high contrast mode by disabling the purple color for the visited stated', + 'Sets the link in high contrast mode by changing the gray underline color', + table: { + defaultValue: { + summary: false, + }, + }, + }, + articles: { + description: + 'Sets the link in articles mode, adding the purple color for the visited stated', table: { defaultValue: { summary: false, diff --git a/packages/components/link/test/link.spec.ts b/packages/components/link/test/link.spec.ts index 3f02469c..b3cab39b 100644 --- a/packages/components/link/test/link.spec.ts +++ b/packages/components/link/test/link.spec.ts @@ -46,4 +46,9 @@ describe('Link tests', () => { factory({ highContrast: true }) expect(findLink().classes()).toContain('puik-link--high-contrast') }) + + it('should set the link in articles mode', () => { + factory({ articles: true }) + expect(findLink().classes()).toContain('puik-link--articles') + }) }) diff --git a/packages/theme/src/link.scss b/packages/theme/src/link.scss index ecd814e4..d721aad2 100644 --- a/packages/theme/src/link.scss +++ b/packages/theme/src/link.scss @@ -14,7 +14,8 @@ duration-150; &:hover, - &:active { + &:active, + &:visited { @apply decoration-primary underline-offset-[5px]; } @@ -22,10 +23,6 @@ @apply outline-none ring-2 ring-blue rounded-[4px] shadow-none; } - &:visited { - @apply text-purple-700; - } - &__target__icon { @apply font-materialIcons align-bottom; @@ -52,4 +49,16 @@ } @apply decoration-primary; } + + &--articles { + @apply decoration-primary-500; + + &:visited { + @apply text-purple-700 decoration-primary-500; + } + + &:focus-visible { + @apply decoration-primary-800; + } + } } From 651f07d7d2c4830dbf705f8cd3660fd7ae4c9abf Mon Sep 17 00:00:00 2001 From: Mike Lebeau Date: Tue, 23 Jan 2024 11:01:36 +0100 Subject: [PATCH 03/12] feat: allow to use tailwindconf inside componenent --- build/package.json | 1 + build/src/tasks/full-bundle.ts | 3 ++ build/src/tasks/modules.ts | 2 ++ .../components/icon/stories/icon.stories.ts | 7 +++++ packages/puik/tsconfig.json | 6 ++++ packages/tailwind-preset/index.js | 7 +++-- packages/theme/tailwind.config.js | 4 ++- packages/theme/tsconfig.json | 5 ---- pnpm-lock.yaml | 28 +++++++++++++++---- 9 files changed, 49 insertions(+), 14 deletions(-) create mode 100644 packages/puik/tsconfig.json delete mode 100644 packages/theme/tsconfig.json diff --git a/build/package.json b/build/package.json index de93ee44..ac0f6d52 100644 --- a/build/package.json +++ b/build/package.json @@ -36,6 +36,7 @@ "devDependencies": { "@esbuild-kit/cjs-loader": "^2.4.2", "@pnpm/types": "^9.0.0", + "@rollup/plugin-json": "^6.1.0", "@types/rollup-plugin-css-only": "^3.1.0", "unbuild": "^1.2.0", "vue": "^3.2.47" diff --git a/build/src/tasks/full-bundle.ts b/build/src/tasks/full-bundle.ts index 5585316f..a4e62147 100644 --- a/build/src/tasks/full-bundle.ts +++ b/build/src/tasks/full-bundle.ts @@ -8,6 +8,7 @@ import esbuild from 'rollup-plugin-esbuild' import { parallel } from 'gulp' import glob from 'fast-glob' import { camelCase, upperFirst } from 'lodash-unified' +import json from '@rollup/plugin-json' import { version } from '../../../packages/puik/version' import { PuikAlias } from '../plugins/puik-alias' import { @@ -48,6 +49,7 @@ async function buildFullEntry(minify: boolean) { 'process.env.NODE_ENV': JSON.stringify('production'), }, }), + json(), ], external: await generateExternal({ full: true }), }) @@ -97,6 +99,7 @@ async function buildFullLocale(minify: boolean) { sourceMap: minify, target, }), + json(), ], }) await writeBundles(bundle, [ diff --git a/build/src/tasks/modules.ts b/build/src/tasks/modules.ts index 04eec298..b4dfcdac 100644 --- a/build/src/tasks/modules.ts +++ b/build/src/tasks/modules.ts @@ -5,6 +5,7 @@ import { nodeResolve } from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import esbuild from 'rollup-plugin-esbuild' import glob from 'fast-glob' +import json from '@rollup/plugin-json' import { puikRoot, pkgRoot, @@ -44,6 +45,7 @@ export const buildModules = async () => { '.vue': 'ts', }, }), + json(), ], external: await generateExternal({ full: false }), treeshake: false, diff --git a/packages/components/icon/stories/icon.stories.ts b/packages/components/icon/stories/icon.stories.ts index 4aaffbb6..211b0c85 100644 --- a/packages/components/icon/stories/icon.stories.ts +++ b/packages/components/icon/stories/icon.stories.ts @@ -34,6 +34,12 @@ export default { dataTest: { description: 'Set the data-test attribute', }, + isDisabled: { + description: 'If the icon is disable', + control: { + type: 'boolean', + }, + }, }, } as Meta @@ -56,6 +62,7 @@ export const Default = { fontSize: 24, nodeType: 'span', dataTest: '', + isDisabled: false, }, parameters: { diff --git a/packages/puik/tsconfig.json b/packages/puik/tsconfig.json new file mode 100644 index 00000000..68bb7381 --- /dev/null +++ b/packages/puik/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "moduleResolution": "NodeNext", + "module": "NodeNext" + } +} diff --git a/packages/tailwind-preset/index.js b/packages/tailwind-preset/index.js index 92607c49..23cb9fe3 100644 --- a/packages/tailwind-preset/index.js +++ b/packages/tailwind-preset/index.js @@ -1,6 +1,7 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires -const Puiktheme = require('./theme') +// const Puiktheme = require('./theme') +import PuikTheme from './theme' -module.exports = { - theme: Puiktheme, +export default { + theme: PuikTheme, } diff --git a/packages/theme/tailwind.config.js b/packages/theme/tailwind.config.js index 6576bfeb..22f4999e 100644 --- a/packages/theme/tailwind.config.js +++ b/packages/theme/tailwind.config.js @@ -1,6 +1,8 @@ +import tailwindConfig from '@puik/tailwind-preset' + /* eslint-disable @typescript-eslint/no-var-requires */ module.exports = { - presets: [require('@puik/tailwind-preset')], + presets: [tailwindConfig], content: ['./src/**/*.scss'], plugins: [require('tailwind-scrollbar')({ nocompatible: true })], darkMode: 'class', // To remove if we wanna use the css' prefers-color-scheme feature (dark mode based on OS/browser preference) diff --git a/packages/theme/tsconfig.json b/packages/theme/tsconfig.json deleted file mode 100644 index 2f980427..00000000 --- a/packages/theme/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "esModuleInterop": true - } -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 828a42b7..24e9ba59 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -250,6 +250,9 @@ importers: '@pnpm/types': specifier: ^9.0.0 version: 9.0.0 + '@rollup/plugin-json': + specifier: ^6.1.0 + version: 6.1.0(rollup@3.20.2) '@types/rollup-plugin-css-only': specifier: ^3.1.0 version: 3.1.0 @@ -3469,16 +3472,16 @@ packages: magic-string: 0.27.0 rollup: 3.20.2 - /@rollup/plugin-json@6.0.0(rollup@3.20.2): - resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==} + /@rollup/plugin-json@6.1.0(rollup@3.20.2): + resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} engines: {node: '>=14.0.0'} peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0 + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 peerDependenciesMeta: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@rollup/pluginutils': 5.1.0(rollup@3.20.2) rollup: 3.20.2 dev: true @@ -3527,6 +3530,21 @@ packages: picomatch: 2.3.1 rollup: 3.20.2 + /@rollup/pluginutils@5.1.0(rollup@3.20.2): + resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@types/estree': 1.0.1 + estree-walker: 2.0.2 + picomatch: 2.3.1 + rollup: 3.20.2 + dev: true + /@sinclair/typebox@0.27.8: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true @@ -14560,7 +14578,7 @@ packages: dependencies: '@rollup/plugin-alias': 4.0.4(rollup@3.20.2) '@rollup/plugin-commonjs': 24.1.0(rollup@3.20.2) - '@rollup/plugin-json': 6.0.0(rollup@3.20.2) + '@rollup/plugin-json': 6.1.0(rollup@3.20.2) '@rollup/plugin-node-resolve': 15.0.2(rollup@3.20.2) '@rollup/plugin-replace': 5.0.2(rollup@3.20.2) '@rollup/pluginutils': 5.0.2(rollup@3.20.2) From f2c5d6ecaaf180b1c82983498ed35c6adb4c24ea Mon Sep 17 00:00:00 2001 From: Matthias Goudjil Date: Mon, 29 Jan 2024 14:53:56 +0100 Subject: [PATCH 04/12] fix: #304 update storybook + refacto syntax of the table emits definitions --- package.json | 4 +-- packages/components/table/src/table.vue | 10 +++--- .../components/table/stories/table.stories.ts | 31 +++++++++++++------ playground/package.json | 2 +- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index c958d2f3..85cefeaf 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "not op_mini all" ], "peerDependencies": { - "vue": "^3.4.14" + "vue": "^3.2.0" }, "dependencies": { "@headlessui/vue": "^1.7.13", @@ -108,7 +108,7 @@ "typescript": "^5.0.4", "unplugin-vue-define-options": "^1.3.3", "vitest": "^0.32.4", - "vue": "^3.4.14", + "vue": "^3.2.47", "vue-router": "^4.1.6", "vue-tsc": "^1.2.0" } diff --git a/packages/components/table/src/table.vue b/packages/components/table/src/table.vue index 6ff25f72..4bf786d2 100644 --- a/packages/components/table/src/table.vue +++ b/packages/components/table/src/table.vue @@ -378,11 +378,11 @@ defineOptions({ const props = defineProps(tableProps) const emit = defineEmits<{ - (e: 'select', index: number): void - (e: 'select:all'): void - (e: 'update:selection', value: number[]): void - (e: 'sortColumn', column: sortOption): void - (e: 'searchSubmit', column: searchOption[]): void + select: [index: number] + 'select:all': [] + 'update:selection': [value: number[]] + sortColumn: [column: sortOption] + searchSubmit: [column: searchOption[]] }>() const { t } = useLocale() diff --git a/packages/components/table/stories/table.stories.ts b/packages/components/table/stories/table.stories.ts index 786d1167..9937b0ac 100644 --- a/packages/components/table/stories/table.stories.ts +++ b/packages/components/table/stories/table.stories.ts @@ -47,14 +47,21 @@ export default { import type { PuikTableHeader } from '@prestashopcorp/puik/es/components/table/src/table' interface PuikTableHeader { - text: string | undefined value: string - size: 'sm' | 'md' | 'lg' | undefined - width: string | undefined - align: 'left' | 'center' | 'right' | undefined - sortable: boolean | undefined - searchable: boolean | undefined - preventExpand: boolean | undefined + text?: string + size?: 'sm' | 'md' | 'lg' + align?: 'left' | 'center' | 'right' + width?: string + sortable?: boolean + preventExpand?: boolean + searchable?: boolean + searchSubmit?: boolean + searchType?: {$PuikTableSearchInputTypes} + } + + enum PuikTableSearchInputTypes { + Text = 'text', + Range = 'range', } `, }, @@ -216,8 +223,10 @@ export default { description: 'Event emitted when sorting a column', table: { type: { - summary: 'sortOption', + summary: 'event => sortOption', detail: ` +// Payload type = sortOption + import type { sortOption } from '@prestashopcorp/puik/es/components/table/src/table' type sortOption = { @@ -233,9 +242,11 @@ type sortOption = { control: 'none', table: { type: { - summary: 'event', + summary: 'event => SearchOption[]', detail: ` -Payload type = Array +// Payload type = Array + +import type { searchOption } from '@prestashopcorp/puik/es/components/table/src/table' type searchOption = { searchBy: string; diff --git a/playground/package.json b/playground/package.json index 861a9d8d..3594e127 100644 --- a/playground/package.json +++ b/playground/package.json @@ -8,7 +8,7 @@ "preview": "vite preview" }, "dependencies": { - "vue": "^3.4.14" + "vue": "3.3.10" }, "devDependencies": { "@vitejs/plugin-vue": "^4.1.0", From fd2cfb5a3e4c4465ee5cbb50792540f1592fce63 Mon Sep 17 00:00:00 2001 From: Matthias Goudjil Date: Mon, 29 Jan 2024 15:06:08 +0100 Subject: [PATCH 05/12] build: update pnpm-lockfile --- pnpm-lock.yaml | 159 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 108 insertions(+), 51 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 828a42b7..1385019d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: dependencies: '@headlessui/vue': specifier: ^1.7.13 - version: 1.7.13(vue@3.4.14) + version: 1.7.13(vue@3.3.10) '@popperjs/core': specifier: ^2.11.7 version: 2.11.7 @@ -37,7 +37,7 @@ importers: version: link:packages/utils '@vueuse/core': specifier: ^9.13.0 - version: 9.13.0(vue@3.4.14) + version: 9.13.0(vue@3.3.10) lodash-es: specifier: ^4.17.21 version: 4.17.21 @@ -95,13 +95,13 @@ importers: version: 5.58.0(eslint@8.38.0)(typescript@5.0.4) '@vitejs/plugin-vue': specifier: ^4.1.0 - version: 4.1.0(vite@4.2.1)(vue@3.4.14) + version: 4.1.0(vite@4.2.1)(vue@3.3.10) '@vitest/coverage-v8': specifier: ^0.32.4 version: 0.32.4(vitest@0.32.4) '@vue/test-utils': specifier: ^2.3.2 - version: 2.3.2(vue@3.4.14) + version: 2.3.2(vue@3.3.10) '@vue/tsconfig': specifier: ^0.1.3 version: 0.1.3(@types/node@18.15.11) @@ -176,16 +176,16 @@ importers: version: 5.0.4 unplugin-vue-define-options: specifier: ^1.3.3 - version: 1.3.3(vue@3.4.14) + version: 1.3.3(vue@3.3.10) vitest: specifier: ^0.32.4 version: 0.32.4(jsdom@21.1.1)(sass@1.62.0) vue: - specifier: ^3.4.14 - version: 3.4.14(typescript@5.0.4) + specifier: ^3.2.47 + version: 3.3.10(typescript@5.0.4) vue-router: specifier: ^4.1.6 - version: 4.1.6(vue@3.4.14) + version: 4.1.6(vue@3.3.10) vue-tsc: specifier: ^1.2.0 version: 1.2.0(typescript@5.0.4) @@ -431,12 +431,12 @@ importers: playground: dependencies: vue: - specifier: ^3.4.14 - version: 3.4.14(typescript@5.0.4) + specifier: 3.3.10 + version: 3.3.10(typescript@5.0.4) devDependencies: '@vitejs/plugin-vue': specifier: ^4.1.0 - version: 4.1.0(vite@4.2.1)(vue@3.4.14) + version: 4.1.0(vite@4.2.1)(vue@3.3.10) typescript: specifier: ^5.0.4 version: 5.0.4 @@ -2203,13 +2203,13 @@ packages: vue: 3.2.47 dev: false - /@headlessui/vue@1.7.13(vue@3.4.14): + /@headlessui/vue@1.7.13(vue@3.3.10): resolution: {integrity: sha512-obG5TdPdBDfs+jiA1mY29LPFqyJl93Q90EL86ontfRe1B6XvbjPkx+x1aAC5DA18bXbb0Juni1ayDbXo0w1u0A==} engines: {node: '>=10'} peerDependencies: vue: ^3.2.0 dependencies: - vue: 3.4.14(typescript@5.0.4) + vue: 3.3.10(typescript@5.0.4) dev: false /@humanwhocodes/config-array@0.11.8: @@ -5073,7 +5073,7 @@ packages: vite: 4.2.1(@types/node@18.15.11)(sass@1.62.0) vue: 3.2.47 - /@vitejs/plugin-vue@4.1.0(vite@4.2.1)(vue@3.4.14): + /@vitejs/plugin-vue@4.1.0(vite@4.2.1)(vue@3.3.10): resolution: {integrity: sha512-++9JOAFdcXI3lyer9UKUV4rfoQ3T1RN8yDqoCLar86s0xQct5yblxAE+yWgRnU5/0FOlVCpTZpYSBV/bGWrSrQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -5081,7 +5081,7 @@ packages: vue: ^3.2.25 dependencies: vite: 4.2.1(@types/node@18.15.11)(sass@1.62.0) - vue: 3.4.14(typescript@5.0.4) + vue: 3.3.10(typescript@5.0.4) dev: true /@vitest/coverage-v8@0.32.4(vitest@0.32.4): @@ -5201,7 +5201,7 @@ packages: - rollup dev: false - /@vue-macros/common@1.2.0(vue@3.4.14): + /@vue-macros/common@1.2.0(vue@3.3.10): resolution: {integrity: sha512-lQglnRn+8wkdAhmGQbrI0mo4SzRuY5KBjst0qi8LBDYllFKtI2brapbewUME1AXnXbVett0SRDnB2EdZXyzCmw==} engines: {node: '>=14.19.0'} peerDependencies: @@ -5215,7 +5215,7 @@ packages: '@vue/compiler-sfc': 3.4.14 local-pkg: 0.4.3 magic-string-ast: 0.1.2 - vue: 3.4.14(typescript@5.0.4) + vue: 3.3.10(typescript@5.0.4) transitivePeerDependencies: - rollup dev: true @@ -5228,6 +5228,14 @@ packages: estree-walker: 2.0.2 source-map: 0.6.1 + /@vue/compiler-core@3.3.10: + resolution: {integrity: sha512-doe0hODR1+i1menPkRzJ5MNR6G+9uiZHIknK3Zn5OcIztu6GGw7u0XUzf3AgB8h/dfsZC9eouzoLo3c3+N/cVA==} + dependencies: + '@babel/parser': 7.23.6 + '@vue/shared': 3.3.10 + estree-walker: 2.0.2 + source-map-js: 1.0.2 + /@vue/compiler-core@3.4.14: resolution: {integrity: sha512-ro4Zzl/MPdWs7XwxT7omHRxAjMbDFRZEEjD+2m3NBf8YzAe3HuoSEZosXQo+m1GQ1G3LQ1LdmNh1RKTYe+ssEg==} dependencies: @@ -5243,6 +5251,12 @@ packages: '@vue/compiler-core': 3.2.47 '@vue/shared': 3.2.47 + /@vue/compiler-dom@3.3.10: + resolution: {integrity: sha512-NCrqF5fm10GXZIK0GrEAauBqdy+F2LZRt3yNHzrYjpYBuRssQbuPLtSnSNjyR9luHKkWSH8we5LMB3g+4z2HvA==} + dependencies: + '@vue/compiler-core': 3.3.10 + '@vue/shared': 3.3.10 + /@vue/compiler-dom@3.4.14: resolution: {integrity: sha512-nOZTY+veWNa0DKAceNWxorAbWm0INHdQq7cejFaWM1WYnoNSJbSEKYtE7Ir6lR/+mo9fttZpPVI9ZFGJ1juUEQ==} dependencies: @@ -5263,6 +5277,20 @@ packages: postcss: 8.4.31 source-map: 0.6.1 + /@vue/compiler-sfc@3.3.10: + resolution: {integrity: sha512-xpcTe7Rw7QefOTRFFTlcfzozccvjM40dT45JtrE3onGm/jBLZ0JhpKu3jkV7rbDFLeeagR/5RlJ2Y9SvyS0lAg==} + dependencies: + '@babel/parser': 7.23.6 + '@vue/compiler-core': 3.3.10 + '@vue/compiler-dom': 3.3.10 + '@vue/compiler-ssr': 3.3.10 + '@vue/reactivity-transform': 3.3.10 + '@vue/shared': 3.3.10 + estree-walker: 2.0.2 + magic-string: 0.30.5 + postcss: 8.4.33 + source-map-js: 1.0.2 + /@vue/compiler-sfc@3.4.14: resolution: {integrity: sha512-1vHc9Kv1jV+YBZC/RJxQJ9JCxildTI+qrhtDh6tPkR1O8S+olBUekimY0km0ZNn8nG1wjtFAe9XHij+YLR8cRQ==} dependencies: @@ -5282,6 +5310,12 @@ packages: '@vue/compiler-dom': 3.2.47 '@vue/shared': 3.2.47 + /@vue/compiler-ssr@3.3.10: + resolution: {integrity: sha512-12iM4jA4GEbskwXMmPcskK5wImc2ohKm408+o9iox3tfN9qua8xL0THIZtoe9OJHnXP4eOWZpgCAAThEveNlqQ==} + dependencies: + '@vue/compiler-dom': 3.3.10 + '@vue/shared': 3.3.10 + /@vue/compiler-ssr@3.4.14: resolution: {integrity: sha512-bXT6+oAGlFjTYVOTtFJ4l4Jab1wjsC0cfSfOe2B4Z0N2vD2zOBSQ9w694RsCfhjk+bC2DY5Gubb1rHZVii107Q==} dependencies: @@ -5301,15 +5335,24 @@ packages: estree-walker: 2.0.2 magic-string: 0.25.9 + /@vue/reactivity-transform@3.3.10: + resolution: {integrity: sha512-0xBdk+CKHWT+Gev8oZ63Tc0qFfj935YZx+UAynlutnrDZ4diFCVFMWixn65HzjE3S1iJppWOo6Tt1OzASH7VEg==} + dependencies: + '@babel/parser': 7.23.6 + '@vue/compiler-core': 3.3.10 + '@vue/shared': 3.3.10 + estree-walker: 2.0.2 + magic-string: 0.30.5 + /@vue/reactivity@3.2.47: resolution: {integrity: sha512-7khqQ/75oyyg+N/e+iwV6lpy1f5wq759NdlS1fpAhFXa8VeAIKGgk2E/C4VF59lx5b+Ezs5fpp/5WsRYXQiKxQ==} dependencies: '@vue/shared': 3.2.47 - /@vue/reactivity@3.4.14: - resolution: {integrity: sha512-xRYwze5Q4tK7tT2J4uy4XLhK/AIXdU5EBUu9PLnIHcOKXO0uyXpNNMzlQKuq7B+zwtq6K2wuUL39pHA6ZQzObw==} + /@vue/reactivity@3.3.10: + resolution: {integrity: sha512-H5Z7rOY/JLO+e5a6/FEXaQ1TMuOvY4LDVgT+/+HKubEAgs9qeeZ+NhADSeEtrNQeiKLDuzeKc8v0CUFpB6Pqgw==} dependencies: - '@vue/shared': 3.4.14 + '@vue/shared': 3.3.10 /@vue/runtime-core@3.2.47: resolution: {integrity: sha512-RZxbLQIRB/K0ev0K9FXhNbBzT32H9iRtYbaXb0ZIz2usLms/D55dJR2t6cIEUn6vyhS3ALNvNthI+Q95C+NOpA==} @@ -5317,11 +5360,11 @@ packages: '@vue/reactivity': 3.2.47 '@vue/shared': 3.2.47 - /@vue/runtime-core@3.4.14: - resolution: {integrity: sha512-qu+NMkfujCoZL6cfqK5NOfxgXJROSlP2ZPs4CTcVR+mLrwl4TtycF5Tgo0QupkdBL+2kigc6EsJlTcuuZC1NaQ==} + /@vue/runtime-core@3.3.10: + resolution: {integrity: sha512-DZ0v31oTN4YHX9JEU5VW1LoIVgFovWgIVb30bWn9DG9a7oA415idcwsRNNajqTx8HQJyOaWfRKoyuP2P2TYIag==} dependencies: - '@vue/reactivity': 3.4.14 - '@vue/shared': 3.4.14 + '@vue/reactivity': 3.3.10 + '@vue/shared': 3.3.10 /@vue/runtime-dom@3.2.47: resolution: {integrity: sha512-ArXrFTjS6TsDei4qwNvgrdmHtD930KgSKGhS5M+j8QxXrDJYLqYw4RRcDy1bz1m1wMmb6j+zGLifdVHtkXA7gA==} @@ -5330,11 +5373,11 @@ packages: '@vue/shared': 3.2.47 csstype: 2.6.21 - /@vue/runtime-dom@3.4.14: - resolution: {integrity: sha512-B85XmcR4E7XsirEHVqhmy4HPbRT9WLFWV9Uhie3OapV9m1MEN9+Er6hmUIE6d8/l2sUygpK9RstFM2bmHEUigA==} + /@vue/runtime-dom@3.3.10: + resolution: {integrity: sha512-c/jKb3ny05KJcYk0j1m7Wbhrxq7mZYr06GhKykDMNRRR9S+/dGT8KpHuNQjv3/8U4JshfkAk6TpecPD3B21Ijw==} dependencies: - '@vue/runtime-core': 3.4.14 - '@vue/shared': 3.4.14 + '@vue/runtime-core': 3.3.10 + '@vue/shared': 3.3.10 csstype: 3.1.3 /@vue/server-renderer@3.2.47(vue@3.2.47): @@ -5346,31 +5389,45 @@ packages: '@vue/shared': 3.2.47 vue: 3.2.47 - /@vue/server-renderer@3.4.14(vue@3.4.14): + /@vue/server-renderer@3.3.10(vue@3.3.10): + resolution: {integrity: sha512-0i6ww3sBV3SKlF3YTjSVqKQ74xialMbjVYGy7cOTi7Imd8ediE7t72SK3qnvhrTAhOvlQhq6Bk6nFPdXxe0sAg==} + peerDependencies: + vue: 3.3.10 + dependencies: + '@vue/compiler-ssr': 3.3.10 + '@vue/shared': 3.3.10 + vue: 3.3.10(typescript@5.0.4) + + /@vue/server-renderer@3.4.14(vue@3.3.10): resolution: {integrity: sha512-pwSKXQfYdJBTpvWHGEYI+akDE18TXAiLcGn+Q/2Fj8wQSHWztoo7PSvfMNqu6NDhp309QXXbPFEGCU5p85HqkA==} peerDependencies: vue: 3.4.14 dependencies: '@vue/compiler-ssr': 3.4.14 '@vue/shared': 3.4.14 - vue: 3.4.14(typescript@5.0.4) + vue: 3.3.10(typescript@5.0.4) + dev: true + optional: true /@vue/shared@3.2.47: resolution: {integrity: sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==} + /@vue/shared@3.3.10: + resolution: {integrity: sha512-2y3Y2J1a3RhFa0WisHvACJR2ncvWiVHcP8t0Inxo+NKz+8RKO4ZV8eZgCxRgQoA6ITfV12L4E6POOL9HOU5nqw==} + /@vue/shared@3.4.14: resolution: {integrity: sha512-nmi3BtLpvqXAWoRZ6HQ+pFJOHBU4UnH3vD3opgmwXac7vhaHKA9nj1VeGjMggdB9eLtW83eHyPCmOU1qzdsC7Q==} - /@vue/test-utils@2.3.2(vue@3.4.14): + /@vue/test-utils@2.3.2(vue@3.3.10): resolution: {integrity: sha512-hJnVaYhbrIm0yBS0+e1Y0Sj85cMyAi+PAbK4JHqMRUZ6S622Goa+G7QzkRSyvCteG8wop7tipuEbHoZo26wsSA==} peerDependencies: vue: ^3.0.1 dependencies: js-beautify: 1.14.6 - vue: 3.4.14(typescript@5.0.4) + vue: 3.3.10(typescript@5.0.4) optionalDependencies: '@vue/compiler-dom': 3.4.14 - '@vue/server-renderer': 3.4.14(vue@3.4.14) + '@vue/server-renderer': 3.4.14(vue@3.3.10) dev: true /@vue/tsconfig@0.1.3(@types/node@18.15.11): @@ -5396,13 +5453,13 @@ packages: - vue dev: false - /@vueuse/core@9.13.0(vue@3.4.14): + /@vueuse/core@9.13.0(vue@3.3.10): resolution: {integrity: sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==} dependencies: '@types/web-bluetooth': 0.0.16 '@vueuse/metadata': 9.13.0 - '@vueuse/shared': 9.13.0(vue@3.4.14) - vue-demi: 0.14.0(vue@3.4.14) + '@vueuse/shared': 9.13.0(vue@3.3.10) + vue-demi: 0.14.0(vue@3.3.10) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -5421,10 +5478,10 @@ packages: - vue dev: false - /@vueuse/shared@9.13.0(vue@3.4.14): + /@vueuse/shared@9.13.0(vue@3.3.10): resolution: {integrity: sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==} dependencies: - vue-demi: 0.14.0(vue@3.4.14) + vue-demi: 0.14.0(vue@3.3.10) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -14754,11 +14811,11 @@ packages: - vue dev: false - /unplugin-vue-define-options@1.3.3(vue@3.4.14): + /unplugin-vue-define-options@1.3.3(vue@3.3.10): resolution: {integrity: sha512-gSBR84QJZUYhiLlQzJ8dQ9BCUAnnfWf+sTqhxXpzoL/nWH3sQqlGWznQtUPKTqQZdupQr1DCIVvLYMQD1/4X6g==} engines: {node: '>=14.19.0'} dependencies: - '@vue-macros/common': 1.2.0(vue@3.4.14) + '@vue-macros/common': 1.2.0(vue@3.3.10) ast-walker-scope: 0.4.1 unplugin: 1.3.1 transitivePeerDependencies: @@ -15152,7 +15209,7 @@ packages: vue: 3.2.47 dev: false - /vue-demi@0.14.0(vue@3.4.14): + /vue-demi@0.14.0(vue@3.3.10): resolution: {integrity: sha512-gt58r2ogsNQeVoQ3EhoUAvUsH9xviydl0dWJj7dabBC/2L4uBId7ujtCwDRD0JhkGsV1i0CtfLAeyYKBht9oWg==} engines: {node: '>=12'} hasBin: true @@ -15164,7 +15221,7 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.4.14(typescript@5.0.4) + vue: 3.3.10(typescript@5.0.4) dev: false /vue-docgen-api@4.71.0(vue@3.2.47): @@ -15220,13 +15277,13 @@ packages: vue: 3.2.47 dev: true - /vue-router@4.1.6(vue@3.4.14): + /vue-router@4.1.6(vue@3.3.10): resolution: {integrity: sha512-DYWYwsG6xNPmLq/FmZn8Ip+qrhFEzA14EI12MsMgVxvHFDYvlr4NXpVF5hrRH1wVcDP8fGi5F4rxuJSl8/r+EQ==} peerDependencies: vue: ^3.2.0 dependencies: '@vue/devtools-api': 6.5.0 - vue: 3.4.14(typescript@5.0.4) + vue: 3.3.10(typescript@5.0.4) dev: true /vue-template-compiler@2.7.14: @@ -15256,19 +15313,19 @@ packages: '@vue/server-renderer': 3.2.47(vue@3.2.47) '@vue/shared': 3.2.47 - /vue@3.4.14(typescript@5.0.4): - resolution: {integrity: sha512-Rop5Al/ZcBbBz+KjPZaZDgHDX0kUP4duEzDbm+1o91uxYUNmJrZSBuegsNIJvUGy+epLevNRNhLjm08VKTgGyw==} + /vue@3.3.10(typescript@5.0.4): + resolution: {integrity: sha512-zg6SIXZdTBwiqCw/1p+m04VyHjLfwtjwz8N57sPaBhEex31ND0RYECVOC1YrRwMRmxFf5T1dabl6SGUbMKKuVw==} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@vue/compiler-dom': 3.4.14 - '@vue/compiler-sfc': 3.4.14 - '@vue/runtime-dom': 3.4.14 - '@vue/server-renderer': 3.4.14(vue@3.4.14) - '@vue/shared': 3.4.14 + '@vue/compiler-dom': 3.3.10 + '@vue/compiler-sfc': 3.3.10 + '@vue/runtime-dom': 3.3.10 + '@vue/server-renderer': 3.3.10(vue@3.3.10) + '@vue/shared': 3.3.10 typescript: 5.0.4 /w3c-xmlserializer@4.0.0: From 120829e4ff6d115903ca6f458471b54755b704d5 Mon Sep 17 00:00:00 2001 From: Matthias Goudjil Date: Mon, 29 Jan 2024 15:10:01 +0100 Subject: [PATCH 06/12] fix: rollback syntax of table emit definitions --- packages/components/table/src/table.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/table/src/table.vue b/packages/components/table/src/table.vue index 4bf786d2..6ff25f72 100644 --- a/packages/components/table/src/table.vue +++ b/packages/components/table/src/table.vue @@ -378,11 +378,11 @@ defineOptions({ const props = defineProps(tableProps) const emit = defineEmits<{ - select: [index: number] - 'select:all': [] - 'update:selection': [value: number[]] - sortColumn: [column: sortOption] - searchSubmit: [column: searchOption[]] + (e: 'select', index: number): void + (e: 'select:all'): void + (e: 'update:selection', value: number[]): void + (e: 'sortColumn', column: sortOption): void + (e: 'searchSubmit', column: searchOption[]): void }>() const { t } = useLocale() From 5f5fbbf6744abd471b9faf2895cd28e337a86ca2 Mon Sep 17 00:00:00 2001 From: ClaraLpresta Date: Wed, 31 Jan 2024 18:40:52 +0400 Subject: [PATCH 07/12] fix: articles added to link component storybook --- packages/components/link/stories/link.stories.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/components/link/stories/link.stories.ts b/packages/components/link/stories/link.stories.ts index 86f7208b..651324c0 100644 --- a/packages/components/link/stories/link.stories.ts +++ b/packages/components/link/stories/link.stories.ts @@ -80,6 +80,7 @@ export default { to: undefined, target: '_self', highContrast: false, + articles: false, default: "I'm a cool link", title: "I'm a tooltip for your link", size: 'md', From 46aefe417d6a347eef48a30f92e0246daa64ae4e Mon Sep 17 00:00:00 2001 From: Matthias Goudjil Date: Thu, 1 Feb 2024 12:03:50 +0100 Subject: [PATCH 08/12] fix: rollup-config --- build/package.json | 2 +- build/src/tasks/full-bundle.ts | 3 --- build/src/tasks/modules.ts | 2 -- packages/components/icon/src/icon.vue | 10 ++++----- packages/puik/tsconfig.json | 6 ----- packages/tailwind-preset/index.js | 7 +++--- packages/tailwind-preset/theme.js | 3 +-- packages/theme/src/icon.scss | 3 +++ packages/theme/tailwind.config.js | 4 +--- packages/theme/tsconfig.json | 5 +++++ playground/.gitignore | 3 +++ pnpm-lock.yaml | 32 ++++++++++++++++++++++++--- 12 files changed, 50 insertions(+), 30 deletions(-) delete mode 100644 packages/puik/tsconfig.json create mode 100644 packages/theme/tsconfig.json diff --git a/build/package.json b/build/package.json index ac0f6d52..2701a110 100644 --- a/build/package.json +++ b/build/package.json @@ -36,8 +36,8 @@ "devDependencies": { "@esbuild-kit/cjs-loader": "^2.4.2", "@pnpm/types": "^9.0.0", - "@rollup/plugin-json": "^6.1.0", "@types/rollup-plugin-css-only": "^3.1.0", + "rollup-plugin-polyfill-node": "^0.13.0", "unbuild": "^1.2.0", "vue": "^3.2.47" } diff --git a/build/src/tasks/full-bundle.ts b/build/src/tasks/full-bundle.ts index a4e62147..5585316f 100644 --- a/build/src/tasks/full-bundle.ts +++ b/build/src/tasks/full-bundle.ts @@ -8,7 +8,6 @@ import esbuild from 'rollup-plugin-esbuild' import { parallel } from 'gulp' import glob from 'fast-glob' import { camelCase, upperFirst } from 'lodash-unified' -import json from '@rollup/plugin-json' import { version } from '../../../packages/puik/version' import { PuikAlias } from '../plugins/puik-alias' import { @@ -49,7 +48,6 @@ async function buildFullEntry(minify: boolean) { 'process.env.NODE_ENV': JSON.stringify('production'), }, }), - json(), ], external: await generateExternal({ full: true }), }) @@ -99,7 +97,6 @@ async function buildFullLocale(minify: boolean) { sourceMap: minify, target, }), - json(), ], }) await writeBundles(bundle, [ diff --git a/build/src/tasks/modules.ts b/build/src/tasks/modules.ts index b4dfcdac..04eec298 100644 --- a/build/src/tasks/modules.ts +++ b/build/src/tasks/modules.ts @@ -5,7 +5,6 @@ import { nodeResolve } from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import esbuild from 'rollup-plugin-esbuild' import glob from 'fast-glob' -import json from '@rollup/plugin-json' import { puikRoot, pkgRoot, @@ -45,7 +44,6 @@ export const buildModules = async () => { '.vue': 'ts', }, }), - json(), ], external: await generateExternal({ full: false }), treeshake: false, diff --git a/packages/components/icon/src/icon.vue b/packages/components/icon/src/icon.vue index 58c7407c..4eed957c 100644 --- a/packages/components/icon/src/icon.vue +++ b/packages/components/icon/src/icon.vue @@ -4,6 +4,9 @@ class="puik-icon" :style="style" :data-test="dataTest" + :class="{ + 'puik-icon--disabled': isDisabled, + }" > {{ icon }} @@ -11,15 +14,12 @@ diff --git a/packages/puik/tsconfig.json b/packages/puik/tsconfig.json deleted file mode 100644 index 68bb7381..00000000 --- a/packages/puik/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "NodeNext", - "module": "NodeNext" - } -} diff --git a/packages/tailwind-preset/index.js b/packages/tailwind-preset/index.js index 23cb9fe3..92607c49 100644 --- a/packages/tailwind-preset/index.js +++ b/packages/tailwind-preset/index.js @@ -1,7 +1,6 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires -// const Puiktheme = require('./theme') -import PuikTheme from './theme' +const Puiktheme = require('./theme') -export default { - theme: PuikTheme, +module.exports = { + theme: Puiktheme, } diff --git a/packages/tailwind-preset/theme.js b/packages/tailwind-preset/theme.js index 7ebe549b..61568df3 100644 --- a/packages/tailwind-preset/theme.js +++ b/packages/tailwind-preset/theme.js @@ -1,5 +1,4 @@ -/** @type {import('tailwindcss').Config} */ -export default { +module.exports = { extend: { colors: { primary: { diff --git a/packages/theme/src/icon.scss b/packages/theme/src/icon.scss index 54bfde56..2ad0f820 100644 --- a/packages/theme/src/icon.scss +++ b/packages/theme/src/icon.scss @@ -1,3 +1,6 @@ .puik-icon { @apply font-materialIcons leading-none; } +.puik-icon--disabled { + color: theme('colors.primary.500') !important; +} diff --git a/packages/theme/tailwind.config.js b/packages/theme/tailwind.config.js index 22f4999e..6576bfeb 100644 --- a/packages/theme/tailwind.config.js +++ b/packages/theme/tailwind.config.js @@ -1,8 +1,6 @@ -import tailwindConfig from '@puik/tailwind-preset' - /* eslint-disable @typescript-eslint/no-var-requires */ module.exports = { - presets: [tailwindConfig], + presets: [require('@puik/tailwind-preset')], content: ['./src/**/*.scss'], plugins: [require('tailwind-scrollbar')({ nocompatible: true })], darkMode: 'class', // To remove if we wanna use the css' prefers-color-scheme feature (dark mode based on OS/browser preference) diff --git a/packages/theme/tsconfig.json b/packages/theme/tsconfig.json new file mode 100644 index 00000000..2f980427 --- /dev/null +++ b/packages/theme/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "esModuleInterop": true + } +} diff --git a/playground/.gitignore b/playground/.gitignore index a547bf36..1f2d1ba9 100644 --- a/playground/.gitignore +++ b/playground/.gitignore @@ -22,3 +22,6 @@ dist-ssr *.njsproj *.sln *.sw? + +# views directory +views diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 94d55343..03c6a895 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -250,12 +250,12 @@ importers: '@pnpm/types': specifier: ^9.0.0 version: 9.0.0 - '@rollup/plugin-json': - specifier: ^6.1.0 - version: 6.1.0(rollup@3.20.2) '@types/rollup-plugin-css-only': specifier: ^3.1.0 version: 3.1.0 + rollup-plugin-polyfill-node: + specifier: ^0.13.0 + version: 0.13.0(rollup@3.20.2) unbuild: specifier: ^1.2.0 version: 1.2.0(sass@1.62.0) @@ -3472,6 +3472,21 @@ packages: magic-string: 0.27.0 rollup: 3.20.2 + /@rollup/plugin-inject@5.0.5(rollup@3.20.2): + resolution: {integrity: sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.1.0(rollup@3.20.2) + estree-walker: 2.0.2 + magic-string: 0.30.5 + rollup: 3.20.2 + dev: true + /@rollup/plugin-json@6.1.0(rollup@3.20.2): resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} engines: {node: '>=14.0.0'} @@ -9616,6 +9631,7 @@ packages: /iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} + requiresBuild: true dependencies: safer-buffer: 2.1.2 @@ -13307,6 +13323,15 @@ packages: - supports-color dev: false + /rollup-plugin-polyfill-node@0.13.0(rollup@3.20.2): + resolution: {integrity: sha512-FYEvpCaD5jGtyBuBFcQImEGmTxDTPbiHjJdrYIp+mFIwgXiXabxvKUK7ZT9P31ozu2Tqm9llYQMRWsfvTMTAOw==} + peerDependencies: + rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 + dependencies: + '@rollup/plugin-inject': 5.0.5(rollup@3.20.2) + rollup: 3.20.2 + dev: true + /rollup@0.63.5: resolution: {integrity: sha512-dFf8LpUNzIj3oE0vCvobX6rqOzHzLBoblyFp+3znPbjiSmSvOoK2kMKx+Fv9jYduG1rvcCfCveSgEaQHjWRF6g==} hasBin: true @@ -13387,6 +13412,7 @@ packages: /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + requiresBuild: true /sass@1.62.0: resolution: {integrity: sha512-Q4USplo4pLYgCi+XlipZCWUQz5pkg/ruSSgJ0WRDSb/+3z9tXUOkQ7QPYn4XrhZKYAK4HlpaQecRwKLJX6+DBg==} From 63c24348cf339df8cd23e3278e53d5ef195522e1 Mon Sep 17 00:00:00 2001 From: Matthias Goudjil Date: Thu, 1 Feb 2024 12:10:14 +0100 Subject: [PATCH 09/12] test: update icon test (check disabled class) --- packages/components/icon/test/icon.spec.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/components/icon/test/icon.spec.ts b/packages/components/icon/test/icon.spec.ts index 0b91801c..48da78e6 100644 --- a/packages/components/icon/test/icon.spec.ts +++ b/packages/components/icon/test/icon.spec.ts @@ -40,7 +40,7 @@ describe('Icon tests', () => { isDisabled: true, }) - expect(findIcon().element.style.color).toBe('rgb(187, 187, 187)') + expect(findIcon().classes()).toContain('puik-icon--disabled') }) it('should set the color', async () => { @@ -84,6 +84,3 @@ describe('Icon tests', () => { expect(findIcon().attributes('data-test')).toBe('test') }) }) -function resolveConfig(tailwindConfig: any) { - throw new Error('Function not implemented.') -} From f1ea72bee0ef973c2b2d845025eb8ae35e48183a Mon Sep 17 00:00:00 2001 From: Matthias Goudjil Date: Thu, 1 Feb 2024 12:22:56 +0100 Subject: [PATCH 10/12] build: remove rollup-plugin-polyfill-node plugin --- build/package.json | 1 - pnpm-lock.yaml | 74 +++++++++++++++++++++++++--------------------- 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/build/package.json b/build/package.json index 2701a110..de93ee44 100644 --- a/build/package.json +++ b/build/package.json @@ -37,7 +37,6 @@ "@esbuild-kit/cjs-loader": "^2.4.2", "@pnpm/types": "^9.0.0", "@types/rollup-plugin-css-only": "^3.1.0", - "rollup-plugin-polyfill-node": "^0.13.0", "unbuild": "^1.2.0", "vue": "^3.2.47" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 03c6a895..415c4d4c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -253,12 +253,9 @@ importers: '@types/rollup-plugin-css-only': specifier: ^3.1.0 version: 3.1.0 - rollup-plugin-polyfill-node: - specifier: ^0.13.0 - version: 0.13.0(rollup@3.20.2) unbuild: specifier: ^1.2.0 - version: 1.2.0(sass@1.62.0) + version: 1.2.0 vue: specifier: ^3.2.47 version: 3.2.47 @@ -3472,21 +3469,6 @@ packages: magic-string: 0.27.0 rollup: 3.20.2 - /@rollup/plugin-inject@5.0.5(rollup@3.20.2): - resolution: {integrity: sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@rollup/pluginutils': 5.1.0(rollup@3.20.2) - estree-walker: 2.0.2 - magic-string: 0.30.5 - rollup: 3.20.2 - dev: true - /@rollup/plugin-json@6.1.0(rollup@3.20.2): resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} engines: {node: '>=14.0.0'} @@ -5103,7 +5085,7 @@ packages: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.2.1(@types/node@18.15.11)(sass@1.62.0) + vite: 4.2.1 vue: 3.2.47 /@vitejs/plugin-vue@4.1.0(vite@4.2.1)(vue@3.3.10): @@ -9657,6 +9639,7 @@ packages: /immutable@4.3.0: resolution: {integrity: sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==} + dev: true /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} @@ -11377,7 +11360,7 @@ packages: engines: {node: '>=10'} hasBin: true - /mkdist@1.2.0(sass@1.62.0)(typescript@5.0.4): + /mkdist@1.2.0(typescript@5.0.4): resolution: {integrity: sha512-UTqu/bXmIk/+VKNVgufAeMyjUcNy1dn9Bl7wL1zZlCKVrpDgj/VllmZBeh3ZCC/2HWqUrt6frNFTKt9TRZbNvQ==} hasBin: true peerDependencies: @@ -11397,7 +11380,6 @@ packages: mlly: 1.2.0 mri: 1.2.0 pathe: 1.1.0 - sass: 1.62.0 typescript: 5.0.4 dev: true @@ -12470,6 +12452,7 @@ packages: nanoid: 3.3.6 picocolors: 1.0.0 source-map-js: 1.0.2 + dev: true /postcss@8.4.31: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} @@ -13323,15 +13306,6 @@ packages: - supports-color dev: false - /rollup-plugin-polyfill-node@0.13.0(rollup@3.20.2): - resolution: {integrity: sha512-FYEvpCaD5jGtyBuBFcQImEGmTxDTPbiHjJdrYIp+mFIwgXiXabxvKUK7ZT9P31ozu2Tqm9llYQMRWsfvTMTAOw==} - peerDependencies: - rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 - dependencies: - '@rollup/plugin-inject': 5.0.5(rollup@3.20.2) - rollup: 3.20.2 - dev: true - /rollup@0.63.5: resolution: {integrity: sha512-dFf8LpUNzIj3oE0vCvobX6rqOzHzLBoblyFp+3znPbjiSmSvOoK2kMKx+Fv9jYduG1rvcCfCveSgEaQHjWRF6g==} hasBin: true @@ -13422,6 +13396,7 @@ packages: chokidar: 3.5.3 immutable: 4.3.0 source-map-js: 1.0.2 + dev: true /saxes@6.0.0: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} @@ -14655,7 +14630,7 @@ packages: which-boxed-primitive: 1.0.2 dev: true - /unbuild@1.2.0(sass@1.62.0): + /unbuild@1.2.0: resolution: {integrity: sha512-GcolNMBatav7FbRdLDR8BMbnYWMoKfxXdJIHibpBtx3GERN4GbbUD5h4RfGIFi+mjWPz4AphSz5gIg9FWNWw3Q==} hasBin: true dependencies: @@ -14673,7 +14648,7 @@ packages: hookable: 5.5.3 jiti: 1.18.2 magic-string: 0.30.0 - mkdist: 1.2.0(sass@1.62.0)(typescript@5.0.4) + mkdist: 1.2.0(typescript@5.0.4) mlly: 1.2.0 mri: 1.2.0 pathe: 1.1.0 @@ -15130,6 +15105,38 @@ packages: - terser dev: true + /vite@4.2.1: + resolution: {integrity: sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + esbuild: 0.17.16 + postcss: 8.4.33 + resolve: 1.22.2 + rollup: 3.20.2 + optionalDependencies: + fsevents: 2.3.2 + /vite@4.2.1(@types/node@18.15.11)(sass@1.62.0): resolution: {integrity: sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==} engines: {node: ^14.18.0 || >=16.0.0} @@ -15163,6 +15170,7 @@ packages: sass: 1.62.0 optionalDependencies: fsevents: 2.3.2 + dev: true /vitest@0.32.4(jsdom@21.1.1)(sass@1.62.0): resolution: {integrity: sha512-3czFm8RnrsWwIzVDu/Ca48Y/M+qh3vOnF16czJm98Q/AN1y3B6PBsyV8Re91Ty5s7txKNjEhpgtGPcfdbh2MZg==} From b47ed9985825c4264141dec6c7ee4e0ce4c5a66a Mon Sep 17 00:00:00 2001 From: Matthias Goudjil Date: Tue, 6 Feb 2024 16:23:37 +0100 Subject: [PATCH 11/12] fix: #303 - change badge colors --- packages/theme/src/badge.scss | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/theme/src/badge.scss b/packages/theme/src/badge.scss index 72542771..25691679 100644 --- a/packages/theme/src/badge.scss +++ b/packages/theme/src/badge.scss @@ -1,25 +1,25 @@ @use './common/typography.scss'; .puik-badge { - @extend .puik-body-default; - @apply rounded-2xl inline-block py-1 px-3 leading-5 font-normal; + @extend .puik-body-default-medium; + @apply rounded-2xl inline-block py-1 px-3 leading-5; &--success { - @apply bg-green text-white; + @apply bg-green-100; } &--warning { - @apply bg-yellow text-primary; + @apply bg-yellow-100; } &--danger { - @apply bg-red text-white; + @apply bg-red-100; } &--info { - @apply bg-blue text-white; + @apply bg-blue-100; } &--neutral { - @apply bg-primary-600 text-white; + @apply bg-primary-300; } } From bb3e5997570de01d88c6551bc126766242fa4ae6 Mon Sep 17 00:00:00 2001 From: Matthias Goudjil Date: Tue, 6 Feb 2024 17:50:37 +0100 Subject: [PATCH 12/12] fix: #308 [tooltip][breaking-change] - prop naming - replace title by heading --- packages/components/tooltip/src/tooltip.ts | 2 +- packages/components/tooltip/src/tooltip.vue | 10 ++-- .../tooltip/stories/tooltip.stories.ts | 58 +++++++++---------- .../components/tooltip/test/tooltip.spec.ts | 16 ++--- packages/theme/src/tooltip.scss | 6 +- 5 files changed, 47 insertions(+), 45 deletions(-) diff --git a/packages/components/tooltip/src/tooltip.ts b/packages/components/tooltip/src/tooltip.ts index ab99d67c..bdb5c458 100644 --- a/packages/components/tooltip/src/tooltip.ts +++ b/packages/components/tooltip/src/tooltip.ts @@ -5,7 +5,7 @@ import type Tooltip from './tooltip.vue' export const tooltipPositions = ['top', 'bottom', 'left', 'right'] as const export type PuikTooltipPosition = (typeof tooltipPositions)[number] export const tooltipProps = buildProps({ - title: { + heading: { type: String, required: false, default: undefined, diff --git a/packages/components/tooltip/src/tooltip.vue b/packages/components/tooltip/src/tooltip.vue index 3c448621..02f585c0 100644 --- a/packages/components/tooltip/src/tooltip.vue +++ b/packages/components/tooltip/src/tooltip.vue @@ -28,10 +28,12 @@ >
{{ title }}{{ heading }} ({
- +
`, @@ -125,15 +125,15 @@ export const Default = { --> - + @@ -144,7 +144,7 @@ export const Default = {