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

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 (192) hide show
  1. package/dist/dsrc.cjs.js +15 -0
  2. package/dist/dsrc.es.js +3255 -0
  3. package/dist/dsrc.umd.js +15 -0
  4. package/dist/shadow/shadow.css +7 -0
  5. package/dist/shadow/shadow.css.map +1 -0
  6. package/dist/shadow/spacing.css +18 -0
  7. package/dist/shadow/spacing.css.map +1 -0
  8. package/dist/spacing/shadow.css +7 -0
  9. package/dist/spacing/shadow.css.map +1 -0
  10. package/dist/spacing/spacing.css +18 -0
  11. package/dist/spacing/spacing.css.map +1 -0
  12. package/dist/src/components/Alert/Alert.d.ts +9 -0
  13. package/dist/src/components/Alert/index.d.ts +1 -0
  14. package/dist/src/components/Avatar/Avatar.d.ts +19 -0
  15. package/dist/src/components/Avatar/Avatar.helpers.d.ts +2 -0
  16. package/dist/src/components/Avatar/index.d.ts +1 -0
  17. package/dist/src/components/Badge/Badge.d.ts +9 -0
  18. package/dist/src/components/Badge/Badge.helpers.d.ts +1 -0
  19. package/dist/src/components/Badge/index.d.ts +1 -0
  20. package/dist/{components → src/components/Button}/Button.d.ts +14 -13
  21. package/dist/src/components/Button/index.d.ts +2 -0
  22. package/dist/{components → src/components/ButtonGroup}/ButtonGroup.d.ts +11 -11
  23. package/dist/src/components/ButtonGroup/index.d.ts +1 -0
  24. package/dist/src/components/Card/Card.d.ts +12 -0
  25. package/dist/src/components/Card/index.d.ts +2 -0
  26. package/dist/src/components/Checkbox/Checkbox.d.ts +7 -0
  27. package/dist/src/components/Checkbox/index.d.ts +1 -0
  28. package/dist/src/components/FieldDescription/FieldDescription.d.ts +3 -0
  29. package/dist/src/components/FieldDescription/index.d.ts +1 -0
  30. package/dist/src/components/FieldError/FieldError.d.ts +3 -0
  31. package/dist/src/components/FieldError/index.d.ts +1 -0
  32. package/dist/src/components/FieldGroup/FieldGroup.d.ts +8 -0
  33. package/dist/src/components/FieldGroup/index.d.ts +1 -0
  34. package/dist/src/components/Form/Form.d.ts +7 -0
  35. package/dist/src/components/Form/index.d.ts +2 -0
  36. package/dist/src/components/FormField/FormField.d.ts +13 -0
  37. package/dist/src/components/FormField/index.d.ts +1 -0
  38. package/dist/src/components/FormGroup/FormGroup.d.ts +7 -0
  39. package/dist/src/components/FormGroup/index.d.ts +1 -0
  40. package/dist/src/components/Icon/Icon.d.ts +14 -0
  41. package/dist/src/components/Icon/index.d.ts +1 -0
  42. package/dist/src/components/Input/Input.d.ts +9 -0
  43. package/dist/src/components/Input/index.d.ts +1 -0
  44. package/dist/src/components/Link/Link.d.ts +14 -0
  45. package/dist/src/components/Link/index.d.ts +1 -0
  46. package/dist/{components → src/components/Loader}/Loader.d.ts +10 -10
  47. package/dist/src/components/Loader/index.d.ts +1 -0
  48. package/dist/src/components/Modal/ActionModal.d.ts +8 -0
  49. package/dist/src/components/Modal/Modal.d.ts +7 -0
  50. package/dist/src/components/Modal/ModalBase.d.ts +6 -0
  51. package/dist/src/components/Modal/ModalCloseButton.d.ts +3 -0
  52. package/dist/src/components/Modal/ModalPortal.d.ts +7 -0
  53. package/dist/src/components/Modal/index.d.ts +10 -0
  54. package/dist/src/components/NumericInput/NumericInput.d.ts +14 -0
  55. package/dist/src/components/NumericInput/index.d.ts +1 -0
  56. package/dist/src/components/Picker/Picker.d.ts +17 -0
  57. package/dist/src/components/Picker/PickerList.d.ts +18 -0
  58. package/dist/src/components/Picker/Trigger.d.ts +15 -0
  59. package/dist/src/components/Picker/index.d.ts +1 -0
  60. package/dist/src/components/Popover/Popover.d.ts +10 -0
  61. package/dist/src/components/Popover/index.d.ts +1 -0
  62. package/dist/{components → src/components/Progress}/ProgressBar.d.ts +9 -9
  63. package/dist/src/components/Progress/ProgressCircle.d.ts +9 -0
  64. package/dist/src/components/Progress/constants.d.ts +4 -0
  65. package/dist/{components → src/components/Progress}/helpers.d.ts +3 -3
  66. package/dist/src/components/Progress/index.d.ts +2 -0
  67. package/dist/{components → src/components/PromoBanner}/PromoBanner.d.ts +13 -19
  68. package/dist/src/components/PromoBanner/index.d.ts +1 -0
  69. package/dist/src/components/RadioButton/RadioButton.d.ts +7 -0
  70. package/dist/src/components/RadioButton/index.d.ts +1 -0
  71. package/dist/src/components/Search/Search.d.ts +16 -0
  72. package/dist/src/components/Search/index.d.ts +1 -0
  73. package/dist/{components → src/components/Switch}/Switch.d.ts +16 -17
  74. package/dist/src/components/Switch/index.d.ts +1 -0
  75. package/dist/{components → src/components/Tab}/Tab.d.ts +12 -12
  76. package/dist/{components → src/components/Tab}/TabsWrapper.d.ts +3 -3
  77. package/dist/src/components/Tab/index.d.ts +2 -0
  78. package/dist/src/components/Tag/Tag.d.ts +12 -0
  79. package/dist/src/components/Tag/index.d.ts +1 -0
  80. package/dist/src/components/TagInput/EditableTag.d.ts +11 -0
  81. package/dist/src/components/TagInput/EditableTagContent.d.ts +11 -0
  82. package/dist/src/components/TagInput/EmailTagInput.d.ts +5 -0
  83. package/dist/src/components/TagInput/TagInput.d.ts +12 -0
  84. package/dist/src/components/TagInput/index.d.ts +4 -0
  85. package/dist/src/components/Toast/Toast.d.ts +16 -0
  86. package/dist/src/components/Toast/ToastWrapper.d.ts +20 -0
  87. package/dist/src/components/Toast/index.d.ts +2 -0
  88. package/dist/src/components/Tooltip/Info.d.ts +8 -0
  89. package/dist/src/components/Tooltip/Interactive.d.ts +14 -0
  90. package/dist/src/components/Tooltip/Simple.d.ts +4 -0
  91. package/dist/src/components/Tooltip/SpotlightOverlay.d.ts +7 -0
  92. package/dist/src/components/Tooltip/Tooltip.d.ts +22 -0
  93. package/dist/src/components/Tooltip/UserGuide.d.ts +12 -0
  94. package/dist/src/components/Tooltip/helpers.d.ts +2 -0
  95. package/dist/src/components/Tooltip/index.d.ts +5 -0
  96. package/dist/src/components/Tooltip/virtualElementReference.d.ts +9 -0
  97. package/dist/{components → src/components/Typography}/Heading.d.ts +11 -11
  98. package/dist/{components → src/components/Typography}/Text.d.ts +15 -15
  99. package/dist/src/components/Typography/index.d.ts +2 -0
  100. package/dist/src/foundations/shadow-token.d.ts +5 -0
  101. package/dist/src/foundations/spacing-token.d.ts +16 -0
  102. package/dist/src/index.d.ts +36 -0
  103. package/dist/src/themes/design-token.d.ts +126 -0
  104. package/dist/src/utils/keyCodes.d.ts +12 -0
  105. package/dist/{utils → src/utils}/noop.d.ts +1 -1
  106. package/dist/src/vite-env.d.ts +1 -0
  107. package/dist/style.css +1 -0
  108. package/dist/themes/dark.css +130 -0
  109. package/dist/themes/dark.css.map +1 -0
  110. package/dist/themes/legacy.css +131 -0
  111. package/dist/themes/legacy.css.map +1 -0
  112. package/dist/themes/light.css +130 -0
  113. package/dist/themes/light.css.map +1 -0
  114. package/package.json +51 -36
  115. package/dist/components/Alert.d.ts +0 -19
  116. package/dist/components/Alert.spec.d.ts +0 -1
  117. package/dist/components/Badge.d.ts +0 -6
  118. package/dist/components/Badge.spec.d.ts +0 -1
  119. package/dist/components/Button.spec.d.ts +0 -1
  120. package/dist/components/ButtonGroup.spec.d.ts +0 -1
  121. package/dist/components/Card.d.ts +0 -6
  122. package/dist/components/Card.spec.d.ts +0 -1
  123. package/dist/components/Checkbox.d.ts +0 -7
  124. package/dist/components/CheckboxField.d.ts +0 -7
  125. package/dist/components/CheckboxField.spec.d.ts +0 -1
  126. package/dist/components/FieldDescription.d.ts +0 -3
  127. package/dist/components/FieldError.d.ts +0 -3
  128. package/dist/components/FieldGroup.d.ts +0 -8
  129. package/dist/components/FieldGroup.spec.d.ts +0 -1
  130. package/dist/components/FieldLabel.d.ts +0 -3
  131. package/dist/components/Form.d.ts +0 -7
  132. package/dist/components/Form.spec.d.ts +0 -1
  133. package/dist/components/FormGroup.d.ts +0 -7
  134. package/dist/components/FormGroup.spec.d.ts +0 -1
  135. package/dist/components/Icon.d.ts +0 -69
  136. package/dist/components/Loader.spec.d.ts +0 -1
  137. package/dist/components/Modal/ActionModal.d.ts +0 -8
  138. package/dist/components/Modal/Modal.d.ts +0 -7
  139. package/dist/components/Modal/ModalBase.d.ts +0 -6
  140. package/dist/components/Modal/ModalBase.spec.d.ts +0 -1
  141. package/dist/components/Modal/ModalCloseButton.d.ts +0 -3
  142. package/dist/components/Modal/ModalPortal.d.ts +0 -7
  143. package/dist/components/ProgressBar.spec.d.ts +0 -1
  144. package/dist/components/ProgressCircle.d.ts +0 -9
  145. package/dist/components/ProgressCircle.spec.d.ts +0 -1
  146. package/dist/components/PromoBanner.spec.d.ts +0 -1
  147. package/dist/components/RadioButton.d.ts +0 -7
  148. package/dist/components/RadioButton.spec.d.ts +0 -1
  149. package/dist/components/Switch.spec.d.ts +0 -1
  150. package/dist/components/Tab.spec.d.ts +0 -1
  151. package/dist/components/TabsWrapper.spec.d.ts +0 -1
  152. package/dist/components/Toast.d.ts +0 -22
  153. package/dist/components/Toast.spec.d.ts +0 -1
  154. package/dist/components/ToastWrapper.d.ts +0 -26
  155. package/dist/components/ToastWrapper.spec.d.ts +0 -1
  156. package/dist/components/constants.d.ts +0 -12
  157. package/dist/constants/keyCodes.d.ts +0 -3
  158. package/dist/index.css +0 -2
  159. package/dist/index.css.map +0 -1
  160. package/dist/index.d.ts +0 -8
  161. package/dist/index.js +0 -2
  162. package/dist/index.js.map +0 -1
  163. package/dist/index.modern.js +0 -2
  164. package/dist/index.modern.js.map +0 -1
  165. package/dist/index.module.js +0 -2
  166. package/dist/index.module.js.map +0 -1
  167. package/dist/index.umd.js +0 -2
  168. package/dist/index.umd.js.map +0 -1
  169. package/dist/stories/Alert.stories.d.ts +0 -14
  170. package/dist/stories/Badge.stories.d.ts +0 -16
  171. package/dist/stories/Button.stories.d.ts +0 -20
  172. package/dist/stories/ButtonGroup.stories.d.ts +0 -18
  173. package/dist/stories/Card.stories.d.ts +0 -10
  174. package/dist/stories/CheckboxField.stories.d.ts +0 -9
  175. package/dist/stories/FieldGroup.stories.d.ts +0 -9
  176. package/dist/stories/Form.stories.d.ts +0 -6
  177. package/dist/stories/FormGroup.stories.d.ts +0 -9
  178. package/dist/stories/Icon.stories.d.ts +0 -14
  179. package/dist/stories/Loader.stories.d.ts +0 -8
  180. package/dist/stories/Modal.stories.d.ts +0 -19
  181. package/dist/stories/ProgressCircle.stories.d.ts +0 -13
  182. package/dist/stories/Progressbar.stories.d.ts +0 -13
  183. package/dist/stories/PromoBanner.stories.d.ts +0 -13
  184. package/dist/stories/RadioButton.stories.d.ts +0 -9
  185. package/dist/stories/Switch.stories.d.ts +0 -12
  186. package/dist/stories/Tab.stories.d.ts +0 -10
  187. package/dist/stories/TabsWrapper.stories.d.ts +0 -15
  188. package/dist/stories/Toast.stories.d.ts +0 -15
  189. package/dist/stories/ToastWrapper.stories.d.ts +0 -40
  190. package/dist/stories/foundations/components/ColorTokens.d.ts +0 -2
  191. package/dist/stories/foundations/components/IconsShowcase.d.ts +0 -6
  192. package/dist/test-utils.d.ts +0 -2
