prime-ui-kit 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -47
- package/dist/chunks/chunk-IQELQNMR.js +379 -0
- package/dist/chunks/chunk-LXGRKN34.js +13260 -0
- package/dist/chunks/chunk-ZEFCDEEQ.js +3493 -0
- package/dist/color-picker.d.ts +7 -0
- package/dist/color-picker.js +9 -0
- package/dist/components/accordion/Accordion.d.ts +44 -32
- package/dist/components/avatar/Avatar.d.ts +36 -53
- package/dist/components/badge/Badge.d.ts +50 -13
- package/dist/components/badge/edgeIcons.d.ts +13 -0
- package/dist/components/badge/tier.d.ts +0 -1
- package/dist/components/banner/Banner.d.ts +29 -60
- package/dist/components/breadcrumb/Breadcrumb.d.ts +11 -23
- package/dist/components/button/Button.d.ts +22 -36
- package/dist/components/button-group/ButtonGroup.d.ts +17 -17
- package/dist/components/card/Card.d.ts +75 -202
- package/dist/components/checkbox/Checkbox.d.ts +37 -38
- package/dist/components/code-block/CodeBlock.d.ts +5 -13
- package/dist/components/color-picker/ColorPicker.d.ts +76 -52
- package/dist/components/color-picker/ColorPresets.d.ts +18 -30
- package/dist/components/color-swatches/ColorSwatches.d.ts +40 -0
- package/dist/components/command-menu/CommandMenu.d.ts +138 -78
- package/dist/components/crossfade/Crossfade.d.ts +14 -0
- package/dist/components/data-table/DataTable.d.ts +35 -81
- package/dist/components/data-table/Footer.d.ts +16 -0
- package/dist/components/data-table/Head.d.ts +21 -0
- package/dist/components/data-table/Row.d.ts +56 -0
- package/dist/components/data-table/StateRows.d.ts +18 -0
- package/dist/components/data-table/rows.d.ts +60 -0
- package/dist/components/data-table/types.d.ts +40 -0
- package/dist/components/data-table/useColumnHover.d.ts +9 -0
- package/dist/components/data-table/useFrozenColumns.d.ts +16 -0
- package/dist/components/data-table/useInfiniteRows.d.ts +24 -0
- package/dist/components/data-table/useRowSelection.d.ts +35 -0
- package/dist/components/datepicker/Datepicker.d.ts +9 -126
- package/dist/components/datepicker/DatepickerPanel.d.ts +113 -0
- package/dist/components/datepicker/datepickerModel.d.ts +16 -22
- package/dist/components/datepicker/panelLayout.d.ts +50 -0
- package/dist/components/digit-input/DigitInput.d.ts +24 -19
- package/dist/components/divider/Divider.d.ts +7 -15
- package/dist/components/dnd/Dnd.d.ts +135 -0
- package/dist/components/dnd/DragOverlay.d.ts +6 -0
- package/dist/components/dnd/autoScroll.d.ts +5 -0
- package/dist/components/dnd/context.d.ts +5 -0
- package/dist/components/dnd/dragSession.d.ts +102 -0
- package/dist/components/dnd/geometry.d.ts +30 -0
- package/dist/components/dnd/labels.d.ts +18 -0
- package/dist/components/dnd/store.d.ts +9 -0
- package/dist/components/dnd/useDragSource.d.ts +36 -0
- package/dist/components/dnd/useDropTarget.d.ts +44 -0
- package/dist/components/dnd/useFlipList.d.ts +11 -0
- package/dist/components/dnd/useSortableList.d.ts +62 -0
- package/dist/components/drawer/Drawer.d.ts +13 -21
- package/dist/components/dropdown/Dropdown.d.ts +78 -84
- package/dist/components/empty-page/EmptyPage.d.ts +48 -48
- package/dist/components/example-frame/ExampleFrame.d.ts +20 -27
- package/dist/components/file-upload/FileUpload.d.ts +79 -134
- package/dist/components/hint/Hint.d.ts +10 -11
- package/dist/components/index.d.ts +58 -42
- package/dist/components/input/Input.d.ts +35 -37
- package/dist/components/kanban/Kanban.d.ts +129 -0
- package/dist/components/kbd/Kbd.d.ts +6 -12
- package/dist/components/label/Label.d.ts +18 -15
- package/dist/components/link-button/LinkButton.d.ts +14 -15
- package/dist/components/login-form/LoginForm.d.ts +115 -0
- package/dist/components/modal/DialogParts.d.ts +57 -16
- package/dist/components/modal/Modal.d.ts +9 -20
- package/dist/components/native-select/NativeSelect.d.ts +28 -0
- package/dist/components/notification/Notification.d.ts +50 -16
- package/dist/components/notification/NotificationStore.d.ts +2 -6
- package/dist/components/page-content/PageContent.d.ts +43 -52
- package/dist/components/page-toolbar/PageToolbar.d.ts +53 -0
- package/dist/components/pagination/Pagination.d.ts +11 -23
- package/dist/components/popover/Popover.d.ts +62 -26
- package/dist/components/progress-bar/ProgressBar.d.ts +17 -13
- package/dist/components/progress-circle/ProgressCircle.d.ts +14 -15
- package/dist/components/radio/Radio.d.ts +46 -54
- package/dist/components/scroll-container/ScrollContainer.d.ts +10 -13
- package/dist/components/segmented-control/SegmentedControl.d.ts +20 -29
- package/dist/components/select/Select.d.ts +54 -135
- package/dist/components/select/SelectItem.d.ts +68 -0
- package/dist/components/select/selectContext.d.ts +61 -0
- package/dist/components/skeleton/Skeleton.d.ts +22 -0
- package/dist/components/slider/Slider.d.ts +24 -16
- package/dist/components/smart-filter/SmartFilter.d.ts +105 -0
- package/dist/components/smart-filter/model.d.ts +33 -0
- package/dist/components/spinner/Spinner.d.ts +22 -0
- package/dist/components/stepper/Stepper.d.ts +32 -42
- package/dist/components/switch/Switch.d.ts +19 -37
- package/dist/components/tabs/Tabs.d.ts +65 -38
- package/dist/components/tag-select/TagOptionMenu.d.ts +29 -0
- package/dist/components/tag-select/TagSelect.d.ts +15 -16
- package/dist/components/tag-select/useChipOverflow.d.ts +19 -0
- package/dist/components/textarea/Textarea.d.ts +16 -31
- package/dist/components/thumbnail/Thumbnail.d.ts +41 -0
- package/dist/components/timeline/Timeline.d.ts +46 -61
- package/dist/components/tooltip/Tooltip.d.ts +21 -17
- package/dist/components/typography/Typography.d.ts +5 -21
- package/dist/hooks/useControllableState.d.ts +0 -1
- package/dist/hooks/useEdgeOverflow.d.ts +12 -0
- package/dist/hooks/useEnterConfirm.d.ts +15 -0
- package/dist/hooks/useImageStatus.d.ts +19 -0
- package/dist/hooks/useInertSiblings.d.ts +9 -0
- package/dist/hooks/useMediaQuery.d.ts +7 -0
- package/dist/hooks/useMergedRefs.d.ts +6 -2
- package/dist/hooks/useModalLayer.d.ts +22 -0
- package/dist/hooks/usePosition.d.ts +46 -40
- package/dist/hooks/usePresence.d.ts +0 -1
- package/dist/hooks/useScrollLock.d.ts +3 -5
- package/dist/hooks/useStateSwap.d.ts +8 -0
- package/dist/hooks/useSwipeDismiss.d.ts +34 -0
- package/dist/icons/Icon.d.ts +24 -7
- package/dist/icons/index.d.ts +2 -44
- package/dist/icons/registry.d.ts +85 -0
- package/dist/index.css +7053 -6846
- package/dist/index.d.ts +0 -1
- package/dist/index.js +106 -13830
- package/dist/internal/AnchorRectContext.d.ts +12 -0
- package/dist/internal/ChoiceField.d.ts +34 -0
- package/dist/internal/ControlSizeContext.d.ts +6 -2
- package/dist/internal/FieldFrame.d.ts +47 -8
- package/dist/internal/HighlightMatch.d.ts +13 -0
- package/dist/internal/MenuGroup.d.ts +8 -0
- package/dist/internal/Portal.d.ts +0 -1
- package/dist/internal/VisuallyHidden.d.ts +11 -0
- package/dist/internal/context.d.ts +0 -1
- package/dist/internal/cx.d.ts +0 -1
- package/dist/internal/data-attributes.d.ts +0 -1
- package/dist/internal/fieldClasses.d.ts +9 -0
- package/dist/internal/formatLabel.d.ts +6 -0
- package/dist/internal/highlightTsxHtml.d.ts +1 -2
- package/dist/internal/iconBox.d.ts +9 -0
- package/dist/internal/iconLayout.d.ts +15 -0
- package/dist/internal/imageSlot.d.ts +29 -0
- package/dist/internal/layoutPxFromPrimitives.d.ts +2 -3
- package/dist/internal/listbox.d.ts +40 -0
- package/dist/internal/mergeRefs.d.ts +4 -2
- package/dist/internal/overlay/FloatingPanel.d.ts +36 -0
- package/dist/internal/overlay/focus.d.ts +14 -0
- package/dist/internal/overlay/layerStack.d.ts +41 -0
- package/dist/internal/overlay/useFloatingLayer.d.ts +70 -0
- package/dist/internal/polymorphic.d.ts +9 -0
- package/dist/internal/progressSegments.d.ts +63 -0
- package/dist/internal/rovingFocus.d.ts +18 -0
- package/dist/internal/scrollAncestors.d.ts +1 -2
- package/dist/internal/slot.d.ts +11 -5
- package/dist/internal/states.d.ts +3 -2
- package/dist/internal/swatch.d.ts +56 -0
- package/dist/internal/touchTarget.d.ts +4 -0
- package/dist/layout/app-header/AppHeader.d.ts +110 -0
- package/dist/layout/app-shell/AppShell.d.ts +47 -22
- package/dist/layout/bottom-nav/BottomNav.d.ts +80 -0
- package/dist/layout/index.d.ts +6 -3
- package/dist/layout/sidebar/Sidebar.d.ts +206 -35
- package/dist/theme/applyTheme.d.ts +0 -1
- package/dist/tokens/naming.d.ts +6 -0
- package/dist/tokens/primitives.d.ts +26 -80
- package/dist/tokens/semantic.d.ts +122 -25
- package/dist/tokens/themes/dark.d.ts +7 -1
- package/package.json +30 -24
- package/src/components/accordion/COMPONENT.md +91 -101
- package/src/components/accordion/examples/collapsible.tsx +27 -0
- package/src/components/accordion/examples/controlled.tsx +36 -0
- package/src/components/accordion/examples/examples.module.css +6 -39
- package/src/components/accordion/examples/multiple.tsx +31 -0
- package/src/components/accordion/examples/overview.tsx +39 -0
- package/src/components/accordion/examples/sizes.tsx +14 -25
- package/src/components/accordion/examples/states.tsx +23 -48
- package/src/components/accordion/examples/variants.tsx +35 -0
- package/src/components/accordion/examples/with-icon.tsx +47 -0
- package/src/components/avatar/COMPONENT.md +88 -153
- package/src/components/avatar/examples/examples.module.css +6 -44
- package/src/components/avatar/examples/overview.tsx +18 -0
- package/src/components/avatar/examples/presence.tsx +20 -17
- package/src/components/avatar/examples/sizes.tsx +8 -10
- package/src/components/avatar/examples/src-from-state.tsx +4 -5
- package/src/components/avatar/examples/states.tsx +17 -27
- package/src/components/avatar/examples/team-group.tsx +21 -0
- package/src/components/avatar/examples/variants.tsx +40 -0
- package/src/components/badge/COMPONENT.md +113 -122
- package/src/components/{tag → badge}/examples/applied-filters.tsx +10 -11
- package/src/components/badge/examples/examples.module.css +14 -59
- package/src/components/badge/examples/filter-values.tsx +39 -0
- package/src/components/badge/examples/in-controls.tsx +14 -26
- package/src/components/badge/examples/overview.tsx +13 -0
- package/src/components/badge/examples/sizes.tsx +8 -10
- package/src/components/badge/examples/states.tsx +35 -29
- package/src/components/badge/examples/variants.tsx +27 -36
- package/src/components/badge/examples/with-icon.tsx +50 -0
- package/src/components/banner/COMPONENT.md +89 -94
- package/src/components/banner/examples/dismissible.tsx +38 -0
- package/src/components/banner/examples/examples.module.css +6 -22
- package/src/components/banner/examples/narrow.tsx +23 -0
- package/src/components/banner/examples/overview.tsx +18 -0
- package/src/components/banner/examples/page-strip.tsx +53 -0
- package/src/components/banner/examples/sizes.tsx +22 -21
- package/src/components/banner/examples/structure.tsx +45 -0
- package/src/components/banner/examples/variants.tsx +28 -55
- package/src/components/breadcrumb/COMPONENT.md +55 -59
- package/src/components/breadcrumb/examples/ellipsis.tsx +12 -0
- package/src/components/breadcrumb/examples/examples.module.css +3 -52
- package/src/components/breadcrumb/examples/overflow.tsx +26 -0
- package/src/components/breadcrumb/examples/overview.tsx +12 -0
- package/src/components/breadcrumb/examples/sizes.tsx +11 -14
- package/src/components/breadcrumb/examples/with-icon.tsx +14 -0
- package/src/components/button/COMPONENT.md +65 -66
- package/src/components/button/examples/as-child.tsx +8 -32
- package/src/components/button/examples/examples.module.css +18 -76
- package/src/components/button/examples/in-form.tsx +20 -14
- package/src/components/button/examples/on-colored-host.tsx +29 -0
- package/src/components/button/examples/overview.tsx +13 -0
- package/src/components/button/examples/sizes.tsx +7 -9
- package/src/components/button/examples/states.tsx +18 -28
- package/src/components/button/examples/variants.tsx +31 -0
- package/src/components/button/examples/with-icon.tsx +35 -23
- package/src/components/button-group/COMPONENT.md +64 -55
- package/src/components/button-group/examples/controlled.tsx +3 -3
- package/src/components/button-group/examples/examples.module.css +4 -39
- package/src/components/button-group/examples/full-width.tsx +10 -14
- package/src/components/button-group/examples/in-form.tsx +3 -3
- package/src/components/button-group/examples/orientation.tsx +6 -8
- package/src/components/button-group/examples/overview.tsx +12 -0
- package/src/components/button-group/examples/sizes.tsx +8 -10
- package/src/components/button-group/examples/states.tsx +28 -7
- package/src/components/button-group/examples/with-icon.tsx +45 -0
- package/src/components/card/COMPONENT.md +99 -298
- package/src/components/card/examples/{content.tsx → content-templates.tsx} +23 -29
- package/src/components/card/examples/examples.module.css +0 -8
- package/src/components/card/examples/flat.tsx +9 -14
- package/src/components/card/examples/kpi-media.tsx +42 -0
- package/src/components/card/examples/narrow.tsx +47 -0
- package/src/components/card/examples/{settings.tsx → overview.tsx} +7 -8
- package/src/components/card/examples/panel-chart.tsx +26 -34
- package/src/components/card/examples/{metrics.tsx → variants.tsx} +12 -18
- package/src/components/checkbox/COMPONENT.md +92 -96
- package/src/components/checkbox/examples/controlled.tsx +41 -0
- package/src/components/checkbox/examples/examples.module.css +47 -43
- package/src/components/checkbox/examples/in-form.tsx +34 -0
- package/src/components/checkbox/examples/indicator.tsx +54 -0
- package/src/components/checkbox/examples/overview.tsx +10 -0
- package/src/components/checkbox/examples/sizes.tsx +5 -10
- package/src/components/checkbox/examples/states.tsx +42 -23
- package/src/components/checkbox/examples/without-label.tsx +3 -7
- package/src/components/code-block/COMPONENT.md +55 -57
- package/src/components/code-block/examples/color-scheme.tsx +4 -15
- package/src/components/code-block/examples/examples.module.css +9 -40
- package/src/components/code-block/examples/{long-lines.tsx → narrow.tsx} +3 -4
- package/src/components/code-block/examples/overview.tsx +19 -0
- package/src/components/code-block/examples/variants.tsx +12 -21
- package/src/components/color-picker/COMPONENT.md +196 -165
- package/src/components/color-picker/examples/controlled.tsx +37 -0
- package/src/components/color-picker/examples/examples.module.css +19 -88
- package/src/components/color-picker/examples/formats.tsx +13 -18
- package/src/components/color-picker/examples/in-form.tsx +44 -0
- package/src/components/color-picker/examples/overview.tsx +37 -0
- package/src/components/color-picker/examples/panel.tsx +12 -13
- package/src/components/color-picker/examples/presets-sizes.tsx +15 -20
- package/src/components/color-picker/examples/presets.tsx +33 -0
- package/src/components/color-picker/examples/sizes.tsx +26 -0
- package/src/components/color-picker/examples/states.tsx +4 -14
- package/src/components/color-picker/examples/validation.tsx +18 -0
- package/src/components/color-swatches/COMPONENT.md +145 -0
- package/src/components/color-swatches/examples/controlled.tsx +22 -0
- package/src/components/color-swatches/examples/examples.module.css +19 -0
- package/src/components/color-swatches/examples/in-form.tsx +35 -0
- package/src/components/color-swatches/examples/overview.tsx +6 -0
- package/src/components/color-swatches/examples/sizes.tsx +19 -0
- package/src/components/color-swatches/examples/states.tsx +20 -0
- package/src/components/color-swatches/examples/wrapping.tsx +12 -0
- package/src/components/command-menu/COMPONENT.md +117 -180
- package/src/components/command-menu/examples/controlled-open.tsx +29 -0
- package/src/components/command-menu/examples/controlled.tsx +19 -26
- package/src/components/command-menu/examples/dismiss.tsx +39 -0
- package/src/components/command-menu/examples/overview.tsx +61 -0
- package/src/components/command-menu/examples/sizes.tsx +30 -51
- package/src/components/command-menu/examples/states.tsx +6 -16
- package/src/components/command-menu/examples/structure.tsx +54 -0
- package/src/components/crossfade/COMPONENT.md +104 -0
- package/src/components/crossfade/examples/examples.module.css +65 -0
- package/src/components/crossfade/examples/overview.tsx +102 -0
- package/src/components/crossfade/examples/record-switch.tsx +67 -0
- package/src/components/data-table/COMPONENT.md +181 -182
- package/src/components/data-table/examples/appearance.tsx +31 -34
- package/src/components/data-table/examples/columns-visibility.tsx +167 -0
- package/src/components/data-table/examples/content-width.tsx +46 -26
- package/src/components/data-table/examples/controlled.tsx +56 -0
- package/src/components/data-table/examples/detail-panel.tsx +23 -28
- package/src/components/data-table/examples/examples.module.css +20 -91
- package/src/components/data-table/examples/infinite-scroll.tsx +17 -18
- package/src/components/data-table/examples/narrow.tsx +28 -38
- package/src/components/data-table/examples/nested-rows.tsx +32 -54
- package/src/components/data-table/examples/numeric.tsx +10 -19
- package/src/components/data-table/examples/overview.tsx +54 -0
- package/src/components/data-table/examples/selection.tsx +11 -15
- package/src/components/data-table/examples/sizes.tsx +22 -33
- package/src/components/data-table/examples/states.tsx +23 -24
- package/src/components/data-table/examples/sticky.tsx +17 -24
- package/src/components/data-table/examples/toolbar.tsx +21 -23
- package/src/components/datepicker/COMPONENT.md +152 -164
- package/src/components/datepicker/examples/controlled-open.tsx +32 -0
- package/src/components/datepicker/examples/controlled.tsx +39 -0
- package/src/components/datepicker/examples/examples.module.css +9 -23
- package/src/components/datepicker/examples/in-form.tsx +32 -45
- package/src/components/datepicker/examples/inline-panel.tsx +3 -3
- package/src/components/datepicker/examples/narrow.tsx +1 -1
- package/src/components/datepicker/examples/overview.tsx +6 -0
- package/src/components/datepicker/examples/range-presets.tsx +6 -5
- package/src/components/datepicker/examples/sizes.tsx +7 -10
- package/src/components/datepicker/examples/states.tsx +9 -30
- package/src/components/datepicker/examples/validation.tsx +26 -0
- package/src/components/datepicker/examples/yearless.tsx +9 -8
- package/src/components/digit-input/COMPONENT.md +96 -58
- package/src/components/digit-input/examples/controlled.tsx +6 -15
- package/src/components/digit-input/examples/examples.module.css +13 -38
- package/src/components/digit-input/examples/full-width.tsx +13 -0
- package/src/components/digit-input/examples/grouped.tsx +11 -0
- package/src/components/digit-input/examples/in-form.tsx +32 -0
- package/src/components/digit-input/examples/on-complete.tsx +20 -0
- package/src/components/digit-input/examples/overview.tsx +6 -0
- package/src/components/digit-input/examples/sizes.tsx +5 -17
- package/src/components/digit-input/examples/states.tsx +6 -50
- package/src/components/digit-input/examples/validation.tsx +17 -0
- package/src/components/divider/COMPONENT.md +62 -53
- package/src/components/divider/examples/align.tsx +14 -0
- package/src/components/divider/examples/examples.module.css +6 -20
- package/src/components/divider/examples/or-separator.tsx +19 -0
- package/src/components/divider/examples/overview.tsx +30 -0
- package/src/components/divider/examples/sizes.tsx +11 -10
- package/src/components/divider/examples/vertical.tsx +21 -0
- package/src/components/divider/examples/with-icon.tsx +26 -0
- package/src/components/dnd/COMPONENT.md +197 -0
- package/src/components/dnd/examples/board.tsx +83 -0
- package/src/components/dnd/examples/drop-zones.tsx +82 -0
- package/src/components/dnd/examples/examples.module.css +89 -0
- package/src/components/dnd/examples/handle.tsx +53 -0
- package/src/components/dnd/examples/narrow.tsx +42 -0
- package/src/components/dnd/examples/overview.tsx +45 -0
- package/src/components/drawer/COMPONENT.md +114 -105
- package/src/components/drawer/examples/controlled-open.tsx +33 -0
- package/src/components/drawer/examples/date-sheet.tsx +41 -0
- package/src/components/drawer/examples/dismiss.tsx +55 -0
- package/src/components/drawer/examples/examples.module.css +8 -24
- package/src/components/drawer/examples/in-form.tsx +82 -0
- package/src/components/drawer/examples/long-content.tsx +40 -0
- package/src/components/drawer/examples/overview.tsx +48 -0
- package/src/components/drawer/examples/{variants-sides.tsx → placement.tsx} +13 -14
- package/src/components/drawer/examples/sizes.tsx +9 -15
- package/src/components/drawer/examples/structure.tsx +35 -0
- package/src/components/dropdown/COMPONENT.md +119 -148
- package/src/components/dropdown/examples/checkbox-items.tsx +48 -0
- package/src/components/dropdown/examples/controlled-open.tsx +32 -0
- package/src/components/dropdown/examples/dismiss.tsx +17 -0
- package/src/components/dropdown/examples/examples.module.css +11 -45
- package/src/components/dropdown/examples/long-list.tsx +42 -0
- package/src/components/dropdown/examples/{full-width.tsx → match-trigger-width.tsx} +5 -4
- package/src/components/dropdown/examples/overview.tsx +41 -0
- package/src/components/dropdown/examples/placement.tsx +16 -13
- package/src/components/dropdown/examples/sizes.tsx +18 -15
- package/src/components/dropdown/examples/states.tsx +21 -29
- package/src/components/dropdown/examples/structure.tsx +56 -0
- package/src/components/empty-page/COMPONENT.md +72 -76
- package/src/components/empty-page/examples/compact.tsx +23 -0
- package/src/components/empty-page/examples/data-region.tsx +8 -11
- package/src/components/empty-page/examples/examples.module.css +22 -25
- package/src/components/empty-page/examples/icon-tones.tsx +5 -6
- package/src/components/empty-page/examples/narrow.tsx +26 -0
- package/src/components/empty-page/examples/{no-results.tsx → overview.tsx} +4 -5
- package/src/components/empty-page/examples/sizes.tsx +14 -20
- package/src/components/example-frame/COMPONENT.md +64 -66
- package/src/components/example-frame/examples/controlled.tsx +42 -0
- package/src/components/example-frame/examples/overview.tsx +16 -0
- package/src/components/file-upload/COMPONENT.md +128 -186
- package/src/components/file-upload/examples/avatar-upload.tsx +7 -12
- package/src/components/file-upload/examples/custom-body.tsx +44 -0
- package/src/components/file-upload/examples/examples.module.css +46 -64
- package/src/components/file-upload/examples/in-form.tsx +76 -0
- package/src/components/file-upload/examples/narrow.tsx +17 -0
- package/src/components/file-upload/examples/overview.tsx +52 -0
- package/src/components/file-upload/examples/sizes.tsx +16 -37
- package/src/components/file-upload/examples/states.tsx +6 -98
- package/src/components/file-upload/examples/upload-progress.tsx +39 -0
- package/src/components/file-upload/examples/validation.tsx +19 -0
- package/src/components/file-upload/examples/variants.tsx +5 -18
- package/src/components/hint/COMPONENT.md +42 -48
- package/src/components/hint/examples/examples.module.css +3 -45
- package/src/components/hint/examples/hint-or-error.tsx +5 -5
- package/src/components/hint/examples/overview.tsx +34 -0
- package/src/components/hint/examples/sizes.tsx +8 -10
- package/src/components/hint/examples/states.tsx +21 -14
- package/src/components/hint/examples/with-icon.tsx +31 -0
- package/src/components/input/COMPONENT.md +70 -88
- package/src/components/input/examples/affixes.tsx +22 -0
- package/src/components/input/examples/controlled.tsx +9 -10
- package/src/components/input/examples/examples.module.css +3 -116
- package/src/components/input/examples/in-form.tsx +35 -14
- package/src/components/input/examples/overview.tsx +12 -0
- package/src/components/input/examples/sizes.tsx +6 -11
- package/src/components/input/examples/states.tsx +6 -23
- package/src/components/input/examples/validation.tsx +35 -0
- package/src/components/input/examples/with-icon.tsx +25 -0
- package/src/components/input/examples/{search-without-focus-ring.tsx → without-focus-ring.tsx} +5 -5
- package/src/components/kanban/COMPONENT.md +181 -0
- package/src/components/kanban/examples/controlled.tsx +78 -0
- package/src/components/kanban/examples/examples.module.css +31 -0
- package/src/components/kanban/examples/limits.tsx +58 -0
- package/src/components/kanban/examples/narrow.tsx +76 -0
- package/src/components/kanban/examples/overview.tsx +130 -0
- package/src/components/kanban/examples/states.tsx +75 -0
- package/src/components/kanban/examples/structure.tsx +76 -0
- package/src/components/kbd/COMPONENT.md +50 -65
- package/src/components/kbd/examples/examples.module.css +11 -41
- package/src/components/kbd/examples/in-controls.tsx +25 -31
- package/src/components/kbd/examples/overview.tsx +24 -0
- package/src/components/kbd/examples/shortcut-list.tsx +12 -12
- package/src/components/kbd/examples/sizes.tsx +8 -13
- package/src/components/label/COMPONENT.md +45 -44
- package/src/components/label/examples/examples.module.css +8 -29
- package/src/components/label/examples/overview.tsx +17 -0
- package/src/components/label/examples/sizes.tsx +9 -13
- package/src/components/label/examples/states.tsx +17 -14
- package/src/components/label/examples/structure.tsx +32 -0
- package/src/components/label/examples/with-icon.tsx +25 -17
- package/src/components/link-button/COMPONENT.md +56 -39
- package/src/components/link-button/examples/as-child.tsx +18 -0
- package/src/components/link-button/examples/external-link.tsx +6 -6
- package/src/components/link-button/examples/overview.tsx +11 -0
- package/src/components/link-button/examples/sizes.tsx +9 -11
- package/src/components/link-button/examples/states.tsx +25 -12
- package/src/components/link-button/examples/variants.tsx +21 -0
- package/src/components/link-button/examples/with-icon.tsx +21 -13
- package/src/components/login-form/COMPONENT.md +162 -0
- package/src/components/login-form/examples/examples.module.css +39 -0
- package/src/components/login-form/examples/forgot-password.tsx +39 -0
- package/src/components/login-form/examples/narrow.tsx +32 -0
- package/src/components/login-form/examples/overview.tsx +58 -0
- package/src/components/login-form/examples/register.tsx +85 -0
- package/src/components/login-form/examples/reset-password.tsx +60 -0
- package/src/components/login-form/examples/sizes.tsx +38 -0
- package/src/components/login-form/examples/states.tsx +75 -0
- package/src/components/login-form/examples/structure.tsx +28 -0
- package/src/components/login-form/examples/verification-code.tsx +57 -0
- package/src/components/modal/COMPONENT.md +71 -88
- package/src/components/modal/examples/{controlled.tsx → controlled-open.tsx} +6 -12
- package/src/components/modal/examples/custom-container.tsx +29 -0
- package/src/components/modal/examples/dismiss.tsx +54 -0
- package/src/components/modal/examples/examples.module.css +4 -20
- package/src/components/modal/examples/in-form.tsx +78 -0
- package/src/components/modal/examples/long-content.tsx +52 -0
- package/src/components/modal/examples/overview.tsx +35 -0
- package/src/components/modal/examples/sizes.tsx +7 -9
- package/src/components/modal/examples/structure.tsx +53 -0
- package/src/components/native-select/COMPONENT.md +132 -0
- package/src/components/native-select/examples/controlled.tsx +26 -0
- package/src/components/native-select/examples/examples.module.css +14 -0
- package/src/components/native-select/examples/in-form.tsx +43 -0
- package/src/components/native-select/examples/option-groups.tsx +17 -0
- package/src/components/native-select/examples/overview.tsx +16 -0
- package/src/components/native-select/examples/sizes.tsx +18 -0
- package/src/components/native-select/examples/states.tsx +21 -0
- package/src/components/native-select/examples/validation.tsx +26 -0
- package/src/components/notification/COMPONENT.md +108 -122
- package/src/components/notification/examples/dismiss.tsx +50 -0
- package/src/components/notification/examples/examples.module.css +10 -23
- package/src/components/notification/examples/in-form.tsx +64 -0
- package/src/components/notification/examples/overview.tsx +24 -0
- package/src/components/notification/examples/placement.tsx +66 -0
- package/src/components/notification/examples/sizes.tsx +11 -18
- package/src/components/notification/examples/stacking.tsx +45 -0
- package/src/components/notification/examples/structure.tsx +20 -0
- package/src/components/notification/examples/tones.tsx +14 -26
- package/src/components/page-content/COMPONENT.md +50 -75
- package/src/components/page-content/examples/examples.module.css +4 -8
- package/src/components/page-content/examples/narrow.tsx +25 -0
- package/src/components/page-content/examples/overview.tsx +41 -0
- package/src/components/page-content/examples/variants.tsx +39 -0
- package/src/components/page-toolbar/COMPONENT.md +142 -0
- package/src/components/page-toolbar/examples/examples.module.css +16 -0
- package/src/components/page-toolbar/examples/narrow.tsx +103 -0
- package/src/components/page-toolbar/examples/overview.tsx +113 -0
- package/src/components/page-toolbar/examples/save-changes.tsx +40 -0
- package/src/components/page-toolbar/examples/without-search.tsx +60 -0
- package/src/components/pagination/COMPONENT.md +73 -64
- package/src/components/pagination/examples/controlled.tsx +51 -0
- package/src/components/pagination/examples/examples.module.css +6 -55
- package/src/components/pagination/examples/narrow.tsx +25 -0
- package/src/components/pagination/examples/overflow.tsx +23 -0
- package/src/components/pagination/examples/overview.tsx +6 -0
- package/src/components/pagination/examples/sizes.tsx +10 -18
- package/src/components/popover/COMPONENT.md +89 -99
- package/src/components/popover/examples/controlled-open.tsx +32 -0
- package/src/components/popover/examples/dismiss.tsx +49 -0
- package/src/components/popover/examples/examples.module.css +21 -41
- package/src/components/popover/examples/flush.tsx +47 -0
- package/src/components/popover/examples/in-form.tsx +54 -0
- package/src/components/popover/examples/{full-width.tsx → match-trigger-width.tsx} +7 -7
- package/src/components/popover/examples/overview.tsx +43 -0
- package/src/components/popover/examples/placement.tsx +17 -15
- package/src/components/popover/examples/sizes.tsx +12 -9
- package/src/components/popover/examples/structure.tsx +50 -0
- package/src/components/progress-bar/COMPONENT.md +103 -62
- package/src/components/progress-bar/examples/custom-max.tsx +12 -0
- package/src/components/progress-bar/examples/examples.module.css +4 -34
- package/src/components/progress-bar/examples/overview.tsx +12 -0
- package/src/components/progress-bar/examples/segments.tsx +32 -0
- package/src/components/progress-bar/examples/sizes.tsx +11 -8
- package/src/components/progress-bar/examples/variants.tsx +34 -0
- package/src/components/progress-circle/COMPONENT.md +102 -61
- package/src/components/progress-circle/examples/examples.module.css +2 -39
- package/src/components/progress-circle/examples/inner-content.tsx +35 -0
- package/src/components/progress-circle/examples/overview.tsx +10 -0
- package/src/components/progress-circle/examples/segments.tsx +64 -0
- package/src/components/progress-circle/examples/sizes.tsx +10 -12
- package/src/components/progress-circle/examples/variants.tsx +28 -0
- package/src/components/radio/COMPONENT.md +93 -114
- package/src/components/radio/examples/controlled.tsx +30 -0
- package/src/components/radio/examples/group.tsx +23 -0
- package/src/components/radio/examples/orientation.tsx +34 -0
- package/src/components/radio/examples/overview.tsx +18 -0
- package/src/components/radio/examples/sizes.tsx +7 -12
- package/src/components/radio/examples/states.tsx +42 -30
- package/src/components/scroll-container/COMPONENT.md +57 -29
- package/src/components/scroll-container/examples/edge-fade.tsx +53 -0
- package/src/components/scroll-container/examples/examples.module.css +7 -7
- package/src/components/scroll-container/examples/overscroll.tsx +27 -0
- package/src/components/scroll-container/examples/overview.tsx +27 -0
- package/src/components/scroll-container/examples/variants.tsx +54 -0
- package/src/components/segmented-control/COMPONENT.md +93 -107
- package/src/components/segmented-control/examples/colors.tsx +8 -13
- package/src/components/segmented-control/examples/controlled.tsx +10 -6
- package/src/components/segmented-control/examples/examples.module.css +2 -88
- package/src/components/segmented-control/examples/full-width.tsx +7 -44
- package/src/components/segmented-control/examples/overview.tsx +12 -0
- package/src/components/segmented-control/examples/scroll.tsx +16 -0
- package/src/components/segmented-control/examples/sizes.tsx +8 -20
- package/src/components/segmented-control/examples/states.tsx +28 -34
- package/src/components/segmented-control/examples/two-line.tsx +17 -104
- package/src/components/segmented-control/examples/with-icon.tsx +52 -0
- package/src/components/select/COMPONENT.md +155 -208
- package/src/components/select/examples/clearable.tsx +23 -0
- package/src/components/select/examples/controlled-open.tsx +30 -0
- package/src/components/select/examples/controlled.tsx +17 -10
- package/src/components/select/examples/examples.module.css +18 -38
- package/src/components/select/examples/in-form.tsx +59 -70
- package/src/components/select/examples/multiple.tsx +21 -33
- package/src/components/select/examples/overview.tsx +17 -0
- package/src/components/select/examples/rich-options.tsx +43 -69
- package/src/components/select/examples/searchable.tsx +42 -0
- package/src/components/select/examples/sizes.tsx +13 -17
- package/src/components/select/examples/states.tsx +34 -48
- package/src/components/select/examples/validation.tsx +41 -0
- package/src/components/select/examples/with-icon.tsx +35 -0
- package/src/components/skeleton/COMPONENT.md +104 -0
- package/src/components/skeleton/examples/examples.module.css +89 -0
- package/src/components/skeleton/examples/form.tsx +20 -0
- package/src/components/skeleton/examples/overview.tsx +21 -0
- package/src/components/skeleton/examples/sizes.tsx +24 -0
- package/src/components/skeleton/examples/with-crossfade.tsx +68 -0
- package/src/components/slider/COMPONENT.md +105 -68
- package/src/components/slider/examples/controlled.tsx +26 -30
- package/src/components/slider/examples/examples.module.css +8 -32
- package/src/components/slider/examples/hint-and-error.tsx +33 -0
- package/src/components/slider/examples/overview.tsx +6 -0
- package/src/components/slider/examples/range-step.tsx +7 -17
- package/src/components/slider/examples/sizes.tsx +8 -6
- package/src/components/slider/examples/states.tsx +11 -8
- package/src/components/slider/examples/value-format.tsx +13 -25
- package/src/components/slider/examples/variants.tsx +23 -0
- package/src/components/smart-filter/COMPONENT.md +184 -0
- package/src/components/smart-filter/examples/controlled.tsx +48 -0
- package/src/components/smart-filter/examples/examples.module.css +56 -0
- package/src/components/smart-filter/examples/many-values.tsx +53 -0
- package/src/components/smart-filter/examples/narrow.tsx +38 -0
- package/src/components/smart-filter/examples/overview.tsx +109 -0
- package/src/components/smart-filter/examples/sizes.tsx +33 -0
- package/src/components/spinner/COMPONENT.md +112 -0
- package/src/components/spinner/examples/examples.module.css +20 -0
- package/src/components/spinner/examples/loading-region.tsx +22 -0
- package/src/components/spinner/examples/overview.tsx +15 -0
- package/src/components/spinner/examples/sizes.tsx +19 -0
- package/src/components/spinner/examples/variants.tsx +19 -0
- package/src/components/stepper/COMPONENT.md +83 -78
- package/src/components/stepper/examples/controlled.tsx +46 -0
- package/src/components/stepper/examples/examples.module.css +9 -40
- package/src/components/stepper/examples/narrow.tsx +11 -19
- package/src/components/stepper/examples/orientation.tsx +21 -59
- package/src/components/stepper/examples/overview.tsx +28 -0
- package/src/components/stepper/examples/sizes.tsx +19 -28
- package/src/components/stepper/examples/states.tsx +20 -21
- package/src/components/stepper/examples/with-icon.tsx +29 -0
- package/src/components/switch/COMPONENT.md +75 -94
- package/src/components/switch/examples/controlled.tsx +8 -6
- package/src/components/switch/examples/examples.module.css +13 -45
- package/src/components/switch/examples/in-form.tsx +20 -24
- package/src/components/switch/examples/overview.tsx +10 -0
- package/src/components/switch/examples/settings-row.tsx +14 -22
- package/src/components/switch/examples/sizes.tsx +5 -10
- package/src/components/switch/examples/states.tsx +37 -25
- package/src/components/tabs/COMPONENT.md +156 -86
- package/src/components/tabs/examples/closable.tsx +48 -0
- package/src/components/tabs/examples/controlled.tsx +14 -20
- package/src/components/tabs/examples/examples.module.css +13 -93
- package/src/components/tabs/examples/orientation.tsx +40 -0
- package/src/components/tabs/examples/overflow.tsx +60 -0
- package/src/components/tabs/examples/overview.tsx +30 -0
- package/src/components/tabs/examples/sizes.tsx +19 -19
- package/src/components/tabs/examples/states.tsx +20 -55
- package/src/components/tabs/examples/two-line.tsx +22 -29
- package/src/components/tabs/examples/variants.tsx +40 -0
- package/src/components/tabs/examples/with-icon.tsx +44 -0
- package/src/components/tag-select/COMPONENT.md +119 -122
- package/src/components/tag-select/examples/controlled-open.tsx +29 -0
- package/src/components/tag-select/examples/controlled.tsx +26 -0
- package/src/components/tag-select/examples/creatable.tsx +28 -0
- package/src/components/tag-select/examples/examples.module.css +3 -22
- package/src/components/tag-select/examples/in-form.tsx +44 -41
- package/src/components/tag-select/examples/manage-tags.tsx +20 -39
- package/src/components/tag-select/examples/many-tags.tsx +20 -0
- package/src/components/tag-select/examples/overview.tsx +21 -0
- package/src/components/tag-select/examples/sizes.tsx +7 -10
- package/src/components/tag-select/examples/states.tsx +11 -36
- package/src/components/tag-select/examples/validation.tsx +35 -0
- package/src/components/textarea/COMPONENT.md +50 -50
- package/src/components/textarea/examples/auto-resize.tsx +21 -0
- package/src/components/textarea/examples/controlled.tsx +12 -16
- package/src/components/textarea/examples/examples.module.css +15 -48
- package/src/components/textarea/examples/in-form.tsx +52 -48
- package/src/components/textarea/examples/overview.tsx +12 -0
- package/src/components/textarea/examples/sizes.tsx +6 -7
- package/src/components/textarea/examples/states.tsx +9 -13
- package/src/components/textarea/examples/validation.tsx +34 -0
- package/src/components/textarea/examples/without-focus-ring.tsx +12 -0
- package/src/components/thumbnail/COMPONENT.md +150 -0
- package/src/components/thumbnail/examples/examples.module.css +45 -0
- package/src/components/thumbnail/examples/full-width.tsx +48 -0
- package/src/components/thumbnail/examples/overview.tsx +31 -0
- package/src/components/thumbnail/examples/ratios.tsx +25 -0
- package/src/components/thumbnail/examples/ring.tsx +29 -0
- package/src/components/thumbnail/examples/sizes.tsx +23 -0
- package/src/components/thumbnail/examples/states.tsx +38 -0
- package/src/components/thumbnail/examples/variants.tsx +28 -0
- package/src/components/timeline/COMPONENT.md +92 -203
- package/src/components/timeline/examples/examples.module.css +5 -20
- package/src/components/timeline/examples/links.tsx +28 -0
- package/src/components/timeline/examples/narrow.tsx +30 -38
- package/src/components/timeline/examples/{activity-feed.tsx → overview.tsx} +9 -17
- package/src/components/timeline/examples/sizes.tsx +22 -28
- package/src/components/timeline/examples/{service-history.tsx → structure.tsx} +10 -8
- package/src/components/timeline/examples/{colors-and-tones.tsx → variants.tsx} +11 -16
- package/src/components/tooltip/COMPONENT.md +74 -62
- package/src/components/tooltip/examples/{controlled.tsx → controlled-open.tsx} +5 -7
- package/src/components/tooltip/examples/delay.tsx +19 -28
- package/src/components/tooltip/examples/disabled-trigger.tsx +18 -0
- package/src/components/tooltip/examples/examples.module.css +3 -33
- package/src/components/tooltip/examples/long-content.tsx +12 -15
- package/src/components/tooltip/examples/overview.tsx +17 -0
- package/src/components/tooltip/examples/placement.tsx +30 -0
- package/src/components/tooltip/examples/sizes.tsx +12 -15
- package/src/components/tooltip/examples/toolbar.tsx +35 -0
- package/src/components/typography/COMPONENT.md +68 -99
- package/src/components/typography/examples/article.tsx +23 -36
- package/src/components/typography/examples/examples.module.css +20 -54
- package/src/components/typography/examples/inline-emphasis.tsx +20 -0
- package/src/components/typography/examples/overview.tsx +20 -0
- package/src/components/typography/examples/semantic-tag.tsx +17 -0
- package/src/components/typography/examples/truncate.tsx +7 -7
- package/src/components/typography/examples/variants.tsx +43 -42
- package/src/components/typography/examples/weights.tsx +31 -0
- package/src/layout/app-header/COMPONENT.md +178 -0
- package/src/layout/app-header/examples/breadcrumbs.tsx +36 -0
- package/src/layout/app-header/examples/examples.module.css +47 -0
- package/src/layout/app-header/examples/in-app-shell.tsx +70 -0
- package/src/layout/app-header/examples/narrow.tsx +29 -0
- package/src/layout/app-header/examples/overview.tsx +36 -0
- package/src/layout/app-shell/COMPONENT.md +63 -63
- package/src/layout/app-shell/examples/contained.tsx +5 -5
- package/src/layout/app-shell/examples/examples.module.css +24 -0
- package/src/layout/app-shell/examples/footer.tsx +59 -0
- package/src/layout/app-shell/examples/overview.tsx +83 -0
- package/src/layout/app-shell/examples/template.tsx +54 -0
- package/src/layout/bottom-nav/COMPONENT.md +153 -0
- package/src/layout/bottom-nav/examples/examples.module.css +39 -0
- package/src/layout/bottom-nav/examples/floating.tsx +89 -0
- package/src/layout/bottom-nav/examples/icon-only.tsx +41 -0
- package/src/layout/bottom-nav/examples/in-app-shell.tsx +64 -0
- package/src/layout/bottom-nav/examples/overview.tsx +44 -0
- package/src/layout/bottom-nav/examples/router.tsx +31 -0
- package/src/layout/bottom-nav/examples/structure.tsx +47 -0
- package/src/layout/sidebar/COMPONENT.md +304 -111
- package/src/layout/sidebar/examples/account.tsx +88 -0
- package/src/layout/sidebar/examples/brand-header.tsx +45 -0
- package/src/layout/sidebar/examples/collapsible-groups.tsx +77 -0
- package/src/layout/sidebar/examples/controlled-open.tsx +55 -0
- package/src/layout/sidebar/examples/controlled.tsx +68 -0
- package/src/layout/sidebar/examples/examples.module.css +17 -3
- package/src/layout/sidebar/examples/nested-items.tsx +74 -0
- package/src/layout/sidebar/examples/overview.tsx +126 -0
- package/src/layout/sidebar/examples/router.tsx +19 -13
- package/src/layout/sidebar/examples/sizes.tsx +17 -12
- package/src/layout/sidebar/examples/structure.tsx +81 -0
- package/src/styles/fonts.css +4 -0
- package/src/styles/globals.css +18 -29
- package/src/styles/reset.css +2 -0
- package/src/styles/theme-dark.css +6 -0
- package/src/styles/theme-light.css +58 -23
- package/src/styles/tokens.css +11 -77
- package/dist/components/accordion/Accordion.d.ts.map +0 -1
- package/dist/components/avatar/Avatar.d.ts.map +0 -1
- package/dist/components/badge/Badge.d.ts.map +0 -1
- package/dist/components/badge/tier.d.ts.map +0 -1
- package/dist/components/banner/Banner.d.ts.map +0 -1
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +0 -1
- package/dist/components/button/Button.d.ts.map +0 -1
- package/dist/components/button-group/ButtonGroup.d.ts.map +0 -1
- package/dist/components/card/Card.d.ts.map +0 -1
- package/dist/components/checkbox/Checkbox.d.ts.map +0 -1
- package/dist/components/code-block/CodeBlock.d.ts.map +0 -1
- package/dist/components/color-picker/ColorPicker.d.ts.map +0 -1
- package/dist/components/color-picker/ColorPresets.d.ts.map +0 -1
- package/dist/components/command-menu/CommandMenu.d.ts.map +0 -1
- package/dist/components/data-table/DataTable.d.ts.map +0 -1
- package/dist/components/datepicker/Datepicker.d.ts.map +0 -1
- package/dist/components/datepicker/datepickerModel.d.ts.map +0 -1
- package/dist/components/digit-input/DigitInput.d.ts.map +0 -1
- package/dist/components/divider/Divider.d.ts.map +0 -1
- package/dist/components/drawer/Drawer.d.ts.map +0 -1
- package/dist/components/dropdown/Dropdown.d.ts.map +0 -1
- package/dist/components/dropdown/dropdownGeometry.d.ts +0 -10
- package/dist/components/dropdown/dropdownGeometry.d.ts.map +0 -1
- package/dist/components/dropdown/menuKeyboard.d.ts +0 -4
- package/dist/components/dropdown/menuKeyboard.d.ts.map +0 -1
- package/dist/components/dropdown/useDropdownPosition.d.ts +0 -18
- package/dist/components/dropdown/useDropdownPosition.d.ts.map +0 -1
- package/dist/components/empty-page/EmptyPage.d.ts.map +0 -1
- package/dist/components/example-frame/ExampleFrame.d.ts.map +0 -1
- package/dist/components/file-upload/FileUpload.d.ts.map +0 -1
- package/dist/components/hint/Hint.d.ts.map +0 -1
- package/dist/components/index.css +0 -11181
- package/dist/components/index.css.map +0 -7
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -13833
- package/dist/components/index.js.map +0 -7
- package/dist/components/input/Input.d.ts.map +0 -1
- package/dist/components/kbd/Kbd.d.ts.map +0 -1
- package/dist/components/label/Label.d.ts.map +0 -1
- package/dist/components/link-button/LinkButton.d.ts.map +0 -1
- package/dist/components/modal/DialogParts.d.ts.map +0 -1
- package/dist/components/modal/Modal.d.ts.map +0 -1
- package/dist/components/modal/useInertSiblings.d.ts +0 -7
- package/dist/components/modal/useInertSiblings.d.ts.map +0 -1
- package/dist/components/notification/Notification.d.ts.map +0 -1
- package/dist/components/notification/NotificationStore.d.ts.map +0 -1
- package/dist/components/page-content/PageContent.d.ts.map +0 -1
- package/dist/components/pagination/Pagination.d.ts.map +0 -1
- package/dist/components/popover/Popover.d.ts.map +0 -1
- package/dist/components/popover/popoverGeometry.d.ts +0 -6
- package/dist/components/popover/popoverGeometry.d.ts.map +0 -1
- package/dist/components/popover/usePopoverPosition.d.ts +0 -18
- package/dist/components/popover/usePopoverPosition.d.ts.map +0 -1
- package/dist/components/progress-bar/ProgressBar.d.ts.map +0 -1
- package/dist/components/progress-circle/ProgressCircle.d.ts.map +0 -1
- package/dist/components/radio/Radio.d.ts.map +0 -1
- package/dist/components/scroll-container/ScrollContainer.d.ts.map +0 -1
- package/dist/components/segmented-control/SegmentedControl.d.ts.map +0 -1
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +0 -29
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts.map +0 -1
- package/dist/components/select/Select.d.ts.map +0 -1
- package/dist/components/select/selectIcons.d.ts +0 -15
- package/dist/components/select/selectIcons.d.ts.map +0 -1
- package/dist/components/select/selectListbox.d.ts +0 -13
- package/dist/components/select/selectListbox.d.ts.map +0 -1
- package/dist/components/slider/Slider.d.ts.map +0 -1
- package/dist/components/stepper/Stepper.d.ts.map +0 -1
- package/dist/components/switch/Switch.d.ts.map +0 -1
- package/dist/components/tabs/Tabs.d.ts.map +0 -1
- package/dist/components/tag/Tag.d.ts +0 -47
- package/dist/components/tag/Tag.d.ts.map +0 -1
- package/dist/components/tag-select/TagSelect.d.ts.map +0 -1
- package/dist/components/textarea/Textarea.d.ts.map +0 -1
- package/dist/components/timeline/Timeline.d.ts.map +0 -1
- package/dist/components/tooltip/Tooltip.d.ts.map +0 -1
- package/dist/components/typography/Typography.d.ts.map +0 -1
- package/dist/hooks/useControllableState.d.ts.map +0 -1
- package/dist/hooks/useEscapeKey.d.ts +0 -7
- package/dist/hooks/useEscapeKey.d.ts.map +0 -1
- package/dist/hooks/useFieldIds.d.ts +0 -17
- package/dist/hooks/useFieldIds.d.ts.map +0 -1
- package/dist/hooks/useFocusTrap.d.ts +0 -20
- package/dist/hooks/useFocusTrap.d.ts.map +0 -1
- package/dist/hooks/useMergedRefs.d.ts.map +0 -1
- package/dist/hooks/useModalKeyboard.d.ts +0 -14
- package/dist/hooks/useModalKeyboard.d.ts.map +0 -1
- package/dist/hooks/useOutsideClick.d.ts +0 -26
- package/dist/hooks/useOutsideClick.d.ts.map +0 -1
- package/dist/hooks/useOverlayModal.d.ts +0 -7
- package/dist/hooks/useOverlayModal.d.ts.map +0 -1
- package/dist/hooks/usePosition.d.ts.map +0 -1
- package/dist/hooks/usePresence.d.ts.map +0 -1
- package/dist/hooks/useResponsiveMonths.d.ts +0 -18
- package/dist/hooks/useResponsiveMonths.d.ts.map +0 -1
- package/dist/hooks/useScrollLock.d.ts.map +0 -1
- package/dist/icons/Icon.d.ts.map +0 -1
- package/dist/icons/index.d.ts.map +0 -1
- package/dist/index.css.map +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -7
- package/dist/internal/ControlSizeContext.d.ts.map +0 -1
- package/dist/internal/DividerContentContext.d.ts +0 -4
- package/dist/internal/DividerContentContext.d.ts.map +0 -1
- package/dist/internal/FieldFrame.d.ts.map +0 -1
- package/dist/internal/OverlayPortalLayerContext.d.ts +0 -13
- package/dist/internal/OverlayPortalLayerContext.d.ts.map +0 -1
- package/dist/internal/Portal.d.ts.map +0 -1
- package/dist/internal/context.d.ts.map +0 -1
- package/dist/internal/cx.d.ts.map +0 -1
- package/dist/internal/data-attributes.d.ts.map +0 -1
- package/dist/internal/highlightTsxHtml.d.ts.map +0 -1
- package/dist/internal/layoutPxFromPrimitives.d.ts.map +0 -1
- package/dist/internal/mergeRefs.d.ts.map +0 -1
- package/dist/internal/runtimeUnits.d.ts +0 -3
- package/dist/internal/runtimeUnits.d.ts.map +0 -1
- package/dist/internal/scrollAncestors.d.ts.map +0 -1
- package/dist/internal/slot.d.ts.map +0 -1
- package/dist/internal/states.d.ts.map +0 -1
- package/dist/internal/useFieldDescriptions.d.ts +0 -18
- package/dist/internal/useFieldDescriptions.d.ts.map +0 -1
- package/dist/layout/app-shell/AppShell.d.ts.map +0 -1
- package/dist/layout/index.d.ts.map +0 -1
- package/dist/layout/sidebar/Sidebar.d.ts.map +0 -1
- package/dist/theme/applyTheme.d.ts.map +0 -1
- package/dist/tokens/primitives.d.ts.map +0 -1
- package/dist/tokens/semantic.d.ts.map +0 -1
- package/dist/tokens/themes/dark.d.ts.map +0 -1
- package/dist/tokens/themes/light.d.ts +0 -3
- package/dist/tokens/themes/light.d.ts.map +0 -1
- package/src/components/accordion/examples/checkout.tsx +0 -73
- package/src/components/accordion/examples/layouts.tsx +0 -58
- package/src/components/avatar/examples/colors.tsx +0 -29
- package/src/components/avatar/examples/group.tsx +0 -35
- package/src/components/avatar/examples/team-card.tsx +0 -70
- package/src/components/badge/examples/icons.tsx +0 -37
- package/src/components/badge/examples/order-list.tsx +0 -48
- package/src/components/badge/examples/palette.tsx +0 -44
- package/src/components/badge/examples/surfaces.tsx +0 -21
- package/src/components/banner/examples/dismiss.tsx +0 -48
- package/src/components/banner/examples/placement.tsx +0 -92
- package/src/components/breadcrumb/examples/collapse.tsx +0 -56
- package/src/components/breadcrumb/examples/page-header.tsx +0 -31
- package/src/components/button/examples/composition.tsx +0 -46
- package/src/components/button/examples/controlled.tsx +0 -18
- package/src/components/button/examples/full-width.tsx +0 -15
- package/src/components/button/examples/icon-only.tsx +0 -42
- package/src/components/button/examples/surfaces.tsx +0 -18
- package/src/components/button/examples/variants-tones.tsx +0 -39
- package/src/components/button-group/examples/composition.tsx +0 -99
- package/src/components/card/examples/mini-media.tsx +0 -55
- package/src/components/card/examples/responsive.tsx +0 -72
- package/src/components/checkbox/examples/hint-error.tsx +0 -22
- package/src/components/checkbox/examples/select-all.tsx +0 -40
- package/src/components/checkbox/examples/settings-card.tsx +0 -76
- package/src/components/code-block/examples/api-docs.tsx +0 -31
- package/src/components/code-block/examples/controlled.tsx +0 -38
- package/src/components/code-block/examples/surfaces.tsx +0 -7
- package/src/components/color-picker/examples/brand-color.tsx +0 -73
- package/src/components/color-picker/examples/hex-input-sizes.tsx +0 -54
- package/src/components/color-picker/examples/presets-quick.tsx +0 -57
- package/src/components/color-picker/examples/presets-tags.tsx +0 -52
- package/src/components/command-menu/examples/composition.tsx +0 -91
- package/src/components/command-menu/examples/examples.module.css +0 -9
- package/src/components/command-menu/examples/keyboard-search.tsx +0 -94
- package/src/components/data-table/examples/dashboard.tsx +0 -205
- package/src/components/data-table/examples/sorting-pagination.tsx +0 -66
- package/src/components/datepicker/examples/badge.tsx +0 -19
- package/src/components/datepicker/examples/single.tsx +0 -16
- package/src/components/digit-input/examples/length-and-complete.tsx +0 -30
- package/src/components/digit-input/examples/surfaces.tsx +0 -6
- package/src/components/digit-input/examples/verification-step.tsx +0 -62
- package/src/components/divider/examples/composition.tsx +0 -49
- package/src/components/divider/examples/variants.tsx +0 -62
- package/src/components/drawer/examples/composition.tsx +0 -94
- package/src/components/drawer/examples/controlled.tsx +0 -42
- package/src/components/drawer/examples/features.tsx +0 -48
- package/src/components/drawer/examples/states.tsx +0 -54
- package/src/components/dropdown/examples/as-child.tsx +0 -23
- package/src/components/dropdown/examples/composition.tsx +0 -91
- package/src/components/dropdown/examples/controlled.tsx +0 -32
- package/src/components/dropdown/examples/row-actions.tsx +0 -56
- package/src/components/dropdown/examples/variants.tsx +0 -52
- package/src/components/example-frame/examples/basic.tsx +0 -18
- package/src/components/file-upload/examples/file-list.tsx +0 -67
- package/src/components/file-upload/examples/in-card.tsx +0 -84
- package/src/components/hint/examples/field-states.tsx +0 -60
- package/src/components/hint/examples/in-form.tsx +0 -45
- package/src/components/input/examples/anatomy.tsx +0 -70
- package/src/components/input/examples/control-alignment.tsx +0 -57
- package/src/components/input/examples/full-width.tsx +0 -23
- package/src/components/input/examples/icons-and-affixes.tsx +0 -32
- package/src/components/input/examples/reserved-support-row.tsx +0 -33
- package/src/components/input/examples/surfaces.tsx +0 -12
- package/src/components/input/examples/with-badge.tsx +0 -40
- package/src/components/kbd/examples/modifier-keys.tsx +0 -24
- package/src/components/label/examples/in-form.tsx +0 -39
- package/src/components/label/examples/markers.tsx +0 -27
- package/src/components/link-button/examples/composition.tsx +0 -30
- package/src/components/link-button/examples/examples.module.css +0 -46
- package/src/components/link-button/examples/tones.tsx +0 -15
- package/src/components/modal/examples/composition.tsx +0 -87
- package/src/components/modal/examples/features.tsx +0 -68
- package/src/components/modal/examples/link.tsx +0 -79
- package/src/components/modal/examples/states.tsx +0 -73
- package/src/components/notification/examples/features.tsx +0 -42
- package/src/components/notification/examples/live.tsx +0 -128
- package/src/components/notification/examples/save-form.tsx +0 -59
- package/src/components/page-content/examples/readable.tsx +0 -24
- package/src/components/page-content/examples/settings-page.tsx +0 -49
- package/src/components/page-content/examples/widths.tsx +0 -39
- package/src/components/pagination/examples/compact.tsx +0 -36
- package/src/components/pagination/examples/list-footer.tsx +0 -50
- package/src/components/pagination/examples/states.tsx +0 -44
- package/src/components/popover/examples/as-child.tsx +0 -29
- package/src/components/popover/examples/composition.tsx +0 -45
- package/src/components/popover/examples/controlled.tsx +0 -39
- package/src/components/popover/examples/features.tsx +0 -56
- package/src/components/popover/examples/inset-variants.tsx +0 -58
- package/src/components/popover/examples/states.tsx +0 -48
- package/src/components/progress-bar/examples/file-upload.tsx +0 -52
- package/src/components/progress-bar/examples/values-and-tones.tsx +0 -17
- package/src/components/progress-circle/examples/goals-card.tsx +0 -37
- package/src/components/progress-circle/examples/values-and-tones.tsx +0 -56
- package/src/components/radio/examples/examples.module.css +0 -43
- package/src/components/radio/examples/hint-error.tsx +0 -28
- package/src/components/radio/examples/horizontal.tsx +0 -33
- package/src/components/radio/examples/plan-picker.tsx +0 -55
- package/src/components/scroll-container/examples/both-axes.tsx +0 -57
- package/src/components/scroll-container/examples/list.tsx +0 -44
- package/src/components/segmented-control/examples/item-content.tsx +0 -78
- package/src/components/segmented-control/examples/surfaces.tsx +0 -82
- package/src/components/segmented-control/examples/toolbar.tsx +0 -56
- package/src/components/segmented-progress-bar/COMPONENT.md +0 -128
- package/src/components/segmented-progress-bar/examples/examples.module.css +0 -68
- package/src/components/segmented-progress-bar/examples/segment-gap.tsx +0 -24
- package/src/components/segmented-progress-bar/examples/sizes.tsx +0 -31
- package/src/components/segmented-progress-bar/examples/storage-distribution.tsx +0 -41
- package/src/components/select/examples/native.tsx +0 -21
- package/src/components/select/examples/search-groups.tsx +0 -61
- package/src/components/select/examples/with-badge.tsx +0 -47
- package/src/components/slider/examples/basic.tsx +0 -6
- package/src/components/slider/examples/display-settings.tsx +0 -41
- package/src/components/stepper/examples/wizard.tsx +0 -62
- package/src/components/switch/examples/notification-settings.tsx +0 -37
- package/src/components/switch/examples/on-off.tsx +0 -15
- package/src/components/switch/examples/validation.tsx +0 -19
- package/src/components/tabs/examples/horizontal.tsx +0 -30
- package/src/components/tabs/examples/vertical.tsx +0 -101
- package/src/components/tag/COMPONENT.md +0 -179
- package/src/components/tag/examples/colors.tsx +0 -49
- package/src/components/tag/examples/examples.module.css +0 -47
- package/src/components/tag/examples/sizes.tsx +0 -23
- package/src/components/tag/examples/states.tsx +0 -19
- package/src/components/tag/examples/surfaces.tsx +0 -16
- package/src/components/tag/examples/with-icon.tsx +0 -29
- package/src/components/textarea/examples/height-and-limits.tsx +0 -45
- package/src/components/textarea/examples/hint-and-error.tsx +0 -21
- package/src/components/textarea/examples/reserved-support-row.tsx +0 -37
- package/src/components/textarea/examples/surfaces.tsx +0 -11
- package/src/components/textarea/examples/with-label.tsx +0 -22
- package/src/components/timeline/examples/hover-highlight.tsx +0 -48
- package/src/components/timeline/examples/in-card.tsx +0 -48
- package/src/components/timeline/examples/selectable.tsx +0 -58
- package/src/components/tooltip/examples/composition.tsx +0 -37
- package/src/components/tooltip/examples/side.tsx +0 -29
- package/src/components/tooltip/examples/states.tsx +0 -45
- package/src/components/typography/examples/as-prop.tsx +0 -25
- package/src/components/typography/examples/composition.tsx +0 -23
- package/src/components/typography/examples/full-width.tsx +0 -29
- package/src/components/typography/examples/reading-and-form.tsx +0 -35
- package/src/components/typography/examples/states.tsx +0 -23
- package/src/components/typography/examples/tones.tsx +0 -34
- package/src/components/typography/examples/variant-catalog.tsx +0 -41
- package/src/layout/app-shell/examples/with-sidebar.tsx +0 -63
- package/src/layout/sidebar/examples/modes.tsx +0 -55
- package/src/layout/sidebar/examples/responsive.tsx +0 -44
- package/src/layout/sidebar/examples/states.tsx +0 -34
|
@@ -1,31 +1,43 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Every state side by side, each labelled by its prop — `checked`, `readOnly`, `invalid`, `disabled`. */
|
|
2
2
|
import { Switch } from "prime-ui-kit";
|
|
3
3
|
|
|
4
|
-
import styles from "./examples.module.css";
|
|
5
|
-
|
|
6
4
|
export default function SwitchStatesExample() {
|
|
7
5
|
return (
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
6
|
+
<>
|
|
7
|
+
<div>
|
|
8
|
+
<div>
|
|
9
|
+
<Switch.Root>
|
|
10
|
+
<Switch.Label>unchecked</Switch.Label>
|
|
11
|
+
</Switch.Root>
|
|
12
|
+
</div>
|
|
13
|
+
<div>
|
|
14
|
+
<Switch.Root defaultChecked>
|
|
15
|
+
<Switch.Label>checked</Switch.Label>
|
|
16
|
+
</Switch.Root>
|
|
17
|
+
</div>
|
|
18
|
+
<div>
|
|
19
|
+
<Switch.Root defaultChecked readOnly>
|
|
20
|
+
<Switch.Label>readOnly</Switch.Label>
|
|
21
|
+
</Switch.Root>
|
|
22
|
+
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<Switch.Root invalid>
|
|
25
|
+
<Switch.Label>invalid</Switch.Label>
|
|
26
|
+
</Switch.Root>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div>
|
|
30
|
+
<div>
|
|
31
|
+
<Switch.Root disabled>
|
|
32
|
+
<Switch.Label>disabled</Switch.Label>
|
|
33
|
+
</Switch.Root>
|
|
34
|
+
</div>
|
|
35
|
+
<div>
|
|
36
|
+
<Switch.Root disabled defaultChecked>
|
|
37
|
+
<Switch.Label>disabled · checked</Switch.Label>
|
|
38
|
+
</Switch.Root>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</>
|
|
30
42
|
);
|
|
31
43
|
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Tabs
|
|
2
2
|
|
|
3
3
|
**Category:** navigation
|
|
4
|
+
**Kind:** navigation
|
|
4
5
|
|
|
5
|
-
>
|
|
6
|
+
> Folder tabs for navigating between content panels of one screen: the active tab rises out of the panel.
|
|
6
7
|
|
|
7
8
|
## When to use
|
|
8
9
|
- Splitting one screen into sections that are viewed one at a time (Overview / Orders / Reviews).
|
|
9
10
|
- Settings pages with a side list of sections (`orientation="vertical"`).
|
|
10
11
|
- Dashboard sections that need a counter or a one-line summary per tab (`Tabs.Count`, `Tabs.Description`).
|
|
12
|
+
- Section bars that must survive narrow containers: with an icon on every tab they collapse to icons with tooltips.
|
|
13
|
+
- Open documents or records the user switches between and closes, like browser tabs (`onRemove`, `minItemWidth`, `maxItemWidth`).
|
|
11
14
|
|
|
12
15
|
## When not to use
|
|
13
16
|
- Choosing a value or a mode (period, list view, filter) → use [SegmentedControl](../segmented-control/COMPONENT.md).
|
|
@@ -22,166 +25,233 @@ import { Tabs } from "prime-ui-kit";
|
|
|
22
25
|
```
|
|
23
26
|
|
|
24
27
|
## Anatomy
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
```
|
|
29
|
+
Tabs.Root value, size, orientation, tone, fullWidth, min/maxItemWidth; horizontal: the frame
|
|
30
|
+
├─ Tabs.List role="tablist" on a ScrollContainer, sliding folder / pill; collapses, then scrolls
|
|
31
|
+
│ ├─ Tabs.Item one tab (role="tab") in an item wrapper; onRemove adds a close button; parts:
|
|
32
|
+
│ │ ├─ Tabs.Icon decorative icon; hidden first, kept last
|
|
33
|
+
│ │ ├─ Tabs.Label title; keeps its width when it turns medium weight
|
|
34
|
+
│ │ ├─ Tabs.Count counter Badge, one tier below the tabs size
|
|
35
|
+
│ │ └─ Tabs.Description muted second line; makes the tab two-line
|
|
36
|
+
│ └─ Tabs.Separator Divider hairline between groups of tabs
|
|
37
|
+
└─ Tabs.Panel role="tabpanel", rendered only while its tab is active
|
|
38
|
+
```
|
|
33
39
|
|
|
34
40
|
## API
|
|
35
|
-
|
|
41
|
+
|
|
42
|
+
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
36
43
|
|
|
37
44
|
### Tabs.Root
|
|
38
|
-
|
|
45
|
+
`ref` → `HTMLDivElement`. `<div>` that owns the active value, size and orientation and lays out the list and the panel; horizontal, it is the frame: a sunken strip over the panel surface.
|
|
39
46
|
|
|
40
47
|
| Prop | Type | Default | Description |
|
|
41
48
|
|---|---|---|---|
|
|
42
49
|
| `value` | `string` | — | Active tab (controlled). |
|
|
43
50
|
| `defaultValue` | `string` | `""` | Initial active tab (uncontrolled). With `""` no tab is selected. |
|
|
44
|
-
| `onValueChange` | `(value: string) => void` | — | Called
|
|
51
|
+
| `onValueChange` | `(value: string) => void` | — | Called with the new active value. |
|
|
45
52
|
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | List direction and arrow keys. A vertical list stacks above the panel when the container is narrower than 600px. |
|
|
46
|
-
| `size` | `"xs" \| "s" \| "m" \| "l" \| "xl"` | `"m"` | Control tier:
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
53
|
+
| `size` | `"xs" \| "s" \| "m" \| "l" \| "xl"` | `"m"` | Control tier: text, icon, spacing, folder radius and panel padding. A horizontal tab is the control height plus the folder rise on both sides; a vertical one is the control height. |
|
|
54
|
+
| `fullWidth` | `boolean` | `true` | Horizontal tabs fill the list and tend to equal widths within `minItemWidth` … `maxItemWidth`, never narrower than their content: a long label keeps its width, short ones share the rest; when they do not fit, the list collapses, then scrolls. `false` sizes each tab to its content within the same bounds. |
|
|
55
|
+
| `tone` | `"neutral" \| "accent"` | `"neutral"` | Colour of the active tab: `neutral` is primary text with an accent icon, `accent` puts text and icon in accent. |
|
|
56
|
+
| `minItemWidth` | `number \| string` | `2.5 × control height` | Narrowest a horizontal tab with a label gets, px or a CSS length; a tab is also never narrower than its content (up to `maxItemWidth`). When tabs do not fit, the list collapses, then scrolls. Icon-only tabs are square. |
|
|
57
|
+
| `maxItemWidth` | `number \| string` | `7 × control height` | Widest a horizontal tab gets, px or a CSS length (`"none"` lifts the cap); a longer label ends with an ellipsis. |
|
|
58
|
+
| `labels` | `Partial<TabsLabels>` | — | Built-in strings, see Labels. |
|
|
59
|
+
| `children` | `ReactNode` | — | `Tabs.List` and `Tabs.Panel`s. |
|
|
60
|
+
| `…rest` | `Omit<HTMLAttributes<HTMLDivElement>, "defaultValue">` | — | `className` and the other div attributes. |
|
|
49
61
|
|
|
50
62
|
### Tabs.List
|
|
51
|
-
|
|
63
|
+
`ref` → `HTMLDivElement`. `role="tablist"` on a `ScrollContainer` (horizontal, edge fade, hidden scrollbar) with the sliding folder (vertical: pill), which glides only into a choice by click or keys and is placed without motion on mount, resize and collapse. When tabs do not fit or a label would be cut, it hides icons and descriptions, then labels (icons with tooltips stay; only when every tab has an icon); then the list scrolls; a label is never cut to make room. The active tab is kept in view: only the list scrolls, never the page.
|
|
52
64
|
|
|
53
65
|
| Prop | Type | Default | Description |
|
|
54
66
|
|---|---|---|---|
|
|
55
|
-
| `children` | `ReactNode` | —
|
|
56
|
-
| `
|
|
67
|
+
| `children` | `ReactNode` | — | `Tabs.Item`s and `Tabs.Separator`s. |
|
|
68
|
+
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `aria-label` (name the list), `className` and the other div attributes; `role`, `aria-orientation` and `onKeyDown` are set by the list. |
|
|
57
69
|
|
|
58
|
-
### Tabs.
|
|
59
|
-
|
|
70
|
+
### Tabs.Item
|
|
71
|
+
`ref` → `HTMLButtonElement`. One tab, a `<button role="tab">` in an item wrapper that also holds the close button of a removable tab; plain text children are wrapped in `Tabs.Label`.
|
|
60
72
|
|
|
61
73
|
| Prop | Type | Default | Description |
|
|
62
74
|
|---|---|---|---|
|
|
63
75
|
| `value` | `string` | — (required) | Value that selects this tab and its panel. |
|
|
64
|
-
| `disabled` | `boolean` | `false` | Disables the tab; arrow keys skip it. |
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
76
|
+
| `disabled` | `boolean` | `false` | Disables the tab; clicks and arrow keys skip it. |
|
|
77
|
+
| `onRemove` | `() => void` | — | Makes the tab closable: a close button (shown on the active tab, on hover and focus, always on touch screens), `Delete` / `Backspace` and a middle click. Closing the active tab first selects its neighbour; remove the item from your list here. |
|
|
78
|
+
| `children` | `ReactNode` | — (required) | Plain text, or `Tabs.Icon` / `Tabs.Label` / `Tabs.Count` / `Tabs.Description`. A description makes the tab two-line. |
|
|
79
|
+
| `…rest` | `Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value" \| "type" \| "role" \| "onClick">` | — | `className`, `aria-*` and the other button attributes; your `onKeyDown` / `onAuxClick` run first and `preventDefault()` keeps the tab open. |
|
|
67
80
|
|
|
68
|
-
### Tabs.Icon
|
|
69
|
-
|
|
81
|
+
### Tabs.Icon
|
|
82
|
+
`ref` → `HTMLSpanElement`. Decorative icon (`aria-hidden`) before the label; muted, accent on the active tab. Hidden first when tabs do not fit; the last thing left when nothing else fits.
|
|
70
83
|
|
|
71
84
|
| Prop | Type | Default | Description |
|
|
72
85
|
|---|---|---|---|
|
|
73
|
-
| `children` | `ReactNode` | — (required) |
|
|
74
|
-
| `
|
|
86
|
+
| `children` | `ReactNode` | — (required) | The icon, e.g. `<Icon name="field.calendar" />`. |
|
|
87
|
+
| `…rest` | `Omit<HTMLAttributes<HTMLSpanElement>, "children">` | — | `className` and the other span attributes. |
|
|
88
|
+
|
|
89
|
+
### Tabs.Label
|
|
90
|
+
`ref` → `HTMLSpanElement`. Title; truncates and keeps a stable width when it turns medium weight.
|
|
91
|
+
|
|
92
|
+
| Prop | Type | Default | Description |
|
|
93
|
+
|---|---|---|---|
|
|
94
|
+
| `children` | `ReactNode` | — (required) | Title text. |
|
|
95
|
+
| `…rest` | `Omit<HTMLAttributes<HTMLSpanElement>, "children">` | — | `className` and the other span attributes. |
|
|
75
96
|
|
|
76
97
|
### Tabs.Count
|
|
77
|
-
|
|
98
|
+
`ref` → `HTMLSpanElement`. Counter `Badge` after the label, one tier below the tabs size.
|
|
78
99
|
|
|
79
100
|
| Prop | Type | Default | Description |
|
|
80
101
|
|---|---|---|---|
|
|
81
102
|
| `color` | `"gray" \| "blue" \| "green" \| "orange" \| "red" \| "yellow" \| "purple" \| "sky" \| "pink" \| "teal"` | `"gray"` | Badge hue. |
|
|
82
103
|
| `children` | `ReactNode` | — (required) | The number. |
|
|
83
|
-
| `
|
|
104
|
+
| `…rest` | `Omit<HTMLAttributes<HTMLSpanElement>, "children">` | — | `className` and the other span attributes. |
|
|
105
|
+
|
|
106
|
+
### Tabs.Description
|
|
107
|
+
`ref` → `HTMLSpanElement`. Muted second line; becomes the tab's `aria-describedby`.
|
|
108
|
+
|
|
109
|
+
| Prop | Type | Default | Description |
|
|
110
|
+
|---|---|---|---|
|
|
111
|
+
| `children` | `ReactNode` | — (required) | Second-line text; wrap a key value in `<strong>`. |
|
|
112
|
+
| `…rest` | `Omit<HTMLAttributes<HTMLSpanElement>, "children">` | — | `className` and the other span attributes. |
|
|
113
|
+
|
|
114
|
+
### Tabs.Separator
|
|
115
|
+
`ref` → `HTMLDivElement`. A `Divider` hairline between groups of tabs, across the list direction; hidden from assistive tech.
|
|
116
|
+
|
|
117
|
+
| Prop | Type | Default | Description |
|
|
118
|
+
|---|---|---|---|
|
|
119
|
+
| `…rest` | `Omit<HTMLAttributes<HTMLDivElement>, "children">` | — | `className` and the other div attributes. |
|
|
84
120
|
|
|
85
121
|
### Tabs.Panel
|
|
86
|
-
|
|
122
|
+
`ref` → `HTMLDivElement`. `<div role="tabpanel">`, focusable, rendered only while its tab is active; horizontal, the padded surface the folder rises from. Its content enters each time it opens.
|
|
87
123
|
|
|
88
124
|
| Prop | Type | Default | Description |
|
|
89
125
|
|---|---|---|---|
|
|
90
126
|
| `value` | `string` | — (required) | Tab value this panel belongs to. |
|
|
91
|
-
| `children` | `ReactNode` | —
|
|
92
|
-
| `
|
|
127
|
+
| `children` | `ReactNode` | — | Panel content. |
|
|
128
|
+
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `className` and the other div attributes. |
|
|
93
129
|
|
|
94
130
|
## Variants
|
|
95
|
-
Tabs have no `variant`: navigation tabs are always
|
|
131
|
+
Tabs have no `variant`: navigation tabs are always a folder (horizontal) or pills (vertical).
|
|
132
|
+
|
|
133
|
+
### tone
|
|
134
|
+
| Value | Looks like | Use when | Default |
|
|
135
|
+
|---|---|---|---|
|
|
136
|
+
| `neutral` | active tab in primary text, medium weight, its leading icon in `accent-text` | most screens | yes |
|
|
137
|
+
| `accent` | active label and icon both in `accent-text` | the tabs are the main control of the screen and must read as selected at a glance | |
|
|
96
138
|
|
|
97
139
|
### orientation
|
|
98
140
|
| Value | Looks like | Use when | Default |
|
|
99
141
|
|---|---|---|---|
|
|
100
|
-
| `horizontal` |
|
|
142
|
+
| `horizontal` | a `bg-sunken` strip over a padded `bg-surface` panel, tabs edge to edge; the active tab is the panel surface rising into the strip with concave flares, gliding between tabs; primary text, medium weight, accent icon; hover is the same shape in `fill-faint` | switching sections above the content | yes |
|
|
101
143
|
| `vertical` | items padded like controls, no rail; active item is a `fill-muted` pill with a short accent mark at the start; hover `fill-subtle`; below a 600px container it becomes a scrolling row above the panel | settings pages with a side list of sections | |
|
|
102
144
|
|
|
103
145
|
### size
|
|
104
146
|
| Value | Looks like | Use when | Default |
|
|
105
147
|
|---|---|---|---|
|
|
106
|
-
| `xs` |
|
|
107
|
-
| `s` |
|
|
108
|
-
| `m` |
|
|
109
|
-
| `l` |
|
|
110
|
-
| `xl` |
|
|
148
|
+
| `xs` | 12/16 text, folder radius 8, rise 4, panel padding 16 | dense panels | |
|
|
149
|
+
| `s` | 13/20, radius 8, rise 4, padding 20 | compact cards | |
|
|
150
|
+
| `m` | 14/20, radius 12, rise 8, padding 24 | default | yes |
|
|
151
|
+
| `l` | 16/24, radius 16, rise 12, padding 24 | page-level sections | |
|
|
152
|
+
| `xl` | 16/24, radius 16, rise 12, padding 32 | hero / landing sections | |
|
|
111
153
|
|
|
112
|
-
|
|
154
|
+
A horizontal tab is the control height of the tier plus the rise above and below its content; a vertical tab is the control height, so a vertical list lines up with Button, Input and SegmentedControl of the same `size`.
|
|
113
155
|
|
|
114
|
-
###
|
|
156
|
+
### Flags
|
|
157
|
+
| Value | Looks like | Use when | Default |
|
|
158
|
+
|---|---|---|---|
|
|
159
|
+
| `fullWidth` | horizontal tabs fill the list and tend to equal widths (`flex: 1 1 0`, up to `maxItemWidth`), content centred; a tab is never narrower than its content or `minItemWidth`, so a long label keeps its width and the short ones share the rest; `false` sizes each tab to its content, the strip still spans the frame | `false` for tabs of very different label lengths | `true` |
|
|
160
|
+
|
|
161
|
+
### minItemWidth · maxItemWidth
|
|
162
|
+
| Value | Looks like | Use when | Default |
|
|
163
|
+
|---|---|---|---|
|
|
164
|
+
| defaults | a horizontal tab is 2.5 to 7 control heights wide (90 … 252 at `m`); tabs never stretch into wide bars | most screens | yes |
|
|
165
|
+
| lengths (`128`, `"16rem"`) | browser tabs: grow up to `maxItemWidth` with the label cut by an ellipsis past it, never narrower than `minItemWidth` or their title up to the cap; in a crowded list the list scrolls | open documents, records, chats — many tabs with long titles | |
|
|
166
|
+
| `maxItemWidth="none"` | tabs share the whole strip | a few sections that must fill a wide frame | |
|
|
167
|
+
|
|
168
|
+
### Item content
|
|
115
169
|
| Value | Looks like | Use when | Default |
|
|
116
170
|
|---|---|---|---|
|
|
117
171
|
| text | label only | most tabs | yes |
|
|
118
172
|
| `Tabs.Icon` + `Tabs.Label` | muted icon before the label; the active tab's leading icon turns accent | sections with recognizable icons | |
|
|
119
|
-
| `Tabs.Count` | soft badge after the label,
|
|
120
|
-
| `Tabs.Description` (two-line) | label (+ count) on line 1, `body-s` muted text on line 2;
|
|
173
|
+
| `Tabs.Count` | soft badge after the label, tabular numbers | showing how many items a section has | |
|
|
174
|
+
| `Tabs.Description` (two-line) | label (+ count) on line 1, `body-s` muted text on line 2; `<strong>` is primary / medium | dashboards with a summary per section | |
|
|
175
|
+
| `onRemove` on Item | a ghost close button (`action.close`, two tiers below) at the end of the tab: on the active tab, on hover and focus, always on touch screens | open documents the user closes, like browser tabs | |
|
|
121
176
|
|
|
122
|
-
|
|
123
|
-
- Recommended: `Tabs.Count color="blue"` on the active tab and `gray` on others (see `controlled.tsx`); per-section hues in two-line dashboards.
|
|
124
|
-
- Avoid: icons on only some tabs; a `Tabs.Description` on only some tabs (rows of uneven height); Tabs used as a filter — use SegmentedControl.
|
|
177
|
+
Avoid icons or descriptions on only some tabs (uneven rows; without an icon on every tab the list cannot collapse to icons) and Tabs used as a filter — use SegmentedControl.
|
|
125
178
|
|
|
126
179
|
## States
|
|
127
180
|
| State | Driven by | DOM |
|
|
128
181
|
|---|---|---|
|
|
129
|
-
| active | `value` / `defaultValue` |
|
|
130
|
-
| hover | pointer | text → primary
|
|
131
|
-
|
|
|
132
|
-
|
|
|
182
|
+
| active | `value` / `defaultValue` | item `aria-selected="true"`, `data-state="active"`, `tabIndex=0`; others `data-state="inactive"`, `tabIndex=-1` |
|
|
183
|
+
| hover | pointer | text → primary; horizontal: the folder shape in `fill-faint`, under the folder; vertical: `fill-subtle` background |
|
|
184
|
+
| pressed | pointer down | the tab content scales to `--prime-motion-press-scale-compact` |
|
|
185
|
+
| focus-visible | keyboard | focus ring inside the tab, above the folder; the panel shows an inset ring (vertical: outer ring) |
|
|
186
|
+
| disabled | `disabled` on Item | native `disabled`, `data-disabled="true"`, `text-disabled`; a removable tab loses its close button |
|
|
187
|
+
| removable | `onRemove` on Item | item wrapper `data-removable="true"`, close button, tab `aria-keyshortcuts="Delete"` |
|
|
133
188
|
| two-line | `Tabs.Description` child | `data-two-line="true"` |
|
|
134
|
-
|
|
|
189
|
+
| collapsed | tabs wider than the list, or a label that would be cut (horizontal) | list `data-collapse="full" \| "compact" \| "icon"`: `compact` hides icons and descriptions; `icon` hides labels (sr-only, shown in a `Tooltip`), counts and close buttons, only when every tab has an icon |
|
|
190
|
+
| overflow | tabs at their narrowest (content width, `minItemWidth` or icon squares) still wider than the list | `data-overflow-start` / `data-overflow-end` on the list (ScrollContainer), faded edges; the active tab is kept in view on mount and on every value change — only the list scrolls, never the page |
|
|
135
191
|
|
|
136
|
-
|
|
192
|
+
The indicator glides (`emphasized` + `base`, `data-animate="true"`) only into a choice by click, arrow keys or closing the active tab; on mount, a value set from outside, a resize, font loading, tabs added or removed and collapse it is placed without motion, and it stays still under `prefers-reduced-motion`. The list scrolls smoothly to the active tab only after such a choice too.
|
|
193
|
+
|
|
194
|
+
Other attributes: Root `data-orientation`, `data-size`, `data-tone`, `data-full-width`, inline `--tabs-item-min` / `--tabs-item-max` when set; List `data-indicator="folder" | "pill"`; Item `data-value` on the tab, `data-state` / `data-disabled` on its wrapper too; Label `data-text`. Inactive panels are unmounted; a panel's content enters each time it opens.
|
|
137
195
|
|
|
138
196
|
## Layout & spacing
|
|
139
|
-
-
|
|
140
|
-
-
|
|
197
|
+
- Horizontal: the root is the frame (`radius-xl`, `bg-sunken`), the list sits flush on the panel and runs edge to edge; the panel pads its content by tier (`--prime-space-4` … `--prime-space-8`). Do not wrap Tabs in a Card — it already is one.
|
|
198
|
+
- Vertical list → panel: `var(--prime-space-6)`.
|
|
199
|
+
- The list never wraps: it collapses, then scrolls horizontally with faded edges (hidden scrollbar, `overscroll-behavior: contain`). Give the list's container a width (`min-width: 0` on flex children).
|
|
200
|
+
- A horizontal tab is never narrower than its content (`min-width: max-content`; the tab bounds that content between `minItemWidth` and `maxItemWidth`), so a label is never cut to make room. Full width, tabs tend to equal widths, not widths in proportion to their labels (`flex: 1 1 0`): a long label keeps its width, the short ones share the rest.
|
|
201
|
+
- A vertical Tabs.Root is a size container: give it a width (it measures itself to switch to a row).
|
|
141
202
|
- In a vertical layout align the panel heading with the first tab by making the heading row one control tall (`min-height: var(--prime-control-m-height)`).
|
|
142
203
|
|
|
143
204
|
## Accessibility
|
|
205
|
+
|
|
206
|
+
### Keyboard
|
|
207
|
+
| Key | Action |
|
|
208
|
+
|---|---|
|
|
209
|
+
| `ArrowLeft` · `ArrowRight` | Select the neighbouring tab, wrapping and skipping disabled ones; also work in a vertical list. |
|
|
210
|
+
| `ArrowUp` · `ArrowDown` | The same in a vertical list. |
|
|
211
|
+
| `Home` · `End` | First and last enabled tab. |
|
|
212
|
+
| `Delete` · `Backspace` | Close a tab with `onRemove`; closing the active tab selects and focuses its neighbour. |
|
|
213
|
+
| `Tab` | Enters the active tab (roving tabindex), then moves to the panel. |
|
|
214
|
+
|
|
215
|
+
### ARIA
|
|
144
216
|
- WAI-ARIA tabs pattern: `tablist` / `tab` / `tabpanel` with `aria-controls` / `aria-labelledby` wired automatically; give `Tabs.List` an `aria-label`.
|
|
145
|
-
-
|
|
217
|
+
- Selection follows focus; the panel is focusable (`tabIndex=0`).
|
|
146
218
|
- In a two-line tab the accessible name is label (+ count); `Tabs.Description` becomes `aria-describedby`.
|
|
147
|
-
- `Tabs.Icon`
|
|
219
|
+
- `Tabs.Icon` and `Tabs.Separator` are `aria-hidden`.
|
|
220
|
+
- When only icons are left, the label stays for screen readers (sr-only) and shows in a `Tooltip` on hover and focus.
|
|
221
|
+
- The close button of a removable tab is named after it (`labels.remove`) and stays out of the Tab order; the tab announces `aria-keyshortcuts="Delete"`.
|
|
148
222
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|---|---|---|
|
|
152
|
-
| [horizontal.tsx](examples/horizontal.tsx) | Underline tabs with panels | switching panels of one screen |
|
|
153
|
-
| [sizes.tsx](examples/sizes.tsx) | Every size next to a Button of the same size | aligning tabs with controls |
|
|
154
|
-
| [states.tsx](examples/states.tsx) | Icons, disabled tab, overflow at phone width | icons, unavailable sections, narrow screens |
|
|
155
|
-
| [controlled.tsx](examples/controlled.tsx) | `value` + `onValueChange` with `Tabs.Count` | tab in app state / URL |
|
|
156
|
-
| [two-line.tsx](examples/two-line.tsx) | Label + Count + Description | dashboards with per-section summary |
|
|
157
|
-
| [vertical.tsx](examples/vertical.tsx) | Vertical settings tabs in a card | settings pages |
|
|
223
|
+
### Labels
|
|
224
|
+
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
158
225
|
|
|
159
|
-
|
|
160
|
-
|
|
226
|
+
| Key | Default | Used for |
|
|
227
|
+
|---|---|---|
|
|
228
|
+
| `remove` | `"Закрыть вкладку «{label}»"` | Accessible name of the close button of a removable tab; `{label}` is the tab title (its value when the title is not text). |
|
|
161
229
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
230
|
+
## Examples
|
|
231
|
+
| Example | Shows |
|
|
232
|
+
|---|---|
|
|
233
|
+
| [overview.tsx](examples/overview.tsx) | Sections of one screen; the active tab rises into the panel and glides to the next one — `defaultValue`. |
|
|
234
|
+
| [variants.tsx](examples/variants.tsx) | The active tab in primary text with an accent icon, or all in accent — `tone`. |
|
|
235
|
+
| [sizes.tsx](examples/sizes.tsx) | Every size tier: text, icon, folder radius and spacing grow together — `size`. |
|
|
236
|
+
| [states.tsx](examples/states.tsx) | A disabled tab that clicks and arrow keys skip — `disabled`. |
|
|
237
|
+
| [with-icon.tsx](examples/with-icon.tsx) | A muted icon before the label and a hairline before the service section — `Tabs.Icon`, `Tabs.Label`, `Tabs.Separator`. |
|
|
238
|
+
| [orientation.tsx](examples/orientation.tsx) | Tabs over the panel and a side list of sections that stacks on top below 600px — `orientation`. |
|
|
239
|
+
| [overflow.tsx](examples/overflow.tsx) | Drag the frame narrower: icons go first, then labels, and icons with tooltips stay; then the list scrolls — `Tabs.Icon`. |
|
|
240
|
+
| [closable.tsx](examples/closable.tsx) | Open order cards as browser tabs: each closes by its button, Delete or a middle click; tabs stay between two widths, and the list scrolls when they do not fit — `onRemove`, `minItemWidth`, `maxItemWidth`. |
|
|
241
|
+
| [two-line.tsx](examples/two-line.tsx) | A label and a counter on the first line, a summary on the second — `Tabs.Count`, `Tabs.Description`. |
|
|
242
|
+
| [controlled.tsx](examples/controlled.tsx) | The active tab lives in parent state, e.g. synced with the URL — `value`, `onValueChange`. |
|
|
175
243
|
|
|
176
244
|
## Mistakes
|
|
177
|
-
- `<Tabs.Root>` without `defaultValue
|
|
245
|
+
- `<Tabs.Root>` without `defaultValue` / `value` → no tab is active; pass the first tab's value.
|
|
178
246
|
- `variant="pills"` / `variant="underline"` → Tabs have no variant; use `orientation`, or SegmentedControl for a pill switch.
|
|
247
|
+
- An icon on only some tabs → the list cannot collapse to icons and scrolls instead; give every tab an icon or none.
|
|
248
|
+
- Tabs inside a `Card.Root` → a frame in a frame; the horizontal root is the surface.
|
|
179
249
|
- Using Tabs to filter a list → use SegmentedControl.
|
|
180
|
-
- `onClick` on `Tabs.
|
|
250
|
+
- `onClick` on `Tabs.Item` → use `onValueChange` on Root.
|
|
251
|
+
- A hand-made × inside `Tabs.Item` → a button inside a tab button; pass `onRemove` instead.
|
|
252
|
+
- `onRemove` that does not drop the tab from your list → the tab stays; the kit only moves the selection.
|
|
181
253
|
- `Tabs.List` without `aria-label` → add one.
|
|
182
254
|
|
|
183
255
|
## Related
|
|
184
|
-
- [
|
|
185
|
-
- [ButtonGroup](../button-group/COMPONENT.md)
|
|
186
|
-
- [Accordion](../accordion/COMPONENT.md)
|
|
187
|
-
- [Badge](../badge/COMPONENT.md)
|
|
256
|
+
- **Built from:** [ScrollContainer](../scroll-container/COMPONENT.md), [Badge](../badge/COMPONENT.md), [Button](../button/COMPONENT.md), [Divider](../divider/COMPONENT.md), [Tooltip](../tooltip/COMPONENT.md)
|
|
257
|
+
- **See also:** [SegmentedControl](../segmented-control/COMPONENT.md), [ButtonGroup](../button-group/COMPONENT.md), [Accordion](../accordion/COMPONENT.md)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Open order cards as browser tabs: each closes by its button, Delete or a middle click; tabs stay between two widths, and the list scrolls when they do not fit — `onRemove`, `minItemWidth`, `maxItemWidth`. */
|
|
2
|
+
import { Button, Tabs, Typography } from "prime-ui-kit";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
const ORDERS = [
|
|
6
|
+
{ id: "10482", client: "Северный ветер", total: "184 200 ₽" },
|
|
7
|
+
{ id: "10479", client: "ИП Корнеева", total: "36 900 ₽" },
|
|
8
|
+
{ id: "10471", client: "Техноплан", total: "512 040 ₽" },
|
|
9
|
+
{ id: "10466", client: "Балтийская логистическая компания", total: "97 300 ₽" },
|
|
10
|
+
{ id: "10458", client: "ИП Гусев", total: "12 400 ₽" },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
export default function TabsClosableExample() {
|
|
14
|
+
const [openOrders, setOpenOrders] = React.useState(ORDERS);
|
|
15
|
+
|
|
16
|
+
if (openOrders.length === 0) {
|
|
17
|
+
return (
|
|
18
|
+
<Button.Root variant="soft" tone="neutral" onClick={() => setOpenOrders(ORDERS)}>
|
|
19
|
+
Открыть заказы снова
|
|
20
|
+
</Button.Root>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Tabs.Root defaultValue="10479" minItemWidth={160} maxItemWidth={224}>
|
|
26
|
+
<Tabs.List aria-label="Открытые заказы">
|
|
27
|
+
{openOrders.map((order) => (
|
|
28
|
+
<Tabs.Item
|
|
29
|
+
key={order.id}
|
|
30
|
+
value={order.id}
|
|
31
|
+
onRemove={() =>
|
|
32
|
+
setOpenOrders((orders) => orders.filter((item) => item.id !== order.id))
|
|
33
|
+
}
|
|
34
|
+
>
|
|
35
|
+
{order.client}
|
|
36
|
+
</Tabs.Item>
|
|
37
|
+
))}
|
|
38
|
+
</Tabs.List>
|
|
39
|
+
{openOrders.map((order) => (
|
|
40
|
+
<Tabs.Panel key={order.id} value={order.id}>
|
|
41
|
+
<Typography variant="body-m" tone="secondary">
|
|
42
|
+
Заказ № {order.id}, {order.client}, сумма {order.total}.
|
|
43
|
+
</Typography>
|
|
44
|
+
</Tabs.Panel>
|
|
45
|
+
))}
|
|
46
|
+
</Tabs.Root>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -1,37 +1,31 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** The active tab lives in parent state, e.g. synced with the URL — `value`, `onValueChange`. */
|
|
2
2
|
import { Tabs, Typography } from "prime-ui-kit";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const tabs = [
|
|
5
|
+
const QUEUES = [
|
|
8
6
|
{ value: "new", label: "Новые", count: 12 },
|
|
9
7
|
{ value: "progress", label: "В работе", count: 5 },
|
|
10
8
|
{ value: "done", label: "Готово", count: 148 },
|
|
11
9
|
];
|
|
12
10
|
|
|
13
11
|
export default function TabsControlledExample() {
|
|
14
|
-
const [
|
|
15
|
-
const current = tabs.find((t) => t.value === value);
|
|
12
|
+
const [queue, setQueue] = React.useState("new");
|
|
16
13
|
|
|
17
14
|
return (
|
|
18
|
-
<Tabs.Root value={
|
|
15
|
+
<Tabs.Root value={queue} onValueChange={setQueue}>
|
|
19
16
|
<Tabs.List aria-label="Заявки">
|
|
20
|
-
{
|
|
21
|
-
<Tabs.
|
|
22
|
-
<Tabs.Label>{
|
|
23
|
-
<Tabs.Count color={
|
|
24
|
-
</Tabs.
|
|
17
|
+
{QUEUES.map((item) => (
|
|
18
|
+
<Tabs.Item key={item.value} value={item.value}>
|
|
19
|
+
<Tabs.Label>{item.label}</Tabs.Label>
|
|
20
|
+
<Tabs.Count color={item.value === queue ? "blue" : "gray"}>{item.count}</Tabs.Count>
|
|
21
|
+
</Tabs.Item>
|
|
25
22
|
))}
|
|
26
23
|
</Tabs.List>
|
|
27
|
-
{
|
|
28
|
-
<Tabs.Panel key={
|
|
29
|
-
<Typography
|
|
30
|
-
Заявок в разделе «{
|
|
31
|
-
|
|
32
|
-
{current?.count}
|
|
33
|
-
</Typography.Root>
|
|
34
|
-
</Typography.Root>
|
|
24
|
+
{QUEUES.map((item) => (
|
|
25
|
+
<Tabs.Panel key={item.value} value={item.value}>
|
|
26
|
+
<Typography variant="body-m" tone="secondary">
|
|
27
|
+
Заявок в разделе «{item.label}»: {item.count}.
|
|
28
|
+
</Typography>
|
|
35
29
|
</Tabs.Panel>
|
|
36
30
|
))}
|
|
37
31
|
</Tabs.Root>
|
|
@@ -1,98 +1,18 @@
|
|
|
1
|
-
/* Layout
|
|
1
|
+
/* Layout of the Tabs scenarios: semantic tokens only. */
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
gap: var(--prime-space-8);
|
|
7
|
-
width: 100%;
|
|
8
|
-
min-width: 0;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.group {
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
gap: var(--prime-space-2);
|
|
15
|
-
width: 100%;
|
|
16
|
-
min-width: 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.sizes {
|
|
20
|
-
display: flex;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
gap: var(--prime-space-4);
|
|
23
|
-
width: 100%;
|
|
24
|
-
min-width: 0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/* label · tabs · button of the same tier on one baseline row */
|
|
28
|
-
.sizeRow {
|
|
29
|
-
display: flex;
|
|
30
|
-
align-items: center;
|
|
31
|
-
gap: var(--prime-space-4);
|
|
32
|
-
min-width: 0;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.sizeRow > :nth-child(2) {
|
|
36
|
-
flex: 0 1 auto;
|
|
37
|
-
min-width: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.caption {
|
|
41
|
-
flex: none;
|
|
42
|
-
width: var(--prime-space-8);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/* ≈375px — a phone-width container. */
|
|
46
|
-
.narrow {
|
|
47
|
-
width: min(100%, calc(var(--prime-drawer-width-s) + var(--prime-space-4)));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.card {
|
|
3
|
+
/* A column for Tabs that fill their frame (a vertical root measures its own width, so it needs
|
|
4
|
+
one): wide enough to show the strip, narrower than the preview. */
|
|
5
|
+
.frame {
|
|
51
6
|
box-sizing: border-box;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
gap: var(--prime-space-4);
|
|
55
|
-
width: min(100%, calc(var(--prime-modal-width-l) - var(--prime-space-4)));
|
|
56
|
-
padding: var(--prime-card-padding-m);
|
|
57
|
-
border-radius: var(--prime-card-radius);
|
|
58
|
-
background: var(--prime-color-card-bg);
|
|
59
|
-
box-shadow: var(--prime-card-shadow);
|
|
60
|
-
--prime-color-field-bg: var(--prime-color-field-bg-surface);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.form {
|
|
64
|
-
display: flex;
|
|
65
|
-
flex-direction: column;
|
|
66
|
-
gap: var(--prime-space-5);
|
|
67
|
-
max-width: calc(var(--prime-drawer-width-s) + var(--prime-space-6));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/* Settings panel: the heading row is one control tall, so it lines up with the first tab. */
|
|
71
|
-
.section {
|
|
72
|
-
display: flex;
|
|
73
|
-
flex-direction: column;
|
|
74
|
-
gap: var(--prime-space-4);
|
|
75
|
-
min-width: 0;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.sectionHead {
|
|
79
|
-
display: flex;
|
|
80
|
-
align-items: center;
|
|
81
|
-
min-height: var(--prime-control-m-height);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.rows {
|
|
85
|
-
display: flex;
|
|
86
|
-
flex-direction: column;
|
|
87
|
-
gap: var(--prime-space-5);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/* Fleet dashboard: two-line underline tabs across the frame. */
|
|
91
|
-
.fleet {
|
|
92
|
-
width: 100%;
|
|
93
|
-
min-width: 0;
|
|
7
|
+
width: min(100%, calc(16 * var(--prime-control-m-height)));
|
|
8
|
+
margin-inline: auto;
|
|
94
9
|
}
|
|
95
10
|
|
|
96
|
-
.
|
|
97
|
-
|
|
11
|
+
/* The same column, which the reader can drag narrower to watch the tabs collapse and scroll. */
|
|
12
|
+
.resizable {
|
|
13
|
+
composes: frame;
|
|
14
|
+
min-width: calc(3 * var(--prime-control-m-height));
|
|
15
|
+
max-width: 100%;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
resize: horizontal;
|
|
98
18
|
}
|