@appdirect/design-system 0.0.10 → 0.0.12

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 (179) hide show
  1. package/README.md +85 -5
  2. package/dist/Buttons/ActionIcon.js +14 -0
  3. package/dist/Buttons/Button.js +66 -0
  4. package/dist/Buttons/CloseButton.js +48 -0
  5. package/dist/Buttons/index.js +13 -0
  6. package/dist/Combobox/AutocompleteClearable.js +36 -0
  7. package/dist/Combobox/Combobox.js +28 -0
  8. package/dist/Combobox/Multiselect.js +31 -0
  9. package/dist/Combobox/SearchableSelect.js +43 -0
  10. package/dist/Combobox/Select.js +72 -0
  11. package/dist/Combobox/index.js +10 -0
  12. package/dist/ComplexComponents/DashboardWidget/DashboardWidget.js +96 -0
  13. package/dist/ComplexComponents/DashboardWidget/index.js +1 -0
  14. package/dist/ComplexComponents/DataTable/CustomBottomToolbar/index.js +82 -0
  15. package/dist/ComplexComponents/DataTable/CustomBottomToolbar/utils.js +23 -0
  16. package/dist/ComplexComponents/DataTable/CustomToolbarAlertBannerContent/index.js +23 -0
  17. package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/index.js +230 -0
  18. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterChip.js +30 -0
  19. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/DateRangeFilter.js +12 -0
  20. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/FilterRenderer.js +32 -0
  21. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/FilterSystem.js +90 -0
  22. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/MultiSelectFilter.js +43 -0
  23. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/SingleSelectFilter.js +30 -0
  24. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/index.js +39 -0
  25. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/types.js +9 -0
  26. package/dist/ComplexComponents/DataTable/CustomTopToolbar/ResultCount/index.js +31 -0
  27. package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.js +42 -0
  28. package/dist/ComplexComponents/DataTable/CustomTopToolbar/SelectFilter.js +21 -0
  29. package/dist/ComplexComponents/DataTable/CustomTopToolbar/index.js +410 -0
  30. package/dist/ComplexComponents/DataTable/DataTable.js +405 -0
  31. package/dist/ComplexComponents/DataTable/ErrorOverlay/index.js +9 -0
  32. package/dist/ComplexComponents/DataTable/SortableHeaderCell/index.js +27 -0
  33. package/dist/ComplexComponents/DataTable/index.js +1 -0
  34. package/dist/ComplexComponents/DataTable/translations/en.js +99 -0
  35. package/dist/ComplexComponents/DataTable/translations/index.js +17 -0
  36. package/dist/ComplexComponents/KeyInsight/KeyInsights.js +176 -0
  37. package/dist/ComplexComponents/KeyInsight/index.js +1 -0
  38. package/dist/ComplexComponents/NameValue/NameValue.js +94 -0
  39. package/dist/ComplexComponents/NameValue/NameValueItem.js +59 -0
  40. package/dist/ComplexComponents/NameValue/index.js +2 -0
  41. package/dist/ComplexComponents/PageContentHeader/PageContentHeader.js +92 -0
  42. package/dist/ComplexComponents/PageContentHeader/PageContentHeader.tsx +24 -34
  43. package/dist/ComplexComponents/PageContentHeader/index.js +1 -0
  44. package/dist/ComplexComponents/PageContentHeader/index.ts +0 -2
  45. package/dist/ComplexComponents/Placeholder/Placeholder.js +51 -0
  46. package/dist/ComplexComponents/Placeholder/index.js +1 -0
  47. package/dist/ComplexComponents/Slat/Slat.js +53 -0
  48. package/dist/ComplexComponents/Slat/index.js +1 -0
  49. package/dist/ComplexComponents/Utilities/CopyButton.js +45 -0
  50. package/dist/ComplexComponents/Utilities/index.js +1 -0
  51. package/dist/DataDisplay/Alert.js +77 -0
  52. package/dist/DataDisplay/Avatar.js +157 -0
  53. package/dist/DataDisplay/Badge.js +78 -0
  54. package/dist/DataDisplay/Card.js +100 -0
  55. package/dist/DataDisplay/Chip.js +36 -0
  56. package/dist/DataDisplay/Indicator.js +59 -0
  57. package/dist/DataDisplay/List.js +60 -0
  58. package/dist/DataDisplay/Pill.js +81 -0
  59. package/dist/DataDisplay/Progress.js +42 -0
  60. package/dist/DataDisplay/Table.js +38 -0
  61. package/dist/DataDisplay/ThemeIcon.js +31 -0
  62. package/dist/DataDisplay/index.js +18 -0
  63. package/dist/Inputs/Checkbox.js +62 -0
  64. package/dist/Inputs/ColorInput.js +48 -0
  65. package/dist/Inputs/DropZone.js +12 -0
  66. package/dist/Inputs/FileInput.js +77 -0
  67. package/dist/Inputs/NumberInput.js +49 -0
  68. package/dist/Inputs/Radio.js +55 -0
  69. package/dist/Inputs/RadioGroup.js +59 -0
  70. package/dist/Inputs/SegmentedControl.js +50 -0
  71. package/dist/Inputs/Slider.js +50 -0
  72. package/dist/Inputs/SliderWithLabel.js +32 -0
  73. package/dist/Inputs/Switch.js +47 -0
  74. package/dist/Inputs/TextArea.js +50 -0
  75. package/dist/Inputs/TextInput.js +87 -0
  76. package/dist/Inputs/index.js +27 -0
  77. package/dist/Layout/Box.js +39 -0
  78. package/dist/Layout/Center.js +11 -0
  79. package/dist/Layout/Container.js +11 -0
  80. package/dist/Layout/Flex.js +12 -0
  81. package/dist/Layout/Grid.js +13 -0
  82. package/dist/Layout/Group.js +14 -0
  83. package/dist/Layout/Inline.js +46 -0
  84. package/dist/Layout/SimpleGrid.js +14 -0
  85. package/dist/Layout/Stack.js +45 -0
  86. package/dist/Layout/index.js +10 -0
  87. package/dist/Misc/Divider.js +8 -0
  88. package/dist/Misc/Paper.js +24 -0
  89. package/dist/Misc/index.js +10 -0
  90. package/dist/Navigation/Breadcrumb.js +60 -0
  91. package/dist/Navigation/NavLink.js +28 -0
  92. package/dist/Navigation/Stepper.js +8 -0
  93. package/dist/Navigation/Tabs.js +22 -0
  94. package/dist/Navigation/index.js +9 -0
  95. package/dist/Overlays/Drawer.js +63 -0
  96. package/dist/Overlays/Menu.js +85 -0
  97. package/dist/Overlays/Modal.js +61 -0
  98. package/dist/Overlays/Popover.js +118 -0
  99. package/dist/Overlays/Tooltip.js +71 -0
  100. package/dist/Overlays/index.js +12 -0
  101. package/dist/Shell/AppShellLayout.js +13 -0
  102. package/dist/Shell/HeaderBar.js +8 -0
  103. package/dist/Shell/SidebarNav.js +9 -0
  104. package/dist/Shell/SidebarNavLink.js +17 -0
  105. package/dist/Shell/SingleColumnLayout.js +11 -0
  106. package/dist/Shell/TertiaryColumnLayout.js +12 -0
  107. package/dist/Shell/index.js +6 -0
  108. package/dist/Typography/Code.js +8 -0
  109. package/dist/Typography/Kbd.js +58 -0
  110. package/dist/Typography/Text.js +8 -0
  111. package/dist/Typography/Title.js +11 -0
  112. package/dist/Typography/index.js +12 -0
  113. package/dist/config.js +202 -0
  114. package/dist/contracts/PageContentHeader.json +10 -5
  115. package/dist/contracts/index.json +1 -1
  116. package/dist/hooks/useTableHandlers.js +136 -0
  117. package/dist/hooks/useTableRenderFunctions.js +164 -0
  118. package/dist/hooks/useTableState.js +70 -0
  119. package/dist/index.js +162 -0
  120. package/dist/index.ts +3 -4
  121. package/dist/stories/Buttons/ActionIcon.stories.tsx +159 -0
  122. package/dist/stories/Buttons/Button.stories.tsx +145 -0
  123. package/dist/stories/Buttons/CloseButton.stories.tsx +121 -0
  124. package/dist/stories/Combobox/AutocompleteClearable.stories.tsx +554 -0
  125. package/dist/stories/Combobox/Combobox.stories.tsx +106 -0
  126. package/dist/stories/Combobox/Multiselect.stories.tsx +664 -0
  127. package/dist/stories/Combobox/SearchableSelect.stories.tsx +640 -0
  128. package/dist/stories/Combobox/Select.stories.tsx +311 -0
  129. package/dist/stories/ComplexComponents/DashboardWidget/DashboardWidget.stories.tsx +822 -0
  130. package/dist/stories/ComplexComponents/DataTable/DataTable.stories.tsx +502 -0
  131. package/dist/stories/ComplexComponents/KeyInsight/KeyInsights.stories.tsx +386 -0
  132. package/dist/stories/ComplexComponents/NameValue/NameValue.stories.tsx +405 -0
  133. package/dist/stories/ComplexComponents/PageContentHeader/PageContentHeader.stories.tsx +527 -0
  134. package/dist/stories/ComplexComponents/Placeholder/Placeholder.stories.tsx +76 -0
  135. package/dist/stories/ComplexComponents/Slat/Slat.stories.tsx +79 -0
  136. package/dist/stories/ComplexComponents/Utilities/CopyButton.stories.tsx +479 -0
  137. package/dist/stories/DataDisplay/Alert.stories.tsx +296 -0
  138. package/dist/stories/DataDisplay/Avatar.stories.tsx +251 -0
  139. package/dist/stories/DataDisplay/Badge.stories.tsx +176 -0
  140. package/dist/stories/DataDisplay/Card.stories.tsx +406 -0
  141. package/dist/stories/DataDisplay/Chip.stories.tsx +495 -0
  142. package/dist/stories/DataDisplay/Indicator.stories.tsx +571 -0
  143. package/dist/stories/DataDisplay/List.stories.tsx +376 -0
  144. package/dist/stories/DataDisplay/Pill.stories.tsx +506 -0
  145. package/dist/stories/DataDisplay/Progress.stories.tsx +352 -0
  146. package/dist/stories/DataDisplay/Table.stories.tsx +346 -0
  147. package/dist/stories/DataDisplay/ThemeIcon.stories.tsx +125 -0
  148. package/dist/stories/Inputs/Checkbox.stories.tsx +263 -0
  149. package/dist/stories/Inputs/ColorInput.stories.tsx +434 -0
  150. package/dist/stories/Inputs/DropZone.stories.tsx +401 -0
  151. package/dist/stories/Inputs/FileInput.stories.tsx +383 -0
  152. package/dist/stories/Inputs/NumberInput.stories.tsx +342 -0
  153. package/dist/stories/Inputs/Radio.stories.tsx +437 -0
  154. package/dist/stories/Inputs/RadioGroup.stories.tsx +526 -0
  155. package/dist/stories/Inputs/SegmentedControl.stories.tsx +60 -0
  156. package/dist/stories/Inputs/Slider.stories.tsx +22 -0
  157. package/dist/stories/Inputs/SliderWithLabel.stories.tsx +37 -0
  158. package/dist/stories/Inputs/Switch.stories.tsx +361 -0
  159. package/dist/stories/Inputs/TextArea.stories.tsx +355 -0
  160. package/dist/stories/Inputs/TextInput.stories.tsx +266 -0
  161. package/dist/stories/Misc/Divider.stories.tsx +581 -0
  162. package/dist/stories/Misc/Paper.stories.tsx +557 -0
  163. package/dist/stories/Navigation/Breadcrumb.stories.tsx +489 -0
  164. package/dist/stories/Navigation/NavLink.stories.tsx +601 -0
  165. package/dist/stories/Navigation/Stepper.stories.tsx +413 -0
  166. package/dist/stories/Navigation/Tabs.stories.tsx +528 -0
  167. package/dist/stories/Overlays/Drawer.stories.tsx +802 -0
  168. package/dist/stories/Overlays/Menu.stories.tsx +941 -0
  169. package/dist/stories/Overlays/Modal.stories.tsx +249 -0
  170. package/dist/stories/Overlays/Popover.stories.tsx +780 -0
  171. package/dist/stories/Overlays/Tooltip.stories.tsx +52 -0
  172. package/dist/stories/Typography/Code.stories.tsx +368 -0
  173. package/dist/stories/Typography/Kbd.stories.tsx +514 -0
  174. package/dist/stories/Typography/Text.stories.tsx +117 -0
  175. package/dist/stories/Typography/Title.stories.tsx +112 -0
  176. package/dist/stories/index.json +1435 -0
  177. package/dist/types.js +127 -0
  178. package/package.json +12 -7
  179. package/dist/ComplexComponents/PageContentHeader/DescriptionBlock.tsx +0 -65
