laif-ds 0.2.74 → 0.2.76

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 (155) hide show
  1. package/dist/CHANGELOG.md +446 -0
  2. package/dist/agent-docs/adoption-report.json +615 -0
  3. package/dist/agent-docs/components/Accordion.md +46 -16
  4. package/dist/agent-docs/components/Alert.md +90 -95
  5. package/dist/agent-docs/components/AlertDialog.md +132 -126
  6. package/dist/agent-docs/components/AppEditor.md +90 -90
  7. package/dist/agent-docs/components/AppRadioGroup.md +18 -18
  8. package/dist/agent-docs/components/AppSidebar.md +129 -122
  9. package/dist/agent-docs/components/AppStepper.md +81 -77
  10. package/dist/agent-docs/components/AspectRatio.md +70 -62
  11. package/dist/agent-docs/components/AudioVisualizer.md +5 -5
  12. package/dist/agent-docs/components/Avatar.md +112 -113
  13. package/dist/agent-docs/components/Badge.md +123 -118
  14. package/dist/agent-docs/components/Breadcrumb.md +8 -1
  15. package/dist/agent-docs/components/Button.md +131 -129
  16. package/dist/agent-docs/components/Card.md +172 -147
  17. package/dist/agent-docs/components/Carousel.md +148 -129
  18. package/dist/agent-docs/components/Chat.md +121 -109
  19. package/dist/agent-docs/components/ChatMessage.md +72 -61
  20. package/dist/agent-docs/components/Checkbox.md +150 -135
  21. package/dist/agent-docs/components/CircularProgress.md +53 -49
  22. package/dist/agent-docs/components/CodeHighlighter.md +4 -4
  23. package/dist/agent-docs/components/Collapsible.md +114 -95
  24. package/dist/agent-docs/components/Command.md +141 -142
  25. package/dist/agent-docs/components/Confirmer.md +182 -175
  26. package/dist/agent-docs/components/ContextMenu.md +196 -191
  27. package/dist/agent-docs/components/DataCrossTable.md +114 -94
  28. package/dist/agent-docs/components/DataTable.md +32 -24
  29. package/dist/agent-docs/components/Dialog.md +130 -125
  30. package/dist/agent-docs/components/Drawer.md +141 -127
  31. package/dist/agent-docs/components/FilePreviewer.md +138 -139
  32. package/dist/agent-docs/components/FileUploader.md +149 -129
  33. package/dist/agent-docs/components/Form.md +3 -1
  34. package/dist/agent-docs/components/FormComposer.md +163 -137
  35. package/dist/agent-docs/components/GanttChart.md +125 -122
  36. package/dist/agent-docs/components/HoverCard.md +1 -1
  37. package/dist/agent-docs/components/Icon.md +98 -99
  38. package/dist/agent-docs/components/Input.md +173 -138
  39. package/dist/agent-docs/components/InputOtp.md +6 -1
  40. package/dist/agent-docs/components/InputSelector.md +94 -97
  41. package/dist/agent-docs/components/InterruptPrompt.md +4 -4
  42. package/dist/agent-docs/components/MarkdownRenderer.md +5 -2
  43. package/dist/agent-docs/components/Menubar.md +60 -57
  44. package/dist/agent-docs/components/MessageInput.md +134 -131
  45. package/dist/agent-docs/components/MessageList.md +110 -96
  46. package/dist/agent-docs/components/MultipleSelector.md +147 -146
  47. package/dist/agent-docs/components/NavigationMenu.md +6 -2
  48. package/dist/agent-docs/components/Popover.md +112 -103
  49. package/dist/agent-docs/components/PromptSuggestions.md +5 -5
  50. package/dist/agent-docs/components/RadioGroup.md +97 -90
  51. package/dist/agent-docs/components/Resizable.md +4 -1
  52. package/dist/agent-docs/components/ResizePrompt.md +12 -13
  53. package/dist/agent-docs/components/ScrollArea.md +6 -2
  54. package/dist/agent-docs/components/SecurePdfViewer.md +10 -6
  55. package/dist/agent-docs/components/Select.md +131 -132
  56. package/dist/agent-docs/components/Sheet.md +8 -1
  57. package/dist/agent-docs/components/ShikiHighlighter.md +5 -5
  58. package/dist/agent-docs/components/Sidebar.md +94 -85
  59. package/dist/agent-docs/components/Slider.md +62 -58
  60. package/dist/agent-docs/components/Sonner.md +1 -0
  61. package/dist/agent-docs/components/Spinner.md +14 -14
  62. package/dist/agent-docs/components/Stepper.md +93 -67
  63. package/dist/agent-docs/components/Switch.md +41 -42
  64. package/dist/agent-docs/components/TableSkeleton.md +8 -8
  65. package/dist/agent-docs/components/Tabs.md +106 -86
  66. package/dist/agent-docs/components/TextArea.md +51 -52
  67. package/dist/agent-docs/components/ThemeSwitcher.md +72 -69
  68. package/dist/agent-docs/components/Toaster.md +1 -0
  69. package/dist/agent-docs/components/Tooltip.md +102 -91
  70. package/dist/agent-docs/components/Typo.md +68 -65
  71. package/dist/agent-docs/components/WeeklyCalendar.md +63 -64
  72. package/dist/agent-docs/components-list.md +1 -0
  73. package/dist/agent-docs/manifest.json +5981 -0
  74. package/dist/agent-docs/truncated-cell.md +342 -0
  75. package/dist/components/editor/editor-hooks/use-update-toolbar.js +6 -6
  76. package/dist/components/editor/plugins/actions/counter-character-plugin.js +6 -6
  77. package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +18 -18
  78. package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +10 -10
  79. package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +9 -9
  80. package/dist/components/ui/app-checkbox.js +1 -1
  81. package/dist/components/ui/app-dialog.js +70 -64
  82. package/dist/components/ui/app-editor.js +51 -51
  83. package/dist/components/ui/app-form.js +81 -81
  84. package/dist/components/ui/app-multiple-select-dropdown.js +36 -36
  85. package/dist/components/ui/app-select.js +109 -104
  86. package/dist/components/ui/app-sidebar.js +41 -41
  87. package/dist/components/ui/app-stepper.js +1 -1
  88. package/dist/components/ui/app-time-picker.js +18 -18
  89. package/dist/components/ui/app-tooltip.js +1 -1
  90. package/dist/components/ui/async-select.js +5 -5
  91. package/dist/components/ui/audio-visualizer.js +61 -58
  92. package/dist/components/ui/card.js +1 -1
  93. package/dist/components/ui/carousel.js +2 -2
  94. package/dist/components/ui/chart.js +1 -1
  95. package/dist/components/ui/chat-message.js +8 -8
  96. package/dist/components/ui/chat.js +86 -88
  97. package/dist/components/ui/command.js +2 -2
  98. package/dist/components/ui/copy-button.js +4 -4
  99. package/dist/components/ui/date-picker.js +20 -20
  100. package/dist/components/ui/file-preview/index.js +13 -13
  101. package/dist/components/ui/file-previewer.js +12 -11
  102. package/dist/components/ui/file-uploader.js +86 -78
  103. package/dist/components/ui/form.js +2 -2
  104. package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +56 -56
  105. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +12 -12
  106. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +1 -1
  107. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +4 -4
  108. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +2 -2
  109. package/dist/components/ui/gantt/components/Chart/Chart.js +23 -23
  110. package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +1 -1
  111. package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +34 -34
  112. package/dist/components/ui/gantt/components/Controls/Controls.js +5 -5
  113. package/dist/components/ui/gantt/components/Gantt/Gantt.js +4 -4
  114. package/dist/components/ui/gantt/hooks/useGanttCalculate.js +25 -18
  115. package/dist/components/ui/input-selector.js +1 -1
  116. package/dist/components/ui/input.js +23 -23
  117. package/dist/components/ui/kanban.js +8 -9
  118. package/dist/components/ui/markdown-renderer.js +41 -35
  119. package/dist/components/ui/message-input.js +45 -44
  120. package/dist/components/ui/multiple-selector.js +91 -82
  121. package/dist/components/ui/secure-pdf-viewer.js +19 -7
  122. package/dist/components/ui/sidebar.js +1 -1
  123. package/dist/components/ui/slider.js +1 -1
  124. package/dist/components/ui/spinner.js +4 -4
  125. package/dist/components/ui/stepper.js +157 -138
  126. package/dist/components/ui/tables/data-cross-table/data-cross-table-buttons.js +29 -29
  127. package/dist/components/ui/tables/data-cross-table/data-cross-table.js +258 -246
  128. package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +4 -1
  129. package/dist/components/ui/tables/data-table/components/data-table-body.js +211 -367
  130. package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +114 -112
  131. package/dist/components/ui/tables/data-table/components/data-table-filters.js +116 -96
  132. package/dist/components/ui/tables/data-table/components/data-table-header.js +211 -0
  133. package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +8 -8
  134. package/dist/components/ui/tables/data-table/components/data-table-skeleton-rows.js +33 -0
  135. package/dist/components/ui/tables/data-table/data-table.js +258 -250
  136. package/dist/components/ui/tables/data-table/data-table.service.js +112 -97
  137. package/dist/components/ui/tables/data-table/data-table.utils.js +25 -15
  138. package/dist/components/ui/textarea.js +2 -2
  139. package/dist/components/ui/theme-switcher.js +1 -1
  140. package/dist/components/ui/toggle-group.js +2 -2
  141. package/dist/components/ui/truncated-cell.js +100 -0
  142. package/dist/components/ui/weekly-calendar/appointment-card.js +16 -16
  143. package/dist/components/ui/weekly-calendar/calendar-context.js +6 -6
  144. package/dist/components/ui/weekly-calendar/calendar-header.js +12 -12
  145. package/dist/components/ui/weekly-calendar/day-column.js +16 -16
  146. package/dist/components/ui/weekly-calendar/time-column.js +4 -4
  147. package/dist/components/ui/weekly-calendar/weekly-calendar.js +4 -4
  148. package/dist/hooks/use-audio-recording.js +1 -1
  149. package/dist/hooks/use-auto-scroll.js +18 -18
  150. package/dist/hooks/use-autosize-textarea.js +12 -13
  151. package/dist/index.d.ts +100 -45
  152. package/dist/index.js +362 -360
  153. package/dist/lib/utils.js +6 -6
  154. package/dist/styles.v3.css +1 -1
  155. package/package.json +14 -4
