@kenpan/zds-r8f3v1 0.2.0 → 0.3.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.
Files changed (113) hide show
  1. package/dist/_virtual/index.js +5 -3
  2. package/dist/_virtual/index.js.map +1 -1
  3. package/dist/_virtual/index2.js +3 -2
  4. package/dist/_virtual/index2.js.map +1 -1
  5. package/dist/_virtual/index3.js +2 -2
  6. package/dist/_virtual/index5.js +2 -5
  7. package/dist/_virtual/index5.js.map +1 -1
  8. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/AppBar/AppBar.js +1 -1
  9. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Autocomplete/Autocomplete.js +1 -1
  10. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Avatar/Avatar.js +1 -1
  11. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Backdrop/Backdrop.js +1 -1
  12. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Box/Box.js +1 -1
  13. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Button/Button.js +1 -1
  14. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/ButtonBase/ButtonBase.js +1 -1
  15. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/ButtonBase/Ripple.js +1 -1
  16. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/ButtonBase/TouchRipple.js +1 -1
  17. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Checkbox/Checkbox.js +1 -1
  18. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Chip/Chip.js +1 -1
  19. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/CircularProgress/CircularProgress.js +1 -1
  20. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/ClickAwayListener/ClickAwayListener.js +1 -1
  21. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Collapse/Collapse.js +1 -1
  22. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/DefaultPropsProvider/DefaultPropsProvider.js +1 -1
  23. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Dialog/Dialog.js +1 -1
  24. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Divider/Divider.js +1 -1
  25. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Drawer/Drawer.js +1 -1
  26. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Fade/Fade.js +1 -1
  27. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/FilledInput/FilledInput.js +1 -1
  28. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/FormControl/FormControl.js +1 -1
  29. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/FormGroup/FormGroup.js +1 -1
  30. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/FormHelperText/FormHelperText.js +1 -1
  31. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/FormLabel/FormLabel.js +1 -1
  32. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/GlobalStyles/GlobalStyles.js +1 -1
  33. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Grow/Grow.js +1 -1
  34. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/IconButton/IconButton.js +1 -1
  35. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Input/Input.js +1 -1
  36. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/InputAdornment/InputAdornment.js +1 -1
  37. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/InputBase/InputBase.js +1 -1
  38. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/InputLabel/InputLabel.js +1 -1
  39. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/LinearProgress/LinearProgress.js +1 -1
  40. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/List/List.js +1 -1
  41. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/ListItemButton/ListItemButton.js +1 -1
  42. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/ListItemIcon/ListItemIcon.js +1 -1
  43. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/ListItemText/ListItemText.js +1 -1
  44. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/ListSubheader/ListSubheader.js +1 -1
  45. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Menu/Menu.js +2 -2
  46. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/MenuItem/MenuItem.js +1 -1
  47. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/MenuList/MenuList.js +2 -2
  48. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Modal/Modal.js +1 -1
  49. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/NativeSelect/NativeSelectInput.js +1 -1
  50. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/OutlinedInput/NotchedOutline.js +1 -1
  51. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/OutlinedInput/OutlinedInput.js +1 -1
  52. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Paper/Paper.js +1 -1
  53. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Popover/Popover.js +1 -1
  54. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Popper/BasePopper.js +1 -1
  55. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Popper/Popper.js +1 -1
  56. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Portal/Portal.js +1 -1
  57. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Radio/Radio.js +1 -1
  58. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Radio/RadioButtonIcon.js +1 -1
  59. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/RadioGroup/RadioGroup.js +1 -1
  60. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Select/Select.js +1 -1
  61. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Select/SelectInput.js +2 -2
  62. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Skeleton/Skeleton.js +1 -1
  63. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Slide/Slide.js +1 -1
  64. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Slider/Slider.js +1 -1
  65. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Slider/SliderValueLabel.js +1 -1
  66. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Snackbar/Snackbar.js +1 -1
  67. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/SnackbarContent/SnackbarContent.js +1 -1
  68. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Stack/Stack.js +1 -1
  69. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Step/Step.js +1 -1
  70. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/StepConnector/StepConnector.js +1 -1
  71. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/StepIcon/StepIcon.js +1 -1
  72. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/StepLabel/StepLabel.js +1 -1
  73. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Stepper/Stepper.js +1 -1
  74. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/SvgIcon/SvgIcon.js +1 -1
  75. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Switch/Switch.js +1 -1
  76. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Tab/Tab.js +1 -1
  77. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/TabScrollButton/TabScrollButton.js +1 -1
  78. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Tabs/ScrollbarSize.js +1 -1
  79. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Tabs/Tabs.js +2 -2
  80. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/TextField/TextField.js +1 -1
  81. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/TextareaAutosize/TextareaAutosize.js +1 -1
  82. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Toolbar/Toolbar.js +1 -1
  83. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Tooltip/Tooltip.js +1 -1
  84. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Typography/Typography.js +1 -1
  85. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/Unstable_TrapFocus/FocusTrap.js +1 -1
  86. package/dist/packages/zenith-ui/node_modules/@mui/material/esm/internal/SwitchBase.js +1 -1
  87. package/dist/packages/zenith-ui/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider.js +1 -1
  88. package/dist/packages/zenith-ui/node_modules/@mui/system/esm/RtlProvider/index.js +1 -1
  89. package/dist/packages/zenith-ui/node_modules/@mui/system/esm/responsivePropType/responsivePropType.js +1 -1
  90. package/dist/packages/zenith-ui/node_modules/@mui/utils/esm/deepmerge/deepmerge.js +1 -1
  91. package/dist/packages/zenith-ui/node_modules/@mui/utils/esm/elementAcceptingRef/elementAcceptingRef.js +1 -1
  92. package/dist/packages/zenith-ui/node_modules/@mui/utils/esm/elementTypeAcceptingRef/elementTypeAcceptingRef.js +1 -1
  93. package/dist/packages/zenith-ui/node_modules/@mui/utils/esm/getDisplayName/getDisplayName.js +1 -1
  94. package/dist/packages/zenith-ui/node_modules/@mui/utils/esm/refType/refType.js +1 -1
  95. package/dist/packages/zenith-ui/node_modules/prop-types/index.js +1 -1
  96. package/dist/packages/zenith-ui/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  97. package/dist/packages/zenith-ui/node_modules/react-is/index.js +1 -1
  98. package/dist/packages/zenith-ui/node_modules/react-transition-group/esm/Transition.js +1 -1
  99. package/dist/packages/zenith-ui/node_modules/react-transition-group/esm/TransitionGroup.js +1 -1
  100. package/dist/packages/zenith-ui/node_modules/react-transition-group/esm/utils/PropTypes.js +1 -1
  101. package/guidelines/Guidelines.md +67 -0
  102. package/guidelines/components/button.md +127 -43
  103. package/guidelines/components/dialog.md +164 -87
  104. package/guidelines/components/forms.md +239 -77
  105. package/guidelines/components/table.md +221 -87
  106. package/guidelines/design-tokens/colors.md +181 -0
  107. package/guidelines/design-tokens/spacing.md +135 -0
  108. package/guidelines/design-tokens/typography.md +146 -0
  109. package/guidelines/overview-components.md +136 -0
  110. package/guidelines/overview-icons.md +144 -0
  111. package/package.json +1 -1
  112. package/guidelines/overview.md +0 -81
  113. package/guidelines/tokens.md +0 -149
