aidos-ui 4.0.0 → 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 (93) hide show
  1. package/.claude/settings.local.json +14 -1
  2. package/CLAUDE.md +72 -0
  3. package/dist/BaseButton.js.map +1 -1
  4. package/dist/BaseLink.js.map +1 -1
  5. package/dist/BaseListItem.d.ts +1 -1
  6. package/dist/Calendar.d.ts +2 -2
  7. package/dist/DarkMode.js.map +1 -1
  8. package/dist/DatePicker.js.map +1 -1
  9. package/dist/Dialog.d.ts +3 -3
  10. package/dist/Dialog.js.map +1 -1
  11. package/dist/Dropdown.js.map +1 -1
  12. package/dist/Icon.d.ts +3 -3
  13. package/dist/Icon.js +2 -21
  14. package/dist/Icon.js.map +1 -1
  15. package/dist/Interactable.js.map +1 -1
  16. package/dist/NextJSRouterState.js.map +1 -1
  17. package/dist/OnVisible.d.ts +1 -1
  18. package/dist/OnVisible.js.map +1 -1
  19. package/dist/Popover.d.ts +3 -3
  20. package/dist/Popover.js.map +1 -1
  21. package/dist/Providers.d.ts +2 -2
  22. package/dist/RangeInput.d.ts +1 -1
  23. package/dist/RootView.js.map +1 -1
  24. package/dist/Select.d.ts +0 -1
  25. package/dist/Storage.d.ts +2 -1
  26. package/dist/Storage.js.map +1 -1
  27. package/dist/Stream.js.map +1 -1
  28. package/dist/Text.js.map +1 -1
  29. package/dist/TextInput.d.ts +3 -2
  30. package/dist/TextInput.js +13 -4
  31. package/dist/TextInput.js.map +1 -1
  32. package/dist/TextPairing.js.map +1 -1
  33. package/dist/Tooltip.d.ts +2 -2
  34. package/dist/Tooltip.js.map +1 -1
  35. package/dist/aria.js.map +1 -1
  36. package/dist/hash.js.map +1 -1
  37. package/dist/jss.d.ts +6 -6
  38. package/dist/jss.js +2 -2
  39. package/dist/jss.js.map +1 -1
  40. package/dist/numberToBase.js.map +1 -1
  41. package/dist/stateMachineContextFactory.js.map +1 -1
  42. package/dist/useCookie.js.map +1 -1
  43. package/dist/useKeyboard.js.map +1 -1
  44. package/dist/useNavigation.js.map +1 -1
  45. package/dist/useRefEffect.js.map +1 -1
  46. package/next-env.d.ts +2 -1
  47. package/next.config.js +2 -1
  48. package/package.json +27 -20
  49. package/src/BaseListItem.tsx +1 -1
  50. package/src/Calendar.tsx +2 -2
  51. package/src/Dialog.tsx +3 -3
  52. package/src/Icon.tsx +4 -30
  53. package/src/Popover.tsx +3 -3
  54. package/src/Providers.tsx +1 -1
  55. package/src/RangeInput.tsx +1 -1
  56. package/src/Storage.tsx +1 -1
  57. package/src/TextInput.tsx +17 -5
  58. package/src/Tooltip.tsx +2 -2
  59. package/src/docs/mdx.tsx +40 -0
  60. package/src/docs/searchIndex.ts +1 -1
  61. package/src/jss.tsx +3 -3
  62. package/src/pages/Badge.mdx +136 -14
  63. package/src/pages/Button.mdx +121 -63
  64. package/src/pages/Calendar.mdx +196 -2
  65. package/src/pages/Card.mdx +123 -47
  66. package/src/pages/Checkbox.mdx +103 -28
  67. package/src/pages/Dialog.mdx +172 -7
  68. package/src/pages/FlexLayout.mdx +185 -51
  69. package/src/pages/Hashing.mdx +199 -8
  70. package/src/pages/Icon.mdx +150 -42
  71. package/src/pages/IconButton.mdx +127 -116
  72. package/src/pages/Link.mdx +118 -47
  73. package/src/pages/List.mdx +167 -283
  74. package/src/pages/ListHeader.mdx +157 -27
  75. package/src/pages/Popover.mdx +177 -55
  76. package/src/pages/ProgressBar.mdx +186 -6
  77. package/src/pages/ProgressCircle.mdx +196 -13
  78. package/src/pages/RangeInput.mdx +189 -61
  79. package/src/pages/Tabs.mdx +202 -346
  80. package/src/pages/Text.mdx +102 -81
  81. package/src/pages/TextInput.mdx +169 -44
  82. package/src/pages/TextPairing.mdx +164 -115
  83. package/src/pages/TimeInput.mdx +142 -37
  84. package/src/pages/Tooltip.mdx +99 -12
  85. package/src/pages/_app.tsx +13 -3
  86. package/src/pages/css-in-js.mdx +196 -83
  87. package/src/pages/navigation.mdx +122 -20
  88. package/src/pages/useCookie.mdx +168 -7
  89. package/src/pages/useKeyboard.mdx +242 -5
  90. package/src/pages/useNavigation.mdx +244 -16
  91. package/src/pages/usePromise.mdx +271 -6
  92. package/src/pages/useRefEffect.mdx +230 -28
  93. package/tsconfig.json +13 -4
