gooee 0.52.0 → 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.
- package/README.md +10 -3
- package/package.json +6 -2
- package/scripts/add.js +181 -42
- package/src/base.css +3 -1
- package/src/components/Accordion/Accordion.module.css +7 -5
- package/src/components/Accordion/Accordion.tsx +13 -11
- package/src/components/Accordion/Accordion.vue +16 -15
- package/src/components/Accordion/AccordionItem.vue +8 -7
- package/src/components/Alert/Alert.module.css +9 -7
- package/src/components/Alert/Alert.tsx +25 -16
- package/src/components/Alert/Alert.vue +31 -27
- package/src/components/AlertDialog/AlertDialog.module.css +2 -0
- package/src/components/AlertDialog/AlertDialog.tsx +8 -7
- package/src/components/AlertDialog/AlertDialog.vue +25 -23
- package/src/components/AnimatedNumber/AnimatedNumber.module.css +5 -3
- package/src/components/AnimatedNumber/AnimatedNumber.tsx +6 -6
- package/src/components/AnimatedNumber/AnimatedNumber.vue +5 -5
- package/src/components/AspectRatio/AspectRatio.module.css +2 -0
- package/src/components/AspectRatio/AspectRatio.tsx +3 -3
- package/src/components/AspectRatio/AspectRatio.vue +5 -8
- package/src/components/Avatar/Avatar.module.css +10 -8
- package/src/components/Avatar/Avatar.tsx +4 -3
- package/src/components/Avatar/Avatar.vue +17 -19
- package/src/components/Avatar/index.ts +0 -2
- package/src/components/AvatarGroup/AvatarGroup.module.css +11 -9
- package/src/components/AvatarGroup/AvatarGroup.tsx +4 -4
- package/src/components/AvatarGroup/AvatarGroup.vue +13 -16
- package/src/components/Badge/Badge.module.css +6 -4
- package/src/components/Badge/Badge.tsx +3 -3
- package/src/components/Badge/Badge.vue +15 -14
- package/src/components/Breadcrumb/Breadcrumb.module.css +5 -3
- package/src/components/Breadcrumb/Breadcrumb.tsx +20 -12
- package/src/components/Breadcrumb/Breadcrumb.vue +33 -25
- package/src/components/Button/Button.module.css +16 -14
- package/src/components/Button/Button.tsx +6 -4
- package/src/components/Button/Button.vue +42 -33
- package/src/components/ButtonGroup/ButtonGroup.module.css +2 -0
- package/src/components/ButtonGroup/ButtonGroup.tsx +1 -1
- package/src/components/ButtonGroup/ButtonGroup.vue +9 -12
- package/src/components/Card/Card.module.css +6 -4
- package/src/components/Card/Card.tsx +6 -6
- package/src/components/Card/Card.vue +18 -21
- package/src/components/Center/Center.module.css +2 -0
- package/src/components/Center/Center.tsx +1 -1
- package/src/components/Center/Center.vue +18 -15
- package/src/components/Checkbox/Checkbox.module.css +10 -8
- package/src/components/Checkbox/Checkbox.tsx +7 -5
- package/src/components/Checkbox/Checkbox.vue +29 -31
- package/src/components/CheckboxGroup/CheckboxGroup.module.css +3 -1
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +4 -4
- package/src/components/CheckboxGroup/CheckboxGroup.vue +33 -30
- package/src/components/Cluster/Cluster.module.css +2 -0
- package/src/components/Cluster/Cluster.tsx +1 -1
- package/src/components/Cluster/Cluster.vue +21 -17
- package/src/components/CodeBlock/CodeBlock.module.css +12 -10
- package/src/components/CodeBlock/CodeBlock.tsx +18 -10
- package/src/components/CodeBlock/CodeBlock.vue +30 -27
- package/src/components/CodeBlock/highlight.ts +1 -1
- package/src/components/Collapsible/Collapsible.module.css +7 -5
- package/src/components/Collapsible/Collapsible.tsx +7 -6
- package/src/components/Collapsible/Collapsible.vue +30 -26
- package/src/components/Container/Container.module.css +2 -0
- package/src/components/Container/Container.tsx +1 -1
- package/src/components/Container/Container.vue +13 -12
- package/src/components/CopyButton/CopyButton.module.css +20 -18
- package/src/components/CopyButton/CopyButton.tsx +21 -14
- package/src/components/CopyButton/CopyButton.vue +41 -31
- package/src/components/Dial/Dial.module.css +26 -11
- package/src/components/Dial/Dial.tsx +18 -18
- package/src/components/Dial/Dial.vue +57 -60
- package/src/components/Dialog/Dialog.module.css +4 -2
- package/src/components/Dialog/Dialog.tsx +22 -13
- package/src/components/Dialog/Dialog.vue +34 -30
- package/src/components/Divider/Divider.module.css +5 -3
- package/src/components/Divider/Divider.tsx +6 -4
- package/src/components/Divider/Divider.vue +13 -16
- package/src/components/DropdownMenu/DropdownMenu.module.css +8 -6
- package/src/components/DropdownMenu/DropdownMenu.tsx +11 -8
- package/src/components/DropdownMenu/DropdownMenu.vue +24 -27
- package/src/components/EmptyState/EmptyState.module.css +6 -4
- package/src/components/EmptyState/EmptyState.tsx +6 -6
- package/src/components/EmptyState/EmptyState.vue +14 -17
- package/src/components/Fab/Fab.module.css +19 -17
- package/src/components/Fab/Fab.tsx +11 -9
- package/src/components/Fab/Fab.vue +29 -26
- package/src/components/Fieldset/Fieldset.module.css +2 -0
- package/src/components/Fieldset/Fieldset.tsx +4 -3
- package/src/components/Fieldset/Fieldset.vue +4 -4
- package/src/components/FormField/FormField.module.css +5 -3
- package/src/components/FormField/FormField.tsx +7 -7
- package/src/components/FormField/FormField.vue +4 -4
- package/src/components/Grid/Grid.module.css +2 -0
- package/src/components/Grid/Grid.tsx +1 -1
- package/src/components/Grid/Grid.vue +25 -22
- package/src/components/HoldToConfirm/HoldToConfirm.module.css +13 -11
- package/src/components/HoldToConfirm/HoldToConfirm.tsx +11 -9
- package/src/components/HoldToConfirm/HoldToConfirm.vue +37 -32
- package/src/components/IconButton/IconButton.module.css +7 -5
- package/src/components/IconButton/IconButton.tsx +2 -1
- package/src/components/IconButton/IconButton.vue +15 -14
- package/src/components/Input/Input.module.css +12 -10
- package/src/components/Input/Input.tsx +9 -7
- package/src/components/Input/Input.vue +45 -35
- package/src/components/InputGroup/InputGroup.module.css +8 -6
- package/src/components/InputGroup/InputGroup.tsx +5 -4
- package/src/components/InputGroup/InputGroup.vue +41 -36
- package/src/components/Kbd/Kbd.module.css +9 -7
- package/src/components/Kbd/Kbd.tsx +1 -1
- package/src/components/Kbd/Kbd.vue +1 -1
- package/src/components/Link/Link.module.css +4 -2
- package/src/components/Link/Link.tsx +4 -3
- package/src/components/Link/Link.vue +13 -16
- package/src/components/LivePill/LivePill.module.css +39 -37
- package/src/components/LivePill/LivePill.tsx +11 -10
- package/src/components/LivePill/LivePill.vue +38 -40
- package/src/components/Meter/Meter.module.css +5 -3
- package/src/components/Meter/Meter.tsx +9 -8
- package/src/components/Meter/Meter.vue +52 -43
- package/src/components/MorphButton/MorphButton.module.css +11 -9
- package/src/components/MorphButton/MorphButton.tsx +20 -10
- package/src/components/MorphButton/MorphButton.vue +29 -25
- package/src/components/NumberInput/NumberInput.module.css +7 -5
- package/src/components/NumberInput/NumberInput.tsx +11 -8
- package/src/components/NumberInput/NumberInput.vue +69 -57
- package/src/components/Pagination/Pagination.module.css +147 -5
- package/src/components/Pagination/Pagination.tsx +216 -41
- package/src/components/Pagination/Pagination.vue +201 -36
- package/src/components/Pagination/labels.ts +38 -0
- package/src/components/PasswordInput/PasswordInput.module.css +10 -8
- package/src/components/PasswordInput/PasswordInput.tsx +15 -7
- package/src/components/PasswordInput/PasswordInput.vue +20 -16
- package/src/components/PasswordInput/index.ts +1 -1
- package/src/components/PickerWheel/DateWheel.vue +20 -12
- package/src/components/PickerWheel/PickerWheel.module.css +15 -6
- package/src/components/PickerWheel/PickerWheel.tsx +70 -44
- package/src/components/PickerWheel/PickerWheel.vue +39 -38
- package/src/components/PickerWheel/TimeWheel.vue +23 -21
- package/src/components/PickerWheel/WheelColumn.vue +7 -5
- package/src/components/Popover/Popover.module.css +5 -3
- package/src/components/Popover/Popover.tsx +17 -8
- package/src/components/Popover/Popover.vue +26 -25
- package/src/components/ProgressBar/ProgressBar.module.css +4 -2
- package/src/components/ProgressBar/ProgressBar.tsx +6 -5
- package/src/components/ProgressBar/ProgressBar.vue +28 -25
- package/src/components/Prose/Prose.module.css +5 -3
- package/src/components/Prose/Prose.tsx +1 -1
- package/src/components/Prose/Prose.vue +5 -8
- package/src/components/Radio/Radio.module.css +10 -8
- package/src/components/Radio/Radio.tsx +10 -8
- package/src/components/Radio/Radio.vue +8 -8
- package/src/components/Radio/RadioGroup.vue +33 -35
- package/src/components/Radio/radioContext.ts +12 -0
- package/src/components/Retime/Retime.vue +25 -22
- package/src/components/RulerScrubber/RulerScrubber.module.css +11 -2
- package/src/components/RulerScrubber/RulerScrubber.tsx +19 -18
- package/src/components/RulerScrubber/RulerScrubber.vue +50 -54
- package/src/components/ScrollArea/ScrollArea.module.css +17 -15
- package/src/components/ScrollArea/ScrollArea.tsx +5 -4
- package/src/components/ScrollArea/ScrollArea.vue +15 -17
- package/src/components/SearchInput/SearchInput.module.css +6 -4
- package/src/components/SearchInput/SearchInput.tsx +15 -8
- package/src/components/SearchInput/SearchInput.vue +20 -17
- package/src/components/SearchInput/index.ts +1 -1
- package/src/components/SegmentedControl/SegmentedControl.module.css +7 -5
- package/src/components/SegmentedControl/SegmentedControl.tsx +9 -5
- package/src/components/SegmentedControl/SegmentedControl.vue +25 -29
- package/src/components/Select/Select.module.css +19 -17
- package/src/components/Select/Select.tsx +30 -17
- package/src/components/Select/Select.vue +62 -57
- package/src/components/Sheet/Sheet.module.css +6 -4
- package/src/components/Sheet/Sheet.tsx +39 -29
- package/src/components/Sheet/Sheet.vue +46 -40
- package/src/components/Skeleton/Skeleton.module.css +4 -2
- package/src/components/Skeleton/Skeleton.tsx +3 -2
- package/src/components/Skeleton/Skeleton.vue +16 -18
- package/src/components/Slider/Slider.module.css +14 -12
- package/src/components/Slider/Slider.tsx +20 -9
- package/src/components/Slider/Slider.vue +47 -37
- package/src/components/Spinner/Spinner.module.css +2 -0
- package/src/components/Spinner/Spinner.tsx +3 -3
- package/src/components/Spinner/Spinner.vue +9 -12
- package/src/components/Split/Split.module.css +2 -0
- package/src/components/Split/Split.tsx +3 -3
- package/src/components/Split/Split.vue +19 -17
- package/src/components/SplitFlap/SplitFlap.module.css +9 -7
- package/src/components/SplitFlap/SplitFlap.tsx +2 -2
- package/src/components/SplitFlap/SplitFlap.vue +24 -21
- package/src/components/Stack/Stack.module.css +2 -0
- package/src/components/Stack/Stack.tsx +1 -1
- package/src/components/Stack/Stack.vue +13 -12
- package/src/components/SwipeDeck/SwipeDeck.module.css +13 -11
- package/src/components/SwipeDeck/SwipeDeck.tsx +23 -28
- package/src/components/SwipeDeck/SwipeDeck.vue +32 -38
- package/src/components/Switch/Switch.module.css +10 -8
- package/src/components/Switch/Switch.tsx +6 -5
- package/src/components/Switch/Switch.vue +22 -24
- package/src/components/Table/Table.module.css +24 -22
- package/src/components/Table/Table.tsx +27 -30
- package/src/components/Table/Table.vue +93 -79
- package/src/components/TableOfContents/TableOfContents.module.css +9 -7
- package/src/components/TableOfContents/TableOfContents.tsx +8 -8
- package/src/components/TableOfContents/TableOfContents.vue +20 -23
- package/src/components/Tabs/Tab.vue +3 -0
- package/src/components/Tabs/TabList.vue +2 -2
- package/src/components/Tabs/TabPanel.vue +2 -0
- package/src/components/Tabs/Tabs.module.css +4 -2
- package/src/components/Tabs/Tabs.tsx +10 -5
- package/src/components/Tabs/Tabs.vue +1 -1
- package/src/components/Tag/Tag.module.css +12 -10
- package/src/components/Tag/Tag.tsx +13 -15
- package/src/components/Tag/Tag.vue +12 -14
- package/src/components/Textarea/Textarea.module.css +8 -6
- package/src/components/Textarea/Textarea.tsx +4 -3
- package/src/components/Textarea/Textarea.vue +32 -34
- package/src/components/ThemeToggle/ThemeToggle.module.css +2 -0
- package/src/components/ThemeToggle/ThemeToggle.tsx +7 -7
- package/src/components/ThemeToggle/ThemeToggle.vue +24 -22
- package/src/components/Toast/Toast.module.css +17 -15
- package/src/components/Toast/Toast.tsx +51 -34
- package/src/components/Toast/Toast.vue +35 -24
- package/src/components/Toast/ToastItem.vue +17 -16
- package/src/components/Toggle/Toggle.module.css +11 -9
- package/src/components/Toggle/Toggle.tsx +3 -2
- package/src/components/Toggle/Toggle.vue +13 -15
- package/src/components/Tooltip/Tooltip.module.css +5 -3
- package/src/components/Tooltip/Tooltip.tsx +1 -0
- package/src/components/Tooltip/Tooltip.vue +13 -18
- package/src/components/VisuallyHidden/VisuallyHidden.module.css +2 -0
- package/src/components/VisuallyHidden/VisuallyHidden.tsx +1 -1
- package/src/components/VisuallyHidden/VisuallyHidden.vue +5 -8
- package/src/{internal → icons}/icons.module.css +4 -2
- package/src/{internal → icons}/icons.tsx +15 -16
- package/src/internal/FieldMessage.module.css +5 -3
- package/src/internal/FieldMessage.tsx +2 -2
- package/src/internal/FieldMessage.vue +2 -2
- package/src/internal/Roll.module.css +5 -3
- package/src/internal/feel.ts +12 -10
- package/src/internal/fling.ts +3 -3
- package/src/internal/liquid.ts +12 -10
- package/src/internal/liquidMatter.ts +1 -1
- package/src/internal/liquidMore.ts +7 -7
- package/src/internal/motion/checkbox.ts +4 -4
- package/src/internal/motion/fling.ts +19 -9
- package/src/internal/motion/holdToConfirm.ts +3 -3
- package/src/internal/motion/index.ts +8 -6
- package/src/internal/motion/liquid.ts +16 -4
- package/src/internal/motion/liquidMatter.ts +8 -6
- package/src/internal/motion/liquidMore.ts +44 -25
- package/src/internal/motion/livePill.ts +1 -1
- package/src/internal/motion/numberInput.ts +2 -2
- package/src/internal/motion/pickerWheel.ts +7 -4
- package/src/internal/motion/ruler.ts +1 -1
- package/src/internal/motion/scrollArea.ts +3 -3
- package/src/internal/motion/scrollFrame.ts +9 -7
- package/src/internal/motion/scrubber.ts +39 -20
- package/src/internal/motion/slider.ts +38 -4
- package/src/internal/motion/softPress.ts +10 -9
- package/src/internal/motion/splitFlap.ts +4 -4
- package/src/internal/motion/swipeDeck.ts +38 -7
- package/src/internal/motion/table.ts +3 -6
- package/src/internal/motion/themeIcon.ts +1 -1
- package/src/internal/motion/themeReveal.ts +1 -1
- package/src/internal/motion/toast.ts +3 -3
- package/src/internal/motion.ts +7 -8
- package/src/internal/scrollFrame.ts +3 -3
- package/src/internal/useScrub.ts +1 -15
- package/src/internal/vue/useScrub.ts +2 -6
- package/src/tokens.css +81 -421
- package/src/{internal/vueIcons.ts → icons/vue.ts} +5 -5
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@layer gooee.components {
|
|
1
2
|
.root {
|
|
2
3
|
--s: var(--gooee-control-h-md);
|
|
3
4
|
position: relative;
|
|
@@ -17,8 +18,8 @@
|
|
|
17
18
|
font-weight: var(--gooee-weight-medium);
|
|
18
19
|
cursor: pointer;
|
|
19
20
|
transition:
|
|
20
|
-
background-color var(--gooee-motion-fast) var(--gooee-ease-
|
|
21
|
-
border-color var(--gooee-motion-base) var(--gooee-ease-
|
|
21
|
+
background-color var(--gooee-motion-fast) var(--gooee-ease-morph),
|
|
22
|
+
border-color var(--gooee-motion-base) var(--gooee-ease-morph);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
.root::after {
|
|
@@ -34,8 +35,8 @@
|
|
|
34
35
|
.root:hover { background: var(--gooee-color-surface-hover); }
|
|
35
36
|
}
|
|
36
37
|
.root:focus-visible { outline: none; box-shadow: var(--gooee-focus-ring); }
|
|
37
|
-
.root[data-copied] { border-color: var(--gooee-color-fg); }
|
|
38
|
-
.root[data-failed] { border-color: var(--gooee-color-danger); color: var(--gooee-color-danger); }
|
|
38
|
+
.root[data-status='copied'] { border-color: var(--gooee-color-fg); }
|
|
39
|
+
.root[data-status='failed'] { border-color: var(--gooee-color-danger); color: var(--gooee-color-danger); }
|
|
39
40
|
|
|
40
41
|
/* With a label, CopyButton.tsx sets --cap-shift so the icon sits on the middle of the capitals. */
|
|
41
42
|
.icons {
|
|
@@ -67,10 +68,10 @@
|
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
.fail,
|
|
70
|
-
.root[data-failed] .copy {
|
|
71
|
+
.root[data-status='failed'] .copy {
|
|
71
72
|
transition:
|
|
72
|
-
opacity var(--gooee-motion-fast) var(--gooee-ease-
|
|
73
|
-
transform var(--gooee-motion-slow) var(--gooee-ease-
|
|
73
|
+
opacity var(--gooee-motion-fast) var(--gooee-ease-morph),
|
|
74
|
+
transform var(--gooee-motion-slow) var(--gooee-ease-morph);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
.check {
|
|
@@ -86,11 +87,11 @@
|
|
|
86
87
|
|
|
87
88
|
.fail { opacity: 0; transform: scale(0.4); }
|
|
88
89
|
|
|
89
|
-
.root[data-copied] .copy { opacity: 0; }
|
|
90
|
-
.root[data-failed] .copy { opacity: 0; transform: scale(0.4) rotate(-45deg); }
|
|
91
|
-
.root[data-failed] .fail { opacity: 1; transform: none; }
|
|
90
|
+
.root[data-status='copied'] .copy { opacity: 0; }
|
|
91
|
+
.root[data-status='failed'] .copy { opacity: 0; transform: scale(0.4) rotate(-45deg); }
|
|
92
|
+
.root[data-status='failed'] .fail { opacity: 1; transform: none; }
|
|
92
93
|
|
|
93
|
-
.root[data-copied] .check { stroke-dashoffset: 0; }
|
|
94
|
+
.root[data-status='copied'] .check { stroke-dashoffset: 0; }
|
|
94
95
|
|
|
95
96
|
.labels {
|
|
96
97
|
display: grid;
|
|
@@ -102,18 +103,18 @@
|
|
|
102
103
|
.labelFailed {
|
|
103
104
|
grid-area: 1 / 1;
|
|
104
105
|
transition:
|
|
105
|
-
transform var(--gooee-motion-slow) var(--gooee-ease-
|
|
106
|
-
opacity var(--gooee-motion-base) var(--gooee-ease-
|
|
106
|
+
transform var(--gooee-motion-slow) var(--gooee-ease-morph),
|
|
107
|
+
opacity var(--gooee-motion-base) var(--gooee-ease-morph);
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
.labelDone { transform: translateY(100%); opacity: 0; }
|
|
110
111
|
/* Out of the layout until a copy fails, so the longer words do not widen every button. */
|
|
111
112
|
.labelFailed { display: none; }
|
|
112
|
-
.root[data-failed] .labelFailed { display: block; }
|
|
113
|
-
.root[data-copied] .labelIdle,
|
|
114
|
-
.root[data-failed] .labelIdle { transform: translateY(-100%); opacity: 0; }
|
|
115
|
-
.root[data-copied] .labelDone,
|
|
116
|
-
.root[data-failed] .labelFailed { transform: none; opacity: 1; }
|
|
113
|
+
.root[data-status='failed'] .labelFailed { display: block; }
|
|
114
|
+
.root[data-status='copied'] .labelIdle,
|
|
115
|
+
.root[data-status='failed'] .labelIdle { transform: translateY(-100%); opacity: 0; }
|
|
116
|
+
.root[data-status='copied'] .labelDone,
|
|
117
|
+
.root[data-status='failed'] .labelFailed { transform: none; opacity: 1; }
|
|
117
118
|
|
|
118
119
|
.srOnly {
|
|
119
120
|
position: absolute;
|
|
@@ -123,3 +124,4 @@
|
|
|
123
124
|
clip-path: inset(50%);
|
|
124
125
|
white-space: nowrap;
|
|
125
126
|
}
|
|
127
|
+
}
|
|
@@ -2,20 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
import { useEffect, useLayoutEffect, useRef, useState } from 'react'
|
|
4
4
|
import { cx } from '../../internal/cx'
|
|
5
|
-
import { CopyIcon, XIcon } from '../../
|
|
5
|
+
import { CopyIcon, XIcon } from '../../icons/icons'
|
|
6
6
|
import { copyRun, type CopyRun } from '../../internal/liquidMore'
|
|
7
7
|
import { capShift, writeText } from '../../internal/motion/copyButton'
|
|
8
8
|
import styles from './CopyButton.module.css'
|
|
9
9
|
|
|
10
|
+
export type CopyButtonLabels = {
|
|
11
|
+
/** Shown and spoken after a successful copy. */
|
|
12
|
+
copied: string
|
|
13
|
+
/** Shown and spoken when the browser blocks the copy. */
|
|
14
|
+
failed: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const defaultLabels: CopyButtonLabels = { copied: 'Copied', failed: 'Could not copy' }
|
|
18
|
+
|
|
10
19
|
export type CopyButtonProps = {
|
|
11
20
|
/** Text to put on the clipboard. */
|
|
12
21
|
value: string
|
|
13
22
|
/** Accessible name, and the visible text when showLabel is on. */
|
|
14
23
|
label?: string
|
|
15
|
-
/** Shown and spoken after a successful copy. */
|
|
16
|
-
copiedLabel?: string
|
|
17
|
-
/** Shown and spoken when the browser blocks the copy. */
|
|
18
|
-
failedLabel?: string
|
|
19
24
|
/** Shows the label as text next to the icon. */
|
|
20
25
|
showLabel?: boolean
|
|
21
26
|
/** Size of the button. */
|
|
@@ -24,6 +29,8 @@ export type CopyButtonProps = {
|
|
|
24
29
|
resetAfter?: number
|
|
25
30
|
/** Called after the text is copied, with the copied text. Not called if copying fails. */
|
|
26
31
|
onCopy?: (value: string) => void
|
|
32
|
+
/** Status text, so you can translate it. Missing keys use the English defaults. */
|
|
33
|
+
labels?: Partial<CopyButtonLabels>
|
|
27
34
|
/** Extra class for the button. */
|
|
28
35
|
className?: string
|
|
29
36
|
}
|
|
@@ -31,14 +38,14 @@ export type CopyButtonProps = {
|
|
|
31
38
|
export function CopyButton({
|
|
32
39
|
value,
|
|
33
40
|
label = 'Copy',
|
|
34
|
-
copiedLabel = 'Copied',
|
|
35
|
-
failedLabel = 'Could not copy',
|
|
36
41
|
showLabel = false,
|
|
37
42
|
size = 'md',
|
|
38
43
|
resetAfter = 1800,
|
|
39
44
|
onCopy,
|
|
45
|
+
labels: labelsProp,
|
|
40
46
|
className,
|
|
41
47
|
}: CopyButtonProps) {
|
|
48
|
+
const labels = { ...defaultLabels, ...labelsProp }
|
|
42
49
|
const [status, setStatus] = useState<'idle' | 'copied' | 'failed'>('idle')
|
|
43
50
|
const timer = useRef<number | undefined>(undefined)
|
|
44
51
|
useEffect(() => () => window.clearTimeout(timer.current), [])
|
|
@@ -83,9 +90,9 @@ export function CopyButton({
|
|
|
83
90
|
<button
|
|
84
91
|
ref={rootRef}
|
|
85
92
|
type="button"
|
|
93
|
+
data-slot="copy-button"
|
|
86
94
|
className={cx(styles.root, styles[size], showLabel && styles.withLabel, className)}
|
|
87
|
-
data-
|
|
88
|
-
data-failed={status === 'failed' || undefined}
|
|
95
|
+
data-status={status}
|
|
89
96
|
aria-label={showLabel ? undefined : label}
|
|
90
97
|
onClick={(e) => {
|
|
91
98
|
const r = iconsRef.current?.getBoundingClientRect()
|
|
@@ -94,7 +101,7 @@ export function CopyButton({
|
|
|
94
101
|
copy()
|
|
95
102
|
}}
|
|
96
103
|
>
|
|
97
|
-
<span ref={iconsRef} className={styles.icons} aria-hidden="true">
|
|
104
|
+
<span ref={iconsRef} data-slot="copy-button-icon" className={styles.icons} aria-hidden="true">
|
|
98
105
|
<CopyIcon className={styles.copy} />
|
|
99
106
|
<svg viewBox="0 0 24 24" className={styles.check}>
|
|
100
107
|
<path d="M5 12.5l4.5 4.5L19 7.5" pathLength="1" />
|
|
@@ -102,13 +109,13 @@ export function CopyButton({
|
|
|
102
109
|
<XIcon className={styles.fail} />
|
|
103
110
|
</span>
|
|
104
111
|
{showLabel && (
|
|
105
|
-
<span className={styles.labels}>
|
|
112
|
+
<span data-slot="copy-button-label" className={styles.labels}>
|
|
106
113
|
<span ref={labelRef} className={styles.labelIdle}>{label}</span>
|
|
107
|
-
<span className={styles.labelDone} aria-hidden="true">{
|
|
108
|
-
<span className={styles.labelFailed} aria-hidden="true">{
|
|
114
|
+
<span className={styles.labelDone} aria-hidden="true">{labels.copied}</span>
|
|
115
|
+
<span className={styles.labelFailed} aria-hidden="true">{labels.failed}</span>
|
|
109
116
|
</span>
|
|
110
117
|
)}
|
|
111
|
-
<span className={styles.srOnly} aria-live="polite">{status === 'copied' ?
|
|
118
|
+
<span className={styles.srOnly} aria-live="polite">{status === 'copied' ? labels.copied : status === 'failed' ? labels.failed : ''}</span>
|
|
112
119
|
</button>
|
|
113
120
|
)
|
|
114
121
|
}
|
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, onBeforeUnmount, ref, watch } from 'vue'
|
|
3
|
-
import { CopyIcon, XIcon } from '../../
|
|
3
|
+
import { CopyIcon, XIcon } from '../../icons/vue'
|
|
4
4
|
import { copyRun, type CopyRun } from '../../internal/motion/liquidMore'
|
|
5
5
|
import { capShift, writeText } from '../../internal/motion/copyButton'
|
|
6
6
|
import styles from './CopyButton.module.css'
|
|
7
7
|
|
|
8
|
+
export type CopyButtonLabels = {
|
|
9
|
+
/** Shown and spoken after a successful copy. */
|
|
10
|
+
copied: string
|
|
11
|
+
/** Shown and spoken when the browser blocks the copy. */
|
|
12
|
+
failed: string
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
// The Vue CopyButton: the same look (CopyButton.module.css), drop and check as the React one.
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
const {
|
|
17
|
+
value,
|
|
18
|
+
label = 'Copy',
|
|
19
|
+
showLabel = false,
|
|
20
|
+
size = 'md',
|
|
21
|
+
resetAfter = 1800,
|
|
22
|
+
labels,
|
|
23
|
+
} = defineProps<{
|
|
24
|
+
/** Text to put on the clipboard. */
|
|
25
|
+
value: string
|
|
26
|
+
/** Accessible name, and the visible text when showLabel is on. */
|
|
27
|
+
label?: string
|
|
28
|
+
/** Shows the label as text next to the icon. */
|
|
29
|
+
showLabel?: boolean
|
|
30
|
+
/** Size of the button. */
|
|
31
|
+
size?: 'sm' | 'md'
|
|
32
|
+
/** How long the check or the failed state stays, in ms. */
|
|
33
|
+
resetAfter?: number
|
|
34
|
+
/** Status text, so you can translate it. Missing keys use the English defaults. */
|
|
35
|
+
labels?: Partial<CopyButtonLabels>
|
|
36
|
+
}>()
|
|
37
|
+
const text = computed(() => ({ copied: 'Copied', failed: 'Could not copy', ...labels }))
|
|
28
38
|
/** Fires after the text is copied, with the copied text. Not fired if copying fails. */
|
|
29
39
|
const emit = defineEmits<{ copy: [value: string] }>()
|
|
30
40
|
|
|
@@ -59,7 +69,7 @@ watch(
|
|
|
59
69
|
// With a label, the icon sits on the middle of the label's capital letters (motion/copyButton.ts).
|
|
60
70
|
let unplace = () => {}
|
|
61
71
|
watch(
|
|
62
|
-
[() =>
|
|
72
|
+
[() => showLabel, () => label, () => size, labelEl],
|
|
63
73
|
() => {
|
|
64
74
|
unplace()
|
|
65
75
|
unplace = capShift(rootEl.value, iconsEl.value, labelEl.value?.firstChild)
|
|
@@ -74,11 +84,11 @@ onBeforeUnmount(() => {
|
|
|
74
84
|
})
|
|
75
85
|
|
|
76
86
|
const copy = async () => {
|
|
77
|
-
const ok = await writeText(
|
|
87
|
+
const ok = await writeText(value)
|
|
78
88
|
status.value = ok ? 'copied' : 'failed'
|
|
79
|
-
if (ok) emit('copy',
|
|
89
|
+
if (ok) emit('copy', value)
|
|
80
90
|
window.clearTimeout(timer)
|
|
81
|
-
timer = window.setTimeout(() => (status.value = 'idle'),
|
|
91
|
+
timer = window.setTimeout(() => (status.value = 'idle'), resetAfter)
|
|
82
92
|
}
|
|
83
93
|
|
|
84
94
|
const onClick = (e: MouseEvent) => {
|
|
@@ -93,24 +103,24 @@ const onClick = (e: MouseEvent) => {
|
|
|
93
103
|
<button
|
|
94
104
|
ref="rootEl"
|
|
95
105
|
type="button"
|
|
106
|
+
data-slot="copy-button"
|
|
96
107
|
:class="[styles.root, styles[size], showLabel && styles.withLabel]"
|
|
97
|
-
:data-
|
|
98
|
-
:data-failed="status === 'failed' || undefined"
|
|
108
|
+
:data-status="status"
|
|
99
109
|
:aria-label="showLabel ? undefined : label"
|
|
100
110
|
@click="onClick"
|
|
101
111
|
>
|
|
102
|
-
<span ref="iconsEl" :class="styles.icons" aria-hidden="true">
|
|
112
|
+
<span ref="iconsEl" data-slot="copy-button-icon" :class="styles.icons" aria-hidden="true">
|
|
103
113
|
<CopyIcon :class="styles.copy" />
|
|
104
114
|
<svg viewBox="0 0 24 24" :class="styles.check">
|
|
105
115
|
<path d="M5 12.5l4.5 4.5L19 7.5" pathLength="1" />
|
|
106
116
|
</svg>
|
|
107
117
|
<XIcon :class="styles.fail" />
|
|
108
118
|
</span>
|
|
109
|
-
<span v-if="showLabel" :class="styles.labels">
|
|
119
|
+
<span v-if="showLabel" data-slot="copy-button-label" :class="styles.labels">
|
|
110
120
|
<span ref="labelEl" :class="styles.labelIdle">{{ label }}</span>
|
|
111
|
-
<span :class="styles.labelDone" aria-hidden="true">{{
|
|
112
|
-
<span :class="styles.labelFailed" aria-hidden="true">{{
|
|
121
|
+
<span :class="styles.labelDone" aria-hidden="true">{{ text.copied }}</span>
|
|
122
|
+
<span :class="styles.labelFailed" aria-hidden="true">{{ text.failed }}</span>
|
|
113
123
|
</span>
|
|
114
|
-
<span :class="styles.srOnly" aria-live="polite">{{ status === 'copied' ?
|
|
124
|
+
<span :class="styles.srOnly" aria-live="polite">{{ status === 'copied' ? text.copied : status === 'failed' ? text.failed : '' }}</span>
|
|
115
125
|
</button>
|
|
116
126
|
</template>
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/* The script reads these tokens, so each is registered with its default: set it on :root to change it. */
|
|
2
|
+
@property --gooee-dial-arc-radius {
|
|
3
|
+
syntax: '<length>';
|
|
4
|
+
inherits: true;
|
|
5
|
+
initial-value: 620px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@property --gooee-dial-arc-gap {
|
|
9
|
+
syntax: '<length>';
|
|
10
|
+
inherits: true;
|
|
11
|
+
initial-value: 20px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@layer gooee.components {
|
|
1
15
|
.root {
|
|
2
16
|
display: grid;
|
|
3
17
|
justify-items: center;
|
|
@@ -52,15 +66,15 @@
|
|
|
52
66
|
/* Printed knob */
|
|
53
67
|
|
|
54
68
|
.printed {
|
|
55
|
-
--num-r: calc(var(--gooee-dial-size) * -0.29);
|
|
69
|
+
--num-r: calc(var(--gooee-dial-size, 208px) * -0.29);
|
|
56
70
|
}
|
|
57
71
|
|
|
58
72
|
.bezel {
|
|
59
73
|
position: relative;
|
|
60
74
|
display: grid;
|
|
61
75
|
place-items: center;
|
|
62
|
-
width: var(--gooee-dial-ring);
|
|
63
|
-
height: var(--gooee-dial-ring);
|
|
76
|
+
width: var(--gooee-dial-ring, 244px);
|
|
77
|
+
height: var(--gooee-dial-ring, 244px);
|
|
64
78
|
border-radius: var(--gooee-radius-full);
|
|
65
79
|
border: var(--gooee-line) solid var(--gooee-color-border);
|
|
66
80
|
}
|
|
@@ -77,8 +91,8 @@
|
|
|
77
91
|
}
|
|
78
92
|
|
|
79
93
|
.knob {
|
|
80
|
-
width: var(--gooee-dial-size);
|
|
81
|
-
height: var(--gooee-dial-size);
|
|
94
|
+
width: var(--gooee-dial-size, 208px);
|
|
95
|
+
height: var(--gooee-dial-size, 208px);
|
|
82
96
|
border-radius: var(--gooee-radius-full);
|
|
83
97
|
background: var(--gooee-color-surface-raised);
|
|
84
98
|
box-shadow: var(--gooee-shadow-2), inset 0 0 0 var(--gooee-line) var(--gooee-color-border);
|
|
@@ -112,7 +126,7 @@
|
|
|
112
126
|
.tick {
|
|
113
127
|
position: absolute;
|
|
114
128
|
left: calc(var(--gooee-indicator) / -2);
|
|
115
|
-
top: calc(var(--gooee-dial-size) / -2 + var(--gooee-space-3));
|
|
129
|
+
top: calc(var(--gooee-dial-size, 208px) / -2 + var(--gooee-space-3));
|
|
116
130
|
width: var(--gooee-indicator);
|
|
117
131
|
height: var(--gooee-space-3);
|
|
118
132
|
border-radius: var(--gooee-radius-full);
|
|
@@ -194,7 +208,7 @@
|
|
|
194
208
|
}
|
|
195
209
|
|
|
196
210
|
.mercuryHit {
|
|
197
|
-
width: min(100%, calc(var(--gooee-dial-ring) + var(--gooee-space-9)));
|
|
211
|
+
width: min(100%, calc(var(--gooee-dial-ring, 244px) + var(--gooee-space-9)));
|
|
198
212
|
border-radius: var(--gooee-radius-panel);
|
|
199
213
|
touch-action: none;
|
|
200
214
|
}
|
|
@@ -224,7 +238,7 @@
|
|
|
224
238
|
fill: var(--gooee-color-border-strong);
|
|
225
239
|
}
|
|
226
240
|
|
|
227
|
-
.dot[data-
|
|
241
|
+
.dot[data-selected] {
|
|
228
242
|
fill: var(--gooee-color-accent);
|
|
229
243
|
}
|
|
230
244
|
|
|
@@ -234,7 +248,7 @@
|
|
|
234
248
|
fill: var(--gooee-color-fg-muted);
|
|
235
249
|
}
|
|
236
250
|
|
|
237
|
-
.level[data-
|
|
251
|
+
.level[data-selected] {
|
|
238
252
|
fill: var(--gooee-color-accent);
|
|
239
253
|
font-weight: var(--gooee-weight-semibold);
|
|
240
254
|
}
|
|
@@ -246,9 +260,9 @@
|
|
|
246
260
|
}
|
|
247
261
|
|
|
248
262
|
.arcStage {
|
|
249
|
-
--rim: calc(var(--gooee-ruler-h) / 2);
|
|
263
|
+
--rim: calc(var(--gooee-ruler-scrubber-h, 120px) / 2);
|
|
250
264
|
width: 100%;
|
|
251
|
-
height: var(--gooee-ruler-h);
|
|
265
|
+
height: var(--gooee-ruler-scrubber-h, 120px);
|
|
252
266
|
border-radius: var(--gooee-radius-md);
|
|
253
267
|
/* A sideways swipe turns it; up and down still scrolls the page. Dial.tsx takes a touch that follows
|
|
254
268
|
the curve, so the page does not scroll under a turn. */
|
|
@@ -343,3 +357,4 @@
|
|
|
343
357
|
border-radius: var(--gooee-radius-full);
|
|
344
358
|
background: var(--gooee-color-fg);
|
|
345
359
|
}
|
|
360
|
+
}
|
|
@@ -6,7 +6,7 @@ import { clamp, pull, roundTo, wheelSteps } from '../../internal/feel'
|
|
|
6
6
|
import { arcTouch, CX, CY, DOT, dialScale, dialScrub, H, KNOB, polar, SWEEP, W, type Rim } from '../../internal/motion/dial'
|
|
7
7
|
import { Roll } from '../../internal/Roll'
|
|
8
8
|
import { useControllable } from '../../internal/useControllable'
|
|
9
|
-
import { ink, tokenNumber,
|
|
9
|
+
import { ink, tokenNumber, useScrub } from '../../internal/useScrub'
|
|
10
10
|
import styles from './Dial.module.css'
|
|
11
11
|
|
|
12
12
|
export type DialProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'onChange' | 'children'> & {
|
|
@@ -16,10 +16,10 @@ export type DialProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'onC
|
|
|
16
16
|
value?: number
|
|
17
17
|
/** Starting value when you do not control it. Undefined starts at min. */
|
|
18
18
|
defaultValue?: number
|
|
19
|
-
/** Called
|
|
19
|
+
/** Called with each new value under the index, while the dial still turns. */
|
|
20
20
|
onValueChange?: (value: number) => void
|
|
21
|
-
/** Called
|
|
22
|
-
|
|
21
|
+
/** Called once the dial comes to rest on a new value. */
|
|
22
|
+
onValueCommit?: (value: number) => void
|
|
23
23
|
/** Lowest value. */
|
|
24
24
|
min?: number
|
|
25
25
|
/** Highest value. */
|
|
@@ -49,7 +49,7 @@ export function Dial({
|
|
|
49
49
|
value: valueProp,
|
|
50
50
|
defaultValue,
|
|
51
51
|
onValueChange,
|
|
52
|
-
|
|
52
|
+
onValueCommit,
|
|
53
53
|
min = 0,
|
|
54
54
|
max = 100,
|
|
55
55
|
step = 1,
|
|
@@ -78,7 +78,7 @@ export function Dial({
|
|
|
78
78
|
const wheel = useRef(wheelSteps())
|
|
79
79
|
|
|
80
80
|
// The drag, keys, tap and wheel (motion/dial.ts) on the shared scrubber.
|
|
81
|
-
const sc = useScrub({ value, ...dialScrub(scale, rim, wheel.current),
|
|
81
|
+
const sc = useScrub({ value, ...dialScrub(scale, rim, wheel.current), onMark: setValue, onSettle: (v) => onValueCommit?.(v), haptics })
|
|
82
82
|
|
|
83
83
|
useLayoutEffect(() => {
|
|
84
84
|
if (variant !== 'arc') return
|
|
@@ -94,7 +94,6 @@ export function Dial({
|
|
|
94
94
|
}, [variant, sc.ref])
|
|
95
95
|
|
|
96
96
|
const shown = land(sc.at)
|
|
97
|
-
useOnChange(shown, onScrub)
|
|
98
97
|
|
|
99
98
|
const index = all.indexOf(value)
|
|
100
99
|
const slider = {
|
|
@@ -107,6 +106,7 @@ export function Dial({
|
|
|
107
106
|
'aria-valuemax': top,
|
|
108
107
|
'aria-valuenow': value,
|
|
109
108
|
'aria-valuetext': variant === 'mercury' && index >= 0 ? `${formatValue(value)}, ${index + 1} of ${all.length}` : formatValue(value),
|
|
109
|
+
'data-slot': 'dial-control',
|
|
110
110
|
'data-moving': sc.moving || undefined,
|
|
111
111
|
onDoubleClick: resetValue === undefined ? undefined : () => sc.go(land(resetValue)),
|
|
112
112
|
...sc.handlers,
|
|
@@ -114,12 +114,12 @@ export function Dial({
|
|
|
114
114
|
|
|
115
115
|
const head = (
|
|
116
116
|
<div className={styles.head}>
|
|
117
|
-
<span id={labelId} className={styles.label}>
|
|
117
|
+
<span id={labelId} data-slot="dial-label" className={styles.label}>
|
|
118
118
|
{label}
|
|
119
119
|
</span>
|
|
120
120
|
<Roll text={formatValue(shown)} className={styles.readout} still={sc.moving} />
|
|
121
121
|
{detail && (
|
|
122
|
-
<span id={detailId} className={styles.detail}>
|
|
122
|
+
<span id={detailId} data-slot="dial-detail" className={styles.detail}>
|
|
123
123
|
{detail}
|
|
124
124
|
</span>
|
|
125
125
|
)}
|
|
@@ -130,7 +130,7 @@ export function Dial({
|
|
|
130
130
|
const angle = -135 + ((sc.at - min) / step) * stepDeg
|
|
131
131
|
const [bx, by] = polar(angle, KNOB)
|
|
132
132
|
return (
|
|
133
|
-
<div className={cx(styles.root, styles.mercury, className)} {...rest}>
|
|
133
|
+
<div data-slot="dial" className={cx(styles.root, styles.mercury, className)} {...rest}>
|
|
134
134
|
{head}
|
|
135
135
|
<div className={styles.mercuryHit} {...slider}>
|
|
136
136
|
<svg viewBox={`0 0 ${W} ${H}`} className={styles.mercurySvg} aria-hidden>
|
|
@@ -148,8 +148,8 @@ export function Dial({
|
|
|
148
148
|
const on = v === shown
|
|
149
149
|
return (
|
|
150
150
|
<g key={v}>
|
|
151
|
-
<circle cx={x} cy={y} r={3.5} className={styles.dot} data-
|
|
152
|
-
<text x={lx} y={ly} textAnchor={Math.abs(a) < 1 ? 'middle' : a < 0 ? 'end' : 'start'} dominantBaseline="middle" className={styles.level} data-
|
|
151
|
+
<circle cx={x} cy={y} r={3.5} data-slot="dial-tick" className={styles.dot} data-selected={on || undefined} />
|
|
152
|
+
<text x={lx} y={ly} textAnchor={Math.abs(a) < 1 ? 'middle' : a < 0 ? 'end' : 'start'} dominantBaseline="middle" data-slot="dial-mark" className={styles.level} data-selected={on || undefined}>
|
|
153
153
|
{markText(v)}
|
|
154
154
|
</text>
|
|
155
155
|
</g>
|
|
@@ -174,7 +174,7 @@ export function Dial({
|
|
|
174
174
|
if (variant === 'arc') {
|
|
175
175
|
const degPerStep = rim && rim.r ? (rim.gap / rim.r) * (180 / Math.PI) : 0
|
|
176
176
|
return (
|
|
177
|
-
<div className={cx(styles.root, styles.arc, className)} {...rest}>
|
|
177
|
+
<div data-slot="dial" className={cx(styles.root, styles.arc, className)} {...rest}>
|
|
178
178
|
{head}
|
|
179
179
|
<div className={styles.arcStage} {...slider}>
|
|
180
180
|
<span className={styles.arcIndex} aria-hidden />
|
|
@@ -189,9 +189,9 @@ export function Dial({
|
|
|
189
189
|
const tier = labelled.includes(v) ? 'major' : i % 2 === 0 ? 'mid' : 'minor'
|
|
190
190
|
return (
|
|
191
191
|
<span key={v} className={styles.arcMark} style={{ transform: `rotate(${a}deg) translateY(calc(var(--gooee-dial-arc-radius) * -1))` }}>
|
|
192
|
-
<i className={styles.arcTick} data-tier={tier} style={{ background: ink(p, 'var(--gooee-color-border-strong)', 'var(--gooee-color-accent)'), transform: `scaleY(${1 + p * 0.7})` }} />
|
|
192
|
+
<i data-slot="dial-tick" className={styles.arcTick} data-tier={tier} style={{ background: ink(p, 'var(--gooee-color-border-strong)', 'var(--gooee-color-accent)'), transform: `scaleY(${1 + p * 0.7})` }} />
|
|
193
193
|
{tier === 'major' && (
|
|
194
|
-
<span className={styles.arcNum} style={{ color: ink(p), transform: `translateX(-50%) scale(${1 + p * 0.3})` }}>
|
|
194
|
+
<span data-slot="dial-mark" className={styles.arcNum} style={{ color: ink(p), transform: `translateX(-50%) scale(${1 + p * 0.3})` }}>
|
|
195
195
|
{markText(v)}
|
|
196
196
|
</span>
|
|
197
197
|
)}
|
|
@@ -216,7 +216,7 @@ export function Dial({
|
|
|
216
216
|
const dense = all.length > 49
|
|
217
217
|
const ticks = all.length <= 121 ? all : all.filter((v) => isMajor(v) || strongSet.has(v))
|
|
218
218
|
return (
|
|
219
|
-
<div className={cx(styles.root, styles.printed, className)} {...rest}>
|
|
219
|
+
<div data-slot="dial" className={cx(styles.root, styles.printed, className)} {...rest}>
|
|
220
220
|
{head}
|
|
221
221
|
<div className={styles.bezel}>
|
|
222
222
|
<span className={styles.index} aria-hidden />
|
|
@@ -233,10 +233,10 @@ export function Dial({
|
|
|
233
233
|
const major = isMajor(v)
|
|
234
234
|
return (
|
|
235
235
|
<span key={v} className={styles.spoke} style={{ transform: `rotate(${at}deg)` }}>
|
|
236
|
-
<i className={styles.tick} data-major={major || undefined} data-fine={(dense && !major) || undefined} data-strong={strongSet.has(v) || undefined} data-
|
|
236
|
+
<i data-slot="dial-tick" className={styles.tick} data-major={major || undefined} data-fine={(dense && !major) || undefined} data-strong={strongSet.has(v) || undefined} data-selected={v === shown || undefined} style={{ background: ink(p, 'var(--gooee-color-border-strong)', 'var(--gooee-color-accent)'), transform: `scaleY(${1 + p * 0.5})` }} />
|
|
237
237
|
{printed.includes(v) && (
|
|
238
238
|
<span className={styles.numAt} style={{ transform: `translateY(var(--num-r)) rotate(${-(at + turned)}deg)` }}>
|
|
239
|
-
<span className={styles.num} style={{ color: ink(p), transform: `translate(-50%, -50%) scale(${1 + p * 0.45})`, fontWeight: `calc(var(--gooee-weight-medium) + (var(--gooee-weight-semibold) - var(--gooee-weight-medium)) * ${p.toFixed(3)})` }}>
|
|
239
|
+
<span data-slot="dial-mark" className={styles.num} style={{ color: ink(p), transform: `translate(-50%, -50%) scale(${1 + p * 0.45})`, fontWeight: `calc(var(--gooee-weight-medium) + (var(--gooee-weight-semibold) - var(--gooee-weight-medium)) * ${p.toFixed(3)})` }}>
|
|
240
240
|
{markText(v)}
|
|
241
241
|
</span>
|
|
242
242
|
</span>
|