@delightui/components 0.1.104 → 0.1.106

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 (120) hide show
  1. package/README.md +104 -1
  2. package/dist/cjs/components/molecules/Modal/DemoModal.d.ts +8 -0
  3. package/dist/cjs/components/molecules/Modal/ModalContext/ModalContext.d.ts +41 -0
  4. package/dist/cjs/components/molecules/Modal/ModalContext/ModalContext.types.d.ts +87 -0
  5. package/dist/cjs/components/molecules/Modal/ModalContext/index.d.ts +3 -0
  6. package/dist/cjs/components/molecules/Modal/ModalContext/useModal.d.ts +34 -0
  7. package/dist/cjs/components/molecules/Modal/index.d.ts +2 -0
  8. package/dist/cjs/components/molecules/Popover/Popover.presenter.d.ts +26 -0
  9. package/dist/cjs/components/molecules/Select/Option/Option.types.d.ts +6 -0
  10. package/dist/cjs/components/molecules/Select/Select.Context.d.ts +1 -1
  11. package/dist/cjs/components/molecules/Select/Select.d.ts +5 -5
  12. package/dist/cjs/components/molecules/Select/Select.presenter.d.ts +1 -0
  13. package/dist/cjs/components/molecules/Select/Select.types.d.ts +5 -0
  14. package/dist/cjs/components/molecules/Select/index.d.ts +2 -9
  15. package/dist/cjs/components/molecules/index.d.ts +2 -0
  16. package/dist/cjs/components/utils/accessibilityUtils.d.ts +41 -0
  17. package/dist/cjs/components/utils/index.d.ts +2 -0
  18. package/dist/cjs/library.css +13 -0
  19. package/dist/cjs/library.js +2 -2
  20. package/dist/cjs/library.js.map +1 -1
  21. package/dist/esm/components/molecules/Modal/DemoModal.d.ts +8 -0
  22. package/dist/esm/components/molecules/Modal/ModalContext/ModalContext.d.ts +41 -0
  23. package/dist/esm/components/molecules/Modal/ModalContext/ModalContext.types.d.ts +87 -0
  24. package/dist/esm/components/molecules/Modal/ModalContext/index.d.ts +3 -0
  25. package/dist/esm/components/molecules/Modal/ModalContext/useModal.d.ts +34 -0
  26. package/dist/esm/components/molecules/Modal/index.d.ts +2 -0
  27. package/dist/esm/components/molecules/Popover/Popover.presenter.d.ts +26 -0
  28. package/dist/esm/components/molecules/Select/Option/Option.types.d.ts +6 -0
  29. package/dist/esm/components/molecules/Select/Select.Context.d.ts +1 -1
  30. package/dist/esm/components/molecules/Select/Select.d.ts +5 -5
  31. package/dist/esm/components/molecules/Select/Select.presenter.d.ts +1 -0
  32. package/dist/esm/components/molecules/Select/Select.types.d.ts +5 -0
  33. package/dist/esm/components/molecules/Select/index.d.ts +2 -9
  34. package/dist/esm/components/molecules/index.d.ts +2 -0
  35. package/dist/esm/components/utils/accessibilityUtils.d.ts +41 -0
  36. package/dist/esm/components/utils/index.d.ts +2 -0
  37. package/dist/esm/library.css +13 -0
  38. package/dist/esm/library.js +3 -3
  39. package/dist/esm/library.js.map +1 -1
  40. package/dist/index.d.ts +156 -12
  41. package/docs/README.md +264 -0
  42. package/docs/components/atoms/ActionImage.md +119 -0
  43. package/docs/components/atoms/Button.md +197 -0
  44. package/docs/components/atoms/Checkbox.md +299 -0
  45. package/docs/components/atoms/CheckboxItem.md +314 -0
  46. package/docs/components/atoms/Chip.md +380 -0
  47. package/docs/components/atoms/CustomToggle.md +270 -0
  48. package/docs/components/atoms/Icon.md +365 -0
  49. package/docs/components/atoms/IconButton.md +407 -0
  50. package/docs/components/atoms/Image.md +448 -0
  51. package/docs/components/atoms/Input.md +430 -0
  52. package/docs/components/atoms/ListItem.md +502 -0
  53. package/docs/components/atoms/Password.md +472 -0
  54. package/docs/components/atoms/RadioButton.md +614 -0
  55. package/docs/components/atoms/RadioButtonItem.md +588 -0
  56. package/docs/components/atoms/ResponsiveComponent.md +612 -0
  57. package/docs/components/atoms/SelectListItem.md +609 -0
  58. package/docs/components/atoms/Slider.md +605 -0
  59. package/docs/components/atoms/Spinner.md +605 -0
  60. package/docs/components/atoms/Text.md +463 -0
  61. package/docs/components/atoms/TextArea.md +670 -0
  62. package/docs/components/atoms/ToastNotification.md +668 -0
  63. package/docs/components/atoms/Toggle.md +737 -0
  64. package/docs/components/atoms/ToggleButton.md +751 -0
  65. package/docs/components/atoms/Tooltip.md +391 -0
  66. package/docs/components/molecules/Accordion.md +440 -0
  67. package/docs/components/molecules/AccordionGroup.md +547 -0
  68. package/docs/components/molecules/ActionCard.md +546 -0
  69. package/docs/components/molecules/Breadcrumb.md +403 -0
  70. package/docs/components/molecules/Breadcrumbs.md +485 -0
  71. package/docs/components/molecules/ButtonGroup.md +383 -0
  72. package/docs/components/molecules/Card.md +298 -0
  73. package/docs/components/molecules/ChipInput.md +646 -0
  74. package/docs/components/molecules/ContextMenu.md +768 -0
  75. package/docs/components/molecules/CustomTimeSelector.md +116 -0
  76. package/docs/components/molecules/DatePicker.md +516 -0
  77. package/docs/components/molecules/DateTimeSelector.md +166 -0
  78. package/docs/components/molecules/FormField.md +312 -0
  79. package/docs/components/molecules/Grid.md +577 -0
  80. package/docs/components/molecules/GridItem.md +834 -0
  81. package/docs/components/molecules/GridList.md +244 -0
  82. package/docs/components/molecules/List.md +485 -0
  83. package/docs/components/molecules/Modal.md +470 -0
  84. package/docs/components/molecules/ModalFooter.md +702 -0
  85. package/docs/components/molecules/ModalHeader.md +756 -0
  86. package/docs/components/molecules/ModalProvider.md +205 -0
  87. package/docs/components/molecules/Nav.md +530 -0
  88. package/docs/components/molecules/NavItem.md +572 -0
  89. package/docs/components/molecules/NavLink.md +499 -0
  90. package/docs/components/molecules/Option.md +521 -0
  91. package/docs/components/molecules/Pagination.md +592 -0
  92. package/docs/components/molecules/PaginationNumberField.md +722 -0
  93. package/docs/components/molecules/Popover.md +516 -0
  94. package/docs/components/molecules/ProgressBar.md +624 -0
  95. package/docs/components/molecules/RadioGroup.md +831 -0
  96. package/docs/components/molecules/RepeaterList.md +185 -0
  97. package/docs/components/molecules/Select.md +402 -0
  98. package/docs/components/molecules/SortableTrigger.md +82 -0
  99. package/docs/components/molecules/useModal.md +379 -0
  100. package/docs/components/organisms/Dropzone.md +346 -0
  101. package/docs/components/organisms/DropzoneClear.md +135 -0
  102. package/docs/components/organisms/DropzoneContent.md +216 -0
  103. package/docs/components/organisms/DropzoneFilename.md +191 -0
  104. package/docs/components/organisms/DropzoneSupportedFormats.md +184 -0
  105. package/docs/components/organisms/DropzoneTrigger.md +209 -0
  106. package/docs/components/organisms/Form.md +533 -0
  107. package/docs/components/organisms/SlideOutPanel.md +662 -0
  108. package/docs/components/organisms/TabContent.md +902 -0
  109. package/docs/components/organisms/TabItem.md +1091 -0
  110. package/docs/components/organisms/Table.md +611 -0
  111. package/docs/components/organisms/TableBody.md +679 -0
  112. package/docs/components/organisms/TableCell.md +482 -0
  113. package/docs/components/organisms/TableHeader.md +513 -0
  114. package/docs/components/organisms/TableHeaderCell.md +661 -0
  115. package/docs/components/organisms/TableRow.md +715 -0
  116. package/docs/components/organisms/Tabs.md +1330 -0
  117. package/docs/components/utils/ConditionalView.md +568 -0
  118. package/docs/components/utils/RenderStateView.md +726 -0
  119. package/docs/components/utils/WrapTextNodes.md +614 -0
  120. package/package.json +3 -2
