@digdir/designsystemet-react 1.1.5 → 1.1.7
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/Combobox/Combobox.js +2 -2
- package/dist/cjs/components/Combobox/Custom.js +1 -1
- package/dist/cjs/components/Combobox/Option/Option.js +1 -1
- package/dist/cjs/components/Combobox/Option/useComboboxOption.js +1 -1
- package/dist/cjs/components/Combobox/internal/ComboboxInput.js +1 -1
- package/dist/cjs/{utilities → components/Combobox}/omit/omit.js +2 -0
- package/dist/cjs/components/Combobox/useComboboxKeyboard.js +1 -1
- package/dist/cjs/components/breadcrumbs/index.js +6 -6
- package/dist/cjs/components/card/index.js +3 -3
- package/dist/cjs/components/chip/index.js +6 -6
- package/dist/cjs/components/details/index.js +4 -4
- package/dist/cjs/components/dialog/index.js +5 -5
- package/dist/cjs/components/dropdown/dropdown-button.js +12 -0
- package/dist/cjs/components/dropdown/dropdown-heading.js +8 -0
- package/dist/cjs/components/dropdown/dropdown-item.js +12 -0
- package/dist/cjs/components/dropdown/dropdown-list.js +12 -0
- package/dist/cjs/components/dropdown/dropdown-trigger-context.js +9 -9
- package/dist/cjs/components/dropdown/dropdown-trigger.js +16 -0
- package/dist/cjs/components/dropdown/index.js +20 -9
- package/dist/cjs/components/error-summary/error-summary-heading.js +8 -0
- package/dist/cjs/components/error-summary/error-summary-item.js +4 -4
- package/dist/cjs/components/error-summary/error-summary-link.js +8 -1
- package/dist/cjs/components/error-summary/error-summary-list.js +15 -0
- package/dist/cjs/components/error-summary/index.js +6 -6
- package/dist/cjs/components/field/field-description.js +6 -0
- package/dist/cjs/components/field/index.js +6 -6
- package/dist/cjs/components/fieldset/fieldset-description.js +2 -2
- package/dist/cjs/components/fieldset/fieldset-legend.js +1 -1
- package/dist/cjs/components/fieldset/index.js +4 -4
- package/dist/cjs/components/list/index.js +5 -5
- package/dist/cjs/components/list/list-item.js +6 -0
- package/dist/cjs/components/list/lists.js +8 -8
- package/dist/cjs/components/pagination/index.js +5 -5
- package/dist/cjs/components/pagination/pagination-button.js +3 -3
- package/dist/cjs/components/pagination/pagination-item.js +5 -5
- package/dist/cjs/components/pagination/pagination-list.js +5 -5
- package/dist/cjs/components/popover/index.js +4 -4
- package/dist/cjs/components/popover/popover-trigger-context.js +3 -3
- package/dist/cjs/components/popover/popover-trigger.js +6 -6
- package/dist/cjs/components/search/index.js +5 -5
- package/dist/cjs/components/search/search-button.js +2 -2
- package/dist/cjs/components/search/search-clear.js +2 -2
- package/dist/cjs/components/search/search-input.js +1 -1
- package/dist/cjs/components/select/index.js +4 -4
- package/dist/cjs/components/select/select-optgroup.js +4 -4
- package/dist/cjs/components/select/select-option.js +2 -2
- package/dist/cjs/components/table/index.js +9 -9
- package/dist/cjs/components/table/table-body.js +6 -6
- package/dist/cjs/components/table/table-cell.js +1 -1
- package/dist/cjs/components/table/table-foot.js +6 -6
- package/dist/cjs/components/table/table-head.js +6 -6
- package/dist/cjs/components/table/table-header-cell.js +1 -1
- package/dist/cjs/components/table/table-row.js +4 -4
- package/dist/cjs/components/tabs/index.js +5 -5
- package/dist/cjs/components/tabs/tabs-list.js +4 -4
- package/dist/cjs/components/tabs/tabs-panel.js +1 -1
- package/dist/cjs/components/tabs/tabs-tab.js +1 -1
- package/dist/cjs/components/toggle-group/index.js +3 -3
- package/dist/cjs/components/toggle-group/toggle-group-item.js +1 -1
- package/dist/cjs/index.js +20 -24
- package/dist/cjs/utilities/hooks/use-synchronized-animation/use-synchronized-animation.js +4 -2
- package/dist/esm/components/Combobox/Combobox.js +2 -2
- package/dist/esm/components/Combobox/Custom.js +1 -1
- package/dist/esm/components/Combobox/Option/Option.js +1 -1
- package/dist/esm/components/Combobox/Option/useComboboxOption.js +1 -1
- package/dist/esm/components/Combobox/internal/ComboboxInput.js +1 -1
- package/dist/esm/{utilities → components/Combobox}/omit/omit.js +2 -0
- package/dist/esm/components/Combobox/useComboboxKeyboard.js +1 -1
- package/dist/esm/components/breadcrumbs/index.js +7 -7
- package/dist/esm/components/card/index.js +4 -4
- package/dist/esm/components/checkbox/checkbox.js +2 -2
- package/dist/esm/components/chip/index.js +6 -6
- package/dist/esm/components/details/index.js +5 -5
- package/dist/esm/components/dialog/index.js +6 -6
- package/dist/esm/components/dropdown/dropdown-button.js +12 -0
- package/dist/esm/components/dropdown/dropdown-heading.js +8 -0
- package/dist/esm/components/dropdown/dropdown-item.js +12 -0
- package/dist/esm/components/dropdown/dropdown-list.js +12 -0
- package/dist/esm/components/dropdown/dropdown-trigger-context.js +9 -9
- package/dist/esm/components/dropdown/dropdown-trigger.js +16 -0
- package/dist/esm/components/dropdown/index.js +21 -10
- package/dist/esm/components/error-summary/error-summary-heading.js +8 -0
- package/dist/esm/components/error-summary/error-summary-item.js +4 -4
- package/dist/esm/components/error-summary/error-summary-link.js +8 -1
- package/dist/esm/components/error-summary/error-summary-list.js +17 -2
- package/dist/esm/components/error-summary/index.js +7 -7
- package/dist/esm/components/field/field-description.js +6 -0
- package/dist/esm/components/field/index.js +7 -7
- package/dist/esm/components/fieldset/fieldset-description.js +2 -2
- package/dist/esm/components/fieldset/fieldset-legend.js +1 -1
- package/dist/esm/components/fieldset/index.js +5 -5
- package/dist/esm/components/list/index.js +5 -5
- package/dist/esm/components/list/list-item.js +6 -0
- package/dist/esm/components/list/lists.js +8 -8
- package/dist/esm/components/pagination/index.js +6 -6
- package/dist/esm/components/pagination/pagination-button.js +3 -3
- package/dist/esm/components/pagination/pagination-item.js +5 -5
- package/dist/esm/components/pagination/pagination-list.js +5 -5
- package/dist/esm/components/popover/index.js +5 -5
- package/dist/esm/components/popover/popover-trigger-context.js +3 -3
- package/dist/esm/components/popover/popover-trigger.js +6 -6
- package/dist/esm/components/radio/radio.js +2 -2
- package/dist/esm/components/search/index.js +6 -6
- package/dist/esm/components/search/search-button.js +2 -2
- package/dist/esm/components/search/search-clear.js +2 -2
- package/dist/esm/components/search/search-input.js +1 -1
- package/dist/esm/components/select/index.js +5 -5
- package/dist/esm/components/select/select-optgroup.js +4 -4
- package/dist/esm/components/select/select-option.js +2 -2
- package/dist/esm/components/suggestion/suggestion.js +2 -2
- package/dist/esm/components/switch/switch.js +2 -2
- package/dist/esm/components/table/index.js +10 -10
- package/dist/esm/components/table/table-body.js +6 -6
- package/dist/esm/components/table/table-cell.js +1 -1
- package/dist/esm/components/table/table-foot.js +6 -6
- package/dist/esm/components/table/table-head.js +6 -6
- package/dist/esm/components/table/table-header-cell.js +1 -1
- package/dist/esm/components/table/table-row.js +4 -4
- package/dist/esm/components/tabs/index.js +6 -6
- package/dist/esm/components/tabs/tabs-list.js +4 -4
- package/dist/esm/components/tabs/tabs-panel.js +1 -1
- package/dist/esm/components/tabs/tabs-tab.js +1 -1
- package/dist/esm/components/textfield/textfield.js +2 -2
- package/dist/esm/components/toggle-group/index.js +4 -4
- package/dist/esm/components/toggle-group/toggle-group-item.js +1 -1
- package/dist/esm/index.js +10 -11
- package/dist/esm/utilities/hooks/use-synchronized-animation/use-synchronized-animation.js +4 -3
- package/dist/react-types.d.ts +1 -2
- package/dist/types/colors.d.ts +1 -23
- package/dist/types/colors.d.ts.map +1 -1
- package/dist/types/components/Combobox/Combobox.d.ts +2 -2
- package/dist/types/components/Combobox/Option/Option.d.ts.map +1 -1
- package/dist/types/components/Combobox/internal/ComboboxInput.d.ts.map +1 -1
- package/dist/types/{utilities → components/Combobox}/omit/omit.d.ts +2 -0
- package/dist/types/components/Combobox/omit/omit.d.ts.map +1 -0
- package/dist/types/components/Combobox/useFormField/useFormField.d.ts +1 -1
- package/dist/types/components/Combobox/useFormField/useFormField.d.ts.map +1 -1
- package/dist/types/components/alert/alert.d.ts +1 -1
- package/dist/types/components/alert/alert.d.ts.map +1 -1
- package/dist/types/components/avatar/avatar.d.ts +2 -1
- package/dist/types/components/avatar/avatar.d.ts.map +1 -1
- package/dist/types/components/badge/badge.d.ts +1 -1
- package/dist/types/components/badge/badge.d.ts.map +1 -1
- package/dist/types/components/badge/index.d.ts +1 -1
- package/dist/types/components/breadcrumbs/index.d.ts +48 -12
- package/dist/types/components/breadcrumbs/index.d.ts.map +1 -1
- package/dist/types/components/button/button.d.ts +3 -3
- package/dist/types/components/button/button.d.ts.map +1 -1
- package/dist/types/components/card/index.d.ts +18 -10
- package/dist/types/components/card/index.d.ts.map +1 -1
- package/dist/types/components/chip/index.d.ts +33 -14
- package/dist/types/components/chip/index.d.ts.map +1 -1
- package/dist/types/components/details/index.d.ts +19 -7
- package/dist/types/components/details/index.d.ts.map +1 -1
- package/dist/types/components/dialog/dialog-trigger.d.ts +1 -1
- package/dist/types/components/dialog/index.d.ts +46 -25
- package/dist/types/components/dialog/index.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown-button.d.ts +12 -0
- package/dist/types/components/dropdown/dropdown-button.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown-heading.d.ts +8 -0
- package/dist/types/components/dropdown/dropdown-heading.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown-item.d.ts +12 -0
- package/dist/types/components/dropdown/dropdown-item.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown-list.d.ts +12 -0
- package/dist/types/components/dropdown/dropdown-list.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown-trigger-context.d.ts +9 -9
- package/dist/types/components/dropdown/dropdown-trigger.d.ts +16 -0
- package/dist/types/components/dropdown/dropdown-trigger.d.ts.map +1 -1
- package/dist/types/components/dropdown/index.d.ts +99 -19
- package/dist/types/components/dropdown/index.d.ts.map +1 -1
- package/dist/types/components/error-summary/error-summary-heading.d.ts +8 -0
- package/dist/types/components/error-summary/error-summary-heading.d.ts.map +1 -1
- package/dist/types/components/error-summary/error-summary-item.d.ts +4 -4
- package/dist/types/components/error-summary/error-summary-link.d.ts +8 -1
- package/dist/types/components/error-summary/error-summary-link.d.ts.map +1 -1
- package/dist/types/components/error-summary/error-summary-list.d.ts +15 -0
- package/dist/types/components/error-summary/error-summary-list.d.ts.map +1 -1
- package/dist/types/components/error-summary/index.d.ts +52 -20
- package/dist/types/components/error-summary/index.d.ts.map +1 -1
- package/dist/types/components/field/field-counter.d.ts +1 -1
- package/dist/types/components/field/field-description.d.ts +6 -0
- package/dist/types/components/field/field-description.d.ts.map +1 -1
- package/dist/types/components/field/index.d.ts +45 -17
- package/dist/types/components/field/index.d.ts.map +1 -1
- package/dist/types/components/fieldset/fieldset-description.d.ts +2 -2
- package/dist/types/components/fieldset/fieldset-legend.d.ts +1 -1
- package/dist/types/components/fieldset/index.d.ts +21 -9
- package/dist/types/components/fieldset/index.d.ts.map +1 -1
- package/dist/types/components/list/index.d.ts +32 -11
- package/dist/types/components/list/index.d.ts.map +1 -1
- package/dist/types/components/list/list-item.d.ts +6 -0
- package/dist/types/components/list/list-item.d.ts.map +1 -1
- package/dist/types/components/list/lists.d.ts +8 -8
- package/dist/types/components/pagination/index.d.ts +38 -15
- package/dist/types/components/pagination/index.d.ts.map +1 -1
- package/dist/types/components/pagination/pagination-button.d.ts +3 -3
- package/dist/types/components/pagination/pagination-item.d.ts +5 -5
- package/dist/types/components/pagination/pagination-list.d.ts +5 -5
- package/dist/types/components/popover/index.d.ts +39 -18
- package/dist/types/components/popover/index.d.ts.map +1 -1
- package/dist/types/components/popover/popover-trigger-context.d.ts +3 -3
- package/dist/types/components/popover/popover-trigger.d.ts +6 -6
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/popover/popover.d.ts.map +1 -1
- package/dist/types/components/search/index.d.ts +34 -15
- package/dist/types/components/search/index.d.ts.map +1 -1
- package/dist/types/components/search/search-button.d.ts +3 -3
- package/dist/types/components/search/search-clear.d.ts +2 -2
- package/dist/types/components/search/search-input.d.ts +1 -1
- package/dist/types/components/select/index.d.ts +27 -12
- package/dist/types/components/select/index.d.ts.map +1 -1
- package/dist/types/components/select/select-optgroup.d.ts +4 -4
- package/dist/types/components/select/select-option.d.ts +2 -2
- package/dist/types/components/suggestion/suggestion.d.ts +8 -8
- package/dist/types/components/table/index.d.ts +65 -16
- package/dist/types/components/table/index.d.ts.map +1 -1
- package/dist/types/components/table/table-body.d.ts +6 -6
- package/dist/types/components/table/table-cell.d.ts +1 -1
- package/dist/types/components/table/table-foot.d.ts +6 -6
- package/dist/types/components/table/table-head.d.ts +6 -6
- package/dist/types/components/table/table-header-cell.d.ts +1 -1
- package/dist/types/components/table/table-row.d.ts +4 -4
- package/dist/types/components/tabs/index.d.ts +29 -14
- package/dist/types/components/tabs/index.d.ts.map +1 -1
- package/dist/types/components/tabs/tabs-list.d.ts +4 -4
- package/dist/types/components/tabs/tabs-panel.d.ts +1 -1
- package/dist/types/components/tabs/tabs-tab.d.ts +1 -1
- package/dist/types/components/tabs/tabs.d.ts +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/toggle-group/index.d.ts +11 -11
- package/dist/types/components/toggle-group/index.d.ts.map +1 -1
- package/dist/types/components/toggle-group/toggle-group-item.d.ts +1 -1
- package/dist/types/components/toggle-group/toggle-group.d.ts +1 -1
- package/dist/types/components/validation-message/validation-message.d.ts +1 -1
- package/dist/types/components/validation-message/validation-message.d.ts.map +1 -1
- package/dist/types/index.d.ts +15 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utilities/hooks/deprecated/use-debounce-callback/use-debounce-callback.d.ts.map +1 -0
- package/dist/types/utilities/hooks/deprecated/use-isomorphic-layout-effect/use-isomorphic-layout-effect.d.ts.map +1 -0
- package/dist/types/utilities/hooks/deprecated/use-media-query/use-media-query.d.ts.map +1 -0
- package/dist/types/utilities/hooks/index.d.ts +3 -3
- package/dist/types/utilities/hooks/index.d.ts.map +1 -1
- package/dist/types/utilities/hooks/use-synchronized-animation/use-synchronized-animation.d.ts +2 -0
- package/dist/types/utilities/hooks/use-synchronized-animation/use-synchronized-animation.d.ts.map +1 -1
- package/dist/types/utilities/index.d.ts +4 -3
- package/dist/types/utilities/index.d.ts.map +1 -1
- package/dist/types/utilities/roving-focus/use-roving-focus.d.ts +2 -2
- package/package.json +8 -7
- package/dist/types/utilities/hooks/use-debounce-callback/use-debounce-callback.d.ts.map +0 -1
- package/dist/types/utilities/hooks/use-isomorphic-layout-effect/use-isomorphic-layout-effect.d.ts.map +0 -1
- package/dist/types/utilities/hooks/use-media-query/use-media-query.d.ts.map +0 -1
- package/dist/types/utilities/omit/omit.d.ts.map +0 -1
- package/dist/types/utilities/roving-focus/index.d.ts +0 -4
- package/dist/types/utilities/roving-focus/index.d.ts.map +0 -1
- /package/dist/cjs/utilities/hooks/{use-debounce-callback → deprecated/use-debounce-callback}/use-debounce-callback.js +0 -0
- /package/dist/cjs/utilities/hooks/{use-isomorphic-layout-effect → deprecated/use-isomorphic-layout-effect}/use-isomorphic-layout-effect.js +0 -0
- /package/dist/cjs/utilities/hooks/{use-media-query → deprecated/use-media-query}/use-media-query.js +0 -0
- /package/dist/esm/utilities/hooks/{use-debounce-callback → deprecated/use-debounce-callback}/use-debounce-callback.js +0 -0
- /package/dist/esm/utilities/hooks/{use-isomorphic-layout-effect → deprecated/use-isomorphic-layout-effect}/use-isomorphic-layout-effect.js +0 -0
- /package/dist/esm/utilities/hooks/{use-media-query → deprecated/use-media-query}/use-media-query.js +0 -0
- /package/dist/types/utilities/hooks/{use-debounce-callback → deprecated/use-debounce-callback}/use-debounce-callback.d.ts +0 -0
- /package/dist/types/utilities/hooks/{use-isomorphic-layout-effect → deprecated/use-isomorphic-layout-effect}/use-isomorphic-layout-effect.d.ts +0 -0
- /package/dist/types/utilities/hooks/{use-media-query → deprecated/use-media-query}/use-media-query.d.ts +0 -0
|
@@ -7,9 +7,9 @@ import { Button } from '../button/button.js';
|
|
|
7
7
|
* PaginationButton component, use within a Pagination.Item.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
-
* <
|
|
11
|
-
* <
|
|
12
|
-
* </
|
|
10
|
+
* <PaginationItem>
|
|
11
|
+
* <PaginationButton aria-label='Forrige side'>Forrige</PaginationButton>
|
|
12
|
+
* </PaginationItem>
|
|
13
13
|
*/
|
|
14
14
|
const PaginationButton = forwardRef(function PaginationButton(rest, ref) {
|
|
15
15
|
return jsx(Button, { ref: ref, ...rest });
|
|
@@ -7,11 +7,11 @@ import { forwardRef } from 'react';
|
|
|
7
7
|
* PaginationItem component, use within a Pagination.List.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
-
* <
|
|
11
|
-
* <
|
|
12
|
-
* <
|
|
13
|
-
* </
|
|
14
|
-
* </
|
|
10
|
+
* <PaginationList>
|
|
11
|
+
* <PaginationItem>
|
|
12
|
+
* <PaginationButton aria-label='Forrige side'>Forrige</PaginationButton>
|
|
13
|
+
* </PaginationItem>
|
|
14
|
+
* </PaginationList>
|
|
15
15
|
*/
|
|
16
16
|
const PaginationItem = forwardRef(function PaginationItem({ asChild, className, ...rest }, ref) {
|
|
17
17
|
const Component = asChild ? Slot : 'li';
|
|
@@ -8,11 +8,11 @@ import { forwardRef } from 'react';
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* <Pagination>
|
|
11
|
-
* <
|
|
12
|
-
* <
|
|
13
|
-
* <
|
|
14
|
-
* </
|
|
15
|
-
* </
|
|
11
|
+
* <PaginationList>
|
|
12
|
+
* <PaginationItem>
|
|
13
|
+
* <PaginationButton aria-label='Forrige side'>Forrige</PaginationButton>
|
|
14
|
+
* </PaginationItem>
|
|
15
|
+
* </PaginationList>
|
|
16
16
|
* </Pagination>
|
|
17
17
|
*/
|
|
18
18
|
const PaginationList = forwardRef(function PaginationList({ asChild, ...rest }, ref) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { Popover
|
|
2
|
+
import { Popover } from './popover.js';
|
|
3
3
|
import { PopoverTrigger } from './popover-trigger.js';
|
|
4
4
|
import { PopoverTriggerContext } from './popover-trigger-context.js';
|
|
5
5
|
|
|
@@ -14,11 +14,11 @@ import { PopoverTriggerContext } from './popover-trigger-context.js';
|
|
|
14
14
|
* </Popover>
|
|
15
15
|
* </Popover.TriggerContext>
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
17
|
+
const PopoverComponent = Object.assign(Popover, {
|
|
18
18
|
TriggerContext: PopoverTriggerContext,
|
|
19
19
|
Trigger: PopoverTrigger,
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
PopoverComponent.TriggerContext.displayName = 'Popover.TriggerContext';
|
|
22
|
+
PopoverComponent.Trigger.displayName = 'Popover.Trigger';
|
|
23
23
|
|
|
24
|
-
export { Popover, PopoverTrigger, PopoverTriggerContext };
|
|
24
|
+
export { PopoverComponent as Popover, PopoverTrigger, PopoverTriggerContext };
|
|
@@ -6,12 +6,12 @@ import { createContext, useId, useState } from 'react';
|
|
|
6
6
|
* PopoverTriggerContext component, use to wrap a Popover.Trigger and Popover.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* <
|
|
10
|
-
* <
|
|
9
|
+
* <PopoverTriggerContext>
|
|
10
|
+
* <PopoverTrigger>Open Popover</PopoverTrigger>
|
|
11
11
|
* <Popover>
|
|
12
12
|
* Content
|
|
13
13
|
* </Popover>
|
|
14
|
-
* </
|
|
14
|
+
* </PopoverTriggerContext>
|
|
15
15
|
*/
|
|
16
16
|
const PopoverTriggerContext = ({ children, }) => {
|
|
17
17
|
const randomPopoverId = useId();
|
|
@@ -9,22 +9,22 @@ import { Context } from './popover-trigger-context.js';
|
|
|
9
9
|
* PopoverTrigger component, used to trigger a popover.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
|
-
* <
|
|
13
|
-
* <
|
|
12
|
+
* <PopoverTriggerContext>
|
|
13
|
+
* <PopoverTrigger>Open Popover</PopoverTrigger>
|
|
14
14
|
* <Popover>
|
|
15
15
|
* Content
|
|
16
16
|
* </Popover>
|
|
17
|
-
* </
|
|
17
|
+
* </PopoverTriggerContext>
|
|
18
18
|
*
|
|
19
19
|
* @example inline
|
|
20
|
-
* <
|
|
20
|
+
* <PopoverTriggerContext>
|
|
21
21
|
* <Paragraph>
|
|
22
|
-
* We can use it <
|
|
22
|
+
* We can use it <PopoverTrigger inline={true}>inline</PopoverTrigger>.
|
|
23
23
|
* </Paragraph>
|
|
24
24
|
* <Popover>
|
|
25
25
|
* Content
|
|
26
26
|
* </Popover>
|
|
27
|
-
* </
|
|
27
|
+
* </PopoverTriggerContext>
|
|
28
28
|
*/
|
|
29
29
|
const PopoverTrigger = forwardRef(function PopoverTrigger({ id, inline, asChild, ...rest }, ref) {
|
|
30
30
|
const { popoverId } = useContext(Context);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import { Field } from '../field/index.js';
|
|
4
|
+
import { Field as FieldComponent } from '../field/index.js';
|
|
5
5
|
import { Input } from '../input/input.js';
|
|
6
6
|
import { Label } from '../label/label.js';
|
|
7
7
|
import { ValidationMessage } from '../validation-message/validation-message.js';
|
|
@@ -13,7 +13,7 @@ import { ValidationMessage } from '../validation-message/validation-message.js';
|
|
|
13
13
|
* <Radio label="I agree" value="agree" />
|
|
14
14
|
*/
|
|
15
15
|
const Radio = forwardRef(function Radio({ 'data-size': size, className, style, children, label, description, error, ...rest }, ref) {
|
|
16
|
-
return (jsxs(
|
|
16
|
+
return (jsxs(FieldComponent, { "data-size": size, className: className, style: style, children: [jsx(Input, { type: 'radio', ref: ref, ...rest }), !!label && jsx(Label, { weight: 'regular', children: label }), !!description && jsx("div", { "data-field": 'description', children: description }), !!error && jsx(ValidationMessage, { children: error })] }));
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
export { Radio };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { Search
|
|
2
|
+
import { Search } from './search.js';
|
|
3
3
|
import { SearchButton } from './search-button.js';
|
|
4
4
|
import { SearchClear } from './search-clear.js';
|
|
5
5
|
import { SearchInput } from './search-input.js';
|
|
@@ -20,13 +20,13 @@ import { SearchInput } from './search-input.js';
|
|
|
20
20
|
* <Search.Clear />
|
|
21
21
|
* </Search>
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const SearchComponent = Object.assign(Search, {
|
|
24
24
|
Clear: SearchClear,
|
|
25
25
|
Button: SearchButton,
|
|
26
26
|
Input: SearchInput,
|
|
27
27
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
SearchComponent.Clear.displayName = 'Search.Clear';
|
|
29
|
+
SearchComponent.Button.displayName = 'Search.Button';
|
|
30
|
+
SearchComponent.Input.displayName = 'Search.Input';
|
|
31
31
|
|
|
32
|
-
export { Search, SearchButton, SearchClear, SearchInput };
|
|
32
|
+
export { SearchComponent as Search, SearchButton, SearchClear, SearchInput };
|
|
@@ -8,8 +8,8 @@ import { Button } from '../button/button.js';
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* <Search>
|
|
11
|
-
* <
|
|
12
|
-
* <
|
|
11
|
+
* <SearchInput aria-label='Søk' />
|
|
12
|
+
* <SearchButton>Søk</SearchButton>
|
|
13
13
|
* </Search>
|
|
14
14
|
*/
|
|
15
15
|
const SearchButton = forwardRef(function SearchButton({ children = 'Søk', ...rest }, ref) {
|
|
@@ -9,8 +9,8 @@ import { setReactInputValue } from '../Combobox/utilities.js';
|
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* <Search>
|
|
12
|
-
* <
|
|
13
|
-
* <
|
|
12
|
+
* <SearchInput aria-label='Søk' />
|
|
13
|
+
* <SearchClear />
|
|
14
14
|
* </Search>
|
|
15
15
|
*/
|
|
16
16
|
const SearchClear = forwardRef(function SearchClear({ 'aria-label': label = 'Tøm', onClick, ...rest }, ref) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { Select
|
|
2
|
+
import { Select } from './select.js';
|
|
3
3
|
import { SelectOptgroup } from './select-optgroup.js';
|
|
4
4
|
import { SelectOption } from './select-option.js';
|
|
5
5
|
|
|
@@ -12,11 +12,11 @@ import { SelectOption } from './select-option.js';
|
|
|
12
12
|
* <Select.Option value='2'>Option 2</Select.Option>
|
|
13
13
|
* </Select>
|
|
14
14
|
*/
|
|
15
|
-
const
|
|
15
|
+
const SelectComponent = Object.assign(Select, {
|
|
16
16
|
Option: SelectOption,
|
|
17
17
|
Optgroup: SelectOptgroup,
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
SelectComponent.Option.displayName = 'Select.Option';
|
|
20
|
+
SelectComponent.Optgroup.displayName = 'Select.Optgroup';
|
|
21
21
|
|
|
22
|
-
export { Select, SelectOptgroup, SelectOption };
|
|
22
|
+
export { SelectComponent as Select, SelectOptgroup, SelectOption };
|
|
@@ -8,10 +8,10 @@ import { forwardRef } from 'react';
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* <Select>
|
|
11
|
-
* <
|
|
12
|
-
* <
|
|
13
|
-
* <
|
|
14
|
-
* </
|
|
11
|
+
* <SelectOptgroup label='Group 1'>
|
|
12
|
+
* <SelectOption value='1'>Option 1</SelectOption>
|
|
13
|
+
* <SelectOption value='2'>Option 2</SelectOption>
|
|
14
|
+
* </SelectOptgroup>
|
|
15
15
|
* </Select>
|
|
16
16
|
*/
|
|
17
17
|
const SelectOptgroup = forwardRef(function SelectOptgroup({ asChild, ...rest }, ref) {
|
|
@@ -8,8 +8,8 @@ import { forwardRef } from 'react';
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* <Select>
|
|
11
|
-
* <
|
|
12
|
-
* <
|
|
11
|
+
* <SelectOption value='1'>Option 1</SelectOption>
|
|
12
|
+
* <SelectOption value='2'>Option 2</SelectOption>
|
|
13
13
|
* </Select>
|
|
14
14
|
*/
|
|
15
15
|
const SelectOption = forwardRef(function SelectOption({ asChild, ...rest }, ref) {
|
|
@@ -3,7 +3,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import { forwardRef, createContext, useRef, useId, useState, useEffect, useCallback } from 'react';
|
|
4
4
|
import '@u-elements/u-combobox';
|
|
5
5
|
import cl from 'clsx/lite';
|
|
6
|
-
import { Chip } from '../chip/index.js';
|
|
6
|
+
import { Chip as ChipComponent } from '../chip/index.js';
|
|
7
7
|
import { useMergeRefs } from '../../utilities/hooks/use-merge-refs/use-merge-refs.js';
|
|
8
8
|
|
|
9
9
|
const SuggestionContext = createContext({
|
|
@@ -92,7 +92,7 @@ const Suggestion = forwardRef(function Suggestion({ children, className, creatab
|
|
|
92
92
|
}
|
|
93
93
|
setIsEmpty(index === disabled);
|
|
94
94
|
}, [filter]);
|
|
95
|
-
return (jsx(SuggestionContext.Provider, { value: { isEmpty, handleFilter, uComboboxRef }, children: jsxs("u-combobox", { "data-multiple": multiple || undefined, "data-creatable": creatable || undefined, class: cl('ds-suggestion', className), ref: mergedRefs, ...rest, children: [selectedItems.map((item) => (jsx(
|
|
95
|
+
return (jsx(SuggestionContext.Provider, { value: { isEmpty, handleFilter, uComboboxRef }, children: jsxs("u-combobox", { "data-multiple": multiple || undefined, "data-creatable": creatable || undefined, class: cl('ds-suggestion', className), ref: mergedRefs, ...rest, children: [selectedItems.map((item) => (jsx(ChipComponent.Removable, { value: item.value, asChild: true, children: jsx("data", { children: renderSelected(item) }) }, item.value))), children, !!name && (jsx("select", { name: name, multiple: true, hidden: true, id: selectId }))] }) }));
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
export { Suggestion, SuggestionContext };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import { Field } from '../field/index.js';
|
|
4
|
+
import { Field as FieldComponent } from '../field/index.js';
|
|
5
5
|
import { Input } from '../input/input.js';
|
|
6
6
|
import { Label } from '../label/label.js';
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ import { Label } from '../label/label.js';
|
|
|
12
12
|
* <Switch label="I agree" value="agree" />
|
|
13
13
|
*/
|
|
14
14
|
const Switch = forwardRef(function Switch({ 'data-size': size, children, className, description, label, position, style, ...rest }, ref) {
|
|
15
|
-
return (jsxs(
|
|
15
|
+
return (jsxs(FieldComponent, { className: className, "data-position": position, "data-size": size, style: style, children: [jsx(Input, { type: 'checkbox', role: 'switch', ref: ref, ...rest }), !!label && jsx(Label, { weight: 'regular', children: label }), !!description && jsx("div", { "data-field": 'description', children: description })] }));
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
export { Switch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { Table
|
|
2
|
+
import { Table } from './table.js';
|
|
3
3
|
import { TableBody } from './table-body.js';
|
|
4
4
|
import { TableCell } from './table-cell.js';
|
|
5
5
|
import { TableFoot } from './table-foot.js';
|
|
@@ -32,7 +32,7 @@ import { TableRow } from './table-row.js';
|
|
|
32
32
|
* </Table.Foot>
|
|
33
33
|
* </Table>
|
|
34
34
|
*/
|
|
35
|
-
const
|
|
35
|
+
const TableComponent = Object.assign(Table, {
|
|
36
36
|
Head: TableHead,
|
|
37
37
|
Body: TableBody,
|
|
38
38
|
Row: TableRow,
|
|
@@ -40,12 +40,12 @@ const Table = Object.assign(Table$1, {
|
|
|
40
40
|
HeaderCell: TableHeaderCell,
|
|
41
41
|
Foot: TableFoot,
|
|
42
42
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
TableComponent.displayName = 'Table';
|
|
44
|
+
TableComponent.Head.displayName = 'Table.Head';
|
|
45
|
+
TableComponent.Body.displayName = 'Table.Body';
|
|
46
|
+
TableComponent.Row.displayName = 'Table.Row';
|
|
47
|
+
TableComponent.Cell.displayName = 'Table.Cell';
|
|
48
|
+
TableComponent.HeaderCell.displayName = 'Table.HeaderCell';
|
|
49
|
+
TableComponent.Foot.displayName = 'Table.Foot';
|
|
50
50
|
|
|
51
|
-
export { Table, TableBody, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow };
|
|
51
|
+
export { TableComponent as Table, TableBody, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow };
|
|
@@ -6,12 +6,12 @@ import { forwardRef } from 'react';
|
|
|
6
6
|
* TableBody component, used to display the body of a table. Renders a native HTML tbody element.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* <
|
|
10
|
-
* <
|
|
11
|
-
* <
|
|
12
|
-
* <
|
|
13
|
-
* </
|
|
14
|
-
* </
|
|
9
|
+
* <TableBody>
|
|
10
|
+
* <TableRow>
|
|
11
|
+
* <TableCell>John</TableCell>
|
|
12
|
+
* <TableCell>25</TableCell>
|
|
13
|
+
* </TableRow>
|
|
14
|
+
* </TableBody>
|
|
15
15
|
*/
|
|
16
16
|
const TableBody = forwardRef(function TableBody(rest, ref) {
|
|
17
17
|
return jsx("tbody", { ref: ref, ...rest });
|
|
@@ -6,7 +6,7 @@ import { forwardRef } from 'react';
|
|
|
6
6
|
* TableCell component, used to display the cells of a table. Renders a native HTML td element.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* <
|
|
9
|
+
* <TableCell>John</TableCell>
|
|
10
10
|
*/
|
|
11
11
|
const TableCell = forwardRef(function TableCell(rest, ref) {
|
|
12
12
|
return jsx("td", { ref: ref, ...rest });
|
|
@@ -6,12 +6,12 @@ import { forwardRef } from 'react';
|
|
|
6
6
|
* TableFoot component, used to display the footer of a table. Renders a native HTML tfoot element.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* <
|
|
10
|
-
* <
|
|
11
|
-
* <
|
|
12
|
-
* <
|
|
13
|
-
* </
|
|
14
|
-
* </
|
|
9
|
+
* <TableFoot>
|
|
10
|
+
* <TableRow>
|
|
11
|
+
* <TableCell>Total</TableCell>
|
|
12
|
+
* <TableCell>2</TableCell>
|
|
13
|
+
* </TableRow>
|
|
14
|
+
* </TableFoot>
|
|
15
15
|
*/
|
|
16
16
|
const TableFoot = forwardRef(function TableFoot(rest, ref) {
|
|
17
17
|
return jsx("tfoot", { ref: ref, ...rest });
|
|
@@ -6,12 +6,12 @@ import { forwardRef } from 'react';
|
|
|
6
6
|
* TableHead component, used to display the header of a table. Renders a native HTML thead element.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* <
|
|
10
|
-
* <
|
|
11
|
-
* <
|
|
12
|
-
* <
|
|
13
|
-
* </
|
|
14
|
-
* </
|
|
9
|
+
* <TableHead>
|
|
10
|
+
* <TableRow>
|
|
11
|
+
* <TableHeaderCell>Name</TableHeaderCell>
|
|
12
|
+
* <TableHeaderCell>Age</TableHeaderCell>
|
|
13
|
+
* </TableRow>
|
|
14
|
+
* </TableHead>
|
|
15
15
|
*/
|
|
16
16
|
const TableHead = forwardRef(function TableHead(rest, ref) {
|
|
17
17
|
return jsx("thead", { ref: ref, ...rest });
|
|
@@ -6,7 +6,7 @@ import { forwardRef } from 'react';
|
|
|
6
6
|
* TableHeaderCell component, used to display the header cells of a table. Renders a native HTML th element.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* <
|
|
9
|
+
* <TableHeaderCell>Name</TableHeaderCell>
|
|
10
10
|
*/
|
|
11
11
|
const TableHeaderCell = forwardRef(function TableHeaderCell({ sort, children, ...rest }, ref) {
|
|
12
12
|
return (jsx("th", { "aria-sort": sort, ref: ref, ...rest, children: sort ? jsx("button", { type: 'button', children: children }) : children }));
|
|
@@ -6,10 +6,10 @@ import { forwardRef } from 'react';
|
|
|
6
6
|
* TableRow component, used to display the rows of a table. Renders a native HTML tr element.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* <
|
|
10
|
-
* <
|
|
11
|
-
* <
|
|
12
|
-
* </
|
|
9
|
+
* <TableRow>
|
|
10
|
+
* <TableCell>John</TableCell>
|
|
11
|
+
* <TableCell>25</TableCell>
|
|
12
|
+
* </TableRow>
|
|
13
13
|
*/
|
|
14
14
|
const TableRow = forwardRef(function TableRow(rest, ref) {
|
|
15
15
|
return jsx("tr", { ref: ref, ...rest });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { Tabs
|
|
2
|
+
import { Tabs } from './tabs.js';
|
|
3
3
|
import { TabsList } from './tabs-list.js';
|
|
4
4
|
import { TabsPanel } from './tabs-panel.js';
|
|
5
5
|
import { TabsTab } from './tabs-tab.js';
|
|
@@ -19,13 +19,13 @@ import { TabsTab } from './tabs-tab.js';
|
|
|
19
19
|
* <Tabs.Panel value='3'>content 3</Tabs.Panel>
|
|
20
20
|
* </Tabs>
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
const TabsComponent = Object.assign(Tabs, {
|
|
23
23
|
List: TabsList,
|
|
24
24
|
Tab: TabsTab,
|
|
25
25
|
Panel: TabsPanel,
|
|
26
26
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
TabsComponent.Tab.displayName = 'Tabs.Tab';
|
|
28
|
+
TabsComponent.List.displayName = 'Tabs.List';
|
|
29
|
+
TabsComponent.Panel.displayName = 'Tabs.Panel';
|
|
30
30
|
|
|
31
|
-
export { Tabs, TabsList, TabsPanel, TabsTab };
|
|
31
|
+
export { TabsComponent as Tabs, TabsList, TabsPanel, TabsTab };
|
|
@@ -8,10 +8,10 @@ import { Context } from './tabs.js';
|
|
|
8
8
|
* The container for all `Tab` components.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
|
-
* <
|
|
12
|
-
* <
|
|
13
|
-
* <
|
|
14
|
-
* </
|
|
11
|
+
* <TabsList>
|
|
12
|
+
* <TabsTab value='1'>Tab 1</TabsTab>
|
|
13
|
+
* <TabsTab value='2'>Tab 2</TabsTab>
|
|
14
|
+
* </TabsList>
|
|
15
15
|
*/
|
|
16
16
|
const TabsList = forwardRef(function TabsList({ children, ...rest }, ref) {
|
|
17
17
|
const { value } = useContext(Context);
|
|
@@ -8,7 +8,7 @@ import { useMergeRefs } from '../../utilities/hooks/use-merge-refs/use-merge-ref
|
|
|
8
8
|
* A single content item in a Tabs component.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
|
-
* <
|
|
11
|
+
* <TabsPanel value='1'>content 1</TabsPanel>
|
|
12
12
|
*/
|
|
13
13
|
const TabsPanel = forwardRef(function TabsPanel({ children, value, ...rest }, ref) {
|
|
14
14
|
const { value: tabsValue } = useContext(Context);
|
|
@@ -8,7 +8,7 @@ import { Context } from './tabs.js';
|
|
|
8
8
|
* A single item in a Tabs component.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
|
-
* <
|
|
11
|
+
* <TabsTab value='1'>Tab 1</TabsTab>
|
|
12
12
|
*/
|
|
13
13
|
const TabsTab = forwardRef(function TabsTab({ value, id, ...rest }, ref) {
|
|
14
14
|
const tabs = useContext(Context);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import { Field } from '../field/index.js';
|
|
4
|
+
import { Field as FieldComponent } from '../field/index.js';
|
|
5
5
|
import { Input } from '../input/input.js';
|
|
6
6
|
import { Label } from '../label/label.js';
|
|
7
7
|
import { Textarea } from '../textarea/textarea.js';
|
|
@@ -19,7 +19,7 @@ import { FieldAffixes, FieldAffix } from '../field/field-affix.js';
|
|
|
19
19
|
* <Textfield label="Textfield label">
|
|
20
20
|
*/
|
|
21
21
|
const Textfield = forwardRef(function Textfield({ label, description, error, multiline, prefix, suffix, 'data-size': size, counter, style, className, ...rest }, ref) {
|
|
22
|
-
return (jsxs(
|
|
22
|
+
return (jsxs(FieldComponent, { className: className, "data-size": size, style: style, children: [!!label && jsx(Label, { children: label }), !!description && jsx(FieldDescription, { children: description }), jsxs(FieldAffixes, { children: [prefix === undefined || jsx(FieldAffix, { children: prefix }), multiline === true ? (jsx(Textarea, { ref: ref, "aria-invalid": Boolean(error) || undefined, ...rest })) : (jsx(Input, { ref: ref, "aria-invalid": Boolean(error) || undefined, ...rest })), suffix === undefined || jsx(FieldAffix, { children: suffix })] }), !!error && jsx(ValidationMessage, { children: error }), !!counter && (jsx(FieldComponent.Counter, { ...(typeof counter === 'number' ? { limit: counter } : counter) }))] }));
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
export { Textfield };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { ToggleGroup
|
|
2
|
+
import { ToggleGroup } from './toggle-group.js';
|
|
3
3
|
import { ToggleGroupItem } from './toggle-group-item.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -12,9 +12,9 @@ import { ToggleGroupItem } from './toggle-group-item.js';
|
|
|
12
12
|
* <ToggleGroup.Item value='3'>Toggle 3</ToggleGroup.Item>
|
|
13
13
|
* </ToggleGroup>
|
|
14
14
|
*/
|
|
15
|
-
const
|
|
15
|
+
const ToggleGroupComponent = Object.assign(ToggleGroup, {
|
|
16
16
|
Item: ToggleGroupItem,
|
|
17
17
|
});
|
|
18
|
-
|
|
18
|
+
ToggleGroupComponent.Item.displayName = 'ToggleGroup.Item';
|
|
19
19
|
|
|
20
|
-
export { ToggleGroup, ToggleGroupItem };
|
|
20
|
+
export { ToggleGroupComponent as ToggleGroup, ToggleGroupItem };
|
|
@@ -8,7 +8,7 @@ import { useToggleGroupItem } from './use-toggle-groupitem.js';
|
|
|
8
8
|
/**
|
|
9
9
|
* A single item in a ToggleGroup.
|
|
10
10
|
* @example
|
|
11
|
-
* <
|
|
11
|
+
* <ToggleGroupItem value='1'>Toggle 1</ToggleGroupItem>
|
|
12
12
|
*/
|
|
13
13
|
const ToggleGroupItem = forwardRef(function ToggleGroupItem(rest, ref) {
|
|
14
14
|
const { active, buttonProps, value } = useToggleGroupItem(rest);
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
export { omit } from './components/Combobox/omit/omit.js';
|
|
3
|
+
export { RovingFocusItem } from './utilities/roving-focus/roving-focus-item.js';
|
|
4
|
+
export { RovingFocusRoot } from './utilities/roving-focus/roving-focus-root.js';
|
|
5
|
+
export { useCheckboxGroup } from './utilities/hooks/use-checkbox-group/use-checkbox-group.js';
|
|
6
|
+
export { useDebounceCallback } from './utilities/hooks/deprecated/use-debounce-callback/use-debounce-callback.js';
|
|
7
|
+
export { useIsomorphicLayoutEffect } from './utilities/hooks/deprecated/use-isomorphic-layout-effect/use-isomorphic-layout-effect.js';
|
|
8
|
+
export { useMediaQuery } from './utilities/hooks/deprecated/use-media-query/use-media-query.js';
|
|
9
|
+
export { usePagination } from './utilities/hooks/use-pagination/use-pagination.js';
|
|
10
|
+
export { useRadioGroup } from './utilities/hooks/use-radio-group/use-radio-group.js';
|
|
11
|
+
export { useSynchronizedAnimation } from './utilities/hooks/use-synchronized-animation/use-synchronized-animation.js';
|
|
2
12
|
export { Alert } from './components/alert/alert.js';
|
|
3
13
|
export { Avatar } from './components/avatar/avatar.js';
|
|
4
14
|
export { Badge } from './components/badge/index.js';
|
|
@@ -95,14 +105,3 @@ export { ToggleGroup } from './components/toggle-group/index.js';
|
|
|
95
105
|
export { ToggleGroupItem } from './components/toggle-group/toggle-group-item.js';
|
|
96
106
|
export { Tooltip } from './components/tooltip/tooltip.js';
|
|
97
107
|
export { ValidationMessage } from './components/validation-message/validation-message.js';
|
|
98
|
-
export { useCheckboxGroup } from './utilities/hooks/use-checkbox-group/use-checkbox-group.js';
|
|
99
|
-
export { useDebounceCallback } from './utilities/hooks/use-debounce-callback/use-debounce-callback.js';
|
|
100
|
-
export { useIsomorphicLayoutEffect } from './utilities/hooks/use-isomorphic-layout-effect/use-isomorphic-layout-effect.js';
|
|
101
|
-
export { useMediaQuery } from './utilities/hooks/use-media-query/use-media-query.js';
|
|
102
|
-
export { usePagination } from './utilities/hooks/use-pagination/use-pagination.js';
|
|
103
|
-
export { useRadioGroup } from './utilities/hooks/use-radio-group/use-radio-group.js';
|
|
104
|
-
export { useSynchronizedAnimation } from './utilities/hooks/use-synchronized-animation/use-synchronized-animation.js';
|
|
105
|
-
export { omit } from './utilities/omit/omit.js';
|
|
106
|
-
export { RovingFocusItem, getNextFocusableValue, getPrevFocusableValue } from './utilities/roving-focus/roving-focus-item.js';
|
|
107
|
-
export { RovingFocusRoot } from './utilities/roving-focus/roving-focus-root.js';
|
|
108
|
-
export { useRovingFocus } from './utilities/roving-focus/use-roving-focus.js';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useRef } from 'react';
|
|
3
|
-
import { useIsomorphicLayoutEffect } from '../use-isomorphic-layout-effect/use-isomorphic-layout-effect.js';
|
|
2
|
+
import { useRef, useLayoutEffect, useEffect } from 'react';
|
|
4
3
|
|
|
5
4
|
// Inspired by Sam Selikoff
|
|
6
5
|
// https://github.com/samselikoff/2022-02-24-use-synchronized-animation/blob/main/src/App.js
|
|
6
|
+
// https://usehooks-ts.com/react-hook/use-isomorphic-layout-effect
|
|
7
|
+
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
|
|
7
8
|
/**
|
|
8
9
|
* Synchronizes the css animation of multiple elements with the same `animationName`.
|
|
9
10
|
*
|
|
@@ -43,4 +44,4 @@ function useSynchronizedAnimation(animationName) {
|
|
|
43
44
|
return ref;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
export { useSynchronizedAnimation };
|
|
47
|
+
export { useIsomorphicLayoutEffect, useSynchronizedAnimation };
|
package/dist/react-types.d.ts
CHANGED
package/dist/types/colors.d.ts
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
type EmptyObject = {
|
|
3
|
-
[emptyObjectSymbol]?: never;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Base interface for available colors in Designsystemet.
|
|
7
|
-
* The CLI will generate augmentations of this interface to allow
|
|
8
|
-
* type safety of custom color names.
|
|
9
|
-
*/
|
|
10
|
-
export interface MainAndSupportColors {
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* If {@link MainAndSupportColors} has been extended to include color names, return T,
|
|
14
|
-
* otherwise return the arbitrary string type.
|
|
15
|
-
*/
|
|
16
|
-
type ColorWithFallback<T> = MainAndSupportColors extends EmptyObject ? string : T;
|
|
17
|
-
export type SeverityInfo = 'info';
|
|
18
|
-
export type SeveritySuccess = 'success';
|
|
19
|
-
export type SeverityWarning = 'warning';
|
|
20
|
-
export type SeverityDanger = 'danger';
|
|
21
|
-
export type SeverityColors = SeverityInfo | SeveritySuccess | SeverityWarning | SeverityDanger;
|
|
22
|
-
export type Color = ColorWithFallback<'neutral' | keyof MainAndSupportColors>;
|
|
23
|
-
export {};
|
|
1
|
+
export type { Color, SeverityColors, } from '@digdir/designsystemet/types';
|
|
24
2
|
//# sourceMappingURL=colors.d.ts.map
|