gooee 0.41.1 → 0.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/components/AnimatedNumber/AnimatedNumber.module.css +3 -3
- package/src/components/Badge/Badge.module.css +1 -1
- package/src/components/Button/Button.module.css +4 -4
- package/src/components/Dial/Dial.module.css +2 -2
- package/src/components/Dialog/Dialog.module.css +10 -4
- package/src/components/HoldToConfirm/HoldToConfirm.module.css +37 -52
- package/src/components/HoldToConfirm/HoldToConfirm.tsx +146 -60
- package/src/components/Kbd/Kbd.module.css +1 -1
- package/src/components/LivePill/LivePill.module.css +211 -31
- package/src/components/LivePill/LivePill.tsx +45 -14
- package/src/components/MorphButton/MorphButton.module.css +8 -4
- package/src/components/PickerWheel/PickerWheel.module.css +1 -1
- package/src/components/Popover/Popover.module.css +11 -3
- package/src/components/Prose/Prose.module.css +4 -2
- package/src/components/RulerScrubber/RulerScrubber.module.css +1 -1
- package/src/components/SegmentedControl/SegmentedControl.module.css +3 -3
- package/src/components/Sheet/Sheet.module.css +10 -3
- package/src/components/Skeleton/Skeleton.module.css +1 -1
- package/src/components/SplitFlap/SplitFlap.module.css +1 -1
- package/src/components/Switch/Switch.module.css +1 -1
- package/src/components/Tabs/Tabs.module.css +34 -33
- package/src/components/Tabs/Tabs.tsx +64 -21
- package/src/components/ThemeToggle/ThemeToggle.module.css +6 -15
- package/src/components/ThemeToggle/ThemeToggle.tsx +108 -9
- package/src/components/Toast/Toast.module.css +6 -3
- package/src/components/Toast/Toast.tsx +2 -2
- package/src/components/Toggle/Toggle.module.css +1 -1
- package/src/internal/liquidMatter.ts +42 -11
- package/src/internal/motion.ts +1 -1
- package/src/internal/themeReveal.ts +63 -0
- package/src/tokens.css +53 -15
package/src/tokens.css
CHANGED
|
@@ -62,20 +62,30 @@
|
|
|
62
62
|
/* Type */
|
|
63
63
|
--gooee-font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
64
64
|
--gooee-font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
|
|
65
|
-
|
|
65
|
+
/* The golden scale: every second step is x1.618 (13, 21, 34, 55 run on Fibonacci). xs and lg are kept
|
|
66
|
+
as names: xs is the caption size, and a large control keeps body-size words and gains room instead. */
|
|
67
|
+
--gooee-text-xs: 13px;
|
|
66
68
|
--gooee-text-sm: 13px;
|
|
67
|
-
--gooee-text-md:
|
|
69
|
+
--gooee-text-md: 16px;
|
|
68
70
|
/* Text typed into a field. On a touch screen it is at least 16px, or iPhone Safari zooms
|
|
69
71
|
the page in when the field is tapped. */
|
|
70
72
|
--gooee-text-input: var(--gooee-text-md);
|
|
71
|
-
--gooee-text-lg:
|
|
72
|
-
--gooee-text-xl:
|
|
73
|
+
--gooee-text-lg: 16px;
|
|
74
|
+
--gooee-text-xl: 21px;
|
|
73
75
|
--gooee-text-2xl: 26px;
|
|
74
76
|
--gooee-text-3xl: 34px;
|
|
75
|
-
--gooee-text-4xl:
|
|
76
|
-
--gooee-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
--gooee-text-4xl: 42px;
|
|
78
|
+
--gooee-text-5xl: 55px;
|
|
79
|
+
/* Line height as a ratio of the text size. The leading tokens below round it to a whole 4px line box
|
|
80
|
+
on each element that uses them, so text never sits between pixels. */
|
|
81
|
+
--gooee-leading-none-ratio: 1;
|
|
82
|
+
--gooee-leading-tight-ratio: 1.2;
|
|
83
|
+
--gooee-leading-snug-ratio: 1.4;
|
|
84
|
+
--gooee-leading-normal-ratio: 1.618;
|
|
85
|
+
--gooee-leading-none: var(--gooee-leading-none-ratio);
|
|
86
|
+
--gooee-leading-tight: var(--gooee-leading-tight-ratio);
|
|
87
|
+
--gooee-leading-snug: var(--gooee-leading-snug-ratio);
|
|
88
|
+
--gooee-leading-normal: var(--gooee-leading-normal-ratio);
|
|
79
89
|
/* Prose: the longest line of reading text, about the most an eye follows back to the next line */
|
|
80
90
|
--gooee-prose-w: 68ch;
|
|
81
91
|
--gooee-weight-regular: 400;
|
|
@@ -102,18 +112,24 @@
|
|
|
102
112
|
|
|
103
113
|
/* Sizes */
|
|
104
114
|
--gooee-line: 1px;
|
|
105
|
-
|
|
115
|
+
/* Lines are 1px or 2px: whole pixels, never a half that blurs. */
|
|
116
|
+
--gooee-line-thick: 2px;
|
|
106
117
|
--gooee-hit-min: 44px;
|
|
107
118
|
--gooee-control-h-sm: 32px;
|
|
108
119
|
--gooee-control-h-md: 40px;
|
|
109
120
|
--gooee-control-h-lg: 48px;
|
|
121
|
+
/* A control's side padding is its height divided by the golden ratio, on the 4px grid: 20, 24, 28. */
|
|
122
|
+
--gooee-control-pad-sm: 20px;
|
|
123
|
+
--gooee-control-pad-md: 24px;
|
|
124
|
+
--gooee-control-pad-lg: 28px;
|
|
110
125
|
--gooee-icon-sm: 14px;
|
|
111
126
|
--gooee-icon-md: 16px;
|
|
112
127
|
--gooee-icon-lg: 20px;
|
|
113
128
|
--gooee-icon-xl: 28px;
|
|
114
|
-
|
|
115
|
-
--gooee-panel-w-
|
|
116
|
-
--gooee-panel-w-
|
|
129
|
+
/* Each panel width is the one before times the golden ratio, on the 4px grid. */
|
|
130
|
+
--gooee-panel-w-sm: 320px;
|
|
131
|
+
--gooee-panel-w-md: 520px;
|
|
132
|
+
--gooee-panel-w-lg: 840px;
|
|
117
133
|
--gooee-menu-w: 220px;
|
|
118
134
|
--gooee-tooltip-w: 260px;
|
|
119
135
|
--gooee-toast-w: 360px;
|
|
@@ -156,7 +172,7 @@
|
|
|
156
172
|
--gooee-radius-sm: 8px;
|
|
157
173
|
--gooee-radius-md: 12px;
|
|
158
174
|
--gooee-radius-panel: 20px;
|
|
159
|
-
--gooee-radius-sheet:
|
|
175
|
+
--gooee-radius-sheet: 32px;
|
|
160
176
|
--gooee-radius-control: 999px;
|
|
161
177
|
--gooee-radius-full: 999px;
|
|
162
178
|
|
|
@@ -165,6 +181,8 @@
|
|
|
165
181
|
--gooee-shadow-2: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 12px rgb(0 0 0 / 0.06);
|
|
166
182
|
--gooee-shadow-3: 0 2px 4px rgb(0 0 0 / 0.04), 0 12px 32px rgb(0 0 0 / 0.1);
|
|
167
183
|
--gooee-shadow-4: 0 4px 8px rgb(0 0 0 / 0.05), 0 24px 64px rgb(0 0 0 / 0.16);
|
|
184
|
+
/* A thumb on its track. Every layer blurs at least twice its drop, so no hard edge shows */
|
|
185
|
+
--gooee-shadow-thumb: 0 1px 3px rgb(0 0 0 / 0.04), 0 3px 8px rgb(0 0 0 / 0.04), 0 6px 16px rgb(0 0 0 / 0.04);
|
|
168
186
|
|
|
169
187
|
/* Motion. Every duration is its base times --gooee-motion-scale, so one value retimes the whole
|
|
170
188
|
library (see Retime). 1 is normal, 1.5 is slower, 0 is no motion. Reduced motion still wins. */
|
|
@@ -178,6 +196,9 @@
|
|
|
178
196
|
back in 400ms, both on --gooee-ease-morph played forward, so a close starts moving at once */
|
|
179
197
|
--gooee-motion-morph: calc(600ms * var(--gooee-motion-scale));
|
|
180
198
|
--gooee-motion-morph-out: calc(400ms * var(--gooee-motion-scale));
|
|
199
|
+
/* A theme change: the new theme grows from the toggle in a circle over the whole screen. The morph's
|
|
200
|
+
close time: a whole-screen change reads best in about 200 to 400ms, and its icon ends with it. */
|
|
201
|
+
--gooee-motion-reveal: var(--gooee-motion-morph-out);
|
|
181
202
|
/* Older names, kept so apps that use them still work. They are the morph now */
|
|
182
203
|
--gooee-motion-pour: var(--gooee-motion-morph);
|
|
183
204
|
--gooee-motion-liquid: var(--gooee-motion-morph);
|
|
@@ -190,8 +211,8 @@
|
|
|
190
211
|
--gooee-motion-shimmer: 1400ms;
|
|
191
212
|
--gooee-motion-spin: 800ms;
|
|
192
213
|
--gooee-motion-indeterminate: 1500ms;
|
|
193
|
-
/* Morph: the one curve for every move.
|
|
194
|
-
|
|
214
|
+
/* Morph: the one curve for every move. A soft lift-off, then a long settle, with no overshoot.
|
|
215
|
+
Opening and closing both play it forward */
|
|
195
216
|
--gooee-ease-morph: cubic-bezier(0.2, 0, 0, 1);
|
|
196
217
|
/* Older names, kept so apps that use them still work. They are the morph now */
|
|
197
218
|
--gooee-ease-out: var(--gooee-ease-morph);
|
|
@@ -277,6 +298,7 @@
|
|
|
277
298
|
--gooee-shadow-2: 0 1px 2px rgb(0 0 0 / 0.2), 0 4px 12px rgb(0 0 0 / 0.15);
|
|
278
299
|
--gooee-shadow-3: 0 2px 4px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.5);
|
|
279
300
|
--gooee-shadow-4: 0 4px 8px rgb(0 0 0 / 0.4), 0 24px 64px rgb(0 0 0 / 0.6);
|
|
301
|
+
--gooee-shadow-thumb: 0 1px 3px rgb(0 0 0 / 0.12), 0 3px 8px rgb(0 0 0 / 0.12), 0 6px 16px rgb(0 0 0 / 0.12);
|
|
280
302
|
color-scheme: dark;
|
|
281
303
|
}
|
|
282
304
|
}
|
|
@@ -318,6 +340,7 @@
|
|
|
318
340
|
--gooee-shadow-2: 0 1px 2px rgb(0 0 0 / 0.2), 0 4px 12px rgb(0 0 0 / 0.15);
|
|
319
341
|
--gooee-shadow-3: 0 2px 4px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.5);
|
|
320
342
|
--gooee-shadow-4: 0 4px 8px rgb(0 0 0 / 0.4), 0 24px 64px rgb(0 0 0 / 0.6);
|
|
343
|
+
--gooee-shadow-thumb: 0 1px 3px rgb(0 0 0 / 0.12), 0 3px 8px rgb(0 0 0 / 0.12), 0 6px 16px rgb(0 0 0 / 0.12);
|
|
321
344
|
color-scheme: dark;
|
|
322
345
|
}
|
|
323
346
|
|
|
@@ -332,6 +355,7 @@
|
|
|
332
355
|
--gooee-motion-slower: 0ms;
|
|
333
356
|
--gooee-motion-morph: 0ms;
|
|
334
357
|
--gooee-motion-morph-out: 0ms;
|
|
358
|
+
--gooee-motion-reveal: 0ms;
|
|
335
359
|
--gooee-motion-stagger: 0ms;
|
|
336
360
|
--gooee-motion-shimmer: 0ms;
|
|
337
361
|
--gooee-motion-spin: 1600ms;
|
|
@@ -725,3 +749,17 @@
|
|
|
725
749
|
--gooee-code-comment: var(--gooee-color-fg-subtle);
|
|
726
750
|
--gooee-code-gutter: var(--gooee-color-fg-subtle);
|
|
727
751
|
}
|
|
752
|
+
|
|
753
|
+
/* Where round() works (every current browser), each leading is a whole line box on the 4px grid. */
|
|
754
|
+
@supports (line-height: round(nearest, 1em, 4px)) {
|
|
755
|
+
:root,
|
|
756
|
+
[data-theme] {
|
|
757
|
+
--gooee-leading-none: round(nearest, 1em, 4px);
|
|
758
|
+
--gooee-rise-room: round(up, 0.14em, 4px);
|
|
759
|
+
--gooee-flap-w: round(nearest, 0.92em, 4px);
|
|
760
|
+
--gooee-flap-h: round(nearest, 1.36em, 4px);
|
|
761
|
+
--gooee-leading-tight: round(nearest, calc(var(--gooee-leading-tight-ratio) * 1em), 4px);
|
|
762
|
+
--gooee-leading-snug: round(nearest, calc(var(--gooee-leading-snug-ratio) * 1em), 4px);
|
|
763
|
+
--gooee-leading-normal: round(nearest, calc(var(--gooee-leading-normal-ratio) * 1em), 4px);
|
|
764
|
+
}
|
|
765
|
+
}
|