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
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { useEffect, useLayoutEffect, useRef, useState, type ComponentPropsWithRef, type CSSProperties, type ReactNode } from 'react'
4
4
  import { cx } from '../../internal/cx'
5
+ import { CheckIcon } from '../../internal/icons'
5
6
  import { motionMs } from '../../internal/motion'
6
7
  import { useControllable } from '../../internal/useControllable'
7
8
  import styles from './LivePill.module.css'
@@ -21,10 +22,14 @@ export type LivePillProps = Omit<ComponentPropsWithRef<'div'>, 'children' | 'tit
21
22
  onOpenChange?: (open: boolean) => void
22
23
  /** Where it sits. At the bottom it is in thumb reach and grows up; at the top it grows down. */
23
24
  placement?: 'bottom' | 'top'
25
+ /** "center" keeps the pill in the middle of its row, like a status bar. "start" puts it at the row's start edge, and the card grows from there. */
26
+ align?: 'center' | 'start'
24
27
  /** Pins it to the screen edge, clear of the safe area. Leave off to place it yourself. */
25
28
  fixed?: boolean
26
- /** From 0 to 1: the pill fills from its start like a progress bar, and its words change ink under the fill. */
29
+ /** From 0 to 1: a ring at the pill's start shows it. Open, the ring grows on its spot with the percent inside. */
27
30
  progress?: number
31
+ /** "done" closes the ring into a tick (also at progress 1). "stopped" turns it red with a mark; say why in the words. */
32
+ status?: 'done' | 'stopped'
28
33
  /** "paper" is a light pill with an outline; "ink" is a solid dark one. */
29
34
  tone?: 'paper' | 'ink'
30
35
  /** News for screen readers, said once each time it changes, such as "Download paused". Never a ticking number. */
