aural-ui 2.0.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.
- package/LICENSE +21 -0
- package/README.md +456 -0
- package/dist/components/aspect-ratio/AspectRatio.stories.tsx +1327 -0
- package/dist/components/aspect-ratio/index.tsx +10 -0
- package/dist/components/aspect-ratio/meta.ts +8 -0
- package/dist/components/avatar/Avatar.stories.tsx +645 -0
- package/dist/components/avatar/index.tsx +50 -0
- package/dist/components/avatar/meta.ts +8 -0
- package/dist/components/badge/Badge.stories.tsx +169 -0
- package/dist/components/badge/index.tsx +28 -0
- package/dist/components/badge/meta.ts +6 -0
- package/dist/components/banner/Banner.stories.tsx +475 -0
- package/dist/components/banner/index.tsx +256 -0
- package/dist/components/banner/meta.ts +36 -0
- package/dist/components/button/Button.stories.tsx +74 -0
- package/dist/components/button/index.tsx +158 -0
- package/dist/components/button/meta.ts +33 -0
- package/dist/components/card/Card.stories.tsx +377 -0
- package/dist/components/card/index.tsx +85 -0
- package/dist/components/card/meta.ts +14 -0
- package/dist/components/char-count/CharCount.stories.tsx +334 -0
- package/dist/components/char-count/index.tsx +51 -0
- package/dist/components/char-count/meta.ts +13 -0
- package/dist/components/checkbox/Checkbox.stories.tsx +209 -0
- package/dist/components/checkbox/index.tsx +34 -0
- package/dist/components/checkbox/meta.ts +19 -0
- package/dist/components/chip/Chip.stories.tsx +207 -0
- package/dist/components/chip/index.tsx +92 -0
- package/dist/components/chip/meta.ts +17 -0
- package/dist/components/circular-loader/CircularLoader.stories.tsx +741 -0
- package/dist/components/circular-loader/index.tsx +138 -0
- package/dist/components/circular-loader/meta.ts +11 -0
- package/dist/components/collapsible/Collapsible.stories.tsx +319 -0
- package/dist/components/collapsible/index.tsx +158 -0
- package/dist/components/collapsible/meta.ts +22 -0
- package/dist/components/command/Command.stories.tsx +996 -0
- package/dist/components/command/index.tsx +324 -0
- package/dist/components/command/meta.ts +18 -0
- package/dist/components/dialog/Dialog.stories.tsx +963 -0
- package/dist/components/dialog/index.tsx +250 -0
- package/dist/components/dialog/meta.ts +28 -0
- package/dist/components/divider/Divider.stories.tsx +633 -0
- package/dist/components/divider/index.tsx +181 -0
- package/dist/components/divider/meta.ts +12 -0
- package/dist/components/dot-loader/DotLoader.stories.tsx +352 -0
- package/dist/components/dot-loader/index.tsx +78 -0
- package/dist/components/dot-loader/meta.ts +14 -0
- package/dist/components/dropdown/Dropdown.stories.tsx +1210 -0
- package/dist/components/dropdown/index.tsx +479 -0
- package/dist/components/dropdown/meta.ts +21 -0
- package/dist/components/form/Form.stories.tsx +320 -0
- package/dist/components/form/index.tsx +183 -0
- package/dist/components/form/meta.ts +11 -0
- package/dist/components/helper-text/HelperText.stories.tsx +254 -0
- package/dist/components/helper-text/index.tsx +102 -0
- package/dist/components/helper-text/meta.ts +18 -0
- package/dist/components/hover-card/HoverCard.stories.tsx +1328 -0
- package/dist/components/hover-card/index.tsx +42 -0
- package/dist/components/hover-card/meta.ts +12 -0
- package/dist/components/icon-button/IconButton.stories.tsx +252 -0
- package/dist/components/icon-button/index.tsx +130 -0
- package/dist/components/icon-button/meta.ts +20 -0
- package/dist/components/if-else/if-else.stories.tsx +100 -0
- package/dist/components/if-else/index.tsx +56 -0
- package/dist/components/if-else/meta.ts +6 -0
- package/dist/components/index.ts +70 -0
- package/dist/components/input/Input.stories.tsx +431 -0
- package/dist/components/input/index.tsx +487 -0
- package/dist/components/input/meta.ts +28 -0
- package/dist/components/label/Label.stories.tsx +200 -0
- package/dist/components/label/index.tsx +43 -0
- package/dist/components/label/meta.ts +14 -0
- package/dist/components/list/List.stories.tsx +963 -0
- package/dist/components/list/index.tsx +567 -0
- package/dist/components/list/meta.ts +24 -0
- package/dist/components/marquee/Marquee.stories.tsx +819 -0
- package/dist/components/marquee/index.tsx +107 -0
- package/dist/components/marquee/meta.ts +6 -0
- package/dist/components/overlay/Overlay.stories.tsx +954 -0
- package/dist/components/overlay/index.tsx +58 -0
- package/dist/components/overlay/meta.ts +10 -0
- package/dist/components/pagination/Pagination.stories.tsx +354 -0
- package/dist/components/pagination/index.tsx +455 -0
- package/dist/components/pagination/meta.ts +29 -0
- package/dist/components/popover/Popover.stories.tsx +1037 -0
- package/dist/components/popover/index.tsx +67 -0
- package/dist/components/popover/meta.ts +12 -0
- package/dist/components/radio/Radio.stories.tsx +146 -0
- package/dist/components/radio/index.tsx +41 -0
- package/dist/components/radio/meta.ts +19 -0
- package/dist/components/resizable/Resizable.stories.tsx +866 -0
- package/dist/components/resizable/index.tsx +55 -0
- package/dist/components/resizable/meta.ts +12 -0
- package/dist/components/scroll-area/ScrollArea.stories.tsx +1104 -0
- package/dist/components/scroll-area/index.tsx +55 -0
- package/dist/components/scroll-area/meta.ts +8 -0
- package/dist/components/search/Search.stories.tsx +678 -0
- package/dist/components/search/index.tsx +141 -0
- package/dist/components/search/meta.ts +6 -0
- package/dist/components/select/Select.stories.tsx +962 -0
- package/dist/components/select/index.tsx +512 -0
- package/dist/components/select/meta.ts +40 -0
- package/dist/components/sheet/Sheet.stories.tsx +1060 -0
- package/dist/components/sheet/index.tsx +440 -0
- package/dist/components/sheet/meta.ts +38 -0
- package/dist/components/skelton/Skelton.stories.tsx +859 -0
- package/dist/components/skelton/index.tsx +17 -0
- package/dist/components/skelton/meta.ts +6 -0
- package/dist/components/slider/Slider.stories.tsx +876 -0
- package/dist/components/slider/index.tsx +156 -0
- package/dist/components/slider/meta.ts +29 -0
- package/dist/components/stepper/Stepper.stories.tsx +639 -0
- package/dist/components/stepper/index.tsx +650 -0
- package/dist/components/stepper/meta.ts +19 -0
- package/dist/components/switch/Switch.stories.tsx +85 -0
- package/dist/components/switch/index.tsx +37 -0
- package/dist/components/switch/meta.ts +24 -0
- package/dist/components/switch-case/SwitchCase.stories.tsx +209 -0
- package/dist/components/switch-case/index.tsx +89 -0
- package/dist/components/switch-case/meta.ts +6 -0
- package/dist/components/table/Table.stories.tsx +1095 -0
- package/dist/components/table/index.tsx +113 -0
- package/dist/components/table/meta.ts +20 -0
- package/dist/components/tabs/Tabs.stories.tsx +1379 -0
- package/dist/components/tabs/index.tsx +186 -0
- package/dist/components/tabs/meta.ts +25 -0
- package/dist/components/tag/Tag.stories.tsx +625 -0
- package/dist/components/tag/index.tsx +320 -0
- package/dist/components/tag/meta.ts +52 -0
- package/dist/components/textarea/TextArea.stories.tsx +723 -0
- package/dist/components/textarea/index.tsx +480 -0
- package/dist/components/textarea/meta.ts +23 -0
- package/dist/components/toast/Toast.stories.tsx +1427 -0
- package/dist/components/toast/index.tsx +26 -0
- package/dist/components/toast/meta.ts +19 -0
- package/dist/components/toggle/Toggle.stories.tsx +1093 -0
- package/dist/components/toggle/index.tsx +44 -0
- package/dist/components/toggle/meta.ts +19 -0
- package/dist/components/tooltip/Tooltip.stories.tsx +1548 -0
- package/dist/components/tooltip/index.tsx +304 -0
- package/dist/components/tooltip/meta.ts +21 -0
- package/dist/components/typography/Typography.stories.tsx +197 -0
- package/dist/components/typography/index.tsx +184 -0
- package/dist/components/typography/meta.ts +38 -0
- package/dist/fonts/LabGrotesque-Regular.ttf +0 -0
- package/dist/fonts/LabGrotesqueTRIAL-Bold.otf +0 -0
- package/dist/fonts/LabGrotesqueTRIAL-Light.otf +0 -0
- package/dist/fonts/LabGrotesqueTRIAL-Medium.otf +0 -0
- package/dist/fonts/LabGrotesqueTRIAL-Regular.otf +0 -0
- package/dist/fonts/PPSupplySans-Regular (1).otf +0 -0
- package/dist/fonts/PPSupplySans-Regular.otf +0 -0
- package/dist/fonts/PPSupplySans-Ultralight.otf +0 -0
- package/dist/hooks/index.ts +3 -0
- package/dist/hooks/use-previous/UsePrevious.stories.tsx +997 -0
- package/dist/hooks/use-previous/index.ts +15 -0
- package/dist/hooks/use-previous/meta.ts +6 -0
- package/dist/hooks/use-standalone-pagination/UseStandalonePagination.stories.tsx +983 -0
- package/dist/hooks/use-standalone-pagination/index.ts +146 -0
- package/dist/hooks/use-standalone-pagination/meta.ts +6 -0
- package/dist/icons/Icons.stories.tsx +29 -0
- package/dist/icons/alert-icon/AlertIcon.stories.tsx +991 -0
- package/dist/icons/alert-icon/index.tsx +48 -0
- package/dist/icons/alert-icon/meta.ts +8 -0
- package/dist/icons/all-icons.tsx +738 -0
- package/dist/icons/angle-down-icon/AngleDownIcon.stories.tsx +1031 -0
- package/dist/icons/angle-down-icon/index.tsx +25 -0
- package/dist/icons/angle-down-icon/meta.ts +8 -0
- package/dist/icons/arrow-box-left-icon/ArrowBoxLeftIcon.stories.tsx +1080 -0
- package/dist/icons/arrow-box-left-icon/index.tsx +24 -0
- package/dist/icons/arrow-box-left-icon/meta.ts +8 -0
- package/dist/icons/arrow-right-icon/ArrowRightIcon.stories.tsx +1151 -0
- package/dist/icons/arrow-right-icon/index.tsx +26 -0
- package/dist/icons/arrow-right-icon/meta.ts +8 -0
- package/dist/icons/arrow-right-up-icon/ArrowRightUpIcon.stories.tsx +1273 -0
- package/dist/icons/arrow-right-up-icon/index.tsx +24 -0
- package/dist/icons/arrow-right-up-icon/meta.ts +8 -0
- package/dist/icons/art-board-icon/ArtBoardIcon.stories.tsx +670 -0
- package/dist/icons/art-board-icon/index.tsx +24 -0
- package/dist/icons/art-board-icon/meta.ts +7 -0
- package/dist/icons/audio-bar-icon/AudioBarIcon.stories.tsx +1244 -0
- package/dist/icons/audio-bar-icon/index.tsx +19 -0
- package/dist/icons/audio-bar-icon/meta.ts +8 -0
- package/dist/icons/bubble-check-icon/BubbleCheckIcon.stories.tsx +1239 -0
- package/dist/icons/bubble-check-icon/index.tsx +24 -0
- package/dist/icons/bubble-check-icon/meta.ts +8 -0
- package/dist/icons/bubble-crossed-icon/BubbleCrossedIcon.stories.tsx +1228 -0
- package/dist/icons/bubble-crossed-icon/index.tsx +24 -0
- package/dist/icons/bubble-crossed-icon/meta.ts +8 -0
- package/dist/icons/bubble-sparkle-icon/BubbleSparkleIcon.stories.tsx +912 -0
- package/dist/icons/bubble-sparkle-icon/index.tsx +26 -0
- package/dist/icons/bubble-sparkle-icon/meta.ts +8 -0
- package/dist/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.stories.tsx +1021 -0
- package/dist/icons/chevron-double-left-icon/index.tsx +34 -0
- package/dist/icons/chevron-double-left-icon/meta.ts +8 -0
- package/dist/icons/chevron-double-right-icon/ChevronDoubleRightIcon.stories.tsx +1021 -0
- package/dist/icons/chevron-double-right-icon/index.tsx +34 -0
- package/dist/icons/chevron-double-right-icon/meta.ts +8 -0
- package/dist/icons/chevron-down-icon/ChevronDownIcon.stories.tsx +1001 -0
- package/dist/icons/chevron-down-icon/index.tsx +27 -0
- package/dist/icons/chevron-down-icon/meta.ts +8 -0
- package/dist/icons/chevron-left-icon/ChevronLeftIcon.stories.tsx +1029 -0
- package/dist/icons/chevron-left-icon/index.tsx +27 -0
- package/dist/icons/chevron-left-icon/meta.ts +8 -0
- package/dist/icons/chevron-right-icon/ChevronRightIcon.stories.tsx +1021 -0
- package/dist/icons/chevron-right-icon/index.tsx +27 -0
- package/dist/icons/chevron-right-icon/meta.ts +8 -0
- package/dist/icons/chevron-up-icon/ChevronUpIcon.stories.tsx +1036 -0
- package/dist/icons/chevron-up-icon/index.tsx +27 -0
- package/dist/icons/chevron-up-icon/meta.ts +8 -0
- package/dist/icons/command-icon/CommandIcon.stories.tsx +1098 -0
- package/dist/icons/command-icon/index.tsx +24 -0
- package/dist/icons/command-icon/meta.ts +8 -0
- package/dist/icons/cross-circle-icon/CrossCircleIcon.stories.tsx +1061 -0
- package/dist/icons/cross-circle-icon/index.tsx +23 -0
- package/dist/icons/cross-circle-icon/meta.ts +8 -0
- package/dist/icons/cross-icon/CrossIcon.stories.tsx +1027 -0
- package/dist/icons/cross-icon/index.tsx +24 -0
- package/dist/icons/cross-icon/meta.ts +8 -0
- package/dist/icons/edit-big-icon/EditBigIcon.stories.tsx +1092 -0
- package/dist/icons/edit-big-icon/index.tsx +22 -0
- package/dist/icons/edit-big-icon/meta.ts +8 -0
- package/dist/icons/eye-close-icon/EyeCloseIcon.stories.tsx +1090 -0
- package/dist/icons/eye-close-icon/index.tsx +26 -0
- package/dist/icons/eye-close-icon/meta.ts +8 -0
- package/dist/icons/eye-open-icon/EyeOpenIcon.stories.tsx +1098 -0
- package/dist/icons/eye-open-icon/index.tsx +24 -0
- package/dist/icons/eye-open-icon/meta.ts +8 -0
- package/dist/icons/feature-shine-icon/FeatureShineIcon.stories.tsx +1071 -0
- package/dist/icons/feature-shine-icon/index.tsx +29 -0
- package/dist/icons/feature-shine-icon/meta.ts +8 -0
- package/dist/icons/file-chart-icon/FileChartIcon.stories.tsx +1115 -0
- package/dist/icons/file-chart-icon/index.tsx +24 -0
- package/dist/icons/file-chart-icon/meta.ts +8 -0
- package/dist/icons/file-text-icon/FileTextIcon.stories.tsx +668 -0
- package/dist/icons/file-text-icon/index.tsx +24 -0
- package/dist/icons/file-text-icon/meta.ts +8 -0
- package/dist/icons/grip-vertical-icon/GripVerticalIcon.stories.tsx +1239 -0
- package/dist/icons/grip-vertical-icon/index.tsx +28 -0
- package/dist/icons/grip-vertical-icon/meta.ts +8 -0
- package/dist/icons/image-icon/ImageIcon.stories.tsx +1181 -0
- package/dist/icons/image-icon/index.tsx +24 -0
- package/dist/icons/image-icon/meta.ts +8 -0
- package/dist/icons/import-folder-icon/ImportFolderIcon.stories.tsx +1248 -0
- package/dist/icons/import-folder-icon/index.tsx +22 -0
- package/dist/icons/import-folder-icon/meta.ts +8 -0
- package/dist/icons/index.ts +46 -0
- package/dist/icons/light-bulb-simple-icon/LightBulbSimpleIcon.stories.tsx +1272 -0
- package/dist/icons/light-bulb-simple-icon/index.tsx +24 -0
- package/dist/icons/light-bulb-simple-icon/meta.ts +8 -0
- package/dist/icons/magic-book-icon/MagicBookIcon.stories.tsx +1245 -0
- package/dist/icons/magic-book-icon/index.tsx +32 -0
- package/dist/icons/magic-book-icon/meta.ts +8 -0
- package/dist/icons/maintenance-icon/MaintenanceIcon.stories.tsx +1251 -0
- package/dist/icons/maintenance-icon/index.tsx +23 -0
- package/dist/icons/maintenance-icon/meta.ts +8 -0
- package/dist/icons/message-icon/MessageIcon.stories.tsx +595 -0
- package/dist/icons/message-icon/index.tsx +30 -0
- package/dist/icons/message-icon/meta.ts +8 -0
- package/dist/icons/move-horizontal-icon/MoveHorizontalIcon.stories.tsx +1245 -0
- package/dist/icons/move-horizontal-icon/index.tsx +23 -0
- package/dist/icons/move-horizontal-icon/meta.ts +8 -0
- package/dist/icons/move-vertical-icon/MoveVerticalIcon.stories.tsx +1196 -0
- package/dist/icons/move-vertical-icon/index.tsx +23 -0
- package/dist/icons/move-vertical-icon/meta.ts +8 -0
- package/dist/icons/page-search-icon/PageSearchIcon.stories.tsx +1167 -0
- package/dist/icons/page-search-icon/index.tsx +21 -0
- package/dist/icons/page-search-icon/meta.ts +8 -0
- package/dist/icons/pencil-icon/PencilIcon.stories.tsx +1131 -0
- package/dist/icons/pencil-icon/index.tsx +21 -0
- package/dist/icons/pencil-icon/meta.ts +8 -0
- package/dist/icons/plus-icon/PlusIcon.stories.tsx +1151 -0
- package/dist/icons/plus-icon/index.tsx +24 -0
- package/dist/icons/plus-icon/meta.ts +8 -0
- package/dist/icons/search-icon/SearchIcon.stories.tsx +1181 -0
- package/dist/icons/search-icon/index.tsx +24 -0
- package/dist/icons/search-icon/meta.ts +8 -0
- package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +1167 -0
- package/dist/icons/site-logo-icon/index.tsx +79 -0
- package/dist/icons/site-logo-icon/meta.ts +8 -0
- package/dist/icons/spinner-gradient-icon/SpinnerGradientIcon.stories.tsx +637 -0
- package/dist/icons/spinner-gradient-icon/index.tsx +53 -0
- package/dist/icons/spinner-gradient-icon/meta.ts +8 -0
- package/dist/icons/spinner-solid-icon/SpinnerSolidIcon.stories.tsx +644 -0
- package/dist/icons/spinner-solid-icon/index.tsx +59 -0
- package/dist/icons/spinner-solid-icon/meta.ts +8 -0
- package/dist/icons/spinner-solid-neutral-icon/SpinnerSolidINeutralcon.stories.tsx +736 -0
- package/dist/icons/spinner-solid-neutral-icon/index.tsx +53 -0
- package/dist/icons/spinner-solid-neutral-icon/meta.ts +8 -0
- package/dist/icons/tick-circle-icon/TickCircleIcon.stories.tsx +1204 -0
- package/dist/icons/tick-circle-icon/index.tsx +23 -0
- package/dist/icons/tick-circle-icon/meta.ts +8 -0
- package/dist/icons/tick-icon/TickIcon.stories.tsx +1340 -0
- package/dist/icons/tick-icon/index.tsx +24 -0
- package/dist/icons/tick-icon/meta.ts +8 -0
- package/dist/icons/trash-icon/TrashIcon.stories.tsx +996 -0
- package/dist/icons/trash-icon/index.tsx +24 -0
- package/dist/icons/trash-icon/meta.ts +8 -0
- package/dist/icons/upload-icon/UploadIcon.stories.tsx +947 -0
- package/dist/icons/upload-icon/index.tsx +24 -0
- package/dist/icons/upload-icon/meta.ts +8 -0
- package/dist/icons/vertical-menu-icon/VerticalMenuIcon.stories.tsx +1045 -0
- package/dist/icons/vertical-menu-icon/index.tsx +27 -0
- package/dist/icons/vertical-menu-icon/meta.ts +8 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +206 -0
- package/dist/lib/utils.ts +6 -0
- package/dist/styles/aural-theme.css +1008 -0
- package/package.json +142 -0
|
@@ -0,0 +1,723 @@
|
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
|
|
4
|
+
import TextArea from "."
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof TextArea> = {
|
|
7
|
+
title: "Components/UI/TextArea",
|
|
8
|
+
component: TextArea,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "centered",
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component:
|
|
14
|
+
"A flexible textarea component built with atomic design principles. Supports multiple decoration styles (underline, outline, filled), auto-growing height, character counting, and comprehensive accessibility features. Can be used as a complete component or composed from individual atomic parts.",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
argTypes: {
|
|
20
|
+
label: {
|
|
21
|
+
control: { type: "text" },
|
|
22
|
+
description: "Label text for the textarea",
|
|
23
|
+
table: {
|
|
24
|
+
type: { summary: "ReactNode" },
|
|
25
|
+
defaultValue: { summary: "undefined" },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
placeholder: {
|
|
29
|
+
control: { type: "text" },
|
|
30
|
+
description: "Placeholder text shown when textarea is empty",
|
|
31
|
+
table: {
|
|
32
|
+
type: { summary: "string" },
|
|
33
|
+
defaultValue: { summary: '""' },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
helperText: {
|
|
37
|
+
control: { type: "text" },
|
|
38
|
+
description: "Helper text displayed below the textarea",
|
|
39
|
+
table: {
|
|
40
|
+
type: { summary: "ReactNode" },
|
|
41
|
+
defaultValue: { summary: "undefined" },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
variant: {
|
|
45
|
+
control: { type: "select" },
|
|
46
|
+
options: ["default", "error", "warning", "success"],
|
|
47
|
+
description: "Visual variant affecting border and helper text colors",
|
|
48
|
+
table: {
|
|
49
|
+
type: { summary: '"default" | "error" | "warning" | "success"' },
|
|
50
|
+
defaultValue: { summary: '"default"' },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
decoration: {
|
|
54
|
+
control: { type: "select" },
|
|
55
|
+
options: ["underline", "outline", "filled"],
|
|
56
|
+
description: "Visual style of the textarea border and background",
|
|
57
|
+
table: {
|
|
58
|
+
type: { summary: '"underline" | "outline" | "filled"' },
|
|
59
|
+
defaultValue: { summary: '"filled"' },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
disabled: {
|
|
63
|
+
control: { type: "boolean" },
|
|
64
|
+
description: "Whether the textarea is disabled and non-interactive",
|
|
65
|
+
table: {
|
|
66
|
+
type: { summary: "boolean" },
|
|
67
|
+
defaultValue: { summary: "false" },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
required: {
|
|
71
|
+
control: { type: "boolean" },
|
|
72
|
+
description: "Whether the textarea is required (adds asterisk to label)",
|
|
73
|
+
table: {
|
|
74
|
+
type: { summary: "boolean" },
|
|
75
|
+
defaultValue: { summary: "false" },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
fullWidth: {
|
|
79
|
+
control: { type: "boolean" },
|
|
80
|
+
description: "Whether the textarea takes full width of its container",
|
|
81
|
+
table: {
|
|
82
|
+
type: { summary: "boolean" },
|
|
83
|
+
defaultValue: { summary: "false" },
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
showCharCount: {
|
|
87
|
+
control: { type: "boolean" },
|
|
88
|
+
description: "Whether to show character count (requires maxLength)",
|
|
89
|
+
table: {
|
|
90
|
+
type: { summary: "boolean" },
|
|
91
|
+
defaultValue: { summary: "false" },
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
value: {
|
|
95
|
+
control: { type: "text" },
|
|
96
|
+
description: "Controlled value of the textarea",
|
|
97
|
+
table: {
|
|
98
|
+
type: { summary: "string" },
|
|
99
|
+
defaultValue: { summary: "undefined" },
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
maxLength: {
|
|
103
|
+
control: { type: "number" },
|
|
104
|
+
description: "Maximum number of characters allowed",
|
|
105
|
+
table: {
|
|
106
|
+
type: { summary: "number" },
|
|
107
|
+
defaultValue: { summary: "undefined" },
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
rows: {
|
|
111
|
+
control: { type: "number", min: 1, max: 10 },
|
|
112
|
+
description: "Number of visible rows when autoGrow is false",
|
|
113
|
+
table: {
|
|
114
|
+
type: { summary: "number" },
|
|
115
|
+
defaultValue: { summary: "3" },
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
autoGrow: {
|
|
119
|
+
control: { type: "boolean" },
|
|
120
|
+
description:
|
|
121
|
+
"Whether the textarea should automatically grow/shrink based on content",
|
|
122
|
+
table: {
|
|
123
|
+
type: { summary: "boolean" },
|
|
124
|
+
defaultValue: { summary: "true" },
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
minHeight: {
|
|
128
|
+
control: { type: "number" },
|
|
129
|
+
description: "Minimum height in pixels (only with autoGrow)",
|
|
130
|
+
table: {
|
|
131
|
+
type: { summary: "number" },
|
|
132
|
+
defaultValue: { summary: "undefined" },
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
maxHeight: {
|
|
136
|
+
control: { type: "number" },
|
|
137
|
+
description: "Maximum height in pixels (only with autoGrow)",
|
|
138
|
+
table: {
|
|
139
|
+
type: { summary: "number" },
|
|
140
|
+
defaultValue: { summary: "undefined" },
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
onChange: {
|
|
144
|
+
action: "changed",
|
|
145
|
+
description: "Callback fired when the value changes",
|
|
146
|
+
table: {
|
|
147
|
+
type: {
|
|
148
|
+
summary: "(e: React.ChangeEvent<HTMLTextAreaElement>) => void",
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
onFocus: {
|
|
153
|
+
action: "focused",
|
|
154
|
+
description: "Callback fired when the textarea receives focus",
|
|
155
|
+
table: {
|
|
156
|
+
type: { summary: "(e: React.FocusEvent<HTMLTextAreaElement>) => void" },
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
onBlur: {
|
|
160
|
+
action: "blurred",
|
|
161
|
+
description: "Callback fired when the textarea loses focus",
|
|
162
|
+
table: {
|
|
163
|
+
type: { summary: "(e: React.FocusEvent<HTMLTextAreaElement>) => void" },
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
unstyled: {
|
|
167
|
+
control: { type: "boolean" },
|
|
168
|
+
description: "Whether to remove all default styling",
|
|
169
|
+
table: {
|
|
170
|
+
type: { summary: "boolean" },
|
|
171
|
+
defaultValue: { summary: "false" },
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
classes: {
|
|
175
|
+
control: { type: "object" },
|
|
176
|
+
description: "Override classes for different parts of the component",
|
|
177
|
+
table: {
|
|
178
|
+
type: {
|
|
179
|
+
summary:
|
|
180
|
+
"{ root?: string; label?: string; wrapper?: string; textarea?: string; helperText?: string; charCount?: string }",
|
|
181
|
+
},
|
|
182
|
+
defaultValue: { summary: "{}" },
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export default meta
|
|
189
|
+
type Story = StoryObj<typeof meta>
|
|
190
|
+
|
|
191
|
+
// Default story
|
|
192
|
+
export const Default: Story = {
|
|
193
|
+
args: {
|
|
194
|
+
label: "Message",
|
|
195
|
+
placeholder: "Enter your message here...",
|
|
196
|
+
decoration: "filled",
|
|
197
|
+
fullWidth: true,
|
|
198
|
+
},
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Decoration variants
|
|
202
|
+
export const DecorationVariants: Story = {
|
|
203
|
+
render: () => (
|
|
204
|
+
<div className="max-w-lg space-y-6">
|
|
205
|
+
<div>
|
|
206
|
+
<h3 className="text-fm-primary mb-2 text-sm font-medium">Underline</h3>
|
|
207
|
+
<TextArea
|
|
208
|
+
label="Underline Style"
|
|
209
|
+
placeholder="Minimalist underline style..."
|
|
210
|
+
decoration="underline"
|
|
211
|
+
fullWidth
|
|
212
|
+
/>
|
|
213
|
+
</div>
|
|
214
|
+
|
|
215
|
+
<div>
|
|
216
|
+
<h3 className="text-fm-primary mb-2 text-sm font-medium">Outline</h3>
|
|
217
|
+
<TextArea
|
|
218
|
+
label="Outline Style"
|
|
219
|
+
placeholder="Traditional outlined style..."
|
|
220
|
+
decoration="outline"
|
|
221
|
+
fullWidth
|
|
222
|
+
/>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<div>
|
|
226
|
+
<h3 className="text-fm-primary mb-2 text-sm font-medium">Filled</h3>
|
|
227
|
+
<TextArea
|
|
228
|
+
label="Filled Style"
|
|
229
|
+
placeholder="Modern filled style..."
|
|
230
|
+
decoration="filled"
|
|
231
|
+
fullWidth
|
|
232
|
+
/>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
),
|
|
236
|
+
parameters: {
|
|
237
|
+
docs: {
|
|
238
|
+
description: {
|
|
239
|
+
story:
|
|
240
|
+
"Three decoration styles available: underline (minimalist), outline (traditional), and filled (modern with background).",
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Controlled component story
|
|
247
|
+
export const Controlled: Story = {
|
|
248
|
+
render: (args) => {
|
|
249
|
+
const [value, setValue] = useState("")
|
|
250
|
+
return (
|
|
251
|
+
<TextArea
|
|
252
|
+
{...args}
|
|
253
|
+
value={value}
|
|
254
|
+
onChange={(e) => setValue(e.target.value)}
|
|
255
|
+
/>
|
|
256
|
+
)
|
|
257
|
+
},
|
|
258
|
+
args: {
|
|
259
|
+
label: "Controlled TextArea",
|
|
260
|
+
placeholder: "Type something...",
|
|
261
|
+
decoration: "filled",
|
|
262
|
+
fullWidth: true,
|
|
263
|
+
},
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// With helper text
|
|
267
|
+
export const WithHelperText: Story = {
|
|
268
|
+
args: {
|
|
269
|
+
label: "Description",
|
|
270
|
+
placeholder: "Enter a description...",
|
|
271
|
+
helperText: "Please provide a detailed description",
|
|
272
|
+
decoration: "outline",
|
|
273
|
+
fullWidth: true,
|
|
274
|
+
},
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// With character count
|
|
278
|
+
export const WithCharCount: Story = {
|
|
279
|
+
args: {
|
|
280
|
+
label: "Comment",
|
|
281
|
+
placeholder: "Share your thoughts...",
|
|
282
|
+
maxLength: 280,
|
|
283
|
+
showCharCount: true,
|
|
284
|
+
decoration: "filled",
|
|
285
|
+
fullWidth: true,
|
|
286
|
+
},
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Error state with different decorations
|
|
290
|
+
export const ErrorStates: Story = {
|
|
291
|
+
render: () => (
|
|
292
|
+
<div className="max-w-lg space-y-4">
|
|
293
|
+
<TextArea
|
|
294
|
+
label="Underline Error"
|
|
295
|
+
placeholder="Error with underline..."
|
|
296
|
+
variant="error"
|
|
297
|
+
decoration="underline"
|
|
298
|
+
helperText="This field is required"
|
|
299
|
+
fullWidth
|
|
300
|
+
/>
|
|
301
|
+
<TextArea
|
|
302
|
+
label="Outline Error"
|
|
303
|
+
placeholder="Error with outline..."
|
|
304
|
+
variant="error"
|
|
305
|
+
decoration="outline"
|
|
306
|
+
helperText="This field is required"
|
|
307
|
+
fullWidth
|
|
308
|
+
/>
|
|
309
|
+
<TextArea
|
|
310
|
+
label="Filled Error"
|
|
311
|
+
placeholder="Error with filled..."
|
|
312
|
+
variant="error"
|
|
313
|
+
decoration="filled"
|
|
314
|
+
helperText="This field is required"
|
|
315
|
+
fullWidth
|
|
316
|
+
/>
|
|
317
|
+
</div>
|
|
318
|
+
),
|
|
319
|
+
parameters: {
|
|
320
|
+
docs: {
|
|
321
|
+
description: {
|
|
322
|
+
story: "Error state examples across all decoration variants.",
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// Warning state
|
|
329
|
+
export const WarningState: Story = {
|
|
330
|
+
args: {
|
|
331
|
+
label: "Message",
|
|
332
|
+
placeholder: "Enter your message...",
|
|
333
|
+
variant: "warning",
|
|
334
|
+
decoration: "outline",
|
|
335
|
+
helperText: "Please double-check your input",
|
|
336
|
+
fullWidth: true,
|
|
337
|
+
},
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// Success state
|
|
341
|
+
export const SuccessState: Story = {
|
|
342
|
+
args: {
|
|
343
|
+
label: "Message",
|
|
344
|
+
placeholder: "Enter your message...",
|
|
345
|
+
variant: "success",
|
|
346
|
+
decoration: "filled",
|
|
347
|
+
helperText: "Looks good!",
|
|
348
|
+
fullWidth: true,
|
|
349
|
+
},
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Disabled state
|
|
353
|
+
export const Disabled: Story = {
|
|
354
|
+
args: {
|
|
355
|
+
label: "Message",
|
|
356
|
+
placeholder: "Enter your message...",
|
|
357
|
+
disabled: true,
|
|
358
|
+
value: "This textarea is disabled",
|
|
359
|
+
decoration: "filled",
|
|
360
|
+
fullWidth: true,
|
|
361
|
+
},
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Required field
|
|
365
|
+
export const Required: Story = {
|
|
366
|
+
args: {
|
|
367
|
+
label: "Required Message",
|
|
368
|
+
placeholder: "This field is required...",
|
|
369
|
+
required: true,
|
|
370
|
+
helperText: "This field is required",
|
|
371
|
+
decoration: "outline",
|
|
372
|
+
fullWidth: true,
|
|
373
|
+
},
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// With auto-grow disabled
|
|
377
|
+
export const FixedHeight: Story = {
|
|
378
|
+
args: {
|
|
379
|
+
label: "Fixed Height TextArea",
|
|
380
|
+
placeholder: "This textarea has a fixed height...",
|
|
381
|
+
autoGrow: false,
|
|
382
|
+
rows: 5,
|
|
383
|
+
decoration: "outline",
|
|
384
|
+
fullWidth: true,
|
|
385
|
+
},
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// With min and max height
|
|
389
|
+
export const WithHeightLimits: Story = {
|
|
390
|
+
args: {
|
|
391
|
+
label: "Height Limited TextArea",
|
|
392
|
+
placeholder: "This textarea has height constraints...",
|
|
393
|
+
autoGrow: true,
|
|
394
|
+
minHeight: 80,
|
|
395
|
+
maxHeight: 200,
|
|
396
|
+
decoration: "filled",
|
|
397
|
+
fullWidth: true,
|
|
398
|
+
},
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// With character limit and warning
|
|
402
|
+
export const CharacterLimitWithWarning: Story = {
|
|
403
|
+
render: (args) => {
|
|
404
|
+
const [value, setValue] = useState("")
|
|
405
|
+
const isNearLimit = value.length > 250
|
|
406
|
+
const isOverHalfway = value.length > 140
|
|
407
|
+
|
|
408
|
+
return (
|
|
409
|
+
<TextArea
|
|
410
|
+
{...args}
|
|
411
|
+
value={value}
|
|
412
|
+
onChange={(e) => setValue(e.target.value)}
|
|
413
|
+
variant={
|
|
414
|
+
isNearLimit ? "warning" : isOverHalfway ? "default" : "default"
|
|
415
|
+
}
|
|
416
|
+
helperText={
|
|
417
|
+
isNearLimit
|
|
418
|
+
? "You're approaching the character limit"
|
|
419
|
+
: "Share what's on your mind"
|
|
420
|
+
}
|
|
421
|
+
/>
|
|
422
|
+
)
|
|
423
|
+
},
|
|
424
|
+
args: {
|
|
425
|
+
label: "Tweet",
|
|
426
|
+
placeholder: "What's happening?",
|
|
427
|
+
maxLength: 280,
|
|
428
|
+
showCharCount: true,
|
|
429
|
+
decoration: "underline",
|
|
430
|
+
fullWidth: true,
|
|
431
|
+
},
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// Atomic composition story - demonstrates how to use individual components
|
|
435
|
+
export const AtomicComposition: Story = {
|
|
436
|
+
render: () => {
|
|
437
|
+
const [value, setValue] = useState("")
|
|
438
|
+
const maxLength = 100
|
|
439
|
+
|
|
440
|
+
return (
|
|
441
|
+
<TextArea.Root fullWidth className="max-w-md">
|
|
442
|
+
<TextArea.Label htmlFor="atomic-textarea" required>
|
|
443
|
+
Custom Composed TextArea
|
|
444
|
+
</TextArea.Label>
|
|
445
|
+
|
|
446
|
+
<TextArea.Wrapper>
|
|
447
|
+
<TextArea.Base
|
|
448
|
+
id="atomic-textarea"
|
|
449
|
+
placeholder="Built with atomic components..."
|
|
450
|
+
value={value}
|
|
451
|
+
onChange={(e) => setValue(e.target.value)}
|
|
452
|
+
maxLength={maxLength}
|
|
453
|
+
variant="default"
|
|
454
|
+
decoration="outline"
|
|
455
|
+
/>
|
|
456
|
+
</TextArea.Wrapper>
|
|
457
|
+
|
|
458
|
+
<div className="flex items-center justify-between gap-2">
|
|
459
|
+
<TextArea.HelperText variant="default">
|
|
460
|
+
This is built using atomic components
|
|
461
|
+
</TextArea.HelperText>
|
|
462
|
+
|
|
463
|
+
<TextArea.CharCount
|
|
464
|
+
currentLength={value.length}
|
|
465
|
+
maxLength={maxLength}
|
|
466
|
+
/>
|
|
467
|
+
</div>
|
|
468
|
+
</TextArea.Root>
|
|
469
|
+
)
|
|
470
|
+
},
|
|
471
|
+
parameters: {
|
|
472
|
+
docs: {
|
|
473
|
+
description: {
|
|
474
|
+
story:
|
|
475
|
+
"This example shows how to compose the TextArea using individual atomic components for maximum flexibility. This pattern allows for custom layouts and advanced use cases.",
|
|
476
|
+
},
|
|
477
|
+
},
|
|
478
|
+
},
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// Complex form example
|
|
482
|
+
export const ComplexFormExample: Story = {
|
|
483
|
+
render: () => {
|
|
484
|
+
const [feedback, setFeedback] = useState("")
|
|
485
|
+
const [description, setDescription] = useState("")
|
|
486
|
+
|
|
487
|
+
return (
|
|
488
|
+
<div className="max-w-lg space-y-6">
|
|
489
|
+
<TextArea
|
|
490
|
+
label="Product Description"
|
|
491
|
+
placeholder="Describe your product..."
|
|
492
|
+
value={description}
|
|
493
|
+
onChange={(e) => setDescription(e.target.value)}
|
|
494
|
+
helperText="Provide a clear and concise description"
|
|
495
|
+
maxLength={500}
|
|
496
|
+
showCharCount
|
|
497
|
+
decoration="outline"
|
|
498
|
+
fullWidth
|
|
499
|
+
/>
|
|
500
|
+
|
|
501
|
+
<TextArea
|
|
502
|
+
label="Customer Feedback"
|
|
503
|
+
placeholder="Share your experience..."
|
|
504
|
+
value={feedback}
|
|
505
|
+
onChange={(e) => setFeedback(e.target.value)}
|
|
506
|
+
variant={feedback.length > 10 ? "success" : "default"}
|
|
507
|
+
helperText={
|
|
508
|
+
feedback.length > 10
|
|
509
|
+
? "Thank you for the detailed feedback!"
|
|
510
|
+
: "Please provide detailed feedback"
|
|
511
|
+
}
|
|
512
|
+
required
|
|
513
|
+
autoGrow
|
|
514
|
+
minHeight={60}
|
|
515
|
+
maxHeight={150}
|
|
516
|
+
decoration="filled"
|
|
517
|
+
fullWidth
|
|
518
|
+
/>
|
|
519
|
+
</div>
|
|
520
|
+
)
|
|
521
|
+
},
|
|
522
|
+
parameters: {
|
|
523
|
+
docs: {
|
|
524
|
+
description: {
|
|
525
|
+
story:
|
|
526
|
+
"An example showing multiple TextArea components in a form with different configurations, decorations, and dynamic states based on user input.",
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
},
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// Sizing variations with different decorations
|
|
533
|
+
export const SizingVariations: Story = {
|
|
534
|
+
render: () => (
|
|
535
|
+
<div className="text-fm-primary space-y-4">
|
|
536
|
+
<div>
|
|
537
|
+
<h3 className="mb-2 text-sm font-medium">Small (3 rows) - Underline</h3>
|
|
538
|
+
<TextArea
|
|
539
|
+
placeholder="Small textarea..."
|
|
540
|
+
rows={3}
|
|
541
|
+
autoGrow={false}
|
|
542
|
+
decoration="underline"
|
|
543
|
+
className="max-w-sm"
|
|
544
|
+
/>
|
|
545
|
+
</div>
|
|
546
|
+
|
|
547
|
+
<div>
|
|
548
|
+
<h3 className="mb-2 text-sm font-medium">Medium (5 rows) - Outline</h3>
|
|
549
|
+
<TextArea
|
|
550
|
+
placeholder="Medium textarea..."
|
|
551
|
+
rows={5}
|
|
552
|
+
autoGrow={false}
|
|
553
|
+
decoration="outline"
|
|
554
|
+
className="max-w-md"
|
|
555
|
+
/>
|
|
556
|
+
</div>
|
|
557
|
+
|
|
558
|
+
<div>
|
|
559
|
+
<h3 className="mb-2 text-sm font-medium">Large (8 rows) - Filled</h3>
|
|
560
|
+
<TextArea
|
|
561
|
+
placeholder="Large textarea..."
|
|
562
|
+
rows={8}
|
|
563
|
+
autoGrow={false}
|
|
564
|
+
decoration="filled"
|
|
565
|
+
className="max-w-lg"
|
|
566
|
+
/>
|
|
567
|
+
</div>
|
|
568
|
+
</div>
|
|
569
|
+
),
|
|
570
|
+
parameters: {
|
|
571
|
+
docs: {
|
|
572
|
+
description: {
|
|
573
|
+
story:
|
|
574
|
+
"Different sizing options for the TextArea component with fixed heights, showcasing different decoration styles.",
|
|
575
|
+
},
|
|
576
|
+
},
|
|
577
|
+
},
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// All variants with all decorations
|
|
581
|
+
export const AllVariantsAllDecorations: Story = {
|
|
582
|
+
render: () => (
|
|
583
|
+
<div className="grid max-w-6xl grid-cols-1 gap-6 lg:grid-cols-3">
|
|
584
|
+
{/* Underline decoration */}
|
|
585
|
+
<div className="space-y-4">
|
|
586
|
+
<h3 className="text-fm-primary text-lg font-semibold">Underline</h3>
|
|
587
|
+
<TextArea
|
|
588
|
+
label="Default"
|
|
589
|
+
placeholder="Default underline..."
|
|
590
|
+
variant="default"
|
|
591
|
+
decoration="underline"
|
|
592
|
+
helperText="Default variant"
|
|
593
|
+
fullWidth
|
|
594
|
+
/>
|
|
595
|
+
<TextArea
|
|
596
|
+
label="Error"
|
|
597
|
+
placeholder="Error underline..."
|
|
598
|
+
variant="error"
|
|
599
|
+
decoration="underline"
|
|
600
|
+
helperText="Something went wrong"
|
|
601
|
+
fullWidth
|
|
602
|
+
/>
|
|
603
|
+
<TextArea
|
|
604
|
+
label="Warning"
|
|
605
|
+
placeholder="Warning underline..."
|
|
606
|
+
variant="warning"
|
|
607
|
+
decoration="underline"
|
|
608
|
+
helperText="Please check input"
|
|
609
|
+
fullWidth
|
|
610
|
+
/>
|
|
611
|
+
<TextArea
|
|
612
|
+
label="Success"
|
|
613
|
+
placeholder="Success underline..."
|
|
614
|
+
variant="success"
|
|
615
|
+
decoration="underline"
|
|
616
|
+
helperText="Looks good!"
|
|
617
|
+
fullWidth
|
|
618
|
+
/>
|
|
619
|
+
</div>
|
|
620
|
+
|
|
621
|
+
{/* Outline decoration */}
|
|
622
|
+
<div className="space-y-4">
|
|
623
|
+
<h3 className="text-fm-primary text-lg font-semibold">Outline</h3>
|
|
624
|
+
<TextArea
|
|
625
|
+
label="Default"
|
|
626
|
+
placeholder="Default outline..."
|
|
627
|
+
variant="default"
|
|
628
|
+
decoration="outline"
|
|
629
|
+
helperText="Default variant"
|
|
630
|
+
fullWidth
|
|
631
|
+
/>
|
|
632
|
+
<TextArea
|
|
633
|
+
label="Error"
|
|
634
|
+
placeholder="Error outline..."
|
|
635
|
+
variant="error"
|
|
636
|
+
decoration="outline"
|
|
637
|
+
helperText="Something went wrong"
|
|
638
|
+
fullWidth
|
|
639
|
+
/>
|
|
640
|
+
<TextArea
|
|
641
|
+
label="Warning"
|
|
642
|
+
placeholder="Warning outline..."
|
|
643
|
+
variant="warning"
|
|
644
|
+
decoration="outline"
|
|
645
|
+
helperText="Please check input"
|
|
646
|
+
fullWidth
|
|
647
|
+
/>
|
|
648
|
+
<TextArea
|
|
649
|
+
label="Success"
|
|
650
|
+
placeholder="Success outline..."
|
|
651
|
+
variant="success"
|
|
652
|
+
decoration="outline"
|
|
653
|
+
helperText="Looks good!"
|
|
654
|
+
fullWidth
|
|
655
|
+
/>
|
|
656
|
+
</div>
|
|
657
|
+
|
|
658
|
+
{/* Filled decoration */}
|
|
659
|
+
<div className="space-y-4">
|
|
660
|
+
<h3 className="text-fm-primary text-lg font-semibold">Filled</h3>
|
|
661
|
+
<TextArea
|
|
662
|
+
label="Default"
|
|
663
|
+
placeholder="Default filled..."
|
|
664
|
+
variant="default"
|
|
665
|
+
decoration="filled"
|
|
666
|
+
helperText="Default variant"
|
|
667
|
+
fullWidth
|
|
668
|
+
/>
|
|
669
|
+
<TextArea
|
|
670
|
+
label="Error"
|
|
671
|
+
placeholder="Error filled..."
|
|
672
|
+
variant="error"
|
|
673
|
+
decoration="filled"
|
|
674
|
+
helperText="Something went wrong"
|
|
675
|
+
fullWidth
|
|
676
|
+
/>
|
|
677
|
+
<TextArea
|
|
678
|
+
label="Warning"
|
|
679
|
+
placeholder="Warning filled..."
|
|
680
|
+
variant="warning"
|
|
681
|
+
decoration="filled"
|
|
682
|
+
helperText="Please check input"
|
|
683
|
+
fullWidth
|
|
684
|
+
/>
|
|
685
|
+
<TextArea
|
|
686
|
+
label="Success"
|
|
687
|
+
placeholder="Success filled..."
|
|
688
|
+
variant="success"
|
|
689
|
+
decoration="filled"
|
|
690
|
+
helperText="Looks good!"
|
|
691
|
+
fullWidth
|
|
692
|
+
/>
|
|
693
|
+
</div>
|
|
694
|
+
</div>
|
|
695
|
+
),
|
|
696
|
+
parameters: {
|
|
697
|
+
docs: {
|
|
698
|
+
description: {
|
|
699
|
+
story:
|
|
700
|
+
"Complete showcase of all visual variants across all decoration styles.",
|
|
701
|
+
},
|
|
702
|
+
},
|
|
703
|
+
},
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// Unstyled example
|
|
707
|
+
export const Unstyled: Story = {
|
|
708
|
+
args: {
|
|
709
|
+
placeholder: "Completely unstyled textarea...",
|
|
710
|
+
unstyled: true,
|
|
711
|
+
className:
|
|
712
|
+
"border-2 border-dashed border-gray-300 p-4 rounded-lg bg-gray-50",
|
|
713
|
+
fullWidth: true,
|
|
714
|
+
},
|
|
715
|
+
parameters: {
|
|
716
|
+
docs: {
|
|
717
|
+
description: {
|
|
718
|
+
story:
|
|
719
|
+
"Example of using the unstyled prop to create completely custom styling.",
|
|
720
|
+
},
|
|
721
|
+
},
|
|
722
|
+
},
|
|
723
|
+
}
|