gooee 0.45.1 → 0.48.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 (31) hide show
  1. package/package.json +1 -1
  2. package/src/components/Alert/Alert.module.css +2 -2
  3. package/src/components/Badge/Badge.module.css +1 -1
  4. package/src/components/Button/Button.module.css +3 -3
  5. package/src/components/Card/Card.module.css +7 -5
  6. package/src/components/CodeBlock/CodeBlock.module.css +4 -2
  7. package/src/components/CopyButton/CopyButton.module.css +1 -1
  8. package/src/components/Dial/Dial.module.css +2 -1
  9. package/src/components/Dial/Dial.tsx +32 -1
  10. package/src/components/DropdownMenu/DropdownMenu.module.css +1 -1
  11. package/src/components/FormField/FormField.module.css +23 -3
  12. package/src/components/Input/Input.module.css +6 -4
  13. package/src/components/InputGroup/InputGroup.module.css +3 -0
  14. package/src/components/Kbd/Kbd.module.css +1 -1
  15. package/src/components/LivePill/LivePill.module.css +2 -0
  16. package/src/components/NumberInput/NumberInput.module.css +9 -5
  17. package/src/components/Pagination/Pagination.module.css +1 -0
  18. package/src/components/Popover/Popover.module.css +1 -1
  19. package/src/components/Prose/Prose.module.css +1 -1
  20. package/src/components/RulerScrubber/RulerScrubber.module.css +1 -1
  21. package/src/components/SegmentedControl/SegmentedControl.module.css +5 -5
  22. package/src/components/Select/Select.module.css +6 -4
  23. package/src/components/Sheet/Sheet.module.css +2 -2
  24. package/src/components/SwipeDeck/SwipeDeck.module.css +1 -1
  25. package/src/components/Switch/Switch.module.css +7 -5
  26. package/src/components/Table/Table.module.css +8 -6
  27. package/src/components/Textarea/Textarea.module.css +5 -3
  28. package/src/components/Toast/Toast.module.css +2 -2
  29. package/src/components/Toggle/Toggle.module.css +3 -3
  30. package/src/internal/icons.tsx +7 -0
  31. package/src/tokens.css +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gooee",
3
- "version": "0.45.1",
3
+ "version": "0.48.0",
4
4
  "description": "React components in black, white and grey with one blue accent. Copy them into your app with npx gooee add <name>.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://gooee.dev",
@@ -2,7 +2,7 @@
2
2
  display: flex;
3
3
  align-items: flex-start;
4
4
  gap: var(--gooee-space-4);
5
- padding: var(--gooee-space-5);
5
+ padding: calc(var(--gooee-space-5) - var(--gooee-line));
6
6
  border: var(--gooee-line) solid var(--gooee-color-border);
7
7
  border-radius: var(--gooee-radius-md);
8
8
  background: var(--gooee-color-surface);
@@ -73,7 +73,7 @@
73
73
  min-width: 0;
74
74
  display: flex;
75
75
  flex-direction: column;
76
- gap: var(--gooee-space-1);
76
+ gap: var(--gooee-space-2);
77
77
  }
78
78
 
79
79
  .title {
@@ -5,7 +5,7 @@
5
5
  gap: var(--gooee-space-2);
6
6
  max-width: 100%;
7
7
  height: var(--gooee-badge-h);
8
- padding: 0 var(--gooee-space-3);
8
+ padding: 0 calc(var(--gooee-space-3) - var(--gooee-line));
9
9
  border: var(--gooee-line) solid transparent;
10
10
  border-radius: var(--gooee-radius-full);
11
11
  font-size: var(--gooee-text-xs);
@@ -8,7 +8,7 @@
8
8
  place-items: center;
9
9
  max-width: 100%;
10
10
  min-height: var(--h);
11
- padding: 0 var(--gooee-control-pad-md);
11
+ padding: 0 calc(var(--gooee-control-pad-md) - var(--gooee-line));
12
12
  --bg: transparent;
13
13
  --line: transparent;
14
14
  border: var(--gooee-line) solid var(--line);
@@ -91,8 +91,8 @@
91
91
  cursor: progress;
92
92
  }
93
93
 
94
- .sm { --h: var(--gooee-control-h-sm); padding: 0 var(--gooee-control-pad-sm); font-size: var(--gooee-text-sm); }
95
- .lg { --h: var(--gooee-control-h-lg); padding: 0 var(--gooee-control-pad-lg); font-size: var(--gooee-text-lg); }
94
+ .sm { --h: var(--gooee-control-h-sm); padding: 0 calc(var(--gooee-control-pad-sm) - var(--gooee-line)); font-size: var(--gooee-text-sm); }
95
+ .lg { --h: var(--gooee-control-h-lg); padding: 0 calc(var(--gooee-control-pad-lg) - var(--gooee-line)); font-size: var(--gooee-text-lg); }
96
96
  .full { display: grid; width: 100%; }
97
97
 
