@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,674 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import { expect, userEvent, waitFor, within } from 'storybook/test';
|
|
5
|
+
import { cs } from 'date-fns/locale/cs';
|
|
6
|
+
import { enUS } from 'date-fns/locale/en-US';
|
|
7
|
+
import { nl } from 'date-fns/locale/nl';
|
|
8
|
+
import { TextField } from './TextField';
|
|
9
|
+
import { Field } from '../field/Field';
|
|
10
|
+
import type { TextFieldBaseProps, TextFieldInputType } from './TextField';
|
|
11
|
+
import { Section, Showcase } from '../../storybook/Section';
|
|
12
|
+
import { componentDoc } from '../../storybook/componentDoc';
|
|
13
|
+
import { FORCE_ERROR_FOCUS, FieldErrorFocusStyles } from '../../storybook/forceStates';
|
|
14
|
+
|
|
15
|
+
// TextFieldProps ties `onTrailingIconClick` to a required `trailingIconLabel` via
|
|
16
|
+
// a union, which CSF's `Args` machinery can't resolve. Type the stories against
|
|
17
|
+
// the base props; the interactive-button stories set both in their render body
|
|
18
|
+
// against the real component, where the contract is enforced.
|
|
19
|
+
type TextFieldStoryArgs = TextFieldBaseProps;
|
|
20
|
+
|
|
21
|
+
const SIZES = ['md', 'sm'] as const;
|
|
22
|
+
const STATES = ['default', 'focused', 'error', 'success', 'disabled', 'readonly'] as const;
|
|
23
|
+
// The plain field's types (manifest delivery.react); `date` has its own stories.
|
|
24
|
+
const TYPES = ['text', 'email', 'tel', 'url', 'search', 'password', 'numeric'] as const satisfies readonly TextFieldInputType[];
|
|
25
|
+
// Manifest `axes.content` — Figma calls it "Has value" (True/False). It is not a
|
|
26
|
+
// prop: content IS the presence of a value, so each cell is described by the
|
|
27
|
+
// props it renders with (`placeholder` for Empty, `defaultValue` for Filled).
|
|
28
|
+
// Covered by the ContentMatrix story below.
|
|
29
|
+
const CONTENTS = ['empty', 'filled'] as const;
|
|
30
|
+
|
|
31
|
+
// The bare atoms below stand outside a `Field`, so nothing labels them: each takes an
|
|
32
|
+
// `aria-label` instead (a label is always present — text-field.md § Copy).
|
|
33
|
+
const LABEL = 'Název firmy';
|
|
34
|
+
const SEARCH_LABEL = 'Hledat';
|
|
35
|
+
const PASSWORD_LABEL = 'Heslo';
|
|
36
|
+
|
|
37
|
+
// type="date": the market's format + locale, the calendar dialog name and its four
|
|
38
|
+
// chevron names are all required — the field is market-agnostic and the consumer
|
|
39
|
+
// owns them. Storybook is the consumer here, Czech by default. The interactive Date
|
|
40
|
+
// demos start on today's date — a designer should see today's calendar; the static
|
|
41
|
+
// matrix and the open-panel story pin one, so their render does not change by day.
|
|
42
|
+
const today = new Date();
|
|
43
|
+
const FIXED_DATE = new Date(2026, 3, 15);
|
|
44
|
+
const DATE_LABEL = 'Datum vystavení';
|
|
45
|
+
const DATE_CS = {
|
|
46
|
+
dateFormat: 'dd. MM. yyyy',
|
|
47
|
+
locale: cs,
|
|
48
|
+
panelLabel: 'Kalendář',
|
|
49
|
+
navLabels: {
|
|
50
|
+
previousMonth: 'Předchozí měsíc',
|
|
51
|
+
nextMonth: 'Další měsíc',
|
|
52
|
+
previousYear: 'Předchozí rok',
|
|
53
|
+
nextYear: 'Další rok',
|
|
54
|
+
},
|
|
55
|
+
} as const;
|
|
56
|
+
|
|
57
|
+
const Frame = ({ children }: { children: ReactNode }) => (
|
|
58
|
+
<div className="w-[calc(var(--space-1200)*4)]">{children}</div>
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const meta = {
|
|
62
|
+
title: 'Design System/Atoms/TextField',
|
|
63
|
+
component: TextField,
|
|
64
|
+
parameters: {
|
|
65
|
+
layout: 'centered',
|
|
66
|
+
containerWidth: 300,
|
|
67
|
+
docs: {
|
|
68
|
+
description: {
|
|
69
|
+
component: componentDoc({
|
|
70
|
+
summary:
|
|
71
|
+
'Single-line text input for short free-form values (name, IČO, e-mail, amount, search). The shell + value only — for a floating label, helper or error/success messaging wrap it in `Field`.',
|
|
72
|
+
useCases: [
|
|
73
|
+
'Plain text — name, IČO/DIČ, address, invoice number',
|
|
74
|
+
'`type="email"` / `"tel"` / `"url"` — semantic keyboards, no visual change',
|
|
75
|
+
'`leadingIcon="magnifying-glass"` — filter / search fields (usually placeholder-only)',
|
|
76
|
+
'`trailingIcon` + `onTrailingIconClick` — clear or password-reveal affordance',
|
|
77
|
+
'`state="readonly"` — a value the user can see and copy but not edit here',
|
|
78
|
+
'`type="date"` — a typeable date with the DS calendar: a `Date` in `value`, out through `onValueChange`; the market\'s `dateFormat` + `locale` are required (no Czech default), as are `panelLabel` / `navLabels`',
|
|
79
|
+
],
|
|
80
|
+
bestPractices: [
|
|
81
|
+
'Always wrap in `Field` and give the input an `id` — the floating `<label>` is the accessible name, never the placeholder',
|
|
82
|
+
'Use `state="readonly"` (native `readonly`) for locked values, never `disabled` — read-only stays copyable and in the tab order',
|
|
83
|
+
'Write specific, impersonal errors ("IČO musí mít 8 číslic"), not "Neplatná hodnota"',
|
|
84
|
+
'Pair `state="error"` with a matching `error` message on the `Field`',
|
|
85
|
+
'Reach for the right component — Select for a fixed set, Textarea for multi-line; a date is `type="date"` here, never a separate field',
|
|
86
|
+
],
|
|
87
|
+
knownIssues: [
|
|
88
|
+
'Error uses `warning-circle`, Success uses `check` (not the spec `check-circle`) in the trailing slot',
|
|
89
|
+
'Focus is a 1px border-colour swap with no ring (per the spec) — borderline for WCAG 2.4.11; thicken the border if visibility becomes an issue, do not re-add a ring',
|
|
90
|
+
],
|
|
91
|
+
docsLink: { label: 'spec/03-atoms/text-field.md' },
|
|
92
|
+
}),
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
} satisfies Meta<TextFieldStoryArgs>;
|
|
97
|
+
|
|
98
|
+
export default meta;
|
|
99
|
+
type Story = StoryObj<TextFieldStoryArgs>;
|
|
100
|
+
|
|
101
|
+
export const Playground: Story = {
|
|
102
|
+
args: {
|
|
103
|
+
type: 'text',
|
|
104
|
+
placeholder: 'Value',
|
|
105
|
+
size: 'md',
|
|
106
|
+
state: 'default',
|
|
107
|
+
},
|
|
108
|
+
argTypes: {
|
|
109
|
+
type: { control: 'select', options: TYPES },
|
|
110
|
+
size: { control: 'select', options: SIZES },
|
|
111
|
+
state: { control: 'select', options: STATES },
|
|
112
|
+
placeholder: { control: 'text' },
|
|
113
|
+
leadingIcon: { control: 'text' },
|
|
114
|
+
trailingIcon: { control: 'text' },
|
|
115
|
+
},
|
|
116
|
+
parameters: {
|
|
117
|
+
docs: {
|
|
118
|
+
description: {
|
|
119
|
+
story:
|
|
120
|
+
'The plain field — `type` covers text / email / tel / url / search / password / numeric (a right-aligned text input with the numeric keyboard). `type="date"` is not in the control: it swaps the value to a `Date` and requires `dateFormat`, `locale` and `navLabels`, so it has its own Playground (Date — Playground) and stories (Date, Date — Open, Date — Matrix).',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
/*
|
|
125
|
+
* Wrapped in `Field`, which is how the component actually ships: the floating
|
|
126
|
+
* label is the real <label> and is what gives the input its accessible name
|
|
127
|
+
* (WCAG 4.1.2), and the helper line is what `aria-describedby` resolves to, so
|
|
128
|
+
* the Error state announces its message (WCAG 3.3.1). A bare <TextField> in the
|
|
129
|
+
* Playground rendered neither, and the runtime a11y pass was right to flag it.
|
|
130
|
+
* The error message is tied to the `state` arg so the wiring appears exactly
|
|
131
|
+
* when `aria-invalid` does.
|
|
132
|
+
*/
|
|
133
|
+
render: args => (
|
|
134
|
+
<Frame>
|
|
135
|
+
<Field
|
|
136
|
+
label="Číslo faktury"
|
|
137
|
+
// `optional-tag` is a measured part; without an optionalLabel it never renders
|
|
138
|
+
// and the runtime pass reports it as absent in every state.
|
|
139
|
+
optionalLabel="Volitelný"
|
|
140
|
+
error={args.state === 'error' ? 'Číslo faktury je povinné.' : undefined}
|
|
141
|
+
success={args.state === 'success' ? 'Číslo je volné.' : undefined}
|
|
142
|
+
helperText={
|
|
143
|
+
args.state === 'error' || args.state === 'success' ? undefined : 'Například 2026001.'
|
|
144
|
+
}
|
|
145
|
+
>
|
|
146
|
+
<TextField id="playground-text-field" {...args} />
|
|
147
|
+
</Field>
|
|
148
|
+
</Frame>
|
|
149
|
+
),
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export const Matrix: Story = {
|
|
153
|
+
parameters: {
|
|
154
|
+
docs: {
|
|
155
|
+
description: {
|
|
156
|
+
story:
|
|
157
|
+
'Full state × size matrix — mirrors the Figma labelled grid. Rows = states, columns = sizes. Error/Success carry the trailing status icon; Disabled and Read-only keep the `--outline-default` border — Disabled on the `--disabled-background` fill with all ink dimmed, Read-only on the `--bg-readonly` fill with the value at full contrast (`--text-primary`).',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
render: () => (
|
|
162
|
+
<Showcase>
|
|
163
|
+
{STATES.map(state => (
|
|
164
|
+
<Section key={state} title={state} layout="row">
|
|
165
|
+
{SIZES.map(size => (
|
|
166
|
+
<div key={size} className="w-[calc(var(--space-1100)*5)]">
|
|
167
|
+
<TextField aria-label={LABEL} state={state} size={size} defaultValue="Value" />
|
|
168
|
+
</div>
|
|
169
|
+
))}
|
|
170
|
+
</Section>
|
|
171
|
+
))}
|
|
172
|
+
</Showcase>
|
|
173
|
+
),
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export const ContentMatrix: Story = {
|
|
177
|
+
name: 'Matrix (state × content)',
|
|
178
|
+
parameters: {
|
|
179
|
+
docs: {
|
|
180
|
+
description: {
|
|
181
|
+
story:
|
|
182
|
+
'Manifest `axes.content` (Figma **Has value**) × state, both at `md` — the size axis is covered by `Matrix`. Rows = states, columns = content: **Empty** on the left (the placeholder run, `--text-placeholder`) and **Filled** on the right (the value, `--text-primary`). On Disabled the placeholder is replaced by an en dash `–` in `--disabled-foreground`. Per the manifest a Read-only field exists only *with* a value, so the Read-only row has no Empty cell. The label-float side of this axis needs the `Field` wrapper — see `WithLabel`.',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
render: () => (
|
|
187
|
+
<Showcase>
|
|
188
|
+
{STATES.map(state => (
|
|
189
|
+
<Section key={state} title={state} layout="row">
|
|
190
|
+
{CONTENTS.filter(content => content === 'filled' || state !== 'readonly').map(content => (
|
|
191
|
+
<div key={content} className="w-[calc(var(--space-1100)*5)]">
|
|
192
|
+
<TextField aria-label={LABEL}
|
|
193
|
+
state={state}
|
|
194
|
+
size="md"
|
|
195
|
+
{...(content === 'filled'
|
|
196
|
+
? { defaultValue: 'Hodnota' }
|
|
197
|
+
: { placeholder: 'Placeholder' })}
|
|
198
|
+
/>
|
|
199
|
+
</div>
|
|
200
|
+
))}
|
|
201
|
+
</Section>
|
|
202
|
+
))}
|
|
203
|
+
</Showcase>
|
|
204
|
+
),
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export const Sizes: Story = {
|
|
208
|
+
parameters: {
|
|
209
|
+
docs: { description: { story: '`md` (48) — standard forms · `sm` (40) — dense rows, filter bars. Pick by density.' } },
|
|
210
|
+
},
|
|
211
|
+
render: () => (
|
|
212
|
+
<Showcase>
|
|
213
|
+
<Section title="md (default)" layout="column">
|
|
214
|
+
<Frame><TextField aria-label={LABEL} size="md" defaultValue="Value" /></Frame>
|
|
215
|
+
<Frame><TextField aria-label={LABEL} size="md" placeholder="Placeholder" /></Frame>
|
|
216
|
+
</Section>
|
|
217
|
+
<Section title="sm" layout="column">
|
|
218
|
+
<Frame><TextField aria-label={LABEL} size="sm" defaultValue="Value" /></Frame>
|
|
219
|
+
<Frame><TextField aria-label={LABEL} size="sm" placeholder="Placeholder" /></Frame>
|
|
220
|
+
</Section>
|
|
221
|
+
</Showcase>
|
|
222
|
+
),
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export const States: Story = {
|
|
226
|
+
parameters: {
|
|
227
|
+
docs: { description: { story: 'All six visual states. Read-only ≠ Disabled — read-only is informative (a locked/computed value), disabled is not applicable. Error + focus keeps the `--status-danger` border and thickens it to `--border-width-200` inside the shell; `--outline-focus` never shows on an invalid field (forced statically below — focus is runtime-only).' } },
|
|
228
|
+
},
|
|
229
|
+
render: () => (
|
|
230
|
+
<Showcase>
|
|
231
|
+
<FieldErrorFocusStyles />
|
|
232
|
+
<Section title="Editable" layout="column">
|
|
233
|
+
<Frame><TextField aria-label={LABEL} state="default" defaultValue="Value" /></Frame>
|
|
234
|
+
<Frame><TextField aria-label={LABEL} state="focused" defaultValue="Value" /></Frame>
|
|
235
|
+
<Frame><TextField aria-label={LABEL} state="error" defaultValue="Value" /></Frame>
|
|
236
|
+
<Frame><TextField aria-label={LABEL} state="success" defaultValue="Value" /></Frame>
|
|
237
|
+
</Section>
|
|
238
|
+
<Section title="Error + focus" layout="column">
|
|
239
|
+
<Frame>
|
|
240
|
+
<div className={FORCE_ERROR_FOCUS}>
|
|
241
|
+
<TextField aria-label={LABEL} state="error" defaultValue="Value" />
|
|
242
|
+
</div>
|
|
243
|
+
</Frame>
|
|
244
|
+
</Section>
|
|
245
|
+
<Section title="Non-editable" layout="column">
|
|
246
|
+
<Frame><TextField aria-label={LABEL} state="disabled" defaultValue="Value" /></Frame>
|
|
247
|
+
<Frame><TextField aria-label={LABEL} state="readonly" defaultValue="Value" /></Frame>
|
|
248
|
+
</Section>
|
|
249
|
+
</Showcase>
|
|
250
|
+
),
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
export const WithIcons: Story = {
|
|
254
|
+
parameters: {
|
|
255
|
+
docs: {
|
|
256
|
+
description: {
|
|
257
|
+
story:
|
|
258
|
+
'Leading glyph for search / filter fields; trailing affordance (interactive when `onTrailingIconClick` is set). On Error / Success the trailing slot is taken by the intrinsic status icon, so a user trailing icon shows only on Default / Focused / Disabled.',
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
render: () => (
|
|
263
|
+
<Showcase>
|
|
264
|
+
<Section title="Leading icon (search)" layout="column">
|
|
265
|
+
<Frame><TextField aria-label={SEARCH_LABEL} leadingIcon="magnifying-glass" placeholder="Hledat…" /></Frame>
|
|
266
|
+
<Frame><TextField aria-label={SEARCH_LABEL} leadingIcon="magnifying-glass" size="sm" placeholder="Hledat…" /></Frame>
|
|
267
|
+
</Section>
|
|
268
|
+
<Section title="Trailing affordance" layout="column">
|
|
269
|
+
<Frame>
|
|
270
|
+
<TextField aria-label={PASSWORD_LABEL}
|
|
271
|
+
type="password"
|
|
272
|
+
defaultValue="secret"
|
|
273
|
+
trailingIcon="eye"
|
|
274
|
+
trailingIconLabel="Zobrazit heslo"
|
|
275
|
+
onTrailingIconClick={() => {}}
|
|
276
|
+
/>
|
|
277
|
+
</Frame>
|
|
278
|
+
</Section>
|
|
279
|
+
</Showcase>
|
|
280
|
+
),
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
export const WithField: Story = {
|
|
284
|
+
parameters: {
|
|
285
|
+
docs: {
|
|
286
|
+
description: {
|
|
287
|
+
story:
|
|
288
|
+
'Real usage — wrapped in `Field` for the floating label, helper and error/success messaging. The label sits inside a calm empty field and floats once focused, filled or in error. Error + focus keeps the `--status-danger` border and thickens it to `--border-width-200` inside the shell, and the label notch widens to match; `--outline-focus` never shows on an invalid field.',
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
render: () => (
|
|
293
|
+
<Showcase>
|
|
294
|
+
<FieldErrorFocusStyles />
|
|
295
|
+
<Section title="Editable" layout="column">
|
|
296
|
+
<Frame>
|
|
297
|
+
<Field label="IČO" helperText="Najdete v hlavičce faktury">
|
|
298
|
+
<TextField id="ico" defaultValue="12345678" />
|
|
299
|
+
</Field>
|
|
300
|
+
</Frame>
|
|
301
|
+
<Frame>
|
|
302
|
+
<Field label="E-mail" optionalLabel="Volitelný">
|
|
303
|
+
<TextField id="email" type="email" placeholder="jmeno@firma.cz" />
|
|
304
|
+
</Field>
|
|
305
|
+
</Frame>
|
|
306
|
+
<Frame>
|
|
307
|
+
<Field label="IČO" error="IČO musí mít 8 číslic">
|
|
308
|
+
<TextField id="ico-err" state="error" defaultValue="1234" />
|
|
309
|
+
</Field>
|
|
310
|
+
</Frame>
|
|
311
|
+
</Section>
|
|
312
|
+
<Section title="Error + focus" layout="column">
|
|
313
|
+
<Frame>
|
|
314
|
+
<div className={FORCE_ERROR_FOCUS}>
|
|
315
|
+
<Field label="E-mail" error="Neplatná emailová adresa">
|
|
316
|
+
<TextField id="email-err-focus" type="email" state="error" defaultValue="jmeno@firma" />
|
|
317
|
+
</Field>
|
|
318
|
+
</div>
|
|
319
|
+
</Frame>
|
|
320
|
+
</Section>
|
|
321
|
+
<Section title="Locked (read-only)" layout="column">
|
|
322
|
+
<Frame>
|
|
323
|
+
<Field label="Variabilní symbol" helperText="Odvozeno z čísla faktury">
|
|
324
|
+
<TextField id="vs" state="readonly" defaultValue="20260721" />
|
|
325
|
+
</Field>
|
|
326
|
+
</Frame>
|
|
327
|
+
</Section>
|
|
328
|
+
</Showcase>
|
|
329
|
+
),
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
export const WithLabel: Story = {
|
|
333
|
+
parameters: {
|
|
334
|
+
docs: {
|
|
335
|
+
description: {
|
|
336
|
+
story:
|
|
337
|
+
'The floating label across value × state. Empty + calm keeps the label **resting inside** (placeholder position); a value, focus, error, Disabled or Read-only floats it to the top border. Every state keeps the border, so the notch is the same 1px surface-colour strip on the border line everywhere. Note: per spec a Read-only field always carries a value — the empty Read-only cell is shown only for completeness.',
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
render: () => (
|
|
342
|
+
<Showcase>
|
|
343
|
+
<Section title="Bez hodnoty (label dole)" layout="column">
|
|
344
|
+
<Frame>
|
|
345
|
+
<Field label="Popis"><TextField id="wl-empty" /></Field>
|
|
346
|
+
</Frame>
|
|
347
|
+
<Frame>
|
|
348
|
+
<Field label="Popis"><TextField id="wl-empty-dis" state="disabled" /></Field>
|
|
349
|
+
</Frame>
|
|
350
|
+
<Frame>
|
|
351
|
+
<Field label="Popis"><TextField id="wl-empty-ro" state="readonly" /></Field>
|
|
352
|
+
</Frame>
|
|
353
|
+
</Section>
|
|
354
|
+
<Section title="S hodnotou (label nahoře)" layout="column">
|
|
355
|
+
<Frame>
|
|
356
|
+
<Field label="Popis"><TextField id="wl-val" defaultValue="Hodnota" /></Field>
|
|
357
|
+
</Frame>
|
|
358
|
+
<Frame>
|
|
359
|
+
<Field label="Popis"><TextField id="wl-val-dis" state="disabled" defaultValue="Hodnota" /></Field>
|
|
360
|
+
</Frame>
|
|
361
|
+
<Frame>
|
|
362
|
+
<Field label="Popis"><TextField id="wl-val-ro" state="readonly" defaultValue="Hodnota" /></Field>
|
|
363
|
+
</Frame>
|
|
364
|
+
</Section>
|
|
365
|
+
<Section title="Stavy (error / success)" layout="column">
|
|
366
|
+
<Frame>
|
|
367
|
+
<Field label="Popis" error="IČO musí mít 8 číslic">
|
|
368
|
+
<TextField id="wl-err" state="error" defaultValue="1234" />
|
|
369
|
+
</Field>
|
|
370
|
+
</Frame>
|
|
371
|
+
<Frame>
|
|
372
|
+
<Field label="Popis" success="Vyplněno správně">
|
|
373
|
+
<TextField id="wl-ok" state="success" defaultValue="12345678" />
|
|
374
|
+
</Field>
|
|
375
|
+
</Frame>
|
|
376
|
+
</Section>
|
|
377
|
+
</Showcase>
|
|
378
|
+
),
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
export const Motion: Story = {
|
|
382
|
+
parameters: {
|
|
383
|
+
docs: {
|
|
384
|
+
description: {
|
|
385
|
+
story:
|
|
386
|
+
'Floating-label motion (manifest 2.14.0 `motion.states.value`) — click or Tab into an empty field, then leave it. The label never travels or scales: the resting label fades out on `--duration-fast` + `--easing-exit` while the floated label fades in on `--duration-normal` + `--easing-enter`, settling `--space-200` down onto the border; leaving swaps the roles (the floated label fades out, the resting one fades in, no settle). Under `prefers-reduced-motion: reduce` (emulate it in DevTools → Rendering) the label swaps pose at once, with no fade and no settle.',
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
render: () => (
|
|
391
|
+
<Showcase>
|
|
392
|
+
<Section title="Empty → focus → blur" layout="column">
|
|
393
|
+
<Frame>
|
|
394
|
+
<Field label="E-mail"><TextField id="motion-md" type="email" /></Field>
|
|
395
|
+
</Frame>
|
|
396
|
+
<Frame>
|
|
397
|
+
<Field label="Hledat" size="sm">
|
|
398
|
+
<TextField id="motion-sm" size="sm" leadingIcon="magnifying-glass" />
|
|
399
|
+
</Field>
|
|
400
|
+
</Frame>
|
|
401
|
+
</Section>
|
|
402
|
+
</Showcase>
|
|
403
|
+
),
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
// Stateful demos live in named components: a hook called straight inside a story's
|
|
407
|
+
// `render` breaks rules-of-hooks (repo convention — see ActionRow).
|
|
408
|
+
function DateDemo() {
|
|
409
|
+
const [value, setValue] = React.useState<Date | undefined>(today);
|
|
410
|
+
return (
|
|
411
|
+
<Frame>
|
|
412
|
+
<Field label={DATE_LABEL} helperText="Formát DD. MM. RRRR">
|
|
413
|
+
<TextField
|
|
414
|
+
type="date"
|
|
415
|
+
id="date-cs"
|
|
416
|
+
{...DATE_CS}
|
|
417
|
+
value={value}
|
|
418
|
+
onValueChange={setValue}
|
|
419
|
+
placeholder="DD. MM. RRRR"
|
|
420
|
+
/>
|
|
421
|
+
</Field>
|
|
422
|
+
</Frame>
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
function DateOtherMarketDemo() {
|
|
427
|
+
const [value, setValue] = React.useState<Date | undefined>(today);
|
|
428
|
+
return (
|
|
429
|
+
<Frame>
|
|
430
|
+
<Field label="Issue date" helperText="Format MM/DD/YYYY">
|
|
431
|
+
<TextField
|
|
432
|
+
type="date"
|
|
433
|
+
id="date-en-us"
|
|
434
|
+
dateFormat="MM/dd/yyyy"
|
|
435
|
+
locale={enUS}
|
|
436
|
+
panelLabel="Calendar"
|
|
437
|
+
navLabels={{
|
|
438
|
+
previousMonth: 'Previous month',
|
|
439
|
+
nextMonth: 'Next month',
|
|
440
|
+
previousYear: 'Previous year',
|
|
441
|
+
nextYear: 'Next year',
|
|
442
|
+
}}
|
|
443
|
+
value={value}
|
|
444
|
+
onValueChange={setValue}
|
|
445
|
+
placeholder="MM/DD/YYYY"
|
|
446
|
+
/>
|
|
447
|
+
</Field>
|
|
448
|
+
</Frame>
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
export const DateMode: Story = {
|
|
453
|
+
name: 'Date',
|
|
454
|
+
parameters: {
|
|
455
|
+
docs: {
|
|
456
|
+
description: {
|
|
457
|
+
story:
|
|
458
|
+
'`type="date"` — a date field is this component, not a separate one. The input stays a typeable text input (never the native date input); the leading slot carries the decorative `calendar-dots` glyph, and a click anywhere on the field opens the Single month Date Picker (ArrowDown from the keyboard moves into the grid, Esc closes and returns focus). The value is a `Date`; a typed draft is parsed in the market\'s `dateFormat` on commit (blur or Enter); one that does not parse or falls outside `minDate` / `maxDate` stays in the input and the value becomes `undefined` (see «Date — Invalid typed date»). Czech market here: `dd. MM. yyyy` + `cs`; the helper line states the format, because a placeholder disappears as soon as the user types. Inside a labelled `Field` the calendar dialog is named by that label (`aria-labelledby`); `panelLabel` is only the fallback for a field nothing visible names.',
|
|
459
|
+
},
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
render: () => <DateDemo />,
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
export const DateOtherMarket: Story = {
|
|
466
|
+
name: 'Date (another market)',
|
|
467
|
+
parameters: {
|
|
468
|
+
docs: {
|
|
469
|
+
description: {
|
|
470
|
+
story:
|
|
471
|
+
'The same field for the US market: `dateFormat="MM/dd/yyyy"` + `locale={enUS}` — the text is shown and parsed as `MM/DD/YYYY`, and the calendar starts its week on Sunday with English month and weekday names. The format and locale always come from the consumer\'s market config; the field never assumes Czech. Every text — label, helper, placeholder, the dialog and chevron names — is in the market\'s language too.',
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
render: () => <DateOtherMarketDemo />,
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
const DATE_LOCALES = { cs, enUS, nl } as const;
|
|
479
|
+
|
|
480
|
+
type DatePlaygroundArgs = {
|
|
481
|
+
dateFormat: string;
|
|
482
|
+
locale: keyof typeof DATE_LOCALES;
|
|
483
|
+
minDate?: number;
|
|
484
|
+
maxDate?: number;
|
|
485
|
+
panelLabel?: string;
|
|
486
|
+
navLabels: typeof DATE_CS.navLabels;
|
|
487
|
+
placeholder?: string;
|
|
488
|
+
size: (typeof SIZES)[number];
|
|
489
|
+
state: (typeof STATES)[number];
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
/*
|
|
493
|
+
* The date-mode props, each on a control. `minDate` / `maxDate` come from
|
|
494
|
+
* Storybook's date control as timestamps and are turned back into `Date`s; the
|
|
495
|
+
* locale control maps a name onto the date-fns Locale object.
|
|
496
|
+
*/
|
|
497
|
+
export const DatePlayground: StoryObj<DatePlaygroundArgs> = {
|
|
498
|
+
name: 'Date — Playground',
|
|
499
|
+
args: {
|
|
500
|
+
dateFormat: DATE_CS.dateFormat,
|
|
501
|
+
locale: 'cs',
|
|
502
|
+
panelLabel: DATE_CS.panelLabel,
|
|
503
|
+
navLabels: DATE_CS.navLabels,
|
|
504
|
+
placeholder: 'DD. MM. RRRR',
|
|
505
|
+
size: 'md',
|
|
506
|
+
state: 'default',
|
|
507
|
+
},
|
|
508
|
+
argTypes: {
|
|
509
|
+
dateFormat: { control: 'text' },
|
|
510
|
+
locale: { control: 'select', options: Object.keys(DATE_LOCALES) },
|
|
511
|
+
minDate: { control: 'date' },
|
|
512
|
+
maxDate: { control: 'date' },
|
|
513
|
+
panelLabel: { control: 'text' },
|
|
514
|
+
navLabels: { control: 'object' },
|
|
515
|
+
placeholder: { control: 'text' },
|
|
516
|
+
size: { control: 'select', options: SIZES },
|
|
517
|
+
state: { control: 'select', options: STATES },
|
|
518
|
+
},
|
|
519
|
+
parameters: {
|
|
520
|
+
docs: {
|
|
521
|
+
description: {
|
|
522
|
+
story:
|
|
523
|
+
'`type="date"` with every date-mode prop on a control. Change `dateFormat` and `locale` together — they are one market. Inside the labelled `Field` the calendar dialog takes the label as its name, so `panelLabel` is read only by a field nothing visible names.',
|
|
524
|
+
},
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
render: function DatePlaygroundRender({ minDate, maxDate, locale, ...args }) {
|
|
528
|
+
const [value, setValue] = React.useState<Date | undefined>();
|
|
529
|
+
return (
|
|
530
|
+
<Frame>
|
|
531
|
+
<Field label={DATE_LABEL}>
|
|
532
|
+
<TextField
|
|
533
|
+
{...args}
|
|
534
|
+
type="date"
|
|
535
|
+
id="date-playground"
|
|
536
|
+
locale={DATE_LOCALES[locale]}
|
|
537
|
+
minDate={minDate === undefined ? undefined : new Date(minDate)}
|
|
538
|
+
maxDate={maxDate === undefined ? undefined : new Date(maxDate)}
|
|
539
|
+
value={value}
|
|
540
|
+
onValueChange={setValue}
|
|
541
|
+
/>
|
|
542
|
+
</Field>
|
|
543
|
+
</Frame>
|
|
544
|
+
);
|
|
545
|
+
},
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
export const DateMatrix: Story = {
|
|
549
|
+
name: 'Date — Matrix',
|
|
550
|
+
parameters: {
|
|
551
|
+
docs: {
|
|
552
|
+
description: {
|
|
553
|
+
story:
|
|
554
|
+
'`type="date"` across state × size. Read-only keeps the calendar glyph as a quiet marker (`--icon-muted`) but never opens the panel; Disabled keeps the `--outline-default` border on the `--disabled-background` fill and dims all ink.',
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
},
|
|
558
|
+
render: () => (
|
|
559
|
+
<Showcase>
|
|
560
|
+
{STATES.map(state => (
|
|
561
|
+
<Section key={state} title={state} layout="row">
|
|
562
|
+
{SIZES.map(size => (
|
|
563
|
+
<div key={size} className="w-[calc(var(--space-1200)*5)]">
|
|
564
|
+
<TextField
|
|
565
|
+
type="date"
|
|
566
|
+
aria-label={DATE_LABEL}
|
|
567
|
+
{...DATE_CS}
|
|
568
|
+
state={state}
|
|
569
|
+
size={size}
|
|
570
|
+
value={FIXED_DATE}
|
|
571
|
+
/>
|
|
572
|
+
</div>
|
|
573
|
+
))}
|
|
574
|
+
</Section>
|
|
575
|
+
))}
|
|
576
|
+
</Showcase>
|
|
577
|
+
),
|
|
578
|
+
};
|
|
579
|
+
|
|
580
|
+
function DateOpenDemo() {
|
|
581
|
+
const [value, setValue] = React.useState<Date | undefined>(FIXED_DATE);
|
|
582
|
+
return (
|
|
583
|
+
<Frame>
|
|
584
|
+
<Field label={DATE_LABEL} helperText="Formát DD. MM. RRRR">
|
|
585
|
+
<TextField
|
|
586
|
+
type="date"
|
|
587
|
+
id="date-open"
|
|
588
|
+
{...DATE_CS}
|
|
589
|
+
value={value}
|
|
590
|
+
onValueChange={setValue}
|
|
591
|
+
placeholder="DD. MM. RRRR"
|
|
592
|
+
/>
|
|
593
|
+
</Field>
|
|
594
|
+
</Frame>
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export const DateOpen: Story = {
|
|
599
|
+
name: 'Date — Open',
|
|
600
|
+
parameters: {
|
|
601
|
+
docs: {
|
|
602
|
+
description: {
|
|
603
|
+
story:
|
|
604
|
+
'The calendar open from the keyboard: focus the field and press ArrowDown — the Single month Date Picker opens in its Popover host and focus lands on the selected day. The dialog is named by the field\'s label through `aria-labelledby`, and the input points at it with `aria-controls` while it is open. The story test runs the accessibility audit on this open state.',
|
|
605
|
+
},
|
|
606
|
+
},
|
|
607
|
+
},
|
|
608
|
+
render: () => <DateOpenDemo />,
|
|
609
|
+
play: async ({ canvasElement }) => {
|
|
610
|
+
const canvas = within(canvasElement);
|
|
611
|
+
const input = canvas.getByRole('combobox', { name: DATE_LABEL });
|
|
612
|
+
input.focus();
|
|
613
|
+
await userEvent.keyboard('{ArrowDown}');
|
|
614
|
+
|
|
615
|
+
// The panel is portalled out of the canvas.
|
|
616
|
+
const body = within(canvasElement.ownerDocument.body);
|
|
617
|
+
const dialog = await body.findByRole('dialog', { name: DATE_LABEL });
|
|
618
|
+
await expect(input).toHaveAttribute('aria-expanded', 'true');
|
|
619
|
+
await expect(input).toHaveAttribute('aria-controls', dialog.id);
|
|
620
|
+
await waitFor(() =>
|
|
621
|
+
expect(within(dialog).getByRole('button', { name: '15. dubna 2026' })).toHaveFocus(),
|
|
622
|
+
);
|
|
623
|
+
},
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
const DATE_INVALID_ERROR = 'Neplatné datum — formát DD. MM. RRRR';
|
|
627
|
+
|
|
628
|
+
function DateInvalidDemo() {
|
|
629
|
+
const [value, setValue] = React.useState<Date | undefined>(today);
|
|
630
|
+
const [error, setError] = React.useState<string>();
|
|
631
|
+
return (
|
|
632
|
+
<Frame>
|
|
633
|
+
<Field label={DATE_LABEL} helperText="Formát DD. MM. RRRR" error={error}>
|
|
634
|
+
<TextField
|
|
635
|
+
type="date"
|
|
636
|
+
id="date-invalid"
|
|
637
|
+
{...DATE_CS}
|
|
638
|
+
state={error ? 'error' : undefined}
|
|
639
|
+
value={value}
|
|
640
|
+
onValueChange={(next) => {
|
|
641
|
+
setError(undefined);
|
|
642
|
+
setValue(next);
|
|
643
|
+
}}
|
|
644
|
+
onInvalidInput={() => setError(DATE_INVALID_ERROR)}
|
|
645
|
+
placeholder="DD. MM. RRRR"
|
|
646
|
+
/>
|
|
647
|
+
</Field>
|
|
648
|
+
</Frame>
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
export const DateInvalid: Story = {
|
|
653
|
+
name: 'Date — Invalid typed date',
|
|
654
|
+
parameters: {
|
|
655
|
+
docs: {
|
|
656
|
+
description: {
|
|
657
|
+
story:
|
|
658
|
+
'A typed date that does not parse (or falls outside `minDate` / `maxDate`) stays in the input after commit (blur or Enter); it is never swapped back for the old date. The value becomes `undefined` (`onValueChange` first), then `onInvalidInput` tells the form why, and the form shows Error with the Copy pattern next to the text the user typed. The story test types `32. 13. 2026` and leaves with Tab.',
|
|
659
|
+
},
|
|
660
|
+
},
|
|
661
|
+
},
|
|
662
|
+
render: () => <DateInvalidDemo />,
|
|
663
|
+
play: async ({ canvasElement }) => {
|
|
664
|
+
const canvas = within(canvasElement);
|
|
665
|
+
const input = canvas.getByRole('combobox', { name: DATE_LABEL });
|
|
666
|
+
await userEvent.clear(input);
|
|
667
|
+
await userEvent.type(input, '32. 13. 2026');
|
|
668
|
+
await userEvent.tab();
|
|
669
|
+
|
|
670
|
+
await expect(input).toHaveValue('32. 13. 2026');
|
|
671
|
+
await expect(input).toHaveAttribute('aria-invalid', 'true');
|
|
672
|
+
await expect(await canvas.findByText(DATE_INVALID_ERROR)).toBeInTheDocument();
|
|
673
|
+
},
|
|
674
|
+
};
|