@music-vine/cadence 3.0.2 → 3.1.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.
@@ -29,8 +29,8 @@ import type * as React from "react";
29
29
  * Includes color variants matching Button component for consistency.
30
30
  */
31
31
  declare const badgeVariants: (props?: ({
32
- variant?: "contrast" | "bold" | "white" | "transparent" | "light" | "subtle" | "brand" | "brandSecondary" | "success" | "error" | "primary" | "secondary" | "destructive" | "brandLight" | "outline" | null | undefined;
33
- size?: "xs" | "sm" | "lg" | "default" | "icon" | null | undefined;
32
+ variant?: "bold" | "white" | "transparent" | "light" | "subtle" | "brand" | "brandSecondary" | "contrast" | "success" | "error" | "primary" | "secondary" | "destructive" | "brandLight" | "outline" | null | undefined;
33
+ size?: "default" | "icon" | "xs" | "sm" | "lg" | null | undefined;
34
34
  shadow?: boolean | null | undefined;
35
35
  strong?: boolean | null | undefined;
36
36
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -47,10 +47,10 @@ import type { ButtonHTMLAttributes, Ref } from "react";
47
47
  type ButtonSize = "default" | "xs" | "sm" | "lg" | "icon" | "xl";
48
48
  type ButtonFontSize = "xxs" | "xs" | "sm" | "base" | "lg" | "xl" | null;
49
49
  declare const buttonVariants: (props?: ({
50
- variant?: "contrast" | "bold" | "transparent" | "light" | "subtle" | "brand" | "brandSecondary" | "success" | "error" | null | undefined;
51
- size?: "xs" | "sm" | "lg" | "xl" | "default" | "icon" | null | undefined;
52
- fontSize?: "xs" | "sm" | "base" | "lg" | "xl" | "xxs" | "null" | null | undefined;
53
- borderRadius?: "rounded" | "sm" | "default" | "full" | null | undefined;
50
+ variant?: "bold" | "transparent" | "light" | "subtle" | "brand" | "brandSecondary" | "contrast" | "success" | "error" | null | undefined;
51
+ size?: "default" | "icon" | "xs" | "sm" | "lg" | "xl" | null | undefined;
52
+ fontSize?: "base" | "xs" | "sm" | "lg" | "xl" | "xxs" | "null" | null | undefined;
53
+ borderRadius?: "default" | "sm" | "rounded" | "full" | null | undefined;
54
54
  border?: boolean | null | undefined;
55
55
  noFeedback?: boolean | null | undefined;
56
56
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -96,7 +96,7 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Om
96
96
  declare const Button: ({ className, variant, size, borderRadius, border, noFeedback, asChild, type, children, fontSize, icon, ref, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
97
97
  /** CVA variants for Loading spinner sizing */
98
98
  declare const loadingVariants: (props?: ({
99
- size?: "xs" | "sm" | "lg" | "xl" | "default" | "icon" | null | undefined;
99
+ size?: "default" | "icon" | "xs" | "sm" | "lg" | "xl" | null | undefined;
100
100
  visible?: boolean | null | undefined;
101
101
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
102
102
  /**
@@ -35,7 +35,7 @@
35
35
  import { type VariantProps } from "class-variance-authority";
36
36
  import type { Ref } from "react";
37
37
  declare const inputVariants: (props?: ({
38
- size?: "sm" | "default" | "auto" | null | undefined;
38
+ size?: "default" | "auto" | "sm" | null | undefined;
39
39
  hasLeftIcon?: boolean | null | undefined;
40
40
  hasRightIcon?: boolean | null | undefined;
41
41
  type?: "search" | null | undefined;
@@ -18,7 +18,7 @@
18
18
  import { type VariantProps } from "class-variance-authority";
19
19
  import type { Ref } from "react";
20
20
  declare const textareaVariants: (props?: ({
21
- size?: "sm" | "default" | null | undefined;
21
+ size?: "default" | "sm" | null | undefined;
22
22
  resize?: "none" | "horizontal" | "vertical" | "both" | null | undefined;
23
23
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
24
24
  /**
@@ -2,7 +2,7 @@ import { type VariantProps } from "class-variance-authority";
2
2
  import type * as React from "react";
3
3
  import type { Ref } from "react";
4
4
  declare const listVariants: (props?: ({
5
- size?: "sm" | "lg" | "default" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | null | undefined;
6
6
  variant?: "ordered" | "custom" | "unordered" | null | undefined;
7
7
  color?: "default" | "modal" | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -1,12 +1,25 @@
1
1
  import { type ClassValue } from "clsx";
2
2
  /**
3
- * Merge Tailwind CSS classes with clsx and tailwind-merge.
4
- * Supports both standard Tailwind classes and fluid-tailwind text sizing.
5
- * This ensures proper handling of conflicting classes.
3
+ * `twMerge` from `fluid-tailwindcss/tailwind-merge` is a tailwind-merge
4
+ * instance preconfigured to recognise every `fl-*` utility (padding,
5
+ * margin, gap, text, sizing, inset, border-radius, …) so merging works
6
+ * correctly out of the box:
6
7
  *
7
- * Fluid classes are expanded to conflict at multiple modifier levels:
8
- * - `@md:fl-text-2xl/3xl` conflicts with BOTH `@md:text-5xl` AND `text-4xl`
9
- * - This ensures fluid classes override all related text sizing
8
+ * - Fluid and standard utilities conflict at the same modifier level
9
+ * (e.g. `@md:fl-text-2xl/3xl` overrides `@md:text-5xl`).
10
+ * - A container-prefixed fluid utility does NOT override its un-prefixed
11
+ * counterpart (e.g. `@md:fl-text-2xl/3xl` leaves `text-4xl` intact),
12
+ * matching the CSS cascade — the prefixed rule only applies inside the
13
+ * container query, so the base utility must survive as the mobile
14
+ * fallback.
15
+ *
16
+ * This replaces the previous hand-rolled adapter that was ported from
17
+ * `fluid-tailwind` (the `~`-prefix variant). The codebase no longer uses
18
+ * `~`-prefixed fluid classes — `fluid-tailwindcss` is the sole fluid plugin.
19
+ */
20
+ /**
21
+ * Merge Tailwind CSS classes with clsx and tailwind-merge, with fluid utility
22
+ * conflict resolution.
10
23
  */
11
24
  export declare function cn(...inputs: ClassValue[]): string;
12
25
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AA8E7C;;;;;;;;GAQG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAqBzC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;GAGG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
package/dist/lib/utils.js CHANGED
@@ -1,59 +1,7 @@
1
1
  import { clsx } from "clsx";
2
- import { extendTailwindMerge, mergeConfigs } from "tailwind-merge";
3
- const isFluidTextSize = (classPart) => {
4
- const fluidPattern = /^fl-text-([a-z0-9]+)\/([a-z0-9]+)$/;
5
- const match = classPart.match(fluidPattern);
6
- if (!match) {
7
- return false;
8
- }
9
- const [, startSize, endSize] = match;
10
- const validSizes = [
11
- "xs",
12
- "sm",
13
- "base",
14
- "lg",
15
- "xl",
16
- "2xl",
17
- "3xl",
18
- "4xl",
19
- "5xl",
20
- "6xl",
21
- "7xl",
22
- "8xl",
23
- "9xl"
24
- ];
25
- return validSizes.includes(startSize) && validSizes.includes(endSize);
26
- };
27
- const customTwMerge = extendTailwindMerge((config) => {
28
- return mergeConfigs(config, {
29
- extend: {
30
- classGroups: {
31
- // Extend font-size class group to support fluid syntax
32
- // Top-level validator receives the full className (e.g., "fl-text-2xl/3xl")
33
- "font-size": [isFluidTextSize]
34
- }
35
- },
36
- // Parse className to extract modifiers and base class name
37
- // For @md:fl-text-4xl/5xl → modifiers:[@md], baseClassName:fl-text-4xl/5xl
38
- experimentalParseClassName: ({ className, parseClassName }) => {
39
- return parseClassName(className);
40
- }
41
- });
42
- });
2
+ import { twMerge } from "fluid-tailwindcss/tailwind-merge";
43
3
  function cn(...inputs) {
44
- const classList = clsx(inputs);
45
- const expanded = classList.split(" ").flatMap((className) => {
46
- const fluidWithModifier = className.match(
47
- /^(@[\w-]+):fl-text-(\w+)\/(\w+)$/
48
- );
49
- if (fluidWithModifier) {
50
- const [, modifier, startSize, endSize] = fluidWithModifier;
51
- const baseFluid = `fl-text-${startSize}/${endSize}`;
52
- return [className, baseFluid];
53
- }
54
- return [className];
55
- });
56
- return customTwMerge(expanded.join(" "));
4
+ return twMerge(clsx(inputs));
57
5
  }
58
6
  export {
59
7
  cn
@@ -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\";\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:fl-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:fl-text-2xl/3xl` conflicts with `@md:text-5xl` (responsive)\n * - `@md:fl-text-2xl/3xl` conflicts with `text-4xl` (base)\n * 3. Simple fluid classes (e.g., `fl-text-2xl/3xl`) conflict with `text-4xl`\n *\n * **Supported patterns:**\n * - `fl-text-4xl/5xl` conflicts with `text-4xl` \u2713\n * - `@md:fl-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: fl-text-X/Y\n const fluidPattern = /^fl-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., \"fl-text-2xl/3xl\")\n \"font-size\": [isFluidTextSize],\n },\n },\n // Parse className to extract modifiers and base class name\n // For @md:fl-text-4xl/5xl \u2192 modifiers:[@md], baseClassName:fl-text-4xl/5xl\n experimentalParseClassName: ({ className, parseClassName }) => {\n return parseClassName(className);\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:fl-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:fl-text-2xl/3xl\n const fluidWithModifier = className.match(\n /^(@[\\w-]+):fl-text-(\\w+)\\/(\\w+)$/\n );\n if (fluidWithModifier) {\n const [, modifier, startSize, endSize] = fluidWithModifier;\n const baseFluid = `fl-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,IAGA,4BAA4B,CAAC,EAAE,WAAW,eAAe,MAAM;AAC7D,aAAO,eAAe,SAAS;AAAA,IACjC;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,WAAW,SAAS,IAAI,OAAO;AAGjD,aAAO,CAAC,WAAW,SAAS;AAAA,IAC9B;AAEA,WAAO,CAAC,SAAS;AAAA,EACnB,CAAC;AAED,SAAO,cAAc,SAAS,KAAK,GAAG,CAAC;AACzC;",
4
+ "sourcesContent": ["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"fluid-tailwindcss/tailwind-merge\";\n\n/**\n * `twMerge` from `fluid-tailwindcss/tailwind-merge` is a tailwind-merge\n * instance preconfigured to recognise every `fl-*` utility (padding,\n * margin, gap, text, sizing, inset, border-radius, \u2026) so merging works\n * correctly out of the box:\n *\n * - Fluid and standard utilities conflict at the same modifier level\n * (e.g. `@md:fl-text-2xl/3xl` overrides `@md:text-5xl`).\n * - A container-prefixed fluid utility does NOT override its un-prefixed\n * counterpart (e.g. `@md:fl-text-2xl/3xl` leaves `text-4xl` intact),\n * matching the CSS cascade \u2014 the prefixed rule only applies inside the\n * container query, so the base utility must survive as the mobile\n * fallback.\n *\n * This replaces the previous hand-rolled adapter that was ported from\n * `fluid-tailwind` (the `~`-prefix variant). The codebase no longer uses\n * `~`-prefixed fluid classes \u2014 `fluid-tailwindcss` is the sole fluid plugin.\n */\n\n/**\n * Merge Tailwind CSS classes with clsx and tailwind-merge, with fluid utility\n * conflict resolution.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],
5
+ "mappings": "AAAA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAyBjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@music-vine/cadence",
3
- "version": "3.0.2",
3
+ "version": "3.1.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -94,6 +94,7 @@
94
94
  "class-variance-authority": "^0.7.1",
95
95
  "clsx": "^2.1.1",
96
96
  "embla-carousel-react": "^8.5.1",
97
+ "fluid-tailwindcss": "^1.0.5",
97
98
  "lodash": "^4.18.1",
98
99
  "lucide-react": "^0.531.0",
99
100
  "motion": "^12.0.0",