98
98
  .primary {
@@ -3,21 +3,23 @@
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  min-width: 0;
6
- border: var(--gooee-line) solid var(--gooee-color-border);
6
+ /* The line is drawn inside the edge and takes no space, so the outer size is the content's own 4px steps. */
7
+ outline: var(--gooee-line) solid var(--gooee-color-border);
8
+ outline-offset: calc(var(--gooee-line) * -1);
7
9
  border-radius: var(--gooee-radius-panel);
8
10
  background: var(--gooee-color-surface);
9
11
  box-shadow: var(--gooee-shadow-1);
10
12
  transition:
11
13
  transform var(--gooee-motion-slow) var(--gooee-ease-spring),
12
14
  box-shadow var(--gooee-motion-slow) var(--gooee-ease-out),
13
- border-color var(--gooee-motion-base) var(--gooee-ease-out);
15
+ outline-color var(--gooee-motion-base) var(--gooee-ease-out);
14
16
  }
15
17
 
16
18
  @media (hover: hover) {
17
19
  .interactive:hover {
18
20
  transform: translateY(calc(var(--gooee-shift-sm) * -1));
19
21
  box-shadow: var(--gooee-shadow-3);
20
- border-color: var(--gooee-color-border-strong);
22
+ outline-color: var(--gooee-color-border-strong);
21
23
  }
22
24
 
23
25
  /* The lift moves the card off a pointer on its lower edge, and it would drop back and lift again.
@@ -35,7 +37,7 @@
35
37
  .media {
36
38
  overflow: hidden;
37
39
  border-bottom: var(--gooee-line) solid var(--gooee-color-border);
38
- border-radius: calc(var(--gooee-radius-panel) - var(--gooee-line)) calc(var(--gooee-radius-panel) - var(--gooee-line)) 0 0;
40
+ border-radius: var(--gooee-radius-panel) var(--gooee-radius-panel) 0 0;
39
41
  }
40
42
 
41
43
  .media > * { transition: transform var(--gooee-motion-slower) var(--gooee-ease-out); }
@@ -77,6 +79,6 @@
77
79
  display: flex;
78
80
  align-items: center;
79
81
  gap: var(--gooee-space-3);
80
- padding: var(--gooee-space-4) var(--gooee-space-6);
82
+ padding: calc(var(--gooee-space-4) - var(--gooee-line)) var(--gooee-space-6) var(--gooee-space-4) var(--gooee-space-6);
81
83
  border-top: var(--gooee-line) solid var(--gooee-color-border);
82
84
  }
@@ -2,7 +2,9 @@
2
2
  .root {
3
3
  min-width: 0;
4
4
  overflow: hidden;
5
- border: var(--gooee-line) solid var(--gooee-color-border);
5
+ /* The line is drawn inside the edge and takes no space, so the outer size is the content's own 4px steps. */
6
+ outline: var(--gooee-line) solid var(--gooee-color-border);
7
+ outline-offset: calc(var(--gooee-line) * -1);
6
8
  border-radius: var(--gooee-radius-md);
7
9
  background: var(--gooee-code-bg);
8
10
  color: var(--gooee-code-fg);
@@ -55,7 +57,7 @@
55
57
  .gutter {
56
58
  position: sticky;
57
59
  left: 0;
58
- padding: 0 var(--gooee-space-4) 0 var(--gooee-space-5);
60
+ padding: 0 calc(var(--gooee-space-4) - var(--gooee-line)) 0 var(--gooee-space-5);
59
61
  border-right: var(--gooee-line) solid var(--gooee-color-border);
60
62
  background: var(--gooee-code-bg);
61
63
  color: var(--gooee-code-gutter);
@@ -28,7 +28,7 @@
28
28
  }
29
29
 
30
30
  .sm { --s: var(--gooee-control-h-sm); }
31
- .withLabel { padding: 0 var(--gooee-space-5) 0 var(--gooee-space-4); }
31
+ .withLabel { padding: 0 calc(var(--gooee-space-5) - var(--gooee-line)) 0 calc(var(--gooee-space-4) - var(--gooee-line)); }
32
32
 
33
33
  @media (hover: hover) {
34
34
  .root:hover { background: var(--gooee-color-surface-hover); }
@@ -250,7 +250,8 @@
250
250
  width: 100%;
251
251
  height: var(--gooee-ruler-h);
252
252
  border-radius: var(--gooee-radius-md);
253
- /* A sideways swipe turns it; up and down still scrolls the page. */
253
+ /* A sideways swipe turns it; up and down still scrolls the page. Dial.tsx takes a touch that follows
254
+ the curve, so the page does not scroll under a turn. */
254
255
  touch-action: pan-y;
255
256
  }
256
257
 
@@ -1,6 +1,6 @@
1
1
  'use client'
2
2
 
3
- import { useId, useLayoutEffect, useRef, useState, type ComponentPropsWithRef, type PointerEvent, type ReactNode } from 'react'
3
+ import { useEffect, useId, useLayoutEffect, useRef, useState, type ComponentPropsWithRef, type PointerEvent, type ReactNode } from 'react'
4
4
  import { cx } from '../../internal/cx'
5
5
  import { clamp, lastStep, pull, roundTo, steps, wheelSteps, stepKey } from '../../internal/feel'
6
6
  import { Roll } from '../../internal/Roll'
@@ -170,6 +170,37 @@ export function Dial({
170
170
  setRim({ r: tokenNumber(el, '--gooee-dial-arc-radius'), gap: tokenNumber(el, '--gooee-dial-arc-gap') })
171
171
  }, [variant, sc.ref])
172
172
 
173
+ // The arc lets an up-and-down swipe scroll the page, but a finger following the curve also moves up or
174
+ // down. Once a touch moves more sideways than half its rise, it is a turn: the page stops taking it.
175
+ useEffect(() => {
176
+ if (variant !== 'arc') return
177
+ const el = sc.ref.current
178
+ if (!el) return
179
+ let from: { x: number; y: number } | null = null
180
+ let turning = false
181
+ const start = (e: TouchEvent) => {
182
+ from = { x: e.touches[0].clientX, y: e.touches[0].clientY }
183
+ turning = false
184
+ }
185
+ const move = (e: TouchEvent) => {
186
+ if (!from) return
187
+ if (!turning) {
188
+ const dx = Math.abs(e.touches[0].clientX - from.x)
189
+ const dy = Math.abs(e.touches[0].clientY - from.y)
190
+ if (dx + dy < 2) return
191
+ turning = dx > dy / 2
192
+ if (!turning) from = null
193
+ }
194
+ if (turning && e.cancelable) e.preventDefault()
195
+ }
196
+ el.addEventListener('touchstart', start, { passive: true })
197
+ el.addEventListener('touchmove', move, { passive: false })
198
+ return () => {
199
+ el.removeEventListener('touchstart', start)
200
+ el.removeEventListener('touchmove', move)
201
+ }
202
+ }, [variant, sc.ref])
203
+
173
204
  const shown = land(sc.at)
174
205
  useOnChange(shown, onScrub)
175
206
 
@@ -5,7 +5,7 @@
5
5
  max-width: calc(100vw - var(--gooee-space-5) * 2);
6
6
  max-height: calc(100dvh - 2 * var(--gooee-space-5));
7
7
  overflow-y: auto;
8
- padding: var(--gooee-space-2);
8
+ padding: calc(var(--gooee-space-2) - var(--gooee-line));
9
9
  border: var(--gooee-line) solid var(--gooee-glass-edge, var(--gooee-color-border));
10
10
  border-radius: var(--gooee-radius-md);
11
11
  background: var(--gooee-glass-bg, var(--gooee-color-surface));
@@ -29,8 +29,10 @@
29
29
  /* Plain native controls inside get the library's field look, so a bare <input> or <select> fits in. */
30
30
  .control > :is(input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea) {
31
31
  min-height: var(--gooee-hit-min);
32
- padding: var(--gooee-space-3) var(--gooee-space-5);
33
- border: var(--gooee-line) solid var(--gooee-color-border-strong);
32
+ /* The line's width lives in --edge, so the padding takes it back and the words never move when it thickens. */
33
+ --edge: var(--gooee-line);
34
+ padding: calc(var(--gooee-space-3) - var(--edge)) calc(var(--gooee-space-5) - var(--edge));
35
+ border: var(--edge) solid var(--gooee-color-border-strong);
34
36
  border-radius: var(--gooee-radius-md);
35
37
  background: var(--gooee-color-surface);
36
38
  font-size: var(--gooee-text-md);
@@ -39,6 +41,24 @@
39
41
  box-shadow var(--gooee-motion-base) var(--gooee-ease-out);
40
42
  }
41
43
 
44
+ /* Safari draws a native select at its own height and ignores the 44px; without its native look it takes
45
+ the field's size. The arrow is the library's chevron, drawn as two thin strokes in the muted ink. */
46
+ .control > select:not([multiple]) {
47
+ --arrow: calc(var(--gooee-space-2) + var(--gooee-line));
48
+ --stroke: calc(var(--gooee-line) * 1.5);
49
+ appearance: none;
50
+ /* Room for the chevron, the line included: 44px, a whole number of grid steps. */
51
+ padding-inline-end: calc(var(--gooee-hit-min) - var(--edge));
52
+ background-image:
53
+ linear-gradient(45deg, transparent calc(50% - var(--stroke) / 2), var(--gooee-color-fg-muted) calc(50% - var(--stroke) / 2) calc(50% + var(--stroke) / 2), transparent calc(50% + var(--stroke) / 2)),
54
+ linear-gradient(-45deg, transparent calc(50% - var(--stroke) / 2), var(--gooee-color-fg-muted) calc(50% - var(--stroke) / 2) calc(50% + var(--stroke) / 2), transparent calc(50% + var(--stroke) / 2));
55
+ background-position:
56
+ calc(100% - var(--gooee-space-5) - var(--arrow)) 50%,
57
+ calc(100% - var(--gooee-space-5)) 50%;
58
+ background-size: var(--arrow) var(--arrow);
59
+ background-repeat: no-repeat;
60
+ }
61
+
42
62
  @media (hover: hover) {
43
63
  .control > :is(input, select, textarea):hover:not(:disabled) { border-color: var(--gooee-color-fg-muted); }
44
64
  }
@@ -51,7 +71,7 @@
51
71
 
52
72
  .root[data-invalid] .control > :is(input, select, textarea) {
53
73
  border-color: var(--gooee-color-danger);
54
- border-width: var(--gooee-line-thick);
74
+ --edge: var(--gooee-line-thick);
55
75
  animation: nudge var(--gooee-motion-slow) var(--gooee-ease-out);
56
76
  }
57
77
 
@@ -23,8 +23,10 @@
23
23
  align-items: center;
24
24
  gap: var(--gooee-space-3);
25
25
  min-height: var(--h);
26
- padding: 0 var(--gooee-space-5);
27
- border: var(--gooee-line) solid var(--gooee-color-border-strong);
26
+ /* The line's width lives in --edge, so the padding takes it back and the words never move when it thickens. */
27
+ --edge: var(--gooee-line);
28
+ padding: 0 calc(var(--gooee-space-5) - var(--edge));
29
+ border: var(--edge) solid var(--gooee-color-border-strong);
28
30
  border-radius: var(--gooee-radius-md);
29
31
  background: var(--gooee-color-surface);
30
32
  cursor: text;
@@ -35,7 +37,7 @@
35
37
  background-color var(--gooee-motion-fast) var(--gooee-ease-out);
36
38
  }
