@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,257 @@
|
|
|
1
|
+
# SparkChart
|
|
2
|
+
|
|
3
|
+
> 차트 · `@iamfiro/design` · 직접 만들지 말고 이 컴포넌트를 쓴다.
|
|
4
|
+
|
|
5
|
+
축 없이 흐름만 보여 주는 아주 작은 차트. 표의 칸이나 KPI 카드에 넣어요. SparkLine(선) · SparkArea(선 + 옅은 그라데이션) · Sparkbar(막대)가 같은 props를 쓰고, SparkChart type으로 하나를 골라요. 24–40px 높이에서도 또렷하게 실제 픽셀 크기로 그리며, 마우스·터치·←/→로 십자선 점과 값 카드를 띄워요. tone="trend"는 처음 값 대비 마지막 값의 방향으로 색을 정해요(Delta처럼 higherIs로 좋고 나쁨).
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { SparkArea, SparkChart, SparkLine } from '@iamfiro/design'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 디자인 규칙
|
|
12
|
+
|
|
13
|
+
- 표 칸 · KPI 카드의 작은 추이는 `SparkLine` · `SparkArea` · `Sparkbar`(같은 props, 하나로 고르면 `SparkChart type`). 축 없음, 실제 픽셀 크기로 그려 24–40px에서도 또렷하게, 값 범위는 0이 아니라 최솟값–최댓값. 색은 `tone="trend"` + `higherIs`(Delta와 같은 규칙), 마지막 값은 `endDot`. 긴 표에선 `tooltip={false}`로 이벤트 없는 정적 그림(`role="img"`). KPI 카드는 Card 안 `Stat` + `Delta` + `SparkArea`.
|
|
14
|
+
|
|
15
|
+
## API
|
|
16
|
+
|
|
17
|
+
### SparkLine · SparkArea
|
|
18
|
+
|
|
19
|
+
SparkArea는 SparkLine props + fill.
|
|
20
|
+
|
|
21
|
+
| prop | 타입 | 기본값 | 설명 |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
| `data` (필수) | `(number \| null)[]` | | 한 칸에 값 하나(오래된 것부터). null이면 선이 끊겨요. |
|
|
24
|
+
| `height` | `number` | `32` | 높이(px). 24–40을 권장해요. |
|
|
25
|
+
| `width` | `number \| string` | `'100%'` | 너비. 표 칸에선 숫자로 고정해요. |
|
|
26
|
+
| `curve` | `'linear' \| 'smooth'` | `'smooth'` | 직선 또는 튀어 오르지 않는 단조 곡선. |
|
|
27
|
+
| `tone` | `'accent' \| 'neutral' \| 'trend'` | `'accent'` | trend는 방향(마지막 값 − 처음 값)에 따라 초록 / 주황. |
|
|
28
|
+
| `higherIs` | `'better' \| 'worse' \| 'neutral'` | `'better'` | trend에서 오르는 게 좋은지. 시간 · 비용 · 오류는 worse. |
|
|
29
|
+
| `worseTone` | `'warning' \| 'danger'` | `'warning'` | 나빠졌을 때 색. |
|
|
30
|
+
| `color` | `string` | | 직접 정한 색(CSS 변수 '--chart-2' 또는 색). tone보다 우선. |
|
|
31
|
+
| `min / max` | `number` | | 값 범위. 기본은 데이터의 최솟값 · 최댓값(모양을 보여 주는 차트라 0부터가 아니에요). |
|
|
32
|
+
| `endDot` | `boolean` | | 마지막 값에 점. |
|
|
33
|
+
| `fill` | `'gradient' \| 'solid'` | `'gradient'` | SparkArea 채움. |
|
|
34
|
+
| `tooltip` | `boolean` | `true` | 십자선 점 + 값 카드. false면 이벤트 · 포커스 없는 정적 그림. |
|
|
35
|
+
| `formatLabel` | `(index) => string` | `'3일'` | 툴팁 제목. |
|
|
36
|
+
| `valueLabel` | `string` | `'값'` | 툴팁 행 이름. |
|
|
37
|
+
| `formatValue` | `(value) => string` | `'1,234'` | 툴팁 값 형식. |
|
|
38
|
+
| `activeIndex / defaultActiveIndex / onActiveIndexChange` | `number \| null` | | 고른 칸(제어/비제어). |
|
|
39
|
+
| `aria-label` | `string` | `'추이'` | 이름. 고른 값은 aria-live로 읽어요. |
|
|
40
|
+
|
|
41
|
+
### SparkChart
|
|
42
|
+
|
|
43
|
+
위 props 전부 + type. bar는 Sparkbar로 그려요(Sparkbar도 tone · higherIs · worseTone을 받아요).
|
|
44
|
+
|
|
45
|
+
| prop | 타입 | 기본값 | 설명 |
|
|
46
|
+
| --- | --- | --- | --- |
|
|
47
|
+
| `type` | `'line' \| 'area' \| 'bar'` | `'line'` | 그릴 모양. |
|
|
48
|
+
|
|
49
|
+
## 예제
|
|
50
|
+
|
|
51
|
+
예제를 감싼 `style={{ ... }}` div는 미리보기 배치용이다. 실제 화면 배치는 `Stack` · `Inline` · `Grid`로 한다.
|
|
52
|
+
|
|
53
|
+
### KPI 카드
|
|
54
|
+
|
|
55
|
+
Card 안에 Stat + Delta + SparkArea. 응답 시간처럼 낮을수록 좋은 지표는 higherIs="worse"로 내려가는 선이 초록이 돼요. endDot은 마지막 값에 점을 찍어요.
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { Delta, Grid, Stack, Card, CardBody, SparkArea, Stat } from '@iamfiro/design'
|
|
59
|
+
|
|
60
|
+
const DAYS = ['10월 12일', '10월 13일', '10월 14일', '10월 15일', '10월 16일', '10월 17일', '10월 18일', '10월 19일', '10월 20일', '10월 21일', '10월 22일', '10월 23일', '10월 24일', '10월 25일']
|
|
61
|
+
|
|
62
|
+
const KPIS = [
|
|
63
|
+
{
|
|
64
|
+
label: '매출',
|
|
65
|
+
value: '₩4,820만',
|
|
66
|
+
delta: 12.4,
|
|
67
|
+
higherIs: 'better' as const,
|
|
68
|
+
unit: '만 원',
|
|
69
|
+
data: [312, 298, 330, 341, 325, 352, 368, 344, 371, 389, 402, 396, 418, 432],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: '활성 사용자',
|
|
73
|
+
value: '18,240',
|
|
74
|
+
delta: -3.1,
|
|
75
|
+
higherIs: 'better' as const,
|
|
76
|
+
unit: '명',
|
|
77
|
+
data: [19400, 19120, 19310, 18980, 18760, 18900, 18640, 18520, 18710, 18450, 18390, 18300, 18260, 18240],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: '평균 응답 시간',
|
|
81
|
+
value: '182ms',
|
|
82
|
+
delta: -8.6,
|
|
83
|
+
higherIs: 'worse' as const,
|
|
84
|
+
unit: 'ms',
|
|
85
|
+
data: [214, 220, 205, 211, 198, 201, 195, 190, 193, 188, 186, 191, 184, 182],
|
|
86
|
+
},
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
export default function Example() {
|
|
90
|
+
return (
|
|
91
|
+
<Grid minItemWidth={200} gap={3} style={{ width: '100%' }}>
|
|
92
|
+
{KPIS.map((k) => (
|
|
93
|
+
<Card key={k.label}>
|
|
94
|
+
<CardBody>
|
|
95
|
+
<Stack gap={3}>
|
|
96
|
+
<Stat label={k.label} value={k.value} delta={<Delta value={k.delta} format={(n) => `${n}%`} higherIs={k.higherIs} size="sm" />} />
|
|
97
|
+
<SparkArea
|
|
98
|
+
data={k.data}
|
|
99
|
+
height={40}
|
|
100
|
+
tone="trend"
|
|
101
|
+
higherIs={k.higherIs}
|
|
102
|
+
endDot
|
|
103
|
+
formatLabel={(i) => DAYS[i]}
|
|
104
|
+
valueLabel={k.label}
|
|
105
|
+
formatValue={(v) => `${v.toLocaleString('ko-KR')}${k.unit}`}
|
|
106
|
+
aria-label={`${k.label} 최근 14일`}
|
|
107
|
+
/>
|
|
108
|
+
</Stack>
|
|
109
|
+
</CardBody>
|
|
110
|
+
</Card>
|
|
111
|
+
))}
|
|
112
|
+
</Grid>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 표 안의 추이
|
|
118
|
+
|
|
119
|
+
Table 칸에 width를 정한 SparkLine. null은 선이 끊긴 칸이에요. 칸 위에서 마우스를 움직이면 그날 값이 떠요.
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
import { Delta, Text, SparkLine, Table, type TableColumn } from '@iamfiro/design'
|
|
123
|
+
|
|
124
|
+
interface Page {
|
|
125
|
+
id: string
|
|
126
|
+
path: string
|
|
127
|
+
views: number
|
|
128
|
+
change: number
|
|
129
|
+
/** 최근 14일 조회수 */
|
|
130
|
+
trend: Array<number | null>
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const PAGES: Page[] = [
|
|
134
|
+
{ id: 'p1', path: '/요금제', views: 12840, change: 18.2, trend: [620, 640, 610, 700, 760, 720, 810, 840, 860, 900, 950, 930, 1010, 1080] },
|
|
135
|
+
{ id: 'p2', path: '/시작하기', views: 9310, change: 4.1, trend: [640, 660, 650, 630, 670, 690, 660, 680, 700, 690, 710, 700, 720, 730] },
|
|
136
|
+
{ id: 'p3', path: '/블로그/출시-노트', views: 6120, change: -22.5, trend: [880, 820, 760, 640, 600, 520, 480, 430, 410, 380, 350, 330, 310, 290] },
|
|
137
|
+
{ id: 'p4', path: '/고객-사례', views: 3470, change: 0, trend: [240, 260, 230, 250, 270, 240, 250, 260, 240, 250, 255, 245, 250, 248] },
|
|
138
|
+
{ id: 'p5', path: '/문의', views: 1980, change: 9.7, trend: [110, 120, null, null, 130, 135, 140, 128, 150, 145, 155, 160, 158, 170] },
|
|
139
|
+
]
|
|
140
|
+
|
|
141
|
+
const COLUMNS: TableColumn<Page>[] = [
|
|
142
|
+
{ key: 'path', header: '페이지', render: (p) => <Text variant="label-md">{p.path}</Text> },
|
|
143
|
+
{ key: 'views', header: '조회수', numeric: true, render: (p) => p.views.toLocaleString('ko-KR') },
|
|
144
|
+
{
|
|
145
|
+
key: 'trend',
|
|
146
|
+
header: '최근 14일',
|
|
147
|
+
width: 120,
|
|
148
|
+
render: (p) => (
|
|
149
|
+
<SparkLine
|
|
150
|
+
data={p.trend}
|
|
151
|
+
width={112}
|
|
152
|
+
height={28}
|
|
153
|
+
tone="trend"
|
|
154
|
+
formatLabel={(i) => `10월 ${12 + i}일`}
|
|
155
|
+
valueLabel="조회수"
|
|
156
|
+
formatValue={(v) => `${v.toLocaleString('ko-KR')}회`}
|
|
157
|
+
aria-label={`${p.path} 최근 14일 조회수`}
|
|
158
|
+
/>
|
|
159
|
+
),
|
|
160
|
+
},
|
|
161
|
+
{ key: 'change', header: '변화', align: 'end', render: (p) => <Delta value={p.change} format={(n) => `${n}%`} size="sm" /> },
|
|
162
|
+
]
|
|
163
|
+
|
|
164
|
+
export default function Example() {
|
|
165
|
+
return <Table caption="많이 본 페이지" columns={COLUMNS} rows={PAGES} rowKey={(p) => p.id} style={{ width: '100%', maxWidth: 640 }} />
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### 세 가지 type
|
|
170
|
+
|
|
171
|
+
SparkChart type="line" | "area" | "bar". 데이터를 바꾸면 선은 새 모양으로, 막대는 새 높이로 미끄러져요.
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
import { useState } from 'react'
|
|
175
|
+
import { Button, Grid, Inline, Stack, Text, SparkChart } from '@iamfiro/design'
|
|
176
|
+
|
|
177
|
+
const THIS_WEEK = [32, 41, 38, 52, 47, 61, 58, 66, 72, 69, 80, 84]
|
|
178
|
+
const LAST_WEEK = [28, 30, 35, 31, 40, 38, 44, 41, 39, 46, 43, 50]
|
|
179
|
+
|
|
180
|
+
const TYPES = [
|
|
181
|
+
{ type: 'line', label: '선 (line)' },
|
|
182
|
+
{ type: 'area', label: '영역 (area)' },
|
|
183
|
+
{ type: 'bar', label: '막대 (bar)' },
|
|
184
|
+
] as const
|
|
185
|
+
|
|
186
|
+
export default function Example() {
|
|
187
|
+
const [week, setWeek] = useState<'this' | 'last'>('this')
|
|
188
|
+
const data = week === 'this' ? THIS_WEEK : LAST_WEEK
|
|
189
|
+
return (
|
|
190
|
+
<Stack gap={5} style={{ width: '100%', maxWidth: 560 }}>
|
|
191
|
+
<Grid columns={3} gap={6}>
|
|
192
|
+
{TYPES.map((t) => (
|
|
193
|
+
<Stack key={t.type} gap={2}>
|
|
194
|
+
<Text variant="caption" tone="tertiary">
|
|
195
|
+
{t.label}
|
|
196
|
+
</Text>
|
|
197
|
+
<SparkChart
|
|
198
|
+
type={t.type}
|
|
199
|
+
data={data}
|
|
200
|
+
height={36}
|
|
201
|
+
tone="accent"
|
|
202
|
+
formatLabel={(i) => `${i * 2}시`}
|
|
203
|
+
valueLabel="주문"
|
|
204
|
+
formatValue={(v) => `${v}건`}
|
|
205
|
+
aria-label={`시간대별 주문 · ${t.label}`}
|
|
206
|
+
/>
|
|
207
|
+
</Stack>
|
|
208
|
+
))}
|
|
209
|
+
</Grid>
|
|
210
|
+
<Inline gap={2}>
|
|
211
|
+
<Button size="sm" variant={week === 'last' ? 'primary' : 'secondary'} onClick={() => setWeek('last')}>
|
|
212
|
+
지난주
|
|
213
|
+
</Button>
|
|
214
|
+
<Button size="sm" variant={week === 'this' ? 'primary' : 'secondary'} onClick={() => setWeek('this')}>
|
|
215
|
+
이번 주
|
|
216
|
+
</Button>
|
|
217
|
+
</Inline>
|
|
218
|
+
</Stack>
|
|
219
|
+
)
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### 추세 색 · 정적
|
|
224
|
+
|
|
225
|
+
tone="trend" + higherIs · worseTone. tooltip={false}면 이벤트 없이 그림만 그려서(role="img") 긴 표에서도 가벼워요. fill="solid"는 한 겹의 옅은 색.
|
|
226
|
+
|
|
227
|
+
```tsx
|
|
228
|
+
import { Inline, Stack, Text, SparkArea, SparkLine } from '@iamfiro/design'
|
|
229
|
+
|
|
230
|
+
const UP = [12, 14, 13, 17, 16, 19, 22, 21, 25, 27]
|
|
231
|
+
const DOWN = [27, 25, 26, 22, 21, 19, 18, 15, 14, 12]
|
|
232
|
+
|
|
233
|
+
const ROWS = [
|
|
234
|
+
{ label: '가입 · 늘수록 좋음', data: UP, higherIs: 'better' as const },
|
|
235
|
+
{ label: '이탈 · 줄수록 좋음', data: DOWN, higherIs: 'worse' as const },
|
|
236
|
+
{ label: '오류 · 늘면 위험', data: UP, higherIs: 'worse' as const, worseTone: 'danger' as const },
|
|
237
|
+
{ label: '방문 · 줄었음', data: DOWN, higherIs: 'better' as const },
|
|
238
|
+
]
|
|
239
|
+
|
|
240
|
+
export default function Example() {
|
|
241
|
+
return (
|
|
242
|
+
<Stack gap={4} style={{ width: '100%', maxWidth: 420 }}>
|
|
243
|
+
{ROWS.map((r) => (
|
|
244
|
+
<Inline key={r.label} justify="between" gap={4} wrap={false}>
|
|
245
|
+
<Text variant="body-sm" tone="secondary">
|
|
246
|
+
{r.label}
|
|
247
|
+
</Text>
|
|
248
|
+
<Inline gap={4} wrap={false}>
|
|
249
|
+
<SparkLine data={r.data} width={96} height={24} tone="trend" higherIs={r.higherIs} worseTone={r.worseTone} endDot tooltip={false} aria-label={r.label} />
|
|
250
|
+
<SparkArea data={r.data} width={96} height={24} tone="trend" higherIs={r.higherIs} worseTone={r.worseTone} curve="linear" fill="solid" tooltip={false} aria-label={r.label} />
|
|
251
|
+
</Inline>
|
|
252
|
+
</Inline>
|
|
253
|
+
))}
|
|
254
|
+
</Stack>
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
```
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Sparkbar
|
|
2
|
+
|
|
3
|
+
> 차트 · `@iamfiro/design` · 직접 만들지 말고 이 컴포넌트를 쓴다.
|
|
4
|
+
|
|
5
|
+
축 없이 막대만 늘어놓은 작은 막대 줄. 합계 아래 일별 추이처럼 흐름만 보여 줄 때 써요. 바닥에서 자라고 데이터가 바뀌면 새 높이로 미끄러지며, 마우스·터치·←/→로 막대를 고르면 차트 툴팁 카드에 값이 떠요. null은 아직 기록이 없는 칸으로 납작한 자리 표시가 돼요.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Sparkbar } 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
|
+
- 표 칸 · KPI 카드의 작은 추이는 `SparkLine` · `SparkArea` · `Sparkbar`(같은 props, 하나로 고르면 `SparkChart type`). 축 없음, 실제 픽셀 크기로 그려 24–40px에서도 또렷하게, 값 범위는 0이 아니라 최솟값–최댓값. 색은 `tone="trend"` + `higherIs`(Delta와 같은 규칙), 마지막 값은 `endDot`. 긴 표에선 `tooltip={false}`로 이벤트 없는 정적 그림(`role="img"`). KPI 카드는 Card 안 `Stat` + `Delta` + `SparkArea`.
|
|
15
|
+
|
|
16
|
+
## API
|
|
17
|
+
|
|
18
|
+
### Sparkbar
|
|
19
|
+
|
|
20
|
+
| prop | 타입 | 기본값 | 설명 |
|
|
21
|
+
| --- | --- | --- | --- |
|
|
22
|
+
| `data` (필수) | `(number \| null)[]` | | 한 칸에 값 하나. null은 기록 없음(자리 표시). |
|
|
23
|
+
| `height` | `number` | `48` | 높이(px). |
|
|
24
|
+
| `max` | `number` | | 막대가 꽉 차는 값. 기본은 가장 큰 값. |
|
|
25
|
+
| `color` | `string` | `'--n5'` | 막대 색. CSS 변수 이름('--accent') 또는 색. |
|
|
26
|
+
| `tone / higherIs / worseTone` | `'accent' \| 'neutral' \| 'trend'` | | SparkLine과 같은 색 규칙. trend는 처음 대비 마지막 값의 방향으로 초록 / 주황. color가 우선이고, 둘 다 없으면 옅은 회색. |
|
|
27
|
+
| `formatLabel` | `(index) => string` | `'3일'` | 툴팁 제목. |
|
|
28
|
+
| `formatValue` | `(value) => string` | `'1,234'` | 툴팁 값 형식. |
|
|
29
|
+
| `valueLabel` | `string` | `'값'` | 툴팁 행 이름. |
|
|
30
|
+
| `tooltip` | `boolean` | `true` | 값 카드 표시. |
|
|
31
|
+
| `activeIndex / defaultActiveIndex / onActiveIndexChange` | `number \| null` | | 고른 막대(제어/비제어). |
|
|
32
|
+
| `aria-label` | `string` | `'막대 그래프'` | 이름. 고른 막대는 aria-live로 읽어요. |
|
|
33
|
+
|
|
34
|
+
## 예제
|
|
35
|
+
|
|
36
|
+
예제를 감싼 `style={{ ... }}` div는 미리보기 배치용이다. 실제 화면 배치는 `Stack` · `Inline` · `Grid`로 한다.
|
|
37
|
+
|
|
38
|
+
### 기본
|
|
39
|
+
|
|
40
|
+
기본 막대는 옅은 회색이고, 고른 막대만 조금 진해져요. 포커스한 뒤 ←/→, Home/End, Esc로도 움직여요.
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { Sparkbar } from '@iamfiro/design'
|
|
44
|
+
|
|
45
|
+
const VISITS = [42, 58, 51, 66, 73, 40, 35, 61, 70, 68, 77, 82, 49, 44, 69, 88, 91, 76, 84, 52, 47, 79, 86, 93]
|
|
46
|
+
|
|
47
|
+
export default function Example() {
|
|
48
|
+
return (
|
|
49
|
+
<div style={{ width: '100%', maxWidth: 360 }}>
|
|
50
|
+
<Sparkbar data={VISITS} formatLabel={(i) => `${i}시`} valueLabel="방문" aria-label="시간대별 방문 수" />
|
|
51
|
+
</div>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 자리 표시 · 색 · 데이터 바뀜
|
|
57
|
+
|
|
58
|
+
앞으로 올 날은 null로 두면 바닥에 납작한 선으로 보여요. color로 막대 색을 바꾸고, 달을 바꾸면 막대가 새 높이로 미끄러져요.
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { useState } from 'react'
|
|
62
|
+
import { Button, Inline, Stack, Sparkbar } from '@iamfiro/design'
|
|
63
|
+
|
|
64
|
+
// 10월은 22일까지만 기록이 있어요. 남은 날은 null → 납작한 자리 표시.
|
|
65
|
+
const OCTOBER = [12, 31, 29, 25, 42, 36, 16, 14, 38, 35, 34, 44, 33, 17, 19, 48, 42, 38, 40, 47, 22, 23, ...Array<null>(9).fill(null)]
|
|
66
|
+
const SEPTEMBER = [26, 30, 28, 33, 31, 18, 15, 29, 35, 33, 30, 36, 20, 17, 31, 38, 34, 32, 40, 21, 19, 33, 36, 35, 31, 39, 22, 18, 30, 32]
|
|
67
|
+
|
|
68
|
+
export default function Example() {
|
|
69
|
+
const [month, setMonth] = useState<9 | 10>(10)
|
|
70
|
+
return (
|
|
71
|
+
<Stack gap={4} style={{ width: '100%', maxWidth: 360 }}>
|
|
72
|
+
<Sparkbar
|
|
73
|
+
data={month === 10 ? OCTOBER : SEPTEMBER}
|
|
74
|
+
height={56}
|
|
75
|
+
color="--accent"
|
|
76
|
+
formatLabel={(i) => `${month}월 ${i + 1}일`}
|
|
77
|
+
formatValue={(v) => `${v}건`}
|
|
78
|
+
valueLabel="주문"
|
|
79
|
+
aria-label={`${month}월 일별 주문`}
|
|
80
|
+
/>
|
|
81
|
+
<Inline gap={2}>
|
|
82
|
+
<Button size="sm" variant={month === 9 ? 'primary' : 'secondary'} onClick={() => setMonth(9)}>
|
|
83
|
+
9월
|
|
84
|
+
</Button>
|
|
85
|
+
<Button size="sm" variant={month === 10 ? 'primary' : 'secondary'} onClick={() => setMonth(10)}>
|
|
86
|
+
10월
|
|
87
|
+
</Button>
|
|
88
|
+
</Inline>
|
|
89
|
+
</Stack>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
```
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Spinner
|
|
2
|
+
|
|
3
|
+
> 진행 표시 · `@iamfiro/design` · 직접 만들지 말고 이 컴포넌트를 쓴다.
|
|
4
|
+
|
|
5
|
+
옅은 고리 위로 호가 돌면서 늘었다 줄었다 하는 로딩 표시. 진행률을 알 수 없는 짧은 기다림에 써요. 기본 색은 주변 글자 색을 따라가고, 스크린 리더에는 label을 읽어 줘요.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Spinner } from '@iamfiro/design'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## API
|
|
12
|
+
|
|
13
|
+
### Spinner
|
|
14
|
+
|
|
15
|
+
| prop | 타입 | 기본값 | 설명 |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| number` | `'sm'` | 이름 있는 크기 또는 px 숫자. |
|
|
18
|
+
| `tone` | `'default' \| 'muted' \| 'accent' \| 'inverse' \| 'inherit'` | `'inherit'` | 색. inherit은 글자 색을 따라가요. |
|
|
19
|
+
| `label` | `string` | `'불러오는 중'` | 스크린 리더가 읽는 이름(role="status"). |
|
|
20
|
+
| `className / style` | `string / CSSProperties` | | 루트에 적용돼요. |
|
|
21
|
+
|
|
22
|
+
## 예제
|
|
23
|
+
|
|
24
|
+
예제를 감싼 `style={{ ... }}` div는 미리보기 배치용이다. 실제 화면 배치는 `Stack` · `Inline` · `Grid`로 한다.
|
|
25
|
+
|
|
26
|
+
### 크기
|
|
27
|
+
|
|
28
|
+
xs 12 · sm 14 · md 18 · lg 24 · xl 32px. 숫자를 넘기면 그 크기(px)로 그려요.
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { Spinner, Text, type SpinnerSize } from '@iamfiro/design'
|
|
32
|
+
|
|
33
|
+
const SIZES: SpinnerSize[] = ['xs', 'sm', 'md', 'lg', 'xl']
|
|
34
|
+
|
|
35
|
+
export default function Example() {
|
|
36
|
+
return (
|
|
37
|
+
<div style={{ display: 'flex', alignItems: 'flex-end', gap: 32 }}>
|
|
38
|
+
{SIZES.map((size) => (
|
|
39
|
+
<div key={size} style={{ display: 'grid', justifyItems: 'center', gap: 10 }}>
|
|
40
|
+
<Spinner size={size} tone="default" />
|
|
41
|
+
<Text variant="caption" tone="tertiary">
|
|
42
|
+
{size}
|
|
43
|
+
</Text>
|
|
44
|
+
</div>
|
|
45
|
+
))}
|
|
46
|
+
<div style={{ display: 'grid', justifyItems: 'center', gap: 10 }}>
|
|
47
|
+
<Spinner size={48} tone="default" />
|
|
48
|
+
<Text variant="caption" tone="tertiary">
|
|
49
|
+
48
|
|
50
|
+
</Text>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 색
|
|
58
|
+
|
|
59
|
+
default · muted · accent는 정해진 색, inverse는 어두운 배경용이에요. 기본값 'inherit'은 currentColor를 써서 글자 색을 따라가요.
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { Spinner, Text } from '@iamfiro/design'
|
|
63
|
+
|
|
64
|
+
export default function Example() {
|
|
65
|
+
return (
|
|
66
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center', gap: 28 }}>
|
|
67
|
+
<Spinner size="lg" tone="default" label="기본" />
|
|
68
|
+
<Spinner size="lg" tone="muted" label="흐리게" />
|
|
69
|
+
<Spinner size="lg" tone="accent" label="강조" />
|
|
70
|
+
<div style={{ display: 'grid', placeItems: 'center', width: 48, height: 48, borderRadius: 12, background: 'var(--primary)' }}>
|
|
71
|
+
<Spinner size="lg" tone="inverse" label="어두운 배경" />
|
|
72
|
+
</div>
|
|
73
|
+
<Text tone="success" style={{ display: 'inline-flex', alignItems: 'center', gap: 8 }}>
|
|
74
|
+
<Spinner />
|
|
75
|
+
글자 색을 따라가요
|
|
76
|
+
</Text>
|
|
77
|
+
</div>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 버튼 · 인라인
|
|
83
|
+
|
|
84
|
+
Button의 loading을 켜면 아이콘 자리에 Spinner가 들어가고 눌리지 않아요. 짧은 상태 문구 옆에도 써요.
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
import { useState } from 'react'
|
|
88
|
+
import { RefreshCw, Save } from 'lucide-react'
|
|
89
|
+
import { Button, Spinner, Text } from '@iamfiro/design'
|
|
90
|
+
|
|
91
|
+
export default function Example() {
|
|
92
|
+
const [saving, setSaving] = useState(false)
|
|
93
|
+
const [syncing, setSyncing] = useState(false)
|
|
94
|
+
|
|
95
|
+
const save = () => {
|
|
96
|
+
setSaving(true)
|
|
97
|
+
setTimeout(() => setSaving(false), 1600)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const sync = () => {
|
|
101
|
+
setSyncing(true)
|
|
102
|
+
setTimeout(() => setSyncing(false), 2400)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<div style={{ display: 'grid', justifyItems: 'center', gap: 20 }}>
|
|
107
|
+
<div style={{ display: 'flex', gap: 8 }}>
|
|
108
|
+
<Button variant="primary" icon={<Save />} loading={saving} onClick={save}>
|
|
109
|
+
{saving ? '저장 중…' : '저장'}
|
|
110
|
+
</Button>
|
|
111
|
+
<Button iconOnly icon={<RefreshCw />} loading={syncing} onClick={sync} aria-label="동기화" />
|
|
112
|
+
<Button size="sm" loading>
|
|
113
|
+
작은 버튼
|
|
114
|
+
</Button>
|
|
115
|
+
</div>
|
|
116
|
+
<Text variant="body-sm" tone="tertiary" style={{ display: 'inline-flex', alignItems: 'center', gap: 8 }}>
|
|
117
|
+
{syncing && <Spinner size="xs" />}
|
|
118
|
+
{syncing ? '동기화 중…' : '2분 전에 동기화됨'}
|
|
119
|
+
</Text>
|
|
120
|
+
</div>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
```
|