@@ -1,46 +1,135 @@
1
1
  import { RangeInput } from "../RangeInput";
2
2
  import { Column } from "../Column";
3
+ import { Row } from "../Row";
3
4
  import { Icon } from "../Icon";
5
+ import { Span } from "../Text";
4
6
 
5
7
  # RangeInput
6
8
 
7
- The `RangeInput` item is a thin wrapper over the HTML `<input type="range">` element with some options for adding addOn and customise the label for it.
9
+ A styled wrapper around the HTML `<input type="range">` element with support for labels, icons, and customization options.
8
10
 
9
- <Column>
10
- <RangeInput value={12.5} onValueChange={() => {}} />
11
- <RangeInput value={25} onValueChange={() => {}} label="Right" />
12
- <RangeInput
13
- value={37.5}
14
- onValueChange={() => {}}
15
- label="Left"
16
- labelPosition="start"
17
- />
11
+ ---
12
+
13
+ ## Props
14
+
15
+ | Prop | Type | Default | Description |
16
+ |------|------|---------|-------------|
17
+ | `value` | `number` | Required | Current slider value |
18
+ | `onValueChange` | `(value: number) => void` | Required | Called when the value changes |
19
+ | `min` | `number` | `0` | Minimum value |
20
+ | `max` | `number` | `100` | Maximum value |
21
+ | `step` | `number` | `1` | Step increment |
22
+ | `label` | `ReactNode` | - | Label text displayed alongside the slider |
23
+ | `labelPosition` | `"start" \| "end"` | `"end"` | Position of the label |
24
+ | `labelSize` | `Size` | - | Label text size |
25
+ | `labelColor` | `TextColor` | - | Label text color |
26
+ | `labelBold` | `boolean` | - | Whether the label is bold |
27
+ | `addOn` | `JSX.Element` | - | Icon or element to display |
28
+ | `addOnPosition` | `"start" \| "end"` | `"start"` | Position of the add-on |
29
+ | `gap` | `Gap` | `"medium"` | Space between elements |
30
+ | `padding` | `Padding` | `"none"` | Container padding |
31
+ | `disabled` | `boolean` | - | Disables the input |
32
+
33
+ ---
34
+
35
+ ## Basic usage
36
+
37
+ <Column gap="medium">
38
+ <RangeInput value={50} onValueChange={() => {}} />
39
+ </Column>
40
+
41
+ ```js
42
+ const [value, setValue] = useState(50);
43
+
44
+ <RangeInput value={value} onValueChange={setValue} />
45
+ ```
46
+
47
+ ---
48
+
49
+ ## With label
50
+
51
+ Labels can be positioned at the start or end of the slider:
52
+
53
+ <Column gap="medium">
54
+ <RangeInput value={75} onValueChange={() => {}} label="75%" />
55
+ <RangeInput value={25} onValueChange={() => {}} label="25%" labelPosition="start" />
56
+ </Column>
57
+
58
+ ```js
59
+ // Label at end (default)
60
+ <RangeInput value={value} onValueChange={setValue} label={`${value}%`} />
61
+
62
+ // Label at start
63
+ <RangeInput
64
+ value={value}
65
+ onValueChange={setValue}
66
+ label={`${value}%`}
67
+ labelPosition="start"
68
+ />
69
+ ```
70
+
71
+ ---
72
+
73
+ ## With icon add-on
74
+
75
+ Add icons to provide context for what the slider controls:
76
+
77
+ <Column gap="medium">
18
78
  <RangeInput
