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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useRef, useState, type ReactNode } from 'react'
|
|
4
4
|
import { cx } from '../../internal/cx'
|
|
5
|
-
import { CheckIcon, XIcon } from '../../
|
|
5
|
+
import { CheckIcon, XIcon } from '../../icons/icons'
|
|
6
6
|
import { collapseOut, focusPast } from '../../internal/motion/collapseOut'
|
|
7
7
|
import styles from './Tag.module.css'
|
|
8
8
|
|
|
@@ -23,12 +23,10 @@ export type TagProps = {
|
|
|
23
23
|
children: ReactNode
|
|
24
24
|
/** Shows a remove button. Called after the exit animation ends. */
|
|
25
25
|
onRemove?: () => void
|
|
26
|
-
/** Label for the remove button. Wins over labels.remove, which defaults to "Remove <text>". */
|
|
27
|
-
removeLabel?: string
|
|
28
26
|
/** Makes the tag a toggle chip (aria-pressed). */
|
|
29
|
-
|
|
30
|
-
/** Called when a toggle chip is pressed, with the new
|
|
31
|
-
|
|
27
|
+
pressed?: boolean
|
|
28
|
+
/** Called when a toggle chip is pressed, with the new pressed state. */
|
|
29
|
+
onPressedChange?: (pressed: boolean) => void
|
|
32
30
|
/** Icon before the text. Not shown on toggle chips, which show a check. */
|
|
33
31
|
icon?: ReactNode
|
|
34
32
|
/** Screen reader text, so you can translate it. Missing keys use the English defaults. */
|
|
@@ -37,11 +35,11 @@ export type TagProps = {
|
|
|
37
35
|
className?: string
|
|
38
36
|
}
|
|
39
37
|
|
|
40
|
-
export function Tag({ children, onRemove,
|
|
38
|
+
export function Tag({ children, onRemove, pressed, onPressedChange, icon, labels: labelsProp, className }: TagProps) {
|
|
41
39
|
const labels = { ...defaultLabels, ...labelsProp }
|
|
42
40
|
const ref = useRef<HTMLSpanElement>(null)
|
|
43
41
|
const [leaving, setLeaving] = useState(false)
|
|
44
|
-
const selectable =
|
|
42
|
+
const selectable = pressed !== undefined
|
|
45
43
|
|
|
46
44
|
// Collapse first so neighbours slide in (motion/collapseOut.ts), then tell the parent
|
|
47
45
|
const remove = () => {
|
|
@@ -58,29 +56,29 @@ export function Tag({ children, onRemove, removeLabel, selected, onSelectedChang
|
|
|
58
56
|
const content = (
|
|
59
57
|
<>
|
|
60
58
|
{selectable ? (
|
|
61
|
-
<span className={styles.check} data-
|
|
59
|
+
<span className={styles.check} data-slot="tag-indicator" aria-hidden="true">
|
|
62
60
|
<CheckIcon />
|
|
63
61
|
</span>
|
|
64
62
|
) : (
|
|
65
|
-
icon && <span className={styles.icon}>{icon}</span>
|
|
63
|
+
icon && <span className={styles.icon} data-slot="tag-icon">{icon}</span>
|
|
66
64
|
)}
|
|
67
|
-
<span className={styles.text} title={typeof children === 'string' || typeof children === 'number' ? String(children) : undefined}>
|
|
65
|
+
<span className={styles.text} data-slot="tag-label" title={typeof children === 'string' || typeof children === 'number' ? String(children) : undefined}>
|
|
68
66
|
{children}
|
|
69
67
|
</span>
|
|
70
68
|
</>
|
|
71
69
|
)
|
|
72
70
|
|
|
73
71
|
return (
|
|
74
|
-
<span ref={ref} className={cx(styles.root,
|
|
72
|
+
<span ref={ref} className={cx(styles.root, pressed && styles.selected, className)} data-slot="tag" data-leaving={leaving || undefined}>
|
|
75
73
|
{selectable ? (
|
|
76
|
-
<button type="button" className={styles.toggle} aria-pressed={
|
|
74
|
+
<button type="button" className={styles.toggle} data-slot="tag-toggle" data-state={pressed ? 'on' : 'off'} aria-pressed={pressed} onClick={() => onPressedChange?.(!pressed)}>
|
|
77
75
|
{content}
|
|
78
76
|
</button>
|
|
79
77
|
) : (
|
|
80
|
-
<span className={styles.static}>{content}</span>
|
|
78
|
+
<span className={styles.static} data-slot="tag-content">{content}</span>
|
|
81
79
|
)}
|
|
82
80
|
{onRemove && (
|
|
83
|
-
<button type="button" className={styles.remove} aria-label={
|
|
81
|
+
<button type="button" className={styles.remove} data-slot="tag-remove" aria-label={labels.remove(label)} onClick={remove}>
|
|
84
82
|
<XIcon />
|
|
85
83
|
</button>
|
|
86
84
|
)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { Comment, Text, ref, type VNode } from 'vue'
|
|
3
|
-
import { CheckIcon, XIcon } from '../../
|
|
3
|
+
import { CheckIcon, XIcon } from '../../icons/vue'
|
|
4
4
|
import { collapseOut, focusPast } from '../../internal/motion/collapseOut'
|
|
5
5
|
import styles from './Tag.module.css'
|
|
6
6
|
|
|
@@ -15,14 +15,12 @@ export type TagLabels = {
|
|
|
15
15
|
const props = defineProps<{
|
|
16
16
|
/** Shows a remove button (listen with @remove). Called after the exit animation ends. */
|
|
17
17
|
onRemove?: () => void
|
|
18
|
-
/** Label for the remove button. Wins over labels.remove, which defaults to "Remove <text>". */
|
|
19
|
-
removeLabel?: string
|
|
20
18
|
/** Screen reader text, so you can translate it. Missing keys use the English defaults. */
|
|
21
19
|
labels?: Partial<TagLabels>
|
|
22
20
|
}>()
|
|
23
21
|
|
|
24
|
-
/** Makes the tag a toggle chip (aria-pressed). Use v-model
|
|
25
|
-
const
|
|
22
|
+
/** Makes the tag a toggle chip (aria-pressed). Use v-model, or leave it out for a plain tag. */
|
|
23
|
+
const pressed = defineModel<boolean | undefined>({ default: undefined })
|
|
26
24
|
const slots = defineSlots<{ default?: () => VNode[]; icon?: () => unknown }>()
|
|
27
25
|
|
|
28
26
|
const root = ref<HTMLElement | null>(null)
|
|
@@ -33,7 +31,7 @@ const plain = () => {
|
|
|
33
31
|
const nodes = (slots.default?.() ?? []).filter((n) => n.type !== Comment)
|
|
34
32
|
return nodes.length && nodes.every((n) => n.type === Text) ? nodes.map((n) => String(n.children)).join('') : undefined
|
|
35
33
|
}
|
|
36
|
-
const removeName = () =>
|
|
34
|
+
const removeName = () => (props.labels?.remove ?? ((name: string) => `Remove ${name}`))(plain() ?? props.labels?.item ?? 'item')
|
|
37
35
|
|
|
38
36
|
const remove = () => {
|
|
39
37
|
const el = root.value
|
|
@@ -47,16 +45,16 @@ const remove = () => {
|
|
|
47
45
|
</script>
|
|
48
46
|
|
|
49
47
|
<template>
|
|
50
|
-
<span ref="root" :class="[styles.root,
|
|
51
|
-
<button v-if="
|
|
52
|
-
<span :class="styles.check"
|
|
53
|
-
<span :class="styles.text" :title="plain()"><slot /></span>
|
|
48
|
+
<span ref="root" :class="[styles.root, pressed && styles.selected]" data-slot="tag" :data-leaving="leaving || undefined">
|
|
49
|
+
<button v-if="pressed !== undefined" type="button" :class="styles.toggle" data-slot="tag-toggle" :data-state="pressed ? 'on' : 'off'" :aria-pressed="pressed" @click="pressed = !pressed">
|
|
50
|
+
<span :class="styles.check" data-slot="tag-indicator" aria-hidden="true"><CheckIcon /></span>
|
|
51
|
+
<span :class="styles.text" data-slot="tag-label" :title="plain()"><slot /></span>
|
|
54
52
|
</button>
|
|
55
|
-
<span v-else :class="styles.static">
|
|
56
|
-
<span v-if="slots.icon" :class="styles.icon"><slot name="icon" /></span>
|
|
57
|
-
<span :class="styles.text" :title="plain()"><slot /></span>
|
|
53
|
+
<span v-else :class="styles.static" data-slot="tag-content">
|
|
54
|
+
<span v-if="slots.icon" :class="styles.icon" data-slot="tag-icon"><slot name="icon" /></span>
|
|
55
|
+
<span :class="styles.text" data-slot="tag-label" :title="plain()"><slot /></span>
|
|
58
56
|
</span>
|
|
59
|
-
<button v-if="onRemove" type="button" :class="styles.remove" :aria-label="removeName()" @click="remove">
|
|
57
|
+
<button v-if="onRemove" type="button" :class="styles.remove" data-slot="tag-remove" :aria-label="removeName()" @click="remove">
|
|
60
58
|
<XIcon />
|
|
61
59
|
</button>
|
|
62
60
|
</span>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@layer gooee.components {
|
|
1
2
|
.root {
|
|
2
3
|
display: flex;
|
|
3
4
|
flex-direction: column;
|
|
@@ -39,9 +40,9 @@
|
|
|
39
40
|
overflow-y: hidden;
|
|
40
41
|
--gooee-flow-edge: var(--gooee-color-fg);
|
|
41
42
|
transition:
|
|
42
|
-
height var(--gooee-motion-base) var(--gooee-ease-
|
|
43
|
-
border-color var(--gooee-motion-fast) var(--gooee-ease-
|
|
44
|
-
box-shadow var(--gooee-motion-fast) var(--gooee-ease-
|
|
43
|
+
height var(--gooee-motion-base) var(--gooee-ease-morph),
|
|
44
|
+
border-color var(--gooee-motion-fast) var(--gooee-ease-morph),
|
|
45
|
+
box-shadow var(--gooee-motion-fast) var(--gooee-ease-morph);
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
/* Holds the drawn edge (internal/liquidMore.ts), which a textarea cannot. */
|
|
@@ -62,8 +63,8 @@
|
|
|
62
63
|
is the field's focus indicator, so it lands at once; a blur fades it. */
|
|
63
64
|
.textarea[data-edge] {
|
|
64
65
|
border-color: var(--gooee-flow-edge);
|
|
65
|
-
box-shadow: inset 0 0 0 calc(var(--gooee-
|
|
66
|
-
transition: height var(--gooee-motion-base) var(--gooee-ease-
|
|
66
|
+
box-shadow: inset 0 0 0 calc(var(--gooee-focus-width) - var(--gooee-line)) var(--gooee-flow-edge);
|
|
67
|
+
transition: height var(--gooee-motion-base) var(--gooee-ease-morph);
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
.textarea[data-invalid] {
|
|
@@ -72,10 +73,11 @@
|
|
|
72
73
|
--edge: var(--gooee-line-thick);
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
.textarea[data-invalid][data-edge] { box-shadow: inset 0 0 0 calc(var(--gooee-
|
|
76
|
+
.textarea[data-invalid][data-edge] { box-shadow: inset 0 0 0 calc(var(--gooee-focus-width) - var(--gooee-line-thick)) var(--gooee-flow-edge); }
|
|
76
77
|
|
|
77
78
|
.textarea:disabled {
|
|
78
79
|
background: var(--gooee-color-surface-sunken);
|
|
79
80
|
opacity: 0.6;
|
|
80
81
|
cursor: not-allowed;
|
|
81
82
|
}
|
|
83
|
+
}
|
|
@@ -78,11 +78,11 @@ export function Textarea({
|
|
|
78
78
|
.join(' ')
|
|
79
79
|
|
|
80
80
|
return (
|
|
81
|
-
<div className={cx(styles.root, className)}>
|
|
81
|
+
<div className={cx(styles.root, className)} data-slot="textarea">
|
|
82
82
|
<div className={styles.labelRow}>
|
|
83
|
-
<label htmlFor={fieldId} className={styles.label}>{label}</label>
|
|
83
|
+
<label htmlFor={fieldId} className={styles.label} data-slot="field-label">{label}</label>
|
|
84
84
|
{showCount && maxLength !== undefined && (
|
|
85
|
-
<span id={countId} ref={countRef} className={styles.count} aria-live="off" />
|
|
85
|
+
<span id={countId} ref={countRef} className={styles.count} data-slot="textarea-count" aria-live="off" />
|
|
86
86
|
)}
|
|
87
87
|
</div>
|
|
88
88
|
<div ref={boxRef} className={styles.box}>
|
|
@@ -91,6 +91,7 @@ export function Textarea({
|
|
|
91
91
|
ref={mergeRefs(inner, ref)}
|
|
92
92
|
rows={minRows}
|
|
93
93
|
className={styles.textarea}
|
|
94
|
+
data-slot="textarea-input"
|
|
94
95
|
data-invalid={error ? true : undefined}
|
|
95
96
|
aria-invalid={error ? true : undefined}
|
|
96
97
|
aria-describedby={describedBy || undefined}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, onBeforeUnmount, onMounted, ref, useAttrs, useId, watch } from 'vue'
|
|
3
3
|
import FieldMessage from '../../internal/FieldMessage.vue'
|
|
4
|
-
import {
|
|
4
|
+
import { createEdgeFlow } from '../../internal/motion/liquidMore'
|
|
5
5
|
import { growTextarea } from '../../internal/motion/textarea'
|
|
6
6
|
import styles from './Textarea.module.css'
|
|
7
7
|
|
|
@@ -9,29 +9,26 @@ import styles from './Textarea.module.css'
|
|
|
9
9
|
// Other attributes, such as name or placeholder, go to the textarea. class and style go to the root.
|
|
10
10
|
defineOptions({ inheritAttrs: false })
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}>(),
|
|
33
|
-
{ autoGrow: true, minRows: 3, maxRows: 10 },
|
|
34
|
-
)
|
|
12
|
+
const { help, error, autoGrow = true, minRows = 3, maxRows = 10, showCount, maxLength, defaultValue, id } = defineProps<{
|
|
13
|
+
/** Visible name of the field, also read by screen readers. */
|
|
14
|
+
label: string
|
|
15
|
+
/** Hint under the field. Hidden while an error shows. */
|
|
16
|
+
help?: string
|
|
17
|
+
/** Error message under the field. Also marks the field invalid. */
|
|
18
|
+
error?: string
|
|
19
|
+
/** Grows with the text. Default true. */
|
|
20
|
+
autoGrow?: boolean
|
|
21
|
+
/** Height in lines when empty. */
|
|
22
|
+
minRows?: number
|
|
23
|
+
/** Most lines it grows to before it scrolls. Only used with autoGrow. */
|
|
24
|
+
maxRows?: number
|
|
25
|
+
/** Shows a live "n / max" count when maxLength is set. */
|
|
26
|
+
showCount?: boolean
|
|
27
|
+
maxLength?: number
|
|
28
|
+
/** The starting text when there is no v-model. */
|
|
29
|
+
defaultValue?: string
|
|
30
|
+
id?: string
|
|
31
|
+
}>()
|
|
35
32
|
/** The text. Use v-model, or leave it out and the field keeps its own text. */
|
|
36
33
|
const model = defineModel<string>()
|
|
37
34
|
const attrs = useAttrs()
|
|
@@ -41,19 +38,19 @@ const fieldAttrs = computed(() => {
|
|
|
41
38
|
return rest
|
|
42
39
|
})
|
|
43
40
|
const auto = useId()
|
|
44
|
-
const fieldId = computed(() =>
|
|
41
|
+
const fieldId = computed(() => id ?? auto)
|
|
45
42
|
const helpId = computed(() => `${fieldId.value}-help`)
|
|
46
43
|
const errorId = computed(() => `${fieldId.value}-error`)
|
|
47
44
|
const countId = computed(() => `${fieldId.value}-count`)
|
|
48
45
|
const describedBy = computed(
|
|
49
|
-
() => [
|
|
46
|
+
() => [help && !error ? helpId.value : null, error ? errorId.value : null, showCount && maxLength ? countId.value : null, attrs['aria-describedby']].filter(Boolean).join(' ') || undefined,
|
|
50
47
|
)
|
|
51
48
|
|
|
52
49
|
const inner = ref<HTMLTextAreaElement | null>(null)
|
|
53
50
|
const box = ref<HTMLElement | null>(null)
|
|
54
51
|
const count = ref<HTMLElement | null>(null)
|
|
55
|
-
defineExpose({
|
|
56
|
-
const resize = () => growTextarea(inner.value, count.value,
|
|
52
|
+
defineExpose({ el: inner })
|
|
53
|
+
const resize = () => growTextarea(inner.value, count.value, { autoGrow, minRows, maxRows, maxLength })
|
|
57
54
|
|
|
58
55
|
// The text is set on the element, not bound: Vue would also write it to a value attribute, which React does not.
|
|
59
56
|
const show = () => {
|
|
@@ -66,7 +63,7 @@ watch(model, () => {
|
|
|
66
63
|
show()
|
|
67
64
|
resize()
|
|
68
65
|
})
|
|
69
|
-
watch(() => [
|
|
66
|
+
watch(() => [autoGrow, minRows, maxRows, maxLength], resize)
|
|
70
67
|
|
|
71
68
|
const onInput = (e: Event) => {
|
|
72
69
|
resize()
|
|
@@ -83,9 +80,9 @@ const onReset = () => {
|
|
|
83
80
|
onMounted(() => {
|
|
84
81
|
const el = inner.value!
|
|
85
82
|
if (model.value !== undefined) show()
|
|
86
|
-
else if (
|
|
83
|
+
else if (defaultValue !== undefined) el.defaultValue = defaultValue
|
|
87
84
|
resize()
|
|
88
|
-
if (box.value) stopEdge =
|
|
85
|
+
if (box.value) stopEdge = createEdgeFlow(el, { root: box.value, when: ':focus', className: styles.edge }).destroy
|
|
89
86
|
el.form?.addEventListener('reset', onReset)
|
|
90
87
|
})
|
|
91
88
|
onBeforeUnmount(() => {
|
|
@@ -96,10 +93,10 @@ onBeforeUnmount(() => {
|
|
|
96
93
|
</script>
|
|
97
94
|
|
|
98
95
|
<template>
|
|
99
|
-
<div :class="[styles.root, attrs.class]" :style="attrs.style as string | undefined">
|
|
96
|
+
<div :class="[styles.root, attrs.class]" :style="attrs.style as string | undefined" data-slot="textarea">
|
|
100
97
|
<div :class="styles.labelRow">
|
|
101
|
-
<label :for="fieldId" :class="styles.label">{{ label }}</label>
|
|
102
|
-
<span v-if="showCount && maxLength !== undefined" :id="countId" ref="count" :class="styles.count" aria-live="off" />
|
|
98
|
+
<label :for="fieldId" :class="styles.label" data-slot="field-label">{{ label }}</label>
|
|
99
|
+
<span v-if="showCount && maxLength !== undefined" :id="countId" ref="count" :class="styles.count" data-slot="textarea-count" aria-live="off" />
|
|
103
100
|
</div>
|
|
104
101
|
<div ref="box" :class="styles.box">
|
|
105
102
|
<textarea
|
|
@@ -107,6 +104,7 @@ onBeforeUnmount(() => {
|
|
|
107
104
|
ref="inner"
|
|
108
105
|
:rows="minRows"
|
|
109
106
|
:class="styles.textarea"
|
|
107
|
+
data-slot="textarea-input"
|
|
110
108
|
:data-invalid="error ? true : undefined"
|
|
111
109
|
:aria-invalid="error ? true : undefined"
|
|
112
110
|
:aria-describedby="describedBy"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@layer gooee.components {
|
|
1
2
|
/* One shape: the sun's disc grows and a bite slides over it into the moon's crescent, with the rays
|
|
2
3
|
drawing back in first (ThemeToggle.tsx draws every frame). */
|
|
3
4
|
.icon {
|
|
@@ -10,3 +11,4 @@
|
|
|
10
11
|
transform-box: view-box;
|
|
11
12
|
transform-origin: 50% 50%;
|
|
12
13
|
}
|
|
14
|
+
}
|
|
@@ -6,13 +6,13 @@ import { themeReveal } from '../../internal/themeReveal'
|
|
|
6
6
|
import { IconButton } from '../IconButton'
|
|
7
7
|
import styles from './ThemeToggle.module.css'
|
|
8
8
|
|
|
9
|
-
export type
|
|
9
|
+
export type ThemeToggleTheme = 'light' | 'dark'
|
|
10
10
|
|
|
11
11
|
export type ThemeToggleProps = {
|
|
12
12
|
/** The theme, when your app keeps it. Leave it out and the toggle sets data-theme on <html> itself. */
|
|
13
|
-
theme?:
|
|
13
|
+
theme?: ThemeToggleTheme
|
|
14
14
|
/** Called with the new theme on every flip. */
|
|
15
|
-
onThemeChange?: (theme:
|
|
15
|
+
onThemeChange?: (theme: ThemeToggleTheme) => void
|
|
16
16
|
/** Where the choice is remembered when the toggle runs the page. Match it in themeScript. */
|
|
17
17
|
storageKey?: string
|
|
18
18
|
/** The new theme grows from the button in a circle over the screen. Turn it off for an instant change. */
|
|
@@ -25,12 +25,12 @@ export type ThemeToggleProps = {
|
|
|
25
25
|
|
|
26
26
|
export { themeScript } from '../../internal/motion/themeReveal'
|
|
27
27
|
|
|
28
|
-
const pageTheme = ():
|
|
28
|
+
const pageTheme = (): ThemeToggleTheme => (document.documentElement.dataset.theme === 'dark' ? 'dark' : 'light')
|
|
29
29
|
|
|
30
30
|
// One button that flips between the light and dark theme. The sun morphs into the moon and back.
|
|
31
31
|
export function ThemeToggle({ theme: themeProp, onThemeChange, storageKey = 'gooee-theme', reveal = true, size = 'sm', className }: ThemeToggleProps) {
|
|
32
32
|
const controlled = themeProp !== undefined
|
|
33
|
-
const [own, setOwn] = useState<
|
|
33
|
+
const [own, setOwn] = useState<ThemeToggleTheme>('light')
|
|
34
34
|
const theme = controlled ? themeProp : own
|
|
35
35
|
|
|
36
36
|
// Read after mount: the server cannot know the page's theme, and themeScript has already set it.
|
|
@@ -38,7 +38,7 @@ export function ThemeToggle({ theme: themeProp, onThemeChange, storageKey = 'goo
|
|
|
38
38
|
if (!controlled) setOwn(pageTheme())
|
|
39
39
|
}, [controlled])
|
|
40
40
|
|
|
41
|
-
const next:
|
|
41
|
+
const next: ThemeToggleTheme = theme === 'dark' ? 'light' : 'dark'
|
|
42
42
|
// Shows the theme the button switches to: the moon in light, the sun in dark (motion/themeIcon.ts).
|
|
43
43
|
const body = useRef<SVGPathElement>(null)
|
|
44
44
|
const icon = useRef<ReturnType<typeof createThemeIcon>>(null)
|
|
@@ -84,7 +84,7 @@ export function ThemeToggle({ theme: themeProp, onThemeChange, storageKey = 'goo
|
|
|
84
84
|
className={className}
|
|
85
85
|
onClick={flip}
|
|
86
86
|
icon={
|
|
87
|
-
<svg className={styles.icon} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.75} strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
87
|
+
<svg className={styles.icon} data-slot="theme-toggle-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.75} strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
88
88
|
<path ref={body} d={bodyAt(icon.current.shown)} />
|
|
89
89
|
<path className={styles.rays} d={RAYS} style={raysAt(icon.current.shown)} />
|
|
90
90
|
</svg>
|
|
@@ -5,30 +5,32 @@ import { themeReveal } from '../../internal/motion/themeReveal'
|
|
|
5
5
|
import IconButton from '../IconButton/IconButton.vue'
|
|
6
6
|
import styles from './ThemeToggle.module.css'
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type ThemeToggleTheme = 'light' | 'dark'
|
|
9
9
|
|
|
10
10
|
// The Vue ThemeToggle: the same button, icon morph and circle reveal as the React one. themeScript, for
|
|
11
11
|
// <head>, is in internal/motion/themeReveal.ts.
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
const {
|
|
13
|
+
theme: themeProp,
|
|
14
|
+
storageKey = 'gooee-theme',
|
|
15
|
+
reveal = true,
|
|
16
|
+
size = 'sm',
|
|
17
|
+
} = defineProps<{
|
|
18
|
+
/** The theme, with v-model:theme. Leave it out and the toggle sets data-theme on <html> itself. */
|
|
19
|
+
theme?: ThemeToggleTheme
|
|
20
|
+
/** Where the choice is remembered when the toggle runs the page. Match it in themeScript. */
|
|
21
|
+
storageKey?: string
|
|
22
|
+
/** The new theme grows from the button in a circle over the screen. Turn it off for an instant change. */
|
|
23
|
+
reveal?: boolean
|
|
24
|
+
/** The button's size, the same as IconButton. */
|
|
25
|
+
size?: 'sm' | 'md' | 'lg'
|
|
26
|
+
}>()
|
|
25
27
|
/** update:theme: the new theme on every flip. */
|
|
26
|
-
const emit = defineEmits<{ 'update:theme': [theme:
|
|
28
|
+
const emit = defineEmits<{ 'update:theme': [theme: ThemeToggleTheme] }>()
|
|
27
29
|
|
|
28
|
-
const controlled = computed(() =>
|
|
29
|
-
const own = ref<
|
|
30
|
-
const theme = computed(() =>
|
|
31
|
-
const next = computed<
|
|
30
|
+
const controlled = computed(() => themeProp !== undefined)
|
|
31
|
+
const own = ref<ThemeToggleTheme>('light')
|
|
32
|
+
const theme = computed(() => themeProp ?? own.value)
|
|
33
|
+
const next = computed<ThemeToggleTheme>(() => (theme.value === 'dark' ? 'light' : 'dark'))
|
|
32
34
|
|
|
33
35
|
// Read after mount: the server cannot know the page's theme, and themeScript has already set it.
|
|
34
36
|
onMounted(() => {
|
|
@@ -55,7 +57,7 @@ const apply = async () => {
|
|
|
55
57
|
if (!controlled.value) {
|
|
56
58
|
document.documentElement.dataset.theme = to
|
|
57
59
|
try {
|
|
58
|
-
localStorage.setItem(
|
|
60
|
+
localStorage.setItem(storageKey, to)
|
|
59
61
|
} catch {
|
|
60
62
|
// Not saved, so it lasts only this visit; the theme still changes.
|
|
61
63
|
}
|
|
@@ -71,7 +73,7 @@ const flip = (e: MouseEvent) => {
|
|
|
71
73
|
icon.morphTo(next.value === 'dark' ? 0 : 1)
|
|
72
74
|
requestAnimationFrame(() =>
|
|
73
75
|
requestAnimationFrame(() => {
|
|
74
|
-
if (
|
|
76
|
+
if (reveal) themeReveal(origin, apply)
|
|
75
77
|
else void apply()
|
|
76
78
|
}),
|
|
77
79
|
)
|
|
@@ -81,7 +83,7 @@ const flip = (e: MouseEvent) => {
|
|
|
81
83
|
<template>
|
|
82
84
|
<IconButton :label="`Switch to ${next} theme`" variant="secondary" :size="size" @click="flip">
|
|
83
85
|
<template #icon>
|
|
84
|
-
<svg :class="styles.icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
86
|
+
<svg :class="styles.icon" data-slot="theme-toggle-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
85
87
|
<path ref="body" :d="bodyAt(icon.shown)" />
|
|
86
88
|
<path :class="styles.rays" :d="RAYS" :style="raysAt(icon.shown)" />
|
|
87
89
|
</svg>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@layer gooee.components {
|
|
1
2
|
/* The negative margin keeps the announcers from adding a pixel of scroll under the page. */
|
|
2
3
|
.srOnly {
|
|
3
4
|
position: absolute;
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
bottom: calc(var(--gooee-space-5) + env(safe-area-inset-bottom));
|
|
17
18
|
z-index: var(--gooee-z-toast);
|
|
18
19
|
pointer-events: none;
|
|
19
|
-
transition: height var(--gooee-motion-slow) var(--gooee-ease-
|
|
20
|
+
transition: height var(--gooee-motion-slow) var(--gooee-ease-morph);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
@media (min-width: 640px) {
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
left: auto;
|
|
25
26
|
right: var(--gooee-space-7);
|
|
26
27
|
bottom: var(--gooee-space-7);
|
|
27
|
-
width: var(--gooee-toast-w);
|
|
28
|
+
width: var(--gooee-toast-w, 360px);
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
|
|
@@ -59,14 +60,14 @@
|
|
|
59
60
|
transform-origin: bottom center;
|
|
60
61
|
transform: translate(var(--dx), var(--y)) scale(var(--s));
|
|
61
62
|
transition:
|
|
62
|
-
transform var(--gooee-motion-slow) var(--gooee-ease-
|
|
63
|
-
opacity var(--gooee-motion-base) var(--gooee-ease-
|
|
64
|
-
animation: toastIn var(--gooee-motion-slow) var(--gooee-ease-
|
|
63
|
+
transform var(--gooee-motion-slow) var(--gooee-ease-morph),
|
|
64
|
+
opacity var(--gooee-motion-base) var(--gooee-ease-morph);
|
|
65
|
+
animation: toastIn var(--gooee-motion-slow) var(--gooee-ease-morph);
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
.toast[data-dragging] { transition: none; }
|
|
68
69
|
/* A spring is moving it from the hand: only the fade stays with CSS. */
|
|
69
|
-
.toast[data-fluid] { transition: opacity var(--gooee-motion-base) var(--gooee-ease-
|
|
70
|
+
.toast[data-fluid] { transition: opacity var(--gooee-motion-base) var(--gooee-ease-morph); }
|
|
70
71
|
.toast[data-hidden] { opacity: 0; pointer-events: none; }
|
|
71
72
|
|
|
72
73
|
.toast[data-behind] {
|
|
@@ -76,16 +77,16 @@
|
|
|
76
77
|
|
|
77
78
|
.toast[data-behind] > * {
|
|
78
79
|
opacity: 0;
|
|
79
|
-
transition: opacity var(--gooee-motion-fast) var(--gooee-ease-
|
|
80
|
+
transition: opacity var(--gooee-motion-fast) var(--gooee-ease-morph);
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
.toast > * { transition: opacity var(--gooee-motion-base) var(--gooee-ease-
|
|
83
|
+
.toast > * { transition: opacity var(--gooee-motion-base) var(--gooee-ease-morph); }
|
|
83
84
|
|
|
84
85
|
.toast[data-leaving="down"] { animation: toastOutDown var(--gooee-motion-morph-out) var(--gooee-ease-morph) forwards; }
|
|
85
|
-
.toast[data-leaving="left"] { animation: toastOutLeft var(--gooee-motion-slow) var(--gooee-ease-
|
|
86
|
-
.toast[data-leaving="right"] { animation: toastOutRight var(--gooee-motion-slow) var(--gooee-ease-
|
|
86
|
+
.toast[data-leaving="left"] { animation: toastOutLeft var(--gooee-motion-slow) var(--gooee-ease-morph) forwards; }
|
|
87
|
+
.toast[data-leaving="right"] { animation: toastOutRight var(--gooee-motion-slow) var(--gooee-ease-morph) forwards; }
|
|
87
88
|
/* Thrown away: the spring carries it off at the hand's speed, so it only fades. */
|
|
88
|
-
.toast[data-fluid][data-leaving] { animation: toastFade var(--gooee-motion-slow) var(--gooee-ease-
|
|
89
|
+
.toast[data-fluid][data-leaving] { animation: toastFade var(--gooee-motion-slow) var(--gooee-ease-morph) forwards; }
|
|
89
90
|
/* The bud (Toast.tsx) grows it in and flows it away instead. */
|
|
90
91
|
.toast[data-liquid]:not([data-leaving]),
|
|
91
92
|
.toast[data-liquid][data-leaving="down"] { animation: none; }
|
|
@@ -98,8 +99,8 @@
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
/* Only the icon has status colour; its shape and the title carry the meaning */
|
|
101
|
-
.icon[data-
|
|
102
|
-
.icon[data-
|
|
102
|
+
.icon[data-tone="success"] { color: var(--gooee-color-success); }
|
|
103
|
+
.icon[data-tone="danger"] { color: var(--gooee-color-danger); }
|
|
103
104
|
|
|
104
105
|
.text {
|
|
105
106
|
flex: 1;
|
|
@@ -132,7 +133,7 @@
|
|
|
132
133
|
font-weight: var(--gooee-weight-medium);
|
|
133
134
|
cursor: pointer;
|
|
134
135
|
position: relative;
|
|
135
|
-
transition: background-color var(--gooee-motion-fast) var(--gooee-ease-
|
|
136
|
+
transition: background-color var(--gooee-motion-fast) var(--gooee-ease-morph);
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
.action::after {
|
|
@@ -161,7 +162,7 @@
|
|
|
161
162
|
color: var(--gooee-color-fg-muted);
|
|
162
163
|
font-size: var(--gooee-icon-md);
|
|
163
164
|
cursor: pointer;
|
|
164
|
-
transition: background-color var(--gooee-motion-fast) var(--gooee-ease-
|
|
165
|
+
transition: background-color var(--gooee-motion-fast) var(--gooee-ease-morph);
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
/* Looks 32px, keeps a 44px touch area. */
|
|
@@ -203,3 +204,4 @@
|
|
|
203
204
|
pointer-events: none;
|
|
204
205
|
}
|
|
205
206
|
|
|
207
|
+
}
|