aidos-ui 3.0.31 → 4.0.1

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.
Files changed (157) hide show
  1. package/.claude/settings.local.json +14 -1
  2. package/CLAUDE.md +72 -0
  3. package/README.md +43 -29
  4. package/dist/Badge.d.ts +2 -2
  5. package/dist/Badge.js.map +1 -1
  6. package/dist/BaseButton.d.ts +2 -2
  7. package/dist/BaseButton.js +2 -2
  8. package/dist/BaseButton.js.map +1 -1
  9. package/dist/BaseInput.d.ts +2 -2
  10. package/dist/BaseInput.js.map +1 -1
  11. package/dist/BaseLink.d.ts +2 -2
  12. package/dist/BaseLink.js +2 -2
  13. package/dist/BaseLink.js.map +1 -1
  14. package/dist/BaseListItem.d.ts +3 -3
  15. package/dist/BaseListItem.js.map +1 -1
  16. package/dist/BaseView.d.ts +2 -2
  17. package/dist/BaseView.js.map +1 -1
  18. package/dist/Calendar.d.ts +4 -4
  19. package/dist/DarkMode.js.map +1 -1
  20. package/dist/DateInput.d.ts +2 -2
  21. package/dist/DatePicker.js.map +1 -1
  22. package/dist/DatetimeInput.d.ts +2 -2
  23. package/dist/Dialog.d.ts +3 -3
  24. package/dist/Dialog.js.map +1 -1
  25. package/dist/Dropdown.d.ts +3 -3
  26. package/dist/Dropdown.js.map +1 -1
  27. package/dist/Icon.d.ts +3 -3
  28. package/dist/Icon.js +2 -21
  29. package/dist/Icon.js.map +1 -1
  30. package/dist/IconLink.js +2 -1
  31. package/dist/IconLink.js.map +1 -1
  32. package/dist/Interactable.d.ts +4 -4
  33. package/dist/Interactable.js +2 -2
  34. package/dist/Interactable.js.map +1 -1
  35. package/dist/ListButtonItem.js +2 -2
  36. package/dist/ListButtonItem.js.map +1 -1
  37. package/dist/ListLinkItem.js +2 -2
  38. package/dist/ListLinkItem.js.map +1 -1
  39. package/dist/MenuIcon.js.map +1 -1
  40. package/dist/NextJSRouter.js.map +1 -1
  41. package/dist/NextJSRouterState.js.map +1 -1
  42. package/dist/OnVisible.d.ts +1 -1
  43. package/dist/OnVisible.js.map +1 -1
  44. package/dist/Popover.d.ts +7 -7
  45. package/dist/Popover.js +2 -2
  46. package/dist/Popover.js.map +1 -1
  47. package/dist/ProgressBar.d.ts +2 -2
  48. package/dist/ProgressBar.js.map +1 -1
  49. package/dist/Providers.d.ts +2 -2
  50. package/dist/Providers.js +2 -2
  51. package/dist/Providers.js.map +1 -1
  52. package/dist/RangeInput.d.ts +3 -3
  53. package/dist/RangeInput.js +2 -2
  54. package/dist/RangeInput.js.map +1 -1
  55. package/dist/RootView.js.map +1 -1
  56. package/dist/Select.d.ts +2 -3
  57. package/dist/Select.js.map +1 -1
  58. package/dist/StaticCheckbox.js.map +1 -1
  59. package/dist/Storage.d.ts +2 -1
  60. package/dist/Storage.js.map +1 -1
  61. package/dist/Stream.js.map +1 -1
  62. package/dist/Sublist.d.ts +2 -2
  63. package/dist/Tabs.d.ts +4 -4
  64. package/dist/Tabs.js +2 -4
  65. package/dist/Tabs.js.map +1 -1
  66. package/dist/Text.d.ts +2 -2
  67. package/dist/Text.js.map +1 -1
  68. package/dist/TextArea.d.ts +2 -2
  69. package/dist/TextArea.js.map +1 -1
  70. package/dist/TextInput.d.ts +4 -3
  71. package/dist/TextInput.js +14 -5
  72. package/dist/TextInput.js.map +1 -1
  73. package/dist/TextPairing.d.ts +2 -2
  74. package/dist/TextPairing.js.map +1 -1
  75. package/dist/Tooltip.d.ts +4 -4
  76. package/dist/Tooltip.js.map +1 -1
  77. package/dist/aria.js.map +1 -1
  78. package/dist/hash.js.map +1 -1
  79. package/dist/jss.d.ts +21 -21
  80. package/dist/jss.js +6 -6
  81. package/dist/jss.js.map +1 -1
  82. package/dist/numberToBase.js.map +1 -1
  83. package/dist/stateMachineContextFactory.js.map +1 -1
  84. package/dist/useCookie.js.map +1 -1
  85. package/dist/useKeyboard.js.map +1 -1
  86. package/dist/useNavigation.js.map +1 -1
  87. package/dist/useRefEffect.js.map +1 -1
  88. package/next-env.d.ts +2 -1
  89. package/next.config.js +2 -1
  90. package/package.json +27 -20
  91. package/src/Badge.tsx +2 -2
  92. package/src/BaseButton.tsx +4 -4
  93. package/src/BaseInput.tsx +2 -2
  94. package/src/BaseLink.tsx +4 -4
  95. package/src/BaseListItem.tsx +3 -3
  96. package/src/BaseView.tsx +3 -3
  97. package/src/Calendar.tsx +4 -4
  98. package/src/DateInput.tsx +2 -2
  99. package/src/DatetimeInput.tsx +2 -2
  100. package/src/Dialog.tsx +3 -3
  101. package/src/Dropdown.tsx +4 -4
  102. package/src/Icon.tsx +4 -30
  103. package/src/IconLink.tsx +2 -1
  104. package/src/Interactable.tsx +4 -4
  105. package/src/ListButtonItem.tsx +2 -2
  106. package/src/ListLinkItem.tsx +2 -2
  107. package/src/MenuIcon.tsx +2 -2
  108. package/src/NextJSRouter.tsx +2 -2
  109. package/src/Popover.tsx +9 -9
  110. package/src/ProgressBar.tsx +3 -3
  111. package/src/Providers.tsx +4 -4
  112. package/src/RangeInput.tsx +5 -5
  113. package/src/Select.tsx +2 -2
  114. package/src/StaticCheckbox.tsx +2 -2
  115. package/src/Storage.tsx +1 -1
  116. package/src/Sublist.tsx +2 -2
  117. package/src/Tabs.tsx +4 -6
  118. package/src/Text.tsx +2 -2
  119. package/src/TextArea.tsx +2 -2
  120. package/src/TextInput.tsx +20 -8
  121. package/src/TextPairing.tsx +2 -2
  122. package/src/Tooltip.tsx +5 -5
  123. package/src/docs/mdx.tsx +40 -0
  124. package/src/docs/searchIndex.ts +1 -1
  125. package/src/jss.tsx +18 -18
  126. package/src/pages/Badge.mdx +136 -14
  127. package/src/pages/Button.mdx +121 -63
  128. package/src/pages/Calendar.mdx +196 -2
  129. package/src/pages/Card.mdx +123 -47
  130. package/src/pages/Checkbox.mdx +103 -28
  131. package/src/pages/Dialog.mdx +172 -7
  132. package/src/pages/FlexLayout.mdx +185 -51
  133. package/src/pages/Hashing.mdx +199 -8
  134. package/src/pages/Icon.mdx +150 -42
  135. package/src/pages/IconButton.mdx +127 -116
  136. package/src/pages/Link.mdx +118 -47
  137. package/src/pages/List.mdx +167 -283
  138. package/src/pages/ListHeader.mdx +157 -27
  139. package/src/pages/Popover.mdx +177 -55
  140. package/src/pages/ProgressBar.mdx +186 -6
  141. package/src/pages/ProgressCircle.mdx +196 -13
  142. package/src/pages/RangeInput.mdx +189 -61
  143. package/src/pages/Tabs.mdx +202 -346
  144. package/src/pages/Text.mdx +102 -81
  145. package/src/pages/TextInput.mdx +169 -44
  146. package/src/pages/TextPairing.mdx +164 -115
  147. package/src/pages/TimeInput.mdx +142 -37
  148. package/src/pages/Tooltip.mdx +99 -12
  149. package/src/pages/_app.tsx +14 -4
  150. package/src/pages/css-in-js.mdx +196 -83
  151. package/src/pages/navigation.mdx +122 -20
  152. package/src/pages/useCookie.mdx +168 -7
  153. package/src/pages/useKeyboard.mdx +242 -5
  154. package/src/pages/useNavigation.mdx +244 -16
  155. package/src/pages/usePromise.mdx +271 -6
  156. package/src/pages/useRefEffect.mdx +230 -28
  157. package/tsconfig.json +13 -4