19
79
  addOn={<Icon icon="fa-volume-up" color="primary" size="medium" />}
20
80
  value={50}
21
81
  onValueChange={() => {}}
22
- label="Right"
82
+ label="50%"
23
83
  />
24
84
  <RangeInput
25
- addOn={<Icon icon="fa-volume-up" color="primary" size="medium" />}
85
+ addOn={<Icon icon="fa-sun" color="warning" size="medium" />}
26
86
  addOnPosition="end"
27
- value={62.5}
87
+ value={80}
28
88
  onValueChange={() => {}}
29
- label="Left"
89
+ label="Brightness"
30
90
  labelPosition="start"
31
91
  />
92
+ </Column>
93
+
94
+ ```js
95
+ // Icon at start (default)
96
+ <RangeInput
97
+ addOn={<Icon icon="fa-volume-up" color="primary" size="medium" />}
98
+ value={volume}
99
+ onValueChange={setVolume}
100
+ label={`${volume}%`}
101
+ />
102
+
103
+ // Icon at end
104
+ <RangeInput
105
+ addOn={<Icon icon="fa-sun" color="warning" size="medium" />}
106
+ addOnPosition="end"
107
+ value={brightness}
108
+ onValueChange={setBrightness}
109
+ label="Brightness"
110
+ labelPosition="start"
111
+ />
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Label styling
117
+
118
+ Customize the label appearance:
119
+
120
+ <Column gap="medium">
32
121
  <RangeInput
33
122
  addOn={<Icon icon="fa-volume-up" color="primary" size="medium" />}
34
123
  value={75}
35
124
  onValueChange={() => {}}
36
- label="Right"
125
+ label="75%"
37
126
  labelSize="large"
38
127
  />
39
128
  <RangeInput
40
129
  addOn={<Icon icon="fa-volume-up" color="primary" size="medium" />}
41
- value={87.5}
130
+ value={90}
42
131
  onValueChange={() => {}}
43
- label="Right"
132
+ label="90%"
44
133
  labelSize="large"
45
134
  labelColor="highlight"
46
135
  />
@@ -48,7 +137,7 @@ The `RangeInput` item is a thin wrapper over the HTML `<input type="range">` ele
48
137
  addOn={<Icon icon="fa-volume-up" color="primary" size="medium" />}
49
138
  value={100}
50
139
  onValueChange={() => {}}
51
- label="Right"
140
+ label="MAX"
52
141
  labelSize="large"
53
142
  labelColor="highlight"
54
143
  labelBold
@@ -56,54 +145,93 @@ The `RangeInput` item is a thin wrapper over the HTML `<input type="range">` ele
56
145
  </Column>
57
146
 
58
147
  ```js
