@invoiceonline/ui-react 0.0.0 → 0.2.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 +100 -0
- package/CHANGELOG.md +149 -0
- package/LICENSE +9 -0
- package/README.md +77 -1
- 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-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 +119 -0
- package/dist/components/field/Field.js +332 -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 +210 -0
- package/dist/components/field-pair/FieldPair.js +335 -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 +160 -0
- package/dist/components/text-field/TextField.js +244 -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 +130 -0
- package/dist/index.js +74 -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.d.ts +60 -0
- package/dist/internal/useDateFieldTrigger.js +235 -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 +44 -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 +396 -0
- package/docs/Contributing.mdx +78 -0
- package/docs/ForAgents.mdx +53 -0
- package/docs/Introduction.mdx +54 -0
- package/llms.txt +550 -0
- package/package.json +347 -3
- 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-picker/DatePicker.mdx +440 -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 +787 -0
- package/src/components/field/index.ts +20 -0
- package/src/components/field-pair/FieldPair.mdx +312 -0
- package/src/components/field-pair/FieldPair.stories.tsx +539 -0
- package/src/components/field-pair/FieldPair.tsx +845 -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 +699 -0
- package/src/components/text-field/TextField.stories.tsx +674 -0
- package/src/components/text-field/TextField.tsx +645 -0
- package/src/components/text-field/index.ts +11 -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 +70 -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 +497 -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 +57 -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 +360 -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,512 @@
|
|
|
1
|
+
import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as ButtonGroupStories from './ButtonGroup.stories';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<Meta of={ButtonGroupStories} tags={['autodocs']} />
|
|
6
|
+
|
|
7
|
+
# ButtonGroup
|
|
8
|
+
|
|
9
|
+
## Metadata
|
|
10
|
+
|
|
11
|
+
- **Layer:** molecule
|
|
12
|
+
- **Status:** draft
|
|
13
|
+
- **Tokens used:** `--bg-active`, `--bg-hover`, `--bg-primary`, `--border-width-100`, `--border-width-200`, `--disabled-control`, `--disabled-foreground`, `--font-body`, `--font-size-base`, `--font-size-md`, `--font-size-sm`, `--font-weight-semibold`, `--leading-loose`, `--leading-relaxed`, `--outline-default`, `--outline-focus`, `--primary-active`, `--primary-foreground`, `--primary-hover`, `--primary-solid`, `--radius-200`, `--secondary`, `--secondary-active`, `--secondary-foreground`, `--secondary-hover`, `--secondary-solid`, `--size-icon`, `--size-icon-small`, `--space-1000`, `--space-300`, `--space-400`, `--space-450`, `--space-500`, `--space-600`, `--space-900`, `--status-danger`, `--status-danger-active`, `--status-danger-foreground`, `--status-danger-hover`, `--status-danger-solid`, `--status-success-active`, `--status-success-hover`, `--status-success-tint-foreground`, `--z-index-base`
|
|
14
|
+
- **Manifest version:** `1.4.1`
|
|
15
|
+
- **Cell manifest:** `_button-segment` version `1.9.1` — the shared segment recipe every cell is built from
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
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 1 px dividers into a single control, and **N tab stops**: every cell is a peer action, a regular `<button>` of its own. Three families × three sizes; the cell count is a variable-length slot and every cell is the shared Button Segment.
|
|
20
|
+
|
|
21
|
+
Use it when several **independent, equal-weight** actions operate on the same object (a document header, a table row, a toolbar cluster). It is **not**:
|
|
22
|
+
|
|
23
|
+
- a **SplitButton** — one default action plus variants *of that action* is the fixed two-segment sibling;
|
|
24
|
+
- a **DropdownButton** — related choices with no distinct default, where the whole body opens a menu;
|
|
25
|
+
- a space-saving container — grouping unrelated actions to save room is an explicit don't (spec § Purpose), and two filled CTAs of equal weight never belong in one group.
|
|
26
|
+
|
|
27
|
+
Copy rules from the spec: each cell is one short verb in sentence case („Upravit“, „Duplikovat“, „Odeslat“), the labels stay **parallel** so the bar reads as one set, and the `role="group"` is named after the **object** the actions operate on — „Akce dokumentu“, „Akce faktury“, never a generic „Tlačítka“.
|
|
28
|
+
|
|
29
|
+
## Rationale
|
|
30
|
+
|
|
31
|
+
Formalising the pattern puts the whole visual contract in one place: the container contributes only the divider, the outer radius and the clip, while all colour, geometry and the focus ring live in the shared **Button Segment** recipe (`internal/buttonSegment.ts`) that `SplitButton` also tiles. The two container implementations are deliberately locked to each other.
|
|
32
|
+
|
|
33
|
+
The molecule adds exactly three things the cell cannot know:
|
|
34
|
+
|
|
35
|
+
1. the container (1 px divider gap + outer radius + clip),
|
|
36
|
+
2. the **per-cell corner position** — a group is a variable-length slot, so a cell cannot know whether it is first, last, both or neither,
|
|
37
|
+
3. the menu affordance on a caret cell.
|
|
38
|
+
|
|
39
|
+
### Why `<ButtonGroupItem>` and not styled `<Button>` children
|
|
40
|
+
|
|
41
|
+
`<ButtonGroup>` + `<ButtonGroupItem>` is the `ToggleGroup.Item` / `Tabs.Trigger` idiom, with the cell
|
|
42
|
+
recipe shared as a `tv()` recipe rather than a component (the same „recipe, not a component“ shape as
|
|
43
|
+
`popoverSurface.ts` / `dayCell.ts`).
|
|
44
|
+
|
|
45
|
+
The spec used to sketch the other model — `<ButtonGroup>` styling plain `<Button>` children through
|
|
46
|
+
context — and this section used to record that as a deviation. **As of manifest 1.2.0 it is the
|
|
47
|
+
contract**: upstream rewrote § Code API from the live component and added `delivery.react`, after we
|
|
48
|
+
reported two concrete problems with the sketch. The cell has its own paddings, its own positional
|
|
49
|
+
radius and an **inset** focus ring that a standalone `Button` must not have (`focus-ring.md` keeps
|
|
50
|
+
`Button` on the offset ring), so context styling would mean overriding `Button` from the outside; and a
|
|
51
|
+
hidden second render branch inside `Button` would be **invisible to the static verifier**,
|
|
52
|
+
which reads token bindings out of `buttonVariants`.
|
|
53
|
+
|
|
54
|
+
## Anatomy
|
|
55
|
+
|
|
56
|
+
A flex container holding N `<button>` cells (`data-fods-component="button-group"`, parts `root` · `segment`):
|
|
57
|
+
|
|
58
|
+
- **Container** (`root`) — a layout `<div role="group">`, never an outer `<button>`. Owns `gap-px` (= `--border-width-100`), `rounded-200` (`--radius-200`) and `overflow-hidden`. **The divider is not an element:** the 1 px gap lets the container *fill* show through — `--bg-primary` (white) on the filled families, `--outline-default` (grey) on the outline one, and `--outline-default` on **every** family once the group carries `disabled`. Your `className` and every remaining `<div>` attribute land here, as does the forwarded `ref`.
|
|
59
|
+
- **Cells** (`segment`) — one `<ButtonGroupItem>` per action. Content is **exclusive**: either a Label (`children`, with an optional `leadingIcon` and optical padding built in) or an Icon (a square single-glyph cell). There is deliberately no „hide label“ toggle.
|
|
60
|
+
- **Corner position** — not a prop. `ButtonGroup` derives it from the child index: the first cell rounds its left corners, the last its right, the middle ones nothing, and a **lone cell rounds both** (`position: 'only'`). The radius exists for the **inset focus ring**, not for the surface — the container's clip already rounds the surface, but an inset box-shadow is painted inside the cell's own border-box and would stay square in a round corner.
|
|
61
|
+
- **Caret affordance** — `caret` renders a trailing glyph wrapper on a Label cell and adds `aria-haspopup="menu"` + `aria-expanded`. The rotation lives on the wrapper `<span>`, so a swapped glyph rotates with it.
|
|
62
|
+
- **Menu panel** — **not part of this component.** As in `SplitButton` / `DropdownButton`, the cell owns the affordance and the announced expanded state. The `role="menu"` panel is the [`Menu`](?path=/docs/design-system-organisms-menu--docs) organism. `ButtonGroupItem` forwards its `ref` to the `<button>` and spreads the remaining props onto it, which is what Menu's `trigger` clone needs — see [Menu segment](#menu-segment).
|
|
63
|
+
|
|
64
|
+
> **Glyph tier and naming are two different things.** The **tier** moved: `slots.caret` defaults to
|
|
65
|
+
> `caret-down-small` as of `_button-segment` 1.6.0 — a library-wide owner decision of 2026-09-14 that
|
|
66
|
+
> deprecated the plain `caret-*` glyphs (icon 1.8.0, retired from the active set in 1.9.0). Split Button
|
|
67
|
+
> and Dropdown Button inherit the same move, so the small caret is the one consistent affordance across
|
|
68
|
+
> the trigger family. The name matches too: the slot is `slots.caret`
|
|
69
|
+
> and the glyph is `caret-down-small` (the Figma boolean is `Show caret`), which is what the React
|
|
70
|
+
> `Icon` renders; the legacy `chevron-down-small` is not an `IconName` in React.
|
|
71
|
+
|
|
72
|
+
## Variants
|
|
73
|
+
|
|
74
|
+
<Canvas of={ButtonGroupStories.Variants} />
|
|
75
|
+
|
|
76
|
+
Three families on the **group** (`variant`), inherited by every cell. The container fill is what you see as the divider.
|
|
77
|
+
|
|
78
|
+
<table>
|
|
79
|
+
<thead>
|
|
80
|
+
<tr><th>Variant</th><th>When</th><th>Container fill (= divider)</th><th>Cells (segment tokens)</th></tr>
|
|
81
|
+
</thead>
|
|
82
|
+
<tbody>
|
|
83
|
+
<tr>
|
|
84
|
+
<td><code>primary</code> (default)</td>
|
|
85
|
+
<td>Filled blue — the in-product action bar</td>
|
|
86
|
+
<td><code>--bg-primary</code> (white 1 px line)</td>
|
|
87
|
+
<td>fill <code>--secondary-solid</code>, hover <code>--secondary-hover</code>, active/open <code>--secondary-active</code>, ink <code>--secondary-foreground</code></td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr>
|
|
90
|
+
<td><code>brand</code></td>
|
|
91
|
+
<td>Filled orange — marketing / brand-tied surfaces</td>
|
|
92
|
+
<td><code>--bg-primary</code></td>
|
|
93
|
+
<td>fill <code>--primary-solid</code>, hover <code>--primary-hover</code>, active/open <code>--primary-active</code>, ink <code>--primary-foreground</code></td>
|
|
94
|
+
</tr>
|
|
95
|
+
<tr>
|
|
96
|
+
<td><code>secondary</code></td>
|
|
97
|
+
<td>Neutral outline — the quiet toolbar, next to outline buttons</td>
|
|
98
|
+
<td><code>--outline-default</code> + the container's own <code>--outline-default</code> identity line</td>
|
|
99
|
+
<td>opaque <code>--bg-primary</code> surface, ink <code>--secondary</code> → <code>--secondary-active</code> on hover/active; wash <code>--bg-hover</code> / <code>--bg-active</code> layered <em>over</em> the white base</td>
|
|
100
|
+
</tr>
|
|
101
|
+
</tbody>
|
|
102
|
+
</table>
|
|
103
|
+
|
|
104
|
+
Two consequences worth knowing:
|
|
105
|
+
|
|
106
|
+
- **The outline family's line is an inset outline, not a border.** It ships as `outline-100 outline-outline-default` at an offset of `calc(-1 * var(--border-width-100))`, which is what the manifest asks for: `composition.container.strokeMode: "inset-outline"`, under the system-wide rule `spec/06-patterns/edge-outline.md`. The container hugs its cells, so a border-box `border-100` would make **this one family** 34 / 42 / 46 tall instead of 32 / 40 / 44 and shrink every square icon cell by 2 px — breaking manifest `sizes[].height` and the § Responsive → Touch sizing promise that size L is exactly 44. The parts map enforces it with a `forbidClasses` invariant on `border-100` / `border-200`.
|
|
107
|
+
> ⚠️ **And never a positioned cell at rest.** A parent's `outline` paints above its **static** children, but a *positioned* child covers it — even at `z-index: auto`. The cells are opaque and reach the container's edge, so an unconditional `relative` on them erases this line (measured in Chrome 2026-08-12 on the sibling: a 4 px test outline survived only in the divider gap and the corner arcs). The `:focus-visible` lift therefore carries its own `position`, and a resting cell is static. **Upstream rule since 2026-08-12** — `edge-outline.md` carries the CSS caveat and the matching Don't.
|
|
108
|
+
- **The outline family's hover/active wash is a layer, not a replacement** (cell manifest changelog 2026-07-03: „alpha over the base, not a replacement“). The white surface is opaque — it has to be, or the divider colour would flood the whole control — so the wash is emitted as a background **image** layer on top of it.
|
|
109
|
+
|
|
110
|
+
### Six families on the cell, three on the group
|
|
111
|
+
|
|
112
|
+
`ButtonGroup` exposes the three families of `axes.variant`. `ButtonGroupItem`'s own `variant` reaches **all six** of the shared cell (`button-group` manifest `notes[2]`: „the segment's other families are reachable via the nested instance“):
|
|
113
|
+
|
|
114
|
+
<table>
|
|
115
|
+
<thead>
|
|
116
|
+
<tr><th>Cell-only variant</th><th>Style</th><th>Tokens</th></tr>
|
|
117
|
+
</thead>
|
|
118
|
+
<tbody>
|
|
119
|
+
<tr>
|
|
120
|
+
<td><code>danger</code></td>
|
|
121
|
+
<td>Filled red — the destructive cell inside a <strong>filled</strong> group</td>
|
|
122
|
+
<td>fill <code>--status-danger-solid</code>, hover <code>--status-danger-hover</code>, active/open <code>--status-danger-active</code>, ink <code>--status-danger-foreground</code></td>
|
|
123
|
+
</tr>
|
|
124
|
+
<tr>
|
|
125
|
+
<td><code>danger-outline</code></td>
|
|
126
|
+
<td>Quiet destructive — the same cell inside an <strong>outline</strong> group</td>
|
|
127
|
+
<td>opaque <code>--bg-primary</code> surface, ink <code>--status-danger</code> → <code>--status-danger-hover</code> → <code>--status-danger-active</code>; wash <code>--bg-hover</code> / <code>--bg-active</code></td>
|
|
128
|
+
</tr>
|
|
129
|
+
<tr>
|
|
130
|
+
<td><code>success-outline</code></td>
|
|
131
|
+
<td>Quiet confirm inside an outline group</td>
|
|
132
|
+
<td>opaque <code>--bg-primary</code> surface, resting ink <code>--status-success-tint-foreground</code> (the AA-safe tint — the bright green fails contrast on white), then <code>--status-success-hover</code> / <code>--status-success-active</code></td>
|
|
133
|
+
</tr>
|
|
134
|
+
</tbody>
|
|
135
|
+
</table>
|
|
136
|
+
|
|
137
|
+
### Dependency rule
|
|
138
|
+
|
|
139
|
+
<Canvas of={ButtonGroupStories.DependencyRule} />
|
|
140
|
+
|
|
141
|
+
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`, inside an outline group the outline counterparts `danger-outline` / `success-outline`. **Never mix** — an outline-red cell in a blue filled bar is the anti-pattern the rule exists to prevent.
|
|
142
|
+
|
|
143
|
+
### Matrix
|
|
144
|
+
|
|
145
|
+
<Canvas of={ButtonGroupStories.Matrix} />
|
|
146
|
+
|
|
147
|
+
Rows = families, columns = sizes S / M / L, mirroring the Figma labelled grid. Every family keeps the same outer height per size, including the outline one, whose identity line is an overlay rather than a layout box.
|
|
148
|
+
|
|
149
|
+
## Sizes
|
|
150
|
+
|
|
151
|
+
<Canvas of={ButtonGroupStories.Sizes} />
|
|
152
|
+
|
|
153
|
+
Heights 32 / 40 / 44, chosen on the **group** and inherited by every cell — a segment never chooses its own size (`_button-segment` intent), so the bar always matches the buttons standing next to it. On a Label cell the icon side is optically one spacing step tighter than the text side; an Icon cell is a square of exactly the row height with the Icon Button geometry (glyph = box − 2 × padding).
|
|
154
|
+
|
|
155
|
+
<table>
|
|
156
|
+
<thead>
|
|
157
|
+
<tr><th>Size</th><th style={{ textAlign: 'right' }}>Height</th><th>Label padding (text / icon side)</th><th>Gap</th><th>Icon cell (square, padding)</th><th style={{ textAlign: 'right' }}>Glyph</th><th>Font (Semibold)</th></tr>
|
|
158
|
+
</thead>
|
|
159
|
+
<tbody>
|
|
160
|
+
<tr>
|
|
161
|
+
<td><code>sm</code></td>
|
|
162
|
+
<td style={{ textAlign: 'right' }}>32 px (<code>--space-900</code>)</td>
|
|
163
|
+
<td><code>--space-500</code> / <code>--space-400</code></td>
|
|
164
|
+
<td><code>--space-300</code></td>
|
|
165
|
+
<td>32 × 32, padding <code>--space-300</code></td>
|
|
166
|
+
<td style={{ textAlign: 'right' }}>20 px (<code>--size-icon-small</code>)</td>
|
|
167
|
+
<td>14 px (<code>--font-size-sm</code>)</td>
|
|
168
|
+
</tr>
|
|
169
|
+
<tr>
|
|
170
|
+
<td><code>md</code> (default)</td>
|
|
171
|
+
<td style={{ textAlign: 'right' }}>40 px (<code>--space-1000</code>)</td>
|
|
172
|
+
<td><code>--space-500</code> / <code>--space-400</code></td>
|
|
173
|
+
<td><code>--space-400</code></td>
|
|
174
|
+
<td>40 × 40, padding <code>--space-400</code></td>
|
|
175
|
+
<td style={{ textAlign: 'right' }}>24 px (<code>--size-icon</code>)</td>
|
|
176
|
+
<td>16 px (<code>--font-size-base</code>)</td>
|
|
177
|
+
</tr>
|
|
178
|
+
<tr>
|
|
179
|
+
<td><code>lg</code></td>
|
|
180
|
+
<td style={{ textAlign: 'right' }}>44 px (literal)</td>
|
|
181
|
+
<td><code>--space-600</code> / <code>--space-500</code></td>
|
|
182
|
+
<td><code>--space-400</code></td>
|
|
183
|
+
<td>44 × 44, padding <code>--space-450</code></td>
|
|
184
|
+
<td style={{ textAlign: 'right' }}>24 px (<code>--size-icon</code>)</td>
|
|
185
|
+
<td>18 px (<code>--font-size-md</code>)</td>
|
|
186
|
+
</tr>
|
|
187
|
+
</tbody>
|
|
188
|
+
</table>
|
|
189
|
+
|
|
190
|
+
- Without a leading glyph both sides of a Label cell use the **text-side** value (`--space-500` on `sm`/`md`, `--space-600` on `lg`); the tighter icon-side padding only applies when the leading slot is filled — by a `leadingIcon` **or by the loading spinner**, which occupies the same slot.
|
|
191
|
+
- The `lg` height and square side are the one off-grid pair in the recipe: 44 px is the tap-target number from `_button-segment` and is not on the spacing-token grid, so it ships as a literal with a registered lint suppression.
|
|
192
|
+
- Weight is `font-semibold` (`--font-weight-semibold`), parity with `Button`. The cell manifest's `sizes[]` declares no font size — the 14 / 16 / 18 ladder comes from `button-group.md` § Button Segment.
|
|
193
|
+
- **`lg` is the touch size** — per the spec's § Responsive → Touch sizing the only step meeting the 44 px target without extra hit area; `sm` / `md` are desktop densities.
|
|
194
|
+
|
|
195
|
+
### Cell count and corner rounding
|
|
196
|
+
|
|
197
|
+
<Canvas of={ButtonGroupStories.CellCount} />
|
|
198
|
+
|
|
199
|
+
The cell count is a variable-length slot (manifest `properties[0]`), so nothing about the count is a prop. `ButtonGroup` counts its valid element children (`React.Children.toArray` already drops a conditionally rendered `null`, so a hidden cell does not consume a corner) and hands each one its `position` through context.
|
|
200
|
+
|
|
201
|
+
### Minification to icon cells
|
|
202
|
+
|
|
203
|
+
<Canvas of={ButtonGroupStories.IconCells} />
|
|
204
|
+
|
|
205
|
+
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. Only minify where the glyph is unambiguous (print, delete).
|
|
206
|
+
|
|
207
|
+
> ⚠️ **Manual, not automatic.** The spec's whole § Responsive behaviour — measured minification via container queries, the „⋯“ overflow cell, the mobile bottom bar, `collapsePriority` — is marked *proposed 2026-06-10* upstream and is **not implemented**. There is no measured stage transition and no overflow cell; you pick each cell's content yourself. A label that does not fit ellipsises on one line (`truncate`, manifest `text.label`).
|
|
208
|
+
|
|
209
|
+
## States
|
|
210
|
+
|
|
211
|
+
<Canvas of={ButtonGroupStories.States} />
|
|
212
|
+
|
|
213
|
+
The group carries **no Figma state axis**: state is per segment and inherited from the cell (`intent.states`). It has exactly **one** state of its own, and since 1.3.0 the manifest declares it rather than leaving it to be read off a colour binding — `Disabled` is a `properties[]` entry, „the code-only Disabled prop … which disables every cell and is the state `composition.container.divider` reads to drop to the neutral hairline“. The prop has been in this component since the divider rule landed (1.1.1); 1.3.0 gave it a declaration to be measured against. It is not a fourth cell state — it is the group flag that disables every cell and turns the seam neutral.
|
|
214
|
+
|
|
215
|
+
- **Default** — the family base (see Variants).
|
|
216
|
+
- **Hover** — filled families move the fill to the `-hover` step; the outline families keep the white surface and add the `--bg-hover` wash, moving the ink one ramp step (`--secondary-active` / `--status-danger-hover` / `--status-success-hover`).
|
|
217
|
+
- **Active** — filled families use the `-active` fill; the outline families use the deeper `--bg-active` wash.
|
|
218
|
+
- **Focus** — **not a variant**: a grouped-control **inset double ring** on `:focus-visible` — 2 px `--outline-focus` at the cell edge plus a 2 px `--bg-primary` gap inside it, both widths derived from `--border-width-200` and emitted as one `box-shadow`, following the cell's positional radius. The focused cell also raises itself to `calc(var(--z-index-base) + 1)`. See Accessibility for why this is not the offset ring standalone `Button` / `IconButton` use.
|
|
219
|
+
- **Disabled** — `--disabled-control` surface and `--disabled-foreground` ink (never `opacity`, which would dim the divider through the cell), plus `pointer-events-none`. Carried by the `aria-disabled:` twin of the cell's treatment, **not** by the native pseudo-class — the cell keeps its tab stop, see below. **One cell or the whole group are two different things:** one dead action keeps the family divider (the group is live, one of its actions is not), while `disabled` on the group drops the seam to `--outline-default`.
|
|
220
|
+
- **Loading** — the `spinner` glyph in the leading slot, `aria-busy="true"` (and deliberately **no** `aria-disabled` — see Accessibility), `pointer-events-none` and a click guard. Loading **keeps the family ink**: `_button-segment` has no `loading` entry in `families[]`, so there is no grey to fall back to.
|
|
221
|
+
- **Open** — caret cells only, and **no token of its own:** the cell re-uses the Active visual and rotates the caret 180°, identical to `DropdownButton` / `SplitButton` (`notes[1]`). It rides a real `data-state="open"` attribute, because CSS `:active` covers only the press.
|
|
222
|
+
|
|
223
|
+
**How the grids render Hover / Active / Focus.** They are pseudo-classes, so a docs grid cannot reach them by passing anything, and `parameters.pseudo` is not trustworthy here (Tailwind v4 wraps every `hover:` utility in `@media (hover: hover)`, which the addon does not rewrite). The stories therefore hand the cell the **bare twin** of the recipe's own class from `src/storybook/forceStates.tsx`, written on the same tokens, so a token change still reaches the grid. Disabled, Loading and Open need no forcing — they are real props / attributes.
|
|
224
|
+
|
|
225
|
+
### States live per cell
|
|
226
|
+
|
|
227
|
+
<Canvas of={ButtonGroupStories.PerSegmentStates} />
|
|
228
|
+
|
|
229
|
+
Hovering „Upravit“ must not light „Odeslat“ — that is why the cells are N controls and not one. Each row forces the state on exactly one cell, so the dividers stay readable and it is visible which cell would respond to a click. The focus rows show the inset ring inside the clipped container, where an offset ring would simply be cut off.
|
|
230
|
+
|
|
231
|
+
The last row is the ring on a **disabled** cell — the one place the tab-stop rule becomes visible rather than stated. Because a disabled cell keeps its tab stop, <kbd>Tab</kbd> really does land on it, and an indicator that were missing there would leave a keyboard user with no idea where they are standing. Only that cell is disabled, so the group stays live and keeps the family divider.
|
|
232
|
+
|
|
233
|
+
### Menu segment
|
|
234
|
+
|
|
235
|
+
<Canvas of={ButtonGroupStories.MenuSegment} />
|
|
236
|
+
|
|
237
|
+
`caret` marks the cell that opens a menu: it renders the affordance and adds `aria-haspopup="menu"` plus `aria-expanded`, written explicitly in **both** states (an `open || undefined` would delete the attribute when closed, which the menu-button pattern requires). On an **icon** cell the prop contributes the semantics only — the glyph already is the affordance, so no second caret is drawn. The panel is the [`Menu`](?path=/docs/design-system-organisms-menu--docs) organism; this cell owns the affordance and the announced state, nothing below it.
|
|
238
|
+
|
|
239
|
+
<Canvas of={ButtonGroupStories.WithMenu} />
|
|
240
|
+
|
|
241
|
+
Composed with Menu, the caret cell is passed as Menu's `trigger` **with neither `open` nor `onClick`**: Menu clones it and hands it the open state, `aria-controls` and the click / <kbd>ArrowDown</kbd> openers, and because the cell forwards its `ref` to the `<button>`, the panel anchors under that cell and <kbd>Escape</kbd> returns focus to it. Use `<Menu size="sm">` beside an `md` group — menu rows sit one density step below their trigger (`popover-patterns.md` § Sizing). A **disabled or loading** caret cell keeps its tab stop but never opens the menu: the cell drops the openers Menu hands it while it is locked, the same way its click guard drops `onClick`.
|
|
242
|
+
|
|
243
|
+
### Disabled and loading
|
|
244
|
+
|
|
245
|
+
<Canvas of={ButtonGroupStories.DisabledAndLoading} />
|
|
246
|
+
|
|
247
|
+
Both are **per cell**, and neither ever uses the native `disabled` attribute:
|
|
248
|
+
|
|
249
|
+
1. `disabled` greys the cell (`--disabled-control` / `--disabled-foreground`) and blocks it through `aria-disabled`, `pointer-events-none` and a click guard — **never** the native `disabled` attribute. `button-group.manifest.json` `intent.rules[0]` and § Accessibility → Keyboard require it: *„disabled segments stay in the tab order with `aria-disabled`.“* A natively disabled button leaves the tab order **and** the accessibility tree, so a keyboard user tabbing along the bar would silently skip a cell.
|
|
250
|
+
2. `loading` keeps the family ink, swaps the leading slot for the spinner and sets `aria-busy="true"` — and **nothing else**. It carries **no** `aria-disabled`: `_button-segment` 1.7.0 `loading.aria` states that the node carrying `aria-busy` must not also carry `aria-disabled`, because *„unavailable“* and *„working“* are two contradicting announcements on one node and *„working“* is the one to announce. The cell stays focusable and is held inert by the click guard and `pointer-events-none` alone. The native attribute is doubly wrong here — it would also silence the very `aria-busy` the state exists to announce.
|
|
251
|
+
|
|
252
|
+
The click guard covers the keyboard too — <kbd>Enter</kbd> and <kbd>Space</kbd> on a `<button>` dispatch a click, so no extra `onKeyDown` guard is needed.
|
|
253
|
+
|
|
254
|
+
> The cell recipe also carries a native `disabled:` treatment (it is shared with `SplitButton`, which uses the native attribute). In a Button Group those rules are **inert** — nothing ever sets the attribute — which is why the parts map splits the `aria-disabled:` twin off as its own `segment-disabled` part.
|
|
255
|
+
|
|
256
|
+
### Motion
|
|
257
|
+
|
|
258
|
+
<Canvas of={ButtonGroupStories.Motion} />
|
|
259
|
+
|
|
260
|
+
The group declares no motion of its own (manifest 1.4.1 `motion.none`); everything that moves is the segment's (`_button-segment` 1.9.1): hover / press washes over `--duration-hover` / `--duration-press`, the caret's 180° turn on `--spring-standard` (interruptible; no turn on first paint or in the server render), and the loading spinner on `--duration-spin` + `--easing-linear`. Under `prefers-reduced-motion: reduce` — when the app mounts `<MotionConfig reducedMotion="user">` (`FodsProvider` mounts it; this Storybook does in `.storybook/preview.tsx`) — the caret shows its end pose at once; the spinner keeps turning regardless.
|
|
261
|
+
|
|
262
|
+
### Compositions
|
|
263
|
+
|
|
264
|
+
<Canvas of={ButtonGroupStories.Compositions} />
|
|
265
|
+
|
|
266
|
+
## API
|
|
267
|
+
|
|
268
|
+
<Controls />
|
|
269
|
+
|
|
270
|
+
### `<ButtonGroup>`
|
|
271
|
+
|
|
272
|
+
<table>
|
|
273
|
+
<thead>
|
|
274
|
+
<tr><th>Prop</th><th>Type</th><th>Default</th><th>Description</th></tr>
|
|
275
|
+
</thead>
|
|
276
|
+
<tbody>
|
|
277
|
+
<tr><td><code>variant</code></td><td><code>'primary' | 'brand' | 'secondary'</code></td><td><code>'primary'</code></td><td>Colour family of the whole group; inherited by every cell (a cell may override it — see the dependency rule).</td></tr>
|
|
278
|
+
<tr><td><code>size</code></td><td><code>'sm' | 'md' | 'lg'</code></td><td><code>'md'</code></td><td>Heights 32 / 40 / 44, applied to every cell. Not overridable per cell.</td></tr>
|
|
279
|
+
<tr><td><code>disabled</code></td><td><code>boolean</code></td><td><code>false</code></td><td>Disables every cell <strong>and</strong> flips the divider to the neutral <code>--outline-default</code> hairline. The prop exists because the divider needs a group-level state to read — the container fill has no state axis of its own (rule 1.1.1; declared in <code>properties[3]</code> since 1.3.0). To disable a single action use that cell's own <code>disabled</code>: the group stays live and keeps the family divider.</td></tr>
|
|
280
|
+
<tr><td><code>aria-label</code> / <code>aria-labelledby</code></td><td><code>string</code></td><td>— (exactly one required)</td><td>Accessible name of the <code>role="group"</code>. Enforced by a TYPE union, not by review.</td></tr>
|
|
281
|
+
<tr><td><code>children</code></td><td><code>ReactNode</code></td><td>— (required)</td><td>The cells — <code><ButtonGroupItem></code> elements, one per action.</td></tr>
|
|
282
|
+
</tbody>
|
|
283
|
+
</table>
|
|
284
|
+
|
|
285
|
+
All remaining native `<div>` attributes and `className` are forwarded to the container; `ref` points at the container `<div>`.
|
|
286
|
+
|
|
287
|
+
### `<ButtonGroupItem>`
|
|
288
|
+
|
|
289
|
+
<table>
|
|
290
|
+
<thead>
|
|
291
|
+
<tr><th>Prop</th><th>Type</th><th>Default</th><th>Description</th></tr>
|
|
292
|
+
</thead>
|
|
293
|
+
<tbody>
|
|
294
|
+
<tr><td><code>children</code></td><td><code>ReactNode</code></td><td>—</td><td>Label content. Exclusive with <code>icon</code>.</td></tr>
|
|
295
|
+
<tr><td><code>icon</code></td><td><code>ReactNode</code></td><td>—</td><td>The single centred glyph of a square Icon cell. Exclusive with <code>children</code>, and requires <code>aria-label</code> at the type level.</td></tr>
|
|
296
|
+
<tr><td><code>variant</code></td><td><code>'primary' | 'brand' | 'secondary' | 'danger' | 'danger-outline' | 'success-outline'</code></td><td>inherited from the group</td><td>Per-cell family override — all six segment families are reachable. Follow the dependency rule.</td></tr>
|
|
297
|
+
<tr><td><code>leadingIcon</code></td><td><code>ReactNode</code></td><td><code>undefined</code></td><td>Decorative glyph before the label (Label cells only); also drives the optical padding.</td></tr>
|
|
298
|
+
<tr><td><code>caret</code></td><td><code>boolean</code></td><td><code>false</code></td><td>Marks the cell as menu-opening: caret glyph (Label cells) + <code>aria-haspopup="menu"</code> + <code>aria-expanded</code> + <code>data-state</code>.</td></tr>
|
|
299
|
+
<tr><td><code>open</code></td><td><code>boolean</code></td><td><code>false</code></td><td>Open state of the menu this cell owns. Caret cells only; the panel is a separate component.</td></tr>
|
|
300
|
+
<tr><td><code>loading</code></td><td><code>boolean</code></td><td><code>false</code></td><td>Spinner in the leading slot + <code>aria-busy</code>; clicks suppressed, family ink kept.</td></tr>
|
|
301
|
+
<tr><td><code>disabled</code></td><td><code>boolean</code></td><td><code>false</code></td><td>Greys the cell out — but <strong>keeps its tab stop</strong>: <code>aria-disabled</code> + a click guard, never the native attribute (manifest <code>intent.rules[0]</code>). A deliberate deviation from <code>Button</code> / <code>IconButton</code>.</td></tr>
|
|
302
|
+
</tbody>
|
|
303
|
+
</table>
|
|
304
|
+
|
|
305
|
+
`size` is deliberately **not** a cell prop — the segment inherits the group's size. Remaining native `<button>` attributes are forwarded; `ref` points at the cell's `<button>`. The contract attributes (`aria-disabled`, `aria-busy`, `aria-haspopup`, `aria-expanded`, `data-state`, `type`) are written after the spread, so a caller cannot clobber them.
|
|
306
|
+
|
|
307
|
+
> ℹ️ **The default family is `primary`, confirmed with design (manifest 1.2.0).** `button-group.manifest.json` `properties[1].default = "Primary"` — the same blue `Button` / `SplitButton` / `DropdownButton` default to, so a group drops in next to them unchanged. The spec's § Code API table used to propose `'secondary'`; that was stale prose, and upstream rewrote the section rather than changing the manifest. This is no longer an open question.
|
|
308
|
+
|
|
309
|
+
## Do / Don't
|
|
310
|
+
|
|
311
|
+
- ✅ Group actions that operate on **one object** — a document, a table row, a toolbar cluster.
|
|
312
|
+
- ✅ Name the group after that object: `aria-label="Akce dokumentu"`, never „Tlačítka“.
|
|
313
|
+
- ✅ Keep the labels parallel — all verbs, similar length — so the bar reads as one set.
|
|
314
|
+
- ✅ Minify to an icon-only cell where the glyph is unambiguous (print, delete), and give it the verb the label would have shown.
|
|
315
|
+
- ✅ Follow the dependency rule: filled `danger` in a filled group, `danger-outline` / `success-outline` in an outline one.
|
|
316
|
+
- ✅ Match family and size to the controls standing next to the bar; use `size="lg"` on touch surfaces.
|
|
317
|
+
- ❌ Don't group unrelated actions just to save space — that is not a group, it is a row of buttons.
|
|
318
|
+
- ❌ Don't put two filled CTAs of equal weight in one group, and don't stand a filled group next to a filled primary CTA (see the Compositions story — the quiet outline bar is the pattern there).
|
|
319
|
+
- ❌ Don't mix an outline-red cell into a blue filled bar.
|
|
320
|
+
- ❌ Don't hide a label where the icon is ambiguous, and never wrap or mid-word-truncate one instead of minifying.
|
|
321
|
+
- ❌ Don't nest a `SplitButton` inside a group (spec § Do / Don't).
|
|
322
|
+
- ❌ Don't reach for this when one action dominates (that is `SplitButton`) or when there is no default at all (that is `DropdownButton`).
|
|
323
|
+
|
|
324
|
+
## Accessibility
|
|
325
|
+
|
|
326
|
+
- **Keyboard** — **N tab stops for N cells.** Each cell is a plain `<button type="button">`; <kbd>Tab</kbd> walks them in DOM = visual order and <kbd>Enter</kbd> / <kbd>Space</kbd> activate natively. A **`disabled` cell keeps its tab stop** — it is marked `aria-disabled` and blocked by a click guard rather than by the native attribute (manifest `intent.rules[0]`; a deliberate deviation from `Button` / `IconButton`, where the native attribute is correct). The component adds **no key behaviour of its own**: there is no roving-tabindex arrow navigation, because the container is `role="group"`, not `role="toolbar"`.
|
|
327
|
+
- **ARIA** — the container is `role="group"` with a **mandatory accessible name**: exactly one of `aria-label` / `aria-labelledby`, enforced by a TypeScript union rather than at runtime, because axe-core cannot catch this one (`group` has `accessibleNameRequired: false`, so an unnamed group passes the automated pass and reaches the designer as a QA blocker). An icon-only cell has no visible text, so its `aria-label` is likewise required by the type. A caret cell adds `aria-haspopup="menu"` and `aria-expanded` in **both** states plus `data-state="open" | "closed"` for styling. `loading` sets `aria-busy="true"` and **never** `aria-disabled` (`_button-segment` 1.7.0 `loading.aria`); `disabled` sets `aria-disabled`. Every glyph — leading icon, icon-cell glyph, caret, spinner — is `aria-hidden`.
|
|
328
|
+
- **Screen reader** — the group is announced once by its name, then each cell by its label (or by its `aria-label` when it is icon-only). A disabled cell is reached and announced as unavailable instead of vanishing from the bar; a loading cell stays in the accessibility tree on purpose, so `aria-busy` is announceable. `role="menu"` and item navigation belong to the [`Menu`](?path=/docs/design-system-organisms-menu--docs) organism; as its trigger, a locked (disabled or loading) caret cell stays reachable but opens nothing — neither by click nor by <kbd>ArrowDown</kbd>.
|
|
329
|
+
- **Focus** — the grouped-control **inset** double ring, not the offset ring: 2 px `--outline-focus` at the cell edge plus a 2 px `--bg-primary` gap inside it, following the cell's effective radius. This is an explicit exception granted to grouped controls by `spec/06-patterns/focus-ring.md` (invoked by `split-button.md` § „Focus — inset double ring (grouped controls)“), not a breach of the a11y floor: nothing overflows the clipped container, and the white inner gap keeps the indicator readable on a blue fill — the blue-on-blue case where an offset ring of the same hue disappears. The focused cell is raised one z-index step because CSS paints a parent's outline **above** its non-positioned children, so without the lift the outline family's grey identity line would eat the outer band. **Do not port this to `Button` / `IconButton`.**
|
|
330
|
+
- **Contrast** — the filled families put white ink (`--secondary-foreground` / `--primary-foreground`) on `--secondary-solid` / `--primary-solid`; both are **accepted, owner-signed token exceptions upstream** (`spec/01-foundations/accessibility.md`) and are documented with measured ratios on [`SplitButton`](?path=/docs/design-system-molecules-splitbutton--docs), which uses the identical cell. The outline families are not implicated: their ink sits on a white surface, and `success-outline` deliberately uses the AA-safe `--status-success-tint-foreground` instead of the bright green. The disabled treatment uses `--disabled-control` / `--disabled-foreground`, never `opacity`. **No axe result is recorded in these docs for this component** — `@storybook/addon-a11y` is installed, so the Accessibility panel runs axe on any story; see Verification status for what was measured.
|
|
331
|
+
- **Motion** — the group adds none of its own: manifest 1.4.1 `motion.none` („the segments carry all the motion — hover, press, caret rotation and spinner“) with `inherits: [_button-segment]`. From `_button-segment` 1.9.1 `motion.states`: the cell's wash and ink change over `--duration-hover` on hover and `--duration-press` on press, both on `--easing-standard`, over `background-color` / `color` only — the inset focus ring (a box-shadow) is never eased, and colour washes need no reduced-motion override. The caret turns 180° on open and back on close on `--spring-standard` (`springs.standard` from `@invoiceonline/ui-system`, in Motion; shared `internal/MotionCaret.tsx`); a quick re-toggle turns it around mid-turn (`interrupt`), and under `prefers-reduced-motion` it shows its end pose at once, provided the app mounts `<MotionConfig reducedMotion="user">` (`FodsProvider` mounts it; this Storybook does). The loading spinner is `animate-spin` — one turn per `--duration-spin` on `--easing-linear` — and keeps turning under reduced motion — a loader is essential motion (manifest `loop`). See [Motion](#motion).
|
|
332
|
+
- **Touch target** — 44 × 44 is met by `lg` only; `sm` / `md` are desktop densities and need extra hit area if used as standalone tap targets (pad the hit area, not the visual box).
|
|
333
|
+
- **Mobile bottom sheet (below `sm`)** — as the trigger of [`Menu`](?path=/docs/design-system-organisms-menu--docs), a caret cell (label or ⋯ icon cell) announces `aria-haspopup="dialog"` instead of `menu` — the one value the cell accepts from its owner; any other `aria-haspopup` keeps `menu` — and keeps `aria-expanded` in both states. The sheet is titled by the cell's label, or by the icon cell's `aria-label`. A disabled or loading caret cell still opens nothing — the cell's guard drops click and <kbd>ArrowDown</kbd>, and `Menu` itself refuses a trigger carrying `aria-disabled` / `aria-busy`.
|
|
334
|
+
|
|
335
|
+
### Verification status
|
|
336
|
+
|
|
337
|
+
*Recorded before this package existed, with a verification tool that is not part of it; not re-run here.*
|
|
338
|
+
|
|
339
|
+
**Static gate:** clean (10 checks). **Runtime pass: run** (2026-08-13, bundled Chromium via Playwright over the built static bundle) — 7 computed properties, the five FODS a11y-floor rules with **no finding**, and an interaction phase that really fired `hover` ×175 and `active` ×81.
|
|
340
|
+
|
|
341
|
+
| Claim | Measured |
|
|
342
|
+
|---|---|
|
|
343
|
+
| Inset double ring renders on a real `:focus-visible` | `2px rgb(9,127,181)` = `--outline-focus` at the cell edge + `4px rgb(255,255,255)` = `--bg-primary` — the second band is a cumulative inset, so what the eye sees is the 2 px gap the pattern asks for (`spec/06-patterns/focus-ring.md` § grouped controls) |
|
|
344
|
+
| Outline family's identity line costs no layout box | the container's `color` measures as `outline #d5e2e8` = `--outline-default`, not as a `border` — matching `strokeMode: "inset-outline"`, so the cell heights stay 32 / 40 / 44 |
|
|
345
|
+
| Group `disabled` reaches the divider | measured in **all three** families: the group-level flag (manifest 1.1.1) is what gave the sweep something to drive |
|
|
346
|
+
|
|
347
|
+
**Not verified, and why:**
|
|
348
|
+
|
|
349
|
+
- **axe has not been run on this component.** Not an omission of the report — the automatic driver passes `axe: false` to the probe, because one CDP call is capped at 45 s and an axe pass exhausts it; axe is a separate entry point on the manual path. The five FODS floor rules, which axe does not cover at all, did run and are clean. The contrast reasoning above is inherited, not measured here: the cell recipe is byte-identical to `SplitButton`'s, where the ratios were measured and the exceptions signed off.
|
|
350
|
+
- **Per-family `hover` / `active`** — **captured but not evaluated.** The interaction pass fires the events on every armed target (hence the ×175 / ×81), but the parts map carries no expected value for those state keys, so nothing compares the measurement against a contract. The token bindings are checked statically instead.
|
|
351
|
+
- **The outline families' composited wash** — `--bg-hover` / `--bg-active` are alpha layers over the opaque white surface, so the runtime pass reads a blended colour rather than a flat token. Verified statically out of the arbitrary property.
|
|
352
|
+
- **`segment-disabled` on `primary` / `brand` / `secondary`** — the part shares its element with `segment` and no story puts that element into the part's state, so it is checked statically only.
|
|
353
|
+
- **13 family × state combinations are not settable through story args** — pseudo-classes and per-cell family overrides; the sweep measures the resting families on the Matrix story instead.
|
|
354
|
+
|
|
355
|
+
> **The Tab walk count is diagnosed, not left open.** The driver reports 27 `Tab` presses against 54 `focusin` transitions on the cells. That is 27 focus moves from `Tab` plus 27 from the click phase — the payload carries `pointerdown` ×27 and `pointerup` ×27 alongside them, and every transition is logged twice in total because `focusin` bubbles to the `root` part as well (`segment` ×54 **and** `root` ×54). The component fires no focus of its own. N tab stops for N cells follows from the DOM structure — one native `<button>` per cell, none of them natively disabled — and is what the runtime pass walks; `ButtonGroup.test.tsx` pins the cell count and the `aria-disabled` treatment, not the walk itself.
|
|
356
|
+
|
|
357
|
+
Accessibility floor for every FODS component: `spec/01-foundations/accessibility.md`.
|
|
358
|
+
|
|
359
|
+
## Mobile bottom sheet
|
|
360
|
+
|
|
361
|
+
<Canvas of={ButtonGroupStories.MobileSheet} />
|
|
362
|
+
|
|
363
|
+
Below `sm` the menu a caret or ⋯ overflow cell opens is a bottom sheet (`button-group.md` § Responsive
|
|
364
|
+
behaviour, stage 4; `overlay-behavior.md` § Mobile). The group renders no panel — `Menu` swaps the surface
|
|
365
|
+
and the popup type; the cell only reflects the announced popup.
|
|
366
|
+
|
|
367
|
+
## Copy
|
|
368
|
+
|
|
369
|
+
Voice: the same rules as a [`Button`](?path=/docs/design-system-atoms-button--docs) label — verb-first,
|
|
370
|
+
one action, sentence case, concise, impersonal. The examples are Czech; the rules hold for every market.
|
|
371
|
+
|
|
372
|
+
- **Label** (a Label cell's `children`) — one action per cell, a short verb in sentence case. Keep the
|
|
373
|
+
labels **parallel** (all verbs, similar length) so the bar reads as one set. One line, at most 20
|
|
374
|
+
characters. When space is tight, minify the cell to an icon-only cell (`icon`) instead of letting the
|
|
375
|
+
label wrap onto two lines or get truncated mid-word; the cell renders the label on one line and
|
|
376
|
+
truncates an overflow.
|
|
377
|
+
- **Icon-only cell name** (`aria-label`, required by the type when `icon` is set) — the same verb the
|
|
378
|
+
label would have shown.
|
|
379
|
+
- **Group name** (`aria-label` or `aria-labelledby` on `ButtonGroup`) — names the object the actions
|
|
380
|
+
operate on, never a generic word for the buttons.
|
|
381
|
+
|
|
382
|
+
<table>
|
|
383
|
+
<thead>
|
|
384
|
+
<tr><th>Text</th><th>Examples</th><th>Not</th></tr>
|
|
385
|
+
</thead>
|
|
386
|
+
<tbody>
|
|
387
|
+
<tr><td>Label</td><td>Upravit · Duplikovat · Odeslat</td><td></td></tr>
|
|
388
|
+
<tr><td>Icon-only cell name</td><td>Tisk · Smazat</td><td></td></tr>
|
|
389
|
+
<tr><td>Group name</td><td>Akce dokumentu · Akce faktury</td><td>Tlačítka</td></tr>
|
|
390
|
+
</tbody>
|
|
391
|
+
</table>
|
|
392
|
+
|
|
393
|
+
## Usage
|
|
394
|
+
|
|
395
|
+
```tsx
|
|
396
|
+
import { ButtonGroup, ButtonGroupItem, Menu, Icon } from '@invoiceonline/ui-react';
|
|
397
|
+
|
|
398
|
+
// Good — the document action bar; the group is named after the object
|
|
399
|
+
<ButtonGroup aria-label="Akce dokumentu">
|
|
400
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />} onClick={editInvoice}>
|
|
401
|
+
Upravit
|
|
402
|
+
</ButtonGroupItem>
|
|
403
|
+
<ButtonGroupItem leadingIcon={<Icon name="copy" />} onClick={duplicateInvoice}>
|
|
404
|
+
Duplikovat
|
|
405
|
+
</ButtonGroupItem>
|
|
406
|
+
<ButtonGroupItem leadingIcon={<Icon name="paper-plane-tilt" />} onClick={sendInvoice}>
|
|
407
|
+
Odeslat
|
|
408
|
+
</ButtonGroupItem>
|
|
409
|
+
</ButtonGroup>
|
|
410
|
+
|
|
411
|
+
// Good — quiet outline bar in a table row, minified where the glyph is unambiguous
|
|
412
|
+
<ButtonGroup variant="secondary" size="sm" aria-label="Akce řádku">
|
|
413
|
+
<ButtonGroupItem icon={<Icon name="eye" />} aria-label="Zobrazit" />
|
|
414
|
+
<ButtonGroupItem icon={<Icon name="pencil-simple" />} aria-label="Upravit" />
|
|
415
|
+
<ButtonGroupItem variant="danger-outline" icon={<Icon name="trash" />} aria-label="Smazat" />
|
|
416
|
+
</ButtonGroup>
|
|
417
|
+
|
|
418
|
+
// Good — a menu-opening cell as Menu's trigger; Menu owns open, onClick and focus
|
|
419
|
+
<ButtonGroup variant="secondary" aria-label="Akce faktury">
|
|
420
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
421
|
+
<Menu
|
|
422
|
+
size="sm"
|
|
423
|
+
items={followUpDocuments}
|
|
424
|
+
trigger={
|
|
425
|
+
<ButtonGroupItem leadingIcon={<Icon name="invoice-new" />} caret>
|
|
426
|
+
Vytvořit navazující
|
|
427
|
+
</ButtonGroupItem>
|
|
428
|
+
}
|
|
429
|
+
/>
|
|
430
|
+
</ButtonGroup>
|
|
431
|
+
|
|
432
|
+
// Possible — a menu-opening cell without Menu: `caret` gives only the affordance,
|
|
433
|
+
// aria-haspopup and aria-expanded. Everything else is yours: render the role="menu"
|
|
434
|
+
// panel, point aria-controls at it, open it on ArrowDown as well as on click, move focus
|
|
435
|
+
// into it and return focus to the cell when it closes. Menu does all of that for you.
|
|
436
|
+
<ButtonGroup variant="secondary" aria-label="Akce faktury">
|
|
437
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
438
|
+
<ButtonGroupItem
|
|
439
|
+
leadingIcon={<Icon name="invoice-new" />}
|
|
440
|
+
caret
|
|
441
|
+
aria-controls={menuId}
|
|
442
|
+
open={isMenuOpen}
|
|
443
|
+
onClick={() => setMenuOpen(o => !o)}
|
|
444
|
+
>
|
|
445
|
+
Vytvořit navazující
|
|
446
|
+
</ButtonGroupItem>
|
|
447
|
+
</ButtonGroup>
|
|
448
|
+
|
|
449
|
+
// Good — a cell that is working; it keeps its ink, its tab stop and announces aria-busy
|
|
450
|
+
<ButtonGroup aria-label="Akce dokumentu">
|
|
451
|
+
<ButtonGroupItem>Upravit</ButtonGroupItem>
|
|
452
|
+
<ButtonGroupItem loading>Odesílám</ButtonGroupItem>
|
|
453
|
+
</ButtonGroup>
|
|
454
|
+
|
|
455
|
+
// Good — touch surface
|
|
456
|
+
<ButtonGroup size="lg" aria-label="Akce faktury">
|
|
457
|
+
<ButtonGroupItem leadingIcon={<Icon name="pencil-simple" />}>Upravit</ButtonGroupItem>
|
|
458
|
+
<ButtonGroupItem leadingIcon={<Icon name="paper-plane-tilt" />}>Odeslat</ButtonGroupItem>
|
|
459
|
+
</ButtonGroup>
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
```tsx
|
|
463
|
+
// Don't — unrelated actions joined only to save space
|
|
464
|
+
<ButtonGroup aria-label="Akce">
|
|
465
|
+
<ButtonGroupItem>Uložit fakturu</ButtonGroupItem>
|
|
466
|
+
<ButtonGroupItem>Odhlásit se</ButtonGroupItem>
|
|
467
|
+
</ButtonGroup>
|
|
468
|
+
|
|
469
|
+
// Don't — an outline-red cell inside a filled group (dependency rule)
|
|
470
|
+
<ButtonGroup variant="primary" aria-label="Akce dokumentu">
|
|
471
|
+
<ButtonGroupItem>Upravit</ButtonGroupItem>
|
|
472
|
+
<ButtonGroupItem variant="danger-outline">Smazat</ButtonGroupItem>
|
|
473
|
+
</ButtonGroup>
|
|
474
|
+
|
|
475
|
+
// Don't — a generic group name, and an icon cell with no accessible name
|
|
476
|
+
// (the second line does not even compile: `aria-label` is required by the type)
|
|
477
|
+
<ButtonGroup aria-label="Tlačítka">
|
|
478
|
+
<ButtonGroupItem icon={<Icon name="printer" />} />
|
|
479
|
+
</ButtonGroup>
|
|
480
|
+
|
|
481
|
+
// Don't — a filled group standing next to a filled primary CTA: two equal-weight
|
|
482
|
+
// fills on one row. Use the quiet outline family for the bar.
|
|
483
|
+
<>
|
|
484
|
+
<ButtonGroup variant="primary" aria-label="Akce faktury">
|
|
485
|
+
<ButtonGroupItem>Upravit</ButtonGroupItem>
|
|
486
|
+
<ButtonGroupItem>Duplikovat</ButtonGroupItem>
|
|
487
|
+
</ButtonGroup>
|
|
488
|
+
<Button variant="primary">Odeslat fakturu</Button>
|
|
489
|
+
</>
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
## Related
|
|
493
|
+
|
|
494
|
+
- [`SplitButton`](?path=/docs/design-system-molecules-splitbutton--docs) — the **fixed two-segment** sibling: one dominant action plus a menu trigger. Same container mechanics, same cell, same inset focus ring.
|
|
495
|
+
- [`Button`](?path=/docs/design-system-atoms-button--docs) — the standalone action; keeps the **offset** focus ring and the same `leadingIcon` / `loading` mechanics.
|
|
496
|
+
- [`DropdownButton`](?path=/docs/design-system-atoms-dropdownbutton--docs) — related choices with no distinct default; the whole body opens the menu.
|
|
497
|
+
- [`IconButton`](?path=/docs/design-system-atoms-iconbutton--docs) — the square icon-only geometry the Icon cells mirror.
|
|
498
|
+
- [`Icon`](?path=/story/design-system-atoms-icon--playground) — the DS glyph set (`caret-down-small`, `dots-three`, `printer`, `trash`, `spinner`).
|
|
499
|
+
- `buttonSegment.ts` — the shared cell recipe both grouped molecules are built from (colour, geometry, inset focus ring); [`Menu`](?path=/docs/design-system-organisms-menu--docs) — the `role="menu"` panel a caret cell opens.
|
|
500
|
+
- `spec/04-molecules/button-group.md` — upstream design spec (including § Button Segment, the shared atom).
|
|
501
|
+
|
|
502
|
+
## Migration notes
|
|
503
|
+
|
|
504
|
+
Notes for adopters:
|
|
505
|
+
|
|
506
|
+
- **1.4.1 / `_button-segment` 1.9.1 — motion audit (2026-11-03).** The group declares no motion of its own (`motion.none`) and inherits the cell's. The cell's raw `transition-colors duration-150` became `transition-[background-color,color] duration-hover ease-standard active:duration-press` (shared `buttonSegment.ts`, so Split Button changed with it). With ui-system 0.17.0 the caret turn moved from that raw `transition-transform duration-150` + `rotate-180` to Motion on `--spring-standard` (shared `internal/MotionCaret.tsx`, so Split Button changed with it): interruptible, end pose at once under reduced motion; the spinner now turns on `--duration-spin` + `--easing-linear`. New `Motion` story.
|
|
507
|
+
- **`_button-segment` 1.8.0 — disabled paint.** Every cell's disabled fill rebinds `--disabled` → `--disabled-control` (claudy/100, was gray/100). `--disabled` is deprecated in `@invoiceonline/ui-system` 0.13.0.
|
|
508
|
+
- **Cells are `<ButtonGroupItem>`, not styled `<Button>` children** — the spec's earlier sketch said otherwise; § Code API was rewritten from the shipped component in manifest 1.2.0. See „Why `<ButtonGroupItem>` and not styled `<Button>` children“ under Rationale.
|
|
509
|
+
- **The default family is `primary`** — manifest first, and confirmed with design in 1.2.0.
|
|
510
|
+
- **`disabled` behaves differently from `Button` on purpose** — `aria-disabled` and a click guard, the cell keeps its tab stop.
|
|
511
|
+
- **§ Responsive behaviour is not implemented** (proposed upstream): no measured minification, no „⋯“ overflow cell, no mobile bottom bar, no `collapsePriority`. Minify by hand with `icon` cells.
|
|
512
|
+
- **The panel is [`Menu`](?path=/docs/design-system-organisms-menu--docs), not this cell** — a caret cell owns the affordance and `aria-expanded` only; focus movement into the rows and Esc belong to Menu. Pass the caret cell as Menu's `trigger` without `open` / `onClick` ([Menu segment](#menu-segment)); a locked caret cell opens nothing, by click or by <kbd>ArrowDown</kbd>.
|