@cueplusplus/ui 0.17.0 → 0.18.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/CHANGELOG.md +76 -0
- package/dist/chrome/empty-state.js +8 -4
- package/dist/chrome/navigation-menu.js +3 -2
- package/dist/chrome/panel.js +2 -1
- package/dist/chrome/row.js +4 -3
- package/dist/chrome/scroll-area.js +4 -3
- package/dist/chrome/segmented-control.js +2 -1
- package/dist/chrome/tabs.js +5 -2
- package/dist/chrome/toolbar.js +5 -3
- package/dist/date/_trigger.js +4 -1
- package/dist/date/calendar.js +15 -9
- package/dist/forms/_chassis.d.ts +10 -2
- package/dist/forms/_chassis.js +15 -5
- package/dist/forms/_listbox.js +18 -13
- package/dist/forms/checkbox.js +9 -6
- package/dist/forms/field.js +5 -5
- package/dist/forms/input-group.js +11 -2
- package/dist/forms/multi-select.js +4 -3
- package/dist/forms/number-field.js +6 -3
- package/dist/forms/otp-field.js +15 -6
- package/dist/forms/radio-group.js +7 -5
- package/dist/forms/select.js +8 -5
- package/dist/forms/slider.js +5 -3
- package/dist/forms/switch.js +6 -4
- package/dist/forms/tags-input.js +4 -3
- package/dist/forms/textarea.js +2 -1
- package/dist/forms/toggle-group.js +2 -1
- package/dist/forms/toggle.js +3 -1
- package/dist/instruments/meter.js +2 -1
- package/dist/instruments/progress.js +6 -3
- package/dist/instruments/stat.js +5 -3
- package/dist/instruments/table.js +3 -2
- package/dist/layout/_collapse.js +24 -8
- package/dist/layout/accordion.js +2 -1
- package/dist/layout/breadcrumb.js +8 -7
- package/dist/layout/card.js +2 -1
- package/dist/layout/collapsible.js +2 -1
- package/dist/layout/link.d.ts +14 -0
- package/dist/layout/link.js +4 -4
- package/dist/layout/pagination.js +7 -8
- package/dist/overlays/_surface.d.ts +4 -4
- package/dist/overlays/_surface.js +8 -7
- package/dist/overlays/alert-dialog.js +1 -1
- package/dist/overlays/command-palette.js +23 -8
- package/dist/overlays/dialog.js +1 -1
- package/dist/overlays/drawer.js +8 -1
- package/dist/overlays/hover-card.js +3 -1
- package/dist/overlays/popover.js +2 -1
- package/dist/overlays/toast.js +8 -4
- package/dist/overlays/tooltip.js +3 -4
- package/dist/primitives/avatar.js +6 -2
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.js +10 -7
- package/dist/primitives/chip.d.ts +0 -36
- package/dist/primitives/chip.js +14 -46
- package/dist/primitives/icon-button.d.ts +1 -1
- package/dist/primitives/kbd.js +2 -2
- package/dist/primitives/skeleton.js +2 -1
- package/dist/system/_style-accordion-rule.js +32 -0
- package/dist/system/_style-avatar.js +20 -0
- package/dist/system/_style-body-leading.js +1 -3
- package/dist/system/_style-body.js +7 -2
- package/dist/system/_style-caption-ink.js +17 -0
- package/dist/system/_style-caption-size.js +19 -0
- package/dist/system/_style-caption-weight.js +18 -0
- package/dist/system/_style-card-gap.js +14 -0
- package/dist/system/_style-cell.js +18 -0
- package/dist/system/_style-check-glyph.js +14 -0
- package/dist/system/_style-check.js +8 -1
- package/dist/system/_style-chip.js +41 -1
- package/dist/system/_style-choice-gap.js +15 -0
- package/dist/system/_style-collapse.js +81 -1
- package/dist/system/_style-control-gap.js +14 -0
- package/dist/system/_style-control-label.js +8 -1
- package/dist/system/_style-crumb.js +44 -0
- package/dist/system/_style-day.js +25 -0
- package/dist/system/_style-disabled.js +70 -0
- package/dist/system/_style-disclosure.js +21 -0
- package/dist/system/_style-empty-state.js +42 -0
- package/dist/system/_style-field-chassis.js +38 -0
- package/dist/system/_style-field-gap.js +12 -0
- package/dist/system/_style-glyph-ink.js +20 -0
- package/dist/system/_style-glyph-opacity.js +20 -0
- package/dist/system/_style-glyph-size.js +21 -0
- package/dist/system/_style-group-gap.js +15 -0
- package/dist/system/_style-group-label-pad.js +14 -0
- package/dist/system/_style-group-label.js +24 -0
- package/dist/system/_style-help.js +10 -1
- package/dist/system/_style-hover-card-width.js +15 -0
- package/dist/system/_style-kbd.js +13 -1
- package/dist/system/_style-link.js +15 -3
- package/dist/system/_style-menu.js +14 -1
- package/dist/system/_style-meter.js +15 -0
- package/dist/system/_style-nav-menu.js +48 -0
- package/dist/system/_style-option.js +61 -4
- package/dist/system/_style-otp.js +15 -0
- package/dist/system/_style-outline-hover.js +18 -0
- package/dist/system/_style-page.js +17 -0
- package/dist/system/_style-palette.js +18 -0
- package/dist/system/_style-panel.js +21 -0
- package/dist/system/_style-popover-width.js +15 -0
- package/dist/system/_style-radio.js +19 -0
- package/dist/system/_style-row-disabled.js +17 -0
- package/dist/system/_style-row.js +30 -0
- package/dist/system/_style-scrollbar.js +19 -0
- package/dist/system/_style-segment-pad.js +15 -0
- package/dist/system/_style-skeleton.js +15 -0
- package/dist/system/_style-slider.js +26 -0
- package/dist/system/_style-stat.js +31 -0
- package/dist/system/_style-stepper.js +16 -0
- package/dist/system/_style-switch.js +26 -0
- package/dist/system/_style-tab-hover.js +15 -0
- package/dist/system/_style-text-focus.js +26 -0
- package/dist/system/_style-toast.js +22 -0
- package/dist/system/_style-toggle.js +50 -0
- package/dist/system/_style-toolbar.js +23 -0
- package/dist/system/_style-tooltip.js +30 -1
- package/manifest/components/accordion.json +22 -1
- package/manifest/components/alert-dialog.json +7 -0
- package/manifest/components/app-bar.json +42 -0
- package/manifest/components/autocomplete.json +48 -1
- package/manifest/components/avatar-group.json +7 -0
- package/manifest/components/avatar.json +7 -0
- package/manifest/components/breadcrumb.json +7 -2
- package/manifest/components/button.json +16 -1
- package/manifest/components/calendar.json +6 -0
- package/manifest/components/card.json +1 -0
- package/manifest/components/channel-matrix.json +6 -0
- package/manifest/components/chart-tooltip-content.json +6 -0
- package/manifest/components/checkbox-group.json +22 -1
- package/manifest/components/checkbox.json +22 -1
- package/manifest/components/chip.json +6 -0
- package/manifest/components/collapsible.json +22 -0
- package/manifest/components/color-field.json +19 -0
- package/manifest/components/color-picker.json +19 -0
- package/manifest/components/combobox.json +48 -1
- package/manifest/components/command-palette.json +11 -0
- package/manifest/components/composer.json +19 -0
- package/manifest/components/context-menu.json +6 -0
- package/manifest/components/date-field.json +18 -0
- package/manifest/components/date-picker.json +22 -0
- package/manifest/components/date-range-picker.json +22 -0
- package/manifest/components/dialog.json +7 -0
- package/manifest/components/disclosure.json +22 -0
- package/manifest/components/dmx-bar.json +6 -0
- package/manifest/components/dmx-strip.json +6 -0
- package/manifest/components/drawer.json +7 -0
- package/manifest/components/dropdown-menu.json +6 -0
- package/manifest/components/empty-state.json +13 -0
- package/manifest/components/env-var-input.json +19 -0
- package/manifest/components/field-description.json +2 -1
- package/manifest/components/field-error.json +2 -1
- package/manifest/components/field-label.json +2 -1
- package/manifest/components/field.json +2 -1
- package/manifest/components/hover-card.json +8 -0
- package/manifest/components/input-group.json +21 -0
- package/manifest/components/input.json +19 -0
- package/manifest/components/kbd.json +2 -0
- package/manifest/components/link.json +23 -0
- package/manifest/components/menubar.json +6 -0
- package/manifest/components/meter.json +1 -0
- package/manifest/components/multi-select.json +49 -1
- package/manifest/components/musical-time-input.json +19 -0
- package/manifest/components/navigation-menu.json +16 -0
- package/manifest/components/number-field.json +21 -0
- package/manifest/components/otp-field.json +20 -0
- package/manifest/components/pagination.json +19 -0
- package/manifest/components/panel-header.json +3 -0
- package/manifest/components/panel.json +3 -0
- package/manifest/components/password-input.json +19 -0
- package/manifest/components/popover.json +7 -0
- package/manifest/components/progress.json +4 -0
- package/manifest/components/radio-group.json +6 -0
- package/manifest/components/radio.json +6 -0
- package/manifest/components/row.json +3 -0
- package/manifest/components/scroll-area.json +3 -1
- package/manifest/components/scrollable-tabs-list.json +3 -0
- package/manifest/components/scrub-input.json +19 -0
- package/manifest/components/seam-list.json +3 -0
- package/manifest/components/search-input.json +19 -0
- package/manifest/components/segmented-control.json +1 -0
- package/manifest/components/select.json +25 -0
- package/manifest/components/sheet.json +6 -0
- package/manifest/components/skeleton.json +2 -0
- package/manifest/components/slider.json +8 -0
- package/manifest/components/stat.json +8 -0
- package/manifest/components/switch.json +22 -0
- package/manifest/components/table-scroll-region.json +2 -0
- package/manifest/components/table.json +2 -0
- package/manifest/components/tabs.json +3 -0
- package/manifest/components/tags-input.json +49 -1
- package/manifest/components/textarea.json +19 -0
- package/manifest/components/theme-configurator.json +6 -0
- package/manifest/components/time-field.json +18 -0
- package/manifest/components/toast.json +9 -0
- package/manifest/components/toggle-group.json +2 -1
- package/manifest/components/toggle.json +28 -0
- package/manifest/components/toolbar.json +19 -0
- package/manifest/components/tooltip.json +11 -0
- package/manifest/fixtures.json +15 -0
- package/manifest/manifest.json +84 -84
- package/manifest/tokens.json +155 -1
- package/package.json +6 -6
package/dist/forms/field.js
CHANGED
|
@@ -7,8 +7,8 @@ import { LABEL_WEIGHT } from "../system/_style-label-weight.js";
|
|
|
7
7
|
import { LABEL_CASE } from "../system/_style-label-case.js";
|
|
8
8
|
import { LABEL_TRACKING_TIGHT } from "../system/_style-label-tracking.js";
|
|
9
9
|
import { LABEL_SIZE } from "../system/_style-label-size.js";
|
|
10
|
-
import {
|
|
11
|
-
import { HELP_INK, HELP_SIZE } from "../system/_style-help.js";
|
|
10
|
+
import { FIELD_GAP } from "../system/_style-field-gap.js";
|
|
11
|
+
import { HELP_INK, HELP_LEADING, HELP_LEADING_ERROR, HELP_SIZE } from "../system/_style-help.js";
|
|
12
12
|
import { LABEL_LEADING } from "../system/_style-label-leading.js";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -36,7 +36,7 @@ const Field$1 = React.forwardRef(function Field$2({ className, ...elementProps }
|
|
|
36
36
|
return /* @__PURE__ */ jsx(Field.Root, {
|
|
37
37
|
ref,
|
|
38
38
|
"data-slot": "field",
|
|
39
|
-
className: cn("flex w-full flex-col
|
|
39
|
+
className: cn("flex w-full flex-col", FIELD_GAP, className),
|
|
40
40
|
...elementProps
|
|
41
41
|
});
|
|
42
42
|
});
|
|
@@ -69,7 +69,7 @@ const FieldDescription = React.forwardRef(function FieldDescription({ className,
|
|
|
69
69
|
return /* @__PURE__ */ jsx(Field.Description, {
|
|
70
70
|
ref,
|
|
71
71
|
"data-slot": "field-description",
|
|
72
|
-
className: cn(LABEL_FACE, HELP_SIZE,
|
|
72
|
+
className: cn(LABEL_FACE, HELP_SIZE, HELP_LEADING, HELP_INK, BODY_WEIGHT, className),
|
|
73
73
|
...elementProps
|
|
74
74
|
});
|
|
75
75
|
});
|
|
@@ -88,7 +88,7 @@ const FieldDescription = React.forwardRef(function FieldDescription({ className,
|
|
|
88
88
|
*/
|
|
89
89
|
const FieldError = React.forwardRef(function FieldError({ className, issues, match, children, ...elementProps }, ref) {
|
|
90
90
|
if (issues !== void 0 && issues.length === 0) return null;
|
|
91
|
-
const classes = cn(LABEL_FACE, HELP_SIZE, "text-danger", BODY_WEIGHT, className);
|
|
91
|
+
const classes = cn(LABEL_FACE, HELP_SIZE, HELP_LEADING_ERROR, "text-danger", BODY_WEIGHT, className);
|
|
92
92
|
if (issues === void 0) return /* @__PURE__ */ jsx(Field.Error, {
|
|
93
93
|
ref,
|
|
94
94
|
"data-slot": "field-error",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { controlGroupFocusClasses, controlVariants } from "./_chassis.js";
|
|
4
|
+
import { GLYPH_INK_SUBTLE } from "../system/_style-glyph-ink.js";
|
|
5
|
+
import { GLYPH_OPACITY_SVG } from "../system/_style-glyph-opacity.js";
|
|
4
6
|
import * as React from "react";
|
|
5
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
//#region src/forms/input-group.tsx
|
|
@@ -12,6 +14,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
14
|
*/
|
|
13
15
|
const InputGroupContext = React.createContext(false);
|
|
14
16
|
/**
|
|
17
|
+
* A gutter: the glyph ink and opacity a set gives a control's glyphs
|
|
18
|
+
* (`style-glyph-ink`, `style-glyph-opacity`), falling back to the `fg-subtle`
|
|
19
|
+
* it drew. The opacity reaches only a glyph, not the text or `Kbd` a gutter
|
|
20
|
+
* may hold: coss.com/ui fades its addon's icons alone (P161.addon).
|
|
21
|
+
*/
|
|
22
|
+
const GUTTER_CLASSES = `flex shrink-0 items-center ${GLYPH_INK_SUBTLE} ${GLYPH_OPACITY_SVG}`;
|
|
23
|
+
/**
|
|
15
24
|
* A control and its adornments, drawn as a single field.
|
|
16
25
|
*
|
|
17
26
|
* The group — not the input — owns the chassis, so there is exactly one rim and
|
|
@@ -40,7 +49,7 @@ const InputGroup = React.forwardRef(function InputGroup({ className, leading, tr
|
|
|
40
49
|
children: [
|
|
41
50
|
leading === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
42
51
|
"data-slot": "input-group-leading",
|
|
43
|
-
className:
|
|
52
|
+
className: GUTTER_CLASSES,
|
|
44
53
|
children: leading
|
|
45
54
|
}),
|
|
46
55
|
/* @__PURE__ */ jsx(InputGroupContext.Provider, {
|
|
@@ -49,7 +58,7 @@ const InputGroup = React.forwardRef(function InputGroup({ className, leading, tr
|
|
|
49
58
|
}),
|
|
50
59
|
trailing === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
51
60
|
"data-slot": "input-group-trailing",
|
|
52
|
-
className:
|
|
61
|
+
className: GUTTER_CLASSES,
|
|
53
62
|
children: trailing
|
|
54
63
|
})
|
|
55
64
|
]
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { bareControlClasses, controlGroupFocusClasses, controlSurface } from "./_chassis.js";
|
|
4
|
+
import { GLYPH_SIZE } from "../system/_style-glyph-size.js";
|
|
4
5
|
import { useCuePortalProps } from "../system/portal.js";
|
|
5
6
|
import { CrossGlyph, TickGlyph } from "./_glyphs.js";
|
|
6
|
-
import { chipFieldClasses, chipRemoveClasses, listboxEmptyClasses, listboxIndicatorClasses, listboxItemClasses, listboxListClasses, listboxPopupClasses, listboxPositionerClasses, valueChipClasses } from "./_listbox.js";
|
|
7
|
+
import { chipFieldClasses, chipInputClasses, chipRemoveClasses, listboxEmptyClasses, listboxIndicatorClasses, listboxItemClasses, listboxListClasses, listboxPopupClasses, listboxPositionerClasses, valueChipClasses } from "./_listbox.js";
|
|
7
8
|
import * as React from "react";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import { Combobox } from "@base-ui/react/combobox";
|
|
@@ -59,7 +60,7 @@ const MultiSelect = React.forwardRef(function MultiSelect({ items, value, defaul
|
|
|
59
60
|
}), /* @__PURE__ */ jsx(Combobox.ChipRemove, {
|
|
60
61
|
"aria-label": removeLabel(item.label),
|
|
61
62
|
className: chipRemoveClasses,
|
|
62
|
-
children: /* @__PURE__ */ jsx(CrossGlyph, { className:
|
|
63
|
+
children: /* @__PURE__ */ jsx(CrossGlyph, { className: GLYPH_SIZE })
|
|
63
64
|
})]
|
|
64
65
|
}, item.value)), /* @__PURE__ */ jsx(Combobox.Input, {
|
|
65
66
|
ref,
|
|
@@ -68,7 +69,7 @@ const MultiSelect = React.forwardRef(function MultiSelect({ items, value, defaul
|
|
|
68
69
|
placeholder: selected.length > 0 ? "" : placeholder,
|
|
69
70
|
"aria-label": ariaLabel,
|
|
70
71
|
"aria-labelledby": ariaLabelledBy,
|
|
71
|
-
className: cn(bareControlClasses,
|
|
72
|
+
className: cn(bareControlClasses, chipInputClasses)
|
|
72
73
|
})] }) })
|
|
73
74
|
})
|
|
74
75
|
}), /* @__PURE__ */ jsx(Combobox.Portal, {
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { FOCUS_RING_INSET } from "../system/_focus-ring.js";
|
|
4
4
|
import { bareControlClasses, controlGroupFocusClasses, controlSurface } from "./_chassis.js";
|
|
5
|
+
import { GLYPH_INK_MUTED } from "../system/_style-glyph-ink.js";
|
|
6
|
+
import { STEPPER_WIDTH } from "../system/_style-stepper.js";
|
|
7
|
+
import { GLYPH_TEXT_SIZE } from "../system/_style-glyph-size.js";
|
|
5
8
|
import * as React from "react";
|
|
6
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
10
|
import { NumberField } from "@base-ui/react/number-field";
|
|
8
11
|
//#region src/forms/number-field.tsx
|
|
9
12
|
/** The − and + affordances: square, borderless, and quiet until hovered. */
|
|
10
|
-
const stepperClasses = `flex shrink-0 items-center justify-center border-0 bg-transparent p-0 font-mono
|
|
13
|
+
const stepperClasses = `flex shrink-0 items-center justify-center border-0 bg-transparent p-0 font-mono ${GLYPH_TEXT_SIZE} ${GLYPH_INK_MUTED} leading-none select-none outline-none transition-colors hover:bg-surface-2 hover:text-fg ${FOCUS_RING_INSET} data-[disabled]:pointer-events-none data-[disabled]:opacity-40`;
|
|
11
14
|
/**
|
|
12
15
|
* A numeric control with explicit − / + affordances and no native spinners.
|
|
13
16
|
*
|
|
@@ -39,7 +42,7 @@ const NumberField$1 = React.forwardRef(function NumberField$2({ className, size
|
|
|
39
42
|
children: [
|
|
40
43
|
/* @__PURE__ */ jsx(NumberField.Decrement, {
|
|
41
44
|
"aria-label": decrementLabel,
|
|
42
|
-
className: cn(stepperClasses, rung === "sm" ? "w-control-sm" :
|
|
45
|
+
className: cn(stepperClasses, rung === "sm" ? "w-control-sm" : STEPPER_WIDTH),
|
|
43
46
|
children: /* @__PURE__ */ jsx("span", {
|
|
44
47
|
"aria-hidden": "true",
|
|
45
48
|
children: "−"
|
|
@@ -52,7 +55,7 @@ const NumberField$1 = React.forwardRef(function NumberField$2({ className, size
|
|
|
52
55
|
}),
|
|
53
56
|
/* @__PURE__ */ jsx(NumberField.Increment, {
|
|
54
57
|
"aria-label": incrementLabel,
|
|
55
|
-
className: cn(stepperClasses, rung === "sm" ? "w-control-sm" :
|
|
58
|
+
className: cn(stepperClasses, rung === "sm" ? "w-control-sm" : STEPPER_WIDTH),
|
|
56
59
|
children: /* @__PURE__ */ jsx("span", {
|
|
57
60
|
"aria-hidden": "true",
|
|
58
61
|
children: "+"
|
package/dist/forms/otp-field.js
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { CONTROL_STEP_SIZE_BODY } from "../system/_style-control-step.js";
|
|
3
4
|
import { controlSurface } from "./_chassis.js";
|
|
5
|
+
import { OTP_GAP } from "../system/_style-otp.js";
|
|
4
6
|
import * as React from "react";
|
|
5
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
import { OTPField } from "@base-ui/react/otp-field";
|
|
7
9
|
//#region src/forms/otp-field.tsx
|
|
8
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* One square slot per rung of the control ladder. The width is spelt as the
|
|
12
|
+
* ladder's own variable, `w-(--cue-control-*)`, which `tailwind-merge` knows is a
|
|
13
|
+
* width and so drops the chassis's `w-full` for: it does not know the theme's
|
|
14
|
+
* `control-*` scale, so `size-control-*` beside the `w-auto` this used to add
|
|
15
|
+
* kept both, `w-auto` won the cascade, and every slot drew as wide as an empty
|
|
16
|
+
* input (round 6, P166.width).
|
|
17
|
+
*/
|
|
9
18
|
const SLOT_SIZES = {
|
|
10
|
-
sm: "
|
|
11
|
-
md:
|
|
12
|
-
lg: "
|
|
19
|
+
sm: "w-(--cue-control-sm) h-control-sm text-(length:--cue-text-ui)",
|
|
20
|
+
md: `w-(--cue-control-md) h-control-md ${CONTROL_STEP_SIZE_BODY}`,
|
|
21
|
+
lg: "w-(--cue-control-lg) h-control-lg text-(length:--cue-text-emphasis)"
|
|
13
22
|
};
|
|
14
23
|
/**
|
|
15
24
|
* A one-time code, one character per box.
|
|
@@ -30,14 +39,14 @@ const SLOT_SIZES = {
|
|
|
30
39
|
const OTPField$1 = React.forwardRef(function OTPField$2({ length = 6, size = "md", groupSize, separator = "–", "aria-label": ariaLabel, id, slotLabel = (index, total) => `Character ${index + 1} of ${total}`, className, slotClassName, ...elementProps }, ref) {
|
|
31
40
|
const generatedId = React.useId();
|
|
32
41
|
const fieldId = id ?? generatedId;
|
|
33
|
-
const slotClasses = cn(controlSurface, "
|
|
42
|
+
const slotClasses = cn(controlSurface, "p-0 text-center tabular-nums", SLOT_SIZES[size], slotClassName);
|
|
34
43
|
return /* @__PURE__ */ jsxs(OTPField.Root, {
|
|
35
44
|
ref,
|
|
36
45
|
id: fieldId,
|
|
37
46
|
length,
|
|
38
47
|
"aria-label": ariaLabel,
|
|
39
48
|
"data-slot": "otp-field",
|
|
40
|
-
className: cn(
|
|
49
|
+
className: cn(`relative flex items-center ${OTP_GAP}`, className),
|
|
41
50
|
...elementProps,
|
|
42
51
|
children: [ariaLabel === void 0 ? null : /* @__PURE__ */ jsx("label", {
|
|
43
52
|
htmlFor: fieldId,
|
|
@@ -3,7 +3,9 @@ import { cn } from "../lib/cn.js";
|
|
|
3
3
|
import { FOCUS_RING } from "../system/_focus-ring.js";
|
|
4
4
|
import { CONTROL_FACE } from "../system/_style-control-face.js";
|
|
5
5
|
import { LABEL_INK } from "../system/_style-label-ink.js";
|
|
6
|
-
import {
|
|
6
|
+
import { CHOICE_GAP } from "../system/_style-choice-gap.js";
|
|
7
|
+
import { CONTROL_LABEL_LEADING, CONTROL_LABEL_WEIGHT } from "../system/_style-control-label.js";
|
|
8
|
+
import { RADIO_CHECKED_GROUND, RADIO_DOT } from "../system/_style-radio.js";
|
|
7
9
|
import * as React from "react";
|
|
8
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
11
|
import { Radio } from "@base-ui/react/radio";
|
|
@@ -28,7 +30,7 @@ const RadioGroup$1 = React.forwardRef(function RadioGroup$2({ className, orienta
|
|
|
28
30
|
ref,
|
|
29
31
|
"data-slot": "radio-group",
|
|
30
32
|
"data-orientation": orientation,
|
|
31
|
-
className: cn("flex", orientation === "horizontal" ? "flex-row flex-wrap items-center gap-(--cue-space-5)" :
|
|
33
|
+
className: cn("flex", orientation === "horizontal" ? "flex-row flex-wrap items-center gap-(--cue-space-5)" : `flex-col ${CHOICE_GAP}`, className),
|
|
32
34
|
...elementProps
|
|
33
35
|
});
|
|
34
36
|
});
|
|
@@ -50,14 +52,14 @@ const Radio$1 = React.forwardRef(function Radio$2({ className, label, size = "md
|
|
|
50
52
|
ref,
|
|
51
53
|
"data-slot": "radio",
|
|
52
54
|
"aria-labelledby": hasLabel ? labelId : void 0,
|
|
53
|
-
className: cn("flex shrink-0 items-center justify-center rounded-full border border-border bg-sunken text-accent outline-none transition-colors", size === "sm" ? "size-icon-sm" : "size-icon-md", "hover:border-border-strong", "data-[checked]:border-accent", `${FOCUS_RING}`, "data-[disabled]:pointer-events-none data-[disabled]:opacity-40", "data-[invalid]:border-danger", className),
|
|
55
|
+
className: cn("flex shrink-0 items-center justify-center rounded-full border border-border bg-sunken text-accent outline-none transition-colors", size === "sm" ? "size-icon-sm" : "size-[var(--cue-style-check-size,var(--cue-icon-md))]", "hover:border-border-strong", "data-[checked]:border-accent", RADIO_CHECKED_GROUND, `${FOCUS_RING}`, "data-[disabled]:pointer-events-none data-[disabled]:opacity-40", "data-[invalid]:border-danger", className),
|
|
54
56
|
...elementProps,
|
|
55
|
-
children: /* @__PURE__ */ jsx(Radio.Indicator, { className:
|
|
57
|
+
children: /* @__PURE__ */ jsx(Radio.Indicator, { className: `block ${RADIO_DOT} rounded-full data-[unchecked]:hidden` })
|
|
56
58
|
});
|
|
57
59
|
if (!hasLabel) return dot;
|
|
58
60
|
return /* @__PURE__ */ jsxs("label", {
|
|
59
61
|
"data-slot": "radio-label",
|
|
60
|
-
className: cn("inline-flex cursor-pointer items-center gap-(--cue-space-3) text-(length:--cue-text-ui) select-none has-[[data-disabled]]:cursor-default has-[[data-disabled]]:opacity-40", LABEL_INK, CONTROL_LABEL_WEIGHT, CONTROL_FACE),
|
|
62
|
+
className: cn("inline-flex cursor-pointer items-center gap-(--cue-space-3) text-(length:--cue-text-ui) select-none has-[[data-disabled]]:cursor-default has-[[data-disabled]]:opacity-40", LABEL_INK, CONTROL_LABEL_WEIGHT, CONTROL_LABEL_LEADING, CONTROL_FACE),
|
|
61
63
|
children: [dot, /* @__PURE__ */ jsx("span", {
|
|
62
64
|
id: labelId,
|
|
63
65
|
children: label
|
package/dist/forms/select.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { CONTROL_FACE } from "../system/_style-control-face.js";
|
|
4
|
+
import { SELECT_HOVER_EDGE } from "../system/_style-field-chassis.js";
|
|
4
5
|
import { controlVariants } from "./_chassis.js";
|
|
6
|
+
import { GLYPH_INK_SUBTLE } from "../system/_style-glyph-ink.js";
|
|
7
|
+
import { GLYPH_OPACITY } from "../system/_style-glyph-opacity.js";
|
|
5
8
|
import { ELEVATION_2 } from "../system/_paint-elevation.js";
|
|
6
9
|
import { useCuePortalProps } from "../system/portal.js";
|
|
7
10
|
import { STROKE_SURFACE_2 } from "../system/_paint-stroke-surface-2.js";
|
|
8
11
|
import { CaretGlyph, TickGlyph } from "./_glyphs.js";
|
|
9
|
-
import { OPTION_ROW } from "../system/_style-option.js";
|
|
12
|
+
import { LISTBOX_PAD, OPTION_HEIGHT, OPTION_LEADING, OPTION_PAD, OPTION_ROW, OPTION_SELECTED_GROUND, OPTION_SELECTED_HIGHLIGHT_GROUND, OPTION_SELECTED_POINTER_GROUND } from "../system/_style-option.js";
|
|
10
13
|
import * as React from "react";
|
|
11
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
15
|
import { Select } from "@base-ui/react/select";
|
|
@@ -53,12 +56,12 @@ const Select$1 = React.forwardRef(function Select$2({ items, value, defaultValue
|
|
|
53
56
|
"data-slot": "select-trigger",
|
|
54
57
|
"aria-label": ariaLabel,
|
|
55
58
|
"aria-labelledby": ariaLabelledBy,
|
|
56
|
-
className: cn(controlVariants({ size }), "flex cursor-default items-center justify-between gap-(--cue-space-3) text-left",
|
|
59
|
+
className: cn(controlVariants({ size }), "flex cursor-default items-center justify-between gap-(--cue-space-3) text-left", SELECT_HOVER_EDGE, className),
|
|
57
60
|
children: [/* @__PURE__ */ jsx(Select.Value, {
|
|
58
61
|
className: "truncate data-[placeholder]:text-fg-subtle",
|
|
59
62
|
placeholder
|
|
60
63
|
}), /* @__PURE__ */ jsx(Select.Icon, {
|
|
61
|
-
className:
|
|
64
|
+
className: `flex shrink-0 items-center ${GLYPH_INK_SUBTLE} ${GLYPH_OPACITY}`,
|
|
62
65
|
children: /* @__PURE__ */ jsx(CaretGlyph, { className: "size-icon-md" })
|
|
63
66
|
})]
|
|
64
67
|
}), /* @__PURE__ */ jsx(Select.Portal, {
|
|
@@ -69,14 +72,14 @@ const Select$1 = React.forwardRef(function Select$2({ items, value, defaultValue
|
|
|
69
72
|
alignItemWithTrigger: false,
|
|
70
73
|
children: /* @__PURE__ */ jsx(Select.Popup, {
|
|
71
74
|
"data-slot": "select-popup",
|
|
72
|
-
className: cn(`min-w-(--anchor-width) origin-(--transform-origin) overflow-hidden rounded-overlay ${STROKE_SURFACE_2}
|
|
75
|
+
className: cn(`min-w-(--anchor-width) origin-(--transform-origin) overflow-hidden rounded-overlay ${STROKE_SURFACE_2} ${LISTBOX_PAD} ${ELEVATION_2} outline-none`, "transition-[opacity,scale] duration-100 ease-out motion-reduce:transition-none", "data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0", "data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0", popupClassName),
|
|
73
76
|
children: /* @__PURE__ */ jsx(Select.List, {
|
|
74
77
|
className: "max-h-(--available-height) overflow-y-auto",
|
|
75
78
|
children: items.map((item) => /* @__PURE__ */ jsxs(Select.Item, {
|
|
76
79
|
value: item.value,
|
|
77
80
|
disabled: item.disabled,
|
|
78
81
|
"data-slot": "select-item",
|
|
79
|
-
className: cn(
|
|
82
|
+
className: cn(`flex ${OPTION_HEIGHT} cursor-default items-center gap-(--cue-space-2) ${OPTION_PAD} text-(length:--cue-text-ui) ${OPTION_LEADING} outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40`, OPTION_ROW, OPTION_SELECTED_GROUND, OPTION_SELECTED_HIGHLIGHT_GROUND, OPTION_SELECTED_POINTER_GROUND, CONTROL_FACE),
|
|
80
83
|
children: [/* @__PURE__ */ jsx("span", {
|
|
81
84
|
className: "flex size-icon-sm shrink-0 items-center justify-center",
|
|
82
85
|
children: /* @__PURE__ */ jsx(Select.ItemIndicator, { children: /* @__PURE__ */ jsx(TickGlyph, { className: "size-icon-sm" }) })
|
package/dist/forms/slider.js
CHANGED
|
@@ -4,6 +4,8 @@ import { FOCUS_RING_OFFSET_2 } from "../system/_focus-ring.js";
|
|
|
4
4
|
import { LABEL_FACE } from "../system/_style-label-face.js";
|
|
5
5
|
import { LABEL_CASE } from "../system/_style-label-case.js";
|
|
6
6
|
import { LABEL_TRACKING_TIGHT } from "../system/_style-label-tracking.js";
|
|
7
|
+
import { SLIDER_THUMB_FILL, SLIDER_THUMB_RIM, SLIDER_THUMB_SIZE, SLIDER_TRACK_HEIGHT, SLIDER_TRACK_INK } from "../system/_style-slider.js";
|
|
8
|
+
import { CAPTION_SIZE_LABEL } from "../system/_style-caption-size.js";
|
|
7
9
|
import * as React from "react";
|
|
8
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
11
|
import { Slider } from "@base-ui/react/slider";
|
|
@@ -44,14 +46,14 @@ const Slider$1 = React.forwardRef(function Slider$2({ className, onCommit, label
|
|
|
44
46
|
className: cn("flex w-full flex-col gap-(--cue-space-2)", className),
|
|
45
47
|
...elementProps,
|
|
46
48
|
children: [label === void 0 && !showValue ? null : /* @__PURE__ */ jsxs("div", {
|
|
47
|
-
className: cn(
|
|
49
|
+
className: cn(`flex items-baseline justify-between gap-(--cue-space-3) ${CAPTION_SIZE_LABEL} text-fg-muted`, LABEL_FACE, LABEL_TRACKING_TIGHT, LABEL_CASE),
|
|
48
50
|
children: [label === void 0 ? /* @__PURE__ */ jsx("span", {}) : /* @__PURE__ */ jsx(Slider.Label, { children: label }), showValue ? /* @__PURE__ */ jsx(Slider.Value, { className: "tabular-nums text-fg normal-case tracking-normal" }) : null]
|
|
49
51
|
}), /* @__PURE__ */ jsx(Slider.Control, {
|
|
50
52
|
"data-slot": "slider-control",
|
|
51
53
|
className: "flex h-control-sm w-full touch-none items-center select-none",
|
|
52
54
|
children: /* @__PURE__ */ jsxs(Slider.Track, {
|
|
53
55
|
"data-slot": "slider-track",
|
|
54
|
-
className:
|
|
56
|
+
className: `relative ${SLIDER_TRACK_HEIGHT} w-full rounded-full ${SLIDER_TRACK_INK} select-none`,
|
|
55
57
|
children: [/* @__PURE__ */ jsx(Slider.Indicator, {
|
|
56
58
|
"data-slot": "slider-indicator",
|
|
57
59
|
className: "h-full rounded-full bg-accent select-none"
|
|
@@ -59,7 +61,7 @@ const Slider$1 = React.forwardRef(function Slider$2({ className, onCommit, label
|
|
|
59
61
|
index,
|
|
60
62
|
"data-slot": "slider-thumb",
|
|
61
63
|
"aria-label": ariaLabel === void 0 ? void 0 : count > 1 ? `${ariaLabel} ${index + 1}` : ariaLabel,
|
|
62
|
-
className:
|
|
64
|
+
className: `${SLIDER_THUMB_SIZE} rounded-full ${SLIDER_THUMB_FILL} ${SLIDER_THUMB_RIM} outline-none ${FOCUS_RING_OFFSET_2} data-[disabled]:opacity-40`
|
|
63
65
|
}, index))]
|
|
64
66
|
})
|
|
65
67
|
})]
|
package/dist/forms/switch.js
CHANGED
|
@@ -3,7 +3,9 @@ import { cn } from "../lib/cn.js";
|
|
|
3
3
|
import { FOCUS_RING } from "../system/_focus-ring.js";
|
|
4
4
|
import { CONTROL_FACE } from "../system/_style-control-face.js";
|
|
5
5
|
import { LABEL_INK } from "../system/_style-label-ink.js";
|
|
6
|
-
import { CONTROL_LABEL_WEIGHT } from "../system/_style-control-label.js";
|
|
6
|
+
import { CONTROL_LABEL_LEADING, CONTROL_LABEL_WEIGHT } from "../system/_style-control-label.js";
|
|
7
|
+
import { DATA_DISABLED_OPACITY, LABEL_DISABLED_INK, LABEL_DISABLED_OPACITY, SWITCH_DISABLED_TRACK } from "../system/_style-disabled.js";
|
|
8
|
+
import { SWITCH_EDGE, SWITCH_THUMB, SWITCH_THUMB_CHECKED, SWITCH_THUMB_DISABLED } from "../system/_style-switch.js";
|
|
7
9
|
import * as React from "react";
|
|
8
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
11
|
import { Switch } from "@base-ui/react/switch";
|
|
@@ -54,17 +56,17 @@ const Switch$1 = React.forwardRef(function Switch$2({ className, label, size = "
|
|
|
54
56
|
ref,
|
|
55
57
|
"data-slot": "switch",
|
|
56
58
|
"aria-labelledby": hasLabel ? labelId : void 0,
|
|
57
|
-
className: cn(
|
|
59
|
+
className: cn(`relative inline-flex shrink-0 items-center rounded-full border ${SWITCH_EDGE} bg-surface-3 p-0 outline-none transition-colors duration-150 motion-reduce:transition-none`, geometry.track, "data-[checked]:border-accent data-[checked]:bg-accent", `${FOCUS_RING}`, `data-[disabled]:pointer-events-none ${DATA_DISABLED_OPACITY} ${SWITCH_DISABLED_TRACK}`, "data-[invalid]:border-danger", className),
|
|
58
60
|
...elementProps,
|
|
59
61
|
children: /* @__PURE__ */ jsx(Switch.Thumb, {
|
|
60
62
|
"data-slot": "switch-thumb",
|
|
61
|
-
className: cn(
|
|
63
|
+
className: cn(`absolute top-1/2 left-px -translate-y-1/2 rounded-full ${SWITCH_THUMB} transition-transform duration-150 motion-reduce:transition-none`, geometry.thumb, SWITCH_THUMB_CHECKED, SWITCH_THUMB_DISABLED)
|
|
62
64
|
})
|
|
63
65
|
});
|
|
64
66
|
if (!hasLabel) return control;
|
|
65
67
|
return /* @__PURE__ */ jsxs("label", {
|
|
66
68
|
"data-slot": "switch-label",
|
|
67
|
-
className: cn("inline-flex cursor-pointer items-center gap-(--cue-space-3) text-(length:--cue-text-ui) select-none has-[[data-disabled]]:cursor-default
|
|
69
|
+
className: cn("inline-flex cursor-pointer items-center gap-(--cue-space-3) text-(length:--cue-text-ui) select-none has-[[data-disabled]]:cursor-default", LABEL_DISABLED_OPACITY, LABEL_INK, LABEL_DISABLED_INK, CONTROL_LABEL_WEIGHT, CONTROL_LABEL_LEADING, CONTROL_FACE),
|
|
68
70
|
children: [control, /* @__PURE__ */ jsx("span", {
|
|
69
71
|
id: labelId,
|
|
70
72
|
children: label
|
package/dist/forms/tags-input.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { bareControlClasses, controlGroupFocusClasses, controlSurface } from "./_chassis.js";
|
|
4
|
+
import { GLYPH_SIZE } from "../system/_style-glyph-size.js";
|
|
4
5
|
import { useCuePortalProps } from "../system/portal.js";
|
|
5
6
|
import { CrossGlyph } from "./_glyphs.js";
|
|
6
|
-
import { chipFieldClasses, chipRemoveClasses, listboxItemClasses, listboxListClasses, listboxPopupClasses, listboxPositionerClasses, valueChipClasses } from "./_listbox.js";
|
|
7
|
+
import { chipFieldClasses, chipInputClasses, chipRemoveClasses, listboxItemClasses, listboxListClasses, listboxPopupClasses, listboxPositionerClasses, valueChipClasses } from "./_listbox.js";
|
|
7
8
|
import * as React from "react";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import { Combobox } from "@base-ui/react/combobox";
|
|
@@ -106,7 +107,7 @@ const TagsInput = React.forwardRef(function TagsInput({ value, defaultValue, onV
|
|
|
106
107
|
}), /* @__PURE__ */ jsx(Combobox.ChipRemove, {
|
|
107
108
|
"aria-label": removeLabel(tag),
|
|
108
109
|
className: chipRemoveClasses,
|
|
109
|
-
children: /* @__PURE__ */ jsx(CrossGlyph, { className:
|
|
110
|
+
children: /* @__PURE__ */ jsx(CrossGlyph, { className: GLYPH_SIZE })
|
|
110
111
|
})]
|
|
111
112
|
}, tag)), /* @__PURE__ */ jsx(Combobox.Input, {
|
|
112
113
|
ref,
|
|
@@ -116,7 +117,7 @@ const TagsInput = React.forwardRef(function TagsInput({ value, defaultValue, onV
|
|
|
116
117
|
"aria-label": ariaLabel,
|
|
117
118
|
"aria-labelledby": ariaLabelledBy,
|
|
118
119
|
onKeyDown: handleKeyDown,
|
|
119
|
-
className: cn(bareControlClasses,
|
|
120
|
+
className: cn(bareControlClasses, chipInputClasses)
|
|
120
121
|
})] }) })
|
|
121
122
|
})
|
|
122
123
|
}), suggestions === void 0 ? null : /* @__PURE__ */ jsx(Combobox.Portal, {
|
package/dist/forms/textarea.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { FIELD_PAD_MD } from "../system/_style-field-chassis.js";
|
|
3
4
|
import { controlSurface } from "./_chassis.js";
|
|
4
5
|
import { TEXTAREA_LEADING, TEXTAREA_PAD_Y } from "../system/_style-textarea.js";
|
|
5
6
|
import * as React from "react";
|
|
@@ -30,7 +31,7 @@ const Textarea = React.forwardRef(function Textarea({ className, rows = 3, ...el
|
|
|
30
31
|
rows
|
|
31
32
|
}),
|
|
32
33
|
"data-slot": "textarea",
|
|
33
|
-
className: cn(controlSurface, `resize-y
|
|
34
|
+
className: cn(controlSurface, `resize-y ${FIELD_PAD_MD} ${TEXTAREA_PAD_Y} text-(length:--cue-text-ui) ${TEXTAREA_LEADING}`, className),
|
|
34
35
|
...controlProps
|
|
35
36
|
});
|
|
36
37
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { GROUP_GAP } from "../system/_style-group-gap.js";
|
|
3
4
|
import * as React from "react";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
@@ -44,7 +45,7 @@ const ToggleGroup$1 = React.forwardRef(function ToggleGroup$2({ value, defaultVa
|
|
|
44
45
|
defaultValue,
|
|
45
46
|
onValueChange: onValueChange === void 0 ? void 0 : handleValueChange,
|
|
46
47
|
orientation,
|
|
47
|
-
className: cn(
|
|
48
|
+
className: cn(`inline-flex items-center ${GROUP_GAP}`, orientation === "vertical" && "flex-col items-stretch", className),
|
|
48
49
|
...groupProps,
|
|
49
50
|
children: /* @__PURE__ */ jsx(ToggleGroupSizeContext.Provider, {
|
|
50
51
|
value: size,
|
package/dist/forms/toggle.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { FOCUS_RING } from "../system/_focus-ring.js";
|
|
4
4
|
import { CONTROL_FACE } from "../system/_style-control-face.js";
|
|
5
|
+
import { DATA_DISABLED_OPACITY } from "../system/_style-disabled.js";
|
|
5
6
|
import { cva } from "../lib/cva.js";
|
|
6
7
|
import { ToggleGroupSizeContext } from "./toggle-group.js";
|
|
8
|
+
import { TOGGLE_DISABLED, TOGGLE_EDGE, TOGGLE_HOVER_EDGE, TOGGLE_HOVER_GROUND, TOGGLE_HOVER_INK, TOGGLE_INK, TOGGLE_PRESSED_EDGE, TOGGLE_PRESSED_GROUND, TOGGLE_PRESSED_INK } from "../system/_style-toggle.js";
|
|
7
9
|
import * as React from "react";
|
|
8
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
11
|
import { Toggle } from "@base-ui/react/toggle";
|
|
@@ -14,7 +16,7 @@ import { Toggle } from "@base-ui/react/toggle";
|
|
|
14
16
|
* the highlighted menu row. A solid accent block on a 22px control reads as a
|
|
15
17
|
* second, louder button and drowns the labels beside it.
|
|
16
18
|
*/
|
|
17
|
-
const toggleVariants = cva(`inline-flex shrink-0 cursor-pointer select-none items-center justify-center gap-[0.4em] whitespace-nowrap rounded-control border
|
|
19
|
+
const toggleVariants = cva(`inline-flex shrink-0 cursor-pointer select-none items-center justify-center gap-[0.4em] whitespace-nowrap rounded-control border ${TOGGLE_EDGE} bg-transparent ${CONTROL_FACE} font-medium ${TOGGLE_INK} transition-colors duration-150 outline-none ${TOGGLE_HOVER_GROUND} ${TOGGLE_HOVER_INK} ${TOGGLE_HOVER_EDGE} ${FOCUS_RING} ${TOGGLE_PRESSED_GROUND} ${TOGGLE_PRESSED_EDGE} ${TOGGLE_PRESSED_INK} data-[disabled]:pointer-events-none ${DATA_DISABLED_OPACITY} ${TOGGLE_DISABLED}`, {
|
|
18
20
|
variants: {
|
|
19
21
|
size: {
|
|
20
22
|
sm: "text-(length:--cue-text-label)",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cn } from "../lib/cn.js";
|
|
2
2
|
import { toRem } from "./_rem.js";
|
|
3
|
+
import { METER_RADIUS } from "../system/_style-meter.js";
|
|
3
4
|
import * as React from "react";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
//#region src/instruments/meter.tsx
|
|
@@ -70,7 +71,7 @@ const Meter = React.forwardRef(function Meter({ className, percent, tone = "ok",
|
|
|
70
71
|
"data-provenance": provenance,
|
|
71
72
|
"data-empty": empty ? "true" : void 0,
|
|
72
73
|
"data-over-pace": overPace ? "true" : void 0,
|
|
73
|
-
className: cn(
|
|
74
|
+
className: cn(`relative w-full overflow-hidden ${METER_RADIUS} bg-surface-3`, TONE_CLASSES[tone], className),
|
|
74
75
|
style: {
|
|
75
76
|
height: toRem(height),
|
|
76
77
|
backgroundImage: trackImage,
|
|
@@ -2,7 +2,10 @@ import { cn } from "../lib/cn.js";
|
|
|
2
2
|
import { LABEL_FACE } from "../system/_style-label-face.js";
|
|
3
3
|
import { LABEL_CASE } from "../system/_style-label-case.js";
|
|
4
4
|
import { LABEL_TRACKING } from "../system/_style-label-tracking.js";
|
|
5
|
+
import { CAPTION_SIZE_LABEL } from "../system/_style-caption-size.js";
|
|
5
6
|
import { toRem } from "./_rem.js";
|
|
7
|
+
import { CAPTION_INK_MUTED, CAPTION_INK_SUBTLE } from "../system/_style-caption-ink.js";
|
|
8
|
+
import { CAPTION_WEIGHT } from "../system/_style-caption-weight.js";
|
|
6
9
|
import * as React from "react";
|
|
7
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
11
|
import { Progress } from "@base-ui/react/progress";
|
|
@@ -57,15 +60,15 @@ const Progress$1 = React.forwardRef(function Progress$2({ className, trackClassN
|
|
|
57
60
|
...rootProps,
|
|
58
61
|
children: [hasHeader ? /* @__PURE__ */ jsxs("div", {
|
|
59
62
|
"data-slot": "progress-header",
|
|
60
|
-
className: cn(
|
|
63
|
+
className: cn(`flex items-baseline gap-(--cue-space-3) ${CAPTION_SIZE_LABEL}`, LABEL_FACE),
|
|
61
64
|
children: [label === void 0 ? null : /* @__PURE__ */ jsx(Progress.Label, {
|
|
62
65
|
id: namedByCaption ? captionId : void 0,
|
|
63
66
|
"data-slot": "progress-label",
|
|
64
|
-
className: cn(
|
|
67
|
+
className: cn(`truncate ${CAPTION_INK_SUBTLE} ${CAPTION_WEIGHT}`, LABEL_TRACKING, LABEL_CASE),
|
|
65
68
|
children: label
|
|
66
69
|
}), showValue ? /* @__PURE__ */ jsx(Progress.Value, {
|
|
67
70
|
"data-slot": "progress-value",
|
|
68
|
-
className:
|
|
71
|
+
className: `ml-auto shrink-0 tabular-nums ${CAPTION_INK_MUTED}`
|
|
69
72
|
}) : null]
|
|
70
73
|
}) : null, /* @__PURE__ */ jsx(Progress.Track, {
|
|
71
74
|
"data-slot": "progress-track",
|
package/dist/instruments/stat.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { cn } from "../lib/cn.js";
|
|
2
2
|
import { LABEL_INK_SUBTLE } from "../system/_style-label-ink.js";
|
|
3
|
+
import { BODY_WEIGHT } from "../system/_style-body-weight.js";
|
|
3
4
|
import { LABEL_FACE } from "../system/_style-label-face.js";
|
|
4
5
|
import { LABEL_WEIGHT } from "../system/_style-label-weight.js";
|
|
5
6
|
import { LABEL_CASE } from "../system/_style-label-case.js";
|
|
6
7
|
import { LABEL_TRACKING } from "../system/_style-label-tracking.js";
|
|
7
8
|
import { LABEL_SIZE_MICRO } from "../system/_style-label-size.js";
|
|
8
9
|
import { DATA_FACE } from "../system/_style-data-face.js";
|
|
10
|
+
import { STAT_DETAIL_LEADING, STAT_DETAIL_SIZE, STAT_GAP, STAT_LEADING, STAT_SIZE, STAT_TRACKING, STAT_WEIGHT } from "../system/_style-stat.js";
|
|
9
11
|
import * as React from "react";
|
|
10
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
13
|
//#region src/instruments/stat.tsx
|
|
@@ -41,7 +43,7 @@ const Stat = React.forwardRef(function Stat({ className, label, value, detail, t
|
|
|
41
43
|
ref,
|
|
42
44
|
"data-slot": "stat",
|
|
43
45
|
"data-tone": tone,
|
|
44
|
-
className: cn("flex min-w-0 flex-col
|
|
46
|
+
className: cn("flex min-w-0 flex-col", STAT_GAP, className),
|
|
45
47
|
...elementProps,
|
|
46
48
|
children: [
|
|
47
49
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -51,12 +53,12 @@ const Stat = React.forwardRef(function Stat({ className, label, value, detail, t
|
|
|
51
53
|
}),
|
|
52
54
|
/* @__PURE__ */ jsx("span", {
|
|
53
55
|
"data-slot": "stat-value",
|
|
54
|
-
className: cn(`truncate ${DATA_FACE}
|
|
56
|
+
className: cn(`truncate ${DATA_FACE} ${STAT_SIZE} ${STAT_LEADING} ${STAT_WEIGHT} ${STAT_TRACKING} tabular-nums`, VALUE_TONE_CLASSES[tone]),
|
|
55
57
|
children: value
|
|
56
58
|
}),
|
|
57
59
|
detail === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
58
60
|
"data-slot": "stat-detail",
|
|
59
|
-
className: `truncate ${DATA_FACE}
|
|
61
|
+
className: `truncate ${DATA_FACE} ${STAT_DETAIL_SIZE} ${STAT_DETAIL_LEADING} ${BODY_WEIGHT} text-fg-muted`,
|
|
60
62
|
children: detail
|
|
61
63
|
})
|
|
62
64
|
]
|
|
@@ -8,6 +8,7 @@ import { LABEL_TRACKING } from "../system/_style-label-tracking.js";
|
|
|
8
8
|
import { LABEL_SIZE } from "../system/_style-label-size.js";
|
|
9
9
|
import { BODY_SIZE, BODY_SIZE_LABEL } from "../system/_style-body-size.js";
|
|
10
10
|
import { DATA_FACE } from "../system/_style-data-face.js";
|
|
11
|
+
import { CELL_LEADING, CELL_PAD } from "../system/_style-cell.js";
|
|
11
12
|
import { SELECTED_ROW } from "../system/_style-selected.js";
|
|
12
13
|
import { HELP_INK } from "../system/_style-help-ink.js";
|
|
13
14
|
import { ROW_PAD_Y } from "../system/_style-row-pad.js";
|
|
@@ -134,7 +135,7 @@ const TableHead = React.forwardRef(function TableHead({ className, numeric = fal
|
|
|
134
135
|
scope,
|
|
135
136
|
"data-slot": "table-head",
|
|
136
137
|
"data-numeric": numeric ? "" : void 0,
|
|
137
|
-
className: cn(`border-b border-border bg-surface-1
|
|
138
|
+
className: cn(`border-b border-border bg-surface-1 ${CELL_PAD} ${ROW_PAD_Y} text-left whitespace-nowrap`, LABEL_SIZE, LABEL_INK_SUBTLE, LABEL_WEIGHT_NORMAL, LABEL_FACE, LABEL_TRACKING, LABEL_CASE, sticky ? "sticky top-0 z-3 border-b-0 shadow-[inset_0_-1px_0_var(--cue-hair-strong)]" : null, className),
|
|
138
139
|
...elementProps
|
|
139
140
|
});
|
|
140
141
|
});
|
|
@@ -238,7 +239,7 @@ const Table = {
|
|
|
238
239
|
ref,
|
|
239
240
|
"data-slot": "table-cell",
|
|
240
241
|
"data-numeric": numeric ? "" : void 0,
|
|
241
|
-
className: cn(
|
|
242
|
+
className: cn(`${CELL_PAD} ${ROW_PAD_Y} ${CELL_LEADING} align-middle`, className),
|
|
242
243
|
...elementProps
|
|
243
244
|
});
|
|
244
245
|
}),
|
package/dist/layout/_collapse.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { FOCUS_RING_INSET_2 } from "../system/_focus-ring.js";
|
|
2
1
|
import { CONTROL_FACE } from "../system/_style-control-face.js";
|
|
3
|
-
import {
|
|
4
|
-
import { COLLAPSE_HEIGHT } from "../system/_style-collapse.js";
|
|
2
|
+
import { COLLAPSE_FOCUS_RING } from "../system/_style-text-focus.js";
|
|
3
|
+
import { COLLAPSE_BODY_FACE, COLLAPSE_BODY_INK, COLLAPSE_BODY_LEADING, COLLAPSE_BODY_PAD, COLLAPSE_BODY_SIZE, COLLAPSE_BODY_TRACKING, COLLAPSE_CARET_INK, COLLAPSE_CARET_OPACITY, COLLAPSE_CARET_SIZE, COLLAPSE_GAP, COLLAPSE_HEIGHT, COLLAPSE_HOVER_GROUND, COLLAPSE_HOVER_INK, COLLAPSE_LEADING, COLLAPSE_OPEN_INK, COLLAPSE_PAD, COLLAPSE_RADIUS, COLLAPSE_SIZE, COLLAPSE_WEIGHT } from "../system/_style-collapse.js";
|
|
5
4
|
import { QUIET_INK } from "../system/_style-quiet-ink.js";
|
|
6
5
|
//#region src/layout/_collapse.ts
|
|
7
6
|
/**
|
|
@@ -22,16 +21,25 @@ import { QUIET_INK } from "../system/_style-quiet-ink.js";
|
|
|
22
21
|
* `focus-visible:outline-solid` re-declares the outline style the sibling
|
|
23
22
|
* `outline-none` switched off — see the note on `buttonChassis`. The ring is
|
|
24
23
|
* inset (`-outline-offset-2`) because sections live inside `overflow-hidden`
|
|
25
|
-
* panels, where an outset ring on the first row would be clipped by the rim
|
|
24
|
+
* panels, where an outset ring on the first row would be clipped by the rim;
|
|
25
|
+
* a style set may move it (`style-text-focus-offset`, `_style-text-focus.ts`).
|
|
26
|
+
*
|
|
27
|
+
* Round 6 (spec §11, lane R6.T) reads the gutter, the gap, the hover and open
|
|
28
|
+
* inks and the ring's offset from the style set, each falling back to the
|
|
29
|
+
* class it replaced (`_style-collapse.ts`); lane R6.K adds the question's
|
|
30
|
+
* size and leading and the hover ground, and lane R6.Z its weight (falling back
|
|
31
|
+
* through the label weight to the `400` it drew), the same way.
|
|
26
32
|
*/
|
|
27
|
-
const collapseTriggerClasses = `group/collapse flex ${COLLAPSE_HEIGHT} w-full cursor-pointer items-center
|
|
33
|
+
const collapseTriggerClasses = `group/collapse flex ${COLLAPSE_HEIGHT} w-full cursor-pointer items-center ${COLLAPSE_GAP} ${COLLAPSE_PAD} ${COLLAPSE_RADIUS} text-left ${CONTROL_FACE} ${COLLAPSE_SIZE} ${COLLAPSE_LEADING} ${QUIET_INK} ${COLLAPSE_WEIGHT} transition-colors duration-150 outline-none select-none ${COLLAPSE_HOVER_INK} ${COLLAPSE_HOVER_GROUND} ${COLLAPSE_FOCUS_RING} ${COLLAPSE_OPEN_INK} data-[disabled]:pointer-events-none data-[disabled]:opacity-40`;
|
|
28
34
|
/** The label between the summary row's gutters — truncates, never wraps. */
|
|
29
35
|
const collapseLabelClasses = "min-w-0 flex-1 truncate";
|
|
30
36
|
/**
|
|
31
37
|
* The caret at the end of a summary row. Rotation is driven off the trigger's
|
|
32
38
|
* own `data-panel-open`, so nothing in React has to know the section is open.
|
|
39
|
+
* Its size and ink read the style set (round 6, lane R6.Z), falling back to
|
|
40
|
+
* the `icon-sm` and `fg-subtle` it drew.
|
|
33
41
|
*/
|
|
34
|
-
const collapseCaretClasses =
|
|
42
|
+
const collapseCaretClasses = `${COLLAPSE_CARET_SIZE} shrink-0 ${COLLAPSE_CARET_INK} ${COLLAPSE_CARET_OPACITY} transition-transform duration-150 ease-out group-data-[panel-open]/collapse:rotate-90 motion-reduce:transition-none`;
|
|
35
43
|
/**
|
|
36
44
|
* Enter/exit for a panel, animated from the height Base UI measures for us.
|
|
37
45
|
*
|
|
@@ -45,7 +53,15 @@ const PANEL_MOTION = "overflow-hidden transition-[height] duration-150 ease-out
|
|
|
45
53
|
const accordionPanelClasses = `${PANEL_MOTION} h-(--accordion-panel-height)`;
|
|
46
54
|
/** {@link PANEL_MOTION} against the collapsible's measured height. */
|
|
47
55
|
const collapsiblePanelClasses = `${PANEL_MOTION} h-(--collapsible-panel-height)`;
|
|
48
|
-
/**
|
|
49
|
-
|
|
56
|
+
/**
|
|
57
|
+
* The padded body inside a panel: aligned to the summary row's gutters, which
|
|
58
|
+
* a style set may move with the trigger's (`style-collapse-pad`), and padded
|
|
59
|
+
* top and bottom by `style-collapse-body-pad` (round 6, spec §11). Its voice
|
|
60
|
+
* reads the set (lanes R6.K and R6.Z): its face (the body face), size, leading
|
|
61
|
+
* and tracking, and its ink
|
|
62
|
+
* (`style-collapse-body-ink`), each falling back to the mono `text-ui` line in
|
|
63
|
+
* `fg-muted` it drew.
|
|
64
|
+
*/
|
|
65
|
+
const collapsePanelBodyClasses = `${COLLAPSE_PAD} ${COLLAPSE_BODY_PAD} ${COLLAPSE_BODY_FACE} ${COLLAPSE_BODY_SIZE} ${COLLAPSE_BODY_LEADING} ${COLLAPSE_BODY_TRACKING} ${COLLAPSE_BODY_INK}`;
|
|
50
66
|
//#endregion
|
|
51
67
|
export { accordionPanelClasses, collapseCaretClasses, collapseLabelClasses, collapsePanelBodyClasses, collapseTriggerClasses, collapsiblePanelClasses };
|