@@ -1,119 +1,196 @@
1
1
  # Dialog Component
2
2
 
3
- The Dialog component creates modal overlays for focused user interactions.
3
+ **Purpose**: Display focused content that requires user attention or action. Use for confirmations, forms, and important messages.
4
4
 
5
- ## When to Use
5
+ **Import**:
6
+ ```tsx
7
+ import { Dialog, DialogHeader, DialogFooter, Button } from '@kenpan/zds-r8f3v1'
8
+ ```
9
+
10
+ ## Props
11
+
12
+ ### Dialog Props
13
+
14
+ | Prop | Type | Default | Description |
15
+ |------|------|---------|-------------|
16
+ | `open` | `boolean` | - | **Required**. Controls dialog visibility |
17
+ | `onClose` | `() => void` | - | **Required**. Called when dialog should close |
18
+ | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Dialog width |
19
+ | `children` | `ReactNode` | - | Dialog content |
6
20
 
7
- - **Confirmation dialogs** - Confirm destructive or irreversible actions
8
- - **Form dialogs** - Collect focused input from users
9
- - **Information dialogs** - Display important information that requires acknowledgment
10
- - **Selection dialogs** - Allow users to make a choice from options
21
+ ### DialogHeader Props
22
+
23
+ | Prop | Type | Default | Description |
24
+ |------|------|---------|-------------|
25
+ | `title` | `string` | - | Header title |
26
+ | `subtitle` | `string` | - | Optional subtitle |
27
+ | `onClose` | `() => void` | - | Close button handler |
28
+ | `icon` | `ReactNode` | - | Optional icon before title |
29
+
30
+ ### DialogFooter Props
31
+
32
+ | Prop | Type | Default | Description |
33
+ |------|------|---------|-------------|
34
+ | `children` | `ReactNode` | - | Footer content (usually buttons) |
35
+ | `align` | `'left' \| 'right' \| 'center'` | `'right'` | Button alignment |
11
36
 
