@charcoal-ui/react 3.3.0 → 3.5.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.
Files changed (68) hide show
  1. package/dist/_lib/useForwardedRef.d.ts +3 -0
  2. package/dist/_lib/useForwardedRef.d.ts.map +1 -0
  3. package/dist/components/Clickable/index.d.ts.map +1 -1
  4. package/dist/components/DropdownSelector/DropdownPopover.d.ts.map +1 -1
  5. package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
  6. package/dist/components/DropdownSelector/Popover/usePreventScroll.d.ts +2 -0
  7. package/dist/components/DropdownSelector/Popover/usePreventScroll.d.ts.map +1 -0
  8. package/dist/components/DropdownSelector/index.story.d.ts +1 -0
  9. package/dist/components/DropdownSelector/index.story.d.ts.map +1 -1
  10. package/dist/components/Icon/index.story.d.ts +1 -1
  11. package/dist/components/Modal/Dialog/index.d.ts +26 -0
  12. package/dist/components/Modal/Dialog/index.d.ts.map +1 -0
  13. package/dist/components/Modal/ModalBackgroundContext.d.ts +6 -0
  14. package/dist/components/Modal/ModalBackgroundContext.d.ts.map +1 -0
  15. package/dist/components/Modal/ModalPlumbing.d.ts.map +1 -1
  16. package/dist/components/Modal/__stories__/InternalScrollStory.d.ts +4 -0
  17. package/dist/components/Modal/__stories__/InternalScrollStory.d.ts.map +1 -0
  18. package/dist/components/Modal/index.d.ts +12 -2
  19. package/dist/components/Modal/index.d.ts.map +1 -1
  20. package/dist/components/Modal/index.story.d.ts +3 -2
  21. package/dist/components/Modal/index.story.d.ts.map +1 -1
  22. package/dist/components/TextArea/index.d.ts.map +1 -1
  23. package/dist/components/TextField/index.d.ts +4 -0
  24. package/dist/components/TextField/index.d.ts.map +1 -1
  25. package/dist/components/TextField/useFocusWithClick.d.ts +3 -0
  26. package/dist/components/TextField/useFocusWithClick.d.ts.map +1 -0
  27. package/dist/index.cjs.js +532 -426
  28. package/dist/index.cjs.js.map +1 -1
  29. package/dist/index.esm.js +482 -377
  30. package/dist/index.esm.js.map +1 -1
  31. package/package.json +6 -6
  32. package/src/_lib/useForwardedRef.tsx +16 -0
  33. package/src/components/Button/__snapshots__/index.story.storyshot +1971 -0
  34. package/src/components/Checkbox/__snapshots__/index.story.storyshot +390 -0
  35. package/src/components/Clickable/__snapshots__/index.story.storyshot +100 -0
  36. package/src/components/Clickable/index.tsx +17 -35
  37. package/src/components/DropdownSelector/DropdownPopover.tsx +0 -1
  38. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +245 -0
  39. package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +555 -0
  40. package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +174 -0
  41. package/src/components/DropdownSelector/Popover/index.tsx +17 -2
  42. package/src/components/DropdownSelector/Popover/usePreventScroll.tsx +18 -0
  43. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +1241 -0
  44. package/src/components/DropdownSelector/index.story.tsx +69 -13
  45. package/src/components/Icon/__snapshots__/index.story.storyshot +12 -0
  46. package/src/components/{Button/__snapshots__/index.test.tsx.snap → IconButton/__snapshots__/index.story.storyshot} +94 -91
  47. package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +81 -0
  48. package/src/components/Modal/Dialog/index.tsx +82 -0
  49. package/src/components/Modal/ModalBackgroundContext.tsx +8 -0
  50. package/src/components/Modal/ModalPlumbing.tsx +16 -4
  51. package/src/components/Modal/__snapshots__/index.story.storyshot +533 -0
  52. package/src/components/Modal/__stories__/InternalScrollStory.tsx +75 -0
  53. package/src/components/Modal/index.story.tsx +57 -38
  54. package/src/components/Modal/index.tsx +63 -94
  55. package/src/components/MultiSelect/__snapshots__/index.story.storyshot +511 -0
  56. package/src/components/Radio/__snapshots__/index.story.storyshot +319 -0
  57. package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +483 -0
  58. package/src/components/Switch/__snapshots__/index.story.storyshot +454 -0
  59. package/src/components/TagItem/__snapshots__/index.story.storyshot +1181 -0
  60. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +1114 -0
  61. package/src/components/TextArea/index.tsx +38 -43
  62. package/src/components/TextField/TextField.story.tsx +2 -3
  63. package/src/components/TextField/__snapshots__/TextField.story.storyshot +1603 -0
  64. package/src/components/TextField/index.tsx +86 -84
  65. package/src/components/TextField/useFocusWithClick.tsx +22 -0
  66. package/dist/components/Button/index.test.d.ts +0 -4
  67. package/dist/components/Button/index.test.d.ts.map +0 -1
  68. package/src/components/Button/index.test.tsx +0 -24
package/dist/index.esm.js CHANGED
@@ -81,39 +81,39 @@ var theme = createTheme(styled);
81
81
 
82
82
  // src/components/Clickable/index.tsx
83
83
  import * as React2 from "react";
84
- import styled2, { css } from "styled-components";
84
+ import styled2 from "styled-components";
85
85
  import { disabledSelector } from "@charcoal-ui/utils";
86
86
  import { jsx as jsx3 } from "react/jsx-runtime";