37
39
 
38
- .sm { --h: var(--gooee-control-h-sm); gap: var(--gooee-space-2); padding: 0 var(--gooee-space-4); }
40
+ .sm { --h: var(--gooee-control-h-sm); gap: var(--gooee-space-2); padding: 0 calc(var(--gooee-space-4) - var(--edge)); }
39
41
  .lg { --h: var(--gooee-control-h-lg); }
40
42
  .floating { --h: var(--gooee-field-h-floating); }
41
43
 
@@ -71,7 +73,7 @@
71
73
  /* Red border, plus the thicker line and the nudge, so the error does not rely on colour. */
72
74
  .field[data-invalid] {
73
75
  border-color: var(--gooee-color-danger);
74
- border-width: var(--gooee-line-thick);
76
+ --edge: var(--gooee-line-thick);
75
77
  animation: nudge var(--gooee-motion-slow) var(--gooee-ease-out);
76
78
  }
77
79
 
@@ -96,13 +96,16 @@
96
96
 
97
97
  .addon > svg { flex: none; font-size: var(--gooee-icon-md); }
98
98
 
99
+ /* The divider takes its width back from the padding on its side, so the words stay on the grid. */
99
100
  .addon[data-side="prefix"] {
101
+ padding-inline-end: calc(var(--gooee-space-4) - var(--gooee-line));
100
102
  border-inline-end: var(--gooee-line) solid var(--gooee-color-border);
101
103
  border-start-start-radius: calc(var(--r) - var(--gooee-line));
102
104
  border-end-start-radius: calc(var(--r) - var(--gooee-line));
103
105
  }
