braid-design-system 32.6.0 → 32.7.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/CHANGELOG.md +46 -0
- package/codemod/dist/wrapper.js +82628 -42142
- package/dist/ToastContext.chunk.cjs +6 -0
- package/dist/ToastContext.chunk.mjs +6 -0
- package/dist/{Toggle.chunk.cjs → index.chunk.cjs} +89 -79
- package/dist/{Toggle.chunk.mjs → index.chunk.mjs} +88 -78
- package/dist/index.cjs +137 -137
- package/dist/index.mjs +1 -1
- package/dist/playroom/components.cjs +147 -147
- package/dist/playroom/components.mjs +2 -2
- package/dist/playroomState.chunk.cjs +1 -1
- package/dist/playroomState.chunk.mjs +1 -1
- package/dist/reset.cjs +5 -0
- package/dist/reset.d.ts +1 -1
- package/dist/reset.mjs +5 -0
- package/dist/styles/lib/components/private/Modal/Modal.css.cjs +15 -7
- package/dist/styles/lib/components/private/Modal/Modal.css.mjs +15 -7
- package/package.json +2 -2
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const ToastContext = require("./ToastContext.chunk.cjs");
|
|
3
2
|
const sideEffects_lib_components_BraidProvider_BraidProvider_cjs = require("./side-effects/lib/components/BraidProvider/BraidProvider.cjs");
|
|
3
|
+
const ToastContext = require("./ToastContext.chunk.cjs");
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const assert = require("assert");
|
|
6
6
|
const React = require("react");
|
|
7
7
|
const styles_lib_css_atoms_sprinkles_css_cjs = require("./styles/lib/css/atoms/sprinkles.css.cjs");
|
|
8
|
-
const styles_lib_components_icons_IconArrow_IconArrow_css_cjs = require("./styles/lib/components/icons/IconArrow/IconArrow.css.cjs");
|
|
9
|
-
const styles_lib_components_icons_IconThumb_IconThumb_css_cjs = require("./styles/lib/components/icons/IconThumb/IconThumb.css.cjs");
|
|
10
8
|
const styles_lib_components_Accordion_AccordionItem_css_cjs = require("./styles/lib/components/Accordion/AccordionItem.css.cjs");
|
|
9
|
+
const styles_lib_components_icons_IconChevron_IconChevron_css_cjs = require("./styles/lib/components/icons/IconChevron/IconChevron.css.cjs");
|
|
11
10
|
const styles_lib_components_private_hideFocusRings_hideFocusRings_css_cjs = require("./styles/lib/components/private/hideFocusRings/hideFocusRings.css.cjs");
|
|
12
11
|
const styles_lib_css_textAlignedToIcon_css_cjs = require("./styles/lib/css/textAlignedToIcon.css.cjs");
|
|
13
12
|
const styles_lib_components_Alert_Alert_css_cjs = require("./styles/lib/components/Alert/Alert.css.cjs");
|
|
14
13
|
const dedent = require("dedent");
|
|
15
14
|
const parseHighlights = require("autosuggest-highlight/parse/index.js");
|
|
15
|
+
const styles_lib_css_typography_css_cjs = require("./styles/lib/css/typography.css.cjs");
|
|
16
16
|
const styles_lib_components_HiddenVisually_HiddenVisually_css_cjs = require("./styles/lib/components/HiddenVisually/HiddenVisually.css.cjs");
|
|
17
17
|
const reactDom = require("react-dom");
|
|
18
18
|
const styles_lib_css_atoms_atoms_cjs = require("./styles/lib/css/atoms/atoms.cjs");
|
|
19
|
-
const
|
|
19
|
+
const clsx = require("clsx");
|
|
20
|
+
const styles_lib_components_private_Field_Field_css_cjs = require("./styles/lib/components/private/Field/Field.css.cjs");
|
|
20
21
|
const reactRemoveScroll = require("react-remove-scroll");
|
|
21
22
|
const styles_lib_components_Autosuggest_Autosuggest_css_cjs = require("./styles/lib/components/Autosuggest/Autosuggest.css.cjs");
|
|
22
23
|
const matchHighlights = require("autosuggest-highlight/match/index.js");
|
|
23
|
-
const clsx = require("clsx");
|
|
24
24
|
const styles_lib_components_private_Keyline_Keyline_css_cjs = require("./styles/lib/components/private/Keyline/Keyline.css.cjs");
|
|
25
|
+
const styles_lib_components_private_InlineField_InlineField_css_cjs = require("./styles/lib/components/private/InlineField/InlineField.css.cjs");
|
|
25
26
|
const FocusLock = require("react-focus-lock");
|
|
26
27
|
const styles_lib_components_private_Modal_ModalExternalGutter_cjs = require("./styles/lib/components/private/Modal/ModalExternalGutter.cjs");
|
|
27
28
|
const styles_lib_components_private_Modal_Modal_css_cjs = require("./styles/lib/components/private/Modal/Modal.css.cjs");
|
|
29
|
+
const styles_lib_components_Dropdown_Dropdown_css_cjs = require("./styles/lib/components/Dropdown/Dropdown.css.cjs");
|
|
28
30
|
const styles_lib_css_lineHeightContainer_css_cjs = require("./styles/lib/css/lineHeightContainer.css.cjs");
|
|
29
31
|
const styles_lib_components_List_List_css_cjs = require("./styles/lib/components/List/List.css.cjs");
|
|
30
32
|
const styles_lib_components_Loader_Loader_css_cjs = require("./styles/lib/components/Loader/Loader.css.cjs");
|
|
31
|
-
const styles_lib_components_MenuItemCheckbox_MenuItemCheckbox_css_cjs = require("./styles/lib/components/MenuItemCheckbox/MenuItemCheckbox.css.cjs");
|
|
32
|
-
const styles_lib_components_MenuItem_useMenuItem_css_cjs = require("./styles/lib/components/MenuItem/useMenuItem.css.cjs");
|
|
33
33
|
const styles_lib_components_MenuRenderer_MenuRenderer_css_cjs = require("./styles/lib/components/MenuRenderer/MenuRenderer.css.cjs");
|
|
34
|
+
const styles_lib_components_MenuItem_useMenuItem_css_cjs = require("./styles/lib/components/MenuItem/useMenuItem.css.cjs");
|
|
35
|
+
const styles_lib_components_MenuItemCheckbox_MenuItemCheckbox_css_cjs = require("./styles/lib/components/MenuItemCheckbox/MenuItemCheckbox.css.cjs");
|
|
34
36
|
const styles_lib_components_OverflowMenu_OverflowMenu_css_cjs = require("./styles/lib/components/OverflowMenu/OverflowMenu.css.cjs");
|
|
35
37
|
const isMobile = require("is-mobile");
|
|
36
|
-
const styles_lib_components_Dropdown_Dropdown_css_cjs = require("./styles/lib/components/Dropdown/Dropdown.css.cjs");
|
|
37
38
|
const styles_lib_components_MonthPicker_MonthPicker_css_cjs = require("./styles/lib/components/MonthPicker/MonthPicker.css.cjs");
|
|
38
39
|
const styles_lib_components_Pagination_Pagination_css_cjs = require("./styles/lib/components/Pagination/Pagination.css.cjs");
|
|
39
|
-
const styles_lib_components_private_InlineField_InlineField_css_cjs = require("./styles/lib/components/private/InlineField/InlineField.css.cjs");
|
|
40
40
|
const styles_lib_components_Rating_Rating_css_cjs = require("./styles/lib/components/Rating/Rating.css.cjs");
|
|
41
41
|
const styles_lib_components_Stepper_Stepper_css_cjs = require("./styles/lib/components/Stepper/Stepper.css.cjs");
|
|
42
42
|
const styles_lib_components_Tabs_Tabs_css_cjs = require("./styles/lib/components/Tabs/Tabs.css.cjs");
|
|
@@ -45,16 +45,16 @@ const styles_lib_components_Tag_Tag_css_cjs = require("./styles/lib/components/T
|
|
|
45
45
|
const styles_lib_components_Textarea_Highlight_Highlight_css_cjs = require("./styles/lib/components/Textarea/Highlight/Highlight.css.cjs");
|
|
46
46
|
const styles_lib_components_Textarea_Textarea_css_cjs = require("./styles/lib/components/Textarea/Textarea.css.cjs");
|
|
47
47
|
const styles_lib_components_TextDropdown_TextDropdown_css_cjs = require("./styles/lib/components/TextDropdown/TextDropdown.css.cjs");
|
|
48
|
-
const styles_lib_components_icons_IconChevron_IconChevron_css_cjs = require("./styles/lib/components/icons/IconChevron/IconChevron.css.cjs");
|
|
49
|
-
const styles_lib_components_private_Field_Field_css_cjs = require("./styles/lib/components/private/Field/Field.css.cjs");
|
|
50
48
|
const styles_lib_components_Tiles_Tiles_css_cjs = require("./styles/lib/components/Tiles/Tiles.css.cjs");
|
|
51
49
|
const styles_lib_components_Toggle_Toggle_css_cjs = require("./styles/lib/components/Toggle/Toggle.css.cjs");
|
|
50
|
+
const styles_lib_components_icons_IconArrow_IconArrow_css_cjs = require("./styles/lib/components/icons/IconArrow/IconArrow.css.cjs");
|
|
51
|
+
const styles_lib_components_icons_IconThumb_IconThumb_css_cjs = require("./styles/lib/components/icons/IconThumb/IconThumb.css.cjs");
|
|
52
52
|
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
53
53
|
const assert__default = /* @__PURE__ */ _interopDefaultCompat(assert);
|
|
54
54
|
const dedent__default = /* @__PURE__ */ _interopDefaultCompat(dedent);
|
|
55
55
|
const parseHighlights__default = /* @__PURE__ */ _interopDefaultCompat(parseHighlights);
|
|
56
|
-
const matchHighlights__default = /* @__PURE__ */ _interopDefaultCompat(matchHighlights);
|
|
57
56
|
const clsx__default = /* @__PURE__ */ _interopDefaultCompat(clsx);
|
|
57
|
+
const matchHighlights__default = /* @__PURE__ */ _interopDefaultCompat(matchHighlights);
|
|
58
58
|
const FocusLock__default = /* @__PURE__ */ _interopDefaultCompat(FocusLock);
|
|
59
59
|
const ThemeNameConsumer = ({ children }) => children(ToastContext.useThemeName());
|
|
60
60
|
const useColor = () => sideEffects_lib_components_BraidProvider_BraidProvider_cjs.useBraidTheme().color;
|
|
@@ -4301,35 +4301,68 @@ const Heading = ({
|
|
|
4301
4301
|
]
|
|
4302
4302
|
}
|
|
4303
4303
|
) });
|
|
4304
|
-
const
|
|
4304
|
+
const validPageBlockComponents = [
|
|
4305
|
+
"div",
|
|
4306
|
+
"article",
|
|
4307
|
+
"aside",
|
|
4308
|
+
"main",
|
|
4309
|
+
"section",
|
|
4310
|
+
"nav"
|
|
4311
|
+
];
|
|
4312
|
+
const gutters = { mobile: "xsmall", tablet: "gutter" };
|
|
4313
|
+
const PageBlock = ({
|
|
4314
|
+
children,
|
|
4315
|
+
width = "large",
|
|
4316
|
+
component: componentProp,
|
|
4317
|
+
data,
|
|
4318
|
+
...restProps
|
|
4319
|
+
}) => {
|
|
4320
|
+
const component = componentProp && validPageBlockComponents.includes(componentProp) ? componentProp : "div";
|
|
4321
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4322
|
+
ToastContext.Box,
|
|
4323
|
+
{
|
|
4324
|
+
component,
|
|
4325
|
+
paddingX: gutters,
|
|
4326
|
+
...ToastContext.buildDataAttributes({ data, validateRestProps: restProps }),
|
|
4327
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ToastContext.ContentBlock, { width, children })
|
|
4328
|
+
}
|
|
4329
|
+
);
|
|
4330
|
+
};
|
|
4331
|
+
const modalPadding = { mobile: "gutter", tablet: "large" };
|
|
4305
4332
|
const ModalContentHeader = React.forwardRef(
|
|
4306
|
-
({ title, headingLevel, description, descriptionId, center }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
{
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
+
({ title, headingLevel, description, descriptionId, center }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4334
|
+
ToastContext.Stack,
|
|
4335
|
+
{
|
|
4336
|
+
space: headingLevel === "2" ? { mobile: "small", tablet: "medium" } : "small",
|
|
4337
|
+
children: [
|
|
4338
|
+
/* @__PURE__ */ jsxRuntime.jsx(Heading, { level: headingLevel, align: center ? "center" : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4339
|
+
ToastContext.Box,
|
|
4340
|
+
{
|
|
4341
|
+
ref,
|
|
4342
|
+
component: "span",
|
|
4343
|
+
tabIndex: -1,
|
|
4344
|
+
outline: "none",
|
|
4345
|
+
position: "relative",
|
|
4346
|
+
className: styles_lib_components_private_Modal_Modal_css_cjs.headingRoot,
|
|
4347
|
+
children: [
|
|
4348
|
+
title,
|
|
4349
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4350
|
+
ToastContext.Overlay,
|
|
4351
|
+
{
|
|
4352
|
+
boxShadow: "outlineFocus",
|
|
4353
|
+
borderRadius: "standard",
|
|
4354
|
+
transition: "fast",
|
|
4355
|
+
className: styles_lib_components_private_Modal_Modal_css_cjs.headingFocus,
|
|
4356
|
+
onlyVisibleForKeyboardNavigation: true
|
|
4357
|
+
}
|
|
4358
|
+
)
|
|
4359
|
+
]
|
|
4360
|
+
}
|
|
4361
|
+
) }),
|
|
4362
|
+
description ? /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Box, { id: descriptionId, children: description }) : null
|
|
4363
|
+
]
|
|
4364
|
+
}
|
|
4365
|
+
)
|
|
4333
4366
|
);
|
|
4334
4367
|
const ModalContent = ({
|
|
4335
4368
|
id,
|
|
@@ -4397,7 +4430,8 @@ const ModalContent = ({
|
|
|
4397
4430
|
boxShadow: "large",
|
|
4398
4431
|
width: width !== "content" ? "full" : void 0,
|
|
4399
4432
|
height: position === "right" || position === "left" ? "full" : void 0,
|
|
4400
|
-
|
|
4433
|
+
paddingY: modalPadding,
|
|
4434
|
+
paddingX: position !== "center" ? gutters : modalPadding,
|
|
4401
4435
|
className: [
|
|
4402
4436
|
styles_lib_components_private_Modal_Modal_css_cjs.pointerEventsAll,
|
|
4403
4437
|
position === "center" && styles_lib_components_private_Modal_Modal_css_cjs.maxSize[position]
|
|
@@ -4446,15 +4480,14 @@ const ModalContent = ({
|
|
|
4446
4480
|
display: "flex",
|
|
4447
4481
|
justifyContent: "flexEnd",
|
|
4448
4482
|
paddingTop: modalPadding,
|
|
4449
|
-
paddingRight: modalPadding,
|
|
4483
|
+
paddingRight: position !== "center" ? gutters : modalPadding,
|
|
4450
4484
|
className: position === "center" && styles_lib_components_private_Modal_Modal_css_cjs.maxSize[position],
|
|
4451
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4485
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4452
4486
|
ToastContext.Box,
|
|
4453
4487
|
{
|
|
4454
4488
|
position: "relative",
|
|
4455
4489
|
background: "surface",
|
|
4456
4490
|
borderRadius: "full",
|
|
4457
|
-
padding: "xsmall",
|
|
4458
4491
|
className: [styles_lib_components_private_Modal_Modal_css_cjs.closeIconOffset, styles_lib_components_private_Modal_Modal_css_cjs.pointerEventsAll],
|
|
4459
4492
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4460
4493
|
ToastContext.ButtonIcon,
|
|
@@ -4469,7 +4502,7 @@ const ModalContent = ({
|
|
|
4469
4502
|
}
|
|
4470
4503
|
)
|
|
4471
4504
|
}
|
|
4472
|
-
)
|
|
4505
|
+
)
|
|
4473
4506
|
}
|
|
4474
4507
|
)
|
|
4475
4508
|
]
|
|
@@ -4562,24 +4595,28 @@ const Modal = ({
|
|
|
4562
4595
|
const closeHandlerRef = React.useRef(onClose);
|
|
4563
4596
|
const initiateClose = () => {
|
|
4564
4597
|
if (allowClose) {
|
|
4565
|
-
|
|
4598
|
+
const result = closeHandlerRef.current(false);
|
|
4599
|
+
if (result === false) {
|
|
4600
|
+
return result;
|
|
4601
|
+
}
|
|
4602
|
+
if (openRef.current) {
|
|
4603
|
+
dispatch(CLOSE_MODAL);
|
|
4604
|
+
}
|
|
4566
4605
|
}
|
|
4567
4606
|
};
|
|
4568
4607
|
React.useEffect(() => {
|
|
4569
4608
|
openRef.current = open;
|
|
4570
4609
|
dispatch(open ? OPEN_MODAL : CLOSE_MODAL);
|
|
4571
4610
|
}, [open]);
|
|
4611
|
+
const closing = state === CLOSING;
|
|
4572
4612
|
React.useEffect(() => {
|
|
4573
|
-
if (
|
|
4613
|
+
if (closing) {
|
|
4574
4614
|
const timer = setTimeout(() => {
|
|
4575
4615
|
dispatch(ANIMATION_COMPLETE);
|
|
4576
4616
|
}, ANIMATION_DURATION);
|
|
4577
4617
|
return () => clearTimeout(timer);
|
|
4578
4618
|
}
|
|
4579
|
-
|
|
4580
|
-
closeHandlerRef.current(false);
|
|
4581
|
-
}
|
|
4582
|
-
}, [state]);
|
|
4619
|
+
}, [closing]);
|
|
4583
4620
|
const shouldAriaHideOthers = state === OPEN || state === CLOSING;
|
|
4584
4621
|
React.useEffect(() => {
|
|
4585
4622
|
if (shouldAriaHideOthers && modalRef.current) {
|
|
@@ -4646,7 +4683,7 @@ const Modal = ({
|
|
|
4646
4683
|
padding: position === "center" ? styles_lib_components_private_Modal_ModalExternalGutter_cjs.externalGutter : void 0,
|
|
4647
4684
|
className: [
|
|
4648
4685
|
styles_lib_components_private_Modal_Modal_css_cjs.modalContainer,
|
|
4649
|
-
position === "left" || position === "right" && styles_lib_components_private_Modal_Modal_css_cjs.horiztontalTransition,
|
|
4686
|
+
(position === "left" || position === "right") && styles_lib_components_private_Modal_Modal_css_cjs.horiztontalTransition,
|
|
4650
4687
|
state === OPENING && styles_lib_components_private_Modal_Modal_css_cjs.entrance[position],
|
|
4651
4688
|
state === CLOSING && position in styles_lib_components_private_Modal_Modal_css_cjs.exit && styles_lib_components_private_Modal_Modal_css_cjs.exit[position]
|
|
4652
4689
|
],
|
|
@@ -5907,33 +5944,6 @@ const Notice = ({
|
|
|
5907
5944
|
}
|
|
5908
5945
|
);
|
|
5909
5946
|
};
|
|
5910
|
-
const validPageBlockComponents = [
|
|
5911
|
-
"div",
|
|
5912
|
-
"article",
|
|
5913
|
-
"aside",
|
|
5914
|
-
"main",
|
|
5915
|
-
"section",
|
|
5916
|
-
"nav"
|
|
5917
|
-
];
|
|
5918
|
-
const gutters = { mobile: "xsmall", tablet: "gutter" };
|
|
5919
|
-
const PageBlock = ({
|
|
5920
|
-
children,
|
|
5921
|
-
width = "large",
|
|
5922
|
-
component: componentProp,
|
|
5923
|
-
data,
|
|
5924
|
-
...restProps
|
|
5925
|
-
}) => {
|
|
5926
|
-
const component = componentProp && validPageBlockComponents.includes(componentProp) ? componentProp : "div";
|
|
5927
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5928
|
-
ToastContext.Box,
|
|
5929
|
-
{
|
|
5930
|
-
component,
|
|
5931
|
-
paddingX: gutters,
|
|
5932
|
-
...ToastContext.buildDataAttributes({ data, validateRestProps: restProps }),
|
|
5933
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(ToastContext.ContentBlock, { width, children })
|
|
5934
|
-
}
|
|
5935
|
-
);
|
|
5936
|
-
};
|
|
5937
5947
|
const paginate = ({
|
|
5938
5948
|
page,
|
|
5939
5949
|
total,
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { useThemeName, useResponsiveValue, Stack, Box, buildDataAttributes, Divider, useIcon, virtualTouchable, Columns, Column, Inline, Text, Overlay, ActionsContext, useBackground, iconContainerSize, IconClear, IconPositive, IconCritical, TextContext, HeadingContext, useBackgroundLightness, textStyles, FieldOverlay, ButtonIcon, Bleed, useColoredBoxClasses, BackgroundProvider, ButtonContainer, useButtonStyles, ButtonOverlays, ButtonText, resolveResponsiveRangeProps, optimizeResponsiveArray, Typography, BraidPortal, TextLinkButton, AvoidWidowIcon, useDefaultTextProps, flattenChildren, DefaultTextPropsProvider, iconSize, ContentBlock, Hidden, useSpace, negativeMargin, resolveResponsiveProp } from "./ToastContext.chunk.mjs";
|
|
2
1
|
import { useBraidTheme, useLinkComponent } from "./side-effects/lib/components/BraidProvider/BraidProvider.mjs";
|
|
2
|
+
import { useThemeName, useResponsiveValue, Stack, Box, buildDataAttributes, Divider, useIcon, virtualTouchable, Columns, Column, Inline, Text, Overlay, ActionsContext, useBackground, iconContainerSize, IconClear, IconPositive, IconCritical, TextContext, HeadingContext, useBackgroundLightness, textStyles, FieldOverlay, ButtonIcon, Bleed, useColoredBoxClasses, BackgroundProvider, ButtonContainer, useButtonStyles, ButtonOverlays, ButtonText, resolveResponsiveRangeProps, optimizeResponsiveArray, Typography, ContentBlock, BraidPortal, TextLinkButton, AvoidWidowIcon, useDefaultTextProps, flattenChildren, DefaultTextPropsProvider, iconSize, Hidden, useSpace, negativeMargin, resolveResponsiveProp } from "./ToastContext.chunk.mjs";
|
|
3
3
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
4
4
|
import assert from "assert";
|
|
5
5
|
import { createContext, useMemo, useState, useContext, cloneElement, useEffect, Fragment, forwardRef, useCallback, useRef, useReducer, Children, createRef } from "react";
|
|
6
6
|
import { normalizeResponsiveValue, mapResponsiveValue } from "./styles/lib/css/atoms/sprinkles.css.mjs";
|
|
7
|
-
import { root, rotate, flip, mirror } from "./styles/lib/components/icons/IconArrow/IconArrow.css.mjs";
|
|
8
|
-
import { root as root$2, down } from "./styles/lib/components/icons/IconThumb/IconThumb.css.mjs";
|
|
9
7
|
import { button, focusRing } from "./styles/lib/components/Accordion/AccordionItem.css.mjs";
|
|
8
|
+
import { root as root$1, up, left, right } from "./styles/lib/components/icons/IconChevron/IconChevron.css.mjs";
|
|
10
9
|
import { hideFocusRingsClassName } from "./styles/lib/components/private/hideFocusRings/hideFocusRings.css.mjs";
|
|
11
10
|
import { textAlignedToIcon } from "./styles/lib/css/textAlignedToIcon.css.mjs";
|
|
12
11
|
import { closeButton, closeButtonFocus, closeButtonHover } from "./styles/lib/components/Alert/Alert.css.mjs";
|
|
13
12
|
import dedent from "dedent";
|
|
14
13
|
import parseHighlights from "autosuggest-highlight/parse/index.js";
|
|
14
|
+
import { fontWeight, tone, touchableText, fontFamily, headingWeight, heading } from "./styles/lib/css/typography.css.mjs";
|
|
15
15
|
import { root as root$3 } from "./styles/lib/components/HiddenVisually/HiddenVisually.css.mjs";
|
|
16
16
|
import { createPortal } from "react-dom";
|
|
17
17
|
import { atoms } from "./styles/lib/css/atoms/atoms.mjs";
|
|
18
|
-
import
|
|
18
|
+
import clsx from "clsx";
|
|
19
|
+
import { secondaryIconSpace, field, placeholderColor, iconSpace, verticalDivider, hideBorderOnDarkBackgroundInLightMode, focusOverlay, hoverOverlay } from "./styles/lib/components/private/Field/Field.css.mjs";
|
|
19
20
|
import { RemoveScroll } from "react-remove-scroll";
|
|
20
21
|
import { backdrop, backdropVisible, menu, groupHeading } from "./styles/lib/components/Autosuggest/Autosuggest.css.mjs";
|
|
21
22
|
import matchHighlights from "autosuggest-highlight/match/index.js";
|
|
22
|
-
import clsx from "clsx";
|
|
23
23
|
import { noRadiusOnRight, largestWidth, width, tone as tone$1, lightMode, darkMode } from "./styles/lib/components/private/Keyline/Keyline.css.mjs";
|
|
24
|
+
import { realField, sizeVars, isMixed, fakeField, hideBorderOnDarkBackgroundInLightMode as hideBorderOnDarkBackgroundInLightMode$1, selected, focusOverlay as focusOverlay$1, hoverOverlay as hoverOverlay$1, checkboxIndicator, radioIndicator, labelOffset, children } from "./styles/lib/components/private/InlineField/InlineField.css.mjs";
|
|
24
25
|
import FocusLock from "react-focus-lock";
|
|
25
26
|
import { externalGutter } from "./styles/lib/components/private/Modal/ModalExternalGutter.mjs";
|
|
26
27
|
import { headingRoot, headingFocus, pointerEventsAll, maxSize, closeIconOffset, resetStackingContext, backdrop as backdrop$1, horiztontalTransition, modalContainer, entrance, exit, fixedStackingContext } from "./styles/lib/components/private/Modal/Modal.css.mjs";
|
|
28
|
+
import { field as field$1 } from "./styles/lib/components/Dropdown/Dropdown.css.mjs";
|
|
27
29
|
import { lineHeightContainer } from "./styles/lib/css/lineHeightContainer.css.mjs";
|
|
28
30
|
import { currentColor, size, minCharacterWidth, trimGutter } from "./styles/lib/components/List/List.css.mjs";
|
|
29
31
|
import { rootSize, delay, size as size$1, currentColor as currentColor$1, circle } from "./styles/lib/components/Loader/Loader.css.mjs";
|
|
30
|
-
import { checkboxSize } from "./styles/lib/components/MenuItemCheckbox/MenuItemCheckbox.css.mjs";
|
|
31
|
-
import { menuItem } from "./styles/lib/components/MenuItem/useMenuItem.css.mjs";
|
|
32
32
|
import { backdrop as backdrop$2, menuIsClosed, width as width$1, placementBottom } from "./styles/lib/components/MenuRenderer/MenuRenderer.css.mjs";
|
|
33
|
+
import { menuItem } from "./styles/lib/components/MenuItem/useMenuItem.css.mjs";
|
|
34
|
+
import { checkboxSize } from "./styles/lib/components/MenuItemCheckbox/MenuItemCheckbox.css.mjs";
|
|
33
35
|
import { triggerOffset } from "./styles/lib/components/OverflowMenu/OverflowMenu.css.mjs";
|
|
34
36
|
import { isMobile } from "is-mobile";
|
|
35
|
-
import { field as field$1 } from "./styles/lib/components/Dropdown/Dropdown.css.mjs";
|
|
36
37
|
import { nativeInput } from "./styles/lib/components/MonthPicker/MonthPicker.css.mjs";
|
|
37
38
|
import { hover, background, current, lightModeCurrentKeyline, darkModeCurrentKeyline } from "./styles/lib/components/Pagination/Pagination.css.mjs";
|
|
38
|
-
import { realField, sizeVars, isMixed, fakeField, hideBorderOnDarkBackgroundInLightMode as hideBorderOnDarkBackgroundInLightMode$1, selected, focusOverlay as focusOverlay$1, hoverOverlay as hoverOverlay$1, checkboxIndicator, radioIndicator, labelOffset, children } from "./styles/lib/components/private/InlineField/InlineField.css.mjs";
|
|
39
39
|
import { starSpacing, textSpacing, lightModeStarColor, darkModeStarColor } from "./styles/lib/components/Rating/Rating.css.mjs";
|
|
40
40
|
import { step, tone as tone$2, progressTrack, progressTrackCentered, progressLine, progressUnfilled, indicatorContainer, focusOverlay as focusOverlay$2, indicator, highlight, complete, active, inner, tick, stretch, stretchLastAboveTablet } from "./styles/lib/components/Stepper/Stepper.css.mjs";
|
|
41
41
|
import { tab, cropToIconX, hoveredTab, tabFocusRing, scroll as scroll$1, nowrap, mask, marginAuto, divider, tabUnderline, tabUnderlineActiveDarkMode, underlineLeft, underlineWidth, tabPanel, tabPanelFocusRing } from "./styles/lib/components/Tabs/Tabs.css.mjs";
|
|
@@ -44,10 +44,10 @@ import { clearGutter } from "./styles/lib/components/Tag/Tag.css.mjs";
|
|
|
44
44
|
import { root as root$4, caution, critical } from "./styles/lib/components/Textarea/Highlight/Highlight.css.mjs";
|
|
45
45
|
import { highlights, field as field$2 } from "./styles/lib/components/Textarea/Textarea.css.mjs";
|
|
46
46
|
import { select, focusOverlay as focusOverlay$3 } from "./styles/lib/components/TextDropdown/TextDropdown.css.mjs";
|
|
47
|
-
import { root as root$1, up, left, right } from "./styles/lib/components/icons/IconChevron/IconChevron.css.mjs";
|
|
48
|
-
import { secondaryIconSpace, field, placeholderColor, iconSpace, verticalDivider, hideBorderOnDarkBackgroundInLightMode, focusOverlay, hoverOverlay } from "./styles/lib/components/private/Field/Field.css.mjs";
|
|
49
47
|
import { columnsWide, columnsDesktop, columnsTablet, columnsMobile } from "./styles/lib/components/Tiles/Tiles.css.mjs";
|
|
50
48
|
import { root as root$5, realField as realField$1, realFieldPosition, fieldSize, slideContainer, slideContainerSize, slideTrack, slideTrackMask, slideTrackBgLightMode, slideTrackBgDarkMode, slideTrackSelected, slider, hideBorderOnDarkBackgroundInLightMode as hideBorderOnDarkBackgroundInLightMode$2, icon as icon$1, focusOverlay as focusOverlay$4, hoverOverlay as hoverOverlay$2, label } from "./styles/lib/components/Toggle/Toggle.css.mjs";
|
|
49
|
+
import { root, rotate, flip, mirror } from "./styles/lib/components/icons/IconArrow/IconArrow.css.mjs";
|
|
50
|
+
import { root as root$2, down } from "./styles/lib/components/icons/IconThumb/IconThumb.css.mjs";
|
|
51
51
|
const ThemeNameConsumer = ({ children: children2 }) => children2(useThemeName());
|
|
52
52
|
const useColor = () => useBraidTheme().color;
|
|
53
53
|
const useBreakpoint = () => {
|
|
@@ -4293,35 +4293,68 @@ const Heading = ({
|
|
|
4293
4293
|
]
|
|
4294
4294
|
}
|
|
4295
4295
|
) });
|
|
4296
|
-
const
|
|
4296
|
+
const validPageBlockComponents = [
|
|
4297
|
+
"div",
|
|
4298
|
+
"article",
|
|
4299
|
+
"aside",
|
|
4300
|
+
"main",
|
|
4301
|
+
"section",
|
|
4302
|
+
"nav"
|
|
4303
|
+
];
|
|
4304
|
+
const gutters = { mobile: "xsmall", tablet: "gutter" };
|
|
4305
|
+
const PageBlock = ({
|
|
4306
|
+
children: children2,
|
|
4307
|
+
width: width2 = "large",
|
|
4308
|
+
component: componentProp,
|
|
4309
|
+
data,
|
|
4310
|
+
...restProps
|
|
4311
|
+
}) => {
|
|
4312
|
+
const component = componentProp && validPageBlockComponents.includes(componentProp) ? componentProp : "div";
|
|
4313
|
+
return /* @__PURE__ */ jsx(
|
|
4314
|
+
Box,
|
|
4315
|
+
{
|
|
4316
|
+
component,
|
|
4317
|
+
paddingX: gutters,
|
|
4318
|
+
...buildDataAttributes({ data, validateRestProps: restProps }),
|
|
4319
|
+
children: /* @__PURE__ */ jsx(ContentBlock, { width: width2, children: children2 })
|
|
4320
|
+
}
|
|
4321
|
+
);
|
|
4322
|
+
};
|
|
4323
|
+
const modalPadding = { mobile: "gutter", tablet: "large" };
|
|
4297
4324
|
const ModalContentHeader = forwardRef(
|
|
4298
|
-
({ title, headingLevel, description, descriptionId, center }, ref) => /* @__PURE__ */ jsxs(
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
{
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
+
({ title, headingLevel, description, descriptionId, center }, ref) => /* @__PURE__ */ jsxs(
|
|
4326
|
+
Stack,
|
|
4327
|
+
{
|
|
4328
|
+
space: headingLevel === "2" ? { mobile: "small", tablet: "medium" } : "small",
|
|
4329
|
+
children: [
|
|
4330
|
+
/* @__PURE__ */ jsx(Heading, { level: headingLevel, align: center ? "center" : void 0, children: /* @__PURE__ */ jsxs(
|
|
4331
|
+
Box,
|
|
4332
|
+
{
|
|
4333
|
+
ref,
|
|
4334
|
+
component: "span",
|
|
4335
|
+
tabIndex: -1,
|
|
4336
|
+
outline: "none",
|
|
4337
|
+
position: "relative",
|
|
4338
|
+
className: headingRoot,
|
|
4339
|
+
children: [
|
|
4340
|
+
title,
|
|
4341
|
+
/* @__PURE__ */ jsx(
|
|
4342
|
+
Overlay,
|
|
4343
|
+
{
|
|
4344
|
+
boxShadow: "outlineFocus",
|
|
4345
|
+
borderRadius: "standard",
|
|
4346
|
+
transition: "fast",
|
|
4347
|
+
className: headingFocus,
|
|
4348
|
+
onlyVisibleForKeyboardNavigation: true
|
|
4349
|
+
}
|
|
4350
|
+
)
|
|
4351
|
+
]
|
|
4352
|
+
}
|
|
4353
|
+
) }),
|
|
4354
|
+
description ? /* @__PURE__ */ jsx(Box, { id: descriptionId, children: description }) : null
|
|
4355
|
+
]
|
|
4356
|
+
}
|
|
4357
|
+
)
|
|
4325
4358
|
);
|
|
4326
4359
|
const ModalContent = ({
|
|
4327
4360
|
id,
|
|
@@ -4389,7 +4422,8 @@ const ModalContent = ({
|
|
|
4389
4422
|
boxShadow: "large",
|
|
4390
4423
|
width: width2 !== "content" ? "full" : void 0,
|
|
4391
4424
|
height: position === "right" || position === "left" ? "full" : void 0,
|
|
4392
|
-
|
|
4425
|
+
paddingY: modalPadding,
|
|
4426
|
+
paddingX: position !== "center" ? gutters : modalPadding,
|
|
4393
4427
|
className: [
|
|
4394
4428
|
pointerEventsAll,
|
|
4395
4429
|
position === "center" && maxSize[position]
|
|
@@ -4438,15 +4472,14 @@ const ModalContent = ({
|
|
|
4438
4472
|
display: "flex",
|
|
4439
4473
|
justifyContent: "flexEnd",
|
|
4440
4474
|
paddingTop: modalPadding,
|
|
4441
|
-
paddingRight: modalPadding,
|
|
4475
|
+
paddingRight: position !== "center" ? gutters : modalPadding,
|
|
4442
4476
|
className: position === "center" && maxSize[position],
|
|
4443
|
-
children: /* @__PURE__ */ jsx(
|
|
4477
|
+
children: /* @__PURE__ */ jsx(
|
|
4444
4478
|
Box,
|
|
4445
4479
|
{
|
|
4446
4480
|
position: "relative",
|
|
4447
4481
|
background: "surface",
|
|
4448
4482
|
borderRadius: "full",
|
|
4449
|
-
padding: "xsmall",
|
|
4450
4483
|
className: [closeIconOffset, pointerEventsAll],
|
|
4451
4484
|
children: /* @__PURE__ */ jsx(
|
|
4452
4485
|
ButtonIcon,
|
|
@@ -4461,7 +4494,7 @@ const ModalContent = ({
|
|
|
4461
4494
|
}
|
|
4462
4495
|
)
|
|
4463
4496
|
}
|
|
4464
|
-
)
|
|
4497
|
+
)
|
|
4465
4498
|
}
|
|
4466
4499
|
)
|
|
4467
4500
|
]
|
|
@@ -4554,24 +4587,28 @@ const Modal = ({
|
|
|
4554
4587
|
const closeHandlerRef = useRef(onClose);
|
|
4555
4588
|
const initiateClose = () => {
|
|
4556
4589
|
if (allowClose) {
|
|
4557
|
-
|
|
4590
|
+
const result = closeHandlerRef.current(false);
|
|
4591
|
+
if (result === false) {
|
|
4592
|
+
return result;
|
|
4593
|
+
}
|
|
4594
|
+
if (openRef.current) {
|
|
4595
|
+
dispatch(CLOSE_MODAL);
|
|
4596
|
+
}
|
|
4558
4597
|
}
|
|
4559
4598
|
};
|
|
4560
4599
|
useEffect(() => {
|
|
4561
4600
|
openRef.current = open;
|
|
4562
4601
|
dispatch(open ? OPEN_MODAL : CLOSE_MODAL);
|
|
4563
4602
|
}, [open]);
|
|
4603
|
+
const closing = state === CLOSING;
|
|
4564
4604
|
useEffect(() => {
|
|
4565
|
-
if (
|
|
4605
|
+
if (closing) {
|
|
4566
4606
|
const timer = setTimeout(() => {
|
|
4567
4607
|
dispatch(ANIMATION_COMPLETE);
|
|
4568
4608
|
}, ANIMATION_DURATION);
|
|
4569
4609
|
return () => clearTimeout(timer);
|
|
4570
4610
|
}
|
|
4571
|
-
|
|
4572
|
-
closeHandlerRef.current(false);
|
|
4573
|
-
}
|
|
4574
|
-
}, [state]);
|
|
4611
|
+
}, [closing]);
|
|
4575
4612
|
const shouldAriaHideOthers = state === OPEN || state === CLOSING;
|
|
4576
4613
|
useEffect(() => {
|
|
4577
4614
|
if (shouldAriaHideOthers && modalRef.current) {
|
|
@@ -4638,7 +4675,7 @@ const Modal = ({
|
|
|
4638
4675
|
padding: position === "center" ? externalGutter : void 0,
|
|
4639
4676
|
className: [
|
|
4640
4677
|
modalContainer,
|
|
4641
|
-
position === "left" || position === "right" && horiztontalTransition,
|
|
4678
|
+
(position === "left" || position === "right") && horiztontalTransition,
|
|
4642
4679
|
state === OPENING && entrance[position],
|
|
4643
4680
|
state === CLOSING && position in exit && exit[position]
|
|
4644
4681
|
],
|
|
@@ -5899,33 +5936,6 @@ const Notice = ({
|
|
|
5899
5936
|
}
|
|
5900
5937
|
);
|
|
5901
5938
|
};
|
|
5902
|
-
const validPageBlockComponents = [
|
|
5903
|
-
"div",
|
|
5904
|
-
"article",
|
|
5905
|
-
"aside",
|
|
5906
|
-
"main",
|
|
5907
|
-
"section",
|
|
5908
|
-
"nav"
|
|
5909
|
-
];
|
|
5910
|
-
const gutters = { mobile: "xsmall", tablet: "gutter" };
|
|
5911
|
-
const PageBlock = ({
|
|
5912
|
-
children: children2,
|
|
5913
|
-
width: width2 = "large",
|
|
5914
|
-
component: componentProp,
|
|
5915
|
-
data,
|
|
5916
|
-
...restProps
|
|
5917
|
-
}) => {
|
|
5918
|
-
const component = componentProp && validPageBlockComponents.includes(componentProp) ? componentProp : "div";
|
|
5919
|
-
return /* @__PURE__ */ jsx(
|
|
5920
|
-
Box,
|
|
5921
|
-
{
|
|
5922
|
-
component,
|
|
5923
|
-
paddingX: gutters,
|
|
5924
|
-
...buildDataAttributes({ data, validateRestProps: restProps }),
|
|
5925
|
-
children: /* @__PURE__ */ jsx(ContentBlock, { width: width2, children: children2 })
|
|
5926
|
-
}
|
|
5927
|
-
);
|
|
5928
|
-
};
|
|
5929
5939
|
const paginate = ({
|
|
5930
5940
|
page,
|
|
5931
5941
|
total,
|