aidos-ui 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc +4 -0
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/dist/Badge.d.ts +7 -0
- package/dist/Badge.js +22 -0
- package/dist/Badge.js.map +1 -0
- package/dist/BaseButton.d.ts +13 -0
- package/dist/BaseButton.js +22 -0
- package/dist/BaseButton.js.map +1 -0
- package/dist/BaseInput.d.ts +15 -0
- package/dist/BaseInput.js +14 -0
- package/dist/BaseInput.js.map +1 -0
- package/dist/BaseLink.d.ts +17 -0
- package/dist/BaseLink.js +28 -0
- package/dist/BaseLink.js.map +1 -0
- package/dist/BaseList.d.ts +6 -0
- package/dist/BaseList.js +14 -0
- package/dist/BaseList.js.map +1 -0
- package/dist/BaseListAddOn.d.ts +5 -0
- package/dist/BaseListAddOn.js +7 -0
- package/dist/BaseListAddOn.js.map +1 -0
- package/dist/BaseListItem.d.ts +27 -0
- package/dist/BaseListItem.js +26 -0
- package/dist/BaseListItem.js.map +1 -0
- package/dist/BaseView.d.ts +12 -0
- package/dist/BaseView.js +26 -0
- package/dist/BaseView.js.map +1 -0
- package/dist/Box.d.ts +5 -0
- package/dist/Box.js +6 -0
- package/dist/Box.js.map +1 -0
- package/dist/Button.d.ts +20 -0
- package/dist/Button.js +20 -0
- package/dist/Button.js.map +1 -0
- package/dist/Calendar.d.ts +18 -0
- package/dist/Calendar.js +57 -0
- package/dist/Calendar.js.map +1 -0
- package/dist/Card.d.ts +4 -0
- package/dist/Card.js +12 -0
- package/dist/Card.js.map +1 -0
- package/dist/Checkbox.d.ts +12 -0
- package/dist/Checkbox.js +32 -0
- package/dist/Checkbox.js.map +1 -0
- package/dist/Circle.d.ts +6 -0
- package/dist/Circle.js +12 -0
- package/dist/Circle.js.map +1 -0
- package/dist/Column.d.ts +6 -0
- package/dist/Column.js +7 -0
- package/dist/Column.js.map +1 -0
- package/dist/DarkMode.d.ts +13 -0
- package/dist/DarkMode.js +61 -0
- package/dist/DarkMode.js.map +1 -0
- package/dist/DateInput.d.ts +13 -0
- package/dist/DateInput.js +29 -0
- package/dist/DateInput.js.map +1 -0
- package/dist/DatePicker.d.ts +12 -0
- package/dist/DatePicker.js +34 -0
- package/dist/DatePicker.js.map +1 -0
- package/dist/DatetimeInput.d.ts +13 -0
- package/dist/DatetimeInput.js +31 -0
- package/dist/DatetimeInput.js.map +1 -0
- package/dist/DesignBook.d.ts +2 -0
- package/dist/DesignBook.js +55 -0
- package/dist/DesignBook.js.map +1 -0
- package/dist/Dialog.d.ts +17 -0
- package/dist/Dialog.js +86 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/Dropdown.d.ts +10 -0
- package/dist/Dropdown.js +64 -0
- package/dist/Dropdown.js.map +1 -0
- package/dist/Emitter.d.ts +6 -0
- package/dist/Emitter.js +19 -0
- package/dist/Emitter.js.map +1 -0
- package/dist/FlexLayout.d.ts +11 -0
- package/dist/FlexLayout.js +18 -0
- package/dist/FlexLayout.js.map +1 -0
- package/dist/Icon.d.ts +12 -0
- package/dist/Icon.js +69 -0
- package/dist/Icon.js.map +1 -0
- package/dist/IconButton.d.ts +9 -0
- package/dist/IconButton.js +31 -0
- package/dist/IconButton.js.map +1 -0
- package/dist/IconLink.d.ts +9 -0
- package/dist/IconLink.js +31 -0
- package/dist/IconLink.js.map +1 -0
- package/dist/IconType.d.ts +1 -0
- package/dist/IconType.js +2 -0
- package/dist/IconType.js.map +1 -0
- package/dist/Interactable.d.ts +48 -0
- package/dist/Interactable.js +131 -0
- package/dist/Interactable.js.map +1 -0
- package/dist/Link.d.ts +20 -0
- package/dist/Link.js +22 -0
- package/dist/Link.js.map +1 -0
- package/dist/List.d.ts +11 -0
- package/dist/List.js +17 -0
- package/dist/List.js.map +1 -0
- package/dist/ListButtonItem.d.ts +15 -0
- package/dist/ListButtonItem.js +9 -0
- package/dist/ListButtonItem.js.map +1 -0
- package/dist/ListDivider.d.ts +2 -0
- package/dist/ListDivider.js +12 -0
- package/dist/ListDivider.js.map +1 -0
- package/dist/ListHeaderItem.d.ts +11 -0
- package/dist/ListHeaderItem.js +13 -0
- package/dist/ListHeaderItem.js.map +1 -0
- package/dist/ListItem.d.ts +10 -0
- package/dist/ListItem.js +7 -0
- package/dist/ListItem.js.map +1 -0
- package/dist/ListLinkItem.d.ts +17 -0
- package/dist/ListLinkItem.js +9 -0
- package/dist/ListLinkItem.js.map +1 -0
- package/dist/ListSpacer.d.ts +2 -0
- package/dist/ListSpacer.js +13 -0
- package/dist/ListSpacer.js.map +1 -0
- package/dist/OnVisible.d.ts +5 -0
- package/dist/OnVisible.js +28 -0
- package/dist/OnVisible.js.map +1 -0
- package/dist/Popover.d.ts +21 -0
- package/dist/Popover.js +88 -0
- package/dist/Popover.js.map +1 -0
- package/dist/ProgressBar.d.ts +8 -0
- package/dist/ProgressBar.js +42 -0
- package/dist/ProgressBar.js.map +1 -0
- package/dist/ProgressCircle.d.ts +6 -0
- package/dist/ProgressCircle.js +12 -0
- package/dist/ProgressCircle.js.map +1 -0
- package/dist/Providers.d.ts +9 -0
- package/dist/Providers.js +16 -0
- package/dist/Providers.js.map +1 -0
- package/dist/RangeInput.d.ts +14 -0
- package/dist/RangeInput.js +32 -0
- package/dist/RangeInput.js.map +1 -0
- package/dist/ResultOrError.d.ts +13 -0
- package/dist/ResultOrError.js +7 -0
- package/dist/ResultOrError.js.map +1 -0
- package/dist/RootView.d.ts +5 -0
- package/dist/RootView.js +35 -0
- package/dist/RootView.js.map +1 -0
- package/dist/Router.d.ts +2 -0
- package/dist/Router.js +37 -0
- package/dist/Router.js.map +1 -0
- package/dist/RouterState.d.ts +38 -0
- package/dist/RouterState.js +111 -0
- package/dist/RouterState.js.map +1 -0
- package/dist/Row.d.ts +6 -0
- package/dist/Row.js +7 -0
- package/dist/Row.js.map +1 -0
- package/dist/StackContext.d.ts +8 -0
- package/dist/StackContext.js +25 -0
- package/dist/StackContext.js.map +1 -0
- package/dist/StaticCheckbox.d.ts +17 -0
- package/dist/StaticCheckbox.js +48 -0
- package/dist/StaticCheckbox.js.map +1 -0
- package/dist/Storage.d.ts +12 -0
- package/dist/Storage.js +148 -0
- package/dist/Storage.js.map +1 -0
- package/dist/Stream.d.ts +9 -0
- package/dist/Stream.js +36 -0
- package/dist/Stream.js.map +1 -0
- package/dist/Sublist.d.ts +12 -0
- package/dist/Sublist.js +18 -0
- package/dist/Sublist.js.map +1 -0
- package/dist/SubmitIconInput.d.ts +9 -0
- package/dist/SubmitIconInput.js +25 -0
- package/dist/SubmitIconInput.js.map +1 -0
- package/dist/Tabs.d.ts +20 -0
- package/dist/Tabs.js +35 -0
- package/dist/Tabs.js.map +1 -0
- package/dist/Text.d.ts +25 -0
- package/dist/Text.js +50 -0
- package/dist/Text.js.map +1 -0
- package/dist/TextArea.d.ts +10 -0
- package/dist/TextArea.js +22 -0
- package/dist/TextArea.js.map +1 -0
- package/dist/TextInput.d.ts +14 -0
- package/dist/TextInput.js +52 -0
- package/dist/TextInput.js.map +1 -0
- package/dist/TextInputWithState.d.ts +10 -0
- package/dist/TextInputWithState.js +14 -0
- package/dist/TextInputWithState.js.map +1 -0
- package/dist/TextPairing.d.ts +21 -0
- package/dist/TextPairing.js +26 -0
- package/dist/TextPairing.js.map +1 -0
- package/dist/TimeInput.d.ts +15 -0
- package/dist/TimeInput.js +58 -0
- package/dist/TimeInput.js.map +1 -0
- package/dist/Tooltip.d.ts +11 -0
- package/dist/Tooltip.js +72 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/aria.d.ts +8 -0
- package/dist/aria.js +42 -0
- package/dist/aria.js.map +1 -0
- package/dist/guid.d.ts +1 -0
- package/dist/guid.js +7 -0
- package/dist/guid.js.map +1 -0
- package/dist/hash.d.ts +1 -0
- package/dist/hash.js +20 -0
- package/dist/hash.js.map +1 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/dist/jss.d.ts +110 -0
- package/dist/jss.js +438 -0
- package/dist/jss.js.map +1 -0
- package/dist/numberToBase.d.ts +1 -0
- package/dist/numberToBase.js +44 -0
- package/dist/numberToBase.js.map +1 -0
- package/dist/stateMachineContextFactory.d.ts +36 -0
- package/dist/stateMachineContextFactory.js +48 -0
- package/dist/stateMachineContextFactory.js.map +1 -0
- package/dist/useCookie.d.ts +9 -0
- package/dist/useCookie.js +65 -0
- package/dist/useCookie.js.map +1 -0
- package/dist/useKeyboard.d.ts +8 -0
- package/dist/useKeyboard.js +26 -0
- package/dist/useKeyboard.js.map +1 -0
- package/dist/useNavigation.d.ts +5 -0
- package/dist/useNavigation.js +79 -0
- package/dist/useNavigation.js.map +1 -0
- package/dist/usePromise.d.ts +1 -0
- package/dist/usePromise.js +12 -0
- package/dist/usePromise.js.map +1 -0
- package/dist/useRefEffect.d.ts +1 -0
- package/dist/useRefEffect.js +15 -0
- package/dist/useRefEffect.js.map +1 -0
- package/next-env.d.ts +5 -0
- package/next.config.js +21 -0
- package/package.json +40 -0
- package/scripts/publish.js +27 -0
- package/src/Badge.tsx +36 -0
- package/src/BaseButton.tsx +58 -0
- package/src/BaseInput.tsx +57 -0
- package/src/BaseLink.tsx +77 -0
- package/src/BaseList.tsx +29 -0
- package/src/BaseListAddOn.tsx +10 -0
- package/src/BaseListItem.tsx +117 -0
- package/src/BaseView.tsx +57 -0
- package/src/Box.tsx +20 -0
- package/src/Button.tsx +84 -0
- package/src/Calendar.tsx +125 -0
- package/src/Card.tsx +17 -0
- package/src/Checkbox.tsx +63 -0
- package/src/Circle.tsx +24 -0
- package/src/Column.tsx +12 -0
- package/src/DarkMode.tsx +99 -0
- package/src/DateInput.tsx +63 -0
- package/src/DatePicker.tsx +67 -0
- package/src/DatetimeInput.tsx +71 -0
- package/src/DesignBook.tsx +697 -0
- package/src/Dialog.tsx +144 -0
- package/src/Dropdown.tsx +129 -0
- package/src/Emitter.ts +26 -0
- package/src/FlexLayout.tsx +53 -0
- package/src/Icon.tsx +96 -0
- package/src/IconButton.tsx +66 -0
- package/src/IconLink.tsx +58 -0
- package/src/IconType.ts +787 -0
- package/src/Interactable.tsx +159 -0
- package/src/Link.tsx +86 -0
- package/src/List.tsx +41 -0
- package/src/ListButtonItem.tsx +69 -0
- package/src/ListDivider.tsx +13 -0
- package/src/ListHeaderItem.tsx +45 -0
- package/src/ListItem.tsx +27 -0
- package/src/ListLinkItem.tsx +76 -0
- package/src/ListSpacer.tsx +14 -0
- package/src/OnVisible.tsx +42 -0
- package/src/Popover.tsx +141 -0
- package/src/ProgressBar.tsx +63 -0
- package/src/ProgressCircle.tsx +38 -0
- package/src/Providers.tsx +33 -0
- package/src/RangeInput.tsx +82 -0
- package/src/ResultOrError.ts +15 -0
- package/src/RootView.tsx +55 -0
- package/src/Router.tsx +62 -0
- package/src/RouterState.tsx +154 -0
- package/src/Row.tsx +12 -0
- package/src/StackContext.tsx +52 -0
- package/src/StaticCheckbox.tsx +74 -0
- package/src/Storage.tsx +200 -0
- package/src/Stream.tsx +50 -0
- package/src/Sublist.tsx +62 -0
- package/src/SubmitIconInput.tsx +45 -0
- package/src/Tabs.tsx +103 -0
- package/src/Text.tsx +102 -0
- package/src/TextArea.tsx +45 -0
- package/src/TextInput.tsx +111 -0
- package/src/TextInputWithState.tsx +35 -0
- package/src/TextPairing.tsx +115 -0
- package/src/TimeInput.tsx +109 -0
- package/src/Tooltip.tsx +108 -0
- package/src/aria.ts +72 -0
- package/src/examples/ExampleDialog.tsx +28 -0
- package/src/guid.ts +7 -0
- package/src/hash.ts +21 -0
- package/src/index.ts +65 -0
- package/src/jss.tsx +607 -0
- package/src/numberToBase.ts +52 -0
- package/src/pages/Badge.mdx +30 -0
- package/src/pages/Button.mdx +57 -0
- package/src/pages/Calendar.mdx +60 -0
- package/src/pages/Checkbox.mdx +56 -0
- package/src/pages/Dialog.mdx +32 -0
- package/src/pages/FlexLayout.mdx +77 -0
- package/src/pages/Hashing.mdx +20 -0
- package/src/pages/Icon.mdx +63 -0
- package/src/pages/IconButton.mdx +144 -0
- package/src/pages/Link.mdx +57 -0
- package/src/pages/List.mdx +292 -0
- package/src/pages/ListHeader.mdx +94 -0
- package/src/pages/Popover.mdx +101 -0
- package/src/pages/ProgressBar.mdx +20 -0
- package/src/pages/ProgressCircle.mdx +35 -0
- package/src/pages/RangeInput.mdx +109 -0
- package/src/pages/Tabs.mdx +168 -0
- package/src/pages/Text.mdx +133 -0
- package/src/pages/TextInput.mdx +110 -0
- package/src/pages/TextPairing.mdx +155 -0
- package/src/pages/TimeInput.mdx +73 -0
- package/src/pages/Tooltip.mdx +28 -0
- package/src/pages/_app.tsx +561 -0
- package/src/pages/_document.tsx +30 -0
- package/src/pages/css-in-js.mdx +127 -0
- package/src/pages/index.mdx +58 -0
- package/src/pages/navigation.mdx +56 -0
- package/src/pages/prism.css +3 -0
- package/src/pages/useCookie.mdx +15 -0
- package/src/pages/useKeyboard.mdx +20 -0
- package/src/pages/useNavigation.mdx +30 -0
- package/src/pages/usePromise.mdx +15 -0
- package/src/pages/useRefEffect.mdx +49 -0
- package/src/stateMachineContextFactory.tsx +111 -0
- package/src/useCookie.tsx +89 -0
- package/src/useKeyboard.tsx +43 -0
- package/src/useNavigation.tsx +89 -0
- package/src/usePromise.tsx +18 -0
- package/src/useRefEffect.tsx +18 -0
- package/tsconfig.build.json +23 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Button } from "../Button";
|
|
2
|
+
import { Row } from "../Row";
|
|
3
|
+
|
|
4
|
+
# Button
|
|
5
|
+
|
|
6
|
+
This component can be used for the user to take actions with a single click.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Basic variants
|
|
11
|
+
|
|
12
|
+
The basic `Button` comes in three main variants, and a disabled style that applies to all three.
|
|
13
|
+
|
|
14
|
+
- Positive: actions that are going to create something or strongly agree
|
|
15
|
+
- Secondary: actions that are less central to the user experience
|
|
16
|
+
- Negative: actions that are going to delete data or remove something
|
|
17
|
+
- Disabled: actions that are not available
|
|
18
|
+
|
|
19
|
+
<Row gap="large" align="center" padding="large" justify="center">
|
|
20
|
+
<Button label="Positive" color="positive" onClick={() => {}} />
|
|
21
|
+
<Button label="Secondary" color="secondary" onClick={() => {}} />
|
|
22
|
+
<Button label="Negative" color="negative" onClick={() => {}} />
|
|
23
|
+
<Button label="Disabled" color="positive" disabled onClick={() => {}} />
|
|
24
|
+
</Row>
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
<Row gap="large" align="center" padding="large" justify="center">
|
|
28
|
+
<Button label="Positive" color="positive" onClick={() => {}} />
|
|
29
|
+
<Button label="Secondary" color="secondary" onClick={() => {}} />
|
|
30
|
+
<Button label="Negative" color="negative" onClick={() => {}} />
|
|
31
|
+
<Button label="Disabled" color="positive" disabled onClick={() => {}} />
|
|
32
|
+
</Row>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Bare variants
|
|
38
|
+
|
|
39
|
+
The bare `Button` variants fulfill the same function than the basic counterparts but have a lighter style that can be more easily integrated in complex components.
|
|
40
|
+
|
|
41
|
+
<Row gap="large" align="center" padding="large" justify="center">
|
|
42
|
+
<Button bare label="Positive" color="positive" onClick={() => {}} />
|
|
43
|
+
<Button bare label="Secondary" color="secondary" onClick={() => {}} />
|
|
44
|
+
<Button bare label="Negative" color="negative" onClick={() => {}} />
|
|
45
|
+
<Button bare label="Disabled" color="positive" disabled onClick={() => {}} />
|
|
46
|
+
</Row>
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
<Row gap="large" align="center" padding="large" justify="center">
|
|
50
|
+
<Button bare label="Positive" color="positive" onClick={() => {}} />
|
|
51
|
+
<Button bare label="Secondary" color="secondary" onClick={() => {}} />
|
|
52
|
+
<Button bare label="Negative" color="negative" onClick={() => {}} />
|
|
53
|
+
<Button bare label="Disabled" color="positive" disabled onClick={() => {}} />
|
|
54
|
+
</Row>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Calendar } from "../Calendar";
|
|
2
|
+
import { Box } from "../Box";
|
|
3
|
+
import { Badge } from "../Badge";
|
|
4
|
+
import { Span, H3 } from "../Text";
|
|
5
|
+
|
|
6
|
+
# Calendar
|
|
7
|
+
|
|
8
|
+
The calendar component is can be used to represent months, and is customisable through render callbacks for the header and cell elemtns
|
|
9
|
+
|
|
10
|
+
<Calendar
|
|
11
|
+
date={new Date()}
|
|
12
|
+
header={({ weekday }) => (
|
|
13
|
+
<Box>
|
|
14
|
+
<H3>{weekday}</H3>
|
|
15
|
+
</Box>
|
|
16
|
+
)}
|
|
17
|
+
cell={({ today, date, outOfMonth }) => (
|
|
18
|
+
<Box relative={true} jsStyle={{ opacity: outOfMonth ? 0.2 : 1 }}>
|
|
19
|
+
{today && (
|
|
20
|
+
<Badge
|
|
21
|
+
jsStyle={{
|
|
22
|
+
position: "absolute",
|
|
23
|
+
top: "50%",
|
|
24
|
+
transform: "translateY(-50%) translateX(-75%)",
|
|
25
|
+
right: "50%",
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
28
|
+
)}
|
|
29
|
+
<Span>{date.getDate()}</Span>
|
|
30
|
+
</Box>
|
|
31
|
+
)}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
<Calendar
|
|
36
|
+
date={new Date()}
|
|
37
|
+
header={({ weekday }) => (
|
|
38
|
+
<Box>
|
|
39
|
+
<H2>{weekday}</H2>
|
|
40
|
+
</Box>
|
|
41
|
+
)}
|
|
42
|
+
cell={({ today, date, outOfMonth }) => (
|
|
43
|
+
<Box relative={true} jsStyle={{ opacity: outOfMonth ? 0.2 : 1 }}>
|
|
44
|
+
{today && (
|
|
45
|
+
<Badge
|
|
46
|
+
jsStyle={{
|
|
47
|
+
position: "absolute",
|
|
48
|
+
top: "50%",
|
|
49
|
+
transform: "translateY(-50%) translateX(-75%)",
|
|
50
|
+
right: "50%",
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
)}
|
|
54
|
+
<Span>{date.getDate()}</Span>
|
|
55
|
+
</Box>
|
|
56
|
+
)}
|
|
57
|
+
/>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Checkbox } from "../Checkbox";
|
|
2
|
+
import { StaticCheckbox } from "../StaticCheckbox";
|
|
3
|
+
import { Column } from "../Column";
|
|
4
|
+
import { Row } from "../Row";
|
|
5
|
+
|
|
6
|
+
# Checkbox
|
|
7
|
+
|
|
8
|
+
The `Checkbox` component is an input of type checkbox with the visual style of a checkbox.
|
|
9
|
+
|
|
10
|
+
<Column>
|
|
11
|
+
<Row padding="medium" gap="medium" justify="center" align="center">
|
|
12
|
+
<Checkbox size="small" checked={true} onClick={() => {}} />
|
|
13
|
+
<Checkbox size="medium" checked={true} onClick={() => {}} />
|
|
14
|
+
<Checkbox size="large" checked={true} onClick={() => {}} />
|
|
15
|
+
</Row>
|
|
16
|
+
<Row padding="medium" gap="medium" justify="center" align="center">
|
|
17
|
+
<Checkbox size="small" checked={false} onClick={() => {}} />
|
|
18
|
+
<Checkbox size="medium" checked={false} onClick={() => {}} />
|
|
19
|
+
<Checkbox size="large" checked={false} onClick={() => {}} />
|
|
20
|
+
</Row>
|
|
21
|
+
</Column>
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
<Column>
|
|
25
|
+
<Row padding="medium" gap="medium" justify="center" align="center">
|
|
26
|
+
<Checkbox size="small" checked={true} onClick={() => {}} />
|
|
27
|
+
<Checkbox size="medium" checked={true} onClick={() => {}} />
|
|
28
|
+
<Checkbox size="large" checked={true} onClick={() => {}} />
|
|
29
|
+
</Row>
|
|
30
|
+
<Row padding="medium" gap="medium" justify="center" align="center">
|
|
31
|
+
<Checkbox size="small" checked={false} onClick={() => {}} />
|
|
32
|
+
<Checkbox size="medium" checked={false} onClick={() => {}} />
|
|
33
|
+
<Checkbox size="large" checked={false} onClick={() => {}} />
|
|
34
|
+
</Row>
|
|
35
|
+
</Column>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Static checkbox
|
|
41
|
+
|
|
42
|
+
The variant `StaticCheckbox` can be used when one only needs the visual representation of a checkbox but the `<input type="checkbox" />` does not make sense.
|
|
43
|
+
|
|
44
|
+
<Row padding="medium" gap="medium" justify="center" align="center">
|
|
45
|
+
<StaticCheckbox size="small" checked={true} />
|
|
46
|
+
<StaticCheckbox size="medium" checked={true} />
|
|
47
|
+
<StaticCheckbox size="large" checked={true} />
|
|
48
|
+
</Row>
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
<Row padding="medium" gap="medium" justify="center" align="center">
|
|
52
|
+
<StaticCheckbox size="small" checked={true} />
|
|
53
|
+
<StaticCheckbox size="medium" checked={true} />
|
|
54
|
+
<StaticCheckbox size="large" checked={true} />
|
|
55
|
+
</Row>
|
|
56
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DialogTrigger } from "../examples/ExampleDialog.tsx";
|
|
2
|
+
|
|
3
|
+
# Dialog
|
|
4
|
+
|
|
5
|
+
The `Dialog` component can be used to show a modal window on top of the main UI. When visible, it will trap focus and clicks to the underlying UI, which is the required behaviour for acceessibility.
|
|
6
|
+
|
|
7
|
+
<DialogTrigger />
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
function ExampleDialog({ close }) {
|
|
11
|
+
return (
|
|
12
|
+
<Dialog close={close} label="Example">
|
|
13
|
+
<Row padding="medium" align="center" justify="space-between">
|
|
14
|
+
<Span>Dark mode</Span>
|
|
15
|
+
<DarkModeToggle />
|
|
16
|
+
</Row>
|
|
17
|
+
</Dialog>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function DialogTrigger() {
|
|
22
|
+
const { open } = useDialog<void>(
|
|
23
|
+
({ close }) => <ExampleDialog close={close} />,
|
|
24
|
+
{ closeOnOutsideClick: true }
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
return <Button label="Show dialog" color={"positive"} onClick={() => open()} />;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Column } from "../Column";
|
|
2
|
+
import { Row } from "../Row";
|
|
3
|
+
import { Badge } from "../Badge";
|
|
4
|
+
import { cssVar } from "../jss";
|
|
5
|
+
|
|
6
|
+
# FlexLayout
|
|
7
|
+
|
|
8
|
+
Because flex is so common there are a `Row` and a `Column` components, with a lot of utility that mean it is very easy to create complex layouts without having to create extra styles.
|
|
9
|
+
|
|
10
|
+
- justify: like the `justify-content` flex property.
|
|
11
|
+
- gap: like the `gap` property, it accepts any `Size`.
|
|
12
|
+
- align: like the `align-items` flex property.
|
|
13
|
+
- padding: like the `padding` property, it accepts any `Padding`.
|
|
14
|
+
|
|
15
|
+
<Column gap="medium">
|
|
16
|
+
<Row
|
|
17
|
+
jsStyle={{ border: `1px solid ${cssVar("--highlight")}` }}
|
|
18
|
+
justify="space-around"
|
|
19
|
+
align="center"
|
|
20
|
+
>
|
|
21
|
+
<Badge />
|
|
22
|
+
<Badge />
|
|
23
|
+
<Badge />
|
|
24
|
+
</Row>
|
|
25
|
+
<Row
|
|
26
|
+
jsStyle={{ border: `1px solid ${cssVar("--highlight")}` }}
|
|
27
|
+
justify="space-evenly"
|
|
28
|
+
align="center"
|
|
29
|
+
>
|
|
30
|
+
<Badge />
|
|
31
|
+
<Badge />
|
|
32
|
+
<Badge />
|
|
33
|
+
</Row>
|
|
34
|
+
<Row
|
|
35
|
+
jsStyle={{ border: `1px solid ${cssVar("--highlight")}` }}
|
|
36
|
+
justify="space-between"
|
|
37
|
+
align="center"
|
|
38
|
+
>
|
|
39
|
+
<Badge />
|
|
40
|
+
<Badge />
|
|
41
|
+
<Badge />
|
|
42
|
+
</Row>
|
|
43
|
+
</Column>
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
<Column gap="medium">
|
|
47
|
+
<Row
|
|
48
|
+
jsStyle={{ border: `1px solid ${cssVar("--highlight")}` }}
|
|
49
|
+
justify="space-around"
|
|
50
|
+
align="center"
|
|
51
|
+
>
|
|
52
|
+
<Badge />
|
|
53
|
+
<Badge />
|
|
54
|
+
<Badge />
|
|
55
|
+
</Row>
|
|
56
|
+
<Row
|
|
57
|
+
jsStyle={{ border: `1px solid ${cssVar("--highlight")}` }}
|
|
58
|
+
justify="space-evenly"
|
|
59
|
+
align="center"
|
|
60
|
+
>
|
|
61
|
+
<Badge />
|
|
62
|
+
<Badge />
|
|
63
|
+
<Badge />
|
|
64
|
+
</Row>
|
|
65
|
+
<Row
|
|
66
|
+
jsStyle={{ border: `1px solid ${cssVar("--highlight")}` }}
|
|
67
|
+
justify="space-between"
|
|
68
|
+
align="center"
|
|
69
|
+
>
|
|
70
|
+
<Badge />
|
|
71
|
+
<Badge />
|
|
72
|
+
<Badge />
|
|
73
|
+
</Row>
|
|
74
|
+
</Column>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Hashing and unique IDs
|
|
2
|
+
|
|
3
|
+
## hash
|
|
4
|
+
|
|
5
|
+
The `hash` function can be used to create a numeric hash from a given string. If you want to constraint the hashing space you can pass an optional modulus.
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
const id = hash("ABC"); // 64578
|
|
9
|
+
const small_id = hash("ABC", 10); // 8
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## numberToBase
|
|
13
|
+
|
|
14
|
+
The `numberToBase` util will transform any number to an arbitrary base represented as a string of characters (e.g. the base two could be ["0", "1"]). This can be useful to convert between numeric representations or to compress big numbers. It defaults to a base of 26 elements formed of the English alphabet.
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
const id_base_26 = numberToBase(hash("ABC")); // cqmv
|
|
18
|
+
const id_base_2 = numberToBase(hash("ABC"), ["?", "!"]); //!!!!!???!???!?!
|
|
19
|
+
const id_base_2 = numberToBase(8, ["1", "0"]); // 100
|
|
20
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Icon } from "../Icon";
|
|
2
|
+
import { Row } from "../Row";
|
|
3
|
+
import { Column } from "../Column";
|
|
4
|
+
|
|
5
|
+
# Icon
|
|
6
|
+
|
|
7
|
+
The `Icon` component uses [iconify](https://github.com/iconify/iconify) under the hood so it makes thousands of different icons available.
|
|
8
|
+
|
|
9
|
+
<Column gap="medium">
|
|
10
|
+
<Row justify="space-around">
|
|
11
|
+
<Icon icon="fa-reddit-alien" color="primary" size="small" />
|
|
12
|
+
<Icon icon="fa-reddit-square" color="secondary" size="small" />
|
|
13
|
+
<Icon icon="fa-refresh" color="highlight" size="small" />
|
|
14
|
+
<Icon icon="fa-registered" color="negative" size="small" />
|
|
15
|
+
<Icon icon="fa-remove" color="subtle" size="small" />
|
|
16
|
+
<Icon icon="fa-renren" color="light" size="small" />
|
|
17
|
+
</Row>
|
|
18
|
+
<Row justify="space-around">
|
|
19
|
+
<Icon icon="fa-reddit-alien" color="primary" size="medium" />
|
|
20
|
+
<Icon icon="fa-reddit-square" color="secondary" size="medium" />
|
|
21
|
+
<Icon icon="fa-refresh" color="highlight" size="medium" />
|
|
22
|
+
<Icon icon="fa-registered" color="negative" size="medium" />
|
|
23
|
+
<Icon icon="fa-remove" color="subtle" size="medium" />
|
|
24
|
+
<Icon icon="fa-renren" color="light" size="medium" />
|
|
25
|
+
</Row>
|
|
26
|
+
<Row justify="space-around">
|
|
27
|
+
<Icon icon="fa-reddit-alien" color="primary" size="large" />
|
|
28
|
+
<Icon icon="fa-reddit-square" color="secondary" size="large" />
|
|
29
|
+
<Icon icon="fa-refresh" color="highlight" size="large" />
|
|
30
|
+
<Icon icon="fa-registered" color="negative" size="large" />
|
|
31
|
+
<Icon icon="fa-remove" color="subtle" size="large" />
|
|
32
|
+
<Icon icon="fa-renren" color="light" size="large" />
|
|
33
|
+
</Row>
|
|
34
|
+
</Column>
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
<Column gap="medium">
|
|
38
|
+
<Row justify="space-around">
|
|
39
|
+
<Icon icon="fa-reddit-alien" color="primary" size="small" />
|
|
40
|
+
<Icon icon="fa-reddit-square" color="secondary" size="small" />
|
|
41
|
+
<Icon icon="fa-refresh" color="highlight" size="small" />
|
|
42
|
+
<Icon icon="fa-registered" color="negative" size="small" />
|
|
43
|
+
<Icon icon="fa-remove" color="subtle" size="small" />
|
|
44
|
+
<Icon icon="fa-renren" color="light" size="small" />
|
|
45
|
+
</Row>
|
|
46
|
+
<Row justify="space-around">
|
|
47
|
+
<Icon icon="fa-reddit-alien" color="primary" size="medium" />
|
|
48
|
+
<Icon icon="fa-reddit-square" color="secondary" size="medium" />
|
|
49
|
+
<Icon icon="fa-refresh" color="highlight" size="medium" />
|
|
50
|
+
<Icon icon="fa-registered" color="negative" size="medium" />
|
|
51
|
+
<Icon icon="fa-remove" color="subtle" size="medium" />
|
|
52
|
+
<Icon icon="fa-renren" color="light" size="medium" />
|
|
53
|
+
</Row>
|
|
54
|
+
<Row justify="space-around">
|
|
55
|
+
<Icon icon="fa-reddit-alien" color="primary" size="large" />
|
|
56
|
+
<Icon icon="fa-reddit-square" color="secondary" size="large" />
|
|
57
|
+
<Icon icon="fa-refresh" color="highlight" size="large" />
|
|
58
|
+
<Icon icon="fa-registered" color="negative" size="large" />
|
|
59
|
+
<Icon icon="fa-remove" color="subtle" size="large" />
|
|
60
|
+
<Icon icon="fa-renren" color="light" size="large" />
|
|
61
|
+
</Row>
|
|
62
|
+
</Column>
|
|
63
|
+
```
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { IconButton } from "../IconButton";
|
|
2
|
+
import { Row } from "../Row";
|
|
3
|
+
|
|
4
|
+
# IconButton
|
|
5
|
+
|
|
6
|
+
This component is similar to the `Button` component but is styled simply as a circle containing an icon.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Basic variants
|
|
11
|
+
|
|
12
|
+
The basic `IconButton` is useful to create compound components in which it is harder to fit a button with a text description. Choosing the right icon will be helpful for the users, and in some cases a tooltip may be necessary to explain the intent.
|
|
13
|
+
|
|
14
|
+
<Row gap="large" align="center" padding="large" justify="center">
|
|
15
|
+
<IconButton
|
|
16
|
+
size="medium"
|
|
17
|
+
icon="fa-check"
|
|
18
|
+
color="positive"
|
|
19
|
+
onClick={() => {}}
|
|
20
|
+
/>
|
|
21
|
+
<IconButton
|
|
22
|
+
size="medium"
|
|
23
|
+
icon="fa-check"
|
|
24
|
+
color="secondary"
|
|
25
|
+
onClick={() => {}}
|
|
26
|
+
/>
|
|
27
|
+
<IconButton
|
|
28
|
+
size="medium"
|
|
29
|
+
icon="fa-check"
|
|
30
|
+
color="negative"
|
|
31
|
+
onClick={() => {}}
|
|
32
|
+
/>
|
|
33
|
+
<IconButton
|
|
34
|
+
size="medium"
|
|
35
|
+
icon="fa-check"
|
|
36
|
+
color="positive"
|
|
37
|
+
disabled
|
|
38
|
+
onClick={() => {}}
|
|
39
|
+
/>
|
|
40
|
+
</Row>
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
<Row gap="large" align="center" padding="large" justify="center">
|
|
44
|
+
<IconButton
|
|
45
|
+
size="medium"
|
|
46
|
+
icon="fa-check"
|
|
47
|
+
color="positive"
|
|
48
|
+
onClick={() => {}}
|
|
49
|
+
/>
|
|
50
|
+
<IconButton
|
|
51
|
+
size="medium"
|
|
52
|
+
icon="fa-check"
|
|
53
|
+
color="secondary"
|
|
54
|
+
onClick={() => {}}
|
|
55
|
+
/>
|
|
56
|
+
<IconButton
|
|
57
|
+
size="medium"
|
|
58
|
+
icon="fa-check"
|
|
59
|
+
color="negative"
|
|
60
|
+
onClick={() => {}}
|
|
61
|
+
/>
|
|
62
|
+
<IconButton
|
|
63
|
+
size="medium"
|
|
64
|
+
icon="fa-check"
|
|
65
|
+
color="positive"
|
|
66
|
+
disabled
|
|
67
|
+
onClick={() => {}}
|
|
68
|
+
/>
|
|
69
|
+
</Row>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Bare variants
|
|
75
|
+
|
|
76
|
+
The bare `IconButton` is even more subtle than the bare `Button` so it can be used to make the interface feel ligther.
|
|
77
|
+
|
|
78
|
+
<Row gap="large" align="center" justify="center">
|
|
79
|
+
<IconButton
|
|
80
|
+
size="medium"
|
|
81
|
+
bare
|
|
82
|
+
icon="fa-check"
|
|
83
|
+
color="positive"
|
|
84
|
+
onClick={() => {}}
|
|
85
|
+
/>
|
|
86
|
+
<IconButton
|
|
87
|
+
size="medium"
|
|
88
|
+
bare
|
|
89
|
+
icon="fa-check"
|
|
90
|
+
color="secondary"
|
|
91
|
+
onClick={() => {}}
|
|
92
|
+
/>
|
|
93
|
+
<IconButton
|
|
94
|
+
size="medium"
|
|
95
|
+
bare
|
|
96
|
+
icon="fa-check"
|
|
97
|
+
color="negative"
|
|
98
|
+
onClick={() => {}}
|
|
99
|
+
/>
|
|
100
|
+
<IconButton
|
|
101
|
+
size="medium"
|
|
102
|
+
bare
|
|
103
|
+
icon="fa-check"
|
|
104
|
+
color="positive"
|
|
105
|
+
disabled
|
|
106
|
+
onClick={() => {}}
|
|
107
|
+
/>
|
|
108
|
+
</Row>
|
|
109
|
+
|
|
110
|
+
```js
|
|
111
|
+
<Row gap="large" align="center" justify="center">
|
|
112
|
+
<IconButton
|
|
113
|
+
size="medium"
|
|
114
|
+
bare
|
|
115
|
+
icon="fa-check"
|
|
116
|
+
color="positive"
|
|
117
|
+
onClick={() => {}}
|
|
118
|
+
/>
|
|
119
|
+
<IconButton
|
|
120
|
+
size="medium"
|
|
121
|
+
bare
|
|
122
|
+
icon="fa-check"
|
|
123
|
+
color="secondary"
|
|
124
|
+
onClick={() => {}}
|
|
125
|
+
/>
|
|
126
|
+
<IconButton
|
|
127
|
+
size="medium"
|
|
128
|
+
bare
|
|
129
|
+
icon="fa-check"
|
|
130
|
+
color="negative"
|
|
131
|
+
onClick={() => {}}
|
|
132
|
+
/>
|
|
133
|
+
<IconButton
|
|
134
|
+
size="medium"
|
|
135
|
+
bare
|
|
136
|
+
icon="fa-check"
|
|
137
|
+
color="positive"
|
|
138
|
+
disabled
|
|
139
|
+
onClick={() => {}}
|
|
140
|
+
/>
|
|
141
|
+
</Row>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Link } from "../Link";
|
|
2
|
+
import { Row } from "../Row";
|
|
3
|
+
|
|
4
|
+
# Link
|
|
5
|
+
|
|
6
|
+
The `Link` component looks the same as the `Button` component and the only difference is that the underlying HTML is an anchor tag.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Basic variants
|
|
11
|
+
|
|
12
|
+
The basic `Link` comes in three main variants, and a disabled style that applies to all three.
|
|
13
|
+
|
|
14
|
+
- Positive: actions that are going to create something or strongly agree
|
|
15
|
+
- Secondary: actions that are less central to the user experience
|
|
16
|
+
- Negative: actions that are going to delete data or remove something
|
|
17
|
+
- Disabled: actions that are not available
|
|
18
|
+
|
|
19
|
+
<Row gap="large" align="center" padding="large" justify="center">
|
|
20
|
+
<Link label="Positive" color="positive" href="/" />
|
|
21
|
+
<Link label="Secondary" color="secondary" href="/" />
|
|
22
|
+
<Link label="Negative" color="negative" href="/" />
|
|
23
|
+
<Link label="Disabled" color="positive" disabled href="/" />
|
|
24
|
+
</Row>
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
<Row gap="large" align="center" padding="large" justify="center">
|
|
28
|
+
<Link label="Positive" color="positive" href="/" />
|
|
29
|
+
<Link label="Secondary" color="secondary" href="/" />
|
|
30
|
+
<Link label="Negative" color="negative" href="/" />
|
|
31
|
+
<Link label="Disabled" color="positive" disabled href="/" />
|
|
32
|
+
</Row>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Bare variants
|
|
38
|
+
|
|
39
|
+
The bare `Link` variants fulfill the same function than the basic counterparts but have a lighter style that can be more easily integrated in complex components.
|
|
40
|
+
|
|
41
|
+
<Row gap="large" align="center" padding="large" justify="center">
|
|
42
|
+
<Link bare label="Positive" color="positive" href="/" />
|
|
43
|
+
<Link bare label="Secondary" color="secondary" href="/" />
|
|
44
|
+
<Link bare label="Negative" color="negative" href="/" />
|
|
45
|
+
<Link bare label="Disabled" color="positive" disabled href="/" />
|
|
46
|
+
</Row>
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
<Row gap="large" align="center" padding="large" justify="center">
|
|
50
|
+
<Link bare label="Positive" color="positive" href="/" />
|
|
51
|
+
<Link bare label="Secondary" color="secondary" href="/" />
|
|
52
|
+
<Link bare label="Negative" color="negative" href="/" />
|
|
53
|
+
<Link bare label="Disabled" color="positive" disabled href="/" />
|
|
54
|
+
</Row>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|