@m3-baseui/react-tailwind 3.0.0 → 5.0.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.
Files changed (67) hide show
  1. package/dist/components/badge/index.js +13 -1
  2. package/dist/components/badge/index.js.map +1 -1
  3. package/dist/components/bottom-app-bar/index.js +13 -1
  4. package/dist/components/bottom-app-bar/index.js.map +1 -1
  5. package/dist/components/bottom-sheet/index.js +13 -1
  6. package/dist/components/bottom-sheet/index.js.map +1 -1
  7. package/dist/components/button/index.d.ts +106 -1
  8. package/dist/components/button/index.js +168 -25
  9. package/dist/components/button/index.js.map +1 -1
  10. package/dist/components/button-group/index.js +13 -1
  11. package/dist/components/button-group/index.js.map +1 -1
  12. package/dist/components/card/index.js +13 -1
  13. package/dist/components/card/index.js.map +1 -1
  14. package/dist/components/carousel/index.js +13 -1
  15. package/dist/components/carousel/index.js.map +1 -1
  16. package/dist/components/date-picker/index.js +13 -1
  17. package/dist/components/date-picker/index.js.map +1 -1
  18. package/dist/components/dialog/index.js +13 -1
  19. package/dist/components/dialog/index.js.map +1 -1
  20. package/dist/components/fab-menu/index.js +13 -1
  21. package/dist/components/fab-menu/index.js.map +1 -1
  22. package/dist/components/icon-button/index.d.ts +50 -22
  23. package/dist/components/icon-button/index.js +130 -33
  24. package/dist/components/icon-button/index.js.map +1 -1
  25. package/dist/components/item/index.d.ts +5 -5
  26. package/dist/components/item/index.js +13 -1
  27. package/dist/components/item/index.js.map +1 -1
  28. package/dist/components/list/index.js +13 -1
  29. package/dist/components/list/index.js.map +1 -1
  30. package/dist/components/loading-indicator/index.js +13 -1
  31. package/dist/components/loading-indicator/index.js.map +1 -1
  32. package/dist/components/menu/index.js +13 -1
  33. package/dist/components/menu/index.js.map +1 -1
  34. package/dist/components/navigation-drawer/index.js +13 -1
  35. package/dist/components/navigation-drawer/index.js.map +1 -1
  36. package/dist/components/navigation-rail/index.js +13 -1
  37. package/dist/components/navigation-rail/index.js.map +1 -1
  38. package/dist/components/search/index.js +13 -1
  39. package/dist/components/search/index.js.map +1 -1
  40. package/dist/components/segmented-button/index.js +13 -1
  41. package/dist/components/segmented-button/index.js.map +1 -1
  42. package/dist/components/select/index.js +13 -1
  43. package/dist/components/select/index.js.map +1 -1
  44. package/dist/components/side-sheet/index.js +13 -1
  45. package/dist/components/side-sheet/index.js.map +1 -1
  46. package/dist/components/slider/index.js +49 -15
  47. package/dist/components/slider/index.js.map +1 -1
  48. package/dist/components/snackbar/index.d.ts +5 -5
  49. package/dist/components/split-button/index.js +13 -1
  50. package/dist/components/split-button/index.js.map +1 -1
  51. package/dist/components/tabs/index.js +13 -1
  52. package/dist/components/tabs/index.js.map +1 -1
  53. package/dist/components/time-picker/index.js +13 -1
  54. package/dist/components/time-picker/index.js.map +1 -1
  55. package/dist/components/toolbar/index.js +13 -1
  56. package/dist/components/toolbar/index.js.map +1 -1
  57. package/dist/components/tooltip/index.js +13 -1
  58. package/dist/components/tooltip/index.js.map +1 -1
  59. package/dist/components/top-app-bar/index.js +13 -1
  60. package/dist/components/top-app-bar/index.js.map +1 -1
  61. package/dist/index.d.ts +1 -1
  62. package/dist/index.js +333 -141
  63. package/dist/index.js.map +1 -1
  64. package/dist/tv.d.ts +13 -8
  65. package/dist/tv.js +13 -1
  66. package/dist/tv.js.map +1 -1
  67. package/package.json +3 -3
@@ -1,6 +1,47 @@
1
1
  "use client";
2
- import { createIconButton } from '@m3-baseui/core';
3
- import { tv } from 'tailwind-variants';
2
+ import { createIconButton, toToggle } from '@m3-baseui/core';
3
+ import { tv as tv$1 } from 'tailwind-variants';
4
+
5
+ // src/components/icon-button/icon-button.ts
6
+ var TYPESCALE = [
7
+ "display-large",
8
+ "display-medium",
9
+ "display-small",
10
+ "headline-large",
11
+ "headline-medium",
12
+ "headline-small",
13
+ "title-large",
14
+ "title-medium",
15
+ "title-small",
16
+ "body-large",
17
+ "body-medium",
18
+ "body-small",
19
+ "label-large",
20
+ "label-medium",
21
+ "label-small"
22
+ ];
23
+ var SHAPE = [
24
+ "none",
25
+ "extra-small",
26
+ "small",
27
+ "medium",
28
+ "large",
29
+ "large-increased",
30
+ "extra-large",
31
+ "extra-large-increased",
32
+ "full"
33
+ ];
34
+ var tv = (options, config) => tv$1(options, {
35
+ ...config,
36
+ twMergeConfig: {
37
+ extend: {
38
+ classGroups: {
39
+ "font-size": [{ text: [...TYPESCALE] }],
40
+ rounded: [{ rounded: [...SHAPE] }]
41
+ }
42
+ }
43
+ }
44
+ });
4
45
 
5
46
  // src/components/icon-button/icon-button.ts
6
47
  var WIDTHS = {
@@ -22,6 +63,35 @@ var widthCompounds = Object.entries(WIDTHS).flatMap(
22
63
  class: klass
23
64
  }))
24
65
  );
