@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,263 @@
|
|
|
1
|
+
import { tv } from '../tailwind-variants';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Recipes of the Table organism (`table.manifest.json` 2.0.0). The token each
|
|
5
|
+
* class carries is listed in the header of `Table.tsx`.
|
|
6
|
+
*
|
|
7
|
+
* Padding model (manifest `chrome.row` / `chrome.column-budget`): a row has an
|
|
8
|
+
* outer inset of `--space-500` on both sides and a `--space-100` gap between
|
|
9
|
+
* cells, and each data cell carries its own `--space-500` left padding. A `<tr>`
|
|
10
|
+
* can hold neither a padding nor a gap, so both are folded into the cells: the
|
|
11
|
+
* first cell takes the leading inset, every other cell the gap, the last cell the
|
|
12
|
+
* trailing inset. `Table.tsx` widens each `<col>` by exactly the same amounts,
|
|
13
|
+
* so the grid still closes on the manifest budget.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** Organism frame — root, scroll frame, `<table>`, caption, footer. */
|
|
17
|
+
export const tableVariants = tv({
|
|
18
|
+
slots: {
|
|
19
|
+
root: 'group/table relative flex w-full min-w-0 flex-col rounded-0 bg-background-primary font-inter',
|
|
20
|
+
table: [
|
|
21
|
+
// `separate` + zero spacing, not `collapse`: a collapsed border belongs to the
|
|
22
|
+
// grid, not to the cell, and scrolls away from a sticky pinned cell.
|
|
23
|
+
'w-full table-fixed border-separate border-spacing-0',
|
|
24
|
+
'text-body-sm font-normal text-text-primary',
|
|
25
|
+
],
|
|
26
|
+
caption: '',
|
|
27
|
+
headerRow: '',
|
|
28
|
+
// Hover = `--bg-hover` over the FULL row bounds (`chrome.row.hover-fill`); a
|
|
29
|
+
// selected row has no fill (`selected-fill: null`). The wash fades on
|
|
30
|
+
// `--duration-hover` / `--easing-standard` (`motion.states.hover`, 1.40.1).
|
|
31
|
+
row: 'group/row transition-[background-color] duration-hover ease-standard hover:bg-background-hover',
|
|
32
|
+
// A loading placeholder row is not a record — no hover affordance.
|
|
33
|
+
skeletonRow: '',
|
|
34
|
+
// When Pagination and the page-size pair do not fit on one line, the pair wraps
|
|
35
|
+
// below as one unit, right-aligned by `ml-auto`; Pagination never shrinks, so its
|
|
36
|
+
// own run stays one row.
|
|
37
|
+
footer: 'flex w-full flex-wrap items-center gap-500 px-500 pt-600 pb-500',
|
|
38
|
+
footerPagination: 'shrink-0',
|
|
39
|
+
footerSpacer: 'flex-1',
|
|
40
|
+
footerPageSize: 'ml-auto flex shrink-0 items-center gap-500',
|
|
41
|
+
footerLabel: 'shrink-0 text-body-sm text-text-secondary',
|
|
42
|
+
// FIXED 88 = `--space-1300` + `--space-400` (`slots.footer-page-size`): at 80 the widest
|
|
43
|
+
// option, 100, truncated to "1…".
|
|
44
|
+
pageSize: 'w-[calc(var(--space-1300)+var(--space-400))] shrink-0',
|
|
45
|
+
},
|
|
46
|
+
variants: {
|
|
47
|
+
captionHidden: {
|
|
48
|
+
true: { caption: 'sr-only' },
|
|
49
|
+
false: { caption: 'pb-400 text-left text-body-sm font-semibold text-text-primary' },
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* The consumer passed `onRowClick`: the whole row is a pointer target (`intent.rules`).
|
|
53
|
+
* The pointer cursor only — the hover wash is the same either way.
|
|
54
|
+
*/
|
|
55
|
+
clickable: {
|
|
56
|
+
true: { row: 'cursor-pointer' },
|
|
57
|
+
false: {},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
defaultVariants: {
|
|
61
|
+
captionHidden: true,
|
|
62
|
+
clickable: false,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Body cell — and the chrome header cells (select-all, column settings), which
|
|
68
|
+
* share the body padding because the header has no Column Header in them.
|
|
69
|
+
*/
|
|
70
|
+
export const tableCellVariants = tv({
|
|
71
|
+
base: [
|
|
72
|
+
'relative p-0 align-middle',
|
|
73
|
+
// A table cell treats `height` as a minimum — the 44 floor of every row.
|
|
74
|
+
// fods-lint-disable-next-line off-grid 44px row min-height (manifest chrome.row.min-height); not on the --space grid
|
|
75
|
+
'h-[44px]',
|
|
76
|
+
],
|
|
77
|
+
variants: {
|
|
78
|
+
align: {
|
|
79
|
+
left: 'text-left',
|
|
80
|
+
right: 'text-right',
|
|
81
|
+
center: 'text-center',
|
|
82
|
+
},
|
|
83
|
+
/** First / middle / last cell of the row — folds the row inset and gap in (file header). */
|
|
84
|
+
position: {
|
|
85
|
+
first: '',
|
|
86
|
+
middle: '',
|
|
87
|
+
last: '',
|
|
88
|
+
only: '',
|
|
89
|
+
},
|
|
90
|
+
divider: {
|
|
91
|
+
true: 'border-b-100 border-b-outline-default',
|
|
92
|
+
false: '',
|
|
93
|
+
},
|
|
94
|
+
pin: {
|
|
95
|
+
none: '',
|
|
96
|
+
// Pinned zones paint the table surface and keep the row hover over it: the
|
|
97
|
+
// wash is translucent, so it is laid as an image over the opaque fill.
|
|
98
|
+
start: [
|
|
99
|
+
'sticky z-[calc(var(--z-index-base)+10)] bg-background-primary',
|
|
100
|
+
'group-hover/row:bg-[image:linear-gradient(var(--bg-hover),var(--bg-hover))]',
|
|
101
|
+
],
|
|
102
|
+
end: [
|
|
103
|
+
'sticky right-0 z-[calc(var(--z-index-base)+10)] bg-background-primary',
|
|
104
|
+
'group-hover/row:bg-[image:linear-gradient(var(--bg-hover),var(--bg-hover))]',
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
/**
|
|
108
|
+
* The zone's own rule (`chrome.horizontal-scroll.pinned-leading/-trailing`): a CSS
|
|
109
|
+
* border on the zone's scrolling-side edge, shown while content passes under the
|
|
110
|
+
* zone (`edge-visibility`). Always present at 1px so turning it on never shifts the grid.
|
|
111
|
+
*/
|
|
112
|
+
zoneEdge: {
|
|
113
|
+
none: '',
|
|
114
|
+
start: 'border-r-100 border-r-transparent',
|
|
115
|
+
end: 'border-l-100 border-l-transparent',
|
|
116
|
+
},
|
|
117
|
+
zoneActive: {
|
|
118
|
+
true: '',
|
|
119
|
+
false: '',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
compoundVariants: [
|
|
123
|
+
// Leading padding: inset + own padding on the first cell, gap + own padding on the rest.
|
|
124
|
+
{ position: ['first', 'only'], align: ['left', 'right'], class: 'pl-800' },
|
|
125
|
+
{ position: ['first', 'only'], align: 'center', class: 'pl-500' },
|
|
126
|
+
{ position: ['middle', 'last'], align: ['left', 'right'], class: 'pl-[calc(var(--space-100)+var(--space-500))]' },
|
|
127
|
+
{ position: ['middle', 'last'], align: 'center', class: 'pl-100' },
|
|
128
|
+
// Trailing padding: left/center cells have none of their own, right cells `--space-500`;
|
|
129
|
+
// the last cell adds the trailing inset.
|
|
130
|
+
{ position: ['first', 'middle'], align: 'right', class: 'pr-500' },
|
|
131
|
+
{ position: ['last', 'only'], align: ['left', 'center'], class: 'pr-500' },
|
|
132
|
+
{ position: ['last', 'only'], align: 'right', class: 'pr-800' },
|
|
133
|
+
{ zoneEdge: 'start', zoneActive: true, class: 'border-r-outline-default' },
|
|
134
|
+
{ zoneEdge: 'end', zoneActive: true, class: 'border-l-outline-default' },
|
|
135
|
+
],
|
|
136
|
+
defaultVariants: {
|
|
137
|
+
align: 'left',
|
|
138
|
+
position: 'middle',
|
|
139
|
+
divider: true,
|
|
140
|
+
pin: 'none',
|
|
141
|
+
zoneEdge: 'none',
|
|
142
|
+
zoneActive: false,
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Header cell hosting a Column Header. The atom owns its own `--space-500` inline
|
|
148
|
+
* padding, so the host only adds the row inset / gap — and the header hairline.
|
|
149
|
+
* The header never takes the row hover, so a pinned header cell is a plain fill.
|
|
150
|
+
*/
|
|
151
|
+
export const tableHeaderCellVariants = tv({
|
|
152
|
+
base: 'border-b-100 border-b-outline-default',
|
|
153
|
+
variants: {
|
|
154
|
+
position: {
|
|
155
|
+
first: 'pl-500',
|
|
156
|
+
middle: 'pl-100',
|
|
157
|
+
last: 'pl-100 pr-500',
|
|
158
|
+
only: 'px-500',
|
|
159
|
+
},
|
|
160
|
+
pin: {
|
|
161
|
+
none: '',
|
|
162
|
+
start: 'sticky z-[calc(var(--z-index-base)+10)] bg-background-primary',
|
|
163
|
+
end: 'sticky right-0 z-[calc(var(--z-index-base)+10)] bg-background-primary',
|
|
164
|
+
},
|
|
165
|
+
zoneEdge: {
|
|
166
|
+
none: '',
|
|
167
|
+
start: 'border-r-100 border-r-transparent',
|
|
168
|
+
end: 'border-l-100 border-l-transparent',
|
|
169
|
+
},
|
|
170
|
+
zoneActive: {
|
|
171
|
+
true: '',
|
|
172
|
+
false: '',
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
compoundVariants: [
|
|
176
|
+
{ zoneEdge: 'start', zoneActive: true, class: 'border-r-outline-default' },
|
|
177
|
+
{ zoneEdge: 'end', zoneActive: true, class: 'border-l-outline-default' },
|
|
178
|
+
],
|
|
179
|
+
defaultVariants: {
|
|
180
|
+
position: 'middle',
|
|
181
|
+
pin: 'none',
|
|
182
|
+
zoneEdge: 'none',
|
|
183
|
+
zoneActive: false,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
/** Content wrappers inside a body cell. */
|
|
188
|
+
export const tableCellContentVariants = tv({
|
|
189
|
+
slots: {
|
|
190
|
+
// `--space-100` would be the Figma gap; the select box is centred in its 40 track.
|
|
191
|
+
select: 'flex items-center justify-center',
|
|
192
|
+
// Row actions: Icon Buttons XS laid out FLUSH (`slots.row-actions`: itemSpacing 0).
|
|
193
|
+
actions: 'flex items-center justify-end',
|
|
194
|
+
settings: 'flex items-center justify-end',
|
|
195
|
+
// Identity cell: on a child row the 24px connector slot, then the value.
|
|
196
|
+
identity: 'flex min-w-0 items-center gap-200',
|
|
197
|
+
connectorSlot: 'flex w-800 shrink-0 items-center self-stretch',
|
|
198
|
+
value: 'min-w-0',
|
|
199
|
+
// Flexible columns are the only truncating cells (`text.flex-cell`).
|
|
200
|
+
truncate: 'block min-w-0 truncate',
|
|
201
|
+
// `chrome.empty-cell`: an em dash in `--text-placeholder`.
|
|
202
|
+
emptyValue: 'text-text-placeholder',
|
|
203
|
+
// `chrome.loading.cell`: Skeleton Text 12 tall (the atom's own default is 16); the width
|
|
204
|
+
// comes from `meta.skeletonWidth`, else 60 % — a bar filling the cell reads as a field.
|
|
205
|
+
skeleton: 'h-500 w-3/5 max-w-full',
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
/** 4px `--status-{f}-solid` strip at the row's true left edge (`chrome.status-edge`). */
|
|
210
|
+
export const tableStatusEdgeVariants = tv({
|
|
211
|
+
base: 'pointer-events-none absolute inset-y-0 left-0 w-200',
|
|
212
|
+
variants: {
|
|
213
|
+
emotion: {
|
|
214
|
+
danger: 'bg-status-danger-solid',
|
|
215
|
+
warning: 'bg-status-warning-solid',
|
|
216
|
+
success: 'bg-status-success-solid',
|
|
217
|
+
info: 'bg-status-info-solid',
|
|
218
|
+
violet: 'bg-status-violet-solid',
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
/** Horizontal scroll region, its frame and the edge signals (`chrome.horizontal-scroll`). */
|
|
224
|
+
export const tableScrollRegionVariants = tv({
|
|
225
|
+
slots: {
|
|
226
|
+
// The frame is the non-scrolling positioning box the edge overlays hang from. Its
|
|
227
|
+
// top hairline closes the table above the header (`chrome.container.leading-rule`).
|
|
228
|
+
frame: 'relative w-full min-w-0 border-t-100 border-t-outline-default',
|
|
229
|
+
// A container, so the empty state can centre itself in the visible width (`100cqw`).
|
|
230
|
+
// `overscroll-x-none`: the elastic overscroll (macOS) would slide the sticky pinned cells
|
|
231
|
+
// past the divider and edge shadow, which hang from the non-scrolling frame.
|
|
232
|
+
region: [
|
|
233
|
+
'@container w-full overflow-x-auto overflow-y-hidden overscroll-x-none',
|
|
234
|
+
'focus-visible:outline focus-visible:outline-200 focus-visible:outline-outline-focus focus-visible:outline-offset-2',
|
|
235
|
+
],
|
|
236
|
+
// 40 (`--space-1000`) wide, full region height, tinted end against the pinned zone.
|
|
237
|
+
// Hidden on the empty state: no rows pass under the pinned zones, so there is nothing to signal.
|
|
238
|
+
edgeShadowStart: [
|
|
239
|
+
'pointer-events-none absolute top-0 z-[calc(var(--z-index-base)+20)] w-1000 group-data-empty/table:hidden',
|
|
240
|
+
// fods-lint-disable-next-line --bg-edge-shadow token recipe derives the zero stop as rgb(from var(--bg-edge-shadow) r g b / 0); no token for it
|
|
241
|
+
'bg-[image:linear-gradient(to_right,var(--bg-edge-shadow),rgb(from_var(--bg-edge-shadow)_r_g_b_/_0))]',
|
|
242
|
+
],
|
|
243
|
+
edgeShadowEnd: [
|
|
244
|
+
'pointer-events-none absolute top-0 z-[calc(var(--z-index-base)+20)] w-1000 group-data-empty/table:hidden',
|
|
245
|
+
// fods-lint-disable-next-line --bg-edge-shadow token recipe derives the zero stop as rgb(from var(--bg-edge-shadow) r g b / 0); no token for it
|
|
246
|
+
'bg-[image:linear-gradient(to_left,var(--bg-edge-shadow),rgb(from_var(--bg-edge-shadow)_r_g_b_/_0))]',
|
|
247
|
+
],
|
|
248
|
+
// A cut edge nothing covers takes the Fade Overlay Kind=Edge mask: content
|
|
249
|
+
// dissolving into `--bg-primary` (`degradation.edge-signal-follows`).
|
|
250
|
+
edgeMaskEnd: [
|
|
251
|
+
'pointer-events-none absolute top-0 right-0 z-[calc(var(--z-index-base)+20)] w-1000 group-data-empty/table:hidden',
|
|
252
|
+
// fods-lint-disable-next-line fade-overlay.md prescribes rgb(from var(--bg-primary) r g b / 0) for the zero stop, never transparent; no token for it
|
|
253
|
+
'bg-[image:linear-gradient(to_right,rgb(from_var(--bg-primary)_r_g_b_/_0),var(--bg-primary))]',
|
|
254
|
+
],
|
|
255
|
+
},
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
/** Column-settings checklist footer — the free-content footer frame, 16 / 8. */
|
|
259
|
+
export const tableColumnSettingsVariants = tv({
|
|
260
|
+
slots: {
|
|
261
|
+
footer: 'flex px-600 py-400',
|
|
262
|
+
},
|
|
263
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A click the row must leave alone: a control inside the row does its own thing. One list
|
|
3
|
+
* for both layouts — the desktop `onRowClick` convenience (Table) and the mobile row tap
|
|
4
|
+
* that toggles the detail panel (TableMobile) — so a link, button or form control never
|
|
5
|
+
* fires the row on one layout and not the other.
|
|
6
|
+
*/
|
|
7
|
+
export const ROW_CLICK_IGNORE =
|
|
8
|
+
'a, button, input, select, textarea, label, [role="button"], [role="checkbox"], [role="menuitem"]';
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type {
|
|
3
|
+
ColumnDef,
|
|
4
|
+
ColumnVisibilityState,
|
|
5
|
+
ReactTable,
|
|
6
|
+
Row,
|
|
7
|
+
RowSelectionState,
|
|
8
|
+
SortingState,
|
|
9
|
+
RowData,
|
|
10
|
+
} from '@tanstack/react-table';
|
|
11
|
+
import type { ChipEmotion } from '../../components/chip/Chip';
|
|
12
|
+
import type { IconName } from '../../components/icon/Icon';
|
|
13
|
+
import type { TableFeatureSet } from './features';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Shared contract of the Table organism (ui-system `table` manifest 2.0.0,
|
|
17
|
+
* `kind: structure`). Everything the organism, its internal pieces and its
|
|
18
|
+
* consumers agree on lives here; the pieces import from this file, never from
|
|
19
|
+
* each other's implementation.
|
|
20
|
+
*
|
|
21
|
+
* The organism owns the TanStack `useTable()` instance. Consumers hand over
|
|
22
|
+
* `columns` + `data` and CONTROLLED state; sorting and pagination are `manual*`
|
|
23
|
+
* — the server orders and pages, the component only reports what the user asked
|
|
24
|
+
* for; the consumer wires that to its own query.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/** Alignment of a column, header and body. `center` only for a presence / icon column (Příloha). */
|
|
28
|
+
export type TableCellAlign = 'left' | 'right' | 'center';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Column facts the manifest attributes to the ORGANISM, not to Column Header
|
|
32
|
+
* (`slots.column-header`: widths, alignment law, header↔body padding). Stored in
|
|
33
|
+
* `columnDef.meta` so a consumer declares each column once.
|
|
34
|
+
*/
|
|
35
|
+
export interface TableColumnMeta {
|
|
36
|
+
/** Content alignment, header and body. Default `left`. Numeric columns are `right`. */
|
|
37
|
+
align?: TableCellAlign;
|
|
38
|
+
/** Preferred width in px at the 1270 container — the `chrome.consumer-grids` number. */
|
|
39
|
+
width: number;
|
|
40
|
+
/**
|
|
41
|
+
* A flexible column shares the leftover width with its siblings and shrinks
|
|
42
|
+
* down to `min` (max(96, label + 48) per `chrome.consumer-grids.shared-rule`)
|
|
43
|
+
* before the organism starts scrolling. Only names and e-mails qualify.
|
|
44
|
+
*/
|
|
45
|
+
flex?: { min: number };
|
|
46
|
+
/** Mandatory column: listed in column settings as a disabled + checked row, never hidden. */
|
|
47
|
+
locked?: boolean;
|
|
48
|
+
/** Part of the consumer's default set. `false` = optional (off until switched on). Default `true`. */
|
|
49
|
+
defaultVisible?: boolean;
|
|
50
|
+
/** One-line clarifier under the header label (`(Celková cena)`); grows the header to 56. */
|
|
51
|
+
description?: string;
|
|
52
|
+
/** Full term for an abbreviated label (`DUZP`) — forwarded to Column Header's Tooltip. */
|
|
53
|
+
tooltip?: React.ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* The row's identity column (Číslo / Kontakt): pinned to the leading edge when
|
|
56
|
+
* the grid scrolls, hosts the child connector slot, and is line 1 of the mobile row.
|
|
57
|
+
*/
|
|
58
|
+
identity?: boolean;
|
|
59
|
+
/** Sortable header. Default `true`; `false` renders a plain `<th>` without a button. */
|
|
60
|
+
sortable?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Width in px of this column's loading Skeleton — a typical value, never the full cell
|
|
63
|
+
* (`chrome.loading.width`; the manifest's expense-grid exhibit (`chrome.loading.width.vydaje`) gives Číslo 78, Příloha 54, Kontakt 61,
|
|
64
|
+
* Datum splatnosti 98, Celkem s DPH 84, Stav 84). Unset = 60 % of the cell.
|
|
65
|
+
*/
|
|
66
|
+
skeletonWidth?: number;
|
|
67
|
+
/**
|
|
68
|
+
* Whether this column is a label→value pair of the mobile detail panel
|
|
69
|
+
* (`chrome.mobile.expanded.panel`). Identity / status / amount columns are excluded
|
|
70
|
+
* automatically (`dedup-rule`), whatever this says.
|
|
71
|
+
* - `'auto'` (default): listed while the column is visible on desktop.
|
|
72
|
+
* - `'always'`: listed even when the column is hidden on desktop — an optional column
|
|
73
|
+
* the panel still names (`chrome.mobile.per-consumer.kontakty.panel`).
|
|
74
|
+
* - `'never'`: never listed, e.g. a value the collapsed row already shows.
|
|
75
|
+
*/
|
|
76
|
+
mobilePanel?: 'auto' | 'always' | 'never';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** A single row action — rendered as an Icon Button (desktop) or a menu item (mobile "Více"). */
|
|
80
|
+
export interface TableRowAction {
|
|
81
|
+
/** Row-scoped accessible name: "Upravit fakturu 2024-0142", never a bare "Upravit". */
|
|
82
|
+
label: string;
|
|
83
|
+
/**
|
|
84
|
+
* Visible hover / focus tooltip on the desktop Icon Button ("Upravit fakturu"). The accessible
|
|
85
|
+
* name stays `label`; the tooltip only describes. Omit it for a bare Icon Button. Mobile ignores
|
|
86
|
+
* it — the "Více" menu items carry visible text.
|
|
87
|
+
*/
|
|
88
|
+
tooltip?: string;
|
|
89
|
+
icon: IconName;
|
|
90
|
+
onClick: () => void;
|
|
91
|
+
disabled?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Destructive (Smazat). In the mobile "Více" Action menu it renders in the `danger` tone,
|
|
94
|
+
* in its own group behind a separator (popover-patterns.md § Action menu). No effect on
|
|
95
|
+
* the desktop Icon Buttons.
|
|
96
|
+
*/
|
|
97
|
+
danger?: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface TableSelection<TData extends RowData> {
|
|
101
|
+
/** TanStack `RowSelectionState` keyed by `getRowId`. */
|
|
102
|
+
state: RowSelectionState;
|
|
103
|
+
onChange: (next: RowSelectionState) => void;
|
|
104
|
+
/** Accessible name of the page-scoped select-all: "Vybrat všechny faktury na této stránce". */
|
|
105
|
+
selectAllLabel: string;
|
|
106
|
+
/** Accessible name of a row checkbox: "Vybrat fakturu 2024-0142". */
|
|
107
|
+
rowLabel: (row: TData) => string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface TableColumnVisibility {
|
|
111
|
+
/** TanStack `ColumnVisibilityState` — `{ [columnId]: boolean }`. Missing = visible. */
|
|
112
|
+
state: ColumnVisibilityState;
|
|
113
|
+
onChange: (next: ColumnVisibilityState) => void;
|
|
114
|
+
/** Copy of the column-settings surface. */
|
|
115
|
+
labels: {
|
|
116
|
+
/** Trigger Icon Button name, e.g. "Nastavení sloupců". */
|
|
117
|
+
settings: string;
|
|
118
|
+
/** `role="group"` name, e.g. "Zobrazené sloupce". */
|
|
119
|
+
group: string;
|
|
120
|
+
/** Footer Text Link, e.g. "Obnovit výchozí". */
|
|
121
|
+
reset: string;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface TablePaginationLabels {
|
|
126
|
+
/** Static label beside the page-size Select: "Položek na stránku". */
|
|
127
|
+
pageSize: string;
|
|
128
|
+
/** Accessible name of the page-size Select: "Počet položek na stránku". */
|
|
129
|
+
pageSizeSelect: string;
|
|
130
|
+
/** Forwarded to the Pagination molecule (`PaginationLabels`). */
|
|
131
|
+
nav: string;
|
|
132
|
+
previous: string;
|
|
133
|
+
next: string;
|
|
134
|
+
/**
|
|
135
|
+
* Page item accessible-name PREFIX, composed with the number by Pagination:
|
|
136
|
+
* `"Stránka"` → `aria-label="Stránka 3"` (`PaginationLabels.page`).
|
|
137
|
+
*/
|
|
138
|
+
page: string;
|
|
139
|
+
/** Visually-hidden name of a collapsed run, e.g. "Další stránky" (`PaginationLabels.morePages`). */
|
|
140
|
+
morePages?: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface TablePagination {
|
|
144
|
+
page: number;
|
|
145
|
+
totalPages: number;
|
|
146
|
+
totalCount: number;
|
|
147
|
+
pageSize: number;
|
|
148
|
+
/** Default `[10, 20, 30, 40, 50, 100]` (`chrome.footer.page-size`). */
|
|
149
|
+
pageSizeOptions?: number[];
|
|
150
|
+
onPageChange: (page: number) => void;
|
|
151
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
152
|
+
/** Optional href builder so page items render as real links. */
|
|
153
|
+
pageHref?: (page: number) => string;
|
|
154
|
+
labels: TablePaginationLabels;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* `load-failed` (1.41.0) is the list that did not load — never the empty-list text
|
|
159
|
+
* (`spec/06-patterns/empty-states.md`). An error over rows already on screen is a Toast,
|
|
160
|
+
* not this state.
|
|
161
|
+
*/
|
|
162
|
+
export type TableEmptyKind = 'empty' | 'no-results' | 'no-results-filters' | 'load-failed';
|
|
163
|
+
|
|
164
|
+
export interface TableEmptyState {
|
|
165
|
+
kind: TableEmptyKind;
|
|
166
|
+
/**
|
|
167
|
+
* The Illustration / Big picture for the kind (`chrome.empty-state.illustration`),
|
|
168
|
+
* supplied by the app — an `<img src={folderEmpty} alt="" />` of its own copy: the
|
|
169
|
+
* package ships no picture. By kind: `empty` folder-empty, `no-results`
|
|
170
|
+
* folder-magnifying-glass, `no-results-filters` funnel, `load-failed` load-failed.
|
|
171
|
+
* Drawn in the `--size-illustration-empty` box, which is `aria-hidden` — the title
|
|
172
|
+
* carries the message.
|
|
173
|
+
*/
|
|
174
|
+
illustration: React.ReactElement;
|
|
175
|
+
/**
|
|
176
|
+
* Names the entity: "Pro výraz „xyz“ nebyly nalezeny žádné odpovídající faktury". ≤ 90 chars,
|
|
177
|
+
* wraps to 2 lines. Kind `load-failed` names what did not load: "Výdaje se nepodařilo načíst".
|
|
178
|
+
*/
|
|
179
|
+
title: string;
|
|
180
|
+
description?: string;
|
|
181
|
+
/**
|
|
182
|
+
* M button with a leading icon, ≤ 24 chars (`chrome.empty-state.action`). Kind `empty` (first
|
|
183
|
+
* use) renders it Primary — the create action, e.g. "Vytvořit výdaj" with the entity glyph;
|
|
184
|
+
* the search and filter kinds render it Secondary — the reset, e.g. "Zrušit vyhledávání".
|
|
185
|
+
* Kind `load-failed` renders it Secondary — the retry, "Zkusit znovu" with `arrow-clockwise`
|
|
186
|
+
* (the default icon of that kind); `onClick` refetches, and the button gets focus back
|
|
187
|
+
* when the retry fails again.
|
|
188
|
+
*/
|
|
189
|
+
action?: { label: string; icon?: IconName; onClick: () => void };
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface TableMobileLoadMore {
|
|
193
|
+
/** Rows currently shown / total — "Zobrazeno N z M". */
|
|
194
|
+
shown: number;
|
|
195
|
+
total: number;
|
|
196
|
+
hasMore: boolean;
|
|
197
|
+
onLoadMore: () => void;
|
|
198
|
+
/**
|
|
199
|
+
* The next page is being fetched: the button stays in place in its loading state
|
|
200
|
+
* (`<Button loading>`, `aria-busy`) and does not call `onLoadMore` again. The
|
|
201
|
+
* table-level `loading` is a different wait — the whole page is a skeleton and the
|
|
202
|
+
* load-more row is not rendered.
|
|
203
|
+
*/
|
|
204
|
+
loading?: boolean;
|
|
205
|
+
labels: {
|
|
206
|
+
/** "Načíst další" */
|
|
207
|
+
loadMore: string;
|
|
208
|
+
/** Counter template: (shown, total) => "Zobrazeno 20 z 134" */
|
|
209
|
+
shownOf: (shown: number, total: number) => string;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface TableMobileConfig<TData extends RowData> {
|
|
214
|
+
/** Line 1 of the identity stack — the row link (Číslo / Kontakt). Usually the `identity` column. */
|
|
215
|
+
identityColumnId: string;
|
|
216
|
+
/** Line 2 of the identity stack, `--text-secondary` (counterparty). Omit for single-line rows (a contact list). */
|
|
217
|
+
secondaryColumnId?: string;
|
|
218
|
+
/** Line 1 of the trailing stack (Stav chip / IČ). */
|
|
219
|
+
statusColumnId: string;
|
|
220
|
+
/** Line 2 of the trailing stack, `--text-secondary` (amount). Omit for single-line rows. */
|
|
221
|
+
amountColumnId?: string;
|
|
222
|
+
/** Primary S button on the right of the panel's action pair (Odeslat / Upravit / Vytvořit fakturu). */
|
|
223
|
+
primaryAction?: (row: TData) => {
|
|
224
|
+
label: string;
|
|
225
|
+
icon?: IconName;
|
|
226
|
+
onClick: () => void;
|
|
227
|
+
/** The action does not apply to this record (a locked invoice): the Button renders `disabled`. */
|
|
228
|
+
disabled?: boolean;
|
|
229
|
+
};
|
|
230
|
+
/** Items of the "Více" dropdown on the left of the action pair. */
|
|
231
|
+
moreActions?: (row: TData) => TableRowAction[];
|
|
232
|
+
/** Label of the "Více" dropdown. Defaults to «Více» (Czech); an app with more language versions passes it from its translations. */
|
|
233
|
+
moreLabel?: string;
|
|
234
|
+
/** Accessible name of the expand toggle: "Zobrazit detail faktury 2024-0142". */
|
|
235
|
+
expandLabel: (row: TData) => string;
|
|
236
|
+
loadMore?: TableMobileLoadMore;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface TableProps<TData extends RowData> {
|
|
240
|
+
/** Accessible name — rendered as a visually hidden `<caption>` unless `captionHidden` is false. */
|
|
241
|
+
caption: string;
|
|
242
|
+
captionHidden?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* Column definitions from `createTableColumnHelper<TData>()` (features.ts), each
|
|
245
|
+
* with `meta: TableColumnMeta`. MUST be referentially stable (module scope or `useMemo`).
|
|
246
|
+
*/
|
|
247
|
+
columns: ColumnDef<TableFeatureSet, TData, any>[];
|
|
248
|
+
data: TData[];
|
|
249
|
+
getRowId: (row: TData) => string;
|
|
250
|
+
/** Child rows (credit notes). A parent + its children render as one cluster. */
|
|
251
|
+
getSubRows?: (row: TData) => TData[] | undefined;
|
|
252
|
+
/**
|
|
253
|
+
* sr-only prefix of a child row's identity LINK NAME: "Dobropis k faktuře 2024-0142".
|
|
254
|
+
* The identity cell renderer places it inside its link with `<TableChildRowPrefix />`
|
|
255
|
+
* (`_table-child-connector` notes[5]) — the organism cannot reach into the consumer's link.
|
|
256
|
+
*/
|
|
257
|
+
childRowPrefix?: (child: TData, parent: TData) => string;
|
|
258
|
+
/** Controlled, `manualSorting`, bi-state asc↔desc (`enableSortingRemoval: false`). */
|
|
259
|
+
sorting: SortingState;
|
|
260
|
+
onSortingChange: (next: SortingState) => void;
|
|
261
|
+
selection?: TableSelection<TData>;
|
|
262
|
+
/**
|
|
263
|
+
* Column settings, controlled. Without this prop the table shows the consumer's
|
|
264
|
+
* DEFAULT set — every `locked` column plus every column whose `meta.defaultVisible` is
|
|
265
|
+
* not `false` — and an optional column (`defaultVisible: false`) cannot be switched on
|
|
266
|
+
* at all: there is no settings trigger and no internal state. With it the consumer owns
|
|
267
|
+
* visibility: `state` decides what shows (a `locked` column is shown regardless), the
|
|
268
|
+
* header gets the settings trigger, and «Obnovit výchozí» reports the default set back
|
|
269
|
+
* through `onChange`.
|
|
270
|
+
*/
|
|
271
|
+
columnVisibility?: TableColumnVisibility;
|
|
272
|
+
pagination?: TablePagination;
|
|
273
|
+
/** 4px `--status-{f}-solid` strip at the row's true left edge (the manifest's invoice grid only). */
|
|
274
|
+
statusEdge?: (row: TData) => ChipEmotion | undefined;
|
|
275
|
+
/** Trailing pinned column, 12 + n×28 + 12 wide; Icon Buttons Tertiary XS, flush. */
|
|
276
|
+
rowActions?: (row: TData) => TableRowAction[];
|
|
277
|
+
/**
|
|
278
|
+
* Click on a desktop body row, parent or child (`intent.rules`: "the whole row is
|
|
279
|
+
* clickable"), usually opening the record the identity link points at. A POINTER-ONLY
|
|
280
|
+
* convenience (`delivery.react`): the row gets no `tabIndex`, no role and no key handler,
|
|
281
|
+
* so the identity cell's real `<a>` stays the sole keyboard / AT path into the record —
|
|
282
|
+
* keep that link. Not called for a click that lands on a link, button, form control or
|
|
283
|
+
* menu item inside the row, on the selection or row-actions cell, or that a cell already
|
|
284
|
+
* handled (`event.defaultPrevented`). With the handler the rows show a pointer cursor.
|
|
285
|
+
* Skeleton rows, the empty state and the mobile layout (whose row tap toggles its
|
|
286
|
+
* panel) never call it.
|
|
287
|
+
*/
|
|
288
|
+
onRowClick?: (row: Row<TableFeatureSet, TData>, event: React.MouseEvent<HTMLTableRowElement>) => void;
|
|
289
|
+
/**
|
|
290
|
+
* Skeleton rows under the real header (`chrome.loading`). `skeletonRows` defaults to the
|
|
291
|
+
* page size — the rows the data will take — `pagination.pageSize`, else
|
|
292
|
+
* `TABLE_DEFAULT_PAGE_SIZE`. The end of the wait is announced once through a visually
|
|
293
|
+
* hidden `role="status"` with the text of `loadedLabel`. While loading no control does
|
|
294
|
+
* anything: sorting (desktop and mobile headers), the select-all and the column-settings
|
|
295
|
+
* trigger are disabled; pagination and the mobile load-more row are not rendered.
|
|
296
|
+
*/
|
|
297
|
+
loading?: boolean;
|
|
298
|
+
skeletonRows?: number;
|
|
299
|
+
/** Text announced once when a load ends. Defaults to «Načteno» (Czech); an app with more language versions passes it from its translations. */
|
|
300
|
+
loadedLabel?: string;
|
|
301
|
+
/** Replaces the body with the Table / Empty sibling — header kept, footer dropped. */
|
|
302
|
+
emptyState?: TableEmptyState;
|
|
303
|
+
/** Below `md` the organism switches to the expandable-row layout. Required for the mobile layout to render. */
|
|
304
|
+
mobile?: TableMobileConfig<TData>;
|
|
305
|
+
/** Accessible name of the horizontal scroll region: "Vystavené faktury — posuvná oblast". */
|
|
306
|
+
scrollRegionLabel?: string;
|
|
307
|
+
className?: string;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** Default page-size options, `chrome.footer.page-size`. */
|
|
311
|
+
export const TABLE_PAGE_SIZE_OPTIONS = [10, 20, 30, 40, 50, 100] as const;
|
|
312
|
+
/** `chrome.footer.page-size.default` — also the skeleton row count when no page size is known. */
|
|
313
|
+
export const TABLE_DEFAULT_PAGE_SIZE = 20;
|
|
314
|
+
|
|
315
|
+
/** Props of the mobile layout piece (`chrome.mobile`), rendered by Table below `md`. */
|
|
316
|
+
export interface TableMobileProps<TData extends RowData> {
|
|
317
|
+
table: ReactTable<TableFeatureSet, TData>;
|
|
318
|
+
caption: string;
|
|
319
|
+
captionHidden?: boolean;
|
|
320
|
+
mobile: TableMobileConfig<TData>;
|
|
321
|
+
statusEdge?: (row: TData) => ChipEmotion | undefined;
|
|
322
|
+
childRowPrefix?: (child: TData, parent: TData) => string;
|
|
323
|
+
loading?: boolean;
|
|
324
|
+
skeletonRows: number;
|
|
325
|
+
emptyState?: TableEmptyState;
|
|
326
|
+
/** Owned by the organism — see `TableEmptyProps.retryFocusRef`. */
|
|
327
|
+
retryFocusRef?: React.MutableRefObject<boolean>;
|
|
328
|
+
className?: string;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/** Props of the Table / Empty sibling body (`chrome.empty-state`) — a `<tbody>` under the kept header. */
|
|
332
|
+
export interface TableEmptyProps {
|
|
333
|
+
emptyState: TableEmptyState;
|
|
334
|
+
/** Number of visible columns, so the single cell spans the full grid. */
|
|
335
|
+
colSpan: number;
|
|
336
|
+
/**
|
|
337
|
+
* Kind `load-failed`: set when the retry is pressed, so the retry button of the NEXT
|
|
338
|
+
* load-failed body takes focus back (`empty-states.md` § Accessibility). The skeleton
|
|
339
|
+
* unmounts the body in between, so the flag lives in the organism, not here.
|
|
340
|
+
*/
|
|
341
|
+
retryFocusRef?: React.MutableRefObject<boolean>;
|
|
342
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// The merge config is generated from the package theme, not written by hand.
|
|
2
|
+
// Components import `tv` from here and `cn` from ./utils, never
|
|
3
|
+
// from tailwind-variants or tailwind-merge directly.
|
|
4
|
+
//
|
|
5
|
+
// One merger for both. `twMerge` is tailwind-merge configured from the package theme
|
|
6
|
+
// (tw-merge-config.generated.ts), so it knows that `text-body-sm` is a text style and
|
|
7
|
+
// `text-text-primary` a colour and keeps both. `cn` runs it over its arguments; `tv`
|
|
8
|
+
// runs it over every recipe result. The full build of tailwind-variants carries its
|
|
9
|
+
// own copy of the merge engine with a module-wide config cache, so `tv` is built on
|
|
10
|
+
// `tailwind-variants/lite` (recipes without merging) and merged here instead: the
|
|
11
|
+
// recipe and a consumer's `className` can then never be merged by two different
|
|
12
|
+
// configs.
|
|
13
|
+
import { extendTailwindMerge } from 'tailwind-merge';
|
|
14
|
+
import { tv as tvWithoutMerge, type TVLite } from 'tailwind-variants/lite';
|
|
15
|
+
import { twMergeConfig } from './tw-merge-config.generated';
|
|
16
|
+
|
|
17
|
+
export type { VariantProps } from 'tailwind-variants';
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
* A class written with the leading `!` of Tailwind 3 (`!text-text-primary/50`), as the
|
|
21
|
+
* components write it. tailwind-merge 3 still reads the leading
|
|
22
|
+
* `!`, but it measures the position of the `/` modifier before it drops the `!`, so
|
|
23
|
+
* the position is one too far and the class lands in no group: `!text-a` and
|
|
24
|
+
* `!text-a/50` both survive a merge. The position is corrected here. The trailing
|
|
25
|
+
* form (`text-a/50!`) is parsed correctly and passes through.
|
|
26
|
+
*/
|
|
27
|
+
const parseLeadingImportant: NonNullable<typeof twMergeConfig.experimentalParseClassName> = ({
|
|
28
|
+
className,
|
|
29
|
+
parseClassName,
|
|
30
|
+
}) => {
|
|
31
|
+
const parsed = parseClassName(className);
|
|
32
|
+
const position = parsed.maybePostfixModifierPosition;
|
|
33
|
+
if (!parsed.hasImportantModifier || position === undefined || className.endsWith('!')) return parsed;
|
|
34
|
+
return { ...parsed, maybePostfixModifierPosition: position - 1 };
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const twMerge = extendTailwindMerge({ ...twMergeConfig, experimentalParseClassName: parseLeadingImportant });
|
|
38
|
+
|
|
39
|
+
type ClassResult = string | undefined;
|
|
40
|
+
type SlotFunction = (props?: Record<string, unknown>) => ClassResult;
|
|
41
|
+
|
|
42
|
+
const mergeClasses = (classes: ClassResult): ClassResult => (classes ? twMerge(classes) || undefined : classes);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Wraps a recipe of tailwind-variants/lite so its output is merged by `twMerge`.
|
|
46
|
+
* A recipe without slots returns a class string; a recipe with slots returns one
|
|
47
|
+
* function per slot. The recipe's own fields (`base`, `slots`, `variants`, …) are
|
|
48
|
+
* copied, because `tv({ extend: recipe })` reads them.
|
|
49
|
+
*/
|
|
50
|
+
function withMerge<T extends (props?: Record<string, unknown>) => unknown>(recipe: T): T {
|
|
51
|
+
const merged = (props?: Record<string, unknown>) => {
|
|
52
|
+
const result = recipe(props);
|
|
53
|
+
if (result === null || typeof result !== 'object') return mergeClasses(result as ClassResult);
|
|
54
|
+
const slots: Record<string, SlotFunction> = {};
|
|
55
|
+
for (const [name, slot] of Object.entries(result as Record<string, SlotFunction>)) {
|
|
56
|
+
slots[name] = (slotProps) => mergeClasses(slot(slotProps));
|
|
57
|
+
}
|
|
58
|
+
return slots;
|
|
59
|
+
};
|
|
60
|
+
return Object.assign(merged, recipe) as unknown as T;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** tailwind-variants `tv`, merged with the package config. It takes no second (config) argument. */
|
|
64
|
+
export const tv: TVLite = ((options: Parameters<TVLite>[0]) =>
|
|
65
|
+
withMerge(tvWithoutMerge(options) as (props?: Record<string, unknown>) => unknown)) as TVLite;
|