@@ -1,99 +1,98 @@
1
- # Icon
2
-
3
- ## Overview
4
-
5
- Wrapper around `lucide-react` icons with design-system sizes and convenient color/className support.
6
-
7
- ---
8
-
9
- ## Props
10
-
11
- | Prop | Type | Default | Description |
12
- | ----------- | ------------------------------------------- | --------- | ----------------------------------------------- |
13
- | `name` | `IconName` (key of `lucide-react` exports) | **required** | Icon name from `lucide-react`. |
14
- | `size` | `"xs" | "sm" | "md" | "lg" | "xl"` | `"md"` | Predefined pixel sizes: 16, 20, 24, 32, 40. |
15
- | `className` | `string` | `""` | Additional classes (e.g., color via theme tokens). |
16
- | `color` | `string` | `undefined` | Overrides color style directly. |
17
-
18
- Any extra props are passed to the underlying `lucide-react` icon component.
19
-
20
- ---
21
-
22
- ## Behavior
23
-
24
- - **Sizing**: The `size` prop maps to pixel sizes (`xs=16`, `sm=20`, `md=24`, `lg=32`, `xl=40`).
25
- - **Coloring**: Prefer theme tokens via `className` (e.g., `text-d-destructive`). For one-off colors, use `color`.
26
- - **Safety**: If `name` is not found, the component renders `null` and logs a warning.
27
-
28
- ---
29
-
30
- ## Examples
31
-
32
- ### Default
33
-
34
- ```tsx
35
- import { Icon } from "laif-ds";
36
-
37
- export function DefaultIcon() {
38
- return <Icon name="Check" size="md" />;
39
- }
40
- ```
41
-
42
- ### Sizes
43
-
44
- ```tsx
45
- import { Icon } from "laif-ds";
46
-
47
- export function IconSizes() {
48
- return (
49
- <div className="flex items-end gap-4">
50
- <div className="flex flex-col items-center gap-2">
51
- <Icon name="Check" size="xs" />
52
- <span className="text-xs">xs</span>
53
- </div>
54
- <div className="flex flex-col items-center gap-2">
55
- <Icon name="Check" size="sm" />
56
- <span className="text-xs">sm</span>
57
- </div>
58
- <div className="flex flex-col items-center gap-2">
59
- <Icon name="Check" size="md" />
60
- <span className="text-xs">md</span>
61
- </div>
62
- <div className="flex flex-col items-center gap-2">
63
- <Icon name="Check" size="lg" />
64
- <span className="text-xs">lg</span>
65
- </div>
66
- <div className="flex flex-col items-center gap-2">
67
- <Icon name="Check" size="xl" />
68
- <span className="text-xs">xl</span>
69
- </div>
70
- </div>
71
- );
72
- }
73
- ```
74
-
75
- ### Colors
76
-
77
- ```tsx
78
- import { Icon } from "laif-ds";
79
-
80
- export function IconColors() {
81
- return (
82
- <div className="flex gap-4">
83
- <Icon name="Heart" size="lg" className="text-d-destructive" />
84
- <Icon name="Heart" size="lg" className="text-d-primary" />
85
- <Icon name="Heart" size="lg" className="text-d-muted-foreground" />
86
- <Icon name="Heart" size="lg" color="#8B5CF6" />
87
- <Icon name="Heart" size="lg" color="#EC4899" />
88
- </div>
89
- );
90
- }
91
- ```
92
-
93
- ---
94
-
95
- ## Notes
96
-
97
- - **Design tokens**: Use theme token classes (`text-d-*`) rather than raw Tailwind colors.
98
- - **Icon library**: Use only `laif-ds` `Icon` (no external icon libraries).
99
-
1
+ # Icon
2
+
3
+ ## Overview
4
+
5
+ Wrapper around `lucide-react` icons with design-system sizes and convenient color/className support.
6
+
7
+ ---
8
+
9
+ ## Props
10
+
11
+ | Prop | Type | Default | Description |
12
+ | ----------- | ------------------------------------------ | ------------ | -------------------------------------------------- | ---- | ----- | ------ | ------------------------------------------- |
13
+ | `name` | `IconName` (key of `lucide-react` exports) | **required** | Icon name from `lucide-react`. |
14
+ | `size` | `"xs" | "sm" | "md" | "lg" | "xl"` | `"md"` | Predefined pixel sizes: 16, 20, 24, 32, 40. |
15
+ | `className` | `string` | `""` | Additional classes (e.g., color via theme tokens). |
16
+ | `color` | `string` | `undefined` | Overrides color style directly. |
17
+
18
+ Any extra props are passed to the underlying `lucide-react` icon component.
19
+
20
+ ---
21
+
22
+ ## Behavior
23
+
24
+ - **Sizing**: The `size` prop maps to pixel sizes (`xs=16`, `sm=20`, `md=24`, `lg=32`, `xl=40`).
25
+ - **Coloring**: Prefer theme tokens via `className` (e.g., `text-d-destructive`). For one-off colors, use `color`.
26
+ - **Safety**: If `name` is not found, the component renders `null` and logs a warning.
27
+
28
+ ---
29
+
30
+ ## Examples
31
+
32
+ ### Default
33
+
34
+ ```tsx
35
+ import { Icon } from "laif-ds";
36
+
37
+ export function DefaultIcon() {
38
+ return <Icon name="Check" size="md" />;
39
+ }
40
+ ```
41
+
42
+ ### Sizes
43
+
44
+ ```tsx
45
+ import { Icon } from "laif-ds";
46
+
47
+ export function IconSizes() {
48
+ return (
49
+ <div className="flex items-end gap-4">
50
+ <div className="flex flex-col items-center gap-2">
51
+ <Icon name="Check" size="xs" />
52
+ <span className="text-xs">xs</span>
53
+ </div>
54
+ <div className="flex flex-col items-center gap-2">
55
+ <Icon name="Check" size="sm" />
56
+ <span className="text-xs">sm</span>
57
+ </div>
58
+ <div className="flex flex-col items-center gap-2">
59
+ <Icon name="Check" size="md" />
60
+ <span className="text-xs">md</span>
61
+ </div>
62
+ <div className="flex flex-col items-center gap-2">
63
+ <Icon name="Check" size="lg" />
64
+ <span className="text-xs">lg</span>
65
+ </div>
66
+ <div className="flex flex-col items-center gap-2">
67
+ <Icon name="Check" size="xl" />
68
+ <span className="text-xs">xl</span>
69
+ </div>
70
+ </div>
71
+ );
72
+ }
73
+ ```
74
+
75
+ ### Colors
76
+
77
+ ```tsx
78
+ import { Icon } from "laif-ds";
79
+
80
+ export function IconColors() {
81
+ return (
82
+ <div className="flex gap-4">
83
+ <Icon name="Heart" size="lg" className="text-d-destructive" />
84
+ <Icon name="Heart" size="lg" className="text-d-primary" />
85
+ <Icon name="Heart" size="lg" className="text-d-muted-foreground" />
86
+ <Icon name="Heart" size="lg" color="#8B5CF6" />
87
+ <Icon name="Heart" size="lg" color="#EC4899" />
88
+ </div>
89
+ );
90
+ }
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Notes
96
+
97
+ - **Design tokens**: Use theme token classes (`text-d-*`) rather than raw Tailwind colors.
98
+ - **Icon library**: Use only `laif-ds` `Icon` (no external icon libraries).
@@ -1,138 +1,173 @@
1
- # Input
2
-
3
- ## Overview
4
-
5
- Text input component with label, sizes, optional left/right icons, custom start/end content, built-in password toggle, validation styles and accessible error messaging.
6
-
7
- ---
8
-
9
- ## Props
10
-
11
- Extends native `<input>` props (except `size` and `label` which are redefined).
12
-
13
- | Prop | Type | Default | Description |
14
- | --------------- | -------------------------------------- | ----------- | -------------------------------------------------------------------- |
15
- | `label` | `string | React.ReactNode` | `undefined` | Field label shown above the input. |
16
- | `labelClassName`| `string` | `""` | Extra classes for the label. |
17
- | `size` | `"sm" | "default" | "lg"` | `"default"` | Controls height and font-size. |
18
- | `iconLeft` | `IconName` | `undefined` | Optional left icon (uses `Icon`). |
19
- | `iconRight` | `IconName` | `undefined` | Optional right icon (ignored when `type="password"`). |
20
- | `startContent` | `React.ReactNode` | `undefined` | Custom content before the input (coexists with `iconLeft`). |
21
- | `endContent` | `React.ReactNode` | `undefined` | Custom content after the input (coexists with `iconRight`). |
22
- | `errorMessage` | `string` | `undefined` | Custom error message (shown after interaction/invalid state). |
23
-
24
- All other standard input attributes (e.g., `type`, `placeholder`, `required`, `min`, `max`, `pattern`, etc.) are supported.
25
-
26
- ---
27
-
28
- ## Behavior
29
-
30
- - **Wrapper focus**: Clicking the wrapper focuses the input; selects text for non-password types (except file).
31
- - **Password toggle**: When `type="password"`, a toggle button switches visibility with accessible labels (`Mostra/Nascondi password`).
32
- - **Validation**: The wrapper reflects validity (`aria-invalid`) and shows `errorMessage` or the browser validation message once touched/invalid.
33
- - **Accessibility**: Errors use `role="alert"` and `aria-live="polite"`; labels link via `htmlFor`/`id`.
34
-
35
- ---
36
-
37
- ## Examples
38
-
39
- ### Basic
40
-
41
- ```tsx
42
- import { Input } from "laif-ds";
43
-
44
- export function BasicInput() {
45
- return (
46
- <Input
47
- label="Nome"
48
- placeholder="Inserisci testo..."
49
- className="w-full max-w-sm"
50
- />
51
- );
52
- }
53
- ```
54
-
55
- ### Sizes and Icons
56
-
57
- ```tsx
58
- import { Input } from "laif-ds";
59
-
60
- export function SizesAndIcons() {
61
- return (
62
- <div className="flex flex-col gap-3 w-full max-w-sm">
63
- <Input size="sm" label="Email" type="email" iconLeft="Mail" placeholder="esempio@dominio.com" />
64
- <Input size="default" label="Cerca" type="search" iconLeft="Search" placeholder="Cerca..." />
65
- <Input size="lg" label="Prezzo" type="number" iconRight="Euro" placeholder="0.00" />
66
- </div>
67
- );
68
- }
69
- ```
70
-
71
- ### Custom Start/End Content
72
-
73
- ```tsx
74
- import { Input } from "laif-ds";
75
-
76
- export function CustomContent() {
77
- return (
78
- <div className="flex flex-col gap-3 w-full max-w-sm">
79
- <Input
80
- label="Importo"
81
- type="number"
82
- placeholder="0.00"
83
- startContent={<span className="text-d-muted-foreground text-sm font-medium">€</span>}
84
- />
85
- <Input
86
- label="Percentuale"
87
- type="number"
88
- placeholder="0"
89
- endContent={<span className="text-d-muted-foreground text-sm font-medium">%</span>}
90
- />
91
- </div>
92
- );
93
- }
94
- ```
95
-
96
- ### Password with Toggle
97
-
98
- ```tsx
99
- import { Input } from "laif-ds";
100
-
101
- export function PasswordField() {
102
- return (
103
- <Input
104
- label="Password"
105
- type="password"
106
- placeholder="Inserisci la tua password"
107
- className="w-full max-w-sm"
108
- required
109
- />
110
- );
111
- }
112
- ```
113
-
114
- ### Validation States
115
-
116
- ```tsx
117
- import { Input } from "laif-ds";
118
-
119
- export function ValidationStates() {
120
- return (
121
- <div className="flex flex-col gap-3 w-full max-w-sm">
122
- <Input label="Campo obbligatorio" placeholder="Questo campo è obbligatorio" required />
123
- <Input label="Email" type="email" placeholder="email@esempio.com" required />
124
- <Input label="URL" type="url" placeholder="https://esempio.com" required />
125
- <Input label="Età (18-65)" type="number" min={18} max={65} required />
126
- </div>
127
- );
128
- }
129
- ```
130
-
131
- ---
132
-
133
- ## Notes
134
-
135
- - **Icons**: Prefer `iconLeft`/`iconRight` rather than embedding icons manually.
136
- - **Content**: `startContent`/`endContent` are ideal for units, prefixes/suffixes, or badges.
137
- - **A11y**: Include helpful placeholders and `aria-describedby` for extra guidance when needed.
138
-
1
+ # Input
2
+
3
+ ## Overview
4
+
5
+ Text input component with label, sizes, optional left/right icons, custom start/end content, built-in password toggle, validation styles and accessible error messaging.
6
+
7
+ ---
8
+
9
+ ## Props
10
+
11
+ Extends native `<input>` props (except `size` and `label` which are redefined).
12
+
13
+ | Prop | Type | Default | Description |
14
+ | ---------------- | ----------------- | ---------------- | ------------------------------------------------------------- | ---------------------------------- | ------------------------------ |
15
+ | `label` | `string | React.ReactNode` | `undefined` | Field label shown above the input. |
16
+ | `labelClassName` | `string` | `""` | Extra classes for the label. |
17
+ | `size` | `"sm" | "default" | "lg"` | `"default"` | Controls height and font-size. |
18
+ | `iconLeft` | `IconName` | `undefined` | Optional left icon (uses `Icon`). |
19
+ | `iconRight` | `IconName` | `undefined` | Optional right icon (ignored when `type="password"`). |
20
+ | `startContent` | `React.ReactNode` | `undefined` | Custom content before the input (coexists with `iconLeft`). |
21
+ | `endContent` | `React.ReactNode` | `undefined` | Custom content after the input (coexists with `iconRight`). |
22
+ | `errorMessage` | `string` | `undefined` | Custom error message (shown after interaction/invalid state). |
23
+
24
+ All other standard input attributes (e.g., `type`, `placeholder`, `required`, `min`, `max`, `pattern`, etc.) are supported.
25
+
26
+ ---
27
+
28
+ ## Behavior
29
+
30
+ - **Wrapper focus**: Clicking the wrapper focuses the input; selects text for non-password types (except file).
31
+ - **Password toggle**: When `type="password"`, a toggle button switches visibility with accessible labels (`Mostra/Nascondi password`).
32
+ - **Validation**: The wrapper reflects validity (`aria-invalid`) and shows `errorMessage` or the browser validation message once touched/invalid.
33
+ - **Accessibility**: Errors use `role="alert"` and `aria-live="polite"`; labels link via `htmlFor`/`id`.
34
+
35
+ ---
36
+
37
+ ## Examples
38
+
39
+ ### Basic
40
+
41
+ ```tsx
42
+ import { Input } from "laif-ds";
43
+
44
+ export function BasicInput() {
45
+ return (
46
+ <Input
47
+ label="Nome"
48
+ placeholder="Inserisci testo..."
49
+ className="w-full max-w-sm"
50
+ />
51
+ );
52
+ }
53
+ ```
54
+
55
+ ### Sizes and Icons
56
+
57
+ ```tsx
58
+ import { Input } from "laif-ds";
59
+
60
+ export function SizesAndIcons() {
61
+ return (
62
+ <div className="flex w-full max-w-sm flex-col gap-3">
63
+ <Input
64
+ size="sm"
65
+ label="Email"
66
+ type="email"
67
+ iconLeft="Mail"
68
+ placeholder="esempio@dominio.com"
69
+ />
70
+ <Input
71
+ size="default"
72
+ label="Cerca"
73
+ type="search"
74
+ iconLeft="Search"
75
+ placeholder="Cerca..."
76
+ />
77
+ <Input
78
+ size="lg"
79
+ label="Prezzo"
80
+ type="number"
81
+ iconRight="Euro"
82
+ placeholder="0.00"
83
+ />
84
+ </div>
85
+ );
86
+ }
87
+ ```
88
+
89
+ ### Custom Start/End Content
90
+
91
+ ```tsx
92
+ import { Input } from "laif-ds";
93
+
94
+ export function CustomContent() {
95
+ return (
96
+ <div className="flex w-full max-w-sm flex-col gap-3">
97
+ <Input
98
+ label="Importo"
99
+ type="number"
100
+ placeholder="0.00"
101
+ startContent={
102
+ <span className="text-d-muted-foreground text-sm font-medium">€</span>
103
+ }
104
+ />
105
+ <Input
106
+ label="Percentuale"
107
+ type="number"
108
+ placeholder="0"
109
+ endContent={
110
+ <span className="text-d-muted-foreground text-sm font-medium">%</span>
111
+ }
112
+ />
113
+ </div>
114
+ );
115
+ }
116
+ ```
117
+
118
+ ### Password with Toggle
119
+
120
+ ```tsx
121
+ import { Input } from "laif-ds";
122
+
123
+ export function PasswordField() {
124
+ return (
125
+ <Input
126
+ label="Password"
127
+ type="password"
128
+ placeholder="Inserisci la tua password"
129
+ className="w-full max-w-sm"
130
+ required
131
+ />
132
+ );
133
+ }
134
+ ```
135
+
136
+ ### Validation States
137
+
138
+ ```tsx
139
+ import { Input } from "laif-ds";
140
+
141
+ export function ValidationStates() {
142
+ return (
143
+ <div className="flex w-full max-w-sm flex-col gap-3">
144
+ <Input
145
+ label="Campo obbligatorio"
146
+ placeholder="Questo campo è obbligatorio"
147
+ required
148
+ />
149
+ <Input
150
+ label="Email"
151
+ type="email"
152
+ placeholder="email@esempio.com"
153
+ required
154
+ />
155
+ <Input
156
+ label="URL"
157
+ type="url"
158
+ placeholder="https://esempio.com"
159
+ required
160
+ />
161
+ <Input label="Età (18-65)" type="number" min={18} max={65} required />
162
+ </div>
163
+ );
164
+ }
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Notes
170
+
171
+ - **Icons**: Prefer `iconLeft`/`iconRight` rather than embedding icons manually.
172
+ - **Content**: `startContent`/`endContent` are ideal for units, prefixes/suffixes, or badges.
173
+ - **A11y**: Include helpful placeholders and `aria-describedby` for extra guidance when needed.
@@ -18,7 +18,12 @@ OTP (One-Time Password) input built on `input-otp`. Includes grouped slots and a
18
18
  ## Example
19
19
 
20
20
  ```tsx
21
- import { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator } from "laif-ds";
21
+ import {
22
+ InputOTP,
23
+ InputOTPGroup,
24
+ InputOTPSlot,
25
+ InputOTPSeparator,
26
+ } from "laif-ds";
22
27
 
23
28
  export function OtpExample() {
24
29
  return (