@@ -1,11 +1,97 @@
1
1
  import { Calendar } from "../Calendar";
2
2
  import { Box } from "../Box";
3
+ import { Row } from "../Row";
4
+ import { Column } from "../Column";
3
5
  import { Badge } from "../Badge";
4
6
  import { Span, H3 } from "../Text";
7
+ import { cssVar } from "../jss";
5
8
 
6
9
  # Calendar
7
10
 
8
- The calendar component is can be used to represent months, and is customisable through render callbacks for the header and cell elemtns
11
+ A flexible calendar grid component for displaying months. Fully customizable through render callbacks for both header cells (weekday names) and day cells.
12
+
13
+ ---
14
+
15
+ ## Props
16
+
17
+ | Prop | Type | Default | Description |
18
+ |------|------|---------|-------------|
19
+ | `date` | `Date` | Required | The month to display (uses year and month from this date) |
20
+ | `header` | `(props) => JSX.Element` | Required | Render function for weekday header cells |
21
+ | `cell` | `(props) => JSX.Element` | Required | Render function for day cells |
22
+ | `jss` | `JSS` | - | Custom styles for the calendar grid |
23
+
24
+ ### Header render props
25
+
26
+ | Property | Type | Description |
27
+ |----------|------|-------------|
28
+ | `weekday` | `string` | Localized weekday abbreviation (Mon, Tue, etc.) |
29
+
30
+ ### Cell render props
31
+
32
+ | Property | Type | Description |
33
+ |----------|------|-------------|
34
+ | `date` | `Date` | The date for this cell |
35
+ | `today` | `boolean` | Whether this date is today |
36
+ | `outOfMonth` | `boolean` | Whether this date is outside the current month |
37
+ | `top` | `boolean` | Whether this cell is in the top row |
38
+ | `bottom` | `boolean` | Whether this cell is in the bottom row |
39
+ | `left` | `boolean` | Whether this cell is in the leftmost column |
40
+ | `right` | `boolean` | Whether this cell is in the rightmost column |
41
+
42
+ ---
43
+
44
+ ## Basic usage
45
+
46
+ <Calendar
47
+ date={new Date()}
48
+ header={({ weekday }) => (
49
+ <Box padding="small" jss={{ textAlign: "center" }}>
50
+ <Span bold color="secondary" size="small">{weekday}</Span>
51
+ </Box>
52
+ )}
53
+ cell={({ today, date, outOfMonth }) => (
54
+ <Box padding="small" relative={true} jss={{ opacity: outOfMonth ? 0.3 : 1, textAlign: "center" }}>
55
+ {today && (
56
+ <Badge
57
+ size="xlarge"
58
+ color="highlight"
59
+ jss={{
60
+ position: "absolute",
61
+ top: "50%",
62
+ left: "50%",
63
+ transform: "translate(-50%, -50%)",
64
+ zIndex: 0,
65
+ }}
66
+ />
67
+ )}
68
+ <Span jss={{ position: "relative", zIndex: 1 }} color={today ? "light" : "primary"}>
69
+ {date.getDate()}
70
+ </Span>
71
+ </Box>
72
+ )}
73
+ />
74
+
75
+ ```js
76
+ <Calendar
77
+ date={new Date()}
78
+ header={({ weekday }) => (
79
+ <Box padding="small" jss={{ textAlign: "center" }}>
80
+ <Span bold color="secondary" size="small">{weekday}</Span>
81
+ </Box>
82
+ )}
83
+ cell={({ today, date, outOfMonth }) => (
84
+ <Box padding="small" jss={{ opacity: outOfMonth ? 0.3 : 1 }}>
85
+ {today && <Badge color="highlight" />}
86
+ <Span>{date.getDate()}</Span>
87
+ </Box>
88
+ )}
89
+ />
90
+ ```
91
+
92
+ ---
93
+
94
+ ## With today indicator
9
95
 
