sherick-ui 2.9.0 → 2.10.1
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 +32 -0
- package/dist/cjs/components/Accordion.cjs +14 -26
- package/dist/cjs/components/Accordion.cjs.map +1 -1
- package/dist/cjs/components/Alert.cjs +60 -19
- package/dist/cjs/components/Alert.cjs.map +1 -1
- package/dist/cjs/components/AlertDialog.cjs +5 -3
- package/dist/cjs/components/AlertDialog.cjs.map +1 -1
- package/dist/cjs/components/Avatar.cjs +12 -3
- package/dist/cjs/components/Avatar.cjs.map +1 -1
- package/dist/cjs/components/Badge.cjs +5 -3
- package/dist/cjs/components/Badge.cjs.map +1 -1
- package/dist/cjs/components/Breadcrumb.cjs +8 -4
- package/dist/cjs/components/Breadcrumb.cjs.map +1 -1
- package/dist/cjs/components/Button.cjs +11 -4
- package/dist/cjs/components/Button.cjs.map +1 -1
- package/dist/cjs/components/Calendar.cjs +39 -4
- package/dist/cjs/components/Calendar.cjs.map +1 -1
- package/dist/cjs/components/Card.cjs +10 -6
- package/dist/cjs/components/Card.cjs.map +1 -1
- package/dist/cjs/components/Checkbox.cjs +15 -3
- package/dist/cjs/components/Checkbox.cjs.map +1 -1
- package/dist/cjs/components/CheckboxGroup.cjs +3 -2
- package/dist/cjs/components/CheckboxGroup.cjs.map +1 -1
- package/dist/cjs/components/Chip.cjs +53 -43
- package/dist/cjs/components/Chip.cjs.map +1 -1
- package/dist/cjs/components/ChipGroup.cjs +17 -0
- package/dist/cjs/components/ChipGroup.cjs.map +1 -1
- package/dist/cjs/components/Collapsible.cjs +1 -1
- package/dist/cjs/components/Collapsible.cjs.map +1 -1
- package/dist/cjs/components/Combobox.cjs +58 -14
- package/dist/cjs/components/Combobox.cjs.map +1 -1
- package/dist/cjs/components/Command.cjs +10 -4
- package/dist/cjs/components/Command.cjs.map +1 -1
- package/dist/cjs/components/CommandPalette.cjs +5 -2
- package/dist/cjs/components/CommandPalette.cjs.map +1 -1
- package/dist/cjs/components/DatePicker.cjs +6 -3
- package/dist/cjs/components/DatePicker.cjs.map +1 -1
- package/dist/cjs/components/DateRangePicker.cjs +3 -2
- package/dist/cjs/components/DateRangePicker.cjs.map +1 -1
- package/dist/cjs/components/DateTimePicker.cjs +1 -1
- package/dist/cjs/components/DateTimePicker.cjs.map +1 -1
- package/dist/cjs/components/Dialog.cjs +10 -3
- package/dist/cjs/components/Dialog.cjs.map +1 -1
- package/dist/cjs/components/DialogContent.cjs +5 -3
- package/dist/cjs/components/DialogContent.cjs.map +1 -1
- package/dist/cjs/components/DialogDescription.cjs +5 -3
- package/dist/cjs/components/DialogDescription.cjs.map +1 -1
- package/dist/cjs/components/DialogFooter.cjs +3 -3
- package/dist/cjs/components/DialogFooter.cjs.map +1 -1
- package/dist/cjs/components/DialogHeader.cjs +5 -3
- package/dist/cjs/components/DialogHeader.cjs.map +1 -1
- package/dist/cjs/components/DialogSurface.cjs +37 -15
- package/dist/cjs/components/DialogSurface.cjs.map +1 -1
- package/dist/cjs/components/DismissButton.cjs +24 -0
- package/dist/cjs/components/DismissButton.cjs.map +1 -0
- package/dist/cjs/components/Divider.cjs +3 -1
- package/dist/cjs/components/Divider.cjs.map +1 -1
- package/dist/cjs/components/Drawer.cjs +24 -14
- package/dist/cjs/components/Drawer.cjs.map +1 -1
- package/dist/cjs/components/Field.cjs +47 -2
- package/dist/cjs/components/Field.cjs.map +1 -1
- package/dist/cjs/components/FieldLabel.cjs +20 -0
- package/dist/cjs/components/FieldLabel.cjs.map +1 -0
- package/dist/cjs/components/FileUpload.cjs +19 -9
- package/dist/cjs/components/FileUpload.cjs.map +1 -1
- package/dist/cjs/components/IconButton.cjs +28 -7
- package/dist/cjs/components/IconButton.cjs.map +1 -1
- package/dist/cjs/components/Input.cjs +14 -5
- package/dist/cjs/components/Input.cjs.map +1 -1
- package/dist/cjs/components/Menu.cjs +18 -4
- package/dist/cjs/components/Menu.cjs.map +1 -1
- package/dist/cjs/components/NavGroup.cjs +7 -1
- package/dist/cjs/components/NavGroup.cjs.map +1 -1
- package/dist/cjs/components/NavItem.cjs +28 -3
- package/dist/cjs/components/NavItem.cjs.map +1 -1
- package/dist/cjs/components/NumberField.cjs +7 -6
- package/dist/cjs/components/NumberField.cjs.map +1 -1
- package/dist/cjs/components/Pagination.cjs +42 -8
- package/dist/cjs/components/Pagination.cjs.map +1 -1
- package/dist/cjs/components/Popover.cjs +13 -5
- package/dist/cjs/components/Popover.cjs.map +1 -1
- package/dist/cjs/components/Progress.cjs +5 -3
- package/dist/cjs/components/Progress.cjs.map +1 -1
- package/dist/cjs/components/RadioGroup.cjs +3 -2
- package/dist/cjs/components/RadioGroup.cjs.map +1 -1
- package/dist/cjs/components/Search.cjs +35 -14
- package/dist/cjs/components/Search.cjs.map +1 -1
- package/dist/cjs/components/SegmentedControl.cjs +2 -1
- package/dist/cjs/components/SegmentedControl.cjs.map +1 -1
- package/dist/cjs/components/Select.cjs +14 -4
- package/dist/cjs/components/Select.cjs.map +1 -1
- package/dist/cjs/components/Skeleton.cjs +5 -3
- package/dist/cjs/components/Skeleton.cjs.map +1 -1
- package/dist/cjs/components/Slider.cjs +1 -1
- package/dist/cjs/components/Slider.cjs.map +1 -1
- package/dist/cjs/components/Spinner.cjs +24 -14
- package/dist/cjs/components/Spinner.cjs.map +1 -1
- package/dist/cjs/components/StatusMark.cjs +43 -0
- package/dist/cjs/components/StatusMark.cjs.map +1 -0
- package/dist/cjs/components/Stepper.cjs +3 -3
- package/dist/cjs/components/Stepper.cjs.map +1 -1
- package/dist/cjs/components/Switch.cjs +20 -1
- package/dist/cjs/components/Switch.cjs.map +1 -1
- package/dist/cjs/components/Table.cjs +15 -7
- package/dist/cjs/components/Table.cjs.map +1 -1
- package/dist/cjs/components/Tabs.cjs +10 -3
- package/dist/cjs/components/Tabs.cjs.map +1 -1
- package/dist/cjs/components/Textarea.cjs +8 -4
- package/dist/cjs/components/Textarea.cjs.map +1 -1
- package/dist/cjs/components/Toast.cjs +47 -34
- package/dist/cjs/components/Toast.cjs.map +1 -1
- package/dist/cjs/components/ToggleGroup.cjs +14 -3
- package/dist/cjs/components/ToggleGroup.cjs.map +1 -1
- package/dist/cjs/components/Tooltip.cjs +16 -2
- package/dist/cjs/components/Tooltip.cjs.map +1 -1
- package/dist/cjs/components/TreeView.cjs +8 -4
- package/dist/cjs/components/TreeView.cjs.map +1 -1
- package/dist/cjs/components/choice-row.cjs +1 -1
- package/dist/cjs/components/choice-row.cjs.map +1 -1
- package/dist/cjs/components/date-family.cjs +16 -2
- package/dist/cjs/components/date-family.cjs.map +1 -1
- package/dist/cjs/components/date-field.cjs +4 -2
- package/dist/cjs/components/date-field.cjs.map +1 -1
- package/dist/cjs/components/edge-fade.cjs +80 -0
- package/dist/cjs/components/edge-fade.cjs.map +1 -0
- package/dist/cjs/components/scroll-region.cjs +56 -0
- package/dist/cjs/components/scroll-region.cjs.map +1 -0
- package/dist/cjs/components/time-panel.cjs +1 -1
- package/dist/cjs/components/time-panel.cjs.map +1 -1
- package/dist/cjs/components/ui.common.cjs +115 -58
- package/dist/cjs/components/ui.common.cjs.map +1 -1
- package/dist/cjs/components/ui.motion.cjs +41 -15
- package/dist/cjs/components/ui.motion.cjs.map +1 -1
- package/dist/cjs/dev.cjs +5 -0
- package/dist/cjs/dev.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/components/Accordion.js +16 -28
- package/dist/esm/components/Accordion.js.map +1 -1
- package/dist/esm/components/Alert.js +62 -22
- package/dist/esm/components/Alert.js.map +1 -1
- package/dist/esm/components/AlertDialog.js +6 -4
- package/dist/esm/components/AlertDialog.js.map +1 -1
- package/dist/esm/components/Avatar.js +14 -5
- package/dist/esm/components/Avatar.js.map +1 -1
- package/dist/esm/components/Badge.js +5 -3
- package/dist/esm/components/Badge.js.map +1 -1
- package/dist/esm/components/Breadcrumb.js +9 -5
- package/dist/esm/components/Breadcrumb.js.map +1 -1
- package/dist/esm/components/Button.js +11 -4
- package/dist/esm/components/Button.js.map +1 -1
- package/dist/esm/components/Calendar.js +42 -7
- package/dist/esm/components/Calendar.js.map +1 -1
- package/dist/esm/components/Card.js +12 -8
- package/dist/esm/components/Card.js.map +1 -1
- package/dist/esm/components/Checkbox.js +16 -4
- package/dist/esm/components/Checkbox.js.map +1 -1
- package/dist/esm/components/CheckboxGroup.js +3 -2
- package/dist/esm/components/CheckboxGroup.js.map +1 -1
- package/dist/esm/components/Chip.js +56 -46
- package/dist/esm/components/Chip.js.map +1 -1
- package/dist/esm/components/ChipGroup.js +18 -1
- package/dist/esm/components/ChipGroup.js.map +1 -1
- package/dist/esm/components/CodeBlock.js +58 -28
- package/dist/esm/components/CodeBlock.js.map +1 -1
- package/dist/esm/components/Collapsible.js +1 -1
- package/dist/esm/components/Collapsible.js.map +1 -1
- package/dist/esm/components/Combobox.js +62 -18
- package/dist/esm/components/Combobox.js.map +1 -1
- package/dist/esm/components/Command.js +11 -5
- package/dist/esm/components/Command.js.map +1 -1
- package/dist/esm/components/CommandPalette.js +7 -4
- package/dist/esm/components/CommandPalette.js.map +1 -1
- package/dist/esm/components/DatePicker.js +7 -4
- package/dist/esm/components/DatePicker.js.map +1 -1
- package/dist/esm/components/DateRangePicker.js +4 -3
- package/dist/esm/components/DateRangePicker.js.map +1 -1
- package/dist/esm/components/DateTimePicker.js +1 -1
- package/dist/esm/components/DateTimePicker.js.map +1 -1
- package/dist/esm/components/Dialog.js +12 -6
- package/dist/esm/components/Dialog.js.map +1 -1
- package/dist/esm/components/DialogContent.js +6 -4
- package/dist/esm/components/DialogContent.js.map +1 -1
- package/dist/esm/components/DialogDescription.js +6 -4
- package/dist/esm/components/DialogDescription.js.map +1 -1
- package/dist/esm/components/DialogFooter.js +3 -3
- package/dist/esm/components/DialogFooter.js.map +1 -1
- package/dist/esm/components/DialogHeader.js +5 -3
- package/dist/esm/components/DialogHeader.js.map +1 -1
- package/dist/esm/components/DialogSurface.js +38 -17
- package/dist/esm/components/DialogSurface.js.map +1 -1
- package/dist/esm/components/DismissButton.js +20 -0
- package/dist/esm/components/DismissButton.js.map +1 -0
- package/dist/esm/components/Divider.js +3 -1
- package/dist/esm/components/Divider.js.map +1 -1
- package/dist/esm/components/Drawer.js +27 -17
- package/dist/esm/components/Drawer.js.map +1 -1
- package/dist/esm/components/Field.js +49 -6
- package/dist/esm/components/Field.js.map +1 -1
- package/dist/esm/components/FieldLabel.js +15 -0
- package/dist/esm/components/FieldLabel.js.map +1 -0
- package/dist/esm/components/FileUpload.js +23 -13
- package/dist/esm/components/FileUpload.js.map +1 -1
- package/dist/esm/components/IconButton.js +30 -9
- package/dist/esm/components/IconButton.js.map +1 -1
- package/dist/esm/components/Input.js +15 -6
- package/dist/esm/components/Input.js.map +1 -1
- package/dist/esm/components/Markdown.js +7 -4
- package/dist/esm/components/Markdown.js.map +1 -1
- package/dist/esm/components/Menu.js +20 -6
- package/dist/esm/components/Menu.js.map +1 -1
- package/dist/esm/components/NavGroup.js +8 -2
- package/dist/esm/components/NavGroup.js.map +1 -1
- package/dist/esm/components/NavItem.js +30 -6
- package/dist/esm/components/NavItem.js.map +1 -1
- package/dist/esm/components/NumberField.js +8 -7
- package/dist/esm/components/NumberField.js.map +1 -1
- package/dist/esm/components/Pagination.js +43 -9
- package/dist/esm/components/Pagination.js.map +1 -1
- package/dist/esm/components/Popover.js +14 -6
- package/dist/esm/components/Popover.js.map +1 -1
- package/dist/esm/components/Progress.js +5 -3
- package/dist/esm/components/Progress.js.map +1 -1
- package/dist/esm/components/RadioGroup.js +3 -2
- package/dist/esm/components/RadioGroup.js.map +1 -1
- package/dist/esm/components/Search.js +36 -15
- package/dist/esm/components/Search.js.map +1 -1
- package/dist/esm/components/SegmentedControl.js +2 -1
- package/dist/esm/components/SegmentedControl.js.map +1 -1
- package/dist/esm/components/Select.js +16 -6
- package/dist/esm/components/Select.js.map +1 -1
- package/dist/esm/components/Skeleton.js +5 -3
- package/dist/esm/components/Skeleton.js.map +1 -1
- package/dist/esm/components/Slider.js +2 -2
- package/dist/esm/components/Slider.js.map +1 -1
- package/dist/esm/components/Spinner.js +24 -14
- package/dist/esm/components/Spinner.js.map +1 -1
- package/dist/esm/components/StatusMark.js +38 -0
- package/dist/esm/components/StatusMark.js.map +1 -0
- package/dist/esm/components/Stepper.js +4 -4
- package/dist/esm/components/Stepper.js.map +1 -1
- package/dist/esm/components/Switch.js +21 -2
- package/dist/esm/components/Switch.js.map +1 -1
- package/dist/esm/components/Table.js +16 -8
- package/dist/esm/components/Table.js.map +1 -1
- package/dist/esm/components/Tabs.js +11 -4
- package/dist/esm/components/Tabs.js.map +1 -1
- package/dist/esm/components/Textarea.js +8 -4
- package/dist/esm/components/Textarea.js.map +1 -1
- package/dist/esm/components/Toast.js +49 -36
- package/dist/esm/components/Toast.js.map +1 -1
- package/dist/esm/components/ToggleGroup.js +16 -5
- package/dist/esm/components/ToggleGroup.js.map +1 -1
- package/dist/esm/components/Tooltip.js +17 -4
- package/dist/esm/components/Tooltip.js.map +1 -1
- package/dist/esm/components/TreeView.js +9 -5
- package/dist/esm/components/TreeView.js.map +1 -1
- package/dist/esm/components/choice-row.js +1 -1
- package/dist/esm/components/choice-row.js.map +1 -1
- package/dist/esm/components/date-family.js +15 -3
- package/dist/esm/components/date-family.js.map +1 -1
- package/dist/esm/components/date-field.js +5 -3
- package/dist/esm/components/date-field.js.map +1 -1
- package/dist/esm/components/edge-fade.js +77 -0
- package/dist/esm/components/edge-fade.js.map +1 -0
- package/dist/esm/components/scroll-region.js +52 -0
- package/dist/esm/components/scroll-region.js.map +1 -0
- package/dist/esm/components/time-panel.js +1 -1
- package/dist/esm/components/time-panel.js.map +1 -1
- package/dist/esm/components/ui.common.js +115 -60
- package/dist/esm/components/ui.common.js.map +1 -1
- package/dist/esm/components/ui.motion.js +39 -16
- package/dist/esm/components/ui.motion.js.map +1 -1
- package/dist/esm/content.js +1 -1
- package/dist/esm/dev.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/styles.css +326 -200
- package/dist/theme.css +15 -12
- package/dist/types/content.d.ts +13 -3
- package/dist/types/dev.d.cts +65 -30
- package/dist/types/dev.d.ts +65 -30
- package/dist/types/index.d.cts +502 -166
- package/dist/types/index.d.ts +502 -166
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cx } from '../libs/utils.js';
|
|
2
|
-
import { motionRim, motionFeedback,
|
|
2
|
+
import { motionStateLayer, motionRim, motionFeedback, motionRowLayer, motionDisclose } from './ui.motion.js';
|
|
3
3
|
|
|
4
4
|
/* Sherick UI design primitives
|
|
5
5
|
==========================================================================
|
|
@@ -66,8 +66,10 @@ import { motionRim, motionFeedback, motionStateLayer, motionRowLayer, motionDisc
|
|
|
66
66
|
trigger and an editable combobox field end up identical in every state: neither looks ringed at
|
|
67
67
|
rest, both look ringed the moment either is used, and both lose it together. `groupFocusRing`
|
|
68
68
|
draws it from the wrapping control instead of the track it contains. */
|
|
69
|
-
const focusRing = "focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-sherick-focus focus-visible:outline-offset-[3px]";
|
|
70
|
-
|
|
69
|
+
const focusRing = "focus:[outline-style:none] focus-visible:outline focus-visible:outline-2 focus-visible:outline-sherick-focus focus-visible:outline-offset-[3px]";
|
|
70
|
+
/* The inset ring is a box shadow, and forced colors removes every box shadow, so the same 2px ring
|
|
71
|
+
is drawn there as an inset outline instead, which the platform paints in a system colour. */
|
|
72
|
+
const focusRingInset = "focus:[outline-style:none] focus-visible:[outline-style:none] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sherick-focus forced-colors:focus-visible:outline forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-offset-[-2px]";
|
|
71
73
|
/* A focus owner that also contains a subtree paints the inset ring on its direct row only. */
|
|
72
74
|
const parentFocusRingInset = "[:focus-visible>&]:ring-2 [:focus-visible>&]:ring-inset [:focus-visible>&]:ring-sherick-focus";
|
|
73
75
|
/* The ring of a value control that is itself the focusable element: it wears it whenever it
|
|
@@ -75,7 +77,7 @@ const parentFocusRingInset = "[:focus-visible>&]:ring-2 [:focus-visible>&]:ring-
|
|
|
75
77
|
hands the DOM focus to its list while that list is open, so the ring follows the control's
|
|
76
78
|
engagement rather than the focus — which is exactly what a native `select` shows, and the only
|
|
77
79
|
focus indication the field has left once the list has taken over. */
|
|
78
|
-
const focusRingHeld = "focus:outline
|
|
80
|
+
const focusRingHeld = "focus:outline focus:outline-2 focus:outline-sherick-focus focus:outline-offset-[3px] data-[popup-open]:outline data-[popup-open]:outline-2 data-[popup-open]:outline-sherick-focus data-[popup-open]:outline-offset-[3px]";
|
|
79
81
|
/* The same ring for a value control whose focus lives in a borderless input inside it. It follows
|
|
80
82
|
**visible** focus rather than any focus, which is what makes a field and a slider differ for
|
|
81
83
|
the platform's reasons instead of by local say-so: a text field is `:focus-visible` whenever it
|
|
@@ -105,10 +107,16 @@ const groupFocusRing = "group-focus-visible:outline group-focus-visible:outline-
|
|
|
105
107
|
A passive surface is flat unless its anatomy is sunk by design: a well, a groove and
|
|
106
108
|
a code well are `recessed` while they sit there, and `flat` is the default for
|
|
107
109
|
everything else passive. A flat control never gains depth by being pressed. */
|
|
110
|
+
/* Forced colors removes shadows and tones, so a shell that separates from the page by depth alone
|
|
111
|
+
loses its boundary. Every shell that carries elevation draws its own system-coloured outline
|
|
112
|
+
there: `outline` is drawn in CanvasText by the platform and `outline-offset` pulls it onto the
|
|
113
|
+
border box, so it traces the object's own corner. The outline has no width in normal colors, so
|
|
114
|
+
it costs nothing on screen; `forced-colors:` is the only place it appears. */
|
|
115
|
+
const forcedBoundary = "forced-colors:outline forced-colors:outline-1 forced-colors:outline-offset-[-1px]";
|
|
108
116
|
const elevation = {
|
|
109
117
|
flat: "shadow-sherick-flat",
|
|
110
|
-
raised: "shadow-sherick-raised",
|
|
111
|
-
floating: "shadow-sherick-floating",
|
|
118
|
+
raised: /* @__PURE__ */ cx("shadow-sherick-raised", forcedBoundary),
|
|
119
|
+
floating: /* @__PURE__ */ cx("shadow-sherick-floating", forcedBoundary),
|
|
112
120
|
control: "shadow-sherick-control",
|
|
113
121
|
recessed: "shadow-sherick-recessed",
|
|
114
122
|
/* One rung further down: the depth a small selection mark sinks to while it is held. A mark
|
|
@@ -212,7 +220,7 @@ const edge = {
|
|
|
212
220
|
directional border class at the call site (`border-t`, `border-l`). */
|
|
213
221
|
rule: edgeTone.rule,
|
|
214
222
|
};
|
|
215
|
-
const effectiveDisabled = "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-45 disabled:cursor-not-allowed disabled:opacity-45";
|
|
223
|
+
const effectiveDisabled = "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-45 aria-disabled:cursor-not-allowed aria-disabled:opacity-45 disabled:cursor-not-allowed disabled:opacity-45";
|
|
216
224
|
/* Interaction states:
|
|
217
225
|
rest the material, at whatever elevation its anatomy calls for
|
|
218
226
|
hover one tonality step, never a change in depth or a new border
|
|
@@ -229,19 +237,26 @@ const state = {
|
|
|
229
237
|
it belongs with the tactile intent in `ui.motion.ts`. */
|
|
230
238
|
recess: "active:shadow-sherick-recessed",
|
|
231
239
|
/* The disabled step for a control whose disabled state is a Sherick prop. */
|
|
232
|
-
disabled: "cursor-not-allowed opacity-45",
|
|
240
|
+
disabled: "cursor-not-allowed opacity-45 aria-disabled:cursor-not-allowed aria-disabled:opacity-45",
|
|
241
|
+
/* A control that is busy is still working for the reader, so it is not dimmed: it keeps its full
|
|
242
|
+
strength and its cursor says work is happening. It stays focusable, and it takes no hover layer
|
|
243
|
+
and no press (`motionTactile` and the state layers withhold both on `aria-busy`). A busy
|
|
244
|
+
control is marked with `aria-busy="true"`, which is what Button and IconButton already carry. */
|
|
245
|
+
busy: "aria-busy:cursor-progress aria-busy:opacity-100",
|
|
233
246
|
/* The same step, keyed on the primitive's own markers rather than on a Sherick prop: Base marks
|
|
234
247
|
an effectively disabled control — including one disabled by the field around it — with
|
|
235
|
-
`data-disabled`, and a part that disables itself at a bound carries `disabled` as well.
|
|
248
|
+
`data-disabled`, and a part that disables itself at a bound carries `disabled` as well. A
|
|
249
|
+
control that stays focusable while disabled sets `aria-disabled="true"` instead, and it dims
|
|
250
|
+
exactly once, on the same step. */
|
|
236
251
|
effectiveDisabled,
|
|
237
252
|
/* A row whose control is disabled by any means — its own option, its group, or the field around
|
|
238
253
|
it — dims from the control's own marker rather than from a Sherick prop. */
|
|
239
|
-
disabledRow: "has-[[data-disabled]]:cursor-not-allowed has-[[data-disabled]]:opacity-45",
|
|
254
|
+
disabledRow: "has-[[data-disabled]]:cursor-not-allowed has-[[data-disabled]]:opacity-45 has-[[aria-disabled=true]]:cursor-not-allowed has-[[aria-disabled=true]]:opacity-45",
|
|
240
255
|
/* A control nested inside a disabled composite. The composite already applied the opacity step,
|
|
241
256
|
and a second one would dim the field unevenly; this carries only the disabled cursor. */
|
|
242
257
|
disabledDescendant: "cursor-not-allowed",
|
|
243
258
|
/* A part dims independently at a bound, but never a second time inside a disabled field. */
|
|
244
|
-
disabledPart: /* @__PURE__ */ cx(effectiveDisabled, "group-data-[disabled]/field:opacity-100"),
|
|
259
|
+
disabledPart: /* @__PURE__ */ cx(effectiveDisabled, "group-data-[disabled]/field:opacity-100 group-data-[disabled]/field:aria-disabled:opacity-100"),
|
|
245
260
|
/* A part the pointer is engaging — the handle of a value control. It sits matte and settled at
|
|
246
261
|
rest and takes its accent, a little larger, while the pointer is on it. Drag covers the case
|
|
247
262
|
where the pointer has been captured and left the control. */
|
|
@@ -250,6 +265,11 @@ const state = {
|
|
|
250
265
|
enabled: "cursor-pointer",
|
|
251
266
|
/* A text field: the normal text cursor, never a pointer. */
|
|
252
267
|
text: "cursor-text",
|
|
268
|
+
/* A muted label that is also a quiet target: it rests at `text.medium` and rises to `text.high` on
|
|
269
|
+
hover and on keyboard focus, with no state layer. A dismiss glyph or a secondary link takes it,
|
|
270
|
+
so the response is the ink itself rather than a tint behind it. Hover is a pointer response
|
|
271
|
+
(§11), so a touch screen only ever sees the focus step. */
|
|
272
|
+
quietInk: "text-sherick-ink-muted hover:text-sherick-ink focus-visible:text-sherick-ink",
|
|
253
273
|
/* Quiet scan feedback for non-interactive data rows: tonality only. */
|
|
254
274
|
rowHover: "hover:bg-sherick-ink/[0.05]",
|
|
255
275
|
/* The field family — one tray, one deeper step, no visible rims. Hover and engagement share the
|
|
@@ -313,29 +333,29 @@ const stateLayerBase = /* @__PURE__ */ cx("before:pointer-events-none before:abs
|
|
|
313
333
|
a suffix, because the stylesheet compiler reads class names as literal text: a name that only
|
|
314
334
|
exists once the recipe is evaluated compiles to no rule at all, and the step silently disappears.
|
|
315
335
|
Interpolating one of these consts is safe — the name is still written here in full. */
|
|
316
|
-
const hoverQuiet = "[&:not([data-disabled]):not(:disabled)]:hover:before:opacity-[0.05]";
|
|
317
|
-
const hoverTonal = "[&:not([data-disabled]):not(:disabled)]:hover:before:opacity-[0.09]";
|
|
318
|
-
const hoverFilled = "[&:not([data-disabled]):not(:disabled)]:hover:before:opacity-[0.18]";
|
|
319
|
-
const hoverTrack = "group-[:not([data-disabled]):not(:disabled)]:hover:before:opacity-[0.18]";
|
|
320
|
-
const pressQuiet = "[&:not([data-disabled]):not(:disabled)]:active:before:opacity-[0.09]";
|
|
321
|
-
const pressTonal = "[&:not([data-disabled]):not(:disabled)]:active:before:opacity-[0.15]";
|
|
336
|
+
const hoverQuiet = "[&:not([data-disabled]):not([aria-disabled=true]):not([aria-busy=true]):not(:disabled)]:hover:before:opacity-[0.05]";
|
|
337
|
+
const hoverTonal = "[&:not([data-disabled]):not([aria-disabled=true]):not([aria-busy=true]):not(:disabled)]:hover:before:opacity-[0.09]";
|
|
338
|
+
const hoverFilled = "[&:not([data-disabled]):not([aria-disabled=true]):not([aria-busy=true]):not(:disabled)]:hover:before:opacity-[0.18]";
|
|
339
|
+
const hoverTrack = "group-[:not([data-disabled]):not([aria-disabled=true]):not([aria-busy=true]):not(:disabled)]:hover:before:opacity-[0.18]";
|
|
340
|
+
const pressQuiet = "[&:not([data-disabled]):not([aria-disabled=true]):not([aria-busy=true]):not(:disabled)]:active:before:opacity-[0.09]";
|
|
341
|
+
const pressTonal = "[&:not([data-disabled]):not([aria-disabled=true]):not([aria-busy=true]):not(:disabled)]:active:before:opacity-[0.15]";
|
|
322
342
|
/* A neutral fill's label is ink, so a 15% ink veil turns the whole control a flat grey while it is
|
|
323
343
|
held — and the recess and the compression already say "pressed". The neutral press is lighter;
|
|
324
344
|
coloured fills keep the stronger step their labels were measured through. */
|
|
325
|
-
const pressTonalNeutral = "[&:not([data-disabled]):not(:disabled)]:active:before:opacity-[0.12]";
|
|
326
|
-
const pressFilled = "[&:not([data-disabled]):not(:disabled)]:active:before:opacity-[0.26]";
|
|
327
|
-
const pressTrack = "group-[:not([data-disabled]):not(:disabled)]:active:before:opacity-[0.26]";
|
|
345
|
+
const pressTonalNeutral = "[&:not([data-disabled]):not([aria-disabled=true]):not([aria-busy=true]):not(:disabled)]:active:before:opacity-[0.12]";
|
|
346
|
+
const pressFilled = "[&:not([data-disabled]):not([aria-disabled=true]):not([aria-busy=true]):not(:disabled)]:active:before:opacity-[0.26]";
|
|
347
|
+
const pressTrack = "group-[:not([data-disabled]):not([aria-disabled=true]):not([aria-busy=true]):not(:disabled)]:active:before:opacity-[0.26]";
|
|
328
348
|
/* A selection mark answers hover with the light tonal step: it is a 20px glyph beside its own
|
|
329
349
|
label, and the track's step would turn an empty well into a grey disc. Its press is depth, not
|
|
330
350
|
a heavier veil — `selectable.markSurface` sinks the well — so the layer only holds its hover
|
|
331
351
|
step while the pointer is down. A read-only mark accepts no change and advertises none.
|
|
332
352
|
The pseudo-class sits *inside* the group selector: written after it, as `…]:hover:`, it would
|
|
333
353
|
match the mark's own 20px box rather than the control and the row around it. */
|
|
334
|
-
const hoverMark = "group-[:not([data-disabled]):not([data-readonly]):not(:disabled):hover]:before:opacity-[0.09]";
|
|
354
|
+
const hoverMark = "[@media(hover:hover)_and_(pointer:fine)]:group-[:not([data-disabled]):not([data-readonly]):not([aria-disabled=true]):not(:disabled):hover]:before:opacity-[0.09]";
|
|
335
355
|
/* A labelled control surface paints its state on a row that owns the pointer area while the
|
|
336
356
|
actual disabled marker belongs to a descendant control. Gate the same quiet response on that
|
|
337
357
|
descendant so a disabled or read-only choice does not advertise a press it cannot accept. */
|
|
338
|
-
const stateLayerQuietComposite = /* @__PURE__ */ cx("relative", stateLayerBase, "before:rounded-[inherit] before:bg-current", "[&:not([data-disabled]):not([data-readonly]):not(:disabled):not(:has([data-disabled])):not(:has([data-readonly]))]:hover:before:opacity-[0.05]", "[&:not([data-disabled]):not([data-readonly]):not(:disabled):not(:has([data-disabled])):not(:has([data-readonly]))]:active:before:opacity-[0.09]");
|
|
358
|
+
const stateLayerQuietComposite = /* @__PURE__ */ cx("relative", stateLayerBase, "before:rounded-[inherit] before:bg-current", "[&:not([data-disabled]):not([data-readonly]):not([aria-disabled=true]):not([aria-busy=true]):not(:disabled):not(:has([data-disabled])):not(:has([data-readonly]))]:hover:before:opacity-[0.05]", "[&:not([data-disabled]):not([data-readonly]):not([aria-disabled=true]):not([aria-busy=true]):not(:disabled):not(:has([data-disabled])):not(:has([data-readonly]))]:active:before:opacity-[0.09]");
|
|
339
359
|
const stateLayer = {
|
|
340
360
|
/* Quiet surfaces — ghost controls, navigation rows, menu options. */
|
|
341
361
|
quiet: /* @__PURE__ */ cx("relative", stateLayerBase, "before:rounded-[inherit] before:bg-current", hoverQuiet, pressQuiet),
|
|
@@ -396,8 +416,8 @@ const hitArea = "relative after:pointer-events-auto after:absolute after:inset-[
|
|
|
396
416
|
takes the mid-emphasis tone, which inverts with the theme and separates in
|
|
397
417
|
both.
|
|
398
418
|
- acrylic: a translucent sheet lit from above, for surfaces that float above
|
|
399
|
-
the application. The gradient
|
|
400
|
-
|
|
419
|
+
the application. The gradient and fill are part of the material; it carries
|
|
420
|
+
no backdrop filter (see `acrylic` below). A gradient arrives as a typed image arbitrary value
|
|
401
421
|
rather than through the colour scale, because `tailwind-merge`
|
|
402
422
|
collapses two background utilities into one and would silently drop
|
|
403
423
|
either the fill or the gradient. Each one is written out literally, so
|
|
@@ -411,13 +431,13 @@ const hitArea = "relative after:pointer-events-auto after:absolute after:inset-[
|
|
|
411
431
|
- acrylicHero: the large-overlay sheet, for a surface that owns the viewport. It is
|
|
412
432
|
markedly more opaque and calmer than the smaller sheets: it has to
|
|
413
433
|
read first as a physical surface and only secondarily as glass, so the
|
|
414
|
-
scrim behind it does the separating,
|
|
434
|
+
scrim behind it does the separating, and the
|
|
415
435
|
gradient is a restrained top-to-bottom light rather than a frosted
|
|
416
436
|
haze. Its tone is a subtle step above the canvas in every theme —
|
|
417
437
|
in dark mode a small step above the canvas rather than a light grey
|
|
418
438
|
sheet — which is how it separates without leaning on its shadow, and
|
|
419
439
|
`--sui-overlay-fill` tunes how much of the sheet is its own tone rather
|
|
420
|
-
than the
|
|
440
|
+
than the page behind it — a large overlay leans on that, not on blur. */
|
|
421
441
|
const material = {
|
|
422
442
|
canvas: "bg-sherick-canvas text-sherick-ink",
|
|
423
443
|
matteQuiet: "bg-sherick-surface/[0.42] text-sherick-ink",
|
|
@@ -433,9 +453,13 @@ const material = {
|
|
|
433
453
|
already — so the error form is the same rule, in the tone the field is in. */
|
|
434
454
|
controlError: "bg-sherick-danger-soft text-sherick-ink placeholder:text-sherick-danger",
|
|
435
455
|
handle: "bg-sherick-ink-muted text-sherick-canvas",
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
456
|
+
/* The glass carries no backdrop filter. Every presence recipe animates the popup node itself, and a
|
|
457
|
+
backdrop filter on an animated node re-blurs the page on each frame (DL §12). The fill is 0.98 to
|
|
458
|
+
0.99 opaque, so the blur showed only one or two percent of what lay behind; the plane's scrim keeps
|
|
459
|
+
the blur where it is static. */
|
|
460
|
+
acrylic: "bg-sherick-surface-float/[var(--sui-glass-fill)] bg-[image:var(--sui-glass-gradient)] text-sherick-ink",
|
|
461
|
+
acrylicDense: "bg-sherick-surface-float/[var(--sui-glass-dense-fill)] bg-[image:var(--sui-glass-gradient-dense)] text-sherick-ink",
|
|
462
|
+
acrylicHero: "bg-sherick-surface-overlay/[var(--sui-overlay-fill)] bg-[image:var(--sui-glass-hero-gradient)] text-sherick-ink",
|
|
439
463
|
};
|
|
440
464
|
/* Dark neutral behind native video, including poster loading and letterboxing. */
|
|
441
465
|
const mediaCanvas = "bg-sherick-media";
|
|
@@ -466,12 +490,17 @@ const type = {
|
|
|
466
490
|
prominent: "text-lg",
|
|
467
491
|
},
|
|
468
492
|
label: "text-sm leading-5 font-medium",
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
493
|
+
/* Wrapping copy keeps its line breaks even: `text-pretty` stops a sentence ending on one word,
|
|
494
|
+
and a heading balances its own lines (`text-balance`). Both are CSS `text-wrap`, so no line is
|
|
495
|
+
forced and a short string is unchanged. */
|
|
496
|
+
body: "text-sm leading-6 text-pretty",
|
|
497
|
+
supporting: "text-[0.8125rem] leading-5 text-pretty",
|
|
498
|
+
caption: "text-xs leading-4 text-pretty",
|
|
499
|
+
title: "text-base leading-6 font-semibold tracking-[-0.011em] text-balance",
|
|
500
|
+
heading: "text-xl leading-7 font-semibold tracking-[-0.02em] text-balance",
|
|
501
|
+
/* Figures carry their own size: a table cell, a stepper value or a time reading is 14px tabular
|
|
502
|
+
copy wherever it sits, so a site composes this role and does not write its own `text-sm`. */
|
|
503
|
+
numeric: "text-sm leading-5 tabular-nums",
|
|
475
504
|
};
|
|
476
505
|
/* Density — three control steps plus the accessible hit target.
|
|
477
506
|
Density owns height and the type step, so controls of one density share a
|
|
@@ -547,7 +576,10 @@ const stacking = {
|
|
|
547
576
|
alert dialog separate from the page identically. */
|
|
548
577
|
const overlay = {
|
|
549
578
|
/* The plane behind a surface that owns the viewport. */
|
|
550
|
-
scrim: /* @__PURE__ */ cx("fixed inset-0", stacking.float, "
|
|
579
|
+
scrim: /* @__PURE__ */ cx("fixed inset-0", stacking.float, "backdrop-blur-[var(--sui-scrim-blur)] [@media(pointer:coarse)]:[backdrop-filter:none]",
|
|
580
|
+
/* The tint is the plane's `::before`, so `motionPresenceScrim` can fade it without animating the
|
|
581
|
+
node that carries the blur. */
|
|
582
|
+
"before:absolute before:inset-0 before:content-[''] before:bg-sherick-scrim/[0.30]"),
|
|
551
583
|
/* An anchored surface with room to breathe: a selection list (Select, Combobox) or
|
|
552
584
|
structured content (Popover). It grows out of its trigger and carries the softer
|
|
553
585
|
surface corner, because what it holds is read rather than scanned.
|
|
@@ -603,6 +635,14 @@ const detail = {
|
|
|
603
635
|
/** The same tone as a block, for a gutter or a rail with thickness. */
|
|
604
636
|
fill: "bg-sherick-detail",
|
|
605
637
|
};
|
|
638
|
+
/* The gap between a heading and the supporting line beneath it. It is applied to the supporting
|
|
639
|
+
line, never to the heading, and it is the only such gap: a header takes no paired padding on its
|
|
640
|
+
own edges. A title-role surface (a card, a popover, a toast, a command palette) takes 4px; a
|
|
641
|
+
dialog or drawer heading, which is the larger `heading` role, takes 8px. */
|
|
642
|
+
const headingRhythm = {
|
|
643
|
+
title: "mt-1",
|
|
644
|
+
heading: "mt-2",
|
|
645
|
+
};
|
|
606
646
|
/* A list surface — the sheet a collection of rows sits in, and the two row densities it can
|
|
607
647
|
hold. Select, Combobox and Menu all compose these, so an option and a command are the same
|
|
608
648
|
object at two densities instead of three independent designs.
|
|
@@ -625,6 +665,9 @@ const detail = {
|
|
|
625
665
|
performed", never "cannot be found". */
|
|
626
666
|
const list = {
|
|
627
667
|
sheet: "max-w-[var(--available-width)] max-h-[var(--available-height)] overflow-y-auto",
|
|
668
|
+
/* The leading mark of a command row: the 14px command text takes the compact slot, so the mark is
|
|
669
|
+
16px and sits in the same box every command's icon does. */
|
|
670
|
+
commandIcon: iconSlot.compact,
|
|
628
671
|
/* A row in a selection list: one line, read one at a time and chosen.
|
|
629
672
|
The row carries two separate things that both have to be visible. Its *navigation highlight*
|
|
630
673
|
is the state layer — one tone shared with the pointer, because a row under the pointer and a
|
|
@@ -639,7 +682,7 @@ const list = {
|
|
|
639
682
|
/* The option's start inset is the field's: a sheet's 8px inset plus the row's 12px puts every
|
|
640
683
|
option label on the same 20px edge as the value in the trigger that opened it, so the list
|
|
641
684
|
reads as the field opening rather than a second surface beside it. */
|
|
642
|
-
option: /* @__PURE__ */ cx("flex w-full items-center justify-between gap-4 px-3 py-3 text-start outline-none", type.control.normal, shape.control, motionFeedback, focusRingInset, text.high, stateLayer.quiet, stateLayer.activeRow, motionRowLayer, state.effectiveDisabled),
|
|
685
|
+
option: /* @__PURE__ */ cx("flex w-full items-center justify-between gap-4 px-3 py-3 text-start [outline-style:none]", type.control.normal, shape.control, motionFeedback, focusRingInset, text.high, stateLayer.quiet, stateLayer.activeRow, motionRowLayer, state.effectiveDisabled),
|
|
643
686
|
/* The heading of a group of options — a category above the channels filed under it. It is a
|
|
644
687
|
caption, not a row: it takes no state layer, no highlight and no focus, because the reader never
|
|
645
688
|
lands on it; the primitive names the group from it, so a screen reader hears the category as it
|
|
@@ -651,7 +694,7 @@ const list = {
|
|
|
651
694
|
rather than read and the list is a control rather than a page. `shape.row` keeps the
|
|
652
695
|
command's corner proportional to its own height, so its highlight nests in the tighter
|
|
653
696
|
sheet the menu is. */
|
|
654
|
-
command: /* @__PURE__ */ cx("flex w-full items-center gap-3 px-3 py-2 text-start outline-none", type.control.compact, shape.row, motionFeedback, focusRingInset, text.high, stateLayer.quiet, stateLayer.activeRow, motionRowLayer, state.effectiveDisabled),
|
|
697
|
+
command: /* @__PURE__ */ cx("flex w-full items-center gap-3 px-3 py-2 text-start [outline-style:none]", type.control.compact, shape.row, motionFeedback, focusRingInset, text.high, stateLayer.quiet, stateLayer.activeRow, motionRowLayer, state.effectiveDisabled),
|
|
655
698
|
};
|
|
656
699
|
/* A disclosure — one row that opens the region beneath it. An item in an `Accordion` and a
|
|
657
700
|
standalone `Collapsible` are the same object: a stacked row, and the in-flow panel its
|
|
@@ -660,15 +703,22 @@ const list = {
|
|
|
660
703
|
component maps its own primitive's panel variable onto, because the measured geometry is
|
|
661
704
|
anatomy and only the interpolation is temporal. */
|
|
662
705
|
const disclosure = {
|
|
663
|
-
/* The
|
|
664
|
-
|
|
665
|
-
|
|
706
|
+
/* The chevron of a disclosure row. The row's label is 15px, so the mark takes the normal slot
|
|
707
|
+
(20px); the row owns the affordance, so the chevron follows the whole row rather than the first
|
|
708
|
+
line of a wrapping label (§17). */
|
|
709
|
+
chevron: iconSlot.normal,
|
|
710
|
+
/* The row: a full-width row in a stacked group, activated like a selectable row. It hangs its 16px
|
|
711
|
+
inset past both edges of its column (§17), so its label and chevron share the edges of the content
|
|
712
|
+
beside it and only the fill reaches into the surface's padding. The panel hangs by the same amount,
|
|
713
|
+
so the label still shares an edge with the panel copy beneath it. Its own focus
|
|
666
714
|
indicator is the shared inset ring, because an offset one drawn outside the row would land on
|
|
667
715
|
the divider or the panel beside it rather than around the row it belongs to — which is the same
|
|
668
716
|
reason a segment inside a track takes the inset form. The chevron the component puts in the
|
|
669
717
|
row is the disclosure's own affordance and turns in place under `motionOrient`. */
|
|
670
|
-
trigger: /* @__PURE__ */ cx("group flex w-
|
|
671
|
-
panel
|
|
718
|
+
trigger: /* @__PURE__ */ cx("group -mx-4 flex w-[calc(100%+2rem)] items-center justify-between gap-4 px-4 py-3 text-start [outline-style:none] [overflow-wrap:anywhere]", type.control.normal, shape.control, motionFeedback, focusRingInset, text.high, stateLayer.quiet, stateLayer.activeRow, motionRowLayer, state.effectiveDisabled, state.enabled),
|
|
719
|
+
/* The panel hangs with the row and pads its copy back in, so its clip leaves the 16px a field's
|
|
720
|
+
focus ring inside it needs. */
|
|
721
|
+
panel: /* @__PURE__ */ cx("-mx-4 h-[var(--sui-disclose-height)] overflow-hidden [overflow-wrap:anywhere]", type.body, text.medium, motionDisclose),
|
|
672
722
|
};
|
|
673
723
|
/* Tone hierarchy — the color roles a surface can take, in rising strength:
|
|
674
724
|
text foreground only, for quiet rows and links.
|
|
@@ -760,15 +810,12 @@ const puck = "bg-sherick-puck";
|
|
|
760
810
|
/* A choice row — an opt-in `surface` row in a RadioGroup or CheckboxGroup — rests on the
|
|
761
811
|
`matteHigh` tray, so every choice in the group reads as a target before any is chosen; it stays
|
|
762
812
|
light enough that the empty mark's rim still clears 3:1 against it. The row that holds the
|
|
763
|
-
selection takes the role's *soft* surface and
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
outline. The selected step and a lift turned a whole card into an accent block, which outshouted
|
|
770
|
-
the priority action on the same view. */
|
|
771
|
-
const selectableRowSurface = /* @__PURE__ */ cx("has-[[data-checked]]:bg-sherick-primary-soft has-[[data-checked]]:text-sherick-ink", "after:pointer-events-none after:absolute after:inset-0 after:box-border after:rounded-[inherit] after:border-[1.5px] after:border-transparent after:content-['']", "has-[[data-checked]]:after:border-sherick-primary", motionRim);
|
|
813
|
+
selection takes the role's *soft* surface and stays flat. The mark it houses is what says "this
|
|
814
|
+
one": an accent rim around the row repeated it and made the chosen row the loudest object on a
|
|
815
|
+
quiet form, and the selected step and a lift turned a whole card into an accent block. The
|
|
816
|
+
transparent overlay stays, so forced colors keeps every row's outline, and the fill and the hover
|
|
817
|
+
layer still reach the row's real edge. */
|
|
818
|
+
const selectableRowSurface = /* @__PURE__ */ cx("has-[[data-checked]]:bg-sherick-primary-soft has-[[data-checked]]:text-sherick-ink", "after:pointer-events-none after:absolute after:inset-0 after:box-border after:rounded-[inherit] after:border-[1.5px] after:border-transparent after:content-['']");
|
|
772
819
|
/* Supporting copy inside such a row — a choice's description. `text.medium` clears 4.5:1 on the
|
|
773
820
|
soft step at rest (5.7:1 light, 6.2:1 dark), but the row's press layer composites toward the label
|
|
774
821
|
and takes that margin away, so while the row holds the selection its supporting line takes full
|
|
@@ -784,7 +831,7 @@ const selectable = {
|
|
|
784
831
|
does. While the wrapping control is held it sinks to the `well`: the floor darkens and the
|
|
785
832
|
boundary stays exactly where it was, which is how a mark that must not move under the pointer
|
|
786
833
|
answers a press. */
|
|
787
|
-
markSurface: /* @__PURE__ */ cx("relative", elevation.recessed, "group-[:not([data-disabled]):not([data-readonly]):not(:disabled):active]:shadow-sherick-well", motionFeedback),
|
|
834
|
+
markSurface: /* @__PURE__ */ cx("relative", elevation.recessed, "group-[:not([data-disabled]):not([data-readonly]):not([aria-disabled=true]):not(:disabled):active]:shadow-sherick-well", motionFeedback),
|
|
788
835
|
/* The resting fill a *groove* holds — a segmented control's track, a tab list — and nothing more.
|
|
789
836
|
A groove that holds labelled segments is identified by those segments, exactly as a tab list is
|
|
790
837
|
identified by its labels, so it takes no boundary of its own. */
|
|
@@ -800,7 +847,7 @@ const selectable = {
|
|
|
800
847
|
recess all reach the mark's real edge: a border would leave a 1.5px frame of untinted fill
|
|
801
848
|
around a hovered selected box. Hover steps the rim to the mid-emphasis tone — darker in light
|
|
802
849
|
mode, lighter in dark — which is a visible answer on a 20px mark where a tint alone is not. */
|
|
803
|
-
mark: /* @__PURE__ */ cx(markWellFill, text.medium, "after:pointer-events-none after:absolute after:inset-0 after:box-border after:rounded-[inherit] after:border-[1.5px] after:content-['']", "after:border-sherick-rim", "group-[:not([data-disabled]):not([data-readonly]):not(:disabled):hover]:after:border-sherick-ink-muted", motionRim),
|
|
850
|
+
mark: /* @__PURE__ */ cx(markWellFill, text.medium, "after:pointer-events-none after:absolute after:inset-0 after:box-border after:rounded-[inherit] after:border-[1.5px] after:content-['']", "after:border-sherick-rim", "[@media(hover:hover)_and_(pointer:fine)]:group-[:not([data-disabled]):not([data-readonly]):not(:disabled):hover]:after:border-sherick-ink-muted", motionRim),
|
|
804
851
|
/* A selected mark is the strong accent, edge to edge, and it settles flat: it is identified by
|
|
805
852
|
its fill and its glyph, and the rim fades out as the fill arrives. The rim fades by opacity
|
|
806
853
|
rather than by colour, so forced colors cannot repaint a transparent rim as a visible one. */
|
|
@@ -848,6 +895,11 @@ const recipeAlphas = {
|
|
|
848
895
|
neutralSoft: fillAlpha(tone.soft.secondary, "tint.neutralSoft"),
|
|
849
896
|
neutralRest: fillAlpha(tone.tonal.secondary, "tint.neutralRest"),
|
|
850
897
|
},
|
|
898
|
+
/* The code well is the `matteHigh` step over the card that holds it, so the contract reads its
|
|
899
|
+
alpha from the same recipe the CodeBlock renders. */
|
|
900
|
+
code: {
|
|
901
|
+
well: fillAlpha(material.matteHigh, "code.well"),
|
|
902
|
+
},
|
|
851
903
|
field: {
|
|
852
904
|
quiet: fillAlpha(material.matteQuiet, "field.quiet"),
|
|
853
905
|
card: fillAlpha(material.matte, "field.card"),
|
|
@@ -861,19 +913,22 @@ const recipeAlphas = {
|
|
|
861
913
|
};
|
|
862
914
|
/* A labelled field is a shrinkable column. Its explanatory copy wraps, including identifiers;
|
|
863
915
|
the input itself keeps its native single-line scrolling behavior. */
|
|
864
|
-
const fieldLayout = "flex min-w-0 w-full flex-col [overflow-wrap:anywhere]";
|
|
916
|
+
const fieldLayout = "flex min-w-0 w-full flex-col gap-2 [overflow-wrap:anywhere] [&>label+p]:-mt-1";
|
|
865
917
|
/* The messages under a field: its description or hint, and its error. One role for every field in
|
|
866
918
|
the family, so a hint reads the same under a text field, a date range and a file chooser. */
|
|
867
919
|
/* The label above a field: the `label` role at full ink, with the one gap every field family keeps
|
|
868
920
|
between its name and its control. */
|
|
869
|
-
const fieldLabel = /* @__PURE__ */ cx(
|
|
921
|
+
const fieldLabel = /* @__PURE__ */ cx(type.label, text.high);
|
|
922
|
+
/* The field column owns the gap between its parts (`fieldLayout`), so a label, a control and a
|
|
923
|
+
message are each eight pixels from the next, and a label that is followed straight by its
|
|
924
|
+
description takes four through the layout's sibling rule. No part carries its own margin. */
|
|
870
925
|
const fieldMessage = {
|
|
871
|
-
description: /* @__PURE__ */ cx(
|
|
872
|
-
error: /* @__PURE__ */ cx(
|
|
926
|
+
description: /* @__PURE__ */ cx(type.supporting, text.medium),
|
|
927
|
+
error: /* @__PURE__ */ cx(type.supporting, tone.text.danger),
|
|
873
928
|
};
|
|
874
929
|
/* The code well — the quiet recess a code block's lines sit in. It is the canvas showing through the
|
|
875
930
|
block's own matte shell, so a well reads as sunk into the block on a card and on the page alike. */
|
|
876
|
-
const codeWell =
|
|
931
|
+
const codeWell = material.matteHigh;
|
|
877
932
|
/* Rich-text accents — content-level emphasis in rendered prose, not structural edges: a quote's rule
|
|
878
933
|
on its start edge, and a link's underline at rest and under the pointer. */
|
|
879
934
|
const richText = {
|
|
@@ -881,5 +936,5 @@ const richText = {
|
|
|
881
936
|
linkUnderline: "decoration-sherick-primary/[0.35] hover:decoration-sherick-primary",
|
|
882
937
|
};
|
|
883
938
|
|
|
884
|
-
export { codeWell, currentDestination, density, detail, disclosure, edge, edgeTone, elevation, fieldLabel, fieldLayout, fieldMessage, focusRing, focusRingDrag, focusRingHeld, focusRingInset, focusRingWithin, groupFocusRing, hitArea, iconSlot, iconStroke, list, material, matteInset, mediaCanvas, overlay, parentFocusRingInset, puck, recessedTop, recipeAlphas, richText, rim, selectable, selectableRowSupporting, selectableRowSurface, shape, stacking, state, stateLayer, stateLayerQuietComposite, text, tone, type };
|
|
939
|
+
export { codeWell, currentDestination, density, detail, disclosure, edge, edgeTone, elevation, fieldLabel, fieldLayout, fieldMessage, focusRing, focusRingDrag, focusRingHeld, focusRingInset, focusRingWithin, forcedBoundary, groupFocusRing, headingRhythm, hitArea, iconSlot, iconStroke, list, material, matteInset, mediaCanvas, overlay, parentFocusRingInset, puck, recessedTop, recipeAlphas, richText, rim, selectable, selectableRowSupporting, selectableRowSurface, shape, stacking, state, stateLayer, stateLayerQuietComposite, text, tone, type };
|
|
885
940
|
//# sourceMappingURL=ui.common.js.map
|