@hanzo/ui 8.0.47 → 8.0.48
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/backends/gui/glass.cjs +22 -13
- package/dist/backends/gui/glass.d.ts +37 -6
- package/dist/backends/gui/glass.d.ts.map +1 -1
- package/dist/backends/gui/glass.js +23 -14
- package/dist/backends/gui/glass.js.map +1 -1
- package/dist/glass.cjs +256 -0
- package/dist/glass.css +140 -0
- package/dist/glass.d.ts +243 -0
- package/dist/glass.d.ts.map +1 -0
- package/dist/glass.js +252 -0
- package/dist/glass.js.map +1 -0
- package/dist/product/SlideOver.cjs +6 -1
- package/dist/product/SlideOver.d.ts.map +1 -1
- package/dist/product/SlideOver.js +6 -1
- package/dist/product/SlideOver.js.map +1 -1
- package/dist/styles/motion.css +10 -3
- package/dist/styles.css +156 -14
- package/dist/theme.css +146 -11
- package/package.json +9 -2
package/dist/glass.d.ts
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The rungs a FLOATING surface may stand on.
|
|
3
|
+
*
|
|
4
|
+
* There is no 1: rung 1 is rest, and a floating thing is never at rest. The
|
|
5
|
+
* type says so, so the mistake cannot be typed.
|
|
6
|
+
*/
|
|
7
|
+
export type Lift = 2 | 3;
|
|
8
|
+
/**
|
|
9
|
+
* Glass — the material floating chrome is made of, and only floating chrome.
|
|
10
|
+
*
|
|
11
|
+
* Menus, dialogs, popovers, toasts, sticky bars: things with page under them.
|
|
12
|
+
* Vibrancy is a lens, so a surface covering nothing but the flat canvas has
|
|
13
|
+
* nothing to soften — an in-flow card wearing this is not glass, it is the page
|
|
14
|
+
* with extra steps, one shade off what it sits on and harder to find than
|
|
15
|
+
* `panel`. Over content -> `glass`, in the flow -> `panel`. No third case.
|
|
16
|
+
*
|
|
17
|
+
* The library's own dialogs, popovers, selects, dropdowns and tooltips are
|
|
18
|
+
* already glass BY SLOT — `glass.css` attaches the material to what a thing IS,
|
|
19
|
+
* so they need nothing from a call site and cannot fall out of step. This is
|
|
20
|
+
* for the surfaces no slot names: a hand-rolled bar, a custom menu, a docked
|
|
21
|
+
* toolbar.
|
|
22
|
+
*
|
|
23
|
+
* MATERIAL ONLY, no geometry. What glass is made of does not tell you what
|
|
24
|
+
* shape it was cut into: a menu is rounded on four sides, a sticky bar is
|
|
25
|
+
* full-bleed with one hairline along its bottom. Baking `borderRadius` and
|
|
26
|
+
* `borderWidth` in here would make every bar undo them, so edges stay at the
|
|
27
|
+
* call site — which only ever needs to say WHICH ones (`borderBottomWidth={1}`),
|
|
28
|
+
* never what colour, because the material already knows.
|
|
29
|
+
*
|
|
30
|
+
* The level is the one thing that genuinely varies, so it is the argument
|
|
31
|
+
* (`selected(on)` is shaped the same way). 2 is anchored — a menu, a toast, a
|
|
32
|
+
* bar, lifted off the page but tied to it. 3 is a modal, floating free over
|
|
33
|
+
* everything with a scrim under it.
|
|
34
|
+
*
|
|
35
|
+
* `backgroundColor` is the opaque fallback, and it is load-bearing rather than
|
|
36
|
+
* belt-and-braces: the material lives inside `@supports (backdrop-filter)`, so
|
|
37
|
+
* a browser that cannot blur gets no rule at all — and a menu with no
|
|
38
|
+
* background is a menu you read the page through.
|
|
39
|
+
*/
|
|
40
|
+
export declare const glass: (level?: Lift) => {
|
|
41
|
+
readonly className: "glass elevation-2" | "glass elevation-3";
|
|
42
|
+
readonly backgroundColor: "$background";
|
|
43
|
+
readonly borderColor: "$borderColor";
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The scrim under anything modal — the dim that makes a floating panel read as
|
|
47
|
+
* floating rather than as more page.
|
|
48
|
+
*
|
|
49
|
+
* Hand-rolled modals reach for `backgroundColor="black"`, with no alpha. That
|
|
50
|
+
* does not dim the page behind them, it DELETES it — and a glass panel over a
|
|
51
|
+
* solid black wall has nothing left to be translucent about, so the scrim
|
|
52
|
+
* cancels the very material it exists to make read.
|
|
53
|
+
*
|
|
54
|
+
* The value is a design token, not a literal, because both languages need it
|
|
55
|
+
* and only one of them can hold the copy: `[data-slot="dialog-overlay"]` reads
|
|
56
|
+
* `--surface-scrim` in `glass.css` and this reads the same token, so the dim
|
|
57
|
+
* behind a library dialog and the dim behind a hand-rolled one are the same dim
|
|
58
|
+
* by construction rather than by two people remembering a number.
|
|
59
|
+
*/
|
|
60
|
+
export declare const scrim: {
|
|
61
|
+
readonly backgroundColor: "var(--surface-scrim, rgb(0 0 0 / .8))";
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* A panel: the quiet surface content in the FLOW sits on.
|
|
65
|
+
*
|
|
66
|
+
* `$color2` is a step off the page, so the fill alone separates the panel from
|
|
67
|
+
* the page and the hairline only finishes the edge. Panels are otherwise
|
|
68
|
+
* variously `$background` (a border with nothing behind it), `$color3` (which
|
|
69
|
+
* is the ACTIVE-item fill — a state, not a surface) and as many radii as there
|
|
70
|
+
* are authors.
|
|
71
|
+
*
|
|
72
|
+
* Rung 1 on the ladder, which is NOT the same claim as "this floats". A cast
|
|
73
|
+
* shadow does say "above the page", and that stays false for a panel in the
|
|
74
|
+
* flow — so rung 1 spends almost nothing on shadow and buys its depth from the
|
|
75
|
+
* lit top edge instead. On a near-black canvas that is the only half that reads
|
|
76
|
+
* at all.
|
|
77
|
+
*/
|
|
78
|
+
export declare const panel: {
|
|
79
|
+
readonly backgroundColor: "$color2";
|
|
80
|
+
readonly borderWidth: 1;
|
|
81
|
+
readonly borderColor: "$borderColor";
|
|
82
|
+
readonly borderRadius: "$6";
|
|
83
|
+
readonly className: "elevation-1";
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* A group of rows — the settings card, and the reason a settings page ends up
|
|
87
|
+
* with four cards where it wanted one.
|
|
88
|
+
*
|
|
89
|
+
* Four toggles as four separate panels reads as four unrelated decisions, each
|
|
90
|
+
* with its own four edges; the same four inside one card, parted by hairlines,
|
|
91
|
+
* reads as one set and drops twelve edges of noise. That is the macOS settings
|
|
92
|
+
* group, and it is the shape every settings surface reaches for by hand.
|
|
93
|
+
*
|
|
94
|
+
* `overflow: hidden` is not decoration — the separators are drawn by the card
|
|
95
|
+
* (`[data-slot="rows"] > * + *`), and without the clip the topmost one runs
|
|
96
|
+
* straight through the rounded corner and out the side.
|
|
97
|
+
*
|
|
98
|
+
* It spreads `panel` WHOLE, so moving the panel up or down the ladder moves its
|
|
99
|
+
* groups with it. The separator hangs off a slot rather than a second class
|
|
100
|
+
* name for the same reason: there is no string to keep in step.
|
|
101
|
+
*/
|
|
102
|
+
export declare const rows: {
|
|
103
|
+
readonly overflow: "hidden";
|
|
104
|
+
readonly backgroundColor: "$color2";
|
|
105
|
+
readonly borderWidth: 1;
|
|
106
|
+
readonly borderColor: "$borderColor";
|
|
107
|
+
readonly borderRadius: "$6";
|
|
108
|
+
readonly className: "elevation-1";
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* One line inside a `rows` card: name on the left, control hard right.
|
|
112
|
+
*
|
|
113
|
+
* The rhythm, so it stops being re-decided per file. Pair it with a label at
|
|
114
|
+
* `fontSize="$3"` in `$color` and any explanation under it at `$1` in
|
|
115
|
+
* `$color11` — both halves matter, because a row whose label is written at
|
|
116
|
+
* `$color11` (the SECONDARY colour) gives the name of the setting and the
|
|
117
|
+
* footnote about it the same weight of grey, and the row has no first thing to
|
|
118
|
+
* read.
|
|
119
|
+
*
|
|
120
|
+
* No border here. A row that draws its own top hairline is a row that has to
|
|
121
|
+
* know whether it is first, and the card already knows — see `rows`.
|
|
122
|
+
*/
|
|
123
|
+
export declare const row: {
|
|
124
|
+
readonly flexDirection: "row";
|
|
125
|
+
readonly alignItems: "center";
|
|
126
|
+
readonly justifyContent: "space-between";
|
|
127
|
+
readonly gap: "$4";
|
|
128
|
+
readonly paddingHorizontal: "$4";
|
|
129
|
+
readonly paddingVertical: "$3";
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Selected — the ONE "you are here" look, wherever a set offers a choice: nav
|
|
133
|
+
* rows, tabs, a filter chip.
|
|
134
|
+
*
|
|
135
|
+
* `$color3` fill with a full-strength label, one step above the panel it sits
|
|
136
|
+
* on. The alternatives in the wild are a pure-white lozenge, and — far more
|
|
137
|
+
* often — no answer at all: an unstyled `TabsTrigger` paints a selected tab
|
|
138
|
+
* exactly like its neighbours, so the page simply does not say which one you
|
|
139
|
+
* are on. Nothing in the markup looks wrong; the state has no picture.
|
|
140
|
+
*
|
|
141
|
+
* The label is `$color12`, not `$color`, and that is a measured distinction
|
|
142
|
+
* rather than a preference. Themes NEST: at the page scope `--color` is
|
|
143
|
+
* hsl(0 0% 100%), but inside a sidebar's scope it is re-based to hsl(0 0% 80%)
|
|
144
|
+
* — the SAME value as `--color11`. So a selected row asking for `$color` gets
|
|
145
|
+
* exactly its neighbours' colour, and had been doing so all along; the markup
|
|
146
|
+
* said "highlight this" and the token quietly collapsed underneath. `$color12`
|
|
147
|
+
* is the theme's full-strength foreground in every scope, so the state survives
|
|
148
|
+
* nesting.
|
|
149
|
+
*/
|
|
150
|
+
export declare const selected: (on: boolean) => {
|
|
151
|
+
readonly backgroundColor: "$color3";
|
|
152
|
+
readonly color: "$color12";
|
|
153
|
+
} | {
|
|
154
|
+
readonly backgroundColor: "transparent";
|
|
155
|
+
readonly color: "$color11";
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* The primary control — the ONE loud thing a page is allowed.
|
|
159
|
+
*
|
|
160
|
+
* `$color5` on `$color6` is a raised pushbutton: legible, quiet, monochrome.
|
|
161
|
+
*
|
|
162
|
+
* Under-emphasis is the failure mode, and it leaves no mark on a screenshot,
|
|
163
|
+
* which is exactly why it needs a rule rather than an eye. `Button`'s `default`
|
|
164
|
+
* variant is a QUIET control on the surface ladder (`$color2`, the same fill
|
|
165
|
+
* `panel` uses), so a dialog whose only action is an unnamed `<Button>` paints
|
|
166
|
+
* its single ask as another surface. Name a variant on every control, and when
|
|
167
|
+
* one is the primary action, spread this. Never `variant="default"`.
|
|
168
|
+
*
|
|
169
|
+
* Not `variant="primary"` either, even though it paints the same pixels — a
|
|
170
|
+
* variant only reaches a `Button`, and half the loud controls in a real app are
|
|
171
|
+
* an `XStack`, a `SizableText` or a `Link`.
|
|
172
|
+
*/
|
|
173
|
+
export declare const accent: {
|
|
174
|
+
readonly backgroundColor: "$color5";
|
|
175
|
+
readonly borderWidth: 1;
|
|
176
|
+
readonly borderColor: "$color6";
|
|
177
|
+
/**
|
|
178
|
+
* The foreground is part of the recipe, not an afterthought.
|
|
179
|
+
*
|
|
180
|
+
* Spell the fill by hand and you own the label too, and that half is the one
|
|
181
|
+
* people drop: a hand-spelled `color="$color1"` (4% grey) on a fill that has
|
|
182
|
+
* since moved to `$color2` (8%) paints a label at 1.07:1 — measured in the
|
|
183
|
+
* browser, not guessed. The sign-in modal's only button was invisible.
|
|
184
|
+
*
|
|
185
|
+
* And it only reaches a label the BUTTON paints. This is the half that is
|
|
186
|
+
* easy to miss: `<Button {...accent}><SizableText>…</SizableText></Button>`
|
|
187
|
+
* puts a second component between the recipe and the text, and that component
|
|
188
|
+
* resolves its own colour from the theme scope the Button just mounted —
|
|
189
|
+
* where `--color` is re-based to 80%. Measured: fill rgb(51,51,51) and border
|
|
190
|
+
* rgb(69,69,69), correct, with the label at rgb(204,204,204) — `$color11`,
|
|
191
|
+
* the QUIET foreground, on the loudest control in the dialog.
|
|
192
|
+
*
|
|
193
|
+
* Two guesses about the cure are both WRONG, and each was measured:
|
|
194
|
+
*
|
|
195
|
+
* - "Just don't name a colour." A bare `<SizableText>` inside the Button
|
|
196
|
+
* still measures rgb(204,204,204). Silence is not neutral here; the
|
|
197
|
+
* nested scope answers for you. The rule is to SAY `$color12`, not to say
|
|
198
|
+
* nothing.
|
|
199
|
+
* - "Hoist the size to the Button and drop the wrapper." `fontSize="$1"` on
|
|
200
|
+
* the Button does not reach the label — still the `size` default. So a
|
|
201
|
+
* control that genuinely wants a smaller label keeps its wrapper.
|
|
202
|
+
*
|
|
203
|
+
* Which leaves two honest shapes. No size of your own -> hand the string
|
|
204
|
+
* straight to the Button and let its text host paint it. A deliberate size or
|
|
205
|
+
* `numberOfLines` -> keep the wrapper and give it `color="$color12"`.
|
|
206
|
+
*
|
|
207
|
+
* BUTTON ONLY. A plain `XStack` mounts no theme scope, so a label inside one
|
|
208
|
+
* that asks for `$color` measures rgb(255,255,255) — correct, and not to be
|
|
209
|
+
* "fixed". The ban is exactly as wide as the re-basing.
|
|
210
|
+
*/
|
|
211
|
+
readonly color: "$color12";
|
|
212
|
+
readonly hoverStyle: {
|
|
213
|
+
readonly backgroundColor: "$color6";
|
|
214
|
+
readonly color: "$color12";
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* A state that owns the whole screen: a loading gate, a 404, a crash screen, an
|
|
219
|
+
* OAuth callback, a receipt. It stands alone — no shell above it — so it must
|
|
220
|
+
* MEASURE the screen itself.
|
|
221
|
+
*
|
|
222
|
+
* `minHeight="100%"` does not measure it, and that is the bug this value ends.
|
|
223
|
+
* A percentage resolves against the parent's computed height; every ancestor up
|
|
224
|
+
* to `<body>` is `height: auto`, and `@hanzo/gui`'s provider span is
|
|
225
|
+
* `display: contents`, so there is no box in between either. The percentage
|
|
226
|
+
* resolves to auto, the stack shrink-wraps its content, and `justifyContent:
|
|
227
|
+
* center` then centres inside THAT — perfectly, and invisibly, in a box the
|
|
228
|
+
* height of the content. Measured: a brand mark at y=0 of a 903px viewport with
|
|
229
|
+
* 860px of black under it, across ten states carrying the identical line.
|
|
230
|
+
*
|
|
231
|
+
* `dvh`, not `vh`: on a phone the URL bar collapses and `100vh` overflows by
|
|
232
|
+
* its height.
|
|
233
|
+
*
|
|
234
|
+
* The centring travels WITH the measure because the two are one decision — a
|
|
235
|
+
* state that fills the screen holds a paragraph of content — and half of this
|
|
236
|
+
* recipe is what produced the defect in the first place.
|
|
237
|
+
*/
|
|
238
|
+
export declare const screen: {
|
|
239
|
+
readonly minHeight: "100dvh";
|
|
240
|
+
readonly alignItems: "center";
|
|
241
|
+
readonly justifyContent: "center";
|
|
242
|
+
};
|
|
243
|
+
//# sourceMappingURL=glass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glass.d.ts","sourceRoot":"","sources":["../src/glass.ts"],"names":[],"mappings":"AA6BA;;;;;GAKG;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,KAAK,GAAI,QAAO,IAAQ;;;;CAKxB,CAAA;AAEb;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK;;CAAwE,CAAA;AAE1F;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK;;;;;;CAMR,CAAA;AAEV;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,IAAI;;;;;;;CAIP,CAAA;AAEV;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,GAAG;;;;;;;CAON,CAAA;AAEV;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,QAAQ,GAAI,IAAI,OAAO;;;;;;CAGkC,CAAA;AAEtE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM;;;;IAIjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;;;;;;CAGK,CAAA;AAEV;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM;;;;CAIT,CAAA"}
|
package/dist/glass.js
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chrome, as values — `@hanzo/ui/glass`.
|
|
3
|
+
*
|
|
4
|
+
* import { glass, panel, scrim } from '@hanzo/ui/glass'
|
|
5
|
+
* import '@hanzo/ui/glass.css' // or '@hanzo/ui/theme.css', which inlines it
|
|
6
|
+
*
|
|
7
|
+
* Eight recipes, because eight things were being spelled out by hand on every
|
|
8
|
+
* page and drifting apart every time: what a floating surface is made of, what
|
|
9
|
+
* a resting one is made of, what dims the page under a modal, how a set of
|
|
10
|
+
* rows is grouped, what one of those rows looks like, which item in a set is
|
|
11
|
+
* the current one, which control is the loud one, and what it means to fill the
|
|
12
|
+
* screen. Each is ONE value here and nowhere else.
|
|
13
|
+
*
|
|
14
|
+
* They are plain objects, spread onto any `@hanzo/gui` element:
|
|
15
|
+
*
|
|
16
|
+
* <YStack {...panel}>…</YStack>
|
|
17
|
+
* <XStack {...glass(2)} borderBottomWidth={1}>…</XStack>
|
|
18
|
+
*
|
|
19
|
+
* A recipe rather than a component or a variant, because a variant only reaches
|
|
20
|
+
* the one component that declares it and half of what wants these is an
|
|
21
|
+
* `XStack`, a `SizableText` or a `Link`. One value that spreads onto any
|
|
22
|
+
* element beats N spellings of it.
|
|
23
|
+
*
|
|
24
|
+
* The material and the ladder live in `glass.css`; these name them. Nothing
|
|
25
|
+
* here restates a colour, a shadow or a blur radius — see that file for where
|
|
26
|
+
* the values come from (`@hanzo/design`).
|
|
27
|
+
*/
|
|
28
|
+
import { slot } from './backends/gui/slot.js';
|
|
29
|
+
/**
|
|
30
|
+
* Glass — the material floating chrome is made of, and only floating chrome.
|
|
31
|
+
*
|
|
32
|
+
* Menus, dialogs, popovers, toasts, sticky bars: things with page under them.
|
|
33
|
+
* Vibrancy is a lens, so a surface covering nothing but the flat canvas has
|
|
34
|
+
* nothing to soften — an in-flow card wearing this is not glass, it is the page
|
|
35
|
+
* with extra steps, one shade off what it sits on and harder to find than
|
|
36
|
+
* `panel`. Over content -> `glass`, in the flow -> `panel`. No third case.
|
|
37
|
+
*
|
|
38
|
+
* The library's own dialogs, popovers, selects, dropdowns and tooltips are
|
|
39
|
+
* already glass BY SLOT — `glass.css` attaches the material to what a thing IS,
|
|
40
|
+
* so they need nothing from a call site and cannot fall out of step. This is
|
|
41
|
+
* for the surfaces no slot names: a hand-rolled bar, a custom menu, a docked
|
|
42
|
+
* toolbar.
|
|
43
|
+
*
|
|
44
|
+
* MATERIAL ONLY, no geometry. What glass is made of does not tell you what
|
|
45
|
+
* shape it was cut into: a menu is rounded on four sides, a sticky bar is
|
|
46
|
+
* full-bleed with one hairline along its bottom. Baking `borderRadius` and
|
|
47
|
+
* `borderWidth` in here would make every bar undo them, so edges stay at the
|
|
48
|
+
* call site — which only ever needs to say WHICH ones (`borderBottomWidth={1}`),
|
|
49
|
+
* never what colour, because the material already knows.
|
|
50
|
+
*
|
|
51
|
+
* The level is the one thing that genuinely varies, so it is the argument
|
|
52
|
+
* (`selected(on)` is shaped the same way). 2 is anchored — a menu, a toast, a
|
|
53
|
+
* bar, lifted off the page but tied to it. 3 is a modal, floating free over
|
|
54
|
+
* everything with a scrim under it.
|
|
55
|
+
*
|
|
56
|
+
* `backgroundColor` is the opaque fallback, and it is load-bearing rather than
|
|
57
|
+
* belt-and-braces: the material lives inside `@supports (backdrop-filter)`, so
|
|
58
|
+
* a browser that cannot blur gets no rule at all — and a menu with no
|
|
59
|
+
* background is a menu you read the page through.
|
|
60
|
+
*/
|
|
61
|
+
export const glass = (level = 2) => ({
|
|
62
|
+
className: `glass elevation-${level}`,
|
|
63
|
+
backgroundColor: '$background',
|
|
64
|
+
borderColor: '$borderColor',
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* The scrim under anything modal — the dim that makes a floating panel read as
|
|
68
|
+
* floating rather than as more page.
|
|
69
|
+
*
|
|
70
|
+
* Hand-rolled modals reach for `backgroundColor="black"`, with no alpha. That
|
|
71
|
+
* does not dim the page behind them, it DELETES it — and a glass panel over a
|
|
72
|
+
* solid black wall has nothing left to be translucent about, so the scrim
|
|
73
|
+
* cancels the very material it exists to make read.
|
|
74
|
+
*
|
|
75
|
+
* The value is a design token, not a literal, because both languages need it
|
|
76
|
+
* and only one of them can hold the copy: `[data-slot="dialog-overlay"]` reads
|
|
77
|
+
* `--surface-scrim` in `glass.css` and this reads the same token, so the dim
|
|
78
|
+
* behind a library dialog and the dim behind a hand-rolled one are the same dim
|
|
79
|
+
* by construction rather than by two people remembering a number.
|
|
80
|
+
*/
|
|
81
|
+
export const scrim = { backgroundColor: 'var(--surface-scrim, rgb(0 0 0 / .8))' };
|
|
82
|
+
/**
|
|
83
|
+
* A panel: the quiet surface content in the FLOW sits on.
|
|
84
|
+
*
|
|
85
|
+
* `$color2` is a step off the page, so the fill alone separates the panel from
|
|
86
|
+
* the page and the hairline only finishes the edge. Panels are otherwise
|
|
87
|
+
* variously `$background` (a border with nothing behind it), `$color3` (which
|
|
88
|
+
* is the ACTIVE-item fill — a state, not a surface) and as many radii as there
|
|
89
|
+
* are authors.
|
|
90
|
+
*
|
|
91
|
+
* Rung 1 on the ladder, which is NOT the same claim as "this floats". A cast
|
|
92
|
+
* shadow does say "above the page", and that stays false for a panel in the
|
|
93
|
+
* flow — so rung 1 spends almost nothing on shadow and buys its depth from the
|
|
94
|
+
* lit top edge instead. On a near-black canvas that is the only half that reads
|
|
95
|
+
* at all.
|
|
96
|
+
*/
|
|
97
|
+
export const panel = {
|
|
98
|
+
backgroundColor: '$color2',
|
|
99
|
+
borderWidth: 1,
|
|
100
|
+
borderColor: '$borderColor',
|
|
101
|
+
borderRadius: '$6',
|
|
102
|
+
className: 'elevation-1',
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* A group of rows — the settings card, and the reason a settings page ends up
|
|
106
|
+
* with four cards where it wanted one.
|
|
107
|
+
*
|
|
108
|
+
* Four toggles as four separate panels reads as four unrelated decisions, each
|
|
109
|
+
* with its own four edges; the same four inside one card, parted by hairlines,
|
|
110
|
+
* reads as one set and drops twelve edges of noise. That is the macOS settings
|
|
111
|
+
* group, and it is the shape every settings surface reaches for by hand.
|
|
112
|
+
*
|
|
113
|
+
* `overflow: hidden` is not decoration — the separators are drawn by the card
|
|
114
|
+
* (`[data-slot="rows"] > * + *`), and without the clip the topmost one runs
|
|
115
|
+
* straight through the rounded corner and out the side.
|
|
116
|
+
*
|
|
117
|
+
* It spreads `panel` WHOLE, so moving the panel up or down the ladder moves its
|
|
118
|
+
* groups with it. The separator hangs off a slot rather than a second class
|
|
119
|
+
* name for the same reason: there is no string to keep in step.
|
|
120
|
+
*/
|
|
121
|
+
export const rows = {
|
|
122
|
+
...panel,
|
|
123
|
+
...slot('rows'),
|
|
124
|
+
overflow: 'hidden',
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* One line inside a `rows` card: name on the left, control hard right.
|
|
128
|
+
*
|
|
129
|
+
* The rhythm, so it stops being re-decided per file. Pair it with a label at
|
|
130
|
+
* `fontSize="$3"` in `$color` and any explanation under it at `$1` in
|
|
131
|
+
* `$color11` — both halves matter, because a row whose label is written at
|
|
132
|
+
* `$color11` (the SECONDARY colour) gives the name of the setting and the
|
|
133
|
+
* footnote about it the same weight of grey, and the row has no first thing to
|
|
134
|
+
* read.
|
|
135
|
+
*
|
|
136
|
+
* No border here. A row that draws its own top hairline is a row that has to
|
|
137
|
+
* know whether it is first, and the card already knows — see `rows`.
|
|
138
|
+
*/
|
|
139
|
+
export const row = {
|
|
140
|
+
flexDirection: 'row',
|
|
141
|
+
alignItems: 'center',
|
|
142
|
+
justifyContent: 'space-between',
|
|
143
|
+
gap: '$4',
|
|
144
|
+
paddingHorizontal: '$4',
|
|
145
|
+
paddingVertical: '$3',
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Selected — the ONE "you are here" look, wherever a set offers a choice: nav
|
|
149
|
+
* rows, tabs, a filter chip.
|
|
150
|
+
*
|
|
151
|
+
* `$color3` fill with a full-strength label, one step above the panel it sits
|
|
152
|
+
* on. The alternatives in the wild are a pure-white lozenge, and — far more
|
|
153
|
+
* often — no answer at all: an unstyled `TabsTrigger` paints a selected tab
|
|
154
|
+
* exactly like its neighbours, so the page simply does not say which one you
|
|
155
|
+
* are on. Nothing in the markup looks wrong; the state has no picture.
|
|
156
|
+
*
|
|
157
|
+
* The label is `$color12`, not `$color`, and that is a measured distinction
|
|
158
|
+
* rather than a preference. Themes NEST: at the page scope `--color` is
|
|
159
|
+
* hsl(0 0% 100%), but inside a sidebar's scope it is re-based to hsl(0 0% 80%)
|
|
160
|
+
* — the SAME value as `--color11`. So a selected row asking for `$color` gets
|
|
161
|
+
* exactly its neighbours' colour, and had been doing so all along; the markup
|
|
162
|
+
* said "highlight this" and the token quietly collapsed underneath. `$color12`
|
|
163
|
+
* is the theme's full-strength foreground in every scope, so the state survives
|
|
164
|
+
* nesting.
|
|
165
|
+
*/
|
|
166
|
+
export const selected = (on) => on
|
|
167
|
+
? { backgroundColor: '$color3', color: '$color12' }
|
|
168
|
+
: { backgroundColor: 'transparent', color: '$color11' };
|
|
169
|
+
/**
|
|
170
|
+
* The primary control — the ONE loud thing a page is allowed.
|
|
171
|
+
*
|
|
172
|
+
* `$color5` on `$color6` is a raised pushbutton: legible, quiet, monochrome.
|
|
173
|
+
*
|
|
174
|
+
* Under-emphasis is the failure mode, and it leaves no mark on a screenshot,
|
|
175
|
+
* which is exactly why it needs a rule rather than an eye. `Button`'s `default`
|
|
176
|
+
* variant is a QUIET control on the surface ladder (`$color2`, the same fill
|
|
177
|
+
* `panel` uses), so a dialog whose only action is an unnamed `<Button>` paints
|
|
178
|
+
* its single ask as another surface. Name a variant on every control, and when
|
|
179
|
+
* one is the primary action, spread this. Never `variant="default"`.
|
|
180
|
+
*
|
|
181
|
+
* Not `variant="primary"` either, even though it paints the same pixels — a
|
|
182
|
+
* variant only reaches a `Button`, and half the loud controls in a real app are
|
|
183
|
+
* an `XStack`, a `SizableText` or a `Link`.
|
|
184
|
+
*/
|
|
185
|
+
export const accent = {
|
|
186
|
+
backgroundColor: '$color5',
|
|
187
|
+
borderWidth: 1,
|
|
188
|
+
borderColor: '$color6',
|
|
189
|
+
/**
|
|
190
|
+
* The foreground is part of the recipe, not an afterthought.
|
|
191
|
+
*
|
|
192
|
+
* Spell the fill by hand and you own the label too, and that half is the one
|
|
193
|
+
* people drop: a hand-spelled `color="$color1"` (4% grey) on a fill that has
|
|
194
|
+
* since moved to `$color2` (8%) paints a label at 1.07:1 — measured in the
|
|
195
|
+
* browser, not guessed. The sign-in modal's only button was invisible.
|
|
196
|
+
*
|
|
197
|
+
* And it only reaches a label the BUTTON paints. This is the half that is
|
|
198
|
+
* easy to miss: `<Button {...accent}><SizableText>…</SizableText></Button>`
|
|
199
|
+
* puts a second component between the recipe and the text, and that component
|
|
200
|
+
* resolves its own colour from the theme scope the Button just mounted —
|
|
201
|
+
* where `--color` is re-based to 80%. Measured: fill rgb(51,51,51) and border
|
|
202
|
+
* rgb(69,69,69), correct, with the label at rgb(204,204,204) — `$color11`,
|
|
203
|
+
* the QUIET foreground, on the loudest control in the dialog.
|
|
204
|
+
*
|
|
205
|
+
* Two guesses about the cure are both WRONG, and each was measured:
|
|
206
|
+
*
|
|
207
|
+
* - "Just don't name a colour." A bare `<SizableText>` inside the Button
|
|
208
|
+
* still measures rgb(204,204,204). Silence is not neutral here; the
|
|
209
|
+
* nested scope answers for you. The rule is to SAY `$color12`, not to say
|
|
210
|
+
* nothing.
|
|
211
|
+
* - "Hoist the size to the Button and drop the wrapper." `fontSize="$1"` on
|
|
212
|
+
* the Button does not reach the label — still the `size` default. So a
|
|
213
|
+
* control that genuinely wants a smaller label keeps its wrapper.
|
|
214
|
+
*
|
|
215
|
+
* Which leaves two honest shapes. No size of your own -> hand the string
|
|
216
|
+
* straight to the Button and let its text host paint it. A deliberate size or
|
|
217
|
+
* `numberOfLines` -> keep the wrapper and give it `color="$color12"`.
|
|
218
|
+
*
|
|
219
|
+
* BUTTON ONLY. A plain `XStack` mounts no theme scope, so a label inside one
|
|
220
|
+
* that asks for `$color` measures rgb(255,255,255) — correct, and not to be
|
|
221
|
+
* "fixed". The ban is exactly as wide as the re-basing.
|
|
222
|
+
*/
|
|
223
|
+
color: '$color12',
|
|
224
|
+
hoverStyle: { backgroundColor: '$color6', color: '$color12' },
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* A state that owns the whole screen: a loading gate, a 404, a crash screen, an
|
|
228
|
+
* OAuth callback, a receipt. It stands alone — no shell above it — so it must
|
|
229
|
+
* MEASURE the screen itself.
|
|
230
|
+
*
|
|
231
|
+
* `minHeight="100%"` does not measure it, and that is the bug this value ends.
|
|
232
|
+
* A percentage resolves against the parent's computed height; every ancestor up
|
|
233
|
+
* to `<body>` is `height: auto`, and `@hanzo/gui`'s provider span is
|
|
234
|
+
* `display: contents`, so there is no box in between either. The percentage
|
|
235
|
+
* resolves to auto, the stack shrink-wraps its content, and `justifyContent:
|
|
236
|
+
* center` then centres inside THAT — perfectly, and invisibly, in a box the
|
|
237
|
+
* height of the content. Measured: a brand mark at y=0 of a 903px viewport with
|
|
238
|
+
* 860px of black under it, across ten states carrying the identical line.
|
|
239
|
+
*
|
|
240
|
+
* `dvh`, not `vh`: on a phone the URL bar collapses and `100vh` overflows by
|
|
241
|
+
* its height.
|
|
242
|
+
*
|
|
243
|
+
* The centring travels WITH the measure because the two are one decision — a
|
|
244
|
+
* state that fills the screen holds a paragraph of content — and half of this
|
|
245
|
+
* recipe is what produced the defect in the first place.
|
|
246
|
+
*/
|
|
247
|
+
export const screen = {
|
|
248
|
+
minHeight: '100dvh',
|
|
249
|
+
alignItems: 'center',
|
|
250
|
+
justifyContent: 'center',
|
|
251
|
+
};
|
|
252
|
+
//# sourceMappingURL=glass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glass.js","sourceRoot":"","sources":["../src/glass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAU1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,QAAc,CAAC,EAAE,EAAE,CACvC,CAAC;IACC,SAAS,EAAE,mBAAmB,KAAK,EAAE;IACrC,eAAe,EAAE,aAAa;IAC9B,WAAW,EAAE,cAAc;CAC5B,CAAU,CAAA;AAEb;;;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;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;CAChB,CAAA"}
|
|
@@ -113,7 +113,12 @@ function SlideOver({ open, onClose, side = 'right', size = 420, title, icon: Ico
|
|
|
113
113
|
ref: panelRef, tabIndex: -1, role: "dialog", "aria-modal": open ? true : undefined, "aria-label": typeof title === 'string' ? title : ariaLabel, position: "absolute", t: 0, b: 0, ...edge, width: "100%", "$lg": { width: size, maxW: '100vw' }, bg: "$color1", borderLeftWidth: side === 'right' ? 1 : 0, borderRightWidth: side === 'left' ? 1 : 0, borderColor: "$borderColor",
|
|
114
114
|
// Material paper depth — the drawer reads as a sheet lifted above the dimmed
|
|
115
115
|
// list behind it (real layered shadow, theme-aware), not a flat panel.
|
|
116
|
-
|
|
116
|
+
//
|
|
117
|
+
// Rung 3, the top of the ladder: a drawer has no anchor and a scrim of its
|
|
118
|
+
// own, so it floats free exactly the way a modal does. It asked for a 4th
|
|
119
|
+
// rung, which is what a ladder turns into when it is treated as a palette —
|
|
120
|
+
// and the 4th was a hardcoded shadow behind a variable nothing defined.
|
|
121
|
+
className: "slide elevation-3",
|
|
117
122
|
// Full-height sheet (100dvh — mobile-safe), inset for the notch (top) + home
|
|
118
123
|
// indicator (bottom) so the drawer header + footer actions clear them on
|
|
119
124
|
// notched devices (env insets are 0 elsewhere, so no effect there).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideOver.d.ts","sourceRoot":"","sources":["../../src/product/SlideOver.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAIzD,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEhD,6EAA6E;AAC7E,QAAA,MAAM,EAAE,OAAO,CAAA;AAmBf,MAAM,M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C,EAAE,SAAS,CAAA;IACjB,sDAAsD;IACtD,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mEAAmE;IACnE,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAID,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,OAAO,EACP,IAAc,EACd,IAAU,EACV,KAAK,EACL,IAAI,EAAE,IAAI,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,MAAa,EACb,QAAQ,GACT,EAAE,cAAc,2CAyIhB;AAED,OAAO,EAAE,EAAE,IAAI,YAAY,EAAE,CAAA"}
|
|
@@ -108,7 +108,12 @@ export function SlideOver({ open, onClose, side = 'right', size = 420, title, ic
|
|
|
108
108
|
ref: panelRef, tabIndex: -1, role: "dialog", "aria-modal": open ? true : undefined, "aria-label": typeof title === 'string' ? title : ariaLabel, position: "absolute", t: 0, b: 0, ...edge, width: "100%", "$lg": { width: size, maxW: '100vw' }, bg: "$color1", borderLeftWidth: side === 'right' ? 1 : 0, borderRightWidth: side === 'left' ? 1 : 0, borderColor: "$borderColor",
|
|
109
109
|
// Material paper depth — the drawer reads as a sheet lifted above the dimmed
|
|
110
110
|
// list behind it (real layered shadow, theme-aware), not a flat panel.
|
|
111
|
-
|
|
111
|
+
//
|
|
112
|
+
// Rung 3, the top of the ladder: a drawer has no anchor and a scrim of its
|
|
113
|
+
// own, so it floats free exactly the way a modal does. It asked for a 4th
|
|
114
|
+
// rung, which is what a ladder turns into when it is treated as a palette —
|
|
115
|
+
// and the 4th was a hardcoded shadow behind a variable nothing defined.
|
|
116
|
+
className: "slide elevation-3",
|
|
112
117
|
// Full-height sheet (100dvh — mobile-safe), inset for the notch (top) + home
|
|
113
118
|
// indicator (bottom) so the drawer header + footer actions clear them on
|
|
114
119
|
// notched devices (env insets are 0 elsewhere, so no effect there).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideOver.js","sourceRoot":"","sources":["../../src/product/SlideOver.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACrE,OAAO,EAAE,CAAC,EAAE,MAAM,0BAA0B,CAAA;AAE5C,OAAO,EAAE,OAAO,EAAiB,MAAM,SAAS,CAAA;AAEhD,6EAA6E;AAC7E,MAAM,EAAE,GAAG,IAAI,CAAA;AAEf,kFAAkF;AAClF,IAAI,SAAS,GAAG,CAAC,CAAA;AACjB,IAAI,aAAa,GAAG,EAAE,CAAA;AACtB,SAAS,UAAU;IACjB,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAM;IAC3C,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;QACpB,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA;QAC5C,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAA;IACzC,CAAC;IACD,SAAS,EAAE,CAAA;AACb,CAAC;AACD,SAAS,YAAY;IACnB,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAM;IAC3C,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,CAAA;IACtC,IAAI,SAAS,KAAK,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,aAAa,CAAA;AACnE,CAAC;AAuBD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;A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ion.css
CHANGED
|
@@ -157,10 +157,17 @@
|
|
|
157
157
|
letter-spacing: -0.01em;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
/* Paper — a ringed sheet: the ladder's lit edge and drop, plus a hairline all
|
|
161
|
+
the way round. The three values are @hanzo/design's, reached by their real
|
|
162
|
+
names. They used to be `--hz-ring` / `--hz-paper-highlight` /
|
|
163
|
+
`--hz-elevation-3`, none of which is defined in this repo, in @hanzo/design
|
|
164
|
+
or in any consumer — so all three resolved to hardcoded fallbacks, and the
|
|
165
|
+
comment above promising that "a host that defines its own --hz-* tokens still
|
|
166
|
+
wins" described a hook nobody could reach. */
|
|
160
167
|
.paper {
|
|
161
|
-
box-shadow: var(--
|
|
162
|
-
var(--
|
|
163
|
-
var(--
|
|
168
|
+
box-shadow: var(--shadow-inset-hairline, inset 0 0 0 1px rgb(255 255 255 / .10)),
|
|
169
|
+
var(--edge-highlight, inset 0 1px 0 0 rgb(255 255 255 / .10)),
|
|
170
|
+
var(--shadow-lg, 0 10px 15px -3px rgb(0 0 0 / .55), 0 4px 6px -4px rgb(0 0 0 / .55));
|
|
164
171
|
}
|
|
165
172
|
|
|
166
173
|
@keyframes menu-in {
|