10
96
  <Calendar
11
97
  date={new Date()}
@@ -36,7 +122,7 @@ The calendar component is can be used to represent months, and is customisable t
36
122
  date={new Date()}
37
123
  header={({ weekday }) => (
38
124
  <Box>
39
- <H2>{weekday}</H2>
125
+ <H3>{weekday}</H3>
40
126
  </Box>
41
127
  )}
42
128
  cell={({ today, date, outOfMonth }) => (
@@ -58,3 +144,111 @@ The calendar component is can be used to represent months, and is customisable t
58
144
  ```
59
145
 
60
146
  ---
147
+
148
+ ## Using position props
149
+
150
+ The cell render props include position information for styling borders and corners:
151
+
152
+ ```js
153
+ <Calendar
154
+ date={new Date()}
155
+ header={({ weekday }) => <Span>{weekday}</Span>}
156
+ cell={({ date, outOfMonth, top, bottom, left, right }) => (
157
+ <Box
158
+ jss={{
159
+ opacity: outOfMonth ? 0.3 : 1,
160
+ borderTop: top ? "1px solid var(--divider)" : "none",
161
+ borderBottom: bottom ? "1px solid var(--divider)" : "none",
162
+ borderLeft: left ? "1px solid var(--divider)" : "none",
163
+ borderRight: right ? "1px solid var(--divider)" : "none",
164
+ borderTopLeftRadius: top && left ? 8 : 0,
165
+ borderTopRightRadius: top && right ? 8 : 0,
166
+ borderBottomLeftRadius: bottom && left ? 8 : 0,
167
+ borderBottomRightRadius: bottom && right ? 8 : 0,
168
+ }}
169
+ >
170
+ <Span>{date.getDate()}</Span>
171
+ </Box>
172
+ )}
173
+ />
174
+ ```
175
+
176
+ ---
177
+
178
+ ## Interactive calendar
179
+
180
+ Create a date picker by adding click handlers:
181
+
182
+ ```js
183
+ function DatePicker() {
184
+ const [selected, setSelected] = useState(null);
185
+ const [month, setMonth] = useState(new Date());
186
+
187
+ return (
188
+ <Column gap="medium">
189
+ <Row justify="space-between" align="center">
190
+ <IconButton
191
+ icon="fa-chevron-left"
192
+ onClick={() => setMonth(new Date(month.getFullYear(), month.getMonth() - 1))}
193
+ />
194
+ <Span bold>
195
+ {month.toLocaleDateString("en-US", { month: "long", year: "numeric" })}
196
+ </Span>
197
+ <IconButton
198
+ icon="fa-chevron-right"
199
+ onClick={() => setMonth(new Date(month.getFullYear(), month.getMonth() + 1))}
200
+ />
201
+ </Row>
202
+ <Calendar
203
+ date={month}
204
+ header={({ weekday }) => <Span size="small">{weekday}</Span>}
205
+ cell={({ date, outOfMonth, today }) => {
206
+ const isSelected = selected?.toDateString() === date.toDateString();
207
+ return (
208
+ <BaseButton
209
+ bare
210
+ onClick={() => !outOfMonth && setSelected(date)}
211
+ jss={{
212
+ opacity: outOfMonth ? 0.3 : 1,
213
+ backgroundColor: isSelected ? "var(--highlight)" : "transparent",
214
+ borderRadius: "50%",
215
+ }}
216
+ >
217
+ <Span color={isSelected ? "light" : "primary"}>
218
+ {date.getDate()}
219
+ </Span>
220
+ </BaseButton>
221
+ );
222
+ }}
223
+ />
224
+ </Column>
225
+ );
226
+ }
227
+ ```
228
+
229
+ ---
230
+
231
+ ## Grid layout
232
+
233
+ The Calendar uses CSS Grid with 7 columns (Mon-Sun). The header row and day cells flow naturally into the grid:
234
+
235
+ ```js
236
+ // Custom grid styling
237
+ <Calendar
238
+ date={new Date()}
239
+ jss={{
240
+ gap: 4,
241
+ padding: 16,
242
+ backgroundColor: "var(--secondary-background)",
243
+ borderRadius: 12,
244
+ }}
245
+ header={...}
246
+ cell={...}
247
+ />
248
+ ```
249
+
250
+ ---
251
+
252
+ ## Localization
253
+
254
+ Weekday names are automatically localized using `Intl.DateTimeFormat` with UK English locale (week starts Monday). The calendar always displays Monday through Sunday.
@@ -1,71 +1,147 @@
1
1
  import { Card } from "../Card";
2
2
  import { Button } from "../Button";
3
3
  import { TextInput } from "../TextInput";
4
- import { TextArea } from "../TextArea";
5
- import { H2, P } from "../Text";
4
+ import { Column } from "../Column";
5
+ import { Row } from "../Row";
6
+ import { H2, H3, P, Span } from "../Text";
7
+ import { Icon } from "../Icon";
6
8
 
7
9
  # Card
8
10
 
9
- Cards can be used to make give cohesion to some UI elements, grouping them visually in a distinct way.
11
+ A container component that groups related content with a distinct visual treatment. Cards provide elevation, background, and rounded corners to create visual hierarchy.
12
+
13
+ ---
14
+
15
+ ## Props
16
+
17
+ Card extends all FlexLayout props:
18
+
19
+ | Prop | Type | Default | Description |
20
+ |------|------|---------|-------------|
21
+ | `padding` | `Padding` | `"large"` | Internal padding |
22
+ | `gap` | `Gap` | `"large"` | Space between children |
23
+ | `direction` | `"row"` \| `"column"` | `"column"` | Flex direction |
24
+ | `align` | `Align` | - | Cross-axis alignment |
25
+ | `justify` | `Justify` | - | Main-axis alignment |
26
+ | `grow` | `boolean` | - | Allow card to grow |
27
+
28
+ ---
29
+
30
+ ## Basic card
31
+
32
+ <Card>
33
+ <H3>Card title</H3>
34
+ <P>Cards group related content together with visual distinction from the surrounding interface.</P>
35
+ </Card>
36
+
37
+ ```js
38
+ <Card>
39
+ <H3>Card title</H3>
40
+ <P>Card content goes here...</P>
41
+ </Card>
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Contact form example
10
47
 
11
48
  <Card>
12
- <H2>Contact Us</H2>
13
- <P>If you have any questions or inquiries, please feel free to contact us.</P>
49
+ <H3>Contact Us</H3>
50
+ <P>Send us a message and we'll get back to you soon.</P>
14
51
  <TextInput
15
- name="email"
16
- placeholder="Email"
17
- value={null}
18
- padding={"medium"}
52
+ placeholder="Your email"
53
+ value=""
19
54
  type="email"
20
55
  onValueChange={() => {}}
21
56
  />
22
- <TextArea
23
- jss={{
24
- resize: "vertical",
25
- }}
26
- name="message"
27
- placeholder="Type your query here..."
28
- value={null}
29
- type="text"
57
+ <TextInput
58
+ placeholder="Your message"
59
+ value=""
30
60
  onValueChange={() => {}}
31
61
  />
32
- <Button
33
- jss={{ animation: "all 1s ease-out" }}
34
- onClick={() => {}}
35
- type="submit"
36
- label="Subscribe"
37
- color="positive"
38
- />
62
+ <Button color="positive" onClick={() => {}}>
63
+ Send Message
64
+ </Button>
39
65
  </Card>
40
66
 
41
67
  ```js
42
68
  <Card>
43
- <H2>Contact Us</H2>
44
- <P>If you have any questions or inquiries, please feel free to contact us.</P>
69
+ <H3>Contact Us</H3>
70
+ <P>Send us a message and we'll get back to you soon.</P>
45
71
  <TextInput
46
- name="email"
47
- placeholder="Email"
48
- value={null}
49
- padding={"medium"}
72
+ placeholder="Your email"
73
+ value={email}
50
74
  type="email"
51
- onValueChange={() => {}}
75
+ onValueChange={setEmail}
52
76
  />
53
- <TextArea
54
- jss={{
55
- resize: "vertical",
56
- }}
57
- name="message"
58
- placeholder="Type your query here..."
59
- value={null}
60
- type="text"
61
- onValueChange={() => {}}
62
- />
63
- <Button
64
- jss={{ animation: "all 1s ease-out" }}
65
- onClick={() => {}}
66
- type="submit"
67
- label="Subscribe"
68
- color="positive"
77
+ <TextInput
78
+ placeholder="Your message"
79
+ value={message}
80
+ onValueChange={setMessage}
69
81
  />
82
+ <Button color="positive" onClick={handleSubmit}>
83
+ Send Message
84
+ </Button>
70
85
  </Card>
71
86
  ```
87
+
88
+ ---
89
+
90
+ ## Custom padding and gap
91
+
92
+ <Row gap="medium">
93
+ <Card padding="small" gap="small">
94
+ <Span>Small padding</Span>
95
+ <Span color="secondary">Compact layout</Span>
96
+ </Card>
97
+ <Card padding="xlarge" gap="medium">
98
+ <Span>Large padding</Span>
99
+ <Span color="secondary">Spacious layout</Span>
100
+ </Card>
101
+ </Row>
102
+
103
+ ```js
104
+ <Card padding="small" gap="small">
105
+ <Span>Compact card</Span>
106
+ </Card>
107
+
108
+ <Card padding="xlarge" gap="large">
109
+ <Span>Spacious card</Span>
110
+ </Card>
111
+ ```
112
+
113
+ ---
114
+
115
+ ## Horizontal card
116
+
117
+ Use `direction="row"` for horizontal layouts:
118
+
119
+ <Card direction="row" align="center" gap="medium">
120
+ <Icon icon="fa-user" color="highlight" size="xlarge" />
121
+ <Column gap="none">
122
+ <Span bold>John Doe</Span>
123
+ <Span color="secondary" size="small">Software Engineer</Span>
124
+ </Column>
125
+ </Card>
126
+
127
+ ```js
128
+ <Card direction="row" align="center" gap="medium">
129
+ <Icon icon="fa-user" color="highlight" size="xlarge" />
130
+ <Column gap="none">
131
+ <Span bold>John Doe</Span>
132
+ <Span color="secondary" size="small">Software Engineer</Span>
133
+ </Column>
134
+ </Card>
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Use cases
140
+
141
+ Cards are useful for:
142
+
143
+ - **Forms** - Group related inputs together
144
+ - **Profiles** - Display user or item information
145
+ - **Summaries** - Highlight key metrics or stats
146
+ - **Actions** - Group related actions with context
147
+ - **Content sections** - Separate distinct content areas
@@ -2,55 +2,130 @@ import { Checkbox } from "../Checkbox";
2
2
  import { StaticCheckbox } from "../StaticCheckbox";
3
3
  import { Column } from "../Column";
4
4
  import { Row } from "../Row";
5
+ import { Span } from "../Text";
5
6
 
6
7
  # Checkbox
7
8
 
8
- The `Checkbox` component is an input of type checkbox with the visual style of a checkbox.
9
+ A styled checkbox input with custom visual appearance. Built on native HTML checkbox for full accessibility support.
9
10
 
10
- <Column>
11
- <Row padding="medium" gap="medium" justify="center" align="center">
11
+ ---
12
+
13
+ ## Props
14
+
15
+ ### Checkbox
16
+
17
+ | Prop | Type | Required | Default | Description |
18
+ |------|------|----------|---------|-------------|
19
+ | `checked` | `boolean` | Yes | - | Whether the checkbox is checked |
20
+ | `onClick` | `() => void` | Yes | - | Called when checkbox is toggled |
21
+ | `size` | `Size` | Yes | - | `"small"` (16px), `"medium"` (20px), `"large"` (24px) |
22
+
23
+ Also accepts standard HTML input attributes.
24
+
25
+ ### StaticCheckbox
26
+
27
+ | Prop | Type | Required | Default | Description |
28
+ |------|------|----------|---------|-------------|
29
+ | `checked` | `boolean` | Yes | - | Whether the checkbox appears checked |
30
+ | `size` | `Size` | Yes | - | `"small"`, `"medium"`, `"large"` |
31
+
32
+ ---
33
+
34
+ ## Sizes
35
+
36
+ <Row padding="medium" gap="xlarge" justify="center" align="center">
37
+ <Column gap="small" align="center">
12
38
  <Checkbox size="small" checked={true} onClick={() => {}} />
39
+ <Span size="small" color="secondary">small</Span>
40
+ </Column>
41
+ <Column gap="small" align="center">
13
42
  <Checkbox size="medium" checked={true} onClick={() => {}} />
43
+ <Span size="small" color="secondary">medium</Span>
44
+ </Column>
45
+ <Column gap="small" align="center">
14
46
  <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>
47
+ <Span size="small" color="secondary">large</Span>
48
+ </Column>
49
+ </Row>
22
50
 
23
51
  ```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={() => {}} />
52
+ <Checkbox size="small" checked={checked} onClick={toggle} />
53
+ <Checkbox size="medium" checked={checked} onClick={toggle} />
54
+ <Checkbox size="large" checked={checked} onClick={toggle} />
55
+ ```
56
+
57
+ ---
58
+
59
+ ## States
60
+
61
+ <Row padding="medium" gap="xlarge" justify="center" align="center">
62
+ <Column gap="small" align="center">
32
63
  <Checkbox size="medium" checked={false} onClick={() => {}} />
33
- <Checkbox size="large" checked={false} onClick={() => {}} />
34
- </Row>
35
- </Column>
64
+ <Span size="small" color="secondary">unchecked</Span>
65
+ </Column>
66
+ <Column gap="small" align="center">
67
+ <Checkbox size="medium" checked={true} onClick={() => {}} />
68
+ <Span size="small" color="secondary">checked</Span>
69
+ </Column>
70
+ </Row>
71
+
72
+ ```js
73
+ const [checked, setChecked] = useState(false);
74
+
75
+ <Checkbox
76
+ size="medium"
77
+ checked={checked}
78
+ onClick={() => setChecked(!checked)}
79
+ />
36
80
  ```
37
81
 
38
82
  ---
39
83
 
40
- ## Static checkbox
84
+ ## StaticCheckbox
41
85
 
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.
86
+ Use `StaticCheckbox` when you need just the visual appearance without the underlying `<input>` element. Useful when the checkbox is part of a larger interactive component.
43
87
 
44
- <Row padding="medium" gap="medium" justify="center" align="center">
88
+ <Row padding="medium" gap="large" justify="center" align="center">
45
89
  <StaticCheckbox size="small" checked={true} />
46
90
  <StaticCheckbox size="medium" checked={true} />
47
91
  <StaticCheckbox size="large" checked={true} />
48
92
  </Row>
49
93
 
50
94
  ```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} />
95
+ // Visual only - no input element
96
+ <StaticCheckbox size="medium" checked={isSelected} />
97
+
98
+ // Used within a custom list item
99
+ <ListButtonItem
100
+ headline="Option"
101
+ addOn={<StaticCheckbox size="medium" checked={selected} />}
102
+ onClick={toggleSelection}
103
+ />
104
+ ```
105
+
106
+ ---
107
+
108
+ ## With label
109
+
110
+ Checkboxes are typically paired with labels for better UX:
111
+
112
+ ```js
113
+ <Row gap="small" align="center">
114
+ <Checkbox
115
+ size="medium"
116
+ checked={agreed}
117
+ onClick={() => setAgreed(!agreed)}
118
+ />
119
+ <Span>I agree to the terms and conditions</Span>
55
120
  </Row>
56
121
  ```
122
+
123
+ ---
124
+
125
+ ## Accessibility
126
+
127
+ - Uses native `<input type="checkbox">` for full keyboard and screen reader support
128
+ - Visual checkbox is layered over the hidden input
129
+ - Focus ring appears on keyboard navigation
130
+ - Press animation provides tactile feedback
131
+ - `aria-checked` attribute reflects current state