12
37
  ## Basic Usage
13
38
 
14
39
  ```tsx
15
- import { Dialog, DialogHeader, DialogContent, DialogFooter, Button } from '@kenpan/zds-r8f3v1'
40
+ import { useState } from 'react'
41
+ import { Dialog, DialogHeader, DialogFooter, Button } from '@kenpan/zds-r8f3v1'
42
+
43
+ function MyComponent() {
44
+ const [open, setOpen] = useState(false)
16
45
 
17
- function ConfirmDialog({ open, onClose, onConfirm }) {
18
46
  return (
19
- <Dialog open={open} onClose={onClose}>
20
- <DialogHeader
21
- title="Delete Item"
22
- onClose={onClose}
23
- />
24
- <DialogContent>
25
- Are you sure you want to delete this item? This action cannot be undone.
26
- </DialogContent>
27
- <DialogFooter>
28
- <Button variant="secondary-gray" onClick={onClose}>
29
- Cancel
30
- </Button>
31
- <Button variant="primary" color="destructive" onClick={onConfirm}>
32
- Delete
33
- </Button>
34
- </DialogFooter>
35
- </Dialog>
47
+ <>
48
+ <Button onClick={() => setOpen(true)}>Open Dialog</Button>
49
+
50
+ <Dialog open={open} onClose={() => setOpen(false)}>
51
+ <DialogHeader
52
+ title="Confirm Action"
53
+ onClose={() => setOpen(false)}
54
+ />
55
+
56
+ <Box sx={{ p: 6 }}>
57
+ <Typography>Are you sure you want to continue?</Typography>
58
+ </Box>
59
+
60
+ <DialogFooter>
61
+ <Button variant="secondary-gray" onClick={() => setOpen(false)}>
62
+ Cancel
63
+ </Button>
64
+ <Button variant="primary" onClick={() => setOpen(false)}>
65
+ Confirm
66
+ </Button>
67
+ </DialogFooter>
68
+ </Dialog>
69
+ </>
36
70
  )
37
71
  }
38
72
  ```
39
73
 
40
- ## Dialog Sizes
74
+ ## Sizes
41
75
 
42
76
  ```tsx
43
- // Small (400px) - Simple confirmations
44
- <Dialog size="sm">...</Dialog>
45
-
46
- // Medium (560px) - Default for most use cases
47
- <Dialog size="md">...</Dialog>
77
+ <Dialog open={open} onClose={onClose} size="xs"> // 400px
78
+ <Dialog open={open} onClose={onClose} size="sm"> // 480px
79
+ <Dialog open={open} onClose={onClose} size="md"> // 560px (default)
80
+ <Dialog open={open} onClose={onClose} size="lg"> // 640px
81
+ <Dialog open={open} onClose={onClose} size="xl"> // 800px
82
+ ```
48
83
 