87
87
  var Clickable = React2.forwardRef(
88
88
  function Clickable2(props, ref) {
89
89
  const { Link } = useComponentAbstraction();
90
- if ("to" in props) {
91
- const { onClick, disabled = false, ...rest } = props;
92
- return /* @__PURE__ */ jsx3(
93
- A,
94
- {
95
- ...rest,
96
- as: disabled ? void 0 : Link,
97
- onClick: disabled ? void 0 : onClick,
98
- "aria-disabled": disabled,
99
- ref
100
- }
101
- );
102
- } else {
103
- return /* @__PURE__ */ jsx3(Button, { ...props, ref });
90
+ const isLink = "to" in props;
91
+ const as = isLink ? Link : "button";
92
+ const ariaDisabled = isLink && props.disabled === true ? true : void 0;
93
+ let rest = props;
94
+ if (isLink) {
95
+ const { disabled, ..._rest } = props;
96
+ rest = _rest;
104
97
  }
98
+ return /* @__PURE__ */ jsx3(
99
+ StyledClickableDiv,
100
+ {
101
+ ...rest,
102
+ ref,
103
+ as,
104
+ "aria-disabled": ariaDisabled
105
+ }
106
+ );
105
107
  }
106
108
  );
107
109
  var Clickable_default = Clickable;
108
- var clickableCss = css`
109
- /* Clickable style */
110
+ var StyledClickableDiv = styled2.div`
110
111
  cursor: pointer;
111
112
 
112
113
  ${disabledSelector} {
113
114
  cursor: default;
114
115
  }
115
- `;
116
- var Button = styled2.button`
116
+
117
117
  /* Reset button appearance */
118
118
  appearance: none;
119
119
  background: transparent;
@@ -146,27 +146,11 @@ var Button = styled2.button`
146
146
  border-style: none;
147
147
  padding: 0;
148
148
  }
149
-
150
- ${clickableCss}
151
- `;
152
- var A = styled2.span`
153
- /* Reset a-tag appearance */
154
- color: inherit;
155
-
156
- &:focus {
157
- outline: none;
158
- }
159
-
160
- .text {
161
- top: calc(1em + 2em);
162
- }
163
-
164
- ${clickableCss}
165
149
  `;
166
150
 
167
151
  // src/components/Button/index.tsx
168
152
  import { jsx as jsx4 } from "react/jsx-runtime";
169
- var Button2 = forwardRef3(function Button3({
153
+ var Button = forwardRef3(function Button2({
170
154
  children,
171
155
  variant = "Default",
172
156
  size = "M",
@@ -187,7 +171,7 @@ var Button2 = forwardRef3(function Button3({
187
171
  }
188
172
  );
189
173
  });
190
- var Button_default = Button2;
174
+ var Button_default = Button;
191
175
  var StyledButton = styled3(Clickable_default)`
192
176
  width: ${(p) => p.$fullWidth ? "stretch" : "min-content"};
193
177
  display: inline-grid;
@@ -494,7 +478,7 @@ function RadioGroup({
494
478
 
495
479
  // src/components/MultiSelect/index.tsx
496
480
  import { useCallback as useCallback2, useContext as useContext3, forwardRef as forwardRef6, memo as memo2 } from "react";
497
- import styled6, { css as css2 } from "styled-components";
481
+ import styled6, { css } from "styled-components";
498
482
  import warning2 from "warning";
499
483
  import { disabledSelector as disabledSelector2, px as px2 } from "@charcoal-ui/utils";
500
484
 
@@ -634,7 +618,7 @@ var MultiSelectInputOverlay = styled6.div`
634
618
  invalid && overlay && o.outline.assertive
635
619
  ])}
636
620
 
637
- ${({ overlay }) => overlay && css2`
621
+ ${({ overlay }) => overlay && css`
638
622
  border-color: ${({ theme: theme3 }) => theme3.color.text5};
639
623
  border-width: 2px;
640
624
  border-style: solid;
@@ -805,9 +789,9 @@ var SwitchInput = styled7.input.attrs({
805
789
  // src/components/TextField/index.tsx
806
790
  import { useTextField } from "@react-aria/textfield";
807
791
  import { useVisuallyHidden } from "@react-aria/visually-hidden";
808
- import { useCallback as useCallback3, useEffect, useRef, useState } from "react";
792
+ import { useCallback as useCallback3, useEffect as useEffect2, useRef, useState } from "react";
809
793
  import * as React5 from "react";
810
- import styled9 from "styled-components";
794
+ import styled9, { css as css2 } from "styled-components";
811
795
 
812
796
  // src/components/FieldLabel/index.tsx
813
797
  import * as React4 from "react";
@@ -859,10 +843,29 @@ var FieldLabelWrapper = styled8.div`
859
843
  }
860
844
  `;
861
845
 
846
+ // src/components/TextField/useFocusWithClick.tsx
847
+ import { useEffect } from "react";
848
+ function useFocusWithClick(containerRef, inputRef) {
849
+ useEffect(() => {
850
+ const el = containerRef.current;
851
+ if (el) {
852
+ const handleDown = (e) => {
853
+ if (e.target !== inputRef.current) {
854
+ inputRef.current?.focus();
855
+ }
856
+ };
857
+ el.addEventListener("click", handleDown);
858
+ return () => {
859
+ el.removeEventListener("click", handleDown);
860
+ };
861
+ }
862
+ });
863
+ }
864
+
862
865
  // src/components/TextField/index.tsx
863
866
  import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
864
867
  var TextField = React5.forwardRef(
865
- function SingleLineTextFieldInner({ onChange, ...props }, forwardRef17) {
868
+ function SingleLineTextFieldInner({ onChange, ...props }, forwardRef18) {
866
869
  const {
867
870
  className,
868
871
  showLabel = false,
@@ -880,13 +883,9 @@ var TextField = React5.forwardRef(
880
883
  } = props;
881
884
  const { visuallyHiddenProps } = useVisuallyHidden();
882
885
  const ariaRef = useRef(null);
883
- const prefixRef = useRef(null);
884
- const suffixRef = useRef(null);
885
886
  const [count, setCount] = useState(
886
887
  countCodePointsInString(props.value ?? "")
887
888
  );
888
- const [prefixWidth, setPrefixWidth] = useState(0);
889
- const [suffixWidth, setSuffixWidth] = useState(0);
890
889
  const nonControlled = props.value === void 0;
891
890
  const handleChange = useCallback3(
892
891
  (value) => {
@@ -901,7 +900,7 @@ var TextField = React5.forwardRef(
901
900
  },
902
901
  [maxLength, nonControlled, onChange]
903
902
  );
904
- useEffect(() => {
903
+ useEffect2(() => {
905
904
  setCount(countCodePointsInString(props.value ?? ""));
906
905
  }, [props.value]);
907
906
  const { inputProps, labelProps, descriptionProps, errorMessageProps } = useTextField(
@@ -917,24 +916,8 @@ var TextField = React5.forwardRef(
917
916
  },
918
917
  ariaRef
919
918
  );
920
- useEffect(() => {
921
- const prefixObserver = new ResizeObserver((entries) => {
922
- setPrefixWidth(entries[0].contentRect.width);
923
- });
924
- const suffixObserver = new ResizeObserver((entries) => {
925
- setSuffixWidth(entries[0].contentRect.width);
926
- });
927
- if (prefixRef.current !== null) {
928
- prefixObserver.observe(prefixRef.current);
929
- }
930
- if (suffixRef.current !== null) {
931
- suffixObserver.observe(suffixRef.current);
932
- }
933
- return () => {
934
- suffixObserver.disconnect();
935
- prefixObserver.disconnect();
936
- };
937
- }, []);
919
+ const containerRef = useRef(null);
920
+ useFocusWithClick(containerRef, ariaRef);
938
921
  return /* @__PURE__ */ jsxs6(TextFieldRoot, { className, isDisabled: disabled, children: [
939
922
  /* @__PURE__ */ jsx10(
940
923
  TextFieldLabel,
@@ -947,23 +930,31 @@ var TextField = React5.forwardRef(
947
930
  ...!showLabel ? visuallyHiddenProps : {}
948
931
  }
949
932
  ),
950
- /* @__PURE__ */ jsxs6(StyledInputContainer, { children: [
951
- /* @__PURE__ */ jsx10(PrefixContainer, { ref: prefixRef, children: /* @__PURE__ */ jsx10(Affix, { children: prefix }) }),
952
- /* @__PURE__ */ jsx10(
953
- StyledInput,
954
- {
955
- ref: mergeRefs(forwardRef17, ariaRef),
956
- invalid,
957
- extraLeftPadding: prefixWidth,
958
- extraRightPadding: suffixWidth,
959
- ...inputProps
960
- }
961
- ),
962
- /* @__PURE__ */ jsxs6(SuffixContainer, { ref: suffixRef, children: [
963
- /* @__PURE__ */ jsx10(Affix, { children: suffix }),
964
- showCount && /* @__PURE__ */ jsx10(SingleLineCounter, { children: maxLength !== void 0 ? `${count}/${maxLength}` : count })
965
- ] })
966
- ] }),
933
+ /* @__PURE__ */ jsxs6(
934
+ StyledInputContainer,
935
+ {
936
+ ref: containerRef,
937
+ invalid,
938
+ "aria-disabled": disabled === true ? true : void 0,
939
+ hasPrefix: prefix != null,
940
+ hasSuffix: suffix != null || showCount,
941
+ children: [
942
+ prefix && /* @__PURE__ */ jsx10(PrefixContainer, { children: prefix }),
943
+ /* @__PURE__ */ jsx10(
944
+ StyledInput,
945
+ {
946
+ ref: mergeRefs(forwardRef18, ariaRef),
947
+ invalid,
948
+ ...inputProps
949
+ }
950
+ ),
951
+ (suffix || showCount) && /* @__PURE__ */ jsxs6(SuffixContainer, { children: [
952
+ suffix,
953
+ showCount && /* @__PURE__ */ jsx10(SingleLineCounter, { children: maxLength !== void 0 ? `${count}/${maxLength}` : count })
954
+ ] })
955
+ ]
956
+ }
957
+ ),
967
958
  assistiveText != null && assistiveText.length !== 0 && /* @__PURE__ */ jsx10(
968
959
  AssistiveText,
969
960
  {
@@ -983,34 +974,53 @@ var TextFieldRoot = styled9.div`
983
974
  ${(p) => p.isDisabled && { opacity: p.theme.elementEffect.disabled.opacity }}
984
975
  `;
985
976
  var TextFieldLabel = styled9(FieldLabel_default)`
986
- ${theme((o) => o.margin.bottom(8))}
977
+ margin-bottom: 8px;
987
978
  `;
988
979
  var StyledInputContainer = styled9.div`
989
- height: 40px;
990
980
  display: grid;
991
- position: relative;
981
+ grid-template-columns: ${(p) => [p.hasPrefix && "auto", "1fr", p.hasSuffix && "auto"].filter(Boolean).join(" ")};
982
+ height: 40px;
983
+ transition: 0.2s background-color, 0.2s box-shadow;
984
+ color: var(--charcoal-text2);
985
+ background-color: var(--charcoal-surface3);
986
+ border-radius: 4px;
987
+ gap: 4px;
988
+ padding: 0 8px;
989
+ line-height: 22px;
990
+ font-size: 14px;
991
+
992
+ :not(:disabled):not([aria-disabled]):hover,
993
+ [aria-disabled='false']:hover {
994
+ background-color: var(--charcoal-surface3-hover);
995
+ }
996
+
997
+ :not(:disabled):not([aria-disabled]):active,
998
+ [aria-disabled='false']:active {
999
+ outline: none;
1000
+ box-shadow: 0 0 0 4px
1001
+ ${(p) => p.invalid ? `rgba(255,43,0,0.32)` : `rgba(0, 150, 250, 0.32);`};
1002
+ }
1003
+
1004
+ :focus-within {
1005
+ outline: none;
1006
+ box-shadow: 0 0 0 4px
1007
+ ${(p) => p.invalid ? `rgba(255,43,0,0.32)` : `rgba(0, 150, 250, 0.32);`};
1008
+ }
1009
+
1010
+ ${(p) => p.invalid && css2`
1011
+ box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
1012
+ `}
992
1013
  `;
993
- var PrefixContainer = styled9.span`
994
- position: absolute;
995
- top: 50%;
996
- left: 8px;
997
- transform: translateY(-50%);
998
- z-index: 1;
1014
+ var PrefixContainer = styled9.div`
1015
+ display: flex;
1016
+ padding-left: 8px;
1017
+ align-items: center;
999
1018
  `;
1000
1019
  var SuffixContainer = styled9.span`
1001
- position: absolute;
1002
- top: 50%;
1003
- right: 8px;
1004
- transform: translateY(-50%);
1005
-
1006
1020
  display: flex;
1021
+ align-items: center;
1007
1022
  gap: 8px;
1008
1023
  `;
1009
- var Affix = styled9.span`
1010
- user-select: none;
1011
-
1012
- ${theme((o) => [o.typography(14).preserveHalfLeading, o.font.text2])}
1013
- `;
1014
1024
  var StyledInput = styled9.input`
1015
1025
  border: none;
1016
1026
  box-sizing: border-box;
@@ -1024,44 +1034,40 @@ var StyledInput = styled9.input`
1024
1034
  height: calc(100% / 0.875);
1025
1035
  font-size: calc(14px / 0.875);
1026
1036
  line-height: calc(22px / 0.875);
1027
- padding-left: calc((8px + ${(p) => p.extraLeftPadding}px) / 0.875);
1028
- padding-right: calc((8px + ${(p) => p.extraRightPadding}px) / 0.875);
1037
+ padding-left: 0;
1038
+ padding-right: 0;
1029
1039
  border-radius: calc(4px / 0.875);
1030
1040
 
1031
1041
  /* Display box-shadow for iOS Safari */
1032
1042
  appearance: none;
1043
+ background: transparent;
1033
1044
 
1034
- ${(p) => theme((o) => [
1035
- o.bg.surface3.hover,
1036
- o.outline.default.focus,
1037
- p.invalid && o.outline.assertive,
1038
- o.font.text2
1039
- ])}
1040
-
1045
+ color: var(--charcoal-text2);
1041
1046
  &::placeholder {
1042
- ${theme((o) => o.font.text3)}
1047
+ color: var(--charcoal-text3);
1043
1048
  }
1044
1049
  `;
1045
1050
  var SingleLineCounter = styled9.span`
1046
- ${theme((o) => [o.typography(14).preserveHalfLeading, o.font.text3])}
1051
+ line-height: 22px;
1052
+ font-size: 14px;
1053
+ color: var(--charcoal-text3);
1047
1054
  `;
1048
1055
  var AssistiveText = styled9.p`
1049
- ${(p) => theme((o) => [
1050
- o.typography(14),
1051
- o.margin.top(8),
1052
- o.margin.bottom(0),
1053
- o.font[p.invalid ? "assertive" : "text1"]
1054
- ])}
1056
+ font-size: 14px;
1057
+ line-height: 22px;
1058
+ margin-top: 4px;
1059
+ margin-bottom: -4px;
1060
+ color: ${(p) => `var(--charcoal-${p.invalid ? `assertive` : `text2`})`};
1055
1061
  `;
1056
1062
 
1057
1063
  // src/components/TextArea/index.tsx
1058
1064
  import { useTextField as useTextField2 } from "@react-aria/textfield";
1059
1065
  import { useVisuallyHidden as useVisuallyHidden2 } from "@react-aria/visually-hidden";
1060
- import { forwardRef as forwardRef10, useCallback as useCallback4, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
1066
+ import { forwardRef as forwardRef10, useCallback as useCallback4, useEffect as useEffect3, useRef as useRef2, useState as useState2 } from "react";
1061
1067
  import styled10, { css as css3 } from "styled-components";
1062
1068
  import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
1063
1069
  var TextArea = forwardRef10(
1064
- function TextAreaInner({ onChange, ...props }, forwardRef17) {
1070
+ function TextAreaInner({ onChange, ...props }, forwardRef18) {
1065
1071
  const {
1066
1072
  className,
1067
1073
  showCount = false,
@@ -1109,7 +1115,7 @@ var TextArea = forwardRef10(
1109
1115
  },
1110
1116
  [autoHeight, maxLength, nonControlled, onChange, syncHeight]
1111
1117
  );
1112
- useEffect2(() => {
1118
+ useEffect3(() => {
1113
1119
  setCount(countCodePointsInString(props.value ?? ""));
1114
1120
  }, [props.value]);
1115
1121
  const { inputProps, labelProps, descriptionProps, errorMessageProps } = useTextField2(
@@ -1125,14 +1131,16 @@ var TextArea = forwardRef10(
1125
1131
  },
1126
1132
  ariaRef
1127
1133
  );
1128
- useEffect2(() => {
1134
+ useEffect3(() => {
1129
1135
  if (autoHeight && textareaRef.current !== null) {
1130
1136
  syncHeight(textareaRef.current);
1131
1137
  }
1132
1138
  }, [autoHeight, syncHeight]);
1139
+ const containerRef = useRef2(null);
1140
+ useFocusWithClick(containerRef, ariaRef);
1133
1141
  return /* @__PURE__ */ jsxs7(TextFieldRoot2, { className, isDisabled: disabled, children: [
1134
1142
  /* @__PURE__ */ jsx11(
1135
- TextFieldLabel2,
1143
+ TextFieldLabel,
1136
1144
  {
1137
1145
  label,
1138
1146
  requiredText,
@@ -1145,13 +1153,15 @@ var TextArea = forwardRef10(
1145
1153
  /* @__PURE__ */ jsxs7(
1146
1154
  StyledTextareaContainer,
1147
1155
  {
1156
+ ref: containerRef,
1148
1157
  invalid,
1149
1158
  rows: showCount ? rows + 1 : rows,
1159
+ "aria-disabled": disabled === true ? "true" : void 0,
1150
1160
  children: [
1151
1161
  /* @__PURE__ */ jsx11(
1152
1162
  StyledTextarea,
1153
1163
  {
1154
- ref: mergeRefs(textareaRef, forwardRef17, ariaRef),
1164
+ ref: mergeRefs(textareaRef, forwardRef18, ariaRef),
1155
1165
  rows,
1156
1166
  noBottomPadding: showCount,
1157
1167
  ...inputProps
@@ -1162,7 +1172,7 @@ var TextArea = forwardRef10(
1162
1172
  }
1163
1173
  ),
1164
1174
  assistiveText != null && assistiveText.length !== 0 && /* @__PURE__ */ jsx11(
1165
- AssistiveText2,
1175
+ AssistiveText,
1166
1176
  {
1167
1177
  invalid,
1168
1178
  ...invalid ? errorMessageProps : descriptionProps,
@@ -1179,29 +1189,32 @@ var TextFieldRoot2 = styled10.div`
1179
1189
 
1180
1190
  ${(p) => p.isDisabled && { opacity: p.theme.elementEffect.disabled.opacity }}
1181
1191
  `;
1182
- var TextFieldLabel2 = styled10(FieldLabel_default)`
1183
- ${theme((o) => o.margin.bottom(8))}
1184
- `;
1185
1192
  var StyledTextareaContainer = styled10.div`
1186
1193
  position: relative;
1187
1194
  overflow: hidden;
1188
- padding: 0 8px;
1189
1195
 
1190
- ${(p) => theme((o) => [
1191
- o.bg.surface3.hover,
1192
- o.outline.default.focus,
1193
- p.invalid && o.outline.assertive,
1194
- o.font.text2,
1195
- o.borderRadius(4)
1196
- ])}
1197
-
1198
- &:focus-within {
1199
- ${(p) => theme((o) => p.invalid ? o.outline.assertive : o.outline.default)}
1200
- }
1196
+ color: var(--charcoal-text2);
1197
+ background-color: var(--charcoal-surface3);
1198
+ border-radius: 4px;
1199
+ transition: 0.2s background-color, 0.2s box-shadow;
1201
1200
 
1202
1201
  ${({ rows }) => css3`
1203
1202
  height: calc(22px * ${rows} + 18px);
1204
1203
  `};
1204
+
1205
+ :not([aria-disabled]):hover,
1206
+ [aria-disabled='false']:hover {
1207
+ background-color: var(--charcoal-surface3-hover);
1208
+ }
1209
+ :focus-within {
1210
+ outline: none;
1211
+ box-shadow: 0 0 0 4px
1212
+ ${(p) => p.invalid ? `rgba(255,43,0,0.32)` : `rgba(0, 150, 250, 0.32);`};
1213
+ }
1214
+
1215
+ ${(p) => p.invalid && css3`
1216
+ box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
1217
+ `}
1205
1218
  `;
1206
1219
  var StyledTextarea = styled10.textarea`
1207
1220
  border: none;
@@ -1209,6 +1222,7 @@ var StyledTextarea = styled10.textarea`
1209
1222
  resize: none;
1210
1223
  font-family: inherit;
1211
1224
  color: inherit;
1225
+ box-sizing: border-box;
1212
1226
 
1213
1227
  /* Prevent zooming for iOS Safari */
1214
1228
  transform-origin: top left;
@@ -1216,10 +1230,11 @@ var StyledTextarea = styled10.textarea`
1216
1230
  width: calc(100% / 0.875);
1217
1231
  font-size: calc(14px / 0.875);
1218
1232
  line-height: calc(22px / 0.875);
1219
- padding: calc(9px / 0.875) 0 ${(p) => p.noBottomPadding ? 0 : ""};
1233
+ padding: calc(9px / 0.875) calc(8px / 0.875)
1234
+ ${(p) => p.noBottomPadding ? 0 : ""};
1220
1235
 
1221
- ${({ rows = 1 }) => css3`
1222
- height: calc(22px / 0.875 * ${rows});
1236
+ ${({ rows = 1, noBottomPadding }) => css3`
1237
+ height: calc(22px / 0.875 * ${rows} + ${noBottomPadding ? 9 : 20}px);
1223
1238
  `};
1224
1239
 
1225
1240
  /* Display box-shadow for iOS Safari */
@@ -1228,31 +1243,17 @@ var StyledTextarea = styled10.textarea`
1228
1243
  background: none;
1229
1244
 
1230
1245
  &::placeholder {
1231
- ${theme((o) => o.font.text3)}
1232
- }
1233
-
1234
- /* Hide scrollbar for Chrome, Safari and Opera */
1235
- &::-webkit-scrollbar {
1236
- display: none;
1246
+ color: var(--charcoal-text3);
1237
1247
  }
1238
- /* Hide scrollbar for IE, Edge and Firefox */
1239
- -ms-overflow-style: none; /* IE and Edge */
1240
- scrollbar-width: none; /* Firefox */
1241
1248
  `;
1242
1249
  var MultiLineCounter = styled10.span`
1243
1250
  position: absolute;
1244
1251
  bottom: 9px;
1245
1252
  right: 8px;
1246
1253
 
1247
- ${theme((o) => [o.typography(14).preserveHalfLeading, o.font.text3])}
1248
- `;
1249
- var AssistiveText2 = styled10.p`
1250
- ${(p) => theme((o) => [
1251
- o.typography(14),
1252
- o.margin.top(8),
1253
- o.margin.bottom(0),
1254
- o.font[p.invalid ? "assertive" : "text1"]
1255
- ])}
1254
+ line-height: 22px;
1255
+ font-size: 14px;
1256
+ color: var(--charcoal-text3);
1256
1257
  `;
1257
1258
 
1258
1259
  // src/components/Icon/index.tsx
@@ -1275,15 +1276,21 @@ var Icon = React6.forwardRef(function IconInner({ name, scale, unsafeNonGuidelin
1275
1276
  var Icon_default = Icon;
1276
1277
 
1277
1278
  // src/components/Modal/index.tsx
1278
- import { useContext as useContext4, forwardRef as forwardRef12, memo as memo4 } from "react";
1279
- import * as React7 from "react";
1279
+ import { useContext as useContext4, forwardRef as forwardRef13, memo as memo4 } from "react";
1280
+ import * as React9 from "react";
1280
1281
  import {
1281
1282
  Overlay,
1282
- useModalOverlay,
1283
- useOverlay
1283
+ useModalOverlay
1284
1284
  } from "@react-aria/overlays";
1285
- import styled11, { css as css4, useTheme } from "styled-components";
1286
- import { FocusScope } from "@react-aria/focus";
1285
+ import styled12, { css as css5, useTheme } from "styled-components";
1286
+ import { maxWidth as maxWidth2 } from "@charcoal-ui/utils";
1287
+ import { useMedia } from "@charcoal-ui/styled";
1288
+ import { animated as animated2, useTransition, easings } from "react-spring";
1289
+ import { useObjectRef as useObjectRef2 } from "@react-aria/utils";
1290
+
1291
+ // src/components/Modal/Dialog/index.tsx
1292
+ import { forwardRef as forwardRef12 } from "react";
1293
+ import styled11, { css as css4 } from "styled-components";
1287
1294
  import { useDialog } from "@react-aria/dialog";
1288
1295
 
1289
1296
  // ../foundation/src/grid.ts
@@ -1293,14 +1300,100 @@ function columnSystem(span, column, gutter) {
1293
1300
  return span * column + (span - 1) * gutter;
1294
1301
  }
1295
1302
 
1296
- // src/components/Modal/index.tsx
1303
+ // src/components/Modal/Dialog/index.tsx
1297
1304
  import { maxWidth } from "@charcoal-ui/utils";
1298
- import { useMedia } from "@charcoal-ui/styled";
1299
- import { animated, useTransition, easings } from "react-spring";
1300
- import { useObjectRef as useObjectRef2 } from "@react-aria/utils";
1301
- import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
1305
+ import { animated } from "react-spring";
1306
+
1307
+ // src/_lib/useForwardedRef.tsx
1308
+ import * as React7 from "react";
1309
+ function useForwardedRef(ref) {
1310
+ const innerRef = React7.useRef(null);
1311
+ React7.useEffect(() => {
1312
+ if (!ref)
1313
+ return;
1314
+ if (typeof ref === "function") {
1315
+ ref(innerRef.current);
1316
+ } else {
1317
+ ref.current = innerRef.current;
1318
+ }
1319
+ });
1320
+ return innerRef;
1321
+ }
1322
+
1323
+ // src/components/Modal/Dialog/index.tsx
1324
+ import { jsx as jsx13 } from "react/jsx-runtime";
1325
+ var Dialog = forwardRef12(function Dialog2(props, forwardRef18) {
1326
+ const ref = useForwardedRef(forwardRef18);
1327
+ const { dialogProps } = useDialog(
1328
+ {
1329
+ role: "dialog"
1330
+ },
1331
+ ref
1332
+ );
1333
+ return /* @__PURE__ */ jsx13(
1334
+ AnimatedStyledDialogDiv,
1335
+ {
1336
+ ...props,
1337
+ role: dialogProps.role,
1338
+ tabIndex: dialogProps.tabIndex,
1339
+ "aria-labelledby": dialogProps["aria-labelledby"],
1340
+ onBlur: dialogProps.onBlur,
1341
+ ref
1342
+ }
1343
+ );
1344
+ });
1345
+ var AnimatedStyledDialogDiv = animated(styled11.div`
1346
+ margin: auto;
1347
+ position: relative;
1348
+ height: fit-content;
1349
+ width: ${(p) => {
1350
+ switch (p.size) {
1351
+ case "S": {
1352
+ return columnSystem(3, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1353
+ }
1354
+ case "M": {
1355
+ return columnSystem(4, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1356
+ }
1357
+ case "L": {
1358
+ return columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1359
+ }
1360
+ default: {
1361
+ return unreachable(p.size);
1362
+ }
1363
+ }
1364
+ }}px;
1365
+
1366
+ background-color: ${({ theme: theme3 }) => theme3.color.background1};
1367
+ border-radius: 24px;
1368
+
1369
+ @media ${({ theme: theme3 }) => maxWidth(theme3.breakpoint.screen1)} {
1370
+ max-width: 440px;
1371
+ width: calc(100% - 48px);
1372
+ ${(p) => p.bottomSheet !== false && css4`
1373
+ max-width: unset;
1374
+ width: 100%;
1375
+ border-radius: 0;
1376
+ margin: auto 0 0 0;
1377
+ ${p.bottomSheet === "full" && css4`
1378
+ min-height: 100%;
1379
+ `}
1380
+ `}
1381
+ }
1382
+ :focus {
1383
+ outline: none;
1384
+ }
1385
+ `);
1386
+
1387
+ // src/components/Modal/ModalBackgroundContext.tsx
1388
+ import * as React8 from "react";
1389
+ var ModalBackgroundContext = React8.createContext(
1390
+ null
1391
+ );
1392
+
1393
+ // src/components/Modal/index.tsx
1394
+ import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
1302
1395
  var DEFAULT_Z_INDEX = 10;
1303
- var Modal = forwardRef12(function ModalInner({ children, zIndex = DEFAULT_Z_INDEX, portalContainer, ...props }, external) {
1396
+ var Modal = forwardRef13(function ModalInner({ children, zIndex = DEFAULT_Z_INDEX, portalContainer, ...props }, external) {
1304
1397
  const {
1305
1398
  title,
1306
1399
  size = "M",
@@ -1311,8 +1404,7 @@ var Modal = forwardRef12(function ModalInner({ children, zIndex = DEFAULT_Z_INDE
1311
1404
  isOpen = false
1312
1405
  } = props;
1313
1406
  const ref = useObjectRef2(external);
1314
- const { overlayProps, underlayProps } = useOverlay(props, ref);
1315
- const { modalProps } = useModalOverlay(
1407
+ const { modalProps, underlayProps } = useModalOverlay(
1316
1408
  props,
1317
1409
  {
1318
1410
  close: onClose,
@@ -1326,40 +1418,45 @@ var Modal = forwardRef12(function ModalInner({ children, zIndex = DEFAULT_Z_INDE
1326
1418
  },
1327
1419
  ref
1328
1420
  );
1329
- const { dialogProps, titleProps } = useDialog(props, ref);
1330
1421
  const theme3 = useTheme();
1331
- const isMobile = useMedia(maxWidth(theme3.breakpoint.screen1)) ?? false;
1422
+ const isMobile = useMedia(maxWidth2(theme3.breakpoint.screen1)) ?? false;
1332
1423
  const transitionEnabled = isMobile && bottomSheet !== false;
1424
+ const showDismiss = !isMobile || bottomSheet !== true;
1333
1425
  const transition = useTransition(isOpen, {
1334
1426
  from: {
1335
1427
  transform: "translateY(100%)",
1336
- backgroundColor: "rgba(0, 0, 0, 0)"
1428
+ backgroundColor: "rgba(0, 0, 0, 0)",
1429
+ overflow: "hidden"
1337
1430
  },
1338
1431
  enter: {
1339
1432
  transform: "translateY(0%)",
1340
1433
  backgroundColor: "rgba(0, 0, 0, 0.4)"
1341
1434
  },
1435
+ update: {
1436
+ overflow: "auto"
1437
+ },
1342
1438
  leave: {
1343
1439
  transform: "translateY(100%)",
1344
- backgroundColor: "rgba(0, 0, 0, 0)"
1440
+ backgroundColor: "rgba(0, 0, 0, 0)",
1441
+ overflow: "hidden"
1345
1442
  },
1346
1443
  config: transitionEnabled ? { duration: 400, easing: easings.easeOutQuart } : { duration: 0 }
1347
1444
  });
1348
- const showDismiss = !isMobile || bottomSheet !== true;
1445
+ const bgRef = React9.useRef(null);
1349
1446
  return transition(
1350
- ({ backgroundColor, transform }, item) => item && /* @__PURE__ */ jsx13(Overlay, { portalContainer, children: /* @__PURE__ */ jsx13(
1447
+ ({ backgroundColor, overflow, transform }, item) => item && /* @__PURE__ */ jsx14(Overlay, { portalContainer, children: /* @__PURE__ */ jsx14(
1351
1448
  ModalBackground,
1352
1449
  {
1450
+ ref: bgRef,
1353
1451
  zIndex,
1354
1452
  ...underlayProps,
1355
- style: transitionEnabled ? { backgroundColor } : {},
1356
- children: /* @__PURE__ */ jsx13(FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: /* @__PURE__ */ jsx13(DialogContainer, { bottomSheet, size, children: /* @__PURE__ */ jsx13(
1357
- ModalDialog,
1453
+ style: transitionEnabled ? { backgroundColor, overflow } : {},
1454
+ $bottomSheet: bottomSheet,
1455
+ children: /* @__PURE__ */ jsx14(ModalBackgroundContext.Provider, { value: bgRef.current, children: /* @__PURE__ */ jsx14(
1456
+ Dialog,
1358
1457
  {
1359
1458
  ref,
1360
- ...overlayProps,
1361
1459
  ...modalProps,
1362
- ...dialogProps,
1363
1460
  style: transitionEnabled ? { transform } : {},
1364
1461
  size,
1365
1462
  bottomSheet,
@@ -1367,10 +1464,16 @@ var Modal = forwardRef12(function ModalInner({ children, zIndex = DEFAULT_Z_INDE
1367
1464
  children: /* @__PURE__ */ jsxs8(
1368
1465
  ModalContext.Provider,
1369
1466
  {
1370
- value: { titleProps, title, close: onClose, showDismiss },
1467
+ value: {
1468
+ titleProps: {},
1469
+ title,
1470
+ close: onClose,
1471
+ showDismiss,
1472
+ bottomSheet
1473
+ },
1371
1474
  children: [
1372
1475
  children,
1373
- isDismissable === true && /* @__PURE__ */ jsx13(
1476
+ isDismissable === true && /* @__PURE__ */ jsx14(
1374
1477
  ModalCrossButton,
1375
1478
  {
1376
1479
  size: "S",
@@ -1382,78 +1485,42 @@ var Modal = forwardRef12(function ModalInner({ children, zIndex = DEFAULT_Z_INDE
1382
1485
  }
1383
1486
  )
1384
1487
  }
1385
- ) }) })
1488
+ ) })
1386
1489
  }
1387
1490
  ) })
1388
1491
  );
1389
1492
  });
1390
1493
  var Modal_default = memo4(Modal);
1391
- var ModalContext = React7.createContext({
1494
+ var ModalContext = React9.createContext({
1392
1495
  titleProps: {},
1393
1496
  title: "",
1394
1497
  close: void 0,
1395
- showDismiss: true
1498
+ showDismiss: true,
1499
+ bottomSheet: false
1396
1500
  });
1397
- var ModalBackground = animated(styled11.div`
1501
+ var ModalBackground = animated2(styled12.div`
1398
1502
  z-index: ${({ zIndex }) => zIndex};
1399
1503
  overflow: auto;
1400
1504
  display: flex;
1401
1505
  position: fixed;
1402
1506
  top: 0;
1403
1507
  left: 0;
1404
- width: 100%;
1508
+ width: -webkit-fill-available;
1509
+ width: -moz-available;
1405
1510
  height: 100%;
1511
+ justify-content: center;
1512
+ padding: 40px 0;
1513
+ box-sizing: border-box;
1406
1514
 
1407
- ${theme((o) => [o.bg.surface4])}
1408
- `);
1409
- var DialogContainer = styled11.div`
1410
- position: relative;
1411
- margin: auto;
1412
- padding: 24px 0;
1413
- width: ${(p) => {
1414
- switch (p.size) {
1415
- case "S": {
1416
- return columnSystem(3, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1417
- }
1418
- case "M": {
1419
- return columnSystem(4, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1420
- }
1421
- case "L": {
1422
- return columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1423
- }
1424
- default: {
1425
- return unreachable(p.size);
1426
- }
1427
- }
1428
- }}px;
1515
+ background-color: ${({ theme: theme3 }) => theme3.color.surface4};
1429
1516
 
1430
- @media ${({ theme: theme3 }) => maxWidth(theme3.breakpoint.screen1)} {
1431
- width: calc(100% - 48px);
1432
- ${(p) => p.bottomSheet !== false && css4`
1433
- margin: 0;
1517
+ @media ${({ theme: theme3 }) => maxWidth2(theme3.breakpoint.screen1)} {
1518
+ ${(p) => p.$bottomSheet !== false && css5`
1434
1519
  padding: 0;
1435
- bottom: 0;
1436
- position: absolute;
1437
- width: 100%;
1438
- ${p.bottomSheet === "full" ? "height: 100%" : ""};
1439
- `}
1440
- }
1441
- `;
1442
- var ModalDialog = animated(styled11.div`
1443
- position: relative;
1444
- margin: auto;
1445
-
1446
- ${theme((o) => [o.bg.background1, o.borderRadius(24)])}
1447
- @media ${({ theme: theme3 }) => maxWidth(theme3.breakpoint.screen1)} {
1448
- ${(p) => p.bottomSheet !== false && css4`
1449
- border-radius: 0;
1450
- ${p.bottomSheet === "full" && css4`
1451
- height: 100%;
1452
- `}
1453
1520
  `}
1454
1521
  }
1455
1522
  `);
1456
- var ModalCrossButton = styled11(IconButton_default)`
1523
+ var ModalCrossButton = styled12(IconButton_default)`
1457
1524
  position: absolute;
1458
1525
  top: 8px;
1459
1526
  right: 8px;
@@ -1462,36 +1529,44 @@ var ModalCrossButton = styled11(IconButton_default)`
1462
1529
  `;
1463
1530
  function ModalTitle(props) {
1464
1531
  const { titleProps, title } = useContext4(ModalContext);
1465
- return /* @__PURE__ */ jsx13(ModalHeading, { ...titleProps, ...props, children: title });
1532
+ return /* @__PURE__ */ jsx14(ModalHeading, { ...titleProps, ...props, children: title });
1466
1533
  }
1467
- var ModalHeading = styled11.h3`
1534
+ var ModalHeading = styled12.h3`
1468
1535
  margin: 0;
1469
1536
  font-weight: inherit;
1470
1537
  font-size: inherit;
1471
1538
  `;
1472
1539
 
1473
1540
  // src/components/Modal/ModalPlumbing.tsx
1474
- import styled12 from "styled-components";
1475
- import { jsx as jsx14 } from "react/jsx-runtime";
1541
+ import styled13, { css as css6 } from "styled-components";
1542
+ import { useContext as useContext5 } from "react";
1543
+ import { maxWidth as maxWidth3 } from "@charcoal-ui/utils";
1544
+ import { jsx as jsx15 } from "react/jsx-runtime";
1476
1545
  function ModalHeader() {
1477
- return /* @__PURE__ */ jsx14(ModalHeaderRoot, { children: /* @__PURE__ */ jsx14(StyledModalTitle, {}) });
1546
+ const modalCtx = useContext5(ModalContext);
1547
+ return /* @__PURE__ */ jsx15(ModalHeaderRoot, { $bottomSheet: modalCtx.bottomSheet, children: /* @__PURE__ */ jsx15(StyledModalTitle, {}) });
1478
1548
  }
1479
- var ModalHeaderRoot = styled12.div`
1549
+ var ModalHeaderRoot = styled13.div`
1480
1550
  height: 64px;
1481
1551
  display: grid;
1482
1552
  align-content: center;
1483
1553
  justify-content: center;
1554
+ @media ${({ theme: theme3 }) => maxWidth3(theme3.breakpoint.screen1)} {
1555
+ ${(p) => p.$bottomSheet !== false && css6`
1556
+ height: 48px;
1557
+ `}
1558
+ }
1484
1559
  `;
1485
- var StyledModalTitle = styled12(ModalTitle)`
1560
+ var StyledModalTitle = styled13(ModalTitle)`
1486
1561
  ${theme((o) => [o.font.text1, o.typography(16).bold])}
1487
1562
  `;
1488
- var ModalAlign = styled12.div`
1563
+ var ModalAlign = styled13.div`
1489
1564
  ${theme((o) => [o.padding.horizontal(16)])}
1490
1565
  `;
1491
- var ModalBody = styled12.div`
1566
+ var ModalBody = styled13.div`
1492
1567
  ${theme((o) => [o.padding.bottom(40)])}
1493
1568
  `;
1494
- var ModalButtons = styled12.div`
1569
+ var ModalButtons = styled13.div`
1495
1570
  display: grid;
1496
1571
  grid-auto-flow: row;
1497
1572
  grid-row-gap: 8px;
@@ -1500,12 +1575,12 @@ var ModalButtons = styled12.div`
1500
1575
  `;
1501
1576
 
1502
1577
  // src/components/LoadingSpinner/index.tsx
1503
- import { forwardRef as forwardRef13, useImperativeHandle, useRef as useRef3, memo as memo5 } from "react";
1504
- import styled13, { keyframes } from "styled-components";
1505
- import { jsx as jsx15 } from "react/jsx-runtime";
1506
- var LoadingSpinner = forwardRef13(
1578
+ import { forwardRef as forwardRef14, useImperativeHandle, useRef as useRef5, memo as memo5 } from "react";
1579
+ import styled14, { keyframes } from "styled-components";
1580
+ import { jsx as jsx16 } from "react/jsx-runtime";
1581
+ var LoadingSpinner = forwardRef14(
1507
1582
  function LoadingSpinnerInner({ size = 48, padding = 16, transparent = false, className }, ref) {
1508
- return /* @__PURE__ */ jsx15(
1583
+ return /* @__PURE__ */ jsx16(
1509
1584
  LoadingSpinnerRoot,
1510
1585
  {
1511
1586
  size,
@@ -1513,13 +1588,13 @@ var LoadingSpinner = forwardRef13(
1513
1588
  transparent,
1514
1589
  className,
1515
1590
  ref,
1516
- children: /* @__PURE__ */ jsx15(LoadingSpinnerIcon, {})
1591
+ children: /* @__PURE__ */ jsx16(LoadingSpinnerIcon, {})
1517
1592
  }
1518
1593
  );
1519
1594
  }
1520
1595
  );
1521
1596
  var LoadingSpinner_default = memo5(LoadingSpinner);
1522
- var LoadingSpinnerRoot = styled13.div.attrs({ role: "progressbar" })`
1597
+ var LoadingSpinnerRoot = styled14.div.attrs({ role: "progressbar" })`
1523
1598
  box-sizing: content-box;
1524
1599
  margin: auto;
1525
1600
  padding: ${(props) => props.padding}px;
@@ -1544,7 +1619,7 @@ var scaleOut = keyframes`
1544
1619
  opacity: 0;
1545
1620
  }
1546
1621
  `;
1547
- var Icon2 = styled13.div.attrs({ role: "presentation" })`
1622
+ var Icon2 = styled14.div.attrs({ role: "presentation" })`
1548
1623
  width: 1em;
1549
1624
  height: 1em;
1550
1625
  border-radius: 1em;
@@ -1556,9 +1631,9 @@ var Icon2 = styled13.div.attrs({ role: "presentation" })`
1556
1631
  animation: none;
1557
1632
  }
1558
1633
  `;
1559
- var LoadingSpinnerIcon = forwardRef13(
1634
+ var LoadingSpinnerIcon = forwardRef14(
1560
1635
  function LoadingSpinnerIcon2({ once = false }, ref) {
1561
- const iconRef = useRef3(null);
1636
+ const iconRef = useRef5(null);
1562
1637
  useImperativeHandle(ref, () => ({
1563
1638
  restart: () => {
1564
1639
  if (!iconRef.current) {
@@ -1569,26 +1644,45 @@ var LoadingSpinnerIcon = forwardRef13(
1569
1644
  delete iconRef.current.dataset.resetAnimation;
1570
1645
  }
1571
1646
  }));
1572
- return /* @__PURE__ */ jsx15(Icon2, { ref: iconRef, once });
1647
+ return /* @__PURE__ */ jsx16(Icon2, { ref: iconRef, once });
1573
1648
  }
1574
1649
  );
1575
1650
 
1576
1651
  // src/components/DropdownSelector/index.tsx
1577
- import { useState as useState3, useRef as useRef7 } from "react";
1578
- import styled16 from "styled-components";
1652
+ import { useState as useState3, useRef as useRef9 } from "react";
1653
+ import styled17 from "styled-components";
1579
1654
  import { disabledSelector as disabledSelector4 } from "@charcoal-ui/utils";
1580
1655
 
1581
1656
  // src/components/DropdownSelector/DropdownPopover.tsx
1582
- import { useEffect as useEffect3, useRef as useRef5 } from "react";
1657
+ import { useEffect as useEffect6, useRef as useRef7 } from "react";
1583
1658
 
1584
1659
  // src/components/DropdownSelector/Popover/index.tsx
1585
- import { useRef as useRef4 } from "react";
1660
+ import { useContext as useContext6, useRef as useRef6 } from "react";
1586
1661
  import { DismissButton, Overlay as Overlay2, usePopover } from "@react-aria/overlays";
1587
- import styled14 from "styled-components";
1588
- import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
1662
+ import styled15 from "styled-components";
1663
+
1664
+ // src/components/DropdownSelector/Popover/usePreventScroll.tsx
1665
+ import { useEffect as useEffect5 } from "react";
1666
+ function usePreventScroll(element, isOpen) {
1667
+ useEffect5(() => {
1668
+ if (isOpen && element) {
1669
+ const defaultPaddingRight = element.style.paddingRight;
1670
+ const defaultOverflow = element.style.overflow;
1671
+ element.style.paddingRight = `${window.innerWidth - element.clientWidth}px`;
1672
+ element.style.overflow = "hidden";
1673
+ return () => {
1674
+ element.style.paddingRight = defaultPaddingRight;
1675
+ element.style.overflow = defaultOverflow;
1676
+ };
1677
+ }
1678
+ }, [element, isOpen]);
1679
+ }
1680
+
1681
+ // src/components/DropdownSelector/Popover/index.tsx
1682
+ import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
1589
1683
  var _empty = () => null;
1590
1684
  function Popover(props) {
1591
- const defaultPopoverRef = useRef4(null);
1685
+ const defaultPopoverRef = useRef6(null);
1592
1686
  const finalPopoverRef = props.popoverRef === void 0 ? defaultPopoverRef : props.popoverRef;
1593
1687
  const { popoverProps, underlayProps } = usePopover(
1594
1688
  {
@@ -1604,18 +1698,30 @@ function Popover(props) {
1604
1698
  toggle: _empty
1605
1699
  }
1606
1700
  );
1701
+ const modalBackground = useContext6(ModalBackgroundContext);
1702
+ usePreventScroll(modalBackground, props.isOpen);
1607
1703
  if (!props.isOpen)
1608
1704
  return null;
1609
1705
  return /* @__PURE__ */ jsxs9(Overlay2, { portalContainer: document.body, children: [
1610
- /* @__PURE__ */ jsx16("div", { ...underlayProps, style: { position: "fixed", inset: 0 } }),
1706
+ /* @__PURE__ */ jsx17(
1707
+ "div",
1708
+ {
1709
+ ...underlayProps,
1710
+ style: {
1711
+ position: "fixed",
1712
+ zIndex: typeof popoverProps.style?.zIndex === "number" ? popoverProps.style.zIndex - 1 : 99999,
1713
+ inset: 0
1714
+ }
1715
+ }
1716
+ ),
1611
1717
  /* @__PURE__ */ jsxs9(DropdownPopoverDiv, { ...popoverProps, ref: finalPopoverRef, children: [
1612
- /* @__PURE__ */ jsx16(DismissButton, { onDismiss: () => props.onClose() }),
1718
+ /* @__PURE__ */ jsx17(DismissButton, { onDismiss: () => props.onClose() }),
1613
1719
  props.children,
1614
- /* @__PURE__ */ jsx16(DismissButton, { onDismiss: () => props.onClose() })
1720
+ /* @__PURE__ */ jsx17(DismissButton, { onDismiss: () => props.onClose() })
1615
1721
  ] })
1616
1722
  ] });
1617
1723
  }
1618
- var DropdownPopoverDiv = styled14.div`
1724
+ var DropdownPopoverDiv = styled15.div`
1619
1725
  margin: 4px 0;
1620
1726
  list-style: none;
1621
1727
  overflow: auto;
@@ -1630,27 +1736,26 @@ var DropdownPopoverDiv = styled14.div`
1630
1736
  `;
1631
1737
 
1632
1738
  // src/components/DropdownSelector/DropdownPopover.tsx
1633
- import { jsx as jsx17 } from "react/jsx-runtime";
1739
+ import { jsx as jsx18 } from "react/jsx-runtime";
1634
1740
  function DropdownPopover({ children, ...props }) {
1635
- const ref = useRef5(null);
1636
- useEffect3(() => {
1741
+ const ref = useRef7(null);
1742
+ useEffect6(() => {
1637
1743
  if (props.isOpen && ref.current && props.triggerRef.current) {
1638
1744
  ref.current.style.width = `${props.triggerRef.current.clientWidth}px`;
1639
1745
  }
1640
1746
  }, [props.triggerRef, props.isOpen]);
1641
- useEffect3(() => {
1747
+ useEffect6(() => {
1642
1748
  if (props.isOpen && props.value !== void 0) {
1643
1749
  const windowScrollY = window.scrollY;
1644
1750
  const windowScrollX = window.scrollX;
1645
1751
  const selectedElement = document.querySelector(
1646
1752
  `[data-key="${props.value.toString()}"]`
1647
1753
  );
1648
- selectedElement?.scrollIntoView({ block: "center" });
1649
1754
  selectedElement?.focus();
1650
1755
  window.scrollTo(windowScrollX, windowScrollY);
1651
1756
  }
1652
1757
  }, [props.value, props.isOpen]);
1653
- return /* @__PURE__ */ jsx17(
1758
+ return /* @__PURE__ */ jsx18(
1654
1759
  Popover,
1655
1760
  {
1656
1761
  isOpen: props.isOpen,
@@ -1663,12 +1768,12 @@ function DropdownPopover({ children, ...props }) {
1663
1768
  }
1664
1769
 
1665
1770
  // src/components/DropdownSelector/utils/findPreviewRecursive.tsx
1666
- import * as React8 from "react";
1771
+ import * as React10 from "react";
1667
1772
  function findPreviewRecursive(children, value) {
1668
- const childArray = React8.Children.toArray(children);
1773
+ const childArray = React10.Children.toArray(children);
1669
1774
  for (let i = 0; i < childArray.length; i++) {
1670
1775
  const child = childArray[i];
1671
- if (React8.isValidElement(child)) {
1776
+ if (React10.isValidElement(child)) {
1672
1777
  if ("value" in child.props) {
1673
1778
  const childValue = child.props.value;
1674
1779
  if (childValue === value && "children" in child.props) {
@@ -1690,12 +1795,12 @@ function findPreviewRecursive(children, value) {
1690
1795
  }
1691
1796
 
1692
1797
  // src/components/DropdownSelector/MenuList/index.tsx
1693
- import { useRef as useRef6 } from "react";
1694
- import styled15 from "styled-components";
1798
+ import { useRef as useRef8 } from "react";
1799
+ import styled16 from "styled-components";
1695
1800
 
1696
1801
  // src/components/DropdownSelector/MenuList/MenuListContext.ts
1697
- import { createContext as createContext5 } from "react";
1698
- var MenuListContext = createContext5({
1802
+ import { createContext as createContext6 } from "react";
1803
+ var MenuListContext = createContext6({
1699
1804
  root: void 0,
1700
1805
  value: "",
1701
1806
  values: [],
@@ -1704,12 +1809,12 @@ var MenuListContext = createContext5({
1704
1809
  });
1705
1810
 
1706
1811
  // src/components/DropdownSelector/MenuList/internals/getValuesRecursive.tsx
1707
- import * as React9 from "react";
1812
+ import * as React11 from "react";
1708
1813
  function getValuesRecursive(children, values = []) {
1709
- const childArray = React9.Children.toArray(children);
1814
+ const childArray = React11.Children.toArray(children);
1710
1815
  for (let i = 0; i < childArray.length; i++) {
1711
1816
  const child = childArray[i];
1712
- if (React9.isValidElement(child)) {
1817
+ if (React11.isValidElement(child)) {
1713
1818
  const props = child.props;
1714
1819
  if ("value" in props && typeof props.value === "string") {
1715
1820
  const childValue = props.value;
@@ -1723,12 +1828,12 @@ function getValuesRecursive(children, values = []) {
1723
1828
  }
1724
1829
 
1725
1830
  // src/components/DropdownSelector/MenuList/index.tsx
1726
- import { jsx as jsx18 } from "react/jsx-runtime";
1831
+ import { jsx as jsx19 } from "react/jsx-runtime";
1727
1832
  function MenuList(props) {
1728
- const root = useRef6(null);
1833
+ const root = useRef8(null);
1729
1834
  const values = [];
1730
1835
  getValuesRecursive(props.children, values);
1731
- return /* @__PURE__ */ jsx18(StyledUl, { ref: root, children: /* @__PURE__ */ jsx18(
1836
+ return /* @__PURE__ */ jsx19(StyledUl, { ref: root, children: /* @__PURE__ */ jsx19(
1732
1837
  MenuListContext.Provider,
1733
1838
  {
1734
1839
  value: {
@@ -1743,20 +1848,20 @@ function MenuList(props) {
1743
1848
  }
1744
1849
  ) });
1745
1850
  }
1746
- var StyledUl = styled15.ul`
1851
+ var StyledUl = styled16.ul`
1747
1852
  padding: 0;
1748
1853
  margin: 0;
1749
1854
  `;
1750
1855
 
1751
1856
  // src/components/DropdownSelector/index.tsx
1752
- import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
1857
+ import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
1753
1858
  var defaultRequiredText = "*\u5FC5\u9808";
1754
1859
  function DropdownSelector(props) {
1755
- const triggerRef = useRef7(null);
1860
+ const triggerRef = useRef9(null);
1756
1861
  const [isOpen, setIsOpen] = useState3(false);
1757
1862
  const preview = findPreviewRecursive(props.children, props.value);
1758
1863
  return /* @__PURE__ */ jsxs10(DropdownSelectorRoot, { "aria-disabled": props.disabled, children: [
1759
- props.showLabel === true && /* @__PURE__ */ jsx19(
1864
+ props.showLabel === true && /* @__PURE__ */ jsx20(
1760
1865
  DropdownFieldLabel,
1761
1866
  {
1762
1867
  label: props.label,
@@ -1778,19 +1883,19 @@ function DropdownSelector(props) {
1778
1883
  ref: triggerRef,
1779
1884
  type: "button",
1780
1885
  children: [
1781
- /* @__PURE__ */ jsx19(DropdownButtonText, { children: props.placeholder !== void 0 && preview === void 0 ? props.placeholder : preview }),
1782
- /* @__PURE__ */ jsx19(DropdownButtonIcon, { name: "16/Menu" })
1886
+ /* @__PURE__ */ jsx20(DropdownButtonText, { children: props.placeholder !== void 0 && preview === void 0 ? props.placeholder : preview }),
1887
+ /* @__PURE__ */ jsx20(DropdownButtonIcon, { name: "16/Menu" })
1783
1888
  ]
1784
1889
  }
1785
1890
  ),
1786
- isOpen && /* @__PURE__ */ jsx19(
1891
+ isOpen && /* @__PURE__ */ jsx20(
1787
1892
  DropdownPopover,
1788
1893
  {
1789
1894
  isOpen,
1790
1895
  onClose: () => setIsOpen(false),
1791
1896
  triggerRef,
1792
1897
  value: props.value,
1793
- children: /* @__PURE__ */ jsx19(
1898
+ children: /* @__PURE__ */ jsx20(
1794
1899
  MenuList,
1795
1900
  {
1796
1901
  value: props.value,
@@ -1803,10 +1908,10 @@ function DropdownSelector(props) {
1803
1908
  )
1804
1909
  }
1805
1910
  ),
1806
- props.assistiveText !== void 0 && /* @__PURE__ */ jsx19(AssertiveText, { invalid: props.invalid, children: props.assistiveText })
1911
+ props.assistiveText !== void 0 && /* @__PURE__ */ jsx20(AssertiveText, { invalid: props.invalid, children: props.assistiveText })
1807
1912
  ] });
1808
1913
  }
1809
- var DropdownSelectorRoot = styled16.div`
1914
+ var DropdownSelectorRoot = styled17.div`
1810
1915
  display: inline-block;
1811
1916
  width: 100%;
1812
1917
 
@@ -1815,12 +1920,12 @@ var DropdownSelectorRoot = styled16.div`
1815
1920
  ${theme((o) => o.disabled)}
1816
1921
  }
1817
1922
  `;
1818
- var DropdownFieldLabel = styled16(FieldLabel_default)`
1923
+ var DropdownFieldLabel = styled17(FieldLabel_default)`
1819
1924
  width: 100%;
1820
1925
 
1821
1926
  ${theme((o) => o.margin.bottom(8))}
1822
1927
  `;
1823
- var DropdownButton = styled16.button`
1928
+ var DropdownButton = styled17.button`
1824
1929
  display: flex;
1825
1930
  justify-content: space-between;
1826
1931
  align-items: center;
@@ -1843,15 +1948,15 @@ var DropdownButton = styled16.button`
1843
1948
  invalid === true && o.outline.assertive
1844
1949
  ])}
1845
1950
  `;
1846
- var DropdownButtonText = styled16.span`
1951
+ var DropdownButtonText = styled17.span`
1847
1952
  text-align: left;
1848
1953
 
1849
1954
  ${theme((o) => [o.typography(14), o.font.text2])}
1850
1955
  `;
1851
- var DropdownButtonIcon = styled16(Icon_default)`
1956
+ var DropdownButtonIcon = styled17(Icon_default)`
1852
1957
  ${theme((o) => [o.font.text2])}
1853
1958
  `;
1854
- var AssertiveText = styled16.div`
1959
+ var AssertiveText = styled17.div`
1855
1960
  ${({ invalid }) => theme((o) => [
1856
1961
  o.typography(14),
1857
1962
  o.margin.top(8),
@@ -1860,19 +1965,19 @@ var AssertiveText = styled16.div`
1860
1965
  `;
1861
1966
 
1862
1967
  // src/components/DropdownSelector/DropdownMenuItem.tsx
1863
- import styled18 from "styled-components";
1968
+ import styled19 from "styled-components";
1864
1969
 
1865
1970
  // src/components/DropdownSelector/ListItem/index.tsx
1866
- import styled17 from "styled-components";
1867
- import { jsx as jsx20 } from "react/jsx-runtime";
1971
+ import styled18 from "styled-components";
1972
+ import { jsx as jsx21 } from "react/jsx-runtime";
1868
1973
  function ListItem(props) {
1869
1974
  const { children, ...rest } = props;
1870
- return /* @__PURE__ */ jsx20(StyledLi, { role: "option", children: /* @__PURE__ */ jsx20(ItemDiv, { ...rest, children: props.children }) });
1975
+ return /* @__PURE__ */ jsx21(StyledLi, { role: "option", children: /* @__PURE__ */ jsx21(ItemDiv, { ...rest, children: props.children }) });
1871
1976
  }
1872
- var StyledLi = styled17.li`
1977
+ var StyledLi = styled18.li`
1873
1978
  list-style: none;
1874
1979
  `;
1875
- var ItemDiv = styled17.div`
1980
+ var ItemDiv = styled18.div`
1876
1981
  display: flex;
1877
1982
  align-items: center;
1878
1983
  min-height: 40px;
@@ -1893,7 +1998,7 @@ var ItemDiv = styled17.div`
1893
1998
  `;
1894
1999
 
1895
2000
  // src/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.tsx
1896
- import { useCallback as useCallback5, useContext as useContext5 } from "react";
2001
+ import { useCallback as useCallback5, useContext as useContext7 } from "react";
1897
2002
 
1898
2003
  // src/components/DropdownSelector/MenuItem/internals/handleFocusByKeyBoard.tsx
1899
2004
  function handleFocusByKeyBoard(element, parent) {
@@ -1926,7 +2031,7 @@ function scrollIfNeeded(element) {
1926
2031
 
1927
2032
  // src/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.tsx
1928
2033
  function useMenuItemHandleKeyDown(value) {
1929
- const { setValue, root, values } = useContext5(MenuListContext);
2034
+ const { setValue, root, values } = useContext7(MenuListContext);
1930
2035
  const setContextValue = useCallback5(() => {
1931
2036
  if (value !== void 0)
1932
2037
  setValue(value);
@@ -1958,11 +2063,11 @@ function useMenuItemHandleKeyDown(value) {
1958
2063
  }
1959
2064
 
1960
2065
  // src/components/DropdownSelector/MenuItem/index.tsx
1961
- import { jsx as jsx21 } from "react/jsx-runtime";
2066
+ import { jsx as jsx22 } from "react/jsx-runtime";
1962
2067
  function MenuItem(props) {
1963
2068
  const { children, as, ...rest } = props;
1964
2069
  const [handleKeyDown, setContextValue] = useMenuItemHandleKeyDown(props.value);
1965
- return /* @__PURE__ */ jsx21(
2070
+ return /* @__PURE__ */ jsx22(
1966
2071
  ListItem,
1967
2072
  {
1968
2073
  ...rest,
@@ -1978,86 +2083,86 @@ function MenuItem(props) {
1978
2083
  }
1979
2084
 
1980
2085
  // src/components/DropdownSelector/DropdownMenuItem.tsx
1981
- import { useContext as useContext6 } from "react";
1982
- import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
2086
+ import { useContext as useContext8 } from "react";
2087
+ import { jsx as jsx23, jsxs as jsxs11 } from "react/jsx-runtime";
1983
2088
  function DropdownMenuItem(props) {
1984
- const { value: ctxValue } = useContext6(MenuListContext);
2089
+ const { value: ctxValue } = useContext8(MenuListContext);
1985
2090
  const isSelected = props.value === ctxValue;
1986
2091
  const { children, ...rest } = props;
1987
2092
  return /* @__PURE__ */ jsxs11(MenuItem, { ...rest, children: [
1988
- isSelected && /* @__PURE__ */ jsx22(Text2ColorIcon, { name: "16/Check" }),
1989
- /* @__PURE__ */ jsx22(StyledSpan, { isSelected, children: props.children })
2093
+ isSelected && /* @__PURE__ */ jsx23(Text2ColorIcon, { name: "16/Check" }),
2094
+ /* @__PURE__ */ jsx23(StyledSpan, { isSelected, children: props.children })
1990
2095
  ] });
1991
2096
  }
1992
- var StyledSpan = styled18.span`
2097
+ var StyledSpan = styled19.span`
1993
2098
  ${theme((o) => [o.typography(14), o.font.text2])};
1994
2099
  display: flex;
1995
2100
  align-items: center;
1996
2101
  width: 100%;
1997
2102
  margin-left: ${({ isSelected }) => isSelected === true ? 0 : 20}px;
1998
2103
  `;
1999
- var Text2ColorIcon = styled18(Icon_default)`
2104
+ var Text2ColorIcon = styled19(Icon_default)`
2000
2105
  ${theme((o) => [o.font.text2])}
2001
2106
  padding-right: 4px;
2002
2107
  `;
2003
2108
 
2004
2109
  // src/components/DropdownSelector/MenuItemGroup/index.tsx
2005
- import styled19 from "styled-components";
2006
- import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
2110
+ import styled20 from "styled-components";
2111
+ import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
2007
2112
  function MenuItemGroup(props) {
2008
2113
  return /* @__PURE__ */ jsxs12(StyledLi2, { role: "presentation", children: [
2009
- /* @__PURE__ */ jsx23(TextSpan, { children: props.text }),
2010
- /* @__PURE__ */ jsx23(StyledUl2, { role: "group", children: props.children })
2114
+ /* @__PURE__ */ jsx24(TextSpan, { children: props.text }),
2115
+ /* @__PURE__ */ jsx24(StyledUl2, { role: "group", children: props.children })
2011
2116
  ] });
2012
2117
  }
2013
- var TextSpan = styled19.span`
2118
+ var TextSpan = styled20.span`
2014
2119
  display: block;
2015
2120
  color: ${({ theme: theme3 }) => theme3.color.text3};
2016
2121
  font-size: 12px;
2017
2122
  font-weight: bold;
2018
2123
  padding: 12px 0 8px 16px;
2019
2124
  `;
2020
- var StyledUl2 = styled19.ul`
2125
+ var StyledUl2 = styled20.ul`
2021
2126
  padding-left: 0;
2022
2127
  margin: 0;
2023
2128
  box-sizing: border-box;
2024
2129
  list-style: none;
2025
2130
  overflow: hidden;
2026
2131
  `;
2027
- var StyledLi2 = styled19.li`
2132
+ var StyledLi2 = styled20.li`
2028
2133
  display: block;
2029
2134
  `;
2030
2135
 
2031
2136
  // src/components/SegmentedControl/index.tsx
2032
- import { forwardRef as forwardRef14, memo as memo6, useMemo as useMemo2, useRef as useRef8 } from "react";
2137
+ import { forwardRef as forwardRef15, memo as memo6, useMemo as useMemo2, useRef as useRef10 } from "react";
2033
2138
  import { useRadioGroupState } from "react-stately";
2034
2139
  import {
2035
2140
  useRadio,
2036
2141
  useRadioGroup
2037
2142
  } from "@react-aria/radio";
2038
- import styled20 from "styled-components";
2143
+ import styled21 from "styled-components";
2039
2144
  import { disabledSelector as disabledSelector5 } from "@charcoal-ui/utils";
2040
2145
 
2041
2146
  // src/components/SegmentedControl/RadioGroupContext.tsx
2042
- import { createContext as createContext6, useContext as useContext7 } from "react";
2043
- import { jsx as jsx24 } from "react/jsx-runtime";
2044
- var RadioContext = createContext6(null);
2147
+ import { createContext as createContext7, useContext as useContext9 } from "react";
2148
+ import { jsx as jsx25 } from "react/jsx-runtime";
2149
+ var RadioContext = createContext7(null);
2045
2150
  var RadioProvider = ({
2046
2151
  value,
2047
2152
  children
2048
2153
  }) => {
2049
- return /* @__PURE__ */ jsx24(RadioContext.Provider, { value, children });
2154
+ return /* @__PURE__ */ jsx25(RadioContext.Provider, { value, children });
2050
2155
  };
2051
2156
  var useRadioContext = () => {
2052
- const state = useContext7(RadioContext);
2157
+ const state = useContext9(RadioContext);
2053
2158
  if (state === null)
2054
2159
  throw new Error("`<RadioProvider>` is not likely mounted.");
2055
2160
  return state;
2056
2161
  };
2057
2162
 
2058
2163
  // src/components/SegmentedControl/index.tsx
2059
- import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
2060
- var SegmentedControl = forwardRef14(
2164
+ import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
2165
+ var SegmentedControl = forwardRef15(
2061
2166
  function SegmentedControlInner(props, ref) {
2062
2167
  const ariaRadioGroupProps = useMemo2(
2063
2168
  () => ({
@@ -2076,13 +2181,13 @@ var SegmentedControl = forwardRef14(
2076
2181
  (d) => typeof d === "string" ? { value: d, label: d } : d
2077
2182
  );
2078
2183
  }, [props.data]);
2079
- return /* @__PURE__ */ jsx25(
2184
+ return /* @__PURE__ */ jsx26(
2080
2185
  SegmentedControlRoot,
2081
2186
  {
2082
2187
  ref,
2083
2188
  ...radioGroupProps,
2084
2189
  className: props.className,
2085
- children: /* @__PURE__ */ jsx25(RadioProvider, { value: state, children: segmentedControlItems.map((item) => /* @__PURE__ */ jsx25(
2190
+ children: /* @__PURE__ */ jsx26(RadioProvider, { value: state, children: segmentedControlItems.map((item) => /* @__PURE__ */ jsx26(
2086
2191
  Segmented,
2087
2192
  {
2088
2193
  value: item.value,
@@ -2098,7 +2203,7 @@ var SegmentedControl = forwardRef14(
2098
2203
  var SegmentedControl_default = memo6(SegmentedControl);
2099
2204
  var Segmented = (props) => {
2100
2205
  const state = useRadioContext();
2101
- const ref = useRef8(null);
2206
+ const ref = useRef10(null);
2102
2207
  const ariaRadioProps = useMemo2(
2103
2208
  () => ({
2104
2209
  value: props.value,
@@ -2118,19 +2223,19 @@ var Segmented = (props) => {
2118
2223
  "aria-disabled": isDisabled || state.isReadOnly,
2119
2224
  checked: isSelected,
2120
2225
  children: [
2121
- /* @__PURE__ */ jsx25(SegmentedInput, { ...inputProps, ref }),
2122
- /* @__PURE__ */ jsx25(RadioLabel2, { children: /* @__PURE__ */ jsx25(SegmentedLabelInner, { children: props.children }) })
2226
+ /* @__PURE__ */ jsx26(SegmentedInput, { ...inputProps, ref }),
2227
+ /* @__PURE__ */ jsx26(RadioLabel2, { children: /* @__PURE__ */ jsx26(SegmentedLabelInner, { children: props.children }) })
2123
2228
  ]
2124
2229
  }
2125
2230
  );
2126
2231
  };
2127
- var SegmentedControlRoot = styled20.div`
2232
+ var SegmentedControlRoot = styled21.div`
2128
2233
  display: inline-flex;
2129
2234
  align-items: center;
2130
2235
 
2131
2236
  ${theme((o) => [o.bg.surface3, o.borderRadius(16)])}
2132
2237
  `;
2133
- var SegmentedRoot = styled20.label`
2238
+ var SegmentedRoot = styled21.label`
2134
2239
  position: relative;
2135
2240
  display: flex;
2136
2241
  align-items: center;
@@ -2149,7 +2254,7 @@ var SegmentedRoot = styled20.label`
2149
2254
  checked === true ? o.font.text5 : o.font.text2
2150
2255
  ])}
2151
2256
  `;
2152
- var SegmentedInput = styled20.input`
2257
+ var SegmentedInput = styled21.input`
2153
2258
  position: absolute;
2154
2259
 
2155
2260
  height: 0px;
@@ -2163,25 +2268,25 @@ var SegmentedInput = styled20.input`
2163
2268
  white-space: nowrap;
2164
2269
  opacity: 0;
2165
2270
  `;
2166
- var RadioLabel2 = styled20.div`
2271
+ var RadioLabel2 = styled21.div`
2167
2272
  background: transparent;
2168
2273
  display: flex;
2169
2274
  align-items: center;
2170
2275
  height: 22px;
2171
2276
  `;
2172
- var SegmentedLabelInner = styled20.div`
2277
+ var SegmentedLabelInner = styled21.div`
2173
2278
  ${theme((o) => [o.typography(14)])}
2174
2279
  `;
2175
2280
 
2176
2281
  // src/components/Checkbox/index.tsx
2177
- import { forwardRef as forwardRef15, memo as memo7, useMemo as useMemo3 } from "react";
2178
- import styled21, { css as css5 } from "styled-components";
2282
+ import { forwardRef as forwardRef16, memo as memo7, useMemo as useMemo3 } from "react";
2283
+ import styled22, { css as css7 } from "styled-components";
2179
2284
  import { useCheckbox } from "@react-aria/checkbox";
2180
2285
  import { useObjectRef as useObjectRef3 } from "@react-aria/utils";
2181
2286
  import { useToggleState as useToggleState2 } from "react-stately";
2182
2287
  import { disabledSelector as disabledSelector6, px as px3 } from "@charcoal-ui/utils";
2183
- import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
2184
- var Checkbox = forwardRef15(
2288
+ import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
2289
+ var Checkbox = forwardRef16(
2185
2290
  function CheckboxInner({ invalid = false, ...props }, ref) {
2186
2291
  const ariaCheckboxProps = useMemo3(
2187
2292
  () => ({
@@ -2200,18 +2305,18 @@ var Checkbox = forwardRef15(
2200
2305
  const isDisabled = (props.disabled ?? false) || (props.readonly ?? false);
2201
2306
  return /* @__PURE__ */ jsxs14(InputRoot, { "aria-disabled": isDisabled, className: props.className, children: [
2202
2307
  /* @__PURE__ */ jsxs14(CheckboxRoot, { children: [
2203
- /* @__PURE__ */ jsx26(CheckboxInput, { type: "checkbox", ...inputProps, invalid }),
2204
- /* @__PURE__ */ jsx26(CheckboxInputOverlay, { "aria-hidden": true, checked: inputProps.checked, children: /* @__PURE__ */ jsx26(Icon_default, { name: "24/Check", unsafeNonGuidelineScale: 2 / 3 }) })
2308
+ /* @__PURE__ */ jsx27(CheckboxInput, { type: "checkbox", ...inputProps, invalid }),
2309
+ /* @__PURE__ */ jsx27(CheckboxInputOverlay, { "aria-hidden": true, checked: inputProps.checked, children: /* @__PURE__ */ jsx27(Icon_default, { name: "24/Check", unsafeNonGuidelineScale: 2 / 3 }) })
2205
2310
  ] }),
2206
- "children" in props && /* @__PURE__ */ jsx26(InputLabel, { children: props.children })
2311
+ "children" in props && /* @__PURE__ */ jsx27(InputLabel, { children: props.children })
2207
2312
  ] });
2208
2313
  }
2209
2314
  );
2210
2315
  var Checkbox_default = memo7(Checkbox);
2211
- var hiddenCss = css5`
2316
+ var hiddenCss = css7`
2212
2317
  visibility: hidden;
2213
2318
  `;
2214
- var InputRoot = styled21.label`
2319
+ var InputRoot = styled22.label`
2215
2320
  position: relative;
2216
2321
  display: flex;
2217
2322
 
@@ -2223,10 +2328,10 @@ var InputRoot = styled21.label`
2223
2328
  gap: ${({ theme: theme3 }) => px3(theme3.spacing[4])};
2224
2329
  ${theme((o) => [o.disabled])}
2225
2330
  `;
2226
- var CheckboxRoot = styled21.div`
2331
+ var CheckboxRoot = styled22.div`
2227
2332
  position: relative;
2228
2333
  `;
2229
- var CheckboxInput = styled21.input`
2334
+ var CheckboxInput = styled22.input`
2230
2335
  &[type='checkbox'] {
2231
2336
  appearance: none;
2232
2337
  display: block;
@@ -2250,7 +2355,7 @@ var CheckboxInput = styled21.input`
2250
2355
  transition: all 0.2s !important;
2251
2356
  }
2252
2357
  `;
2253
- var CheckboxInputOverlay = styled21.div`
2358
+ var CheckboxInputOverlay = styled22.div`
2254
2359
  position: absolute;
2255
2360
  top: -2px;
2256
2361
  left: -2px;
@@ -2263,7 +2368,7 @@ var CheckboxInputOverlay = styled21.div`
2263
2368
 
2264
2369
  ${({ checked }) => checked !== true && hiddenCss};
2265
2370
  `;
2266
- var InputLabel = styled21.div`
2371
+ var InputLabel = styled22.div`
2267
2372
  ${theme((o) => [o.font.text2])}
2268
2373
 
2269
2374
  font-size: 14px;
@@ -2272,17 +2377,17 @@ var InputLabel = styled21.div`
2272
2377
  `;
2273
2378
 
2274
2379
  // src/components/TagItem/index.tsx
2275
- import { forwardRef as forwardRef16, memo as memo8, useMemo as useMemo4 } from "react";
2380
+ import { forwardRef as forwardRef17, memo as memo8, useMemo as useMemo4 } from "react";
2276
2381
  import { useObjectRef as useObjectRef4 } from "@react-aria/utils";
2277
- import styled22, { css as css6 } from "styled-components";
2382
+ import styled23, { css as css8 } from "styled-components";
2278
2383
  import { disabledSelector as disabledSelector7, px as px4 } from "@charcoal-ui/utils";
2279
2384
  import { useButton } from "@react-aria/button";
2280
- import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
2385
+ import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
2281
2386
  var sizeMap = {
2282
2387
  S: 32,
2283
2388
  M: 40
2284
2389
  };
2285
- var TagItem = forwardRef16(
2390
+ var TagItem = forwardRef17(
2286
2391
  function TagItemInner({
2287
2392
  label,
2288
2393
  translatedLabel,
@@ -2314,13 +2419,13 @@ var TagItem = forwardRef16(
2314
2419
  ...buttonProps,
2315
2420
  className,
2316
2421
  children: [
2317
- /* @__PURE__ */ jsx27(Background, { bgColor, bgImage, status }),
2422
+ /* @__PURE__ */ jsx28(Background, { bgColor, bgImage, status }),
2318
2423
  /* @__PURE__ */ jsxs15(Inner, { children: [
2319
2424
  /* @__PURE__ */ jsxs15(LabelWrapper, { isTranslate: hasTranslatedLabel, children: [
2320
- hasTranslatedLabel && /* @__PURE__ */ jsx27(TranslatedLabel, { children: /* @__PURE__ */ jsx27(Label3, { children: translatedLabel }) }),
2321
- /* @__PURE__ */ jsx27(Label3, { children: label })
2425
+ hasTranslatedLabel && /* @__PURE__ */ jsx28(TranslatedLabel, { children: /* @__PURE__ */ jsx28(Label3, { children: translatedLabel }) }),
2426
+ /* @__PURE__ */ jsx28(Label3, { children: label })
2322
2427
  ] }),
2323
- status === "active" && /* @__PURE__ */ jsx27(Icon_default, { name: "16/Remove" })
2428
+ status === "active" && /* @__PURE__ */ jsx28(Icon_default, { name: "16/Remove" })
2324
2429
  ] })
2325
2430
  ]
2326
2431
  }
@@ -2328,7 +2433,7 @@ var TagItem = forwardRef16(
2328
2433
  }
2329
2434
  );
2330
2435
  var TagItem_default = memo8(TagItem);
2331
- var TagItemRoot = styled22.a`
2436
+ var TagItemRoot = styled23.a`
2332
2437
  isolation: isolate;
2333
2438
  position: relative;
2334
2439
  height: ${({ size }) => sizeMap[size]}px;
@@ -2353,7 +2458,7 @@ var TagItemRoot = styled22.a`
2353
2458
  cursor: default;
2354
2459
  }
2355
2460
  `;
2356
- var Background = styled22.div`
2461
+ var Background = styled23.div`
2357
2462
  position: absolute;
2358
2463
  z-index: 1;
2359
2464
  top: 0;
@@ -2364,7 +2469,7 @@ var Background = styled22.div`
2364
2469
  background-color: ${({ bgColor }) => bgColor};
2365
2470
  ${({ status }) => status === "inactive" && theme((o) => o.bg.surface3)}
2366
2471
 
2367
- ${({ bgImage }) => bgImage !== void 0 && css6`
2472
+ ${({ bgImage }) => bgImage !== void 0 && css8`
2368
2473
  ${theme((o) => [o.bg.surface4])}
2369
2474
  &::before {
2370
2475
  content: '';
@@ -2380,25 +2485,25 @@ var Background = styled22.div`
2380
2485
  }
2381
2486
  `}
2382
2487
  `;
2383
- var Inner = styled22.div`
2488
+ var Inner = styled23.div`
2384
2489
  display: inline-flex;
2385
2490
  gap: ${({ theme: theme3 }) => px4(theme3.spacing[8])};
2386
2491
  align-items: center;
2387
2492
  z-index: 2;
2388
2493
  `;
2389
- var labelCSS = css6`
2494
+ var labelCSS = css8`
2390
2495
  ${theme((o) => [o.typography(14).bold])}
2391
2496
  `;
2392
- var translateLabelCSS = css6`
2497
+ var translateLabelCSS = css8`
2393
2498
  display: flex;
2394
2499
  align-items: center;
2395
2500
  flex-direction: column;
2396
2501
  font-size: 10px;
2397
2502
  `;
2398
- var LabelWrapper = styled22.div`
2503
+ var LabelWrapper = styled23.div`
2399
2504
  ${({ isTranslate }) => isTranslate ?? false ? translateLabelCSS : labelCSS}
2400
2505
  `;
2401
- var Label3 = styled22.span`
2506
+ var Label3 = styled23.span`
2402
2507
  max-width: 152px;
2403
2508
  overflow: hidden;
2404
2509
  text-overflow: ellipsis;
@@ -2407,7 +2512,7 @@ var Label3 = styled22.span`
2407
2512
  color: inherit;
2408
2513
  line-height: inherit;
2409
2514
  `;
2410
- var TranslatedLabel = styled22.div`
2515
+ var TranslatedLabel = styled23.div`
2411
2516
  ${theme((o) => [o.typography(12).bold])}
2412
2517
  `;
2413
2518
  export {