@@ -46,8 +51,10 @@ export function LivePill({
46
51
  defaultOpen = false,
47
52
  onOpenChange,
48
53
  placement = 'bottom',
54
+ align = 'center',
49
55
  fixed = false,
50
56
  progress,
57
+ status,
51
58
  tone = 'paper',
52
59
  news,
53
60
  alert,
@@ -61,11 +68,16 @@ export function LivePill({
61
68
  const button = useRef<HTMLButtonElement>(null)
62
69
  const [shut, setShut] = useState<string>()
63
70
  const [rowH, setRowH] = useState<number>()
71
+ const [ringAt, setRingAt] = useState<[number, number]>()
72
+ const slot = useRef<HTMLSpanElement>(null)
73
+ const lead = useRef<HTMLSpanElement>(null)
64
74
  const [byAlert, setByAlert] = useState(false)
65
75
  const [held, setHeld] = useState(false)
66
76
  const [said, setSaid] = useState('')
67
77
  const lastNews = useRef(news)
68
78
  const lastAlert = useRef(alert)
79
+ const openNow = useRef(open)
80
+ openNow.current = open
69
81
 
70
82
  // Shut, the card is cut back to the button's own box, so the pill grows out of its own spot.
71
83
  useLayoutEffect(() => {
@@ -73,10 +85,18 @@ export function LivePill({
73
85
  const b = button.current
74
86
  if (!sh || !b) return
75
87
  const measure = () => {
88
+ // Open, the pill's button shrinks to the ring; the shut shape is read only while it is shut.
89
+ if (openNow.current) return
76
90
  // Real fractions, not whole pixels: a half-pixel miss shows as an outline thin on one side and thick on the other.
77
91
  const s = sh.getBoundingClientRect()
78
92
  const r = b.getBoundingClientRect()
79
- setShut(`inset(${r.top - s.top}px ${s.right - r.right}px ${s.bottom - r.bottom}px ${r.left - s.left}px round ${r.height / 2}px)`)
93
+ // A page that scales its content (a zoom, an entrance) scales these boxes too; k turns them back into CSS pixels.
94
+ const k = s.width / sh.offsetWidth || 1
95
+ setShut(`inset(${(r.top - s.top) / k}px ${(s.right - r.right) / k}px ${(s.bottom - r.bottom) / k}px ${(r.left - s.left) / k}px round ${r.height / k / 2}px)`)
96
+ // Shut, the card's ring sits on the pill's ring slot: the distance between the two, read from layout.
97
+ const sl = slot.current?.getBoundingClientRect()
98
+ const ld = lead.current
99
+ if (sl && ld) setRingAt([(sl.left - s.left) / k - ld.offsetLeft, (sl.top - s.top) / k - ld.offsetTop])
80
100
  const row = b.parentElement as HTMLElement
81
101
  setRowH(row.offsetHeight)
82
102
  }
@@ -134,10 +154,12 @@ export function LivePill({
134
154
  }, [open, byAlert, held, alertMs])
135
155
 
136
156
  const p = progress === undefined ? undefined : Math.min(1, Math.max(0, progress))
137
- const vars = { '--pill-shut': shut, '--pill-row': rowH === undefined ? undefined : `${rowH}px`, '--p': p, ...style } as CSSProperties
157
+ const state = status ?? (p === 1 ? 'done' : undefined)
158
+ const ring = p !== undefined || state !== undefined
159
+ const vars = { '--pill-shut': shut, '--pill-row': rowH === undefined ? undefined : `${rowH}px`, '--ring-x': ringAt && `${ringAt[0]}px`, '--ring-y': ringAt && `${ringAt[1]}px`, ...style } as CSSProperties
138
160
 
139
161
  return (
140
- <div className={cx(styles.root, className)} data-placement={placement} data-fixed={fixed || undefined} style={vars} {...rest}>
162
+ <div className={cx(styles.root, className)} data-placement={placement} data-align={align} data-ring={ring || undefined} data-fixed={fixed || undefined} style={vars} {...rest}>
141
163
  <div
142
164
  ref={shell}
143
165
  className={styles.shell}
@@ -156,18 +178,27 @@ export function LivePill({
156
178
  if (!e.currentTarget.contains(e.relatedTarget as Node)) setHeld(false)
157
179
  }}
158
180
  >
159
- <div className={styles.row}>
160
- <button ref={button} type="button" className={styles.button} data-fill={p === undefined ? undefined : ''} aria-expanded={open} aria-label={label} onClick={() => (open ? close(false) : setOpen(true))}>
161
- {p === undefined ? (
162
- <span className={styles.face}>{compact}</span>
181
+ {ring && (
182
+ <span ref={lead} className={styles.lead} data-state={state} aria-hidden="true">
183
+ <svg className={styles.ring} viewBox="0 0 44 44">
184
+ <circle className={styles.track} cx="22" cy="22" r="20" />
185
+ <circle className={styles.arc} cx="22" cy="22" r="20" pathLength={100} strokeDasharray={`${state ? 100 : (p ?? 0) * 100} 100`} />
186
+ </svg>
187
+ {state === 'done' ? (
188
+ <CheckIcon className={styles.mark} />
189
+ ) : state === 'stopped' ? (
190
+ <svg className={styles.mark} viewBox="0 0 24 24">
191
+ <path d="M12 7v6M12 17v.01" />
192
+ </svg>
163
193
  ) : (
164
- <span className={styles.stack}>
165
- <span className={styles.face}>{compact}</span>
166
- <span className={cx(styles.face, styles.over)} aria-hidden="true">
167
- {compact}
168
- </span>
169
- </span>
194
+ <span className={styles.pct}>{Math.round((p ?? 0) * 100)}%</span>
170
195
  )}
196
+ </span>
197
+ )}
198
+ <div className={styles.row}>
199
+ <button ref={button} type="button" className={styles.button} aria-expanded={open} aria-label={label} onClick={() => (open ? close(false) : setOpen(true))}>
200
+ {ring && <span ref={slot} className={styles.slot} />}
201
+ <span className={styles.face}>{compact}</span>
171
202
  </button>
172
203
  </div>
173
204
  <div className={styles.body} inert={!open} aria-hidden={!open || undefined}>
@@ -120,13 +120,14 @@
120
120
  .shell[data-corner^="b"] .panel { padding: var(--gooee-space-6) var(--gooee-space-6) calc(var(--gooee-control-h-lg) + var(--gooee-space-3)); }
121
121
 
122
122
  .close {
123
+ /* On the corner's own centre, so it follows the curve: inset = corner - half its size. */
123
124
  position: absolute;
124
- top: var(--gooee-space-1);
125
- right: var(--gooee-space-1);
125
+ top: calc(var(--gooee-radius-panel) - var(--gooee-control-h-sm) / 2);
126
+ right: calc(var(--gooee-radius-panel) - var(--gooee-control-h-sm) / 2);
126
127
  display: grid;
127
128
  place-items: center;
128
- width: var(--gooee-hit-min);
129
- height: var(--gooee-hit-min);
129
+ width: var(--gooee-control-h-sm);
130
+ height: var(--gooee-control-h-sm);
130
131
  padding: 0;
131
132
  border: 0;
132
133
  border-radius: var(--gooee-radius-full);
@@ -135,6 +136,9 @@
135
136
  cursor: pointer;
136
137
  }
137
138
 
139
+ /* Looks 32px, keeps a 44px touch area. */
140
+ .close::after { content: ""; position: absolute; inset: calc((var(--gooee-control-h-sm) - var(--gooee-hit-min)) / 2); border-radius: inherit; }
141
+
138
142
  .close svg {
139
143
  width: var(--gooee-icon-md);
140
144
  height: var(--gooee-icon-md);
@@ -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
  }
@@ -21,7 +21,7 @@
21
21
  font-size: var(--gooee-text-4xl);
22
22
  font-weight: var(--gooee-weight-semibold);
23
23
  letter-spacing: var(--gooee-tracking-tight);
24
- line-height: 1;
24
+ line-height: var(--gooee-leading-none);
25
25
  font-variant-numeric: tabular-nums;
26
26
  }
27
27
 
@@ -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));
@@ -33,7 +33,8 @@
33
33
  align-items: center;
34
34
  justify-content: space-between;
35
35
  gap: var(--gooee-space-4);
36
- margin: calc(var(--gooee-space-2) * -1) calc(var(--gooee-space-3) * -1) var(--gooee-space-3) 0;
36
+ margin: 0 0 var(--gooee-space-3);
37
+ padding-right: calc(var(--gooee-control-h-sm) + var(--gooee-space-3));
37
38
  }
38
39
 
39
40
  .title {
@@ -43,10 +44,14 @@
43
44
  }
44
45
 
45
46
  .close {
47
+ /* On the corner's own centre, so it follows the curve: inset = corner - half its size. */
48
+ position: absolute;
49
+ top: calc(var(--gooee-radius-panel) - var(--gooee-control-h-sm) / 2 - var(--gooee-line));
50
+ right: calc(var(--gooee-radius-panel) - var(--gooee-control-h-sm) / 2 - var(--gooee-line));
46
51
  display: grid;
47
52
  place-items: center;
48
- width: var(--gooee-hit-min);
49
- height: var(--gooee-hit-min);
53
+ width: var(--gooee-control-h-sm);
54
+ height: var(--gooee-control-h-sm);
50
55
  padding: 0;
51
56
  border: 0;
52
57
  border-radius: var(--gooee-radius-full);
@@ -57,6 +62,9 @@
57
62
  transition: background-color var(--gooee-motion-fast) var(--gooee-ease-out), transform var(--gooee-motion-slow) var(--gooee-ease-spring);
58
63
  }
59
64
 
65
+ /* Looks 32px, keeps a 44px touch area. */
66
+ .close::after { content: ""; position: absolute; inset: calc((var(--gooee-control-h-sm) - var(--gooee-hit-min)) / 2); border-radius: inherit; }
67
+
60
68
  @media (hover: hover) {
61
69
  .close:hover { background: var(--gooee-color-surface-hover); color: var(--gooee-color-fg); }
62
70
  }
@@ -65,7 +65,9 @@
65
65
  border-radius: var(--gooee-radius-xs);
66
66
  background: var(--gooee-color-surface-sunken);
67
67
  font-family: var(--gooee-font-mono);
68
- font-size: 0.9em;
68
+ font-size: var(--gooee-text-sm);
69
+ /* Smaller words on the line's baseline: a tight box keeps them inside the line, so the line stays whole pixels in every browser. */
70
+ line-height: var(--gooee-leading-none);
69
71
  }
70
72
 
71
73
  .root :where(pre) {
@@ -78,7 +80,7 @@
78
80
  line-height: var(--gooee-leading-normal);
79
81
  }
80
82
 
81
- .root :where(pre) :where(code) { padding: 0; background: none; font-size: inherit; }
83
+ .root :where(pre) :where(code) { padding: 0; background: none; font-size: inherit; line-height: inherit; }
82
84
 
83
85
  .root :where(img, video) {
84
86
  display: block;
@@ -107,7 +109,7 @@
107
109
  }
108
110
 
109
111
  .root :where(th, td) {
110
- 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);
111
113
  border-bottom: var(--gooee-line) solid var(--gooee-color-border);
112
114
  text-align: left;
113
115
  }
@@ -21,7 +21,7 @@
21
21
  font-size: var(--gooee-text-4xl);
22
22
  font-weight: var(--gooee-weight-semibold);
23
23
  letter-spacing: var(--gooee-tracking-tight);
24
- line-height: 1;
24
+ line-height: var(--gooee-leading-none);
25
25
  }
26
26
 
27
27
  .detail {
@@ -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
  }
@@ -90,7 +90,7 @@
90
90
  align-items: flex-start;
91
91
  justify-content: space-between;
92
92
  gap: var(--gooee-space-4);
93
- padding: var(--gooee-space-4) var(--gooee-space-4) var(--gooee-space-3) var(--gooee-space-7);
93
+ padding: var(--gooee-space-4) calc(calc(var(--gooee-radius-sheet) - var(--gooee-control-h-sm) / 2) + var(--gooee-control-h-sm) + var(--gooee-space-3)) var(--gooee-space-3) var(--gooee-space-7);
94
94
  }
95
95
 
96
96
  .titles {
@@ -115,11 +115,15 @@
115
115
  }
116
116
 
117
117
  .close {
118
+ /* On the corner's own centre, so it follows the curve: inset = corner - half its size, less the border. */
119
+ position: absolute;
120
+ top: calc(var(--gooee-radius-sheet) - var(--gooee-control-h-sm) / 2 - var(--gooee-line));
121
+ right: calc(var(--gooee-radius-sheet) - var(--gooee-control-h-sm) / 2 - var(--gooee-line));
118
122
  display: grid;
119
123
  place-items: center;
120
124
  flex: none;
121
- width: var(--gooee-hit-min);
122
- height: var(--gooee-hit-min);
125
+ width: var(--gooee-control-h-sm);
126
+ height: var(--gooee-control-h-sm);
123
127
  padding: 0;
124
128
  border: 0;
125
129
  border-radius: var(--gooee-radius-full);
@@ -130,6 +134,9 @@
130
134
  transition: background-color var(--gooee-motion-fast) var(--gooee-ease-out);
131
135
  }
132
136
 
137
+ /* Looks 32px, keeps a 44px touch area. */
138
+ .close::after { content: ""; position: absolute; inset: calc((var(--gooee-control-h-sm) - var(--gooee-hit-min)) / 2); border-radius: inherit; }
139
+
133
140
  @media (hover: hover) {
134
141
  .close:hover { background: var(--gooee-color-surface-hover); color: var(--gooee-color-fg); }
135
142
  }
@@ -149,7 +156,7 @@
149
156
  display: flex;
150
157
  flex-direction: column-reverse;
151
158
  gap: var(--gooee-space-3);
152
- 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);
153
160
  border-top: var(--gooee-line) solid var(--gooee-color-border);
154
161
  }
155
162
 
@@ -22,7 +22,7 @@
22
22
  animation-delay: calc(var(--i, 0) * var(--gooee-motion-stagger) * 3);
23
23
  }
24
24
 
25
- .text { height: 0.8em; border-radius: var(--gooee-radius-xs); }
25
+ .text { height: 0.8em; height: round(nearest, 0.8em, 4px); border-radius: var(--gooee-radius-xs); }
26
26
  .rect { width: 100%; height: var(--gooee-skeleton-block); border-radius: var(--gooee-radius-md); }
27
27
  .circle { width: var(--gooee-skeleton-avatar); height: var(--gooee-skeleton-avatar); border-radius: var(--gooee-radius-full); }
28
28
 
@@ -4,7 +4,7 @@
4
4
  font-size: var(--gooee-text-xl);
5
5
  font-weight: var(--gooee-weight-semibold);
6
6
  font-variant-numeric: tabular-nums;
7
- line-height: 1;
7
+ line-height: var(--gooee-leading-none);
8
8
  }
9
9
 
10
10
  .root[data-size='sm'] {
@@ -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