@livechat/design-system-react-components 1.0.0-alpha.1 → 1.0.0-alpha.10

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 (158) hide show
  1. package/dist/dsrc.cjs.js +1 -0
  2. package/dist/dsrc.es.js +2228 -0
  3. package/dist/dsrc.umd.js +1 -0
  4. package/dist/{components → src/components/Alert}/Alert.d.ts +13 -19
  5. package/dist/src/components/Alert/index.d.ts +1 -0
  6. package/dist/src/components/Badge/Badge.d.ts +5 -0
  7. package/dist/src/components/Badge/index.d.ts +1 -0
  8. package/dist/src/components/Button/Button.d.ts +13 -0
  9. package/dist/src/components/Button/index.d.ts +2 -0
  10. package/dist/src/components/ButtonGroup/ButtonGroup.d.ts +11 -0
  11. package/dist/src/components/ButtonGroup/index.d.ts +1 -0
  12. package/dist/src/components/Card/Card.d.ts +6 -0
  13. package/dist/src/components/Card/index.d.ts +2 -0
  14. package/dist/src/components/Checkbox/Checkbox.d.ts +7 -0
  15. package/dist/{components → src/components/Checkbox}/CheckboxField.d.ts +7 -7
  16. package/dist/src/components/Checkbox/index.d.ts +2 -0
  17. package/dist/src/components/FieldDescription/FieldDescription.d.ts +3 -0
  18. package/dist/src/components/FieldDescription/index.d.ts +1 -0
  19. package/dist/src/components/FieldError/FieldError.d.ts +3 -0
  20. package/dist/src/components/FieldError/index.d.ts +1 -0
  21. package/dist/src/components/FieldGroup/FieldGroup.d.ts +8 -0
  22. package/dist/src/components/FieldGroup/index.d.ts +1 -0
  23. package/dist/src/components/Form/Form.d.ts +7 -0
  24. package/dist/src/components/Form/index.d.ts +2 -0
  25. package/dist/src/components/FormGroup/FormGroup.d.ts +7 -0
  26. package/dist/src/components/FormGroup/index.d.ts +1 -0
  27. package/dist/{components → src/components/Icon}/Icon.d.ts +70 -69
  28. package/dist/src/components/Icon/index.d.ts +1 -0
  29. package/dist/src/components/InputField/InputField.d.ts +15 -0
  30. package/dist/src/components/InputField/index.d.ts +1 -0
  31. package/dist/src/components/Link/Link.d.ts +14 -0
  32. package/dist/src/components/Link/index.d.ts +1 -0
  33. package/dist/{components → src/components/Loader}/Loader.d.ts +10 -10
  34. package/dist/src/components/Loader/index.d.ts +1 -0
  35. package/dist/src/components/Modal/ActionModal.d.ts +8 -0
  36. package/dist/src/components/Modal/Modal.d.ts +7 -0
  37. package/dist/src/components/Modal/ModalBase.d.ts +6 -0
  38. package/dist/src/components/Modal/ModalCloseButton.d.ts +3 -0
  39. package/dist/src/components/Modal/ModalPortal.d.ts +7 -0
  40. package/dist/src/components/Modal/index.d.ts +10 -0
  41. package/dist/src/components/NumericInput/NumericInput.d.ts +14 -0
  42. package/dist/src/components/NumericInput/NumericInputField.d.ts +19 -0
  43. package/dist/src/components/NumericInput/index.d.ts +2 -0
  44. package/dist/src/components/Popover/Popover.d.ts +15 -0
  45. package/dist/src/components/Popover/index.d.ts +1 -0
  46. package/dist/{components → src/components/Progress}/ProgressCircle.d.ts +9 -9
  47. package/dist/{components → src/components/Progress}/constants.d.ts +12 -13
  48. package/dist/{components → src/components/Progress}/helpers.d.ts +3 -3
  49. package/dist/src/components/Progress/index.d.ts +1 -0
  50. package/dist/{components → src/components/PromoBanner}/PromoBanner.d.ts +19 -19
  51. package/dist/src/components/PromoBanner/index.d.ts +1 -0
  52. package/dist/src/components/RadioButton/RadioButton.d.ts +7 -0
  53. package/dist/src/components/RadioButton/index.d.ts +1 -0
  54. package/dist/{components → src/components/Switch}/Switch.d.ts +20 -17
  55. package/dist/src/components/Switch/index.d.ts +1 -0
  56. package/dist/{components → src/components/Tab}/Tab.d.ts +12 -12
  57. package/dist/{components → src/components/Tab}/TabsWrapper.d.ts +3 -3
  58. package/dist/src/components/Tab/index.d.ts +2 -0
  59. package/dist/src/components/Tag/Tag.d.ts +12 -0
  60. package/dist/src/components/Tag/index.d.ts +1 -0
  61. package/dist/src/components/TagInput/EditableTag.d.ts +11 -0
  62. package/dist/src/components/TagInput/EditableTagContent.d.ts +11 -0
  63. package/dist/src/components/TagInput/EmailTagInput.d.ts +5 -0
  64. package/dist/src/components/TagInput/TagInput.d.ts +12 -0
  65. package/dist/src/components/TagInput/index.d.ts +4 -0
  66. package/dist/src/components/TextField/TextField.d.ts +13 -0
  67. package/dist/src/components/TextField/index.d.ts +1 -0
  68. package/dist/{components → src/components/Toast}/Toast.d.ts +22 -22
  69. package/dist/{components → src/components/Toast}/ToastWrapper.d.ts +27 -26
  70. package/dist/src/components/Toast/index.d.ts +2 -0
  71. package/dist/{components → src/components/Typography}/Heading.d.ts +11 -11
  72. package/dist/{components → src/components/Typography}/Text.d.ts +15 -15
  73. package/dist/src/components/Typography/index.d.ts +2 -0
  74. package/dist/src/index.d.ts +29 -0
  75. package/dist/src/themes/designTokens.d.ts +126 -0
  76. package/dist/src/utils/keyCodes.d.ts +12 -0
  77. package/dist/src/utils/noop.d.ts +1 -0
  78. package/dist/src/vite-env.d.ts +1 -0
  79. package/dist/style.css +1 -0
  80. package/dist/themes/dark.css +129 -0
  81. package/dist/themes/dark.css.map +1 -0
  82. package/dist/themes/legacy.css +130 -0
  83. package/dist/themes/legacy.css.map +1 -0
  84. package/dist/themes/light.css +129 -0
  85. package/dist/themes/light.css.map +1 -0
  86. package/package.json +45 -37
  87. package/dist/components/Alert.spec.d.ts +0 -1
  88. package/dist/components/AlertIcon.d.ts +0 -7
  89. package/dist/components/Badge.d.ts +0 -6
  90. package/dist/components/Badge.spec.d.ts +0 -1
  91. package/dist/components/Button.d.ts +0 -12
  92. package/dist/components/Button.spec.d.ts +0 -1
  93. package/dist/components/Card.d.ts +0 -6
  94. package/dist/components/Card.spec.d.ts +0 -1
  95. package/dist/components/Checkbox.d.ts +0 -7
  96. package/dist/components/CheckboxField.spec.d.ts +0 -1
  97. package/dist/components/FieldDescription.d.ts +0 -3
  98. package/dist/components/FieldError.d.ts +0 -3
  99. package/dist/components/FieldGroup.d.ts +0 -8
  100. package/dist/components/FieldGroup.spec.d.ts +0 -1
  101. package/dist/components/FieldLabel.d.ts +0 -3
  102. package/dist/components/Form.d.ts +0 -7
  103. package/dist/components/Form.spec.d.ts +0 -1
  104. package/dist/components/FormGroup.d.ts +0 -7
  105. package/dist/components/FormGroup.spec.d.ts +0 -1
  106. package/dist/components/Loader.spec.d.ts +0 -1
  107. package/dist/components/Modal/ActionModal.d.ts +0 -8
  108. package/dist/components/Modal/Modal.d.ts +0 -7
  109. package/dist/components/Modal/ModalBase.d.ts +0 -6
  110. package/dist/components/Modal/ModalBase.spec.d.ts +0 -1
  111. package/dist/components/Modal/ModalCloseButton.d.ts +0 -3
  112. package/dist/components/Modal/ModalPortal.d.ts +0 -7
  113. package/dist/components/ProgressBar.d.ts +0 -9
  114. package/dist/components/ProgressBar.spec.d.ts +0 -1
  115. package/dist/components/ProgressCircle.spec.d.ts +0 -1
  116. package/dist/components/PromoBanner.spec.d.ts +0 -1
  117. package/dist/components/RadioButton.d.ts +0 -7
  118. package/dist/components/RadioButton.spec.d.ts +0 -1
  119. package/dist/components/Switch.spec.d.ts +0 -1
  120. package/dist/components/Tab.spec.d.ts +0 -1
  121. package/dist/components/TabsWrapper.spec.d.ts +0 -1
  122. package/dist/components/Toast.spec.d.ts +0 -1
  123. package/dist/components/ToastIcon.d.ts +0 -7
  124. package/dist/components/ToastWrapper.spec.d.ts +0 -1
  125. package/dist/constants/keyCodes.d.ts +0 -3
  126. package/dist/index.css +0 -2
  127. package/dist/index.css.map +0 -1
  128. package/dist/index.d.ts +0 -7
  129. package/dist/index.js +0 -2
  130. package/dist/index.js.map +0 -1
  131. package/dist/index.modern.js +0 -2
  132. package/dist/index.modern.js.map +0 -1
  133. package/dist/index.module.js +0 -2
  134. package/dist/index.module.js.map +0 -1
  135. package/dist/index.umd.js +0 -2
  136. package/dist/index.umd.js.map +0 -1
  137. package/dist/stories/Alert.stories.d.ts +0 -14
  138. package/dist/stories/Badge.stories.d.ts +0 -16
  139. package/dist/stories/Button.stories.d.ts +0 -21
  140. package/dist/stories/Card.stories.d.ts +0 -10
  141. package/dist/stories/CheckboxField.stories.d.ts +0 -9
  142. package/dist/stories/FieldGroup.stories.d.ts +0 -9
  143. package/dist/stories/Form.stories.d.ts +0 -6
  144. package/dist/stories/FormGroup.stories.d.ts +0 -9
  145. package/dist/stories/Icon.stories.d.ts +0 -14
  146. package/dist/stories/Loader.stories.d.ts +0 -8
  147. package/dist/stories/Modal.stories.d.ts +0 -19
  148. package/dist/stories/ProgressCircle.stories.d.ts +0 -13
  149. package/dist/stories/Progressbar.stories.d.ts +0 -13
  150. package/dist/stories/PromoBanner.stories.d.ts +0 -13
  151. package/dist/stories/RadioButton.stories.d.ts +0 -9
  152. package/dist/stories/Switch.stories.d.ts +0 -11
  153. package/dist/stories/Tab.stories.d.ts +0 -10
  154. package/dist/stories/TabsWrapper.stories.d.ts +0 -15
  155. package/dist/stories/Toast.stories.d.ts +0 -15
  156. package/dist/stories/ToastWrapper.stories.d.ts +0 -40
  157. package/dist/stories/foundations/components/IconsShowcase.d.ts +0 -6
  158. package/dist/test-utils.d.ts +0 -1
