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,21 +1,42 @@
1
1
  import React from "react"
2
- import HelperText from "@components/helper-text"
2
+ import { EmailIcon } from "@icons/email-icon"
3
3
  import { AlertIcon, CrossIcon, TickIcon } from "@icons/index"
4
4
  import type { Meta, StoryObj } from "@storybook/react-vite"
5
5
 
6
+ import { AuralComponentDocsPage } from "src/ui/story-spec/components/component-story-docs-page"
7
+
6
8
  import Input from "."
7
9
 
10
+ // ─── Meta ─────────────────────────────────────────────────────────────────────
11
+
8
12
  const meta: Meta<typeof Input> = {
9
13
  title: "Components/UI/Input",
10
14
  component: Input,
11
15
  parameters: {
12
16
  layout: "centered",
13
- backgrounds: {
14
- default: "dark",
15
- values: [
16
- { name: "dark", value: "#0a0a0a" },
17
- { name: "light", value: "#ffffff" },
18
- ],
17
+ docs: {
18
+ description: {
19
+ component:
20
+ "A flexible text input built with atomic design principles. Supports four validation variants (default, error, warning, success), three decoration styles (underline, outline, filled), start/end icon slots, password toggle, character counting, and full accessibility via ARIA attributes.",
21
+ },
22
+ page: () => (
23
+ <AuralComponentDocsPage
24
+ features={[
25
+ {
26
+ title: "4 Validation States",
27
+ description: "Default to success",
28
+ },
29
+ {
30
+ title: "3 Decoration Styles",
31
+ description: "Underline, outline, filled",
32
+ },
33
+ {
34
+ title: "Icon Slots",
35
+ description: "Start and end icons",
36
+ },
37
+ ]}
38
+ />
39
+ ),
19
40
  },
20
41
  },
21
42
  tags: ["autodocs"],
@@ -23,419 +44,466 @@ const meta: Meta<typeof Input> = {
23
44
  variant: {
24
45
  control: { type: "select" },
25
46
  options: ["default", "error", "warning", "success"],
47
+ description: "Visual validation state",
48
+ },
49
+ decoration: {
50
+ control: { type: "select" },
51
+ options: ["underline", "outline", "filled"],
52
+ description: "Border and background style",
26
53
  },
27
54
  type: {
28
55
  control: { type: "select" },
29
56
  options: ["text", "email", "password", "number", "tel", "url"],
57
+ description: "HTML input type",
30
58
  },
31
- disabled: {
32
- control: { type: "boolean" },
33
- },
34
- required: {
35
- control: { type: "boolean" },
36
- },
37
- fullWidth: {
38
- control: { type: "boolean" },
39
- },
40
- transparentOnAutofill: {
41
- control: { type: "boolean" },
42
- },
59
+ disabled: { control: { type: "boolean" } },
60
+ required: { control: { type: "boolean" } },
61
+ fullWidth: { control: { type: "boolean" } },
62
+ label: { control: { type: "text" } },
63
+ placeholder: { control: { type: "text" } },
64
+ helperText: { control: { type: "text" } },
43
65
  },
44
- }
45
-
46
- export default meta
47
- type Story = StoryObj<typeof Input>
48
-
49
- // Basic variants
50
- export const Default: Story = {
51
- args: {
52
- label: "Default Input",
53
- placeholder: "Enter text here...",
54
- variant: "default",
55
- },
56
- }
57
-
58
- export const WithValue: Story = {
59
66
  args: {
60
- label: "Input with Value",
61
- value: "Pre-filled value",
62
67
  variant: "default",
68
+ decoration: "underline",
69
+ type: "text",
70
+ disabled: false,
71
+ required: false,
72
+ fullWidth: false,
73
+ label: "Label",
74
+ placeholder: "Placeholder…",
63
75
  },
64
76
  }
65
77
 
66
- export const Required: Story = {
67
- args: {
68
- label: "Required Field",
69
- placeholder: "This field is required",
70
- required: true,
71
- variant: "default",
72
- },
73
- }
74
-
75
- // Variants
76
- export const Error: Story = {
77
- args: {
78
- label: "Error Input",
79
- placeholder: "Enter valid email",
80
- variant: "error",
81
- helperText: "This field contains an error",
82
- value: "invalid-email",
83
- },
84
- }
85
-
86
- export const Warning: Story = {
87
- args: {
88
- label: "Warning Input",
89
- placeholder: "Enter password",
90
- variant: "warning",
91
- helperText: "Password strength is weak",
92
- value: "123",
93
- },
94
- }
78
+ export default meta
79
+ type Story = StoryObj<typeof Input>
95
80
 
96
- export const Success: Story = {
97
- args: {
98
- label: "Success Input",
99
- placeholder: "Enter email",
100
- variant: "success",
101
- helperText: "Email is valid",
102
- value: "user@example.com",
103
- },
104
- }
81
+ // ─── 1. Playground ────────────────────────────────────────────────────────────
105
82
 
106
- // States
107
- export const Disabled: Story = {
108
- args: {
109
- label: "Disabled Input",
110
- placeholder: "Cannot type here",
111
- disabled: true,
112
- value: "Disabled value",
113
- },
114
- }
115
-
116
- export const FullWidth: Story = {
117
- args: {
118
- label: "Full Width Input",
119
- placeholder: "This input takes full width",
120
- fullWidth: true,
121
- },
83
+ export const Playground: Story = {
122
84
  parameters: {
123
- layout: "padded",
124
- },
125
- }
126
-
127
- // Input types
128
- export const EmailInput: Story = {
129
- args: {
130
- label: "Email",
131
- type: "email",
132
- placeholder: "Enter your email",
133
- helperText: "We'll never share your email",
85
+ docs: {
86
+ description: {
87
+ story:
88
+ "Use the Storybook controls panel to configure every prop. The input below reflects your selections live.",
89
+ },
90
+ },
134
91
  },
92
+ render: (args) => (
93
+ <div className="w-full max-w-sm space-y-4">
94
+ <Input {...args} fullWidth />
95
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border px-4 py-3">
96
+ <code className="text-fm-secondary text-fm-md leading-fm-md font-(--font-fm-mono)">
97
+ {`<Input variant="${args.variant}" decoration="${args.decoration}" type="${args.type}"${args.disabled ? " disabled" : ""}${args.required ? " required" : ""} />`}
98
+ </code>
99
+ </div>
100
+ </div>
101
+ ),
135
102
  }
136
103
 
137
- export const PasswordInput: Story = {
138
- args: {
139
- label: "Password",
140
- type: "password",
141
- placeholder: "Enter your password",
142
- helperText: "Password must be at least 8 characters",
143
- },
144
- }
104
+ // ─── 2. AllVariants ───────────────────────────────────────────────────────────
145
105
 
146
- export const NumberInput: Story = {
147
- args: {
148
- label: "Age",
149
- type: "number",
150
- placeholder: "Enter your age",
106
+ export const AllVariants: Story = {
107
+ parameters: {
108
+ docs: {
109
+ description: {
110
+ story:
111
+ "Full matrix of all four validation variants (default, error, warning, success) across all three decoration styles (underline, outline, filled).",
112
+ },
113
+ },
151
114
  },
152
- }
115
+ render: () => {
116
+ const variants = [
117
+ { variant: "default" as const, label: "Default" },
118
+ { variant: "error" as const, label: "Error" },
119
+ { variant: "warning" as const, label: "Warning" },
120
+ { variant: "success" as const, label: "Success" },
121
+ ]
122
+ const decorations = [
123
+ { decoration: "underline" as const, label: "Underline" },
124
+ { decoration: "outline" as const, label: "Outline" },
125
+ { decoration: "filled" as const, label: "Filled" },
126
+ ]
153
127
 
154
- export const TelInput: Story = {
155
- args: {
156
- label: "Phone Number",
157
- type: "tel",
158
- placeholder: "Enter your phone number",
128
+ return (
129
+ <div className="space-y-8">
130
+ {decorations.map(({ decoration, label: decLabel }) => (
131
+ <div key={decoration}>
132
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
133
+ {decLabel}
134
+ </h4>
135
+ <div className="flex flex-wrap gap-6">
136
+ {variants.map(({ variant, label }) => (
137
+ <div key={variant} className="w-48 space-y-2 text-center">
138
+ <Input
139
+ label={label}
140
+ placeholder={`${label}…`}
141
+ variant={variant}
142
+ decoration={decoration}
143
+ helperText={
144
+ variant === "error"
145
+ ? "Something went wrong"
146
+ : variant === "warning"
147
+ ? "Double-check this value"
148
+ : variant === "success"
149
+ ? "Looks great!"
150
+ : "Helper text"
151
+ }
152
+ fullWidth
153
+ />
154
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
155
+ {label}
156
+ </p>
157
+ </div>
158
+ ))}
159
+ </div>
160
+ </div>
161
+ ))}
162
+ </div>
163
+ )
159
164
  },
160
165
  }
161
166
 
162
- export const UrlInput: Story = {
163
- args: {
164
- label: "Website",
165
- type: "url",
166
- placeholder: "https://example.com",
167
- },
168
- }
167
+ // ─── 3. Configurations ────────────────────────────────────────────────────────
169
168
 
170
- // With icons
171
- export const WithStartIcon: Story = {
172
- args: {
173
- label: "Search",
174
- placeholder: "Search for items...",
175
- startIcon: <TickIcon className="h-4 w-4 text-gray-400" />,
169
+ export const Configurations: Story = {
170
+ parameters: {
171
+ docs: {
172
+ description: {
173
+ story:
174
+ "Non-variant configuration axes: start icon, end icon, both icons together, and different input types (email, password with toggle, number).",
175
+ },
176
+ },
176
177
  },
177
- }
178
+ render: () => (
179
+ <div className="w-full max-w-sm space-y-8">
180
+ {/* Start icon */}
181
+ <div>
182
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
183
+ Start Icon
184
+ </h4>
185
+ <div className="flex flex-wrap gap-4">
186
+ <div className="w-full space-y-2 text-center">
187
+ <Input
188
+ label="Search"
189
+ placeholder="Search…"
190
+ decoration="outline"
191
+ startIcon={<AlertIcon className="text-fm-secondary h-4 w-4" />}
192
+ fullWidth
193
+ />
194
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
195
+ startIcon
196
+ </p>
197
+ </div>
198
+ </div>
199
+ </div>
178
200
 
179
- export const WithEndIcon: Story = {
180
- args: {
181
- label: "Verified Field",
182
- placeholder: "Enter verified information",
183
- endIcon: <TickIcon className="h-4 w-4 text-green-500" />,
184
- variant: "success",
185
- },
186
- }
201
+ {/* End icon */}
202
+ <div>
203
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
204
+ End Icon
205
+ </h4>
206
+ <div className="w-full space-y-2 text-center">
207
+ <Input
208
+ label="Verified email"
209
+ placeholder="you@example.com"
210
+ decoration="outline"
211
+ variant="success"
212
+ endIcon={<TickIcon className="text-fm-positive h-4 w-4" />}
213
+ helperText="Email is valid"
214
+ fullWidth
215
+ />
216
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
217
+ endIcon
218
+ </p>
219
+ </div>
220
+ </div>
187
221
 
188
- export const WithBothIcons: Story = {
189
- args: {
190
- label: "Username",
191
- placeholder: "Enter username",
192
- startIcon: <AlertIcon className="h-4 w-4 text-red-400" />,
193
- endIcon: <CrossIcon className="h-4 w-4 text-red-500" />,
194
- variant: "error",
195
- helperText: "Username is already taken",
196
- },
197
- }
222
+ {/* Both icons */}
223
+ <div>
224
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
225
+ Both Icons
226
+ </h4>
227
+ <div className="w-full space-y-2 text-center">
228
+ <Input
229
+ label="Username"
230
+ placeholder="your_handle"
231
+ decoration="outline"
232
+ variant="error"
233
+ startIcon={<AlertIcon className="text-fm-negative h-4 w-4" />}
234
+ endIcon={<CrossIcon className="text-fm-negative h-4 w-4" />}
235
+ helperText="Username already taken"
236
+ fullWidth
237
+ />
238
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
239
+ startIcon + endIcon
240
+ </p>
241
+ </div>
242
+ </div>
198
243
 
199
- // Complex examples
200
- export const LoginForm: Story = {
201
- render: () => (
202
- <div className="w-80 space-y-4">
203
- <Input
204
- label="Email"
205
- type="email"
206
- placeholder="Enter your email"
207
- required
208
- fullWidth
209
- />
210
- <Input
211
- label="Password"
212
- type="password"
213
- placeholder="Enter your password"
214
- required
215
- fullWidth
216
- />
244
+ {/* Input types */}
245
+ <div>
246
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
247
+ Input Types
248
+ </h4>
249
+ <div className="space-y-4">
250
+ <div className="space-y-2 text-center">
251
+ <Input
252
+ label="Email"
253
+ type="email"
254
+ placeholder="you@example.com"
255
+ decoration="outline"
256
+ startIcon={<EmailIcon className="text-fm-secondary h-4 w-4" />}
257
+ helperText="We'll never share your email"
258
+ fullWidth
259
+ />
260
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
261
+ type="email"
262
+ </p>
263
+ </div>
264
+ <div className="space-y-2 text-center">
265
+ <Input
266
+ label="Password"
267
+ type="password"
268
+ placeholder="Min 8 characters"
269
+ decoration="outline"
270
+ helperText="Password toggle appears automatically"
271
+ fullWidth
272
+ />
273
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
274
+ type="password" (toggle built-in)
275
+ </p>
276
+ </div>
277
+ <div className="space-y-2 text-center">
278
+ <Input
279
+ label="Age"
280
+ type="number"
281
+ placeholder="25"
282
+ decoration="outline"
283
+ fullWidth
284
+ />
285
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
286
+ type="number"
287
+ </p>
288
+ </div>
289
+ </div>
290
+ </div>
217
291
  </div>
218
292
  ),
219
- parameters: {
220
- layout: "centered",
221
- },
222
293
  }
223
294
 
224
- export const ValidationStates: Story = {
225
- render: () => (
226
- <div className="w-80 space-y-4">
227
- <Input
228
- label="Valid Email"
229
- type="email"
230
- value="user@example.com"
231
- variant="success"
232
- helperText="Email is valid"
233
- endIcon={<TickIcon className="h-4 w-4 text-green-500" />}
234
- fullWidth
235
- />
236
- <Input
237
- label="Invalid Email"
238
- type="email"
239
- value="invalid-email"
240
- variant="error"
241
- helperText="Please enter a valid email address"
242
- endIcon={<CrossIcon className="h-4 w-4 text-red-500" />}
243
- fullWidth
244
- />
245
- <Input
246
- label="Weak Password"
247
- type="password"
248
- value="123"
249
- variant="warning"
250
- helperText="Password is too weak. Use at least 8 characters"
251
- fullWidth
252
- />
253
- </div>
254
- ),
295
+ // ─── 4. States ────────────────────────────────────────────────────────────────
296
+
297
+ export const States: Story = {
255
298
  parameters: {
256
- layout: "centered",
299
+ docs: {
300
+ description: {
301
+ story:
302
+ "All five input states side by side: default (idle), disabled (non-interactive), error, warning, and success.",
303
+ },
304
+ },
257
305
  },
258
- }
259
-
260
- export const DifferentSizes: Story = {
261
306
  render: () => (
262
- <div className="space-y-4">
263
- <div className="w-60">
264
- <Input label="Small Width" placeholder="60 units wide" />
265
- </div>
266
- <div className="w-80">
267
- <Input label="Medium Width" placeholder="80 units wide" />
268
- </div>
269
- <div className="w-96">
270
- <Input label="Large Width" placeholder="96 units wide" />
271
- </div>
272
- <div className="w-full">
273
- <Input
274
- label="Full Width"
275
- placeholder="Full container width"
276
- fullWidth
277
- />
278
- </div>
307
+ <div className="w-full max-w-sm space-y-8">
308
+ {[
309
+ {
310
+ label: "Default",
311
+ props: {
312
+ label: "Default",
313
+ placeholder: "Enter a value…",
314
+ variant: "default" as const,
315
+ },
316
+ },
317
+ {
318
+ label: "Disabled",
319
+ props: {
320
+ label: "Disabled",
321
+ value: "Cannot edit this",
322
+ disabled: true,
323
+ variant: "default" as const,
324
+ },
325
+ },
326
+ {
327
+ label: "Error",
328
+ props: {
329
+ label: "Error",
330
+ value: "invalid-email",
331
+ variant: "error" as const,
332
+ helperText: "Please enter a valid email address.",
333
+ },
334
+ },
335
+ {
336
+ label: "Warning",
337
+ props: {
338
+ label: "Warning",
339
+ value: "abc",
340
+ variant: "warning" as const,
341
+ helperText: "Password is too short (min 8 characters).",
342
+ },
343
+ },
344
+ {
345
+ label: "Success",
346
+ props: {
347
+ label: "Success",
348
+ value: "user@example.com",
349
+ variant: "success" as const,
350
+ helperText: "Email is valid.",
351
+ },
352
+ },
353
+ ].map(({ label, props }) => (
354
+ <div key={label}>
355
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-3 font-medium">
356
+ {label}
357
+ </h4>
358
+ <Input decoration="outline" fullWidth {...props} />
359
+ </div>
360
+ ))}
279
361
  </div>
280
362
  ),
281
- parameters: {
282
- layout: "padded",
283
- },
284
363
  }
285
364
 
286
- // Atomic components showcase
287
- export const AtomicComponents: Story = {
288
- render: () => (
289
- <div className="space-y-6">
290
- <div>
291
- <h3 className="text-fm-primary mb-3 text-lg font-semibold">
292
- Using Atomic Components
293
- </h3>
294
-
295
- <Input.Root className="w-80">
296
- <Input.Label htmlFor="custom-input" required>
297
- Custom Composed Input
298
- </Input.Label>
299
-
300
- <Input.Wrapper>
301
- <Input.StartIcon>
302
- <AlertIcon className="h-4 w-4 text-gray-400" />
303
- </Input.StartIcon>
304
-
305
- <Input.Base
306
- id="custom-input"
307
- className="block w-full rounded-md border border-gray-300 py-2 pr-10 pl-10 transition-all duration-200 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 focus:outline-none"
308
- placeholder="Custom composition"
309
- />
310
-
311
- <Input.EndIcon>
312
- <TickIcon className="h-4 w-4 text-green-500" />
313
- </Input.EndIcon>
314
- </Input.Wrapper>
365
+ // ─── 5. Interactive ───────────────────────────────────────────────────────────
315
366
 
316
- <HelperText variant="success">
317
- Built using atomic components
318
- </HelperText>
319
- </Input.Root>
320
- </div>
321
- </div>
322
- ),
367
+ export const Interactive: Story = {
323
368
  parameters: {
324
- layout: "centered",
369
+ docs: {
370
+ description: {
371
+ story:
372
+ "Live validation demo. The email and password inputs update their variant and helper text in real time as you type. Preset buttons let you jump to predefined states.",
373
+ },
374
+ },
325
375
  },
326
- }
327
-
328
- // Interactive example
329
- export const InteractiveExample: Story = {
330
376
  render: () => {
331
377
  const [email, setEmail] = React.useState("")
332
378
  const [password, setPassword] = React.useState("")
379
+ const [decoration, setDecoration] = React.useState<
380
+ "underline" | "outline" | "filled"
381
+ >("outline")
333
382
 
334
383
  const emailVariant =
335
- email.includes("@") && email.includes(".")
336
- ? "success"
337
- : email.length > 0
338
- ? "error"
339
- : "default"
384
+ email.length === 0
385
+ ? "default"
386
+ : email.includes("@") && email.includes(".")
387
+ ? "success"
388
+ : "error"
389
+
340
390
  const passwordVariant =
341
- password.length >= 8
342
- ? "success"
343
- : password.length > 0
344
- ? "warning"
345
- : "default"
391
+ password.length === 0
392
+ ? "default"
393
+ : password.length >= 8
394
+ ? "success"
395
+ : password.length >= 4
396
+ ? "warning"
397
+ : "error"
398
+
399
+ const presets: Array<{ label: string; email: string; password: string }> = [
400
+ {
401
+ label: "Valid credentials",
402
+ email: "user@example.com",
403
+ password: "securepass1",
404
+ },
405
+ {
406
+ label: "Invalid email",
407
+ email: "not-an-email",
408
+ password: "securepass1",
409
+ },
410
+ { label: "Weak password", email: "user@example.com", password: "abc" },
411
+ { label: "Clear", email: "", password: "" },
412
+ ]
346
413
 
347
414
  return (
348
- <div className="w-80 space-y-4">
349
- <Input
350
- label="Email"
351
- type="email"
352
- placeholder="Enter your email"
353
- value={email}
354
- onChange={(e) => setEmail(e.target.value)}
355
- variant={emailVariant}
356
- helperText={
357
- emailVariant === "success"
358
- ? "Email looks good!"
359
- : emailVariant === "error"
360
- ? "Please enter a valid email"
361
- : "Enter your email address"
362
- }
363
- endIcon={
364
- emailVariant === "success" ? (
365
- <TickIcon className="h-4 w-4 text-green-500" />
366
- ) : undefined
367
- }
368
- required
369
- fullWidth
370
- />
371
-
372
- <Input
373
- label="Password"
374
- type="password"
375
- placeholder="Enter your password"
376
- value={password}
377
- onChange={(e) => setPassword(e.target.value)}
378
- variant={passwordVariant}
379
- helperText={
380
- passwordVariant === "success"
381
- ? "Password strength is good"
382
- : passwordVariant === "warning"
383
- ? "Password is too short (min 8 characters)"
384
- : "Enter your password"
385
- }
386
- required
387
- fullWidth
388
- />
389
-
390
- <div className="text-sm text-gray-600">
391
- Email: {email || "(empty)"}
392
- <br />
393
- Password: {"*".repeat(password.length) || "(empty)"}
415
+ <div className="w-full p-8">
416
+ <div className="mx-auto max-w-3xl space-y-6">
417
+ <div className="grid grid-cols-1 gap-6 lg:grid-cols-3">
418
+ {/* Controls panel */}
419
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-5 rounded-xl border p-5">
420
+ <p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
421
+ Presets
422
+ </p>
423
+ <div className="space-y-2">
424
+ {presets.map(({ label, email: e, password: p }) => (
425
+ <button
426
+ key={label}
427
+ onClick={() => {
428
+ setEmail(e)
429
+ setPassword(p)
430
+ }}
431
+ className="border-fm-divider-secondary text-fm-primary font-fm-text text-fm-sm leading-fm-sm hover:bg-fm-surface-primary w-full rounded-lg border px-3 py-2 text-left transition-colors"
432
+ >
433
+ {label}
434
+ </button>
435
+ ))}
436
+ </div>
437
+ <div className="border-fm-divider-secondary border-t pt-4" />
438
+ <p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
439
+ Decoration
440
+ </p>
441
+ <div className="space-y-2">
442
+ {(["underline", "outline", "filled"] as const).map((d) => (
443
+ <button
444
+ key={d}
445
+ onClick={() => setDecoration(d)}
446
+ className={`border-fm-divider-secondary text-fm-primary font-fm-text text-fm-sm leading-fm-sm w-full rounded-lg border px-3 py-2 text-left capitalize transition-colors ${decoration === d ? "bg-fm-surface-primary" : "hover:bg-fm-surface-primary"}`}
447
+ >
448
+ {d}
449
+ </button>
450
+ ))}
451
+ </div>
452
+ </div>
453
+
454
+ {/* Preview stage */}
455
+ <div className="flex flex-col gap-4 lg:col-span-2">
456
+ <Input
457
+ label="Email"
458
+ type="email"
459
+ placeholder="you@example.com"
460
+ value={email}
461
+ onChange={(e) => setEmail(e.target.value)}
462
+ variant={emailVariant as "default" | "error" | "success"}
463
+ decoration={decoration}
464
+ helperText={
465
+ emailVariant === "success"
466
+ ? "Email looks good!"
467
+ : emailVariant === "error"
468
+ ? "Please enter a valid email address."
469
+ : "Enter your email address"
470
+ }
471
+ required
472
+ fullWidth
473
+ />
474
+
475
+ <Input
476
+ label="Password"
477
+ type="password"
478
+ placeholder="Min 8 characters"
479
+ value={password}
480
+ onChange={(e) => setPassword(e.target.value)}
481
+ variant={
482
+ passwordVariant as "default" | "error" | "warning" | "success"
483
+ }
484
+ decoration={decoration}
485
+ helperText={
486
+ passwordVariant === "success"
487
+ ? "Password strength is strong."
488
+ : passwordVariant === "warning"
489
+ ? "Password is too short — use at least 8 characters."
490
+ : passwordVariant === "error"
491
+ ? "Password is far too short."
492
+ : "Enter your password"
493
+ }
494
+ required
495
+ fullWidth
496
+ />
497
+
498
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border px-4 py-3">
499
+ <code className="text-fm-secondary text-fm-md leading-fm-md font-(--font-fm-mono)">
500
+ {`email variant="${emailVariant}" | password variant="${passwordVariant}"`}
501
+ </code>
502
+ </div>
503
+ </div>
504
+ </div>
394
505
  </div>
395
506
  </div>
396
507
  )
397
508
  },
398
- parameters: {
399
- layout: "centered",
400
- },
401
- }
402
-
403
- // Edge cases
404
- export const EdgeCases: Story = {
405
- render: () => (
406
- <div className="w-80 space-y-4">
407
- <Input
408
- label="Very Long Label That Might Wrap to Multiple Lines in Some Cases"
409
- placeholder="Long label test"
410
- helperText="This demonstrates how the component handles very long labels and helper text that might wrap to multiple lines in constrained spaces"
411
- variant="default"
412
- fullWidth
413
- />
414
-
415
- <Input
416
- label=""
417
- placeholder="No label provided"
418
- helperText="Input without label"
419
- fullWidth
420
- />
421
-
422
- <Input label="No Helper Text" placeholder="Clean input" fullWidth />
423
-
424
- <Input placeholder="No label, no helper text" fullWidth />
425
-
426
- <Input
427
- label="All Features"
428
- placeholder="Everything enabled"
429
- startIcon={<AlertIcon className="h-4 w-4 text-blue-500" />}
430
- endIcon={<TickIcon className="h-4 w-4 text-green-500" />}
431
- helperText="This input has all features enabled"
432
- variant="success"
433
- required
434
- fullWidth
435
- />
436
- </div>
437
- ),
438
- parameters: {
439
- layout: "centered",
440
- },
441
509
  }