gooee 0.52.0 → 1.0.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.
Files changed (269) hide show
  1. package/README.md +10 -3
  2. package/package.json +6 -2
  3. package/scripts/add.js +181 -42
  4. package/src/base.css +3 -1
  5. package/src/components/Accordion/Accordion.module.css +7 -5
  6. package/src/components/Accordion/Accordion.tsx +13 -11
  7. package/src/components/Accordion/Accordion.vue +16 -15
  8. package/src/components/Accordion/AccordionItem.vue +8 -7
  9. package/src/components/Alert/Alert.module.css +9 -7
  10. package/src/components/Alert/Alert.tsx +25 -16
  11. package/src/components/Alert/Alert.vue +31 -27
  12. package/src/components/AlertDialog/AlertDialog.module.css +2 -0
  13. package/src/components/AlertDialog/AlertDialog.tsx +8 -7
  14. package/src/components/AlertDialog/AlertDialog.vue +25 -23
  15. package/src/components/AnimatedNumber/AnimatedNumber.module.css +5 -3
  16. package/src/components/AnimatedNumber/AnimatedNumber.tsx +6 -6
  17. package/src/components/AnimatedNumber/AnimatedNumber.vue +5 -5
  18. package/src/components/AspectRatio/AspectRatio.module.css +2 -0
  19. package/src/components/AspectRatio/AspectRatio.tsx +3 -3
  20. package/src/components/AspectRatio/AspectRatio.vue +5 -8
  21. package/src/components/Avatar/Avatar.module.css +10 -8
  22. package/src/components/Avatar/Avatar.tsx +4 -3
  23. package/src/components/Avatar/Avatar.vue +17 -19
  24. package/src/components/Avatar/index.ts +0 -2
  25. package/src/components/AvatarGroup/AvatarGroup.module.css +11 -9
  26. package/src/components/AvatarGroup/AvatarGroup.tsx +4 -4
  27. package/src/components/AvatarGroup/AvatarGroup.vue +13 -16
  28. package/src/components/Badge/Badge.module.css +6 -4
  29. package/src/components/Badge/Badge.tsx +3 -3
  30. package/src/components/Badge/Badge.vue +15 -14
  31. package/src/components/Breadcrumb/Breadcrumb.module.css +5 -3
  32. package/src/components/Breadcrumb/Breadcrumb.tsx +20 -12
  33. package/src/components/Breadcrumb/Breadcrumb.vue +33 -25
  34. package/src/components/Button/Button.module.css +16 -14
  35. package/src/components/Button/Button.tsx +6 -4
  36. package/src/components/Button/Button.vue +42 -33
  37. package/src/components/ButtonGroup/ButtonGroup.module.css +2 -0
  38. package/src/components/ButtonGroup/ButtonGroup.tsx +1 -1
  39. package/src/components/ButtonGroup/ButtonGroup.vue +9 -12
  40. package/src/components/Card/Card.module.css +6 -4
  41. package/src/components/Card/Card.tsx +6 -6
  42. package/src/components/Card/Card.vue +18 -21
  43. package/src/components/Center/Center.module.css +2 -0
  44. package/src/components/Center/Center.tsx +1 -1
  45. package/src/components/Center/Center.vue +18 -15
  46. package/src/components/Checkbox/Checkbox.module.css +10 -8
  47. package/src/components/Checkbox/Checkbox.tsx +15 -9
  48. package/src/components/Checkbox/Checkbox.vue +29 -31
  49. package/src/components/CheckboxGroup/CheckboxGroup.module.css +3 -1
  50. package/src/components/CheckboxGroup/CheckboxGroup.tsx +4 -4
  51. package/src/components/CheckboxGroup/CheckboxGroup.vue +33 -30
  52. package/src/components/Cluster/Cluster.module.css +2 -0
  53. package/src/components/Cluster/Cluster.tsx +1 -1
  54. package/src/components/Cluster/Cluster.vue +21 -17
  55. package/src/components/CodeBlock/CodeBlock.module.css +12 -10
  56. package/src/components/CodeBlock/CodeBlock.tsx +18 -10
  57. package/src/components/CodeBlock/CodeBlock.vue +30 -27
  58. package/src/components/CodeBlock/highlight.ts +1 -1
  59. package/src/components/Collapsible/Collapsible.module.css +7 -5
  60. package/src/components/Collapsible/Collapsible.tsx +7 -6
  61. package/src/components/Collapsible/Collapsible.vue +30 -26
  62. package/src/components/Container/Container.module.css +2 -0
  63. package/src/components/Container/Container.tsx +1 -1
  64. package/src/components/Container/Container.vue +13 -12
  65. package/src/components/CopyButton/CopyButton.module.css +20 -18
  66. package/src/components/CopyButton/CopyButton.tsx +21 -14
  67. package/src/components/CopyButton/CopyButton.vue +41 -31
  68. package/src/components/Dial/Dial.module.css +26 -11
  69. package/src/components/Dial/Dial.tsx +18 -18
  70. package/src/components/Dial/Dial.vue +57 -60
  71. package/src/components/Dialog/Dialog.module.css +4 -2
  72. package/src/components/Dialog/Dialog.tsx +22 -13
  73. package/src/components/Dialog/Dialog.vue +34 -30
  74. package/src/components/Divider/Divider.module.css +5 -3
  75. package/src/components/Divider/Divider.tsx +6 -4
  76. package/src/components/Divider/Divider.vue +13 -16
  77. package/src/components/DropdownMenu/DropdownMenu.module.css +8 -6
  78. package/src/components/DropdownMenu/DropdownMenu.tsx +12 -9
  79. package/src/components/DropdownMenu/DropdownMenu.vue +25 -28
  80. package/src/components/EmptyState/EmptyState.module.css +6 -4
  81. package/src/components/EmptyState/EmptyState.tsx +6 -6
  82. package/src/components/EmptyState/EmptyState.vue +14 -17
  83. package/src/components/Fab/Fab.module.css +19 -17
  84. package/src/components/Fab/Fab.tsx +11 -9
  85. package/src/components/Fab/Fab.vue +29 -26
  86. package/src/components/Fieldset/Fieldset.module.css +2 -0
  87. package/src/components/Fieldset/Fieldset.tsx +4 -3
  88. package/src/components/Fieldset/Fieldset.vue +4 -4
  89. package/src/components/FormField/FormField.module.css +5 -3
  90. package/src/components/FormField/FormField.tsx +7 -7
  91. package/src/components/FormField/FormField.vue +4 -4
  92. package/src/components/Grid/Grid.module.css +2 -0
  93. package/src/components/Grid/Grid.tsx +1 -1
  94. package/src/components/Grid/Grid.vue +25 -22
  95. package/src/components/HoldToConfirm/HoldToConfirm.module.css +13 -11
  96. package/src/components/HoldToConfirm/HoldToConfirm.tsx +11 -9
  97. package/src/components/HoldToConfirm/HoldToConfirm.vue +37 -32
  98. package/src/components/IconButton/IconButton.module.css +7 -5
  99. package/src/components/IconButton/IconButton.tsx +2 -1
  100. package/src/components/IconButton/IconButton.vue +15 -14
  101. package/src/components/Input/Input.module.css +12 -10
  102. package/src/components/Input/Input.tsx +9 -7
  103. package/src/components/Input/Input.vue +45 -35
  104. package/src/components/InputGroup/InputGroup.module.css +8 -6
  105. package/src/components/InputGroup/InputGroup.tsx +5 -4
  106. package/src/components/InputGroup/InputGroup.vue +41 -36
  107. package/src/components/Kbd/Kbd.module.css +9 -7
  108. package/src/components/Kbd/Kbd.tsx +1 -1
  109. package/src/components/Kbd/Kbd.vue +1 -1
  110. package/src/components/Link/Link.module.css +4 -2
  111. package/src/components/Link/Link.tsx +4 -3
  112. package/src/components/Link/Link.vue +13 -16
  113. package/src/components/LivePill/LivePill.module.css +39 -37
  114. package/src/components/LivePill/LivePill.tsx +11 -10
  115. package/src/components/LivePill/LivePill.vue +38 -40
  116. package/src/components/Meter/Meter.module.css +5 -3
  117. package/src/components/Meter/Meter.tsx +9 -8
  118. package/src/components/Meter/Meter.vue +52 -43
  119. package/src/components/MorphButton/MorphButton.module.css +11 -9
  120. package/src/components/MorphButton/MorphButton.tsx +20 -10
  121. package/src/components/MorphButton/MorphButton.vue +29 -25
  122. package/src/components/NumberInput/NumberInput.module.css +7 -5
  123. package/src/components/NumberInput/NumberInput.tsx +11 -8
  124. package/src/components/NumberInput/NumberInput.vue +69 -57
  125. package/src/components/Pagination/Pagination.module.css +147 -5
  126. package/src/components/Pagination/Pagination.tsx +216 -41
  127. package/src/components/Pagination/Pagination.vue +201 -36
  128. package/src/components/Pagination/labels.ts +38 -0
  129. package/src/components/PasswordInput/PasswordInput.module.css +10 -8
  130. package/src/components/PasswordInput/PasswordInput.tsx +15 -7
  131. package/src/components/PasswordInput/PasswordInput.vue +20 -16
  132. package/src/components/PasswordInput/index.ts +1 -1
  133. package/src/components/PickerWheel/DateWheel.vue +20 -12
  134. package/src/components/PickerWheel/PickerWheel.module.css +15 -6
  135. package/src/components/PickerWheel/PickerWheel.tsx +70 -44
  136. package/src/components/PickerWheel/PickerWheel.vue +39 -38
  137. package/src/components/PickerWheel/TimeWheel.vue +23 -21
  138. package/src/components/PickerWheel/WheelColumn.vue +7 -5
  139. package/src/components/Popover/Popover.module.css +5 -3
  140. package/src/components/Popover/Popover.tsx +17 -8
  141. package/src/components/Popover/Popover.vue +26 -25
  142. package/src/components/ProgressBar/ProgressBar.module.css +4 -2
  143. package/src/components/ProgressBar/ProgressBar.tsx +6 -5
  144. package/src/components/ProgressBar/ProgressBar.vue +28 -25
  145. package/src/components/Prose/Prose.module.css +5 -3
  146. package/src/components/Prose/Prose.tsx +1 -1
  147. package/src/components/Prose/Prose.vue +5 -8
  148. package/src/components/Radio/Radio.module.css +10 -8
  149. package/src/components/Radio/Radio.tsx +10 -8
  150. package/src/components/Radio/Radio.vue +8 -8
  151. package/src/components/Radio/RadioGroup.vue +33 -35
  152. package/src/components/Radio/radioContext.ts +12 -0
  153. package/src/components/Retime/Retime.vue +25 -22
  154. package/src/components/RulerScrubber/RulerScrubber.module.css +11 -2
  155. package/src/components/RulerScrubber/RulerScrubber.tsx +19 -18
  156. package/src/components/RulerScrubber/RulerScrubber.vue +50 -54
  157. package/src/components/ScrollArea/ScrollArea.module.css +17 -15
  158. package/src/components/ScrollArea/ScrollArea.tsx +5 -4
  159. package/src/components/ScrollArea/ScrollArea.vue +15 -17
  160. package/src/components/SearchInput/SearchInput.module.css +6 -4
  161. package/src/components/SearchInput/SearchInput.tsx +22 -10
  162. package/src/components/SearchInput/SearchInput.vue +20 -17
  163. package/src/components/SearchInput/index.ts +1 -1
  164. package/src/components/SegmentedControl/SegmentedControl.module.css +7 -5
  165. package/src/components/SegmentedControl/SegmentedControl.tsx +9 -5
  166. package/src/components/SegmentedControl/SegmentedControl.vue +25 -29
  167. package/src/components/Select/Select.module.css +19 -17
  168. package/src/components/Select/Select.tsx +31 -18
  169. package/src/components/Select/Select.vue +63 -58
  170. package/src/components/Sheet/Sheet.module.css +6 -4
  171. package/src/components/Sheet/Sheet.tsx +39 -29
  172. package/src/components/Sheet/Sheet.vue +46 -40
  173. package/src/components/Skeleton/Skeleton.module.css +4 -2
  174. package/src/components/Skeleton/Skeleton.tsx +3 -2
  175. package/src/components/Skeleton/Skeleton.vue +16 -18
  176. package/src/components/Slider/Slider.module.css +14 -12
  177. package/src/components/Slider/Slider.tsx +27 -11
  178. package/src/components/Slider/Slider.vue +47 -37
  179. package/src/components/Spinner/Spinner.module.css +2 -0
  180. package/src/components/Spinner/Spinner.tsx +3 -3
  181. package/src/components/Spinner/Spinner.vue +9 -12
  182. package/src/components/Split/Split.module.css +2 -0
  183. package/src/components/Split/Split.tsx +3 -3
  184. package/src/components/Split/Split.vue +19 -17
  185. package/src/components/SplitFlap/SplitFlap.module.css +9 -7
  186. package/src/components/SplitFlap/SplitFlap.tsx +2 -2
  187. package/src/components/SplitFlap/SplitFlap.vue +24 -21
  188. package/src/components/Stack/Stack.module.css +2 -0
  189. package/src/components/Stack/Stack.tsx +1 -1
  190. package/src/components/Stack/Stack.vue +13 -12
  191. package/src/components/SwipeDeck/SwipeDeck.module.css +13 -11
  192. package/src/components/SwipeDeck/SwipeDeck.tsx +23 -28
  193. package/src/components/SwipeDeck/SwipeDeck.vue +32 -38
  194. package/src/components/Switch/Switch.module.css +10 -8
  195. package/src/components/Switch/Switch.tsx +6 -5
  196. package/src/components/Switch/Switch.vue +22 -24
  197. package/src/components/Table/Table.module.css +24 -22
  198. package/src/components/Table/Table.tsx +27 -30
  199. package/src/components/Table/Table.vue +93 -79
  200. package/src/components/TableOfContents/TableOfContents.module.css +9 -7
  201. package/src/components/TableOfContents/TableOfContents.tsx +8 -8
  202. package/src/components/TableOfContents/TableOfContents.vue +20 -23
  203. package/src/components/Tabs/Tab.vue +3 -0
  204. package/src/components/Tabs/TabList.vue +2 -2
  205. package/src/components/Tabs/TabPanel.vue +2 -0
  206. package/src/components/Tabs/Tabs.module.css +4 -2
  207. package/src/components/Tabs/Tabs.tsx +10 -5
  208. package/src/components/Tabs/Tabs.vue +1 -1
  209. package/src/components/Tag/Tag.module.css +12 -10
  210. package/src/components/Tag/Tag.tsx +13 -15
  211. package/src/components/Tag/Tag.vue +12 -14
  212. package/src/components/Textarea/Textarea.module.css +8 -6
  213. package/src/components/Textarea/Textarea.tsx +4 -3
  214. package/src/components/Textarea/Textarea.vue +32 -34
  215. package/src/components/ThemeToggle/ThemeToggle.module.css +2 -0
  216. package/src/components/ThemeToggle/ThemeToggle.tsx +7 -7
  217. package/src/components/ThemeToggle/ThemeToggle.vue +24 -22
  218. package/src/components/Toast/Toast.module.css +17 -15
  219. package/src/components/Toast/Toast.tsx +51 -34
  220. package/src/components/Toast/Toast.vue +35 -24
  221. package/src/components/Toast/ToastItem.vue +17 -16
  222. package/src/components/Toggle/Toggle.module.css +11 -9
  223. package/src/components/Toggle/Toggle.tsx +3 -2
  224. package/src/components/Toggle/Toggle.vue +13 -15
  225. package/src/components/Tooltip/Tooltip.module.css +5 -3
  226. package/src/components/Tooltip/Tooltip.tsx +1 -0
  227. package/src/components/Tooltip/Tooltip.vue +13 -18
  228. package/src/components/VisuallyHidden/VisuallyHidden.module.css +2 -0
  229. package/src/components/VisuallyHidden/VisuallyHidden.tsx +1 -1
  230. package/src/components/VisuallyHidden/VisuallyHidden.vue +5 -8
  231. package/src/{internal → icons}/icons.module.css +4 -2
  232. package/src/{internal → icons}/icons.tsx +15 -16
  233. package/src/internal/FieldMessage.module.css +5 -3
  234. package/src/internal/FieldMessage.tsx +2 -2
  235. package/src/internal/FieldMessage.vue +2 -2
  236. package/src/internal/Roll.module.css +5 -3
  237. package/src/internal/feel.ts +12 -10
  238. package/src/internal/fling.ts +3 -3
  239. package/src/internal/liquid.ts +12 -10
  240. package/src/internal/liquidMatter.ts +1 -1
  241. package/src/internal/liquidMore.ts +7 -7
  242. package/src/internal/motion/checkbox.ts +4 -4
  243. package/src/internal/motion/fling.ts +19 -9
  244. package/src/internal/motion/holdToConfirm.ts +3 -3
  245. package/src/internal/motion/index.ts +8 -6
  246. package/src/internal/motion/liquid.ts +16 -4
  247. package/src/internal/motion/liquidMatter.ts +8 -6
  248. package/src/internal/motion/liquidMore.ts +44 -25
  249. package/src/internal/motion/livePill.ts +1 -1
  250. package/src/internal/motion/numberInput.ts +2 -2
  251. package/src/internal/motion/pickerWheel.ts +7 -4
  252. package/src/internal/motion/ruler.ts +1 -1
  253. package/src/internal/motion/scrollArea.ts +3 -3
  254. package/src/internal/motion/scrollFrame.ts +9 -7
  255. package/src/internal/motion/scrubber.ts +39 -20
  256. package/src/internal/motion/slider.ts +38 -4
  257. package/src/internal/motion/softPress.ts +10 -9
  258. package/src/internal/motion/splitFlap.ts +4 -4
  259. package/src/internal/motion/swipeDeck.ts +38 -7
  260. package/src/internal/motion/table.ts +3 -6
  261. package/src/internal/motion/themeIcon.ts +1 -1
  262. package/src/internal/motion/themeReveal.ts +1 -1
  263. package/src/internal/motion/toast.ts +3 -3
  264. package/src/internal/motion.ts +7 -8
  265. package/src/internal/scrollFrame.ts +3 -3
  266. package/src/internal/useScrub.ts +1 -15
  267. package/src/internal/vue/useScrub.ts +2 -6
  268. package/src/tokens.css +81 -421
  269. package/src/{internal/vueIcons.ts → icons/vue.ts} +5 -5
