@invoiceonline/ui-react 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +99 -0
- package/CHANGELOG.md +131 -0
- package/LICENSE +9 -0
- package/README.md +78 -2
- package/dist/assets/label-brush-1.svg +6 -0
- package/dist/assets/pattern-dark.svg +113 -0
- package/dist/components/action-row/ActionRow.d.ts +178 -0
- package/dist/components/action-row/ActionRow.js +340 -0
- package/dist/components/action-row/index.d.ts +2 -0
- package/dist/components/action-row/index.js +1 -0
- package/dist/components/alert/Alert.d.ts +314 -0
- package/dist/components/alert/Alert.js +446 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +1 -0
- package/dist/components/anchored-panel/AnchoredPanel.d.ts +41 -0
- package/dist/components/anchored-panel/AnchoredPanel.js +72 -0
- package/dist/components/anchored-panel/index.d.ts +3 -0
- package/dist/components/anchored-panel/index.js +3 -0
- package/dist/components/badge/Badge.d.ts +146 -0
- package/dist/components/badge/Badge.js +258 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/banner/Banner.d.ts +209 -0
- package/dist/components/banner/Banner.js +339 -0
- package/dist/components/banner/index.d.ts +2 -0
- package/dist/components/banner/index.js +1 -0
- package/dist/components/button/Button.d.ts +54 -0
- package/dist/components/button/Button.js +312 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button-group/ButtonGroup.d.ts +187 -0
- package/dist/components/button-group/ButtonGroup.js +217 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/card-select/CardSelect.d.ts +274 -0
- package/dist/components/card-select/CardSelect.js +561 -0
- package/dist/components/card-select/CardSelectGroup.d.ts +92 -0
- package/dist/components/card-select/CardSelectGroup.js +72 -0
- package/dist/components/card-select/index.d.ts +3 -0
- package/dist/components/card-select/index.js +3 -0
- package/dist/components/checkbox/Checkbox.d.ts +104 -0
- package/dist/components/checkbox/Checkbox.js +194 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/Chip.d.ts +250 -0
- package/dist/components/chip/Chip.js +441 -0
- package/dist/components/chip/index.d.ts +2 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/column-header/ColumnHeader.d.ts +144 -0
- package/dist/components/column-header/ColumnHeader.js +209 -0
- package/dist/components/column-header/index.d.ts +2 -0
- package/dist/components/column-header/index.js +1 -0
- package/dist/components/combobox-field/Combobox.d.ts +104 -0
- package/dist/components/combobox-field/Combobox.js +355 -0
- package/dist/components/combobox-field/ComboboxField.d.ts +76 -0
- package/dist/components/combobox-field/ComboboxField.js +98 -0
- package/dist/components/combobox-field/index.d.ts +3 -0
- package/dist/components/combobox-field/index.js +3 -0
- package/dist/components/date-field/DateField.d.ts +52 -0
- package/dist/components/date-field/DateField.js +45 -0
- package/dist/components/date-field/index.d.ts +2 -0
- package/dist/components/date-field/index.js +1 -0
- package/dist/components/date-picker/DatePicker.d.ts +53 -0
- package/dist/components/date-picker/DatePicker.js +329 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/divider/Divider.d.ts +81 -0
- package/dist/components/divider/Divider.js +93 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/drawer/Drawer.d.ts +128 -0
- package/dist/components/drawer/Drawer.js +367 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/dropdown-button/DropdownButton.d.ts +72 -0
- package/dist/components/dropdown-button/DropdownButton.js +122 -0
- package/dist/components/dropdown-button/index.d.ts +2 -0
- package/dist/components/dropdown-button/index.js +1 -0
- package/dist/components/faq/FAQ.d.ts +135 -0
- package/dist/components/faq/FAQ.js +258 -0
- package/dist/components/faq/index.d.ts +2 -0
- package/dist/components/faq/index.js +1 -0
- package/dist/components/field/Field.d.ts +118 -0
- package/dist/components/field/Field.js +327 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/field-pair/FieldPair.d.ts +194 -0
- package/dist/components/field-pair/FieldPair.js +321 -0
- package/dist/components/field-pair/index.d.ts +2 -0
- package/dist/components/field-pair/index.js +1 -0
- package/dist/components/file-upload/FileUpload.d.ts +137 -0
- package/dist/components/file-upload/FileUpload.js +434 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/file-upload/index.js +1 -0
- package/dist/components/filter-chip/FilterChip.d.ts +373 -0
- package/dist/components/filter-chip/FilterChip.js +517 -0
- package/dist/components/filter-chip/index.d.ts +2 -0
- package/dist/components/filter-chip/index.js +1 -0
- package/dist/components/filter-facet/FilterFacet.d.ts +116 -0
- package/dist/components/filter-facet/FilterFacet.js +632 -0
- package/dist/components/filter-facet/index.d.ts +2 -0
- package/dist/components/filter-facet/index.js +1 -0
- package/dist/components/firm-avatar/FirmAvatar.d.ts +75 -0
- package/dist/components/firm-avatar/FirmAvatar.js +119 -0
- package/dist/components/firm-avatar/index.d.ts +2 -0
- package/dist/components/firm-avatar/index.js +1 -0
- package/dist/components/form-actions/FormActions.d.ts +123 -0
- package/dist/components/form-actions/FormActions.js +195 -0
- package/dist/components/form-actions/index.d.ts +2 -0
- package/dist/components/form-actions/index.js +1 -0
- package/dist/components/form-block/FormBlock.d.ts +252 -0
- package/dist/components/form-block/FormBlock.js +420 -0
- package/dist/components/form-block/index.d.ts +3 -0
- package/dist/components/form-block/index.js +3 -0
- package/dist/components/form-section/FormSection.d.ts +130 -0
- package/dist/components/form-section/FormSection.js +206 -0
- package/dist/components/form-section/index.d.ts +2 -0
- package/dist/components/form-section/index.js +1 -0
- package/dist/components/heading/Heading.d.ts +69 -0
- package/dist/components/heading/Heading.js +79 -0
- package/dist/components/heading/index.d.ts +2 -0
- package/dist/components/heading/index.js +1 -0
- package/dist/components/heading-group/HeadingGroup.d.ts +258 -0
- package/dist/components/heading-group/HeadingGroup.js +255 -0
- package/dist/components/heading-group/index.d.ts +2 -0
- package/dist/components/heading-group/index.js +1 -0
- package/dist/components/hero/Hero.d.ts +268 -0
- package/dist/components/hero/Hero.js +316 -0
- package/dist/components/hero/index.d.ts +2 -0
- package/dist/components/hero/index.js +1 -0
- package/dist/components/icon/Icon.d.ts +27 -0
- package/dist/components/icon/Icon.js +30 -0
- package/dist/components/icon/index.d.ts +3 -0
- package/dist/components/icon/index.js +3 -0
- package/dist/components/icon-button/IconButton.d.ts +75 -0
- package/dist/components/icon-button/IconButton.js +151 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +1 -0
- package/dist/components/item-row/ItemRow.d.ts +253 -0
- package/dist/components/item-row/ItemRow.js +496 -0
- package/dist/components/item-row/index.d.ts +2 -0
- package/dist/components/item-row/index.js +1 -0
- package/dist/components/list-row/ListRow.d.ts +165 -0
- package/dist/components/list-row/ListRow.js +233 -0
- package/dist/components/list-row/index.d.ts +2 -0
- package/dist/components/list-row/index.js +1 -0
- package/dist/components/menu/Menu.d.ts +64 -0
- package/dist/components/menu/Menu.js +186 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/modal/Modal.d.ts +272 -0
- package/dist/components/modal/Modal.js +788 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.js +1 -0
- package/dist/components/nav-link/NavLink.d.ts +123 -0
- package/dist/components/nav-link/NavLink.js +157 -0
- package/dist/components/nav-link/index.d.ts +2 -0
- package/dist/components/nav-link/index.js +1 -0
- package/dist/components/number-field/NumberField.d.ts +62 -0
- package/dist/components/number-field/NumberField.js +210 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/index.js +1 -0
- package/dist/components/pagination/Pagination.d.ts +133 -0
- package/dist/components/pagination/Pagination.js +217 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/pagination/index.js +3 -0
- package/dist/components/popover-surface/index.d.ts +2 -0
- package/dist/components/popover-surface/index.js +1 -0
- package/dist/components/progress-bar/ProgressBar.d.ts +260 -0
- package/dist/components/progress-bar/ProgressBar.js +470 -0
- package/dist/components/progress-bar/index.d.ts +2 -0
- package/dist/components/progress-bar/index.js +1 -0
- package/dist/components/promo-sticker/PromoSticker.d.ts +204 -0
- package/dist/components/promo-sticker/PromoSticker.js +177 -0
- package/dist/components/promo-sticker/index.d.ts +2 -0
- package/dist/components/promo-sticker/index.js +1 -0
- package/dist/components/promo-surface/PromoSurface.d.ts +94 -0
- package/dist/components/promo-surface/PromoSurface.js +119 -0
- package/dist/components/promo-surface/index.d.ts +2 -0
- package/dist/components/promo-surface/index.js +1 -0
- package/dist/components/radio/Radio.d.ts +92 -0
- package/dist/components/radio/Radio.js +171 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/index.js +1 -0
- package/dist/components/radio-group/RadioGroup.d.ts +61 -0
- package/dist/components/radio-group/RadioGroup.js +51 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/select/Select.d.ts +65 -0
- package/dist/components/select/Select.js +176 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/select-field/SelectField.d.ts +16 -0
- package/dist/components/select-field/SelectField.js +55 -0
- package/dist/components/select-field/index.d.ts +2 -0
- package/dist/components/select-field/index.js +1 -0
- package/dist/components/skeleton/Skeleton.d.ts +64 -0
- package/dist/components/skeleton/Skeleton.js +65 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/split-button/SplitButton.d.ts +80 -0
- package/dist/components/split-button/SplitButton.js +182 -0
- package/dist/components/split-button/index.d.ts +2 -0
- package/dist/components/split-button/index.js +1 -0
- package/dist/components/status-summary-bar/StatusSummaryBar.d.ts +118 -0
- package/dist/components/status-summary-bar/StatusSummaryBar.js +278 -0
- package/dist/components/status-summary-bar/index.d.ts +2 -0
- package/dist/components/status-summary-bar/index.js +1 -0
- package/dist/components/subject-lookup-field/SubjectLookupField.d.ts +157 -0
- package/dist/components/subject-lookup-field/SubjectLookupField.js +663 -0
- package/dist/components/subject-lookup-field/index.d.ts +2 -0
- package/dist/components/subject-lookup-field/index.js +1 -0
- package/dist/components/switch/Switch.d.ts +152 -0
- package/dist/components/switch/Switch.js +307 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/table/Table.d.ts +5 -0
- package/dist/components/table/Table.js +601 -0
- package/dist/components/table/index.d.ts +6 -0
- package/dist/components/table/index.js +6 -0
- package/dist/components/text-field/TextField.d.ts +65 -0
- package/dist/components/text-field/TextField.js +173 -0
- package/dist/components/text-field/index.d.ts +2 -0
- package/dist/components/text-field/index.js +1 -0
- package/dist/components/text-link/TextLink.d.ts +260 -0
- package/dist/components/text-link/TextLink.js +303 -0
- package/dist/components/text-link/index.d.ts +2 -0
- package/dist/components/text-link/index.js +1 -0
- package/dist/components/textarea/Textarea.d.ts +93 -0
- package/dist/components/textarea/Textarea.js +256 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +129 -0
- package/dist/components/tooltip/Tooltip.js +457 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/unit-field/UnitField.d.ts +46 -0
- package/dist/components/unit-field/UnitField.js +133 -0
- package/dist/components/unit-field/index.d.ts +2 -0
- package/dist/components/unit-field/index.js +1 -0
- package/dist/icons/icon-registry.generated.js +500 -0
- package/dist/icons/icon-types.generated.d.ts +2 -0
- package/dist/icons/icon-types.generated.js +126 -0
- package/dist/index.d.ts +132 -0
- package/dist/index.js +75 -0
- package/dist/internal/BottomSheet.js +496 -0
- package/dist/internal/FodsProvider.d.ts +25 -0
- package/dist/internal/FodsProvider.js +32 -0
- package/dist/internal/MotionCaret.js +35 -0
- package/dist/internal/NumberFormatInput.d.ts +21 -0
- package/dist/internal/NumberFormatInput.js +126 -0
- package/dist/internal/SummaryDonut.d.ts +3 -0
- package/dist/internal/SummaryDonut.js +300 -0
- package/dist/internal/buttonSegment.d.ts +44 -0
- package/dist/internal/buttonSegment.js +126 -0
- package/dist/internal/collapseRoom.js +128 -0
- package/dist/internal/comboboxKeys.js +44 -0
- package/dist/internal/contentPresence.js +46 -0
- package/dist/internal/dayCell.js +95 -0
- package/dist/internal/dialogPortal.d.ts +2 -0
- package/dist/internal/dialogPortal.js +21 -0
- package/dist/internal/donutSweeps.js +65 -0
- package/dist/internal/enterOnViewGeometry.js +46 -0
- package/dist/internal/faqItem.js +80 -0
- package/dist/internal/floatingLabelMotion.js +68 -0
- package/dist/internal/formBlockContext.d.ts +22 -0
- package/dist/internal/formBlockContext.js +20 -0
- package/dist/internal/heightRoom.js +87 -0
- package/dist/internal/numberSeparators.js +62 -0
- package/dist/internal/overlayMotion.js +48 -0
- package/dist/internal/paginationItem.d.ts +8 -0
- package/dist/internal/paginationItem.js +22 -0
- package/dist/internal/popoverSurface.d.ts +8 -0
- package/dist/internal/popoverSurface.js +23 -0
- package/dist/internal/portalContainer.d.ts +1 -0
- package/dist/internal/portalContainer.js +6 -0
- package/dist/internal/progressBarItem.d.ts +207 -0
- package/dist/internal/progressBarItem.js +264 -0
- package/dist/internal/selectionControlText.js +12 -0
- package/dist/internal/statusSummaryParts.js +371 -0
- package/dist/internal/summaryMotion.js +75 -0
- package/dist/internal/table/ChildConnector.js +62 -0
- package/dist/internal/table/ChildRowPrefix.d.ts +9 -0
- package/dist/internal/table/ChildRowPrefix.js +27 -0
- package/dist/internal/table/ColumnSettings.js +135 -0
- package/dist/internal/table/ScrollRegion.js +114 -0
- package/dist/internal/table/TableEmpty.js +93 -0
- package/dist/internal/table/TableLayout.d.ts +17 -0
- package/dist/internal/table/TableLayout.js +29 -0
- package/dist/internal/table/TableLoadStatus.js +56 -0
- package/dist/internal/table/TableMobile.js +488 -0
- package/dist/internal/table/TruncatedCell.js +33 -0
- package/dist/internal/table/emptyValue.js +10 -0
- package/dist/internal/table/features.d.ts +41 -0
- package/dist/internal/table/features.js +31 -0
- package/dist/internal/table/recipes.js +227 -0
- package/dist/internal/table/rowClick.js +9 -0
- package/dist/internal/table/types.d.ts +325 -0
- package/dist/internal/table/types.js +13 -0
- package/dist/internal/tailwind-variants.d.ts +3 -0
- package/dist/internal/tailwind-variants.js +37 -0
- package/dist/internal/tooltipContext.js +5 -0
- package/dist/internal/tw-merge-config.generated.js +314 -0
- package/dist/internal/useAnchoredPanel.d.ts +87 -0
- package/dist/internal/useAnchoredPanel.js +108 -0
- package/dist/internal/useCountUp.js +53 -0
- package/dist/internal/useDateFieldTrigger.js +183 -0
- package/dist/internal/useEChart.js +59 -0
- package/dist/internal/useEnterOnView.js +42 -0
- package/dist/internal/useFloatingBar.js +100 -0
- package/dist/internal/useFormReset.js +37 -0
- package/dist/internal/useIsMobile.js +44 -0
- package/dist/internal/useOneRowOverflow.js +88 -0
- package/dist/internal/usePrefersReducedMotion.js +25 -0
- package/dist/internal/useReturnFocus.js +26 -0
- package/dist/internal/utils.d.ts +7 -0
- package/dist/internal/utils.js +58 -0
- package/dist/node_modules/@tanstack/store/dist/store.d.ts +29 -0
- package/dist/node_modules/@tanstack/store/dist/types.d.ts +38 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/cells/coreCellsFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/cells/coreCellsFeature.types.d.ts +53 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/columns/coreColumnsFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/columns/coreColumnsFeature.types.d.ts +90 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/coreFeatures.d.ts +17 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/headers/coreHeadersFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/headers/coreHeadersFeature.types.d.ts +114 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/reactivity/coreReactivityFeature.types.d.ts +51 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/row-models/coreRowModelsFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/row-models/coreRowModelsFeature.types.d.ts +29 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/rows/coreRowsFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/rows/coreRowsFeature.types.d.ts +129 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/table/coreTablesFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/core/table/coreTablesFeature.types.d.ts +203 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/cell-selection/cellSelectionFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/cell-selection/cellSelectionFeature.types.d.ts +294 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/cell-spanning/cellSpanningFeature.d.ts +11 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/cell-spanning/cellSpanningFeature.types.d.ts +148 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-faceting/columnFacetingFeature.d.ts +12 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-faceting/columnFacetingFeature.types.d.ts +63 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-filtering/columnFilteringFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-filtering/columnFilteringFeature.types.d.ts +209 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-filtering/filterFns.d.ts +35 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-grouping/columnGroupingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-grouping/columnGroupingFeature.types.d.ts +128 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-ordering/columnOrderingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-ordering/columnOrderingFeature.types.d.ts +82 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-pinning/columnPinningFeature.d.ts +11 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-pinning/columnPinningFeature.types.d.ts +195 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-resizing/columnResizingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-resizing/columnResizingFeature.types.d.ts +73 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-sizing/columnSizingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-sizing/columnSizingFeature.types.d.ts +134 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-visibility/columnVisibilityFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +92 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/global-filtering/globalFilteringFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/global-filtering/globalFilteringFeature.types.d.ts +67 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-aggregation/aggregationFns.d.ts +23 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-aggregation/rowAggregationFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-aggregation/rowAggregationFeature.types.d.ts +183 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-aggregation/rowAggregationFeature.utils.d.ts +18 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-expanding/rowExpandingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-expanding/rowExpandingFeature.types.d.ts +125 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-pagination/rowPaginationFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-pagination/rowPaginationFeature.types.d.ts +135 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-pinning/rowPinningFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-pinning/rowPinningFeature.types.d.ts +76 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-selection/rowSelectionFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-selection/rowSelectionFeature.types.d.ts +187 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-sorting/rowSortingFeature.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-sorting/rowSortingFeature.types.d.ts +236 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/row-sorting/sortFns.d.ts +23 -0
- package/dist/node_modules/@tanstack/table-core/dist/features/stockFeatures.d.ts +37 -0
- package/dist/node_modules/@tanstack/table-core/dist/helpers/columnHelper.d.ts +47 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Cell.d.ts +16 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Column.d.ts +30 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/ColumnDef.d.ts +123 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Header.d.ts +12 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/HeaderGroup.d.ts +6 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Row.d.ts +24 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/RowModel.d.ts +19 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/RowModelFns.d.ts +11 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/Table.d.ts +53 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/TableFeatures.d.ts +416 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/TableOptions.d.ts +78 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/TableState.d.ts +46 -0
- package/dist/node_modules/@tanstack/table-core/dist/types/type-utils.d.ts +25 -0
- package/dist/shared.css +179 -0
- package/dist/styles.css +5467 -0
- package/dist/theme.css +314 -0
- package/dist/theme.map.json +278 -0
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/index.js +1 -0
- package/dist/tokens/tokens.generated.d.ts +2040 -0
- package/dist/tokens/tokens.generated.js +2053 -0
- package/dist/tokens.css +484 -0
- package/dist/tokens.flat.json +429 -0
- package/docs/Consuming.mdx +379 -0
- package/docs/Contributing.mdx +78 -0
- package/docs/ForAgents.mdx +53 -0
- package/docs/Introduction.mdx +54 -0
- package/llms.txt +556 -0
- package/package.json +357 -4
- package/src/components/action-row/ActionRow.mdx +686 -0
- package/src/components/action-row/ActionRow.stories.tsx +669 -0
- package/src/components/action-row/ActionRow.tsx +632 -0
- package/src/components/action-row/index.ts +9 -0
- package/src/components/alert/Alert.mdx +377 -0
- package/src/components/alert/Alert.stories.tsx +674 -0
- package/src/components/alert/Alert.tsx +579 -0
- package/src/components/alert/index.ts +13 -0
- package/src/components/anchored-panel/AnchoredPanel.mdx +381 -0
- package/src/components/anchored-panel/AnchoredPanel.stories.tsx +593 -0
- package/src/components/anchored-panel/AnchoredPanel.tsx +176 -0
- package/src/components/anchored-panel/index.ts +15 -0
- package/src/components/badge/Badge.mdx +487 -0
- package/src/components/badge/Badge.stories.tsx +375 -0
- package/src/components/badge/Badge.tsx +360 -0
- package/src/components/badge/index.ts +10 -0
- package/src/components/banner/Banner.mdx +704 -0
- package/src/components/banner/Banner.stories.tsx +448 -0
- package/src/components/banner/Banner.tsx +602 -0
- package/src/components/banner/index.ts +14 -0
- package/src/components/button/Button.mdx +286 -0
- package/src/components/button/Button.stories.tsx +381 -0
- package/src/components/button/Button.tsx +384 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/button-group/ButtonGroup.mdx +512 -0
- package/src/components/button-group/ButtonGroup.stories.tsx +714 -0
- package/src/components/button-group/ButtonGroup.tsx +491 -0
- package/src/components/button-group/index.ts +10 -0
- package/src/components/card-select/CardSelect.mdx +662 -0
- package/src/components/card-select/CardSelect.stories.tsx +784 -0
- package/src/components/card-select/CardSelect.tsx +783 -0
- package/src/components/card-select/CardSelectGroup.tsx +169 -0
- package/src/components/card-select/index.ts +18 -0
- package/src/components/checkbox/Checkbox.mdx +269 -0
- package/src/components/checkbox/Checkbox.stories.tsx +306 -0
- package/src/components/checkbox/Checkbox.tsx +343 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/chip/Chip.mdx +683 -0
- package/src/components/chip/Chip.stories.tsx +734 -0
- package/src/components/chip/Chip.tsx +732 -0
- package/src/components/chip/index.ts +9 -0
- package/src/components/column-header/ColumnHeader.mdx +301 -0
- package/src/components/column-header/ColumnHeader.stories.tsx +319 -0
- package/src/components/column-header/ColumnHeader.tsx +287 -0
- package/src/components/column-header/index.ts +7 -0
- package/src/components/combobox-field/Combobox.tsx +693 -0
- package/src/components/combobox-field/ComboboxField.mdx +525 -0
- package/src/components/combobox-field/ComboboxField.stories.tsx +502 -0
- package/src/components/combobox-field/ComboboxField.tsx +259 -0
- package/src/components/combobox-field/index.ts +12 -0
- package/src/components/date-field/DateField.mdx +340 -0
- package/src/components/date-field/DateField.stories.tsx +221 -0
- package/src/components/date-field/DateField.tsx +176 -0
- package/src/components/date-field/index.ts +1 -0
- package/src/components/date-picker/DatePicker.mdx +436 -0
- package/src/components/date-picker/DatePicker.stories.tsx +458 -0
- package/src/components/date-picker/DatePicker.tsx +688 -0
- package/src/components/date-picker/index.ts +9 -0
- package/src/components/divider/Divider.mdx +256 -0
- package/src/components/divider/Divider.stories.tsx +177 -0
- package/src/components/divider/Divider.tsx +193 -0
- package/src/components/divider/index.ts +1 -0
- package/src/components/drawer/Drawer.mdx +518 -0
- package/src/components/drawer/Drawer.stories.tsx +392 -0
- package/src/components/drawer/Drawer.tsx +683 -0
- package/src/components/drawer/index.ts +1 -0
- package/src/components/dropdown-button/DropdownButton.mdx +285 -0
- package/src/components/dropdown-button/DropdownButton.stories.tsx +398 -0
- package/src/components/dropdown-button/DropdownButton.tsx +198 -0
- package/src/components/dropdown-button/index.ts +7 -0
- package/src/components/faq/FAQ.mdx +364 -0
- package/src/components/faq/FAQ.stories.tsx +343 -0
- package/src/components/faq/FAQ.tsx +337 -0
- package/src/components/faq/index.ts +1 -0
- package/src/components/field/Field.mdx +129 -0
- package/src/components/field/Field.stories.tsx +461 -0
- package/src/components/field/Field.tsx +765 -0
- package/src/components/field/index.ts +20 -0
- package/src/components/field-pair/FieldPair.mdx +308 -0
- package/src/components/field-pair/FieldPair.stories.tsx +530 -0
- package/src/components/field-pair/FieldPair.tsx +796 -0
- package/src/components/field-pair/index.ts +9 -0
- package/src/components/file-upload/FileUpload.mdx +345 -0
- package/src/components/file-upload/FileUpload.stories.tsx +698 -0
- package/src/components/file-upload/FileUpload.tsx +802 -0
- package/src/components/file-upload/index.ts +6 -0
- package/src/components/filter-chip/FilterChip.mdx +778 -0
- package/src/components/filter-chip/FilterChip.stories.tsx +827 -0
- package/src/components/filter-chip/FilterChip.tsx +881 -0
- package/src/components/filter-chip/index.ts +11 -0
- package/src/components/filter-facet/FilterFacet.mdx +536 -0
- package/src/components/filter-facet/FilterFacet.stories.tsx +506 -0
- package/src/components/filter-facet/FilterFacet.tsx +1160 -0
- package/src/components/filter-facet/index.ts +7 -0
- package/src/components/firm-avatar/FirmAvatar.mdx +280 -0
- package/src/components/firm-avatar/FirmAvatar.stories.tsx +147 -0
- package/src/components/firm-avatar/FirmAvatar.tsx +172 -0
- package/src/components/firm-avatar/index.ts +7 -0
- package/src/components/form-actions/FormActions.mdx +518 -0
- package/src/components/form-actions/FormActions.stories.tsx +621 -0
- package/src/components/form-actions/FormActions.tsx +273 -0
- package/src/components/form-actions/index.ts +6 -0
- package/src/components/form-block/FormBlock.mdx +728 -0
- package/src/components/form-block/FormBlock.stories.tsx +813 -0
- package/src/components/form-block/FormBlock.tsx +679 -0
- package/src/components/form-block/index.ts +13 -0
- package/src/components/form-section/FormSection.mdx +436 -0
- package/src/components/form-section/FormSection.stories.tsx +407 -0
- package/src/components/form-section/FormSection.tsx +290 -0
- package/src/components/form-section/index.ts +17 -0
- package/src/components/heading/Heading.mdx +206 -0
- package/src/components/heading/Heading.stories.tsx +169 -0
- package/src/components/heading/Heading.tsx +124 -0
- package/src/components/heading/index.ts +8 -0
- package/src/components/heading-group/HeadingGroup.mdx +521 -0
- package/src/components/heading-group/HeadingGroup.stories.tsx +353 -0
- package/src/components/heading-group/HeadingGroup.tsx +396 -0
- package/src/components/heading-group/index.ts +7 -0
- package/src/components/hero/Hero.mdx +742 -0
- package/src/components/hero/Hero.stories.tsx +527 -0
- package/src/components/hero/Hero.tsx +807 -0
- package/src/components/hero/index.ts +1 -0
- package/src/components/icon/Icon.mdx +329 -0
- package/src/components/icon/Icon.stories.tsx +398 -0
- package/src/components/icon/Icon.tsx +97 -0
- package/src/components/icon/index.ts +2 -0
- package/src/components/icon-button/IconButton.mdx +206 -0
- package/src/components/icon-button/IconButton.stories.tsx +341 -0
- package/src/components/icon-button/IconButton.tsx +273 -0
- package/src/components/icon-button/index.ts +1 -0
- package/src/components/item-row/ItemRow.mdx +533 -0
- package/src/components/item-row/ItemRow.stories.tsx +434 -0
- package/src/components/item-row/ItemRow.tsx +676 -0
- package/src/components/item-row/index.ts +9 -0
- package/src/components/list-row/ListRow.mdx +404 -0
- package/src/components/list-row/ListRow.stories.tsx +404 -0
- package/src/components/list-row/ListRow.tsx +424 -0
- package/src/components/list-row/index.ts +1 -0
- package/src/components/menu/Menu.mdx +268 -0
- package/src/components/menu/Menu.stories.tsx +455 -0
- package/src/components/menu/Menu.tsx +452 -0
- package/src/components/menu/index.ts +1 -0
- package/src/components/modal/Modal.mdx +854 -0
- package/src/components/modal/Modal.stories.tsx +881 -0
- package/src/components/modal/Modal.tsx +1434 -0
- package/src/components/modal/index.ts +1 -0
- package/src/components/nav-link/NavLink.mdx +196 -0
- package/src/components/nav-link/NavLink.stories.tsx +243 -0
- package/src/components/nav-link/NavLink.tsx +222 -0
- package/src/components/nav-link/index.ts +1 -0
- package/src/components/number-field/NumberField.mdx +223 -0
- package/src/components/number-field/NumberField.stories.tsx +291 -0
- package/src/components/number-field/NumberField.tsx +388 -0
- package/src/components/number-field/index.ts +6 -0
- package/src/components/pagination/Pagination.mdx +305 -0
- package/src/components/pagination/Pagination.stories.tsx +333 -0
- package/src/components/pagination/Pagination.tsx +343 -0
- package/src/components/pagination/index.ts +8 -0
- package/src/components/popover-surface/PopoverSurface.mdx +158 -0
- package/src/components/popover-surface/PopoverSurface.stories.tsx +421 -0
- package/src/components/popover-surface/index.ts +1 -0
- package/src/components/progress-bar/ProgressBar.mdx +802 -0
- package/src/components/progress-bar/ProgressBar.stories.tsx +533 -0
- package/src/components/progress-bar/ProgressBar.tsx +654 -0
- package/src/components/progress-bar/index.ts +9 -0
- package/src/components/promo-sticker/PromoSticker.mdx +436 -0
- package/src/components/promo-sticker/PromoSticker.stories.tsx +363 -0
- package/src/components/promo-sticker/PromoSticker.tsx +313 -0
- package/src/components/promo-sticker/index.ts +7 -0
- package/src/components/promo-surface/PromoSurface.mdx +399 -0
- package/src/components/promo-surface/PromoSurface.stories.tsx +270 -0
- package/src/components/promo-surface/PromoSurface.tsx +305 -0
- package/src/components/promo-surface/index.ts +7 -0
- package/src/components/radio/Radio.mdx +243 -0
- package/src/components/radio/Radio.stories.tsx +307 -0
- package/src/components/radio/Radio.tsx +288 -0
- package/src/components/radio/index.ts +1 -0
- package/src/components/radio-group/RadioGroup.mdx +119 -0
- package/src/components/radio-group/RadioGroup.stories.tsx +225 -0
- package/src/components/radio-group/RadioGroup.tsx +139 -0
- package/src/components/radio-group/index.ts +1 -0
- package/src/components/select/Select.mdx +241 -0
- package/src/components/select/Select.stories.tsx +404 -0
- package/src/components/select/Select.tsx +381 -0
- package/src/components/select/index.ts +1 -0
- package/src/components/select-field/SelectField.mdx +324 -0
- package/src/components/select-field/SelectField.stories.tsx +460 -0
- package/src/components/select-field/SelectField.tsx +138 -0
- package/src/components/select-field/index.ts +1 -0
- package/src/components/skeleton/Skeleton.mdx +194 -0
- package/src/components/skeleton/Skeleton.stories.tsx +260 -0
- package/src/components/skeleton/Skeleton.tsx +107 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/split-button/SplitButton.mdx +445 -0
- package/src/components/split-button/SplitButton.stories.tsx +465 -0
- package/src/components/split-button/SplitButton.tsx +361 -0
- package/src/components/split-button/index.ts +7 -0
- package/src/components/status-summary-bar/StatusSummaryBar.mdx +338 -0
- package/src/components/status-summary-bar/StatusSummaryBar.stories.tsx +408 -0
- package/src/components/status-summary-bar/StatusSummaryBar.tsx +428 -0
- package/src/components/status-summary-bar/index.ts +8 -0
- package/src/components/subject-lookup-field/SubjectLookupField.mdx +378 -0
- package/src/components/subject-lookup-field/SubjectLookupField.stories.tsx +393 -0
- package/src/components/subject-lookup-field/SubjectLookupField.tsx +1079 -0
- package/src/components/subject-lookup-field/index.ts +11 -0
- package/src/components/switch/Switch.mdx +376 -0
- package/src/components/switch/Switch.stories.tsx +296 -0
- package/src/components/switch/Switch.tsx +483 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/table/Table.mdx +575 -0
- package/src/components/table/Table.stories.tsx +1049 -0
- package/src/components/table/Table.tsx +745 -0
- package/src/components/table/TableConsumers.stories.tsx +195 -0
- package/src/components/table/_tableFixtures.ts +1189 -0
- package/src/components/table/index.ts +22 -0
- package/src/components/text-field/TextField.mdx +479 -0
- package/src/components/text-field/TextField.stories.tsx +366 -0
- package/src/components/text-field/TextField.tsx +391 -0
- package/src/components/text-field/index.ts +8 -0
- package/src/components/text-link/TextLink.mdx +353 -0
- package/src/components/text-link/TextLink.stories.tsx +458 -0
- package/src/components/text-link/TextLink.tsx +504 -0
- package/src/components/text-link/index.ts +10 -0
- package/src/components/textarea/Textarea.mdx +244 -0
- package/src/components/textarea/Textarea.stories.tsx +371 -0
- package/src/components/textarea/Textarea.tsx +489 -0
- package/src/components/textarea/index.ts +9 -0
- package/src/components/tooltip/Tooltip.mdx +462 -0
- package/src/components/tooltip/Tooltip.stories.tsx +500 -0
- package/src/components/tooltip/Tooltip.tsx +756 -0
- package/src/components/tooltip/index.ts +13 -0
- package/src/components/unit-field/UnitField.mdx +215 -0
- package/src/components/unit-field/UnitField.stories.tsx +291 -0
- package/src/components/unit-field/UnitField.tsx +255 -0
- package/src/components/unit-field/index.ts +7 -0
- package/src/icons/icon-registry.generated.ts +510 -0
- package/src/icons/icon-types.generated.ts +256 -0
- package/src/index.ts +71 -0
- package/src/internal/BottomSheet.tsx +714 -0
- package/src/internal/FodsProvider.tsx +36 -0
- package/src/internal/MotionCaret.tsx +53 -0
- package/src/internal/NumberFormatInput.tsx +276 -0
- package/src/internal/SummaryDonut.tsx +359 -0
- package/src/internal/buttonSegment.ts +241 -0
- package/src/internal/collapseRoom.ts +130 -0
- package/src/internal/comboboxKeys.ts +90 -0
- package/src/internal/contentPresence.ts +46 -0
- package/src/internal/dayCell.ts +274 -0
- package/src/internal/dialogPortal.ts +50 -0
- package/src/internal/donutSweeps.ts +77 -0
- package/src/internal/enterOnViewGeometry.ts +53 -0
- package/src/internal/faqItem.ts +104 -0
- package/src/internal/floatingLabelMotion.tsx +109 -0
- package/src/internal/formBlockContext.ts +27 -0
- package/src/internal/heightRoom.ts +135 -0
- package/src/internal/numberSeparators.ts +93 -0
- package/src/internal/overlayMotion.tsx +32 -0
- package/src/internal/paginationItem.ts +106 -0
- package/src/internal/popoverSurface.ts +78 -0
- package/src/internal/portalContainer.ts +11 -0
- package/src/internal/progressBarItem.ts +356 -0
- package/src/internal/selectionControlText.ts +42 -0
- package/src/internal/statusSummaryParts.tsx +475 -0
- package/src/internal/summaryMotion.ts +111 -0
- package/src/internal/table/ChildConnector.tsx +57 -0
- package/src/internal/table/ChildRowPrefix.tsx +21 -0
- package/src/internal/table/ColumnSettings.tsx +194 -0
- package/src/internal/table/ScrollRegion.tsx +176 -0
- package/src/internal/table/TableEmpty.tsx +99 -0
- package/src/internal/table/TableLayout.tsx +29 -0
- package/src/internal/table/TableLoadStatus.tsx +60 -0
- package/src/internal/table/TableMobile.tsx +582 -0
- package/src/internal/table/TruncatedCell.tsx +35 -0
- package/src/internal/table/emptyValue.ts +11 -0
- package/src/internal/table/features.ts +44 -0
- package/src/internal/table/recipes.ts +263 -0
- package/src/internal/table/rowClick.ts +8 -0
- package/src/internal/table/types.ts +342 -0
- package/src/internal/tailwind-variants.ts +65 -0
- package/src/internal/tooltipContext.ts +15 -0
- package/src/internal/tw-merge-config.generated.ts +275 -0
- package/src/internal/useAnchoredPanel.ts +340 -0
- package/src/internal/useCountUp.ts +65 -0
- package/src/internal/useDateFieldTrigger.tsx +357 -0
- package/src/internal/useEChart.ts +88 -0
- package/src/internal/useEnterOnView.ts +80 -0
- package/src/internal/useFloatingBar.ts +125 -0
- package/src/internal/useFormReset.ts +47 -0
- package/src/internal/useIsMobile.ts +64 -0
- package/src/internal/useNoImplicitSubmit.ts +41 -0
- package/src/internal/useOneRowOverflow.ts +103 -0
- package/src/internal/usePrefersReducedMotion.ts +27 -0
- package/src/internal/useReturnFocus.ts +34 -0
- package/src/internal/utils.ts +58 -0
- package/src/recipes/EmptyState.stories.tsx +105 -0
- package/src/recipes/Form.stories.tsx +355 -0
- package/src/recipes/ModalWithForm.stories.tsx +219 -0
- package/src/recipes/Recipes.mdx +61 -0
- package/src/recipes/TableWithFilters.stories.tsx +278 -0
- package/src/storybook/FodsFamily.tsx +39 -0
- package/src/storybook/Section.tsx +36 -0
- package/src/storybook/a11y.ts +24 -0
- package/src/storybook/assets/banner-character-bartender.webp +0 -0
- package/src/storybook/assets/banner-invoice-sheet-left.webp +0 -0
- package/src/storybook/assets/banner-invoice-sheet-right.webp +0 -0
- package/src/storybook/assets/invoice-hero.webp +0 -0
- package/src/storybook/assets/invoice.webp +0 -0
- package/src/storybook/assets/section-document-info.svg +21 -0
- package/src/storybook/assets/section-gear-checklist.svg +11 -0
- package/src/storybook/assets/section-person-arrow-in.svg +15 -0
- package/src/storybook/assets/section-person-arrow-out.svg +22 -0
- package/src/storybook/assets/section-receipt-dollar.svg +23 -0
- package/src/storybook/assets/table-empty-folder-empty.png +0 -0
- package/src/storybook/assets/table-empty-folder-magnifying-glass.png +0 -0
- package/src/storybook/assets/table-empty-funnel.png +0 -0
- package/src/storybook/assets/table-empty-load-failed.png +0 -0
- package/src/storybook/assets/wallet-spot.png +0 -0
- package/src/storybook/assets.d.ts +17 -0
- package/src/storybook/componentDoc.ts +41 -0
- package/src/storybook/fitFrame.tsx +70 -0
- package/src/storybook/forceStates.tsx +647 -0
- package/src/storybook/illustrations.tsx +66 -0
- package/src/storybook/viewportFrame.tsx +58 -0
- package/src/styles/assets/label-brush-1.svg +6 -0
- package/src/styles/assets/pattern-dark.svg +113 -0
- package/src/styles/base.css +106 -0
- package/src/styles/index.css +15 -0
- package/src/styles/motion.css +157 -0
- package/src/styles/promo-sticker.css +27 -0
- package/src/styles/promo-surface.css +49 -0
- package/src/styles/shared.css +11 -0
- package/src/styles/theme.generated.css +314 -0
- package/src/styles/theme.map.json +278 -0
- package/src/styles/tracking.generated.css +12 -0
- package/src/tokens/index.ts +4 -0
- package/src/tokens/tokens.generated.ts +542 -0
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as FileUploadStories from './FileUpload.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={FileUploadStories} tags={['autodocs']} />
|
|
5
|
+
|
|
6
|
+
# FileUpload
|
|
7
|
+
|
|
8
|
+
## Metadata
|
|
9
|
+
|
|
10
|
+
- **Layer:** atom
|
|
11
|
+
- **Status:** stable. The design acceptance of the Storybook DoD §6(d) was given on 2026-11-13 by the package maintainer instead of the designer; the designer may still fine-tune the component.
|
|
12
|
+
- **Tokens used:** `--bg-primary`, `--bg-secondary`, `--border-width-100`, `--duration-instant`, `--duration-normal`, `--duration-spin`, `--easing-linear`, `--easing-standard`, `--font-body`, `--font-size-base`, `--font-size-xs`, `--font-size-xxs`, `--font-weight-normal`, `--font-weight-semibold`, `--leading-loose`, `--leading-relaxed`, `--outline-default`, `--radius-100`, `--radius-200`, `--radius-400`, `--secondary`, `--secondary-solid`, `--size-icon`, `--size-icon-xsmall`, `--space-200`, `--space-300`, `--space-400`, `--space-500`, `--space-600`, `--space-700`, `--space-800`, `--space-900`, `--status-danger`, `--text-primary`, `--text-secondary`, `--text-wrap-body`
|
|
13
|
+
- **Manifest version:** `1.11.0`
|
|
14
|
+
|
|
15
|
+
The list covers the classes of `FileUpload.tsx` and the two Field recipes it calls for the floating label and the helper row. The composed `TextLink` (trigger) and `IconButton` (row actions) bring their own tokens, documented on their pages. The motion of the state swap and of the file rows runs in `motion/react` on `--duration-slow`, `--duration-fast`, `--easing-enter`, `--easing-exit` and `--spring-gentle` (manifest `motion`, see [States → Motion](#motion)).
|
|
16
|
+
|
|
17
|
+
The manifest is `spec/03-atoms/file-upload.manifest.json`; a manifest bump re-opens the component per COMPONENT-CODE-CONVENTIONS § DoD (e).
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
FileUpload is the **drop-zone field for attaching a file or image inside a form**: a company logo, invoice attachments, a scanned document. It draws the Text Field shell (border, fill, radius, floating label, helper line) around an 88-tall drop zone. The trigger link «Nahrajte svůj soubor» opens the OS file picker, and so does a click anywhere else on the shell; the whole shell is also a drag-and-drop target.
|
|
22
|
+
|
|
23
|
+
**Use it** when the value *is* a file: the user picks or drops a file and the field shows what was attached, with a way to preview (images) and remove it.
|
|
24
|
+
|
|
25
|
+
**Do not use it** for choosing from a fixed set of options (→ `Select`), for plain free-form text (→ `TextField`) or for a link-out.
|
|
26
|
+
|
|
27
|
+
The component **renders state, it does not upload.** Everything picked or dropped is handed to `onFilesSelect` verbatim; the consumer validates it, runs the transfer and passes the result back through `files`, `loading`, `progress` and `error`.
|
|
28
|
+
|
|
29
|
+
<Canvas of={FileUploadStories.Playground} />
|
|
30
|
+
|
|
31
|
+
## Rationale
|
|
32
|
+
|
|
33
|
+
The upstream spec promotes the file input to its own atom for four reasons:
|
|
34
|
+
|
|
35
|
+
- **One shell, many fields.** The drop zone draws the same outlined shell the Text Field draws, so a file field and a text field read as one system in a form. In code the floating label and the helper row reuse the Field recipes (`floatingLabelVariants`, `helperTextVariants`) rather than restyling them.
|
|
36
|
+
- **The drop target is deliberately large.** The zone stands off the field height grid (88, not the 48 / 40 of a Text Field): a file drop target needs room (manifest `intent.sizing`).
|
|
37
|
+
- **The uploaded state is shown, not implied.** Each attached file gets a preview row (a thumbnail for images, the filename for documents) with explicit view / remove actions, so the user always knows what is attached and can undo it.
|
|
38
|
+
- **Failure is a first-class state, signalled twice.** Error carries a `--status-danger` border **and** a `warning-circle` + message, never colour alone (WCAG 1.4.1).
|
|
39
|
+
|
|
40
|
+
Two implementation decisions are contract, not style:
|
|
41
|
+
|
|
42
|
+
- **The state is derived, never passed.** The manifest's single axis is `state`, and there is no `state` prop: all six states come from content (see [Variants](#variants)).
|
|
43
|
+
- **No `disabled` prop.** The manifest has no Disabled state and no `--disabled-*` bindings. Inside a disabled `<fieldset>` the browser switches off the input, the trigger and the row actions natively, and the component ignores a drop and a click on the shell (it checks the input's `:disabled`). The manifest defines no disabled look, so what shows is mixed: the row actions dim through their own disabled styles, the trigger keeps its link ink, and the shell loses its pointer cursor.
|
|
44
|
+
|
|
45
|
+
<Canvas of={FileUploadStories.DisabledFieldset} />
|
|
46
|
+
|
|
47
|
+
## Anatomy
|
|
48
|
+
|
|
49
|
+
The root `<div>` carries `data-fods-component="file-upload"`; the parts carry `data-fods-part`:
|
|
50
|
+
|
|
51
|
+
- **`label`** — the floating label, a real `<label htmlFor>` of the file input. Always floating (the zone is never empty, so the label has no resting position). Body/XXS in `--text-secondary` on a `--bg-primary` notch; `--status-danger` on Error (manifest `parts.label`). Single line, truncates.
|
|
52
|
+
- **`root`** — the shell: `--bg-primary` fill, `--outline-default` border at `--border-width-100`, radius `--radius-400`, inline padding `--space-500`. It hugs its content and carries the drag handlers (`dragenter`, `dragover`, `drop`). The visually hidden `<input type="file">` sits inside it.
|
|
53
|
+
- **`container`** — the drop zone, `min-height` 88 as a floor, holding the content of the current state; gap `--space-400`.
|
|
54
|
+
- **`prompt-icon`** — the `upload-simple` glyph (`--size-icon`) in `--secondary`, in every state including Error (manifest `slots.prompt-icon`, `notes[5]`). Top-aligned with the first line of the prompt.
|
|
55
|
+
- **`prompt`** — one sentence in Body/M/Regular `--text-primary`: the trigger (`TextLink` Strong / md, rendered as a `<button type="button">` because it has no `href`) followed by the drop hint. It wraps as one text flow.
|
|
56
|
+
- **`spinner`** — Uploading only: the `spinner` glyph (`--size-icon`, `--secondary`) replaces the prompt icon and turns with `animate-spin`.
|
|
57
|
+
- **`progress`** — Uploading only: the fill of the progress bar, `--secondary-solid`, 3px tall, radius `--radius-100`. The bar has **no track**: neither Figma nor the manifest draws one. It sits inside a `role="progressbar"` box.
|
|
58
|
+
- **`thumbnail`** — Uploaded Image only: an 80 × 80 box (a raw 80 from the manifest, `notes[3]` and `sizes[0].note`), `--bg-secondary` fill, `--outline-default` border, radius `--radius-200`. It holds the real image when `previewUrl` is set, otherwise the **`thumbnail-icon`**: the `image` glyph (`--size-icon`) in `--text-secondary`.
|
|
59
|
+
- **`filename`** — Body/M/Semibold `--text-primary`, fills the row, single line, truncates keeping the extension: the base name shrinks to an ellipsis, the extension stays whole (manifest `text.filename`). The full name stays in the text and in the `title`.
|
|
60
|
+
- **Row actions** — `IconButton` Tertiary / md: **view** (`eye`, Uploaded Image only) and **remove** (`trash`, every file). Right of the filename.
|
|
61
|
+
- **`helper`** — the helper / error row below the shell: Body/XS, `--text-secondary` by default, `--status-danger` on Error, where the message **replaces** the helper and is led by the **`status-icon`** (`warning-circle`, `--size-icon-xsmall`). It wraps, never truncates, and sits `--space-400` below the shell while it holds a message.
|
|
62
|
+
- **`file-stack`** / **`file-row`** — Uploaded Multi Files only: a `<ul>` of `<li>` rows **below the helper row**. Each row is the legacy row, not List Row (manifest `notes[4]`, `backlog`): `min-height` 56, padding `--space-400` / `--space-600`, gap `--space-400`, filename + remove. A `--border-width-100` `--outline-default` rule separates rows; the first row has none.
|
|
63
|
+
|
|
64
|
+
## Variants
|
|
65
|
+
|
|
66
|
+
One axis, `state`, with six members, and it is **not a prop**: each state is derived from content. The matrix below shows them in the order of the Figma set.
|
|
67
|
+
|
|
68
|
+
<Canvas of={FileUploadStories.Matrix} />
|
|
69
|
+
|
|
70
|
+
<table>
|
|
71
|
+
<thead>
|
|
72
|
+
<tr><th>State</th><th>Rendered when</th><th>Zone content</th></tr>
|
|
73
|
+
</thead>
|
|
74
|
+
<tbody>
|
|
75
|
+
<tr>
|
|
76
|
+
<td>Default</td>
|
|
77
|
+
<td>empty <code>files</code>, not <code>loading</code></td>
|
|
78
|
+
<td><code>upload-simple</code> + the prompt sentence with its trigger</td>
|
|
79
|
+
</tr>
|
|
80
|
+
<tr>
|
|
81
|
+
<td>Uploading</td>
|
|
82
|
+
<td><code>loading</code> (wins over every other content state)</td>
|
|
83
|
+
<td><code>spinner</code> + progress bar</td>
|
|
84
|
+
</tr>
|
|
85
|
+
<tr>
|
|
86
|
+
<td>Uploaded Image</td>
|
|
87
|
+
<td>one file, not <code>multiple</code>, <code>kind: 'image'</code></td>
|
|
88
|
+
<td>80 × 80 thumbnail + filename + view + remove</td>
|
|
89
|
+
</tr>
|
|
90
|
+
<tr>
|
|
91
|
+
<td>Uploaded File</td>
|
|
92
|
+
<td>one file, not <code>multiple</code>, <code>kind</code> other than <code>'image'</code> (default)</td>
|
|
93
|
+
<td>filename + remove</td>
|
|
94
|
+
</tr>
|
|
95
|
+
<tr>
|
|
96
|
+
<td>Uploaded Multi Files</td>
|
|
97
|
+
<td><code>multiple</code> + <code>files</code></td>
|
|
98
|
+
<td>the prompt stays; a row per file below the helper row</td>
|
|
99
|
+
</tr>
|
|
100
|
+
<tr>
|
|
101
|
+
<td>Error</td>
|
|
102
|
+
<td>a non-empty <code>error</code></td>
|
|
103
|
+
<td>unchanged; the border and label turn <code>--status-danger</code> and the message replaces the helper</td>
|
|
104
|
+
</tr>
|
|
105
|
+
</tbody>
|
|
106
|
+
</table>
|
|
107
|
+
|
|
108
|
+
In single mode only the first file of `files` is rendered. Error combines with the content states: an error over an uploaded file keeps the file row and reds the chrome. An empty string in `error` means "no error" and keeps the helper visible.
|
|
109
|
+
|
|
110
|
+
## Sizes
|
|
111
|
+
|
|
112
|
+
**Single size, no size axis** (manifest `sizes[0]` "Default", no `axes.size`). There is no `size` prop. Width fills the column: no `minWidth`, no `maxWidth`.
|
|
113
|
+
|
|
114
|
+
<table>
|
|
115
|
+
<thead>
|
|
116
|
+
<tr><th>Part</th><th>Measure</th></tr>
|
|
117
|
+
</thead>
|
|
118
|
+
<tbody>
|
|
119
|
+
<tr>
|
|
120
|
+
<td>Drop zone (<code>container</code>)</td>
|
|
121
|
+
<td><code>min-height</code> 88, a floor. Uploaded Image grows to 112 (manifest <code>sizes[0].heightExceptions</code>); a wrapped prompt grows the zone too</td>
|
|
122
|
+
</tr>
|
|
123
|
+
<tr>
|
|
124
|
+
<td>Zone padding-block</td>
|
|
125
|
+
<td>Default, Uploaded Multi Files, Error, Uploading: <code>--space-900</code>, <code>--space-700</code> below SM · Uploaded File: <code>--space-800</code> · Uploaded Image: <code>--space-600</code></td>
|
|
126
|
+
</tr>
|
|
127
|
+
<tr>
|
|
128
|
+
<td>Shell</td>
|
|
129
|
+
<td>inline padding <code>--space-500</code>, radius <code>--radius-400</code>, border <code>--border-width-100</code></td>
|
|
130
|
+
</tr>
|
|
131
|
+
<tr>
|
|
132
|
+
<td>Icons</td>
|
|
133
|
+
<td><code>--size-icon</code> (prompt, spinner, thumbnail glyph) · <code>--size-icon-xsmall</code> (status icon)</td>
|
|
134
|
+
</tr>
|
|
135
|
+
<tr>
|
|
136
|
+
<td>Thumbnail</td>
|
|
137
|
+
<td>80 × 80 (raw, manifest <code>notes[3]</code>), radius <code>--radius-200</code></td>
|
|
138
|
+
</tr>
|
|
139
|
+
<tr>
|
|
140
|
+
<td>Progress fill</td>
|
|
141
|
+
<td>3px tall, radius <code>--radius-100</code></td>
|
|
142
|
+
</tr>
|
|
143
|
+
<tr>
|
|
144
|
+
<td>File row</td>
|
|
145
|
+
<td><code>min-height</code> 56, padding <code>--space-400</code> / <code>--space-600</code>, gap <code>--space-400</code></td>
|
|
146
|
+
</tr>
|
|
147
|
+
<tr>
|
|
148
|
+
<td>Helper row</td>
|
|
149
|
+
<td><code>--space-400</code> below the shell while it holds a message, inline padding <code>--space-500</code></td>
|
|
150
|
+
</tr>
|
|
151
|
+
</tbody>
|
|
152
|
+
</table>
|
|
153
|
+
|
|
154
|
+
The 88 floor and the 56 row are raw values from the manifest (`sizes[0]`), deliberately off the `--space` scale; the 80 thumbnail is a raw manifest value too (`notes[3]`, `sizes[0].note`) that no semantic size token carries; and the 3px fill height is the manifest's raw `slots.spinner` value; each carries a `fods-lint-disable-next-line` with that reason.
|
|
155
|
+
|
|
156
|
+
**Width.** The zone fills its column down to the 358 Mobile form column. Where the prompt does not fit on one line it wraps as one sentence, link words included, the icon stays on the first line and the zone grows past its floor.
|
|
157
|
+
|
|
158
|
+
<Canvas of={FileUploadStories.Width} />
|
|
159
|
+
|
|
160
|
+
**Below SM** (640) the prompt and uploading zones pad `--space-700` instead of `--space-900` (`py-700 sm:py-900`), so a wrapped prompt does not make the zone tall on a phone.
|
|
161
|
+
|
|
162
|
+
<Canvas of={FileUploadStories.Mobile} />
|
|
163
|
+
|
|
164
|
+
**Overflow.** The filename truncates on one line so the row actions stay put, and only its base shrinks: the base ends in an ellipsis, the extension stays whole («velmi-dlouhy-na….pdf»). The full name stays in the text, so a screen reader reads all of it, and in the `title` for a pointer user. The helper and the error message wrap.
|
|
165
|
+
|
|
166
|
+
<Canvas of={FileUploadStories.Overflow} />
|
|
167
|
+
|
|
168
|
+
## States
|
|
169
|
+
|
|
170
|
+
There is **no Hover, Active or Disabled state** (manifest: "No Hover state (parity with Text Field)"; `axes.state` has no Disabled), and **no Drag-over state**: drops work, but the highlight is planned, not built (manifest `backlog`). Default and Error are shown in the [Variants](#variants) matrix.
|
|
171
|
+
|
|
172
|
+
**Uploading** — the spinner replaces the prompt icon. With a numeric `progress` (clamped to 0–100) the fill grows to it from the start edge. Without one the bar draws no fill and claims no value (`aria-valuenow`, `aria-valuemin` and `aria-valuemax` are omitted): the manifest defines no indeterminate bar, so the spinner alone carries the activity. The input gets `aria-busy="true"`.
|
|
173
|
+
|
|
174
|
+
<Canvas of={FileUploadStories.Uploading} />
|
|
175
|
+
|
|
176
|
+
**Uploaded Image** — one image replaces the prompt with a preview row: thumbnail, filename, view and remove. The zone grows from 88 to 112. The `image` glyph is the placeholder until `previewUrl` is set; then the thumbnail shows the image (`object-cover`).
|
|
177
|
+
|
|
178
|
+
<Canvas of={FileUploadStories.UploadedImage} />
|
|
179
|
+
|
|
180
|
+
**Uploaded File** — a document gets the filename and remove only: no thumbnail and no view action.
|
|
181
|
+
|
|
182
|
+
<Canvas of={FileUploadStories.UploadedFile} />
|
|
183
|
+
|
|
184
|
+
**Uploaded Multi Files** — `multiple` keeps the prompt, so more files can be added, and appends a row per file below the helper row. Each row carries remove only (`slots.action-view` is Uploaded Image only).
|
|
185
|
+
|
|
186
|
+
<Canvas of={FileUploadStories.UploadedMultiFiles} />
|
|
187
|
+
|
|
188
|
+
**Error** — a non-empty `error` turns the shell border and the label `--status-danger` and replaces the helper with a `warning-circle` and the message in `--status-danger`. The prompt glyph stays `--secondary`: the family's Error icon colour addresses the status icon only (manifest `notes[5]`). The input gets `aria-invalid="true"`.
|
|
189
|
+
|
|
190
|
+
### Motion
|
|
191
|
+
|
|
192
|
+
Per the manifest `motion` block (1.10.3):
|
|
193
|
+
|
|
194
|
+
- **State swap** (prompt ↔ uploading ↔ uploaded): the outgoing content fades out over `--duration-fast` / `--easing-exit`, then the shell's height moves to the new content's (88 → 112 for Uploaded Image) on `--spring-gentle` while the new content fades in over `--duration-slow` / `--easing-enter`. The swap is keyed by the content state, so a `progress` update inside Uploading never re-runs it. The outgoing content is `inert` while it leaves.
|
|
195
|
+
- **File rows**: an added row fades in while the rows settle on `--spring-gentle`; a removed row fades out first, then the rows below close up. Rows present on the first render do not animate.
|
|
196
|
+
- **Progress fill**: grows by `scaleX` over `--duration-normal` / `--easing-standard`; it never slides.
|
|
197
|
+
- **Spinner**: `animate-spin`, one turn per `--duration-spin` on `--easing-linear`.
|
|
198
|
+
- **Reduced motion**: rows and previews appear and vanish at once and the height switches at once; the fill keeps tracking on `--duration-instant`; the spinner keeps turning (a loader is essential motion, manifest `motion.loop.reducedMotion`).
|
|
199
|
+
|
|
200
|
+
<Canvas of={FileUploadStories.Motion} />
|
|
201
|
+
|
|
202
|
+
## API
|
|
203
|
+
|
|
204
|
+
<Controls />
|
|
205
|
+
|
|
206
|
+
There is no `state`, `size` or `disabled` prop (see [Rationale](#rationale)). The `ref` reaches the native `<input type="file">`.
|
|
207
|
+
|
|
208
|
+
- **`label`** is required: it is the `<label>` of the input.
|
|
209
|
+
- **`files`** is an array of `FileUploadFile`: `{ id, name, kind?, previewUrl? }`. `kind` defaults to a document; `previewUrl` (e.g. an object URL) replaces the thumbnail placeholder.
|
|
210
|
+
- **`files` is controlled only**: there is no `defaultFiles`. This is a deliberate exception to the controlled / uncontrolled pair of COMPONENT-CODE-CONVENTIONS §2. The list is the consumer's upload state (what the server accepted, under which id, with which preview URL); the component renders it and never owns it. `onFilesSelect` and `onRemove` only report intents, so an internal copy would show files that were never uploaded or are already gone.
|
|
211
|
+
- **`loading`** is the manifest's Uploading state: the spinner and the progress bar, `aria-busy="true"` on the input, and the drop zone stops opening the picker and ignores a drop.
|
|
212
|
+
- **`onFilesSelect`** receives every picked or dropped file, verbatim. Nothing is cut to one file in single mode and nothing is filtered by `accept` (a drop never is), because files dropped silently cannot be explained to the user. Enforcing count, type and size, and saying so through `error`, is the consumer's job. The native value is cleared after each pick, so picking the same file again fires again.
|
|
213
|
+
- **`onView`** only reports the intent. Opening the full image is the consumer's job: the manifest carrier is a Compact `Modal` holding only the image, contained and never cropped (`slots.action-view`); the [Interactive](#usage) story shows it.
|
|
214
|
+
- **Copy props** default to Czech: `triggerLabel` «Nahrajte svůj soubor», `dropHintText` « nebo jej sem přetáhněte» (with its leading space), `viewLabel` «Zobrazit», `removeLabel` «Odebrat», `uploadingLabel` «Nahrávání souboru». An app with more language versions passes every one of them from its translations. `viewLabel` and `removeLabel` are prefixes: the action's accessible name is the prefix plus the filename.
|
|
215
|
+
|
|
216
|
+
## Do / Don't
|
|
217
|
+
|
|
218
|
+
- ✅ Keep the shell locked to Text Field: same border, radius, floating label and helper.
|
|
219
|
+
- ✅ Write the accepted formats into `helperText` («Logo musí být ve formátu jpg, jpeg, gif nebo png.»).
|
|
220
|
+
- ✅ Validate what `onFilesSelect` hands over (count, type, size) and say what was rejected through `error`.
|
|
221
|
+
- ✅ Write errors impersonally and problem-first («Soubor se nepodařilo nahrát.»).
|
|
222
|
+
- ✅ Give every attached file its remove action, and open the full image in a Modal from `onView`.
|
|
223
|
+
- ✅ Keep the field on a `--bg-primary` surface.
|
|
224
|
+
- ✅ Disable the field through a disabled `<fieldset>` around it.
|
|
225
|
+
- ❌ Don't restyle the shell independently of Text Field.
|
|
226
|
+
- ❌ Don't rely on the red border alone.
|
|
227
|
+
- ❌ Don't leave the accepted formats unstated: the user finds out by failing.
|
|
228
|
+
- ❌ Don't write a bare «Chyba» or «Něco se pokazilo».
|
|
229
|
+
- ❌ Don't assume `accept` or single mode filters the files: a drop is not filtered, and every file is handed over.
|
|
230
|
+
- ❌ Don't place it on a tinted or secondary background: the shell's fill and contrast are built for primary only.
|
|
231
|
+
- ❌ Don't wrap the field in a `<label>`: the trigger and the row actions are interactive content, and a label would forward every click to the input.
|
|
232
|
+
|
|
233
|
+
## Accessibility
|
|
234
|
+
|
|
235
|
+
- **Keyboard** — the native input is out of the tab order (`tabIndex={-1}`), so the keyboard path is the **trigger**, a `<button type="button">` (Enter / Space opens the picker programmatically), and each row's `IconButton`. Drag-and-drop is an enhancement on top of the picker, never the only path. A click on the shell itself opens the picker too, for the pointer only: the shell takes no focus and no role, a click on the trigger opens the picker once, a click on a row action does not open it, and while uploading the shell does not react (`cursor-pointer` is dropped). Focus shows on the trigger and the row actions through their own offset `:focus-visible` ring; the shell does not recolour on focus (manifest `focus.note`).
|
|
236
|
+
- **ARIA (what the component sets)** — the floating label is the `<label htmlFor>` of a real `<input type="file">`. The trigger is named through `aria-labelledby` by its own words plus the field label («Nahrajte svůj soubor Logo»), so two upload fields on one form do not offer the same button. Uploading sets `aria-busy="true"` on the input; Error sets `aria-invalid="true"`. While a helper or error message is shown, the input, the trigger and the view and remove buttons are described by it (`aria-describedby`): the input itself is never focused, so the controls are where focus lands. The file stack `<ul>` is named by the field label (`aria-labelledby`). The progress bar is `role="progressbar"`, named by `uploadingLabel`, with `aria-valuenow` only when a numeric `progress` is given.
|
|
237
|
+
- **Focus management** — focus moves only when it was lost: it fell to the body, its element left the document, or it sat inside a row that is leaving. It never moves away from something the user chose. After a remove in single mode, or after an upload that ends back on the prompt, focus goes to the trigger. After an upload that ends on a single file, it goes to the first action of the new content: view for an image, remove for a document. After a remove in the stack, it goes to the next row's remove, or to the trigger after the last row. A leaving row, a leaving stack and the outgoing zone content are `inert` while they fade out, so their actions cannot fire twice.
|
|
238
|
+
- **ARIA (what the consumer provides)** — `label`, always. In a product with more than one language, every copy prop, including the screen-reader-only `uploadingLabel` and the `viewLabel` / `removeLabel` prefixes.
|
|
239
|
+
- **Screen reader** — the helper / error row is a polite live region (`role="status"`, `aria-live="polite"`), always mounted, because the input is never focused and a region inserted together with its text is not announced. An error message lands there, and when an upload starts the `uploadingLabel` is said once there (screen-reader-only text). The progress values and the end of an upload are not announced. Each row action is named with the filename («Odebrat muj-soubor.pdf»), so a stack does not announce identical buttons. Every glyph is `aria-hidden="true"`; an uploaded image's `<img>` takes `alt=""`, because the filename beside it already names the file.
|
|
240
|
+
- **Non-colour signal (1.4.1)** — Error is carried by the `warning-circle` and the message text as well as the colour; the message wraps and is never truncated (WCAG 3.3.1).
|
|
241
|
+
- **Contrast** — every colour is a semantic token; the field is built for a `--bg-primary` surface only (manifest `notes`).
|
|
242
|
+
- **Motion** — under `prefers-reduced-motion` rows and previews appear and vanish at once and the zone height switches at once; the progress fill and the spinner keep moving (see [Motion](#motion)).
|
|
243
|
+
- **Disabled** — inside a disabled `<fieldset>` the input, the trigger and the row actions are disabled natively, and a drop or a click on the shell is ignored (the pointer cue falls back to the default cursor). The row actions dim through their own disabled styles; the trigger keeps its link ink, because the manifest defines no disabled look.
|
|
244
|
+
|
|
245
|
+
<Canvas of={FileUploadStories.Focus} />
|
|
246
|
+
|
|
247
|
+
Accessibility floor for every FODS component: `spec/01-foundations/accessibility.md`.
|
|
248
|
+
|
|
249
|
+
## Copy
|
|
250
|
+
|
|
251
|
+
Voice: the field copy rules of [`TextField`](?path=/docs/design-system-atoms-textfield--docs) apply unchanged — impersonal and neutral, clear over clever, concise, specific and helpful, consistent terminology. Examples are Czech; the rules hold for every language version.
|
|
252
|
+
|
|
253
|
+
- **Label** (`label`) — the field name in the floating notch, e.g. «Logo». 1–3 words; instructions go in the helper. Single line, truncates, max 24 characters.
|
|
254
|
+
- **Prompt** (`triggerLabel` + `dropHintText`) — the drop-zone call to action, one sentence without a terminal period: an action-verb trigger link plus the drag hint, «Nahrajte svůj soubor» + « nebo jej sem přetáhněte». It wraps as one text flow; keep it to one or two lines, max 60 characters.
|
|
255
|
+
- **Filename** (`files[].name`) — the file's own name, shown verbatim. Single line, truncates keeping the extension, max 40 characters. Never rename it or hide the extension.
|
|
256
|
+
- **Helper** (`helperText`) — the accepted formats or size limit: a format hint, not an instruction, e.g. «Logo musí být ve formátu jpg, jpeg, gif nebo png.». Wraps, never truncated, max 120 characters.
|
|
257
|
+
- **Error** (`error`) — impersonal and problem-first: state what failed plainly; where a rule was broken, name it. Not a bare label, not a command. It replaces the helper, wraps and must be fully visible (WCAG 3.3.1), max 140 characters.
|
|
258
|
+
|
|
259
|
+
<table>
|
|
260
|
+
<thead>
|
|
261
|
+
<tr><th>Run</th><th>✅ Write</th><th>❌ Don't write</th></tr>
|
|
262
|
+
</thead>
|
|
263
|
+
<tbody>
|
|
264
|
+
<tr><td>Prompt</td><td>Nahrajte svůj soubor nebo jej sem přetáhněte</td><td>Klikněte sem pro nahrání souboru prosím</td></tr>
|
|
265
|
+
<tr><td>Helper</td><td>Logo musí být ve formátu jpg, jpeg, gif nebo png.</td><td>Nahrajte prosím správný soubor</td></tr>
|
|
266
|
+
<tr><td>Error</td><td>Soubor se nepodařilo nahrát.</td><td>Chyba · Něco se pokazilo</td></tr>
|
|
267
|
+
<tr><td>Error (a broken rule)</td><td>Soubor je příliš velký — max. 5 MB</td><td>Chyba</td></tr>
|
|
268
|
+
<tr><td>Filename</td><td>muj-soubor.pdf</td><td>a renamed file, or a hidden extension</td></tr>
|
|
269
|
+
</tbody>
|
|
270
|
+
</table>
|
|
271
|
+
|
|
272
|
+
## Usage
|
|
273
|
+
|
|
274
|
+
```tsx
|
|
275
|
+
import { FileUpload, type FileUploadFile } from '@invoiceonline/ui-react';
|
|
276
|
+
|
|
277
|
+
// Good — a company logo: one image, a format hint, the state driven by the consumer
|
|
278
|
+
<FileUpload
|
|
279
|
+
label="Logo"
|
|
280
|
+
helperText="Logo musí být ve formátu jpg, jpeg, gif nebo png."
|
|
281
|
+
accept="image/png,image/jpeg,image/gif"
|
|
282
|
+
files={logo ? [logo] : []}
|
|
283
|
+
loading={uploading}
|
|
284
|
+
progress={progress}
|
|
285
|
+
error={error}
|
|
286
|
+
onFilesSelect={files => {
|
|
287
|
+
// Every picked or dropped file arrives here; counting them is the consumer's job.
|
|
288
|
+
if (files.length > 1) return setError('Vybráno více souborů — nahrát lze jen jeden');
|
|
289
|
+
upload(files[0]);
|
|
290
|
+
}}
|
|
291
|
+
onView={() => setPreviewOpen(true)}
|
|
292
|
+
onRemove={() => setLogo(null)}
|
|
293
|
+
/>
|
|
294
|
+
|
|
295
|
+
// Good — invoice attachments: the drop zone stays, a row per file below the helper
|
|
296
|
+
<FileUpload
|
|
297
|
+
label="Přílohy"
|
|
298
|
+
helperText="Přílohy musí být ve formátu pdf, jpg nebo png"
|
|
299
|
+
multiple
|
|
300
|
+
files={attachments}
|
|
301
|
+
onFilesSelect={addAttachments}
|
|
302
|
+
onRemove={id => setAttachments(current => current.filter(file => file.id !== id))}
|
|
303
|
+
/>
|
|
304
|
+
|
|
305
|
+
// Good — the view action opens the image in a Compact Modal
|
|
306
|
+
<Modal open={previewOpen} onClose={() => setPreviewOpen(false)} type="compact" size="md" title={logo?.name}>
|
|
307
|
+
{/* Contained, never cropped, capped at min(640px, 70vh) (manifest slots.action-view) */}
|
|
308
|
+
<img src={logo?.previewUrl} alt="" className="max-h-[min(640px,70vh)] w-full object-contain" />
|
|
309
|
+
</Modal>
|
|
310
|
+
|
|
311
|
+
// Good — disabled with the rest of the form section
|
|
312
|
+
<fieldset disabled={saving}>
|
|
313
|
+
<FileUpload label="Logo" files={logo ? [logo] : []} />
|
|
314
|
+
</fieldset>
|
|
315
|
+
|
|
316
|
+
// Don't — there is no state and no disabled prop; the state comes from content
|
|
317
|
+
<FileUpload label="Logo" state="error" disabled />
|
|
318
|
+
|
|
319
|
+
// Don't — a bare error label, and no format hint
|
|
320
|
+
<FileUpload label="Logo" error="Chyba" />
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
A consumer in miniature, kept in the story: pick or drop a file and the progress, the thumbnail, view (in a Modal) and remove all work; two files in single mode, or `shouldFail`, show the error copy.
|
|
324
|
+
|
|
325
|
+
<Canvas of={FileUploadStories.Interactive} />
|
|
326
|
+
|
|
327
|
+
## Related
|
|
328
|
+
|
|
329
|
+
- [`TextField`](?path=/docs/design-system-atoms-textfield--docs) — the field whose shell, floating label and helper row FileUpload reuses.
|
|
330
|
+
- [`Field`](?path=/docs/design-system-atoms-field--docs) — owns `floatingLabelVariants` and `helperTextVariants`, the recipes of the label and the helper row.
|
|
331
|
+
- [`TextLink`](?path=/docs/design-system-atoms-textlink--docs) — the trigger (Strong / md).
|
|
332
|
+
- [`IconButton`](?path=/docs/design-system-atoms-iconbutton--docs) — the view and remove row actions (Tertiary / md).
|
|
333
|
+
- [`Icon`](?path=/docs/design-system-atoms-icon--docs) — `upload-simple`, `spinner`, `image`, `warning-circle`, `eye`, `trash`.
|
|
334
|
+
- [`Modal`](?path=/docs/design-system-organisms-modal--docs) — the carrier of the view action (Compact).
|
|
335
|
+
- [`Select`](?path=/docs/design-system-organisms-select--docs) — for choosing from a fixed set instead.
|
|
336
|
+
- Spec: `spec/03-atoms/file-upload.md`
|
|
337
|
+
|
|
338
|
+
## Migration notes
|
|
339
|
+
|
|
340
|
+
From the spec § Migration notes.
|
|
341
|
+
|
|
342
|
+
- **Supersedes** the raw `<input type="file">` + hardcoded pink error badge. The badge maps to the **Error** state (border + `warning-circle` + message); browser-default chrome maps to the drop-zone shell.
|
|
343
|
+
- **Shell parity** — the shell is the Text Field shell, with the same `border/100` stroke as every other shell.
|
|
344
|
+
- **Open items** (manifest `backlog`): **per-file status + retry on the file row** (today every failure collapses into one field-level Error, so a partial failure in a multi-file stack cannot be expressed and a failed upload has no retry — needs a decision, it is a new state axis); **error timing is undefined** across the whole field family (three distinct failure moments here — client-side reject, mid-transfer failure, post-upload server reject — and no pattern doc owns the contract); a Drag-over state (not built); the 56-tall file rows vs the List Row recipe; the right-aligned view/remove cluster (designer-approved, recorded against the legacy left cluster).
|
|
345
|
+
- **No minWidth.** The earlier hard 416 px floor is gone: it pushed the drop-zone out of the 358 px Mobile form column. The prompt wraps instead (see [Sizes](#sizes)).
|