m3-design-system 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +700 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +129 -0
- package/dist/index.d.ts +129 -0
- package/dist/index.js +628 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/tokens.css +83 -0
- package/package.json +67 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,700 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var clsx = require('clsx');
|
|
4
|
+
var tailwindMerge = require('tailwind-merge');
|
|
5
|
+
var React3 = require('react');
|
|
6
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
7
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
10
|
+
var lucideReact = require('lucide-react');
|
|
11
|
+
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
12
|
+
var ProgressPrimitive = require('@radix-ui/react-progress');
|
|
13
|
+
var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
|
14
|
+
var SliderPrimitive = require('@radix-ui/react-slider');
|
|
15
|
+
var SwitchPrimitives = require('@radix-ui/react-switch');
|
|
16
|
+
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
17
|
+
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
18
|
+
|
|
19
|
+
function _interopNamespace(e) {
|
|
20
|
+
if (e && e.__esModule) return e;
|
|
21
|
+
var n = Object.create(null);
|
|
22
|
+
if (e) {
|
|
23
|
+
Object.keys(e).forEach(function (k) {
|
|
24
|
+
if (k !== 'default') {
|
|
25
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
26
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return e[k]; }
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
n.default = e;
|
|
34
|
+
return Object.freeze(n);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
|
|
38
|
+
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
39
|
+
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
40
|
+
var ProgressPrimitive__namespace = /*#__PURE__*/_interopNamespace(ProgressPrimitive);
|
|
41
|
+
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
42
|
+
var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive);
|
|
43
|
+
var SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitives);
|
|
44
|
+
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
45
|
+
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
|
|
46
|
+
|
|
47
|
+
// src/lib/utils.ts
|
|
48
|
+
function cn(...inputs) {
|
|
49
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
50
|
+
}
|
|
51
|
+
var buttonVariants = classVarianceAuthority.cva(
|
|
52
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-all duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-m3-primary disabled:pointer-events-none disabled:opacity-38 [&_svg]:pointer-events-none [&_svg]:size-[18px] [&_svg]:shrink-0 select-none",
|
|
53
|
+
{
|
|
54
|
+
variants: {
|
|
55
|
+
variant: {
|
|
56
|
+
filled: "bg-m3-primary text-m3-on-primary hover:shadow-m3-1 active:shadow-none rounded-m3-full",
|
|
57
|
+
outlined: "border border-m3-outline text-m3-primary hover:bg-m3-primary/8 active:bg-m3-primary/12 rounded-m3-full",
|
|
58
|
+
text: "text-m3-primary hover:bg-m3-primary/8 active:bg-m3-primary/12 rounded-m3-full",
|
|
59
|
+
elevated: "bg-m3-surface-container-low text-m3-primary shadow-m3-1 hover:shadow-m3-2 active:shadow-m3-1 rounded-m3-full",
|
|
60
|
+
tonal: "bg-m3-secondary-container text-m3-on-secondary-container hover:shadow-m3-1 active:shadow-none rounded-m3-full"
|
|
61
|
+
},
|
|
62
|
+
size: {
|
|
63
|
+
sm: "h-8 px-3 text-xs",
|
|
64
|
+
md: "h-10 px-6 text-sm",
|
|
65
|
+
lg: "h-12 px-8 text-base",
|
|
66
|
+
icon: "h-10 w-10 p-0"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
defaultVariants: {
|
|
70
|
+
variant: "filled",
|
|
71
|
+
size: "md"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
var Button = React3__namespace.forwardRef(
|
|
76
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
77
|
+
const Comp = asChild ? reactSlot.Slot : "button";
|
|
78
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
+
Comp,
|
|
80
|
+
{
|
|
81
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
82
|
+
ref,
|
|
83
|
+
...props
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
Button.displayName = "Button";
|
|
89
|
+
var badgeVariants = classVarianceAuthority.cva(
|
|
90
|
+
"inline-flex items-center justify-center font-medium",
|
|
91
|
+
{
|
|
92
|
+
variants: {
|
|
93
|
+
variant: {
|
|
94
|
+
small: "size-[6px] rounded-full bg-m3-error",
|
|
95
|
+
large: "min-w-4 h-4 px-1 rounded-full bg-m3-error text-m3-on-error text-[11px]"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
defaultVariants: {
|
|
99
|
+
variant: "large"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
var Badge = React3__namespace.forwardRef(
|
|
104
|
+
({ className, variant, count, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
105
|
+
"span",
|
|
106
|
+
{
|
|
107
|
+
ref,
|
|
108
|
+
className: cn(badgeVariants({ variant, className })),
|
|
109
|
+
"aria-label": count !== void 0 ? `${count} notifications` : "notification",
|
|
110
|
+
...props,
|
|
111
|
+
children: variant === "large" && count !== void 0 && (count > 999 ? "999+" : count)
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
);
|
|
115
|
+
Badge.displayName = "Badge";
|
|
116
|
+
var cardVariants = classVarianceAuthority.cva(
|
|
117
|
+
"rounded-m3-md overflow-hidden transition-shadow duration-200",
|
|
118
|
+
{
|
|
119
|
+
variants: {
|
|
120
|
+
variant: {
|
|
121
|
+
elevated: "bg-m3-surface-container-low shadow-m3-1 hover:shadow-m3-2",
|
|
122
|
+
filled: "bg-m3-surface-container-highest",
|
|
123
|
+
outlined: "bg-m3-surface border border-m3-outline-variant"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
defaultVariants: {
|
|
127
|
+
variant: "elevated"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
var Card = React3__namespace.forwardRef(
|
|
132
|
+
({ className, variant, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
ref,
|
|
136
|
+
className: cn(cardVariants({ variant, className })),
|
|
137
|
+
...props
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
);
|
|
141
|
+
Card.displayName = "Card";
|
|
142
|
+
var CardHeader = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("p-4 pb-0", className), ...props }));
|
|
143
|
+
CardHeader.displayName = "CardHeader";
|
|
144
|
+
var CardTitle = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
145
|
+
"h3",
|
|
146
|
+
{
|
|
147
|
+
ref,
|
|
148
|
+
className: cn("text-lg font-medium text-m3-on-surface", className),
|
|
149
|
+
...props
|
|
150
|
+
}
|
|
151
|
+
));
|
|
152
|
+
CardTitle.displayName = "CardTitle";
|
|
153
|
+
var CardDescription = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
154
|
+
"p",
|
|
155
|
+
{
|
|
156
|
+
ref,
|
|
157
|
+
className: cn("text-sm text-m3-on-surface-variant mt-1", className),
|
|
158
|
+
...props
|
|
159
|
+
}
|
|
160
|
+
));
|
|
161
|
+
CardDescription.displayName = "CardDescription";
|
|
162
|
+
var CardContent = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("p-4", className), ...props }));
|
|
163
|
+
CardContent.displayName = "CardContent";
|
|
164
|
+
var CardFooter = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
165
|
+
"div",
|
|
166
|
+
{
|
|
167
|
+
ref,
|
|
168
|
+
className: cn("flex items-center gap-2 p-4 pt-0", className),
|
|
169
|
+
...props
|
|
170
|
+
}
|
|
171
|
+
));
|
|
172
|
+
CardFooter.displayName = "CardFooter";
|
|
173
|
+
var Checkbox = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
174
|
+
CheckboxPrimitive__namespace.Root,
|
|
175
|
+
{
|
|
176
|
+
ref,
|
|
177
|
+
className: cn(
|
|
178
|
+
"peer h-[18px] w-[18px] shrink-0 rounded-[2px] border-2 border-m3-on-surface-variant transition-all duration-200",
|
|
179
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-m3-primary",
|
|
180
|
+
"disabled:cursor-not-allowed disabled:opacity-38",
|
|
181
|
+
"data-[state=checked]:bg-m3-primary data-[state=checked]:border-m3-primary data-[state=checked]:text-m3-on-primary",
|
|
182
|
+
"data-[state=indeterminate]:bg-m3-primary data-[state=indeterminate]:border-m3-primary data-[state=indeterminate]:text-m3-on-primary",
|
|
183
|
+
className
|
|
184
|
+
),
|
|
185
|
+
...props,
|
|
186
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxPrimitive__namespace.Indicator, { className: "flex items-center justify-center", children: props.checked === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { className: "size-3.5 stroke-[3]" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3.5 stroke-[3]" }) })
|
|
187
|
+
}
|
|
188
|
+
));
|
|
189
|
+
Checkbox.displayName = "Checkbox";
|
|
190
|
+
var chipVariants = classVarianceAuthority.cva(
|
|
191
|
+
"inline-flex items-center gap-2 rounded-m3-sm font-medium transition-all duration-200 select-none [&_svg]:size-[18px] [&_svg]:shrink-0",
|
|
192
|
+
{
|
|
193
|
+
variants: {
|
|
194
|
+
variant: {
|
|
195
|
+
assist: "border border-m3-outline text-m3-on-surface hover:bg-m3-on-surface/8 h-8 px-4 text-sm",
|
|
196
|
+
filter: "border border-m3-outline text-m3-on-surface-variant hover:bg-m3-on-surface/8 h-8 px-4 text-sm data-[selected=true]:bg-m3-secondary-container data-[selected=true]:text-m3-on-secondary-container data-[selected=true]:border-transparent",
|
|
197
|
+
input: "border border-m3-outline text-m3-on-surface-variant hover:bg-m3-on-surface/8 h-8 pl-4 pr-2 text-sm",
|
|
198
|
+
suggestion: "border border-m3-outline text-m3-on-surface-variant hover:bg-m3-on-surface/8 h-8 px-4 text-sm"
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
defaultVariants: {
|
|
202
|
+
variant: "assist"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
var Chip = React3__namespace.forwardRef(
|
|
207
|
+
({ className, variant, selected, onRemove, icon, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
208
|
+
"div",
|
|
209
|
+
{
|
|
210
|
+
ref,
|
|
211
|
+
role: variant === "filter" ? "option" : void 0,
|
|
212
|
+
"aria-selected": variant === "filter" ? selected : void 0,
|
|
213
|
+
"data-selected": selected,
|
|
214
|
+
className: cn(chipVariants({ variant, className })),
|
|
215
|
+
...props,
|
|
216
|
+
children: [
|
|
217
|
+
icon,
|
|
218
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children }),
|
|
219
|
+
(variant === "input" || onRemove) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
220
|
+
"button",
|
|
221
|
+
{
|
|
222
|
+
onClick: onRemove,
|
|
223
|
+
className: "rounded-full p-0.5 hover:bg-m3-on-surface/12 transition-colors",
|
|
224
|
+
"aria-label": "Remove",
|
|
225
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "!size-4" })
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
)
|
|
231
|
+
);
|
|
232
|
+
Chip.displayName = "Chip";
|
|
233
|
+
var Dialog = DialogPrimitive__namespace.Root;
|
|
234
|
+
var DialogTrigger = DialogPrimitive__namespace.Trigger;
|
|
235
|
+
var DialogPortal = DialogPrimitive__namespace.Portal;
|
|
236
|
+
var DialogClose = DialogPrimitive__namespace.Close;
|
|
237
|
+
var DialogOverlay = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
238
|
+
DialogPrimitive__namespace.Overlay,
|
|
239
|
+
{
|
|
240
|
+
ref,
|
|
241
|
+
className: cn(
|
|
242
|
+
"fixed inset-0 z-50 bg-m3-scrim/32 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
243
|
+
className
|
|
244
|
+
),
|
|
245
|
+
...props
|
|
246
|
+
}
|
|
247
|
+
));
|
|
248
|
+
DialogOverlay.displayName = "DialogOverlay";
|
|
249
|
+
var DialogContent = React3__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
250
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
251
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
252
|
+
DialogPrimitive__namespace.Content,
|
|
253
|
+
{
|
|
254
|
+
ref,
|
|
255
|
+
className: cn(
|
|
256
|
+
"fixed left-1/2 top-1/2 z-50 w-full max-w-[560px] -translate-x-1/2 -translate-y-1/2",
|
|
257
|
+
"bg-m3-surface-container-high rounded-m3-xl p-6 shadow-m3-3",
|
|
258
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
259
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
260
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
261
|
+
className
|
|
262
|
+
),
|
|
263
|
+
...props,
|
|
264
|
+
children: [
|
|
265
|
+
children,
|
|
266
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Close, { className: "absolute right-4 top-4 rounded-full p-1 text-m3-on-surface-variant hover:bg-m3-on-surface/8 transition-colors", children: [
|
|
267
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-5" }),
|
|
268
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
269
|
+
] })
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
] }));
|
|
274
|
+
DialogContent.displayName = "DialogContent";
|
|
275
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col gap-1.5 mb-4", className), ...props });
|
|
276
|
+
DialogHeader.displayName = "DialogHeader";
|
|
277
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex justify-end gap-2 mt-6", className), ...props });
|
|
278
|
+
DialogFooter.displayName = "DialogFooter";
|
|
279
|
+
var DialogTitle = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
280
|
+
DialogPrimitive__namespace.Title,
|
|
281
|
+
{
|
|
282
|
+
ref,
|
|
283
|
+
className: cn("text-2xl font-normal text-m3-on-surface", className),
|
|
284
|
+
...props
|
|
285
|
+
}
|
|
286
|
+
));
|
|
287
|
+
DialogTitle.displayName = "DialogTitle";
|
|
288
|
+
var DialogDescription = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
289
|
+
DialogPrimitive__namespace.Description,
|
|
290
|
+
{
|
|
291
|
+
ref,
|
|
292
|
+
className: cn("text-sm text-m3-on-surface-variant", className),
|
|
293
|
+
...props
|
|
294
|
+
}
|
|
295
|
+
));
|
|
296
|
+
DialogDescription.displayName = "DialogDescription";
|
|
297
|
+
var fabVariants = classVarianceAuthority.cva(
|
|
298
|
+
"inline-flex items-center justify-center gap-3 transition-all duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-m3-primary shadow-m3-3 hover:shadow-m3-4 active:shadow-m3-3 select-none [&_svg]:shrink-0",
|
|
299
|
+
{
|
|
300
|
+
variants: {
|
|
301
|
+
variant: {
|
|
302
|
+
surface: "bg-m3-surface-container-high text-m3-primary",
|
|
303
|
+
primary: "bg-m3-primary-container text-m3-on-primary-container",
|
|
304
|
+
secondary: "bg-m3-secondary-container text-m3-on-secondary-container",
|
|
305
|
+
tertiary: "bg-m3-tertiary-container text-m3-on-tertiary-container"
|
|
306
|
+
},
|
|
307
|
+
size: {
|
|
308
|
+
sm: "h-10 w-10 rounded-m3-md [&_svg]:size-5",
|
|
309
|
+
md: "h-14 w-14 rounded-m3-lg [&_svg]:size-6",
|
|
310
|
+
lg: "h-24 w-24 rounded-m3-xl [&_svg]:size-9",
|
|
311
|
+
extended: "h-14 px-4 rounded-m3-lg [&_svg]:size-6 font-medium text-base"
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
defaultVariants: {
|
|
315
|
+
variant: "primary",
|
|
316
|
+
size: "md"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
);
|
|
320
|
+
var FAB = React3__namespace.forwardRef(
|
|
321
|
+
({ className, variant, size, icon, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
322
|
+
"button",
|
|
323
|
+
{
|
|
324
|
+
ref,
|
|
325
|
+
className: cn(fabVariants({ variant, size, className })),
|
|
326
|
+
...props,
|
|
327
|
+
children: [
|
|
328
|
+
icon,
|
|
329
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("span", { children })
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
)
|
|
333
|
+
);
|
|
334
|
+
FAB.displayName = "FAB";
|
|
335
|
+
var Progress = React3__namespace.forwardRef(({ className, value, variant = "linear", indeterminate = false, ...props }, ref) => {
|
|
336
|
+
if (variant === "circular") {
|
|
337
|
+
const size = 48;
|
|
338
|
+
const strokeWidth = 4;
|
|
339
|
+
const radius = (size - strokeWidth) / 2;
|
|
340
|
+
const circumference = radius * 2 * Math.PI;
|
|
341
|
+
const offset = circumference - (value ?? 0) / 100 * circumference;
|
|
342
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
343
|
+
"div",
|
|
344
|
+
{
|
|
345
|
+
role: "progressbar",
|
|
346
|
+
"aria-valuenow": indeterminate ? void 0 : value ?? 0,
|
|
347
|
+
"aria-valuemin": 0,
|
|
348
|
+
"aria-valuemax": 100,
|
|
349
|
+
className: cn("inline-flex", indeterminate && "animate-spin", className),
|
|
350
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: [
|
|
351
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
352
|
+
"circle",
|
|
353
|
+
{
|
|
354
|
+
cx: size / 2,
|
|
355
|
+
cy: size / 2,
|
|
356
|
+
r: radius,
|
|
357
|
+
fill: "none",
|
|
358
|
+
stroke: "currentColor",
|
|
359
|
+
strokeWidth,
|
|
360
|
+
className: "text-m3-surface-container-highest"
|
|
361
|
+
}
|
|
362
|
+
),
|
|
363
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
364
|
+
"circle",
|
|
365
|
+
{
|
|
366
|
+
cx: size / 2,
|
|
367
|
+
cy: size / 2,
|
|
368
|
+
r: radius,
|
|
369
|
+
fill: "none",
|
|
370
|
+
stroke: "currentColor",
|
|
371
|
+
strokeWidth,
|
|
372
|
+
strokeDasharray: circumference,
|
|
373
|
+
strokeDashoffset: indeterminate ? circumference * 0.75 : offset,
|
|
374
|
+
strokeLinecap: "round",
|
|
375
|
+
className: "text-m3-primary transition-all duration-300",
|
|
376
|
+
transform: `rotate(-90 ${size / 2} ${size / 2})`
|
|
377
|
+
}
|
|
378
|
+
)
|
|
379
|
+
] })
|
|
380
|
+
}
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
384
|
+
ProgressPrimitive__namespace.Root,
|
|
385
|
+
{
|
|
386
|
+
ref,
|
|
387
|
+
className: cn("relative h-1 w-full overflow-hidden rounded-full bg-m3-surface-container-highest", className),
|
|
388
|
+
...props,
|
|
389
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
390
|
+
ProgressPrimitive__namespace.Indicator,
|
|
391
|
+
{
|
|
392
|
+
className: cn(
|
|
393
|
+
"h-full bg-m3-primary rounded-full transition-all duration-300",
|
|
394
|
+
indeterminate && "animate-[indeterminate_1.5s_ease-in-out_infinite] w-1/3"
|
|
395
|
+
),
|
|
396
|
+
style: indeterminate ? void 0 : { width: `${value ?? 0}%` }
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
}
|
|
400
|
+
);
|
|
401
|
+
});
|
|
402
|
+
Progress.displayName = "Progress";
|
|
403
|
+
var RadioGroup = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
404
|
+
RadioGroupPrimitive__namespace.Root,
|
|
405
|
+
{
|
|
406
|
+
className: cn("grid gap-3", className),
|
|
407
|
+
...props,
|
|
408
|
+
ref
|
|
409
|
+
}
|
|
410
|
+
));
|
|
411
|
+
RadioGroup.displayName = "RadioGroup";
|
|
412
|
+
var RadioGroupItem = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
413
|
+
RadioGroupPrimitive__namespace.Item,
|
|
414
|
+
{
|
|
415
|
+
ref,
|
|
416
|
+
className: cn(
|
|
417
|
+
"aspect-square h-5 w-5 rounded-full border-2 border-m3-on-surface-variant transition-all duration-200",
|
|
418
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-m3-primary",
|
|
419
|
+
"disabled:cursor-not-allowed disabled:opacity-38",
|
|
420
|
+
"data-[state=checked]:border-m3-primary",
|
|
421
|
+
className
|
|
422
|
+
),
|
|
423
|
+
...props,
|
|
424
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-[10px] rounded-full bg-m3-primary" }) })
|
|
425
|
+
}
|
|
426
|
+
));
|
|
427
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
428
|
+
var Slider = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
429
|
+
SliderPrimitive__namespace.Root,
|
|
430
|
+
{
|
|
431
|
+
ref,
|
|
432
|
+
className: cn(
|
|
433
|
+
"relative flex w-full touch-none select-none items-center",
|
|
434
|
+
className
|
|
435
|
+
),
|
|
436
|
+
...props,
|
|
437
|
+
children: [
|
|
438
|
+
/* @__PURE__ */ jsxRuntime.jsx(SliderPrimitive__namespace.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-full bg-m3-surface-container-highest", children: /* @__PURE__ */ jsxRuntime.jsx(SliderPrimitive__namespace.Range, { className: "absolute h-full bg-m3-primary" }) }),
|
|
439
|
+
/* @__PURE__ */ jsxRuntime.jsx(SliderPrimitive__namespace.Thumb, { className: "block size-5 rounded-full bg-m3-primary shadow-m3-1 transition-all hover:shadow-m3-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-m3-primary disabled:pointer-events-none disabled:opacity-38 cursor-pointer" })
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
));
|
|
443
|
+
Slider.displayName = "Slider";
|
|
444
|
+
var Snackbar = React3__namespace.forwardRef(
|
|
445
|
+
({ className, message, action, onAction, onDismiss, open = true, ...props }, ref) => {
|
|
446
|
+
if (!open) return null;
|
|
447
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
448
|
+
"div",
|
|
449
|
+
{
|
|
450
|
+
ref,
|
|
451
|
+
role: "status",
|
|
452
|
+
"aria-live": "polite",
|
|
453
|
+
className: cn(
|
|
454
|
+
"flex items-center gap-2 min-w-[288px] max-w-[560px] bg-m3-inverse-surface text-m3-inverse-on-surface rounded-m3-xs px-4 py-3 shadow-m3-3",
|
|
455
|
+
className
|
|
456
|
+
),
|
|
457
|
+
...props,
|
|
458
|
+
children: [
|
|
459
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-sm", children: message }),
|
|
460
|
+
action && /* @__PURE__ */ jsxRuntime.jsx(
|
|
461
|
+
"button",
|
|
462
|
+
{
|
|
463
|
+
onClick: onAction,
|
|
464
|
+
className: "text-m3-inverse-primary text-sm font-medium hover:opacity-80 transition-opacity px-2",
|
|
465
|
+
children: action
|
|
466
|
+
}
|
|
467
|
+
),
|
|
468
|
+
onDismiss && /* @__PURE__ */ jsxRuntime.jsx(
|
|
469
|
+
"button",
|
|
470
|
+
{
|
|
471
|
+
onClick: onDismiss,
|
|
472
|
+
className: "text-m3-inverse-on-surface hover:opacity-80 transition-opacity p-0.5",
|
|
473
|
+
"aria-label": "Dismiss",
|
|
474
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-5" })
|
|
475
|
+
}
|
|
476
|
+
)
|
|
477
|
+
]
|
|
478
|
+
}
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
);
|
|
482
|
+
Snackbar.displayName = "Snackbar";
|
|
483
|
+
var Switch = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
484
|
+
SwitchPrimitives__namespace.Root,
|
|
485
|
+
{
|
|
486
|
+
className: cn(
|
|
487
|
+
"peer inline-flex h-8 w-[52px] shrink-0 cursor-pointer items-center rounded-m3-full border-2 border-m3-outline transition-colors duration-200",
|
|
488
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-m3-primary",
|
|
489
|
+
"disabled:cursor-not-allowed disabled:opacity-38",
|
|
490
|
+
"data-[state=checked]:bg-m3-primary data-[state=checked]:border-m3-primary",
|
|
491
|
+
"data-[state=unchecked]:bg-m3-surface-container-highest",
|
|
492
|
+
className
|
|
493
|
+
),
|
|
494
|
+
...props,
|
|
495
|
+
ref,
|
|
496
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
497
|
+
SwitchPrimitives__namespace.Thumb,
|
|
498
|
+
{
|
|
499
|
+
className: cn(
|
|
500
|
+
"pointer-events-none block rounded-full transition-all duration-200",
|
|
501
|
+
"data-[state=checked]:translate-x-[22px] data-[state=checked]:bg-m3-on-primary data-[state=checked]:size-6",
|
|
502
|
+
"data-[state=unchecked]:translate-x-[2px] data-[state=unchecked]:bg-m3-outline data-[state=unchecked]:size-4"
|
|
503
|
+
)
|
|
504
|
+
}
|
|
505
|
+
)
|
|
506
|
+
}
|
|
507
|
+
));
|
|
508
|
+
Switch.displayName = "Switch";
|
|
509
|
+
var Tabs = TabsPrimitive__namespace.Root;
|
|
510
|
+
var TabsList = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
511
|
+
TabsPrimitive__namespace.List,
|
|
512
|
+
{
|
|
513
|
+
ref,
|
|
514
|
+
className: cn(
|
|
515
|
+
"flex items-center border-b border-m3-surface-container-highest bg-m3-surface",
|
|
516
|
+
className
|
|
517
|
+
),
|
|
518
|
+
...props
|
|
519
|
+
}
|
|
520
|
+
));
|
|
521
|
+
TabsList.displayName = "TabsList";
|
|
522
|
+
var TabsTrigger = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
523
|
+
TabsPrimitive__namespace.Trigger,
|
|
524
|
+
{
|
|
525
|
+
ref,
|
|
526
|
+
className: cn(
|
|
527
|
+
"inline-flex items-center justify-center gap-2 px-6 py-3.5 text-sm font-medium transition-all duration-200",
|
|
528
|
+
"text-m3-on-surface-variant hover:bg-m3-on-surface/8",
|
|
529
|
+
"focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-m3-primary",
|
|
530
|
+
"disabled:pointer-events-none disabled:opacity-38",
|
|
531
|
+
"data-[state=active]:text-m3-primary data-[state=active]:border-b-[3px] data-[state=active]:border-m3-primary data-[state=active]:-mb-px",
|
|
532
|
+
className
|
|
533
|
+
),
|
|
534
|
+
...props
|
|
535
|
+
}
|
|
536
|
+
));
|
|
537
|
+
TabsTrigger.displayName = "TabsTrigger";
|
|
538
|
+
var TabsContent = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
539
|
+
TabsPrimitive__namespace.Content,
|
|
540
|
+
{
|
|
541
|
+
ref,
|
|
542
|
+
className: cn("mt-4 focus-visible:outline-none", className),
|
|
543
|
+
...props
|
|
544
|
+
}
|
|
545
|
+
));
|
|
546
|
+
TabsContent.displayName = "TabsContent";
|
|
547
|
+
var textFieldVariants = classVarianceAuthority.cva(
|
|
548
|
+
"relative w-full",
|
|
549
|
+
{
|
|
550
|
+
variants: {
|
|
551
|
+
variant: {
|
|
552
|
+
filled: "",
|
|
553
|
+
outlined: ""
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
defaultVariants: {
|
|
557
|
+
variant: "filled"
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
);
|
|
561
|
+
var TextField = React3__namespace.forwardRef(
|
|
562
|
+
({
|
|
563
|
+
className,
|
|
564
|
+
variant,
|
|
565
|
+
label,
|
|
566
|
+
supportingText,
|
|
567
|
+
error,
|
|
568
|
+
errorText,
|
|
569
|
+
leadingIcon,
|
|
570
|
+
trailingIcon,
|
|
571
|
+
...props
|
|
572
|
+
}, ref) => {
|
|
573
|
+
const inputId = React3__namespace.useId();
|
|
574
|
+
const supportId = React3__namespace.useId();
|
|
575
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(textFieldVariants({ variant }), className), children: [
|
|
576
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
577
|
+
"div",
|
|
578
|
+
{
|
|
579
|
+
className: cn(
|
|
580
|
+
"relative flex items-center",
|
|
581
|
+
variant === "filled" && "bg-m3-surface-container-highest rounded-t-m3-xs border-b-2 border-m3-on-surface-variant focus-within:border-m3-primary",
|
|
582
|
+
variant === "outlined" && "border border-m3-outline rounded-m3-xs focus-within:border-2 focus-within:border-m3-primary",
|
|
583
|
+
error && "border-m3-error focus-within:border-m3-error"
|
|
584
|
+
),
|
|
585
|
+
children: [
|
|
586
|
+
leadingIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pl-3 text-m3-on-surface-variant [&_svg]:size-5", children: leadingIcon }),
|
|
587
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 min-w-0", children: [
|
|
588
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
589
|
+
"input",
|
|
590
|
+
{
|
|
591
|
+
ref,
|
|
592
|
+
id: inputId,
|
|
593
|
+
"aria-describedby": supportingText || errorText ? supportId : void 0,
|
|
594
|
+
"aria-invalid": error,
|
|
595
|
+
className: cn(
|
|
596
|
+
"peer w-full bg-transparent outline-none text-m3-on-surface text-base h-14 px-4 pt-4 pb-1 placeholder-transparent",
|
|
597
|
+
leadingIcon && "pl-2",
|
|
598
|
+
trailingIcon && "pr-2"
|
|
599
|
+
),
|
|
600
|
+
placeholder: label,
|
|
601
|
+
...props
|
|
602
|
+
}
|
|
603
|
+
),
|
|
604
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
605
|
+
"label",
|
|
606
|
+
{
|
|
607
|
+
htmlFor: inputId,
|
|
608
|
+
className: cn(
|
|
609
|
+
"absolute left-4 top-1/2 -translate-y-1/2 text-m3-on-surface-variant text-base transition-all duration-200 pointer-events-none",
|
|
610
|
+
"peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-xs peer-focus:text-m3-primary",
|
|
611
|
+
"peer-[:not(:placeholder-shown)]:top-2 peer-[:not(:placeholder-shown)]:translate-y-0 peer-[:not(:placeholder-shown)]:text-xs",
|
|
612
|
+
leadingIcon && "left-2",
|
|
613
|
+
error && "peer-focus:text-m3-error"
|
|
614
|
+
),
|
|
615
|
+
children: label
|
|
616
|
+
}
|
|
617
|
+
)
|
|
618
|
+
] }),
|
|
619
|
+
trailingIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pr-3 text-m3-on-surface-variant [&_svg]:size-5", children: trailingIcon })
|
|
620
|
+
]
|
|
621
|
+
}
|
|
622
|
+
),
|
|
623
|
+
(supportingText || errorText) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
624
|
+
"p",
|
|
625
|
+
{
|
|
626
|
+
id: supportId,
|
|
627
|
+
className: cn(
|
|
628
|
+
"text-xs mt-1 px-4",
|
|
629
|
+
error ? "text-m3-error" : "text-m3-on-surface-variant"
|
|
630
|
+
),
|
|
631
|
+
children: error ? errorText : supportingText
|
|
632
|
+
}
|
|
633
|
+
)
|
|
634
|
+
] });
|
|
635
|
+
}
|
|
636
|
+
);
|
|
637
|
+
TextField.displayName = "TextField";
|
|
638
|
+
var TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
639
|
+
var Tooltip = TooltipPrimitive__namespace.Root;
|
|
640
|
+
var TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
641
|
+
var TooltipContent = React3__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
642
|
+
TooltipPrimitive__namespace.Content,
|
|
643
|
+
{
|
|
644
|
+
ref,
|
|
645
|
+
sideOffset,
|
|
646
|
+
className: cn(
|
|
647
|
+
"z-50 overflow-hidden rounded-m3-xs bg-m3-inverse-surface px-2 py-1.5 text-xs text-m3-inverse-on-surface",
|
|
648
|
+
"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
649
|
+
className
|
|
650
|
+
),
|
|
651
|
+
...props
|
|
652
|
+
}
|
|
653
|
+
));
|
|
654
|
+
TooltipContent.displayName = "TooltipContent";
|
|
655
|
+
|
|
656
|
+
exports.Badge = Badge;
|
|
657
|
+
exports.Button = Button;
|
|
658
|
+
exports.Card = Card;
|
|
659
|
+
exports.CardContent = CardContent;
|
|
660
|
+
exports.CardDescription = CardDescription;
|
|
661
|
+
exports.CardFooter = CardFooter;
|
|
662
|
+
exports.CardHeader = CardHeader;
|
|
663
|
+
exports.CardTitle = CardTitle;
|
|
664
|
+
exports.Checkbox = Checkbox;
|
|
665
|
+
exports.Chip = Chip;
|
|
666
|
+
exports.Dialog = Dialog;
|
|
667
|
+
exports.DialogClose = DialogClose;
|
|
668
|
+
exports.DialogContent = DialogContent;
|
|
669
|
+
exports.DialogDescription = DialogDescription;
|
|
670
|
+
exports.DialogFooter = DialogFooter;
|
|
671
|
+
exports.DialogHeader = DialogHeader;
|
|
672
|
+
exports.DialogOverlay = DialogOverlay;
|
|
673
|
+
exports.DialogPortal = DialogPortal;
|
|
674
|
+
exports.DialogTitle = DialogTitle;
|
|
675
|
+
exports.DialogTrigger = DialogTrigger;
|
|
676
|
+
exports.FAB = FAB;
|
|
677
|
+
exports.Progress = Progress;
|
|
678
|
+
exports.RadioGroup = RadioGroup;
|
|
679
|
+
exports.RadioGroupItem = RadioGroupItem;
|
|
680
|
+
exports.Slider = Slider;
|
|
681
|
+
exports.Snackbar = Snackbar;
|
|
682
|
+
exports.Switch = Switch;
|
|
683
|
+
exports.Tabs = Tabs;
|
|
684
|
+
exports.TabsContent = TabsContent;
|
|
685
|
+
exports.TabsList = TabsList;
|
|
686
|
+
exports.TabsTrigger = TabsTrigger;
|
|
687
|
+
exports.TextField = TextField;
|
|
688
|
+
exports.Tooltip = Tooltip;
|
|
689
|
+
exports.TooltipContent = TooltipContent;
|
|
690
|
+
exports.TooltipProvider = TooltipProvider;
|
|
691
|
+
exports.TooltipTrigger = TooltipTrigger;
|
|
692
|
+
exports.badgeVariants = badgeVariants;
|
|
693
|
+
exports.buttonVariants = buttonVariants;
|
|
694
|
+
exports.cardVariants = cardVariants;
|
|
695
|
+
exports.chipVariants = chipVariants;
|
|
696
|
+
exports.cn = cn;
|
|
697
|
+
exports.fabVariants = fabVariants;
|
|
698
|
+
exports.textFieldVariants = textFieldVariants;
|
|
699
|
+
//# sourceMappingURL=index.cjs.map
|
|
700
|
+
//# sourceMappingURL=index.cjs.map
|