aural-ui 3.0.7 → 4.1.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 (183) hide show
  1. package/dist/components/aspect-ratio/AspectRatio.stories.tsx +290 -1199
  2. package/dist/components/avatar/Avatar.stories.tsx +235 -237
  3. package/dist/components/badge/Badge.stories.tsx +379 -116
  4. package/dist/components/banner/Banner.stories.tsx +445 -391
  5. package/dist/components/breadcrumb/Breadcrumb.stories.tsx +453 -199
  6. package/dist/components/button/Button.stories.tsx +585 -230
  7. package/dist/components/button/index.tsx +7 -7
  8. package/dist/components/card/Card.stories.tsx +619 -301
  9. package/dist/components/char-count/CharCount.stories.tsx +350 -248
  10. package/dist/components/checkbox/Checkbox.stories.tsx +309 -167
  11. package/dist/components/chip/Chip.stories.tsx +362 -168
  12. package/dist/components/circular-loader/CircularLoader.stories.tsx +221 -620
  13. package/dist/components/clamp-lines/ClampLines.stories.tsx +246 -117
  14. package/dist/components/collapsible/Collapsible.stories.tsx +391 -252
  15. package/dist/components/command/Command.stories.tsx +533 -856
  16. package/dist/components/dialog/Dialog.stories.tsx +505 -949
  17. package/dist/components/divider/Divider.stories.tsx +265 -502
  18. package/dist/components/dot-loader/DotLoader.stories.tsx +256 -257
  19. package/dist/components/drawer/Drawer.stories.tsx +659 -993
  20. package/dist/components/drawer/index.tsx +3 -3
  21. package/dist/components/dropdown/Dropdown.stories.tsx +643 -1018
  22. package/dist/components/form/Form.stories.tsx +560 -274
  23. package/dist/components/helper-text/HelperText.stories.tsx +199 -200
  24. package/dist/components/hover-card/HoverCard.stories.tsx +318 -1221
  25. package/dist/components/icon-button/IconButton.stories.tsx +837 -194
  26. package/dist/components/if-else/if-else.stories.tsx +370 -83
  27. package/dist/components/input/Input.stories.tsx +436 -368
  28. package/dist/components/label/Label.stories.tsx +156 -154
  29. package/dist/components/list/List.stories.tsx +485 -822
  30. package/dist/components/marquee/Marquee.stories.tsx +356 -694
  31. package/dist/components/otp-inputs/OtpInputs.stories.tsx +352 -410
  32. package/dist/components/overlay/Overlay.stories.tsx +452 -818
  33. package/dist/components/overlay/index.tsx +4 -4
  34. package/dist/components/pagination/Pagination.stories.tsx +721 -210
  35. package/dist/components/popover/Popover.stories.tsx +484 -873
  36. package/dist/components/radio/Radio.stories.tsx +432 -124
  37. package/dist/components/resizable/Resizable.stories.tsx +496 -752
  38. package/dist/components/scroll-area/ScrollArea.stories.tsx +384 -1006
  39. package/dist/components/search/Search.stories.tsx +314 -575
  40. package/dist/components/select/Select.stories.tsx +684 -787
  41. package/dist/components/sheet/Sheet.stories.tsx +671 -936
  42. package/dist/components/skelton/Skelton.stories.tsx +230 -764
  43. package/dist/components/slider/Slider.stories.tsx +384 -737
  44. package/dist/components/stepper/Stepper.stories.tsx +371 -514
  45. package/dist/components/switch/Switch.stories.tsx +461 -208
  46. package/dist/components/switch-case/SwitchCase.stories.tsx +367 -188
  47. package/dist/components/table/Table.stories.tsx +770 -914
  48. package/dist/components/tabs/Tabs.stories.tsx +459 -1400
  49. package/dist/components/tag/Tag.stories.tsx +714 -542
  50. package/dist/components/textarea/TextArea.stories.tsx +621 -562
  51. package/dist/components/thumbnail-tags/ThumbnailTags.stories.tsx +228 -148
  52. package/dist/components/toast/Toast.stories.tsx +452 -1333
  53. package/dist/components/toggle/Toggle.stories.tsx +488 -909
  54. package/dist/components/tooltip/Tooltip.stories.tsx +344 -1372
  55. package/dist/components/typography/Typography.stories.tsx +406 -89
  56. package/dist/hooks/use-change-state/UseChangeState.stories.tsx +309 -606
  57. package/dist/hooks/use-previous/UsePrevious.stories.tsx +367 -917
  58. package/dist/hooks/use-standalone-pagination/UseStandalonePagination.stories.tsx +639 -867
  59. package/dist/icons/Icons.stories.tsx +0 -12
  60. package/dist/icons/ai-avatar-icon/AiAvatarIcon.stories.tsx +226 -1013
  61. package/dist/icons/alert-icon/AlertIcon.stories.tsx +109 -929
  62. package/dist/icons/all-icons.tsx +124 -87
  63. package/dist/icons/angle-down-icon/AngleDownIcon.stories.tsx +140 -971
  64. package/dist/icons/apple-logo-icon/AppleLogoIcon.stories.tsx +148 -888
  65. package/dist/icons/arrow-box-left-icon/ArrowBoxLeftIcon.stories.tsx +135 -1019
  66. package/dist/icons/arrow-corner-up-left-icon/ArrowCornerUpLeftIcon.stories.tsx +137 -953
  67. package/dist/icons/arrow-corner-up-right-icon/ArrowCornerUpRightIcon.stories.tsx +138 -997
  68. package/dist/icons/arrow-left-icon/ArrowLeftIcon.stories.tsx +136 -942
  69. package/dist/icons/arrow-right-icon/ArrowRightIcon.stories.tsx +148 -1092
  70. package/dist/icons/arrow-right-up-icon/ArrowRightUpIcon.stories.tsx +146 -1211
  71. package/dist/icons/art-board-icon/ArtBoardIcon.stories.tsx +126 -615
  72. package/dist/icons/audio-bar-icon/AudioBarIcon.stories.tsx +144 -1164
  73. package/dist/icons/backward-ten-seconds-icon/BackwardTenSecondsIcon.stories.tsx +167 -985
  74. package/dist/icons/bubble-check-icon/BubbleCheckIcon.stories.tsx +122 -1179
  75. package/dist/icons/bubble-crossed-icon/BubbleCrossedIcon.stories.tsx +124 -1168
  76. package/dist/icons/bubble-sparkle-icon/BubbleSparkleIcon.stories.tsx +119 -850
  77. package/dist/icons/camera-icon/CameraIcon.stories.tsx +112 -1213
  78. package/dist/icons/capital-a-letter-icon/CapitalALetterIcon.stories.tsx +117 -934
  79. package/dist/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.stories.tsx +160 -961
  80. package/dist/icons/chevron-double-right-icon/ChevronDoubleRightIcon.stories.tsx +163 -961
  81. package/dist/icons/chevron-down-icon/ChevronDownIcon.stories.tsx +144 -942
  82. package/dist/icons/chevron-left-icon/ChevronLeftIcon.stories.tsx +129 -966
  83. package/dist/icons/chevron-right-icon/ChevronRightIcon.stories.tsx +147 -964
  84. package/dist/icons/chevron-up-icon/ChevronUpIcon.stories.tsx +145 -975
  85. package/dist/icons/circle-tick-icon/CircleTickIcon.stories.tsx +150 -1142
  86. package/dist/icons/circular-play-icon/CircularPlayIcon.stories.tsx +114 -461
  87. package/dist/icons/coin-icon/CoinIcon.stories.tsx +124 -1322
  88. package/dist/icons/coin-toons-icon/CoinToonsIcon.stories.tsx +117 -1318
  89. package/dist/icons/column-wide-add-icon/ColumnWideAddIcon.stories.tsx +114 -903
  90. package/dist/icons/command-icon/CommandIcon.stories.tsx +127 -1042
  91. package/dist/icons/copy-icon/CopyIcon.stories.tsx +123 -962
  92. package/dist/icons/cross-circle-icon/CrossCircleIcon.stories.tsx +147 -999
  93. package/dist/icons/cross-icon/CrossIcon.stories.tsx +139 -960
  94. package/dist/icons/download-icon/DownloadIcon.stories.tsx +126 -820
  95. package/dist/icons/edit-big-icon/EditBigIcon.stories.tsx +124 -1031
  96. package/dist/icons/email-icon/EmailIcon.stories.tsx +115 -936
  97. package/dist/icons/expand-icon/ExpandIcon.stories.tsx +112 -1111
  98. package/dist/icons/eye-close-icon/EyeCloseIcon.stories.tsx +144 -1025
  99. package/dist/icons/eye-open-icon/EyeOpenIcon.stories.tsx +143 -1036
  100. package/dist/icons/feature-shine-icon/FeatureShineIcon.stories.tsx +127 -1011
  101. package/dist/icons/file-chart-icon/FileChartIcon.stories.tsx +126 -1056
  102. package/dist/icons/file-text-icon/FileTextIcon.stories.tsx +125 -614
  103. package/dist/icons/filter-bar-row-icon/FilterBarRowIcon.stories.tsx +119 -1050
  104. package/dist/icons/forward-ten-seconds-icon/ForwardTenSecondsIcon.stories.tsx +169 -989
  105. package/dist/icons/git-branch-icon/GitBranchIcon.stories.tsx +115 -1145
  106. package/dist/icons/git-fork-icon/GitForkIcon.stories.tsx +115 -1122
  107. package/dist/icons/globe-icon/GlobeIcon.stories.tsx +130 -313
  108. package/dist/icons/google-logo-icon/GoogleLogoIcon.stories.tsx +145 -940
  109. package/dist/icons/grip-vertical-icon/GripVerticalIcon.stories.tsx +119 -1174
  110. package/dist/icons/head-icon/HeadIcon.stories.tsx +111 -916
  111. package/dist/icons/heart-icon/HeartIcon.stories.tsx +120 -1019
  112. package/dist/icons/image-avatar-sparkle-icon/ImageAvatarSparkleIcon.stories.tsx +119 -683
  113. package/dist/icons/image-icon/ImageIcon.stories.tsx +105 -1121
  114. package/dist/icons/import-folder-icon/ImportFolderIcon.stories.tsx +111 -1192
  115. package/dist/icons/import-left-arrow-folder-icon/ImportLeftArrowFolderIcon.stories.tsx +136 -1256
  116. package/dist/icons/indian-flag-icon/IndianFlagIcon.stories.tsx +159 -962
  117. package/dist/icons/instagram-icon/InstagramIcon.stories.tsx +161 -1385
  118. package/dist/icons/layout-column-icon/LayoutColumnIcon.stories.tsx +124 -972
  119. package/dist/icons/layout-left-icon/LayoutLeftIcon.stories.tsx +119 -948
  120. package/dist/icons/layout-right-icon/LayoutRightIcon.stories.tsx +119 -942
  121. package/dist/icons/light-bulb-simple-icon/LightBulbSimpleIcon.stories.tsx +108 -1215
  122. package/dist/icons/linked-in-icon/LinkedInIcon.stories.tsx +154 -1517
  123. package/dist/icons/magic-book-icon/MagicBookIcon.stories.tsx +110 -1188
  124. package/dist/icons/magic-edit-icon/MagicEditIcon.stories.tsx +119 -678
  125. package/dist/icons/maintenance-icon/MaintenanceIcon.stories.tsx +123 -1184
  126. package/dist/icons/message-icon/MessageIcon.stories.tsx +114 -538
  127. package/dist/icons/minimize-icon/MinimizeIcon.stories.tsx +116 -1158
  128. package/dist/icons/moon-icon/MoonIcon.stories.tsx +120 -536
  129. package/dist/icons/move-horizontal-icon/MoveHorizontalIcon.stories.tsx +109 -1184
  130. package/dist/icons/move-vertical-icon/MoveVerticalIcon.stories.tsx +115 -1134
  131. package/dist/icons/musical-note-icon/MusicalNoteIcon.stories.tsx +119 -971
  132. package/dist/icons/notepad-icon/NotepadIcon.stories.tsx +111 -1100
  133. package/dist/icons/notes-icon/NotesIcon.stories.tsx +119 -1101
  134. package/dist/icons/page-search-icon/PageSearchIcon.stories.tsx +109 -1111
  135. package/dist/icons/page-text-icon/PageTextIcon.stories.tsx +122 -684
  136. package/dist/icons/paint-roll-icon/PaintRollIcon.stories.tsx +113 -954
  137. package/dist/icons/paper-plane-icon/PaperPlaneIcon.stories.tsx +112 -877
  138. package/dist/icons/pause-icon/PauseIcon.stories.tsx +113 -1000
  139. package/dist/icons/pencil-icon/PencilIcon.stories.tsx +115 -1070
  140. package/dist/icons/phone-icon/PhoneIcon.stories.tsx +115 -978
  141. package/dist/icons/plus-icon/PlusIcon.stories.tsx +106 -1093
  142. package/dist/icons/pocket-studio-icon/PocketStudioIcon.stories.tsx +107 -829
  143. package/dist/icons/scroll-down-icon/ScrollDownIcon.stories.tsx +102 -469
  144. package/dist/icons/search-icon/SearchIcon.stories.tsx +111 -1124
  145. package/dist/icons/setting-icon/SettingIcon.stories.tsx +107 -970
  146. package/dist/icons/share-icon/ShareIcon.stories.tsx +120 -1025
  147. package/dist/icons/shield-icon/ShieldIcon.stories.tsx +117 -931
  148. package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +137 -1104
  149. package/dist/icons/skip-backward-icon/SkipBackwardIcon.stories.tsx +172 -982
  150. package/dist/icons/skip-forward-icon/SkipForwardIcon.stories.tsx +164 -983
  151. package/dist/icons/sparkles-soft-icon/SparklesSoftIcon.stories.tsx +105 -958
  152. package/dist/icons/spinner-gradient-icon/SpinnerGradientIcon.stories.tsx +158 -580
  153. package/dist/icons/spinner-gradient-icon/index.tsx +6 -1
  154. package/dist/icons/spinner-solid-icon/SpinnerSolidIcon.stories.tsx +158 -587
  155. package/dist/icons/spinner-solid-icon/index.tsx +6 -1
  156. package/dist/icons/spinner-solid-neutral-icon/SpinnerSolidINeutralcon.stories.tsx +146 -682
  157. package/dist/icons/spinner-solid-neutral-icon/index.tsx +1 -1
  158. package/dist/icons/star-icon/StarIcon.stories.tsx +124 -904
  159. package/dist/icons/store-coin-icon/StoreCoinIcon.stories.tsx +112 -964
  160. package/dist/icons/suggestion-icon/SuggestionIcon.stories.tsx +116 -852
  161. package/dist/icons/sun-icon/SunIcon.stories.tsx +120 -831
  162. package/dist/icons/text-color-icon/TextColorIcon.stories.tsx +116 -950
  163. package/dist/icons/text-indicator-icon/TextIndicatorIcon.stories.tsx +123 -980
  164. package/dist/icons/threads-icon/ThreadsIcon.stories.tsx +156 -1427
  165. package/dist/icons/tick-circle-icon/TickCircleIcon.stories.tsx +146 -1142
  166. package/dist/icons/tick-icon/TickIcon.stories.tsx +145 -1276
  167. package/dist/icons/trash-icon/TrashIcon.stories.tsx +108 -933
  168. package/dist/icons/twitter-x-icon/TwitterXIcon.stories.tsx +157 -1402
  169. package/dist/icons/upload-icon/UploadIcon.stories.tsx +115 -889
  170. package/dist/icons/vertical-menu-icon/VerticalMenuIcon.stories.tsx +118 -984
  171. package/dist/icons/video-play-list-icon/VideoPlaylistIcon.stories.tsx +125 -1049
  172. package/dist/icons/voice-playing-icon/VoicePlayingIcon.stories.tsx +123 -1356
  173. package/dist/icons/volume-full-icon/VolumeFullIcon.stories.tsx +110 -1171
  174. package/dist/icons/volume-half-icon/VolumeHalfIcon.stories.tsx +112 -1093
  175. package/dist/icons/volume-off-icon/VolumeOffIcon.stories.tsx +115 -1087
  176. package/dist/icons/warning-icon/WarningIcon.stories.tsx +122 -1046
  177. package/dist/icons/youtube-icon/YoutubeIcon.stories.tsx +161 -936
  178. package/dist/index.cjs +84 -84
  179. package/dist/index.js +84 -84
  180. package/dist/styles/aural-all-theme.css +1222 -0
  181. package/dist/styles/{aural-theme.css → aural-dark-theme.css} +15 -3
  182. package/dist/styles/aural-light-theme.css +1047 -0
  183. package/package.json +1 -1
