@music-vine/cadence 2.4.0 → 2.5.0
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.
- package/dist/components/accordion.js.map +2 -2
- package/dist/components/badge.js.map +2 -2
- package/dist/components/breadcrumb.js +1 -4
- package/dist/components/breadcrumb.js.map +2 -2
- package/dist/components/button.js +20 -17
- package/dist/components/button.js.map +2 -2
- package/dist/components/card.js +5 -1
- package/dist/components/card.js.map +2 -2
- package/dist/components/carousel.js +8 -1
- package/dist/components/carousel.js.map +2 -2
- package/dist/components/checkbox.js +13 -2
- package/dist/components/checkbox.js.map +2 -2
- package/dist/components/context-menu.js +47 -8
- package/dist/components/context-menu.js.map +2 -2
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drawer.js.map +2 -2
- package/dist/components/index.js +7 -4
- package/dist/components/index.js.map +2 -2
- package/dist/components/input.js +5 -1
- package/dist/components/input.js.map +2 -2
- package/dist/components/popover.js +13 -15
- package/dist/components/popover.js.map +2 -2
- package/dist/components/select.js +159 -139
- package/dist/components/select.js.map +2 -2
- package/dist/components/separator.js.map +2 -2
- package/dist/components/skeleton.js +12 -14
- package/dist/components/skeleton.js.map +2 -2
- package/dist/components/stacking-card.js +1 -1
- package/dist/components/stacking-card.js.map +2 -2
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/textarea.js +7 -1
- package/dist/components/textarea.js.map +2 -2
- package/dist/components/toast.js +33 -8
- package/dist/components/toast.js.map +2 -2
- package/dist/components/typography/heading.js +8 -1
- package/dist/components/typography/heading.js.map +2 -2
- package/dist/components/typography/list.js +15 -2
- package/dist/components/typography/list.js.map +2 -2
- package/dist/components/typography/text.js +7 -1
- package/dist/components/typography/text.js.map +2 -2
- package/dist/icons/custom/boards-indicator.js.map +2 -2
- package/dist/icons/custom/exclamation-mark-in-octagon.js.map +2 -2
- package/dist/icons/custom/lightning-bolt.js +33 -0
- package/dist/icons/custom/lightning-bolt.js.map +7 -0
- package/dist/icons/custom/tick.js.map +2 -2
- package/dist/icons/index.js +1 -0
- package/dist/icons/index.js.map +2 -2
- package/dist/lib/utils.js +3 -1
- package/dist/lib/utils.js.map +2 -2
- package/dist/styles/index.css +14 -14
- package/dist/styles/index.v4.css +14 -14
- package/dist/test/setup.js +4 -2
- package/dist/test/setup.js.map +2 -2
- package/dist/theme/index.js +39 -13
- package/dist/theme/index.js.map +2 -2
- package/package.json +3 -3
- package/tailwind.config.ts +3 -2
- package/tailwind.config.v4.css +1 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../..";
|
|
3
|
+
const LightningBolt = ({
|
|
4
|
+
className,
|
|
5
|
+
"aria-hidden": ariaHidden = true
|
|
6
|
+
}) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"svg",
|
|
9
|
+
{
|
|
10
|
+
width: "16",
|
|
11
|
+
height: "16",
|
|
12
|
+
viewBox: "0 0 16 16",
|
|
13
|
+
fill: "none",
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
className: cn("text-black dark:text-white", className),
|
|
16
|
+
"aria-hidden": ariaHidden,
|
|
17
|
+
children: /* @__PURE__ */ jsx(
|
|
18
|
+
"path",
|
|
19
|
+
{
|
|
20
|
+
d: "M11.211 1.90927C11.3195 1.63336 11.1196 1.33325 10.8273 1.33325H5.95064C5.77278 1.33325 5.61489 1.44893 5.55865 1.62045L3.35489 8.34076C3.26571 8.61276 3.46486 8.89359 3.74689 8.89359H5.95001C6.21883 8.89359 6.41607 9.15039 6.35087 9.4155L5.18823 14.1427C5.08659 14.556 5.58494 14.8428 5.88127 14.5417L13.2115 7.09053C13.4718 6.82592 13.2875 6.37348 12.9193 6.37348H10.0646C9.77226 6.37348 9.57236 6.07336 9.68095 5.79747L11.211 1.90927Z",
|
|
21
|
+
stroke: "currentColor",
|
|
22
|
+
strokeWidth: "1.33",
|
|
23
|
+
strokeLinecap: "round",
|
|
24
|
+
strokeLinejoin: "round"
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
LightningBolt
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=lightning-bolt.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/icons/custom/lightning-bolt.tsx"],
|
|
4
|
+
"sourcesContent": ["import { cn } from \"../..\";\n\nexport const LightningBolt = ({\n className,\n 'aria-hidden': ariaHidden = true,\n}: {\n className?: string;\n 'aria-hidden'?: boolean;\n}) => {\n return (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\"text-black dark:text-white\", className)}\n aria-hidden={ariaHidden}\n >\n <path\n d=\"M11.211 1.90927C11.3195 1.63336 11.1196 1.33325 10.8273 1.33325H5.95064C5.77278 1.33325 5.61489 1.44893 5.55865 1.62045L3.35489 8.34076C3.26571 8.61276 3.46486 8.89359 3.74689 8.89359H5.95001C6.21883 8.89359 6.41607 9.15039 6.35087 9.4155L5.18823 14.1427C5.08659 14.556 5.58494 14.8428 5.88127 14.5417L13.2115 7.09053C13.4718 6.82592 13.2875 6.37348 12.9193 6.37348H10.0646C9.77226 6.37348 9.57236 6.07336 9.68095 5.79747L11.211 1.90927Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.33\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAmBM;AAnBN,SAAS,UAAU;AAEZ,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA,eAAe,aAAa;AAC9B,MAGM;AACJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,OAAM;AAAA,MACN,WAAW,GAAG,8BAA8B,SAAS;AAAA,MACrD,eAAa;AAAA,MAEb;AAAA,QAAC;AAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA;AAAA,MACjB;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/icons/custom/tick.tsx"],
|
|
4
|
-
"sourcesContent": ["import { memo } from \"react\";\n\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { memo } from \"react\";\n\nconst _Tick = ({ className, ...props }: React.SVGProps<SVGSVGElement>) => (\n <svg\n aria-hidden=\"true\"\n className={className}\n fill=\"none\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n width=\"20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M16.6666 5L7.49992 14.1667L3.33325 10\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2.5\"\n />\n </svg>\n);\n\nconst Tick = memo(_Tick);\n\nexport { Tick };\n"],
|
|
5
|
+
"mappings": "AAaI;AAbJ,SAAS,YAAY;AAErB,MAAM,QAAQ,CAAC,EAAE,WAAW,GAAG,MAAM,MACnC;AAAA,EAAC;AAAA;AAAA,IACC,eAAY;AAAA,IACZ;AAAA,IACA,MAAK;AAAA,IACL,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,OAAM;AAAA,IACN,OAAM;AAAA,IACL,GAAG;AAAA,IAEJ;AAAA,MAAC;AAAA;AAAA,QACC,GAAE;AAAA,QACF,QAAO;AAAA,QACP,eAAc;AAAA,QACd,gBAAe;AAAA,QACf,aAAY;AAAA;AAAA,IACd;AAAA;AACF;AAGF,MAAM,OAAO,KAAK,KAAK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/icons/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./custom/horizontal-orientation";
|
|
|
6
6
|
export * from "./custom/pin";
|
|
7
7
|
export * from "./custom/premium-star";
|
|
8
8
|
export * from "./custom/social";
|
|
9
|
+
export * from "./custom/lightning-bolt";
|
|
9
10
|
export * from "./custom/square-aspect-ratio";
|
|
10
11
|
import { Tick } from "./custom/tick";
|
|
11
12
|
export * from "./custom/tick-in-circle";
|
package/dist/icons/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/icons/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Cadence Icons\n *\n * All Lucide icons are re-exported, plus custom Uppbeat icons.\n *\n * @example\n * import { Play, Pause, Tick, PremiumStar } from '@music-vine/cadence/icons';\n */\n\n// Re-export ALL Lucide icons\nexport * from \"lucide-react\";\nexport * from \"./custom/boards-indicator\";\nexport * from \"./custom/download-history\";\nexport * from \"./custom/exclamation-mark-in-octagon\";\nexport * from \"./custom/horizontal-orientation\";\nexport * from \"./custom/pin\";\nexport * from \"./custom/premium-star\";\n// Social icons\nexport * from \"./custom/social\";\n// Custom Uppbeat icons\nexport * from \"./custom/square-aspect-ratio\";\nexport { Tick } from \"./custom/tick\";\nexport * from \"./custom/tick-in-circle\";\nexport * from \"./custom/tick-small\";\nexport * from \"./custom/ultra-wide-aspect-ratio\";\nexport * from \"./custom/uppbeat-credit\";\nexport * from \"./custom/vertical-orientation\";\nexport * from \"./custom/view-credit-note\";\n"],
|
|
5
|
-
"mappings": "AAUA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAEd,cAAc;AACd,SAAS,YAAY;AACrB,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
4
|
+
"sourcesContent": ["/**\n * Cadence Icons\n *\n * All Lucide icons are re-exported, plus custom Uppbeat icons.\n *\n * @example\n * import { Play, Pause, Tick, PremiumStar } from '@music-vine/cadence/icons';\n */\n\n// Re-export ALL Lucide icons\nexport * from \"lucide-react\";\nexport * from \"./custom/boards-indicator\";\nexport * from \"./custom/download-history\";\nexport * from \"./custom/exclamation-mark-in-octagon\";\nexport * from \"./custom/horizontal-orientation\";\nexport * from \"./custom/pin\";\nexport * from \"./custom/premium-star\";\n// Social icons\nexport * from \"./custom/social\";\n// Custom Uppbeat icons\nexport * from \"./custom/lightning-bolt\";\nexport * from \"./custom/square-aspect-ratio\";\nexport { Tick } from \"./custom/tick\";\nexport * from \"./custom/tick-in-circle\";\nexport * from \"./custom/tick-small\";\nexport * from \"./custom/ultra-wide-aspect-ratio\";\nexport * from \"./custom/uppbeat-credit\";\nexport * from \"./custom/vertical-orientation\";\nexport * from \"./custom/view-credit-note\";\n"],
|
|
5
|
+
"mappings": "AAUA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,SAAS,YAAY;AACrB,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/lib/utils.js
CHANGED
|
@@ -53,7 +53,9 @@ const customTwMerge = extendTailwindMerge((config) => {
|
|
|
53
53
|
function cn(...inputs) {
|
|
54
54
|
const classList = clsx(inputs);
|
|
55
55
|
const expanded = classList.split(" ").flatMap((className) => {
|
|
56
|
-
const fluidWithModifier = className.match(
|
|
56
|
+
const fluidWithModifier = className.match(
|
|
57
|
+
/^~(@[\w-]+):~text-(\w+)\/(\w+)$/
|
|
58
|
+
);
|
|
57
59
|
if (fluidWithModifier) {
|
|
58
60
|
const [, modifier, startSize, endSize] = fluidWithModifier;
|
|
59
61
|
const baseFluid = `~text-${startSize}/${endSize}`;
|
package/dist/lib/utils.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/lib/utils.ts"],
|
|
4
|
-
"sourcesContent": ["import { type ClassValue, clsx } from \"clsx\";\nimport { extendTailwindMerge, mergeConfigs } from \"tailwind-merge\";\
|
|
5
|
-
"mappings": "AAAA,SAA0B,YAAY;AACtC,SAAS,qBAAqB,oBAAoB;
|
|
4
|
+
"sourcesContent": ["import { type ClassValue, clsx } from \"clsx\";\nimport { extendTailwindMerge, mergeConfigs } from \"tailwind-merge\";\n\n/**\n * Fluid-tailwind support for tailwind-merge.\n * Adapted from @fluid-tailwind/tailwind-merge source code.\n *\n * **How it works:**\n * 1. Fluid classes with modifiers (e.g., `~@md:~text-2xl/3xl`) are expanded\n * to include both the modified and base versions\n * 2. This ensures they conflict at multiple modifier levels:\n * - `~@md:~text-2xl/3xl` conflicts with `@md:text-5xl` (responsive)\n * - `~@md:~text-2xl/3xl` conflicts with `text-4xl` (base)\n * 3. Simple fluid classes (e.g., `~text-2xl/3xl`) conflict with `text-4xl`\n *\n * **Supported patterns:**\n * - `~text-4xl/5xl` conflicts with `text-4xl` \u2713\n * - `~@md:~text-4xl/5xl` conflicts with BOTH `@md:text-5xl` AND `text-4xl` \u2713\n * - Fluid text sizing with any container query breakpoint \u2713\n *\n * This implementation ensures that passing a fluid className overrides all\n * related text sizing classes, as expected in a component library.\n */\n\n/**\n * Validator for fluid text sizes with `/` separator.\n * This matches the full className including prefix and postfix.\n * Tailwind-merge class groups can receive full className for top-level validators.\n */\nconst isFluidTextSize = (classPart: string): boolean => {\n // Match full fluid class patterns: ~text-X/Y\n const fluidPattern = /^~text-([a-z0-9]+)\\/([a-z0-9]+)$/;\n const match = classPart.match(fluidPattern);\n\n if (!match) {\n return false;\n }\n\n const [, startSize, endSize] = match;\n const validSizes = [\n \"xs\",\n \"sm\",\n \"base\",\n \"lg\",\n \"xl\",\n \"2xl\",\n \"3xl\",\n \"4xl\",\n \"5xl\",\n \"6xl\",\n \"7xl\",\n \"8xl\",\n \"9xl\",\n ];\n\n return validSizes.includes(startSize) && validSizes.includes(endSize);\n};\n\n/**\n * Custom tailwind-merge with fluid text size support.\n */\nconst customTwMerge = extendTailwindMerge((config) => {\n return mergeConfigs(config, {\n extend: {\n classGroups: {\n // Extend font-size class group to support fluid syntax\n // Top-level validator receives the full className (e.g., \"~text-2xl/3xl\")\n \"font-size\": [isFluidTextSize],\n },\n },\n // Strip `~` prefixes from modifiers only (NOT from baseClassName)\n // This allows ~@md:~text-4xl/5xl to conflict with @md:text-5xl\n // After processing: ~@md:~text-4xl/5xl \u2192 modifiers:[@md], baseClassName:~text-4xl/5xl\n // We keep the ~ on baseClassName because tailwind-merge needs it to recognize fluid syntax\n experimentalParseClassName: ({ className, parseClassName }) => {\n const parsed = parseClassName(className);\n\n // Strip ~ prefix from each modifier (map, not filter!)\n const cleanedModifiers = parsed.modifiers.map((modifier) =>\n modifier.startsWith(\"~\") ? modifier.slice(1) : modifier\n );\n\n return {\n ...parsed,\n modifiers: cleanedModifiers,\n // Keep baseClassName as-is (preserving ~) so fluid syntax isn't misinterpreted as line-height\n };\n },\n });\n});\n\n/**\n * Merge Tailwind CSS classes with clsx and tailwind-merge.\n * Supports both standard Tailwind classes and fluid-tailwind text sizing.\n * This ensures proper handling of conflicting classes.\n *\n * Fluid classes are expanded to conflict at multiple modifier levels:\n * - `~@md:~text-2xl/3xl` conflicts with BOTH `@md:text-5xl` AND `text-4xl`\n * - This ensures fluid classes override all related text sizing\n */\nexport function cn(...inputs: ClassValue[]) {\n const classList = clsx(inputs);\n\n // Expand fluid classes to conflict at multiple modifier levels\n const expanded = classList.split(\" \").flatMap((className) => {\n // Match fluid classes with modifiers: ~@md:~text-2xl/3xl\n const fluidWithModifier = className.match(\n /^~(@[\\w-]+):~text-(\\w+)\\/(\\w+)$/\n );\n if (fluidWithModifier) {\n const [, modifier, startSize, endSize] = fluidWithModifier;\n const baseFluid = `~text-${startSize}/${endSize}`;\n // Return both the modified version and base version\n // This makes it conflict with both @md:text-* and text-*\n return [className, baseFluid];\n }\n\n return [className];\n });\n\n return customTwMerge(expanded.join(\" \"));\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAA0B,YAAY;AACtC,SAAS,qBAAqB,oBAAoB;AA4BlD,MAAM,kBAAkB,CAAC,cAA+B;AAEtD,QAAM,eAAe;AACrB,QAAM,QAAQ,UAAU,MAAM,YAAY;AAE1C,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AAEA,QAAM,CAAC,EAAE,WAAW,OAAO,IAAI;AAC/B,QAAM,aAAa;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,WAAW,SAAS,SAAS,KAAK,WAAW,SAAS,OAAO;AACtE;AAKA,MAAM,gBAAgB,oBAAoB,CAAC,WAAW;AACpD,SAAO,aAAa,QAAQ;AAAA,IAC1B,QAAQ;AAAA,MACN,aAAa;AAAA;AAAA;AAAA,QAGX,aAAa,CAAC,eAAe;AAAA,MAC/B;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,4BAA4B,CAAC,EAAE,WAAW,eAAe,MAAM;AAC7D,YAAM,SAAS,eAAe,SAAS;AAGvC,YAAM,mBAAmB,OAAO,UAAU;AAAA,QAAI,CAAC,aAC7C,SAAS,WAAW,GAAG,IAAI,SAAS,MAAM,CAAC,IAAI;AAAA,MACjD;AAEA,aAAO;AAAA,QACL,GAAG;AAAA,QACH,WAAW;AAAA;AAAA,MAEb;AAAA,IACF;AAAA,EACF,CAAC;AACH,CAAC;AAWM,SAAS,MAAM,QAAsB;AAC1C,QAAM,YAAY,KAAK,MAAM;AAG7B,QAAM,WAAW,UAAU,MAAM,GAAG,EAAE,QAAQ,CAAC,cAAc;AAE3D,UAAM,oBAAoB,UAAU;AAAA,MAClC;AAAA,IACF;AACA,QAAI,mBAAmB;AACrB,YAAM,CAAC,EAAE,UAAU,WAAW,OAAO,IAAI;AACzC,YAAM,YAAY,SAAS,SAAS,IAAI,OAAO;AAG/C,aAAO,CAAC,WAAW,SAAS;AAAA,IAC9B;AAEA,WAAO,CAAC,SAAS;AAAA,EACnB,CAAC;AAED,SAAO,cAAc,SAAS,KAAK,GAAG,CAAC;AACzC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/styles/index.css
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
@layer base {
|
|
6
6
|
:root {
|
|
7
7
|
/* Brand Colors - Themeable */
|
|
8
|
-
--brand-primary: #
|
|
9
|
-
--brand-primary-hover: #
|
|
10
|
-
--brand-primary-active: #
|
|
11
|
-
--brand-secondary: #
|
|
12
|
-
--brand-secondary-hover: #
|
|
13
|
-
--background: #
|
|
14
|
-
--foreground: #
|
|
8
|
+
--brand-primary: #f23d75;
|
|
9
|
+
--brand-primary-hover: #df1f64;
|
|
10
|
+
--brand-primary-active: #bc1454;
|
|
11
|
+
--brand-secondary: #fff1f4;
|
|
12
|
+
--brand-secondary-hover: #ffe4ea;
|
|
13
|
+
--background: #fff;
|
|
14
|
+
--foreground: #151a20;
|
|
15
15
|
|
|
16
16
|
/* Focus Ring - Follows brand color */
|
|
17
17
|
--focus-ring: var(--brand-primary);
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
|
|
21
21
|
.theme-dark {
|
|
22
22
|
/* Brand Colors (same in dark mode) */
|
|
23
|
-
--brand-primary: #
|
|
24
|
-
--brand-primary-hover: #
|
|
25
|
-
--brand-primary-active: #
|
|
26
|
-
--brand-secondary: #
|
|
27
|
-
--brand-secondary-hover: #
|
|
28
|
-
--background: #
|
|
29
|
-
--foreground: #
|
|
23
|
+
--brand-primary: #f23d75;
|
|
24
|
+
--brand-primary-hover: #df1f64;
|
|
25
|
+
--brand-primary-active: #bc1454;
|
|
26
|
+
--brand-secondary: #461f34;
|
|
27
|
+
--brand-secondary-hover: #5f152e;
|
|
28
|
+
--background: #151a20;
|
|
29
|
+
--foreground: #fff;
|
|
30
30
|
|
|
31
31
|
/* Focus Ring - Follows brand color */
|
|
32
32
|
--focus-ring: var(--brand-primary);
|
package/dist/styles/index.v4.css
CHANGED
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
@layer base {
|
|
20
20
|
:root {
|
|
21
21
|
/* Brand Colors - Themeable */
|
|
22
|
-
--brand-primary: #
|
|
23
|
-
--brand-primary-hover: #
|
|
24
|
-
--brand-primary-active: #
|
|
25
|
-
--brand-secondary: #
|
|
26
|
-
--brand-secondary-hover: #
|
|
27
|
-
--background: #
|
|
28
|
-
--foreground: #
|
|
22
|
+
--brand-primary: #f23d75;
|
|
23
|
+
--brand-primary-hover: #df1f64;
|
|
24
|
+
--brand-primary-active: #bc1454;
|
|
25
|
+
--brand-secondary: #fff1f4;
|
|
26
|
+
--brand-secondary-hover: #ffe4ea;
|
|
27
|
+
--background: #fff;
|
|
28
|
+
--foreground: #151a20;
|
|
29
29
|
|
|
30
30
|
/* Focus Ring - Follows brand color */
|
|
31
31
|
--focus-ring: var(--brand-primary);
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
|
|
35
35
|
.theme-dark {
|
|
36
36
|
/* Brand Colors (same in dark mode) */
|
|
37
|
-
--brand-primary: #
|
|
38
|
-
--brand-primary-hover: #
|
|
39
|
-
--brand-primary-active: #
|
|
40
|
-
--brand-secondary: #
|
|
41
|
-
--brand-secondary-hover: #
|
|
42
|
-
--background: #
|
|
43
|
-
--foreground: #
|
|
37
|
+
--brand-primary: #f23d75;
|
|
38
|
+
--brand-primary-hover: #df1f64;
|
|
39
|
+
--brand-primary-active: #bc1454;
|
|
40
|
+
--brand-secondary: #461f34;
|
|
41
|
+
--brand-secondary-hover: #5f152e;
|
|
42
|
+
--background: #151a20;
|
|
43
|
+
--foreground: #fff;
|
|
44
44
|
|
|
45
45
|
/* Focus Ring - Follows brand color */
|
|
46
46
|
--focus-ring: var(--brand-primary);
|
package/dist/test/setup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@testing-library/jest-dom/vitest";
|
|
2
2
|
import { cleanup } from "@testing-library/react";
|
|
3
|
-
import { afterEach, beforeAll,
|
|
3
|
+
import { afterAll, afterEach, beforeAll, vi } from "vitest";
|
|
4
4
|
afterEach(() => {
|
|
5
5
|
cleanup();
|
|
6
6
|
});
|
|
@@ -52,7 +52,9 @@ const originalError = console.error;
|
|
|
52
52
|
const originalWarn = console.warn;
|
|
53
53
|
beforeAll(() => {
|
|
54
54
|
console.error = (...args) => {
|
|
55
|
-
if (typeof args[0] === "string" && (args[0].includes("ReactDOM.render") || args[0].includes(
|
|
55
|
+
if (typeof args[0] === "string" && (args[0].includes("ReactDOM.render") || args[0].includes(
|
|
56
|
+
"Not implemented: HTMLFormElement.prototype.requestSubmit"
|
|
57
|
+
))) {
|
|
56
58
|
return;
|
|
57
59
|
}
|
|
58
60
|
originalError.call(console, ...args);
|
package/dist/test/setup.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/test/setup.ts"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "AAAA,OAAO;AACP,SAAS,eAAe;AACxB,SAAS,WAAW,WAAW,UAAU
|
|
4
|
+
"sourcesContent": ["import \"@testing-library/jest-dom/vitest\";\nimport { cleanup } from \"@testing-library/react\";\nimport { afterAll, afterEach, beforeAll, vi } from \"vitest\";\n\nafterEach(() => {\n cleanup();\n});\n\n// Mock IntersectionObserver (Radix Popover, ContextMenu)\nglobal.IntersectionObserver = vi.fn().mockImplementation(() => ({\n observe: vi.fn(),\n unobserve: vi.fn(),\n disconnect: vi.fn(),\n root: null,\n rootMargin: \"\",\n thresholds: [],\n takeRecords: vi.fn(),\n}));\n\n// Mock ResizeObserver (Dialog, Drawer, Popover positioning)\nglobal.ResizeObserver = vi.fn().mockImplementation(() => ({\n observe: vi.fn(),\n unobserve: vi.fn(),\n disconnect: vi.fn(),\n}));\n\n// Mock matchMedia (responsive components, dark mode)\nObject.defineProperty(window, \"matchMedia\", {\n writable: true,\n value: vi.fn().mockImplementation((query: string) => ({\n matches: false,\n media: query,\n onchange: null,\n addListener: vi.fn(),\n removeListener: vi.fn(),\n addEventListener: vi.fn(),\n removeEventListener: vi.fn(),\n dispatchEvent: vi.fn(),\n })),\n});\n\n// Mock scrollTo (Dialog scroll locking)\nglobal.scrollTo = vi.fn();\n\n// Mock HTMLElement.prototype methods used by Radix UI\nHTMLElement.prototype.hasPointerCapture = vi.fn();\nHTMLElement.prototype.scrollIntoView = vi.fn();\nHTMLElement.prototype.releasePointerCapture = vi.fn();\nHTMLElement.prototype.setPointerCapture = vi.fn();\n\n// Mock getComputedStyle for transform calculations (Drawer/Vaul)\nconst originalGetComputedStyle = window.getComputedStyle;\nwindow.getComputedStyle = (element: Element) => {\n const style = originalGetComputedStyle(element);\n // Return a proxy that includes transform properties\n return new Proxy(style, {\n get(target, prop) {\n if (\n prop === \"transform\" ||\n prop === \"webkitTransform\" ||\n prop === \"mozTransform\"\n ) {\n return \"none\";\n }\n return target[prop as keyof CSSStyleDeclaration];\n },\n });\n};\n\n// Suppress known test warnings\nconst originalError = console.error;\nconst originalWarn = console.warn;\n\nbeforeAll(() => {\n console.error = (...args: unknown[]) => {\n if (\n typeof args[0] === \"string\" &&\n (args[0].includes(\"ReactDOM.render\") ||\n args[0].includes(\n \"Not implemented: HTMLFormElement.prototype.requestSubmit\"\n ))\n ) {\n return;\n }\n originalError.call(console, ...args);\n };\n\n console.warn = (...args: unknown[]) => {\n if (\n typeof args[0] === \"string\" &&\n args[0].includes(\"When server rendering\")\n ) {\n return;\n }\n originalWarn.call(console, ...args);\n };\n});\n\nafterAll(() => {\n console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AI,QAAQ,MAAM;AAChB,UACE,SAAS,eACT,SAAS,qBACT,SAAS,gBACT;AACA,eAAO;AAAA,MACT;AACA,aAAO,OAAO,IAAiC;AAAA,IACjD;AAAA,EACF,CAAC;AACH;AAGA,MAAM,gBAAgB,QAAQ;AAC9B,MAAM,eAAe,QAAQ;AAE7B,UAAU,MAAM;AACd,UAAQ,QAAQ,IAAI,SAAoB;AACtC,QACE,OAAO,KAAK,CAAC,MAAM,aAClB,KAAK,CAAC,EAAE,SAAS,iBAAiB,KACjC,KAAK,CAAC,EAAE;AAAA,MACN;AAAA,IACF,IACF;AACA;AAAA,IACF;AACA,kBAAc,KAAK,SAAS,GAAG,IAAI;AAAA,EACrC;AAEA,UAAQ,OAAO,IAAI,SAAoB;AACrC,QACE,OAAO,KAAK,CAAC,MAAM,YACnB,KAAK,CAAC,EAAE,SAAS,uBAAuB,GACxC;AACA;AAAA,IACF;AACA,iBAAa,KAAK,SAAS,GAAG,IAAI;AAAA,EACpC;AACF,CAAC;AAED,SAAS,MAAM;AACb,UAAQ,QAAQ;AAChB,UAAQ,OAAO;AACjB,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/theme/index.js
CHANGED
|
@@ -6,16 +6,32 @@ const radiusValues = {
|
|
|
6
6
|
xl: "16px"
|
|
7
7
|
};
|
|
8
8
|
function lightenColor(hex, percent = 20) {
|
|
9
|
-
const num = parseInt(hex.replace("#", ""), 16);
|
|
10
|
-
const r = Math.min(
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const num = Number.parseInt(hex.replace("#", ""), 16);
|
|
10
|
+
const r = Math.min(
|
|
11
|
+
255,
|
|
12
|
+
Math.floor((num >> 16) + (255 - (num >> 16)) * percent / 100)
|
|
13
|
+
);
|
|
14
|
+
const g = Math.min(
|
|
15
|
+
255,
|
|
16
|
+
Math.floor(
|
|
17
|
+
(num >> 8 & 255) + (255 - (num >> 8 & 255)) * percent / 100
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
const b = Math.min(
|
|
21
|
+
255,
|
|
22
|
+
Math.floor(
|
|
23
|
+
(num & 255) + (255 - (num & 255)) * percent / 100
|
|
24
|
+
)
|
|
25
|
+
);
|
|
13
26
|
return `#${(r << 16 | g << 8 | b).toString(16).padStart(6, "0")}`;
|
|
14
27
|
}
|
|
15
28
|
function darkenColor(hex, percent = 20) {
|
|
16
|
-
const num = parseInt(hex.replace("#", ""), 16);
|
|
29
|
+
const num = Number.parseInt(hex.replace("#", ""), 16);
|
|
17
30
|
const r = Math.max(0, Math.floor((num >> 16) * (1 - percent / 100)));
|
|
18
|
-
const g = Math.max(
|
|
31
|
+
const g = Math.max(
|
|
32
|
+
0,
|
|
33
|
+
Math.floor((num >> 8 & 255) * (1 - percent / 100))
|
|
34
|
+
);
|
|
19
35
|
const b = Math.max(0, Math.floor((num & 255) * (1 - percent / 100)));
|
|
20
36
|
return `#${(r << 16 | g << 8 | b).toString(16).padStart(6, "0")}`;
|
|
21
37
|
}
|
|
@@ -24,10 +40,18 @@ function createTheme(config = {}) {
|
|
|
24
40
|
const cssVariables = [];
|
|
25
41
|
if (config.brand?.primary) {
|
|
26
42
|
cssVariables.push(`--brand-primary: ${config.brand.primary};`);
|
|
27
|
-
cssVariables.push(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
cssVariables.push(
|
|
43
|
+
cssVariables.push(
|
|
44
|
+
`--brand-primary-hover: ${config.brand.accent || darkenColor(config.brand.primary, 15)};`
|
|
45
|
+
);
|
|
46
|
+
cssVariables.push(
|
|
47
|
+
`--brand-primary-active: ${darkenColor(config.brand.primary, 25)};`
|
|
48
|
+
);
|
|
49
|
+
cssVariables.push(
|
|
50
|
+
`--brand-secondary: ${lightenColor(config.brand.primary, 40)};`
|
|
51
|
+
);
|
|
52
|
+
cssVariables.push(
|
|
53
|
+
`--brand-secondary-hover: ${lightenColor(config.brand.primary, 30)};`
|
|
54
|
+
);
|
|
31
55
|
cssVariables.push(`--text-brand: ${config.brand.primary};`);
|
|
32
56
|
cssVariables.push(`--border-brand: ${config.brand.primary};`);
|
|
33
57
|
cssVariables.push(`--focus-ring: ${config.brand.primary};`);
|
|
@@ -37,7 +61,9 @@ function createTheme(config = {}) {
|
|
|
37
61
|
}
|
|
38
62
|
if (config.colors?.success) {
|
|
39
63
|
cssVariables.push(`--success: ${config.colors.success};`);
|
|
40
|
-
cssVariables.push(
|
|
64
|
+
cssVariables.push(
|
|
65
|
+
`--success-dark: ${darkenColor(config.colors.success, 15)};`
|
|
66
|
+
);
|
|
41
67
|
}
|
|
42
68
|
if (config.colors?.error) {
|
|
43
69
|
cssVariables.push(`--error: ${config.colors.error};`);
|
|
@@ -52,8 +78,8 @@ function createTheme(config = {}) {
|
|
|
52
78
|
if (config.radius) {
|
|
53
79
|
const radiusValue = radiusValues[config.radius];
|
|
54
80
|
cssVariables.push(`--radius-default: ${radiusValue};`);
|
|
55
|
-
cssVariables.push(`--radius-sm: ${parseInt(radiusValue) / 2}px;`);
|
|
56
|
-
cssVariables.push(`--radius-lg: ${parseInt(radiusValue) * 1.5}px;`);
|
|
81
|
+
cssVariables.push(`--radius-sm: ${Number.parseInt(radiusValue) / 2}px;`);
|
|
82
|
+
cssVariables.push(`--radius-lg: ${Number.parseInt(radiusValue) * 1.5}px;`);
|
|
57
83
|
}
|
|
58
84
|
if (config.fonts?.sans) {
|
|
59
85
|
cssVariables.push(`--font-sans: ${config.fonts.sans};`);
|
package/dist/theme/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/theme/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @module Theme\n *\n * Theme customization utilities for Cadence Design System.\n *\n * @example\n * // Basic usage\n * import { createTheme } from '@music-vine/cadence/theme';\n *\n * const customTheme = createTheme({\n * brand: {\n * primary: '#FF6B6B',\n * accent: '#4ECDC4',\n * }\n * });\n *\n * // Apply to root or specific container\n * <div className={customTheme}>\n * <Button>Themed Button</Button>\n * </div>\n *\n * @example\n * // Complete customization\n * const theme = createTheme({\n * brand: {\n * primary: '#FF6B6B',\n * accent: '#4ECDC4',\n * },\n * colors: {\n * success: '#51CF66',\n * error: '#FF6B6B',\n * warning: '#FFD93D',\n * info: '#74C0FC',\n * },\n * radius: 'lg',\n * fonts: {\n * sans: 'Inter, system-ui, sans-serif',\n * heading: 'Poppins, system-ui, sans-serif',\n * },\n * });\n */\n\n/**\n * Configuration for brand colors\n */\nexport interface BrandColors {\n /** Primary brand color (used for primary buttons, links, focus rings) */\n primary?: string;\n /** Accent/hover color for primary brand interactions */\n accent?: string;\n}\n\n/**\n * Configuration for status/semantic colors\n */\nexport interface StatusColors {\n /** Success state color */\n success?: string;\n /** Error state color */\n error?: string;\n /** Warning state color */\n warning?: string;\n /** Info state color */\n info?: string;\n}\n\n/**\n * Configuration for font families\n */\nexport interface FontConfig {\n /** Sans-serif font family for body text */\n sans?: string;\n /** Font family for headings */\n heading?: string;\n}\n\n/**\n * Border radius presets\n */\nexport type RadiusPreset =
|
|
5
|
-
"mappings": "AAkGA,MAAM,eAA6C;AAAA,EACjD,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAMA,SAAS,aAAa,KAAa,
|
|
4
|
+
"sourcesContent": ["/**\n * @module Theme\n *\n * Theme customization utilities for Cadence Design System.\n *\n * @example\n * // Basic usage\n * import { createTheme } from '@music-vine/cadence/theme';\n *\n * const customTheme = createTheme({\n * brand: {\n * primary: '#FF6B6B',\n * accent: '#4ECDC4',\n * }\n * });\n *\n * // Apply to root or specific container\n * <div className={customTheme}>\n * <Button>Themed Button</Button>\n * </div>\n *\n * @example\n * // Complete customization\n * const theme = createTheme({\n * brand: {\n * primary: '#FF6B6B',\n * accent: '#4ECDC4',\n * },\n * colors: {\n * success: '#51CF66',\n * error: '#FF6B6B',\n * warning: '#FFD93D',\n * info: '#74C0FC',\n * },\n * radius: 'lg',\n * fonts: {\n * sans: 'Inter, system-ui, sans-serif',\n * heading: 'Poppins, system-ui, sans-serif',\n * },\n * });\n */\n\n/**\n * Configuration for brand colors\n */\nexport interface BrandColors {\n /** Primary brand color (used for primary buttons, links, focus rings) */\n primary?: string;\n /** Accent/hover color for primary brand interactions */\n accent?: string;\n}\n\n/**\n * Configuration for status/semantic colors\n */\nexport interface StatusColors {\n /** Success state color */\n success?: string;\n /** Error state color */\n error?: string;\n /** Warning state color */\n warning?: string;\n /** Info state color */\n info?: string;\n}\n\n/**\n * Configuration for font families\n */\nexport interface FontConfig {\n /** Sans-serif font family for body text */\n sans?: string;\n /** Font family for headings */\n heading?: string;\n}\n\n/**\n * Border radius presets\n */\nexport type RadiusPreset = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n/**\n * Complete theme configuration\n */\nexport interface ThemeConfig {\n /** Brand color overrides */\n brand?: BrandColors;\n /** Status color overrides */\n colors?: StatusColors;\n /** Border radius preset */\n radius?: RadiusPreset;\n /** Font family overrides */\n fonts?: FontConfig;\n}\n\n/**\n * Border radius values mapped to CSS values\n */\nconst radiusValues: Record<RadiusPreset, string> = {\n none: \"0px\",\n sm: \"4px\",\n md: \"8px\",\n lg: \"12px\",\n xl: \"16px\",\n};\n\n/**\n * Generates a lightened version of a hex color\n * Simple implementation - for production, consider using a color manipulation library\n */\nfunction lightenColor(hex: string, percent = 20): string {\n const num = Number.parseInt(hex.replace(\"#\", \"\"), 16);\n const r = Math.min(\n 255,\n Math.floor((num >> 16) + ((255 - (num >> 16)) * percent) / 100)\n );\n const g = Math.min(\n 255,\n Math.floor(\n ((num >> 8) & 0x00_ff) + ((255 - ((num >> 8) & 0x00_ff)) * percent) / 100\n )\n );\n const b = Math.min(\n 255,\n Math.floor(\n (num & 0x00_00_ff) + ((255 - (num & 0x00_00_ff)) * percent) / 100\n )\n );\n return `#${((r << 16) | (g << 8) | b).toString(16).padStart(6, \"0\")}`;\n}\n\n/**\n * Generates a darkened version of a hex color\n */\nfunction darkenColor(hex: string, percent = 20): string {\n const num = Number.parseInt(hex.replace(\"#\", \"\"), 16);\n const r = Math.max(0, Math.floor((num >> 16) * (1 - percent / 100)));\n const g = Math.max(\n 0,\n Math.floor(((num >> 8) & 0x00_ff) * (1 - percent / 100))\n );\n const b = Math.max(0, Math.floor((num & 0x00_00_ff) * (1 - percent / 100)));\n return `#${((r << 16) | (g << 8) | b).toString(16).padStart(6, \"0\")}`;\n}\n\n/**\n * Creates a custom theme by generating CSS variables based on the provided configuration.\n * Returns a className that can be applied to any container element.\n *\n * @param config - Theme configuration object\n * @returns CSS class name to apply to container\n *\n * @example\n * const theme = createTheme({\n * brand: { primary: '#FF6B6B' }\n * });\n *\n * <div className={theme}>\n * <Button variant=\"brand\">Custom Themed Button</Button>\n * </div>\n */\nexport function createTheme(config: ThemeConfig = {}): string {\n const themeId = `cadence-theme-${Math.random().toString(36).substring(2, 11)}`;\n const cssVariables: string[] = [];\n\n // Brand colors\n if (config.brand?.primary) {\n cssVariables.push(`--brand-primary: ${config.brand.primary};`);\n cssVariables.push(\n `--brand-primary-hover: ${config.brand.accent || darkenColor(config.brand.primary, 15)};`\n );\n cssVariables.push(\n `--brand-primary-active: ${darkenColor(config.brand.primary, 25)};`\n );\n cssVariables.push(\n `--brand-secondary: ${lightenColor(config.brand.primary, 40)};`\n );\n cssVariables.push(\n `--brand-secondary-hover: ${lightenColor(config.brand.primary, 30)};`\n );\n cssVariables.push(`--text-brand: ${config.brand.primary};`);\n cssVariables.push(`--border-brand: ${config.brand.primary};`);\n cssVariables.push(`--focus-ring: ${config.brand.primary};`);\n }\n\n if (config.brand?.accent) {\n cssVariables.push(`--brand-primary-hover: ${config.brand.accent};`);\n }\n\n // Status colors\n if (config.colors?.success) {\n cssVariables.push(`--success: ${config.colors.success};`);\n cssVariables.push(\n `--success-dark: ${darkenColor(config.colors.success, 15)};`\n );\n }\n\n if (config.colors?.error) {\n cssVariables.push(`--error: ${config.colors.error};`);\n cssVariables.push(`--error-dark: ${darkenColor(config.colors.error, 15)};`);\n }\n\n if (config.colors?.warning) {\n cssVariables.push(`--warning: ${config.colors.warning};`);\n }\n\n if (config.colors?.info) {\n cssVariables.push(`--info: ${config.colors.info};`);\n }\n\n // Border radius\n if (config.radius) {\n const radiusValue = radiusValues[config.radius];\n cssVariables.push(`--radius-default: ${radiusValue};`);\n cssVariables.push(`--radius-sm: ${Number.parseInt(radiusValue) / 2}px;`);\n cssVariables.push(`--radius-lg: ${Number.parseInt(radiusValue) * 1.5}px;`);\n }\n\n // Font families\n if (config.fonts?.sans) {\n cssVariables.push(`--font-sans: ${config.fonts.sans};`);\n }\n\n if (config.fonts?.heading) {\n cssVariables.push(`--font-heading: ${config.fonts.heading};`);\n }\n\n // Inject styles into document head\n if (typeof document !== \"undefined\") {\n const styleId = `${themeId}-styles`;\n let styleElement = document.getElementById(styleId) as HTMLStyleElement;\n\n if (!styleElement) {\n styleElement = document.createElement(\"style\");\n styleElement.id = styleId;\n document.head.appendChild(styleElement);\n }\n\n styleElement.textContent = `\n .${themeId} {\n ${cssVariables.join(\"\\n \")}\n }\n `;\n }\n\n return themeId;\n}\n\n/**\n * Type guard to check if a string is a valid hex color\n */\nexport function isValidHexColor(color: string): boolean {\n return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);\n}\n\n/**\n * Pre-configured theme presets for common use cases\n */\nexport const themePresets = {\n /**\n * Default Uppbeat theme (pink brand color)\n */\n uppbeat: {\n brand: {\n primary: \"#F23D75\",\n accent: \"#DF1F64\",\n },\n },\n\n /**\n * Music Vine theme (coral pink brand color)\n */\n musicVine: {\n brand: {\n primary: \"#FF5F6E\",\n accent: \"#671920\",\n },\n },\n} satisfies Record<string, ThemeConfig>;\n\n/**\n * Helper to create a theme from a preset\n *\n * @example\n * const theme = createThemeFromPreset('ocean');\n * <div className={theme}>...</div>\n */\nexport function createThemeFromPreset(\n preset: keyof typeof themePresets\n): string {\n return createTheme(themePresets[preset]);\n}\n"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[]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@music-vine/cadence",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -134,12 +134,12 @@
|
|
|
134
134
|
"pngjs": "^7.0.0",
|
|
135
135
|
"postcss": "^8.4.49",
|
|
136
136
|
"rimraf": "^6.0.1",
|
|
137
|
-
"storybook": "^10.
|
|
137
|
+
"storybook": "^10.2.10",
|
|
138
138
|
"tailwindcss": "^4.1.18",
|
|
139
139
|
"tailwindcss-v3": "npm:tailwindcss@^3.4.18",
|
|
140
140
|
"tsx": "^4.21.0",
|
|
141
141
|
"typescript": "^5.2.2",
|
|
142
|
-
"vite": "^6.4.
|
|
142
|
+
"vite": "^6.4.2",
|
|
143
143
|
"vitest": "^3.2.4"
|
|
144
144
|
},
|
|
145
145
|
"scripts": {
|
package/tailwind.config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Config } from "tailwindcss-v3";
|
|
2
|
-
import * as animate from "tailwindcss-animate";
|
|
3
1
|
import * as containerQueries from "@tailwindcss/container-queries";
|
|
2
|
+
import * as animate from "tailwindcss-animate";
|
|
3
|
+
import type { Config } from "tailwindcss-v3";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Cadence Design System - Tailwind Configuration
|
|
@@ -160,6 +160,7 @@ const cadenceConfig: Config = {
|
|
|
160
160
|
700: "#5A646F",
|
|
161
161
|
800: "#3D4653",
|
|
162
162
|
850: "#323A45",
|
|
163
|
+
875: "#292F38",
|
|
163
164
|
900: "#1D232C",
|
|
164
165
|
950: "#151A20",
|
|
165
166
|
},
|