49
- // Large (720px) - Complex forms or content
50
- <Dialog size="lg">...</Dialog>
84
+ ## With Form
51
85
 
52
- // Full width (with padding)
53
- <Dialog fullWidth>...</Dialog>
86
+ ```tsx
87
+ <Dialog open={open} onClose={onClose} size="lg">
88
+ <DialogHeader title="Create New Item" onClose={onClose} />
89
+
90
+ <Box sx={{ p: 6 }}>
91
+ <Stack spacing={4}>
92
+ <InputField label="Name" placeholder="Enter name" />
93
+ <InputField label="Description" placeholder="Enter description" multiline rows={3} />
94
+ </Stack>
95
+ </Box>
96
+
97
+ <DialogFooter>
98
+ <Button variant="secondary-gray" onClick={onClose}>Cancel</Button>
99
+ <Button variant="primary" onClick={handleSubmit}>Create</Button>
100
+ </DialogFooter>
101
+ </Dialog>
54
102
  ```
55
103
 
56
- ## DialogHeader
104
+ ## Confirmation Dialog
57
105
 
58
106
  ```tsx
59
- // Basic header with title
60
- <DialogHeader title="Edit Profile" onClose={handleClose} />
61
-
62
- // With supporting text
63
- <DialogHeader
64
- title="Import Data"
65
- supportingText="Upload a CSV file to import your data"
66
- onClose={handleClose}
67
- />
68
-
69
- // With icon
70
- <DialogHeader
71
- title="Warning"
72
- icon={<AlertIcon />}
73
- onClose={handleClose}
74
- />
107
+ <Dialog open={open} onClose={onClose} size="sm">
108
+ <DialogHeader
109
+ title="Delete Item?"
110
+ onClose={onClose}
111
+ />
112
+
113
+ <Box sx={{ p: 6 }}>
114
+ <Typography>
115
+ This action cannot be undone. The item will be permanently deleted.
116
+ </Typography>
117
+ </Box>
118
+
119
+ <DialogFooter>
120
+ <Button variant="secondary-gray" onClick={onClose}>Cancel</Button>
121
+ <Button variant="primary" destructive onClick={handleDelete}>
122
+ Delete
123
+ </Button>
124
+ </DialogFooter>
125
+ </Dialog>
75
126
  ```
76
127
 
77
- ## DialogContent
128
+ ## With Icon in Header
78
129
 
79
130
  ```tsx
80
- // Standard content
81
- <DialogContent>
82
- Your content here...
83
- </DialogContent>
84
-
85
- // With custom padding
86
- <DialogContent padding="none">
87
- <Table />
88
- </DialogContent>
89
-
90
- // Scrollable content
91
- <DialogContent maxHeight={400}>
92
- Long content that scrolls...
93
- </DialogContent>
131
+ import { AlertTriangleIcon } from '@kenpan/zds-r8f3v1/icons'
132
+ import { FeaturedIcon } from '@kenpan/zds-r8f3v1'
133
+
134
+ <Dialog open={open} onClose={onClose} size="sm">
135
+ <DialogHeader
136
+ title="Warning"
137
+ subtitle="Please review before continuing"
138
+ onClose={onClose}
139
+ icon={
140
+ <FeaturedIcon color="warning" size="lg" theme="light">
141
+ <AlertTriangleIcon />
142
+ </FeaturedIcon>
143
+ }
144
+ />
145
+ {/* ... */}
146
+ </Dialog>
94
147
  ```
95
148
 
96
- ## DialogFooter
149
+ ## Usage Guidelines
150
+
151
+ ### Do:
152
+ - Use dialogs for focused tasks that require completion
153
+ - Keep dialog content focused and minimal
154
+ - Provide clear action buttons (Cancel/Confirm pattern)
155
+ - Use appropriate size for content
156
+ - Close dialog after action completion
157
+
158
+ ### Don't:
159
+ - Don't nest dialogs inside other dialogs
160
+ - Don't use dialogs for simple notifications (use Toast instead)
161
+ - Don't put long forms in dialogs (use a page instead)
162
+ - Don't forget to handle the close action
163
+ - Don't use dialogs for navigation
97
164
 