104
106
 
105
107
  .addon[data-side="suffix"] {
108
+ padding-inline-start: calc(var(--gooee-space-4) - var(--gooee-line));
106
109
  border-inline-start: var(--gooee-line) solid var(--gooee-color-border);
107
110
  border-start-end-radius: calc(var(--r) - var(--gooee-line));
108
111
  border-end-end-radius: calc(var(--r) - var(--gooee-line));
@@ -5,7 +5,7 @@
5
5
  justify-content: center;
6
6
  min-width: var(--gooee-kbd-h);
7
7
  height: var(--gooee-kbd-h);
8
- padding: 0 var(--gooee-space-3);
8
+ padding: 0 calc(var(--gooee-space-3) - var(--gooee-line));
9
9
  border: var(--gooee-line) solid var(--gooee-color-border-strong);
10
10
  border-bottom-width: var(--gooee-line-focus);
11
11
  border-radius: var(--gooee-radius-sm);
@@ -318,6 +318,8 @@
318
318
  block-size: 100%;
319
319
  rotate: -90deg;
320
320
  fill: none;
321
+ /* Shut, the stroke is thicker in the drawing (5.5) and reaches past the 44 box; an svg crops by default. */
322
+ overflow: visible;
321
323
  }
322
324
 
323
325
  /* Strokes are in the 44px drawing: 5.5 shows as 3px when the ring is shut at 24px, 4 shows as 4px open. */
@@ -18,24 +18,28 @@
18
18
  max-width: 100%;
19
19
  min-height: var(--gooee-hit-min);
20
20
  padding: 0;
21
- border: var(--gooee-line) solid var(--gooee-color-border-strong);
21
+ /* The line width lives in --edge, so the padding gives it back and the words stay put when it thickens. */
22
+ --edge: var(--gooee-line);
23
+ /* The line is drawn inside the edge and takes no space, so the outer size is the content's own 4px steps. */
24
+ outline: var(--edge) solid var(--gooee-color-border-strong);
25
+ outline-offset: calc(var(--edge) * -1);
22
26
  border-radius: var(--gooee-radius-control);
23
27
  background: var(--gooee-color-surface);
24
28
  transition:
