gooee 0.42.0 → 0.47.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.
Files changed (46) hide show
  1. package/package.json +1 -1
  2. package/src/components/Alert/Alert.module.css +2 -2
  3. package/src/components/AnimatedNumber/AnimatedNumber.module.css +3 -3
  4. package/src/components/Badge/Badge.module.css +2 -2
  5. package/src/components/Button/Button.module.css +4 -4
  6. package/src/components/Card/Card.module.css +7 -5
  7. package/src/components/CodeBlock/CodeBlock.module.css +4 -2
  8. package/src/components/CopyButton/CopyButton.module.css +1 -1
  9. package/src/components/Dial/Dial.module.css +4 -3
  10. package/src/components/Dial/Dial.tsx +32 -1
  11. package/src/components/Dialog/Dialog.module.css +10 -4
  12. package/src/components/DropdownMenu/DropdownMenu.module.css +1 -1
  13. package/src/components/FormField/FormField.module.css +23 -3
  14. package/src/components/HoldToConfirm/HoldToConfirm.module.css +37 -52
  15. package/src/components/HoldToConfirm/HoldToConfirm.tsx +146 -60
  16. package/src/components/Input/Input.module.css +6 -4
  17. package/src/components/InputGroup/InputGroup.module.css +3 -0
  18. package/src/components/Kbd/Kbd.module.css +2 -2
  19. package/src/components/LivePill/LivePill.module.css +213 -31
  20. package/src/components/LivePill/LivePill.tsx +45 -14
  21. package/src/components/MorphButton/MorphButton.module.css +8 -4
  22. package/src/components/NumberInput/NumberInput.module.css +9 -5
  23. package/src/components/Pagination/Pagination.module.css +1 -0
  24. package/src/components/PickerWheel/PickerWheel.module.css +1 -1
  25. package/src/components/Popover/Popover.module.css +12 -4
  26. package/src/components/Prose/Prose.module.css +5 -3
  27. package/src/components/RulerScrubber/RulerScrubber.module.css +2 -2
  28. package/src/components/SegmentedControl/SegmentedControl.module.css +5 -5
  29. package/src/components/Select/Select.module.css +6 -4
  30. package/src/components/Sheet/Sheet.module.css +12 -5
  31. package/src/components/Skeleton/Skeleton.module.css +1 -1
  32. package/src/components/SplitFlap/SplitFlap.module.css +1 -1
  33. package/src/components/SwipeDeck/SwipeDeck.module.css +1 -1
  34. package/src/components/Switch/Switch.module.css +7 -5
  35. package/src/components/Table/Table.module.css +8 -6
  36. package/src/components/Tabs/Tabs.module.css +34 -33
  37. package/src/components/Tabs/Tabs.tsx +64 -21
  38. package/src/components/Textarea/Textarea.module.css +5 -3
  39. package/src/components/ThemeToggle/ThemeToggle.module.css +6 -15
  40. package/src/components/ThemeToggle/ThemeToggle.tsx +108 -9
  41. package/src/components/Toast/Toast.module.css +8 -5
  42. package/src/components/Toggle/Toggle.module.css +4 -4
  43. package/src/internal/icons.tsx +7 -0
  44. package/src/internal/motion.ts +1 -1
  45. package/src/internal/themeReveal.ts +63 -0
  46. package/src/tokens.css +49 -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
- --gooee-text-xs: 12px;
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: 15px;
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: 17px;
72
- --gooee-text-xl: 20px;
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: 44px;
76
- --gooee-leading-tight: 1.2;
77
- --gooee-leading-snug: 1.4;
78
- --gooee-leading-normal: 1.6;
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
- --gooee-line-thick: 1.5px;
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
- --gooee-panel-w-sm: 380px;
115
- --gooee-panel-w-md: 480px;
116
- --gooee-panel-w-lg: 640px;
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;
@@ -127,7 +143,7 @@
127
143
  --gooee-progress-h: 6px;
128
144
  --gooee-progress-h-sm: 3px;
129
145
  --gooee-switch-w: 44px;
130
- --gooee-switch-h: 26px;
146
+ --gooee-switch-h: 28px;
131
147
  --gooee-switch-pad: 3px;
132
148
  --gooee-switch-stretch: 6px;
133
149
  --gooee-field-h-floating: 56px;
@@ -137,7 +153,7 @@
137
153
  --gooee-avatar-lg: 48px;
138
154
  --gooee-avatar-xl: 72px;
139
155
  --gooee-kbd-h: 24px;
140
- --gooee-badge-h: 22px;
156
+ --gooee-badge-h: 24px;
141
157
  --gooee-dot: 6px;
142
158
  --gooee-mini-button: 24px;
143
159
  --gooee-handle-w: 40px;
@@ -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: 28px;
175
+ --gooee-radius-sheet: 32px;
160
176
  --gooee-radius-control: 999px;
161
177
  --gooee-radius-full: 999px;
162
178
 
@@ -180,6 +196,9 @@
180
196
  back in 400ms, both on --gooee-ease-morph played forward, so a close starts moving at once */
181
197
  --gooee-motion-morph: calc(600ms * var(--gooee-motion-scale));
182
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);
183
202
  /* Older names, kept so apps that use them still work. They are the morph now */
184
203
  --gooee-motion-pour: var(--gooee-motion-morph);
185
204
  --gooee-motion-liquid: var(--gooee-motion-morph);
@@ -336,6 +355,7 @@
336
355
  --gooee-motion-slower: 0ms;
337
356
  --gooee-motion-morph: 0ms;
338
357
  --gooee-motion-morph-out: 0ms;
358
+ --gooee-motion-reveal: 0ms;
339
359
  --gooee-motion-stagger: 0ms;
340
360
  --gooee-motion-shimmer: 0ms;
341
361
  --gooee-motion-spin: 1600ms;
@@ -729,3 +749,17 @@
729
749
  --gooee-code-comment: var(--gooee-color-fg-subtle);
730
750
  --gooee-code-gutter: var(--gooee-color-fg-subtle);
731
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
+ }