165
+ ## Common Patterns
166
+
167
+ ### Alert/Warning Dialog
98
168
  ```tsx
99
- // Standard footer with cancel/confirm
100
- <DialogFooter>
101
- <Button variant="secondary-gray" onClick={onClose}>Cancel</Button>
102
- <Button variant="primary" onClick={onConfirm}>Confirm</Button>
103
- </DialogFooter>
104
-
105
- // Left-aligned action
106
- <DialogFooter leftAction={<Button variant="link-gray">Learn more</Button>}>
107
- <Button variant="secondary-gray" onClick={onClose}>Cancel</Button>
108
- <Button variant="primary" onClick={onConfirm}>Save</Button>
109
- </DialogFooter>
169
+ <Dialog open={open} onClose={onClose} size="sm">
170
+ <DialogHeader title="Are you sure?" onClose={onClose} />
171
+ <Box sx={{ p: 6 }}>
172
+ <Alert color="warning">This action cannot be undone.</Alert>
173
+ </Box>
174
+ <DialogFooter>
175
+ <Button variant="secondary-gray" onClick={onClose}>Cancel</Button>
176
+ <Button variant="primary" destructive onClick={handleConfirm}>Proceed</Button>
177
+ </DialogFooter>
178
+ </Dialog>
110
179
  ```
111
180
 
112
- ## Best Practices
113
-
114
- 1. **Clear titles** - Use action-oriented titles like "Delete Item?" not "Warning"
115
- 2. **Concise content** - Keep dialog content brief and focused
116
- 3. **Clear actions** - Primary action on the right, cancel on the left
117
- 4. **Escape to close** - Always allow closing with Escape key
118
- 5. **Focus management** - Focus should trap inside the dialog
119
- 6. **Avoid nested dialogs** - Don't open dialogs from within dialogs
181
+ ### Info Dialog
182
+ ```tsx
183
+ <Dialog open={open} onClose={onClose} size="md">
184
+ <DialogHeader
185
+ title="About This Feature"
186
+ subtitle="Learn how it works"
187
+ onClose={onClose}
188
+ />
189
+ <Box sx={{ p: 6 }}>
190
+ <Typography>Detailed information here...</Typography>
191
+ </Box>
192
+ <DialogFooter>
193
+ <Button variant="primary" onClick={onClose}>Got it</Button>
194
+ </DialogFooter>
195
+ </Dialog>
196
+ ```
@@ -1,151 +1,313 @@
1
1
  # Form Components
2
2
 
3
- ZDS provides a comprehensive set of form components for building accessible, user-friendly forms.
3
+ **Purpose**: Collect user input through various form controls.
4
+
5
+ **Import**:
6
+ ```tsx
7
+ import {
8
+ InputField,
9
+ InputNumber,
10
+ InputSearch,
11
+ Checkbox,
12
+ Radio,
13
+ Switch,
14
+ Slider
15
+ } from '@kenpan/zds-r8f3v1'
16
+ ```
4
17
 
5
18
  ## InputField
6
19
 
7
- Text input with label, helper text, and validation states.
20
+ Text input with label, hint, and validation support.
8
21
 
9
- ```tsx
10
- import { InputField } from '@kenpan/zds-r8f3v1'
22
+ ### Props
23
+
24
+ | Prop | Type | Default | Description |
25
+ |------|------|---------|-------------|
26
+ | `label` | `string` | - | Field label |
27
+ | `placeholder` | `string` | - | Placeholder text |
28
+ | `hint` | `string` | - | Helper text below input |
29
+ | `error` | `boolean` | `false` | Show error state |
30
+ | `errorMessage` | `string` | - | Error message text |
31
+ | `disabled` | `boolean` | `false` | Disable input |
32
+ | `required` | `boolean` | `false` | Mark as required |
33
+ | `value` | `string` | - | Controlled value |
34
+ | `onChange` | `(e) => void` | - | Change handler |
35
+ | `multiline` | `boolean` | `false` | Textarea mode |
36
+ | `rows` | `number` | - | Textarea rows |
11
37
 
12
- // Basic usage
38
+ ### Examples
39
+
40
+ ```tsx
41
+ // Basic input
13
42
  <InputField
