@remix-run/ui 0.2.0 → 0.4.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 +50 -164
- 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.d.ts → anchor/index.d.ts} +8 -1
- package/dist/{components/anchor/anchor.js → anchor/index.js} +31 -12
- package/dist/anchor/index.js.map +1 -0
- package/dist/animation/demos/aspect-ratio.d.ts +2 -0
- package/dist/animation/demos/aspect-ratio.js +69 -0
- package/dist/animation/demos/aspect-ratio.js.map +1 -0
- package/dist/animation/demos/bouncy-switch.d.ts +2 -0
- package/dist/animation/demos/bouncy-switch.js +36 -0
- package/dist/animation/demos/bouncy-switch.js.map +1 -0
- package/dist/animation/demos/color-interpolation.d.ts +1 -0
- package/dist/animation/demos/color-interpolation.js +53 -0
- package/dist/animation/demos/color-interpolation.js.map +1 -0
- package/dist/animation/demos/cube.d.ts +2 -0
- package/dist/animation/demos/cube.js +86 -0
- package/dist/animation/demos/cube.js.map +1 -0
- package/dist/animation/demos/default-animate.d.ts +2 -0
- package/dist/animation/demos/default-animate.js +89 -0
- package/dist/animation/demos/default-animate.js.map +1 -0
- package/dist/animation/demos/drag-release.d.ts +24 -0
- package/dist/animation/demos/drag-release.js +96 -0
- package/dist/animation/demos/drag-release.js.map +1 -0
- package/dist/animation/demos/enter.d.ts +1 -0
- package/dist/animation/demos/enter.js +19 -0
- package/dist/animation/demos/enter.js.map +1 -0
- package/dist/animation/demos/exit.d.ts +2 -0
- package/dist/animation/demos/exit.js +58 -0
- package/dist/animation/demos/exit.js.map +1 -0
- package/dist/animation/demos/flip-toggle.d.ts +2 -0
- package/dist/animation/demos/flip-toggle.js +37 -0
- package/dist/animation/demos/flip-toggle.js.map +1 -0
- package/dist/animation/demos/hold-to-confirm.d.ts +13 -0
- package/dist/animation/demos/hold-to-confirm.js +211 -0
- package/dist/animation/demos/hold-to-confirm.js.map +1 -0
- package/dist/animation/demos/html-content.d.ts +2 -0
- package/dist/animation/demos/html-content.js +30 -0
- package/dist/animation/demos/html-content.js.map +1 -0
- package/dist/animation/demos/interruptible-keyframes.d.ts +1 -0
- package/dist/animation/demos/interruptible-keyframes.js +48 -0
- package/dist/animation/demos/interruptible-keyframes.js.map +1 -0
- package/dist/animation/demos/keyframes.d.ts +1 -0
- package/dist/animation/demos/keyframes.js +24 -0
- package/dist/animation/demos/keyframes.js.map +1 -0
- package/dist/animation/demos/material-ripple.d.ts +2 -0
- package/dist/animation/demos/material-ripple.js +127 -0
- package/dist/animation/demos/material-ripple.js.map +1 -0
- package/dist/animation/demos/mixin-presence-list.d.ts +2 -0
- package/dist/animation/demos/mixin-presence-list.js +88 -0
- package/dist/animation/demos/mixin-presence-list.js.map +1 -0
- package/dist/animation/demos/mixin-reclaim.d.ts +2 -0
- package/dist/animation/demos/mixin-reclaim.js +90 -0
- package/dist/animation/demos/mixin-reclaim.js.map +1 -0
- package/dist/animation/demos/multi-state-badge.d.ts +2 -0
- package/dist/animation/demos/multi-state-badge.js +231 -0
- package/dist/animation/demos/multi-state-badge.js.map +1 -0
- package/dist/animation/demos/press.d.ts +2 -0
- package/dist/animation/demos/press.js +63 -0
- package/dist/animation/demos/press.js.map +1 -0
- package/dist/animation/demos/reordering.d.ts +2 -0
- package/dist/animation/demos/reordering.js +53 -0
- package/dist/animation/demos/reordering.js.map +1 -0
- package/dist/animation/demos/rolling-square.d.ts +2 -0
- package/dist/animation/demos/rolling-square.js +42 -0
- package/dist/animation/demos/rolling-square.js.map +1 -0
- package/dist/animation/demos/rotate.d.ts +1 -0
- package/dist/animation/demos/rotate.js +18 -0
- package/dist/animation/demos/rotate.js.map +1 -0
- package/dist/animation/demos/shared-layout.d.ts +2 -0
- package/dist/animation/demos/shared-layout.js +114 -0
- package/dist/animation/demos/shared-layout.js.map +1 -0
- package/dist/animation/demos/transition-options.d.ts +1 -0
- package/dist/animation/demos/transition-options.js +21 -0
- package/dist/animation/demos/transition-options.js.map +1 -0
- package/dist/animation/spring.d.ts +22 -0
- package/dist/animation/spring.js +22 -0
- 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 +125 -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} +3 -7
- package/dist/{components/combobox/combobox.js → combobox/primitives.js} +8 -61
- package/dist/combobox/primitives.js.map +1 -0
- 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/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} +6 -32
- package/dist/{components/menu/menu.js → menu/primitives.js} +117 -279
- package/dist/menu/primitives.js.map +1 -0
- package/dist/{components/popover/popover.d.ts → popover/index.d.ts} +3 -5
- package/dist/{components/popover/popover.js → popover/index.js} +15 -51
- 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-entries.d.ts +1 -2
- package/dist/runtime/client-entries.js.map +1 -1
- package/dist/runtime/component.d.ts +2 -2
- package/dist/runtime/component.js +1 -1
- package/dist/runtime/component.js.map +1 -1
- package/dist/runtime/diff-dom.js +194 -21
- package/dist/runtime/diff-dom.js.map +1 -1
- package/dist/runtime/frame.d.ts +7 -0
- package/dist/runtime/frame.js +176 -41
- package/dist/runtime/frame.js.map +1 -1
- package/dist/runtime/jsx.d.ts +2 -3
- package/dist/runtime/jsx.js.map +1 -1
- package/dist/runtime/reconcile.js +11 -5
- package/dist/runtime/reconcile.js.map +1 -1
- package/dist/runtime/vdom.js +3 -0
- package/dist/runtime/vdom.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} +4 -6
- package/dist/{components/select/select.js → select/primitives.js} +12 -64
- package/dist/select/primitives.js.map +1 -0
- package/dist/server/stream.js +5 -4
- 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/{theme/presets/rmx-01/index.js → shared/style-values.js} +3 -34
- 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/style.js +27 -10
- package/dist/style/style.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/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 +74 -45
- 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 +48 -5
- package/src/{components/anchor/anchor.ts → anchor/index.ts} +53 -12
- package/src/animation/demos/aspect-ratio.tsx +120 -0
- package/src/animation/demos/bouncy-switch.tsx +47 -0
- package/src/animation/demos/color-interpolation.tsx +73 -0
- package/src/animation/demos/cube.tsx +116 -0
- package/src/animation/demos/default-animate.tsx +129 -0
- package/src/animation/demos/drag-release.ts +118 -0
- package/src/animation/demos/enter.tsx +22 -0
- package/src/animation/demos/exit.tsx +79 -0
- package/src/animation/demos/flip-toggle.tsx +46 -0
- package/src/animation/demos/hold-to-confirm.tsx +317 -0
- package/src/animation/demos/html-content.tsx +41 -0
- package/src/animation/demos/interruptible-keyframes.tsx +62 -0
- package/src/animation/demos/keyframes.tsx +29 -0
- package/src/animation/demos/material-ripple.tsx +158 -0
- package/src/animation/demos/mixin-presence-list.tsx +121 -0
- package/src/animation/demos/mixin-reclaim.tsx +125 -0
- package/src/animation/demos/multi-state-badge.tsx +426 -0
- package/src/animation/demos/press.tsx +67 -0
- package/src/animation/demos/reordering.tsx +68 -0
- package/src/animation/demos/rolling-square.tsx +57 -0
- package/src/animation/demos/rotate.tsx +21 -0
- package/src/animation/demos/shared-layout.tsx +211 -0
- package/src/animation/demos/transition-options.tsx +24 -0
- package/src/animation/spring.ts +22 -0
- 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 +162 -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/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/menu/README.md +161 -0
- package/src/menu/index.tsx +354 -0
- package/src/{components/menu/menu.tsx → menu/primitives.tsx} +117 -359
- package/src/{components/popover → popover}/README.md +20 -39
- package/src/{components/popover/popover.ts → popover/index.ts} +16 -61
- package/src/{utils → popover}/scroll-lock.ts +0 -28
- package/src/radio/README.md +53 -0
- package/src/radio/index.ts +100 -0
- package/src/runtime/client-entries.ts +1 -5
- package/src/runtime/component.ts +3 -3
- package/src/runtime/demos/readme.demo.tsx +704 -0
- package/src/runtime/diff-dom.ts +270 -20
- package/src/runtime/frame.ts +218 -41
- package/src/runtime/jsx.ts +6 -10
- package/src/runtime/reconcile.ts +11 -5
- package/src/runtime/vdom.ts +3 -0
- 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} +11 -99
- package/src/server/stream.ts +10 -5
- 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 +29 -10
- package/src/tabs/README.md +141 -0
- package/src/tabs/index.tsx +244 -0
- package/src/tabs/primitives.ts +365 -0
- package/src/toggle/README.md +56 -0
- package/src/toggle/index.tsx +134 -0
- package/src/toggle/primitives.ts +192 -0
- 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 -6
- package/dist/components/accordion/demos/card.demo.js +0 -58
- package/dist/components/accordion/demos/card.demo.js.map +0 -1
- package/dist/components/accordion/demos/multiple.demo.d.ts +0 -6
- package/dist/components/accordion/demos/multiple.demo.js +0 -19
- package/dist/components/accordion/demos/multiple.demo.js.map +0 -1
- package/dist/components/accordion/demos/overview.demo.d.ts +0 -6
- package/dist/components/accordion/demos/overview.demo.js +0 -19
- package/dist/components/accordion/demos/overview.demo.js.map +0 -1
- package/dist/components/anchor/anchor.js.map +0 -1
- package/dist/components/breadcrumbs/breadcrumbs.js.map +0 -1
- package/dist/components/breadcrumbs/demos/basic.demo.d.ts +0 -5
- package/dist/components/breadcrumbs/demos/basic.demo.js +0 -14
- package/dist/components/breadcrumbs/demos/basic.demo.js.map +0 -1
- package/dist/components/breadcrumbs/demos/separator.demo.d.ts +0 -5
- package/dist/components/breadcrumbs/demos/separator.demo.js +0 -14
- package/dist/components/breadcrumbs/demos/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 -6
- package/dist/components/button/demos/aliases.demo.js +0 -18
- package/dist/components/button/demos/aliases.demo.js.map +0 -1
- package/dist/components/button/demos/basic.demo.d.ts +0 -6
- package/dist/components/button/demos/basic.demo.js +0 -19
- package/dist/components/button/demos/basic.demo.js.map +0 -1
- package/dist/components/button/demos/states.demo.d.ts +0 -6
- package/dist/components/button/demos/states.demo.js +0 -29
- package/dist/components/button/demos/states.demo.js.map +0 -1
- package/dist/components/combobox/combobox.js.map +0 -1
- package/dist/components/combobox/demos/overview.demo.d.ts +0 -6
- package/dist/components/combobox/demos/overview.demo.js +0 -153
- package/dist/components/combobox/demos/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/demos/overview.demo.d.ts +0 -6
- package/dist/components/listbox/demos/overview.demo.js +0 -64
- package/dist/components/listbox/demos/overview.demo.js.map +0 -1
- package/dist/components/listbox/listbox.js.map +0 -1
- package/dist/components/menu/demos/bubbling.demo.d.ts +0 -5
- package/dist/components/menu/demos/bubbling.demo.js +0 -15
- package/dist/components/menu/demos/bubbling.demo.js.map +0 -1
- package/dist/components/menu/demos/overview.demo.d.ts +0 -6
- package/dist/components/menu/demos/overview.demo.js +0 -32
- 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/demos/overview.demo.d.ts +0 -6
- package/dist/components/popover/demos/overview.demo.js +0 -64
- package/dist/components/popover/demos/overview.demo.js.map +0 -1
- package/dist/components/popover/popover.js.map +0 -1
- package/dist/components/select/demos/deconstructed.demo.d.ts +0 -6
- package/dist/components/select/demos/deconstructed.demo.js +0 -53
- package/dist/components/select/demos/deconstructed.demo.js.map +0 -1
- package/dist/components/select/demos/overview.demo.d.ts +0 -5
- package/dist/components/select/demos/overview.demo.js +0 -27
- package/dist/components/select/demos/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/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.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/components/accordion/accordion.tsx +0 -565
- package/src/components/accordion/demos/card.demo.tsx +0 -113
- package/src/components/accordion/demos/multiple.demo.tsx +0 -56
- package/src/components/accordion/demos/overview.demo.tsx +0 -56
- package/src/components/breadcrumbs/demos/basic.demo.tsx +0 -17
- package/src/components/breadcrumbs/demos/separator.demo.tsx +0 -18
- 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 -27
- package/src/components/button/demos/basic.demo.tsx +0 -30
- package/src/components/button/demos/states.demo.tsx +0 -52
- package/src/components/combobox/demos/overview.demo.tsx +0 -199
- package/src/components/glyph/README.md +0 -72
- package/src/components/glyph/glyph.tsx +0 -110
- package/src/components/listbox/demos/overview.demo.tsx +0 -101
- package/src/components/menu/README.md +0 -96
- package/src/components/menu/demos/bubbling.demo.tsx +0 -34
- package/src/components/menu/demos/overview.demo.tsx +0 -76
- package/src/components/popover/demos/overview.demo.tsx +0 -143
- package/src/components/select/demos/deconstructed.demo.tsx +0 -95
- package/src/components/select/demos/overview.demo.tsx +0 -51
- 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/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/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/{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,67 @@
|
|
|
1
|
+
import { createMixin, css, on, type Handle } from '@remix-run/ui'
|
|
2
|
+
import { spring } from '@remix-run/ui/animation'
|
|
3
|
+
|
|
4
|
+
export function Press(handle: Handle) {
|
|
5
|
+
let pressed = false
|
|
6
|
+
|
|
7
|
+
function setPressed(nextPressed: boolean) {
|
|
8
|
+
if (pressed === nextPressed) return
|
|
9
|
+
pressed = nextPressed
|
|
10
|
+
handle.update()
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return () => (
|
|
14
|
+
<div
|
|
15
|
+
tabIndex={0}
|
|
16
|
+
mix={[
|
|
17
|
+
css({
|
|
18
|
+
width: 100,
|
|
19
|
+
height: 100,
|
|
20
|
+
backgroundColor: '#9911ff',
|
|
21
|
+
borderRadius: 5,
|
|
22
|
+
transition: `transform ${spring()}`,
|
|
23
|
+
'&:focus': {
|
|
24
|
+
outline: '4px solid rgba(0,120,255,0.7)',
|
|
25
|
+
outlineOffset: 1,
|
|
26
|
+
},
|
|
27
|
+
'&:hover, &:focus': {
|
|
28
|
+
transform: pressed ? 'scale(0.8)' : 'scale(1.2)',
|
|
29
|
+
},
|
|
30
|
+
// or use default browser :active but lose keyboard "down" press states
|
|
31
|
+
// '&:active': {
|
|
32
|
+
// transform: 'scale(0.8)',
|
|
33
|
+
// },
|
|
34
|
+
}),
|
|
35
|
+
onPressDown(() => {
|
|
36
|
+
setPressed(true)
|
|
37
|
+
}),
|
|
38
|
+
onPressUp(() => {
|
|
39
|
+
setPressed(false)
|
|
40
|
+
}),
|
|
41
|
+
]}
|
|
42
|
+
/>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const onPressDown = createMixin<HTMLElement, [handler: () => void]>(() => (handler) => [
|
|
47
|
+
on('pointerdown', (event) => {
|
|
48
|
+
if (event.isPrimary === false) return
|
|
49
|
+
handler()
|
|
50
|
+
}),
|
|
51
|
+
on('keydown', (event) => {
|
|
52
|
+
if (!(event.key === 'Enter' || event.key === ' ') || event.repeat) return
|
|
53
|
+
event.preventDefault()
|
|
54
|
+
handler()
|
|
55
|
+
}),
|
|
56
|
+
])
|
|
57
|
+
|
|
58
|
+
const onPressUp = createMixin<HTMLElement, [handler: () => void]>(() => (handler) => [
|
|
59
|
+
on('pointerup', handler),
|
|
60
|
+
on('pointerleave', handler),
|
|
61
|
+
on('keyup', (event) => {
|
|
62
|
+
if (!(event.key === 'Enter' || event.key === ' ')) return
|
|
63
|
+
event.preventDefault()
|
|
64
|
+
handler()
|
|
65
|
+
}),
|
|
66
|
+
on('blur', handler),
|
|
67
|
+
])
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { css, type Handle } from '@remix-run/ui'
|
|
2
|
+
import { animateLayout, spring } from '@remix-run/ui/animation'
|
|
3
|
+
|
|
4
|
+
const initialOrder = ['#ff0088', '#dd00ee', '#9911ff', '#0d63f8']
|
|
5
|
+
|
|
6
|
+
function shuffle<T>(array: T[]): T[] {
|
|
7
|
+
let result = [...array]
|
|
8
|
+
for (let i = result.length - 1; i > 0; i--) {
|
|
9
|
+
let j = Math.floor(Math.random() * (i + 1))
|
|
10
|
+
;[result[i], result[j]] = [result[j], result[i]]
|
|
11
|
+
}
|
|
12
|
+
return result
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function Reordering(handle: Handle) {
|
|
16
|
+
let order = initialOrder
|
|
17
|
+
|
|
18
|
+
function scheduleNextShuffle(signal: AbortSignal) {
|
|
19
|
+
let timeoutId = setTimeout(async () => {
|
|
20
|
+
if (signal.aborted) return
|
|
21
|
+
order = shuffle(order)
|
|
22
|
+
let nextSignal = await handle.update()
|
|
23
|
+
if (nextSignal.aborted) return
|
|
24
|
+
scheduleNextShuffle(nextSignal)
|
|
25
|
+
}, 1000)
|
|
26
|
+
|
|
27
|
+
signal.addEventListener('abort', () => clearTimeout(timeoutId), { once: true })
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
handle.queueTask(scheduleNextShuffle)
|
|
31
|
+
|
|
32
|
+
return () => (
|
|
33
|
+
<ul
|
|
34
|
+
mix={[
|
|
35
|
+
css({
|
|
36
|
+
listStyle: 'none',
|
|
37
|
+
padding: 0,
|
|
38
|
+
margin: 0,
|
|
39
|
+
position: 'relative',
|
|
40
|
+
display: 'flex',
|
|
41
|
+
flexWrap: 'wrap',
|
|
42
|
+
gap: 10,
|
|
43
|
+
width: 220,
|
|
44
|
+
flexDirection: 'row',
|
|
45
|
+
justifyContent: 'center',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
}),
|
|
48
|
+
]}
|
|
49
|
+
>
|
|
50
|
+
{order.map((backgroundColor) => (
|
|
51
|
+
<li
|
|
52
|
+
key={backgroundColor}
|
|
53
|
+
mix={[
|
|
54
|
+
css({
|
|
55
|
+
width: 100,
|
|
56
|
+
height: 100,
|
|
57
|
+
borderRadius: 10,
|
|
58
|
+
}),
|
|
59
|
+
animateLayout({
|
|
60
|
+
...spring({ duration: 600, bounce: 0.2 }),
|
|
61
|
+
}),
|
|
62
|
+
]}
|
|
63
|
+
style={{ backgroundColor }}
|
|
64
|
+
/>
|
|
65
|
+
))}
|
|
66
|
+
</ul>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type Handle } from '@remix-run/ui'
|
|
2
|
+
import { css, on } from '@remix-run/ui'
|
|
3
|
+
|
|
4
|
+
import { spring } from '@remix-run/ui/animation'
|
|
5
|
+
|
|
6
|
+
export function RollingSquare(handle: Handle) {
|
|
7
|
+
let toggled = false
|
|
8
|
+
|
|
9
|
+
return () => (
|
|
10
|
+
<div
|
|
11
|
+
mix={[
|
|
12
|
+
css({
|
|
13
|
+
display: 'flex',
|
|
14
|
+
flexDirection: 'column',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
gap: '20px',
|
|
18
|
+
minWidth: '300px',
|
|
19
|
+
}),
|
|
20
|
+
]}
|
|
21
|
+
>
|
|
22
|
+
<div
|
|
23
|
+
mix={[
|
|
24
|
+
css({
|
|
25
|
+
width: '80px',
|
|
26
|
+
height: '80px',
|
|
27
|
+
backgroundColor: '#8df0cc',
|
|
28
|
+
borderRadius: '10px',
|
|
29
|
+
transition: `transform ${spring({ duration: 500, bounce: 0.5 })}`,
|
|
30
|
+
}),
|
|
31
|
+
]}
|
|
32
|
+
style={{
|
|
33
|
+
transform: toggled ? 'translateX(100%) rotate(180deg)' : 'translateX(-100%)',
|
|
34
|
+
}}
|
|
35
|
+
/>
|
|
36
|
+
<button
|
|
37
|
+
mix={[
|
|
38
|
+
css({
|
|
39
|
+
backgroundColor: '#8df0cc',
|
|
40
|
+
color: '#0f1115',
|
|
41
|
+
borderRadius: '5px',
|
|
42
|
+
padding: '10px',
|
|
43
|
+
margin: '10px',
|
|
44
|
+
border: 'none',
|
|
45
|
+
cursor: 'pointer',
|
|
46
|
+
}),
|
|
47
|
+
on('click', () => {
|
|
48
|
+
toggled = !toggled
|
|
49
|
+
handle.update()
|
|
50
|
+
}),
|
|
51
|
+
]}
|
|
52
|
+
>
|
|
53
|
+
Toggle position
|
|
54
|
+
</button>
|
|
55
|
+
</div>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { css } from '@remix-run/ui'
|
|
2
|
+
|
|
3
|
+
export function Rotate() {
|
|
4
|
+
return () => (
|
|
5
|
+
<div
|
|
6
|
+
mix={[
|
|
7
|
+
css({
|
|
8
|
+
width: 100,
|
|
9
|
+
height: 100,
|
|
10
|
+
backgroundColor: '#ff0088',
|
|
11
|
+
borderRadius: 5,
|
|
12
|
+
'@keyframes rotate-demo': {
|
|
13
|
+
'0%': { transform: 'rotate(0deg)' },
|
|
14
|
+
'100%': { transform: 'rotate(360deg)' },
|
|
15
|
+
},
|
|
16
|
+
animation: `rotate-demo 1s ease-in-out 1`,
|
|
17
|
+
}),
|
|
18
|
+
]}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { css, on, type Handle, type RemixNode } from '@remix-run/ui'
|
|
2
|
+
import { animateEntrance, animateExit } from '@remix-run/ui/animation'
|
|
3
|
+
|
|
4
|
+
const ease = 'cubic-bezier(0.26, 0.02, 0.23, 0.94)'
|
|
5
|
+
|
|
6
|
+
function OverlapExample(handle: Handle<{ state: boolean }>) {
|
|
7
|
+
let shouldAnimate = false
|
|
8
|
+
handle.queueTask(() => {
|
|
9
|
+
shouldAnimate = true
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
return () => {
|
|
13
|
+
let { state } = handle.props
|
|
14
|
+
let animationMix = [
|
|
15
|
+
animateExit({
|
|
16
|
+
opacity: 0,
|
|
17
|
+
transform: 'scale(0.8)',
|
|
18
|
+
duration: 300,
|
|
19
|
+
easing: ease,
|
|
20
|
+
}),
|
|
21
|
+
]
|
|
22
|
+
if (shouldAnimate) {
|
|
23
|
+
animationMix.unshift(
|
|
24
|
+
animateEntrance({
|
|
25
|
+
opacity: 0,
|
|
26
|
+
transform: 'scale(0.6)',
|
|
27
|
+
duration: 300,
|
|
28
|
+
easing: ease,
|
|
29
|
+
}),
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
// grid layout so children render in the same position
|
|
36
|
+
mix={[css({ display: 'grid', width: 80, height: 80, '& > *': { gridArea: '1 / 1' } })]}
|
|
37
|
+
>
|
|
38
|
+
{state ? (
|
|
39
|
+
<div key="filled" mix={animationMix}>
|
|
40
|
+
<Circle filled>
|
|
41
|
+
<FilledIcon />
|
|
42
|
+
</Circle>
|
|
43
|
+
</div>
|
|
44
|
+
) : (
|
|
45
|
+
<div key="outline" mix={animationMix}>
|
|
46
|
+
<Circle>
|
|
47
|
+
<OutlineIcon />
|
|
48
|
+
</Circle>
|
|
49
|
+
</div>
|
|
50
|
+
)}
|
|
51
|
+
</div>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function WaitExample(handle: Handle<{ state: boolean }>) {
|
|
57
|
+
let shouldAnimate = false
|
|
58
|
+
handle.queueTask(() => {
|
|
59
|
+
shouldAnimate = true
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
return () => {
|
|
63
|
+
let { state } = handle.props
|
|
64
|
+
let animationMix = [
|
|
65
|
+
animateExit({
|
|
66
|
+
opacity: 0,
|
|
67
|
+
transform: 'scale(0.8)',
|
|
68
|
+
duration: 300,
|
|
69
|
+
easing: ease,
|
|
70
|
+
}),
|
|
71
|
+
]
|
|
72
|
+
if (shouldAnimate) {
|
|
73
|
+
animationMix.unshift(
|
|
74
|
+
animateEntrance({
|
|
75
|
+
opacity: 0,
|
|
76
|
+
transform: 'scale(0.6)',
|
|
77
|
+
duration: 300,
|
|
78
|
+
easing: ease,
|
|
79
|
+
delay: 300,
|
|
80
|
+
}),
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<div
|
|
86
|
+
// grid layout so children render in the same position
|
|
87
|
+
mix={[css({ display: 'grid', width: 80, height: 80, '& > *': { gridArea: '1 / 1' } })]}
|
|
88
|
+
>
|
|
89
|
+
{state ? (
|
|
90
|
+
<div key="filled" mix={animationMix}>
|
|
91
|
+
<Circle filled>
|
|
92
|
+
<FilledIcon />
|
|
93
|
+
</Circle>
|
|
94
|
+
</div>
|
|
95
|
+
) : (
|
|
96
|
+
<div key="outline" mix={animationMix}>
|
|
97
|
+
<Circle>
|
|
98
|
+
<OutlineIcon />
|
|
99
|
+
</Circle>
|
|
100
|
+
</div>
|
|
101
|
+
)}
|
|
102
|
+
</div>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function SharedLayout(handle: Handle) {
|
|
108
|
+
let state = true
|
|
109
|
+
|
|
110
|
+
return () => (
|
|
111
|
+
<div
|
|
112
|
+
mix={[
|
|
113
|
+
css({
|
|
114
|
+
display: 'flex',
|
|
115
|
+
flexDirection: 'column',
|
|
116
|
+
alignItems: 'center',
|
|
117
|
+
gap: 16,
|
|
118
|
+
}),
|
|
119
|
+
]}
|
|
120
|
+
>
|
|
121
|
+
<div mix={[css({ display: 'flex', gap: 16 })]}>
|
|
122
|
+
<OverlapExample state={state} />
|
|
123
|
+
<WaitExample state={state} />
|
|
124
|
+
</div>
|
|
125
|
+
<button
|
|
126
|
+
mix={[
|
|
127
|
+
css({
|
|
128
|
+
backgroundColor: '#0f1115',
|
|
129
|
+
color: '#f5f5f5',
|
|
130
|
+
border: 'none',
|
|
131
|
+
borderRadius: 8,
|
|
132
|
+
padding: '12px 32px',
|
|
133
|
+
fontSize: 14,
|
|
134
|
+
fontWeight: 500,
|
|
135
|
+
cursor: 'pointer',
|
|
136
|
+
transition: 'transform 100ms ease-in-out',
|
|
137
|
+
'&:active': {
|
|
138
|
+
transform: 'scale(0.95)',
|
|
139
|
+
},
|
|
140
|
+
}),
|
|
141
|
+
on('click', () => {
|
|
142
|
+
state = !state
|
|
143
|
+
handle.update()
|
|
144
|
+
}),
|
|
145
|
+
]}
|
|
146
|
+
>
|
|
147
|
+
Switch
|
|
148
|
+
</button>
|
|
149
|
+
</div>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function Circle(handle: Handle<{ filled?: boolean; children: RemixNode }>) {
|
|
154
|
+
return () => (
|
|
155
|
+
<div
|
|
156
|
+
mix={[
|
|
157
|
+
css({
|
|
158
|
+
width: 80,
|
|
159
|
+
height: 80,
|
|
160
|
+
borderRadius: '50%',
|
|
161
|
+
display: 'flex',
|
|
162
|
+
alignItems: 'center',
|
|
163
|
+
justifyContent: 'center',
|
|
164
|
+
boxSizing: 'border-box',
|
|
165
|
+
backgroundColor: handle.props.filled ? '#0f1115' : 'transparent',
|
|
166
|
+
color: handle.props.filled ? '#f5f5f5' : '#0f1115',
|
|
167
|
+
border: handle.props.filled ? '2px solid #0f1115' : '2px solid #0f1115',
|
|
168
|
+
}),
|
|
169
|
+
]}
|
|
170
|
+
>
|
|
171
|
+
{handle.props.children}
|
|
172
|
+
</div>
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function FilledIcon() {
|
|
177
|
+
return () => (
|
|
178
|
+
<svg
|
|
179
|
+
width="24"
|
|
180
|
+
height="24"
|
|
181
|
+
viewBox="0 0 24 24"
|
|
182
|
+
fill="none"
|
|
183
|
+
stroke="currentColor"
|
|
184
|
+
strokeWidth="2"
|
|
185
|
+
strokeLinecap="round"
|
|
186
|
+
strokeLinejoin="round"
|
|
187
|
+
>
|
|
188
|
+
<path d="M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6" />
|
|
189
|
+
<path d="m21 3-9 9" />
|
|
190
|
+
<path d="M15 3h6v6" />
|
|
191
|
+
</svg>
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function OutlineIcon() {
|
|
196
|
+
return () => (
|
|
197
|
+
<svg
|
|
198
|
+
width="24"
|
|
199
|
+
height="24"
|
|
200
|
+
viewBox="0 0 24 24"
|
|
201
|
+
fill="none"
|
|
202
|
+
stroke="currentColor"
|
|
203
|
+
strokeWidth="2"
|
|
204
|
+
strokeLinecap="round"
|
|
205
|
+
strokeLinejoin="round"
|
|
206
|
+
>
|
|
207
|
+
<rect x="3" y="3" width="18" height="18" rx="2" />
|
|
208
|
+
<path d="M9 12h6" />
|
|
209
|
+
</svg>
|
|
210
|
+
)
|
|
211
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { css } from '@remix-run/ui'
|
|
2
|
+
import { animateEntrance } from '@remix-run/ui/animation'
|
|
3
|
+
|
|
4
|
+
export function TransitionOptions() {
|
|
5
|
+
return () => (
|
|
6
|
+
<div
|
|
7
|
+
mix={[
|
|
8
|
+
css({
|
|
9
|
+
width: 100,
|
|
10
|
+
height: 100,
|
|
11
|
+
borderRadius: '50%',
|
|
12
|
+
backgroundColor: '#9911ff',
|
|
13
|
+
}),
|
|
14
|
+
animateEntrance({
|
|
15
|
+
opacity: 0,
|
|
16
|
+
transform: 'scale(0.5)',
|
|
17
|
+
duration: 800,
|
|
18
|
+
delay: 500,
|
|
19
|
+
easing: 'cubic-bezier(0, 0.71, 0.2, 1.01)',
|
|
20
|
+
}),
|
|
21
|
+
]}
|
|
22
|
+
/>
|
|
23
|
+
)
|
|
24
|
+
}
|
package/src/animation/spring.ts
CHANGED
|
@@ -144,6 +144,28 @@ function transition(
|
|
|
144
144
|
return properties.map((p) => `${p} ${s}`).join(', ')
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
/**
|
|
148
|
+
* Create a spring-physics animation iterator for CSS transitions and WAAPI.
|
|
149
|
+
*
|
|
150
|
+
* The returned iterator can be:
|
|
151
|
+
* - Iterated to get position values (0→1)
|
|
152
|
+
* - Spread into WAAPI options: `element.animate(keyframes, { ...spring() })`
|
|
153
|
+
* - Stringified for CSS: `` `transform ${spring()}` ``
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* // Named preset
|
|
157
|
+
* let s = spring('bouncy')
|
|
158
|
+
* element.style.transition = `transform ${s}`
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* // Custom parameters
|
|
162
|
+
* let s = spring({ duration: 500, bounce: 0.2 })
|
|
163
|
+
* element.animate(keyframes, { ...s })
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* // Transition helper for multiple properties
|
|
167
|
+
* element.style.transition = spring.transition(['transform', 'opacity'], 'snappy')
|
|
168
|
+
*/
|
|
147
169
|
export const spring: SpringFunction = Object.assign(createSpring, {
|
|
148
170
|
transition,
|
|
149
171
|
presets,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`Breadcrumbs` renders semantic breadcrumb navigation from a list of items. Use it when the page needs a compact path back through parent sections.
|
|
4
4
|
|
|
5
|
-
## Usage
|
|
5
|
+
## Component Usage
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
8
|
import { Breadcrumbs } from 'remix/ui/breadcrumbs'
|
|
@@ -32,13 +32,13 @@ Mark an earlier item as current when the page belongs to a parent section but th
|
|
|
32
32
|
/>
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Pass `separator` to replace the default chevron
|
|
35
|
+
Pass `separator` to replace the default chevron icon.
|
|
36
36
|
|
|
37
37
|
```tsx
|
|
38
38
|
<Breadcrumbs items={[{ href: '/', label: 'Home' }, { label: 'Breadcrumbs' }]} separator="/" />
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
## `breadcrumbs
|
|
41
|
+
## `remix/ui/breadcrumbs`
|
|
42
42
|
|
|
43
43
|
- `Breadcrumbs`: component that renders a `<nav>` with an ordered list of breadcrumb items.
|
|
44
44
|
- `BreadcrumbItem`: item shape with `label`, optional `href`, and optional `current`.
|
|
@@ -52,4 +52,4 @@ Pass `separator` to replace the default chevron glyph.
|
|
|
52
52
|
- An explicit current item wins over the last-item default.
|
|
53
53
|
- Current items render as text with `aria-current="page"`, even when they include `href`.
|
|
54
54
|
- Non-current items with `href` render as links; non-current items without `href` render as text.
|
|
55
|
-
- The default separator is
|
|
55
|
+
- The default separator is a chevron icon. Separators render between items and are hidden from assistive technology.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css, createElement } from '@remix-run/ui'
|
|
2
2
|
import type { Handle, Props, RemixNode } from '@remix-run/ui'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { ChevronRightIcon } from '../shared/icons.tsx'
|
|
5
|
+
import { componentStyleValues as styles } from '../shared/style-values.ts'
|
|
6
6
|
|
|
7
7
|
export type BreadcrumbItem = {
|
|
8
8
|
current?: boolean
|
|
@@ -23,7 +23,7 @@ const listCss = css({
|
|
|
23
23
|
display: 'flex',
|
|
24
24
|
flexWrap: 'wrap',
|
|
25
25
|
alignItems: 'center',
|
|
26
|
-
gap: `${
|
|
26
|
+
gap: `${styles.space.xs} ${styles.space.sm}`,
|
|
27
27
|
minWidth: 0,
|
|
28
28
|
margin: 0,
|
|
29
29
|
padding: 0,
|
|
@@ -41,34 +41,34 @@ const separatorCss = css({
|
|
|
41
41
|
alignItems: 'center',
|
|
42
42
|
justifyContent: 'center',
|
|
43
43
|
flexShrink: 0,
|
|
44
|
-
width:
|
|
45
|
-
height:
|
|
46
|
-
color:
|
|
44
|
+
width: styles.fontSize.sm,
|
|
45
|
+
height: styles.fontSize.sm,
|
|
46
|
+
color: styles.colors.text.muted,
|
|
47
47
|
})
|
|
48
48
|
|
|
49
49
|
const linkCss = css({
|
|
50
|
-
color:
|
|
51
|
-
fontSize:
|
|
52
|
-
lineHeight:
|
|
50
|
+
color: styles.colors.text.secondary,
|
|
51
|
+
fontSize: styles.fontSize.sm,
|
|
52
|
+
lineHeight: styles.lineHeight.normal,
|
|
53
53
|
textDecoration: 'none',
|
|
54
54
|
whiteSpace: 'nowrap',
|
|
55
55
|
'&:hover': {
|
|
56
|
-
color:
|
|
56
|
+
color: styles.colors.text.primary,
|
|
57
57
|
},
|
|
58
58
|
})
|
|
59
59
|
|
|
60
60
|
const currentCss = css({
|
|
61
|
-
color:
|
|
62
|
-
fontSize:
|
|
63
|
-
lineHeight:
|
|
64
|
-
fontWeight:
|
|
61
|
+
color: styles.colors.text.primary,
|
|
62
|
+
fontSize: styles.fontSize.sm,
|
|
63
|
+
lineHeight: styles.lineHeight.normal,
|
|
64
|
+
fontWeight: styles.fontWeight.medium,
|
|
65
65
|
whiteSpace: 'nowrap',
|
|
66
66
|
})
|
|
67
67
|
|
|
68
68
|
const textCss = css({
|
|
69
|
-
color:
|
|
70
|
-
fontSize:
|
|
71
|
-
lineHeight:
|
|
69
|
+
color: styles.colors.text.secondary,
|
|
70
|
+
fontSize: styles.fontSize.sm,
|
|
71
|
+
lineHeight: styles.lineHeight.normal,
|
|
72
72
|
whiteSpace: 'nowrap',
|
|
73
73
|
})
|
|
74
74
|
|
|
@@ -80,7 +80,7 @@ export function Breadcrumbs(handle: Handle<BreadcrumbsProps>): () => RemixNode {
|
|
|
80
80
|
currentIndex = Math.max(0, items.length - 1)
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
let separatorContent = separator ?? <
|
|
83
|
+
let separatorContent = separator ?? <ChevronRightIcon />
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
86
|
<nav aria-label={ariaLabel ?? 'Breadcrumb'} {...navProps} mix={[rootCss, mix]}>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# button
|
|
2
|
+
|
|
3
|
+
`button` is a style mixin for pill-shaped action controls. It owns only button-like visual styling and the default `type="button"` behavior for native `<button>` hosts.
|
|
4
|
+
|
|
5
|
+
## Primitive Usage
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import button from 'remix/ui/button'
|
|
9
|
+
|
|
10
|
+
function Actions() {
|
|
11
|
+
return () => (
|
|
12
|
+
<div>
|
|
13
|
+
<button mix={button()}>Edit order</button>
|
|
14
|
+
<button mix={button({ size: 'lg', tone: 'primary' })}>Add product</button>
|
|
15
|
+
<button mix={button({ tone: 'ghost' })}>Cancel</button>
|
|
16
|
+
</div>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Compose app-owned styles around the primitive when a control needs local layout or state styling:
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import button from 'remix/ui/button'
|
|
25
|
+
import { toolbarButtonStyle } from './toolbar.styles'
|
|
26
|
+
|
|
27
|
+
function ToolbarAction() {
|
|
28
|
+
return () => <button mix={[toolbarButtonStyle, button({ tone: 'ghost' })]}>Archive</button>
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## `remix/ui/button`
|
|
33
|
+
|
|
34
|
+
- `button(options)`: style mixin for native buttons or button-like hosts.
|
|
35
|
+
- `ButtonOptions`: accepts `size` and `tone`.
|
|
36
|
+
- `ButtonSize`: `'md'` or `'lg'`. Defaults to `'md'`.
|
|
37
|
+
- `ButtonTone`: `'neutral'`, `'primary'`, or `'ghost'`. Defaults to `'neutral'`.
|
|
38
|
+
|
|
39
|
+
## Behavior Notes
|
|
40
|
+
|
|
41
|
+
- `button()` returns a mixin descriptor, so it composes with other mixins in the host element's `mix` prop.
|
|
42
|
+
- Native `<button>` hosts receive `type="button"` unless an explicit `type` is provided.
|
|
43
|
+
- Non-button hosts receive styling only.
|
|
44
|
+
- Disabled hosts use the shared disabled treatment through `disabled` or `aria-disabled="true"`.
|