59
- <Column>
60
- <RangeInput value={12.5} onValueChange={() => {}} />
61
- <RangeInput value={25} onValueChange={() => {}} label="Right" />
62
- <RangeInput
63
- value={37.5}
64
- onValueChange={() => {}}
65
- label="Left"
66
- labelPosition="start"
67
- />
68
- <RangeInput
69
- addOn={<Icon icon="fa-volume-up" color="primary" size="medium" />}
70
- value={50}
71
- onValueChange={() => {}}
72
- label="Right"
73
- />
74
- <RangeInput
75
- addOn={<Icon icon="fa-volume-up" color="primary" size="medium" />}
76
- addOnPosition="end"
77
- value={62.5}
78
- onValueChange={() => {}}
79
- label="Left"
80
- labelPosition="start"
81
- />
82
- <RangeInput
83
- addOn={<Icon icon="fa-volume-up" color="primary" size="medium" />}
84
- value={75}
85
- onValueChange={() => {}}
86
- label="Right"
87
- labelSize="large"
88
- />
89
- <RangeInput
90
- addOn={<Icon icon="fa-volume-up" color="primary" size="medium" />}
91
- value={87.5}
92
- onValueChange={() => {}}
93
- label="Right"
94
- labelSize="large"
95
- labelColor="highlight"
96
- />
148
+ <RangeInput
149
+ value={value}
150
+ onValueChange={setValue}
151
+ label={`${value}%`}
152
+ labelSize="large"
153
+ labelColor="highlight"
154
+ labelBold
155
+ />
156
+ ```
157
+
158
+ ---
159
+
160
+ ## Custom range
161
+
162
+ Set min, max, and step values:
163
+
164
+ ```js
165
+ // Temperature slider (0-100 in steps of 5)
166
+ <RangeInput
167
+ value={temperature}
168
+ onValueChange={setTemperature}
169
+ min={0}
170
+ max={100}
171
+ step={5}
172
+ label={`${temperature}°C`}
173
+ />
174
+
175
+ // Decimal values (0-1 in steps of 0.1)
176
+ <RangeInput
177
+ value={opacity}
178
+ onValueChange={setOpacity}
179
+ min={0}
180
+ max={1}
181
+ step={0.1}
182
+ label={opacity.toFixed(1)}
183
+ />
184
+ ```
185
+
186
+ ---
187
+
188
+ ## Volume control example
189
+
190
+ <Row gap="medium" align="center" padding="medium">
97
191
  <RangeInput
98
192
  addOn={<Icon icon="fa-volume-up" color="primary" size="medium" />}
99
- value={100}
193
+ value={65}
100
194
  onValueChange={() => {}}
101
- label="Right"
102
- labelSize="large"
103
- labelColor="highlight"
195
+ label="65%"
104
196
  labelBold
105
197
  />
106
- </Column>
198
+ </Row>
199
+
200
+ ```js
201
+ function VolumeControl() {
202
+ const [volume, setVolume] = useState(50);
203
+
204
+ const icon = volume === 0
205
+ ? "fa-volume-off"
206
+ : volume < 50
207
+ ? "fa-volume-down"
208
+ : "fa-volume-up";
209
+
210
+ return (
211
+ <RangeInput
212
+ addOn={<Icon icon={icon} color="primary" size="medium" />}
213
+ value={volume}
214
+ onValueChange={setVolume}
215
+ label={`${volume}%`}
216
+ labelBold
217
+ />
218
+ );
219
+ }
107
220
  ```
108
221
 
109
222
  ---
223
+
224
+ ## Accessibility
225
+
226
+ - The underlying `<input type="range">` is fully accessible
227
+ - Labels are properly associated with the input via `htmlFor`
228
+ - Focus states are visually indicated
229
+ - Use `aria-label` or visible labels to describe the slider's purpose
230
+
231
+ ```js
232
+ <RangeInput
233
+ aria-label="Volume"
234
+ value={volume}
235
+ onValueChange={setVolume}
236
+ />
237
+ ```