@sybilion/uilib 1.4.20 → 1.4.22

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 (83) hide show
  1. package/assets/globals.css +3 -0
  2. package/dist/agent-glossary/workspace.generated.ts +2 -0
  3. package/dist/agent-glossary/workspace.index.md +2 -0
  4. package/dist/agent-glossary/workspace.md +2 -0
  5. package/dist/esm/components/ui/Checkbox/Checkbox.js +2 -2
  6. package/dist/esm/components/ui/Checkbox/Checkbox.styl.js +2 -2
  7. package/dist/esm/components/ui/DatePicker/Calendar.js +72 -0
  8. package/dist/esm/components/ui/DatePicker/DatePicker.js +81 -0
  9. package/dist/esm/components/ui/DatePicker/DatePicker.styl.js +7 -0
  10. package/dist/esm/components/ui/DatePicker/DatePickerInput.js +70 -0
  11. package/dist/esm/components/ui/DatePicker/DateRangePickerInput.js +130 -0
  12. package/dist/esm/components/ui/DatePicker/dateUtils.js +137 -0
  13. package/dist/esm/components/ui/RadioGroup/RadioGroup.helpers.js +6 -0
  14. package/dist/esm/components/ui/RadioGroup/RadioGroup.js +18 -0
  15. package/dist/esm/components/ui/RadioGroup/RadioGroup.styl.js +7 -0
  16. package/dist/esm/components/ui/Sidebar/SidebarGroup/SidebarGroup.styl.js +1 -1
  17. package/dist/esm/components/ui/TextShimmer/TextShimmer.js +1 -1
  18. package/dist/esm/components/ui/TextShimmer/TextShimmer.styl.js +1 -1
  19. package/dist/esm/index.js +5 -0
  20. package/dist/esm/types/src/components/ui/Checkbox/Checkbox.d.ts +1 -1
  21. package/dist/esm/types/src/components/ui/Checkbox/Checkbox.types.d.ts +2 -0
  22. package/dist/esm/types/src/components/ui/Checkbox/index.d.ts +1 -1
  23. package/dist/esm/types/src/components/ui/DatePicker/Calendar.d.ts +2 -0
  24. package/dist/esm/types/src/components/ui/DatePicker/DatePicker.d.ts +2 -0
  25. package/dist/esm/types/src/components/ui/DatePicker/DatePicker.types.d.ts +60 -0
  26. package/dist/esm/types/src/components/ui/DatePicker/DatePickerInput.d.ts +2 -0
  27. package/dist/esm/types/src/components/ui/DatePicker/DateRangePickerInput.d.ts +2 -0
  28. package/dist/esm/types/src/components/ui/DatePicker/dateUtils.d.ts +30 -0
  29. package/dist/esm/types/src/components/ui/DatePicker/index.d.ts +6 -0
  30. package/dist/esm/types/src/components/ui/RadioGroup/RadioGroup.d.ts +4 -0
  31. package/dist/esm/types/src/components/ui/RadioGroup/RadioGroup.example.d.ts +1 -0
  32. package/dist/esm/types/src/components/ui/RadioGroup/RadioGroup.helpers.d.ts +3 -0
  33. package/dist/esm/types/src/components/ui/RadioGroup/RadioGroup.types.d.ts +11 -0
  34. package/dist/esm/types/src/components/ui/RadioGroup/index.d.ts +2 -0
  35. package/dist/esm/types/src/docs/pages/DataDisplayOverviewPage.d.ts +1 -0
  36. package/dist/esm/types/src/docs/pages/DatePickerPage.d.ts +1 -0
  37. package/dist/esm/types/src/docs/pages/FeedbackOverviewPage.d.ts +1 -0
  38. package/dist/esm/types/src/docs/pages/FormsOverviewPage.d.ts +1 -0
  39. package/dist/esm/types/src/docs/pages/LayoutOverviewPage.d.ts +1 -0
  40. package/dist/esm/types/src/docs/pages/NavigationOverviewPage.d.ts +1 -0
  41. package/dist/esm/types/src/docs/pages/OverlaysOverviewPage.d.ts +1 -0
  42. package/dist/esm/types/src/docs/pages/RadioGroupPage.d.ts +1 -0
  43. package/dist/esm/types/src/index.d.ts +2 -0
  44. package/package.json +2 -1
  45. package/src/components/ui/Checkbox/AGENT.md +1 -0
  46. package/src/components/ui/Checkbox/Checkbox.styl +26 -2
  47. package/src/components/ui/Checkbox/Checkbox.styl.d.ts +4 -0
  48. package/src/components/ui/Checkbox/Checkbox.tsx +3 -3
  49. package/src/components/ui/Checkbox/Checkbox.types.ts +5 -1
  50. package/src/components/ui/Checkbox/index.ts +1 -1
  51. package/src/components/ui/DatePicker/AGENT.md +45 -0
  52. package/src/components/ui/DatePicker/Calendar.tsx +160 -0
  53. package/src/components/ui/DatePicker/DatePicker.styl +219 -0
  54. package/src/components/ui/DatePicker/DatePicker.styl.d.ts +39 -0
  55. package/src/components/ui/DatePicker/DatePicker.tsx +160 -0
  56. package/src/components/ui/DatePicker/DatePicker.types.ts +91 -0
  57. package/src/components/ui/DatePicker/DatePickerInput.tsx +169 -0
  58. package/src/components/ui/DatePicker/DateRangePickerInput.tsx +276 -0
  59. package/src/components/ui/DatePicker/dateUtils.ts +199 -0
  60. package/src/components/ui/DatePicker/index.ts +13 -0
  61. package/src/components/ui/RadioGroup/AGENT.md +24 -0
  62. package/src/components/ui/RadioGroup/RadioGroup.example.tsx +136 -0
  63. package/src/components/ui/RadioGroup/RadioGroup.helpers.ts +11 -0
  64. package/src/components/ui/RadioGroup/RadioGroup.styl +70 -0
  65. package/src/components/ui/RadioGroup/RadioGroup.styl.d.ts +13 -0
  66. package/src/components/ui/RadioGroup/RadioGroup.tsx +58 -0
  67. package/src/components/ui/RadioGroup/RadioGroup.types.ts +19 -0
  68. package/src/components/ui/RadioGroup/index.ts +6 -0
  69. package/src/components/ui/Sidebar/SidebarGroup/SidebarGroup.styl +3 -0
  70. package/src/components/ui/TextShimmer/TextShimmer.styl +1 -0
  71. package/src/components/ui/TextShimmer/TextShimmer.tsx +1 -1
  72. package/src/docs/components/DocsSidebar/DocsSidebar.tsx +7 -1
  73. package/src/docs/pages/CheckboxPage.tsx +129 -18
  74. package/src/docs/pages/DataDisplayOverviewPage.tsx +241 -0
  75. package/src/docs/pages/DatePickerPage.tsx +183 -0
  76. package/src/docs/pages/FeedbackOverviewPage.tsx +57 -0
  77. package/src/docs/pages/FormsOverviewPage.tsx +721 -0
  78. package/src/docs/pages/LayoutOverviewPage.tsx +259 -0
  79. package/src/docs/pages/NavigationOverviewPage.tsx +94 -0
  80. package/src/docs/pages/OverlaysOverviewPage.tsx +196 -0
  81. package/src/docs/pages/RadioGroupPage.tsx +21 -0
  82. package/src/docs/registry.ts +48 -0
  83. package/src/index.ts +2 -0
