@navikt/ds-react 7.8.0 → 7.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/accordion/AccordionContent.js +2 -2
- package/cjs/accordion/AccordionContent.js.map +1 -1
- package/cjs/accordion/AccordionHeader.js +2 -2
- package/cjs/accordion/AccordionHeader.js.map +1 -1
- package/cjs/button/Button.js +9 -25
- package/cjs/button/Button.js.map +1 -1
- package/cjs/date/datepicker/parts/WeekNumber.js +2 -2
- package/cjs/date/datepicker/parts/WeekNumber.js.map +1 -1
- package/cjs/date/parts/DateInput.js +1 -1
- package/cjs/date/parts/DateInput.js.map +1 -1
- package/cjs/form/combobox/Combobox.d.ts +1 -1
- package/cjs/form/combobox/Combobox.js +1 -1
- package/cjs/form/combobox/Combobox.js.map +1 -1
- package/cjs/form/combobox/ComboboxWrapper.js +0 -1
- package/cjs/form/combobox/ComboboxWrapper.js.map +1 -1
- package/cjs/form/combobox/Input/Input.js +9 -9
- package/cjs/form/combobox/Input/Input.js.map +1 -1
- package/cjs/form/combobox/Input/InputController.d.ts +1 -1
- package/cjs/form/combobox/Input/InputController.js +8 -2
- package/cjs/form/combobox/Input/InputController.js.map +1 -1
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js +5 -0
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
- package/cjs/form/confirmation-panel/ConfirmationPanel.js +1 -1
- package/cjs/form/confirmation-panel/ConfirmationPanel.js.map +1 -1
- package/cjs/form/fieldset/Fieldset.js +1 -1
- package/cjs/form/fieldset/Fieldset.js.map +1 -1
- package/cjs/form/file-upload/parts/dropzone/Dropzone.js +1 -1
- package/cjs/form/file-upload/parts/dropzone/Dropzone.js.map +1 -1
- package/cjs/form/search/Search.d.ts +1 -1
- package/cjs/form/search/Search.js +4 -4
- package/cjs/form/search/Search.js.map +1 -1
- package/cjs/form/select/Select.js +1 -1
- package/cjs/form/select/Select.js.map +1 -1
- package/cjs/form/switch/Switch.js +1 -7
- package/cjs/form/switch/Switch.js.map +1 -1
- package/cjs/form/textarea/Textarea.js +1 -1
- package/cjs/form/textarea/Textarea.js.map +1 -1
- package/cjs/form/textfield/TextField.js +1 -1
- package/cjs/form/textfield/TextField.js.map +1 -1
- package/cjs/guide-panel/GuidePanel.js +2 -2
- package/cjs/guide-panel/GuidePanel.js.map +1 -1
- package/cjs/help-text/HelpText.js +2 -2
- package/cjs/help-text/HelpText.js.map +1 -1
- package/cjs/internal-header/InternalHeader.js +3 -3
- package/cjs/internal-header/InternalHeader.js.map +1 -1
- package/cjs/layout/base/BasePrimitive.js +2 -2
- package/cjs/layout/base/BasePrimitive.js.map +1 -1
- package/cjs/layout/bleed/Bleed.js +2 -2
- package/cjs/layout/bleed/Bleed.js.map +1 -1
- package/cjs/layout/box/Box.d.ts +3 -2
- package/cjs/layout/box/Box.darkside.d.ts +10 -6
- package/cjs/layout/box/Box.darkside.js.map +1 -1
- package/cjs/layout/box/Box.js +2 -2
- package/cjs/layout/box/Box.js.map +1 -1
- package/cjs/layout/grid/HGrid.js +2 -2
- package/cjs/layout/grid/HGrid.js.map +1 -1
- package/cjs/layout/page/Page.js +2 -2
- package/cjs/layout/page/Page.js.map +1 -1
- package/cjs/layout/stack/Stack.js +2 -2
- package/cjs/layout/stack/Stack.js.map +1 -1
- package/cjs/layout/utilities/types.d.ts +7 -23
- package/cjs/overlays/action-menu/ActionMenu.js +2 -2
- package/cjs/overlays/action-menu/ActionMenu.js.map +1 -1
- package/cjs/pagination/PaginationItem.js +2 -2
- package/cjs/pagination/PaginationItem.js.map +1 -1
- package/cjs/popover/Popover.js +2 -2
- package/cjs/popover/Popover.js.map +1 -1
- package/cjs/portal/Portal.js +12 -0
- package/cjs/portal/Portal.js.map +1 -1
- package/cjs/provider/index.d.ts +0 -1
- package/cjs/provider/index.js +1 -4
- package/cjs/provider/index.js.map +1 -1
- package/cjs/read-more/ReadMore.js +1 -3
- package/cjs/read-more/ReadMore.js.map +1 -1
- package/cjs/tabs/Tabs.context.d.ts +1 -1
- package/cjs/tabs/parts/tablist/useScrollButtons.d.ts +1 -1
- package/cjs/tag/Tag.d.ts +1 -1
- package/cjs/tag/Tag.js +4 -1
- package/cjs/tag/Tag.js.map +1 -1
- package/cjs/theme/Theme.d.ts +16 -0
- package/cjs/{provider/theme/AkselTheme.js → theme/Theme.js} +17 -18
- package/cjs/theme/Theme.js.map +1 -0
- package/cjs/theme/index.d.ts +1 -0
- package/cjs/theme/index.js +7 -0
- package/cjs/theme/index.js.map +1 -0
- package/cjs/timeline/Pin.js +5 -2
- package/cjs/timeline/Pin.js.map +1 -1
- package/cjs/timeline/hooks/useTimelineRows.d.ts +5 -1
- package/cjs/timeline/hooks/useTimelineRows.js +14 -3
- package/cjs/timeline/hooks/useTimelineRows.js.map +1 -1
- package/cjs/timeline/period/ClickablePeriod.js +5 -2
- package/cjs/timeline/period/ClickablePeriod.js.map +1 -1
- package/cjs/toggle-group/parts/ToggleItem.js +1 -1
- package/cjs/toggle-group/parts/ToggleItem.js.map +1 -1
- package/cjs/tooltip/Tooltip.js +6 -3
- package/cjs/tooltip/Tooltip.js.map +1 -1
- package/cjs/typography/ErrorMessage.d.ts +4 -0
- package/cjs/typography/ErrorMessage.js +6 -2
- package/cjs/typography/ErrorMessage.js.map +1 -1
- package/cjs/util/TextareaAutoSize.js +1 -1
- package/cjs/util/TextareaAutoSize.js.map +1 -1
- package/cjs/util/debounce.d.ts +2 -2
- package/cjs/util/debounce.js +5 -1
- package/cjs/util/debounce.js.map +1 -1
- package/esm/accordion/AccordionContent.js +2 -2
- package/esm/accordion/AccordionContent.js.map +1 -1
- package/esm/accordion/AccordionHeader.js +2 -2
- package/esm/accordion/AccordionHeader.js.map +1 -1
- package/esm/button/Button.js +10 -26
- package/esm/button/Button.js.map +1 -1
- package/esm/date/datepicker/parts/WeekNumber.js +2 -2
- package/esm/date/datepicker/parts/WeekNumber.js.map +1 -1
- package/esm/date/parts/DateInput.js +1 -1
- package/esm/date/parts/DateInput.js.map +1 -1
- package/esm/form/combobox/Combobox.d.ts +1 -1
- package/esm/form/combobox/Combobox.js +1 -1
- package/esm/form/combobox/Combobox.js.map +1 -1
- package/esm/form/combobox/ComboboxWrapper.js +0 -1
- package/esm/form/combobox/ComboboxWrapper.js.map +1 -1
- package/esm/form/combobox/Input/Input.js +9 -9
- package/esm/form/combobox/Input/Input.js.map +1 -1
- package/esm/form/combobox/Input/InputController.d.ts +1 -1
- package/esm/form/combobox/Input/InputController.js +8 -2
- package/esm/form/combobox/Input/InputController.js.map +1 -1
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js +5 -0
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
- package/esm/form/confirmation-panel/ConfirmationPanel.js +1 -1
- package/esm/form/confirmation-panel/ConfirmationPanel.js.map +1 -1
- package/esm/form/fieldset/Fieldset.js +1 -1
- package/esm/form/fieldset/Fieldset.js.map +1 -1
- package/esm/form/file-upload/parts/dropzone/Dropzone.js +1 -1
- package/esm/form/file-upload/parts/dropzone/Dropzone.js.map +1 -1
- package/esm/form/search/Search.d.ts +1 -1
- package/esm/form/search/Search.js +4 -4
- package/esm/form/search/Search.js.map +1 -1
- package/esm/form/select/Select.js +1 -1
- package/esm/form/select/Select.js.map +1 -1
- package/esm/form/switch/Switch.js +1 -7
- package/esm/form/switch/Switch.js.map +1 -1
- package/esm/form/textarea/Textarea.js +1 -1
- package/esm/form/textarea/Textarea.js.map +1 -1
- package/esm/form/textfield/TextField.js +1 -1
- package/esm/form/textfield/TextField.js.map +1 -1
- package/esm/guide-panel/GuidePanel.js +2 -2
- package/esm/guide-panel/GuidePanel.js.map +1 -1
- package/esm/help-text/HelpText.js +2 -2
- package/esm/help-text/HelpText.js.map +1 -1
- package/esm/internal-header/InternalHeader.js +3 -3
- package/esm/internal-header/InternalHeader.js.map +1 -1
- package/esm/layout/base/BasePrimitive.js +2 -2
- package/esm/layout/base/BasePrimitive.js.map +1 -1
- package/esm/layout/bleed/Bleed.js +2 -2
- package/esm/layout/bleed/Bleed.js.map +1 -1
- package/esm/layout/box/Box.d.ts +3 -2
- package/esm/layout/box/Box.darkside.d.ts +10 -6
- package/esm/layout/box/Box.darkside.js.map +1 -1
- package/esm/layout/box/Box.js +2 -2
- package/esm/layout/box/Box.js.map +1 -1
- package/esm/layout/grid/HGrid.js +2 -2
- package/esm/layout/grid/HGrid.js.map +1 -1
- package/esm/layout/page/Page.js +2 -2
- package/esm/layout/page/Page.js.map +1 -1
- package/esm/layout/stack/Stack.js +2 -2
- package/esm/layout/stack/Stack.js.map +1 -1
- package/esm/layout/utilities/types.d.ts +7 -23
- package/esm/overlays/action-menu/ActionMenu.js +2 -2
- package/esm/overlays/action-menu/ActionMenu.js.map +1 -1
- package/esm/pagination/PaginationItem.js +2 -2
- package/esm/pagination/PaginationItem.js.map +1 -1
- package/esm/popover/Popover.js +2 -2
- package/esm/popover/Popover.js.map +1 -1
- package/esm/portal/Portal.js +12 -0
- package/esm/portal/Portal.js.map +1 -1
- package/esm/provider/index.d.ts +0 -1
- package/esm/provider/index.js +0 -1
- package/esm/provider/index.js.map +1 -1
- package/esm/read-more/ReadMore.js +1 -3
- package/esm/read-more/ReadMore.js.map +1 -1
- package/esm/tabs/Tabs.context.d.ts +1 -1
- package/esm/tabs/parts/tablist/useScrollButtons.d.ts +1 -1
- package/esm/tag/Tag.d.ts +1 -1
- package/esm/tag/Tag.js +4 -1
- package/esm/tag/Tag.js.map +1 -1
- package/esm/theme/Theme.d.ts +16 -0
- package/esm/theme/Theme.js +21 -0
- package/esm/theme/Theme.js.map +1 -0
- package/esm/theme/index.d.ts +1 -0
- package/esm/theme/index.js +3 -0
- package/esm/theme/index.js.map +1 -0
- package/esm/timeline/Pin.js +5 -2
- package/esm/timeline/Pin.js.map +1 -1
- package/esm/timeline/hooks/useTimelineRows.d.ts +5 -1
- package/esm/timeline/hooks/useTimelineRows.js +14 -3
- package/esm/timeline/hooks/useTimelineRows.js.map +1 -1
- package/esm/timeline/period/ClickablePeriod.js +5 -2
- package/esm/timeline/period/ClickablePeriod.js.map +1 -1
- package/esm/toggle-group/parts/ToggleItem.js +1 -1
- package/esm/toggle-group/parts/ToggleItem.js.map +1 -1
- package/esm/tooltip/Tooltip.js +6 -3
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/esm/typography/ErrorMessage.d.ts +4 -0
- package/esm/typography/ErrorMessage.js +6 -2
- package/esm/typography/ErrorMessage.js.map +1 -1
- package/esm/util/TextareaAutoSize.js +1 -1
- package/esm/util/TextareaAutoSize.js.map +1 -1
- package/esm/util/debounce.d.ts +2 -2
- package/esm/util/debounce.js +5 -1
- package/esm/util/debounce.js.map +1 -1
- package/package.json +4 -4
- package/src/accordion/AccordionContent.tsx +2 -2
- package/src/accordion/AccordionHeader.tsx +2 -2
- package/src/button/Button.tsx +20 -50
- package/src/date/datepicker/parts/WeekNumber.tsx +2 -2
- package/src/date/parts/DateInput.tsx +5 -1
- package/src/form/combobox/Combobox.tsx +5 -1
- package/src/form/combobox/ComboboxWrapper.tsx +0 -1
- package/src/form/combobox/Input/Input.tsx +9 -9
- package/src/form/combobox/Input/InputController.tsx +10 -2
- package/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx +4 -0
- package/src/form/confirmation-panel/ConfirmationPanel.tsx +5 -1
- package/src/form/fieldset/Fieldset.tsx +3 -1
- package/src/form/file-upload/parts/dropzone/Dropzone.tsx +1 -1
- package/src/form/search/Search.tsx +6 -4
- package/src/form/select/Select.tsx +3 -1
- package/src/form/switch/Switch.tsx +1 -10
- package/src/form/textarea/Textarea.tsx +3 -1
- package/src/form/textfield/TextField.tsx +3 -1
- package/src/guide-panel/GuidePanel.tsx +2 -2
- package/src/help-text/HelpText.tsx +2 -2
- package/src/internal-header/InternalHeader.tsx +4 -4
- package/src/layout/base/BasePrimitive.tsx +2 -2
- package/src/layout/bleed/Bleed.tsx +2 -2
- package/src/layout/box/Box.darkside.tsx +19 -14
- package/src/layout/box/Box.tsx +6 -4
- package/src/layout/grid/HGrid.tsx +2 -2
- package/src/layout/page/Page.tsx +2 -2
- package/src/layout/stack/Stack.tsx +2 -2
- package/src/layout/utilities/types.ts +20 -42
- package/src/overlays/action-menu/ActionMenu.tsx +2 -2
- package/src/pagination/PaginationItem.tsx +2 -2
- package/src/popover/Popover.tsx +2 -2
- package/src/portal/Portal.tsx +17 -0
- package/src/provider/index.ts +0 -4
- package/src/read-more/ReadMore.tsx +1 -4
- package/src/tag/Tag.tsx +32 -18
- package/src/theme/Theme.tsx +60 -0
- package/src/theme/index.ts +2 -0
- package/src/timeline/Pin.tsx +16 -10
- package/src/timeline/hooks/useTimelineRows.ts +25 -9
- package/src/timeline/period/ClickablePeriod.tsx +16 -10
- package/src/timeline/tests/useTimelineRows.test.ts +131 -0
- package/src/toggle-group/parts/ToggleItem.tsx +1 -0
- package/src/tooltip/Tooltip.tsx +7 -2
- package/src/typography/ErrorMessage.tsx +36 -2
- package/src/util/TextareaAutoSize.tsx +15 -11
- package/src/util/debounce.ts +11 -3
- package/cjs/provider/theme/AkselTheme.d.ts +0 -22
- package/cjs/provider/theme/AkselTheme.js.map +0 -1
- package/esm/provider/theme/AkselTheme.d.ts +0 -22
- package/esm/provider/theme/AkselTheme.js +0 -22
- package/esm/provider/theme/AkselTheme.js.map +0 -1
- package/src/provider/theme/AkselTheme.tsx +0 -70
|
@@ -193,7 +193,9 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
193
193
|
aria-live="polite"
|
|
194
194
|
>
|
|
195
195
|
{showErrorMsg && (
|
|
196
|
-
<ErrorMessage size={size}>
|
|
196
|
+
<ErrorMessage size={size} showIcon>
|
|
197
|
+
{props.error}
|
|
198
|
+
</ErrorMessage>
|
|
197
199
|
)}
|
|
198
200
|
</div>
|
|
199
201
|
</div>
|
|
@@ -127,7 +127,9 @@ export const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
|
127
127
|
aria-live="polite"
|
|
128
128
|
>
|
|
129
129
|
{showErrorMsg && (
|
|
130
|
-
<ErrorMessage size={size}>
|
|
130
|
+
<ErrorMessage size={size} showIcon>
|
|
131
|
+
{props.error}
|
|
132
|
+
</ErrorMessage>
|
|
131
133
|
)}
|
|
132
134
|
</div>
|
|
133
135
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { HTMLAttributes, forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useThemeInternal } from "../theme/Theme";
|
|
4
4
|
import { DefaultIllustration } from "./Illustration";
|
|
5
5
|
import { DarksideGudiepanelIllustration } from "./Illustration.darkside";
|
|
6
6
|
|
|
@@ -37,7 +37,7 @@ export interface GuidePanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
37
37
|
*/
|
|
38
38
|
export const GuidePanel = forwardRef<HTMLDivElement, GuidePanelProps>(
|
|
39
39
|
({ children, className, illustration, poster, ...rest }, ref) => {
|
|
40
|
-
const themeContext =
|
|
40
|
+
const themeContext = useThemeInternal(false);
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
43
|
<div
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef, useRef, useState } from "react";
|
|
3
3
|
import { Popover, PopoverProps } from "../popover";
|
|
4
|
-
import {
|
|
4
|
+
import { useThemeInternal } from "../theme/Theme";
|
|
5
5
|
import { composeEventHandlers } from "../util/composeEventHandlers";
|
|
6
6
|
import { useMergeRefs } from "../util/hooks/useMergeRefs";
|
|
7
7
|
import { useI18n } from "../util/i18n/i18n.context";
|
|
@@ -52,7 +52,7 @@ export const HelpText = forwardRef<HTMLButtonElement, HelpTextProps>(
|
|
|
52
52
|
const buttonRef = useRef<HTMLButtonElement | null>(null);
|
|
53
53
|
const mergedRef = useMergeRefs(buttonRef, ref);
|
|
54
54
|
const [open, setOpen] = useState(false);
|
|
55
|
-
const themeContext =
|
|
55
|
+
const themeContext = useThemeInternal(false);
|
|
56
56
|
const translate = useI18n("HelpText");
|
|
57
57
|
|
|
58
58
|
const titleWithFallback = title || translate("title");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { HTMLAttributes, forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Theme, useThemeInternal } from "../theme/Theme";
|
|
4
4
|
import { OverridableComponent } from "../util/types";
|
|
5
5
|
import InternalHeaderButton, {
|
|
6
6
|
InternalHeaderButtonProps,
|
|
@@ -78,20 +78,20 @@ interface InternalHeaderComponent
|
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
80
|
export const InternalHeader = forwardRef(({ className, ...rest }, ref) => {
|
|
81
|
-
const themeContext =
|
|
81
|
+
const themeContext = useThemeInternal(false);
|
|
82
82
|
|
|
83
83
|
/*
|
|
84
84
|
* Component is always in "dark" mode, so we manually override global theme.
|
|
85
85
|
*/
|
|
86
86
|
if (themeContext) {
|
|
87
87
|
return (
|
|
88
|
-
<
|
|
88
|
+
<Theme theme="dark" asChild>
|
|
89
89
|
<header
|
|
90
90
|
{...rest}
|
|
91
91
|
ref={ref}
|
|
92
92
|
className={cl("navds-internalheader", className)}
|
|
93
93
|
/>
|
|
94
|
-
</
|
|
94
|
+
</Theme>
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { UNSAFE_useAkselTheme } from "../../provider";
|
|
4
3
|
import { Slot } from "../../slot/Slot";
|
|
4
|
+
import { useThemeInternal } from "../../theme/Theme";
|
|
5
5
|
import { getResponsiveProps, getResponsiveValue } from "../utilities/css";
|
|
6
6
|
import { ResponsiveProp, SpacingScale } from "../utilities/types";
|
|
7
7
|
|
|
@@ -252,7 +252,7 @@ export const BasePrimitive = ({
|
|
|
252
252
|
flexShrink,
|
|
253
253
|
gridColumn,
|
|
254
254
|
}: BasePrimitiveProps) => {
|
|
255
|
-
const themeContext =
|
|
255
|
+
const themeContext = useThemeInternal(false);
|
|
256
256
|
const prefix = themeContext ? "ax" : "a";
|
|
257
257
|
|
|
258
258
|
const style: React.CSSProperties = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
|
-
import { UNSAFE_useAkselTheme } from "../../provider";
|
|
4
3
|
import { Slot } from "../../slot/Slot";
|
|
4
|
+
import { useThemeInternal } from "../../theme/Theme";
|
|
5
5
|
import { getResponsiveProps } from "../utilities/css";
|
|
6
6
|
import { ResponsiveProp, SpacingScale } from "../utilities/types";
|
|
7
7
|
|
|
@@ -81,7 +81,7 @@ export const Bleed = forwardRef<HTMLDivElement, BleedProps>(
|
|
|
81
81
|
},
|
|
82
82
|
ref,
|
|
83
83
|
) => {
|
|
84
|
-
const themeContext =
|
|
84
|
+
const themeContext = useThemeInternal(false);
|
|
85
85
|
const prefix = themeContext ? "ax" : "a";
|
|
86
86
|
|
|
87
87
|
let style: React.CSSProperties = {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import type {
|
|
4
|
+
BorderColorKeys,
|
|
5
|
+
BorderColorWithRoleKeys,
|
|
6
|
+
BorderRadiusKeys,
|
|
7
|
+
DefaultBgKeys,
|
|
8
|
+
ShadowKeys,
|
|
9
|
+
StaticBgKeys,
|
|
10
|
+
} from "@navikt/ds-tokens/types";
|
|
4
11
|
import { Slot } from "../../slot/Slot";
|
|
5
12
|
import { omit } from "../../util";
|
|
6
13
|
import { OverridableComponent } from "../../util/types";
|
|
@@ -10,27 +17,21 @@ import BasePrimitive, {
|
|
|
10
17
|
} from "../base/BasePrimitive";
|
|
11
18
|
import { PrimitiveAsChildProps } from "../base/PrimitiveAsChildProps";
|
|
12
19
|
import { getResponsiveProps } from "../utilities/css";
|
|
13
|
-
import {
|
|
14
|
-
BorderRadiiToken,
|
|
15
|
-
ResponsiveProp,
|
|
16
|
-
SemanticRoleBgDarkside,
|
|
17
|
-
SemanticShadowTokens,
|
|
18
|
-
SemanticStaticBgDarkside,
|
|
19
|
-
SemanticStaticBorderDarkside,
|
|
20
|
-
SpaceDelimitedAttribute,
|
|
21
|
-
} from "../utilities/types";
|
|
20
|
+
import { ResponsiveProp, SpaceDelimitedAttribute } from "../utilities/types";
|
|
22
21
|
|
|
23
22
|
export type BoxNewProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
24
23
|
/**
|
|
25
24
|
* CSS `background-color` property.
|
|
26
25
|
* Accepts a [background/surface color token](https://aksel.nav.no/grunnleggende/styling/design-tokens#afff774dad80).
|
|
26
|
+
* @see {@link DefaultBgKeys} and {@link StaticBgKeys}
|
|
27
27
|
*/
|
|
28
|
-
background?:
|
|
28
|
+
background?: DefaultBgKeys | StaticBgKeys;
|
|
29
29
|
/**
|
|
30
30
|
* CSS `border-color` property.
|
|
31
31
|
* Accepts a [border color token](https://aksel.nav.no/grunnleggende/styling/design-tokens#adb1767e2f87).
|
|
32
|
+
* @see {@link BorderColorKeys} and {@link BorderColorWithRoleKeys}
|
|
32
33
|
*/
|
|
33
|
-
borderColor?:
|
|
34
|
+
borderColor?: Exclude<BorderColorKeys, "focus"> | BorderColorWithRoleKeys;
|
|
34
35
|
/**
|
|
35
36
|
* CSS `border-radius` property.
|
|
36
37
|
* Accepts a [radius token](https://aksel.nav.no/grunnleggende/styling/design-tokens#6d79c5605d31)
|
|
@@ -39,8 +40,11 @@ export type BoxNewProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
39
40
|
* borderRadius='full'
|
|
40
41
|
* borderRadius='0 full large small'
|
|
41
42
|
* borderRadius={{xs: 'small large', sm: '0', md: 'large', lg: 'full'}}
|
|
43
|
+
* @see {@link BorderRadiusKeys}
|
|
42
44
|
*/
|
|
43
|
-
borderRadius?: ResponsiveProp<
|
|
45
|
+
borderRadius?: ResponsiveProp<
|
|
46
|
+
SpaceDelimitedAttribute<BorderRadiusKeys | "0">
|
|
47
|
+
>;
|
|
44
48
|
/**
|
|
45
49
|
* CSS `border-width` property. If this is not set there will be no border.
|
|
46
50
|
* @example
|
|
@@ -51,8 +55,9 @@ export type BoxNewProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
51
55
|
/** Shadow on box. Accepts a shadow token.
|
|
52
56
|
* @example
|
|
53
57
|
* shadow='small'
|
|
58
|
+
* @see {@link ShadowKeys}
|
|
54
59
|
*/
|
|
55
|
-
shadow?:
|
|
60
|
+
shadow?: ShadowKeys;
|
|
56
61
|
} & PrimitiveProps &
|
|
57
62
|
PrimitiveAsChildProps;
|
|
58
63
|
|
package/src/layout/box/Box.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { type BorderRadiusKeys } from "@navikt/ds-tokens/types";
|
|
4
4
|
import { Slot } from "../../slot/Slot";
|
|
5
|
+
import { useThemeInternal } from "../../theme/Theme";
|
|
5
6
|
import { omit } from "../../util";
|
|
6
7
|
import { OverridableComponent } from "../../util/types";
|
|
7
8
|
import BasePrimitive, {
|
|
@@ -13,7 +14,6 @@ import { getResponsiveProps } from "../utilities/css";
|
|
|
13
14
|
import {
|
|
14
15
|
BackgroundColorToken,
|
|
15
16
|
BorderColorToken,
|
|
16
|
-
BorderRadiiToken,
|
|
17
17
|
ResponsiveProp,
|
|
18
18
|
ShadowToken,
|
|
19
19
|
SpaceDelimitedAttribute,
|
|
@@ -41,7 +41,9 @@ export type BoxProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
41
41
|
* borderRadius='0 full large small'
|
|
42
42
|
* borderRadius={{xs: 'small large', sm: '0', md: 'large', lg: 'full'}}
|
|
43
43
|
*/
|
|
44
|
-
borderRadius?: ResponsiveProp<
|
|
44
|
+
borderRadius?: ResponsiveProp<
|
|
45
|
+
SpaceDelimitedAttribute<BorderRadiusKeys | "0">
|
|
46
|
+
>;
|
|
45
47
|
/**
|
|
46
48
|
* CSS `border-width` property. If this is not set there will be no border.
|
|
47
49
|
* @example
|
|
@@ -107,7 +109,7 @@ export const BoxComponent: OverridableComponent<BoxProps, HTMLDivElement> =
|
|
|
107
109
|
},
|
|
108
110
|
ref,
|
|
109
111
|
) => {
|
|
110
|
-
const themeContext =
|
|
112
|
+
const themeContext = useThemeInternal(false);
|
|
111
113
|
|
|
112
114
|
if (
|
|
113
115
|
process.env.NODE_ENV !== "production" &&
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
|
-
import { UNSAFE_useAkselTheme } from "../../provider";
|
|
4
3
|
import { Slot } from "../../slot/Slot";
|
|
4
|
+
import { useThemeInternal } from "../../theme/Theme";
|
|
5
5
|
import { OverridableComponent, omit } from "../../util";
|
|
6
6
|
import BasePrimitive, {
|
|
7
7
|
PRIMITIVE_PROPS,
|
|
@@ -78,7 +78,7 @@ export const HGrid: OverridableComponent<HGridProps, HTMLDivElement> =
|
|
|
78
78
|
},
|
|
79
79
|
ref,
|
|
80
80
|
) => {
|
|
81
|
-
const themeContext =
|
|
81
|
+
const themeContext = useThemeInternal(false);
|
|
82
82
|
const prefix = themeContext ? "ax" : "a";
|
|
83
83
|
|
|
84
84
|
const styles: React.CSSProperties = {
|
package/src/layout/page/Page.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useThemeInternal } from "../../theme/Theme";
|
|
4
4
|
import { OverridableComponent } from "../../util";
|
|
5
5
|
import { BackgroundColorToken } from "../utilities/types";
|
|
6
6
|
import { PageBlock } from "./parts/PageBlock";
|
|
@@ -54,7 +54,7 @@ export const PageComponent: OverridableComponent<PageProps, HTMLElement> =
|
|
|
54
54
|
},
|
|
55
55
|
ref,
|
|
56
56
|
) => {
|
|
57
|
-
const themeContext =
|
|
57
|
+
const themeContext = useThemeInternal(false);
|
|
58
58
|
|
|
59
59
|
if (process.env.NODE_ENV !== "production" && themeContext && background) {
|
|
60
60
|
console.warn(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { HTMLAttributes, forwardRef } from "react";
|
|
3
|
-
import { UNSAFE_useAkselTheme } from "../../provider";
|
|
4
3
|
import { Slot } from "../../slot/Slot";
|
|
4
|
+
import { useThemeInternal } from "../../theme/Theme";
|
|
5
5
|
import { omit } from "../../util";
|
|
6
6
|
import { OverridableComponent } from "../../util/types";
|
|
7
7
|
import BasePrimitive, {
|
|
@@ -84,7 +84,7 @@ export const Stack: OverridableComponent<StackProps, HTMLDivElement> =
|
|
|
84
84
|
},
|
|
85
85
|
ref,
|
|
86
86
|
) => {
|
|
87
|
-
const themeContext =
|
|
87
|
+
const themeContext = useThemeInternal(false);
|
|
88
88
|
const prefix = themeContext ? "ax" : "a";
|
|
89
89
|
|
|
90
90
|
const style: React.CSSProperties = {
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export type
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export type
|
|
21
|
-
|
|
22
|
-
export type BreakpointsAlias = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
23
|
-
|
|
24
|
-
export type SpacingScale = keyof (typeof Spacing)["a"]["spacing"];
|
|
1
|
+
import type {
|
|
2
|
+
BreakPointKeys,
|
|
3
|
+
LegacyBgColorKeys,
|
|
4
|
+
LegacyBorderColorKeys,
|
|
5
|
+
LegacyShadowKeys,
|
|
6
|
+
LegacySurfaceColorKeys,
|
|
7
|
+
SpacingKeys,
|
|
8
|
+
} from "@navikt/ds-tokens/types";
|
|
9
|
+
|
|
10
|
+
export type BackgroundColorToken = LegacyBgColorKeys;
|
|
11
|
+
export type SurfaceColorToken = LegacySurfaceColorKeys;
|
|
12
|
+
export type BorderColorToken = LegacyBorderColorKeys;
|
|
13
|
+
export type ShadowToken = LegacyShadowKeys;
|
|
14
|
+
|
|
15
|
+
export type BreakpointsAlias = Extract<
|
|
16
|
+
BreakPointKeys,
|
|
17
|
+
"xs" | "sm" | "md" | "lg" | "xl" | "2xl"
|
|
18
|
+
>;
|
|
19
|
+
|
|
20
|
+
export type SpacingScale = SpacingKeys;
|
|
25
21
|
|
|
26
22
|
export type SpaceDelimitedAttribute<T extends string> =
|
|
27
23
|
| T
|
|
@@ -33,21 +29,3 @@ type FixedResponsiveT<T> = {
|
|
|
33
29
|
};
|
|
34
30
|
|
|
35
31
|
export type ResponsiveProp<T> = T | FixedResponsiveT<T>;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Darkside tokens
|
|
39
|
-
*/
|
|
40
|
-
export type SemanticShadowTokens = keyof ReturnType<
|
|
41
|
-
typeof shadowTokenConfig
|
|
42
|
-
>["shadow"];
|
|
43
|
-
|
|
44
|
-
export type SemanticStaticBgDarkside = keyof ReturnType<
|
|
45
|
-
typeof semanticTokenConfig
|
|
46
|
-
>["bg"];
|
|
47
|
-
|
|
48
|
-
export type SemanticRoleBgDarkside =
|
|
49
|
-
keyof SemanticTokensForAllRolesConfigT<"color">["bg"];
|
|
50
|
-
|
|
51
|
-
export type SemanticStaticBorderDarkside = keyof ReturnType<
|
|
52
|
-
typeof semanticTokenConfig
|
|
53
|
-
>["border"];
|
|
@@ -2,8 +2,8 @@ import cl from "clsx";
|
|
|
2
2
|
import React, { forwardRef, useRef } from "react";
|
|
3
3
|
import { ChevronRightIcon } from "@navikt/aksel-icons";
|
|
4
4
|
import { useModalContext } from "../../modal/Modal.context";
|
|
5
|
-
import { UNSAFE_useAkselTheme } from "../../provider";
|
|
6
5
|
import { Slot } from "../../slot/Slot";
|
|
6
|
+
import { useThemeInternal } from "../../theme/Theme";
|
|
7
7
|
import { OverridableComponent, useId } from "../../util";
|
|
8
8
|
import { composeEventHandlers } from "../../util/composeEventHandlers";
|
|
9
9
|
import { createContext } from "../../util/create-context";
|
|
@@ -736,7 +736,7 @@ export const ActionMenuRadioItem = forwardRef<
|
|
|
736
736
|
{ children, className, onSelect, ...rest }: ActionMenuRadioItemProps,
|
|
737
737
|
ref,
|
|
738
738
|
) => {
|
|
739
|
-
const themeContext =
|
|
739
|
+
const themeContext = useThemeInternal(false);
|
|
740
740
|
|
|
741
741
|
return (
|
|
742
742
|
<Menu.RadioItem
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
3
|
import { Button, ButtonProps } from "../button";
|
|
4
|
-
import {
|
|
4
|
+
import { useThemeInternal } from "../theme/Theme";
|
|
5
5
|
import { OverridableComponent } from "../util/types";
|
|
6
6
|
|
|
7
7
|
export interface PaginationItemProps extends ButtonProps {
|
|
@@ -40,7 +40,7 @@ export const Item: PaginationItemType = forwardRef(
|
|
|
40
40
|
},
|
|
41
41
|
ref,
|
|
42
42
|
) => {
|
|
43
|
-
const themeContext =
|
|
43
|
+
const themeContext = useThemeInternal(false);
|
|
44
44
|
|
|
45
45
|
return (
|
|
46
46
|
<Button
|
package/src/popover/Popover.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import React, { HTMLAttributes, forwardRef, useContext, useRef } from "react";
|
|
|
11
11
|
import { DateInputContext } from "../date/context";
|
|
12
12
|
import { useModalContext } from "../modal/Modal.context";
|
|
13
13
|
import { DismissableLayer } from "../overlays/dismissablelayer/DismissableLayer";
|
|
14
|
-
import {
|
|
14
|
+
import { useThemeInternal } from "../theme/Theme";
|
|
15
15
|
import { useClientLayoutEffect } from "../util/hooks";
|
|
16
16
|
import { useMergeRefs } from "../util/hooks/useMergeRefs";
|
|
17
17
|
import PopoverContent, { PopoverContentType } from "./PopoverContent";
|
|
@@ -125,7 +125,7 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
|
|
|
125
125
|
const chosenStrategy = userStrategy ?? (isInModal ? "fixed" : "absolute");
|
|
126
126
|
const chosenFlip = isInDatepicker ? false : _flip;
|
|
127
127
|
|
|
128
|
-
const themeContext =
|
|
128
|
+
const themeContext = useThemeInternal(false);
|
|
129
129
|
|
|
130
130
|
const {
|
|
131
131
|
update,
|
package/src/portal/Portal.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import React, { HTMLAttributes, forwardRef } from "react";
|
|
|
2
2
|
import ReactDOM from "react-dom";
|
|
3
3
|
import { useProvider } from "../provider/Provider";
|
|
4
4
|
import { Slot } from "../slot/Slot";
|
|
5
|
+
import { Theme, useThemeInternal } from "../theme/Theme";
|
|
5
6
|
import { AsChildProps } from "../util/types";
|
|
6
7
|
|
|
7
8
|
interface PortalBaseProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -15,11 +16,27 @@ export type PortalProps = PortalBaseProps & AsChildProps;
|
|
|
15
16
|
|
|
16
17
|
export const Portal = forwardRef<HTMLDivElement, PortalProps>(
|
|
17
18
|
({ rootElement, asChild, ...rest }, ref) => {
|
|
19
|
+
const themeContext = useThemeInternal(false);
|
|
18
20
|
const contextRoot = useProvider()?.rootElement;
|
|
19
21
|
const root = rootElement ?? contextRoot ?? globalThis?.document?.body;
|
|
20
22
|
|
|
21
23
|
const Component = asChild ? Slot : "div";
|
|
22
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Portal can be mounted outside of theme-classNames.
|
|
27
|
+
* If a theme is present, we want to make sure that theme cascades to portaled element.
|
|
28
|
+
*/
|
|
29
|
+
if (themeContext) {
|
|
30
|
+
return root
|
|
31
|
+
? ReactDOM.createPortal(
|
|
32
|
+
<Theme theme={themeContext.theme} asChild hasBackground={false}>
|
|
33
|
+
<Component ref={ref} data-aksel-portal="" {...rest} />
|
|
34
|
+
</Theme>,
|
|
35
|
+
root,
|
|
36
|
+
)
|
|
37
|
+
: null;
|
|
38
|
+
}
|
|
39
|
+
|
|
23
40
|
return root
|
|
24
41
|
? ReactDOM.createPortal(
|
|
25
42
|
<Component ref={ref} data-aksel-portal="" {...rest} />,
|
package/src/provider/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
3
|
import { ChevronDownIcon } from "@navikt/aksel-icons";
|
|
4
|
-
import { UNSAFE_useAkselTheme } from "../provider";
|
|
5
4
|
import { BodyLong } from "../typography";
|
|
6
5
|
import { composeEventHandlers } from "../util/composeEventHandlers";
|
|
7
6
|
import { useControllableState } from "../util/hooks/useControllableState";
|
|
@@ -75,8 +74,6 @@ export const ReadMore = forwardRef<HTMLButtonElement, ReadMoreProps>(
|
|
|
75
74
|
onChange: onOpenChange,
|
|
76
75
|
});
|
|
77
76
|
|
|
78
|
-
const themeContext = UNSAFE_useAkselTheme(false);
|
|
79
|
-
|
|
80
77
|
const typoSize = size === "small" ? "small" : "medium";
|
|
81
78
|
|
|
82
79
|
return (
|
|
@@ -87,7 +84,7 @@ export const ReadMore = forwardRef<HTMLButtonElement, ReadMoreProps>(
|
|
|
87
84
|
className,
|
|
88
85
|
{ "navds-read-more--open": _open },
|
|
89
86
|
)}
|
|
90
|
-
data-volume=
|
|
87
|
+
data-volume="low"
|
|
91
88
|
>
|
|
92
89
|
<button
|
|
93
90
|
{...rest}
|
package/src/tag/Tag.tsx
CHANGED
|
@@ -31,7 +31,13 @@ export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
31
31
|
| "alt2-moderate"
|
|
32
32
|
| "alt3"
|
|
33
33
|
| "alt3-filled"
|
|
34
|
-
| "alt3-moderate"
|
|
34
|
+
| "alt3-moderate"
|
|
35
|
+
| "meta-purple"
|
|
36
|
+
| "meta-purple-filled"
|
|
37
|
+
| "meta-purple-moderate"
|
|
38
|
+
| "meta-lime"
|
|
39
|
+
| "meta-lime-filled"
|
|
40
|
+
| "meta-lime-moderate";
|
|
35
41
|
/**
|
|
36
42
|
* @default "medium"
|
|
37
43
|
*/
|
|
@@ -54,23 +60,31 @@ export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
54
60
|
* ```
|
|
55
61
|
*/
|
|
56
62
|
export const Tag = forwardRef<HTMLSpanElement, TagProps>(
|
|
57
|
-
({ children, className, variant, size = "medium", icon, ...rest }, ref) =>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
({ children, className, variant, size = "medium", icon, ...rest }, ref) => {
|
|
64
|
+
const filledVariant = variant?.endsWith("-filled") && "strong";
|
|
65
|
+
const moderateVariant = variant?.endsWith("-moderate") && "moderate";
|
|
66
|
+
const color = variant?.replace("-filled", "").replace("-moderate", "");
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<BodyShort
|
|
70
|
+
{...rest}
|
|
71
|
+
ref={ref}
|
|
72
|
+
as="span"
|
|
73
|
+
size={size === "medium" ? "medium" : "small"}
|
|
74
|
+
className={cl(
|
|
75
|
+
"navds-tag",
|
|
76
|
+
className,
|
|
77
|
+
`navds-tag--${variant}`,
|
|
78
|
+
`navds-tag--${size}`,
|
|
79
|
+
`navds-tag--${filledVariant || moderateVariant || "outline"}`,
|
|
80
|
+
`navds-tag--${color}`,
|
|
81
|
+
)}
|
|
82
|
+
>
|
|
83
|
+
{icon && <span className="navds-tag__icon--left">{icon}</span>}
|
|
84
|
+
{children}
|
|
85
|
+
</BodyShort>
|
|
86
|
+
);
|
|
87
|
+
},
|
|
74
88
|
);
|
|
75
89
|
|
|
76
90
|
export default Tag;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import cl from "clsx";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
|
+
import { Slot } from "../slot/Slot";
|
|
4
|
+
import { createContext } from "../util/create-context";
|
|
5
|
+
import { AsChildProps } from "../util/types";
|
|
6
|
+
|
|
7
|
+
type ThemeContext = {
|
|
8
|
+
/**
|
|
9
|
+
* Color theme
|
|
10
|
+
* @default "light"
|
|
11
|
+
*/
|
|
12
|
+
theme: "light" | "dark";
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const [ThemeProvider, useThemeInternal] = createContext<ThemeContext>({
|
|
16
|
+
hookName: "useTheme",
|
|
17
|
+
name: "ThemeProvider",
|
|
18
|
+
providerName: "ThemeProvider",
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
type ThemeProps = {
|
|
22
|
+
className?: string;
|
|
23
|
+
hasBackground?: boolean;
|
|
24
|
+
} & ThemeContext &
|
|
25
|
+
AsChildProps;
|
|
26
|
+
|
|
27
|
+
const Theme = forwardRef<HTMLDivElement, ThemeProps>(
|
|
28
|
+
(props: ThemeProps, ref) => {
|
|
29
|
+
const context = useThemeInternal(false);
|
|
30
|
+
|
|
31
|
+
const {
|
|
32
|
+
children,
|
|
33
|
+
className,
|
|
34
|
+
asChild = false,
|
|
35
|
+
theme = context?.theme ?? "light",
|
|
36
|
+
hasBackground: hasBackgroundProp = true,
|
|
37
|
+
} = props;
|
|
38
|
+
|
|
39
|
+
const isRoot = context === undefined;
|
|
40
|
+
|
|
41
|
+
const hasBackground =
|
|
42
|
+
hasBackgroundProp ?? (isRoot && props.theme !== undefined);
|
|
43
|
+
|
|
44
|
+
const SlotElement = asChild ? Slot : "div";
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<ThemeProvider theme={theme}>
|
|
48
|
+
<SlotElement
|
|
49
|
+
ref={ref}
|
|
50
|
+
className={cl("navds-theme", className, theme)}
|
|
51
|
+
data-background={hasBackground}
|
|
52
|
+
>
|
|
53
|
+
{children}
|
|
54
|
+
</SlotElement>
|
|
55
|
+
</ThemeProvider>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export { Theme, useThemeInternal };
|