braid-design-system 33.10.1 → 33.10.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # braid-design-system
2
2
 
3
+ ## 33.10.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Expand the peer dependency range to support React 19. ([#1822](https://github.com/seek-oss/braid-design-system/pull/1822))
8
+
3
9
  ## 33.10.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -60,7 +60,7 @@ If you're rendering within the context of another application, you may want to o
60
60
  If you'd like to customise the technical implementation of all `Link` and `TextLink` components from Braid, you can pass a custom component to the `linkComponent` prop on `BraidProvider`. For example, if you wanted to ensure that all relative links are [React Router](https://reacttraining.com/react-router/) links:
61
61
 
62
62
  ```tsx
63
- import { Link as ReactRouterLink } from 'react-router-dom';
63
+ import { Link as ReactRouterLink } from 'react-router';
64
64
  import { BraidProvider, makeLinkComponent } from 'braid-design-system';
65
65
  import wireframe from 'braid-design-system/themes/wireframe';
66
66
 
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ForwardRefRenderFunction, AnchorHTMLAttributes, ComponentType, ReactNode, ReactElement, AllHTMLAttributes, ElementType, RefAttributes, Ref, RefObject, KeyboardEvent, MouseEvent, FormEvent, RefCallback } from 'react';
2
+ import react__default, { ForwardRefRenderFunction, AnchorHTMLAttributes, ComponentType, ReactNode, ReactElement, AllHTMLAttributes, ElementType, RefAttributes, Ref, RefObject, KeyboardEvent, MouseEvent, FormEvent, RefCallback } from 'react';
3
3
  import { FontMetrics } from '@capsizecss/core';
4
4
  import * as clsx from 'clsx';
5
5
  import { ClassValue } from 'clsx';
@@ -324,7 +324,7 @@ declare const BraidPortal: ({ children, container }: BraidPortalProps) => react.
324
324
  interface ThemeNameConsumerProps {
325
325
  children(name: string): ReactElement;
326
326
  }
327
- declare const ThemeNameConsumer: ({ children }: ThemeNameConsumerProps) => ReactElement<any, string | react.JSXElementConstructor<any>>;
327
+ declare const ThemeNameConsumer: ({ children }: ThemeNameConsumerProps) => ReactElement<unknown, string | react.JSXElementConstructor<any>>;
328
328
 
329
329
  declare const useThemeName: () => string;
330
330
 
@@ -2746,7 +2746,7 @@ type Sprinkles = Parameters<typeof sprinkles>[0];
2746
2746
  type Space = keyof typeof vars$1.space | 'none';
2747
2747
  type ResponsiveSpace = RequiredResponsiveValue<Space>;
2748
2748
  interface Atoms extends Sprinkles {
2749
- reset?: keyof JSX.IntrinsicElements;
2749
+ reset?: keyof react__default.JSX.IntrinsicElements;
2750
2750
  }
2751
2751
 
2752
2752
  type BoxBackgroundVariant = Background | 'customDark' | 'customLight';
@@ -3371,7 +3371,7 @@ interface IconRendererProps {
3371
3371
  className: string;
3372
3372
  }) => ReactElement | null;
3373
3373
  }
3374
- declare const IconRenderer: ({ children }: IconRendererProps) => ReactElement<any, string | react.JSXElementConstructor<any>> | null;
3374
+ declare const IconRenderer: ({ children }: IconRendererProps) => ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
3375
3375
 
3376
3376
  type LinkProps = Omit<LinkComponentProps, 'className'> & {
3377
3377
  className?: ClassValue;
@@ -3433,8 +3433,8 @@ interface PopoverProps {
3433
3433
  modal?: boolean;
3434
3434
  open: boolean;
3435
3435
  onClose?: () => void;
3436
- triggerRef: RefObject<HTMLElement>;
3437
- enterFocusRef?: RefObject<HTMLElement>;
3436
+ triggerRef: RefObject<HTMLElement | null>;
3437
+ enterFocusRef?: RefObject<HTMLElement | null>;
3438
3438
  children: ReactNode;
3439
3439
  }
3440
3440
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ForwardRefRenderFunction, AnchorHTMLAttributes, ComponentType, ReactNode, ReactElement, AllHTMLAttributes, ElementType, RefAttributes, Ref, RefObject, KeyboardEvent, MouseEvent, FormEvent, RefCallback } from 'react';
2
+ import react__default, { ForwardRefRenderFunction, AnchorHTMLAttributes, ComponentType, ReactNode, ReactElement, AllHTMLAttributes, ElementType, RefAttributes, Ref, RefObject, KeyboardEvent, MouseEvent, FormEvent, RefCallback } from 'react';
3
3
  import { FontMetrics } from '@capsizecss/core';
4
4
  import * as clsx from 'clsx';
5
5
  import { ClassValue } from 'clsx';
@@ -324,7 +324,7 @@ declare const BraidPortal: ({ children, container }: BraidPortalProps) => react.
324
324
  interface ThemeNameConsumerProps {
325
325
  children(name: string): ReactElement;
326
326
  }
327
- declare const ThemeNameConsumer: ({ children }: ThemeNameConsumerProps) => ReactElement<any, string | react.JSXElementConstructor<any>>;
327
+ declare const ThemeNameConsumer: ({ children }: ThemeNameConsumerProps) => ReactElement<unknown, string | react.JSXElementConstructor<any>>;
328
328
 
329
329
  declare const useThemeName: () => string;
330
330
 
@@ -2746,7 +2746,7 @@ type Sprinkles = Parameters<typeof sprinkles>[0];
2746
2746
  type Space = keyof typeof vars$1.space | 'none';
2747
2747
  type ResponsiveSpace = RequiredResponsiveValue<Space>;
2748
2748
  interface Atoms extends Sprinkles {
2749
- reset?: keyof JSX.IntrinsicElements;
2749
+ reset?: keyof react__default.JSX.IntrinsicElements;
2750
2750
  }
2751
2751
 
2752
2752
  type BoxBackgroundVariant = Background | 'customDark' | 'customLight';
@@ -3371,7 +3371,7 @@ interface IconRendererProps {
3371
3371
  className: string;
3372
3372
  }) => ReactElement | null;
3373
3373
  }
3374
- declare const IconRenderer: ({ children }: IconRendererProps) => ReactElement<any, string | react.JSXElementConstructor<any>> | null;
3374
+ declare const IconRenderer: ({ children }: IconRendererProps) => ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
3375
3375
 
3376
3376
  type LinkProps = Omit<LinkComponentProps, 'className'> & {
3377
3377
  className?: ClassValue;
@@ -3433,8 +3433,8 @@ interface PopoverProps {
3433
3433
  modal?: boolean;
3434
3434
  open: boolean;
3435
3435
  onClose?: () => void;
3436
- triggerRef: RefObject<HTMLElement>;
3437
- enterFocusRef?: RefObject<HTMLElement>;
3436
+ triggerRef: RefObject<HTMLElement | null>;
3437
+ enterFocusRef?: RefObject<HTMLElement | null>;
3438
3438
  children: ReactNode;
3439
3439
  }
3440
3440
 
@@ -2,7 +2,7 @@
2
2
  const react = require("react");
3
3
  const useTimeout = ({ onTimeout, duration }) => {
4
4
  const [activated, setActivated] = react.useState(true);
5
- const timeoutRef = react.useRef();
5
+ const timeoutRef = react.useRef(void 0);
6
6
  const stopTimeout = react.useCallback(() => {
7
7
  window.clearTimeout(timeoutRef.current);
8
8
  setActivated(false);
@@ -1,7 +1,7 @@
1
1
  import { useState, useRef, useCallback, useEffect } from "react";
2
2
  const useTimeout = ({ onTimeout, duration }) => {
3
3
  const [activated, setActivated] = useState(true);
4
- const timeoutRef = useRef();
4
+ const timeoutRef = useRef(void 0);
5
5
  const stopTimeout = useCallback(() => {
6
6
  window.clearTimeout(timeoutRef.current);
7
7
  setActivated(false);
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  const react = require("react");
3
- const reactIs = require("react-is");
3
+ const lib_utils_isFragment_cjs = require("./isFragment.cjs");
4
4
  function flattenChildren(children, depth = 0, keys = []) {
5
5
  return react.Children.toArray(children).reduce(
6
6
  (acc, node, nodeIndex) => {
7
- if (reactIs.isFragment(node)) {
7
+ if (lib_utils_isFragment_cjs.isFragment(node)) {
8
8
  acc.push(
9
9
  ...flattenChildren(
10
10
  node.props.children,
@@ -1,5 +1,5 @@
1
1
  import { Children, isValidElement, cloneElement } from "react";
2
- import { isFragment } from "react-is";
2
+ import { isFragment } from "./isFragment.mjs";
3
3
  function flattenChildren(children, depth = 0, keys = []) {
4
4
  return Children.toArray(children).reduce(
5
5
  (acc, node, nodeIndex) => {
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ const REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
3
+ const LEGACY_REACT_ELEMENT_TYPE = Symbol.for("react.element");
4
+ const REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
5
+ const isReactElementType = (value) => {
6
+ if (typeof value !== "object" || value === null) {
7
+ return false;
8
+ }
9
+ const $$typeof = value.$$typeof;
10
+ return $$typeof === REACT_ELEMENT_TYPE || $$typeof === LEGACY_REACT_ELEMENT_TYPE;
11
+ };
12
+ const isFragment = (value) => isReactElementType(value) && value.type === REACT_FRAGMENT_TYPE;
13
+ exports.isFragment = isFragment;
@@ -0,0 +1,14 @@
1
+ const REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
2
+ const LEGACY_REACT_ELEMENT_TYPE = Symbol.for("react.element");
3
+ const REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
4
+ const isReactElementType = (value) => {
5
+ if (typeof value !== "object" || value === null) {
6
+ return false;
7
+ }
8
+ const $$typeof = value.$$typeof;
9
+ return $$typeof === REACT_ELEMENT_TYPE || $$typeof === LEGACY_REACT_ELEMENT_TYPE;
10
+ };
11
+ const isFragment = (value) => isReactElementType(value) && value.type === REACT_FRAGMENT_TYPE;
12
+ export {
13
+ isFragment
14
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-design-system",
3
- "version": "33.10.1",
3
+ "version": "33.10.2",
4
4
  "description": "Themeable design system for the SEEK Group",
5
5
  "homepage": "https://seek-oss.github.io/braid-design-system/",
6
6
  "bugs": {
@@ -178,7 +178,6 @@
178
178
  "lodash.curry": "^4.1.1",
179
179
  "polished": "^4.1.0",
180
180
  "react-focus-lock": "^2.9.7",
181
- "react-is": "^18.2.0",
182
181
  "react-remove-scroll": "^2.7.0",
183
182
  "throttle-debounce": "^5.0.2",
184
183
  "utility-types": "^3.10.0"
@@ -199,10 +198,8 @@
199
198
  "@types/gradient-parser": "^0.1.5",
200
199
  "@types/lodash.curry": "^4.1.9",
201
200
  "@types/node": "^22.16.0",
202
- "@types/react": "^18.3.18",
203
- "@types/react-dom": "^18.3.0",
204
- "@types/react-is": "^18.3.0",
205
- "@types/react-router-dom": "^5.3.3",
201
+ "@types/react": "^19.1.8",
202
+ "@types/react-dom": "^19.1.6",
206
203
  "@types/sanitize-html": "^2.13.0",
207
204
  "@types/testing-library__jest-dom": "^5.9.1",
208
205
  "@types/throttle-debounce": "^5.0.2",
@@ -216,9 +213,9 @@
216
213
  "html-validate": "^9.7.1",
217
214
  "playroom": "0.44.0",
218
215
  "prettier": "^3.4.1",
219
- "react": "^18.3.1",
220
- "react-dom": "^18.3.1",
221
- "react-router-dom": "^6.3.0",
216
+ "react": "^19.1.0",
217
+ "react-dom": "^19.1.0",
218
+ "react-router": "^7.6.3",
222
219
  "sanitize-html": "^2.12.1",
223
220
  "sku": "14.8.0",
224
221
  "storybook": "9.0.15",
@@ -227,8 +224,8 @@
227
224
  "@braid-design-system/source.macro": "1.0.0"
228
225
  },
229
226
  "peerDependencies": {
230
- "react": "^18",
231
- "react-dom": "^18"
227
+ "react": "^18 || ^19",
228
+ "react-dom": "^18 || ^19"
232
229
  },
233
230
  "scripts": {
234
231
  "build": "crackle package",