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

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 +3188 -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 +13 -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 +6 -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 +129 -0
  109. package/dist/themes/dark.css.map +1 -0
  110. package/dist/themes/legacy.css +130 -0
  111. package/dist/themes/legacy.css.map +1 -0
  112. package/dist/themes/light.css +129 -0
  113. package/dist/themes/light.css.map +1 -0
  114. package/package.json +50 -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,3188 @@
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, Check, ChevronUp, ChevronDown, 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$E = "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$E], kind && styles$x[`${baseClass$E}--${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$D = "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$D], styles$w[`${baseClass$D}--${kind}`], isSmallContainer && styles$w[`${baseClass$D}--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$D}__content`]
390
+ }, /* @__PURE__ */ React.createElement(Icon, __spreadProps(__spreadValues({}, IconConfig[kind]), {
391
+ size: "large",
392
+ className: styles$w[`${baseClass$D}__content-icon`]
393
+ })), /* @__PURE__ */ React.createElement(Text, {
394
+ as: "div",
395
+ className: cx(styles$w[`${baseClass$D}__content-text`], onClose && styles$w[`${baseClass$D}__content-text--margin`])
396
+ }, children)), onClose && /* @__PURE__ */ React.createElement("button", {
397
+ type: "button",
398
+ className: styles$w[`${baseClass$D}__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$C = "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$C]]: true,
487
+ [styles$v[`${baseClass$C}--${shape}`]]: true,
488
+ [styles$v[`${baseClass$C}--${size}`]]: true,
489
+ [styles$v[`${baseClass$C}--with-rim`]]: withRim,
490
+ [`${className}`]: className
491
+ });
492
+ const mergedStatusClassNames = cx(styles$v[`${baseClass$C}__status`], styles$v[`${baseClass$C}__status--${shape}`], styles$v[`${baseClass$C}__status--${size}`], styles$v[`${baseClass$C}__status--${status}`]);
493
+ const mergedIconClassNames = cx(styles$v[`${baseClass$C}__icon`], styles$v[`${baseClass$C}__icon--${size}`]);
494
+ const mergedRimClassNames = cx(styles$v[`${baseClass$C}__rim`], styles$v[`${baseClass$C}__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$C}__rim`,
504
+ className: mergedRimClassNames
505
+ }), status && /* @__PURE__ */ React.createElement("div", {
506
+ "data-testid": `${baseClass$C}__status`,
507
+ className: mergedStatusClassNames
508
+ }), shouldDisplayImage && /* @__PURE__ */ React.createElement("img", {
509
+ className: styles$v[`${baseClass$C}__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$C}__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$B = "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$B], styles$u[`${baseClass$B}--${kind}`], styles$u[`${baseClass$B}--${size}`]);
555
+ const content = {
556
+ ["counter"]: formatCount(count, max),
557
+ ["alert"]: "!",
558
+ ["dot"]: /* @__PURE__ */ React.createElement("span", {
559
+ className: styles$u[`${baseClass$B}__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$A = "loader";
581
+ const spinnerClass = `${baseClass$A}__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$A], 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$z = "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
+ } = _h, props = __objRest(_h, [
646
+ "loading",
647
+ "disabled",
648
+ "type",
649
+ "fullWidth",
650
+ "kind",
651
+ "size",
652
+ "icon",
653
+ "iconPosition",
654
+ "loaderLabel",
655
+ "className",
656
+ "children",
657
+ "href"
658
+ ]);
659
+ const isDisabled = loading || disabled;
660
+ const Component = href ? "a" : "button";
661
+ const mergedClassNames = cx(className, styles$s[baseClass$z], styles$s[`${baseClass$z}--${kind}`], styles$s[`${baseClass$z}--${size}`], {
662
+ [styles$s[`${baseClass$z}--loading`]]: loading,
663
+ [styles$s[`${baseClass$z}--full-width`]]: fullWidth,
664
+ [styles$s[`${baseClass$z}--icon-only`]]: !children && icon2,
665
+ [styles$s[`${baseClass$z}--disabled`]]: isDisabled
666
+ });
667
+ return /* @__PURE__ */ React.createElement(Component, __spreadValues({
668
+ className: mergedClassNames,
669
+ disabled: isDisabled,
670
+ type,
671
+ href: isDisabled ? void 0 : href
672
+ }, props), loading && /* @__PURE__ */ React.createElement(Loader, {
673
+ size: "small",
674
+ label: loaderLabel,
675
+ className: styles$s[`${baseClass$z}__loader`]
676
+ }), icon2 && React.cloneElement(icon2, {
677
+ className: cx(styles$s[`${baseClass$z}__icon`], styles$s[`${baseClass$z}__icon--${iconPosition}`]),
678
+ disabled
679
+ }), /* @__PURE__ */ React.createElement("div", {
680
+ className: styles$s[`${baseClass$z}__content`]
681
+ }, children));
682
+ };
683
+ const btn = "lc-ButtonGroup-module__btn___bXPrU";
684
+ var styles$r = {
685
+ "btn-group": "lc-ButtonGroup-module__btn-group___R-lZQ",
686
+ btn,
687
+ "btn--active": "lc-ButtonGroup-module__btn--active___VAc37",
688
+ "btn--compact": "lc-ButtonGroup-module__btn--compact___t1whe",
689
+ "btn--medium": "lc-ButtonGroup-module__btn--medium___XFRBP",
690
+ "btn--large": "lc-ButtonGroup-module__btn--large___OtNUz"
691
+ };
692
+ function noop() {
693
+ }
694
+ const baseClass$y = "btn-group";
695
+ const ButtonGroup = (_i) => {
696
+ var _j = _i, {
697
+ size = "medium",
698
+ fullWidth = false,
699
+ onIndexChange = noop,
700
+ className,
701
+ children,
702
+ currentIndex,
703
+ initialIndex = -1
704
+ } = _j, restProps = __objRest(_j, [
705
+ "size",
706
+ "fullWidth",
707
+ "onIndexChange",
708
+ "className",
709
+ "children",
710
+ "currentIndex",
711
+ "initialIndex"
712
+ ]);
713
+ const mergedClassName = cx(styles$r[baseClass$y], className);
714
+ const [currentStateIndex, setCurrentStateIndex] = React.useState(initialIndex);
715
+ const isControlled = typeof currentIndex === "number";
716
+ const _currentIndex = isControlled ? currentIndex : currentStateIndex;
717
+ const handleClick = (index2, event) => {
718
+ if (!isControlled) {
719
+ setCurrentStateIndex(index2);
720
+ }
721
+ onIndexChange(index2, event);
722
+ };
723
+ return /* @__PURE__ */ React.createElement("div", __spreadValues({
724
+ role: "group",
725
+ className: mergedClassName
726
+ }, restProps), React.Children.map(children, (child, i) => React.cloneElement(child, {
727
+ fullWidth,
728
+ size,
729
+ kind: "secondary",
730
+ type: "button",
731
+ onClick: (event) => {
732
+ handleClick(i, event);
733
+ if (child.props.onClick) {
734
+ child.props.onClick(event);
735
+ }
736
+ },
737
+ className: cx(styles$r["btn"], styles$r[`btn--${size}`], i === _currentIndex && styles$r["btn--active"])
738
+ })));
739
+ };
740
+ const card = "lc-Card-module__card___GqMm2";
741
+ const card__title = "lc-Card-module__card__title___1YjAR";
742
+ const card__text = "lc-Card-module__card__text___-jYlF";
743
+ const card__img = "lc-Card-module__card__img___teLC8";
744
+ var styles$q = {
745
+ card,
746
+ card__title,
747
+ card__text,
748
+ card__img
749
+ };
750
+ const Card = (_k) => {
751
+ var _l = _k, {
752
+ img,
753
+ title,
754
+ children,
755
+ className
756
+ } = _l, restProps = __objRest(_l, [
757
+ "img",
758
+ "title",
759
+ "children",
760
+ "className"
761
+ ]);
762
+ return /* @__PURE__ */ React.createElement(Text, __spreadValues({
763
+ as: "div",
764
+ size: "md",
765
+ className: cx(styles$q["card"], className)
766
+ }, restProps), (img || title) && /* @__PURE__ */ React.createElement(Heading, {
767
+ as: "div",
768
+ size: "sm",
769
+ className: styles$q["card__title"]
770
+ }, img && /* @__PURE__ */ React.createElement("img", {
771
+ src: img,
772
+ className: styles$q["card__img"]
773
+ }), title && /* @__PURE__ */ React.createElement("div", {
774
+ className: styles$q["card__text"]
775
+ }, title)), children);
776
+ };
777
+ var styles$p = {
778
+ "field-description": "lc-FieldDescription-module__field-description___IcRDH"
779
+ };
780
+ const baseClass$x = "field-description";
781
+ const FieldDescription = (_m) => {
782
+ var _n = _m, {
783
+ children,
784
+ className = ""
785
+ } = _n, props = __objRest(_n, [
786
+ "children",
787
+ "className"
788
+ ]);
789
+ const mergedClassNames = cx(styles$p[baseClass$x], className);
790
+ return /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({
791
+ as: "span",
792
+ size: "sm"
793
+ }, props), {
794
+ className: mergedClassNames
795
+ }), children);
796
+ };
797
+ const checkbox = "lc-Checkbox-module__checkbox___G7nTf";
798
+ const checkbox__label = "lc-Checkbox-module__checkbox__label___-o01x";
799
+ const checkbox__square = "lc-Checkbox-module__checkbox__square___MHUyd";
800
+ const checkbox__checkmark = "lc-Checkbox-module__checkbox__checkmark___16pfY";
801
+ const checkbox__input = "lc-Checkbox-module__checkbox__input___YLbVF";
802
+ const checkbox__text = "lc-Checkbox-module__checkbox__text___P2SIq";
803
+ const checkbox__helper = "lc-Checkbox-module__checkbox__helper___YSJ-n";
804
+ var styles$o = {
805
+ checkbox,
806
+ checkbox__label,
807
+ checkbox__square,
808
+ checkbox__checkmark,
809
+ "checkbox--selected": "lc-Checkbox-module__checkbox--selected___S2vqY",
810
+ checkbox__input,
811
+ checkbox__text,
812
+ "checkbox--disabled": "lc-Checkbox-module__checkbox--disabled___-lAqW",
813
+ checkbox__helper
814
+ };
815
+ const baseClass$w = "checkbox";
816
+ const Checkbox = React.forwardRef((_o, ref) => {
817
+ var _p = _o, { checked, disabled, children, description, className } = _p, restInputProps = __objRest(_p, ["checked", "disabled", "children", "description", "className"]);
818
+ return /* @__PURE__ */ React.createElement("div", {
819
+ className: cx(styles$o[baseClass$w], className, {
820
+ [styles$o[`${baseClass$w}--selected`]]: checked,
821
+ [styles$o[`${baseClass$w}--disabled`]]: disabled
822
+ })
823
+ }, /* @__PURE__ */ React.createElement("label", {
824
+ className: styles$o[`${baseClass$w}__label`]
825
+ }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues({}, restInputProps), {
826
+ ref,
827
+ checked,
828
+ disabled,
829
+ className: styles$o[`${baseClass$w}__input`],
830
+ type: "checkbox"
831
+ })), /* @__PURE__ */ React.createElement("div", {
832
+ className: styles$o[`${baseClass$w}__square`]
833
+ }, /* @__PURE__ */ React.createElement(Icon, {
834
+ source: Check,
835
+ kind: "inverted",
836
+ size: "xsmall",
837
+ className: styles$o[`${baseClass$w}__checkmark`]
838
+ }))), children && /* @__PURE__ */ React.createElement(Text, {
839
+ as: "div",
840
+ size: "md",
841
+ className: styles$o[`${baseClass$w}__text`]
842
+ }, children)), description && /* @__PURE__ */ React.createElement(FieldDescription, {
843
+ className: styles$o[`${baseClass$w}__helper`]
844
+ }, description));
845
+ });
846
+ var styles$n = {
847
+ "field-error": "lc-FieldError-module__field-error___IDkPT"
848
+ };
849
+ const baseClass$v = "field-error";
850
+ const FieldError = (_q) => {
851
+ var _r = _q, {
852
+ children,
853
+ className = ""
854
+ } = _r, props = __objRest(_r, [
855
+ "children",
856
+ "className"
857
+ ]);
858
+ const mergedClassNames = cx(styles$n[baseClass$v], className);
859
+ return /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({
860
+ as: "span",
861
+ size: "sm"
862
+ }, props), {
863
+ className: mergedClassNames
864
+ }), children);
865
+ };
866
+ var styles$m = {
867
+ "field-group": "lc-FieldGroup-module__field-group___gy8lp",
868
+ "field-group--inline": "lc-FieldGroup-module__field-group--inline___or4qf",
869
+ "field-group--stretched": "lc-FieldGroup-module__field-group--stretched___6rkuO"
870
+ };
871
+ const baseClass$u = "field-group";
872
+ const FieldGroup = (_s) => {
873
+ var _t = _s, {
874
+ className = "",
875
+ children,
876
+ description,
877
+ error,
878
+ inline,
879
+ stretch
880
+ } = _t, props = __objRest(_t, [
881
+ "className",
882
+ "children",
883
+ "description",
884
+ "error",
885
+ "inline",
886
+ "stretch"
887
+ ]);
888
+ const mergedClassNames = cx(styles$m[baseClass$u], className, {
889
+ [styles$m[`${baseClass$u}--inline`]]: inline,
890
+ [styles$m[`${baseClass$u}--stretched`]]: stretch
891
+ });
892
+ return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({}, props), {
893
+ className: mergedClassNames
894
+ }), children, error && /* @__PURE__ */ React.createElement(FieldError, null, error), description && /* @__PURE__ */ React.createElement(FieldDescription, null, description));
895
+ };
896
+ const form = "lc-Form-module__form___1nOYF";
897
+ const form__header = "lc-Form-module__form__header___U4B7t";
898
+ const form__footer = "lc-Form-module__form__footer___1-sUX";
899
+ const form__label = "lc-Form-module__form__label___spg-J";
900
+ const form__helper = "lc-Form-module__form__helper___bhfwS";
901
+ var styles$l = {
902
+ form,
903
+ form__header,
904
+ form__footer,
905
+ form__label,
906
+ form__helper
907
+ };
908
+ const baseClass$t = "form";
909
+ const Form = (_u) => {
910
+ var _v = _u, {
911
+ className,
912
+ children,
913
+ labelText,
914
+ helperText,
915
+ formFooter
916
+ } = _v, restProps = __objRest(_v, [
917
+ "className",
918
+ "children",
919
+ "labelText",
920
+ "helperText",
921
+ "formFooter"
922
+ ]);
923
+ return /* @__PURE__ */ React.createElement("form", __spreadValues({
924
+ className: cx(styles$l[baseClass$t], className)
925
+ }, restProps), (labelText || helperText) && /* @__PURE__ */ React.createElement("div", {
926
+ className: styles$l[`${baseClass$t}__header`]
927
+ }, labelText && /* @__PURE__ */ React.createElement(Heading, {
928
+ size: "sm",
929
+ className: styles$l[`${baseClass$t}__label`]
930
+ }, labelText), helperText && /* @__PURE__ */ React.createElement(Text, {
931
+ as: "p",
932
+ size: "sm",
933
+ className: styles$l[`${baseClass$t}__helper`]
934
+ }, helperText)), children, formFooter && /* @__PURE__ */ React.createElement("div", {
935
+ className: styles$l[`${baseClass$t}__footer`]
936
+ }, formFooter));
937
+ };
938
+ var styles$k = {
939
+ "form-field": "lc-FormField-module__form-field___JqnX6",
940
+ "form-field--inline": "lc-FormField-module__form-field--inline___4DgIq",
941
+ "form-field__wrapper--inline": "lc-FormField-module__form-field__wrapper--inline___Ubvrn",
942
+ "form-field__label": "lc-FormField-module__form-field__label___hNCFS",
943
+ "form-field__label--inline": "lc-FormField-module__form-field__label--inline___QxyM6",
944
+ "form-field__label--no-text": "lc-FormField-module__form-field__label--no-text___Ohs-I",
945
+ "form-field__label-wrapper": "lc-FormField-module__form-field__label-wrapper___61-NO",
946
+ "form-field__label-adornment": "lc-FormField-module__form-field__label-adornment___HB0z7",
947
+ "form-field__label-left-node": "lc-FormField-module__form-field__label-left-node___dvipB",
948
+ "form-field__label-right-node": "lc-FormField-module__form-field__label-right-node___LR-03",
949
+ "form-field__label-right-node--inline": "lc-FormField-module__form-field__label-right-node--inline___BkiPG",
950
+ "form-field__row-break": "lc-FormField-module__form-field__row-break___DCBjC",
951
+ "form-field__content": "lc-FormField-module__form-field__content___XaOx3"
952
+ };
953
+ const baseClass$s = "form-field";
954
+ const FormField = ({
955
+ inline,
956
+ error,
957
+ description,
958
+ labelText,
959
+ labelAdornment,
960
+ className,
961
+ labelFor,
962
+ children,
963
+ labelRightNode
964
+ }) => {
965
+ const mergedClassNames = cx(styles$k[baseClass$s], {
966
+ [styles$k[`${baseClass$s}--inline`]]: inline
967
+ }, className);
968
+ return /* @__PURE__ */ React.createElement("div", {
969
+ className: mergedClassNames
970
+ }, labelRightNode && inline && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
971
+ className: cx(styles$k[`${baseClass$s}__label-right-node`], styles$k[`${baseClass$s}__label-right-node--inline`])
972
+ }, labelRightNode), /* @__PURE__ */ React.createElement("div", {
973
+ className: styles$k[`${baseClass$s}__row-break`]
974
+ })), /* @__PURE__ */ React.createElement("div", {
975
+ className: cx(styles$k[`${baseClass$s}__wrapper`], inline && styles$k[`${baseClass$s}__wrapper--inline`])
976
+ }, (labelText || labelRightNode) && /* @__PURE__ */ React.createElement("div", {
977
+ className: cx(styles$k[`${baseClass$s}__label`], inline && styles$k[`${baseClass$s}__label--inline`], !labelText && styles$k[`${baseClass$s}__label--no-text`])
978
+ }, labelText && /* @__PURE__ */ React.createElement("div", {
979
+ className: cx(styles$k[`${baseClass$s}__label-wrapper`])
980
+ }, /* @__PURE__ */ React.createElement("label", {
981
+ className: styles$k[`${baseClass$s}__label-left-node`],
982
+ htmlFor: labelFor
983
+ }, /* @__PURE__ */ React.createElement(Text, {
984
+ as: "span",
985
+ size: "sm"
986
+ }, labelText)), labelAdornment && /* @__PURE__ */ React.createElement("div", {
987
+ className: cx(styles$k[`${baseClass$s}__label-adornment`])
988
+ }, labelAdornment)), labelRightNode && !inline && /* @__PURE__ */ React.createElement("div", {
989
+ className: cx(styles$k[`${baseClass$s}__label-right-node`])
990
+ }, labelRightNode)), /* @__PURE__ */ React.createElement("div", {
991
+ className: cx(styles$k[`${baseClass$s}__content`])
992
+ }, children, error && /* @__PURE__ */ React.createElement(FieldError, null, error), description && /* @__PURE__ */ React.createElement(FieldDescription, null, description))));
993
+ };
994
+ var styles$j = {
995
+ "form-group": "lc-FormGroup-module__form-group___e2JHa",
996
+ "form-group__header": "lc-FormGroup-module__form-group__header___DgGmR",
997
+ "form-group__label": "lc-FormGroup-module__form-group__label___NC-JW",
998
+ "form-group__helper": "lc-FormGroup-module__form-group__helper___SRuxe"
999
+ };
1000
+ const baseClass$r = "form-group";
1001
+ const FormGroup = (_w) => {
1002
+ var _x = _w, {
1003
+ className = "",
1004
+ children,
1005
+ labelText,
1006
+ helperText
1007
+ } = _x, props = __objRest(_x, [
1008
+ "className",
1009
+ "children",
1010
+ "labelText",
1011
+ "helperText"
1012
+ ]);
1013
+ const mergedClassNames = cx(styles$j[baseClass$r], className);
1014
+ return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
1015
+ role: "group"
1016
+ }), labelText && { "aria-label": labelText }), {
1017
+ className: mergedClassNames
1018
+ }), /* @__PURE__ */ React.createElement("div", {
1019
+ className: styles$j[`${baseClass$r}__header`]
1020
+ }, /* @__PURE__ */ React.createElement(Heading, {
1021
+ as: "div",
1022
+ size: "sm",
1023
+ className: styles$j[`${baseClass$r}__label`]
1024
+ }, labelText), helperText && /* @__PURE__ */ React.createElement(Text, {
1025
+ as: "div",
1026
+ size: "sm",
1027
+ className: styles$j[`${baseClass$r}__helper`]
1028
+ }, helperText)), children);
1029
+ };
1030
+ const input = "lc-Input-module__input___qeMAQ";
1031
+ var styles$i = {
1032
+ input,
1033
+ "input--error": "lc-Input-module__input--error___DlDbC",
1034
+ "input--xsmall": "lc-Input-module__input--xsmall___9u99K",
1035
+ "input--small": "lc-Input-module__input--small___elNtF",
1036
+ "input--medium": "lc-Input-module__input--medium___3BjqQ",
1037
+ "input--large": "lc-Input-module__input--large___jX5RW"
1038
+ };
1039
+ const baseClass$q = "input";
1040
+ const Input = React.forwardRef((_y, ref) => {
1041
+ var _z = _y, { size = "medium", error = false, className } = _z, inputProps = __objRest(_z, ["size", "error", "className"]);
1042
+ return /* @__PURE__ */ React.createElement("input", __spreadValues({
1043
+ className: cx(className, styles$i[baseClass$q], styles$i[`${baseClass$q}--${size}`], {
1044
+ [styles$i[`${baseClass$q}--error`]]: error
1045
+ }),
1046
+ type: "text",
1047
+ ref
1048
+ }, inputProps));
1049
+ });
1050
+ const link = "lc-Link-module__link___kqx52";
1051
+ var styles$h = {
1052
+ link,
1053
+ "link--bold": "lc-Link-module__link--bold___1rGdO"
1054
+ };
1055
+ const baseClass$p = "link";
1056
+ const Link = (_A) => {
1057
+ var _B = _A, {
1058
+ bold = false,
1059
+ className = ""
1060
+ } = _B, rest = __objRest(_B, [
1061
+ "bold",
1062
+ "className"
1063
+ ]);
1064
+ return /* @__PURE__ */ React.createElement("a", __spreadValues({
1065
+ className: cx(styles$h[baseClass$p], bold && styles$h[`${baseClass$p}--bold`], className)
1066
+ }, rest));
1067
+ };
1068
+ const modal__header = "lc-Modal-module__modal__header___Fp5VE";
1069
+ const modal__heading = "lc-Modal-module__modal__heading___G9KVK";
1070
+ const modal__body = "lc-Modal-module__modal__body___M-jmN";
1071
+ const modal__footer = "lc-Modal-module__modal__footer___2LYdc";
1072
+ var styles$g = {
1073
+ "modal-base": "lc-Modal-module__modal-base___hbL1U",
1074
+ "modal-base__overlay": "lc-Modal-module__modal-base__overlay___kCQ8t",
1075
+ "modal-base__overlay--visible": "lc-Modal-module__modal-base__overlay--visible___zUNJL",
1076
+ "modal-base__close": "lc-Modal-module__modal-base__close___gJlgr",
1077
+ modal__header,
1078
+ modal__heading,
1079
+ modal__body,
1080
+ modal__footer,
1081
+ "action-modal": "lc-Modal-module__action-modal___CsRC7",
1082
+ "action-modal__heading": "lc-Modal-module__action-modal__heading___m3MuG",
1083
+ "action-modal__content": "lc-Modal-module__action-modal__content___gf-R2",
1084
+ "action-modal__actions": "lc-Modal-module__action-modal__actions___kpRXD",
1085
+ "action-modal__icon": "lc-Modal-module__action-modal__icon___MK5xt"
1086
+ };
1087
+ const ModalCloseButton = ({
1088
+ onClick
1089
+ }) => /* @__PURE__ */ React.createElement("button", {
1090
+ title: "Close modal",
1091
+ className: styles$g["modal-base__close"],
1092
+ onClick,
1093
+ type: "button"
1094
+ }, /* @__PURE__ */ React.createElement(Icon, {
1095
+ source: Close,
1096
+ size: "large"
1097
+ }));
1098
+ const KeyCodes = {
1099
+ esc: "Escape",
1100
+ enter: "Enter",
1101
+ backspace: "Backspace",
1102
+ delete: "Delete",
1103
+ spacebar: " ",
1104
+ tab: "Tab",
1105
+ semicolon: ";",
1106
+ comma: ",",
1107
+ arrowUp: "ArrowUp",
1108
+ arrowDown: "ArrowDown"
1109
+ };
1110
+ const baseClass$o = "modal-base";
1111
+ const ModalBase = (_C) => {
1112
+ var _D = _C, {
1113
+ children,
1114
+ className = "",
1115
+ onClose,
1116
+ closeOnEscPress = true
1117
+ } = _D, props = __objRest(_D, [
1118
+ "children",
1119
+ "className",
1120
+ "onClose",
1121
+ "closeOnEscPress"
1122
+ ]);
1123
+ const mergedClassNames = cx(styles$g[baseClass$o], className);
1124
+ React.useEffect(() => {
1125
+ if (!closeOnEscPress) {
1126
+ return;
1127
+ }
1128
+ const onKeyUp = (event) => {
1129
+ if (event.key === KeyCodes.esc) {
1130
+ onClose();
1131
+ }
1132
+ };
1133
+ document.addEventListener("keyup", onKeyUp, true);
1134
+ return () => document.removeEventListener("keyup", onKeyUp, true);
1135
+ }, [closeOnEscPress]);
1136
+ const onOverlayClick = (event) => {
1137
+ if (event.target === event.currentTarget) {
1138
+ onClose();
1139
+ }
1140
+ };
1141
+ const onCloseButtonClick = (event) => {
1142
+ event.preventDefault();
1143
+ event.stopPropagation();
1144
+ onClose();
1145
+ };
1146
+ return /* @__PURE__ */ React.createElement("div", {
1147
+ "data-testid": "lc-modal-overlay",
1148
+ onMouseDown: onOverlayClick,
1149
+ className: cx(styles$g[`${baseClass$o}__overlay`], styles$g[`${baseClass$o}__overlay--visible`])
1150
+ }, /* @__PURE__ */ React.createElement("div", __spreadValues({
1151
+ className: mergedClassNames
1152
+ }, props), /* @__PURE__ */ React.createElement(ModalCloseButton, {
1153
+ onClick: onCloseButtonClick
1154
+ }), children));
1155
+ };
1156
+ const baseClass$n = "action-modal";
1157
+ const ActionModal = (_E) => {
1158
+ var _F = _E, {
1159
+ children,
1160
+ className = "",
1161
+ icon: icon2,
1162
+ heading,
1163
+ actions
1164
+ } = _F, props = __objRest(_F, [
1165
+ "children",
1166
+ "className",
1167
+ "icon",
1168
+ "heading",
1169
+ "actions"
1170
+ ]);
1171
+ const mergedClassNames = cx(styles$g[baseClass$n], className);
1172
+ return /* @__PURE__ */ React.createElement(ModalBase, __spreadValues({
1173
+ className: mergedClassNames
1174
+ }, props), icon2 && /* @__PURE__ */ React.createElement("div", {
1175
+ className: styles$g[`${baseClass$n}__icon`]
1176
+ }, icon2), heading && /* @__PURE__ */ React.createElement("div", {
1177
+ className: styles$g[`${baseClass$n}__heading`]
1178
+ }, heading), /* @__PURE__ */ React.createElement("div", {
1179
+ className: styles$g[`${baseClass$n}__content`]
1180
+ }, children), actions && /* @__PURE__ */ React.createElement("div", {
1181
+ className: styles$g[`${baseClass$n}__actions`]
1182
+ }, actions));
1183
+ };
1184
+ const baseClass$m = "modal";
1185
+ const Modal = (_G) => {
1186
+ var _H = _G, {
1187
+ children,
1188
+ className = "",
1189
+ heading,
1190
+ footer
1191
+ } = _H, props = __objRest(_H, [
1192
+ "children",
1193
+ "className",
1194
+ "heading",
1195
+ "footer"
1196
+ ]);
1197
+ const mergedClassNames = cx(styles$g[baseClass$m], className);
1198
+ return /* @__PURE__ */ React.createElement(ModalBase, __spreadValues({
1199
+ className: mergedClassNames
1200
+ }, props), heading && /* @__PURE__ */ React.createElement("div", {
1201
+ className: styles$g[`${baseClass$m}__header`]
1202
+ }, /* @__PURE__ */ React.createElement(Heading, {
1203
+ size: "sm",
1204
+ as: "div",
1205
+ className: styles$g[`${baseClass$m}__heading`]
1206
+ }, heading)), /* @__PURE__ */ React.createElement("div", {
1207
+ className: styles$g[`${baseClass$m}__body`]
1208
+ }, children), footer && /* @__PURE__ */ React.createElement("div", {
1209
+ className: styles$g[`${baseClass$m}__footer`]
1210
+ }, footer));
1211
+ };
1212
+ const ModalPortal = ({
1213
+ children,
1214
+ className = "",
1215
+ parentElementName = "body",
1216
+ zIndex
1217
+ }) => {
1218
+ const [container] = React.useState(() => document.createElement("div"));
1219
+ if (className) {
1220
+ container.classList.add(className);
1221
+ }
1222
+ if (zIndex) {
1223
+ container.style.zIndex = zIndex.toString();
1224
+ }
1225
+ React.useEffect(() => {
1226
+ var _a;
1227
+ (_a = document.querySelector(parentElementName)) == null ? void 0 : _a.appendChild(container);
1228
+ return () => {
1229
+ var _a2;
1230
+ (_a2 = document.querySelector(parentElementName)) == null ? void 0 : _a2.removeChild(container);
1231
+ };
1232
+ }, [parentElementName]);
1233
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, ReactDOM.createPortal(children, container));
1234
+ };
1235
+ var styles$f = {
1236
+ "numeric-input": "lc-NumericInput-module__numeric-input___j1esc",
1237
+ "numeric-input__increment": "lc-NumericInput-module__numeric-input__increment___i3Tys",
1238
+ "numeric-input__decrement": "lc-NumericInput-module__numeric-input__decrement___3qgn0",
1239
+ "numeric-input--disabled": "lc-NumericInput-module__numeric-input--disabled___yaRvQ",
1240
+ "numeric-input--no-controls": "lc-NumericInput-module__numeric-input--no-controls___D90rG",
1241
+ "numeric-input--error": "lc-NumericInput-module__numeric-input--error___TMxRx"
1242
+ };
1243
+ const baseClass$l = "numeric-input";
1244
+ const NumericInput = (_I) => {
1245
+ var _J = _I, {
1246
+ className,
1247
+ error,
1248
+ value,
1249
+ max,
1250
+ min,
1251
+ disabled,
1252
+ noControls,
1253
+ style,
1254
+ onChange
1255
+ } = _J, restProps = __objRest(_J, [
1256
+ "className",
1257
+ "error",
1258
+ "value",
1259
+ "max",
1260
+ "min",
1261
+ "disabled",
1262
+ "noControls",
1263
+ "style",
1264
+ "onChange"
1265
+ ]);
1266
+ const inputRef = React.useRef(null);
1267
+ const mergedClassNames = cx(styles$f[baseClass$l], {
1268
+ [styles$f[`${baseClass$l}--error`]]: error,
1269
+ [styles$f[`${baseClass$l}--no-controls`]]: noControls,
1270
+ [styles$f[`${baseClass$l}--disabled`]]: disabled
1271
+ }, className);
1272
+ const callOnChange = (val) => onChange(String(val));
1273
+ const calcValue = (val) => {
1274
+ if (max !== void 0 && val > max) {
1275
+ return max;
1276
+ }
1277
+ if (min !== void 0 && val < min) {
1278
+ return min;
1279
+ }
1280
+ return val;
1281
+ };
1282
+ const updateValue = (val) => {
1283
+ const newValue = parseInt(value, 10) + val;
1284
+ return callOnChange(calcValue(newValue));
1285
+ };
1286
+ const onKeyDown = (e) => {
1287
+ if (e.key === KeyCodes.arrowDown) {
1288
+ e.preventDefault();
1289
+ updateValue(-1);
1290
+ }
1291
+ if (e.key === KeyCodes.arrowUp) {
1292
+ e.preventDefault();
1293
+ updateValue(1);
1294
+ }
1295
+ };
1296
+ const hasReachedTheLimit = (value2, margin) => margin !== void 0 && parseInt(value2, 10) === margin;
1297
+ const handleOnChange = (e) => {
1298
+ e.preventDefault();
1299
+ e.stopPropagation();
1300
+ const inputVal = e.currentTarget.value.replace(/((?!([-]|([-]?\d+))).)/, "");
1301
+ if (inputVal === "" || inputVal === "-") {
1302
+ return callOnChange(inputVal);
1303
+ }
1304
+ const newValue = parseInt(inputVal, 10);
1305
+ return callOnChange(calcValue(newValue));
1306
+ };
1307
+ const handleIncrementClick = () => {
1308
+ var _a;
1309
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
1310
+ return updateValue(1);
1311
+ };
1312
+ const handleDecrementClick = () => {
1313
+ var _a;
1314
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
1315
+ return updateValue(-1);
1316
+ };
1317
+ return /* @__PURE__ */ React.createElement("div", {
1318
+ className: mergedClassNames,
1319
+ style
1320
+ }, /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues({
1321
+ type: "text",
1322
+ ref: inputRef
1323
+ }, restProps), {
1324
+ value,
1325
+ disabled,
1326
+ onChange: handleOnChange,
1327
+ onKeyDown,
1328
+ min,
1329
+ max
1330
+ })), !noControls && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("button", {
1331
+ tabIndex: -1,
1332
+ disabled: disabled || hasReachedTheLimit(value, max),
1333
+ onClick: handleIncrementClick,
1334
+ "aria-label": "Increment value",
1335
+ className: styles$f[`${baseClass$l}__increment`],
1336
+ type: "button"
1337
+ }, /* @__PURE__ */ React.createElement(Icon, {
1338
+ source: ChevronUp,
1339
+ disabled: disabled || hasReachedTheLimit(value, max),
1340
+ kind: "primary"
1341
+ })), /* @__PURE__ */ React.createElement("button", {
1342
+ tabIndex: -1,
1343
+ disabled: disabled || hasReachedTheLimit(value, min),
1344
+ "aria-label": "Decrement value",
1345
+ className: styles$f[`${baseClass$l}__decrement`],
1346
+ onClick: handleDecrementClick,
1347
+ type: "button"
1348
+ }, /* @__PURE__ */ React.createElement(Icon, {
1349
+ source: ChevronDown,
1350
+ kind: "primary",
1351
+ disabled: disabled || hasReachedTheLimit(value, min)
1352
+ }))));
1353
+ };
1354
+ var styles$e = {
1355
+ "picker-trigger": "lc-Trigger-module__picker-trigger___BIvTx",
1356
+ "picker-trigger--compact": "lc-Trigger-module__picker-trigger--compact___3i1DL",
1357
+ "picker-trigger--medium": "lc-Trigger-module__picker-trigger--medium___-fbEx",
1358
+ "picker-trigger--large": "lc-Trigger-module__picker-trigger--large___C8qkZ",
1359
+ "picker-trigger__text": "lc-Trigger-module__picker-trigger__text___9cWZO",
1360
+ "picker-trigger--disabled": "lc-Trigger-module__picker-trigger--disabled___7H4tD",
1361
+ "picker-trigger--focused": "lc-Trigger-module__picker-trigger--focused___vTr39",
1362
+ "picker-trigger--error": "lc-Trigger-module__picker-trigger--error___Rh8Qd",
1363
+ "picker-trigger__input": "lc-Trigger-module__picker-trigger__input___GGc12"
1364
+ };
1365
+ const baseClass$k = "picker-trigger";
1366
+ const Trigger = ({
1367
+ children,
1368
+ isSearchDisabled,
1369
+ isDisabled,
1370
+ isError,
1371
+ isItemSelected,
1372
+ isOpen,
1373
+ isRequired,
1374
+ size = "medium",
1375
+ onClick,
1376
+ onClearClick,
1377
+ onFilter
1378
+ }) => {
1379
+ const triggerRef = React.useRef(null);
1380
+ 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`]);
1381
+ React.useEffect(() => {
1382
+ const onKeyDown = (e) => {
1383
+ const isFocused = document.activeElement === triggerRef.current;
1384
+ if (isFocused && e.key !== KeyCodes.tab) {
1385
+ onClick();
1386
+ }
1387
+ };
1388
+ if (!isSearchDisabled) {
1389
+ document.addEventListener("keydown", onKeyDown);
1390
+ }
1391
+ return () => {
1392
+ if (!isSearchDisabled) {
1393
+ document.removeEventListener("keydown", onKeyDown);
1394
+ }
1395
+ };
1396
+ }, [isSearchDisabled]);
1397
+ const handleTriggerClick = () => {
1398
+ onClick();
1399
+ };
1400
+ const handleOnClearClick = (e) => {
1401
+ e.stopPropagation();
1402
+ onClearClick();
1403
+ };
1404
+ const handleOnChange = (e) => {
1405
+ onFilter(e.target.value);
1406
+ };
1407
+ return /* @__PURE__ */ React.createElement("div", {
1408
+ ref: triggerRef,
1409
+ className: mergedClassNames,
1410
+ onClick: handleTriggerClick,
1411
+ tabIndex: 0
1412
+ }, isOpen && !isSearchDisabled ? /* @__PURE__ */ React.createElement("input", {
1413
+ className: styles$e[`${baseClass$k}__input`],
1414
+ placeholder: "Select option",
1415
+ onChange: handleOnChange,
1416
+ autoFocus: true
1417
+ }) : /* @__PURE__ */ React.createElement("div", {
1418
+ className: styles$e[`${baseClass$k}__text`]
1419
+ }, children), isItemSelected && !isDisabled && !isRequired && /* @__PURE__ */ React.createElement("div", {
1420
+ "data-testid": `${baseClass$k}__clear-icon`,
1421
+ className: styles$e[`${baseClass$k}__clear-icon`],
1422
+ onClick: handleOnClearClick
1423
+ }, /* @__PURE__ */ React.createElement(Icon, {
1424
+ kind: "link",
1425
+ source: Close
1426
+ })), /* @__PURE__ */ React.createElement(Icon, {
1427
+ className: styles$e[`${baseClass$k}__chevron-icon`],
1428
+ source: !isOpen ? ChevronDown : ChevronUp,
1429
+ size: "large",
1430
+ disabled: isDisabled
1431
+ }));
1432
+ };
1433
+ var styles$d = {
1434
+ "picker-list": "lc-PickerList-module__picker-list___FqdgZ",
1435
+ "picker-list--compact": "lc-PickerList-module__picker-list--compact___F-cAF",
1436
+ "picker-list--medium": "lc-PickerList-module__picker-list--medium___9B1DT",
1437
+ "picker-list--large": "lc-PickerList-module__picker-list--large___8-Q-N",
1438
+ "picker-list__no-results": "lc-PickerList-module__picker-list__no-results___tX172",
1439
+ "picker-list__item": "lc-PickerList-module__picker-list__item___8QNS0",
1440
+ "picker-list__item__header": "lc-PickerList-module__picker-list__item__header___mxmg0"
1441
+ };
1442
+ const baseClass$j = "picker-list";
1443
+ const itemClassName = `${baseClass$j}__item`;
1444
+ const PickerList = ({
1445
+ isOpen,
1446
+ items,
1447
+ selectedItem,
1448
+ size = "medium",
1449
+ emptyStateText = "No results found",
1450
+ onClose,
1451
+ onSelect
1452
+ }) => {
1453
+ const mergedClassNames = cx(styles$d[baseClass$j], styles$d[`${baseClass$j}--${size}`], {
1454
+ [styles$d[`${baseClass$j}__no-results`]]: items.length === 0
1455
+ });
1456
+ const [currentItemKey, setCurrentItemKey] = React.useState(null);
1457
+ const indexRef = React.useRef(-1);
1458
+ const lastIndexRef = React.useRef(0);
1459
+ const listRef = React.useRef(null);
1460
+ React.useEffect(() => {
1461
+ if (indexRef.current > -1 && items.length > 0) {
1462
+ setCurrentItemKey(items[indexRef.current].key);
1463
+ }
1464
+ if (isOpen) {
1465
+ document.addEventListener("keydown", onKeyDown);
1466
+ return () => document.removeEventListener("keydown", onKeyDown);
1467
+ } else {
1468
+ indexRef.current = -1;
1469
+ lastIndexRef.current = 0;
1470
+ setCurrentItemKey(null);
1471
+ }
1472
+ }, [items, isOpen]);
1473
+ const isHeaderOrDisabled = (i) => !!items[i] && (items[i].disabled || items[i].groupHeader);
1474
+ const getPrevItemIndex = () => {
1475
+ indexRef.current = indexRef.current - 1;
1476
+ while (isHeaderOrDisabled(indexRef.current)) {
1477
+ indexRef.current = indexRef.current - 1;
1478
+ if (!isHeaderOrDisabled(indexRef.current)) {
1479
+ break;
1480
+ }
1481
+ }
1482
+ lastIndexRef.current = indexRef.current;
1483
+ return indexRef.current;
1484
+ };
1485
+ const getNextItemIndex = () => {
1486
+ indexRef.current = indexRef.current + 1;
1487
+ if (!isHeaderOrDisabled(indexRef.current)) {
1488
+ lastIndexRef.current = indexRef.current;
1489
+ return indexRef.current;
1490
+ }
1491
+ while (isHeaderOrDisabled(indexRef.current)) {
1492
+ indexRef.current = indexRef.current + 1;
1493
+ if (indexRef.current === items.length && !isHeaderOrDisabled(indexRef.current)) {
1494
+ return lastIndexRef.current;
1495
+ }
1496
+ if (!isHeaderOrDisabled(indexRef.current)) {
1497
+ break;
1498
+ }
1499
+ }
1500
+ lastIndexRef.current = indexRef.current;
1501
+ return indexRef.current;
1502
+ };
1503
+ const onKeyDown = (e) => {
1504
+ if (e.key === KeyCodes.esc) {
1505
+ e.preventDefault();
1506
+ onClose();
1507
+ }
1508
+ if (e.key === KeyCodes.arrowUp && indexRef.current > 0) {
1509
+ e.preventDefault();
1510
+ indexRef.current = getPrevItemIndex();
1511
+ setCurrentItemKey(items[indexRef.current].key);
1512
+ }
1513
+ if (e.key === KeyCodes.arrowDown && indexRef.current + 1 < items.length) {
1514
+ e.preventDefault();
1515
+ indexRef.current = getNextItemIndex();
1516
+ setCurrentItemKey(items[indexRef.current].key);
1517
+ }
1518
+ if (e.key === KeyCodes.enter && !items[indexRef.current].disabled) {
1519
+ e.preventDefault();
1520
+ onSelect(items[indexRef.current]);
1521
+ }
1522
+ };
1523
+ const handleOnClick = (item) => onSelect(item);
1524
+ const isItemSelected = (key) => !!selectedItem && key === selectedItem.key;
1525
+ if (!isOpen) {
1526
+ return null;
1527
+ }
1528
+ if (items.length === 0) {
1529
+ return /* @__PURE__ */ React.createElement("div", {
1530
+ className: mergedClassNames
1531
+ }, emptyStateText);
1532
+ }
1533
+ return /* @__PURE__ */ React.createElement("ul", {
1534
+ ref: listRef,
1535
+ className: mergedClassNames,
1536
+ role: "listbox",
1537
+ tabIndex: -1
1538
+ }, items.map((item) => {
1539
+ if (item.groupHeader) {
1540
+ return /* @__PURE__ */ React.createElement("li", {
1541
+ role: "option",
1542
+ key: item.key,
1543
+ className: styles$d[`${itemClassName}__header`]
1544
+ }, item.name);
1545
+ }
1546
+ return /* @__PURE__ */ React.createElement("li", {
1547
+ ref: (element) => {
1548
+ if (currentItemKey === item.key) {
1549
+ element == null ? void 0 : element.scrollIntoView({ block: "nearest" });
1550
+ }
1551
+ },
1552
+ role: "option",
1553
+ "aria-current": currentItemKey === item.key,
1554
+ "aria-selected": isItemSelected(item.key),
1555
+ "aria-disabled": item.disabled,
1556
+ id: item.key,
1557
+ key: item.key,
1558
+ className: styles$d[itemClassName],
1559
+ onClick: () => !item.disabled && handleOnClick(item)
1560
+ }, item.name, isItemSelected(item.key) && /* @__PURE__ */ React.createElement(Icon, {
1561
+ kind: "link",
1562
+ source: Check
1563
+ }));
1564
+ }));
1565
+ };
1566
+ const picker = "lc-Picker-module__picker___GRj9W";
1567
+ const picker__container = "lc-Picker-module__picker__container___s0PUc";
1568
+ const picker__label = "lc-Picker-module__picker__label___Ac7Vu";
1569
+ const picker__error = "lc-Picker-module__picker__error___H865k";
1570
+ const picker__error__icon = "lc-Picker-module__picker__error__icon___bbL7r";
1571
+ var styles$c = {
1572
+ picker,
1573
+ picker__container,
1574
+ picker__label,
1575
+ "picker__label--disabled": "lc-Picker-module__picker__label--disabled___Opu7s",
1576
+ picker__error,
1577
+ picker__error__icon
1578
+ };
1579
+ const baseClass$i = "picker";
1580
+ const Picker = ({
1581
+ disabled,
1582
+ error,
1583
+ label,
1584
+ options,
1585
+ selectedOption,
1586
+ size = "medium",
1587
+ placeholder = "Select option",
1588
+ isRequired,
1589
+ noSearchResultText = "No results found",
1590
+ searchDisabled = false,
1591
+ onSelect
1592
+ }) => {
1593
+ const [isListOpen, setIsListOpen] = React.useState(false);
1594
+ const [selectedItem, setSelectedItem] = React.useState(selectedOption || null);
1595
+ const [searchPhrase, setSearchPhrase] = React.useState(null);
1596
+ const triggerRef = React.useRef(null);
1597
+ React.useEffect(() => {
1598
+ if (isListOpen) {
1599
+ const onDocumentClick = (e) => {
1600
+ var _a;
1601
+ if (!((_a = triggerRef.current) == null ? void 0 : _a.contains(e.target))) {
1602
+ setIsListOpen(false);
1603
+ }
1604
+ };
1605
+ const onKeyDown = (e) => {
1606
+ if (e.key === KeyCodes.tab) {
1607
+ setIsListOpen(false);
1608
+ }
1609
+ };
1610
+ document.addEventListener("mousedown", onDocumentClick);
1611
+ document.addEventListener("keydown", onKeyDown);
1612
+ return () => {
1613
+ document.removeEventListener("mousedown", onDocumentClick);
1614
+ document.addEventListener("keydown", onKeyDown);
1615
+ };
1616
+ } else {
1617
+ setSearchPhrase(null);
1618
+ }
1619
+ }, [isListOpen]);
1620
+ const handleOnTriggerClick = () => {
1621
+ if (disabled) {
1622
+ return;
1623
+ }
1624
+ return setIsListOpen((prev) => !prev);
1625
+ };
1626
+ const handleOnClose = () => {
1627
+ setIsListOpen(false);
1628
+ };
1629
+ const handleOnSelect = (item) => {
1630
+ setIsListOpen(false);
1631
+ setSelectedItem(item);
1632
+ onSelect(item);
1633
+ };
1634
+ const handleOnClearClick = () => {
1635
+ setIsListOpen(false);
1636
+ setSelectedItem(null);
1637
+ onSelect(null);
1638
+ };
1639
+ const handleOnFilter = (text) => setSearchPhrase(text);
1640
+ const items = React.useMemo(() => {
1641
+ if (!searchPhrase) {
1642
+ return options;
1643
+ }
1644
+ return options.filter((item) => {
1645
+ if (item.groupHeader) {
1646
+ return false;
1647
+ }
1648
+ const search = searchPhrase.toLowerCase();
1649
+ const itemName = item.name.toLowerCase();
1650
+ return itemName.includes(search);
1651
+ });
1652
+ }, [searchPhrase]);
1653
+ return /* @__PURE__ */ React.createElement("div", {
1654
+ ref: triggerRef,
1655
+ className: styles$c[baseClass$i]
1656
+ }, label && /* @__PURE__ */ React.createElement("div", {
1657
+ className: cx(styles$c[`${baseClass$i}__label`], {
1658
+ [styles$c[`${baseClass$i}__label--disabled`]]: disabled
1659
+ })
1660
+ }, label), /* @__PURE__ */ React.createElement("div", {
1661
+ className: styles$c[`${baseClass$i}__container`]
1662
+ }, /* @__PURE__ */ React.createElement(Trigger, {
1663
+ isSearchDisabled: searchDisabled,
1664
+ isError: !!error,
1665
+ isOpen: isListOpen,
1666
+ isDisabled: disabled,
1667
+ isItemSelected: !!selectedItem,
1668
+ isRequired,
1669
+ size,
1670
+ onClick: handleOnTriggerClick,
1671
+ onClearClick: handleOnClearClick,
1672
+ onFilter: handleOnFilter
1673
+ }, selectedItem ? selectedItem.name : placeholder), /* @__PURE__ */ React.createElement(PickerList, {
1674
+ selectedItem,
1675
+ items,
1676
+ isOpen: isListOpen,
1677
+ size,
1678
+ emptyStateText: noSearchResultText,
1679
+ onClose: handleOnClose,
1680
+ onSelect: handleOnSelect
1681
+ })), error && /* @__PURE__ */ React.createElement("div", {
1682
+ className: styles$c[`${baseClass$i}__error`]
1683
+ }, /* @__PURE__ */ React.createElement(Icon, {
1684
+ className: styles$c[`${baseClass$i}__error__icon`],
1685
+ source: Error2,
1686
+ kind: "error",
1687
+ size: "small"
1688
+ }), error));
1689
+ };
1690
+ const popover = "lc-Popover-module__popover___8X1b2";
1691
+ var cssStyles = {
1692
+ popover,
1693
+ "popover--visible": "lc-Popover-module__popover--visible___u5NXB"
1694
+ };
1695
+ const Popover = (props) => {
1696
+ const {
1697
+ triggerRenderer,
1698
+ children,
1699
+ className,
1700
+ placement,
1701
+ isVisible = false
1702
+ } = props;
1703
+ const [visible, setVisibility] = React.useState(false);
1704
+ const {
1705
+ x,
1706
+ y,
1707
+ reference,
1708
+ floating,
1709
+ strategy,
1710
+ refs,
1711
+ update,
1712
+ placement: updatedPlacement
1713
+ } = useFloating({
1714
+ middleware: [offset(4), flip()],
1715
+ placement
1716
+ });
1717
+ React.useEffect(() => {
1718
+ setVisibility(isVisible);
1719
+ }, [isVisible]);
1720
+ React.useEffect(() => {
1721
+ if (!refs.reference.current || !refs.floating.current) {
1722
+ return;
1723
+ }
1724
+ return autoUpdate(refs.reference.current, refs.floating.current, update);
1725
+ }, [refs.reference, refs.floating, update, updatedPlacement, visible]);
1726
+ function handleDocumentClick(event) {
1727
+ if (refs.floating.current && refs.floating.current.contains(event.target)) {
1728
+ return;
1729
+ } else if (refs.reference.current && refs.reference.current.contains(event.target)) {
1730
+ setVisibility((prevVisible) => !prevVisible);
1731
+ } else {
1732
+ setVisibility(false);
1733
+ }
1734
+ }
1735
+ const handleHideOnEscape = (event) => {
1736
+ if (event.key === "Escape") {
1737
+ setVisibility(false);
1738
+ }
1739
+ };
1740
+ React.useEffect(() => {
1741
+ document.addEventListener("keydown", handleHideOnEscape);
1742
+ document.addEventListener("mousedown", handleDocumentClick);
1743
+ return () => {
1744
+ document.removeEventListener("keydown", handleHideOnEscape);
1745
+ document.removeEventListener("mousedown", handleDocumentClick);
1746
+ };
1747
+ }, []);
1748
+ const mergedClassNames = cx(cssStyles["popover"], className, {
1749
+ [cssStyles["popover--visible"]]: visible
1750
+ });
1751
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
1752
+ style: { width: "fit-content" },
1753
+ ref: reference
1754
+ }, triggerRenderer()), /* @__PURE__ */ React.createElement("div", {
1755
+ ref: floating,
1756
+ className: mergedClassNames,
1757
+ style: {
1758
+ position: strategy,
1759
+ top: y != null ? y : "",
1760
+ left: x != null ? x : ""
1761
+ }
1762
+ }, children));
1763
+ };
1764
+ const PROGRESS_STATUSES = [
1765
+ "normal",
1766
+ "error",
1767
+ "success"
1768
+ ];
1769
+ const clampPercentage = (percent) => Math.min(Math.max(percent, 0), 100);
1770
+ function getPercentNumber(status, percent = 0) {
1771
+ if (status === "error") {
1772
+ return 0;
1773
+ }
1774
+ return clampPercentage(parseInt(percent.toString(), 10));
1775
+ }
1776
+ function getProgressStatus(status, percent) {
1777
+ if (!PROGRESS_STATUSES.includes(status) && percent >= 100) {
1778
+ return "normal";
1779
+ }
1780
+ return status || "normal";
1781
+ }
1782
+ var styles$b = {
1783
+ "progress-circle": "lc-ProgressCircle-module__progress-circle___NRHCi",
1784
+ "progress-circle--small": "lc-ProgressCircle-module__progress-circle--small___8FVwG",
1785
+ "progress-circle--medium": "lc-ProgressCircle-module__progress-circle--medium___XlzEX",
1786
+ "progress-circle--large": "lc-ProgressCircle-module__progress-circle--large___qxa2y",
1787
+ "progress-circle__bg-line--normal": "lc-ProgressCircle-module__progress-circle__bg-line--normal___nDNwj",
1788
+ "progress-circle__bg-line--success": "lc-ProgressCircle-module__progress-circle__bg-line--success___1aP-O",
1789
+ "progress-circle__bg-line--error": "lc-ProgressCircle-module__progress-circle__bg-line--error___oqMZL",
1790
+ "progress-circle__indicator--normal": "lc-ProgressCircle-module__progress-circle__indicator--normal___0SdkX",
1791
+ "progress-circle__indicator--success": "lc-ProgressCircle-module__progress-circle__indicator--success___fLwRR",
1792
+ "progress-circle__indicator--error": "lc-ProgressCircle-module__progress-circle__indicator--error___nwJS9",
1793
+ "progress-circle--error": "lc-ProgressCircle-module__progress-circle--error___2AA9K",
1794
+ "progress-circle__bg-line": "lc-ProgressCircle-module__progress-circle__bg-line___12YrE",
1795
+ "progress-circle--success": "lc-ProgressCircle-module__progress-circle--success___hH5jv",
1796
+ "progress-circle--normal": "lc-ProgressCircle-module__progress-circle--normal___dFneQ"
1797
+ };
1798
+ const THICKNESS_FROM_SIZE = {
1799
+ small: 2,
1800
+ medium: 3,
1801
+ large: 4
1802
+ };
1803
+ const SIZE_VALUE_FROM_SIZE = {
1804
+ small: 15,
1805
+ medium: 36,
1806
+ large: 56
1807
+ };
1808
+ const baseClass$h = "progress-circle";
1809
+ const ProgressCircle = React.forwardRef((_K, ref) => {
1810
+ var _L = _K, {
1811
+ status = "normal",
1812
+ progressValue,
1813
+ className,
1814
+ size = "medium"
1815
+ } = _L, restProps = __objRest(_L, [
1816
+ "status",
1817
+ "progressValue",
1818
+ "className",
1819
+ "size"
1820
+ ]);
1821
+ const progressStatus = getProgressStatus(status, progressValue);
1822
+ const percentNumber = getPercentNumber(progressStatus, progressValue);
1823
+ const thickness = THICKNESS_FROM_SIZE[size];
1824
+ const sizeValue = SIZE_VALUE_FROM_SIZE[size];
1825
+ const mergedClassNames = cx(styles$b[baseClass$h], {
1826
+ [styles$b[`${baseClass$h}--${size}`]]: size,
1827
+ [styles$b[`${baseClass$h}--${status}`]]: status
1828
+ }, className);
1829
+ const circumference = 2 * Math.PI * ((sizeValue - thickness) / 2);
1830
+ const indicatorStyle = {
1831
+ strokeDasharray: circumference.toFixed(3),
1832
+ strokeDashoffset: `${((100 - percentNumber) / 100 * circumference).toFixed(3)}px`
1833
+ };
1834
+ const svgViewBox = `${sizeValue / 2} ${sizeValue / 2} ${sizeValue} ${sizeValue}`;
1835
+ return /* @__PURE__ */ React.createElement("div", __spreadValues({
1836
+ className: mergedClassNames,
1837
+ ref,
1838
+ role: "progressbar"
1839
+ }, restProps), /* @__PURE__ */ React.createElement("svg", {
1840
+ viewBox: svgViewBox
1841
+ }, /* @__PURE__ */ React.createElement("circle", {
1842
+ className: styles$b[`${baseClass$h}__bg-line--${status}`],
1843
+ cx: sizeValue,
1844
+ cy: sizeValue,
1845
+ r: (sizeValue - thickness) / 2,
1846
+ fill: "none",
1847
+ strokeWidth: thickness
1848
+ }), /* @__PURE__ */ React.createElement("circle", {
1849
+ className: styles$b[`${baseClass$h}__indicator--${status}`],
1850
+ style: indicatorStyle,
1851
+ cx: sizeValue,
1852
+ cy: sizeValue,
1853
+ r: (sizeValue - thickness) / 2,
1854
+ fill: "none",
1855
+ strokeWidth: thickness
1856
+ })));
1857
+ });
1858
+ var styles$a = {
1859
+ "progress-bar": "lc-ProgressBar-module__progress-bar___3pa3d",
1860
+ "progress-bar--small": "lc-ProgressBar-module__progress-bar--small___7nQKx",
1861
+ "progress-bar--medium": "lc-ProgressBar-module__progress-bar--medium___cM44p",
1862
+ "progress-bar--large": "lc-ProgressBar-module__progress-bar--large___UlzNR",
1863
+ "progress-bar--error": "lc-ProgressBar-module__progress-bar--error___MulqI",
1864
+ "progress-bar--success": "lc-ProgressBar-module__progress-bar--success___p7nB-",
1865
+ "progress-bar--normal": "lc-ProgressBar-module__progress-bar--normal___ZwCb-",
1866
+ "progress-bar__indicator--success": "lc-ProgressBar-module__progress-bar__indicator--success___wRjR3",
1867
+ "progress-bar__indicator--normal": "lc-ProgressBar-module__progress-bar__indicator--normal___0Uhle"
1868
+ };
1869
+ const baseClass$g = "progress-bar";
1870
+ const ProgressBar = React.forwardRef((_M, ref) => {
1871
+ var _N = _M, {
1872
+ status = "normal",
1873
+ percent,
1874
+ size = "medium",
1875
+ className = ""
1876
+ } = _N, restProps = __objRest(_N, [
1877
+ "status",
1878
+ "percent",
1879
+ "size",
1880
+ "className"
1881
+ ]);
1882
+ const progressStatus = getProgressStatus(status, percent);
1883
+ const percentNumber = getPercentNumber(progressStatus, percent);
1884
+ const mergedClassNames = cx(styles$a[baseClass$g], {
1885
+ [styles$a[`${baseClass$g}--${size}`]]: size,
1886
+ [styles$a[`${baseClass$g}--${status}`]]: status
1887
+ }, className);
1888
+ return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({}, restProps), {
1889
+ className: mergedClassNames,
1890
+ ref,
1891
+ role: "progressbar"
1892
+ }), /* @__PURE__ */ React.createElement("div", {
1893
+ className: styles$a[`${baseClass$g}__indicator--${status}`],
1894
+ style: { width: `${percentNumber}%` }
1895
+ }));
1896
+ });
1897
+ var styles$9 = {
1898
+ "promo-banner": "lc-PromoBanner-module__promo-banner___-mGpq",
1899
+ "promo-banner__content": "lc-PromoBanner-module__promo-banner__content___kRWar",
1900
+ "promo-banner__wrapper": "lc-PromoBanner-module__promo-banner__wrapper___I-8cl",
1901
+ "promo-banner__header": "lc-PromoBanner-module__promo-banner__header___ebYHW",
1902
+ "promo-banner__img": "lc-PromoBanner-module__promo-banner__img___eaShb",
1903
+ "promo-banner__button-text": "lc-PromoBanner-module__promo-banner__button-text___taYKa",
1904
+ "promo-banner--light": "lc-PromoBanner-module__promo-banner--light___eJxOR",
1905
+ "promo-banner__footer": "lc-PromoBanner-module__promo-banner__footer___8OjvH",
1906
+ "promo-banner--small": "lc-PromoBanner-module__promo-banner--small___7sWLV",
1907
+ "promo-banner--large": "lc-PromoBanner-module__promo-banner--large___pMiCU",
1908
+ "promo-banner__close-icon": "lc-PromoBanner-module__promo-banner__close-icon___GowBL"
1909
+ };
1910
+ const SMALL_CONTAINER_WIDTH_TRESHOLD = 400;
1911
+ const LARGE_CONTAINER_WIDTH_TRESHOLD = 800;
1912
+ const RESIZE_DEBOUNCE_TRESHOLD = 500;
1913
+ const baseClass$f = "promo-banner";
1914
+ const PromoBanner = ({
1915
+ className,
1916
+ buttonText,
1917
+ children,
1918
+ header,
1919
+ img,
1920
+ light = false,
1921
+ linkText,
1922
+ onButtonClick,
1923
+ onClose,
1924
+ onLinkClick
1925
+ }) => {
1926
+ const containerRef = React.useRef(null);
1927
+ const [containerSize, setContainerSize] = React.useState("medium");
1928
+ const mergedClassNames = cx(styles$9[baseClass$f], {
1929
+ [styles$9[`${baseClass$f}--light`]]: light,
1930
+ [styles$9[`${baseClass$f}--small`]]: containerSize === "small",
1931
+ [styles$9[`${baseClass$f}--large`]]: containerSize === "large"
1932
+ }, className);
1933
+ React.useEffect(() => {
1934
+ const handleResize = () => {
1935
+ if (containerRef.current && containerRef.current.offsetWidth <= SMALL_CONTAINER_WIDTH_TRESHOLD) {
1936
+ return setContainerSize("small");
1937
+ }
1938
+ if (containerRef.current && containerRef.current.offsetWidth >= LARGE_CONTAINER_WIDTH_TRESHOLD) {
1939
+ return setContainerSize("large");
1940
+ }
1941
+ return setContainerSize("medium");
1942
+ };
1943
+ const debouncedHandleResize = debounce(handleResize, RESIZE_DEBOUNCE_TRESHOLD);
1944
+ window.addEventListener("resize", debouncedHandleResize);
1945
+ handleResize();
1946
+ return () => {
1947
+ debouncedHandleResize.cancel();
1948
+ window.removeEventListener("resize", handleResize);
1949
+ };
1950
+ }, []);
1951
+ const footer = /* @__PURE__ */ React.createElement("div", {
1952
+ className: styles$9[`${baseClass$f}__footer`]
1953
+ }, buttonText && /* @__PURE__ */ React.createElement(Button, {
1954
+ kind: "primary",
1955
+ size: "compact",
1956
+ onClick: onButtonClick,
1957
+ className: styles$9[`${baseClass$f}__button-text`]
1958
+ }, buttonText), linkText && /* @__PURE__ */ React.createElement(Button, {
1959
+ size: "compact",
1960
+ kind: "text",
1961
+ onClick: onLinkClick
1962
+ }, linkText));
1963
+ return /* @__PURE__ */ React.createElement("div", {
1964
+ ref: containerRef,
1965
+ className: mergedClassNames
1966
+ }, /* @__PURE__ */ React.createElement("div", {
1967
+ className: styles$9[`${baseClass$f}__content`]
1968
+ }, img && /* @__PURE__ */ React.createElement("img", {
1969
+ src: img,
1970
+ className: styles$9[`${baseClass$f}__img`]
1971
+ }), /* @__PURE__ */ React.createElement("div", {
1972
+ className: styles$9[`${baseClass$f}__wrapper`]
1973
+ }, /* @__PURE__ */ React.createElement("div", {
1974
+ className: styles$9[`${baseClass$f}__header`]
1975
+ }, header), /* @__PURE__ */ React.createElement("div", null, children), containerSize !== "large" && footer), containerSize === "large" && footer), onClose && /* @__PURE__ */ React.createElement("button", {
1976
+ type: "button",
1977
+ className: styles$9[`${baseClass$f}__close-icon`],
1978
+ onClick: onClose
1979
+ }, /* @__PURE__ */ React.createElement(Icon, {
1980
+ source: Close,
1981
+ size: "large"
1982
+ })));
1983
+ };
1984
+ var styles$8 = {
1985
+ "radio-button": "lc-RadioButton-module__radio-button___WaToM",
1986
+ "radio-button__label": "lc-RadioButton-module__radio-button__label___i7ygg",
1987
+ "radio-button__circle": "lc-RadioButton-module__radio-button__circle___wimWA",
1988
+ "radio-button__inner-circle": "lc-RadioButton-module__radio-button__inner-circle___qkRVf",
1989
+ "radio-button__text": "lc-RadioButton-module__radio-button__text___mT8c0",
1990
+ "radio-button__input": "lc-RadioButton-module__radio-button__input___7OTAK",
1991
+ "radio-button__helper": "lc-RadioButton-module__radio-button__helper___r8gJJ",
1992
+ "radio-button--selected": "lc-RadioButton-module__radio-button--selected___s9lqj",
1993
+ "radio-button--disabled": "lc-RadioButton-module__radio-button--disabled___wHSA7"
1994
+ };
1995
+ const baseClass$e = "radio-button";
1996
+ const RadioButton = React.forwardRef((_O, ref) => {
1997
+ var _P = _O, { children, className = "", description, checked, disabled } = _P, props = __objRest(_P, ["children", "className", "description", "checked", "disabled"]);
1998
+ const mergedClassNames = cx(styles$8[baseClass$e], className, {
1999
+ [styles$8[`${baseClass$e}--selected`]]: checked,
2000
+ [styles$8[`${baseClass$e}--disabled`]]: disabled
2001
+ });
2002
+ return /* @__PURE__ */ React.createElement("div", {
2003
+ className: mergedClassNames
2004
+ }, /* @__PURE__ */ React.createElement("label", {
2005
+ className: styles$8[`${baseClass$e}__label`]
2006
+ }, /* @__PURE__ */ React.createElement("div", {
2007
+ className: styles$8[`${baseClass$e}__circle`]
2008
+ }, /* @__PURE__ */ React.createElement("span", {
2009
+ className: styles$8[`${baseClass$e}__inner-circle`]
2010
+ }), /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues({}, props), {
2011
+ className: styles$8[`${baseClass$e}__input`],
2012
+ ref,
2013
+ type: "radio",
2014
+ checked,
2015
+ disabled
2016
+ }))), children && /* @__PURE__ */ React.createElement(Text, {
2017
+ as: "div",
2018
+ size: "md",
2019
+ className: styles$8[`${baseClass$e}__text`]
2020
+ }, children)), description && /* @__PURE__ */ React.createElement(FieldDescription, {
2021
+ className: styles$8[`${baseClass$e}__helper`]
2022
+ }, description));
2023
+ });
2024
+ var styles$7 = {
2025
+ "search-input": "lc-Search-module__search-input___FsbCk",
2026
+ "search-input__search-icon": "lc-Search-module__search-input__search-icon___BBQoD",
2027
+ "search-input__clear-icon": "lc-Search-module__search-input__clear-icon___LoNkc",
2028
+ "search-input__loader": "lc-Search-module__search-input__loader___pkpIG",
2029
+ "search-input__input": "lc-Search-module__search-input__input___OhyTr",
2030
+ "search-input__input--compact": "lc-Search-module__search-input__input--compact___yikdR",
2031
+ "search-input__input--medium": "lc-Search-module__search-input__input--medium___u6tRA",
2032
+ "search-input__input--large": "lc-Search-module__search-input__input--large___9jQ-s",
2033
+ "search-input__input--collapsable": "lc-Search-module__search-input__input--collapsable___4VjS8",
2034
+ "search-input__input--collapsable--open": "lc-Search-module__search-input__input--collapsable--open___a2rX2",
2035
+ "search-input__input--disabled": "lc-Search-module__search-input__input--disabled___nfZau"
2036
+ };
2037
+ const baseClass$d = "search-input";
2038
+ const inputBaseClass = `${baseClass$d}__input`;
2039
+ const SearchInput = ({
2040
+ isCollapsable,
2041
+ isDisabled,
2042
+ isLoading,
2043
+ placeholder = "Search ...",
2044
+ size = "medium",
2045
+ value,
2046
+ onChange
2047
+ }) => {
2048
+ const [searchValue, setSearchValue] = React.useState(value || "");
2049
+ const [isCollapsed, setIsCollapsed] = React.useState(true);
2050
+ const inputRef = React.useRef(null);
2051
+ const isCloseIconVisible = !!searchValue && !isDisabled && !isLoading;
2052
+ 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`]);
2053
+ React.useEffect(() => {
2054
+ if (typeof value === "string") {
2055
+ setSearchValue(value);
2056
+ }
2057
+ }, [value]);
2058
+ const handleOnChange = (e) => {
2059
+ const value2 = e.currentTarget.value;
2060
+ setSearchValue(value2);
2061
+ onChange(value2);
2062
+ };
2063
+ const handleClear = () => {
2064
+ setSearchValue("");
2065
+ onChange("");
2066
+ };
2067
+ const handleClick = () => {
2068
+ var _a;
2069
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
2070
+ };
2071
+ const handleFocus = () => {
2072
+ if (isCollapsable) {
2073
+ setIsCollapsed(false);
2074
+ }
2075
+ };
2076
+ const handleBlur = () => {
2077
+ if (isCollapsable && !searchValue) {
2078
+ setIsCollapsed(true);
2079
+ }
2080
+ };
2081
+ const handleKeyDown = (e) => {
2082
+ if (e.key === KeyCodes.enter) {
2083
+ e.preventDefault();
2084
+ onChange(searchValue);
2085
+ }
2086
+ };
2087
+ return /* @__PURE__ */ React.createElement("div", {
2088
+ "data-testid": `${baseClass$d}-container`,
2089
+ className: styles$7[baseClass$d],
2090
+ onClick: handleClick
2091
+ }, /* @__PURE__ */ React.createElement(Icon, {
2092
+ className: styles$7[`${baseClass$d}__search-icon`],
2093
+ source: Search,
2094
+ disabled: isDisabled || isLoading,
2095
+ kind: "primary"
2096
+ }), /* @__PURE__ */ React.createElement("input", {
2097
+ ref: inputRef,
2098
+ className: mergedClassNames,
2099
+ type: "text",
2100
+ value: searchValue,
2101
+ placeholder,
2102
+ onChange: handleOnChange,
2103
+ onBlur: handleBlur,
2104
+ onFocus: handleFocus,
2105
+ onKeyDown: handleKeyDown,
2106
+ disabled: isDisabled || isLoading
2107
+ }), isCloseIconVisible && /* @__PURE__ */ React.createElement("div", {
2108
+ className: styles$7[`${baseClass$d}__clear-icon`],
2109
+ "data-testid": `${baseClass$d}-clear-icon`,
2110
+ onClick: handleClear
2111
+ }, /* @__PURE__ */ React.createElement(Icon, {
2112
+ source: Close
2113
+ })), isLoading && /* @__PURE__ */ React.createElement("div", {
2114
+ "data-testid": `${baseClass$d}-loader`,
2115
+ className: styles$7[`${baseClass$d}__loader`]
2116
+ }, /* @__PURE__ */ React.createElement(Loader, {
2117
+ size: "small"
2118
+ })));
2119
+ };
2120
+ const switch__input = "lc-Switch-module__switch__input___NiiOR";
2121
+ const switch__container = "lc-Switch-module__switch__container___79F7W";
2122
+ const switch__track = "lc-Switch-module__switch__track___2wr2M";
2123
+ const switch__slider = "lc-Switch-module__switch__slider___WHd--";
2124
+ const switch__loader = "lc-Switch-module__switch__loader___FE-fA";
2125
+ var styles$6 = {
2126
+ "switch": "lc-Switch-module__switch___AaA2k",
2127
+ "switch__track--enabled": "lc-Switch-module__switch__track--enabled___sy4Xl",
2128
+ "switch__track--on": "lc-Switch-module__switch__track--on___aOMWe",
2129
+ "switch__track--off": "lc-Switch-module__switch__track--off___NAisj",
2130
+ "switch--large": "lc-Switch-module__switch--large___pSoJ7",
2131
+ "switch--compact": "lc-Switch-module__switch--compact___OGFIX",
2132
+ "switch--medium": "lc-Switch-module__switch--medium___EcZwT",
2133
+ switch__input,
2134
+ "switch__input--disabled": "lc-Switch-module__switch__input--disabled___Po8gh",
2135
+ switch__container,
2136
+ switch__track,
2137
+ "switch__track--disabled": "lc-Switch-module__switch__track--disabled___HkDhl",
2138
+ switch__slider,
2139
+ "switch__slider--large": "lc-Switch-module__switch__slider--large___WoEgi",
2140
+ "switch__slider--large--on": "lc-Switch-module__switch__slider--large--on___7Qp3G",
2141
+ "switch__slider--large--off": "lc-Switch-module__switch__slider--large--off___iRMmD",
2142
+ "switch__slider--compact": "lc-Switch-module__switch__slider--compact___uZ-lS",
2143
+ "switch__slider--compact--on": "lc-Switch-module__switch__slider--compact--on___FykE3",
2144
+ "switch__slider--compact--off": "lc-Switch-module__switch__slider--compact--off___s5yR8",
2145
+ "switch__slider--medium": "lc-Switch-module__switch__slider--medium___uhptz",
2146
+ "switch__slider--medium--on": "lc-Switch-module__switch__slider--medium--on___SfeAV",
2147
+ "switch__slider--medium--off": "lc-Switch-module__switch__slider--medium--off___eXJJz",
2148
+ switch__loader,
2149
+ "switch__loader--compact": "lc-Switch-module__switch__loader--compact___3imUh",
2150
+ "switch__loader--medium": "lc-Switch-module__switch__loader--medium___2zi05",
2151
+ "switch__loader--large": "lc-Switch-module__switch__loader--large___vLRFa"
2152
+ };
2153
+ const baseClass$c = "switch";
2154
+ const Switch = (_Q) => {
2155
+ var _R = _Q, {
2156
+ className = "",
2157
+ defaultOn = false,
2158
+ disabled = false,
2159
+ name = baseClass$c,
2160
+ on,
2161
+ onChange = noop,
2162
+ size = "large",
2163
+ state = "regular",
2164
+ innerRef
2165
+ } = _R, props = __objRest(_R, [
2166
+ "className",
2167
+ "defaultOn",
2168
+ "disabled",
2169
+ "name",
2170
+ "on",
2171
+ "onChange",
2172
+ "size",
2173
+ "state",
2174
+ "innerRef"
2175
+ ]);
2176
+ const [checked, setChecked] = React.useState(() => on !== void 0 ? on : defaultOn);
2177
+ React.useEffect(() => {
2178
+ if (on !== void 0) {
2179
+ setChecked(on);
2180
+ }
2181
+ }, [on]);
2182
+ const isLoading = state === "loading";
2183
+ const isLocked = state === "locked";
2184
+ const iconSize = size === "large" ? "small" : "xsmall";
2185
+ const toggleStyles = checked ? "on" : "off";
2186
+ const shouldBehaveAsDisabled = disabled || isLoading || isLocked;
2187
+ const availabilityStyles = shouldBehaveAsDisabled ? "disabled" : "enabled";
2188
+ const mergedClassNames = cx(styles$6[baseClass$c], styles$6[`${baseClass$c}--${size}`], className);
2189
+ const handleChange = (e) => {
2190
+ const hasOnChangePassed = onChange !== noop;
2191
+ if (hasOnChangePassed) {
2192
+ onChange(e, checked);
2193
+ return;
2194
+ }
2195
+ e.stopPropagation();
2196
+ setChecked((prevEnabled) => !prevEnabled);
2197
+ };
2198
+ return /* @__PURE__ */ React.createElement("span", {
2199
+ className: mergedClassNames
2200
+ }, /* @__PURE__ */ React.createElement("input", __spreadValues({
2201
+ type: "checkbox",
2202
+ className: cx(styles$6[`${baseClass$c}__input`], styles$6[`${baseClass$c}__input--${availabilityStyles}`]),
2203
+ onChange: handleChange,
2204
+ checked,
2205
+ name,
2206
+ ref: innerRef,
2207
+ disabled: shouldBehaveAsDisabled,
2208
+ "test-id": "foo"
2209
+ }, props)), /* @__PURE__ */ React.createElement("span", {
2210
+ className: styles$6[`${baseClass$c}__container`]
2211
+ }, /* @__PURE__ */ React.createElement("span", {
2212
+ className: cx(styles$6[`${baseClass$c}__track`], styles$6[`${baseClass$c}__track--${toggleStyles}`], styles$6[`${baseClass$c}__track--${availabilityStyles}`])
2213
+ }), /* @__PURE__ */ React.createElement("span", {
2214
+ className: cx(styles$6[`${baseClass$c}__slider`], styles$6[`${baseClass$c}__slider--${size}`], styles$6[`${baseClass$c}__slider--${size}--${toggleStyles}`])
2215
+ }, isLoading && /* @__PURE__ */ React.createElement(Loader, {
2216
+ className: cx(styles$6[`${baseClass$c}__loader`], styles$6[`${baseClass$c}__loader--${size}`])
2217
+ }), isLocked && /* @__PURE__ */ React.createElement(Icon, {
2218
+ "data-testid": "lock-icon",
2219
+ size: iconSize,
2220
+ source: LockBlack,
2221
+ kind: "primary"
2222
+ }))));
2223
+ };
2224
+ const tab = "lc-Tab-module__tab___fME7u";
2225
+ const tab__description = "lc-Tab-module__tab__description___JGXU6";
2226
+ var styles$5 = {
2227
+ tab,
2228
+ tab__description,
2229
+ "tab--selected": "lc-Tab-module__tab--selected___c0EkL"
2230
+ };
2231
+ const baseClass$b = "tab";
2232
+ const Tab = (_S) => {
2233
+ var _T = _S, {
2234
+ children,
2235
+ className,
2236
+ description,
2237
+ isSelected
2238
+ } = _T, restProps = __objRest(_T, [
2239
+ "children",
2240
+ "className",
2241
+ "description",
2242
+ "isSelected"
2243
+ ]);
2244
+ return /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({}, restProps), {
2245
+ as: restProps.href ? "a" : "button",
2246
+ size: "md",
2247
+ bold: isSelected,
2248
+ className: cx(styles$5[baseClass$b], className, isSelected && styles$5[`${baseClass$b}--selected`])
2249
+ }), children, description && /* @__PURE__ */ React.createElement(Text, {
2250
+ as: "span",
2251
+ size: "md",
2252
+ className: styles$5[`${baseClass$b}__description`]
2253
+ }, "(", description, ")"));
2254
+ };
2255
+ const tabs = "lc-TabsWrapper-module__tabs___Y2xyD";
2256
+ const tabs__list = "lc-TabsWrapper-module__tabs__list___i6tVO";
2257
+ var styles$4 = {
2258
+ tabs,
2259
+ tabs__list
2260
+ };
2261
+ const baseClass$a = "tabs";
2262
+ const TabsWrapper = ({
2263
+ className,
2264
+ children
2265
+ }) => {
2266
+ return /* @__PURE__ */ React.createElement("div", {
2267
+ className: cx(styles$4[baseClass$a], className)
2268
+ }, children);
2269
+ };
2270
+ const TabsList = ({
2271
+ className,
2272
+ children
2273
+ }) => {
2274
+ return /* @__PURE__ */ React.createElement("div", {
2275
+ className: cx(styles$4[`${baseClass$a}__list`], className)
2276
+ }, children);
2277
+ };
2278
+ const tag = "lc-Tag-module__tag___1QRVY";
2279
+ const tag__remove = "lc-Tag-module__tag__remove___UmtrW";
2280
+ const icon = "lc-Tag-module__icon___2Z-35";
2281
+ const tag__icon = "lc-Tag-module__tag__icon___tZoQ9";
2282
+ const tag__avatar = "lc-Tag-module__tag__avatar___U4c-P";
2283
+ var styles$3 = {
2284
+ tag,
2285
+ "tag--success": "lc-Tag-module__tag--success___P2hXQ",
2286
+ tag__remove,
2287
+ "tag--error": "lc-Tag-module__tag--error___1cjsm",
2288
+ "tag--warning": "lc-Tag-module__tag--warning___PstMG",
2289
+ "tag--info": "lc-Tag-module__tag--info___RTH0C",
2290
+ "tag--medium": "lc-Tag-module__tag--medium___l5-KI",
2291
+ "tag--large": "lc-Tag-module__tag--large___ytC6Y",
2292
+ "tag--outline": "lc-Tag-module__tag--outline___aZXtr",
2293
+ icon,
2294
+ "tag--text-white": "lc-Tag-module__tag--text-white___x0fnD",
2295
+ "tag--text-black": "lc-Tag-module__tag--text-black___dUvmD",
2296
+ "tag--with-icon": "lc-Tag-module__tag--with-icon___ZlkvT",
2297
+ "tag--dismissible": "lc-Tag-module__tag--dismissible___Qobyr",
2298
+ tag__icon,
2299
+ tag__avatar
2300
+ };
2301
+ const baseClass$9 = "tag";
2302
+ const getCustomTextClass = (customColor) => {
2303
+ if (!customColor) {
2304
+ return "";
2305
+ }
2306
+ return getContrast(customColor, "#FFFFFF") > 4.5 ? "text-white" : "text-black";
2307
+ };
2308
+ const Tag = (_U) => {
2309
+ var _V = _U, {
2310
+ className = "",
2311
+ children,
2312
+ dismissible = false,
2313
+ size = "medium",
2314
+ kind = "default",
2315
+ onRemove,
2316
+ outline = false,
2317
+ icon: icon2,
2318
+ avatar: avatar2,
2319
+ customColor
2320
+ } = _V, restProps = __objRest(_V, [
2321
+ "className",
2322
+ "children",
2323
+ "dismissible",
2324
+ "size",
2325
+ "kind",
2326
+ "onRemove",
2327
+ "outline",
2328
+ "icon",
2329
+ "avatar",
2330
+ "customColor"
2331
+ ]);
2332
+ const mergedClassNames = cx(styles$3[baseClass$9], className, styles$3[`${baseClass$9}--${size}`], styles$3[`${baseClass$9}--${kind}`], {
2333
+ [styles$3[`${baseClass$9}--dismissible`]]: dismissible,
2334
+ [styles$3[`${baseClass$9}--outline`]]: outline,
2335
+ [styles$3[`${baseClass$9}--with-icon`]]: !!icon2 || !!avatar2,
2336
+ [styles$3[`${baseClass$9}--${getCustomTextClass(customColor)}`]]: !!customColor
2337
+ });
2338
+ const getCustomColorStyles = () => {
2339
+ if (!customColor) {
2340
+ return {};
2341
+ }
2342
+ if (outline) {
2343
+ return {
2344
+ style: {
2345
+ backgroundColor: "transparent",
2346
+ color: customColor,
2347
+ borderColor: customColor
2348
+ }
2349
+ };
2350
+ }
2351
+ return { style: { backgroundColor: customColor } };
2352
+ };
2353
+ const getIconCustomColor = () => {
2354
+ if (!customColor) {
2355
+ return void 0;
2356
+ }
2357
+ if (outline) {
2358
+ return customColor;
2359
+ }
2360
+ return getContrast(customColor, "#FFFFFF") > 4.5 ? "#FFFFFF" : "#000000";
2361
+ };
2362
+ return /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues(__spreadValues({
2363
+ className: mergedClassNames
2364
+ }, restProps), getCustomColorStyles()), {
2365
+ as: "div",
2366
+ size: "md"
2367
+ }), avatar2 && /* @__PURE__ */ React.createElement("img", {
2368
+ className: styles$3[`${baseClass$9}__avatar`],
2369
+ src: avatar2,
2370
+ alt: "tag-avatar",
2371
+ "data-testid": "lc-tag-avatar"
2372
+ }), " ", icon2 && !avatar2 && /* @__PURE__ */ React.createElement(Icon, {
2373
+ "data-testid": "lc-tag-icon",
2374
+ className: styles$3[`${baseClass$9}__icon`],
2375
+ source: icon2,
2376
+ size: "small",
2377
+ customColor: getIconCustomColor()
2378
+ }), children, dismissible && /* @__PURE__ */ React.createElement("button", {
2379
+ title: "Remove",
2380
+ onClick: onRemove,
2381
+ type: "button",
2382
+ className: styles$3[`${baseClass$9}__remove`]
2383
+ }, /* @__PURE__ */ React.createElement(Icon, {
2384
+ source: Close,
2385
+ size: "medium",
2386
+ customColor: getIconCustomColor()
2387
+ })));
2388
+ };
2389
+ const EditableTagContent = ({
2390
+ className = "",
2391
+ innerEditableRef,
2392
+ inputRef,
2393
+ change,
2394
+ remove,
2395
+ value
2396
+ }) => {
2397
+ const [removed, setRemoved] = React.useState(false);
2398
+ const getRef = () => innerEditableRef.current;
2399
+ const getValue = () => {
2400
+ const ref = getRef();
2401
+ return ref ? ref.innerText : "";
2402
+ };
2403
+ const focusInputRef = () => {
2404
+ if (inputRef && inputRef.current) {
2405
+ inputRef.current.focus();
2406
+ }
2407
+ };
2408
+ const onKeyDown = (e) => {
2409
+ if (e.key === KeyCodes.enter) {
2410
+ e.preventDefault();
2411
+ focusInputRef();
2412
+ return;
2413
+ }
2414
+ if (e.key === KeyCodes.backspace && getValue() === "") {
2415
+ setRemoved(true);
2416
+ remove();
2417
+ focusInputRef();
2418
+ }
2419
+ };
2420
+ const onBlur = () => {
2421
+ const ref = getRef();
2422
+ if (removed || !ref) {
2423
+ return;
2424
+ }
2425
+ if (ref.innerText === "") {
2426
+ remove();
2427
+ return;
2428
+ }
2429
+ change(ref.innerText);
2430
+ };
2431
+ const onPaste = (e) => {
2432
+ e.preventDefault();
2433
+ const text = e.clipboardData.getData("text/plain");
2434
+ document.execCommand("insertHTML", false, escape(text));
2435
+ };
2436
+ return /* @__PURE__ */ React.createElement("div", {
2437
+ ref: innerEditableRef,
2438
+ className,
2439
+ contentEditable: true,
2440
+ onPaste,
2441
+ onBlur,
2442
+ onKeyDown,
2443
+ dangerouslySetInnerHTML: { __html: escape(value) }
2444
+ });
2445
+ };
2446
+ var styles$2 = {
2447
+ "tag-input": "lc-TagInput-module__tag-input___CLVY-",
2448
+ "tag-input--error": "lc-TagInput-module__tag-input--error___RP0SB",
2449
+ "tag-input__input": "lc-TagInput-module__tag-input__input___dgEYB",
2450
+ "tag-input__input--medium": "lc-TagInput-module__tag-input__input--medium___DYF7X",
2451
+ "tag-input__input--large": "lc-TagInput-module__tag-input__input--large___G6iEO",
2452
+ "tag-input__tag__content": "lc-TagInput-module__tag-input__tag__content___x95-M"
2453
+ };
2454
+ const baseClass$8 = "tag-input__tag";
2455
+ const EditableTag = ({
2456
+ children,
2457
+ index: index2,
2458
+ remove,
2459
+ validator,
2460
+ inputRef,
2461
+ update,
2462
+ size
2463
+ }) => {
2464
+ const isValid = React.useMemo(() => {
2465
+ return validator !== void 0 ? validator(children) : true;
2466
+ }, [children, validator]);
2467
+ const innerEditableRef = React.useRef(null);
2468
+ const removeTag = () => remove(index2);
2469
+ return /* @__PURE__ */ React.createElement(Tag, {
2470
+ kind: isValid ? "default" : "error",
2471
+ dismissible: true,
2472
+ size,
2473
+ onRemove: removeTag
2474
+ }, /* @__PURE__ */ React.createElement(EditableTagContent, {
2475
+ value: children,
2476
+ inputRef,
2477
+ innerEditableRef,
2478
+ className: styles$2[`${baseClass$8}__content`],
2479
+ change: (newValue) => update(index2, newValue),
2480
+ remove: removeTag,
2481
+ validator
2482
+ }));
2483
+ };
2484
+ const baseClass$7 = "tag-input";
2485
+ const tagSeparatorKeys = [
2486
+ KeyCodes.enter,
2487
+ KeyCodes.spacebar,
2488
+ KeyCodes.tab,
2489
+ KeyCodes.semicolon,
2490
+ KeyCodes.comma
2491
+ ];
2492
+ const tagRemoveKeys = [KeyCodes.backspace, KeyCodes.delete];
2493
+ const TagInput = ({
2494
+ tags,
2495
+ onChange,
2496
+ validator,
2497
+ error,
2498
+ placeholder,
2499
+ size = "medium"
2500
+ }) => {
2501
+ const mergedClassNames = cx(styles$2[baseClass$7], {
2502
+ [styles$2[`${baseClass$7}--error`]]: error
2503
+ });
2504
+ const inputClassNames = cx(styles$2[`${baseClass$7}__input`], styles$2[`${baseClass$7}__input--${size}`]);
2505
+ const [inputValue, setInputValue] = React.useState("");
2506
+ const inputRef = React.useRef(null);
2507
+ const addTag = (value) => {
2508
+ onChange([...tags || [], value]);
2509
+ setInputValue("");
2510
+ };
2511
+ const removeTag = (idx) => {
2512
+ const newTags = [...tags || []];
2513
+ newTags.splice(idx, 1);
2514
+ onChange(newTags);
2515
+ };
2516
+ const onInputChange = (e) => setInputValue(e.target.value);
2517
+ const onInputKeyDown = (e) => {
2518
+ if (tagSeparatorKeys.includes(e.key)) {
2519
+ e.preventDefault();
2520
+ if (inputValue === "") {
2521
+ return;
2522
+ }
2523
+ addTag(inputValue);
2524
+ } else if (tagRemoveKeys.includes(e.key)) {
2525
+ if (inputValue !== "" || !(tags == null ? void 0 : tags.length)) {
2526
+ return;
2527
+ }
2528
+ removeTag(tags.length - 1);
2529
+ }
2530
+ };
2531
+ const updateTag = (i, value) => {
2532
+ const newTags = [...tags || []];
2533
+ const numOccurrencesOfValue = newTags.reduce((prev, currentValue, index2) => prev + (currentValue === value && index2 !== i ? 1 : 0), 0);
2534
+ if (numOccurrencesOfValue > 0) {
2535
+ newTags.splice(i, 1);
2536
+ } else {
2537
+ newTags[i] = value;
2538
+ }
2539
+ onChange(newTags);
2540
+ };
2541
+ const onPaste = (e) => {
2542
+ e.preventDefault();
2543
+ const text = e.clipboardData.getData("text/plain");
2544
+ const newTags = text.split(/[\s,;\n]+/);
2545
+ onChange([...tags || [], ...newTags]);
2546
+ };
2547
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
2548
+ className: mergedClassNames
2549
+ }, tags == null ? void 0 : tags.map((tag2, index2) => /* @__PURE__ */ React.createElement(EditableTag, {
2550
+ index: index2,
2551
+ key: `${index2}${tag2}`,
2552
+ update: updateTag,
2553
+ remove: removeTag,
2554
+ inputRef,
2555
+ validator,
2556
+ size
2557
+ }, tag2)), /* @__PURE__ */ React.createElement("input", {
2558
+ ref: inputRef,
2559
+ className: inputClassNames,
2560
+ placeholder,
2561
+ value: inputValue,
2562
+ onChange: onInputChange,
2563
+ onKeyDown: onInputKeyDown,
2564
+ onPaste
2565
+ })), error && /* @__PURE__ */ React.createElement(FieldError, null, error));
2566
+ };
2567
+ 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;
2568
+ const defaultPlaceholder = "name@company.com";
2569
+ const emailValidator = (value) => {
2570
+ return emailRegex.test(value);
2571
+ };
2572
+ const EmailTagInput = ({
2573
+ tags,
2574
+ onChange,
2575
+ error,
2576
+ placeholder = defaultPlaceholder,
2577
+ size
2578
+ }) => {
2579
+ return /* @__PURE__ */ React.createElement(TagInput, {
2580
+ tags,
2581
+ error,
2582
+ onChange,
2583
+ placeholder,
2584
+ validator: emailValidator,
2585
+ size
2586
+ });
2587
+ };
2588
+ const toast = "lc-Toast-module__toast___j5Amn";
2589
+ const toast__content = "lc-Toast-module__toast__content___HjaNw";
2590
+ const toast__actions = "lc-Toast-module__toast__actions___JWu-1";
2591
+ var styles$1 = {
2592
+ toast,
2593
+ toast__content,
2594
+ toast__actions,
2595
+ "toast__actions--close": "lc-Toast-module__toast__actions--close___QuXHY",
2596
+ "toast__actions--custom": "lc-Toast-module__toast__actions--custom___lm-pM",
2597
+ "toast--success": "lc-Toast-module__toast--success___7UC6m",
2598
+ "toast--warning": "lc-Toast-module__toast--warning___pteb7",
2599
+ "toast--error": "lc-Toast-module__toast--error___trg--",
2600
+ "toast--info": "lc-Toast-module__toast--info___IOp44",
2601
+ "toast-wrapper": "lc-Toast-module__toast-wrapper___Oiwqp",
2602
+ "toast-wrapper--fixed": "lc-Toast-module__toast-wrapper--fixed___QYxRI",
2603
+ "toast-wrapper--block": "lc-Toast-module__toast-wrapper--block___j0kGt",
2604
+ "toast-wrapper--horizontal-center": "lc-Toast-module__toast-wrapper--horizontal-center___t9AFd",
2605
+ "toast-wrapper--horizontal-left": "lc-Toast-module__toast-wrapper--horizontal-left___-GY4I",
2606
+ "toast-wrapper--horizontal-right": "lc-Toast-module__toast-wrapper--horizontal-right___VVMgm",
2607
+ "toast-wrapper--vertical-top": "lc-Toast-module__toast-wrapper--vertical-top___uBfEG",
2608
+ "toast-appear--slide": "lc-Toast-module__toast-appear--slide___G7GAp",
2609
+ "toast-appear-active--slide": "lc-Toast-module__toast-appear-active--slide___brfgK",
2610
+ "toast-exit--slide": "lc-Toast-module__toast-exit--slide___aqiBq",
2611
+ "toast-exit-active--slide": "lc-Toast-module__toast-exit-active--slide___WryMi",
2612
+ "toast-wrapper--vertical-bottom": "lc-Toast-module__toast-wrapper--vertical-bottom___erPuH",
2613
+ "toast-appear--fade": "lc-Toast-module__toast-appear--fade___oUwHm",
2614
+ "toast-appear-active--fade": "lc-Toast-module__toast-appear-active--fade___D3--J",
2615
+ "toast-exit--fade": "lc-Toast-module__toast-exit--fade___iDA1p",
2616
+ "toast-exit-active--fade": "lc-Toast-module__toast-exit-active--fade___tL7sb"
2617
+ };
2618
+ const iconConfig = {
2619
+ success: {
2620
+ source: CheckCircleSolid,
2621
+ kind: "inverted"
2622
+ },
2623
+ warning: {
2624
+ source: Warning
2625
+ },
2626
+ error: {
2627
+ source: Error2,
2628
+ kind: "inverted"
2629
+ },
2630
+ info: {
2631
+ source: Info$1,
2632
+ kind: "inverted"
2633
+ }
2634
+ };
2635
+ const baseClass$6 = "toast";
2636
+ const Toast = (_W) => {
2637
+ var _X = _W, {
2638
+ action,
2639
+ className,
2640
+ children,
2641
+ removable,
2642
+ kind = "info",
2643
+ onClose
2644
+ } = _X, divProps = __objRest(_X, [
2645
+ "action",
2646
+ "className",
2647
+ "children",
2648
+ "removable",
2649
+ "kind",
2650
+ "onClose"
2651
+ ]);
2652
+ const mergedClassNames = cx(styles$1[baseClass$6], styles$1[`${baseClass$6}--${kind}`], className);
2653
+ const onActionClick = (action2) => {
2654
+ if (action2 && action2.closesOnClick && onClose) {
2655
+ action2.onClick();
2656
+ return onClose();
2657
+ }
2658
+ return action2.onClick();
2659
+ };
2660
+ return /* @__PURE__ */ React.createElement("div", __spreadValues({
2661
+ className: mergedClassNames
2662
+ }, divProps), /* @__PURE__ */ React.createElement("div", {
2663
+ className: styles$1[`${baseClass$6}__icon`]
2664
+ }, /* @__PURE__ */ React.createElement(Icon, __spreadProps(__spreadValues({}, iconConfig[kind]), {
2665
+ size: "medium"
2666
+ }))), /* @__PURE__ */ React.createElement("div", {
2667
+ className: styles$1[`${baseClass$6}__content`]
2668
+ }, children), (action || removable) && /* @__PURE__ */ React.createElement("div", {
2669
+ className: styles$1[`${baseClass$6}__actions`]
2670
+ }, action && /* @__PURE__ */ React.createElement(Button, {
2671
+ className: styles$1[`${baseClass$6}__actions--custom`],
2672
+ kind: "plain",
2673
+ onClick: () => onActionClick(action)
2674
+ }, action.label), removable && /* @__PURE__ */ React.createElement("div", {
2675
+ className: styles$1[`${baseClass$6}__actions--close`],
2676
+ "aria-label": "Close toast",
2677
+ onClick: onClose
2678
+ }, /* @__PURE__ */ React.createElement(Icon, {
2679
+ source: Close,
2680
+ size: "medium",
2681
+ kind: ["warning"].includes(kind) ? "primary" : "inverted"
2682
+ }))));
2683
+ };
2684
+ const ANIMATION_TIME = 200;
2685
+ const baseClass$5 = "toast-wrapper";
2686
+ const ToastWrapper = ({
2687
+ className,
2688
+ toasts = [],
2689
+ fixed = true,
2690
+ block = false,
2691
+ animationType = "slide",
2692
+ verticalPosition = "top",
2693
+ horizontalPosition = "center"
2694
+ }) => {
2695
+ const mergedClassNames = cx(styles$1[baseClass$5], {
2696
+ [styles$1[`${baseClass$5}--fixed`]]: fixed,
2697
+ [styles$1[`${baseClass$5}--block`]]: !fixed && block,
2698
+ [styles$1[`${baseClass$5}--horizontal-${horizontalPosition}`]]: horizontalPosition,
2699
+ [styles$1[`${baseClass$5}--vertical-${verticalPosition}`]]: verticalPosition
2700
+ }, className);
2701
+ return /* @__PURE__ */ React.createElement("div", {
2702
+ className: mergedClassNames
2703
+ }, /* @__PURE__ */ React.createElement(TransitionGroup, {
2704
+ component: null
2705
+ }, toasts.map(({ id, kind, content, removable, action, onClose }) => /* @__PURE__ */ React.createElement(CSSTransition, {
2706
+ key: id,
2707
+ classNames: {
2708
+ enter: styles$1[`toast-appear--${animationType}`],
2709
+ enterActive: styles$1[`toast-appear-active--${animationType}`],
2710
+ exit: styles$1[`toast-exit--${animationType}`],
2711
+ exitActive: styles$1[`toast-exit-active--${animationType}`]
2712
+ },
2713
+ timeout: ANIMATION_TIME
2714
+ }, /* @__PURE__ */ React.createElement(Toast, {
2715
+ kind,
2716
+ onClose,
2717
+ removable,
2718
+ action
2719
+ }, content)))));
2720
+ };
2721
+ const tooltip = "lc-Tooltip-module__tooltip___QOOAr";
2722
+ const tooltip__arrow = "lc-Tooltip-module__tooltip__arrow___Ov1YW";
2723
+ var styles = {
2724
+ tooltip,
2725
+ "tooltip--invert": "lc-Tooltip-module__tooltip--invert___PVjhE",
2726
+ "tooltip--important": "lc-Tooltip-module__tooltip--important___X-IMK",
2727
+ tooltip__arrow,
2728
+ "tooltip-header": "lc-Tooltip-module__tooltip-header___QV0Vd",
2729
+ "tooltip-image": "lc-Tooltip-module__tooltip-image___Aorwg",
2730
+ "tooltip-text": "lc-Tooltip-module__tooltip-text___FB8OV",
2731
+ "tooltip-close": "lc-Tooltip-module__tooltip-close___3r3h9",
2732
+ "tooltip-step": "lc-Tooltip-module__tooltip-step___-j0n8",
2733
+ "guide-tooltip--slide": "lc-Tooltip-module__guide-tooltip--slide___Uawm2",
2734
+ "guide-tooltip__overlay": "lc-Tooltip-module__guide-tooltip__overlay___IyrKK",
2735
+ "guide-tooltip__overlay--slide": "lc-Tooltip-module__guide-tooltip__overlay--slide___VW8oq",
2736
+ "guide-tooltip__overlay--visible": "lc-Tooltip-module__guide-tooltip__overlay--visible___dbdsZ"
2737
+ };
2738
+ const sleep = (milliseconds) => {
2739
+ return new Promise((resolve) => setTimeout(resolve, milliseconds));
2740
+ };
2741
+ const baseClass$4 = "tooltip";
2742
+ const Tooltip = (props) => {
2743
+ const {
2744
+ triggerRenderer,
2745
+ referenceElement,
2746
+ children,
2747
+ className,
2748
+ theme,
2749
+ placement,
2750
+ isVisible,
2751
+ withFadeAnimation = true,
2752
+ transitionDuration = 200,
2753
+ transitionDelay = 0,
2754
+ hoverOutDelayTimeout = 100,
2755
+ offsetMainAxis = 8,
2756
+ triggerOnClick = false,
2757
+ arrowOffsetY,
2758
+ arrowOffsetX,
2759
+ onOpen,
2760
+ onClose
2761
+ } = props;
2762
+ const isManaged = isVisible !== void 0;
2763
+ const arrowRef = React.useRef(null);
2764
+ const [visible, setVisibility] = React.useState(isVisible);
2765
+ const isHovered = React.useRef(false);
2766
+ const {
2767
+ x,
2768
+ y,
2769
+ reference,
2770
+ floating,
2771
+ strategy,
2772
+ update,
2773
+ refs,
2774
+ placement: updatedPlacement,
2775
+ middlewareData: { arrow: { x: arrowX, y: arrowY } = {} }
2776
+ } = useFloating({
2777
+ middleware: [
2778
+ offset({ mainAxis: offsetMainAxis }),
2779
+ arrow({ element: arrowRef }),
2780
+ flip()
2781
+ ],
2782
+ placement
2783
+ });
2784
+ React.useEffect(() => {
2785
+ referenceElement && reference(referenceElement);
2786
+ }, [reference, referenceElement]);
2787
+ React.useEffect(() => {
2788
+ setVisibility(isVisible);
2789
+ }, [isVisible]);
2790
+ React.useEffect(() => {
2791
+ document.addEventListener("keydown", handleCloseAction);
2792
+ return () => {
2793
+ document.removeEventListener("keydown", handleCloseAction);
2794
+ };
2795
+ }, []);
2796
+ React.useEffect(() => {
2797
+ if (!refs.reference.current || !refs.floating.current) {
2798
+ return;
2799
+ }
2800
+ return autoUpdate(refs.reference.current, refs.floating.current, update);
2801
+ }, [refs.reference, refs.floating, update, updatedPlacement, visible]);
2802
+ const handleMouseLeave = () => {
2803
+ if (triggerOnClick || isManaged)
2804
+ return;
2805
+ isHovered.current = false;
2806
+ void sleep(hoverOutDelayTimeout).then(() => {
2807
+ if (!isHovered.current) {
2808
+ setVisibility(false);
2809
+ }
2810
+ });
2811
+ };
2812
+ const handleOpen = () => {
2813
+ if (onOpen)
2814
+ onOpen();
2815
+ if (!isManaged) {
2816
+ setVisibility(true);
2817
+ }
2818
+ };
2819
+ const handleClose = () => {
2820
+ if (onClose)
2821
+ onClose();
2822
+ if (!isManaged) {
2823
+ setVisibility(false);
2824
+ }
2825
+ };
2826
+ const handleMouseEnter = () => {
2827
+ if (triggerOnClick || isManaged)
2828
+ return;
2829
+ isHovered.current = true;
2830
+ setVisibility(true);
2831
+ };
2832
+ const handleCloseAction = (event) => {
2833
+ if (event instanceof KeyboardEvent && event.key === "Escape") {
2834
+ handleClose();
2835
+ }
2836
+ if (event.type === "click") {
2837
+ handleClose();
2838
+ }
2839
+ };
2840
+ const handleClick = () => {
2841
+ if (isManaged)
2842
+ return;
2843
+ if (visible) {
2844
+ handleClose();
2845
+ } else {
2846
+ handleOpen();
2847
+ }
2848
+ };
2849
+ const top = arrowOffsetY && arrowY ? arrowY + arrowOffsetY : arrowY;
2850
+ const left = arrowOffsetX && arrowX ? arrowX + arrowOffsetX : arrowX;
2851
+ const mergedClassNames = cx(styles[baseClass$4], className, {
2852
+ [styles[`${baseClass$4}--invert`]]: theme === "invert",
2853
+ [styles[`${baseClass$4}--important`]]: theme === "important"
2854
+ });
2855
+ const floatingComponent = /* @__PURE__ */ React.createElement("div", {
2856
+ ref: floating,
2857
+ style: {
2858
+ position: strategy,
2859
+ top: y != null ? y : "",
2860
+ left: x != null ? x : ""
2861
+ },
2862
+ className: mergedClassNames,
2863
+ onMouseEnter: handleMouseEnter,
2864
+ onMouseLeave: handleMouseLeave
2865
+ }, React.Children.map(children, (child) => {
2866
+ if (React.isValidElement(child)) {
2867
+ return React.cloneElement(child, __spreadValues({
2868
+ handleCloseAction,
2869
+ theme
2870
+ }, child.props));
2871
+ }
2872
+ return null;
2873
+ }), /* @__PURE__ */ React.createElement("div", {
2874
+ ref: arrowRef,
2875
+ className: cx([styles[`${baseClass$4}__arrow`]]),
2876
+ "data-arrow-placement": updatedPlacement,
2877
+ style: { top, left }
2878
+ }));
2879
+ function renderFloatingComponent() {
2880
+ if (withFadeAnimation) {
2881
+ const enter = css`
2882
+ opacity: 0;
2883
+ `;
2884
+ const enterActive = css`
2885
+ opacity: 1;
2886
+ transition-property: opacity;
2887
+ transition-duration: ${transitionDuration}ms;
2888
+ transition-delay: ${transitionDelay}ms;
2889
+ `;
2890
+ const exit = css`
2891
+ opacity: 1;
2892
+ `;
2893
+ const exitActive = css`
2894
+ opacity: 0;
2895
+ transition-property: opacity;
2896
+ transition-duration: ${transitionDuration}ms;
2897
+ transition-delay: ${transitionDelay}ms;
2898
+ `;
2899
+ const timeout = transitionDuration + transitionDelay;
2900
+ return /* @__PURE__ */ React.createElement(CSSTransition, {
2901
+ in: visible,
2902
+ mountOnEnter: true,
2903
+ unmountOnExit: true,
2904
+ timeout,
2905
+ classNames: {
2906
+ enter,
2907
+ enterActive,
2908
+ exit,
2909
+ exitActive
2910
+ }
2911
+ }, floatingComponent);
2912
+ } else {
2913
+ return visible && floatingComponent;
2914
+ }
2915
+ }
2916
+ if (referenceElement) {
2917
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, renderFloatingComponent());
2918
+ }
2919
+ const referenceOptions = () => {
2920
+ if (!isManaged) {
2921
+ if (triggerOnClick) {
2922
+ return {
2923
+ onClick: handleClick
2924
+ };
2925
+ } else {
2926
+ return {
2927
+ onMouseEnter: handleMouseEnter,
2928
+ onMouseLeave: handleMouseLeave
2929
+ };
2930
+ }
2931
+ }
2932
+ };
2933
+ const triggerElement = /* @__PURE__ */ React.createElement("div", __spreadValues({
2934
+ ref: reference
2935
+ }, referenceOptions()), triggerRenderer());
2936
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, triggerElement, renderFloatingComponent());
2937
+ };
2938
+ const Simple = ({ text }) => {
2939
+ return /* @__PURE__ */ React.createElement("div", null, text);
2940
+ };
2941
+ function getIconType(theme) {
2942
+ switch (theme) {
2943
+ case "invert":
2944
+ return "inverted";
2945
+ case "important":
2946
+ return "subtle";
2947
+ default:
2948
+ return "primary";
2949
+ }
2950
+ }
2951
+ const baseClass$3 = "tooltip";
2952
+ const Info = ({ header, text, closeWithX, theme, handleCloseAction }) => {
2953
+ return /* @__PURE__ */ React.createElement("div", {
2954
+ style: { position: "relative" }
2955
+ }, closeWithX && /* @__PURE__ */ React.createElement("div", {
2956
+ className: styles[`${baseClass$3}-close`],
2957
+ onClick: handleCloseAction
2958
+ }, /* @__PURE__ */ React.createElement(Icon, {
2959
+ source: Close,
2960
+ kind: theme ? getIconType(theme) : "primary"
2961
+ })), header && /* @__PURE__ */ React.createElement("div", {
2962
+ className: styles[`${baseClass$3}-header`]
2963
+ }, header), /* @__PURE__ */ React.createElement("div", {
2964
+ className: styles[`${baseClass$3}-text`]
2965
+ }, text));
2966
+ };
2967
+ const baseClass$2 = "tooltip";
2968
+ const Interactive = ({
2969
+ header,
2970
+ text,
2971
+ image,
2972
+ closeWithX,
2973
+ theme,
2974
+ handleCloseAction,
2975
+ handleClickPrimary,
2976
+ handleClickSecondary
2977
+ }) => {
2978
+ const decoration = theme === "invert" ? "underline" : "none";
2979
+ return /* @__PURE__ */ React.createElement("div", {
2980
+ style: { width: "270px" }
2981
+ }, /* @__PURE__ */ React.createElement("div", {
2982
+ style: { position: "relative", height: "25px", marginBottom: "10px" }
2983
+ }, closeWithX && /* @__PURE__ */ React.createElement("div", {
2984
+ className: styles[`${baseClass$2}-close`]
2985
+ }, /* @__PURE__ */ React.createElement("div", {
2986
+ onClick: handleCloseAction
2987
+ }, /* @__PURE__ */ React.createElement(Icon, {
2988
+ source: Close,
2989
+ kind: theme ? getIconType(theme) : "primary"
2990
+ })))), image && /* @__PURE__ */ React.createElement("div", {
2991
+ style: { margin: "0 4px" }
2992
+ }, /* @__PURE__ */ React.createElement("img", {
2993
+ className: styles[`${baseClass$2}-image`],
2994
+ src: image.src,
2995
+ alt: image.alt
2996
+ })), header && /* @__PURE__ */ React.createElement("div", {
2997
+ className: styles[`${baseClass$2}-header`]
2998
+ }, header), /* @__PURE__ */ React.createElement("div", {
2999
+ className: styles[`${baseClass$2}-text`]
3000
+ }, text), /* @__PURE__ */ React.createElement("div", {
3001
+ style: { margin: "4px" }
3002
+ }, /* @__PURE__ */ React.createElement(Button, {
3003
+ kind: "primary",
3004
+ onClick: handleClickPrimary
3005
+ }, "Primary button"), /* @__PURE__ */ React.createElement("div", {
3006
+ onClick: handleClickSecondary,
3007
+ style: {
3008
+ cursor: "pointer",
3009
+ display: "inline-block",
3010
+ marginLeft: "16px",
3011
+ textDecoration: decoration
3012
+ }
3013
+ }, "Link")));
3014
+ };
3015
+ const baseClass$1 = "guide-tooltip";
3016
+ const SpotlightOverlay = ({
3017
+ gap,
3018
+ isVisible,
3019
+ slide,
3020
+ disablePointerEvents
3021
+ }) => {
3022
+ if (!gap)
3023
+ return null;
3024
+ const overlayLeft = {
3025
+ top: `${gap.top}px`,
3026
+ left: "0",
3027
+ width: `${gap.left}px`,
3028
+ height: `${gap.height}px`
3029
+ };
3030
+ const overlayRight = {
3031
+ top: `${gap.top}px`,
3032
+ left: `${gap.right}px`,
3033
+ width: `calc(100% - ${gap.right}px)`,
3034
+ height: `${gap.height}px`
3035
+ };
3036
+ const overlayTop = {
3037
+ top: "0",
3038
+ left: "0",
3039
+ width: "100%",
3040
+ height: `${gap.top}px`
3041
+ };
3042
+ const overlayBottom = {
3043
+ top: `${gap.bottom}px`,
3044
+ left: "0",
3045
+ width: "100%",
3046
+ height: `calc(100% - ${gap.bottom}px)`
3047
+ };
3048
+ const spotlight = {
3049
+ top: `${gap.top}px`,
3050
+ left: `${gap.left}px`,
3051
+ width: `${gap.width}px`,
3052
+ height: `${gap.height}px`,
3053
+ backgroundColor: "transparent"
3054
+ };
3055
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
3056
+ className: cx({
3057
+ [styles[`${baseClass$1}__overlay`]]: true,
3058
+ [styles[`${baseClass$1}__overlay--visible`]]: isVisible,
3059
+ [styles[`${baseClass$1}__overlay--slide`]]: slide
3060
+ }),
3061
+ style: overlayLeft
3062
+ }), /* @__PURE__ */ React.createElement("div", {
3063
+ className: cx({
3064
+ [styles[`${baseClass$1}__overlay`]]: true,
3065
+ [styles[`${baseClass$1}__overlay--visible`]]: isVisible,
3066
+ [styles[`${baseClass$1}__overlay--slide`]]: slide
3067
+ }),
3068
+ style: overlayTop
3069
+ }), /* @__PURE__ */ React.createElement("div", {
3070
+ className: cx({
3071
+ [styles[`${baseClass$1}__overlay`]]: true,
3072
+ [styles[`${baseClass$1}__overlay--visible`]]: isVisible,
3073
+ [styles[`${baseClass$1}__overlay--slide`]]: slide
3074
+ }),
3075
+ style: overlayRight
3076
+ }), /* @__PURE__ */ React.createElement("div", {
3077
+ className: cx({
3078
+ [styles[`${baseClass$1}__overlay`]]: true,
3079
+ [styles[`${baseClass$1}__overlay--visible`]]: isVisible,
3080
+ [styles[`${baseClass$1}__overlay--slide`]]: slide
3081
+ }),
3082
+ style: overlayBottom
3083
+ }), disablePointerEvents && /* @__PURE__ */ React.createElement("div", {
3084
+ className: cx({
3085
+ [styles[`${baseClass$1}__overlay`]]: true,
3086
+ [styles[`${baseClass$1}__overlay--visible`]]: isVisible,
3087
+ [styles[`${baseClass$1}__overlay--slide`]]: slide
3088
+ }),
3089
+ style: spotlight
3090
+ }));
3091
+ };
3092
+ class VirtualReference {
3093
+ constructor(element, padding) {
3094
+ __publicField(this, "element");
3095
+ __publicField(this, "padding");
3096
+ this.element = element;
3097
+ this.padding = padding;
3098
+ }
3099
+ addPadding(rect) {
3100
+ const x = Math.round(rect.left) - this.padding;
3101
+ const y = Math.round(rect.top) - this.padding;
3102
+ const width = Math.round(rect.width) + 2 * this.padding;
3103
+ const height = Math.round(rect.height) + 2 * this.padding;
3104
+ const top = y;
3105
+ const left = x;
3106
+ const bottom = top + height;
3107
+ const right = left + width;
3108
+ return {
3109
+ x,
3110
+ y,
3111
+ width,
3112
+ height,
3113
+ top,
3114
+ left,
3115
+ bottom,
3116
+ right
3117
+ };
3118
+ }
3119
+ getBoundingClientRect() {
3120
+ return this.addPadding(this.element.getBoundingClientRect());
3121
+ }
3122
+ get clientWidth() {
3123
+ return this.getBoundingClientRect().width;
3124
+ }
3125
+ get clientHeight() {
3126
+ return this.getBoundingClientRect().height;
3127
+ }
3128
+ }
3129
+ const spotlightPadding = 8;
3130
+ const baseClass = "guide-tooltip";
3131
+ const virtualReference = (element, padding) => new VirtualReference(element, padding);
3132
+ const UserGuide = (props) => {
3133
+ const {
3134
+ className,
3135
+ parentElementName,
3136
+ isVisible = false,
3137
+ shouldSlide = true
3138
+ } = props;
3139
+ const [parentElement, setParentElement] = React.useState(null);
3140
+ const [rect, setRect] = React.useState(null);
3141
+ const [isSliding, setIsSliding] = React.useState(shouldSlide);
3142
+ const handleViewportChange = () => {
3143
+ if (parentElement) {
3144
+ setRect(virtualReference(parentElement, spotlightPadding).getBoundingClientRect());
3145
+ setIsSliding(false);
3146
+ }
3147
+ };
3148
+ React.useEffect(() => {
3149
+ if (parentElement !== null) {
3150
+ window.addEventListener("resize", handleViewportChange);
3151
+ window.addEventListener("scroll", handleViewportChange);
3152
+ return () => {
3153
+ window.addEventListener("resize", handleViewportChange);
3154
+ window.addEventListener("resize", handleViewportChange);
3155
+ };
3156
+ }
3157
+ }, [parentElement, parentElementName]);
3158
+ React.useEffect(() => {
3159
+ if (parentElementName) {
3160
+ const element = document.querySelector(parentElementName);
3161
+ setParentElement(element);
3162
+ }
3163
+ }, [parentElementName]);
3164
+ React.useEffect(() => {
3165
+ parentElement && setRect(virtualReference(parentElement, spotlightPadding).getBoundingClientRect());
3166
+ setIsSliding(true);
3167
+ }, [parentElement]);
3168
+ return parentElement && isVisible ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(SpotlightOverlay, {
3169
+ gap: rect,
3170
+ isVisible,
3171
+ slide: isSliding,
3172
+ disablePointerEvents: true
3173
+ }), /* @__PURE__ */ React.createElement(Tooltip, __spreadProps(__spreadValues({}, props), {
3174
+ referenceElement: {
3175
+ getBoundingClientRect: () => {
3176
+ return rect;
3177
+ },
3178
+ contextElement: parentElement
3179
+ },
3180
+ arrowOffsetY: 25,
3181
+ className: cx({
3182
+ [styles[baseClass]]: true,
3183
+ [styles[`${baseClass}--slide`]]: isSliding,
3184
+ className
3185
+ })
3186
+ }), props.children)) : null;
3187
+ };
3188
+ 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 };