@m3-baseui/react-tailwind 1.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/badge.d.ts +45 -0
- package/dist/badge.js +50 -0
- package/dist/badge.js.map +1 -0
- package/dist/button.d.ts +69 -0
- package/dist/button.js +74 -0
- package/dist/button.js.map +1 -0
- package/dist/card.d.ts +80 -0
- package/dist/card.js +77 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.d.ts +63 -0
- package/dist/checkbox.js +60 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chip.d.ts +165 -0
- package/dist/chip.js +76 -0
- package/dist/chip.js.map +1 -0
- package/dist/dialog.d.ts +86 -0
- package/dist/dialog.js +68 -0
- package/dist/dialog.js.map +1 -0
- package/dist/divider.d.ts +83 -0
- package/dist/divider.js +34 -0
- package/dist/divider.js.map +1 -0
- package/dist/fab.d.ts +104 -0
- package/dist/fab.js +43 -0
- package/dist/fab.js.map +1 -0
- package/dist/icon-button.d.ts +174 -0
- package/dist/icon-button.js +121 -0
- package/dist/icon-button.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +1157 -0
- package/dist/index.js.map +1 -0
- package/dist/item.d.ts +94 -0
- package/dist/item.js +62 -0
- package/dist/item.js.map +1 -0
- package/dist/list.d.ts +163 -0
- package/dist/list.js +94 -0
- package/dist/list.js.map +1 -0
- package/dist/menu.d.ts +119 -0
- package/dist/menu.js +114 -0
- package/dist/menu.js.map +1 -0
- package/dist/navigation-bar.d.ts +91 -0
- package/dist/navigation-bar.js +48 -0
- package/dist/navigation-bar.js.map +1 -0
- package/dist/navigation-drawer.d.ts +86 -0
- package/dist/navigation-drawer.js +78 -0
- package/dist/navigation-drawer.js.map +1 -0
- package/dist/progress.d.ts +118 -0
- package/dist/progress.js +41 -0
- package/dist/progress.js.map +1 -0
- package/dist/radio.d.ts +56 -0
- package/dist/radio.js +47 -0
- package/dist/radio.js.map +1 -0
- package/dist/segmented-button.d.ts +83 -0
- package/dist/segmented-button.js +71 -0
- package/dist/segmented-button.js.map +1 -0
- package/dist/select.d.ts +125 -0
- package/dist/select.js +99 -0
- package/dist/select.js.map +1 -0
- package/dist/slider.d.ts +94 -0
- package/dist/slider.js +71 -0
- package/dist/slider.js.map +1 -0
- package/dist/snackbar.d.ts +108 -0
- package/dist/snackbar.js +57 -0
- package/dist/snackbar.js.map +1 -0
- package/dist/switch.d.ts +72 -0
- package/dist/switch.js +66 -0
- package/dist/switch.js.map +1 -0
- package/dist/tabs.d.ts +118 -0
- package/dist/tabs.js +97 -0
- package/dist/tabs.js.map +1 -0
- package/dist/textfield.d.ts +127 -0
- package/dist/textfield.js +83 -0
- package/dist/textfield.js.map +1 -0
- package/dist/tooltip.d.ts +61 -0
- package/dist/tooltip.js +52 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/tv.d.ts +19 -0
- package/dist/tv.js +35 -0
- package/dist/tv.js.map +1 -0
- package/package.json +171 -0
- package/styles/preset.css +30 -0
- package/styles/theme.css +213 -0
- package/styles/tokens.css +361 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1157 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createButton, createIconButton, createSwitch, createCheckbox, createRadio, createRadioGroup, createChip, createTooltip, createDialog, createMenu, createTabs, createSlider, createSelect, createTextField, createNavigationBar, createFab, createDivider, createProgress, createList, createSnackbar, createItem, createBadge, createCard, createSegmentedButton, createNavigationDrawer } from '@m3-baseui/core';
|
|
3
|
+
export { Ripple, ThemeProvider, applyScheme, generateScheme, schemeToCssText, useSnackbar, useTheme } from '@m3-baseui/core';
|
|
4
|
+
import { tv } from 'tailwind-variants';
|
|
5
|
+
|
|
6
|
+
// src/button.ts
|
|
7
|
+
var button = tv({
|
|
8
|
+
base: [
|
|
9
|
+
"relative inline-flex items-center justify-center gap-2",
|
|
10
|
+
"h-10 px-6 rounded-full overflow-hidden cursor-pointer select-none border-0",
|
|
11
|
+
"text-label-large",
|
|
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.
|
|
15
|
+
"[&_[data-slot=button-icon]]:inline-flex [&_[data-slot=button-icon]]:items-center [&_[data-slot=button-icon]]:justify-center",
|
|
16
|
+
"[&_[data-slot=button-icon]>svg]:size-[18px]",
|
|
17
|
+
"transition-[box-shadow,background-color,color,border-color] duration-200 ease-[var(--md-sys-motion-easing-standard)]",
|
|
18
|
+
// State layer overlay
|
|
19
|
+
"before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:pointer-events-none",
|
|
20
|
+
"before:transition-opacity before:duration-100",
|
|
21
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
22
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
23
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
24
|
+
"data-[pressed]:before:opacity-[var(--md-sys-state-pressed)]",
|
|
25
|
+
// Focus ring (M3: 3px secondary, 2px offset)
|
|
26
|
+
"focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary",
|
|
27
|
+
// Disabled: no interaction, no state layer, no elevation. Per-variant
|
|
28
|
+
// colors (container on-surface/12, label on-surface/38) live on each variant.
|
|
29
|
+
"disabled:pointer-events-none disabled:shadow-none disabled:before:opacity-0",
|
|
30
|
+
"data-[disabled]:pointer-events-none data-[disabled]:shadow-none data-[disabled]:before:opacity-0"
|
|
31
|
+
],
|
|
32
|
+
variants: {
|
|
33
|
+
// M3 elevation per variant: filled/tonal rest level0→hover level1→pressed level0;
|
|
34
|
+
// elevated rest level1→hover level2→pressed level1. Disabled container is
|
|
35
|
+
// on-surface/12 and label on-surface/38, matching material-web.
|
|
36
|
+
variant: {
|
|
37
|
+
filled: [
|
|
38
|
+
"bg-primary text-on-primary",
|
|
39
|
+
"hover:shadow-level1 focus-visible:shadow-none active:shadow-none data-[pressed]:shadow-none",
|
|
40
|
+
"disabled:bg-on-surface/12 disabled:text-on-surface/38",
|
|
41
|
+
"data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38"
|
|
42
|
+
],
|
|
43
|
+
tonal: [
|
|
44
|
+
"bg-secondary-container text-on-secondary-container",
|
|
45
|
+
"hover:shadow-level1 focus-visible:shadow-none active:shadow-none data-[pressed]:shadow-none",
|
|
46
|
+
"disabled:bg-on-surface/12 disabled:text-on-surface/38",
|
|
47
|
+
"data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38"
|
|
48
|
+
],
|
|
49
|
+
outlined: [
|
|
50
|
+
"bg-transparent text-primary border border-outline",
|
|
51
|
+
"disabled:text-on-surface/38 disabled:border-on-surface/12",
|
|
52
|
+
"data-[disabled]:text-on-surface/38 data-[disabled]:border-on-surface/12"
|
|
53
|
+
],
|
|
54
|
+
elevated: [
|
|
55
|
+
"bg-surface-container-low text-primary shadow-level1",
|
|
56
|
+
"hover:shadow-level2 focus-visible:shadow-level1 active:shadow-level1 data-[pressed]:shadow-level1",
|
|
57
|
+
"disabled:bg-on-surface/12 disabled:text-on-surface/38",
|
|
58
|
+
"data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38"
|
|
59
|
+
],
|
|
60
|
+
text: [
|
|
61
|
+
"bg-transparent text-primary px-3",
|
|
62
|
+
"disabled:text-on-surface/38",
|
|
63
|
+
"data-[disabled]:text-on-surface/38"
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
defaultVariants: {
|
|
68
|
+
variant: "filled"
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
var Button = createButton(({ variant }) => button({ variant }));
|
|
72
|
+
var WIDTHS = {
|
|
73
|
+
xs: { narrow: "w-7", default: "w-8", wide: "w-10" },
|
|
74
|
+
// 28 / 32 / 40
|
|
75
|
+
s: { narrow: "w-8", default: "w-10", wide: "w-13" },
|
|
76
|
+
// 32 / 40 / 52
|
|
77
|
+
m: { narrow: "w-12", default: "w-14", wide: "w-18" },
|
|
78
|
+
// 48 / 56 / 72
|
|
79
|
+
l: { narrow: "w-16", default: "w-24", wide: "w-32" },
|
|
80
|
+
// 64 / 96 / 128
|
|
81
|
+
xl: { narrow: "w-26", default: "w-34", wide: "w-46" }
|
|
82
|
+
// 104 / 136 / 184
|
|
83
|
+
};
|
|
84
|
+
var widthCompounds = Object.entries(WIDTHS).flatMap(
|
|
85
|
+
([size, w]) => Object.entries(w).map(([width, klass]) => ({
|
|
86
|
+
size,
|
|
87
|
+
width,
|
|
88
|
+
class: klass
|
|
89
|
+
}))
|
|
90
|
+
);
|
|
91
|
+
var iconButton = tv({
|
|
92
|
+
base: [
|
|
93
|
+
"relative inline-flex items-center justify-center shrink-0",
|
|
94
|
+
"rounded-full overflow-hidden cursor-pointer select-none border-0 bg-transparent",
|
|
95
|
+
"transition-[box-shadow,background-color,color] duration-200 ease-standard",
|
|
96
|
+
// State layer overlay
|
|
97
|
+
"before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:pointer-events-none",
|
|
98
|
+
"before:transition-opacity before:duration-100",
|
|
99
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
100
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
101
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
102
|
+
"data-[pressed]:before:opacity-[var(--md-sys-state-pressed)]",
|
|
103
|
+
// Focus ring (M3: 3px secondary, 2px offset)
|
|
104
|
+
"focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary",
|
|
105
|
+
// Disabled: no interaction, no state layer. Per-variant disabled colors
|
|
106
|
+
// (container on-surface/12, icon on-surface/38) live on each variant.
|
|
107
|
+
"disabled:pointer-events-none disabled:before:opacity-0",
|
|
108
|
+
"data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0"
|
|
109
|
+
],
|
|
110
|
+
variants: {
|
|
111
|
+
// Disabled icon is on-surface/38 for every variant; filled/tonal disabled
|
|
112
|
+
// container is on-surface/12; outlined disabled outline is on-surface/12
|
|
113
|
+
// (material-web parity).
|
|
114
|
+
variant: {
|
|
115
|
+
standard: [
|
|
116
|
+
"text-on-surface-variant",
|
|
117
|
+
"disabled:text-on-surface/38 data-[disabled]:text-on-surface/38"
|
|
118
|
+
],
|
|
119
|
+
filled: [
|
|
120
|
+
"bg-primary text-on-primary",
|
|
121
|
+
"disabled:bg-on-surface/12 disabled:text-on-surface/38",
|
|
122
|
+
"data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38"
|
|
123
|
+
],
|
|
124
|
+
tonal: [
|
|
125
|
+
"bg-secondary-container text-on-secondary-container",
|
|
126
|
+
"disabled:bg-on-surface/12 disabled:text-on-surface/38",
|
|
127
|
+
"data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38"
|
|
128
|
+
],
|
|
129
|
+
outlined: [
|
|
130
|
+
"border border-outline text-on-surface-variant",
|
|
131
|
+
"disabled:border-on-surface/12 disabled:text-on-surface/38",
|
|
132
|
+
"data-[disabled]:border-on-surface/12 data-[disabled]:text-on-surface/38"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
selected: {
|
|
136
|
+
true: "",
|
|
137
|
+
false: ""
|
|
138
|
+
},
|
|
139
|
+
// Container height + icon size per M3 Expressive size. Width comes from the
|
|
140
|
+
// (size, width) compound variants below.
|
|
141
|
+
size: {
|
|
142
|
+
xs: "h-8 [&>svg]:size-5",
|
|
143
|
+
s: "h-10 [&>svg]:size-6",
|
|
144
|
+
m: "h-14 [&>svg]:size-6",
|
|
145
|
+
l: "h-24 [&>svg]:size-8",
|
|
146
|
+
xl: "h-[136px] [&>svg]:size-10"
|
|
147
|
+
},
|
|
148
|
+
width: {
|
|
149
|
+
narrow: "",
|
|
150
|
+
default: "",
|
|
151
|
+
wide: ""
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
compoundVariants: [
|
|
155
|
+
...widthCompounds,
|
|
156
|
+
{ variant: "standard", selected: true, class: "text-primary" },
|
|
157
|
+
{ variant: "filled", selected: false, class: "bg-surface-container-highest text-primary" },
|
|
158
|
+
{
|
|
159
|
+
variant: "tonal",
|
|
160
|
+
selected: false,
|
|
161
|
+
class: "bg-surface-container-highest text-on-surface-variant"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
variant: "outlined",
|
|
165
|
+
selected: true,
|
|
166
|
+
class: [
|
|
167
|
+
"bg-inverse-surface text-inverse-on-surface border-transparent",
|
|
168
|
+
// M3 disabled + selected: faint on-surface/12 container, no outline
|
|
169
|
+
// (icon falls back to on-surface/38 from the variant). NOT transparent.
|
|
170
|
+
"disabled:bg-on-surface/12 disabled:border-transparent",
|
|
171
|
+
"data-[disabled]:bg-on-surface/12 data-[disabled]:border-transparent"
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
defaultVariants: {
|
|
176
|
+
variant: "standard",
|
|
177
|
+
size: "s",
|
|
178
|
+
width: "default"
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
var IconButton = createIconButton(
|
|
182
|
+
({ variant, selected, size, width }) => iconButton({ variant, selected, size, width })
|
|
183
|
+
);
|
|
184
|
+
var switchTv = tv({
|
|
185
|
+
slots: {
|
|
186
|
+
root: [
|
|
187
|
+
"group relative inline-flex shrink-0 w-[52px] h-8 rounded-full border-2 box-border cursor-pointer",
|
|
188
|
+
"bg-surface-container-highest border-outline",
|
|
189
|
+
"transition-colors duration-200 ease-standard",
|
|
190
|
+
"data-[checked]:bg-primary data-[checked]:border-primary",
|
|
191
|
+
"focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary",
|
|
192
|
+
"data-[disabled]:pointer-events-none",
|
|
193
|
+
// M3 disabled: faint track + outline (unselected); on-surface/12 track,
|
|
194
|
+
// no outline (selected). Not a blanket element opacity.
|
|
195
|
+
"data-[disabled]:bg-surface-container-highest/12 data-[disabled]:border-on-surface/12",
|
|
196
|
+
"data-[disabled]:data-[checked]:bg-on-surface/12 data-[disabled]:data-[checked]:border-transparent"
|
|
197
|
+
],
|
|
198
|
+
thumb: [
|
|
199
|
+
"absolute top-1/2 -translate-y-1/2 left-[6px] size-4 rounded-full pointer-events-none",
|
|
200
|
+
"flex items-center justify-center",
|
|
201
|
+
"bg-outline text-on-surface",
|
|
202
|
+
"transition-all duration-200 ease-standard",
|
|
203
|
+
"data-[checked]:left-[22px] data-[checked]:size-6 data-[checked]:bg-on-primary data-[checked]:text-primary",
|
|
204
|
+
// M3 with-icon: the unchecked handle grows to 24dp to fit its icon
|
|
205
|
+
"data-[with-icon]:data-[unchecked]:left-1 data-[with-icon]:data-[unchecked]:size-6",
|
|
206
|
+
// M3 handle interaction colors: unselected outline→on-surface-variant,
|
|
207
|
+
// selected on-primary→primary-container on hover/focus/press
|
|
208
|
+
"group-hover:bg-on-surface-variant group-focus-visible:bg-on-surface-variant group-active:bg-on-surface-variant",
|
|
209
|
+
"group-hover:data-[checked]:bg-primary-container group-focus-visible:data-[checked]:bg-primary-container group-active:data-[checked]:bg-primary-container",
|
|
210
|
+
// M3 squish: handle grows to 28px while pressed, staying on its side
|
|
211
|
+
"group-active:left-0 group-active:size-7",
|
|
212
|
+
"group-active:data-[checked]:left-5 group-active:data-[checked]:size-7",
|
|
213
|
+
// M3 disabled handle: on-surface/38 (unselected), surface (selected)
|
|
214
|
+
"group-data-[disabled]:bg-on-surface/38",
|
|
215
|
+
"group-data-[disabled]:data-[checked]:bg-surface",
|
|
216
|
+
// 40dp circular state layer centered on the thumb
|
|
217
|
+
'before:content-[""] before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2',
|
|
218
|
+
"before:size-10 before:rounded-full before:bg-current before:opacity-0 before:transition-opacity before:duration-100",
|
|
219
|
+
"group-hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
220
|
+
"group-focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
221
|
+
"group-active:before:opacity-[var(--md-sys-state-pressed)]"
|
|
222
|
+
],
|
|
223
|
+
// Handle icons (16dp). Both stay mounted; the root's data-checked reveals one.
|
|
224
|
+
iconChecked: [
|
|
225
|
+
"hidden group-data-[checked]:inline-flex items-center justify-center",
|
|
226
|
+
"text-on-primary-container [&>svg]:size-4"
|
|
227
|
+
],
|
|
228
|
+
iconUnchecked: [
|
|
229
|
+
"inline-flex group-data-[checked]:hidden items-center justify-center",
|
|
230
|
+
"text-surface-container-highest [&>svg]:size-4"
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
var s = switchTv();
|
|
235
|
+
var Switch = createSwitch({
|
|
236
|
+
root: s.root(),
|
|
237
|
+
thumb: s.thumb(),
|
|
238
|
+
iconChecked: s.iconChecked(),
|
|
239
|
+
iconUnchecked: s.iconUnchecked()
|
|
240
|
+
});
|
|
241
|
+
var checkboxTv = tv({
|
|
242
|
+
slots: {
|
|
243
|
+
root: [
|
|
244
|
+
"group relative inline-flex items-center justify-center shrink-0 box-border",
|
|
245
|
+
"size-[18px] rounded-[2px] border-2 cursor-pointer bg-transparent",
|
|
246
|
+
// Outline is on-surface-variant; the state layer (text/currentColor) is
|
|
247
|
+
// on-surface unselected, primary when selected (material-web).
|
|
248
|
+
"border-on-surface-variant text-on-surface",
|
|
249
|
+
"transition-colors duration-150 ease-standard",
|
|
250
|
+
"data-[checked]:bg-primary data-[checked]:border-primary data-[checked]:text-primary",
|
|
251
|
+
"data-[indeterminate]:bg-primary data-[indeterminate]:border-primary data-[indeterminate]:text-primary",
|
|
252
|
+
// M3 pressed state layer inverts: unselected→primary, selected→on-surface
|
|
253
|
+
"active:text-primary",
|
|
254
|
+
"data-[checked]:active:text-on-surface data-[indeterminate]:active:text-on-surface",
|
|
255
|
+
// M3 error: error outline + error-filled box; state layer stays error
|
|
256
|
+
"data-[error]:border-error data-[error]:text-error data-[error]:active:text-error",
|
|
257
|
+
"data-[error]:data-[checked]:bg-error data-[error]:data-[checked]:border-error data-[error]:data-[checked]:text-error data-[error]:data-[checked]:active:text-error",
|
|
258
|
+
"data-[error]:data-[indeterminate]:bg-error data-[error]:data-[indeterminate]:border-error data-[error]:data-[indeterminate]:text-error data-[error]:data-[indeterminate]:active:text-error",
|
|
259
|
+
"focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary",
|
|
260
|
+
"data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0",
|
|
261
|
+
// M3 disabled: unselected outline on-surface/38; selected/indeterminate
|
|
262
|
+
// box on-surface/38 with no outline (the check turns surface, below).
|
|
263
|
+
"data-[disabled]:border-on-surface/38",
|
|
264
|
+
"data-[disabled]:data-[checked]:bg-on-surface/38 data-[disabled]:data-[checked]:border-transparent",
|
|
265
|
+
"data-[disabled]:data-[indeterminate]:bg-on-surface/38 data-[disabled]:data-[indeterminate]:border-transparent",
|
|
266
|
+
// 40dp circular state layer
|
|
267
|
+
'before:content-[""] before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2',
|
|
268
|
+
"before:size-10 before:rounded-full before:bg-current before:opacity-0 before:transition-opacity before:duration-100",
|
|
269
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
270
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
271
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]"
|
|
272
|
+
],
|
|
273
|
+
indicator: [
|
|
274
|
+
"group/cb relative inline-flex items-center justify-center size-full pointer-events-none text-on-primary",
|
|
275
|
+
// M3 error: the check / dash turn on-error on the error-filled box
|
|
276
|
+
"group-data-[error]:text-on-error",
|
|
277
|
+
// M3 disabled: the check / dash turn the surface color on the faint box
|
|
278
|
+
"group-data-[disabled]:text-surface",
|
|
279
|
+
"opacity-0 data-[checked]:opacity-100 data-[indeterminate]:opacity-100",
|
|
280
|
+
'data-[indeterminate]:after:content-[""] data-[indeterminate]:after:absolute',
|
|
281
|
+
"data-[indeterminate]:after:w-[10px] data-[indeterminate]:after:h-[2px] data-[indeterminate]:after:rounded-full data-[indeterminate]:after:bg-current"
|
|
282
|
+
],
|
|
283
|
+
icon: ["w-[18px] h-[18px] group-data-[indeterminate]/cb:opacity-0"]
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
var c = checkboxTv();
|
|
287
|
+
var Checkbox = createCheckbox({
|
|
288
|
+
root: c.root(),
|
|
289
|
+
indicator: c.indicator(),
|
|
290
|
+
icon: c.icon()
|
|
291
|
+
});
|
|
292
|
+
var radioTv = tv({
|
|
293
|
+
slots: {
|
|
294
|
+
root: [
|
|
295
|
+
"group relative inline-flex items-center justify-center shrink-0 box-border",
|
|
296
|
+
"size-5 rounded-full border-2 cursor-pointer bg-transparent",
|
|
297
|
+
// Ring is on-surface-variant; the state layer (text/currentColor) is
|
|
298
|
+
// on-surface unselected, primary when selected (material-web).
|
|
299
|
+
"border-on-surface-variant text-on-surface",
|
|
300
|
+
"transition-colors duration-150 ease-standard",
|
|
301
|
+
"data-[checked]:border-primary data-[checked]:text-primary",
|
|
302
|
+
// M3 pressed state layer inverts: unselected→primary, selected→on-surface
|
|
303
|
+
"active:text-primary",
|
|
304
|
+
"data-[checked]:active:text-on-surface",
|
|
305
|
+
// M3 error: error ring + error state layer in every interaction state
|
|
306
|
+
"data-[error]:border-error data-[error]:text-error data-[error]:active:text-error",
|
|
307
|
+
"data-[error]:data-[checked]:border-error data-[error]:data-[checked]:text-error data-[error]:data-[checked]:active:text-error",
|
|
308
|
+
"focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary",
|
|
309
|
+
// M3 disabled: ring (and dot) turn on-surface/38; no state layer.
|
|
310
|
+
"data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0",
|
|
311
|
+
"data-[disabled]:border-on-surface/38",
|
|
312
|
+
'before:content-[""] before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2',
|
|
313
|
+
"before:size-10 before:rounded-full before:bg-current before:opacity-0 before:transition-opacity before:duration-100",
|
|
314
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
315
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
316
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]"
|
|
317
|
+
],
|
|
318
|
+
indicator: [
|
|
319
|
+
"block rounded-full bg-primary pointer-events-none",
|
|
320
|
+
"size-0 opacity-0 transition-all duration-150 ease-standard",
|
|
321
|
+
"data-[checked]:size-2.5 data-[checked]:opacity-100",
|
|
322
|
+
"group-data-[error]:bg-error",
|
|
323
|
+
"group-data-[disabled]:bg-on-surface/38"
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
var r = radioTv();
|
|
328
|
+
var Radio = createRadio({ root: r.root(), indicator: r.indicator() });
|
|
329
|
+
var RadioGroup = createRadioGroup("inline-flex flex-col gap-1");
|
|
330
|
+
var chipTv = tv({
|
|
331
|
+
slots: {
|
|
332
|
+
root: [
|
|
333
|
+
"group relative inline-flex items-center justify-center gap-2 box-border",
|
|
334
|
+
"h-8 px-4 rounded-[8px] overflow-hidden select-none border bg-transparent text-label-large",
|
|
335
|
+
"transition-colors duration-150 ease-standard",
|
|
336
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
337
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
338
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
339
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
340
|
+
"focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary",
|
|
341
|
+
// M3 disabled: label on-surface/38, outline on-surface/12; no state layer.
|
|
342
|
+
"data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0",
|
|
343
|
+
"disabled:pointer-events-none disabled:before:opacity-0",
|
|
344
|
+
"data-[disabled]:text-on-surface/38 data-[disabled]:border-on-surface/12",
|
|
345
|
+
"disabled:text-on-surface/38 disabled:border-on-surface/12"
|
|
346
|
+
],
|
|
347
|
+
remove: [
|
|
348
|
+
"inline-flex items-center justify-center shrink-0 size-[18px] -mr-1 ml-1 rounded-full border-0 bg-transparent",
|
|
349
|
+
"text-on-surface-variant cursor-pointer hover:opacity-80"
|
|
350
|
+
],
|
|
351
|
+
check: [
|
|
352
|
+
"inline-flex items-center justify-center shrink-0 h-[18px] w-0 -ml-2 opacity-0 overflow-hidden pointer-events-none",
|
|
353
|
+
"transition-all duration-150 ease-standard",
|
|
354
|
+
"group-data-[pressed]:w-[18px] group-data-[pressed]:ml-0 group-data-[pressed]:opacity-100"
|
|
355
|
+
],
|
|
356
|
+
// M3 leading avatar: 24dp circle; negative margin trims the leading padding to 4dp.
|
|
357
|
+
avatar: [
|
|
358
|
+
"inline-flex items-center justify-center shrink-0 size-6 -ml-3 rounded-full overflow-hidden",
|
|
359
|
+
"bg-primary-container text-on-primary-container",
|
|
360
|
+
"[&>img]:size-full [&>img]:object-cover"
|
|
361
|
+
]
|
|
362
|
+
},
|
|
363
|
+
variants: {
|
|
364
|
+
variant: {
|
|
365
|
+
assist: { root: "border-outline text-on-surface cursor-pointer" },
|
|
366
|
+
suggestion: { root: "border-outline text-on-surface-variant cursor-pointer" },
|
|
367
|
+
input: { root: "border-outline text-on-surface-variant cursor-default pr-2" },
|
|
368
|
+
filter: {
|
|
369
|
+
root: [
|
|
370
|
+
"border-outline text-on-surface-variant cursor-pointer",
|
|
371
|
+
"data-[pressed]:bg-secondary-container data-[pressed]:text-on-secondary-container data-[pressed]:border-transparent",
|
|
372
|
+
// M3 disabled + selected: faint on-surface/12 container
|
|
373
|
+
"data-[pressed]:data-[disabled]:bg-on-surface/12 data-[pressed]:disabled:bg-on-surface/12"
|
|
374
|
+
]
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
// M3 elevated: filled surface-container-low + elevation level1→level2 on hover,
|
|
378
|
+
// no outline. Disabled drops the shadow.
|
|
379
|
+
elevated: {
|
|
380
|
+
true: {
|
|
381
|
+
root: [
|
|
382
|
+
"bg-surface-container-low border-transparent shadow-level1",
|
|
383
|
+
"hover:shadow-level2 active:shadow-level1",
|
|
384
|
+
"disabled:shadow-none data-[disabled]:shadow-none"
|
|
385
|
+
]
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
defaultVariants: {
|
|
390
|
+
variant: "assist"
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
var Chip = createChip(({ variant, elevated }) => {
|
|
394
|
+
const c3 = chipTv({ variant, elevated });
|
|
395
|
+
return { root: c3.root(), remove: c3.remove(), check: c3.check(), avatar: c3.avatar() };
|
|
396
|
+
});
|
|
397
|
+
var TYPESCALE = [
|
|
398
|
+
"display-large",
|
|
399
|
+
"display-medium",
|
|
400
|
+
"display-small",
|
|
401
|
+
"headline-large",
|
|
402
|
+
"headline-medium",
|
|
403
|
+
"headline-small",
|
|
404
|
+
"title-large",
|
|
405
|
+
"title-medium",
|
|
406
|
+
"title-small",
|
|
407
|
+
"body-large",
|
|
408
|
+
"body-medium",
|
|
409
|
+
"body-small",
|
|
410
|
+
"label-large",
|
|
411
|
+
"label-medium",
|
|
412
|
+
"label-small"
|
|
413
|
+
];
|
|
414
|
+
var tv7 = (options, config) => tv(options, {
|
|
415
|
+
...config,
|
|
416
|
+
twMergeConfig: {
|
|
417
|
+
extend: {
|
|
418
|
+
classGroups: {
|
|
419
|
+
"font-size": [{ text: [...TYPESCALE] }]
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
// src/tooltip.ts
|
|
426
|
+
var tooltipTv = tv7({
|
|
427
|
+
slots: {
|
|
428
|
+
popup: [
|
|
429
|
+
"bg-inverse-surface text-inverse-on-surface text-body-small",
|
|
430
|
+
"rounded-extra-small px-2 py-1 max-w-[224px] select-none",
|
|
431
|
+
"origin-[var(--transform-origin)] transition-[opacity,transform] duration-150 ease-standard",
|
|
432
|
+
"data-[starting-style]:opacity-0 data-[starting-style]:scale-95",
|
|
433
|
+
"data-[ending-style]:opacity-0 data-[ending-style]:scale-95"
|
|
434
|
+
],
|
|
435
|
+
arrow: ["text-inverse-surface"]
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
var t = tooltipTv();
|
|
439
|
+
var Tooltip = createTooltip({ popup: t.popup(), arrow: t.arrow() });
|
|
440
|
+
var dialogTv = tv7({
|
|
441
|
+
slots: {
|
|
442
|
+
backdrop: [
|
|
443
|
+
"fixed inset-0 z-40 bg-scrim/32",
|
|
444
|
+
"transition-opacity duration-200 ease-standard",
|
|
445
|
+
"data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"
|
|
446
|
+
],
|
|
447
|
+
popup: [
|
|
448
|
+
"fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2",
|
|
449
|
+
"w-[min(560px,calc(100vw-48px))] max-h-[calc(100vh-48px)] overflow-auto",
|
|
450
|
+
"bg-surface-container-high text-on-surface rounded-extra-large shadow-level3",
|
|
451
|
+
"p-6 flex flex-col gap-4",
|
|
452
|
+
"origin-[var(--transform-origin)] transition-[opacity,transform] duration-200 ease-emphasized",
|
|
453
|
+
"data-[starting-style]:opacity-0 data-[starting-style]:scale-95",
|
|
454
|
+
"data-[ending-style]:opacity-0 data-[ending-style]:scale-95",
|
|
455
|
+
"focus:outline-none"
|
|
456
|
+
],
|
|
457
|
+
title: ["text-headline-small text-on-surface m-0"],
|
|
458
|
+
description: ["text-body-medium text-on-surface-variant m-0"],
|
|
459
|
+
close: ["inline-flex"]
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
var d = dialogTv();
|
|
463
|
+
var Dialog = createDialog({
|
|
464
|
+
backdrop: d.backdrop(),
|
|
465
|
+
popup: d.popup(),
|
|
466
|
+
title: d.title(),
|
|
467
|
+
description: d.description(),
|
|
468
|
+
close: d.close()
|
|
469
|
+
});
|
|
470
|
+
var menuTv = tv7({
|
|
471
|
+
slots: {
|
|
472
|
+
popup: [
|
|
473
|
+
"min-w-[112px] max-w-[280px] py-2",
|
|
474
|
+
"bg-surface-container text-on-surface rounded-extra-small shadow-level2",
|
|
475
|
+
"origin-[var(--transform-origin)] transition-[opacity,transform] duration-150 ease-standard",
|
|
476
|
+
"data-[starting-style]:opacity-0 data-[starting-style]:scale-95",
|
|
477
|
+
"data-[ending-style]:opacity-0",
|
|
478
|
+
"focus:outline-none"
|
|
479
|
+
],
|
|
480
|
+
item: [
|
|
481
|
+
"relative flex items-center gap-3 h-12 px-3 overflow-hidden cursor-pointer select-none outline-none",
|
|
482
|
+
"text-label-large text-on-surface",
|
|
483
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
484
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
485
|
+
"data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]",
|
|
486
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
487
|
+
// M3 disabled (per-token, not a blanket fade): label + leading/trailing
|
|
488
|
+
// icon on-surface/0.38, no state layer.
|
|
489
|
+
"data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none",
|
|
490
|
+
"data-[disabled]:[&_[data-slot=menu-leading]]:text-on-surface/[0.38] data-[disabled]:[&_[data-slot=menu-trailing]]:text-on-surface/[0.38]",
|
|
491
|
+
// M3 leading icon (24dp) + trailing supporting text (shortcut/meta).
|
|
492
|
+
"[&_[data-slot=menu-leading]]:inline-flex [&_[data-slot=menu-leading]]:text-on-surface-variant [&_[data-slot=menu-leading]>svg]:size-6",
|
|
493
|
+
"[&_[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"
|
|
494
|
+
],
|
|
495
|
+
separator: ["my-2 h-px border-0 bg-outline-variant"],
|
|
496
|
+
groupLabel: ["px-3 py-2 text-label-small text-on-surface-variant"],
|
|
497
|
+
// Submenu trigger: item look + trailing chevron, highlighted while open.
|
|
498
|
+
submenuTrigger: [
|
|
499
|
+
"relative flex items-center justify-between gap-3 h-12 px-3 overflow-hidden cursor-pointer select-none outline-none",
|
|
500
|
+
"text-label-large text-on-surface",
|
|
501
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
502
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
503
|
+
"data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]",
|
|
504
|
+
"data-[popup-open]:before:opacity-[var(--md-sys-state-hover)]",
|
|
505
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
506
|
+
// M3 disabled (per-token): label + leading icon on-surface/0.38, no state layer.
|
|
507
|
+
"data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none",
|
|
508
|
+
"data-[disabled]:[&_[data-slot=menu-leading]]:text-on-surface/[0.38]",
|
|
509
|
+
"[&_[data-slot=menu-leading]]:inline-flex [&_[data-slot=menu-leading]]:text-on-surface-variant [&_[data-slot=menu-leading]>svg]:size-6"
|
|
510
|
+
],
|
|
511
|
+
// Selectable items: 24dp leading indicator column + label.
|
|
512
|
+
checkboxItem: [
|
|
513
|
+
"group relative grid grid-cols-[24px_1fr] items-center gap-3 h-12 px-3 overflow-hidden",
|
|
514
|
+
"cursor-pointer select-none outline-none text-label-large text-on-surface",
|
|
515
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
516
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
517
|
+
"data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]",
|
|
518
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
519
|
+
// M3 disabled (per-token): label on-surface/0.38, no state layer.
|
|
520
|
+
"data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none"
|
|
521
|
+
],
|
|
522
|
+
radioItem: [
|
|
523
|
+
"group relative grid grid-cols-[24px_1fr] items-center gap-3 h-12 px-3 overflow-hidden",
|
|
524
|
+
"cursor-pointer select-none outline-none text-label-large text-on-surface",
|
|
525
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
526
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
527
|
+
"data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]",
|
|
528
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
529
|
+
// M3 disabled (per-token): label on-surface/0.38, no state layer.
|
|
530
|
+
"data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none"
|
|
531
|
+
],
|
|
532
|
+
itemIndicator: "inline-flex items-center justify-center text-on-surface invisible group-data-[checked]:visible group-data-[disabled]:text-on-surface/[0.38]"
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
var m = menuTv();
|
|
536
|
+
var Menu = createMenu({
|
|
537
|
+
popup: m.popup(),
|
|
538
|
+
item: m.item(),
|
|
539
|
+
separator: m.separator(),
|
|
540
|
+
groupLabel: m.groupLabel(),
|
|
541
|
+
submenuTrigger: m.submenuTrigger(),
|
|
542
|
+
checkboxItem: m.checkboxItem(),
|
|
543
|
+
radioItem: m.radioItem(),
|
|
544
|
+
itemIndicator: m.itemIndicator()
|
|
545
|
+
});
|
|
546
|
+
var tabsTv = tv7({
|
|
547
|
+
slots: {
|
|
548
|
+
root: "flex flex-col",
|
|
549
|
+
list: [
|
|
550
|
+
"relative flex border-b border-surface-variant",
|
|
551
|
+
// M3 scrollable tabs: horizontal overflow, no wrap, hidden scrollbar.
|
|
552
|
+
"data-[scrollable]:overflow-x-auto data-[scrollable]:flex-nowrap",
|
|
553
|
+
"data-[scrollable]:[scrollbar-width:none] data-[scrollable]:[&::-webkit-scrollbar]:hidden"
|
|
554
|
+
],
|
|
555
|
+
tab: [
|
|
556
|
+
"relative flex shrink-0 items-center justify-center gap-2 h-12 px-4 overflow-hidden",
|
|
557
|
+
"cursor-pointer select-none border-0 bg-transparent outline-none text-title-small",
|
|
558
|
+
"text-on-surface-variant",
|
|
559
|
+
// Icon slot (24dp), centered.
|
|
560
|
+
"[&_[data-slot=tab-icon]]:inline-flex [&_[data-slot=tab-icon]>svg]:size-6",
|
|
561
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
562
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
563
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
564
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
565
|
+
// M3 disabled (per-token, not a blanket fade): label + icon on-surface/0.38,
|
|
566
|
+
// no state layer. currentColor carries the dim to the icon slot.
|
|
567
|
+
"data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none",
|
|
568
|
+
// A disabled tab that is also the active value stays dimmed: the variant's
|
|
569
|
+
// data-[active] color has equal specificity, so a combined selector wins.
|
|
570
|
+
"data-[disabled]:data-[active]:text-on-surface/[0.38]"
|
|
571
|
+
],
|
|
572
|
+
indicator: [
|
|
573
|
+
"absolute bottom-0 left-0 bg-primary",
|
|
574
|
+
"w-[var(--active-tab-width)] translate-x-[var(--active-tab-left)]",
|
|
575
|
+
"transition-all duration-200 ease-standard"
|
|
576
|
+
],
|
|
577
|
+
panel: "p-4 outline-none"
|
|
578
|
+
},
|
|
579
|
+
variants: {
|
|
580
|
+
variant: {
|
|
581
|
+
// primary: 3dp active indicator with rounded top corners; icon stacks
|
|
582
|
+
// above the label (64dp tall) when a tab carries an icon.
|
|
583
|
+
primary: {
|
|
584
|
+
tab: "data-[active]:text-primary data-[with-icon]:flex-col data-[with-icon]:h-16 data-[with-icon]:gap-1",
|
|
585
|
+
indicator: "h-[3px] rounded-t-[3px]"
|
|
586
|
+
},
|
|
587
|
+
// secondary: 2dp square active indicator, active label = on-surface
|
|
588
|
+
secondary: { tab: "data-[active]:text-on-surface", indicator: "h-[2px]" }
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
defaultVariants: {
|
|
592
|
+
variant: "primary"
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
var Tabs = createTabs((variant) => {
|
|
596
|
+
const s9 = tabsTv({ variant });
|
|
597
|
+
return {
|
|
598
|
+
root: s9.root(),
|
|
599
|
+
list: s9.list(),
|
|
600
|
+
tab: s9.tab(),
|
|
601
|
+
indicator: s9.indicator(),
|
|
602
|
+
panel: s9.panel()
|
|
603
|
+
};
|
|
604
|
+
});
|
|
605
|
+
var sliderTv = tv7({
|
|
606
|
+
slots: {
|
|
607
|
+
root: "group relative flex items-center select-none w-full touch-none",
|
|
608
|
+
control: "relative flex items-center w-full h-10",
|
|
609
|
+
track: [
|
|
610
|
+
"relative w-full h-1 rounded-full bg-surface-container-highest",
|
|
611
|
+
"group-data-[disabled]:bg-on-surface/[0.12]"
|
|
612
|
+
],
|
|
613
|
+
indicator: [
|
|
614
|
+
"absolute h-1 rounded-full bg-primary",
|
|
615
|
+
"group-data-[disabled]:bg-on-surface/[0.38]"
|
|
616
|
+
],
|
|
617
|
+
thumb: [
|
|
618
|
+
"relative size-5 rounded-full bg-primary outline-none",
|
|
619
|
+
'before:content-[""] before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2',
|
|
620
|
+
"before:size-10 before:rounded-full before:bg-primary before:opacity-0 before:transition-opacity before:duration-100",
|
|
621
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
622
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
623
|
+
"data-[dragging]:before:opacity-[var(--md-sys-state-pressed)]",
|
|
624
|
+
"group-data-[disabled]:bg-on-surface/[0.38]"
|
|
625
|
+
],
|
|
626
|
+
value: "text-label-large text-on-surface-variant tabular-nums"
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
var s2 = sliderTv();
|
|
630
|
+
var Slider = createSlider({
|
|
631
|
+
root: s2.root(),
|
|
632
|
+
control: s2.control(),
|
|
633
|
+
track: s2.track(),
|
|
634
|
+
indicator: s2.indicator(),
|
|
635
|
+
thumb: s2.thumb(),
|
|
636
|
+
value: s2.value()
|
|
637
|
+
});
|
|
638
|
+
var selectTv = tv7({
|
|
639
|
+
slots: {
|
|
640
|
+
trigger: [
|
|
641
|
+
"group relative inline-flex items-center justify-between gap-2 box-border",
|
|
642
|
+
"h-14 min-w-[200px] px-4 rounded-extra-small border border-outline bg-transparent",
|
|
643
|
+
"text-on-surface text-body-large cursor-pointer outline-none text-left",
|
|
644
|
+
"transition-colors duration-150 ease-standard",
|
|
645
|
+
// focus/open = 3dp primary outline; padding drops 2px to keep content steady
|
|
646
|
+
"data-[popup-open]:border-primary data-[popup-open]:border-[3px] data-[popup-open]:px-[14px]",
|
|
647
|
+
"focus-visible:border-primary focus-visible:border-[3px] focus-visible:px-[14px]",
|
|
648
|
+
"data-[disabled]:border-on-surface/[0.12] data-[disabled]:text-on-surface/[0.38] data-[disabled]:pointer-events-none"
|
|
649
|
+
],
|
|
650
|
+
value: "flex-1 truncate",
|
|
651
|
+
icon: "flex text-on-surface-variant transition-transform duration-150 group-data-[popup-open]:rotate-180 group-data-[disabled]:text-on-surface/[0.38]",
|
|
652
|
+
popup: [
|
|
653
|
+
"min-w-[var(--anchor-width)] max-h-[var(--available-height)] py-2 overflow-auto",
|
|
654
|
+
"bg-surface-container text-on-surface rounded-extra-small shadow-level2",
|
|
655
|
+
"origin-[var(--transform-origin)] transition-[opacity,transform] duration-150 ease-standard",
|
|
656
|
+
"data-[starting-style]:opacity-0 data-[starting-style]:scale-95",
|
|
657
|
+
"data-[ending-style]:opacity-0",
|
|
658
|
+
"focus:outline-none"
|
|
659
|
+
],
|
|
660
|
+
item: [
|
|
661
|
+
"group relative grid grid-cols-[24px_1fr_auto] items-center gap-2 h-12 px-3 overflow-hidden",
|
|
662
|
+
"cursor-pointer select-none outline-none text-body-large text-on-surface",
|
|
663
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
664
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
665
|
+
"data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]",
|
|
666
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
667
|
+
// M3 disabled (per-token, not a blanket fade): label + trailing supporting
|
|
668
|
+
// text on-surface/0.38, no state layer.
|
|
669
|
+
"data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none",
|
|
670
|
+
"data-[disabled]:[&_[data-slot=select-trailing]]:text-on-surface/[0.38]",
|
|
671
|
+
// M3 trailing supporting text (e.g. meta) sits in the last column.
|
|
672
|
+
"[&_[data-slot=select-trailing]]:pl-4 [&_[data-slot=select-trailing]]:text-label-large [&_[data-slot=select-trailing]]:text-on-surface-variant"
|
|
673
|
+
],
|
|
674
|
+
itemIndicator: "inline-flex items-center justify-center text-primary invisible group-data-[selected]:visible group-data-[disabled]:text-on-surface/[0.38]",
|
|
675
|
+
groupLabel: "px-3 py-2 text-label-small text-on-surface-variant",
|
|
676
|
+
// Sticky scroll affordances at the popup edges; surface-tinted with a chevron.
|
|
677
|
+
scrollUpArrow: [
|
|
678
|
+
"sticky top-0 z-[1] flex items-center justify-center h-6 cursor-default",
|
|
679
|
+
"bg-surface-container text-on-surface-variant [&>svg]:size-5"
|
|
680
|
+
],
|
|
681
|
+
scrollDownArrow: [
|
|
682
|
+
"sticky bottom-0 z-[1] flex items-center justify-center h-6 cursor-default",
|
|
683
|
+
"bg-surface-container text-on-surface-variant [&>svg]:size-5"
|
|
684
|
+
]
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
var s3 = selectTv();
|
|
688
|
+
var Select = createSelect({
|
|
689
|
+
trigger: s3.trigger(),
|
|
690
|
+
value: s3.value(),
|
|
691
|
+
icon: s3.icon(),
|
|
692
|
+
popup: s3.popup(),
|
|
693
|
+
item: s3.item(),
|
|
694
|
+
itemIndicator: s3.itemIndicator(),
|
|
695
|
+
groupLabel: s3.groupLabel(),
|
|
696
|
+
scrollUpArrow: s3.scrollUpArrow(),
|
|
697
|
+
scrollDownArrow: s3.scrollDownArrow()
|
|
698
|
+
});
|
|
699
|
+
var textFieldTv = tv({
|
|
700
|
+
slots: {
|
|
701
|
+
root: "flex flex-col gap-1 min-w-[210px]",
|
|
702
|
+
field: [
|
|
703
|
+
"relative flex items-stretch gap-3 h-14 px-4 box-border",
|
|
704
|
+
"transition-[border-color,padding] duration-150 ease-standard",
|
|
705
|
+
"group-data-[disabled]:opacity-[0.38] group-data-[disabled]:pointer-events-none"
|
|
706
|
+
],
|
|
707
|
+
inputWrap: "relative flex-1 flex items-center min-w-0",
|
|
708
|
+
input: [
|
|
709
|
+
"peer w-full bg-transparent outline-none border-0 p-0 text-body-large text-on-surface",
|
|
710
|
+
"placeholder:text-on-surface-variant"
|
|
711
|
+
],
|
|
712
|
+
label: [
|
|
713
|
+
"absolute left-0 pointer-events-none origin-left",
|
|
714
|
+
"top-1/2 -translate-y-1/2 text-body-large text-on-surface-variant",
|
|
715
|
+
"transition-all duration-150 ease-standard",
|
|
716
|
+
"group-data-[focused]:text-primary group-data-[invalid]:text-error"
|
|
717
|
+
],
|
|
718
|
+
leadingIcon: "flex items-center shrink-0 text-on-surface-variant",
|
|
719
|
+
trailingIcon: "flex items-center shrink-0 text-on-surface-variant",
|
|
720
|
+
supporting: [
|
|
721
|
+
"flex justify-between gap-4 px-4 text-body-small text-on-surface-variant",
|
|
722
|
+
"group-data-[invalid]:text-error"
|
|
723
|
+
],
|
|
724
|
+
supportingText: "min-w-0",
|
|
725
|
+
counter: "shrink-0 tabular-nums"
|
|
726
|
+
},
|
|
727
|
+
variants: {
|
|
728
|
+
variant: {
|
|
729
|
+
filled: {
|
|
730
|
+
field: [
|
|
731
|
+
"rounded-t-extra-small bg-surface-container-highest",
|
|
732
|
+
"border-b-2 border-outline",
|
|
733
|
+
"group-data-[focused]:border-primary group-data-[invalid]:border-error"
|
|
734
|
+
],
|
|
735
|
+
input: "pt-3",
|
|
736
|
+
label: [
|
|
737
|
+
"group-data-[focused]:top-1.5 group-data-[focused]:translate-y-0 group-data-[focused]:text-body-small",
|
|
738
|
+
"group-data-[filled]:top-1.5 group-data-[filled]:translate-y-0 group-data-[filled]:text-body-small"
|
|
739
|
+
]
|
|
740
|
+
},
|
|
741
|
+
outlined: {
|
|
742
|
+
field: [
|
|
743
|
+
"rounded-extra-small border border-outline",
|
|
744
|
+
"group-data-[focused]:border-2 group-data-[focused]:border-primary group-data-[focused]:px-[15px]",
|
|
745
|
+
"group-data-[invalid]:border-error"
|
|
746
|
+
],
|
|
747
|
+
label: [
|
|
748
|
+
"group-data-[focused]:top-0 group-data-[focused]:-translate-y-1/2 group-data-[focused]:text-body-small group-data-[focused]:bg-surface group-data-[focused]:px-1",
|
|
749
|
+
"group-data-[filled]:top-0 group-data-[filled]:-translate-y-1/2 group-data-[filled]:text-body-small group-data-[filled]:bg-surface group-data-[filled]:px-1"
|
|
750
|
+
]
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
defaultVariants: {
|
|
755
|
+
variant: "filled"
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
var TextField = createTextField(({ variant }) => {
|
|
759
|
+
const c3 = textFieldTv({ variant });
|
|
760
|
+
return {
|
|
761
|
+
root: c3.root(),
|
|
762
|
+
field: c3.field(),
|
|
763
|
+
inputWrap: c3.inputWrap(),
|
|
764
|
+
input: c3.input(),
|
|
765
|
+
label: c3.label(),
|
|
766
|
+
leadingIcon: c3.leadingIcon(),
|
|
767
|
+
trailingIcon: c3.trailingIcon(),
|
|
768
|
+
supporting: c3.supporting(),
|
|
769
|
+
supportingText: c3.supportingText(),
|
|
770
|
+
counter: c3.counter()
|
|
771
|
+
};
|
|
772
|
+
});
|
|
773
|
+
var navigationBarTv = tv({
|
|
774
|
+
slots: {
|
|
775
|
+
root: "flex items-stretch justify-around w-full h-20 bg-surface-container",
|
|
776
|
+
item: [
|
|
777
|
+
"group relative flex flex-1 flex-col items-center justify-center gap-1 px-1 pt-3 pb-4",
|
|
778
|
+
"bg-transparent border-0 cursor-pointer select-none outline-none",
|
|
779
|
+
"data-[disabled]:opacity-[0.38] data-[disabled]:pointer-events-none"
|
|
780
|
+
],
|
|
781
|
+
iconWrap: "relative flex items-center justify-center w-16 h-8",
|
|
782
|
+
indicator: [
|
|
783
|
+
"absolute inset-0 rounded-full bg-transparent overflow-hidden",
|
|
784
|
+
"transition-colors duration-150 ease-standard",
|
|
785
|
+
"group-data-[pressed]:bg-secondary-container",
|
|
786
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
787
|
+
"group-hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
788
|
+
"group-focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
789
|
+
"group-active:before:opacity-[var(--md-sys-state-pressed)]"
|
|
790
|
+
],
|
|
791
|
+
icon: [
|
|
792
|
+
"relative flex items-center justify-center text-on-surface-variant",
|
|
793
|
+
"transition-colors duration-150 ease-standard",
|
|
794
|
+
"group-data-[pressed]:text-on-secondary-container"
|
|
795
|
+
],
|
|
796
|
+
label: [
|
|
797
|
+
"text-label-medium text-on-surface-variant",
|
|
798
|
+
"transition-colors duration-150 ease-standard",
|
|
799
|
+
"group-data-[pressed]:text-on-surface group-data-[pressed]:font-bold"
|
|
800
|
+
]
|
|
801
|
+
}
|
|
802
|
+
});
|
|
803
|
+
var s4 = navigationBarTv();
|
|
804
|
+
var NavigationBar = createNavigationBar({
|
|
805
|
+
root: s4.root(),
|
|
806
|
+
item: s4.item(),
|
|
807
|
+
iconWrap: s4.iconWrap(),
|
|
808
|
+
indicator: s4.indicator(),
|
|
809
|
+
icon: s4.icon(),
|
|
810
|
+
label: s4.label()
|
|
811
|
+
});
|
|
812
|
+
var fabTv = tv({
|
|
813
|
+
base: [
|
|
814
|
+
"relative inline-flex items-center justify-center box-border overflow-hidden",
|
|
815
|
+
"border-0 cursor-pointer select-none outline-none",
|
|
816
|
+
"shadow-level3 hover:shadow-level4",
|
|
817
|
+
"transition-shadow duration-150 ease-standard",
|
|
818
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
819
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
820
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
821
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
822
|
+
"data-[pressed]:before:opacity-[var(--md-sys-state-pressed)]",
|
|
823
|
+
"disabled:opacity-[0.38] disabled:pointer-events-none disabled:shadow-none",
|
|
824
|
+
"data-[disabled]:opacity-[0.38] data-[disabled]:pointer-events-none data-[disabled]:shadow-none"
|
|
825
|
+
],
|
|
826
|
+
variants: {
|
|
827
|
+
size: {
|
|
828
|
+
small: "size-10 rounded-medium [&_svg]:size-6",
|
|
829
|
+
regular: "size-14 rounded-large [&_svg]:size-6",
|
|
830
|
+
large: "size-24 rounded-extra-large [&_svg]:size-9",
|
|
831
|
+
extended: "h-14 min-w-20 px-4 gap-3 rounded-large text-label-large [&_svg]:size-6"
|
|
832
|
+
},
|
|
833
|
+
color: {
|
|
834
|
+
surface: "bg-surface-container-high text-primary",
|
|
835
|
+
primary: "bg-primary-container text-on-primary-container",
|
|
836
|
+
secondary: "bg-secondary-container text-on-secondary-container",
|
|
837
|
+
tertiary: "bg-tertiary-container text-on-tertiary-container"
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
defaultVariants: {
|
|
841
|
+
size: "regular",
|
|
842
|
+
color: "surface"
|
|
843
|
+
}
|
|
844
|
+
});
|
|
845
|
+
var Fab = createFab(({ size, color }) => fabTv({ size, color }));
|
|
846
|
+
var dividerTv = tv({
|
|
847
|
+
base: "shrink-0 self-stretch border-0 bg-outline-variant",
|
|
848
|
+
variants: {
|
|
849
|
+
orientation: {
|
|
850
|
+
horizontal: "h-px w-auto",
|
|
851
|
+
vertical: "w-px h-auto"
|
|
852
|
+
},
|
|
853
|
+
inset: {
|
|
854
|
+
full: "",
|
|
855
|
+
inset: "",
|
|
856
|
+
middle: ""
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
compoundVariants: [
|
|
860
|
+
{ orientation: "horizontal", inset: "inset", class: "ms-4" },
|
|
861
|
+
{ orientation: "horizontal", inset: "middle", class: "mx-4" },
|
|
862
|
+
{ orientation: "vertical", inset: "inset", class: "mt-4" },
|
|
863
|
+
{ orientation: "vertical", inset: "middle", class: "my-4" }
|
|
864
|
+
],
|
|
865
|
+
defaultVariants: {
|
|
866
|
+
orientation: "horizontal",
|
|
867
|
+
inset: "full"
|
|
868
|
+
}
|
|
869
|
+
});
|
|
870
|
+
var Divider = createDivider(({ inset, orientation }) => dividerTv({ inset, orientation }));
|
|
871
|
+
var linearTv = tv({
|
|
872
|
+
slots: {
|
|
873
|
+
root: "group relative block w-full h-1 overflow-hidden rounded-full",
|
|
874
|
+
track: "absolute inset-0 bg-surface-container-highest rounded-full",
|
|
875
|
+
indicator: [
|
|
876
|
+
"absolute inset-y-0 left-0 bg-primary rounded-full",
|
|
877
|
+
"transition-[width] duration-200 ease-standard",
|
|
878
|
+
"group-data-[indeterminate]:w-2/5 group-data-[indeterminate]:transition-none",
|
|
879
|
+
"group-data-[indeterminate]:animate-m3-linear-indeterminate"
|
|
880
|
+
]
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
var circularTv = tv({
|
|
884
|
+
slots: {
|
|
885
|
+
root: [
|
|
886
|
+
"inline-flex items-center justify-center size-12",
|
|
887
|
+
"[&_svg]:block [&_svg]:size-full",
|
|
888
|
+
"data-[indeterminate]:animate-spin"
|
|
889
|
+
],
|
|
890
|
+
track: "stroke-surface-container-highest [stroke-width:4px]",
|
|
891
|
+
indicator: [
|
|
892
|
+
"stroke-primary [stroke-width:4px] [stroke-linecap:round]",
|
|
893
|
+
"transition-[stroke-dashoffset] duration-300 ease-standard"
|
|
894
|
+
]
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
var l = linearTv();
|
|
898
|
+
var c2 = circularTv();
|
|
899
|
+
var Progress = createProgress({
|
|
900
|
+
linear: { root: l.root(), track: l.track(), indicator: l.indicator() },
|
|
901
|
+
circular: { root: c2.root(), track: c2.track(), indicator: c2.indicator() }
|
|
902
|
+
});
|
|
903
|
+
var listTv = tv7({
|
|
904
|
+
slots: {
|
|
905
|
+
root: "list-none m-0 px-0 py-2 bg-transparent",
|
|
906
|
+
item: [
|
|
907
|
+
"group relative flex w-full items-center gap-4 box-border px-4 text-left",
|
|
908
|
+
"bg-transparent border-0 text-on-surface no-underline"
|
|
909
|
+
],
|
|
910
|
+
leading: "flex items-center justify-center shrink-0 text-on-surface-variant [&_svg]:size-6",
|
|
911
|
+
content: "flex flex-col min-w-0 flex-1",
|
|
912
|
+
headline: "text-body-large text-on-surface group-data-[disabled]:text-on-surface/38",
|
|
913
|
+
supporting: "text-body-medium text-on-surface-variant group-data-[disabled]:text-on-surface/38",
|
|
914
|
+
trailing: [
|
|
915
|
+
"flex items-center shrink-0 text-label-small text-on-surface-variant [&_svg]:size-6",
|
|
916
|
+
"group-data-[disabled]:text-on-surface/38"
|
|
917
|
+
]
|
|
918
|
+
},
|
|
919
|
+
variants: {
|
|
920
|
+
lines: {
|
|
921
|
+
1: { item: "min-h-14 py-2" },
|
|
922
|
+
2: { item: "min-h-[72px] py-2" },
|
|
923
|
+
3: { item: "min-h-[88px] items-start py-3" }
|
|
924
|
+
},
|
|
925
|
+
interactive: {
|
|
926
|
+
true: {
|
|
927
|
+
item: [
|
|
928
|
+
"cursor-pointer select-none overflow-hidden outline-none",
|
|
929
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
930
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
931
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
932
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
933
|
+
"data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0",
|
|
934
|
+
"disabled:pointer-events-none disabled:before:opacity-0"
|
|
935
|
+
]
|
|
936
|
+
},
|
|
937
|
+
false: {}
|
|
938
|
+
}
|
|
939
|
+
},
|
|
940
|
+
defaultVariants: {
|
|
941
|
+
lines: 1,
|
|
942
|
+
interactive: false
|
|
943
|
+
}
|
|
944
|
+
});
|
|
945
|
+
var List = createList({
|
|
946
|
+
root: listTv().root(),
|
|
947
|
+
item: ({ lines, interactive }) => {
|
|
948
|
+
const c3 = listTv({ lines, interactive });
|
|
949
|
+
return {
|
|
950
|
+
item: c3.item(),
|
|
951
|
+
leading: c3.leading(),
|
|
952
|
+
content: c3.content(),
|
|
953
|
+
headline: c3.headline(),
|
|
954
|
+
supporting: c3.supporting(),
|
|
955
|
+
trailing: c3.trailing()
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
});
|
|
959
|
+
var snackbarTv = tv({
|
|
960
|
+
slots: {
|
|
961
|
+
viewport: [
|
|
962
|
+
"fixed bottom-4 left-1/2 -translate-x-1/2 z-50",
|
|
963
|
+
"flex flex-col gap-2 w-[min(560px,calc(100vw-32px))]"
|
|
964
|
+
],
|
|
965
|
+
root: [
|
|
966
|
+
"relative flex items-center gap-2 min-h-12 box-border pl-4 pr-2 py-2",
|
|
967
|
+
"rounded-extra-small bg-inverse-surface text-inverse-on-surface shadow-level3",
|
|
968
|
+
"text-body-medium",
|
|
969
|
+
"transition-[opacity,transform] duration-200 ease-emphasized",
|
|
970
|
+
"data-[starting-style]:opacity-0 data-[starting-style]:translate-y-2",
|
|
971
|
+
"data-[ending-style]:opacity-0"
|
|
972
|
+
],
|
|
973
|
+
content: "flex flex-col flex-1 min-w-0 gap-0.5",
|
|
974
|
+
title: "text-body-medium",
|
|
975
|
+
description: "text-body-small opacity-90",
|
|
976
|
+
action: [
|
|
977
|
+
"relative inline-flex items-center justify-center shrink-0 h-9 px-3 overflow-hidden",
|
|
978
|
+
"rounded-extra-small bg-transparent border-0 cursor-pointer outline-none",
|
|
979
|
+
"text-inverse-primary text-label-large",
|
|
980
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
981
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
982
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
983
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]"
|
|
984
|
+
],
|
|
985
|
+
close: [
|
|
986
|
+
"relative inline-flex items-center justify-center shrink-0 size-8 rounded-full overflow-hidden",
|
|
987
|
+
"bg-transparent border-0 cursor-pointer text-inverse-on-surface outline-none",
|
|
988
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
989
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
990
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
991
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
992
|
+
"data-[pressed]:before:opacity-[var(--md-sys-state-pressed)]"
|
|
993
|
+
]
|
|
994
|
+
}
|
|
995
|
+
});
|
|
996
|
+
var s5 = snackbarTv();
|
|
997
|
+
var Snackbar = createSnackbar({
|
|
998
|
+
viewport: s5.viewport(),
|
|
999
|
+
root: s5.root(),
|
|
1000
|
+
content: s5.content(),
|
|
1001
|
+
title: s5.title(),
|
|
1002
|
+
description: s5.description(),
|
|
1003
|
+
action: s5.action(),
|
|
1004
|
+
close: s5.close()
|
|
1005
|
+
});
|
|
1006
|
+
var itemTv = tv7({
|
|
1007
|
+
slots: {
|
|
1008
|
+
root: [
|
|
1009
|
+
"relative flex w-full items-center gap-4 box-border px-4 py-3 min-h-14 text-left",
|
|
1010
|
+
"bg-transparent text-on-surface"
|
|
1011
|
+
],
|
|
1012
|
+
leading: "flex items-center justify-center shrink-0 text-on-surface-variant [&_svg]:size-6",
|
|
1013
|
+
content: "flex flex-col min-w-0 flex-1",
|
|
1014
|
+
overline: "text-label-small text-on-surface-variant",
|
|
1015
|
+
headline: "text-body-large text-on-surface",
|
|
1016
|
+
supporting: "text-body-medium text-on-surface-variant",
|
|
1017
|
+
trailing: "flex items-center shrink-0 text-label-small text-on-surface-variant [&_svg]:size-6"
|
|
1018
|
+
}
|
|
1019
|
+
});
|
|
1020
|
+
var s6 = itemTv();
|
|
1021
|
+
var Item = createItem({
|
|
1022
|
+
root: s6.root(),
|
|
1023
|
+
leading: s6.leading(),
|
|
1024
|
+
content: s6.content(),
|
|
1025
|
+
overline: s6.overline(),
|
|
1026
|
+
headline: s6.headline(),
|
|
1027
|
+
supporting: s6.supporting(),
|
|
1028
|
+
trailing: s6.trailing()
|
|
1029
|
+
});
|
|
1030
|
+
var badgeTv = tv7({
|
|
1031
|
+
base: "pointer-events-none select-none inline-flex items-center justify-center bg-error text-on-error",
|
|
1032
|
+
variants: {
|
|
1033
|
+
size: {
|
|
1034
|
+
small: "absolute top-1 right-1 size-1.5 rounded-full",
|
|
1035
|
+
large: "absolute -top-1 -right-1 min-w-4 h-4 px-1 rounded-full text-label-small leading-none tabular-nums"
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
var Badge = createBadge({
|
|
1040
|
+
root: ({ size }) => badgeTv({ size })
|
|
1041
|
+
});
|
|
1042
|
+
var cardTv = tv7({
|
|
1043
|
+
base: "relative box-border rounded-medium text-on-surface",
|
|
1044
|
+
variants: {
|
|
1045
|
+
variant: {
|
|
1046
|
+
elevated: "bg-surface-container-low shadow-level1",
|
|
1047
|
+
filled: "bg-surface-container-highest",
|
|
1048
|
+
outlined: "bg-surface border border-outline-variant"
|
|
1049
|
+
},
|
|
1050
|
+
interactive: {
|
|
1051
|
+
true: [
|
|
1052
|
+
"group overflow-hidden cursor-pointer select-none text-left w-full outline-none",
|
|
1053
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
1054
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
1055
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
1056
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
1057
|
+
"focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary",
|
|
1058
|
+
// M3 disabled: drop the shadow + state layer, dim the content per-token.
|
|
1059
|
+
"disabled:pointer-events-none disabled:before:opacity-0 disabled:shadow-none disabled:text-on-surface/38",
|
|
1060
|
+
"data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0 data-[disabled]:shadow-none data-[disabled]:text-on-surface/38"
|
|
1061
|
+
],
|
|
1062
|
+
false: ""
|
|
1063
|
+
}
|
|
1064
|
+
},
|
|
1065
|
+
compoundVariants: [
|
|
1066
|
+
// M3 interactive elevated: lifts to level2 on hover, settles to level1 on press.
|
|
1067
|
+
{
|
|
1068
|
+
variant: "elevated",
|
|
1069
|
+
interactive: true,
|
|
1070
|
+
class: "hover:shadow-level2 active:shadow-level1"
|
|
1071
|
+
}
|
|
1072
|
+
],
|
|
1073
|
+
defaultVariants: {
|
|
1074
|
+
variant: "elevated",
|
|
1075
|
+
interactive: false
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
var Card = createCard({
|
|
1079
|
+
root: ({ variant, interactive }) => cardTv({ variant, interactive })
|
|
1080
|
+
});
|
|
1081
|
+
var segmentedButtonTv = tv7({
|
|
1082
|
+
slots: {
|
|
1083
|
+
root: "inline-flex items-stretch h-10 rounded-full border border-outline overflow-hidden",
|
|
1084
|
+
item: [
|
|
1085
|
+
"group relative inline-flex flex-1 items-center justify-center gap-2 px-3 min-w-12",
|
|
1086
|
+
"bg-transparent border-0 border-l border-outline first:border-l-0 cursor-pointer select-none outline-none",
|
|
1087
|
+
"text-label-large text-on-surface",
|
|
1088
|
+
"transition-colors duration-150 ease-standard",
|
|
1089
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
1090
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
1091
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
1092
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
1093
|
+
"data-[pressed]:bg-secondary-container data-[pressed]:text-on-secondary-container",
|
|
1094
|
+
"data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0 data-[disabled]:text-on-surface/38",
|
|
1095
|
+
"disabled:pointer-events-none disabled:before:opacity-0 disabled:text-on-surface/38"
|
|
1096
|
+
],
|
|
1097
|
+
check: [
|
|
1098
|
+
"inline-flex items-center justify-center shrink-0 h-[18px] w-0 opacity-0 overflow-hidden pointer-events-none",
|
|
1099
|
+
"transition-all duration-150 ease-standard",
|
|
1100
|
+
"group-data-[pressed]:w-[18px] group-data-[pressed]:opacity-100"
|
|
1101
|
+
],
|
|
1102
|
+
icon: "inline-flex items-center justify-center shrink-0 [&_svg]:size-[18px] group-data-[pressed]:hidden",
|
|
1103
|
+
label: "truncate"
|
|
1104
|
+
}
|
|
1105
|
+
});
|
|
1106
|
+
var s7 = segmentedButtonTv();
|
|
1107
|
+
var SegmentedButton = createSegmentedButton({
|
|
1108
|
+
root: s7.root(),
|
|
1109
|
+
item: s7.item(),
|
|
1110
|
+
check: s7.check(),
|
|
1111
|
+
icon: s7.icon(),
|
|
1112
|
+
label: s7.label()
|
|
1113
|
+
});
|
|
1114
|
+
var navigationDrawerTv = tv7({
|
|
1115
|
+
slots: {
|
|
1116
|
+
root: "flex flex-col gap-1 box-border w-[360px] p-3 bg-surface-container-low text-on-surface",
|
|
1117
|
+
headline: "px-4 pt-4 pb-1 text-title-small text-on-surface-variant",
|
|
1118
|
+
item: [
|
|
1119
|
+
"group relative flex w-full items-center gap-3 box-border h-14 px-4 rounded-full text-left",
|
|
1120
|
+
"bg-transparent border-0 text-on-surface-variant no-underline cursor-pointer select-none overflow-hidden outline-none",
|
|
1121
|
+
"text-label-large",
|
|
1122
|
+
"transition-colors duration-150 ease-standard",
|
|
1123
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
1124
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
1125
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
1126
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
1127
|
+
"data-[selected]:bg-secondary-container data-[selected]:text-on-secondary-container",
|
|
1128
|
+
"data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0 data-[disabled]:text-on-surface/38",
|
|
1129
|
+
"disabled:pointer-events-none disabled:before:opacity-0 disabled:text-on-surface/38"
|
|
1130
|
+
],
|
|
1131
|
+
leading: "flex items-center justify-center shrink-0 [&_svg]:size-6",
|
|
1132
|
+
label: "flex-1 min-w-0 truncate",
|
|
1133
|
+
trailing: "flex items-center shrink-0 text-label-small"
|
|
1134
|
+
},
|
|
1135
|
+
variants: {
|
|
1136
|
+
variant: {
|
|
1137
|
+
standard: {},
|
|
1138
|
+
modal: { root: "shadow-level1 rounded-e-large" }
|
|
1139
|
+
}
|
|
1140
|
+
},
|
|
1141
|
+
defaultVariants: {
|
|
1142
|
+
variant: "standard"
|
|
1143
|
+
}
|
|
1144
|
+
});
|
|
1145
|
+
var s8 = navigationDrawerTv();
|
|
1146
|
+
var NavigationDrawer = createNavigationDrawer({
|
|
1147
|
+
root: ({ variant }) => navigationDrawerTv({ variant }).root(),
|
|
1148
|
+
headline: s8.headline(),
|
|
1149
|
+
item: s8.item(),
|
|
1150
|
+
leading: s8.leading(),
|
|
1151
|
+
label: s8.label(),
|
|
1152
|
+
trailing: s8.trailing()
|
|
1153
|
+
});
|
|
1154
|
+
|
|
1155
|
+
export { Badge, Button, Card, Checkbox, Chip, Dialog, Divider, Fab, IconButton, Item, List, Menu, NavigationBar, NavigationDrawer, Progress, Radio, RadioGroup, SegmentedButton, Select, Slider, Snackbar, Switch, Tabs, TextField, Tooltip, badgeTv, button, cardTv, checkboxTv, chipTv, circularTv, dialogTv, dividerTv, fabTv, iconButton, itemTv, linearTv, listTv, menuTv, navigationBarTv, navigationDrawerTv, radioTv, segmentedButtonTv, selectTv, sliderTv, snackbarTv, switchTv, tabsTv, textFieldTv, tooltipTv };
|
|
1156
|
+
//# sourceMappingURL=index.js.map
|
|
1157
|
+
//# sourceMappingURL=index.js.map
|