sherick-ui 2.11.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Badge.cjs +21 -2
- package/dist/cjs/components/Badge.cjs.map +1 -1
- package/dist/cjs/components/Card.cjs +3 -3
- package/dist/cjs/components/Card.cjs.map +1 -1
- package/dist/cjs/components/CheckboxGroup.cjs.map +1 -1
- package/dist/cjs/components/Chip.cjs +9 -6
- package/dist/cjs/components/Chip.cjs.map +1 -1
- package/dist/cjs/components/ChipGroup.cjs +21 -2
- package/dist/cjs/components/ChipGroup.cjs.map +1 -1
- package/dist/cjs/components/Combobox.cjs +4 -4
- package/dist/cjs/components/Combobox.cjs.map +1 -1
- package/dist/cjs/components/Command.cjs +1 -1
- package/dist/cjs/components/Command.cjs.map +1 -1
- package/dist/cjs/components/DatePicker.cjs +1 -1
- package/dist/cjs/components/DatePicker.cjs.map +1 -1
- package/dist/cjs/components/DateRangePicker.cjs +1 -1
- 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/Drawer.cjs +10 -4
- package/dist/cjs/components/Drawer.cjs.map +1 -1
- package/dist/cjs/components/Field.cjs +10 -0
- package/dist/cjs/components/Field.cjs.map +1 -1
- package/dist/cjs/components/Input.cjs +2 -2
- package/dist/cjs/components/Input.cjs.map +1 -1
- package/dist/cjs/components/NumberField.cjs +2 -2
- package/dist/cjs/components/NumberField.cjs.map +1 -1
- package/dist/cjs/components/RadioGroup.cjs.map +1 -1
- package/dist/cjs/components/Search.cjs +1 -1
- package/dist/cjs/components/Search.cjs.map +1 -1
- package/dist/cjs/components/Select.cjs +1 -1
- package/dist/cjs/components/Select.cjs.map +1 -1
- package/dist/cjs/components/Table.cjs +23 -5
- package/dist/cjs/components/Table.cjs.map +1 -1
- package/dist/cjs/components/Textarea.cjs +1 -1
- package/dist/cjs/components/Textarea.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-field.cjs +7 -4
- package/dist/cjs/components/date-field.cjs.map +1 -1
- package/dist/cjs/components/edge-fade.cjs +1 -1
- package/dist/cjs/components/edge-fade.cjs.map +1 -1
- package/dist/cjs/components/ui.common.cjs +100 -56
- package/dist/cjs/components/ui.common.cjs.map +1 -1
- package/dist/cjs/components/ui.motion.cjs +2 -3
- package/dist/cjs/components/ui.motion.cjs.map +1 -1
- package/dist/cjs/dev.cjs +4 -0
- package/dist/cjs/dev.cjs.map +1 -1
- package/dist/esm/components/Badge.js +22 -3
- package/dist/esm/components/Badge.js.map +1 -1
- package/dist/esm/components/Card.js +4 -4
- package/dist/esm/components/Card.js.map +1 -1
- package/dist/esm/components/CheckboxGroup.js.map +1 -1
- package/dist/esm/components/Chip.js +9 -6
- package/dist/esm/components/Chip.js.map +1 -1
- package/dist/esm/components/ChipGroup.js +22 -3
- package/dist/esm/components/ChipGroup.js.map +1 -1
- package/dist/esm/components/Combobox.js +6 -6
- package/dist/esm/components/Combobox.js.map +1 -1
- package/dist/esm/components/Command.js +2 -2
- package/dist/esm/components/Command.js.map +1 -1
- package/dist/esm/components/DatePicker.js +1 -1
- package/dist/esm/components/DatePicker.js.map +1 -1
- package/dist/esm/components/DateRangePicker.js +1 -1
- 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/Drawer.js +11 -5
- package/dist/esm/components/Drawer.js.map +1 -1
- package/dist/esm/components/Field.js +10 -1
- package/dist/esm/components/Field.js.map +1 -1
- package/dist/esm/components/Input.js +3 -3
- package/dist/esm/components/Input.js.map +1 -1
- package/dist/esm/components/NumberField.js +4 -4
- package/dist/esm/components/NumberField.js.map +1 -1
- package/dist/esm/components/RadioGroup.js.map +1 -1
- package/dist/esm/components/Search.js +2 -2
- package/dist/esm/components/Search.js.map +1 -1
- package/dist/esm/components/Select.js +2 -2
- package/dist/esm/components/Select.js.map +1 -1
- package/dist/esm/components/Table.js +24 -6
- package/dist/esm/components/Table.js.map +1 -1
- package/dist/esm/components/Textarea.js +2 -2
- package/dist/esm/components/Textarea.js.map +1 -1
- package/dist/esm/components/choice-row.js +2 -2
- package/dist/esm/components/choice-row.js.map +1 -1
- package/dist/esm/components/date-field.js +8 -5
- package/dist/esm/components/date-field.js.map +1 -1
- package/dist/esm/components/edge-fade.js +1 -1
- package/dist/esm/components/edge-fade.js.map +1 -1
- package/dist/esm/components/ui.common.js +98 -58
- package/dist/esm/components/ui.common.js.map +1 -1
- package/dist/esm/components/ui.motion.js +2 -3
- package/dist/esm/components/ui.motion.js.map +1 -1
- package/dist/esm/dev.js +1 -1
- package/dist/styles.css +149 -53
- package/dist/theme.css +40 -28
- package/dist/types/dev.d.cts +19 -7
- package/dist/types/dev.d.ts +19 -7
- package/dist/types/index.d.cts +59 -9
- package/dist/types/index.d.ts +59 -9
- package/package.json +5 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cx } from '../libs/utils.js';
|
|
2
|
-
import { motionStateLayer,
|
|
2
|
+
import { motionStateLayer, motionFeedback, motionRowLayer, motionRim, motionDisclose } from './ui.motion.js';
|
|
3
3
|
|
|
4
4
|
/* Sherick UI design primitives
|
|
5
5
|
==========================================================================
|
|
@@ -93,9 +93,10 @@ const groupFocusRing = "group-focus-visible:outline group-focus-visible:outline-
|
|
|
93
93
|
owns the timing and the reduced-motion behavior for it. A recipe in this module
|
|
94
94
|
interpolates one of those names; it never writes a duration, a curve, a transition or
|
|
95
95
|
an animation of its own. */
|
|
96
|
-
/* Elevation — distance from the surface plane, and nothing else.
|
|
97
|
-
exist, and
|
|
96
|
+
/* Elevation — distance from the surface plane, and nothing else. These depth roles
|
|
97
|
+
exist, and `control` and `recessed` are a single tactile pair:
|
|
98
98
|
- flat: at rest on the page. Separation comes from tone alone.
|
|
99
|
+
- resting: a card seated on the page by a close contact shadow, not lifted.
|
|
99
100
|
- raised: a manipulated control, lifted a hair above its own track so it feels
|
|
100
101
|
touchable; pressing it returns it to the track.
|
|
101
102
|
- floating: a surface that genuinely sits above the application.
|
|
@@ -104,25 +105,32 @@ const groupFocusRing = "group-focus-visible:outline group-focus-visible:outline-
|
|
|
104
105
|
- recessed: the other half of that pair: a groove, a track or a well, which is
|
|
105
106
|
recessed by definition, and a raised control while it is held, which
|
|
106
107
|
lands at the same depth.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
- mark, well: an empty selection mark's recess, and the rung it sinks to while held.
|
|
109
|
+
A passive surface is flat unless it is a card (`resting`) or its anatomy is sunk by
|
|
110
|
+
design: a well, a groove and a code well are `recessed` while they sit there, and
|
|
111
|
+
`flat` is the default for everything else passive. A flat control never gains depth
|
|
112
|
+
by being pressed. */
|
|
110
113
|
/* Forced colors removes shadows and tones, so a shell that separates from the page by depth alone
|
|
111
|
-
loses its boundary. Every shell
|
|
112
|
-
there: `outline` is drawn in CanvasText by the platform and `outline-offset` pulls it onto the
|
|
114
|
+
loses its boundary. Every lifted shell (`raised`, `floating`) draws its own system-coloured outline
|
|
115
|
+
there; a `resting` card does not, as a flat card never did: `outline` is drawn in CanvasText by the platform and `outline-offset` pulls it onto the
|
|
113
116
|
border box, so it traces the object's own corner. The outline has no width in normal colors, so
|
|
114
117
|
it costs nothing on screen; `forced-colors:` is the only place it appears. */
|
|
115
118
|
const forcedBoundary = "forced-colors:outline forced-colors:outline-1 forced-colors:outline-offset-[-1px]";
|
|
116
119
|
const elevation = {
|
|
117
120
|
flat: "shadow-sherick-flat",
|
|
121
|
+
/* A card at rest on the page: a close contact shadow that seats the sheet without lifting it. */
|
|
122
|
+
resting: "shadow-sherick-resting",
|
|
118
123
|
raised: /* @__PURE__ */ cx("shadow-sherick-raised", forcedBoundary),
|
|
119
124
|
floating: /* @__PURE__ */ cx("shadow-sherick-floating", forcedBoundary),
|
|
120
125
|
control: "shadow-sherick-control",
|
|
121
126
|
recessed: "shadow-sherick-recessed",
|
|
122
127
|
/* One rung further down: the depth a small selection mark sinks to while it is held. A mark
|
|
123
|
-
rests
|
|
128
|
+
rests at the `mark` rung; this is its press, never its identity. See
|
|
124
129
|
`selectable.markSurface`. */
|
|
125
130
|
well: "shadow-sherick-well",
|
|
131
|
+
/* An empty selection mark at rest: a recess stronger than `recessed`, for a 20px well that has
|
|
132
|
+
no rim and must be found by its depth. */
|
|
133
|
+
mark: "shadow-sherick-mark",
|
|
126
134
|
};
|
|
127
135
|
/* An inset sheet's shaded upper wall, without a lower rim. Kept independent so
|
|
128
136
|
unrelated components do not bundle this recipe. */
|
|
@@ -154,11 +162,17 @@ const recessedTop = "shadow-sherick-recessed-top";
|
|
|
154
162
|
also holds compact floating controls, and those must keep their softness.
|
|
155
163
|
- expressive: an expressive surface that owns the viewport — a dialog, tightened so it
|
|
156
164
|
reads as a focused surface rather than a pillowy one.
|
|
165
|
+
- tag: a subtle badge — a short label set inside a row of content, such as a reason in a
|
|
166
|
+
table cell. It labels the row rather than acting, so it is a rounded rectangle
|
|
167
|
+
and not a capsule: a run of pills in a navigable row reads as a row of buttons. Its
|
|
168
|
+
corner is under a third of its 20px height, like the `mark` box's, so it stays
|
|
169
|
+
clearly short of a capsule.
|
|
157
170
|
- pill: fully rounded controls whose width follows their content.
|
|
158
171
|
- circle: fully rounded square targets. */
|
|
159
172
|
const shape = {
|
|
160
173
|
control: "rounded-[0.75rem]",
|
|
161
174
|
mark: "rounded-[0.375rem]",
|
|
175
|
+
tag: "rounded-[0.375rem]",
|
|
162
176
|
row: "rounded-[0.5rem]",
|
|
163
177
|
prominent: "rounded-[1rem]",
|
|
164
178
|
surface: "rounded-[1.25rem]",
|
|
@@ -196,16 +210,18 @@ const edgeTone = {
|
|
|
196
210
|
chevron, a calendar glyph, a stepper — show what it is and where it is, which is how WCAG 1.4.11
|
|
197
211
|
lets a control be identified without a 3:1 edge. Its tray says "something goes here", and its
|
|
198
212
|
states ride on the tray and the focus ring (`state.field`). `rim.field` is therefore no visible
|
|
199
|
-
line: it is a
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
213
|
+
line: it is a border that exists under forced colors only, where the tray and its recess are
|
|
214
|
+
discarded and the border, in a system colour, gives the field its whole outline. In normal
|
|
215
|
+
colours a field has no border at all: an inset shadow starts at the padding edge, so even a
|
|
216
|
+
transparent border leaves a band of plain tray outside the recess, which reads as a double edge.
|
|
217
|
+
The scoped baseline sizes boxes by their border edge, so the border never changes a field's
|
|
218
|
+
footprint. An invalid field takes the same border.
|
|
203
219
|
A drop target's rim is dashed, and the dashes are a mask over an overlay rather than the native
|
|
204
220
|
`dashed` style, whose dash length and corner joins the platform decides: the mask fixes the dash
|
|
205
221
|
rhythm and follows the `control` corner exactly. The mask is authored in `tokens.ts`. */
|
|
206
222
|
const dashedRimMask = "after:[mask-image:var(--sui-rim-dashed)] after:[mask-size:100%_100%] after:[mask-repeat:no-repeat]";
|
|
207
223
|
const rim = {
|
|
208
|
-
field: "border-[1.5px]
|
|
224
|
+
field: "forced-colors:border-[1.5px]",
|
|
209
225
|
dashed: /* @__PURE__ */ cx("after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:content-['']", "after:bg-sherick-rim", dashedRimMask, motionRim),
|
|
210
226
|
/* The dashes step up under the pointer and take the primary tone while a file is held over them. */
|
|
211
227
|
dashedHover: "hover:after:bg-sherick-ink-muted",
|
|
@@ -220,6 +236,10 @@ const edge = {
|
|
|
220
236
|
directional border class at the call site (`border-t`, `border-l`). */
|
|
221
237
|
rule: edgeTone.rule,
|
|
222
238
|
};
|
|
239
|
+
/* A navigable row's press: the quiet press step, as a fill rather than a layer, because a table row
|
|
240
|
+
cannot hold a positioned overlay of its own in every engine. It outranks the row's hover step, which
|
|
241
|
+
compiles later inside its pointer media query, so a held press is not hidden by the hover under it. */
|
|
242
|
+
const rowPress = "[&&]:active:bg-sherick-ink/[0.09]";
|
|
223
243
|
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";
|
|
224
244
|
/* Interaction states:
|
|
225
245
|
rest the material, at whatever elevation its anatomy calls for
|
|
@@ -272,13 +292,20 @@ const state = {
|
|
|
272
292
|
quietInk: "text-sherick-ink-muted hover:text-sherick-ink focus-visible:text-sherick-ink",
|
|
273
293
|
/* Quiet scan feedback for non-interactive data rows: tonality only. */
|
|
274
294
|
rowHover: "hover:bg-sherick-ink/[0.05]",
|
|
295
|
+
/* A data row that leads somewhere — a table row whose link opens the record. It adds what a
|
|
296
|
+
navigable row needs beside `rowHover`: the pointer cursor, the same tint while keyboard focus is
|
|
297
|
+
inside the row, and the quiet press step, so a touch screen, which sees no hover, still answers.
|
|
298
|
+
The cursor and the press are only honest if the whole row opens, so the link or button in the
|
|
299
|
+
row's header cell stretches its hit area over the row (`rowTarget`). It stays square: the row
|
|
300
|
+
keeps its divider lines, and a fill with corners between two lines reads as a card. */
|
|
301
|
+
rowNavigable: /* @__PURE__ */ cx("cursor-pointer has-[:focus-visible]:bg-sherick-ink/[0.05]", rowPress),
|
|
275
302
|
/* The field family — one tray, one deeper step, no visible rims. Hover and engagement share the
|
|
276
303
|
deep step; a composite field engages its outer surface while the input inside stays borderless;
|
|
277
304
|
an expanded control holds the engaged step while its popup is open. Tonality and the focus ring
|
|
278
305
|
carry the state, so no border appears and disappears. */
|
|
279
|
-
/* A field is a
|
|
280
|
-
|
|
281
|
-
|
|
306
|
+
/* A field is a well: the light `tray` tone, sunk by `elevation.recessed`. It
|
|
307
|
+
draws no line: its label and content identify it (see `rim`), and the recess, not a heavy fill,
|
|
308
|
+
says "something goes here" on a card and on the page alike.
|
|
282
309
|
The pointer sinks it to the deep tray, and so does engagement — focus or an open popup — where
|
|
283
310
|
the focus ring is what says "this one is engaged"; an engaged field never falls back under the
|
|
284
311
|
pointer, because both states share the step. An invalid field is the danger tray — the role's
|
|
@@ -398,6 +425,11 @@ const stateLayer = {
|
|
|
398
425
|
CSS cannot see neighbouring geometry, so it keeps clearance only while surrounding rows are at
|
|
399
426
|
least as tall as that floor — which this library's own `density.normal` rhythm is, and a 40px
|
|
400
427
|
table row is not. */
|
|
428
|
+
/* A navigable row's target: the link or button in the row's header cell (`th scope="row"`) draws its hit
|
|
429
|
+
area over the whole row, so a press anywhere in the row opens what the row names. The row is the
|
|
430
|
+
positioned box the area fills. Any other control in the row's data cells stays above that area and
|
|
431
|
+
keeps its own press. The link keeps its own focus ring; the area paints nothing. */
|
|
432
|
+
const rowTarget = "relative [&>th[scope=row]_:is(a,button)]:after:absolute [&>th[scope=row]_:is(a,button)]:after:inset-0 [&>th[scope=row]_:is(a,button)]:after:content-[''] [&>td_:is(a,button,input,select,textarea,[tabindex])]:relative [&>td_:is(a,button,input,select,textarea,[tabindex])]:z-[1]";
|
|
401
433
|
const hitArea = "relative after:pointer-events-auto after:absolute after:inset-[min(0px,calc((100%-2.75rem)/2))] after:content-['']";
|
|
402
434
|
/* Material — fill only. No material carries elevation or a rim: the same matte
|
|
403
435
|
fill appears flat in a card, lifted on a button and recessed in a groove.
|
|
@@ -409,8 +441,9 @@ const hitArea = "relative after:pointer-events-auto after:absolute after:inset-[
|
|
|
409
441
|
- matteInset: a passive sheet tucked under a stronger control; subdued without
|
|
410
442
|
blending into the canvas or needing a drawn rim.
|
|
411
443
|
- control: the fill every text control shares, plus its placeholder tone: an opaque tray
|
|
412
|
-
in the `
|
|
413
|
-
label and content, not a drawn edge, are what
|
|
444
|
+
in the `tray` tone, which a field sinks with `elevation.recessed`. The well says
|
|
445
|
+
"something goes here"; the field's label and content, not a drawn edge, are what
|
|
446
|
+
identify it (see `rim`).
|
|
414
447
|
- handle: the fill of a small part the user has to find — a value control's handle.
|
|
415
448
|
Surface steps sit within a few percent of their neighbours, so this role
|
|
416
449
|
takes the mid-emphasis tone, which inverts with the theme and separates in
|
|
@@ -441,9 +474,9 @@ const hitArea = "relative after:pointer-events-auto after:absolute after:inset-[
|
|
|
441
474
|
const material = {
|
|
442
475
|
canvas: "bg-sherick-canvas text-sherick-ink",
|
|
443
476
|
matteQuiet: "bg-sherick-surface/[0.42] text-sherick-ink",
|
|
444
|
-
matte: "bg-sherick-surface
|
|
477
|
+
matte: "bg-sherick-surface text-sherick-ink",
|
|
445
478
|
matteHigh: "bg-sherick-surface-high/[0.72] text-sherick-ink",
|
|
446
|
-
control: "bg-sherick-
|
|
479
|
+
control: "bg-sherick-tray text-sherick-ink placeholder:text-sherick-ink-muted",
|
|
447
480
|
/* The invalid fill carries its placeholder at the *full* danger tone, not at a fraction of it. A
|
|
448
481
|
placeholder is text, so it answers to the same 4.5:1 the copy beside it does, and a partial
|
|
449
482
|
opacity of an accent is a different colour from the accent: the 72%-opacity placeholder
|
|
@@ -461,6 +494,11 @@ const material = {
|
|
|
461
494
|
acrylicDense: "bg-sherick-surface-float/[var(--sui-glass-dense-fill)] bg-[image:var(--sui-glass-gradient-dense)] text-sherick-ink",
|
|
462
495
|
acrylicHero: "bg-sherick-surface-overlay/[var(--sui-overlay-fill)] bg-[image:var(--sui-glass-hero-gradient)] text-sherick-ink",
|
|
463
496
|
};
|
|
497
|
+
/* A text field's box: the tray, sunk by `recessed`, with the forced-colors border. Every field
|
|
498
|
+
takes this recipe, so the fill, the rim and the recess cannot drift apart between fields. The
|
|
499
|
+
file drop target is a hollow control, not a well: it keeps `material.control` alone. */
|
|
500
|
+
const fieldWell = /* @__PURE__ */ cx(material.control, rim.field, elevation.recessed);
|
|
501
|
+
const fieldWellError = /* @__PURE__ */ cx(material.controlError, rim.field, elevation.recessed);
|
|
464
502
|
/* Dark neutral behind native video, including poster loading and letterboxing. */
|
|
465
503
|
const mediaCanvas = "bg-sherick-media";
|
|
466
504
|
/* A passive sheet tucked below a stronger control; independently tree-shakeable. */
|
|
@@ -807,50 +845,51 @@ const currentDestination = {
|
|
|
807
845
|
an option, a tree row, a date — keeps `tone.selected`, because a list sheet is already the
|
|
808
846
|
brightest surface and a white row on it would vanish. */
|
|
809
847
|
const puck = "bg-sherick-puck";
|
|
810
|
-
/* A
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
848
|
+
/* A boundary that only forced colors can see: a transparent border on an overlay. Forced colors
|
|
849
|
+
discards fills and shadows and repaints the border in a system colour, so a part that is
|
|
850
|
+
identified by tone and depth alone keeps an outline there. */
|
|
851
|
+
const forcedColorsBorder = "after:pointer-events-none after:absolute after:inset-0 after:box-border after:rounded-[inherit] after:border-[1.5px] after:border-transparent after:content-['']";
|
|
852
|
+
/* A choice row — an opt-in `surface` row in a RadioGroup or CheckboxGroup — is a well at rest: the
|
|
853
|
+
field's own `tray` under `recessed`, so a group of choices belongs to the same sunk family as the
|
|
854
|
+
fields around it. The row that holds the selection lifts out of that family: it takes the role's
|
|
855
|
+
*soft* surface and the `control` elevation, the same lift every held choice has. It keeps the
|
|
856
|
+
soft step, not the selected one, and draws no accent rim: the stronger step and a rim made the
|
|
857
|
+
chosen row the loudest object on a quiet form. `forcedColorsBorder` keeps every row's outline in
|
|
858
|
+
forced colors. */
|
|
859
|
+
const selectableRowRest = /* @__PURE__ */ cx(material.control, elevation.recessed);
|
|
860
|
+
const selectableRowSurface = /* @__PURE__ */ cx("has-[[data-checked]]:bg-sherick-primary-soft has-[[data-checked]]:shadow-sherick-control", forcedColorsBorder);
|
|
819
861
|
/* Supporting copy inside such a row — a choice's description. `text.medium` clears 4.5:1 on the
|
|
820
862
|
soft step at rest (5.7:1 light, 6.2:1 dark), but the row's press layer composites toward the label
|
|
821
863
|
and takes that margin away, so while the row holds the selection its supporting line takes full
|
|
822
864
|
ink; the supporting type step keeps it subordinate to the label. Keyed on the same primitive
|
|
823
865
|
marker as the surface itself. */
|
|
824
866
|
const selectableRowSupporting = "group-has-[[data-checked]]:text-sherick-ink";
|
|
825
|
-
/* An empty mark's
|
|
826
|
-
|
|
827
|
-
|
|
867
|
+
/* An empty mark's floor: the `mark-well` tone, the deepest neutral step in light and the most lit
|
|
868
|
+
one in dark. Named on its own so the contrast model can read it without retaining the whole
|
|
869
|
+
`selectable` table in bundles that never draw a mark. */
|
|
870
|
+
const markWellFill = "bg-sherick-mark-well";
|
|
828
871
|
const selectable = {
|
|
829
872
|
surface: /* @__PURE__ */ cx("relative", elevation.recessed, motionFeedback),
|
|
830
|
-
/* A selection mark — a checkbox box, a radio socket — rests
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
873
|
+
/* A selection mark — a checkbox box, a radio socket — rests at the `mark` rung: a recess one
|
|
874
|
+
step stronger than a field's, because a 20px well has to be found by its depth alone. While the
|
|
875
|
+
wrapping control is held it sinks to the `well`: the floor darkens and the boundary stays
|
|
876
|
+
exactly where it was, which is how a mark that must not move under the pointer answers a
|
|
877
|
+
press. */
|
|
878
|
+
markSurface: /* @__PURE__ */ cx("relative", elevation.mark, "group-[:not([data-disabled]):not([data-readonly]):not([aria-disabled=true]):not(:disabled):active]:shadow-sherick-well", motionFeedback),
|
|
835
879
|
/* The resting fill a *groove* holds — a segmented control's track, a tab list — and nothing more.
|
|
836
880
|
A groove that holds labelled segments is identified by those segments, exactly as a tab list is
|
|
837
881
|
identified by its labels, so it takes no boundary of its own. */
|
|
838
882
|
rest: /* @__PURE__ */ cx(material.matteHigh, text.medium),
|
|
839
|
-
/* An *empty mark* — an unchecked box, an unselected radio — is a
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
The rim is an overlay rather than the mark's own border, so the fill, the hover layer and the
|
|
847
|
-
recess all reach the mark's real edge: a border would leave a 1.5px frame of untinted fill
|
|
848
|
-
around a hovered selected box. Hover steps the rim to the mid-emphasis tone — darker in light
|
|
849
|
-
mode, lighter in dark — which is a visible answer on a 20px mark where a tint alone is not. */
|
|
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),
|
|
883
|
+
/* An *empty mark* — an unchecked box, an unselected radio — is a soft well, the same sunk
|
|
884
|
+
material a text field is, and it draws no rim. Its darker floor and the `mark` recess are what
|
|
885
|
+
make it findable, and its label names it. This is a deliberate relaxation: a 20px well does not
|
|
886
|
+
reach the 3:1 a control's boundary is normally held to, and the library accepts that for an
|
|
887
|
+
empty mark so that no control in a form is outlined. `forcedColorsBorder` keeps its outline
|
|
888
|
+
in forced colors. */
|
|
889
|
+
mark: /* @__PURE__ */ cx(markWellFill, text.medium, forcedColorsBorder),
|
|
851
890
|
/* A selected mark is the strong accent, edge to edge, and it settles flat: it is identified by
|
|
852
|
-
its fill and its glyph
|
|
853
|
-
|
|
891
|
+
its fill and its glyph. The overlay is hidden by opacity as the fill arrives, so forced colors
|
|
892
|
+
cannot repaint its transparent border over a selected mark. */
|
|
854
893
|
selected: "group-data-[checked]:bg-sherick-primary-strong group-data-[checked]:text-sherick-on-primary group-data-[checked]:shadow-sherick-flat group-data-[checked]:after:opacity-0",
|
|
855
894
|
indeterminate: "group-data-[indeterminate]:bg-sherick-primary-strong group-data-[indeterminate]:text-sherick-on-primary group-data-[indeterminate]:shadow-sherick-flat group-data-[indeterminate]:after:opacity-0",
|
|
856
895
|
/* A selected radio's dot: the socket's on-colour, flat. A Switch thumb is lifted because it is a
|
|
@@ -877,12 +916,11 @@ const toneAlpha = (tone) => (recipe, label) => {
|
|
|
877
916
|
throw new Error(`recipe alpha missing for ${label}`);
|
|
878
917
|
return match[1] === undefined ? 1 : Number(match[1]);
|
|
879
918
|
};
|
|
880
|
-
/* A field
|
|
881
|
-
|
|
882
|
-
const trayAlpha = toneAlpha("surface-high");
|
|
919
|
+
/* A field's `tray` step, its deep step, its danger step, and an empty mark's floor. */
|
|
920
|
+
const trayAlpha = toneAlpha("tray");
|
|
883
921
|
const deepTrayAlpha = toneAlpha("tray-deep");
|
|
922
|
+
const markAlpha = toneAlpha("mark-well");
|
|
884
923
|
const dangerTrayAlpha = toneAlpha("danger-soft");
|
|
885
|
-
const markAlpha = toneAlpha("canvas");
|
|
886
924
|
const recipeAlphas = {
|
|
887
925
|
state: {
|
|
888
926
|
quiet: { hover: stateAlpha(hoverQuiet, "state.quiet.hover"), press: stateAlpha(pressQuiet, "state.quiet.press") },
|
|
@@ -890,6 +928,7 @@ const recipeAlphas = {
|
|
|
890
928
|
tonalNeutral: { hover: stateAlpha(hoverTonal, "state.tonalNeutral.hover"), press: stateAlpha(pressTonalNeutral, "state.tonalNeutral.press") },
|
|
891
929
|
filled: { hover: stateAlpha(hoverFilled, "state.filled.hover"), press: stateAlpha(pressFilled, "state.filled.press") },
|
|
892
930
|
mark: { hover: stateAlpha(hoverMark, "state.mark.hover") },
|
|
931
|
+
row: { hover: fillAlpha(state.rowHover, "state.row.hover"), press: fillAlpha(rowPress, "state.row.press") },
|
|
893
932
|
},
|
|
894
933
|
tint: {
|
|
895
934
|
neutralSoft: fillAlpha(tone.soft.secondary, "tint.neutralSoft"),
|
|
@@ -902,8 +941,9 @@ const recipeAlphas = {
|
|
|
902
941
|
},
|
|
903
942
|
field: {
|
|
904
943
|
quiet: fillAlpha(material.matteQuiet, "field.quiet"),
|
|
905
|
-
card:
|
|
944
|
+
card: toneAlpha("surface")(material.matte, "field.card"),
|
|
906
945
|
groove: fillAlpha(material.matteHigh, "field.groove"),
|
|
946
|
+
choiceRow: trayAlpha(selectableRowRest, "field.choiceRow"),
|
|
907
947
|
control: trayAlpha(material.control, "field.control"),
|
|
908
948
|
hover: deepTrayAlpha(state.field.hover, "field.hover"),
|
|
909
949
|
engaged: deepTrayAlpha(state.field.engaged, "field.engaged"),
|
|
@@ -936,5 +976,5 @@ const richText = {
|
|
|
936
976
|
linkUnderline: "decoration-sherick-primary/[0.35] hover:decoration-sherick-primary",
|
|
937
977
|
};
|
|
938
978
|
|
|
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 };
|
|
979
|
+
export { codeWell, currentDestination, density, detail, disclosure, edge, edgeTone, elevation, fieldLabel, fieldLayout, fieldMessage, fieldWell, fieldWellError, focusRing, focusRingDrag, focusRingHeld, focusRingInset, focusRingWithin, forcedBoundary, groupFocusRing, headingRhythm, hitArea, iconSlot, iconStroke, list, material, matteInset, mediaCanvas, overlay, parentFocusRingInset, puck, recessedTop, recipeAlphas, richText, rim, rowTarget, selectable, selectableRowRest, selectableRowSupporting, selectableRowSurface, shape, stacking, state, stateLayer, stateLayerQuietComposite, text, tone, type };
|
|
940
980
|
//# sourceMappingURL=ui.common.js.map
|