@iamfiro/design 0.0.0-stage → 0.3.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/AGENTS.md +82 -0
- package/README.md +15 -2
- package/agents/INDEX.md +157 -0
- package/agents/accordion/AGENTS.md +279 -0
- package/agents/action-bar/AGENTS.md +90 -0
- package/agents/alert/AGENTS.md +212 -0
- package/agents/alert-dialog/AGENTS.md +193 -0
- package/agents/app-shell/AGENTS.md +409 -0
- package/agents/area-chart/AGENTS.md +183 -0
- package/agents/aspect-ratio/AGENTS.md +143 -0
- package/agents/avatar/AGENTS.md +130 -0
- package/agents/badge/AGENTS.md +217 -0
- package/agents/bar-chart/AGENTS.md +386 -0
- package/agents/bar-list/AGENTS.md +223 -0
- package/agents/brand-icon/AGENTS.md +82 -0
- package/agents/breadcrumb/AGENTS.md +133 -0
- package/agents/button/AGENTS.md +195 -0
- package/agents/card/AGENTS.md +141 -0
- package/agents/card-frame/AGENTS.md +227 -0
- package/agents/chat-bubble/AGENTS.md +266 -0
- package/agents/chat-composer/AGENTS.md +251 -0
- package/agents/checkbox/AGENTS.md +113 -0
- package/agents/code-block/AGENTS.md +144 -0
- package/agents/color-dot/AGENTS.md +120 -0
- package/agents/color-picker/AGENTS.md +224 -0
- package/agents/colors/AGENTS.md +168 -0
- package/agents/combobox/AGENTS.md +218 -0
- package/agents/command-menu/AGENTS.md +169 -0
- package/agents/comment/AGENTS.md +206 -0
- package/agents/context-menu/AGENTS.md +303 -0
- package/agents/copy-button/AGENTS.md +84 -0
- package/agents/count-badge/AGENTS.md +115 -0
- package/agents/countdown/AGENTS.md +101 -0
- package/agents/data-grid/AGENTS.md +460 -0
- package/agents/date-picker/AGENTS.md +197 -0
- package/agents/delta/AGENTS.md +114 -0
- package/agents/description-list/AGENTS.md +251 -0
- package/agents/dialog/AGENTS.md +391 -0
- package/agents/drawer/AGENTS.md +471 -0
- package/agents/dropdown-menu/AGENTS.md +322 -0
- package/agents/dropzone/AGENTS.md +116 -0
- package/agents/elapsed/AGENTS.md +160 -0
- package/agents/empty-state/AGENTS.md +203 -0
- package/agents/file-chip/AGENTS.md +79 -0
- package/agents/file-icon/AGENTS.md +66 -0
- package/agents/file-upload/AGENTS.md +168 -0
- package/agents/filter-chips/AGENTS.md +167 -0
- package/agents/flag/AGENTS.md +67 -0
- package/agents/funnel-chart/AGENTS.md +131 -0
- package/agents/highlight/AGENTS.md +119 -0
- package/agents/hover-card/AGENTS.md +271 -0
- package/agents/icon-stack/AGENTS.md +120 -0
- package/agents/icon-tile/AGENTS.md +94 -0
- package/agents/inline-diff/AGENTS.md +211 -0
- package/agents/input/AGENTS.md +261 -0
- package/agents/kanban/AGENTS.md +352 -0
- package/agents/kbd/AGENTS.md +160 -0
- package/agents/layout/AGENTS.md +351 -0
- package/agents/line-chart/AGENTS.md +393 -0
- package/agents/link/AGENTS.md +53 -0
- package/agents/list/AGENTS.md +392 -0
- package/agents/marker/AGENTS.md +142 -0
- package/agents/masked-text/AGENTS.md +127 -0
- package/agents/menubar/AGENTS.md +276 -0
- package/agents/multi-select/AGENTS.md +159 -0
- package/agents/navigation-menu/AGENTS.md +315 -0
- package/agents/notice-stack/AGENTS.md +101 -0
- package/agents/number-stepper/AGENTS.md +96 -0
- package/agents/otp-input/AGENTS.md +162 -0
- package/agents/pagination/AGENTS.md +189 -0
- package/agents/phone-input/AGENTS.md +131 -0
- package/agents/pie-chart/AGENTS.md +243 -0
- package/agents/popover/AGENTS.md +190 -0
- package/agents/progress/AGENTS.md +273 -0
- package/agents/progress-tracker/AGENTS.md +305 -0
- package/agents/rating/AGENTS.md +165 -0
- package/agents/relative-time/AGENTS.md +103 -0
- package/agents/resizable/AGENTS.md +390 -0
- package/agents/scaled-preview/AGENTS.md +111 -0
- package/agents/scatter-chart/AGENTS.md +160 -0
- package/agents/scroll-area/AGENTS.md +271 -0
- package/agents/search-input/AGENTS.md +105 -0
- package/agents/segmented-control/AGENTS.md +153 -0
- package/agents/select/AGENTS.md +159 -0
- package/agents/selector-button/AGENTS.md +122 -0
- package/agents/sidebar/AGENTS.md +201 -0
- package/agents/skeleton/AGENTS.md +166 -0
- package/agents/slider/AGENTS.md +181 -0
- package/agents/social-login-button/AGENTS.md +156 -0
- package/agents/spark-chart/AGENTS.md +257 -0
- package/agents/sparkbar/AGENTS.md +92 -0
- package/agents/spinner/AGENTS.md +123 -0
- package/agents/split-view/AGENTS.md +290 -0
- package/agents/stat/AGENTS.md +138 -0
- package/agents/status-icon/AGENTS.md +243 -0
- package/agents/step-list/AGENTS.md +313 -0
- package/agents/table/AGENTS.md +286 -0
- package/agents/tabs/AGENTS.md +305 -0
- package/agents/tag-input/AGENTS.md +246 -0
- package/agents/time-picker/AGENTS.md +228 -0
- package/agents/timeline/AGENTS.md +1018 -0
- package/agents/toast/AGENTS.md +266 -0
- package/agents/toggle-group/AGENTS.md +216 -0
- package/agents/toolbar/AGENTS.md +277 -0
- package/agents/tooltip/AGENTS.md +154 -0
- package/agents/tracker/AGENTS.md +158 -0
- package/agents/tree-diagram/AGENTS.md +260 -0
- package/agents/tree-view/AGENTS.md +329 -0
- package/agents/typography/AGENTS.md +396 -0
- package/lib/components/Accordion/Accordion2.js +135 -0
- package/lib/components/ActionBar/ActionBar2.js +65 -0
- package/lib/components/Alert/Alert2.js +131 -0
- package/lib/components/AppShell/AppShell2.js +94 -0
- package/lib/components/AreaChart/AreaChart.js +59 -0
- package/lib/components/BarChart/BarChart2.js +243 -0
- package/lib/components/BarList/BarList2.js +172 -0
- package/lib/components/Breadcrumb/Breadcrumb2.js +87 -0
- package/lib/components/Calendar/Calendar2.js +309 -0
- package/lib/components/Calendar/DatePicker2.js +229 -0
- package/lib/components/Calendar/date.js +121 -0
- package/lib/components/Card/Card2.js +104 -0
- package/lib/components/CardFrame/CardFrame2.js +72 -0
- package/lib/components/Chart/ChartParts.js +150 -0
- package/lib/components/Chart/chart2.js +96 -0
- package/lib/components/Chart/useChartInteraction.js +94 -0
- package/lib/components/ChatBubble/ChatBubble2.js +174 -0
- package/lib/components/ChatBubble/formatChatTime.js +53 -0
- package/lib/components/ChatComposer/ChatComposer2.js +153 -0
- package/lib/components/CodeBlock/CodeBlock2.js +93 -0
- package/lib/components/CodeBlock/highlight.js +114 -0
- package/lib/components/ColorPicker/ColorPicker2.js +610 -0
- package/lib/components/ColorPicker/color.js +180 -0
- package/lib/components/ColorPicker/presets.js +75 -0
- package/lib/components/Combobox/Combobox2.js +229 -0
- package/lib/components/CommandMenu/CommandMenu.js +267 -0
- package/lib/components/Comment/Comment2.js +134 -0
- package/lib/components/ContextMenu/ContextMenu2.js +168 -0
- package/lib/components/DataGrid/DataGrid2.js +1996 -0
- package/lib/components/DataGrid/GridPopover.js +154 -0
- package/lib/components/DataGrid/anchor.js +50 -0
- package/lib/components/DataGrid/model.js +558 -0
- package/lib/components/DataGrid/panels.js +703 -0
- package/lib/components/DataGrid/typeMeta.js +76 -0
- package/lib/components/DataGrid/types.js +54 -0
- package/lib/components/DescriptionList/DescriptionList2.js +180 -0
- package/lib/components/Dialog/AlertDialog.js +118 -0
- package/lib/components/Dialog/Dialog2.js +109 -0
- package/lib/components/Dialog/modal.js +92 -0
- package/lib/components/Drawer/Drawer2.js +244 -0
- package/lib/components/DropdownMenu/DropdownMenu2.js +394 -0
- package/lib/components/DropdownMenu/menuCore.js +63 -0
- package/lib/components/Dropzone/Dropzone2.js +144 -0
- package/lib/components/EmptyState/EmptyState2.js +72 -0
- package/lib/components/FileChip/FileChip2.js +118 -0
- package/lib/components/FileUpload/FileUpload.js +258 -0
- package/lib/components/FilterChips/FilterChips2.js +101 -0
- package/lib/components/FunnelChart/FunnelChart2.js +283 -0
- package/lib/components/FunnelChart/funnel.js +69 -0
- package/lib/components/Highlight/Highlight2.js +100 -0
- package/lib/components/HoverCard/HoverCard.js +134 -0
- package/lib/components/InlineDiff/InlineDiff2.js +215 -0
- package/lib/components/InlineDiff/diff.js +126 -0
- package/lib/components/InlineDiff/useDiffReview.js +109 -0
- package/lib/components/Kanban/Kanban2.js +691 -0
- package/lib/components/Kanban/KanbanCard.js +159 -0
- package/lib/components/Kanban/move.js +69 -0
- package/lib/components/LineChart/LineChart2.js +342 -0
- package/lib/components/List/List2.js +133 -0
- package/lib/components/Listbox/Listbox2.js +163 -0
- package/lib/components/Marker/Marker2.js +82 -0
- package/lib/components/Menubar/Menubar2.js +223 -0
- package/lib/components/MultiSelect/MultiSelect2.js +204 -0
- package/lib/components/NavigationMenu/NavigationMenu2.js +481 -0
- package/lib/components/NoticeStack/NoticeStack2.js +178 -0
- package/lib/components/NumberStepper/NumberStepper2.js +129 -0
- package/lib/components/OtpInput/OtpInput2.js +122 -0
- package/lib/components/Pagination/Pagination2.js +210 -0
- package/lib/components/Pagination/paginationRange.js +53 -0
- package/lib/components/PhoneInput/PhoneInput.js +175 -0
- package/lib/components/PieChart/PieChart2.js +246 -0
- package/lib/components/PieChart/arc.js +66 -0
- package/lib/components/PieChart/useArcTween.js +94 -0
- package/lib/components/Popover/Popover2.js +112 -0
- package/lib/components/ProgressTracker/ProgressTracker2.js +226 -0
- package/lib/components/Rating/Rating2.js +186 -0
- package/lib/components/Resizable/Resizable2.js +236 -0
- package/lib/components/Resizable/layout.js +115 -0
- package/lib/components/ScaledPreview/ScaledPreview2.js +100 -0
- package/lib/components/ScatterChart/ScatterChart2.js +356 -0
- package/lib/components/ScatterChart/scatter.js +83 -0
- package/lib/components/ScrollArea/ScrollArea2.js +218 -0
- package/lib/components/Select/Select2.js +153 -0
- package/lib/components/Sidebar/Sidebar2.js +127 -0
- package/lib/components/Skeleton/Skeleton2.js +91 -0
- package/lib/components/Slider/Slider2.js +142 -0
- package/lib/components/SocialLoginButton/SocialLoginButton.js +85 -0
- package/lib/components/SparkChart/SparkChart2.js +217 -0
- package/lib/components/SparkChart/spark.js +76 -0
- package/lib/components/Sparkbar/Sparkbar2.js +111 -0
- package/lib/components/SplitView/SplitView2.js +95 -0
- package/lib/components/Stat/Stat2.js +164 -0
- package/lib/components/StepList/StepList2.js +131 -0
- package/lib/components/Table/Table2.js +104 -0
- package/lib/components/Tabs/Tabs2.js +131 -0
- package/lib/components/TagInput/TagInput2.js +360 -0
- package/lib/components/TimePicker/TimePicker2.js +388 -0
- package/lib/components/TimePicker/time.js +83 -0
- package/lib/components/Timeline/Timeline2.js +369 -0
- package/lib/components/Timeline/scale.js +83 -0
- package/lib/components/Toast/Toaster.js +212 -0
- package/lib/components/Toast/store.js +129 -0
- package/lib/components/ToggleGroup/ToggleGroup2.js +125 -0
- package/lib/components/Toolbar/Toolbar2.js +281 -0
- package/lib/components/Tracker/Tracker2.js +172 -0
- package/lib/components/TreeDiagram/TreeDiagram2.js +223 -0
- package/lib/components/TreeView/TreeView2.js +284 -0
- package/lib/hooks/timing.js +55 -0
- package/lib/hooks/useControllableState.js +49 -0
- package/lib/hooks/useCountdown.js +80 -0
- package/lib/hooks/useDigitInput.js +105 -0
- package/lib/hooks/useDismiss.js +71 -0
- package/lib/hooks/useElapsed.js +83 -0
- package/lib/hooks/useFloating.js +70 -0
- package/lib/hooks/useFocusTrap.js +61 -0
- package/lib/hooks/usePresence.js +60 -0
- package/lib/hooks/usePressToOpen.js +69 -0
- package/lib/hooks/useScrollLock.js +70 -0
- package/lib/hooks/useSelection.js +68 -0
- package/lib/index.js +178 -0
- package/lib/primitives/AspectRatio2.js +80 -0
- package/lib/primitives/BrandIcon.js +245 -0
- package/lib/primitives/ColorDot2.js +70 -0
- package/lib/primitives/CopyButton2.js +85 -0
- package/lib/primitives/CountBadge2.js +78 -0
- package/lib/primitives/Countdown2.js +65 -0
- package/lib/primitives/Delta2.js +67 -0
- package/lib/primitives/Elapsed.js +62 -0
- package/lib/primitives/FileIcon2.js +125 -0
- package/lib/primitives/Flag2.js +263 -0
- package/lib/primitives/IconStack2.js +85 -0
- package/lib/primitives/IconTile2.js +68 -0
- package/lib/primitives/Kbd2.js +88 -0
- package/lib/primitives/Layout2.js +118 -0
- package/lib/primitives/Link2.js +53 -0
- package/lib/primitives/MaskedText2.js +120 -0
- package/lib/primitives/Progress2.js +137 -0
- package/lib/primitives/RelativeTime.js +84 -0
- package/lib/primitives/SearchInput2.js +84 -0
- package/lib/primitives/SelectorButton2.js +97 -0
- package/lib/primitives/Spinner2.js +98 -0
- package/lib/primitives/StatusIcon2.js +126 -0
- package/lib/primitives/Swatch2.js +79 -0
- package/lib/primitives/Tooltip2.js +132 -0
- package/lib/primitives/Typography2.js +97 -0
- package/lib/primitives/formatCountdown.js +51 -0
- package/lib/primitives/formatElapsed.js +66 -0
- package/lib/primitives/formatRelativeTime.js +64 -0
- package/lib/primitives/hotkey.js +94 -0
- package/lib/primitives/index.js +352 -0
- package/lib/primitives/maskValue.js +65 -0
- package/lib/style.css +2 -0
- package/lib/types/components/Accordion/Accordion.d.ts +57 -0
- package/lib/types/components/ActionBar/ActionBar.d.ts +24 -0
- package/lib/types/components/Alert/Alert.d.ts +36 -0
- package/lib/types/components/AppShell/AppShell.d.ts +38 -0
- package/lib/types/components/AreaChart/AreaChart.d.ts +17 -0
- package/lib/types/components/BarChart/BarChart.d.ts +57 -0
- package/lib/types/components/BarList/BarList.d.ts +56 -0
- package/lib/types/components/Breadcrumb/Breadcrumb.d.ts +15 -0
- package/lib/types/components/Calendar/Calendar.d.ts +34 -0
- package/lib/types/components/Calendar/DatePicker.d.ts +45 -0
- package/lib/types/components/Calendar/date.d.ts +32 -0
- package/lib/types/components/Card/Card.d.ts +64 -0
- package/lib/types/components/CardFrame/CardFrame.d.ts +15 -0
- package/lib/types/components/Chart/ChartParts.d.ts +38 -0
- package/lib/types/components/Chart/chart.d.ts +46 -0
- package/lib/types/components/Chart/useChartInteraction.d.ts +39 -0
- package/lib/types/components/ChatBubble/ChatBubble.d.ts +61 -0
- package/lib/types/components/ChatBubble/formatChatTime.d.ts +2 -0
- package/lib/types/components/ChatComposer/ChatComposer.d.ts +42 -0
- package/lib/types/components/CodeBlock/CodeBlock.d.ts +18 -0
- package/lib/types/components/CodeBlock/highlight.d.ts +10 -0
- package/lib/types/components/ColorPicker/ColorPicker.d.ts +61 -0
- package/lib/types/components/ColorPicker/color.d.ts +48 -0
- package/lib/types/components/ColorPicker/presets.d.ts +7 -0
- package/lib/types/components/Combobox/Combobox.d.ts +48 -0
- package/lib/types/components/CommandMenu/CommandMenu.d.ts +51 -0
- package/lib/types/components/Comment/Comment.d.ts +45 -0
- package/lib/types/components/ContextMenu/ContextMenu.d.ts +40 -0
- package/lib/types/components/DataGrid/DataGrid.d.ts +43 -0
- package/lib/types/components/DataGrid/GridPopover.d.ts +43 -0
- package/lib/types/components/DataGrid/anchor.d.ts +5 -0
- package/lib/types/components/DataGrid/model.d.ts +61 -0
- package/lib/types/components/DataGrid/panels.d.ts +63 -0
- package/lib/types/components/DataGrid/typeMeta.d.ts +6 -0
- package/lib/types/components/DataGrid/types.d.ts +77 -0
- package/lib/types/components/DescriptionList/DescriptionList.d.ts +77 -0
- package/lib/types/components/Dialog/AlertDialog.d.ts +26 -0
- package/lib/types/components/Dialog/Dialog.d.ts +42 -0
- package/lib/types/components/Dialog/modal.d.ts +38 -0
- package/lib/types/components/Drawer/Drawer.d.ts +62 -0
- package/lib/types/components/DropdownMenu/DropdownMenu.d.ts +97 -0
- package/lib/types/components/DropdownMenu/menuCore.d.ts +23 -0
- package/lib/types/components/Dropzone/Dropzone.d.ts +30 -0
- package/lib/types/components/EmptyState/EmptyState.d.ts +26 -0
- package/lib/types/components/FileChip/FileChip.d.ts +32 -0
- package/lib/types/components/FileUpload/FileUpload.d.ts +52 -0
- package/lib/types/components/FilterChips/FilterChips.d.ts +37 -0
- package/lib/types/components/FunnelChart/FunnelChart.d.ts +38 -0
- package/lib/types/components/FunnelChart/funnel.d.ts +25 -0
- package/lib/types/components/Highlight/Highlight.d.ts +35 -0
- package/lib/types/components/HoverCard/HoverCard.d.ts +47 -0
- package/lib/types/components/InlineDiff/InlineDiff.d.ts +36 -0
- package/lib/types/components/InlineDiff/diff.d.ts +42 -0
- package/lib/types/components/InlineDiff/useDiffReview.d.ts +57 -0
- package/lib/types/components/Kanban/Kanban.d.ts +64 -0
- package/lib/types/components/Kanban/KanbanCard.d.ts +35 -0
- package/lib/types/components/Kanban/move.d.ts +25 -0
- package/lib/types/components/LineChart/LineChart.d.ts +85 -0
- package/lib/types/components/List/List.d.ts +62 -0
- package/lib/types/components/Listbox/Listbox.d.ts +60 -0
- package/lib/types/components/Marker/Marker.d.ts +28 -0
- package/lib/types/components/Menubar/Menubar.d.ts +50 -0
- package/lib/types/components/MultiSelect/MultiSelect.d.ts +38 -0
- package/lib/types/components/NavigationMenu/NavigationMenu.d.ts +101 -0
- package/lib/types/components/NoticeStack/NoticeStack.d.ts +41 -0
- package/lib/types/components/NumberStepper/NumberStepper.d.ts +32 -0
- package/lib/types/components/OtpInput/OtpInput.d.ts +31 -0
- package/lib/types/components/Pagination/Pagination.d.ts +54 -0
- package/lib/types/components/Pagination/paginationRange.d.ts +7 -0
- package/lib/types/components/PhoneInput/PhoneInput.d.ts +47 -0
- package/lib/types/components/PieChart/PieChart.d.ts +67 -0
- package/lib/types/components/PieChart/arc.d.ts +26 -0
- package/lib/types/components/PieChart/useArcTween.d.ts +15 -0
- package/lib/types/components/Popover/Popover.d.ts +28 -0
- package/lib/types/components/ProgressTracker/ProgressTracker.d.ts +64 -0
- package/lib/types/components/Rating/Rating.d.ts +42 -0
- package/lib/types/components/Resizable/Resizable.d.ts +50 -0
- package/lib/types/components/Resizable/layout.d.ts +31 -0
- package/lib/types/components/ScaledPreview/ScaledPreview.d.ts +38 -0
- package/lib/types/components/ScatterChart/ScatterChart.d.ts +81 -0
- package/lib/types/components/ScatterChart/scatter.d.ts +14 -0
- package/lib/types/components/ScrollArea/ScrollArea.d.ts +34 -0
- package/lib/types/components/Select/Select.d.ts +39 -0
- package/lib/types/components/Sidebar/Sidebar.d.ts +39 -0
- package/lib/types/components/Skeleton/Skeleton.d.ts +47 -0
- package/lib/types/components/Slider/Slider.d.ts +36 -0
- package/lib/types/components/SocialLoginButton/SocialLoginButton.d.ts +10 -0
- package/lib/types/components/SparkChart/SparkChart.d.ts +55 -0
- package/lib/types/components/SparkChart/spark.d.ts +16 -0
- package/lib/types/components/Sparkbar/Sparkbar.d.ts +39 -0
- package/lib/types/components/SplitView/SplitView.d.ts +31 -0
- package/lib/types/components/Stat/Stat.d.ts +58 -0
- package/lib/types/components/StepList/StepList.d.ts +61 -0
- package/lib/types/components/Table/Table.d.ts +39 -0
- package/lib/types/components/Tabs/Tabs.d.ts +47 -0
- package/lib/types/components/TagInput/TagInput.d.ts +46 -0
- package/lib/types/components/TimePicker/TimePicker.d.ts +43 -0
- package/lib/types/components/TimePicker/time.d.ts +15 -0
- package/lib/types/components/Timeline/Timeline.d.ts +154 -0
- package/lib/types/components/Timeline/scale.d.ts +22 -0
- package/lib/types/components/Toast/Toaster.d.ts +19 -0
- package/lib/types/components/Toast/index.d.ts +4 -0
- package/lib/types/components/Toast/store.d.ts +75 -0
- package/lib/types/components/ToggleGroup/ToggleGroup.d.ts +28 -0
- package/lib/types/components/Toolbar/Toolbar.d.ts +70 -0
- package/lib/types/components/Tracker/Tracker.d.ts +43 -0
- package/lib/types/components/TreeDiagram/TreeDiagram.d.ts +68 -0
- package/lib/types/components/TreeView/TreeView.d.ts +107 -0
- package/lib/types/components/index.d.ts +188 -0
- package/lib/types/hooks/index.d.ts +17 -0
- package/lib/types/hooks/timing.d.ts +29 -0
- package/lib/types/hooks/useControllableState.d.ts +5 -0
- package/lib/types/hooks/useCountdown.d.ts +19 -0
- package/lib/types/hooks/useDigitInput.d.ts +24 -0
- package/lib/types/hooks/useDismiss.d.ts +3 -0
- package/lib/types/hooks/useElapsed.d.ts +28 -0
- package/lib/types/hooks/useFloating.d.ts +21 -0
- package/lib/types/hooks/useFocusTrap.d.ts +7 -0
- package/lib/types/hooks/usePresence.d.ts +8 -0
- package/lib/types/hooks/usePressToOpen.d.ts +20 -0
- package/lib/types/hooks/useScrollLock.d.ts +2 -0
- package/lib/types/hooks/useSelection.d.ts +29 -0
- package/lib/types/index.d.ts +5 -0
- package/lib/types/primitives/AspectRatio.d.ts +14 -0
- package/lib/types/primitives/BrandIcon.d.ts +12 -0
- package/lib/types/primitives/ColorDot.d.ts +20 -0
- package/lib/types/primitives/CopyButton.d.ts +12 -0
- package/lib/types/primitives/CountBadge.d.ts +28 -0
- package/lib/types/primitives/Countdown.d.ts +21 -0
- package/lib/types/primitives/Delta.d.ts +33 -0
- package/lib/types/primitives/Elapsed.d.ts +23 -0
- package/lib/types/primitives/FileIcon.d.ts +17 -0
- package/lib/types/primitives/Flag.d.ts +15 -0
- package/lib/types/primitives/IconStack.d.ts +27 -0
- package/lib/types/primitives/IconTile.d.ts +24 -0
- package/lib/types/primitives/Kbd.d.ts +19 -0
- package/lib/types/primitives/Layout.d.ts +64 -0
- package/lib/types/primitives/Link.d.ts +12 -0
- package/lib/types/primitives/MaskedText.d.ts +28 -0
- package/lib/types/primitives/Progress.d.ts +52 -0
- package/lib/types/primitives/RelativeTime.d.ts +22 -0
- package/lib/types/primitives/SearchInput.d.ts +8 -0
- package/lib/types/primitives/SelectorButton.d.ts +23 -0
- package/lib/types/primitives/Spinner.d.ts +15 -0
- package/lib/types/primitives/StatusIcon.d.ts +40 -0
- package/lib/types/primitives/Swatch.d.ts +11 -0
- package/lib/types/primitives/Tooltip.d.ts +17 -0
- package/lib/types/primitives/Typography.d.ts +48 -0
- package/lib/types/primitives/formatCountdown.d.ts +2 -0
- package/lib/types/primitives/formatElapsed.d.ts +8 -0
- package/lib/types/primitives/formatRelativeTime.d.ts +16 -0
- package/lib/types/primitives/hotkey.d.ts +10 -0
- package/lib/types/primitives/index.d.ts +188 -0
- package/lib/types/primitives/maskValue.d.ts +24 -0
- package/package.json +55 -4
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# ChatComposer
|
|
2
|
+
|
|
3
|
+
> 텍스트 입력 · `@iamfiro/design` · 직접 만들지 말고 이 컴포넌트를 쓴다.
|
|
4
|
+
|
|
5
|
+
대화형 AI 화면의 메시지 입력창. 글이 길어지면 maxRows까지 자라고, Enter로 보내고 Shift+Enter로 줄을 바꿔요(한글 조합 중 Enter는 무시). 왼쪽 tools · 오른쪽 actions · 아래 footer 자리에 FilterChip · DropdownMenu · Button 같은 기존 컴포넌트를 그대로 끼워 써요.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { ChatComposer } from '@iamfiro/design'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## API
|
|
12
|
+
|
|
13
|
+
### ChatComposer
|
|
14
|
+
|
|
15
|
+
| prop | 타입 | 기본값 | 설명 |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `value / defaultValue` | `string` | | 입력 글. 제어/비제어 모두 돼요. |
|
|
18
|
+
| `onValueChange` | `(value: string) => void` | | 글이 바뀔 때. |
|
|
19
|
+
| `onSubmit` | `(value: string) => void` | | Enter나 보내기 버튼. 부른 뒤 글을 비워요. 공백만 있으면 보내지 않아요. |
|
|
20
|
+
| `placeholder` | `string` | `'무엇이든 물어보세요'` | 빈 칸 안내 문구. |
|
|
21
|
+
| `pending` | `boolean` | | 응답 생성 중. 보내기 → 중지 버튼, Esc로도 중지. |
|
|
22
|
+
| `onStop` | `() => void` | | 중지 버튼이나 Esc. |
|
|
23
|
+
| `onAttach` | `() => void` | | 주면 왼쪽에 + 버튼이 생겨요. |
|
|
24
|
+
| `attachLabel` | `string` | `'파일 첨부'` | + 버튼의 aria-label. |
|
|
25
|
+
| `tools` | `ReactNode` | | 도구 막대 왼쪽(+ 다음). 모드 칩 등. |
|
|
26
|
+
| `actions` | `ReactNode` | | 도구 막대 오른쪽(보내기 앞). 모델 선택, 음성 등. |
|
|
27
|
+
| `attachments` | `ReactNode` | | 글 위. 첨부 파일, 인용한 메시지. |
|
|
28
|
+
| `footer` | `ReactNode` | | 옅은 선 아래 띠. 앱 연결, 안내 문구. |
|
|
29
|
+
| `maxRows` | `number` | `8 (sm: 4)` | 이 줄 수까지 자라고 그 뒤로는 스크롤. |
|
|
30
|
+
| `size` | `'sm' \| 'md'` | `'md'` | md: 글 아래 도구 막대 · sm: 글 · actions · 보내기가 한 줄에 놓이는 작은 입력창(답글 · 댓글). |
|
|
31
|
+
| `disabled` | `boolean` | | 입력 · 첨부 · 보내기를 막아요. tools · actions 안 버튼은 직접 disabled를 주세요. |
|
|
32
|
+
| `autoFocus · name · aria-label` | `—` | | 안쪽 textarea에 전달돼요. aria-label 기본값은 "메시지". |
|
|
33
|
+
|
|
34
|
+
## 예제
|
|
35
|
+
|
|
36
|
+
예제를 감싼 `style={{ ... }}` div는 미리보기 배치용이다. 실제 화면 배치는 `Stack` · `Inline` · `Grid`로 한다.
|
|
37
|
+
|
|
38
|
+
### 기본
|
|
39
|
+
|
|
40
|
+
첨부(+) · 승인 요청 칩 · 모델 선택 · 음성 · 보내기, 아래에 앱 연결 줄. 빈 곳 어디를 눌러도 글 입력으로 포커스가 가요.
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { useState } from 'react'
|
|
44
|
+
import { ChevronDown, Hand, Mic } from 'lucide-react'
|
|
45
|
+
import { BrandIcon, Button, Inline, Tooltip, ChatComposer, DropdownMenu, DropdownMenuRadioGroup, DropdownMenuRadioItem, FilterChip, toast } from '@iamfiro/design'
|
|
46
|
+
|
|
47
|
+
const MODELS = [
|
|
48
|
+
{ value: 'auto', label: '자동', description: '질문에 맞춰 모델을 골라요' },
|
|
49
|
+
{ value: 'fast', label: '빠르게', description: '짧은 답을 바로' },
|
|
50
|
+
{ value: 'deep', label: '깊게 생각', description: '복잡한 문제를 단계별로' },
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
export default function Example() {
|
|
54
|
+
const [approval, setApproval] = useState(false)
|
|
55
|
+
const [model, setModel] = useState('auto')
|
|
56
|
+
const current = MODELS.find((m) => m.value === model)?.label
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div style={{ width: '100%', maxWidth: 680 }}>
|
|
60
|
+
<ChatComposer
|
|
61
|
+
placeholder="입력해서 시작하세요..."
|
|
62
|
+
onAttach={() => toast('파일 선택 창을 열어요')}
|
|
63
|
+
onSubmit={(text) => toast.success('보냈어요', { description: text })}
|
|
64
|
+
tools={
|
|
65
|
+
<FilterChip icon={<Hand />} selected={approval} onSelectedChange={setApproval}>
|
|
66
|
+
승인 요청
|
|
67
|
+
</FilterChip>
|
|
68
|
+
}
|
|
69
|
+
actions={
|
|
70
|
+
<>
|
|
71
|
+
<DropdownMenu
|
|
72
|
+
aria-label="모델"
|
|
73
|
+
align="end"
|
|
74
|
+
trigger={
|
|
75
|
+
<Button variant="ghost" iconRight={<ChevronDown />}>
|
|
76
|
+
{current}
|
|
77
|
+
</Button>
|
|
78
|
+
}
|
|
79
|
+
>
|
|
80
|
+
<DropdownMenuRadioGroup label="모델" value={model} onValueChange={setModel}>
|
|
81
|
+
{MODELS.map((m) => (
|
|
82
|
+
<DropdownMenuRadioItem key={m.value} value={m.value} description={m.description}>
|
|
83
|
+
{m.label}
|
|
84
|
+
</DropdownMenuRadioItem>
|
|
85
|
+
))}
|
|
86
|
+
</DropdownMenuRadioGroup>
|
|
87
|
+
</DropdownMenu>
|
|
88
|
+
<Tooltip content="음성 입력">
|
|
89
|
+
<Button variant="ghost" iconOnly icon={<Mic />} aria-label="음성 입력" />
|
|
90
|
+
</Tooltip>
|
|
91
|
+
</>
|
|
92
|
+
}
|
|
93
|
+
footer={
|
|
94
|
+
<Button
|
|
95
|
+
variant="ghost"
|
|
96
|
+
size="sm"
|
|
97
|
+
icon={
|
|
98
|
+
<Inline gap={1} wrap={false}>
|
|
99
|
+
<BrandIcon name="gmail" size={16} />
|
|
100
|
+
<BrandIcon name="slack" size={16} />
|
|
101
|
+
<BrandIcon name="clickup" size={16} />
|
|
102
|
+
</Inline>
|
|
103
|
+
}
|
|
104
|
+
onClick={() => toast('연결할 앱을 골라요')}
|
|
105
|
+
>
|
|
106
|
+
앱 연결
|
|
107
|
+
</Button>
|
|
108
|
+
}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 응답 생성 중
|
|
116
|
+
|
|
117
|
+
pending이면 보내기 버튼이 중지로 바뀌어요. 중지 버튼이나 Esc로 onStop이 불려요. 그동안에도 다음 메시지를 미리 쓸 수 있어요.
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
import { useEffect, useRef, useState } from 'react'
|
|
121
|
+
import { Stack, Text, ChatComposer } from '@iamfiro/design'
|
|
122
|
+
|
|
123
|
+
export default function Example() {
|
|
124
|
+
const [pending, setPending] = useState(false)
|
|
125
|
+
const [status, setStatus] = useState('메시지를 보내 보세요.')
|
|
126
|
+
const timer = useRef(0)
|
|
127
|
+
|
|
128
|
+
useEffect(() => () => window.clearTimeout(timer.current), [])
|
|
129
|
+
|
|
130
|
+
const send = (text: string) => {
|
|
131
|
+
setPending(true)
|
|
132
|
+
setStatus(`"${text}"에 답하는 중…`)
|
|
133
|
+
timer.current = window.setTimeout(() => {
|
|
134
|
+
setPending(false)
|
|
135
|
+
setStatus('답변을 마쳤어요.')
|
|
136
|
+
}, 4000)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const stop = () => {
|
|
140
|
+
window.clearTimeout(timer.current)
|
|
141
|
+
setPending(false)
|
|
142
|
+
setStatus('응답을 중지했어요.')
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<Stack gap={3} style={{ width: '100%', maxWidth: 560 }}>
|
|
147
|
+
<ChatComposer placeholder="질문을 입력하세요" pending={pending} onSubmit={send} onStop={stop} onAttach={() => {}} />
|
|
148
|
+
<Text variant="body-sm" tone="secondary">
|
|
149
|
+
{status}
|
|
150
|
+
</Text>
|
|
151
|
+
</Stack>
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### 첨부 파일
|
|
157
|
+
|
|
158
|
+
attachments 자리는 글 위에 놓여요. 제거 가능한 FilterChip으로 첨부 목록을 보여 줘요.
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
import { useState } from 'react'
|
|
162
|
+
import { FileIcon, Inline, ChatComposer, FilterChip, toast } from '@iamfiro/design'
|
|
163
|
+
|
|
164
|
+
const SAMPLE = ['3분기 매출 보고서.pdf', '고객 인터뷰 정리.docx', '대시보드 시안.png']
|
|
165
|
+
|
|
166
|
+
export default function Example() {
|
|
167
|
+
const [files, setFiles] = useState(SAMPLE.slice(0, 2))
|
|
168
|
+
|
|
169
|
+
const attach = () => {
|
|
170
|
+
const next = SAMPLE.find((f) => !files.includes(f))
|
|
171
|
+
if (next) setFiles([...files, next])
|
|
172
|
+
else toast('예시 파일을 모두 첨부했어요')
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return (
|
|
176
|
+
<div style={{ width: '100%', maxWidth: 560 }}>
|
|
177
|
+
<ChatComposer
|
|
178
|
+
placeholder="첨부한 파일에 대해 물어보세요"
|
|
179
|
+
defaultValue="두 문서를 비교해서 핵심만 요약해 줘"
|
|
180
|
+
onAttach={attach}
|
|
181
|
+
onSubmit={() => {
|
|
182
|
+
toast.success(`파일 ${files.length}개와 함께 보냈어요`)
|
|
183
|
+
setFiles([])
|
|
184
|
+
}}
|
|
185
|
+
attachments={
|
|
186
|
+
files.length > 0 && (
|
|
187
|
+
<Inline gap={2}>
|
|
188
|
+
{files.map((f) => (
|
|
189
|
+
<FilterChip key={f} size="sm" icon={<FileIcon name={f} size={16} />} onRemove={() => setFiles(files.filter((x) => x !== f))} removeLabel={`${f} 제거`}>
|
|
190
|
+
{f}
|
|
191
|
+
</FilterChip>
|
|
192
|
+
))}
|
|
193
|
+
</Inline>
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
/>
|
|
197
|
+
</div>
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 상태
|
|
203
|
+
|
|
204
|
+
disabled면 회색 배경에 금지 커서. 최소 구성(footer · tools 없이)도 그대로 정렬이 맞아요.
|
|
205
|
+
|
|
206
|
+
```tsx
|
|
207
|
+
import { Stack, ChatComposer } from '@iamfiro/design'
|
|
208
|
+
|
|
209
|
+
export default function Example() {
|
|
210
|
+
return (
|
|
211
|
+
<Stack gap={4} style={{ width: '100%', maxWidth: 560 }}>
|
|
212
|
+
<ChatComposer placeholder="최소 구성 — 글과 보내기만" />
|
|
213
|
+
<ChatComposer placeholder="사용량을 모두 썼어요. 내일 오전 9시에 다시 쓸 수 있어요." disabled onAttach={() => {}} />
|
|
214
|
+
</Stack>
|
|
215
|
+
)
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### 한 줄 답글 (size="sm")
|
|
220
|
+
|
|
221
|
+
댓글 · 답글용 작은 입력창. 글 · actions · 작은 보내기 버튼이 한 줄에 놓이고, 글이 길어지면 maxRows(기본 4)까지 자라는 동안 버튼은 마지막 줄에 머물러요. placeholder로 "@로 멤버를 불러 보세요" 같은 안내만 바꾸면 돼요.
|
|
222
|
+
|
|
223
|
+
```tsx
|
|
224
|
+
import { useState } from 'react'
|
|
225
|
+
import { AtSign } from 'lucide-react'
|
|
226
|
+
import { Button, Stack, Text, ChatComposer } from '@iamfiro/design'
|
|
227
|
+
|
|
228
|
+
export default function Example() {
|
|
229
|
+
const [sent, setSent] = useState<string[]>([])
|
|
230
|
+
return (
|
|
231
|
+
<Stack gap={5} style={{ width: 380 }}>
|
|
232
|
+
<Stack gap={2}>
|
|
233
|
+
{sent.map((s, i) => (
|
|
234
|
+
<Text key={i} variant="body-sm" tone="secondary">
|
|
235
|
+
보냄: {s}
|
|
236
|
+
</Text>
|
|
237
|
+
))}
|
|
238
|
+
<ChatComposer size="sm" placeholder="답글을 쓰거나 @로 멤버를 불러 보세요" aria-label="답글" onSubmit={(v) => setSent((p) => [...p, v])} />
|
|
239
|
+
</Stack>
|
|
240
|
+
<ChatComposer
|
|
241
|
+
size="sm"
|
|
242
|
+
placeholder="댓글 남기기"
|
|
243
|
+
aria-label="댓글"
|
|
244
|
+
onAttach={() => {}}
|
|
245
|
+
actions={<Button variant="ghost" size="sm" iconOnly icon={<AtSign />} aria-label="멤버 언급" />}
|
|
246
|
+
/>
|
|
247
|
+
<ChatComposer size="sm" placeholder="보관된 문서에는 댓글을 달 수 없어요" disabled />
|
|
248
|
+
</Stack>
|
|
249
|
+
)
|
|
250
|
+
}
|
|
251
|
+
```
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Checkbox · Radio · Switch
|
|
2
|
+
|
|
3
|
+
> 선택 컨트롤 · `@iamfiro/design` · 직접 만들지 말고 이 컴포넌트를 쓴다.
|
|
4
|
+
|
|
5
|
+
켜고 끄는 선택 요소 세 가지. 여러 개를 고를 땐 Checkbox, 하나만 고를 땐 Radio, 바로 적용되는 설정에는 Switch를 써요. 모두 <label>로 감싸져 있어 글자를 눌러도 바뀌고, Space로 토글돼요.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Checkbox, Radio, Switch } from '@iamfiro/design'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## API
|
|
12
|
+
|
|
13
|
+
### Checkbox · Radio · Switch
|
|
14
|
+
|
|
15
|
+
셋 모두 같은 props를 받아요. label 외의 props는 안쪽 <input>에 전달돼요(type은 정해져 있어요).
|
|
16
|
+
|
|
17
|
+
| prop | 타입 | 기본값 | 설명 |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| `label` | `ReactNode` | | 옆에 보일 글자. 눌러도 토글돼요. |
|
|
20
|
+
| `checked` | `boolean` | | 선택 상태(제어). |
|
|
21
|
+
| `defaultChecked` | `boolean` | | 처음 선택 상태(비제어). |
|
|
22
|
+
| `onChange` | `(e: ChangeEvent<HTMLInputElement>) => void` | | 바뀔 때. e.target.checked로 새 값을 읽어요. |
|
|
23
|
+
| `disabled` | `boolean` | | 비활성. |
|
|
24
|
+
| `name / value` | `string` | | 폼 제출용. Radio는 같은 name끼리 한 그룹이 돼요. |
|
|
25
|
+
| `className` | `string` | | 바깥 <label>에 붙일 클래스. |
|
|
26
|
+
|
|
27
|
+
## 예제
|
|
28
|
+
|
|
29
|
+
예제를 감싼 `style={{ ... }}` div는 미리보기 배치용이다. 실제 화면 배치는 `Stack` · `Inline` · `Grid`로 한다.
|
|
30
|
+
|
|
31
|
+
### Checkbox
|
|
32
|
+
|
|
33
|
+
checked / onChange로 제어하거나 defaultChecked로 비제어 사용. disabled는 흐리게 보이고 누를 수 없어요.
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { useState } from 'react'
|
|
37
|
+
import { Checkbox } from '@iamfiro/design'
|
|
38
|
+
|
|
39
|
+
const NOTICES = [
|
|
40
|
+
{ id: 'comment', label: '내 글에 댓글이 달렸을 때' },
|
|
41
|
+
{ id: 'mention', label: '누군가 나를 언급했을 때' },
|
|
42
|
+
{ id: 'deploy', label: '배포가 끝났을 때' },
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
export default function Example() {
|
|
46
|
+
const [checked, setChecked] = useState<string[]>(['mention'])
|
|
47
|
+
|
|
48
|
+
const toggle = (id: string) => setChecked((prev) => (prev.includes(id) ? prev.filter((v) => v !== id) : [...prev, id]))
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div style={{ display: 'grid', gap: 12 }}>
|
|
52
|
+
{NOTICES.map((n) => (
|
|
53
|
+
<Checkbox key={n.id} label={n.label} checked={checked.includes(n.id)} onChange={() => toggle(n.id)} />
|
|
54
|
+
))}
|
|
55
|
+
<Checkbox label="보안 알림 (끌 수 없어요)" checked disabled readOnly />
|
|
56
|
+
</div>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Radio
|
|
62
|
+
|
|
63
|
+
같은 name으로 묶으면 화살표 키로 옮겨 다닐 수 있어요. 바깥에 role="radiogroup"과 aria-label을 주세요.
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import { useState } from 'react'
|
|
67
|
+
import { Radio } from '@iamfiro/design'
|
|
68
|
+
|
|
69
|
+
const CYCLES = [
|
|
70
|
+
{ value: 'monthly', label: '월간 결제 · 월 12,000원' },
|
|
71
|
+
{ value: 'yearly', label: '연간 결제 · 월 9,600원 (20% 할인)' },
|
|
72
|
+
{ value: 'lifetime', label: '평생 이용권 · 준비 중' },
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
export default function Example() {
|
|
76
|
+
const [cycle, setCycle] = useState('monthly')
|
|
77
|
+
return (
|
|
78
|
+
<div role="radiogroup" aria-label="결제 주기" style={{ display: 'grid', gap: 12 }}>
|
|
79
|
+
{CYCLES.map((c) => (
|
|
80
|
+
<Radio
|
|
81
|
+
key={c.value}
|
|
82
|
+
name="billing-cycle"
|
|
83
|
+
value={c.value}
|
|
84
|
+
label={c.label}
|
|
85
|
+
checked={cycle === c.value}
|
|
86
|
+
onChange={() => setCycle(c.value)}
|
|
87
|
+
disabled={c.value === 'lifetime'}
|
|
88
|
+
/>
|
|
89
|
+
))}
|
|
90
|
+
</div>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Switch
|
|
96
|
+
|
|
97
|
+
저장 버튼 없이 바로 적용되는 설정에 써요. role="switch"가 붙어 있어요.
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
import { useState } from 'react'
|
|
101
|
+
import { Switch } from '@iamfiro/design'
|
|
102
|
+
|
|
103
|
+
export default function Example() {
|
|
104
|
+
const [autoSave, setAutoSave] = useState(true)
|
|
105
|
+
return (
|
|
106
|
+
<div style={{ display: 'grid', gap: 14 }}>
|
|
107
|
+
<Switch label="자동 저장" checked={autoSave} onChange={(e) => setAutoSave(e.target.checked)} />
|
|
108
|
+
<Switch label="이메일로 주간 리포트 받기" defaultChecked />
|
|
109
|
+
<Switch label="다크 모드 (준비 중)" disabled />
|
|
110
|
+
</div>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
```
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# CodeBlock
|
|
2
|
+
|
|
3
|
+
> 텍스트 & 코드 · `@iamfiro/design` · 직접 만들지 말고 이 컴포넌트를 쓴다.
|
|
4
|
+
|
|
5
|
+
읽기 전용 코드 블록. TSX · CSS · 셸 스니펫에 가벼운 문법 색을 입히고 복사 버튼을 달아요. 설치 명령처럼 한 줄짜리는 command로, 긴 코드는 maxHeight로 접어 둘 수 있어요.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { CodeBlock, type CodeLanguage } from '@iamfiro/design'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## API
|
|
12
|
+
|
|
13
|
+
### CodeBlock
|
|
14
|
+
|
|
15
|
+
| prop | 타입 | 기본값 | 설명 |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `code` (필수) | `string` | | 보여 줄 코드. 끝의 빈 줄은 잘라요. |
|
|
18
|
+
| `language` | `'tsx' \| 'css' \| 'bash' \| 'text'` | `'tsx'` | 문법 색 규칙. text는 색 없이 보여요. |
|
|
19
|
+
| `title` | `ReactNode` | | 머리 줄 제목(파일 이름, 탭 이름). |
|
|
20
|
+
| `command` | `boolean` | | $ 프롬프트가 붙은 한 줄 명령 스타일. bash 규칙으로 색을 입혀요. |
|
|
21
|
+
| `showLineNumbers` | `boolean` | | 왼쪽에 줄 번호. |
|
|
22
|
+
| `maxHeight` | `number` | | 이 높이(px)를 넘으면 접고 "코드 더 보기" 버튼을 보여 줘요. |
|
|
23
|
+
| `copyable` | `boolean` | `true` | 복사 버튼 표시. |
|
|
24
|
+
| `className` | `string` | | 루트에 붙일 클래스. |
|
|
25
|
+
|
|
26
|
+
## 예제
|
|
27
|
+
|
|
28
|
+
예제를 감싼 `style={{ ... }}` div는 미리보기 배치용이다. 실제 화면 배치는 `Stack` · `Inline` · `Grid`로 한다.
|
|
29
|
+
|
|
30
|
+
### 기본
|
|
31
|
+
|
|
32
|
+
code만 넘기면 tsx로 색을 입혀요. title은 머리 줄에 파일 이름처럼 보여요.
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { CodeBlock, Button } from '@iamfiro/design'
|
|
36
|
+
|
|
37
|
+
const CODE = `
|
|
38
|
+
export function SaveButton({ saving }: { saving: boolean }) {
|
|
39
|
+
return (
|
|
40
|
+
<Button variant="primary" loading={saving}>
|
|
41
|
+
저장
|
|
42
|
+
</Button>
|
|
43
|
+
)
|
|
44
|
+
}`
|
|
45
|
+
|
|
46
|
+
export default function Example() {
|
|
47
|
+
return (
|
|
48
|
+
<div style={{ width: '100%', maxWidth: 560 }}>
|
|
49
|
+
<CodeBlock title="SaveButton.tsx" code={CODE} />
|
|
50
|
+
</div>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 언어
|
|
56
|
+
|
|
57
|
+
language로 'css', 'bash', 'text'를 고를 수 있어요.
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { CodeBlock } from '@iamfiro/design'
|
|
61
|
+
|
|
62
|
+
const CSS = `/* 값은 토큰으로 맞춰요 */
|
|
63
|
+
.billing-card {
|
|
64
|
+
padding: 20px;
|
|
65
|
+
border-radius: var(--r-lg);
|
|
66
|
+
background: #ffffff;
|
|
67
|
+
color: var(--text);
|
|
68
|
+
}`
|
|
69
|
+
|
|
70
|
+
const BASH = `# 의존성을 설치하고 개발 서버를 띄워요
|
|
71
|
+
npm install
|
|
72
|
+
npm run dev -- --port 5173`
|
|
73
|
+
|
|
74
|
+
export default function Example() {
|
|
75
|
+
return (
|
|
76
|
+
<div style={{ display: 'grid', gap: 16, width: '100%', maxWidth: 560 }}>
|
|
77
|
+
<CodeBlock title="billing.css" language="css" code={CSS} />
|
|
78
|
+
<CodeBlock title="터미널" language="bash" code={BASH} />
|
|
79
|
+
</div>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 명령어
|
|
85
|
+
|
|
86
|
+
command는 $ 프롬프트가 붙은 한 줄 스타일이에요. 복사할 때 $는 빠져요.
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
import { CodeBlock } from '@iamfiro/design'
|
|
90
|
+
|
|
91
|
+
export default function Example() {
|
|
92
|
+
return (
|
|
93
|
+
<div style={{ display: 'grid', gap: 12, width: '100%', maxWidth: 420 }}>
|
|
94
|
+
<CodeBlock command code="npm install @lumen/ui" />
|
|
95
|
+
<CodeBlock command code="npx lumen init --template dashboard" />
|
|
96
|
+
</div>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 줄 번호 · 접기
|
|
102
|
+
|
|
103
|
+
showLineNumbers로 줄 번호를 보여 주고, 코드가 maxHeight보다 길면 접힌 채로 시작해 "코드 더 보기"로 펼쳐요.
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
import { CodeBlock, Button, Field, Input, toast } from '@iamfiro/design'
|
|
107
|
+
|
|
108
|
+
const CODE = `import { useState } from 'react'
|
|
109
|
+
|
|
110
|
+
export function InviteForm() {
|
|
111
|
+
const [email, setEmail] = useState('')
|
|
112
|
+
const [sending, setSending] = useState(false)
|
|
113
|
+
|
|
114
|
+
const invite = async () => {
|
|
115
|
+
setSending(true)
|
|
116
|
+
try {
|
|
117
|
+
await sendInvite(email)
|
|
118
|
+
toast.success('초대를 보냈어요', { description: email })
|
|
119
|
+
setEmail('')
|
|
120
|
+
} catch {
|
|
121
|
+
toast.error('초대를 보내지 못했어요')
|
|
122
|
+
} finally {
|
|
123
|
+
setSending(false)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<Field label="이메일" htmlFor="invite-email">
|
|
129
|
+
<Input id="invite-email" value={email} onChange={(e) => setEmail(e.target.value)} />
|
|
130
|
+
<Button variant="primary" loading={sending} onClick={invite}>
|
|
131
|
+
초대하기
|
|
132
|
+
</Button>
|
|
133
|
+
</Field>
|
|
134
|
+
)
|
|
135
|
+
}`
|
|
136
|
+
|
|
137
|
+
export default function Example() {
|
|
138
|
+
return (
|
|
139
|
+
<div style={{ width: '100%', maxWidth: 560 }}>
|
|
140
|
+
<CodeBlock title="InviteForm.tsx" code={CODE} showLineNumbers maxHeight={220} />
|
|
141
|
+
</div>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
```
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# ColorDot
|
|
2
|
+
|
|
3
|
+
> 라벨 & 배지 · `@iamfiro/design` · 직접 만들지 말고 이 컴포넌트를 쓴다.
|
|
4
|
+
|
|
5
|
+
라벨과 시리즈·분류 색을 이어 주는 작은 색 표시. 차트 범례와 툴팁 행에서 써요. 텍스트 옆에 놓여도 찌그러지지 않아요(flex: none).
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { ColorDot } from '@iamfiro/design'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 디자인 규칙
|
|
12
|
+
|
|
13
|
+
- 차트: 시리즈 색은 `--chart-1…6`을 순서대로, 그리드는 `--chart-grid`로 아주 옅게(세로선·축선 없음). 범례·툴팁의 색 표시는 `ColorDot`, 툴팁은 `Card raised` + `Separator`로 조립. 축·툴팁·범례·호버/키보드는 `components/Chart/`의 공용 조각(`ChartTooltip`, `ChartLegend`, `useChartInteraction`)을 쓴다. → `LineChart` · `BarChart` · `PieChart` · `Sparkbar`
|
|
14
|
+
- 시간 축(계획 대비 실제, 워터폴, 하루 일정)은 `Timeline` + `TimelineRow` + `TimelineBar`로. 계획 = 점선 틀(`outline`), 실제 = 옅은 색 막대(`fill`), 계획 초과 = 주황(`limit`), 아직 = `faded` 행. 지금은 파란 `now` 선, 목표·예상은 `markers`(점선/실선 + 아래 Badge 칩 + 옅은 `band`). 진행 중 막대는 `running`(앞 가장자리 + shimmer). 범례 색 표시는 같은 옅기의 `ColorDot variant="soft" | "dashed" | "hatched"`.
|
|
15
|
+
|
|
16
|
+
## API
|
|
17
|
+
|
|
18
|
+
### ColorDot
|
|
19
|
+
|
|
20
|
+
| prop | 타입 | 기본값 | 설명 |
|
|
21
|
+
| --- | --- | --- | --- |
|
|
22
|
+
| `color` (필수) | `string` | | CSS 변수 이름('--chart-1') 또는 아무 CSS 색. |
|
|
23
|
+
| `shape` | `'square' \| 'circle' \| 'line'` | `'square'` | 모양. |
|
|
24
|
+
| `variant` | `'solid' \| 'soft' \| 'dashed' \| 'hatched'` | `'solid'` | 채움 방식. soft는 옅은 색(24%), dashed는 점선 틀, hatched는 빗금. |
|
|
25
|
+
| `size` | `number` | `10` | 한 변 길이(px). |
|
|
26
|
+
|
|
27
|
+
## 예제
|
|
28
|
+
|
|
29
|
+
예제를 감싼 `style={{ ... }}` div는 미리보기 배치용이다. 실제 화면 배치는 `Stack` · `Inline` · `Grid`로 한다.
|
|
30
|
+
|
|
31
|
+
### 모양
|
|
32
|
+
|
|
33
|
+
square는 범례·툴팁, circle은 상태, line은 선 차트 범례에 어울려요.
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { ColorDot, Inline, Text } from '@iamfiro/design'
|
|
37
|
+
|
|
38
|
+
export default function Example() {
|
|
39
|
+
return (
|
|
40
|
+
<Inline gap={6}>
|
|
41
|
+
{(['square', 'circle', 'line'] as const).map((shape) => (
|
|
42
|
+
<Inline key={shape} gap={2}>
|
|
43
|
+
<ColorDot color="--chart-2" shape={shape} />
|
|
44
|
+
<Text variant="body-sm" tone="secondary">
|
|
45
|
+
{shape}
|
|
46
|
+
</Text>
|
|
47
|
+
</Inline>
|
|
48
|
+
))}
|
|
49
|
+
</Inline>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 범례
|
|
55
|
+
|
|
56
|
+
Inline + ColorDot + Text로 범례 한 줄을 만들어요.
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { ColorDot, Inline, Text } from '@iamfiro/design'
|
|
60
|
+
|
|
61
|
+
const SERIES = [
|
|
62
|
+
{ label: '유료 광고', color: '--chart-1' },
|
|
63
|
+
{ label: '검색 유입', color: '--chart-2' },
|
|
64
|
+
{ label: '이메일', color: '--chart-3' },
|
|
65
|
+
{ label: '추천', color: '--chart-4' },
|
|
66
|
+
{ label: '직접 방문', color: '--chart-5' },
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
export default function Example() {
|
|
70
|
+
return (
|
|
71
|
+
<Inline gap={4}>
|
|
72
|
+
{SERIES.map((s) => (
|
|
73
|
+
<Inline key={s.label} gap={2}>
|
|
74
|
+
<ColorDot color={s.color} />
|
|
75
|
+
<Text variant="body-sm" tone="secondary">
|
|
76
|
+
{s.label}
|
|
77
|
+
</Text>
|
|
78
|
+
</Inline>
|
|
79
|
+
))}
|
|
80
|
+
</Inline>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 변형 (variant)
|
|
86
|
+
|
|
87
|
+
solid는 색 그대로, soft는 TimelineBar 같은 옅은 막대와 같은 색, dashed는 점선 틀(계획·목표), hatched는 빗금(예상·무제한). "계획 / 실제 / 초과" 범례에 써요.
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import { ColorDot, Inline, Text, type ColorDotVariant } from '@iamfiro/design'
|
|
91
|
+
|
|
92
|
+
const ITEMS: Array<{ variant: ColorDotVariant; color: string; label: string }> = [
|
|
93
|
+
{ variant: 'dashed', color: '--n8', label: '계획' },
|
|
94
|
+
{ variant: 'soft', color: '--chart-4', label: '실제' },
|
|
95
|
+
{ variant: 'soft', color: '--chart-6', label: '초과' },
|
|
96
|
+
{ variant: 'hatched', color: '--chart-2', label: '예상' },
|
|
97
|
+
{ variant: 'solid', color: '--chart-2', label: '확정' },
|
|
98
|
+
]
|
|
99
|
+
|
|
100
|
+
export default function Example() {
|
|
101
|
+
return (
|
|
102
|
+
<Inline gap={4}>
|
|
103
|
+
{ITEMS.map((it) => (
|
|
104
|
+
<Inline key={it.label} gap={2} wrap={false}>
|
|
105
|
+
<ColorDot color={it.color} variant={it.variant} size={12} />
|
|
106
|
+
<Text variant="body-sm" tone="secondary">
|
|
107
|
+
{it.label}
|
|
108
|
+
</Text>
|
|
109
|
+
</Inline>
|
|
110
|
+
))}
|
|
111
|
+
<Inline gap={2} wrap={false}>
|
|
112
|
+
<ColorDot color="--n8" shape="line" variant="dashed" size={12} />
|
|
113
|
+
<Text variant="body-sm" tone="secondary">
|
|
114
|
+
목표선
|
|
115
|
+
</Text>
|
|
116
|
+
</Inline>
|
|
117
|
+
</Inline>
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
```
|