gooee 0.51.1 → 1.0.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 (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 +7 -5
  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 +11 -8
  79. package/src/components/DropdownMenu/DropdownMenu.vue +24 -27
  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 +15 -8
  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 +30 -17
  169. package/src/components/Select/Select.vue +62 -57
  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 +20 -9
  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
@@ -1,13 +1,13 @@
1
1
  <script setup lang="ts">
2
- import { onBeforeUnmount, ref, shallowRef, useId, watch, type VNode } from 'vue'
2
+ import { computed, onBeforeUnmount, ref, shallowRef, useId, watch, type VNode } from 'vue'
3
3
  import type { Align, Side } from '../../internal/motion/floating'
4
4
  import { trapFocus } from '../../internal/motion/focus'
5
5
  import { dismissable } from '../../internal/motion/layers'
6
- import { createLiquid } from '../../internal/motion/liquid'
6
+ import { createMorph } from '../../internal/motion/liquid'
7
7
  import { useFloating } from '../../internal/vue/useFloating'
8
8
  import { usePresence } from '../../internal/vue/usePresence'
9
9
  import { cloneTrigger, elementRef, firstNode } from '../../internal/vue/trigger'
10
- import { XIcon } from '../../internal/vueIcons'
10
+ import { XIcon } from '../../icons/vue'
11
11
  import styles from './Popover.module.css'
12
12
 
13
13
  // The Vue Popover: the same look (Popover.module.css), growth, dismiss and focus as the React one.
@@ -15,19 +15,22 @@ import styles from './Popover.module.css'
15
15
  // Other attributes, such as class, go to the panel.
16
16
  defineOptions({ inheritAttrs: false })
17
17
 
18
- const props = withDefaults(
19
- defineProps<{
20
- /** Visible heading, also the dialog's accessible name. The title slot replaces it. */
21
- title?: string
22
- /** Preferred side of the trigger. It flips when there is no room. */
23
- side?: Side
24
- /** How the panel lines up with the trigger along that side. */
25
- align?: Align
26
- /** Label for the close button. */
27
- closeLabel?: string
28
- }>(),
29
- { side: 'bottom', align: 'start', closeLabel: 'Close' },
30
- )
18
+ export type PopoverLabels = {
19
+ /** Screen reader name for the close button. */
20
+ close: string
21
+ }
22
+
23
+ const { side = 'bottom', align = 'start', labels: labelsProp } = defineProps<{
24
+ /** Visible heading, also the dialog's accessible name. The title slot replaces it. */
25
+ title?: string
26
+ /** Preferred side of the trigger. It flips when there is no room. */
27
+ side?: Side
28
+ /** How the panel lines up with the trigger along that side. */
29
+ align?: Align
30
+ /** Text for the popover's controls, so you can translate it. Missing keys use the English defaults. */
31
+ labels?: Partial<PopoverLabels>
32
+ }>()
33
+ const labels = computed<PopoverLabels>(() => ({ close: 'Close', ...labelsProp }))
31
34
  /** Whether the panel is open. Use v-model:open to control it; without it the popover keeps its own state. */
32
35
  const open = defineModel<boolean>('open', { default: false })
33
36
  const slots = defineSlots<{ trigger?: () => VNode[]; default?: () => unknown; title?: () => unknown }>()
@@ -38,13 +41,10 @@ const setAnchor = elementRef(anchor)
38
41
  const panel = ref<HTMLElement | null>(null)
39
42
  const close = () => (open.value = false)
40
43
  const { mounted, state } = usePresence(open, 'morph-out')
41
- const { style, side: placed, ready } = useFloating(anchor, panel, mounted, () => ({ side: props.side, align: props.align, offset: 8 }))
44
+ const { style, side: placed, ready } = useFloating(anchor, panel, mounted, () => ({ side, align, offset: 8 }))
42
45
  // Vue sets a bare number as no length at all, so the place gets its unit here.
43
46
  // The panel grows out of its trigger and folds back into it.
44
- const liquid = createLiquid(
45
- () => panel.value,
46
- () => anchor.value,
47
- )
47
+ const liquid = createMorph(() => panel.value, { origin: () => anchor.value })
48
48
  watch([state, () => mounted.value && ready.value], ([s, on]) => on && liquid.play(s), { flush: 'post' })
49
49
 
50
50
  let releaseDismiss = () => {}
@@ -92,17 +92,18 @@ const trigger = () => {
92
92
  :aria-labelledby="`${id}-title`"
93
93
  tabindex="-1"
94
94
  :class="styles.panel"
95
+ data-slot="popover-content"
95
96
  :data-state="state"
96
97
  :data-side="placed"
97
98
  :style="style"
98
99
  >
99
- <div :class="styles.head">
100
- <h2 :id="`${id}-title`" :class="styles.title"><slot name="title">{{ title }}</slot></h2>
101
- <button type="button" :class="styles.close" :aria-label="closeLabel" data-skip-initial-focus="true" @click="close">
100
+ <div :class="styles.head" data-slot="popover-header">
101
+ <h2 :id="`${id}-title`" :class="styles.title" data-slot="popover-title"><slot name="title">{{ title }}</slot></h2>
102
+ <button type="button" :class="styles.close" data-slot="popover-close" :aria-label="labels.close" data-skip-initial-focus="true" @click="close">
102
103
  <XIcon />
103
104
  </button>
104
105
  </div>
105
- <div :class="styles.body"><slot /></div>
106
+ <div :class="styles.body" data-slot="popover-body"><slot /></div>
106
107
  </div>
107
108
  </Teleport>
108
109
  </template>
@@ -1,3 +1,4 @@
1
+ @layer gooee.components {
1
2
  .root {
2
3
  display: flex;
3
4
  flex-direction: column;
@@ -37,10 +38,10 @@
37
38
  border-radius: inherit;
38
39
  background: var(--gooee-color-accent);
39
40
  transform-origin: left center;
40
- transition: transform var(--gooee-motion-slower) var(--gooee-ease-out);
41
+ transition: transform var(--gooee-motion-slower) var(--gooee-ease-morph);
41
42
  }
42
43
 
43
- .track[data-indeterminate] .fill {
44
+ .track[data-status="indeterminate"] .fill {
44
45
  width: 40%;
45
46
  animation: slide var(--gooee-motion-indeterminate) var(--gooee-ease-in-out) infinite;
46
47
  }
@@ -59,3 +60,4 @@
59
60
  50% { transform: translateX(80%) scaleX(1); }
60
61
  100% { transform: translateX(260%) scaleX(0.6); }
61
62
  }
63
+ }
@@ -27,10 +27,10 @@ export function ProgressBar({ label, value, max = 100, showValue = true, hideLab
27
27
  const ratio = determinate ? Math.min(Math.max(value / max, 0), 1) : 0
28
28
  const pct = Math.round(ratio * 100)
29
29
  return (
30
- <div className={cx(styles.root, className)}>
30
+ <div className={cx(styles.root, className)} data-slot="progress-bar">
31
31
  <div className={cx(styles.head, hideLabel && styles.srOnly)}>
32
- <span id={id} className={styles.label}>{label}</span>
33
- {determinate && showValue && <span className={styles.value} aria-hidden="true">{pct}%</span>}
32
+ <span id={id} className={styles.label} data-slot="progress-bar-label">{label}</span>
33
+ {determinate && showValue && <span className={styles.value} data-slot="progress-bar-value" aria-hidden="true">{pct}%</span>}
34
34
  </div>
35
35
  <div
36
36
  role="progressbar"
@@ -39,9 +39,10 @@ export function ProgressBar({ label, value, max = 100, showValue = true, hideLab
39
39
  aria-valuemax={determinate ? max : undefined}
40
40
  aria-valuenow={determinate ? Math.min(Math.max(value, 0), max) : undefined}
41
41
  className={cx(styles.track, styles[size])}
42
- data-indeterminate={!determinate || undefined}
42
+ data-slot="progress-bar-track"
43
+ data-status={!determinate ? 'indeterminate' : ratio >= 1 ? 'complete' : 'loading'}
43
44
  >
44
- <span className={styles.fill} style={determinate ? { transform: `scaleX(${ratio})` } : undefined} />
45
+ <span className={styles.fill} data-slot="progress-bar-indicator" style={determinate ? { transform: `scaleX(${ratio})` } : undefined} />
45
46
  </div>
46
47
  </div>
47
48
  )
@@ -3,35 +3,37 @@ import { computed, useId } from 'vue'
3
3
  import styles from './ProgressBar.module.css'
4
4
 
5
5
  // The Vue ProgressBar: the same look (ProgressBar.module.css) as the React one.
6
- const props = withDefaults(
7
- defineProps<{
8
- /** Says what is in progress. Shown above the bar and read by screen readers. */
9
- label: string
10
- /** 0 to max. Leave it out for an indeterminate bar. */
11
- value?: number
12
- /** The value that means done. */
13
- max?: number
14
- /** Shows the percentage next to the label. */
15
- showValue?: boolean
16
- /** Hides the label visually but keeps it for screen readers. */
17
- hideLabel?: boolean
18
- /** Thickness of the bar. */
19
- size?: 'sm' | 'md'
20
- }>(),
21
- { max: 100, showValue: true, size: 'md' },
22
- )
6
+ const {
7
+ value,
8
+ max = 100,
9
+ showValue = true,
10
+ size = 'md',
11
+ } = defineProps<{
12
+ /** Says what is in progress. Shown above the bar and read by screen readers. */
13
+ label: string
14
+ /** 0 to max. Leave it out for an indeterminate bar. */
15
+ value?: number
16
+ /** The value that means done. */
17
+ max?: number
18
+ /** Shows the percentage next to the label. */
19
+ showValue?: boolean
20
+ /** Hides the label visually but keeps it for screen readers. */
21
+ hideLabel?: boolean
22
+ /** Thickness of the bar. */
23
+ size?: 'sm' | 'md'
24
+ }>()
23
25
 
24
26
  const id = useId()
25
- const determinate = computed(() => props.value !== undefined)
26
- const ratio = computed(() => (props.value !== undefined ? Math.min(Math.max(props.value / props.max, 0), 1) : 0))
27
- const now = computed(() => (props.value !== undefined ? Math.min(Math.max(props.value, 0), props.max) : undefined))
27
+ const determinate = computed(() => value !== undefined)
28
+ const ratio = computed(() => (value !== undefined ? Math.min(Math.max(value / max, 0), 1) : 0))
29
+ const now = computed(() => (value !== undefined ? Math.min(Math.max(value, 0), max) : undefined))
28
30
  </script>
29
31
 
30
32
  <template>
31
- <div :class="styles.root">
33
+ <div :class="styles.root" data-slot="progress-bar">
32
34
  <div :class="[styles.head, hideLabel && styles.srOnly]">
33
- <span :id="id" :class="styles.label">{{ label }}</span>
34
- <span v-if="determinate && showValue" :class="styles.value" aria-hidden="true">{{ Math.round(ratio * 100) }}%</span>
35
+ <span :id="id" :class="styles.label" data-slot="progress-bar-label">{{ label }}</span>
36
+ <span v-if="determinate && showValue" :class="styles.value" data-slot="progress-bar-value" aria-hidden="true">{{ Math.round(ratio * 100) }}%</span>
35
37
  </div>
36
38
  <div
37
39
  role="progressbar"
@@ -40,9 +42,10 @@ const now = computed(() => (props.value !== undefined ? Math.min(Math.max(props.
40
42
  :aria-valuemax="determinate ? max : undefined"
41
43
  :aria-valuenow="now"
42
44
  :class="[styles.track, styles[size]]"
43
- :data-indeterminate="!determinate || undefined"
45
+ data-slot="progress-bar-track"
46
+ :data-status="!determinate ? 'indeterminate' : ratio >= 1 ? 'complete' : 'loading'"
44
47
  >
45
- <span :class="styles.fill" :style="determinate ? { transform: `scaleX(${ratio})` } : undefined" />
48
+ <span :class="styles.fill" data-slot="progress-bar-indicator" :style="determinate ? { transform: `scaleX(${ratio})` } : undefined" />
46
49
  </div>
47
50
  </div>
48
51
  </template>
@@ -1,3 +1,4 @@
1
+ @layer gooee.components {
1
2
  /* A line of about 68 characters, the length an eye can follow back to the next line without losing it.
2
3
  :where keeps every rule at zero weight, so a class you add inside always wins. */
3
4
  .root {
@@ -36,7 +37,7 @@
36
37
  text-decoration-color: var(--gooee-color-border-strong);
37
38
  text-decoration-thickness: var(--gooee-line);
38
39
  text-underline-offset: 0.2em;
39
- transition: text-decoration-color var(--gooee-motion-fast) var(--gooee-ease-out);
40
+ transition: text-decoration-color var(--gooee-motion-fast) var(--gooee-ease-morph);
40
41
  }
41
42
 
42
43
  @media (hover: hover) {
@@ -74,8 +75,8 @@
74
75
  overflow-x: auto;
75
76
  padding: var(--gooee-space-5);
76
77
  border-radius: var(--gooee-radius-md);
77
- background: var(--gooee-code-bg);
78
- color: var(--gooee-code-fg);
78
+ background: var(--gooee-code-block-bg, var(--gooee-color-surface-sunken));
79
+ color: var(--gooee-code-block-fg, var(--gooee-color-fg));
79
80
  font-size: var(--gooee-text-sm);
80
81
  line-height: var(--gooee-leading-normal);
81
82
  }
@@ -115,3 +116,4 @@
115
116
  }
116
117
 
117
118
  .root :where(th) { font-weight: var(--gooee-weight-semibold); }
119
+ }
@@ -10,5 +10,5 @@ export type ProseProps = {
10
10
  // Long text written elsewhere, such as Markdown or a CMS: headings, paragraphs, lists, quotes, code and
11
11
  // pictures, set for reading. It styles plain HTML inside it, so nothing needs a class.
12
12
  export function Prose({ as: Tag = 'div', className, ...rest }: ProseProps) {
13
- return <Tag className={cx(styles.root, className)} {...rest} />
13
+ return <Tag className={cx(styles.root, className)} data-slot="prose" {...rest} />
14
14
  }
@@ -3,16 +3,13 @@ import styles from './Prose.module.css'
3
3
 
4
4
  // The Vue Prose: the same look (Prose.module.css) as the React one. It styles the plain HTML inside it,
5
5
  // so Markdown or CMS HTML can go in with v-html, or as the default slot.
6
- withDefaults(
7
- defineProps<{
8
- /** The element to render, such as article. */
9
- as?: string
10
- }>(),
11
- { as: 'div' },
12
- )
6
+ const { as = 'div' } = defineProps<{
7
+ /** The element to render, such as article. */
8
+ as?: string
9
+ }>()
13
10
  defineSlots<{ default?: () => unknown }>()
14
11
  </script>
15
12
 
16
13
  <template>
17
- <component :is="as" :class="styles.root"><slot /></component>
14
+ <component :is="as" :class="styles.root" data-slot="prose"><slot /></component>
18
15
  </template>
@@ -1,3 +1,4 @@
1
+ @layer gooee.components {
1
2
  .group {
2
3
  margin: 0;
3
4
  padding: 0;
@@ -61,9 +62,9 @@
61
62
  border-radius: var(--gooee-radius-full);
62
63
  background: var(--gooee-color-surface);
63
64
  transition:
64
- border-color var(--gooee-motion-fast) var(--gooee-ease-out),
65
- box-shadow var(--gooee-motion-fast) var(--gooee-ease-out),
66
- transform var(--gooee-motion-slow) var(--gooee-ease-spring);
65
+ border-color var(--gooee-motion-fast) var(--gooee-ease-morph),
66
+ box-shadow var(--gooee-motion-fast) var(--gooee-ease-morph),
67
+ transform var(--gooee-motion-slow) var(--gooee-ease-morph);
67
68
  }
68
69
 
69
70
  @media (hover: hover) {
@@ -71,8 +72,8 @@
71
72
  }
72
73
  .input:active:not(:disabled) + .circle { transform: scale(var(--gooee-press-scale-strong)); transition-duration: var(--gooee-motion-instant); }
73
74
  .input:focus-visible + .circle { box-shadow: var(--gooee-focus-ring); }
74
- .circle[data-on] { border-color: var(--gooee-color-accent); }
75
- .group[data-invalid] .circle:not([data-on]) { border-color: var(--gooee-color-danger); }
75
+ .circle[data-state="checked"] { border-color: var(--gooee-color-accent); }
76
+ .group[data-invalid] .circle:not([data-state="checked"]) { border-color: var(--gooee-color-danger); }
76
77
 
77
78
  .dot {
78
79
  width: var(--gooee-control-dot);
@@ -80,12 +81,12 @@
80
81
  border-radius: var(--gooee-radius-full);
81
82
  background: var(--gooee-color-accent);
82
83
  transform: scale(0);
83
- transition: transform var(--gooee-motion-fast) var(--gooee-ease-in);
84
+ transition: transform var(--gooee-motion-fast) var(--gooee-ease-morph);
84
85
  }
85
86
 
86
- .circle[data-on] .dot {
87
+ .circle[data-state="checked"] .dot {
87
88
  transform: scale(1);
88
- transition: transform var(--gooee-motion-slow) var(--gooee-ease-bounce);
89
+ transition: transform var(--gooee-motion-slow) var(--gooee-ease-morph);
89
90
  }
90
91
 
91
92
  .text {
@@ -104,3 +105,4 @@
104
105
  color: var(--gooee-color-fg-muted);
105
106
  line-height: var(--gooee-leading-snug);
106
107
  }
108
+ }
@@ -56,15 +56,16 @@ export function RadioGroup({
56
56
  <fieldset
57
57
  role="radiogroup"
58
58
  className={cx(styles.group, className)}
59
+ data-slot="radio-group"
59
60
  disabled={disabled}
60
61
  aria-invalid={error ? true : undefined}
61
62
  aria-describedby={describedBy || undefined}
62
63
  data-invalid={error ? true : undefined}
63
64
  >
64
- <legend className={styles.legend}>{label}</legend>
65
- {description && <p id={descId} className={styles.groupDescription}>{description}</p>}
66
- <div className={cx(styles.items, styles[orientation])}>
67
- <RadioCtx.Provider value={{ name: name ?? auto, value, set: setValue, disabled, invalid: !!error }}>{children}</RadioCtx.Provider>
65
+ <legend className={styles.legend} data-slot="field-label">{label}</legend>
66
+ {description && <p id={descId} className={styles.groupDescription} data-slot="radio-group-description">{description}</p>}
67
+ <div className={cx(styles.items, styles[orientation])} data-slot="radio-group-items" data-orientation={orientation}>
68
+ <RadioCtx value={{ name: name ?? auto, value, set: setValue, disabled, invalid: !!error }}>{children}</RadioCtx>
68
69
  </div>
69
70
  <FieldMessage helpId={`${auto}-help`} errorId={errorId} error={error} />
70
71
  </fieldset>
@@ -88,12 +89,13 @@ export function Radio({ value, label, description, disabled }: RadioProps) {
88
89
  const id = useId()
89
90
  const isOn = ctx.value === value
90
91
  return (
91
- <div className={styles.root} data-disabled={disabled || ctx.disabled || undefined}>
92
+ <div className={styles.root} data-slot="radio" data-state={isOn ? 'checked' : 'unchecked'} data-disabled={disabled || ctx.disabled || undefined}>
92
93
  <span className={styles.circleWrap}>
93
94
  <input
94
95
  id={id}
95
96
  type="radio"
96
97
  className={styles.input}
98
+ data-slot="radio-input"
97
99
  name={ctx.name}
98
100
  value={value}
99
101
  checked={isOn}
@@ -102,13 +104,13 @@ export function Radio({ value, label, description, disabled }: RadioProps) {
102
104
  aria-describedby={description ? `${id}-desc` : undefined}
103
105
  onChange={() => ctx.set(value)}
104
106
  />
105
- <span className={styles.circle} data-on={isOn || undefined} aria-hidden="true">
107
+ <span className={styles.circle} data-slot="radio-indicator" data-state={isOn ? 'checked' : 'unchecked'} aria-hidden="true">
106
108
  <span className={styles.dot} />
107
109
  </span>
108
110
  </span>
109
111
  <span className={styles.text}>
110
- <label htmlFor={id} className={styles.label}>{label}</label>
111
- {description && <span id={`${id}-desc`} className={styles.description}>{description}</span>}
112
+ <label htmlFor={id} className={styles.label} data-slot="field-label">{label}</label>
113
+ {description && <span id={`${id}-desc`} className={styles.description} data-slot="radio-description">{description}</span>}
112
114
  </span>
113
115
  </div>
114
116
  )
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { computed, inject, useId } from 'vue'
3
- import { radioKey } from './RadioGroup.vue'
2
+ import { computed, useId } from 'vue'
3
+ import { useRadioGroup } from './radioContext'
4
4
  import styles from './Radio.module.css'
5
5
 
6
6
  // The Vue Radio: one choice inside a RadioGroup, the same look (Radio.module.css) as the React one.
@@ -16,19 +16,19 @@ const props = defineProps<{
16
16
  disabled?: boolean
17
17
  }>()
18
18
 
19
- const ctx = inject(radioKey)
20
- if (!ctx) throw new Error('Radio must be inside RadioGroup')
19
+ const ctx = useRadioGroup()
21
20
  const id = useId()
22
21
  const isOn = computed(() => ctx.value.value === props.value)
23
22
  </script>
24
23
 
25
24
  <template>
26
- <div :class="styles.root" :data-disabled="disabled || ctx.disabled.value || undefined">
25
+ <div :class="styles.root" data-slot="radio" :data-state="isOn ? 'checked' : 'unchecked'" :data-disabled="disabled || ctx.disabled.value || undefined">
27
26
  <span :class="styles.circleWrap">
28
27
  <input
29
28
  :id="id"
30
29
  type="radio"
31
30
  :class="styles.input"
31
+ data-slot="radio-input"
32
32
  :name="ctx.name.value"
33
33
  :value="value"
34
34
  :checked="isOn"
@@ -37,13 +37,13 @@ const isOn = computed(() => ctx.value.value === props.value)
37
37
  :aria-describedby="description ? `${id}-desc` : undefined"
38
38
  @change="ctx.set(value)"
39
39
  />
40
- <span :class="styles.circle" :data-on="isOn || undefined" aria-hidden="true">
40
+ <span :class="styles.circle" data-slot="radio-indicator" :data-state="isOn ? 'checked' : 'unchecked'" aria-hidden="true">
41
41
  <span :class="styles.dot" />
42
42
  </span>
43
43
  </span>
44
44
  <span :class="styles.text">
45
- <label :for="id" :class="styles.label">{{ label }}</label>
46
- <span v-if="description" :id="`${id}-desc`" :class="styles.description">{{ description }}</span>
45
+ <label :for="id" :class="styles.label" data-slot="field-label">{{ label }}</label>
46
+ <span v-if="description" :id="`${id}-desc`" :class="styles.description" data-slot="radio-description">{{ description }}</span>
47
47
  </span>
48
48
  </div>
49
49
  </template>
@@ -1,40 +1,38 @@
1
- <script lang="ts">
2
- import type { InjectionKey, Ref } from 'vue'
3
-
4
- export type RadioContext = { name: Ref<string>; value: Ref<string | null>; set: (v: string) => void; disabled: Ref<boolean | undefined>; invalid: Ref<boolean> }
5
- export const radioKey: InjectionKey<RadioContext> = Symbol('radio')
6
- </script>
7
-
8
1
  <script setup lang="ts">
9
2
  import { computed, provide, ref, useId } from 'vue'
10
3
  import FieldMessage from '../../internal/FieldMessage.vue'
4
+ import { radioKey } from './radioContext'
11
5
  import styles from './Radio.module.css'
12
6
 
13
7
  // The Vue RadioGroup: the same look (Radio.module.css) as the React one. Put Radio parts in its slot.
14
8
 
15
- const props = withDefaults(
16
- defineProps<{
17
- /** Visible group label (rendered as the fieldset legend). */
18
- label: string
19
- /** Extra text under the group label. */
20
- description?: string
21
- /** Error under the radios. Marks the group invalid and is read with it. */
22
- error?: string
23
- /** Starting value when there is no v-model. */
24
- defaultValue?: string | null
25
- /** Form field name shared by every radio. Undefined makes a unique one. */
26
- name?: string
27
- /** Turns off every radio in the group. */
28
- disabled?: boolean
29
- /** Stacks the radios or puts them in a row. */
30
- orientation?: 'vertical' | 'horizontal'
31
- }>(),
32
- { defaultValue: null, disabled: undefined, orientation: 'vertical' },
33
- )
9
+ const {
10
+ description,
11
+ error,
12
+ defaultValue = null,
13
+ name,
14
+ disabled = undefined,
15
+ orientation = 'vertical',
16
+ } = defineProps<{
17
+ /** Visible group label (rendered as the fieldset legend). */
18
+ label: string
19
+ /** Extra text under the group label. */
20
+ description?: string
21
+ /** Error under the radios. Marks the group invalid and is read with it. */
22
+ error?: string
23
+ /** Starting value when there is no v-model. */
24
+ defaultValue?: string | null
25
+ /** Form field name shared by every radio. Undefined makes a unique one. */
26
+ name?: string
27
+ /** Turns off every radio in the group. */
28
+ disabled?: boolean
29
+ /** Stacks the radios or puts them in a row. */
30
+ orientation?: 'vertical' | 'horizontal'
31
+ }>()
34
32
 
35
33
  /** The selected value. Null means nothing is picked. Use v-model, or leave it out and the group keeps its own state. */
36
34
  const model = defineModel<string | null>()
37
- const local = ref(props.defaultValue)
35
+ const local = ref(defaultValue)
38
36
  const value = computed({
39
37
  get: () => (model.value === undefined ? local.value : model.value),
40
38
  set: (next: string | null) => {
@@ -46,22 +44,22 @@ const value = computed({
46
44
  const auto = useId()
47
45
  const descId = `${auto}-desc`
48
46
  const errorId = `${auto}-error`
49
- const describedBy = computed(() => [props.description ? descId : null, props.error ? errorId : null].filter(Boolean).join(' ') || undefined)
47
+ const describedBy = computed(() => [description ? descId : null, error ? errorId : null].filter(Boolean).join(' ') || undefined)
50
48
 
51
49
  provide(radioKey, {
52
- name: computed(() => props.name ?? auto),
50
+ name: computed(() => name ?? auto),
53
51
  value,
54
52
  set: (v) => (value.value = v),
55
- disabled: computed(() => props.disabled),
56
- invalid: computed(() => !!props.error),
53
+ disabled: computed(() => disabled),
54
+ invalid: computed(() => !!error),
57
55
  })
58
56
  </script>
59
57
 
60
58
  <template>
61
- <fieldset role="radiogroup" :class="styles.group" :disabled="disabled" :aria-invalid="error ? true : undefined" :aria-describedby="describedBy" :data-invalid="error ? true : undefined">
62
- <legend :class="styles.legend">{{ label }}</legend>
63
- <p v-if="description" :id="descId" :class="styles.groupDescription">{{ description }}</p>
64
- <div :class="[styles.items, styles[orientation]]">
59
+ <fieldset role="radiogroup" :class="styles.group" data-slot="radio-group" :disabled="disabled" :aria-invalid="error ? true : undefined" :aria-describedby="describedBy" :data-invalid="error ? true : undefined">
60
+ <legend :class="styles.legend" data-slot="field-label">{{ label }}</legend>
61
+ <p v-if="description" :id="descId" :class="styles.groupDescription" data-slot="radio-group-description">{{ description }}</p>
62
+ <div :class="[styles.items, styles[orientation]]" data-slot="radio-group-items" :data-orientation="orientation">
65
63
  <slot />
66
64
  </div>
67
65
  <FieldMessage :help-id="`${auto}-help`" :error-id="errorId" :error="error" />
@@ -0,0 +1,12 @@
1
+ import { inject, type InjectionKey, type Ref } from 'vue'
2
+
3
+ // What the Vue RadioGroup shares with its Radio parts.
4
+ export type RadioContext = { name: Ref<string>; value: Ref<string | null>; set: (v: string) => void; disabled: Ref<boolean | undefined>; invalid: Ref<boolean> }
5
+
6
+ export const radioKey: InjectionKey<RadioContext> = Symbol('gooee-radio')
7
+
8
+ export function useRadioGroup() {
9
+ const c = inject(radioKey, null)
10
+ if (!c) throw new Error('Radio must be inside RadioGroup')
11
+ return c
12
+ }
@@ -9,27 +9,30 @@ import SegmentedControl from '../SegmentedControl/SegmentedControl.vue'
9
9
 
10
10
  // The Vue Retime: the same control and speed (motion/retime.ts) as the React one.
11
11
 
12
- const props = withDefaults(
13
- defineProps<{
14
- /** Visible label. */
15
- label?: string
16
- /** Starting speed when there is no v-model. A speed saved on this device wins over it. */
17
- defaultValue?: RetimeSpeed
18
- /** Saves the choice on this device, so it lasts across visits. */
19
- remember?: boolean
20
- /** Height of the control. */
21
- size?: 'sm' | 'md'
22
- /** Text for each speed, so you can translate it. */
23
- labels?: Partial<RetimeLabels>
24
- /** Fills the row, with the speeds sharing it evenly, as in a settings panel. */
25
- fullWidth?: boolean
26
- }>(),
27
- { label: 'Motion', defaultValue: 'normal', remember: true, size: 'md' },
28
- )
12
+ const {
13
+ label = 'Motion',
14
+ defaultValue = 'normal',
15
+ remember = true,
16
+ size = 'md',
17
+ labels: labelsProp,
18
+ } = defineProps<{
19
+ /** Visible label. */
20
+ label?: string
21
+ /** Starting speed when there is no v-model. A speed saved on this device wins over it. */
22
+ defaultValue?: RetimeSpeed
23
+ /** Saves the choice on this device, so it lasts across visits. */
24
+ remember?: boolean
25
+ /** Height of the control. */
26
+ size?: 'sm' | 'md'
27
+ /** Text for each speed, so you can translate it. */
28
+ labels?: Partial<RetimeLabels>
29
+ /** Fills the row, with the speeds sharing it evenly, as in a settings panel. */
30
+ fullWidth?: boolean
31
+ }>()
29
32
 
30
33
  /** The chosen speed. Use v-model, or leave it out and the part keeps its own. */
31
34
  const model = defineModel<RetimeSpeed>()
32
- const local = ref<RetimeSpeed>(props.defaultValue)
35
+ const local = ref<RetimeSpeed>(defaultValue)
33
36
  const speed = computed({
34
37
  get: () => model.value ?? local.value,
35
38
  set: (next: RetimeSpeed) => {
@@ -39,7 +42,7 @@ const speed = computed({
39
42
  })
40
43
 
41
44
  const options = computed(() => {
42
- const labels = { ...defaultRetimeLabels, ...props.labels }
45
+ const labels = { ...defaultRetimeLabels, ...labelsProp }
43
46
  return retimeSpeeds.map((s) => ({ value: s, label: labels[s] }))
44
47
  })
45
48
 
@@ -48,13 +51,13 @@ const follow = (e: Event) => {
48
51
  if (model.value === undefined) speed.value = (e as CustomEvent<RetimeSpeed>).detail
49
52
  }
50
53
  onMounted(() => {
51
- if (props.remember && model.value === undefined) {
54
+ if (remember && model.value === undefined) {
52
55
  const saved = savedSpeed()
53
56
  if (saved) local.value = saved
54
57
  }
55
58
  window.addEventListener(RETIME_EVENT, follow)
56
- commitSpeed(speed.value, props.remember)
57
- watch([speed, () => props.remember], () => commitSpeed(speed.value, props.remember))
59
+ commitSpeed(speed.value, remember)
60
+ watch([speed, () => remember], () => commitSpeed(speed.value, remember))
58
61
  })
59
62
  onBeforeUnmount(() => window.removeEventListener(RETIME_EVENT, follow))
60
63
  </script>