@@ -1,6 +1,8 @@
1
1
  import React from "react"
2
2
  import type { Meta, StoryObj } from "@storybook/react-vite"
3
3
 
4
+ import { AuralComponentDocsPage } from "src/ui/story-spec/components/component-story-docs-page"
5
+
4
6
  import DotLoader from "."
5
7
 
6
8
  const meta: Meta<typeof DotLoader> = {
@@ -10,77 +12,44 @@ const meta: Meta<typeof DotLoader> = {
10
12
  layout: "centered",
11
13
  docs: {
12
14
  description: {
13
- component: `
14
- # DotLoader
15
-
16
- A customizable animated dot loader component with three dots that pulse in sequence, built with accessibility in mind.
17
-
18
- ## Features
19
- - Smooth pulsing animation with CSS custom properties
20
- - Customizable colors for normal and active states
21
- - Optional text label with flexible content support
22
- - Comprehensive accessibility features (ARIA attributes, screen reader support)
23
- - Flexible styling with custom classes
24
- - Dark theme optimized
25
- - Screen reader announcements with configurable messages
26
-
27
- ## Accessibility Features
28
- - \`role="status"\` for proper semantic meaning
29
- - \`aria-live="polite"\` for non-intrusive screen reader announcements
30
- - \`aria-busy="true"\` to indicate loading state
31
- - Hidden descriptive text for screen readers
32
- - Configurable ARIA labels and loading messages
33
- - Decorative elements properly hidden from assistive technology
34
-
35
- ## Usage
36
- \`\`\`tsx
37
- import DotLoader from '@/ui/components/dot-loader'
38
-
39
- // Basic usage
40
- <DotLoader />
41
-
42
- // With text
43
- <DotLoader text="Loading..." />
44
-
45
- // Custom colors and accessibility
46
- <DotLoader
47
- color="var(--color-blue-500)"
48
- activeDotColor="var(--color-blue-300)"
49
- text="Processing..."
50
- ariaLabel="Processing user data"
51
- loadingMessage="User data is being processed, please wait"
52
- />
53
-
54
- // Silent loading (no screen reader announcements)
55
- <DotLoader
56
- text="Background sync"
57
- announceToScreenReader={false}
58
- />
59
- \`\`\`
60
- `,
15
+ component:
16
+ "An animated three-dot loading indicator that pulses in sequence. Supports optional visible text, custom dot colors via design tokens, and comprehensive ARIA attributes for screen reader compatibility.",
61
17
  },
62
- },
63
- backgrounds: {
64
- default: "dark",
65
- values: [
66
- { name: "dark", value: "#1a1a1a" },
67
- { name: "light", value: "#ffffff" },
68
- ],
18
+ page: () => (
19
+ <AuralComponentDocsPage
20
+ features={[
21
+ {
22
+ title: "Pulsing Animation",
23
+ description: "Sequenced dot animation",
24
+ },
25
+ {
26
+ title: "Token Colors",
27
+ description: "Active & inactive dots",
28
+ },
29
+ {
30
+ title: "ARIA Support",
31
+ description: "aria-live and role built in",
32
+ },
33
+ ]}
34
+ />
35
+ ),
69
36
  },
70
37
  },
38
+ tags: ["autodocs"],
71
39
  argTypes: {
72
40
  text: {
73
41
  control: "text",
74
- description:
75
- "Optional text to display below the loader (supports React nodes)",
42
+ description: "Optional visible text displayed below the dots",
76
43
  },
77
44
  color: {
78
- control: "color",
79
- description: "Color of the inactive dots",
45
+ control: "text",
46
+ description:
47
+ "CSS value for the inactive dot color (use design token var() references)",
80
48
  },
81
49
  activeDotColor: {
82
- control: "color",
83
- description: "Color of the active/pulsing dot",
50
+ control: "text",
51
+ description:
52
+ "CSS value for the active/pulsing dot color (use design token var() references)",
84
53
  },
85
54
  className: {
86
55
  control: "text",
@@ -93,143 +62,187 @@ import DotLoader from '@/ui/components/dot-loader'
93
62
  },
94
63
  ariaLabel: {
95
64
  control: "text",
96
- description: "Accessible label for screen readers",
65
+ description: "Accessible label announced by screen readers",
97
66
  },
98
67
  announceToScreenReader: {
99
68
  control: "boolean",
100
- description: "Whether to announce loading state to screen readers",
69
+ description:
70
+ "Whether to add aria-live='polite' for screen reader announcements",
101
71
  },
102
72
  loadingMessage: {
103
73
  control: "text",
104
- description: "Custom loading message for screen readers",
74
+ description: "Hidden descriptive message read by screen readers",
105
75
  },
106
76
  },
107
- tags: ["autodocs"],
108
77
  }