25
- border-color var(--gooee-motion-fast) var(--gooee-ease-out),
29
+ outline-color var(--gooee-motion-fast) var(--gooee-ease-out),
26
30
  box-shadow var(--gooee-motion-base) var(--gooee-ease-out);
27
31
  }
28
32
 
29
33
  @media (hover: hover) {
30
- .field:hover { border-color: var(--gooee-color-fg-muted); }
34
+ .field:hover { outline-color: var(--gooee-color-fg-muted); }
31
35
  }
32
36
 
33
37
  .field:focus-within {
34
- border-color: var(--gooee-color-fg);
38
+ outline-color: var(--gooee-color-fg);
35
39
  box-shadow: 0 0 0 var(--gooee-halo) var(--gooee-color-surface-active);
36
40
  }
37
41
 
38
- .field[data-invalid] { border-color: var(--gooee-color-danger); border-width: var(--gooee-line-thick); }
42
+ .field[data-invalid] { outline-color: var(--gooee-color-danger); --edge: var(--gooee-line-thick); }
39
43
  .field[data-disabled] { opacity: 0.6; background: var(--gooee-color-surface-sunken); }
40
44
 
41
45
  .step {
@@ -77,6 +77,7 @@
77
77
  .btn:focus-visible { outline: none; box-shadow: var(--gooee-focus-ring); }
78
78
 
79
79
  .edge {
80
+ padding: 0 calc(var(--gooee-space-3) - var(--gooee-line));
80
81
  font-size: var(--gooee-icon-md);
81
82
  border: var(--gooee-line) solid var(--gooee-color-border);
82
83
  }
@@ -3,7 +3,7 @@
3
3
  z-index: var(--gooee-z-popover);
4
4
  width: max-content;
5
5
  max-width: min(var(--gooee-panel-w-sm), calc(100vw - var(--gooee-space-5) * 2));
6
- padding: var(--gooee-space-5);
6
+ padding: calc(var(--gooee-space-5) - var(--gooee-line));
7
7
  border: var(--gooee-line) solid var(--gooee-glass-edge, var(--gooee-color-border));
8
8
  border-radius: var(--gooee-radius-panel);
9
9
  background: var(--gooee-glass-bg, var(--gooee-color-surface));
@@ -109,7 +109,7 @@
109
109
  }
110
110
 
111
111
  .root :where(th, td) {
112
- padding: var(--gooee-space-3) var(--gooee-space-4);
112
+ padding: var(--gooee-space-3) var(--gooee-space-4) calc(var(--gooee-space-3) - var(--gooee-line)) var(--gooee-space-4);
113
113
  border-bottom: var(--gooee-line) solid var(--gooee-color-border);
114
114
  text-align: left;
115
115
  }
@@ -131,7 +131,7 @@
131
131
  position: absolute;
132
132
  left: 50%;
133
133
  top: calc(var(--base) + var(--gooee-space-7));
134
- padding: 0 var(--gooee-space-3);
134
+ padding: 0 calc(var(--gooee-space-3) - var(--gooee-line));
135
135
  border: var(--gooee-line) solid var(--gooee-color-border-strong);
136
136
  border-radius: var(--gooee-radius-full);
137
137
  background: var(--gooee-color-surface);
@@ -3,7 +3,7 @@
3
3
  display: inline-flex;
4
4
  /* Its own width in a column layout too; fullWidth (.full) still fills the row. */
5
5
  width: fit-content;
6
- padding: var(--gooee-space-1);
6
+ padding: calc(var(--gooee-space-2) - var(--gooee-line));
7
7
  border: var(--gooee-line) solid var(--gooee-color-border);
8
8
  border-radius: var(--gooee-radius-control);
9
9
  background: var(--gooee-color-surface-sunken);
@@ -16,8 +16,8 @@
16
16
 
17
17
  .pill {
18
18
  position: absolute;
19
- top: var(--gooee-space-1);
20
- bottom: var(--gooee-space-1);
19
+ top: calc(var(--gooee-space-2) - var(--gooee-line));
20
+ bottom: calc(var(--gooee-space-2) - var(--gooee-line));
21
21
  left: 0;
22
22
  z-index: -1;
23
23
  border-radius: var(--gooee-radius-control);
@@ -73,7 +73,7 @@
73
73
  justify-content: center;
74
74
  gap: var(--gooee-space-3);
75
75
  --pad: var(--gooee-space-5);
76
- min-height: calc(var(--gooee-control-h-md) - var(--gooee-space-1) * 2);
76
+ min-height: calc(var(--gooee-control-h-md) - var(--gooee-space-2) * 2);
77
77
  padding: 0 var(--pad);
78
78
  border: 0;
79
79
  border-radius: var(--gooee-radius-control);
@@ -98,7 +98,7 @@
98
98
 
99
99
  .sm .item {
100
100
  --pad: var(--gooee-space-4);
101
- min-height: calc(var(--gooee-control-h-sm) - var(--gooee-space-1) * 2);
101
+ min-height: calc(var(--gooee-control-h-sm) - var(--gooee-space-2) * 2);
102
102
  font-size: var(--gooee-text-xs);
103
103
  }
104
104
 
@@ -28,8 +28,10 @@
28
28
  justify-content: space-between;
29
29
  gap: var(--gooee-space-3);
30
30
  min-height: var(--gooee-hit-min);
31
- padding: 0 var(--gooee-space-4) 0 var(--gooee-space-5);
32
- border: var(--gooee-line) solid var(--gooee-color-border-strong);
31
+ /* The line's width lives in --edge, so the padding takes it back and the words never move when it thickens. */
32
+ --edge: var(--gooee-line);
33
+ padding: 0 calc(var(--gooee-space-4) - var(--edge)) 0 calc(var(--gooee-space-5) - var(--edge));
34
+ border: var(--edge) solid var(--gooee-color-border-strong);
33
35
  border-radius: var(--gooee-radius-md);
34
36
  background: var(--gooee-color-surface);
35
37
  position: relative;
@@ -63,7 +65,7 @@
63
65
  overflow: visible;
64
66
  pointer-events: none;
65
67
  }