14
43
  label="Email"
15
- placeholder="Enter your email"
16
- supportingText="We'll never share your email"
44
+ placeholder="Enter your email"
45
+ />
46
+
47
+ // With hint
48
+ <InputField
49
+ label="Password"
50
+ type="password"
51
+ hint="Must be at least 8 characters"
17
52
  />
18
53
 
19
- // With error state
54
+ // With error
20
55
  <InputField
21
56
  label="Email"
22
- error
23
- supportingText="Please enter a valid email"
57
+ error
58
+ errorMessage="Please enter a valid email"
24
59
  />
25
60
 
26
- // With leading/trailing icons
61
+ // Textarea
27
62
  <InputField
28
- label="Search"
29
- leadingIcon={<SearchIcon />}
63
+ label="Description"
64
+ multiline
65
+ rows={4}
66
+ placeholder="Enter description..."
30
67
  />
31
68
 
32
- // Password input
69
+ // Controlled
70
+ const [value, setValue] = useState('')
33
71
  <InputField
34
- label="Password"
35
- type="password"
72
+ label="Name"
73
+ value={value}
74
+ onChange={(e) => setValue(e.target.value)}
36
75
  />
37
76
  ```
38
77
 
39
- ## Checkbox
78
+ ## InputNumber
79
+
80
+ Numeric input with increment/decrement buttons.
81
+
82
+ ### Props
83
+
84
+ | Prop | Type | Default | Description |
85
+ |------|------|---------|-------------|
86
+ | `label` | `string` | - | Field label |
87
+ | `value` | `number` | - | Controlled value |
88
+ | `onChange` | `(value: number) => void` | - | Value change handler |
89
+ | `min` | `number` | - | Minimum value |
90
+ | `max` | `number` | - | Maximum value |
91
+ | `step` | `number` | `1` | Increment step |
92
+ | `disabled` | `boolean` | `false` | Disable input |
93
+
94
+ ### Example
40
95
 
41
96
  ```tsx
42
- import { Checkbox } from '@kenpan/zds-r8f3v1'
97
+ const [quantity, setQuantity] = useState(1)
98
+
99
+ <InputNumber
100
+ label="Quantity"
101
+ value={quantity}
102
+ onChange={setQuantity}
103
+ min={1}
104
+ max={100}
105
+ />
106
+ ```
107
+
108
+ ## InputSearch
109
+
110
+ Search input with clear button.
111
+
112
+ ### Props
113
+
114
+ | Prop | Type | Default | Description |
115
+ |------|------|---------|-------------|
116
+ | `placeholder` | `string` | `'Search...'` | Placeholder text |
117
+ | `value` | `string` | - | Controlled value |
118
+ | `onChange` | `(value: string) => void` | - | Value change handler |
119
+ | `onSearch` | `(value: string) => void` | - | Search submit handler |
120
+ | `onClear` | `() => void` | - | Clear handler |
121
+
122
+ ### Example
123
+
124
+ ```tsx
125
+ const [search, setSearch] = useState('')
126
+
127
+ <InputSearch
128
+ placeholder="Search items..."
129
+ value={search}
130
+ onChange={setSearch}
131
+ onSearch={(val) => console.log('Search:', val)}
132
+ />
133
+ ```
134
+
135
+ ## Checkbox
136
+
137
+ Checkbox with label and optional description.
138
+
139
+ ### Props
43
140
 
44
- // Basic checkbox
45
- <Checkbox label="Accept terms" />
141
+ | Prop | Type | Default | Description |
142
+ |------|------|---------|-------------|
143
+ | `label` | `string` | - | Checkbox label |
144
+ | `description` | `string` | - | Additional description |
145
+ | `checked` | `boolean` | - | Controlled checked state |
146
+ | `onChange` | `(e) => void` | - | Change handler |
147
+ | `disabled` | `boolean` | `false` | Disable checkbox |
148
+ | `indeterminate` | `boolean` | `false` | Indeterminate state |
149
+
150
+ ### Examples
151
+
152
+ ```tsx
153
+ // Basic
154
+ <Checkbox label="Accept terms and conditions" />
46
155
 