@@ -22,16 +22,17 @@ export function Skeleton({ shape = 'rect', width, height, lines = 1, variant = '
22
22
  const look = variant === 'sketch' && styles.sketch
23
23
  if (shape === 'text') {
24
24
  return (
25
- <span className={cx(styles.lines, className)} style={{ width }} aria-hidden="true">
25
+ <span className={cx(styles.lines, className)} data-slot="skeleton" style={{ width }} aria-hidden="true">
26
26
  {Array.from({ length: lines }, (_, i) => (
27
27
  <span
28
28
  key={i}
29
29
  className={cx(styles.bone, styles.text, look)}
30
+ data-slot="skeleton-line"
30
31
  style={{ width: lines > 1 && i === lines - 1 ? '62%' : '100%', ['--i' as string]: i }}
31
32
  />
32
33
  ))}
33
34
  </span>
34
35
  )
35
36
  }
36
- return <span className={cx(styles.bone, styles[shape], look, className)} style={{ width, height }} aria-hidden="true" />
37
+ return <span className={cx(styles.bone, styles[shape], look, className)} data-slot="skeleton" style={{ width, height }} aria-hidden="true" />
37
38
  }
@@ -4,35 +4,33 @@ import styles from './Skeleton.module.css'
4
4
 
5
5
  // The Vue Skeleton: the same shapes (Skeleton.module.css) as the React one.
6
6
  // Decorative only. Mark the loading container with aria-busy and a label instead.
7
- const props = withDefaults(
8
- defineProps<{
9
- /** Text draws lines, rect a box, circle a round shape such as an avatar. */
10
- shape?: 'text' | 'rect' | 'circle'
11
- /** Any CSS width, such as 120 or "50%". */
12
- width?: number | string
13
- /** Any CSS height. Ignored for text, where lines set the height. */
14
- height?: number | string
15
- /** For text: number of lines. The last one is shorter, like real text. */
16
- lines?: number
17
- /** Solid grey shapes, or a sketch: the same shapes as dashed outlines, like a pencil layout. */
18
- variant?: 'solid' | 'sketch'
19
- }>(),
20
- { shape: 'rect', lines: 1, variant: 'solid' },
21
- )
7
+ const { shape = 'rect', lines = 1, variant = 'solid' } = defineProps<{
8
+ /** Text draws lines, rect a box, circle a round shape such as an avatar. */
9
+ shape?: 'text' | 'rect' | 'circle'
10
+ /** Any CSS width, such as 120 or "50%". */
11
+ width?: number | string
12
+ /** Any CSS height. Ignored for text, where lines set the height. */
13
+ height?: number | string
14
+ /** For text: number of lines. The last one is shorter, like real text. */
15
+ lines?: number
16
+ /** Solid grey shapes, or a sketch: the same shapes as dashed outlines, like a pencil layout. */
17
+ variant?: 'solid' | 'sketch'
18
+ }>()
22
19
 
23
20
  // A number is pixels, as in React.
24
21
  const px = (v: number | string | undefined) => (typeof v === 'number' ? `${v}px` : v)
25
- const look = computed(() => props.variant === 'sketch' && styles.sketch)
22
+ const look = computed(() => variant === 'sketch' && styles.sketch)
26
23
  </script>
27
24
 
28
25
  <template>
29
- <span v-if="shape === 'text'" :class="styles.lines" :style="{ width: px(width) }" aria-hidden="true">
26
+ <span v-if="shape === 'text'" :class="styles.lines" data-slot="skeleton" :style="{ width: px(width) }" aria-hidden="true">
30
27
  <span
31
28
  v-for="i in lines"
32
29
  :key="i - 1"
33
30
  :class="[styles.bone, styles.text, look]"
31
+ data-slot="skeleton-line"
34
32
  :style="{ width: lines > 1 && i === lines ? '62%' : '100%', '--i': i - 1 }"
35
33
  />
36
34
  </span>
37
- <span v-else :class="[styles.bone, styles[shape], look]" :style="{ width: px(width), height: px(height) }" aria-hidden="true" />
35
+ <span v-else :class="[styles.bone, styles[shape], look]" data-slot="skeleton" :style="{ width: px(width), height: px(height) }" aria-hidden="true" />
38
36
  </template>
@@ -1,3 +1,4 @@
1
+ @layer gooee.components {
1
2
  .root {
2
3
  display: flex;
3
4
  flex-direction: column;
@@ -48,20 +49,20 @@
48
49
  .input:focus { outline: none; }
49
50
 
50
51
  .input::-webkit-slider-runnable-track {
51
- height: var(--gooee-track-h);
52
+ height: var(--gooee-slider-track-h, 4px);
52
53
  border-radius: var(--gooee-radius-full);
53
54
  background: linear-gradient(to right, var(--gooee-color-accent) var(--pct), var(--gooee-color-surface-active) var(--pct));
54
55
  box-shadow: inset 0 0 0 var(--gooee-line) var(--gooee-color-border);
55
56
  }
56
57
 
57
58
  .input::-moz-range-track {
58
- height: var(--gooee-track-h);
59
+ height: var(--gooee-slider-track-h, 4px);
59
60
  border-radius: var(--gooee-radius-full);
60
61
  background: var(--gooee-color-surface-active);
61
62
  }
62
63
 
63
64
  .input::-moz-range-progress {
64
- height: var(--gooee-track-h);
65
+ height: var(--gooee-slider-track-h, 4px);
65
66
  border-radius: var(--gooee-radius-full);
66
67
  background: var(--gooee-color-accent);
67
68
  }
@@ -70,14 +71,14 @@
70
71
  -webkit-appearance: none;
71
72
  width: var(--thumb);
72
73
  height: var(--thumb);
73
- margin-top: calc((var(--gooee-track-h) - var(--thumb)) / 2);
74
+ margin-top: calc((var(--gooee-slider-track-h, 4px) - var(--thumb)) / 2);
74
75
  border: var(--gooee-line-thick) solid var(--gooee-color-accent);
75
76
  border-radius: var(--gooee-radius-full);
76
77
  background: var(--gooee-color-surface-raised);
77
78
  box-shadow: var(--gooee-shadow-2);
78
79
  transition:
79
- transform var(--gooee-motion-slow) var(--gooee-ease-spring),
80
- box-shadow var(--gooee-motion-fast) var(--gooee-ease-out);
80
+ transform var(--gooee-motion-slow) var(--gooee-ease-morph),
81
+ box-shadow var(--gooee-motion-fast) var(--gooee-ease-morph);
81
82
  }
82
83
 
83
84
  .input::-moz-range-thumb {
@@ -89,8 +90,8 @@
89
90
  background: var(--gooee-color-surface-raised);
90
91
  box-shadow: var(--gooee-shadow-2);
91
92
  transition:
92
- transform var(--gooee-motion-slow) var(--gooee-ease-spring),
93
- box-shadow var(--gooee-motion-fast) var(--gooee-ease-out);
93
+ transform var(--gooee-motion-slow) var(--gooee-ease-morph),
94
+ box-shadow var(--gooee-motion-fast) var(--gooee-ease-morph);
94
95
  }
95
96
 
96
97
  @media (hover: hover) {
@@ -118,8 +119,8 @@
118
119
  transform: translate(-50%, var(--gooee-shift-sm)) scale(0.8);
119
120
  /* It stays a beat after a click or a let-go, so the value can be read before it fades. */
120
121
  transition:
121
- opacity var(--gooee-motion-fast) var(--gooee-ease-out) var(--gooee-motion-base),
122
- transform var(--gooee-motion-base) var(--gooee-ease-spring) var(--gooee-motion-base);
122
+ opacity var(--gooee-motion-fast) var(--gooee-ease-morph) var(--gooee-motion-base),
123
+ transform var(--gooee-motion-base) var(--gooee-ease-morph) var(--gooee-motion-base);
123
124
  }
124
125
 
125
126
  .input:active:not(:disabled) + .bubble,
@@ -147,9 +148,10 @@
147
148
  border-radius: var(--gooee-radius-full);
148
149
  background: var(--gooee-color-border-strong);
149
150
  translate: -50% -50%;
150
- transition: opacity var(--gooee-motion-fast) var(--gooee-ease-out);
151
+ transition: opacity var(--gooee-motion-fast) var(--gooee-ease-morph);
151
152
  }
152
153
 
153
- .mark[data-on] {
154
+ .mark[data-state="active"] {
154
155
  opacity: 0;
155
156
  }
157
+ }
@@ -13,8 +13,10 @@ export type SliderProps = Omit<ComponentPropsWithRef<'input'>, 'type' | 'value'
13
13
  value?: number
14
14
  /** Starting value when you do not control it. Undefined starts at min. */
15
15
  defaultValue?: number
16
- /** Called when the value changes, with the new number. */
16
+ /** Called on each new value, while the thumb still moves. */
17
17
  onValueChange?: (value: number) => void
18
+ /** Called once the value comes to rest: the hand lets go, a key comes up, or the slider loses focus. */
19
+ onValueCommit?: (value: number) => void
18
20
  /** Lowest value on the track. */
19
21
  min?: number
20
22
  /** Highest value on the track. */
@@ -34,6 +36,7 @@ export function Slider({
34
36
  value: valueProp,
35
37
  defaultValue,
36
38
  onValueChange,
39
+ onValueCommit,
37
40
  min = 0,
38
41
  max = 100,
39
42
  step = 1,
@@ -48,18 +51,23 @@ export function Slider({
48
51
  onPointerUp,
49
52
  onPointerCancel,
50
53
  onKeyDown,
54
+ onKeyUp,
51
55
  onBlur,
52
56
  ...rest
53
57
  }: SliderProps) {
54
58
  const auto = useId()
55
59
  const inputId = id ?? auto
56
60
  const [value, setValue] = useControllable(valueProp, defaultValue ?? min, onValueChange)
61
+ // A form library's onChange runs after the slider's own instead of replacing it.
62
+ const { onChange, ...inputRest } = rest as typeof rest & Pick<ComponentPropsWithRef<'input'>, 'onChange'>
57
63
  // Where the thumb is drawn while it glides to a click or settles on a mark; the value is set already.
58
64
  const [shown, setShown] = useState<number | null>(null)
59
65
  const latest = useRef({ value, min, max, step, marks })
60
66
  latest.current = { value, min, max, step, marks }
61
67
  const set = useRef(setValue)
62
68
  set.current = setValue
69
+ const commit = useRef(onValueCommit)
70
+ commit.current = onValueCommit
63
71
  // The glide, the grab and the landing on marks (motion/slider.ts).
64
72
  const slider = useRef<ReturnType<typeof createSlider>>(null)
65
73
  slider.current ??= createSlider(
@@ -69,6 +77,7 @@ export function Slider({
69
77
  set.current(v)
70
78
  },
71
79
  setShown,
80
+ (v) => commit.current?.(v),
72
81
  )
73
82
  const at = shown ?? value
74
83
  const pct = max === min ? 0 : ((at - min) / (max - min)) * 100
@@ -77,16 +86,17 @@ export function Slider({
77
86
  useEffect(() => () => slider.current!.destroy(), [])
78
87
 
79
88
  return (
80
- <div className={cx(styles.root, className)} data-disabled={disabled || undefined}>
89
+ <div className={cx(styles.root, className)} data-slot="slider" data-orientation="horizontal" data-disabled={disabled || undefined}>
81
90
  <div className={styles.head}>
82
- <label htmlFor={inputId} className={styles.label}>{label}</label>
83
- {showValue && <output htmlFor={inputId} className={styles.value} aria-hidden="true">{text}</output>}
91
+ <label htmlFor={inputId} className={styles.label} data-slot="field-label">{label}</label>
92
+ {showValue && <output htmlFor={inputId} className={styles.value} data-slot="slider-value" aria-hidden="true">{text}</output>}
84
93
  </div>
85
- <div className={styles.trackWrap} data-gliding={shown !== null || undefined} style={{ ['--pct' as string]: `${pct}%`, ['--p' as string]: pct / 100 }}>
94
+ <div className={styles.trackWrap} data-slot="slider-control" data-gliding={shown !== null || undefined} style={{ ['--pct' as string]: `${pct}%`, ['--p' as string]: pct / 100 }}>
86
95
  <input
87
96
  id={inputId}
88
97
  type="range"
89
98
  className={styles.input}
99
+ data-slot="slider-input"
90
100
  min={min}
91
101
  max={max}
92
102
  step={shown === null ? step : 'any'}
@@ -95,7 +105,10 @@ export function Slider({
95
105
  aria-valuenow={value}
96
106
  aria-valuetext={formatValue === String ? undefined : text}
97
107
  // Only "input": the browser's "change" on release carries the thumb's mid-glide place, not the value.
98
- onChange={(e) => e.nativeEvent.type === 'input' && slider.current!.input(e.currentTarget, Number(e.target.value))}
108
+ onChange={(e) => {
109
+ if (e.nativeEvent.type === 'input') slider.current!.input(e.currentTarget, Number(e.target.value))
110
+ onChange?.(e)
111
+ }}
99
112
  onPointerDown={(e: PointerEvent<HTMLInputElement>) => {
100
113
  slider.current!.down(e.currentTarget, e.clientX)
101
114
  onPointerDown?.(e)
@@ -118,20 +131,23 @@ export function Slider({
118
131
  onBlur?.(e)
119
132
  }}
120
133
  onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => {
121
- slider.current!.end()
122
134
  onKeyDown?.(e)
123
135
  if (!e.defaultPrevented && slider.current!.key(e.key)) e.preventDefault()
124
136
  }}
125
- {...rest}
137
+ onKeyUp={(e: KeyboardEvent<HTMLInputElement>) => {
138
+ slider.current!.keyUp()
139
+ onKeyUp?.(e)
140
+ }}
141
+ {...inputRest}
126
142
  />
127
143
  {showValue && (
128
- <span className={styles.bubble} aria-hidden="true">{text}</span>
144
+ <span className={styles.bubble} data-slot="slider-bubble" aria-hidden="true">{text}</span>
129
145
  )}
130
146
  {/* After the bubble, which CSS shows from the input just before it. */}
131
147
  {marks?.length ? (
132
- <span className={styles.marks} aria-hidden="true">
148
+ <span className={styles.marks} data-slot="slider-marks" aria-hidden="true">
133
149
  {marks.map((m) => (
134
- <span key={m} className={styles.mark} data-on={m === value || undefined} style={{ ['--m' as string]: (m - min) / (max - min || 1) }} />
150
+ <span key={m} className={styles.mark} data-slot="slider-mark" data-state={m === value ? 'active' : 'inactive'} style={{ ['--m' as string]: (m - min) / (max - min || 1) }} />
135
151
  ))}
136
152
  </span>
137
153
  ) : null}
@@ -7,33 +7,41 @@ import styles from './Slider.module.css'
7
7
  // Other attributes, such as name or a listener, go to the input. A class goes to the root, as in React.
8
8
  defineOptions({ inheritAttrs: false })
9
9
 
10
- const props = withDefaults(
11
- defineProps<{
12
- /** Visible name of the slider, also read by screen readers. */
13
- label: string
14
- /** Starting value when there is no v-model. Undefined starts at min. */
15
- defaultValue?: number
16
- /** Lowest value on the track. */
17
- min?: number
18
- /** Highest value on the track. */
19
- max?: number
20
- /** Size of each move, by drag or arrow key. */
21
- step?: number
22
- /** Shows the value next to the label and in a bubble while dragging. */
23
- showValue?: boolean
24
- /** Turns the number into the text shown and read by screen readers. */
25
- formatValue?: (value: number) => string
26
- /** Values the thumb is drawn to as it passes, shown as dots on the track. Let go near one and it lands on it; Page Up and Page Down jump between them. */
27
- marks?: number[]
28
- disabled?: boolean
29
- id?: string
30
- }>(),
31
- { min: 0, max: 100, step: 1, showValue: true, formatValue: String },
32
- )
10
+ const {
11
+ defaultValue,
12
+ min = 0,
13
+ max = 100,
14
+ step = 1,
15
+ showValue = true,
16
+ formatValue = String,
17
+ marks,
18
+ id,
19
+ } = defineProps<{
20
+ /** Visible name of the slider, also read by screen readers. */
21
+ label: string
22
+ /** Starting value when there is no v-model. Undefined starts at min. */
23
+ defaultValue?: number
24
+ /** Lowest value on the track. */
25
+ min?: number
26
+ /** Highest value on the track. */
27
+ max?: number
28
+ /** Size of each move, by drag or arrow key. */
29
+ step?: number
30
+ /** Shows the value next to the label and in a bubble while dragging. */
31
+ showValue?: boolean
32
+ /** Turns the number into the text shown and read by screen readers. */
33
+ formatValue?: (value: number) => string
34
+ /** Values the thumb is drawn to as it passes, shown as dots on the track. Let go near one and it lands on it; Page Up and Page Down jump between them. */
35
+ marks?: number[]
36
+ disabled?: boolean
37
+ id?: string
38
+ }>()
39
+
40
+ const emit = defineEmits<{ /** The value once it comes to rest: the hand lets go, a key comes up, or the slider loses focus. */ valueCommit: [value: number] }>()
33
41
 
34
- /** The value. Use v-model, or leave it out and the slider keeps its own value. */
42
+ /** The value, set on each new one while the thumb moves. Use v-model, or leave it out and the slider keeps its own value. */
35
43
  const model = defineModel<number>()
36
- const local = ref(props.defaultValue ?? props.min)
44
+ const local = ref(defaultValue ?? min)
37
45
  const value = computed({
38
46
  get: () => model.value ?? local.value,
39
47
  set: (next: number) => {
@@ -48,18 +56,19 @@ const inputAttrs = computed(() => {
48
56
  })
49
57
 
50
58
  const auto = useId()
51
- const inputId = computed(() => props.id ?? auto)
59
+ const inputId = computed(() => id ?? auto)
52
60
  // Where the thumb is drawn while it glides to a click or settles on a mark; the value is set already.
53
61
  const shown = ref<number | null>(null)
54
62
  const at = computed(() => shown.value ?? value.value)
55
- const pct = computed(() => (props.max === props.min ? 0 : ((at.value - props.min) / (props.max - props.min)) * 100))
56
- const text = computed(() => props.formatValue(value.value))
63
+ const pct = computed(() => (max === min ? 0 : ((at.value - min) / (max - min)) * 100))
64
+ const text = computed(() => formatValue(value.value))
57
65
 
58
66
  // The glide, the grab and the landing on marks (motion/slider.ts).
59
67
  const slider = createSlider(
60
- () => ({ value: value.value, min: props.min, max: props.max, step: props.step, marks: props.marks }),
68
+ () => ({ value: value.value, min, max, step, marks }),
61
69
  (v) => (value.value = v),
62
70
  (v) => (shown.value = v),
71
+ (v) => emit('valueCommit', v),
63
72
  )
64
73
  onBeforeUnmount(slider.destroy)
65
74
 
@@ -70,23 +79,23 @@ const onInput = (e: Event) => {
70
79
  input.value = String(at.value)
71
80
  }
72
81
  const onKeydown = (e: KeyboardEvent) => {
73
- slider.end()
74
82
  if (!e.defaultPrevented && slider.key(e.key)) e.preventDefault()
75
83
  }
76
84
  </script>
77
85
 
78
86
  <template>
79
- <div :class="[styles.root, attrs.class]" :data-disabled="disabled || undefined">
87
+ <div :class="[styles.root, attrs.class]" data-slot="slider" data-orientation="horizontal" :data-disabled="disabled || undefined">
80
88
  <div :class="styles.head">
81
- <label :for="inputId" :class="styles.label">{{ label }}</label>
82
- <output v-if="showValue" :for="inputId" :class="styles.value" aria-hidden="true">{{ text }}</output>
89
+ <label :for="inputId" :class="styles.label" data-slot="field-label">{{ label }}</label>
90
+ <output v-if="showValue" :for="inputId" :class="styles.value" data-slot="slider-value" aria-hidden="true">{{ text }}</output>
83
91
  </div>
84
- <div :class="styles.trackWrap" :data-gliding="shown !== null || undefined" :style="{ '--pct': `${pct}%`, '--p': pct / 100 }">
92
+ <div :class="styles.trackWrap" data-slot="slider-control" :data-gliding="shown !== null || undefined" :style="{ '--pct': `${pct}%`, '--p': pct / 100 }">
85
93
  <input
86
94
  v-bind="inputAttrs"
87
95
  :id="inputId"
88
96
  type="range"
89
97
  :class="styles.input"
98
+ data-slot="slider-input"
90
99
  :min="min"
91
100
  :max="max"
92
101
  :step="shown === null ? step : 'any'"
@@ -102,11 +111,12 @@ const onKeydown = (e: KeyboardEvent) => {
102
111
  @lostpointercapture="slider.end()"
103
112
  @blur="slider.end()"
104
113
  @keydown="onKeydown"
114
+ @keyup="slider.keyUp()"
105
115
  />
106
- <span v-if="showValue" :class="styles.bubble" aria-hidden="true">{{ text }}</span>
116
+ <span v-if="showValue" :class="styles.bubble" data-slot="slider-bubble" aria-hidden="true">{{ text }}</span>
107
117
  <!-- After the bubble, which CSS shows from the input just before it. -->
108
- <span v-if="marks?.length" :class="styles.marks" aria-hidden="true">
109
- <span v-for="m in marks" :key="m" :class="styles.mark" :data-on="m === value || undefined" :style="{ '--m': (m - min) / (max - min || 1) }" />
118
+ <span v-if="marks?.length" :class="styles.marks" data-slot="slider-marks" aria-hidden="true">
119
+ <span v-for="m in marks" :key="m" :class="styles.mark" data-slot="slider-mark" :data-state="m === value ? 'active' : 'inactive'" :style="{ '--m': (m - min) / (max - min || 1) }" />
110
120
  </span>
111
121
  </div>
112
122
  </div>
@@ -1,3 +1,4 @@
1
+ @layer gooee.components {
1
2
  .root {
2
3
  display: inline-flex;
3
4
  flex: none;
@@ -48,3 +49,4 @@
48
49
  0%, 100% { stroke-dasharray: 18 100; }
49
50
  50% { stroke-dasharray: 62 100; }
50
51
  }
52
+ }
@@ -18,10 +18,10 @@ export function Spinner({ size = 'md', label = 'Loading', className }: SpinnerPr
18
18
  const [mounted, setMounted] = useState(false)
19
19
  useEffect(() => setMounted(true), [])
20
20
  return (
21
- <span className={cx(styles.root, styles[size], className)} role={label ? 'status' : undefined}>
21
+ <span className={cx(styles.root, styles[size], className)} data-slot="spinner" role={label ? 'status' : undefined}>
22
22
  <svg className={styles.svg} viewBox="0 0 24 24" aria-hidden="true" focusable="false">
23
- <circle className={styles.track} cx="12" cy="12" r="9.5" />
24
- <circle className={styles.arc} cx="12" cy="12" r="9.5" pathLength="100" />
23
+ <circle className={styles.track} data-slot="spinner-track" cx="12" cy="12" r="9.5" />
24
+ <circle className={styles.arc} data-slot="spinner-indicator" cx="12" cy="12" r="9.5" pathLength="100" />
25
25
  </svg>
26
26
  {label && <span className={styles.srOnly}>{mounted ? label : null}</span>}
27
27
  </span>
@@ -4,15 +4,12 @@ import styles from './Spinner.module.css'
4
4
 
5
5
  // The Vue Spinner: the same look (Spinner.module.css) as the React one.
6
6
 
7
- withDefaults(
8
- defineProps<{
9
- /** Diameter of the spinner. */
10
- size?: 'sm' | 'md' | 'lg'
11
- /** Spoken to screen readers. Pass null when a parent already announces the busy state. */
12
- label?: string | null
13
- }>(),
14
- { size: 'md', label: 'Loading' },
15
- )
7
+ const { size = 'md', label = 'Loading' } = defineProps<{
8
+ /** Diameter of the spinner. */
9
+ size?: 'sm' | 'md' | 'lg'
10
+ /** Spoken to screen readers. Pass null when a parent already announces the busy state. */
11
+ label?: string | null
12
+ }>()
16
13
 
17
14
  // The label lands after the empty live region is mounted, so screen readers hear it.
18
15
  const mounted = ref(false)
@@ -20,10 +17,10 @@ onMounted(() => (mounted.value = true))
20
17
  </script>
21
18
 
22
19
  <template>
23
- <span :class="[styles.root, styles[size]]" :role="label ? 'status' : undefined">
20
+ <span :class="[styles.root, styles[size]]" data-slot="spinner" :role="label ? 'status' : undefined">
24
21
  <svg :class="styles.svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
25
- <circle :class="styles.track" cx="12" cy="12" r="9.5" />
26
- <circle :class="styles.arc" cx="12" cy="12" r="9.5" pathLength="100" />
22
+ <circle :class="styles.track" data-slot="spinner-track" cx="12" cy="12" r="9.5" />
23
+ <circle :class="styles.arc" data-slot="spinner-indicator" cx="12" cy="12" r="9.5" pathLength="100" />
27
24
  </svg>
28
25
  <span v-if="label" :class="styles.srOnly">{{ mounted ? label : null }}</span>
29
26
  </span>
@@ -1,3 +1,4 @@
1
+ @layer gooee.components {
1
2
  .root {
2
3
  container-type: inline-size;
3
4
  min-width: 0;
@@ -27,3 +28,4 @@
27
28
  [data-stacked="main"] > .side,
28
29
  [data-stacked="sidebar"] > .main { display: none; }
29
30
  }
31
+ }
@@ -18,12 +18,12 @@ export type SplitProps = ComponentPropsWithRef<'div'> & {
18
18
 
19
19
  export function Split({ sidebar, side = 'start', sidebarWidth = 'md', gap = 7, stacked = 'both', className, style, children, ...rest }: SplitProps) {
20
20
  const hasSide = sidebar !== null && sidebar !== undefined && sidebar !== false
21
- const aside = hasSide && <div className={styles.side}>{sidebar}</div>
22
- const main = <div className={styles.main}>{children}</div>
21
+ const aside = hasSide && <div className={styles.side} data-slot="split-side">{sidebar}</div>
22
+ const main = <div className={styles.main} data-slot="split-main">{children}</div>
23
23
  const vars = { '--split-gap': space(gap), '--split-side': `var(--gooee-split-side-${sidebarWidth})`, ...style } as CSSProperties
24
24
  // The outer box is the query container: an element cannot query its own width.
25
25
  return (
26
- <div className={cx(styles.root, className)} style={vars} {...rest}>
26
+ <div className={cx(styles.root, className)} data-slot="split" style={vars} {...rest}>
27
27
  <div className={cx(styles.inner, hasSide ? styles[side] : styles.solo)} data-stacked={stacked}>
28
28
  {side === 'start' ? aside : main}
29
29
  {side === 'start' ? main : aside}
@@ -5,30 +5,32 @@ import styles from './Split.module.css'
5
5
 
6
6
  // The Vue Split: the same look (Split.module.css) as the React one. The sidebar slot is the narrow column;
7
7
  // leave it out for one column. Other attributes go to the outer box.
8
- const props = withDefaults(
9
- defineProps<{
10
- /** Which side the sidebar sits on. It also comes first ("start") or last ("end") when the columns stack. */
11
- side?: 'start' | 'end'
12
- /** Width of the sidebar, from the --gooee-split-side-* tokens. */
13
- sidebarWidth?: 'sm' | 'md' | 'lg'
14
- /** Space between the columns, and between them once stacked, as a step of the space scale. */
15
- gap?: Space
16
- /** What shows once the columns stack: both, only main, or only the sidebar. */
17
- stacked?: 'both' | 'main' | 'sidebar'
18
- }>(),
19
- { side: 'start', sidebarWidth: 'md', gap: 7, stacked: 'both' },
20
- )
8
+ const {
9
+ side = 'start',
10
+ sidebarWidth = 'md',
11
+ gap = 7,
12
+ stacked = 'both',
13
+ } = defineProps<{
14
+ /** Which side the sidebar sits on. It also comes first ("start") or last ("end") when the columns stack. */
15
+ side?: 'start' | 'end'
16
+ /** Width of the sidebar, from the --gooee-split-side-* tokens. */
17
+ sidebarWidth?: 'sm' | 'md' | 'lg'
18
+ /** Space between the columns, and between them once stacked, as a step of the space scale. */
19
+ gap?: Space
20
+ /** What shows once the columns stack: both, only main, or only the sidebar. */
21
+ stacked?: 'both' | 'main' | 'sidebar'
22
+ }>()
21
23
  const slots = defineSlots<{ default?: () => unknown; sidebar?: () => unknown }>()
22
24
  const hasSide = computed(() => !!slots.sidebar)
23
25
  </script>
24
26
 
25
27
  <!-- The outer box is the query container: an element cannot query its own width. -->
26
28
  <template>
27
- <div :class="styles.root" :style="{ '--split-gap': space(gap), '--split-side': `var(--gooee-split-side-${sidebarWidth})` }">
29
+ <div :class="styles.root" data-slot="split" :style="{ '--split-gap': space(gap), '--split-side': `var(--gooee-split-side-${sidebarWidth})` }">
28
30
  <div :class="[styles.inner, hasSide ? styles[side] : styles.solo]" :data-stacked="stacked">
29
- <div v-if="hasSide && side === 'start'" :class="styles.side"><slot name="sidebar" /></div>
30
- <div :class="styles.main"><slot /></div>
31
- <div v-if="hasSide && side === 'end'" :class="styles.side"><slot name="sidebar" /></div>
31
+ <div v-if="hasSide && side === 'start'" :class="styles.side" data-slot="split-side"><slot name="sidebar" /></div>
32
+ <div :class="styles.main" data-slot="split-main"><slot /></div>
33
+ <div v-if="hasSide && side === 'end'" :class="styles.side" data-slot="split-side"><slot name="sidebar" /></div>
32
34
  </div>
33
35
  </div>
34
36
  </template>
@@ -1,3 +1,4 @@
1
+ @layer gooee.components {
1
2
  .root {
2
3
  display: inline-flex;
3
4
  vertical-align: middle;
@@ -37,9 +38,9 @@
37
38
  .cell {
38
39
  position: relative;
39
40
  display: block;
40
- inline-size: var(--gooee-flap-w);
41
- block-size: var(--gooee-flap-h);
42
- perspective: calc(var(--gooee-flap-h) * 3);
41
+ inline-size: var(--gooee-split-flap-w, round(nearest, 0.92em, 4px));
42
+ block-size: var(--gooee-split-flap-h, round(nearest, 1.36em, 4px));
43
+ perspective: calc(var(--gooee-split-flap-h, round(nearest, 1.36em, 4px)) * 3);
43
44
  color: var(--gooee-color-fg);
44
45
  }
45
46
 
@@ -58,22 +59,22 @@
58
59
  .front {
59
60
  top: 0;
60
61
  border-radius: var(--gooee-radius-xs) var(--gooee-radius-xs) 0 0;
61
- background: var(--gooee-flap-top);
62
+ background: var(--gooee-split-flap-top, light-dark(var(--gooee-color-surface-sunken), var(--gooee-color-surface-active)));
62
63
  }
63
64
 
64
65
  .bottom,
65
66
  .back {
66
67
  bottom: 0;
67
68
  border-radius: 0 0 var(--gooee-radius-xs) var(--gooee-radius-xs);
68
- background: var(--gooee-flap-bottom);
69
+ background: var(--gooee-split-flap-bottom, var(--gooee-color-surface-hover));
69
70
  }
70
71
 
71
72
  .glyph {
72
73
  position: absolute;
73
74
  inset-inline: 0;
74
75
  top: 0;
75
- block-size: var(--gooee-flap-h);
76
- line-height: var(--gooee-flap-h);
76
+ block-size: var(--gooee-split-flap-h, round(nearest, 1.36em, 4px));
77
+ line-height: var(--gooee-split-flap-h, round(nearest, 1.36em, 4px));
77
78
  text-align: center;
78
79
  }
79
80
 
@@ -105,3 +106,4 @@
105
106
  bottom: auto;
106
107
  transform: rotateX(180deg);
107
108
  }
109
+ }
@@ -51,11 +51,11 @@ export function SplitFlap({ value, length = 0, size = 'md', chars = SPLIT_FLAP_C
51
51
  useEffect(() => () => flap.current?.destroy(), [])
52
52
 
53
53
  return (
54
- <span className={cx(styles.root, className)} data-size={size} {...rest}>
54
+ <span className={cx(styles.root, className)} data-slot="split-flap" data-size={size} {...rest}>
55
55
  <span className={styles.sr} aria-live={announce ? 'polite' : undefined} aria-atomic="true">
56
56
  {said}
57
57
  </span>
58
- <span ref={board} className={styles.board} aria-hidden="true" dangerouslySetInnerHTML={first} />
58
+ <span ref={board} className={styles.board} data-slot="split-flap-board" aria-hidden="true" dangerouslySetInnerHTML={first} />
59
59
  </span>
60
60
  )
61
61
  }