aural-ui 3.0.6 → 4.0.1
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.
- package/dist/components/aspect-ratio/AspectRatio.stories.tsx +271 -242
- package/dist/components/avatar/Avatar.stories.tsx +84 -70
- package/dist/components/button/Button.stories.tsx +7 -7
- package/dist/components/button/index.tsx +7 -7
- package/dist/components/card/Card.stories.tsx +3 -3
- package/dist/components/char-count/CharCount.stories.tsx +9 -9
- package/dist/components/circular-loader/CircularLoader.stories.tsx +109 -93
- package/dist/components/clamp-lines/ClampLines.stories.tsx +25 -0
- package/dist/components/clamp-lines/index.tsx +6 -1
- package/dist/components/collapsible/Collapsible.stories.tsx +1 -1
- package/dist/components/command/Command.stories.tsx +52 -38
- package/dist/components/dialog/Dialog.stories.tsx +89 -84
- package/dist/components/divider/Divider.stories.tsx +86 -60
- package/dist/components/dot-loader/DotLoader.stories.tsx +12 -12
- package/dist/components/drawer/Drawer.stories.tsx +74 -44
- package/dist/components/drawer/index.tsx +3 -3
- package/dist/components/dropdown/Dropdown.stories.tsx +42 -32
- package/dist/components/helper-text/HelperText.stories.tsx +2 -2
- package/dist/components/hover-card/HoverCard.stories.tsx +211 -178
- package/dist/components/input/Input.stories.tsx +2 -2
- package/dist/components/input/index.tsx +2 -0
- package/dist/components/label/Label.stories.tsx +10 -10
- package/dist/components/list/List.stories.tsx +58 -44
- package/dist/components/marquee/Marquee.stories.tsx +131 -113
- package/dist/components/otp-inputs/OtpInputs.stories.tsx +47 -35
- package/dist/components/overlay/Overlay.stories.tsx +98 -92
- package/dist/components/overlay/index.tsx +4 -4
- package/dist/components/popover/Popover.stories.tsx +132 -106
- package/dist/components/radio/Radio.stories.tsx +2 -2
- package/dist/components/resizable/Resizable.stories.tsx +186 -138
- package/dist/components/scroll-area/ScrollArea.stories.tsx +174 -120
- package/dist/components/search/Search.stories.tsx +81 -59
- package/dist/components/select/Select.stories.tsx +3 -1
- package/dist/components/sheet/Sheet.stories.tsx +68 -54
- package/dist/components/slider/Slider.stories.tsx +71 -47
- package/dist/components/stepper/Stepper.stories.tsx +16 -16
- package/dist/components/switch/Switch.stories.tsx +12 -12
- package/dist/components/table/Table.stories.tsx +8 -6
- package/dist/components/tabs/Tabs.stories.tsx +324 -268
- package/dist/components/textarea/TextArea.stories.tsx +1 -1
- package/dist/components/thumbnail-tags/ThumbnailTags.stories.tsx +16 -10
- package/dist/components/toast/Toast.stories.tsx +51 -45
- package/dist/components/toggle/Toggle.stories.tsx +111 -89
- package/dist/components/tooltip/Tooltip.stories.tsx +160 -144
- package/dist/icons/Icons.stories.tsx +2 -2
- package/dist/icons/ai-avatar-icon/AiAvatarIcon.stories.tsx +287 -237
- package/dist/icons/alert-icon/AlertIcon.stories.tsx +290 -248
- package/dist/icons/all-icons.tsx +97 -81
- package/dist/icons/angle-down-icon/AngleDownIcon.stories.tsx +312 -270
- package/dist/icons/apple-logo-icon/AppleLogoIcon.stories.tsx +294 -244
- package/dist/icons/arrow-box-left-icon/ArrowBoxLeftIcon.stories.tsx +309 -279
- package/dist/icons/arrow-corner-up-left-icon/ArrowCornerUpLeftIcon.stories.tsx +294 -258
- package/dist/icons/arrow-corner-up-right-icon/ArrowCornerUpRightIcon.stories.tsx +289 -255
- package/dist/icons/arrow-left-icon/ArrowLeftIcon.stories.tsx +288 -256
- package/dist/icons/arrow-right-icon/ArrowRightIcon.stories.tsx +322 -288
- package/dist/icons/arrow-right-up-icon/ArrowRightUpIcon.stories.tsx +340 -296
- package/dist/icons/art-board-icon/ArtBoardIcon.stories.tsx +197 -177
- package/dist/icons/audio-bar-icon/AudioBarIcon.stories.tsx +390 -328
- package/dist/icons/backward-ten-seconds-icon/BackwardTenSecondsIcon.stories.tsx +313 -277
- package/dist/icons/bubble-check-icon/BubbleCheckIcon.stories.tsx +367 -309
- package/dist/icons/bubble-crossed-icon/BubbleCrossedIcon.stories.tsx +356 -308
- package/dist/icons/bubble-sparkle-icon/BubbleSparkleIcon.stories.tsx +280 -234
- package/dist/icons/camera-icon/CameraIcon.stories.tsx +370 -326
- package/dist/icons/capital-a-letter-icon/CapitalALetterIcon.stories.tsx +300 -256
- package/dist/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.stories.tsx +298 -262
- package/dist/icons/chevron-double-right-icon/ChevronDoubleRightIcon.stories.tsx +294 -260
- package/dist/icons/chevron-down-icon/ChevronDownIcon.stories.tsx +291 -259
- package/dist/icons/chevron-left-icon/ChevronLeftIcon.stories.tsx +286 -256
- package/dist/icons/chevron-right-icon/ChevronRightIcon.stories.tsx +282 -256
- package/dist/icons/chevron-up-icon/ChevronUpIcon.stories.tsx +292 -256
- package/dist/icons/circle-tick-icon/CircleTickIcon.stories.tsx +338 -290
- package/dist/icons/circular-play-icon/CircularPlayIcon.stories.tsx +167 -148
- package/dist/icons/coin-icon/CoinIcon.stories.tsx +342 -296
- package/dist/icons/coin-toons-icon/CoinToonsIcon.stories.tsx +342 -296
- package/dist/icons/column-wide-add-icon/ColumnWideAddIcon.stories.tsx +280 -238
- package/dist/icons/command-icon/CommandIcon.stories.tsx +328 -280
- package/dist/icons/copy-icon/CopyIcon.stories.tsx +294 -256
- package/dist/icons/cross-circle-icon/CrossCircleIcon.stories.tsx +285 -235
- package/dist/icons/cross-icon/CrossIcon.stories.tsx +308 -266
- package/dist/icons/download-icon/DownloadIcon.stories.tsx +271 -231
- package/dist/icons/edit-big-icon/EditBigIcon.stories.tsx +330 -278
- package/dist/icons/email-icon/EmailIcon.stories.tsx +303 -257
- package/dist/icons/expand-icon/ExpandIcon.stories.tsx +324 -286
- package/dist/icons/eye-close-icon/EyeCloseIcon.stories.tsx +317 -271
- package/dist/icons/eye-open-icon/EyeOpenIcon.stories.tsx +320 -272
- package/dist/icons/feature-shine-icon/FeatureShineIcon.stories.tsx +322 -280
- package/dist/icons/file-chart-icon/FileChartIcon.stories.tsx +315 -277
- package/dist/icons/file-text-icon/FileTextIcon.stories.tsx +199 -177
- package/dist/icons/filter-bar-row-icon/FilterBarRowIcon.stories.tsx +304 -264
- package/dist/icons/forward-ten-seconds-icon/ForwardTenSecondsIcon.stories.tsx +311 -277
- package/dist/icons/git-branch-icon/GitBranchIcon.stories.tsx +327 -287
- package/dist/icons/git-fork-icon/GitForkIcon.stories.tsx +314 -278
- package/dist/icons/globe-icon/GlobeIcon.stories.tsx +113 -98
- package/dist/icons/google-logo-icon/GoogleLogoIcon.stories.tsx +274 -226
- package/dist/icons/grip-vertical-icon/GripVerticalIcon.stories.tsx +349 -303
- package/dist/icons/head-icon/HeadIcon.stories.tsx +286 -246
- package/dist/icons/heart-icon/HeartIcon.stories.tsx +312 -268
- package/dist/icons/image-avatar-sparkle-icon/ImageAvatarSparkleIcon.stories.tsx +246 -210
- package/dist/icons/image-icon/ImageIcon.stories.tsx +330 -284
- package/dist/icons/import-folder-icon/ImportFolderIcon.stories.tsx +326 -282
- package/dist/icons/import-left-arrow-folder-icon/ImportLeftArrowFolderIcon.stories.tsx +330 -294
- package/dist/icons/indian-flag-icon/IndianFlagIcon.stories.tsx +288 -234
- package/dist/icons/instagram-icon/InstagramIcon.stories.tsx +386 -330
- package/dist/icons/layout-column-icon/LayoutColumnIcon.stories.tsx +305 -263
- package/dist/icons/layout-left-icon/LayoutLeftIcon.stories.tsx +295 -259
- package/dist/icons/layout-right-icon/LayoutRightIcon.stories.tsx +296 -256
- package/dist/icons/light-bulb-simple-icon/LightBulbSimpleIcon.stories.tsx +322 -282
- package/dist/icons/linked-in-icon/LinkedInIcon.stories.tsx +399 -359
- package/dist/icons/magic-book-icon/MagicBookIcon.stories.tsx +314 -272
- package/dist/icons/magic-edit-icon/MagicEditIcon.stories.tsx +238 -206
- package/dist/icons/maintenance-icon/MaintenanceIcon.stories.tsx +322 -276
- package/dist/icons/message-icon/MessageIcon.stories.tsx +192 -170
- package/dist/icons/minimize-icon/MinimizeIcon.stories.tsx +348 -304
- package/dist/icons/moon-icon/MoonIcon.stories.tsx +191 -167
- package/dist/icons/move-horizontal-icon/MoveHorizontalIcon.stories.tsx +380 -326
- package/dist/icons/move-vertical-icon/MoveVerticalIcon.stories.tsx +345 -291
- package/dist/icons/musical-note-icon/MusicalNoteIcon.stories.tsx +310 -266
- package/dist/icons/notepad-icon/NotepadIcon.stories.tsx +311 -271
- package/dist/icons/notes-icon/NotesIcon.stories.tsx +311 -271
- package/dist/icons/page-search-icon/PageSearchIcon.stories.tsx +309 -271
- package/dist/icons/page-text-icon/PageTextIcon.stories.tsx +248 -210
- package/dist/icons/paint-roll-icon/PaintRollIcon.stories.tsx +310 -262
- package/dist/icons/paper-plane-icon/PaperPlaneIcon.stories.tsx +274 -236
- package/dist/icons/pause-icon/PauseIcon.stories.tsx +324 -280
- package/dist/icons/pencil-icon/PencilIcon.stories.tsx +323 -281
- package/dist/icons/phone-icon/PhoneIcon.stories.tsx +288 -240
- package/dist/icons/plus-icon/PlusIcon.stories.tsx +315 -273
- package/dist/icons/pocket-studio-icon/PocketStudioIcon.stories.tsx +278 -234
- package/dist/icons/scroll-down-icon/ScrollDownIcon.stories.tsx +161 -151
- package/dist/icons/search-icon/SearchIcon.stories.tsx +324 -284
- package/dist/icons/setting-icon/SettingIcon.stories.tsx +306 -264
- package/dist/icons/share-icon/ShareIcon.stories.tsx +314 -272
- package/dist/icons/shield-icon/ShieldIcon.stories.tsx +281 -235
- package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +309 -250
- package/dist/icons/skip-backward-icon/SkipBackwardIcon.stories.tsx +317 -279
- package/dist/icons/skip-forward-icon/SkipForwardIcon.stories.tsx +315 -279
- package/dist/icons/sparkles-soft-icon/SparklesSoftIcon.stories.tsx +299 -253
- package/dist/icons/spinner-gradient-icon/SpinnerGradientIcon.stories.tsx +185 -169
- package/dist/icons/spinner-gradient-icon/index.tsx +6 -1
- package/dist/icons/spinner-solid-icon/SpinnerSolidIcon.stories.tsx +192 -168
- package/dist/icons/spinner-solid-icon/index.tsx +6 -1
- package/dist/icons/spinner-solid-neutral-icon/SpinnerSolidINeutralcon.stories.tsx +212 -178
- package/dist/icons/spinner-solid-neutral-icon/index.tsx +1 -1
- package/dist/icons/star-icon/StarIcon.stories.tsx +290 -244
- package/dist/icons/store-coin-icon/StoreCoinIcon.stories.tsx +286 -234
- package/dist/icons/suggestion-icon/SuggestionIcon.stories.tsx +272 -230
- package/dist/icons/sun-icon/SunIcon.stories.tsx +262 -226
- package/dist/icons/text-color-icon/TextColorIcon.stories.tsx +321 -279
- package/dist/icons/text-indicator-icon/TextIndicatorIcon.stories.tsx +332 -282
- package/dist/icons/threads-icon/ThreadsIcon.stories.tsx +394 -342
- package/dist/icons/tick-circle-icon/TickCircleIcon.stories.tsx +338 -290
- package/dist/icons/tick-icon/TickIcon.stories.tsx +364 -315
- package/dist/icons/trash-icon/TrashIcon.stories.tsx +293 -253
- package/dist/icons/twitter-x-icon/TwitterXIcon.stories.tsx +396 -338
- package/dist/icons/upload-icon/UploadIcon.stories.tsx +291 -247
- package/dist/icons/vertical-menu-icon/VerticalMenuIcon.stories.tsx +309 -271
- package/dist/icons/video-play-list-icon/VideoPlaylistIcon.stories.tsx +336 -290
- package/dist/icons/voice-playing-icon/VoicePlayingIcon.stories.tsx +382 -334
- package/dist/icons/volume-full-icon/VolumeFullIcon.stories.tsx +349 -305
- package/dist/icons/volume-half-icon/VolumeHalfIcon.stories.tsx +327 -295
- package/dist/icons/volume-off-icon/VolumeOffIcon.stories.tsx +336 -296
- package/dist/icons/warning-icon/WarningIcon.stories.tsx +314 -274
- package/dist/icons/youtube-icon/YoutubeIcon.stories.tsx +311 -261
- package/dist/index.cjs +84 -84
- package/dist/index.js +84 -84
- package/dist/styles/aural-all-theme.css +1222 -0
- package/dist/styles/{aural-theme.css → aural-dark-theme.css} +15 -3
- package/dist/styles/aural-light-theme.css +1047 -0
- package/package.json +1 -1
|
@@ -161,7 +161,7 @@ export const WithTextarea: Story = {
|
|
|
161
161
|
<textarea
|
|
162
162
|
value={text}
|
|
163
163
|
onChange={(e) => setText(e.target.value)}
|
|
164
|
-
className="w-full resize-none rounded-md border
|
|
164
|
+
className="border-fm-divider-secondary w-full resize-none rounded-md border px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none"
|
|
165
165
|
placeholder="What's happening?"
|
|
166
166
|
rows={4}
|
|
167
167
|
aria-describedby="tweet-count"
|
|
@@ -194,12 +194,12 @@ export const WithInput: Story = {
|
|
|
194
194
|
type="text"
|
|
195
195
|
value={username}
|
|
196
196
|
onChange={(e) => setUsername(e.target.value)}
|
|
197
|
-
className="w-full rounded-md border
|
|
197
|
+
className="border-fm-divider-secondary w-full rounded-md border px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none"
|
|
198
198
|
placeholder="Enter username"
|
|
199
199
|
aria-describedby="username-count"
|
|
200
200
|
/>
|
|
201
201
|
<div className="mt-2 flex items-center justify-between">
|
|
202
|
-
<span className="text-
|
|
202
|
+
<span className="text-fm-secondary text-sm">
|
|
203
203
|
Must be unique and memorable
|
|
204
204
|
</span>
|
|
205
205
|
<CharCount
|
|
@@ -230,7 +230,7 @@ export const MultipleInputs: Story = {
|
|
|
230
230
|
type="text"
|
|
231
231
|
value={title}
|
|
232
232
|
onChange={(e) => setTitle(e.target.value)}
|
|
233
|
-
className="w-full rounded-md border
|
|
233
|
+
className="border-fm-divider-secondary w-full rounded-md border px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none"
|
|
234
234
|
placeholder="Enter post title"
|
|
235
235
|
aria-describedby="title-count"
|
|
236
236
|
/>
|
|
@@ -248,7 +248,7 @@ export const MultipleInputs: Story = {
|
|
|
248
248
|
<textarea
|
|
249
249
|
value={description}
|
|
250
250
|
onChange={(e) => setDescription(e.target.value)}
|
|
251
|
-
className="w-full resize-none rounded-md border
|
|
251
|
+
className="border-fm-divider-secondary w-full resize-none rounded-md border px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none"
|
|
252
252
|
placeholder="Describe your post"
|
|
253
253
|
rows={3}
|
|
254
254
|
aria-describedby="description-count"
|
|
@@ -270,12 +270,12 @@ export const MultipleInputs: Story = {
|
|
|
270
270
|
type="text"
|
|
271
271
|
value={tags}
|
|
272
272
|
onChange={(e) => setTags(e.target.value)}
|
|
273
|
-
className="w-full rounded-md border
|
|
273
|
+
className="border-fm-divider-secondary w-full rounded-md border px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none"
|
|
274
274
|
placeholder="react, typescript, ui"
|
|
275
275
|
aria-describedby="tags-count"
|
|
276
276
|
/>
|
|
277
277
|
<div className="mt-1 flex items-center justify-between">
|
|
278
|
-
<span className="text-
|
|
278
|
+
<span className="text-fm-secondary text-xs">
|
|
279
279
|
Separate tags with commas
|
|
280
280
|
</span>
|
|
281
281
|
<CharCount
|
|
@@ -313,7 +313,7 @@ export const AccessibilityExample: Story = {
|
|
|
313
313
|
className={`w-full resize-none rounded-md border px-3 py-2 focus:ring-2 focus:outline-none ${
|
|
314
314
|
isOverLimit
|
|
315
315
|
? "border-red-300 focus:ring-red-500"
|
|
316
|
-
: "border-
|
|
316
|
+
: "border-fm-divider-secondary focus:ring-blue-500"
|
|
317
317
|
}`}
|
|
318
318
|
placeholder="Enter your message"
|
|
319
319
|
rows={4}
|
|
@@ -322,7 +322,7 @@ export const AccessibilityExample: Story = {
|
|
|
322
322
|
required
|
|
323
323
|
/>
|
|
324
324
|
<div className="mt-2 flex items-start justify-between">
|
|
325
|
-
<div id="message-help" className="text-
|
|
325
|
+
<div id="message-help" className="text-fm-secondary text-sm">
|
|
326
326
|
{isOverLimit
|
|
327
327
|
? "Message is too long. Please shorten it."
|
|
328
328
|
: "Share your thoughts with the community."}
|
|
@@ -174,7 +174,7 @@ export const Default: Story = {
|
|
|
174
174
|
},
|
|
175
175
|
parameters: storyParameters,
|
|
176
176
|
render: (args) => (
|
|
177
|
-
<div className="flex h-32 items-center justify-center rounded-lg
|
|
177
|
+
<div className="bg-fm-surface-primary flex h-32 items-center justify-center rounded-lg p-8">
|
|
178
178
|
<CircularLoader {...args} />
|
|
179
179
|
</div>
|
|
180
180
|
),
|
|
@@ -192,46 +192,48 @@ export const Variants: Story = {
|
|
|
192
192
|
},
|
|
193
193
|
},
|
|
194
194
|
render: () => (
|
|
195
|
-
<div className="space-y-8 rounded-lg
|
|
195
|
+
<div className="bg-fm-surface-primary space-y-8 rounded-lg p-8">
|
|
196
196
|
<div className="text-center">
|
|
197
|
-
<h3 className="mb-4 text-xl font-bold
|
|
198
|
-
|
|
197
|
+
<h3 className="text-fm-primary mb-4 text-xl font-bold">
|
|
198
|
+
Spinner Variants
|
|
199
|
+
</h3>
|
|
200
|
+
<p className="text-fm-secondary text-sm">
|
|
199
201
|
Three distinct visual styles with full accessibility support
|
|
200
202
|
</p>
|
|
201
203
|
</div>
|
|
202
204
|
|
|
203
205
|
<div className="grid grid-cols-1 gap-8 md:grid-cols-3">
|
|
204
206
|
<div className="text-center">
|
|
205
|
-
<div className="mb-4 flex h-32 items-center justify-center rounded-lg border
|
|
207
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary mb-4 flex h-32 items-center justify-center rounded-lg border">
|
|
206
208
|
<CircularLoader variant="v1" text="Gradient" size="lg" />
|
|
207
209
|
</div>
|
|
208
210
|
<div className="space-y-1">
|
|
209
|
-
<div className="font-medium
|
|
210
|
-
<div className="text-
|
|
211
|
+
<div className="text-fm-primary font-medium">Variant V1</div>
|
|
212
|
+
<div className="text-fm-secondary text-xs">
|
|
211
213
|
Gradient spinner with smooth transitions
|
|
212
214
|
</div>
|
|
213
215
|
</div>
|
|
214
216
|
</div>
|
|
215
217
|
|
|
216
218
|
<div className="text-center">
|
|
217
|
-
<div className="mb-4 flex h-32 items-center justify-center rounded-lg border
|
|
219
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary mb-4 flex h-32 items-center justify-center rounded-lg border">
|
|
218
220
|
<CircularLoader variant="v2" text="Solid" size="lg" />
|
|
219
221
|
</div>
|
|
220
222
|
<div className="space-y-1">
|
|
221
|
-
<div className="font-medium
|
|
222
|
-
<div className="text-
|
|
223
|
+
<div className="text-fm-primary font-medium">Variant V2</div>
|
|
224
|
+
<div className="text-fm-secondary text-xs">
|
|
223
225
|
Solid spinner with consistent theming
|
|
224
226
|
</div>
|
|
225
227
|
</div>
|
|
226
228
|
</div>
|
|
227
229
|
|
|
228
230
|
<div className="text-center">
|
|
229
|
-
<div className="mb-4 flex h-32 items-center justify-center rounded-lg border
|
|
231
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary mb-4 flex h-32 items-center justify-center rounded-lg border">
|
|
230
232
|
<CircularLoader variant="v3" text="Neutral" size="lg" />
|
|
231
233
|
</div>
|
|
232
234
|
<div className="space-y-1">
|
|
233
|
-
<div className="font-medium
|
|
234
|
-
<div className="text-
|
|
235
|
+
<div className="text-fm-primary font-medium">Variant V3</div>
|
|
236
|
+
<div className="text-fm-secondary text-xs">
|
|
235
237
|
Neutral spinner for any theme
|
|
236
238
|
</div>
|
|
237
239
|
</div>
|
|
@@ -253,56 +255,62 @@ export const Sizes: Story = {
|
|
|
253
255
|
},
|
|
254
256
|
},
|
|
255
257
|
render: () => (
|
|
256
|
-
<div className="space-y-8 rounded-lg
|
|
258
|
+
<div className="bg-fm-surface-primary space-y-8 rounded-lg p-8">
|
|
257
259
|
<div className="text-center">
|
|
258
|
-
<h3 className="mb-4 text-xl font-bold
|
|
259
|
-
|
|
260
|
+
<h3 className="text-fm-primary mb-4 text-xl font-bold">
|
|
261
|
+
Size Variations
|
|
262
|
+
</h3>
|
|
263
|
+
<p className="text-fm-secondary text-sm">
|
|
260
264
|
Four predefined sizes for different contexts and use cases
|
|
261
265
|
</p>
|
|
262
266
|
</div>
|
|
263
267
|
|
|
264
268
|
<div className="grid grid-cols-2 gap-6 md:grid-cols-4">
|
|
265
269
|
<div className="text-center">
|
|
266
|
-
<div className="mb-4 flex h-24 items-center justify-center rounded-lg border
|
|
270
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary mb-4 flex h-24 items-center justify-center rounded-lg border">
|
|
267
271
|
<CircularLoader size="sm" text="Small" />
|
|
268
272
|
</div>
|
|
269
273
|
<div className="space-y-1">
|
|
270
|
-
<div className="font-medium
|
|
271
|
-
<div className="text-
|
|
274
|
+
<div className="text-fm-primary font-medium">Small</div>
|
|
275
|
+
<div className="text-fm-secondary text-xs">
|
|
272
276
|
16×16px - Inline elements
|
|
273
277
|
</div>
|
|
274
278
|
</div>
|
|
275
279
|
</div>
|
|
276
280
|
|
|
277
281
|
<div className="text-center">
|
|
278
|
-
<div className="mb-4 flex h-24 items-center justify-center rounded-lg border
|
|
282
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary mb-4 flex h-24 items-center justify-center rounded-lg border">
|
|
279
283
|
<CircularLoader size="md" text="Medium" />
|
|
280
284
|
</div>
|
|
281
285
|
<div className="space-y-1">
|
|
282
|
-
<div className="font-medium
|
|
283
|
-
<div className="text-
|
|
286
|
+
<div className="text-fm-primary font-medium">Medium</div>
|
|
287
|
+
<div className="text-fm-secondary text-xs">
|
|
288
|
+
24×24px - Default size
|
|
289
|
+
</div>
|
|
284
290
|
</div>
|
|
285
291
|
</div>
|
|
286
292
|
|
|
287
293
|
<div className="text-center">
|
|
288
|
-
<div className="mb-4 flex h-24 items-center justify-center rounded-lg border
|
|
294
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary mb-4 flex h-24 items-center justify-center rounded-lg border">
|
|
289
295
|
<CircularLoader size="lg" text="Large" />
|
|
290
296
|
</div>
|
|
291
297
|
<div className="space-y-1">
|
|
292
|
-
<div className="font-medium
|
|
293
|
-
<div className="text-
|
|
298
|
+
<div className="text-fm-primary font-medium">Large</div>
|
|
299
|
+
<div className="text-fm-secondary text-xs">
|
|
294
300
|
32×32px - Prominent loading
|
|
295
301
|
</div>
|
|
296
302
|
</div>
|
|
297
303
|
</div>
|
|
298
304
|
|
|
299
305
|
<div className="text-center">
|
|
300
|
-
<div className="mb-4 flex h-24 items-center justify-center rounded-lg border
|
|
306
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary mb-4 flex h-24 items-center justify-center rounded-lg border">
|
|
301
307
|
<CircularLoader size="xl" text="Extra Large" />
|
|
302
308
|
</div>
|
|
303
309
|
<div className="space-y-1">
|
|
304
|
-
<div className="font-medium
|
|
305
|
-
<div className="text-
|
|
310
|
+
<div className="text-fm-primary font-medium">Extra Large</div>
|
|
311
|
+
<div className="text-fm-secondary text-xs">
|
|
312
|
+
48×48px - Page loading
|
|
313
|
+
</div>
|
|
306
314
|
</div>
|
|
307
315
|
</div>
|
|
308
316
|
</div>
|
|
@@ -322,32 +330,32 @@ export const AccessibilityFeatures: Story = {
|
|
|
322
330
|
},
|
|
323
331
|
},
|
|
324
332
|
render: () => (
|
|
325
|
-
<div className="space-y-8 rounded-lg
|
|
333
|
+
<div className="bg-fm-surface-primary space-y-8 rounded-lg p-8">
|
|
326
334
|
<div className="text-center">
|
|
327
|
-
<h3 className="mb-4 text-xl font-bold
|
|
335
|
+
<h3 className="text-fm-primary mb-4 text-xl font-bold">
|
|
328
336
|
Accessibility Features
|
|
329
337
|
</h3>
|
|
330
|
-
<p className="text-
|
|
338
|
+
<p className="text-fm-secondary text-sm">
|
|
331
339
|
Built with comprehensive screen reader support and ARIA attributes
|
|
332
340
|
</p>
|
|
333
341
|
</div>
|
|
334
342
|
|
|
335
343
|
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
|
336
344
|
<div className="space-y-6">
|
|
337
|
-
<div className="rounded-lg border
|
|
338
|
-
<h4 className="mb-4 text-lg font-semibold
|
|
345
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-6">
|
|
346
|
+
<h4 className="text-fm-primary mb-4 text-lg font-semibold">
|
|
339
347
|
Visual + Screen Reader
|
|
340
348
|
</h4>
|
|
341
349
|
<div className="mb-4 flex items-center justify-center">
|
|
342
350
|
<CircularLoader text="Loading data..." size="lg" />
|
|
343
351
|
</div>
|
|
344
|
-
<div className="text-
|
|
352
|
+
<div className="text-fm-secondary text-sm">
|
|
345
353
|
Shows visible text and provides the same message to screen readers
|
|
346
354
|
</div>
|
|
347
355
|
</div>
|
|
348
356
|
|
|
349
|
-
<div className="rounded-lg border
|
|
350
|
-
<h4 className="mb-4 text-lg font-semibold
|
|
357
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-6">
|
|
358
|
+
<h4 className="text-fm-primary mb-4 text-lg font-semibold">
|
|
351
359
|
Screen Reader Only
|
|
352
360
|
</h4>
|
|
353
361
|
<div className="mb-4 flex items-center justify-center">
|
|
@@ -356,15 +364,15 @@ export const AccessibilityFeatures: Story = {
|
|
|
356
364
|
size="lg"
|
|
357
365
|
/>
|
|
358
366
|
</div>
|
|
359
|
-
<div className="text-
|
|
367
|
+
<div className="text-fm-secondary text-sm">
|
|
360
368
|
No visible text but provides descriptive label for screen readers
|
|
361
369
|
</div>
|
|
362
370
|
</div>
|
|
363
371
|
</div>
|
|
364
372
|
|
|
365
373
|
<div className="space-y-6">
|
|
366
|
-
<div className="rounded-lg border
|
|
367
|
-
<h4 className="mb-4 text-lg font-semibold
|
|
374
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-6">
|
|
375
|
+
<h4 className="text-fm-primary mb-4 text-lg font-semibold">
|
|
368
376
|
Custom Loading Message
|
|
369
377
|
</h4>
|
|
370
378
|
<div className="mb-4 flex items-center justify-center">
|
|
@@ -374,13 +382,13 @@ export const AccessibilityFeatures: Story = {
|
|
|
374
382
|
size="lg"
|
|
375
383
|
/>
|
|
376
384
|
</div>
|
|
377
|
-
<div className="text-
|
|
385
|
+
<div className="text-fm-secondary text-sm">
|
|
378
386
|
Visual text differs from detailed screen reader message
|
|
379
387
|
</div>
|
|
380
388
|
</div>
|
|
381
389
|
|
|
382
|
-
<div className="rounded-lg border
|
|
383
|
-
<h4 className="mb-4 text-lg font-semibold
|
|
390
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-6">
|
|
391
|
+
<h4 className="text-fm-primary mb-4 text-lg font-semibold">
|
|
384
392
|
Assertive Announcements
|
|
385
393
|
</h4>
|
|
386
394
|
<div className="mb-4 flex items-center justify-center">
|
|
@@ -390,23 +398,21 @@ export const AccessibilityFeatures: Story = {
|
|
|
390
398
|
size="lg"
|
|
391
399
|
/>
|
|
392
400
|
</div>
|
|
393
|
-
<div className="text-
|
|
401
|
+
<div className="text-fm-secondary text-sm">
|
|
394
402
|
Immediately announces changes to screen readers
|
|
395
403
|
</div>
|
|
396
404
|
</div>
|
|
397
405
|
</div>
|
|
398
406
|
</div>
|
|
399
407
|
|
|
400
|
-
<div className="
|
|
401
|
-
<h4 className="mb-4 text-lg font-semibold
|
|
408
|
+
<div className="border-fm-divider-secondary bg-fm-surface-info-sec rounded-lg border p-6">
|
|
409
|
+
<h4 className="text-fm-info mb-4 text-lg font-semibold">
|
|
402
410
|
Accessibility Best Practices
|
|
403
411
|
</h4>
|
|
404
412
|
<div className="grid grid-cols-1 gap-4 md:grid-cols-2">
|
|
405
413
|
<div>
|
|
406
|
-
<h5 className="mb-2 font-medium
|
|
407
|
-
|
|
408
|
-
</h5>
|
|
409
|
-
<ul className="space-y-1 text-sm text-blue-200/80">
|
|
414
|
+
<h5 className="text-fm-info mb-2 font-medium">Built-in Features</h5>
|
|
415
|
+
<ul className="text-fm-info-sec space-y-1 text-sm">
|
|
410
416
|
<li>• Role="status" for loading states</li>
|
|
411
417
|
<li>• ARIA-live regions for dynamic updates</li>
|
|
412
418
|
<li>• ARIA-hidden on decorative elements</li>
|
|
@@ -415,8 +421,8 @@ export const AccessibilityFeatures: Story = {
|
|
|
415
421
|
</ul>
|
|
416
422
|
</div>
|
|
417
423
|
<div>
|
|
418
|
-
<h5 className="mb-2 font-medium
|
|
419
|
-
<ul className="space-y-1 text-sm
|
|
424
|
+
<h5 className="text-fm-info mb-2 font-medium">Usage Guidelines</h5>
|
|
425
|
+
<ul className="text-fm-info-sec space-y-1 text-sm">
|
|
420
426
|
<li>• Always provide context about what's loading</li>
|
|
421
427
|
<li>• Use "polite" for non-critical updates</li>
|
|
422
428
|
<li>• Use "assertive" for important changes</li>
|
|
@@ -462,12 +468,12 @@ export const UsageExamples: Story = {
|
|
|
462
468
|
}
|
|
463
469
|
|
|
464
470
|
return (
|
|
465
|
-
<div className="space-y-8 rounded-lg
|
|
471
|
+
<div className="bg-fm-surface-primary space-y-8 rounded-lg p-8">
|
|
466
472
|
<div className="text-center">
|
|
467
|
-
<h3 className="mb-4 text-xl font-bold
|
|
473
|
+
<h3 className="text-fm-primary mb-4 text-xl font-bold">
|
|
468
474
|
Real-world Usage
|
|
469
475
|
</h3>
|
|
470
|
-
<p className="text-
|
|
476
|
+
<p className="text-fm-secondary text-sm">
|
|
471
477
|
Common UI patterns and contexts where CircularLoader is used
|
|
472
478
|
</p>
|
|
473
479
|
</div>
|
|
@@ -475,7 +481,9 @@ export const UsageExamples: Story = {
|
|
|
475
481
|
<div className="grid grid-cols-1 gap-8 lg:grid-cols-3">
|
|
476
482
|
{/* Button Loading */}
|
|
477
483
|
<div className="space-y-4">
|
|
478
|
-
<h4 className="text-lg font-semibold
|
|
484
|
+
<h4 className="text-fm-primary text-lg font-semibold">
|
|
485
|
+
Button Loading
|
|
486
|
+
</h4>
|
|
479
487
|
<div className="space-y-3">
|
|
480
488
|
<Button
|
|
481
489
|
onClick={handleButtonClick}
|
|
@@ -491,7 +499,7 @@ export const UsageExamples: Story = {
|
|
|
491
499
|
"Save Changes"
|
|
492
500
|
)}
|
|
493
501
|
</Button>
|
|
494
|
-
<div className="text-
|
|
502
|
+
<div className="text-fm-secondary text-xs">
|
|
495
503
|
Inline loader in button with accessible label
|
|
496
504
|
</div>
|
|
497
505
|
</div>
|
|
@@ -499,8 +507,10 @@ export const UsageExamples: Story = {
|
|
|
499
507
|
|
|
500
508
|
{/* Card Loading */}
|
|
501
509
|
<div className="space-y-4">
|
|
502
|
-
<h4 className="text-lg font-semibold
|
|
503
|
-
|
|
510
|
+
<h4 className="text-fm-primary text-lg font-semibold">
|
|
511
|
+
Card Loading
|
|
512
|
+
</h4>
|
|
513
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
|
|
504
514
|
{cardLoading ? (
|
|
505
515
|
<div className="flex h-32 items-center justify-center">
|
|
506
516
|
<CircularLoader
|
|
@@ -511,9 +521,9 @@ export const UsageExamples: Story = {
|
|
|
511
521
|
</div>
|
|
512
522
|
) : (
|
|
513
523
|
<div className="space-y-3">
|
|
514
|
-
<div className="h-4 rounded
|
|
515
|
-
<div className="h-4 rounded
|
|
516
|
-
<div className="h-4 w-3/4 rounded
|
|
524
|
+
<div className="bg-fm-surface-tertiary h-4 rounded"></div>
|
|
525
|
+
<div className="bg-fm-surface-tertiary h-4 rounded"></div>
|
|
526
|
+
<div className="bg-fm-surface-tertiary h-4 w-3/4 rounded"></div>
|
|
517
527
|
<Button
|
|
518
528
|
onClick={handleCardRefresh}
|
|
519
529
|
size="sm"
|
|
@@ -524,15 +534,17 @@ export const UsageExamples: Story = {
|
|
|
524
534
|
</div>
|
|
525
535
|
)}
|
|
526
536
|
</div>
|
|
527
|
-
<div className="text-
|
|
537
|
+
<div className="text-fm-secondary text-xs">
|
|
528
538
|
Content area with detailed loading message
|
|
529
539
|
</div>
|
|
530
540
|
</div>
|
|
531
541
|
|
|
532
542
|
{/* Page Loading */}
|
|
533
543
|
<div className="space-y-4">
|
|
534
|
-
<h4 className="text-lg font-semibold
|
|
535
|
-
|
|
544
|
+
<h4 className="text-fm-primary text-lg font-semibold">
|
|
545
|
+
Page Loading
|
|
546
|
+
</h4>
|
|
547
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
|
|
536
548
|
{pageLoading ? (
|
|
537
549
|
<div className="flex h-32 items-center justify-center">
|
|
538
550
|
<CircularLoader
|
|
@@ -545,7 +557,7 @@ export const UsageExamples: Story = {
|
|
|
545
557
|
) : (
|
|
546
558
|
<div className="space-y-3">
|
|
547
559
|
<div className="text-center">
|
|
548
|
-
<div className="mb-2 text-sm font-medium
|
|
560
|
+
<div className="text-fm-primary mb-2 text-sm font-medium">
|
|
549
561
|
Application Ready
|
|
550
562
|
</div>
|
|
551
563
|
<Button
|
|
@@ -559,15 +571,15 @@ export const UsageExamples: Story = {
|
|
|
559
571
|
</div>
|
|
560
572
|
)}
|
|
561
573
|
</div>
|
|
562
|
-
<div className="text-
|
|
574
|
+
<div className="text-fm-secondary text-xs">
|
|
563
575
|
Full page loading with assertive announcements
|
|
564
576
|
</div>
|
|
565
577
|
</div>
|
|
566
578
|
</div>
|
|
567
579
|
|
|
568
580
|
{/* Form Submission Example */}
|
|
569
|
-
<div className="rounded-lg border
|
|
570
|
-
<h4 className="mb-4 text-lg font-semibold
|
|
581
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-6">
|
|
582
|
+
<h4 className="text-fm-primary mb-4 text-lg font-semibold">
|
|
571
583
|
Form Submission
|
|
572
584
|
</h4>
|
|
573
585
|
<div className="space-y-4">
|
|
@@ -575,23 +587,23 @@ export const UsageExamples: Story = {
|
|
|
575
587
|
<input
|
|
576
588
|
type="text"
|
|
577
589
|
placeholder="Name"
|
|
578
|
-
className="
|
|
590
|
+
className="border-fm-divider-secondary bg-fm-surface-tertiary text-fm-primary placeholder:text-fm-tertiary rounded-lg border p-3"
|
|
579
591
|
/>
|
|
580
592
|
<input
|
|
581
593
|
type="email"
|
|
582
594
|
placeholder="Email"
|
|
583
|
-
className="
|
|
595
|
+
className="border-fm-divider-secondary bg-fm-surface-tertiary text-fm-primary placeholder:text-fm-tertiary rounded-lg border p-3"
|
|
584
596
|
/>
|
|
585
597
|
</div>
|
|
586
598
|
<textarea
|
|
587
599
|
placeholder="Message"
|
|
588
600
|
rows={3}
|
|
589
|
-
className="w-full rounded-lg border
|
|
601
|
+
className="border-fm-divider-secondary bg-fm-surface-tertiary text-fm-primary placeholder:text-fm-tertiary w-full rounded-lg border p-3"
|
|
590
602
|
/>
|
|
591
603
|
<div className="flex items-center justify-between">
|
|
592
604
|
<div className="flex items-center gap-2">
|
|
593
605
|
<CircularLoader size="sm" aria-label="Submitting form" />
|
|
594
|
-
<span className="text-
|
|
606
|
+
<span className="text-fm-secondary text-sm">
|
|
595
607
|
Submitting your message...
|
|
596
608
|
</span>
|
|
597
609
|
</div>
|
|
@@ -664,60 +676,64 @@ export const Playground: Story = {
|
|
|
664
676
|
},
|
|
665
677
|
},
|
|
666
678
|
render: (args) => (
|
|
667
|
-
<div className="space-y-8 rounded-lg
|
|
679
|
+
<div className="bg-fm-surface-primary space-y-8 rounded-lg p-8">
|
|
668
680
|
<div className="text-center">
|
|
669
|
-
<h3 className="mb-4 text-xl font-bold
|
|
681
|
+
<h3 className="text-fm-primary mb-4 text-xl font-bold">
|
|
670
682
|
Interactive Playground
|
|
671
683
|
</h3>
|
|
672
|
-
<p className="text-
|
|
684
|
+
<p className="text-fm-secondary text-sm">
|
|
673
685
|
Experiment with all CircularLoader configurations and accessibility
|
|
674
686
|
features
|
|
675
687
|
</p>
|
|
676
688
|
</div>
|
|
677
689
|
|
|
678
690
|
<div className="flex items-center justify-center">
|
|
679
|
-
<div className="rounded-lg border
|
|
691
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-8">
|
|
680
692
|
<CircularLoader {...args} />
|
|
681
693
|
</div>
|
|
682
694
|
</div>
|
|
683
695
|
|
|
684
|
-
<div className="rounded-lg border
|
|
685
|
-
<h4 className="mb-4 text-lg font-semibold
|
|
696
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-6">
|
|
697
|
+
<h4 className="text-fm-primary mb-4 text-lg font-semibold">
|
|
686
698
|
Current Configuration
|
|
687
699
|
</h4>
|
|
688
700
|
<div className="grid grid-cols-2 gap-4 text-sm">
|
|
689
701
|
<div>
|
|
690
|
-
<div className="font-medium
|
|
691
|
-
<div className="text-
|
|
702
|
+
<div className="text-fm-primary font-medium">Variant:</div>
|
|
703
|
+
<div className="text-fm-secondary">{args.variant}</div>
|
|
692
704
|
</div>
|
|
693
705
|
<div>
|
|
694
|
-
<div className="font-medium
|
|
695
|
-
<div className="text-
|
|
706
|
+
<div className="text-fm-primary font-medium">Size:</div>
|
|
707
|
+
<div className="text-fm-secondary">{args.size}</div>
|
|
696
708
|
</div>
|
|
697
709
|
<div>
|
|
698
|
-
<div className="font-medium
|
|
699
|
-
<div className="text-
|
|
710
|
+
<div className="text-fm-primary font-medium">Visual Text:</div>
|
|
711
|
+
<div className="text-fm-secondary">{args.text || "None"}</div>
|
|
700
712
|
</div>
|
|
701
713
|
<div>
|
|
702
|
-
<div className="font-medium
|
|
703
|
-
<div className="text-
|
|
714
|
+
<div className="text-fm-primary font-medium">ARIA Label:</div>
|
|
715
|
+
<div className="text-fm-secondary">
|
|
716
|
+
{args["aria-label"] || "None"}
|
|
717
|
+
</div>
|
|
704
718
|
</div>
|
|
705
719
|
<div>
|
|
706
|
-
<div className="font-medium
|
|
707
|
-
<div className="text-
|
|
720
|
+
<div className="text-fm-primary font-medium">ARIA Live:</div>
|
|
721
|
+
<div className="text-fm-secondary">{args["aria-live"]}</div>
|
|
708
722
|
</div>
|
|
709
723
|
<div>
|
|
710
|
-
<div className="font-medium
|
|
711
|
-
<div className="text-
|
|
724
|
+
<div className="text-fm-primary font-medium">Loading Message:</div>
|
|
725
|
+
<div className="text-fm-secondary">
|
|
726
|
+
{args.loadingMessage || "None"}
|
|
727
|
+
</div>
|
|
712
728
|
</div>
|
|
713
729
|
</div>
|
|
714
730
|
</div>
|
|
715
731
|
|
|
716
|
-
<div className="
|
|
717
|
-
<h4 className="mb-4 text-lg font-semibold
|
|
732
|
+
<div className="border-fm-divider-positive bg-fm-surface-positive-sec rounded-lg border p-6">
|
|
733
|
+
<h4 className="text-fm-positive mb-4 text-lg font-semibold">
|
|
718
734
|
Accessibility Info
|
|
719
735
|
</h4>
|
|
720
|
-
<div className="space-y-2 text-sm
|
|
736
|
+
<div className="text-fm-positive-sec space-y-2 text-sm">
|
|
721
737
|
<div>
|
|
722
738
|
<strong>Screen Reader Message:</strong>{" "}
|
|
723
739
|
{args.text ||
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-vite"
|
|
3
|
+
import { toast } from "sonner"
|
|
3
4
|
|
|
4
5
|
import { ClampLines } from "."
|
|
6
|
+
import { Toaster } from "../toast"
|
|
5
7
|
|
|
6
8
|
const LONG_TEXT =
|
|
7
9
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
@@ -108,6 +110,29 @@ export const WithCustomButton: Story = {
|
|
|
108
110
|
},
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
export const WithOnToggle: Story = {
|
|
114
|
+
name: "With onToggle (Toast)",
|
|
115
|
+
args: {
|
|
116
|
+
children: LONG_TEXT,
|
|
117
|
+
wordLimit: 20,
|
|
118
|
+
onToggle: (open) => {
|
|
119
|
+
toast(open ? "Expanded" : "Collapsed", {
|
|
120
|
+
description: open
|
|
121
|
+
? "Full text is now visible."
|
|
122
|
+
: "Text has been collapsed.",
|
|
123
|
+
})
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
decorators: [
|
|
127
|
+
(Story) => (
|
|
128
|
+
<>
|
|
129
|
+
<Story />
|
|
130
|
+
<Toaster />
|
|
131
|
+
</>
|
|
132
|
+
),
|
|
133
|
+
],
|
|
134
|
+
}
|
|
135
|
+
|
|
111
136
|
export const ShortText: Story = {
|
|
112
137
|
name: "Short Text (no truncation)",
|
|
113
138
|
args: {
|
|
@@ -17,6 +17,7 @@ export interface IClampLinesProps {
|
|
|
17
17
|
minWordLimit?: number
|
|
18
18
|
readMoreText?: string
|
|
19
19
|
readLessText?: string
|
|
20
|
+
onToggle?: (open: boolean) => void
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export const ClampLines = ({
|
|
@@ -28,6 +29,7 @@ export const ClampLines = ({
|
|
|
28
29
|
minWordLimit,
|
|
29
30
|
readMoreText = "READ MORE",
|
|
30
31
|
readLessText = "READ LESS",
|
|
32
|
+
onToggle,
|
|
31
33
|
}: IClampLinesProps) => {
|
|
32
34
|
const [open, setOpen] = useState(false)
|
|
33
35
|
const ref = useRef<HTMLParagraphElement | null>(null)
|
|
@@ -112,11 +114,14 @@ export const ClampLines = ({
|
|
|
112
114
|
}, [shouldTruncate, effectiveWordLimit, children, open])
|
|
113
115
|
|
|
114
116
|
const handleClick = () => {
|
|
115
|
-
|
|
117
|
+
const next = !open
|
|
118
|
+
setOpen(next)
|
|
119
|
+
onToggle?.(next)
|
|
116
120
|
}
|
|
117
121
|
|
|
118
122
|
const renderButton = !button ? (
|
|
119
123
|
<Button
|
|
124
|
+
data-nosnippet
|
|
120
125
|
variant="text"
|
|
121
126
|
noise="none"
|
|
122
127
|
innerClassName={cn("px-0! h-fit inline", classes.clampLineBtnInnerClass)}
|
|
@@ -203,7 +203,7 @@ export const RichContent: Story = {
|
|
|
203
203
|
</div>
|
|
204
204
|
<div>
|
|
205
205
|
<h4 className="mb-2 font-semibold">Pricing:</h4>
|
|
206
|
-
<div className="
|
|
206
|
+
<div className="bg-fm-surface-secondary rounded p-3">
|
|
207
207
|
<p className="text-sm">Starting at $29/month for basic plan</p>
|
|
208
208
|
</div>
|
|
209
209
|
</div>
|