@navikt/ds-react 7.30.0 → 7.30.1

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.
Files changed (157) hide show
  1. package/cjs/accordion/AccordionContent.js +1 -1
  2. package/cjs/accordion/AccordionContent.js.map +1 -1
  3. package/cjs/accordion/AccordionHeader.js +1 -1
  4. package/cjs/accordion/AccordionHeader.js.map +1 -1
  5. package/cjs/chips/Removable.js +1 -1
  6. package/cjs/chips/Removable.js.map +1 -1
  7. package/cjs/chips/Toggle.js +1 -1
  8. package/cjs/chips/Toggle.js.map +1 -1
  9. package/cjs/copybutton/CopyButton.js +8 -4
  10. package/cjs/copybutton/CopyButton.js.map +1 -1
  11. package/cjs/expansion-card/ExpansionCardContent.js +2 -1
  12. package/cjs/expansion-card/ExpansionCardContent.js.map +1 -1
  13. package/cjs/form/checkbox/Checkbox.js +42 -0
  14. package/cjs/form/checkbox/Checkbox.js.map +1 -1
  15. package/cjs/form/checkbox/useCheckbox.d.ts +2 -2
  16. package/cjs/form/checkbox/useCheckbox.js +5 -5
  17. package/cjs/form/checkbox/useCheckbox.js.map +1 -1
  18. package/cjs/form/radio/Radio.js +18 -0
  19. package/cjs/form/radio/Radio.js.map +1 -1
  20. package/cjs/form/radio/useRadio.d.ts +2 -2
  21. package/cjs/form/radio/useRadio.js +5 -5
  22. package/cjs/form/radio/useRadio.js.map +1 -1
  23. package/cjs/form/search/Search.js +1 -1
  24. package/cjs/form/search/Search.js.map +1 -1
  25. package/cjs/guide-panel/GuidePanel.js +3 -3
  26. package/cjs/guide-panel/GuidePanel.js.map +1 -1
  27. package/cjs/help-text/HelpText.js +1 -1
  28. package/cjs/help-text/HelpText.js.map +1 -1
  29. package/cjs/internal-header/InternalHeader.js +1 -1
  30. package/cjs/internal-header/InternalHeader.js.map +1 -1
  31. package/cjs/layout/base/BasePrimitive.js +1 -1
  32. package/cjs/layout/base/BasePrimitive.js.map +1 -1
  33. package/cjs/layout/bleed/Bleed.js +1 -1
  34. package/cjs/layout/bleed/Bleed.js.map +1 -1
  35. package/cjs/layout/box/Box.js +4 -4
  36. package/cjs/layout/box/Box.js.map +1 -1
  37. package/cjs/layout/grid/HGrid.js +1 -1
  38. package/cjs/layout/grid/HGrid.js.map +1 -1
  39. package/cjs/layout/page/Page.js +3 -1
  40. package/cjs/layout/page/Page.js.map +1 -1
  41. package/cjs/layout/stack/Stack.js +1 -1
  42. package/cjs/layout/stack/Stack.js.map +1 -1
  43. package/cjs/link/Link.js +1 -1
  44. package/cjs/link/Link.js.map +1 -1
  45. package/cjs/list/List.js +1 -1
  46. package/cjs/list/List.js.map +1 -1
  47. package/cjs/overlays/action-menu/ActionMenu.js +1 -1
  48. package/cjs/overlays/action-menu/ActionMenu.js.map +1 -1
  49. package/cjs/pagination/PaginationItem.js +1 -1
  50. package/cjs/pagination/PaginationItem.js.map +1 -1
  51. package/cjs/popover/Popover.js +2 -2
  52. package/cjs/popover/Popover.js.map +1 -1
  53. package/cjs/portal/Portal.js +1 -1
  54. package/cjs/portal/Portal.js.map +1 -1
  55. package/cjs/theme/Theme.d.ts +6 -1
  56. package/cjs/theme/Theme.js +10 -2
  57. package/cjs/theme/Theme.js.map +1 -1
  58. package/cjs/timeline/Pin.js +1 -1
  59. package/cjs/timeline/Pin.js.map +1 -1
  60. package/cjs/timeline/period/ClickablePeriod.js +1 -1
  61. package/cjs/timeline/period/ClickablePeriod.js.map +1 -1
  62. package/cjs/toggle-group/ToggleGroup.js +1 -1
  63. package/cjs/toggle-group/ToggleGroup.js.map +1 -1
  64. package/esm/accordion/AccordionContent.js +1 -1
  65. package/esm/accordion/AccordionContent.js.map +1 -1
  66. package/esm/accordion/AccordionHeader.js +1 -1
  67. package/esm/accordion/AccordionHeader.js.map +1 -1
  68. package/esm/chips/Removable.js +1 -1
  69. package/esm/chips/Removable.js.map +1 -1
  70. package/esm/chips/Toggle.js +1 -1
  71. package/esm/chips/Toggle.js.map +1 -1
  72. package/esm/copybutton/CopyButton.js +8 -4
  73. package/esm/copybutton/CopyButton.js.map +1 -1
  74. package/esm/expansion-card/ExpansionCardContent.js +3 -2
  75. package/esm/expansion-card/ExpansionCardContent.js.map +1 -1
  76. package/esm/form/checkbox/Checkbox.js +44 -2
  77. package/esm/form/checkbox/Checkbox.js.map +1 -1
  78. package/esm/form/checkbox/useCheckbox.d.ts +2 -2
  79. package/esm/form/checkbox/useCheckbox.js +5 -5
  80. package/esm/form/checkbox/useCheckbox.js.map +1 -1
  81. package/esm/form/radio/Radio.js +17 -2
  82. package/esm/form/radio/Radio.js.map +1 -1
  83. package/esm/form/radio/useRadio.d.ts +2 -2
  84. package/esm/form/radio/useRadio.js +5 -5
  85. package/esm/form/radio/useRadio.js.map +1 -1
  86. package/esm/form/search/Search.js +1 -1
  87. package/esm/form/search/Search.js.map +1 -1
  88. package/esm/guide-panel/GuidePanel.js +3 -3
  89. package/esm/guide-panel/GuidePanel.js.map +1 -1
  90. package/esm/help-text/HelpText.js +1 -1
  91. package/esm/help-text/HelpText.js.map +1 -1
  92. package/esm/internal-header/InternalHeader.js +1 -1
  93. package/esm/internal-header/InternalHeader.js.map +1 -1
  94. package/esm/layout/base/BasePrimitive.js +1 -1
  95. package/esm/layout/base/BasePrimitive.js.map +1 -1
  96. package/esm/layout/bleed/Bleed.js +1 -1
  97. package/esm/layout/bleed/Bleed.js.map +1 -1
  98. package/esm/layout/box/Box.js +4 -4
  99. package/esm/layout/box/Box.js.map +1 -1
  100. package/esm/layout/grid/HGrid.js +1 -1
  101. package/esm/layout/grid/HGrid.js.map +1 -1
  102. package/esm/layout/page/Page.js +3 -1
  103. package/esm/layout/page/Page.js.map +1 -1
  104. package/esm/layout/stack/Stack.js +1 -1
  105. package/esm/layout/stack/Stack.js.map +1 -1
  106. package/esm/link/Link.js +1 -1
  107. package/esm/link/Link.js.map +1 -1
  108. package/esm/list/List.js +1 -1
  109. package/esm/list/List.js.map +1 -1
  110. package/esm/overlays/action-menu/ActionMenu.js +1 -1
  111. package/esm/overlays/action-menu/ActionMenu.js.map +1 -1
  112. package/esm/pagination/PaginationItem.js +1 -1
  113. package/esm/pagination/PaginationItem.js.map +1 -1
  114. package/esm/popover/Popover.js +2 -2
  115. package/esm/popover/Popover.js.map +1 -1
  116. package/esm/portal/Portal.js +1 -1
  117. package/esm/portal/Portal.js.map +1 -1
  118. package/esm/theme/Theme.d.ts +6 -1
  119. package/esm/theme/Theme.js +10 -2
  120. package/esm/theme/Theme.js.map +1 -1
  121. package/esm/timeline/Pin.js +1 -1
  122. package/esm/timeline/Pin.js.map +1 -1
  123. package/esm/timeline/period/ClickablePeriod.js +1 -1
  124. package/esm/timeline/period/ClickablePeriod.js.map +1 -1
  125. package/esm/toggle-group/ToggleGroup.js +1 -1
  126. package/esm/toggle-group/ToggleGroup.js.map +1 -1
  127. package/package.json +3 -3
  128. package/src/accordion/AccordionContent.tsx +1 -1
  129. package/src/accordion/AccordionHeader.tsx +1 -1
  130. package/src/chips/Removable.tsx +1 -1
  131. package/src/chips/Toggle.tsx +1 -1
  132. package/src/copybutton/CopyButton.tsx +8 -4
  133. package/src/expansion-card/ExpansionCardContent.tsx +3 -1
  134. package/src/form/checkbox/Checkbox.tsx +91 -2
  135. package/src/form/checkbox/useCheckbox.ts +5 -5
  136. package/src/form/radio/Radio.tsx +47 -2
  137. package/src/form/radio/useRadio.ts +5 -5
  138. package/src/form/search/Search.tsx +1 -1
  139. package/src/guide-panel/GuidePanel.tsx +3 -3
  140. package/src/help-text/HelpText.tsx +2 -2
  141. package/src/internal-header/InternalHeader.tsx +1 -1
  142. package/src/layout/base/BasePrimitive.tsx +1 -1
  143. package/src/layout/bleed/Bleed.tsx +1 -1
  144. package/src/layout/box/Box.tsx +5 -4
  145. package/src/layout/grid/HGrid.tsx +1 -1
  146. package/src/layout/page/Page.tsx +5 -1
  147. package/src/layout/stack/Stack.tsx +1 -1
  148. package/src/link/Link.tsx +1 -1
  149. package/src/list/List.tsx +1 -1
  150. package/src/overlays/action-menu/ActionMenu.tsx +1 -1
  151. package/src/pagination/PaginationItem.tsx +1 -1
  152. package/src/popover/Popover.tsx +2 -2
  153. package/src/portal/Portal.tsx +1 -1
  154. package/src/theme/Theme.tsx +14 -3
  155. package/src/timeline/Pin.tsx +1 -1
  156. package/src/timeline/period/ClickablePeriod.tsx +1 -1
  157. package/src/toggle-group/ToggleGroup.tsx +1 -1