@@ -0,0 +1,571 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { Stack, Box } from '@mantine/core';
3
+ import { Inline, Badge, Indicator, Title, Text, Avatar, NavLink, Paper, ThemeIcon, Button } from '@appdirect/design-system';
4
+ import { useState } from 'react';
5
+ import { RiAccessibilityLine } from '@remixicon/react';
6
+
7
+ const meta: Meta<typeof Indicator> = {
8
+ title: 'Design System/Data Display/Indicator',
9
+ component: Indicator,
10
+ parameters: {
11
+ layout: 'centered',
12
+ docs: {
13
+ description: {
14
+ component: 'Indicator component for showing notifications, status, or supplementary information attached to other elements.',
15
+ },
16
+ },
17
+ },
18
+ tags: ['autodocs', 'code-connected'],
19
+ argTypes: {
20
+ type: {
21
+ control: 'select',
22
+ options: ['default', 'info', 'success', 'danger', 'pending'],
23
+ description: 'Semantic indicator type',
24
+ },
25
+ size: {
26
+ control: 'number',
27
+ description: 'Indicator size in pixels',
28
+ },
29
+ position: {
30
+ control: 'select',
31
+ options: [
32
+ 'top-start', 'top-center', 'top-end',
33
+ 'middle-start', 'middle-center', 'middle-end',
34
+ 'bottom-start', 'bottom-center', 'bottom-end'
35
+ ],
36
+ description: 'Indicator position',
37
+ },
38
+ count: {
39
+ control: 'number',
40
+ description: 'Number to display in indicator',
41
+ },
42
+ label: {
43
+ control: 'text',
44
+ description: 'Custom label inside indicator',
45
+ },
46
+ withBorder: {
47
+ control: 'boolean',
48
+ description: 'Whether indicator should have border',
49
+ },
50
+ withOutline: {
51
+ control: 'boolean',
52
+ description: 'Whether to show outline variant',
53
+ },
54
+ processing: {
55
+ control: 'boolean',
56
+ description: 'Whether indicator should be animated',
57
+ },
58
+ disabled: {
59
+ control: 'boolean',
60
+ description: 'Whether indicator should be disabled',
61
+ },
62
+ },
63
+ };
64
+
65
+ export default meta;
66
+ type Story = StoryObj<typeof meta>;
67
+
68
+ export const Default: Story = {
69
+ args: {
70
+ type: 'info',
71
+ size: 12,
72
+ children: (
73
+ <Avatar variant="initials" initials="JD" />
74
+ ),
75
+ },
76
+ };
77
+
78
+ export const Types: Story = {
79
+ render: () => (
80
+ <Inline gap="xl">
81
+ <Indicator type="default" size={12}>
82
+ <Avatar variant="initials" initials="D" />
83
+ </Indicator>
84
+ <Indicator type="info" size={12}>
85
+ <Avatar variant="initials" initials="I" />
86
+ </Indicator>
87
+ <Indicator type="success" size={12}>
88
+ <Avatar variant="initials" initials="S" />
89
+ </Indicator>
90
+ <Indicator type="danger" size={12}>
91
+ <Avatar variant="initials" initials="D" />
92
+ </Indicator>
93
+ <Indicator type="pending" size={12}>
94
+ <Avatar variant="initials" initials="P" />
95
+ </Indicator>
96
+ </Inline>
97
+ ),
98
+ parameters: {
99
+ docs: {
100
+ description: {
101
+ story: 'Different semantic types of the Indicator component.',
102
+ },
103
+ },
104
+ },
105
+ };
106
+
107
+ export const Sizes: Story = {
108
+ render: () => (
109
+ <Inline gap="xl">
110
+ <Indicator type="info" size={8}>
111
+ <Avatar variant="initials" initials="8px" />
112
+ </Indicator>
113
+ <Indicator type="info" size={12}>
114
+ <Avatar variant="initials" initials="12px" />
115
+ </Indicator>
116
+ <Indicator type="info" size={16}>
117
+ <Avatar variant="initials" initials="16px" />
118
+ </Indicator>
119
+ <Indicator type="info" size={20}>
120
+ <Avatar variant="initials" initials="20px" />
121
+ </Indicator>
122
+ <Indicator type="info" size={24}>
123
+ <Avatar variant="initials" initials="24px" />
124
+ </Indicator>
125
+ </Inline>
126
+ ),
127
+ parameters: {
128
+ docs: {
129
+ description: {
130
+ story: 'Indicator component in different sizes (pixels). Note that all indicators maintain a minimum circular size - they cannot be smaller than a perfect circle.',
131
+ },
132
+ },
133
+ },
134
+ };
135
+
136
+ export const Positions: Story = {
137
+ render: () => (
138
+ <Stack gap="lg">
139
+ <Inline gap="xl">
140
+ <div>
141
+ <Text size="sm" fw={500} mb="sm">Top Positions:</Text>
142
+ <Inline gap="md">
143
+ <Indicator type="danger" position="top-start" size={12}>
144
+ <Avatar variant="initials" initials="TS" />
145
+ </Indicator>
146
+ <Indicator type="danger" position="top-center" size={12}>
147
+ <Avatar variant="initials" initials="TC" />
148
+ </Indicator>
149
+ <Indicator type="danger" position="top-end" size={12}>
150
+ <Avatar variant="initials" initials="TE" />
151
+ </Indicator>
152
+ </Inline>
153
+ </div>
154
+ </Inline>
155
+
156
+ <Inline gap="xl">
157
+ <div>
158
+ <Text size="sm" fw={500} mb="sm">Middle Positions:</Text>
159
+ <Inline gap="md">
160
+ <Indicator type="success" position="middle-start" size={12}>
161
+ <Avatar variant="initials" initials="MS" />
162
+ </Indicator>
163
+ <Indicator type="success" position="middle-center" size={12}>
164
+ <Avatar variant="initials" initials="MC" />
165
+ </Indicator>
166
+ <Indicator type="success" position="middle-end" size={12}>
167
+ <Avatar variant="initials" initials="ME" />
168
+ </Indicator>
169
+ </Inline>
170
+ </div>
171
+ </Inline>
172
+
173
+ <Inline gap="xl">
174
+ <div>
175
+ <Text size="sm" fw={500} mb="sm">Bottom Positions:</Text>
176
+ <Inline gap="md">
177
+ <Indicator type="info" position="bottom-start" size={12}>
178
+ <Avatar variant="initials" initials="BS" />
179
+ </Indicator>
180
+ <Indicator type="info" position="bottom-center" size={12}>
181
+ <Avatar variant="initials" initials="BC" />
182
+ </Indicator>
183
+ <Indicator type="info" position="bottom-end" size={12}>
184
+ <Avatar variant="initials" initials="BE" />
185
+ </Indicator>
186
+ </Inline>
187
+ </div>
188
+ </Inline>
189
+ </Stack>
190
+ ),
191
+ parameters: {
192
+ docs: {
193
+ description: {
194
+ story: 'Different positioning options for the Indicator component.',
195
+ },
196
+ },
197
+ },
198
+ };
199
+
200
+ export const WithCounts: Story = {
201
+ render: () => (
202
+ <Inline gap="xl">
203
+ <Indicator type="danger" count={1} size={16}>
204
+ <Button variant="outline">Messages</Button>
205
+ </Indicator>
206
+ <Indicator type="danger" count={5} size={18}>
207
+ <Button variant="outline">Notifications</Button>
208
+ </Indicator>
209
+ <Indicator type="danger" count={12} size={20}>
210
+ <Button variant="outline">Alerts</Button>
211
+ </Indicator>
212
+ <Indicator type="danger" count={99} size={22}>
213
+ <Button variant="outline">Updates</Button>
214
+ </Indicator>
215
+ <Indicator type="danger" count={999} size={24}>
216
+ <Button variant="outline">Items</Button>
217
+ </Indicator>
218
+ </Inline>
219
+ ),
220
+ parameters: {
221
+ docs: {
222
+ description: {
223
+ story: 'Indicator with count numbers. When content is added, the indicator becomes pill-shaped with circular ends to accommodate the text while maintaining proper proportions.',
224
+ },
225
+ },
226
+ },
227
+ };
228
+
229
+ export const WithLabels: Story = {
230
+ render: () => (
231
+ <Inline gap="xl">
232
+ <Indicator type="success" label="✓" size={16}>
233
+ <Avatar variant="initials" initials="OK" />
234
+ </Indicator>
235
+ <Indicator type="danger" label="!" size={16}>
236
+ <Avatar variant="initials" initials="ER" />
237
+ </Indicator>
238
+ <Indicator type="info" label="i" size={16}>
239
+ <Avatar variant="initials" initials="IN" />
240
+ </Indicator>
241
+ <Indicator type="pending" label="?" size={16}>
242
+ <Avatar variant="initials" initials="UN" />
243
+ </Indicator>
244
+ <Indicator type="info" label="NEW" size={20}>
245
+ <Button variant="outline">Feature</Button>
246
+ </Indicator>
247
+ </Inline>
248
+ ),
249
+ parameters: {
250
+ docs: {
251
+ description: {
252
+ story: 'Indicator with custom labels. Single characters remain more circular, while longer text creates a pill shape with rounded ends.',
253
+ },
254
+ },
255
+ },
256
+ };
257
+
258
+ export const WithBorders: Story = {
259
+ render: () => (
260
+ <Stack gap="md">
261
+ <Inline gap="xl">
262
+ <Text size="sm" fw={500}>Without Border:</Text>
263
+ <Indicator type="success" size={16}>
264
+ <Avatar variant="initials" initials="NB" />
265
+ </Indicator>
266
+ <Indicator type="danger" count={5} size={16}>
267
+ <Button variant="danger">No Border</Button>
268
+ </Indicator>
269
+ </Inline>
270
+
271
+ <Inline gap="xl">
272
+ <Text size="sm" fw={500}>With Border:</Text>
273
+ <Indicator type="success" withBorder size={16}>
274
+ <Avatar variant="initials" initials="WB" />
275
+ </Indicator>
276
+ <Indicator type="danger" count={5} withBorder size={16}>
277
+ <Button variant="primary">With Border</Button>
278
+ </Indicator>
279
+ </Inline>
280
+
281
+ <Inline gap="xl">
282
+ <Text size="sm" fw={500}>With Outline:</Text>
283
+ <Indicator type="success" withOutline size={16}>
284
+ <Avatar variant="initials" initials="WO" />
285
+ </Indicator>
286
+ <Indicator type="danger" count={5} withOutline size={16}>
287
+ <Button variant="primary">With Border</Button>
288
+ </Indicator>
289
+ </Inline>
290
+ </Stack>
291
+ ),
292
+ parameters: {
293
+ docs: {
294
+ description: {
295
+ story: 'Indicator with different border and outline styles.',
296
+ },
297
+ },
298
+ },
299
+ };
300
+
301
+ export const ProcessingStates: Story = {
302
+ render: () => (
303
+ <Inline gap="xl">
304
+ <Indicator type="pending" processing size={12}>
305
+ <Avatar variant="initials" initials="PR" />
306
+ </Indicator>
307
+ <Indicator type="info" processing count={3} size={16}>
308
+ <Button variant="outline">Loading</Button>
309
+ </Indicator>
310
+ <Indicator type="success" processing label="SYNC" size={18}>
311
+ <Button variant="outline">Syncing</Button>
312
+ </Indicator>
313
+ <Indicator type="danger" processing size={12}>
314
+ <ThemeIcon variant="default" size="xxl">
315
+ <RiAccessibilityLine size={40} color="var(--mantine-color-blue-5)" />
316
+ </ThemeIcon>
317
+ </Indicator>
318
+ </Inline>
319
+ ),
320
+ parameters: {
321
+ docs: {
322
+ description: {
323
+ story: 'Animated processing indicators for showing active states.',
324
+ },
325
+ },
326
+ },
327
+ };
328
+
329
+ export const States: Story = {
330
+ render: () => (
331
+ <Stack gap="md">
332
+ <Inline gap="xl">
333
+ <Text size="sm" fw={500}>Normal:</Text>
334
+ <Indicator type="info" count={5} size={16}>
335
+ <Button variant="outline">Normal</Button>
336
+ </Indicator>
337
+ <Indicator type="success" size={12}>
338
+ <Avatar variant="initials" initials="N" />
339
+ </Indicator>
340
+ </Inline>
341
+
342
+ <Inline gap="xl">
343
+ <Text size="sm" fw={500}>Disabled:</Text>
344
+ <Indicator type="info" count={5} disabled size={16}>
345
+ <Button variant="outline">Disabled</Button>
346
+ </Indicator>
347
+ <Indicator type="success" disabled size={12}>
348
+ <Avatar variant="initials" initials="D" />
349
+ </Indicator>
350
+ </Inline>
351
+ </Stack>
352
+ ),
353
+ parameters: {
354
+ docs: {
355
+ description: {
356
+ story: 'Different states of the Indicator component.',
357
+ },
358
+ },
359
+ },
360
+ };
361
+
362
+ export const NotificationExamples: Story = {
363
+ render: () => {
364
+ const [messageCount, setMessageCount] = useState(3);
365
+ const [alertCount, setAlertCount] = useState(1);
366
+ const [hasNotification, setHasNotification] = useState(true);
367
+
368
+ return (
369
+ <Stack gap="lg" w={400}>
370
+ <Title order={3} size="md" fw={500}>Notification Examples</Title>
371
+
372
+ <Inline gap="md">
373
+ <Indicator type="danger" count={messageCount} disabled={messageCount === 0} size={16}>
374
+ <Button
375
+ variant="outline"
376
+ onClick={() => setMessageCount(prev => Math.max(0, prev - 1))}
377
+ >
378
+ Messages
379
+ </Button>
380
+ </Indicator>
381
+
382
+ <Indicator type="pending" count={alertCount} disabled={alertCount === 0} size={16}>
383
+ <Button
384
+ variant="outline"
385
+ onClick={() => setAlertCount(prev => Math.max(0, prev - 1))}
386
+ >
387
+ Alerts
388
+ </Button>
389
+ </Indicator>
390
+
391
+ <Indicator type="success" disabled={!hasNotification} size={12}>
392
+ <Button
393
+ variant="outline"
394
+ onClick={() => setHasNotification(prev => !prev)}
395
+ >
396
+ Status
397
+ </Button>
398
+ </Indicator>
399
+ </Inline>
400
+
401
+ <Inline gap="sm">
402
+ <Button
403
+ size="xs"
404
+ variant="secondary"
405
+ onClick={() => setMessageCount(prev => prev + 1)}
406
+ >
407
+ Add Message
408
+ </Button>
409
+ <Button
410
+ size="xs"
411
+ variant="secondary"
412
+ onClick={() => setAlertCount(prev => prev + 1)}
413
+ >
414
+ Add Alert
415
+ </Button>
416
+ <Button
417
+ size="xs"
418
+ variant="secondary"
419
+ onClick={() => {
420
+ setMessageCount(0);
421
+ setAlertCount(0);
422
+ setHasNotification(false);
423
+ }}
424
+ >
425
+ Clear All
426
+ </Button>
427
+ </Inline>
428
+ </Stack>
429
+ );
430
+ },
431
+ parameters: {
432
+ docs: {
433
+ description: {
434
+ story: 'Interactive example showing notification indicators with dynamic counts.',
435
+ },
436
+ },
437
+ },
438
+ };
439
+
440
+ export const UseCases: Story = {
441
+ render: () => (
442
+ <Stack gap="lg" w={600}>
443
+ <Title order={3} size="md" fw={500} mb="xs">Common Use Cases</Title>
444
+ <Box>
445
+ <Text size="sm" fw={500} mb="sm">1. User Status Indicators:</Text>
446
+ <Inline gap="lg">
447
+ <Indicator type="success" label="online" size={20}>
448
+ <Avatar variant="initials" initials="JD" />
449
+ </Indicator>
450
+ <Indicator type="info" label="offline" size={20}>
451
+ <Avatar variant="initials" initials="AS" />
452
+ </Indicator>
453
+ <Indicator type="default" label="disabled" size={20}>
454
+ <Avatar variant="initials" initials="MJ" />
455
+ </Indicator>
456
+ </Inline>
457
+ </Box>
458
+
459
+ <Box>
460
+ <Text size="sm" fw={500} mb="sm">2. Notification Badges:</Text>
461
+ <Inline gap="md">
462
+ <Indicator type="danger" count={12} size={18}>
463
+ <Button variant="outline">Inbox</Button>
464
+ </Indicator>
465
+ <Indicator type="info" count={3} size={16}>
466
+ <Button variant="outline">Updates</Button>
467
+ </Indicator>
468
+ <Indicator type="success" label="NEW" size={18}>
469
+ <Button variant="outline">Features</Button>
470
+ </Indicator>
471
+ </Inline>
472
+ </Box>
473
+
474
+ <Box>
475
+ <Text size="sm" fw={500} mb="sm">3. Status Indicators:</Text>
476
+ <Inline gap="md">
477
+ <Indicator type="success" label="✓" size={16}>
478
+ <Badge variant="outline" color="success" size="md">
479
+ Completed Task
480
+ </Badge>
481
+ </Indicator>
482
+ <Indicator type="danger" label="!" size={16}>
483
+ <Badge variant="outline" color="danger" size="md">
484
+ Error State
485
+ </Badge>
486
+ </Indicator>
487
+ <Indicator type="pending" processing size={12}>
488
+ <Badge variant="outline" color="pending" size="md">
489
+ Processing
490
+ </Badge>
491
+ </Indicator>
492
+ </Inline>
493
+ </Box>
494
+
495
+ <Box>
496
+ <Text size="sm" fw={500} mb="sm">4. Menu Item Indicators:</Text>
497
+ <Paper w={300} variant="border-shadow">
498
+ <Indicator type="danger" count={5} position="middle-start" size={16}>
499
+ <NavLink label="Messages" />
500
+ </Indicator>
501
+ <Indicator type="info" count={2} position="middle-start" size={16}>
502
+ <NavLink label="Notifications" />
503
+ </Indicator>
504
+ <Indicator type="success" count={7} position="middle-start" size={16}>
505
+ <NavLink label="Trash" />
506
+ </Indicator>
507
+ </Paper>
508
+ </Box>
509
+ </Stack>
510
+ ),
511
+ parameters: {
512
+ docs: {
513
+ description: {
514
+ story: 'Real-world examples of Indicator usage in different application contexts.',
515
+ },
516
+ },
517
+ },
518
+ };
519
+
520
+
521
+ export const MinimumSizeDemo: Story = {
522
+ render: () => (
523
+ <Stack gap="lg">
524
+ <Inline gap="xl">
525
+ <Text size="sm" fw={500}>Dots (no content) - Always circular:</Text>
526
+ <Indicator type="danger" size={4}>
527
+ <Avatar variant="initials" initials="T1" />
528
+ </Indicator>
529
+ <Indicator type="success" size={6}>
530
+ <Avatar variant="initials" initials="T2" />
531
+ </Indicator>
532
+ <Indicator type="info" size={8}>
533
+ <Avatar variant="initials" initials="T3" />
534
+ </Indicator>
535
+ <Indicator type="pending" size={12}>
536
+ <Avatar variant="initials" initials="T4" />
537
+ </Indicator>
538
+ </Inline>
539
+ </Stack>
540
+ ),
541
+ parameters: {
542
+ docs: {
543
+ description: {
544
+ story: 'Demonstration of minimum size behavior. Indicators without content are always perfect circles (dots), while indicators with content become pill-shaped with circular ends. The size prop sets the minimum dimensions in pixels, but the indicator cannot be smaller than a circle.',
545
+ },
546
+ },
547
+ },
548
+ };
549
+
550
+
551
+ export const Interactive: Story = {
552
+ args: {
553
+ type: 'info',
554
+ size: 12,
555
+ position: 'top-end',
556
+ count: 5,
557
+ withBorder: false,
558
+ processing: false,
559
+ disabled: false,
560
+ children: (
561
+ <Avatar variant="initials" initials="IN" />
562
+ ),
563
+ },
564
+ parameters: {
565
+ docs: {
566
+ description: {
567
+ story: 'Use the controls below to interact with the Indicator and see different combinations.',
568
+ },
569
+ },
570
+ },
571
+ };