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 +6 -0
- package/README.md +1 -1
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/lib/components/useToast/useTimeout.cjs +1 -1
- package/dist/lib/components/useToast/useTimeout.mjs +1 -1
- package/dist/lib/utils/flattenChildren.cjs +2 -2
- package/dist/lib/utils/flattenChildren.mjs +1 -1
- package/dist/lib/utils/isFragment.cjs +13 -0
- package/dist/lib/utils/isFragment.mjs +14 -0
- package/package.json +8 -11
package/CHANGELOG.md
CHANGED
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
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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
|
|
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 (
|
|
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 "
|
|
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.
|
|
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": "^
|
|
203
|
-
"@types/react-dom": "^
|
|
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": "^
|
|
220
|
-
"react-dom": "^
|
|
221
|
-
"react-router
|
|
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",
|