braid-design-system 32.1.1 → 32.3.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 +214 -0
- package/codemod/dist/wrapper.js +1315 -21130
- package/dist/ToastContext.chunk.cjs +71 -99
- package/dist/ToastContext.chunk.mjs +117 -145
- package/dist/Toggle.chunk.cjs +70 -49
- package/dist/Toggle.chunk.mjs +80 -59
- package/dist/reset.d.ts +212 -95
- package/dist/side-effects/lib/themes/baseTokens/apac.cjs +7 -8
- package/dist/side-effects/lib/themes/baseTokens/apac.mjs +6 -8
- package/dist/side-effects/lib/themes/makeRuntimeTokens.cjs +3 -9
- package/dist/side-effects/lib/themes/makeRuntimeTokens.mjs +3 -8
- package/dist/side-effects/lib/themes/tokenType.cjs +15 -0
- package/dist/side-effects/lib/themes/tokenType.mjs +16 -0
- package/dist/styles/lib/components/Button/Button.css.cjs +24 -23
- package/dist/styles/lib/components/Button/Button.css.mjs +25 -24
- package/dist/styles/lib/components/Stepper/Stepper.css.cjs +8 -7
- package/dist/styles/lib/components/Stepper/Stepper.css.mjs +8 -7
- package/dist/styles/lib/components/Textarea/Highlight/Highlight.css.cjs +34 -3
- package/dist/styles/lib/components/Textarea/Highlight/Highlight.css.mjs +34 -3
- package/dist/styles/lib/components/TooltipRenderer/TooltipRenderer.css.cjs +1 -9
- package/dist/styles/lib/components/TooltipRenderer/TooltipRenderer.css.mjs +1 -9
- package/dist/styles/lib/components/private/Keyline/Keyline.css.cjs +4 -0
- package/dist/styles/lib/components/private/Keyline/Keyline.css.mjs +5 -1
- package/dist/styles/lib/css/atoms/atomicProperties.cjs +2 -0
- package/dist/styles/lib/css/atoms/atomicProperties.mjs +2 -0
- package/dist/styles/lib/css/negativeMargin/negativeMargin.css.cjs +4 -9
- package/dist/styles/lib/css/negativeMargin/negativeMargin.css.mjs +1 -6
- package/dist/styles/lib/css/typography.css.cjs +1 -16
- package/dist/styles/lib/css/typography.css.mjs +1 -16
- package/dist/styles/lib/themes/docs/tokens.cjs +8 -8
- package/dist/styles/lib/themes/docs/tokens.mjs +6 -8
- package/dist/styles/lib/themes/makeVanillaTheme.cjs +22 -9
- package/dist/styles/lib/themes/makeVanillaTheme.mjs +22 -9
- package/dist/styles/lib/themes/wireframe/tokens.cjs +25 -29
- package/dist/styles/lib/themes/wireframe/tokens.mjs +23 -29
- package/package.json +4 -3
- package/dist/styles/lib/components/Badge/Badge.css.cjs +0 -27
- package/dist/styles/lib/components/Badge/Badge.css.mjs +0 -28
package/dist/Toggle.chunk.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useThemeName, useResponsiveValue, Stack, Box, buildDataAttributes, Divider, useIcon, virtualTouchable, Columns, Column, Inline, Text, Overlay, ActionsContext, useBackground, iconContainerSize, IconClear,
|
|
1
|
+
import { useThemeName, useResponsiveValue, Stack, Box, buildDataAttributes, Divider, useIcon, virtualTouchable, Columns, Column, Inline, Text, Overlay, ActionsContext, useBackground, iconContainerSize, IconClear, IconPositive, IconCritical, TextContext, HeadingContext, textStyles, FieldOverlay, ButtonIcon, Bleed, useColoredBoxClasses, BackgroundProvider, ButtonContainer, useButtonStyles, ButtonOverlays, ButtonText, useBackgroundLightness, resolveResponsiveRangeProps, optimizeResponsiveArray, Typography, BraidPortal, TextLinkButton, AvoidWidowIcon, useDefaultTextProps, flattenChildren, DefaultTextPropsProvider, iconSize, Hidden, useSpace, negativeMargin, resolveResponsiveProp } from "./ToastContext.chunk.mjs";
|
|
2
2
|
import { useBraidTheme, useLinkComponent } from "./side-effects/lib/components/BraidProvider/BraidProvider.mjs";
|
|
3
3
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
4
4
|
import assert from "assert";
|
|
@@ -19,16 +19,16 @@ import { fontWeight, tone, touchableText, fontFamily, headingWeight, heading } f
|
|
|
19
19
|
import { RemoveScroll } from "react-remove-scroll";
|
|
20
20
|
import { backdrop, backdropVisible, menu, groupHeading } from "./styles/lib/components/Autosuggest/Autosuggest.css.mjs";
|
|
21
21
|
import matchHighlights from "autosuggest-highlight/match/index.js";
|
|
22
|
-
import { lineHeightContainer } from "./styles/lib/css/lineHeightContainer.css.mjs";
|
|
23
|
-
import { constants, bleedY } from "./styles/lib/components/Badge/Badge.css.mjs";
|
|
24
22
|
import clsx from "clsx";
|
|
23
|
+
import { noRadiusOnRight, largestWidth, width, tone as tone$1, lightMode, darkMode } from "./styles/lib/components/private/Keyline/Keyline.css.mjs";
|
|
25
24
|
import FocusLock from "react-focus-lock";
|
|
26
25
|
import { externalGutter } from "./styles/lib/components/private/Modal/ModalExternalGutter.mjs";
|
|
27
26
|
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";
|
|
27
|
+
import { lineHeightContainer } from "./styles/lib/css/lineHeightContainer.css.mjs";
|
|
28
28
|
import { currentColor, size, minCharacterWidth, trimGutter } from "./styles/lib/components/List/List.css.mjs";
|
|
29
29
|
import { rootSize, delay, size as size$1, currentColor as currentColor$1, circle } from "./styles/lib/components/Loader/Loader.css.mjs";
|
|
30
30
|
import { menuItem } from "./styles/lib/components/MenuItem/useMenuItem.css.mjs";
|
|
31
|
-
import { backdrop as backdrop$2, menuIsClosed, width, placementBottom } from "./styles/lib/components/MenuRenderer/MenuRenderer.css.mjs";
|
|
31
|
+
import { backdrop as backdrop$2, menuIsClosed, width as width$1, placementBottom } from "./styles/lib/components/MenuRenderer/MenuRenderer.css.mjs";
|
|
32
32
|
import { triggerOffset } from "./styles/lib/components/OverflowMenu/OverflowMenu.css.mjs";
|
|
33
33
|
import { isMobile } from "is-mobile";
|
|
34
34
|
import { field as field$1 } from "./styles/lib/components/Dropdown/Dropdown.css.mjs";
|
|
@@ -36,11 +36,11 @@ import { nativeInput } from "./styles/lib/components/MonthPicker/MonthPicker.css
|
|
|
36
36
|
import { hover, background, current, lightModeCurrentKeyline, darkModeCurrentKeyline } from "./styles/lib/components/Pagination/Pagination.css.mjs";
|
|
37
37
|
import { realField, realFieldPosition, isMixed, fakeField, fakeFieldSize, selected, focusOverlay as focusOverlay$1, hoverOverlay as hoverOverlay$1, checkboxIndicator, radioIndicator, root as root$4, labelOffset, badgeOffset, children } from "./styles/lib/components/private/InlineField/InlineField.css.mjs";
|
|
38
38
|
import { starSpacing, textSpacing, lightModeStarColor, darkModeStarColor } from "./styles/lib/components/Rating/Rating.css.mjs";
|
|
39
|
-
import { step, tone as tone$
|
|
39
|
+
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";
|
|
40
40
|
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";
|
|
41
41
|
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
42
42
|
import { clearGutter } from "./styles/lib/components/Tag/Tag.css.mjs";
|
|
43
|
-
import { root as root$5 } from "./styles/lib/components/Textarea/Highlight/Highlight.css.mjs";
|
|
43
|
+
import { root as root$5, caution, critical } from "./styles/lib/components/Textarea/Highlight/Highlight.css.mjs";
|
|
44
44
|
import { highlights, field as field$2 } from "./styles/lib/components/Textarea/Textarea.css.mjs";
|
|
45
45
|
import { select, focusOverlay as focusOverlay$3 } from "./styles/lib/components/TextDropdown/TextDropdown.css.mjs";
|
|
46
46
|
import { root as root$1, up, left, right } from "./styles/lib/components/icons/IconChevron/IconChevron.css.mjs";
|
|
@@ -2261,7 +2261,8 @@ const Alert = ({
|
|
|
2261
2261
|
{
|
|
2262
2262
|
id,
|
|
2263
2263
|
background: backgroundForTone[tone2],
|
|
2264
|
-
|
|
2264
|
+
paddingY: "medium",
|
|
2265
|
+
paddingX: "gutter",
|
|
2265
2266
|
borderRadius: borderRadius$3,
|
|
2266
2267
|
position: "relative",
|
|
2267
2268
|
overflow: "hidden",
|
|
@@ -2335,8 +2336,7 @@ const Alert = ({
|
|
|
2335
2336
|
boxShadow: { lightMode: borderForTone[tone2] },
|
|
2336
2337
|
visible: true
|
|
2337
2338
|
}
|
|
2338
|
-
)
|
|
2339
|
-
/* @__PURE__ */ jsx(Keyline, { tone: tone2, borderRadius: borderRadius$3 })
|
|
2339
|
+
)
|
|
2340
2340
|
]
|
|
2341
2341
|
}
|
|
2342
2342
|
);
|
|
@@ -2449,10 +2449,11 @@ const FieldLabel = ({
|
|
|
2449
2449
|
description ? /* @__PURE__ */ jsx(Box, { paddingTop: label2 ? "xxsmall" : void 0, paddingBottom: "xxsmall", children: /* @__PURE__ */ jsx(Text, { tone: "secondary", id: descriptionId, children: description }) }) : null
|
|
2450
2450
|
] });
|
|
2451
2451
|
};
|
|
2452
|
-
const tones$1 = ["neutral", "critical", "positive"];
|
|
2452
|
+
const tones$1 = ["neutral", "critical", "positive", "caution"];
|
|
2453
2453
|
const icon = {
|
|
2454
2454
|
critical: /* @__PURE__ */ jsx(IconCritical, { tone: "critical" }),
|
|
2455
|
-
positive: /* @__PURE__ */ jsx(IconPositive, { tone: "positive" })
|
|
2455
|
+
positive: /* @__PURE__ */ jsx(IconPositive, { tone: "positive" }),
|
|
2456
|
+
caution: /* @__PURE__ */ jsx(IconCaution, { tone: "caution" })
|
|
2456
2457
|
};
|
|
2457
2458
|
const FieldMessage = ({
|
|
2458
2459
|
id,
|
|
@@ -2549,7 +2550,7 @@ const Field = ({
|
|
|
2549
2550
|
}
|
|
2550
2551
|
),
|
|
2551
2552
|
/* @__PURE__ */ jsx(FieldOverlay, { variant: "focus", className: focusOverlay }),
|
|
2552
|
-
/* @__PURE__ */ jsx(FieldOverlay, { variant: "
|
|
2553
|
+
/* @__PURE__ */ jsx(FieldOverlay, { variant: "formAccent", className: hoverOverlay })
|
|
2553
2554
|
] });
|
|
2554
2555
|
const fieldPadding = "small";
|
|
2555
2556
|
return /* @__PURE__ */ jsxs(Stack, { space: "xsmall", children: [
|
|
@@ -3026,7 +3027,6 @@ function GroupHeading({ children: children2 }) {
|
|
|
3026
3027
|
Box,
|
|
3027
3028
|
{
|
|
3028
3029
|
paddingX: "small",
|
|
3029
|
-
borderRadius: "standard",
|
|
3030
3030
|
className: [
|
|
3031
3031
|
groupHeading,
|
|
3032
3032
|
touchableText.xsmall,
|
|
@@ -3590,11 +3590,12 @@ const lightModeBackgroundForTone = {
|
|
|
3590
3590
|
neutral: "neutralLight",
|
|
3591
3591
|
caution: "cautionLight"
|
|
3592
3592
|
};
|
|
3593
|
+
const verticalPadding = "xxsmall";
|
|
3593
3594
|
const Badge = forwardRef(
|
|
3594
3595
|
({
|
|
3595
3596
|
tone: tone2 = "info",
|
|
3596
3597
|
weight = "regular",
|
|
3597
|
-
bleedY
|
|
3598
|
+
bleedY = false,
|
|
3598
3599
|
title,
|
|
3599
3600
|
children: children2,
|
|
3600
3601
|
id,
|
|
@@ -3613,16 +3614,12 @@ const Badge = forwardRef(
|
|
|
3613
3614
|
),
|
|
3614
3615
|
"Badge may only contain strings or numbers"
|
|
3615
3616
|
);
|
|
3616
|
-
|
|
3617
|
+
const content = /* @__PURE__ */ jsx(
|
|
3617
3618
|
Box,
|
|
3618
3619
|
{
|
|
3619
3620
|
component: "span",
|
|
3620
3621
|
display: "flex",
|
|
3621
3622
|
cursor: "default",
|
|
3622
|
-
className: [
|
|
3623
|
-
lineHeightContainer[constants.textSize],
|
|
3624
|
-
bleedY$1 ? bleedY : null
|
|
3625
|
-
],
|
|
3626
3623
|
...buildDataAttributes({ data, validateRestProps: restProps }),
|
|
3627
3624
|
children: /* @__PURE__ */ jsx(
|
|
3628
3625
|
Box,
|
|
@@ -3634,23 +3631,16 @@ const Badge = forwardRef(
|
|
|
3634
3631
|
"aria-describedby": ariaDescribedBy,
|
|
3635
3632
|
title: title ?? (!ariaDescribedBy ? children2 : void 0),
|
|
3636
3633
|
background: weight === "strong" ? tone2 : lightModeBackgroundForTone[tone2],
|
|
3634
|
+
paddingY: verticalPadding,
|
|
3637
3635
|
paddingX: "xsmall",
|
|
3638
|
-
borderRadius: "
|
|
3636
|
+
borderRadius: "standard",
|
|
3639
3637
|
overflow: "hidden",
|
|
3640
|
-
children: /* @__PURE__ */ jsx(
|
|
3641
|
-
Text,
|
|
3642
|
-
{
|
|
3643
|
-
size: constants.textSize,
|
|
3644
|
-
weight: "medium",
|
|
3645
|
-
truncate: true,
|
|
3646
|
-
baseline: false,
|
|
3647
|
-
children: children2
|
|
3648
|
-
}
|
|
3649
|
-
)
|
|
3638
|
+
children: /* @__PURE__ */ jsx(Text, { size: "xsmall", weight: "medium", truncate: true, children: children2 })
|
|
3650
3639
|
}
|
|
3651
3640
|
)
|
|
3652
3641
|
}
|
|
3653
3642
|
);
|
|
3643
|
+
return bleedY ? /* @__PURE__ */ jsx(Bleed, { component: "span", vertical: verticalPadding, children: content }) : content;
|
|
3654
3644
|
}
|
|
3655
3645
|
);
|
|
3656
3646
|
Badge.displayName = "Badge";
|
|
@@ -3693,7 +3683,7 @@ const ButtonLink = forwardRef(
|
|
|
3693
3683
|
size: size2,
|
|
3694
3684
|
tone: tone2,
|
|
3695
3685
|
variant,
|
|
3696
|
-
bleedY
|
|
3686
|
+
bleedY,
|
|
3697
3687
|
bleed,
|
|
3698
3688
|
icon: icon2,
|
|
3699
3689
|
iconPosition,
|
|
@@ -3703,7 +3693,7 @@ const ButtonLink = forwardRef(
|
|
|
3703
3693
|
}, ref) => {
|
|
3704
3694
|
const LinkComponent = useLinkComponent(ref);
|
|
3705
3695
|
if (process.env.NODE_ENV !== "production") {
|
|
3706
|
-
if (typeof
|
|
3696
|
+
if (typeof bleedY !== "undefined") {
|
|
3707
3697
|
console.warn(
|
|
3708
3698
|
dedent`
|
|
3709
3699
|
The "bleedY" prop has been deprecated and will be removed in a future version. Use "bleed" instead.
|
|
@@ -3729,7 +3719,7 @@ const ButtonLink = forwardRef(
|
|
|
3729
3719
|
variant,
|
|
3730
3720
|
tone: tone2,
|
|
3731
3721
|
size: size2,
|
|
3732
|
-
bleed: bleed ||
|
|
3722
|
+
bleed: bleed || bleedY,
|
|
3733
3723
|
loading
|
|
3734
3724
|
}),
|
|
3735
3725
|
children: [
|
|
@@ -3753,6 +3743,36 @@ const ButtonLink = forwardRef(
|
|
|
3753
3743
|
}
|
|
3754
3744
|
);
|
|
3755
3745
|
ButtonLink.displayName = "ButtonLink";
|
|
3746
|
+
const Keyline = ({ tone: tone2, borderRadius: borderRadius2 }) => {
|
|
3747
|
+
const backgroundLightness = useBackgroundLightness();
|
|
3748
|
+
return /* @__PURE__ */ jsx(
|
|
3749
|
+
Box,
|
|
3750
|
+
{
|
|
3751
|
+
component: "span",
|
|
3752
|
+
position: "absolute",
|
|
3753
|
+
top: 0,
|
|
3754
|
+
bottom: 0,
|
|
3755
|
+
left: 0,
|
|
3756
|
+
overflow: "hidden",
|
|
3757
|
+
borderRadius: borderRadius2,
|
|
3758
|
+
className: [noRadiusOnRight, largestWidth],
|
|
3759
|
+
children: /* @__PURE__ */ jsx(
|
|
3760
|
+
Box,
|
|
3761
|
+
{
|
|
3762
|
+
component: "span",
|
|
3763
|
+
height: "full",
|
|
3764
|
+
display: "inlineBlock",
|
|
3765
|
+
className: [
|
|
3766
|
+
width,
|
|
3767
|
+
tone$1[tone2],
|
|
3768
|
+
lightMode[backgroundLightness.lightMode],
|
|
3769
|
+
darkMode[backgroundLightness.darkMode]
|
|
3770
|
+
]
|
|
3771
|
+
}
|
|
3772
|
+
)
|
|
3773
|
+
}
|
|
3774
|
+
);
|
|
3775
|
+
};
|
|
3756
3776
|
const validCardComponents = [
|
|
3757
3777
|
"div",
|
|
3758
3778
|
"article",
|
|
@@ -3761,7 +3781,7 @@ const validCardComponents = [
|
|
|
3761
3781
|
"main",
|
|
3762
3782
|
"section"
|
|
3763
3783
|
];
|
|
3764
|
-
const borderRadius$2 = "
|
|
3784
|
+
const borderRadius$2 = "large";
|
|
3765
3785
|
const Card = ({
|
|
3766
3786
|
children: children2,
|
|
3767
3787
|
component = "div",
|
|
@@ -3889,6 +3909,7 @@ const StyledInput = forwardRef(
|
|
|
3889
3909
|
const accentBackground = disabled ? "neutralLight" : "formAccent";
|
|
3890
3910
|
const isMixed$1 = isCheckbox && checked === "mixed";
|
|
3891
3911
|
const fieldBackground = disabled ? { lightMode: "neutralSoft", darkMode: "neutral" } : { lightMode: "surface" };
|
|
3912
|
+
const defaultBorder = checked ? "formAccent" : "default";
|
|
3892
3913
|
useEffect(() => {
|
|
3893
3914
|
if (ref && typeof ref === "object" && ref.current && isCheckbox) {
|
|
3894
3915
|
ref.current.indeterminate = isMixed$1;
|
|
@@ -3945,7 +3966,7 @@ const StyledInput = forwardRef(
|
|
|
3945
3966
|
/* @__PURE__ */ jsx(
|
|
3946
3967
|
FieldOverlay,
|
|
3947
3968
|
{
|
|
3948
|
-
variant: disabled ? "disabled" :
|
|
3969
|
+
variant: disabled ? "disabled" : defaultBorder,
|
|
3949
3970
|
borderRadius: fieldBorderRadius,
|
|
3950
3971
|
visible: tone2 !== "critical" || disabled
|
|
3951
3972
|
}
|
|
@@ -3979,7 +4000,7 @@ const StyledInput = forwardRef(
|
|
|
3979
4000
|
/* @__PURE__ */ jsx(
|
|
3980
4001
|
FieldOverlay,
|
|
3981
4002
|
{
|
|
3982
|
-
variant: "
|
|
4003
|
+
variant: "formAccent",
|
|
3983
4004
|
borderRadius: fieldBorderRadius,
|
|
3984
4005
|
className: hoverOverlay$1,
|
|
3985
4006
|
children: /* @__PURE__ */ jsx(Indicator, { type, hover: true, checked: true })
|
|
@@ -4220,7 +4241,7 @@ const Heading = ({
|
|
|
4220
4241
|
) });
|
|
4221
4242
|
const modalPadding = ["gutter", "large"];
|
|
4222
4243
|
const ModalContentHeader = forwardRef(
|
|
4223
|
-
({ title, headingLevel, description, descriptionId, center }, ref) => /* @__PURE__ */ jsxs(Stack, { space: "
|
|
4244
|
+
({ title, headingLevel, description, descriptionId, center }, ref) => /* @__PURE__ */ jsxs(Stack, { space: "small", children: [
|
|
4224
4245
|
/* @__PURE__ */ jsx(Heading, { level: headingLevel, align: center ? "center" : void 0, children: /* @__PURE__ */ jsxs(
|
|
4225
4246
|
Box,
|
|
4226
4247
|
{
|
|
@@ -5183,7 +5204,7 @@ const borderRadius$1 = "large";
|
|
|
5183
5204
|
function Menu({
|
|
5184
5205
|
offsetSpace,
|
|
5185
5206
|
align,
|
|
5186
|
-
width:
|
|
5207
|
+
width: width2,
|
|
5187
5208
|
placement,
|
|
5188
5209
|
children: children2,
|
|
5189
5210
|
open,
|
|
@@ -5208,9 +5229,10 @@ function Menu({
|
|
|
5208
5229
|
transition: "fast",
|
|
5209
5230
|
right: align === "right" ? 0 : void 0,
|
|
5210
5231
|
opacity: !open ? 0 : void 0,
|
|
5232
|
+
overflow: "hidden",
|
|
5211
5233
|
className: [
|
|
5212
5234
|
!open && menuIsClosed,
|
|
5213
|
-
|
|
5235
|
+
width2 !== "content" && width$1[width2],
|
|
5214
5236
|
placement === "top" && placementBottom
|
|
5215
5237
|
],
|
|
5216
5238
|
children: [
|
|
@@ -5840,7 +5862,7 @@ const paginate = ({
|
|
|
5840
5862
|
}
|
|
5841
5863
|
return Array.from(Array(pageCount).keys()).map((p) => p + minPage);
|
|
5842
5864
|
};
|
|
5843
|
-
const borderRadius = "
|
|
5865
|
+
const borderRadius = "standard";
|
|
5844
5866
|
const PageNav = ({
|
|
5845
5867
|
label: label2,
|
|
5846
5868
|
direction
|
|
@@ -6608,7 +6630,7 @@ const Step = ({ complete: complete2 = false, id, children: children2 }) => {
|
|
|
6608
6630
|
cursor: interactable ? "pointer" : void 0,
|
|
6609
6631
|
pointerEvents: !interactable && !active2 ? "none" : void 0,
|
|
6610
6632
|
"aria-current": active2 ? "step" : void 0,
|
|
6611
|
-
className: [step, tone$
|
|
6633
|
+
className: [step, tone$2[tone2]],
|
|
6612
6634
|
onClick: interactable ? () => {
|
|
6613
6635
|
if (onClick) {
|
|
6614
6636
|
onClick(stepNumber);
|
|
@@ -7510,17 +7532,9 @@ const Tag = ({
|
|
|
7510
7532
|
}
|
|
7511
7533
|
);
|
|
7512
7534
|
};
|
|
7513
|
-
const
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
component: "mark",
|
|
7517
|
-
borderRadius: "standard",
|
|
7518
|
-
background: { lightMode: "criticalLight", darkMode: "critical" },
|
|
7519
|
-
className: root$5,
|
|
7520
|
-
children: children2
|
|
7521
|
-
}
|
|
7522
|
-
);
|
|
7523
|
-
const formatRanges = (value, highlightRanges) => {
|
|
7535
|
+
const styleForTone = { caution, critical };
|
|
7536
|
+
const Highlight = ({ children: children2, tone: tone2 }) => /* @__PURE__ */ jsx(Box, { component: "mark", className: [root$5, styleForTone[tone2]], children: children2 });
|
|
7537
|
+
const formatRanges = (value, highlightRanges, tone2) => {
|
|
7524
7538
|
if (highlightRanges && value) {
|
|
7525
7539
|
let lastEnd = 0;
|
|
7526
7540
|
const validatedAndSortedRanges = highlightRanges.sort((a, b) => a.start > b.start ? 1 : -1).reduce((acc, { end, start }) => {
|
|
@@ -7547,7 +7561,9 @@ const formatRanges = (value, highlightRanges) => {
|
|
|
7547
7561
|
])
|
|
7548
7562
|
).reduce((acc, { text, highlight: highlight2 }, i) => {
|
|
7549
7563
|
if (text) {
|
|
7550
|
-
acc.push(
|
|
7564
|
+
acc.push(
|
|
7565
|
+
highlight2 ? /* @__PURE__ */ jsx(Highlight, { tone: tone2, children: text }, i) : text
|
|
7566
|
+
);
|
|
7551
7567
|
}
|
|
7552
7568
|
return acc;
|
|
7553
7569
|
}, []);
|
|
@@ -7594,6 +7610,8 @@ const Textarea = forwardRef(
|
|
|
7594
7610
|
lines = 3,
|
|
7595
7611
|
lineLimit,
|
|
7596
7612
|
grow = true,
|
|
7613
|
+
tone: tone2,
|
|
7614
|
+
spellCheck,
|
|
7597
7615
|
...restProps
|
|
7598
7616
|
}, ref) => {
|
|
7599
7617
|
const [rows, setRows] = useState(lines);
|
|
@@ -7607,13 +7625,15 @@ const Textarea = forwardRef(
|
|
|
7607
7625
|
[highlightsRef]
|
|
7608
7626
|
);
|
|
7609
7627
|
const inputLength = String(value).length;
|
|
7610
|
-
const
|
|
7611
|
-
const
|
|
7628
|
+
const hasExceededCharacterLimit = characterLimit && inputLength > characterLimit;
|
|
7629
|
+
const highlightTone = !hasExceededCharacterLimit && (tone2 === "critical" || tone2 === "caution") ? tone2 : "critical";
|
|
7630
|
+
const highlightRanges = hasExceededCharacterLimit ? [{ start: characterLimit }] : highlightRangesProp;
|
|
7612
7631
|
const hasHighlights = highlightRanges.length > 0;
|
|
7613
7632
|
return /* @__PURE__ */ jsx(
|
|
7614
7633
|
Field,
|
|
7615
7634
|
{
|
|
7616
7635
|
...restProps,
|
|
7636
|
+
tone: tone2,
|
|
7617
7637
|
value,
|
|
7618
7638
|
icon: void 0,
|
|
7619
7639
|
prefix: void 0,
|
|
@@ -7644,7 +7664,7 @@ const Textarea = forwardRef(
|
|
|
7644
7664
|
left: 0,
|
|
7645
7665
|
className: [highlights, className],
|
|
7646
7666
|
...fieldProps,
|
|
7647
|
-
children: formatRanges(String(value), highlightRanges)
|
|
7667
|
+
children: formatRanges(String(value), highlightRanges, highlightTone)
|
|
7648
7668
|
}
|
|
7649
7669
|
) : null,
|
|
7650
7670
|
/* @__PURE__ */ jsx(
|
|
@@ -7671,6 +7691,7 @@ const Textarea = forwardRef(
|
|
|
7671
7691
|
onPaste,
|
|
7672
7692
|
onScroll: hasHighlights ? (event) => updateScroll(event.currentTarget.scrollTop) : void 0,
|
|
7673
7693
|
placeholder: !restProps.disabled ? placeholder : void 0,
|
|
7694
|
+
spellCheck,
|
|
7674
7695
|
className: [field$2, className],
|
|
7675
7696
|
...fieldProps,
|
|
7676
7697
|
ref
|
|
@@ -7997,7 +8018,7 @@ const Toggle = forwardRef(
|
|
|
7997
8018
|
{
|
|
7998
8019
|
position: "absolute",
|
|
7999
8020
|
background: "surface",
|
|
8000
|
-
boxShadow: "borderField",
|
|
8021
|
+
boxShadow: on ? "borderFormAccent" : "borderField",
|
|
8001
8022
|
transition: "fast",
|
|
8002
8023
|
display: "flex",
|
|
8003
8024
|
alignItems: "center",
|
|
@@ -8017,9 +8038,9 @@ const Toggle = forwardRef(
|
|
|
8017
8038
|
/* @__PURE__ */ jsx(
|
|
8018
8039
|
FieldOverlay,
|
|
8019
8040
|
{
|
|
8020
|
-
variant: "
|
|
8041
|
+
variant: "formAccent",
|
|
8021
8042
|
borderRadius: "full",
|
|
8022
|
-
className: hoverOverlay$2
|
|
8043
|
+
className: !on ? hoverOverlay$2 : void 0
|
|
8023
8044
|
}
|
|
8024
8045
|
)
|
|
8025
8046
|
]
|