@invoiceonline/ui-react 0.0.0 → 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 +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-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 +351 -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-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,827 @@
|
|
|
1
|
+
import React, { Fragment, useState, type ComponentType } from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
import {
|
|
4
|
+
FilterChip,
|
|
5
|
+
type FilterChipBaseProps,
|
|
6
|
+
type FilterChipEmotion,
|
|
7
|
+
type FilterChipPopup,
|
|
8
|
+
type FilterChipType,
|
|
9
|
+
} from './FilterChip';
|
|
10
|
+
import { BADGE_STATUS_ICONS } from '../badge/Badge';
|
|
11
|
+
import { Section, Showcase } from '../../storybook/Section';
|
|
12
|
+
import { FodsFamily } from '../../storybook/FodsFamily';
|
|
13
|
+
import { TooltipProvider } from '../tooltip/Tooltip';
|
|
14
|
+
import {
|
|
15
|
+
FILTER_CHIP_FORCE_CLEAR_RING,
|
|
16
|
+
FILTER_CHIP_FORCE_HOVER,
|
|
17
|
+
FILTER_CHIP_FORCE_RING,
|
|
18
|
+
} from '../../storybook/forceStates';
|
|
19
|
+
import { componentDoc } from '../../storybook/componentDoc';
|
|
20
|
+
import { a11yRulesOff } from '../../storybook/a11y';
|
|
21
|
+
|
|
22
|
+
// Built against `filter-chip` manifest 1.14.1.
|
|
23
|
+
const TYPES = ['facet', 'toggle'] as const satisfies readonly FilterChipType[];
|
|
24
|
+
const EMOTIONS = ['neutral', 'warning', 'danger'] as const satisfies readonly FilterChipEmotion[];
|
|
25
|
+
const SIZES = ['md', 'sm'] as const;
|
|
26
|
+
const POPUPS = ['listbox', 'dialog'] as const satisfies readonly FilterChipPopup[];
|
|
27
|
+
/**
|
|
28
|
+
* `axes.selection` is a FAMILY split here, not a prop — a Facet is Selected when it has
|
|
29
|
+
* an applied `value`, a Toggle when it is `checked`. The constant exists so the axis is
|
|
30
|
+
* actually enumerated rather than implied by six hand-written family rows.
|
|
31
|
+
*/
|
|
32
|
+
const SELECTIONS = ['unselected', 'selected'] as const;
|
|
33
|
+
|
|
34
|
+
const titleCase = (value: string) => value.charAt(0).toUpperCase() + value.slice(1);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The recipe's own colour axis: one row per manifest family, derived from Emotion ×
|
|
38
|
+
* Selection so the two source axes cannot drift from the six rows they produce. The
|
|
39
|
+
* `key` is what the recipe's `family` variant is named, what `data-fods-family` carries
|
|
40
|
+
* and what the forced Hover twin is keyed by — one name in all three places.
|
|
41
|
+
*/
|
|
42
|
+
const FAMILIES = EMOTIONS.flatMap(emotion =>
|
|
43
|
+
SELECTIONS.map(selection => ({
|
|
44
|
+
key: `${emotion}-${selection}` as keyof typeof FILTER_CHIP_FORCE_HOVER,
|
|
45
|
+
label: `${titleCase(emotion)} · ${titleCase(selection)}`,
|
|
46
|
+
emotion,
|
|
47
|
+
selected: selection === 'selected',
|
|
48
|
+
})),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The manifest's state axis is Default · Hover · Disabled. Hover is a pseudo-class,
|
|
53
|
+
* so a docs grid cannot render it by passing anything — it is forced statically with
|
|
54
|
+
* the bare twin of the recipe's own class. Focus is deliberately NOT a variant (it is
|
|
55
|
+
* the cross-cutting focus-ring pattern), but the DoD asks for it to be visible, so it
|
|
56
|
+
* gets its own forced column. There is no Active state: the axis has three values.
|
|
57
|
+
*/
|
|
58
|
+
const STATES = [
|
|
59
|
+
{ label: 'Default', props: {}, force: '' },
|
|
60
|
+
{ label: 'Hover', props: {}, force: 'hover' },
|
|
61
|
+
{ label: 'Focus', props: {}, force: 'ring' },
|
|
62
|
+
{ label: 'Disabled', props: { disabled: true }, force: '' },
|
|
63
|
+
] as const;
|
|
64
|
+
|
|
65
|
+
const forceClass = (family: keyof typeof FILTER_CHIP_FORCE_HOVER, force: string) => {
|
|
66
|
+
if (force === 'ring') return FILTER_CHIP_FORCE_RING;
|
|
67
|
+
if (force === 'hover') return FILTER_CHIP_FORCE_HOVER[family];
|
|
68
|
+
return undefined;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The reference implementation the spec names: the `/firmy` public-register filter
|
|
73
|
+
* bar. Facets are Neutral only — Warning / Danger are Toggle's risk-flag vocabulary.
|
|
74
|
+
*/
|
|
75
|
+
const REGISTER_FACETS = [
|
|
76
|
+
{ label: 'Kraj', icon: 'map-pin', count: 14, value: undefined },
|
|
77
|
+
{ label: 'Obor činnosti', icon: 'briefcase', count: 31, value: undefined },
|
|
78
|
+
{ label: 'Právní forma', icon: 'buildings', count: 8, value: 's.r.o.' },
|
|
79
|
+
] as const;
|
|
80
|
+
|
|
81
|
+
const REGISTER_FLAGS = [
|
|
82
|
+
{ label: 'Plátce DPH', emotion: 'neutral', icon: 'shield-check', count: 18 },
|
|
83
|
+
{ label: 'Nespolehlivý DPH', emotion: 'warning', icon: 'warning', count: 2 },
|
|
84
|
+
{ label: 'Insolvence', emotion: 'danger', icon: 'warning-circle', count: 25 },
|
|
85
|
+
] as const satisfies readonly {
|
|
86
|
+
label: string;
|
|
87
|
+
emotion: FilterChipEmotion;
|
|
88
|
+
icon: string;
|
|
89
|
+
count: number;
|
|
90
|
+
}[];
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* `FilterChipProps` makes `clearLabel` mandatory for `type="facet"` through a
|
|
94
|
+
* discriminated union — right for consumers, but CSF's `Args` machinery cannot resolve
|
|
95
|
+
* a union prop type and collapses every `args` block to `never` (the wall `Chip` and
|
|
96
|
+
* `RadioGroup` hit). Type the stories against the permissive base; the required-label
|
|
97
|
+
* contract still bites in each render body, where the real component type applies.
|
|
98
|
+
*/
|
|
99
|
+
type FilterChipStoryArgs = FilterChipBaseProps;
|
|
100
|
+
|
|
101
|
+
const meta = {
|
|
102
|
+
title: 'Design System/Atoms/FilterChip',
|
|
103
|
+
// Storybook 10 types `component` against the story args; the clearLabel union
|
|
104
|
+
// of FilterChipProps does not overlap FilterChipBaseProps, so cast through unknown.
|
|
105
|
+
component: FilterChip as unknown as ComponentType<FilterChipStoryArgs>,
|
|
106
|
+
parameters: {
|
|
107
|
+
// label-content-name-mismatch: the trigger's accessible name is the string the spec
|
|
108
|
+
// prescribes (filter-chip.md § Accessibility), and it holds every visible word — axe
|
|
109
|
+
// reads it otherwise twice over. A Toggle with a count is named `Plátce DPH, 18`, while
|
|
110
|
+
// axe joins the label and count spans, which sit flush in the DOM, into "Plátce DPH18".
|
|
111
|
+
// A Selected Facet with several values shows `Čistota Plus +2` and is named
|
|
112
|
+
// `Dodavatel: Čistota Plus, Datacentrum Sever, Pekárna Růžička`, the `+2` elision
|
|
113
|
+
// spelled out on purpose. Off on the meta because nine stories render such a chip.
|
|
114
|
+
a11y: a11yRulesOff('label-content-name-mismatch'),
|
|
115
|
+
layout: 'centered',
|
|
116
|
+
// Narrowed from the global `^on[A-Z].*` in the Storybook preview. That regex
|
|
117
|
+
// auto-injects an action for EVERY on* prop, so a Facet Playground would also
|
|
118
|
+
// receive `onCheckedChange` and trip the component's own dev warning
|
|
119
|
+
// ("`onCheckedChange` is Toggle-only"). The warning is correct; the caller was
|
|
120
|
+
// Storybook. Only the two handlers a Facet actually has get logged.
|
|
121
|
+
actions: { argTypesRegex: '^(onClear|onClick)$' },
|
|
122
|
+
docs: {
|
|
123
|
+
description: {
|
|
124
|
+
component: componentDoc({
|
|
125
|
+
summary:
|
|
126
|
+
'The FILTER-BAR control — a Facet that opens an options panel and then morphs in place into the chosen value with a clearing ×, or a Toggle that flips a binary flag directly. Both carry a live result count. 2 types × 3 emotions × 2 selections × 2 sizes × 3 states; chrome and padding come from the Pill recipe (spec 06-patterns/pill.md) extended to the 32/40 control tier on Button metrics.',
|
|
127
|
+
useCases: [
|
|
128
|
+
'`facet` — the `/firmy` register bar: pick a Kraj / Obor činnosti from a panel, the chip then shows the applied value',
|
|
129
|
+
'`toggle` — a binary flag flipped in place (Plátce DPH, Nespolehlivý DPH, Insolvence), no panel',
|
|
130
|
+
'Warning / Danger are Toggle\'s **risk flags** — a Facet stays Neutral, the app\'s own selection accent',
|
|
131
|
+
],
|
|
132
|
+
bestPractices: [
|
|
133
|
+
'Reach for FilterChip when the control **is** the filter state; for a removable tag or a checkbox filter row use **Chip** (22/30 tag tier), for read-only status **Badge**, for a fixed menu noun ("Akce") **DropdownButton**',
|
|
134
|
+
'Let selection recolour the whole pill (outline → family solid) — the deliberate opposite of Chip, whose pill never recolours',
|
|
135
|
+
'Morph a Facet **in place**: same node, category label ↔ applied value, caret ↔ ×. The × clears the filter; it never removes the control',
|
|
136
|
+
'Show the live result count **including zero** — it is an answer, not an absence. No parentheses, no unit noun',
|
|
137
|
+
'Keep the leading glyph semantic — the facet\'s category (`pin` / `buildings`) or the flag\'s risk class per Badge\'s map. Do not ship the generic `funnel-simple` default on a shipped screen',
|
|
138
|
+
'The count is folded into the accessible name ("Plátce DPH, 18"), never a visual-only suffix',
|
|
139
|
+
'The × is a real focusable `<button>` with a 32×32 hit area (the dense-control tier, not the 24×24 floor — manifest 1.3.0), named by the required `clearLabel` — translated by the caller, because this atom has no locale of its own',
|
|
140
|
+
'Match the bar\'s density: `md` (40) is the default, `sm` (32) for dense toolbars — do not mix sizes in one bar',
|
|
141
|
+
],
|
|
142
|
+
knownIssues: [
|
|
143
|
+
'`children` is typed `string`, not `ReactNode` — the label is plain text by contract (1 line, truncated, ≤ ~28 chars).',
|
|
144
|
+
'Selection is **derived**, not passed: a Facet is Selected when `value != null`, a Toggle when `checked`. That makes "a Selected Facet with no applied value" unrepresentable, at the cost of two different selection props per type.',
|
|
145
|
+
'The manifest animates the morph\'s **width** as well as its colours. CSS cannot transition width on a hug-width box, so the width change snaps; only fill and hairline colour animate (`--duration-normal` / `--easing-standard`, instant under `prefers-reduced-motion`).',
|
|
146
|
+
'The Unselected hairline and the focus ring both want the root\'s single `outline`, and FilterChip is the first component in the system to collide them. Resolved the opposite way round from `edge-outline.md` § Interaction with the focus ring: the hairline keeps the `outline` (its mechanism is a manifest fact the verifier grades per family and state) and the RING becomes the `::before` offset band that `focus-ring.md` § Styles sanctions and Field Pair already ships. Identical rendering; the pattern doc still says "No current component reaches it" and should record this precedent.',
|
|
147
|
+
'The count\'s ink on **disabled** outline chrome is an open manifest `backlog` item (status `blocked` — the count is family-dependent ink, which the family-independence law keeps out of `parts`). It is bound to `--disabled-foreground` here, following the family\'s `disabled.text`: derived, not specified.',
|
|
148
|
+
'Upstream `slots.leading` names `funnel-simple`, `map-pin`, `briefcase` and `warning-circle`. All four render under those canonical names.',
|
|
149
|
+
'A Facet in a non-Neutral emotion only logs a dev warning rather than being a type error — consistent with how `Chip` handles invalid type/affordance combinations.',
|
|
150
|
+
],
|
|
151
|
+
docsLink: { label: 'spec/03-atoms/filter-chip.md' },
|
|
152
|
+
}),
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
} satisfies Meta<FilterChipStoryArgs>;
|
|
157
|
+
|
|
158
|
+
export default meta;
|
|
159
|
+
type Story = StoryObj<FilterChipStoryArgs>;
|
|
160
|
+
|
|
161
|
+
export const Playground: Story = {
|
|
162
|
+
args: {
|
|
163
|
+
children: 'Kraj',
|
|
164
|
+
type: 'facet',
|
|
165
|
+
popup: 'listbox',
|
|
166
|
+
emotion: 'neutral',
|
|
167
|
+
size: 'md',
|
|
168
|
+
disabled: false,
|
|
169
|
+
count: 14,
|
|
170
|
+
showCount: true,
|
|
171
|
+
leadingIcon: 'funnel-simple',
|
|
172
|
+
open: false,
|
|
173
|
+
// Unselected on purpose. The FODS runtime pass measures parts in THIS story, and
|
|
174
|
+
// the parts map's resting expectation is the Unselected family (`--bg-primary` +
|
|
175
|
+
// the `--outline-default` hairline). A pre-applied `value` would put the family
|
|
176
|
+
// solid under the probe and report every Unselected binding as a mismatch —
|
|
177
|
+
// the same trap Chip's pre-checked Playground fell into. Type a value into the
|
|
178
|
+
// control, or see the Morph story, for the Selected pair.
|
|
179
|
+
value: undefined,
|
|
180
|
+
// The × is icon-only and the component ships no default name (it would announce
|
|
181
|
+
// Czech on the PL / SK / EN markets), so the Playground plays the consumer. It
|
|
182
|
+
// paints nothing, so the runtime measurement is unaffected.
|
|
183
|
+
clearLabel: 'Zrušit filtr Kraj',
|
|
184
|
+
},
|
|
185
|
+
argTypes: {
|
|
186
|
+
children: { control: 'text' },
|
|
187
|
+
type: { control: 'inline-radio', options: TYPES },
|
|
188
|
+
popup: { control: 'inline-radio', options: POPUPS },
|
|
189
|
+
emotion: { control: 'inline-radio', options: EMOTIONS },
|
|
190
|
+
size: { control: 'inline-radio', options: SIZES },
|
|
191
|
+
disabled: { control: 'boolean' },
|
|
192
|
+
count: { control: 'number' },
|
|
193
|
+
showCount: { control: 'boolean' },
|
|
194
|
+
leadingIcon: { control: 'text' },
|
|
195
|
+
open: { control: 'boolean' },
|
|
196
|
+
value: { control: 'text' },
|
|
197
|
+
clearLabel: { control: 'text' },
|
|
198
|
+
checked: { control: 'boolean' },
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export const Types: Story = {
|
|
203
|
+
args: { children: 'Kraj' },
|
|
204
|
+
parameters: {
|
|
205
|
+
docs: {
|
|
206
|
+
description: {
|
|
207
|
+
story:
|
|
208
|
+
'The Type axis changes **semantics and the trailing affordance, not colour**. A `facet` trigger is a `<button role="combobox" aria-haspopup="listbox" aria-expanded>` with a trailing caret — or, with `popup="dialog"` (a multi-value facet whose panel is a Multi-select filter group, or a numeric range facet whose panel is a Field Pair), a plain `<button aria-haspopup="dialog" aria-expanded>`; applying a value replaces the label and turns the caret into a real sibling `<button>` for the clearing ×. A `toggle` is a `<button aria-pressed>` with no trailing affordance at all — its count sits at the end of the label run. Both share one DOM shape: a `<span>` pill (chrome, height, radius, hairline, focus ring) wrapping the trigger, because a Selected Facet needs two sibling buttons and a `<button>` may not contain interactive content.',
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
render: () => (
|
|
213
|
+
<Showcase>
|
|
214
|
+
<Section title="Facet — opens a panel, then morphs into the applied value">
|
|
215
|
+
<FilterChip count={14} clearLabel="Zrušit filtr Kraj">
|
|
216
|
+
Kraj
|
|
217
|
+
</FilterChip>
|
|
218
|
+
<FilterChip value="Praha" clearLabel="Zrušit filtr Kraj">
|
|
219
|
+
Kraj
|
|
220
|
+
</FilterChip>
|
|
221
|
+
</Section>
|
|
222
|
+
<Section title="Toggle — a binary flag, no panel">
|
|
223
|
+
<FilterChip type="toggle" leadingIcon="shield-check" count={18}>
|
|
224
|
+
Plátce DPH
|
|
225
|
+
</FilterChip>
|
|
226
|
+
<FilterChip type="toggle" leadingIcon="shield-check" count={18} defaultChecked>
|
|
227
|
+
Plátce DPH
|
|
228
|
+
</FilterChip>
|
|
229
|
+
</Section>
|
|
230
|
+
</Showcase>
|
|
231
|
+
),
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
export const Emotions: Story = {
|
|
235
|
+
args: { children: 'Insolvence' },
|
|
236
|
+
parameters: {
|
|
237
|
+
docs: {
|
|
238
|
+
description: {
|
|
239
|
+
story:
|
|
240
|
+
'Colour comes from the family (Emotion × Selection), never from the type. **Unselected** is outline chrome — `--bg-primary` fill plus a `--outline-default` hairline — in every emotion; the emotion only shows on hover, where the hairline swaps to that family\'s solid. **Selected** is the family solid: `--secondary-solid` (Neutral, the app\'s selection accent), `--status-warning-solid`, `--status-danger-solid`. Facet is Neutral only; Warning and Danger belong to Toggle\'s risk-flag vocabulary (Nespolehlivý DPH, Insolvence).',
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
render: () => (
|
|
245
|
+
<Showcase>
|
|
246
|
+
<Section title="Unselected — outline chrome in every emotion (hover reveals the family)">
|
|
247
|
+
{REGISTER_FLAGS.map(flag => (
|
|
248
|
+
<FilterChip
|
|
249
|
+
key={flag.label}
|
|
250
|
+
type="toggle"
|
|
251
|
+
emotion={flag.emotion}
|
|
252
|
+
leadingIcon={flag.icon}
|
|
253
|
+
count={flag.count}
|
|
254
|
+
>
|
|
255
|
+
{flag.label}
|
|
256
|
+
</FilterChip>
|
|
257
|
+
))}
|
|
258
|
+
</Section>
|
|
259
|
+
<Section title="Selected — the family solid fill">
|
|
260
|
+
{REGISTER_FLAGS.map(flag => (
|
|
261
|
+
<FilterChip
|
|
262
|
+
key={flag.label}
|
|
263
|
+
type="toggle"
|
|
264
|
+
emotion={flag.emotion}
|
|
265
|
+
leadingIcon={flag.icon}
|
|
266
|
+
count={flag.count}
|
|
267
|
+
defaultChecked
|
|
268
|
+
>
|
|
269
|
+
{flag.label}
|
|
270
|
+
</FilterChip>
|
|
271
|
+
))}
|
|
272
|
+
</Section>
|
|
273
|
+
</Showcase>
|
|
274
|
+
),
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export const Sizes: Story = {
|
|
278
|
+
args: { children: 'Kraj' },
|
|
279
|
+
parameters: {
|
|
280
|
+
docs: {
|
|
281
|
+
description: {
|
|
282
|
+
story:
|
|
283
|
+
'The Pill recipe on **Button metrics**: 40 (`md`) / 32 (`sm`), radius tracking the size (`--radius-400` / `--radius-300`), labels `Body/M/Semibold` / `Body/S/Semibold`, glyphs 20 / 16, gap `--space-400` / `--space-300`. Inline padding is `--space-500` (12) at both sizes with the **affordance side one step down in code** — the leading glyph\'s side and the caret / × side land on `--space-400` (8), while a Toggle\'s trailing count keeps the base 12 because a text run is not an affordance. `md` is the default filter-bar density; `sm` is for dense toolbars and embedded bars — the `/firmy` register bar runs `sm` at seven controls plus a clear action.',
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
render: () => (
|
|
288
|
+
<Showcase>
|
|
289
|
+
{SIZES.map(size => (
|
|
290
|
+
<Section
|
|
291
|
+
key={size}
|
|
292
|
+
title={size === 'md' ? 'md — 40 (default filter-bar density)' : 'sm — 32 (dense toolbars)'}
|
|
293
|
+
>
|
|
294
|
+
<FilterChip size={size} count={14} clearLabel="Zrušit filtr Kraj">
|
|
295
|
+
Kraj
|
|
296
|
+
</FilterChip>
|
|
297
|
+
<FilterChip size={size} value="Praha" clearLabel="Zrušit filtr Kraj">
|
|
298
|
+
Kraj
|
|
299
|
+
</FilterChip>
|
|
300
|
+
<FilterChip size={size} type="toggle" leadingIcon="shield-check" count={18}>
|
|
301
|
+
Plátce DPH
|
|
302
|
+
</FilterChip>
|
|
303
|
+
<FilterChip size={size} type="toggle" leadingIcon={null} count={18} defaultChecked>
|
|
304
|
+
Plátce DPH
|
|
305
|
+
</FilterChip>
|
|
306
|
+
</Section>
|
|
307
|
+
))}
|
|
308
|
+
</Showcase>
|
|
309
|
+
),
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export const Matrix: Story = {
|
|
313
|
+
args: { children: 'Kraj' },
|
|
314
|
+
parameters: {
|
|
315
|
+
docs: {
|
|
316
|
+
description: {
|
|
317
|
+
story:
|
|
318
|
+
'The full family × size matrix, mirroring the Figma labelled grid (set 7181:119581). Rows are the six manifest families (Emotion × Selection — `kind: matrix`, the Checkbox precedent where selection is a family split and the states stay Default / Hover / Disabled); columns are `md` / `sm`. Facet rows exist only under Neutral, so the Warning and Danger rows are Toggles — that is the 48-variant split: Facet builds 12 under Neutral, Toggle 36 across all three emotions.',
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
render: () => (
|
|
323
|
+
<Showcase>
|
|
324
|
+
<Section title="Family × size" layout="column">
|
|
325
|
+
<div className="grid grid-cols-[11rem_repeat(2,minmax(0,1fr))] items-center gap-400">
|
|
326
|
+
<span />
|
|
327
|
+
{SIZES.map(size => (
|
|
328
|
+
<span key={size} className="text-body-sm font-semibold text-text-secondary">
|
|
329
|
+
{size}
|
|
330
|
+
</span>
|
|
331
|
+
))}
|
|
332
|
+
{FAMILIES.map(family => (
|
|
333
|
+
<Fragment key={family.key}>
|
|
334
|
+
<span className="text-body-sm text-text-secondary">{family.label}</span>
|
|
335
|
+
{SIZES.map(size => (
|
|
336
|
+
<FodsFamily key={size} name={family.key}>
|
|
337
|
+
{family.emotion === 'neutral' ? (
|
|
338
|
+
<FilterChip
|
|
339
|
+
size={size}
|
|
340
|
+
count={14}
|
|
341
|
+
value={family.selected ? 'Praha' : undefined}
|
|
342
|
+
clearLabel="Zrušit filtr Kraj"
|
|
343
|
+
>
|
|
344
|
+
Kraj
|
|
345
|
+
</FilterChip>
|
|
346
|
+
) : (
|
|
347
|
+
<FilterChip
|
|
348
|
+
type="toggle"
|
|
349
|
+
emotion={family.emotion}
|
|
350
|
+
// A risk flag carries its own glyph, never the default funnel.
|
|
351
|
+
leadingIcon={BADGE_STATUS_ICONS[family.emotion]}
|
|
352
|
+
size={size}
|
|
353
|
+
count={2}
|
|
354
|
+
checked={family.selected}
|
|
355
|
+
>
|
|
356
|
+
{family.emotion === 'warning' ? 'Nespolehlivý DPH' : 'Insolvence'}
|
|
357
|
+
</FilterChip>
|
|
358
|
+
)}
|
|
359
|
+
</FodsFamily>
|
|
360
|
+
))}
|
|
361
|
+
</Fragment>
|
|
362
|
+
))}
|
|
363
|
+
</div>
|
|
364
|
+
</Section>
|
|
365
|
+
<Section title="Facet is Neutral only — the type axis under Neutral" layout="column">
|
|
366
|
+
<div className="grid grid-cols-[11rem_repeat(2,minmax(0,1fr))] items-center gap-400">
|
|
367
|
+
<span />
|
|
368
|
+
{SIZES.map(size => (
|
|
369
|
+
<span key={size} className="text-body-sm font-semibold text-text-secondary">
|
|
370
|
+
{size}
|
|
371
|
+
</span>
|
|
372
|
+
))}
|
|
373
|
+
{TYPES.map(type => (
|
|
374
|
+
<Fragment key={type}>
|
|
375
|
+
<span className="text-body-sm text-text-secondary">{type}</span>
|
|
376
|
+
{SIZES.map(size => (
|
|
377
|
+
<FodsFamily key={size} name="neutral-unselected">
|
|
378
|
+
<FilterChip
|
|
379
|
+
type={type}
|
|
380
|
+
size={size}
|
|
381
|
+
count={14}
|
|
382
|
+
leadingIcon={type === 'facet' ? 'funnel-simple' : 'shield-check'}
|
|
383
|
+
clearLabel="Zrušit filtr Kraj"
|
|
384
|
+
>
|
|
385
|
+
{type === 'facet' ? 'Kraj' : 'Plátce DPH'}
|
|
386
|
+
</FilterChip>
|
|
387
|
+
</FodsFamily>
|
|
388
|
+
))}
|
|
389
|
+
</Fragment>
|
|
390
|
+
))}
|
|
391
|
+
</div>
|
|
392
|
+
</Section>
|
|
393
|
+
</Showcase>
|
|
394
|
+
),
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
export const States: Story = {
|
|
398
|
+
args: { children: 'Kraj' },
|
|
399
|
+
parameters: {
|
|
400
|
+
docs: {
|
|
401
|
+
description: {
|
|
402
|
+
story:
|
|
403
|
+
'The state axis per family. **Hover** is two different things depending on selection, and that is the point: an Unselected family keeps its `--bg-primary` fill and swaps the **hairline** to the family solid, while a Selected family deepens the **fill** one step to the family\'s hover tone. **Focus** is not a variant at all — it is the cross-cutting additive offset ring (`--outline-focus` at `--border-width-200`, a 2px gap, radius one step up), painted on the pill as a `::before` band driven by the trigger\'s `:focus-visible`, never a border on the element itself. The **×** on a Selected Facet rings itself in `--outline-focus-inverse` instead, because `--outline-focus` is invisible on the solid fill. **Disabled** preserves the selection structurally but not chromatically: Unselected keeps the outline chrome with grey content, Selected keeps a solid fill but in `--disabled-control` grey — so a disabled Danger Toggle looks identical to a disabled Neutral Facet. There is no **Active** state; the manifest axis is Default · Hover · Disabled. Hover and Focus are **forced statically** here, so every column differs from Default without a live cursor.',
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
render: () => (
|
|
408
|
+
<Showcase>
|
|
409
|
+
<Section title="State × family" layout="column">
|
|
410
|
+
<div className="grid grid-cols-[11rem_repeat(4,minmax(0,1fr))] items-center gap-400">
|
|
411
|
+
<span />
|
|
412
|
+
{STATES.map(state => (
|
|
413
|
+
<span key={state.label} className="text-body-sm font-semibold text-text-secondary">
|
|
414
|
+
{state.label}
|
|
415
|
+
</span>
|
|
416
|
+
))}
|
|
417
|
+
{FAMILIES.map(family => (
|
|
418
|
+
<Fragment key={family.key}>
|
|
419
|
+
<span className="text-body-sm text-text-secondary">{family.label}</span>
|
|
420
|
+
{STATES.map(state => (
|
|
421
|
+
<FodsFamily key={state.label} name={family.key}>
|
|
422
|
+
{family.emotion === 'neutral' ? (
|
|
423
|
+
<FilterChip
|
|
424
|
+
count={14}
|
|
425
|
+
value={family.selected ? 'Praha' : undefined}
|
|
426
|
+
clearLabel="Zrušit filtr Kraj"
|
|
427
|
+
className={forceClass(family.key, state.force)}
|
|
428
|
+
{...state.props}
|
|
429
|
+
>
|
|
430
|
+
Kraj
|
|
431
|
+
</FilterChip>
|
|
432
|
+
) : (
|
|
433
|
+
<FilterChip
|
|
434
|
+
type="toggle"
|
|
435
|
+
emotion={family.emotion}
|
|
436
|
+
leadingIcon={BADGE_STATUS_ICONS[family.emotion]}
|
|
437
|
+
count={2}
|
|
438
|
+
checked={family.selected}
|
|
439
|
+
className={forceClass(family.key, state.force)}
|
|
440
|
+
{...state.props}
|
|
441
|
+
>
|
|
442
|
+
{family.emotion === 'warning' ? 'Nespolehlivý DPH' : 'Insolvence'}
|
|
443
|
+
</FilterChip>
|
|
444
|
+
)}
|
|
445
|
+
</FodsFamily>
|
|
446
|
+
))}
|
|
447
|
+
</Fragment>
|
|
448
|
+
))}
|
|
449
|
+
</div>
|
|
450
|
+
<div className="grid grid-cols-[11rem_repeat(4,minmax(0,1fr))] items-center gap-400">
|
|
451
|
+
<span className="text-body-sm text-text-secondary">Neutral · Selected — focus on ×</span>
|
|
452
|
+
{/* Lined up under the Focus column of the grid above. */}
|
|
453
|
+
<span />
|
|
454
|
+
<span />
|
|
455
|
+
<FodsFamily name="neutral-selected">
|
|
456
|
+
<FilterChip
|
|
457
|
+
count={14}
|
|
458
|
+
value="Praha"
|
|
459
|
+
clearLabel="Zrušit filtr Kraj"
|
|
460
|
+
className={FILTER_CHIP_FORCE_CLEAR_RING}
|
|
461
|
+
>
|
|
462
|
+
Kraj
|
|
463
|
+
</FilterChip>
|
|
464
|
+
</FodsFamily>
|
|
465
|
+
</div>
|
|
466
|
+
<p className="max-w-[65ch] text-body-sm text-text-secondary">
|
|
467
|
+
The Focus column forces the ring on the <strong>pill</strong>, which is where it lives
|
|
468
|
+
whenever the chip body holds focus. On a Selected Facet the real ring can instead belong
|
|
469
|
+
to the <strong>×</strong> — the only other element that holds DOM focus — which rings
|
|
470
|
+
itself in <code>--outline-focus-inverse</code>; the last row forces that ring. The ring is
|
|
471
|
+
never on both at once.
|
|
472
|
+
</p>
|
|
473
|
+
</Section>
|
|
474
|
+
</Showcase>
|
|
475
|
+
),
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
export const Morph: Story = {
|
|
479
|
+
args: { children: 'Kraj' },
|
|
480
|
+
parameters: {
|
|
481
|
+
docs: {
|
|
482
|
+
description: {
|
|
483
|
+
story:
|
|
484
|
+
'A Facet morphs **in place**: one node in both directions. The category noun is replaced by the applied value, the caret becomes a clearing ×, and the count node disappears entirely — since 1.3.0 `Show count` is absent on the whole Facet type, in both selections: an unselected Facet category is not appliable, and a selected one has replaced the option list with a value. The × returns the chip to its bare trigger; it never removes the control. The container\'s colours transition over `--duration-instant` while the content swap is instant, and `prefers-reduced-motion` makes the whole thing instant. In Figma every Selected variant also carries a transparent 1px inside stroke purely for width parity — in code the hairline is a `::before` overlay that takes no layout, so both selections already measure the same box and no such device is needed. Click a chip below to apply a value, then the × to clear it.',
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
render: function MorphStory() {
|
|
489
|
+
const [region, setRegion] = useState<string | undefined>(undefined);
|
|
490
|
+
const [form, setForm] = useState<string | undefined>('s.r.o.');
|
|
491
|
+
|
|
492
|
+
return (
|
|
493
|
+
<Showcase>
|
|
494
|
+
<Section title="Unselected ↔ Selected — the same node in both directions">
|
|
495
|
+
<FilterChip
|
|
496
|
+
leadingIcon="map-pin"
|
|
497
|
+
count={14}
|
|
498
|
+
value={region}
|
|
499
|
+
clearLabel="Zrušit filtr Kraj"
|
|
500
|
+
onClear={() => setRegion(undefined)}
|
|
501
|
+
onClick={() => setRegion(current => (current == null ? 'Praha' : current))}
|
|
502
|
+
>
|
|
503
|
+
Kraj
|
|
504
|
+
</FilterChip>
|
|
505
|
+
<FilterChip
|
|
506
|
+
leadingIcon="buildings"
|
|
507
|
+
count={8}
|
|
508
|
+
value={form}
|
|
509
|
+
clearLabel="Zrušit filtr Právní forma"
|
|
510
|
+
onClear={() => setForm(undefined)}
|
|
511
|
+
onClick={() => setForm(current => (current == null ? 's.r.o.' : current))}
|
|
512
|
+
>
|
|
513
|
+
Právní forma
|
|
514
|
+
</FilterChip>
|
|
515
|
+
</Section>
|
|
516
|
+
<Section title="Disabled + Selected — the × still renders, natively disabled">
|
|
517
|
+
<FilterChip disabled value="Praha" leadingIcon="map-pin" clearLabel="Zrušit filtr Kraj">
|
|
518
|
+
Kraj
|
|
519
|
+
</FilterChip>
|
|
520
|
+
<FilterChip disabled leadingIcon="map-pin" count={14} clearLabel="Zrušit filtr Kraj">
|
|
521
|
+
Kraj
|
|
522
|
+
</FilterChip>
|
|
523
|
+
</Section>
|
|
524
|
+
<p className="max-w-[65ch] text-body-sm text-text-secondary">
|
|
525
|
+
The whole chip is one inert control when disabled — the × has no tab stop, no hover and
|
|
526
|
+
no action. Clearing a disabled applied facet happens through the bar's{' '}
|
|
527
|
+
<em>Vymazat</em>, never through the disabled ×.
|
|
528
|
+
</p>
|
|
529
|
+
</Showcase>
|
|
530
|
+
);
|
|
531
|
+
},
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
export const Motion: Story = {
|
|
535
|
+
args: { children: 'Kraj' },
|
|
536
|
+
parameters: {
|
|
537
|
+
docs: {
|
|
538
|
+
description: {
|
|
539
|
+
story:
|
|
540
|
+
'Caret motion (manifest 1.13.1 `motion.states.open`) — click a Facet to toggle `open`. Its caret turns 180° (down → up) on `--spring-standard` while the panel is open and back on close; click twice quickly and it turns around mid-turn without a jerk (`motion.interrupt`). The panel itself is not drawn here — the chip owns only the caret and `aria-expanded`. Under `prefers-reduced-motion: reduce` (emulate it in DevTools → Rendering) the caret turns without the spring — it shows its end pose at once.',
|
|
541
|
+
},
|
|
542
|
+
},
|
|
543
|
+
},
|
|
544
|
+
render: function MotionStory() {
|
|
545
|
+
const [regionOpen, setRegionOpen] = useState(false);
|
|
546
|
+
const [fieldOpen, setFieldOpen] = useState(false);
|
|
547
|
+
|
|
548
|
+
return (
|
|
549
|
+
<Showcase>
|
|
550
|
+
<Section title="Click to toggle open">
|
|
551
|
+
<FilterChip
|
|
552
|
+
leadingIcon="map-pin"
|
|
553
|
+
open={regionOpen}
|
|
554
|
+
clearLabel="Zrušit filtr Kraj"
|
|
555
|
+
onClick={() => setRegionOpen(current => !current)}
|
|
556
|
+
>
|
|
557
|
+
Kraj
|
|
558
|
+
</FilterChip>
|
|
559
|
+
<FilterChip
|
|
560
|
+
size="sm"
|
|
561
|
+
leadingIcon="briefcase"
|
|
562
|
+
open={fieldOpen}
|
|
563
|
+
clearLabel="Zrušit filtr Obor činnosti"
|
|
564
|
+
onClick={() => setFieldOpen(current => !current)}
|
|
565
|
+
>
|
|
566
|
+
Obor činnosti
|
|
567
|
+
</FilterChip>
|
|
568
|
+
</Section>
|
|
569
|
+
</Showcase>
|
|
570
|
+
);
|
|
571
|
+
},
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
export const Count: Story = {
|
|
575
|
+
args: { children: 'Plátce DPH' },
|
|
576
|
+
parameters: {
|
|
577
|
+
docs: {
|
|
578
|
+
description: {
|
|
579
|
+
story:
|
|
580
|
+
'The count is a **live result count under the current query**, rendered as a bare locale-formatted integer after the label at the same size in Regular weight — weight alone is what separates the value from its metadata on a solid fill. **Zero renders**: it is an answer, not an absence, so it is never hidden and never wrapped in parentheses. Its ink is `--text-secondary` on outline chrome and the family\'s own label foreground on a solid fill. It is folded into the accessible name — a screen reader hears "Plátce DPH, 18", not a visual-only suffix — through an `aria-label` composed in the same render as the visible runs, because leaving it to the name calculation over the label and count nodes joins them with a space and produces "Plátce DPH , 18". **It is a Toggle affordance**: manifest 1.3.0 makes the count structurally absent on a Facet in BOTH selection states — a count answers "how many rows if I apply THIS", and a category is not appliable, while an applied value has already replaced the option list. The per-option counts live on the panel rows. `showCount` therefore only turns the run off on a Toggle.',
|
|
581
|
+
},
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
render: () => (
|
|
585
|
+
<Showcase>
|
|
586
|
+
<Section title="Counts, including zero">
|
|
587
|
+
<FilterChip type="toggle" leadingIcon="shield-check" count={18}>
|
|
588
|
+
Plátce DPH
|
|
589
|
+
</FilterChip>
|
|
590
|
+
<FilterChip type="toggle" leadingIcon="shield-check" count={0}>
|
|
591
|
+
Plátce DPH
|
|
592
|
+
</FilterChip>
|
|
593
|
+
<FilterChip type="toggle" leadingIcon="shield-check" count={1284}>
|
|
594
|
+
Plátce DPH
|
|
595
|
+
</FilterChip>
|
|
596
|
+
</Section>
|
|
597
|
+
<Section title="On a solid fill the count takes the label's foreground">
|
|
598
|
+
<FilterChip type="toggle" leadingIcon="shield-check" count={18} defaultChecked>
|
|
599
|
+
Plátce DPH
|
|
600
|
+
</FilterChip>
|
|
601
|
+
<FilterChip
|
|
602
|
+
type="toggle"
|
|
603
|
+
emotion="warning"
|
|
604
|
+
leadingIcon="warning"
|
|
605
|
+
count={2}
|
|
606
|
+
defaultChecked
|
|
607
|
+
>
|
|
608
|
+
Nespolehlivý DPH
|
|
609
|
+
</FilterChip>
|
|
610
|
+
</Section>
|
|
611
|
+
<Section title="showCount={false} — a deliberately compact bar">
|
|
612
|
+
<FilterChip type="toggle" leadingIcon="shield-check" count={18} showCount={false}>
|
|
613
|
+
Plátce DPH
|
|
614
|
+
</FilterChip>
|
|
615
|
+
</Section>
|
|
616
|
+
<Section title="A Facet renders no count — with or without one passed (manifest 1.3.0)">
|
|
617
|
+
<FilterChip leadingIcon="map-pin" count={14} clearLabel="Zrušit filtr Kraj">
|
|
618
|
+
Kraj
|
|
619
|
+
</FilterChip>
|
|
620
|
+
<FilterChip leadingIcon="map-pin" count={14} value="Praha" clearLabel="Zrušit filtr Kraj">
|
|
621
|
+
Kraj
|
|
622
|
+
</FilterChip>
|
|
623
|
+
</Section>
|
|
624
|
+
</Showcase>
|
|
625
|
+
),
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
export const LeadingGlyph: Story = {
|
|
629
|
+
args: { children: 'Kraj' },
|
|
630
|
+
parameters: {
|
|
631
|
+
docs: {
|
|
632
|
+
description: {
|
|
633
|
+
story:
|
|
634
|
+
'The leading glyph is a **scanning cue, not decoration**: it repeats what the chip filters by, so the family tint is never the only thing carrying that meaning. Swap it to the facet\'s category or to the flag\'s risk class, reusing Badge\'s emotion→glyph map so one risk reads identically in a badge and in a chip. The `funnel-simple` default is generic but never wrong — do not ship it on a shipped screen, and never pick a glyph that contradicts the label. It is `aria-hidden`; the label carries the meaning. Passing `leadingIcon={null}` hides it — only where the row has no room for icon + label (manifest 1.12.0 icon rule) — and the left padding then returns to the base `--space-500` because there is no affordance to pad against. Upstream names `map-pin`, `briefcase` and `warning-circle`; all three render under those names.',
|
|
635
|
+
},
|
|
636
|
+
},
|
|
637
|
+
},
|
|
638
|
+
render: () => (
|
|
639
|
+
<Showcase>
|
|
640
|
+
<Section title="Facet categories">
|
|
641
|
+
{REGISTER_FACETS.map(facet => (
|
|
642
|
+
<FilterChip
|
|
643
|
+
key={facet.label}
|
|
644
|
+
leadingIcon={facet.icon}
|
|
645
|
+
count={facet.count}
|
|
646
|
+
value={facet.value}
|
|
647
|
+
clearLabel={`Zrušit filtr ${facet.label}`}
|
|
648
|
+
>
|
|
649
|
+
{facet.label}
|
|
650
|
+
</FilterChip>
|
|
651
|
+
))}
|
|
652
|
+
</Section>
|
|
653
|
+
<Section title="Toggle risk classes — Badge's emotion→glyph map">
|
|
654
|
+
{REGISTER_FLAGS.map(flag => (
|
|
655
|
+
<FilterChip
|
|
656
|
+
key={flag.label}
|
|
657
|
+
type="toggle"
|
|
658
|
+
emotion={flag.emotion}
|
|
659
|
+
leadingIcon={flag.icon}
|
|
660
|
+
count={flag.count}
|
|
661
|
+
>
|
|
662
|
+
{flag.label}
|
|
663
|
+
</FilterChip>
|
|
664
|
+
))}
|
|
665
|
+
</Section>
|
|
666
|
+
<Section title="leadingIcon={null} — the left padding returns to the base 12">
|
|
667
|
+
<FilterChip type="toggle" leadingIcon={null} count={18}>
|
|
668
|
+
Plátce DPH
|
|
669
|
+
</FilterChip>
|
|
670
|
+
<FilterChip leadingIcon={null} count={14} clearLabel="Zrušit filtr Kraj">
|
|
671
|
+
Kraj
|
|
672
|
+
</FilterChip>
|
|
673
|
+
</Section>
|
|
674
|
+
</Showcase>
|
|
675
|
+
),
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
export const MultiValue: Story = {
|
|
679
|
+
args: { children: 'Dodavatel' },
|
|
680
|
+
parameters: {
|
|
681
|
+
docs: {
|
|
682
|
+
description: {
|
|
683
|
+
story:
|
|
684
|
+
'One facet, several values. Within a facet the values **OR** together (across facets they AND), and this is deliberately **not** a new variant — the chip is unchanged and the label carries it, collapsing to `value +N`. The `+N` form is mandatory over "Dodavatel: 3": it keeps a concrete value on screen, which is the whole point of the morph, and it sidesteps Czech numeral agreement (2 dodavatelé / 5 dodavatelů). Because `+2` is an **elision**, it is never the sole carrier — the elided values are listed in a Tooltip on the trigger and the accessible name carries the full list with the category in front ("Dodavatel: Čistota Plus, Datacentrum Sever, Pekárna Růžička"). The collapsed case therefore needs a `TooltipProvider` ancestor, the same requirement Chip\'s info slot carries; the story mounts one. A facet that applies several values opens a Multi-select filter group that focus moves into, so its trigger takes `popup="dialog"` (manifest 1.7.0): a plain button with `aria-haspopup="dialog"`, no combobox role and no `aria-activedescendant`. A numeric range facet (Field Pair panel, focus moves into the first field) takes `popup="dialog"` too (manifest 1.11.0) — its panel holds no list. The pill itself is identical.',
|
|
685
|
+
},
|
|
686
|
+
},
|
|
687
|
+
},
|
|
688
|
+
render: function MultiValueStory() {
|
|
689
|
+
const suppliers = ['Čistota Plus', 'Datacentrum Sever', 'Pekárna Růžička'];
|
|
690
|
+
return (
|
|
691
|
+
<TooltipProvider>
|
|
692
|
+
<Showcase>
|
|
693
|
+
<Section title="One value — the label IS the value, no elision to explain">
|
|
694
|
+
<FilterChip
|
|
695
|
+
leadingIcon="buildings"
|
|
696
|
+
value={suppliers[0]}
|
|
697
|
+
clearLabel="Zrušit filtr Dodavatel"
|
|
698
|
+
>
|
|
699
|
+
Dodavatel
|
|
700
|
+
</FilterChip>
|
|
701
|
+
</Section>
|
|
702
|
+
<Section title="Several values — first value + remainder, Tooltip carries the rest">
|
|
703
|
+
<FilterChip
|
|
704
|
+
leadingIcon="buildings"
|
|
705
|
+
value={suppliers.slice(0, 2)}
|
|
706
|
+
clearLabel="Zrušit filtr Dodavatel"
|
|
707
|
+
>
|
|
708
|
+
Dodavatel
|
|
709
|
+
</FilterChip>
|
|
710
|
+
<FilterChip
|
|
711
|
+
leadingIcon="buildings"
|
|
712
|
+
value={suppliers}
|
|
713
|
+
clearLabel="Zrušit filtr Dodavatel"
|
|
714
|
+
>
|
|
715
|
+
Dodavatel
|
|
716
|
+
</FilterChip>
|
|
717
|
+
</Section>
|
|
718
|
+
<Section title='popup="dialog" — the multi-value facet trigger: a plain button, not a combobox'>
|
|
719
|
+
<FilterChip leadingIcon="buildings" popup="dialog" clearLabel="Zrušit filtr Dodavatel">
|
|
720
|
+
Dodavatel
|
|
721
|
+
</FilterChip>
|
|
722
|
+
<FilterChip
|
|
723
|
+
leadingIcon="buildings"
|
|
724
|
+
popup="dialog"
|
|
725
|
+
value={suppliers}
|
|
726
|
+
clearLabel="Zrušit filtr Dodavatel"
|
|
727
|
+
>
|
|
728
|
+
Dodavatel
|
|
729
|
+
</FilterChip>
|
|
730
|
+
</Section>
|
|
731
|
+
<Section title='A range is a facet too — one label, the unit stated once; popup="dialog", the panel holds no list'>
|
|
732
|
+
<FilterChip
|
|
733
|
+
leadingIcon="funnel-simple"
|
|
734
|
+
popup="dialog"
|
|
735
|
+
value={'od 500\u00a0Kč'}
|
|
736
|
+
clearLabel="Zrušit filtr Částka"
|
|
737
|
+
>
|
|
738
|
+
Částka
|
|
739
|
+
</FilterChip>
|
|
740
|
+
<FilterChip
|
|
741
|
+
leadingIcon="funnel-simple"
|
|
742
|
+
popup="dialog"
|
|
743
|
+
value={'500\u00a0– 5\u00a0000\u00a0Kč'}
|
|
744
|
+
clearLabel="Zrušit filtr Částka"
|
|
745
|
+
>
|
|
746
|
+
Částka
|
|
747
|
+
</FilterChip>
|
|
748
|
+
</Section>
|
|
749
|
+
</Showcase>
|
|
750
|
+
</TooltipProvider>
|
|
751
|
+
);
|
|
752
|
+
},
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
export const FilterBar: Story = {
|
|
756
|
+
args: { children: 'Kraj' },
|
|
757
|
+
parameters: {
|
|
758
|
+
docs: {
|
|
759
|
+
description: {
|
|
760
|
+
story:
|
|
761
|
+
'The shape FilterChip actually ships in: the `/firmy` public-register filter bar, running `sm` because the row is long — three facets, three risk flags and a clear action. Each chip is its own tab stop; the facets are controlled by the page, and the options panel a facet opens is **not** part of this component (it is the Popover / Filter Facet assembly). The bar-level reset stays a composition concern beside the chips, not a chip affordance — and it is the only way to clear a disabled applied facet.',
|
|
762
|
+
},
|
|
763
|
+
},
|
|
764
|
+
},
|
|
765
|
+
render: function FilterBarStory() {
|
|
766
|
+
const [facets, setFacets] = useState<Record<string, string | undefined>>({
|
|
767
|
+
Kraj: 'Praha',
|
|
768
|
+
'Obor činnosti': undefined,
|
|
769
|
+
'Právní forma': undefined,
|
|
770
|
+
});
|
|
771
|
+
const [flags, setFlags] = useState<string[]>(['Plátce DPH']);
|
|
772
|
+
|
|
773
|
+
const applied = Object.values(facets).some(value => value != null) || flags.length > 0;
|
|
774
|
+
|
|
775
|
+
return (
|
|
776
|
+
<Showcase>
|
|
777
|
+
<Section title="/firmy register bar (sm)">
|
|
778
|
+
{REGISTER_FACETS.map(facet => (
|
|
779
|
+
<FilterChip
|
|
780
|
+
key={facet.label}
|
|
781
|
+
size="sm"
|
|
782
|
+
leadingIcon={facet.icon}
|
|
783
|
+
count={facet.count}
|
|
784
|
+
value={facets[facet.label]}
|
|
785
|
+
// A real consumer builds this from its translation layer, e.g.
|
|
786
|
+
// `t('filters.clear', { facet: facet.label })` — it names the FACET, so
|
|
787
|
+
// a bar of chips does not announce "Zrušit filtr" over and over.
|
|
788
|
+
clearLabel={`Zrušit filtr ${facet.label}`}
|
|
789
|
+
onClear={() => setFacets(prev => ({ ...prev, [facet.label]: undefined }))}
|
|
790
|
+
onClick={() =>
|
|
791
|
+
setFacets(prev => ({
|
|
792
|
+
...prev,
|
|
793
|
+
[facet.label]: prev[facet.label] == null ? 'Praha' : prev[facet.label],
|
|
794
|
+
}))
|
|
795
|
+
}
|
|
796
|
+
>
|
|
797
|
+
{facet.label}
|
|
798
|
+
</FilterChip>
|
|
799
|
+
))}
|
|
800
|
+
{REGISTER_FLAGS.map(flag => (
|
|
801
|
+
<FilterChip
|
|
802
|
+
key={flag.label}
|
|
803
|
+
type="toggle"
|
|
804
|
+
size="sm"
|
|
805
|
+
emotion={flag.emotion}
|
|
806
|
+
leadingIcon={flag.icon}
|
|
807
|
+
count={flag.count}
|
|
808
|
+
checked={flags.includes(flag.label)}
|
|
809
|
+
onCheckedChange={checked =>
|
|
810
|
+
setFlags(prev =>
|
|
811
|
+
checked ? [...prev, flag.label] : prev.filter(item => item !== flag.label),
|
|
812
|
+
)
|
|
813
|
+
}
|
|
814
|
+
>
|
|
815
|
+
{flag.label}
|
|
816
|
+
</FilterChip>
|
|
817
|
+
))}
|
|
818
|
+
</Section>
|
|
819
|
+
<p className="max-w-[65ch] text-body-sm text-text-secondary">
|
|
820
|
+
{applied
|
|
821
|
+
? 'Some filters are applied — the bar-level Vymazat (a Tertiary Button beside the chips) resets all of them at once.'
|
|
822
|
+
: 'No filters applied.'}
|
|
823
|
+
</p>
|
|
824
|
+
</Showcase>
|
|
825
|
+
);
|
|
826
|
+
},
|
|
827
|
+
};
|