@@ -0,0 +1,407 @@
1
+ # IconButton
2
+
3
+ A specialized button component designed specifically for displaying icons without text content. IconButton inherits most functionality from the Button component but is optimized for icon-only interactions. It provides a compact, accessible way to trigger actions using only visual icons, making it perfect for toolbars, navigation, and space-constrained interfaces.
4
+
5
+ ## Aliases
6
+
7
+ - IconButton
8
+ - IconBtn
9
+ - ActionIcon
10
+
11
+ ## Props Breakdown
12
+
13
+ **Extends:** `HTMLAttributes<HTMLButtonElement>` (via ButtonProps, excluding `leadingIcon`, `trailingIcon`, `style`, `size`)
14
+
15
+ | Prop | Type | Default | Required | Description |
16
+ |------|------|---------|----------|-------------|
17
+ | `appearance` | `'Default' \| 'Inverse'` | `'Default'` | No | Appearance of the button |
18
+ | `icon` | `ReactNode` | `undefined` | No | The icon to be displayed |
19
+ | `style` | `'Primary' \| 'Secondary'` | `'Primary'` | No | Style of the button |
20
+ | `size` | `'Small' \| 'Medium'` | `'Medium'` | No | Size of the button |
21
+ | `type` | `'Filled' \| 'Outlined' \| 'Ghost'` | `'Filled'` | No | Type of the button |
22
+ | `loading` | `boolean` | `false` | No | Indicates if the button is in a loading state |
23
+ | `disabled` | `boolean` | `false` | No | Specifies if the button is disabled |
24
+ | `onClick` | `(event?: MouseEvent<HTMLElement>) => void` | `undefined` | No | Click event handler for the button |
25
+ | `className` | `string` | `undefined` | No | Additional class for styling |
26
+ | `actionType` | `'button' \| 'submit' \| 'reset'` | `'button'` | No | Type of action associated with the button |
27
+
28
+ Plus all standard HTML button attributes (id, title, aria-*, data-*, etc.).
29
+
30
+ ## Examples
31
+
32
+ ### Basic Icon Button
33
+
34
+ ```tsx
35
+ import { IconButton, Icon } from '@delightui/components';
36
+
37
+ function BasicIconButtonExample() {
38
+ const handleClick = () => {
39
+ console.log('Icon button clicked!');
40
+ };
41
+
42
+ return (
43
+ <IconButton
44
+ icon={<Icon name="AddFilled" />}
45
+ onClick={handleClick}
46
+ />
47
+ );
48
+ }
49
+ ```
50
+
51
+ ### Different Sizes
52
+
53
+ ```tsx
54
+ import { IconButton, Icon } from '@delightui/components';
55
+
56
+ function SizedIconButtonsExample() {
57
+ return (
58
+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
59
+ <IconButton
60
+ size="Small"
61
+ icon={<Icon name="SearchFilled" />}
62
+ onClick={() => console.log('Small search')}
63
+ />
64
+
65
+ <IconButton
66
+ size="Medium"
67
+ icon={<Icon name="SearchFilled" />}
68
+ onClick={() => console.log('Medium search')}
69
+ />
70
+ </div>
71
+ );
72
+ }
73
+ ```
74
+
75
+ ### Different Styles and Types
76
+
77
+ ```tsx
78
+ import { IconButton, Icon } from '@delightui/components';
79
+
80
+ function StyledIconButtonsExample() {
81
+ return (
82
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
83
+ {/* Primary Styles */}
84
+ <div style={{ display: 'flex', gap: '8px' }}>
85
+ <IconButton
86
+ style="Primary"
87
+ type="Filled"
88
+ icon={<Icon name="CheckFilled" />}
89
+ />
90
+ <IconButton
91
+ style="Primary"
92
+ type="Outlined"
93
+ icon={<Icon name="CheckFilled" />}
94
+ />
95
+ <IconButton
96
+ style="Primary"
97
+ type="Ghost"
98
+ icon={<Icon name="CheckFilled" />}
99
+ />
100
+ </div>
101
+
102
+ {/* Secondary Styles */}
103
+ <div style={{ display: 'flex', gap: '8px' }}>
104
+ <IconButton
105
+ style="Secondary"
106
+ type="Filled"
107
+ icon={<Icon name="InfoFilled" />}
108
+ />
109
+ <IconButton
110
+ style="Secondary"
111
+ type="Outlined"
112
+ icon={<Icon name="InfoFilled" />}
113
+ />
114
+ <IconButton
115
+ style="Secondary"
116
+ type="Ghost"
117
+ icon={<Icon name="InfoFilled" />}
118
+ />
119
+ </div>
120
+ </div>
121
+ );
122
+ }
123
+ ```
124
+
125
+ ### Different Appearances
126
+
127
+ ```tsx
128
+ import { IconButton, Icon } from '@delightui/components';
129
+
130
+ function AppearanceIconButtonsExample() {
131
+ return (
132
+ <div style={{ display: 'flex', gap: '16px' }}>
133
+ <IconButton
134
+ appearance="Default"
135
+ icon={<Icon name="AddFilled" />}
136
+ onClick={() => console.log('Default appearance')}
137
+ />
138
+
139
+ <IconButton
140
+ appearance="Inverse"
141
+ icon={<Icon name="AddFilled" />}
142
+ onClick={() => console.log('Inverse appearance')}
143
+ />
144
+ </div>
145
+ );
146
+ }
147
+ ```
148
+
149
+ ### Loading State
150
+
151
+ ```tsx
152
+ import { IconButton, Icon } from '@delightui/components';
153
+
154
+ function LoadingIconButtonExample() {
155
+ const [isLoading, setIsLoading] = useState(false);
156
+
157
+ const handleClick = async () => {
158
+ setIsLoading(true);
159
+ // Simulate API call
160
+ await new Promise(resolve => setTimeout(resolve, 2000));
161
+ setIsLoading(false);
162
+ };
163
+
164
+ return (
165
+ <IconButton
166
+ icon={<Icon name="SearchFilled" />}
167
+ loading={isLoading}
168
+ onClick={handleClick}
169
+ />
170
+ );
171
+ }
172
+ ```
173
+
174
+ ### Disabled State
175
+
176
+ ```tsx
177
+ import { IconButton, Icon } from '@delightui/components';
178
+
179
+ function DisabledIconButtonExample() {
180
+ return (
181
+ <div style={{ display: 'flex', gap: '16px' }}>
182
+ <IconButton
183
+ icon={<Icon name="AddFilled" />}
184
+ disabled={false}
185
+ onClick={() => console.log('Enabled button clicked')}
186
+ />
187
+
188
+ <IconButton
189
+ icon={<Icon name="AddFilled" />}
190
+ disabled={true}
191
+ onClick={() => console.log('This will not be called')}
192
+ />
193
+ </div>
194
+ );
195
+ }
196
+ ```
197
+
198
+ ### Form Integration
199
+
200
+ ```tsx
201
+ import { Form, FormField, IconButton, Icon, Input, Button } from '@delightui/components';
202
+
203
+ function FormIconButtonExample() {
204
+ const [showPassword, setShowPassword] = useState(false);
205
+
206
+ const handleSubmit = (data: any) => {
207
+ console.log('Form submitted:', data);
208
+ };
209
+
210
+ return (
211
+ <Form onSubmit={handleSubmit}>
212
+ <FormField name="email" label="Email">
213
+ <Input type="email" />
214
+ </FormField>
215
+
216
+ <FormField name="password" label="Password">
217
+ <div style={{ position: 'relative' }}>
218
+ <Input type={showPassword ? 'text' : 'password'} />
219
+ <IconButton
220
+ type="Ghost"
221
+ size="Small"
222
+ icon={<Icon name={showPassword ? 'VisibilityOffFilled' : 'VisibilityOnFilled'} />}
223
+ onClick={() => setShowPassword(!showPassword)}
224
+ style={{ position: 'absolute', right: '8px', top: '50%', transform: 'translateY(-50%)' }}
225
+ />
226
+ </div>
227
+ </FormField>
228
+
229
+ <Button type="submit">
230
+ Submit
231
+ </Button>
232
+ </Form>
233
+ );
234
+ }
235
+ ```
236
+
237
+ ### Toolbar Example
238
+
239
+ ```tsx
240
+ import { IconButton, Icon } from '@delightui/components';
241
+
242
+ function ToolbarExample() {
243
+ const handleAction = (action: string) => {
244
+ console.log(`${action} clicked`);
245
+ };
246
+
247
+ return (
248
+ <div style={{
249
+ display: 'flex',
250
+ gap: '8px',
251
+ padding: '8px',
252
+ border: '1px solid #ccc',
253
+ borderRadius: '4px',
254
+ backgroundColor: '#f9f9f9'
255
+ }}>
256
+ <IconButton
257
+ size="Small"
258
+ type="Ghost"
259
+ icon={<Icon name="AddFilled" />}
260
+ onClick={() => handleAction('Add')}
261
+ title="Add item"
262
+ />
263
+
264
+ <IconButton
265
+ size="Small"
266
+ type="Ghost"
267
+ icon={<Icon name="SearchFilled" />}
268
+ onClick={() => handleAction('Search')}
269
+ title="Search"
270
+ />
271
+
272
+ <IconButton
273
+ size="Small"
274
+ type="Ghost"
275
+ icon={<Icon name="CloseDeleteOutlined" />}
276
+ onClick={() => handleAction('Delete')}
277
+ title="Delete"
278
+ />
279
+
280
+ <div style={{ width: '1px', backgroundColor: '#ccc', margin: '0 4px' }} />
281
+
282
+ <IconButton
283
+ size="Small"
284
+ type="Ghost"
285
+ icon={<Icon name="InfoFilled" />}
286
+ onClick={() => handleAction('Info')}
287
+ title="Information"
288
+ />
289
+ </div>
290
+ );
291
+ }
292
+ ```
293
+
294
+ ### Navigation Example
295
+
296
+ ```tsx
297
+ import { IconButton, Icon } from '@delightui/components';
298
+
299
+ function NavigationExample() {
300
+ const [currentPage, setCurrentPage] = useState(1);
301
+ const totalPages = 10;
302
+
303
+ const goToPrevious = () => {
304
+ if (currentPage > 1) {
305
+ setCurrentPage(currentPage - 1);
306
+ }
307
+ };
308
+
309
+ const goToNext = () => {
310
+ if (currentPage < totalPages) {
311
+ setCurrentPage(currentPage + 1);
312
+ }
313
+ };
314
+
315
+ return (
316
+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
317
+ <IconButton
318
+ icon={<Icon name="ChevronLeftOutlined" />}
319
+ disabled={currentPage === 1}
320
+ onClick={goToPrevious}
321
+ title="Previous page"
322
+ />
323
+
324
+ <span>Page {currentPage} of {totalPages}</span>
325
+
326
+ <IconButton
327
+ icon={<Icon name="ChevronRightOutlined" />}
328
+ disabled={currentPage === totalPages}
329
+ onClick={goToNext}
330
+ title="Next page"
331
+ />
332
+ </div>
333
+ );
334
+ }
335
+ ```
336
+
337
+ ### Custom Styling
338
+
339
+ ```tsx
340
+ import { IconButton, Icon } from '@delightui/components';
341
+
342
+ function CustomStyledIconButtonExample() {
343
+ return (
344
+ <div style={{ display: 'flex', gap: '16px' }}>
345
+ <IconButton
346
+ icon={<Icon name="AddFilled" />}
347
+ className="custom-icon-button-primary"
348
+ onClick={() => console.log('Custom primary clicked')}
349
+ />
350
+
351
+ <IconButton
352
+ icon={<Icon name="CloseDeleteOutlined" />}
353
+ className="custom-icon-button-danger"
354
+ onClick={() => console.log('Custom danger clicked')}
355
+ />
356
+ </div>
357
+ );
358
+ }
359
+ ```
360
+
361
+ ### Action Type Examples
362
+
363
+ ```tsx
364
+ import { Form, IconButton, Icon, Input, FormField } from '@delightui/components';
365
+
366
+ function ActionTypeExample() {
367
+ const handleSubmit = (data: any) => {
368
+ console.log('Form submitted:', data);
369
+ };
370
+
371
+ const handleReset = () => {
372
+ console.log('Form reset');
373
+ };
374
+
375
+ return (
376
+ <Form onSubmit={handleSubmit}>
377
+ <FormField name="searchTerm" label="Search">
378
+ <Input placeholder="Enter search term..." />
379
+ </FormField>
380
+
381
+ <div style={{ display: 'flex', gap: '8px', marginTop: '16px' }}>
382
+ <IconButton
383
+ actionType="submit"
384
+ icon={<Icon name="SearchFilled" />}
385
+ title="Search"
386
+ />
387
+
388
+ <IconButton
389
+ actionType="reset"
390
+ type="Outlined"
391
+ icon={<Icon name="CloseDeleteOutlined" />}
392
+ onClick={handleReset}
393
+ title="Clear"
394
+ />
395
+
396
+ <IconButton
397
+ actionType="button"
398
+ type="Ghost"
399
+ icon={<Icon name="InfoFilled" />}
400
+ onClick={() => console.log('Info clicked')}
401
+ title="Information"
402
+ />
403
+ </div>
404
+ </Form>
405
+ );
406
+ }
407
+ ```