@@ -1,13 +1,58 @@
1
+ import cl from "clsx";
1
2
  import React, { forwardRef } from "react";
2
- import { useRenameCSS } from "../../theme/Theme";
3
+ import { useRenameCSS, useThemeInternal } from "../../theme/Theme";
3
4
  import { BodyShort } from "../../typography";
4
- import { omit } from "../../util";
5
+ import { omit, useId } from "../../util";
5
6
  import { RadioProps } from "./types";
6
7
  import { useRadio } from "./useRadio";
7
8
 
8
9
  export const Radio = forwardRef<HTMLInputElement, RadioProps>((props, ref) => {
9
10
  const { cn } = useRenameCSS();
10
11
  const { inputProps, size, hasError, readOnly } = useRadio(props);
12
+ const descriptionId = useId();
13
+ const themeContext = useThemeInternal(false);
14
+
15
+ if (themeContext?.isDarkside) {
16
+ return (
17
+ <div
18
+ className={cn(props.className, "navds-radio", `navds-radio--${size}`, {
19
+ "navds-radio--error": hasError,
20
+ "navds-radio--disabled": inputProps.disabled,
21
+ "navds-radio--readonly": readOnly,
22
+ })}
23
+ data-color={hasError ? "danger" : props["data-color"]}
24
+ >
25
+ <input
26
+ {...omit(props, ["children", "size", "description", "readOnly"])}
27
+ {...omit(inputProps, ["aria-invalid", "aria-describedby"])}
28
+ aria-describedby={cl(inputProps["aria-describedby"], {
29
+ [descriptionId]: props.description,
30
+ })}
31
+ className={cn("navds-radio__input")}
32
+ ref={ref}
33
+ />
34
+ <BodyShort
35
+ as="label"
36
+ htmlFor={inputProps.id}
37
+ className={cn("navds-radio__label")}
38
+ size={size}
39
+ >
40
+ {props.children}
41
+ </BodyShort>
42
+ {props.description && (
43
+ <BodyShort
44
+ id={descriptionId}
45
+ size={size}
46
+ className={cn(
47
+ "navds-form-field__subdescription navds-radio__description",
48
+ )}
49
+ >
50
+ {props.description}
51
+ </BodyShort>
52
+ )}
53
+ </div>
54
+ );
55
+ }
11
56
 
12
57
  return (
13
58
  <div
@@ -37,19 +37,19 @@ export const useRadio = (props: RadioProps) => {
37
37
  radioGroup?.value === undefined
38
38
  ? undefined
39
39
  : radioGroup?.value === props.value,
40
- onChange: (e) => {
40
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => {
41
41
  if (readOnly) {
42
42
  return;
43
43
  }
44
- props.onChange?.(e);
44
+ props.onChange?.(event);
45
45
  radioGroup?.onChange?.(props.value);
46
46
  },
47
- onClick: (e) => {
47
+ onClick: (event: React.MouseEvent<HTMLInputElement>) => {
48
48
  if (readOnly) {
49
- e.preventDefault();
49
+ event.preventDefault();
50
50
  return;
51
51
  }
52
- props?.onClick?.(e);
52
+ props?.onClick?.(event);
53
53
  },
54
54
  required: radioGroup?.required,
55
55
  type: "radio",
@@ -271,7 +271,7 @@ function ClearButton({
271
271
  const themeContext = useThemeInternal(false);
272
272
  const translate = useI18n("Search");
273
273
 
274
- return themeContext ? (
274
+ return themeContext?.isDarkside ? (
275
275
  <Button
276
276
  className={cn("navds-search__button-clear")}
277
277
  variant="tertiary"
@@ -64,14 +64,14 @@ export const GuidePanel = forwardRef<HTMLDivElement, GuidePanelProps>(
64
64
  >
65
65
  <div className={cn("navds-guide")}>
66
66
  {illustration ??
67
- (themeContext ? (
67
+ (themeContext?.isDarkside ? (
68
68
  <DarksideGudiepanelIllustration />
69
69
  ) : (
70
70
  <DefaultIllustration />
71
71
  ))}
72
72
  </div>
73
73
  <div className={cn("navds-guide-panel__content")}>
74
- {themeContext && (
74
+ {themeContext?.isDarkside && (
75
75
  <svg
76
76
  viewBox="0 0 33 22"
77
77
  width="33"
@@ -96,7 +96,7 @@ export const GuidePanel = forwardRef<HTMLDivElement, GuidePanelProps>(
96
96
  />
97
97
  </svg>
98
98
  )}
99
- {themeContext ? (
99
+ {themeContext?.isDarkside ? (
100
100
  <div className={cn("navds-guide-panel__content-inner")}>
101
101
  {children}
102
102
  </div>
@@ -81,8 +81,8 @@ export const HelpText = forwardRef<HTMLButtonElement, HelpTextProps>(
81
81
  anchorEl={buttonRef.current}
82
82
  placement={placement}
83
83
  strategy={strategy}
84
- offset={themeContext ? 8 : 12}
85
- arrow={!themeContext}
84
+ offset={themeContext?.isDarkside ? 8 : 12}
85
+ arrow={!themeContext?.isDarkside}
86
86
  >
87
87
  <Popover.Content className={cn("navds-body-short")}>
88
88
  {children}
@@ -84,7 +84,7 @@ export const InternalHeader = forwardRef(({ className, ...rest }, ref) => {
84
84
  /*
85
85
  * Component is always in "dark" mode, so we manually override global theme.
86
86
  */
87
- if (themeContext) {
87
+ if (themeContext?.isDarkside) {
88
88
  return (
89
89
  <Theme theme="dark" asChild hasBackground={false}>
90
90
  <header
@@ -253,7 +253,7 @@ export const BasePrimitive = ({
253
253
  }: BasePrimitiveProps) => {
254
254
  const themeContext = useThemeInternal(false);
255
255
  const { cn } = useRenameCSS();
256
- const prefix = themeContext ? "ax" : "a";
256
+ const prefix = themeContext?.isDarkside ? "ax" : "a";
257
257
 
258
258
  const style: React.CSSProperties = {
259
259
  /* Padding */
@@ -82,7 +82,7 @@ export const Bleed = forwardRef<HTMLDivElement, BleedProps>(
82
82
  ) => {
83
83
  const themeContext = useThemeInternal(false);
84
84
  const { cn } = useRenameCSS();
85
- const prefix = themeContext ? "ax" : "a";
85
+ const prefix = themeContext?.isDarkside ? "ax" : "a";
86
86
 
87
87
  let style: React.CSSProperties = {
88
88
  ..._style,
@@ -113,7 +113,7 @@ export const BoxComponent: OverridableComponent<BoxProps, HTMLDivElement> =
113
113
 
114
114
  if (
115
115
  process.env.NODE_ENV !== "production" &&
116
- themeContext &&
116
+ themeContext?.isDarkside &&
117
117
  (background || borderColor || shadow)
118
118
  ) {
119
119
  let errorText = ``;
@@ -131,7 +131,7 @@ export const BoxComponent: OverridableComponent<BoxProps, HTMLDivElement> =
131
131
  );
132
132
  }
133
133
 
134
- const prefix = themeContext ? "ax" : "a";
134
+ const prefix = themeContext?.isDarkside ? "ax" : "a";
135
135
 
136
136
  const style: React.CSSProperties = {
137
137
  ..._style,
@@ -173,8 +173,9 @@ export const BoxComponent: OverridableComponent<BoxProps, HTMLDivElement> =
173
173
  "navds-box-bg": background,
174
174
  "navds-box-border-color": borderColor,
175
175
  "navds-box-border-width": borderWidth,
176
- "navds-box-border-radius": borderRadius && !themeContext,
177
- "navds-box-radius": borderRadius && themeContext,
176
+ "navds-box-border-radius":
177
+ borderRadius && !themeContext?.isDarkside,
178
+ "navds-box-radius": borderRadius && themeContext?.isDarkside,
178
179
  "navds-box-shadow": shadow,
179
180
  })}
180
181
  >
@@ -78,7 +78,7 @@ export const HGrid: OverridableComponent<HGridProps, HTMLDivElement> =
78
78
  ref,
79
79
  ) => {
80
80
  const themeContext = useThemeInternal(false);
81
- const prefix = themeContext ? "ax" : "a";
81
+ const prefix = themeContext?.isDarkside ? "ax" : "a";
82
82
  const { cn } = useRenameCSS();
83
83
 
84
84
  const styles: React.CSSProperties = {
@@ -56,7 +56,11 @@ export const PageComponent: OverridableComponent<PageProps, HTMLElement> =
56
56
  const themeContext = useThemeInternal(false);
57
57
  const { cn } = useRenameCSS();
58
58
 
59
- if (process.env.NODE_ENV !== "production" && themeContext && background) {
59
+ if (
60
+ process.env.NODE_ENV !== "production" &&
61
+ themeContext?.isDarkside &&
62
+ background
63
+ ) {
60
64
  console.warn(
61
65
  `Prop \`background\` is deprecated and cannot be used with theme-support. Instead wrap component with \`<Box asChild background>\``,
62
66
  );
@@ -84,7 +84,7 @@ export const Stack: OverridableComponent<StackProps, HTMLDivElement> =
84
84
  ref,
85
85
  ) => {
86
86
  const themeContext = useThemeInternal(false);
87
- const prefix = themeContext ? "ax" : "a";
87
+ const prefix = themeContext?.isDarkside ? "ax" : "a";
88
88
  const { cn } = useRenameCSS();
89
89
 
90
90
  const style: React.CSSProperties = {
package/src/link/Link.tsx CHANGED
@@ -72,7 +72,7 @@ export const Link: OverridableComponent<LinkProps, HTMLAnchorElement> =
72
72
  */
73
73
  let localVariant: LinkProps["variant"];
74
74
 
75
- if (themeContext) {
75
+ if (themeContext?.isDarkside) {
76
76
  localVariant = variant;
77
77
  } else {
78
78
  localVariant = variant ?? "action";
package/src/list/List.tsx CHANGED
@@ -63,7 +63,7 @@ export const List = forwardRef<HTMLDivElement, ListProps>(
63
63
 
64
64
  const listSize = size ?? contextSize;
65
65
 
66
- if (themeContext) {
66
+ if (themeContext?.isDarkside) {
67
67
  if (
68
68
  process.env.NODE_ENV !== "production" &&
69
69
  (title || description || headingTag)
@@ -802,7 +802,7 @@ export const ActionMenuRadioItem = forwardRef<
802
802
  fill="var(--ax-bg-default, var(--a-surface-default))"
803
803
  />
804
804
  </g>
805
- {themeContext ? (
805
+ {themeContext?.isDarkside ? (
806
806
  <g className={cn("navds-action-menu__indicator-icon--checked")}>
807
807
  <rect
808
808
  width="24"
@@ -46,7 +46,7 @@ export const Item: PaginationItemType = forwardRef(
46
46
  return (
47
47
  <Button
48
48
  as={Component}
49
- variant={themeContext ? "tertiary-neutral" : "tertiary"}
49
+ variant={themeContext?.isDarkside ? "tertiary-neutral" : "tertiary"}
50
50
  data-color={color}
51
51
  aria-current={selected}
52
52
  data-pressed={selected}
@@ -138,7 +138,7 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
138
138
  placement,
139
139
  open,
140
140
  middleware: [
141
- flOffset(offset ?? (themeContext ? 8 : arrow ? 16 : 4)),
141
+ flOffset(offset ?? (themeContext?.isDarkside ? 8 : arrow ? 16 : 4)),
142
142
  chosenFlip &&
143
143
  flip({ padding: 5, fallbackPlacements: ["bottom", "top"] }),
144
144
  shift({ padding: 12 }),
@@ -191,7 +191,7 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
191
191
  >
192
192
  {children}
193
193
  {/* Hide arrow in new design, prop will be removed in breaking change update */}
194
- {arrow && !themeContext && (
194
+ {arrow && !themeContext?.isDarkside && (
195
195
  <div
196
196
  ref={(node) => {
197
197
  arrowRef.current = node;
@@ -26,7 +26,7 @@ export const Portal = forwardRef<HTMLDivElement, PortalProps>(
26
26
  * Portal can be mounted outside of theme-classNames.
27
27
  * If a theme is present, we want to make sure that theme cascades to portaled element.
28
28
  */
29
- if (themeContext) {
29
+ if (themeContext?.isDarkside) {
30
30
  return root
31
31
  ? ReactDOM.createPortal(
32
32
  <Theme
@@ -45,6 +45,8 @@ const RenameCSS = ({ children }: { children: React.ReactNode }) => {
45
45
  /* -------------------------------------------------------------------------- */
46
46
  /* Theme provider */
47
47
  /* -------------------------------------------------------------------------- */
48
+ const DEFAULT_COLOR: AkselColor = "accent";
49
+
48
50
  type ThemeContext = {
49
51
  /**
50
52
  * Color theme
@@ -52,12 +54,21 @@ type ThemeContext = {
52
54
  */
53
55
  theme?: "light" | "dark";
54
56
  color?: AkselColor;
57
+ /**
58
+ * Indicates if Theme-component is used or not.
59
+ * @default false
60
+ */
61
+ isDarkside: boolean;
55
62
  };
56
63
 
57
64
  const [ThemeProvider, useThemeInternal] = createContext<ThemeContext>({
58
65
  hookName: "useTheme",
59
66
  name: "ThemeProvider",
60
67
  providerName: "ThemeProvider",
68
+ defaultValue: {
69
+ color: DEFAULT_COLOR,
70
+ isDarkside: false,
71
+ },
61
72
  });
62
73
 
63
74
  export type ThemeProps = {
@@ -70,7 +81,7 @@ export type ThemeProps = {
70
81
  * Sets default 'base'-color for application
71
82
  */
72
83
  "data-color"?: AkselColor;
73
- } & Omit<ThemeContext, "color"> &
84
+ } & Omit<ThemeContext, "color" | "isDarkside"> &
74
85
  AsChildProps;
75
86
 
76
87
  const Theme = forwardRef<HTMLDivElement, ThemeProps>(
@@ -86,7 +97,7 @@ const Theme = forwardRef<HTMLDivElement, ThemeProps>(
86
97
  "data-color": color = context?.color,
87
98
  } = props;
88
99
 
89
- const isRoot = context === undefined;
100
+ const isRoot = !context?.isDarkside;
90
101
 
91
102
  const hasBackground =
92
103
  hasBackgroundProp ?? (isRoot && props.theme !== undefined);
@@ -94,7 +105,7 @@ const Theme = forwardRef<HTMLDivElement, ThemeProps>(
94
105
  const SlotElement = asChild ? Slot : "div";
95
106
 
96
107
  return (
97
- <ThemeProvider theme={theme} color={color}>
108
+ <ThemeProvider theme={theme} color={color} isDarkside={true}>
98
109
  <RenameCSS>
99
110
  <SlotElement
100
111
  ref={ref}
@@ -49,7 +49,7 @@ export const Pin = forwardRef<HTMLButtonElement, TimelinePinProps>(
49
49
  const translate = useI18n("Timeline");
50
50
 
51
51
  const themeContext = useThemeInternal(false);
52
- const showArrow = !themeContext;
52
+ const showArrow = !themeContext?.isDarkside;
53
53
 
54
54
  const {
55
55
  context,
@@ -61,7 +61,7 @@ const ClickablePeriod = React.memo(
61
61
  const translate = useI18n("Timeline");
62
62
 
63
63
  const themeContext = useThemeInternal(false);
64
- const showArrow = !themeContext;
64
+ const showArrow = !themeContext?.isDarkside;
65
65
 
66
66
  const {
67
67
  context,
@@ -84,7 +84,7 @@ export const ToggleGroup = forwardRef<HTMLDivElement, ToggleGroupProps>(
84
84
 
85
85
  let localVariant: ToggleGroupProps["variant"] | undefined;
86
86
 
87
- if (themeContext) {
87
+ if (themeContext?.isDarkside) {
88
88
  localVariant = variant;
89
89
  } else {
90
90
  localVariant = variant ?? "action";