109
78
 
110
79
  export default meta
111
80
  type Story = StoryObj<typeof meta>
112
81
 
113
- // Default story
114
- export const Default: Story = {
115
- args: {},
116
- }
82
+ // ─── 1. Playground ────────────────────────────────────────────────────────────
117
83
 
118
- // With text
119
- export const WithText: Story = {
84
+ export const Playground: Story = {
120
85
  args: {
121
86
  text: "Loading...",
122
- },
123
- }
124
-
125
- // Custom colors
126
- export const CustomColors: Story = {
127
- args: {
128
- text: "Processing...",
129
- color: "#64748b",
130
- activeDotColor: "#3b82f6",
131
- },
132
- }
133
-
134
- // Brand colors
135
- export const BrandColors: Story = {
136
- args: {
137
- text: "Please wait",
138
87
  color: "var(--color-fm-secondary-800)",
139
88
  activeDotColor: "var(--color-fm-secondary-500)",
140
- },
141
- }
142
-
143
- // Accessibility focused story
144
- export const AccessibilityFeatures: Story = {
145
- args: {
146
- text: "Loading user profile",
147
- ariaLabel: "Loading user profile data",
148
- loadingMessage: "User profile data is being loaded, please wait",
89
+ ariaLabel: "Loading",
149
90
  announceToScreenReader: true,
91
+ loadingMessage: "Content is loading, please wait",
150
92
  },
93
+ render: (args) => (
94
+ <div className="w-full max-w-sm space-y-4">
95
+ <div className="flex justify-center py-4">
96
+ <DotLoader {...args} />
97
+ </div>
98
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border px-4 py-3">
99
+ <code className="text-fm-secondary text-fm-md leading-fm-md font-(--font-fm-mono)">
100
+ {`<DotLoader${args.text ? ` text="${args.text}"` : ""}${args.ariaLabel ? ` ariaLabel="${args.ariaLabel}"` : ""} />`}
101
+ </code>
102
+ </div>
103
+ </div>
104
+ ),
151
105
  parameters: {
152
106
  docs: {
153
107
  description: {
154
108
  story:
155
- "Demonstrates accessibility features with custom ARIA labels and screen reader messages.",
109
+ "Adjust text, dot colors, and accessibility props using the controls panel in the sidebar.",
156
110
  },
157
111
  },
158
112
  },
159
113
  }
160
114
 
161
- // Silent loading (no screen reader announcements)
162
- export const SilentLoading: Story = {
163
- args: {
164
- text: "Background sync",
165
- announceToScreenReader: false,
166
- ariaLabel: "Background synchronization",
167
- },
168
- parameters: {
169
- docs: {
170
- description: {
171
- story:
172
- "Example of a loader that doesn't announce to screen readers, useful for background processes.",
173
- },
174
- },
175
- },
176
- }
115
+ // ─── 2. Configurations ────────────────────────────────────────────────────────
177
116
 
178
- // Large with custom styling
179
- export const CustomStyling: Story = {
180
- args: {
181
- text: "Loading your content...",
182
- className: "p-8",
183
- classes: {
184
- root: "bg-slate-800 rounded-lg p-6",
185
- dot: "scale-150",
186
- text: "text-slate-300 text-lg font-semibold",
187
- },
188
- ariaLabel: "Loading content",
189
- loadingMessage: "Content is being loaded with custom styling",
190
- },
191
- }
192
-
193
- // Different color variations
194
- export const ColorVariations: Story = {
117
+ export const Configurations: Story = {
195
118
  render: () => (
196
- <div className="flex flex-col gap-8">
197
- <div className="text-center">
198
- <h3 className="mb-4 text-lg text-white">Default Theme</h3>
199
- <DotLoader text="Loading..." ariaLabel="Loading default content" />
119
+ <div className="space-y-8">
120
+ <div className="space-y-4">
121
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
122
+ Text Options
123
+ </h4>
124
+ <div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
125
+ <div className="space-y-3 text-center">
126
+ <div className="flex min-h-24 items-center justify-center">
127
+ <DotLoader ariaLabel="Loading" />
128
+ </div>
129
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
130
+ No Text
131
+ </p>
132
+ </div>
133
+ <div className="space-y-3 text-center">
134
+ <div className="flex min-h-24 items-center justify-center">
135
+ <DotLoader text="Loading..." ariaLabel="Loading content" />
136
+ </div>
137
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
138
+ With Text
139
+ </p>
140
+ </div>
141
+ <div className="space-y-3 text-center">
142
+ <div className="flex min-h-24 items-center justify-center">
143
+ <DotLoader
144
+ text="Uploading your files..."
145
+ ariaLabel="Uploading files"
146
+ />
147
+ </div>
148
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
149
+ Longer Text
150
+ </p>
151
+ </div>
152
+ </div>
200
153
  </div>
201
154
 
202
- <div className="text-center">
203
- <h3 className="mb-4 text-lg text-white">Blue Theme</h3>
204
- <DotLoader
205
- text="Processing..."
206
- color="#1e293b"
207
- activeDotColor="#3b82f6"
208
- ariaLabel="Processing data"
209
- loadingMessage="Data processing in progress"
210
- />
155
+ <div className="space-y-4">
156
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
157
+ Custom Colors (Design Tokens)
158
+ </h4>
159
+ <div className="grid gap-6 sm:grid-cols-2 xl:grid-cols-4">
160
+ <div className="space-y-3 text-center">
161
+ <div className="flex min-h-24 items-center justify-center">
162
+ <DotLoader
163
+ text="Default"
164
+ color="var(--color-fm-secondary-800)"
165
+ activeDotColor="var(--color-fm-secondary-500)"
166
+ ariaLabel="Loading with brand colors"
167
+ />
168
+ </div>
169
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
170
+ Brand (Secondary)
171
+ </p>
172
+ </div>
173
+ <div className="space-y-3 text-center">
174
+ <div className="flex min-h-24 items-center justify-center">
175
+ <DotLoader
176
+ text="Positive"
177
+ color="var(--color-fm-green-900)"
178
+ activeDotColor="var(--color-fm-green-500)"
179
+ ariaLabel="Loading with positive indicator"
180
+ />
181
+ </div>
182
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
183
+ Positive
184
+ </p>
185
+ </div>
186
+ <div className="space-y-3 text-center">
187
+ <div className="flex min-h-24 items-center justify-center">
188
+ <DotLoader
189
+ text="Info"
190
+ color="var(--color-fm-blue-900)"
191
+ activeDotColor="var(--color-fm-blue-500)"
192
+ ariaLabel="Loading with info indicator"
193
+ />
194
+ </div>
195
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
196
+ Info
197
+ </p>
198
+ </div>
199
+ <div className="space-y-3 text-center">
200
+ <div className="flex min-h-24 items-center justify-center">
201
+ <DotLoader
202
+ text="Warning"
203
+ color="var(--color-fm-yellow-800)"
204
+ activeDotColor="var(--color-fm-yellow-500)"
205
+ ariaLabel="Loading with warning indicator"
206
+ />
207
+ </div>
208
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
209
+ Warning
210
+ </p>
211
+ </div>
212
+ </div>
211
213
  </div>
212
214
 
213
- <div className="text-center">
214
- <h3 className="mb-4 text-lg text-white">Green Theme</h3>
215
- <DotLoader
216
- text="Uploading..."
217
- color="#1f2937"
218
- activeDotColor="#10b981"
219
- ariaLabel="Uploading files"
220
- loadingMessage="Files are being uploaded"
221
- />
222
- </div>
223
-
224
- <div className="text-center">
225
- <h3 className="mb-4 text-lg text-white">Red Theme</h3>
226
- <DotLoader
227
- text="Deleting..."
228
- color="#1f2937"
229
- activeDotColor="#ef4444"
230
- ariaLabel="Deleting items"
231
- loadingMessage="Items are being deleted"
232
- />
215
+ <div className="space-y-4">
216
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
217
+ Screen Reader Announcement Mode
218
+ </h4>
219
+ <div className="grid gap-6 sm:grid-cols-2">
220
+ <div className="space-y-3 text-center">
221
+ <div className="flex min-h-24 items-center justify-center">
222
+ <DotLoader
223
+ text="Syncing..."
224
+ announceToScreenReader={true}
225
+ ariaLabel="Syncing data"
226
+ loadingMessage="Data is being synced with the server, please wait"
227
+ />
228
+ </div>
229
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
230
+ Announced (aria-live)
231
+ </p>
232
+ </div>
233
+ <div className="space-y-3 text-center">
234
+ <div className="flex min-h-24 items-center justify-center">
235
+ <DotLoader
236
+ text="Background sync"
237
+ announceToScreenReader={false}
238
+ ariaLabel="Background synchronization"
239
+ />
240
+ </div>
241
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
242
+ Silent (no aria-live)
243
+ </p>
244
+ </div>
245
+ </div>
233
246
  </div>
234
247
  </div>
235
248
  ),
@@ -237,58 +250,93 @@ export const ColorVariations: Story = {
237
250
  docs: {
238
251
  description: {
239
252
  story:
240
- "Examples of different color combinations for various use cases, each with appropriate accessibility labels.",
253
+ "Configuration options: text presence, custom dot colors using design token CSS variables, and screen reader announcement mode.",
241
254
  },
242
255
  },
243
256
  },
244
257
  }
245
258
 
246
- // Loading states simulation
247
- export const LoadingStates: Story = {
248
- render: () => (
249
- <div className="grid grid-cols-2 gap-8">
250
- <div className="rounded-lg bg-slate-800 p-6 text-center">
251
- <h4 className="mb-4 text-sm text-white">File Upload</h4>
252
- <DotLoader
253
- text="Uploading files..."
254
- color="#374151"
255
- activeDotColor="#06b6d4"
256
- ariaLabel="File upload in progress"
257
- loadingMessage="Files are being uploaded to the server"
258
- />
259
- </div>
259
+ // ─── 3. Accessibility ─────────────────────────────────────────────────────────
260
260
 
261
- <div className="rounded-lg bg-slate-800 p-6 text-center">
262
- <h4 className="mb-4 text-sm text-white">Data Processing</h4>
263
- <DotLoader
264
- text="Processing data..."
265
- color="#374151"
266
- activeDotColor="#8b5cf6"
267
- ariaLabel="Data processing"
268
- loadingMessage="Your data is being processed"
269
- />
270
- </div>
271
-
272
- <div className="rounded-lg bg-slate-800 p-6 text-center">
273
- <h4 className="mb-4 text-sm text-white">Authentication</h4>
274
- <DotLoader
275
- text="Signing in..."
276
- color="#374151"
277
- activeDotColor="#f59e0b"
278
- ariaLabel="Authentication in progress"
279
- loadingMessage="Please wait while we sign you in"
280
- />
261
+ export const Accessibility: Story = {
262
+ render: () => (
263
+ <div className="space-y-8">
264
+ <div className="space-y-4">
265
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
266
+ ARIA Attribute Examples
267
+ </h4>
268
+ <div className="flex flex-wrap items-start gap-8">
269
+ <div className="space-y-2 text-center">
270
+ <DotLoader
271
+ text="Loading user profile"
272
+ ariaLabel="Loading user profile data"
273
+ loadingMessage="User profile data is being loaded, please wait"
274
+ announceToScreenReader={true}
275
+ />
276
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
277
+ Visual + SR message
278
+ </p>
279
+ </div>
280
+ <div className="space-y-2 text-center">
281
+ <DotLoader
282
+ ariaLabel="Authenticating your account"
283
+ loadingMessage="Authentication is in progress, please wait"
284
+ announceToScreenReader={true}
285
+ />
286
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
287
+ SR label only (no text)
288
+ </p>
289
+ </div>
290
+ <div className="space-y-2 text-center">
291
+ <DotLoader
292
+ text="Saving changes"
293
+ announceToScreenReader={false}
294
+ ariaLabel="Saving document changes silently"
295
+ />
296
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
297
+ Silent background task
298
+ </p>
299
+ </div>
300
+ </div>
281
301
  </div>
282
302
 
283
- <div className="rounded-lg bg-slate-800 p-6 text-center">
284
- <h4 className="mb-4 text-sm text-white">Content Loading</h4>
285
- <DotLoader
286
- text="Loading content..."
287
- color="#374151"
288
- activeDotColor="#10b981"
289
- ariaLabel="Content loading"
290
- loadingMessage="Page content is being loaded"
291
- />
303
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
304
+ <p className="text-fm-secondary font-fm-text text-fm-md leading-fm-xl">
305
+ <strong className="text-fm-primary">Best practices:</strong>
306
+ </p>
307
+ <ul className="mt-2 space-y-1">
308
+ <li>
309
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
310
+ Always provide <code>ariaLabel</code> or <code>text</code> so
311
+ screen readers have context about what is loading.
312
+ </p>
313
+ </li>
314
+ <li>
315
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
316
+ • Use <code>loadingMessage</code> to supply a more detailed
317
+ description than the visible text, if they differ.
318
+ </p>
319
+ </li>
320
+ <li>
321
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
322
+ • Set <code>announceToScreenReader=false</code> for silent
323
+ background tasks that should not interrupt the user.
324
+ </p>
325
+ </li>
326
+ <li>
327
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
328
+ • The component uses <code>role="status"</code> and{" "}
329
+ <code>aria-busy="true"</code> automatically — no extra markup
330
+ needed.
331
+ </p>
332
+ </li>
333
+ <li>
334
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
335
+ • Decorative dot elements are hidden from assistive technology via{" "}
336
+ <code>aria-hidden="true"</code>.
337
+ </p>
338
+ </li>
339
+ </ul>
292
340
  </div>
293
341
  </div>
294
342
  ),
@@ -296,56 +344,7 @@ export const LoadingStates: Story = {
296
344
  docs: {
297
345
  description: {
298
346
  story:
299
- "Real-world examples of how the loader might be used in different contexts with appropriate accessibility descriptions.",
300
- },
301
- },
302
- },
303
- }
304
-
305
- // Complex content example
306
- export const ComplexContent: Story = {
307
- args: {
308
- text: (
309
- <div className="flex items-center gap-2">
310
- <span>Loading</span>
311
- <span className="font-bold text-blue-400">premium</span>
312
- <span>content...</span>
313
- </div>
314
- ),
315
- ariaLabel: "Loading premium content",
316
- loadingMessage: "Premium content is being loaded for your account",
317
- },
318
- parameters: {
319
- docs: {
320
- description: {
321
- story:
322
- "Example with complex React node content while maintaining accessibility.",
323
- },
324
- },
325
- },
326
- }
327
-
328
- // Playground story for interactive testing
329
- export const Playground: Story = {
330
- args: {
331
- text: "Loading...",
332
- color: "#64748b",
333
- activeDotColor: "#3b82f6",
334
- className: "",
335
- classes: {
336
- root: "",
337
- dot: "",
338
- text: "",
339
- },
340
- ariaLabel: "Loading",
341
- announceToScreenReader: true,
342
- loadingMessage: "Content is loading, please wait",
343
- },
344
- parameters: {
345
- docs: {
346
- description: {
347
- story:
348
- "Interactive playground to test all component props including accessibility features.",
347
+ "Proper ARIA attribute usage patterns for DotLoader covering visible-text loaders, screen-reader-only labels, and silent background tasks, with a best-practices reference at the bottom.",
349
348
  },
350
349
  },
351
350
  },