@invoiceonline/ui-react 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +99 -0
- package/CHANGELOG.md +131 -0
- package/LICENSE +9 -0
- package/README.md +78 -2
- package/dist/assets/label-brush-1.svg +6 -0
- package/dist/assets/pattern-dark.svg +113 -0
- package/dist/components/action-row/ActionRow.d.ts +178 -0
- package/dist/components/action-row/ActionRow.js +340 -0
- package/dist/components/action-row/index.d.ts +2 -0
- package/dist/components/action-row/index.js +1 -0
- package/dist/components/alert/Alert.d.ts +314 -0
- package/dist/components/alert/Alert.js +446 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +1 -0
- package/dist/components/anchored-panel/AnchoredPanel.d.ts +41 -0
- package/dist/components/anchored-panel/AnchoredPanel.js +72 -0
- package/dist/components/anchored-panel/index.d.ts +3 -0
- package/dist/components/anchored-panel/index.js +3 -0
- package/dist/components/badge/Badge.d.ts +146 -0
- package/dist/components/badge/Badge.js +258 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/banner/Banner.d.ts +209 -0
- package/dist/components/banner/Banner.js +339 -0
- package/dist/components/banner/index.d.ts +2 -0
- package/dist/components/banner/index.js +1 -0
- package/dist/components/button/Button.d.ts +54 -0
- package/dist/components/button/Button.js +312 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button-group/ButtonGroup.d.ts +187 -0
- package/dist/components/button-group/ButtonGroup.js +217 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/card-select/CardSelect.d.ts +274 -0
- package/dist/components/card-select/CardSelect.js +561 -0
- package/dist/components/card-select/CardSelectGroup.d.ts +92 -0
- package/dist/components/card-select/CardSelectGroup.js +72 -0
- package/dist/components/card-select/index.d.ts +3 -0
- package/dist/components/card-select/index.js +3 -0
- package/dist/components/checkbox/Checkbox.d.ts +104 -0
- package/dist/components/checkbox/Checkbox.js +194 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/Chip.d.ts +250 -0
- package/dist/components/chip/Chip.js +441 -0
- package/dist/components/chip/index.d.ts +2 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/column-header/ColumnHeader.d.ts +144 -0
- package/dist/components/column-header/ColumnHeader.js +209 -0
- package/dist/components/column-header/index.d.ts +2 -0
- package/dist/components/column-header/index.js +1 -0
- package/dist/components/combobox-field/Combobox.d.ts +104 -0
- package/dist/components/combobox-field/Combobox.js +355 -0
- package/dist/components/combobox-field/ComboboxField.d.ts +76 -0
- package/dist/components/combobox-field/ComboboxField.js +98 -0
- package/dist/components/combobox-field/index.d.ts +3 -0
- package/dist/components/combobox-field/index.js +3 -0
- package/dist/components/date-field/DateField.d.ts +52 -0
- package/dist/components/date-field/DateField.js +45 -0
- package/dist/components/date-field/index.d.ts +2 -0
- package/dist/components/date-field/index.js +1 -0
- package/dist/components/date-picker/DatePicker.d.ts +53 -0
- package/dist/components/date-picker/DatePicker.js +329 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/divider/Divider.d.ts +81 -0
- package/dist/components/divider/Divider.js +93 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/drawer/Drawer.d.ts +128 -0
- package/dist/components/drawer/Drawer.js +367 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/dropdown-button/DropdownButton.d.ts +72 -0
- package/dist/components/dropdown-button/DropdownButton.js +122 -0
- package/dist/components/dropdown-button/index.d.ts +2 -0
- package/dist/components/dropdown-button/index.js +1 -0
- package/dist/components/faq/FAQ.d.ts +135 -0
- package/dist/components/faq/FAQ.js +258 -0
- package/dist/components/faq/index.d.ts +2 -0
- package/dist/components/faq/index.js +1 -0
- package/dist/components/field/Field.d.ts +118 -0
- package/dist/components/field/Field.js +327 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/field-pair/FieldPair.d.ts +194 -0
- package/dist/components/field-pair/FieldPair.js +321 -0
- package/dist/components/field-pair/index.d.ts +2 -0
- package/dist/components/field-pair/index.js +1 -0
- package/dist/components/file-upload/FileUpload.d.ts +137 -0
- package/dist/components/file-upload/FileUpload.js +434 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/file-upload/index.js +1 -0
- package/dist/components/filter-chip/FilterChip.d.ts +373 -0
- package/dist/components/filter-chip/FilterChip.js +517 -0
- package/dist/components/filter-chip/index.d.ts +2 -0
- package/dist/components/filter-chip/index.js +1 -0
- package/dist/components/filter-facet/FilterFacet.d.ts +116 -0
- package/dist/components/filter-facet/FilterFacet.js +632 -0
- package/dist/components/filter-facet/index.d.ts +2 -0
- package/dist/components/filter-facet/index.js +1 -0
- package/dist/components/firm-avatar/FirmAvatar.d.ts +75 -0
- package/dist/components/firm-avatar/FirmAvatar.js +119 -0
- package/dist/components/firm-avatar/index.d.ts +2 -0
- package/dist/components/firm-avatar/index.js +1 -0
- package/dist/components/form-actions/FormActions.d.ts +123 -0
- package/dist/components/form-actions/FormActions.js +195 -0
- package/dist/components/form-actions/index.d.ts +2 -0
- package/dist/components/form-actions/index.js +1 -0
- package/dist/components/form-block/FormBlock.d.ts +252 -0
- package/dist/components/form-block/FormBlock.js +420 -0
- package/dist/components/form-block/index.d.ts +3 -0
- package/dist/components/form-block/index.js +3 -0
- package/dist/components/form-section/FormSection.d.ts +130 -0
- package/dist/components/form-section/FormSection.js +206 -0
- package/dist/components/form-section/index.d.ts +2 -0
- package/dist/components/form-section/index.js +1 -0
- package/dist/components/heading/Heading.d.ts +69 -0
- package/dist/components/heading/Heading.js +79 -0
- package/dist/components/heading/index.d.ts +2 -0
- package/dist/components/heading/index.js +1 -0
- package/dist/components/heading-group/HeadingGroup.d.ts +258 -0
- package/dist/components/heading-group/HeadingGroup.js +255 -0
- package/dist/components/heading-group/index.d.ts +2 -0
- package/dist/components/heading-group/index.js +1 -0
- package/dist/components/hero/Hero.d.ts +268 -0
- package/dist/components/hero/Hero.js +316 -0
- package/dist/components/hero/index.d.ts +2 -0
- package/dist/components/hero/index.js +1 -0
- package/dist/components/icon/Icon.d.ts +27 -0
- package/dist/components/icon/Icon.js +30 -0
- package/dist/components/icon/index.d.ts +3 -0
- package/dist/components/icon/index.js +3 -0
- package/dist/components/icon-button/IconButton.d.ts +75 -0
- package/dist/components/icon-button/IconButton.js +151 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +1 -0
- package/dist/components/item-row/ItemRow.d.ts +253 -0
- package/dist/components/item-row/ItemRow.js +496 -0
- package/dist/components/item-row/index.d.ts +2 -0
- package/dist/components/item-row/index.js +1 -0
- package/dist/components/list-row/ListRow.d.ts +165 -0
- package/dist/components/list-row/ListRow.js +233 -0
- package/dist/components/list-row/index.d.ts +2 -0
- package/dist/components/list-row/index.js +1 -0
- package/dist/components/menu/Menu.d.ts +64 -0
- package/dist/components/menu/Menu.js +186 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/modal/Modal.d.ts +272 -0
- package/dist/components/modal/Modal.js +788 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.js +1 -0
- package/dist/components/nav-link/NavLink.d.ts +123 -0
- package/dist/components/nav-link/NavLink.js +157 -0
- package/dist/components/nav-link/index.d.ts +2 -0
- package/dist/components/nav-link/index.js +1 -0
- package/dist/components/number-field/NumberField.d.ts +62 -0
- package/dist/components/number-field/NumberField.js +210 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/index.js +1 -0
- package/dist/components/pagination/Pagination.d.ts +133 -0
- package/dist/components/pagination/Pagination.js +217 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/pagination/index.js +3 -0
- package/dist/components/popover-surface/index.d.ts +2 -0
- package/dist/components/popover-surface/index.js +1 -0
- package/dist/components/progress-bar/ProgressBar.d.ts +260 -0
- package/dist/components/progress-bar/ProgressBar.js +470 -0
- package/dist/components/progress-bar/index.d.ts +2 -0
- package/dist/components/progress-bar/index.js +1 -0
- package/dist/components/promo-sticker/PromoSticker.d.ts +204 -0
- package/dist/components/promo-sticker/PromoSticker.js +177 -0
- package/dist/components/promo-sticker/index.d.ts +2 -0
- package/dist/components/promo-sticker/index.js +1 -0
- package/dist/components/promo-surface/PromoSurface.d.ts +94 -0
- package/dist/components/promo-surface/PromoSurface.js +119 -0
- package/dist/components/promo-surface/index.d.ts +2 -0
- package/dist/components/promo-surface/index.js +1 -0
- package/dist/components/radio/Radio.d.ts +92 -0
- package/dist/components/radio/Radio.js +171 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/index.js +1 -0
- package/dist/components/radio-group/RadioGroup.d.ts +61 -0
- package/dist/components/radio-group/RadioGroup.js +51 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/select/Select.d.ts +65 -0
- package/dist/components/select/Select.js +176 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/select-field/SelectField.d.ts +16 -0
- package/dist/components/select-field/SelectField.js +55 -0
- package/dist/components/select-field/index.d.ts +2 -0
- package/dist/components/select-field/index.js +1 -0
- package/dist/components/skeleton/Skeleton.d.ts +64 -0
- package/dist/components/skeleton/Skeleton.js +65 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/split-button/SplitButton.d.ts +80 -0
- package/dist/components/split-button/SplitButton.js +182 -0
- package/dist/components/split-button/index.d.ts +2 -0
- package/dist/components/split-button/index.js +1 -0
- package/dist/components/status-summary-bar/StatusSummaryBar.d.ts +118 -0
- package/dist/components/status-summary-bar/StatusSummaryBar.js +278 -0
- package/dist/components/status-summary-bar/index.d.ts +2 -0
- package/dist/components/status-summary-bar/index.js +1 -0
- package/dist/components/subject-lookup-field/SubjectLookupField.d.ts +157 -0
- package/dist/components/subject-lookup-field/SubjectLookupField.js +663 -0
- package/dist/components/subject-lookup-field/index.d.ts +2 -0
- package/dist/components/subject-lookup-field/index.js +1 -0
- package/dist/components/switch/Switch.d.ts +152 -0
- package/dist/components/switch/Switch.js +307 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/table/Table.d.ts +5 -0
- package/dist/components/table/Table.js +601 -0
- package/dist/components/table/index.d.ts +6 -0
- package/dist/components/table/index.js +6 -0
- package/dist/components/text-field/TextField.d.ts +65 -0
- package/dist/components/text-field/TextField.js +173 -0
- package/dist/components/text-field/index.d.ts +2 -0
- package/dist/components/text-field/index.js +1 -0
- package/dist/components/text-link/TextLink.d.ts +260 -0
- package/dist/components/text-link/TextLink.js +303 -0
- package/dist/components/text-link/index.d.ts +2 -0
- package/dist/components/text-link/index.js +1 -0
- package/dist/components/textarea/Textarea.d.ts +93 -0
- package/dist/components/textarea/Textarea.js +256 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +129 -0
- package/dist/components/tooltip/Tooltip.js +457 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/unit-field/UnitField.d.ts +46 -0
- package/dist/components/unit-field/UnitField.js +133 -0
- package/dist/components/unit-field/index.d.ts +2 -0
- package/dist/components/unit-field/index.js +1 -0
- package/dist/icons/icon-registry.generated.js +500 -0
- package/dist/icons/icon-types.generated.d.ts +2 -0
- package/dist/icons/icon-types.generated.js +126 -0
- package/dist/index.d.ts +132 -0
- package/dist/index.js +75 -0
- package/dist/internal/BottomSheet.js +496 -0
- package/dist/internal/FodsProvider.d.ts +25 -0
- package/dist/internal/FodsProvider.js +32 -0
- package/dist/internal/MotionCaret.js +35 -0
- package/dist/internal/NumberFormatInput.d.ts +21 -0
- package/dist/internal/NumberFormatInput.js +126 -0
- package/dist/internal/SummaryDonut.d.ts +3 -0
- package/dist/internal/SummaryDonut.js +300 -0
- package/dist/internal/buttonSegment.d.ts +44 -0
- package/dist/internal/buttonSegment.js +126 -0
- package/dist/internal/collapseRoom.js +128 -0
- package/dist/internal/comboboxKeys.js +44 -0
- package/dist/internal/contentPresence.js +46 -0
- package/dist/internal/dayCell.js +95 -0
- package/dist/internal/dialogPortal.d.ts +2 -0
- package/dist/internal/dialogPortal.js +21 -0
- package/dist/internal/donutSweeps.js +65 -0
- package/dist/internal/enterOnViewGeometry.js +46 -0
- package/dist/internal/faqItem.js +80 -0
- package/dist/internal/floatingLabelMotion.js +68 -0
- package/dist/internal/formBlockContext.d.ts +22 -0
- package/dist/internal/formBlockContext.js +20 -0
- package/dist/internal/heightRoom.js +87 -0
- package/dist/internal/numberSeparators.js +62 -0
- package/dist/internal/overlayMotion.js +48 -0
- package/dist/internal/paginationItem.d.ts +8 -0
- package/dist/internal/paginationItem.js +22 -0
- package/dist/internal/popoverSurface.d.ts +8 -0
- package/dist/internal/popoverSurface.js +23 -0
- package/dist/internal/portalContainer.d.ts +1 -0
- package/dist/internal/portalContainer.js +6 -0
- package/dist/internal/progressBarItem.d.ts +207 -0
- package/dist/internal/progressBarItem.js +264 -0
- package/dist/internal/selectionControlText.js +12 -0
- package/dist/internal/statusSummaryParts.js +371 -0
- package/dist/internal/summaryMotion.js +75 -0
- package/dist/internal/table/ChildConnector.js +62 -0
- package/dist/internal/table/ChildRowPrefix.d.ts +9 -0
- package/dist/internal/table/ChildRowPrefix.js +27 -0
- package/dist/internal/table/ColumnSettings.js +135 -0
- package/dist/internal/table/ScrollRegion.js +114 -0
- package/dist/internal/table/TableEmpty.js +93 -0
- package/dist/internal/table/TableLayout.d.ts +17 -0
- package/dist/internal/table/TableLayout.js +29 -0
- package/dist/internal/table/TableLoadStatus.js +56 -0
- package/dist/internal/table/TableMobile.js +488 -0
- package/dist/internal/table/TruncatedCell.js +33 -0
- package/dist/internal/table/emptyValue.js +10 -0
- package/dist/internal/table/features.d.ts +41 -0
- package/dist/internal/table/features.js +31 -0
- package/dist/internal/table/recipes.js +227 -0
- package/dist/internal/table/rowClick.js +9 -0
- package/dist/internal/table/types.d.ts +325 -0
- package/dist/internal/table/types.js +13 -0
- package/dist/internal/tailwind-variants.d.ts +3 -0
- package/dist/internal/tailwind-variants.js +37 -0
- package/dist/internal/tooltipContext.js +5 -0
- package/dist/internal/tw-merge-config.generated.js +314 -0
- package/dist/internal/useAnchoredPanel.d.ts +87 -0
- package/dist/internal/useAnchoredPanel.js +108 -0
- package/dist/internal/useCountUp.js +53 -0
- package/dist/internal/useDateFieldTrigger.js +183 -0
- package/dist/internal/useEChart.js +59 -0
- package/dist/internal/useEnterOnView.js +42 -0
- package/dist/internal/useFloatingBar.js +100 -0
- package/dist/internal/useFormReset.js +37 -0
- package/dist/internal/useIsMobile.js +44 -0
- package/dist/internal/useOneRowOverflow.js +88 -0
- package/dist/internal/usePrefersReducedMotion.js +25 -0
- package/dist/internal/useReturnFocus.js +26 -0
- package/dist/internal/utils.d.ts +7 -0
- package/dist/internal/utils.js +58 -0
- package/dist/node_modules/@tanstack/store/dist/store.d.ts +29 -0
- package/dist/node_modules/@tanstack/store/dist/types.d.ts +38 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/cells/coreCellsFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/cells/coreCellsFeature.types.d.ts +53 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/columns/coreColumnsFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/columns/coreColumnsFeature.types.d.ts +90 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/coreFeatures.d.ts +17 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/headers/coreHeadersFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/headers/coreHeadersFeature.types.d.ts +114 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/reactivity/coreReactivityFeature.types.d.ts +51 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/row-models/coreRowModelsFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/row-models/coreRowModelsFeature.types.d.ts +29 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/rows/coreRowsFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/rows/coreRowsFeature.types.d.ts +129 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/table/coreTablesFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/table/coreTablesFeature.types.d.ts +203 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/cell-selection/cellSelectionFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/cell-selection/cellSelectionFeature.types.d.ts +294 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/cell-spanning/cellSpanningFeature.d.ts +11 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/cell-spanning/cellSpanningFeature.types.d.ts +148 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-faceting/columnFacetingFeature.d.ts +12 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-faceting/columnFacetingFeature.types.d.ts +63 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-filtering/columnFilteringFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-filtering/columnFilteringFeature.types.d.ts +209 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-filtering/filterFns.d.ts +35 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-grouping/columnGroupingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-grouping/columnGroupingFeature.types.d.ts +128 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-ordering/columnOrderingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-ordering/columnOrderingFeature.types.d.ts +82 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-pinning/columnPinningFeature.d.ts +11 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-pinning/columnPinningFeature.types.d.ts +195 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-resizing/columnResizingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-resizing/columnResizingFeature.types.d.ts +73 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-sizing/columnSizingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-sizing/columnSizingFeature.types.d.ts +134 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-visibility/columnVisibilityFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +92 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/global-filtering/globalFilteringFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/global-filtering/globalFilteringFeature.types.d.ts +67 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-aggregation/aggregationFns.d.ts +23 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-aggregation/rowAggregationFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-aggregation/rowAggregationFeature.types.d.ts +183 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-aggregation/rowAggregationFeature.utils.d.ts +18 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-expanding/rowExpandingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-expanding/rowExpandingFeature.types.d.ts +125 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-pagination/rowPaginationFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-pagination/rowPaginationFeature.types.d.ts +135 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-pinning/rowPinningFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-pinning/rowPinningFeature.types.d.ts +76 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-selection/rowSelectionFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-selection/rowSelectionFeature.types.d.ts +187 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-sorting/rowSortingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-sorting/rowSortingFeature.types.d.ts +236 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-sorting/sortFns.d.ts +23 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/stockFeatures.d.ts +37 -0
- package/dist/node_modules/@tanstack/table-core/dist/helpers/columnHelper.d.ts +47 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Cell.d.ts +16 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Column.d.ts +30 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/ColumnDef.d.ts +123 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Header.d.ts +12 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/HeaderGroup.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Row.d.ts +24 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/RowModel.d.ts +19 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/RowModelFns.d.ts +11 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Table.d.ts +53 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/TableFeatures.d.ts +416 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/TableOptions.d.ts +78 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/TableState.d.ts +46 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/type-utils.d.ts +25 -0
- package/dist/shared.css +179 -0
- package/dist/styles.css +5467 -0
- package/dist/theme.css +314 -0
- package/dist/theme.map.json +278 -0
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/index.js +1 -0
- package/dist/tokens/tokens.generated.d.ts +2040 -0
- package/dist/tokens/tokens.generated.js +2053 -0
- package/dist/tokens.css +484 -0
- package/dist/tokens.flat.json +429 -0
- package/docs/Consuming.mdx +379 -0
- package/docs/Contributing.mdx +78 -0
- package/docs/ForAgents.mdx +53 -0
- package/docs/Introduction.mdx +54 -0
- package/llms.txt +556 -0
- package/package.json +357 -4
- package/src/components/action-row/ActionRow.mdx +686 -0
- package/src/components/action-row/ActionRow.stories.tsx +669 -0
- package/src/components/action-row/ActionRow.tsx +632 -0
- package/src/components/action-row/index.ts +9 -0
- package/src/components/alert/Alert.mdx +377 -0
- package/src/components/alert/Alert.stories.tsx +674 -0
- package/src/components/alert/Alert.tsx +579 -0
- package/src/components/alert/index.ts +13 -0
- package/src/components/anchored-panel/AnchoredPanel.mdx +381 -0
- package/src/components/anchored-panel/AnchoredPanel.stories.tsx +593 -0
- package/src/components/anchored-panel/AnchoredPanel.tsx +176 -0
- package/src/components/anchored-panel/index.ts +15 -0
- package/src/components/badge/Badge.mdx +487 -0
- package/src/components/badge/Badge.stories.tsx +375 -0
- package/src/components/badge/Badge.tsx +360 -0
- package/src/components/badge/index.ts +10 -0
- package/src/components/banner/Banner.mdx +704 -0
- package/src/components/banner/Banner.stories.tsx +448 -0
- package/src/components/banner/Banner.tsx +602 -0
- package/src/components/banner/index.ts +14 -0
- package/src/components/button/Button.mdx +286 -0
- package/src/components/button/Button.stories.tsx +381 -0
- package/src/components/button/Button.tsx +384 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/button-group/ButtonGroup.mdx +512 -0
- package/src/components/button-group/ButtonGroup.stories.tsx +714 -0
- package/src/components/button-group/ButtonGroup.tsx +491 -0
- package/src/components/button-group/index.ts +10 -0
- package/src/components/card-select/CardSelect.mdx +662 -0
- package/src/components/card-select/CardSelect.stories.tsx +784 -0
- package/src/components/card-select/CardSelect.tsx +783 -0
- package/src/components/card-select/CardSelectGroup.tsx +169 -0
- package/src/components/card-select/index.ts +18 -0
- package/src/components/checkbox/Checkbox.mdx +269 -0
- package/src/components/checkbox/Checkbox.stories.tsx +306 -0
- package/src/components/checkbox/Checkbox.tsx +343 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/chip/Chip.mdx +683 -0
- package/src/components/chip/Chip.stories.tsx +734 -0
- package/src/components/chip/Chip.tsx +732 -0
- package/src/components/chip/index.ts +9 -0
- package/src/components/column-header/ColumnHeader.mdx +301 -0
- package/src/components/column-header/ColumnHeader.stories.tsx +319 -0
- package/src/components/column-header/ColumnHeader.tsx +287 -0
- package/src/components/column-header/index.ts +7 -0
- package/src/components/combobox-field/Combobox.tsx +693 -0
- package/src/components/combobox-field/ComboboxField.mdx +525 -0
- package/src/components/combobox-field/ComboboxField.stories.tsx +502 -0
- package/src/components/combobox-field/ComboboxField.tsx +259 -0
- package/src/components/combobox-field/index.ts +12 -0
- package/src/components/date-field/DateField.mdx +340 -0
- package/src/components/date-field/DateField.stories.tsx +221 -0
- package/src/components/date-field/DateField.tsx +176 -0
- package/src/components/date-field/index.ts +1 -0
- package/src/components/date-picker/DatePicker.mdx +436 -0
- package/src/components/date-picker/DatePicker.stories.tsx +458 -0
- package/src/components/date-picker/DatePicker.tsx +688 -0
- package/src/components/date-picker/index.ts +9 -0
- package/src/components/divider/Divider.mdx +256 -0
- package/src/components/divider/Divider.stories.tsx +177 -0
- package/src/components/divider/Divider.tsx +193 -0
- package/src/components/divider/index.ts +1 -0
- package/src/components/drawer/Drawer.mdx +518 -0
- package/src/components/drawer/Drawer.stories.tsx +392 -0
- package/src/components/drawer/Drawer.tsx +683 -0
- package/src/components/drawer/index.ts +1 -0
- package/src/components/dropdown-button/DropdownButton.mdx +285 -0
- package/src/components/dropdown-button/DropdownButton.stories.tsx +398 -0
- package/src/components/dropdown-button/DropdownButton.tsx +198 -0
- package/src/components/dropdown-button/index.ts +7 -0
- package/src/components/faq/FAQ.mdx +364 -0
- package/src/components/faq/FAQ.stories.tsx +343 -0
- package/src/components/faq/FAQ.tsx +337 -0
- package/src/components/faq/index.ts +1 -0
- package/src/components/field/Field.mdx +129 -0
- package/src/components/field/Field.stories.tsx +461 -0
- package/src/components/field/Field.tsx +765 -0
- package/src/components/field/index.ts +20 -0
- package/src/components/field-pair/FieldPair.mdx +308 -0
- package/src/components/field-pair/FieldPair.stories.tsx +530 -0
- package/src/components/field-pair/FieldPair.tsx +796 -0
- package/src/components/field-pair/index.ts +9 -0
- package/src/components/file-upload/FileUpload.mdx +345 -0
- package/src/components/file-upload/FileUpload.stories.tsx +698 -0
- package/src/components/file-upload/FileUpload.tsx +802 -0
- package/src/components/file-upload/index.ts +6 -0
- package/src/components/filter-chip/FilterChip.mdx +778 -0
- package/src/components/filter-chip/FilterChip.stories.tsx +827 -0
- package/src/components/filter-chip/FilterChip.tsx +881 -0
- package/src/components/filter-chip/index.ts +11 -0
- package/src/components/filter-facet/FilterFacet.mdx +536 -0
- package/src/components/filter-facet/FilterFacet.stories.tsx +506 -0
- package/src/components/filter-facet/FilterFacet.tsx +1160 -0
- package/src/components/filter-facet/index.ts +7 -0
- package/src/components/firm-avatar/FirmAvatar.mdx +280 -0
- package/src/components/firm-avatar/FirmAvatar.stories.tsx +147 -0
- package/src/components/firm-avatar/FirmAvatar.tsx +172 -0
- package/src/components/firm-avatar/index.ts +7 -0
- package/src/components/form-actions/FormActions.mdx +518 -0
- package/src/components/form-actions/FormActions.stories.tsx +621 -0
- package/src/components/form-actions/FormActions.tsx +273 -0
- package/src/components/form-actions/index.ts +6 -0
- package/src/components/form-block/FormBlock.mdx +728 -0
- package/src/components/form-block/FormBlock.stories.tsx +813 -0
- package/src/components/form-block/FormBlock.tsx +679 -0
- package/src/components/form-block/index.ts +13 -0
- package/src/components/form-section/FormSection.mdx +436 -0
- package/src/components/form-section/FormSection.stories.tsx +407 -0
- package/src/components/form-section/FormSection.tsx +290 -0
- package/src/components/form-section/index.ts +17 -0
- package/src/components/heading/Heading.mdx +206 -0
- package/src/components/heading/Heading.stories.tsx +169 -0
- package/src/components/heading/Heading.tsx +124 -0
- package/src/components/heading/index.ts +8 -0
- package/src/components/heading-group/HeadingGroup.mdx +521 -0
- package/src/components/heading-group/HeadingGroup.stories.tsx +353 -0
- package/src/components/heading-group/HeadingGroup.tsx +396 -0
- package/src/components/heading-group/index.ts +7 -0
- package/src/components/hero/Hero.mdx +742 -0
- package/src/components/hero/Hero.stories.tsx +527 -0
- package/src/components/hero/Hero.tsx +807 -0
- package/src/components/hero/index.ts +1 -0
- package/src/components/icon/Icon.mdx +329 -0
- package/src/components/icon/Icon.stories.tsx +398 -0
- package/src/components/icon/Icon.tsx +97 -0
- package/src/components/icon/index.ts +2 -0
- package/src/components/icon-button/IconButton.mdx +206 -0
- package/src/components/icon-button/IconButton.stories.tsx +341 -0
- package/src/components/icon-button/IconButton.tsx +273 -0
- package/src/components/icon-button/index.ts +1 -0
- package/src/components/item-row/ItemRow.mdx +533 -0
- package/src/components/item-row/ItemRow.stories.tsx +434 -0
- package/src/components/item-row/ItemRow.tsx +676 -0
- package/src/components/item-row/index.ts +9 -0
- package/src/components/list-row/ListRow.mdx +404 -0
- package/src/components/list-row/ListRow.stories.tsx +404 -0
- package/src/components/list-row/ListRow.tsx +424 -0
- package/src/components/list-row/index.ts +1 -0
- package/src/components/menu/Menu.mdx +268 -0
- package/src/components/menu/Menu.stories.tsx +455 -0
- package/src/components/menu/Menu.tsx +452 -0
- package/src/components/menu/index.ts +1 -0
- package/src/components/modal/Modal.mdx +854 -0
- package/src/components/modal/Modal.stories.tsx +881 -0
- package/src/components/modal/Modal.tsx +1434 -0
- package/src/components/modal/index.ts +1 -0
- package/src/components/nav-link/NavLink.mdx +196 -0
- package/src/components/nav-link/NavLink.stories.tsx +243 -0
- package/src/components/nav-link/NavLink.tsx +222 -0
- package/src/components/nav-link/index.ts +1 -0
- package/src/components/number-field/NumberField.mdx +223 -0
- package/src/components/number-field/NumberField.stories.tsx +291 -0
- package/src/components/number-field/NumberField.tsx +388 -0
- package/src/components/number-field/index.ts +6 -0
- package/src/components/pagination/Pagination.mdx +305 -0
- package/src/components/pagination/Pagination.stories.tsx +333 -0
- package/src/components/pagination/Pagination.tsx +343 -0
- package/src/components/pagination/index.ts +8 -0
- package/src/components/popover-surface/PopoverSurface.mdx +158 -0
- package/src/components/popover-surface/PopoverSurface.stories.tsx +421 -0
- package/src/components/popover-surface/index.ts +1 -0
- package/src/components/progress-bar/ProgressBar.mdx +802 -0
- package/src/components/progress-bar/ProgressBar.stories.tsx +533 -0
- package/src/components/progress-bar/ProgressBar.tsx +654 -0
- package/src/components/progress-bar/index.ts +9 -0
- package/src/components/promo-sticker/PromoSticker.mdx +436 -0
- package/src/components/promo-sticker/PromoSticker.stories.tsx +363 -0
- package/src/components/promo-sticker/PromoSticker.tsx +313 -0
- package/src/components/promo-sticker/index.ts +7 -0
- package/src/components/promo-surface/PromoSurface.mdx +399 -0
- package/src/components/promo-surface/PromoSurface.stories.tsx +270 -0
- package/src/components/promo-surface/PromoSurface.tsx +305 -0
- package/src/components/promo-surface/index.ts +7 -0
- package/src/components/radio/Radio.mdx +243 -0
- package/src/components/radio/Radio.stories.tsx +307 -0
- package/src/components/radio/Radio.tsx +288 -0
- package/src/components/radio/index.ts +1 -0
- package/src/components/radio-group/RadioGroup.mdx +119 -0
- package/src/components/radio-group/RadioGroup.stories.tsx +225 -0
- package/src/components/radio-group/RadioGroup.tsx +139 -0
- package/src/components/radio-group/index.ts +1 -0
- package/src/components/select/Select.mdx +241 -0
- package/src/components/select/Select.stories.tsx +404 -0
- package/src/components/select/Select.tsx +381 -0
- package/src/components/select/index.ts +1 -0
- package/src/components/select-field/SelectField.mdx +324 -0
- package/src/components/select-field/SelectField.stories.tsx +460 -0
- package/src/components/select-field/SelectField.tsx +138 -0
- package/src/components/select-field/index.ts +1 -0
- package/src/components/skeleton/Skeleton.mdx +194 -0
- package/src/components/skeleton/Skeleton.stories.tsx +260 -0
- package/src/components/skeleton/Skeleton.tsx +107 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/split-button/SplitButton.mdx +445 -0
- package/src/components/split-button/SplitButton.stories.tsx +465 -0
- package/src/components/split-button/SplitButton.tsx +361 -0
- package/src/components/split-button/index.ts +7 -0
- package/src/components/status-summary-bar/StatusSummaryBar.mdx +338 -0
- package/src/components/status-summary-bar/StatusSummaryBar.stories.tsx +408 -0
- package/src/components/status-summary-bar/StatusSummaryBar.tsx +428 -0
- package/src/components/status-summary-bar/index.ts +8 -0
- package/src/components/subject-lookup-field/SubjectLookupField.mdx +378 -0
- package/src/components/subject-lookup-field/SubjectLookupField.stories.tsx +393 -0
- package/src/components/subject-lookup-field/SubjectLookupField.tsx +1079 -0
- package/src/components/subject-lookup-field/index.ts +11 -0
- package/src/components/switch/Switch.mdx +376 -0
- package/src/components/switch/Switch.stories.tsx +296 -0
- package/src/components/switch/Switch.tsx +483 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/table/Table.mdx +575 -0
- package/src/components/table/Table.stories.tsx +1049 -0
- package/src/components/table/Table.tsx +745 -0
- package/src/components/table/TableConsumers.stories.tsx +195 -0
- package/src/components/table/_tableFixtures.ts +1189 -0
- package/src/components/table/index.ts +22 -0
- package/src/components/text-field/TextField.mdx +479 -0
- package/src/components/text-field/TextField.stories.tsx +366 -0
- package/src/components/text-field/TextField.tsx +391 -0
- package/src/components/text-field/index.ts +8 -0
- package/src/components/text-link/TextLink.mdx +353 -0
- package/src/components/text-link/TextLink.stories.tsx +458 -0
- package/src/components/text-link/TextLink.tsx +504 -0
- package/src/components/text-link/index.ts +10 -0
- package/src/components/textarea/Textarea.mdx +244 -0
- package/src/components/textarea/Textarea.stories.tsx +371 -0
- package/src/components/textarea/Textarea.tsx +489 -0
- package/src/components/textarea/index.ts +9 -0
- package/src/components/tooltip/Tooltip.mdx +462 -0
- package/src/components/tooltip/Tooltip.stories.tsx +500 -0
- package/src/components/tooltip/Tooltip.tsx +756 -0
- package/src/components/tooltip/index.ts +13 -0
- package/src/components/unit-field/UnitField.mdx +215 -0
- package/src/components/unit-field/UnitField.stories.tsx +291 -0
- package/src/components/unit-field/UnitField.tsx +255 -0
- package/src/components/unit-field/index.ts +7 -0
- package/src/icons/icon-registry.generated.ts +510 -0
- package/src/icons/icon-types.generated.ts +256 -0
- package/src/index.ts +71 -0
- package/src/internal/BottomSheet.tsx +714 -0
- package/src/internal/FodsProvider.tsx +36 -0
- package/src/internal/MotionCaret.tsx +53 -0
- package/src/internal/NumberFormatInput.tsx +276 -0
- package/src/internal/SummaryDonut.tsx +359 -0
- package/src/internal/buttonSegment.ts +241 -0
- package/src/internal/collapseRoom.ts +130 -0
- package/src/internal/comboboxKeys.ts +90 -0
- package/src/internal/contentPresence.ts +46 -0
- package/src/internal/dayCell.ts +274 -0
- package/src/internal/dialogPortal.ts +50 -0
- package/src/internal/donutSweeps.ts +77 -0
- package/src/internal/enterOnViewGeometry.ts +53 -0
- package/src/internal/faqItem.ts +104 -0
- package/src/internal/floatingLabelMotion.tsx +109 -0
- package/src/internal/formBlockContext.ts +27 -0
- package/src/internal/heightRoom.ts +135 -0
- package/src/internal/numberSeparators.ts +93 -0
- package/src/internal/overlayMotion.tsx +32 -0
- package/src/internal/paginationItem.ts +106 -0
- package/src/internal/popoverSurface.ts +78 -0
- package/src/internal/portalContainer.ts +11 -0
- package/src/internal/progressBarItem.ts +356 -0
- package/src/internal/selectionControlText.ts +42 -0
- package/src/internal/statusSummaryParts.tsx +475 -0
- package/src/internal/summaryMotion.ts +111 -0
- package/src/internal/table/ChildConnector.tsx +57 -0
- package/src/internal/table/ChildRowPrefix.tsx +21 -0
- package/src/internal/table/ColumnSettings.tsx +194 -0
- package/src/internal/table/ScrollRegion.tsx +176 -0
- package/src/internal/table/TableEmpty.tsx +99 -0
- package/src/internal/table/TableLayout.tsx +29 -0
- package/src/internal/table/TableLoadStatus.tsx +60 -0
- package/src/internal/table/TableMobile.tsx +582 -0
- package/src/internal/table/TruncatedCell.tsx +35 -0
- package/src/internal/table/emptyValue.ts +11 -0
- package/src/internal/table/features.ts +44 -0
- package/src/internal/table/recipes.ts +263 -0
- package/src/internal/table/rowClick.ts +8 -0
- package/src/internal/table/types.ts +342 -0
- package/src/internal/tailwind-variants.ts +65 -0
- package/src/internal/tooltipContext.ts +15 -0
- package/src/internal/tw-merge-config.generated.ts +275 -0
- package/src/internal/useAnchoredPanel.ts +340 -0
- package/src/internal/useCountUp.ts +65 -0
- package/src/internal/useDateFieldTrigger.tsx +357 -0
- package/src/internal/useEChart.ts +88 -0
- package/src/internal/useEnterOnView.ts +80 -0
- package/src/internal/useFloatingBar.ts +125 -0
- package/src/internal/useFormReset.ts +47 -0
- package/src/internal/useIsMobile.ts +64 -0
- package/src/internal/useNoImplicitSubmit.ts +41 -0
- package/src/internal/useOneRowOverflow.ts +103 -0
- package/src/internal/usePrefersReducedMotion.ts +27 -0
- package/src/internal/useReturnFocus.ts +34 -0
- package/src/internal/utils.ts +58 -0
- package/src/recipes/EmptyState.stories.tsx +105 -0
- package/src/recipes/Form.stories.tsx +355 -0
- package/src/recipes/ModalWithForm.stories.tsx +219 -0
- package/src/recipes/Recipes.mdx +61 -0
- package/src/recipes/TableWithFilters.stories.tsx +278 -0
- package/src/storybook/FodsFamily.tsx +39 -0
- package/src/storybook/Section.tsx +36 -0
- package/src/storybook/a11y.ts +24 -0
- package/src/storybook/assets/banner-character-bartender.webp +0 -0
- package/src/storybook/assets/banner-invoice-sheet-left.webp +0 -0
- package/src/storybook/assets/banner-invoice-sheet-right.webp +0 -0
- package/src/storybook/assets/invoice-hero.webp +0 -0
- package/src/storybook/assets/invoice.webp +0 -0
- package/src/storybook/assets/section-document-info.svg +21 -0
- package/src/storybook/assets/section-gear-checklist.svg +11 -0
- package/src/storybook/assets/section-person-arrow-in.svg +15 -0
- package/src/storybook/assets/section-person-arrow-out.svg +22 -0
- package/src/storybook/assets/section-receipt-dollar.svg +23 -0
- package/src/storybook/assets/table-empty-folder-empty.png +0 -0
- package/src/storybook/assets/table-empty-folder-magnifying-glass.png +0 -0
- package/src/storybook/assets/table-empty-funnel.png +0 -0
- package/src/storybook/assets/table-empty-load-failed.png +0 -0
- package/src/storybook/assets/wallet-spot.png +0 -0
- package/src/storybook/assets.d.ts +17 -0
- package/src/storybook/componentDoc.ts +41 -0
- package/src/storybook/fitFrame.tsx +70 -0
- package/src/storybook/forceStates.tsx +647 -0
- package/src/storybook/illustrations.tsx +66 -0
- package/src/storybook/viewportFrame.tsx +58 -0
- package/src/styles/assets/label-brush-1.svg +6 -0
- package/src/styles/assets/pattern-dark.svg +113 -0
- package/src/styles/base.css +106 -0
- package/src/styles/index.css +15 -0
- package/src/styles/motion.css +157 -0
- package/src/styles/promo-sticker.css +27 -0
- package/src/styles/promo-surface.css +49 -0
- package/src/styles/shared.css +11 -0
- package/src/styles/theme.generated.css +314 -0
- package/src/styles/theme.map.json +278 -0
- package/src/styles/tracking.generated.css +12 -0
- package/src/tokens/index.ts +4 -0
- package/src/tokens/tokens.generated.ts +542 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as ColumnHeaderStories from './ColumnHeader.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={ColumnHeaderStories} tags={['autodocs']} />
|
|
5
|
+
|
|
6
|
+
# ColumnHeader
|
|
7
|
+
|
|
8
|
+
## Metadata
|
|
9
|
+
|
|
10
|
+
- **Layer:** atom
|
|
11
|
+
- **Status:** draft
|
|
12
|
+
- **Manifest version:** `2.1.1`
|
|
13
|
+
- **Tokens used:** `--border-width-200`, `--font-body`, `--font-size-sm`, `--font-size-xxs`, `--font-weight-normal`, `--font-weight-semibold`, `--icon-muted`, `--leading-loose`, `--leading-relaxed`, `--outline-focus`, `--radius-0`, `--size-icon-xsmall`, `--space-400`, `--space-500`, `--text-primary`, `--text-secondary`, `--text-wrap-body`
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
ColumnHeader is the **header cell that tops every table column**: a label, an optional one-line description under it, and a state-driven sort glyph. It renders a `<th scope="col">`; a sortable column puts a real `<button>` across the whole cell.
|
|
18
|
+
|
|
19
|
+
**Use it** as the header cell of each column of a Table — one instance per column. Pass `sortable=false` for a column that never sorts, and `description` for a secondary clarifying line under the label (e.g. `Celkem s DPH` / `(Celková cena)`).
|
|
20
|
+
|
|
21
|
+
**Do not use it** as a general-purpose label, as a filter control, or as the place for column actions — it is the only sortable-header affordance and nothing else (manifest `intent.whenToUse`).
|
|
22
|
+
|
|
23
|
+
## Rationale
|
|
24
|
+
|
|
25
|
+
This atom deliberately avoids three header defects (spec § Rationale): a sort caret glued to the label with near-zero spacing, a default caret that contradicts the actual row order (ascending while the data is descending), and a header that is a monolithic table concern with no per-column state.
|
|
26
|
+
|
|
27
|
+
ColumnHeader therefore codifies three things:
|
|
28
|
+
|
|
29
|
+
- **An honest indicator.** The sort state has exactly one source — the `aria-sort` the consumer puts on the cell. The glyph and the ink are derived from it, so the indicator cannot disagree with what assistive tech announces. There is no separate `sorted` prop.
|
|
30
|
+
- **The shadcn `DataTableColumnHeader` glyph pairing** — a 16px glyph, `--space-400` (8px) after the label.
|
|
31
|
+
- **A single ink ladder** — one ghost family (`families[0]` "header") covers all three Align values; only State recolours.
|
|
32
|
+
|
|
33
|
+
## Anatomy
|
|
34
|
+
|
|
35
|
+
The `<th>` carries `data-fods-component="column-header"` and the part markers below.
|
|
36
|
+
|
|
37
|
+
- **Cell** (`data-fods-part="root"`) — the `<th scope="col">`. It owns only the 44px min-height (`h-[44px]`; a table cell reads `height` as a minimum) and paints **no fill in any state** — the header is ghost, body rows own washes. It carries no padding, so the button inside can use the whole cell as its hit box.
|
|
38
|
+
- **Sort button** (`data-fods-part="sort"`) — a `<button type="button">` stretched over the whole cell (`h-full w-full`). It holds the inline padding `--space-500`, the block padding `--space-400`, the label↔glyph gap `--space-400`, radius `--radius-0`, and the **label ink**. On a non-sortable column the same layout is a plain `<div>` with no part marker.
|
|
39
|
+
- **Text stack** — vertical, gap 0:
|
|
40
|
+
- **Label** (`data-fods-part="label"`) — Body/S Semibold (`--font-size-sm`, `--font-weight-semibold`). It sets no colour of its own and inherits the button's ink. It stays on **one line** and ellipsises (`truncate`); while it is clipped, a Tooltip carries the full text.
|
|
41
|
+
- **Description** (`data-fods-part="description"`) — optional, Body/XXS Regular (`--font-size-xxs`, `--font-weight-normal`), `--text-secondary` in every state, one line with an ellipsis. Rendered only when `description` is passed — no reserved space otherwise.
|
|
42
|
+
- **Sort glyph** (`data-fods-part="icon"`) — 16px (`--size-icon-xsmall`), trailing after the stack in every alignment. `caret-up-down-small` when unsorted, `caret-up-small` / `caret-down-small` when sorted. Rendered only on a sortable column.
|
|
43
|
+
|
|
44
|
+
## Variants
|
|
45
|
+
|
|
46
|
+
<Canvas of={ColumnHeaderStories.Matrix} />
|
|
47
|
+
|
|
48
|
+
`Align` is a **layout** axis, not a colour axis — the ink matrix is identical in all three rows. State is the only thing that recolours (see States).
|
|
49
|
+
|
|
50
|
+
<table>
|
|
51
|
+
<thead>
|
|
52
|
+
<tr><th>Variant / option</th><th>Prop</th><th>When</th><th>Tokens</th></tr>
|
|
53
|
+
</thead>
|
|
54
|
+
<tbody>
|
|
55
|
+
<tr>
|
|
56
|
+
<td>Left (default)</td>
|
|
57
|
+
<td><code>align="left"</code></td>
|
|
58
|
+
<td>Text columns</td>
|
|
59
|
+
<td>Same ghost family as Right — no ink change</td>
|
|
60
|
+
</tr>
|
|
61
|
+
<tr>
|
|
62
|
+
<td>Center</td>
|
|
63
|
+
<td><code>align="center"</code></td>
|
|
64
|
+
<td>Only a presence / icon column whose body cells are centred (e.g. an attachment column). The label + glyph cluster centres in the cell and the label hugs; an overflow truncates at the cell width minus padding, gap and glyph — the manifest's <code>max-width: calc(100% − 48px)</code>, reached by the stack shrinking as a flex item</td>
|
|
65
|
+
<td>Same ghost family — no ink change</td>
|
|
66
|
+
</tr>
|
|
67
|
+
<tr>
|
|
68
|
+
<td>Right</td>
|
|
69
|
+
<td><code>align="right"</code></td>
|
|
70
|
+
<td>Numeric / money columns. The whole label + glyph cluster moves to the trailing edge, the text stack right-aligns, and the glyph stays <strong>trailing after the label</strong> (no mirrored left glyph)</td>
|
|
71
|
+
<td>Same ghost family as Left — no ink change</td>
|
|
72
|
+
</tr>
|
|
73
|
+
<tr>
|
|
74
|
+
<td>Show sort off</td>
|
|
75
|
+
<td><code>sortable=false</code></td>
|
|
76
|
+
<td>A column that never sorts (attachments, actions): a plain <code><th></code> with no button, no glyph and no reserved space</td>
|
|
77
|
+
<td>Label <code>--text-secondary</code>; no hover, no focus ring</td>
|
|
78
|
+
</tr>
|
|
79
|
+
<tr>
|
|
80
|
+
<td>Show description on</td>
|
|
81
|
+
<td><code>description</code></td>
|
|
82
|
+
<td>Only when the label alone is ambiguous</td>
|
|
83
|
+
<td><code>--text-secondary</code>, <code>--font-size-xxs</code>, <code>--font-weight-normal</code></td>
|
|
84
|
+
</tr>
|
|
85
|
+
</tbody>
|
|
86
|
+
</table>
|
|
87
|
+
|
|
88
|
+
The alignment law is owned by Table: text columns left, numeric / money columns right, a presence / icon column (Příloha) centred — **nothing else centres**. In a Table the header follows the column's `meta.align`, so a `center` column centres its body cells and its header together.
|
|
89
|
+
|
|
90
|
+
<Canvas of={ColumnHeaderStories.Center} />
|
|
91
|
+
|
|
92
|
+
<Canvas of={ColumnHeaderStories.WithDescription} />
|
|
93
|
+
|
|
94
|
+
<Canvas of={ColumnHeaderStories.NonSortable} />
|
|
95
|
+
|
|
96
|
+
## Sizes
|
|
97
|
+
|
|
98
|
+
No size axis — a table runs at one row density and its header matches it, so there is no `size` prop.
|
|
99
|
+
|
|
100
|
+
<table>
|
|
101
|
+
<thead>
|
|
102
|
+
<tr><th>Size</th><th style={{ textAlign: 'right' }}>Min-height</th><th>Tokens</th></tr>
|
|
103
|
+
</thead>
|
|
104
|
+
<tbody>
|
|
105
|
+
<tr>
|
|
106
|
+
<td><code>Base</code> (the only one)</td>
|
|
107
|
+
<td style={{ textAlign: 'right' }}>44px</td>
|
|
108
|
+
<td>padding-X <code>--space-500</code>, padding-Y <code>--space-400</code>, label↔glyph gap <code>--space-400</code>, label↔description gap 0, radius <code>--radius-0</code>, glyph 16px (<code>--size-icon-xsmall</code>), label Body/S</td>
|
|
109
|
+
</tr>
|
|
110
|
+
</tbody>
|
|
111
|
+
</table>
|
|
112
|
+
|
|
113
|
+
44px is a **min-height**: a single-line label is 8 + 22 + 8 = 38 and renders at 44 with the content centred; with a description the cell grows to what its text stack needs (Table: 56). The label never wraps, so a header row is 44, or 56 with a description — never taller (manifest 2.0.0). The resulting row height is the consuming organism's fact, not this atom's. `--space-500` (12px) matches the body-cell inline padding, so a left label shares an edge with its column data.
|
|
114
|
+
|
|
115
|
+
The 44px is not on the spacing-token grid, so it ships as an arbitrary `h-[44px]` on the cell under a `fods-lint` suppression (stories `knownIssues`).
|
|
116
|
+
|
|
117
|
+
<Canvas of={ColumnHeaderStories.LongLabel} />
|
|
118
|
+
|
|
119
|
+
## States
|
|
120
|
+
|
|
121
|
+
<Canvas of={ColumnHeaderStories.States} />
|
|
122
|
+
|
|
123
|
+
State is **not a prop** (manifest `properties.State.maps`: "driven by interaction + aria-sort"). Hover is the CSS `:hover` on the sort button; the sorted pair is derived from `aria-sort` on the cell.
|
|
124
|
+
|
|
125
|
+
<table>
|
|
126
|
+
<thead>
|
|
127
|
+
<tr><th>State</th><th>Driven by</th><th>Label</th><th>Glyph</th></tr>
|
|
128
|
+
</thead>
|
|
129
|
+
<tbody>
|
|
130
|
+
<tr>
|
|
131
|
+
<td>Default</td>
|
|
132
|
+
<td>no <code>aria-sort</code></td>
|
|
133
|
+
<td><code>--text-secondary</code></td>
|
|
134
|
+
<td><code>caret-up-down-small</code>, <code>--icon-muted</code></td>
|
|
135
|
+
</tr>
|
|
136
|
+
<tr>
|
|
137
|
+
<td>Hover</td>
|
|
138
|
+
<td><code>:hover</code> anywhere over the button</td>
|
|
139
|
+
<td><code>--text-primary</code></td>
|
|
140
|
+
<td><code>caret-up-down-small</code>, <code>--text-secondary</code></td>
|
|
141
|
+
</tr>
|
|
142
|
+
<tr>
|
|
143
|
+
<td>Sorted asc</td>
|
|
144
|
+
<td><code>aria-sort="ascending"</code></td>
|
|
145
|
+
<td><code>--text-primary</code></td>
|
|
146
|
+
<td><code>caret-up-small</code>, <code>--text-primary</code></td>
|
|
147
|
+
</tr>
|
|
148
|
+
<tr>
|
|
149
|
+
<td>Sorted desc</td>
|
|
150
|
+
<td><code>aria-sort="descending"</code></td>
|
|
151
|
+
<td><code>--text-primary</code></td>
|
|
152
|
+
<td><code>caret-down-small</code>, <code>--text-primary</code></td>
|
|
153
|
+
</tr>
|
|
154
|
+
<tr>
|
|
155
|
+
<td>Focus</td>
|
|
156
|
+
<td><code>:focus-visible</code> on the sort button</td>
|
|
157
|
+
<td colSpan={2}>Not a variant — additive offset ring <code>--outline-focus</code> at <code>--border-width-200</code>, 2px outside the button; never a border on the cell</td>
|
|
158
|
+
</tr>
|
|
159
|
+
</tbody>
|
|
160
|
+
</table>
|
|
161
|
+
|
|
162
|
+
- **Hover is ink-only** — the header never paints a `--bg-hover` wash; that belongs to body rows. A sorted column keeps its `--text-primary` glyph under hover.
|
|
163
|
+
- **The description** stays `--text-secondary` in every state; it never joins the label / glyph ladder.
|
|
164
|
+
- **Motion** (manifest 2.1.1 `motion.states`, ink only, `--easing-standard`). **Hover** — the label and glyph ink over `--duration-hover` (150ms). **Value** — entering Sorted asc / desc cross-fades the label and arrow ink to `--text-primary` over `--duration-toggle` (100ms); the arrow **glyph** (unsorted / up / down) swaps instantly — it is a sort direction, not an open / close caret, so it never rotates. The property list is `transition-[color]`, not `transition-colors`, so the focus ring is never eased. CSS limit: a transition takes its duration from the state it lands in, so a column **losing** its sort (another column took it) fades back on `--duration-hover`. Colour only, so there is no reduced-motion override.
|
|
165
|
+
- **No Disabled state.** The manifest has none, so the `disabled` prop (see [API](#api)) keeps the resting look (label, glyph, resting ink) and takes away only the pointer cursor and the hover step: the label and glyph do not change ink under the pointer. Whether the spec gets a Disabled state is a pending design decision.
|
|
166
|
+
- **Sort is bi-state** (asc ↔ desc). The component does not cycle anything: `onSort` only reports the activation, and the consumer decides the next `aria-sort`.
|
|
167
|
+
- In the States story, Hover and Focus are rendered with **bare twins** of the recipe classes (`src/storybook/forceStates.tsx`), not `parameters.pseudo`: Tailwind wraps `hover:` utilities in `@media (hover: hover)`, which the pseudo-states addon does not rewrite.
|
|
168
|
+
|
|
169
|
+
<Canvas of={ColumnHeaderStories.Disabled} />
|
|
170
|
+
|
|
171
|
+
## API
|
|
172
|
+
|
|
173
|
+
<Controls />
|
|
174
|
+
|
|
175
|
+
- `children` — the column label, a **string**, one line. The full text stays in the DOM, so a truncated label is still read in full, and while it is truncated the same text opens in a Tooltip.
|
|
176
|
+
- `aria-sort` — `'ascending' | 'descending'`, the **only** source of the sort state. Pass it on the active column; leave it off every other sortable column. It is dropped on a non-sortable column.
|
|
177
|
+
- `onSort` — fires on click / Enter / Space on the sort button, unless `disabled`.
|
|
178
|
+
- `disabled` — switches sorting off for now; Table passes it while `loading`. The manifest has no Disabled state, so the cell keeps its resting look: the label, the glyph, the resting ink, `aria-sort` and `data-sorted` stay. Only the pointer cursor goes (`cursor-default`) and the hover ink no longer steps (the recipe applies its hover classes only while not disabled). The sort button gets `aria-disabled="true"` instead of the native `disabled`, `onSort` is not called on click, Enter or Space, and the button keeps its tab stop. No effect on a `sortable={false}` cell.
|
|
179
|
+
- `align` — `'left' | 'center' | 'right'`; `center` only for a presence / icon column.
|
|
180
|
+
- `tooltip` — the full term for an abbreviated label, shown on every hover / focus. Without it the truncation fallback Tooltip still mounts, so **every** ColumnHeader needs a `TooltipProvider` ancestor (`FodsProvider` mounts one at the app root; Table brings its own).
|
|
181
|
+
- `scope` is not a prop: the cell always renders `scope="col"`. Every other `<th>` attribute, `className` and the forwarded `ref` land on the cell.
|
|
182
|
+
|
|
183
|
+
<Canvas of={ColumnHeaderStories.Abbreviated} />
|
|
184
|
+
|
|
185
|
+
## Do / Don't
|
|
186
|
+
|
|
187
|
+
- ✅ Keep labels to a short noun / noun phrase (`Číslo` · `Datum splatnosti` · `Celkem s DPH`), under ~24 characters
|
|
188
|
+
- ✅ Put a unit or basis into `description`, e.g. `(Celková cena)` — and only when the label alone is ambiguous
|
|
189
|
+
- ✅ Use `sortable=false` for genuinely non-sortable columns (attachments, actions)
|
|
190
|
+
- ✅ Right-align numeric / money headers over right-aligned values; centre only a presence / icon column (Příloha)
|
|
191
|
+
- ✅ Put `aria-sort` on exactly one column — the active one — and let it reflect the true current order
|
|
192
|
+
- ✅ Keep the label on one line; treat an ellipsis as a signal: widen the column, or abbreviate the label and pass the full term as `tooltip`
|
|
193
|
+
- ❌ Write sentences or units into the label
|
|
194
|
+
- ❌ Ship an empty or decorative description line
|
|
195
|
+
- ❌ Show a dead glyph on a column that never sorts
|
|
196
|
+
- ❌ Centre a text or numeric column
|
|
197
|
+
- ❌ Keep a separate "sorted" flag next to `aria-sort`, or default the indicator to a direction the data is not in
|
|
198
|
+
- ❌ Add a fill or a hover wash to the header cell
|
|
199
|
+
|
|
200
|
+
## Accessibility
|
|
201
|
+
|
|
202
|
+
- **Keyboard** — a sortable column's `<button type="button">` is a normal tab stop; Enter / Space activate it and call `onSort`. A non-sortable column renders no button and holds no focus. A **disabled** sortable column stays a tab stop, but click, Enter and Space do nothing: the button carries `aria-disabled="true"` and no click handler, not the native `disabled`. The reason: a user who just sorted is still focused on this header while the sorted page loads, and the native `disabled` would drop that focus to `<body>`. `aria-sort` stays on the cell, so the header still announces the sort it asked for. Nothing stays operable while disabled. The manifest does not ask for this kept tab stop, so it is a code decision awaiting the design answer.
|
|
203
|
+
- **ARIA** — the cell is always `<th scope="col">`. `aria-sort` sits on the `<th>` only while the column is sorted; an unsorted sortable column carries none, and a non-sortable column never carries it (the component drops it). The sort glyph is rendered by `Icon` with `aria-hidden="true"` — direction is announced through `aria-sort`, not the icon.
|
|
204
|
+
- **Screen reader** — the label and the description both live inside the sort button, so both are part of its accessible name. The label and description ellipses are CSS-only; the full strings stay in the DOM and are announced in full.
|
|
205
|
+
- **Tooltip** — an explicit `tooltip` opens on every hover / focus; without one, the label's own text opens only while the label is truncated (measured when the tooltip would open). On a sortable column the tooltip hangs off the sort button, so it opens on keyboard focus as well as on hover. On a **non-sortable** column the trigger is the label text, which is not focusable — the full term is reachable **by pointer only** there (stories `knownIssues`).
|
|
206
|
+
- **Focus** — additive offset ring on `:focus-visible`: `--outline-focus` at `--border-width-200`, 2px outside the button. Never a border on the cell.
|
|
207
|
+
- **Target size** — the button fills the cell (`h-full w-full`), so the hit area is the whole cell of at least 44px, not the 22px text line.
|
|
208
|
+
- **Contrast & motion** — sort state is carried by glyph shape plus `aria-sort`, not by colour alone. The only motion is an ink transition (`--duration-hover` / `--duration-toggle`, see [States](#states)); the focus ring is never transitioned.
|
|
209
|
+
|
|
210
|
+
Accessibility floor for every FODS component: `spec/01-foundations/accessibility.md`.
|
|
211
|
+
|
|
212
|
+
### Known limitations
|
|
213
|
+
|
|
214
|
+
- **Tooltip on a non-sortable column is hover-only** — see Accessibility above. That includes the truncation fallback of a non-sortable column (Příloha).
|
|
215
|
+
- **Provider required** — every ColumnHeader mounts a Tooltip, so it renders only under a `TooltipProvider`.
|
|
216
|
+
- **Off-grid 44px** — the min-height ships as an arbitrary `h-[44px]` under a `fods-lint` suppression.
|
|
217
|
+
|
|
218
|
+
## Copy
|
|
219
|
+
|
|
220
|
+
Voice: column labels are nouns, not instructions — impersonal, sentence case, no terminal period.
|
|
221
|
+
|
|
222
|
+
- **Label** (`children`) — a short noun / noun phrase naming the column's content. One line, max 24 characters; it never wraps, because the Table header is never taller than 56. When it does not fit, abbreviate the label or widen the column when the header is written. An abbreviated label carries the full term in `tooltip` — an abbreviation the reader cannot expand is worse than a long header. If it still overflows at runtime (a longer market), it truncates with an ellipsis and the Tooltip shows the full text. The ellipsis is a signal, never a resting state.
|
|
223
|
+
- **Description** (`description`) — an optional parenthetical clarifier of unit or basis under the label. One line, max 24 characters; it never wraps and truncates with an ellipsis. Only when the label alone is ambiguous; it never repeats the label and is never a sentence. Otherwise omit it — never an empty line.
|
|
224
|
+
|
|
225
|
+
<table>
|
|
226
|
+
<thead>
|
|
227
|
+
<tr><th>Run</th><th>Examples</th></tr>
|
|
228
|
+
</thead>
|
|
229
|
+
<tbody>
|
|
230
|
+
<tr><td>Label</td><td><code>Číslo</code> · <code>Dodavatel</code> · <code>Datum splatnosti</code> · <code>Celkem s DPH</code> · <code>Stav</code></td></tr>
|
|
231
|
+
<tr><td>Description</td><td><code>(Celková cena)</code> · <code>(bez DPH)</code></td></tr>
|
|
232
|
+
<tr><td>Abbreviated label + <code>tooltip</code></td><td><code>DUZP</code> → <code>Datum uskutečnění zdanitelného plnění</code></td></tr>
|
|
233
|
+
</tbody>
|
|
234
|
+
</table>
|
|
235
|
+
|
|
236
|
+
## Usage
|
|
237
|
+
|
|
238
|
+
<Canvas of={ColumnHeaderStories.Playground} />
|
|
239
|
+
|
|
240
|
+
```tsx
|
|
241
|
+
// Good — the consumer owns the sort state and puts aria-sort on the active column only.
|
|
242
|
+
const [sort, setSort] = useState<{ key: 'number' | 'total'; dir: ColumnHeaderSort }>(
|
|
243
|
+
{ key: 'number', dir: 'descending' },
|
|
244
|
+
);
|
|
245
|
+
const toggle = (key: 'number' | 'total') =>
|
|
246
|
+
setSort(prev =>
|
|
247
|
+
prev.key === key
|
|
248
|
+
? { key, dir: prev.dir === 'ascending' ? 'descending' : 'ascending' }
|
|
249
|
+
: { key, dir: 'ascending' },
|
|
250
|
+
);
|
|
251
|
+
const ariaSort = (key: 'number' | 'total') => (sort.key === key ? sort.dir : undefined);
|
|
252
|
+
|
|
253
|
+
<thead>
|
|
254
|
+
<tr>
|
|
255
|
+
<ColumnHeader aria-sort={ariaSort('number')} onSort={() => toggle('number')}>
|
|
256
|
+
Číslo
|
|
257
|
+
</ColumnHeader>
|
|
258
|
+
<ColumnHeader sortable={false}>Odběratel</ColumnHeader>
|
|
259
|
+
<ColumnHeader
|
|
260
|
+
align="right"
|
|
261
|
+
description="(Celková cena)"
|
|
262
|
+
aria-sort={ariaSort('total')}
|
|
263
|
+
onSort={() => toggle('total')}
|
|
264
|
+
>
|
|
265
|
+
Celkem s DPH
|
|
266
|
+
</ColumnHeader>
|
|
267
|
+
</tr>
|
|
268
|
+
</thead>
|
|
269
|
+
|
|
270
|
+
// Good — an abbreviated label carries the full term (needs a TooltipProvider ancestor).
|
|
271
|
+
<ColumnHeader tooltip="Datum uskutečnění zdanitelného plnění">DUZP</ColumnHeader>
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
```tsx
|
|
275
|
+
// Don't — a ColumnHeader outside a table row; a <th> is only valid inside a <tr>.
|
|
276
|
+
<div><ColumnHeader>Číslo</ColumnHeader></div>
|
|
277
|
+
|
|
278
|
+
// Don't — aria-sort on every sortable column; an unsorted column carries none.
|
|
279
|
+
<ColumnHeader aria-sort="ascending">Číslo</ColumnHeader>
|
|
280
|
+
<ColumnHeader aria-sort="ascending">Celkem s DPH</ColumnHeader>
|
|
281
|
+
|
|
282
|
+
// Don't — a unit stuffed into the label instead of the description.
|
|
283
|
+
<ColumnHeader align="right">Celkem s DPH (Celková cena v Kč)</ColumnHeader>
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## Related
|
|
287
|
+
|
|
288
|
+
- [`Table`](?path=/docs/design-system-organisms-table--docs) — the consumer of this atom; it owns column widths, the alignment law and the header↔body padding match. Spec: `spec/05-organisms/table.md`.
|
|
289
|
+
- [`Pagination`](?path=/docs/design-system-molecules-pagination--docs) — the other table-family piece.
|
|
290
|
+
- [`Tooltip`](?path=/docs/design-system-atoms-tooltip--docs) — the full term behind an abbreviated label.
|
|
291
|
+
- Spec: `spec/03-atoms/column-header.md`.
|
|
292
|
+
|
|
293
|
+
## Migration notes
|
|
294
|
+
|
|
295
|
+
What a consumer has to know:
|
|
296
|
+
|
|
297
|
+
- There is **no `sorted` prop.** The sort state is the `aria-sort` attribute on the cell (`'ascending' | 'descending'`, or absent), and the glyph and ink follow from it.
|
|
298
|
+
- The asc ↔ desc cycle lives in the consumer; `onSort` only reports the activation.
|
|
299
|
+
- A non-sortable column is `sortable=false`, not a hidden glyph.
|
|
300
|
+
|
|
301
|
+
**Manifest 2.0.0 → 2.1.1 (2026-11-03).** 2.1.0 carries no design change. 2.1.1 (motion audit) adds `motion.states.hover` / `value`: the untokenised `transition-colors duration-150` on the button became `transition-[color]` on `--duration-hover` (Sorted: `--duration-toggle`) with `--easing-standard`, and the glyph got the same ink transition — see [States](#states) → Motion. No API change.
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Decorator, Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
import { expect, fn, userEvent, within } from 'storybook/test';
|
|
4
|
+
import { ColumnHeader, type ColumnHeaderProps } from './ColumnHeader';
|
|
5
|
+
import { TooltipProvider } from '../tooltip/Tooltip';
|
|
6
|
+
import { Section, Showcase } from '../../storybook/Section';
|
|
7
|
+
import { componentDoc } from '../../storybook/componentDoc';
|
|
8
|
+
import { COLUMN_HEADER_FORCE_HOVER, COLUMN_HEADER_FORCE_RING } from '../../storybook/forceStates';
|
|
9
|
+
|
|
10
|
+
// Built against `column-header` manifest 2.1.1.
|
|
11
|
+
/** `axes.variant` (Left · Center · Right) — exposed as the `align` prop, layout only. */
|
|
12
|
+
const VARIANTS = ['left', 'center', 'right'] as const;
|
|
13
|
+
/**
|
|
14
|
+
* `axes.state` (Default · Hover · Sorted asc · Sorted desc). Not a prop: Hover is
|
|
15
|
+
* the CSS `:hover` (forced statically below), the sorted pair is driven by
|
|
16
|
+
* `aria-sort` on the cell.
|
|
17
|
+
*/
|
|
18
|
+
const STATES = ['default', 'hover', 'sorted-asc', 'sorted-desc'] as const;
|
|
19
|
+
type State = (typeof STATES)[number];
|
|
20
|
+
|
|
21
|
+
const STATE_LABEL: Record<State, string> = {
|
|
22
|
+
default: 'Default',
|
|
23
|
+
hover: 'Hover',
|
|
24
|
+
'sorted-asc': 'Sorted asc',
|
|
25
|
+
'sorted-desc': 'Sorted desc',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const stateProps = (state: State): Partial<ColumnHeaderProps> => {
|
|
29
|
+
if (state === 'sorted-asc') return { 'aria-sort': 'ascending' };
|
|
30
|
+
if (state === 'sorted-desc') return { 'aria-sort': 'descending' };
|
|
31
|
+
return {};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Hover is forced with the bare twin of the recipe's own classes — `parameters.pseudo`
|
|
36
|
+
* cannot reach `hover:` utilities that Tailwind v4 wraps in `@media (hover: hover)`.
|
|
37
|
+
*/
|
|
38
|
+
const stateClass = (state: State) => (state === 'hover' ? COLUMN_HEADER_FORCE_HOVER : undefined);
|
|
39
|
+
|
|
40
|
+
/** A `<th>` is only valid inside a table row, so every grid renders its own table. */
|
|
41
|
+
const HeaderRow = ({ children }: { children: ReactNode }) => (
|
|
42
|
+
<table className="table-fixed border-collapse">
|
|
43
|
+
<thead>
|
|
44
|
+
<tr>{children}</tr>
|
|
45
|
+
</thead>
|
|
46
|
+
</table>
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// Storybook demo cell widths; `narrow` forces the LongLabel two-line clamp.
|
|
50
|
+
// fods-lint-disable-next-line Storybook demo column widths, dev-only chrome, not a runtime token
|
|
51
|
+
const CELL_WIDTH = { default: 'w-[240px]', matrix: 'w-[180px]', states: 'w-[200px]', narrow: 'w-[140px]' };
|
|
52
|
+
// fods-lint-disable-next-line off-grid story fixture: the attachment-presence column width of the Table manifest's expense grid (76)
|
|
53
|
+
const PRESENCE_CELL_WIDTH = 'w-[76px]';
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Wraps single-cell stories in `<table><thead><tr>`. Grid stories that render their
|
|
57
|
+
* own tables opt out with `parameters.ownTable`; `parameters.cellWidth` narrows the
|
|
58
|
+
* column (LongLabel needs a narrow one to show the one-line ellipsis).
|
|
59
|
+
*/
|
|
60
|
+
const withTableRow: Decorator = (Story, context) => {
|
|
61
|
+
if (context.parameters.ownTable) return <Story />;
|
|
62
|
+
const width = (context.parameters.cellWidth as string | undefined) ?? CELL_WIDTH.default;
|
|
63
|
+
return (
|
|
64
|
+
<table className={`table-fixed border-collapse ${width}`}>
|
|
65
|
+
<thead>
|
|
66
|
+
<tr>
|
|
67
|
+
<Story />
|
|
68
|
+
</tr>
|
|
69
|
+
</thead>
|
|
70
|
+
</table>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// The tooltip on an abbreviated label is a Radix Tooltip and throws without a
|
|
75
|
+
// provider ancestor. A consumer mounts one at the app root through FodsProvider.
|
|
76
|
+
const withTooltipProvider: Decorator = Story => (
|
|
77
|
+
<TooltipProvider>
|
|
78
|
+
<Story />
|
|
79
|
+
</TooltipProvider>
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const meta = {
|
|
83
|
+
title: 'Design System/Atoms/ColumnHeader',
|
|
84
|
+
component: ColumnHeader,
|
|
85
|
+
decorators: [withTableRow, withTooltipProvider],
|
|
86
|
+
parameters: {
|
|
87
|
+
layout: 'centered',
|
|
88
|
+
actions: { argTypesRegex: '^onSort$' },
|
|
89
|
+
docs: {
|
|
90
|
+
description: {
|
|
91
|
+
component: componentDoc({
|
|
92
|
+
summary:
|
|
93
|
+
'The header cell that tops every table column — a label, an optional one-line description and a state-driven sort glyph (ui-system manifest 2.1.1). Renders `<th scope="col">`; a sortable column puts a real `<button>` across the whole cell (min-height 44).',
|
|
94
|
+
useCases: [
|
|
95
|
+
'`align="left"` — text columns; `align="right"` — numeric / money columns; `align="center"` — only a presence / icon column such as Příloha (layout only, the ink never changes)',
|
|
96
|
+
'`sortable={false}` — a column that never sorts (attachments, actions): a plain `<th>`, no glyph, no reserved space',
|
|
97
|
+
'`description` — a parenthetical clarifier under an ambiguous label, e.g. `(Celková cena)`',
|
|
98
|
+
'`tooltip` — the full term behind an abbreviated label (`DUZP`)',
|
|
99
|
+
],
|
|
100
|
+
bestPractices: [
|
|
101
|
+
'Drive the sort state through `aria-sort` on the active column only; an unsorted sortable column carries no `aria-sort`',
|
|
102
|
+
'The cycle is bi-state (asc ↔ desc) and lives in the consumer — `onSort` only reports the activation',
|
|
103
|
+
'Keep labels short and on one line; an ellipsis is a signal to widen the column or abbreviate (with a `tooltip`)',
|
|
104
|
+
'Text left, numbers right, and only a presence / icon column centres',
|
|
105
|
+
],
|
|
106
|
+
knownIssues: [
|
|
107
|
+
'The row min-height of 44 is not on the `--space` grid; it ships as an arbitrary height on the cell (a table cell reads `height` as a minimum)',
|
|
108
|
+
'On a non-sortable column the tooltip trigger is the label text, which is not focusable — the full term is reachable by pointer only there',
|
|
109
|
+
'Every ColumnHeader now mounts a Tooltip (the truncation fallback), so it needs a `TooltipProvider` ancestor even without `tooltip` — Table brings its own',
|
|
110
|
+
],
|
|
111
|
+
}),
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
} satisfies Meta<typeof ColumnHeader>;
|
|
116
|
+
|
|
117
|
+
export default meta;
|
|
118
|
+
type Story = StoryObj<typeof meta>;
|
|
119
|
+
|
|
120
|
+
export const Playground: Story = {
|
|
121
|
+
args: {
|
|
122
|
+
children: 'Datum splatnosti',
|
|
123
|
+
align: 'left',
|
|
124
|
+
sortable: true,
|
|
125
|
+
'aria-sort': undefined,
|
|
126
|
+
disabled: false,
|
|
127
|
+
description: undefined,
|
|
128
|
+
},
|
|
129
|
+
argTypes: {
|
|
130
|
+
align: { control: 'inline-radio', options: VARIANTS },
|
|
131
|
+
sortable: { control: 'boolean' },
|
|
132
|
+
disabled: { control: 'boolean' },
|
|
133
|
+
'aria-sort': { control: 'select', options: [undefined, 'ascending', 'descending'] },
|
|
134
|
+
description: { control: 'text' },
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export const Matrix: Story = {
|
|
139
|
+
args: { children: 'Celkem s DPH' },
|
|
140
|
+
parameters: {
|
|
141
|
+
ownTable: true,
|
|
142
|
+
docs: {
|
|
143
|
+
description: {
|
|
144
|
+
story:
|
|
145
|
+
'Align × State, mirroring the Figma set (manifest 2.0.0). Default = `--text-secondary` label + muted `caret-up-down-small` (`--icon-muted`); Hover = ink only (`--text-primary` label, `--text-secondary` glyph), no wash; Sorted asc / desc = a single directional caret, label and glyph `--text-primary`. Align is layout only — the ink matrix is identical in all three rows; Center hugs the label and centres the cluster. Hover is forced statically.',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
render: () => (
|
|
150
|
+
<Showcase>
|
|
151
|
+
{VARIANTS.map(align => (
|
|
152
|
+
<Section key={align} title={`align=${align}`}>
|
|
153
|
+
<HeaderRow>
|
|
154
|
+
{STATES.map(state => (
|
|
155
|
+
<ColumnHeader
|
|
156
|
+
key={state}
|
|
157
|
+
align={align}
|
|
158
|
+
className={`${CELL_WIDTH.matrix} ${stateClass(state) ?? ''}`}
|
|
159
|
+
{...stateProps(state)}
|
|
160
|
+
>
|
|
161
|
+
{STATE_LABEL[state]}
|
|
162
|
+
</ColumnHeader>
|
|
163
|
+
))}
|
|
164
|
+
</HeaderRow>
|
|
165
|
+
</Section>
|
|
166
|
+
))}
|
|
167
|
+
</Showcase>
|
|
168
|
+
),
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const STATE_ROWS = [
|
|
172
|
+
{ key: 'default', label: 'Default', force: undefined, props: {} },
|
|
173
|
+
{ key: 'hover', label: 'Hover', force: COLUMN_HEADER_FORCE_HOVER, props: {} },
|
|
174
|
+
{ key: 'focus', label: 'Focus', force: COLUMN_HEADER_FORCE_RING, props: {} },
|
|
175
|
+
{ key: 'sorted-asc', label: 'Sorted asc', force: undefined, props: stateProps('sorted-asc') },
|
|
176
|
+
{ key: 'sorted-desc', label: 'Sorted desc', force: undefined, props: stateProps('sorted-desc') },
|
|
177
|
+
] as const;
|
|
178
|
+
|
|
179
|
+
export const States: Story = {
|
|
180
|
+
args: { children: 'Číslo' },
|
|
181
|
+
parameters: {
|
|
182
|
+
ownTable: true,
|
|
183
|
+
docs: {
|
|
184
|
+
description: {
|
|
185
|
+
story:
|
|
186
|
+
'Every state rendered statically, with and without a description. Hover and Focus are forced with bare twins of the recipe classes (`src/storybook/forceStates.tsx`); the description stays `--text-secondary` in every row. Focus is not a variant — it is the cross-cutting additive `--outline-focus` ring at `--border-width-200`, offset outside the sort button, never a border on the cell.',
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
render: () => (
|
|
191
|
+
<Showcase>
|
|
192
|
+
{STATE_ROWS.map(row => (
|
|
193
|
+
<Section key={row.key} title={row.label}>
|
|
194
|
+
<HeaderRow>
|
|
195
|
+
<ColumnHeader className={`${CELL_WIDTH.states} ${row.force ?? ''}`} {...row.props}>
|
|
196
|
+
Číslo
|
|
197
|
+
</ColumnHeader>
|
|
198
|
+
<ColumnHeader
|
|
199
|
+
align="right"
|
|
200
|
+
description="(Celková cena)"
|
|
201
|
+
className={`${CELL_WIDTH.states} ${row.force ?? ''}`}
|
|
202
|
+
{...row.props}
|
|
203
|
+
>
|
|
204
|
+
Celkem s DPH
|
|
205
|
+
</ColumnHeader>
|
|
206
|
+
</HeaderRow>
|
|
207
|
+
</Section>
|
|
208
|
+
))}
|
|
209
|
+
</Showcase>
|
|
210
|
+
),
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export const WithDescription: Story = {
|
|
214
|
+
args: {
|
|
215
|
+
children: 'Celkem s DPH',
|
|
216
|
+
description: '(Celková cena)',
|
|
217
|
+
align: 'right',
|
|
218
|
+
},
|
|
219
|
+
parameters: {
|
|
220
|
+
docs: {
|
|
221
|
+
description: {
|
|
222
|
+
story:
|
|
223
|
+
'The optional secondary line — Body/XXS Regular, `--text-secondary` in every state, one line with an ellipsis, no gap to the label. Use it only when the label alone is ambiguous.',
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export const NonSortable: Story = {
|
|
230
|
+
args: {
|
|
231
|
+
children: 'Přílohy',
|
|
232
|
+
sortable: false,
|
|
233
|
+
},
|
|
234
|
+
parameters: {
|
|
235
|
+
docs: {
|
|
236
|
+
description: {
|
|
237
|
+
story:
|
|
238
|
+
'`sortable={false}` — a plain `<th>` with no button, no glyph and no reserved space. It holds no focus and shows no ring.',
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export const Center: Story = {
|
|
245
|
+
args: {
|
|
246
|
+
children: 'Příloha',
|
|
247
|
+
align: 'center',
|
|
248
|
+
sortable: false,
|
|
249
|
+
},
|
|
250
|
+
parameters: {
|
|
251
|
+
cellWidth: PRESENCE_CELL_WIDTH,
|
|
252
|
+
docs: {
|
|
253
|
+
description: {
|
|
254
|
+
story:
|
|
255
|
+
'`align="center"` — only for a presence / icon column whose body cells are centred (an attachment presence column, at the width that column really has). The label hugs and centres; an overflow still truncates, at the cell width minus padding (and glyph, when sortable).',
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export const LongLabel: Story = {
|
|
262
|
+
args: {
|
|
263
|
+
children: 'Datum uskutečnění zdanitelného plnění',
|
|
264
|
+
},
|
|
265
|
+
parameters: {
|
|
266
|
+
cellWidth: CELL_WIDTH.narrow,
|
|
267
|
+
docs: {
|
|
268
|
+
description: {
|
|
269
|
+
story:
|
|
270
|
+
'The label stays on one line and ellipsises. While it is clipped, hover or keyboard focus opens a Tooltip with the full text (the runtime fallback). The ellipsis is a signal — widen the column or abbreviate the label. The cut is CSS-only: the accessible name of the sort button is still the full text.',
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
export const Abbreviated: Story = {
|
|
277
|
+
args: {
|
|
278
|
+
children: 'DUZP',
|
|
279
|
+
tooltip: 'Datum uskutečnění zdanitelného plnění',
|
|
280
|
+
},
|
|
281
|
+
parameters: {
|
|
282
|
+
docs: {
|
|
283
|
+
description: {
|
|
284
|
+
story:
|
|
285
|
+
'An abbreviated label carries a Tooltip with the full term. On a sortable column the tooltip hangs off the sort button, so it opens on keyboard focus as well as on hover.',
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
export const Disabled: Story = {
|
|
292
|
+
args: {
|
|
293
|
+
children: 'Datum splatnosti',
|
|
294
|
+
'aria-sort': 'descending',
|
|
295
|
+
disabled: true,
|
|
296
|
+
onSort: fn(),
|
|
297
|
+
},
|
|
298
|
+
parameters: {
|
|
299
|
+
docs: {
|
|
300
|
+
description: {
|
|
301
|
+
story:
|
|
302
|
+
'`disabled` — Table passes it while `loading`. Manifest 2.1.1 has no Disabled state, so the cell keeps its resting look (here Sorted desc) and only the pointer cursor and the hover ink go; the design answer is pending. The sort button keeps its tab stop and `aria-sort`, carries `aria-disabled="true"`, and click, Enter and Space do not call `onSort`.',
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
play: async ({ canvasElement, args }) => {
|
|
307
|
+
const canvas = within(canvasElement);
|
|
308
|
+
const button = canvas.getByRole('button', { name: 'Datum splatnosti' });
|
|
309
|
+
await userEvent.tab();
|
|
310
|
+
await expect(button).toHaveFocus();
|
|
311
|
+
await expect(button).toHaveAttribute('aria-disabled', 'true');
|
|
312
|
+
await expect(canvas.getByRole('columnheader')).toHaveAttribute('aria-sort', 'descending');
|
|
313
|
+
await userEvent.keyboard('{Enter}');
|
|
314
|
+
await userEvent.keyboard(' ');
|
|
315
|
+
await userEvent.click(button);
|
|
316
|
+
await expect(args.onSort).not.toHaveBeenCalled();
|
|
317
|
+
await expect(button).toHaveFocus();
|
|
318
|
+
},
|
|
319
|
+
};
|