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,8 +1,9 @@
1
1
  import React from "react"
2
- import { ArrowRightIcon } from "@icons/arrow-right-icon"
3
2
  import { ChevronDoubleRightIcon } from "@icons/chevron-double-right-icon"
4
3
  import type { Meta, StoryObj } from "@storybook/react-vite"
5
4
 
5
+ import { AuralComponentDocsPage } from "src/ui/story-spec/components/component-story-docs-page"
6
+
6
7
  import { Breadcrumb } from "."
7
8
 
8
9
  const meta: Meta<typeof Breadcrumb> = {
@@ -10,73 +11,29 @@ const meta: Meta<typeof Breadcrumb> = {
10
11
  component: Breadcrumb,
11
12
  parameters: {
12
13
  layout: "centered",
13
- backgrounds: {
14
- default: "dark",
15
- values: [
16
- { name: "dark", value: "#0a0a0a" },
17
- { name: "light", value: "#ffffff" },
18
- ],
19
- },
20
14
  docs: {
21
15
  description: {
22
- component: `
23
- # Breadcrumb Component
24
-
25
- A navigation component that shows the current page's location within a site hierarchy. Users can navigate back to previous levels by clicking on breadcrumb items.
26
-
27
- ## Features
28
-
29
- - **Multiple Separators**: Support for chevron, slash, arrow, and custom separators
30
- - **Custom Separator**: Use any React component or icon as a separator
31
- - **Clickable Navigation**: Items can be clickable links or static text
32
- - **Responsive Design**: Adapts spacing for mobile and desktop
33
- - **Accessibility**: Proper ARIA labels and semantic HTML structure
34
- - **Customizable**: Size variants and custom styling options
35
- - **Truncation**: Optional max items with ellipsis for long breadcrumbs
36
- - **Home Integration**: Optional home item at the beginning
37
-
38
- ## Usage Examples
39
-
40
- ### Basic Breadcrumb
41
- \`\`\`tsx
42
- <Breadcrumb
43
- items={[
44
- { title: "Home", url: "/" },
45
- { title: "Products", url: "/products" },
46
- { title: "Electronics" }
47
- ]}
48
- onItemClick={(title, url) => console.log(title, url)}
49
- />
50
- \`\`\`
51
-
52
- ### With Different Separators
53
- \`\`\`tsx
54
- <Breadcrumb
55
- items={items}
56
- separator="slash"
57
- onItemClick={handleClick}
58
- />
59
- \`\`\`
60
-
61
- ### With Size Variants
62
- \`\`\`tsx
63
- <Breadcrumb
64
- items={items}
65
- size="lg"
66
- onItemClick={handleClick}
67
- />
68
- \`\`\`
69
-
70
- ### With Custom Separator
71
- \`\`\`tsx
72
- <Breadcrumb
73
- items={items}
74
- customSeparator={<ArrowRightIcon width={16} height={16} />}
75
- onItemClick={handleClick}
76
- />
77
- \`\`\`
78
- `,
16
+ component:
17
+ "A navigation component that shows the current page's location within a site hierarchy. Supports chevron, slash, arrow, and custom separators; optional home prepend; maxItems truncation; and clickable or static items.",
79
18
  },
19
+ page: () => (
20
+ <AuralComponentDocsPage
21
+ features={[
22
+ {
23
+ title: "Multiple Separators",
24
+ description: "Chevron, slash, arrow",
25
+ },
26
+ {
27
+ title: "Home Prefix",
28
+ description: "Optional home item",
29
+ },
30
+ {
31
+ title: "Auto Truncation",
32
+ description: "maxItems collapses path",
33
+ },
34
+ ]}
35
+ />
36
+ ),
80
37
  },
81
38
  },
82
39
  tags: ["autodocs"],
@@ -104,199 +61,496 @@ A navigation component that shows the current page's location within a site hier
104
61
  export default meta
105
62
  type Story = StoryObj<typeof Breadcrumb>
106
63
 
107
- const sampleItems = [
108
- { title: "Home", url: "/", isClickable: true },
109
- { title: "Products", url: "/products", isClickable: true },
110
- { title: "Electronics", url: "/products/electronics", isClickable: true },
64
+ const subsectionHeaderClass =
65
+ "text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium"
66
+ const itemLabelClass = "text-fm-secondary font-fm-text text-fm-sm leading-fm-sm"
67
+ const cardClass =
68
+ "border-fm-divider-secondary rounded-xl border bg-transparent p-4"
69
+ const codeBlockClass =
70
+ "border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border px-4 py-3"
71
+ const codeClass =
72
+ "text-fm-secondary font-[var(--font-fm-mono)] text-fm-md leading-fm-md"
73
+
74
+ const musicItems = [
75
+ { title: "Discover", url: "/discover", isClickable: true },
76
+ { title: "Artists", url: "/discover/artists", isClickable: true },
77
+ {
78
+ title: "Electronic",
79
+ url: "/discover/artists/electronic",
80
+ isClickable: true,
81
+ },
111
82
  {
112
- title: "Smartphones",
113
- url: "/products/electronics/smartphones",
83
+ title: "Bicep",
84
+ url: "/discover/artists/electronic/bicep",
114
85
  isClickable: true,
115
86
  },
116
- { title: "iPhone 15 Pro" },
87
+ { title: "Isles" },
117
88
  ]
118
89
 
119
- const longItems = [
120
- { title: "Home", url: "/", isClickable: true },
121
- { title: "Products", url: "/products", isClickable: true },
122
- { title: "Electronics", url: "/products/electronics", isClickable: true },
90
+ const longMusicItems = [
91
+ { title: "Discover", url: "/discover", isClickable: true },
92
+ { title: "Artists", url: "/discover/artists", isClickable: true },
123
93
  {
124
- title: "Smartphones",
125
- url: "/products/electronics/smartphones",
94
+ title: "Electronic",
95
+ url: "/discover/artists/electronic",
126
96
  isClickable: true,
127
97
  },
128
98
  {
129
- title: "Apple",
130
- url: "/products/electronics/smartphones/apple",
99
+ title: "United Kingdom",
100
+ url: "/discover/artists/electronic/uk",
131
101
  isClickable: true,
132
102
  },
133
103
  {
134
- title: "iPhone",
135
- url: "/products/electronics/smartphones/apple/iphone",
104
+ title: "Bicep",
105
+ url: "/discover/artists/electronic/uk/bicep",
136
106
  isClickable: true,
137
107
  },
138
- { title: "iPhone 15 Pro" },
139
- ]
140
-
141
- export const Default: Story = {
142
- args: {
143
- items: sampleItems,
144
- size: "md",
145
- separator: "chevron",
108
+ {
109
+ title: "Studio Albums",
110
+ url: "/discover/artists/electronic/uk/bicep/albums",
111
+ isClickable: true,
146
112
  },
147
- }
113
+ { title: "Isles" },
114
+ ]
148
115
 
149
- export const WithSlashSeparator: Story = {
150
- args: {
151
- items: sampleItems,
152
- separator: "slash",
153
- },
116
+ function StoryLabel({ children }: React.PropsWithChildren) {
117
+ return <p className={itemLabelClass}>{children}</p>
154
118
  }
155
119
 
156
- export const WithArrowSeparator: Story = {
157
- args: {
158
- items: sampleItems,
159
- separator: "arrow",
160
- },
120
+ function BreadcrumbCard({
121
+ children,
122
+ align = "center",
123
+ }: React.PropsWithChildren<{ align?: "center" | "start" }>) {
124
+ return (
125
+ <div className={cardClass}>
126
+ <div className="overflow-x-auto pb-1">
127
+ <div
128
+ className={
129
+ align === "start"
130
+ ? "flex min-w-max items-center"
131
+ : "flex min-w-max items-center justify-center"
132
+ }
133
+ >
134
+ {children}
135
+ </div>
136
+ </div>
137
+ </div>
138
+ )
161
139
  }
162
140
 
163
- export const WithCustomSeparator: Story = {
164
- args: {
165
- items: sampleItems,
166
- customSeparator: <ChevronDoubleRightIcon width={16} height={16} />,
167
- },
141
+ function BreadcrumbItemCard({
142
+ label,
143
+ children,
144
+ }: React.PropsWithChildren<{ label: string }>) {
145
+ return (
146
+ <div className="space-y-2 text-center">
147
+ <BreadcrumbCard>{children}</BreadcrumbCard>
148
+ <StoryLabel>{label}</StoryLabel>
149
+ </div>
150
+ )
168
151
  }
169
152
 
170
- export const SmallSize: Story = {
153
+ export const Playground: Story = {
171
154
  args: {
172
- items: sampleItems,
173
- size: "sm",
155
+ items: musicItems,
156
+ size: "md",
157
+ separator: "chevron",
158
+ showHome: false,
174
159
  },
175
- }
176
-
177
- export const LargeSize: Story = {
178
- args: {
179
- items: sampleItems,
180
- size: "lg",
160
+ render: (args) => (
161
+ <div className="w-full max-w-2xl space-y-4">
162
+ <BreadcrumbCard>
163
+ <Breadcrumb {...args} />
164
+ </BreadcrumbCard>
165
+ <div className={codeBlockClass}>
166
+ <code className={codeClass}>
167
+ {`<Breadcrumb size="${args.size}" separator="${args.separator}" showHome={${args.showHome}} />`}
168
+ </code>
169
+ </div>
170
+ </div>
171
+ ),
172
+ parameters: {
173
+ docs: {
174
+ description: {
175
+ story:
176
+ "Controls-driven playground. Use the Storybook sidebar to change size, separator, showHome, and maxItems and see live results alongside the generated code snippet.",
177
+ },
178
+ },
181
179
  },
182
180
  }
183
181
 
184
- export const WithHome: Story = {
185
- args: {
186
- items: [
187
- { title: "Products", url: "/products", isClickable: true },
188
- { title: "Electronics", url: "/products/electronics", isClickable: true },
189
- { title: "Smartphones" },
190
- ],
191
- showHome: true,
192
- homeTitle: "Home",
193
- homeUrl: "/",
194
- },
195
- }
182
+ export const Configurations: Story = {
183
+ render: () => (
184
+ <div className="space-y-8">
185
+ <div className="space-y-4">
186
+ <h4 className={subsectionHeaderClass}>Separator Types</h4>
187
+ <div className="grid gap-4 md:grid-cols-2">
188
+ <BreadcrumbItemCard label="Chevron (default)">
189
+ <Breadcrumb items={musicItems} separator="chevron" />
190
+ </BreadcrumbItemCard>
191
+ <BreadcrumbItemCard label="Slash">
192
+ <Breadcrumb items={musicItems} separator="slash" />
193
+ </BreadcrumbItemCard>
194
+ <BreadcrumbItemCard label="Arrow">
195
+ <Breadcrumb items={musicItems} separator="arrow" />
196
+ </BreadcrumbItemCard>
197
+ <BreadcrumbItemCard label="Custom icon">
198
+ <Breadcrumb
199
+ items={musicItems}
200
+ customSeparator={
201
+ <ChevronDoubleRightIcon width={14} height={14} />
202
+ }
203
+ />
204
+ </BreadcrumbItemCard>
205
+ <BreadcrumbItemCard label="Custom text">
206
+ <Breadcrumb items={musicItems} customSeparator="·" />
207
+ </BreadcrumbItemCard>
208
+ </div>
209
+ </div>
196
210
 
197
- export const WithMaxItems: Story = {
198
- args: {
199
- items: longItems,
200
- maxItems: 4,
201
- },
202
- }
211
+ <div className="space-y-4">
212
+ <h4 className={subsectionHeaderClass}>Show Home Prefix</h4>
213
+ <div className="grid gap-4 md:grid-cols-2">
214
+ <BreadcrumbItemCard label="showHome: false">
215
+ <Breadcrumb
216
+ items={[
217
+ { title: "Artists", url: "/artists", isClickable: true },
218
+ { title: "Bicep" },
219
+ ]}
220
+ />
221
+ </BreadcrumbItemCard>
222
+ <BreadcrumbItemCard label="showHome: true">
223
+ <Breadcrumb
224
+ items={[
225
+ { title: "Artists", url: "/artists", isClickable: true },
226
+ { title: "Bicep" },
227
+ ]}
228
+ showHome
229
+ homeTitle="Home"
230
+ homeUrl="/"
231
+ />
232
+ </BreadcrumbItemCard>
233
+ </div>
234
+ </div>
203
235
 
204
- export const NonClickable: Story = {
205
- args: {
206
- items: [
207
- { title: "Home", isClickable: false },
208
- { title: "Products", isClickable: false },
209
- { title: "Electronics", isClickable: false },
210
- { title: "Smartphones" },
211
- ],
212
- },
213
- }
236
+ <div className="space-y-4">
237
+ <h4 className={subsectionHeaderClass}>maxItems Truncation</h4>
238
+ <div className="grid gap-4">
239
+ <BreadcrumbItemCard label="All items (no limit)">
240
+ <Breadcrumb items={longMusicItems} />
241
+ </BreadcrumbItemCard>
242
+ <BreadcrumbItemCard label="maxItems: 4 (ellipsis middle)">
243
+ <Breadcrumb items={longMusicItems} maxItems={4} />
244
+ </BreadcrumbItemCard>
245
+ <BreadcrumbItemCard label="maxItems: 2 (first + last only)">
246
+ <Breadcrumb items={longMusicItems} maxItems={2} />
247
+ </BreadcrumbItemCard>
248
+ </div>
249
+ </div>
214
250
 
215
- export const MixedClickable: Story = {
216
- args: {
217
- items: [
218
- { title: "Home", url: "/", isClickable: true },
219
- { title: "Products", isClickable: false },
220
- { title: "Electronics", url: "/products/electronics", isClickable: true },
221
- { title: "Smartphones" },
222
- ],
251
+ <div className="space-y-4">
252
+ <h4 className={subsectionHeaderClass}>
253
+ Clickable vs Non-Clickable Items
254
+ </h4>
255
+ <div className="grid gap-4 md:grid-cols-2">
256
+ <BreadcrumbItemCard label="Clickable ancestors, static current page">
257
+ <Breadcrumb
258
+ items={[
259
+ { title: "Discover", url: "/discover", isClickable: true },
260
+ { title: "Artists", url: "/artists", isClickable: true },
261
+ { title: "Bicep" },
262
+ ]}
263
+ />
264
+ </BreadcrumbItemCard>
265
+ <BreadcrumbItemCard label="All non-clickable">
266
+ <Breadcrumb
267
+ items={[
268
+ { title: "Discover", isClickable: false },
269
+ { title: "Artists", isClickable: false },
270
+ { title: "Bicep" },
271
+ ]}
272
+ />
273
+ </BreadcrumbItemCard>
274
+ </div>
275
+ </div>
276
+ </div>
277
+ ),
278
+ parameters: {
279
+ docs: {
280
+ description: {
281
+ story:
282
+ "Comparison of all configuration axes: separator types (chevron, slash, arrow, custom), showHome toggle, maxItems truncation levels, and clickable versus static items.",
283
+ },
284
+ },
223
285
  },
224
286
  }
225
287
 
226
- export const AllVariants: Story = {
288
+ export const Sizes: Story = {
227
289
  render: () => (
228
- <div className="flex flex-col gap-8 p-8">
290
+ <div className="space-y-8">
291
+ <div className="flex flex-wrap items-end justify-center gap-6">
292
+ <BreadcrumbItemCard label="Small (sm)">
293
+ <Breadcrumb
294
+ items={[
295
+ { title: "Discover", url: "/discover", isClickable: true },
296
+ { title: "Artists", url: "/artists", isClickable: true },
297
+ { title: "Bicep" },
298
+ ]}
299
+ size="sm"
300
+ />
301
+ </BreadcrumbItemCard>
302
+ <BreadcrumbItemCard label="Medium (md · default)">
303
+ <Breadcrumb
304
+ items={[
305
+ { title: "Discover", url: "/discover", isClickable: true },
306
+ { title: "Artists", url: "/artists", isClickable: true },
307
+ { title: "Bicep" },
308
+ ]}
309
+ size="md"
310
+ />
311
+ </BreadcrumbItemCard>
312
+ <BreadcrumbItemCard label="Large (lg)">
313
+ <Breadcrumb
314
+ items={[
315
+ { title: "Discover", url: "/discover", isClickable: true },
316
+ { title: "Artists", url: "/artists", isClickable: true },
317
+ { title: "Bicep" },
318
+ ]}
319
+ size="lg"
320
+ />
321
+ </BreadcrumbItemCard>
322
+ </div>
323
+
229
324
  <div className="space-y-4">
230
- <h3 className="text-fm-lg font-fm-brand text-neutral-400">
231
- Size Variants
232
- </h3>
233
- <div className="space-y-2">
234
- <Breadcrumb items={sampleItems} size="sm" />
235
- <Breadcrumb items={sampleItems} size="md" />
236
- <Breadcrumb items={sampleItems} size="lg" />
325
+ <h4 className={subsectionHeaderClass}>Size × Separator</h4>
326
+ <div className="grid gap-4">
327
+ {(["sm", "md", "lg"] as const).map((size) => (
328
+ <BreadcrumbItemCard key={size} label={`${size} · slash`}>
329
+ <Breadcrumb items={musicItems} size={size} separator="slash" />
330
+ </BreadcrumbItemCard>
331
+ ))}
237
332
  </div>
238
333
  </div>
334
+ </div>
335
+ ),
336
+ parameters: {
337
+ docs: {
338
+ description: {
339
+ story:
340
+ "Three size variants (sm, md, lg) shown side by side with a size × separator cross-axis comparison.",
341
+ },
342
+ },
343
+ },
344
+ }
239
345
 
346
+ export const UseCases: Story = {
347
+ render: () => (
348
+ <div className="mx-auto max-w-3xl space-y-8 p-8">
240
349
  <div className="space-y-4">
241
- <h3 className="text-fm-lg font-fm-brand text-neutral-400">
242
- Separator Variants
243
- </h3>
244
- <div className="space-y-2">
245
- <Breadcrumb items={sampleItems} separator="chevron" />
246
- <Breadcrumb items={sampleItems} separator="slash" />
247
- <Breadcrumb items={sampleItems} separator="arrow" />
248
- <Breadcrumb
249
- items={sampleItems}
250
- customSeparator={<ArrowRightIcon width={16} height={16} />}
251
- />
252
- <Breadcrumb
253
- items={sampleItems}
254
- customSeparator={<ChevronDoubleRightIcon width={16} height={16} />}
255
- />
256
- <Breadcrumb items={sampleItems} customSeparator="•" />
350
+ <h4 className={subsectionHeaderClass}>Music Library Navigation</h4>
351
+ <div className="border-fm-divider-secondary mx-auto max-w-2xl space-y-4 rounded-xl border bg-transparent p-5">
352
+ <div className="overflow-x-auto pb-1">
353
+ <div className="min-w-max">
354
+ <Breadcrumb
355
+ items={[
356
+ { title: "Library", url: "/library", isClickable: true },
357
+ {
358
+ title: "Albums",
359
+ url: "/library/albums",
360
+ isClickable: true,
361
+ },
362
+ {
363
+ title: "Electronic",
364
+ url: "/library/albums/electronic",
365
+ isClickable: true,
366
+ },
367
+ { title: "Isles" },
368
+ ]}
369
+ showHome
370
+ homeTitle="Home"
371
+ homeUrl="/"
372
+ separator="chevron"
373
+ size="sm"
374
+ />
375
+ </div>
376
+ </div>
377
+ <div className="bg-fm-surface-tertiary h-32 rounded-lg" />
378
+ <p className="text-fm-primary font-fm-brand text-fm-lg leading-fm-lg font-semibold">
379
+ Isles
380
+ </p>
381
+ <p className={itemLabelClass}>Bicep · 2021 · 12 tracks</p>
257
382
  </div>
258
383
  </div>
259
384
 
260
385
  <div className="space-y-4">
261
- <h3 className="text-fm-lg font-fm-brand text-neutral-400">With Home</h3>
262
- <Breadcrumb
263
- items={[
264
- { title: "Products", url: "/products", isClickable: true },
265
- { title: "Electronics" },
266
- ]}
267
- showHome={true}
268
- />
386
+ <h4 className={subsectionHeaderClass}>Settings Page Context</h4>
387
+ <div className="border-fm-divider-secondary mx-auto max-w-2xl rounded-xl border bg-transparent">
388
+ <div className="border-fm-divider-secondary overflow-x-auto border-b px-5 py-3">
389
+ <div className="min-w-max">
390
+ <Breadcrumb
391
+ items={[
392
+ { title: "Account", url: "/account", isClickable: true },
393
+ {
394
+ title: "Preferences",
395
+ url: "/account/preferences",
396
+ isClickable: true,
397
+ },
398
+ { title: "Audio Quality" },
399
+ ]}
400
+ separator="slash"
401
+ size="sm"
402
+ />
403
+ </div>
404
+ </div>
405
+ <div className="space-y-3 p-5">
406
+ <p className="text-fm-primary font-fm-brand text-fm-md leading-fm-md font-semibold">
407
+ Audio Quality Settings
408
+ </p>
409
+ <p className={itemLabelClass}>
410
+ Choose your preferred streaming and download quality.
411
+ </p>
412
+ </div>
413
+ </div>
269
414
  </div>
270
415
 
271
416
  <div className="space-y-4">
272
- <h3 className="text-fm-lg font-fm-brand text-neutral-400">
273
- With Max Items (4)
274
- </h3>
275
- <Breadcrumb items={longItems} maxItems={4} />
417
+ <h4 className={subsectionHeaderClass}>Deep Path with Truncation</h4>
418
+ <div className="border-fm-divider-secondary mx-auto max-w-2xl space-y-3 rounded-xl border bg-transparent p-5">
419
+ <div className="overflow-x-auto pb-1">
420
+ <div className="min-w-max">
421
+ <Breadcrumb
422
+ items={longMusicItems}
423
+ maxItems={4}
424
+ separator="arrow"
425
+ size="md"
426
+ />
427
+ </div>
428
+ </div>
429
+ <p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
430
+ Deep paths collapse automatically so the current location stays easy
431
+ to scan.
432
+ </p>
433
+ </div>
276
434
  </div>
277
435
  </div>
278
436
  ),
437
+ parameters: {
438
+ layout: "fullscreen",
439
+ docs: {
440
+ description: {
441
+ story:
442
+ "Real product-shaped examples: music library album navigation with home prefix, a settings page context bar, and a deep path using maxItems truncation.",
443
+ },
444
+ },
445
+ },
279
446
  }
280
447
 
281
448
  export const Interactive: Story = {
282
449
  render: () => {
283
- const [currentPath, setCurrentPath] = React.useState("iPhone 15 Pro")
450
+ const pathTree = [
451
+ { title: "Discover", url: "/discover" },
452
+ { title: "Artists", url: "/discover/artists" },
453
+ { title: "Electronic", url: "/discover/artists/electronic" },
454
+ { title: "Bicep", url: "/discover/artists/electronic/bicep" },
455
+ { title: "Isles", url: "/discover/artists/electronic/bicep/isles" },
456
+ ]
284
457
 
285
- const handleItemClick = (title: string, url?: string) => {
286
- console.log(`Clicked: ${title}`, url)
287
- setCurrentPath(title)
458
+ const [activePath, setActivePath] = React.useState<string[]>([
459
+ "Discover",
460
+ "Artists",
461
+ "Electronic",
462
+ "Bicep",
463
+ "Isles",
464
+ ])
465
+
466
+ const handleItemClick = (title: string) => {
467
+ const nextIndex = pathTree.findIndex((node) => node.title === title)
468
+
469
+ if (nextIndex >= 0) {
470
+ setActivePath(
471
+ pathTree.slice(0, nextIndex + 1).map((node) => node.title)
472
+ )
473
+ }
288
474
  }
289
475
 
476
+ const breadcrumbItems = activePath.map((title, index) => ({
477
+ title,
478
+ url: pathTree.find((node) => node.title === title)?.url,
479
+ isClickable: index < activePath.length - 1,
480
+ }))
481
+
290
482
  return (
291
- <div className="space-y-4 p-8">
292
- <h3 className="text-fm-lg font-fm-brand text-neutral-400">
293
- Current Path: {currentPath}
294
- </h3>
295
- <Breadcrumb items={sampleItems} onItemClick={handleItemClick} />
296
- <div className="text-fm-secondary text-fm-sm">
297
- Click on any breadcrumb item to see the interaction
483
+ <div className="w-full p-8">
484
+ <div className="mx-auto max-w-4xl space-y-6">
485
+ <div className="grid grid-cols-1 gap-6 lg:grid-cols-3">
486
+ <div className="border-fm-divider-secondary space-y-5 rounded-xl border bg-transparent p-5">
487
+ <p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
488
+ Navigate To
489
+ </p>
490
+ <div className="space-y-2">
491
+ {pathTree.map((node) => {
492
+ const isCurrent =
493
+ activePath[activePath.length - 1] === node.title
494
+ const isVisited = activePath.includes(node.title)
495
+
496
+ return (
497
+ <button
498
+ key={node.title}
499
+ onClick={() => handleItemClick(node.title)}
500
+ className={[
501
+ "border-fm-divider-secondary w-full rounded-lg border px-3 py-2 text-left transition-colors",
502
+ "text-fm-sm leading-fm-sm",
503
+ isCurrent
504
+ ? "bg-fm-surface-tertiary text-fm-primary font-medium"
505
+ : isVisited
506
+ ? "bg-fm-surface-secondary text-fm-primary"
507
+ : "bg-fm-surface-primary text-fm-secondary hover:bg-fm-surface-tertiary",
508
+ ].join(" ")}
509
+ >
510
+ {node.title}
511
+ </button>
512
+ )
513
+ })}
514
+ </div>
515
+ </div>
516
+
517
+ <div className="flex flex-col gap-3 lg:col-span-2">
518
+ <div className="border-fm-divider-secondary rounded-xl border bg-transparent p-6">
519
+ <div className="overflow-x-auto pb-1">
520
+ <div className="min-w-max">
521
+ <Breadcrumb
522
+ items={breadcrumbItems}
523
+ onItemClick={handleItemClick}
524
+ size="md"
525
+ separator="chevron"
526
+ />
527
+ </div>
528
+ </div>
529
+ </div>
530
+ <div className={codeBlockClass}>
531
+ <code className={`${codeClass} break-all`}>
532
+ {`Current: ${activePath.join(" › ")}`}
533
+ </code>
534
+ </div>
535
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
536
+ <p className="text-fm-secondary font-fm-text text-fm-md leading-fm-xl">
537
+ Click any breadcrumb item or jump directly from the left panel
538
+ to simulate moving back through the hierarchy.
539
+ </p>
540
+ </div>
541
+ </div>
542
+ </div>
298
543
  </div>
299
544
  </div>
300
545
  )
301
546
  },
547
+ parameters: {
548
+ layout: "fullscreen",
549
+ docs: {
550
+ description: {
551
+ story:
552
+ "Live navigation simulation using useState. Click any breadcrumb item or a node in the panel to travel to that depth; the trail updates immediately to show the new active path.",
553
+ },
554
+ },
555
+ },
302
556
  }