aidos-ui 4.0.0 → 4.0.2
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/.claude/settings.local.json +14 -1
- package/CLAUDE.md +72 -0
- package/dist/BaseButton.js.map +1 -1
- package/dist/BaseLink.js.map +1 -1
- package/dist/BaseListItem.d.ts +1 -1
- package/dist/Calendar.d.ts +2 -2
- package/dist/Card.js +1 -1
- package/dist/Card.js.map +1 -1
- package/dist/DarkMode.js.map +1 -1
- package/dist/DatePicker.js.map +1 -1
- package/dist/Dialog.d.ts +3 -3
- package/dist/Dialog.js +7 -1
- package/dist/Dialog.js.map +1 -1
- package/dist/Dropdown.js.map +1 -1
- package/dist/Icon.d.ts +3 -3
- package/dist/Icon.js +2 -21
- package/dist/Icon.js.map +1 -1
- package/dist/Interactable.js.map +1 -1
- package/dist/NextJSRouterState.js.map +1 -1
- package/dist/OnVisible.d.ts +1 -1
- package/dist/OnVisible.js.map +1 -1
- package/dist/Popover.d.ts +3 -3
- package/dist/Popover.js +3 -1
- package/dist/Popover.js.map +1 -1
- package/dist/Providers.d.ts +2 -2
- package/dist/RangeInput.d.ts +1 -1
- package/dist/RootView.js.map +1 -1
- package/dist/Select.d.ts +0 -1
- package/dist/Storage.d.ts +2 -1
- package/dist/Storage.js.map +1 -1
- package/dist/Stream.js.map +1 -1
- package/dist/Text.js.map +1 -1
- package/dist/TextInput.d.ts +3 -2
- package/dist/TextInput.js +13 -4
- package/dist/TextInput.js.map +1 -1
- package/dist/TextPairing.js.map +1 -1
- package/dist/Tooltip.d.ts +2 -2
- package/dist/Tooltip.js +3 -2
- package/dist/Tooltip.js.map +1 -1
- package/dist/aria.js.map +1 -1
- package/dist/hash.js.map +1 -1
- package/dist/jss.d.ts +11 -6
- package/dist/jss.js +47 -2
- package/dist/jss.js.map +1 -1
- package/dist/numberToBase.js.map +1 -1
- package/dist/stateMachineContextFactory.js.map +1 -1
- package/dist/useCookie.js.map +1 -1
- package/dist/useKeyboard.js.map +1 -1
- package/dist/useNavigation.js.map +1 -1
- package/dist/useRefEffect.js.map +1 -1
- package/next-env.d.ts +2 -1
- package/next.config.js +2 -1
- package/package.json +27 -20
- package/src/BaseListItem.tsx +1 -1
- package/src/Calendar.tsx +2 -2
- package/src/Card.tsx +1 -1
- package/src/Dialog.tsx +10 -4
- package/src/Icon.tsx +4 -30
- package/src/Popover.tsx +6 -4
- package/src/Providers.tsx +1 -1
- package/src/RangeInput.tsx +1 -1
- package/src/Storage.tsx +1 -1
- package/src/TextInput.tsx +17 -5
- package/src/Tooltip.tsx +5 -4
- package/src/docs/mdx.tsx +40 -0
- package/src/docs/searchIndex.ts +1 -1
- package/src/jss.tsx +55 -3
- package/src/pages/Badge.mdx +136 -14
- package/src/pages/Button.mdx +121 -63
- package/src/pages/Calendar.mdx +196 -2
- package/src/pages/Card.mdx +123 -47
- package/src/pages/Checkbox.mdx +103 -28
- package/src/pages/Dialog.mdx +172 -7
- package/src/pages/FlexLayout.mdx +185 -51
- package/src/pages/Hashing.mdx +199 -8
- package/src/pages/Icon.mdx +150 -42
- package/src/pages/IconButton.mdx +127 -116
- package/src/pages/Link.mdx +118 -47
- package/src/pages/List.mdx +167 -283
- package/src/pages/ListHeader.mdx +157 -27
- package/src/pages/Popover.mdx +177 -55
- package/src/pages/ProgressBar.mdx +186 -6
- package/src/pages/ProgressCircle.mdx +196 -13
- package/src/pages/RangeInput.mdx +189 -61
- package/src/pages/Tabs.mdx +202 -346
- package/src/pages/Text.mdx +102 -81
- package/src/pages/TextInput.mdx +169 -44
- package/src/pages/TextPairing.mdx +164 -115
- package/src/pages/TimeInput.mdx +142 -37
- package/src/pages/Tooltip.mdx +99 -12
- package/src/pages/_app.tsx +13 -3
- package/src/pages/css-in-js.mdx +196 -83
- package/src/pages/navigation.mdx +122 -20
- package/src/pages/useCookie.mdx +168 -7
- package/src/pages/useKeyboard.mdx +242 -5
- package/src/pages/useNavigation.mdx +244 -16
- package/src/pages/usePromise.mdx +271 -6
- package/src/pages/useRefEffect.mdx +230 -28
- package/tsconfig.json +13 -4
package/src/jss.tsx
CHANGED
|
@@ -210,7 +210,7 @@ export function JSSProvider({
|
|
|
210
210
|
children,
|
|
211
211
|
}: {
|
|
212
212
|
themes: { dark: Theme; light: Theme };
|
|
213
|
-
children: JSX.Element;
|
|
213
|
+
children: React.JSX.Element;
|
|
214
214
|
}) {
|
|
215
215
|
const stylesRef = useRef<string[] | null>(null);
|
|
216
216
|
|
|
@@ -405,6 +405,13 @@ export type Theme = {
|
|
|
405
405
|
["--border-radius-m"]: string;
|
|
406
406
|
["--border-radius-l"]: string;
|
|
407
407
|
["--nav-bar-height"]: string;
|
|
408
|
+
/* Shadows */
|
|
409
|
+
["--shadow-sm"]: string;
|
|
410
|
+
["--shadow-md"]: string;
|
|
411
|
+
["--shadow-lg"]: string;
|
|
412
|
+
/* Transitions */
|
|
413
|
+
["--transition-fast"]: string;
|
|
414
|
+
["--transition-normal"]: string;
|
|
408
415
|
};
|
|
409
416
|
|
|
410
417
|
export const lightTheme: Theme = {
|
|
@@ -454,6 +461,13 @@ export const lightTheme: Theme = {
|
|
|
454
461
|
["--border-radius-m"]: "4px",
|
|
455
462
|
["--border-radius-l"]: "8px",
|
|
456
463
|
["--nav-bar-height"]: "50px",
|
|
464
|
+
/* Shadows */
|
|
465
|
+
["--shadow-sm"]: "0 1px 2px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1)",
|
|
466
|
+
["--shadow-md"]: "0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05)",
|
|
467
|
+
["--shadow-lg"]: "0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1)",
|
|
468
|
+
/* Transitions */
|
|
469
|
+
["--transition-fast"]: "0.15s ease",
|
|
470
|
+
["--transition-normal"]: "0.2s ease",
|
|
457
471
|
};
|
|
458
472
|
|
|
459
473
|
export const darkTheme: Theme = {
|
|
@@ -503,6 +517,13 @@ export const darkTheme: Theme = {
|
|
|
503
517
|
["--border-radius-m"]: "4px",
|
|
504
518
|
["--border-radius-l"]: "8px",
|
|
505
519
|
["--nav-bar-height"]: "50px",
|
|
520
|
+
/* Shadows - stronger for dark mode to be visible */
|
|
521
|
+
["--shadow-sm"]: "0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.3)",
|
|
522
|
+
["--shadow-md"]: "0 4px 6px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.2)",
|
|
523
|
+
["--shadow-lg"]: "0 10px 25px rgba(0, 0, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.25)",
|
|
524
|
+
/* Transitions */
|
|
525
|
+
["--transition-fast"]: "0.15s ease",
|
|
526
|
+
["--transition-normal"]: "0.2s ease",
|
|
506
527
|
};
|
|
507
528
|
|
|
508
529
|
export const baseStyles = `
|
|
@@ -527,6 +548,37 @@ body {
|
|
|
527
548
|
background-color: ${cssVar("--primary-background")};
|
|
528
549
|
}
|
|
529
550
|
|
|
551
|
+
@keyframes dialogFadeIn {
|
|
552
|
+
from {
|
|
553
|
+
opacity: 0;
|
|
554
|
+
transform: scale(0.95) translateY(-10px);
|
|
555
|
+
}
|
|
556
|
+
to {
|
|
557
|
+
opacity: 1;
|
|
558
|
+
transform: scale(1) translateY(0);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
@keyframes backdropFadeIn {
|
|
563
|
+
from {
|
|
564
|
+
opacity: 0;
|
|
565
|
+
}
|
|
566
|
+
to {
|
|
567
|
+
opacity: 1;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
@keyframes popoverFadeIn {
|
|
572
|
+
from {
|
|
573
|
+
opacity: 0;
|
|
574
|
+
transform: scale(0.95);
|
|
575
|
+
}
|
|
576
|
+
to {
|
|
577
|
+
opacity: 1;
|
|
578
|
+
transform: scale(1);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
530
582
|
`;
|
|
531
583
|
|
|
532
584
|
const backgroundStyles = {
|
|
@@ -534,10 +586,10 @@ const backgroundStyles = {
|
|
|
534
586
|
backgroundColor: cssVar("--highlight"),
|
|
535
587
|
},
|
|
536
588
|
light: {
|
|
537
|
-
backgroundColor: "
|
|
589
|
+
backgroundColor: cssVar("--light-text"),
|
|
538
590
|
},
|
|
539
591
|
dark: {
|
|
540
|
-
backgroundColor: "
|
|
592
|
+
backgroundColor: cssVar("--primary-text"),
|
|
541
593
|
},
|
|
542
594
|
warning: {
|
|
543
595
|
backgroundColor: cssVar("--warning"),
|
package/src/pages/Badge.mdx
CHANGED
|
@@ -1,30 +1,152 @@
|
|
|
1
1
|
import { Badge } from "../Badge";
|
|
2
2
|
import { Row } from "../Row";
|
|
3
|
+
import { Column } from "../Column";
|
|
4
|
+
import { Span } from "../Text";
|
|
5
|
+
import { IconButton } from "../IconButton";
|
|
3
6
|
|
|
4
7
|
# Badge
|
|
5
8
|
|
|
6
|
-
|
|
9
|
+
A small circular indicator used to draw attention to specific UI elements. Common uses include notification counts, status indicators, and visual markers.
|
|
7
10
|
|
|
8
11
|
---
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
## Props
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
|------|------|---------|-------------|
|
|
17
|
+
| `size` | `Size` | `"medium"` | Badge size: `"xsmall"` (4px), `"small"` (6px), `"medium"` (12px), `"large"` (18px), `"xlarge"` (24px) |
|
|
18
|
+
| `color` | `Color` | `"highlight"` | Background color from theme |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Sizes
|
|
23
|
+
|
|
24
|
+
<Row gap="large" align="center" justify="center" padding="medium">
|
|
25
|
+
<Column align="center" gap="small">
|
|
26
|
+
<Badge size="xsmall" />
|
|
27
|
+
<Span size="small" color="secondary">xsmall</Span>
|
|
28
|
+
</Column>
|
|
29
|
+
<Column align="center" gap="small">
|
|
30
|
+
<Badge size="small" />
|
|
31
|
+
<Span size="small" color="secondary">small</Span>
|
|
32
|
+
</Column>
|
|
33
|
+
<Column align="center" gap="small">
|
|
34
|
+
<Badge size="medium" />
|
|
35
|
+
<Span size="small" color="secondary">medium</Span>
|
|
36
|
+
</Column>
|
|
37
|
+
<Column align="center" gap="small">
|
|
38
|
+
<Badge size="large" />
|
|
39
|
+
<Span size="small" color="secondary">large</Span>
|
|
40
|
+
</Column>
|
|
41
|
+
<Column align="center" gap="small">
|
|
42
|
+
<Badge size="xlarge" />
|
|
43
|
+
<Span size="small" color="secondary">xlarge</Span>
|
|
44
|
+
</Column>
|
|
18
45
|
</Row>
|
|
19
46
|
|
|
20
47
|
```js
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
48
|
+
<Badge size="xsmall" /> // 4px
|
|
49
|
+
<Badge size="small" /> // 6px
|
|
50
|
+
<Badge size="medium" /> // 12px (default)
|
|
51
|
+
<Badge size="large" /> // 18px
|
|
52
|
+
<Badge size="xlarge" /> // 24px
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Colors
|
|
58
|
+
|
|
59
|
+
<Row gap="large" align="center" justify="center" padding="medium">
|
|
60
|
+
<Column align="center" gap="small">
|
|
61
|
+
<Badge color="highlight" />
|
|
62
|
+
<Span size="small" color="secondary">highlight</Span>
|
|
63
|
+
</Column>
|
|
64
|
+
<Column align="center" gap="small">
|
|
65
|
+
<Badge color="negative" />
|
|
66
|
+
<Span size="small" color="secondary">negative</Span>
|
|
67
|
+
</Column>
|
|
68
|
+
<Column align="center" gap="small">
|
|
69
|
+
<Badge color="warning" />
|
|
70
|
+
<Span size="small" color="secondary">warning</Span>
|
|
71
|
+
</Column>
|
|
72
|
+
<Column align="center" gap="small">
|
|
73
|
+
<Badge color="divider" />
|
|
74
|
+
<Span size="small" color="secondary">divider</Span>
|
|
75
|
+
</Column>
|
|
27
76
|
</Row>
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
<Badge color="highlight" /> // Accent/brand color
|
|
80
|
+
<Badge color="negative" /> // Error/alert
|
|
81
|
+
<Badge color="warning" /> // Warning
|
|
82
|
+
<Badge color="divider" /> // Neutral/muted
|
|
28
83
|
```
|
|
29
84
|
|
|
30
85
|
---
|
|
86
|
+
|
|
87
|
+
## Common use cases
|
|
88
|
+
|
|
89
|
+
### Notification indicator
|
|
90
|
+
|
|
91
|
+
<Row gap="medium" align="center" padding="medium">
|
|
92
|
+
<Row jss={{ position: "relative" }}>
|
|
93
|
+
<IconButton bare icon="fa-bell" size="large" color="secondary" onClick={() => {}} />
|
|
94
|
+
<Badge size="small" color="negative" jss={{ position: "absolute", top: 0, right: 0 }} />
|
|
95
|
+
</Row>
|
|
96
|
+
<Span color="secondary">Unread notifications</Span>
|
|
97
|
+
</Row>
|
|
98
|
+
|
|
99
|
+
```js
|
|
100
|
+
<Row jss={{ position: "relative" }}>
|
|
101
|
+
<IconButton bare icon="fa-bell" size="large" color="secondary" onClick={() => {}} />
|
|
102
|
+
<Badge
|
|
103
|
+
size="small"
|
|
104
|
+
color="negative"
|
|
105
|
+
jss={{ position: "absolute", top: 0, right: 0 }}
|
|
106
|
+
/>
|
|
107
|
+
</Row>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Status indicator
|
|
111
|
+
|
|
112
|
+
<Column gap="small" padding="medium">
|
|
113
|
+
<Row gap="small" align="center">
|
|
114
|
+
<Badge size="small" color="highlight" />
|
|
115
|
+
<Span>Online</Span>
|
|
116
|
+
</Row>
|
|
117
|
+
<Row gap="small" align="center">
|
|
118
|
+
<Badge size="small" color="warning" />
|
|
119
|
+
<Span>Away</Span>
|
|
120
|
+
</Row>
|
|
121
|
+
<Row gap="small" align="center">
|
|
122
|
+
<Badge size="small" color="divider" />
|
|
123
|
+
<Span>Offline</Span>
|
|
124
|
+
</Row>
|
|
125
|
+
</Column>
|
|
126
|
+
|
|
127
|
+
```js
|
|
128
|
+
<Row gap="small" align="center">
|
|
129
|
+
<Badge size="small" color="highlight" />
|
|
130
|
+
<Span>Online</Span>
|
|
131
|
+
</Row>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Visual markers
|
|
137
|
+
|
|
138
|
+
Use badges to highlight new or important items:
|
|
139
|
+
|
|
140
|
+
<Row gap="medium" align="center" padding="medium">
|
|
141
|
+
<Row gap="small" align="center">
|
|
142
|
+
<Span>New feature</Span>
|
|
143
|
+
<Badge size="xsmall" color="highlight" />
|
|
144
|
+
</Row>
|
|
145
|
+
</Row>
|
|
146
|
+
|
|
147
|
+
```js
|
|
148
|
+
<Row gap="small" align="center">
|
|
149
|
+
<Span>New feature</Span>
|
|
150
|
+
<Badge size="xsmall" color="highlight" />
|
|
151
|
+
</Row>
|
|
152
|
+
```
|
package/src/pages/Button.mdx
CHANGED
|
@@ -1,105 +1,163 @@
|
|
|
1
1
|
import { Button } from "../Button";
|
|
2
2
|
import { Row } from "../Row";
|
|
3
|
+
import { Column } from "../Column";
|
|
4
|
+
import { Icon } from "../Icon";
|
|
3
5
|
|
|
4
6
|
# Button
|
|
5
7
|
|
|
6
|
-
The `Button` component
|
|
8
|
+
The `Button` component enables users to trigger actions with a single click. It supports multiple color variants for different semantic purposes and can include icons.
|
|
7
9
|
|
|
8
10
|
---
|
|
9
11
|
|
|
10
|
-
##
|
|
12
|
+
## Props
|
|
13
|
+
|
|
14
|
+
| Prop | Type | Required | Default | Description |
|
|
15
|
+
|------|------|----------|---------|-------------|
|
|
16
|
+
| `children` | `string` | Yes | - | Button text label |
|
|
17
|
+
| `color` | `InteractableColor` | Yes | - | `"positive"`, `"primary"`, `"negative"`, `"dark"`, `"light"` |
|
|
18
|
+
| `onClick` | `function` | Yes | - | Click handler |
|
|
19
|
+
| `bare` | `boolean` | No | `false` | Removes background for a lighter appearance |
|
|
20
|
+
| `border` | `boolean` | No | `false` | Adds a border matching the text color |
|
|
21
|
+
| `disabled` | `boolean` | No | `false` | Disables interaction |
|
|
22
|
+
| `icon` | `IconType` | No | - | Icon to display alongside text |
|
|
23
|
+
| `iconPosition` | `"left"` \| `"right"` | No | `"left"` | Icon placement relative to text |
|
|
24
|
+
| `iconSize` | `Size` | No | `"medium"` | Icon size |
|
|
25
|
+
| `size` | `Size` | No | `"medium"` | Text size |
|
|
26
|
+
| `padding` | `Padding` | No | `"medium"` | Internal padding |
|
|
27
|
+
| `bold` | `boolean` | No | `false` | Bold text |
|
|
11
28
|
|
|
12
|
-
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Color variants
|
|
32
|
+
|
|
33
|
+
Each color variant communicates a different intent to users:
|
|
13
34
|
|
|
14
|
-
- Positive
|
|
15
|
-
- Primary
|
|
16
|
-
- Negative
|
|
17
|
-
- Dark
|
|
18
|
-
- Light: primary actions in a light theme
|
|
19
|
-
- Disabled: actions that are not available
|
|
35
|
+
- **Positive**: Confirmations, submissions, primary actions
|
|
36
|
+
- **Primary**: Secondary or neutral actions
|
|
37
|
+
- **Negative**: Destructive actions like delete or remove
|
|
38
|
+
- **Dark/Light**: Theme-specific variants for special contexts
|
|
20
39
|
|
|
21
40
|
<Row gap="large" align="center" padding="large" justify="center">
|
|
22
|
-
<Button
|
|
23
|
-
<Button
|
|
24
|
-
<Button
|
|
25
|
-
<Button
|
|
26
|
-
<Button
|
|
27
|
-
<Button label="Light" color="light" onClick={() => {}} />
|
|
41
|
+
<Button color="positive" onClick={() => {}}>Positive</Button>
|
|
42
|
+
<Button color="primary" onClick={() => {}}>Primary</Button>
|
|
43
|
+
<Button color="negative" onClick={() => {}}>Negative</Button>
|
|
44
|
+
<Button color="dark" onClick={() => {}}>Dark</Button>
|
|
45
|
+
<Button color="light" onClick={() => {}}>Light</Button>
|
|
28
46
|
</Row>
|
|
29
47
|
|
|
30
48
|
```js
|
|
49
|
+
<Button color="positive" onClick={() => {}}>Positive</Button>
|
|
50
|
+
<Button color="primary" onClick={() => {}}>Primary</Button>
|
|
51
|
+
<Button color="negative" onClick={() => {}}>Negative</Button>
|
|
52
|
+
<Button color="dark" onClick={() => {}}>Dark</Button>
|
|
53
|
+
<Button color="light" onClick={() => {}}>Light</Button>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Bare variant
|
|
59
|
+
|
|
60
|
+
The `bare` prop removes the background color, creating a lighter appearance that integrates well within complex layouts or when you need a less prominent action.
|
|
61
|
+
|
|
31
62
|
<Row gap="large" align="center" padding="large" justify="center">
|
|
32
|
-
<Button
|
|
33
|
-
<Button
|
|
34
|
-
<Button
|
|
35
|
-
<Button
|
|
36
|
-
<Button
|
|
37
|
-
<Button label="Light" color="light" onClick={() => {}} />
|
|
63
|
+
<Button bare color="positive" onClick={() => {}}>Positive</Button>
|
|
64
|
+
<Button bare color="primary" onClick={() => {}}>Primary</Button>
|
|
65
|
+
<Button bare color="negative" onClick={() => {}}>Negative</Button>
|
|
66
|
+
<Button bare color="dark" onClick={() => {}}>Dark</Button>
|
|
67
|
+
<Button bare color="light" onClick={() => {}}>Light</Button>
|
|
38
68
|
</Row>
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
<Button bare color="positive" onClick={() => {}}>Positive</Button>
|
|
72
|
+
<Button bare color="primary" onClick={() => {}}>Primary</Button>
|
|
73
|
+
<Button bare color="negative" onClick={() => {}}>Negative</Button>
|
|
39
74
|
```
|
|
40
75
|
|
|
41
76
|
---
|
|
42
77
|
|
|
43
|
-
##
|
|
78
|
+
## With border
|
|
44
79
|
|
|
45
|
-
|
|
80
|
+
Add a `border` prop to give buttons a defined edge. Works well with `bare` for outlined button styles.
|
|
46
81
|
|
|
47
82
|
<Row gap="large" align="center" padding="large" justify="center">
|
|
48
|
-
<Button bare
|
|
49
|
-
<Button bare
|
|
50
|
-
<Button bare
|
|
51
|
-
<Button bare label="Disabled" color="positive" disabled onClick={() => {}} />
|
|
52
|
-
<Button bare label="Dark" color="dark" onClick={() => {}} />
|
|
53
|
-
<Button bare label="Light" color="light" onClick={() => {}} />
|
|
83
|
+
<Button border bare color="positive" onClick={() => {}}>Positive</Button>
|
|
84
|
+
<Button border bare color="primary" onClick={() => {}}>Primary</Button>
|
|
85
|
+
<Button border bare color="negative" onClick={() => {}}>Negative</Button>
|
|
54
86
|
</Row>
|
|
55
87
|
|
|
56
88
|
```js
|
|
89
|
+
<Button border bare color="positive" onClick={() => {}}>Outlined</Button>
|
|
90
|
+
<Button border bare color="primary" onClick={() => {}}>Outlined</Button>
|
|
91
|
+
<Button border bare color="negative" onClick={() => {}}>Outlined</Button>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## With icon
|
|
97
|
+
|
|
98
|
+
Buttons can include icons to reinforce their purpose. Use `icon` to specify the icon and `iconPosition` to place it on the left or right.
|
|
99
|
+
|
|
57
100
|
<Row gap="large" align="center" padding="large" justify="center">
|
|
58
|
-
<Button
|
|
59
|
-
<Button
|
|
60
|
-
<Button
|
|
61
|
-
<Button bare label="Disabled" color="positive" disabled onClick={() => {}} />
|
|
62
|
-
<Button bare label="Dark" color="dark" onClick={() => {}} />
|
|
63
|
-
<Button bare label="Light" color="light" onClick={() => {}} />
|
|
101
|
+
<Button color="positive" icon="fa-check" onClick={() => {}}>Confirm</Button>
|
|
102
|
+
<Button color="negative" icon="fa-trash" onClick={() => {}}>Delete</Button>
|
|
103
|
+
<Button color="primary" icon="fa-arrow-right" iconPosition="right" onClick={() => {}}>Next</Button>
|
|
64
104
|
</Row>
|
|
105
|
+
|
|
106
|
+
```js
|
|
107
|
+
<Button color="positive" icon="fa-check" onClick={() => {}}>
|
|
108
|
+
Confirm
|
|
109
|
+
</Button>
|
|
110
|
+
|
|
111
|
+
<Button color="negative" icon="fa-trash" onClick={() => {}}>
|
|
112
|
+
Delete
|
|
113
|
+
</Button>
|
|
114
|
+
|
|
115
|
+
<Button color="primary" icon="fa-arrow-right" iconPosition="right" onClick={() => {}}>
|
|
116
|
+
Next
|
|
117
|
+
</Button>
|
|
65
118
|
```
|
|
66
119
|
|
|
67
|
-
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Disabled state
|
|
68
123
|
|
|
69
|
-
|
|
124
|
+
Disabled buttons prevent interaction and display a muted appearance. The component uses `aria-disabled` for accessibility.
|
|
70
125
|
|
|
71
126
|
<Row gap="large" align="center" padding="large" justify="center">
|
|
72
|
-
<Button
|
|
73
|
-
<Button
|
|
74
|
-
<Button border bare
|
|
75
|
-
<Button
|
|
76
|
-
border
|
|
77
|
-
bare
|
|
78
|
-
label="Disabled"
|
|
79
|
-
color="positive"
|
|
80
|
-
disabled
|
|
81
|
-
onClick={() => {}}
|
|
82
|
-
/>
|
|
83
|
-
<Button border bare label="Dark" color="dark" onClick={() => {}} />
|
|
84
|
-
<Button border bare label="Light" color="light" onClick={() => {}} />
|
|
127
|
+
<Button color="positive" disabled onClick={() => {}}>Disabled</Button>
|
|
128
|
+
<Button bare color="positive" disabled onClick={() => {}}>Disabled bare</Button>
|
|
129
|
+
<Button border bare color="positive" disabled onClick={() => {}}>Disabled outlined</Button>
|
|
85
130
|
</Row>
|
|
86
131
|
|
|
87
132
|
```js
|
|
133
|
+
<Button color="positive" disabled onClick={() => {}}>
|
|
134
|
+
Disabled
|
|
135
|
+
</Button>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Sizes
|
|
141
|
+
|
|
142
|
+
Control text size with the `size` prop. Available sizes: `"xsmall"`, `"small"`, `"medium"`, `"large"`, `"xlarge"`.
|
|
143
|
+
|
|
88
144
|
<Row gap="large" align="center" padding="large" justify="center">
|
|
89
|
-
<Button
|
|
90
|
-
<Button
|
|
91
|
-
<Button
|
|
92
|
-
<Button
|
|
93
|
-
border
|
|
94
|
-
bare
|
|
95
|
-
label="Disabled"
|
|
96
|
-
color="positive"
|
|
97
|
-
disabled
|
|
98
|
-
onClick={() => {}}
|
|
99
|
-
/>
|
|
100
|
-
<Button border bare label="Dark" color="dark" onClick={() => {}} />
|
|
101
|
-
<Button border bare label="Light" color="light" onClick={() => {}} />
|
|
145
|
+
<Button color="positive" size="small" onClick={() => {}}>Small</Button>
|
|
146
|
+
<Button color="positive" size="medium" onClick={() => {}}>Medium</Button>
|
|
147
|
+
<Button color="positive" size="large" onClick={() => {}}>Large</Button>
|
|
102
148
|
</Row>
|
|
149
|
+
|
|
150
|
+
```js
|
|
151
|
+
<Button color="positive" size="small" onClick={() => {}}>Small</Button>
|
|
152
|
+
<Button color="positive" size="medium" onClick={() => {}}>Medium</Button>
|
|
153
|
+
<Button color="positive" size="large" onClick={() => {}}>Large</Button>
|
|
103
154
|
```
|
|
104
155
|
|
|
105
156
|
---
|
|
157
|
+
|
|
158
|
+
## Accessibility
|
|
159
|
+
|
|
160
|
+
- Buttons use semantic `<button>` elements
|
|
161
|
+
- Disabled state is communicated via `aria-disabled` attribute
|
|
162
|
+
- Focus states are clearly visible with outline styling
|
|
163
|
+
- Click handlers are ignored when disabled, preventing accidental actions
|