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

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