66
- .trigger[data-invalid] { --gooee-flow-edge: var(--gooee-color-danger); border-color: var(--gooee-color-danger); border-width: var(--gooee-line-thick); }
68
+ .trigger[data-invalid] { --gooee-flow-edge: var(--gooee-color-danger); border-color: var(--gooee-color-danger); --edge: var(--gooee-line-thick); }
67
69
  .trigger[data-invalid][data-edge] { box-shadow: inset 0 0 0 calc(var(--gooee-line-focus) - var(--gooee-line-thick)) var(--gooee-flow-edge); }
68
70
  .trigger:disabled { opacity: var(--gooee-disabled-opacity); cursor: not-allowed; background: var(--gooee-color-surface-sunken); }
69
71
 
@@ -97,7 +99,7 @@
97
99
  max-height: min(var(--gooee-listbox-max-h), 60vh);
98
100
  overflow-y: auto;
99
101
  overscroll-behavior: contain;
100
- padding: var(--gooee-space-2);
102
+ padding: calc(var(--gooee-space-2) - var(--gooee-line));
101
103
  border: var(--gooee-line) solid var(--gooee-color-border);
102
104
  border-radius: var(--gooee-radius-md);
103
105
  background: var(--gooee-color-surface);
@@ -27,7 +27,7 @@
27
27
  backdrop-filter: var(--gooee-glass-filter, none);
28
28
  box-shadow: var(--gooee-shadow-4);
29
29
  outline: none;
30
- padding-bottom: env(safe-area-inset-bottom);
30
+ padding-bottom: calc(env(safe-area-inset-bottom) - var(--gooee-line));
31
31
  animation: sheetIn var(--gooee-motion-morph) var(--gooee-ease-morph);
32
32
  transition: transform var(--gooee-motion-morph-out) var(--gooee-ease-morph);
33
33
  }
@@ -156,7 +156,7 @@
156
156
  display: flex;
157
157
  flex-direction: column-reverse;
158
158
  gap: var(--gooee-space-3);
159
- padding: var(--gooee-space-5) var(--gooee-space-7) var(--gooee-space-6);
159
+ padding: calc(var(--gooee-space-5) - var(--gooee-line)) var(--gooee-space-7) var(--gooee-space-6) var(--gooee-space-7);
160
160
  border-top: var(--gooee-line) solid var(--gooee-color-border);
161
161
  }
162
162
 
@@ -74,7 +74,7 @@
74
74
  display: grid;
75
75
  place-content: center;
76
76
  min-block-size: var(--gooee-deck-card-h);
77
- padding: var(--gooee-space-6);
77
+ padding: calc(var(--gooee-space-6) - var(--gooee-line));
78
78
  border: var(--gooee-line) dashed var(--gooee-color-border-strong);
79
79
  border-radius: var(--gooee-radius-panel);
80
80
  color: var(--gooee-color-fg-muted);
@@ -16,7 +16,8 @@
16
16
  --w: var(--gooee-switch-w);
17
17
  --h: var(--gooee-switch-h);
18
18
  --pad: var(--gooee-switch-pad);
19
- --thumb: calc(var(--h) - var(--pad) * 2);
19
+ /* The thumb sits inside the line as well as the pad, so the gap round it is even: 1 + 3 = 4. */
20
+ --thumb: calc(var(--h) - (var(--pad) + var(--gooee-line)) * 2);
20
21
  position: relative;
21
22
  flex: none;
22
23
  width: var(--w);
@@ -39,7 +40,7 @@
39
40
  inset: calc(var(--gooee-line) * -1);
40
41
  border-radius: var(--gooee-radius-full);
41
42
  background: var(--gooee-color-accent);
42
- clip-path: inset(var(--in) calc(var(--w) - var(--in) - var(--thumb) + var(--gooee-line) * 2) var(--in) var(--in) round var(--gooee-radius-full));
43
+ clip-path: inset(var(--in) calc(var(--w) - var(--in) - var(--thumb)) var(--in) var(--in) round var(--gooee-radius-full));
43
44
  transition: clip-path var(--gooee-motion-base) var(--gooee-ease-morph);
