@lanfermann/ui 0.6.0 → 0.7.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/components/accordion/accordion.d.ts +11 -3
- package/dist/components/accordion/accordion.js +15 -10
- package/dist/components/action-bar/action-bar.d.ts +2 -1
- package/dist/components/action-bar/action-bar.js +3 -2
- package/dist/components/attachment/attachment.d.ts +6 -1
- package/dist/components/attachment/attachment.js +64 -31
- package/dist/components/attachment/kinds.js +44 -2
- package/dist/components/button-group/button-group-variants.d.ts +4 -3
- package/dist/components/button-group/button-group-variants.js +13 -12
- package/dist/components/button-group/button-group.d.ts +3 -3
- package/dist/components/button-group/button-group.js +3 -3
- package/dist/components/card/card.d.ts +9 -1
- package/dist/components/card/card.js +14 -2
- package/dist/components/checkbox-card/checkbox-card.js +3 -2
- package/dist/components/collapsible/collapsible.js +7 -3
- package/dist/components/combobox/combobox.d.ts +3 -1
- package/dist/components/combobox/combobox.js +45 -30
- package/dist/components/copy-page/copy-page.d.ts +4 -4
- package/dist/components/copy-page/copy-page.js +9 -19
- package/dist/components/menu/menu.d.ts +20 -8
- package/dist/components/menu/menu.js +51 -29
- package/dist/components/message/message.d.ts +10 -2
- package/dist/components/message/message.js +20 -8
- package/dist/components/navigation-menu/navigation-menu.d.ts +7 -1
- package/dist/components/navigation-menu/navigation-menu.js +11 -4
- package/dist/components/otp-field/otp-field.js +46 -11
- package/dist/components/radio-card/radio-card.js +3 -2
- package/dist/components/segmented-control/segmented-control.js +29 -16
- package/dist/components/select/select.d.ts +4 -3
- package/dist/components/select/select.js +15 -10
- package/dist/components/stat/stat.d.ts +3 -1
- package/dist/components/stat/stat.js +3 -1
- package/dist/components/steps/steps.js +5 -2
- package/dist/components/time-field/time-field.js +6 -5
- package/dist/components/toggle/toggle.d.ts +5 -2
- package/dist/components/toggle/toggle.js +13 -5
- package/dist/components/toolbar/toolbar.d.ts +9 -2
- package/dist/components/toolbar/toolbar.js +18 -5
- package/dist/components/trace/trace.js +1 -1
- package/dist/internal/choice-card.js +27 -11
- package/dist/internal/disclosure.js +15 -3
- package/dist/internal/key-tip.js +18 -0
- package/dist/internal/list-mark.js +39 -0
- package/dist/internal/number-places.js +4 -3
- package/dist/internal/rule.js +2 -1
- package/dist/internal/tile.js +23 -0
- package/dist/lib/cn.js +10 -4
- package/package.json +1 -1
- package/src/styles/accordion.css +176 -0
- package/src/styles/depth.css +104 -32
- package/src/styles/motion.css +3 -0
- package/src/styles/segmented.css +14 -7
- package/src/styles.css +1 -0
|
@@ -15,6 +15,18 @@ const disclosurePanel = [
|
|
|
15
15
|
"data-starting-style:h-0 data-starting-style:opacity-0",
|
|
16
16
|
"data-ending-style:h-0 data-ending-style:opacity-0 data-ending-style:spring-leave"
|
|
17
17
|
].join(" ");
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Added to a `disclosurePanel` whose one child is its content (`Accordion`, `Collapsible`): the
|
|
20
|
+
* content comes down with the opening edge from `--motion-enter-offset` above, so the answer
|
|
21
|
+
* unfolds instead of being uncovered. Closing only fades: exits do not travel. Not on a panel
|
|
22
|
+
* whose entries something else measures while they move (a `Sidebar`'s travelling tint).
|
|
23
|
+
*/
|
|
24
|
+
const disclosureUnfold = ["*:transition-[translate] *:spring-settle", "data-starting-style:*:-translate-y-(--motion-enter-offset)"].join(" ");
|
|
25
|
+
/**
|
|
26
|
+
* The chevron of a disclosure: muted until the row is pointed at, and it turns on `seat`. While
|
|
27
|
+
* the row is pointed at it also leans `--motion-lean` the way it points; each part sets that way
|
|
28
|
+
* as `--lean` (an x and a y), since a chevron that has turned points elsewhere. Without `--lean`
|
|
29
|
+
* it stays in place (`Sidebar`, `Trace`).
|
|
30
|
+
*/
|
|
31
|
+
const disclosureChevron = "text-fg-muted transition-[rotate,translate,color] spring-seat group-hover:text-fg group-hover:[translate:var(--lean)] group-data-disabled:text-on-disabled";
|
|
32
|
+
export { disclosureChevron, disclosurePanel, disclosureUnfold };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Shortcut } from "../components/shortcut/shortcut.js";
|
|
3
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../components/tooltip/tooltip.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
// src/internal/key-tip.tsx
|
|
6
|
+
/**
|
|
7
|
+
* The name of a key that shows only a symbol, said above it under the pointer, with its shortcut
|
|
8
|
+
* when it has one. A toolbar gives one to each of its symbol keys: in a row of symbols the name
|
|
9
|
+
* is what the reader is missing. It shows nothing on a touch screen; the key's `aria-label`
|
|
10
|
+
* still names it there.
|
|
11
|
+
*/
|
|
12
|
+
function KeyTip({ label, shortcut, trigger }) {
|
|
13
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: trigger }), /* @__PURE__ */ jsxs(TooltipContent, {
|
|
14
|
+
className: "flex items-center gap-2",
|
|
15
|
+
children: [label, shortcut !== void 0 && /* @__PURE__ */ jsx(Shortcut, { keys: shortcut })]
|
|
16
|
+
})] });
|
|
17
|
+
}
|
|
18
|
+
export { KeyTip };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TickGlyph } from "./glyphs.js";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// src/internal/list-mark.tsx
|
|
5
|
+
/**
|
|
6
|
+
* The mark of a chosen row, at the row's right end: every row keeps its slot and only the chosen
|
|
7
|
+
* one shows its mark. The row must be a `group` that says it is chosen with `data-selected`
|
|
8
|
+
* (a select, a combobox) or `data-checked` (a menu), or pass `on`. Put `ml-auto` on it where
|
|
9
|
+
* nothing before it pushes it to the end.
|
|
10
|
+
*/
|
|
11
|
+
function ListMark({ kind = "single", on, className }) {
|
|
12
|
+
return /* @__PURE__ */ jsx("span", {
|
|
13
|
+
"aria-hidden": true,
|
|
14
|
+
"data-slot": "list-mark",
|
|
15
|
+
className: cn("flex size-4 shrink-0 items-center justify-center text-accent group-data-disabled:text-on-disabled", className),
|
|
16
|
+
children: kind === "single" ? /* @__PURE__ */ jsx("span", { className: cn("mark", on === void 0 ? "mark-quiet group-data-checked:mark-on group-data-selected:mark-on" : on ? "mark-on" : "mark-quiet") }) : /* @__PURE__ */ jsx(TickGlyph, { className: on === void 0 ? "opacity-0 group-data-checked:opacity-100 group-data-selected:opacity-100" : on ? "" : "opacity-0" })
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A row with a detail at its right, chosen: it stands on the tint. The tint is a layer of its
|
|
21
|
+
* own under the row's words, so it can fade in and out (`settle`) while the highlight under the
|
|
22
|
+
* pointer and the arrow keys stays instant. Chosen rows that touch are one shape: where a chosen
|
|
23
|
+
* row meets another, both give up their corners there, so only the block's outer corners are
|
|
24
|
+
* round, and a corner eases square or round as a neighbour is taken or given up. Under the
|
|
25
|
+
* pointer a chosen row's tint deepens at once. The muted detail reads below 4.5:1 on the tint,
|
|
26
|
+
* so on a chosen row it takes the body's colour.
|
|
27
|
+
*/
|
|
28
|
+
const listTint = [
|
|
29
|
+
"relative isolate",
|
|
30
|
+
"before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:bg-tint before:opacity-0",
|
|
31
|
+
"before:transition-[opacity,border-radius] before:spring-settle motion-reduce:before:transition-opacity",
|
|
32
|
+
"data-selected:before:opacity-100",
|
|
33
|
+
"data-highlighted:before:bg-[color-mix(in_srgb,var(--color-tint),var(--color-fg)_5%)]",
|
|
34
|
+
"data-selected:[&:has(+[data-selected])]:before:rounded-b-none",
|
|
35
|
+
"data-selected:[[data-selected]+&]:before:rounded-t-none",
|
|
36
|
+
"data-selected:[&_[data-slot$=-detail]]:text-fg-body",
|
|
37
|
+
"forced-colors:data-selected:outline forced-colors:data-selected:-outline-offset-1"
|
|
38
|
+
].join(" ");
|
|
39
|
+
export { ListMark, listTint };
|
|
@@ -43,10 +43,11 @@ function toPlaces(format, value) {
|
|
|
43
43
|
unit += run;
|
|
44
44
|
run = "";
|
|
45
45
|
};
|
|
46
|
-
for (const part of parts.slice(0, first)) if (part.type === "minusSign") {
|
|
46
|
+
for (const part of parts.slice(0, first)) if (part.type === "minusSign" || part.type === "plusSign") {
|
|
47
47
|
flush();
|
|
48
|
+
const key = part.type === "minusSign" ? "minus" : "plus";
|
|
48
49
|
places.push({
|
|
49
|
-
key
|
|
50
|
+
key,
|
|
50
51
|
kind: "symbol",
|
|
51
52
|
text: part.value
|
|
52
53
|
});
|
|
@@ -127,7 +128,7 @@ function nextRolls(rolls, places, direction) {
|
|
|
127
128
|
/** Left to right: what comes before, the integer places from the highest, the fraction. */
|
|
128
129
|
function rank(key) {
|
|
129
130
|
if (key === "pre") return 0;
|
|
130
|
-
if (key === "minus") return 1;
|
|
131
|
+
if (key === "minus" || key === "plus") return 1;
|
|
131
132
|
if (key === "pre2") return 2;
|
|
132
133
|
if (key === "decimal") return 5e4;
|
|
133
134
|
if (key === "post") return 9e4;
|
package/dist/internal/rule.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/internal/rule.ts
|
|
2
2
|
/**
|
|
3
|
-
* The 2px rule that opens a block (`Table`, `
|
|
3
|
+
* The 2px rule that opens a block (`Table`, `ParameterList`, `DescriptionList`, a ruled
|
|
4
|
+
* `StatGroup`; not an `Accordion`, which opens with a hairline): a straight line with
|
|
4
5
|
* round ends. The box keeps a transparent 2px top border, so it is laid out exactly as with
|
|
5
6
|
* `border-t-2`, and the line is drawn into that border as `::before`. A border cannot round its
|
|
6
7
|
* own ends: with a radius it bends down at the corners instead. Where the rule stands by itself,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Icon } from "../components/icon/icon.js";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// src/internal/tile.tsx
|
|
5
|
+
/**
|
|
6
|
+
* The small square a row's symbol stands in, before its title and its line (the pages of a
|
|
7
|
+
* `NavigationMenu` panel, the rows of a `CopyPage` menu): a small raised plug, 36px with an 18px
|
|
8
|
+
* symbol, as in Clerk's menus (Justin, 2026-11-20, chosen over a flat square and over 32px).
|
|
9
|
+
* The symbol is muted and darkens with the row under the pointer or the keyboard: give the row
|
|
10
|
+
* `group/row`.
|
|
11
|
+
*/
|
|
12
|
+
function Tile({ icon, children, className }) {
|
|
13
|
+
return /* @__PURE__ */ jsx("span", {
|
|
14
|
+
"aria-hidden": true,
|
|
15
|
+
"data-slot": "tile",
|
|
16
|
+
className: cn("flex size-9 shrink-0 items-center justify-center rounded-md bg-raised depth-plug text-fg-muted", "group-hover/row:text-fg group-data-highlighted/row:text-fg", className),
|
|
17
|
+
children: icon ? /* @__PURE__ */ jsx(Icon, {
|
|
18
|
+
icon,
|
|
19
|
+
size: 18
|
|
20
|
+
}) : children
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export { Tile };
|
package/dist/lib/cn.js
CHANGED
|
@@ -19,7 +19,10 @@ const depthNames = [
|
|
|
19
19
|
"field-focus",
|
|
20
20
|
"field-invalid",
|
|
21
21
|
"card",
|
|
22
|
-
"
|
|
22
|
+
"bevel",
|
|
23
|
+
"bevel-chosen",
|
|
24
|
+
"gloss",
|
|
25
|
+
"dock",
|
|
23
26
|
"floating",
|
|
24
27
|
"overlay",
|
|
25
28
|
"bar",
|
|
@@ -43,8 +46,9 @@ const shadowNames = [
|
|
|
43
46
|
"field-focus",
|
|
44
47
|
"field-invalid",
|
|
45
48
|
"card",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
49
|
+
"bevel",
|
|
50
|
+
"bevel-pressed",
|
|
51
|
+
"dock",
|
|
48
52
|
"floating",
|
|
49
53
|
"overlay",
|
|
50
54
|
"bar"
|
|
@@ -57,7 +61,9 @@ const insetShadowNames = [
|
|
|
57
61
|
"trough",
|
|
58
62
|
"field",
|
|
59
63
|
"card",
|
|
60
|
-
"
|
|
64
|
+
"bevel",
|
|
65
|
+
"bevel-chosen",
|
|
66
|
+
"gloss",
|
|
61
67
|
"sheet",
|
|
62
68
|
"bar"
|
|
63
69
|
];
|
package/package.json
CHANGED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Accordion: rows divided by hairlines, and the shape a row takes while it is pointed at.
|
|
3
|
+
* Chosen by Justin on 2026-11-20 (DESIGN.md, Accordion).
|
|
4
|
+
*
|
|
5
|
+
* One edge per boundary. Where a wash marks a row, the lines on its two sides step aside (fade),
|
|
6
|
+
* so the wash is the row's only edge and never stands a pixel short of a line that runs on past
|
|
7
|
+
* its corners. A wash stands `--accordion-inset` inside its row.
|
|
8
|
+
*
|
|
9
|
+
* An open row rests unmarked. Pointed at, its question's wash is a lid: its lower corners go
|
|
10
|
+
* square and the wash runs on at half strength behind the answer, so the pointer shows what the
|
|
11
|
+
* row holds. The corners turn as the row opens (`settle`) and closes (`leave`).
|
|
12
|
+
*
|
|
13
|
+
* The lines and washes are pseudo-elements, so they can fade and take corners of their own:
|
|
14
|
+
* root ::before the hairline that opens the block
|
|
15
|
+
* item ::after the hairline under the row
|
|
16
|
+
* item ::before the tail of an open row's wash, behind its answer
|
|
17
|
+
* trigger ::before the wash under the pointer
|
|
18
|
+
* (The trigger's `::after` is its touch target.)
|
|
19
|
+
*
|
|
20
|
+
* Pointed at means `:hover` on a device that can hover, and `:active` everywhere, so a finger
|
|
21
|
+
* gets the wash while it is down, as a cell does on iOS. `data-quiet` (the `quiet` prop) takes no
|
|
22
|
+
* wash: the lines stay and only the chevron answers.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
[data-slot="accordion"] {
|
|
26
|
+
--accordion-inset: 2px;
|
|
27
|
+
position: relative;
|
|
28
|
+
padding-top: 1px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* ---- Lines ---- */
|
|
32
|
+
|
|
33
|
+
[data-slot="accordion-item"] {
|
|
34
|
+
position: relative;
|
|
35
|
+
isolation: isolate;
|
|
36
|
+
padding-bottom: 1px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[data-slot="accordion"]::before,
|
|
40
|
+
[data-slot="accordion-item"]::after {
|
|
41
|
+
content: "";
|
|
42
|
+
position: absolute;
|
|
43
|
+
inset-inline: 0;
|
|
44
|
+
height: 1px;
|
|
45
|
+
background-color: var(--lf-hairline);
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
transition: opacity var(--transition-duration-spring-snap) var(--ease-spring-snap);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[data-slot="accordion"]::before {
|
|
51
|
+
top: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[data-slot="accordion-item"]::after {
|
|
55
|
+
bottom: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* ---- Washes ---- */
|
|
59
|
+
|
|
60
|
+
[data-slot="accordion-trigger"] {
|
|
61
|
+
isolation: isolate;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
[data-slot="accordion-trigger"]::before {
|
|
65
|
+
content: "";
|
|
66
|
+
position: absolute;
|
|
67
|
+
inset: var(--accordion-inset) 0;
|
|
68
|
+
z-index: -1;
|
|
69
|
+
border-radius: var(--radius-base);
|
|
70
|
+
background-color: var(--lf-hover);
|
|
71
|
+
opacity: 0;
|
|
72
|
+
pointer-events: none;
|
|
73
|
+
transition:
|
|
74
|
+
opacity var(--transition-duration-spring-snap) var(--ease-spring-snap),
|
|
75
|
+
border-radius var(--transition-duration-spring-leave) var(--ease-spring-leave);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Open, the wash is a lid: the tail's corners on top, square below where the answer goes on. */
|
|
79
|
+
[data-slot="accordion-trigger"][data-panel-open]::before {
|
|
80
|
+
border-radius: calc(var(--radius-base) * 1.5) calc(var(--radius-base) * 1.5) 0 0;
|
|
81
|
+
transition:
|
|
82
|
+
opacity var(--transition-duration-spring-snap) var(--ease-spring-snap),
|
|
83
|
+
border-radius var(--transition-duration-spring-settle) var(--ease-spring-settle);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* The tail: the whole open row, inside its lines by the inset, under the lid. */
|
|
87
|
+
[data-slot="accordion-item"]::before {
|
|
88
|
+
content: "";
|
|
89
|
+
position: absolute;
|
|
90
|
+
inset: var(--accordion-inset) 0 calc(var(--accordion-inset) + 1px);
|
|
91
|
+
z-index: -1;
|
|
92
|
+
border-radius: calc(var(--radius-base) * 1.5);
|
|
93
|
+
background-color: var(--lf-hover);
|
|
94
|
+
opacity: 0;
|
|
95
|
+
pointer-events: none;
|
|
96
|
+
transition: opacity var(--transition-duration-spring-snap) var(--ease-spring-snap);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* ---- Pointed at ---- */
|
|
100
|
+
|
|
101
|
+
@media (hover: hover) {
|
|
102
|
+
[data-slot="accordion"]:not([data-quiet]) {
|
|
103
|
+
& [data-slot="accordion-trigger"]:hover::before {
|
|
104
|
+
opacity: 1;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&
|
|
108
|
+
[data-slot="accordion-item"][data-open]:has(
|
|
109
|
+
> [data-slot="accordion-header"] > [data-slot="accordion-trigger"]:hover
|
|
110
|
+
)::before {
|
|
111
|
+
opacity: 0.5;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&
|
|
115
|
+
[data-slot="accordion-item"]:is(
|
|
116
|
+
:has(> [data-slot="accordion-header"] > [data-slot="accordion-trigger"]:hover),
|
|
117
|
+
:has(
|
|
118
|
+
+ [data-slot="accordion-item"]
|
|
119
|
+
> [data-slot="accordion-header"]
|
|
120
|
+
> [data-slot="accordion-trigger"]:hover
|
|
121
|
+
)
|
|
122
|
+
)::after {
|
|
123
|
+
opacity: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&:has(
|
|
127
|
+
> [data-slot="accordion-item"]:first-child
|
|
128
|
+
> [data-slot="accordion-header"]
|
|
129
|
+
> [data-slot="accordion-trigger"]:hover
|
|
130
|
+
)::before {
|
|
131
|
+
opacity: 0;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
[data-slot="accordion"]:not([data-quiet]) {
|
|
137
|
+
& [data-slot="accordion-trigger"]:active::before {
|
|
138
|
+
opacity: 1;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&
|
|
142
|
+
[data-slot="accordion-item"][data-open]:has(
|
|
143
|
+
> [data-slot="accordion-header"] > [data-slot="accordion-trigger"]:active
|
|
144
|
+
)::before {
|
|
145
|
+
opacity: 0.5;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&
|
|
149
|
+
[data-slot="accordion-item"]:is(
|
|
150
|
+
:has(> [data-slot="accordion-header"] > [data-slot="accordion-trigger"]:active),
|
|
151
|
+
:has(
|
|
152
|
+
+ [data-slot="accordion-item"]
|
|
153
|
+
> [data-slot="accordion-header"]
|
|
154
|
+
> [data-slot="accordion-trigger"]:active
|
|
155
|
+
)
|
|
156
|
+
)::after {
|
|
157
|
+
opacity: 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&:has(
|
|
161
|
+
> [data-slot="accordion-item"]:first-child
|
|
162
|
+
> [data-slot="accordion-header"]
|
|
163
|
+
> [data-slot="accordion-trigger"]:active
|
|
164
|
+
)::before {
|
|
165
|
+
opacity: 0;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* Forced colours drop the washes; the lines are drawn in the text colour and always stay. */
|
|
170
|
+
@media (forced-colors: active) {
|
|
171
|
+
[data-slot="accordion"]::before,
|
|
172
|
+
[data-slot="accordion-item"]::after {
|
|
173
|
+
background-color: CanvasText;
|
|
174
|
+
opacity: 1 !important;
|
|
175
|
+
}
|
|
176
|
+
}
|
package/src/styles/depth.css
CHANGED
|
@@ -9,11 +9,13 @@
|
|
|
9
9
|
* Fitting what a hand presses depth-raised (+ -hover, depth-pressed)
|
|
10
10
|
* Plug a fitting seated in a socket depth-plug (a checked box)
|
|
11
11
|
* Socket what receives a value or a part depth-socket, depth-trough, depth-field
|
|
12
|
-
* Card one object you act on depth-card (
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* Card one object you act on depth-card (in an app's main area a block of
|
|
13
|
+
* the page, without the wide shadow); depth-bevel
|
|
14
|
+
* and depth-gloss, a card cut like a fitting for
|
|
15
|
+
* what is handled (-chosen: one of several, taken;
|
|
16
|
+
* shadow-bevel-pressed under a press)
|
|
17
|
+
* Sheet what floats temporarily depth-floating, depth-overlay; depth-dock, a
|
|
18
|
+
* fitting that floats (the action bar)
|
|
17
19
|
* Bar the site's bar over the page depth-bar
|
|
18
20
|
* Seam where two sections of a site meet depth-seam (components/seam)
|
|
19
21
|
*
|
|
@@ -137,6 +139,20 @@
|
|
|
137
139
|
--depth-card-near: rgb(19 18 28 / 0.05);
|
|
138
140
|
--depth-card-far: rgb(42 37 82 / 0.2);
|
|
139
141
|
|
|
142
|
+
/* the bevelled card: cut like a fitting, a crisp edge and a lip at its foot */
|
|
143
|
+
--depth-bevel-face: linear-gradient(rgb(42 37 82 / 0) 55%, rgb(42 37 82 / 0.035));
|
|
144
|
+
--depth-bevel-edge: rgb(19 18 28 / 0.11);
|
|
145
|
+
--depth-bevel-hi: rgb(255 255 255 / 0);
|
|
146
|
+
--depth-bevel-lo: rgb(19 18 28 / 0.06);
|
|
147
|
+
--depth-bevel-contact: rgb(19 18 28 / 0.07);
|
|
148
|
+
--depth-bevel-ambient: rgb(42 37 82 / 0.1);
|
|
149
|
+
/* Glanz: the same cut with a face that visibly shines and darkens toward its foot */
|
|
150
|
+
--depth-gloss-face: linear-gradient(rgb(255 255 255 / 0), rgb(42 37 82 / 0.075));
|
|
151
|
+
--depth-gloss-hi: rgb(255 255 255 / 0);
|
|
152
|
+
--depth-gloss-lo: rgb(19 18 28 / 0.08);
|
|
153
|
+
/* the light that follows the pointer over a choice card */
|
|
154
|
+
--depth-bevel-light: rgb(95 80 208 / 0.07);
|
|
155
|
+
|
|
140
156
|
--depth-sheet-edge: rgb(19 18 28 / 0.12);
|
|
141
157
|
--depth-sheet-hi: rgb(255 255 255 / 0);
|
|
142
158
|
--depth-sheet-near: rgb(19 18 28 / 0.08);
|
|
@@ -216,6 +232,17 @@
|
|
|
216
232
|
--depth-card-near: rgb(8 7 12 / 0.4);
|
|
217
233
|
--depth-card-far: rgb(8 7 12 / 0.3);
|
|
218
234
|
|
|
235
|
+
--depth-bevel-face: linear-gradient(rgb(255 255 255 / 0.045), rgb(255 255 255 / 0.01));
|
|
236
|
+
--depth-bevel-edge: rgb(255 255 255 / 0.08);
|
|
237
|
+
--depth-bevel-hi: rgb(255 255 255 / 0.09);
|
|
238
|
+
--depth-bevel-lo: rgb(0 0 0 / 0.3);
|
|
239
|
+
--depth-bevel-contact: rgb(8 7 12 / 0.55);
|
|
240
|
+
--depth-bevel-ambient: rgb(8 7 12 / 0.35);
|
|
241
|
+
--depth-gloss-face: linear-gradient(rgb(255 255 255 / 0.085), rgb(255 255 255 / 0.015));
|
|
242
|
+
--depth-gloss-hi: rgb(255 255 255 / 0.14);
|
|
243
|
+
--depth-gloss-lo: rgb(0 0 0 / 0.35);
|
|
244
|
+
--depth-bevel-light: rgb(255 255 255 / 0.06);
|
|
245
|
+
|
|
219
246
|
--depth-sheet-edge: rgb(8 7 12 / 0.8);
|
|
220
247
|
--depth-sheet-hi: rgb(255 255 255 / 0.08);
|
|
221
248
|
--depth-sheet-near: rgb(8 7 12 / 0.4);
|
|
@@ -296,6 +323,17 @@
|
|
|
296
323
|
--depth-card-near: rgb(19 18 28 / 0.14);
|
|
297
324
|
--depth-card-far: rgb(19 18 28 / 0.22);
|
|
298
325
|
|
|
326
|
+
--depth-bevel-face: linear-gradient(rgb(255 255 255 / 0.08), rgb(255 255 255 / 0));
|
|
327
|
+
--depth-bevel-edge: rgb(255 255 255 / 0.16);
|
|
328
|
+
--depth-bevel-hi: rgb(255 255 255 / 0.14);
|
|
329
|
+
--depth-bevel-lo: rgb(19 18 28 / 0.16);
|
|
330
|
+
--depth-bevel-contact: rgb(19 18 28 / 0.16);
|
|
331
|
+
--depth-bevel-ambient: rgb(19 18 28 / 0.2);
|
|
332
|
+
--depth-gloss-face: linear-gradient(rgb(255 255 255 / 0.14), rgb(255 255 255 / 0));
|
|
333
|
+
--depth-gloss-hi: rgb(255 255 255 / 0.2);
|
|
334
|
+
--depth-gloss-lo: rgb(19 18 28 / 0.2);
|
|
335
|
+
--depth-bevel-light: rgb(255 255 255 / 0.08);
|
|
336
|
+
|
|
299
337
|
--depth-sheet-edge: rgb(19 18 28 / 0.2);
|
|
300
338
|
--depth-sheet-hi: rgb(255 255 255 / 0);
|
|
301
339
|
--depth-sheet-near: rgb(19 18 28 / 0.14);
|
|
@@ -357,22 +395,39 @@
|
|
|
357
395
|
--shadow-field-invalid: 0 0 0 1px var(--lf-danger), 0 0 0 4px var(--depth-field-halo-danger);
|
|
358
396
|
--inset-shadow-field: inset 0 1px 2px 0 var(--depth-field-shade);
|
|
359
397
|
|
|
360
|
-
/* Cards: softly raised.
|
|
398
|
+
/* Cards: softly raised. The wide layer reaches 6px down with a 16px blur: at 12px and 28px it
|
|
399
|
+
spread too far (Justin, 2026-11-20, chosen over that and over 3px and 8px). */
|
|
361
400
|
--shadow-card:
|
|
362
|
-
0 0 0 1px var(--
|
|
363
|
-
0
|
|
364
|
-
/* A card that is a control (a `RadioCard`) answers with its shadow and keeps its size: a
|
|
365
|
-
little higher under the pointer, down on the page under a press. The layers match. */
|
|
366
|
-
--shadow-card-hover:
|
|
367
|
-
0 0 0 1px var(--d-card-edge, var(--depth-card-edge)), 0 3px 6px 0 var(--depth-card-near),
|
|
368
|
-
0 16px 32px -8px var(--depth-card-far);
|
|
369
|
-
--shadow-card-pressed:
|
|
370
|
-
0 0 0 1px var(--d-card-edge, var(--depth-card-edge)), 0 1px 2px 0 var(--depth-card-near),
|
|
371
|
-
0 4px 12px -6px var(--depth-card-far);
|
|
401
|
+
0 0 0 1px var(--depth-card-edge), 0 2px 4px 0 var(--depth-card-near),
|
|
402
|
+
0 6px 16px -6px var(--depth-card-far);
|
|
372
403
|
--inset-shadow-card: inset 0 1px 0 0 var(--depth-card-hi);
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
404
|
+
|
|
405
|
+
/* The bevelled card (Fase): a card cut like a fitting. Its edge is crisp, light runs along its
|
|
406
|
+
top and a 1px lip along its foot, and its shadow is short: it stands on the page, it does
|
|
407
|
+
not hover over it. A choice card on it goes down to the page under a press; the layers
|
|
408
|
+
match, so it eases between the two. */
|
|
409
|
+
--shadow-bevel:
|
|
410
|
+
0 0 0 1px var(--d-card-edge, var(--depth-bevel-edge)), 0 1px 2px 0 var(--depth-bevel-contact),
|
|
411
|
+
0 4px 12px -4px var(--depth-bevel-ambient);
|
|
412
|
+
--shadow-bevel-pressed:
|
|
413
|
+
0 0 0 1px var(--d-card-edge, var(--depth-bevel-edge)), 0 0 0 0 transparent,
|
|
414
|
+
0 1px 3px -1px var(--depth-bevel-ambient);
|
|
415
|
+
--inset-shadow-bevel:
|
|
416
|
+
inset 0 1px 0 0 var(--depth-bevel-hi), inset 0 -1px 0 0 var(--depth-bevel-lo);
|
|
417
|
+
/* Chosen, the one of several wears the accent as its edge: a pixel outside (`--d-card-edge`,
|
|
418
|
+
in whatever state the card's shadow is) and a pixel inside, in place of the top light. */
|
|
419
|
+
--inset-shadow-bevel-chosen:
|
|
420
|
+
inset 0 0 0 1px var(--lf-accent), inset 0 -1px 0 0 var(--depth-bevel-lo);
|
|
421
|
+
/* Glanz: the bevelled card with a face that visibly shines, Clerk's prompt cards on dark. */
|
|
422
|
+
--inset-shadow-gloss:
|
|
423
|
+
inset 0 1px 0 0 var(--depth-gloss-hi), inset 0 -1px 0 0 var(--depth-gloss-lo);
|
|
424
|
+
|
|
425
|
+
/* The dock: a fitting's face that floats over the page for as long as a selection lasts (the
|
|
426
|
+
`ActionBar`). The edge, light and lip of a key, and a long, wide float under it (Justin,
|
|
427
|
+
2026-11-20, chosen over a shorter and a wider one). */
|
|
428
|
+
--shadow-dock:
|
|
429
|
+
0 0 0 1px var(--depth-surface-edge), 0 1px 2px 0 var(--depth-surface-contact),
|
|
430
|
+
0 12px 28px -10px var(--depth-sheet-mid), 0 28px 60px -20px var(--depth-sheet-far);
|
|
376
431
|
|
|
377
432
|
/* Sheets. */
|
|
378
433
|
--shadow-floating:
|
|
@@ -475,31 +530,48 @@
|
|
|
475
530
|
[data-slot="app-shell-main"] & {
|
|
476
531
|
--depth-card-far: transparent;
|
|
477
532
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
&:is([data-slot="checkbox-card"], [data-slot="radio-card"]) {
|
|
482
|
-
--depth-card-far: transparent;
|
|
483
|
-
@media (hover: hover) {
|
|
484
|
-
&:hover:not(:has([data-slot="choice-control"][data-disabled])) {
|
|
485
|
-
--depth-card-far: inherit;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
533
|
+
@media (forced-colors: active) {
|
|
534
|
+
outline: 1px solid ButtonBorder;
|
|
535
|
+
outline-offset: -1px;
|
|
488
536
|
}
|
|
537
|
+
}
|
|
538
|
+
/* A card cut like a fitting (`Card variant="bevel"`, the choice cards). */
|
|
539
|
+
@utility depth-bevel {
|
|
540
|
+
@apply shadow-bevel inset-shadow-bevel;
|
|
541
|
+
background-image: var(--depth-bevel-face);
|
|
489
542
|
@media (forced-colors: active) {
|
|
490
543
|
outline: 1px solid ButtonBorder;
|
|
491
544
|
outline-offset: -1px;
|
|
492
545
|
}
|
|
493
546
|
}
|
|
494
|
-
/*
|
|
495
|
-
@utility depth-
|
|
547
|
+
/* The same cut with a shining face (`Card variant="gloss"`). */
|
|
548
|
+
@utility depth-gloss {
|
|
549
|
+
@apply shadow-bevel inset-shadow-gloss;
|
|
550
|
+
background-image: var(--depth-gloss-face);
|
|
551
|
+
@media (forced-colors: active) {
|
|
552
|
+
outline: 1px solid ButtonBorder;
|
|
553
|
+
outline-offset: -1px;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
/* Worn over `depth-bevel`: the accent as its edge, outside and in; the shadow is the card's. */
|
|
557
|
+
@utility depth-bevel-chosen {
|
|
496
558
|
--d-card-edge: var(--lf-accent);
|
|
497
|
-
@apply inset-shadow-
|
|
559
|
+
@apply inset-shadow-bevel-chosen;
|
|
498
560
|
@media (forced-colors: active) {
|
|
499
561
|
outline: 2px solid Highlight;
|
|
500
562
|
outline-offset: -2px;
|
|
501
563
|
}
|
|
502
564
|
}
|
|
565
|
+
/* A fitting that floats: the `ActionBar`. Its face, light and lip are a key's. */
|
|
566
|
+
@utility depth-dock {
|
|
567
|
+
@apply shadow-dock inset-shadow-raised;
|
|
568
|
+
background-image: var(--d-face, var(--depth-surface-face));
|
|
569
|
+
@media (forced-colors: active) {
|
|
570
|
+
outline: 1px solid ButtonBorder;
|
|
571
|
+
outline-offset: -1px;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
/* Worn over `depth-card`: it changes the edge and leaves the shadow to the card's state. */
|
|
503
575
|
@utility depth-floating {
|
|
504
576
|
@apply shadow-floating inset-shadow-sheet;
|
|
505
577
|
@media (forced-colors: active) {
|
package/src/styles/motion.css
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
--motion-enter-scale: 0.96;
|
|
14
14
|
--motion-enter-offset: 4px;
|
|
15
15
|
--motion-press-scale: 0.98;
|
|
16
|
+
/* How far a disclosure's chevron leans the way it points while its row is pointed at. */
|
|
17
|
+
--motion-lean: 1.5px;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -20,6 +22,7 @@
|
|
|
20
22
|
--motion-enter-scale: 1;
|
|
21
23
|
--motion-enter-offset: 0px;
|
|
22
24
|
--motion-press-scale: 1;
|
|
25
|
+
--motion-lean: 0px;
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
|
package/src/styles/segmented.css
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
* Everything that moves here is a transform, so nothing is laid out while it travels; only a
|
|
5
5
|
* change of width between two segments is, on the thumb alone.
|
|
6
6
|
*
|
|
7
|
+
* What is measured (`--thumb-left`, `--thumb-width`, `--thumb-lean`, `--track-width`,
|
|
8
|
+
* `--track-height`) is written as a plain number of layout pixels and made a length only where
|
|
9
|
+
* it is used (`* 1px`). Under CSS `zoom` every engine treated a length in a custom property in
|
|
10
|
+
* its own way: Firefox zoomed the registered width twice, so the thumb came out 1.4 times too
|
|
11
|
+
* wide past the trough's end, and WebKit placed the resting thumb off its segment. A number is
|
|
12
|
+
* not zoomed, and the `1px` it is multiplied by is zoomed once, where it is used.
|
|
13
|
+
*
|
|
7
14
|
* Three parts, the first two as in a slider (slider.css):
|
|
8
15
|
*
|
|
9
16
|
* rider `segment-thumb`: the place. It travels to the chosen segment on `--segment-pace`
|
|
@@ -51,9 +58,9 @@
|
|
|
51
58
|
initial-value: 1;
|
|
52
59
|
}
|
|
53
60
|
@property --thumb-width {
|
|
54
|
-
syntax: "<
|
|
61
|
+
syntax: "<number>";
|
|
55
62
|
inherits: true;
|
|
56
|
-
initial-value:
|
|
63
|
+
initial-value: 0;
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
@layer components {
|
|
@@ -103,8 +110,8 @@
|
|
|
103
110
|
}
|
|
104
111
|
|
|
105
112
|
[data-slot="segment-thumb"] {
|
|
106
|
-
width: var(--thumb-width);
|
|
107
|
-
translate: calc(var(--thumb-left,
|
|
113
|
+
width: calc(var(--thumb-width) * 1px);
|
|
114
|
+
translate: calc((var(--thumb-left, 0) + var(--thumb-lean, 0)) * 1px) 0;
|
|
108
115
|
}
|
|
109
116
|
/* Until it is placed, the chosen segment's own seat stands in for it (segmented-control.tsx):
|
|
110
117
|
the two change places in one frame, so a page that came from a server has a thumb at once. */
|
|
@@ -116,18 +123,18 @@
|
|
|
116
123
|
px, not in percent of the box. */
|
|
117
124
|
[data-slot="segment-thumb-face"] {
|
|
118
125
|
scale: var(--thumb-long) var(--thumb-tall);
|
|
119
|
-
translate: calc(var(--thumb-off) * var(--thumb-width)) 0;
|
|
126
|
+
translate: calc(var(--thumb-off) * var(--thumb-width) * 1px) 0;
|
|
120
127
|
}
|
|
121
128
|
|
|
122
129
|
/* The inverse: T(c) S(l) is undone by T(-c/l) S(1/l). The press is left in, so a held label
|
|
123
130
|
goes down with its thumb. */
|
|
124
131
|
[data-slot="segment-lens"] {
|
|
125
132
|
scale: calc(1 / var(--thumb-s)) calc(1 / (1 - (var(--thumb-s) - 1) * var(--thumb-thin)));
|
|
126
|
-
translate: calc(-1 * var(--thumb-off) * var(--thumb-width) / var(--thumb-long)) 0;
|
|
133
|
+
translate: calc(-1 * var(--thumb-off) * var(--thumb-width) * 1px / var(--thumb-long)) 0;
|
|
127
134
|
}
|
|
128
135
|
/* And the rider's way taken back: the labels stand where the track's labels stand. */
|
|
129
136
|
[data-slot="segment-lens-labels"] {
|
|
130
|
-
translate: calc(-1 * (var(--thumb-left,
|
|
137
|
+
translate: calc(-1 * (var(--thumb-left, 0) + var(--thumb-lean, 0)) * 1px) 0;
|
|
131
138
|
}
|
|
132
139
|
|
|
133
140
|
/* What eases. On the track, the numbers the face and the lens are worked out from; on the
|
package/src/styles.css
CHANGED