@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,77 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Tone } from '../../primitives';
|
|
3
|
+
export type GridColumnType = 'text' | 'number' | 'select' | 'multiSelect' | 'checkbox' | 'date' | 'url';
|
|
4
|
+
/** One choice of a select / multiSelect column. The label is also the stored value (like Notion). */
|
|
5
|
+
export interface GridOption {
|
|
6
|
+
label: string;
|
|
7
|
+
tone?: Tone;
|
|
8
|
+
}
|
|
9
|
+
/** A row is any object with a stable string id; cell values live under each column's key. */
|
|
10
|
+
export interface GridRow {
|
|
11
|
+
id: string;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
export type GridNumberFormat = 'plain' | 'comma' | 'percent' | 'won' | 'usd';
|
|
15
|
+
export type GridAggregate = 'none' | 'count' | 'empty' | 'filled' | 'percentEmpty' | 'percentFilled' | 'unique' | 'sum' | 'avg' | 'median' | 'min' | 'max' | 'range' | 'checked' | 'unchecked' | 'percentChecked' | 'earliest' | 'latest';
|
|
16
|
+
export interface GridColumn<R extends GridRow = GridRow> {
|
|
17
|
+
/** Field the cells read and write (`row[key]`). */
|
|
18
|
+
key: string;
|
|
19
|
+
name: string;
|
|
20
|
+
type?: GridColumnType;
|
|
21
|
+
/** px, default 180. */
|
|
22
|
+
width?: number;
|
|
23
|
+
minWidth?: number;
|
|
24
|
+
/** Frozen on the left while scrolling sideways. */
|
|
25
|
+
pinned?: boolean;
|
|
26
|
+
hidden?: boolean;
|
|
27
|
+
/** Wrap long text instead of cutting it with "…" (turns row virtualization off). */
|
|
28
|
+
wrap?: boolean;
|
|
29
|
+
align?: 'start' | 'center' | 'end';
|
|
30
|
+
/** select / multiSelect choices. Typing a new label creates one unless `creatable` is false. */
|
|
31
|
+
options?: GridOption[];
|
|
32
|
+
creatable?: boolean;
|
|
33
|
+
/** number columns */
|
|
34
|
+
format?: GridNumberFormat;
|
|
35
|
+
decimals?: number;
|
|
36
|
+
/** Footer calculation. */
|
|
37
|
+
aggregate?: GridAggregate;
|
|
38
|
+
readOnly?: boolean;
|
|
39
|
+
/** Users can't delete it or change its type. */
|
|
40
|
+
locked?: boolean;
|
|
41
|
+
/** Custom cell content. The editor still follows `type`. */
|
|
42
|
+
render?: (value: unknown, row: R) => ReactNode;
|
|
43
|
+
/** Return a message to reject an edit (the cell shakes and stays in edit mode). */
|
|
44
|
+
validate?: (value: unknown, row: R) => string | null | undefined;
|
|
45
|
+
}
|
|
46
|
+
export interface GridSort {
|
|
47
|
+
key: string;
|
|
48
|
+
dir: 'asc' | 'desc';
|
|
49
|
+
}
|
|
50
|
+
export type GridFilterOp = 'contains' | 'notContains' | 'is' | 'isNot' | 'startsWith' | 'endsWith' | 'gt' | 'lt' | 'gte' | 'lte' | 'before' | 'after' | 'checked' | 'unchecked' | 'empty' | 'notEmpty';
|
|
51
|
+
export interface GridFilter {
|
|
52
|
+
id: string;
|
|
53
|
+
key: string;
|
|
54
|
+
op: GridFilterOp;
|
|
55
|
+
value?: string;
|
|
56
|
+
}
|
|
57
|
+
export type GridDensity = 'compact' | 'default' | 'comfortable';
|
|
58
|
+
/** Everything about how rows are shown (not the data itself). Save it to keep a "view". */
|
|
59
|
+
export interface GridView {
|
|
60
|
+
sorts: GridSort[];
|
|
61
|
+
filters: GridFilter[];
|
|
62
|
+
filterMode: 'and' | 'or';
|
|
63
|
+
groupBy: string | null;
|
|
64
|
+
/** Collapsed group keys. */
|
|
65
|
+
collapsed: string[];
|
|
66
|
+
search: string;
|
|
67
|
+
density: GridDensity;
|
|
68
|
+
rowNumbers: boolean;
|
|
69
|
+
gridlines: boolean;
|
|
70
|
+
}
|
|
71
|
+
export declare const DEFAULT_VIEW: GridView;
|
|
72
|
+
export interface GridCellEdit<R extends GridRow = GridRow> {
|
|
73
|
+
row: R;
|
|
74
|
+
column: GridColumn<R>;
|
|
75
|
+
value: unknown;
|
|
76
|
+
previous: unknown;
|
|
77
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import { type Space, type TextTone } from '../../primitives';
|
|
3
|
+
import './DescriptionList.css';
|
|
4
|
+
export type DescriptionListLayout = 'stacked' | 'inline';
|
|
5
|
+
export type DescriptionListVariant = 'plain' | 'soft';
|
|
6
|
+
export type DescriptionListLabelStyle = 'overline' | 'muted';
|
|
7
|
+
export type DescriptionListSize = 'sm' | 'md' | 'lg';
|
|
8
|
+
export type DescriptionListAlign = 'end' | 'start';
|
|
9
|
+
export interface DescriptionListItem {
|
|
10
|
+
/** Stable key; falls back to the position. */
|
|
11
|
+
id?: string;
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
value: ReactNode;
|
|
14
|
+
/** Leading icon before the label (a lucide icon), drawn muted at 16px (14px stacked). */
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
/** Color of the value, e.g. danger for "1 오류". */
|
|
17
|
+
tone?: TextTone;
|
|
18
|
+
/** Columns this item spans in the grid. */
|
|
19
|
+
span?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface DescriptionListProps {
|
|
22
|
+
/** The pairs; or pass `<DescriptionItem>` children. */
|
|
23
|
+
items?: DescriptionListItem[];
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
/** stacked: label above the value, in a grid · inline: one row per pair, label left and value right. */
|
|
26
|
+
layout?: DescriptionListLayout;
|
|
27
|
+
/** A fixed column count, or a full `grid-template-columns` string. Default: 3 stacked, 1 inline. */
|
|
28
|
+
columns?: number | string;
|
|
29
|
+
/** Responsive: as many columns as fit, each at least this wide (px). Overrides `columns`. */
|
|
30
|
+
minItemWidth?: number;
|
|
31
|
+
/** plain: nothing around it · soft: a gray panel (--surface-active, radius 12, compact padding). */
|
|
32
|
+
variant?: DescriptionListVariant;
|
|
33
|
+
/** overline: small uppercase-style labels ("소요 시간") · muted: quiet caption labels ("금액"). */
|
|
34
|
+
labelStyle?: DescriptionListLabelStyle;
|
|
35
|
+
/** Value size — the same number roles Stat uses (sm 14 · md 18 · lg 28). Inline rows use label roles. */
|
|
36
|
+
size?: DescriptionListSize;
|
|
37
|
+
/**
|
|
38
|
+
* Inline rows only. end: the value sits at the row's right edge ("비용 ₩42,000") ·
|
|
39
|
+
* start: values line up in a second column right after the widest label ("받는 사람 / 제목 / 첨부").
|
|
40
|
+
*/
|
|
41
|
+
align?: DescriptionListAlign;
|
|
42
|
+
/** Space between columns. */
|
|
43
|
+
gap?: Space;
|
|
44
|
+
/** Space between rows. Default: 4 stacked, 2 inline. */
|
|
45
|
+
rowGap?: Space;
|
|
46
|
+
'aria-label'?: string;
|
|
47
|
+
className?: string;
|
|
48
|
+
style?: CSSProperties;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Key–value pairs as a real `<dl>`: labels (overline or muted) above values in a grid, or one row per
|
|
52
|
+
* pair. `soft` puts it in a small gray panel, the way detail popovers show durations and costs.
|
|
53
|
+
* Pure Box / Grid / Stack / Inline / Text.
|
|
54
|
+
*/
|
|
55
|
+
export declare function DescriptionList({ items, children, layout, columns, minItemWidth, variant, labelStyle, size, align, gap, rowGap, 'aria-label': ariaLabel, className, style, }: DescriptionListProps): import("react").JSX.Element;
|
|
56
|
+
export interface DescriptionItemProps {
|
|
57
|
+
label: ReactNode;
|
|
58
|
+
/** Leading icon before the label, drawn muted at 16px (14px stacked). */
|
|
59
|
+
icon?: ReactNode;
|
|
60
|
+
/** The value. */
|
|
61
|
+
children: ReactNode;
|
|
62
|
+
tone?: TextTone;
|
|
63
|
+
span?: number;
|
|
64
|
+
className?: string;
|
|
65
|
+
}
|
|
66
|
+
/** One label + value pair inside a DescriptionList (reads its layout, label style, size and alignment). */
|
|
67
|
+
export declare function DescriptionItem({ label, icon, children, tone, span, className }: DescriptionItemProps): import("react").JSX.Element;
|
|
68
|
+
export interface DescriptionSectionProps {
|
|
69
|
+
/** Overline heading ("입력", "결과"). */
|
|
70
|
+
title: ReactNode;
|
|
71
|
+
/** Body text, or any content. */
|
|
72
|
+
children: ReactNode;
|
|
73
|
+
className?: string;
|
|
74
|
+
style?: CSSProperties;
|
|
75
|
+
}
|
|
76
|
+
/** An overline heading over a short body — the "입력 / 결과" blocks under a detail grid. */
|
|
77
|
+
export declare function DescriptionSection({ title, children, className, style }: DescriptionSectionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type MouseEvent, type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
export interface AlertDialogProps {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
defaultOpen?: boolean;
|
|
5
|
+
onOpenChange?: (open: boolean) => void;
|
|
6
|
+
trigger?: ReactElement<{
|
|
7
|
+
onClick?: (e: MouseEvent) => void;
|
|
8
|
+
}>;
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
/** danger: red confirm, warning icon, focus starts on 취소 so Enter doesn't destroy anything. */
|
|
12
|
+
tone?: 'default' | 'danger';
|
|
13
|
+
/** Name the action — "삭제", "보내기" — never "확인". */
|
|
14
|
+
confirmLabel: ReactNode;
|
|
15
|
+
cancelLabel?: ReactNode;
|
|
16
|
+
/** May be async: the button spins and the dialog stays locked until it settles; a throw keeps it open. */
|
|
17
|
+
onConfirm: () => void | Promise<void>;
|
|
18
|
+
/** Ask the user to type this exact text first (e.g. the project name) for the most destructive actions. */
|
|
19
|
+
confirmationText?: string;
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The confirm step for actions that can't be undone (permanent delete, payment, mass send).
|
|
24
|
+
* For anything undoable, run it right away and offer `toast.undo()` instead.
|
|
25
|
+
*/
|
|
26
|
+
export declare function AlertDialog({ open: openProp, defaultOpen, onOpenChange, trigger, title, description, tone, confirmLabel, cancelLabel, onConfirm, confirmationText, children, }: AlertDialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ReactNode, type RefObject } from 'react';
|
|
2
|
+
import { type ModalTrigger } from './modal';
|
|
3
|
+
import './Dialog.css';
|
|
4
|
+
export interface DialogProps {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
/** A button that opens the dialog (its own onClick still runs). */
|
|
9
|
+
trigger?: ModalTrigger;
|
|
10
|
+
title: ReactNode;
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/** Buttons row at the bottom (right-aligned). Ignored with `bare`. */
|
|
14
|
+
footer?: ReactNode;
|
|
15
|
+
/** Panel width: 400 / 520 / 720px. Becomes a bottom sheet on phones. */
|
|
16
|
+
size?: 'sm' | 'md' | 'lg';
|
|
17
|
+
/** Close on Esc and on a click outside. Turn off while something is saving. */
|
|
18
|
+
dismissible?: boolean;
|
|
19
|
+
/** Show the × in the corner. Never shown with `bare`. */
|
|
20
|
+
showClose?: boolean;
|
|
21
|
+
/** Where focus lands when it opens; defaults to the first focusable element. */
|
|
22
|
+
initialFocus?: RefObject<HTMLElement | null>;
|
|
23
|
+
/**
|
|
24
|
+
* Children go straight into the panel: no header, body or footer wrappers, no padding, no ×.
|
|
25
|
+
* The panel is a clipping flex column, so a child can take `min-height: 0` and scroll.
|
|
26
|
+
* `title` (and `description`) still name the dialog but are visually hidden.
|
|
27
|
+
*/
|
|
28
|
+
bare?: boolean;
|
|
29
|
+
/** Keep the normal layout but visually hide the title and description (screen readers still read them). */
|
|
30
|
+
hideTitle?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* center: in the middle (a bottom sheet on phones). top: about 12vh from the top so the panel
|
|
33
|
+
* doesn't jump as its height changes (command palettes); stays a floating panel on phones.
|
|
34
|
+
*/
|
|
35
|
+
placement?: 'center' | 'top';
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A modal over the page: focus is trapped inside, the page behind can't scroll, Esc or a click
|
|
40
|
+
* outside closes it, and focus returns to the trigger. Opens and closes with a soft scale.
|
|
41
|
+
*/
|
|
42
|
+
export declare function Dialog({ open: openProp, defaultOpen, onOpenChange, trigger, title, description, children, footer, size, dismissible, showClose, initialFocus, bare, hideTitle, placement, className, }: DialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type KeyboardEvent, type MouseEvent, type PointerEvent, type ReactElement, type RefObject } from 'react';
|
|
2
|
+
export type ModalTrigger = ReactElement<{
|
|
3
|
+
onClick?: (e: MouseEvent) => void;
|
|
4
|
+
}>;
|
|
5
|
+
interface ModalLayerOptions {
|
|
6
|
+
open: boolean;
|
|
7
|
+
setOpen: (open: boolean) => void;
|
|
8
|
+
/** Esc and outside press close it. */
|
|
9
|
+
dismissible: boolean;
|
|
10
|
+
/** Exit animation length (keeps the layer mounted while it plays). */
|
|
11
|
+
exitMs: number;
|
|
12
|
+
panelRef: RefObject<HTMLElement | null>;
|
|
13
|
+
initialFocus?: RefObject<HTMLElement | null>;
|
|
14
|
+
/** Modal: lock page scroll and trap focus. Off for a panel the page stays usable beside. */
|
|
15
|
+
modal?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The shared machinery of a modal layer (Dialog, Drawer): presence for the exit animation,
|
|
19
|
+
* scroll lock, focus trap with focus return, Esc, and closing on a press that both starts and
|
|
20
|
+
* ends outside the panel (dragging out of a text field doesn't count).
|
|
21
|
+
*/
|
|
22
|
+
export declare function useModalLayer({ open, setOpen, dismissible, exitMs, panelRef, initialFocus, modal }: ModalLayerOptions): {
|
|
23
|
+
presence: {
|
|
24
|
+
mounted: boolean;
|
|
25
|
+
closing: boolean;
|
|
26
|
+
};
|
|
27
|
+
close: () => void;
|
|
28
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
29
|
+
outsideProps: {
|
|
30
|
+
onPointerDown: (e: PointerEvent) => void;
|
|
31
|
+
onClick: (e: MouseEvent) => void;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** Clones a trigger button so it opens the layer (its own onClick still runs; preventDefault stops opening). */
|
|
35
|
+
export declare function modalTrigger(trigger: ModalTrigger | undefined, open: boolean, onOpen: () => void): ReactElement<{
|
|
36
|
+
onClick?: (e: MouseEvent) => void;
|
|
37
|
+
}, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type ReactNode, type RefObject } from 'react';
|
|
2
|
+
import { type ModalTrigger } from '../Dialog/modal';
|
|
3
|
+
import './Drawer.css';
|
|
4
|
+
export type DrawerSide = 'right' | 'left' | 'top' | 'bottom';
|
|
5
|
+
export type DrawerSize = 'sm' | 'md' | 'lg' | 'full';
|
|
6
|
+
export interface DrawerProps {
|
|
7
|
+
open?: boolean;
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
/** A button that opens the drawer (its own onClick still runs). */
|
|
11
|
+
trigger?: ModalTrigger;
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
description?: ReactNode;
|
|
14
|
+
/** Body. Scrolls on its own; the header and footer stay put. */
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/** Buttons row pinned to the bottom (right-aligned). */
|
|
17
|
+
footer?: ReactNode;
|
|
18
|
+
/** Edge it slides in from. */
|
|
19
|
+
side?: DrawerSide;
|
|
20
|
+
/**
|
|
21
|
+
* left / right: width 360 · 440 · 640px · the whole screen.
|
|
22
|
+
* top / bottom: max height 50 · 75 · 92% of the screen · the whole screen.
|
|
23
|
+
*/
|
|
24
|
+
size?: DrawerSize;
|
|
25
|
+
/** Esc, a click outside, the × and dragging down close it. Turn off while something is saving. */
|
|
26
|
+
dismissible?: boolean;
|
|
27
|
+
/** Show the × in the corner. */
|
|
28
|
+
showClose?: boolean;
|
|
29
|
+
/** Where focus lands when it opens; defaults to the first focusable element. */
|
|
30
|
+
initialFocus?: RefObject<HTMLElement | null>;
|
|
31
|
+
/** Visually hide the title and description (screen readers still read them). */
|
|
32
|
+
hideTitle?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* true: dims the page, traps focus and locks scrolling (like Dialog).
|
|
35
|
+
* false: no overlay — the page beside it stays usable (an inspector panel). Esc still closes it.
|
|
36
|
+
*/
|
|
37
|
+
modal?: boolean;
|
|
38
|
+
/** Float 8px off the edges with every corner rounded, instead of sitting flush against the edge. */
|
|
39
|
+
inset?: boolean;
|
|
40
|
+
/** Drag handle (top / bottom only). Defaults to on for `side="bottom"`. Drag the handle or header to resize or dismiss. */
|
|
41
|
+
handle?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Heights the sheet rests at, as fractions of its full height in ascending order (e.g. [0.5, 1]).
|
|
44
|
+
* Dragging settles on the nearest one (a flick moves on); the handle steps through them.
|
|
45
|
+
*/
|
|
46
|
+
snapPoints?: number[];
|
|
47
|
+
/** Current snap point (controlled). */
|
|
48
|
+
snap?: number;
|
|
49
|
+
/** Snap point each time it opens (uncontrolled). Defaults to the largest. */
|
|
50
|
+
defaultSnap?: number;
|
|
51
|
+
onSnapChange?: (snap: number) => void;
|
|
52
|
+
className?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A modal panel that slides in from an edge — filters, details, settings, a mobile action sheet.
|
|
56
|
+
* Shares Dialog's machinery (focus trap, scroll lock, Esc / outside close, focus return) and
|
|
57
|
+
* leaves by sliding back out the way it came. A bottom sheet can be dragged down to dismiss.
|
|
58
|
+
*/
|
|
59
|
+
export declare function Drawer({ open: openProp, defaultOpen, onOpenChange, trigger, title, description, children, footer, side, size, dismissible, showClose, initialFocus, hideTitle, modal, inset, handle: handleProp, snapPoints, snap: snapProp, defaultSnap, onSnapChange, className, }: DrawerProps): import("react").JSX.Element;
|
|
60
|
+
export type SheetProps = Omit<DrawerProps, 'side'>;
|
|
61
|
+
/** A bottom sheet: `Drawer side="bottom"` with a drag handle — drag down to dismiss, optional snap points. */
|
|
62
|
+
export declare function Sheet(props: SheetProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode, type RefObject } from 'react';
|
|
2
|
+
import '../Popover/Popover.css';
|
|
3
|
+
import './DropdownMenu.css';
|
|
4
|
+
export interface DropdownMenuProps {
|
|
5
|
+
/** The button that opens the menu. */
|
|
6
|
+
trigger: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
open?: boolean;
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
align?: 'start' | 'center' | 'end';
|
|
12
|
+
/** Minimum panel width in px. */
|
|
13
|
+
minWidth?: number;
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* An action menu. A mouse press opens it at once and releasing over an item picks it
|
|
18
|
+
* (press-drag-release); a plain click leaves it open. Arrows, Home/End and letters move,
|
|
19
|
+
* Enter/Space pick, Esc closes. Submenus open on a short hover and stay open while you aim at them.
|
|
20
|
+
*/
|
|
21
|
+
export declare function DropdownMenu({ trigger, children, open: openProp, defaultOpen, onOpenChange, align, minWidth, 'aria-label': ariaLabel, }: DropdownMenuProps): import("react").JSX.Element;
|
|
22
|
+
export declare namespace DropdownMenu {
|
|
23
|
+
var Item: typeof DropdownMenuItem;
|
|
24
|
+
var CheckboxItem: typeof DropdownMenuCheckboxItem;
|
|
25
|
+
var RadioGroup: typeof DropdownMenuRadioGroup;
|
|
26
|
+
var RadioItem: typeof DropdownMenuRadioItem;
|
|
27
|
+
var Label: typeof DropdownMenuLabel;
|
|
28
|
+
var Separator: typeof DropdownMenuSeparator;
|
|
29
|
+
var Sub: typeof DropdownMenuSub;
|
|
30
|
+
}
|
|
31
|
+
export interface MenuPanelProps {
|
|
32
|
+
id?: string;
|
|
33
|
+
panelRef: RefObject<HTMLDivElement | null>;
|
|
34
|
+
side: string;
|
|
35
|
+
closing: boolean;
|
|
36
|
+
style: CSSProperties;
|
|
37
|
+
onEscape: () => void;
|
|
38
|
+
/** ← on a row of this panel (submenu: back to its row; menubar: previous menu). */
|
|
39
|
+
onArrowLeft?: () => void;
|
|
40
|
+
/** → on a plain row of this panel (menubar: next menu). Submenu rows open their submenu instead. */
|
|
41
|
+
onArrowRight?: () => void;
|
|
42
|
+
onPointerEnter?: () => void;
|
|
43
|
+
className?: string;
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
'aria-label'?: string;
|
|
46
|
+
'aria-labelledby'?: string;
|
|
47
|
+
}
|
|
48
|
+
export declare function MenuPanel({ id, panelRef, side, closing, style, onEscape, onArrowLeft, onArrowRight, onPointerEnter, className, children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, }: MenuPanelProps): import("react").ReactPortal;
|
|
49
|
+
interface ItemBaseProps {
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
icon?: ReactNode;
|
|
52
|
+
/** Second line in gray. */
|
|
53
|
+
description?: ReactNode;
|
|
54
|
+
/** Key names for the shortcut hint, e.g. ['mod', 'D']. */
|
|
55
|
+
shortcut?: string[];
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface DropdownMenuItemProps extends ItemBaseProps {
|
|
59
|
+
onSelect?: () => void;
|
|
60
|
+
/** Red, for destructive actions. */
|
|
61
|
+
danger?: boolean;
|
|
62
|
+
/** Keep the menu open after picking (for repeated actions). */
|
|
63
|
+
keepOpen?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare function DropdownMenuItem({ onSelect, danger, keepOpen, ...rest }: DropdownMenuItemProps): import("react").JSX.Element;
|
|
66
|
+
export interface DropdownMenuCheckboxItemProps extends ItemBaseProps {
|
|
67
|
+
checked: boolean;
|
|
68
|
+
onCheckedChange: (checked: boolean) => void;
|
|
69
|
+
/** Checkbox items keep the menu open by default so several can be toggled. */
|
|
70
|
+
closeOnSelect?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export declare function DropdownMenuCheckboxItem({ checked, onCheckedChange, closeOnSelect, ...rest }: DropdownMenuCheckboxItemProps): import("react").JSX.Element;
|
|
73
|
+
export declare function DropdownMenuRadioGroup({ value, onValueChange, label, children, }: {
|
|
74
|
+
value: string;
|
|
75
|
+
onValueChange: (value: string) => void;
|
|
76
|
+
label?: ReactNode;
|
|
77
|
+
children: ReactNode;
|
|
78
|
+
}): import("react").JSX.Element;
|
|
79
|
+
export declare function DropdownMenuRadioItem({ value, ...rest }: ItemBaseProps & {
|
|
80
|
+
value: string;
|
|
81
|
+
}): import("react").JSX.Element;
|
|
82
|
+
export declare function DropdownMenuLabel({ children }: {
|
|
83
|
+
children: ReactNode;
|
|
84
|
+
}): import("react").JSX.Element;
|
|
85
|
+
export declare function DropdownMenuSeparator(): import("react").JSX.Element;
|
|
86
|
+
export interface DropdownMenuSubProps {
|
|
87
|
+
label: ReactNode;
|
|
88
|
+
icon?: ReactNode;
|
|
89
|
+
disabled?: boolean;
|
|
90
|
+
children: ReactNode;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A nested menu. Opens after resting TIMING.hoverIntent on its row (or →/Enter); while the
|
|
94
|
+
* pointer travels diagonally toward it, rows it crosses don't steal the highlight.
|
|
95
|
+
*/
|
|
96
|
+
export declare function DropdownMenuSub({ label, icon, disabled, children }: DropdownMenuSubProps): import("react").JSX.Element;
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type PointerEvent, type RefObject } from 'react';
|
|
2
|
+
/** Exit animation length of menu panels (matches .ds-floating[data-state='closed']). */
|
|
3
|
+
export declare const MENU_EXIT_MS = 160;
|
|
4
|
+
export declare const MENU_ITEM = "[data-menu-item]:not([aria-disabled=\"true\"])";
|
|
5
|
+
export interface MenuCtx {
|
|
6
|
+
/** Close every level of the menu (after a pick, Tab, outside press). */
|
|
7
|
+
closeAll: (returnFocus?: boolean) => void;
|
|
8
|
+
/** While pointing toward an open submenu, other rows must not steal the highlight. */
|
|
9
|
+
isAimingAtSub: (x: number, y: number) => boolean;
|
|
10
|
+
setAim: (fn: ((x: number, y: number) => boolean) | null) => void;
|
|
11
|
+
/** Panels belonging to this menu (root + open subs), for outside-press checks. */
|
|
12
|
+
panels: Set<RefObject<HTMLElement | null>>;
|
|
13
|
+
}
|
|
14
|
+
export declare const MenuContext: import("react").Context<MenuCtx | null>;
|
|
15
|
+
/** Builds the root menu state: submenu aim guard + the set of open panels (for outside-press checks). */
|
|
16
|
+
export declare function useMenuRoot(closeAll: (returnFocus?: boolean) => void): MenuCtx;
|
|
17
|
+
/** Enabled items of one panel (not its submenus), in order. */
|
|
18
|
+
export declare const menuItems: (panel: HTMLElement | null) => HTMLElement[];
|
|
19
|
+
/**
|
|
20
|
+
* Press-drag-release from a mouse press on a trigger: if the pointer travels and is released over
|
|
21
|
+
* a menu item (not a submenu row), that item is clicked.
|
|
22
|
+
*/
|
|
23
|
+
export declare function trackPressDragRelease(e: PointerEvent): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import './Dropzone.css';
|
|
3
|
+
/** Whether a file matches an `<input accept>` string (`.pdf,image/*,text/csv`). Empty accepts everything. */
|
|
4
|
+
export declare function matchesAccept(file: File, accept?: string): boolean;
|
|
5
|
+
export interface DropzoneProps {
|
|
6
|
+
/** Files dropped or picked. Those that don't match `accept` come in `rejected` (the zone shakes). */
|
|
7
|
+
onFiles?: (accepted: File[], rejected: File[]) => void;
|
|
8
|
+
/** Same syntax as `<input accept>`. Checked for dropped files too. */
|
|
9
|
+
accept?: string;
|
|
10
|
+
/** Allow several files at once. */
|
|
11
|
+
multiple?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
invalid?: boolean;
|
|
14
|
+
/** Main line. Defaults to "여기에 파일을 끌어 놓거나 찾아보기". */
|
|
15
|
+
title?: ReactNode;
|
|
16
|
+
/** Gray line under the title (formats, size limit). */
|
|
17
|
+
description?: ReactNode;
|
|
18
|
+
/** md: centred with an illustration · sm: one compact row. */
|
|
19
|
+
size?: 'sm' | 'md';
|
|
20
|
+
/** Form field name for the hidden file input. */
|
|
21
|
+
name?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
'aria-label'?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A dashed area that takes files by drag-and-drop, click, or Enter / Space.
|
|
28
|
+
* While files hover over it the sheets fan out and the area turns blue.
|
|
29
|
+
*/
|
|
30
|
+
export declare function Dropzone({ onFiles, accept, multiple, disabled, invalid, title, description, size, name, className, style, 'aria-label': ariaLabel, }: DropzoneProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import './EmptyState.css';
|
|
3
|
+
export type EmptyStateTone = 'default' | 'accent' | 'danger' | 'warning' | 'success';
|
|
4
|
+
export interface EmptyStateProps {
|
|
5
|
+
/** An icon (lucide etc.) shown in a soft round badge, or your own illustration via `media`. */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
/** Replaces the icon badge entirely (illustration, image, Lottie…). */
|
|
8
|
+
media?: ReactNode;
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
/** Buttons; the first is usually the primary action. */
|
|
12
|
+
actions?: ReactNode;
|
|
13
|
+
/** A small line under the actions (help link, shortcut hint…). */
|
|
14
|
+
footer?: ReactNode;
|
|
15
|
+
tone?: EmptyStateTone;
|
|
16
|
+
size?: 'sm' | 'md' | 'lg';
|
|
17
|
+
/** Left-aligned for use inside panels and tables. */
|
|
18
|
+
align?: 'center' | 'start';
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* "Nothing here yet" for lists, search results, errors and locked areas.
|
|
24
|
+
* Its parts rise in one after another when it appears.
|
|
25
|
+
*/
|
|
26
|
+
export declare function EmptyState({ icon, media, title, description, actions, footer, tone, size, align, className, style, }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import './FileChip.css';
|
|
3
|
+
export type FileChipVariant = 'ghost' | 'soft';
|
|
4
|
+
export interface FileChipProps {
|
|
5
|
+
/** File name; the extension stays visible while the rest truncates ("월간-정산-보고….pdf"). */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Bytes (formatted with formatBytes) or a ready string ("1.2MB"). */
|
|
8
|
+
size?: number | string;
|
|
9
|
+
/** Makes it a link. */
|
|
10
|
+
href?: string;
|
|
11
|
+
/** With `href`: download instead of navigating (true, or a file name). */
|
|
12
|
+
download?: boolean | string;
|
|
13
|
+
target?: string;
|
|
14
|
+
/** Makes it a button (preview, open a drawer). */
|
|
15
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
16
|
+
/** clip: a paperclip (attachment in text) · file: the colored FileIcon · or your own icon. */
|
|
17
|
+
icon?: 'clip' | 'file' | ReactNode;
|
|
18
|
+
/** ghost: link-like, no fill until hover · soft: the small gray chip fill. */
|
|
19
|
+
variant?: FileChipVariant;
|
|
20
|
+
/** The name truncates past this width (px). */
|
|
21
|
+
maxWidth?: number;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
className?: string;
|
|
24
|
+
style?: CSSProperties;
|
|
25
|
+
'aria-label'?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A compact attachment: paperclip (or FileIcon), a file name that truncates in the middle so the
|
|
29
|
+
* extension stays readable, and an optional size. A link with `href`, a button with `onClick`,
|
|
30
|
+
* plain text otherwise.
|
|
31
|
+
*/
|
|
32
|
+
export declare function FileChip({ name, size, href, download, target, onClick, icon, variant, maxWidth, disabled, className, style, 'aria-label': ariaLabel, }: FileChipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
export type UploadStatus = 'uploading' | 'done' | 'error';
|
|
3
|
+
export interface UploadItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
/** Bytes. */
|
|
7
|
+
size: number;
|
|
8
|
+
/** Bytes sent so far. */
|
|
9
|
+
loaded?: number;
|
|
10
|
+
status: UploadStatus;
|
|
11
|
+
/** Red line shown instead of the progress (status 'error'). */
|
|
12
|
+
error?: ReactNode;
|
|
13
|
+
/** The picked file. Items without one (validation errors, items from the server) can't be retried. */
|
|
14
|
+
file?: File;
|
|
15
|
+
}
|
|
16
|
+
export type UploadHandler = (file: File, ctx: {
|
|
17
|
+
onProgress: (loaded: number) => void;
|
|
18
|
+
signal: AbortSignal;
|
|
19
|
+
}) => Promise<unknown>;
|
|
20
|
+
export interface FileUploadProps {
|
|
21
|
+
/** Sends one file. Report bytes with `onProgress`, resolve when done, reject to show the error. `signal` aborts on ×. Without it, picked files are just listed. */
|
|
22
|
+
upload?: UploadHandler;
|
|
23
|
+
/** Rows (controlled). */
|
|
24
|
+
items?: UploadItem[];
|
|
25
|
+
defaultItems?: UploadItem[];
|
|
26
|
+
onItemsChange?: (items: UploadItem[]) => void;
|
|
27
|
+
/** Called when a row is removed with × (an upload in progress is aborted first). */
|
|
28
|
+
onRemove?: (item: UploadItem) => void;
|
|
29
|
+
/** Same syntax as `<input accept>`. Other files come in as "지원하지 않는 형식" rows. */
|
|
30
|
+
accept?: string;
|
|
31
|
+
/** Largest file in bytes. */
|
|
32
|
+
maxSize?: number;
|
|
33
|
+
/** Most files at once (failed rows don't count). */
|
|
34
|
+
maxFiles?: number;
|
|
35
|
+
multiple?: boolean;
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/** Dropzone main line. */
|
|
38
|
+
title?: ReactNode;
|
|
39
|
+
/** Dropzone gray line. Defaults to the formats from `accept` and `maxSize`. */
|
|
40
|
+
description?: ReactNode;
|
|
41
|
+
/** The "업로드 중 · 1.2 / 8.1MB" line at the bottom. */
|
|
42
|
+
showSummary?: boolean;
|
|
43
|
+
className?: string;
|
|
44
|
+
style?: CSSProperties;
|
|
45
|
+
}
|
|
46
|
+
/** 4404019 → "4.2MB". */
|
|
47
|
+
export declare function formatBytes(bytes: number): string;
|
|
48
|
+
/**
|
|
49
|
+
* Drop files, watch each one upload, cancel or retry. Assembled from foundations:
|
|
50
|
+
* Card + Dropzone + List/ListItem + FileIcon + Progress + Text.
|
|
51
|
+
*/
|
|
52
|
+
export declare function FileUpload({ upload, items: itemsProp, defaultItems, onItemsChange, onRemove, accept, maxSize, maxFiles, multiple, disabled, title, description, showSummary, className, style, }: FileUploadProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type SelectionProps, type SelectionValue } from '../../hooks';
|
|
3
|
+
import './FilterChips.css';
|
|
4
|
+
export type FilterChipVariant = 'solid' | 'soft';
|
|
5
|
+
export type FilterChipSize = 'sm' | 'md';
|
|
6
|
+
export type FilterChipGroupProps<V extends SelectionValue> = SelectionProps<V> & {
|
|
7
|
+
/** solid: selected chip turns dark · soft: selected chip gets a blue tint */
|
|
8
|
+
variant?: FilterChipVariant;
|
|
9
|
+
size?: FilterChipSize;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Show a reset button once anything is selected. */
|
|
12
|
+
clearable?: boolean;
|
|
13
|
+
clearLabel?: ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
'aria-label'?: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
/** A row of filter chips sharing one selection (single or multiple). */
|
|
19
|
+
export declare function FilterChipGroup<V extends SelectionValue>(props: FilterChipGroupProps<V>): import("react").JSX.Element;
|
|
20
|
+
export declare namespace FilterChipGroup {
|
|
21
|
+
var Chip: typeof FilterChip;
|
|
22
|
+
}
|
|
23
|
+
export interface FilterChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
|
|
24
|
+
/** Inside a FilterChipGroup: the value this chip toggles. */
|
|
25
|
+
value?: SelectionValue;
|
|
26
|
+
/** Standalone use: controlled pressed state. */
|
|
27
|
+
selected?: boolean;
|
|
28
|
+
onSelectedChange?: (selected: boolean) => void;
|
|
29
|
+
/** Shows an × button, e.g. for an applied filter like "상태: 진행 중". */
|
|
30
|
+
onRemove?: () => void;
|
|
31
|
+
removeLabel?: string;
|
|
32
|
+
icon?: ReactNode;
|
|
33
|
+
count?: number;
|
|
34
|
+
variant?: FilterChipVariant;
|
|
35
|
+
size?: FilterChipSize;
|
|
36
|
+
}
|
|
37
|
+
export declare function FilterChip({ value, selected: selectedProp, onSelectedChange, onRemove, removeLabel, icon, count, variant: variantProp, size: sizeProp, disabled: disabledProp, className, children, onClick, ...rest }: FilterChipProps): import("react").JSX.Element;
|