@digdir/designsystemet-react 1.0.0-next.15 → 1.0.0-next.16
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/dist/cjs/components/Accordion/index.js +2 -2
- package/dist/cjs/components/Breadcrumbs/BreadcrumbsItem.js +11 -0
- package/dist/cjs/components/Breadcrumbs/BreadcrumbsLink.js +12 -0
- package/dist/cjs/components/Breadcrumbs/BreadcrumbsList.js +23 -0
- package/dist/cjs/components/Breadcrumbs/BreadcrumbsNav.js +11 -0
- package/dist/cjs/components/Breadcrumbs/BreadcrumbsRoot.js +11 -0
- package/dist/cjs/components/Breadcrumbs/index.js +43 -0
- package/dist/cjs/components/Divider/Divider.js +3 -4
- package/dist/cjs/components/DropdownMenu/DropdownMenuContent.js +2 -2
- package/dist/cjs/components/Modal/ModalDialog.js +1 -2
- package/dist/cjs/components/Modal/ModalHeader.js +2 -2
- package/dist/cjs/components/Modal/index.js +1 -0
- package/dist/cjs/components/Popover/PopoverContent.js +3 -4
- package/dist/cjs/components/Tabs/TabList.js +1 -1
- package/dist/cjs/components/ToggleGroup/ToggleGroupRoot.js +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +3 -4
- package/dist/cjs/components/form/Checkbox/{Group/Group.js → CheckboxGroup.js} +3 -2
- package/dist/cjs/components/form/Checkbox/index.js +3 -3
- package/dist/cjs/components/form/Checkbox/useCheckbox.js +2 -2
- package/dist/cjs/components/form/Combobox/Combobox.js +2 -2
- package/dist/cjs/components/form/Combobox/Option/Description.js +1 -2
- package/dist/cjs/components/form/Combobox/internal/ComboboxChips.js +1 -2
- package/dist/cjs/components/form/Combobox/internal/ComboboxClearButton.js +1 -2
- package/dist/cjs/components/form/Combobox/internal/ComboboxError.js +1 -2
- package/dist/cjs/components/form/Combobox/internal/ComboboxInput.js +5 -6
- package/dist/cjs/components/form/Combobox/internal/ComboboxLabel.js +1 -2
- package/dist/cjs/components/form/Combobox/internal/ComboboxNative.js +1 -2
- package/dist/cjs/components/form/Combobox/useCombobox.js +5 -0
- package/dist/cjs/components/form/Combobox/useFloatingCombobox.js +4 -4
- package/dist/cjs/components/form/NativeSelect/NativeSelect.js +2 -2
- package/dist/cjs/components/form/NativeSelect/useNativeSelect.js +19 -1
- package/dist/cjs/components/form/Radio/{Group/Group.js → RadioGroup.js} +3 -3
- package/dist/cjs/components/form/Radio/index.js +3 -3
- package/dist/cjs/components/form/Radio/useRadio.js +2 -2
- package/dist/cjs/components/form/Switch/useSwitch.js +2 -2
- package/dist/cjs/index.js +50 -36
- package/dist/cjs/node_modules/@floating-ui/core/dist/floating-ui.core.js +23 -9
- package/dist/cjs/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +39 -24
- package/dist/cjs/node_modules/@floating-ui/react/dist/floating-ui.react.js +848 -729
- package/dist/cjs/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +1 -1
- package/dist/cjs/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +68 -0
- package/dist/cjs/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +11 -0
- package/dist/cjs/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +97 -45
- package/dist/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +17 -6
- package/dist/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +14 -5
- package/dist/cjs/node_modules/@radix-ui/react-compose-refs/dist/index.js +10 -14
- package/dist/cjs/node_modules/@radix-ui/react-slot/dist/index.js +88 -69
- package/dist/cjs/node_modules/@tanstack/virtual-core/dist/esm/index.js +134 -62
- package/dist/cjs/node_modules/@tanstack/virtual-core/dist/esm/utils.js +3 -5
- package/dist/cjs/utilities/AnimateHeight/AnimateHeight.js +4 -1
- package/dist/cjs/utilities/RovingFocus/RovingFocusItem.js +34 -6
- package/dist/cjs/utilities/RovingFocus/RovingFocusRoot.js +3 -1
- package/dist/cjs/utilities/RovingFocus/useRovingFocus.js +2 -1
- package/dist/esm/components/Accordion/index.js +2 -2
- package/dist/esm/components/Box/Box.js +2 -2
- package/dist/esm/components/Breadcrumbs/BreadcrumbsItem.js +9 -0
- package/dist/esm/components/Breadcrumbs/BreadcrumbsLink.js +10 -0
- package/dist/esm/components/Breadcrumbs/BreadcrumbsList.js +21 -0
- package/dist/esm/components/Breadcrumbs/BreadcrumbsNav.js +9 -0
- package/dist/esm/components/Breadcrumbs/BreadcrumbsRoot.js +9 -0
- package/dist/esm/components/Breadcrumbs/index.js +36 -0
- package/dist/esm/components/Button/Button.js +2 -2
- package/dist/esm/components/Card/Card.js +2 -2
- package/dist/esm/components/Card/CardContent.js +2 -2
- package/dist/esm/components/Card/CardFooter.js +2 -2
- package/dist/esm/components/Card/CardHeader.js +2 -2
- package/dist/esm/components/Card/CardMedia.js +2 -2
- package/dist/esm/components/Divider/Divider.js +3 -4
- package/dist/esm/components/DropdownMenu/DropdownMenuContent.js +2 -2
- package/dist/esm/components/DropdownMenu/DropdownMenuTrigger.js +2 -2
- package/dist/esm/components/ErrorSummary/ErrorSummaryRoot.js +2 -2
- package/dist/esm/components/Link/Link.js +2 -2
- package/dist/esm/components/List/ListItem.js +2 -2
- package/dist/esm/components/List/ListRoot.js +2 -2
- package/dist/esm/components/List/Lists.js +3 -3
- package/dist/esm/components/Modal/ModaContent.js +2 -2
- package/dist/esm/components/Modal/ModalDialog.js +5 -6
- package/dist/esm/components/Modal/ModalFooter.js +2 -2
- package/dist/esm/components/Modal/ModalHeader.js +4 -4
- package/dist/esm/components/Modal/ModalTrigger.js +2 -2
- package/dist/esm/components/Modal/index.js +1 -1
- package/dist/esm/components/Pagination/PaginationContent.js +2 -2
- package/dist/esm/components/Pagination/PaginationItem.js +2 -2
- package/dist/esm/components/Pagination/PaginationRoot.js +2 -2
- package/dist/esm/components/Popover/PopoverContent.js +2 -3
- package/dist/esm/components/Popover/PopoverTrigger.js +2 -2
- package/dist/esm/components/Tabs/TabList.js +1 -1
- package/dist/esm/components/ToggleGroup/ToggleGroupRoot.js +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +2 -3
- package/dist/esm/components/Typography/ErrorMessage/ErrorMessage.js +2 -2
- package/dist/esm/components/Typography/Heading/Heading.js +2 -2
- package/dist/esm/components/Typography/Ingress/Ingress.js +2 -2
- package/dist/esm/components/Typography/Label/Label.js +2 -2
- package/dist/esm/components/Typography/Paragraph/Paragraph.js +2 -2
- package/dist/esm/components/form/Checkbox/{Group/Group.js → CheckboxGroup.js} +3 -2
- package/dist/esm/components/form/Checkbox/index.js +1 -1
- package/dist/esm/components/form/Checkbox/useCheckbox.js +1 -1
- package/dist/esm/components/form/Combobox/Combobox.js +2 -2
- package/dist/esm/components/form/Combobox/Custom.js +2 -2
- package/dist/esm/components/form/Combobox/Option/Description.js +1 -2
- package/dist/esm/components/form/Combobox/internal/ComboboxChips.js +1 -2
- package/dist/esm/components/form/Combobox/internal/ComboboxClearButton.js +1 -2
- package/dist/esm/components/form/Combobox/internal/ComboboxError.js +1 -2
- package/dist/esm/components/form/Combobox/internal/ComboboxInput.js +5 -6
- package/dist/esm/components/form/Combobox/internal/ComboboxLabel.js +1 -2
- package/dist/esm/components/form/Combobox/internal/ComboboxNative.js +1 -2
- package/dist/esm/components/form/Combobox/useCombobox.js +5 -0
- package/dist/esm/components/form/Combobox/useFloatingCombobox.js +2 -2
- package/dist/esm/components/form/NativeSelect/NativeSelect.js +2 -2
- package/dist/esm/components/form/NativeSelect/useNativeSelect.js +19 -1
- package/dist/esm/components/form/Radio/{Group/Group.js → RadioGroup.js} +3 -3
- package/dist/esm/components/form/Radio/index.js +1 -1
- package/dist/esm/components/form/Radio/useRadio.js +1 -1
- package/dist/esm/components/form/Switch/useSwitch.js +1 -1
- package/dist/esm/index.js +9 -2
- package/dist/esm/node_modules/@floating-ui/core/dist/floating-ui.core.js +24 -10
- package/dist/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +41 -26
- package/dist/esm/node_modules/@floating-ui/react/dist/floating-ui.react.js +830 -712
- package/dist/esm/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +1 -1
- package/dist/esm/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +57 -0
- package/dist/esm/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +9 -0
- package/dist/esm/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +96 -45
- package/dist/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +17 -7
- package/dist/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +14 -5
- package/dist/esm/node_modules/@radix-ui/react-compose-refs/dist/index.js +10 -14
- package/dist/esm/node_modules/@radix-ui/react-slot/dist/index.js +71 -71
- package/dist/esm/node_modules/@tanstack/virtual-core/dist/esm/index.js +134 -62
- package/dist/esm/node_modules/@tanstack/virtual-core/dist/esm/utils.js +3 -5
- package/dist/esm/utilities/AnimateHeight/AnimateHeight.js +4 -1
- package/dist/esm/utilities/RovingFocus/RovingFocusItem.js +36 -8
- package/dist/esm/utilities/RovingFocus/RovingFocusRoot.js +5 -3
- package/dist/esm/utilities/RovingFocus/useRovingFocus.js +2 -1
- package/dist/types/components/Accordion/AccordionHeading.d.ts +1 -1
- package/dist/types/components/Accordion/AccordionHeading.d.ts.map +1 -1
- package/dist/types/components/Accordion/AccordionItem.d.ts +2 -2
- package/dist/types/components/Accordion/AccordionItem.d.ts.map +1 -1
- package/dist/types/components/Accordion/AccordionRoot.d.ts +2 -2
- package/dist/types/components/Accordion/AccordionRoot.d.ts.map +1 -1
- package/dist/types/components/Accordion/index.d.ts +2 -2
- package/dist/types/components/Accordion/index.d.ts.map +1 -1
- package/dist/types/components/Alert/Alert.d.ts +3 -3
- package/dist/types/components/Alert/Alert.d.ts.map +1 -1
- package/dist/types/components/Badge/Badge.d.ts +93 -0
- package/dist/types/components/Badge/Badge.d.ts.map +1 -0
- package/dist/types/components/Badge/index.d.ts +3 -0
- package/dist/types/components/Badge/index.d.ts.map +1 -0
- package/dist/types/components/Box/Box.d.ts +5 -5
- package/dist/types/components/Box/Box.d.ts.map +1 -1
- package/dist/types/components/Breadcrumbs/BreadcrumbsItem.d.ts +4 -0
- package/dist/types/components/Breadcrumbs/BreadcrumbsItem.d.ts.map +1 -0
- package/dist/types/components/Breadcrumbs/BreadcrumbsLink.d.ts +10 -0
- package/dist/types/components/Breadcrumbs/BreadcrumbsLink.d.ts.map +1 -0
- package/dist/types/components/Breadcrumbs/BreadcrumbsList.d.ts +4 -0
- package/dist/types/components/Breadcrumbs/BreadcrumbsList.d.ts.map +1 -0
- package/dist/types/components/Breadcrumbs/BreadcrumbsNav.d.ts +14 -0
- package/dist/types/components/Breadcrumbs/BreadcrumbsNav.d.ts.map +1 -0
- package/dist/types/components/Breadcrumbs/BreadcrumbsRoot.d.ts +16 -0
- package/dist/types/components/Breadcrumbs/BreadcrumbsRoot.d.ts.map +1 -0
- package/dist/types/components/Breadcrumbs/index.d.ts +44 -0
- package/dist/types/components/Breadcrumbs/index.d.ts.map +1 -0
- package/dist/types/components/Button/Button.d.ts +6 -6
- package/dist/types/components/Button/Button.d.ts.map +1 -1
- package/dist/types/components/Card/Card.d.ts +3 -3
- package/dist/types/components/Card/Card.d.ts.map +1 -1
- package/dist/types/components/Card/CardContent.d.ts +1 -1
- package/dist/types/components/Card/CardContent.d.ts.map +1 -1
- package/dist/types/components/Card/CardFooter.d.ts +1 -1
- package/dist/types/components/Card/CardFooter.d.ts.map +1 -1
- package/dist/types/components/Card/CardHeader.d.ts +1 -1
- package/dist/types/components/Card/CardHeader.d.ts.map +1 -1
- package/dist/types/components/Card/CardMedia.d.ts +1 -1
- package/dist/types/components/Card/CardMedia.d.ts.map +1 -1
- package/dist/types/components/Card/index.d.ts.map +1 -1
- package/dist/types/components/Chip/Group/Group.d.ts +1 -1
- package/dist/types/components/Chip/Removable/Removable.d.ts +1 -1
- package/dist/types/components/Chip/Toggle/Toggle.d.ts +3 -3
- package/dist/types/components/Chip/Toggle/Toggle.d.ts.map +1 -1
- package/dist/types/components/Divider/Divider.d.ts +1 -1
- package/dist/types/components/Divider/Divider.d.ts.map +1 -1
- package/dist/types/components/DropdownMenu/DropdownMenuContent.d.ts.map +1 -1
- package/dist/types/components/DropdownMenu/DropdownMenuGroup.d.ts.map +1 -1
- package/dist/types/components/DropdownMenu/DropdownMenuTrigger.d.ts +7 -7
- package/dist/types/components/DropdownMenu/index.d.ts.map +1 -1
- package/dist/types/components/ErrorSummary/ErrorSummaryRoot.d.ts +1 -1
- package/dist/types/components/ErrorSummary/index.d.ts.map +1 -1
- package/dist/types/components/Link/Link.d.ts +4 -4
- package/dist/types/components/Link/Link.d.ts.map +1 -1
- package/dist/types/components/List/ListHeading.d.ts +4 -4
- package/dist/types/components/List/ListItem.d.ts +1 -1
- package/dist/types/components/List/ListItem.d.ts.map +1 -1
- package/dist/types/components/List/ListRoot.d.ts +2 -2
- package/dist/types/components/List/ListRoot.d.ts.map +1 -1
- package/dist/types/components/List/Lists.d.ts +2 -2
- package/dist/types/components/List/Lists.d.ts.map +1 -1
- package/dist/types/components/Modal/ModaContent.d.ts +1 -1
- package/dist/types/components/Modal/ModaContent.d.ts.map +1 -1
- package/dist/types/components/Modal/ModalDialog.d.ts +4 -4
- package/dist/types/components/Modal/ModalDialog.d.ts.map +1 -1
- package/dist/types/components/Modal/ModalFooter.d.ts +1 -1
- package/dist/types/components/Modal/ModalFooter.d.ts.map +1 -1
- package/dist/types/components/Modal/ModalHeader.d.ts +19 -3
- package/dist/types/components/Modal/ModalHeader.d.ts.map +1 -1
- package/dist/types/components/Modal/ModalTrigger.d.ts +7 -7
- package/dist/types/components/Modal/index.d.ts +1 -1
- package/dist/types/components/Modal/index.d.ts.map +1 -1
- package/dist/types/components/Modal/useModalState.d.ts.map +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts +4 -4
- package/dist/types/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/types/components/Pagination/PaginationButton.d.ts +1 -1
- package/dist/types/components/Pagination/PaginationButton.d.ts.map +1 -1
- package/dist/types/components/Pagination/PaginationContent.d.ts +1 -1
- package/dist/types/components/Pagination/PaginationContent.d.ts.map +1 -1
- package/dist/types/components/Pagination/PaginationItem.d.ts +1 -1
- package/dist/types/components/Pagination/PaginationItem.d.ts.map +1 -1
- package/dist/types/components/Pagination/PaginationNextPrev.d.ts +2 -2
- package/dist/types/components/Pagination/PaginationRoot.d.ts +3 -3
- package/dist/types/components/Pagination/PaginationRoot.d.ts.map +1 -1
- package/dist/types/components/Pagination/index.d.ts.map +1 -1
- package/dist/types/components/Popover/PopoverContent.d.ts.map +1 -1
- package/dist/types/components/Popover/PopoverRoot.d.ts +10 -10
- package/dist/types/components/Popover/PopoverRoot.d.ts.map +1 -1
- package/dist/types/components/Popover/PopoverTrigger.d.ts +7 -7
- package/dist/types/components/Popover/index.d.ts.map +1 -1
- package/dist/types/components/SkipLink/SkipLink.d.ts.map +1 -1
- package/dist/types/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/types/components/Table/Table.d.ts +4 -4
- package/dist/types/components/Table/Table.d.ts.map +1 -1
- package/dist/types/components/Table/TableHeaderCell.d.ts +3 -3
- package/dist/types/components/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/types/components/Table/index.d.ts.map +1 -1
- package/dist/types/components/Tabs/TabList.d.ts.map +1 -1
- package/dist/types/components/Tabs/TabsRoot.d.ts +4 -4
- package/dist/types/components/Tabs/TabsRoot.d.ts.map +1 -1
- package/dist/types/components/Tag/Tag.d.ts +1 -1
- package/dist/types/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/components/ToggleGroup/ToggleGroupItem/ToggleGroupItem.d.ts +1 -1
- package/dist/types/components/ToggleGroup/ToggleGroupItem/ToggleGroupItem.d.ts.map +1 -1
- package/dist/types/components/ToggleGroup/ToggleGroupRoot.d.ts +5 -5
- package/dist/types/components/ToggleGroup/ToggleGroupRoot.d.ts.map +1 -1
- package/dist/types/components/ToggleGroup/index.d.ts.map +1 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +4 -4
- package/dist/types/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/components/Typography/ErrorMessage/ErrorMessage.d.ts +4 -4
- package/dist/types/components/Typography/ErrorMessage/ErrorMessage.d.ts.map +1 -1
- package/dist/types/components/Typography/Heading/Heading.d.ts +4 -4
- package/dist/types/components/Typography/Heading/Heading.d.ts.map +1 -1
- package/dist/types/components/Typography/Ingress/Ingress.d.ts +3 -3
- package/dist/types/components/Typography/Ingress/Ingress.d.ts.map +1 -1
- package/dist/types/components/Typography/Label/Label.d.ts +4 -4
- package/dist/types/components/Typography/Label/Label.d.ts.map +1 -1
- package/dist/types/components/Typography/Paragraph/Paragraph.d.ts +4 -4
- package/dist/types/components/Typography/Paragraph/Paragraph.d.ts.map +1 -1
- package/dist/types/components/form/CharacterCounter.d.ts.map +1 -1
- package/dist/types/components/form/Checkbox/Checkbox.d.ts +1 -1
- package/dist/types/components/form/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/types/components/form/Checkbox/{Group/Group.d.ts → CheckboxGroup.d.ts} +5 -5
- package/dist/types/components/form/Checkbox/CheckboxGroup.d.ts.map +1 -0
- package/dist/types/components/form/Checkbox/index.d.ts +2 -2
- package/dist/types/components/form/Checkbox/index.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/Combobox.d.ts +42 -42
- package/dist/types/components/form/Combobox/Combobox.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/ComboboxIdContext.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/Empty.d.ts +1 -1
- package/dist/types/components/form/Combobox/Empty.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/Option/Option.d.ts +2 -2
- package/dist/types/components/form/Combobox/Option/Option.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/Option/useComboboxOption.d.ts +1 -1
- package/dist/types/components/form/Combobox/index.d.ts +3 -0
- package/dist/types/components/form/Combobox/index.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/useCombobox.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/useFloatingCombobox.d.ts +9 -9
- package/dist/types/components/form/Fieldset/Fieldset.d.ts +3 -3
- package/dist/types/components/form/Fieldset/Fieldset.d.ts.map +1 -1
- package/dist/types/components/form/Fieldset/useFieldset.d.ts +2 -2
- package/dist/types/components/form/NativeSelect/NativeSelect.d.ts +6 -6
- package/dist/types/components/form/NativeSelect/NativeSelect.d.ts.map +1 -1
- package/dist/types/components/form/NativeSelect/useNativeSelect.d.ts +1 -1
- package/dist/types/components/form/NativeSelect/useNativeSelect.d.ts.map +1 -1
- package/dist/types/components/form/Radio/{Group/Group.d.ts → RadioGroup.d.ts} +7 -7
- package/dist/types/components/form/Radio/RadioGroup.d.ts.map +1 -0
- package/dist/types/components/form/Radio/index.d.ts +2 -2
- package/dist/types/components/form/Radio/index.d.ts.map +1 -1
- package/dist/types/components/form/Radio/useRadio.d.ts.map +1 -1
- package/dist/types/components/form/Search/Search.d.ts +7 -7
- package/dist/types/components/form/Search/Search.d.ts.map +1 -1
- package/dist/types/components/form/Switch/Switch.d.ts +2 -2
- package/dist/types/components/form/Switch/Switch.d.ts.map +1 -1
- package/dist/types/components/form/Textarea/Textarea.d.ts +7 -7
- package/dist/types/components/form/Textarea/Textarea.d.ts.map +1 -1
- package/dist/types/components/form/Textfield/Textfield.d.ts +7 -7
- package/dist/types/components/form/Textfield/Textfield.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/utilities/AnimateHeight/AnimateHeight.d.ts.map +1 -1
- package/dist/types/utilities/RovingFocus/RovingFocusItem.d.ts +2 -2
- package/dist/types/utilities/RovingFocus/RovingFocusItem.d.ts.map +1 -1
- package/dist/types/utilities/RovingFocus/RovingFocusRoot.d.ts +10 -2
- package/dist/types/utilities/RovingFocus/RovingFocusRoot.d.ts.map +1 -1
- package/dist/types/utilities/RovingFocus/useRovingFocus.d.ts +11 -10
- package/dist/types/utilities/RovingFocus/useRovingFocus.d.ts.map +1 -1
- package/package.json +18 -8
- package/dist/cjs/node_modules/@babel/runtime/helpers/esm/extends.js +0 -19
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/extends.js +0 -17
- package/dist/types/components/form/Checkbox/Group/Group.d.ts.map +0 -1
- package/dist/types/components/form/Checkbox/Group/index.d.ts +0 -2
- package/dist/types/components/form/Checkbox/Group/index.d.ts.map +0 -1
- package/dist/types/components/form/Radio/Group/Group.d.ts.map +0 -1
- package/dist/types/components/form/Radio/Group/index.d.ts +0 -2
- package/dist/types/components/form/Radio/Group/index.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ import { forwardRef } from 'react';
|
|
|
14
14
|
* </Card>
|
|
15
15
|
*/
|
|
16
16
|
const Card = forwardRef(({ isLink = false, asChild = false, color = 'neutral', className, ...rest }, ref) => {
|
|
17
|
-
const Component = asChild ?
|
|
17
|
+
const Component = asChild ? Slot : 'div';
|
|
18
18
|
return (jsx(Component, { ref: ref, className: clsx(`ds-card`, `ds-card--${color}`, isLink && `ds-card--link`, isLink && `ds-focus`, className), ...rest }));
|
|
19
19
|
});
|
|
20
20
|
Card.displayName = 'Card';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import { Paragraph } from '../Typography/Paragraph/Paragraph.js';
|
|
7
7
|
|
|
8
8
|
const CardContent = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
9
|
-
const Component = asChild ?
|
|
9
|
+
const Component = asChild ? Slot : 'div';
|
|
10
10
|
return (jsx(Paragraph, { size: 'md', asChild: true, children: jsx(Component, { className: clsx(`ds-card__content`, className), ref: ref, ...rest }) }));
|
|
11
11
|
});
|
|
12
12
|
CardContent.displayName = 'CardContent';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import { Paragraph } from '../Typography/Paragraph/Paragraph.js';
|
|
7
7
|
|
|
8
8
|
const CardFooter = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
9
|
-
const Component = asChild ?
|
|
9
|
+
const Component = asChild ? Slot : 'div';
|
|
10
10
|
return (jsx(Paragraph, { size: 'md', asChild: true, children: jsx(Component, { className: clsx(`ds-card__footer`, className), ref: ref, ...rest }) }));
|
|
11
11
|
});
|
|
12
12
|
CardFooter.displayName = 'CardFooter';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import { Heading } from '../Typography/Heading/Heading.js';
|
|
7
7
|
|
|
8
8
|
const CardHeader = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
9
|
-
const Component = asChild ?
|
|
9
|
+
const Component = asChild ? Slot : 'div';
|
|
10
10
|
return (jsx(Heading, { size: 'md', asChild: true, children: jsx(Component, { className: clsx(`ds-card__header`, className), ref: ref, ...rest }) }));
|
|
11
11
|
});
|
|
12
12
|
CardHeader.displayName = 'CardHeader';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
|
|
7
7
|
const CardMedia = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
8
|
-
const Component = asChild ?
|
|
8
|
+
const Component = asChild ? Slot : 'div';
|
|
9
9
|
return (jsx(Component, { className: clsx(`ds-card__media`, className), ref: ref, ...rest }));
|
|
10
10
|
});
|
|
11
11
|
CardMedia.displayName = 'CardMedia';
|
|
@@ -3,10 +3,9 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
|
|
6
|
-
const Divider = forwardRef(({ color = 'default', className, ...rest }, ref) =>
|
|
7
|
-
|
|
8
|
-
});
|
|
9
|
-
Divider.displayName = 'Divider';
|
|
6
|
+
const Divider = forwardRef(({ color = 'default', className, ...rest }, ref) => (
|
|
7
|
+
// biome-ignore lint/a11y/noAriaHiddenOnFocusable: <hr> is not foucsable but biome thinks it is
|
|
8
|
+
jsx("hr", { "aria-hidden": 'true', className: clsx('ds-divider', `ds-divider--${color}`, className), ref: ref, ...rest })));
|
|
10
9
|
Divider.displayName = 'Divider';
|
|
11
10
|
|
|
12
11
|
export { Divider };
|
|
@@ -5,8 +5,8 @@ import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { forwardRef, useContext, useRef } from 'react';
|
|
7
7
|
import { DropdownMenuContext } from './DropdownMenuRoot.js';
|
|
8
|
-
import { autoUpdate
|
|
9
|
-
import { offset } from '../../node_modules/@floating-ui/
|
|
8
|
+
import { autoUpdate } from '../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js';
|
|
9
|
+
import { offset, shift } from '../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js';
|
|
10
10
|
import { useIsomorphicLayoutEffect } from '../../utilities/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js';
|
|
11
11
|
|
|
12
12
|
const GAP = 4;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMergeRefs } from '../../node_modules/@floating-ui/react/dist/floating-ui.react.js';
|
|
4
|
-
import { Slot
|
|
4
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
5
5
|
import { forwardRef, useContext } from 'react';
|
|
6
6
|
import { DropdownMenuContext } from './DropdownMenuRoot.js';
|
|
7
7
|
import { Button } from '../Button/Button.js';
|
|
@@ -9,7 +9,7 @@ import { Button } from '../Button/Button.js';
|
|
|
9
9
|
const DropdownMenuTrigger = forwardRef(({ asChild, ...rest }, ref) => {
|
|
10
10
|
const { triggerRef, internalOpen, setInternalOpen, isControlled } = useContext(DropdownMenuContext);
|
|
11
11
|
const mergedRefs = useMergeRefs([ref, triggerRef]);
|
|
12
|
-
const Component = asChild ?
|
|
12
|
+
const Component = asChild ? Slot : Button;
|
|
13
13
|
return (jsx(Component, { ref: mergedRefs, onClick: () => {
|
|
14
14
|
if (!isControlled)
|
|
15
15
|
setInternalOpen(!internalOpen);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { createContext, forwardRef, useId, useState } from 'react';
|
|
5
5
|
import { List } from '../List/index.js';
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ const ErrorSummaryContext = createContext({
|
|
|
11
11
|
const ErrorSummaryRoot = forwardRef(({ size, role = 'alert', 'aria-live': ariaLive = 'polite', 'aria-relevant': ariaRelevant = 'all', children, ...rest }, ref) => {
|
|
12
12
|
const randomId = useId();
|
|
13
13
|
const [headingId, setHeadingId] = useState(randomId);
|
|
14
|
-
return (jsx(ErrorSummaryContext.Provider, { value: { headingId, setHeadingId }, children: jsx(
|
|
14
|
+
return (jsx(ErrorSummaryContext.Provider, { value: { headingId, setHeadingId }, children: jsx(Slot, { className: 'ds-error-summary', ref: ref, role: role, "aria-live": ariaLive, "aria-relevant": ariaRelevant, "aria-labelledby": headingId, ...rest, children: jsx(List.Root, { size: size, children: children }) }) }));
|
|
15
15
|
});
|
|
16
16
|
ErrorSummaryRoot.displayName = 'ErrorSummaryRoot';
|
|
17
17
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
|
|
7
7
|
const Link = forwardRef(({ color = 'accent', asChild, children, className, ...rest }, ref) => {
|
|
8
|
-
const Component = asChild ?
|
|
8
|
+
const Component = asChild ? Slot : 'a';
|
|
9
9
|
return (jsx(Component, { className: clsx('ds-link', `ds-link--${color}`, className), ref: ref, ...rest, children: children }));
|
|
10
10
|
});
|
|
11
11
|
Link.displayName = 'Link';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
|
|
7
7
|
const ListItem = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
8
|
-
const Component = asChild ?
|
|
8
|
+
const Component = asChild ? Slot : 'li';
|
|
9
9
|
return (jsx(Component, { className: clsx('ds-list__item', className), ...rest, ref: ref }));
|
|
10
10
|
});
|
|
11
11
|
ListItem.displayName = 'ListItem';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { createContext, forwardRef, useState } from 'react';
|
|
5
5
|
|
|
6
6
|
const ListContext = createContext({
|
|
@@ -10,7 +10,7 @@ const ListContext = createContext({
|
|
|
10
10
|
});
|
|
11
11
|
const ListRoot = forwardRef(({ size = 'md', asChild, ...rest }, ref) => {
|
|
12
12
|
const [headingId, setHeadingId] = useState();
|
|
13
|
-
const Component = asChild ?
|
|
13
|
+
const Component = asChild ? Slot : 'div';
|
|
14
14
|
return (jsx(ListContext.Provider, { value: { size, headingId, setHeadingId }, children: jsx(Component, { ref: ref, ...rest }) }));
|
|
15
15
|
});
|
|
16
16
|
ListRoot.displayName = 'ListRoot';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef, useContext } from 'react';
|
|
6
6
|
import { ListContext } from './ListRoot.js';
|
|
@@ -8,13 +8,13 @@ import { Paragraph } from '../Typography/Paragraph/Paragraph.js';
|
|
|
8
8
|
|
|
9
9
|
const Unordered = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
10
10
|
const { size, headingId } = useContext(ListContext);
|
|
11
|
-
const Component = asChild ?
|
|
11
|
+
const Component = asChild ? Slot : 'ul';
|
|
12
12
|
return (jsx(Paragraph, { size: size, asChild: true, children: jsx(Component, { className: clsx(`ds-list`, `ds-list--${size}`, className), ...(headingId ? { 'aria-labelledby': headingId } : {}), ref: ref, ...rest }) }));
|
|
13
13
|
});
|
|
14
14
|
Unordered.displayName = 'ListUnordered';
|
|
15
15
|
const Ordered = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
16
16
|
const { size, headingId } = useContext(ListContext);
|
|
17
|
-
const Component = asChild ?
|
|
17
|
+
const Component = asChild ? Slot : 'ol';
|
|
18
18
|
return (jsx(Paragraph, { size: size, asChild: true, children: jsx(Component, { className: clsx(`ds-list`, `ds-list--${size}`, className), ...(headingId ? { 'aria-labelledby': headingId } : {}), ref: ref, ...rest }) }));
|
|
19
19
|
});
|
|
20
20
|
Ordered.displayName = 'ListOrdered';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
|
|
7
7
|
const ModalContent = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
8
|
-
const Component = asChild ?
|
|
8
|
+
const Component = asChild ? Slot : 'div';
|
|
9
9
|
return (jsx(Component, { ref: ref, className: clsx('ds-modal__content', className), ...rest }));
|
|
10
10
|
});
|
|
11
11
|
ModalContent.displayName = 'ModalContent';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx
|
|
3
|
-
import {
|
|
4
|
-
import { Slot
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useMergeRefs } from '../../node_modules/@floating-ui/react/dist/floating-ui.react.js';
|
|
4
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
5
5
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
6
6
|
import { forwardRef, useRef, useContext, useEffect } from 'react';
|
|
7
7
|
import { ModalContext } from './ModalRoot.js';
|
|
@@ -9,10 +9,9 @@ import { useModalState } from './useModalState.js';
|
|
|
9
9
|
import { useScrollLock } from './useScrollLock.js';
|
|
10
10
|
|
|
11
11
|
const ModalDialog = forwardRef(({ onInteractOutside, onClose, onBeforeClose, asChild, className, children, ...rest }, ref) => {
|
|
12
|
-
const Component = asChild ?
|
|
12
|
+
const Component = asChild ? Slot : 'dialog';
|
|
13
13
|
// This local ref is used to make sure the modal works without a ModalRoot
|
|
14
14
|
const modalDialogRef = useRef(null);
|
|
15
|
-
const { context } = useFloating();
|
|
16
15
|
const { modalRef, setOpen, setCloseModal } = useContext(ModalContext);
|
|
17
16
|
const open = useModalState(modalDialogRef);
|
|
18
17
|
useEffect(() => {
|
|
@@ -65,7 +64,7 @@ const ModalDialog = forwardRef(({ onInteractOutside, onClose, onBeforeClose, asC
|
|
|
65
64
|
}
|
|
66
65
|
modalRef.current?.close();
|
|
67
66
|
};
|
|
68
|
-
return (jsx(Component, { ref: mergedRefs, className: clsx('ds-modal', className), onCancel: onCancel, ...rest, children:
|
|
67
|
+
return (jsx(Component, { ref: mergedRefs, className: clsx('ds-modal', className), onCancel: onCancel, ...rest, children: children }));
|
|
69
68
|
});
|
|
70
69
|
ModalDialog.displayName = 'ModalDialog';
|
|
71
70
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
|
|
7
7
|
const ModalFooter = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
8
|
-
const Component = asChild ?
|
|
8
|
+
const Component = asChild ? Slot : 'footer';
|
|
9
9
|
return (jsx(Component, { ref: ref, className: clsx('ds-modal__footer', className), ...rest }));
|
|
10
10
|
});
|
|
11
11
|
ModalFooter.displayName = 'ModalFooter';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { XMarkIcon } from '@navikt/aksel-icons';
|
|
4
|
-
import { Slot
|
|
4
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
5
5
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
6
6
|
import { forwardRef, useContext } from 'react';
|
|
7
7
|
import { ModalContext } from './ModalRoot.js';
|
|
@@ -9,10 +9,10 @@ import { Button } from '../Button/Button.js';
|
|
|
9
9
|
import { Paragraph } from '../Typography/Paragraph/Paragraph.js';
|
|
10
10
|
import { Heading } from '../Typography/Heading/Heading.js';
|
|
11
11
|
|
|
12
|
-
const ModalHeader = forwardRef(({ closeButton = true, children, subtitle, asChild, className, ...rest }, ref) => {
|
|
13
|
-
const Component = asChild ?
|
|
12
|
+
const ModalHeader = forwardRef(({ closeButton = true, closeButtonTitle = 'close modal', children, subtitle, asChild, className, ...rest }, ref) => {
|
|
13
|
+
const Component = asChild ? Slot : 'div';
|
|
14
14
|
const { closeModal } = useContext(ModalContext);
|
|
15
|
-
return (jsxs(Component, { ref: ref, className: clsx('ds-modal__header', !closeButton && 'ds-modal__header--no-button', className), ...rest, children: [subtitle && (jsx(Paragraph, { size: 'sm', variant: 'short', children: subtitle })), jsx(Heading, { level: 2, size: 'xs', children: children }), closeButton && (jsx(Button, { name: 'close', variant: 'tertiary', color: 'neutral', size: 'md', onClick: () => closeModal?.(), autoFocus: true, icon: true, className: 'ds-modal__header__button', children: jsx(XMarkIcon, { title:
|
|
15
|
+
return (jsxs(Component, { ref: ref, className: clsx('ds-modal__header', !closeButton && 'ds-modal__header--no-button', className), ...rest, children: [subtitle && (jsx(Paragraph, { size: 'sm', variant: 'short', children: subtitle })), jsx(Heading, { level: 2, size: 'xs', children: children }), closeButton && (jsx(Button, { name: 'close', variant: 'tertiary', color: 'neutral', size: 'md', onClick: () => closeModal?.(), autoFocus: true, icon: true, className: 'ds-modal__header__button', title: closeButtonTitle, children: jsx(XMarkIcon, { title: closeButtonTitle, fontSize: '1.5em' }) }))] }));
|
|
16
16
|
});
|
|
17
17
|
ModalHeader.displayName = 'ModalHeader';
|
|
18
18
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { forwardRef, useContext } from 'react';
|
|
5
5
|
import { ModalContext } from './ModalRoot.js';
|
|
6
6
|
import { Button } from '../Button/Button.js';
|
|
7
7
|
|
|
8
8
|
const ModalTrigger = forwardRef(({ asChild, ...rest }, ref) => {
|
|
9
9
|
const { modalRef, open } = useContext(ModalContext);
|
|
10
|
-
const Component = asChild ?
|
|
10
|
+
const Component = asChild ? Slot : Button;
|
|
11
11
|
return (jsx(Component, { ref: ref, onClick: () => modalRef?.current?.showModal(), "aria-expanded": open, "aria-haspopup": 'dialog', ...rest }));
|
|
12
12
|
});
|
|
13
13
|
ModalTrigger.displayName = 'ModalTrigger';
|
|
@@ -20,4 +20,4 @@ Modal.Header.displayName = 'Modal.Header';
|
|
|
20
20
|
Modal.Content.displayName = 'Modal.Content';
|
|
21
21
|
Modal.Trigger.displayName = 'Modal.Trigger';
|
|
22
22
|
|
|
23
|
-
export { Modal, ModalContent, ModalDialog, ModalFooter, ModalHeader, ModalTrigger };
|
|
23
|
+
export { Modal, ModalContent, ModalDialog, ModalFooter, ModalHeader, ModalRoot, ModalTrigger };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef, useContext } from 'react';
|
|
6
6
|
import { PaginationContext } from './PaginationRoot.js';
|
|
7
7
|
|
|
8
8
|
const PaginationContent = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
9
|
-
const Component = asChild ?
|
|
9
|
+
const Component = asChild ? Slot : 'ul';
|
|
10
10
|
const { size } = useContext(PaginationContext);
|
|
11
11
|
return (jsx(Component, { ref: ref, className: clsx('ds-pagination', `ds-pagination--${size}`, className), ...rest }));
|
|
12
12
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef, useContext } from 'react';
|
|
6
6
|
import { PaginationContext } from './PaginationRoot.js';
|
|
7
7
|
|
|
8
8
|
const PaginationItem = forwardRef(({ asChild, className, ...rest }, ref) => {
|
|
9
|
-
const Component = asChild ?
|
|
9
|
+
const Component = asChild ? Slot : 'li';
|
|
10
10
|
const { size, compact } = useContext(PaginationContext);
|
|
11
11
|
return (jsx(Component, { ref: ref, className: clsx('ds-pagination__item', `ds-pagination--${size}`, compact && 'ds-pagination--compact', className), ...rest }));
|
|
12
12
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { createContext, forwardRef } from 'react';
|
|
5
5
|
|
|
6
6
|
const PaginationContext = createContext({
|
|
@@ -8,7 +8,7 @@ const PaginationContext = createContext({
|
|
|
8
8
|
compact: false,
|
|
9
9
|
});
|
|
10
10
|
const PaginationRoot = forwardRef(({ asChild, compact = false, size = 'md', ...rest }, ref) => {
|
|
11
|
-
const Component = asChild ?
|
|
11
|
+
const Component = asChild ? Slot : 'nav';
|
|
12
12
|
return (jsx(PaginationContext.Provider, { value: { size, compact }, children: jsx(Component, { ref: ref, "aria-label": 'Pagination', ...rest }) }));
|
|
13
13
|
});
|
|
14
14
|
PaginationRoot.displayName = 'PaginationRoot';
|
|
@@ -5,9 +5,8 @@ import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { forwardRef, useContext, useRef, useEffect, useMemo } from 'react';
|
|
7
7
|
import { PopoverContext } from './PopoverRoot.js';
|
|
8
|
-
import { autoUpdate
|
|
9
|
-
import { offset } from '../../node_modules/@floating-ui/
|
|
10
|
-
import { arrow } from '../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js';
|
|
8
|
+
import { autoUpdate } from '../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js';
|
|
9
|
+
import { offset, flip, shift, arrow } from '../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js';
|
|
11
10
|
import { useIsomorphicLayoutEffect } from '../../utilities/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js';
|
|
12
11
|
import { Paragraph } from '../Typography/Paragraph/Paragraph.js';
|
|
13
12
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMergeRefs } from '../../node_modules/@floating-ui/react/dist/floating-ui.react.js';
|
|
4
|
-
import { Slot
|
|
4
|
+
import { Slot } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
5
5
|
import { forwardRef, useContext, useEffect } from 'react';
|
|
6
6
|
import { PopoverContext } from './PopoverRoot.js';
|
|
7
7
|
import { Button } from '../Button/Button.js';
|
|
@@ -12,7 +12,7 @@ const PopoverTrigger = forwardRef(({ id, asChild, ...rest }, ref) => {
|
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
id && setTriggerId?.(id);
|
|
14
14
|
}, [id, setTriggerId]);
|
|
15
|
-
const Component = asChild ?
|
|
15
|
+
const Component = asChild ? Slot : Button;
|
|
16
16
|
return (jsx(Component, { ref: mergedRefs, onClick: () => {
|
|
17
17
|
if (!isControlled)
|
|
18
18
|
setInternalOpen(!internalOpen);
|
|
@@ -17,7 +17,7 @@ import { RovingFocusRoot } from '../../utilities/RovingFocus/RovingFocusRoot.js'
|
|
|
17
17
|
*/
|
|
18
18
|
const TabList = forwardRef(({ children, className, ...rest }, ref) => {
|
|
19
19
|
const { value } = useContext(TabsContext);
|
|
20
|
-
return (jsx(RovingFocusRoot, { role: 'tablist', activeValue: value, className: clsx('ds-tabs__tablist', className), ref: ref, ...rest, children: children }));
|
|
20
|
+
return (jsx(RovingFocusRoot, { role: 'tablist', activeValue: value, className: clsx('ds-tabs__tablist', className), orientation: 'ambiguous', ref: ref, ...rest, children: children }));
|
|
21
21
|
});
|
|
22
22
|
TabList.displayName = 'TabList';
|
|
23
23
|
|
|
@@ -32,7 +32,7 @@ const ToggleGroupRoot = forwardRef(({ size = 'md', children, value, defaultValue
|
|
|
32
32
|
name: name ?? `togglegroup-name-${nameId}`,
|
|
33
33
|
onChange: onValueChange,
|
|
34
34
|
size,
|
|
35
|
-
}, children: [name && (jsx("input", { className: 'ds-togglegroup__input', name: name, value: value })), jsx(RovingFocusRoot, { asChild: true, activeValue: value, children: jsx("div", { className: 'ds-togglegroup__content', role: 'radiogroup', children: children }) })] }) }));
|
|
35
|
+
}, children: [name && (jsx("input", { className: 'ds-togglegroup__input', name: name, value: value })), jsx(RovingFocusRoot, { asChild: true, activeValue: value, orientation: 'ambiguous', children: jsx("div", { className: 'ds-togglegroup__content', role: 'radiogroup', children: children }) })] }) }));
|
|
36
36
|
});
|
|
37
37
|
ToggleGroupRoot.displayName = 'ToggleGroupRoot';
|
|
38
38
|
|
|
@@ -4,9 +4,8 @@ import { useFloating, useTransitionStyles, useInteractions, useHover, useFocus,
|
|
|
4
4
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { forwardRef, useState, cloneElement } from 'react';
|
|
7
|
-
import { autoUpdate
|
|
8
|
-
import { offset } from '../../node_modules/@floating-ui/
|
|
9
|
-
import { arrow } from '../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js';
|
|
7
|
+
import { autoUpdate } from '../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js';
|
|
8
|
+
import { offset, flip, shift, arrow } from '../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js';
|
|
10
9
|
import { Paragraph } from '../Typography/Paragraph/Paragraph.js';
|
|
11
10
|
|
|
12
11
|
const ARROW_HEIGHT = 7;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
|
|
7
7
|
/** Use `ErrorMessage` to display text as error message. */
|
|
8
8
|
const ErrorMessage = forwardRef(({ size = 'md', className, spacing, asChild, error = true, ...rest }, ref) => {
|
|
9
|
-
const Component = asChild ?
|
|
9
|
+
const Component = asChild ? Slot : 'div';
|
|
10
10
|
return (jsx(Component, { ref: ref, className: clsx('ds-error-message', `ds-error_message--${size}`, spacing && 'ds-error-message--spacing', error && 'ds-error-message--error', className), ...rest }));
|
|
11
11
|
});
|
|
12
12
|
ErrorMessage.displayName = 'ErrorMessage';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ import { forwardRef } from 'react';
|
|
|
11
11
|
* <Heading size='lg' level={2}>Heading</Heading>
|
|
12
12
|
*/
|
|
13
13
|
const Heading = forwardRef(({ size = 'xl', level = 1, spacing = false, className, asChild, ...rest }, ref) => {
|
|
14
|
-
const Component = asChild ?
|
|
14
|
+
const Component = asChild ? Slot : `h${level ?? 1}`;
|
|
15
15
|
return (jsx(Component, { ref: ref, className: clsx('ds-heading', `ds-heading--${size}`, spacing && 'ds-heading--spacing', className), ...rest }));
|
|
16
16
|
});
|
|
17
17
|
Heading.displayName = 'Heading';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ import { forwardRef } from 'react';
|
|
|
11
11
|
* <Ingress size='lg'>Ingress</Ingress>
|
|
12
12
|
*/
|
|
13
13
|
const Ingress = forwardRef(({ size = 'md', className, spacing, asChild, ...rest }, ref) => {
|
|
14
|
-
const Component = asChild ?
|
|
14
|
+
const Component = asChild ? Slot : 'p';
|
|
15
15
|
return (jsx(Component, { ref: ref, className: clsx(`ds-ingress`, `ds-ingress--${size}`, spacing && 'ds-ingress--spacing', className), ...rest }));
|
|
16
16
|
});
|
|
17
17
|
Ingress.displayName = 'Ingress';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ import { forwardRef } from 'react';
|
|
|
11
11
|
* <Label size='lg'>Label</Label>
|
|
12
12
|
*/
|
|
13
13
|
const Label = forwardRef(({ className, spacing, size = 'md', weight = 'medium', asChild, ...rest }, ref) => {
|
|
14
|
-
const Component = asChild ?
|
|
14
|
+
const Component = asChild ? Slot : 'label';
|
|
15
15
|
return (jsx(Component, { ref: ref, className: clsx('ds-label', `ds-label--${size}`, spacing && 'ds-label--spacing', weight && `ds-font-weight--${weight}`, className), ...rest }));
|
|
16
16
|
});
|
|
17
17
|
Label.displayName = 'Label';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Slot
|
|
3
|
+
import { Slot } from '../../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
4
4
|
import { clsx } from '../../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ const lineHeightMap = {
|
|
|
16
16
|
* <Paragraph size='lg'>Paragraph</Paragraph>
|
|
17
17
|
*/
|
|
18
18
|
const Paragraph = forwardRef(({ className, spacing, size = 'md', asChild, variant, ...rest }, ref) => {
|
|
19
|
-
const Component = asChild ?
|
|
19
|
+
const Component = asChild ? Slot : 'p';
|
|
20
20
|
return (jsx(Component, { ref: ref, className: clsx('ds-paragraph', spacing && 'ds-paragraph--spacing', `ds-paragraph--${size}`, lineHeightMap[variant ?? 'default'], className), ...rest }));
|
|
21
21
|
});
|
|
22
22
|
Paragraph.displayName = 'Paragraph';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { clsx } from '../../../node_modules/clsx/dist/lite.js';
|
|
3
4
|
import { createContext, forwardRef, useState } from 'react';
|
|
4
|
-
import { Fieldset } from '
|
|
5
|
+
import { Fieldset } from '../Fieldset/Fieldset.js';
|
|
5
6
|
|
|
6
7
|
const CheckboxGroupContext = createContext(null);
|
|
7
8
|
const CheckboxGroup = forwardRef(({ onChange, children, value, readOnly, defaultValue, size = 'md', ...rest }, ref) => {
|
|
@@ -20,7 +21,7 @@ const CheckboxGroup = forwardRef(({ onChange, children, value, readOnly, default
|
|
|
20
21
|
value,
|
|
21
22
|
defaultValue,
|
|
22
23
|
toggleValue,
|
|
23
|
-
}, children: jsx("div", { className: 'ds-checkbox__group', children: children }) }) }));
|
|
24
|
+
}, children: jsx("div", { className: clsx('ds-checkbox__group', `ds-checkbox__group--${size}`), children: children }) }) }));
|
|
24
25
|
});
|
|
25
26
|
CheckboxGroup.displayName = 'CheckboxGroup';
|
|
26
27
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { Checkbox as Checkbox$1 } from './Checkbox.js';
|
|
3
|
-
import { CheckboxGroup } from './
|
|
3
|
+
import { CheckboxGroup } from './CheckboxGroup.js';
|
|
4
4
|
|
|
5
5
|
/** `<input> element with `type="checkbox"` used for selecting one option */
|
|
6
6
|
const Checkbox = Checkbox$1;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { useFormField } from '../useFormField.js';
|
|
4
|
-
import { CheckboxGroupContext } from './
|
|
4
|
+
import { CheckboxGroupContext } from './CheckboxGroup.js';
|
|
5
5
|
|
|
6
6
|
/** Handles props for `Checkbox` in context with `Checkbox.Group` (and `Fieldset`) */
|
|
7
7
|
const useCheckbox = (props) => {
|
|
@@ -96,9 +96,9 @@ const ComboboxComponent = forwardRef(({ value, initialValue = [], onValueChange,
|
|
|
96
96
|
}
|
|
97
97
|
else {
|
|
98
98
|
/* clear newSelectedOptions */
|
|
99
|
-
Object.keys(newSelectedOptions)
|
|
99
|
+
for (const key of Object.keys(newSelectedOptions)) {
|
|
100
100
|
delete newSelectedOptions[key];
|
|
101
|
-
}
|
|
101
|
+
}
|
|
102
102
|
newSelectedOptions[prefix(option.value)] = option;
|
|
103
103
|
setInputValue(option?.label || '');
|
|
104
104
|
// move cursor to the end of the input
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMergeRefs } from '../../../node_modules/@floating-ui/react/dist/floating-ui.react.js';
|
|
4
|
-
import { Slot
|
|
4
|
+
import { Slot } from '../../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
5
5
|
import { clsx } from '../../../node_modules/clsx/dist/lite.js';
|
|
6
6
|
import { forwardRef, useId, useContext, useMemo } from 'react';
|
|
7
7
|
import { ComboboxContext } from './ComboboxContext.js';
|
|
@@ -13,7 +13,7 @@ const ComboboxCustom = forwardRef(({ asChild, interactive, id, className, ...res
|
|
|
13
13
|
if (interactive && !id) {
|
|
14
14
|
throw new Error('If ComboboxCustom is interactive, it must have an id');
|
|
15
15
|
}
|
|
16
|
-
const Component = asChild ?
|
|
16
|
+
const Component = asChild ? Slot : 'div';
|
|
17
17
|
const randomId = useId();
|
|
18
18
|
const { activeIndex } = useComboboxId();
|
|
19
19
|
const context = useContext(ComboboxContext);
|