@youngonesworks/ui 1.0.3 → 1.0.5
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.
- package/dist/components/radioButton/index.d.ts +2 -2
- package/dist/hooks/phone/usePhoneNumberPrefix.d.ts +2 -1
- package/dist/index.cjs +287 -412
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +198 -338
- package/dist/index.js.map +1 -1
- package/dist/jsx-runtime-shim.d.ts +1 -3
- package/dist/styles/variables.css +1 -1
- package/dist/utils/formatIcon.d.ts +1 -1
- package/package.json +22 -24
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//#region rolldown:runtime
|
|
1
|
+
"use client";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
5
4
|
var __create = Object.create;
|
|
6
5
|
var __defProp = Object.defineProperty;
|
|
7
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -22,40 +21,39 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
21
|
value: mod,
|
|
23
22
|
enumerable: true
|
|
24
23
|
}) : target, mod));
|
|
25
|
-
|
|
26
24
|
//#endregion
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
25
|
+
let react = require("react");
|
|
26
|
+
react = __toESM(react);
|
|
27
|
+
let _tabler_icons_react = require("@tabler/icons-react");
|
|
28
|
+
let clsx = require("clsx");
|
|
29
|
+
clsx = __toESM(clsx);
|
|
30
|
+
let tailwind_merge = require("tailwind-merge");
|
|
31
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
let _floating_ui_react = require("@floating-ui/react");
|
|
33
|
+
let react_day_picker = require("react-day-picker");
|
|
34
|
+
let date_fns = require("date-fns");
|
|
35
|
+
let date_fns_locale = require("date-fns/locale");
|
|
36
|
+
let react_dom = require("react-dom");
|
|
37
|
+
let react_tooltip = require("react-tooltip");
|
|
38
|
+
let phone = require("phone");
|
|
39
|
+
phone = __toESM(phone);
|
|
40
|
+
let country_list_with_dial_code_and_flag = require("country-list-with-dial-code-and-flag");
|
|
41
|
+
country_list_with_dial_code_and_flag = __toESM(country_list_with_dial_code_and_flag);
|
|
42
|
+
let _tiptap_extension_placeholder = require("@tiptap/extension-placeholder");
|
|
43
|
+
let _tiptap_extension_underline = require("@tiptap/extension-underline");
|
|
44
|
+
let _tiptap_react = require("@tiptap/react");
|
|
45
|
+
let _tiptap_starter_kit = require("@tiptap/starter-kit");
|
|
46
|
+
react.createElement;
|
|
47
|
+
react.createElement;
|
|
48
|
+
react.Fragment;
|
|
50
49
|
//#endregion
|
|
51
50
|
//#region src/utils/cn.ts
|
|
52
51
|
function cn(...inputs) {
|
|
53
52
|
return (0, tailwind_merge.twMerge)((0, clsx.default)(inputs));
|
|
54
53
|
}
|
|
55
|
-
|
|
56
54
|
//#endregion
|
|
57
55
|
//#region src/components/unstyledButton/index.tsx
|
|
58
|
-
const UnstyledButton = (0, react.forwardRef)(({ className
|
|
56
|
+
const UnstyledButton = (0, react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
59
57
|
type: "button",
|
|
60
58
|
"data-component": "unstyledButton",
|
|
61
59
|
className: cn("appearance-none", className),
|
|
@@ -63,7 +61,6 @@ const UnstyledButton = (0, react.forwardRef)(({ className,...props }, ref) => /*
|
|
|
63
61
|
...props
|
|
64
62
|
}));
|
|
65
63
|
UnstyledButton.displayName = "UnstyledButton";
|
|
66
|
-
|
|
67
64
|
//#endregion
|
|
68
65
|
//#region src/components/accordion/AccordionItem.tsx
|
|
69
66
|
const AccordionItem = ({ controlContent, panelContent, style = "light", border = false, chevronPosition = "left", disabled = false, active = false, endContent, className }) => {
|
|
@@ -88,7 +85,7 @@ const AccordionItem = ({ controlContent, panelContent, style = "light", border =
|
|
|
88
85
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
89
86
|
onClick: () => setIsActive(!isActive),
|
|
90
87
|
className: `duration-300${isActive ? "rotate-180" : ""}`,
|
|
91
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
88
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconChevronDown, {
|
|
92
89
|
size: 18,
|
|
93
90
|
color: style === "dark" ? "white" : "black"
|
|
94
91
|
})
|
|
@@ -109,7 +106,6 @@ const AccordionItem = ({ controlContent, panelContent, style = "light", border =
|
|
|
109
106
|
})]
|
|
110
107
|
}) });
|
|
111
108
|
};
|
|
112
|
-
|
|
113
109
|
//#endregion
|
|
114
110
|
//#region src/components/accordion/AccordionWrapper.tsx
|
|
115
111
|
const AccordionWrapper = ({ children, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -118,21 +114,16 @@ const AccordionWrapper = ({ children, className }) => /* @__PURE__ */ (0, react_
|
|
|
118
114
|
className: cn(className, "flex flex-col gap-2"),
|
|
119
115
|
children
|
|
120
116
|
});
|
|
121
|
-
|
|
122
117
|
//#endregion
|
|
123
118
|
//#region src/hooks/useMergeRefs.ts
|
|
124
119
|
function useMergeRefs(...refs) {
|
|
125
120
|
return (0, react.useCallback)((value) => {
|
|
126
121
|
refs.forEach((ref) => {
|
|
127
|
-
if (typeof ref === "function")
|
|
128
|
-
|
|
129
|
-
} else if (ref) {
|
|
130
|
-
ref.current = value;
|
|
131
|
-
}
|
|
122
|
+
if (typeof ref === "function") ref(value);
|
|
123
|
+
else if (ref) ref.current = value;
|
|
132
124
|
});
|
|
133
125
|
}, [refs]);
|
|
134
126
|
}
|
|
135
|
-
|
|
136
127
|
//#endregion
|
|
137
128
|
//#region src/components/tooltip/index.tsx
|
|
138
129
|
const sizeClasses = {
|
|
@@ -144,23 +135,23 @@ const sizeClasses = {
|
|
|
144
135
|
const Tooltip = ({ content, children, passedOpen = false, size = "md", variant = "default" }) => {
|
|
145
136
|
const [isOpen, setIsOpen] = (0, react.useState)(passedOpen);
|
|
146
137
|
const arrowRef = (0, react.useRef)(null);
|
|
147
|
-
const { refs, floatingStyles, context } = (0,
|
|
138
|
+
const { refs, floatingStyles, context } = (0, _floating_ui_react.useFloating)({
|
|
148
139
|
open: isOpen,
|
|
149
140
|
onOpenChange: setIsOpen,
|
|
150
141
|
placement: "top",
|
|
151
142
|
middleware: [
|
|
152
|
-
variant === "default" ? (0,
|
|
153
|
-
(0,
|
|
154
|
-
(0,
|
|
155
|
-
(0,
|
|
143
|
+
variant === "default" ? (0, _floating_ui_react.offset)(20) : (0, _floating_ui_react.offset)(25),
|
|
144
|
+
(0, _floating_ui_react.flip)(),
|
|
145
|
+
(0, _floating_ui_react.shift)(),
|
|
146
|
+
(0, _floating_ui_react.arrow)({ element: arrowRef })
|
|
156
147
|
],
|
|
157
|
-
whileElementsMounted:
|
|
148
|
+
whileElementsMounted: _floating_ui_react.autoUpdate
|
|
158
149
|
});
|
|
159
|
-
const hover = (0,
|
|
160
|
-
const focus = (0,
|
|
161
|
-
const dismiss = (0,
|
|
162
|
-
const role = (0,
|
|
163
|
-
const { getReferenceProps, getFloatingProps } = (0,
|
|
150
|
+
const hover = (0, _floating_ui_react.useHover)(context, { move: false });
|
|
151
|
+
const focus = (0, _floating_ui_react.useFocus)(context);
|
|
152
|
+
const dismiss = (0, _floating_ui_react.useDismiss)(context);
|
|
153
|
+
const role = (0, _floating_ui_react.useRole)(context, { role: "tooltip" });
|
|
154
|
+
const { getReferenceProps, getFloatingProps } = (0, _floating_ui_react.useInteractions)([
|
|
164
155
|
hover,
|
|
165
156
|
focus,
|
|
166
157
|
dismiss,
|
|
@@ -186,7 +177,7 @@ const Tooltip = ({ content, children, passedOpen = false, size = "md", variant =
|
|
|
186
177
|
"data-testid": "tooltip-content",
|
|
187
178
|
className: `${sizeClasses[size]} px-2 py-1 text-sm font-normal`,
|
|
188
179
|
children: content
|
|
189
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
180
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingArrow, {
|
|
190
181
|
ref: arrowRef,
|
|
191
182
|
context,
|
|
192
183
|
width: 10,
|
|
@@ -202,7 +193,7 @@ const Tooltip = ({ content, children, passedOpen = false, size = "md", variant =
|
|
|
202
193
|
"data-testid": "tooltip-content",
|
|
203
194
|
className: `${sizeClasses[size]} overflow-hidden bg-white p-5 px-2 py-1 text-start text-sm font-normal`,
|
|
204
195
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: content })
|
|
205
|
-
}), size === "md" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
196
|
+
}), size === "md" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingArrow, {
|
|
206
197
|
ref: arrowRef,
|
|
207
198
|
context,
|
|
208
199
|
width: 25,
|
|
@@ -211,7 +202,7 @@ const Tooltip = ({ content, children, passedOpen = false, size = "md", variant =
|
|
|
211
202
|
fill: "white",
|
|
212
203
|
className: "drop-shadow-xl",
|
|
213
204
|
"data-testid": "tooltip-arrow"
|
|
214
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
205
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingArrow, {
|
|
215
206
|
ref: arrowRef,
|
|
216
207
|
context,
|
|
217
208
|
width: 10,
|
|
@@ -225,65 +216,52 @@ const Tooltip = ({ content, children, passedOpen = false, size = "md", variant =
|
|
|
225
216
|
})] });
|
|
226
217
|
};
|
|
227
218
|
Tooltip.displayName = "Tooltip";
|
|
228
|
-
|
|
229
219
|
//#endregion
|
|
230
220
|
//#region src/utils/enums.ts
|
|
231
|
-
let ACTION_ICON_STYLE_VARIANT = /* @__PURE__ */ function(ACTION_ICON_STYLE_VARIANT
|
|
232
|
-
ACTION_ICON_STYLE_VARIANT
|
|
233
|
-
ACTION_ICON_STYLE_VARIANT
|
|
234
|
-
ACTION_ICON_STYLE_VARIANT
|
|
235
|
-
ACTION_ICON_STYLE_VARIANT
|
|
236
|
-
return ACTION_ICON_STYLE_VARIANT
|
|
221
|
+
let ACTION_ICON_STYLE_VARIANT = /* @__PURE__ */ function(ACTION_ICON_STYLE_VARIANT) {
|
|
222
|
+
ACTION_ICON_STYLE_VARIANT["DEFAULT"] = "default";
|
|
223
|
+
ACTION_ICON_STYLE_VARIANT["TRANSPARENT"] = "transparent";
|
|
224
|
+
ACTION_ICON_STYLE_VARIANT["SMALL"] = "small";
|
|
225
|
+
ACTION_ICON_STYLE_VARIANT["ROUND"] = "round";
|
|
226
|
+
return ACTION_ICON_STYLE_VARIANT;
|
|
237
227
|
}({});
|
|
238
|
-
let THEME_ICON_STYLE_VARIANT = /* @__PURE__ */ function(THEME_ICON_STYLE_VARIANT
|
|
239
|
-
THEME_ICON_STYLE_VARIANT
|
|
240
|
-
return THEME_ICON_STYLE_VARIANT
|
|
228
|
+
let THEME_ICON_STYLE_VARIANT = /* @__PURE__ */ function(THEME_ICON_STYLE_VARIANT) {
|
|
229
|
+
THEME_ICON_STYLE_VARIANT["SECONDARY_WITH_BACKGROUND"] = "secondary-with-background";
|
|
230
|
+
return THEME_ICON_STYLE_VARIANT;
|
|
241
231
|
}({});
|
|
242
|
-
let COLOR = /* @__PURE__ */ function(COLOR
|
|
243
|
-
COLOR
|
|
244
|
-
COLOR
|
|
245
|
-
COLOR
|
|
246
|
-
COLOR
|
|
247
|
-
COLOR
|
|
248
|
-
COLOR
|
|
249
|
-
COLOR
|
|
250
|
-
COLOR
|
|
251
|
-
COLOR
|
|
252
|
-
COLOR
|
|
253
|
-
COLOR
|
|
254
|
-
COLOR
|
|
255
|
-
COLOR
|
|
256
|
-
COLOR
|
|
257
|
-
COLOR
|
|
258
|
-
COLOR
|
|
259
|
-
COLOR
|
|
260
|
-
COLOR
|
|
261
|
-
COLOR
|
|
262
|
-
COLOR
|
|
263
|
-
COLOR
|
|
264
|
-
COLOR
|
|
265
|
-
COLOR
|
|
266
|
-
COLOR
|
|
267
|
-
COLOR
|
|
268
|
-
COLOR
|
|
269
|
-
COLOR
|
|
270
|
-
COLOR
|
|
271
|
-
COLOR
|
|
272
|
-
COLOR
|
|
273
|
-
return COLOR
|
|
232
|
+
let COLOR = /* @__PURE__ */ function(COLOR) {
|
|
233
|
+
COLOR["PRIMARY"] = "primary";
|
|
234
|
+
COLOR["BLACK"] = "black";
|
|
235
|
+
COLOR["NAVY_BLUE"] = "navy-blue";
|
|
236
|
+
COLOR["LIGHT_BLUE"] = "light-blue";
|
|
237
|
+
COLOR["LIGHT_BLUE_DISABLED"] = "light-blue-disabled";
|
|
238
|
+
COLOR["GREEN"] = "green";
|
|
239
|
+
COLOR["GREEN_LIGHT"] = "green-light";
|
|
240
|
+
COLOR["SECONDARY"] = "secondary";
|
|
241
|
+
COLOR["SECONDARY_LIGHT"] = "secondary-light";
|
|
242
|
+
COLOR["ORANGE"] = "orange";
|
|
243
|
+
COLOR["ORANGE_LIGHT"] = "orange-light";
|
|
244
|
+
COLOR["ACCENT_BLUE"] = "accent-blue";
|
|
245
|
+
COLOR["ACCENT_BLUE_LIGHT"] = "accent-blue-light";
|
|
246
|
+
COLOR["YELLOW"] = "yellow";
|
|
247
|
+
COLOR["CHECK"] = "check";
|
|
248
|
+
COLOR["WARNING"] = "warning";
|
|
249
|
+
COLOR["ERROR"] = "error";
|
|
250
|
+
COLOR["SUCCESS"] = "success";
|
|
251
|
+
COLOR["WARNING_LIGHT"] = "warning-light";
|
|
252
|
+
COLOR["ULTRA_LIGHT_BLUE"] = "ultra-light-blue";
|
|
253
|
+
COLOR["ULTRA_LIGHT_GRAY"] = "ultra-light-gray";
|
|
254
|
+
COLOR["ULTRA_LIGHT_BLUE_GRAY"] = "ultra-light-blue-gray";
|
|
255
|
+
COLOR["TURQUOISE"] = "turquoise";
|
|
256
|
+
COLOR["RED"] = "red";
|
|
257
|
+
COLOR["DARK_GRAY"] = "dark-gray";
|
|
258
|
+
COLOR["GRAY"] = "gray";
|
|
259
|
+
COLOR["WHITE"] = "white";
|
|
260
|
+
COLOR["PURPLE"] = "purple";
|
|
261
|
+
COLOR["PURPLE_LIGHT"] = "purple-light";
|
|
262
|
+
COLOR["NAVY_BLUE_SHADES"] = "navy-blue-shades";
|
|
263
|
+
return COLOR;
|
|
274
264
|
}({});
|
|
275
|
-
let REGION = /* @__PURE__ */ function(REGION$1) {
|
|
276
|
-
REGION$1["NETHERLANDS"] = "nl";
|
|
277
|
-
REGION$1["BELGIUM"] = "nl-BE";
|
|
278
|
-
REGION$1["UNITED_KINGDOM"] = "gb";
|
|
279
|
-
return REGION$1;
|
|
280
|
-
}({});
|
|
281
|
-
let TOOLTIP_COLOR = /* @__PURE__ */ function(TOOLTIP_COLOR$1) {
|
|
282
|
-
TOOLTIP_COLOR$1["DEFAULT"] = "default";
|
|
283
|
-
TOOLTIP_COLOR$1["WHITE"] = "white";
|
|
284
|
-
return TOOLTIP_COLOR$1;
|
|
285
|
-
}({});
|
|
286
|
-
|
|
287
265
|
//#endregion
|
|
288
266
|
//#region src/utils/formatIcon.ts
|
|
289
267
|
const globalDefaultFormatAttributes = {};
|
|
@@ -298,13 +276,12 @@ function formatIcon(icon, defaultFormatAttributes) {
|
|
|
298
276
|
...globalDefaultFormatAttributes,
|
|
299
277
|
...defaultFormatAttributes,
|
|
300
278
|
...icon.props,
|
|
301
|
-
|
|
279
|
+
className: (0, clsx.default)(globalDefaultFormatAttributes.className, defaultFormatAttributes.className, icon.props.className)
|
|
302
280
|
});
|
|
303
281
|
}
|
|
304
|
-
|
|
305
282
|
//#endregion
|
|
306
283
|
//#region src/components/actionIcon/index.tsx
|
|
307
|
-
const ActionIcon = ({ ref, title, disabled = false, styleVariant = "default", icon, type = "button", "data-testid": testId, iconSize = 20, strokeWidth = 1, onClick, className
|
|
284
|
+
const ActionIcon = ({ ref, title, disabled = false, styleVariant = "default", icon, type = "button", "data-testid": testId, iconSize = 20, strokeWidth = 1, onClick, className, ...props }) => {
|
|
308
285
|
const variantClassNames = (0, clsx.default)({
|
|
309
286
|
"active:translate-y-[1px] content-center flex items-center justify-center rounded-[4px] border border-gray-200 hover:border-black text-black child:p-10 w-[36px] h-[36px] disabled:text-gray-500": styleVariant === ACTION_ICON_STYLE_VARIANT.DEFAULT,
|
|
310
287
|
"active:translate-y-[1px] border-none content-center flex items-center justify-center rounded-[4px] border text-black child:p-10 w-[36px] h-[36px] disabled:text-gray-500": styleVariant === ACTION_ICON_STYLE_VARIANT.TRANSPARENT,
|
|
@@ -334,31 +311,28 @@ const ActionIcon = ({ ref, title, disabled = false, styleVariant = "default", ic
|
|
|
334
311
|
}) });
|
|
335
312
|
};
|
|
336
313
|
ActionIcon.displayName = "ActionIcon";
|
|
337
|
-
|
|
338
314
|
//#endregion
|
|
339
315
|
//#region src/components/alert/index.tsx
|
|
340
|
-
const Alert = ({ show, title, description, type = "warning", button, plain = false, closable = false, className, icon, onClose
|
|
316
|
+
const Alert = ({ show, title, description, type = "warning", button, plain = false, closable = false, className, icon, onClose, ...props }) => {
|
|
341
317
|
if (!show || !title) return null;
|
|
342
|
-
const
|
|
318
|
+
const { bg, iconColor, Icon } = {
|
|
343
319
|
success: {
|
|
344
320
|
bg: "bg-green-light",
|
|
345
321
|
iconColor: "text-green",
|
|
346
|
-
Icon:
|
|
322
|
+
Icon: _tabler_icons_react.IconCircleCheck
|
|
347
323
|
},
|
|
348
324
|
warning: {
|
|
349
325
|
bg: "bg-warning-light",
|
|
350
326
|
iconColor: "text-warning",
|
|
351
|
-
Icon:
|
|
327
|
+
Icon: _tabler_icons_react.IconAlertTriangle
|
|
352
328
|
},
|
|
353
329
|
error: {
|
|
354
330
|
bg: "bg-red-50",
|
|
355
331
|
iconColor: "text-red-500",
|
|
356
|
-
Icon:
|
|
332
|
+
Icon: _tabler_icons_react.IconAlertCircle
|
|
357
333
|
}
|
|
358
|
-
};
|
|
359
|
-
const
|
|
360
|
-
const { bg, iconColor, Icon } = config;
|
|
361
|
-
const descriptionId = description ? "alert-desc" : undefined;
|
|
334
|
+
}[type];
|
|
335
|
+
const descriptionId = description ? "alert-desc" : void 0;
|
|
362
336
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
363
337
|
role: "alert",
|
|
364
338
|
"aria-live": "assertive",
|
|
@@ -383,7 +357,7 @@ const Alert = ({ show, title, description, type = "warning", button, plain = fal
|
|
|
383
357
|
"data-testid": "alert-icon",
|
|
384
358
|
"aria-hidden": "true"
|
|
385
359
|
})), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
386
|
-
className: "text-base
|
|
360
|
+
className: "yo-text-base",
|
|
387
361
|
children: title
|
|
388
362
|
})]
|
|
389
363
|
}),
|
|
@@ -404,7 +378,7 @@ const Alert = ({ show, title, description, type = "warning", button, plain = fal
|
|
|
404
378
|
onClick: onClose,
|
|
405
379
|
"aria-label": "Dismiss alert",
|
|
406
380
|
"data-testid": "alert-close",
|
|
407
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
381
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconX, {
|
|
408
382
|
size: 18,
|
|
409
383
|
"aria-hidden": "true"
|
|
410
384
|
})
|
|
@@ -412,7 +386,6 @@ const Alert = ({ show, title, description, type = "warning", button, plain = fal
|
|
|
412
386
|
});
|
|
413
387
|
};
|
|
414
388
|
Alert.displayName = "Alert";
|
|
415
|
-
|
|
416
389
|
//#endregion
|
|
417
390
|
//#region src/components/appleAppButtonIcon/index.tsx
|
|
418
391
|
const AppleAppButtonIcon = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
@@ -553,10 +526,9 @@ const AppleAppButtonIcon = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs
|
|
|
553
526
|
})
|
|
554
527
|
}) })]
|
|
555
528
|
});
|
|
556
|
-
|
|
557
529
|
//#endregion
|
|
558
530
|
//#region src/icons/IconLoading.tsx
|
|
559
|
-
const IconLoading = ({ className
|
|
531
|
+
const IconLoading = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
560
532
|
"data-component": "button",
|
|
561
533
|
"data-testid": "loading-svg-button",
|
|
562
534
|
viewBox: "0 0 256 256",
|
|
@@ -640,10 +612,9 @@ const IconLoading = ({ className,...props }) => /* @__PURE__ */ (0, react_jsx_ru
|
|
|
640
612
|
})
|
|
641
613
|
]
|
|
642
614
|
});
|
|
643
|
-
|
|
644
615
|
//#endregion
|
|
645
616
|
//#region src/components/textInput/index.tsx
|
|
646
|
-
const TextInput = react.default.forwardRef(({ rightSection, leftSection, className, error, autoFocus, label, maxLength, enablePasswordManagerAutofill = false, onBlur, disabled, loadingState, onKeyDown, min = "0", max, autoComplete, showRightSection = true, step, wrapperClassName, password = false
|
|
617
|
+
const TextInput = react.default.forwardRef(({ rightSection, leftSection, className, error, autoFocus, label, maxLength, enablePasswordManagerAutofill = false, onBlur, disabled, loadingState, onKeyDown, min = "0", max, autoComplete, showRightSection = true, step, wrapperClassName, password = false, ...props }, ref) => {
|
|
647
618
|
const [showPassword, setShowPassword] = react.default.useState(false);
|
|
648
619
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
649
620
|
"data-component": "TextInput",
|
|
@@ -673,9 +644,9 @@ const TextInput = react.default.forwardRef(({ rightSection, leftSection, classNa
|
|
|
673
644
|
step,
|
|
674
645
|
maxLength,
|
|
675
646
|
className: (0, clsx.default)(`${loadingState ? "cursor-not-allowed" : ""}`, `${disabled ? "text-gray-500" : "text-gray-900"} selection:bg-turquoise-200 focus:border-turquoise-500 focus:ring-turquoise-500 active:border-turquoise-500 active:ring-turquoise-500 h-10 w-full rounded-[4px] border border-gray-200 bg-ultra-light-gray px-3 text-sm font-normal outline-hidden ${rightSection && "pr-12"} ${leftSection && "pl-12"} ${error && "border-red-500 text-red-500 selection:bg-red-200 focus:border-red-500 focus:ring-red-500 focus:placeholder:text-red-500 active:border-red-500 active:ring-red-500"}`, className),
|
|
676
|
-
"aria-busy": loadingState ||
|
|
677
|
-
"data-lpignore": enablePasswordManagerAutofill ?
|
|
678
|
-
"data-1p-ignore": enablePasswordManagerAutofill ?
|
|
647
|
+
"aria-busy": loadingState || void 0,
|
|
648
|
+
"data-lpignore": enablePasswordManagerAutofill ? void 0 : "true",
|
|
649
|
+
"data-1p-ignore": enablePasswordManagerAutofill ? void 0 : "true",
|
|
679
650
|
ref,
|
|
680
651
|
...props,
|
|
681
652
|
type: password ? showPassword ? "text" : "password" : "text"
|
|
@@ -692,12 +663,12 @@ const TextInput = react.default.forwardRef(({ rightSection, leftSection, classNa
|
|
|
692
663
|
}),
|
|
693
664
|
password && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
694
665
|
className: "absolute inset-y-0 right-4 flex content-center items-center justify-center align-middle text-sm font-medium text-black",
|
|
695
|
-
children: showPassword ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
666
|
+
children: showPassword ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconEyeCheck, {
|
|
696
667
|
"data-testid": "password-visibility-toggle",
|
|
697
668
|
className: "cursor-pointer text-gray-500",
|
|
698
669
|
size: 15,
|
|
699
670
|
onClick: () => setShowPassword(false)
|
|
700
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
671
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconEyeOff, {
|
|
701
672
|
"data-testid": "password-visibility-toggle",
|
|
702
673
|
className: "cursor-pointer text-gray-500",
|
|
703
674
|
size: 15,
|
|
@@ -713,7 +684,6 @@ const TextInput = react.default.forwardRef(({ rightSection, leftSection, classNa
|
|
|
713
684
|
]
|
|
714
685
|
});
|
|
715
686
|
});
|
|
716
|
-
|
|
717
687
|
//#endregion
|
|
718
688
|
//#region src/components/autoCompleteInput/index.tsx
|
|
719
689
|
const AutoCompleteInput = ({ label, onChange, onFocus, inputValue, showSuggestions, handleOnKeyDown, children, error, rightSection, inputRef }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -734,7 +704,6 @@ const AutoCompleteInput = ({ label, onChange, onFocus, inputValue, showSuggestio
|
|
|
734
704
|
"aria-controls": "suggestions-googlemaps-location-list"
|
|
735
705
|
}), showSuggestions && inputValue && children]
|
|
736
706
|
});
|
|
737
|
-
|
|
738
707
|
//#endregion
|
|
739
708
|
//#region src/components/avatar/index.tsx
|
|
740
709
|
const radiusFormatter = {
|
|
@@ -760,10 +729,9 @@ const Avatar = ({ src, alt = "", size = 50, radius = 100, "data-testid": dataTes
|
|
|
760
729
|
})
|
|
761
730
|
});
|
|
762
731
|
Avatar.displayName = "Avatar";
|
|
763
|
-
|
|
764
732
|
//#endregion
|
|
765
733
|
//#region src/components/avatarIndicator/index.tsx
|
|
766
|
-
const AvatarIndicator = ({ indicatorCount, className
|
|
734
|
+
const AvatarIndicator = ({ indicatorCount, className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
767
735
|
className: cn("grid h-5 min-w-5 w-fit flex-col place-content-center items-center justify-center rounded-full bg-white px-0.5", className),
|
|
768
736
|
"data-component": "AvatarIndicator",
|
|
769
737
|
"data-testid": "AvatarIndicator",
|
|
@@ -773,10 +741,9 @@ const AvatarIndicator = ({ indicatorCount, className,...props }) => /* @__PURE__
|
|
|
773
741
|
children: `+${indicatorCount}`
|
|
774
742
|
})
|
|
775
743
|
});
|
|
776
|
-
|
|
777
744
|
//#endregion
|
|
778
745
|
//#region src/components/badge/index.tsx
|
|
779
|
-
const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, children
|
|
746
|
+
const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, children, ...props }) => {
|
|
780
747
|
if (!children) return null;
|
|
781
748
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
782
749
|
"data-testid": "badge",
|
|
@@ -803,10 +770,9 @@ const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, children
|
|
|
803
770
|
});
|
|
804
771
|
};
|
|
805
772
|
Badge.displayName = "Badge";
|
|
806
|
-
|
|
807
773
|
//#endregion
|
|
808
774
|
//#region src/components/bigBadge/index.tsx
|
|
809
|
-
const BigBadge = ({ styleVariant = COLOR.GREEN, className, children
|
|
775
|
+
const BigBadge = ({ styleVariant = COLOR.GREEN, className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
810
776
|
"data-component": "BigBadge",
|
|
811
777
|
"data-testid": "big-badge",
|
|
812
778
|
className: cn("grid h-9 max-w-full min-w-[140px] place-content-center rounded-full border border-solid px-6 py-1 text-sm font-medium whitespace-nowrap lowercase", {
|
|
@@ -822,19 +788,17 @@ const BigBadge = ({ styleVariant = COLOR.GREEN, className, children,...props })
|
|
|
822
788
|
...props,
|
|
823
789
|
children
|
|
824
790
|
});
|
|
825
|
-
|
|
826
791
|
//#endregion
|
|
827
792
|
//#region src/components/breadCrumb/index.tsx
|
|
828
793
|
const BreadCrumb = ({ children, LinkText }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkText, {
|
|
829
794
|
"data-component": "BreadCrumb",
|
|
830
795
|
classNames: "flex items-center",
|
|
831
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
796
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconArrowNarrowLeft, { size: 20 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
832
797
|
className: "flex items-center gap-5",
|
|
833
798
|
children
|
|
834
799
|
})] })
|
|
835
800
|
});
|
|
836
801
|
BreadCrumb.displayName = "BreadCrumb";
|
|
837
|
-
|
|
838
802
|
//#endregion
|
|
839
803
|
//#region src/components/button/buttonVariants.ts
|
|
840
804
|
const defaultButtonStyling = "justify-center group relative flex items-center gap-2 cursor-pointer border rounded py-2 px-5 text-sx md:text-sm md:font-medium font-medium hover:outline-hidden focus:outline-hidden disabled:cursor-not-allowed transition-colors duration-100 ease-in-out";
|
|
@@ -849,10 +813,9 @@ const buttonVariants = {
|
|
|
849
813
|
icon__danger: (0, clsx.default)(defaultButtonStyling, "flex! items-center justify-center"),
|
|
850
814
|
action: (0, clsx.default)(defaultButtonStyling, "w-full bg-transparent border border-gray-200 whitespace-nowrap", "lg:w-[36px] lg:h-[36px]", "lg:p-0 lg:gap-0", "lg:hover:bg-transparent lg:hover:border-black", "lg:[&_svg]:-ml-2 lg:[&_svg]:-mr-2")
|
|
851
815
|
};
|
|
852
|
-
|
|
853
816
|
//#endregion
|
|
854
817
|
//#region src/components/button/index.tsx
|
|
855
|
-
function Button({ type = "button", variant = "primary", ariaLabel, block = false, isLoading = false, icon: iconFromProps = null, iconRight = false, onClick, className, children, dataTestId
|
|
818
|
+
function Button({ type = "button", variant = "primary", ariaLabel, block = false, isLoading = false, icon: iconFromProps = null, iconRight = false, onClick, className, children, dataTestId, ...props }) {
|
|
856
819
|
const loadingIcon = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconLoading, { className: "animate-spin-slow mr-2 stroke-current" });
|
|
857
820
|
const icon = isLoading ? loadingIcon : iconFromProps;
|
|
858
821
|
const formattedIcon = icon ? formatIcon(icon, { className: (0, clsx.default)({
|
|
@@ -877,10 +840,9 @@ function Button({ type = "button", variant = "primary", ariaLabel, block = false
|
|
|
877
840
|
});
|
|
878
841
|
}
|
|
879
842
|
Button.displayName = "Button";
|
|
880
|
-
|
|
881
843
|
//#endregion
|
|
882
844
|
//#region src/components/checkbox/index.tsx
|
|
883
|
-
const CheckboxComponent = ({ size = "md", className, error, mediumBoldText, label, labelClassName, indeterminate = false, disabled = false
|
|
845
|
+
const CheckboxComponent = ({ size = "md", className, error, mediumBoldText, label, labelClassName, indeterminate = false, disabled = false, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
884
846
|
"data-testid": "checkbox-wrapper",
|
|
885
847
|
className: cn("relative grid gap-2", className),
|
|
886
848
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
@@ -938,42 +900,39 @@ const CheckboxComponent = ({ size = "md", className, error, mediumBoldText, labe
|
|
|
938
900
|
})]
|
|
939
901
|
});
|
|
940
902
|
const Checkbox = (0, react.forwardRef)(CheckboxComponent);
|
|
941
|
-
|
|
942
903
|
//#endregion
|
|
943
904
|
//#region src/components/popover/index.tsx
|
|
944
905
|
const Popover = (0, react.forwardRef)(({ content, children, hoverEnabled = false, passedOpen = false, placement = "right", style = "card", isMobile = false, className }, ref) => {
|
|
945
906
|
const [isOpen, setIsOpen] = (0, react.useState)(passedOpen);
|
|
946
907
|
const mobileStyles = { width: `${style === "card" && "100%"}` };
|
|
947
|
-
const { refs, floatingStyles, context } = (0,
|
|
908
|
+
const { refs, floatingStyles, context } = (0, _floating_ui_react.useFloating)({
|
|
948
909
|
open: isOpen,
|
|
949
910
|
onOpenChange: setIsOpen,
|
|
950
911
|
placement: !isMobile ? placement : "bottom-start",
|
|
951
912
|
middleware: [
|
|
952
|
-
!isMobile && (0,
|
|
953
|
-
!isMobile && (0,
|
|
954
|
-
(0,
|
|
913
|
+
!isMobile && (0, _floating_ui_react.flip)(),
|
|
914
|
+
!isMobile && (0, _floating_ui_react.shift)(),
|
|
915
|
+
(0, _floating_ui_react.offset)(() => ({
|
|
955
916
|
mainAxis: 15,
|
|
956
917
|
crossAxis: !isMobile ? 0 : 78
|
|
957
918
|
}))
|
|
958
919
|
],
|
|
959
|
-
whileElementsMounted:
|
|
920
|
+
whileElementsMounted: _floating_ui_react.autoUpdate
|
|
960
921
|
});
|
|
961
|
-
const click = (0,
|
|
922
|
+
const click = (0, _floating_ui_react.useClick)(context, {
|
|
962
923
|
event: "click",
|
|
963
924
|
keyboardHandlers: true
|
|
964
925
|
});
|
|
965
|
-
const focus = (0,
|
|
966
|
-
const hover = (0,
|
|
967
|
-
const dismiss = (0, __floating_ui_react.useDismiss)(context);
|
|
968
|
-
const role = (0, __floating_ui_react.useRole)(context, { role: "tooltip" });
|
|
926
|
+
const focus = (0, _floating_ui_react.useFocus)(context);
|
|
927
|
+
const hover = (0, _floating_ui_react.useHover)(context, { enabled: hoverEnabled });
|
|
969
928
|
const interactions = [
|
|
970
929
|
click,
|
|
971
930
|
focus,
|
|
972
|
-
|
|
973
|
-
role,
|
|
931
|
+
(0, _floating_ui_react.useDismiss)(context),
|
|
932
|
+
(0, _floating_ui_react.useRole)(context, { role: "tooltip" }),
|
|
974
933
|
hover
|
|
975
934
|
];
|
|
976
|
-
const { getReferenceProps, getFloatingProps } = (0,
|
|
935
|
+
const { getReferenceProps, getFloatingProps } = (0, _floating_ui_react.useInteractions)(interactions);
|
|
977
936
|
(0, react.useImperativeHandle)(ref, () => ({
|
|
978
937
|
closePopover: () => setIsOpen(false),
|
|
979
938
|
openPopover: () => setIsOpen(true),
|
|
@@ -1005,7 +964,7 @@ const Popover = (0, react.forwardRef)(({ content, children, hoverEnabled = false
|
|
|
1005
964
|
children: [!hoverEnabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActionIcon, {
|
|
1006
965
|
onClick: () => setIsOpen(false),
|
|
1007
966
|
title: "",
|
|
1008
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
967
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconX, {}),
|
|
1009
968
|
styleVariant: "small",
|
|
1010
969
|
className: "absolute top-5 right-5"
|
|
1011
970
|
}), content]
|
|
@@ -1014,12 +973,11 @@ const Popover = (0, react.forwardRef)(({ content, children, hoverEnabled = false
|
|
|
1014
973
|
})]
|
|
1015
974
|
});
|
|
1016
975
|
});
|
|
1017
|
-
|
|
1018
976
|
//#endregion
|
|
1019
977
|
//#region src/components/datePickerInput/index.tsx
|
|
1020
978
|
const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil, className, error, onChange, placeholder, label, disabled, minimalDropdownYears = 4 }) => {
|
|
1021
979
|
const [selected, setSelected] = (0, react.useState)(value);
|
|
1022
|
-
const today = new Date();
|
|
980
|
+
const today = /* @__PURE__ */ new Date();
|
|
1023
981
|
const [newMonth, setNewMonth] = (0, react.useState)(selected || today);
|
|
1024
982
|
const [dropdownOpened, setDropdownOpened] = (0, react.useState)({
|
|
1025
983
|
month: false,
|
|
@@ -1098,9 +1056,9 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
1098
1056
|
fixedWeeks: true,
|
|
1099
1057
|
endMonth: (0, date_fns.addMonths)(today, 13),
|
|
1100
1058
|
captionLayout: "dropdown",
|
|
1101
|
-
onMonthChange: (newMonth
|
|
1059
|
+
onMonthChange: (newMonth) => setNewMonth(newMonth),
|
|
1102
1060
|
showOutsideDays: true,
|
|
1103
|
-
disabled: disabledFrom ? { before: disabledFrom } : disabledUntil ? { after: disabledUntil } :
|
|
1061
|
+
disabled: disabledFrom ? { before: disabledFrom } : disabledUntil ? { after: disabledUntil } : void 0,
|
|
1104
1062
|
className,
|
|
1105
1063
|
classNames: {
|
|
1106
1064
|
month_grid: "mt-3 max-w-[400px] border-t border-gray-100",
|
|
@@ -1123,7 +1081,7 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
1123
1081
|
},
|
|
1124
1082
|
components: {
|
|
1125
1083
|
DayButton: (props) => {
|
|
1126
|
-
const { day
|
|
1084
|
+
const { day, ...buttonProps } = props;
|
|
1127
1085
|
const { goToMonth } = (0, react_day_picker.useDayPicker)();
|
|
1128
1086
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1129
1087
|
type: "button",
|
|
@@ -1138,7 +1096,7 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
1138
1096
|
Dropdown: (props) => {
|
|
1139
1097
|
const { goToMonth, months } = (0, react_day_picker.useDayPicker)();
|
|
1140
1098
|
const { className: dropdownClassName } = props;
|
|
1141
|
-
const today
|
|
1099
|
+
const today = /* @__PURE__ */ new Date();
|
|
1142
1100
|
/* istanbul ignore next - react-day-picker may not pass this className in our test env */
|
|
1143
1101
|
if (dropdownClassName === "rdp-months_dropdown") {
|
|
1144
1102
|
const selectedYear = newMonth.getFullYear();
|
|
@@ -1164,8 +1122,7 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
1164
1122
|
className: "shadow-dropdown absolute z-70 rounded-md border border-gray-50 bg-white",
|
|
1165
1123
|
children: selectItems.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1166
1124
|
onClick: () => {
|
|
1167
|
-
|
|
1168
|
-
goToMonth(newDate);
|
|
1125
|
+
goToMonth(new Date(selectedYear, parseInt(item.value)));
|
|
1169
1126
|
setDropdownOpened({
|
|
1170
1127
|
month: false,
|
|
1171
1128
|
year: false
|
|
@@ -1180,14 +1137,14 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
1180
1137
|
type: "button",
|
|
1181
1138
|
className: "absolute top-4 right-4 z-10 h-8 px-3 text-xs font-normal",
|
|
1182
1139
|
onClick: () => {
|
|
1183
|
-
goToMonth(today
|
|
1184
|
-
handleDayClick(today
|
|
1140
|
+
goToMonth(today);
|
|
1141
|
+
handleDayClick(today);
|
|
1185
1142
|
},
|
|
1186
1143
|
children: todayText
|
|
1187
1144
|
})] });
|
|
1188
1145
|
} else if (dropdownClassName === "rdp-years_dropdown") {
|
|
1189
|
-
const earliestYear = new Date().getFullYear() - minimalDropdownYears;
|
|
1190
|
-
const latestYear = new Date().getFullYear() + 1;
|
|
1146
|
+
const earliestYear = (/* @__PURE__ */ new Date()).getFullYear() - minimalDropdownYears;
|
|
1147
|
+
const latestYear = (/* @__PURE__ */ new Date()).getFullYear() + 1;
|
|
1191
1148
|
/* istanbul ignore else - defensive guard will always be truthy */
|
|
1192
1149
|
if (earliestYear && latestYear) {
|
|
1193
1150
|
const years = Array.from({ length: latestYear - earliestYear + 1 }, (_, i) => earliestYear + i).reverse();
|
|
@@ -1206,7 +1163,7 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
1206
1163
|
className: "shadow-dropdown absolute z-70 rounded-md border border-gray-50 bg-white max-h-64 overflow-y-auto",
|
|
1207
1164
|
children: years.map((year) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1208
1165
|
onClick: () => {
|
|
1209
|
-
const newDate = months?.[0].date || new Date();
|
|
1166
|
+
const newDate = months?.[0].date || /* @__PURE__ */ new Date();
|
|
1210
1167
|
newDate.setFullYear(year);
|
|
1211
1168
|
goToMonth(newDate);
|
|
1212
1169
|
setDropdownOpened({
|
|
@@ -1246,28 +1203,28 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
1246
1203
|
),
|
|
1247
1204
|
onClick: () => setNewMonth(today),
|
|
1248
1205
|
children: [
|
|
1249
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1206
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconCalendar, {}),
|
|
1250
1207
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1251
1208
|
className: "text-sm font-normal text-nowrap text-black",
|
|
1252
1209
|
children: selected ? selected.toLocaleDateString() : placeholder
|
|
1253
1210
|
}),
|
|
1254
|
-
selected !==
|
|
1211
|
+
selected !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1255
1212
|
className: "cursor-pointer text-sm font-normal text-gray-800",
|
|
1256
1213
|
role: "button",
|
|
1257
1214
|
"aria-label": "Clear date",
|
|
1258
1215
|
tabIndex: 0,
|
|
1259
1216
|
onClick: () => {
|
|
1260
|
-
setSelected(
|
|
1261
|
-
onChange?.(
|
|
1217
|
+
setSelected(void 0);
|
|
1218
|
+
onChange?.(void 0);
|
|
1262
1219
|
},
|
|
1263
1220
|
onKeyDown: (e) => {
|
|
1264
1221
|
if (e.key === "Enter" || e.key === " ") {
|
|
1265
1222
|
e.preventDefault();
|
|
1266
|
-
setSelected(
|
|
1267
|
-
onChange?.(
|
|
1223
|
+
setSelected(void 0);
|
|
1224
|
+
onChange?.(void 0);
|
|
1268
1225
|
}
|
|
1269
1226
|
},
|
|
1270
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1227
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconX, { size: 15 })
|
|
1271
1228
|
}) })
|
|
1272
1229
|
]
|
|
1273
1230
|
}),
|
|
@@ -1279,19 +1236,17 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
1279
1236
|
})
|
|
1280
1237
|
});
|
|
1281
1238
|
};
|
|
1282
|
-
|
|
1283
1239
|
//#endregion
|
|
1284
1240
|
//#region src/components/divider/index.tsx
|
|
1285
|
-
const Divider = ({ className
|
|
1241
|
+
const Divider = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1286
1242
|
"data-component": "divider",
|
|
1287
1243
|
className: (0, clsx.default)("block h-px w-full bg-gray-200", className),
|
|
1288
1244
|
...props
|
|
1289
1245
|
});
|
|
1290
|
-
|
|
1291
1246
|
//#endregion
|
|
1292
1247
|
//#region src/components/favouriteButton/index.tsx
|
|
1293
1248
|
const FavouriteButton = (0, react.forwardRef)((props, ref) => {
|
|
1294
|
-
const { onClick, favourite, iconFilled, iconOutline, favouriteTitle, iconColorSelected = "text-secondary", iconColor = "text-gray-800", iconSize, className = "", styleVariant = "transparent", children
|
|
1249
|
+
const { onClick, favourite, iconFilled, iconOutline, favouriteTitle, iconColorSelected = "text-secondary", iconColor = "text-gray-800", iconSize, className = "", styleVariant = "transparent", children, ...rest } = props;
|
|
1295
1250
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActionIcon, {
|
|
1296
1251
|
onClick,
|
|
1297
1252
|
"data-component": "favouriteButton",
|
|
@@ -1300,12 +1255,11 @@ const FavouriteButton = (0, react.forwardRef)((props, ref) => {
|
|
|
1300
1255
|
className: `${favourite ? iconColorSelected : iconColor} ${className}`.trim(),
|
|
1301
1256
|
iconSize,
|
|
1302
1257
|
ref,
|
|
1303
|
-
icon: favourite ? iconFilled ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1258
|
+
icon: favourite ? iconFilled ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconHeartFilled, {}) : iconOutline ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconHeart, {}),
|
|
1304
1259
|
...rest,
|
|
1305
1260
|
children
|
|
1306
1261
|
});
|
|
1307
1262
|
});
|
|
1308
|
-
|
|
1309
1263
|
//#endregion
|
|
1310
1264
|
//#region src/components/filters/FilterButton.tsx
|
|
1311
1265
|
const FilterButton = ({ onClick, hasFilters, reset, filtersText, resetText }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1315,7 +1269,7 @@ const FilterButton = ({ onClick, hasFilters, reset, filtersText, resetText }) =>
|
|
|
1315
1269
|
onClick,
|
|
1316
1270
|
variant: "secondary",
|
|
1317
1271
|
className: "font-normal md:font-normal",
|
|
1318
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1272
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconFilter, { stroke: 1 }),
|
|
1319
1273
|
children: filtersText
|
|
1320
1274
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnstyledButton, {
|
|
1321
1275
|
className: "text-sm font-normal disabled:text-gray-500",
|
|
@@ -1324,7 +1278,6 @@ const FilterButton = ({ onClick, hasFilters, reset, filtersText, resetText }) =>
|
|
|
1324
1278
|
children: resetText
|
|
1325
1279
|
})]
|
|
1326
1280
|
});
|
|
1327
|
-
|
|
1328
1281
|
//#endregion
|
|
1329
1282
|
//#region src/components/filters/FilterItem.tsx
|
|
1330
1283
|
const FilterItem = ({ title, isActive = false, onClick }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
@@ -1336,7 +1289,6 @@ const FilterItem = ({ title, isActive = false, onClick }) => /* @__PURE__ */ (0,
|
|
|
1336
1289
|
checked: isActive
|
|
1337
1290
|
}), title]
|
|
1338
1291
|
});
|
|
1339
|
-
|
|
1340
1292
|
//#endregion
|
|
1341
1293
|
//#region src/components/filters/index.tsx
|
|
1342
1294
|
const Filters = ({ filters, setFilters, selectedFilters, selectedFiltersText, filtersText, resetText }) => {
|
|
@@ -1382,7 +1334,6 @@ const Filters = ({ filters, setFilters, selectedFilters, selectedFiltersText, fi
|
|
|
1382
1334
|
})]
|
|
1383
1335
|
});
|
|
1384
1336
|
};
|
|
1385
|
-
|
|
1386
1337
|
//#endregion
|
|
1387
1338
|
//#region src/components/googleAppButtonIcon/index.tsx
|
|
1388
1339
|
const GoogleAppButtonIcon = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
@@ -1574,7 +1525,6 @@ const GoogleAppButtonIcon = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx
|
|
|
1574
1525
|
]
|
|
1575
1526
|
})]
|
|
1576
1527
|
});
|
|
1577
|
-
|
|
1578
1528
|
//#endregion
|
|
1579
1529
|
//#region src/components/hamburgerMenuButton/index.tsx
|
|
1580
1530
|
const HamburgerMenuButton = (0, react.forwardRef)(({ menuState, setMenuState }, ref) => {
|
|
@@ -1603,7 +1553,6 @@ const HamburgerMenuButton = (0, react.forwardRef)(({ menuState, setMenuState },
|
|
|
1603
1553
|
});
|
|
1604
1554
|
});
|
|
1605
1555
|
HamburgerMenuButton.displayName = "HamburgerMenuButton";
|
|
1606
|
-
|
|
1607
1556
|
//#endregion
|
|
1608
1557
|
//#region src/components/hr/index.tsx
|
|
1609
1558
|
const HR = ({ className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", {
|
|
@@ -1611,10 +1560,9 @@ const HR = ({ className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", {
|
|
|
1611
1560
|
className: `h-px w-full border-none bg-gray-200 ${className}`
|
|
1612
1561
|
});
|
|
1613
1562
|
HR.displayName = "HR";
|
|
1614
|
-
|
|
1615
1563
|
//#endregion
|
|
1616
1564
|
//#region src/components/island/index.tsx
|
|
1617
|
-
const Island = ({ children, className, noShadow = false, noPadding = false
|
|
1565
|
+
const Island = ({ children, className, noShadow = false, noPadding = false, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1618
1566
|
"data-testid": "island",
|
|
1619
1567
|
"data-component": "island",
|
|
1620
1568
|
className: cn("relative bg-white px-5 py-5 md:px-10 md:py-9", {
|
|
@@ -1626,7 +1574,6 @@ const Island = ({ children, className, noShadow = false, noPadding = false,...pr
|
|
|
1626
1574
|
children
|
|
1627
1575
|
});
|
|
1628
1576
|
Island.displayName = "Island";
|
|
1629
|
-
|
|
1630
1577
|
//#endregion
|
|
1631
1578
|
//#region src/components/kebabMenu/index.tsx
|
|
1632
1579
|
const KebabMenu = ({ title, tooltip, content, disabled = false, styleVariant = "default" }) => {
|
|
@@ -1662,7 +1609,7 @@ const KebabMenu = ({ title, tooltip, content, disabled = false, styleVariant = "
|
|
|
1662
1609
|
children: [title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1663
1610
|
className: "yo-text-small hidden md:block",
|
|
1664
1611
|
children: title
|
|
1665
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1612
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconDotsVertical, {
|
|
1666
1613
|
size: 20,
|
|
1667
1614
|
stroke: 1,
|
|
1668
1615
|
fill: "black"
|
|
@@ -1689,7 +1636,7 @@ const KebabMenu = ({ title, tooltip, content, disabled = false, styleVariant = "
|
|
|
1689
1636
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1690
1637
|
className: "absolute right-0 z-10 mt-2 w-auto min-w-[200px] rounded-md border-[0.0625rem] border-gray-200 bg-white p-1 shadow-md",
|
|
1691
1638
|
children: content.map((c, index) => {
|
|
1692
|
-
const button
|
|
1639
|
+
const button = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnstyledButton, {
|
|
1693
1640
|
onClick: () => handleItemClick(c.onClick),
|
|
1694
1641
|
className: "w-full rounded-md px-4 py-2 text-left text-sm font-normal whitespace-nowrap hover:bg-gray-50",
|
|
1695
1642
|
"aria-label": "Options Menu Item",
|
|
@@ -1700,25 +1647,23 @@ const KebabMenu = ({ title, tooltip, content, disabled = false, styleVariant = "
|
|
|
1700
1647
|
passedOpen: false,
|
|
1701
1648
|
size: "sm",
|
|
1702
1649
|
content: c.tooltip,
|
|
1703
|
-
children: button
|
|
1704
|
-
}, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: button
|
|
1650
|
+
children: button
|
|
1651
|
+
}, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: button }, index);
|
|
1705
1652
|
})
|
|
1706
1653
|
})
|
|
1707
1654
|
})]
|
|
1708
1655
|
}) });
|
|
1709
1656
|
};
|
|
1710
1657
|
KebabMenu.displayName = "KebabMenu";
|
|
1711
|
-
|
|
1712
1658
|
//#endregion
|
|
1713
1659
|
//#region src/components/label/index.tsx
|
|
1714
|
-
const Label = ({ children, className
|
|
1660
|
+
const Label = ({ children, className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1715
1661
|
"data-component": "label",
|
|
1716
1662
|
"data-testid": "label",
|
|
1717
1663
|
className: cn("flex items-center gap-1 text-xs font-medium text-black", className),
|
|
1718
1664
|
...props,
|
|
1719
1665
|
children
|
|
1720
1666
|
});
|
|
1721
|
-
|
|
1722
1667
|
//#endregion
|
|
1723
1668
|
//#region src/components/loader/index.tsx
|
|
1724
1669
|
const Loader = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -1730,7 +1675,6 @@ const Loader = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
|
1730
1675
|
})
|
|
1731
1676
|
});
|
|
1732
1677
|
Loader.displayName = "Loader";
|
|
1733
|
-
|
|
1734
1678
|
//#endregion
|
|
1735
1679
|
//#region src/components/logo/index.tsx
|
|
1736
1680
|
const LogoBlack = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
@@ -1800,7 +1744,6 @@ const LogoBlack = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg",
|
|
|
1800
1744
|
})
|
|
1801
1745
|
}) })]
|
|
1802
1746
|
});
|
|
1803
|
-
|
|
1804
1747
|
//#endregion
|
|
1805
1748
|
//#region src/components/modal/index.tsx
|
|
1806
1749
|
const Modal = ({ title, children, withCloseButton = true, opened, additionalClassNames, closeModalWithConfirmation = false, gradient = true, uncloseAble = false, confirmText = "Are you sure you want to close this modal?", dataTestId, onClose, size }) => {
|
|
@@ -1878,7 +1821,7 @@ const Modal = ({ title, children, withCloseButton = true, opened, additionalClas
|
|
|
1878
1821
|
"aria-label": "close modal",
|
|
1879
1822
|
className: "absolute top-0 right-0",
|
|
1880
1823
|
"data-testid": "close-modal",
|
|
1881
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1824
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconX, {}),
|
|
1882
1825
|
title: "Close modal"
|
|
1883
1826
|
})
|
|
1884
1827
|
}),
|
|
@@ -1901,7 +1844,6 @@ const Modal = ({ title, children, withCloseButton = true, opened, additionalClas
|
|
|
1901
1844
|
}), document.body);
|
|
1902
1845
|
};
|
|
1903
1846
|
Modal.displayName = "Modal";
|
|
1904
|
-
|
|
1905
1847
|
//#endregion
|
|
1906
1848
|
//#region src/components/navButtons/index.tsx
|
|
1907
1849
|
const NavButtons = ({ onNext, onPrev }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1911,7 +1853,7 @@ const NavButtons = ({ onNext, onPrev }) => /* @__PURE__ */ (0, react_jsx_runtime
|
|
|
1911
1853
|
"data-testid": "chevron-left",
|
|
1912
1854
|
className: `flex ${onPrev ? "cursor-pointer hover:bg-gray-50" : "cursor-not-allowed"} h-full items-center px-2`,
|
|
1913
1855
|
onClick: onPrev,
|
|
1914
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1856
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconChevronLeft, {
|
|
1915
1857
|
size: 20,
|
|
1916
1858
|
className: onPrev ? "text-gray-500" : "text-gray-200"
|
|
1917
1859
|
})
|
|
@@ -1921,14 +1863,13 @@ const NavButtons = ({ onNext, onPrev }) => /* @__PURE__ */ (0, react_jsx_runtime
|
|
|
1921
1863
|
"data-testid": "chevron-right",
|
|
1922
1864
|
className: `flex ${onNext ? "cursor-pointer hover:bg-gray-50" : "cursor-not-allowed"} h-full items-center px-2 hover:bg-gray-50`,
|
|
1923
1865
|
onClick: onNext,
|
|
1924
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1866
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconChevronRight, {
|
|
1925
1867
|
size: 20,
|
|
1926
1868
|
className: onNext ? "text-gray-500" : "text-gray-200"
|
|
1927
1869
|
})
|
|
1928
1870
|
})
|
|
1929
1871
|
]
|
|
1930
1872
|
});
|
|
1931
|
-
|
|
1932
1873
|
//#endregion
|
|
1933
1874
|
//#region src/components/numberField/index.tsx
|
|
1934
1875
|
const NumberField = ({ name, value = 0, max, min = 0, isDisabled, id, className = "", label, error, onChange }) => {
|
|
@@ -1988,7 +1929,6 @@ const NumberField = ({ name, value = 0, max, min = 0, isDisabled, id, className
|
|
|
1988
1929
|
]
|
|
1989
1930
|
});
|
|
1990
1931
|
};
|
|
1991
|
-
|
|
1992
1932
|
//#endregion
|
|
1993
1933
|
//#region src/components/pageUnavailable/index.tsx
|
|
1994
1934
|
const PageUnavailable = ({ notAvailableButton, notAvailableDescription, notAvailableHeaderText }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Island, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2002,7 +1942,6 @@ const PageUnavailable = ({ notAvailableButton, notAvailableDescription, notAvail
|
|
|
2002
1942
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: notAvailableButton })
|
|
2003
1943
|
]
|
|
2004
1944
|
}) });
|
|
2005
|
-
|
|
2006
1945
|
//#endregion
|
|
2007
1946
|
//#region src/components/passwordInput/index.tsx
|
|
2008
1947
|
const PasswordInput = react.default.forwardRef((props, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextInput, {
|
|
@@ -2013,7 +1952,6 @@ const PasswordInput = react.default.forwardRef((props, ref) => /* @__PURE__ */ (
|
|
|
2013
1952
|
ref
|
|
2014
1953
|
}));
|
|
2015
1954
|
PasswordInput.displayName = "PasswordInput";
|
|
2016
|
-
|
|
2017
1955
|
//#endregion
|
|
2018
1956
|
//#region src/components/progressBar/index.tsx
|
|
2019
1957
|
const ProgressBar = ({ value, maxValue = 100, className }) => {
|
|
@@ -2037,10 +1975,9 @@ const ProgressBar = ({ value, maxValue = 100, className }) => {
|
|
|
2037
1975
|
})
|
|
2038
1976
|
});
|
|
2039
1977
|
};
|
|
2040
|
-
|
|
2041
1978
|
//#endregion
|
|
2042
1979
|
//#region src/components/radioButton/index.tsx
|
|
2043
|
-
const RadioButton = ({ id, name, value, label, onChange, checked, dataTestId, className, containerClassName, labelClassName
|
|
1980
|
+
const RadioButton = ({ id, name, value, label, onChange, checked, dataTestId, className, containerClassName, labelClassName, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2044
1981
|
"data-testid": "radio-button-container",
|
|
2045
1982
|
className: `${containerClassName || "radio-button-container"} relative flex items-start`,
|
|
2046
1983
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2050,7 +1987,7 @@ const RadioButton = ({ id, name, value, label, onChange, checked, dataTestId, cl
|
|
|
2050
1987
|
id,
|
|
2051
1988
|
name,
|
|
2052
1989
|
value,
|
|
2053
|
-
onChange: props.disabled ?
|
|
1990
|
+
onChange: props.disabled ? void 0 : onChange,
|
|
2054
1991
|
checked,
|
|
2055
1992
|
"data-testid": dataTestId,
|
|
2056
1993
|
className: `${(0, clsx.default)(className, "ease checked:border-navyBlue checked:bg-navy-blue relative m-0 flex size-5 cursor-pointer appearance-none items-center justify-center rounded-full border border-gray-400 bg-white transition-colors duration-100 focus:ring-0 focus:outline-hidden focus-visible:ring-0", { "cursor-not-allowed opacity-50": props.disabled })}`,
|
|
@@ -2073,7 +2010,6 @@ const RadioButton = ({ id, name, value, label, onChange, checked, dataTestId, cl
|
|
|
2073
2010
|
})]
|
|
2074
2011
|
});
|
|
2075
2012
|
RadioButton.displayName = "RadioButton";
|
|
2076
|
-
|
|
2077
2013
|
//#endregion
|
|
2078
2014
|
//#region src/icons/IconStarEmpty.tsx
|
|
2079
2015
|
const IconStarEmpty = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
@@ -2090,7 +2026,6 @@ const IconStarEmpty = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg
|
|
|
2090
2026
|
fill: "#E0E0E0"
|
|
2091
2027
|
})
|
|
2092
2028
|
});
|
|
2093
|
-
|
|
2094
2029
|
//#endregion
|
|
2095
2030
|
//#region src/icons/IconStarFilled.tsx
|
|
2096
2031
|
const IconStarFilled = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
@@ -2107,7 +2042,6 @@ const IconStarFilled = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("sv
|
|
|
2107
2042
|
fill: "currentColor"
|
|
2108
2043
|
})
|
|
2109
2044
|
});
|
|
2110
|
-
|
|
2111
2045
|
//#endregion
|
|
2112
2046
|
//#region src/icons/IconStarHalfFilled.tsx
|
|
2113
2047
|
const IconStarHalfFilled = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
@@ -2127,7 +2061,6 @@ const IconStarHalfFilled = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs
|
|
|
2127
2061
|
fill: "currentColor"
|
|
2128
2062
|
})]
|
|
2129
2063
|
});
|
|
2130
|
-
|
|
2131
2064
|
//#endregion
|
|
2132
2065
|
//#region src/components/rating/index.tsx
|
|
2133
2066
|
const Rating = ({ rating, ratings, size = "normal", setReview, className, setReviewError, error }) => {
|
|
@@ -2136,7 +2069,7 @@ const Rating = ({ rating, ratings, size = "normal", setReview, className, setRev
|
|
|
2136
2069
|
const [reviewIsSet, setReviewIsSet] = (0, react.useState)(false);
|
|
2137
2070
|
const currentRating = hoveredStars || Math.round(rating * 2) / 2;
|
|
2138
2071
|
const currentSmallRating = hoveredSmallStars;
|
|
2139
|
-
const sizeClasses
|
|
2072
|
+
const sizeClasses = {
|
|
2140
2073
|
small: "h-4 w-4",
|
|
2141
2074
|
normal: "h-[22px] w-[22px]",
|
|
2142
2075
|
large: "h-[32px] w-[32px]"
|
|
@@ -2150,29 +2083,26 @@ const Rating = ({ rating, ratings, size = "normal", setReview, className, setRev
|
|
|
2150
2083
|
const handleHover = (value) => setReview && setHoveredStars(value);
|
|
2151
2084
|
const StarIcon = ({ index }) => {
|
|
2152
2085
|
if (!setReview) {
|
|
2153
|
-
const roundedRating
|
|
2154
|
-
const hasHalf
|
|
2155
|
-
const effectiveRating
|
|
2156
|
-
|
|
2157
|
-
if (index
|
|
2158
|
-
|
|
2159
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarEmpty, { className: `text-yellow ${sizeClasses$1[size]}` });
|
|
2086
|
+
const roundedRating = Math.round(rating * 2) / 2;
|
|
2087
|
+
const hasHalf = roundedRating % 1 === .5;
|
|
2088
|
+
const effectiveRating = roundedRating;
|
|
2089
|
+
if (index <= Math.floor(effectiveRating)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarFilled, { className: `text-yellow ${sizeClasses[size]}` });
|
|
2090
|
+
if (hasHalf && index === Math.ceil(effectiveRating)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarHalfFilled, { className: `text-yellow ${sizeClasses[size]}` });
|
|
2091
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarEmpty, { className: `text-yellow ${sizeClasses[size]}` });
|
|
2160
2092
|
}
|
|
2161
2093
|
const displayRating = reviewIsSet ? Number(reviewIsSet) : currentRating;
|
|
2162
2094
|
const roundedRating = Math.round(displayRating * 2) / 2;
|
|
2163
2095
|
const hasHalf = roundedRating % 1 === .5;
|
|
2164
2096
|
const effectiveRating = roundedRating;
|
|
2165
|
-
|
|
2166
|
-
if (index
|
|
2167
|
-
|
|
2168
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarEmpty, { className: `text-yellow ${sizeClasses$1[size]} ` });
|
|
2097
|
+
if (index <= Math.floor(effectiveRating)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarFilled, { className: `text-yellow ${sizeClasses[size]}` });
|
|
2098
|
+
if (hasHalf && index === Math.ceil(effectiveRating)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarHalfFilled, { className: `text-yellow ${sizeClasses[size]}` });
|
|
2099
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarEmpty, { className: `text-yellow ${sizeClasses[size]} ` });
|
|
2169
2100
|
};
|
|
2170
|
-
const StarSmallIcon = ({ index, className
|
|
2171
|
-
const
|
|
2172
|
-
|
|
2173
|
-
if (index ===
|
|
2174
|
-
|
|
2175
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarEmpty, { className: cn(className$1, "text-yellow") });
|
|
2101
|
+
const StarSmallIcon = ({ index, className }) => {
|
|
2102
|
+
const roundedRating = Math.round(currentSmallRating * 2) / 2;
|
|
2103
|
+
if (index === roundedRating) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarFilled, { className: cn(className, "text-yellow") });
|
|
2104
|
+
if (index - roundedRating === .5) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarHalfFilled, { className: cn(className, "text-yellow") });
|
|
2105
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarEmpty, { className: cn(className, "text-yellow") });
|
|
2176
2106
|
};
|
|
2177
2107
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2178
2108
|
className: cn("flex flex-col", className),
|
|
@@ -2215,10 +2145,9 @@ const Rating = ({ rating, ratings, size = "normal", setReview, className, setRev
|
|
|
2215
2145
|
]
|
|
2216
2146
|
});
|
|
2217
2147
|
};
|
|
2218
|
-
|
|
2219
2148
|
//#endregion
|
|
2220
2149
|
//#region src/components/regionSelector/index.tsx
|
|
2221
|
-
const RegionSelector = ({ title, regions
|
|
2150
|
+
const RegionSelector = ({ title, regions, ...props }) => {
|
|
2222
2151
|
if (regions?.length === 0) return null;
|
|
2223
2152
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2224
2153
|
"data-component": "regionSelector",
|
|
@@ -2235,7 +2164,6 @@ const RegionSelector = ({ title, regions,...props }) => {
|
|
|
2235
2164
|
});
|
|
2236
2165
|
};
|
|
2237
2166
|
RegionSelector.displayName = "RegionSelector";
|
|
2238
|
-
|
|
2239
2167
|
//#endregion
|
|
2240
2168
|
//#region src/components/reviews/index.tsx
|
|
2241
2169
|
const ReviewsLine = ({ maxValue, amount, countStarsText }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2297,7 +2225,6 @@ const Reviews = ({ totalRatings, ratings, averageRating, aggregatedRating, count
|
|
|
2297
2225
|
})
|
|
2298
2226
|
})]
|
|
2299
2227
|
});
|
|
2300
|
-
|
|
2301
2228
|
//#endregion
|
|
2302
2229
|
//#region src/components/scrollToTop/index.tsx
|
|
2303
2230
|
const ScrollToTop = ({ scrollToTopTitle }) => {
|
|
@@ -2331,16 +2258,15 @@ const ScrollToTop = ({ scrollToTopTitle }) => {
|
|
|
2331
2258
|
onClick: scrollToTop,
|
|
2332
2259
|
"data-tooltip-id": scrollToTopTitle,
|
|
2333
2260
|
"data-tooltip-content": scrollToTopTitle,
|
|
2334
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2261
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconChevronUp, {})
|
|
2335
2262
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_tooltip.Tooltip, {
|
|
2336
2263
|
id: scrollToTopTitle,
|
|
2337
2264
|
className: "z-[99]"
|
|
2338
2265
|
})] });
|
|
2339
2266
|
};
|
|
2340
|
-
|
|
2341
2267
|
//#endregion
|
|
2342
2268
|
//#region src/components/searchInput/index.tsx
|
|
2343
|
-
const SearchInput = ({ placeholder, value, onChange, className, rightSection
|
|
2269
|
+
const SearchInput = ({ placeholder, value, onChange, className, rightSection, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextInput, {
|
|
2344
2270
|
placeholder,
|
|
2345
2271
|
className: className || "w-full lg:w-auto lg:min-w-[23.75rem]",
|
|
2346
2272
|
rightSection: rightSection || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {}),
|
|
@@ -2348,7 +2274,6 @@ const SearchInput = ({ placeholder, value, onChange, className, rightSection,...
|
|
|
2348
2274
|
onChange,
|
|
2349
2275
|
...props
|
|
2350
2276
|
});
|
|
2351
|
-
|
|
2352
2277
|
//#endregion
|
|
2353
2278
|
//#region src/hooks/useDebouncedValue.ts
|
|
2354
2279
|
function useDebouncedValue(value, delay = 200) {
|
|
@@ -2359,10 +2284,9 @@ function useDebouncedValue(value, delay = 200) {
|
|
|
2359
2284
|
}, [value, delay]);
|
|
2360
2285
|
return debouncedValue;
|
|
2361
2286
|
}
|
|
2362
|
-
|
|
2363
2287
|
//#endregion
|
|
2364
2288
|
//#region src/components/select/index.tsx
|
|
2365
|
-
function Select({ id, options, placeholder, label, errorText, hideError = false, isClearable = false, disabled = false, multiSelect = false, searchable = false, value, defaultValue, onValueChange, className, searchPlaceholder, noResultsText
|
|
2289
|
+
function Select({ id, options, placeholder, label, errorText, hideError = false, isClearable = false, disabled = false, multiSelect = false, searchable = false, value, defaultValue, onValueChange, className, searchPlaceholder, noResultsText, ...props }) {
|
|
2366
2290
|
const innerRef = (0, react.useRef)(null);
|
|
2367
2291
|
const buttonRef = (0, react.useRef)(null);
|
|
2368
2292
|
const optionRefs = (0, react.useRef)([]);
|
|
@@ -2372,29 +2296,27 @@ function Select({ id, options, placeholder, label, errorText, hideError = false,
|
|
|
2372
2296
|
const [searchTerm, setSearchTerm] = (0, react.useState)("");
|
|
2373
2297
|
const [focusedIndex, setFocusedIndex] = (0, react.useState)(-1);
|
|
2374
2298
|
const debouncedSearch = useDebouncedValue(searchTerm);
|
|
2375
|
-
const isControlled = value !==
|
|
2299
|
+
const isControlled = value !== void 0;
|
|
2376
2300
|
const currentValue = isControlled ? value : internalValue;
|
|
2377
2301
|
const selectedLabels = (0, react.useMemo)(() => {
|
|
2378
|
-
if (Array.isArray(currentValue))
|
|
2379
|
-
return options.filter((o) => currentValue.includes(o.value)).map((o) => o.label).join(", ");
|
|
2380
|
-
}
|
|
2302
|
+
if (Array.isArray(currentValue)) return options.filter((o) => currentValue.includes(o.value)).map((o) => o.label).join(", ");
|
|
2381
2303
|
return options.find((o) => o.value === currentValue)?.label;
|
|
2382
2304
|
}, [currentValue, options]);
|
|
2383
|
-
const { refs, floatingStyles, context } = (0,
|
|
2305
|
+
const { refs, floatingStyles, context } = (0, _floating_ui_react.useFloating)({
|
|
2384
2306
|
open,
|
|
2385
2307
|
onOpenChange: setOpen,
|
|
2386
2308
|
middleware: [
|
|
2387
|
-
(0,
|
|
2388
|
-
(0,
|
|
2389
|
-
(0,
|
|
2309
|
+
(0, _floating_ui_react.offset)(4),
|
|
2310
|
+
(0, _floating_ui_react.flip)(),
|
|
2311
|
+
(0, _floating_ui_react.shift)()
|
|
2390
2312
|
],
|
|
2391
|
-
whileElementsMounted:
|
|
2313
|
+
whileElementsMounted: _floating_ui_react.autoUpdate,
|
|
2392
2314
|
placement: "bottom-start"
|
|
2393
2315
|
});
|
|
2394
|
-
const click = (0,
|
|
2395
|
-
const dismiss = (0,
|
|
2396
|
-
const role = (0,
|
|
2397
|
-
const { getReferenceProps, getFloatingProps } = (0,
|
|
2316
|
+
const click = (0, _floating_ui_react.useClick)(context);
|
|
2317
|
+
const dismiss = (0, _floating_ui_react.useDismiss)(context);
|
|
2318
|
+
const role = (0, _floating_ui_react.useRole)(context, { role: "combobox" });
|
|
2319
|
+
const { getReferenceProps, getFloatingProps } = (0, _floating_ui_react.useInteractions)([
|
|
2398
2320
|
click,
|
|
2399
2321
|
dismiss,
|
|
2400
2322
|
role
|
|
@@ -2420,8 +2342,8 @@ function Select({ id, options, placeholder, label, errorText, hideError = false,
|
|
|
2420
2342
|
const handleClear = (0, react.useCallback)((e) => {
|
|
2421
2343
|
e.preventDefault();
|
|
2422
2344
|
e.stopPropagation();
|
|
2423
|
-
if (!isControlled) setInternalValue(
|
|
2424
|
-
onValueChange?.(
|
|
2345
|
+
if (!isControlled) setInternalValue(void 0);
|
|
2346
|
+
onValueChange?.(void 0);
|
|
2425
2347
|
setSearchTerm("");
|
|
2426
2348
|
}, [isControlled, onValueChange]);
|
|
2427
2349
|
const showPlaceholder = !currentValue || Array.isArray(currentValue) && currentValue.length === 0;
|
|
@@ -2541,7 +2463,7 @@ function Select({ id, options, placeholder, label, errorText, hideError = false,
|
|
|
2541
2463
|
className: "truncate",
|
|
2542
2464
|
children: selectedLabels
|
|
2543
2465
|
})
|
|
2544
|
-
}), isClearable && !showPlaceholder ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2466
|
+
}), isClearable && !showPlaceholder ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconX, {
|
|
2545
2467
|
size: 16,
|
|
2546
2468
|
color: "black",
|
|
2547
2469
|
className: "cursor-pointer",
|
|
@@ -2549,13 +2471,13 @@ function Select({ id, options, placeholder, label, errorText, hideError = false,
|
|
|
2549
2471
|
onPointerDown: handleClear,
|
|
2550
2472
|
role: "button",
|
|
2551
2473
|
"aria-label": "Clear selection"
|
|
2552
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2474
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconSelector, {
|
|
2553
2475
|
size: 16,
|
|
2554
2476
|
color: "black",
|
|
2555
2477
|
"aria-hidden": "true"
|
|
2556
2478
|
})]
|
|
2557
2479
|
}),
|
|
2558
|
-
open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2480
|
+
open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingPortal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingFocusManager, {
|
|
2559
2481
|
context,
|
|
2560
2482
|
modal: false,
|
|
2561
2483
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -2574,7 +2496,7 @@ function Select({ id, options, placeholder, label, errorText, hideError = false,
|
|
|
2574
2496
|
children: [searchable && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2575
2497
|
className: "flex items-center gap-2 px-2 py-1 border-b border-gray-100 sticky top-0 bg-white",
|
|
2576
2498
|
role: "search",
|
|
2577
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2499
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconSearch, {
|
|
2578
2500
|
size: 14,
|
|
2579
2501
|
className: "text-gray-400",
|
|
2580
2502
|
"aria-hidden": "true"
|
|
@@ -2592,7 +2514,9 @@ function Select({ id, options, placeholder, label, errorText, hideError = false,
|
|
|
2592
2514
|
children: filteredOptions.length ? filteredOptions.map((opt, index) => {
|
|
2593
2515
|
const isSelected = Array.isArray(currentValue) ? currentValue.includes(opt.value) : currentValue === opt.value;
|
|
2594
2516
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2595
|
-
ref: (el) =>
|
|
2517
|
+
ref: (el) => {
|
|
2518
|
+
optionRefs.current[index] = el;
|
|
2519
|
+
},
|
|
2596
2520
|
type: "button",
|
|
2597
2521
|
onClick: () => handleSelect(opt.value),
|
|
2598
2522
|
role: "option",
|
|
@@ -2602,7 +2526,7 @@ function Select({ id, options, placeholder, label, errorText, hideError = false,
|
|
|
2602
2526
|
children: [multiSelect && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2603
2527
|
className: cn("flex h-4 w-4 items-center justify-center rounded-sm border", isSelected ? "border-light-blue bg-light-blue" : "border-gray-400 bg-white"),
|
|
2604
2528
|
"aria-hidden": "true",
|
|
2605
|
-
children: isSelected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2529
|
+
children: isSelected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconCheck, {
|
|
2606
2530
|
size: 12,
|
|
2607
2531
|
color: "white",
|
|
2608
2532
|
stroke: 2,
|
|
@@ -2631,7 +2555,6 @@ function Select({ id, options, placeholder, label, errorText, hideError = false,
|
|
|
2631
2555
|
});
|
|
2632
2556
|
}
|
|
2633
2557
|
Select.displayName = "Select";
|
|
2634
|
-
|
|
2635
2558
|
//#endregion
|
|
2636
2559
|
//#region src/components/settingsCard/index.tsx
|
|
2637
2560
|
const SettingsCard = ({ icon, title, link, ManageText, LinkComponent }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2650,7 +2573,6 @@ const SettingsCard = ({ icon, title, link, ManageText, LinkComponent }) => /* @_
|
|
|
2650
2573
|
children: ManageText
|
|
2651
2574
|
})]
|
|
2652
2575
|
});
|
|
2653
|
-
|
|
2654
2576
|
//#endregion
|
|
2655
2577
|
//#region src/components/skeleton/index.tsx
|
|
2656
2578
|
const Skeleton = ({ className, "data-testid": dataTestId }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -2658,7 +2580,6 @@ const Skeleton = ({ className, "data-testid": dataTestId }) => /* @__PURE__ */ (
|
|
|
2658
2580
|
"data-testid": dataTestId || "skeleton",
|
|
2659
2581
|
className: cn("inline-block rounded-md", "animate-pulse bg-gray-100/50", className)
|
|
2660
2582
|
});
|
|
2661
|
-
|
|
2662
2583
|
//#endregion
|
|
2663
2584
|
//#region src/components/skillPill/index.tsx
|
|
2664
2585
|
const SkillPill = ({ name, number }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2673,7 +2594,6 @@ const SkillPill = ({ name, number }) => /* @__PURE__ */ (0, react_jsx_runtime.js
|
|
|
2673
2594
|
children: number
|
|
2674
2595
|
})]
|
|
2675
2596
|
});
|
|
2676
|
-
|
|
2677
2597
|
//#endregion
|
|
2678
2598
|
//#region src/components/stepper/NumberedStepper.tsx
|
|
2679
2599
|
const NumberedStepper = ({ steps, active, className, stepsCompleted, completedLabel, onStepClick }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -2703,7 +2623,7 @@ const NumberedStepper = ({ steps, active, className, stepsCompleted, completedLa
|
|
|
2703
2623
|
children: [
|
|
2704
2624
|
completedLabel,
|
|
2705
2625
|
" ",
|
|
2706
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2626
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconCheck, {
|
|
2707
2627
|
className: "align-middle",
|
|
2708
2628
|
size: 12
|
|
2709
2629
|
})
|
|
@@ -2713,7 +2633,6 @@ const NumberedStepper = ({ steps, active, className, stepsCompleted, completedLa
|
|
|
2713
2633
|
})
|
|
2714
2634
|
}), index < steps.length - 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: `my-2 ml-6 flex h-[24px] w-px align-middle md:ml-0 md:h-px md:w-auto md:flex-1 ${active === 1 ? "bg-light-blue" : "bg-[#CCCCCC]"}` })] }, index))
|
|
2715
2635
|
});
|
|
2716
|
-
|
|
2717
2636
|
//#endregion
|
|
2718
2637
|
//#region src/components/stepper/Stepper.tsx
|
|
2719
2638
|
const Stepper = ({ steps, setStep = () => {}, variant = "default", clickableSteps, completedSteps, activeStep, isMobile, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -2744,7 +2663,7 @@ const Stepper = ({ steps, setStep = () => {}, variant = "default", clickableStep
|
|
|
2744
2663
|
}),
|
|
2745
2664
|
children: [(index < activeStep || isCompleted) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2746
2665
|
className: "flex items-center justify-center text-white",
|
|
2747
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2666
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconCheck, { size: variant === "small" || isMobile ? 7 : 12 })
|
|
2748
2667
|
}), index === activeStep && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2749
2668
|
"data-testid": "active-step-indicator",
|
|
2750
2669
|
className: `${variant === "small" || isMobile ? "size-1" : "size-2"} bg-light-blue rounded-full`
|
|
@@ -2764,7 +2683,6 @@ const Stepper = ({ steps, setStep = () => {}, variant = "default", clickableStep
|
|
|
2764
2683
|
}, index);
|
|
2765
2684
|
})
|
|
2766
2685
|
});
|
|
2767
|
-
|
|
2768
2686
|
//#endregion
|
|
2769
2687
|
//#region src/components/stickyMobileButton/index.tsx
|
|
2770
2688
|
const StickyMobileButtonWrapper = ({ children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -2776,17 +2694,15 @@ const StickyMobileButtonWrapper = ({ children }) => /* @__PURE__ */ (0, react_js
|
|
|
2776
2694
|
children
|
|
2777
2695
|
})
|
|
2778
2696
|
});
|
|
2779
|
-
|
|
2780
2697
|
//#endregion
|
|
2781
2698
|
//#region src/components/table/index.tsx
|
|
2782
|
-
const Table = ({ children, className
|
|
2699
|
+
const Table = ({ children, className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2783
2700
|
"data-testid": "table",
|
|
2784
2701
|
"data-component": "table",
|
|
2785
2702
|
className: cn("table w-full table-fixed border-collapse overflow-auto", className),
|
|
2786
2703
|
...props,
|
|
2787
2704
|
children
|
|
2788
2705
|
});
|
|
2789
|
-
|
|
2790
2706
|
//#endregion
|
|
2791
2707
|
//#region src/components/table/tableCell/index.tsx
|
|
2792
2708
|
const TableCell = ({ children, smallPadding, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -2795,7 +2711,6 @@ const TableCell = ({ children, smallPadding, className }) => /* @__PURE__ */ (0,
|
|
|
2795
2711
|
className: `${cn("table-cell py-2 align-middle text-sm font-normal first:pl-2 last:pr-2 md:py-0 md:xl:first:pl-10 md:xl:last:pr-10", { "md:xl:first:pl-5 md:xl:last:pr-5": smallPadding }, className)}`,
|
|
2796
2712
|
children
|
|
2797
2713
|
});
|
|
2798
|
-
|
|
2799
2714
|
//#endregion
|
|
2800
2715
|
//#region src/components/table/tableHeader/index.tsx
|
|
2801
2716
|
const TableHeader = ({ children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -2804,30 +2719,27 @@ const TableHeader = ({ children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)
|
|
|
2804
2719
|
className: "table-header-group border-b border-gray-200",
|
|
2805
2720
|
children
|
|
2806
2721
|
});
|
|
2807
|
-
|
|
2808
2722
|
//#endregion
|
|
2809
2723
|
//#region src/components/table/tableHeaderItem/index.tsx
|
|
2810
|
-
const TableHeaderItem = ({ children, smallPadding, className
|
|
2724
|
+
const TableHeaderItem = ({ children, smallPadding, className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2811
2725
|
"data-testid": "tableHeaderItem",
|
|
2812
2726
|
"data-component": "tableHeaderItem",
|
|
2813
2727
|
className: cn("hidden h-10 align-middle text-xs font-medium first:pl-10 last:pr-10 xl:table-cell", { "xl:first:pl-5 xl:last:pr-5": smallPadding }, className),
|
|
2814
2728
|
...props,
|
|
2815
2729
|
children
|
|
2816
2730
|
});
|
|
2817
|
-
|
|
2818
2731
|
//#endregion
|
|
2819
2732
|
//#region src/components/table/tableHeaderRow/index.tsx
|
|
2820
|
-
const TableHeaderRow = ({ children
|
|
2733
|
+
const TableHeaderRow = ({ children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2821
2734
|
"data-testid": "tableHeaderRow",
|
|
2822
2735
|
"data-component": "tableHeaderRow",
|
|
2823
2736
|
className: "table-row xl:border-0 xl:border-b xl:border-solid xl:border-gray-200",
|
|
2824
2737
|
...props,
|
|
2825
2738
|
children
|
|
2826
2739
|
});
|
|
2827
|
-
|
|
2828
2740
|
//#endregion
|
|
2829
2741
|
//#region src/components/table/tableRow/index.tsx
|
|
2830
|
-
function TableRow({ children, className, header
|
|
2742
|
+
function TableRow({ children, className, header, ...props }) {
|
|
2831
2743
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2832
2744
|
"data-testid": "tableRow",
|
|
2833
2745
|
"data-component": "tableRow",
|
|
@@ -2836,7 +2748,6 @@ function TableRow({ children, className, header,...props }) {
|
|
|
2836
2748
|
children
|
|
2837
2749
|
});
|
|
2838
2750
|
}
|
|
2839
|
-
|
|
2840
2751
|
//#endregion
|
|
2841
2752
|
//#region src/components/tabs/Tab.tsx
|
|
2842
2753
|
const Tab = (0, react.forwardRef)(({ tabId, activeTab, tabContent, clickFnc, rightSection }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
@@ -2849,7 +2760,6 @@ const Tab = (0, react.forwardRef)(({ tabId, activeTab, tabContent, clickFnc, rig
|
|
|
2849
2760
|
children: rightSection
|
|
2850
2761
|
})]
|
|
2851
2762
|
}));
|
|
2852
|
-
|
|
2853
2763
|
//#endregion
|
|
2854
2764
|
//#region src/components/tabs/TabsBadge.tsx
|
|
2855
2765
|
const TabsBadge = ({ children }) => {
|
|
@@ -2864,7 +2774,6 @@ const TabsBadge = ({ children }) => {
|
|
|
2864
2774
|
});
|
|
2865
2775
|
};
|
|
2866
2776
|
TabsBadge.displayName = "TabsBadge";
|
|
2867
|
-
|
|
2868
2777
|
//#endregion
|
|
2869
2778
|
//#region src/components/tabs/TabsWrapper.tsx
|
|
2870
2779
|
const TabsWrapper = ({ setActiveTab, activeTab, tabs }) => {
|
|
@@ -2922,17 +2831,16 @@ const TabContent = (0, react.forwardRef)(({ tab, setActiveTab, activeTab }, ref)
|
|
|
2922
2831
|
setActiveTab,
|
|
2923
2832
|
activeTab: activeTab === tab.value,
|
|
2924
2833
|
tabContent: tab.name,
|
|
2925
|
-
rightSection: tab?.rightSection ||
|
|
2834
|
+
rightSection: tab?.rightSection || void 0,
|
|
2926
2835
|
clickFnc: () => {
|
|
2927
2836
|
tab.clickFnc && tab.clickFnc(tab.value);
|
|
2928
2837
|
setActiveTab(tab.value);
|
|
2929
2838
|
}
|
|
2930
2839
|
}));
|
|
2931
2840
|
TabContent.displayName = "TabContent";
|
|
2932
|
-
|
|
2933
2841
|
//#endregion
|
|
2934
2842
|
//#region src/components/textArea/index.tsx
|
|
2935
|
-
const Textarea = (0, react.forwardRef)(({ className, label, error, rows = 8
|
|
2843
|
+
const Textarea = (0, react.forwardRef)(({ className, label, error, rows = 8, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2936
2844
|
className: "relative grid gap-2",
|
|
2937
2845
|
children: [
|
|
2938
2846
|
label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
@@ -2952,10 +2860,9 @@ const Textarea = (0, react.forwardRef)(({ className, label, error, rows = 8,...p
|
|
|
2952
2860
|
})
|
|
2953
2861
|
]
|
|
2954
2862
|
}));
|
|
2955
|
-
|
|
2956
2863
|
//#endregion
|
|
2957
2864
|
//#region src/components/themeIcon/index.tsx
|
|
2958
|
-
function ThemeIcon({ styleVariant = "black", className, icon, adjustedSize, title
|
|
2865
|
+
function ThemeIcon({ styleVariant = "black", className, icon, adjustedSize, title, ...props }) {
|
|
2959
2866
|
const classNames = cn("bg-transparent h-9 w-9 rounded-[5px] grid place-content-center", {
|
|
2960
2867
|
"text-black": styleVariant === COLOR.BLACK,
|
|
2961
2868
|
"text-gray-500": styleVariant === COLOR.GRAY,
|
|
@@ -2980,10 +2887,9 @@ function ThemeIcon({ styleVariant = "black", className, icon, adjustedSize, titl
|
|
|
2980
2887
|
})
|
|
2981
2888
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_tooltip.Tooltip, { id: title })] });
|
|
2982
2889
|
}
|
|
2983
|
-
|
|
2984
2890
|
//#endregion
|
|
2985
2891
|
//#region src/components/timeInput/index.tsx
|
|
2986
|
-
const TimeInput = (0, react.forwardRef)(({ label, error, withSeconds, className = ""
|
|
2892
|
+
const TimeInput = (0, react.forwardRef)(({ label, error, withSeconds, className = "", ...props }, ref) => {
|
|
2987
2893
|
const handleTimeChange = (e) => {
|
|
2988
2894
|
if (props.onChange) props.onChange(e);
|
|
2989
2895
|
};
|
|
@@ -3011,7 +2917,6 @@ const TimeInput = (0, react.forwardRef)(({ label, error, withSeconds, className
|
|
|
3011
2917
|
]
|
|
3012
2918
|
});
|
|
3013
2919
|
});
|
|
3014
|
-
|
|
3015
2920
|
//#endregion
|
|
3016
2921
|
//#region src/components/toggle/index.tsx
|
|
3017
2922
|
const Toggle = ({ onClick, value, disabled = false }) => {
|
|
@@ -3033,7 +2938,6 @@ const Toggle = ({ onClick, value, disabled = false }) => {
|
|
|
3033
2938
|
})
|
|
3034
2939
|
});
|
|
3035
2940
|
};
|
|
3036
|
-
|
|
3037
2941
|
//#endregion
|
|
3038
2942
|
//#region src/components/truncatedText/index.tsx
|
|
3039
2943
|
const TruncatedText = ({ text, limit = 20 }) => {
|
|
@@ -3052,15 +2956,14 @@ const TruncatedText = ({ text, limit = 20 }) => {
|
|
|
3052
2956
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3053
2957
|
className: "text-secondary",
|
|
3054
2958
|
"data-testid": "truncated-text-icon",
|
|
3055
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2959
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconMessageDots, { stroke: 1 })
|
|
3056
2960
|
})
|
|
3057
2961
|
})]
|
|
3058
2962
|
});
|
|
3059
2963
|
};
|
|
3060
|
-
|
|
3061
2964
|
//#endregion
|
|
3062
2965
|
//#region src/components/unorderedList/index.tsx
|
|
3063
|
-
const UnorderedList = ({ children, className, actionItem
|
|
2966
|
+
const UnorderedList = ({ children, className, actionItem, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
|
|
3064
2967
|
className: cn("m-0 last:border-none", className),
|
|
3065
2968
|
"data-component": "unorderedList",
|
|
3066
2969
|
"data-testid": "unorderedList",
|
|
@@ -3070,10 +2973,9 @@ const UnorderedList = ({ children, className, actionItem,...props }) => /* @__PU
|
|
|
3070
2973
|
children: actionItem
|
|
3071
2974
|
})]
|
|
3072
2975
|
});
|
|
3073
|
-
|
|
3074
2976
|
//#endregion
|
|
3075
2977
|
//#region src/components/unorderedListItem/index.tsx
|
|
3076
|
-
const UnorderedListItem = ({ children, actionItem, className, header = false
|
|
2978
|
+
const UnorderedListItem = ({ children, actionItem, className, header = false, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
3077
2979
|
...props,
|
|
3078
2980
|
"data-component": "unorderedListItem",
|
|
3079
2981
|
className: cn("grid min-h-[74px] list-none items-center border-b border-solid border-b-gray-200 py-5 text-sm font-normal last:border-none md:flex md:py-4 md:pr-10 md:pl-10", header ? "md:items-end" : "hover:bg-ultra-light-blue-gray", { "grid-cols-2": actionItem }, className),
|
|
@@ -3082,60 +2984,44 @@ const UnorderedListItem = ({ children, actionItem, className, header = false,...
|
|
|
3082
2984
|
children: actionItem
|
|
3083
2985
|
})]
|
|
3084
2986
|
});
|
|
3085
|
-
|
|
3086
2987
|
//#endregion
|
|
3087
2988
|
//#region src/hooks/phone/usePhoneNumber.ts
|
|
3088
2989
|
function usePhoneNumber() {
|
|
3089
|
-
/**
|
|
3090
|
-
* Validates a phone number and returns parsing results
|
|
3091
|
-
*/
|
|
3092
|
-
const validatePhone = (0, react.useCallback)((phoneNumber, options) => (0, phone.default)(phoneNumber, options), []);
|
|
3093
|
-
/**
|
|
3094
|
-
* Strips the country code from a phone number
|
|
3095
|
-
* Example: +85265698900 -> 65698900
|
|
3096
|
-
*/
|
|
3097
|
-
const stripCountryCode = (0, react.useCallback)((phoneNumber) => {
|
|
3098
|
-
const result = (0, phone.default)(phoneNumber);
|
|
3099
|
-
if (!result.isValid) return phoneNumber;
|
|
3100
|
-
return result.phoneNumber.replace(result.countryCode, "");
|
|
3101
|
-
}, []);
|
|
3102
|
-
/**
|
|
3103
|
-
* Returns the country code from a phone number
|
|
3104
|
-
* Example: +85265698900 -> +852
|
|
3105
|
-
*/
|
|
3106
|
-
const getCountryCode = (0, react.useCallback)((phoneNumber) => {
|
|
3107
|
-
const result = (0, phone.default)(phoneNumber);
|
|
3108
|
-
if (!result.isValid) return phoneNumber;
|
|
3109
|
-
return result.countryCode;
|
|
3110
|
-
}, []);
|
|
3111
|
-
/**
|
|
3112
|
-
* Formats a phone number to international format with country code
|
|
3113
|
-
* Example: 0648711212 (with country: 'NL') -> +31648711212
|
|
3114
|
-
*/
|
|
3115
|
-
const formatToInternational = (0, react.useCallback)((phoneNumber, options) => {
|
|
3116
|
-
const result = (0, phone.default)(phoneNumber, options);
|
|
3117
|
-
if (!result.isValid) return phoneNumber;
|
|
3118
|
-
return result.phoneNumber;
|
|
3119
|
-
}, []);
|
|
3120
2990
|
return {
|
|
3121
|
-
validatePhone,
|
|
3122
|
-
stripCountryCode,
|
|
3123
|
-
|
|
3124
|
-
|
|
2991
|
+
validatePhone: (0, react.useCallback)((phoneNumber, options) => (0, phone.default)(phoneNumber, options), []),
|
|
2992
|
+
stripCountryCode: (0, react.useCallback)((phoneNumber) => {
|
|
2993
|
+
const result = (0, phone.default)(phoneNumber);
|
|
2994
|
+
if (!result.isValid) return phoneNumber;
|
|
2995
|
+
return result.phoneNumber.replace(result.countryCode, "");
|
|
2996
|
+
}, []),
|
|
2997
|
+
getCountryCode: (0, react.useCallback)((phoneNumber) => {
|
|
2998
|
+
const result = (0, phone.default)(phoneNumber);
|
|
2999
|
+
if (!result.isValid) return phoneNumber;
|
|
3000
|
+
return result.countryCode;
|
|
3001
|
+
}, []),
|
|
3002
|
+
formatToInternational: (0, react.useCallback)((phoneNumber, options) => {
|
|
3003
|
+
const result = (0, phone.default)(phoneNumber, options);
|
|
3004
|
+
if (!result.isValid) return phoneNumber;
|
|
3005
|
+
return result.phoneNumber;
|
|
3006
|
+
}, [])
|
|
3125
3007
|
};
|
|
3126
3008
|
}
|
|
3127
|
-
|
|
3128
3009
|
//#endregion
|
|
3129
3010
|
//#region src/hooks/phone/usePhoneNumberPrefix.ts
|
|
3011
|
+
/** CJS package often exposes `{ Country, default: api }`; Vite/Node ESM may not unwrap `.default`. */
|
|
3012
|
+
const countryListApi = (() => {
|
|
3013
|
+
const mod = country_list_with_dial_code_and_flag.default;
|
|
3014
|
+
if (typeof mod.getAll === "function") return mod;
|
|
3015
|
+
if (mod.default && typeof mod.default.getAll === "function") return mod.default;
|
|
3016
|
+
throw new Error("country-list-with-dial-code-and-flag: expected getAll()");
|
|
3017
|
+
})();
|
|
3130
3018
|
const usePhoneNumberPrefix = (defaultCountry) => {
|
|
3131
|
-
|
|
3132
|
-
return countryList.filter((country) => country.dial_code).sort((a, b) => {
|
|
3019
|
+
return countryListApi.getAll().filter((country) => country.dial_code).sort((a, b) => {
|
|
3133
3020
|
if (a?.code === defaultCountry) return -1;
|
|
3134
3021
|
if (b?.code === defaultCountry) return 1;
|
|
3135
3022
|
return a.name.localeCompare(b.name);
|
|
3136
3023
|
});
|
|
3137
3024
|
};
|
|
3138
|
-
|
|
3139
3025
|
//#endregion
|
|
3140
3026
|
//#region src/components/phoneInput/index.tsx
|
|
3141
3027
|
const CountrySelector = ({ searchPlaceholder, defaultCountry, ref }) => {
|
|
@@ -3146,24 +3032,24 @@ const CountrySelector = ({ searchPlaceholder, defaultCountry, ref }) => {
|
|
|
3146
3032
|
const [filteredCountries, setFilteredCountries] = (0, react.useState)(phoneNumberPrefixes);
|
|
3147
3033
|
const [highlightedIndex, setHighlightedIndex] = (0, react.useState)(-1);
|
|
3148
3034
|
const optionRefs = (0, react.useRef)([]);
|
|
3149
|
-
const { refs, floatingStyles, context } = (0,
|
|
3035
|
+
const { refs, floatingStyles, context } = (0, _floating_ui_react.useFloating)({
|
|
3150
3036
|
open: openDropdown,
|
|
3151
3037
|
onOpenChange: (isOpen) => {
|
|
3152
3038
|
setOpenDropdown(isOpen);
|
|
3153
3039
|
if (isOpen) setHighlightedIndex(-1);
|
|
3154
3040
|
},
|
|
3155
3041
|
middleware: [
|
|
3156
|
-
(0,
|
|
3157
|
-
(0,
|
|
3158
|
-
(0,
|
|
3042
|
+
(0, _floating_ui_react.offset)(4),
|
|
3043
|
+
(0, _floating_ui_react.flip)(),
|
|
3044
|
+
(0, _floating_ui_react.shift)()
|
|
3159
3045
|
],
|
|
3160
|
-
whileElementsMounted:
|
|
3046
|
+
whileElementsMounted: _floating_ui_react.autoUpdate,
|
|
3161
3047
|
placement: "bottom-start"
|
|
3162
3048
|
});
|
|
3163
|
-
const click = (0,
|
|
3164
|
-
const dismiss = (0,
|
|
3165
|
-
const role = (0,
|
|
3166
|
-
const { getReferenceProps, getFloatingProps } = (0,
|
|
3049
|
+
const click = (0, _floating_ui_react.useClick)(context);
|
|
3050
|
+
const dismiss = (0, _floating_ui_react.useDismiss)(context);
|
|
3051
|
+
const role = (0, _floating_ui_react.useRole)(context, { role: "combobox" });
|
|
3052
|
+
const { getReferenceProps, getFloatingProps } = (0, _floating_ui_react.useInteractions)([
|
|
3167
3053
|
click,
|
|
3168
3054
|
dismiss,
|
|
3169
3055
|
role
|
|
@@ -3174,20 +3060,17 @@ const CountrySelector = ({ searchPlaceholder, defaultCountry, ref }) => {
|
|
|
3174
3060
|
return phoneNumberPrefixes.filter((country) => country.name.toLowerCase().includes(lowerQuery) || country.dial_code.toLowerCase().includes(lowerQuery) || country.code.toLowerCase().includes(lowerQuery));
|
|
3175
3061
|
}, [phoneNumberPrefixes]);
|
|
3176
3062
|
(0, react.useEffect)(() => {
|
|
3177
|
-
|
|
3178
|
-
setFilteredCountries(results);
|
|
3063
|
+
setFilteredCountries(performSearch(searchQuery));
|
|
3179
3064
|
setHighlightedIndex(-1);
|
|
3180
3065
|
}, [searchQuery]);
|
|
3181
3066
|
(0, react.useEffect)(() => {
|
|
3182
3067
|
optionRefs.current = optionRefs.current.slice(0, filteredCountries.length);
|
|
3183
3068
|
}, [filteredCountries]);
|
|
3184
3069
|
(0, react.useEffect)(() => {
|
|
3185
|
-
if (highlightedIndex >= 0 && optionRefs.current[highlightedIndex]) {
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
});
|
|
3190
|
-
}
|
|
3070
|
+
if (highlightedIndex >= 0 && optionRefs.current[highlightedIndex]) optionRefs.current[highlightedIndex]?.scrollIntoView({
|
|
3071
|
+
behavior: "auto",
|
|
3072
|
+
block: "nearest"
|
|
3073
|
+
});
|
|
3191
3074
|
}, [highlightedIndex]);
|
|
3192
3075
|
const handleSelect = (country) => {
|
|
3193
3076
|
setSelectedCountry(country);
|
|
@@ -3204,11 +3087,10 @@ const CountrySelector = ({ searchPlaceholder, defaultCountry, ref }) => {
|
|
|
3204
3087
|
e.preventDefault();
|
|
3205
3088
|
setHighlightedIndex((prev) => prev > 0 ? prev - 1 : filteredCountries.length - 1);
|
|
3206
3089
|
break;
|
|
3207
|
-
case "Enter":
|
|
3090
|
+
case "Enter":
|
|
3208
3091
|
e.preventDefault();
|
|
3209
3092
|
if (highlightedIndex >= 0) handleSelect(filteredCountries[highlightedIndex]);
|
|
3210
3093
|
break;
|
|
3211
|
-
}
|
|
3212
3094
|
case "Escape":
|
|
3213
3095
|
e.preventDefault();
|
|
3214
3096
|
setOpenDropdown(false);
|
|
@@ -3239,7 +3121,7 @@ const CountrySelector = ({ searchPlaceholder, defaultCountry, ref }) => {
|
|
|
3239
3121
|
children: selectedCountry?.dial_code
|
|
3240
3122
|
})
|
|
3241
3123
|
})
|
|
3242
|
-
}), openDropdown && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3124
|
+
}), openDropdown && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingPortal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingFocusManager, {
|
|
3243
3125
|
context,
|
|
3244
3126
|
modal: false,
|
|
3245
3127
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -3266,7 +3148,9 @@ const CountrySelector = ({ searchPlaceholder, defaultCountry, ref }) => {
|
|
|
3266
3148
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3267
3149
|
className: "max-h-[200px] overflow-auto p-1",
|
|
3268
3150
|
children: filteredCountries.length > 0 ? filteredCountries.map((country, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3269
|
-
ref: (el) =>
|
|
3151
|
+
ref: (el) => {
|
|
3152
|
+
optionRefs.current[index] = el;
|
|
3153
|
+
},
|
|
3270
3154
|
type: "button",
|
|
3271
3155
|
role: "option",
|
|
3272
3156
|
"aria-selected": selectedCountry?.code === country.code,
|
|
@@ -3295,7 +3179,7 @@ const CountrySelector = ({ searchPlaceholder, defaultCountry, ref }) => {
|
|
|
3295
3179
|
}) })]
|
|
3296
3180
|
});
|
|
3297
3181
|
};
|
|
3298
|
-
const PhoneInput = ({ placeholder, searchPlaceHolder, defaultCountry = "NL", invalidMessage, defaultValue, onChange, ref
|
|
3182
|
+
const PhoneInput = ({ placeholder, searchPlaceHolder, defaultCountry = "NL", invalidMessage, defaultValue, onChange, ref, ...rest }) => {
|
|
3299
3183
|
const inputRef = (0, react.useRef)(null);
|
|
3300
3184
|
const [phoneNumber, setPhoneNumber] = (0, react.useState)(defaultValue || "");
|
|
3301
3185
|
const { validatePhone, stripCountryCode, getCountryCode, formatToInternational } = usePhoneNumber();
|
|
@@ -3308,18 +3192,15 @@ const PhoneInput = ({ placeholder, searchPlaceHolder, defaultCountry = "NL", inv
|
|
|
3308
3192
|
if (filteredValue.startsWith("+") && filteredValue.length > 1) {
|
|
3309
3193
|
const countryCode = getCountryCode(filteredValue);
|
|
3310
3194
|
if (countryCode) countrySelectorRef.current?.updateCountry(countryCode);
|
|
3311
|
-
|
|
3312
|
-
setPhoneNumber(strippedNumber);
|
|
3195
|
+
setPhoneNumber(stripCountryCode(filteredValue));
|
|
3313
3196
|
return;
|
|
3314
3197
|
} else setPhoneNumber(filteredValue);
|
|
3315
3198
|
};
|
|
3316
3199
|
const handleBlur = () => {
|
|
3317
3200
|
if (phoneNumber.trim()) {
|
|
3318
3201
|
const selectedCountry = countrySelectorRef.current?.getSelectedCountry();
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
const formattedNumber = formatToInternational(phoneNumber, { country: selectedCountry?.code });
|
|
3322
|
-
const displayNumber = stripCountryCode(formattedNumber);
|
|
3202
|
+
if (validatePhone(phoneNumber, { country: selectedCountry?.code }).isValid) {
|
|
3203
|
+
const displayNumber = stripCountryCode(formatToInternational(phoneNumber, { country: selectedCountry?.code }));
|
|
3323
3204
|
const fullNumber = selectedCountry?.dial_code + displayNumber;
|
|
3324
3205
|
setPhoneNumber(displayNumber);
|
|
3325
3206
|
onChange(fullNumber);
|
|
@@ -3345,7 +3226,6 @@ const PhoneInput = ({ placeholder, searchPlaceHolder, defaultCountry = "NL", inv
|
|
|
3345
3226
|
});
|
|
3346
3227
|
};
|
|
3347
3228
|
PhoneInput.displayName = "PhoneInput";
|
|
3348
|
-
|
|
3349
3229
|
//#endregion
|
|
3350
3230
|
//#region src/components/profileMenu/index.tsx
|
|
3351
3231
|
const ProfileMenu = ({ title, metaTitle, icon, content, disabled = false, classNames }) => {
|
|
@@ -3360,26 +3240,23 @@ const ProfileMenu = ({ title, metaTitle, icon, content, disabled = false, classN
|
|
|
3360
3240
|
const buttonId = `${menuId}-button`;
|
|
3361
3241
|
const defaultStyling = "text-black flex items-center gap-1 bg-transparent py-1 px-2.5 h-9 min-w-9 cursor-pointer border-gray-200 focus:bg-gray-50 focus:ring focus:ring-primary focus:outline-none focus:border-0 focus:ring-inset";
|
|
3362
3242
|
const handleToggle = () => {
|
|
3363
|
-
if (!disabled) {
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
return newIsOpen;
|
|
3381
|
-
});
|
|
3382
|
-
}
|
|
3243
|
+
if (!disabled) setIsOpen((prev) => {
|
|
3244
|
+
const newIsOpen = !prev;
|
|
3245
|
+
/* istanbul ignore next - branch depends on async DOM focus */
|
|
3246
|
+
if (newIsOpen) setTimeout(() => {
|
|
3247
|
+
/* istanbul ignore next - async focus behavior depends on DOM/timing */
|
|
3248
|
+
setFocusedIndex(0);
|
|
3249
|
+
/* istanbul ignore next - async focus behavior depends on DOM/timing */
|
|
3250
|
+
menuItemRefs.current[0]?.focus();
|
|
3251
|
+
}, 0);
|
|
3252
|
+
else {
|
|
3253
|
+
/* istanbul ignore next - focus reset depends on DOM/timing */
|
|
3254
|
+
setFocusedIndex(-1);
|
|
3255
|
+
/* istanbul ignore next - focus reset depends on DOM/timing */
|
|
3256
|
+
buttonRef.current?.focus();
|
|
3257
|
+
}
|
|
3258
|
+
return newIsOpen;
|
|
3259
|
+
});
|
|
3383
3260
|
};
|
|
3384
3261
|
/* istanbul ignore next - click handler behavior covered via integration; unit env flaky */
|
|
3385
3262
|
const handleItemClick = (onClick) => {
|
|
@@ -3461,7 +3338,7 @@ const ProfileMenu = ({ title, metaTitle, icon, content, disabled = false, classN
|
|
|
3461
3338
|
"aria-label": "Toggle profile menu",
|
|
3462
3339
|
"aria-expanded": isOpen,
|
|
3463
3340
|
"aria-haspopup": "menu",
|
|
3464
|
-
"aria-controls": isOpen ? menuId :
|
|
3341
|
+
"aria-controls": isOpen ? menuId : void 0,
|
|
3465
3342
|
className: cn(buttonVariants["secondary"], defaultStyling, classNames?.button),
|
|
3466
3343
|
disabled,
|
|
3467
3344
|
onClick: handleToggle,
|
|
@@ -3492,50 +3369,48 @@ const ProfileMenu = ({ title, metaTitle, icon, content, disabled = false, classN
|
|
|
3492
3369
|
})]
|
|
3493
3370
|
}) });
|
|
3494
3371
|
};
|
|
3495
|
-
|
|
3496
3372
|
//#endregion
|
|
3497
3373
|
//#region src/utils/ssr.ts
|
|
3498
3374
|
const isSSR = () => typeof window === "undefined" || typeof document === "undefined";
|
|
3499
|
-
|
|
3500
3375
|
//#endregion
|
|
3501
3376
|
//#region src/components/wysiwygEditor/index.tsx
|
|
3502
|
-
const BoldIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3377
|
+
const BoldIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconBold, {
|
|
3503
3378
|
size: 18,
|
|
3504
3379
|
stroke: 1.5
|
|
3505
3380
|
});
|
|
3506
|
-
const ItalicIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3381
|
+
const ItalicIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconItalic, {
|
|
3507
3382
|
size: 18,
|
|
3508
3383
|
stroke: 1.5
|
|
3509
3384
|
});
|
|
3510
|
-
const UnderlineIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3385
|
+
const UnderlineIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconUnderline, {
|
|
3511
3386
|
size: 18,
|
|
3512
3387
|
stroke: 1.5
|
|
3513
3388
|
});
|
|
3514
|
-
const ClearFormattingIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3389
|
+
const ClearFormattingIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconClearFormatting, {
|
|
3515
3390
|
size: 18,
|
|
3516
3391
|
stroke: 1.5
|
|
3517
3392
|
});
|
|
3518
|
-
const ListIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3393
|
+
const ListIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconList, {
|
|
3519
3394
|
size: 18,
|
|
3520
3395
|
stroke: 1.5
|
|
3521
3396
|
});
|
|
3522
|
-
const ListNumbersIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3397
|
+
const ListNumbersIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconListNumbers, {
|
|
3523
3398
|
size: 18,
|
|
3524
3399
|
stroke: 1.5
|
|
3525
3400
|
});
|
|
3526
3401
|
const WysiwygEditor = (0, react.forwardRef)(({ id, content, className, placeholder, onChange, readOnly, error }, ref) => {
|
|
3527
|
-
const editor = (0,
|
|
3402
|
+
const editor = (0, _tiptap_react.useEditor)({
|
|
3528
3403
|
extensions: [
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3404
|
+
_tiptap_starter_kit.StarterKit,
|
|
3405
|
+
_tiptap_extension_underline.Underline,
|
|
3406
|
+
_tiptap_extension_placeholder.Placeholder.configure({ placeholder })
|
|
3532
3407
|
],
|
|
3533
3408
|
editorProps: { attributes: { class: "min-h-[190px] md:min-h-[150px] bg-ultra-light-gray text-sm font-normal p-4 prose prose-sm sm:prose-base lg:prose-lg xl:prose-2xl focus:outline-hidden" } },
|
|
3534
3409
|
content,
|
|
3535
3410
|
immediatelyRender: false,
|
|
3536
3411
|
editable: !readOnly,
|
|
3537
|
-
onUpdate({ editor
|
|
3538
|
-
let sanitizedOutput = editor
|
|
3412
|
+
onUpdate({ editor }) {
|
|
3413
|
+
let sanitizedOutput = editor.getHTML().replaceAll(/<li><p>(.*?)<\/p><(\/?)(ol|li|ul)>/gi, "<li>$1<$2$3>");
|
|
3539
3414
|
sanitizedOutput = sanitizedOutput.replace(/(<p><\/p>\s*)+/gi, "<p></p>");
|
|
3540
3415
|
sanitizedOutput = sanitizedOutput.replace(/^(<p><\/p>\s*)+/gi, "");
|
|
3541
3416
|
sanitizedOutput = sanitizedOutput.replace(/(<p><\/p>\s*)+$/gi, "");
|
|
@@ -3608,7 +3483,7 @@ const WysiwygEditor = (0, react.forwardRef)(({ id, content, className, placehold
|
|
|
3608
3483
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ListNumbersIcon, {})
|
|
3609
3484
|
})]
|
|
3610
3485
|
})]
|
|
3611
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3486
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tiptap_react.EditorContent, {
|
|
3612
3487
|
editor,
|
|
3613
3488
|
"data-component": "wysiwygEditor",
|
|
3614
3489
|
"data-testid": id,
|
|
@@ -3620,7 +3495,6 @@ const WysiwygEditor = (0, react.forwardRef)(({ id, content, className, placehold
|
|
|
3620
3495
|
children: error
|
|
3621
3496
|
})] });
|
|
3622
3497
|
});
|
|
3623
|
-
|
|
3624
3498
|
//#endregion
|
|
3625
3499
|
exports.AccordionItem = AccordionItem;
|
|
3626
3500
|
exports.AccordionWrapper = AccordionWrapper;
|
|
@@ -3689,4 +3563,5 @@ exports.UnorderedListItem = UnorderedListItem;
|
|
|
3689
3563
|
exports.UnstyledButton = UnstyledButton;
|
|
3690
3564
|
exports.WysiwygEditor = WysiwygEditor;
|
|
3691
3565
|
exports.buttonVariants = buttonVariants;
|
|
3566
|
+
|
|
3692
3567
|
//# sourceMappingURL=index.cjs.map
|