@jakubmazanec/ui 0.1.0-unstable.0c19abe → 0.1.0-unstable.8dffd18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -57,7 +57,7 @@ export function createTailwindConfig({
|
|
|
57
57
|
for (let contentPath of content) {
|
|
58
58
|
if (contentPath.startsWith(".") || contentPath.startsWith("/")) {
|
|
59
59
|
resolvedContent.push(contentPath);
|
|
60
|
-
} else
|
|
60
|
+
} else {
|
|
61
61
|
resolvedContent.push(`${resolveModule(contentPath)}/**`);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../source/development/createTailwindConfig.ts"],
|
|
4
|
-
"sourcesContent": ["import {type Config as TailwindConfig} from 'tailwindcss';\n// TODO: fix this when Tailwind CSS v4 is released\n// @ts-expect-error -- Tailwind CSS v3 is missing `exports` field in the package.json file, and it won't be added\nimport tailwindPlugin from 'tailwindcss/plugin';\nimport type TailwindPlugin from 'tailwindcss/plugin.d.ts';\n\nimport {DEFAULT_STOP, type DEFAULT_STOPS} from './internals/constants.js';\nimport {createPalette} from './internals/createPalette.js';\nimport {resolveModule} from './internals/resolveModule.js';\n\nconst PREFIX = 'ui';\n\nlet plugin = tailwindPlugin as typeof TailwindPlugin;\n\nexport type CreateTailwindConfigOptions = {\n content?: string[] | undefined;\n colors?: Record<\n string,\n | string\n | {\n swatches: Array<{hex: string; stop: (typeof DEFAULT_STOPS)[number]}>;\n hueShift?: number;\n saturationShift?: number;\n }\n | {hex: string; hueShift?: number; saturationShift?: number}\n >;\n};\n\nexport function createTailwindConfig({\n content = ['./{.storybook,app,source,stories}/**/*.{js,jsx,ts,tsx,mdx}'],\n colors,\n}: CreateTailwindConfigOptions = {}): TailwindConfig {\n let themeColors = {\n transparent: 'transparent',\n current: 'currentColor',\n white: '#fff',\n black: '#000',\n };\n\n for (let [name, color] of Object.entries(colors ?? {})) {\n if (typeof color === 'string') {\n themeColors = {\n ...themeColors,\n ...createPalette({\n name,\n swatches: [\n {\n hex: color,\n stop: DEFAULT_STOP,\n },\n ],\n hueShift: 0,\n saturationShift: 0,\n }),\n };\n } else if ('swatches' in color) {\n themeColors = {\n ...themeColors,\n ...createPalette({\n name,\n swatches: color.swatches,\n hueShift: color.hueShift ?? 0,\n saturationShift: color.saturationShift ?? 0,\n }),\n };\n } else if ('hex' in color) {\n themeColors = {\n ...themeColors,\n ...createPalette({\n name,\n swatches: [{hex: color.hex, stop: DEFAULT_STOP}],\n hueShift: color.hueShift ?? 0,\n saturationShift: color.saturationShift ?? 0,\n }),\n };\n }\n }\n\n let resolvedContent = [];\n\n for (let contentPath of content) {\n if (contentPath.startsWith('.') || contentPath.startsWith('/')) {\n resolvedContent.push(contentPath);\n } else
|
|
5
|
-
"mappings": ";AAGA,OAAO,oBAAoB;AAG3B,SAAQ,oBAAuC;AAC/C,SAAQ,qBAAoB;AAC5B,SAAQ,qBAAoB;AAE5B,MAAM,SAAS;AAEf,IAAI,SAAS;AAgBN,gBAAS,qBAAqB;AAAA,EACnC,UAAU,CAAC,4DAA4D;AAAA,EACvE;AACF,IAAiC,CAAC,GAAmB;AACnD,MAAI,cAAc;AAAA,IAChB,aAAa;AAAA,IACb,SAAS;AAAA,IACT,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAEA,WAAS,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,UAAU,CAAC,CAAC,GAAG;AACtD,QAAI,OAAO,UAAU,UAAU;AAC7B,oBAAc;AAAA,QACZ,GAAG;AAAA,QACH,GAAG,cAAc;AAAA,UACf;AAAA,UACA,UAAU;AAAA,YACR;AAAA,cACE,KAAK;AAAA,cACL,MAAM;AAAA,YACR;AAAA,UACF;AAAA,UACA,UAAU;AAAA,UACV,iBAAiB;AAAA,QACnB,CAAC;AAAA,MACH;AAAA,IACF,WAAW,cAAc,OAAO;AAC9B,oBAAc;AAAA,QACZ,GAAG;AAAA,QACH,GAAG,cAAc;AAAA,UACf;AAAA,UACA,UAAU,MAAM;AAAA,UAChB,UAAU,MAAM,YAAY;AAAA,UAC5B,iBAAiB,MAAM,mBAAmB;AAAA,QAC5C,CAAC;AAAA,MACH;AAAA,IACF,WAAW,SAAS,OAAO;AACzB,oBAAc;AAAA,QACZ,GAAG;AAAA,QACH,GAAG,cAAc;AAAA,UACf;AAAA,UACA,UAAU,CAAC,EAAC,KAAK,MAAM,KAAK,MAAM,aAAY,CAAC;AAAA,UAC/C,UAAU,MAAM,YAAY;AAAA,UAC5B,iBAAiB,MAAM,mBAAmB;AAAA,QAC5C,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAEA,MAAI,kBAAkB,CAAC;AAEvB,WAAS,eAAe,SAAS;AAC/B,QAAI,YAAY,WAAW,GAAG,KAAK,YAAY,WAAW,GAAG,GAAG;AAC9D,sBAAgB,KAAK,WAAW;AAAA,IAClC,
|
|
4
|
+
"sourcesContent": ["import {type Config as TailwindConfig} from 'tailwindcss';\n// TODO: fix this when Tailwind CSS v4 is released\n// @ts-expect-error -- Tailwind CSS v3 is missing `exports` field in the package.json file, and it won't be added\nimport tailwindPlugin from 'tailwindcss/plugin';\nimport type TailwindPlugin from 'tailwindcss/plugin.d.ts';\n\nimport {DEFAULT_STOP, type DEFAULT_STOPS} from './internals/constants.js';\nimport {createPalette} from './internals/createPalette.js';\nimport {resolveModule} from './internals/resolveModule.js';\n\nconst PREFIX = 'ui';\n\nlet plugin = tailwindPlugin as typeof TailwindPlugin;\n\nexport type CreateTailwindConfigOptions = {\n content?: string[] | undefined;\n colors?: Record<\n string,\n | string\n | {\n swatches: Array<{hex: string; stop: (typeof DEFAULT_STOPS)[number]}>;\n hueShift?: number;\n saturationShift?: number;\n }\n | {hex: string; hueShift?: number; saturationShift?: number}\n >;\n};\n\nexport function createTailwindConfig({\n content = ['./{.storybook,app,source,stories}/**/*.{js,jsx,ts,tsx,mdx}'],\n colors,\n}: CreateTailwindConfigOptions = {}): TailwindConfig {\n let themeColors = {\n transparent: 'transparent',\n current: 'currentColor',\n white: '#fff',\n black: '#000',\n };\n\n for (let [name, color] of Object.entries(colors ?? {})) {\n if (typeof color === 'string') {\n themeColors = {\n ...themeColors,\n ...createPalette({\n name,\n swatches: [\n {\n hex: color,\n stop: DEFAULT_STOP,\n },\n ],\n hueShift: 0,\n saturationShift: 0,\n }),\n };\n } else if ('swatches' in color) {\n themeColors = {\n ...themeColors,\n ...createPalette({\n name,\n swatches: color.swatches,\n hueShift: color.hueShift ?? 0,\n saturationShift: color.saturationShift ?? 0,\n }),\n };\n } else if ('hex' in color) {\n themeColors = {\n ...themeColors,\n ...createPalette({\n name,\n swatches: [{hex: color.hex, stop: DEFAULT_STOP}],\n hueShift: color.hueShift ?? 0,\n saturationShift: color.saturationShift ?? 0,\n }),\n };\n }\n }\n\n let resolvedContent = [];\n\n for (let contentPath of content) {\n if (contentPath.startsWith('.') || contentPath.startsWith('/')) {\n resolvedContent.push(contentPath);\n } else {\n resolvedContent.push(`${resolveModule(contentPath)}/**`);\n }\n }\n\n return {\n content: resolvedContent,\n theme: {\n colors: themeColors,\n extend: {\n spacing: {\n 13: '3.25rem',\n 15: '3.75',\n 17: '4.25rem',\n 18: '4.5rem',\n 19: '4.75rem',\n 21: '5.25rem',\n 22: '5.5rem',\n 23: '5.75rem',\n 25: '6.25rem',\n 26: '6.5rem',\n 27: '6.75rem',\n 29: '6.25rem',\n 30: '7.5rem',\n 34: '8.5rem',\n 38: '9.5rem',\n 40: '10rem',\n },\n fontFamily: {\n sans: [\n 'InterVariable',\n 'ui-sans-serif',\n 'system-ui',\n 'sans-serif',\n '\"Apple Color Emoji\"',\n '\"Segoe UI Emoji\"',\n '\"Segoe UI Symbol\"',\n '\"Noto Color Emoji\"',\n ],\n },\n },\n },\n future: {\n hoverOnlyWhenSupported: true,\n },\n plugins: [\n plugin(({addVariant}) => {\n for (let state of ['open', 'checked', 'selected', 'active', 'disabled']) {\n addVariant(`${PREFIX}-${state}`, [\n `&[data-headlessui-state~=\"${state}\"]`,\n `:where([data-headlessui-state~=\"${state}\"]) &`,\n ]);\n\n addVariant(`${PREFIX}-not-${state}`, [\n `&[data-headlessui-state]:not([data-headlessui-state~=\"${state}\"])`,\n `:where([data-headlessui-state]:not([data-headlessui-state~=\"${state}\"])) &:not([data-headlessui-state])`,\n ]);\n }\n\n addVariant(`${PREFIX}-focus-visible`, ':where([data-headlessui-focus-visible]) &:focus');\n addVariant(\n `${PREFIX}-not-focus-visible`,\n '&:focus:where(:not([data-headlessui-focus-visible] &))',\n );\n }),\n ],\n };\n}\n\n// plugins based on https://github.com/tailwindlabs/headlessui/tree/626a253dcf09589e2a2fbbfd0c279120153394cc/packages/@headlessui-tailwindcss (see https://github.com/tailwindlabs/headlessui/blob/626a253dcf09589e2a2fbbfd0c279120153394cc/packages/%40headlessui-tailwindcss/LICENSE for license)\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,oBAAoB;AAG3B,SAAQ,oBAAuC;AAC/C,SAAQ,qBAAoB;AAC5B,SAAQ,qBAAoB;AAE5B,MAAM,SAAS;AAEf,IAAI,SAAS;AAgBN,gBAAS,qBAAqB;AAAA,EACnC,UAAU,CAAC,4DAA4D;AAAA,EACvE;AACF,IAAiC,CAAC,GAAmB;AACnD,MAAI,cAAc;AAAA,IAChB,aAAa;AAAA,IACb,SAAS;AAAA,IACT,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAEA,WAAS,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,UAAU,CAAC,CAAC,GAAG;AACtD,QAAI,OAAO,UAAU,UAAU;AAC7B,oBAAc;AAAA,QACZ,GAAG;AAAA,QACH,GAAG,cAAc;AAAA,UACf;AAAA,UACA,UAAU;AAAA,YACR;AAAA,cACE,KAAK;AAAA,cACL,MAAM;AAAA,YACR;AAAA,UACF;AAAA,UACA,UAAU;AAAA,UACV,iBAAiB;AAAA,QACnB,CAAC;AAAA,MAC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;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,QAAQ;AAAA,MACN,wBAAwB;AAAA,IAC1B;AAAA,IACA,SAAS;AAAA,MACP,OAAO,CAAC,EAAC,WAAU,MAAM;AACvB,iBAAS,SAAS,CAAC,QAAQ,WAAW,YAAY,UAAU,UAAU,GAAG;AACvE,qBAAW,GAAG,MAAM,IAAI,KAAK,IAAI;AAAA,YAC/B,6BAA6B,KAAK;AAAA,YAClC,mCAAmC,KAAK;AAAA,UAC1C,CAAC;AAED,qBAAW,GAAG,MAAM,QAAQ,KAAK,IAAI;AAAA,YACnC,yDAAyD,KAAK;AAAA,YAC9D,+DAA+D,KAAK;AAAA,UACtE,CAAC;AAAA,QACH;AAEA,mBAAW,GAAG,MAAM,kBAAkB,iDAAiD;AACvF;AAAA,UACE,GAAG,MAAM;AAAA,UACT;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -81,7 +81,7 @@ export function createTailwindConfig({
|
|
|
81
81
|
for (let contentPath of content) {
|
|
82
82
|
if (contentPath.startsWith('.') || contentPath.startsWith('/')) {
|
|
83
83
|
resolvedContent.push(contentPath);
|
|
84
|
-
} else
|
|
84
|
+
} else {
|
|
85
85
|
resolvedContent.push(`${resolveModule(contentPath)}/**`);
|
|
86
86
|
}
|
|
87
87
|
}
|