@@ -0,0 +1,721 @@
1
+ import { useState } from 'react';
2
+
3
+ import { Button } from '#uilib/components/ui/Button';
4
+ import { ButtonGroup } from '#uilib/components/ui/ButtonGroup';
5
+ import { Checkbox } from '#uilib/components/ui/Checkbox';
6
+ import {
7
+ DatePickerInput,
8
+ DateRangePickerInput,
9
+ } from '#uilib/components/ui/DatePicker';
10
+ import type { DateRangeValue } from '#uilib/components/ui/DatePicker';
11
+ import { DropZone } from '#uilib/components/ui/DropZone/DropZone';
12
+ import { Input } from '#uilib/components/ui/Input';
13
+ import { Label } from '#uilib/components/ui/Label';
14
+ import { LabelWithId } from '#uilib/components/ui/LabelWithId';
15
+ import { LabeledInput } from '#uilib/components/ui/LabeledInput/LabeledInput';
16
+ import { MobileAdaptiveSelector } from '#uilib/components/ui/MobileAdaptiveSelector';
17
+ import { NumberControl } from '#uilib/components/ui/NumberControl';
18
+ import { PageContentSection } from '#uilib/components/ui/Page';
19
+ import { RadioGroup, RadioGroupItem } from '#uilib/components/ui/RadioGroup';
20
+ import { RegionSelector } from '#uilib/components/ui/RegionCoords';
21
+ import { Renamer } from '#uilib/components/ui/Renamer';
22
+ import {
23
+ Select,
24
+ SelectContent,
25
+ SelectItem,
26
+ SelectTrigger,
27
+ SelectValue,
28
+ } from '#uilib/components/ui/Select';
29
+ import { Slider } from '#uilib/components/ui/Slider';
30
+ import { Switch } from '#uilib/components/ui/Switch';
31
+ import { TimeRangeControls } from '#uilib/components/ui/TimeRangeControls';
32
+ import { ToggleGroup, ToggleGroupItem } from '#uilib/components/ui/ToggleGroup';
33
+
34
+ import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
35
+ import { DocsHeaderActions } from '../docsHeaderActions';
36
+
37
+ const FRUIT_OPTIONS = [
38
+ { value: 'apple', label: 'Apple' },
39
+ { value: 'orange', label: 'Orange' },
40
+ { value: 'banana', label: 'Banana' },
41
+ ] as const;
42
+
43
+ const ROLE_OPTIONS = [
44
+ { value: 'viewer', label: 'Viewer' },
45
+ { value: 'editor', label: 'Editor' },
46
+ { value: 'admin', label: 'Admin' },
47
+ ] as const;
48
+
49
+ const MOBILE_SELECTOR_ITEMS = [
50
+ { value: 'a', label: 'Alpha' },
51
+ { value: 'b', label: 'Beta' },
52
+ { value: 'c', label: 'Gamma' },
53
+ ] as const;
54
+
55
+ const REGION_COORDS = {
56
+ NYC: { longitude: -74.006, latitude: 40.7128 },
57
+ London: { longitude: -0.1276, latitude: 51.5074 },
58
+ } as const;
59
+
60
+ const SLIDER_WIDTH = 280;
61
+ const FIELD_WIDTH = 280;
62
+
63
+ const stateLabelStyle: React.CSSProperties = {
64
+ marginBottom: '0.5rem',
65
+ fontSize: 13,
66
+ fontWeight: 600,
67
+ color: 'var(--muted-foreground)',
68
+ textTransform: 'uppercase',
69
+ letterSpacing: '0.04em',
70
+ };
71
+
72
+ const twoColumnStyle: React.CSSProperties = {
73
+ display: 'grid',
74
+ gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))',
75
+ gap: '1.5rem',
76
+ };
77
+
78
+ const panelStyle: React.CSSProperties = {
79
+ display: 'flex',
80
+ flexDirection: 'column',
81
+ gap: '0.75rem',
82
+ padding: 'var(--p-3)',
83
+ borderRadius: 'var(--radius-3)',
84
+ };
85
+
86
+ function DemoSelect({
87
+ disabled = false,
88
+ defaultValue,
89
+ placeholder = 'Pick fruit',
90
+ }: {
91
+ disabled?: boolean;
92
+ defaultValue?: string;
93
+ placeholder?: string;
94
+ }) {
95
+ return (
96
+ <Select defaultValue={defaultValue}>
97
+ <SelectTrigger disabled={disabled} style={{ width: FIELD_WIDTH }}>
98
+ <SelectValue placeholder={placeholder} />
99
+ </SelectTrigger>
100
+ <SelectContent>
101
+ {FRUIT_OPTIONS.map(o => (
102
+ <SelectItem key={o.value} value={o.value}>
103
+ {o.label}
104
+ </SelectItem>
105
+ ))}
106
+ </SelectContent>
107
+ </Select>
108
+ );
109
+ }
110
+
111
+ export default function FormsOverviewPage() {
112
+ const [sliderValue, setSliderValue] = useState([40]);
113
+ const [toggleValue, setToggleValue] = useState('day');
114
+ const [numberValue, setNumberValue] = useState(2);
115
+ const [labeledValue, setLabeledValue] = useState('Sybilion');
116
+ const [period, setPeriod] = useState('week');
117
+ const [composedName, setComposedName] = useState('Alex Morgan');
118
+ const [composedEmail, setComposedEmail] = useState('alex@example.com');
119
+ const [composedRole, setComposedRole] = useState('editor');
120
+ const [composedNotifications, setComposedNotifications] = useState(true);
121
+ const [composedTerms, setComposedTerms] = useState(false);
122
+ const [billingPlan, setBillingPlan] = useState('pro');
123
+ const [dropZoneName, setDropZoneName] = useState<string | null>(null);
124
+ const [mobileSelectorValue, setMobileSelectorValue] = useState('a');
125
+ const [regionPick, setRegionPick] = useState<string | null>(null);
126
+ const [renamerValue, setRenamerValue] = useState('Dataset name');
127
+ const [timeRange, setTimeRange] = useState('1y');
128
+ const [dateValue, setDateValue] = useState('2026-07-03');
129
+ const [dateRangeValue, setDateRangeValue] = useState<DateRangeValue | null>({
130
+ start: '2026-07-01',
131
+ end: '2026-07-31',
132
+ });
133
+
134
+ return (
135
+ <>
136
+ <AppPageHeader
137
+ breadcrumbs={[{ label: 'Overview' }]}
138
+ title="Overview"
139
+ subheader="Composition of form inputs and actions."
140
+ actions={<DocsHeaderActions />}
141
+ />
142
+ <PageContentSection
143
+ style={{ display: 'flex', flexDirection: 'column', gap: '2.5rem' }}
144
+ >
145
+ <section>
146
+ <h3 style={{ marginBottom: '1rem' }}>Text input</h3>
147
+ <div style={twoColumnStyle}>
148
+ <div style={panelStyle}>
149
+ <p style={stateLabelStyle}>Default</p>
150
+ <Input placeholder="Enter text" style={{ width: FIELD_WIDTH }} />
151
+ <Input
152
+ type="textarea"
153
+ placeholder="Enter description"
154
+ rows={3}
155
+ style={{ width: FIELD_WIDTH }}
156
+ />
157
+ </div>
158
+ <div style={panelStyle}>
159
+ <p style={stateLabelStyle}>Disabled</p>
160
+ <Input
161
+ disabled
162
+ placeholder="Enter text"
163
+ style={{ width: FIELD_WIDTH }}
164
+ />
165
+ <Input
166
+ type="textarea"
167
+ disabled
168
+ placeholder="Enter description"
169
+ rows={3}
170
+ style={{ width: FIELD_WIDTH }}
171
+ />
172
+ </div>
173
+ </div>
174
+ </section>
175
+
176
+ <section>
177
+ <h3 style={{ marginBottom: '1rem' }}>Label</h3>
178
+ <div style={panelStyle}>
179
+ <Label htmlFor="forms-label-demo">Example label</Label>
180
+ </div>
181
+ </section>
182
+
183
+ <section>
184
+ <h3 style={{ marginBottom: '1rem' }}>LabelWithId</h3>
185
+ <div style={panelStyle}>
186
+ <LabelWithId id={42} label="Analysis label" />
187
+ </div>
188
+ </section>
189
+
190
+ <section>
191
+ <h3 style={{ marginBottom: '1rem' }}>LabeledInput</h3>
192
+ <div style={twoColumnStyle}>
193
+ <div style={panelStyle}>
194
+ <p style={stateLabelStyle}>Default</p>
195
+ <LabeledInput
196
+ id="forms-labeled-default"
197
+ name="labeled-default"
198
+ label="Account name"
199
+ value={labeledValue}
200
+ onChange={e => setLabeledValue(e.target.value)}
201
+ placeholder="Value"
202
+ />
203
+ </div>
204
+ <div style={panelStyle}>
205
+ <p style={stateLabelStyle}>Disabled</p>
206
+ <LabeledInput
207
+ id="forms-labeled-disabled"
208
+ name="labeled-disabled"
209
+ label="Account name"
210
+ value="Sybilion"
211
+ onChange={() => {}}
212
+ placeholder="Value"
213
+ disabled
214
+ />
215
+ </div>
216
+ </div>
217
+ </section>
218
+
219
+ <section>
220
+ <h3 style={{ marginBottom: '1rem' }}>Checkbox</h3>
221
+ <div style={twoColumnStyle}>
222
+ <div style={panelStyle}>
223
+ <p style={stateLabelStyle}>Default</p>
224
+ <div
225
+ style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}
226
+ >
227
+ <Checkbox id="forms-cb-default" defaultChecked />
228
+ <Label htmlFor="forms-cb-default">Accept terms</Label>
229
+ </div>
230
+ <div
231
+ style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}
232
+ >
233
+ <Checkbox id="forms-cb-unchecked" />
234
+ <Label htmlFor="forms-cb-unchecked">Subscribe to updates</Label>
235
+ </div>
236
+ </div>
237
+ <div style={panelStyle}>
238
+ <p style={stateLabelStyle}>Disabled</p>
239
+ <div
240
+ style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}
241
+ >
242
+ <Checkbox id="forms-cb-dis-on" checked disabled />
243
+ <Label htmlFor="forms-cb-dis-on">Accept terms</Label>
244
+ </div>
245
+ <div
246
+ style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}
247
+ >
248
+ <Checkbox id="forms-cb-dis-off" disabled />
249
+ <Label htmlFor="forms-cb-dis-off">Subscribe to updates</Label>
250
+ </div>
251
+ </div>
252
+ </div>
253
+ </section>
254
+
255
+ <section>
256
+ <h3 style={{ marginBottom: '1rem' }}>RadioGroup</h3>
257
+ <div style={twoColumnStyle}>
258
+ <div style={panelStyle}>
259
+ <p style={stateLabelStyle}>Default</p>
260
+ <RadioGroup
261
+ value={billingPlan}
262
+ onValueChange={setBillingPlan}
263
+ aria-label="Billing plan"
264
+ >
265
+ <div
266
+ style={{
267
+ display: 'flex',
268
+ alignItems: 'center',
269
+ gap: '0.5rem',
270
+ }}
271
+ >
272
+ <RadioGroupItem value="starter" id="forms-rg-starter" />
273
+ <Label htmlFor="forms-rg-starter">Starter</Label>
274
+ </div>
275
+ <div
276
+ style={{
277
+ display: 'flex',
278
+ alignItems: 'center',
279
+ gap: '0.5rem',
280
+ }}
281
+ >
282
+ <RadioGroupItem value="pro" id="forms-rg-pro" />
283
+ <Label htmlFor="forms-rg-pro">Pro</Label>
284
+ </div>
285
+ <div
286
+ style={{
287
+ display: 'flex',
288
+ alignItems: 'center',
289
+ gap: '0.5rem',
290
+ }}
291
+ >
292
+ <RadioGroupItem value="enterprise" id="forms-rg-enterprise" />
293
+ <Label htmlFor="forms-rg-enterprise">Enterprise</Label>
294
+ </div>
295
+ </RadioGroup>
296
+ </div>
297
+ <div style={panelStyle}>
298
+ <p style={stateLabelStyle}>Disabled</p>
299
+ <RadioGroup
300
+ defaultValue="starter"
301
+ disabled
302
+ aria-label="Disabled plan"
303
+ >
304
+ <div
305
+ style={{
306
+ display: 'flex',
307
+ alignItems: 'center',
308
+ gap: '0.5rem',
309
+ }}
310
+ >
311
+ <RadioGroupItem value="starter" id="forms-rg-dis-starter" />
312
+ <Label htmlFor="forms-rg-dis-starter">Starter</Label>
313
+ </div>
314
+ <div
315
+ style={{
316
+ display: 'flex',
317
+ alignItems: 'center',
318
+ gap: '0.5rem',
319
+ }}
320
+ >
321
+ <RadioGroupItem value="pro" id="forms-rg-dis-pro" />
322
+ <Label htmlFor="forms-rg-dis-pro">Pro</Label>
323
+ </div>
324
+ <div
325
+ style={{
326
+ display: 'flex',
327
+ alignItems: 'center',
328
+ gap: '0.5rem',
329
+ }}
330
+ >
331
+ <RadioGroupItem
332
+ value="enterprise"
333
+ id="forms-rg-dis-enterprise"
334
+ />
335
+ <Label htmlFor="forms-rg-dis-enterprise">Enterprise</Label>
336
+ </div>
337
+ </RadioGroup>
338
+ </div>
339
+ </div>
340
+ </section>
341
+
342
+ <section>
343
+ <h3 style={{ marginBottom: '1rem' }}>Switch</h3>
344
+ <div style={twoColumnStyle}>
345
+ <div style={panelStyle}>
346
+ <p style={stateLabelStyle}>Default</p>
347
+ <div
348
+ style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}
349
+ >
350
+ <Switch id="forms-sw-default" defaultChecked />
351
+ <Label htmlFor="forms-sw-default">Enable notifications</Label>
352
+ </div>
353
+ </div>
354
+ <div style={panelStyle}>
355
+ <p style={stateLabelStyle}>Disabled</p>
356
+ <div
357
+ style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}
358
+ >
359
+ <Switch id="forms-sw-dis-on" checked disabled />
360
+ <Label htmlFor="forms-sw-dis-on">Enable notifications</Label>
361
+ </div>
362
+ <div
363
+ style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}
364
+ >
365
+ <Switch id="forms-sw-dis-off" disabled />
366
+ <Label htmlFor="forms-sw-dis-off">Enable notifications</Label>
367
+ </div>
368
+ </div>
369
+ </div>
370
+ </section>
371
+
372
+ <section>
373
+ <h3 style={{ marginBottom: '1rem' }}>Select</h3>
374
+ <div style={twoColumnStyle}>
375
+ <div style={panelStyle}>
376
+ <p style={stateLabelStyle}>Default</p>
377
+ <DemoSelect defaultValue="apple" />
378
+ <DemoSelect placeholder="Pick fruit" />
379
+ </div>
380
+ <div style={panelStyle}>
381
+ <p style={stateLabelStyle}>Disabled</p>
382
+ <DemoSelect defaultValue="orange" disabled />
383
+ </div>
384
+ </div>
385
+ </section>
386
+
387
+ <section>
388
+ <h3 style={{ marginBottom: '1rem' }}>DatePicker</h3>
389
+ <div style={twoColumnStyle}>
390
+ <div style={panelStyle}>
391
+ <p style={stateLabelStyle}>Single date</p>
392
+ <DatePickerInput
393
+ value={dateValue}
394
+ onChange={next => setDateValue(next ?? '')}
395
+ style={{ width: FIELD_WIDTH }}
396
+ />
397
+ </div>
398
+ <div style={panelStyle}>
399
+ <p style={stateLabelStyle}>Date range</p>
400
+ <DateRangePickerInput
401
+ value={dateRangeValue}
402
+ onChange={setDateRangeValue}
403
+ style={{ width: FIELD_WIDTH + 80 }}
404
+ />
405
+ </div>
406
+ </div>
407
+ <div
408
+ style={{ ...panelStyle, marginTop: '1rem', maxWidth: FIELD_WIDTH }}
409
+ >
410
+ <p style={stateLabelStyle}>Disabled</p>
411
+ <DatePickerInput
412
+ value="2026-07-03"
413
+ disabled
414
+ style={{ width: FIELD_WIDTH }}
415
+ />
416
+ </div>
417
+ </section>
418
+
419
+ <section>
420
+ <h3 style={{ marginBottom: '1rem' }}>Slider</h3>
421
+ <div style={twoColumnStyle}>
422
+ <div style={panelStyle}>
423
+ <p style={stateLabelStyle}>Default</p>
424
+ <Slider
425
+ value={sliderValue}
426
+ onValueChange={setSliderValue}
427
+ max={100}
428
+ step={1}
429
+ style={{ width: SLIDER_WIDTH }}
430
+ />
431
+ <p style={{ fontSize: 14, color: 'var(--muted-foreground)' }}>
432
+ Value: {sliderValue[0]}
433
+ </p>
434
+ </div>
435
+ <div style={panelStyle}>
436
+ <p style={stateLabelStyle}>Disabled</p>
437
+ <Slider
438
+ defaultValue={[60]}
439
+ max={100}
440
+ step={1}
441
+ disabled
442
+ style={{ width: SLIDER_WIDTH }}
443
+ />
444
+ </div>
445
+ </div>
446
+ </section>
447
+
448
+ <section>
449
+ <h3 style={{ marginBottom: '1rem' }}>ToggleGroup</h3>
450
+ <div style={twoColumnStyle}>
451
+ <div style={panelStyle}>
452
+ <p style={stateLabelStyle}>Default</p>
453
+ <ToggleGroup
454
+ type="single"
455
+ value={toggleValue}
456
+ onValueChange={val => {
457
+ if (val) setToggleValue(val);
458
+ }}
459
+ >
460
+ <ToggleGroupItem value="day">Day</ToggleGroupItem>
461
+ <ToggleGroupItem value="week">Week</ToggleGroupItem>
462
+ <ToggleGroupItem value="month">Month</ToggleGroupItem>
463
+ </ToggleGroup>
464
+ </div>
465
+ <div style={panelStyle}>
466
+ <p style={stateLabelStyle}>Disabled</p>
467
+ <ToggleGroup type="single" value="week" disabled>
468
+ <ToggleGroupItem value="day">Day</ToggleGroupItem>
469
+ <ToggleGroupItem value="week">Week</ToggleGroupItem>
470
+ <ToggleGroupItem value="month">Month</ToggleGroupItem>
471
+ </ToggleGroup>
472
+ </div>
473
+ </div>
474
+ </section>
475
+
476
+ <section>
477
+ <h3 style={{ marginBottom: '1rem' }}>NumberControl</h3>
478
+ <div style={panelStyle}>
479
+ <NumberControl
480
+ value={numberValue}
481
+ onChange={setNumberValue}
482
+ min={0}
483
+ max={10}
484
+ step={1}
485
+ />
486
+ </div>
487
+ </section>
488
+
489
+ <section>
490
+ <h3 style={{ marginBottom: '1rem' }}>Button</h3>
491
+ <div style={panelStyle}>
492
+ <div
493
+ style={{
494
+ display: 'flex',
495
+ flexWrap: 'wrap',
496
+ gap: '0.75rem',
497
+ alignItems: 'center',
498
+ }}
499
+ >
500
+ <Button type="button">Primary</Button>
501
+ <Button type="button" variant="secondary">
502
+ Secondary
503
+ </Button>
504
+ <Button type="button" variant="outline">
505
+ Outline
506
+ </Button>
507
+ <Button type="button" variant="ghost">
508
+ Ghost
509
+ </Button>
510
+ <Button type="button" variant="link">
511
+ Link
512
+ </Button>
513
+ </div>
514
+ <div
515
+ style={{
516
+ display: 'flex',
517
+ flexWrap: 'wrap',
518
+ gap: '0.75rem',
519
+ alignItems: 'center',
520
+ }}
521
+ >
522
+ <Button type="button" disabled>
523
+ Disabled
524
+ </Button>
525
+ <Button type="button" variant="outline" disabled>
526
+ Disabled outline
527
+ </Button>
528
+ </div>
529
+ </div>
530
+ </section>
531
+
532
+ <section>
533
+ <h3 style={{ marginBottom: '1rem' }}>ButtonGroup</h3>
534
+ <div style={panelStyle}>
535
+ <ButtonGroup>
536
+ {['day', 'week', 'month'].map(item => (
537
+ <Button
538
+ key={item}
539
+ type="button"
540
+ variant={item === period ? 'default' : 'outline'}
541
+ onClick={() => setPeriod(item)}
542
+ >
543
+ {item}
544
+ </Button>
545
+ ))}
546
+ </ButtonGroup>
547
+ </div>
548
+ </section>
549
+
550
+ <section>
551
+ <h3 style={{ marginBottom: '1rem' }}>DropZone</h3>
552
+ <div style={{ ...panelStyle, maxWidth: 420 }}>
553
+ <DropZone
554
+ accept=".csv,.txt"
555
+ label="Drop a .csv or .txt file here"
556
+ onFile={file => setDropZoneName(file.name)}
557
+ />
558
+ {dropZoneName ? (
559
+ <p style={{ margin: 0, fontSize: 14 }}>
560
+ Selected: {dropZoneName}
561
+ </p>
562
+ ) : null}
563
+ </div>
564
+ </section>
565
+
566
+ <section>
567
+ <h3 style={{ marginBottom: '1rem' }}>MobileAdaptiveSelector</h3>
568
+ <div style={panelStyle}>
569
+ <MobileAdaptiveSelector
570
+ value={mobileSelectorValue}
571
+ onChange={setMobileSelectorValue}
572
+ items={[...MOBILE_SELECTOR_ITEMS]}
573
+ isDropdown={false}
574
+ />
575
+ </div>
576
+ </section>
577
+
578
+ <section>
579
+ <h3 style={{ marginBottom: '1rem' }}>RegionCoords</h3>
580
+ <div style={panelStyle}>
581
+ <RegionSelector
582
+ regions={REGION_COORDS}
583
+ onSelect={(name, coords) => {
584
+ setRegionPick(
585
+ `${name}: ${coords.latitude.toFixed(2)}, ${coords.longitude.toFixed(2)}`,
586
+ );
587
+ }}
588
+ >
589
+ <span style={{ marginRight: 8 }}>Map region</span>
590
+ </RegionSelector>
591
+ {regionPick ? (
592
+ <p style={{ margin: 0, fontSize: 14 }}>{regionPick}</p>
593
+ ) : null}
594
+ </div>
595
+ </section>
596
+
597
+ <section>
598
+ <h3 style={{ marginBottom: '1rem' }}>Renamer</h3>
599
+ <div style={panelStyle}>
600
+ <Renamer value={renamerValue} onChange={setRenamerValue} size="md">
601
+ {renamerValue}
602
+ </Renamer>
603
+ </div>
604
+ </section>
605
+
606
+ <section>
607
+ <h3 style={{ marginBottom: '1rem' }}>TimeRangeControls</h3>
608
+ <div style={panelStyle}>
609
+ <TimeRangeControls
610
+ timeRange={timeRange}
611
+ onTimeRangeChange={setTimeRange}
612
+ loading={false}
613
+ />
614
+ </div>
615
+ </section>
616
+
617
+ {/* Form (react-hook-form integration) excluded — see FormPage */}
618
+
619
+ <section>
620
+ <h3 style={{ marginBottom: '1rem' }}>Composed form</h3>
621
+ <p
622
+ style={{
623
+ marginBottom: '1rem',
624
+ color: 'var(--muted-foreground)',
625
+ maxWidth: 560,
626
+ }}
627
+ >
628
+ Realistic layout combining several controls — visual composition
629
+ only, no form library.
630
+ </p>
631
+ <form
632
+ style={{
633
+ ...panelStyle,
634
+ maxWidth: 480,
635
+ gap: '1.25rem',
636
+ }}
637
+ onSubmit={e => e.preventDefault()}
638
+ >
639
+ <LabeledInput
640
+ id="forms-composed-name"
641
+ name="name"
642
+ label="Full name"
643
+ value={composedName}
644
+ onChange={e => setComposedName(e.target.value)}
645
+ placeholder="Enter your name"
646
+ />
647
+ <LabeledInput
648
+ id="forms-composed-email"
649
+ name="email"
650
+ type="email"
651
+ label="Email"
652
+ value={composedEmail}
653
+ onChange={e => setComposedEmail(e.target.value)}
654
+ placeholder="you@company.com"
655
+ />
656
+ <div
657
+ style={{
658
+ display: 'flex',
659
+ flexDirection: 'column',
660
+ gap: '0.5rem',
661
+ }}
662
+ >
663
+ <Label htmlFor="forms-composed-role">Role</Label>
664
+ <Select value={composedRole} onValueChange={setComposedRole}>
665
+ <SelectTrigger
666
+ id="forms-composed-role"
667
+ style={{ width: '100%' }}
668
+ >
669
+ <SelectValue placeholder="Select role" />
670
+ </SelectTrigger>
671
+ <SelectContent>
672
+ {ROLE_OPTIONS.map(o => (
673
+ <SelectItem key={o.value} value={o.value}>
674
+ {o.label}
675
+ </SelectItem>
676
+ ))}
677
+ </SelectContent>
678
+ </Select>
679
+ </div>
680
+ <div
681
+ style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}
682
+ >
683
+ <Switch
684
+ id="forms-composed-notifications"
685
+ checked={composedNotifications}
686
+ onCheckedChange={setComposedNotifications}
687
+ />
688
+ <Label htmlFor="forms-composed-notifications">
689
+ Email me about product updates
690
+ </Label>
691
+ </div>
692
+ <div
693
+ style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}
694
+ >
695
+ <Checkbox
696
+ id="forms-composed-terms"
697
+ checked={composedTerms}
698
+ onCheckedChange={v => setComposedTerms(v === true)}
699
+ />
700
+ <Label htmlFor="forms-composed-terms">
701
+ I agree to the terms of service
702
+ </Label>
703
+ </div>
704
+ <div
705
+ style={{
706
+ display: 'flex',
707
+ gap: '0.75rem',
708
+ paddingTop: '0.5rem',
709
+ }}
710
+ >
711
+ <Button type="submit">Save profile</Button>
712
+ <Button type="button" variant="outline">
713
+ Cancel
714
+ </Button>
715
+ </div>
716
+ </form>
717
+ </section>
718
+ </PageContentSection>
719
+ </>
720
+ );
721
+ }