@koide-labs/ui 0.0.0 → 0.0.2
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/README.md +53 -3
- package/{src/-types.ts → dist/-types.d.ts} +1 -6
- package/dist/-types.js +1 -0
- package/dist/-utils.d.ts +19 -0
- package/dist/-utils.js +33 -0
- package/dist/Button-DrPFFzo7.js +31 -0
- package/dist/CompositeRoot-CVk5a-pR.js +233 -0
- package/dist/DirectionContext-C2o_MF_i.js +9 -0
- package/dist/FieldItemContext-DAvk99to.js +11 -0
- package/dist/FloatingPortal-tWyuKRSN.js +435 -0
- package/dist/FloatingPortalLite-DVyq6YhV.js +28 -0
- package/dist/InternalBackdrop-jYAiOJ8v.js +574 -0
- package/dist/LabelableContext-BMvjVwor.js +169 -0
- package/dist/ToolbarRootContext-CvvL0Tk1.js +9 -0
- package/dist/clamp-D0KDAQIz.js +6 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/accordion/index.d.ts +12 -0
- package/dist/components/accordion/index.js +699 -0
- package/dist/components/alert-dialog/index.d.ts +26 -0
- package/dist/components/alert-dialog/index.js +136 -0
- package/dist/components/anchor/index.d.ts +8 -0
- package/dist/components/anchor/index.js +38 -0
- package/dist/components/avatar/index.d.ts +21 -0
- package/dist/components/avatar/index.js +161 -0
- package/dist/components/badge/index.d.ts +16 -0
- package/dist/components/badge/index.js +40 -0
- package/dist/components/button/index.d.ts +24 -0
- package/dist/components/button/index.js +47 -0
- package/dist/components/checkbox/index.d.ts +9 -0
- package/dist/components/checkbox/index.js +269 -0
- package/dist/components/code/index.d.ts +9 -0
- package/dist/components/code/index.js +10 -0
- package/dist/components/collapse/index.d.ts +11 -0
- package/dist/components/collapse/index.js +41 -0
- package/dist/components/command/index.d.ts +14 -0
- package/dist/components/command/index.js +1695 -0
- package/dist/components/context-menu/index.d.ts +42 -0
- package/dist/components/context-menu/index.js +1444 -0
- package/dist/components/dialog/index.d.ts +48 -0
- package/dist/components/dialog/index.js +138 -0
- package/dist/components/heading/index.d.ts +44 -0
- package/dist/components/heading/index.js +56 -0
- package/dist/components/icon/icon-names.d.ts +1 -0
- package/dist/components/icon/icon-names.js +1 -0
- package/dist/components/icon/index.d.ts +24 -0
- package/dist/components/icon/index.js +43 -0
- package/dist/components/icon-button/index.d.ts +12 -0
- package/dist/components/icon-button/index.js +45 -0
- package/dist/components/inline-code/index.d.ts +6 -0
- package/dist/components/inline-code/index.js +22 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/index.js +119 -0
- package/dist/components/meter/index.d.ts +18 -0
- package/dist/components/meter/index.js +165 -0
- package/dist/components/multiline-input/index.d.ts +6 -0
- package/dist/components/multiline-input/index.js +100 -0
- package/dist/components/number-input/index.d.ts +10 -0
- package/dist/components/number-input/index.js +1169 -0
- package/dist/components/password-input/index.d.ts +2 -0
- package/dist/components/password-input/index.js +29 -0
- package/dist/components/pill/index.d.ts +13 -0
- package/dist/components/pill/index.js +38 -0
- package/dist/components/popover/index.d.ts +21 -0
- package/dist/components/popover/index.js +636 -0
- package/dist/components/preview-card/index.d.ts +17 -0
- package/dist/components/preview-card/index.js +402 -0
- package/dist/components/radio/index.d.ts +13 -0
- package/dist/components/radio/index.js +404 -0
- package/dist/components/search-bar/index.d.ts +12 -0
- package/dist/components/search-bar/index.js +48 -0
- package/dist/components/select/index.d.ts +16 -0
- package/dist/components/select/index.js +1263 -0
- package/dist/components/separator/index.d.ts +7 -0
- package/dist/components/separator/index.js +6 -0
- package/dist/components/slider/index.d.ts +5 -0
- package/dist/components/slider/index.js +902 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.js +13 -0
- package/dist/components/stacked-avatars/index.d.ts +14 -0
- package/dist/components/stacked-avatars/index.js +92 -0
- package/dist/components/status-banner/index.d.ts +17 -0
- package/dist/components/status-banner/index.js +69 -0
- package/dist/components/surface/index.d.ts +27 -0
- package/dist/components/surface/index.js +41 -0
- package/dist/components/switch/index.d.ts +5 -0
- package/dist/components/switch/index.js +196 -0
- package/dist/components/tabs/index.d.ts +18 -0
- package/dist/components/tabs/index.js +509 -0
- package/dist/components/text/index.d.ts +26 -0
- package/dist/components/text/index.js +51 -0
- package/dist/components/theme-provider/index.d.ts +2 -0
- package/dist/components/theme-provider/index.js +6 -0
- package/dist/components/theme-provider/theme-context.d.ts +9 -0
- package/dist/components/theme-provider/theme-context.js +13 -0
- package/dist/components/theme-provider/theme-provider.d.ts +17 -0
- package/dist/components/theme-provider/theme-provider.js +30 -0
- package/dist/components/timestamp/index.d.ts +23 -0
- package/dist/components/timestamp/index.js +1392 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +7 -0
- package/dist/components/toast/toast.d.ts +2 -0
- package/dist/components/toast/toast.js +878 -0
- package/dist/components/toast/use-toast-manager.d.ts +27 -0
- package/dist/components/toast/use-toast-manager.js +4 -0
- package/dist/components/tooltip/index.d.ts +14 -0
- package/dist/components/tooltip/index.js +712 -0
- package/dist/components/tooltip/tooltip-arrow.d.ts +3 -0
- package/dist/components/tooltip/tooltip-arrow.js +6 -0
- package/dist/components/view/index.d.ts +30 -0
- package/dist/components/view/index.js +84 -0
- package/dist/components/visually-hidden/index.d.ts +1 -0
- package/dist/components/visually-hidden/index.js +4 -0
- package/dist/composite-Bx7Szd_T.js +208 -0
- package/dist/composite-C9L5QmZL.js +66 -0
- package/dist/createBaseUIEventDetails-D8M2Yl-a.js +59 -0
- package/dist/detectBrowser-I-s3yzIE.js +43 -0
- package/dist/dialog.css +1 -0
- package/dist/dialog.module-BeF-6XAo.js +415 -0
- package/dist/element-CZEOj04G.js +80 -0
- package/dist/event-CKoGyQEJ.js +30 -0
- package/dist/floating-ui.utils-C7pRWMZ_.js +128 -0
- package/dist/floating-ui.utils.dom-C7FS5id0.js +135 -0
- package/dist/formatErrorMessage-BqPuTBN-.js +7 -0
- package/dist/formatNumber-1UNwjeqf.js +25 -0
- package/dist/getDisabledMountTransitionStyles-YfHPge6T.js +1510 -0
- package/dist/index-BX1XbbRk.js +1206 -0
- package/dist/index-CeuccO-T.js +109 -0
- package/dist/index-DN9Bn1qm.js +29 -0
- package/dist/index-FMoPxlJ2.js +52 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +108 -0
- package/dist/index10.css +1 -0
- package/dist/index11.css +1 -0
- package/dist/index12.css +1 -0
- package/dist/index13.css +1 -0
- package/dist/index14.css +1 -0
- package/dist/index15.css +1 -0
- package/dist/index16.css +1 -0
- package/dist/index17.css +1 -0
- package/dist/index18.css +1 -0
- package/dist/index19.css +1 -0
- package/dist/index2.css +1 -0
- package/dist/index20.css +1 -0
- package/dist/index21.css +1 -0
- package/dist/index22.css +1 -0
- package/dist/index23.css +1 -0
- package/dist/index24.css +1 -0
- package/dist/index25.css +1 -0
- package/dist/index26.css +1 -0
- package/dist/index27.css +1 -0
- package/dist/index28.css +1 -0
- package/dist/index29.css +1 -0
- package/dist/index3.css +1 -0
- package/dist/index30.css +1 -0
- package/dist/index31.css +1 -0
- package/dist/index32.css +1 -0
- package/dist/index33.css +1 -0
- package/dist/index34.css +1 -0
- package/dist/index35.css +1 -0
- package/dist/index36.css +1 -0
- package/dist/index37.css +1 -0
- package/dist/index4.css +1 -0
- package/dist/index5.css +1 -0
- package/dist/index6.css +1 -0
- package/dist/index7.css +1 -0
- package/dist/index8.css +1 -0
- package/dist/index9.css +1 -0
- package/dist/inertValue-BCYGsdmf.js +7 -0
- package/dist/input.css +1 -0
- package/dist/input.module-DDQY_Ij6.js +7 -0
- package/dist/integrations/react-markdown/index.d.ts +5 -0
- package/dist/integrations/react-markdown/index.js +6895 -0
- package/dist/integrations/remix/index.d.ts +9 -0
- package/{src/integrations/remix.ts → dist/integrations/remix/index.js} +7 -4
- package/dist/integrations/tailwind.css +1 -0
- package/dist/integrations/twemoij/index.d.ts +3 -0
- package/dist/integrations/twemoij/index.js +18 -0
- package/dist/isElementDisabled-Cbd8W9kH.js +6 -0
- package/dist/owner-rKN292Q9.js +6 -0
- package/dist/safePolygon-DWy1dGKJ.js +308 -0
- package/dist/styles/core.css +1 -0
- package/dist/styles/tokens.d.ts +400 -0
- package/{src/styles/tokens.ts → dist/styles/tokens.js} +54 -96
- package/dist/toast.css +1 -0
- package/dist/tooltip-arrow-C1qXdi5T.js +24 -0
- package/dist/tooltip-arrow.css +1 -0
- package/dist/transitions.css +1 -0
- package/dist/transitions.module-CWX8e5cx.js +1343 -0
- package/dist/use-toast-manager-Dq-44AuW.js +37 -0
- package/dist/useAnimationFrame-451ugS_6.js +68 -0
- package/dist/useBaseUiId-B7WyxtIE.js +7 -0
- package/dist/useButton-DfIwsdb8.js +127 -0
- package/dist/useCompositeListItem-OkcAim_1.js +148 -0
- package/dist/useControlled-Du4sJyMj.js +31 -0
- package/dist/useHoverReferenceInteraction-SfOBPoXM.js +264 -0
- package/dist/useId-C5kyn6tA.js +22 -0
- package/dist/useIsoLayoutEffect-CIDbvm3Q.js +6 -0
- package/dist/useLabelableId-Ci_jDvmv.js +29 -0
- package/dist/useOnMount-VRW6CK2u.js +8 -0
- package/dist/useOpenChangeComplete-Dse9kY9E.js +61 -0
- package/dist/usePopupAutoResize-CNR6Ekmx.js +85 -0
- package/dist/useRender-CLx7dR_1.js +7 -0
- package/dist/useRenderElement-DwToLA61.js +244 -0
- package/dist/useRole-oDBdbuwQ.js +77 -0
- package/dist/useStableCallback-CkTrVkNX.js +29 -0
- package/dist/useSyncedFloatingRootContext-Dorsv-jf.js +167 -0
- package/dist/useTimeout-CflX-kz3.js +32 -0
- package/dist/useTransitionStatus-CUfcuGAV.js +42 -0
- package/dist/useTypeahead-D85V2IUx.js +333 -0
- package/dist/useValueAsRef-HURLzret.js +19 -0
- package/dist/useValueChanged-DL757-yD.js +14 -0
- package/dist/valueToPercent-DaP9qN4u.js +6 -0
- package/dist/view.css +1 -0
- package/dist/view.module-DfDLgJE0.js +6 -0
- package/dist/visuallyHidden-CpJ-mhai.js +16 -0
- package/dist/warn-CKtX8MLJ.js +11 -0
- package/package.json +18 -2
- package/.husky/pre-commit +0 -1
- package/.storybook/main.ts +0 -25
- package/.storybook/preview-head.html +0 -6
- package/.storybook/preview.tsx +0 -48
- package/.storybook/vitest.setup.ts +0 -8
- package/eslint.config.mjs +0 -29
- package/lint-staged.config.js +0 -15
- package/pnpm-workspace.yaml +0 -2
- package/postcss.config.mjs +0 -7
- package/prettier.config.mjs +0 -24
- package/scripts/build-icon-types.ts +0 -38
- package/src/-utils.tsx +0 -64
- package/src/components/accordion/accordion.module.css +0 -44
- package/src/components/accordion/accordion.stories.tsx +0 -36
- package/src/components/accordion/index.tsx +0 -67
- package/src/components/alert-dialog/alert-dialog.module.css +0 -5
- package/src/components/alert-dialog/alert-dialog.stories.tsx +0 -53
- package/src/components/alert-dialog/index.tsx +0 -138
- package/src/components/anchor/anchor.module.css +0 -18
- package/src/components/anchor/anchor.stories.tsx +0 -28
- package/src/components/anchor/index.tsx +0 -45
- package/src/components/avatar/avatar.module.css +0 -56
- package/src/components/avatar/avatar.stories.tsx +0 -61
- package/src/components/avatar/index.tsx +0 -82
- package/src/components/badge/badge.module.css +0 -35
- package/src/components/badge/badge.stories.tsx +0 -60
- package/src/components/badge/index.tsx +0 -71
- package/src/components/button/button.module.css +0 -42
- package/src/components/button/button.stories.tsx +0 -108
- package/src/components/button/index.tsx +0 -63
- package/src/components/checkbox/checkbox.module.css +0 -36
- package/src/components/checkbox/checkbox.stories.tsx +0 -21
- package/src/components/checkbox/index.tsx +0 -41
- package/src/components/code/code.module.css +0 -20
- package/src/components/code/code.stories.tsx +0 -42
- package/src/components/code/index.tsx +0 -73
- package/src/components/collapse/collapse.module.css +0 -27
- package/src/components/collapse/collapse.stories.tsx +0 -27
- package/src/components/collapse/index.tsx +0 -59
- package/src/components/command/command.module.css +0 -95
- package/src/components/command/command.stories.tsx +0 -38
- package/src/components/command/index.tsx +0 -108
- package/src/components/context-menu/context-menu.module.css +0 -36
- package/src/components/context-menu/context-menu.stories.tsx +0 -99
- package/src/components/context-menu/index.tsx +0 -242
- package/src/components/dialog/dialog.module.css +0 -71
- package/src/components/dialog/dialog.stories.tsx +0 -29
- package/src/components/dialog/index.tsx +0 -148
- package/src/components/heading/heading.module.css +0 -3
- package/src/components/heading/heading.stories.tsx +0 -52
- package/src/components/heading/index.tsx +0 -112
- package/src/components/icon/icon-names.ts +0 -3189
- package/src/components/icon/icon.module.css +0 -36
- package/src/components/icon/icon.stories.tsx +0 -40
- package/src/components/icon/index.tsx +0 -60
- package/src/components/icon-button/icon-button.module.css +0 -33
- package/src/components/icon-button/icon-button.stories.tsx +0 -59
- package/src/components/icon-button/index.tsx +0 -48
- package/src/components/inline-code/index.tsx +0 -29
- package/src/components/inline-code/inline-code.module.css +0 -13
- package/src/components/inline-code/inline-code.stories.tsx +0 -31
- package/src/components/input/index.tsx +0 -22
- package/src/components/input/input.module.css +0 -23
- package/src/components/input/input.stories.tsx +0 -52
- package/src/components/meter/index.tsx +0 -55
- package/src/components/meter/meter.module.css +0 -23
- package/src/components/meter/meter.stories.tsx +0 -31
- package/src/components/multiline-input/index.tsx +0 -58
- package/src/components/multiline-input/multiline-input.stories.tsx +0 -26
- package/src/components/number-input/index.tsx +0 -74
- package/src/components/number-input/number-input.module.css +0 -41
- package/src/components/number-input/number-input.stories.tsx +0 -24
- package/src/components/password-input/index.tsx +0 -24
- package/src/components/password-input/password-input.module.css +0 -10
- package/src/components/password-input/password-input.stories.tsx +0 -24
- package/src/components/pill/index.tsx +0 -45
- package/src/components/pill/pill.module.css +0 -22
- package/src/components/pill/pill.stories.tsx +0 -83
- package/src/components/popover/index.tsx +0 -94
- package/src/components/popover/popover.module.css +0 -8
- package/src/components/popover/popover.stories.tsx +0 -53
- package/src/components/preview-card/index.tsx +0 -68
- package/src/components/preview-card/preview-card.module.css +0 -5
- package/src/components/preview-card/preview-card.stories.tsx +0 -58
- package/src/components/radio/index.tsx +0 -67
- package/src/components/radio/radio-group.module.css +0 -5
- package/src/components/radio/radio.module.css +0 -36
- package/src/components/radio/radio.stories.tsx +0 -27
- package/src/components/search-bar/index.tsx +0 -60
- package/src/components/search-bar/search-bar.module.css +0 -29
- package/src/components/search-bar/search-bar.stories.tsx +0 -37
- package/src/components/select/index.tsx +0 -132
- package/src/components/select/select.module.css +0 -63
- package/src/components/select/select.stories.tsx +0 -49
- package/src/components/separator/index.tsx +0 -28
- package/src/components/separator/separator.module.css +0 -24
- package/src/components/separator/separator.stories.tsx +0 -40
- package/src/components/slider/index.tsx +0 -28
- package/src/components/slider/slider.module.css +0 -52
- package/src/components/slider/slider.stories.tsx +0 -53
- package/src/components/spinner/index.tsx +0 -14
- package/src/components/spinner/spinner.module.css +0 -13
- package/src/components/spinner/spinner.stories.tsx +0 -17
- package/src/components/stacked-avatars/index.tsx +0 -88
- package/src/components/stacked-avatars/stacked-avatars.module.css +0 -79
- package/src/components/stacked-avatars/stacked-avatars.stories.tsx +0 -48
- package/src/components/status-banner/index.tsx +0 -96
- package/src/components/status-banner/status-banner.module.css +0 -52
- package/src/components/status-banner/status-banner.stories.tsx +0 -44
- package/src/components/surface/index.tsx +0 -83
- package/src/components/surface/surface.module.css +0 -35
- package/src/components/surface/surface.stories.tsx +0 -84
- package/src/components/switch/index.tsx +0 -23
- package/src/components/switch/switch.module.css +0 -45
- package/src/components/switch/switch.stories.tsx +0 -48
- package/src/components/tabs/index.tsx +0 -126
- package/src/components/tabs/tabs.module.css +0 -134
- package/src/components/tabs/tabs.stories.tsx +0 -88
- package/src/components/text/index.tsx +0 -69
- package/src/components/text/text.module.css +0 -76
- package/src/components/text/text.stories.tsx +0 -107
- package/src/components/theme-provider/index.ts +0 -2
- package/src/components/theme-provider/theme-context.tsx +0 -18
- package/src/components/theme-provider/theme-provider.stories.tsx +0 -47
- package/src/components/theme-provider/theme-provider.tsx +0 -77
- package/src/components/timestamp/index.tsx +0 -131
- package/src/components/timestamp/timestamp.module.css +0 -8
- package/src/components/timestamp/timestamp.stories.tsx +0 -37
- package/src/components/toast/index.ts +0 -2
- package/src/components/toast/toast.module.css +0 -163
- package/src/components/toast/toast.stories.tsx +0 -53
- package/src/components/toast/toast.tsx +0 -104
- package/src/components/toast/use-toast-manager.ts +0 -63
- package/src/components/tooltip/index.tsx +0 -61
- package/src/components/tooltip/tooltip-arrow.tsx +0 -17
- package/src/components/tooltip/tooltip.module.css +0 -44
- package/src/components/tooltip/tooltip.stories.tsx +0 -76
- package/src/components/view/index.tsx +0 -137
- package/src/components/view/view.module.css +0 -11
- package/src/components/view/view.stories.tsx +0 -131
- package/src/components/view/view_colorway.module.css +0 -280
- package/src/components/view/view_interactive.module.css +0 -127
- package/src/components/view/view_loading.module.css +0 -58
- package/src/components/visually-hidden/index.ts +0 -1
- package/src/index.ts +0 -49
- package/src/integrations/react-markdown/index.tsx +0 -134
- package/src/integrations/react-markdown/react-markdown.module.css +0 -62
- package/src/integrations/react-markdown/react-markdown.stories.tsx +0 -31
- package/src/integrations/tailwind.css +0 -173
- package/src/integrations/twemoij/index.tsx +0 -13
- package/src/integrations/twemoij/twemoji.module.css +0 -7
- package/src/integrations/twemoij/twemoji.stories.tsx +0 -40
- package/src/stories/components/all-variants.tsx +0 -40
- package/src/stories/data.ts +0 -72
- package/src/stories/utils.ts +0 -20
- package/src/styles/core.css +0 -153
- package/src/styles/themes/dark.css +0 -86
- package/src/styles/themes/light.css +0 -86
- package/src/styles/transitions.module.css +0 -31
- package/stylelint.config.mjs +0 -29
- package/tsconfig.app.json +0 -35
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -103
- package/vitest.shims.d.ts +0 -1
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
.icon {
|
|
2
|
-
--icon-size: var(--space-16);
|
|
3
|
-
|
|
4
|
-
vertical-align: middle;
|
|
5
|
-
width: var(--icon-size);
|
|
6
|
-
min-width: var(--icon-size);
|
|
7
|
-
height: var(--icon-size);
|
|
8
|
-
min-height: var(--icon-size);
|
|
9
|
-
font-size: var(--icon-size);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/* Maximize performance by declaring styles instead of inline styles */
|
|
13
|
-
.icon_size_sm {
|
|
14
|
-
/* TODO revisit this - we kind of depend on icons to be at least 16 px, so maybe expose an "xs" size? idk */
|
|
15
|
-
--icon-size: var(--space-16);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.icon_size_md {
|
|
19
|
-
--icon-size: var(--space-16);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.icon_size_lg {
|
|
23
|
-
--icon-size: var(--space-20);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.icon_size_xl {
|
|
27
|
-
--icon-size: var(--space-24);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.icon_size_2xl {
|
|
31
|
-
--icon-size: var(--space-32);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.icon_size_3xl {
|
|
35
|
-
--icon-size: var(--space-48);
|
|
36
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { colorTokens, tokens } from "~/styles/tokens";
|
|
4
|
-
|
|
5
|
-
import { Icon } from ".";
|
|
6
|
-
|
|
7
|
-
const iconSizeOptions = ["sm", "md", "lg", "xl", "2xl", "3xl"] as const;
|
|
8
|
-
|
|
9
|
-
const meta = {
|
|
10
|
-
title: "Icon",
|
|
11
|
-
component: Icon,
|
|
12
|
-
parameters: { layout: "centered" },
|
|
13
|
-
argTypes: {
|
|
14
|
-
color: {
|
|
15
|
-
control: "select",
|
|
16
|
-
options: Object.values(colorTokens),
|
|
17
|
-
},
|
|
18
|
-
size: {
|
|
19
|
-
control: "select",
|
|
20
|
-
options: iconSizeOptions,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
} satisfies Meta<typeof Icon>;
|
|
24
|
-
|
|
25
|
-
export default meta;
|
|
26
|
-
|
|
27
|
-
type Story = StoryObj<typeof meta>;
|
|
28
|
-
|
|
29
|
-
export const Default: Story = {
|
|
30
|
-
args: {
|
|
31
|
-
name: "heart-fill",
|
|
32
|
-
color: tokens.primaryDefault,
|
|
33
|
-
size: "md",
|
|
34
|
-
},
|
|
35
|
-
render: (props) => (
|
|
36
|
-
<div>
|
|
37
|
-
<Icon {...props} />
|
|
38
|
-
</div>
|
|
39
|
-
),
|
|
40
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
|
-
import { type ComponentProps } from "react";
|
|
3
|
-
import svgSprite from "remixicon/fonts/remixicon.symbol.svg";
|
|
4
|
-
|
|
5
|
-
import { type ColorToken, type Size } from "~/styles/tokens";
|
|
6
|
-
|
|
7
|
-
import { type IconName } from "./icon-names";
|
|
8
|
-
|
|
9
|
-
import styles from "./icon.module.css";
|
|
10
|
-
|
|
11
|
-
export interface IconProps extends Omit<ComponentProps<"svg">, "name"> {
|
|
12
|
-
/**
|
|
13
|
-
* Overrides the icon size provider.
|
|
14
|
-
* Defaults to "md".
|
|
15
|
-
*/
|
|
16
|
-
size?: Size;
|
|
17
|
-
|
|
18
|
-
/** Icon name */
|
|
19
|
-
name: IconName;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Icon fill color
|
|
23
|
-
* You probably should provide a color token, but we allow any color
|
|
24
|
-
*/
|
|
25
|
-
color?: ColorToken | (string & {});
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Use like `img alt` attribute.
|
|
29
|
-
* Leave empty if icon is purely decorative.
|
|
30
|
-
*/
|
|
31
|
-
alt?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function Icon({
|
|
35
|
-
size = "md",
|
|
36
|
-
name,
|
|
37
|
-
color,
|
|
38
|
-
alt,
|
|
39
|
-
className,
|
|
40
|
-
...props
|
|
41
|
-
}: IconProps) {
|
|
42
|
-
const href = `${svgSprite}#ri-${name}`;
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<svg
|
|
46
|
-
preserveAspectRatio="xMidYMin"
|
|
47
|
-
viewBox="0 0 24 24"
|
|
48
|
-
aria-hidden={!alt}
|
|
49
|
-
focusable={false}
|
|
50
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
-
fill={color || "currentColor"}
|
|
52
|
-
className={clsx(styles["icon"], styles[`icon_size_${size}`], className)}
|
|
53
|
-
{...props}
|
|
54
|
-
>
|
|
55
|
-
{/* https://css-tricks.com/accessible-svg-icons/ */}
|
|
56
|
-
{alt ? <title>{alt}</title> : null}
|
|
57
|
-
<use xlinkHref={href} href={href} />
|
|
58
|
-
</svg>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
.icon-button {
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: center;
|
|
4
|
-
align-items: center;
|
|
5
|
-
border-radius: var(--border-radius-default);
|
|
6
|
-
aspect-ratio: 1 / 1;
|
|
7
|
-
width: var(--icon-button-size);
|
|
8
|
-
height: var(--icon-button-size);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.icon-button_size_sm {
|
|
12
|
-
--icon-button-size: var(--space-24);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.icon-button_size_md {
|
|
16
|
-
--icon-button-size: var(--space-32);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.icon-button_size_lg {
|
|
20
|
-
--icon-button-size: var(--space-40);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.icon-button_size_xl {
|
|
24
|
-
--icon-button-size: var(--space-48);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.icon-button_size_2xl {
|
|
28
|
-
--icon-button-size: var(--space-56);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.icon-button_size_3xl {
|
|
32
|
-
--icon-button-size: var(--space-64);
|
|
33
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { AllVariants } from "~/stories/components/all-variants";
|
|
4
|
-
import { sizes } from "~/stories/data";
|
|
5
|
-
|
|
6
|
-
import { IconButton } from ".";
|
|
7
|
-
|
|
8
|
-
const meta = {
|
|
9
|
-
title: "IconButton",
|
|
10
|
-
component: IconButton,
|
|
11
|
-
parameters: { layout: "centered" },
|
|
12
|
-
argTypes: {
|
|
13
|
-
size: {
|
|
14
|
-
control: "select",
|
|
15
|
-
options: sizes,
|
|
16
|
-
},
|
|
17
|
-
interactive: {
|
|
18
|
-
control: "boolean",
|
|
19
|
-
},
|
|
20
|
-
loading: {
|
|
21
|
-
control: "boolean",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
} satisfies Meta<typeof IconButton>;
|
|
25
|
-
|
|
26
|
-
export default meta;
|
|
27
|
-
|
|
28
|
-
type Story = StoryObj<typeof meta>;
|
|
29
|
-
|
|
30
|
-
export const Default: Story = {
|
|
31
|
-
args: {
|
|
32
|
-
size: "md",
|
|
33
|
-
icon: "add-line",
|
|
34
|
-
alt: "Create a new project.",
|
|
35
|
-
interactive: true,
|
|
36
|
-
loading: false,
|
|
37
|
-
},
|
|
38
|
-
render: (args) => <IconButton {...args} />,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const AllSizes: Story = {
|
|
42
|
-
args: {
|
|
43
|
-
icon: "add-line",
|
|
44
|
-
alt: "Create a new project.",
|
|
45
|
-
},
|
|
46
|
-
argTypes: {
|
|
47
|
-
size: {
|
|
48
|
-
control: false,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
render: (props) => (
|
|
52
|
-
<AllVariants
|
|
53
|
-
variantName="size"
|
|
54
|
-
variants={sizes}
|
|
55
|
-
element={<IconButton interactive {...props} />}
|
|
56
|
-
style={{ flexDirection: "row" }}
|
|
57
|
-
/>
|
|
58
|
-
),
|
|
59
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
|
|
4
|
-
import { type Size } from "~/styles/tokens";
|
|
5
|
-
|
|
6
|
-
import { Icon } from "../icon";
|
|
7
|
-
import type { IconName } from "../icon/icon-names";
|
|
8
|
-
import { View, type ViewProps } from "../view";
|
|
9
|
-
|
|
10
|
-
import styles from "./icon-button.module.css";
|
|
11
|
-
|
|
12
|
-
export type IconButtonProps = ViewProps<"button"> & {
|
|
13
|
-
/** Icon to display. */
|
|
14
|
-
icon: IconName;
|
|
15
|
-
|
|
16
|
-
/** Explain what the button does. Required for accessibility. */
|
|
17
|
-
alt: string;
|
|
18
|
-
|
|
19
|
-
/** What size should the IconButton be. Defaults to "md". */
|
|
20
|
-
size?: Size;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export function IconButton({
|
|
24
|
-
icon,
|
|
25
|
-
alt,
|
|
26
|
-
size = "md",
|
|
27
|
-
render,
|
|
28
|
-
...props
|
|
29
|
-
}: IconButtonProps) {
|
|
30
|
-
return (
|
|
31
|
-
<View<"button">
|
|
32
|
-
interactive={true}
|
|
33
|
-
render={
|
|
34
|
-
<ButtonPrimitive
|
|
35
|
-
className={clsx(
|
|
36
|
-
styles["icon-button"],
|
|
37
|
-
styles[`icon-button_size_${size}`],
|
|
38
|
-
)}
|
|
39
|
-
focusableWhenDisabled={!!props.loading}
|
|
40
|
-
render={render}
|
|
41
|
-
/>
|
|
42
|
-
}
|
|
43
|
-
{...props}
|
|
44
|
-
>
|
|
45
|
-
<Icon name={icon} size={size} alt={alt} />
|
|
46
|
-
</View>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { useRender } from "@base-ui/react";
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
|
|
4
|
-
import { Surface } from "../surface";
|
|
5
|
-
import { Text } from "../text";
|
|
6
|
-
import type { Color } from "../view";
|
|
7
|
-
|
|
8
|
-
import styles from "./inline-code.module.css";
|
|
9
|
-
|
|
10
|
-
export interface InlineCodeProps extends useRender.ComponentProps<"span"> {
|
|
11
|
-
color?: Color;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const InlineCode = ({ color, ...props }: InlineCodeProps) => {
|
|
15
|
-
return (
|
|
16
|
-
<Surface
|
|
17
|
-
elevated
|
|
18
|
-
className={clsx(
|
|
19
|
-
styles["inline-code"],
|
|
20
|
-
color && styles["inline-code_colorway"],
|
|
21
|
-
)}
|
|
22
|
-
color={color}
|
|
23
|
-
>
|
|
24
|
-
<Text size="sm" color="inherit">
|
|
25
|
-
<code {...props} />
|
|
26
|
-
</Text>
|
|
27
|
-
</Surface>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
.inline-code {
|
|
2
|
-
display: inline;
|
|
3
|
-
border: 1px solid var(--surface-interactive-border);
|
|
4
|
-
border-radius: var(--border-radius-6);
|
|
5
|
-
padding: 0 var(--space-4);
|
|
6
|
-
line-height: var(--line-height-default);
|
|
7
|
-
font-family: var(--font-family-code);
|
|
8
|
-
overflow-wrap: anywhere;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.inline-code_colorway {
|
|
12
|
-
color: var(--view-colorway-default);
|
|
13
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { tokens } from "~/styles/tokens";
|
|
4
|
-
|
|
5
|
-
import { InlineCode } from ".";
|
|
6
|
-
import { Surface } from "../surface";
|
|
7
|
-
import { Text } from "../text";
|
|
8
|
-
|
|
9
|
-
const meta = {
|
|
10
|
-
title: "Code/Inline Code",
|
|
11
|
-
component: InlineCode,
|
|
12
|
-
parameters: { layout: "centered" },
|
|
13
|
-
} satisfies Meta<typeof InlineCode>;
|
|
14
|
-
|
|
15
|
-
export default meta;
|
|
16
|
-
|
|
17
|
-
type Story = StoryObj<typeof meta>;
|
|
18
|
-
|
|
19
|
-
export const Default: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
color: undefined,
|
|
22
|
-
},
|
|
23
|
-
render: (args) => (
|
|
24
|
-
<Surface style={{ padding: tokens.space16 }} elevated>
|
|
25
|
-
<Text>
|
|
26
|
-
Import the library with{" "}
|
|
27
|
-
<InlineCode {...args}>import * from "natmfat"</InlineCode>
|
|
28
|
-
</Text>
|
|
29
|
-
</Surface>
|
|
30
|
-
),
|
|
31
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
|
|
4
|
-
import { View } from "../view";
|
|
5
|
-
|
|
6
|
-
import styles from "./input.module.css";
|
|
7
|
-
|
|
8
|
-
export type InputProps = InputPrimitive.Props;
|
|
9
|
-
|
|
10
|
-
export function Input({ className, ...props }: InputProps) {
|
|
11
|
-
return (
|
|
12
|
-
<View
|
|
13
|
-
interactive="fill-outline"
|
|
14
|
-
render={
|
|
15
|
-
<InputPrimitive
|
|
16
|
-
className={clsx(styles["input"], className)}
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
.input {
|
|
2
|
-
flex: 1 1 0%;
|
|
3
|
-
outline: none;
|
|
4
|
-
padding: var(--space-4) var(--space-8);
|
|
5
|
-
height: var(--space-32);
|
|
6
|
-
min-height: var(--space-32);
|
|
7
|
-
font-size: var(--font-size-default);
|
|
8
|
-
line-height: var(--line-height-input);
|
|
9
|
-
font-family: var(--font-family-default);
|
|
10
|
-
|
|
11
|
-
&::placeholder {
|
|
12
|
-
color: var(--foreground-dimmest);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&:not([disabled], [data-disabled]) {
|
|
16
|
-
cursor: text;
|
|
17
|
-
color: var(--foreground-default);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.input_autosize {
|
|
22
|
-
resize: none;
|
|
23
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { AllVariants } from "~/stories/components/all-variants";
|
|
4
|
-
import { surfaceBackgrounds } from "~/stories/data";
|
|
5
|
-
import { tokens } from "~/styles/tokens";
|
|
6
|
-
|
|
7
|
-
import { Input } from ".";
|
|
8
|
-
import { Surface } from "../surface";
|
|
9
|
-
|
|
10
|
-
const meta = {
|
|
11
|
-
title: "Input/Text",
|
|
12
|
-
component: Input,
|
|
13
|
-
parameters: { layout: "centered" },
|
|
14
|
-
} satisfies Meta<typeof Input>;
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
|
|
18
|
-
type Story = StoryObj<typeof meta>;
|
|
19
|
-
|
|
20
|
-
export const Default: Story = {
|
|
21
|
-
args: {
|
|
22
|
-
placeholder: "Hello World",
|
|
23
|
-
disabled: false,
|
|
24
|
-
},
|
|
25
|
-
render: (args) => <Input {...args} style={{ width: tokens.space256 }} />,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const AllInteractiveStyles: Story = {
|
|
29
|
-
args: {
|
|
30
|
-
placeholder: "Hello World",
|
|
31
|
-
disabled: false,
|
|
32
|
-
},
|
|
33
|
-
render: (args) => (
|
|
34
|
-
<AllVariants
|
|
35
|
-
variantName="background"
|
|
36
|
-
variants={surfaceBackgrounds}
|
|
37
|
-
style={{ backgroundColor: "transparent" }}
|
|
38
|
-
element={
|
|
39
|
-
<Surface
|
|
40
|
-
style={{
|
|
41
|
-
padding: tokens.space16,
|
|
42
|
-
gap: tokens.space8,
|
|
43
|
-
borderWidth: "1px",
|
|
44
|
-
borderColor: tokens.outlineDimmest,
|
|
45
|
-
}}
|
|
46
|
-
>
|
|
47
|
-
<Input {...args} />
|
|
48
|
-
</Surface>
|
|
49
|
-
}
|
|
50
|
-
/>
|
|
51
|
-
),
|
|
52
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Meter as MeterPrimitive } from "@base-ui/react/meter";
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
|
|
4
|
-
import { Text } from "../text";
|
|
5
|
-
import { View, type Color } from "../view";
|
|
6
|
-
|
|
7
|
-
import styles from "./meter.module.css";
|
|
8
|
-
|
|
9
|
-
export type MeterProps = MeterPrimitive.Root.Props & {
|
|
10
|
-
/**
|
|
11
|
-
* What is this meter even for bro?
|
|
12
|
-
* If one is not provided, we render a standard meter (no label, no value).
|
|
13
|
-
* You can still provide one yourself through children.
|
|
14
|
-
* @example
|
|
15
|
-
* <Meter value={24}>
|
|
16
|
-
* <MeterPrimitive.Label render={<Text />} />
|
|
17
|
-
* <MeterPrimitive.Value render={<Text />} />
|
|
18
|
-
* </Meter>
|
|
19
|
-
*/
|
|
20
|
-
label?: string;
|
|
21
|
-
|
|
22
|
-
/** Communicate purpose with color. Defaults to "primary". */
|
|
23
|
-
color?: Color;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export function Meter({
|
|
27
|
-
label,
|
|
28
|
-
color = "primary",
|
|
29
|
-
className,
|
|
30
|
-
children,
|
|
31
|
-
...props
|
|
32
|
-
}: MeterProps) {
|
|
33
|
-
return (
|
|
34
|
-
<View color={color}>
|
|
35
|
-
<MeterPrimitive.Root
|
|
36
|
-
className={clsx(styles["meter"], className)}
|
|
37
|
-
{...props}
|
|
38
|
-
>
|
|
39
|
-
{label ? (
|
|
40
|
-
<>
|
|
41
|
-
<Text render={<MeterPrimitive.Label />}>{label}</Text>
|
|
42
|
-
<Text
|
|
43
|
-
className={styles["meter__value"]}
|
|
44
|
-
render={<MeterPrimitive.Value />}
|
|
45
|
-
/>
|
|
46
|
-
</>
|
|
47
|
-
) : null}
|
|
48
|
-
{children}
|
|
49
|
-
<MeterPrimitive.Track className={styles["meter__track"]}>
|
|
50
|
-
<MeterPrimitive.Indicator className={styles["meter__indicator"]} />
|
|
51
|
-
</MeterPrimitive.Track>
|
|
52
|
-
</MeterPrimitive.Root>
|
|
53
|
-
</View>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
.meter {
|
|
2
|
-
display: grid;
|
|
3
|
-
grid-template-columns: 1fr 1fr;
|
|
4
|
-
row-gap: var(--space-4);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.meter__value {
|
|
8
|
-
grid-column-start: 2;
|
|
9
|
-
margin: 0;
|
|
10
|
-
text-align: right;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.meter__track {
|
|
14
|
-
grid-column: 1 / 3;
|
|
15
|
-
background-color: var(--surface-interactive-border);
|
|
16
|
-
height: var(--space-8);
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.meter__indicator {
|
|
21
|
-
transition: width var(--transition-duration-chill);
|
|
22
|
-
background-color: var(--view-colorway-default);
|
|
23
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { colors } from "~/stories/data";
|
|
4
|
-
import { tokens } from "~/styles/tokens";
|
|
5
|
-
|
|
6
|
-
import { Meter } from ".";
|
|
7
|
-
|
|
8
|
-
const meta = {
|
|
9
|
-
title: "Meter",
|
|
10
|
-
component: Meter,
|
|
11
|
-
parameters: { layout: "centered" },
|
|
12
|
-
argTypes: {
|
|
13
|
-
color: {
|
|
14
|
-
control: "select",
|
|
15
|
-
options: colors,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
} satisfies Meta<typeof Meter>;
|
|
19
|
-
|
|
20
|
-
export default meta;
|
|
21
|
-
|
|
22
|
-
type Story = StoryObj<typeof meta>;
|
|
23
|
-
|
|
24
|
-
export const Default: Story = {
|
|
25
|
-
args: {
|
|
26
|
-
color: "orange",
|
|
27
|
-
label: "Storage used",
|
|
28
|
-
value: 24,
|
|
29
|
-
},
|
|
30
|
-
render: (args) => <Meter {...args} style={{ width: tokens.space256 }} />,
|
|
31
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { useRender } from "@base-ui/react";
|
|
2
|
-
import autosize from "autosize";
|
|
3
|
-
import clsx from "clsx";
|
|
4
|
-
import { useEffect, useRef } from "react";
|
|
5
|
-
|
|
6
|
-
import { mergeRefs } from "~/-utils";
|
|
7
|
-
|
|
8
|
-
import { View } from "../view";
|
|
9
|
-
|
|
10
|
-
import styles from "../input/input.module.css";
|
|
11
|
-
|
|
12
|
-
export interface MultilineInputProps extends useRender.ComponentProps<"textarea"> {
|
|
13
|
-
/** Automatically resize textarea. Defaults to false. */
|
|
14
|
-
autosize?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function MultilineInput({
|
|
18
|
-
autosize = false,
|
|
19
|
-
className,
|
|
20
|
-
ref,
|
|
21
|
-
...props
|
|
22
|
-
}: MultilineInputProps) {
|
|
23
|
-
const autosizeRef = useAutosize(autosize);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<View
|
|
27
|
-
interactive="fill-outline"
|
|
28
|
-
render={
|
|
29
|
-
<textarea
|
|
30
|
-
className={clsx(
|
|
31
|
-
styles["input"],
|
|
32
|
-
autosize && styles["input_autosize"],
|
|
33
|
-
className,
|
|
34
|
-
)}
|
|
35
|
-
ref={mergeRefs(ref, autosizeRef)}
|
|
36
|
-
{...props}
|
|
37
|
-
></textarea>
|
|
38
|
-
}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function useAutosize(enabled: boolean) {
|
|
44
|
-
const ref = useRef<HTMLTextAreaElement>(null);
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
const element = ref.current;
|
|
48
|
-
if (!element || !enabled) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
autosize(element);
|
|
52
|
-
return () => {
|
|
53
|
-
autosize.destroy(element);
|
|
54
|
-
};
|
|
55
|
-
}, [enabled]);
|
|
56
|
-
|
|
57
|
-
return ref;
|
|
58
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { tokens } from "~/styles/tokens";
|
|
4
|
-
|
|
5
|
-
import { MultilineInput } from ".";
|
|
6
|
-
|
|
7
|
-
const meta = {
|
|
8
|
-
title: "Input/Textarea",
|
|
9
|
-
component: MultilineInput,
|
|
10
|
-
parameters: { layout: "centered" },
|
|
11
|
-
} satisfies Meta<typeof MultilineInput>;
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
|
|
15
|
-
type Story = StoryObj<typeof meta>;
|
|
16
|
-
|
|
17
|
-
export const Default: Story = {
|
|
18
|
-
args: {
|
|
19
|
-
placeholder: "Hello World",
|
|
20
|
-
disabled: false,
|
|
21
|
-
autosize: true,
|
|
22
|
-
},
|
|
23
|
-
render: (args) => (
|
|
24
|
-
<MultilineInput {...args} style={{ width: tokens.space256 }} />
|
|
25
|
-
),
|
|
26
|
-
};
|