@tinybigui/react 0.14.0 → 0.16.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/README.md +18 -18
- package/dist/index.cjs +775 -204
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +9 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +130 -38
- package/dist/index.d.ts +130 -38
- package/dist/index.js +775 -204
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5159,9 +5159,6 @@ var DrawerItem = forwardRef(
|
|
|
5159
5159
|
DrawerItem.displayName = "DrawerItem";
|
|
5160
5160
|
var progressContainerVariants = cva(["inline-flex", "flex-col", "gap-1"], {
|
|
5161
5161
|
variants: {
|
|
5162
|
-
/**
|
|
5163
|
-
* The visual type of the indicator.
|
|
5164
|
-
*/
|
|
5165
5162
|
type: {
|
|
5166
5163
|
linear: "w-full",
|
|
5167
5164
|
circular: "items-center justify-center w-auto"
|
|
@@ -5171,41 +5168,60 @@ var progressContainerVariants = cva(["inline-flex", "flex-col", "gap-1"], {
|
|
|
5171
5168
|
type: "linear"
|
|
5172
5169
|
}
|
|
5173
5170
|
});
|
|
5174
|
-
var
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5171
|
+
var progressLabelVariants = cva(["text-body-small", "text-on-surface", "select-none"]);
|
|
5172
|
+
var progressTrackVariants = cva(
|
|
5173
|
+
[
|
|
5174
|
+
"relative",
|
|
5175
|
+
"w-full",
|
|
5176
|
+
"overflow-visible",
|
|
5177
|
+
// gap segments extend beyond clipping bounds
|
|
5178
|
+
"rounded-full"
|
|
5179
|
+
],
|
|
5180
|
+
{
|
|
5181
|
+
variants: {
|
|
5182
|
+
thickness: {
|
|
5183
|
+
default: "h-1",
|
|
5184
|
+
thick: "h-2"
|
|
5185
|
+
}
|
|
5186
|
+
},
|
|
5187
|
+
defaultVariants: {
|
|
5188
|
+
thickness: "default"
|
|
5189
|
+
}
|
|
5190
|
+
}
|
|
5191
|
+
);
|
|
5192
|
+
var progressActiveIndicatorVariants = cva([
|
|
5186
5193
|
"absolute",
|
|
5187
5194
|
"left-0",
|
|
5188
5195
|
"top-0",
|
|
5189
5196
|
"h-full",
|
|
5190
5197
|
"rounded-full",
|
|
5191
5198
|
"bg-primary",
|
|
5192
|
-
//
|
|
5199
|
+
// Spatial spring — width changes are spatial (bar growing)
|
|
5193
5200
|
"transition-[width]",
|
|
5194
|
-
"duration-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5201
|
+
"duration-spring-standard-default-spatial",
|
|
5202
|
+
"ease-spring-standard-default-spatial"
|
|
5203
|
+
]);
|
|
5204
|
+
var progressInactiveSegmentVariants = cva([
|
|
5205
|
+
"absolute",
|
|
5206
|
+
"top-0",
|
|
5207
|
+
"right-0",
|
|
5208
|
+
"h-full",
|
|
5209
|
+
"rounded-full",
|
|
5210
|
+
"bg-primary-container",
|
|
5211
|
+
// Spatial spring on left position (gap moves as progress moves)
|
|
5212
|
+
"transition-[left]",
|
|
5213
|
+
"duration-spring-standard-default-spatial",
|
|
5214
|
+
"ease-spring-standard-default-spatial"
|
|
5198
5215
|
]);
|
|
5199
5216
|
var progressStopIndicatorVariants = cva([
|
|
5200
5217
|
"absolute",
|
|
5201
5218
|
"right-0",
|
|
5202
5219
|
"top-1/2",
|
|
5203
5220
|
"-translate-y-1/2",
|
|
5204
|
-
"
|
|
5205
|
-
|
|
5221
|
+
"size-1",
|
|
5222
|
+
// 4dp
|
|
5206
5223
|
"rounded-full",
|
|
5207
5224
|
"bg-primary"
|
|
5208
|
-
// MD3: stop indicator uses primary color
|
|
5209
5225
|
]);
|
|
5210
5226
|
var progressCircularSizeVariants = cva(
|
|
5211
5227
|
["relative", "flex", "items-center", "justify-center", "flex-shrink-0"],
|
|
@@ -5213,11 +5229,8 @@ var progressCircularSizeVariants = cva(
|
|
|
5213
5229
|
variants: {
|
|
5214
5230
|
size: {
|
|
5215
5231
|
small: "h-6 w-6",
|
|
5216
|
-
// MD3: 24dp
|
|
5217
5232
|
medium: "h-12 w-12",
|
|
5218
|
-
// MD3: 48dp (default)
|
|
5219
5233
|
large: "h-16 w-16"
|
|
5220
|
-
// MD3: 64dp
|
|
5221
5234
|
}
|
|
5222
5235
|
},
|
|
5223
5236
|
defaultVariants: {
|
|
@@ -5225,33 +5238,85 @@ var progressCircularSizeVariants = cva(
|
|
|
5225
5238
|
}
|
|
5226
5239
|
}
|
|
5227
5240
|
);
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5241
|
+
function useReducedMotion2() {
|
|
5242
|
+
const [reduced, setReduced] = useState(() => {
|
|
5243
|
+
if (typeof window === "undefined") return false;
|
|
5244
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
5245
|
+
});
|
|
5246
|
+
useEffect(() => {
|
|
5247
|
+
if (typeof window === "undefined") return;
|
|
5248
|
+
const mql = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
5249
|
+
const handler = (e) => setReduced(e.matches);
|
|
5250
|
+
mql.addEventListener("change", handler);
|
|
5251
|
+
return () => mql.removeEventListener("change", handler);
|
|
5252
|
+
}, []);
|
|
5253
|
+
return reduced;
|
|
5254
|
+
}
|
|
5255
|
+
var STROKE_WIDTH_DEFAULT = 4;
|
|
5256
|
+
var STROKE_WIDTH_THICK = 8;
|
|
5257
|
+
var INDICATOR_TRACK_GAP = 4;
|
|
5236
5258
|
var CIRCULAR_SIZE_PX = {
|
|
5237
5259
|
small: 24,
|
|
5238
5260
|
medium: 48,
|
|
5239
5261
|
large: 64
|
|
5240
5262
|
};
|
|
5241
|
-
|
|
5263
|
+
var WAVE_AMPLITUDE_DEFAULT = 3;
|
|
5264
|
+
var WAVE_AMPLITUDE_THICK = 5;
|
|
5265
|
+
var LINEAR_WAVE_COUNT = 14;
|
|
5266
|
+
var VB_W = 100;
|
|
5267
|
+
var WAVE_WAVELENGTH_CIRCULAR = 30;
|
|
5268
|
+
function getStrokeWidth(thickness) {
|
|
5269
|
+
return thickness === "thick" ? STROKE_WIDTH_THICK : STROKE_WIDTH_DEFAULT;
|
|
5270
|
+
}
|
|
5271
|
+
function getCircularGeometry(size, thickness) {
|
|
5272
|
+
const strokeWidth = getStrokeWidth(thickness);
|
|
5242
5273
|
const diameter = CIRCULAR_SIZE_PX[size];
|
|
5243
|
-
const radius = (diameter -
|
|
5274
|
+
const radius = (diameter - strokeWidth) / 2;
|
|
5244
5275
|
const circumference = 2 * Math.PI * radius;
|
|
5245
5276
|
const viewBox = `0 0 ${diameter} ${diameter}`;
|
|
5246
5277
|
const cx = diameter / 2;
|
|
5247
5278
|
const cy = diameter / 2;
|
|
5248
|
-
return { diameter, radius, circumference, viewBox, cx, cy };
|
|
5279
|
+
return { diameter, radius, circumference, viewBox, cx, cy, strokeWidth };
|
|
5280
|
+
}
|
|
5281
|
+
function buildLinearWavePath(vbWidth, waveCount, amplitude, midY, padCycles = 0) {
|
|
5282
|
+
const wavelength = vbWidth / waveCount;
|
|
5283
|
+
const totalCycles = waveCount + padCycles;
|
|
5284
|
+
const cp = wavelength / 4;
|
|
5285
|
+
const segments = [`M 0 ${midY}`];
|
|
5286
|
+
for (let i = 0; i < totalCycles; i++) {
|
|
5287
|
+
const x = i * wavelength;
|
|
5288
|
+
segments.push(
|
|
5289
|
+
`C ${x + cp} ${midY - amplitude} ${x + wavelength / 2 - cp} ${midY - amplitude} ${x + wavelength / 2} ${midY}`
|
|
5290
|
+
);
|
|
5291
|
+
segments.push(
|
|
5292
|
+
`C ${x + wavelength / 2 + cp} ${midY + amplitude} ${x + wavelength - cp} ${midY + amplitude} ${x + wavelength} ${midY}`
|
|
5293
|
+
);
|
|
5294
|
+
}
|
|
5295
|
+
return segments.join(" ");
|
|
5296
|
+
}
|
|
5297
|
+
function buildCircularWavePath(cx, cy, radius, amplitude, waveCount, steps) {
|
|
5298
|
+
const actualSteps = waveCount * 12;
|
|
5299
|
+
const points = [];
|
|
5300
|
+
for (let i = 0; i <= actualSteps; i++) {
|
|
5301
|
+
const t = i / actualSteps;
|
|
5302
|
+
const angle = t * 2 * Math.PI;
|
|
5303
|
+
const radialOffset = amplitude * Math.sin(2 * Math.PI * waveCount * t);
|
|
5304
|
+
const r = radius + radialOffset;
|
|
5305
|
+
const x = cx + r * Math.cos(angle);
|
|
5306
|
+
const y = cy + r * Math.sin(angle);
|
|
5307
|
+
points.push(
|
|
5308
|
+
i === 0 ? `M ${x.toFixed(2)} ${y.toFixed(2)}` : `L ${x.toFixed(2)} ${y.toFixed(2)}`
|
|
5309
|
+
);
|
|
5310
|
+
}
|
|
5311
|
+
return points.join(" ") + " Z";
|
|
5249
5312
|
}
|
|
5250
5313
|
var Progress = forwardRef(
|
|
5251
5314
|
({
|
|
5252
5315
|
type = "linear",
|
|
5253
5316
|
indeterminate = false,
|
|
5254
5317
|
size = "medium",
|
|
5318
|
+
shape = "flat",
|
|
5319
|
+
thickness = "default",
|
|
5255
5320
|
className,
|
|
5256
5321
|
label,
|
|
5257
5322
|
value = 0,
|
|
@@ -5261,6 +5326,7 @@ var Progress = forwardRef(
|
|
|
5261
5326
|
}, forwardedRef) => {
|
|
5262
5327
|
const internalRef = useRef(null);
|
|
5263
5328
|
const ref = forwardedRef ?? internalRef;
|
|
5329
|
+
const reducedMotion = useReducedMotion2();
|
|
5264
5330
|
const { progressBarProps, labelProps } = useProgressBar({
|
|
5265
5331
|
label,
|
|
5266
5332
|
value,
|
|
@@ -5270,6 +5336,7 @@ var Progress = forwardRef(
|
|
|
5270
5336
|
...restProps
|
|
5271
5337
|
});
|
|
5272
5338
|
const percentage = indeterminate ? 0 : Math.min(100, Math.max(0, (value - minValue) / (maxValue - minValue) * 100));
|
|
5339
|
+
const effectiveShape = reducedMotion ? "flat" : shape;
|
|
5273
5340
|
if (process.env.NODE_ENV !== "production") {
|
|
5274
5341
|
const ariaProps = restProps;
|
|
5275
5342
|
if (!label && !ariaProps["aria-label"] && !ariaProps["aria-labelledby"]) {
|
|
@@ -5286,52 +5353,72 @@ var Progress = forwardRef(
|
|
|
5286
5353
|
className: cn(progressContainerVariants({ type }), className),
|
|
5287
5354
|
children: [
|
|
5288
5355
|
label && /* @__PURE__ */ jsx("span", { ...labelProps, className: cn(progressLabelVariants()), children: label }),
|
|
5289
|
-
type === "linear" ? /* @__PURE__ */ jsx(
|
|
5290
|
-
|
|
5291
|
-
}
|
|
5292
|
-
);
|
|
5293
|
-
}
|
|
5294
|
-
);
|
|
5295
|
-
Progress.displayName = "Progress";
|
|
5296
|
-
function LinearProgress({ percentage, indeterminate }) {
|
|
5297
|
-
if (indeterminate) {
|
|
5298
|
-
return /* @__PURE__ */ jsx("div", { "data-progress-track": "", className: cn(progressTrackVariants()), children: /* @__PURE__ */ jsxs(
|
|
5299
|
-
"div",
|
|
5300
|
-
{
|
|
5301
|
-
"data-progress-indeterminate": "",
|
|
5302
|
-
className: "absolute inset-0 overflow-hidden rounded-full",
|
|
5303
|
-
children: [
|
|
5304
|
-
/* @__PURE__ */ jsx(
|
|
5305
|
-
"div",
|
|
5356
|
+
type === "linear" ? /* @__PURE__ */ jsx(
|
|
5357
|
+
LinearProgress,
|
|
5306
5358
|
{
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5359
|
+
percentage,
|
|
5360
|
+
indeterminate,
|
|
5361
|
+
shape: effectiveShape,
|
|
5362
|
+
thickness,
|
|
5363
|
+
reducedMotion
|
|
5311
5364
|
}
|
|
5312
|
-
)
|
|
5313
|
-
|
|
5314
|
-
"div",
|
|
5365
|
+
) : /* @__PURE__ */ jsx(
|
|
5366
|
+
CircularProgress,
|
|
5315
5367
|
{
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5368
|
+
percentage,
|
|
5369
|
+
indeterminate,
|
|
5370
|
+
size,
|
|
5371
|
+
shape: effectiveShape,
|
|
5372
|
+
thickness,
|
|
5373
|
+
reducedMotion
|
|
5320
5374
|
}
|
|
5321
5375
|
)
|
|
5322
5376
|
]
|
|
5323
5377
|
}
|
|
5324
|
-
)
|
|
5378
|
+
);
|
|
5325
5379
|
}
|
|
5326
|
-
|
|
5380
|
+
);
|
|
5381
|
+
Progress.displayName = "Progress";
|
|
5382
|
+
function LinearProgress({
|
|
5383
|
+
percentage,
|
|
5384
|
+
indeterminate,
|
|
5385
|
+
shape,
|
|
5386
|
+
thickness,
|
|
5387
|
+
reducedMotion
|
|
5388
|
+
}) {
|
|
5389
|
+
if (indeterminate) {
|
|
5390
|
+
return shape === "wavy" ? /* @__PURE__ */ jsx(LinearWavyIndeterminate, { thickness }) : /* @__PURE__ */ jsx(LinearFlatIndeterminate, { thickness });
|
|
5391
|
+
}
|
|
5392
|
+
return shape === "wavy" ? /* @__PURE__ */ jsx(
|
|
5393
|
+
LinearWavyDeterminate,
|
|
5394
|
+
{
|
|
5395
|
+
percentage,
|
|
5396
|
+
thickness,
|
|
5397
|
+
reducedMotion
|
|
5398
|
+
}
|
|
5399
|
+
) : /* @__PURE__ */ jsx(LinearFlatDeterminate, { percentage, thickness });
|
|
5400
|
+
}
|
|
5401
|
+
function LinearFlatDeterminate({
|
|
5402
|
+
percentage,
|
|
5403
|
+
thickness
|
|
5404
|
+
}) {
|
|
5405
|
+
return /* @__PURE__ */ jsxs("div", { "data-progress-track": "", className: cn(progressTrackVariants({ thickness })), children: [
|
|
5327
5406
|
/* @__PURE__ */ jsx(
|
|
5328
5407
|
"div",
|
|
5329
5408
|
{
|
|
5330
5409
|
"data-progress-indicator": "",
|
|
5331
|
-
className: cn(
|
|
5410
|
+
className: cn(progressActiveIndicatorVariants()),
|
|
5332
5411
|
style: { width: `${percentage}%` }
|
|
5333
5412
|
}
|
|
5334
5413
|
),
|
|
5414
|
+
percentage < 100 && /* @__PURE__ */ jsx(
|
|
5415
|
+
"div",
|
|
5416
|
+
{
|
|
5417
|
+
"data-progress-inactive-segment": "",
|
|
5418
|
+
className: cn(progressInactiveSegmentVariants()),
|
|
5419
|
+
style: { left: `calc(${percentage}% + ${INDICATOR_TRACK_GAP}px)` }
|
|
5420
|
+
}
|
|
5421
|
+
),
|
|
5335
5422
|
/* @__PURE__ */ jsx(
|
|
5336
5423
|
"div",
|
|
5337
5424
|
{
|
|
@@ -5342,14 +5429,211 @@ function LinearProgress({ percentage, indeterminate }) {
|
|
|
5342
5429
|
)
|
|
5343
5430
|
] });
|
|
5344
5431
|
}
|
|
5432
|
+
function LinearFlatIndeterminate({
|
|
5433
|
+
thickness
|
|
5434
|
+
}) {
|
|
5435
|
+
return /* @__PURE__ */ jsx("div", { "data-progress-track": "", className: cn(progressTrackVariants({ thickness })), children: /* @__PURE__ */ jsxs("div", { "data-progress-indeterminate": "", className: "absolute inset-0 overflow-hidden rounded-full", children: [
|
|
5436
|
+
/* @__PURE__ */ jsx(
|
|
5437
|
+
"div",
|
|
5438
|
+
{
|
|
5439
|
+
className: cn(
|
|
5440
|
+
"bg-primary absolute top-0 h-full rounded-full",
|
|
5441
|
+
"animate-progress-linear-indeterminate-1"
|
|
5442
|
+
)
|
|
5443
|
+
}
|
|
5444
|
+
),
|
|
5445
|
+
/* @__PURE__ */ jsx(
|
|
5446
|
+
"div",
|
|
5447
|
+
{
|
|
5448
|
+
className: cn(
|
|
5449
|
+
"bg-primary absolute top-0 h-full rounded-full",
|
|
5450
|
+
"animate-progress-linear-indeterminate-2"
|
|
5451
|
+
)
|
|
5452
|
+
}
|
|
5453
|
+
)
|
|
5454
|
+
] }) });
|
|
5455
|
+
}
|
|
5456
|
+
function LinearWavyDeterminate({
|
|
5457
|
+
percentage,
|
|
5458
|
+
thickness,
|
|
5459
|
+
reducedMotion
|
|
5460
|
+
}) {
|
|
5461
|
+
const amplitude = thickness === "thick" ? WAVE_AMPLITUDE_THICK : WAVE_AMPLITUDE_DEFAULT;
|
|
5462
|
+
const containerHeight = (thickness === "thick" ? 8 : 4) + 2 * amplitude + 4;
|
|
5463
|
+
const midY = amplitude + 2;
|
|
5464
|
+
const trackHeightClass = thickness === "thick" ? "h-2" : "h-1";
|
|
5465
|
+
const trackPx = getStrokeWidth(thickness);
|
|
5466
|
+
const rampedAmplitude = reducedMotion || percentage <= 0 || percentage >= 100 ? 0 : amplitude * Math.min(
|
|
5467
|
+
(percentage - 10) / 10,
|
|
5468
|
+
// ramp up 10%→20%
|
|
5469
|
+
(90 - percentage) / 10,
|
|
5470
|
+
// ramp down 80%→90%
|
|
5471
|
+
1
|
|
5472
|
+
);
|
|
5473
|
+
const wavePath = buildLinearWavePath(VB_W, LINEAR_WAVE_COUNT, rampedAmplitude, midY);
|
|
5474
|
+
return /* @__PURE__ */ jsxs(
|
|
5475
|
+
"div",
|
|
5476
|
+
{
|
|
5477
|
+
"data-progress-track": "",
|
|
5478
|
+
className: cn("relative w-full overflow-hidden", trackHeightClass),
|
|
5479
|
+
style: { height: containerHeight },
|
|
5480
|
+
children: [
|
|
5481
|
+
/* @__PURE__ */ jsx(
|
|
5482
|
+
"svg",
|
|
5483
|
+
{
|
|
5484
|
+
viewBox: `0 0 ${VB_W} ${containerHeight}`,
|
|
5485
|
+
preserveAspectRatio: "none",
|
|
5486
|
+
className: cn(
|
|
5487
|
+
"absolute inset-0 w-full",
|
|
5488
|
+
"transition-[clip-path]",
|
|
5489
|
+
"duration-spring-standard-default-spatial",
|
|
5490
|
+
"ease-spring-standard-default-spatial"
|
|
5491
|
+
),
|
|
5492
|
+
style: {
|
|
5493
|
+
height: containerHeight,
|
|
5494
|
+
// clip-path applied in rendered-element space: keeps left `percentage`%
|
|
5495
|
+
clipPath: `inset(0 ${100 - percentage}% 0 0)`
|
|
5496
|
+
},
|
|
5497
|
+
"aria-hidden": "true",
|
|
5498
|
+
children: /* @__PURE__ */ jsx(
|
|
5499
|
+
"path",
|
|
5500
|
+
{
|
|
5501
|
+
"data-progress-indicator": "",
|
|
5502
|
+
d: wavePath,
|
|
5503
|
+
fill: "none",
|
|
5504
|
+
stroke: "currentColor",
|
|
5505
|
+
strokeWidth: getStrokeWidth(thickness),
|
|
5506
|
+
strokeLinecap: "round",
|
|
5507
|
+
vectorEffect: "non-scaling-stroke",
|
|
5508
|
+
className: "text-primary"
|
|
5509
|
+
}
|
|
5510
|
+
)
|
|
5511
|
+
}
|
|
5512
|
+
),
|
|
5513
|
+
percentage < 100 && /* @__PURE__ */ jsx(
|
|
5514
|
+
"div",
|
|
5515
|
+
{
|
|
5516
|
+
"data-progress-inactive-segment": "",
|
|
5517
|
+
className: cn(progressInactiveSegmentVariants()),
|
|
5518
|
+
style: {
|
|
5519
|
+
left: `calc(${percentage}% + ${INDICATOR_TRACK_GAP}px)`,
|
|
5520
|
+
height: trackPx,
|
|
5521
|
+
top: midY - trackPx / 2
|
|
5522
|
+
}
|
|
5523
|
+
}
|
|
5524
|
+
),
|
|
5525
|
+
/* @__PURE__ */ jsx(
|
|
5526
|
+
"div",
|
|
5527
|
+
{
|
|
5528
|
+
"data-stop-indicator": "",
|
|
5529
|
+
className: cn(progressStopIndicatorVariants()),
|
|
5530
|
+
style: { top: midY },
|
|
5531
|
+
"aria-hidden": "true"
|
|
5532
|
+
}
|
|
5533
|
+
)
|
|
5534
|
+
]
|
|
5535
|
+
}
|
|
5536
|
+
);
|
|
5537
|
+
}
|
|
5538
|
+
function LinearWavyIndeterminate({
|
|
5539
|
+
thickness
|
|
5540
|
+
}) {
|
|
5541
|
+
const amplitude = thickness === "thick" ? WAVE_AMPLITUDE_THICK : WAVE_AMPLITUDE_DEFAULT;
|
|
5542
|
+
const containerHeight = (thickness === "thick" ? 8 : 4) + 2 * amplitude + 4;
|
|
5543
|
+
const midY = amplitude + 2;
|
|
5544
|
+
const trackHeightClass = thickness === "thick" ? "h-2" : "h-1";
|
|
5545
|
+
const trackPx = getStrokeWidth(thickness);
|
|
5546
|
+
const wavePath = buildLinearWavePath(VB_W, LINEAR_WAVE_COUNT, amplitude, midY);
|
|
5547
|
+
return /* @__PURE__ */ jsxs(
|
|
5548
|
+
"div",
|
|
5549
|
+
{
|
|
5550
|
+
"data-progress-track": "",
|
|
5551
|
+
className: cn("relative w-full overflow-hidden", trackHeightClass),
|
|
5552
|
+
style: { height: containerHeight },
|
|
5553
|
+
children: [
|
|
5554
|
+
/* @__PURE__ */ jsx(
|
|
5555
|
+
"div",
|
|
5556
|
+
{
|
|
5557
|
+
className: "bg-primary-container absolute right-0 left-0 rounded-full",
|
|
5558
|
+
style: { height: trackPx, top: midY - trackPx / 2 }
|
|
5559
|
+
}
|
|
5560
|
+
),
|
|
5561
|
+
/* @__PURE__ */ jsxs("div", { "data-progress-indeterminate": "", className: "absolute inset-0", children: [
|
|
5562
|
+
/* @__PURE__ */ jsx(
|
|
5563
|
+
"svg",
|
|
5564
|
+
{
|
|
5565
|
+
viewBox: `0 0 ${VB_W} ${containerHeight}`,
|
|
5566
|
+
preserveAspectRatio: "none",
|
|
5567
|
+
className: "animate-progress-linear-indeterminate-1 absolute top-0 h-full",
|
|
5568
|
+
"aria-hidden": "true",
|
|
5569
|
+
children: /* @__PURE__ */ jsx(
|
|
5570
|
+
"path",
|
|
5571
|
+
{
|
|
5572
|
+
d: wavePath,
|
|
5573
|
+
fill: "none",
|
|
5574
|
+
stroke: "currentColor",
|
|
5575
|
+
strokeWidth: getStrokeWidth(thickness),
|
|
5576
|
+
strokeLinecap: "round",
|
|
5577
|
+
vectorEffect: "non-scaling-stroke",
|
|
5578
|
+
className: "text-primary"
|
|
5579
|
+
}
|
|
5580
|
+
)
|
|
5581
|
+
}
|
|
5582
|
+
),
|
|
5583
|
+
/* @__PURE__ */ jsx(
|
|
5584
|
+
"svg",
|
|
5585
|
+
{
|
|
5586
|
+
viewBox: `0 0 ${VB_W} ${containerHeight}`,
|
|
5587
|
+
preserveAspectRatio: "none",
|
|
5588
|
+
className: "animate-progress-linear-indeterminate-2 absolute top-0 h-full",
|
|
5589
|
+
"aria-hidden": "true",
|
|
5590
|
+
children: /* @__PURE__ */ jsx(
|
|
5591
|
+
"path",
|
|
5592
|
+
{
|
|
5593
|
+
d: wavePath,
|
|
5594
|
+
fill: "none",
|
|
5595
|
+
stroke: "currentColor",
|
|
5596
|
+
strokeWidth: getStrokeWidth(thickness),
|
|
5597
|
+
strokeLinecap: "round",
|
|
5598
|
+
vectorEffect: "non-scaling-stroke",
|
|
5599
|
+
className: "text-primary"
|
|
5600
|
+
}
|
|
5601
|
+
)
|
|
5602
|
+
}
|
|
5603
|
+
)
|
|
5604
|
+
] })
|
|
5605
|
+
]
|
|
5606
|
+
}
|
|
5607
|
+
);
|
|
5608
|
+
}
|
|
5345
5609
|
function CircularProgress({
|
|
5346
5610
|
percentage,
|
|
5347
5611
|
indeterminate,
|
|
5348
|
-
size
|
|
5612
|
+
size,
|
|
5613
|
+
shape,
|
|
5614
|
+
thickness,
|
|
5615
|
+
reducedMotion
|
|
5349
5616
|
}) {
|
|
5350
|
-
const { radius, circumference, viewBox, cx, cy } = getCircularGeometry(
|
|
5351
|
-
|
|
5617
|
+
const { radius, circumference, viewBox, cx, cy, strokeWidth, diameter } = getCircularGeometry(
|
|
5618
|
+
size,
|
|
5619
|
+
thickness
|
|
5620
|
+
);
|
|
5352
5621
|
if (indeterminate) {
|
|
5622
|
+
if (shape === "wavy") {
|
|
5623
|
+
return /* @__PURE__ */ jsx(
|
|
5624
|
+
CircularWavyIndeterminate,
|
|
5625
|
+
{
|
|
5626
|
+
size,
|
|
5627
|
+
cx,
|
|
5628
|
+
cy,
|
|
5629
|
+
radius,
|
|
5630
|
+
circumference,
|
|
5631
|
+
viewBox,
|
|
5632
|
+
strokeWidth,
|
|
5633
|
+
diameter
|
|
5634
|
+
}
|
|
5635
|
+
);
|
|
5636
|
+
}
|
|
5353
5637
|
return /* @__PURE__ */ jsx(
|
|
5354
5638
|
"div",
|
|
5355
5639
|
{
|
|
@@ -5371,8 +5655,8 @@ function CircularProgress({
|
|
|
5371
5655
|
r: radius,
|
|
5372
5656
|
fill: "none",
|
|
5373
5657
|
stroke: "currentColor",
|
|
5374
|
-
strokeWidth
|
|
5375
|
-
className: "text-
|
|
5658
|
+
strokeWidth,
|
|
5659
|
+
className: "text-primary-container"
|
|
5376
5660
|
}
|
|
5377
5661
|
),
|
|
5378
5662
|
/* @__PURE__ */ jsx(
|
|
@@ -5383,7 +5667,7 @@ function CircularProgress({
|
|
|
5383
5667
|
r: radius,
|
|
5384
5668
|
fill: "none",
|
|
5385
5669
|
stroke: "currentColor",
|
|
5386
|
-
strokeWidth
|
|
5670
|
+
strokeWidth,
|
|
5387
5671
|
className: "animate-progress-circular-dash text-primary",
|
|
5388
5672
|
strokeLinecap: "round"
|
|
5389
5673
|
}
|
|
@@ -5394,41 +5678,211 @@ function CircularProgress({
|
|
|
5394
5678
|
}
|
|
5395
5679
|
);
|
|
5396
5680
|
}
|
|
5397
|
-
|
|
5398
|
-
/* @__PURE__ */ jsx(
|
|
5399
|
-
|
|
5400
|
-
{
|
|
5401
|
-
cx,
|
|
5402
|
-
cy,
|
|
5403
|
-
r: radius,
|
|
5404
|
-
fill: "none",
|
|
5405
|
-
stroke: "currentColor",
|
|
5406
|
-
strokeWidth: STROKE_WIDTH,
|
|
5407
|
-
className: "text-surface-container-highest"
|
|
5408
|
-
}
|
|
5409
|
-
),
|
|
5410
|
-
/* @__PURE__ */ jsx(
|
|
5411
|
-
"circle",
|
|
5681
|
+
if (shape === "wavy") {
|
|
5682
|
+
return /* @__PURE__ */ jsx(
|
|
5683
|
+
CircularWavyDeterminate,
|
|
5412
5684
|
{
|
|
5685
|
+
size,
|
|
5686
|
+
percentage,
|
|
5413
5687
|
cx,
|
|
5414
5688
|
cy,
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
strokeWidth
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
strokeDasharray: circumference,
|
|
5422
|
-
strokeDashoffset
|
|
5689
|
+
radius,
|
|
5690
|
+
circumference,
|
|
5691
|
+
viewBox,
|
|
5692
|
+
strokeWidth,
|
|
5693
|
+
diameter,
|
|
5694
|
+
reducedMotion
|
|
5423
5695
|
}
|
|
5424
|
-
)
|
|
5425
|
-
|
|
5696
|
+
);
|
|
5697
|
+
}
|
|
5698
|
+
const activeArc = percentage / 100 * circumference;
|
|
5699
|
+
const activeArcGapped = Math.max(0, activeArc - INDICATOR_TRACK_GAP);
|
|
5700
|
+
const inactiveArcGapped = Math.max(0, circumference - activeArc - INDICATOR_TRACK_GAP);
|
|
5701
|
+
const activeOffset = 0;
|
|
5702
|
+
const inactiveOffset = -(activeArcGapped + INDICATOR_TRACK_GAP);
|
|
5703
|
+
return /* @__PURE__ */ jsxs("div", { "data-progress-size": size, className: cn(progressCircularSizeVariants({ size })), children: [
|
|
5704
|
+
/* @__PURE__ */ jsxs("svg", { viewBox, className: "h-full w-full -rotate-90", "aria-hidden": "true", children: [
|
|
5705
|
+
percentage < 100 && /* @__PURE__ */ jsx(
|
|
5706
|
+
"circle",
|
|
5707
|
+
{
|
|
5708
|
+
cx,
|
|
5709
|
+
cy,
|
|
5710
|
+
r: radius,
|
|
5711
|
+
fill: "none",
|
|
5712
|
+
stroke: "currentColor",
|
|
5713
|
+
strokeWidth,
|
|
5714
|
+
strokeLinecap: "round",
|
|
5715
|
+
strokeDasharray: `${inactiveArcGapped} ${circumference - inactiveArcGapped}`,
|
|
5716
|
+
strokeDashoffset: inactiveOffset,
|
|
5717
|
+
className: "text-primary-container duration-spring-standard-default-spatial ease-spring-standard-default-spatial transition-[stroke-dasharray,stroke-dashoffset]"
|
|
5718
|
+
}
|
|
5719
|
+
),
|
|
5720
|
+
percentage > 0 && /* @__PURE__ */ jsx(
|
|
5721
|
+
"circle",
|
|
5722
|
+
{
|
|
5723
|
+
cx,
|
|
5724
|
+
cy,
|
|
5725
|
+
r: radius,
|
|
5726
|
+
fill: "none",
|
|
5727
|
+
stroke: "currentColor",
|
|
5728
|
+
strokeWidth,
|
|
5729
|
+
strokeLinecap: "round",
|
|
5730
|
+
strokeDasharray: `${activeArcGapped} ${circumference - activeArcGapped}`,
|
|
5731
|
+
strokeDashoffset: activeOffset,
|
|
5732
|
+
className: "text-primary duration-spring-standard-default-spatial ease-spring-standard-default-spatial transition-[stroke-dasharray,stroke-dashoffset]"
|
|
5733
|
+
}
|
|
5734
|
+
),
|
|
5735
|
+
percentage === 0 && /* @__PURE__ */ jsx(
|
|
5736
|
+
"circle",
|
|
5737
|
+
{
|
|
5738
|
+
cx,
|
|
5739
|
+
cy,
|
|
5740
|
+
r: radius,
|
|
5741
|
+
fill: "none",
|
|
5742
|
+
stroke: "currentColor",
|
|
5743
|
+
strokeWidth,
|
|
5744
|
+
className: "text-primary-container"
|
|
5745
|
+
}
|
|
5746
|
+
)
|
|
5747
|
+
] }),
|
|
5748
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", "data-progress-diameter": diameter })
|
|
5749
|
+
] });
|
|
5750
|
+
}
|
|
5751
|
+
function CircularWavyIndeterminate({
|
|
5752
|
+
size,
|
|
5753
|
+
cx,
|
|
5754
|
+
cy,
|
|
5755
|
+
radius,
|
|
5756
|
+
circumference: _circumference,
|
|
5757
|
+
viewBox,
|
|
5758
|
+
strokeWidth
|
|
5759
|
+
}) {
|
|
5760
|
+
const circAmp = Math.min(WAVE_AMPLITUDE_DEFAULT, radius * 0.35);
|
|
5761
|
+
const meanRadius = radius - circAmp;
|
|
5762
|
+
const meanCircumference = 2 * Math.PI * meanRadius;
|
|
5763
|
+
const waveCount = Math.max(4, Math.round(meanCircumference / WAVE_WAVELENGTH_CIRCULAR));
|
|
5764
|
+
const wavePath = buildCircularWavePath(cx, cy, meanRadius, circAmp, waveCount);
|
|
5765
|
+
return /* @__PURE__ */ jsx(
|
|
5766
|
+
"div",
|
|
5767
|
+
{
|
|
5768
|
+
"data-progress-size": size,
|
|
5769
|
+
"data-progress-indeterminate": "",
|
|
5770
|
+
className: cn(progressCircularSizeVariants({ size })),
|
|
5771
|
+
children: /* @__PURE__ */ jsxs(
|
|
5772
|
+
"svg",
|
|
5773
|
+
{
|
|
5774
|
+
viewBox,
|
|
5775
|
+
className: "animate-progress-circular-rotate h-full w-full",
|
|
5776
|
+
"aria-hidden": "true",
|
|
5777
|
+
children: [
|
|
5778
|
+
/* @__PURE__ */ jsx(
|
|
5779
|
+
"circle",
|
|
5780
|
+
{
|
|
5781
|
+
cx,
|
|
5782
|
+
cy,
|
|
5783
|
+
r: meanRadius,
|
|
5784
|
+
fill: "none",
|
|
5785
|
+
stroke: "currentColor",
|
|
5786
|
+
strokeWidth,
|
|
5787
|
+
className: "text-primary-container"
|
|
5788
|
+
}
|
|
5789
|
+
),
|
|
5790
|
+
/* @__PURE__ */ jsx(
|
|
5791
|
+
"path",
|
|
5792
|
+
{
|
|
5793
|
+
d: wavePath,
|
|
5794
|
+
fill: "none",
|
|
5795
|
+
stroke: "currentColor",
|
|
5796
|
+
strokeWidth,
|
|
5797
|
+
strokeLinecap: "round",
|
|
5798
|
+
pathLength: 100,
|
|
5799
|
+
strokeDasharray: "28 72",
|
|
5800
|
+
className: "text-primary"
|
|
5801
|
+
}
|
|
5802
|
+
)
|
|
5803
|
+
]
|
|
5804
|
+
}
|
|
5805
|
+
)
|
|
5806
|
+
}
|
|
5807
|
+
);
|
|
5808
|
+
}
|
|
5809
|
+
function CircularWavyDeterminate({
|
|
5810
|
+
size,
|
|
5811
|
+
percentage,
|
|
5812
|
+
cx,
|
|
5813
|
+
cy,
|
|
5814
|
+
radius,
|
|
5815
|
+
circumference: _circumference,
|
|
5816
|
+
viewBox,
|
|
5817
|
+
strokeWidth,
|
|
5818
|
+
diameter,
|
|
5819
|
+
reducedMotion
|
|
5820
|
+
}) {
|
|
5821
|
+
const circAmp = reducedMotion ? 0 : Math.min(WAVE_AMPLITUDE_DEFAULT, radius * 0.35);
|
|
5822
|
+
const meanRadius = radius - circAmp;
|
|
5823
|
+
const meanCircumference = 2 * Math.PI * meanRadius;
|
|
5824
|
+
const waveCount = Math.max(4, Math.round(meanCircumference / WAVE_WAVELENGTH_CIRCULAR));
|
|
5825
|
+
const wavePath = buildCircularWavePath(cx, cy, meanRadius, circAmp, waveCount);
|
|
5826
|
+
const gapPct = INDICATOR_TRACK_GAP / meanCircumference * 100;
|
|
5827
|
+
const activeLen = Math.max(0, percentage - gapPct);
|
|
5828
|
+
const inactiveLen = Math.max(0, 100 - percentage - gapPct);
|
|
5829
|
+
const inactiveOffset = -(activeLen + gapPct);
|
|
5830
|
+
return /* @__PURE__ */ jsxs("div", { "data-progress-size": size, className: cn(progressCircularSizeVariants({ size })), children: [
|
|
5831
|
+
/* @__PURE__ */ jsxs("svg", { viewBox, className: "h-full w-full -rotate-90", "aria-hidden": "true", children: [
|
|
5832
|
+
percentage === 0 && /* @__PURE__ */ jsx(
|
|
5833
|
+
"circle",
|
|
5834
|
+
{
|
|
5835
|
+
cx,
|
|
5836
|
+
cy,
|
|
5837
|
+
r: meanRadius,
|
|
5838
|
+
fill: "none",
|
|
5839
|
+
stroke: "currentColor",
|
|
5840
|
+
strokeWidth,
|
|
5841
|
+
className: "text-primary-container"
|
|
5842
|
+
}
|
|
5843
|
+
),
|
|
5844
|
+
percentage > 0 && percentage < 100 && /* @__PURE__ */ jsx(
|
|
5845
|
+
"circle",
|
|
5846
|
+
{
|
|
5847
|
+
cx,
|
|
5848
|
+
cy,
|
|
5849
|
+
r: meanRadius,
|
|
5850
|
+
fill: "none",
|
|
5851
|
+
stroke: "currentColor",
|
|
5852
|
+
strokeWidth,
|
|
5853
|
+
strokeLinecap: "round",
|
|
5854
|
+
pathLength: 100,
|
|
5855
|
+
strokeDasharray: `${inactiveLen} ${100 - inactiveLen}`,
|
|
5856
|
+
strokeDashoffset: inactiveOffset,
|
|
5857
|
+
className: "text-primary-container duration-spring-standard-default-spatial ease-spring-standard-default-spatial transition-[stroke-dasharray,stroke-dashoffset]"
|
|
5858
|
+
}
|
|
5859
|
+
),
|
|
5860
|
+
percentage > 0 && /* @__PURE__ */ jsx(
|
|
5861
|
+
"path",
|
|
5862
|
+
{
|
|
5863
|
+
"data-progress-indicator": "",
|
|
5864
|
+
d: wavePath,
|
|
5865
|
+
fill: "none",
|
|
5866
|
+
stroke: "currentColor",
|
|
5867
|
+
strokeWidth,
|
|
5868
|
+
strokeLinecap: "round",
|
|
5869
|
+
pathLength: 100,
|
|
5870
|
+
strokeDasharray: percentage < 100 ? `${activeLen} ${100 - activeLen}` : void 0,
|
|
5871
|
+
strokeDashoffset: 0,
|
|
5872
|
+
className: "text-primary duration-spring-standard-default-spatial ease-spring-standard-default-spatial transition-[stroke-dasharray]"
|
|
5873
|
+
}
|
|
5874
|
+
)
|
|
5875
|
+
] }),
|
|
5876
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", "data-progress-diameter": diameter })
|
|
5877
|
+
] });
|
|
5426
5878
|
}
|
|
5427
5879
|
var ProgressHeadless = forwardRef(
|
|
5428
5880
|
({
|
|
5429
5881
|
type = "linear",
|
|
5430
5882
|
indeterminate = false,
|
|
5431
5883
|
size = "medium",
|
|
5884
|
+
shape = "flat",
|
|
5885
|
+
thickness = "default",
|
|
5432
5886
|
className,
|
|
5433
5887
|
children,
|
|
5434
5888
|
renderProgress,
|
|
@@ -5455,7 +5909,9 @@ var ProgressHeadless = forwardRef(
|
|
|
5455
5909
|
percentage,
|
|
5456
5910
|
isIndeterminate: indeterminate,
|
|
5457
5911
|
type,
|
|
5458
|
-
size
|
|
5912
|
+
size,
|
|
5913
|
+
shape,
|
|
5914
|
+
thickness
|
|
5459
5915
|
}),
|
|
5460
5916
|
children
|
|
5461
5917
|
] });
|
|
@@ -7983,37 +8439,150 @@ InteractiveListItem.displayName = "InteractiveListItem";
|
|
|
7983
8439
|
var listVariants = cva("w-full bg-surface");
|
|
7984
8440
|
var listItemVariants = cva(
|
|
7985
8441
|
[
|
|
7986
|
-
|
|
7987
|
-
"
|
|
8442
|
+
// Layout
|
|
8443
|
+
"relative flex items-center overflow-hidden px-4 py-2 select-none",
|
|
8444
|
+
// Color transition — effects spring (no spatial overshoot on color)
|
|
8445
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
8446
|
+
// Cursor: non-interactive base; data-[interactive] overrides
|
|
8447
|
+
"cursor-default",
|
|
8448
|
+
"data-[interactive]:cursor-pointer",
|
|
8449
|
+
// Selected: secondary-container background
|
|
8450
|
+
"group-data-[selected]/list-item:bg-secondary-container",
|
|
8451
|
+
// Disabled: self-targeting selectors (not group, since root is the group)
|
|
8452
|
+
"data-[disabled]:opacity-38 data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed"
|
|
7988
8453
|
],
|
|
7989
8454
|
{
|
|
7990
8455
|
variants: {
|
|
8456
|
+
/**
|
|
8457
|
+
* Visual density — derived from content, not a user prop.
|
|
8458
|
+
* one-line: headline only (56dp)
|
|
8459
|
+
* two-line: headline + supportingText (72dp)
|
|
8460
|
+
* three-line: overline + headline + supportingText (88dp)
|
|
8461
|
+
*/
|
|
7991
8462
|
density: {
|
|
7992
8463
|
"one-line": "min-h-14",
|
|
7993
8464
|
"two-line": "min-h-18",
|
|
7994
8465
|
"three-line": "min-h-22 items-start"
|
|
7995
|
-
},
|
|
7996
|
-
isSelected: {
|
|
7997
|
-
true: "bg-secondary-container text-on-secondary-container",
|
|
7998
|
-
false: ""
|
|
7999
|
-
},
|
|
8000
|
-
isDisabled: {
|
|
8001
|
-
true: "opacity-38 pointer-events-none",
|
|
8002
|
-
false: ""
|
|
8003
|
-
},
|
|
8004
|
-
isInteractive: {
|
|
8005
|
-
true: "",
|
|
8006
|
-
false: "cursor-default"
|
|
8007
8466
|
}
|
|
8008
8467
|
},
|
|
8009
8468
|
defaultVariants: {
|
|
8010
|
-
density: "one-line"
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
|
|
8469
|
+
density: "one-line"
|
|
8470
|
+
}
|
|
8471
|
+
}
|
|
8472
|
+
);
|
|
8473
|
+
var listItemStateLayerVariants = cva([
|
|
8474
|
+
"absolute inset-0 pointer-events-none opacity-0",
|
|
8475
|
+
"bg-on-surface",
|
|
8476
|
+
// Effects transition for opacity — no spatial overshoot
|
|
8477
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
8478
|
+
// Hover: 8%
|
|
8479
|
+
"group-data-[hovered]/list-item:opacity-8",
|
|
8480
|
+
// Focus: 10%
|
|
8481
|
+
"group-data-[focus-visible]/list-item:opacity-10",
|
|
8482
|
+
// Pressed: 10%, doubled selector beats hover
|
|
8483
|
+
"group-data-[pressed]/list-item:group-data-[pressed]/list-item:opacity-10",
|
|
8484
|
+
// No state layer when disabled
|
|
8485
|
+
"group-data-[disabled]/list-item:hidden"
|
|
8486
|
+
]);
|
|
8487
|
+
var listItemFocusRingVariants = cva([
|
|
8488
|
+
"pointer-events-none absolute inset-0",
|
|
8489
|
+
"outline outline-2 -outline-offset-2 outline-secondary",
|
|
8490
|
+
// Effects transition — opacity must NOT overshoot
|
|
8491
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
8492
|
+
"opacity-0",
|
|
8493
|
+
"group-data-[focus-visible]/list-item:opacity-100"
|
|
8494
|
+
]);
|
|
8495
|
+
var listItemLeadingVariants = cva(
|
|
8496
|
+
[
|
|
8497
|
+
"mr-4 flex shrink-0 items-center",
|
|
8498
|
+
// Effects transition for icon color changes
|
|
8499
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects"
|
|
8500
|
+
],
|
|
8501
|
+
{
|
|
8502
|
+
variants: {
|
|
8503
|
+
type: {
|
|
8504
|
+
icon: [
|
|
8505
|
+
"size-6",
|
|
8506
|
+
"text-on-surface-variant",
|
|
8507
|
+
// Selected: icon color changes to on-secondary-container
|
|
8508
|
+
"group-data-[selected]/list-item:text-on-secondary-container",
|
|
8509
|
+
// Disabled: 38% (inherited from root opacity-38, but also explicit for color accuracy)
|
|
8510
|
+
"group-data-[disabled]/list-item:text-on-surface/38"
|
|
8511
|
+
],
|
|
8512
|
+
avatar: [
|
|
8513
|
+
"size-10 overflow-hidden rounded-full"
|
|
8514
|
+
// Avatar color provided by content; no token overrides needed
|
|
8515
|
+
],
|
|
8516
|
+
checkbox: [],
|
|
8517
|
+
radio: []
|
|
8518
|
+
}
|
|
8519
|
+
},
|
|
8520
|
+
defaultVariants: {
|
|
8521
|
+
type: "icon"
|
|
8014
8522
|
}
|
|
8015
8523
|
}
|
|
8016
8524
|
);
|
|
8525
|
+
var listItemTrailingVariants = cva(
|
|
8526
|
+
[
|
|
8527
|
+
"ml-auto flex shrink-0 items-center",
|
|
8528
|
+
// Effects transition for color changes
|
|
8529
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects"
|
|
8530
|
+
],
|
|
8531
|
+
{
|
|
8532
|
+
variants: {
|
|
8533
|
+
type: {
|
|
8534
|
+
icon: [
|
|
8535
|
+
"size-6",
|
|
8536
|
+
"text-on-surface-variant",
|
|
8537
|
+
"group-data-[selected]/list-item:text-on-secondary-container",
|
|
8538
|
+
"group-data-[disabled]/list-item:text-on-surface/38"
|
|
8539
|
+
],
|
|
8540
|
+
text: [
|
|
8541
|
+
"text-label-small",
|
|
8542
|
+
"text-on-surface-variant",
|
|
8543
|
+
"group-data-[selected]/list-item:text-on-secondary-container",
|
|
8544
|
+
"group-data-[disabled]/list-item:text-on-surface/38"
|
|
8545
|
+
],
|
|
8546
|
+
checkbox: [],
|
|
8547
|
+
radio: []
|
|
8548
|
+
}
|
|
8549
|
+
},
|
|
8550
|
+
defaultVariants: {
|
|
8551
|
+
type: "icon"
|
|
8552
|
+
}
|
|
8553
|
+
}
|
|
8554
|
+
);
|
|
8555
|
+
var listItemOverlineVariants = cva([
|
|
8556
|
+
"text-label-small",
|
|
8557
|
+
"text-on-surface-variant",
|
|
8558
|
+
// Effects transition for color
|
|
8559
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
8560
|
+
// Selected: on-secondary-container
|
|
8561
|
+
"group-data-[selected]/list-item:text-on-secondary-container",
|
|
8562
|
+
// Disabled: opacity inherited from root; explicit for color
|
|
8563
|
+
"group-data-[disabled]/list-item:text-on-surface/38"
|
|
8564
|
+
]);
|
|
8565
|
+
var listItemHeadlineVariants = cva([
|
|
8566
|
+
"text-body-large",
|
|
8567
|
+
"text-on-surface",
|
|
8568
|
+
// Effects transition for color
|
|
8569
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
8570
|
+
// Selected: on-secondary-container
|
|
8571
|
+
"group-data-[selected]/list-item:text-on-secondary-container",
|
|
8572
|
+
// Disabled: 38% color via CSS (opacity-38 on root handles all descendants, but
|
|
8573
|
+
// explicit token ensures predictable rendering when color is specified).
|
|
8574
|
+
"group-data-[disabled]/list-item:text-on-surface/38"
|
|
8575
|
+
]);
|
|
8576
|
+
var listItemSupportingTextVariants = cva([
|
|
8577
|
+
"text-body-medium",
|
|
8578
|
+
"text-on-surface-variant",
|
|
8579
|
+
// Effects transition for color
|
|
8580
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
8581
|
+
// Selected: on-secondary-container
|
|
8582
|
+
"group-data-[selected]/list-item:text-on-secondary-container",
|
|
8583
|
+
// Disabled: 38% color
|
|
8584
|
+
"group-data-[disabled]/list-item:text-on-surface/38"
|
|
8585
|
+
]);
|
|
8017
8586
|
function interleaveWithDividers(children) {
|
|
8018
8587
|
const items = Children.toArray(children);
|
|
8019
8588
|
return items.reduce((acc, child, index) => {
|
|
@@ -8038,51 +8607,25 @@ var List = forwardRef(function List2({ className, showDividers = false, children
|
|
|
8038
8607
|
return /* @__PURE__ */ jsx(ListHeadless, { ref, className: cn(listVariants(), className), ...props, children: renderedChildren });
|
|
8039
8608
|
});
|
|
8040
8609
|
List.displayName = "List";
|
|
8041
|
-
var typeClasses = {
|
|
8042
|
-
icon: "size-6 text-on-surface-variant",
|
|
8043
|
-
avatar: "size-10 overflow-hidden rounded-full",
|
|
8044
|
-
checkbox: "",
|
|
8045
|
-
radio: ""
|
|
8046
|
-
};
|
|
8047
8610
|
var ListItemLeading = forwardRef(
|
|
8048
8611
|
function ListItemLeading2({ type, children, className }, ref) {
|
|
8049
8612
|
const isControl = type === "checkbox" || type === "radio";
|
|
8050
|
-
return /* @__PURE__ */ jsx(
|
|
8051
|
-
"div",
|
|
8052
|
-
{
|
|
8053
|
-
ref,
|
|
8054
|
-
className: cn("mr-4 flex shrink-0 items-center", typeClasses[type], className),
|
|
8055
|
-
children: isControl ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", tabIndex: -1, children }) : children
|
|
8056
|
-
}
|
|
8057
|
-
);
|
|
8613
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(listItemLeadingVariants({ type }), className), children: isControl ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", tabIndex: -1, children }) : children });
|
|
8058
8614
|
}
|
|
8059
8615
|
);
|
|
8060
8616
|
ListItemLeading.displayName = "ListItemLeading";
|
|
8061
|
-
var typeClasses2 = {
|
|
8062
|
-
icon: "size-6 text-on-surface-variant",
|
|
8063
|
-
text: "text-on-surface-variant text-label-small",
|
|
8064
|
-
checkbox: "",
|
|
8065
|
-
radio: ""
|
|
8066
|
-
};
|
|
8067
8617
|
var ListItemTrailing = forwardRef(
|
|
8068
8618
|
function ListItemTrailing2({ type, children, className }, ref) {
|
|
8069
8619
|
const isControl = type === "checkbox" || type === "radio";
|
|
8070
|
-
return /* @__PURE__ */ jsx(
|
|
8071
|
-
"div",
|
|
8072
|
-
{
|
|
8073
|
-
ref,
|
|
8074
|
-
className: cn("ml-auto flex shrink-0 items-center", typeClasses2[type], className),
|
|
8075
|
-
children: isControl ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", tabIndex: -1, children }) : children
|
|
8076
|
-
}
|
|
8077
|
-
);
|
|
8620
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(listItemTrailingVariants({ type }), className), children: isControl ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", tabIndex: -1, children }) : children });
|
|
8078
8621
|
}
|
|
8079
8622
|
);
|
|
8080
8623
|
ListItemTrailing.displayName = "ListItemTrailing";
|
|
8081
8624
|
var ListItemText = forwardRef(function ListItemText2({ headline, supportingText, overline, className }, ref) {
|
|
8082
8625
|
return /* @__PURE__ */ jsxs("div", { ref, className: cn("min-w-0 flex-1", className), children: [
|
|
8083
|
-
overline && /* @__PURE__ */ jsx("p", { className:
|
|
8084
|
-
/* @__PURE__ */ jsx("p", { className:
|
|
8085
|
-
supportingText && /* @__PURE__ */ jsx("p", { className:
|
|
8626
|
+
overline && /* @__PURE__ */ jsx("p", { className: cn(listItemOverlineVariants()), children: overline }),
|
|
8627
|
+
/* @__PURE__ */ jsx("p", { className: cn(listItemHeadlineVariants()), children: headline }),
|
|
8628
|
+
supportingText && /* @__PURE__ */ jsx("p", { className: cn(listItemSupportingTextVariants()), children: supportingText })
|
|
8086
8629
|
] });
|
|
8087
8630
|
});
|
|
8088
8631
|
ListItemText.displayName = "ListItemText";
|
|
@@ -8126,44 +8669,72 @@ var ListItem = forwardRef(function ListItem2({
|
|
|
8126
8669
|
}
|
|
8127
8670
|
);
|
|
8128
8671
|
}
|
|
8129
|
-
return /* @__PURE__ */
|
|
8130
|
-
|
|
8672
|
+
return /* @__PURE__ */ jsx(
|
|
8673
|
+
StaticStyledListItem,
|
|
8131
8674
|
{
|
|
8132
8675
|
ref: forwardedRef,
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
/* @__PURE__ */ jsx(
|
|
8146
|
-
ListItemText,
|
|
8147
|
-
{
|
|
8148
|
-
headline,
|
|
8149
|
-
...supportingText !== void 0 ? { supportingText } : {},
|
|
8150
|
-
...overline !== void 0 ? { overline } : {}
|
|
8151
|
-
}
|
|
8152
|
-
),
|
|
8153
|
-
trailingSlot && /* @__PURE__ */ jsx(ListItemTrailing, { type: trailingType ?? "icon", children: trailingSlot }),
|
|
8154
|
-
insetDivider && /* @__PURE__ */ jsx(
|
|
8155
|
-
Divider,
|
|
8156
|
-
{
|
|
8157
|
-
orientation: "horizontal",
|
|
8158
|
-
inset: "start",
|
|
8159
|
-
className: "absolute right-0 bottom-0 left-0"
|
|
8160
|
-
}
|
|
8161
|
-
)
|
|
8162
|
-
]
|
|
8676
|
+
value,
|
|
8677
|
+
headline,
|
|
8678
|
+
...supportingText !== void 0 ? { supportingText } : {},
|
|
8679
|
+
...overline !== void 0 ? { overline } : {},
|
|
8680
|
+
...leadingSlot !== void 0 ? { leadingSlot } : {},
|
|
8681
|
+
...leadingType !== void 0 ? { leadingType } : {},
|
|
8682
|
+
...trailingSlot !== void 0 ? { trailingSlot } : {},
|
|
8683
|
+
...trailingType !== void 0 ? { trailingType } : {},
|
|
8684
|
+
density,
|
|
8685
|
+
isDisabled,
|
|
8686
|
+
insetDivider,
|
|
8687
|
+
...className !== void 0 ? { className } : {}
|
|
8163
8688
|
}
|
|
8164
8689
|
);
|
|
8165
8690
|
});
|
|
8166
8691
|
ListItem.displayName = "ListItem";
|
|
8692
|
+
var StaticStyledListItem = forwardRef(
|
|
8693
|
+
function StaticStyledListItem2({
|
|
8694
|
+
headline,
|
|
8695
|
+
supportingText,
|
|
8696
|
+
overline,
|
|
8697
|
+
leadingSlot,
|
|
8698
|
+
leadingType,
|
|
8699
|
+
trailingSlot,
|
|
8700
|
+
trailingType,
|
|
8701
|
+
density,
|
|
8702
|
+
isDisabled,
|
|
8703
|
+
insetDivider,
|
|
8704
|
+
className
|
|
8705
|
+
}, ref) {
|
|
8706
|
+
return /* @__PURE__ */ jsxs(
|
|
8707
|
+
"li",
|
|
8708
|
+
{
|
|
8709
|
+
ref,
|
|
8710
|
+
role: "listitem",
|
|
8711
|
+
className: cn(listItemVariants({ density }), "group/list-item", className),
|
|
8712
|
+
...getInteractionDataAttributes({ isDisabled }),
|
|
8713
|
+
children: [
|
|
8714
|
+
leadingSlot && /* @__PURE__ */ jsx(ListItemLeading, { type: leadingType ?? "icon", children: leadingSlot }),
|
|
8715
|
+
/* @__PURE__ */ jsx(
|
|
8716
|
+
ListItemText,
|
|
8717
|
+
{
|
|
8718
|
+
headline,
|
|
8719
|
+
...supportingText !== void 0 ? { supportingText } : {},
|
|
8720
|
+
...overline !== void 0 ? { overline } : {}
|
|
8721
|
+
}
|
|
8722
|
+
),
|
|
8723
|
+
trailingSlot && /* @__PURE__ */ jsx(ListItemTrailing, { type: trailingType ?? "icon", children: trailingSlot }),
|
|
8724
|
+
insetDivider && /* @__PURE__ */ jsx(
|
|
8725
|
+
Divider,
|
|
8726
|
+
{
|
|
8727
|
+
orientation: "horizontal",
|
|
8728
|
+
inset: "start",
|
|
8729
|
+
className: "absolute right-0 bottom-0 left-0"
|
|
8730
|
+
}
|
|
8731
|
+
)
|
|
8732
|
+
]
|
|
8733
|
+
}
|
|
8734
|
+
);
|
|
8735
|
+
}
|
|
8736
|
+
);
|
|
8737
|
+
StaticStyledListItem.displayName = "StaticStyledListItem";
|
|
8167
8738
|
var InteractiveStyledListItem = forwardRef(
|
|
8168
8739
|
function InteractiveStyledListItem2({
|
|
8169
8740
|
value,
|
|
@@ -8181,36 +8752,36 @@ var InteractiveStyledListItem = forwardRef(
|
|
|
8181
8752
|
}, forwardedRef) {
|
|
8182
8753
|
const internalRef = useRef(null);
|
|
8183
8754
|
const ref = forwardedRef ?? internalRef;
|
|
8184
|
-
const { optionProps, isSelected, isDisabled } = useOption(
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8755
|
+
const { optionProps, isSelected, isDisabled, isPressed, isFocusVisible } = useOption(
|
|
8756
|
+
{ key: value },
|
|
8757
|
+
state,
|
|
8758
|
+
ref
|
|
8759
|
+
);
|
|
8760
|
+
const { isHovered, hoverProps } = useHover({ isDisabled });
|
|
8761
|
+
const { onMouseDown: handleRipple, ripples } = useRipple({ disabled: isDisabled });
|
|
8762
|
+
const mergedProps = mergeProps(optionProps, hoverProps, { onMouseDown: handleRipple });
|
|
8763
|
+
const hasLeading = !!leadingSlot;
|
|
8764
|
+
const hasTrailing = !!trailingSlot;
|
|
8189
8765
|
return /* @__PURE__ */ jsxs(
|
|
8190
8766
|
"li",
|
|
8191
8767
|
{
|
|
8192
8768
|
...mergedProps,
|
|
8193
8769
|
ref,
|
|
8194
|
-
className: cn(
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
"data-
|
|
8204
|
-
"data-
|
|
8770
|
+
className: cn(listItemVariants({ density }), "group/list-item", className),
|
|
8771
|
+
...getInteractionDataAttributes({
|
|
8772
|
+
isHovered,
|
|
8773
|
+
isFocusVisible,
|
|
8774
|
+
isPressed,
|
|
8775
|
+
isSelected,
|
|
8776
|
+
isDisabled
|
|
8777
|
+
}),
|
|
8778
|
+
"data-interactive": "",
|
|
8779
|
+
"data-with-leading": hasLeading ? "" : void 0,
|
|
8780
|
+
"data-with-trailing": hasTrailing ? "" : void 0,
|
|
8205
8781
|
children: [
|
|
8206
|
-
/* @__PURE__ */ jsx(
|
|
8207
|
-
"div",
|
|
8208
|
-
{
|
|
8209
|
-
"aria-hidden": "true",
|
|
8210
|
-
className: "bg-on-surface duration-short2 ease-standard pointer-events-none absolute inset-0 opacity-0 transition-opacity group-hover:opacity-8 group-active:opacity-12"
|
|
8211
|
-
}
|
|
8212
|
-
),
|
|
8213
8782
|
ripples,
|
|
8783
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn(listItemStateLayerVariants()) }),
|
|
8784
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn(listItemFocusRingVariants()) }),
|
|
8214
8785
|
leadingSlot && /* @__PURE__ */ jsx(ListItemLeading, { type: leadingType ?? "icon", children: leadingSlot }),
|
|
8215
8786
|
/* @__PURE__ */ jsx(
|
|
8216
8787
|
ListItemText,
|