@@ -0,0 +1,2228 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import * as React from "react";
33
+ import cx from "clsx";
34
+ import { Info, Warning, CheckCircleSolid, Block, Close, Check, ChevronUp, ChevronDown, Error as Error2 } from "@livechat/design-system-icons/react/material";
35
+ import debounce from "lodash.debounce";
36
+ import * as ReactDOM from "react-dom";
37
+ import { usePopper } from "react-popper";
38
+ import { getContrast } from "polished";
39
+ import escape from "lodash.escape";
40
+ import { TransitionGroup, CSSTransition } from "react-transition-group";
41
+ var index = "";
42
+ const DesignTokens = {
43
+ Background: "--background",
44
+ SurfaceBasicDefault: "--surface-basic-default",
45
+ SurfaceBasicSubtle: "--surface-basic-subtle",
46
+ SurfaceBasicHover: "--surface-basic-hover",
47
+ SurfaceBasicActive: "--surface-basic-active",
48
+ SurfaceBasicDisabled: "--surface-basic-disabled",
49
+ SurfaceSecondaryDefault: "--surface-secondary-default",
50
+ SurfaceSecondarySubtle: "--surface-secondary-subtle",
51
+ SurfaceSecondaryHover: "--surface-secondary-hover",
52
+ SurfaceSecondaryDisabled: "--surface-secondary-disabled",
53
+ SurfaceFeedbackInfo: "--surface-feedback-info",
54
+ SurfaceFeedbackNegative: "--surface-feedback-negative",
55
+ SurfaceFeedbackWarning: "--surface-feedback-warning",
56
+ SurfaceFeedbackPositive: "--surface-feedback-positive",
57
+ SurfaceInvertDefault: "--surface-invert-default",
58
+ SurfaceInvertSubtle: "--surface-invert-subtle",
59
+ SurfaceInvertDisabled: "--surface-invert-disabled",
60
+ SurfaceOverlay: "--surface-overlay",
61
+ ContentDefault: "--content-default",
62
+ ContentSubtle: "--content-subtle",
63
+ ContentDisabled: "--content-disabled",
64
+ ContentWhiteLocked: "--content-white-locked",
65
+ ContentInvertDefault: "--content-invert-default",
66
+ ContentInvertSubtle: "--content-invert-subtle",
67
+ ContentInvertDisabled: "--content-invert-disabled",
68
+ BorderDefault: "--border-default",
69
+ BorderSubtle: "--border-subtle",
70
+ BorderHover: "--border-hover",
71
+ BorderDisabled: "--border-disabled",
72
+ BorderInvertDefault: "--border-invert-default",
73
+ BorderInvertSubtle: "--border-invert-subtle",
74
+ BorderInvertHover: "--border-invert-hover",
75
+ BorderInvertDisabled: "--border-invert-disabled",
76
+ ColorActionActive: "--color-action-active",
77
+ ColorActionHover: "--color-action-hover",
78
+ ColorActionDefault: "--color-action-default",
79
+ ColorActionDisabled: "--color-action-disabled",
80
+ ColorNegativeActive: "--color-negative-active",
81
+ ColorNegativeHover: "--color-negative-hover",
82
+ ColorNegativeDefault: "--color-negative-default",
83
+ ColorNegativeDisabled: "--color-negative-disabled",
84
+ ColorWarningDefault: "--color-warning-default",
85
+ ColorWarningHover: "--color-warning-hover",
86
+ ColorPositiveDefault: "--color-positive-default",
87
+ ColorPositiveHover: "--color-positive-hover",
88
+ ColorPositiveDisabled: "--color-positive-disabled",
89
+ ColorBot: "--color-bot",
90
+ ColorBlack: "--color-black",
91
+ ColorWhite: "--color-white",
92
+ DecorBlue900: "--decor-blue900",
93
+ DecorBlue800: "--decor-blue800",
94
+ DecorBlue700: "--decor-blue700",
95
+ DecorBlue600: "--decor-blue600",
96
+ DecorBlue500: "--decor-blue500",
97
+ DecorBlue400: "--decor-blue400",
98
+ DecorBlue300: "--decor-blue300",
99
+ DecorBlue200: "--decor-blue200",
100
+ DecorBlue100: "--decor-blue100",
101
+ DecorBlue50: "--decor-blue50",
102
+ DecorOrange900: "--decor-orange900",
103
+ DecorOrange800: "--decor-orange800",
104
+ DecorOrange700: "--decor-orange700",
105
+ DecorOrange600: "--decor-orange600",
106
+ DecorOrange500: "--decor-orange500",
107
+ DecorOrange400: "--decor-orange400",
108
+ DecorOrange300: "--decor-orange300",
109
+ DecorOrange200: "--decor-orange200",
110
+ DecorOrange100: "--decor-orange100",
111
+ DecorOrange50: "--decor-orange50",
112
+ DecorYellow900: "--decor-yellow900",
113
+ DecorYellow800: "--decor-yellow800",
114
+ DecorYellow700: "--decor-yellow700",
115
+ DecorYellow600: "--decor-yellow600",
116
+ DecorYellow500: "--decor-yellow500",
117
+ DecorYellow400: "--decor-yellow400",
118
+ DecorYellow300: "--decor-yellow300",
119
+ DecorYellow200: "--decor-yellow200",
120
+ DecorYellow100: "--decor-yellow100",
121
+ DecorYellow50: "--decor-yellow50",
122
+ DecorGray950: "--decor-gray950",
123
+ DecorGray900: "--decor-gray900",
124
+ DecorGray800: "--decor-gray800",
125
+ DecorGray700: "--decor-gray700",
126
+ DecorGray600: "--decor-gray600",
127
+ DecorGray500: "--decor-gray500",
128
+ DecorGray400: "--decor-gray400",
129
+ DecorGray300: "--decor-gray300",
130
+ DecorGray200: "--decor-gray200",
131
+ DecorGray150: "--decor-gray150",
132
+ DecorGray100: "--decor-gray100",
133
+ DecorGray75: "--decor-gray75",
134
+ DecorGray50: "--decor-gray50",
135
+ DecorGray40: "--decor-gray40",
136
+ DecorGray20: "--decor-gray20",
137
+ DecorGreen900: "--decor-green900",
138
+ DecorGreen800: "--decor-green800",
139
+ DecorGreen700: "--decor-green700",
140
+ DecorGreen600: "--decor-green600",
141
+ DecorGreen500: "--decor-green500",
142
+ DecorGreen400: "--decor-green400",
143
+ DecorGreen300: "--decor-green300",
144
+ DecorGreen200: "--decor-green200",
145
+ DecorGreen100: "--decor-green100",
146
+ DecorGreen50: "--decor-green50",
147
+ DecorRed900: "--decor-red900",
148
+ DecorRed800: "--decor-red800",
149
+ DecorRed700: "--decor-red700",
150
+ DecorRed600: "--decor-red600",
151
+ DecorRed500: "--decor-red500",
152
+ DecorRed400: "--decor-red400",
153
+ DecorRed300: "--decor-red300",
154
+ DecorRed200: "--decor-red200",
155
+ DecorRed100: "--decor-red100",
156
+ DecorRed50: "--decor-red50",
157
+ DecorPurple900: "--decor-purple900",
158
+ DecorPurple800: "--decor-purple800",
159
+ DecorPurple700: "--decor-purple700",
160
+ DecorPurple600: "--decor-purple600",
161
+ DecorPurple500: "--decor-purple500",
162
+ DecorPurple400: "--decor-purple400",
163
+ DecorPurple300: "--decor-purple300",
164
+ DecorPurple200: "--decor-purple200",
165
+ DecorPurple100: "--decor-purple100",
166
+ DecorPurple50: "--decor-purple50"
167
+ };
168
+ const caps = "lc-Typography-module__caps___c3eNJ";
169
+ var styles$r = {
170
+ "heading-xl": "lc-Typography-module__heading-xl___nhr-6",
171
+ "heading-lg": "lc-Typography-module__heading-lg___XYF7l",
172
+ "heading-md": "lc-Typography-module__heading-md___wHOIs",
173
+ "heading-sm": "lc-Typography-module__heading-sm___nBmTV",
174
+ "heading-xs": "lc-Typography-module__heading-xs___VcZBs",
175
+ caps,
176
+ "caps--bold": "lc-Typography-module__caps--bold___OZovw",
177
+ "paragraph-md": "lc-Typography-module__paragraph-md___UGoqq",
178
+ "paragraph-md--bold": "lc-Typography-module__paragraph-md--bold___mWcMG",
179
+ "paragraph-md--underline": "lc-Typography-module__paragraph-md--underline___Fv6zM",
180
+ "paragraph-md--strike": "lc-Typography-module__paragraph-md--strike___yLGHh",
181
+ "paragraph-sm": "lc-Typography-module__paragraph-sm___QIEFL",
182
+ "paragraph-sm--bold": "lc-Typography-module__paragraph-sm--bold___fAjI5",
183
+ "paragraph-xs": "lc-Typography-module__paragraph-xs___OUooD",
184
+ "paragraph-xs--bold": "lc-Typography-module__paragraph-xs--bold___z7om7"
185
+ };
186
+ var sizeToElement = /* @__PURE__ */ ((sizeToElement2) => {
187
+ sizeToElement2["xl"] = "h1";
188
+ sizeToElement2["lg"] = "h2";
189
+ sizeToElement2["md"] = "h3";
190
+ sizeToElement2["sm"] = "h4";
191
+ sizeToElement2["xs"] = "h5";
192
+ return sizeToElement2;
193
+ })(sizeToElement || {});
194
+ const Heading = (_a) => {
195
+ var _b = _a, {
196
+ as,
197
+ size = "md",
198
+ children,
199
+ className
200
+ } = _b, props = __objRest(_b, [
201
+ "as",
202
+ "size",
203
+ "children",
204
+ "className"
205
+ ]);
206
+ return React.createElement(as || sizeToElement[size], __spreadValues({ className: cx(styles$r[`heading-${size}`], className) }, props), children);
207
+ };
208
+ const Text = (_c) => {
209
+ var _d = _c, {
210
+ as = "p",
211
+ size = "md",
212
+ caps: caps2 = false,
213
+ bold = false,
214
+ underline = false,
215
+ strike = false,
216
+ children,
217
+ className
218
+ } = _d, props = __objRest(_d, [
219
+ "as",
220
+ "size",
221
+ "caps",
222
+ "bold",
223
+ "underline",
224
+ "strike",
225
+ "children",
226
+ "className"
227
+ ]);
228
+ const baseClassPrefix = caps2 ? "caps" : `paragraph-${size}`;
229
+ return React.createElement(as, __spreadValues({
230
+ className: cx({
231
+ [styles$r[`${baseClassPrefix}`]]: true,
232
+ [styles$r[`${baseClassPrefix}--bold`]]: bold,
233
+ [styles$r[`${baseClassPrefix}--strike`]]: strike,
234
+ [styles$r[`${baseClassPrefix}--underline`]]: underline
235
+ }, className)
236
+ }, props), children);
237
+ };
238
+ const icon$1 = "lc-Icon-module__icon___tw31R";
239
+ var styles$q = {
240
+ icon: icon$1,
241
+ "icon--primary": "lc-Icon-module__icon--primary___JJnBV",
242
+ "icon--subtle": "lc-Icon-module__icon--subtle___sZIzL",
243
+ "icon--inverted": "lc-Icon-module__icon--inverted___zA9QC",
244
+ "icon--inverted-subtle": "lc-Icon-module__icon--inverted-subtle___6UwBT",
245
+ "icon--link": "lc-Icon-module__icon--link___Jwkw9",
246
+ "icon--success": "lc-Icon-module__icon--success___MKdz3",
247
+ "icon--warning": "lc-Icon-module__icon--warning___5YCSW",
248
+ "icon--error": "lc-Icon-module__icon--error___CiJCD",
249
+ "icon--disabled--primary": "lc-Icon-module__icon--disabled--primary___E0nee",
250
+ "icon--disabled--subtle": "lc-Icon-module__icon--disabled--subtle___l-hK4",
251
+ "icon--disabled--inverted": "lc-Icon-module__icon--disabled--inverted___5SBAf",
252
+ "icon--disabled--inverted-subtle": "lc-Icon-module__icon--disabled--inverted-subtle___w-NBk",
253
+ "icon--disabled--link": "lc-Icon-module__icon--disabled--link___sVJOa",
254
+ "icon--disabled--success": "lc-Icon-module__icon--disabled--success___sG-7d",
255
+ "icon--disabled--warning": "lc-Icon-module__icon--disabled--warning___8ko1e",
256
+ "icon--disabled--error": "lc-Icon-module__icon--disabled--error___9KbVo"
257
+ };
258
+ var IconSizeName = /* @__PURE__ */ ((IconSizeName2) => {
259
+ IconSizeName2["XSmall"] = "xsmall";
260
+ IconSizeName2["Small"] = "small";
261
+ IconSizeName2["Medium"] = "medium";
262
+ IconSizeName2["Large"] = "large";
263
+ IconSizeName2["XLarge"] = "xlarge";
264
+ return IconSizeName2;
265
+ })(IconSizeName || {});
266
+ const IconSize = {
267
+ ["xsmall"]: {
268
+ width: 12,
269
+ height: 12
270
+ },
271
+ ["small"]: {
272
+ width: 16,
273
+ height: 16
274
+ },
275
+ ["medium"]: {
276
+ width: 20,
277
+ height: 20
278
+ },
279
+ ["large"]: {
280
+ width: 24,
281
+ height: 24
282
+ },
283
+ ["xlarge"]: {
284
+ width: 32,
285
+ height: 32
286
+ }
287
+ };
288
+ var IconTypeName = /* @__PURE__ */ ((IconTypeName2) => {
289
+ IconTypeName2["Primary"] = "primary";
290
+ IconTypeName2["Subtle"] = "subtle";
291
+ IconTypeName2["Inverted"] = "inverted";
292
+ IconTypeName2["InvertedSubtle"] = "inverted_subtle";
293
+ IconTypeName2["Link"] = "link";
294
+ IconTypeName2["Success"] = "success";
295
+ IconTypeName2["Warning"] = "warning";
296
+ IconTypeName2["Error"] = "error";
297
+ return IconTypeName2;
298
+ })(IconTypeName || {});
299
+ const IconColorMapper = {
300
+ ["primary"]: "primary",
301
+ ["subtle"]: "subtle",
302
+ ["inverted"]: "inverted",
303
+ ["inverted_subtle"]: "inverted-subtle",
304
+ ["link"]: "link",
305
+ ["success"]: "success",
306
+ ["warning"]: "warning",
307
+ ["error"]: "error"
308
+ };
309
+ const IconColorDisabledMapper = {
310
+ ["primary"]: "disabled--primary",
311
+ ["subtle"]: "disabled--subtle",
312
+ ["inverted"]: "disabled--inverted",
313
+ ["inverted_subtle"]: "disabled--inverted-subtle",
314
+ ["link"]: "disabled--link",
315
+ ["success"]: "disabled--success",
316
+ ["warning"]: "disabled--warning",
317
+ ["error"]: "disabled--error"
318
+ };
319
+ const baseClass$t = "icon";
320
+ const Icon = (props) => {
321
+ const _a = props, {
322
+ source,
323
+ size = "medium",
324
+ iconType,
325
+ disabled,
326
+ className,
327
+ customColor
328
+ } = _a, restProps = __objRest(_a, [
329
+ "source",
330
+ "size",
331
+ "iconType",
332
+ "disabled",
333
+ "className",
334
+ "customColor"
335
+ ]);
336
+ let filledColor;
337
+ if (iconType) {
338
+ filledColor = IconColorMapper[iconType];
339
+ if (disabled) {
340
+ filledColor = IconColorDisabledMapper[iconType];
341
+ }
342
+ }
343
+ const GeneratedIcon = React.createElement(source, __spreadProps(__spreadValues({}, IconSize[size]), {
344
+ color: customColor
345
+ }));
346
+ const mergedClassNames = cx(className, styles$q[baseClass$t], filledColor && styles$q[`${baseClass$t}--${filledColor}`]);
347
+ return /* @__PURE__ */ React.createElement("span", __spreadProps(__spreadValues({}, restProps), {
348
+ className: mergedClassNames
349
+ }), GeneratedIcon);
350
+ };
351
+ const alert = "lc-Alert-module__alert___HBTns";
352
+ const alert__content = "lc-Alert-module__alert__content___9nZdf";
353
+ const alert__icon = "lc-Alert-module__alert__icon___8TaAH";
354
+ var styles$p = {
355
+ alert,
356
+ alert__content,
357
+ "alert__content-text": "lc-Alert-module__alert__content-text___x2Un5",
358
+ "alert__content-text--margin": "lc-Alert-module__alert__content-text--margin___whVzG",
359
+ "alert__content-icon": "lc-Alert-module__alert__content-icon___-EXJm",
360
+ "alert--small": "lc-Alert-module__alert--small___Fyk-v",
361
+ "alert__close-icon": "lc-Alert-module__alert__close-icon___rYxVy",
362
+ "alert--info": "lc-Alert-module__alert--info___GmIGN",
363
+ "alert--warning": "lc-Alert-module__alert--warning___MubhD",
364
+ "alert--success": "lc-Alert-module__alert--success___fPtlZ",
365
+ "alert--error": "lc-Alert-module__alert--error___DKPo0",
366
+ alert__icon
367
+ };
368
+ const IconConfig$1 = {
369
+ ["info"]: {
370
+ source: Info,
371
+ iconType: IconTypeName.Link
372
+ },
373
+ ["warning"]: {
374
+ source: Warning,
375
+ iconType: IconTypeName.Warning
376
+ },
377
+ ["success"]: {
378
+ source: CheckCircleSolid,
379
+ iconType: IconTypeName.Success
380
+ },
381
+ ["error"]: {
382
+ source: Block,
383
+ iconType: IconTypeName.Error
384
+ }
385
+ };
386
+ const baseClass$s = "alert";
387
+ const Alert = ({
388
+ children,
389
+ className,
390
+ type = "info",
391
+ onClose
392
+ }) => {
393
+ const containerRef = React.useRef(null);
394
+ const [isSmallContainer, setIsSmallContainer] = React.useState(false);
395
+ const mergedClassNames = cx(styles$p[baseClass$s], styles$p[`${baseClass$s}--${type}`], isSmallContainer && styles$p[`${baseClass$s}--small`], className);
396
+ React.useEffect(() => {
397
+ const handleResize = debounce(() => {
398
+ if (containerRef.current && containerRef.current.offsetWidth <= 400) {
399
+ return setIsSmallContainer(true);
400
+ }
401
+ return setIsSmallContainer(false);
402
+ }, 500);
403
+ window.addEventListener("resize", handleResize);
404
+ return () => window.removeEventListener("resize", handleResize);
405
+ });
406
+ return /* @__PURE__ */ React.createElement("div", {
407
+ ref: containerRef,
408
+ className: mergedClassNames
409
+ }, /* @__PURE__ */ React.createElement("div", {
410
+ className: styles$p[`${baseClass$s}__content`]
411
+ }, /* @__PURE__ */ React.createElement(Icon, __spreadProps(__spreadValues({}, IconConfig$1[type]), {
412
+ className: styles$p[`${baseClass$s}__content-icon`]
413
+ })), /* @__PURE__ */ React.createElement(Text, {
414
+ as: "div",
415
+ className: cx(styles$p[`${baseClass$s}__content-text`], onClose && styles$p[`${baseClass$s}__content-text--margin`])
416
+ }, children)), onClose && /* @__PURE__ */ React.createElement("button", {
417
+ type: "button",
418
+ className: styles$p[`${baseClass$s}__close-icon`],
419
+ onClick: onClose
420
+ }, /* @__PURE__ */ React.createElement(Icon, {
421
+ source: Close,
422
+ size: IconSizeName.Large,
423
+ iconType: IconTypeName.Primary
424
+ })));
425
+ };
426
+ const badge = "lc-Badge-module__badge___GhLnu";
427
+ var styles$o = {
428
+ badge,
429
+ "badge--secondary": "lc-Badge-module__badge--secondary___JjNIJ"
430
+ };
431
+ const Badge = ({
432
+ children,
433
+ className,
434
+ secondary = false
435
+ }) => {
436
+ return /* @__PURE__ */ React.createElement("span", {
437
+ className: cx(styles$o.badge, className, {
438
+ [styles$o["badge--secondary"]]: secondary
439
+ })
440
+ }, children);
441
+ };
442
+ const loader = "lc-Loader-module__loader___LRflD";
443
+ const loader__spinner = "lc-Loader-module__loader__spinner___l3C1g";
444
+ const rotate = "lc-Loader-module__rotate___Tlni-";
445
+ const loader__label = "lc-Loader-module__loader__label___R74f6";
446
+ var styles$n = {
447
+ loader,
448
+ loader__spinner,
449
+ "loader__spinner--small": "lc-Loader-module__loader__spinner--small___dGFFt",
450
+ "loader__spinner--medium": "lc-Loader-module__loader__spinner--medium___J-ki0",
451
+ "loader__spinner--large": "lc-Loader-module__loader__spinner--large___Poqq7",
452
+ "loader__spinner-circle": "lc-Loader-module__loader__spinner-circle___ApBUO",
453
+ rotate,
454
+ loader__label
455
+ };
456
+ const baseClass$r = "loader";
457
+ const spinnerClass = `${baseClass$r}__spinner`;
458
+ const Loader = ({
459
+ primaryColor,
460
+ secondaryColor,
461
+ label,
462
+ className,
463
+ size = "medium"
464
+ }) => {
465
+ return /* @__PURE__ */ React.createElement("div", {
466
+ className: cx(styles$n[baseClass$r], className)
467
+ }, /* @__PURE__ */ React.createElement("div", {
468
+ className: cx(styles$n[spinnerClass], styles$n[`${spinnerClass}--${size}`])
469
+ }, /* @__PURE__ */ React.createElement("div", {
470
+ className: styles$n["loader__spinner-circle"],
471
+ style: {
472
+ borderColor: secondaryColor,
473
+ borderTopColor: primaryColor
474
+ }
475
+ })), label && /* @__PURE__ */ React.createElement(Text, {
476
+ as: "div",
477
+ size: "md",
478
+ className: styles$n["loader__label"]
479
+ }, label));
480
+ };
481
+ const btn$1 = "lc-Button-module__btn___aijZJ";
482
+ const btn__loader = "lc-Button-module__btn__loader___c8zZz";
483
+ const btn__content = "lc-Button-module__btn__content___wefl2";
484
+ const btn__icon = "lc-Button-module__btn__icon___GVExB";
485
+ var styles$m = {
486
+ btn: btn$1,
487
+ "btn--disabled": "lc-Button-module__btn--disabled___lXBav",
488
+ "btn--icon-only": "lc-Button-module__btn--icon-only___bF5pW",
489
+ "btn__icon--left": "lc-Button-module__btn__icon--left___H68zu",
490
+ "btn__icon--right": "lc-Button-module__btn__icon--right___fHr3D",
491
+ "btn--full-width": "lc-Button-module__btn--full-width___kdbAr",
492
+ "btn--basic": "lc-Button-module__btn--basic___Jc2gD",
493
+ "btn--primary": "lc-Button-module__btn--primary___ajbjQ",
494
+ "btn--secondary": "lc-Button-module__btn--secondary___iWzE0",
495
+ "btn--destructive": "lc-Button-module__btn--destructive___-kLCl",
496
+ "btn--compact": "lc-Button-module__btn--compact___4eptQ",
497
+ "btn--large": "lc-Button-module__btn--large___lb-z6",
498
+ "btn--text": "lc-Button-module__btn--text___WA8OL",
499
+ "btn--plain": "lc-Button-module__btn--plain___eOPui",
500
+ "btn--plain-light": "lc-Button-module__btn--plain-light___eS9em",
501
+ "btn--loading": "lc-Button-module__btn--loading___ZAgjv",
502
+ btn__loader,
503
+ btn__content,
504
+ btn__icon
505
+ };
506
+ const baseClass$q = "btn";
507
+ const Button = (_e) => {
508
+ var _f = _e, {
509
+ loading = false,
510
+ disabled = false,
511
+ type = "button",
512
+ fullWidth = false,
513
+ kind = "basic",
514
+ size = "medium",
515
+ icon: icon2 = null,
516
+ iconPosition = "left",
517
+ loaderLabel,
518
+ className,
519
+ children,
520
+ href
521
+ } = _f, props = __objRest(_f, [
522
+ "loading",
523
+ "disabled",
524
+ "type",
525
+ "fullWidth",
526
+ "kind",
527
+ "size",
528
+ "icon",
529
+ "iconPosition",
530
+ "loaderLabel",
531
+ "className",
532
+ "children",
533
+ "href"
534
+ ]);
535
+ const isDisabled = loading || disabled;
536
+ const Component = href ? "a" : "button";
537
+ const mergedClassNames = cx(className, styles$m[baseClass$q], styles$m[`${baseClass$q}--${kind}`], styles$m[`${baseClass$q}--${size}`], {
538
+ [styles$m[`${baseClass$q}--loading`]]: loading,
539
+ [styles$m[`${baseClass$q}--full-width`]]: fullWidth,
540
+ [styles$m[`${baseClass$q}--icon-only`]]: !children && icon2,
541
+ [styles$m[`${baseClass$q}--disabled`]]: isDisabled
542
+ });
543
+ return /* @__PURE__ */ React.createElement(Component, __spreadValues({
544
+ className: mergedClassNames,
545
+ disabled: isDisabled,
546
+ type,
547
+ href: isDisabled ? void 0 : href
548
+ }, props), loading && /* @__PURE__ */ React.createElement(Loader, {
549
+ size: "small",
550
+ label: loaderLabel,
551
+ className: styles$m[`${baseClass$q}__loader`]
552
+ }), icon2 && React.cloneElement(icon2, {
553
+ className: cx(styles$m[`${baseClass$q}__icon`], styles$m[`${baseClass$q}__icon--${iconPosition}`]),
554
+ disabled
555
+ }), /* @__PURE__ */ React.createElement("div", {
556
+ className: styles$m[`${baseClass$q}__content`]
557
+ }, children));
558
+ };
559
+ const btn = "lc-ButtonGroup-module__btn___bXPrU";
560
+ var styles$l = {
561
+ "btn-group": "lc-ButtonGroup-module__btn-group___R-lZQ",
562
+ btn,
563
+ "btn--active": "lc-ButtonGroup-module__btn--active___VAc37",
564
+ "btn--compact": "lc-ButtonGroup-module__btn--compact___t1whe",
565
+ "btn--medium": "lc-ButtonGroup-module__btn--medium___XFRBP",
566
+ "btn--large": "lc-ButtonGroup-module__btn--large___OtNUz"
567
+ };
568
+ function noop() {
569
+ }
570
+ const baseClass$p = "btn-group";
571
+ const ButtonGroup = (_g) => {
572
+ var _h = _g, {
573
+ size = "medium",
574
+ fullWidth = false,
575
+ onIndexChange = noop,
576
+ className,
577
+ children,
578
+ currentIndex,
579
+ initialIndex = -1
580
+ } = _h, restProps = __objRest(_h, [
581
+ "size",
582
+ "fullWidth",
583
+ "onIndexChange",
584
+ "className",
585
+ "children",
586
+ "currentIndex",
587
+ "initialIndex"
588
+ ]);
589
+ const mergedClassName = cx(styles$l[baseClass$p], className);
590
+ const [currentStateIndex, setCurrentStateIndex] = React.useState(initialIndex);
591
+ const isControlled = typeof currentIndex === "number";
592
+ const _currentIndex = isControlled ? currentIndex : currentStateIndex;
593
+ const handleClick = (index2, event) => {
594
+ if (!isControlled) {
595
+ setCurrentStateIndex(index2);
596
+ }
597
+ onIndexChange(index2, event);
598
+ };
599
+ return /* @__PURE__ */ React.createElement("div", __spreadValues({
600
+ role: "group",
601
+ className: mergedClassName
602
+ }, restProps), React.Children.map(children, (child, i) => React.cloneElement(child, {
603
+ fullWidth,
604
+ size,
605
+ kind: "secondary",
606
+ type: "button",
607
+ onClick: (event) => {
608
+ handleClick(i, event);
609
+ if (child.props.onClick) {
610
+ child.props.onClick(event);
611
+ }
612
+ },
613
+ className: cx(styles$l["btn"], styles$l[`btn--${size}`], i === _currentIndex && styles$l["btn--active"])
614
+ })));
615
+ };
616
+ const card = "lc-Card-module__card___GqMm2";
617
+ const card__title = "lc-Card-module__card__title___1YjAR";
618
+ const card__text = "lc-Card-module__card__text___-jYlF";
619
+ const card__img = "lc-Card-module__card__img___teLC8";
620
+ var styles$k = {
621
+ card,
622
+ card__title,
623
+ card__text,
624
+ card__img
625
+ };
626
+ const Card = (_i) => {
627
+ var _j = _i, {
628
+ img,
629
+ title,
630
+ children,
631
+ className
632
+ } = _j, restProps = __objRest(_j, [
633
+ "img",
634
+ "title",
635
+ "children",
636
+ "className"
637
+ ]);
638
+ return /* @__PURE__ */ React.createElement(Text, __spreadValues({
639
+ as: "div",
640
+ size: "md",
641
+ className: cx(styles$k["card"], className)
642
+ }, restProps), (img || title) && /* @__PURE__ */ React.createElement(Heading, {
643
+ as: "div",
644
+ size: "sm",
645
+ className: styles$k["card__title"]
646
+ }, img && /* @__PURE__ */ React.createElement("img", {
647
+ src: img,
648
+ className: styles$k["card__img"]
649
+ }), title && /* @__PURE__ */ React.createElement("div", {
650
+ className: styles$k["card__text"]
651
+ }, title)), children);
652
+ };
653
+ const checkbox = "lc-Checkbox-module__checkbox___G7nTf";
654
+ const checkbox__label = "lc-Checkbox-module__checkbox__label___-o01x";
655
+ const checkbox__square = "lc-Checkbox-module__checkbox__square___MHUyd";
656
+ const checkbox__checkmark = "lc-Checkbox-module__checkbox__checkmark___16pfY";
657
+ const checkbox__input = "lc-Checkbox-module__checkbox__input___YLbVF";
658
+ const checkbox__text = "lc-Checkbox-module__checkbox__text___P2SIq";
659
+ const checkbox__helper = "lc-Checkbox-module__checkbox__helper___YSJ-n";
660
+ var styles$j = {
661
+ checkbox,
662
+ checkbox__label,
663
+ checkbox__square,
664
+ checkbox__checkmark,
665
+ "checkbox--selected": "lc-Checkbox-module__checkbox--selected___S2vqY",
666
+ checkbox__input,
667
+ checkbox__text,
668
+ "checkbox--disabled": "lc-Checkbox-module__checkbox--disabled___-lAqW",
669
+ checkbox__helper
670
+ };
671
+ const baseClass$o = "checkbox";
672
+ const Checkbox = (_k) => {
673
+ var _l = _k, {
674
+ className = ""
675
+ } = _l, props = __objRest(_l, [
676
+ "className"
677
+ ]);
678
+ const mergedClassNames = cx(styles$j[`${baseClass$o}__square`], className);
679
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues({}, props), {
680
+ className: styles$j[`${baseClass$o}__input`],
681
+ type: "checkbox"
682
+ })), /* @__PURE__ */ React.createElement("div", {
683
+ className: mergedClassNames
684
+ }, /* @__PURE__ */ React.createElement(Icon, {
685
+ source: Check,
686
+ iconType: IconTypeName.Inverted,
687
+ size: IconSizeName.XSmall,
688
+ className: styles$j[`${baseClass$o}__checkmark`]
689
+ })));
690
+ };
691
+ var styles$i = {
692
+ "field-description": "lc-FieldDescription-module__field-description___IcRDH"
693
+ };
694
+ const baseClass$n = "field-description";
695
+ const FieldDescription = (_m) => {
696
+ var _n = _m, {
697
+ children,
698
+ className = ""
699
+ } = _n, props = __objRest(_n, [
700
+ "children",
701
+ "className"
702
+ ]);
703
+ const mergedClassNames = cx(styles$i[baseClass$n], className);
704
+ return /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({
705
+ as: "span",
706
+ size: "sm"
707
+ }, props), {
708
+ className: mergedClassNames
709
+ }), children);
710
+ };
711
+ const baseClass$m = "checkbox";
712
+ const CheckboxField = (_o) => {
713
+ var _p = _o, {
714
+ children,
715
+ className = "",
716
+ description,
717
+ checked,
718
+ disabled
719
+ } = _p, props = __objRest(_p, [
720
+ "children",
721
+ "className",
722
+ "description",
723
+ "checked",
724
+ "disabled"
725
+ ]);
726
+ const mergedClassNames = cx(styles$j[baseClass$m], className, {
727
+ [styles$j[`${baseClass$m}--selected`]]: checked,
728
+ [styles$j[`${baseClass$m}--disabled`]]: disabled
729
+ });
730
+ return /* @__PURE__ */ React.createElement("div", {
731
+ className: mergedClassNames
732
+ }, /* @__PURE__ */ React.createElement("label", {
733
+ className: styles$j[`${baseClass$m}__label`]
734
+ }, /* @__PURE__ */ React.createElement(Checkbox, __spreadProps(__spreadValues({}, props), {
735
+ checked,
736
+ disabled
737
+ })), /* @__PURE__ */ React.createElement(Text, {
738
+ as: "div",
739
+ size: "md",
740
+ className: styles$j[`${baseClass$m}__text`]
741
+ }, children)), description && /* @__PURE__ */ React.createElement(FieldDescription, {
742
+ className: styles$j[`${baseClass$m}__helper`]
743
+ }, description));
744
+ };
745
+ var styles$h = {
746
+ "field-error": "lc-FieldError-module__field-error___IDkPT"
747
+ };
748
+ const baseClass$l = "field-error";
749
+ const FieldError = (_q) => {
750
+ var _r = _q, {
751
+ children,
752
+ className = ""
753
+ } = _r, props = __objRest(_r, [
754
+ "children",
755
+ "className"
756
+ ]);
757
+ const mergedClassNames = cx(styles$h[baseClass$l], className);
758
+ return /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({
759
+ as: "span",
760
+ size: "sm"
761
+ }, props), {
762
+ className: mergedClassNames
763
+ }), children);
764
+ };
765
+ var styles$g = {
766
+ "field-group": "lc-FieldGroup-module__field-group___gy8lp",
767
+ "field-group--inline": "lc-FieldGroup-module__field-group--inline___or4qf",
768
+ "field-group--stretched": "lc-FieldGroup-module__field-group--stretched___6rkuO"
769
+ };
770
+ const baseClass$k = "field-group";
771
+ const FieldGroup = (_s) => {
772
+ var _t = _s, {
773
+ className = "",
774
+ children,
775
+ description,
776
+ error,
777
+ inline,
778
+ stretch
779
+ } = _t, props = __objRest(_t, [
780
+ "className",
781
+ "children",
782
+ "description",
783
+ "error",
784
+ "inline",
785
+ "stretch"
786
+ ]);
787
+ const mergedClassNames = cx(styles$g[baseClass$k], className, {
788
+ [styles$g[`${baseClass$k}--inline`]]: inline,
789
+ [styles$g[`${baseClass$k}--stretched`]]: stretch
790
+ });
791
+ return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({}, props), {
792
+ className: mergedClassNames
793
+ }), children, error && /* @__PURE__ */ React.createElement(FieldError, null, error), description && /* @__PURE__ */ React.createElement(FieldDescription, null, description));
794
+ };
795
+ const form = "lc-Form-module__form___1nOYF";
796
+ const form__header = "lc-Form-module__form__header___U4B7t";
797
+ const form__footer = "lc-Form-module__form__footer___1-sUX";
798
+ const form__label = "lc-Form-module__form__label___spg-J";
799
+ const form__helper = "lc-Form-module__form__helper___bhfwS";
800
+ var styles$f = {
801
+ form,
802
+ form__header,
803
+ form__footer,
804
+ form__label,
805
+ form__helper
806
+ };
807
+ const baseClass$j = "form";
808
+ const Form = (_u) => {
809
+ var _v = _u, {
810
+ className,
811
+ children,
812
+ labelText,
813
+ helperText,
814
+ formFooter
815
+ } = _v, restProps = __objRest(_v, [
816
+ "className",
817
+ "children",
818
+ "labelText",
819
+ "helperText",
820
+ "formFooter"
821
+ ]);
822
+ return /* @__PURE__ */ React.createElement("form", __spreadValues({
823
+ className: cx(styles$f[baseClass$j], className)
824
+ }, restProps), (labelText || helperText) && /* @__PURE__ */ React.createElement("div", {
825
+ className: styles$f[`${baseClass$j}__header`]
826
+ }, labelText && /* @__PURE__ */ React.createElement(Heading, {
827
+ size: "sm",
828
+ className: styles$f[`${baseClass$j}__label`]
829
+ }, labelText), helperText && /* @__PURE__ */ React.createElement(Text, {
830
+ as: "p",
831
+ size: "sm",
832
+ className: styles$f[`${baseClass$j}__helper`]
833
+ }, helperText)), children, formFooter && /* @__PURE__ */ React.createElement("div", {
834
+ className: styles$f[`${baseClass$j}__footer`]
835
+ }, formFooter));
836
+ };
837
+ var styles$e = {
838
+ "form-group": "lc-FormGroup-module__form-group___e2JHa",
839
+ "form-group__header": "lc-FormGroup-module__form-group__header___DgGmR",
840
+ "form-group__label": "lc-FormGroup-module__form-group__label___NC-JW",
841
+ "form-group__helper": "lc-FormGroup-module__form-group__helper___SRuxe"
842
+ };
843
+ const baseClass$i = "form-group";
844
+ const FormGroup = (_w) => {
845
+ var _x = _w, {
846
+ className = "",
847
+ children,
848
+ labelText,
849
+ helperText
850
+ } = _x, props = __objRest(_x, [
851
+ "className",
852
+ "children",
853
+ "labelText",
854
+ "helperText"
855
+ ]);
856
+ const mergedClassNames = cx(styles$e[baseClass$i], className);
857
+ return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
858
+ role: "group"
859
+ }), labelText && { "aria-label": labelText }), {
860
+ className: mergedClassNames
861
+ }), /* @__PURE__ */ React.createElement("div", {
862
+ className: styles$e[`${baseClass$i}__header`]
863
+ }, /* @__PURE__ */ React.createElement(Heading, {
864
+ as: "div",
865
+ size: "sm",
866
+ className: styles$e[`${baseClass$i}__label`]
867
+ }, labelText), helperText && /* @__PURE__ */ React.createElement(Text, {
868
+ as: "div",
869
+ size: "sm",
870
+ className: styles$e[`${baseClass$i}__helper`]
871
+ }, helperText)), children);
872
+ };
873
+ var styles$d = {
874
+ "text-field": "lc-TextField-module__text-field___bis8c",
875
+ "text-field--inline": "lc-TextField-module__text-field--inline___MPHqg",
876
+ "text-field__wrapper--inline": "lc-TextField-module__text-field__wrapper--inline___-gOob",
877
+ "text-field__label": "lc-TextField-module__text-field__label___vpNdg",
878
+ "text-field__label--inline": "lc-TextField-module__text-field__label--inline___YSRYX",
879
+ "text-field__label--no-text": "lc-TextField-module__text-field__label--no-text___XSyn2",
880
+ "text-field__label-wrapper": "lc-TextField-module__text-field__label-wrapper___SNCct",
881
+ "text-field__label-adornment": "lc-TextField-module__text-field__label-adornment___--pgp",
882
+ "text-field__label-right-node": "lc-TextField-module__text-field__label-right-node___sdnWg",
883
+ "text-field__label-right-node--inline": "lc-TextField-module__text-field__label-right-node--inline___vMBP2",
884
+ "text-field__row-break": "lc-TextField-module__text-field__row-break___AnNrI",
885
+ "text-field__content": "lc-TextField-module__text-field__content___dCkUW",
886
+ "field-label": "lc-TextField-module__field-label___q8Y-p"
887
+ };
888
+ const baseClass$h = "text-field";
889
+ const TextField = ({
890
+ inline,
891
+ error,
892
+ description,
893
+ labelText,
894
+ labelAdornment,
895
+ className,
896
+ labelFor,
897
+ children,
898
+ labelRightNode
899
+ }) => {
900
+ const mergedClassNames = cx(styles$d[baseClass$h], {
901
+ [styles$d[`${baseClass$h}--inline`]]: inline
902
+ }, className);
903
+ return /* @__PURE__ */ React.createElement("div", {
904
+ className: mergedClassNames
905
+ }, labelRightNode && inline && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
906
+ className: cx(styles$d[`${baseClass$h}__label-right-node`], styles$d[`${baseClass$h}__label-right-node--inline`])
907
+ }, labelRightNode), /* @__PURE__ */ React.createElement("div", {
908
+ className: styles$d[`${baseClass$h}__row-break`]
909
+ })), /* @__PURE__ */ React.createElement("div", {
910
+ className: cx(styles$d[`${baseClass$h}__wrapper`], inline && styles$d[`${baseClass$h}__wrapper--inline`])
911
+ }, (labelText || labelRightNode) && /* @__PURE__ */ React.createElement("div", {
912
+ className: cx(styles$d[`${baseClass$h}__label`], inline && styles$d[`${baseClass$h}__label--inline`], !labelText && styles$d[`${baseClass$h}__label--no-text`])
913
+ }, labelText && /* @__PURE__ */ React.createElement("div", {
914
+ className: cx(styles$d[`${baseClass$h}__label-wrapper`])
915
+ }, /* @__PURE__ */ React.createElement("label", {
916
+ className: "lc-field-label",
917
+ htmlFor: labelFor
918
+ }, /* @__PURE__ */ React.createElement(Text, {
919
+ as: "span",
920
+ size: "sm"
921
+ }, labelText)), labelAdornment && /* @__PURE__ */ React.createElement("div", {
922
+ className: cx(styles$d[`${baseClass$h}__label-adornment`])
923
+ }, labelAdornment)), labelRightNode && !inline && /* @__PURE__ */ React.createElement("div", {
924
+ className: cx(styles$d[`${baseClass$h}__label-right-node`])
925
+ }, labelRightNode)), /* @__PURE__ */ React.createElement("div", {
926
+ className: cx(styles$d[`${baseClass$h}__content`])
927
+ }, children, error && /* @__PURE__ */ React.createElement(FieldError, null, error), description && /* @__PURE__ */ React.createElement(FieldDescription, null, description))));
928
+ };
929
+ var styles$c = {
930
+ "input-field": "lc-InputField-module__input-field___A-GHj",
931
+ "input-field--error": "lc-InputField-module__input-field--error___MMchC"
932
+ };
933
+ const baseClass$g = "input-field";
934
+ const InputField = React.forwardRef((_y, ref) => {
935
+ var _z = _y, {
936
+ id,
937
+ labelText,
938
+ labelAdornment,
939
+ className,
940
+ inline,
941
+ error,
942
+ description,
943
+ labelRightNode,
944
+ fieldClassName,
945
+ style,
946
+ type = "text"
947
+ } = _z, restProps = __objRest(_z, [
948
+ "id",
949
+ "labelText",
950
+ "labelAdornment",
951
+ "className",
952
+ "inline",
953
+ "error",
954
+ "description",
955
+ "labelRightNode",
956
+ "fieldClassName",
957
+ "style",
958
+ "type"
959
+ ]);
960
+ const mergedClassNames = cx(styles$c[baseClass$g], {
961
+ [styles$c[`${baseClass$g}--error`]]: error
962
+ }, fieldClassName);
963
+ return /* @__PURE__ */ React.createElement(TextField, {
964
+ inline,
965
+ error,
966
+ description,
967
+ labelText,
968
+ labelAdornment,
969
+ className,
970
+ labelFor: id,
971
+ labelRightNode
972
+ }, /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues({}, restProps), {
973
+ id,
974
+ ref,
975
+ className: mergedClassNames,
976
+ style,
977
+ type
978
+ })));
979
+ });
980
+ const link = "lc-Link-module__link___kqx52";
981
+ var styles$b = {
982
+ link,
983
+ "link--bold": "lc-Link-module__link--bold___1rGdO"
984
+ };
985
+ const baseClass$f = "link";
986
+ const Link = (_A) => {
987
+ var _B = _A, {
988
+ bold = false,
989
+ className = ""
990
+ } = _B, rest = __objRest(_B, [
991
+ "bold",
992
+ "className"
993
+ ]);
994
+ return /* @__PURE__ */ React.createElement("a", __spreadValues({
995
+ className: cx(styles$b[baseClass$f], bold && styles$b[`${baseClass$f}--bold`], className)
996
+ }, rest));
997
+ };
998
+ const modal__header = "lc-Modal-module__modal__header___Fp5VE";
999
+ const modal__heading = "lc-Modal-module__modal__heading___G9KVK";
1000
+ const modal__body = "lc-Modal-module__modal__body___M-jmN";
1001
+ const modal__footer = "lc-Modal-module__modal__footer___2LYdc";
1002
+ var styles$a = {
1003
+ "modal-base": "lc-Modal-module__modal-base___hbL1U",
1004
+ "modal-base__overlay": "lc-Modal-module__modal-base__overlay___kCQ8t",
1005
+ "modal-base__overlay--visible": "lc-Modal-module__modal-base__overlay--visible___zUNJL",
1006
+ "modal-base__close": "lc-Modal-module__modal-base__close___gJlgr",
1007
+ modal__header,
1008
+ modal__heading,
1009
+ modal__body,
1010
+ modal__footer,
1011
+ "action-modal": "lc-Modal-module__action-modal___CsRC7",
1012
+ "action-modal__heading": "lc-Modal-module__action-modal__heading___m3MuG",
1013
+ "action-modal__content": "lc-Modal-module__action-modal__content___gf-R2",
1014
+ "action-modal__actions": "lc-Modal-module__action-modal__actions___kpRXD",
1015
+ "action-modal__icon": "lc-Modal-module__action-modal__icon___MK5xt"
1016
+ };
1017
+ const ModalCloseButton = ({
1018
+ onClick
1019
+ }) => /* @__PURE__ */ React.createElement("button", {
1020
+ title: "Close modal",
1021
+ className: styles$a["modal-base__close"],
1022
+ onClick,
1023
+ type: "button"
1024
+ }, /* @__PURE__ */ React.createElement(Icon, {
1025
+ source: Close,
1026
+ size: IconSizeName.Large
1027
+ }));
1028
+ const KeyCodes = {
1029
+ esc: "Escape",
1030
+ enter: "Enter",
1031
+ backspace: "Backspace",
1032
+ delete: "Delete",
1033
+ spacebar: " ",
1034
+ tab: "Tab",
1035
+ semicolon: ";",
1036
+ comma: ",",
1037
+ arrowUp: "ArrowUp",
1038
+ arrowDown: "ArrowDown"
1039
+ };
1040
+ const baseClass$e = "modal-base";
1041
+ const ModalBase = (_C) => {
1042
+ var _D = _C, {
1043
+ children,
1044
+ className = "",
1045
+ onClose,
1046
+ closeOnEscPress = true
1047
+ } = _D, props = __objRest(_D, [
1048
+ "children",
1049
+ "className",
1050
+ "onClose",
1051
+ "closeOnEscPress"
1052
+ ]);
1053
+ const mergedClassNames = cx(styles$a[baseClass$e], className);
1054
+ React.useEffect(() => {
1055
+ if (!closeOnEscPress) {
1056
+ return;
1057
+ }
1058
+ const onKeyUp = (event) => {
1059
+ if (event.key === KeyCodes.esc) {
1060
+ onClose();
1061
+ }
1062
+ };
1063
+ document.addEventListener("keyup", onKeyUp, true);
1064
+ return () => document.removeEventListener("keyup", onKeyUp, true);
1065
+ }, [closeOnEscPress]);
1066
+ const onOverlayClick = (event) => {
1067
+ if (event.target === event.currentTarget) {
1068
+ onClose();
1069
+ }
1070
+ };
1071
+ const onCloseButtonClick = (event) => {
1072
+ event.preventDefault();
1073
+ event.stopPropagation();
1074
+ onClose();
1075
+ };
1076
+ return /* @__PURE__ */ React.createElement("div", {
1077
+ "data-testid": "lc-modal-overlay",
1078
+ onMouseDown: onOverlayClick,
1079
+ className: cx(styles$a[`${baseClass$e}__overlay`], styles$a[`${baseClass$e}__overlay--visible`])
1080
+ }, /* @__PURE__ */ React.createElement("div", __spreadValues({
1081
+ className: mergedClassNames
1082
+ }, props), /* @__PURE__ */ React.createElement(ModalCloseButton, {
1083
+ onClick: onCloseButtonClick
1084
+ }), children));
1085
+ };
1086
+ const baseClass$d = "action-modal";
1087
+ const ActionModal = (_E) => {
1088
+ var _F = _E, {
1089
+ children,
1090
+ className = "",
1091
+ icon: icon2,
1092
+ heading,
1093
+ actions
1094
+ } = _F, props = __objRest(_F, [
1095
+ "children",
1096
+ "className",
1097
+ "icon",
1098
+ "heading",
1099
+ "actions"
1100
+ ]);
1101
+ const mergedClassNames = cx(styles$a[baseClass$d], className);
1102
+ return /* @__PURE__ */ React.createElement(ModalBase, __spreadValues({
1103
+ className: mergedClassNames
1104
+ }, props), icon2 && /* @__PURE__ */ React.createElement("div", {
1105
+ className: styles$a[`${baseClass$d}__icon`]
1106
+ }, icon2), heading && /* @__PURE__ */ React.createElement("div", {
1107
+ className: styles$a[`${baseClass$d}__heading`]
1108
+ }, heading), /* @__PURE__ */ React.createElement("div", {
1109
+ className: styles$a[`${baseClass$d}__content`]
1110
+ }, children), actions && /* @__PURE__ */ React.createElement("div", {
1111
+ className: styles$a[`${baseClass$d}__actions`]
1112
+ }, actions));
1113
+ };
1114
+ const baseClass$c = "modal";
1115
+ const Modal = (_G) => {
1116
+ var _H = _G, {
1117
+ children,
1118
+ className = "",
1119
+ heading,
1120
+ footer
1121
+ } = _H, props = __objRest(_H, [
1122
+ "children",
1123
+ "className",
1124
+ "heading",
1125
+ "footer"
1126
+ ]);
1127
+ const mergedClassNames = cx(styles$a[baseClass$c], className);
1128
+ return /* @__PURE__ */ React.createElement(ModalBase, __spreadValues({
1129
+ className: mergedClassNames
1130
+ }, props), heading && /* @__PURE__ */ React.createElement("div", {
1131
+ className: styles$a[`${baseClass$c}__header`]
1132
+ }, /* @__PURE__ */ React.createElement(Heading, {
1133
+ size: "sm",
1134
+ as: "div",
1135
+ className: styles$a[`${baseClass$c}__heading`]
1136
+ }, heading)), /* @__PURE__ */ React.createElement("div", {
1137
+ className: styles$a[`${baseClass$c}__body`]
1138
+ }, children), footer && /* @__PURE__ */ React.createElement("div", {
1139
+ className: styles$a[`${baseClass$c}__footer`]
1140
+ }, footer));
1141
+ };
1142
+ const ModalPortal = ({
1143
+ children,
1144
+ className = "",
1145
+ parentElementName = "body",
1146
+ zIndex
1147
+ }) => {
1148
+ const [container] = React.useState(() => document.createElement("div"));
1149
+ if (className) {
1150
+ container.classList.add(className);
1151
+ }
1152
+ if (zIndex) {
1153
+ container.style.zIndex = zIndex.toString();
1154
+ }
1155
+ React.useEffect(() => {
1156
+ var _a;
1157
+ (_a = document.querySelector(parentElementName)) == null ? void 0 : _a.appendChild(container);
1158
+ return () => {
1159
+ var _a2;
1160
+ (_a2 = document.querySelector(parentElementName)) == null ? void 0 : _a2.removeChild(container);
1161
+ };
1162
+ }, []);
1163
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, ReactDOM.createPortal(children, container));
1164
+ };
1165
+ var styles$9 = {
1166
+ "numeric-input": "lc-NumericInput-module__numeric-input___j1esc",
1167
+ "numeric-input__increment": "lc-NumericInput-module__numeric-input__increment___i3Tys",
1168
+ "numeric-input__decrement": "lc-NumericInput-module__numeric-input__decrement___3qgn0",
1169
+ "numeric-input--disabled": "lc-NumericInput-module__numeric-input--disabled___yaRvQ",
1170
+ "numeric-input--no-controls": "lc-NumericInput-module__numeric-input--no-controls___D90rG",
1171
+ "numeric-input--error": "lc-NumericInput-module__numeric-input--error___TMxRx"
1172
+ };
1173
+ const baseClass$b = "numeric-input";
1174
+ const NumericInput = (_I) => {
1175
+ var _J = _I, {
1176
+ className,
1177
+ error,
1178
+ value,
1179
+ max,
1180
+ min,
1181
+ disabled,
1182
+ noControls,
1183
+ style,
1184
+ onChange
1185
+ } = _J, restProps = __objRest(_J, [
1186
+ "className",
1187
+ "error",
1188
+ "value",
1189
+ "max",
1190
+ "min",
1191
+ "disabled",
1192
+ "noControls",
1193
+ "style",
1194
+ "onChange"
1195
+ ]);
1196
+ const inputRef = React.useRef(null);
1197
+ const mergedClassNames = cx(styles$9[baseClass$b], {
1198
+ [styles$9[`${baseClass$b}--error`]]: error,
1199
+ [styles$9[`${baseClass$b}--no-controls`]]: noControls,
1200
+ [styles$9[`${baseClass$b}--disabled`]]: disabled
1201
+ }, className);
1202
+ const callOnChange = (val) => onChange(String(val));
1203
+ const calcValue = (val) => {
1204
+ if (max !== void 0 && val > max) {
1205
+ return max;
1206
+ }
1207
+ if (min !== void 0 && val < min) {
1208
+ return min;
1209
+ }
1210
+ return val;
1211
+ };
1212
+ const updateValue = (val) => {
1213
+ const newValue = parseInt(value, 10) + val;
1214
+ return callOnChange(calcValue(newValue));
1215
+ };
1216
+ const onKeyDown = (e) => {
1217
+ if (e.key === KeyCodes.arrowDown) {
1218
+ e.preventDefault();
1219
+ updateValue(-1);
1220
+ }
1221
+ if (e.key === KeyCodes.arrowUp) {
1222
+ e.preventDefault();
1223
+ updateValue(1);
1224
+ }
1225
+ };
1226
+ const hasReachedTheLimit = (value2, margin) => margin !== void 0 && parseInt(value2, 10) === margin;
1227
+ const handleOnChange = (e) => {
1228
+ e.preventDefault();
1229
+ e.stopPropagation();
1230
+ const inputVal = e.currentTarget.value.replace(/((?!([-]|([-]?\d+))).)/, "");
1231
+ if (inputVal === "" || inputVal === "-") {
1232
+ return callOnChange(inputVal);
1233
+ }
1234
+ const newValue = parseInt(inputVal, 10);
1235
+ return callOnChange(calcValue(newValue));
1236
+ };
1237
+ const handleIncrementClick = () => {
1238
+ var _a;
1239
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
1240
+ return updateValue(1);
1241
+ };
1242
+ const handleDecrementClick = () => {
1243
+ var _a;
1244
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
1245
+ return updateValue(-1);
1246
+ };
1247
+ return /* @__PURE__ */ React.createElement("div", {
1248
+ className: mergedClassNames,
1249
+ style
1250
+ }, /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues({
1251
+ type: "text",
1252
+ ref: inputRef
1253
+ }, restProps), {
1254
+ value,
1255
+ disabled,
1256
+ onChange: handleOnChange,
1257
+ onKeyDown,
1258
+ min,
1259
+ max
1260
+ })), !noControls && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("button", {
1261
+ tabIndex: -1,
1262
+ disabled: disabled || hasReachedTheLimit(value, max),
1263
+ onClick: handleIncrementClick,
1264
+ "aria-label": "Increment value",
1265
+ className: styles$9[`${baseClass$b}__increment`],
1266
+ type: "button"
1267
+ }, /* @__PURE__ */ React.createElement(Icon, {
1268
+ source: ChevronUp,
1269
+ disabled: disabled || hasReachedTheLimit(value, max),
1270
+ iconType: IconTypeName.Primary
1271
+ })), /* @__PURE__ */ React.createElement("button", {
1272
+ tabIndex: -1,
1273
+ disabled: disabled || hasReachedTheLimit(value, min),
1274
+ "aria-label": "Decrement value",
1275
+ className: styles$9[`${baseClass$b}__decrement`],
1276
+ onClick: handleDecrementClick,
1277
+ type: "button"
1278
+ }, /* @__PURE__ */ React.createElement(Icon, {
1279
+ source: ChevronDown,
1280
+ iconType: IconTypeName.Primary,
1281
+ disabled: disabled || hasReachedTheLimit(value, min)
1282
+ }))));
1283
+ };
1284
+ const NumericInputField = (_K) => {
1285
+ var _L = _K, {
1286
+ id,
1287
+ labelText,
1288
+ labelAdornment,
1289
+ className,
1290
+ inline,
1291
+ error,
1292
+ description,
1293
+ labelRightNode,
1294
+ fieldClassName,
1295
+ style
1296
+ } = _L, restProps = __objRest(_L, [
1297
+ "id",
1298
+ "labelText",
1299
+ "labelAdornment",
1300
+ "className",
1301
+ "inline",
1302
+ "error",
1303
+ "description",
1304
+ "labelRightNode",
1305
+ "fieldClassName",
1306
+ "style"
1307
+ ]);
1308
+ return /* @__PURE__ */ React.createElement(TextField, {
1309
+ inline,
1310
+ error,
1311
+ description,
1312
+ labelText,
1313
+ labelAdornment,
1314
+ className,
1315
+ labelFor: id,
1316
+ labelRightNode
1317
+ }, /* @__PURE__ */ React.createElement(NumericInput, __spreadProps(__spreadValues({}, restProps), {
1318
+ id,
1319
+ className: fieldClassName,
1320
+ style,
1321
+ error
1322
+ })));
1323
+ };
1324
+ const popover = "lc-Popover-module__popover___8X1b2";
1325
+ var cssStyles = {
1326
+ popover,
1327
+ "popover--visible": "lc-Popover-module__popover--visible___u5NXB"
1328
+ };
1329
+ const buildPopperModifiers = (modifiers) => {
1330
+ const { offset, flip, preventOverflow } = modifiers;
1331
+ const calculatedOffset = [
1332
+ {
1333
+ name: "offset",
1334
+ options: __spreadValues({
1335
+ offset: [0, 4]
1336
+ }, (offset == null ? void 0 : offset.options) || {})
1337
+ }
1338
+ ];
1339
+ const calculateFlip = [
1340
+ {
1341
+ name: "flip",
1342
+ options: __spreadValues({}, (flip == null ? void 0 : flip.options) || {})
1343
+ }
1344
+ ];
1345
+ const calculatePreventOverflow = [
1346
+ {
1347
+ name: "preventOverlow",
1348
+ options: __spreadValues({
1349
+ rootBoundary: "viewport"
1350
+ }, preventOverflow || {})
1351
+ }
1352
+ ];
1353
+ return [...calculatedOffset, ...calculateFlip, ...calculatePreventOverflow];
1354
+ };
1355
+ const Popover = (props) => {
1356
+ const {
1357
+ triggerRenderer,
1358
+ children,
1359
+ className,
1360
+ placement,
1361
+ isVisible = false
1362
+ } = props;
1363
+ const rendererRef = React.useRef(null);
1364
+ const popperRef = React.useRef(null);
1365
+ const [visible, setVisibility] = React.useState(false);
1366
+ React.useEffect(() => {
1367
+ setVisibility(isVisible);
1368
+ }, [isVisible]);
1369
+ function handleDocumentClick(event) {
1370
+ var _a, _b;
1371
+ if ((_a = popperRef.current) == null ? void 0 : _a.contains(event.target)) {
1372
+ return;
1373
+ } else if ((_b = rendererRef.current) == null ? void 0 : _b.contains(event.target)) {
1374
+ setVisibility((prevVisible) => !prevVisible);
1375
+ } else {
1376
+ setVisibility(false);
1377
+ }
1378
+ }
1379
+ const handleHideOnEscape = (event) => {
1380
+ if (event.key === "Escape") {
1381
+ setVisibility(false);
1382
+ }
1383
+ };
1384
+ React.useEffect(() => {
1385
+ document.addEventListener("keydown", handleHideOnEscape);
1386
+ document.addEventListener("mousedown", handleDocumentClick);
1387
+ return () => {
1388
+ document.removeEventListener("keydown", handleHideOnEscape);
1389
+ document.removeEventListener("mousedown", handleDocumentClick);
1390
+ };
1391
+ }, []);
1392
+ const { styles: styles2, attributes } = usePopper(rendererRef.current, popperRef.current, {
1393
+ modifiers: props.modifiers ? buildPopperModifiers(props.modifiers) : [],
1394
+ placement
1395
+ });
1396
+ const mergedClassNames = cx(cssStyles["popover"], className, {
1397
+ [cssStyles["popover--visible"]]: visible
1398
+ });
1399
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
1400
+ ref: rendererRef
1401
+ }, triggerRenderer()), /* @__PURE__ */ React.createElement("div", __spreadValues({
1402
+ ref: popperRef,
1403
+ className: mergedClassNames,
1404
+ style: styles2.popper
1405
+ }, attributes.popper), children));
1406
+ };
1407
+ var ProgressStatus = /* @__PURE__ */ ((ProgressStatus2) => {
1408
+ ProgressStatus2["Normal"] = "normal";
1409
+ ProgressStatus2["Error"] = "error";
1410
+ ProgressStatus2["Success"] = "success";
1411
+ return ProgressStatus2;
1412
+ })(ProgressStatus || {});
1413
+ var ProgressSize = /* @__PURE__ */ ((ProgressSize2) => {
1414
+ ProgressSize2["Small"] = "small";
1415
+ ProgressSize2["Medium"] = "medium";
1416
+ ProgressSize2["Large"] = "large";
1417
+ return ProgressSize2;
1418
+ })(ProgressSize || {});
1419
+ const PROGRESS_STATUSES = [
1420
+ "normal",
1421
+ "error",
1422
+ "success"
1423
+ ];
1424
+ const clampPercentage = (percent) => Math.min(Math.max(percent, 0), 100);
1425
+ function getPercentNumber(status, percent = 0) {
1426
+ if (status === ProgressStatus.Error) {
1427
+ return 0;
1428
+ }
1429
+ return clampPercentage(parseInt(percent.toString(), 10));
1430
+ }
1431
+ function getProgressStatus(status, percent) {
1432
+ if (!PROGRESS_STATUSES.includes(status) && percent >= 100) {
1433
+ return ProgressStatus.Normal;
1434
+ }
1435
+ return status || ProgressStatus.Normal;
1436
+ }
1437
+ var styles$8 = {
1438
+ "progress-circle": "lc-ProgressCircle-module__progress-circle___NRHCi",
1439
+ "progress-circle--small": "lc-ProgressCircle-module__progress-circle--small___8FVwG",
1440
+ "progress-circle--medium": "lc-ProgressCircle-module__progress-circle--medium___XlzEX",
1441
+ "progress-circle--large": "lc-ProgressCircle-module__progress-circle--large___qxa2y",
1442
+ "progress-circle__bg-line--normal": "lc-ProgressCircle-module__progress-circle__bg-line--normal___nDNwj",
1443
+ "progress-circle__bg-line--success": "lc-ProgressCircle-module__progress-circle__bg-line--success___1aP-O",
1444
+ "progress-circle__bg-line--error": "lc-ProgressCircle-module__progress-circle__bg-line--error___oqMZL",
1445
+ "progress-circle__indicator--normal": "lc-ProgressCircle-module__progress-circle__indicator--normal___0SdkX",
1446
+ "progress-circle__indicator--success": "lc-ProgressCircle-module__progress-circle__indicator--success___fLwRR",
1447
+ "progress-circle__indicator--error": "lc-ProgressCircle-module__progress-circle__indicator--error___nwJS9",
1448
+ "progress-circle--error": "lc-ProgressCircle-module__progress-circle--error___2AA9K",
1449
+ "progress-circle__bg-line": "lc-ProgressCircle-module__progress-circle__bg-line___12YrE",
1450
+ "progress-circle--success": "lc-ProgressCircle-module__progress-circle--success___hH5jv",
1451
+ "progress-circle--normal": "lc-ProgressCircle-module__progress-circle--normal___dFneQ"
1452
+ };
1453
+ const THICKNESS_FROM_SIZE = {
1454
+ [ProgressSize.Small]: 2,
1455
+ [ProgressSize.Medium]: 3,
1456
+ [ProgressSize.Large]: 4
1457
+ };
1458
+ const SIZE_VALUE_FROM_SIZE = {
1459
+ [ProgressSize.Small]: 15,
1460
+ [ProgressSize.Medium]: 36,
1461
+ [ProgressSize.Large]: 56
1462
+ };
1463
+ const baseClass$a = "progress-circle";
1464
+ const ProgressCircle = React.forwardRef((_M, ref) => {
1465
+ var _N = _M, {
1466
+ status = ProgressStatus.Normal,
1467
+ percent,
1468
+ className,
1469
+ size = ProgressSize.Medium
1470
+ } = _N, restProps = __objRest(_N, [
1471
+ "status",
1472
+ "percent",
1473
+ "className",
1474
+ "size"
1475
+ ]);
1476
+ const progressStatus = getProgressStatus(status, percent);
1477
+ const percentNumber = getPercentNumber(progressStatus, percent);
1478
+ const thickness = THICKNESS_FROM_SIZE[size];
1479
+ const sizeValue = SIZE_VALUE_FROM_SIZE[size];
1480
+ const mergedClassNames = cx(styles$8[baseClass$a], {
1481
+ [styles$8[`${baseClass$a}--${size}`]]: size,
1482
+ [styles$8[`${baseClass$a}--error`]]: progressStatus === ProgressStatus.Error,
1483
+ [styles$8[`${baseClass$a}--success`]]: progressStatus === ProgressStatus.Success,
1484
+ [styles$8[`${baseClass$a}--normal`]]: progressStatus === ProgressStatus.Normal
1485
+ }, className);
1486
+ const circumference = 2 * Math.PI * ((sizeValue - thickness) / 2);
1487
+ const indicatorStyle = {
1488
+ strokeDasharray: circumference.toFixed(3),
1489
+ strokeDashoffset: `${((100 - percentNumber) / 100 * circumference).toFixed(3)}px`
1490
+ };
1491
+ const svgViewBox = `${sizeValue / 2} ${sizeValue / 2} ${sizeValue} ${sizeValue}`;
1492
+ return /* @__PURE__ */ React.createElement("div", __spreadValues({
1493
+ className: mergedClassNames,
1494
+ ref,
1495
+ role: "progressbar"
1496
+ }, restProps), /* @__PURE__ */ React.createElement("svg", {
1497
+ viewBox: svgViewBox
1498
+ }, /* @__PURE__ */ React.createElement("circle", {
1499
+ className: styles$8[`${baseClass$a}__bg-line--${status}`],
1500
+ cx: sizeValue,
1501
+ cy: sizeValue,
1502
+ r: (sizeValue - thickness) / 2,
1503
+ fill: "none",
1504
+ strokeWidth: thickness
1505
+ }), /* @__PURE__ */ React.createElement("circle", {
1506
+ className: styles$8[`${baseClass$a}__indicator--${status}`],
1507
+ style: indicatorStyle,
1508
+ cx: sizeValue,
1509
+ cy: sizeValue,
1510
+ r: (sizeValue - thickness) / 2,
1511
+ fill: "none",
1512
+ strokeWidth: thickness
1513
+ })));
1514
+ });
1515
+ var styles$7 = {
1516
+ "promo-banner": "lc-PromoBanner-module__promo-banner___-mGpq",
1517
+ "promo-banner__content": "lc-PromoBanner-module__promo-banner__content___kRWar",
1518
+ "promo-banner__wrapper": "lc-PromoBanner-module__promo-banner__wrapper___I-8cl",
1519
+ "promo-banner__header": "lc-PromoBanner-module__promo-banner__header___ebYHW",
1520
+ "promo-banner__img": "lc-PromoBanner-module__promo-banner__img___eaShb",
1521
+ "promo-banner__button-text": "lc-PromoBanner-module__promo-banner__button-text___taYKa",
1522
+ "promo-banner--light": "lc-PromoBanner-module__promo-banner--light___eJxOR",
1523
+ "promo-banner--small": "lc-PromoBanner-module__promo-banner--small___7sWLV",
1524
+ "promo-banner__footer": "lc-PromoBanner-module__promo-banner__footer___8OjvH",
1525
+ "promo-banner--medium": "lc-PromoBanner-module__promo-banner--medium___NeeoJ",
1526
+ "promo-banner--large": "lc-PromoBanner-module__promo-banner--large___pMiCU",
1527
+ "promo-banner__close-icon": "lc-PromoBanner-module__promo-banner__close-icon___GowBL"
1528
+ };
1529
+ const baseClass$9 = "promo-banner";
1530
+ const PromoBanner = ({
1531
+ className,
1532
+ buttonText,
1533
+ children,
1534
+ header,
1535
+ img,
1536
+ light = false,
1537
+ linkText,
1538
+ size = "small",
1539
+ onButtonClick,
1540
+ onClose,
1541
+ onLinkClick
1542
+ }) => {
1543
+ const mergedClassNames = cx(styles$7[baseClass$9], {
1544
+ [styles$7[`${baseClass$9}--light`]]: light,
1545
+ [styles$7[`${baseClass$9}--${size}`]]: size
1546
+ }, className);
1547
+ const shouldRenderLargeFooter = (buttonText || linkText) && size === "large";
1548
+ const shouldRenderSmallOrMediumFooter = (buttonText || linkText) && size !== "large";
1549
+ const footer = /* @__PURE__ */ React.createElement("div", {
1550
+ className: styles$7[`${baseClass$9}__footer`]
1551
+ }, buttonText && /* @__PURE__ */ React.createElement(Button, {
1552
+ kind: "primary",
1553
+ size: "compact",
1554
+ onClick: onButtonClick,
1555
+ className: styles$7[`${baseClass$9}__button-text`]
1556
+ }, buttonText), linkText && /* @__PURE__ */ React.createElement(Button, {
1557
+ size: "compact",
1558
+ kind: "text",
1559
+ onClick: onLinkClick
1560
+ }, linkText));
1561
+ return /* @__PURE__ */ React.createElement("div", {
1562
+ className: mergedClassNames
1563
+ }, /* @__PURE__ */ React.createElement("div", {
1564
+ className: styles$7[`${baseClass$9}__content`]
1565
+ }, img && /* @__PURE__ */ React.createElement("img", {
1566
+ src: img,
1567
+ className: styles$7[`${baseClass$9}__img`]
1568
+ }), /* @__PURE__ */ React.createElement("div", {
1569
+ className: styles$7[`${baseClass$9}__wrapper`]
1570
+ }, /* @__PURE__ */ React.createElement("div", {
1571
+ className: styles$7[`${baseClass$9}__header`]
1572
+ }, header), /* @__PURE__ */ React.createElement("div", null, children), shouldRenderSmallOrMediumFooter && footer), shouldRenderLargeFooter && footer), onClose && /* @__PURE__ */ React.createElement("button", {
1573
+ type: "button",
1574
+ className: styles$7[`${baseClass$9}__close-icon`],
1575
+ onClick: onClose
1576
+ }, /* @__PURE__ */ React.createElement(Icon, {
1577
+ source: Close,
1578
+ size: IconSizeName.Large
1579
+ })));
1580
+ };
1581
+ var styles$6 = {
1582
+ "radio-button": "lc-RadioButton-module__radio-button___WaToM",
1583
+ "radio-button__label": "lc-RadioButton-module__radio-button__label___i7ygg",
1584
+ "radio-button__circle": "lc-RadioButton-module__radio-button__circle___wimWA",
1585
+ "radio-button__inner-circle": "lc-RadioButton-module__radio-button__inner-circle___qkRVf",
1586
+ "radio-button__text": "lc-RadioButton-module__radio-button__text___mT8c0",
1587
+ "radio-button__input": "lc-RadioButton-module__radio-button__input___7OTAK",
1588
+ "radio-button__helper": "lc-RadioButton-module__radio-button__helper___r8gJJ",
1589
+ "radio-button--selected": "lc-RadioButton-module__radio-button--selected___s9lqj",
1590
+ "radio-button--disabled": "lc-RadioButton-module__radio-button--disabled___wHSA7"
1591
+ };
1592
+ const baseClass$8 = "radio-button";
1593
+ const RadioButton = (_O) => {
1594
+ var _P = _O, {
1595
+ children,
1596
+ className = "",
1597
+ description,
1598
+ checked,
1599
+ disabled
1600
+ } = _P, props = __objRest(_P, [
1601
+ "children",
1602
+ "className",
1603
+ "description",
1604
+ "checked",
1605
+ "disabled"
1606
+ ]);
1607
+ const mergedClassNames = cx(styles$6[baseClass$8], className, {
1608
+ [styles$6[`${baseClass$8}--selected`]]: checked,
1609
+ [styles$6[`${baseClass$8}--disabled`]]: disabled
1610
+ });
1611
+ return /* @__PURE__ */ React.createElement("div", {
1612
+ className: mergedClassNames
1613
+ }, /* @__PURE__ */ React.createElement("label", {
1614
+ className: styles$6[`${baseClass$8}__label`]
1615
+ }, /* @__PURE__ */ React.createElement("div", {
1616
+ className: styles$6[`${baseClass$8}__circle`]
1617
+ }, /* @__PURE__ */ React.createElement("span", {
1618
+ className: styles$6[`${baseClass$8}__inner-circle`]
1619
+ }), /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues({
1620
+ className: styles$6[`${baseClass$8}__input`]
1621
+ }, props), {
1622
+ type: "radio",
1623
+ checked,
1624
+ disabled
1625
+ }))), /* @__PURE__ */ React.createElement(Text, {
1626
+ as: "div",
1627
+ size: "md",
1628
+ className: styles$6[`${baseClass$8}__text`]
1629
+ }, children)), description && /* @__PURE__ */ React.createElement(FieldDescription, {
1630
+ className: styles$6[`${baseClass$8}__helper`]
1631
+ }, description));
1632
+ };
1633
+ const switch__input = "lc-Switch-module__switch__input___NiiOR";
1634
+ const switch__container = "lc-Switch-module__switch__container___79F7W";
1635
+ const switch__track = "lc-Switch-module__switch__track___2wr2M";
1636
+ const switch__slider = "lc-Switch-module__switch__slider___WHd--";
1637
+ var styles$5 = {
1638
+ "switch": "lc-Switch-module__switch___AaA2k",
1639
+ "switch__track--enabled": "lc-Switch-module__switch__track--enabled___sy4Xl",
1640
+ "switch__track--disabled": "lc-Switch-module__switch__track--disabled___HkDhl",
1641
+ "switch--basic": "lc-Switch-module__switch--basic___jKO4n",
1642
+ "switch--compact": "lc-Switch-module__switch--compact___OGFIX",
1643
+ switch__input,
1644
+ switch__container,
1645
+ switch__track,
1646
+ switch__slider,
1647
+ "switch__slider--basic": "lc-Switch-module__switch__slider--basic___OMKTp",
1648
+ "switch__slider--basic--enabled": "lc-Switch-module__switch__slider--basic--enabled___sh9jo",
1649
+ "switch__slider--basic--disabled": "lc-Switch-module__switch__slider--basic--disabled___GSTO9",
1650
+ "switch__slider--compact": "lc-Switch-module__switch__slider--compact___uZ-lS",
1651
+ "switch__slider--compact--enabled": "lc-Switch-module__switch__slider--compact--enabled___04TFA",
1652
+ "switch__slider--compact--disabled": "lc-Switch-module__switch__slider--compact--disabled___Vqznr"
1653
+ };
1654
+ const baseClass$7 = "switch";
1655
+ const Switch = (_Q) => {
1656
+ var _R = _Q, {
1657
+ className = "",
1658
+ defaultOn = false,
1659
+ disabled = false,
1660
+ name = baseClass$7,
1661
+ on,
1662
+ onChange = noop,
1663
+ size = "basic",
1664
+ innerRef
1665
+ } = _R, props = __objRest(_R, [
1666
+ "className",
1667
+ "defaultOn",
1668
+ "disabled",
1669
+ "name",
1670
+ "on",
1671
+ "onChange",
1672
+ "size",
1673
+ "innerRef"
1674
+ ]);
1675
+ const getEnabledValue = () => {
1676
+ return on !== void 0 ? on : defaultOn;
1677
+ };
1678
+ const [enabled, setEnabled] = React.useState(getEnabledValue());
1679
+ React.useEffect(() => {
1680
+ if (on !== void 0) {
1681
+ setEnabled(on);
1682
+ }
1683
+ }, [on]);
1684
+ const valueStyles = enabled ? "enabled" : "disabled";
1685
+ const mergedClassNames = cx(styles$5[baseClass$7], styles$5[`${baseClass$7}--${size}`], className);
1686
+ const handleChange = (e) => {
1687
+ const hasOnChangePassed = onChange !== noop;
1688
+ if (hasOnChangePassed) {
1689
+ onChange(e, enabled);
1690
+ return;
1691
+ }
1692
+ e.stopPropagation();
1693
+ setEnabled((prevEnabled) => !prevEnabled);
1694
+ };
1695
+ return /* @__PURE__ */ React.createElement("span", {
1696
+ className: mergedClassNames
1697
+ }, /* @__PURE__ */ React.createElement("input", __spreadValues({
1698
+ type: "checkbox",
1699
+ className: styles$5[`${baseClass$7}__input`],
1700
+ onChange: handleChange,
1701
+ checked: enabled,
1702
+ name,
1703
+ ref: innerRef,
1704
+ disabled,
1705
+ "test-id": "foo"
1706
+ }, props)), /* @__PURE__ */ React.createElement("span", {
1707
+ className: styles$5[`${baseClass$7}__container`]
1708
+ }, /* @__PURE__ */ React.createElement("span", {
1709
+ className: cx(styles$5[`${baseClass$7}__track`], styles$5[`${baseClass$7}__track--${valueStyles}`])
1710
+ }), /* @__PURE__ */ React.createElement("span", {
1711
+ className: cx(styles$5[`${baseClass$7}__slider`], styles$5[`${baseClass$7}__slider--${size}`], styles$5[`${baseClass$7}__slider--${size}--${valueStyles}`])
1712
+ })));
1713
+ };
1714
+ const tab = "lc-Tab-module__tab___fME7u";
1715
+ const tab__description = "lc-Tab-module__tab__description___JGXU6";
1716
+ var styles$4 = {
1717
+ tab,
1718
+ tab__description,
1719
+ "tab--selected": "lc-Tab-module__tab--selected___c0EkL"
1720
+ };
1721
+ const baseClass$6 = "tab";
1722
+ const Tab = (_S) => {
1723
+ var _T = _S, {
1724
+ children,
1725
+ className,
1726
+ description,
1727
+ isSelected
1728
+ } = _T, restProps = __objRest(_T, [
1729
+ "children",
1730
+ "className",
1731
+ "description",
1732
+ "isSelected"
1733
+ ]);
1734
+ return /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({}, restProps), {
1735
+ as: restProps.href ? "a" : "button",
1736
+ size: "md",
1737
+ bold: isSelected,
1738
+ className: cx(styles$4[baseClass$6], className, isSelected && styles$4[`${baseClass$6}--selected`])
1739
+ }), children, description && /* @__PURE__ */ React.createElement(Text, {
1740
+ as: "span",
1741
+ size: "md",
1742
+ className: styles$4[`${baseClass$6}__description`]
1743
+ }, "(", description, ")"));
1744
+ };
1745
+ const tabs = "lc-TabsWrapper-module__tabs___Y2xyD";
1746
+ const tabs__list = "lc-TabsWrapper-module__tabs__list___i6tVO";
1747
+ var styles$3 = {
1748
+ tabs,
1749
+ tabs__list
1750
+ };
1751
+ const baseClass$5 = "tabs";
1752
+ const TabsWrapper = ({
1753
+ className,
1754
+ children
1755
+ }) => {
1756
+ return /* @__PURE__ */ React.createElement("div", {
1757
+ className: cx(styles$3[baseClass$5], className)
1758
+ }, children);
1759
+ };
1760
+ const TabsList = ({
1761
+ className,
1762
+ children
1763
+ }) => {
1764
+ return /* @__PURE__ */ React.createElement("div", {
1765
+ className: cx(styles$3[`${baseClass$5}__list`], className)
1766
+ }, children);
1767
+ };
1768
+ const tag = "lc-Tag-module__tag___1QRVY";
1769
+ const tag__remove = "lc-Tag-module__tag__remove___UmtrW";
1770
+ const icon = "lc-Tag-module__icon___2Z-35";
1771
+ const tag__icon = "lc-Tag-module__tag__icon___tZoQ9";
1772
+ const tag__avatar = "lc-Tag-module__tag__avatar___U4c-P";
1773
+ var styles$2 = {
1774
+ tag,
1775
+ "tag--success": "lc-Tag-module__tag--success___P2hXQ",
1776
+ tag__remove,
1777
+ "tag--error": "lc-Tag-module__tag--error___1cjsm",
1778
+ "tag--warning": "lc-Tag-module__tag--warning___PstMG",
1779
+ "tag--info": "lc-Tag-module__tag--info___RTH0C",
1780
+ "tag--medium": "lc-Tag-module__tag--medium___l5-KI",
1781
+ "tag--large": "lc-Tag-module__tag--large___ytC6Y",
1782
+ "tag--outline": "lc-Tag-module__tag--outline___aZXtr",
1783
+ icon,
1784
+ "tag--text-white": "lc-Tag-module__tag--text-white___x0fnD",
1785
+ "tag--text-black": "lc-Tag-module__tag--text-black___dUvmD",
1786
+ "tag--with-icon": "lc-Tag-module__tag--with-icon___ZlkvT",
1787
+ "tag--dismissible": "lc-Tag-module__tag--dismissible___Qobyr",
1788
+ tag__icon,
1789
+ tag__avatar
1790
+ };
1791
+ const baseClass$4 = "tag";
1792
+ const getCustomTextClass = (customColor) => {
1793
+ if (!customColor) {
1794
+ return "";
1795
+ }
1796
+ return getContrast(customColor, "#FFFFFF") > 4.5 ? "text-white" : "text-black";
1797
+ };
1798
+ const Tag = (_U) => {
1799
+ var _V = _U, {
1800
+ className = "",
1801
+ children,
1802
+ dismissible = false,
1803
+ size = "medium",
1804
+ kind = "default",
1805
+ onRemove,
1806
+ outline = false,
1807
+ icon: icon2,
1808
+ avatar,
1809
+ customColor
1810
+ } = _V, restProps = __objRest(_V, [
1811
+ "className",
1812
+ "children",
1813
+ "dismissible",
1814
+ "size",
1815
+ "kind",
1816
+ "onRemove",
1817
+ "outline",
1818
+ "icon",
1819
+ "avatar",
1820
+ "customColor"
1821
+ ]);
1822
+ const mergedClassNames = cx(styles$2[baseClass$4], className, styles$2[`${baseClass$4}--${size}`], styles$2[`${baseClass$4}--${kind}`], {
1823
+ [styles$2[`${baseClass$4}--dismissible`]]: dismissible,
1824
+ [styles$2[`${baseClass$4}--outline`]]: outline,
1825
+ [styles$2[`${baseClass$4}--with-icon`]]: !!icon2 || !!avatar,
1826
+ [styles$2[`${baseClass$4}--${getCustomTextClass(customColor)}`]]: !!customColor
1827
+ });
1828
+ const getCustomColorStyles = () => {
1829
+ if (!customColor) {
1830
+ return {};
1831
+ }
1832
+ if (outline) {
1833
+ return {
1834
+ style: {
1835
+ backgroundColor: "transparent",
1836
+ color: customColor,
1837
+ borderColor: customColor
1838
+ }
1839
+ };
1840
+ }
1841
+ return { style: { backgroundColor: customColor } };
1842
+ };
1843
+ const getIconCustomColor = () => {
1844
+ if (!customColor) {
1845
+ return void 0;
1846
+ }
1847
+ if (outline) {
1848
+ return customColor;
1849
+ }
1850
+ return getContrast(customColor, "#FFFFFF") > 4.5 ? "#FFFFFF" : "#000000";
1851
+ };
1852
+ return /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues(__spreadValues({
1853
+ className: mergedClassNames
1854
+ }, restProps), getCustomColorStyles()), {
1855
+ as: "div",
1856
+ size: "md"
1857
+ }), avatar && /* @__PURE__ */ React.createElement("img", {
1858
+ className: styles$2[`${baseClass$4}__avatar`],
1859
+ src: avatar,
1860
+ alt: "tag-avatar",
1861
+ "data-testid": "lc-tag-avatar"
1862
+ }), " ", icon2 && !avatar && /* @__PURE__ */ React.createElement(Icon, {
1863
+ "data-testid": "lc-tag-icon",
1864
+ className: styles$2[`${baseClass$4}__icon`],
1865
+ source: icon2,
1866
+ size: IconSizeName.Small,
1867
+ customColor: getIconCustomColor()
1868
+ }), children, dismissible && /* @__PURE__ */ React.createElement("button", {
1869
+ title: "Remove",
1870
+ onClick: onRemove,
1871
+ type: "button",
1872
+ className: styles$2[`${baseClass$4}__remove`]
1873
+ }, /* @__PURE__ */ React.createElement(Icon, {
1874
+ source: Close,
1875
+ size: IconSizeName.Medium,
1876
+ customColor: getIconCustomColor()
1877
+ })));
1878
+ };
1879
+ const EditableTagContent = ({
1880
+ className = "",
1881
+ innerEditableRef,
1882
+ inputRef,
1883
+ change,
1884
+ remove,
1885
+ value
1886
+ }) => {
1887
+ const [removed, setRemoved] = React.useState(false);
1888
+ const getRef = () => innerEditableRef.current;
1889
+ const getValue = () => {
1890
+ const ref = getRef();
1891
+ return ref ? ref.innerText : "";
1892
+ };
1893
+ const focusInputRef = () => {
1894
+ if (inputRef && inputRef.current) {
1895
+ inputRef.current.focus();
1896
+ }
1897
+ };
1898
+ const onKeyDown = (e) => {
1899
+ if (e.key === KeyCodes.enter) {
1900
+ e.preventDefault();
1901
+ focusInputRef();
1902
+ return;
1903
+ }
1904
+ if (e.key === KeyCodes.backspace && getValue() === "") {
1905
+ setRemoved(true);
1906
+ remove();
1907
+ focusInputRef();
1908
+ }
1909
+ };
1910
+ const onBlur = () => {
1911
+ const ref = getRef();
1912
+ if (removed || !ref) {
1913
+ return;
1914
+ }
1915
+ if (ref.innerText === "") {
1916
+ remove();
1917
+ return;
1918
+ }
1919
+ change(ref.innerText);
1920
+ };
1921
+ const onPaste = (e) => {
1922
+ e.preventDefault();
1923
+ const text = e.clipboardData.getData("text/plain");
1924
+ document.execCommand("insertHTML", false, escape(text));
1925
+ };
1926
+ return /* @__PURE__ */ React.createElement("div", {
1927
+ ref: innerEditableRef,
1928
+ className,
1929
+ contentEditable: true,
1930
+ onPaste,
1931
+ onBlur,
1932
+ onKeyDown,
1933
+ dangerouslySetInnerHTML: { __html: escape(value) }
1934
+ });
1935
+ };
1936
+ var styles$1 = {
1937
+ "tag-input": "lc-TagInput-module__tag-input___CLVY-",
1938
+ "tag-input--error": "lc-TagInput-module__tag-input--error___RP0SB",
1939
+ "tag-input__input": "lc-TagInput-module__tag-input__input___dgEYB",
1940
+ "tag-input__input--medium": "lc-TagInput-module__tag-input__input--medium___DYF7X",
1941
+ "tag-input__input--large": "lc-TagInput-module__tag-input__input--large___G6iEO",
1942
+ "tag-input__tag__content": "lc-TagInput-module__tag-input__tag__content___x95-M"
1943
+ };
1944
+ const baseClass$3 = "tag-input__tag";
1945
+ const EditableTag = ({
1946
+ children,
1947
+ index: index2,
1948
+ remove,
1949
+ validator,
1950
+ inputRef,
1951
+ update,
1952
+ size
1953
+ }) => {
1954
+ const isValid = React.useMemo(() => {
1955
+ return validator !== void 0 ? validator(children) : true;
1956
+ }, [children, validator]);
1957
+ const innerEditableRef = React.useRef(null);
1958
+ const removeTag = () => remove(index2);
1959
+ return /* @__PURE__ */ React.createElement(Tag, {
1960
+ kind: isValid ? "default" : "error",
1961
+ dismissible: true,
1962
+ size,
1963
+ onRemove: removeTag
1964
+ }, /* @__PURE__ */ React.createElement(EditableTagContent, {
1965
+ value: children,
1966
+ inputRef,
1967
+ innerEditableRef,
1968
+ className: styles$1[`${baseClass$3}__content`],
1969
+ change: (newValue) => update(index2, newValue),
1970
+ remove: removeTag,
1971
+ validator
1972
+ }));
1973
+ };
1974
+ const baseClass$2 = "tag-input";
1975
+ const tagSeparatorKeys = [
1976
+ KeyCodes.enter,
1977
+ KeyCodes.spacebar,
1978
+ KeyCodes.tab,
1979
+ KeyCodes.semicolon,
1980
+ KeyCodes.comma
1981
+ ];
1982
+ const tagRemoveKeys = [KeyCodes.backspace, KeyCodes.delete];
1983
+ const TagInput = ({
1984
+ tags,
1985
+ onChange,
1986
+ validator,
1987
+ error,
1988
+ placeholder,
1989
+ size = "medium"
1990
+ }) => {
1991
+ const mergedClassNames = cx(styles$1[baseClass$2], {
1992
+ [styles$1[`${baseClass$2}--error`]]: error
1993
+ });
1994
+ const inputClassNames = cx(styles$1[`${baseClass$2}__input`], styles$1[`${baseClass$2}__input--${size}`]);
1995
+ const [inputValue, setInputValue] = React.useState("");
1996
+ const inputRef = React.useRef(null);
1997
+ const addTag = (value) => {
1998
+ onChange([...tags || [], value]);
1999
+ setInputValue("");
2000
+ };
2001
+ const removeTag = (idx) => {
2002
+ const newTags = [...tags || []];
2003
+ newTags.splice(idx, 1);
2004
+ onChange(newTags);
2005
+ };
2006
+ const onInputChange = (e) => setInputValue(e.target.value);
2007
+ const onInputKeyDown = (e) => {
2008
+ if (tagSeparatorKeys.includes(e.key)) {
2009
+ e.preventDefault();
2010
+ if (inputValue === "") {
2011
+ return;
2012
+ }
2013
+ addTag(inputValue);
2014
+ } else if (tagRemoveKeys.includes(e.key)) {
2015
+ if (inputValue !== "" || !(tags == null ? void 0 : tags.length)) {
2016
+ return;
2017
+ }
2018
+ removeTag(tags.length - 1);
2019
+ }
2020
+ };
2021
+ const updateTag = (i, value) => {
2022
+ const newTags = [...tags || []];
2023
+ const numOccurrencesOfValue = newTags.reduce((prev, currentValue, index2) => prev + (currentValue === value && index2 !== i ? 1 : 0), 0);
2024
+ if (numOccurrencesOfValue > 0) {
2025
+ newTags.splice(i, 1);
2026
+ } else {
2027
+ newTags[i] = value;
2028
+ }
2029
+ onChange(newTags);
2030
+ };
2031
+ const onPaste = (e) => {
2032
+ e.preventDefault();
2033
+ const text = e.clipboardData.getData("text/plain");
2034
+ const newTags = text.split(/[\s,;\n]+/);
2035
+ onChange([...tags || [], ...newTags]);
2036
+ };
2037
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
2038
+ className: mergedClassNames
2039
+ }, tags == null ? void 0 : tags.map((tag2, index2) => /* @__PURE__ */ React.createElement(EditableTag, {
2040
+ index: index2,
2041
+ key: `${index2}${tag2}`,
2042
+ update: updateTag,
2043
+ remove: removeTag,
2044
+ inputRef,
2045
+ validator,
2046
+ size
2047
+ }, tag2)), /* @__PURE__ */ React.createElement("input", {
2048
+ ref: inputRef,
2049
+ className: inputClassNames,
2050
+ placeholder,
2051
+ value: inputValue,
2052
+ onChange: onInputChange,
2053
+ onKeyDown: onInputKeyDown,
2054
+ onPaste
2055
+ })), error && /* @__PURE__ */ React.createElement(FieldError, null, error));
2056
+ };
2057
+ const emailRegex = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])$/i;
2058
+ const defaultPlaceholder = "name@company.com";
2059
+ const emailValidator = (value) => {
2060
+ return emailRegex.test(value);
2061
+ };
2062
+ const EmailTagInput = ({
2063
+ tags,
2064
+ onChange,
2065
+ error,
2066
+ placeholder = defaultPlaceholder,
2067
+ size
2068
+ }) => {
2069
+ return /* @__PURE__ */ React.createElement(TagInput, {
2070
+ tags,
2071
+ error,
2072
+ onChange,
2073
+ placeholder,
2074
+ validator: emailValidator,
2075
+ size
2076
+ });
2077
+ };
2078
+ const toast = "lc-Toast-module__toast___j5Amn";
2079
+ const toast__content = "lc-Toast-module__toast__content___HjaNw";
2080
+ const toast__icon = "lc-Toast-module__toast__icon___wLbLu";
2081
+ const toast__close = "lc-Toast-module__toast__close___O18Lh";
2082
+ const toast__actions = "lc-Toast-module__toast__actions___JWu-1";
2083
+ var styles = {
2084
+ toast,
2085
+ toast__content,
2086
+ toast__icon,
2087
+ toast__close,
2088
+ toast__actions,
2089
+ "toast__actions-close": "lc-Toast-module__toast__actions-close___xN8YT",
2090
+ "toast__actions-custom": "lc-Toast-module__toast__actions-custom___z1UUf",
2091
+ "toast--notification": "lc-Toast-module__toast--notification___pDXnc",
2092
+ "toast--success": "lc-Toast-module__toast--success___7UC6m",
2093
+ "toast--warning": "lc-Toast-module__toast--warning___pteb7",
2094
+ "toast--error": "lc-Toast-module__toast--error___trg--",
2095
+ "toast--info": "lc-Toast-module__toast--info___IOp44",
2096
+ "toast-wrapper": "lc-Toast-module__toast-wrapper___Oiwqp",
2097
+ "toast-wrapper--fixed": "lc-Toast-module__toast-wrapper--fixed___QYxRI",
2098
+ "toast-wrapper--block": "lc-Toast-module__toast-wrapper--block___j0kGt",
2099
+ "toast-wrapper--horizontal-center": "lc-Toast-module__toast-wrapper--horizontal-center___t9AFd",
2100
+ "toast-wrapper--horizontal-left": "lc-Toast-module__toast-wrapper--horizontal-left___-GY4I",
2101
+ "toast-wrapper--horizontal-right": "lc-Toast-module__toast-wrapper--horizontal-right___VVMgm",
2102
+ "toast-wrapper--vertical-top": "lc-Toast-module__toast-wrapper--vertical-top___uBfEG",
2103
+ "toast-appear--slide": "lc-Toast-module__toast-appear--slide___G7GAp",
2104
+ "toast-appear-active--slide": "lc-Toast-module__toast-appear-active--slide___brfgK",
2105
+ "toast-exit--slide": "lc-Toast-module__toast-exit--slide___aqiBq",
2106
+ "toast-exit-active--slide": "lc-Toast-module__toast-exit-active--slide___WryMi",
2107
+ "toast-wrapper--vertical-bottom": "lc-Toast-module__toast-wrapper--vertical-bottom___erPuH",
2108
+ "toast-appear--fade": "lc-Toast-module__toast-appear--fade___oUwHm",
2109
+ "toast-appear-active--fade": "lc-Toast-module__toast-appear-active--fade___D3--J",
2110
+ "toast-exit--fade": "lc-Toast-module__toast-exit--fade___iDA1p",
2111
+ "toast-exit-active--fade": "lc-Toast-module__toast-exit-active--fade___tL7sb"
2112
+ };
2113
+ const baseClass$1 = "toast";
2114
+ var Variants = /* @__PURE__ */ ((Variants2) => {
2115
+ Variants2["Success"] = "success";
2116
+ Variants2["Warning"] = "warning";
2117
+ Variants2["Error"] = "error";
2118
+ Variants2["Info"] = "info";
2119
+ Variants2["Notification"] = "notification";
2120
+ return Variants2;
2121
+ })(Variants || {});
2122
+ const IconConfig = {
2123
+ ["success"]: {
2124
+ source: CheckCircleSolid,
2125
+ iconType: IconTypeName.Inverted
2126
+ },
2127
+ ["warning"]: {
2128
+ source: Warning
2129
+ },
2130
+ ["error"]: {
2131
+ source: Error2,
2132
+ iconType: IconTypeName.Inverted
2133
+ },
2134
+ ["info"]: {
2135
+ source: Info,
2136
+ iconType: IconTypeName.Inverted
2137
+ },
2138
+ ["notification"]: {
2139
+ source: Info,
2140
+ iconType: IconTypeName.Link
2141
+ }
2142
+ };
2143
+ const Toast = ({
2144
+ action,
2145
+ className,
2146
+ children,
2147
+ removable,
2148
+ variant = "info",
2149
+ onClose
2150
+ }) => {
2151
+ const mergedClassNames = cx(styles[baseClass$1], styles[`${baseClass$1}--${variant}`], className);
2152
+ const onActionClick = (action2) => {
2153
+ if (action2 && action2.closeOnClick && onClose) {
2154
+ action2.handler();
2155
+ return onClose();
2156
+ }
2157
+ return action2.handler();
2158
+ };
2159
+ return /* @__PURE__ */ React.createElement("div", {
2160
+ className: mergedClassNames
2161
+ }, /* @__PURE__ */ React.createElement("div", {
2162
+ className: styles[`${baseClass$1}__icon`]
2163
+ }, /* @__PURE__ */ React.createElement(Icon, __spreadValues({}, IconConfig[variant]))), /* @__PURE__ */ React.createElement("div", {
2164
+ className: styles[`${baseClass$1}__content`]
2165
+ }, children), (action || removable) && /* @__PURE__ */ React.createElement("div", {
2166
+ className: styles[`${baseClass$1}__actions`]
2167
+ }, action && /* @__PURE__ */ React.createElement("button", {
2168
+ className: styles[`${baseClass$1}__actions-custom`],
2169
+ onClick: () => onActionClick(action)
2170
+ }, action.label), removable && /* @__PURE__ */ React.createElement("div", {
2171
+ className: styles[`${baseClass$1}__actions-close`],
2172
+ "aria-label": "Close toast",
2173
+ onClick: onClose
2174
+ }, /* @__PURE__ */ React.createElement(Icon, {
2175
+ source: Close,
2176
+ size: IconSizeName.Small,
2177
+ iconType: ["warning", "notification"].includes(variant) ? IconTypeName.Primary : IconTypeName.Inverted
2178
+ }))));
2179
+ };
2180
+ var HorizontalPosition = /* @__PURE__ */ ((HorizontalPosition2) => {
2181
+ HorizontalPosition2["Left"] = "left";
2182
+ HorizontalPosition2["Center"] = "center";
2183
+ HorizontalPosition2["Right"] = "right";
2184
+ return HorizontalPosition2;
2185
+ })(HorizontalPosition || {});
2186
+ var VerticalPosition = /* @__PURE__ */ ((VerticalPosition2) => {
2187
+ VerticalPosition2["Top"] = "top";
2188
+ VerticalPosition2["Bottom"] = "bottom";
2189
+ return VerticalPosition2;
2190
+ })(VerticalPosition || {});
2191
+ const ANIMATION_TIME = 200;
2192
+ const baseClass = "toast-wrapper";
2193
+ const ToastWrapper = ({
2194
+ className,
2195
+ toasts = [],
2196
+ fixed = true,
2197
+ block = false,
2198
+ animationType = "slide",
2199
+ verticalPosition = "top",
2200
+ horizontalPosition = "center"
2201
+ }) => {
2202
+ const mergedClassNames = cx(styles[baseClass], {
2203
+ [styles[`${baseClass}--fixed`]]: fixed,
2204
+ [styles[`${baseClass}--block`]]: !fixed && block,
2205
+ [styles[`${baseClass}--horizontal-${horizontalPosition}`]]: horizontalPosition,
2206
+ [styles[`${baseClass}--vertical-${verticalPosition}`]]: verticalPosition
2207
+ }, className);
2208
+ return /* @__PURE__ */ React.createElement("div", {
2209
+ className: mergedClassNames
2210
+ }, /* @__PURE__ */ React.createElement(TransitionGroup, {
2211
+ component: null
2212
+ }, toasts.map(({ id, variant, content, removable, action, onClose }) => /* @__PURE__ */ React.createElement(CSSTransition, {
2213
+ key: id,
2214
+ classNames: {
2215
+ enter: styles[`toast-appear--${animationType}`],
2216
+ enterActive: styles[`toast-appear-active--${animationType}`],
2217
+ exit: styles[`toast-exit--${animationType}`],
2218
+ exitActive: styles[`toast-exit-active--${animationType}`]
2219
+ },
2220
+ timeout: ANIMATION_TIME
2221
+ }, /* @__PURE__ */ React.createElement(Toast, {
2222
+ variant,
2223
+ onClose,
2224
+ removable,
2225
+ action
2226
+ }, content)))));
2227
+ };
2228
+ export { ANIMATION_TIME, ActionModal, Alert, Badge, Button, ButtonGroup, Card, Checkbox, CheckboxField, DesignTokens, EmailTagInput, FieldDescription, FieldError, FieldGroup, Form, FormGroup, Heading, HorizontalPosition, Icon, IconSizeName, IconTypeName, InputField, Link, Loader, Modal, ModalBase, ModalCloseButton, ModalPortal, NumericInput, NumericInputField, Popover, ProgressCircle, PromoBanner, RadioButton, Switch, Tab, TabsList, TabsWrapper, Tag, TagInput, Text, TextField, Toast, ToastWrapper, Variants, VerticalPosition };