@@ -0,0 +1,3255 @@
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
+ var __publicField = (obj, key, value) => {
33
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
34
+ return value;
35
+ };
36
+ import * as React from "react";
37
+ import cx from "clsx";
38
+ import { Close, Info as Info$1, Warning, CheckCircleSolid, Block, Person, ChevronUp, ChevronDown, Check, Error as Error2, Search, LockBlack } from "@livechat/design-system-icons/react/material";
39
+ import debounce from "lodash.debounce";
40
+ import { getContrast } from "polished";
41
+ import * as ReactDOM from "react-dom";
42
+ import { useFloating, offset, flip, autoUpdate, arrow } from "@floating-ui/react-dom";
43
+ import escape from "lodash.escape";
44
+ import { TransitionGroup, CSSTransition } from "react-transition-group";
45
+ import { css } from "@emotion/css";
46
+ var index = "";
47
+ const DesignToken = {
48
+ Background: "--background",
49
+ SurfaceBasicDefault: "--surface-basic-default",
50
+ SurfaceBasicSubtle: "--surface-basic-subtle",
51
+ SurfaceBasicHover: "--surface-basic-hover",
52
+ SurfaceBasicActive: "--surface-basic-active",
53
+ SurfaceBasicDisabled: "--surface-basic-disabled",
54
+ SurfaceSecondaryDefault: "--surface-secondary-default",
55
+ SurfaceSecondarySubtle: "--surface-secondary-subtle",
56
+ SurfaceSecondaryHover: "--surface-secondary-hover",
57
+ SurfaceSecondaryDisabled: "--surface-secondary-disabled",
58
+ SurfaceFeedbackInfo: "--surface-feedback-info",
59
+ SurfaceFeedbackNegative: "--surface-feedback-negative",
60
+ SurfaceFeedbackWarning: "--surface-feedback-warning",
61
+ SurfaceFeedbackPositive: "--surface-feedback-positive",
62
+ SurfaceInvertDefault: "--surface-invert-default",
63
+ SurfaceInvertSubtle: "--surface-invert-subtle",
64
+ SurfaceInvertDisabled: "--surface-invert-disabled",
65
+ SurfaceOverlay: "--surface-overlay",
66
+ ContentDefault: "--content-default",
67
+ ContentSubtle: "--content-subtle",
68
+ ContentDisabled: "--content-disabled",
69
+ ContentWhiteLocked: "--content-white-locked",
70
+ ContentInvertDefault: "--content-invert-default",
71
+ ContentInvertSubtle: "--content-invert-subtle",
72
+ ContentInvertDisabled: "--content-invert-disabled",
73
+ BorderDefault: "--border-default",
74
+ BorderSubtle: "--border-subtle",
75
+ BorderHover: "--border-hover",
76
+ BorderDisabled: "--border-disabled",
77
+ BorderInvertDefault: "--border-invert-default",
78
+ BorderInvertSubtle: "--border-invert-subtle",
79
+ BorderInvertHover: "--border-invert-hover",
80
+ BorderInvertDisabled: "--border-invert-disabled",
81
+ ColorActionActive: "--color-action-active",
82
+ ColorActionHover: "--color-action-hover",
83
+ ColorActionDefault: "--color-action-default",
84
+ ColorActionDisabled: "--color-action-disabled",
85
+ ColorNegativeActive: "--color-negative-active",
86
+ ColorNegativeHover: "--color-negative-hover",
87
+ ColorNegativeDefault: "--color-negative-default",
88
+ ColorNegativeDisabled: "--color-negative-disabled",
89
+ ColorWarningDefault: "--color-warning-default",
90
+ ColorWarningHover: "--color-warning-hover",
91
+ ColorPositiveDefault: "--color-positive-default",
92
+ ColorPositiveHover: "--color-positive-hover",
93
+ ColorPositiveDisabled: "--color-positive-disabled",
94
+ ColorBot: "--color-bot",
95
+ ColorBlack: "--color-black",
96
+ ColorWhite: "--color-white",
97
+ DecorBlue900: "--decor-blue900",
98
+ DecorBlue800: "--decor-blue800",
99
+ DecorBlue700: "--decor-blue700",
100
+ DecorBlue600: "--decor-blue600",
101
+ DecorBlue500: "--decor-blue500",
102
+ DecorBlue400: "--decor-blue400",
103
+ DecorBlue300: "--decor-blue300",
104
+ DecorBlue200: "--decor-blue200",
105
+ DecorBlue100: "--decor-blue100",
106
+ DecorBlue50: "--decor-blue50",
107
+ DecorOrange900: "--decor-orange900",
108
+ DecorOrange800: "--decor-orange800",
109
+ DecorOrange700: "--decor-orange700",
110
+ DecorOrange600: "--decor-orange600",
111
+ DecorOrange500: "--decor-orange500",
112
+ DecorOrange400: "--decor-orange400",
113
+ DecorOrange300: "--decor-orange300",
114
+ DecorOrange200: "--decor-orange200",
115
+ DecorOrange100: "--decor-orange100",
116
+ DecorOrange50: "--decor-orange50",
117
+ DecorYellow900: "--decor-yellow900",
118
+ DecorYellow800: "--decor-yellow800",
119
+ DecorYellow700: "--decor-yellow700",
120
+ DecorYellow600: "--decor-yellow600",
121
+ DecorYellow500: "--decor-yellow500",
122
+ DecorYellow400: "--decor-yellow400",
123
+ DecorYellow300: "--decor-yellow300",
124
+ DecorYellow200: "--decor-yellow200",
125
+ DecorYellow100: "--decor-yellow100",
126
+ DecorYellow50: "--decor-yellow50",
127
+ DecorGray950: "--decor-gray950",
128
+ DecorGray900: "--decor-gray900",
129
+ DecorGray800: "--decor-gray800",
130
+ DecorGray700: "--decor-gray700",
131
+ DecorGray600: "--decor-gray600",
132
+ DecorGray500: "--decor-gray500",
133
+ DecorGray400: "--decor-gray400",
134
+ DecorGray300: "--decor-gray300",
135
+ DecorGray200: "--decor-gray200",
136
+ DecorGray150: "--decor-gray150",
137
+ DecorGray100: "--decor-gray100",
138
+ DecorGray75: "--decor-gray75",
139
+ DecorGray50: "--decor-gray50",
140
+ DecorGray40: "--decor-gray40",
141
+ DecorGray20: "--decor-gray20",
142
+ DecorGreen900: "--decor-green900",
143
+ DecorGreen800: "--decor-green800",
144
+ DecorGreen700: "--decor-green700",
145
+ DecorGreen600: "--decor-green600",
146
+ DecorGreen500: "--decor-green500",
147
+ DecorGreen400: "--decor-green400",
148
+ DecorGreen300: "--decor-green300",
149
+ DecorGreen200: "--decor-green200",
150
+ DecorGreen100: "--decor-green100",
151
+ DecorGreen50: "--decor-green50",
152
+ DecorRed900: "--decor-red900",
153
+ DecorRed800: "--decor-red800",
154
+ DecorRed700: "--decor-red700",
155
+ DecorRed600: "--decor-red600",
156
+ DecorRed500: "--decor-red500",
157
+ DecorRed400: "--decor-red400",
158
+ DecorRed300: "--decor-red300",
159
+ DecorRed200: "--decor-red200",
160
+ DecorRed100: "--decor-red100",
161
+ DecorRed50: "--decor-red50",
162
+ DecorPurple900: "--decor-purple900",
163
+ DecorPurple800: "--decor-purple800",
164
+ DecorPurple700: "--decor-purple700",
165
+ DecorPurple600: "--decor-purple600",
166
+ DecorPurple500: "--decor-purple500",
167
+ DecorPurple400: "--decor-purple400",
168
+ DecorPurple300: "--decor-purple300",
169
+ DecorPurple200: "--decor-purple200",
170
+ DecorPurple100: "--decor-purple100",
171
+ DecorPurple50: "--decor-purple50"
172
+ };
173
+ const SpacingToken = {
174
+ Spacing0: "--spacing-0",
175
+ Spacing05: "--spacing-05",
176
+ Spacing1: "--spacing-1",
177
+ Spacing2: "--spacing-2",
178
+ Spacing3: "--spacing-3",
179
+ Spacing4: "--spacing-4",
180
+ Spacing5: "--spacing-5",
181
+ Spacing6: "--spacing-6",
182
+ Spacing8: "--spacing-8",
183
+ Spacing12: "--spacing-12",
184
+ Spacing16: "--spacing-16",
185
+ Spacing18: "--spacing-18",
186
+ Spacing20: "--spacing-20",
187
+ Spacing24: "--spacing-24"
188
+ };
189
+ const ShadowToken = {
190
+ Float: "--shadow-float",
191
+ PopOver: "--shadow-pop-over",
192
+ Modal: "--shadow-modal"
193
+ };
194
+ const caps = "lc-Typography-module__caps___c3eNJ";
195
+ var styles$y = {
196
+ "heading-xl": "lc-Typography-module__heading-xl___nhr-6",
197
+ "heading-lg": "lc-Typography-module__heading-lg___XYF7l",
198
+ "heading-md": "lc-Typography-module__heading-md___wHOIs",
199
+ "heading-sm": "lc-Typography-module__heading-sm___nBmTV",
200
+ "heading-xs": "lc-Typography-module__heading-xs___VcZBs",
201
+ caps,
202
+ "caps--bold": "lc-Typography-module__caps--bold___OZovw",
203
+ "paragraph-md": "lc-Typography-module__paragraph-md___UGoqq",
204
+ "paragraph-md--bold": "lc-Typography-module__paragraph-md--bold___mWcMG",
205
+ "paragraph-md--underline": "lc-Typography-module__paragraph-md--underline___Fv6zM",
206
+ "paragraph-md--strike": "lc-Typography-module__paragraph-md--strike___yLGHh",
207
+ "paragraph-sm": "lc-Typography-module__paragraph-sm___QIEFL",
208
+ "paragraph-sm--bold": "lc-Typography-module__paragraph-sm--bold___fAjI5",
209
+ "paragraph-xs": "lc-Typography-module__paragraph-xs___OUooD",
210
+ "paragraph-xs--bold": "lc-Typography-module__paragraph-xs--bold___z7om7"
211
+ };
212
+ const SIZE_TO_ELEMENT_MAP = {
213
+ xl: "h1",
214
+ lg: "h2",
215
+ md: "h3",
216
+ sm: "h4",
217
+ xs: "h5"
218
+ };
219
+ const Heading = (_a) => {
220
+ var _b = _a, {
221
+ as,
222
+ size = "md",
223
+ children,
224
+ className
225
+ } = _b, props = __objRest(_b, [
226
+ "as",
227
+ "size",
228
+ "children",
229
+ "className"
230
+ ]);
231
+ return React.createElement(as || SIZE_TO_ELEMENT_MAP[size], __spreadValues({ className: cx(styles$y[`heading-${size}`], className) }, props), children);
232
+ };
233
+ const Text = (_c) => {
234
+ var _d = _c, {
235
+ as = "p",
236
+ size = "md",
237
+ caps: caps2 = false,
238
+ bold = false,
239
+ underline = false,
240
+ strike = false,
241
+ children,
242
+ className
243
+ } = _d, props = __objRest(_d, [
244
+ "as",
245
+ "size",
246
+ "caps",
247
+ "bold",
248
+ "underline",
249
+ "strike",
250
+ "children",
251
+ "className"
252
+ ]);
253
+ const baseClassPrefix = caps2 ? "caps" : `paragraph-${size}`;
254
+ return React.createElement(as, __spreadValues({
255
+ className: cx({
256
+ [styles$y[`${baseClassPrefix}`]]: true,
257
+ [styles$y[`${baseClassPrefix}--bold`]]: bold,
258
+ [styles$y[`${baseClassPrefix}--strike`]]: strike,
259
+ [styles$y[`${baseClassPrefix}--underline`]]: underline
260
+ }, className)
261
+ }, props), children);
262
+ };
263
+ const icon$1 = "lc-Icon-module__icon___tw31R";
264
+ var styles$x = {
265
+ icon: icon$1,
266
+ "icon--primary": "lc-Icon-module__icon--primary___JJnBV",
267
+ "icon--subtle": "lc-Icon-module__icon--subtle___sZIzL",
268
+ "icon--inverted": "lc-Icon-module__icon--inverted___zA9QC",
269
+ "icon--inverted-subtle": "lc-Icon-module__icon--inverted-subtle___6UwBT",
270
+ "icon--link": "lc-Icon-module__icon--link___Jwkw9",
271
+ "icon--success": "lc-Icon-module__icon--success___MKdz3",
272
+ "icon--warning": "lc-Icon-module__icon--warning___5YCSW",
273
+ "icon--error": "lc-Icon-module__icon--error___CiJCD",
274
+ "icon--disabled--primary": "lc-Icon-module__icon--disabled--primary___E0nee",
275
+ "icon--disabled--subtle": "lc-Icon-module__icon--disabled--subtle___l-hK4",
276
+ "icon--disabled--inverted": "lc-Icon-module__icon--disabled--inverted___5SBAf",
277
+ "icon--disabled--inverted-subtle": "lc-Icon-module__icon--disabled--inverted-subtle___w-NBk",
278
+ "icon--disabled--link": "lc-Icon-module__icon--disabled--link___sVJOa",
279
+ "icon--disabled--success": "lc-Icon-module__icon--disabled--success___sG-7d",
280
+ "icon--disabled--warning": "lc-Icon-module__icon--disabled--warning___8ko1e",
281
+ "icon--disabled--error": "lc-Icon-module__icon--disabled--error___9KbVo"
282
+ };
283
+ const IconSizeMap = {
284
+ xsmall: {
285
+ width: 12,
286
+ height: 12
287
+ },
288
+ small: {
289
+ width: 16,
290
+ height: 16
291
+ },
292
+ medium: {
293
+ width: 20,
294
+ height: 20
295
+ },
296
+ large: {
297
+ width: 24,
298
+ height: 24
299
+ },
300
+ xlarge: {
301
+ width: 32,
302
+ height: 32
303
+ }
304
+ };
305
+ const baseClass$F = "icon";
306
+ const Icon = (props) => {
307
+ const _a = props, {
308
+ source,
309
+ size = "medium",
310
+ kind,
311
+ disabled,
312
+ className,
313
+ customColor
314
+ } = _a, restProps = __objRest(_a, [
315
+ "source",
316
+ "size",
317
+ "kind",
318
+ "disabled",
319
+ "className",
320
+ "customColor"
321
+ ]);
322
+ const GeneratedIcon = React.createElement(source, __spreadProps(__spreadValues({}, IconSizeMap[size]), {
323
+ color: customColor
324
+ }));
325
+ const mergedClassNames = cx(className, styles$x[baseClass$F], kind && styles$x[`${baseClass$F}--${disabled ? "disabled--" : ""}${kind}`]);
326
+ return /* @__PURE__ */ React.createElement("span", __spreadProps(__spreadValues({}, restProps), {
327
+ className: mergedClassNames
328
+ }), GeneratedIcon);
329
+ };
330
+ const alert = "lc-Alert-module__alert___HBTns";
331
+ const alert__content = "lc-Alert-module__alert__content___9nZdf";
332
+ const alert__icon = "lc-Alert-module__alert__icon___8TaAH";
333
+ var styles$w = {
334
+ alert,
335
+ alert__content,
336
+ "alert__content-text": "lc-Alert-module__alert__content-text___x2Un5",
337
+ "alert__content-text--margin": "lc-Alert-module__alert__content-text--margin___whVzG",
338
+ "alert__content-icon": "lc-Alert-module__alert__content-icon___-EXJm",
339
+ "alert--small": "lc-Alert-module__alert--small___Fyk-v",
340
+ "alert__close-icon": "lc-Alert-module__alert__close-icon___rYxVy",
341
+ "alert--info": "lc-Alert-module__alert--info___GmIGN",
342
+ "alert--warning": "lc-Alert-module__alert--warning___MubhD",
343
+ "alert--success": "lc-Alert-module__alert--success___fPtlZ",
344
+ "alert--error": "lc-Alert-module__alert--error___DKPo0",
345
+ alert__icon
346
+ };
347
+ const IconConfig = {
348
+ info: {
349
+ source: Info$1,
350
+ kind: "link"
351
+ },
352
+ warning: {
353
+ source: Warning,
354
+ kind: "warning"
355
+ },
356
+ success: {
357
+ source: CheckCircleSolid,
358
+ kind: "success"
359
+ },
360
+ error: {
361
+ source: Block,
362
+ kind: "error"
363
+ }
364
+ };
365
+ const baseClass$E = "alert";
366
+ const Alert = ({
367
+ children,
368
+ className,
369
+ kind = "info",
370
+ onClose
371
+ }) => {
372
+ const containerRef = React.useRef(null);
373
+ const [isSmallContainer, setIsSmallContainer] = React.useState(false);
374
+ const mergedClassNames = cx(styles$w[baseClass$E], styles$w[`${baseClass$E}--${kind}`], isSmallContainer && styles$w[`${baseClass$E}--small`], className);
375
+ React.useEffect(() => {
376
+ const handleResize = debounce(() => {
377
+ if (containerRef.current && containerRef.current.offsetWidth <= 400) {
378
+ return setIsSmallContainer(true);
379
+ }
380
+ return setIsSmallContainer(false);
381
+ }, 500);
382
+ window.addEventListener("resize", handleResize);
383
+ return () => window.removeEventListener("resize", handleResize);
384
+ });
385
+ return /* @__PURE__ */ React.createElement("div", {
386
+ ref: containerRef,
387
+ className: mergedClassNames
388
+ }, /* @__PURE__ */ React.createElement("div", {
389
+ className: styles$w[`${baseClass$E}__content`]
390
+ }, /* @__PURE__ */ React.createElement(Icon, __spreadProps(__spreadValues({}, IconConfig[kind]), {
391
+ size: "large",
392
+ className: styles$w[`${baseClass$E}__content-icon`]
393
+ })), /* @__PURE__ */ React.createElement(Text, {
394
+ as: "div",
395
+ className: cx(styles$w[`${baseClass$E}__content-text`], onClose && styles$w[`${baseClass$E}__content-text--margin`])
396
+ }, children)), onClose && /* @__PURE__ */ React.createElement("button", {
397
+ type: "button",
398
+ className: styles$w[`${baseClass$E}__close-icon`],
399
+ onClick: onClose
400
+ }, /* @__PURE__ */ React.createElement(Icon, {
401
+ source: Close,
402
+ size: "large",
403
+ kind: "primary"
404
+ })));
405
+ };
406
+ function getInitials(name = "", count = 2) {
407
+ return name.split(" ").map((el) => el.charAt(0)).join("").substring(0, count).toUpperCase();
408
+ }
409
+ function getFontColor(color) {
410
+ return getContrast(color, "#FFFFFF") > 4.5 ? "var(--color-white)" : "var(--color-black)";
411
+ }
412
+ const avatar = "lc-Avatar-module__avatar___1zTCE";
413
+ const avatar__status = "lc-Avatar-module__avatar__status___nX2Ls";
414
+ const avatar__rim = "lc-Avatar-module__avatar__rim___RCQ8Q";
415
+ const avatar__image = "lc-Avatar-module__avatar__image___YqfqE";
416
+ var styles$v = {
417
+ avatar,
418
+ avatar__status,
419
+ "avatar__status--available": "lc-Avatar-module__avatar__status--available___tcpFg",
420
+ "avatar__status--unavailable": "lc-Avatar-module__avatar__status--unavailable___ciauF",
421
+ "avatar__status--unknown": "lc-Avatar-module__avatar__status--unknown___MBaGB",
422
+ "avatar__status--xxxsmall": "lc-Avatar-module__avatar__status--xxxsmall___8pkEO",
423
+ "avatar__status--circle": "lc-Avatar-module__avatar__status--circle___doV5H",
424
+ "avatar__status--xxsmall": "lc-Avatar-module__avatar__status--xxsmall___M69lx",
425
+ "avatar__status--xsmall": "lc-Avatar-module__avatar__status--xsmall___RKQiI",
426
+ "avatar__status--small": "lc-Avatar-module__avatar__status--small___cVrA7",
427
+ "avatar__status--medium": "lc-Avatar-module__avatar__status--medium___n5z1H",
428
+ "avatar__status--large": "lc-Avatar-module__avatar__status--large___Lt-0p",
429
+ "avatar__status--xlarge": "lc-Avatar-module__avatar__status--xlarge___RWIcJ",
430
+ "avatar__status--xxlarge": "lc-Avatar-module__avatar__status--xxlarge___crG9D",
431
+ "avatar__status--rounded-square": "lc-Avatar-module__avatar__status--rounded-square___-My1P",
432
+ avatar__rim,
433
+ "avatar__rim--xxxsmall": "lc-Avatar-module__avatar__rim--xxxsmall___0CH9D",
434
+ "avatar__rim--xxsmall": "lc-Avatar-module__avatar__rim--xxsmall___Mde0K",
435
+ "avatar__rim--xsmall": "lc-Avatar-module__avatar__rim--xsmall___LAN-b",
436
+ "avatar__rim--small": "lc-Avatar-module__avatar__rim--small___FT8LX",
437
+ "avatar__rim--medium": "lc-Avatar-module__avatar__rim--medium___Dy0pr",
438
+ "avatar__rim--large": "lc-Avatar-module__avatar__rim--large___FPvGp",
439
+ "avatar__rim--xlarge": "lc-Avatar-module__avatar__rim--xlarge___CY0kN",
440
+ "avatar__rim--xxlarge": "lc-Avatar-module__avatar__rim--xxlarge___tE053",
441
+ avatar__image,
442
+ "avatar__icon--xxxsmall": "lc-Avatar-module__avatar__icon--xxxsmall___KaoMa",
443
+ "avatar__icon--xxsmall": "lc-Avatar-module__avatar__icon--xxsmall___NJJNV",
444
+ "avatar__icon--xsmall": "lc-Avatar-module__avatar__icon--xsmall___yHEZK",
445
+ "avatar__icon--small": "lc-Avatar-module__avatar__icon--small___l6lBu",
446
+ "avatar__icon--medium": "lc-Avatar-module__avatar__icon--medium___LF4w2",
447
+ "avatar__icon--large": "lc-Avatar-module__avatar__icon--large___QntBf",
448
+ "avatar__icon--xlarge": "lc-Avatar-module__avatar__icon--xlarge___bcHbI",
449
+ "avatar__icon--xxlarge": "lc-Avatar-module__avatar__icon--xxlarge___sx8Fq",
450
+ "avatar--circle": "lc-Avatar-module__avatar--circle___XwEz-",
451
+ "avatar--rounded-square": "lc-Avatar-module__avatar--rounded-square___m7-4I",
452
+ "avatar--with-rim": "lc-Avatar-module__avatar--with-rim___pvFZR",
453
+ "avatar--xxxsmall": "lc-Avatar-module__avatar--xxxsmall___EHzpP",
454
+ "avatar--xxsmall": "lc-Avatar-module__avatar--xxsmall___EDOVp",
455
+ "avatar--xsmall": "lc-Avatar-module__avatar--xsmall___nI348",
456
+ "avatar--small": "lc-Avatar-module__avatar--small___UuQen",
457
+ "avatar--medium": "lc-Avatar-module__avatar--medium___Bt9Eo",
458
+ "avatar--large": "lc-Avatar-module__avatar--large___OU-08",
459
+ "avatar--xlarge": "lc-Avatar-module__avatar--xlarge___zwgeW",
460
+ "avatar--xxlarge": "lc-Avatar-module__avatar--xxlarge___Ur0ul"
461
+ };
462
+ const baseClass$D = "avatar";
463
+ const defaultBackgroundColor = "var(--surface-basic-disabled)";
464
+ const defaultFontColor = "var(--content-subtle)";
465
+ const Avatar = ({
466
+ alt,
467
+ className,
468
+ color,
469
+ shape = "circle",
470
+ size = "medium",
471
+ src,
472
+ status,
473
+ text,
474
+ type,
475
+ withRim = false
476
+ }) => {
477
+ const isImproperImageSetup = type === "image" && !src;
478
+ const [shouldDisplayFallbackAvatar, setShouldDisplayFallbackAvatar] = React.useState(isImproperImageSetup);
479
+ const shouldDisplayImage = type === "image" && !!src && !shouldDisplayFallbackAvatar;
480
+ const shouldDisplayInitials = type === "text";
481
+ const letterCount = ["xxxsmall", "xxsmall", "xsmall"].includes(size) ? 1 : 2;
482
+ const initials = getInitials(text, letterCount);
483
+ const backgroundColor = color || defaultBackgroundColor;
484
+ const fontColor = color ? getFontColor(color) : defaultFontColor;
485
+ const mergedClassNames = cx({
486
+ [styles$v[baseClass$D]]: true,
487
+ [styles$v[`${baseClass$D}--${shape}`]]: true,
488
+ [styles$v[`${baseClass$D}--${size}`]]: true,
489
+ [styles$v[`${baseClass$D}--with-rim`]]: withRim,
490
+ [`${className}`]: className
491
+ });
492
+ const mergedStatusClassNames = cx(styles$v[`${baseClass$D}__status`], styles$v[`${baseClass$D}__status--${shape}`], styles$v[`${baseClass$D}__status--${size}`], styles$v[`${baseClass$D}__status--${status}`]);
493
+ const mergedIconClassNames = cx(styles$v[`${baseClass$D}__icon`], styles$v[`${baseClass$D}__icon--${size}`]);
494
+ const mergedRimClassNames = cx(styles$v[`${baseClass$D}__rim`], styles$v[`${baseClass$D}__rim--${size}`]);
495
+ const handleError = React.useCallback(() => setShouldDisplayFallbackAvatar(true), []);
496
+ React.useEffect(() => {
497
+ setShouldDisplayFallbackAvatar(isImproperImageSetup);
498
+ }, [isImproperImageSetup]);
499
+ return /* @__PURE__ */ React.createElement("div", {
500
+ className: mergedClassNames,
501
+ style: { backgroundColor }
502
+ }, withRim && /* @__PURE__ */ React.createElement("div", {
503
+ "data-testid": `${baseClass$D}__rim`,
504
+ className: mergedRimClassNames
505
+ }), status && /* @__PURE__ */ React.createElement("div", {
506
+ "data-testid": `${baseClass$D}__status`,
507
+ className: mergedStatusClassNames
508
+ }), shouldDisplayImage && /* @__PURE__ */ React.createElement("img", {
509
+ className: styles$v[`${baseClass$D}__image`],
510
+ src,
511
+ alt,
512
+ onError: handleError
513
+ }), shouldDisplayInitials && /* @__PURE__ */ React.createElement("span", {
514
+ style: { color: fontColor }
515
+ }, initials), shouldDisplayFallbackAvatar && /* @__PURE__ */ React.createElement(Icon, {
516
+ "data-testid": `${baseClass$D}__icon`,
517
+ className: mergedIconClassNames,
518
+ source: Person,
519
+ kind: "primary"
520
+ }));
521
+ };
522
+ const badge = "lc-Badge-module__badge___GhLnu";
523
+ const badge__dot = "lc-Badge-module__badge__dot___z6RO6";
524
+ var styles$u = {
525
+ badge,
526
+ badge__dot,
527
+ "badge--large": "lc-Badge-module__badge--large___B131q",
528
+ "badge--medium": "lc-Badge-module__badge--medium___TDU8a",
529
+ "badge--compact": "lc-Badge-module__badge--compact___9xJ4y",
530
+ "badge--primary": "lc-Badge-module__badge--primary___8LRpp",
531
+ "badge--secondary": "lc-Badge-module__badge--secondary___JjNIJ",
532
+ "badge--tertiary": "lc-Badge-module__badge--tertiary___e83wV"
533
+ };
534
+ function formatCount(count, max) {
535
+ return count > max ? `${max}+` : `${count}`;
536
+ }
537
+ const baseClass$C = "badge";
538
+ const Badge = (_e) => {
539
+ var _f = _e, {
540
+ className,
541
+ count = 0,
542
+ max = 99,
543
+ kind = "primary",
544
+ size = "medium",
545
+ type = "counter"
546
+ } = _f, spanProps = __objRest(_f, [
547
+ "className",
548
+ "count",
549
+ "max",
550
+ "kind",
551
+ "size",
552
+ "type"
553
+ ]);
554
+ const mergedClassNames = cx(className, styles$u[baseClass$C], styles$u[`${baseClass$C}--${kind}`], styles$u[`${baseClass$C}--${size}`]);
555
+ const content = {
556
+ ["counter"]: formatCount(count, max),
557
+ ["alert"]: "!",
558
+ ["dot"]: /* @__PURE__ */ React.createElement("span", {
559
+ className: styles$u[`${baseClass$C}__dot`]
560
+ })
561
+ }[type];
562
+ return /* @__PURE__ */ React.createElement("span", __spreadValues({
563
+ className: mergedClassNames
564
+ }, spanProps), content);
565
+ };
566
+ const loader = "lc-Loader-module__loader___LRflD";
567
+ const loader__spinner = "lc-Loader-module__loader__spinner___l3C1g";
568
+ const rotate = "lc-Loader-module__rotate___Tlni-";
569
+ const loader__label = "lc-Loader-module__loader__label___R74f6";
570
+ var styles$t = {
571
+ loader,
572
+ loader__spinner,
573
+ "loader__spinner--small": "lc-Loader-module__loader__spinner--small___dGFFt",
574
+ "loader__spinner--medium": "lc-Loader-module__loader__spinner--medium___J-ki0",
575
+ "loader__spinner--large": "lc-Loader-module__loader__spinner--large___Poqq7",
576
+ "loader__spinner-circle": "lc-Loader-module__loader__spinner-circle___ApBUO",
577
+ rotate,
578
+ loader__label
579
+ };
580
+ const baseClass$B = "loader";
581
+ const spinnerClass = `${baseClass$B}__spinner`;
582
+ const Loader = ({
583
+ primaryColor,
584
+ secondaryColor,
585
+ label,
586
+ className,
587
+ size = "medium"
588
+ }) => {
589
+ return /* @__PURE__ */ React.createElement("div", {
590
+ className: cx(styles$t[baseClass$B], className)
591
+ }, /* @__PURE__ */ React.createElement("div", {
592
+ className: cx(styles$t[spinnerClass], styles$t[`${spinnerClass}--${size}`])
593
+ }, /* @__PURE__ */ React.createElement("div", {
594
+ className: styles$t["loader__spinner-circle"],
595
+ style: {
596
+ borderColor: secondaryColor,
597
+ borderTopColor: primaryColor
598
+ }
599
+ })), label && /* @__PURE__ */ React.createElement(Text, {
600
+ as: "div",
601
+ size: "md",
602
+ className: styles$t["loader__label"]
603
+ }, label));
604
+ };
605
+ const btn$1 = "lc-Button-module__btn___aijZJ";
606
+ const btn__loader = "lc-Button-module__btn__loader___c8zZz";
607
+ const btn__content = "lc-Button-module__btn__content___wefl2";
608
+ const btn__icon = "lc-Button-module__btn__icon___GVExB";
609
+ var styles$s = {
610
+ btn: btn$1,
611
+ "btn--disabled": "lc-Button-module__btn--disabled___lXBav",
612
+ "btn--icon-only": "lc-Button-module__btn--icon-only___bF5pW",
613
+ "btn__icon--left": "lc-Button-module__btn__icon--left___H68zu",
614
+ "btn__icon--right": "lc-Button-module__btn__icon--right___fHr3D",
615
+ "btn--full-width": "lc-Button-module__btn--full-width___kdbAr",
616
+ "btn--basic": "lc-Button-module__btn--basic___Jc2gD",
617
+ "btn--primary": "lc-Button-module__btn--primary___ajbjQ",
618
+ "btn--secondary": "lc-Button-module__btn--secondary___iWzE0",
619
+ "btn--destructive": "lc-Button-module__btn--destructive___-kLCl",
620
+ "btn--compact": "lc-Button-module__btn--compact___4eptQ",
621
+ "btn--large": "lc-Button-module__btn--large___lb-z6",
622
+ "btn--text": "lc-Button-module__btn--text___WA8OL",
623
+ "btn--plain": "lc-Button-module__btn--plain___eOPui",
624
+ "btn--plain-light": "lc-Button-module__btn--plain-light___eS9em",
625
+ "btn--loading": "lc-Button-module__btn--loading___ZAgjv",
626
+ btn__loader,
627
+ btn__content,
628
+ btn__icon
629
+ };
630
+ const baseClass$A = "btn";
631
+ const Button = (_g) => {
632
+ var _h = _g, {
633
+ loading = false,
634
+ disabled = false,
635
+ type = "button",
636
+ fullWidth = false,
637
+ kind = "basic",
638
+ size = "medium",
639
+ icon: icon2 = null,
640
+ iconPosition = "left",
641
+ loaderLabel,
642
+ className,
643
+ children,
644
+ href,
645
+ onClick
646
+ } = _h, props = __objRest(_h, [
647
+ "loading",
648
+ "disabled",
649
+ "type",
650
+ "fullWidth",
651
+ "kind",
652
+ "size",
653
+ "icon",
654
+ "iconPosition",
655
+ "loaderLabel",
656
+ "className",
657
+ "children",
658
+ "href",
659
+ "onClick"
660
+ ]);
661
+ const isDisabled = loading || disabled;
662
+ const Component = href ? "a" : "button";
663
+ const mergedClassNames = cx(className, styles$s[baseClass$A], styles$s[`${baseClass$A}--${kind}`], styles$s[`${baseClass$A}--${size}`], {
664
+ [styles$s[`${baseClass$A}--loading`]]: loading,
665
+ [styles$s[`${baseClass$A}--full-width`]]: fullWidth,
666
+ [styles$s[`${baseClass$A}--icon-only`]]: !children && icon2,
667
+ [styles$s[`${baseClass$A}--disabled`]]: isDisabled
668
+ });
669
+ return /* @__PURE__ */ React.createElement(Component, __spreadValues({
670
+ className: mergedClassNames,
671
+ "aria-disabled": isDisabled,
672
+ type,
673
+ href: isDisabled ? void 0 : href,
674
+ onClick: isDisabled ? void 0 : onClick
675
+ }, props), loading && /* @__PURE__ */ React.createElement(Loader, {
676
+ size: "small",
677
+ label: loaderLabel,
678
+ className: styles$s[`${baseClass$A}__loader`]
679
+ }), icon2 && React.cloneElement(icon2, {
680
+ className: cx(styles$s[`${baseClass$A}__icon`], styles$s[`${baseClass$A}__icon--${iconPosition}`]),
681
+ disabled
682
+ }), /* @__PURE__ */ React.createElement("div", {
683
+ className: styles$s[`${baseClass$A}__content`]
684
+ }, children));
685
+ };
686
+ const btn = "lc-ButtonGroup-module__btn___bXPrU";
687
+ var styles$r = {
688
+ "btn-group": "lc-ButtonGroup-module__btn-group___R-lZQ",
689
+ btn,
690
+ "btn--active": "lc-ButtonGroup-module__btn--active___VAc37",
691
+ "btn--compact": "lc-ButtonGroup-module__btn--compact___t1whe",
692
+ "btn--medium": "lc-ButtonGroup-module__btn--medium___XFRBP",
693
+ "btn--large": "lc-ButtonGroup-module__btn--large___OtNUz"
694
+ };
695
+ function noop() {
696
+ }
697
+ const baseClass$z = "btn-group";
698
+ const ButtonGroup = (_i) => {
699
+ var _j = _i, {
700
+ size = "medium",
701
+ fullWidth = false,
702
+ onIndexChange = noop,
703
+ className,
704
+ children,
705
+ currentIndex,
706
+ initialIndex = -1
707
+ } = _j, restProps = __objRest(_j, [
708
+ "size",
709
+ "fullWidth",
710
+ "onIndexChange",
711
+ "className",
712
+ "children",
713
+ "currentIndex",
714
+ "initialIndex"
715
+ ]);
716
+ const mergedClassName = cx(styles$r[baseClass$z], className);
717
+ const [currentStateIndex, setCurrentStateIndex] = React.useState(initialIndex);
718
+ const isControlled = typeof currentIndex === "number";
719
+ const _currentIndex = isControlled ? currentIndex : currentStateIndex;
720
+ const handleClick = (index2, event) => {
721
+ if (!isControlled) {
722
+ setCurrentStateIndex(index2);
723
+ }
724
+ onIndexChange(index2, event);
725
+ };
726
+ return /* @__PURE__ */ React.createElement("div", __spreadValues({
727
+ role: "group",
728
+ className: mergedClassName
729
+ }, restProps), React.Children.map(children, (child, i) => React.cloneElement(child, {
730
+ fullWidth,
731
+ size,
732
+ kind: "secondary",
733
+ type: "button",
734
+ onClick: (event) => {
735
+ handleClick(i, event);
736
+ if (child.props.onClick) {
737
+ child.props.onClick(event);
738
+ }
739
+ },
740
+ className: cx(styles$r["btn"], styles$r[`btn--${size}`], i === _currentIndex && styles$r["btn--active"])
741
+ })));
742
+ };
743
+ const card = "lc-Card-module__card___GqMm2";
744
+ const card__header = "lc-Card-module__card__header___0ptfD";
745
+ const card__header__image = "lc-Card-module__card__header__image___QMwSu";
746
+ const card__header__heading = "lc-Card-module__card__header__heading___Wkikx";
747
+ const card__header__heading__title = "lc-Card-module__card__header__heading__title___Uxi8s";
748
+ const card__header__heading__description = "lc-Card-module__card__header__heading__description___6LnOK";
749
+ const card__content = "lc-Card-module__card__content___KuDcc";
750
+ const card__actions = "lc-Card-module__card__actions___q9sAo";
751
+ const card__actions__line = "lc-Card-module__card__actions__line___TF1bt";
752
+ const card__actions__buttons = "lc-Card-module__card__actions__buttons___PDMMR";
753
+ var styles$q = {
754
+ card,
755
+ card__header,
756
+ card__header__image,
757
+ card__header__heading,
758
+ card__header__heading__title,
759
+ card__header__heading__description,
760
+ card__content,
761
+ "card__expanded-content": "lc-Card-module__card__expanded-content___yB-QL",
762
+ card__actions,
763
+ card__actions__line,
764
+ card__actions__buttons,
765
+ "card__actions__buttons-expander": "lc-Card-module__card__actions__buttons-expander___lz4h-"
766
+ };
767
+ const baseClass$y = "card";
768
+ const headerClass = `${baseClass$y}__header`;
769
+ const headingClass = `${headerClass}__heading`;
770
+ const actionsClass = `${baseClass$y}__actions`;
771
+ const Card = (_k) => {
772
+ var _l = _k, {
773
+ alt,
774
+ buttonsOptions = [],
775
+ children,
776
+ className,
777
+ description,
778
+ expandableContent,
779
+ src,
780
+ title
781
+ } = _l, divProps = __objRest(_l, [
782
+ "alt",
783
+ "buttonsOptions",
784
+ "children",
785
+ "className",
786
+ "description",
787
+ "expandableContent",
788
+ "src",
789
+ "title"
790
+ ]);
791
+ const [isExpanded, setIsExpanded] = React.useState(false);
792
+ const expandIcon = isExpanded ? ChevronUp : ChevronDown;
793
+ const expandButtonText = isExpanded ? "Hide" : "Show more";
794
+ const shouldShowActionButtons = (buttonsOptions == null ? void 0 : buttonsOptions.length) > 0;
795
+ const shouldShowExpandAction = !!expandableContent;
796
+ const shouldShowActions = shouldShowActionButtons || shouldShowExpandAction;
797
+ return /* @__PURE__ */ React.createElement("div", __spreadValues({
798
+ className: cx(styles$q[baseClass$y], className)
799
+ }, divProps), /* @__PURE__ */ React.createElement("div", {
800
+ className: styles$q[headerClass]
801
+ }, src && /* @__PURE__ */ React.createElement("img", {
802
+ alt,
803
+ className: styles$q[`${headerClass}__image`],
804
+ src
805
+ }), /* @__PURE__ */ React.createElement("div", {
806
+ className: styles$q[headingClass]
807
+ }, /* @__PURE__ */ React.createElement(Heading, {
808
+ size: "sm",
809
+ className: styles$q[`${headingClass}__title`]
810
+ }, title), /* @__PURE__ */ React.createElement(Text, {
811
+ size: "sm",
812
+ className: styles$q[`${headingClass}__description`]
813
+ }, description))), /* @__PURE__ */ React.createElement(Text, {
814
+ as: "div",
815
+ size: "md",
816
+ className: styles$q[`${baseClass$y}__content`]
817
+ }, children), isExpanded && /* @__PURE__ */ React.createElement(Text, {
818
+ as: "div",
819
+ size: "md",
820
+ className: styles$q[`${baseClass$y}__expanded-content`]
821
+ }, expandableContent), shouldShowActions && /* @__PURE__ */ React.createElement("div", {
822
+ className: styles$q[actionsClass]
823
+ }, /* @__PURE__ */ React.createElement("div", {
824
+ className: styles$q[`${actionsClass}__line`]
825
+ }), /* @__PURE__ */ React.createElement("div", {
826
+ className: styles$q[`${actionsClass}__buttons`]
827
+ }, shouldShowActionButtons && buttonsOptions.map(({ kind, onClick, children: buttonChildren }) => /* @__PURE__ */ React.createElement(Button, {
828
+ size: "compact",
829
+ kind,
830
+ onClick
831
+ }, buttonChildren)), shouldShowExpandAction && /* @__PURE__ */ React.createElement(Button, {
832
+ className: styles$q[`${actionsClass}__buttons-expander`],
833
+ kind: "plain",
834
+ iconPosition: "right",
835
+ icon: /* @__PURE__ */ React.createElement(Icon, {
836
+ source: expandIcon
837
+ }),
838
+ onClick: () => setIsExpanded(!isExpanded)
839
+ }, expandButtonText))));
840
+ };
841
+ var styles$p = {
842
+ "field-description": "lc-FieldDescription-module__field-description___IcRDH"
843
+ };
844
+ const baseClass$x = "field-description";
845
+ const FieldDescription = (_m) => {
846
+ var _n = _m, {
847
+ children,
848
+ className = ""
849
+ } = _n, props = __objRest(_n, [
850
+ "children",
851
+ "className"
852
+ ]);
853
+ const mergedClassNames = cx(styles$p[baseClass$x], className);
854
+ return /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({
855
+ as: "span",
856
+ size: "sm"
857
+ }, props), {
858
+ className: mergedClassNames
859
+ }), children);
860
+ };
861
+ const checkbox = "lc-Checkbox-module__checkbox___G7nTf";
862
+ const checkbox__label = "lc-Checkbox-module__checkbox__label___-o01x";
863
+ const checkbox__square = "lc-Checkbox-module__checkbox__square___MHUyd";
864
+ const checkbox__checkmark = "lc-Checkbox-module__checkbox__checkmark___16pfY";
865
+ const checkbox__input = "lc-Checkbox-module__checkbox__input___YLbVF";
866
+ const checkbox__text = "lc-Checkbox-module__checkbox__text___P2SIq";
867
+ const checkbox__helper = "lc-Checkbox-module__checkbox__helper___YSJ-n";
868
+ var styles$o = {
869
+ checkbox,
870
+ checkbox__label,
871
+ checkbox__square,
872
+ checkbox__checkmark,
873
+ "checkbox--selected": "lc-Checkbox-module__checkbox--selected___S2vqY",
874
+ checkbox__input,
875
+ checkbox__text,
876
+ "checkbox--disabled": "lc-Checkbox-module__checkbox--disabled___-lAqW",
877
+ checkbox__helper
878
+ };
879
+ const baseClass$w = "checkbox";
880
+ const Checkbox = React.forwardRef((_o, ref) => {
881
+ var _p = _o, { checked, disabled, children, description, className } = _p, restInputProps = __objRest(_p, ["checked", "disabled", "children", "description", "className"]);
882
+ return /* @__PURE__ */ React.createElement("div", {
883
+ className: cx(styles$o[baseClass$w], className, {
884
+ [styles$o[`${baseClass$w}--selected`]]: checked,
885
+ [styles$o[`${baseClass$w}--disabled`]]: disabled
886
+ })
887
+ }, /* @__PURE__ */ React.createElement("label", {
888
+ className: styles$o[`${baseClass$w}__label`]
889
+ }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues({}, restInputProps), {
890
+ ref,
891
+ checked,
892
+ disabled,
893
+ className: styles$o[`${baseClass$w}__input`],
894
+ type: "checkbox"
895
+ })), /* @__PURE__ */ React.createElement("div", {
896
+ className: styles$o[`${baseClass$w}__square`]
897
+ }, /* @__PURE__ */ React.createElement(Icon, {
898
+ source: Check,
899
+ kind: "inverted",
900
+ size: "xsmall",
901
+ className: styles$o[`${baseClass$w}__checkmark`]
902
+ }))), children && /* @__PURE__ */ React.createElement(Text, {
903
+ as: "div",
904
+ size: "md",
905
+ className: styles$o[`${baseClass$w}__text`]
906
+ }, children)), description && /* @__PURE__ */ React.createElement(FieldDescription, {
907
+ className: styles$o[`${baseClass$w}__helper`]
908
+ }, description));
909
+ });
910
+ var styles$n = {
911
+ "field-error": "lc-FieldError-module__field-error___IDkPT"
912
+ };
913
+ const baseClass$v = "field-error";
914
+ const FieldError = (_q) => {
915
+ var _r = _q, {
916
+ children,
917
+ className = ""
918
+ } = _r, props = __objRest(_r, [
919
+ "children",
920
+ "className"
921
+ ]);
922
+ const mergedClassNames = cx(styles$n[baseClass$v], className);
923
+ return /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({
924
+ as: "span",
925
+ size: "sm"
926
+ }, props), {
927
+ className: mergedClassNames
928
+ }), children);
929
+ };
930
+ var styles$m = {
931
+ "field-group": "lc-FieldGroup-module__field-group___gy8lp",
932
+ "field-group--inline": "lc-FieldGroup-module__field-group--inline___or4qf",
933
+ "field-group--stretched": "lc-FieldGroup-module__field-group--stretched___6rkuO"
934
+ };
935
+ const baseClass$u = "field-group";
936
+ const FieldGroup = (_s) => {
937
+ var _t = _s, {
938
+ className = "",
939
+ children,
940
+ description,
941
+ error,
942
+ inline,
943
+ stretch
944
+ } = _t, props = __objRest(_t, [
945
+ "className",
946
+ "children",
947
+ "description",
948
+ "error",
949
+ "inline",
950
+ "stretch"
951
+ ]);
952
+ const mergedClassNames = cx(styles$m[baseClass$u], className, {
953
+ [styles$m[`${baseClass$u}--inline`]]: inline,
954
+ [styles$m[`${baseClass$u}--stretched`]]: stretch
955
+ });
956
+ return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({}, props), {
957
+ className: mergedClassNames
958
+ }), children, error && /* @__PURE__ */ React.createElement(FieldError, null, error), description && /* @__PURE__ */ React.createElement(FieldDescription, null, description));
959
+ };
960
+ const form = "lc-Form-module__form___1nOYF";
961
+ const form__header = "lc-Form-module__form__header___U4B7t";
962
+ const form__footer = "lc-Form-module__form__footer___1-sUX";
963
+ const form__label = "lc-Form-module__form__label___spg-J";
964
+ const form__helper = "lc-Form-module__form__helper___bhfwS";
965
+ var styles$l = {
966
+ form,
967
+ form__header,
968
+ form__footer,
969
+ form__label,
970
+ form__helper
971
+ };
972
+ const baseClass$t = "form";
973
+ const Form = (_u) => {
974
+ var _v = _u, {
975
+ className,
976
+ children,
977
+ labelText,
978
+ helperText,
979
+ formFooter
980
+ } = _v, restProps = __objRest(_v, [
981
+ "className",
982
+ "children",
983
+ "labelText",
984
+ "helperText",
985
+ "formFooter"
986
+ ]);
987
+ return /* @__PURE__ */ React.createElement("form", __spreadValues({
988
+ className: cx(styles$l[baseClass$t], className)
989
+ }, restProps), (labelText || helperText) && /* @__PURE__ */ React.createElement("div", {
990
+ className: styles$l[`${baseClass$t}__header`]
991
+ }, labelText && /* @__PURE__ */ React.createElement(Heading, {
992
+ size: "sm",
993
+ className: styles$l[`${baseClass$t}__label`]
994
+ }, labelText), helperText && /* @__PURE__ */ React.createElement(Text, {
995
+ as: "p",
996
+ size: "sm",
997
+ className: styles$l[`${baseClass$t}__helper`]
998
+ }, helperText)), children, formFooter && /* @__PURE__ */ React.createElement("div", {
999
+ className: styles$l[`${baseClass$t}__footer`]
1000
+ }, formFooter));
1001
+ };
1002
+ var styles$k = {
1003
+ "form-field": "lc-FormField-module__form-field___JqnX6",
1004
+ "form-field--inline": "lc-FormField-module__form-field--inline___4DgIq",
1005
+ "form-field__wrapper--inline": "lc-FormField-module__form-field__wrapper--inline___Ubvrn",
1006
+ "form-field__label": "lc-FormField-module__form-field__label___hNCFS",
1007
+ "form-field__label--inline": "lc-FormField-module__form-field__label--inline___QxyM6",
1008
+ "form-field__label--no-text": "lc-FormField-module__form-field__label--no-text___Ohs-I",
1009
+ "form-field__label-wrapper": "lc-FormField-module__form-field__label-wrapper___61-NO",
1010
+ "form-field__label-adornment": "lc-FormField-module__form-field__label-adornment___HB0z7",
1011
+ "form-field__label-left-node": "lc-FormField-module__form-field__label-left-node___dvipB",
1012
+ "form-field__label-right-node": "lc-FormField-module__form-field__label-right-node___LR-03",
1013
+ "form-field__label-right-node--inline": "lc-FormField-module__form-field__label-right-node--inline___BkiPG",
1014
+ "form-field__row-break": "lc-FormField-module__form-field__row-break___DCBjC",
1015
+ "form-field__content": "lc-FormField-module__form-field__content___XaOx3"
1016
+ };
1017
+ const baseClass$s = "form-field";
1018
+ const FormField = ({
1019
+ inline,
1020
+ error,
1021
+ description,
1022
+ labelText,
1023
+ labelAdornment,
1024
+ className,
1025
+ labelFor,
1026
+ children,
1027
+ labelRightNode
1028
+ }) => {
1029
+ const mergedClassNames = cx(styles$k[baseClass$s], {
1030
+ [styles$k[`${baseClass$s}--inline`]]: inline
1031
+ }, className);
1032
+ return /* @__PURE__ */ React.createElement("div", {
1033
+ className: mergedClassNames
1034
+ }, labelRightNode && inline && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
1035
+ className: cx(styles$k[`${baseClass$s}__label-right-node`], styles$k[`${baseClass$s}__label-right-node--inline`])
1036
+ }, labelRightNode), /* @__PURE__ */ React.createElement("div", {
1037
+ className: styles$k[`${baseClass$s}__row-break`]
1038
+ })), /* @__PURE__ */ React.createElement("div", {
1039
+ className: cx(styles$k[`${baseClass$s}__wrapper`], inline && styles$k[`${baseClass$s}__wrapper--inline`])
1040
+ }, (labelText || labelRightNode) && /* @__PURE__ */ React.createElement("div", {
1041
+ className: cx(styles$k[`${baseClass$s}__label`], inline && styles$k[`${baseClass$s}__label--inline`], !labelText && styles$k[`${baseClass$s}__label--no-text`])
1042
+ }, labelText && /* @__PURE__ */ React.createElement("div", {
1043
+ className: cx(styles$k[`${baseClass$s}__label-wrapper`])
1044
+ }, /* @__PURE__ */ React.createElement("label", {
1045
+ className: styles$k[`${baseClass$s}__label-left-node`],
1046
+ htmlFor: labelFor
1047
+ }, /* @__PURE__ */ React.createElement(Text, {
1048
+ as: "span",
1049
+ size: "sm"
1050
+ }, labelText)), labelAdornment && /* @__PURE__ */ React.createElement("div", {
1051
+ className: cx(styles$k[`${baseClass$s}__label-adornment`])
1052
+ }, labelAdornment)), labelRightNode && !inline && /* @__PURE__ */ React.createElement("div", {
1053
+ className: cx(styles$k[`${baseClass$s}__label-right-node`])
1054
+ }, labelRightNode)), /* @__PURE__ */ React.createElement("div", {
1055
+ className: cx(styles$k[`${baseClass$s}__content`])
1056
+ }, children, error && /* @__PURE__ */ React.createElement(FieldError, null, error), description && /* @__PURE__ */ React.createElement(FieldDescription, null, description))));
1057
+ };
1058
+ var styles$j = {
1059
+ "form-group": "lc-FormGroup-module__form-group___e2JHa",
1060
+ "form-group__header": "lc-FormGroup-module__form-group__header___DgGmR",
1061
+ "form-group__label": "lc-FormGroup-module__form-group__label___NC-JW",
1062
+ "form-group__helper": "lc-FormGroup-module__form-group__helper___SRuxe"
1063
+ };
1064
+ const baseClass$r = "form-group";
1065
+ const FormGroup = (_w) => {
1066
+ var _x = _w, {
1067
+ className = "",
1068
+ children,
1069
+ labelText,
1070
+ helperText
1071
+ } = _x, props = __objRest(_x, [
1072
+ "className",
1073
+ "children",
1074
+ "labelText",
1075
+ "helperText"
1076
+ ]);
1077
+ const mergedClassNames = cx(styles$j[baseClass$r], className);
1078
+ return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
1079
+ role: "group"
1080
+ }), labelText && { "aria-label": labelText }), {
1081
+ className: mergedClassNames
1082
+ }), /* @__PURE__ */ React.createElement("div", {
1083
+ className: styles$j[`${baseClass$r}__header`]
1084
+ }, /* @__PURE__ */ React.createElement(Heading, {
1085
+ as: "div",
1086
+ size: "sm",
1087
+ className: styles$j[`${baseClass$r}__label`]
1088
+ }, labelText), helperText && /* @__PURE__ */ React.createElement(Text, {
1089
+ as: "div",
1090
+ size: "sm",
1091
+ className: styles$j[`${baseClass$r}__helper`]
1092
+ }, helperText)), children);
1093
+ };
1094
+ const input = "lc-Input-module__input___qeMAQ";
1095
+ var styles$i = {
1096
+ input,
1097
+ "input--error": "lc-Input-module__input--error___DlDbC",
1098
+ "input--xsmall": "lc-Input-module__input--xsmall___9u99K",
1099
+ "input--small": "lc-Input-module__input--small___elNtF",
1100
+ "input--medium": "lc-Input-module__input--medium___3BjqQ",
1101
+ "input--large": "lc-Input-module__input--large___jX5RW"
1102
+ };
1103
+ const baseClass$q = "input";
1104
+ const Input = React.forwardRef((_y, ref) => {
1105
+ var _z = _y, { size = "medium", error = false, className } = _z, inputProps = __objRest(_z, ["size", "error", "className"]);
1106
+ return /* @__PURE__ */ React.createElement("input", __spreadValues({
1107
+ className: cx(className, styles$i[baseClass$q], styles$i[`${baseClass$q}--${size}`], {
1108
+ [styles$i[`${baseClass$q}--error`]]: error
1109
+ }),
1110
+ type: "text",
1111
+ ref
1112
+ }, inputProps));
1113
+ });
1114
+ const link = "lc-Link-module__link___kqx52";
1115
+ var styles$h = {
1116
+ link,
1117
+ "link--bold": "lc-Link-module__link--bold___1rGdO"
1118
+ };
1119
+ const baseClass$p = "link";
1120
+ const Link = (_A) => {
1121
+ var _B = _A, {
1122
+ bold = false,
1123
+ className = ""
1124
+ } = _B, rest = __objRest(_B, [
1125
+ "bold",
1126
+ "className"
1127
+ ]);
1128
+ return /* @__PURE__ */ React.createElement("a", __spreadValues({
1129
+ className: cx(styles$h[baseClass$p], bold && styles$h[`${baseClass$p}--bold`], className)
1130
+ }, rest));
1131
+ };
1132
+ const modal__header = "lc-Modal-module__modal__header___Fp5VE";
1133
+ const modal__heading = "lc-Modal-module__modal__heading___G9KVK";
1134
+ const modal__body = "lc-Modal-module__modal__body___M-jmN";
1135
+ const modal__footer = "lc-Modal-module__modal__footer___2LYdc";
1136
+ var styles$g = {
1137
+ "modal-base": "lc-Modal-module__modal-base___hbL1U",
1138
+ "modal-base__overlay": "lc-Modal-module__modal-base__overlay___kCQ8t",
1139
+ "modal-base__overlay--visible": "lc-Modal-module__modal-base__overlay--visible___zUNJL",
1140
+ "modal-base__close": "lc-Modal-module__modal-base__close___gJlgr",
1141
+ modal__header,
1142
+ modal__heading,
1143
+ modal__body,
1144
+ modal__footer,
1145
+ "action-modal": "lc-Modal-module__action-modal___CsRC7",
1146
+ "action-modal__heading": "lc-Modal-module__action-modal__heading___m3MuG",
1147
+ "action-modal__content": "lc-Modal-module__action-modal__content___gf-R2",
1148
+ "action-modal__actions": "lc-Modal-module__action-modal__actions___kpRXD",
1149
+ "action-modal__icon": "lc-Modal-module__action-modal__icon___MK5xt"
1150
+ };
1151
+ const ModalCloseButton = ({
1152
+ onClick
1153
+ }) => /* @__PURE__ */ React.createElement("button", {
1154
+ title: "Close modal",
1155
+ className: styles$g["modal-base__close"],
1156
+ onClick,
1157
+ type: "button"
1158
+ }, /* @__PURE__ */ React.createElement(Icon, {
1159
+ source: Close,
1160
+ size: "large"
1161
+ }));
1162
+ const KeyCodes = {
1163
+ esc: "Escape",
1164
+ enter: "Enter",
1165
+ backspace: "Backspace",
1166
+ delete: "Delete",
1167
+ spacebar: " ",
1168
+ tab: "Tab",
1169
+ semicolon: ";",
1170
+ comma: ",",
1171
+ arrowUp: "ArrowUp",
1172
+ arrowDown: "ArrowDown"
1173
+ };
1174
+ const baseClass$o = "modal-base";
1175
+ const ModalBase = (_C) => {
1176
+ var _D = _C, {
1177
+ children,
1178
+ className = "",
1179
+ onClose,
1180
+ closeOnEscPress = true
1181
+ } = _D, props = __objRest(_D, [
1182
+ "children",
1183
+ "className",
1184
+ "onClose",
1185
+ "closeOnEscPress"
1186
+ ]);
1187
+ const mergedClassNames = cx(styles$g[baseClass$o], className);
1188
+ React.useEffect(() => {
1189
+ if (!closeOnEscPress) {
1190
+ return;
1191
+ }
1192
+ const onKeyUp = (event) => {
1193
+ if (event.key === KeyCodes.esc) {
1194
+ onClose();
1195
+ }
1196
+ };
1197
+ document.addEventListener("keyup", onKeyUp, true);
1198
+ return () => document.removeEventListener("keyup", onKeyUp, true);
1199
+ }, [closeOnEscPress]);
1200
+ const onOverlayClick = (event) => {
1201
+ if (event.target === event.currentTarget) {
1202
+ onClose();
1203
+ }
1204
+ };
1205
+ const onCloseButtonClick = (event) => {
1206
+ event.preventDefault();
1207
+ event.stopPropagation();
1208
+ onClose();
1209
+ };
1210
+ return /* @__PURE__ */ React.createElement("div", {
1211
+ "data-testid": "lc-modal-overlay",
1212
+ onMouseDown: onOverlayClick,
1213
+ className: cx(styles$g[`${baseClass$o}__overlay`], styles$g[`${baseClass$o}__overlay--visible`])
1214
+ }, /* @__PURE__ */ React.createElement("div", __spreadValues({
1215
+ className: mergedClassNames
1216
+ }, props), /* @__PURE__ */ React.createElement(ModalCloseButton, {
1217
+ onClick: onCloseButtonClick
1218
+ }), children));
1219
+ };
1220
+ const baseClass$n = "action-modal";
1221
+ const ActionModal = (_E) => {
1222
+ var _F = _E, {
1223
+ children,
1224
+ className = "",
1225
+ icon: icon2,
1226
+ heading,
1227
+ actions
1228
+ } = _F, props = __objRest(_F, [
1229
+ "children",
1230
+ "className",
1231
+ "icon",
1232
+ "heading",
1233
+ "actions"
1234
+ ]);
1235
+ const mergedClassNames = cx(styles$g[baseClass$n], className);
1236
+ return /* @__PURE__ */ React.createElement(ModalBase, __spreadValues({
1237
+ className: mergedClassNames
1238
+ }, props), icon2 && /* @__PURE__ */ React.createElement("div", {
1239
+ className: styles$g[`${baseClass$n}__icon`]
1240
+ }, icon2), heading && /* @__PURE__ */ React.createElement("div", {
1241
+ className: styles$g[`${baseClass$n}__heading`]
1242
+ }, heading), /* @__PURE__ */ React.createElement("div", {
1243
+ className: styles$g[`${baseClass$n}__content`]
1244
+ }, children), actions && /* @__PURE__ */ React.createElement("div", {
1245
+ className: styles$g[`${baseClass$n}__actions`]
1246
+ }, actions));
1247
+ };
1248
+ const baseClass$m = "modal";
1249
+ const Modal = (_G) => {
1250
+ var _H = _G, {
1251
+ children,
1252
+ className = "",
1253
+ heading,
1254
+ footer
1255
+ } = _H, props = __objRest(_H, [
1256
+ "children",
1257
+ "className",
1258
+ "heading",
1259
+ "footer"
1260
+ ]);
1261
+ const mergedClassNames = cx(styles$g[baseClass$m], className);
1262
+ return /* @__PURE__ */ React.createElement(ModalBase, __spreadValues({
1263
+ className: mergedClassNames
1264
+ }, props), heading && /* @__PURE__ */ React.createElement("div", {
1265
+ className: styles$g[`${baseClass$m}__header`]
1266
+ }, /* @__PURE__ */ React.createElement(Heading, {
1267
+ size: "sm",
1268
+ as: "div",
1269
+ className: styles$g[`${baseClass$m}__heading`]
1270
+ }, heading)), /* @__PURE__ */ React.createElement("div", {
1271
+ className: styles$g[`${baseClass$m}__body`]
1272
+ }, children), footer && /* @__PURE__ */ React.createElement("div", {
1273
+ className: styles$g[`${baseClass$m}__footer`]
1274
+ }, footer));
1275
+ };
1276
+ const ModalPortal = ({
1277
+ children,
1278
+ className = "",
1279
+ parentElementName = "body",
1280
+ zIndex
1281
+ }) => {
1282
+ const [container] = React.useState(() => document.createElement("div"));
1283
+ if (className) {
1284
+ container.classList.add(className);
1285
+ }
1286
+ if (zIndex) {
1287
+ container.style.zIndex = zIndex.toString();
1288
+ }
1289
+ React.useEffect(() => {
1290
+ var _a;
1291
+ (_a = document.querySelector(parentElementName)) == null ? void 0 : _a.appendChild(container);
1292
+ return () => {
1293
+ var _a2;
1294
+ (_a2 = document.querySelector(parentElementName)) == null ? void 0 : _a2.removeChild(container);
1295
+ };
1296
+ }, [parentElementName]);
1297
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, ReactDOM.createPortal(children, container));
1298
+ };
1299
+ var styles$f = {
1300
+ "numeric-input": "lc-NumericInput-module__numeric-input___j1esc",
1301
+ "numeric-input__increment": "lc-NumericInput-module__numeric-input__increment___i3Tys",
1302
+ "numeric-input__decrement": "lc-NumericInput-module__numeric-input__decrement___3qgn0",
1303
+ "numeric-input--disabled": "lc-NumericInput-module__numeric-input--disabled___yaRvQ",
1304
+ "numeric-input--no-controls": "lc-NumericInput-module__numeric-input--no-controls___D90rG",
1305
+ "numeric-input--error": "lc-NumericInput-module__numeric-input--error___TMxRx"
1306
+ };
1307
+ const baseClass$l = "numeric-input";
1308
+ const NumericInput = (_I) => {
1309
+ var _J = _I, {
1310
+ className,
1311
+ error,
1312
+ value,
1313
+ max,
1314
+ min,
1315
+ disabled,
1316
+ noControls,
1317
+ style,
1318
+ onChange
1319
+ } = _J, restProps = __objRest(_J, [
1320
+ "className",
1321
+ "error",
1322
+ "value",
1323
+ "max",
1324
+ "min",
1325
+ "disabled",
1326
+ "noControls",
1327
+ "style",
1328
+ "onChange"
1329
+ ]);
1330
+ const inputRef = React.useRef(null);
1331
+ const mergedClassNames = cx(styles$f[baseClass$l], {
1332
+ [styles$f[`${baseClass$l}--error`]]: error,
1333
+ [styles$f[`${baseClass$l}--no-controls`]]: noControls,
1334
+ [styles$f[`${baseClass$l}--disabled`]]: disabled
1335
+ }, className);
1336
+ const callOnChange = (val) => onChange(String(val));
1337
+ const calcValue = (val) => {
1338
+ if (max !== void 0 && val > max) {
1339
+ return max;
1340
+ }
1341
+ if (min !== void 0 && val < min) {
1342
+ return min;
1343
+ }
1344
+ return val;
1345
+ };
1346
+ const updateValue = (val) => {
1347
+ const newValue = parseInt(value, 10) + val;
1348
+ return callOnChange(calcValue(newValue));
1349
+ };
1350
+ const onKeyDown = (e) => {
1351
+ if (e.key === KeyCodes.arrowDown) {
1352
+ e.preventDefault();
1353
+ updateValue(-1);
1354
+ }
1355
+ if (e.key === KeyCodes.arrowUp) {
1356
+ e.preventDefault();
1357
+ updateValue(1);
1358
+ }
1359
+ };
1360
+ const hasReachedTheLimit = (value2, margin) => margin !== void 0 && parseInt(value2, 10) === margin;
1361
+ const handleOnChange = (e) => {
1362
+ e.preventDefault();
1363
+ e.stopPropagation();
1364
+ const inputVal = e.currentTarget.value.replace(/((?!([-]|([-]?\d+))).)/, "");
1365
+ if (inputVal === "" || inputVal === "-") {
1366
+ return callOnChange(inputVal);
1367
+ }
1368
+ const newValue = parseInt(inputVal, 10);
1369
+ return callOnChange(calcValue(newValue));
1370
+ };
1371
+ const handleIncrementClick = () => {
1372
+ var _a;
1373
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
1374
+ return updateValue(1);
1375
+ };
1376
+ const handleDecrementClick = () => {
1377
+ var _a;
1378
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
1379
+ return updateValue(-1);
1380
+ };
1381
+ return /* @__PURE__ */ React.createElement("div", {
1382
+ className: mergedClassNames,
1383
+ style
1384
+ }, /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues({
1385
+ type: "text",
1386
+ ref: inputRef
1387
+ }, restProps), {
1388
+ value,
1389
+ disabled,
1390
+ onChange: handleOnChange,
1391
+ onKeyDown,
1392
+ min,
1393
+ max
1394
+ })), !noControls && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("button", {
1395
+ tabIndex: -1,
1396
+ disabled: disabled || hasReachedTheLimit(value, max),
1397
+ onClick: handleIncrementClick,
1398
+ "aria-label": "Increment value",
1399
+ className: styles$f[`${baseClass$l}__increment`],
1400
+ type: "button"
1401
+ }, /* @__PURE__ */ React.createElement(Icon, {
1402
+ source: ChevronUp,
1403
+ disabled: disabled || hasReachedTheLimit(value, max),
1404
+ kind: "primary"
1405
+ })), /* @__PURE__ */ React.createElement("button", {
1406
+ tabIndex: -1,
1407
+ disabled: disabled || hasReachedTheLimit(value, min),
1408
+ "aria-label": "Decrement value",
1409
+ className: styles$f[`${baseClass$l}__decrement`],
1410
+ onClick: handleDecrementClick,
1411
+ type: "button"
1412
+ }, /* @__PURE__ */ React.createElement(Icon, {
1413
+ source: ChevronDown,
1414
+ kind: "primary",
1415
+ disabled: disabled || hasReachedTheLimit(value, min)
1416
+ }))));
1417
+ };
1418
+ var styles$e = {
1419
+ "picker-trigger": "lc-Trigger-module__picker-trigger___BIvTx",
1420
+ "picker-trigger--compact": "lc-Trigger-module__picker-trigger--compact___3i1DL",
1421
+ "picker-trigger--medium": "lc-Trigger-module__picker-trigger--medium___-fbEx",
1422
+ "picker-trigger--large": "lc-Trigger-module__picker-trigger--large___C8qkZ",
1423
+ "picker-trigger__text": "lc-Trigger-module__picker-trigger__text___9cWZO",
1424
+ "picker-trigger--disabled": "lc-Trigger-module__picker-trigger--disabled___7H4tD",
1425
+ "picker-trigger--focused": "lc-Trigger-module__picker-trigger--focused___vTr39",
1426
+ "picker-trigger--error": "lc-Trigger-module__picker-trigger--error___Rh8Qd",
1427
+ "picker-trigger__input": "lc-Trigger-module__picker-trigger__input___GGc12"
1428
+ };
1429
+ const baseClass$k = "picker-trigger";
1430
+ const Trigger = ({
1431
+ children,
1432
+ isSearchDisabled,
1433
+ isDisabled,
1434
+ isError,
1435
+ isItemSelected,
1436
+ isOpen,
1437
+ isRequired,
1438
+ size = "medium",
1439
+ onClick,
1440
+ onClearClick,
1441
+ onFilter
1442
+ }) => {
1443
+ const triggerRef = React.useRef(null);
1444
+ const mergedClassNames = cx(styles$e[baseClass$k], styles$e[`${baseClass$k}--${size}`], isDisabled && styles$e[`${baseClass$k}--disabled`], isOpen && styles$e[`${baseClass$k}--focused`], isError && styles$e[`${baseClass$k}--error`]);
1445
+ React.useEffect(() => {
1446
+ const onKeyDown = (e) => {
1447
+ const isFocused = document.activeElement === triggerRef.current;
1448
+ if (isFocused && e.key !== KeyCodes.tab) {
1449
+ onClick();
1450
+ }
1451
+ };
1452
+ if (!isSearchDisabled) {
1453
+ document.addEventListener("keydown", onKeyDown);
1454
+ }
1455
+ return () => {
1456
+ if (!isSearchDisabled) {
1457
+ document.removeEventListener("keydown", onKeyDown);
1458
+ }
1459
+ };
1460
+ }, [isSearchDisabled]);
1461
+ const handleTriggerClick = () => {
1462
+ onClick();
1463
+ };
1464
+ const handleOnClearClick = (e) => {
1465
+ e.stopPropagation();
1466
+ onClearClick();
1467
+ };
1468
+ const handleOnChange = (e) => {
1469
+ onFilter(e.target.value);
1470
+ };
1471
+ return /* @__PURE__ */ React.createElement("div", {
1472
+ ref: triggerRef,
1473
+ className: mergedClassNames,
1474
+ onClick: handleTriggerClick,
1475
+ tabIndex: 0
1476
+ }, isOpen && !isSearchDisabled ? /* @__PURE__ */ React.createElement("input", {
1477
+ className: styles$e[`${baseClass$k}__input`],
1478
+ placeholder: "Select option",
1479
+ onChange: handleOnChange,
1480
+ autoFocus: true
1481
+ }) : /* @__PURE__ */ React.createElement("div", {
1482
+ className: styles$e[`${baseClass$k}__text`]
1483
+ }, children), isItemSelected && !isDisabled && !isRequired && /* @__PURE__ */ React.createElement("div", {
1484
+ "data-testid": `${baseClass$k}__clear-icon`,
1485
+ className: styles$e[`${baseClass$k}__clear-icon`],
1486
+ onClick: handleOnClearClick
1487
+ }, /* @__PURE__ */ React.createElement(Icon, {
1488
+ kind: "link",
1489
+ source: Close
1490
+ })), /* @__PURE__ */ React.createElement(Icon, {
1491
+ className: styles$e[`${baseClass$k}__chevron-icon`],
1492
+ source: !isOpen ? ChevronDown : ChevronUp,
1493
+ size: "large",
1494
+ disabled: isDisabled
1495
+ }));
1496
+ };
1497
+ var styles$d = {
1498
+ "picker-list": "lc-PickerList-module__picker-list___FqdgZ",
1499
+ "picker-list--compact": "lc-PickerList-module__picker-list--compact___F-cAF",
1500
+ "picker-list--medium": "lc-PickerList-module__picker-list--medium___9B1DT",
1501
+ "picker-list--large": "lc-PickerList-module__picker-list--large___8-Q-N",
1502
+ "picker-list__no-results": "lc-PickerList-module__picker-list__no-results___tX172",
1503
+ "picker-list__item": "lc-PickerList-module__picker-list__item___8QNS0",
1504
+ "picker-list__item__header": "lc-PickerList-module__picker-list__item__header___mxmg0"
1505
+ };
1506
+ const baseClass$j = "picker-list";
1507
+ const itemClassName = `${baseClass$j}__item`;
1508
+ const PickerList = ({
1509
+ isOpen,
1510
+ items,
1511
+ selectedItem,
1512
+ size = "medium",
1513
+ emptyStateText = "No results found",
1514
+ onClose,
1515
+ onSelect
1516
+ }) => {
1517
+ const mergedClassNames = cx(styles$d[baseClass$j], styles$d[`${baseClass$j}--${size}`], {
1518
+ [styles$d[`${baseClass$j}__no-results`]]: items.length === 0
1519
+ });
1520
+ const [currentItemKey, setCurrentItemKey] = React.useState(null);
1521
+ const indexRef = React.useRef(-1);
1522
+ const lastIndexRef = React.useRef(0);
1523
+ const listRef = React.useRef(null);
1524
+ React.useEffect(() => {
1525
+ if (indexRef.current > -1 && items.length > 0) {
1526
+ setCurrentItemKey(items[indexRef.current].key);
1527
+ }
1528
+ if (isOpen) {
1529
+ document.addEventListener("keydown", onKeyDown);
1530
+ return () => document.removeEventListener("keydown", onKeyDown);
1531
+ } else {
1532
+ indexRef.current = -1;
1533
+ lastIndexRef.current = 0;
1534
+ setCurrentItemKey(null);
1535
+ }
1536
+ }, [items, isOpen]);
1537
+ const isHeaderOrDisabled = (i) => !!items[i] && (items[i].disabled || items[i].groupHeader);
1538
+ const getPrevItemIndex = () => {
1539
+ indexRef.current = indexRef.current - 1;
1540
+ while (isHeaderOrDisabled(indexRef.current)) {
1541
+ indexRef.current = indexRef.current - 1;
1542
+ if (!isHeaderOrDisabled(indexRef.current)) {
1543
+ break;
1544
+ }
1545
+ }
1546
+ lastIndexRef.current = indexRef.current;
1547
+ return indexRef.current;
1548
+ };
1549
+ const getNextItemIndex = () => {
1550
+ indexRef.current = indexRef.current + 1;
1551
+ if (!isHeaderOrDisabled(indexRef.current)) {
1552
+ lastIndexRef.current = indexRef.current;
1553
+ return indexRef.current;
1554
+ }
1555
+ while (isHeaderOrDisabled(indexRef.current)) {
1556
+ indexRef.current = indexRef.current + 1;
1557
+ if (indexRef.current === items.length && !isHeaderOrDisabled(indexRef.current)) {
1558
+ return lastIndexRef.current;
1559
+ }
1560
+ if (!isHeaderOrDisabled(indexRef.current)) {
1561
+ break;
1562
+ }
1563
+ }
1564
+ lastIndexRef.current = indexRef.current;
1565
+ return indexRef.current;
1566
+ };
1567
+ const onKeyDown = (e) => {
1568
+ if (e.key === KeyCodes.esc) {
1569
+ e.preventDefault();
1570
+ onClose();
1571
+ }
1572
+ if (e.key === KeyCodes.arrowUp && indexRef.current > 0) {
1573
+ e.preventDefault();
1574
+ indexRef.current = getPrevItemIndex();
1575
+ setCurrentItemKey(items[indexRef.current].key);
1576
+ }
1577
+ if (e.key === KeyCodes.arrowDown && indexRef.current + 1 < items.length) {
1578
+ e.preventDefault();
1579
+ indexRef.current = getNextItemIndex();
1580
+ setCurrentItemKey(items[indexRef.current].key);
1581
+ }
1582
+ if (e.key === KeyCodes.enter && !items[indexRef.current].disabled) {
1583
+ e.preventDefault();
1584
+ onSelect(items[indexRef.current]);
1585
+ }
1586
+ };
1587
+ const handleOnClick = (item) => onSelect(item);
1588
+ const isItemSelected = (key) => !!selectedItem && key === selectedItem.key;
1589
+ if (!isOpen) {
1590
+ return null;
1591
+ }
1592
+ if (items.length === 0) {
1593
+ return /* @__PURE__ */ React.createElement("div", {
1594
+ className: mergedClassNames
1595
+ }, emptyStateText);
1596
+ }
1597
+ return /* @__PURE__ */ React.createElement("ul", {
1598
+ ref: listRef,
1599
+ className: mergedClassNames,
1600
+ role: "listbox",
1601
+ tabIndex: -1
1602
+ }, items.map((item) => {
1603
+ if (item.groupHeader) {
1604
+ return /* @__PURE__ */ React.createElement("li", {
1605
+ role: "option",
1606
+ key: item.key,
1607
+ className: styles$d[`${itemClassName}__header`]
1608
+ }, item.name);
1609
+ }
1610
+ return /* @__PURE__ */ React.createElement("li", {
1611
+ ref: (element) => {
1612
+ if (currentItemKey === item.key) {
1613
+ element == null ? void 0 : element.scrollIntoView({ block: "nearest" });
1614
+ }
1615
+ },
1616
+ role: "option",
1617
+ "aria-current": currentItemKey === item.key,
1618
+ "aria-selected": isItemSelected(item.key),
1619
+ "aria-disabled": item.disabled,
1620
+ id: item.key,
1621
+ key: item.key,
1622
+ className: styles$d[itemClassName],
1623
+ onClick: () => !item.disabled && handleOnClick(item)
1624
+ }, item.name, isItemSelected(item.key) && /* @__PURE__ */ React.createElement(Icon, {
1625
+ kind: "link",
1626
+ source: Check
1627
+ }));
1628
+ }));
1629
+ };
1630
+ const picker = "lc-Picker-module__picker___GRj9W";
1631
+ const picker__container = "lc-Picker-module__picker__container___s0PUc";
1632
+ const picker__label = "lc-Picker-module__picker__label___Ac7Vu";
1633
+ const picker__error = "lc-Picker-module__picker__error___H865k";
1634
+ const picker__error__icon = "lc-Picker-module__picker__error__icon___bbL7r";
1635
+ var styles$c = {
1636
+ picker,
1637
+ picker__container,
1638
+ picker__label,
1639
+ "picker__label--disabled": "lc-Picker-module__picker__label--disabled___Opu7s",
1640
+ picker__error,
1641
+ picker__error__icon
1642
+ };
1643
+ const baseClass$i = "picker";
1644
+ const Picker = ({
1645
+ disabled,
1646
+ error,
1647
+ label,
1648
+ options,
1649
+ selectedOption,
1650
+ size = "medium",
1651
+ placeholder = "Select option",
1652
+ isRequired,
1653
+ noSearchResultText = "No results found",
1654
+ searchDisabled = false,
1655
+ onSelect
1656
+ }) => {
1657
+ const [isListOpen, setIsListOpen] = React.useState(false);
1658
+ const [selectedItem, setSelectedItem] = React.useState(selectedOption || null);
1659
+ const [searchPhrase, setSearchPhrase] = React.useState(null);
1660
+ const triggerRef = React.useRef(null);
1661
+ React.useEffect(() => {
1662
+ if (isListOpen) {
1663
+ const onDocumentClick = (e) => {
1664
+ var _a;
1665
+ if (!((_a = triggerRef.current) == null ? void 0 : _a.contains(e.target))) {
1666
+ setIsListOpen(false);
1667
+ }
1668
+ };
1669
+ const onKeyDown = (e) => {
1670
+ if (e.key === KeyCodes.tab) {
1671
+ setIsListOpen(false);
1672
+ }
1673
+ };
1674
+ document.addEventListener("mousedown", onDocumentClick);
1675
+ document.addEventListener("keydown", onKeyDown);
1676
+ return () => {
1677
+ document.removeEventListener("mousedown", onDocumentClick);
1678
+ document.addEventListener("keydown", onKeyDown);
1679
+ };
1680
+ } else {
1681
+ setSearchPhrase(null);
1682
+ }
1683
+ }, [isListOpen]);
1684
+ const handleOnTriggerClick = () => {
1685
+ if (disabled) {
1686
+ return;
1687
+ }
1688
+ return setIsListOpen((prev) => !prev);
1689
+ };
1690
+ const handleOnClose = () => {
1691
+ setIsListOpen(false);
1692
+ };
1693
+ const handleOnSelect = (item) => {
1694
+ setIsListOpen(false);
1695
+ setSelectedItem(item);
1696
+ onSelect(item);
1697
+ };
1698
+ const handleOnClearClick = () => {
1699
+ setIsListOpen(false);
1700
+ setSelectedItem(null);
1701
+ onSelect(null);
1702
+ };
1703
+ const handleOnFilter = (text) => setSearchPhrase(text);
1704
+ const items = React.useMemo(() => {
1705
+ if (!searchPhrase) {
1706
+ return options;
1707
+ }
1708
+ return options.filter((item) => {
1709
+ if (item.groupHeader) {
1710
+ return false;
1711
+ }
1712
+ const search = searchPhrase.toLowerCase();
1713
+ const itemName = item.name.toLowerCase();
1714
+ return itemName.includes(search);
1715
+ });
1716
+ }, [searchPhrase]);
1717
+ return /* @__PURE__ */ React.createElement("div", {
1718
+ ref: triggerRef,
1719
+ className: styles$c[baseClass$i]
1720
+ }, label && /* @__PURE__ */ React.createElement("div", {
1721
+ className: cx(styles$c[`${baseClass$i}__label`], {
1722
+ [styles$c[`${baseClass$i}__label--disabled`]]: disabled
1723
+ })
1724
+ }, label), /* @__PURE__ */ React.createElement("div", {
1725
+ className: styles$c[`${baseClass$i}__container`]
1726
+ }, /* @__PURE__ */ React.createElement(Trigger, {
1727
+ isSearchDisabled: searchDisabled,
1728
+ isError: !!error,
1729
+ isOpen: isListOpen,
1730
+ isDisabled: disabled,
1731
+ isItemSelected: !!selectedItem,
1732
+ isRequired,
1733
+ size,
1734
+ onClick: handleOnTriggerClick,
1735
+ onClearClick: handleOnClearClick,
1736
+ onFilter: handleOnFilter
1737
+ }, selectedItem ? selectedItem.name : placeholder), /* @__PURE__ */ React.createElement(PickerList, {
1738
+ selectedItem,
1739
+ items,
1740
+ isOpen: isListOpen,
1741
+ size,
1742
+ emptyStateText: noSearchResultText,
1743
+ onClose: handleOnClose,
1744
+ onSelect: handleOnSelect
1745
+ })), error && /* @__PURE__ */ React.createElement("div", {
1746
+ className: styles$c[`${baseClass$i}__error`]
1747
+ }, /* @__PURE__ */ React.createElement(Icon, {
1748
+ className: styles$c[`${baseClass$i}__error__icon`],
1749
+ source: Error2,
1750
+ kind: "error",
1751
+ size: "small"
1752
+ }), error));
1753
+ };
1754
+ const popover = "lc-Popover-module__popover___8X1b2";
1755
+ var cssStyles = {
1756
+ popover,
1757
+ "popover--visible": "lc-Popover-module__popover--visible___u5NXB"
1758
+ };
1759
+ const Popover = (props) => {
1760
+ const {
1761
+ triggerRenderer,
1762
+ children,
1763
+ className,
1764
+ placement,
1765
+ isVisible = false
1766
+ } = props;
1767
+ const [visible, setVisibility] = React.useState(false);
1768
+ const {
1769
+ x,
1770
+ y,
1771
+ reference,
1772
+ floating,
1773
+ strategy,
1774
+ refs,
1775
+ update,
1776
+ placement: updatedPlacement
1777
+ } = useFloating({
1778
+ middleware: [offset(4), flip()],
1779
+ placement
1780
+ });
1781
+ React.useEffect(() => {
1782
+ setVisibility(isVisible);
1783
+ }, [isVisible]);
1784
+ React.useEffect(() => {
1785
+ if (!refs.reference.current || !refs.floating.current) {
1786
+ return;
1787
+ }
1788
+ return autoUpdate(refs.reference.current, refs.floating.current, update);
1789
+ }, [refs.reference, refs.floating, update, updatedPlacement, visible]);
1790
+ function handleDocumentClick(event) {
1791
+ if (refs.floating.current && refs.floating.current.contains(event.target)) {
1792
+ return;
1793
+ } else if (refs.reference.current && refs.reference.current.contains(event.target)) {
1794
+ setVisibility((prevVisible) => !prevVisible);
1795
+ } else {
1796
+ setVisibility(false);
1797
+ }
1798
+ }
1799
+ const handleHideOnEscape = (event) => {
1800
+ if (event.key === "Escape") {
1801
+ setVisibility(false);
1802
+ }
1803
+ };
1804
+ React.useEffect(() => {
1805
+ document.addEventListener("keydown", handleHideOnEscape);
1806
+ document.addEventListener("mousedown", handleDocumentClick);
1807
+ return () => {
1808
+ document.removeEventListener("keydown", handleHideOnEscape);
1809
+ document.removeEventListener("mousedown", handleDocumentClick);
1810
+ };
1811
+ }, []);
1812
+ const mergedClassNames = cx(cssStyles["popover"], className, {
1813
+ [cssStyles["popover--visible"]]: visible
1814
+ });
1815
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
1816
+ style: { width: "fit-content" },
1817
+ ref: reference
1818
+ }, triggerRenderer()), /* @__PURE__ */ React.createElement("div", {
1819
+ ref: floating,
1820
+ className: mergedClassNames,
1821
+ style: {
1822
+ position: strategy,
1823
+ top: y != null ? y : "",
1824
+ left: x != null ? x : ""
1825
+ }
1826
+ }, children));
1827
+ };
1828
+ const PROGRESS_STATUSES = [
1829
+ "normal",
1830
+ "error",
1831
+ "success"
1832
+ ];
1833
+ const clampPercentage = (percent) => Math.min(Math.max(percent, 0), 100);
1834
+ function getPercentNumber(status, percent = 0) {
1835
+ if (status === "error") {
1836
+ return 0;
1837
+ }
1838
+ return clampPercentage(parseInt(percent.toString(), 10));
1839
+ }
1840
+ function getProgressStatus(status, percent) {
1841
+ if (!PROGRESS_STATUSES.includes(status) && percent >= 100) {
1842
+ return "normal";
1843
+ }
1844
+ return status || "normal";
1845
+ }
1846
+ var styles$b = {
1847
+ "progress-circle": "lc-ProgressCircle-module__progress-circle___NRHCi",
1848
+ "progress-circle--small": "lc-ProgressCircle-module__progress-circle--small___8FVwG",
1849
+ "progress-circle--medium": "lc-ProgressCircle-module__progress-circle--medium___XlzEX",
1850
+ "progress-circle--large": "lc-ProgressCircle-module__progress-circle--large___qxa2y",
1851
+ "progress-circle__bg-line--normal": "lc-ProgressCircle-module__progress-circle__bg-line--normal___nDNwj",
1852
+ "progress-circle__bg-line--success": "lc-ProgressCircle-module__progress-circle__bg-line--success___1aP-O",
1853
+ "progress-circle__bg-line--error": "lc-ProgressCircle-module__progress-circle__bg-line--error___oqMZL",
1854
+ "progress-circle__indicator--normal": "lc-ProgressCircle-module__progress-circle__indicator--normal___0SdkX",
1855
+ "progress-circle__indicator--success": "lc-ProgressCircle-module__progress-circle__indicator--success___fLwRR",
1856
+ "progress-circle__indicator--error": "lc-ProgressCircle-module__progress-circle__indicator--error___nwJS9",
1857
+ "progress-circle--error": "lc-ProgressCircle-module__progress-circle--error___2AA9K",
1858
+ "progress-circle__bg-line": "lc-ProgressCircle-module__progress-circle__bg-line___12YrE",
1859
+ "progress-circle--success": "lc-ProgressCircle-module__progress-circle--success___hH5jv",
1860
+ "progress-circle--normal": "lc-ProgressCircle-module__progress-circle--normal___dFneQ"
1861
+ };
1862
+ const THICKNESS_FROM_SIZE = {
1863
+ small: 2,
1864
+ medium: 3,
1865
+ large: 4
1866
+ };
1867
+ const SIZE_VALUE_FROM_SIZE = {
1868
+ small: 15,
1869
+ medium: 36,
1870
+ large: 56
1871
+ };
1872
+ const baseClass$h = "progress-circle";
1873
+ const ProgressCircle = React.forwardRef((_K, ref) => {
1874
+ var _L = _K, {
1875
+ status = "normal",
1876
+ progressValue,
1877
+ className,
1878
+ size = "medium"
1879
+ } = _L, restProps = __objRest(_L, [
1880
+ "status",
1881
+ "progressValue",
1882
+ "className",
1883
+ "size"
1884
+ ]);
1885
+ const progressStatus = getProgressStatus(status, progressValue);
1886
+ const percentNumber = getPercentNumber(progressStatus, progressValue);
1887
+ const thickness = THICKNESS_FROM_SIZE[size];
1888
+ const sizeValue = SIZE_VALUE_FROM_SIZE[size];
1889
+ const mergedClassNames = cx(styles$b[baseClass$h], {
1890
+ [styles$b[`${baseClass$h}--${size}`]]: size,
1891
+ [styles$b[`${baseClass$h}--${status}`]]: status
1892
+ }, className);
1893
+ const circumference = 2 * Math.PI * ((sizeValue - thickness) / 2);
1894
+ const indicatorStyle = {
1895
+ strokeDasharray: circumference.toFixed(3),
1896
+ strokeDashoffset: `${((100 - percentNumber) / 100 * circumference).toFixed(3)}px`
1897
+ };
1898
+ const svgViewBox = `${sizeValue / 2} ${sizeValue / 2} ${sizeValue} ${sizeValue}`;
1899
+ return /* @__PURE__ */ React.createElement("div", __spreadValues({
1900
+ className: mergedClassNames,
1901
+ ref,
1902
+ role: "progressbar"
1903
+ }, restProps), /* @__PURE__ */ React.createElement("svg", {
1904
+ viewBox: svgViewBox
1905
+ }, /* @__PURE__ */ React.createElement("circle", {
1906
+ className: styles$b[`${baseClass$h}__bg-line--${status}`],
1907
+ cx: sizeValue,
1908
+ cy: sizeValue,
1909
+ r: (sizeValue - thickness) / 2,
1910
+ fill: "none",
1911
+ strokeWidth: thickness
1912
+ }), /* @__PURE__ */ React.createElement("circle", {
1913
+ className: styles$b[`${baseClass$h}__indicator--${status}`],
1914
+ style: indicatorStyle,
1915
+ cx: sizeValue,
1916
+ cy: sizeValue,
1917
+ r: (sizeValue - thickness) / 2,
1918
+ fill: "none",
1919
+ strokeWidth: thickness
1920
+ })));
1921
+ });
1922
+ var styles$a = {
1923
+ "progress-bar": "lc-ProgressBar-module__progress-bar___3pa3d",
1924
+ "progress-bar--small": "lc-ProgressBar-module__progress-bar--small___7nQKx",
1925
+ "progress-bar--medium": "lc-ProgressBar-module__progress-bar--medium___cM44p",
1926
+ "progress-bar--large": "lc-ProgressBar-module__progress-bar--large___UlzNR",
1927
+ "progress-bar--error": "lc-ProgressBar-module__progress-bar--error___MulqI",
1928
+ "progress-bar--success": "lc-ProgressBar-module__progress-bar--success___p7nB-",
1929
+ "progress-bar--normal": "lc-ProgressBar-module__progress-bar--normal___ZwCb-",
1930
+ "progress-bar__indicator--success": "lc-ProgressBar-module__progress-bar__indicator--success___wRjR3",
1931
+ "progress-bar__indicator--normal": "lc-ProgressBar-module__progress-bar__indicator--normal___0Uhle"
1932
+ };
1933
+ const baseClass$g = "progress-bar";
1934
+ const ProgressBar = React.forwardRef((_M, ref) => {
1935
+ var _N = _M, {
1936
+ status = "normal",
1937
+ percent,
1938
+ size = "medium",
1939
+ className = ""
1940
+ } = _N, restProps = __objRest(_N, [
1941
+ "status",
1942
+ "percent",
1943
+ "size",
1944
+ "className"
1945
+ ]);
1946
+ const progressStatus = getProgressStatus(status, percent);
1947
+ const percentNumber = getPercentNumber(progressStatus, percent);
1948
+ const mergedClassNames = cx(styles$a[baseClass$g], {
1949
+ [styles$a[`${baseClass$g}--${size}`]]: size,
1950
+ [styles$a[`${baseClass$g}--${status}`]]: status
1951
+ }, className);
1952
+ return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({}, restProps), {
1953
+ className: mergedClassNames,
1954
+ ref,
1955
+ role: "progressbar"
1956
+ }), /* @__PURE__ */ React.createElement("div", {
1957
+ className: styles$a[`${baseClass$g}__indicator--${status}`],
1958
+ style: { width: `${percentNumber}%` }
1959
+ }));
1960
+ });
1961
+ var styles$9 = {
1962
+ "promo-banner": "lc-PromoBanner-module__promo-banner___-mGpq",
1963
+ "promo-banner__content": "lc-PromoBanner-module__promo-banner__content___kRWar",
1964
+ "promo-banner__wrapper": "lc-PromoBanner-module__promo-banner__wrapper___I-8cl",
1965
+ "promo-banner__header": "lc-PromoBanner-module__promo-banner__header___ebYHW",
1966
+ "promo-banner__img": "lc-PromoBanner-module__promo-banner__img___eaShb",
1967
+ "promo-banner__button-text": "lc-PromoBanner-module__promo-banner__button-text___taYKa",
1968
+ "promo-banner--light": "lc-PromoBanner-module__promo-banner--light___eJxOR",
1969
+ "promo-banner__footer": "lc-PromoBanner-module__promo-banner__footer___8OjvH",
1970
+ "promo-banner--small": "lc-PromoBanner-module__promo-banner--small___7sWLV",
1971
+ "promo-banner--large": "lc-PromoBanner-module__promo-banner--large___pMiCU",
1972
+ "promo-banner__close-icon": "lc-PromoBanner-module__promo-banner__close-icon___GowBL"
1973
+ };
1974
+ const SMALL_CONTAINER_WIDTH_TRESHOLD = 400;
1975
+ const LARGE_CONTAINER_WIDTH_TRESHOLD = 800;
1976
+ const RESIZE_DEBOUNCE_TRESHOLD = 500;
1977
+ const baseClass$f = "promo-banner";
1978
+ const PromoBanner = ({
1979
+ className,
1980
+ buttonText,
1981
+ children,
1982
+ header,
1983
+ img,
1984
+ light = false,
1985
+ linkText,
1986
+ onButtonClick,
1987
+ onClose,
1988
+ onLinkClick
1989
+ }) => {
1990
+ const containerRef = React.useRef(null);
1991
+ const [containerSize, setContainerSize] = React.useState("medium");
1992
+ const mergedClassNames = cx(styles$9[baseClass$f], {
1993
+ [styles$9[`${baseClass$f}--light`]]: light,
1994
+ [styles$9[`${baseClass$f}--small`]]: containerSize === "small",
1995
+ [styles$9[`${baseClass$f}--large`]]: containerSize === "large"
1996
+ }, className);
1997
+ React.useEffect(() => {
1998
+ const handleResize = () => {
1999
+ if (containerRef.current && containerRef.current.offsetWidth <= SMALL_CONTAINER_WIDTH_TRESHOLD) {
2000
+ return setContainerSize("small");
2001
+ }
2002
+ if (containerRef.current && containerRef.current.offsetWidth >= LARGE_CONTAINER_WIDTH_TRESHOLD) {
2003
+ return setContainerSize("large");
2004
+ }
2005
+ return setContainerSize("medium");
2006
+ };
2007
+ const debouncedHandleResize = debounce(handleResize, RESIZE_DEBOUNCE_TRESHOLD);
2008
+ window.addEventListener("resize", debouncedHandleResize);
2009
+ handleResize();
2010
+ return () => {
2011
+ debouncedHandleResize.cancel();
2012
+ window.removeEventListener("resize", handleResize);
2013
+ };
2014
+ }, []);
2015
+ const footer = /* @__PURE__ */ React.createElement("div", {
2016
+ className: styles$9[`${baseClass$f}__footer`]
2017
+ }, buttonText && /* @__PURE__ */ React.createElement(Button, {
2018
+ kind: "primary",
2019
+ size: "compact",
2020
+ onClick: onButtonClick,
2021
+ className: styles$9[`${baseClass$f}__button-text`]
2022
+ }, buttonText), linkText && /* @__PURE__ */ React.createElement(Button, {
2023
+ size: "compact",
2024
+ kind: "text",
2025
+ onClick: onLinkClick
2026
+ }, linkText));
2027
+ return /* @__PURE__ */ React.createElement("div", {
2028
+ ref: containerRef,
2029
+ className: mergedClassNames
2030
+ }, /* @__PURE__ */ React.createElement("div", {
2031
+ className: styles$9[`${baseClass$f}__content`]
2032
+ }, img && /* @__PURE__ */ React.createElement("img", {
2033
+ src: img,
2034
+ className: styles$9[`${baseClass$f}__img`]
2035
+ }), /* @__PURE__ */ React.createElement("div", {
2036
+ className: styles$9[`${baseClass$f}__wrapper`]
2037
+ }, /* @__PURE__ */ React.createElement("div", {
2038
+ className: styles$9[`${baseClass$f}__header`]
2039
+ }, header), /* @__PURE__ */ React.createElement("div", null, children), containerSize !== "large" && footer), containerSize === "large" && footer), onClose && /* @__PURE__ */ React.createElement("button", {
2040
+ type: "button",
2041
+ className: styles$9[`${baseClass$f}__close-icon`],
2042
+ onClick: onClose
2043
+ }, /* @__PURE__ */ React.createElement(Icon, {
2044
+ source: Close,
2045
+ size: "large"
2046
+ })));
2047
+ };
2048
+ var styles$8 = {
2049
+ "radio-button": "lc-RadioButton-module__radio-button___WaToM",
2050
+ "radio-button__label": "lc-RadioButton-module__radio-button__label___i7ygg",
2051
+ "radio-button__circle": "lc-RadioButton-module__radio-button__circle___wimWA",
2052
+ "radio-button__inner-circle": "lc-RadioButton-module__radio-button__inner-circle___qkRVf",
2053
+ "radio-button__text": "lc-RadioButton-module__radio-button__text___mT8c0",
2054
+ "radio-button__input": "lc-RadioButton-module__radio-button__input___7OTAK",
2055
+ "radio-button__helper": "lc-RadioButton-module__radio-button__helper___r8gJJ",
2056
+ "radio-button--selected": "lc-RadioButton-module__radio-button--selected___s9lqj",
2057
+ "radio-button--disabled": "lc-RadioButton-module__radio-button--disabled___wHSA7"
2058
+ };
2059
+ const baseClass$e = "radio-button";
2060
+ const RadioButton = React.forwardRef((_O, ref) => {
2061
+ var _P = _O, { children, className = "", description, checked, disabled } = _P, props = __objRest(_P, ["children", "className", "description", "checked", "disabled"]);
2062
+ const mergedClassNames = cx(styles$8[baseClass$e], className, {
2063
+ [styles$8[`${baseClass$e}--selected`]]: checked,
2064
+ [styles$8[`${baseClass$e}--disabled`]]: disabled
2065
+ });
2066
+ return /* @__PURE__ */ React.createElement("div", {
2067
+ className: mergedClassNames
2068
+ }, /* @__PURE__ */ React.createElement("label", {
2069
+ className: styles$8[`${baseClass$e}__label`]
2070
+ }, /* @__PURE__ */ React.createElement("div", {
2071
+ className: styles$8[`${baseClass$e}__circle`]
2072
+ }, /* @__PURE__ */ React.createElement("span", {
2073
+ className: styles$8[`${baseClass$e}__inner-circle`]
2074
+ }), /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues({}, props), {
2075
+ className: styles$8[`${baseClass$e}__input`],
2076
+ ref,
2077
+ type: "radio",
2078
+ checked,
2079
+ disabled
2080
+ }))), children && /* @__PURE__ */ React.createElement(Text, {
2081
+ as: "div",
2082
+ size: "md",
2083
+ className: styles$8[`${baseClass$e}__text`]
2084
+ }, children)), description && /* @__PURE__ */ React.createElement(FieldDescription, {
2085
+ className: styles$8[`${baseClass$e}__helper`]
2086
+ }, description));
2087
+ });
2088
+ var styles$7 = {
2089
+ "search-input": "lc-Search-module__search-input___FsbCk",
2090
+ "search-input__search-icon": "lc-Search-module__search-input__search-icon___BBQoD",
2091
+ "search-input__clear-icon": "lc-Search-module__search-input__clear-icon___LoNkc",
2092
+ "search-input__loader": "lc-Search-module__search-input__loader___pkpIG",
2093
+ "search-input__input": "lc-Search-module__search-input__input___OhyTr",
2094
+ "search-input__input--compact": "lc-Search-module__search-input__input--compact___yikdR",
2095
+ "search-input__input--medium": "lc-Search-module__search-input__input--medium___u6tRA",
2096
+ "search-input__input--large": "lc-Search-module__search-input__input--large___9jQ-s",
2097
+ "search-input__input--collapsable": "lc-Search-module__search-input__input--collapsable___4VjS8",
2098
+ "search-input__input--collapsable--open": "lc-Search-module__search-input__input--collapsable--open___a2rX2",
2099
+ "search-input__input--disabled": "lc-Search-module__search-input__input--disabled___nfZau"
2100
+ };
2101
+ const baseClass$d = "search-input";
2102
+ const inputBaseClass = `${baseClass$d}__input`;
2103
+ const SearchInput = ({
2104
+ isCollapsable,
2105
+ isDisabled,
2106
+ isLoading,
2107
+ placeholder = "Search ...",
2108
+ size = "medium",
2109
+ value,
2110
+ onChange
2111
+ }) => {
2112
+ const [searchValue, setSearchValue] = React.useState(value || "");
2113
+ const [isCollapsed, setIsCollapsed] = React.useState(true);
2114
+ const inputRef = React.useRef(null);
2115
+ const isCloseIconVisible = !!searchValue && !isDisabled && !isLoading;
2116
+ const mergedClassNames = cx(styles$7[`${inputBaseClass}`], styles$7[`${inputBaseClass}--${size}`], (isDisabled || isLoading) && styles$7[`${inputBaseClass}--disabled`], isCollapsable && styles$7[`${inputBaseClass}--collapsable`], !isCollapsed && styles$7[`${inputBaseClass}--collapsable--open`]);
2117
+ React.useEffect(() => {
2118
+ if (typeof value === "string") {
2119
+ setSearchValue(value);
2120
+ }
2121
+ }, [value]);
2122
+ const handleOnChange = (e) => {
2123
+ const value2 = e.currentTarget.value;
2124
+ setSearchValue(value2);
2125
+ onChange(value2);
2126
+ };
2127
+ const handleClear = () => {
2128
+ setSearchValue("");
2129
+ onChange("");
2130
+ };
2131
+ const handleClick = () => {
2132
+ var _a;
2133
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
2134
+ };
2135
+ const handleFocus = () => {
2136
+ if (isCollapsable) {
2137
+ setIsCollapsed(false);
2138
+ }
2139
+ };
2140
+ const handleBlur = () => {
2141
+ if (isCollapsable && !searchValue) {
2142
+ setIsCollapsed(true);
2143
+ }
2144
+ };
2145
+ const handleKeyDown = (e) => {
2146
+ if (e.key === KeyCodes.enter) {
2147
+ e.preventDefault();
2148
+ onChange(searchValue);
2149
+ }
2150
+ };
2151
+ return /* @__PURE__ */ React.createElement("div", {
2152
+ "data-testid": `${baseClass$d}-container`,
2153
+ className: styles$7[baseClass$d],
2154
+ onClick: handleClick
2155
+ }, /* @__PURE__ */ React.createElement(Icon, {
2156
+ className: styles$7[`${baseClass$d}__search-icon`],
2157
+ source: Search,
2158
+ disabled: isDisabled || isLoading,
2159
+ kind: "primary"
2160
+ }), /* @__PURE__ */ React.createElement("input", {
2161
+ ref: inputRef,
2162
+ className: mergedClassNames,
2163
+ type: "text",
2164
+ value: searchValue,
2165
+ placeholder,
2166
+ onChange: handleOnChange,
2167
+ onBlur: handleBlur,
2168
+ onFocus: handleFocus,
2169
+ onKeyDown: handleKeyDown,
2170
+ disabled: isDisabled || isLoading
2171
+ }), isCloseIconVisible && /* @__PURE__ */ React.createElement("div", {
2172
+ className: styles$7[`${baseClass$d}__clear-icon`],
2173
+ "data-testid": `${baseClass$d}-clear-icon`,
2174
+ onClick: handleClear
2175
+ }, /* @__PURE__ */ React.createElement(Icon, {
2176
+ source: Close
2177
+ })), isLoading && /* @__PURE__ */ React.createElement("div", {
2178
+ "data-testid": `${baseClass$d}-loader`,
2179
+ className: styles$7[`${baseClass$d}__loader`]
2180
+ }, /* @__PURE__ */ React.createElement(Loader, {
2181
+ size: "small"
2182
+ })));
2183
+ };
2184
+ const switch__input = "lc-Switch-module__switch__input___NiiOR";
2185
+ const switch__container = "lc-Switch-module__switch__container___79F7W";
2186
+ const switch__track = "lc-Switch-module__switch__track___2wr2M";
2187
+ const switch__slider = "lc-Switch-module__switch__slider___WHd--";
2188
+ const switch__loader = "lc-Switch-module__switch__loader___FE-fA";
2189
+ const switch__icon = "lc-Switch-module__switch__icon___-O1qY";
2190
+ var styles$6 = {
2191
+ "switch": "lc-Switch-module__switch___AaA2k",
2192
+ "switch__track--enabled": "lc-Switch-module__switch__track--enabled___sy4Xl",
2193
+ "switch__track--on": "lc-Switch-module__switch__track--on___aOMWe",
2194
+ "switch__track--off": "lc-Switch-module__switch__track--off___NAisj",
2195
+ "switch--large": "lc-Switch-module__switch--large___pSoJ7",
2196
+ "switch--compact": "lc-Switch-module__switch--compact___OGFIX",
2197
+ "switch--medium": "lc-Switch-module__switch--medium___EcZwT",
2198
+ switch__input,
2199
+ "switch__input--disabled": "lc-Switch-module__switch__input--disabled___Po8gh",
2200
+ switch__container,
2201
+ switch__track,
2202
+ "switch__track--disabled": "lc-Switch-module__switch__track--disabled___HkDhl",
2203
+ switch__slider,
2204
+ "switch__slider--large": "lc-Switch-module__switch__slider--large___WoEgi",
2205
+ "switch__slider--large--on": "lc-Switch-module__switch__slider--large--on___7Qp3G",
2206
+ "switch__slider--large--off": "lc-Switch-module__switch__slider--large--off___iRMmD",
2207
+ "switch__slider--compact": "lc-Switch-module__switch__slider--compact___uZ-lS",
2208
+ "switch__slider--compact--on": "lc-Switch-module__switch__slider--compact--on___FykE3",
2209
+ "switch__slider--compact--off": "lc-Switch-module__switch__slider--compact--off___s5yR8",
2210
+ "switch__slider--medium": "lc-Switch-module__switch__slider--medium___uhptz",
2211
+ "switch__slider--medium--on": "lc-Switch-module__switch__slider--medium--on___SfeAV",
2212
+ "switch__slider--medium--off": "lc-Switch-module__switch__slider--medium--off___eXJJz",
2213
+ switch__loader,
2214
+ "switch__loader--compact": "lc-Switch-module__switch__loader--compact___3imUh",
2215
+ "switch__loader--medium": "lc-Switch-module__switch__loader--medium___2zi05",
2216
+ "switch__loader--large": "lc-Switch-module__switch__loader--large___vLRFa",
2217
+ switch__icon
2218
+ };
2219
+ const baseClass$c = "switch";
2220
+ const Switch = (_Q) => {
2221
+ var _R = _Q, {
2222
+ className = "",
2223
+ defaultOn = false,
2224
+ disabled = false,
2225
+ name = baseClass$c,
2226
+ on,
2227
+ onChange = noop,
2228
+ size = "large",
2229
+ state = "regular",
2230
+ innerRef
2231
+ } = _R, props = __objRest(_R, [
2232
+ "className",
2233
+ "defaultOn",
2234
+ "disabled",
2235
+ "name",
2236
+ "on",
2237
+ "onChange",
2238
+ "size",
2239
+ "state",
2240
+ "innerRef"
2241
+ ]);
2242
+ const [checked, setChecked] = React.useState(() => on !== void 0 ? on : defaultOn);
2243
+ React.useEffect(() => {
2244
+ if (on !== void 0) {
2245
+ setChecked(on);
2246
+ }
2247
+ }, [on]);
2248
+ const isLoading = state === "loading";
2249
+ const isLocked = state === "locked";
2250
+ const iconSize = size === "large" ? "small" : "xsmall";
2251
+ const toggleStyles = checked ? "on" : "off";
2252
+ const shouldBehaveAsDisabled = disabled || isLoading || isLocked;
2253
+ const availabilityStyles = shouldBehaveAsDisabled ? "disabled" : "enabled";
2254
+ const mergedClassNames = cx(styles$6[baseClass$c], styles$6[`${baseClass$c}--${size}`], className);
2255
+ const handleChange = (e) => {
2256
+ const hasOnChangePassed = onChange !== noop;
2257
+ if (hasOnChangePassed) {
2258
+ onChange(e, checked);
2259
+ return;
2260
+ }
2261
+ e.stopPropagation();
2262
+ setChecked((prevEnabled) => !prevEnabled);
2263
+ };
2264
+ return /* @__PURE__ */ React.createElement("span", {
2265
+ className: mergedClassNames
2266
+ }, /* @__PURE__ */ React.createElement("input", __spreadValues({
2267
+ type: "checkbox",
2268
+ className: cx(styles$6[`${baseClass$c}__input`], styles$6[`${baseClass$c}__input--${availabilityStyles}`]),
2269
+ onChange: handleChange,
2270
+ checked,
2271
+ name,
2272
+ ref: innerRef,
2273
+ disabled: shouldBehaveAsDisabled,
2274
+ "test-id": "foo"
2275
+ }, props)), /* @__PURE__ */ React.createElement("span", {
2276
+ className: styles$6[`${baseClass$c}__container`]
2277
+ }, /* @__PURE__ */ React.createElement("span", {
2278
+ className: cx(styles$6[`${baseClass$c}__track`], styles$6[`${baseClass$c}__track--${toggleStyles}`], styles$6[`${baseClass$c}__track--${availabilityStyles}`])
2279
+ }), /* @__PURE__ */ React.createElement("span", {
2280
+ className: cx(styles$6[`${baseClass$c}__slider`], styles$6[`${baseClass$c}__slider--${size}`], styles$6[`${baseClass$c}__slider--${size}--${toggleStyles}`])
2281
+ }, isLoading && /* @__PURE__ */ React.createElement(Loader, {
2282
+ className: cx(styles$6[`${baseClass$c}__loader`], styles$6[`${baseClass$c}__loader--${size}`])
2283
+ }), isLocked && /* @__PURE__ */ React.createElement(Icon, {
2284
+ className: styles$6[`${baseClass$c}__icon`],
2285
+ "data-testid": "lock-icon",
2286
+ size: iconSize,
2287
+ source: LockBlack,
2288
+ kind: "primary"
2289
+ }))));
2290
+ };
2291
+ const tab = "lc-Tab-module__tab___fME7u";
2292
+ const tab__description = "lc-Tab-module__tab__description___JGXU6";
2293
+ var styles$5 = {
2294
+ tab,
2295
+ tab__description,
2296
+ "tab--selected": "lc-Tab-module__tab--selected___c0EkL"
2297
+ };
2298
+ const baseClass$b = "tab";
2299
+ const Tab = (_S) => {
2300
+ var _T = _S, {
2301
+ children,
2302
+ className,
2303
+ description,
2304
+ isSelected
2305
+ } = _T, restProps = __objRest(_T, [
2306
+ "children",
2307
+ "className",
2308
+ "description",
2309
+ "isSelected"
2310
+ ]);
2311
+ return /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({}, restProps), {
2312
+ as: restProps.href ? "a" : "button",
2313
+ size: "md",
2314
+ bold: isSelected,
2315
+ className: cx(styles$5[baseClass$b], className, isSelected && styles$5[`${baseClass$b}--selected`])
2316
+ }), children, description && /* @__PURE__ */ React.createElement(Text, {
2317
+ as: "span",
2318
+ size: "md",
2319
+ className: styles$5[`${baseClass$b}__description`]
2320
+ }, "(", description, ")"));
2321
+ };
2322
+ const tabs = "lc-TabsWrapper-module__tabs___Y2xyD";
2323
+ const tabs__list = "lc-TabsWrapper-module__tabs__list___i6tVO";
2324
+ var styles$4 = {
2325
+ tabs,
2326
+ tabs__list
2327
+ };
2328
+ const baseClass$a = "tabs";
2329
+ const TabsWrapper = ({
2330
+ className,
2331
+ children
2332
+ }) => {
2333
+ return /* @__PURE__ */ React.createElement("div", {
2334
+ className: cx(styles$4[baseClass$a], className)
2335
+ }, children);
2336
+ };
2337
+ const TabsList = ({
2338
+ className,
2339
+ children
2340
+ }) => {
2341
+ return /* @__PURE__ */ React.createElement("div", {
2342
+ className: cx(styles$4[`${baseClass$a}__list`], className)
2343
+ }, children);
2344
+ };
2345
+ const tag = "lc-Tag-module__tag___1QRVY";
2346
+ const tag__remove = "lc-Tag-module__tag__remove___UmtrW";
2347
+ const icon = "lc-Tag-module__icon___2Z-35";
2348
+ const tag__icon = "lc-Tag-module__tag__icon___tZoQ9";
2349
+ const tag__avatar = "lc-Tag-module__tag__avatar___U4c-P";
2350
+ var styles$3 = {
2351
+ tag,
2352
+ "tag--success": "lc-Tag-module__tag--success___P2hXQ",
2353
+ tag__remove,
2354
+ "tag--error": "lc-Tag-module__tag--error___1cjsm",
2355
+ "tag--warning": "lc-Tag-module__tag--warning___PstMG",
2356
+ "tag--info": "lc-Tag-module__tag--info___RTH0C",
2357
+ "tag--medium": "lc-Tag-module__tag--medium___l5-KI",
2358
+ "tag--large": "lc-Tag-module__tag--large___ytC6Y",
2359
+ "tag--outline": "lc-Tag-module__tag--outline___aZXtr",
2360
+ icon,
2361
+ "tag--text-white": "lc-Tag-module__tag--text-white___x0fnD",
2362
+ "tag--text-black": "lc-Tag-module__tag--text-black___dUvmD",
2363
+ "tag--with-icon": "lc-Tag-module__tag--with-icon___ZlkvT",
2364
+ "tag--dismissible": "lc-Tag-module__tag--dismissible___Qobyr",
2365
+ tag__icon,
2366
+ tag__avatar
2367
+ };
2368
+ const baseClass$9 = "tag";
2369
+ const getCustomTextClass = (customColor) => {
2370
+ if (!customColor) {
2371
+ return "";
2372
+ }
2373
+ return getContrast(customColor, "#FFFFFF") > 4.5 ? "text-white" : "text-black";
2374
+ };
2375
+ const Tag = (_U) => {
2376
+ var _V = _U, {
2377
+ className = "",
2378
+ children,
2379
+ dismissible = false,
2380
+ size = "medium",
2381
+ kind = "default",
2382
+ onRemove,
2383
+ outline = false,
2384
+ icon: icon2,
2385
+ avatar: avatar2,
2386
+ customColor
2387
+ } = _V, restProps = __objRest(_V, [
2388
+ "className",
2389
+ "children",
2390
+ "dismissible",
2391
+ "size",
2392
+ "kind",
2393
+ "onRemove",
2394
+ "outline",
2395
+ "icon",
2396
+ "avatar",
2397
+ "customColor"
2398
+ ]);
2399
+ const mergedClassNames = cx(styles$3[baseClass$9], className, styles$3[`${baseClass$9}--${size}`], styles$3[`${baseClass$9}--${kind}`], {
2400
+ [styles$3[`${baseClass$9}--dismissible`]]: dismissible,
2401
+ [styles$3[`${baseClass$9}--outline`]]: outline,
2402
+ [styles$3[`${baseClass$9}--with-icon`]]: !!icon2 || !!avatar2,
2403
+ [styles$3[`${baseClass$9}--${getCustomTextClass(customColor)}`]]: !!customColor
2404
+ });
2405
+ const getCustomColorStyles = () => {
2406
+ if (!customColor) {
2407
+ return {};
2408
+ }
2409
+ if (outline) {
2410
+ return {
2411
+ style: {
2412
+ backgroundColor: "transparent",
2413
+ color: customColor,
2414
+ borderColor: customColor
2415
+ }
2416
+ };
2417
+ }
2418
+ return { style: { backgroundColor: customColor } };
2419
+ };
2420
+ const getIconCustomColor = () => {
2421
+ if (!customColor) {
2422
+ return void 0;
2423
+ }
2424
+ if (outline) {
2425
+ return customColor;
2426
+ }
2427
+ return getContrast(customColor, "#FFFFFF") > 4.5 ? "#FFFFFF" : "#000000";
2428
+ };
2429
+ return /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues(__spreadValues({
2430
+ className: mergedClassNames
2431
+ }, restProps), getCustomColorStyles()), {
2432
+ as: "div",
2433
+ size: "md"
2434
+ }), avatar2 && /* @__PURE__ */ React.createElement("img", {
2435
+ className: styles$3[`${baseClass$9}__avatar`],
2436
+ src: avatar2,
2437
+ alt: "tag-avatar",
2438
+ "data-testid": "lc-tag-avatar"
2439
+ }), " ", icon2 && !avatar2 && /* @__PURE__ */ React.createElement(Icon, {
2440
+ "data-testid": "lc-tag-icon",
2441
+ className: styles$3[`${baseClass$9}__icon`],
2442
+ source: icon2,
2443
+ size: "small",
2444
+ customColor: getIconCustomColor()
2445
+ }), children, dismissible && /* @__PURE__ */ React.createElement("button", {
2446
+ title: "Remove",
2447
+ onClick: onRemove,
2448
+ type: "button",
2449
+ className: styles$3[`${baseClass$9}__remove`]
2450
+ }, /* @__PURE__ */ React.createElement(Icon, {
2451
+ source: Close,
2452
+ size: "medium",
2453
+ customColor: getIconCustomColor()
2454
+ })));
2455
+ };
2456
+ const EditableTagContent = ({
2457
+ className = "",
2458
+ innerEditableRef,
2459
+ inputRef,
2460
+ change,
2461
+ remove,
2462
+ value
2463
+ }) => {
2464
+ const [removed, setRemoved] = React.useState(false);
2465
+ const getRef = () => innerEditableRef.current;
2466
+ const getValue = () => {
2467
+ const ref = getRef();
2468
+ return ref ? ref.innerText : "";
2469
+ };
2470
+ const focusInputRef = () => {
2471
+ if (inputRef && inputRef.current) {
2472
+ inputRef.current.focus();
2473
+ }
2474
+ };
2475
+ const onKeyDown = (e) => {
2476
+ if (e.key === KeyCodes.enter) {
2477
+ e.preventDefault();
2478
+ focusInputRef();
2479
+ return;
2480
+ }
2481
+ if (e.key === KeyCodes.backspace && getValue() === "") {
2482
+ setRemoved(true);
2483
+ remove();
2484
+ focusInputRef();
2485
+ }
2486
+ };
2487
+ const onBlur = () => {
2488
+ const ref = getRef();
2489
+ if (removed || !ref) {
2490
+ return;
2491
+ }
2492
+ if (ref.innerText === "") {
2493
+ remove();
2494
+ return;
2495
+ }
2496
+ change(ref.innerText);
2497
+ };
2498
+ const onPaste = (e) => {
2499
+ e.preventDefault();
2500
+ const text = e.clipboardData.getData("text/plain");
2501
+ document.execCommand("insertHTML", false, escape(text));
2502
+ };
2503
+ return /* @__PURE__ */ React.createElement("div", {
2504
+ ref: innerEditableRef,
2505
+ className,
2506
+ contentEditable: true,
2507
+ onPaste,
2508
+ onBlur,
2509
+ onKeyDown,
2510
+ dangerouslySetInnerHTML: { __html: escape(value) }
2511
+ });
2512
+ };
2513
+ var styles$2 = {
2514
+ "tag-input": "lc-TagInput-module__tag-input___CLVY-",
2515
+ "tag-input--error": "lc-TagInput-module__tag-input--error___RP0SB",
2516
+ "tag-input__input": "lc-TagInput-module__tag-input__input___dgEYB",
2517
+ "tag-input__input--medium": "lc-TagInput-module__tag-input__input--medium___DYF7X",
2518
+ "tag-input__input--large": "lc-TagInput-module__tag-input__input--large___G6iEO",
2519
+ "tag-input__tag__content": "lc-TagInput-module__tag-input__tag__content___x95-M"
2520
+ };
2521
+ const baseClass$8 = "tag-input__tag";
2522
+ const EditableTag = ({
2523
+ children,
2524
+ index: index2,
2525
+ remove,
2526
+ validator,
2527
+ inputRef,
2528
+ update,
2529
+ size
2530
+ }) => {
2531
+ const isValid = React.useMemo(() => {
2532
+ return validator !== void 0 ? validator(children) : true;
2533
+ }, [children, validator]);
2534
+ const innerEditableRef = React.useRef(null);
2535
+ const removeTag = () => remove(index2);
2536
+ return /* @__PURE__ */ React.createElement(Tag, {
2537
+ kind: isValid ? "default" : "error",
2538
+ dismissible: true,
2539
+ size,
2540
+ onRemove: removeTag
2541
+ }, /* @__PURE__ */ React.createElement(EditableTagContent, {
2542
+ value: children,
2543
+ inputRef,
2544
+ innerEditableRef,
2545
+ className: styles$2[`${baseClass$8}__content`],
2546
+ change: (newValue) => update(index2, newValue),
2547
+ remove: removeTag,
2548
+ validator
2549
+ }));
2550
+ };
2551
+ const baseClass$7 = "tag-input";
2552
+ const tagSeparatorKeys = [
2553
+ KeyCodes.enter,
2554
+ KeyCodes.spacebar,
2555
+ KeyCodes.tab,
2556
+ KeyCodes.semicolon,
2557
+ KeyCodes.comma
2558
+ ];
2559
+ const tagRemoveKeys = [KeyCodes.backspace, KeyCodes.delete];
2560
+ const TagInput = ({
2561
+ tags,
2562
+ onChange,
2563
+ validator,
2564
+ error,
2565
+ placeholder,
2566
+ size = "medium"
2567
+ }) => {
2568
+ const mergedClassNames = cx(styles$2[baseClass$7], {
2569
+ [styles$2[`${baseClass$7}--error`]]: error
2570
+ });
2571
+ const inputClassNames = cx(styles$2[`${baseClass$7}__input`], styles$2[`${baseClass$7}__input--${size}`]);
2572
+ const [inputValue, setInputValue] = React.useState("");
2573
+ const inputRef = React.useRef(null);
2574
+ const addTag = (value) => {
2575
+ onChange([...tags || [], value]);
2576
+ setInputValue("");
2577
+ };
2578
+ const removeTag = (idx) => {
2579
+ const newTags = [...tags || []];
2580
+ newTags.splice(idx, 1);
2581
+ onChange(newTags);
2582
+ };
2583
+ const onInputChange = (e) => setInputValue(e.target.value);
2584
+ const onInputKeyDown = (e) => {
2585
+ if (tagSeparatorKeys.includes(e.key)) {
2586
+ e.preventDefault();
2587
+ if (inputValue === "") {
2588
+ return;
2589
+ }
2590
+ addTag(inputValue);
2591
+ } else if (tagRemoveKeys.includes(e.key)) {
2592
+ if (inputValue !== "" || !(tags == null ? void 0 : tags.length)) {
2593
+ return;
2594
+ }
2595
+ removeTag(tags.length - 1);
2596
+ }
2597
+ };
2598
+ const updateTag = (i, value) => {
2599
+ const newTags = [...tags || []];
2600
+ const numOccurrencesOfValue = newTags.reduce((prev, currentValue, index2) => prev + (currentValue === value && index2 !== i ? 1 : 0), 0);
2601
+ if (numOccurrencesOfValue > 0) {
2602
+ newTags.splice(i, 1);
2603
+ } else {
2604
+ newTags[i] = value;
2605
+ }
2606
+ onChange(newTags);
2607
+ };
2608
+ const onPaste = (e) => {
2609
+ e.preventDefault();
2610
+ const text = e.clipboardData.getData("text/plain");
2611
+ const newTags = text.split(/[\s,;\n]+/);
2612
+ onChange([...tags || [], ...newTags]);
2613
+ };
2614
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
2615
+ className: mergedClassNames
2616
+ }, tags == null ? void 0 : tags.map((tag2, index2) => /* @__PURE__ */ React.createElement(EditableTag, {
2617
+ index: index2,
2618
+ key: `${index2}${tag2}`,
2619
+ update: updateTag,
2620
+ remove: removeTag,
2621
+ inputRef,
2622
+ validator,
2623
+ size
2624
+ }, tag2)), /* @__PURE__ */ React.createElement("input", {
2625
+ ref: inputRef,
2626
+ className: inputClassNames,
2627
+ placeholder,
2628
+ value: inputValue,
2629
+ onChange: onInputChange,
2630
+ onKeyDown: onInputKeyDown,
2631
+ onPaste
2632
+ })), error && /* @__PURE__ */ React.createElement(FieldError, null, error));
2633
+ };
2634
+ 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;
2635
+ const defaultPlaceholder = "name@company.com";
2636
+ const emailValidator = (value) => {
2637
+ return emailRegex.test(value);
2638
+ };
2639
+ const EmailTagInput = ({
2640
+ tags,
2641
+ onChange,
2642
+ error,
2643
+ placeholder = defaultPlaceholder,
2644
+ size
2645
+ }) => {
2646
+ return /* @__PURE__ */ React.createElement(TagInput, {
2647
+ tags,
2648
+ error,
2649
+ onChange,
2650
+ placeholder,
2651
+ validator: emailValidator,
2652
+ size
2653
+ });
2654
+ };
2655
+ const toast = "lc-Toast-module__toast___j5Amn";
2656
+ const toast__content = "lc-Toast-module__toast__content___HjaNw";
2657
+ const toast__actions = "lc-Toast-module__toast__actions___JWu-1";
2658
+ var styles$1 = {
2659
+ toast,
2660
+ toast__content,
2661
+ toast__actions,
2662
+ "toast__actions--close": "lc-Toast-module__toast__actions--close___QuXHY",
2663
+ "toast__actions--custom": "lc-Toast-module__toast__actions--custom___lm-pM",
2664
+ "toast--success": "lc-Toast-module__toast--success___7UC6m",
2665
+ "toast--warning": "lc-Toast-module__toast--warning___pteb7",
2666
+ "toast--error": "lc-Toast-module__toast--error___trg--",
2667
+ "toast--info": "lc-Toast-module__toast--info___IOp44",
2668
+ "toast-wrapper": "lc-Toast-module__toast-wrapper___Oiwqp",
2669
+ "toast-wrapper--fixed": "lc-Toast-module__toast-wrapper--fixed___QYxRI",
2670
+ "toast-wrapper--block": "lc-Toast-module__toast-wrapper--block___j0kGt",
2671
+ "toast-wrapper--horizontal-center": "lc-Toast-module__toast-wrapper--horizontal-center___t9AFd",
2672
+ "toast-wrapper--horizontal-left": "lc-Toast-module__toast-wrapper--horizontal-left___-GY4I",
2673
+ "toast-wrapper--horizontal-right": "lc-Toast-module__toast-wrapper--horizontal-right___VVMgm",
2674
+ "toast-wrapper--vertical-top": "lc-Toast-module__toast-wrapper--vertical-top___uBfEG",
2675
+ "toast-appear--slide": "lc-Toast-module__toast-appear--slide___G7GAp",
2676
+ "toast-appear-active--slide": "lc-Toast-module__toast-appear-active--slide___brfgK",
2677
+ "toast-exit--slide": "lc-Toast-module__toast-exit--slide___aqiBq",
2678
+ "toast-exit-active--slide": "lc-Toast-module__toast-exit-active--slide___WryMi",
2679
+ "toast-wrapper--vertical-bottom": "lc-Toast-module__toast-wrapper--vertical-bottom___erPuH",
2680
+ "toast-appear--fade": "lc-Toast-module__toast-appear--fade___oUwHm",
2681
+ "toast-appear-active--fade": "lc-Toast-module__toast-appear-active--fade___D3--J",
2682
+ "toast-exit--fade": "lc-Toast-module__toast-exit--fade___iDA1p",
2683
+ "toast-exit-active--fade": "lc-Toast-module__toast-exit-active--fade___tL7sb"
2684
+ };
2685
+ const iconConfig = {
2686
+ success: {
2687
+ source: CheckCircleSolid,
2688
+ kind: "inverted"
2689
+ },
2690
+ warning: {
2691
+ source: Warning
2692
+ },
2693
+ error: {
2694
+ source: Error2,
2695
+ kind: "inverted"
2696
+ },
2697
+ info: {
2698
+ source: Info$1,
2699
+ kind: "inverted"
2700
+ }
2701
+ };
2702
+ const baseClass$6 = "toast";
2703
+ const Toast = (_W) => {
2704
+ var _X = _W, {
2705
+ action,
2706
+ className,
2707
+ children,
2708
+ removable,
2709
+ kind = "info",
2710
+ onClose
2711
+ } = _X, divProps = __objRest(_X, [
2712
+ "action",
2713
+ "className",
2714
+ "children",
2715
+ "removable",
2716
+ "kind",
2717
+ "onClose"
2718
+ ]);
2719
+ const mergedClassNames = cx(styles$1[baseClass$6], styles$1[`${baseClass$6}--${kind}`], className);
2720
+ const onActionClick = (action2) => {
2721
+ if (action2 && action2.closesOnClick && onClose) {
2722
+ action2.onClick();
2723
+ return onClose();
2724
+ }
2725
+ return action2.onClick();
2726
+ };
2727
+ return /* @__PURE__ */ React.createElement("div", __spreadValues({
2728
+ className: mergedClassNames
2729
+ }, divProps), /* @__PURE__ */ React.createElement("div", {
2730
+ className: styles$1[`${baseClass$6}__icon`]
2731
+ }, /* @__PURE__ */ React.createElement(Icon, __spreadProps(__spreadValues({}, iconConfig[kind]), {
2732
+ size: "medium"
2733
+ }))), /* @__PURE__ */ React.createElement("div", {
2734
+ className: styles$1[`${baseClass$6}__content`]
2735
+ }, children), (action || removable) && /* @__PURE__ */ React.createElement("div", {
2736
+ className: styles$1[`${baseClass$6}__actions`]
2737
+ }, action && /* @__PURE__ */ React.createElement(Button, {
2738
+ className: styles$1[`${baseClass$6}__actions--custom`],
2739
+ kind: "plain",
2740
+ onClick: () => onActionClick(action)
2741
+ }, action.label), removable && /* @__PURE__ */ React.createElement("div", {
2742
+ className: styles$1[`${baseClass$6}__actions--close`],
2743
+ "aria-label": "Close toast",
2744
+ onClick: onClose
2745
+ }, /* @__PURE__ */ React.createElement(Icon, {
2746
+ source: Close,
2747
+ size: "medium",
2748
+ kind: ["warning"].includes(kind) ? "primary" : "inverted"
2749
+ }))));
2750
+ };
2751
+ const ANIMATION_TIME = 200;
2752
+ const baseClass$5 = "toast-wrapper";
2753
+ const ToastWrapper = ({
2754
+ className,
2755
+ toasts = [],
2756
+ fixed = true,
2757
+ block = false,
2758
+ animationType = "slide",
2759
+ verticalPosition = "top",
2760
+ horizontalPosition = "center"
2761
+ }) => {
2762
+ const mergedClassNames = cx(styles$1[baseClass$5], {
2763
+ [styles$1[`${baseClass$5}--fixed`]]: fixed,
2764
+ [styles$1[`${baseClass$5}--block`]]: !fixed && block,
2765
+ [styles$1[`${baseClass$5}--horizontal-${horizontalPosition}`]]: horizontalPosition,
2766
+ [styles$1[`${baseClass$5}--vertical-${verticalPosition}`]]: verticalPosition
2767
+ }, className);
2768
+ return /* @__PURE__ */ React.createElement("div", {
2769
+ className: mergedClassNames
2770
+ }, /* @__PURE__ */ React.createElement(TransitionGroup, {
2771
+ component: null
2772
+ }, toasts.map(({ id, kind, content, removable, action, onClose }) => /* @__PURE__ */ React.createElement(CSSTransition, {
2773
+ key: id,
2774
+ classNames: {
2775
+ enter: styles$1[`toast-appear--${animationType}`],
2776
+ enterActive: styles$1[`toast-appear-active--${animationType}`],
2777
+ exit: styles$1[`toast-exit--${animationType}`],
2778
+ exitActive: styles$1[`toast-exit-active--${animationType}`]
2779
+ },
2780
+ timeout: ANIMATION_TIME
2781
+ }, /* @__PURE__ */ React.createElement(Toast, {
2782
+ kind,
2783
+ onClose,
2784
+ removable,
2785
+ action
2786
+ }, content)))));
2787
+ };
2788
+ const tooltip = "lc-Tooltip-module__tooltip___QOOAr";
2789
+ const tooltip__arrow = "lc-Tooltip-module__tooltip__arrow___Ov1YW";
2790
+ var styles = {
2791
+ tooltip,
2792
+ "tooltip--invert": "lc-Tooltip-module__tooltip--invert___PVjhE",
2793
+ "tooltip--important": "lc-Tooltip-module__tooltip--important___X-IMK",
2794
+ tooltip__arrow,
2795
+ "tooltip-header": "lc-Tooltip-module__tooltip-header___QV0Vd",
2796
+ "tooltip-image": "lc-Tooltip-module__tooltip-image___Aorwg",
2797
+ "tooltip-text": "lc-Tooltip-module__tooltip-text___FB8OV",
2798
+ "tooltip-close": "lc-Tooltip-module__tooltip-close___3r3h9",
2799
+ "tooltip-step": "lc-Tooltip-module__tooltip-step___-j0n8",
2800
+ "guide-tooltip--slide": "lc-Tooltip-module__guide-tooltip--slide___Uawm2",
2801
+ "guide-tooltip__overlay": "lc-Tooltip-module__guide-tooltip__overlay___IyrKK",
2802
+ "guide-tooltip__overlay--slide": "lc-Tooltip-module__guide-tooltip__overlay--slide___VW8oq",
2803
+ "guide-tooltip__overlay--visible": "lc-Tooltip-module__guide-tooltip__overlay--visible___dbdsZ"
2804
+ };
2805
+ const sleep = (milliseconds) => {
2806
+ return new Promise((resolve) => setTimeout(resolve, milliseconds));
2807
+ };
2808
+ const baseClass$4 = "tooltip";
2809
+ const Tooltip = (props) => {
2810
+ const {
2811
+ triggerRenderer,
2812
+ referenceElement,
2813
+ children,
2814
+ className,
2815
+ theme,
2816
+ placement,
2817
+ isVisible,
2818
+ withFadeAnimation = true,
2819
+ transitionDuration = 200,
2820
+ transitionDelay = 0,
2821
+ hoverOutDelayTimeout = 100,
2822
+ offsetMainAxis = 8,
2823
+ triggerOnClick = false,
2824
+ arrowOffsetY,
2825
+ arrowOffsetX,
2826
+ onOpen,
2827
+ onClose
2828
+ } = props;
2829
+ const isManaged = isVisible !== void 0;
2830
+ const arrowRef = React.useRef(null);
2831
+ const [visible, setVisibility] = React.useState(isVisible);
2832
+ const isHovered = React.useRef(false);
2833
+ const {
2834
+ x,
2835
+ y,
2836
+ reference,
2837
+ floating,
2838
+ strategy,
2839
+ update,
2840
+ refs,
2841
+ placement: updatedPlacement,
2842
+ middlewareData: { arrow: { x: arrowX, y: arrowY } = {} }
2843
+ } = useFloating({
2844
+ middleware: [
2845
+ offset({ mainAxis: offsetMainAxis }),
2846
+ arrow({ element: arrowRef }),
2847
+ flip()
2848
+ ],
2849
+ placement
2850
+ });
2851
+ React.useEffect(() => {
2852
+ referenceElement && reference(referenceElement);
2853
+ }, [reference, referenceElement]);
2854
+ React.useEffect(() => {
2855
+ setVisibility(isVisible);
2856
+ }, [isVisible]);
2857
+ React.useEffect(() => {
2858
+ document.addEventListener("keydown", handleCloseAction);
2859
+ return () => {
2860
+ document.removeEventListener("keydown", handleCloseAction);
2861
+ };
2862
+ }, []);
2863
+ React.useEffect(() => {
2864
+ if (!refs.reference.current || !refs.floating.current) {
2865
+ return;
2866
+ }
2867
+ return autoUpdate(refs.reference.current, refs.floating.current, update);
2868
+ }, [refs.reference, refs.floating, update, updatedPlacement, visible]);
2869
+ const handleMouseLeave = () => {
2870
+ if (triggerOnClick || isManaged)
2871
+ return;
2872
+ isHovered.current = false;
2873
+ void sleep(hoverOutDelayTimeout).then(() => {
2874
+ if (!isHovered.current) {
2875
+ setVisibility(false);
2876
+ }
2877
+ });
2878
+ };
2879
+ const handleOpen = () => {
2880
+ if (onOpen)
2881
+ onOpen();
2882
+ if (!isManaged) {
2883
+ setVisibility(true);
2884
+ }
2885
+ };
2886
+ const handleClose = () => {
2887
+ if (onClose)
2888
+ onClose();
2889
+ if (!isManaged) {
2890
+ setVisibility(false);
2891
+ }
2892
+ };
2893
+ const handleMouseEnter = () => {
2894
+ if (triggerOnClick || isManaged)
2895
+ return;
2896
+ isHovered.current = true;
2897
+ setVisibility(true);
2898
+ };
2899
+ const handleCloseAction = (event) => {
2900
+ if (event instanceof KeyboardEvent && event.key === "Escape") {
2901
+ handleClose();
2902
+ }
2903
+ if (event.type === "click") {
2904
+ handleClose();
2905
+ }
2906
+ };
2907
+ const handleClick = () => {
2908
+ if (isManaged)
2909
+ return;
2910
+ if (visible) {
2911
+ handleClose();
2912
+ } else {
2913
+ handleOpen();
2914
+ }
2915
+ };
2916
+ const top = arrowOffsetY && arrowY ? arrowY + arrowOffsetY : arrowY;
2917
+ const left = arrowOffsetX && arrowX ? arrowX + arrowOffsetX : arrowX;
2918
+ const mergedClassNames = cx(styles[baseClass$4], className, {
2919
+ [styles[`${baseClass$4}--invert`]]: theme === "invert",
2920
+ [styles[`${baseClass$4}--important`]]: theme === "important"
2921
+ });
2922
+ const floatingComponent = /* @__PURE__ */ React.createElement("div", {
2923
+ ref: floating,
2924
+ style: {
2925
+ position: strategy,
2926
+ top: y != null ? y : "",
2927
+ left: x != null ? x : ""
2928
+ },
2929
+ className: mergedClassNames,
2930
+ onMouseEnter: handleMouseEnter,
2931
+ onMouseLeave: handleMouseLeave
2932
+ }, React.Children.map(children, (child) => {
2933
+ if (React.isValidElement(child)) {
2934
+ return React.cloneElement(child, __spreadValues({
2935
+ handleCloseAction,
2936
+ theme
2937
+ }, child.props));
2938
+ }
2939
+ return null;
2940
+ }), /* @__PURE__ */ React.createElement("div", {
2941
+ ref: arrowRef,
2942
+ className: cx([styles[`${baseClass$4}__arrow`]]),
2943
+ "data-arrow-placement": updatedPlacement,
2944
+ style: { top, left }
2945
+ }));
2946
+ function renderFloatingComponent() {
2947
+ if (withFadeAnimation) {
2948
+ const enter = css`
2949
+ opacity: 0;
2950
+ `;
2951
+ const enterActive = css`
2952
+ opacity: 1;
2953
+ transition-property: opacity;
2954
+ transition-duration: ${transitionDuration}ms;
2955
+ transition-delay: ${transitionDelay}ms;
2956
+ `;
2957
+ const exit = css`
2958
+ opacity: 1;
2959
+ `;
2960
+ const exitActive = css`
2961
+ opacity: 0;
2962
+ transition-property: opacity;
2963
+ transition-duration: ${transitionDuration}ms;
2964
+ transition-delay: ${transitionDelay}ms;
2965
+ `;
2966
+ const timeout = transitionDuration + transitionDelay;
2967
+ return /* @__PURE__ */ React.createElement(CSSTransition, {
2968
+ in: visible,
2969
+ mountOnEnter: true,
2970
+ unmountOnExit: true,
2971
+ timeout,
2972
+ classNames: {
2973
+ enter,
2974
+ enterActive,
2975
+ exit,
2976
+ exitActive
2977
+ }
2978
+ }, floatingComponent);
2979
+ } else {
2980
+ return visible && floatingComponent;
2981
+ }
2982
+ }
2983
+ if (referenceElement) {
2984
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, renderFloatingComponent());
2985
+ }
2986
+ const referenceOptions = () => {
2987
+ if (!isManaged) {
2988
+ if (triggerOnClick) {
2989
+ return {
2990
+ onClick: handleClick
2991
+ };
2992
+ } else {
2993
+ return {
2994
+ onMouseEnter: handleMouseEnter,
2995
+ onMouseLeave: handleMouseLeave
2996
+ };
2997
+ }
2998
+ }
2999
+ };
3000
+ const triggerElement = /* @__PURE__ */ React.createElement("div", __spreadValues({
3001
+ ref: reference
3002
+ }, referenceOptions()), triggerRenderer());
3003
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, triggerElement, renderFloatingComponent());
3004
+ };
3005
+ const Simple = ({ text }) => {
3006
+ return /* @__PURE__ */ React.createElement("div", null, text);
3007
+ };
3008
+ function getIconType(theme) {
3009
+ switch (theme) {
3010
+ case "invert":
3011
+ return "inverted";
3012
+ case "important":
3013
+ return "subtle";
3014
+ default:
3015
+ return "primary";
3016
+ }
3017
+ }
3018
+ const baseClass$3 = "tooltip";
3019
+ const Info = ({ header, text, closeWithX, theme, handleCloseAction }) => {
3020
+ return /* @__PURE__ */ React.createElement("div", {
3021
+ style: { position: "relative" }
3022
+ }, closeWithX && /* @__PURE__ */ React.createElement("div", {
3023
+ className: styles[`${baseClass$3}-close`],
3024
+ onClick: handleCloseAction
3025
+ }, /* @__PURE__ */ React.createElement(Icon, {
3026
+ source: Close,
3027
+ kind: theme ? getIconType(theme) : "primary"
3028
+ })), header && /* @__PURE__ */ React.createElement("div", {
3029
+ className: styles[`${baseClass$3}-header`]
3030
+ }, header), /* @__PURE__ */ React.createElement("div", {
3031
+ className: styles[`${baseClass$3}-text`]
3032
+ }, text));
3033
+ };
3034
+ const baseClass$2 = "tooltip";
3035
+ const Interactive = ({
3036
+ header,
3037
+ text,
3038
+ image,
3039
+ closeWithX,
3040
+ theme,
3041
+ handleCloseAction,
3042
+ handleClickPrimary,
3043
+ handleClickSecondary
3044
+ }) => {
3045
+ const decoration = theme === "invert" ? "underline" : "none";
3046
+ return /* @__PURE__ */ React.createElement("div", {
3047
+ style: { width: "270px" }
3048
+ }, /* @__PURE__ */ React.createElement("div", {
3049
+ style: { position: "relative", height: "25px", marginBottom: "10px" }
3050
+ }, closeWithX && /* @__PURE__ */ React.createElement("div", {
3051
+ className: styles[`${baseClass$2}-close`]
3052
+ }, /* @__PURE__ */ React.createElement("div", {
3053
+ onClick: handleCloseAction
3054
+ }, /* @__PURE__ */ React.createElement(Icon, {
3055
+ source: Close,
3056
+ kind: theme ? getIconType(theme) : "primary"
3057
+ })))), image && /* @__PURE__ */ React.createElement("div", {
3058
+ style: { margin: "0 4px" }
3059
+ }, /* @__PURE__ */ React.createElement("img", {
3060
+ className: styles[`${baseClass$2}-image`],
3061
+ src: image.src,
3062
+ alt: image.alt
3063
+ })), header && /* @__PURE__ */ React.createElement("div", {
3064
+ className: styles[`${baseClass$2}-header`]
3065
+ }, header), /* @__PURE__ */ React.createElement("div", {
3066
+ className: styles[`${baseClass$2}-text`]
3067
+ }, text), /* @__PURE__ */ React.createElement("div", {
3068
+ style: { margin: "4px" }
3069
+ }, /* @__PURE__ */ React.createElement(Button, {
3070
+ kind: "primary",
3071
+ onClick: handleClickPrimary
3072
+ }, "Primary button"), /* @__PURE__ */ React.createElement("div", {
3073
+ onClick: handleClickSecondary,
3074
+ style: {
3075
+ cursor: "pointer",
3076
+ display: "inline-block",
3077
+ marginLeft: "16px",
3078
+ textDecoration: decoration
3079
+ }
3080
+ }, "Link")));
3081
+ };
3082
+ const baseClass$1 = "guide-tooltip";
3083
+ const SpotlightOverlay = ({
3084
+ gap,
3085
+ isVisible,
3086
+ slide,
3087
+ disablePointerEvents
3088
+ }) => {
3089
+ if (!gap)
3090
+ return null;
3091
+ const overlayLeft = {
3092
+ top: `${gap.top}px`,
3093
+ left: "0",
3094
+ width: `${gap.left}px`,
3095
+ height: `${gap.height}px`
3096
+ };
3097
+ const overlayRight = {
3098
+ top: `${gap.top}px`,
3099
+ left: `${gap.right}px`,
3100
+ width: `calc(100% - ${gap.right}px)`,
3101
+ height: `${gap.height}px`
3102
+ };
3103
+ const overlayTop = {
3104
+ top: "0",
3105
+ left: "0",
3106
+ width: "100%",
3107
+ height: `${gap.top}px`
3108
+ };
3109
+ const overlayBottom = {
3110
+ top: `${gap.bottom}px`,
3111
+ left: "0",
3112
+ width: "100%",
3113
+ height: `calc(100% - ${gap.bottom}px)`
3114
+ };
3115
+ const spotlight = {
3116
+ top: `${gap.top}px`,
3117
+ left: `${gap.left}px`,
3118
+ width: `${gap.width}px`,
3119
+ height: `${gap.height}px`,
3120
+ backgroundColor: "transparent"
3121
+ };
3122
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
3123
+ className: cx({
3124
+ [styles[`${baseClass$1}__overlay`]]: true,
3125
+ [styles[`${baseClass$1}__overlay--visible`]]: isVisible,
3126
+ [styles[`${baseClass$1}__overlay--slide`]]: slide
3127
+ }),
3128
+ style: overlayLeft
3129
+ }), /* @__PURE__ */ React.createElement("div", {
3130
+ className: cx({
3131
+ [styles[`${baseClass$1}__overlay`]]: true,
3132
+ [styles[`${baseClass$1}__overlay--visible`]]: isVisible,
3133
+ [styles[`${baseClass$1}__overlay--slide`]]: slide
3134
+ }),
3135
+ style: overlayTop
3136
+ }), /* @__PURE__ */ React.createElement("div", {
3137
+ className: cx({
3138
+ [styles[`${baseClass$1}__overlay`]]: true,
3139
+ [styles[`${baseClass$1}__overlay--visible`]]: isVisible,
3140
+ [styles[`${baseClass$1}__overlay--slide`]]: slide
3141
+ }),
3142
+ style: overlayRight
3143
+ }), /* @__PURE__ */ React.createElement("div", {
3144
+ className: cx({
3145
+ [styles[`${baseClass$1}__overlay`]]: true,
3146
+ [styles[`${baseClass$1}__overlay--visible`]]: isVisible,
3147
+ [styles[`${baseClass$1}__overlay--slide`]]: slide
3148
+ }),
3149
+ style: overlayBottom
3150
+ }), disablePointerEvents && /* @__PURE__ */ React.createElement("div", {
3151
+ className: cx({
3152
+ [styles[`${baseClass$1}__overlay`]]: true,
3153
+ [styles[`${baseClass$1}__overlay--visible`]]: isVisible,
3154
+ [styles[`${baseClass$1}__overlay--slide`]]: slide
3155
+ }),
3156
+ style: spotlight
3157
+ }));
3158
+ };
3159
+ class VirtualReference {
3160
+ constructor(element, padding) {
3161
+ __publicField(this, "element");
3162
+ __publicField(this, "padding");
3163
+ this.element = element;
3164
+ this.padding = padding;
3165
+ }
3166
+ addPadding(rect) {
3167
+ const x = Math.round(rect.left) - this.padding;
3168
+ const y = Math.round(rect.top) - this.padding;
3169
+ const width = Math.round(rect.width) + 2 * this.padding;
3170
+ const height = Math.round(rect.height) + 2 * this.padding;
3171
+ const top = y;
3172
+ const left = x;
3173
+ const bottom = top + height;
3174
+ const right = left + width;
3175
+ return {
3176
+ x,
3177
+ y,
3178
+ width,
3179
+ height,
3180
+ top,
3181
+ left,
3182
+ bottom,
3183
+ right
3184
+ };
3185
+ }
3186
+ getBoundingClientRect() {
3187
+ return this.addPadding(this.element.getBoundingClientRect());
3188
+ }
3189
+ get clientWidth() {
3190
+ return this.getBoundingClientRect().width;
3191
+ }
3192
+ get clientHeight() {
3193
+ return this.getBoundingClientRect().height;
3194
+ }
3195
+ }
3196
+ const spotlightPadding = 8;
3197
+ const baseClass = "guide-tooltip";
3198
+ const virtualReference = (element, padding) => new VirtualReference(element, padding);
3199
+ const UserGuide = (props) => {
3200
+ const {
3201
+ className,
3202
+ parentElementName,
3203
+ isVisible = false,
3204
+ shouldSlide = true
3205
+ } = props;
3206
+ const [parentElement, setParentElement] = React.useState(null);
3207
+ const [rect, setRect] = React.useState(null);
3208
+ const [isSliding, setIsSliding] = React.useState(shouldSlide);
3209
+ const handleViewportChange = () => {
3210
+ if (parentElement) {
3211
+ setRect(virtualReference(parentElement, spotlightPadding).getBoundingClientRect());
3212
+ setIsSliding(false);
3213
+ }
3214
+ };
3215
+ React.useEffect(() => {
3216
+ if (parentElement !== null) {
3217
+ window.addEventListener("resize", handleViewportChange);
3218
+ window.addEventListener("scroll", handleViewportChange);
3219
+ return () => {
3220
+ window.addEventListener("resize", handleViewportChange);
3221
+ window.addEventListener("resize", handleViewportChange);
3222
+ };
3223
+ }
3224
+ }, [parentElement, parentElementName]);
3225
+ React.useEffect(() => {
3226
+ if (parentElementName) {
3227
+ const element = document.querySelector(parentElementName);
3228
+ setParentElement(element);
3229
+ }
3230
+ }, [parentElementName]);
3231
+ React.useEffect(() => {
3232
+ parentElement && setRect(virtualReference(parentElement, spotlightPadding).getBoundingClientRect());
3233
+ setIsSliding(true);
3234
+ }, [parentElement]);
3235
+ return parentElement && isVisible ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(SpotlightOverlay, {
3236
+ gap: rect,
3237
+ isVisible,
3238
+ slide: isSliding,
3239
+ disablePointerEvents: true
3240
+ }), /* @__PURE__ */ React.createElement(Tooltip, __spreadProps(__spreadValues({}, props), {
3241
+ referenceElement: {
3242
+ getBoundingClientRect: () => {
3243
+ return rect;
3244
+ },
3245
+ contextElement: parentElement
3246
+ },
3247
+ arrowOffsetY: 25,
3248
+ className: cx({
3249
+ [styles[baseClass]]: true,
3250
+ [styles[`${baseClass}--slide`]]: isSliding,
3251
+ className
3252
+ })
3253
+ }), props.children)) : null;
3254
+ };
3255
+ export { ANIMATION_TIME, ActionModal, Alert, Avatar, Badge, Button, ButtonGroup, Card, Checkbox, DesignToken, EmailTagInput, FieldDescription, FieldError, FieldGroup, Form, FormField, FormGroup, Heading, Icon, Info, Input, Interactive, Link, Loader, Modal, ModalBase, ModalCloseButton, ModalPortal, NumericInput, Picker, Popover, ProgressBar, ProgressCircle, PromoBanner, RadioButton, SearchInput, ShadowToken, Simple, SpacingToken, Switch, Tab, TabsList, TabsWrapper, Tag, TagInput, Text, Toast, ToastWrapper, Tooltip, UserGuide };