@remix-run/ui 0.3.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.js → anchor/index.js} +1 -1
- package/dist/anchor/index.js.map +1 -0
- package/dist/animation/demos/reordering.js +9 -6
- package/dist/animation/demos/reordering.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} +3 -32
- package/dist/{components/menu/menu.js → menu/primitives.js} +97 -314
- 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/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} +11 -63
- package/dist/select/primitives.js.map +1 -0
- package/dist/server/stream.js +2 -2
- 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/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 +73 -44
- 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/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 +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/{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 +100 -0
- package/src/runtime/demos/readme.demo.tsx +16 -14
- 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} +10 -98
- package/src/server/stream.ts +3 -3
- 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/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/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.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
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { css } from '@remix-run/ui'
|
|
2
|
-
import {
|
|
3
|
-
Accordion,
|
|
4
|
-
AccordionContent,
|
|
5
|
-
AccordionItem,
|
|
6
|
-
AccordionTrigger,
|
|
7
|
-
} from '@remix-run/ui/accordion'
|
|
8
|
-
import { theme } from '@remix-run/ui/theme'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @order 2
|
|
12
|
-
* @name Accordion Multiple Open
|
|
13
|
-
* @description Multiple mode allows several sections to stay open simultaneously, useful for operational checklists and dashboards.
|
|
14
|
-
* @layout center
|
|
15
|
-
*/
|
|
16
|
-
export default function Example() {
|
|
17
|
-
return () => (
|
|
18
|
-
<Accordion defaultValue={['api', 'alerts']} type="multiple">
|
|
19
|
-
<AccordionItem value="api">
|
|
20
|
-
<AccordionTrigger>API status checks</AccordionTrigger>
|
|
21
|
-
<AccordionContent>
|
|
22
|
-
<p mix={bodyTextCss}>
|
|
23
|
-
Multiple mode works well for operational checklists and dashboards where several
|
|
24
|
-
sections often need to stay open together.
|
|
25
|
-
</p>
|
|
26
|
-
</AccordionContent>
|
|
27
|
-
</AccordionItem>
|
|
28
|
-
|
|
29
|
-
<AccordionItem disabled value="access">
|
|
30
|
-
<AccordionTrigger>Access control sync</AccordionTrigger>
|
|
31
|
-
<AccordionContent>
|
|
32
|
-
<p mix={bodyTextCss}>
|
|
33
|
-
This section is intentionally disabled to show how one unavailable item should read
|
|
34
|
-
inside an otherwise active list.
|
|
35
|
-
</p>
|
|
36
|
-
</AccordionContent>
|
|
37
|
-
</AccordionItem>
|
|
38
|
-
|
|
39
|
-
<AccordionItem value="alerts">
|
|
40
|
-
<AccordionTrigger>Alert routing</AccordionTrigger>
|
|
41
|
-
<AccordionContent>
|
|
42
|
-
<p mix={bodyTextCss}>
|
|
43
|
-
Disabled items should feel clearly unavailable without changing the overall visual model
|
|
44
|
-
of the disclosure list.
|
|
45
|
-
</p>
|
|
46
|
-
</AccordionContent>
|
|
47
|
-
</AccordionItem>
|
|
48
|
-
</Accordion>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const bodyTextCss = css({
|
|
53
|
-
margin: 0,
|
|
54
|
-
fontSize: theme.fontSize.sm,
|
|
55
|
-
lineHeight: theme.lineHeight.relaxed,
|
|
56
|
-
color: theme.colors.text.secondary,
|
|
57
|
-
})
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { css } from '@remix-run/ui'
|
|
2
|
-
import {
|
|
3
|
-
Accordion,
|
|
4
|
-
AccordionContent,
|
|
5
|
-
AccordionItem,
|
|
6
|
-
AccordionTrigger,
|
|
7
|
-
} from '@remix-run/ui/accordion'
|
|
8
|
-
import { theme } from '@remix-run/ui/theme'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @name Accordion Overview
|
|
12
|
-
* @description A single-open disclosure list that keeps settings, billing, or notification rules in one calm section.
|
|
13
|
-
* @layout center
|
|
14
|
-
* @order 1
|
|
15
|
-
*/
|
|
16
|
-
export default function Example() {
|
|
17
|
-
return () => (
|
|
18
|
-
<Accordion defaultValue="account">
|
|
19
|
-
<AccordionItem value="account">
|
|
20
|
-
<AccordionTrigger>Account defaults</AccordionTrigger>
|
|
21
|
-
<AccordionContent>
|
|
22
|
-
<p mix={bodyTextCss}>
|
|
23
|
-
Keep billing contacts, email summaries, and workspace naming rules in one calm
|
|
24
|
-
disclosure list without adding another card layer.
|
|
25
|
-
</p>
|
|
26
|
-
</AccordionContent>
|
|
27
|
-
</AccordionItem>
|
|
28
|
-
|
|
29
|
-
<AccordionItem value="billing">
|
|
30
|
-
<AccordionTrigger>Billing schedule</AccordionTrigger>
|
|
31
|
-
<AccordionContent>
|
|
32
|
-
<p mix={bodyTextCss}>
|
|
33
|
-
Review invoice timing, payment methods, and renewal reminders with the same spacing and
|
|
34
|
-
typography used elsewhere in the system.
|
|
35
|
-
</p>
|
|
36
|
-
</AccordionContent>
|
|
37
|
-
</AccordionItem>
|
|
38
|
-
|
|
39
|
-
<AccordionItem value="notifications">
|
|
40
|
-
<AccordionTrigger>Notification rules</AccordionTrigger>
|
|
41
|
-
<AccordionContent>
|
|
42
|
-
<p mix={bodyTextCss}>
|
|
43
|
-
Use single mode when only one details panel should stay open at a time in a compact
|
|
44
|
-
settings or details view.
|
|
45
|
-
</p>
|
|
46
|
-
</AccordionContent>
|
|
47
|
-
</AccordionItem>
|
|
48
|
-
</Accordion>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const bodyTextCss = css({
|
|
53
|
-
margin: 0,
|
|
54
|
-
fontSize: theme.fontSize.sm,
|
|
55
|
-
lineHeight: theme.lineHeight.relaxed,
|
|
56
|
-
color: theme.colors.text.secondary,
|
|
57
|
-
})
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Breadcrumbs } from '@remix-run/ui/breadcrumbs'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @name Breadcrumbs Basic
|
|
5
|
-
* @description A basic breadcrumb trail linking back through the page hierarchy.
|
|
6
|
-
* @layout center
|
|
7
|
-
*/
|
|
8
|
-
export default function Example() {
|
|
9
|
-
return () => (
|
|
10
|
-
<Breadcrumbs
|
|
11
|
-
items={[
|
|
12
|
-
{ href: '/', label: 'Home' },
|
|
13
|
-
{ href: '/components', label: 'Components' },
|
|
14
|
-
{ label: 'Breadcrumbs' },
|
|
15
|
-
]}
|
|
16
|
-
/>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Breadcrumbs } from '@remix-run/ui/breadcrumbs'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @name Breadcrumbs with Separator
|
|
5
|
-
* @description Pass a custom separator string to override the default chevron icon.
|
|
6
|
-
* @layout center
|
|
7
|
-
*/
|
|
8
|
-
export default function Example() {
|
|
9
|
-
return () => (
|
|
10
|
-
<Breadcrumbs
|
|
11
|
-
items={[
|
|
12
|
-
{ href: '/', label: 'Workspace' },
|
|
13
|
-
{ href: '/projects', label: 'Projects' },
|
|
14
|
-
{ label: 'RMX_01' },
|
|
15
|
-
]}
|
|
16
|
-
separator="/"
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# button
|
|
2
|
-
|
|
3
|
-
`button` is the shared button styling contract for `remix/ui`. Use `Button` for ordinary action buttons, or compose flat `button.*Style` exports directly when a higher-level control needs button structure without a wrapper.
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
```tsx
|
|
8
|
-
import { Button } from 'remix/ui/button'
|
|
9
|
-
import * as button from 'remix/ui/button'
|
|
10
|
-
import { Glyph } from 'remix/ui/glyph'
|
|
11
|
-
|
|
12
|
-
function Actions() {
|
|
13
|
-
return (
|
|
14
|
-
<div>
|
|
15
|
-
<Button startIcon={<Glyph name="add" />} tone="primary">
|
|
16
|
-
Create project
|
|
17
|
-
</Button>
|
|
18
|
-
|
|
19
|
-
<a href="/projects" mix={[button.baseStyle, button.secondaryStyle]}>
|
|
20
|
-
<span mix={button.labelStyle}>View projects</span>
|
|
21
|
-
<Glyph mix={button.iconStyle} name="chevronRight" />
|
|
22
|
-
</a>
|
|
23
|
-
</div>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## `button.*`
|
|
29
|
-
|
|
30
|
-
- `Button`: thin button wrapper for the common `base + tone + label/icon slots` case. Pass `tone`, `startIcon`, and `endIcon` when the default authored structure is enough.
|
|
31
|
-
- `button.baseStyle`: base host styling plus the default `type="button"` behavior for button elements.
|
|
32
|
-
- `button.primaryStyle`, `button.secondaryStyle`, `button.ghostStyle`, and `button.dangerStyle`: visual button treatments.
|
|
33
|
-
- `button.labelStyle`: inline label slot with the standard button spacing.
|
|
34
|
-
- `button.iconStyle`: icon slot sizing and `aria-hidden` defaults for decorative icons.
|
|
35
|
-
|
|
36
|
-
## Behavior Notes
|
|
37
|
-
|
|
38
|
-
- `button.baseStyle` only adds `type="button"` when the host element is a `<button>` and no explicit `type` was provided.
|
|
39
|
-
- `Button` renders `children` inside `button.labelStyle` and renders `startIcon` and `endIcon` inside `button.iconStyle`.
|
|
40
|
-
- Use an explicit accessible name when you render an icon-only button.
|
|
41
|
-
|
|
42
|
-
## When To Use Something Else
|
|
43
|
-
|
|
44
|
-
Use `button.*Style` exports directly when a control needs button structure plus extra behavior or layout, like `select`, `menu`, or `tabs`. Those controls own their own interaction mixins and should not hide that behavior behind `Button`.
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import { attrs, createElement, createMixin, css } from '@remix-run/ui'
|
|
2
|
-
import type {
|
|
3
|
-
CSSMixinDescriptor,
|
|
4
|
-
ElementProps,
|
|
5
|
-
Handle,
|
|
6
|
-
MixinDescriptor,
|
|
7
|
-
MixinFactory,
|
|
8
|
-
Props,
|
|
9
|
-
RemixNode,
|
|
10
|
-
} from '@remix-run/ui'
|
|
11
|
-
|
|
12
|
-
import { theme } from '../../theme/theme.ts'
|
|
13
|
-
|
|
14
|
-
const ghostButtonToneCss: CSSMixinDescriptor = css({
|
|
15
|
-
backgroundColor: 'transparent',
|
|
16
|
-
backgroundImage: 'none',
|
|
17
|
-
color: theme.colors.text.secondary,
|
|
18
|
-
border: '0.5px solid transparent',
|
|
19
|
-
boxShadow: 'none',
|
|
20
|
-
'&:hover': {
|
|
21
|
-
backgroundColor: theme.surface.lvl3,
|
|
22
|
-
color: theme.colors.text.primary,
|
|
23
|
-
},
|
|
24
|
-
'&:active': {
|
|
25
|
-
backgroundColor: `color-mix(in oklab, ${theme.surface.lvl3} 94%, black)`,
|
|
26
|
-
color: `color-mix(in oklab, ${theme.colors.text.primary} 94%, black)`,
|
|
27
|
-
},
|
|
28
|
-
'&:focus-visible': {
|
|
29
|
-
outline: `2px solid ${theme.colors.focus.ring}`,
|
|
30
|
-
outlineOffset: '2px',
|
|
31
|
-
backgroundColor: theme.surface.lvl3,
|
|
32
|
-
color: theme.colors.text.primary,
|
|
33
|
-
},
|
|
34
|
-
'&:disabled': {
|
|
35
|
-
opacity: 0.6,
|
|
36
|
-
},
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
const buttonBaseStyleCss: CSSMixinDescriptor = css({
|
|
40
|
-
'--rmx-button-label-padding-inline': theme.space.xs,
|
|
41
|
-
all: 'unset',
|
|
42
|
-
boxSizing: 'border-box',
|
|
43
|
-
cursor: 'revert',
|
|
44
|
-
position: 'relative',
|
|
45
|
-
isolation: 'isolate',
|
|
46
|
-
display: 'inline-flex',
|
|
47
|
-
alignItems: 'center',
|
|
48
|
-
justifyContent: 'center',
|
|
49
|
-
overflow: 'hidden',
|
|
50
|
-
borderRadius: theme.radius.full,
|
|
51
|
-
fontFamily: theme.fontFamily.sans,
|
|
52
|
-
minHeight: theme.control.height.sm,
|
|
53
|
-
paddingInline: theme.space.md,
|
|
54
|
-
fontSize: theme.fontSize.xs,
|
|
55
|
-
lineHeight: '1',
|
|
56
|
-
fontWeight: theme.fontWeight.medium,
|
|
57
|
-
whiteSpace: 'nowrap',
|
|
58
|
-
textDecoration: 'none',
|
|
59
|
-
userSelect: 'none',
|
|
60
|
-
WebkitUserSelect: 'none',
|
|
61
|
-
verticalAlign: 'top',
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
const buttonLabelCss: CSSMixinDescriptor = css({
|
|
65
|
-
display: 'inline-flex',
|
|
66
|
-
alignItems: 'center',
|
|
67
|
-
minWidth: 0,
|
|
68
|
-
paddingInline: 'var(--rmx-button-label-padding-inline)',
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
const buttonIconCss: CSSMixinDescriptor = css({
|
|
72
|
-
display: 'inline-flex',
|
|
73
|
-
alignItems: 'center',
|
|
74
|
-
justifyContent: 'center',
|
|
75
|
-
width: '1em',
|
|
76
|
-
height: '1em',
|
|
77
|
-
flexShrink: 0,
|
|
78
|
-
'& > svg': {
|
|
79
|
-
display: 'block',
|
|
80
|
-
width: '100%',
|
|
81
|
-
height: '100%',
|
|
82
|
-
},
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
const buttonIconAttrsCss: MixinDescriptor<Element, [Partial<ElementProps>], ElementProps> = attrs({
|
|
86
|
-
'aria-hidden': true,
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
const buttonDefaultsMixin: MixinFactory<Element, [], ElementProps> = createMixin<
|
|
90
|
-
Element,
|
|
91
|
-
[],
|
|
92
|
-
ElementProps
|
|
93
|
-
>((handle, hostType) => (props) => {
|
|
94
|
-
if (hostType !== 'button' || props.type !== undefined) {
|
|
95
|
-
return handle.element
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return createElement(handle.element as unknown as string, {
|
|
99
|
-
...props,
|
|
100
|
-
type: 'button',
|
|
101
|
-
})
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
const buttonDefaultsCss: MixinDescriptor<Element, [], ElementProps> = buttonDefaultsMixin()
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Base button styling with the default `type="button"` behavior for `<button>`
|
|
108
|
-
* hosts. Compose with a tone style (e.g. {@link primaryStyle}) when applying
|
|
109
|
-
* button styling without using the {@link Button} component.
|
|
110
|
-
*
|
|
111
|
-
* @category mixin
|
|
112
|
-
*/
|
|
113
|
-
export const baseStyle = [buttonDefaultsCss, buttonBaseStyleCss] as const
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Icon slot sizing and `aria-hidden` defaults for decorative icons rendered
|
|
117
|
-
* inside a button.
|
|
118
|
-
*
|
|
119
|
-
* @category mixin
|
|
120
|
-
*/
|
|
121
|
-
export const iconStyle = [buttonIconAttrsCss, buttonIconCss] as const
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Inline label slot with the standard button label spacing.
|
|
125
|
-
*
|
|
126
|
-
* @category mixin
|
|
127
|
-
*/
|
|
128
|
-
export const labelStyle = buttonLabelCss
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Primary visual treatment for buttons. Combine with {@link baseStyle} when
|
|
132
|
-
* styling a non-`Button` host element.
|
|
133
|
-
*
|
|
134
|
-
* @category mixin
|
|
135
|
-
*/
|
|
136
|
-
export const primaryStyle: CSSMixinDescriptor = createButtonCss(theme.colors.action.primary)
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Secondary visual treatment for buttons. Combine with {@link baseStyle} when
|
|
140
|
-
* styling a non-`Button` host element.
|
|
141
|
-
*
|
|
142
|
-
* @category mixin
|
|
143
|
-
*/
|
|
144
|
-
export const secondaryStyle: CSSMixinDescriptor = createButtonCss(theme.colors.action.secondary)
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Ghost visual treatment for buttons — transparent background with a hover
|
|
148
|
-
* surface. Combine with {@link baseStyle} when styling a non-`Button` host
|
|
149
|
-
* element.
|
|
150
|
-
*
|
|
151
|
-
* @category mixin
|
|
152
|
-
*/
|
|
153
|
-
export const ghostStyle = ghostButtonToneCss
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Danger visual treatment for destructive actions. Combine with
|
|
157
|
-
* {@link baseStyle} when styling a non-`Button` host element.
|
|
158
|
-
*
|
|
159
|
-
* @category mixin
|
|
160
|
-
*/
|
|
161
|
-
export const dangerStyle: CSSMixinDescriptor = createButtonCss(theme.colors.action.danger)
|
|
162
|
-
|
|
163
|
-
const toneStyleByTone = {
|
|
164
|
-
primary: primaryStyle,
|
|
165
|
-
secondary: secondaryStyle,
|
|
166
|
-
ghost: ghostStyle,
|
|
167
|
-
danger: dangerStyle,
|
|
168
|
-
} as const
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Visual treatment supported by {@link Button} — `'primary'`, `'secondary'`,
|
|
172
|
-
* `'ghost'`, or `'danger'`.
|
|
173
|
-
*/
|
|
174
|
-
export type ButtonTone = keyof typeof toneStyleByTone
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Props accepted by the {@link Button} component.
|
|
178
|
-
*
|
|
179
|
-
* Extends the native `<button>` element props with optional icon slots and a
|
|
180
|
-
* tone variant
|
|
181
|
-
*/
|
|
182
|
-
export type ButtonProps = Omit<Props<'button'>, 'children'> & {
|
|
183
|
-
/**
|
|
184
|
-
* Content rendered inside the button's label slot.
|
|
185
|
-
*/
|
|
186
|
-
readonly children?: RemixNode
|
|
187
|
-
/**
|
|
188
|
-
* Decorative icon rendered after the label, inside the icon slot.
|
|
189
|
-
*/
|
|
190
|
-
readonly endIcon?: RemixNode
|
|
191
|
-
/**
|
|
192
|
-
* Decorative icon rendered before the label, inside the icon slot.
|
|
193
|
-
*/
|
|
194
|
-
readonly startIcon?: RemixNode
|
|
195
|
-
/**
|
|
196
|
-
* Visual treatment to apply to the button (default `'secondary'`).
|
|
197
|
-
*/
|
|
198
|
-
readonly tone?: ButtonTone
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Renders a `<button>` with `baseStyle` and the resolved tone style, along with
|
|
203
|
-
* optional start and end icons.
|
|
204
|
-
*
|
|
205
|
-
* @param handle Component handle providing the runtime API and the resolved {@link ButtonProps}.
|
|
206
|
-
* @returns A render function for the button element.
|
|
207
|
-
*
|
|
208
|
-
* @example
|
|
209
|
-
* ```tsx
|
|
210
|
-
* import { Button } from '@remix-run/ui/button'
|
|
211
|
-
* import { Glyph } from '@remix-run/ui/glyph'
|
|
212
|
-
*
|
|
213
|
-
* <Button startIcon={<Glyph name="add" />} tone="primary">
|
|
214
|
-
* Create project
|
|
215
|
-
* </Button>
|
|
216
|
-
* ```
|
|
217
|
-
*/
|
|
218
|
-
export function Button(handle: Handle<ButtonProps>): () => RemixNode {
|
|
219
|
-
return () => {
|
|
220
|
-
let { children, endIcon, mix, startIcon, tone = 'secondary', ...buttonProps } = handle.props
|
|
221
|
-
|
|
222
|
-
return (
|
|
223
|
-
<button {...buttonProps} mix={[baseStyle, toneStyleByTone[tone], mix]}>
|
|
224
|
-
{startIcon ? <span mix={iconStyle}>{startIcon}</span> : null}
|
|
225
|
-
{children !== undefined ? <span mix={labelStyle}>{children}</span> : null}
|
|
226
|
-
{endIcon ? <span mix={iconStyle}>{endIcon}</span> : null}
|
|
227
|
-
</button>
|
|
228
|
-
)
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
function createButtonCss(buttonTheme: {
|
|
233
|
-
background: string
|
|
234
|
-
backgroundHover: string
|
|
235
|
-
backgroundActive: string
|
|
236
|
-
foreground: string
|
|
237
|
-
border: string
|
|
238
|
-
}): CSSMixinDescriptor {
|
|
239
|
-
let borderColor = createButtonBorderColor(buttonTheme.border)
|
|
240
|
-
let hoverBorderColor = createButtonBorderColor(buttonTheme.backgroundHover)
|
|
241
|
-
let activeBorderColor = createButtonBorderColor(buttonTheme.backgroundActive)
|
|
242
|
-
|
|
243
|
-
return css({
|
|
244
|
-
backgroundColor: buttonTheme.background,
|
|
245
|
-
backgroundImage: createButtonBackgroundImage(buttonTheme.background),
|
|
246
|
-
color: buttonTheme.foreground,
|
|
247
|
-
border: `0.5px solid ${borderColor}`,
|
|
248
|
-
boxShadow: `${createButtonHighlight(buttonTheme.background)}, ${theme.shadow.xs}, ${theme.shadow.sm}`,
|
|
249
|
-
'&:hover': {
|
|
250
|
-
backgroundColor: buttonTheme.backgroundHover,
|
|
251
|
-
backgroundImage: createButtonBackgroundImage(buttonTheme.backgroundHover),
|
|
252
|
-
borderColor: hoverBorderColor,
|
|
253
|
-
},
|
|
254
|
-
'&:active': {
|
|
255
|
-
backgroundColor: buttonTheme.backgroundActive,
|
|
256
|
-
backgroundImage: createButtonBackgroundImage(buttonTheme.backgroundActive),
|
|
257
|
-
borderColor: activeBorderColor,
|
|
258
|
-
boxShadow: `${createButtonHighlight(buttonTheme.backgroundActive, 0.12)}, ${theme.shadow.xs}`,
|
|
259
|
-
},
|
|
260
|
-
'&:focus-visible': {
|
|
261
|
-
outline: `2px solid ${theme.colors.focus.ring}`,
|
|
262
|
-
outlineOffset: '2px',
|
|
263
|
-
},
|
|
264
|
-
'&:disabled': {
|
|
265
|
-
opacity: 0.6,
|
|
266
|
-
cursor: 'not-allowed',
|
|
267
|
-
},
|
|
268
|
-
})
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
function createButtonBackgroundImage(background: string) {
|
|
272
|
-
return `linear-gradient(to bottom, ${createButtonHighlightColor(background, 0.18)} 0%, ${background} 100%)`
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
function createButtonBorderColor(color: string) {
|
|
276
|
-
return `color-mix(in oklab, ${color} 74%, black)`
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
function createButtonHighlight(background: string, amount = 0.16) {
|
|
280
|
-
return `inset 0 1px 0 ${createButtonHighlightColor(background, amount)}`
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
function createButtonHighlightColor(background: string, amount: number) {
|
|
284
|
-
let alpha = Math.round(amount * 100)
|
|
285
|
-
return `color-mix(in oklab, white ${alpha}%, ${background})`
|
|
286
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Button } from '@remix-run/ui/button'
|
|
2
|
-
import { css } from '@remix-run/ui'
|
|
3
|
-
import { theme } from '@remix-run/ui/theme'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @name Button Component
|
|
7
|
-
* @description The Button component wraps the low-level style primitives and accepts a tone prop for quick theming.
|
|
8
|
-
* @layout center
|
|
9
|
-
* @order 2
|
|
10
|
-
*/
|
|
11
|
-
export default function Example() {
|
|
12
|
-
return () => (
|
|
13
|
-
<div mix={buttonRowCss}>
|
|
14
|
-
<Button tone="primary" type="submit">
|
|
15
|
-
Save
|
|
16
|
-
</Button>
|
|
17
|
-
<Button tone="secondary">Secondary</Button>
|
|
18
|
-
<Button tone="ghost">Ghost</Button>
|
|
19
|
-
<Button tone="danger">Delete</Button>
|
|
20
|
-
</div>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const buttonRowCss = css({
|
|
25
|
-
display: 'flex',
|
|
26
|
-
alignItems: 'center',
|
|
27
|
-
gap: theme.space.sm,
|
|
28
|
-
})
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { css } from '@remix-run/ui'
|
|
2
|
-
import * as button from '@remix-run/ui/button'
|
|
3
|
-
import { Glyph } from '@remix-run/ui/glyph'
|
|
4
|
-
import { theme } from '@remix-run/ui/theme'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @name Basic Button
|
|
8
|
-
* @description The default button contract supports both ordinary actions and link-shaped navigation.
|
|
9
|
-
* @layout center
|
|
10
|
-
* @order 1
|
|
11
|
-
*/
|
|
12
|
-
export default function Example() {
|
|
13
|
-
return () => (
|
|
14
|
-
<div mix={buttonRowCss}>
|
|
15
|
-
<button type="submit" mix={[button.baseStyle, button.primaryStyle]}>
|
|
16
|
-
<Glyph mix={button.iconStyle} name="add" />
|
|
17
|
-
<span mix={button.labelStyle}>Publish</span>
|
|
18
|
-
</button>
|
|
19
|
-
<a href="/api/remix/ui/button/overview/" mix={[button.baseStyle, button.secondaryStyle]}>
|
|
20
|
-
<span mix={button.labelStyle}>View button docs</span>
|
|
21
|
-
<Glyph mix={button.iconStyle} name="chevronRight" />
|
|
22
|
-
</a>
|
|
23
|
-
</div>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const buttonRowCss = css({
|
|
28
|
-
display: 'flex',
|
|
29
|
-
alignItems: 'center',
|
|
30
|
-
gap: theme.space.sm,
|
|
31
|
-
})
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import * as button from '@remix-run/ui/button'
|
|
2
|
-
import { css } from '@remix-run/ui'
|
|
3
|
-
import { Glyph } from '@remix-run/ui/glyph'
|
|
4
|
-
import { theme } from '@remix-run/ui/theme'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @name Button States
|
|
8
|
-
* @description Buttons support normal, disabled, and busy (loading) states using aria attributes.
|
|
9
|
-
* @layout center
|
|
10
|
-
* @order 3
|
|
11
|
-
*/
|
|
12
|
-
export default function Example() {
|
|
13
|
-
return () => (
|
|
14
|
-
<div mix={buttonRowCss}>
|
|
15
|
-
<button mix={[button.baseStyle, button.primaryStyle]}>
|
|
16
|
-
<Glyph mix={button.iconStyle} name="add" />
|
|
17
|
-
<span mix={button.labelStyle}>New issue</span>
|
|
18
|
-
</button>
|
|
19
|
-
|
|
20
|
-
<button mix={[button.baseStyle, button.ghostStyle]}>
|
|
21
|
-
<span mix={button.labelStyle}>Open</span>
|
|
22
|
-
<Glyph mix={button.iconStyle} name="chevronRight" />
|
|
23
|
-
</button>
|
|
24
|
-
|
|
25
|
-
<button disabled mix={[button.baseStyle, button.secondaryStyle]}>
|
|
26
|
-
<span mix={button.labelStyle}>Disabled</span>
|
|
27
|
-
</button>
|
|
28
|
-
|
|
29
|
-
<button aria-busy="true" mix={[button.baseStyle, button.secondaryStyle]}>
|
|
30
|
-
<Glyph mix={[button.iconStyle, spinnerGlyphCss, spinCss]} name="spinner" />
|
|
31
|
-
<span mix={button.labelStyle}>Saving</span>
|
|
32
|
-
</button>
|
|
33
|
-
</div>
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const buttonRowCss = css({
|
|
38
|
-
display: 'flex',
|
|
39
|
-
alignItems: 'center',
|
|
40
|
-
gap: theme.space.sm,
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
const spinnerGlyphCss = css({
|
|
44
|
-
opacity: 0.72,
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
const spinCss = css({
|
|
48
|
-
'@keyframes demo-button-spin': {
|
|
49
|
-
from: { transform: 'rotate(0deg)' },
|
|
50
|
-
to: { transform: 'rotate(360deg)' },
|
|
51
|
-
},
|
|
52
|
-
animation: 'demo-button-spin 1s linear infinite',
|
|
53
|
-
})
|