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.
- 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
|
@@ -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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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(() =>
|
|
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-
|
|
80
|
-
box-shadow var(--gooee-motion-fast) var(--gooee-ease-
|
|
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-
|
|
93
|
-
box-shadow var(--gooee-motion-fast) var(--gooee-ease-
|
|
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-
|
|
122
|
-
transform var(--gooee-motion-base) var(--gooee-ease-
|
|
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-
|
|
151
|
+
transition: opacity var(--gooee-motion-fast) var(--gooee-ease-morph);
|
|
151
152
|
}
|
|
152
153
|
|
|
153
|
-
.mark[data-
|
|
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
|
|
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,6 +51,7 @@ export function Slider({
|
|
|
48
51
|
onPointerUp,
|
|
49
52
|
onPointerCancel,
|
|
50
53
|
onKeyDown,
|
|
54
|
+
onKeyUp,
|
|
51
55
|
onBlur,
|
|
52
56
|
...rest
|
|
53
57
|
}: SliderProps) {
|
|
@@ -60,6 +64,8 @@ export function Slider({
|
|
|
60
64
|
latest.current = { value, min, max, step, marks }
|
|
61
65
|
const set = useRef(setValue)
|
|
62
66
|
set.current = setValue
|
|
67
|
+
const commit = useRef(onValueCommit)
|
|
68
|
+
commit.current = onValueCommit
|
|
63
69
|
// The glide, the grab and the landing on marks (motion/slider.ts).
|
|
64
70
|
const slider = useRef<ReturnType<typeof createSlider>>(null)
|
|
65
71
|
slider.current ??= createSlider(
|
|
@@ -69,6 +75,7 @@ export function Slider({
|
|
|
69
75
|
set.current(v)
|
|
70
76
|
},
|
|
71
77
|
setShown,
|
|
78
|
+
(v) => commit.current?.(v),
|
|
72
79
|
)
|
|
73
80
|
const at = shown ?? value
|
|
74
81
|
const pct = max === min ? 0 : ((at - min) / (max - min)) * 100
|
|
@@ -77,16 +84,17 @@ export function Slider({
|
|
|
77
84
|
useEffect(() => () => slider.current!.destroy(), [])
|
|
78
85
|
|
|
79
86
|
return (
|
|
80
|
-
<div className={cx(styles.root, className)} data-disabled={disabled || undefined}>
|
|
87
|
+
<div className={cx(styles.root, className)} data-slot="slider" data-orientation="horizontal" data-disabled={disabled || undefined}>
|
|
81
88
|
<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>}
|
|
89
|
+
<label htmlFor={inputId} className={styles.label} data-slot="field-label">{label}</label>
|
|
90
|
+
{showValue && <output htmlFor={inputId} className={styles.value} data-slot="slider-value" aria-hidden="true">{text}</output>}
|
|
84
91
|
</div>
|
|
85
|
-
<div className={styles.trackWrap} data-gliding={shown !== null || undefined} style={{ ['--pct' as string]: `${pct}%`, ['--p' as string]: pct / 100 }}>
|
|
92
|
+
<div className={styles.trackWrap} data-slot="slider-control" data-gliding={shown !== null || undefined} style={{ ['--pct' as string]: `${pct}%`, ['--p' as string]: pct / 100 }}>
|
|
86
93
|
<input
|
|
87
94
|
id={inputId}
|
|
88
95
|
type="range"
|
|
89
96
|
className={styles.input}
|
|
97
|
+
data-slot="slider-input"
|
|
90
98
|
min={min}
|
|
91
99
|
max={max}
|
|
92
100
|
step={shown === null ? step : 'any'}
|
|
@@ -118,20 +126,23 @@ export function Slider({
|
|
|
118
126
|
onBlur?.(e)
|
|
119
127
|
}}
|
|
120
128
|
onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => {
|
|
121
|
-
slider.current!.end()
|
|
122
129
|
onKeyDown?.(e)
|
|
123
130
|
if (!e.defaultPrevented && slider.current!.key(e.key)) e.preventDefault()
|
|
124
131
|
}}
|
|
132
|
+
onKeyUp={(e: KeyboardEvent<HTMLInputElement>) => {
|
|
133
|
+
slider.current!.keyUp()
|
|
134
|
+
onKeyUp?.(e)
|
|
135
|
+
}}
|
|
125
136
|
{...rest}
|
|
126
137
|
/>
|
|
127
138
|
{showValue && (
|
|
128
|
-
<span className={styles.bubble} aria-hidden="true">{text}</span>
|
|
139
|
+
<span className={styles.bubble} data-slot="slider-bubble" aria-hidden="true">{text}</span>
|
|
129
140
|
)}
|
|
130
141
|
{/* After the bubble, which CSS shows from the input just before it. */}
|
|
131
142
|
{marks?.length ? (
|
|
132
|
-
<span className={styles.marks} aria-hidden="true">
|
|
143
|
+
<span className={styles.marks} data-slot="slider-marks" aria-hidden="true">
|
|
133
144
|
{marks.map((m) => (
|
|
134
|
-
<span key={m} className={styles.mark} data-
|
|
145
|
+
<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
146
|
))}
|
|
136
147
|
</span>
|
|
137
148
|
) : 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
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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(
|
|
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(() =>
|
|
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(() => (
|
|
56
|
-
const text = computed(() =>
|
|
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
|
|
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-
|
|
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>
|
|
@@ -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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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>
|
|
@@ -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
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
}
|