@danske/sapphire-react-lab 0.106.3 → 0.107.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/build/cjs/index.js +2557 -64
- package/build/cjs/index.js.map +1 -1
- package/build/esm/core/src/BreakpointProvider/useBreakpointContext.js +11 -0
- package/build/esm/core/src/BreakpointProvider/useBreakpointContext.js.map +1 -0
- package/build/esm/core/src/Flex/src/Flex.js +64 -0
- package/build/esm/core/src/Flex/src/Flex.js.map +1 -0
- package/build/esm/core/src/Grid/src/Grid.js +55 -0
- package/build/esm/core/src/Grid/src/Grid.js.map +1 -0
- package/build/esm/core/src/Icon/src/Icon.js +37 -0
- package/build/esm/core/src/Icon/src/Icon.js.map +1 -0
- package/build/esm/core/src/ListBox/i18n/da-DK.json.js +7 -0
- package/build/esm/core/src/ListBox/i18n/de-DE.json.js +7 -0
- package/build/esm/core/src/ListBox/i18n/en-US.json.js +7 -0
- package/build/esm/core/src/ListBox/i18n/fi-FI.json.js +7 -0
- package/build/esm/core/src/ListBox/i18n/index.js.map +1 -0
- package/build/esm/core/src/ListBox/i18n/nb-NO.json.js +7 -0
- package/build/esm/core/src/ListBox/i18n/pl-PL.json.js +7 -0
- package/build/esm/core/src/ListBox/i18n/sv-SE.json.js +7 -0
- package/build/esm/core/src/ListBox/src/ListBoxContext.js +8 -0
- package/build/esm/core/src/ListBox/src/ListBoxContext.js.map +1 -0
- package/build/esm/core/src/ListBox/src/ListBoxEmptyState.js +26 -0
- package/build/esm/core/src/ListBox/src/ListBoxEmptyState.js.map +1 -0
- package/build/esm/core/src/ListBox/src/ListBoxItemSkeleton.js +37 -0
- package/build/esm/core/src/ListBox/src/ListBoxItemSkeleton.js.map +1 -0
- package/build/esm/core/src/ListBox/src/ListBoxOption.js +105 -0
- package/build/esm/core/src/ListBox/src/ListBoxOption.js.map +1 -0
- package/build/esm/core/src/ListBox/src/ListBoxSection.js +86 -0
- package/build/esm/core/src/ListBox/src/ListBoxSection.js.map +1 -0
- package/build/esm/core/src/ListBox/src/StatelessListBox.js +162 -0
- package/build/esm/core/src/ListBox/src/StatelessListBox.js.map +1 -0
- package/build/esm/core/src/Pagination/src/usePaginationContext.js +8 -0
- package/build/esm/core/src/Pagination/src/usePaginationContext.js.map +1 -0
- package/build/esm/core/src/Popover/src/Popover.js +62 -0
- package/build/esm/core/src/Popover/src/Popover.js.map +1 -0
- package/build/esm/core/src/Radio/src/RadioBox.js +58 -0
- package/build/esm/core/src/Radio/src/RadioBox.js.map +1 -0
- package/build/esm/core/src/Separator/src/Separator.js +32 -0
- package/build/esm/core/src/Separator/src/Separator.js.map +1 -0
- package/build/esm/core/src/Skeleton/src/Skeleton.js +19 -0
- package/build/esm/core/src/Skeleton/src/Skeleton.js.map +1 -0
- package/build/esm/core/src/Skeleton/src/SkeletonCircle.js +39 -0
- package/build/esm/core/src/Skeleton/src/SkeletonCircle.js.map +1 -0
- package/build/esm/core/src/Skeleton/src/SkeletonText.js +59 -0
- package/build/esm/core/src/Skeleton/src/SkeletonText.js.map +1 -0
- package/build/esm/core/src/Skeleton/src/animation.js +4 -0
- package/build/esm/core/src/Skeleton/src/animation.js.map +1 -0
- package/build/esm/core/src/ThemeRoot/src/ThemeRoot.js +42 -0
- package/build/esm/core/src/ThemeRoot/src/ThemeRoot.js.map +1 -0
- package/build/esm/core/src/View/src/View.js +60 -0
- package/build/esm/core/src/View/src/View.js.map +1 -0
- package/build/esm/core/src/utils/SapphireStyleProps.js +48 -0
- package/build/esm/core/src/utils/SapphireStyleProps.js.map +1 -0
- package/build/esm/core/src/utils/useCollectionFocusProxy.js +53 -0
- package/build/esm/core/src/utils/useCollectionFocusProxy.js.map +1 -0
- package/build/esm/core/src/utils/usePreventTouchEnd.js +16 -0
- package/build/esm/core/src/utils/usePreventTouchEnd.js.map +1 -0
- package/build/esm/core/src/utils/useSapphireStyleProps.js +179 -0
- package/build/esm/core/src/utils/useSapphireStyleProps.js.map +1 -0
- package/build/esm/core/src/utils/useSapphireTextStyleProps.js +9 -0
- package/build/esm/core/src/utils/useSapphireTextStyleProps.js.map +1 -0
- package/build/esm/core/src/utils/useScrollCheck.js +38 -0
- package/build/esm/core/src/utils/useScrollCheck.js.map +1 -0
- package/build/esm/core/src/utils/useThemeCheck.js +14 -0
- package/build/esm/core/src/utils/useThemeCheck.js.map +1 -0
- package/build/esm/core/src/utils/virtualization/ListWithLoadingStateLayout.js +158 -0
- package/build/esm/core/src/utils/virtualization/ListWithLoadingStateLayout.js.map +1 -0
- package/build/esm/core/src/utils/virtualization/VariableWidthListLayout.js +69 -0
- package/build/esm/core/src/utils/virtualization/VariableWidthListLayout.js.map +1 -0
- package/build/esm/core/src/utils/virtualization/VirtualizerWithLoadingSkeleton.js +40 -0
- package/build/esm/core/src/utils/virtualization/VirtualizerWithLoadingSkeleton.js.map +1 -0
- package/build/esm/core/src/utils/virtualization/useListWithLoadingStateLayout.js +35 -0
- package/build/esm/core/src/utils/virtualization/useListWithLoadingStateLayout.js.map +1 -0
- package/build/esm/index.js +23 -20
- package/build/esm/index.js.map +1 -1
- package/build/esm/lab/src/Accordion/index.js.map +1 -0
- package/build/esm/lab/src/Accordion/src/Accordion.js.map +1 -0
- package/build/esm/lab/src/Accordion/src/AccordionContext.js.map +1 -0
- package/build/esm/lab/src/Accordion/src/AccordionHeading.js.map +1 -0
- package/build/esm/lab/src/Accordion/src/AccordionItem.js.map +1 -0
- package/build/esm/lab/src/Accordion/src/AccordionPanel.js.map +1 -0
- package/build/esm/lab/src/Accordion/src/utils.js.map +1 -0
- package/build/esm/lab/src/Alert/src/Alert.js.map +1 -0
- package/build/esm/lab/src/Amount/src/Amount.js.map +1 -0
- package/build/esm/lab/src/Amount/src/useGroupAmount.js.map +1 -0
- package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/da-DK.json.js +2 -2
- package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/de-DE.json.js +2 -2
- package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/en-US.json.js +2 -2
- package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/fi-FI.json.js +2 -2
- package/build/esm/lab/src/Autocomplete/i18n/index.js +20 -0
- package/build/esm/lab/src/Autocomplete/i18n/index.js.map +1 -0
- package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/nb-NO.json.js +2 -2
- package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/pl-PL.json.js +2 -2
- package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/sv-SE.json.js +2 -2
- package/build/esm/lab/src/Autocomplete/src/Autocomplete.js.map +1 -0
- package/build/esm/lab/src/Breadcrumbs/src/BreadcrumbItem.js.map +1 -0
- package/build/esm/lab/src/Breadcrumbs/src/BreadcrumbItemLink.js.map +1 -0
- package/build/esm/lab/src/Breadcrumbs/src/BreadcrumbItemStatic.js.map +1 -0
- package/build/esm/lab/src/Breadcrumbs/src/BreadcrumbOverflowMenu.js.map +1 -0
- package/build/esm/lab/src/Breadcrumbs/src/Breadcrumbs.js.map +1 -0
- package/build/esm/lab/src/Breadcrumbs/src/BreadcrumbsSeparator.js.map +1 -0
- package/build/esm/lab/src/Breadcrumbs/src/useBreadcrumbThreshold.js.map +1 -0
- package/build/esm/lab/src/DataGrid/index.js +9 -0
- package/build/esm/lab/src/DataGrid/index.js.map +1 -0
- package/build/esm/lab/src/DataGrid/src/DataGrid.js +463 -0
- package/build/esm/lab/src/DataGrid/src/DataGrid.js.map +1 -0
- package/build/esm/lab/src/DataGrid/src/DataGridCellContext.js +6 -0
- package/build/esm/lab/src/DataGrid/src/DataGridCellContext.js.map +1 -0
- package/build/esm/lab/src/DataGrid/src/EditableCellContent.js +125 -0
- package/build/esm/lab/src/DataGrid/src/EditableCellContent.js.map +1 -0
- package/build/esm/lab/src/DataGrid/src/createDataGridColumnHelper.js +15 -0
- package/build/esm/lab/src/DataGrid/src/createDataGridColumnHelper.js.map +1 -0
- package/build/esm/lab/src/DataGrid/src/useGridKeyboardNavigation.js +417 -0
- package/build/esm/lab/src/DataGrid/src/useGridKeyboardNavigation.js.map +1 -0
- package/build/esm/lab/src/DataGrid/src/useMeasureColumnWidths.js +55 -0
- package/build/esm/lab/src/DataGrid/src/useMeasureColumnWidths.js.map +1 -0
- package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/da-DK.json.js +2 -2
- package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/de-DE.json.js +2 -2
- package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/en-US.json.js +2 -2
- package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/fi-FI.json.js +2 -2
- package/build/esm/lab/src/FileDropzone/i18n/index.js.map +1 -0
- package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/nb-NO.json.js +2 -2
- package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/pl-PL.json.js +2 -2
- package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/sv-SE.json.js +2 -2
- package/build/esm/lab/src/FileDropzone/src/FileDropzone.js.map +1 -0
- package/build/esm/lab/src/FileDropzone/src/FileTrigger.js.map +1 -0
- package/build/esm/lab/src/FileDropzone/src/utils.js.map +1 -0
- package/build/esm/lab/src/Filtering/src/FilterDropdown.js.map +1 -0
- package/build/esm/{Filtering → lab/src/Filtering}/src/SearchableSelectFilter.js +2 -0
- package/build/esm/lab/src/Filtering/src/SearchableSelectFilter.js.map +1 -0
- package/build/esm/lab/src/Flag/src/Flag.js.map +1 -0
- package/build/esm/lab/src/LabeledValue/src/LabeledValue.js.map +1 -0
- package/build/esm/{NumberField → lab/src/NumberField}/i18n/da-DK.json.js +2 -2
- package/build/esm/{NumberField → lab/src/NumberField}/i18n/de-DE.json.js +2 -2
- package/build/esm/{NumberField → lab/src/NumberField}/i18n/en-US.json.js +2 -2
- package/build/esm/{NumberField → lab/src/NumberField}/i18n/fi-FI.json.js +2 -2
- package/build/esm/lab/src/NumberField/i18n/index.js.map +1 -0
- package/build/esm/{NumberField → lab/src/NumberField}/i18n/nb-NO.json.js +2 -2
- package/build/esm/{NumberField → lab/src/NumberField}/i18n/pl-PL.json.js +2 -2
- package/build/esm/{NumberField → lab/src/NumberField}/i18n/sv-SE.json.js +2 -2
- package/build/esm/lab/src/NumberField/src/NumberField.js.map +1 -0
- package/build/esm/lab/src/NumberField/src/StepperButton.js.map +1 -0
- package/build/esm/lab/src/NumberField/src/cursorHelpers.js.map +1 -0
- package/build/esm/lab/src/NumberField/src/formatHelpers.js.map +1 -0
- package/build/esm/lab/src/NumberField/src/keyboardHelpers.js.map +1 -0
- package/build/esm/lab/src/NumberField/src/useAutofillStyle.js.map +1 -0
- package/build/esm/lab/src/NumberField/src/useNumberFieldFormatting.js.map +1 -0
- package/build/esm/lab/src/NumberField/src/useSapphireNumberField.js.map +1 -0
- package/build/esm/lab/src/ProgressIndicator/src/ProgressIndicator.js.map +1 -0
- package/build/esm/lab/src/Sidebar/index.js.map +1 -0
- package/build/esm/lab/src/Sidebar/src/Body.js.map +1 -0
- package/build/esm/lab/src/Sidebar/src/ExpandableItem.js.map +1 -0
- package/build/esm/lab/src/Sidebar/src/Header.js.map +1 -0
- package/build/esm/lab/src/Sidebar/src/Item.js.map +1 -0
- package/build/esm/lab/src/Sidebar/src/List.js.map +1 -0
- package/build/esm/lab/src/Sidebar/src/Panel.js.map +1 -0
- package/build/esm/lab/src/Sidebar/src/ResponsiveSidebarContext.js.map +1 -0
- package/build/esm/lab/src/Sidebar/src/SecondarySidebarContext.js.map +1 -0
- package/build/esm/lab/src/Sidebar/src/Section.js.map +1 -0
- package/build/esm/lab/src/Sidebar/src/Sidebar.js.map +1 -0
- package/build/esm/lab/src/Sidebar/src/useSidebar.js.map +1 -0
- package/build/esm/lab/src/Slider/index.js.map +1 -0
- package/build/esm/lab/src/Slider/src/Slider.js.map +1 -0
- package/build/esm/lab/src/TagGroup/src/Tag.js.map +1 -0
- package/build/esm/lab/src/TagGroup/src/TagGroup.js.map +1 -0
- package/build/esm/lab/src/TagGroup/src/TagItem.js.map +1 -0
- package/build/esm/{TimeField → lab/src/TimeField}/i18n/da-DK.json.js +2 -2
- package/build/esm/lab/src/TimeField/i18n/da-DK.json.js.map +1 -0
- package/build/esm/{TimeField → lab/src/TimeField}/i18n/de-DE.json.js +2 -2
- package/build/esm/lab/src/TimeField/i18n/de-DE.json.js.map +1 -0
- package/build/esm/{TimeField → lab/src/TimeField}/i18n/en-US.json.js +2 -2
- package/build/esm/lab/src/TimeField/i18n/en-US.json.js.map +1 -0
- package/build/esm/{TimeField → lab/src/TimeField}/i18n/fi-FI.json.js +2 -2
- package/build/esm/lab/src/TimeField/i18n/fi-FI.json.js.map +1 -0
- package/build/esm/lab/src/TimeField/i18n/index.js.map +1 -0
- package/build/esm/{TimeField → lab/src/TimeField}/i18n/nb-NO.json.js +2 -2
- package/build/esm/lab/src/TimeField/i18n/nb-NO.json.js.map +1 -0
- package/build/esm/{TimeField → lab/src/TimeField}/i18n/pl-PL.json.js +2 -2
- package/build/esm/lab/src/TimeField/i18n/pl-PL.json.js.map +1 -0
- package/build/esm/{TimeField → lab/src/TimeField}/i18n/sv-SE.json.js +2 -2
- package/build/esm/lab/src/TimeField/i18n/sv-SE.json.js.map +1 -0
- package/build/esm/lab/src/TimeField/src/TimeField.js.map +1 -0
- package/build/esm/lab/src/TimeField/src/TimeFieldSegment.js.map +1 -0
- package/build/esm/lab/src/TruncateOverflow/src/TruncateOverflow.js +46 -0
- package/build/esm/lab/src/TruncateOverflow/src/TruncateOverflow.js.map +1 -0
- package/build/index.d.ts +551 -8
- package/package.json +7 -5
- package/build/esm/Accordion/index.js.map +0 -1
- package/build/esm/Accordion/src/Accordion.js.map +0 -1
- package/build/esm/Accordion/src/AccordionContext.js.map +0 -1
- package/build/esm/Accordion/src/AccordionHeading.js.map +0 -1
- package/build/esm/Accordion/src/AccordionItem.js.map +0 -1
- package/build/esm/Accordion/src/AccordionPanel.js.map +0 -1
- package/build/esm/Accordion/src/utils.js.map +0 -1
- package/build/esm/Alert/src/Alert.js.map +0 -1
- package/build/esm/Amount/src/Amount.js.map +0 -1
- package/build/esm/Amount/src/useGroupAmount.js.map +0 -1
- package/build/esm/Autocomplete/i18n/index.js.map +0 -1
- package/build/esm/Autocomplete/src/Autocomplete.js.map +0 -1
- package/build/esm/Breadcrumbs/src/BreadcrumbItem.js.map +0 -1
- package/build/esm/Breadcrumbs/src/BreadcrumbItemLink.js.map +0 -1
- package/build/esm/Breadcrumbs/src/BreadcrumbItemStatic.js.map +0 -1
- package/build/esm/Breadcrumbs/src/BreadcrumbOverflowMenu.js.map +0 -1
- package/build/esm/Breadcrumbs/src/Breadcrumbs.js.map +0 -1
- package/build/esm/Breadcrumbs/src/BreadcrumbsSeparator.js.map +0 -1
- package/build/esm/Breadcrumbs/src/useBreadcrumbThreshold.js.map +0 -1
- package/build/esm/FileDropzone/i18n/index.js.map +0 -1
- package/build/esm/FileDropzone/src/FileDropzone.js.map +0 -1
- package/build/esm/FileDropzone/src/FileTrigger.js.map +0 -1
- package/build/esm/FileDropzone/src/utils.js.map +0 -1
- package/build/esm/Filtering/src/FilterDropdown.js.map +0 -1
- package/build/esm/Filtering/src/SearchableSelectFilter.js.map +0 -1
- package/build/esm/Flag/src/Flag.js.map +0 -1
- package/build/esm/LabeledValue/src/LabeledValue.js.map +0 -1
- package/build/esm/NumberField/i18n/index.js.map +0 -1
- package/build/esm/NumberField/src/NumberField.js.map +0 -1
- package/build/esm/NumberField/src/StepperButton.js.map +0 -1
- package/build/esm/NumberField/src/cursorHelpers.js.map +0 -1
- package/build/esm/NumberField/src/formatHelpers.js.map +0 -1
- package/build/esm/NumberField/src/keyboardHelpers.js.map +0 -1
- package/build/esm/NumberField/src/useAutofillStyle.js.map +0 -1
- package/build/esm/NumberField/src/useNumberFieldFormatting.js.map +0 -1
- package/build/esm/NumberField/src/useSapphireNumberField.js.map +0 -1
- package/build/esm/ProgressIndicator/src/ProgressIndicator.js.map +0 -1
- package/build/esm/Sidebar/index.js.map +0 -1
- package/build/esm/Sidebar/src/Body.js.map +0 -1
- package/build/esm/Sidebar/src/ExpandableItem.js.map +0 -1
- package/build/esm/Sidebar/src/Header.js.map +0 -1
- package/build/esm/Sidebar/src/Item.js.map +0 -1
- package/build/esm/Sidebar/src/List.js.map +0 -1
- package/build/esm/Sidebar/src/Panel.js.map +0 -1
- package/build/esm/Sidebar/src/ResponsiveSidebarContext.js.map +0 -1
- package/build/esm/Sidebar/src/SecondarySidebarContext.js.map +0 -1
- package/build/esm/Sidebar/src/Section.js.map +0 -1
- package/build/esm/Sidebar/src/Sidebar.js.map +0 -1
- package/build/esm/Sidebar/src/useSidebar.js.map +0 -1
- package/build/esm/Slider/index.js.map +0 -1
- package/build/esm/Slider/src/Slider.js.map +0 -1
- package/build/esm/TagGroup/src/Tag.js.map +0 -1
- package/build/esm/TagGroup/src/TagGroup.js.map +0 -1
- package/build/esm/TagGroup/src/TagItem.js.map +0 -1
- package/build/esm/TimeField/i18n/index.js.map +0 -1
- package/build/esm/TimeField/src/TimeField.js.map +0 -1
- package/build/esm/TimeField/src/TimeFieldSegment.js.map +0 -1
- /package/build/esm/{TimeField → core/src/ListBox}/i18n/da-DK.json.js.map +0 -0
- /package/build/esm/{TimeField → core/src/ListBox}/i18n/de-DE.json.js.map +0 -0
- /package/build/esm/{TimeField → core/src/ListBox}/i18n/en-US.json.js.map +0 -0
- /package/build/esm/{TimeField → core/src/ListBox}/i18n/fi-FI.json.js.map +0 -0
- /package/build/esm/{TimeField → core/src/ListBox}/i18n/index.js +0 -0
- /package/build/esm/{TimeField → core/src/ListBox}/i18n/nb-NO.json.js.map +0 -0
- /package/build/esm/{TimeField → core/src/ListBox}/i18n/pl-PL.json.js.map +0 -0
- /package/build/esm/{TimeField → core/src/ListBox}/i18n/sv-SE.json.js.map +0 -0
- /package/build/esm/{Accordion → lab/src/Accordion}/index.js +0 -0
- /package/build/esm/{Accordion → lab/src/Accordion}/src/Accordion.js +0 -0
- /package/build/esm/{Accordion → lab/src/Accordion}/src/AccordionContext.js +0 -0
- /package/build/esm/{Accordion → lab/src/Accordion}/src/AccordionHeading.js +0 -0
- /package/build/esm/{Accordion → lab/src/Accordion}/src/AccordionItem.js +0 -0
- /package/build/esm/{Accordion → lab/src/Accordion}/src/AccordionPanel.js +0 -0
- /package/build/esm/{Accordion → lab/src/Accordion}/src/utils.js +0 -0
- /package/build/esm/{Alert → lab/src/Alert}/src/Alert.js +0 -0
- /package/build/esm/{Amount → lab/src/Amount}/src/Amount.js +0 -0
- /package/build/esm/{Amount → lab/src/Amount}/src/useGroupAmount.js +0 -0
- /package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/da-DK.json.js.map +0 -0
- /package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/de-DE.json.js.map +0 -0
- /package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/en-US.json.js.map +0 -0
- /package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/fi-FI.json.js.map +0 -0
- /package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/nb-NO.json.js.map +0 -0
- /package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/pl-PL.json.js.map +0 -0
- /package/build/esm/{Autocomplete → lab/src/Autocomplete}/i18n/sv-SE.json.js.map +0 -0
- /package/build/esm/{Autocomplete → lab/src/Autocomplete}/src/Autocomplete.js +0 -0
- /package/build/esm/{Breadcrumbs → lab/src/Breadcrumbs}/src/BreadcrumbItem.js +0 -0
- /package/build/esm/{Breadcrumbs → lab/src/Breadcrumbs}/src/BreadcrumbItemLink.js +0 -0
- /package/build/esm/{Breadcrumbs → lab/src/Breadcrumbs}/src/BreadcrumbItemStatic.js +0 -0
- /package/build/esm/{Breadcrumbs → lab/src/Breadcrumbs}/src/BreadcrumbOverflowMenu.js +0 -0
- /package/build/esm/{Breadcrumbs → lab/src/Breadcrumbs}/src/Breadcrumbs.js +0 -0
- /package/build/esm/{Breadcrumbs → lab/src/Breadcrumbs}/src/BreadcrumbsSeparator.js +0 -0
- /package/build/esm/{Breadcrumbs → lab/src/Breadcrumbs}/src/useBreadcrumbThreshold.js +0 -0
- /package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/da-DK.json.js.map +0 -0
- /package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/de-DE.json.js.map +0 -0
- /package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/en-US.json.js.map +0 -0
- /package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/fi-FI.json.js.map +0 -0
- /package/build/esm/{Autocomplete → lab/src/FileDropzone}/i18n/index.js +0 -0
- /package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/nb-NO.json.js.map +0 -0
- /package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/pl-PL.json.js.map +0 -0
- /package/build/esm/{FileDropzone → lab/src/FileDropzone}/i18n/sv-SE.json.js.map +0 -0
- /package/build/esm/{FileDropzone → lab/src/FileDropzone}/src/FileDropzone.js +0 -0
- /package/build/esm/{FileDropzone → lab/src/FileDropzone}/src/FileTrigger.js +0 -0
- /package/build/esm/{FileDropzone → lab/src/FileDropzone}/src/utils.js +0 -0
- /package/build/esm/{Filtering → lab/src/Filtering}/src/FilterDropdown.js +0 -0
- /package/build/esm/{Flag → lab/src/Flag}/src/Flag.js +0 -0
- /package/build/esm/{LabeledValue → lab/src/LabeledValue}/src/LabeledValue.js +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/i18n/da-DK.json.js.map +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/i18n/de-DE.json.js.map +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/i18n/en-US.json.js.map +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/i18n/fi-FI.json.js.map +0 -0
- /package/build/esm/{FileDropzone → lab/src/NumberField}/i18n/index.js +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/i18n/nb-NO.json.js.map +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/i18n/pl-PL.json.js.map +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/i18n/sv-SE.json.js.map +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/src/NumberField.js +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/src/StepperButton.js +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/src/cursorHelpers.js +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/src/formatHelpers.js +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/src/keyboardHelpers.js +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/src/useAutofillStyle.js +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/src/useNumberFieldFormatting.js +0 -0
- /package/build/esm/{NumberField → lab/src/NumberField}/src/useSapphireNumberField.js +0 -0
- /package/build/esm/{ProgressIndicator → lab/src/ProgressIndicator}/src/ProgressIndicator.js +0 -0
- /package/build/esm/{Sidebar → lab/src/Sidebar}/index.js +0 -0
- /package/build/esm/{Sidebar → lab/src/Sidebar}/src/Body.js +0 -0
- /package/build/esm/{Sidebar → lab/src/Sidebar}/src/ExpandableItem.js +0 -0
- /package/build/esm/{Sidebar → lab/src/Sidebar}/src/Header.js +0 -0
- /package/build/esm/{Sidebar → lab/src/Sidebar}/src/Item.js +0 -0
- /package/build/esm/{Sidebar → lab/src/Sidebar}/src/List.js +0 -0
- /package/build/esm/{Sidebar → lab/src/Sidebar}/src/Panel.js +0 -0
- /package/build/esm/{Sidebar → lab/src/Sidebar}/src/ResponsiveSidebarContext.js +0 -0
- /package/build/esm/{Sidebar → lab/src/Sidebar}/src/SecondarySidebarContext.js +0 -0
- /package/build/esm/{Sidebar → lab/src/Sidebar}/src/Section.js +0 -0
- /package/build/esm/{Sidebar → lab/src/Sidebar}/src/Sidebar.js +0 -0
- /package/build/esm/{Sidebar → lab/src/Sidebar}/src/useSidebar.js +0 -0
- /package/build/esm/{Slider → lab/src/Slider}/index.js +0 -0
- /package/build/esm/{Slider → lab/src/Slider}/src/Slider.js +0 -0
- /package/build/esm/{TagGroup → lab/src/TagGroup}/src/Tag.js +0 -0
- /package/build/esm/{TagGroup → lab/src/TagGroup}/src/TagGroup.js +0 -0
- /package/build/esm/{TagGroup → lab/src/TagGroup}/src/TagItem.js +0 -0
- /package/build/esm/{NumberField → lab/src/TimeField}/i18n/index.js +0 -0
- /package/build/esm/{TimeField → lab/src/TimeField}/src/TimeField.js +0 -0
- /package/build/esm/{TimeField → lab/src/TimeField}/src/TimeFieldSegment.js +0 -0
package/build/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { ReactNode, Key, ReactElement, RefObject } from 'react';
|
|
2
|
+
import React__default, { ReactNode, Key, ReactElement, RefObject, FormEvent } from 'react';
|
|
3
3
|
import * as _react_types_shared from '@react-types/shared';
|
|
4
|
-
import { DOMProps, AriaLabelingProps, PressEvents, FocusableRefValue, CollectionBase, ItemProps } from '@react-types/shared';
|
|
4
|
+
import { DOMProps, AriaLabelingProps, PressEvents, FocusableRefValue, CollectionBase, ItemProps, DisabledBehavior } from '@react-types/shared';
|
|
5
5
|
import * as _danske_sapphire_react from '@danske/sapphire-react';
|
|
6
|
-
import { GlobalDomAttributes, SapphireStyleProps, TypographyHeadingProps, TypographyBodyProps, ListBoxProps, ButtonProps, PopoverTriggerProps, SearchFieldPropsWithRef, IconButtonProps, ThemeVariant, FieldProps } from '@danske/sapphire-react';
|
|
6
|
+
import { GlobalDomAttributes, SapphireStyleProps, TypographyHeadingProps, TypographyBodyProps, ListBoxProps, ButtonProps, PopoverTriggerProps, SearchFieldPropsWithRef, IconButtonProps, ThemeVariant, FieldProps, SapphireViewStyleProps, ColumnAlignment, CellSpacing, StickyPosition } from '@danske/sapphire-react';
|
|
7
7
|
import { DisclosureGroupProps, DisclosureProps, DisclosurePanelProps, BreadcrumbsProps as BreadcrumbsProps$1, BreadcrumbProps, SliderProps as SliderProps$1, SliderThumbProps, TimeValue } from 'react-aria-components';
|
|
8
8
|
import { ComboBoxProps } from 'react-stately/useComboBoxState';
|
|
9
9
|
import { HoverProps } from 'react-aria/useHover';
|
|
@@ -11,6 +11,7 @@ import { DropOptions } from 'react-aria/useDrop';
|
|
|
11
11
|
import { AriaNumberFieldProps } from 'react-aria/useNumberField';
|
|
12
12
|
import { FocusWithinProps } from 'react-aria/useFocusWithin';
|
|
13
13
|
import { AriaTimeFieldProps } from 'react-aria/useTimeField';
|
|
14
|
+
import { SortDirection } from '@react-types/shared/src/collections';
|
|
14
15
|
export { useLocale } from 'react-aria/I18nProvider';
|
|
15
16
|
|
|
16
17
|
interface AccordionProps extends GlobalDomAttributes, SapphireStyleProps, DOMProps, Pick<DisclosureGroupProps, 'allowsMultipleExpanded' | 'expandedKeys' | 'defaultExpandedKeys' | 'onExpandedChange' | 'children' | 'isDisabled'> {
|
|
@@ -162,9 +163,9 @@ declare type BreadcrumbsProps<T extends object> = Pick<BreadcrumbsProps$1<T>, 'a
|
|
|
162
163
|
maxWidth?: React__default.CSSProperties['maxWidth'];
|
|
163
164
|
} & SapphireStyleProps & GlobalDomAttributes;
|
|
164
165
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
166
|
+
* Shows the path to the current page through a hierarchical trail of links,
|
|
167
|
+
* helping users understand their location within the application and navigate back to
|
|
168
|
+
* parent pages.
|
|
168
169
|
*/
|
|
169
170
|
declare const Breadcrumbs: <T extends object>(props: Pick<BreadcrumbsProps$1<T>, "children" | "isDisabled" | "aria-label"> & {
|
|
170
171
|
/**
|
|
@@ -627,6 +628,9 @@ declare type ProgressIndicatorProps = {
|
|
|
627
628
|
} | {
|
|
628
629
|
'aria-label': string;
|
|
629
630
|
});
|
|
631
|
+
/**
|
|
632
|
+
* When users need a visual representation of how far along a process or operation is, either as a continuous bar or divided into discrete segments.
|
|
633
|
+
*/
|
|
630
634
|
declare const ProgressIndicator: (props: ProgressIndicatorProps) => JSX.Element;
|
|
631
635
|
|
|
632
636
|
declare type SliderProps = {
|
|
@@ -746,6 +750,9 @@ declare type TimeFieldProps<T extends TimeValue> = Pick<AriaTimeFieldProps<T>, '
|
|
|
746
750
|
*/
|
|
747
751
|
contextualHelp?: ReactNode;
|
|
748
752
|
};
|
|
753
|
+
/**
|
|
754
|
+
* For collecting a specific time value from users with a segmented, locale-aware input that supports keyboard navigation between hours and minutes.
|
|
755
|
+
*/
|
|
749
756
|
declare const TimeField: <T extends TimeValue>(props: Pick<AriaTimeFieldProps<T>, "isDisabled" | "onFocus" | "onBlur" | "value" | "defaultValue" | "onChange" | "label" | "isRequired" | "isReadOnly" | "shouldForceLeadingZeros"> & SapphireStyleProps & Pick<_react_types_shared.GlobalDOMAttributes<Element>, "translate" | "dir" | "lang" | "inert"> & Pick<_react_types_shared.DOMProps, "id"> & {
|
|
750
757
|
/**
|
|
751
758
|
* @default 'lg'
|
|
@@ -792,5 +799,541 @@ declare const TimeField: <T extends TimeValue>(props: Pick<AriaTimeFieldProps<T>
|
|
|
792
799
|
ref?: React__default.RefObject<HTMLDivElement> | undefined;
|
|
793
800
|
}) => React__default.ReactElement;
|
|
794
801
|
|
|
795
|
-
|
|
796
|
-
|
|
802
|
+
interface TruncateOverflowProps extends SapphireViewStyleProps {
|
|
803
|
+
/** Content to truncate. */
|
|
804
|
+
children: React__default.ReactNode;
|
|
805
|
+
/**
|
|
806
|
+
* Overrides the tooltip shown when the text is truncated.
|
|
807
|
+
* When omitted, the tooltip is derived automatically from the `children` if
|
|
808
|
+
* it's a string or from element's `textContent` otherwise.
|
|
809
|
+
*/
|
|
810
|
+
tooltip?: React__default.ReactNode;
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Renders its children in a block that clips overflowing text with an ellipsis.
|
|
814
|
+
* When the text is actually truncated, a tooltip is shown on hover with
|
|
815
|
+
* the full content.
|
|
816
|
+
*/
|
|
817
|
+
declare const TruncateOverflow: React__default.ForwardRefExoticComponent<TruncateOverflowProps & React__default.RefAttributes<HTMLSpanElement>>;
|
|
818
|
+
|
|
819
|
+
interface EditableCellContentProps extends SapphireStyleProps {
|
|
820
|
+
/**
|
|
821
|
+
* The display value rendered when not editing.
|
|
822
|
+
*/
|
|
823
|
+
children?: React__default.ReactNode;
|
|
824
|
+
/**
|
|
825
|
+
* A function that renders the editable form content.
|
|
826
|
+
* This should typically contain form inputs like {@link TextField} or {@link Select}.
|
|
827
|
+
*/
|
|
828
|
+
renderEditor: () => ReactNode;
|
|
829
|
+
/**
|
|
830
|
+
* Callback fired when the user submits the edit (via Enter key or checkmark button).
|
|
831
|
+
* If this returns false, the editor popover is not closed. This is useful
|
|
832
|
+
* when the field contains errors.
|
|
833
|
+
*/
|
|
834
|
+
onSubmit?: (e: FormEvent<HTMLFormElement>) => boolean | void;
|
|
835
|
+
/**
|
|
836
|
+
* Callback fired when the user cancels the edit (via Escape key).
|
|
837
|
+
*/
|
|
838
|
+
onCancel?: () => void;
|
|
839
|
+
/**
|
|
840
|
+
* aria-label of the edit button
|
|
841
|
+
* @default: 'Edit'
|
|
842
|
+
*/
|
|
843
|
+
editButtonLabel?: string;
|
|
844
|
+
/**
|
|
845
|
+
* aria-label of the save button
|
|
846
|
+
* @default: 'Save'
|
|
847
|
+
*/
|
|
848
|
+
saveButtonLabel?: string;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* The interaction that triggered an `onSelectionChange` callback.
|
|
853
|
+
*
|
|
854
|
+
* - `'select-all'` — the user clicked the "Select all" header checkbox.
|
|
855
|
+
* - `'select'` — the user selected or deselected an individual row.
|
|
856
|
+
*/
|
|
857
|
+
declare type DataGridSelectionInteraction = 'select-all' | 'select';
|
|
858
|
+
/**
|
|
859
|
+
* Determines how column widths are calculated.
|
|
860
|
+
*
|
|
861
|
+
* - `'auto'` — uses the browser's native
|
|
862
|
+
* [`table-layout: auto`](https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout) algorithm.
|
|
863
|
+
* - `'fixed'` — uses the browser's native
|
|
864
|
+
* [`table-layout: fixed`](https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout) algorithm.
|
|
865
|
+
*/
|
|
866
|
+
declare type Layout = 'auto' | 'fixed';
|
|
867
|
+
/**
|
|
868
|
+
* Column sizing options when using `layout="fixed"`.
|
|
869
|
+
* Only `width` is effective in fixed table layout; `minWidth` and `maxWidth` have no effect.
|
|
870
|
+
*
|
|
871
|
+
* Note: this type is the *most restrictive* column sizing shape. A value of
|
|
872
|
+
* this type is structurally assignable to both fixed- and auto-mode column
|
|
873
|
+
* arrays, which is what lets column helpers return "mode-agnostic" columns
|
|
874
|
+
* (and therefore reusable) whenever `minWidth`/`maxWidth` are not used.
|
|
875
|
+
*/
|
|
876
|
+
interface FixedColumnSizing {
|
|
877
|
+
/**
|
|
878
|
+
* Width of the column. Accepts a pixel count (`number`) or any valid CSS `width` value
|
|
879
|
+
* (`string`, e.g. `'50%'`). In fixed layout this is the exact column width.
|
|
880
|
+
*/
|
|
881
|
+
width?: number | string;
|
|
882
|
+
/** @internal Not available in fixed layout */
|
|
883
|
+
minWidth?: never;
|
|
884
|
+
/** @internal Not available in fixed layout */
|
|
885
|
+
maxWidth?: never;
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* Column sizing options when using `layout="auto"`.
|
|
889
|
+
* All three properties are treated as hints by the browser's sizing algorithm —
|
|
890
|
+
* see the `"auto"` docs section for caveats.
|
|
891
|
+
*/
|
|
892
|
+
interface AutoColumnSizing {
|
|
893
|
+
/**
|
|
894
|
+
* Preferred width hint. Accepts a pixel count (`number`) or any valid CSS `width` value
|
|
895
|
+
* (`string`, e.g. `'50%'`, `'10rem'`). Pass `0` to make the column as narrow as its
|
|
896
|
+
* content — useful for icon or action button columns.
|
|
897
|
+
*/
|
|
898
|
+
width?: number | string;
|
|
899
|
+
/**
|
|
900
|
+
* Minimum width of the column. Accepts a pixel count (`number`) or any valid CSS
|
|
901
|
+
* `min-width` value (`string`).
|
|
902
|
+
*/
|
|
903
|
+
minWidth?: number | string;
|
|
904
|
+
/**
|
|
905
|
+
* Maximum width of the column. Accepts a pixel count (`number`) or any valid CSS
|
|
906
|
+
* `max-width` value (`string`).
|
|
907
|
+
*/
|
|
908
|
+
maxWidth?: number | string;
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* Sizing shape available for a given {@link Layout}.
|
|
912
|
+
*/
|
|
913
|
+
declare type ColumnSizingFor<TMode extends Layout> = TMode extends 'fixed' ? FixedColumnSizing : AutoColumnSizing;
|
|
914
|
+
/**
|
|
915
|
+
* Context passed to a column's `cell` renderer.
|
|
916
|
+
*
|
|
917
|
+
* - `row` — the plain row data (`TData`).
|
|
918
|
+
* - `value` — the cell value, typed from `accessorKey` / `accessorFn`.
|
|
919
|
+
* For display columns (no accessor) this is `undefined`.
|
|
920
|
+
* - `rowIndex` — the zero-based index of the row within the current data.
|
|
921
|
+
* - `context` — the `context` object passed to the DataGrid. Typed via the
|
|
922
|
+
* `TContext` generic.
|
|
923
|
+
*/
|
|
924
|
+
interface DataGridBodyCellRenderProps<TData, TValue, TContext> extends DataGridCellRendererProps<TContext> {
|
|
925
|
+
/** The cell value (typed from `accessorKey`/`accessorFn`). */
|
|
926
|
+
value: TValue;
|
|
927
|
+
/** The row data. */
|
|
928
|
+
rowData: TData;
|
|
929
|
+
/** Zero-based row index in the current data. */
|
|
930
|
+
rowIndex: number;
|
|
931
|
+
}
|
|
932
|
+
interface DataGridCellRendererProps<TContext> {
|
|
933
|
+
/** Custom context object passed via the DataGrid `context` prop. */
|
|
934
|
+
context: TContext;
|
|
935
|
+
}
|
|
936
|
+
/**
|
|
937
|
+
* Props shared by all DataGrid column definitions, regardless of column kind
|
|
938
|
+
* (accessor / accessor function / display) and sizing mode.
|
|
939
|
+
*/
|
|
940
|
+
interface DataGridColumnShared<TMode extends Layout, TContext> {
|
|
941
|
+
/** Stable id for the column. Required for display columns. */
|
|
942
|
+
id?: string;
|
|
943
|
+
/** Header rendered in the column's header cell. */
|
|
944
|
+
header?: ReactNode | (({ context }: DataGridCellRendererProps<TContext>) => ReactNode);
|
|
945
|
+
/** Footer rendered in the column's footer cell. */
|
|
946
|
+
footer?: ReactNode | (({ context }: DataGridCellRendererProps<TContext>) => ReactNode);
|
|
947
|
+
/** Whether sorting can be toggled on this column. */
|
|
948
|
+
enableSorting?: boolean;
|
|
949
|
+
/** Horizontal alignment of cell content. Defaults to `'left'`. */
|
|
950
|
+
align?: ColumnAlignment;
|
|
951
|
+
/** Whether this column is a [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader). */
|
|
952
|
+
isRowHeader?: boolean;
|
|
953
|
+
/**
|
|
954
|
+
* Custom skeleton loading content for this column. Receives the skeleton row
|
|
955
|
+
* index and returns a `ReactNode` to render inside the cell while the grid is
|
|
956
|
+
* in a loading state. Defaults to `<Skeleton.Text>`.
|
|
957
|
+
*/
|
|
958
|
+
renderLoadingSkeleton?: (rowIndex: number) => ReactNode;
|
|
959
|
+
/** Column width/min/max (shape depends on sizing mode). */
|
|
960
|
+
sizing?: ColumnSizingFor<TMode>;
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Accessor column — reads a value directly from a property of `TData` by key.
|
|
964
|
+
* `value` in the cell renderer is typed as `TData[TKey]`.
|
|
965
|
+
*/
|
|
966
|
+
interface DataGridAccessorKeyColumn<TData, TKey extends keyof TData, TContext, TMode extends Layout> extends DataGridColumnShared<TMode, TContext> {
|
|
967
|
+
accessorKey: TKey;
|
|
968
|
+
accessorFn?: never;
|
|
969
|
+
cell?: (context: DataGridBodyCellRenderProps<TData, TData[TKey], TContext>) => ReactNode;
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Accessor-function column — derives the value via a function of `TData`.
|
|
973
|
+
* `value` in the cell renderer is typed as the function's return type.
|
|
974
|
+
* `id` is required since there is no `accessorKey` to derive it from.
|
|
975
|
+
*/
|
|
976
|
+
interface DataGridAccessorFnColumn<TData, TValue, TContext, TMode extends Layout> extends DataGridColumnShared<TMode, TContext> {
|
|
977
|
+
id: string;
|
|
978
|
+
accessorKey?: never;
|
|
979
|
+
accessorFn: (row: TData) => TValue;
|
|
980
|
+
cell?: (context: DataGridBodyCellRenderProps<TData, TValue, TContext>) => ReactNode;
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* Display column — no accessor. `value` in the cell renderer is `undefined`.
|
|
984
|
+
* Typically used for action columns that render controls derived only from
|
|
985
|
+
* row data / custom context.
|
|
986
|
+
*/
|
|
987
|
+
interface DataGridDisplayColumn<TData, TContext, TMode extends Layout> extends DataGridColumnShared<TMode, TContext> {
|
|
988
|
+
id: string;
|
|
989
|
+
accessorKey?: never;
|
|
990
|
+
accessorFn?: never;
|
|
991
|
+
cell?: (context: DataGridBodyCellRenderProps<TData, undefined, TContext>) => ReactNode;
|
|
992
|
+
}
|
|
993
|
+
/**
|
|
994
|
+
* A column definition. Union of:
|
|
995
|
+
* - {@link DataGridAccessorKeyColumn} — one per key of `TData`, with `value` typed as `TData[K]`
|
|
996
|
+
* - {@link DataGridAccessorFnColumn} — `value` typed from the `accessorFn` return
|
|
997
|
+
* - {@link DataGridDisplayColumn} — no accessor, `value` is `undefined`
|
|
998
|
+
*
|
|
999
|
+
* Generic order is `<TData, TMode, TContext>`: the sizing mode is the most
|
|
1000
|
+
* common "second argument" consumers need, and `TContext` defaults to
|
|
1001
|
+
* `undefined` so the single-arg form works.
|
|
1002
|
+
*/
|
|
1003
|
+
declare type DataGridColumn<TData, TMode extends Layout = 'auto', TContext = undefined> = {
|
|
1004
|
+
[K in keyof TData]: DataGridAccessorKeyColumn<TData, K, TContext, TMode>;
|
|
1005
|
+
}[keyof TData] | DataGridAccessorFnColumn<TData, unknown, TContext, TMode> | DataGridDisplayColumn<TData, TContext, TMode>;
|
|
1006
|
+
declare type DataGridSelectionMode = 'none' | 'single' | 'multiple';
|
|
1007
|
+
interface DataGridSortDescriptor {
|
|
1008
|
+
/** The id of the column to sort by. */
|
|
1009
|
+
column: string;
|
|
1010
|
+
/** The direction to sort by. */
|
|
1011
|
+
direction: SortDirection;
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* Context-ergonomics helper: when `TContext` is `undefined` (consumer didn't
|
|
1015
|
+
* specify a context type), the `context` prop is optional. Otherwise it is
|
|
1016
|
+
* required, mirroring the shape of the column definitions.
|
|
1017
|
+
*/
|
|
1018
|
+
declare type ContextProp<TContext> = [TContext] extends [undefined] ? {
|
|
1019
|
+
context?: undefined;
|
|
1020
|
+
} : {
|
|
1021
|
+
/**
|
|
1022
|
+
* Object passed to every cell renderer as `context`. Use it to share
|
|
1023
|
+
* table-level state or callbacks (e.g. editing handlers) with cells
|
|
1024
|
+
* without closing over ad-hoc references in every column `cell`.
|
|
1025
|
+
*/
|
|
1026
|
+
context: TContext;
|
|
1027
|
+
};
|
|
1028
|
+
declare type DataGridProps<TData, TContext = undefined> = ({
|
|
1029
|
+
layout?: 'auto';
|
|
1030
|
+
/** Column definitions */
|
|
1031
|
+
columns: DataGridColumn<TData, 'auto', TContext>[];
|
|
1032
|
+
} | {
|
|
1033
|
+
layout: 'fixed';
|
|
1034
|
+
/** Column definitions */
|
|
1035
|
+
columns: DataGridColumn<TData, 'fixed', TContext>[];
|
|
1036
|
+
}) & SapphireStyleProps & DOMProps & ContextProp<TContext> & {
|
|
1037
|
+
/** Accessibility label for the grid */
|
|
1038
|
+
'aria-label': string;
|
|
1039
|
+
/** Row data */
|
|
1040
|
+
data: TData[];
|
|
1041
|
+
/**
|
|
1042
|
+
* The spacing inside table cells.
|
|
1043
|
+
* @default 'md'
|
|
1044
|
+
*/
|
|
1045
|
+
cellSpacing?: CellSpacing;
|
|
1046
|
+
/**
|
|
1047
|
+
* Default sorting state. Used for initializing uncontrolled sorting.
|
|
1048
|
+
*/
|
|
1049
|
+
defaultSortDescriptor?: DataGridSortDescriptor;
|
|
1050
|
+
/**
|
|
1051
|
+
* The current sort state. Used for controlled sorting.
|
|
1052
|
+
* If not provided, the component will manage its own sort state.
|
|
1053
|
+
*/
|
|
1054
|
+
sortDescriptor?: DataGridSortDescriptor;
|
|
1055
|
+
/**
|
|
1056
|
+
* Called when the sort state changes.
|
|
1057
|
+
* Use together with `sortingDescriptor` for controlled sorting.
|
|
1058
|
+
*/
|
|
1059
|
+
onSortChange?: (sorting: DataGridSortDescriptor | undefined) => void;
|
|
1060
|
+
/**
|
|
1061
|
+
* Function to derive a stable unique identifier for each row.
|
|
1062
|
+
* Defaults to the row's index. Provide this when using controlled selection
|
|
1063
|
+
* or when row order can change (e.g. after sorting).
|
|
1064
|
+
*/
|
|
1065
|
+
getRowId?: (row: TData, index: number) => string;
|
|
1066
|
+
/**
|
|
1067
|
+
* Enables row selection. Pass `'single'` for single-row selection or
|
|
1068
|
+
* `'multiple'` for multi-row selection with a "select all" header checkbox.
|
|
1069
|
+
*/
|
|
1070
|
+
selectionMode?: DataGridSelectionMode;
|
|
1071
|
+
/**
|
|
1072
|
+
* When `true`, no user interaction can result in an empty selection.
|
|
1073
|
+
* In single-selection mode, radio buttons are rendered instead of checkboxes
|
|
1074
|
+
* to communicate this to users.
|
|
1075
|
+
* Has no effect on the initial or controlled state.
|
|
1076
|
+
*/
|
|
1077
|
+
disallowEmptySelection?: boolean;
|
|
1078
|
+
/**
|
|
1079
|
+
* The currently selected row ids (controlled).
|
|
1080
|
+
* Use together with `onSelectionChange`.
|
|
1081
|
+
*/
|
|
1082
|
+
selectedRowIds?: string[];
|
|
1083
|
+
/**
|
|
1084
|
+
* Default selected row ids (uncontrolled).
|
|
1085
|
+
*/
|
|
1086
|
+
defaultSelectedRowIds?: string[];
|
|
1087
|
+
/**
|
|
1088
|
+
* Called when the selection changes with the new array of selected row ids
|
|
1089
|
+
* and the interaction that triggered the change.
|
|
1090
|
+
*
|
|
1091
|
+
* - `'select-all'` — the user clicked the "Select all" header checkbox.
|
|
1092
|
+
* - `'select'` — the user selected or deselected an individual row.
|
|
1093
|
+
*/
|
|
1094
|
+
onSelectionChange?: (selectedRowsIds: string[], interaction: DataGridSelectionInteraction) => void;
|
|
1095
|
+
/**
|
|
1096
|
+
* Content to show when there are no rows to display. Can be used to
|
|
1097
|
+
* communicate empty, or error state. The value is typically a
|
|
1098
|
+
* {@link FeedbackMessage} element. For loading state, render skeleton
|
|
1099
|
+
* loading rows using {@link loadingState} prop.
|
|
1100
|
+
*/
|
|
1101
|
+
emptyState?: ReactNode;
|
|
1102
|
+
/**
|
|
1103
|
+
* Whether the grid is currently loading data.
|
|
1104
|
+
* When set to `'loading'`, the grid will show loading skeleton rows instead of the actual content.
|
|
1105
|
+
* When set to `'loadingMore'`, the grid will show loading skeleton rows in addition to the actual content.
|
|
1106
|
+
* Use this for "infinite scrolling" scenarios when you want to indicate that more content is being loaded, but you
|
|
1107
|
+
* still have some content to show.
|
|
1108
|
+
**/
|
|
1109
|
+
loadingState?: 'loading' | 'loadingMore';
|
|
1110
|
+
/**
|
|
1111
|
+
* Number of loading skeleton rows to render when {@link loadingState} is set.
|
|
1112
|
+
* Use it to match amount of actual content rows being loaded as closely as possible.
|
|
1113
|
+
* @default 3
|
|
1114
|
+
*/
|
|
1115
|
+
loadingSkeletonRowsCount?: number;
|
|
1116
|
+
/**
|
|
1117
|
+
* Whether to hide the divider after the last row.
|
|
1118
|
+
* @default false
|
|
1119
|
+
*/
|
|
1120
|
+
hideLastDivider?: boolean;
|
|
1121
|
+
/**
|
|
1122
|
+
* When `true`, rows are virtualized — only the rows currently in the
|
|
1123
|
+
* viewport are rendered. The table must have a bounded scroll area for this
|
|
1124
|
+
* to work, either via {@link height} or by constraining the container through
|
|
1125
|
+
* parent layout.
|
|
1126
|
+
* @default false
|
|
1127
|
+
*/
|
|
1128
|
+
enableRowVirtualization?: boolean;
|
|
1129
|
+
/**
|
|
1130
|
+
* Estimated height of each row in pixels, used to improve scroll accuracy
|
|
1131
|
+
* during virtualization. Defaults to the natural row height for the current
|
|
1132
|
+
* {@link cellSpacing}.
|
|
1133
|
+
*/
|
|
1134
|
+
estimatedRowHeight?: number;
|
|
1135
|
+
/**
|
|
1136
|
+
* Called when the user scrolls near the bottom of the table.
|
|
1137
|
+
* Use this to append more rows for infinite scrolling.
|
|
1138
|
+
* Not called while {@link loadingState} is set.
|
|
1139
|
+
*/
|
|
1140
|
+
onLoadMore?: () => void;
|
|
1141
|
+
/**
|
|
1142
|
+
* Element rendered in a sticky footer below the table.
|
|
1143
|
+
* Normally used to render a {@link Pagination} component.
|
|
1144
|
+
*
|
|
1145
|
+
* The DataGrid automatically provides the scroll container reference to
|
|
1146
|
+
* the `Pagination` component so that it scrolls back to the top of the
|
|
1147
|
+
* table when the page changes.
|
|
1148
|
+
*/
|
|
1149
|
+
footer?: ReactNode;
|
|
1150
|
+
/**
|
|
1151
|
+
* Whether the table header should be sticky relative to the first
|
|
1152
|
+
* scrolling ancestor.
|
|
1153
|
+
*
|
|
1154
|
+
* - `'auto'` (default) — the header sticks when the component has a
|
|
1155
|
+
* set (or constrained) height.
|
|
1156
|
+
* - `true` — always sticky.
|
|
1157
|
+
* - `false` — never sticky.
|
|
1158
|
+
*
|
|
1159
|
+
* @default 'auto'
|
|
1160
|
+
*/
|
|
1161
|
+
stickyHeader?: StickyPosition;
|
|
1162
|
+
/**
|
|
1163
|
+
* Whether the table footer (rendered via the [`footer`](#props:footer)
|
|
1164
|
+
* prop) should be sticky relative to the first scrolling ancestor.
|
|
1165
|
+
*
|
|
1166
|
+
* - `'auto'` (default) — the footer sticks when the component has a
|
|
1167
|
+
* set (or constrained) height.
|
|
1168
|
+
* - `true` — always sticky.
|
|
1169
|
+
* - `false` — never sticky.
|
|
1170
|
+
*
|
|
1171
|
+
* @default 'auto'
|
|
1172
|
+
*/
|
|
1173
|
+
stickyFooter?: StickyPosition;
|
|
1174
|
+
/**
|
|
1175
|
+
* Configures row expansion.
|
|
1176
|
+
*
|
|
1177
|
+
* - `{ type: 'subRows', getSubRows }` — tree-grid structure. `getSubRows`
|
|
1178
|
+
* returns the child rows for a given parent row. Child rows are indented
|
|
1179
|
+
* to convey depth.
|
|
1180
|
+
* - `{ type: 'expandedView', getExpandedView }` — accordion-style panel.
|
|
1181
|
+
* `getExpandedView` returns the `ReactNode` to render below the row when
|
|
1182
|
+
* it is expanded.
|
|
1183
|
+
*
|
|
1184
|
+
* Use {@link defaultExpandedRowIds} to pre-expand rows, or control expansion
|
|
1185
|
+
* fully with {@link expandedRowIds} and {@link onExpandedRowsChange}.
|
|
1186
|
+
*/
|
|
1187
|
+
rowExpansion?: {
|
|
1188
|
+
type: 'subRows';
|
|
1189
|
+
getSubRows: (row: TData, index: number) => TData[] | undefined;
|
|
1190
|
+
} | {
|
|
1191
|
+
type: 'expandedView';
|
|
1192
|
+
getExpandedView: (row: TData, index: number) => ReactNode;
|
|
1193
|
+
};
|
|
1194
|
+
/**
|
|
1195
|
+
* The currently expanded row ids (controlled).
|
|
1196
|
+
* Use together with {@link onExpandedRowsChange}.
|
|
1197
|
+
*/
|
|
1198
|
+
expandedRowIds?: string[];
|
|
1199
|
+
/**
|
|
1200
|
+
* Default expanded row ids (uncontrolled).
|
|
1201
|
+
*/
|
|
1202
|
+
defaultExpandedRowIds?: string[];
|
|
1203
|
+
/**
|
|
1204
|
+
* Called when the set of expanded rows changes.
|
|
1205
|
+
*/
|
|
1206
|
+
onExpandedRowsChange?: (expandedRowIds: string[]) => void;
|
|
1207
|
+
/**
|
|
1208
|
+
* Called when a row is clicked. Passing it makes the rows interactive.
|
|
1209
|
+
*/
|
|
1210
|
+
onRowAction?: (row: TData) => void;
|
|
1211
|
+
/**
|
|
1212
|
+
* Disables individual rows. Pass a function to evaluate the disabled state
|
|
1213
|
+
* per row, or a static `true` to disable all rows.
|
|
1214
|
+
* Use {@link disabledBehavior} to control whether disabled rows are fully
|
|
1215
|
+
* inert (`'all'`, the default) or only prevented from being selected
|
|
1216
|
+
* (`'selection'`).
|
|
1217
|
+
*/
|
|
1218
|
+
isDisabled?: boolean | ((row: TData) => boolean);
|
|
1219
|
+
/**
|
|
1220
|
+
* Whether disabled state applies to all interactions, or only selection.
|
|
1221
|
+
* @default "all"
|
|
1222
|
+
*/
|
|
1223
|
+
disabledBehavior?: DisabledBehavior;
|
|
1224
|
+
};
|
|
1225
|
+
/**
|
|
1226
|
+
* DataGrid renders an array of objects into a grid layout following Sapphire Table design.
|
|
1227
|
+
* It supports features such as sorting or row selection, typically required for data-heavy applications.
|
|
1228
|
+
*/
|
|
1229
|
+
declare function DataGrid<TData, TContext = undefined>({ 'aria-label': ariaLabel, columns, data, cellSpacing, sortDescriptor, onSortChange, defaultSortDescriptor, selectionMode, disallowEmptySelection, getRowId, selectedRowIds: selectedRowsProp, defaultSelectedRowIds, onSelectionChange, emptyState, loadingState, loadingSkeletonRowsCount, hideLastDivider, enableRowVirtualization, estimatedRowHeight, rowExpansion, expandedRowIds, defaultExpandedRowIds, onExpandedRowsChange, onLoadMore, onRowAction, isDisabled, disabledBehavior, layout, footer, stickyHeader, stickyFooter, context, ...otherProps }: DataGridProps<TData, TContext>): React__default.JSX.Element;
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* Options accepted by {@link createDataGridColumnHelper}.
|
|
1233
|
+
*/
|
|
1234
|
+
interface CreateDataGridColumnHelperOptions<TMode extends Layout = 'auto'> {
|
|
1235
|
+
/**
|
|
1236
|
+
* The column sizing mode the produced columns will be used with.
|
|
1237
|
+
* Determines the shape of the `sizing` option on each column.
|
|
1238
|
+
*
|
|
1239
|
+
* @default 'auto'
|
|
1240
|
+
*/
|
|
1241
|
+
layout?: TMode;
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Column helper returned by {@link createDataGridColumnHelper}. Provides
|
|
1245
|
+
* type-safe builders for the three kinds of column definition:
|
|
1246
|
+
* accessor (by key), accessor (by function), and display.
|
|
1247
|
+
*
|
|
1248
|
+
* Each builder method is overloaded: the first overload covers the
|
|
1249
|
+
* "mode-neutral" case where `sizing` does not use `minWidth` / `maxWidth`,
|
|
1250
|
+
* returning a `'fixed'`-typed column. Because
|
|
1251
|
+
* {@link FixedColumnSizing} uses `never` for `minWidth` / `maxWidth` (and
|
|
1252
|
+
* `never` is assignable to any type), such a column is structurally
|
|
1253
|
+
* assignable to both fixed- and auto-layout column arrays — making it
|
|
1254
|
+
* reusable across grids with different `layout` settings regardless
|
|
1255
|
+
* of which helper created it.
|
|
1256
|
+
*
|
|
1257
|
+
* The second overload covers the remaining case and keeps the column
|
|
1258
|
+
* bound to the helper's declared mode (`TMode`). If the helper was created
|
|
1259
|
+
* for `'fixed'`, the call site still rejects `minWidth` /
|
|
1260
|
+
* `maxWidth` at the property level.
|
|
1261
|
+
*/
|
|
1262
|
+
interface DataGridColumnHelper<TData, TContext, TMode extends Layout> {
|
|
1263
|
+
/**
|
|
1264
|
+
* Define an accessor column that reads a value directly from a property of
|
|
1265
|
+
* `TData` by key. The `value` received in the cell renderer is typed as
|
|
1266
|
+
* `TData[TKey]`.
|
|
1267
|
+
*/
|
|
1268
|
+
accessor<TKey extends keyof TData>(accessorKey: TKey, column: Omit<DataGridAccessorKeyColumn<TData, TKey, TContext, 'fixed'>, 'accessorKey'>): DataGridAccessorKeyColumn<TData, TKey, TContext, 'fixed'>;
|
|
1269
|
+
accessor<TKey extends keyof TData>(accessorKey: TKey, column: Omit<DataGridAccessorKeyColumn<TData, TKey, TContext, TMode>, 'accessorKey'>): DataGridAccessorKeyColumn<TData, TKey, TContext, TMode>;
|
|
1270
|
+
/**
|
|
1271
|
+
* Define an accessor column that derives its value via a function. The
|
|
1272
|
+
* `value` received in the cell renderer is typed as the function's return
|
|
1273
|
+
* type. `id` is required since there is no `accessorKey` to derive it from.
|
|
1274
|
+
*/
|
|
1275
|
+
accessor<TValue>(accessorFn: (row: TData) => TValue, column: Omit<DataGridAccessorFnColumn<TData, TValue, TContext, 'fixed'>, 'accessorFn'>): DataGridAccessorFnColumn<TData, TValue, TContext, 'fixed'>;
|
|
1276
|
+
accessor<TValue>(accessorFn: (row: TData) => TValue, column: Omit<DataGridAccessorFnColumn<TData, TValue, TContext, TMode>, 'accessorFn'>): DataGridAccessorFnColumn<TData, TValue, TContext, TMode>;
|
|
1277
|
+
/**
|
|
1278
|
+
* Define a display column — no accessor. The cell renderer receives a
|
|
1279
|
+
* `row` and `context` but `value` is `undefined`. Typically used for
|
|
1280
|
+
* action columns.
|
|
1281
|
+
*/
|
|
1282
|
+
display(column: DataGridDisplayColumn<TData, TContext, 'fixed'>): DataGridDisplayColumn<TData, TContext, 'fixed'>;
|
|
1283
|
+
display(column: DataGridDisplayColumn<TData, TContext, TMode>): DataGridDisplayColumn<TData, TContext, TMode>;
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* Create a typed column helper for a `DataGrid` with the given row data type
|
|
1287
|
+
* `TData` and cell rendering context type `TContext`. The helper's
|
|
1288
|
+
* `accessor` / `display` methods return correctly typed column definitions
|
|
1289
|
+
* that plug into the `columns` prop.
|
|
1290
|
+
*
|
|
1291
|
+
* @example
|
|
1292
|
+
* ```tsx
|
|
1293
|
+
* interface Person { id: string; name: string; age: number; }
|
|
1294
|
+
* interface Ctx { onEdit: (p: Person) => void; }
|
|
1295
|
+
*
|
|
1296
|
+
* const helper = createDataGridColumnHelper<Person, Ctx>();
|
|
1297
|
+
*
|
|
1298
|
+
* const columns = [
|
|
1299
|
+
* helper.accessor('name', {
|
|
1300
|
+
* header: 'Name',
|
|
1301
|
+
* cell: ({ value }) => value.toUpperCase(), // value: string
|
|
1302
|
+
* }),
|
|
1303
|
+
* helper.accessor((row) => row.age * 12, {
|
|
1304
|
+
* id: 'ageInMonths',
|
|
1305
|
+
* header: 'Age (months)',
|
|
1306
|
+
* cell: ({ value }) => value.toLocaleString(), // value: number
|
|
1307
|
+
* }),
|
|
1308
|
+
* helper.display({
|
|
1309
|
+
* id: 'actions',
|
|
1310
|
+
* header: 'Actions',
|
|
1311
|
+
* cell: ({ row, context }) => (
|
|
1312
|
+
* <button onClick={() => context.onEdit(row)}>Edit</button>
|
|
1313
|
+
* ),
|
|
1314
|
+
* }),
|
|
1315
|
+
* ];
|
|
1316
|
+
* ```
|
|
1317
|
+
*
|
|
1318
|
+
* Pass `{ layout: 'fixed' }` in the options to type the
|
|
1319
|
+
* column `sizing` property for fixed-layout grids. The sizing mode is
|
|
1320
|
+
* inferred from the options object — there is no need to pass it as an
|
|
1321
|
+
* explicit generic argument.
|
|
1322
|
+
*
|
|
1323
|
+
* Columns whose `sizing` does not use `minWidth` / `maxWidth` are returned
|
|
1324
|
+
* as mode-agnostic so that they can be reused across both fixed- and
|
|
1325
|
+
* auto-layout grids, regardless of which helper created them.
|
|
1326
|
+
*/
|
|
1327
|
+
declare function createDataGridColumnHelper<TData, TContext = undefined>(options: {
|
|
1328
|
+
layout: 'fixed';
|
|
1329
|
+
}): DataGridColumnHelper<TData, TContext, 'fixed'>;
|
|
1330
|
+
declare function createDataGridColumnHelper<TData, TContext = undefined>(options?: {
|
|
1331
|
+
layout?: 'auto';
|
|
1332
|
+
}): DataGridColumnHelper<TData, TContext, 'auto'>;
|
|
1333
|
+
|
|
1334
|
+
declare const _DataGrid: typeof DataGrid & {
|
|
1335
|
+
EditableCellContent: React.ForwardRefExoticComponent<EditableCellContentProps & React.RefAttributes<HTMLSpanElement>>;
|
|
1336
|
+
};
|
|
1337
|
+
|
|
1338
|
+
export { _Accordion as Accordion, AccordionContext, Alert, Amount, Autocomplete, BreadcrumbItem, Breadcrumbs, _DataGrid as DataGrid, FileDropzone, FileTrigger, FilterDropdown, Flag, LabeledValue, NumberField, ProgressIndicator, SearchableSelectFilter, _Sidebar as Sidebar, _Slider as Slider, TagGroup, TagItem, TimeField, TruncateOverflow, createDataGridColumnHelper };
|
|
1339
|
+
export type { AccordionHeadingProps, AccordionItemProps, AccordionPanelProps, AccordionProps, AmountProps, AutoColumnSizing, AutocompleteProps, BreadcrumbItemProps, BreadcrumbsProps, ColumnSizingFor, CreateDataGridColumnHelperOptions, DataGridAccessorFnColumn, DataGridAccessorKeyColumn, DataGridBodyCellRenderProps, DataGridColumn, DataGridColumnHelper, DataGridDisplayColumn, DataGridProps, DataGridSelectionMode, DataGridSortDescriptor, FileDropzoneProps, FileTriggerProps, FilterDropdownProps, FixedColumnSizing, FlagProps, Layout, NumberFieldProps, NumberFieldRef, ProgressIndicatorProps, SapphireAlertProps, SearchableSelectFilterProps, SidebarBodyProps, SidebarExpandableItemProps, SidebarHeaderProps, SidebarItemProps, SidebarListProps, SidebarProps, SidebarSectionProps, SliderProps, TagGroupProps, TimeFieldProps, TruncateOverflowProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danske/sapphire-react-lab",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.107.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "Experimental React components of the Sapphire Design System from Danske Bank A/S",
|
|
6
6
|
"exports": {
|
|
@@ -25,28 +25,30 @@
|
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@danske/sapphire-icons": "^3.1.0",
|
|
28
|
-
"@danske/sapphire-react": "^5.
|
|
28
|
+
"@danske/sapphire-react": "^5.17.2",
|
|
29
29
|
"react": ">=16.8.0",
|
|
30
30
|
"react-dom": ">=16.8.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@danske/sapphire-icons": "^3.2.0",
|
|
34
|
-
"@danske/sapphire-react": "^5.17.
|
|
34
|
+
"@danske/sapphire-react": "^5.17.2",
|
|
35
35
|
"@types/react-transition-group": "^4.4.5",
|
|
36
36
|
"cross-env": "^7.0.3"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@danske/sapphire-css": "^
|
|
39
|
+
"@danske/sapphire-css": "^51.0.0",
|
|
40
40
|
"@internationalized/date": "3.12.1",
|
|
41
41
|
"@internationalized/string": "3.2.8",
|
|
42
42
|
"@react-aria/i18n": "3.13.0",
|
|
43
43
|
"@react-spectrum/utils": "3.13.0",
|
|
44
44
|
"@react-types/shared": "3.34.0",
|
|
45
|
+
"@tanstack/react-table": "8.21.3",
|
|
46
|
+
"@tanstack/react-virtual": "3.13.23",
|
|
45
47
|
"clsx": "^1.1.1",
|
|
46
48
|
"react-aria": "3.48.0",
|
|
47
49
|
"react-aria-components": "1.17.0",
|
|
48
50
|
"react-stately": "3.46.0",
|
|
49
51
|
"react-transition-group": "^4.4.5"
|
|
50
52
|
},
|
|
51
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "4903f9d28140b74e3e42467f790174d7f977f15d"
|
|
52
54
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/Accordion/index.ts"],"sourcesContent":["import { Accordion, type AccordionProps } from './src/Accordion';\nimport {\n AccordionHeading,\n type AccordionHeadingProps,\n} from './src/AccordionHeading';\nimport { AccordionItem, type AccordionItemProps } from './src/AccordionItem';\nimport { AccordionContext } from './src/AccordionContext';\nimport { AccordionPanel, type AccordionPanelProps } from './src/AccordionPanel';\n\n/*\n * Before moving Accordion component to the core package, it's important to check on the\n * latest release of \"@react-aria/accordion\".\n * The hook and the component package are marked as \"pre-release\", so we can expect some changes.\n *\n * https://github.com/adobe/react-spectrum/issues/2801#issuecomment-1035377858\n * https://github.com/adobe/react-spectrum/discussions/6635#discussioncomment-9990027\n *\n * The current implementation is based on the SelectableCollection API, which creates bugs when\n * focusable items are used inside of the Accordion.Item.\n * E.g. UC-3414 (fixed), UC-3545 (to-do)\n *\n * Alternatively, we can re-implement the component.\n */\nconst _Accordion = Object.assign(Accordion, {\n Heading: AccordionHeading,\n Item: AccordionItem,\n Panel: AccordionPanel,\n});\n\nexport {\n _Accordion as Accordion,\n AccordionContext,\n type AccordionProps,\n type AccordionItemProps,\n type AccordionHeadingProps,\n type AccordionPanelProps,\n};\n"],"names":[],"mappings":";;;;;;AAuBA,MAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,SAAA,EAAW;AAAA,EAC1C,OAAA,EAAS,gBAAA;AAAA,EACT,IAAA,EAAM,aAAA;AAAA,EACN,KAAA,EAAO;AACT,CAAC;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sources":["../../../../src/Accordion/src/Accordion.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef } from 'react';\nimport clsx from 'clsx';\nimport { filterDOMProps } from 'react-aria/filterDOMProps';\nimport { useObjectRef } from 'react-aria/useObjectRef';\nimport { DOMProps } from '@react-types/shared';\nimport styles from '@danske/sapphire-css/components/accordion/accordion.module.css';\nimport {\n SapphireStyleProps,\n TypographyHeadingProps,\n useSapphireStyleProps,\n useThemeCheck,\n withTruthyZero as hasAllowedCustomSidePadding,\n GlobalDomAttributes,\n} from '@danske/sapphire-react';\nimport { FocusScope } from 'react-aria/FocusScope';\n\nimport { AccordionContext } from './AccordionContext';\nimport { DisclosureGroup, DisclosureGroupProps } from 'react-aria-components';\n\nexport type TreeExpansionMode = 'single' | 'multiple';\n\nexport interface AccordionProps\n extends GlobalDomAttributes,\n SapphireStyleProps,\n DOMProps,\n Pick<\n DisclosureGroupProps,\n | 'allowsMultipleExpanded'\n | 'expandedKeys'\n | 'defaultExpandedKeys'\n | 'onExpandedChange'\n | 'children'\n | 'isDisabled'\n > {\n /** Set aria-level attribute for item's header. Accessibility requirement.\n * Defines the hierarchical level of an element within a page structure.\n * @default 5\n */\n headerLevel?: TypographyHeadingProps['level'];\n /**\n * Removes the divider after the last accordion item.\n * Useful when rendered in a container which already has borders.\n */\n hideLastDivider?: boolean;\n /**\n * Counter acts the side padding, so that accordion is shifted to the left with same amount\n * and having side padding * 2 added to width – resulting in full width accordion.\n * Useful in scenarions where accordion is inside a padded container and desired layout has accordion going from edge to edge horizontally.\n * @example\n * ```tsx\n * <Accordion hasNegativeSideMargin>...</Accordion>\n * ```\n */\n hasNegativeSideMargin?: boolean;\n /**\n * Add custom sized padding to the sides of the accordion items.\n * @example\n * ```tsx\n * <Accordion sidePadding={tokens.size.spacingContainerHorizontalM.value} hasNegativeSideMargin>...</Accordion>\n * ```\n */\n sidePadding?: number | string;\n}\n\n/**\n * Accordion is a vertically stacked set of items, that consist of an interactive header and expandable content section. An accordion item’s content display can be toggled on and off by clicking the component’s header above.\n */\nexport const Accordion = forwardRef(function Accordion(\n {\n allowsMultipleExpanded = true,\n headerLevel = 5,\n hideLastDivider = false,\n hasNegativeSideMargin = false,\n sidePadding,\n children,\n expandedKeys,\n defaultExpandedKeys,\n onExpandedChange,\n isDisabled,\n ...props\n }: AccordionProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n useThemeCheck();\n const { styleProps } = useSapphireStyleProps(props);\n const forwardedRef = useObjectRef<HTMLDivElement>(ref);\n\n return (\n <FocusScope>\n <AccordionContext.Provider value={{ sidePadding, headerLevel }}>\n <DisclosureGroup\n {...filterDOMProps(props, { global: true, labelable: true })}\n allowsMultipleExpanded={allowsMultipleExpanded}\n expandedKeys={expandedKeys}\n defaultExpandedKeys={defaultExpandedKeys}\n onExpandedChange={onExpandedChange}\n isDisabled={isDisabled}\n ref={forwardedRef}\n className={clsx(\n styles['sapphire-accordion'],\n {\n [styles['sapphire-accordion--without-last-divider']]:\n hideLastDivider,\n [styles['sapphire-accordion--negative-margin-self']]:\n !hasAllowedCustomSidePadding(sidePadding) &&\n hasNegativeSideMargin,\n },\n styleProps.className\n )}\n style={{\n ...(hasAllowedCustomSidePadding(sidePadding) &&\n hasNegativeSideMargin\n ? {\n marginLeft:\n typeof sidePadding === 'string'\n ? `calc(${sidePadding} * -1)`\n : `-${sidePadding}px`,\n width: `calc(100% + calc(${sidePadding} * 2${\n typeof sidePadding === 'string' ? '' : 'px'\n }))`,\n }\n : {}),\n ...styleProps.style,\n }}\n >\n {children}\n </DisclosureGroup>\n </AccordionContext.Provider>\n </FocusScope>\n );\n});\n"],"names":["Accordion","hasAllowedCustomSidePadding"],"mappings":";;;;;;;;;;AAmEO,MAAM,SAAA,GAAY,UAAA,CAAW,SAASA,UAAAA,CAC3C;AAAA,EACE,sBAAA,GAAyB,IAAA;AAAA,EACzB,WAAA,GAAc,CAAA;AAAA,EACd,eAAA,GAAkB,KAAA;AAAA,EAClB,qBAAA,GAAwB,KAAA;AAAA,EACxB,WAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,mBAAA;AAAA,EACA,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,GAAG;AACL,CAAA,EACA,GAAA,EACA;AACA,EAAA,aAAA,EAAc;AACd,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,qBAAA,CAAsB,KAAK,CAAA;AAClD,EAAA,MAAM,YAAA,GAAe,aAA6B,GAAG,CAAA;AAErD,EAAA,uBACE,KAAA,CAAA,aAAA,CAAC,UAAA,EAAA,IAAA,kBACC,KAAA,CAAA,aAAA,CAAC,gBAAA,CAAiB,QAAA,EAAjB,EAA0B,KAAA,EAAO,EAAE,WAAA,EAAa,WAAA,EAAY,EAAA,kBAC3D,KAAA,CAAA,aAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACE,GAAG,eAAe,KAAA,EAAO,EAAE,QAAQ,IAAA,EAAM,SAAA,EAAW,MAAM,CAAA;AAAA,MAC3D,sBAAA;AAAA,MACA,YAAA;AAAA,MACA,mBAAA;AAAA,MACA,gBAAA;AAAA,MACA,UAAA;AAAA,MACA,GAAA,EAAK,YAAA;AAAA,MACL,SAAA,EAAW,IAAA;AAAA,QACT,OAAO,oBAAoB,CAAA;AAAA,QAC3B;AAAA,UACE,CAAC,MAAA,CAAO,0CAA0C,CAAC,GACjD,eAAA;AAAA,UACF,CAAC,OAAO,0CAA0C,CAAC,GACjD,CAACC,cAAA,CAA4B,WAAW,CAAA,IACxC;AAAA,SACJ;AAAA,QACA,UAAA,CAAW;AAAA,OACb;AAAA,MACA,KAAA,EAAO;AAAA,QACL,GAAIA,cAAA,CAA4B,WAAW,CAAA,IAC3C,qBAAA,GACI;AAAA,UACE,UAAA,EACE,OAAO,WAAA,KAAgB,QAAA,GACnB,QAAQ,WAAW,CAAA,MAAA,CAAA,GACnB,IAAI,WAAW,CAAA,EAAA,CAAA;AAAA,UACrB,KAAA,EAAO,oBAAoB,WAAW,CAAA,IAAA,EACpC,OAAO,WAAA,KAAgB,QAAA,GAAW,KAAK,IACzC,CAAA,EAAA;AAAA,YAEF,EAAC;AAAA,QACL,GAAG,UAAA,CAAW;AAAA;AAChB,KAAA;AAAA,IAEC;AAAA,GAEL,CACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionContext.js","sources":["../../../../src/Accordion/src/AccordionContext.ts"],"sourcesContent":["import { TypographyHeadingProps } from '@danske/sapphire-react';\nimport React, { useContext } from 'react';\n\ninterface AccordionContextProps {\n sidePadding?: number | string;\n headerLevel?: TypographyHeadingProps['level'];\n}\n\nexport const AccordionContext = React.createContext<AccordionContextProps>({\n sidePadding: undefined,\n headerLevel: 5,\n});\n\nexport function useAccordionContext(): AccordionContextProps {\n const context = useContext(AccordionContext);\n if (context) {\n return context;\n }\n throw new Error(\n 'Accordion context can only be used within Accordion component.'\n );\n}\n"],"names":[],"mappings":";;AAQO,MAAM,gBAAA,GAAmB,MAAM,aAAA,CAAqC;AAAA,EACzE,WAAA,EAAa,MAAA;AAAA,EACb,WAAA,EAAa;AACf,CAAC;AAEM,SAAS,mBAAA,GAA6C;AAC3D,EAAA,MAAM,OAAA,GAAU,WAAW,gBAAgB,CAAA;AAC3C,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,OAAO,OAAA;AAAA,EACT;AACA,EAAA,MAAM,IAAI,KAAA;AAAA,IACR;AAAA,GACF;AACF;;;;"}
|