44
45
  }
45
46
 
@@ -63,8 +64,9 @@
63
64
 
64
65
  .thumb {
65
66
  position: absolute;
66
- top: calc(var(--pad) - var(--gooee-line));
67
- left: calc(var(--pad) - var(--gooee-line));
67
+ /* Inside the line by the pad: 1 + 3 = 4 from the outside, the same spot as the fill's dot. */
68
+ top: var(--pad);
69
+ left: var(--pad);
68
70
  width: var(--thumb);
69
71
  height: var(--thumb);
70
72
  border-radius: var(--gooee-radius-full);
@@ -80,7 +82,7 @@
80
82
  }
81
83
 
82
84
  .track[data-on] .thumb {
83
- transform: translateX(calc(var(--w) - var(--thumb) - var(--pad) * 2));
85
+ transform: translateX(calc(var(--w) - var(--thumb) - (var(--pad) + var(--gooee-line)) * 2));
84
86
  }
85
87
 
86
88
  .text {
@@ -4,7 +4,9 @@
4
4
  position: relative;
5
5
  container-type: inline-size;
6
6
  min-width: 0;
7
- border: var(--gooee-line) solid var(--gooee-color-border);
7
+ /* The line is drawn inside the edge and takes no space, so the outer size is the content's own 4px steps. */
8
+ outline: var(--gooee-line) solid var(--gooee-color-border);
9
+ outline-offset: calc(var(--gooee-line) * -1);
8
10
  border-radius: var(--gooee-radius-panel);
9
11
  background: var(--gooee-color-surface);
10
12
  overflow: hidden;
@@ -120,7 +122,7 @@
120
122
  .td,
121
123
  .checkCell {
122
124
  height: var(--gooee-hit-min);
123
- padding: var(--gooee-space-3) var(--gooee-space-5);
125
+ padding: calc(var(--gooee-space-3) - var(--gooee-line)) var(--gooee-space-5) var(--gooee-space-3) var(--gooee-space-5);
124
126
  border-top: var(--gooee-line) solid var(--gooee-color-border);
125
127
  vertical-align: middle;
126
128
  font-variant-numeric: tabular-nums;
@@ -138,7 +140,7 @@
138
140
  /* A group's header: its name and how many rows it holds, on a quiet band that opens a gap above it,
139
141
  so the groups read as pieces the table split into. */
140
142
  .groupHead {
141
- padding: var(--gooee-space-6) var(--gooee-space-5) var(--gooee-space-2);
143
+ padding: calc(var(--gooee-space-6) - var(--gooee-line)) var(--gooee-space-5) var(--gooee-space-2) var(--gooee-space-5);
142
144
  border-top: var(--gooee-line) solid var(--gooee-color-border);
143
145
  background: var(--gooee-color-surface-sunken);
144
146
  font-size: var(--gooee-text-sm);
@@ -165,7 +167,7 @@
165
167
  .loadingRow { pointer-events: none; }
166
168
 
167
169
  .empty {
168
- padding: var(--gooee-space-9) var(--gooee-space-5);
170
+ padding: calc(var(--gooee-space-9) - var(--gooee-line)) var(--gooee-space-5) var(--gooee-space-9) var(--gooee-space-5);
169
171
  border-top: var(--gooee-line) solid var(--gooee-color-border);
170
172
  text-align: center;
171
173
  color: var(--gooee-color-fg-muted);
@@ -259,7 +261,7 @@
259
261
  flex-wrap: wrap;
260
262
  align-items: center;
261
263
  gap: var(--gooee-space-2);
262
- padding: var(--gooee-space-2) var(--gooee-space-3);
264
+ padding: var(--gooee-space-2) var(--gooee-space-3) calc(var(--gooee-space-2) - var(--gooee-line)) var(--gooee-space-3);
263
265
  border-bottom: var(--gooee-line) solid var(--gooee-color-border);
264
266
  }
265
267
 
@@ -274,7 +276,7 @@
274
276
 
275
277
  [data-layout="stack"] .row {
276
278
  position: relative;
277
- padding: var(--gooee-space-3) var(--gooee-space-4);
279
+ padding: calc(var(--gooee-space-3) - var(--gooee-line)) var(--gooee-space-4) var(--gooee-space-3) var(--gooee-space-4);
278
280
  border-top: var(--gooee-line) solid var(--gooee-color-border);
279
281
  }
280
282
 
@@ -27,8 +27,10 @@
27
27
  display: block;
28
28
  width: 100%;
29
29
  resize: none;
30
- padding: var(--gooee-space-4) var(--gooee-space-5);
31
- border: var(--gooee-line) solid var(--gooee-color-border-strong);
30
+ /* The line's width lives in --edge, so the padding takes it back and the words never move when it thickens. */
31
+ --edge: var(--gooee-line);
32
+ padding: calc(var(--gooee-space-4) - var(--edge)) calc(var(--gooee-space-5) - var(--edge));
33
+ border: var(--edge) solid var(--gooee-color-border-strong);
32
34
  border-radius: var(--gooee-radius-md);
33
35
  background: var(--gooee-color-surface);
34
36
  font-size: var(--gooee-text-input);
@@ -67,7 +69,7 @@
67
69
  .textarea[data-invalid] {
68
70
  --gooee-flow-edge: var(--gooee-color-danger);
69
71
  border-color: var(--gooee-color-danger);
70
- border-width: var(--gooee-line-thick);
72
+ --edge: var(--gooee-line-thick);
71
73
  }
72
74
 
73
75
  .textarea[data-invalid][data-edge] { box-shadow: inset 0 0 0 calc(var(--gooee-line-focus) - var(--gooee-line-thick)) var(--gooee-flow-edge); }
@@ -46,7 +46,7 @@
46
46
  display: flex;
47
47
  align-items: flex-start;
48
48
  gap: var(--gooee-space-4);
49
- padding: var(--gooee-space-5) var(--gooee-space-2) var(--gooee-space-5) var(--gooee-space-5);
49
+ padding: calc(var(--gooee-space-5) - var(--gooee-line)) calc(var(--gooee-space-2) - var(--gooee-line)) calc(var(--gooee-space-5) - var(--gooee-line)) calc(var(--gooee-space-5) - var(--gooee-line));
50
50
  border: var(--gooee-line) solid var(--gooee-glass-edge, var(--gooee-color-border));
51
51
  border-radius: var(--gooee-radius-md);
52
52
  background: var(--gooee-glass-bg, var(--gooee-color-surface));
@@ -124,7 +124,7 @@
124
124
  flex: none;
125
125
  align-self: center;
126
126
  min-height: var(--gooee-control-h-sm);
127
- padding: 0 var(--gooee-space-4);
127
+ padding: 0 calc(var(--gooee-space-4) - var(--gooee-line));
128
128
  border: var(--gooee-line) solid var(--gooee-color-border-strong);
129
129
  border-radius: var(--gooee-radius-control);
130
130
  background: transparent;
@@ -7,7 +7,7 @@
7
7
  gap: var(--gooee-space-3);
8
8
  flex: none;
9
9
  min-height: var(--h);
10
- padding: 0 var(--gooee-space-6);
10
+ padding: 0 calc(var(--gooee-space-6) - var(--gooee-line));
11
11
  border: var(--gooee-line) solid var(--gooee-color-border-strong);
12
12
  border-radius: var(--gooee-radius-control);
13
13
  background: var(--gooee-color-surface);
@@ -39,8 +39,8 @@
39
39
  .root::after { inset-inline: min(0px, calc((100% - var(--gooee-hit-min)) / 2)); }
40
40
  }
41
41
 
42
- .sm { --h: var(--gooee-control-h-sm); padding: 0 var(--gooee-space-5); font-size: var(--gooee-text-sm); }
43
- .lg { --h: var(--gooee-control-h-lg); padding: 0 var(--gooee-space-8); font-size: var(--gooee-text-lg); }
42
+ .sm { --h: var(--gooee-control-h-sm); padding: 0 calc(var(--gooee-space-5) - var(--gooee-line)); font-size: var(--gooee-text-sm); }
43
+ .lg { --h: var(--gooee-control-h-lg); padding: 0 calc(var(--gooee-space-8) - var(--gooee-line)); font-size: var(--gooee-text-lg); }
44
44
 
45
45
  .iconOnly {
46
46
  width: var(--h);
@@ -223,6 +223,13 @@ export const PaletteIcon = (p: IconProps) => (
223
223
  <circle cx="14.75" cy="7.75" r="1.1" fill="currentColor" stroke="none" />
224
224
  </Svg>
225
225
  )
226
+ // Lucide's ruler: a rule laid on a slant with four marks.
227
+ export const RulerIcon = (p: IconProps) => (
228
+ <Svg m="draw" {...p}>
229
+ <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z" />
230
+ <path d="m14.5 12.5 2-2M11.5 9.5l2-2M8.5 6.5l2-2M17.5 15.5l2-2" />
231
+ </Svg>
232
+ )
226
233
  export const SlidersIcon = (p: IconProps) => (
227
234
  <Svg m="bounce" {...p}>
228
235
  <path d="M4 7h9M17 7h3M4 17h3M11 17h9" />
package/src/tokens.css CHANGED
@@ -143,7 +143,7 @@
143
143
  --gooee-progress-h: 6px;
144
144
  --gooee-progress-h-sm: 3px;
145
145
  --gooee-switch-w: 44px;
146
- --gooee-switch-h: 26px;
146
+ --gooee-switch-h: 28px;
147
147
  --gooee-switch-pad: 3px;
148
148
  --gooee-switch-stretch: 6px;
149
149
  --gooee-field-h-floating: 56px;
@@ -153,7 +153,7 @@
153
153
  --gooee-avatar-lg: 48px;
154
154
  --gooee-avatar-xl: 72px;
155
155
  --gooee-kbd-h: 24px;
156
- --gooee-badge-h: 22px;
156
+ --gooee-badge-h: 24px;
157
157
  --gooee-dot: 6px;
158
158
  --gooee-mini-button: 24px;
159
159
  --gooee-handle-w: 40px;