@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.
- package/dist/components/badge/index.js +13 -1
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/bottom-app-bar/index.js +13 -1
- package/dist/components/bottom-app-bar/index.js.map +1 -1
- package/dist/components/bottom-sheet/index.js +13 -1
- package/dist/components/bottom-sheet/index.js.map +1 -1
- package/dist/components/button/index.d.ts +106 -1
- package/dist/components/button/index.js +168 -25
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button-group/index.js +13 -1
- package/dist/components/button-group/index.js.map +1 -1
- package/dist/components/card/index.js +13 -1
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/carousel/index.js +13 -1
- package/dist/components/carousel/index.js.map +1 -1
- package/dist/components/date-picker/index.js +13 -1
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/dialog/index.js +13 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/fab-menu/index.js +13 -1
- package/dist/components/fab-menu/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +50 -22
- package/dist/components/icon-button/index.js +130 -33
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/item/index.d.ts +5 -5
- package/dist/components/item/index.js +13 -1
- package/dist/components/item/index.js.map +1 -1
- package/dist/components/list/index.js +13 -1
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/loading-indicator/index.js +13 -1
- package/dist/components/loading-indicator/index.js.map +1 -1
- package/dist/components/menu/index.js +13 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/navigation-drawer/index.js +13 -1
- package/dist/components/navigation-drawer/index.js.map +1 -1
- package/dist/components/navigation-rail/index.js +13 -1
- package/dist/components/navigation-rail/index.js.map +1 -1
- package/dist/components/search/index.js +13 -1
- package/dist/components/search/index.js.map +1 -1
- package/dist/components/segmented-button/index.js +13 -1
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/select/index.js +13 -1
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/side-sheet/index.js +13 -1
- package/dist/components/side-sheet/index.js.map +1 -1
- package/dist/components/slider/index.js +49 -15
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +5 -5
- package/dist/components/split-button/index.js +13 -1
- package/dist/components/split-button/index.js.map +1 -1
- package/dist/components/tabs/index.js +13 -1
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/time-picker/index.js +13 -1
- package/dist/components/time-picker/index.js.map +1 -1
- package/dist/components/toolbar/index.js +13 -1
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/components/tooltip/index.js +13 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/top-app-bar/index.js +13 -1
- package/dist/components/top-app-bar/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +333 -141
- package/dist/index.js.map +1 -1
- package/dist/tv.d.ts +13 -8
- package/dist/tv.js +13 -1
- package/dist/tv.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,20 +1,59 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createButton, createIconButton, createSwitch, createCheckbox, createRadio, createRadioGroup, createChip, createTooltip, createRichTooltip, createDialog, createMenu, createTabs, createSlider, createSelect, createTextField, createNavigationBar, createFab, createFabMenu, createDivider, createProgress, createLoadingIndicator, createList, createSnackbar, createItem, createBadge, createCard, createSegmentedButton, createButtonGroup, createSplitButton, createNavigationDrawer, createTopAppBar, createBottomAppBar, createNavigationRail, createBottomSheet, createSideSheet, createSearch, createDatePicker, createTimePicker, createToolbar, createCarousel } from '@m3-baseui/core';
|
|
2
|
+
import { createButton, toToggle, createIconButton, createSwitch, createCheckbox, createRadio, createRadioGroup, createChip, createTooltip, createRichTooltip, createDialog, createMenu, createTabs, createSlider, createSelect, createTextField, createNavigationBar, createFab, createFabMenu, createDivider, createProgress, createLoadingIndicator, createList, createSnackbar, createItem, createBadge, createCard, createSegmentedButton, createButtonGroup, createSplitButton, createNavigationDrawer, createTopAppBar, createBottomAppBar, createNavigationRail, createBottomSheet, createSideSheet, createSearch, createDatePicker, createTimePicker, createToolbar, createCarousel } from '@m3-baseui/core';
|
|
3
3
|
export { ITEM_LEADING_VARIANTS, LIST_LEADING_VARIANTS, Ripple, ThemeProvider, applyScheme, generateScheme, schemeToCssText, useSnackbar, useTheme } from '@m3-baseui/core';
|
|
4
|
-
import { tv } from 'tailwind-variants';
|
|
4
|
+
import { tv as tv$1 } from 'tailwind-variants';
|
|
5
|
+
|
|
6
|
+
// src/components/button/button.ts
|
|
7
|
+
var TYPESCALE = [
|
|
8
|
+
"display-large",
|
|
9
|
+
"display-medium",
|
|
10
|
+
"display-small",
|
|
11
|
+
"headline-large",
|
|
12
|
+
"headline-medium",
|
|
13
|
+
"headline-small",
|
|
14
|
+
"title-large",
|
|
15
|
+
"title-medium",
|
|
16
|
+
"title-small",
|
|
17
|
+
"body-large",
|
|
18
|
+
"body-medium",
|
|
19
|
+
"body-small",
|
|
20
|
+
"label-large",
|
|
21
|
+
"label-medium",
|
|
22
|
+
"label-small"
|
|
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
|
+
];
|
|
35
|
+
var tv = (options, config) => tv$1(options, {
|
|
36
|
+
...config,
|
|
37
|
+
twMergeConfig: {
|
|
38
|
+
extend: {
|
|
39
|
+
classGroups: {
|
|
40
|
+
"font-size": [{ text: [...TYPESCALE] }],
|
|
41
|
+
rounded: [{ rounded: [...SHAPE] }]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
5
46
|
|
|
6
47
|
// src/components/button/button.ts
|
|
7
48
|
var button = tv({
|
|
8
49
|
base: [
|
|
9
|
-
"relative inline-flex items-center justify-center
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
// M3 with-icon padding: the icon side trims to 16dp (label side stays 24dp).
|
|
13
|
-
"data-[with-start-icon]:pl-4 data-[with-end-icon]:pr-4",
|
|
14
|
-
// Icon slot: 18dp, centered.
|
|
50
|
+
"relative inline-flex items-center justify-center",
|
|
51
|
+
"overflow-hidden cursor-pointer select-none border-0",
|
|
52
|
+
// Icon slot: centered; the svg size comes from the `size` variant.
|
|
15
53
|
"[&_[data-slot=button-icon]]:inline-flex [&_[data-slot=button-icon]]:items-center [&_[data-slot=button-icon]]:justify-center",
|
|
16
|
-
|
|
17
|
-
|
|
54
|
+
// Motion: Compose uses DefaultEffects (critically-damped spring, no bounce)
|
|
55
|
+
// for the shape/color/elevation transitions — spring-effects-default here.
|
|
56
|
+
"transition-[box-shadow,background-color,color,border-color,border-radius] duration-200 ease-spring-effects-default",
|
|
18
57
|
// State layer overlay
|
|
19
58
|
"before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:pointer-events-none",
|
|
20
59
|
"before:transition-opacity before:duration-100",
|
|
@@ -25,20 +64,23 @@ var button = tv({
|
|
|
25
64
|
// Focus ring (M3: 3px secondary, 2px offset)
|
|
26
65
|
"focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary",
|
|
27
66
|
// Disabled: no interaction, no state layer, no elevation. Per-variant
|
|
28
|
-
// colors (container on-surface/
|
|
67
|
+
// colors (container on-surface/10, label on-surface-variant/38) live on
|
|
68
|
+
// each variant.
|
|
29
69
|
"disabled:pointer-events-none disabled:shadow-none disabled:before:opacity-0",
|
|
30
70
|
"data-[disabled]:pointer-events-none data-[disabled]:shadow-none data-[disabled]:before:opacity-0"
|
|
31
71
|
],
|
|
32
72
|
variants: {
|
|
33
73
|
// M3 elevation per variant: filled/tonal rest level0→hover level1→pressed level0;
|
|
34
|
-
// elevated rest level1→hover level2→pressed level1.
|
|
35
|
-
// on-surface/
|
|
74
|
+
// elevated rest level1→hover level2→pressed level1. Expressive disabled:
|
|
75
|
+
// container on-surface/10, label on-surface-variant/38 — except tonal, which
|
|
76
|
+
// is unchanged upstream (FilledTonalButtonTokens v0_103) and keeps 0.12 /
|
|
77
|
+
// on-surface. Expressive also moves outlined/text labels to on-surface-variant.
|
|
36
78
|
variant: {
|
|
37
79
|
filled: [
|
|
38
80
|
"bg-primary text-on-primary",
|
|
39
81
|
"hover:shadow-level1 focus-visible:shadow-none active:shadow-none data-[pressed]:shadow-none",
|
|
40
|
-
"disabled:bg-on-surface/
|
|
41
|
-
"data-[disabled]:bg-on-surface/
|
|
82
|
+
"disabled:bg-on-surface/10 disabled:text-on-surface-variant/38",
|
|
83
|
+
"data-[disabled]:bg-on-surface/10 data-[disabled]:text-on-surface-variant/38"
|
|
42
84
|
],
|
|
43
85
|
tonal: [
|
|
44
86
|
"bg-secondary-container text-on-secondary-container",
|
|
@@ -47,28 +89,129 @@ var button = tv({
|
|
|
47
89
|
"data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38"
|
|
48
90
|
],
|
|
49
91
|
outlined: [
|
|
50
|
-
"bg-transparent text-
|
|
51
|
-
|
|
52
|
-
|
|
92
|
+
"bg-transparent text-on-surface-variant border border-outline-variant",
|
|
93
|
+
// Compose outlinedButtonBorder(enabled=false) tints the outline with
|
|
94
|
+
// DisabledContainerOpacity (0.1), so the disabled border is faint.
|
|
95
|
+
"disabled:text-on-surface-variant/38 disabled:border-outline-variant/10",
|
|
96
|
+
"data-[disabled]:text-on-surface-variant/38 data-[disabled]:border-outline-variant/10"
|
|
53
97
|
],
|
|
54
98
|
elevated: [
|
|
55
99
|
"bg-surface-container-low text-primary shadow-level1",
|
|
56
100
|
"hover:shadow-level2 focus-visible:shadow-level1 active:shadow-level1 data-[pressed]:shadow-level1",
|
|
57
|
-
"disabled:bg-on-surface/
|
|
58
|
-
"data-[disabled]:bg-on-surface/
|
|
101
|
+
"disabled:bg-on-surface/10 disabled:text-on-surface-variant/38",
|
|
102
|
+
"data-[disabled]:bg-on-surface/10 data-[disabled]:text-on-surface-variant/38"
|
|
59
103
|
],
|
|
60
104
|
text: [
|
|
61
|
-
"bg-transparent text-
|
|
62
|
-
"disabled:text-on-surface/38",
|
|
63
|
-
"data-[disabled]:text-on-surface/38"
|
|
105
|
+
"bg-transparent text-on-surface-variant",
|
|
106
|
+
"disabled:text-on-surface-variant/38",
|
|
107
|
+
"data-[disabled]:text-on-surface-variant/38"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
// Height / horizontal padding / gap / typescale / icon size per Expressive
|
|
111
|
+
// size. The pressed corner morph (PressedContainerShape: XS·S small 8 /
|
|
112
|
+
// M medium 12 / L·XL large 16) rides on data-[pressed]/active here so its
|
|
113
|
+
// attribute-selector specificity wins over the resting `rounded-*`.
|
|
114
|
+
size: {
|
|
115
|
+
xs: [
|
|
116
|
+
// XS is special-cased in Compose Button.kt: contentPaddingFor returns
|
|
117
|
+
// ExtraSmallContentPadding (12dp) and iconSpacingFor returns
|
|
118
|
+
// ExtraSmallIconSpacing (4dp) — tighter than the ButtonXSmallTokens
|
|
119
|
+
// Leading/TrailingSpace (16) and IconLabelSpace (8). S–XL use their tokens.
|
|
120
|
+
"h-8 px-3 gap-1 text-label-large [&_[data-slot=button-icon]>svg]:size-5",
|
|
121
|
+
"data-[pressed]:rounded-small active:rounded-small"
|
|
122
|
+
],
|
|
123
|
+
s: [
|
|
124
|
+
"h-10 px-4 gap-2 text-label-large [&_[data-slot=button-icon]>svg]:size-5",
|
|
125
|
+
"data-[pressed]:rounded-small active:rounded-small"
|
|
126
|
+
],
|
|
127
|
+
m: [
|
|
128
|
+
"h-14 px-6 gap-2 text-title-medium [&_[data-slot=button-icon]>svg]:size-6",
|
|
129
|
+
"data-[pressed]:rounded-medium active:rounded-medium"
|
|
130
|
+
],
|
|
131
|
+
l: [
|
|
132
|
+
"h-24 px-12 gap-3 text-headline-small [&_[data-slot=button-icon]>svg]:size-8",
|
|
133
|
+
"data-[pressed]:rounded-large active:rounded-large"
|
|
134
|
+
],
|
|
135
|
+
xl: [
|
|
136
|
+
"h-[136px] px-16 gap-4 text-headline-large [&_[data-slot=button-icon]>svg]:size-10",
|
|
137
|
+
"data-[pressed]:rounded-large active:rounded-large"
|
|
64
138
|
]
|
|
139
|
+
},
|
|
140
|
+
// round = full pill; the square corner is size-specific (compounds below).
|
|
141
|
+
shape: {
|
|
142
|
+
round: "rounded-full",
|
|
143
|
+
square: ""
|
|
144
|
+
},
|
|
145
|
+
// Toggle state, string-keyed so a plain (non-toggle) button — `toggle`
|
|
146
|
+
// unset — fires neither compound below (a boolean variant would default to
|
|
147
|
+
// `off` in tailwind-variants and wrongly apply the unselected look).
|
|
148
|
+
toggle: {
|
|
149
|
+
on: "",
|
|
150
|
+
off: ""
|
|
65
151
|
}
|
|
66
152
|
},
|
|
153
|
+
compoundVariants: [
|
|
154
|
+
// ---- Resting square corner (ContainerShapeSquare) ---------------------
|
|
155
|
+
{ shape: "square", size: "xs", class: "rounded-medium" },
|
|
156
|
+
// 12dp
|
|
157
|
+
{ shape: "square", size: "s", class: "rounded-medium" },
|
|
158
|
+
// 12dp
|
|
159
|
+
{ shape: "square", size: "m", class: "rounded-large" },
|
|
160
|
+
// 16dp
|
|
161
|
+
{ shape: "square", size: "l", class: "rounded-extra-large" },
|
|
162
|
+
// 28dp
|
|
163
|
+
{ shape: "square", size: "xl", class: "rounded-extra-large" },
|
|
164
|
+
// 28dp
|
|
165
|
+
// ---- Selected shape morph: swap to the opposite shape -----------------
|
|
166
|
+
// (listed after the resting corner so tailwind-merge keeps these).
|
|
167
|
+
{ shape: "round", toggle: "on", size: "xs", class: "rounded-medium" },
|
|
168
|
+
{ shape: "round", toggle: "on", size: "s", class: "rounded-medium" },
|
|
169
|
+
{ shape: "round", toggle: "on", size: "m", class: "rounded-large" },
|
|
170
|
+
{ shape: "round", toggle: "on", size: "l", class: "rounded-extra-large" },
|
|
171
|
+
{ shape: "round", toggle: "on", size: "xl", class: "rounded-extra-large" },
|
|
172
|
+
{ shape: "square", toggle: "on", size: "xs", class: "rounded-full" },
|
|
173
|
+
{ shape: "square", toggle: "on", size: "s", class: "rounded-full" },
|
|
174
|
+
{ shape: "square", toggle: "on", size: "m", class: "rounded-full" },
|
|
175
|
+
{ shape: "square", toggle: "on", size: "l", class: "rounded-full" },
|
|
176
|
+
{ shape: "square", toggle: "on", size: "xl", class: "rounded-full" },
|
|
177
|
+
// ---- Outlined border width (OutlinedOutlineWidth: L 2 / XL 3 dp) ------
|
|
178
|
+
{ variant: "outlined", size: "l", class: "border-2" },
|
|
179
|
+
{ variant: "outlined", size: "xl", class: "border-[3px]" },
|
|
180
|
+
// ---- Toggle colors (Selected*/Unselected* tokens) ---------------------
|
|
181
|
+
// filled/tonal: base = default & selected look; `toggle:off` = unselected.
|
|
182
|
+
{ variant: "filled", toggle: "off", class: "bg-surface-container text-on-surface-variant" },
|
|
183
|
+
{ variant: "tonal", toggle: "off", class: "bg-surface-container text-on-surface-variant" },
|
|
184
|
+
// elevated: distinct selected (primary) & unselected looks.
|
|
185
|
+
{ variant: "elevated", toggle: "on", class: "bg-primary text-on-primary" },
|
|
186
|
+
{
|
|
187
|
+
variant: "elevated",
|
|
188
|
+
toggle: "off",
|
|
189
|
+
class: "bg-surface-container-low text-on-surface-variant"
|
|
190
|
+
},
|
|
191
|
+
// outlined: selected fills with the inverse surface (base = unselected).
|
|
192
|
+
{
|
|
193
|
+
variant: "outlined",
|
|
194
|
+
toggle: "on",
|
|
195
|
+
class: [
|
|
196
|
+
"bg-inverse-surface text-inverse-on-surface border-transparent",
|
|
197
|
+
"disabled:bg-on-surface/10 disabled:border-transparent",
|
|
198
|
+
"data-[disabled]:bg-on-surface/10 data-[disabled]:border-transparent"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
// text: no Selected/Unselected tokens exist upstream (TextButtonTokens),
|
|
202
|
+
// so selection raises the label emphasis to primary (base = unselected
|
|
203
|
+
// on-surface-variant) to communicate the toggle state.
|
|
204
|
+
{ variant: "text", toggle: "on", class: "text-primary" }
|
|
205
|
+
],
|
|
67
206
|
defaultVariants: {
|
|
68
|
-
variant: "filled"
|
|
207
|
+
variant: "filled",
|
|
208
|
+
size: "s",
|
|
209
|
+
shape: "round"
|
|
69
210
|
}
|
|
70
211
|
});
|
|
71
|
-
var Button = createButton(
|
|
212
|
+
var Button = createButton(
|
|
213
|
+
({ variant, size, shape, selected }) => button({ variant, size, shape, toggle: toToggle(selected) })
|
|
214
|
+
);
|
|
72
215
|
var WIDTHS = {
|
|
73
216
|
xs: { narrow: "w-7", default: "w-8", wide: "w-10" },
|
|
74
217
|
// 28 / 32 / 40
|
|
@@ -88,6 +231,35 @@ var widthCompounds = Object.entries(WIDTHS).flatMap(
|
|
|
88
231
|
class: klass
|
|
89
232
|
}))
|
|
90
233
|
);
|
|
234
|
+
var SQUARE_CORNER = {
|
|
235
|
+
xs: "rounded-medium",
|
|
236
|
+
// 12dp
|
|
237
|
+
s: "rounded-medium",
|
|
238
|
+
// 12dp
|
|
239
|
+
m: "rounded-large",
|
|
240
|
+
// 16dp
|
|
241
|
+
l: "rounded-extra-large",
|
|
242
|
+
// 28dp
|
|
243
|
+
xl: "rounded-extra-large"
|
|
244
|
+
// 28dp
|
|
245
|
+
};
|
|
246
|
+
var squareShapeCompounds = Object.keys(SQUARE_CORNER).map(
|
|
247
|
+
(size) => ({ shape: "square", size, class: SQUARE_CORNER[size] })
|
|
248
|
+
);
|
|
249
|
+
var selectedShapeCompounds = [
|
|
250
|
+
...Object.keys(SQUARE_CORNER).map((size) => ({
|
|
251
|
+
shape: "round",
|
|
252
|
+
toggle: "on",
|
|
253
|
+
size,
|
|
254
|
+
class: SQUARE_CORNER[size]
|
|
255
|
+
})),
|
|
256
|
+
...Object.keys(SQUARE_CORNER).map((size) => ({
|
|
257
|
+
shape: "square",
|
|
258
|
+
toggle: "on",
|
|
259
|
+
size,
|
|
260
|
+
class: "rounded-full"
|
|
261
|
+
}))
|
|
262
|
+
];
|
|
91
263
|
var iconButton = tv({
|
|
92
264
|
base: [
|
|
93
265
|
"relative inline-flex items-center justify-center shrink-0",
|
|
@@ -95,7 +267,9 @@ var iconButton = tv({
|
|
|
95
267
|
// The state layer is already rounded (before:rounded-[inherit]); the ripple
|
|
96
268
|
// self-clips.
|
|
97
269
|
"rounded-full cursor-pointer select-none border-0 bg-transparent",
|
|
98
|
-
|
|
270
|
+
// Motion: Compose uses DefaultEffects (critically-damped spring, no bounce)
|
|
271
|
+
// for the shape/color transitions — spring-effects-default here.
|
|
272
|
+
"transition-[box-shadow,background-color,color,border-color,border-radius] duration-200 ease-spring-effects-default",
|
|
99
273
|
// State layer overlay
|
|
100
274
|
"before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:pointer-events-none",
|
|
101
275
|
"before:transition-opacity before:duration-100",
|
|
@@ -106,14 +280,14 @@ var iconButton = tv({
|
|
|
106
280
|
// Focus ring (M3: 3px secondary, 2px offset)
|
|
107
281
|
"focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary",
|
|
108
282
|
// Disabled: no interaction, no state layer. Per-variant disabled colors
|
|
109
|
-
// (container on-surface/
|
|
283
|
+
// (container on-surface/10, icon on-surface/38) live on each variant.
|
|
110
284
|
"disabled:pointer-events-none disabled:before:opacity-0",
|
|
111
285
|
"data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0"
|
|
112
286
|
],
|
|
113
287
|
variants: {
|
|
114
288
|
// Disabled icon is on-surface/38 for every variant; filled/tonal disabled
|
|
115
|
-
// container is on-surface/
|
|
116
|
-
//
|
|
289
|
+
// container is on-surface/10 (DisabledContainerOpacity); outlined disabled
|
|
290
|
+
// outline stays outline-variant (Expressive DisabledOutlineColor).
|
|
117
291
|
variant: {
|
|
118
292
|
standard: [
|
|
119
293
|
"text-on-surface-variant",
|
|
@@ -121,70 +295,95 @@ var iconButton = tv({
|
|
|
121
295
|
],
|
|
122
296
|
filled: [
|
|
123
297
|
"bg-primary text-on-primary",
|
|
124
|
-
"disabled:bg-on-surface/
|
|
125
|
-
"data-[disabled]:bg-on-surface/
|
|
298
|
+
"disabled:bg-on-surface/10 disabled:text-on-surface/38",
|
|
299
|
+
"data-[disabled]:bg-on-surface/10 data-[disabled]:text-on-surface/38"
|
|
126
300
|
],
|
|
127
301
|
tonal: [
|
|
128
302
|
"bg-secondary-container text-on-secondary-container",
|
|
129
|
-
"disabled:bg-on-surface/
|
|
130
|
-
"data-[disabled]:bg-on-surface/
|
|
303
|
+
"disabled:bg-on-surface/10 disabled:text-on-surface/38",
|
|
304
|
+
"data-[disabled]:bg-on-surface/10 data-[disabled]:text-on-surface/38"
|
|
131
305
|
],
|
|
132
306
|
outlined: [
|
|
133
|
-
"border border-outline text-on-surface-variant",
|
|
134
|
-
"disabled:border-
|
|
135
|
-
"data-[disabled]:border-
|
|
307
|
+
"border border-outline-variant text-on-surface-variant",
|
|
308
|
+
"disabled:border-outline-variant disabled:text-on-surface/38",
|
|
309
|
+
"data-[disabled]:border-outline-variant data-[disabled]:text-on-surface/38"
|
|
136
310
|
]
|
|
137
311
|
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
312
|
+
// Toggle state, string-keyed so a plain (non-toggle) button — `toggle`
|
|
313
|
+
// unset — fires neither compound below (a boolean variant would default to
|
|
314
|
+
// `off` in tailwind-variants and wrongly apply the unselected look).
|
|
315
|
+
toggle: {
|
|
316
|
+
on: "",
|
|
317
|
+
off: ""
|
|
141
318
|
},
|
|
142
319
|
// Container height + icon size per M3 Expressive size. Width comes from the
|
|
143
|
-
// (size, width) compound variants below.
|
|
320
|
+
// (size, width) compound variants below. The pressed corner morph
|
|
321
|
+
// (PressedContainerShape: XS·S small 8 / M medium 12 / L·XL large 16) rides
|
|
322
|
+
// on data-[pressed]/active so its attribute-selector specificity wins over
|
|
323
|
+
// the resting `rounded-*`.
|
|
144
324
|
size: {
|
|
145
|
-
xs: "h-8 [&>svg]:size-5",
|
|
146
|
-
s: "h-10 [&>svg]:size-6",
|
|
147
|
-
m: "h-14 [&>svg]:size-6",
|
|
148
|
-
l: "h-24 [&>svg]:size-8",
|
|
149
|
-
xl: "h-[136px] [&>svg]:size-10"
|
|
325
|
+
xs: "h-8 [&>svg]:size-5 data-[pressed]:rounded-small active:rounded-small",
|
|
326
|
+
s: "h-10 [&>svg]:size-6 data-[pressed]:rounded-small active:rounded-small",
|
|
327
|
+
m: "h-14 [&>svg]:size-6 data-[pressed]:rounded-medium active:rounded-medium",
|
|
328
|
+
l: "h-24 [&>svg]:size-8 data-[pressed]:rounded-large active:rounded-large",
|
|
329
|
+
xl: "h-[136px] [&>svg]:size-10 data-[pressed]:rounded-large active:rounded-large"
|
|
150
330
|
},
|
|
151
331
|
width: {
|
|
152
332
|
narrow: "",
|
|
153
333
|
default: "",
|
|
154
334
|
wide: ""
|
|
335
|
+
},
|
|
336
|
+
// round = full circle; the square corner is size-specific (compounds below).
|
|
337
|
+
shape: {
|
|
338
|
+
round: "rounded-full",
|
|
339
|
+
square: ""
|
|
155
340
|
}
|
|
156
341
|
},
|
|
157
342
|
compoundVariants: [
|
|
158
343
|
...widthCompounds,
|
|
159
|
-
|
|
160
|
-
|
|
344
|
+
...squareShapeCompounds,
|
|
345
|
+
...selectedShapeCompounds,
|
|
346
|
+
// ---- Outlined border width (OutlinedOutlineWidth: L 2 / XL 3 dp) ------
|
|
347
|
+
{ variant: "outlined", size: "l", class: "border-2" },
|
|
348
|
+
{ variant: "outlined", size: "xl", class: "border-[3px]" },
|
|
349
|
+
// ---- Toggle colors (Selected*/Unselected* tokens) ---------------------
|
|
350
|
+
// standard: unselected = on-surface-variant (base); selected = primary.
|
|
351
|
+
{ variant: "standard", toggle: "on", class: "text-primary" },
|
|
352
|
+
// filled: base = default & selected look (primary/on-primary); unselected =
|
|
353
|
+
// surface-container + on-surface-variant (was surface-container-highest+primary).
|
|
161
354
|
{
|
|
162
|
-
variant: "
|
|
163
|
-
|
|
164
|
-
class: "bg-surface-container
|
|
355
|
+
variant: "filled",
|
|
356
|
+
toggle: "off",
|
|
357
|
+
class: "bg-surface-container text-on-surface-variant"
|
|
165
358
|
},
|
|
359
|
+
// tonal: base = default & unselected look (secondary-container); selected =
|
|
360
|
+
// secondary + on-secondary (was left at the variant default — the "selection
|
|
361
|
+
// not visible" bug this issue fixes).
|
|
362
|
+
{ variant: "tonal", toggle: "on", class: "bg-secondary text-on-secondary" },
|
|
363
|
+
// outlined: selected fills with the inverse surface (base = unselected).
|
|
166
364
|
{
|
|
167
365
|
variant: "outlined",
|
|
168
|
-
|
|
366
|
+
toggle: "on",
|
|
169
367
|
class: [
|
|
170
368
|
"bg-inverse-surface text-inverse-on-surface border-transparent",
|
|
171
|
-
// M3 disabled + selected: faint on-surface/
|
|
369
|
+
// M3 disabled + selected: faint on-surface/10 container, no outline
|
|
172
370
|
// (icon falls back to on-surface/38 from the variant). NOT transparent.
|
|
173
|
-
"disabled:bg-on-surface/
|
|
174
|
-
"data-[disabled]:bg-on-surface/
|
|
371
|
+
"disabled:bg-on-surface/10 disabled:border-transparent",
|
|
372
|
+
"data-[disabled]:bg-on-surface/10 data-[disabled]:border-transparent"
|
|
175
373
|
]
|
|
176
374
|
}
|
|
177
375
|
],
|
|
178
376
|
defaultVariants: {
|
|
179
377
|
variant: "standard",
|
|
180
378
|
size: "s",
|
|
181
|
-
width: "default"
|
|
379
|
+
width: "default",
|
|
380
|
+
shape: "round"
|
|
182
381
|
}
|
|
183
382
|
});
|
|
184
383
|
var IconButton = createIconButton(
|
|
185
|
-
({ variant, selected, size, width }) => iconButton({ variant,
|
|
384
|
+
({ variant, selected, size, width, shape }) => iconButton({ variant, size, width, shape, toggle: toToggle(selected) })
|
|
186
385
|
);
|
|
187
|
-
var switchTv = tv({
|
|
386
|
+
var switchTv = tv$1({
|
|
188
387
|
slots: {
|
|
189
388
|
root: [
|
|
190
389
|
"group relative inline-flex shrink-0 w-[52px] h-8 rounded-full border-2 box-border cursor-pointer",
|
|
@@ -244,7 +443,7 @@ var Switch = createSwitch({
|
|
|
244
443
|
iconChecked: s.iconChecked(),
|
|
245
444
|
iconUnchecked: s.iconUnchecked()
|
|
246
445
|
});
|
|
247
|
-
var checkboxTv = tv({
|
|
446
|
+
var checkboxTv = tv$1({
|
|
248
447
|
slots: {
|
|
249
448
|
root: [
|
|
250
449
|
"group relative inline-flex items-center justify-center shrink-0 box-border",
|
|
@@ -300,7 +499,7 @@ var Checkbox = createCheckbox({
|
|
|
300
499
|
indicator: c.indicator(),
|
|
301
500
|
icon: c.icon()
|
|
302
501
|
});
|
|
303
|
-
var radioTv = tv({
|
|
502
|
+
var radioTv = tv$1({
|
|
304
503
|
slots: {
|
|
305
504
|
root: [
|
|
306
505
|
"group relative inline-flex items-center justify-center shrink-0 box-border",
|
|
@@ -343,7 +542,7 @@ var radioTv = tv({
|
|
|
343
542
|
var r = radioTv();
|
|
344
543
|
var Radio = createRadio({ root: r.root(), indicator: r.indicator() });
|
|
345
544
|
var RadioGroup = createRadioGroup("inline-flex flex-col gap-1");
|
|
346
|
-
var chipTv = tv({
|
|
545
|
+
var chipTv = tv$1({
|
|
347
546
|
slots: {
|
|
348
547
|
root: [
|
|
349
548
|
"group relative inline-flex items-center justify-center gap-2 box-border",
|
|
@@ -437,41 +636,12 @@ var Chip = createChip(({ variant, elevated }) => {
|
|
|
437
636
|
icon: c3.icon()
|
|
438
637
|
};
|
|
439
638
|
});
|
|
440
|
-
var TYPESCALE = [
|
|
441
|
-
"display-large",
|
|
442
|
-
"display-medium",
|
|
443
|
-
"display-small",
|
|
444
|
-
"headline-large",
|
|
445
|
-
"headline-medium",
|
|
446
|
-
"headline-small",
|
|
447
|
-
"title-large",
|
|
448
|
-
"title-medium",
|
|
449
|
-
"title-small",
|
|
450
|
-
"body-large",
|
|
451
|
-
"body-medium",
|
|
452
|
-
"body-small",
|
|
453
|
-
"label-large",
|
|
454
|
-
"label-medium",
|
|
455
|
-
"label-small"
|
|
456
|
-
];
|
|
457
|
-
var tv7 = (options, config) => tv(options, {
|
|
458
|
-
...config,
|
|
459
|
-
twMergeConfig: {
|
|
460
|
-
extend: {
|
|
461
|
-
classGroups: {
|
|
462
|
-
"font-size": [{ text: [...TYPESCALE] }]
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
// src/components/tooltip/tooltip.ts
|
|
469
639
|
var transition = [
|
|
470
640
|
"origin-[var(--transform-origin)] transition-[opacity,transform] duration-150 ease-standard",
|
|
471
641
|
"data-[starting-style]:opacity-0 data-[starting-style]:scale-95",
|
|
472
642
|
"data-[ending-style]:opacity-0 data-[ending-style]:scale-95"
|
|
473
643
|
];
|
|
474
|
-
var tooltipTv =
|
|
644
|
+
var tooltipTv = tv({
|
|
475
645
|
slots: {
|
|
476
646
|
popup: [
|
|
477
647
|
"bg-inverse-surface text-inverse-on-surface text-body-small",
|
|
@@ -481,7 +651,7 @@ var tooltipTv = tv7({
|
|
|
481
651
|
arrow: ["text-inverse-surface"]
|
|
482
652
|
}
|
|
483
653
|
});
|
|
484
|
-
var richTooltipTv =
|
|
654
|
+
var richTooltipTv = tv({
|
|
485
655
|
slots: {
|
|
486
656
|
popup: [
|
|
487
657
|
"bg-surface-container text-on-surface shadow-level2",
|
|
@@ -508,7 +678,7 @@ var RichTooltip = createRichTooltip({
|
|
|
508
678
|
supportingText: r2.supportingText(),
|
|
509
679
|
actions: r2.actions()
|
|
510
680
|
});
|
|
511
|
-
var dialogTv =
|
|
681
|
+
var dialogTv = tv({
|
|
512
682
|
slots: {
|
|
513
683
|
backdrop: [
|
|
514
684
|
"fixed inset-0 z-40 bg-scrim/32",
|
|
@@ -613,7 +783,7 @@ var menuSelectableItemBase = [
|
|
|
613
783
|
...menuSelectableItemPositionShapeFallback,
|
|
614
784
|
...menuSelectableItemDisabled
|
|
615
785
|
];
|
|
616
|
-
var menuSelectableItemTv =
|
|
786
|
+
var menuSelectableItemTv = tv({
|
|
617
787
|
slots: {
|
|
618
788
|
/** Select row: check + label + optional trailing meta. */
|
|
619
789
|
selectItem: ["grid grid-cols-[24px_1fr_auto] items-center gap-3", ...menuSelectableItemBase],
|
|
@@ -638,7 +808,7 @@ var menuSurfaceBase = [
|
|
|
638
808
|
"data-[ending-style]:opacity-0",
|
|
639
809
|
"focus:outline-none"
|
|
640
810
|
];
|
|
641
|
-
var menuSurfaceTv =
|
|
811
|
+
var menuSurfaceTv = tv({
|
|
642
812
|
slots: {
|
|
643
813
|
popup: ["max-w-[280px]", ...menuSurfaceBase],
|
|
644
814
|
groupLabel: "px-3 py-2 text-label-small text-on-surface-variant"
|
|
@@ -666,7 +836,7 @@ menuSurfaceTv();
|
|
|
666
836
|
// src/components/menu/menu.ts
|
|
667
837
|
var surface = menuSurfaceTv({ width: "standard", scroll: "none" });
|
|
668
838
|
var selectable = menuSelectableItem;
|
|
669
|
-
var menuTv =
|
|
839
|
+
var menuTv = tv({
|
|
670
840
|
slots: {
|
|
671
841
|
popup: surface.popup(),
|
|
672
842
|
item: [
|
|
@@ -716,7 +886,7 @@ var Menu = createMenu({
|
|
|
716
886
|
radioItem: m.radioItem(),
|
|
717
887
|
itemIndicator: m.itemIndicator()
|
|
718
888
|
});
|
|
719
|
-
var tabsTv =
|
|
889
|
+
var tabsTv = tv({
|
|
720
890
|
slots: {
|
|
721
891
|
root: "flex flex-col",
|
|
722
892
|
list: [
|
|
@@ -775,36 +945,58 @@ var Tabs = createTabs((variant) => {
|
|
|
775
945
|
panel: s14.panel()
|
|
776
946
|
};
|
|
777
947
|
});
|
|
778
|
-
var sliderTv =
|
|
948
|
+
var sliderTv = tv({
|
|
779
949
|
slots: {
|
|
780
950
|
root: "group relative flex items-center select-none w-full touch-none",
|
|
781
|
-
control: "relative flex items-center w-full h-
|
|
951
|
+
control: "relative flex items-center w-full h-11",
|
|
952
|
+
// Transparent positioning container; the inactive rail lives on the pseudos.
|
|
953
|
+
// `::before` = the rail after the active end (single + range). `::after` =
|
|
954
|
+
// the rail before the active start (range only; it collapses when
|
|
955
|
+
// `--m3-slider-start` is 0). Both offset by the 8px handle gap and keep a 2dp
|
|
956
|
+
// inside corner / full outside corner. Logical inline insets track RTL.
|
|
782
957
|
track: [
|
|
783
|
-
"relative w-full h-
|
|
784
|
-
"
|
|
785
|
-
|
|
958
|
+
"relative w-full h-4",
|
|
959
|
+
"before:content-[''] before:absolute before:top-0 before:bottom-0 before:end-0",
|
|
960
|
+
"before:[inset-inline-start:calc(var(--m3-slider-end)_+_8px)]",
|
|
961
|
+
"before:bg-secondary-container before:rounded-s-[2px] before:rounded-e-full",
|
|
962
|
+
"group-data-[disabled]:before:bg-on-surface/[0.12]",
|
|
963
|
+
"after:content-[''] after:absolute after:top-0 after:bottom-0 after:start-0",
|
|
964
|
+
"after:[inset-inline-end:calc(100%_-_var(--m3-slider-start)_+_8px)]",
|
|
965
|
+
"after:bg-secondary-container after:rounded-s-full after:rounded-e-[2px]",
|
|
966
|
+
"group-data-[disabled]:after:bg-on-surface/[0.12]"
|
|
967
|
+
],
|
|
968
|
+
// Active fill. Geometry (absolute insets built from the active fraction + 8px
|
|
969
|
+
// gap) is set inline by the factory; here we own colour + corners. Outer edge
|
|
970
|
+
// full, inner (handle-facing) edge 2dp; a range slider's start edge is inner
|
|
971
|
+
// too (`data-range`).
|
|
786
972
|
indicator: [
|
|
787
|
-
"
|
|
973
|
+
"bg-primary rounded-s-full rounded-e-[2px]",
|
|
974
|
+
"group-data-[range]:rounded-s-[2px]",
|
|
788
975
|
"group-data-[disabled]:bg-on-surface/[0.38]"
|
|
789
976
|
],
|
|
977
|
+
// 4×44dp bar handle, CornerFull. No state layer: it shrinks to 2dp on
|
|
978
|
+
// pressed (data-dragging) / focus via the fast-spatial spring; hover stays
|
|
979
|
+
// 4dp. Disabled keeps the 4dp width (DisabledHandleWidth) and dims to 0.38.
|
|
790
980
|
thumb: [
|
|
791
|
-
"
|
|
792
|
-
|
|
793
|
-
"
|
|
794
|
-
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
795
|
-
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
796
|
-
"data-[dragging]:before:opacity-[var(--md-sys-state-dragged)]",
|
|
981
|
+
"w-1 h-11 rounded-full bg-primary outline-none",
|
|
982
|
+
"transition-[width] ease-spring-spatial-fast duration-[var(--md-sys-motion-duration-spring-spatial-fast)]",
|
|
983
|
+
"focus-visible:w-0.5 data-[dragging]:w-0.5",
|
|
797
984
|
"group-data-[disabled]:bg-on-surface/[0.38]"
|
|
798
985
|
],
|
|
799
986
|
value: "text-label-large text-on-surface-variant tabular-nums",
|
|
800
987
|
tickList: "pointer-events-none absolute inset-0",
|
|
988
|
+
// Stop dots reverse across the tracks: primary on the inactive rail,
|
|
989
|
+
// secondary-container on the active fill; disabled dots are on-surface.
|
|
801
990
|
tick: [
|
|
802
|
-
"absolute size-1 -translate-x-1/2 -translate-y-1/2 rounded-full bg-
|
|
803
|
-
"data-[active]:bg-
|
|
991
|
+
"absolute size-1 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary",
|
|
992
|
+
"data-[active]:bg-secondary-container",
|
|
993
|
+
"group-data-[disabled]:bg-on-surface"
|
|
804
994
|
],
|
|
995
|
+
// Floating value indicator: inverse-surface container / inverse-on-surface
|
|
996
|
+
// text, 12dp above the handle.
|
|
805
997
|
valueLabel: [
|
|
806
|
-
"pointer-events-none absolute bottom-full left-1/2 mb-
|
|
807
|
-
"bg-
|
|
998
|
+
"pointer-events-none absolute bottom-full left-1/2 mb-3 -translate-x-1/2 whitespace-nowrap rounded px-2 py-0.5",
|
|
999
|
+
"bg-inverse-surface text-label-large text-inverse-on-surface tabular-nums opacity-0",
|
|
808
1000
|
"data-[visible]:opacity-100"
|
|
809
1001
|
]
|
|
810
1002
|
}
|
|
@@ -823,7 +1015,7 @@ var Slider = createSlider({
|
|
|
823
1015
|
});
|
|
824
1016
|
var surface2 = menuSurfaceTv({ width: "anchor", scroll: "auto" });
|
|
825
1017
|
var selectable2 = menuSelectableItem;
|
|
826
|
-
var selectTv =
|
|
1018
|
+
var selectTv = tv({
|
|
827
1019
|
slots: {
|
|
828
1020
|
trigger: [
|
|
829
1021
|
"group relative inline-flex items-center justify-between gap-2 box-border",
|
|
@@ -849,7 +1041,7 @@ var selectTv = tv7({
|
|
|
849
1041
|
groupLabel: surface2.groupLabel()
|
|
850
1042
|
}
|
|
851
1043
|
});
|
|
852
|
-
var selectFieldTv =
|
|
1044
|
+
var selectFieldTv = tv({
|
|
853
1045
|
slots: {
|
|
854
1046
|
// The `group` hook lives here (not in engine-neutral core): supporting text
|
|
855
1047
|
// keys its error color off Field.Root's `group-data-[invalid]`.
|
|
@@ -955,7 +1147,7 @@ var Select = createSelect(
|
|
|
955
1147
|
}
|
|
956
1148
|
);
|
|
957
1149
|
var iconVisual = "inline-flex items-center justify-center shrink-0 text-on-surface-variant [&>svg]:size-6";
|
|
958
|
-
var textFieldTv = tv({
|
|
1150
|
+
var textFieldTv = tv$1({
|
|
959
1151
|
slots: {
|
|
960
1152
|
root: "flex flex-col gap-1 min-w-[210px]",
|
|
961
1153
|
field: [
|
|
@@ -1053,7 +1245,7 @@ var TextField = createTextField(({ variant }) => {
|
|
|
1053
1245
|
counter: c3.counter()
|
|
1054
1246
|
};
|
|
1055
1247
|
});
|
|
1056
|
-
var navigationBarTv = tv({
|
|
1248
|
+
var navigationBarTv = tv$1({
|
|
1057
1249
|
slots: {
|
|
1058
1250
|
root: "flex items-stretch justify-around w-full h-20 bg-surface-container",
|
|
1059
1251
|
item: [
|
|
@@ -1108,7 +1300,7 @@ var NavigationBar = createNavigationBar({
|
|
|
1108
1300
|
icon: s4.icon(),
|
|
1109
1301
|
label: s4.label()
|
|
1110
1302
|
});
|
|
1111
|
-
var fabTv = tv({
|
|
1303
|
+
var fabTv = tv$1({
|
|
1112
1304
|
base: [
|
|
1113
1305
|
"relative inline-flex items-center justify-center box-border overflow-hidden",
|
|
1114
1306
|
"border-0 cursor-pointer select-none outline-none",
|
|
@@ -1178,7 +1370,7 @@ var fabTv = tv({
|
|
|
1178
1370
|
}
|
|
1179
1371
|
});
|
|
1180
1372
|
var Fab = createFab(({ size, color, variant }) => fabTv({ size, color, variant }));
|
|
1181
|
-
var fabMenuTv =
|
|
1373
|
+
var fabMenuTv = tv({
|
|
1182
1374
|
slots: {
|
|
1183
1375
|
popup: [
|
|
1184
1376
|
"flex flex-col items-end gap-1 bg-transparent outline-none",
|
|
@@ -1217,7 +1409,7 @@ var FabMenu = createFabMenu(({ size, color }) => fabTv({ size, color }), {
|
|
|
1217
1409
|
popup: fabMenuTv().popup(),
|
|
1218
1410
|
item: (color) => fabMenuTv({ color }).item()
|
|
1219
1411
|
});
|
|
1220
|
-
var dividerTv = tv({
|
|
1412
|
+
var dividerTv = tv$1({
|
|
1221
1413
|
base: "shrink-0 self-stretch border-0 bg-outline-variant",
|
|
1222
1414
|
variants: {
|
|
1223
1415
|
orientation: {
|
|
@@ -1243,7 +1435,7 @@ var dividerTv = tv({
|
|
|
1243
1435
|
}
|
|
1244
1436
|
});
|
|
1245
1437
|
var Divider = createDivider(({ inset, orientation }) => dividerTv({ inset, orientation }));
|
|
1246
|
-
var linearTv = tv({
|
|
1438
|
+
var linearTv = tv$1({
|
|
1247
1439
|
slots: {
|
|
1248
1440
|
// The track-stop dot (primary, full track height) sits at the inline-end via
|
|
1249
1441
|
// `after:`. It's a determinate-only M3 concept, so it's hidden while
|
|
@@ -1299,7 +1491,7 @@ var linearTv = tv({
|
|
|
1299
1491
|
]
|
|
1300
1492
|
}
|
|
1301
1493
|
});
|
|
1302
|
-
var circularTv = tv({
|
|
1494
|
+
var circularTv = tv$1({
|
|
1303
1495
|
slots: {
|
|
1304
1496
|
// Size comes from the factory (inline width/height) so `size` is honored.
|
|
1305
1497
|
// Indeterminate rotates the whole ring; the arc grows/shrinks via the
|
|
@@ -1335,7 +1527,7 @@ var Progress = createProgress({
|
|
|
1335
1527
|
},
|
|
1336
1528
|
circular: { root: c2.root(), track: c2.track(), indicator: c2.indicator() }
|
|
1337
1529
|
});
|
|
1338
|
-
var loadingIndicatorTv =
|
|
1530
|
+
var loadingIndicatorTv = tv({
|
|
1339
1531
|
slots: {
|
|
1340
1532
|
// The SVG is a fixed 38dp active indicator. Uncontained: the box shrinks to
|
|
1341
1533
|
// the shape. Contained: a 48dp pill wraps it (5dp inset on each side).
|
|
@@ -1358,7 +1550,7 @@ var LoadingIndicator = createLoadingIndicator(({ contained }) => {
|
|
|
1358
1550
|
const s14 = loadingIndicatorTv({ contained });
|
|
1359
1551
|
return { root: s14.root(), indicator: s14.indicator() };
|
|
1360
1552
|
});
|
|
1361
|
-
var listTv =
|
|
1553
|
+
var listTv = tv({
|
|
1362
1554
|
slots: {
|
|
1363
1555
|
root: "list-none m-0 px-0 py-2 bg-transparent",
|
|
1364
1556
|
item: [
|
|
@@ -1421,7 +1613,7 @@ var List = createList({
|
|
|
1421
1613
|
};
|
|
1422
1614
|
}
|
|
1423
1615
|
});
|
|
1424
|
-
var snackbarTv = tv({
|
|
1616
|
+
var snackbarTv = tv$1({
|
|
1425
1617
|
slots: {
|
|
1426
1618
|
viewport: [
|
|
1427
1619
|
"fixed bottom-4 left-1/2 -translate-x-1/2 z-50",
|
|
@@ -1473,7 +1665,7 @@ var Snackbar = createSnackbar({
|
|
|
1473
1665
|
action: s5.action(),
|
|
1474
1666
|
close: s5.close()
|
|
1475
1667
|
});
|
|
1476
|
-
var itemTv =
|
|
1668
|
+
var itemTv = tv({
|
|
1477
1669
|
slots: {
|
|
1478
1670
|
root: [
|
|
1479
1671
|
"relative flex w-full items-center gap-4 box-border px-4 py-3 min-h-14 text-left",
|
|
@@ -1504,7 +1696,7 @@ var Item = createItem({
|
|
|
1504
1696
|
supporting: s6.supporting(),
|
|
1505
1697
|
trailing: s6.trailing()
|
|
1506
1698
|
});
|
|
1507
|
-
var badgeTv =
|
|
1699
|
+
var badgeTv = tv({
|
|
1508
1700
|
base: "pointer-events-none select-none inline-flex items-center justify-center bg-error text-on-error",
|
|
1509
1701
|
variants: {
|
|
1510
1702
|
size: {
|
|
@@ -1516,7 +1708,7 @@ var badgeTv = tv7({
|
|
|
1516
1708
|
var Badge = createBadge({
|
|
1517
1709
|
root: ({ size }) => badgeTv({ size })
|
|
1518
1710
|
});
|
|
1519
|
-
var cardTv =
|
|
1711
|
+
var cardTv = tv({
|
|
1520
1712
|
base: "relative box-border rounded-medium text-on-surface",
|
|
1521
1713
|
variants: {
|
|
1522
1714
|
variant: {
|
|
@@ -1557,7 +1749,7 @@ var cardTv = tv7({
|
|
|
1557
1749
|
var Card = createCard({
|
|
1558
1750
|
root: ({ variant, interactive }) => cardTv({ variant, interactive })
|
|
1559
1751
|
});
|
|
1560
|
-
var segmentedButtonTv =
|
|
1752
|
+
var segmentedButtonTv = tv({
|
|
1561
1753
|
slots: {
|
|
1562
1754
|
root: "inline-flex items-stretch h-10 rounded-full border border-outline",
|
|
1563
1755
|
item: [
|
|
@@ -1595,7 +1787,7 @@ var SegmentedButton = createSegmentedButton({
|
|
|
1595
1787
|
icon: s7.icon(),
|
|
1596
1788
|
label: s7.label()
|
|
1597
1789
|
});
|
|
1598
|
-
var buttonGroup =
|
|
1790
|
+
var buttonGroup = tv({
|
|
1599
1791
|
base: "inline-flex items-center",
|
|
1600
1792
|
variants: {
|
|
1601
1793
|
variant: {
|
|
@@ -1653,7 +1845,7 @@ var VARIANT_TEXT = [
|
|
|
1653
1845
|
"disabled:text-on-surface/38",
|
|
1654
1846
|
"data-[disabled]:text-on-surface/38"
|
|
1655
1847
|
];
|
|
1656
|
-
var splitButtonTv =
|
|
1848
|
+
var splitButtonTv = tv({
|
|
1657
1849
|
slots: {
|
|
1658
1850
|
group: "inline-flex items-center gap-0.5",
|
|
1659
1851
|
// leading: outer (start) corner full, seam (end) corner reduced.
|
|
@@ -1703,7 +1895,7 @@ var SplitButton = createSplitButton({
|
|
|
1703
1895
|
popup: splitButtonTv().popup(),
|
|
1704
1896
|
item: splitButtonTv().item()
|
|
1705
1897
|
});
|
|
1706
|
-
var navigationDrawerTv =
|
|
1898
|
+
var navigationDrawerTv = tv({
|
|
1707
1899
|
slots: {
|
|
1708
1900
|
root: "flex flex-col gap-1 box-border w-[360px] p-3 bg-surface-container-low text-on-surface",
|
|
1709
1901
|
headline: "px-4 pt-4 pb-1 text-title-small text-on-surface-variant",
|
|
@@ -1743,7 +1935,7 @@ var NavigationDrawer = createNavigationDrawer({
|
|
|
1743
1935
|
label: s8.label(),
|
|
1744
1936
|
trailing: s8.trailing()
|
|
1745
1937
|
});
|
|
1746
|
-
var topAppBarTv =
|
|
1938
|
+
var topAppBarTv = tv({
|
|
1747
1939
|
slots: {
|
|
1748
1940
|
root: "flex flex-col w-full box-border h-16 bg-surface text-on-surface",
|
|
1749
1941
|
row: "flex items-center gap-1 h-16 px-1",
|
|
@@ -1773,7 +1965,7 @@ var TopAppBar = createTopAppBar((args) => {
|
|
|
1773
1965
|
trailing: s14.trailing()
|
|
1774
1966
|
};
|
|
1775
1967
|
});
|
|
1776
|
-
var bottomAppBarTv =
|
|
1968
|
+
var bottomAppBarTv = tv({
|
|
1777
1969
|
slots: {
|
|
1778
1970
|
root: "flex items-center justify-between w-full box-border h-20 px-1 bg-surface-container text-on-surface-variant",
|
|
1779
1971
|
actions: "flex items-center gap-1 pl-2 [&_svg]:size-6",
|
|
@@ -1786,7 +1978,7 @@ var BottomAppBar = createBottomAppBar({
|
|
|
1786
1978
|
actions: s9.actions(),
|
|
1787
1979
|
fab: s9.fab()
|
|
1788
1980
|
});
|
|
1789
|
-
var navigationRailTv =
|
|
1981
|
+
var navigationRailTv = tv({
|
|
1790
1982
|
slots: {
|
|
1791
1983
|
root: "flex flex-col items-center gap-3 h-full w-20 py-5 bg-surface",
|
|
1792
1984
|
header: "flex flex-col items-center gap-3 mb-1",
|
|
@@ -1840,7 +2032,7 @@ var NavigationRail = createNavigationRail({
|
|
|
1840
2032
|
icon: s10.icon(),
|
|
1841
2033
|
label: s10.label()
|
|
1842
2034
|
});
|
|
1843
|
-
var bottomSheetTv =
|
|
2035
|
+
var bottomSheetTv = tv({
|
|
1844
2036
|
slots: {
|
|
1845
2037
|
backdrop: [
|
|
1846
2038
|
"fixed inset-0 z-40 bg-scrim/32",
|
|
@@ -1872,7 +2064,7 @@ var BottomSheet = createBottomSheet({
|
|
|
1872
2064
|
title: s11.title(),
|
|
1873
2065
|
description: s11.description()
|
|
1874
2066
|
});
|
|
1875
|
-
var sideSheetTv =
|
|
2067
|
+
var sideSheetTv = tv({
|
|
1876
2068
|
slots: {
|
|
1877
2069
|
backdrop: [
|
|
1878
2070
|
"fixed inset-0 z-40 bg-scrim/32",
|
|
@@ -1924,7 +2116,7 @@ var SideSheet = createSideSheet({
|
|
|
1924
2116
|
description: s12.description(),
|
|
1925
2117
|
close: s12.close()
|
|
1926
2118
|
});
|
|
1927
|
-
var searchTv =
|
|
2119
|
+
var searchTv = tv({
|
|
1928
2120
|
slots: {
|
|
1929
2121
|
bar: [
|
|
1930
2122
|
"flex items-center gap-1 h-14 min-w-[360px] max-w-full pl-4 pr-2",
|
|
@@ -1991,7 +2183,7 @@ var Search = createSearch({
|
|
|
1991
2183
|
separator: s13.separator(),
|
|
1992
2184
|
groupLabel: s13.groupLabel()
|
|
1993
2185
|
});
|
|
1994
|
-
var datePickerTv =
|
|
2186
|
+
var datePickerTv = tv({
|
|
1995
2187
|
slots: {
|
|
1996
2188
|
calendar: ["w-[328px] max-w-full p-3 text-on-surface"],
|
|
1997
2189
|
header: ["flex items-center justify-between gap-2 h-12 pl-3 pr-1"],
|
|
@@ -2112,7 +2304,7 @@ var stateLayerBase = [
|
|
|
2112
2304
|
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
2113
2305
|
"focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary focus-visible:outline-offset-2"
|
|
2114
2306
|
];
|
|
2115
|
-
var timePickerTv =
|
|
2307
|
+
var timePickerTv = tv({
|
|
2116
2308
|
slots: {
|
|
2117
2309
|
root: ["inline-flex flex-col items-center p-2 text-on-surface"],
|
|
2118
2310
|
header: ["flex items-center gap-3 min-h-[98px]"],
|
|
@@ -2182,7 +2374,7 @@ var TimePicker = createTimePicker(() => ({
|
|
|
2182
2374
|
inputBox: tp.inputBox(),
|
|
2183
2375
|
inputCaption: tp.inputCaption()
|
|
2184
2376
|
}));
|
|
2185
|
-
var toolbarTv =
|
|
2377
|
+
var toolbarTv = tv({
|
|
2186
2378
|
base: "inline-flex items-center justify-center gap-1 box-border rounded-full shadow-level3 [&_svg]:size-6",
|
|
2187
2379
|
variants: {
|
|
2188
2380
|
variant: {
|
|
@@ -2199,7 +2391,7 @@ var toolbarTv = tv7({
|
|
|
2199
2391
|
var Toolbar = createToolbar(
|
|
2200
2392
|
({ variant, orientation }) => toolbarTv({ variant, orientation })
|
|
2201
2393
|
);
|
|
2202
|
-
var carouselTv =
|
|
2394
|
+
var carouselTv = tv({
|
|
2203
2395
|
slots: {
|
|
2204
2396
|
root: [
|
|
2205
2397
|
"flex gap-2 overflow-x-auto snap-x snap-mandatory scroll-smooth",
|