47
156
  // With description
48
157
  <Checkbox
49
- label="Subscribe to newsletter"
50
- description="Receive weekly updates about new features"
158
+ label="Email notifications"
159
+ description="Receive updates about your account"
51
160
  />
52
161
 
53
162
  // Controlled
163
+ const [checked, setChecked] = useState(false)
54
164
  <Checkbox
55
- checked={isChecked}
56
- onChange={(e) => setIsChecked(e.target.checked)}
57
165
  label="Remember me"
166
+ checked={checked}
167
+ onChange={(e) => setChecked(e.target.checked)}
58
168
  />
59
-
60
- // Indeterminate (for "select all" patterns)
61
- <Checkbox indeterminate label="Select all items" />
62
169
  ```
63
170
 
64
171
  ## Radio
65
172
 
173
+ Radio button groups for mutually exclusive options.
174
+
175
+ ### Props
176
+
177
+ | Prop | Type | Default | Description |
178
+ |------|------|---------|-------------|
179
+ | `label` | `string` | - | Radio label |
180
+ | `value` | `string` | - | Radio value |
181
+ | `checked` | `boolean` | - | Checked state |
182
+ | `onChange` | `(e) => void` | - | Change handler |
183
+ | `disabled` | `boolean` | `false` | Disable radio |
184
+
185
+ ### Example
186
+
66
187
  ```tsx
67
- import { Radio, RadioGroup } from '@kenpan/zds-r8f3v1'
188
+ const [selected, setSelected] = useState('option1')
68
189
 
69
- <RadioGroup value={value} onChange={handleChange}>
70
- <Radio value="option1" label="Option 1" />
71
- <Radio value="option2" label="Option 2" />
72
- <Radio value="option3" label="Option 3" description="With description" />
190
+ <RadioGroup value={selected} onChange={(e) => setSelected(e.target.value)}>
191
+ <Radio label="Option 1" value="option1" />
192
+ <Radio label="Option 2" value="option2" />
193
+ <Radio label="Option 3" value="option3" />
73
194
  </RadioGroup>
74
195
  ```
75
196
 
76
197
  ## Switch
77
198
 
78
- ```tsx
79
- import { Switch } from '@kenpan/zds-r8f3v1'
199
+ Toggle switch for on/off states.
80
200
 
81
- // Basic toggle
82
- <Switch label="Enable notifications" />
201
+ ### Props
202
+
203
+ | Prop | Type | Default | Description |
204
+ |------|------|---------|-------------|
205
+ | `label` | `string` | - | Switch label |
206
+ | `checked` | `boolean` | - | Controlled checked state |
207
+ | `onChange` | `(e) => void` | - | Change handler |
208
+ | `disabled` | `boolean` | `false` | Disable switch |
209
+ | `size` | `'sm' \| 'md'` | `'md'` | Switch size |
83
210
 
84
- // With switch text (on/off labels)
85
- <Switch label="Dark mode" switchText />
211
+ ### Examples
212
+
213
+ ```tsx
214
+ // Basic
215
+ <Switch label="Enable notifications" />
86
216
 
87
217
  // Controlled
218
+ const [enabled, setEnabled] = useState(false)
88
219
  <Switch
89
- checked={enabled}
220
+ label="Dark mode"
221
+ checked={enabled}
90
222
  onChange={(e) => setEnabled(e.target.checked)}
91
- label="Active"
92
223
  />
93
224
  ```
94
225
 
95
226
  ## Slider
96
227
 
