@livechat/design-system-react-components 1.0.0-alpha.2 → 1.0.0-alpha.6

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