aidos-ui 4.0.4 → 4.0.5
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/LICENSE +1 -1
- package/README.md +23 -3
- package/dist/index.d.ts +797 -68
- package/dist/index.js +3868 -68
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.d.ts +6 -2
- package/dist/jsx-dev-runtime.js +87 -42
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +2 -2
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/vite-plugin-jss-debug.d.ts +3 -1
- package/dist/vite-plugin-jss-debug.js +57 -74
- package/dist/vite-plugin-jss-debug.js.map +1 -1
- package/package.json +58 -27
- package/.prettierrc +0 -4
- package/CLAUDE.md +0 -72
- package/dist/Badge.d.ts +0 -6
- package/dist/Badge.js +0 -22
- package/dist/Badge.js.map +0 -1
- package/dist/BaseButton.d.ts +0 -14
- package/dist/BaseButton.js +0 -23
- package/dist/BaseButton.js.map +0 -1
- package/dist/BaseInput.d.ts +0 -14
- package/dist/BaseInput.js +0 -15
- package/dist/BaseInput.js.map +0 -1
- package/dist/BaseLink.d.ts +0 -18
- package/dist/BaseLink.js +0 -29
- package/dist/BaseLink.js.map +0 -1
- package/dist/BaseList.d.ts +0 -6
- package/dist/BaseList.js +0 -14
- package/dist/BaseList.js.map +0 -1
- package/dist/BaseListAddOn.d.ts +0 -5
- package/dist/BaseListAddOn.js +0 -7
- package/dist/BaseListAddOn.js.map +0 -1
- package/dist/BaseListItem.d.ts +0 -26
- package/dist/BaseListItem.js +0 -29
- package/dist/BaseListItem.js.map +0 -1
- package/dist/BaseView.d.ts +0 -12
- package/dist/BaseView.js +0 -26
- package/dist/BaseView.js.map +0 -1
- package/dist/Box.d.ts +0 -4
- package/dist/Box.js +0 -6
- package/dist/Box.js.map +0 -1
- package/dist/Button.d.ts +0 -20
- package/dist/Button.js +0 -19
- package/dist/Button.js.map +0 -1
- package/dist/Calendar.d.ts +0 -18
- package/dist/Calendar.js +0 -57
- package/dist/Calendar.js.map +0 -1
- package/dist/Card.d.ts +0 -4
- package/dist/Card.js +0 -14
- package/dist/Card.js.map +0 -1
- package/dist/Checkbox.d.ts +0 -11
- package/dist/Checkbox.js +0 -32
- package/dist/Checkbox.js.map +0 -1
- package/dist/Circle.d.ts +0 -5
- package/dist/Circle.js +0 -12
- package/dist/Circle.js.map +0 -1
- package/dist/Column.d.ts +0 -6
- package/dist/Column.js +0 -7
- package/dist/Column.js.map +0 -1
- package/dist/DarkMode.d.ts +0 -13
- package/dist/DarkMode.js +0 -62
- package/dist/DarkMode.js.map +0 -1
- package/dist/DateInput.d.ts +0 -13
- package/dist/DateInput.js +0 -29
- package/dist/DateInput.js.map +0 -1
- package/dist/DatePicker.d.ts +0 -11
- package/dist/DatePicker.js +0 -34
- package/dist/DatePicker.js.map +0 -1
- package/dist/DatetimeInput.d.ts +0 -13
- package/dist/DatetimeInput.js +0 -31
- package/dist/DatetimeInput.js.map +0 -1
- package/dist/DesignBook.d.ts +0 -1
- package/dist/DesignBook.js +0 -55
- package/dist/DesignBook.js.map +0 -1
- package/dist/Dialog.d.ts +0 -17
- package/dist/Dialog.js +0 -92
- package/dist/Dialog.js.map +0 -1
- package/dist/Dropdown.d.ts +0 -14
- package/dist/Dropdown.js +0 -65
- package/dist/Dropdown.js.map +0 -1
- package/dist/Emitter.d.ts +0 -6
- package/dist/Emitter.js +0 -19
- package/dist/Emitter.js.map +0 -1
- package/dist/FlexLayout.d.ts +0 -11
- package/dist/FlexLayout.js +0 -18
- package/dist/FlexLayout.js.map +0 -1
- package/dist/Icon.d.ts +0 -12
- package/dist/Icon.js +0 -60
- package/dist/Icon.js.map +0 -1
- package/dist/IconButton.d.ts +0 -11
- package/dist/IconButton.js +0 -34
- package/dist/IconButton.js.map +0 -1
- package/dist/IconLink.d.ts +0 -9
- package/dist/IconLink.js +0 -32
- package/dist/IconLink.js.map +0 -1
- package/dist/IconType.d.ts +0 -1
- package/dist/IconType.js +0 -2
- package/dist/IconType.js.map +0 -1
- package/dist/Interactable.d.ts +0 -50
- package/dist/Interactable.js +0 -169
- package/dist/Interactable.js.map +0 -1
- package/dist/JSSComment.d.ts +0 -10
- package/dist/JSSComment.js +0 -52
- package/dist/JSSComment.js.map +0 -1
- package/dist/Link.d.ts +0 -22
- package/dist/Link.js +0 -29
- package/dist/Link.js.map +0 -1
- package/dist/List.d.ts +0 -15
- package/dist/List.js +0 -29
- package/dist/List.js.map +0 -1
- package/dist/ListButtonItem.d.ts +0 -14
- package/dist/ListButtonItem.js +0 -11
- package/dist/ListButtonItem.js.map +0 -1
- package/dist/ListDivider.d.ts +0 -1
- package/dist/ListDivider.js +0 -12
- package/dist/ListDivider.js.map +0 -1
- package/dist/ListHeaderItem.d.ts +0 -10
- package/dist/ListHeaderItem.js +0 -15
- package/dist/ListHeaderItem.js.map +0 -1
- package/dist/ListItem.d.ts +0 -9
- package/dist/ListItem.js +0 -9
- package/dist/ListItem.js.map +0 -1
- package/dist/ListLinkItem.d.ts +0 -16
- package/dist/ListLinkItem.js +0 -11
- package/dist/ListLinkItem.js.map +0 -1
- package/dist/ListSpacer.d.ts +0 -1
- package/dist/ListSpacer.js +0 -13
- package/dist/ListSpacer.js.map +0 -1
- package/dist/MenuIcon.d.ts +0 -5
- package/dist/MenuIcon.js +0 -31
- package/dist/MenuIcon.js.map +0 -1
- package/dist/NextJSRouter.d.ts +0 -1
- package/dist/NextJSRouter.js +0 -37
- package/dist/NextJSRouter.js.map +0 -1
- package/dist/NextJSRouterState.d.ts +0 -38
- package/dist/NextJSRouterState.js +0 -111
- package/dist/NextJSRouterState.js.map +0 -1
- package/dist/OnVisible.d.ts +0 -5
- package/dist/OnVisible.js +0 -28
- package/dist/OnVisible.js.map +0 -1
- package/dist/Popover.d.ts +0 -22
- package/dist/Popover.js +0 -90
- package/dist/Popover.js.map +0 -1
- package/dist/ProgressBar.d.ts +0 -7
- package/dist/ProgressBar.js +0 -42
- package/dist/ProgressBar.js.map +0 -1
- package/dist/ProgressCircle.d.ts +0 -5
- package/dist/ProgressCircle.js +0 -12
- package/dist/ProgressCircle.js.map +0 -1
- package/dist/Providers.d.ts +0 -9
- package/dist/Providers.js +0 -16
- package/dist/Providers.js.map +0 -1
- package/dist/RangeInput.d.ts +0 -14
- package/dist/RangeInput.js +0 -32
- package/dist/RangeInput.js.map +0 -1
- package/dist/ResultOrError.d.ts +0 -13
- package/dist/ResultOrError.js +0 -7
- package/dist/ResultOrError.js.map +0 -1
- package/dist/RootView.d.ts +0 -5
- package/dist/RootView.js +0 -35
- package/dist/RootView.js.map +0 -1
- package/dist/Row.d.ts +0 -6
- package/dist/Row.js +0 -7
- package/dist/Row.js.map +0 -1
- package/dist/Select.d.ts +0 -9
- package/dist/Select.js +0 -17
- package/dist/Select.js.map +0 -1
- package/dist/StackContext.d.ts +0 -8
- package/dist/StackContext.js +0 -25
- package/dist/StackContext.js.map +0 -1
- package/dist/StaticCheckbox.d.ts +0 -16
- package/dist/StaticCheckbox.js +0 -48
- package/dist/StaticCheckbox.js.map +0 -1
- package/dist/Storage.d.ts +0 -13
- package/dist/Storage.js +0 -146
- package/dist/Storage.js.map +0 -1
- package/dist/Stream.d.ts +0 -9
- package/dist/Stream.js +0 -36
- package/dist/Stream.js.map +0 -1
- package/dist/Sublist.d.ts +0 -12
- package/dist/Sublist.js +0 -18
- package/dist/Sublist.js.map +0 -1
- package/dist/SubmitIconInput.d.ts +0 -8
- package/dist/SubmitIconInput.js +0 -25
- package/dist/SubmitIconInput.js.map +0 -1
- package/dist/Tabs.d.ts +0 -23
- package/dist/Tabs.js +0 -39
- package/dist/Tabs.js.map +0 -1
- package/dist/Text.d.ts +0 -25
- package/dist/Text.js +0 -52
- package/dist/Text.js.map +0 -1
- package/dist/TextArea.d.ts +0 -11
- package/dist/TextArea.js +0 -27
- package/dist/TextArea.js.map +0 -1
- package/dist/TextInput.d.ts +0 -15
- package/dist/TextInput.js +0 -61
- package/dist/TextInput.js.map +0 -1
- package/dist/TextInputWithState.d.ts +0 -8
- package/dist/TextInputWithState.js +0 -14
- package/dist/TextInputWithState.js.map +0 -1
- package/dist/TextPairing.d.ts +0 -21
- package/dist/TextPairing.js +0 -26
- package/dist/TextPairing.js.map +0 -1
- package/dist/TimeInput.d.ts +0 -15
- package/dist/TimeInput.js +0 -58
- package/dist/TimeInput.js.map +0 -1
- package/dist/Tooltip.d.ts +0 -11
- package/dist/Tooltip.js +0 -73
- package/dist/Tooltip.js.map +0 -1
- package/dist/aria.d.ts +0 -8
- package/dist/aria.js +0 -42
- package/dist/aria.js.map +0 -1
- package/dist/guid.d.ts +0 -1
- package/dist/guid.js +0 -7
- package/dist/guid.js.map +0 -1
- package/dist/hash.d.ts +0 -1
- package/dist/hash.js +0 -20
- package/dist/hash.js.map +0 -1
- package/dist/isServer.d.ts +0 -1
- package/dist/isServer.js +0 -4
- package/dist/isServer.js.map +0 -1
- package/dist/jss.d.ts +0 -122
- package/dist/jss.js +0 -515
- package/dist/jss.js.map +0 -1
- package/dist/numberToBase.d.ts +0 -1
- package/dist/numberToBase.js +0 -44
- package/dist/numberToBase.js.map +0 -1
- package/dist/stateMachineContextFactory.d.ts +0 -36
- package/dist/stateMachineContextFactory.js +0 -48
- package/dist/stateMachineContextFactory.js.map +0 -1
- package/dist/useCookie.d.ts +0 -9
- package/dist/useCookie.js +0 -67
- package/dist/useCookie.js.map +0 -1
- package/dist/useKeyboard.d.ts +0 -8
- package/dist/useKeyboard.js +0 -26
- package/dist/useKeyboard.js.map +0 -1
- package/dist/useNavigation.d.ts +0 -5
- package/dist/useNavigation.js +0 -79
- package/dist/useNavigation.js.map +0 -1
- package/dist/usePromise.d.ts +0 -1
- package/dist/usePromise.js +0 -12
- package/dist/usePromise.js.map +0 -1
- package/dist/useRefEffect.d.ts +0 -1
- package/dist/useRefEffect.js +0 -15
- package/dist/useRefEffect.js.map +0 -1
- package/jss-debug-loader.mjs +0 -44
- package/next-env.d.ts +0 -6
- package/next.config.js +0 -33
- package/scripts/embeddings.js +0 -93
- package/scripts/openai_embeddings.js +0 -100
- package/scripts/publish.js +0 -28
- package/scripts/test_embeddings.js +0 -47
- package/src/Badge.tsx +0 -36
- package/src/BaseButton.tsx +0 -62
- package/src/BaseInput.tsx +0 -63
- package/src/BaseLink.tsx +0 -80
- package/src/BaseList.tsx +0 -26
- package/src/BaseListAddOn.tsx +0 -10
- package/src/BaseListItem.tsx +0 -119
- package/src/BaseView.tsx +0 -57
- package/src/Box.tsx +0 -20
- package/src/Button.tsx +0 -90
- package/src/Calendar.tsx +0 -123
- package/src/Card.tsx +0 -30
- package/src/Checkbox.tsx +0 -63
- package/src/Circle.tsx +0 -24
- package/src/Column.tsx +0 -12
- package/src/DarkMode.tsx +0 -100
- package/src/DateInput.tsx +0 -63
- package/src/DatePicker.tsx +0 -67
- package/src/DatetimeInput.tsx +0 -64
- package/src/DesignBook.tsx +0 -677
- package/src/Dialog.tsx +0 -150
- package/src/Dropdown.tsx +0 -146
- package/src/Emitter.ts +0 -26
- package/src/FlexLayout.tsx +0 -53
- package/src/Icon.tsx +0 -80
- package/src/IconButton.tsx +0 -81
- package/src/IconLink.tsx +0 -59
- package/src/IconType.ts +0 -787
- package/src/Interactable.tsx +0 -210
- package/src/JSSComment.tsx +0 -56
- package/src/Link.tsx +0 -110
- package/src/List.tsx +0 -58
- package/src/ListButtonItem.tsx +0 -69
- package/src/ListDivider.tsx +0 -13
- package/src/ListHeaderItem.tsx +0 -45
- package/src/ListItem.tsx +0 -24
- package/src/ListLinkItem.tsx +0 -76
- package/src/ListSpacer.tsx +0 -14
- package/src/MenuIcon.tsx +0 -50
- package/src/NextJSRouter.tsx +0 -60
- package/src/NextJSRouterState.tsx +0 -154
- package/src/OnVisible.tsx +0 -42
- package/src/Popover.tsx +0 -145
- package/src/ProgressBar.tsx +0 -63
- package/src/ProgressCircle.tsx +0 -38
- package/src/Providers.tsx +0 -33
- package/src/RangeInput.tsx +0 -82
- package/src/ResultOrError.ts +0 -15
- package/src/RootView.tsx +0 -55
- package/src/Row.tsx +0 -12
- package/src/Select.tsx +0 -39
- package/src/StackContext.tsx +0 -52
- package/src/StaticCheckbox.tsx +0 -72
- package/src/Storage.tsx +0 -198
- package/src/Stream.tsx +0 -50
- package/src/Sublist.tsx +0 -61
- package/src/SubmitIconInput.tsx +0 -45
- package/src/Tabs.tsx +0 -110
- package/src/Text.tsx +0 -111
- package/src/TextArea.tsx +0 -58
- package/src/TextInput.tsx +0 -123
- package/src/TextInputWithState.tsx +0 -32
- package/src/TextPairing.tsx +0 -115
- package/src/TimeInput.tsx +0 -109
- package/src/Tooltip.tsx +0 -109
- package/src/aria.ts +0 -72
- package/src/docs/mdx.tsx +0 -137
- package/src/docs/pages.ts +0 -115
- package/src/docs/searchIndex.ts +0 -1
- package/src/examples/ExampleDialog.tsx +0 -28
- package/src/guid.ts +0 -7
- package/src/hash.ts +0 -21
- package/src/index.ts +0 -68
- package/src/isServer.ts +0 -3
- package/src/jss.tsx +0 -712
- package/src/jsx-dev-runtime.ts +0 -74
- package/src/jsx-runtime.ts +0 -2
- package/src/numberToBase.ts +0 -52
- package/src/pages/Badge.mdx +0 -152
- package/src/pages/Button.mdx +0 -163
- package/src/pages/Calendar.mdx +0 -254
- package/src/pages/Card.mdx +0 -147
- package/src/pages/Checkbox.mdx +0 -131
- package/src/pages/Dialog.mdx +0 -197
- package/src/pages/FlexLayout.mdx +0 -211
- package/src/pages/Hashing.mdx +0 -211
- package/src/pages/Icon.mdx +0 -171
- package/src/pages/IconButton.mdx +0 -155
- package/src/pages/Link.mdx +0 -160
- package/src/pages/List.mdx +0 -262
- package/src/pages/ListHeader.mdx +0 -220
- package/src/pages/Popover.mdx +0 -223
- package/src/pages/ProgressBar.mdx +0 -200
- package/src/pages/ProgressCircle.mdx +0 -218
- package/src/pages/RangeInput.mdx +0 -237
- package/src/pages/Tabs.mdx +0 -281
- package/src/pages/Text.mdx +0 -154
- package/src/pages/TextInput.mdx +0 -235
- package/src/pages/TextPairing.mdx +0 -204
- package/src/pages/TimeInput.mdx +0 -178
- package/src/pages/Tooltip.mdx +0 -115
- package/src/pages/_app.tsx +0 -466
- package/src/pages/_document.tsx +0 -30
- package/src/pages/css-in-js.mdx +0 -240
- package/src/pages/index.mdx +0 -58
- package/src/pages/navigation.mdx +0 -158
- package/src/pages/prism.css +0 -3
- package/src/pages/useCookie.mdx +0 -176
- package/src/pages/useKeyboard.mdx +0 -257
- package/src/pages/useNavigation.mdx +0 -258
- package/src/pages/usePromise.mdx +0 -280
- package/src/pages/useRefEffect.mdx +0 -251
- package/src/stateMachineContextFactory.tsx +0 -111
- package/src/useCookie.tsx +0 -95
- package/src/useKeyboard.tsx +0 -43
- package/src/useNavigation.tsx +0 -89
- package/src/usePromise.tsx +0 -18
- package/src/useRefEffect.tsx +0 -18
- package/src/vite-plugin-jss-debug.ts +0 -77
- package/tsconfig.build.json +0 -23
- package/tsconfig.json +0 -38
package/src/pages/List.mdx
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
import { List } from "../List";
|
|
2
|
-
import { ListItem } from "../ListItem";
|
|
3
|
-
import { ListButtonItem } from "../ListButtonItem";
|
|
4
|
-
import { ListLinkItem } from "../ListLinkItem";
|
|
5
|
-
import { ListDivider } from "../ListDivider";
|
|
6
|
-
import { Icon } from "../Icon";
|
|
7
|
-
import { Sublist } from "../Sublist";
|
|
8
|
-
import { Row } from "../Row";
|
|
9
|
-
|
|
10
|
-
# List
|
|
11
|
-
|
|
12
|
-
A container for displaying items in a vertical list. Lists support multiple item types, keyboard navigation, and can be styled with different visual treatments.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Props
|
|
17
|
-
|
|
18
|
-
### List
|
|
19
|
-
|
|
20
|
-
| Prop | Type | Required | Default | Description |
|
|
21
|
-
|------|------|----------|---------|-------------|
|
|
22
|
-
| `ariaLabel` | `string` | Yes | - | Accessible label for the list |
|
|
23
|
-
| `bare` | `boolean` | No | `false` | Minimal styling without background/borders |
|
|
24
|
-
| `carded` | `boolean` | No | `true` | Rounded corners with full border |
|
|
25
|
-
| `navigation` | `boolean` | No | `true` | Enable arrow key navigation |
|
|
26
|
-
| `autofocus` | `boolean` | No | `false` | Focus first item on mount |
|
|
27
|
-
|
|
28
|
-
### List item components
|
|
29
|
-
|
|
30
|
-
- **`ListItem`** - Static, non-interactive item
|
|
31
|
-
- **`ListButtonItem`** - Clickable button item
|
|
32
|
-
- **`ListLinkItem`** - Navigation link item
|
|
33
|
-
- **`ListDivider`** - Visual separator
|
|
34
|
-
- **`ListHeaderItem`** - Section header
|
|
35
|
-
- **`Sublist`** - Collapsible group of items
|
|
36
|
-
|
|
37
|
-
All item components accept `TextPairing` props (`headline`, `body`, `addOn`, etc.).
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Basic list
|
|
42
|
-
|
|
43
|
-
The default list has a bordered card appearance with rounded corners.
|
|
44
|
-
|
|
45
|
-
<List ariaLabel="Settings">
|
|
46
|
-
<ListItem
|
|
47
|
-
headline="Notifications"
|
|
48
|
-
body="Manage your notification preferences"
|
|
49
|
-
addOn={<Icon color="primary" icon="fa-bell" size="medium" />}
|
|
50
|
-
/>
|
|
51
|
-
<ListButtonItem
|
|
52
|
-
color="secondary"
|
|
53
|
-
headline="Account"
|
|
54
|
-
body="Update your profile information"
|
|
55
|
-
addOn={<Icon color="primary" icon="fa-user" size="medium" />}
|
|
56
|
-
onClick={() => {}}
|
|
57
|
-
/>
|
|
58
|
-
<ListLinkItem
|
|
59
|
-
href="/"
|
|
60
|
-
color="secondary"
|
|
61
|
-
headline="Help Center"
|
|
62
|
-
addOn={<Icon color="primary" icon="fa-question-circle" size="medium" />}
|
|
63
|
-
withDivider={false}
|
|
64
|
-
/>
|
|
65
|
-
</List>
|
|
66
|
-
|
|
67
|
-
```js
|
|
68
|
-
<List ariaLabel="Settings">
|
|
69
|
-
<ListItem
|
|
70
|
-
headline="Notifications"
|
|
71
|
-
body="Manage your notification preferences"
|
|
72
|
-
addOn={<Icon color="primary" icon="fa-bell" size="medium" />}
|
|
73
|
-
/>
|
|
74
|
-
<ListButtonItem
|
|
75
|
-
color="secondary"
|
|
76
|
-
headline="Account"
|
|
77
|
-
onClick={() => {}}
|
|
78
|
-
/>
|
|
79
|
-
<ListLinkItem
|
|
80
|
-
href="/help"
|
|
81
|
-
color="secondary"
|
|
82
|
-
headline="Help Center"
|
|
83
|
-
withDivider={false}
|
|
84
|
-
/>
|
|
85
|
-
</List>
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## Edge-to-edge list
|
|
91
|
-
|
|
92
|
-
Set `carded={false}` to remove rounded corners, useful for full-width layouts.
|
|
93
|
-
|
|
94
|
-
<List carded={false} ariaLabel="Menu">
|
|
95
|
-
<ListButtonItem color="secondary" headline="Profile" onClick={() => {}} />
|
|
96
|
-
<ListButtonItem color="secondary" headline="Settings" onClick={() => {}} />
|
|
97
|
-
<ListButtonItem color="secondary" headline="Logout" onClick={() => {}} withDivider={false} />
|
|
98
|
-
</List>
|
|
99
|
-
|
|
100
|
-
```js
|
|
101
|
-
<List carded={false} ariaLabel="Menu">
|
|
102
|
-
<ListButtonItem color="secondary" headline="Profile" onClick={() => {}} />
|
|
103
|
-
<ListButtonItem color="secondary" headline="Settings" onClick={() => {}} />
|
|
104
|
-
<ListButtonItem color="secondary" headline="Logout" onClick={() => {}} withDivider={false} />
|
|
105
|
-
</List>
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## Bare list
|
|
111
|
-
|
|
112
|
-
The `bare` variant removes background and borders for a minimal appearance.
|
|
113
|
-
|
|
114
|
-
<List bare ariaLabel="Navigation">
|
|
115
|
-
<ListButtonItem bare color="secondary" headline="Home" addOn={<Icon color="primary" icon="fa-home" size="medium" />} onClick={() => {}} />
|
|
116
|
-
<ListButtonItem bare color="secondary" headline="Projects" addOn={<Icon color="primary" icon="fa-folder" size="medium" />} onClick={() => {}} />
|
|
117
|
-
<ListLinkItem bare href="/" color="secondary" headline="Settings" selected addOn={<Icon color="highlight" icon="fa-cog" size="medium" />} withDivider={false} />
|
|
118
|
-
</List>
|
|
119
|
-
|
|
120
|
-
```js
|
|
121
|
-
<List bare ariaLabel="Navigation">
|
|
122
|
-
<ListButtonItem
|
|
123
|
-
bare
|
|
124
|
-
color="secondary"
|
|
125
|
-
headline="Home"
|
|
126
|
-
addOn={<Icon color="primary" icon="fa-home" size="medium" />}
|
|
127
|
-
onClick={() => {}}
|
|
128
|
-
/>
|
|
129
|
-
<ListLinkItem
|
|
130
|
-
bare
|
|
131
|
-
href="/settings"
|
|
132
|
-
color="secondary"
|
|
133
|
-
headline="Settings"
|
|
134
|
-
selected
|
|
135
|
-
withDivider={false}
|
|
136
|
-
/>
|
|
137
|
-
</List>
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
## Item colors
|
|
143
|
-
|
|
144
|
-
ListButtonItem and ListLinkItem support semantic colors:
|
|
145
|
-
|
|
146
|
-
<List ariaLabel="Actions">
|
|
147
|
-
<ListButtonItem color="positive" headline="Create new" addOn={<Icon color="highlight" icon="fa-plus" size="medium" />} onClick={() => {}} />
|
|
148
|
-
<ListButtonItem color="secondary" headline="Edit item" addOn={<Icon color="primary" icon="fa-pencil" size="medium" />} onClick={() => {}} />
|
|
149
|
-
<ListButtonItem color="negative" headline="Delete item" addOn={<Icon color="negative" icon="fa-trash" size="medium" />} onClick={() => {}} withDivider={false} />
|
|
150
|
-
</List>
|
|
151
|
-
|
|
152
|
-
```js
|
|
153
|
-
<ListButtonItem color="positive" headline="Create" onClick={() => {}} />
|
|
154
|
-
<ListButtonItem color="secondary" headline="Edit" onClick={() => {}} />
|
|
155
|
-
<ListButtonItem color="negative" headline="Delete" onClick={() => {}} />
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
## Selected state
|
|
161
|
-
|
|
162
|
-
Link items support a `selected` prop to indicate the current selection:
|
|
163
|
-
|
|
164
|
-
<List bare ariaLabel="Pages">
|
|
165
|
-
<ListLinkItem bare href="/" color="secondary" headline="Dashboard" />
|
|
166
|
-
<ListLinkItem bare href="/" color="secondary" headline="Analytics" selected />
|
|
167
|
-
<ListLinkItem bare href="/" color="secondary" headline="Reports" withDivider={false} />
|
|
168
|
-
</List>
|
|
169
|
-
|
|
170
|
-
```js
|
|
171
|
-
<ListLinkItem
|
|
172
|
-
bare
|
|
173
|
-
href="/analytics"
|
|
174
|
-
headline="Analytics"
|
|
175
|
-
selected={currentPage === "analytics"}
|
|
176
|
-
/>
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
---
|
|
180
|
-
|
|
181
|
-
## Sublist
|
|
182
|
-
|
|
183
|
-
Group related items with collapsible sections:
|
|
184
|
-
|
|
185
|
-
<List bare ariaLabel="Documentation">
|
|
186
|
-
<Sublist label="Getting Started">
|
|
187
|
-
<ListItem headline="Installation" />
|
|
188
|
-
<ListItem headline="Quick Start" />
|
|
189
|
-
<ListItem headline="Configuration" />
|
|
190
|
-
</Sublist>
|
|
191
|
-
<Sublist label="Components">
|
|
192
|
-
<ListItem headline="Button" />
|
|
193
|
-
<ListItem headline="Input" />
|
|
194
|
-
<ListItem headline="List" />
|
|
195
|
-
</Sublist>
|
|
196
|
-
</List>
|
|
197
|
-
|
|
198
|
-
```js
|
|
199
|
-
<List bare ariaLabel="Documentation">
|
|
200
|
-
<Sublist label="Getting Started">
|
|
201
|
-
<ListItem headline="Installation" />
|
|
202
|
-
<ListItem headline="Quick Start" />
|
|
203
|
-
</Sublist>
|
|
204
|
-
<Sublist label="Components">
|
|
205
|
-
<ListItem headline="Button" />
|
|
206
|
-
<ListItem headline="Input" />
|
|
207
|
-
</Sublist>
|
|
208
|
-
</List>
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## Keyboard navigation
|
|
214
|
-
|
|
215
|
-
Lists support arrow key navigation by default (following [WAI-ARIA grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/)):
|
|
216
|
-
|
|
217
|
-
- **Arrow Up/Down** - Move between items
|
|
218
|
-
- **Enter/Space** - Activate the focused item
|
|
219
|
-
- **Home/End** - Jump to first/last item
|
|
220
|
-
|
|
221
|
-
<List ariaLabel="Keyboard demo" navigation={true}>
|
|
222
|
-
<ListButtonItem color="secondary" headline="First item (use arrow keys)" onClick={() => {}} />
|
|
223
|
-
<ListButtonItem color="secondary" headline="Second item" onClick={() => {}} />
|
|
224
|
-
<ListButtonItem color="secondary" headline="Third item" onClick={() => {}} withDivider={false} />
|
|
225
|
-
</List>
|
|
226
|
-
|
|
227
|
-
Disable navigation with `navigation={false}` if items have their own focus management.
|
|
228
|
-
|
|
229
|
-
```js
|
|
230
|
-
// Keyboard navigation enabled (default)
|
|
231
|
-
<List ariaLabel="Menu" navigation={true}>
|
|
232
|
-
...
|
|
233
|
-
</List>
|
|
234
|
-
|
|
235
|
-
// Keyboard navigation disabled
|
|
236
|
-
<List ariaLabel="Form fields" navigation={false}>
|
|
237
|
-
...
|
|
238
|
-
</List>
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
-
|
|
243
|
-
## Dividers
|
|
244
|
-
|
|
245
|
-
List items include dividers by default. Remove with `withDivider={false}`:
|
|
246
|
-
|
|
247
|
-
```js
|
|
248
|
-
<List ariaLabel="Items">
|
|
249
|
-
<ListItem headline="With divider" />
|
|
250
|
-
<ListItem headline="With divider" />
|
|
251
|
-
<ListItem headline="No divider" withDivider={false} />
|
|
252
|
-
</List>
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
---
|
|
256
|
-
|
|
257
|
-
## Accessibility
|
|
258
|
-
|
|
259
|
-
- Uses `role="grid"` with `aria-label` for screen readers
|
|
260
|
-
- Keyboard navigation follows WAI-ARIA grid pattern
|
|
261
|
-
- Focus management with arrow keys, Home, and End
|
|
262
|
-
- Proper focus indicators on keyboard navigation
|
package/src/pages/ListHeader.mdx
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { List } from "../List";
|
|
2
|
-
import { Icon } from "../Icon";
|
|
3
|
-
import { ListItem } from "../ListItem";
|
|
4
|
-
import { ListHeaderItem } from "../ListHeaderItem";
|
|
5
|
-
import { Column } from "../Column";
|
|
6
|
-
import { Span } from "../Text";
|
|
7
|
-
|
|
8
|
-
# ListHeaderItem
|
|
9
|
-
|
|
10
|
-
A specialized list item for section headers. Use to organize and visually separate groups within a list.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Props
|
|
15
|
-
|
|
16
|
-
| Prop | Type | Default | Description |
|
|
17
|
-
|------|------|---------|-------------|
|
|
18
|
-
| `headline` | `string` | Required | Header text |
|
|
19
|
-
| `body` | `string` | - | Optional secondary text |
|
|
20
|
-
| `highlight` | `boolean` | `false` | Use accent background color |
|
|
21
|
-
| `addOn` | `ReactNode` | - | Icon or element to display |
|
|
22
|
-
| `addOnPosition` | `Position` | - | Position of the add-on |
|
|
23
|
-
| `withDivider` | `boolean` | - | Show divider below header |
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Basic usage
|
|
28
|
-
|
|
29
|
-
<List ariaLabel="example">
|
|
30
|
-
<ListHeaderItem headline="Section A" />
|
|
31
|
-
<ListItem headline="Item 1" body="Description" />
|
|
32
|
-
<ListItem headline="Item 2" body="Description" />
|
|
33
|
-
<ListHeaderItem headline="Section B" />
|
|
34
|
-
<ListItem headline="Item 3" body="Description" />
|
|
35
|
-
<ListItem withDivider={false} headline="Item 4" body="Description" />
|
|
36
|
-
</List>
|
|
37
|
-
|
|
38
|
-
```js
|
|
39
|
-
<List ariaLabel="example">
|
|
40
|
-
<ListHeaderItem headline="Section A" />
|
|
41
|
-
<ListItem headline="Item 1" body="Description" />
|
|
42
|
-
<ListItem headline="Item 2" body="Description" />
|
|
43
|
-
<ListHeaderItem headline="Section B" />
|
|
44
|
-
<ListItem headline="Item 3" body="Description" />
|
|
45
|
-
<ListItem headline="Item 4" body="Description" />
|
|
46
|
-
</List>
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## Styles
|
|
52
|
-
|
|
53
|
-
### Standard headers
|
|
54
|
-
|
|
55
|
-
<List ariaLabel="example">
|
|
56
|
-
<ListHeaderItem headline="Header" />
|
|
57
|
-
<ListItem headline="Headline 1" body="Body 1" />
|
|
58
|
-
<ListHeaderItem
|
|
59
|
-
headline="Header"
|
|
60
|
-
addOn={<Icon icon="fa-chain-broken" size="medium" color="primary" />}
|
|
61
|
-
/>
|
|
62
|
-
<ListItem headline="Headline 2" body="Body 2" />
|
|
63
|
-
<ListHeaderItem highlight headline="Header" />
|
|
64
|
-
<ListItem headline="Headline 3" body="Body 3" />
|
|
65
|
-
<ListHeaderItem
|
|
66
|
-
highlight
|
|
67
|
-
headline="Header"
|
|
68
|
-
addOn={<Icon icon="fa-chain-broken" size="medium" color="light" />}
|
|
69
|
-
/>
|
|
70
|
-
<ListItem withDivider={false} headline="Headline 4" body="Body 3" />
|
|
71
|
-
</List>
|
|
72
|
-
|
|
73
|
-
```js
|
|
74
|
-
// Plain header
|
|
75
|
-
<ListHeaderItem headline="Header" />
|
|
76
|
-
|
|
77
|
-
// With icon
|
|
78
|
-
<ListHeaderItem
|
|
79
|
-
headline="Header"
|
|
80
|
-
addOn={<Icon icon="fa-chain-broken" size="medium" color="primary" />}
|
|
81
|
-
/>
|
|
82
|
-
|
|
83
|
-
// Highlighted (accent background)
|
|
84
|
-
<ListHeaderItem highlight headline="Header" />
|
|
85
|
-
|
|
86
|
-
// Highlighted with icon
|
|
87
|
-
<ListHeaderItem
|
|
88
|
-
highlight
|
|
89
|
-
headline="Header"
|
|
90
|
-
addOn={<Icon icon="fa-chain-broken" size="medium" color="light" />}
|
|
91
|
-
/>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Bare list headers
|
|
97
|
-
|
|
98
|
-
In bare lists, headers have no background:
|
|
99
|
-
|
|
100
|
-
<List bare ariaLabel="example">
|
|
101
|
-
<ListHeaderItem headline="Header" />
|
|
102
|
-
<ListItem headline="Headline 1" body="Body 1" />
|
|
103
|
-
<ListHeaderItem
|
|
104
|
-
headline="Header"
|
|
105
|
-
addOn={<Icon icon="fa-chain-broken" size="medium" color="primary" />}
|
|
106
|
-
/>
|
|
107
|
-
<ListItem headline="Headline 2" body="Body 2" />
|
|
108
|
-
<ListHeaderItem highlight headline="Header" />
|
|
109
|
-
<ListItem headline="Headline 3" body="Body 3" />
|
|
110
|
-
<ListHeaderItem
|
|
111
|
-
highlight
|
|
112
|
-
headline="Header"
|
|
113
|
-
addOn={<Icon icon="fa-chain-broken" size="medium" color="highlight" />}
|
|
114
|
-
/>
|
|
115
|
-
<ListItem withDivider={false} headline="Headline 4" body="Body 3" />
|
|
116
|
-
</List>
|
|
117
|
-
|
|
118
|
-
```js
|
|
119
|
-
<List bare ariaLabel="example">
|
|
120
|
-
<ListHeaderItem headline="Header" />
|
|
121
|
-
<ListItem headline="Item" body="Description" />
|
|
122
|
-
|
|
123
|
-
{/* Highlighted in bare mode uses highlight text color instead */}
|
|
124
|
-
<ListHeaderItem highlight headline="Header" />
|
|
125
|
-
<ListItem headline="Item" body="Description" />
|
|
126
|
-
</List>
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## With icons
|
|
132
|
-
|
|
133
|
-
Add context with icons:
|
|
134
|
-
|
|
135
|
-
```js
|
|
136
|
-
// Category header
|
|
137
|
-
<ListHeaderItem
|
|
138
|
-
headline="Documents"
|
|
139
|
-
addOn={<Icon icon="fa-folder" size="medium" color="primary" />}
|
|
140
|
-
/>
|
|
141
|
-
|
|
142
|
-
// Status header
|
|
143
|
-
<ListHeaderItem
|
|
144
|
-
headline="Pending"
|
|
145
|
-
addOn={<Icon icon="fa-clock-o" size="medium" color="warning" />}
|
|
146
|
-
/>
|
|
147
|
-
|
|
148
|
-
// Alert header (highlighted)
|
|
149
|
-
<ListHeaderItem
|
|
150
|
-
highlight
|
|
151
|
-
headline="Urgent"
|
|
152
|
-
addOn={<Icon icon="fa-exclamation" size="medium" color="light" />}
|
|
153
|
-
/>
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
## Common patterns
|
|
159
|
-
|
|
160
|
-
### Grouped settings
|
|
161
|
-
|
|
162
|
-
```js
|
|
163
|
-
<List ariaLabel="Settings">
|
|
164
|
-
<ListHeaderItem headline="Account" />
|
|
165
|
-
<ListButtonItem headline="Profile" onClick={() => {}} />
|
|
166
|
-
<ListButtonItem headline="Password" onClick={() => {}} />
|
|
167
|
-
|
|
168
|
-
<ListHeaderItem headline="Preferences" />
|
|
169
|
-
<ListButtonItem headline="Theme" onClick={() => {}} />
|
|
170
|
-
<ListButtonItem headline="Language" onClick={() => {}} />
|
|
171
|
-
|
|
172
|
-
<ListHeaderItem headline="Danger Zone" highlight />
|
|
173
|
-
<ListButtonItem headline="Delete Account" color="negative" onClick={() => {}} />
|
|
174
|
-
</List>
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### Alphabetical grouping
|
|
178
|
-
|
|
179
|
-
```js
|
|
180
|
-
<List ariaLabel="Contacts">
|
|
181
|
-
<ListHeaderItem headline="A" />
|
|
182
|
-
<ListItem headline="Alice Anderson" />
|
|
183
|
-
<ListItem headline="Andrew Adams" />
|
|
184
|
-
|
|
185
|
-
<ListHeaderItem headline="B" />
|
|
186
|
-
<ListItem headline="Bob Brown" />
|
|
187
|
-
<ListItem headline="Betty Baker" />
|
|
188
|
-
</List>
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
### Category browser
|
|
192
|
-
|
|
193
|
-
```js
|
|
194
|
-
<List ariaLabel="Categories">
|
|
195
|
-
<ListHeaderItem
|
|
196
|
-
headline="Popular"
|
|
197
|
-
addOn={<Icon icon="fa-fire" color="warning" />}
|
|
198
|
-
/>
|
|
199
|
-
<ListButtonItem headline="Technology" onClick={() => {}} />
|
|
200
|
-
<ListButtonItem headline="Design" onClick={() => {}} />
|
|
201
|
-
|
|
202
|
-
<ListHeaderItem
|
|
203
|
-
headline="Recent"
|
|
204
|
-
addOn={<Icon icon="fa-clock-o" color="secondary" />}
|
|
205
|
-
/>
|
|
206
|
-
<ListButtonItem headline="Science" onClick={() => {}} />
|
|
207
|
-
<ListButtonItem headline="Art" onClick={() => {}} />
|
|
208
|
-
</List>
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## Styling behavior
|
|
214
|
-
|
|
215
|
-
| Context | Standard Header | Highlighted Header |
|
|
216
|
-
|---------|----------------|-------------------|
|
|
217
|
-
| Regular list | Gray background | Accent background |
|
|
218
|
-
| Bare list | No background | Accent text color |
|
|
219
|
-
|
|
220
|
-
The component automatically adapts based on the parent list's `bare` prop.
|
package/src/pages/Popover.mdx
DELETED
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { Popover, PopoverTrigger } from "../Popover";
|
|
2
|
-
import { Icon } from "../Icon";
|
|
3
|
-
import { Button } from "../Button";
|
|
4
|
-
import { List } from "../List";
|
|
5
|
-
import { ListButtonItem } from "../ListButtonItem";
|
|
6
|
-
import { Row } from "../Row";
|
|
7
|
-
import { Column } from "../Column";
|
|
8
|
-
|
|
9
|
-
# Popover
|
|
10
|
-
|
|
11
|
-
A floating panel that appears next to a trigger element. Unlike tooltips, popovers can contain interactive content like menus, forms, or action lists.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Props
|
|
16
|
-
|
|
17
|
-
### PopoverTrigger
|
|
18
|
-
|
|
19
|
-
| Prop | Type | Required | Description |
|
|
20
|
-
|------|------|----------|-------------|
|
|
21
|
-
| `PopoverComponent` | `(props: { close: () => void } & Input) => JSX.Element` | Yes | Component to render in the popover |
|
|
22
|
-
| `children` | `(props: { toggle: (input: Input) => void }) => JSX.Element` | Yes | Render function for the trigger element |
|
|
23
|
-
| `jss` | `JSS` | No | Custom styles for the wrapper |
|
|
24
|
-
| `jssDialog` | `JSS` | No | Custom styles for the popover dialog |
|
|
25
|
-
| `grow` | `boolean` | No | Allow wrapper to grow |
|
|
26
|
-
| `shrink` | `boolean` | No | Allow wrapper to shrink |
|
|
27
|
-
| `tag` | `keyof HTMLElementTagNameMap` | No | HTML tag for the wrapper |
|
|
28
|
-
|
|
29
|
-
### Popover
|
|
30
|
-
|
|
31
|
-
| Prop | Type | Required | Description |
|
|
32
|
-
|------|------|----------|-------------|
|
|
33
|
-
| `children` | `ReactNode` | Yes | Popover content |
|
|
34
|
-
| `close` | `() => void` | Yes | Function to close the popover |
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Basic usage
|
|
39
|
-
|
|
40
|
-
Use `PopoverTrigger` to create a button that opens a popover with interactive options:
|
|
41
|
-
|
|
42
|
-
<Row padding="large">
|
|
43
|
-
<PopoverTrigger
|
|
44
|
-
PopoverComponent={({ close }) => (
|
|
45
|
-
<Popover close={close}>
|
|
46
|
-
<List bare ariaLabel="Options">
|
|
47
|
-
<ListButtonItem bare headline="Edit" onClick={() => close()} color="secondary" />
|
|
48
|
-
<ListButtonItem bare headline="Duplicate" onClick={() => close()} color="secondary" />
|
|
49
|
-
<ListButtonItem bare headline="Delete" onClick={() => close()} color="negative" withDivider={false} />
|
|
50
|
-
</List>
|
|
51
|
-
</Popover>
|
|
52
|
-
)}
|
|
53
|
-
>
|
|
54
|
-
{({ toggle }) => (
|
|
55
|
-
<Button color="positive" onClick={() => toggle(undefined)}>
|
|
56
|
-
Show Options
|
|
57
|
-
</Button>
|
|
58
|
-
)}
|
|
59
|
-
</PopoverTrigger>
|
|
60
|
-
</Row>
|
|
61
|
-
|
|
62
|
-
```js
|
|
63
|
-
<PopoverTrigger
|
|
64
|
-
PopoverComponent={({ close }) => (
|
|
65
|
-
<Popover close={close}>
|
|
66
|
-
<List bare ariaLabel="Options">
|
|
67
|
-
<ListButtonItem
|
|
68
|
-
bare
|
|
69
|
-
headline="Edit"
|
|
70
|
-
onClick={() => close()}
|
|
71
|
-
color="secondary"
|
|
72
|
-
/>
|
|
73
|
-
<ListButtonItem
|
|
74
|
-
bare
|
|
75
|
-
headline="Duplicate"
|
|
76
|
-
onClick={() => close()}
|
|
77
|
-
color="secondary"
|
|
78
|
-
/>
|
|
79
|
-
<ListButtonItem
|
|
80
|
-
bare
|
|
81
|
-
headline="Delete"
|
|
82
|
-
onClick={() => close()}
|
|
83
|
-
color="negative"
|
|
84
|
-
withDivider={false}
|
|
85
|
-
/>
|
|
86
|
-
</List>
|
|
87
|
-
</Popover>
|
|
88
|
-
)}
|
|
89
|
-
>
|
|
90
|
-
{({ toggle }) => (
|
|
91
|
-
<Button color="positive" onClick={() => toggle(undefined)}>
|
|
92
|
-
Show Options
|
|
93
|
-
</Button>
|
|
94
|
-
)}
|
|
95
|
-
</PopoverTrigger>
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## Passing data to popover
|
|
101
|
-
|
|
102
|
-
Use TypeScript generics to pass data when opening the popover:
|
|
103
|
-
|
|
104
|
-
```js
|
|
105
|
-
interface Item {
|
|
106
|
-
id: string;
|
|
107
|
-
name: string;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
<PopoverTrigger<Item>
|
|
111
|
-
PopoverComponent={({ close, id, name }) => (
|
|
112
|
-
<Popover close={close}>
|
|
113
|
-
<Column padding="medium" gap="small">
|
|
114
|
-
<P>Edit: {name}</P>
|
|
115
|
-
<Button color="positive" onClick={() => {
|
|
116
|
-
saveItem(id);
|
|
117
|
-
close();
|
|
118
|
-
}}>
|
|
119
|
-
Save
|
|
120
|
-
</Button>
|
|
121
|
-
</Column>
|
|
122
|
-
</Popover>
|
|
123
|
-
)}
|
|
124
|
-
>
|
|
125
|
-
{({ toggle }) => (
|
|
126
|
-
<Button
|
|
127
|
-
color="primary"
|
|
128
|
-
onClick={() => toggle({ id: "123", name: "My Item" })}
|
|
129
|
-
>
|
|
130
|
-
Edit Item
|
|
131
|
-
</Button>
|
|
132
|
-
)}
|
|
133
|
-
</PopoverTrigger>
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## Behavior
|
|
139
|
-
|
|
140
|
-
- **Toggle on click**: Clicking the trigger opens/closes the popover
|
|
141
|
-
- **Focus management**: Focus moves into the popover when opened
|
|
142
|
-
- **Focus trap**: Tab cycles through focusable elements within the popover
|
|
143
|
-
- **Escape to close**: Pressing Escape closes the popover
|
|
144
|
-
- **Outside click**: Clicking outside closes the popover
|
|
145
|
-
- **Focus restoration**: Focus returns to the trigger when closed
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## Common patterns
|
|
150
|
-
|
|
151
|
-
### Dropdown menu
|
|
152
|
-
|
|
153
|
-
```js
|
|
154
|
-
<PopoverTrigger
|
|
155
|
-
PopoverComponent={({ close }) => (
|
|
156
|
-
<Popover close={close}>
|
|
157
|
-
<List bare ariaLabel="Menu">
|
|
158
|
-
<ListButtonItem bare headline="Profile" onClick={() => close()} />
|
|
159
|
-
<ListButtonItem bare headline="Settings" onClick={() => close()} />
|
|
160
|
-
<ListButtonItem bare headline="Logout" onClick={() => close()} color="negative" />
|
|
161
|
-
</List>
|
|
162
|
-
</Popover>
|
|
163
|
-
)}
|
|
164
|
-
>
|
|
165
|
-
{({ toggle }) => (
|
|
166
|
-
<IconButton
|
|
167
|
-
bare
|
|
168
|
-
icon="fa-ellipsis-v"
|
|
169
|
-
size="medium"
|
|
170
|
-
color="secondary"
|
|
171
|
-
onClick={() => toggle(undefined)}
|
|
172
|
-
/>
|
|
173
|
-
)}
|
|
174
|
-
</PopoverTrigger>
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### Action confirmation
|
|
178
|
-
|
|
179
|
-
```js
|
|
180
|
-
<PopoverTrigger
|
|
181
|
-
PopoverComponent={({ close }) => (
|
|
182
|
-
<Popover close={close}>
|
|
183
|
-
<Column padding="medium" gap="medium">
|
|
184
|
-
<P>Are you sure you want to delete?</P>
|
|
185
|
-
<Row gap="small" justify="end">
|
|
186
|
-
<Button bare color="primary" onClick={close}>Cancel</Button>
|
|
187
|
-
<Button color="negative" onClick={() => {
|
|
188
|
-
deleteItem();
|
|
189
|
-
close();
|
|
190
|
-
}}>Delete</Button>
|
|
191
|
-
</Row>
|
|
192
|
-
</Column>
|
|
193
|
-
</Popover>
|
|
194
|
-
)}
|
|
195
|
-
>
|
|
196
|
-
{({ toggle }) => (
|
|
197
|
-
<Button color="negative" onClick={() => toggle(undefined)}>
|
|
198
|
-
Delete
|
|
199
|
-
</Button>
|
|
200
|
-
)}
|
|
201
|
-
</PopoverTrigger>
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
## Accessibility
|
|
207
|
-
|
|
208
|
-
- Uses `<dialog>` element with `.show()` for proper popover behavior
|
|
209
|
-
- Focus is trapped within the popover
|
|
210
|
-
- Escape key closes the popover
|
|
211
|
-
- Focus returns to the trigger when closed
|
|
212
|
-
- Tab navigation cycles through focusable elements
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
## Popover vs Dialog vs Tooltip
|
|
217
|
-
|
|
218
|
-
| Popover | Dialog | Tooltip |
|
|
219
|
-
|---------|--------|---------|
|
|
220
|
-
| Positioned near trigger | Centered on screen | Positioned near trigger |
|
|
221
|
-
| Light interactions | Complex workflows | Text only |
|
|
222
|
-
| Partial page blocking | Full page blocking | No blocking |
|
|
223
|
-
| Menus, quick actions | Forms, confirmations | Hints, labels |
|