@remix-run/ui 0.3.0 → 0.5.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 +116 -157
- package/dist/accordion/index.d.ts +46 -0
- package/dist/accordion/index.js +142 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/accordion/primitives.d.ts +104 -0
- package/dist/accordion/primitives.js +312 -0
- package/dist/accordion/primitives.js.map +1 -0
- package/dist/{components/anchor/anchor.js → anchor/index.js} +1 -1
- package/dist/anchor/index.js.map +1 -0
- package/dist/animation/animate-layout-mixin.js +1 -1
- package/dist/animation/animate-layout-mixin.js.map +1 -1
- package/dist/animation/animate-mixins.js +2 -2
- package/dist/animation/animate-mixins.js.map +1 -1
- package/dist/animation/demos/color-interpolation.js +1 -1
- package/dist/animation/demos/color-interpolation.js.map +1 -1
- package/dist/animation/demos/drag-release.d.ts +1 -1
- package/dist/animation/demos/hold-to-confirm.d.ts +3 -3
- package/dist/animation/demos/material-ripple.js +1 -3
- package/dist/animation/demos/material-ripple.js.map +1 -1
- package/dist/animation/demos/reordering.js +9 -6
- package/dist/animation/demos/reordering.js.map +1 -1
- package/dist/animation/index.js +4 -4
- package/dist/animation/spring.js.map +1 -1
- package/dist/{components/breadcrumbs/breadcrumbs.js → breadcrumbs/index.js} +19 -19
- package/dist/breadcrumbs/index.js.map +1 -0
- package/dist/button/index.d.ts +15 -0
- package/dist/button/index.js +128 -0
- package/dist/button/index.js.map +1 -0
- package/dist/checkbox/index.d.ts +14 -0
- package/dist/checkbox/index.js +127 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/combobox/index.d.ts +21 -0
- package/dist/combobox/index.js +58 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/{components/combobox/combobox.d.ts → combobox/primitives.d.ts} +4 -8
- package/dist/{components/combobox/combobox.js → combobox/primitives.js} +8 -61
- package/dist/combobox/primitives.js.map +1 -0
- package/dist/dev/refresh.d.ts +1 -0
- package/dist/dev/refresh.js +2 -0
- package/dist/dev/refresh.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -14
- package/dist/input/index.d.ts +13 -0
- package/dist/input/index.js +121 -0
- package/dist/input/index.js.map +1 -0
- package/dist/jsx-runtime.js +2 -2
- package/dist/listbox/flash-attribute.js.map +1 -0
- package/dist/{components/listbox/listbox.d.ts → listbox/index.d.ts} +2 -6
- package/dist/{components/listbox/listbox.js → listbox/index.js} +4 -82
- package/dist/listbox/index.js.map +1 -0
- package/dist/menu/hover-aim.js.map +1 -0
- package/dist/menu/index.d.ts +42 -0
- package/dist/menu/index.js +250 -0
- package/dist/menu/index.js.map +1 -0
- package/dist/{components/menu/menu.d.ts → menu/primitives.d.ts} +4 -33
- package/dist/{components/menu/menu.js → menu/primitives.js} +98 -315
- package/dist/menu/primitives.js.map +1 -0
- package/dist/{components/popover/popover.d.ts → popover/index.d.ts} +2 -4
- package/dist/{components/popover/popover.js → popover/index.js} +5 -48
- package/dist/popover/index.js.map +1 -0
- package/dist/{interactions/outside-click/outside-click-mixin.js → popover/outside-click.js} +1 -1
- package/dist/popover/outside-click.js.map +1 -0
- package/dist/popover/scroll-lock.d.ts +1 -0
- package/dist/{utils → popover}/scroll-lock.js +0 -18
- package/dist/popover/scroll-lock.js.map +1 -0
- package/dist/radio/index.d.ts +12 -0
- package/dist/radio/index.js +77 -0
- package/dist/radio/index.js.map +1 -0
- package/dist/runtime/client-entry-boundary.d.ts +14 -0
- package/dist/runtime/client-entry-boundary.js +29 -0
- package/dist/runtime/client-entry-boundary.js.map +1 -0
- package/dist/runtime/component.d.ts +19 -4
- package/dist/runtime/component.js +39 -9
- package/dist/runtime/component.js.map +1 -1
- package/dist/runtime/core/attributes.js +36 -3
- package/dist/runtime/core/attributes.js.map +1 -1
- package/dist/runtime/core/children.d.ts +2 -0
- package/dist/runtime/core/children.js +26 -2
- package/dist/runtime/core/children.js.map +1 -1
- package/dist/runtime/core/props.js +2 -2
- package/dist/runtime/core/vnode.d.ts +3 -3
- package/dist/runtime/core/vnode.js +22 -1
- package/dist/runtime/core/vnode.js.map +1 -1
- package/dist/runtime/create-element.d.ts +2 -2
- package/dist/runtime/create-element.js +3 -2
- package/dist/runtime/create-element.js.map +1 -1
- package/dist/runtime/diff-dom.js +294 -219
- package/dist/runtime/diff-dom.js.map +1 -1
- package/dist/runtime/diff-props.js +3 -3
- package/dist/runtime/dom.d.ts +12 -0
- package/dist/runtime/element-function.d.ts +3 -0
- package/dist/runtime/element-function.js +2 -0
- package/dist/runtime/element-function.js.map +1 -0
- package/dist/runtime/form-navigation.d.ts +25 -0
- package/dist/runtime/form-navigation.js +132 -0
- package/dist/runtime/form-navigation.js.map +1 -0
- package/dist/runtime/frame-resolution.d.ts +5 -0
- package/dist/runtime/frame-resolution.js +10 -0
- package/dist/runtime/frame-resolution.js.map +1 -0
- package/dist/runtime/frame.d.ts +58 -15
- package/dist/runtime/frame.js +367 -114
- package/dist/runtime/frame.js.map +1 -1
- package/dist/runtime/jsx.d.ts +1 -1
- package/dist/runtime/jsx.js +1 -1
- package/dist/runtime/jsx.js.map +1 -1
- package/dist/runtime/key.d.ts +1 -0
- package/dist/runtime/key.js +2 -0
- package/dist/runtime/key.js.map +1 -0
- package/dist/runtime/mixins/attrs-mixin.js +2 -2
- package/dist/runtime/mixins/link-mixin.js +4 -3
- package/dist/runtime/mixins/link-mixin.js.map +1 -1
- package/dist/runtime/mixins/mixin.d.ts +15 -10
- package/dist/runtime/mixins/mixin.js +4 -4
- package/dist/runtime/mixins/mixin.js.map +1 -1
- package/dist/runtime/mixins/on-mixin.js +1 -1
- package/dist/runtime/mixins/ref-mixin.js +1 -1
- package/dist/runtime/navigation.d.ts +4 -1
- package/dist/runtime/navigation.js +157 -32
- package/dist/runtime/navigation.js.map +1 -1
- package/dist/runtime/reconcile.d.ts +11 -10
- package/dist/runtime/reconcile.js +557 -423
- package/dist/runtime/reconcile.js.map +1 -1
- package/dist/runtime/refresh.d.ts +28 -0
- package/dist/runtime/refresh.js +31 -0
- package/dist/runtime/refresh.js.map +1 -0
- package/dist/runtime/render.js +1 -1
- package/dist/runtime/render.js.map +1 -1
- package/dist/runtime/run.d.ts +3 -1
- package/dist/runtime/run.js +15 -7
- package/dist/runtime/run.js.map +1 -1
- package/dist/runtime/scheduler.js +8 -16
- package/dist/runtime/scheduler.js.map +1 -1
- package/dist/runtime/to-vnode.d.ts +2 -2
- package/dist/runtime/to-vnode.js +68 -20
- package/dist/runtime/to-vnode.js.map +1 -1
- package/dist/runtime/vdom.d.ts +4 -2
- package/dist/runtime/vdom.js +89 -41
- package/dist/runtime/vdom.js.map +1 -1
- package/dist/runtime/vnode.d.ts +138 -67
- package/dist/runtime/vnode.js +17 -12
- package/dist/runtime/vnode.js.map +1 -1
- package/dist/select/index.d.ts +19 -0
- package/dist/select/index.js +95 -0
- package/dist/select/index.js.map +1 -0
- package/dist/select/keydown.js.map +1 -0
- package/dist/{components/select/select.d.ts → select/primitives.d.ts} +5 -7
- package/dist/{components/select/select.js → select/primitives.js} +11 -63
- package/dist/select/primitives.js.map +1 -0
- package/dist/server/stream.js +22 -29
- package/dist/server/stream.js.map +1 -1
- package/dist/shared/focus-styles.d.ts +1 -0
- package/dist/shared/focus-styles.js +2 -0
- package/dist/shared/focus-styles.js.map +1 -0
- package/dist/shared/icons.d.ts +9 -0
- package/dist/shared/icons.js +42 -0
- package/dist/shared/icons.js.map +1 -0
- package/dist/shared/listbox-popover-styles.d.ts +6 -0
- package/dist/shared/listbox-popover-styles.js +137 -0
- package/dist/shared/listbox-popover-styles.js.map +1 -0
- package/dist/shared/style-values.d.ts +78 -0
- package/dist/shared/style-values.js +88 -0
- package/dist/shared/style-values.js.map +1 -0
- package/dist/{interactions/typeahead/typeahead-mixin.js → shared/typeahead.js} +1 -1
- package/dist/shared/typeahead.js.map +1 -0
- package/dist/shared/wait-for-css-transition.js.map +1 -0
- package/dist/shared/wait.js.map +1 -0
- package/dist/style/css-mixin.js +3 -3
- package/dist/style/index.js +2 -2
- package/dist/style/style.js +25 -6
- package/dist/style/style.js.map +1 -1
- package/dist/style/stylesheet.d.ts +0 -1
- package/dist/style/stylesheet.js +13 -54
- package/dist/style/stylesheet.js.map +1 -1
- package/dist/tabs/index.d.ts +32 -0
- package/dist/tabs/index.js +157 -0
- package/dist/tabs/index.js.map +1 -0
- package/dist/tabs/primitives.d.ts +57 -0
- package/dist/tabs/primitives.js +238 -0
- package/dist/tabs/primitives.js.map +1 -0
- package/dist/test.js +1 -1
- package/dist/toggle/index.d.ts +9 -0
- package/dist/toggle/index.js +108 -0
- package/dist/toggle/index.js.map +1 -0
- package/dist/toggle/primitives.d.ts +29 -0
- package/dist/toggle/primitives.js +127 -0
- package/dist/toggle/primitives.js.map +1 -0
- package/package.json +81 -49
- package/src/{components/accordion → accordion}/README.md +50 -14
- package/src/accordion/index.tsx +285 -0
- package/src/accordion/primitives.tsx +512 -0
- package/src/{components/anchor → anchor}/README.md +37 -2
- package/src/animation/animate-mixins.ts +3 -3
- package/src/animation/demos/color-interpolation.tsx +1 -1
- package/src/animation/demos/reordering.tsx +9 -6
- package/src/{components/breadcrumbs → breadcrumbs}/README.md +4 -4
- package/src/{components/breadcrumbs/breadcrumbs.tsx → breadcrumbs/index.tsx} +18 -18
- package/src/button/README.md +44 -0
- package/src/button/index.ts +168 -0
- package/src/checkbox/README.md +59 -0
- package/src/checkbox/index.ts +164 -0
- package/src/{components/combobox → combobox}/README.md +58 -9
- package/src/combobox/index.tsx +112 -0
- package/src/{components/combobox/combobox.tsx → combobox/primitives.tsx} +5 -91
- package/src/dev/refresh.ts +1 -0
- package/src/index.ts +1 -1
- package/src/input/README.md +52 -0
- package/src/input/index.ts +147 -0
- package/src/{components/listbox → listbox}/README.md +9 -41
- package/src/{components/listbox/listbox.ts → listbox/index.ts} +2 -87
- package/src/{components/menu → menu}/README.md +55 -14
- package/src/menu/index.tsx +354 -0
- package/src/{components/menu/menu.tsx → menu/primitives.tsx} +99 -413
- package/src/{components/popover → popover}/README.md +20 -39
- package/src/{components/popover/popover.ts → popover/index.ts} +3 -57
- package/src/{utils → popover}/scroll-lock.ts +0 -28
- package/src/radio/README.md +53 -0
- package/src/radio/index.ts +101 -0
- package/src/runtime/client-entry-boundary.ts +54 -0
- package/src/runtime/component.ts +65 -16
- package/src/runtime/core/attributes.ts +35 -1
- package/src/runtime/core/children.ts +24 -2
- package/src/runtime/core/vnode.ts +25 -4
- package/src/runtime/create-element.ts +6 -5
- package/src/runtime/demos/readme.demo.tsx +20 -18
- package/src/runtime/diff-dom.ts +358 -243
- package/src/runtime/dom.ts +331 -214
- package/src/runtime/element-function.ts +1 -0
- package/src/runtime/event-listeners.ts +1 -1
- package/src/runtime/form-navigation.ts +184 -0
- package/src/runtime/frame-resolution.ts +13 -0
- package/src/runtime/frame.ts +482 -124
- package/src/runtime/jsx.ts +3 -5
- package/src/runtime/key.ts +1 -0
- package/src/runtime/mixins/link-mixin.ts +1 -0
- package/src/runtime/mixins/mixin.ts +21 -18
- package/src/runtime/navigation.ts +204 -30
- package/src/runtime/reconcile.ts +769 -760
- package/src/runtime/refresh.ts +46 -0
- package/src/runtime/run.ts +12 -2
- package/src/runtime/scheduler.ts +9 -29
- package/src/runtime/to-vnode.ts +85 -23
- package/src/runtime/vdom.ts +91 -69
- package/src/runtime/vnode.ts +192 -88
- package/src/{components/select → select}/README.md +29 -19
- package/src/select/index.tsx +159 -0
- package/src/{components/select/select.tsx → select/primitives.tsx} +10 -98
- package/src/server/stream.ts +25 -31
- package/src/shared/focus-styles.ts +2 -0
- package/src/shared/icons.tsx +62 -0
- package/src/shared/listbox-popover-styles.ts +146 -0
- package/src/shared/style-values.ts +165 -0
- package/src/style/style.ts +25 -6
- package/src/style/stylesheet.ts +32 -57
- package/src/tabs/README.md +141 -0
- package/src/tabs/index.tsx +245 -0
- package/src/tabs/primitives.ts +365 -0
- package/src/test/README.md +151 -60
- package/src/toggle/README.md +56 -0
- package/src/toggle/index.tsx +136 -0
- package/src/toggle/primitives.ts +192 -0
- package/dist/animation/demos/animation.demo.d.ts +0 -5
- package/dist/animation/demos/animation.demo.js +0 -92
- package/dist/animation/demos/animation.demo.js.map +0 -1
- package/dist/animation/demos/spring.demo.d.ts +0 -6
- package/dist/animation/demos/spring.demo.js +0 -304
- package/dist/animation/demos/spring.demo.js.map +0 -1
- package/dist/components/accordion/accordion.d.ts +0 -92
- package/dist/components/accordion/accordion.js +0 -335
- package/dist/components/accordion/accordion.js.map +0 -1
- package/dist/components/accordion/demos/card.demo.d.ts +0 -7
- package/dist/components/accordion/demos/card.demo.js +0 -59
- package/dist/components/accordion/demos/card.demo.js.map +0 -1
- package/dist/components/accordion/demos/multiple.demo.d.ts +0 -7
- package/dist/components/accordion/demos/multiple.demo.js +0 -20
- package/dist/components/accordion/demos/multiple.demo.js.map +0 -1
- package/dist/components/accordion/demos/overview.demo.d.ts +0 -7
- package/dist/components/accordion/demos/overview.demo.js +0 -20
- package/dist/components/accordion/demos/overview.demo.js.map +0 -1
- package/dist/components/anchor/anchor.js.map +0 -1
- package/dist/components/breadcrumbs/basic.demo.d.ts +0 -6
- package/dist/components/breadcrumbs/basic.demo.js +0 -15
- package/dist/components/breadcrumbs/basic.demo.js.map +0 -1
- package/dist/components/breadcrumbs/breadcrumbs.js.map +0 -1
- package/dist/components/breadcrumbs/separator.demo.d.ts +0 -6
- package/dist/components/breadcrumbs/separator.demo.js +0 -15
- package/dist/components/breadcrumbs/separator.demo.js.map +0 -1
- package/dist/components/button/button.d.ts +0 -105
- package/dist/components/button/button.js +0 -207
- package/dist/components/button/button.js.map +0 -1
- package/dist/components/button/demos/aliases.demo.d.ts +0 -7
- package/dist/components/button/demos/aliases.demo.js +0 -19
- package/dist/components/button/demos/aliases.demo.js.map +0 -1
- package/dist/components/button/demos/basic.demo.d.ts +0 -7
- package/dist/components/button/demos/basic.demo.js +0 -20
- package/dist/components/button/demos/basic.demo.js.map +0 -1
- package/dist/components/button/demos/states.demo.d.ts +0 -7
- package/dist/components/button/demos/states.demo.js +0 -30
- package/dist/components/button/demos/states.demo.js.map +0 -1
- package/dist/components/combobox/combobox.js.map +0 -1
- package/dist/components/combobox/overview.demo.d.ts +0 -7
- package/dist/components/combobox/overview.demo.js +0 -154
- package/dist/components/combobox/overview.demo.js.map +0 -1
- package/dist/components/glyph/glyph.d.ts +0 -14
- package/dist/components/glyph/glyph.js +0 -65
- package/dist/components/glyph/glyph.js.map +0 -1
- package/dist/components/listbox/listbox.js.map +0 -1
- package/dist/components/listbox/overview.demo.d.ts +0 -7
- package/dist/components/listbox/overview.demo.js +0 -65
- package/dist/components/listbox/overview.demo.js.map +0 -1
- package/dist/components/menu/demos/bubbling.demo.d.ts +0 -6
- package/dist/components/menu/demos/bubbling.demo.js +0 -16
- package/dist/components/menu/demos/bubbling.demo.js.map +0 -1
- package/dist/components/menu/demos/context-trigger.demo.d.ts +0 -7
- package/dist/components/menu/demos/context-trigger.demo.js +0 -87
- package/dist/components/menu/demos/context-trigger.demo.js.map +0 -1
- package/dist/components/menu/demos/overview.demo.d.ts +0 -7
- package/dist/components/menu/demos/overview.demo.js +0 -33
- package/dist/components/menu/demos/overview.demo.js.map +0 -1
- package/dist/components/menu/hover-aim.js.map +0 -1
- package/dist/components/menu/menu.js.map +0 -1
- package/dist/components/popover/overview.demo.d.ts +0 -7
- package/dist/components/popover/overview.demo.js +0 -65
- package/dist/components/popover/overview.demo.js.map +0 -1
- package/dist/components/popover/popover.js.map +0 -1
- package/dist/components/select/deconstructed.demo.d.ts +0 -7
- package/dist/components/select/deconstructed.demo.js +0 -54
- package/dist/components/select/deconstructed.demo.js.map +0 -1
- package/dist/components/select/overview.demo.d.ts +0 -6
- package/dist/components/select/overview.demo.js +0 -28
- package/dist/components/select/overview.demo.js.map +0 -1
- package/dist/components/select/select.js.map +0 -1
- package/dist/components/separator/separator.d.ts +0 -2
- package/dist/components/separator/separator.js +0 -15
- package/dist/components/separator/separator.js.map +0 -1
- package/dist/components/tabs/tabs.d.ts +0 -78
- package/dist/components/tabs/tabs.js +0 -339
- package/dist/components/tabs/tabs.js.map +0 -1
- package/dist/interactions/keydown/keydown.js.map +0 -1
- package/dist/interactions/outside-click/outside-click-mixin.js.map +0 -1
- package/dist/interactions/typeahead/typeahead-mixin.js.map +0 -1
- package/dist/runtime/demos/basic.demo.d.ts +0 -6
- package/dist/runtime/demos/basic.demo.js +0 -16
- package/dist/runtime/demos/basic.demo.js.map +0 -1
- package/dist/runtime/demos/controlled-uncontrolled-values.demo.d.ts +0 -6
- package/dist/runtime/demos/controlled-uncontrolled-values.demo.js +0 -77
- package/dist/runtime/demos/controlled-uncontrolled-values.demo.js.map +0 -1
- package/dist/runtime/demos/keyed-list.demo.d.ts +0 -6
- package/dist/runtime/demos/keyed-list.demo.js +0 -62
- package/dist/runtime/demos/keyed-list.demo.js.map +0 -1
- package/dist/runtime/demos/readme.demo.d.ts +0 -5
- package/dist/runtime/demos/readme.demo.js +0 -396
- package/dist/runtime/demos/readme.demo.js.map +0 -1
- package/dist/theme/contract.d.ts +0 -61
- package/dist/theme/contract.js +0 -131
- package/dist/theme/contract.js.map +0 -1
- package/dist/theme/glyph-contract.d.ts +0 -11
- package/dist/theme/glyph-contract.js +0 -34
- package/dist/theme/glyph-contract.js.map +0 -1
- package/dist/theme/presets/rmx-01/glyphs.d.ts +0 -2
- package/dist/theme/presets/rmx-01/glyphs.js +0 -252
- package/dist/theme/presets/rmx-01/glyphs.js.map +0 -1
- package/dist/theme/presets/rmx-01/index.d.ts +0 -4
- package/dist/theme/presets/rmx-01/index.js +0 -119
- package/dist/theme/presets/rmx-01/index.js.map +0 -1
- package/dist/theme/runtime.d.ts +0 -2
- package/dist/theme/runtime.js +0 -84
- package/dist/theme/runtime.js.map +0 -1
- package/dist/theme/theme.d.ts +0 -6
- package/dist/theme/theme.js +0 -5
- package/dist/theme/theme.js.map +0 -1
- package/dist/utils/flash-attribute.js.map +0 -1
- package/dist/utils/scroll-lock.d.ts +0 -3
- package/dist/utils/scroll-lock.js.map +0 -1
- package/dist/utils/wait-for-css-transition.js.map +0 -1
- package/dist/utils/wait.js.map +0 -1
- package/src/animation/demos/animation.demo.tsx +0 -194
- package/src/animation/demos/spring.demo.tsx +0 -385
- package/src/components/accordion/accordion.tsx +0 -565
- package/src/components/accordion/demos/card.demo.tsx +0 -114
- package/src/components/accordion/demos/multiple.demo.tsx +0 -57
- package/src/components/accordion/demos/overview.demo.tsx +0 -57
- package/src/components/breadcrumbs/basic.demo.tsx +0 -18
- package/src/components/breadcrumbs/separator.demo.tsx +0 -19
- package/src/components/button/README.md +0 -44
- package/src/components/button/button.tsx +0 -286
- package/src/components/button/demos/aliases.demo.tsx +0 -28
- package/src/components/button/demos/basic.demo.tsx +0 -31
- package/src/components/button/demos/states.demo.tsx +0 -53
- package/src/components/combobox/overview.demo.tsx +0 -200
- package/src/components/glyph/README.md +0 -72
- package/src/components/glyph/glyph.tsx +0 -110
- package/src/components/listbox/overview.demo.tsx +0 -102
- package/src/components/menu/demos/bubbling.demo.tsx +0 -35
- package/src/components/menu/demos/context-trigger.demo.tsx +0 -133
- package/src/components/menu/demos/overview.demo.tsx +0 -77
- package/src/components/popover/overview.demo.tsx +0 -144
- package/src/components/select/deconstructed.demo.tsx +0 -96
- package/src/components/select/overview.demo.tsx +0 -52
- package/src/components/separator/separator.ts +0 -19
- package/src/components/tabs/README.md +0 -105
- package/src/components/tabs/tabs.tsx +0 -504
- package/src/runtime/demos/basic.demo.tsx +0 -21
- package/src/runtime/demos/controlled-uncontrolled-values.demo.tsx +0 -177
- package/src/runtime/demos/keyed-list.demo.tsx +0 -94
- package/src/theme/README.md +0 -103
- package/src/theme/contract.ts +0 -215
- package/src/theme/glyph-contract.ts +0 -59
- package/src/theme/presets/rmx-01/glyphs.tsx +0 -308
- package/src/theme/presets/rmx-01/index.ts +0 -123
- package/src/theme/runtime.ts +0 -119
- package/src/theme/theme.ts +0 -15
- package/src/utils/scroll-lock/README.md +0 -33
- /package/dist/{components/anchor/anchor.d.ts → anchor/index.d.ts} +0 -0
- /package/dist/{components/breadcrumbs/breadcrumbs.d.ts → breadcrumbs/index.d.ts} +0 -0
- /package/dist/{utils → listbox}/flash-attribute.d.ts +0 -0
- /package/dist/{utils → listbox}/flash-attribute.js +0 -0
- /package/dist/{components/menu → menu}/hover-aim.d.ts +0 -0
- /package/dist/{components/menu → menu}/hover-aim.js +0 -0
- /package/dist/{interactions/outside-click/outside-click-mixin.d.ts → popover/outside-click.d.ts} +0 -0
- /package/dist/{interactions/keydown → select}/keydown.d.ts +0 -0
- /package/dist/{interactions/keydown → select}/keydown.js +0 -0
- /package/dist/{interactions/typeahead/typeahead-mixin.d.ts → shared/typeahead.d.ts} +0 -0
- /package/dist/{utils → shared}/wait-for-css-transition.d.ts +0 -0
- /package/dist/{utils → shared}/wait-for-css-transition.js +0 -0
- /package/dist/{utils → shared}/wait.d.ts +0 -0
- /package/dist/{utils → shared}/wait.js +0 -0
- /package/src/{components/anchor/anchor.ts → anchor/index.ts} +0 -0
- /package/src/{utils → listbox}/flash-attribute.ts +0 -0
- /package/src/{components/menu → menu}/hover-aim.ts +0 -0
- /package/src/{interactions/outside-click/outside-click-mixin.ts → popover/outside-click.ts} +0 -0
- /package/src/{interactions/keydown → select}/keydown.ts +0 -0
- /package/src/{interactions/typeahead/typeahead-mixin.ts → shared/typeahead.ts} +0 -0
- /package/src/{utils → shared}/wait-for-css-transition.ts +0 -0
- /package/src/{utils → shared}/wait.ts +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { createMixin, css } from '@remix-run/ui'
|
|
2
|
+
import type { CSSMixinDescriptor, ElementProps, MixinDescriptor } from '@remix-run/ui'
|
|
3
|
+
import { renderMixinElement } from '../runtime/mixins/mixin.ts'
|
|
4
|
+
import { controlFocusShadow } from '../shared/focus-styles.ts'
|
|
5
|
+
|
|
6
|
+
export { ToggleChangeEvent, onToggleChange } from '@remix-run/ui/toggle/primitives'
|
|
7
|
+
|
|
8
|
+
export type ToggleSize = 'md' | 'lg'
|
|
9
|
+
|
|
10
|
+
export interface ToggleOptions {
|
|
11
|
+
size?: ToggleSize
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type ToggleMixin = readonly [MixinDescriptor<Element, [], ElementProps>, CSSMixinDescriptor]
|
|
15
|
+
|
|
16
|
+
const checkedSelector = '&:checked, &[aria-checked="true"], &[data-state="checked"]'
|
|
17
|
+
const checkedThumbSelector =
|
|
18
|
+
'&:checked::before, &[aria-checked="true"]::before, &[data-state="checked"]::before'
|
|
19
|
+
const uncheckedThumbBackground =
|
|
20
|
+
'linear-gradient(180deg, rgba(0, 0, 0, 0) 33%, light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)) 100%), light-dark(#FFFFFF, #1a1a1a)'
|
|
21
|
+
const uncheckedThumbShadow =
|
|
22
|
+
'0 0 0 0.5px light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.12)), 0 1px 1px -0.5px rgba(0, 0, 0, 0.12), 0 2px 2px -1px rgba(0, 0, 0, 0.12), 0 4px 4px -2px rgba(0, 0, 0, 0.12), inset 0 0 2px 1px light-dark(#FFFFFF, rgba(255, 255, 255, 0.08))'
|
|
23
|
+
const checkedThumbBackground =
|
|
24
|
+
'linear-gradient(180deg, rgba(112, 199, 84, 0) 25%, rgba(112, 199, 84, 0.25) 100%), light-dark(#FFFFFF, #f5fff0)'
|
|
25
|
+
const checkedThumbShadow =
|
|
26
|
+
'0 1px 2px -0.5px rgba(66, 134, 44, 0.6), 0 2px 4px -1px rgba(66, 134, 44, 0.6), 0 4px 6px -2px rgba(66, 134, 44, 0.6), 0 0 0 0.5px light-dark(rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.28)), inset 0 0 2px 1px light-dark(#FFFFFF, rgba(255, 255, 255, 0.5))'
|
|
27
|
+
|
|
28
|
+
const toggleDefaultAttrs = createMixin<Element, [], ElementProps>((handle, hostType) => (props) => {
|
|
29
|
+
if (hostType !== 'input') {
|
|
30
|
+
return handle.element
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let type = props.type ?? 'checkbox'
|
|
34
|
+
if (type !== 'checkbox') {
|
|
35
|
+
return renderMixinElement(handle.element, {
|
|
36
|
+
...props,
|
|
37
|
+
type,
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return renderMixinElement(handle.element, {
|
|
42
|
+
...props,
|
|
43
|
+
role: props.role ?? 'switch',
|
|
44
|
+
type,
|
|
45
|
+
})
|
|
46
|
+
})()
|
|
47
|
+
|
|
48
|
+
const baseStyles = {
|
|
49
|
+
appearance: 'none',
|
|
50
|
+
WebkitAppearance: 'none',
|
|
51
|
+
margin: 0,
|
|
52
|
+
boxSizing: 'border-box',
|
|
53
|
+
position: 'relative',
|
|
54
|
+
display: 'inline-block',
|
|
55
|
+
width: 'var(--rmx-toggle-width)',
|
|
56
|
+
height: 'var(--rmx-toggle-height)',
|
|
57
|
+
minWidth: 'var(--rmx-toggle-width)',
|
|
58
|
+
minHeight: 'var(--rmx-toggle-height)',
|
|
59
|
+
padding: 0,
|
|
60
|
+
border: 0,
|
|
61
|
+
borderRadius: '9999px',
|
|
62
|
+
background:
|
|
63
|
+
'linear-gradient(180deg, light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.08)) 0%, rgba(0, 0, 0, 0) 100%), light-dark(#EBEBEB, #2c2c2c)',
|
|
64
|
+
boxShadow:
|
|
65
|
+
'inset 0 0 4px 1px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(0, 0, 0, 0.02), inset 0 2px 2px rgba(0, 0, 0, 0.02)',
|
|
66
|
+
verticalAlign: 'middle',
|
|
67
|
+
flex: 'none',
|
|
68
|
+
'&::before': {
|
|
69
|
+
content: '""',
|
|
70
|
+
position: 'absolute',
|
|
71
|
+
left: 'var(--rmx-toggle-thumb-inset)',
|
|
72
|
+
top: 'calc((var(--rmx-toggle-height) - var(--rmx-toggle-thumb-height)) / 2)',
|
|
73
|
+
width: 'var(--rmx-toggle-thumb-width)',
|
|
74
|
+
height: 'var(--rmx-toggle-thumb-height)',
|
|
75
|
+
borderRadius: '99px',
|
|
76
|
+
background: uncheckedThumbBackground,
|
|
77
|
+
boxShadow: uncheckedThumbShadow,
|
|
78
|
+
transform: 'translateX(0)',
|
|
79
|
+
transition: 'transform 160ms ease, background 160ms ease, box-shadow 160ms ease',
|
|
80
|
+
pointerEvents: 'none',
|
|
81
|
+
},
|
|
82
|
+
'&:disabled, &[aria-disabled="true"]': {
|
|
83
|
+
opacity: 0.55,
|
|
84
|
+
},
|
|
85
|
+
[checkedSelector]: {
|
|
86
|
+
background:
|
|
87
|
+
'linear-gradient(180deg, light-dark(#70C754, #8ee572) 0%, light-dark(#70C754, #8ee572) 100%)',
|
|
88
|
+
boxShadow:
|
|
89
|
+
'0 1px 0 rgba(255, 255, 255, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.4), 0 -4px 8px 2px light-dark(#FFFFFF, rgba(255, 255, 255, 0.18)), 0 4px 8px 2px rgba(0, 0, 0, 0.05), 0 0 12px 1px rgba(112, 199, 84, 0.25), inset 0 0 4px 1px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 2px 2px rgba(0, 0, 0, 0.1)',
|
|
90
|
+
},
|
|
91
|
+
[checkedThumbSelector]: {
|
|
92
|
+
background: checkedThumbBackground,
|
|
93
|
+
boxShadow: checkedThumbShadow,
|
|
94
|
+
transform: 'translateX(var(--rmx-toggle-thumb-translate-x))',
|
|
95
|
+
},
|
|
96
|
+
'&:focus-visible': {
|
|
97
|
+
outline: 0,
|
|
98
|
+
boxShadow: controlFocusShadow,
|
|
99
|
+
},
|
|
100
|
+
'@media (prefers-reduced-motion: reduce)': {
|
|
101
|
+
'&::before': {
|
|
102
|
+
transition: 'none',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const thumbTranslate =
|
|
108
|
+
'calc(var(--rmx-toggle-width) - var(--rmx-toggle-thumb-width) - (var(--rmx-toggle-thumb-inset) * 2))'
|
|
109
|
+
|
|
110
|
+
const sizeStyles = {
|
|
111
|
+
md: css({
|
|
112
|
+
'--rmx-toggle-width': '30px',
|
|
113
|
+
'--rmx-toggle-height': '18px',
|
|
114
|
+
'--rmx-toggle-thumb-width': '18px',
|
|
115
|
+
'--rmx-toggle-thumb-height': '14px',
|
|
116
|
+
'--rmx-toggle-thumb-inset': '2px',
|
|
117
|
+
'--rmx-toggle-thumb-translate-x': thumbTranslate,
|
|
118
|
+
...baseStyles,
|
|
119
|
+
}),
|
|
120
|
+
lg: css({
|
|
121
|
+
'--rmx-toggle-width': '36px',
|
|
122
|
+
'--rmx-toggle-height': '22px',
|
|
123
|
+
'--rmx-toggle-thumb-width': '22px',
|
|
124
|
+
'--rmx-toggle-thumb-height': '18px',
|
|
125
|
+
'--rmx-toggle-thumb-inset': '2px',
|
|
126
|
+
'--rmx-toggle-thumb-translate-x': thumbTranslate,
|
|
127
|
+
...baseStyles,
|
|
128
|
+
}),
|
|
129
|
+
} as const satisfies Record<ToggleSize, CSSMixinDescriptor>
|
|
130
|
+
|
|
131
|
+
export function toggle(options: ToggleOptions = {}): ToggleMixin {
|
|
132
|
+
let { size = 'md' } = options
|
|
133
|
+
return [toggleDefaultAttrs, sizeStyles[size]]
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export default toggle
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { createElement, createMixin, on, ref } from '@remix-run/ui'
|
|
2
|
+
import type { Dispatched, ElementProps, MixinFactory } from '@remix-run/ui'
|
|
3
|
+
|
|
4
|
+
export interface ToggleControlOptions {
|
|
5
|
+
checked?: boolean
|
|
6
|
+
defaultChecked?: boolean
|
|
7
|
+
disabled?: boolean
|
|
8
|
+
form?: string
|
|
9
|
+
inputRef?: (input: HTMLInputElement, signal: AbortSignal) => void
|
|
10
|
+
name?: string
|
|
11
|
+
onCheckedChange?: (checked: boolean) => void
|
|
12
|
+
readOnly?: boolean
|
|
13
|
+
required?: boolean
|
|
14
|
+
tabIndex?: number
|
|
15
|
+
value?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type ToggleChangeHandler<target extends HTMLElement> = (
|
|
19
|
+
event: Dispatched<ToggleChangeEvent, target>,
|
|
20
|
+
signal: AbortSignal,
|
|
21
|
+
) => void | Promise<void>
|
|
22
|
+
|
|
23
|
+
const TOGGLE_CHANGE_EVENT = 'rmx:toggle-change' as const
|
|
24
|
+
|
|
25
|
+
declare global {
|
|
26
|
+
interface HTMLElementEventMap {
|
|
27
|
+
[TOGGLE_CHANGE_EVENT]: ToggleChangeEvent
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class ToggleChangeEvent extends Event {
|
|
32
|
+
readonly checked: boolean
|
|
33
|
+
|
|
34
|
+
constructor(checked: boolean) {
|
|
35
|
+
super(TOGGLE_CHANGE_EVENT, { bubbles: true })
|
|
36
|
+
this.checked = checked
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getBooleanState(value: unknown): boolean | undefined {
|
|
41
|
+
return value === true || value === false ? value : undefined
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function propIsTrue(value: unknown): boolean {
|
|
45
|
+
return value === true || value === 'true' || value === ''
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function isDisabled(options: { disabled?: boolean }, props: ElementProps): boolean {
|
|
49
|
+
return (
|
|
50
|
+
options.disabled === true || propIsTrue(props.disabled) || propIsTrue(props['aria-disabled'])
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function isReadOnly(options: { readOnly?: boolean }, props: ElementProps): boolean {
|
|
55
|
+
return (
|
|
56
|
+
options.readOnly === true || propIsTrue(props.readOnly) || propIsTrue(props['aria-readonly'])
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const controlMixin: MixinFactory<HTMLElement, [options?: ToggleControlOptions], ElementProps> =
|
|
61
|
+
createMixin<HTMLElement, [options?: ToggleControlOptions], ElementProps>((handle, hostType) => {
|
|
62
|
+
let uncontrolledChecked = false
|
|
63
|
+
let hasInitialized = false
|
|
64
|
+
|
|
65
|
+
function getChecked(options: ToggleControlOptions, props: ElementProps) {
|
|
66
|
+
let optionChecked = getBooleanState(options.checked)
|
|
67
|
+
if (optionChecked !== undefined) {
|
|
68
|
+
return optionChecked
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
let propChecked = getBooleanState(props.checked)
|
|
72
|
+
if (propChecked !== undefined) {
|
|
73
|
+
return propChecked
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (!hasInitialized) {
|
|
77
|
+
uncontrolledChecked =
|
|
78
|
+
getBooleanState(options.defaultChecked) ?? getBooleanState(props.defaultChecked) ?? false
|
|
79
|
+
hasInitialized = true
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return uncontrolledChecked
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function setChecked(
|
|
86
|
+
node: HTMLElement,
|
|
87
|
+
options: ToggleControlOptions,
|
|
88
|
+
props: ElementProps,
|
|
89
|
+
nextChecked: boolean,
|
|
90
|
+
) {
|
|
91
|
+
if (isDisabled(options, props) || isReadOnly(options, props)) {
|
|
92
|
+
if (node instanceof HTMLInputElement) {
|
|
93
|
+
node.checked = getChecked(options, props)
|
|
94
|
+
}
|
|
95
|
+
return
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (options.checked === undefined && props.checked === undefined) {
|
|
99
|
+
uncontrolledChecked = nextChecked
|
|
100
|
+
void handle.update()
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
options.onCheckedChange?.(nextChecked)
|
|
104
|
+
node.dispatchEvent(new ToggleChangeEvent(nextChecked))
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return (options = {}, props) => {
|
|
108
|
+
let checked = getChecked(options, props)
|
|
109
|
+
let disabled = isDisabled(options, props)
|
|
110
|
+
let readOnly = isReadOnly(options, props)
|
|
111
|
+
let required = options.required ?? props.required
|
|
112
|
+
|
|
113
|
+
let nextProps: ElementProps = {
|
|
114
|
+
...props,
|
|
115
|
+
'aria-checked': hostType === 'input' ? undefined : checked,
|
|
116
|
+
'aria-disabled': hostType === 'input' ? undefined : disabled || undefined,
|
|
117
|
+
'aria-readonly': hostType === 'input' ? undefined : readOnly || undefined,
|
|
118
|
+
'aria-required': hostType === 'input' ? undefined : required || undefined,
|
|
119
|
+
checked: hostType === 'input' ? checked : props.checked,
|
|
120
|
+
defaultChecked: hostType === 'input' ? undefined : props.defaultChecked,
|
|
121
|
+
disabled: hostType === 'input' ? disabled || undefined : props.disabled,
|
|
122
|
+
form: hostType === 'input' ? (options.form ?? props.form) : props.form,
|
|
123
|
+
name: hostType === 'input' ? (options.name ?? props.name) : props.name,
|
|
124
|
+
readOnly: hostType === 'input' ? readOnly || undefined : props.readOnly,
|
|
125
|
+
required: hostType === 'input' ? required : props.required,
|
|
126
|
+
role: 'switch',
|
|
127
|
+
tabIndex:
|
|
128
|
+
hostType === 'input'
|
|
129
|
+
? (options.tabIndex ?? props.tabIndex)
|
|
130
|
+
: disabled
|
|
131
|
+
? undefined
|
|
132
|
+
: (options.tabIndex ?? props.tabIndex ?? 0),
|
|
133
|
+
type:
|
|
134
|
+
hostType === 'input'
|
|
135
|
+
? props.type === undefined
|
|
136
|
+
? 'checkbox'
|
|
137
|
+
: props.type
|
|
138
|
+
: hostType === 'button' && props.type === undefined
|
|
139
|
+
? 'button'
|
|
140
|
+
: props.type,
|
|
141
|
+
value: hostType === 'input' ? (options.value ?? props.value) : props.value,
|
|
142
|
+
'data-state': checked ? 'checked' : 'unchecked',
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return createElement(handle.element, {
|
|
146
|
+
...nextProps,
|
|
147
|
+
mix: [
|
|
148
|
+
ref((node: HTMLElement, signal) => {
|
|
149
|
+
if (node instanceof HTMLInputElement) {
|
|
150
|
+
options.inputRef?.(node, signal)
|
|
151
|
+
}
|
|
152
|
+
}),
|
|
153
|
+
on<HTMLElement, 'click'>('click', (event) => {
|
|
154
|
+
if (hostType !== 'input') {
|
|
155
|
+
event.preventDefault()
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (disabled || readOnly) {
|
|
159
|
+
if (event.currentTarget instanceof HTMLInputElement) {
|
|
160
|
+
event.currentTarget.checked = checked
|
|
161
|
+
}
|
|
162
|
+
return
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
let nextChecked =
|
|
166
|
+
event.currentTarget instanceof HTMLInputElement
|
|
167
|
+
? event.currentTarget.checked
|
|
168
|
+
: !checked
|
|
169
|
+
|
|
170
|
+
setChecked(event.currentTarget, options, props, nextChecked)
|
|
171
|
+
}),
|
|
172
|
+
on<HTMLElement, 'keydown'>('keydown', (event) => {
|
|
173
|
+
if (hostType === 'input' || event.key !== ' ') {
|
|
174
|
+
return
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
event.preventDefault()
|
|
178
|
+
setChecked(event.currentTarget, options, props, !checked)
|
|
179
|
+
}),
|
|
180
|
+
],
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
export const control = controlMixin
|
|
186
|
+
|
|
187
|
+
export function onToggleChange<target extends HTMLElement>(
|
|
188
|
+
handler: ToggleChangeHandler<target>,
|
|
189
|
+
captureBoolean?: boolean,
|
|
190
|
+
): ReturnType<typeof on<target, typeof TOGGLE_CHANGE_EVENT>> {
|
|
191
|
+
return on(TOGGLE_CHANGE_EVENT, handler, captureBoolean)
|
|
192
|
+
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@remix-run/ui/jsx-runtime";
|
|
2
|
-
import { css, on } from '@remix-run/ui';
|
|
3
|
-
import { DefaultAnimate } from "./default-animate.js";
|
|
4
|
-
import { EnterAnimation } from "./enter.js";
|
|
5
|
-
import { ExitAnimation } from "./exit.js";
|
|
6
|
-
import { Press } from "./press.js";
|
|
7
|
-
import { HTMLContent } from "./html-content.js";
|
|
8
|
-
import { Keyframes } from "./keyframes.js";
|
|
9
|
-
import { InterruptibleKeyframes } from "./interruptible-keyframes.js";
|
|
10
|
-
import { RollingSquare } from "./rolling-square.js";
|
|
11
|
-
import { Rotate } from "./rotate.js";
|
|
12
|
-
import { TransitionOptions } from "./transition-options.js";
|
|
13
|
-
import { Cube } from "./cube.js";
|
|
14
|
-
import { SharedLayout } from "./shared-layout.js";
|
|
15
|
-
import { AspectRatio } from "./aspect-ratio.js";
|
|
16
|
-
import { BouncySwitch } from "./bouncy-switch.js";
|
|
17
|
-
import { ColorInterpolation } from "./color-interpolation.js";
|
|
18
|
-
import { FlipToggle } from "./flip-toggle.js";
|
|
19
|
-
import { Reordering } from "./reordering.js";
|
|
20
|
-
import { MultiStateBadge } from "./multi-state-badge.js";
|
|
21
|
-
import { HoldToConfirm } from "./hold-to-confirm.js";
|
|
22
|
-
import { MaterialRipple } from "./material-ripple.js";
|
|
23
|
-
function Tile(handle) {
|
|
24
|
-
let remountKey = 0;
|
|
25
|
-
return () => {
|
|
26
|
-
let { title, children, notes } = handle.props;
|
|
27
|
-
return (_jsxs("div", { mix: [
|
|
28
|
-
css({
|
|
29
|
-
backgroundColor: 'white',
|
|
30
|
-
padding: '40px',
|
|
31
|
-
borderRadius: 12,
|
|
32
|
-
boxShadow: '0 0 10px 0 rgba(0, 0, 0, 0.1)',
|
|
33
|
-
display: 'flex',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
flexDirection: 'column',
|
|
36
|
-
gap: 12,
|
|
37
|
-
position: 'relative',
|
|
38
|
-
}),
|
|
39
|
-
], children: [_jsx("button", { mix: [
|
|
40
|
-
css({
|
|
41
|
-
position: 'absolute',
|
|
42
|
-
bottom: 8,
|
|
43
|
-
right: 8,
|
|
44
|
-
width: 18,
|
|
45
|
-
height: 18,
|
|
46
|
-
padding: 0,
|
|
47
|
-
border: 'none',
|
|
48
|
-
background: 'transparent',
|
|
49
|
-
cursor: 'pointer',
|
|
50
|
-
opacity: 0.4,
|
|
51
|
-
'&:hover': {
|
|
52
|
-
opacity: 1,
|
|
53
|
-
},
|
|
54
|
-
}),
|
|
55
|
-
on('click', () => {
|
|
56
|
-
remountKey++;
|
|
57
|
-
handle.update();
|
|
58
|
-
}),
|
|
59
|
-
], title: "Replay animation", children: _jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("path", { d: "M1 4v6h6M23 20v-6h-6" }), _jsx("path", { d: "M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15" })] }) }), _jsx("h3", { mix: [css({ margin: 0 })], children: title }), _jsx("div", { mix: [
|
|
60
|
-
css({
|
|
61
|
-
flex: 1,
|
|
62
|
-
display: 'flex',
|
|
63
|
-
alignItems: 'center',
|
|
64
|
-
justifyContent: 'center',
|
|
65
|
-
minHeight: 280,
|
|
66
|
-
}),
|
|
67
|
-
], children: children }, remountKey), notes && (_jsx("p", { mix: [
|
|
68
|
-
css({
|
|
69
|
-
margin: 0,
|
|
70
|
-
fontSize: 12,
|
|
71
|
-
color: '#666',
|
|
72
|
-
textAlign: 'center',
|
|
73
|
-
maxWidth: '200px',
|
|
74
|
-
}),
|
|
75
|
-
], children: notes }))] }));
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* @name Animation Gallery
|
|
80
|
-
* @description A collection of motion and animation experiments adapted from the standalone demos.
|
|
81
|
-
*/
|
|
82
|
-
export default function AnimationGallery() {
|
|
83
|
-
return () => (_jsxs(_Fragment, { children: [_jsx("h1", { mix: [css({ marginBottom: 0, '& + p': { marginTop: 0 } })], children: "Animations" }), _jsxs("p", { children: ["Most animations are adapted from ", _jsx("a", { href: "https://www.motion.dev", children: "Motion" }), ". Thank you for your work ", _jsx("a", { href: "https://motion.dev/@matt", children: "Matt Perry" }), "!"] }), _jsxs("div", { mix: [
|
|
84
|
-
css({
|
|
85
|
-
display: 'grid',
|
|
86
|
-
gridTemplateColumns: 'repeat(auto-fill, minmax(320px, 1fr))',
|
|
87
|
-
gap: 24,
|
|
88
|
-
marginTop: 40,
|
|
89
|
-
}),
|
|
90
|
-
], children: [_jsx(Tile, { title: "Default Animate", notes: "animateEntrance + animateLayout defaults", children: _jsx(DefaultAnimate, {}) }), _jsx(Tile, { title: "Rolling Square", notes: "CSS transition with spring() timing function", children: _jsx(RollingSquare, {}) }), _jsx(Tile, { title: "Enter Animation", notes: "animateEntrance() with spring physics", children: _jsx(EnterAnimation, {}) }), _jsx(Tile, { title: "Exit Animation", notes: "animateEntrance() + animateExit()", children: _jsx(ExitAnimation, {}) }), _jsx(Tile, { title: "Press Interaction", notes: "CSS transition + pointer/keyboard events", children: _jsx(Press, {}) }), _jsx(Tile, { title: "HTML Content", notes: "rAF loop with spring iterator for text", children: _jsx(HTMLContent, {}) }), _jsx(Tile, { title: "Keyframes", notes: "CSS @keyframes with infinite loop", children: _jsx(Keyframes, {}) }), _jsx(Tile, { title: "Interruptible Keyframes", notes: "Web Animations API with commitStyles()", children: _jsx(InterruptibleKeyframes, {}) }), _jsx(Tile, { title: "Rotate", notes: "CSS @keyframes (one-shot)", children: _jsx(Rotate, {}) }), _jsx(Tile, { title: "Transition Options", notes: "animateEntrance() with cubic-bezier + delay", children: _jsx(TransitionOptions, {}) }), _jsx(Tile, { title: "3D Cube", notes: "rAF loop with direct style manipulation", children: _jsx(Cube, {}) }), _jsx(Tile, { title: "Shared Layout", notes: "CSS Grid overlap for simultaneous enter/exit", children: _jsx(SharedLayout, {}) }), _jsx(Tile, { title: "Aspect Ratio", children: _jsx(AspectRatio, {}) }), _jsx(Tile, { title: "Bouncy Switch", notes: "Spring up, bounce down with CSS linear()", children: _jsx(BouncySwitch, {}) }), _jsx(Tile, { title: "FLIP Toggle", notes: "animateLayout() with interruptible WAAPI", children: _jsx(FlipToggle, {}) }), _jsx(Tile, { title: "Reordering", notes: "animateLayout() with auto-shuffling list", children: _jsx(Reordering, {}) }), _jsx(Tile, { title: "Color Interpolation", notes: "sRGB vs OKLCH color space", children: _jsx(ColorInterpolation, {}) }), _jsx(Tile, { title: "Multi-State Badge", notes: "Animated icon/label swap with WAAPI shake", children: _jsx(MultiStateBadge, {}) }), _jsx(Tile, { title: "Hold to Confirm", notes: "Custom interaction with progress tracking", children: _jsx(HoldToConfirm, {}) }), _jsx(Tile, { title: "Material Ripple", notes: "Pointer-tracked ripples with enter/exit animations", children: _jsx(MaterialRipple, {}) })] })] }));
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=animation.demo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"animation.demo.js","sourceRoot":"","sources":["../../../src/animation/demos/animation.demo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAA+B,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAuB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAa,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAY,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAa,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAoB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAA;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA+B,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAsB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAc,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAA0B,CAAA;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAY,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAqB,CAAA;AAClD,O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AAC,yCAAyC,YACnE,KAAC,IAAI,KAAG,GACH,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,eAAe,EAAC,KAAK,EAAC,8CAA8C,YAC9E,KAAC,YAAY,KAAG,GACX,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,cAAc,YACxB,KAAC,WAAW,KAAG,GACV,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,eAAe,EAAC,KAAK,EAAC,0CAA0C,YAC1E,KAAC,YAAY,KAAG,GACX,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,aAAa,EAAC,KAAK,EAAC,0CAA0C,YACxE,KAAC,UAAU,KAAG,GACT,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,YAAY,EAAC,KAAK,EAAC,0CAA0C,YACvE,KAAC,UAAU,KAAG,GACT,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,qBAAqB,EAAC,KAAK,EAAC,2BAA2B,YACjE,KAAC,kBAAkB,KAAG,GACjB,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,mBAAmB,EAAC,KAAK,EAAC,2CAA2C,YAC/E,KAAC,eAAe,KAAG,GACd,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,iBAAiB,EAAC,KAAK,EAAC,2CAA2C,YAC7E,KAAC,aAAa,KAAG,GACZ,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,iBAAiB,EAAC,KAAK,EAAC,oDAAoD,YACtF,KAAC,cAAc,KAAG,GACb,IACH,IACL,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type Handle } from '@remix-run/ui';
|
|
2
|
-
/**
|
|
3
|
-
* @name Spring Drag Release
|
|
4
|
-
* @description A full-screen spring physics playground with click targets and drag-release velocity.
|
|
5
|
-
*/
|
|
6
|
-
export default function SpringDemo(handle: Handle): () => import("@remix-run/ui").RemixElement;
|