66
+ var SQUARE_CORNER = {
67
+ xs: "rounded-medium",
68
+ // 12dp
69
+ s: "rounded-medium",
70
+ // 12dp
71
+ m: "rounded-large",
72
+ // 16dp
73
+ l: "rounded-extra-large",
74
+ // 28dp
75
+ xl: "rounded-extra-large"
76
+ // 28dp
77
+ };
78
+ var squareShapeCompounds = Object.keys(SQUARE_CORNER).map(
79
+ (size) => ({ shape: "square", size, class: SQUARE_CORNER[size] })
80
+ );
81
+ var selectedShapeCompounds = [
82
+ ...Object.keys(SQUARE_CORNER).map((size) => ({
83
+ shape: "round",
84
+ toggle: "on",
85
+ size,
86
+ class: SQUARE_CORNER[size]
87
+ })),
88
+ ...Object.keys(SQUARE_CORNER).map((size) => ({
89
+ shape: "square",
90
+ toggle: "on",
91
+ size,
92
+ class: "rounded-full"
93
+ }))
94
+ ];
25
95
  var iconButton = tv({
26
96
  base: [
27
97
  "relative inline-flex items-center justify-center shrink-0",
@@ -29,7 +99,9 @@ var iconButton = tv({
29
99
  // The state layer is already rounded (before:rounded-[inherit]); the ripple
30
100
  // self-clips.
31
101
  "rounded-full cursor-pointer select-none border-0 bg-transparent",
32
- "transition-[box-shadow,background-color,color] duration-200 ease-standard",
102
+ // Motion: Compose uses DefaultEffects (critically-damped spring, no bounce)
103
+ // for the shape/color transitions — spring-effects-default here.
104
+ "transition-[box-shadow,background-color,color,border-color,border-radius] duration-200 ease-spring-effects-default",
33
105
  // State layer overlay
34
106
  "before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:pointer-events-none",
35
107
  "before:transition-opacity before:duration-100",
@@ -40,14 +112,14 @@ var iconButton = tv({
40
112
  // Focus ring (M3: 3px secondary, 2px offset)
41
113
  "focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary",
42
114
  // Disabled: no interaction, no state layer. Per-variant disabled colors
43
- // (container on-surface/12, icon on-surface/38) live on each variant.
115
+ // (container on-surface/10, icon on-surface/38) live on each variant.
44
116
  "disabled:pointer-events-none disabled:before:opacity-0",
45
117
  "data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0"
46
118
  ],
47
119
  variants: {
48
120
  // Disabled icon is on-surface/38 for every variant; filled/tonal disabled
49
- // container is on-surface/12; outlined disabled outline is on-surface/12
50
- // (material-web parity).
121
+ // container is on-surface/10 (DisabledContainerOpacity); outlined disabled
122
+ // outline stays outline-variant (Expressive DisabledOutlineColor).
51
123
  variant: {
52
124
  standard: [
53
125
  "text-on-surface-variant",
@@ -55,68 +127,93 @@ var iconButton = tv({
55
127
  ],
56
128
  filled: [
57
129
  "bg-primary text-on-primary",
58
- "disabled:bg-on-surface/12 disabled:text-on-surface/38",
59
- "data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38"
130
+ "disabled:bg-on-surface/10 disabled:text-on-surface/38",
131
+ "data-[disabled]:bg-on-surface/10 data-[disabled]:text-on-surface/38"
60
132
  ],
61
133
  tonal: [
62
134
  "bg-secondary-container text-on-secondary-container",
63
- "disabled:bg-on-surface/12 disabled:text-on-surface/38",
64
- "data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38"
135
+ "disabled:bg-on-surface/10 disabled:text-on-surface/38",
136
+ "data-[disabled]:bg-on-surface/10 data-[disabled]:text-on-surface/38"
65
137
  ],
66
138
  outlined: [
67
- "border border-outline text-on-surface-variant",
68
- "disabled:border-on-surface/12 disabled:text-on-surface/38",
69
- "data-[disabled]:border-on-surface/12 data-[disabled]:text-on-surface/38"
139
+ "border border-outline-variant text-on-surface-variant",
140
+ "disabled:border-outline-variant disabled:text-on-surface/38",
141
+ "data-[disabled]:border-outline-variant data-[disabled]:text-on-surface/38"
70
142
  ]
71
143
  },
72
- selected: {
73
- true: "",
74
- false: ""
144
+ // Toggle state, string-keyed so a plain (non-toggle) button — `toggle`
145
+ // unset — fires neither compound below (a boolean variant would default to
146
+ // `off` in tailwind-variants and wrongly apply the unselected look).
147
+ toggle: {
148
+ on: "",
149
+ off: ""
75
150
  },
76
151
  // Container height + icon size per M3 Expressive size. Width comes from the
77
- // (size, width) compound variants below.
152
+ // (size, width) compound variants below. The pressed corner morph
153
+ // (PressedContainerShape: XS·S small 8 / M medium 12 / L·XL large 16) rides
154
+ // on data-[pressed]/active so its attribute-selector specificity wins over
155
+ // the resting `rounded-*`.
78
156
  size: {
79
- xs: "h-8 [&>svg]:size-5",
80
- s: "h-10 [&>svg]:size-6",
81
- m: "h-14 [&>svg]:size-6",
82
- l: "h-24 [&>svg]:size-8",
83
- xl: "h-[136px] [&>svg]:size-10"
157
+ xs: "h-8 [&>svg]:size-5 data-[pressed]:rounded-small active:rounded-small",
158
+ s: "h-10 [&>svg]:size-6 data-[pressed]:rounded-small active:rounded-small",
159
+ m: "h-14 [&>svg]:size-6 data-[pressed]:rounded-medium active:rounded-medium",
160
+ l: "h-24 [&>svg]:size-8 data-[pressed]:rounded-large active:rounded-large",
161
+ xl: "h-[136px] [&>svg]:size-10 data-[pressed]:rounded-large active:rounded-large"
84
162
  },
85
163
  width: {
86
164
  narrow: "",
87
165
  default: "",
88
166
  wide: ""
167
+ },
168
+ // round = full circle; the square corner is size-specific (compounds below).
169
+ shape: {
170
+ round: "rounded-full",
171
+ square: ""
89
172
  }
90
173
  },
91
174
  compoundVariants: [
92
175
  ...widthCompounds,
93
- { variant: "standard", selected: true, class: "text-primary" },
94
- { variant: "filled", selected: false, class: "bg-surface-container-highest text-primary" },
176
+ ...squareShapeCompounds,
177
+ ...selectedShapeCompounds,
178
+ // ---- Outlined border width (OutlinedOutlineWidth: L 2 / XL 3 dp) ------
179
+ { variant: "outlined", size: "l", class: "border-2" },
180
+ { variant: "outlined", size: "xl", class: "border-[3px]" },
181
+ // ---- Toggle colors (Selected*/Unselected* tokens) ---------------------
182
+ // standard: unselected = on-surface-variant (base); selected = primary.
183
+ { variant: "standard", toggle: "on", class: "text-primary" },
184
+ // filled: base = default & selected look (primary/on-primary); unselected =
185
+ // surface-container + on-surface-variant (was surface-container-highest+primary).
95
186
  {
96
- variant: "tonal",
97
- selected: false,
98
- class: "bg-surface-container-highest text-on-surface-variant"
187
+ variant: "filled",
188
+ toggle: "off",
189
+ class: "bg-surface-container text-on-surface-variant"
99
190
  },
191
+ // tonal: base = default & unselected look (secondary-container); selected =
192
+ // secondary + on-secondary (was left at the variant default — the "selection
193
+ // not visible" bug this issue fixes).
194
+ { variant: "tonal", toggle: "on", class: "bg-secondary text-on-secondary" },
195
+ // outlined: selected fills with the inverse surface (base = unselected).
100
196
  {
101
197
  variant: "outlined",
102
- selected: true,
198
+ toggle: "on",
103
199
  class: [
104
200
  "bg-inverse-surface text-inverse-on-surface border-transparent",
105
- // M3 disabled + selected: faint on-surface/12 container, no outline
201
+ // M3 disabled + selected: faint on-surface/10 container, no outline
106
202
  // (icon falls back to on-surface/38 from the variant). NOT transparent.
107
- "disabled:bg-on-surface/12 disabled:border-transparent",
108
- "data-[disabled]:bg-on-surface/12 data-[disabled]:border-transparent"
203
+ "disabled:bg-on-surface/10 disabled:border-transparent",
204
+ "data-[disabled]:bg-on-surface/10 data-[disabled]:border-transparent"
109
205
  ]
110
206
  }
111
207
  ],
112
208
  defaultVariants: {
113
209
  variant: "standard",
114
210
  size: "s",
115
- width: "default"
211
+ width: "default",
212
+ shape: "round"
116
213
  }
117
214
  });
118
215
  var IconButton = createIconButton(
119
- ({ variant, selected, size, width }) => iconButton({ variant, selected, size, width })
216
+ ({ variant, selected, size, width, shape }) => iconButton({ variant, size, width, shape, toggle: toToggle(selected) })
120
217
  );
121
218
 
122
219
  export { IconButton, iconButton };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/icon-button/icon-button.ts"],"names":[],"mappings":";;;;;AAYA,IAAM,MAAA,GAAS;AAAA,EACb,IAAI,EAAE,MAAA,EAAQ,OAAO,OAAA,EAAS,KAAA,EAAO,MAAM,MAAA,EAAO;AAAA;AAAA,EAClD,GAAG,EAAE,MAAA,EAAQ,OAAO,OAAA,EAAS,MAAA,EAAQ,MAAM,MAAA,EAAO;AAAA;AAAA,EAClD,GAAG,EAAE,MAAA,EAAQ,QAAQ,OAAA,EAAS,MAAA,EAAQ,MAAM,MAAA,EAAO;AAAA;AAAA,EACnD,GAAG,EAAE,MAAA,EAAQ,QAAQ,OAAA,EAAS,MAAA,EAAQ,MAAM,MAAA,EAAO;AAAA;AAAA,EACnD,IAAI,EAAE,MAAA,EAAQ,QAAQ,OAAA,EAAS,MAAA,EAAQ,MAAM,MAAA;AAAO;AACtD,CAAA;AAEA,IAAM,cAAA,GAAiB,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,CAAE,OAAA;AAAA,EAAQ,CAAC,CAAC,IAAA,EAAM,CAAC,MAC7D,MAAA,CAAO,OAAA,CAAQ,CAAC,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,KAAA,EAAO,KAAK,CAAA,MAAO;AAAA,IACzC,IAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA,EAAO;AAAA,GACT,CAAE;AACJ,CAAA;AAEO,IAAM,aAAa,EAAA,CAAG;AAAA,EAC3B,IAAA,EAAM;AAAA,IACJ,2DAAA;AAAA;AAAA;AAAA;AAAA,IAIA,iEAAA;AAAA,IACA,2EAAA;AAAA;AAAA,IAEA,uHAAA;AAAA,IACA,+CAAA;AAAA,IACA,kDAAA;AAAA,IACA,0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A,MACE,OAAA,EAAS,UAAA;AAAA,MACT,QAAA,EAAU,IAAA;AAAA,MACV,KAAA,EAAO;AAAA,QACL,+DAAA;AAAA;AAAA;AAAA,QAGA,uDAAA;AAAA,QACA;AAAA;AACF;AACF,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS,UAAA;AAAA,IACT,IAAA,EAAM,GAAA;AAAA,IACN,KAAA,EAAO;AAAA;AAEX,CAAC;AAEM,IAAM,UAAA,GAAa,gBAAA;AAAA,EAAiB,CAAC,EAAE,OAAA,EAAS,QAAA,EAAU,IAAA,EAAM,KAAA,EAAM,KAC3E,UAAA,CAAW,EAAE,OAAA,EAAS,QAAA,EAAU,IAAA,EAAM,OAAO;AAC/C","file":"index.js","sourcesContent":["/**\n * icon-button.ts — tailwind-variants resolver for the M3 Icon Button.\n *\n * 40×40 circular target with a centered icon. The `selected` variant supports\n * toggle icon buttons; when `selected` is undefined the variant's default\n * (filled/active) look is used. Emits the same DOM + ripple as the VE build.\n */\nimport { createIconButton } from '@m3-baseui/core';\nimport { tv } from 'tailwind-variants';\n\n// M3 Expressive container widths (px) per size × width. Tailwind v4's dynamic\n// spacing scale resolves any integer (e.g. w-13 = 52px, w-46 = 184px).\nconst WIDTHS = {\n xs: { narrow: 'w-7', default: 'w-8', wide: 'w-10' }, // 28 / 32 / 40\n s: { narrow: 'w-8', default: 'w-10', wide: 'w-13' }, // 32 / 40 / 52\n m: { narrow: 'w-12', default: 'w-14', wide: 'w-18' }, // 48 / 56 / 72\n l: { narrow: 'w-16', default: 'w-24', wide: 'w-32' }, // 64 / 96 / 128\n xl: { narrow: 'w-26', default: 'w-34', wide: 'w-46' }, // 104 / 136 / 184\n} as const;\n\nconst widthCompounds = Object.entries(WIDTHS).flatMap(([size, w]) =>\n Object.entries(w).map(([width, klass]) => ({\n size: size as keyof typeof WIDTHS,\n width: width as 'narrow' | 'default' | 'wide',\n class: klass,\n })),\n);\n\nexport const iconButton = tv({\n base: [\n 'relative inline-flex items-center justify-center shrink-0',\n // No `overflow-hidden`: it would clip the 48dp touch target on small sizes.\n // The state layer is already rounded (before:rounded-[inherit]); the ripple\n // self-clips.\n 'rounded-full cursor-pointer select-none border-0 bg-transparent',\n 'transition-[box-shadow,background-color,color] duration-200 ease-standard',\n // State layer overlay\n 'before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:pointer-events-none',\n 'before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'focus-visible:before:opacity-[var(--md-sys-state-focus)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n 'data-[pressed]:before:opacity-[var(--md-sys-state-pressed)]',\n // Focus ring (M3: 3px secondary, 2px offset)\n 'focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary',\n // Disabled: no interaction, no state layer. Per-variant disabled colors\n // (container on-surface/12, icon on-surface/38) live on each variant.\n 'disabled:pointer-events-none disabled:before:opacity-0',\n 'data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0',\n ],\n variants: {\n // Disabled icon is on-surface/38 for every variant; filled/tonal disabled\n // container is on-surface/12; outlined disabled outline is on-surface/12\n // (material-web parity).\n variant: {\n standard: [\n 'text-on-surface-variant',\n 'disabled:text-on-surface/38 data-[disabled]:text-on-surface/38',\n ],\n filled: [\n 'bg-primary text-on-primary',\n 'disabled:bg-on-surface/12 disabled:text-on-surface/38',\n 'data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38',\n ],\n tonal: [\n 'bg-secondary-container text-on-secondary-container',\n 'disabled:bg-on-surface/12 disabled:text-on-surface/38',\n 'data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38',\n ],\n outlined: [\n 'border border-outline text-on-surface-variant',\n 'disabled:border-on-surface/12 disabled:text-on-surface/38',\n 'data-[disabled]:border-on-surface/12 data-[disabled]:text-on-surface/38',\n ],\n },\n selected: {\n true: '',\n false: '',\n },\n // Container height + icon size per M3 Expressive size. Width comes from the\n // (size, width) compound variants below.\n size: {\n xs: 'h-8 [&>svg]:size-5',\n s: 'h-10 [&>svg]:size-6',\n m: 'h-14 [&>svg]:size-6',\n l: 'h-24 [&>svg]:size-8',\n xl: 'h-[136px] [&>svg]:size-10',\n },\n width: {\n narrow: '',\n default: '',\n wide: '',\n },\n },\n compoundVariants: [\n ...widthCompounds,\n { variant: 'standard', selected: true, class: 'text-primary' },\n { variant: 'filled', selected: false, class: 'bg-surface-container-highest text-primary' },\n {\n variant: 'tonal',\n selected: false,\n class: 'bg-surface-container-highest text-on-surface-variant',\n },\n {\n variant: 'outlined',\n selected: true,\n class: [\n 'bg-inverse-surface text-inverse-on-surface border-transparent',\n // M3 disabled + selected: faint on-surface/12 container, no outline\n // (icon falls back to on-surface/38 from the variant). NOT transparent.\n 'disabled:bg-on-surface/12 disabled:border-transparent',\n 'data-[disabled]:bg-on-surface/12 data-[disabled]:border-transparent',\n ],\n },\n ],\n defaultVariants: {\n variant: 'standard',\n size: 's',\n width: 'default',\n },\n});\n\nexport const IconButton = createIconButton(({ variant, selected, size, width }) =>\n iconButton({ variant, selected, size, width }),\n);\nexport type { IconButtonProps, IconButtonVariant } from '@m3-baseui/core';\n"]}
1
+ {"version":3,"sources":["../../../src/tv.ts","../../../src/components/icon-button/icon-button.ts"],"names":["baseTv"],"mappings":";;;;;AAoBA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAKA,IAAM,KAAA,GAAQ;AAAA,EACZ,MAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA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IAAA,EAAM,OAAO,cAAA,EAAe;AAAA;AAAA;AAAA,IAG3D;AAAA,MACE,OAAA,EAAS,QAAA;AAAA,MACT,MAAA,EAAQ,KAAA;AAAA,MACR,KAAA,EAAO;AAAA,KACT;AAAA;AAAA;AAAA;AAAA,IAIA,EAAE,OAAA,EAAS,OAAA,EAAS,MAAA,EAAQ,IAAA,EAAM,OAAO,gCAAA,EAAiC;AAAA;AAAA,IAE1E;AAAA,MACE,OAAA,EAAS,UAAA;AAAA,MACT,MAAA,EAAQ,IAAA;AAAA,MACR,KAAA,EAAO;AAAA,QACL,+DAAA;AAAA;AAAA;AAAA,QAGA,uDAAA;AAAA,QACA;AAAA;AACF;AACF,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS,UAAA;AAAA,IACT,IAAA,EAAM,GAAA;AAAA,IACN,KAAA,EAAO,SAAA;AAAA,IACP,KAAA,EAAO;AAAA;AAEX,CAAC;AAEM,IAAM,UAAA,GAAa,gBAAA;AAAA,EAAiB,CAAC,EAAE,OAAA,EAAS,UAAU,IAAA,EAAM,KAAA,EAAO,OAAM,KAClF,UAAA,CAAW,EAAE,OAAA,EAAS,MAAM,KAAA,EAAO,KAAA,EAAO,QAAQ,QAAA,CAAS,QAAQ,GAAG;AACxE","file":"index.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale and\n * shape scale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`) and the\n * shape scale as `rounded-<role>` border-radius utilities (e.g. `rounded-small`,\n * `rounded-extra-large`). Stock tailwind-merge does not know these custom names,\n * so it (a) groups the typescale names with `text-<color>` and drops one when a\n * slot sets both a color *and* a typescale, and (b) fails to see two custom\n * `rounded-<role>` classes as conflicting, so a later corner override never\n * dedupes the resting one (both survive, and CSS source order — not intent —\n * decides). Either way token compliance / shape morph silently breaks.\n *\n * Teaching tailwind-merge that the typescale names belong to `font-size` and the\n * shape names belong to `rounded` keeps color and type independent and makes the\n * corner utilities override one another as expected.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\n// M3 shape scale exposed as `rounded-<role>` (see @m3-baseui/tokens theme.css\n// `--radius-*`). `none` / `full` overlap stock Tailwind and are harmless to\n// re-list; the intermediate roles are what stock tailwind-merge misses.\nconst SHAPE = [\n 'none',\n 'extra-small',\n 'small',\n 'medium',\n 'large',\n 'large-increased',\n 'extra-large',\n 'extra-large-increased',\n 'full',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n rounded: [{ rounded: [...SHAPE] }],\n },\n },\n },\n });\n","/**\n * icon-button.ts — tailwind-variants resolver for the M3 (Expressive) Icon Button.\n *\n * Emits the same DOM + `data-*` state as the vanilla-extract build (drop-in\n * compatible); only the class strings differ. The `rounded-<role>` corner\n * utilities come from the Tailwind v4 `@theme` preset in\n * `@m3-baseui/tokens/theme.css`; the configured `tv` helper teaches\n * tailwind-merge to dedupe them so a morph override drops the resting corner.\n *\n * M3 Expressive: five sizes (XS 32 → XL 136 dp) drive height / icon size and\n * (with `width`) the container width; `shape` picks the resting corner\n * (round=full circle vs a size-specific square), the corner morphs smaller on\n * press, and toggle buttons (`selected`) swap to the opposite shape\n * (round↔square) plus the Selected/Unselected color set.\n */\nimport { createIconButton, toToggle } from '@m3-baseui/core';\nimport { tv } from '../../tv';\n\n// M3 Expressive container widths (px) per size × width. Tailwind v4's dynamic\n// spacing scale resolves any integer (e.g. w-13 = 52px, w-46 = 184px).\nconst WIDTHS = {\n xs: { narrow: 'w-7', default: 'w-8', wide: 'w-10' }, // 28 / 32 / 40\n s: { narrow: 'w-8', default: 'w-10', wide: 'w-13' }, // 32 / 40 / 52\n m: { narrow: 'w-12', default: 'w-14', wide: 'w-18' }, // 48 / 56 / 72\n l: { narrow: 'w-16', default: 'w-24', wide: 'w-32' }, // 64 / 96 / 128\n xl: { narrow: 'w-26', default: 'w-34', wide: 'w-46' }, // 104 / 136 / 184\n} as const;\n\nconst widthCompounds = Object.entries(WIDTHS).flatMap(([size, w]) =>\n Object.entries(w).map(([width, klass]) => ({\n size: size as keyof typeof WIDTHS,\n width: width as 'narrow' | 'default' | 'wide',\n class: klass,\n })),\n);\n\n// Resting square corner (ContainerShapeSquare) per size bucket.\nconst SQUARE_CORNER = {\n xs: 'rounded-medium', // 12dp\n s: 'rounded-medium', // 12dp\n m: 'rounded-large', // 16dp\n l: 'rounded-extra-large', // 28dp\n xl: 'rounded-extra-large', // 28dp\n} as const;\n\n// Resting square corner: `shape: square` maps to the size-specific corner.\nconst squareShapeCompounds = (Object.keys(SQUARE_CORNER) as (keyof typeof SQUARE_CORNER)[]).map(\n (size) => ({ shape: 'square' as const, size, class: SQUARE_CORNER[size] }),\n);\n\n// Selected shape morph (Expressive's signature behavior). Listed after the\n// resting corner so tailwind-merge keeps these: a selected `round` container\n// morphs to the square corner; a selected `square` container morphs to `full`.\nconst selectedShapeCompounds = [\n ...(Object.keys(SQUARE_CORNER) as (keyof typeof SQUARE_CORNER)[]).map((size) => ({\n shape: 'round' as const,\n toggle: 'on' as const,\n size,\n class: SQUARE_CORNER[size],\n })),\n ...(Object.keys(SQUARE_CORNER) as (keyof typeof SQUARE_CORNER)[]).map((size) => ({\n shape: 'square' as const,\n toggle: 'on' as const,\n size,\n class: 'rounded-full',\n })),\n];\n\nexport const iconButton = tv({\n base: [\n 'relative inline-flex items-center justify-center shrink-0',\n // No `overflow-hidden`: it would clip the 48dp touch target on small sizes.\n // The state layer is already rounded (before:rounded-[inherit]); the ripple\n // self-clips.\n 'rounded-full cursor-pointer select-none border-0 bg-transparent',\n // Motion: Compose uses DefaultEffects (critically-damped spring, no bounce)\n // for the shape/color transitions — spring-effects-default here.\n 'transition-[box-shadow,background-color,color,border-color,border-radius] duration-200 ease-spring-effects-default',\n // State layer overlay\n 'before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:pointer-events-none',\n 'before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'focus-visible:before:opacity-[var(--md-sys-state-focus)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n 'data-[pressed]:before:opacity-[var(--md-sys-state-pressed)]',\n // Focus ring (M3: 3px secondary, 2px offset)\n 'focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary',\n // Disabled: no interaction, no state layer. Per-variant disabled colors\n // (container on-surface/10, icon on-surface/38) live on each variant.\n 'disabled:pointer-events-none disabled:before:opacity-0',\n 'data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0',\n ],\n variants: {\n // Disabled icon is on-surface/38 for every variant; filled/tonal disabled\n // container is on-surface/10 (DisabledContainerOpacity); outlined disabled\n // outline stays outline-variant (Expressive DisabledOutlineColor).\n variant: {\n standard: [\n 'text-on-surface-variant',\n 'disabled:text-on-surface/38 data-[disabled]:text-on-surface/38',\n ],\n filled: [\n 'bg-primary text-on-primary',\n 'disabled:bg-on-surface/10 disabled:text-on-surface/38',\n 'data-[disabled]:bg-on-surface/10 data-[disabled]:text-on-surface/38',\n ],\n tonal: [\n 'bg-secondary-container text-on-secondary-container',\n 'disabled:bg-on-surface/10 disabled:text-on-surface/38',\n 'data-[disabled]:bg-on-surface/10 data-[disabled]:text-on-surface/38',\n ],\n outlined: [\n 'border border-outline-variant text-on-surface-variant',\n 'disabled:border-outline-variant disabled:text-on-surface/38',\n 'data-[disabled]:border-outline-variant data-[disabled]:text-on-surface/38',\n ],\n },\n // Toggle state, string-keyed so a plain (non-toggle) button — `toggle`\n // unset — fires neither compound below (a boolean variant would default to\n // `off` in tailwind-variants and wrongly apply the unselected look).\n toggle: {\n on: '',\n off: '',\n },\n // Container height + icon size per M3 Expressive size. Width comes from the\n // (size, width) compound variants below. The pressed corner morph\n // (PressedContainerShape: XS·S small 8 / M medium 12 / L·XL large 16) rides\n // on data-[pressed]/active so its attribute-selector specificity wins over\n // the resting `rounded-*`.\n size: {\n xs: 'h-8 [&>svg]:size-5 data-[pressed]:rounded-small active:rounded-small',\n s: 'h-10 [&>svg]:size-6 data-[pressed]:rounded-small active:rounded-small',\n m: 'h-14 [&>svg]:size-6 data-[pressed]:rounded-medium active:rounded-medium',\n l: 'h-24 [&>svg]:size-8 data-[pressed]:rounded-large active:rounded-large',\n xl: 'h-[136px] [&>svg]:size-10 data-[pressed]:rounded-large active:rounded-large',\n },\n width: {\n narrow: '',\n default: '',\n wide: '',\n },\n // round = full circle; the square corner is size-specific (compounds below).\n shape: {\n round: 'rounded-full',\n square: '',\n },\n },\n compoundVariants: [\n ...widthCompounds,\n ...squareShapeCompounds,\n ...selectedShapeCompounds,\n // ---- Outlined border width (OutlinedOutlineWidth: L 2 / XL 3 dp) ------\n { variant: 'outlined', size: 'l', class: 'border-2' },\n { variant: 'outlined', size: 'xl', class: 'border-[3px]' },\n // ---- Toggle colors (Selected*/Unselected* tokens) ---------------------\n // standard: unselected = on-surface-variant (base); selected = primary.\n { variant: 'standard', toggle: 'on', class: 'text-primary' },\n // filled: base = default & selected look (primary/on-primary); unselected =\n // surface-container + on-surface-variant (was surface-container-highest+primary).\n {\n variant: 'filled',\n toggle: 'off',\n class: 'bg-surface-container text-on-surface-variant',\n },\n // tonal: base = default & unselected look (secondary-container); selected =\n // secondary + on-secondary (was left at the variant default — the \"selection\n // not visible\" bug this issue fixes).\n { variant: 'tonal', toggle: 'on', class: 'bg-secondary text-on-secondary' },\n // outlined: selected fills with the inverse surface (base = unselected).\n {\n variant: 'outlined',\n toggle: 'on',\n class: [\n 'bg-inverse-surface text-inverse-on-surface border-transparent',\n // M3 disabled + selected: faint on-surface/10 container, no outline\n // (icon falls back to on-surface/38 from the variant). NOT transparent.\n 'disabled:bg-on-surface/10 disabled:border-transparent',\n 'data-[disabled]:bg-on-surface/10 data-[disabled]:border-transparent',\n ],\n },\n ],\n defaultVariants: {\n variant: 'standard',\n size: 's',\n width: 'default',\n shape: 'round',\n },\n});\n\nexport const IconButton = createIconButton(({ variant, selected, size, width, shape }) =>\n iconButton({ variant, size, width, shape, toggle: toToggle(selected) }),\n);\nexport type {\n IconButtonProps,\n IconButtonVariant,\n IconButtonSize,\n IconButtonWidth,\n IconButtonShape,\n} from '@m3-baseui/core';\n"]}
@@ -9,9 +9,9 @@ declare const itemTv: tailwind_variants.TVReturnType<{
9
9
  [key: string]: {
10
10
  [key: string]: tailwind_merge.ClassNameValue | {
11
11
  content?: tailwind_merge.ClassNameValue;
12
+ overline?: tailwind_merge.ClassNameValue;
12
13
  leading?: tailwind_merge.ClassNameValue;
13
14
  trailing?: tailwind_merge.ClassNameValue;
14
- overline?: tailwind_merge.ClassNameValue;
15
15
  supporting?: tailwind_merge.ClassNameValue;
16
16
  root?: tailwind_merge.ClassNameValue;
17
17
  headline?: tailwind_merge.ClassNameValue;
@@ -21,9 +21,9 @@ declare const itemTv: tailwind_variants.TVReturnType<{
21
21
  [x: string]: {
22
22
  [x: string]: tailwind_merge.ClassNameValue | {
23
23
  content?: tailwind_merge.ClassNameValue;
24
+ overline?: tailwind_merge.ClassNameValue;
24
25
  leading?: tailwind_merge.ClassNameValue;
25
26
  trailing?: tailwind_merge.ClassNameValue;
26
- overline?: tailwind_merge.ClassNameValue;
27
27
  supporting?: tailwind_merge.ClassNameValue;
28
28
  root?: tailwind_merge.ClassNameValue;
29
29
  headline?: tailwind_merge.ClassNameValue;
@@ -41,9 +41,9 @@ declare const itemTv: tailwind_variants.TVReturnType<{
41
41
  [key: string]: {
42
42
  [key: string]: tailwind_merge.ClassNameValue | {
43
43
  content?: tailwind_merge.ClassNameValue;
44
+ overline?: tailwind_merge.ClassNameValue;
44
45
  leading?: tailwind_merge.ClassNameValue;
45
46
  trailing?: tailwind_merge.ClassNameValue;
46
- overline?: tailwind_merge.ClassNameValue;
47
47
  supporting?: tailwind_merge.ClassNameValue;
48
48
  root?: tailwind_merge.ClassNameValue;
49
49
  headline?: tailwind_merge.ClassNameValue;
@@ -53,9 +53,9 @@ declare const itemTv: tailwind_variants.TVReturnType<{
53
53
  [key: string]: {
54
54
  [key: string]: tailwind_merge.ClassNameValue | {
55
55
  content?: tailwind_merge.ClassNameValue;
56
+ overline?: tailwind_merge.ClassNameValue;
56
57
  leading?: tailwind_merge.ClassNameValue;
57
58
  trailing?: tailwind_merge.ClassNameValue;
58
- overline?: tailwind_merge.ClassNameValue;
59
59
  supporting?: tailwind_merge.ClassNameValue;
60
60
  root?: tailwind_merge.ClassNameValue;
61
61
  headline?: tailwind_merge.ClassNameValue;
@@ -81,9 +81,9 @@ declare const itemTv: tailwind_variants.TVReturnType<{
81
81
  [key: string]: {
82
82
  [key: string]: tailwind_merge.ClassNameValue | {
83
83
  content?: tailwind_merge.ClassNameValue;
84
+ overline?: tailwind_merge.ClassNameValue;
84
85
  leading?: tailwind_merge.ClassNameValue;
85
86
  trailing?: tailwind_merge.ClassNameValue;
86
- overline?: tailwind_merge.ClassNameValue;
87
87
  supporting?: tailwind_merge.ClassNameValue;
88
88
  root?: tailwind_merge.ClassNameValue;
89
89
  headline?: tailwind_merge.ClassNameValue;
@@ -21,12 +21,24 @@ var TYPESCALE = [
21
21
  "label-medium",
22
22
  "label-small"
23
23
  ];
24
+ var SHAPE = [
25
+ "none",
26
+ "extra-small",
27
+ "small",
28
+ "medium",
29
+ "large",
30
+ "large-increased",
31
+ "extra-large",
32
+ "extra-large-increased",
33
+ "full"
34
+ ];
24
35
  var tv = (options, config) => tv$1(options, {
25
36
  ...config,
26
37
  twMergeConfig: {
27
38
  extend: {
28
39
  classGroups: {
29
- "font-size": [{ text: [...TYPESCALE] }]
40
+ "font-size": [{ text: [...TYPESCALE] }],
41
+ rounded: [{ rounded: [...SHAPE] }]
30
42
  }
31
43
  }
32
44
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/tv.ts","../../../src/components/item/item.ts"],"names":["baseTv"],"mappings":";;;;;;AAeA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,EAAA,GAAS,CAAC,OAAA,EAAS,MAAA,KAC9BA,KAAO,OAAA,EAAS;AAAA,EACd,GAAG,MAAA;AAAA,EACH,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,WAAA,EAAa;AAAA,QACX,WAAA,EAAa,CAAC,EAAE,IAAA,EAAM,CAAC,GAAG,SAAS,GAAG;AAAA;AACxC;AACF;AAEJ,CAAC,CAAA;AChCI,IAAM,SAAS,EAAA,CAAG;AAAA,EACvB,KAAA,EAAO;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,iFAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,OAAA,EAAS;AAAA,MACP,mFAAA;AAAA,MACA,uDAAA;AAAA;AAAA,MAEA,kEAAA;AAAA,MACA,8BAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,OAAA,EAAS,8BAAA;AAAA,IACT,QAAA,EAAU,0CAAA;AAAA,IACV,QAAA,EAAU,iCAAA;AAAA,IACV,UAAA,EAAY,0CAAA;AAAA,IACZ,QAAA,EAAU;AAAA;AAEd,CAAC;AAED,IAAM,IAAI,MAAA,EAAO;AACV,IAAM,OAAO,UAAA,CAAW;AAAA,EAC7B,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,OAAA,EAAS,EAAE,OAAA,EAAQ;AAAA,EACnB,OAAA,EAAS,EAAE,OAAA,EAAQ;AAAA,EACnB,QAAA,EAAU,EAAE,QAAA,EAAS;AAAA,EACrB,QAAA,EAAU,EAAE,QAAA,EAAS;AAAA,EACrB,UAAA,EAAY,EAAE,UAAA,EAAW;AAAA,EACzB,QAAA,EAAU,EAAE,QAAA;AACd,CAAC","file":"index.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`). Stock\n * tailwind-merge does not know these custom names, so it groups them with the\n * `text-<color>` utilities and drops one when a slot sets both a color *and* a\n * typescale (the common M3 case). That silently strips either the color or the\n * type, breaking token compliance.\n *\n * Teaching tailwind-merge that the typescale names belong to the `font-size`\n * group keeps color and type independent, so both survive the merge.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n },\n },\n },\n });\n","/**\n * item.ts — tailwind-variants slots for the M3 Item row primitive.\n *\n * The shared row layout: leading slot, overline/headline/supporting column and\n * trailing slot. Headline is `body-large`/`on-surface`, overline `label-small`,\n * supporting `body-medium`, leading/trailing `on-surface-variant`. Inert by\n * design — interactive surfaces wrap it. Same DOM as the VE build.\n */\nimport { createItem } from '@m3-baseui/core';\nimport { tv } from '../../tv';\n\nexport const itemTv = tv({\n slots: {\n root: [\n 'relative flex w-full items-center gap-4 box-border px-4 py-3 min-h-14 text-left',\n 'bg-transparent text-on-surface',\n ],\n leading: [\n 'flex items-center justify-center shrink-0 overflow-hidden text-on-surface-variant',\n '[&_svg]:size-6 [&_img]:size-full [&_img]:object-cover',\n // M3 leading column widths, keyed on the factory's data-leading attribute.\n 'data-[leading=avatar]:size-10 data-[leading=avatar]:rounded-full',\n 'data-[leading=image]:size-14',\n 'data-[leading=video]:w-25 data-[leading=video]:h-14',\n ],\n content: 'flex flex-col min-w-0 flex-1',\n overline: 'text-label-small text-on-surface-variant',\n headline: 'text-body-large text-on-surface',\n supporting: 'text-body-medium text-on-surface-variant',\n trailing: 'flex items-center shrink-0 text-label-small text-on-surface-variant [&_svg]:size-6',\n },\n});\n\nconst s = itemTv();\nexport const Item = createItem({\n root: s.root(),\n leading: s.leading(),\n content: s.content(),\n overline: s.overline(),\n headline: s.headline(),\n supporting: s.supporting(),\n trailing: s.trailing(),\n});\nexport { ITEM_LEADING_VARIANTS } from '@m3-baseui/core';\nexport type { ItemProps, ItemLeadingVariant } from '@m3-baseui/core';\n"]}
1
+ {"version":3,"sources":["../../../src/tv.ts","../../../src/components/item/item.ts"],"names":["baseTv"],"mappings":";;;;;;AAoBA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAKA,IAAM,KAAA,GAAQ;AAAA,EACZ,MAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,iBAAA;AAAA,EACA,aAAA;AAAA,EACA,uBAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,EAAA,GAAS,CAAC,OAAA,EAAS,MAAA,KAC9BA,KAAO,OAAA,EAAS;AAAA,EACd,GAAG,MAAA;AAAA,EACH,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,WAAA,EAAa;AAAA,QACX,WAAA,EAAa,CAAC,EAAE,IAAA,EAAM,CAAC,GAAG,SAAS,GAAG,CAAA;AAAA,QACtC,OAAA,EAAS,CAAC,EAAE,OAAA,EAAS,CAAC,GAAG,KAAK,GAAG;AAAA;AACnC;AACF;AAEJ,CAAC,CAAA;ACrDI,IAAM,SAAS,EAAA,CAAG;AAAA,EACvB,KAAA,EAAO;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,iFAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,OAAA,EAAS;AAAA,MACP,mFAAA;AAAA,MACA,uDAAA;AAAA;AAAA,MAEA,kEAAA;AAAA,MACA,8BAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,OAAA,EAAS,8BAAA;AAAA,IACT,QAAA,EAAU,0CAAA;AAAA,IACV,QAAA,EAAU,iCAAA;AAAA,IACV,UAAA,EAAY,0CAAA;AAAA,IACZ,QAAA,EAAU;AAAA;AAEd,CAAC;AAED,IAAM,IAAI,MAAA,EAAO;AACV,IAAM,OAAO,UAAA,CAAW;AAAA,EAC7B,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,OAAA,EAAS,EAAE,OAAA,EAAQ;AAAA,EACnB,OAAA,EAAS,EAAE,OAAA,EAAQ;AAAA,EACnB,QAAA,EAAU,EAAE,QAAA,EAAS;AAAA,EACrB,QAAA,EAAU,EAAE,QAAA,EAAS;AAAA,EACrB,UAAA,EAAY,EAAE,UAAA,EAAW;AAAA,EACzB,QAAA,EAAU,EAAE,QAAA;AACd,CAAC","file":"index.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale and\n * shape scale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`) and the\n * shape scale as `rounded-<role>` border-radius utilities (e.g. `rounded-small`,\n * `rounded-extra-large`). Stock tailwind-merge does not know these custom names,\n * so it (a) groups the typescale names with `text-<color>` and drops one when a\n * slot sets both a color *and* a typescale, and (b) fails to see two custom\n * `rounded-<role>` classes as conflicting, so a later corner override never\n * dedupes the resting one (both survive, and CSS source order — not intent —\n * decides). Either way token compliance / shape morph silently breaks.\n *\n * Teaching tailwind-merge that the typescale names belong to `font-size` and the\n * shape names belong to `rounded` keeps color and type independent and makes the\n * corner utilities override one another as expected.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\n// M3 shape scale exposed as `rounded-<role>` (see @m3-baseui/tokens theme.css\n// `--radius-*`). `none` / `full` overlap stock Tailwind and are harmless to\n// re-list; the intermediate roles are what stock tailwind-merge misses.\nconst SHAPE = [\n 'none',\n 'extra-small',\n 'small',\n 'medium',\n 'large',\n 'large-increased',\n 'extra-large',\n 'extra-large-increased',\n 'full',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n rounded: [{ rounded: [...SHAPE] }],\n },\n },\n },\n });\n","/**\n * item.ts — tailwind-variants slots for the M3 Item row primitive.\n *\n * The shared row layout: leading slot, overline/headline/supporting column and\n * trailing slot. Headline is `body-large`/`on-surface`, overline `label-small`,\n * supporting `body-medium`, leading/trailing `on-surface-variant`. Inert by\n * design — interactive surfaces wrap it. Same DOM as the VE build.\n */\nimport { createItem } from '@m3-baseui/core';\nimport { tv } from '../../tv';\n\nexport const itemTv = tv({\n slots: {\n root: [\n 'relative flex w-full items-center gap-4 box-border px-4 py-3 min-h-14 text-left',\n 'bg-transparent text-on-surface',\n ],\n leading: [\n 'flex items-center justify-center shrink-0 overflow-hidden text-on-surface-variant',\n '[&_svg]:size-6 [&_img]:size-full [&_img]:object-cover',\n // M3 leading column widths, keyed on the factory's data-leading attribute.\n 'data-[leading=avatar]:size-10 data-[leading=avatar]:rounded-full',\n 'data-[leading=image]:size-14',\n 'data-[leading=video]:w-25 data-[leading=video]:h-14',\n ],\n content: 'flex flex-col min-w-0 flex-1',\n overline: 'text-label-small text-on-surface-variant',\n headline: 'text-body-large text-on-surface',\n supporting: 'text-body-medium text-on-surface-variant',\n trailing: 'flex items-center shrink-0 text-label-small text-on-surface-variant [&_svg]:size-6',\n },\n});\n\nconst s = itemTv();\nexport const Item = createItem({\n root: s.root(),\n leading: s.leading(),\n content: s.content(),\n overline: s.overline(),\n headline: s.headline(),\n supporting: s.supporting(),\n trailing: s.trailing(),\n});\nexport { ITEM_LEADING_VARIANTS } from '@m3-baseui/core';\nexport type { ItemProps, ItemLeadingVariant } from '@m3-baseui/core';\n"]}
@@ -21,12 +21,24 @@ var TYPESCALE = [
21
21
  "label-medium",
22
22
  "label-small"
23
23
  ];
24
+ var SHAPE = [
25
+ "none",
26
+ "extra-small",
27
+ "small",
28
+ "medium",
29
+ "large",
30
+ "large-increased",
31
+ "extra-large",
32
+ "extra-large-increased",
33
+ "full"
34
+ ];
24
35
  var tv = (options, config) => tv$1(options, {
25
36
  ...config,
26
37
  twMergeConfig: {
27
38
  extend: {
28
39
  classGroups: {
29
- "font-size": [{ text: [...TYPESCALE] }]
40
+ "font-size": [{ text: [...TYPESCALE] }],
41
+ rounded: [{ rounded: [...SHAPE] }]
30
42
  }
31
43
  }
32
44
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/tv.ts","../../../src/components/list/list.ts"],"names":["baseTv"],"mappings":";;;;;;AAeA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;A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,UACA,0DAAA;AAAA,UACA,qDAAA;AAAA,UACA,sEAAA;AAAA,UACA;AAAA;AACF,OACF;AAAA,MACA,OAAO;AAAC;AACV,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,KAAA,EAAO,CAAA;AAAA,IACP,WAAA,EAAa;AAAA;AAEjB,CAAC;AAEM,IAAM,OAAO,UAAA,CAAW;AAAA,EAC7B,IAAA,EAAM,MAAA,EAAO,CAAE,IAAA,EAAK;AAAA,EACpB,IAAA,EAAM,CAAC,EAAE,KAAA,EAAO,aAAY,KAAM;AAChC,IAAA,MAAM,CAAA,GAAI,MAAA,CAAO,EAAE,KAAA,EAAO,aAAa,CAAA;AACvC,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,MACb,OAAA,EAAS,EAAE,OAAA,EAAQ;AAAA,MACnB,OAAA,EAAS,EAAE,OAAA,EAAQ;AAAA,MACnB,QAAA,EAAU,EAAE,QAAA,EAAS;AAAA,MACrB,UAAA,EAAY,EAAE,UAAA,EAAW;AAAA,MACzB,QAAA,EAAU,EAAE,QAAA;AAAS,KACvB;AAAA,EACF;AACF,CAAC","file":"index.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`). Stock\n * tailwind-merge does not know these custom names, so it groups them with the\n * `text-<color>` utilities and drops one when a slot sets both a color *and* a\n * typescale (the common M3 case). That silently strips either the color or the\n * type, breaking token compliance.\n *\n * Teaching tailwind-merge that the typescale names belong to the `font-size`\n * group keeps color and type independent, so both survive the merge.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n },\n },\n },\n });\n","/**\n * list.ts — tailwind-variants slots for the M3 List.\n *\n * `surface` container with 8dp block padding; rows are 56/72/88dp for\n * one/two/three-line. Interactive rows get a `currentColor` state-layer\n * `::before` (the pointer ripple is added by the factory) and dim per-token when\n * `data-disabled`. Headline is `body-large`/`on-surface`, supporting\n * `body-medium`/`on-surface-variant`, leading/trailing `on-surface-variant`.\n * Same DOM as the VE build.\n */\nimport { createList } from '@m3-baseui/core';\nimport { tv } from '../../tv';\n\nexport const listTv = tv({\n slots: {\n root: 'list-none m-0 px-0 py-2 bg-transparent',\n item: [\n 'group relative flex w-full items-center gap-4 box-border px-4 text-left',\n 'bg-transparent border-0 text-on-surface no-underline',\n ],\n leading: [\n 'flex items-center justify-center shrink-0 overflow-hidden text-on-surface-variant',\n '[&_svg]:size-6 [&_img]:size-full [&_img]:object-cover',\n // M3 leading column widths, keyed on the factory's data-leading attribute.\n 'data-[leading=avatar]:size-10 data-[leading=avatar]:rounded-full',\n 'data-[leading=image]:size-14',\n 'data-[leading=video]:w-25 data-[leading=video]:h-14',\n ],\n content: 'flex flex-col min-w-0 flex-1',\n headline: 'text-body-large text-on-surface group-data-[disabled]:text-on-surface/38',\n supporting: 'text-body-medium text-on-surface-variant group-data-[disabled]:text-on-surface/38',\n trailing: [\n 'flex items-center shrink-0 text-label-small text-on-surface-variant [&_svg]:size-6',\n 'group-data-[disabled]:text-on-surface/38',\n ],\n },\n variants: {\n lines: {\n 1: { item: 'min-h-14 py-2' },\n 2: { item: 'min-h-[72px] py-2' },\n 3: { item: 'min-h-[88px] items-start py-3' },\n },\n interactive: {\n true: {\n item: [\n 'cursor-pointer select-none overflow-hidden outline-none',\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'focus-visible:before:opacity-[var(--md-sys-state-focus)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n 'data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0',\n 'disabled:pointer-events-none disabled:before:opacity-0',\n ],\n },\n false: {},\n },\n },\n defaultVariants: {\n lines: 1,\n interactive: false,\n },\n});\n\nexport const List = createList({\n root: listTv().root(),\n item: ({ lines, interactive }) => {\n const c = listTv({ lines, interactive });\n return {\n item: c.item(),\n leading: c.leading(),\n content: c.content(),\n headline: c.headline(),\n supporting: c.supporting(),\n trailing: c.trailing(),\n };\n },\n});\nexport { LIST_LEADING_VARIANTS } from '@m3-baseui/core';\nexport type { ListItemProps, ListItemLines, ListLeadingVariant } from '@m3-baseui/core';\n"]}
1
+ {"version":3,"sources":["../../../src/tv.ts","../../../src/components/list/list.ts"],"names":["baseTv"],"mappings":";;;;;;AAoBA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAKA,IAAM,KAAA,GAAQ;AAAA,EACZ,MAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,iBAAA;AAAA,EACA,aAAA;AAAA,EACA,uBAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,EAAA,GAAS,CAAC,OAAA,EAAS,MAAA,KAC9BA,KAAO,OAAA,EAAS;AAAA,EACd,GAAG,MAAA;AAAA,EACH,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,WAAA,EAAa;AAAA,QACX,WAAA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AAA,EAAK;AAAA,EACpB,IAAA,EAAM,CAAC,EAAE,KAAA,EAAO,aAAY,KAAM;AAChC,IAAA,MAAM,CAAA,GAAI,MAAA,CAAO,EAAE,KAAA,EAAO,aAAa,CAAA;AACvC,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,MACb,OAAA,EAAS,EAAE,OAAA,EAAQ;AAAA,MACnB,OAAA,EAAS,EAAE,OAAA,EAAQ;AAAA,MACnB,QAAA,EAAU,EAAE,QAAA,EAAS;AAAA,MACrB,UAAA,EAAY,EAAE,UAAA,EAAW;AAAA,MACzB,QAAA,EAAU,EAAE,QAAA;AAAS,KACvB;AAAA,EACF;AACF,CAAC","file":"index.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale and\n * shape scale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`) and the\n * shape scale as `rounded-<role>` border-radius utilities (e.g. `rounded-small`,\n * `rounded-extra-large`). Stock tailwind-merge does not know these custom names,\n * so it (a) groups the typescale names with `text-<color>` and drops one when a\n * slot sets both a color *and* a typescale, and (b) fails to see two custom\n * `rounded-<role>` classes as conflicting, so a later corner override never\n * dedupes the resting one (both survive, and CSS source order — not intent —\n * decides). Either way token compliance / shape morph silently breaks.\n *\n * Teaching tailwind-merge that the typescale names belong to `font-size` and the\n * shape names belong to `rounded` keeps color and type independent and makes the\n * corner utilities override one another as expected.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\n// M3 shape scale exposed as `rounded-<role>` (see @m3-baseui/tokens theme.css\n// `--radius-*`). `none` / `full` overlap stock Tailwind and are harmless to\n// re-list; the intermediate roles are what stock tailwind-merge misses.\nconst SHAPE = [\n 'none',\n 'extra-small',\n 'small',\n 'medium',\n 'large',\n 'large-increased',\n 'extra-large',\n 'extra-large-increased',\n 'full',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n rounded: [{ rounded: [...SHAPE] }],\n },\n },\n },\n });\n","/**\n * list.ts — tailwind-variants slots for the M3 List.\n *\n * `surface` container with 8dp block padding; rows are 56/72/88dp for\n * one/two/three-line. Interactive rows get a `currentColor` state-layer\n * `::before` (the pointer ripple is added by the factory) and dim per-token when\n * `data-disabled`. Headline is `body-large`/`on-surface`, supporting\n * `body-medium`/`on-surface-variant`, leading/trailing `on-surface-variant`.\n * Same DOM as the VE build.\n */\nimport { createList } from '@m3-baseui/core';\nimport { tv } from '../../tv';\n\nexport const listTv = tv({\n slots: {\n root: 'list-none m-0 px-0 py-2 bg-transparent',\n item: [\n 'group relative flex w-full items-center gap-4 box-border px-4 text-left',\n 'bg-transparent border-0 text-on-surface no-underline',\n ],\n leading: [\n 'flex items-center justify-center shrink-0 overflow-hidden text-on-surface-variant',\n '[&_svg]:size-6 [&_img]:size-full [&_img]:object-cover',\n // M3 leading column widths, keyed on the factory's data-leading attribute.\n 'data-[leading=avatar]:size-10 data-[leading=avatar]:rounded-full',\n 'data-[leading=image]:size-14',\n 'data-[leading=video]:w-25 data-[leading=video]:h-14',\n ],\n content: 'flex flex-col min-w-0 flex-1',\n headline: 'text-body-large text-on-surface group-data-[disabled]:text-on-surface/38',\n supporting: 'text-body-medium text-on-surface-variant group-data-[disabled]:text-on-surface/38',\n trailing: [\n 'flex items-center shrink-0 text-label-small text-on-surface-variant [&_svg]:size-6',\n 'group-data-[disabled]:text-on-surface/38',\n ],\n },\n variants: {\n lines: {\n 1: { item: 'min-h-14 py-2' },\n 2: { item: 'min-h-[72px] py-2' },\n 3: { item: 'min-h-[88px] items-start py-3' },\n },\n interactive: {\n true: {\n item: [\n 'cursor-pointer select-none overflow-hidden outline-none',\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'focus-visible:before:opacity-[var(--md-sys-state-focus)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n 'data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0',\n 'disabled:pointer-events-none disabled:before:opacity-0',\n ],\n },\n false: {},\n },\n },\n defaultVariants: {\n lines: 1,\n interactive: false,\n },\n});\n\nexport const List = createList({\n root: listTv().root(),\n item: ({ lines, interactive }) => {\n const c = listTv({ lines, interactive });\n return {\n item: c.item(),\n leading: c.leading(),\n content: c.content(),\n headline: c.headline(),\n supporting: c.supporting(),\n trailing: c.trailing(),\n };\n },\n});\nexport { LIST_LEADING_VARIANTS } from '@m3-baseui/core';\nexport type { ListItemProps, ListItemLines, ListLeadingVariant } from '@m3-baseui/core';\n"]}
@@ -20,12 +20,24 @@ var TYPESCALE = [
20
20
  "label-medium",
21
21
  "label-small"
22
22
  ];
23
+ var SHAPE = [
24
+ "none",
25
+ "extra-small",
26
+ "small",
27
+ "medium",
28
+ "large",
29
+ "large-increased",
30
+ "extra-large",
31
+ "extra-large-increased",
32
+ "full"
33
+ ];
23
34
  var tv = (options, config) => tv$1(options, {
24
35
  ...config,
25
36
  twMergeConfig: {
26
37
  extend: {
27
38
  classGroups: {
28
- "font-size": [{ text: [...TYPESCALE] }]
39
+ "font-size": [{ text: [...TYPESCALE] }],
40
+ rounded: [{ rounded: [...SHAPE] }]
29
41
  }
30
42
  }
31
43
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/tv.ts","../../../src/components/loading-indicator/loading-indicator.ts"],"names":["baseTv"],"mappings":";;;;;AAeA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,EAAA,GAAS,CAAC,OAAA,EAAS,MAAA,KAC9BA,KAAO,OAAA,EAAS;AAAA,EACd,GAAG,MAAA;AAAA,EACH,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,WAAA,EAAa;AAAA,QACX,WAAA,EAAa,CAAC,EAAE,IAAA,EAAM,CAAC,GAAG,SAAS,GAAG;AAAA;AACxC;AACF;AAEJ,CAAC,CAAA;;;AC/BI,IAAM,qBAAqB,EAAA,CAAG;AAAA,EACnC,KAAA,EAAO;AAAA;AAAA;AAAA,IAGL,IAAA,EAAM,2EAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,cAAA;AAAA;AAAA,MAEA;AAAA;AACF,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,EAAE,IAAA,EAAM,6CAAA,EAA8C;AAAA,MAC5D,OAAO;AAAC;AACV,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,SAAA,EAAW,KAAA;AAChC,CAAC;AAEM,IAAM,gBAAA,GAAmB,sBAAA,CAAuB,CAAC,EAAE,WAAU,KAAM;AACxE,EAAA,MAAM,CAAA,GAAI,kBAAA,CAAmB,EAAE,SAAA,EAAW,CAAA;AAC1C,EAAA,OAAO,EAAE,MAAM,CAAA,CAAE,IAAA,IAAQ,SAAA,EAAW,CAAA,CAAE,WAAU,EAAE;AACpD,CAAC","file":"index.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`). Stock\n * tailwind-merge does not know these custom names, so it groups them with the\n * `text-<color>` utilities and drops one when a slot sets both a color *and* a\n * typescale (the common M3 case). That silently strips either the color or the\n * type, breaking token compliance.\n *\n * Teaching tailwind-merge that the typescale names belong to the `font-size`\n * group keeps color and type independent, so both survive the merge.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n },\n },\n },\n });\n","/**\n * loading-indicator.ts — tailwind-variants slots for the M3 Expressive Loading\n * indicator.\n *\n * A 48dp box holding the morphing `primary` shape; the rotate+scale morph keys\n * off the `m3-loading` keyframe (see preset.css) and always runs (indeterminate\n * only). `contained` puts the shape on a `secondary-container` pill. Same DOM as\n * the VE build.\n */\nimport { createLoadingIndicator } from '@m3-baseui/core';\nimport { tv } from '../../tv';\n\nexport const loadingIndicatorTv = tv({\n slots: {\n // The SVG is a fixed 38dp active indicator. Uncontained: the box shrinks to\n // the shape. Contained: a 48dp pill wraps it (5dp inset on each side).\n root: 'inline-flex items-center justify-center [&_svg]:block [&_svg]:size-[38px]',\n indicator: [\n 'fill-primary',\n // Morph + rotate about the shape's own centre (transform-box: fill-box).\n '[transform-box:fill-box] origin-center animate-m3-loading',\n ],\n },\n variants: {\n contained: {\n true: { root: 'size-12 rounded-full bg-secondary-container' },\n false: {},\n },\n },\n defaultVariants: { contained: false },\n});\n\nexport const LoadingIndicator = createLoadingIndicator(({ contained }) => {\n const s = loadingIndicatorTv({ contained });\n return { root: s.root(), indicator: s.indicator() };\n});\nexport type { LoadingIndicatorProps } from '@m3-baseui/core';\n"]}
1
+ {"version":3,"sources":["../../../src/tv.ts","../../../src/components/loading-indicator/loading-indicator.ts"],"names":["baseTv"],"mappings":";;;;;AAoBA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAKA,IAAM,KAAA,GAAQ;AAAA,EACZ,MAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,iBAAA;AAAA,EACA,aAAA;AAAA,EACA,uBAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,EAAA,GAAS,CAAC,OAAA,EAAS,MAAA,KAC9BA,KAAO,OAAA,EAAS;AAAA,EACd,GAAG,MAAA;AAAA,EACH,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,WAAA,EAAa;AAAA,QACX,WAAA,EAAa,CAAC,EAAE,IAAA,EAAM,CAAC,GAAG,SAAS,GAAG,CAAA;AAAA,QACtC,OAAA,EAAS,CAAC,EAAE,OAAA,EAAS,CAAC,GAAG,KAAK,GAAG;AAAA;AACnC;AACF;AAEJ,CAAC,CAAA;;;ACpDI,IAAM,qBAAqB,EAAA,CAAG;AAAA,EACnC,KAAA,EAAO;AAAA;AAAA;AAAA,IAGL,IAAA,EAAM,2EAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,cAAA;AAAA;AAAA,MAEA;AAAA;AACF,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,EAAE,IAAA,EAAM,6CAAA,EAA8C;AAAA,MAC5D,OAAO;AAAC;AACV,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,SAAA,EAAW,KAAA;AAChC,CAAC;AAEM,IAAM,gBAAA,GAAmB,sBAAA,CAAuB,CAAC,EAAE,WAAU,KAAM;AACxE,EAAA,MAAM,CAAA,GAAI,kBAAA,CAAmB,EAAE,SAAA,EAAW,CAAA;AAC1C,EAAA,OAAO,EAAE,MAAM,CAAA,CAAE,IAAA,IAAQ,SAAA,EAAW,CAAA,CAAE,WAAU,EAAE;AACpD,CAAC","file":"index.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale and\n * shape scale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`) and the\n * shape scale as `rounded-<role>` border-radius utilities (e.g. `rounded-small`,\n * `rounded-extra-large`). Stock tailwind-merge does not know these custom names,\n * so it (a) groups the typescale names with `text-<color>` and drops one when a\n * slot sets both a color *and* a typescale, and (b) fails to see two custom\n * `rounded-<role>` classes as conflicting, so a later corner override never\n * dedupes the resting one (both survive, and CSS source order — not intent —\n * decides). Either way token compliance / shape morph silently breaks.\n *\n * Teaching tailwind-merge that the typescale names belong to `font-size` and the\n * shape names belong to `rounded` keeps color and type independent and makes the\n * corner utilities override one another as expected.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\n// M3 shape scale exposed as `rounded-<role>` (see @m3-baseui/tokens theme.css\n// `--radius-*`). `none` / `full` overlap stock Tailwind and are harmless to\n// re-list; the intermediate roles are what stock tailwind-merge misses.\nconst SHAPE = [\n 'none',\n 'extra-small',\n 'small',\n 'medium',\n 'large',\n 'large-increased',\n 'extra-large',\n 'extra-large-increased',\n 'full',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n rounded: [{ rounded: [...SHAPE] }],\n },\n },\n },\n });\n","/**\n * loading-indicator.ts — tailwind-variants slots for the M3 Expressive Loading\n * indicator.\n *\n * A 48dp box holding the morphing `primary` shape; the rotate+scale morph keys\n * off the `m3-loading` keyframe (see preset.css) and always runs (indeterminate\n * only). `contained` puts the shape on a `secondary-container` pill. Same DOM as\n * the VE build.\n */\nimport { createLoadingIndicator } from '@m3-baseui/core';\nimport { tv } from '../../tv';\n\nexport const loadingIndicatorTv = tv({\n slots: {\n // The SVG is a fixed 38dp active indicator. Uncontained: the box shrinks to\n // the shape. Contained: a 48dp pill wraps it (5dp inset on each side).\n root: 'inline-flex items-center justify-center [&_svg]:block [&_svg]:size-[38px]',\n indicator: [\n 'fill-primary',\n // Morph + rotate about the shape's own centre (transform-box: fill-box).\n '[transform-box:fill-box] origin-center animate-m3-loading',\n ],\n },\n variants: {\n contained: {\n true: { root: 'size-12 rounded-full bg-secondary-container' },\n false: {},\n },\n },\n defaultVariants: { contained: false },\n});\n\nexport const LoadingIndicator = createLoadingIndicator(({ contained }) => {\n const s = loadingIndicatorTv({ contained });\n return { root: s.root(), indicator: s.indicator() };\n});\nexport type { LoadingIndicatorProps } from '@m3-baseui/core';\n"]}
@@ -20,12 +20,24 @@ var TYPESCALE = [
20
20
  "label-medium",
21
21
  "label-small"
22
22
  ];
23
+ var SHAPE = [
24
+ "none",
25
+ "extra-small",
26
+ "small",
27
+ "medium",
28
+ "large",
29
+ "large-increased",
30
+ "extra-large",
31
+ "extra-large-increased",
32
+ "full"
33
+ ];
23
34
  var tv = (options, config) => tv$1(options, {
24
35
  ...config,
25
36
  twMergeConfig: {
26
37
  extend: {
27
38
  classGroups: {
28
- "font-size": [{ text: [...TYPESCALE] }]
39
+ "font-size": [{ text: [...TYPESCALE] }],
40
+ rounded: [{ rounded: [...SHAPE] }]
29
41
  }
30
42
  }
31
43
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/tv.ts","../../../src/components/menu/menu-selectable-item.ts","../../../src/components/menu/menu-surface.ts","../../../src/components/menu/menu.ts"],"names":["baseTv"],"mappings":";;;;;AAeA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,EAAA,GAAS,CAAC,OAAA,EAAS,MAAA,KAC9BA,KAAO,OAAA,EAAS;AAAA,EACd,GAAG,MAAA;AAAA,EACH,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,WAAA,EAAa;AAAA,QACX,WAAA,EAAa,CAAC,EAAE,IAAA,EAAM,CAAC,GAAG,SAAS,GAAG;AAAA;AACxC;AACF;AAEJ,CAAC,CAAA;;;AClCI,IAAM,4BAAA,GAA+B;AAAA,EAC1C,4IAAA;AAAA,EACA,kDAAA;AAAA,EACA,+DAAA;AAAA,EACA;AACF,CAAA;AAGO,IAAM,8BAAA,GAAiC;AAAA,EAC5C,oFAAA;AAAA,EACA;AACF,CAAA;AAGO,IAAM,+BAAA,GAAkC;AAAA,EAC7C,0DAAA;AAAA,EACA,6DAAA;AAAA,EACA,qDAAA;AAAA,EACA,4DAAA;AAAA,EACA,yDAAA;AAAA,EACA,4DAAA;AAAA,EACA,oDAAA;AAAA,EACA;AACF,CAAA;AAGO,IAAM,uCAAA,GAA0C;AAAA,EACrD,0DAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,0BAAA,GAA6B;AAAA,EACxC,6GAAA;AAAA,EACA,uGAAA;AAAA,EACA;A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YAAA,EAAa;AAAA,EAC7B,SAAA,EAAW,EAAE,SAAA,EAAU;AAAA,EACvB,aAAA,EAAe,EAAE,aAAA;AACnB,CAAC","file":"index.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`). Stock\n * tailwind-merge does not know these custom names, so it groups them with the\n * `text-<color>` utilities and drops one when a slot sets both a color *and* a\n * typescale (the common M3 case). That silently strips either the color or the\n * type, breaking token compliance.\n *\n * Teaching tailwind-merge that the typescale names belong to the `font-size`\n * group keeps color and type independent, so both survive the merge.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n },\n },\n },\n });\n","/**\n * menu-selectable-item.ts — shared M3 selectable menu row tokens.\n *\n * Select.Item and Menu CheckboxItem / RadioItem share secondary-container fill,\n * position-based selected shapes (issue #98), and the 24dp leading indicator column.\n */\nimport { tv } from '../../tv';\n\n/** State layer on selectable rows (hover / highlighted / pressed). */\nexport const menuSelectableItemStateLayer = [\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n] as const;\n\n/** M3 selectable row fill when selected or checked. */\nexport const menuSelectableItemSelectedFill = [\n 'data-[selected]:bg-secondary-container data-[selected]:text-on-secondary-container',\n 'data-[checked]:bg-secondary-container data-[checked]:text-on-secondary-container',\n] as const;\n\n/** M3 MenuDefaults.itemShape — corner radii on the selected/checked container. */\nexport const menuSelectableItemPositionShape = [\n 'data-[selected]:data-[position=only]:rounded-extra-small',\n 'data-[selected]:data-[position=first]:rounded-t-extra-small',\n 'data-[selected]:data-[position=middle]:rounded-none',\n 'data-[selected]:data-[position=last]:rounded-b-extra-small',\n 'data-[checked]:data-[position=only]:rounded-extra-small',\n 'data-[checked]:data-[position=first]:rounded-t-extra-small',\n 'data-[checked]:data-[position=middle]:rounded-none',\n 'data-[checked]:data-[position=last]:rounded-b-extra-small',\n] as const;\n\n/** Fallback when rows are rendered via a wrapper and data-position is not stamped. */\nexport const menuSelectableItemPositionShapeFallback = [\n 'data-[selected]:not([data-position]):rounded-extra-small',\n 'data-[checked]:not([data-position]):rounded-extra-small',\n] as const;\n\nexport const menuSelectableItemDisabled = [\n 'data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none',\n 'data-[disabled]:data-[selected]:bg-transparent data-[disabled]:data-[selected]:text-on-surface/[0.38]',\n 'data-[disabled]:data-[checked]:bg-transparent data-[disabled]:data-[checked]:text-on-surface/[0.38]',\n] as const;\n\nexport const menuSelectableItemBase = [\n 'group relative cursor-pointer select-none outline-none text-label-large text-on-surface',\n 'h-12 px-3 overflow-hidden',\n ...menuSelectableItemStateLayer,\n ...menuSelectableItemSelectedFill,\n ...menuSelectableItemPositionShape,\n ...menuSelectableItemPositionShapeFallback,\n ...menuSelectableItemDisabled,\n] as const;\n\nexport const menuSelectableItemTv = tv({\n slots: {\n /** Select row: check + label + optional trailing meta. */\n selectItem: ['grid grid-cols-[24px_1fr_auto] items-center gap-3', ...menuSelectableItemBase],\n /** Menu checkbox / radio row: check + label. */\n menuSelectableItem: ['grid grid-cols-[24px_1fr] items-center gap-3', ...menuSelectableItemBase],\n itemIndicator: [\n 'inline-flex items-center justify-center text-on-surface',\n 'invisible group-data-[selected]:visible group-data-[checked]:visible',\n 'group-data-[selected]:text-on-secondary-container group-data-[checked]:text-on-secondary-container',\n 'group-data-[disabled]:text-on-surface/[0.38]',\n ],\n },\n});\n\nexport const menuSelectableItem = menuSelectableItemTv();\n","/**\n * menu-surface.ts — shared M3 menu popup surface tokens (Menus specs).\n *\n * Used by Menu (standard width) and Select (anchor-width + scroll). Engine-neutral\n * class strings; both components compose variants on top.\n */\nimport { tv } from '../../tv';\n\n/** Base popup surface shared by Menu and Select list popups. */\nexport const menuSurfaceBase = [\n 'py-2',\n 'bg-surface-container text-on-surface rounded-extra-small shadow-level2',\n 'origin-[var(--transform-origin)] transition-[opacity,transform] duration-150 ease-standard',\n 'data-[starting-style]:opacity-0 data-[starting-style]:scale-95',\n 'data-[ending-style]:opacity-0',\n 'focus:outline-none',\n] as const;\n\nexport const menuSurfaceTv = tv({\n slots: {\n popup: ['max-w-[280px]', ...menuSurfaceBase],\n groupLabel: 'px-3 py-2 text-label-small text-on-surface-variant',\n },\n variants: {\n width: {\n /** Standalone Menu: 112–280dp. */\n standard: { popup: 'min-w-[112px]' },\n /** Exposed Dropdown / Select: at least anchor width, capped at 280dp. */\n anchor: { popup: 'min-w-[max(112px,var(--anchor-width))]' },\n },\n scroll: {\n none: {},\n /** Select popup: clamp height and scroll the list. */\n auto: { popup: 'max-h-[var(--available-height)] overflow-auto' },\n },\n },\n defaultVariants: {\n width: 'standard',\n scroll: 'none',\n },\n});\n\nexport const menuSurface = menuSurfaceTv();\n","/**\n * menu.ts — Tailwind classes for the M3 Menu.\n *\n * surface-container popup (elevation 2, extra-small corners); 48dp items with a\n * `before:` state layer keyed to hover + Base UI's data-[highlighted]. Selectable\n * checkbox/radio rows share menu-selectable-item tokens with Select. Same DOM\n * + ripple as the VE build.\n */\nimport { createMenu } from '@m3-baseui/core';\nimport { tv } from '../../tv';\nimport { menuSelectableItem } from './menu-selectable-item';\nimport { menuSurfaceTv } from './menu-surface';\n\nconst surface = menuSurfaceTv({ width: 'standard', scroll: 'none' });\nconst selectable = menuSelectableItem;\n\nexport const menuTv = tv({\n slots: {\n popup: surface.popup(),\n item: [\n 'relative flex items-center gap-3 h-12 px-3 overflow-hidden cursor-pointer select-none outline-none',\n 'text-label-large text-on-surface',\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n // M3 disabled (per-token, not a blanket fade): label + leading/trailing\n // icon on-surface/0.38, no state layer.\n 'data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none',\n 'data-[disabled]:[&_[data-slot=menu-leading]]:text-on-surface/[0.38] data-[disabled]:[&_[data-slot=menu-trailing]]:text-on-surface/[0.38]',\n // M3 leading icon (24dp) + trailing supporting text (shortcut/meta).\n '[&_[data-slot=menu-leading]]:inline-flex [&_[data-slot=menu-leading]]:text-on-surface-variant [&_[data-slot=menu-leading]>svg]:size-6',\n '[&_[data-slot=menu-trailing]]:ml-auto [&_[data-slot=menu-trailing]]:pl-4 [&_[data-slot=menu-trailing]]:text-label-large [&_[data-slot=menu-trailing]]:text-on-surface-variant',\n ],\n separator: ['my-2 h-px border-0 bg-outline-variant'],\n groupLabel: surface.groupLabel(),\n // Submenu trigger: item look + trailing chevron, highlighted while open.\n submenuTrigger: [\n 'relative flex items-center justify-between gap-3 h-12 px-3 overflow-hidden cursor-pointer select-none outline-none',\n 'text-label-large text-on-surface',\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]',\n 'data-[popup-open]:before:opacity-[var(--md-sys-state-hover)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n // M3 disabled (per-token): label + leading icon on-surface/0.38, no state layer.\n 'data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none',\n 'data-[disabled]:[&_[data-slot=menu-leading]]:text-on-surface/[0.38]',\n '[&_[data-slot=menu-leading]]:inline-flex [&_[data-slot=menu-leading]]:text-on-surface-variant [&_[data-slot=menu-leading]>svg]:size-6',\n ],\n checkboxItem: selectable.menuSelectableItem(),\n radioItem: selectable.menuSelectableItem(),\n itemIndicator: selectable.itemIndicator(),\n },\n});\n\nconst m = menuTv();\nexport const Menu = createMenu({\n popup: m.popup(),\n item: m.item(),\n separator: m.separator(),\n groupLabel: m.groupLabel(),\n submenuTrigger: m.submenuTrigger(),\n checkboxItem: m.checkboxItem(),\n radioItem: m.radioItem(),\n itemIndicator: m.itemIndicator(),\n});\n"]}
1
+ {"version":3,"sources":["../../../src/tv.ts","../../../src/components/menu/menu-selectable-item.ts","../../../src/components/menu/menu-surface.ts","../../../src/components/menu/menu.ts"],"names":["baseTv"],"mappings":";;;;;AAoBA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAKA,IAAM,KAAA,GAAQ;AAAA,EACZ,MAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,iBAAA;AAAA,EACA,aAAA;AAAA,EACA,uBAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,EAAA,GAAS,CAAC,OAAA,EAAS,MAAA,KAC9BA,KAAO,OAAA,EAAS;AAAA,EACd,GAAG,MAAA;AAAA,EACH,aAAA,EAAe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CAAC,uCAAuC,CAAA;AAAA,IACnD,UAAA,EAAY,QAAQ,UAAA,EAAW;AAAA;AAAA,IAE/B,cAAA,EAAgB;AAAA,MACd,oHAAA;AAAA,MACA,kCAAA;AAAA,MACA,4IAAA;AAAA,MACA,kDAAA;AAAA,MACA,+DAAA;AAAA,MACA,8DAAA;AAAA,MACA,qDAAA;AAAA;AAAA,MAEA,6GAAA;AAAA,MACA,qEAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,YAAA,EAAc,WAAW,kBAAA,EAAmB;AAAA,IAC5C,SAAA,EAAW,WAAW,kBAAA,EAAmB;AAAA,IACzC,aAAA,EAAe,WAAW,aAAA;AAAc;AAE5C,CAAC;AAED,IAAM,IAAI,MAAA,EAAO;AACV,IAAM,OAAO,UAAA,CAAW;AAAA,EAC7B,KAAA,EAAO,EAAE,KAAA,EAAM;AAAA,EACf,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,SAAA,EAAW,EAAE,SAAA,EAAU;AAAA,EACvB,UAAA,EAAY,EAAE,UAAA,EAAW;AAAA,EACzB,cAAA,EAAgB,EAAE,cAAA,EAAe;AAAA,EACjC,YAAA,EAAc,EAAE,YAAA,EAAa;AAAA,EAC7B,SAAA,EAAW,EAAE,SAAA,EAAU;AAAA,EACvB,aAAA,EAAe,EAAE,aAAA;AACnB,CAAC","file":"index.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale and\n * shape scale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`) and the\n * shape scale as `rounded-<role>` border-radius utilities (e.g. `rounded-small`,\n * `rounded-extra-large`). Stock tailwind-merge does not know these custom names,\n * so it (a) groups the typescale names with `text-<color>` and drops one when a\n * slot sets both a color *and* a typescale, and (b) fails to see two custom\n * `rounded-<role>` classes as conflicting, so a later corner override never\n * dedupes the resting one (both survive, and CSS source order — not intent —\n * decides). Either way token compliance / shape morph silently breaks.\n *\n * Teaching tailwind-merge that the typescale names belong to `font-size` and the\n * shape names belong to `rounded` keeps color and type independent and makes the\n * corner utilities override one another as expected.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\n// M3 shape scale exposed as `rounded-<role>` (see @m3-baseui/tokens theme.css\n// `--radius-*`). `none` / `full` overlap stock Tailwind and are harmless to\n// re-list; the intermediate roles are what stock tailwind-merge misses.\nconst SHAPE = [\n 'none',\n 'extra-small',\n 'small',\n 'medium',\n 'large',\n 'large-increased',\n 'extra-large',\n 'extra-large-increased',\n 'full',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n rounded: [{ rounded: [...SHAPE] }],\n },\n },\n },\n });\n","/**\n * menu-selectable-item.ts — shared M3 selectable menu row tokens.\n *\n * Select.Item and Menu CheckboxItem / RadioItem share secondary-container fill,\n * position-based selected shapes (issue #98), and the 24dp leading indicator column.\n */\nimport { tv } from '../../tv';\n\n/** State layer on selectable rows (hover / highlighted / pressed). */\nexport const menuSelectableItemStateLayer = [\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n] as const;\n\n/** M3 selectable row fill when selected or checked. */\nexport const menuSelectableItemSelectedFill = [\n 'data-[selected]:bg-secondary-container data-[selected]:text-on-secondary-container',\n 'data-[checked]:bg-secondary-container data-[checked]:text-on-secondary-container',\n] as const;\n\n/** M3 MenuDefaults.itemShape — corner radii on the selected/checked container. */\nexport const menuSelectableItemPositionShape = [\n 'data-[selected]:data-[position=only]:rounded-extra-small',\n 'data-[selected]:data-[position=first]:rounded-t-extra-small',\n 'data-[selected]:data-[position=middle]:rounded-none',\n 'data-[selected]:data-[position=last]:rounded-b-extra-small',\n 'data-[checked]:data-[position=only]:rounded-extra-small',\n 'data-[checked]:data-[position=first]:rounded-t-extra-small',\n 'data-[checked]:data-[position=middle]:rounded-none',\n 'data-[checked]:data-[position=last]:rounded-b-extra-small',\n] as const;\n\n/** Fallback when rows are rendered via a wrapper and data-position is not stamped. */\nexport const menuSelectableItemPositionShapeFallback = [\n 'data-[selected]:not([data-position]):rounded-extra-small',\n 'data-[checked]:not([data-position]):rounded-extra-small',\n] as const;\n\nexport const menuSelectableItemDisabled = [\n 'data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none',\n 'data-[disabled]:data-[selected]:bg-transparent data-[disabled]:data-[selected]:text-on-surface/[0.38]',\n 'data-[disabled]:data-[checked]:bg-transparent data-[disabled]:data-[checked]:text-on-surface/[0.38]',\n] as const;\n\nexport const menuSelectableItemBase = [\n 'group relative cursor-pointer select-none outline-none text-label-large text-on-surface',\n 'h-12 px-3 overflow-hidden',\n ...menuSelectableItemStateLayer,\n ...menuSelectableItemSelectedFill,\n ...menuSelectableItemPositionShape,\n ...menuSelectableItemPositionShapeFallback,\n ...menuSelectableItemDisabled,\n] as const;\n\nexport const menuSelectableItemTv = tv({\n slots: {\n /** Select row: check + label + optional trailing meta. */\n selectItem: ['grid grid-cols-[24px_1fr_auto] items-center gap-3', ...menuSelectableItemBase],\n /** Menu checkbox / radio row: check + label. */\n menuSelectableItem: ['grid grid-cols-[24px_1fr] items-center gap-3', ...menuSelectableItemBase],\n itemIndicator: [\n 'inline-flex items-center justify-center text-on-surface',\n 'invisible group-data-[selected]:visible group-data-[checked]:visible',\n 'group-data-[selected]:text-on-secondary-container group-data-[checked]:text-on-secondary-container',\n 'group-data-[disabled]:text-on-surface/[0.38]',\n ],\n },\n});\n\nexport const menuSelectableItem = menuSelectableItemTv();\n","/**\n * menu-surface.ts — shared M3 menu popup surface tokens (Menus specs).\n *\n * Used by Menu (standard width) and Select (anchor-width + scroll). Engine-neutral\n * class strings; both components compose variants on top.\n */\nimport { tv } from '../../tv';\n\n/** Base popup surface shared by Menu and Select list popups. */\nexport const menuSurfaceBase = [\n 'py-2',\n 'bg-surface-container text-on-surface rounded-extra-small shadow-level2',\n 'origin-[var(--transform-origin)] transition-[opacity,transform] duration-150 ease-standard',\n 'data-[starting-style]:opacity-0 data-[starting-style]:scale-95',\n 'data-[ending-style]:opacity-0',\n 'focus:outline-none',\n] as const;\n\nexport const menuSurfaceTv = tv({\n slots: {\n popup: ['max-w-[280px]', ...menuSurfaceBase],\n groupLabel: 'px-3 py-2 text-label-small text-on-surface-variant',\n },\n variants: {\n width: {\n /** Standalone Menu: 112–280dp. */\n standard: { popup: 'min-w-[112px]' },\n /** Exposed Dropdown / Select: at least anchor width, capped at 280dp. */\n anchor: { popup: 'min-w-[max(112px,var(--anchor-width))]' },\n },\n scroll: {\n none: {},\n /** Select popup: clamp height and scroll the list. */\n auto: { popup: 'max-h-[var(--available-height)] overflow-auto' },\n },\n },\n defaultVariants: {\n width: 'standard',\n scroll: 'none',\n },\n});\n\nexport const menuSurface = menuSurfaceTv();\n","/**\n * menu.ts — Tailwind classes for the M3 Menu.\n *\n * surface-container popup (elevation 2, extra-small corners); 48dp items with a\n * `before:` state layer keyed to hover + Base UI's data-[highlighted]. Selectable\n * checkbox/radio rows share menu-selectable-item tokens with Select. Same DOM\n * + ripple as the VE build.\n */\nimport { createMenu } from '@m3-baseui/core';\nimport { tv } from '../../tv';\nimport { menuSelectableItem } from './menu-selectable-item';\nimport { menuSurfaceTv } from './menu-surface';\n\nconst surface = menuSurfaceTv({ width: 'standard', scroll: 'none' });\nconst selectable = menuSelectableItem;\n\nexport const menuTv = tv({\n slots: {\n popup: surface.popup(),\n item: [\n 'relative flex items-center gap-3 h-12 px-3 overflow-hidden cursor-pointer select-none outline-none',\n 'text-label-large text-on-surface',\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n // M3 disabled (per-token, not a blanket fade): label + leading/trailing\n // icon on-surface/0.38, no state layer.\n 'data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none',\n 'data-[disabled]:[&_[data-slot=menu-leading]]:text-on-surface/[0.38] data-[disabled]:[&_[data-slot=menu-trailing]]:text-on-surface/[0.38]',\n // M3 leading icon (24dp) + trailing supporting text (shortcut/meta).\n '[&_[data-slot=menu-leading]]:inline-flex [&_[data-slot=menu-leading]]:text-on-surface-variant [&_[data-slot=menu-leading]>svg]:size-6',\n '[&_[data-slot=menu-trailing]]:ml-auto [&_[data-slot=menu-trailing]]:pl-4 [&_[data-slot=menu-trailing]]:text-label-large [&_[data-slot=menu-trailing]]:text-on-surface-variant',\n ],\n separator: ['my-2 h-px border-0 bg-outline-variant'],\n groupLabel: surface.groupLabel(),\n // Submenu trigger: item look + trailing chevron, highlighted while open.\n submenuTrigger: [\n 'relative flex items-center justify-between gap-3 h-12 px-3 overflow-hidden cursor-pointer select-none outline-none',\n 'text-label-large text-on-surface',\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]',\n 'data-[popup-open]:before:opacity-[var(--md-sys-state-hover)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n // M3 disabled (per-token): label + leading icon on-surface/0.38, no state layer.\n 'data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none',\n 'data-[disabled]:[&_[data-slot=menu-leading]]:text-on-surface/[0.38]',\n '[&_[data-slot=menu-leading]]:inline-flex [&_[data-slot=menu-leading]]:text-on-surface-variant [&_[data-slot=menu-leading]>svg]:size-6',\n ],\n checkboxItem: selectable.menuSelectableItem(),\n radioItem: selectable.menuSelectableItem(),\n itemIndicator: selectable.itemIndicator(),\n },\n});\n\nconst m = menuTv();\nexport const Menu = createMenu({\n popup: m.popup(),\n item: m.item(),\n separator: m.separator(),\n groupLabel: m.groupLabel(),\n submenuTrigger: m.submenuTrigger(),\n checkboxItem: m.checkboxItem(),\n radioItem: m.radioItem(),\n itemIndicator: m.itemIndicator(),\n});\n"]}