228
+ Range slider for numeric values.
229
+
230
+ ### Props
231
+
232
+ | Prop | Type | Default | Description |
233
+ |------|------|---------|-------------|
234
+ | `label` | `string` | - | Slider label |
235
+ | `value` | `number` | - | Controlled value |
236
+ | `onChange` | `(value: number) => void` | - | Value change handler |
237
+ | `min` | `number` | `0` | Minimum value |
238
+ | `max` | `number` | `100` | Maximum value |
239
+ | `step` | `number` | `1` | Step increment |
240
+ | `disabled` | `boolean` | `false` | Disable slider |
241
+ | `showValue` | `boolean` | `true` | Show current value |
242
+
243
+ ### Example
244
+
97
245
  ```tsx
98
- import { Slider } from '@kenpan/zds-r8f3v1'
246
+ const [volume, setVolume] = useState(50)
99
247
 
100
- // Single value
101
248
  <Slider
102
- value={50}
103
- onChange={(e, value) => setValue(value)}
249
+ label="Volume"
250
+ value={volume}
251
+ onChange={setVolume}
104
252
  min={0}
105
253
  max={100}
106
254
  />
255
+ ```
107
256
 
108
- // Range (dual handles)
109
- <Slider
110
- value={[20, 80]}
111
- onChange={(e, value) => setRange(value)}
112
- mode="dual"
113
- />
257
+ ## Form Layout Patterns
114
258
 
115
- // With labels
116
- <Slider
117
- value={50}
118
- showLabels
119
- labels={['Low', 'Medium', 'High']}
120
- />
259
+ ### Vertical Form
260
+
261
+ ```tsx
262
+ <Stack spacing={4}>
263
+ <InputField label="First Name" placeholder="Enter first name" />
264
+ <InputField label="Last Name" placeholder="Enter last name" />
265
+ <InputField label="Email" type="email" placeholder="Enter email" />
266
+ <Button variant="primary" fullWidth>Submit</Button>
267
+ </Stack>
121
268
  ```
122
269
 
123
- ## DatePicker
270
+ ### Inline Form Fields
124
271
 
125
272
  ```tsx
126
- import { DatePicker } from '@kenpan/zds-r8f3v1'
273
+ <Stack direction="row" spacing={4}>
274
+ <InputField label="First Name" sx={{ flex: 1 }} />
275
+ <InputField label="Last Name" sx={{ flex: 1 }} />
276
+ </Stack>
277
+ ```
127
278
 
128
- // Single date
129
- <DatePicker
130
- label="Select date"
131
- value={date}
132
- onChange={setDate}
133
- />
279
+ ### Form with Validation
280
+
281
+ ```tsx
282
+ const [email, setEmail] = useState('')
283
+ const [error, setError] = useState(false)
284
+
285
+ const validateEmail = (value) => {
286
+ const isValid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)
287
+ setError(!isValid)
288
+ }
134
289
 
135
- // Date range
136
- <DatePicker
137
- label="Select range"
138
- mode="range"
139
- value={[startDate, endDate]}
140
- onChange={setDateRange}
290
+ <InputField
291
+ label="Email"
292
+ value={email}
293
+ onChange={(e) => setEmail(e.target.value)}
294
+ onBlur={() => validateEmail(email)}
295
+ error={error}
296
+ errorMessage="Please enter a valid email address"
141
297
  />
142
298
  ```
143
299
 
144
- ## Form Layout Best Practices
300
+ ## Usage Guidelines
301
+
302
+ ### Do:
303
+ - Always provide labels for form fields
304
+ - Use appropriate input types (email, password, number)
305
+ - Provide helpful hints for complex fields
306
+ - Show clear error messages
307
+ - Use controlled components for form state
145
308
 
146
- 1. **Labels above inputs** - Place labels above form fields for better scanning
147
- 2. **Helper text** - Use supportingText for additional context
148
- 3. **Error messages** - Show inline validation errors near the field
149
- 4. **Required indicators** - Mark required fields clearly
150
- 5. **Logical grouping** - Group related fields together
151
- 6. **Progressive disclosure** - Show advanced options only when needed
309
+ ### Don't:
310
+ - Don't use placeholders as labels
311
+ - Don't hide required field indicators
312
+ - Don't use generic error messages
313
+ - Don't nest form controls