@invoiceonline/ui-react 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +99 -0
- package/CHANGELOG.md +131 -0
- package/LICENSE +9 -0
- package/README.md +78 -2
- package/dist/assets/label-brush-1.svg +6 -0
- package/dist/assets/pattern-dark.svg +113 -0
- package/dist/components/action-row/ActionRow.d.ts +178 -0
- package/dist/components/action-row/ActionRow.js +340 -0
- package/dist/components/action-row/index.d.ts +2 -0
- package/dist/components/action-row/index.js +1 -0
- package/dist/components/alert/Alert.d.ts +314 -0
- package/dist/components/alert/Alert.js +446 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +1 -0
- package/dist/components/anchored-panel/AnchoredPanel.d.ts +41 -0
- package/dist/components/anchored-panel/AnchoredPanel.js +72 -0
- package/dist/components/anchored-panel/index.d.ts +3 -0
- package/dist/components/anchored-panel/index.js +3 -0
- package/dist/components/badge/Badge.d.ts +146 -0
- package/dist/components/badge/Badge.js +258 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/banner/Banner.d.ts +209 -0
- package/dist/components/banner/Banner.js +339 -0
- package/dist/components/banner/index.d.ts +2 -0
- package/dist/components/banner/index.js +1 -0
- package/dist/components/button/Button.d.ts +54 -0
- package/dist/components/button/Button.js +312 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button-group/ButtonGroup.d.ts +187 -0
- package/dist/components/button-group/ButtonGroup.js +217 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/card-select/CardSelect.d.ts +274 -0
- package/dist/components/card-select/CardSelect.js +561 -0
- package/dist/components/card-select/CardSelectGroup.d.ts +92 -0
- package/dist/components/card-select/CardSelectGroup.js +72 -0
- package/dist/components/card-select/index.d.ts +3 -0
- package/dist/components/card-select/index.js +3 -0
- package/dist/components/checkbox/Checkbox.d.ts +104 -0
- package/dist/components/checkbox/Checkbox.js +194 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/Chip.d.ts +250 -0
- package/dist/components/chip/Chip.js +441 -0
- package/dist/components/chip/index.d.ts +2 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/column-header/ColumnHeader.d.ts +144 -0
- package/dist/components/column-header/ColumnHeader.js +209 -0
- package/dist/components/column-header/index.d.ts +2 -0
- package/dist/components/column-header/index.js +1 -0
- package/dist/components/combobox-field/Combobox.d.ts +104 -0
- package/dist/components/combobox-field/Combobox.js +355 -0
- package/dist/components/combobox-field/ComboboxField.d.ts +76 -0
- package/dist/components/combobox-field/ComboboxField.js +98 -0
- package/dist/components/combobox-field/index.d.ts +3 -0
- package/dist/components/combobox-field/index.js +3 -0
- package/dist/components/date-field/DateField.d.ts +52 -0
- package/dist/components/date-field/DateField.js +45 -0
- package/dist/components/date-field/index.d.ts +2 -0
- package/dist/components/date-field/index.js +1 -0
- package/dist/components/date-picker/DatePicker.d.ts +53 -0
- package/dist/components/date-picker/DatePicker.js +329 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/divider/Divider.d.ts +81 -0
- package/dist/components/divider/Divider.js +93 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/drawer/Drawer.d.ts +128 -0
- package/dist/components/drawer/Drawer.js +367 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/dropdown-button/DropdownButton.d.ts +72 -0
- package/dist/components/dropdown-button/DropdownButton.js +122 -0
- package/dist/components/dropdown-button/index.d.ts +2 -0
- package/dist/components/dropdown-button/index.js +1 -0
- package/dist/components/faq/FAQ.d.ts +135 -0
- package/dist/components/faq/FAQ.js +258 -0
- package/dist/components/faq/index.d.ts +2 -0
- package/dist/components/faq/index.js +1 -0
- package/dist/components/field/Field.d.ts +118 -0
- package/dist/components/field/Field.js +327 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/field-pair/FieldPair.d.ts +194 -0
- package/dist/components/field-pair/FieldPair.js +321 -0
- package/dist/components/field-pair/index.d.ts +2 -0
- package/dist/components/field-pair/index.js +1 -0
- package/dist/components/file-upload/FileUpload.d.ts +137 -0
- package/dist/components/file-upload/FileUpload.js +434 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/file-upload/index.js +1 -0
- package/dist/components/filter-chip/FilterChip.d.ts +373 -0
- package/dist/components/filter-chip/FilterChip.js +517 -0
- package/dist/components/filter-chip/index.d.ts +2 -0
- package/dist/components/filter-chip/index.js +1 -0
- package/dist/components/filter-facet/FilterFacet.d.ts +116 -0
- package/dist/components/filter-facet/FilterFacet.js +632 -0
- package/dist/components/filter-facet/index.d.ts +2 -0
- package/dist/components/filter-facet/index.js +1 -0
- package/dist/components/firm-avatar/FirmAvatar.d.ts +75 -0
- package/dist/components/firm-avatar/FirmAvatar.js +119 -0
- package/dist/components/firm-avatar/index.d.ts +2 -0
- package/dist/components/firm-avatar/index.js +1 -0
- package/dist/components/form-actions/FormActions.d.ts +123 -0
- package/dist/components/form-actions/FormActions.js +195 -0
- package/dist/components/form-actions/index.d.ts +2 -0
- package/dist/components/form-actions/index.js +1 -0
- package/dist/components/form-block/FormBlock.d.ts +252 -0
- package/dist/components/form-block/FormBlock.js +420 -0
- package/dist/components/form-block/index.d.ts +3 -0
- package/dist/components/form-block/index.js +3 -0
- package/dist/components/form-section/FormSection.d.ts +130 -0
- package/dist/components/form-section/FormSection.js +206 -0
- package/dist/components/form-section/index.d.ts +2 -0
- package/dist/components/form-section/index.js +1 -0
- package/dist/components/heading/Heading.d.ts +69 -0
- package/dist/components/heading/Heading.js +79 -0
- package/dist/components/heading/index.d.ts +2 -0
- package/dist/components/heading/index.js +1 -0
- package/dist/components/heading-group/HeadingGroup.d.ts +258 -0
- package/dist/components/heading-group/HeadingGroup.js +255 -0
- package/dist/components/heading-group/index.d.ts +2 -0
- package/dist/components/heading-group/index.js +1 -0
- package/dist/components/hero/Hero.d.ts +268 -0
- package/dist/components/hero/Hero.js +316 -0
- package/dist/components/hero/index.d.ts +2 -0
- package/dist/components/hero/index.js +1 -0
- package/dist/components/icon/Icon.d.ts +27 -0
- package/dist/components/icon/Icon.js +30 -0
- package/dist/components/icon/index.d.ts +3 -0
- package/dist/components/icon/index.js +3 -0
- package/dist/components/icon-button/IconButton.d.ts +75 -0
- package/dist/components/icon-button/IconButton.js +151 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +1 -0
- package/dist/components/item-row/ItemRow.d.ts +253 -0
- package/dist/components/item-row/ItemRow.js +496 -0
- package/dist/components/item-row/index.d.ts +2 -0
- package/dist/components/item-row/index.js +1 -0
- package/dist/components/list-row/ListRow.d.ts +165 -0
- package/dist/components/list-row/ListRow.js +233 -0
- package/dist/components/list-row/index.d.ts +2 -0
- package/dist/components/list-row/index.js +1 -0
- package/dist/components/menu/Menu.d.ts +64 -0
- package/dist/components/menu/Menu.js +186 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/modal/Modal.d.ts +272 -0
- package/dist/components/modal/Modal.js +788 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.js +1 -0
- package/dist/components/nav-link/NavLink.d.ts +123 -0
- package/dist/components/nav-link/NavLink.js +157 -0
- package/dist/components/nav-link/index.d.ts +2 -0
- package/dist/components/nav-link/index.js +1 -0
- package/dist/components/number-field/NumberField.d.ts +62 -0
- package/dist/components/number-field/NumberField.js +210 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/index.js +1 -0
- package/dist/components/pagination/Pagination.d.ts +133 -0
- package/dist/components/pagination/Pagination.js +217 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/pagination/index.js +3 -0
- package/dist/components/popover-surface/index.d.ts +2 -0
- package/dist/components/popover-surface/index.js +1 -0
- package/dist/components/progress-bar/ProgressBar.d.ts +260 -0
- package/dist/components/progress-bar/ProgressBar.js +470 -0
- package/dist/components/progress-bar/index.d.ts +2 -0
- package/dist/components/progress-bar/index.js +1 -0
- package/dist/components/promo-sticker/PromoSticker.d.ts +204 -0
- package/dist/components/promo-sticker/PromoSticker.js +177 -0
- package/dist/components/promo-sticker/index.d.ts +2 -0
- package/dist/components/promo-sticker/index.js +1 -0
- package/dist/components/promo-surface/PromoSurface.d.ts +94 -0
- package/dist/components/promo-surface/PromoSurface.js +119 -0
- package/dist/components/promo-surface/index.d.ts +2 -0
- package/dist/components/promo-surface/index.js +1 -0
- package/dist/components/radio/Radio.d.ts +92 -0
- package/dist/components/radio/Radio.js +171 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/index.js +1 -0
- package/dist/components/radio-group/RadioGroup.d.ts +61 -0
- package/dist/components/radio-group/RadioGroup.js +51 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/select/Select.d.ts +65 -0
- package/dist/components/select/Select.js +176 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/select-field/SelectField.d.ts +16 -0
- package/dist/components/select-field/SelectField.js +55 -0
- package/dist/components/select-field/index.d.ts +2 -0
- package/dist/components/select-field/index.js +1 -0
- package/dist/components/skeleton/Skeleton.d.ts +64 -0
- package/dist/components/skeleton/Skeleton.js +65 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/split-button/SplitButton.d.ts +80 -0
- package/dist/components/split-button/SplitButton.js +182 -0
- package/dist/components/split-button/index.d.ts +2 -0
- package/dist/components/split-button/index.js +1 -0
- package/dist/components/status-summary-bar/StatusSummaryBar.d.ts +118 -0
- package/dist/components/status-summary-bar/StatusSummaryBar.js +278 -0
- package/dist/components/status-summary-bar/index.d.ts +2 -0
- package/dist/components/status-summary-bar/index.js +1 -0
- package/dist/components/subject-lookup-field/SubjectLookupField.d.ts +157 -0
- package/dist/components/subject-lookup-field/SubjectLookupField.js +663 -0
- package/dist/components/subject-lookup-field/index.d.ts +2 -0
- package/dist/components/subject-lookup-field/index.js +1 -0
- package/dist/components/switch/Switch.d.ts +152 -0
- package/dist/components/switch/Switch.js +307 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/table/Table.d.ts +5 -0
- package/dist/components/table/Table.js +601 -0
- package/dist/components/table/index.d.ts +6 -0
- package/dist/components/table/index.js +6 -0
- package/dist/components/text-field/TextField.d.ts +65 -0
- package/dist/components/text-field/TextField.js +173 -0
- package/dist/components/text-field/index.d.ts +2 -0
- package/dist/components/text-field/index.js +1 -0
- package/dist/components/text-link/TextLink.d.ts +260 -0
- package/dist/components/text-link/TextLink.js +303 -0
- package/dist/components/text-link/index.d.ts +2 -0
- package/dist/components/text-link/index.js +1 -0
- package/dist/components/textarea/Textarea.d.ts +93 -0
- package/dist/components/textarea/Textarea.js +256 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +129 -0
- package/dist/components/tooltip/Tooltip.js +457 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/unit-field/UnitField.d.ts +46 -0
- package/dist/components/unit-field/UnitField.js +133 -0
- package/dist/components/unit-field/index.d.ts +2 -0
- package/dist/components/unit-field/index.js +1 -0
- package/dist/icons/icon-registry.generated.js +500 -0
- package/dist/icons/icon-types.generated.d.ts +2 -0
- package/dist/icons/icon-types.generated.js +126 -0
- package/dist/index.d.ts +132 -0
- package/dist/index.js +75 -0
- package/dist/internal/BottomSheet.js +496 -0
- package/dist/internal/FodsProvider.d.ts +25 -0
- package/dist/internal/FodsProvider.js +32 -0
- package/dist/internal/MotionCaret.js +35 -0
- package/dist/internal/NumberFormatInput.d.ts +21 -0
- package/dist/internal/NumberFormatInput.js +126 -0
- package/dist/internal/SummaryDonut.d.ts +3 -0
- package/dist/internal/SummaryDonut.js +300 -0
- package/dist/internal/buttonSegment.d.ts +44 -0
- package/dist/internal/buttonSegment.js +126 -0
- package/dist/internal/collapseRoom.js +128 -0
- package/dist/internal/comboboxKeys.js +44 -0
- package/dist/internal/contentPresence.js +46 -0
- package/dist/internal/dayCell.js +95 -0
- package/dist/internal/dialogPortal.d.ts +2 -0
- package/dist/internal/dialogPortal.js +21 -0
- package/dist/internal/donutSweeps.js +65 -0
- package/dist/internal/enterOnViewGeometry.js +46 -0
- package/dist/internal/faqItem.js +80 -0
- package/dist/internal/floatingLabelMotion.js +68 -0
- package/dist/internal/formBlockContext.d.ts +22 -0
- package/dist/internal/formBlockContext.js +20 -0
- package/dist/internal/heightRoom.js +87 -0
- package/dist/internal/numberSeparators.js +62 -0
- package/dist/internal/overlayMotion.js +48 -0
- package/dist/internal/paginationItem.d.ts +8 -0
- package/dist/internal/paginationItem.js +22 -0
- package/dist/internal/popoverSurface.d.ts +8 -0
- package/dist/internal/popoverSurface.js +23 -0
- package/dist/internal/portalContainer.d.ts +1 -0
- package/dist/internal/portalContainer.js +6 -0
- package/dist/internal/progressBarItem.d.ts +207 -0
- package/dist/internal/progressBarItem.js +264 -0
- package/dist/internal/selectionControlText.js +12 -0
- package/dist/internal/statusSummaryParts.js +371 -0
- package/dist/internal/summaryMotion.js +75 -0
- package/dist/internal/table/ChildConnector.js +62 -0
- package/dist/internal/table/ChildRowPrefix.d.ts +9 -0
- package/dist/internal/table/ChildRowPrefix.js +27 -0
- package/dist/internal/table/ColumnSettings.js +135 -0
- package/dist/internal/table/ScrollRegion.js +114 -0
- package/dist/internal/table/TableEmpty.js +93 -0
- package/dist/internal/table/TableLayout.d.ts +17 -0
- package/dist/internal/table/TableLayout.js +29 -0
- package/dist/internal/table/TableLoadStatus.js +56 -0
- package/dist/internal/table/TableMobile.js +488 -0
- package/dist/internal/table/TruncatedCell.js +33 -0
- package/dist/internal/table/emptyValue.js +10 -0
- package/dist/internal/table/features.d.ts +41 -0
- package/dist/internal/table/features.js +31 -0
- package/dist/internal/table/recipes.js +227 -0
- package/dist/internal/table/rowClick.js +9 -0
- package/dist/internal/table/types.d.ts +325 -0
- package/dist/internal/table/types.js +13 -0
- package/dist/internal/tailwind-variants.d.ts +3 -0
- package/dist/internal/tailwind-variants.js +37 -0
- package/dist/internal/tooltipContext.js +5 -0
- package/dist/internal/tw-merge-config.generated.js +314 -0
- package/dist/internal/useAnchoredPanel.d.ts +87 -0
- package/dist/internal/useAnchoredPanel.js +108 -0
- package/dist/internal/useCountUp.js +53 -0
- package/dist/internal/useDateFieldTrigger.js +183 -0
- package/dist/internal/useEChart.js +59 -0
- package/dist/internal/useEnterOnView.js +42 -0
- package/dist/internal/useFloatingBar.js +100 -0
- package/dist/internal/useFormReset.js +37 -0
- package/dist/internal/useIsMobile.js +44 -0
- package/dist/internal/useOneRowOverflow.js +88 -0
- package/dist/internal/usePrefersReducedMotion.js +25 -0
- package/dist/internal/useReturnFocus.js +26 -0
- package/dist/internal/utils.d.ts +7 -0
- package/dist/internal/utils.js +58 -0
- package/dist/node_modules/@tanstack/store/dist/store.d.ts +29 -0
- package/dist/node_modules/@tanstack/store/dist/types.d.ts +38 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/cells/coreCellsFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/cells/coreCellsFeature.types.d.ts +53 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/columns/coreColumnsFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/columns/coreColumnsFeature.types.d.ts +90 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/coreFeatures.d.ts +17 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/headers/coreHeadersFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/headers/coreHeadersFeature.types.d.ts +114 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/reactivity/coreReactivityFeature.types.d.ts +51 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/row-models/coreRowModelsFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/row-models/coreRowModelsFeature.types.d.ts +29 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/rows/coreRowsFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/rows/coreRowsFeature.types.d.ts +129 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/table/coreTablesFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/table/coreTablesFeature.types.d.ts +203 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/cell-selection/cellSelectionFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/cell-selection/cellSelectionFeature.types.d.ts +294 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/cell-spanning/cellSpanningFeature.d.ts +11 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/cell-spanning/cellSpanningFeature.types.d.ts +148 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-faceting/columnFacetingFeature.d.ts +12 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-faceting/columnFacetingFeature.types.d.ts +63 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-filtering/columnFilteringFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-filtering/columnFilteringFeature.types.d.ts +209 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-filtering/filterFns.d.ts +35 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-grouping/columnGroupingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-grouping/columnGroupingFeature.types.d.ts +128 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-ordering/columnOrderingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-ordering/columnOrderingFeature.types.d.ts +82 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-pinning/columnPinningFeature.d.ts +11 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-pinning/columnPinningFeature.types.d.ts +195 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-resizing/columnResizingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-resizing/columnResizingFeature.types.d.ts +73 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-sizing/columnSizingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-sizing/columnSizingFeature.types.d.ts +134 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-visibility/columnVisibilityFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +92 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/global-filtering/globalFilteringFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/global-filtering/globalFilteringFeature.types.d.ts +67 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-aggregation/aggregationFns.d.ts +23 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-aggregation/rowAggregationFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-aggregation/rowAggregationFeature.types.d.ts +183 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-aggregation/rowAggregationFeature.utils.d.ts +18 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-expanding/rowExpandingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-expanding/rowExpandingFeature.types.d.ts +125 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-pagination/rowPaginationFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-pagination/rowPaginationFeature.types.d.ts +135 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-pinning/rowPinningFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-pinning/rowPinningFeature.types.d.ts +76 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-selection/rowSelectionFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-selection/rowSelectionFeature.types.d.ts +187 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-sorting/rowSortingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-sorting/rowSortingFeature.types.d.ts +236 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-sorting/sortFns.d.ts +23 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/stockFeatures.d.ts +37 -0
- package/dist/node_modules/@tanstack/table-core/dist/helpers/columnHelper.d.ts +47 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Cell.d.ts +16 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Column.d.ts +30 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/ColumnDef.d.ts +123 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Header.d.ts +12 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/HeaderGroup.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Row.d.ts +24 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/RowModel.d.ts +19 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/RowModelFns.d.ts +11 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Table.d.ts +53 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/TableFeatures.d.ts +416 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/TableOptions.d.ts +78 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/TableState.d.ts +46 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/type-utils.d.ts +25 -0
- package/dist/shared.css +179 -0
- package/dist/styles.css +5467 -0
- package/dist/theme.css +314 -0
- package/dist/theme.map.json +278 -0
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/index.js +1 -0
- package/dist/tokens/tokens.generated.d.ts +2040 -0
- package/dist/tokens/tokens.generated.js +2053 -0
- package/dist/tokens.css +484 -0
- package/dist/tokens.flat.json +429 -0
- package/docs/Consuming.mdx +379 -0
- package/docs/Contributing.mdx +78 -0
- package/docs/ForAgents.mdx +53 -0
- package/docs/Introduction.mdx +54 -0
- package/llms.txt +556 -0
- package/package.json +357 -4
- package/src/components/action-row/ActionRow.mdx +686 -0
- package/src/components/action-row/ActionRow.stories.tsx +669 -0
- package/src/components/action-row/ActionRow.tsx +632 -0
- package/src/components/action-row/index.ts +9 -0
- package/src/components/alert/Alert.mdx +377 -0
- package/src/components/alert/Alert.stories.tsx +674 -0
- package/src/components/alert/Alert.tsx +579 -0
- package/src/components/alert/index.ts +13 -0
- package/src/components/anchored-panel/AnchoredPanel.mdx +381 -0
- package/src/components/anchored-panel/AnchoredPanel.stories.tsx +593 -0
- package/src/components/anchored-panel/AnchoredPanel.tsx +176 -0
- package/src/components/anchored-panel/index.ts +15 -0
- package/src/components/badge/Badge.mdx +487 -0
- package/src/components/badge/Badge.stories.tsx +375 -0
- package/src/components/badge/Badge.tsx +360 -0
- package/src/components/badge/index.ts +10 -0
- package/src/components/banner/Banner.mdx +704 -0
- package/src/components/banner/Banner.stories.tsx +448 -0
- package/src/components/banner/Banner.tsx +602 -0
- package/src/components/banner/index.ts +14 -0
- package/src/components/button/Button.mdx +286 -0
- package/src/components/button/Button.stories.tsx +381 -0
- package/src/components/button/Button.tsx +384 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/button-group/ButtonGroup.mdx +512 -0
- package/src/components/button-group/ButtonGroup.stories.tsx +714 -0
- package/src/components/button-group/ButtonGroup.tsx +491 -0
- package/src/components/button-group/index.ts +10 -0
- package/src/components/card-select/CardSelect.mdx +662 -0
- package/src/components/card-select/CardSelect.stories.tsx +784 -0
- package/src/components/card-select/CardSelect.tsx +783 -0
- package/src/components/card-select/CardSelectGroup.tsx +169 -0
- package/src/components/card-select/index.ts +18 -0
- package/src/components/checkbox/Checkbox.mdx +269 -0
- package/src/components/checkbox/Checkbox.stories.tsx +306 -0
- package/src/components/checkbox/Checkbox.tsx +343 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/chip/Chip.mdx +683 -0
- package/src/components/chip/Chip.stories.tsx +734 -0
- package/src/components/chip/Chip.tsx +732 -0
- package/src/components/chip/index.ts +9 -0
- package/src/components/column-header/ColumnHeader.mdx +301 -0
- package/src/components/column-header/ColumnHeader.stories.tsx +319 -0
- package/src/components/column-header/ColumnHeader.tsx +287 -0
- package/src/components/column-header/index.ts +7 -0
- package/src/components/combobox-field/Combobox.tsx +693 -0
- package/src/components/combobox-field/ComboboxField.mdx +525 -0
- package/src/components/combobox-field/ComboboxField.stories.tsx +502 -0
- package/src/components/combobox-field/ComboboxField.tsx +259 -0
- package/src/components/combobox-field/index.ts +12 -0
- package/src/components/date-field/DateField.mdx +340 -0
- package/src/components/date-field/DateField.stories.tsx +221 -0
- package/src/components/date-field/DateField.tsx +176 -0
- package/src/components/date-field/index.ts +1 -0
- package/src/components/date-picker/DatePicker.mdx +436 -0
- package/src/components/date-picker/DatePicker.stories.tsx +458 -0
- package/src/components/date-picker/DatePicker.tsx +688 -0
- package/src/components/date-picker/index.ts +9 -0
- package/src/components/divider/Divider.mdx +256 -0
- package/src/components/divider/Divider.stories.tsx +177 -0
- package/src/components/divider/Divider.tsx +193 -0
- package/src/components/divider/index.ts +1 -0
- package/src/components/drawer/Drawer.mdx +518 -0
- package/src/components/drawer/Drawer.stories.tsx +392 -0
- package/src/components/drawer/Drawer.tsx +683 -0
- package/src/components/drawer/index.ts +1 -0
- package/src/components/dropdown-button/DropdownButton.mdx +285 -0
- package/src/components/dropdown-button/DropdownButton.stories.tsx +398 -0
- package/src/components/dropdown-button/DropdownButton.tsx +198 -0
- package/src/components/dropdown-button/index.ts +7 -0
- package/src/components/faq/FAQ.mdx +364 -0
- package/src/components/faq/FAQ.stories.tsx +343 -0
- package/src/components/faq/FAQ.tsx +337 -0
- package/src/components/faq/index.ts +1 -0
- package/src/components/field/Field.mdx +129 -0
- package/src/components/field/Field.stories.tsx +461 -0
- package/src/components/field/Field.tsx +765 -0
- package/src/components/field/index.ts +20 -0
- package/src/components/field-pair/FieldPair.mdx +308 -0
- package/src/components/field-pair/FieldPair.stories.tsx +530 -0
- package/src/components/field-pair/FieldPair.tsx +796 -0
- package/src/components/field-pair/index.ts +9 -0
- package/src/components/file-upload/FileUpload.mdx +345 -0
- package/src/components/file-upload/FileUpload.stories.tsx +698 -0
- package/src/components/file-upload/FileUpload.tsx +802 -0
- package/src/components/file-upload/index.ts +6 -0
- package/src/components/filter-chip/FilterChip.mdx +778 -0
- package/src/components/filter-chip/FilterChip.stories.tsx +827 -0
- package/src/components/filter-chip/FilterChip.tsx +881 -0
- package/src/components/filter-chip/index.ts +11 -0
- package/src/components/filter-facet/FilterFacet.mdx +536 -0
- package/src/components/filter-facet/FilterFacet.stories.tsx +506 -0
- package/src/components/filter-facet/FilterFacet.tsx +1160 -0
- package/src/components/filter-facet/index.ts +7 -0
- package/src/components/firm-avatar/FirmAvatar.mdx +280 -0
- package/src/components/firm-avatar/FirmAvatar.stories.tsx +147 -0
- package/src/components/firm-avatar/FirmAvatar.tsx +172 -0
- package/src/components/firm-avatar/index.ts +7 -0
- package/src/components/form-actions/FormActions.mdx +518 -0
- package/src/components/form-actions/FormActions.stories.tsx +621 -0
- package/src/components/form-actions/FormActions.tsx +273 -0
- package/src/components/form-actions/index.ts +6 -0
- package/src/components/form-block/FormBlock.mdx +728 -0
- package/src/components/form-block/FormBlock.stories.tsx +813 -0
- package/src/components/form-block/FormBlock.tsx +679 -0
- package/src/components/form-block/index.ts +13 -0
- package/src/components/form-section/FormSection.mdx +436 -0
- package/src/components/form-section/FormSection.stories.tsx +407 -0
- package/src/components/form-section/FormSection.tsx +290 -0
- package/src/components/form-section/index.ts +17 -0
- package/src/components/heading/Heading.mdx +206 -0
- package/src/components/heading/Heading.stories.tsx +169 -0
- package/src/components/heading/Heading.tsx +124 -0
- package/src/components/heading/index.ts +8 -0
- package/src/components/heading-group/HeadingGroup.mdx +521 -0
- package/src/components/heading-group/HeadingGroup.stories.tsx +353 -0
- package/src/components/heading-group/HeadingGroup.tsx +396 -0
- package/src/components/heading-group/index.ts +7 -0
- package/src/components/hero/Hero.mdx +742 -0
- package/src/components/hero/Hero.stories.tsx +527 -0
- package/src/components/hero/Hero.tsx +807 -0
- package/src/components/hero/index.ts +1 -0
- package/src/components/icon/Icon.mdx +329 -0
- package/src/components/icon/Icon.stories.tsx +398 -0
- package/src/components/icon/Icon.tsx +97 -0
- package/src/components/icon/index.ts +2 -0
- package/src/components/icon-button/IconButton.mdx +206 -0
- package/src/components/icon-button/IconButton.stories.tsx +341 -0
- package/src/components/icon-button/IconButton.tsx +273 -0
- package/src/components/icon-button/index.ts +1 -0
- package/src/components/item-row/ItemRow.mdx +533 -0
- package/src/components/item-row/ItemRow.stories.tsx +434 -0
- package/src/components/item-row/ItemRow.tsx +676 -0
- package/src/components/item-row/index.ts +9 -0
- package/src/components/list-row/ListRow.mdx +404 -0
- package/src/components/list-row/ListRow.stories.tsx +404 -0
- package/src/components/list-row/ListRow.tsx +424 -0
- package/src/components/list-row/index.ts +1 -0
- package/src/components/menu/Menu.mdx +268 -0
- package/src/components/menu/Menu.stories.tsx +455 -0
- package/src/components/menu/Menu.tsx +452 -0
- package/src/components/menu/index.ts +1 -0
- package/src/components/modal/Modal.mdx +854 -0
- package/src/components/modal/Modal.stories.tsx +881 -0
- package/src/components/modal/Modal.tsx +1434 -0
- package/src/components/modal/index.ts +1 -0
- package/src/components/nav-link/NavLink.mdx +196 -0
- package/src/components/nav-link/NavLink.stories.tsx +243 -0
- package/src/components/nav-link/NavLink.tsx +222 -0
- package/src/components/nav-link/index.ts +1 -0
- package/src/components/number-field/NumberField.mdx +223 -0
- package/src/components/number-field/NumberField.stories.tsx +291 -0
- package/src/components/number-field/NumberField.tsx +388 -0
- package/src/components/number-field/index.ts +6 -0
- package/src/components/pagination/Pagination.mdx +305 -0
- package/src/components/pagination/Pagination.stories.tsx +333 -0
- package/src/components/pagination/Pagination.tsx +343 -0
- package/src/components/pagination/index.ts +8 -0
- package/src/components/popover-surface/PopoverSurface.mdx +158 -0
- package/src/components/popover-surface/PopoverSurface.stories.tsx +421 -0
- package/src/components/popover-surface/index.ts +1 -0
- package/src/components/progress-bar/ProgressBar.mdx +802 -0
- package/src/components/progress-bar/ProgressBar.stories.tsx +533 -0
- package/src/components/progress-bar/ProgressBar.tsx +654 -0
- package/src/components/progress-bar/index.ts +9 -0
- package/src/components/promo-sticker/PromoSticker.mdx +436 -0
- package/src/components/promo-sticker/PromoSticker.stories.tsx +363 -0
- package/src/components/promo-sticker/PromoSticker.tsx +313 -0
- package/src/components/promo-sticker/index.ts +7 -0
- package/src/components/promo-surface/PromoSurface.mdx +399 -0
- package/src/components/promo-surface/PromoSurface.stories.tsx +270 -0
- package/src/components/promo-surface/PromoSurface.tsx +305 -0
- package/src/components/promo-surface/index.ts +7 -0
- package/src/components/radio/Radio.mdx +243 -0
- package/src/components/radio/Radio.stories.tsx +307 -0
- package/src/components/radio/Radio.tsx +288 -0
- package/src/components/radio/index.ts +1 -0
- package/src/components/radio-group/RadioGroup.mdx +119 -0
- package/src/components/radio-group/RadioGroup.stories.tsx +225 -0
- package/src/components/radio-group/RadioGroup.tsx +139 -0
- package/src/components/radio-group/index.ts +1 -0
- package/src/components/select/Select.mdx +241 -0
- package/src/components/select/Select.stories.tsx +404 -0
- package/src/components/select/Select.tsx +381 -0
- package/src/components/select/index.ts +1 -0
- package/src/components/select-field/SelectField.mdx +324 -0
- package/src/components/select-field/SelectField.stories.tsx +460 -0
- package/src/components/select-field/SelectField.tsx +138 -0
- package/src/components/select-field/index.ts +1 -0
- package/src/components/skeleton/Skeleton.mdx +194 -0
- package/src/components/skeleton/Skeleton.stories.tsx +260 -0
- package/src/components/skeleton/Skeleton.tsx +107 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/split-button/SplitButton.mdx +445 -0
- package/src/components/split-button/SplitButton.stories.tsx +465 -0
- package/src/components/split-button/SplitButton.tsx +361 -0
- package/src/components/split-button/index.ts +7 -0
- package/src/components/status-summary-bar/StatusSummaryBar.mdx +338 -0
- package/src/components/status-summary-bar/StatusSummaryBar.stories.tsx +408 -0
- package/src/components/status-summary-bar/StatusSummaryBar.tsx +428 -0
- package/src/components/status-summary-bar/index.ts +8 -0
- package/src/components/subject-lookup-field/SubjectLookupField.mdx +378 -0
- package/src/components/subject-lookup-field/SubjectLookupField.stories.tsx +393 -0
- package/src/components/subject-lookup-field/SubjectLookupField.tsx +1079 -0
- package/src/components/subject-lookup-field/index.ts +11 -0
- package/src/components/switch/Switch.mdx +376 -0
- package/src/components/switch/Switch.stories.tsx +296 -0
- package/src/components/switch/Switch.tsx +483 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/table/Table.mdx +575 -0
- package/src/components/table/Table.stories.tsx +1049 -0
- package/src/components/table/Table.tsx +745 -0
- package/src/components/table/TableConsumers.stories.tsx +195 -0
- package/src/components/table/_tableFixtures.ts +1189 -0
- package/src/components/table/index.ts +22 -0
- package/src/components/text-field/TextField.mdx +479 -0
- package/src/components/text-field/TextField.stories.tsx +366 -0
- package/src/components/text-field/TextField.tsx +391 -0
- package/src/components/text-field/index.ts +8 -0
- package/src/components/text-link/TextLink.mdx +353 -0
- package/src/components/text-link/TextLink.stories.tsx +458 -0
- package/src/components/text-link/TextLink.tsx +504 -0
- package/src/components/text-link/index.ts +10 -0
- package/src/components/textarea/Textarea.mdx +244 -0
- package/src/components/textarea/Textarea.stories.tsx +371 -0
- package/src/components/textarea/Textarea.tsx +489 -0
- package/src/components/textarea/index.ts +9 -0
- package/src/components/tooltip/Tooltip.mdx +462 -0
- package/src/components/tooltip/Tooltip.stories.tsx +500 -0
- package/src/components/tooltip/Tooltip.tsx +756 -0
- package/src/components/tooltip/index.ts +13 -0
- package/src/components/unit-field/UnitField.mdx +215 -0
- package/src/components/unit-field/UnitField.stories.tsx +291 -0
- package/src/components/unit-field/UnitField.tsx +255 -0
- package/src/components/unit-field/index.ts +7 -0
- package/src/icons/icon-registry.generated.ts +510 -0
- package/src/icons/icon-types.generated.ts +256 -0
- package/src/index.ts +71 -0
- package/src/internal/BottomSheet.tsx +714 -0
- package/src/internal/FodsProvider.tsx +36 -0
- package/src/internal/MotionCaret.tsx +53 -0
- package/src/internal/NumberFormatInput.tsx +276 -0
- package/src/internal/SummaryDonut.tsx +359 -0
- package/src/internal/buttonSegment.ts +241 -0
- package/src/internal/collapseRoom.ts +130 -0
- package/src/internal/comboboxKeys.ts +90 -0
- package/src/internal/contentPresence.ts +46 -0
- package/src/internal/dayCell.ts +274 -0
- package/src/internal/dialogPortal.ts +50 -0
- package/src/internal/donutSweeps.ts +77 -0
- package/src/internal/enterOnViewGeometry.ts +53 -0
- package/src/internal/faqItem.ts +104 -0
- package/src/internal/floatingLabelMotion.tsx +109 -0
- package/src/internal/formBlockContext.ts +27 -0
- package/src/internal/heightRoom.ts +135 -0
- package/src/internal/numberSeparators.ts +93 -0
- package/src/internal/overlayMotion.tsx +32 -0
- package/src/internal/paginationItem.ts +106 -0
- package/src/internal/popoverSurface.ts +78 -0
- package/src/internal/portalContainer.ts +11 -0
- package/src/internal/progressBarItem.ts +356 -0
- package/src/internal/selectionControlText.ts +42 -0
- package/src/internal/statusSummaryParts.tsx +475 -0
- package/src/internal/summaryMotion.ts +111 -0
- package/src/internal/table/ChildConnector.tsx +57 -0
- package/src/internal/table/ChildRowPrefix.tsx +21 -0
- package/src/internal/table/ColumnSettings.tsx +194 -0
- package/src/internal/table/ScrollRegion.tsx +176 -0
- package/src/internal/table/TableEmpty.tsx +99 -0
- package/src/internal/table/TableLayout.tsx +29 -0
- package/src/internal/table/TableLoadStatus.tsx +60 -0
- package/src/internal/table/TableMobile.tsx +582 -0
- package/src/internal/table/TruncatedCell.tsx +35 -0
- package/src/internal/table/emptyValue.ts +11 -0
- package/src/internal/table/features.ts +44 -0
- package/src/internal/table/recipes.ts +263 -0
- package/src/internal/table/rowClick.ts +8 -0
- package/src/internal/table/types.ts +342 -0
- package/src/internal/tailwind-variants.ts +65 -0
- package/src/internal/tooltipContext.ts +15 -0
- package/src/internal/tw-merge-config.generated.ts +275 -0
- package/src/internal/useAnchoredPanel.ts +340 -0
- package/src/internal/useCountUp.ts +65 -0
- package/src/internal/useDateFieldTrigger.tsx +357 -0
- package/src/internal/useEChart.ts +88 -0
- package/src/internal/useEnterOnView.ts +80 -0
- package/src/internal/useFloatingBar.ts +125 -0
- package/src/internal/useFormReset.ts +47 -0
- package/src/internal/useIsMobile.ts +64 -0
- package/src/internal/useNoImplicitSubmit.ts +41 -0
- package/src/internal/useOneRowOverflow.ts +103 -0
- package/src/internal/usePrefersReducedMotion.ts +27 -0
- package/src/internal/useReturnFocus.ts +34 -0
- package/src/internal/utils.ts +58 -0
- package/src/recipes/EmptyState.stories.tsx +105 -0
- package/src/recipes/Form.stories.tsx +355 -0
- package/src/recipes/ModalWithForm.stories.tsx +219 -0
- package/src/recipes/Recipes.mdx +61 -0
- package/src/recipes/TableWithFilters.stories.tsx +278 -0
- package/src/storybook/FodsFamily.tsx +39 -0
- package/src/storybook/Section.tsx +36 -0
- package/src/storybook/a11y.ts +24 -0
- package/src/storybook/assets/banner-character-bartender.webp +0 -0
- package/src/storybook/assets/banner-invoice-sheet-left.webp +0 -0
- package/src/storybook/assets/banner-invoice-sheet-right.webp +0 -0
- package/src/storybook/assets/invoice-hero.webp +0 -0
- package/src/storybook/assets/invoice.webp +0 -0
- package/src/storybook/assets/section-document-info.svg +21 -0
- package/src/storybook/assets/section-gear-checklist.svg +11 -0
- package/src/storybook/assets/section-person-arrow-in.svg +15 -0
- package/src/storybook/assets/section-person-arrow-out.svg +22 -0
- package/src/storybook/assets/section-receipt-dollar.svg +23 -0
- package/src/storybook/assets/table-empty-folder-empty.png +0 -0
- package/src/storybook/assets/table-empty-folder-magnifying-glass.png +0 -0
- package/src/storybook/assets/table-empty-funnel.png +0 -0
- package/src/storybook/assets/table-empty-load-failed.png +0 -0
- package/src/storybook/assets/wallet-spot.png +0 -0
- package/src/storybook/assets.d.ts +17 -0
- package/src/storybook/componentDoc.ts +41 -0
- package/src/storybook/fitFrame.tsx +70 -0
- package/src/storybook/forceStates.tsx +647 -0
- package/src/storybook/illustrations.tsx +66 -0
- package/src/storybook/viewportFrame.tsx +58 -0
- package/src/styles/assets/label-brush-1.svg +6 -0
- package/src/styles/assets/pattern-dark.svg +113 -0
- package/src/styles/base.css +106 -0
- package/src/styles/index.css +15 -0
- package/src/styles/motion.css +157 -0
- package/src/styles/promo-sticker.css +27 -0
- package/src/styles/promo-surface.css +49 -0
- package/src/styles/shared.css +11 -0
- package/src/styles/theme.generated.css +314 -0
- package/src/styles/theme.map.json +278 -0
- package/src/styles/tracking.generated.css +12 -0
- package/src/tokens/index.ts +4 -0
- package/src/tokens/tokens.generated.ts +542 -0
|
@@ -0,0 +1,714 @@
|
|
|
1
|
+
import { Fragment, useState, type ReactNode } from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
import { ButtonGroup, ButtonGroupItem } from './ButtonGroup';
|
|
4
|
+
import { Button } from '../button/Button';
|
|
5
|
+
import { Icon } from '../icon/Icon';
|
|
6
|
+
import { Menu, type MenuEntry } from '../menu/Menu';
|
|
7
|
+
import { Section, Showcase } from '../../storybook/Section';
|
|
8
|
+
import { FodsFamily } from '../../storybook/FodsFamily';
|
|
9
|
+
import { BUTTON_SEGMENT_FORCE_RING, BUTTON_SEGMENT_FORCE_STATE } from '../../storybook/forceStates';
|
|
10
|
+
import { componentDoc } from '../../storybook/componentDoc';
|
|
11
|
+
|
|
12
|
+
// Built against `button-group` manifest 1.4.1 (cell `_button-segment` 1.9.1).
|
|
13
|
+
const VARIANTS = ['primary', 'brand', 'secondary'] as const;
|
|
14
|
+
const SIZES = ['sm', 'md', 'lg'] as const;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The manifest has no `state` axis of its own — the group inherits the cell's
|
|
18
|
+
* (`_button-segment` axes.state) and applies it PER SEGMENT ("State is per-segment
|
|
19
|
+
* … the group itself has no state axis"). Hover / Active / Focus are pseudo-classes,
|
|
20
|
+
* so a docs grid cannot render them by passing anything: they are forced statically
|
|
21
|
+
* with the bare twins of the recipe's own classes, handed to the cell through
|
|
22
|
+
* `className`. Disabled and Loading are per-cell props; Open rides a real
|
|
23
|
+
* `data-state` attribute.
|
|
24
|
+
*/
|
|
25
|
+
const STATES = [
|
|
26
|
+
{ label: 'Default', props: {}, force: '' },
|
|
27
|
+
{ label: 'Hover', props: {}, force: 'hover' },
|
|
28
|
+
{ label: 'Active', props: {}, force: 'active' },
|
|
29
|
+
{ label: 'Focus', props: {}, force: 'ring' },
|
|
30
|
+
{ label: 'Disabled', props: { disabled: true }, force: '' },
|
|
31
|
+
{ label: 'Loading', props: { loading: true }, force: '' },
|
|
32
|
+
] as const;
|
|
33
|
+
|
|
34
|
+
const forceClass = (variant: (typeof VARIANTS)[number], force: string) => {
|
|
35
|
+
if (force === 'ring') return BUTTON_SEGMENT_FORCE_RING;
|
|
36
|
+
if (force === 'hover') return BUTTON_SEGMENT_FORCE_STATE[variant].hover;
|
|
37
|
+
if (force === 'active') return BUTTON_SEGMENT_FORCE_STATE[variant].active;
|
|
38
|
+
return undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const meta = {
|
|
42
|
+
title: 'Design System/Molecules/ButtonGroup',
|
|
43
|
+
component: ButtonGroup,
|
|
44
|
+
subcomponents: { ButtonGroupItem },
|
|
45
|
+
parameters: {
|
|
46
|
+
layout: 'centered',
|
|
47
|
+
docs: {
|
|
48
|
+
description: {
|
|
49
|
+
component: componentDoc({
|
|
50
|
+
summary:
|
|
51
|
+
'A connected row of related actions on ONE object — the action-bar pattern („Upravit · Duplikovat · Vytvořit navazující ▾ · Tisk · Smazat"). N cells fused by 1px dividers into a single control, N tab stops. 3 families × S/M/L; the cell count is variable and every cell is the shared Button Segment.',
|
|
52
|
+
useCases: [
|
|
53
|
+
'`primary` — filled blue, the in-product action bar',
|
|
54
|
+
'`brand` — filled orange, marketing / brand-tied surfaces',
|
|
55
|
+
'`secondary` — neutral outline, white cells with blue labels; the quiet toolbar',
|
|
56
|
+
],
|
|
57
|
+
bestPractices: [
|
|
58
|
+
'Group actions that operate on ONE object (a document, a table row, a toolbar) — grouping unrelated actions just to save space is a don’t',
|
|
59
|
+
'`aria-label` (or `aria-labelledby`) is required and names the OBJECT: „Akce dokumentu", never „Tlačítka"',
|
|
60
|
+
'Keep the labels parallel — all verbs, similar length — so the bar reads as one set',
|
|
61
|
+
'Minify to an icon-only cell (`icon` + `aria-label`) where the glyph is unambiguous (print, delete); never wrap or truncate a label instead',
|
|
62
|
+
'Follow the dependency rule: a destructive cell is `danger` inside a filled group and `danger-outline` inside an outline one — never an outline-red cell in a blue bar',
|
|
63
|
+
'Use `size="lg"` on touch surfaces — the only size meeting the 44-pixel target without extra hit area',
|
|
64
|
+
],
|
|
65
|
+
knownIssues: [
|
|
66
|
+
'A disabled cell keeps its tab stop and is marked `aria-disabled` — deliberately unlike `Button`, which uses the native attribute (`button-group.md` § Accessibility → Keyboard)',
|
|
67
|
+
'The menu PANEL of a caret cell is a separate component (`Menu`) — the cell owns only the affordance and `aria-expanded`',
|
|
68
|
+
'The § Responsive behaviour stages (measured minification, ⋯ overflow, mobile bottom bar) are marked *proposed* upstream and are NOT implemented — pick the cell content yourself for now',
|
|
69
|
+
],
|
|
70
|
+
docsLink: {
|
|
71
|
+
label: 'spec/04-molecules/button-group.md',
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
// No autodocs tag — ButtonGroup.mdx provides the dedicated Docs page.
|
|
78
|
+
} satisfies Meta<typeof ButtonGroup>;
|
|
79
|
+
|
|
80
|
+
export default meta;
|
|
81
|
+
type Story = StoryObj<typeof meta>;
|
|
82
|
+
|
|
83
|
+
/** The canonical document action bar, reused across the showcase stories. */
|
|
84
|
+
const documentActions = (
|
|
85
|
+
<>
|
|
86
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
87
|
+
<ButtonGroupItem leadingIcon={<Icon name="copy" />}>Duplikovat</ButtonGroupItem>
|
|
88
|
+
<ButtonGroupItem leadingIcon={<Icon name="paper-plane-tilt" />}>Odeslat</ButtonGroupItem>
|
|
89
|
+
</>
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
export const Playground: Story = {
|
|
93
|
+
args: {
|
|
94
|
+
variant: 'primary',
|
|
95
|
+
size: 'md',
|
|
96
|
+
'aria-label': 'Akce dokumentu',
|
|
97
|
+
children: documentActions,
|
|
98
|
+
},
|
|
99
|
+
argTypes: {
|
|
100
|
+
variant: { control: 'select', options: VARIANTS },
|
|
101
|
+
size: { control: 'select', options: SIZES },
|
|
102
|
+
'aria-label': { control: 'text' },
|
|
103
|
+
children: { control: false },
|
|
104
|
+
},
|
|
105
|
+
parameters: {
|
|
106
|
+
docs: {
|
|
107
|
+
description: {
|
|
108
|
+
story:
|
|
109
|
+
'Three peer actions on one document. Tab through it: each cell is its own stop with its own inset focus ring, and the group is announced once by its `aria-label`. Family and size are group-level — a cell never chooses its own size, so the bar always matches the buttons standing next to it.',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const Variants: Story = {
|
|
116
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
117
|
+
parameters: {
|
|
118
|
+
docs: {
|
|
119
|
+
description: {
|
|
120
|
+
story:
|
|
121
|
+
'The three families. The container fill IS the divider: white (`--bg-primary`) between filled cells, grey (`--outline-default`) between outline ones — where it also carries the outer edge outline. Keep one family per group; the Danger / Success exception has its own story below.',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
render: () => (
|
|
126
|
+
<Showcase>
|
|
127
|
+
{VARIANTS.map(v => (
|
|
128
|
+
<Section key={v} title={v}>
|
|
129
|
+
<ButtonGroup variant={v} aria-label="Akce dokumentu">
|
|
130
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
131
|
+
<ButtonGroupItem leadingIcon={<Icon name="copy" />}>Duplikovat</ButtonGroupItem>
|
|
132
|
+
<ButtonGroupItem leadingIcon={<Icon name="paper-plane-tilt" />}>Odeslat</ButtonGroupItem>
|
|
133
|
+
</ButtonGroup>
|
|
134
|
+
</Section>
|
|
135
|
+
))}
|
|
136
|
+
</Showcase>
|
|
137
|
+
),
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const Matrix: Story = {
|
|
141
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
142
|
+
parameters: {
|
|
143
|
+
docs: {
|
|
144
|
+
description: {
|
|
145
|
+
story:
|
|
146
|
+
'Full variant × size matrix, mirroring the Figma labelled grid (set 6070:14588). Rows = families, columns = sizes S / M / L. Every family keeps the same outer height per size — 32 / 40 / 44 — including the outline one, whose identity line is drawn as an overlay rather than a layout border.',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
render: () => (
|
|
151
|
+
<Showcase>
|
|
152
|
+
{VARIANTS.map(v => (
|
|
153
|
+
<FodsFamily key={v} name={v}>
|
|
154
|
+
<Section title={v} layout="row">
|
|
155
|
+
{SIZES.map(s => (
|
|
156
|
+
<ButtonGroup key={s} variant={v} size={s} aria-label="Akce dokumentu">
|
|
157
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
158
|
+
<ButtonGroupItem leadingIcon={<Icon name="copy" />}>Duplikovat</ButtonGroupItem>
|
|
159
|
+
<ButtonGroupItem leadingIcon={<Icon name="paper-plane-tilt" />}>Odeslat</ButtonGroupItem>
|
|
160
|
+
</ButtonGroup>
|
|
161
|
+
))}
|
|
162
|
+
</Section>
|
|
163
|
+
</FodsFamily>
|
|
164
|
+
))}
|
|
165
|
+
</Showcase>
|
|
166
|
+
),
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const Sizes: Story = {
|
|
170
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
171
|
+
parameters: {
|
|
172
|
+
docs: {
|
|
173
|
+
description: {
|
|
174
|
+
story:
|
|
175
|
+
'Heights 32 / 40 / 44 with a 20 / 24 / 24 glyph, inherited by every cell from the group. On a label cell the icon side is optically one `--space` step tighter than the text side; an icon-only cell is a square of exactly the row height. `lg` is the touch size — the only step meeting the 44-CSS-pixel WCAG target without extra hit area.',
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
render: () => (
|
|
180
|
+
<Showcase>
|
|
181
|
+
<Section title="Label cells (sm → lg)" layout="column">
|
|
182
|
+
{SIZES.map(s => (
|
|
183
|
+
<ButtonGroup key={s} size={s} aria-label="Akce dokumentu">
|
|
184
|
+
<ButtonGroupItem>Upravit</ButtonGroupItem>
|
|
185
|
+
<ButtonGroupItem>Duplikovat</ButtonGroupItem>
|
|
186
|
+
<ButtonGroupItem>Odeslat</ButtonGroupItem>
|
|
187
|
+
</ButtonGroup>
|
|
188
|
+
))}
|
|
189
|
+
</Section>
|
|
190
|
+
<Section title="With leading icons — optical padding (sm → lg)" layout="column">
|
|
191
|
+
{SIZES.map(s => (
|
|
192
|
+
<ButtonGroup key={s} size={s} aria-label="Akce dokumentu">
|
|
193
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
194
|
+
<ButtonGroupItem leadingIcon={<Icon name="copy" />}>Duplikovat</ButtonGroupItem>
|
|
195
|
+
<ButtonGroupItem leadingIcon={<Icon name="paper-plane-tilt" />}>Odeslat</ButtonGroupItem>
|
|
196
|
+
</ButtonGroup>
|
|
197
|
+
))}
|
|
198
|
+
</Section>
|
|
199
|
+
<Section title="Mixed — square icon cells keep the row height (sm → lg)" layout="column">
|
|
200
|
+
{SIZES.map(s => (
|
|
201
|
+
<ButtonGroup key={s} variant="secondary" size={s} aria-label="Akce faktury">
|
|
202
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
203
|
+
<ButtonGroupItem icon={<Icon name="printer" />} aria-label="Tisk" />
|
|
204
|
+
<ButtonGroupItem icon={<Icon name="download-simple" />} aria-label="Stáhnout" />
|
|
205
|
+
</ButtonGroup>
|
|
206
|
+
))}
|
|
207
|
+
</Section>
|
|
208
|
+
</Showcase>
|
|
209
|
+
),
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export const States: Story = {
|
|
213
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
214
|
+
parameters: {
|
|
215
|
+
docs: {
|
|
216
|
+
description: {
|
|
217
|
+
story:
|
|
218
|
+
'The cell state axis applied to the MIDDLE cell, per family. Hover / Active / Focus are **forced statically** — they are pseudo-classes, and `parameters.pseudo` cannot be trusted (Tailwind v4 wraps every `hover:` utility in `@media (hover: hover)`, which the addon does not rewrite), so the cell is handed the bare twin of the recipe’s own class. Every column therefore differs from Default without a live cursor. Only the middle cell changes in each row: state lives per segment, and the group itself has no state axis. Loading keeps the family ink on purpose (the cell manifest has no `loading` entry in `families[]`) and sets `aria-busy`; Disabled greys the cell but — unlike `Button` — keeps its tab stop, marking it `aria-disabled`.',
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
render: () => (
|
|
223
|
+
<Showcase>
|
|
224
|
+
<Section title="State × family (middle cell)" layout="column">
|
|
225
|
+
<div className="grid grid-cols-[6rem_repeat(6,minmax(0,1fr))] items-center gap-400">
|
|
226
|
+
<span />
|
|
227
|
+
{STATES.map(state => (
|
|
228
|
+
<span key={state.label} className="text-body-sm font-semibold text-text-secondary">
|
|
229
|
+
{state.label}
|
|
230
|
+
</span>
|
|
231
|
+
))}
|
|
232
|
+
{VARIANTS.map(variant => (
|
|
233
|
+
<Fragment key={variant}>
|
|
234
|
+
<span className="text-body-sm text-text-secondary">{variant}</span>
|
|
235
|
+
{STATES.map(state => (
|
|
236
|
+
<FodsFamily key={state.label} name={variant}>
|
|
237
|
+
<ButtonGroup variant={variant} aria-label="Akce dokumentu">
|
|
238
|
+
<ButtonGroupItem>Upravit</ButtonGroupItem>
|
|
239
|
+
<ButtonGroupItem
|
|
240
|
+
className={forceClass(variant, state.force)}
|
|
241
|
+
{...state.props}
|
|
242
|
+
>
|
|
243
|
+
{state.label}
|
|
244
|
+
</ButtonGroupItem>
|
|
245
|
+
<ButtonGroupItem>Odeslat</ButtonGroupItem>
|
|
246
|
+
</ButtonGroup>
|
|
247
|
+
</FodsFamily>
|
|
248
|
+
))}
|
|
249
|
+
</Fragment>
|
|
250
|
+
))}
|
|
251
|
+
</div>
|
|
252
|
+
</Section>
|
|
253
|
+
</Showcase>
|
|
254
|
+
),
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export const PerSegmentStates: Story = {
|
|
258
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
259
|
+
parameters: {
|
|
260
|
+
docs: {
|
|
261
|
+
description: {
|
|
262
|
+
story:
|
|
263
|
+
'Why the cells are N controls and not one: hovering „Upravit" must not light „Odeslat". Each row forces the state on ONE cell, so the dividers stay readable and it is visible which cell would respond to a click. The focus rows are the grouped-control **inset** double ring — 2px `--outline-focus` at the cell edge plus a 2px `--bg-primary` gap inside it — which is what keeps the indicator readable on a blue fill, where an offset ring of the same hue would vanish, and inside a clipped container, where an offset ring would be cut off. The last row is the ring on a **disabled** cell: since a disabled cell deliberately keeps its tab stop (`aria-disabled`, not the native attribute), Tab really does land on it, and a keyboard user who could not see the indicator there would not know where they are standing. Only that one cell is disabled, so the group stays live and keeps the family divider.',
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
render: () => (
|
|
268
|
+
<Showcase>
|
|
269
|
+
{VARIANTS.map(variant => (
|
|
270
|
+
<FodsFamily key={variant} name={variant}>
|
|
271
|
+
<Section title={variant} layout="row">
|
|
272
|
+
{[
|
|
273
|
+
{ label: 'Hover on the first cell', at: 0, force: 'hover' },
|
|
274
|
+
{ label: 'Hover on the last cell', at: 2, force: 'hover' },
|
|
275
|
+
{ label: 'Focus on the first cell', at: 0, force: 'ring' },
|
|
276
|
+
{ label: 'Focus on the middle cell', at: 1, force: 'ring' },
|
|
277
|
+
// The one row that shows the component's most distinctive a11y rule
|
|
278
|
+
// rather than a colour: a disabled cell keeps its tab stop, so Tab
|
|
279
|
+
// lands on it and the ring HAS to be visible there. Only that cell
|
|
280
|
+
// is disabled — the group is live, so the divider stays the family's.
|
|
281
|
+
{ label: 'Focus on a disabled cell', at: 1, force: 'ring', disabled: true },
|
|
282
|
+
].map(row => (
|
|
283
|
+
<div key={row.label} className="flex flex-col items-start gap-300">
|
|
284
|
+
<span className="text-body-sm text-text-secondary">{row.label}</span>
|
|
285
|
+
<ButtonGroup variant={variant} aria-label="Akce dokumentu">
|
|
286
|
+
{['Upravit', 'Duplikovat', 'Odeslat'].map((label, index) => (
|
|
287
|
+
<ButtonGroupItem
|
|
288
|
+
key={label}
|
|
289
|
+
className={index === row.at ? forceClass(variant, row.force) : undefined}
|
|
290
|
+
disabled={row.disabled === true && index === row.at}
|
|
291
|
+
>
|
|
292
|
+
{label}
|
|
293
|
+
</ButtonGroupItem>
|
|
294
|
+
))}
|
|
295
|
+
</ButtonGroup>
|
|
296
|
+
</div>
|
|
297
|
+
))}
|
|
298
|
+
</Section>
|
|
299
|
+
</FodsFamily>
|
|
300
|
+
))}
|
|
301
|
+
</Showcase>
|
|
302
|
+
),
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
export const CellCount: Story = {
|
|
306
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
307
|
+
parameters: {
|
|
308
|
+
docs: {
|
|
309
|
+
description: {
|
|
310
|
+
story:
|
|
311
|
+
'The cell count is a variable-length slot (manifest `properties[0]`), so corner rounding is derived from position, not asked of the caller: the first cell rounds its left corners, the last its right, the middle ones nothing — and a lone cell rounds both. The radius matters even though the container clips: the focus ring is an inset box-shadow painted inside the cell’s own border-box, so with square corners its bands would stay square where the control is round.',
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
render: () => (
|
|
316
|
+
<Showcase>
|
|
317
|
+
<Section title="One cell (rounds both ends)">
|
|
318
|
+
<ButtonGroup variant="secondary" aria-label="Akce dokumentu">
|
|
319
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
320
|
+
</ButtonGroup>
|
|
321
|
+
</Section>
|
|
322
|
+
<Section title="Two cells">
|
|
323
|
+
<ButtonGroup variant="secondary" aria-label="Akce dokumentu">
|
|
324
|
+
<ButtonGroupItem>Upravit</ButtonGroupItem>
|
|
325
|
+
<ButtonGroupItem>Odeslat</ButtonGroupItem>
|
|
326
|
+
</ButtonGroup>
|
|
327
|
+
</Section>
|
|
328
|
+
<Section title="Five cells — the full action bar">
|
|
329
|
+
<ButtonGroup variant="secondary" aria-label="Akce dokumentu">
|
|
330
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
331
|
+
<ButtonGroupItem leadingIcon={<Icon name="copy" />}>Duplikovat</ButtonGroupItem>
|
|
332
|
+
<ButtonGroupItem leadingIcon={<Icon name="invoice-new" />} caret>
|
|
333
|
+
Vytvořit navazující
|
|
334
|
+
</ButtonGroupItem>
|
|
335
|
+
<ButtonGroupItem icon={<Icon name="printer" />} aria-label="Tisk" />
|
|
336
|
+
<ButtonGroupItem variant="danger-outline" icon={<Icon name="trash" />} aria-label="Smazat" />
|
|
337
|
+
</ButtonGroup>
|
|
338
|
+
</Section>
|
|
339
|
+
</Showcase>
|
|
340
|
+
),
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
export const IconCells: Story = {
|
|
344
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
345
|
+
parameters: {
|
|
346
|
+
docs: {
|
|
347
|
+
description: {
|
|
348
|
+
story:
|
|
349
|
+
'Minification, the spec’s answer to a bar that no longer fits: a cell drops its label and becomes a square single-glyph cell (`icon`) — never a wrapped or mid-word-truncated label. Icon-only has no visible text, so `aria-label` is required by the TYPE, not by review: it carries the same verb the label would have shown („Tisk", „Smazat"). Only minify where the glyph is unambiguous.',
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
render: () => (
|
|
354
|
+
<Showcase>
|
|
355
|
+
<Section title="Full — every cell keeps its label" layout="column">
|
|
356
|
+
<ButtonGroup variant="secondary" aria-label="Akce dokumentu">
|
|
357
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
358
|
+
<ButtonGroupItem leadingIcon={<Icon name="copy" />}>Duplikovat</ButtonGroupItem>
|
|
359
|
+
<ButtonGroupItem leadingIcon={<Icon name="printer" />}>Tisk</ButtonGroupItem>
|
|
360
|
+
<ButtonGroupItem leadingIcon={<Icon name="trash" />}>Smazat</ButtonGroupItem>
|
|
361
|
+
</ButtonGroup>
|
|
362
|
+
</Section>
|
|
363
|
+
<Section title="Minified — the unambiguous glyphs drop their labels" layout="column">
|
|
364
|
+
<ButtonGroup variant="secondary" aria-label="Akce dokumentu">
|
|
365
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
366
|
+
<ButtonGroupItem leadingIcon={<Icon name="copy" />}>Duplikovat</ButtonGroupItem>
|
|
367
|
+
<ButtonGroupItem icon={<Icon name="printer" />} aria-label="Tisk" />
|
|
368
|
+
<ButtonGroupItem icon={<Icon name="trash" />} aria-label="Smazat" />
|
|
369
|
+
</ButtonGroup>
|
|
370
|
+
</Section>
|
|
371
|
+
<Section title="Icon-only bar — a toolbar cluster" layout="column">
|
|
372
|
+
<ButtonGroup variant="secondary" aria-label="Nástroje tabulky">
|
|
373
|
+
<ButtonGroupItem icon={<Icon name="funnel-simple" />} aria-label="Filtrovat" />
|
|
374
|
+
<ButtonGroupItem icon={<Icon name="magnifying-glass" />} aria-label="Hledat" />
|
|
375
|
+
<ButtonGroupItem icon={<Icon name="arrow-clockwise" />} aria-label="Obnovit" />
|
|
376
|
+
<ButtonGroupItem icon={<Icon name="dots-three" />} aria-label="Další akce" caret />
|
|
377
|
+
</ButtonGroup>
|
|
378
|
+
</Section>
|
|
379
|
+
</Showcase>
|
|
380
|
+
),
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
export const MenuSegment: Story = {
|
|
384
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
385
|
+
parameters: {
|
|
386
|
+
docs: {
|
|
387
|
+
description: {
|
|
388
|
+
story:
|
|
389
|
+
'A cell that opens a menu: `caret` renders the affordance and adds `aria-haspopup="menu"` plus `aria-expanded`, written explicitly in BOTH states. Open has no token of its own — it re-uses the Active visual and rotates the caret 180°, identical to `DropdownButton`. The panel itself is the `Menu` component; this cell owns only the affordance and the announced state. Click the third cell to toggle it.',
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
render: function MenuSegmentStory() {
|
|
394
|
+
const [open, setOpen] = useState(false);
|
|
395
|
+
return (
|
|
396
|
+
<Showcase>
|
|
397
|
+
<Section title="Interactive — click „Vytvořit navazující“">
|
|
398
|
+
<ButtonGroup variant="secondary" aria-label="Akce faktury">
|
|
399
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
400
|
+
<ButtonGroupItem leadingIcon={<Icon name="copy" />}>Duplikovat</ButtonGroupItem>
|
|
401
|
+
<ButtonGroupItem
|
|
402
|
+
leadingIcon={<Icon name="invoice-new" />}
|
|
403
|
+
caret
|
|
404
|
+
open={open}
|
|
405
|
+
onClick={() => setOpen(o => !o)}
|
|
406
|
+
>
|
|
407
|
+
Vytvořit navazující
|
|
408
|
+
</ButtonGroupItem>
|
|
409
|
+
</ButtonGroup>
|
|
410
|
+
</Section>
|
|
411
|
+
<Section title="Open state per family" layout="column">
|
|
412
|
+
{VARIANTS.map(v => (
|
|
413
|
+
<ButtonGroup key={v} variant={v} aria-label="Akce faktury">
|
|
414
|
+
<ButtonGroupItem>Upravit</ButtonGroupItem>
|
|
415
|
+
<ButtonGroupItem caret open>
|
|
416
|
+
Vytvořit navazující
|
|
417
|
+
</ButtonGroupItem>
|
|
418
|
+
</ButtonGroup>
|
|
419
|
+
))}
|
|
420
|
+
</Section>
|
|
421
|
+
</Showcase>
|
|
422
|
+
);
|
|
423
|
+
},
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
export const Motion: Story = {
|
|
427
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
428
|
+
parameters: {
|
|
429
|
+
docs: {
|
|
430
|
+
description: {
|
|
431
|
+
story:
|
|
432
|
+
'The group has no motion of its own (manifest 1.4.1 `motion.none`); it inherits the segment\'s (`_button-segment` 1.9.1). Click a caret cell to toggle it: the caret turns 180° (down → up) on `--spring-standard` and back on close (`states.open`); click twice quickly and it turns around mid-turn without a jerk (`interrupt`). Hover and press wash a cell over `--duration-hover` / `--duration-press`; a loading cell\'s spinner turns once per `--duration-spin`, linear. Under `prefers-reduced-motion: reduce` (emulate it in DevTools → Rendering) the caret shows its end pose at once, without the turn; the spinner keeps turning.',
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
render: function MotionStory() {
|
|
437
|
+
const [open, setOpen] = useState<string | null>(null);
|
|
438
|
+
const toggle = (variant: string) => () => setOpen(current => (current === variant ? null : variant));
|
|
439
|
+
return (
|
|
440
|
+
<Showcase>
|
|
441
|
+
<Section title="Click the caret cell to toggle open" layout="column">
|
|
442
|
+
{VARIANTS.map(v => (
|
|
443
|
+
<ButtonGroup key={v} variant={v} aria-label="Akce faktury">
|
|
444
|
+
<ButtonGroupItem>Upravit</ButtonGroupItem>
|
|
445
|
+
<ButtonGroupItem caret open={open === v} onClick={toggle(v)}>
|
|
446
|
+
Vytvořit navazující
|
|
447
|
+
</ButtonGroupItem>
|
|
448
|
+
</ButtonGroup>
|
|
449
|
+
))}
|
|
450
|
+
</Section>
|
|
451
|
+
</Showcase>
|
|
452
|
+
);
|
|
453
|
+
},
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
/** Commands are logged, not wired — a story must not mutate anything. */
|
|
457
|
+
const logCommand = (command: string) => () => {
|
|
458
|
+
// eslint-disable-next-line no-console
|
|
459
|
+
console.log(`[ButtonGroup → Menu] ${command}`);
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
const FOLLOW_UP_DOCUMENTS: MenuEntry[] = [
|
|
463
|
+
{ id: 'credit-note', label: 'Dobropis', onSelect: logCommand('Dobropis') },
|
|
464
|
+
{ id: 'proforma', label: 'Zálohová faktura', onSelect: logCommand('Zálohová faktura') },
|
|
465
|
+
{ id: 'delivery-note', label: 'Dodací list', onSelect: logCommand('Dodací list') },
|
|
466
|
+
];
|
|
467
|
+
|
|
468
|
+
const OVERFLOW_COMMANDS: MenuEntry[] = [
|
|
469
|
+
{ id: 'rename', label: 'Přejmenovat', icon: <Icon name="writer" />, onSelect: logCommand('Přejmenovat') },
|
|
470
|
+
{ id: 'duplicate', label: 'Duplikovat', icon: <Icon name="copy" />, onSelect: logCommand('Duplikovat') },
|
|
471
|
+
{ type: 'separator' },
|
|
472
|
+
{
|
|
473
|
+
id: 'delete',
|
|
474
|
+
label: 'Smazat',
|
|
475
|
+
icon: <Icon name="trash" />,
|
|
476
|
+
variant: 'danger',
|
|
477
|
+
onSelect: logCommand('Smazat'),
|
|
478
|
+
},
|
|
479
|
+
];
|
|
480
|
+
|
|
481
|
+
// The Menu panel is portalled and absolutely positioned, so each example reserves
|
|
482
|
+
// room for its open panel (same reserve as Menu.stories.tsx); token-derived, no raw px.
|
|
483
|
+
const PanelRoom = ({ children }: { children: ReactNode }) => (
|
|
484
|
+
<div className="flex items-start" style={{ minHeight: 'calc(var(--space-1200) * 4)' }}>
|
|
485
|
+
{children}
|
|
486
|
+
</div>
|
|
487
|
+
);
|
|
488
|
+
|
|
489
|
+
export const WithMenu: Story = {
|
|
490
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
491
|
+
parameters: {
|
|
492
|
+
docs: {
|
|
493
|
+
description: {
|
|
494
|
+
story:
|
|
495
|
+
'The caret cell as the `trigger` of the `Menu` organism. Menu clones the cell and hands it the open state, `aria-controls` and the click / ArrowDown openers; the cell forwards its ref to the `<button>`, so the panel anchors under that cell and Escape returns focus to it. Pass neither `open` nor `onClick` to the cell — Menu owns both. `size="sm"` keeps the rows one density step below the md group (`popover-patterns.md` § Sizing). A disabled or loading caret cell stays focusable but never opens the menu.',
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
render: () => (
|
|
500
|
+
<Showcase>
|
|
501
|
+
<Section title="Labelled caret cell — „Vytvořit navazující“" layout="column">
|
|
502
|
+
<PanelRoom>
|
|
503
|
+
<ButtonGroup variant="secondary" aria-label="Akce faktury">
|
|
504
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
505
|
+
<ButtonGroupItem leadingIcon={<Icon name="copy" />}>Duplikovat</ButtonGroupItem>
|
|
506
|
+
<Menu
|
|
507
|
+
size="sm"
|
|
508
|
+
items={FOLLOW_UP_DOCUMENTS}
|
|
509
|
+
trigger={
|
|
510
|
+
<ButtonGroupItem leadingIcon={<Icon name="invoice-new" />} caret>
|
|
511
|
+
Vytvořit navazující
|
|
512
|
+
</ButtonGroupItem>
|
|
513
|
+
}
|
|
514
|
+
/>
|
|
515
|
+
</ButtonGroup>
|
|
516
|
+
</PanelRoom>
|
|
517
|
+
</Section>
|
|
518
|
+
<Section title="Icon-only overflow cell — toolbar cluster" layout="column">
|
|
519
|
+
<PanelRoom>
|
|
520
|
+
<ButtonGroup variant="secondary" aria-label="Nástroje tabulky">
|
|
521
|
+
<ButtonGroupItem icon={<Icon name="funnel-simple" />} aria-label="Filtrovat" />
|
|
522
|
+
<ButtonGroupItem icon={<Icon name="magnifying-glass" />} aria-label="Hledat" />
|
|
523
|
+
<Menu
|
|
524
|
+
size="sm"
|
|
525
|
+
items={OVERFLOW_COMMANDS}
|
|
526
|
+
trigger={<ButtonGroupItem icon={<Icon name="dots-three" />} aria-label="Další akce" caret />}
|
|
527
|
+
/>
|
|
528
|
+
</ButtonGroup>
|
|
529
|
+
</PanelRoom>
|
|
530
|
+
</Section>
|
|
531
|
+
<Section title="Disabled caret cell — focusable, never opens" layout="column">
|
|
532
|
+
<ButtonGroup variant="secondary" aria-label="Akce faktury">
|
|
533
|
+
<ButtonGroupItem>Upravit</ButtonGroupItem>
|
|
534
|
+
<Menu
|
|
535
|
+
size="sm"
|
|
536
|
+
items={FOLLOW_UP_DOCUMENTS}
|
|
537
|
+
trigger={
|
|
538
|
+
<ButtonGroupItem caret disabled>
|
|
539
|
+
Vytvořit navazující
|
|
540
|
+
</ButtonGroupItem>
|
|
541
|
+
}
|
|
542
|
+
/>
|
|
543
|
+
</ButtonGroup>
|
|
544
|
+
</Section>
|
|
545
|
+
</Showcase>
|
|
546
|
+
),
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
const MOBILE_VIEWPORTS = {
|
|
550
|
+
// fods-lint-disable-next-line Storybook viewport preset: the 390 mobile exhibit width, not a design value
|
|
551
|
+
mobile: { name: 'Below sm · 390', styles: { width: '390px', height: '844px' } },
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
export const MobileSheet: Story = {
|
|
555
|
+
name: 'Mobile — bottom sheet',
|
|
556
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
557
|
+
parameters: {
|
|
558
|
+
layout: 'fullscreen',
|
|
559
|
+
viewport: { options: MOBILE_VIEWPORTS },
|
|
560
|
+
docs: {
|
|
561
|
+
description: {
|
|
562
|
+
story:
|
|
563
|
+
'Below `sm` the menu a caret or ⋯ overflow cell opens is a **bottom sheet** (button-group.md § Responsive behaviour, stage 4), rendered by the `Menu` organism: the cell announces `aria-haspopup="dialog"` instead of `"menu"` and keeps `aria-expanded`; the sheet is titled by the cell’s label, or the icon cell’s `aria-label`. A disabled caret cell stays focusable and never opens the sheet. Open the story in the canvas — the docs column is wider than `sm`.',
|
|
564
|
+
},
|
|
565
|
+
},
|
|
566
|
+
},
|
|
567
|
+
globals: { viewport: { value: 'mobile' } },
|
|
568
|
+
render: () => (
|
|
569
|
+
<div className="flex flex-col gap-600 p-600">
|
|
570
|
+
<ButtonGroup variant="secondary" aria-label="Akce faktury">
|
|
571
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
572
|
+
<Menu
|
|
573
|
+
items={FOLLOW_UP_DOCUMENTS}
|
|
574
|
+
trigger={
|
|
575
|
+
<ButtonGroupItem leadingIcon={<Icon name="invoice-new" />} caret>
|
|
576
|
+
Vytvořit navazující
|
|
577
|
+
</ButtonGroupItem>
|
|
578
|
+
}
|
|
579
|
+
/>
|
|
580
|
+
</ButtonGroup>
|
|
581
|
+
<ButtonGroup variant="secondary" aria-label="Nástroje tabulky">
|
|
582
|
+
<ButtonGroupItem icon={<Icon name="funnel-simple" />} aria-label="Filtrovat" />
|
|
583
|
+
<Menu
|
|
584
|
+
items={OVERFLOW_COMMANDS}
|
|
585
|
+
trigger={<ButtonGroupItem icon={<Icon name="dots-three" />} aria-label="Další akce" caret />}
|
|
586
|
+
/>
|
|
587
|
+
</ButtonGroup>
|
|
588
|
+
</div>
|
|
589
|
+
),
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
export const DependencyRule: Story = {
|
|
593
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
594
|
+
parameters: {
|
|
595
|
+
docs: {
|
|
596
|
+
description: {
|
|
597
|
+
story:
|
|
598
|
+
'Destructive and confirming cells are the one exception to „one family per group" — and they follow the GROUP style (`button-group.md` § Variants → Dependency rule): inside a filled group use the filled `danger` / `success`, inside an outline group the outline counterparts. Never an outline-red cell in a blue filled bar. `success-outline` uses the AA-safe `--status-success-tint-foreground` label, because the bright `--status-success` fails contrast on white.',
|
|
599
|
+
},
|
|
600
|
+
},
|
|
601
|
+
},
|
|
602
|
+
render: () => (
|
|
603
|
+
<Showcase>
|
|
604
|
+
<Section title="Filled group → filled danger cell" layout="column">
|
|
605
|
+
<ButtonGroup variant="primary" aria-label="Akce dokumentu">
|
|
606
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
607
|
+
<ButtonGroupItem leadingIcon={<Icon name="copy" />}>Duplikovat</ButtonGroupItem>
|
|
608
|
+
<ButtonGroupItem variant="danger" leadingIcon={<Icon name="trash" />}>
|
|
609
|
+
Smazat
|
|
610
|
+
</ButtonGroupItem>
|
|
611
|
+
</ButtonGroup>
|
|
612
|
+
</Section>
|
|
613
|
+
<Section title="Outline group → outline danger / success cells" layout="column">
|
|
614
|
+
<ButtonGroup variant="secondary" aria-label="Akce dokumentu">
|
|
615
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
616
|
+
<ButtonGroupItem variant="success-outline" leadingIcon={<Icon name="check" />}>
|
|
617
|
+
Schválit
|
|
618
|
+
</ButtonGroupItem>
|
|
619
|
+
<ButtonGroupItem variant="danger-outline" leadingIcon={<Icon name="trash" />}>
|
|
620
|
+
Smazat
|
|
621
|
+
</ButtonGroupItem>
|
|
622
|
+
</ButtonGroup>
|
|
623
|
+
</Section>
|
|
624
|
+
</Showcase>
|
|
625
|
+
),
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
export const DisabledAndLoading: Story = {
|
|
629
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
630
|
+
parameters: {
|
|
631
|
+
docs: {
|
|
632
|
+
description: {
|
|
633
|
+
story:
|
|
634
|
+
'Cell states are per cell — but the WHOLE group has one state of its own, because the divider needs something to read. **Disabled deliberately keeps its tab stop** — `button-group.manifest.json` `intent.rules[0]` and § Accessibility → Keyboard require `aria-disabled` rather than the native attribute, so a keyboard user tabbing along the bar does not silently skip a cell. Tab through the first bar to see it. Loading keeps the family ink (there is no `loading` entry in the cell manifest’s `families[]`), replaces the leading slot with a spinner and sets `aria-busy` — it too stays reachable, which is the point: `aria-busy` on a natively disabled element would never be announced. The third bar shows `disabled` on the GROUP (1.1.1): every cell greys out **and** the divider drops the family white for the neutral `--outline-default` hairline. Compare the first and third filled bars — one dead action keeps the white seam, a dead group does not.',
|
|
635
|
+
},
|
|
636
|
+
},
|
|
637
|
+
},
|
|
638
|
+
render: () => (
|
|
639
|
+
<Showcase>
|
|
640
|
+
<Section title="One disabled cell — still tabbable, marked aria-disabled" layout="column">
|
|
641
|
+
{VARIANTS.map(v => (
|
|
642
|
+
<ButtonGroup key={v} variant={v} aria-label="Akce dokumentu">
|
|
643
|
+
<ButtonGroupItem>Upravit</ButtonGroupItem>
|
|
644
|
+
<ButtonGroupItem disabled>Duplikovat</ButtonGroupItem>
|
|
645
|
+
<ButtonGroupItem>Odeslat</ButtonGroupItem>
|
|
646
|
+
</ButtonGroup>
|
|
647
|
+
))}
|
|
648
|
+
</Section>
|
|
649
|
+
<Section title="One loading cell — keeps the family ink, sets aria-busy" layout="column">
|
|
650
|
+
{VARIANTS.map(v => (
|
|
651
|
+
<ButtonGroup key={v} variant={v} aria-label="Akce dokumentu">
|
|
652
|
+
<ButtonGroupItem>Upravit</ButtonGroupItem>
|
|
653
|
+
<ButtonGroupItem loading>Odesílám</ButtonGroupItem>
|
|
654
|
+
<ButtonGroupItem>Tisk</ButtonGroupItem>
|
|
655
|
+
</ButtonGroup>
|
|
656
|
+
))}
|
|
657
|
+
</Section>
|
|
658
|
+
{/*
|
|
659
|
+
The group-level flag, and the only thing that reaches the divider: on the
|
|
660
|
+
filled families the seam goes from white to the neutral hairline, because a
|
|
661
|
+
white line between two grey cells is the loudest mark on an inert control.
|
|
662
|
+
The outline family already drew that line, so it looks unchanged — which is
|
|
663
|
+
the point of the rule (one law, not two behaviours).
|
|
664
|
+
*/}
|
|
665
|
+
<Section title="The whole group disabled — cells grey out AND the divider goes neutral" layout="column">
|
|
666
|
+
{VARIANTS.map(v => (
|
|
667
|
+
<ButtonGroup key={v} variant={v} disabled aria-label="Akce dokumentu">
|
|
668
|
+
<ButtonGroupItem>Upravit</ButtonGroupItem>
|
|
669
|
+
<ButtonGroupItem>Duplikovat</ButtonGroupItem>
|
|
670
|
+
<ButtonGroupItem>Odeslat</ButtonGroupItem>
|
|
671
|
+
</ButtonGroup>
|
|
672
|
+
))}
|
|
673
|
+
</Section>
|
|
674
|
+
</Showcase>
|
|
675
|
+
),
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
export const Compositions: Story = {
|
|
679
|
+
args: { 'aria-label': 'Akce dokumentu', children: documentActions },
|
|
680
|
+
parameters: {
|
|
681
|
+
docs: {
|
|
682
|
+
description: {
|
|
683
|
+
story:
|
|
684
|
+
'Real-world compositions. In a detail header the bar holds the peer actions and the primary CTA stays a separate filled control — a filled group next to a filled CTA would put two equal-weight fills on one row, which is a don’t. In a table row the bar is the quiet outline family at `sm`.',
|
|
685
|
+
},
|
|
686
|
+
},
|
|
687
|
+
},
|
|
688
|
+
render: () => (
|
|
689
|
+
<Showcase>
|
|
690
|
+
<Section title="Detail header — quiet bar beside the primary CTA" layout="row">
|
|
691
|
+
<ButtonGroup variant="secondary" aria-label="Akce faktury">
|
|
692
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
693
|
+
<ButtonGroupItem leadingIcon={<Icon name="copy" />}>Duplikovat</ButtonGroupItem>
|
|
694
|
+
<ButtonGroupItem icon={<Icon name="printer" />} aria-label="Tisk" />
|
|
695
|
+
</ButtonGroup>
|
|
696
|
+
<Button variant="primary" leadingIcon={<Icon name="paper-plane-tilt" />}>
|
|
697
|
+
Odeslat fakturu
|
|
698
|
+
</Button>
|
|
699
|
+
</Section>
|
|
700
|
+
<Section title="Table row — dense outline bar at sm" layout="row">
|
|
701
|
+
<ButtonGroup variant="secondary" size="sm" aria-label="Akce řádku">
|
|
702
|
+
<ButtonGroupItem icon={<Icon name="eye" />} aria-label="Zobrazit" />
|
|
703
|
+
<ButtonGroupItem icon={<Icon name="pencil-simple" />} aria-label="Upravit" />
|
|
704
|
+
<ButtonGroupItem icon={<Icon name="copy" />} aria-label="Duplikovat" />
|
|
705
|
+
<ButtonGroupItem
|
|
706
|
+
variant="danger-outline"
|
|
707
|
+
icon={<Icon name="trash" />}
|
|
708
|
+
aria-label="Smazat"
|
|
709
|
+
/>
|
|
710
|
+
</ButtonGroup>
|
|
711
|
+
</Section>
|
|
712
|
+
</Showcase>
|
|
713
|
+
),
|
|
714
|
+
};
|