@muffled-ui/react 1.0.21

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/index.mjs ADDED
@@ -0,0 +1,4490 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
21
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
+ var __objRest = (source, exclude) => {
23
+ var target = {};
24
+ for (var prop in source)
25
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
26
+ target[prop] = source[prop];
27
+ if (source != null && __getOwnPropSymbols)
28
+ for (var prop of __getOwnPropSymbols(source)) {
29
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
30
+ target[prop] = source[prop];
31
+ }
32
+ return target;
33
+ };
34
+ var __export = (target, all) => {
35
+ for (var name in all)
36
+ __defProp(target, name, { get: all[name], enumerable: true });
37
+ };
38
+ var __copyProps = (to, from, except, desc) => {
39
+ if (from && typeof from === "object" || typeof from === "function") {
40
+ for (let key of __getOwnPropNames(from))
41
+ if (!__hasOwnProp.call(to, key) && key !== except)
42
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
43
+ }
44
+ return to;
45
+ };
46
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
47
+
48
+ // src/index.ts
49
+ var index_exports = {};
50
+ __export(index_exports, {
51
+ Accordion: () => Accordion,
52
+ AccordionDetail: () => AccordionDetail,
53
+ AccordionSummary: () => AccordionSummary,
54
+ Alert: () => Alert,
55
+ Backdrop: () => Backdrop,
56
+ Badge: () => Badge,
57
+ BasePicker: () => BasePicker,
58
+ BaseUploader: () => BaseUploader,
59
+ Box: () => Box,
60
+ Breadcrumbs: () => Breadcrumbs,
61
+ Button: () => Button,
62
+ ButtonGroup: () => ButtonGroup,
63
+ Card: () => Card,
64
+ CardContent: () => CardContent,
65
+ CardMedia: () => CardMedia,
66
+ CenteredWidget: () => CenteredWidget,
67
+ Checkbox: () => Checkbox,
68
+ Chip: () => Chip,
69
+ CircleLoader: () => CircleLoader,
70
+ CircleProgress: () => CircleProgress,
71
+ ClickOutside: () => ClickOutside,
72
+ ClickableElement: () => ClickableElement,
73
+ Collapse: () => Collapse,
74
+ Container: () => Container5,
75
+ DarkTheme: () => DarkTheme,
76
+ DatePicker: () => DatePicker,
77
+ DateRangePicker: () => DateRangePicker,
78
+ DestructiveButton: () => DestructiveButton,
79
+ DetailsGrouping: () => DetailsGrouping,
80
+ Drawer: () => Drawer,
81
+ Fade: () => Fade,
82
+ GlobalStyles: () => GlobalStyles,
83
+ Grow: () => Grow,
84
+ ImageComp: () => ImageComp,
85
+ Input: () => Input2,
86
+ InputGroup: () => InputGroup,
87
+ Label: () => Label3,
88
+ LightTheme: () => LightTheme,
89
+ LinearLoader: () => LinearLoader,
90
+ LinearProgress: () => LinearProgress,
91
+ LinearSlide: () => LinearSlide,
92
+ List: () => List,
93
+ ListItem: () => ListItem,
94
+ Menu: () => Menu,
95
+ MenuItem: () => MenuItem,
96
+ Modal: () => Modal,
97
+ MuffledUI: () => MuffledUI,
98
+ NumberField: () => NumberField,
99
+ Open: () => Open,
100
+ OrderedList: () => OrderedList,
101
+ OutlineButton: () => OutlineButton,
102
+ Pagination: () => Pagination,
103
+ Panel: () => Panel,
104
+ Password: () => Password,
105
+ Portal: () => Portal,
106
+ PrimaryButton: () => PrimaryButton,
107
+ Radio: () => Radio,
108
+ RadioIcon: () => RadioIcon,
109
+ Scrollable: () => Scrollable,
110
+ SecondaryButton: () => SecondaryButton,
111
+ Select: () => Select,
112
+ SelectButton: () => SelectButton,
113
+ SelectContext: () => SelectContext,
114
+ SelectFilter: () => SelectFilter,
115
+ SelectItem: () => SelectItem,
116
+ SelectList: () => SelectList,
117
+ SettingsContext: () => SettingsContext,
118
+ SimpleSelect: () => SimpleSelect,
119
+ Skeleton: () => Skeleton,
120
+ Slide: () => Slide,
121
+ SnackbarContext: () => SnackbarContext,
122
+ SnackbarItem: () => SnackbarItem,
123
+ SnackbarProvider: () => SnackbarProvider,
124
+ StepIcon: () => StepIcon,
125
+ StepLabel: () => StepLabel,
126
+ Stepper: () => Stepper,
127
+ StepperContext: () => StepperContext,
128
+ Switch: () => Switch,
129
+ SyntaxHighlighter: () => SyntaxHighlighter,
130
+ TabItem: () => TabItem,
131
+ TabItems: () => TabItems,
132
+ TabPane: () => TabPane,
133
+ TabPaneList: () => TabPaneList,
134
+ Table: () => Table,
135
+ TableBody: () => TableBody,
136
+ TableCell: () => TableCell,
137
+ TableHead: () => TableHead,
138
+ TableRow: () => TableRow,
139
+ Tabs: () => Tabs,
140
+ TextArea: () => TextArea,
141
+ ThemeButton: () => ThemeButton,
142
+ ThemeSwitch: () => ThemeSwitch,
143
+ ThreeColumns: () => ThreeColumns,
144
+ Title: () => Title,
145
+ Tooltip: () => Tooltip,
146
+ TwoColumns: () => TwoColumns,
147
+ Typography: () => Typography,
148
+ UnorderedList: () => UnorderedList,
149
+ UploadButton: () => UploadButton,
150
+ UploadZone: () => UploadZone,
151
+ clearInputOnSelectItem: () => clearInputOnSelectItem,
152
+ stopPropagation: () => stopPropagation,
153
+ useMuffledSettings: () => useMuffledSettings,
154
+ useSelectContext: () => useSelectContext,
155
+ useSnackbar: () => useSnackbar,
156
+ useStepperContext: () => useStepperContext
157
+ });
158
+
159
+ // src/inputs/Button/Button.tsx
160
+ import { forwardRef as forwardRef2 } from "react";
161
+ import styled2 from "styled-components";
162
+
163
+ // src/inputs/Button/BaseButton.tsx
164
+ import { forwardRef } from "react";
165
+ import styled from "styled-components";
166
+ import {
167
+ border,
168
+ color,
169
+ flexbox,
170
+ layout,
171
+ position,
172
+ space,
173
+ typography,
174
+ boxShadow
175
+ } from "styled-system";
176
+ import { jsx } from "react/jsx-runtime";
177
+ var StyledButton = styled.button`
178
+ display: inline-flex;
179
+ place-content: center;
180
+ align-items: center;
181
+ user-select: none;
182
+ border-radius: ${({ theme: theme2 }) => theme2.radii[3]};
183
+ padding: ${({ theme: theme2 }) => `${theme2.space[2]} ${theme2.space[3]}`};
184
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes[1]};
185
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights[1]};
186
+ font-weight: 500;
187
+ > :not([hidden]) ~ :not([hidden]) {
188
+ margin-left: 0.5rem;
189
+ }
190
+ ${({ disabled }) => disabled && "cursor: not-allowed;"}
191
+ ${layout}
192
+ ${border}
193
+ ${position}
194
+ ${color}
195
+ ${space}
196
+ ${typography}
197
+ ${flexbox}
198
+ ${boxShadow}
199
+ `;
200
+ var BaseButton = forwardRef((_a, ref) => {
201
+ var _b = _a, {
202
+ children,
203
+ disabled
204
+ } = _b, rest = __objRest(_b, [
205
+ "children",
206
+ "disabled"
207
+ ]);
208
+ return /* @__PURE__ */ jsx(StyledButton, __spreadProps(__spreadValues({ ref, disabled }, rest), { children }));
209
+ });
210
+
211
+ // src/inputs/Button/Button.tsx
212
+ import { darken } from "polished";
213
+ import { jsx as jsx2 } from "react/jsx-runtime";
214
+ var StyledButton2 = styled2(BaseButton)`
215
+ color: ${({ theme: theme2 }) => theme2.colors.foreground};
216
+ background: ${({ theme: theme2, active }) => active ? theme2.colors.accent : "transparent"};
217
+ :disabled {
218
+ color: ${({ theme: theme2 }) => theme2.colors.mutedForeground};
219
+ }
220
+ :hover {
221
+ background: ${({ theme: theme2, active }) => active ? darken(0.05, theme2.colors.accent) : theme2.colors.accent};
222
+ }
223
+ `;
224
+ var Button = forwardRef2((_a, ref) => {
225
+ var _b = _a, { children, color: color6 } = _b, rest = __objRest(_b, ["children", "color"]);
226
+ return /* @__PURE__ */ jsx2(StyledButton2, __spreadProps(__spreadValues({ ref }, rest), { children }));
227
+ });
228
+
229
+ // src/inputs/Button/PrimaryButton.tsx
230
+ import { forwardRef as forwardRef3 } from "react";
231
+ import styled3 from "styled-components";
232
+ import { jsx as jsx3 } from "react/jsx-runtime";
233
+ var StyledButton3 = styled3(BaseButton)`
234
+ :hover {
235
+ opacity: 0.8;
236
+ }
237
+ :disabled {
238
+ opacity: 0.8;
239
+ }
240
+ `;
241
+ var PrimaryButton = forwardRef3((_a, ref) => {
242
+ var _b = _a, {
243
+ children
244
+ } = _b, rest = __objRest(_b, [
245
+ "children"
246
+ ]);
247
+ return /* @__PURE__ */ jsx3(
248
+ StyledButton3,
249
+ __spreadProps(__spreadValues({
250
+ color: "background",
251
+ bg: "primary",
252
+ ref
253
+ }, rest), {
254
+ children
255
+ })
256
+ );
257
+ });
258
+
259
+ // src/inputs/Button/SecondaryButton.tsx
260
+ import { forwardRef as forwardRef4 } from "react";
261
+ import styled4 from "styled-components";
262
+ import { jsx as jsx4 } from "react/jsx-runtime";
263
+ var StyledButton4 = styled4(BaseButton)`
264
+ :hover {
265
+ opacity: 0.7;
266
+ }
267
+ :disabled {
268
+ opacity: 0.7;
269
+ }
270
+ `;
271
+ var SecondaryButton = forwardRef4((_a, ref) => {
272
+ var _b = _a, {
273
+ children
274
+ } = _b, rest = __objRest(_b, [
275
+ "children"
276
+ ]);
277
+ return /* @__PURE__ */ jsx4(
278
+ StyledButton4,
279
+ __spreadProps(__spreadValues({
280
+ color: "secondaryForeground",
281
+ bg: "secondary",
282
+ ref
283
+ }, rest), {
284
+ children
285
+ })
286
+ );
287
+ });
288
+
289
+ // src/inputs/Button/DestructiveButton.tsx
290
+ import { forwardRef as forwardRef5 } from "react";
291
+ import styled5 from "styled-components";
292
+ import { darken as darken2 } from "polished";
293
+ import { jsx as jsx5 } from "react/jsx-runtime";
294
+ var StyledButton5 = styled5(BaseButton)`
295
+ :hover {
296
+ background: ${({ theme: theme2 }) => darken2(0.1, theme2.colors.destructive)};
297
+ }
298
+ :disabled {
299
+ opacity: 0.8;
300
+ }
301
+ `;
302
+ var DestructiveButton = forwardRef5((_a, ref) => {
303
+ var _b = _a, {
304
+ children
305
+ } = _b, rest = __objRest(_b, [
306
+ "children"
307
+ ]);
308
+ return /* @__PURE__ */ jsx5(
309
+ StyledButton5,
310
+ __spreadProps(__spreadValues({
311
+ color: "destructiveForeground",
312
+ bg: "destructive",
313
+ ref
314
+ }, rest), {
315
+ children
316
+ })
317
+ );
318
+ });
319
+
320
+ // src/inputs/Button/OutlineButton.tsx
321
+ import { forwardRef as forwardRef6 } from "react";
322
+ import styled6 from "styled-components";
323
+ import { jsx as jsx6 } from "react/jsx-runtime";
324
+ var StyledButton6 = styled6(BaseButton)`
325
+ :disabled {
326
+ background: ${({ theme: theme2 }) => theme2.colors.accent};
327
+ }
328
+ :hover:not(:disabled) {
329
+ background: ${({ theme: theme2 }) => theme2.colors.accent};
330
+ }
331
+ `;
332
+ var OutlineButton = forwardRef6((_a, ref) => {
333
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
334
+ return /* @__PURE__ */ jsx6(
335
+ StyledButton6,
336
+ __spreadProps(__spreadValues({
337
+ backgroundColor: "background",
338
+ boxShadow: "base.0",
339
+ border: "border.1",
340
+ color: "foreground",
341
+ lineHeight: "18px",
342
+ ref
343
+ }, rest), {
344
+ children
345
+ })
346
+ );
347
+ });
348
+
349
+ // src/inputs/Button/ClickableElement.tsx
350
+ import { forwardRef as forwardRef7 } from "react";
351
+ import { jsx as jsx7 } from "react/jsx-runtime";
352
+ var ClickableElement = forwardRef7((_a, ref) => {
353
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
354
+ return /* @__PURE__ */ jsx7(
355
+ BaseButton,
356
+ __spreadProps(__spreadValues({
357
+ padding: "0",
358
+ backgroundColor: "transparent",
359
+ fontWeight: "inherit",
360
+ lineHeight: "inherit",
361
+ fontSize: "inherit",
362
+ ref
363
+ }, rest), {
364
+ children
365
+ })
366
+ );
367
+ });
368
+
369
+ // src/utils/Transitions/Collapse.tsx
370
+ import { useMeasure } from "react-use";
371
+ import { animated, useSpring } from "react-spring";
372
+
373
+ // src/shared/usePrevious.tsx
374
+ import { useEffect, useRef } from "react";
375
+ function usePrevious(state) {
376
+ let ref = useRef();
377
+ useEffect(() => {
378
+ ref.current = state;
379
+ });
380
+ return ref.current;
381
+ }
382
+
383
+ // src/utils/Transitions/Collapse.tsx
384
+ import { jsx as jsx8 } from "react/jsx-runtime";
385
+ var Collapse = (_a) => {
386
+ var _b = _a, { children, inProp = false } = _b, rest = __objRest(_b, ["children", "inProp"]);
387
+ let previous = usePrevious(inProp);
388
+ let [ref, { height: viewHeight }] = useMeasure();
389
+ let { height } = useSpring(__spreadValues({
390
+ from: { height: 0 },
391
+ to: { height: inProp ? viewHeight : 0 }
392
+ }, rest));
393
+ return /* @__PURE__ */ jsx8(animated.div, { style: { overflow: "hidden", height: inProp && previous === inProp ? "auto" : height }, children: /* @__PURE__ */ jsx8(animated.div, { ref, children }) });
394
+ };
395
+
396
+ // src/utils/Transitions/Slide.tsx
397
+ import { useRef as useRef2 } from "react";
398
+ import { animated as animated2, useTransition, useSpring as useSpring2, useSpringRef, useChain } from "react-spring";
399
+ import { jsx as jsx9 } from "react/jsx-runtime";
400
+ var Slide = (_a) => {
401
+ var _b = _a, { children, inProp } = _b, rest = __objRest(_b, ["children", "inProp"]);
402
+ let ref = useRef2(null);
403
+ let springRef = useSpringRef();
404
+ let { opacity } = useSpring2({
405
+ ref: springRef,
406
+ from: { opacity: 1 },
407
+ to: { opacity: 0 }
408
+ });
409
+ let transRef = useSpringRef();
410
+ let transitions = useTransition(inProp, __spreadValues({
411
+ ref: transRef,
412
+ from: { translateX: "100%" },
413
+ enter: { translateX: "0" },
414
+ leave: { translateX: "100%" },
415
+ reverse: inProp
416
+ }, rest));
417
+ useChain(inProp ? [transRef] : [transRef, springRef], [0, 0.2]);
418
+ return transitions(
419
+ (styles, item) => item && /* @__PURE__ */ jsx9(
420
+ animated2.div,
421
+ {
422
+ ref,
423
+ style: __spreadProps(__spreadValues({}, styles), { opacity }),
424
+ children
425
+ }
426
+ )
427
+ );
428
+ };
429
+
430
+ // src/utils/Transitions/Fade.tsx
431
+ import { animated as animated3, useTransition as useTransition2 } from "react-spring";
432
+ import { jsx as jsx10 } from "react/jsx-runtime";
433
+ var Fade = (_a) => {
434
+ var _b = _a, { children, inProp } = _b, rest = __objRest(_b, ["children", "inProp"]);
435
+ let transitions = useTransition2(inProp, __spreadValues({
436
+ from: { opacity: 0 },
437
+ enter: { opacity: 1 },
438
+ leave: { opacity: 0 },
439
+ reverse: inProp
440
+ }, rest));
441
+ return transitions(
442
+ (styles, item) => item && /* @__PURE__ */ jsx10(animated3.div, { style: styles, children })
443
+ );
444
+ };
445
+
446
+ // src/utils/Transitions/LinearSlide.tsx
447
+ import { animated as animated4, useSpring as useSpring3 } from "react-spring";
448
+ import { jsx as jsx11 } from "react/jsx-runtime";
449
+ var LinearSlide = (_a) => {
450
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
451
+ let styles = useSpring3(__spreadValues({
452
+ from: { translateX: "-100%", left: "0" },
453
+ to: { translateX: "100", left: "100%" },
454
+ config: { duration: 2e3 },
455
+ loop: true
456
+ }, rest));
457
+ return /* @__PURE__ */ jsx11(animated4.div, { style: styles, children });
458
+ };
459
+
460
+ // src/utils/Transitions/Grow.tsx
461
+ import { animated as animated5, useTransition as useTransition3 } from "react-spring";
462
+ import styled7 from "styled-components";
463
+ import { jsx as jsx12 } from "react/jsx-runtime";
464
+ var Container = styled7(animated5.div)`
465
+ transform-origin: top left;
466
+ `;
467
+ var Grow = (_a) => {
468
+ var _b = _a, { children, inProp } = _b, rest = __objRest(_b, ["children", "inProp"]);
469
+ let transitions = useTransition3(inProp, __spreadValues({
470
+ from: { opacity: 0, transform: "scale(0)" },
471
+ enter: { opacity: 1, transform: "scale(1)" },
472
+ leave: { opacity: 0, transform: "scale(0)" },
473
+ config: {
474
+ duration: 100
475
+ },
476
+ reverse: inProp
477
+ }, rest));
478
+ return transitions(
479
+ (styles, item) => item && /* @__PURE__ */ jsx12(Container, { style: styles, children })
480
+ );
481
+ };
482
+
483
+ // src/utils/Transitions/Open.tsx
484
+ import { animated as animated6, useTransition as useTransition4 } from "react-spring";
485
+ import { jsx as jsx13 } from "react/jsx-runtime";
486
+ var Open = (_a) => {
487
+ var _b = _a, { children, direction = "right", inProp } = _b, rest = __objRest(_b, ["children", "direction", "inProp"]);
488
+ let transitions = useTransition4(inProp, __spreadValues({
489
+ from: { translateX: direction === "right" ? "100%" : "-100%" },
490
+ enter: { translateX: direction === "right" ? "0%" : "0%" },
491
+ leave: { translateX: direction === "right" ? "100%" : "-100%" },
492
+ reverse: inProp
493
+ }, rest));
494
+ return transitions(
495
+ (styles, item) => item && /* @__PURE__ */ jsx13(animated6.div, __spreadProps(__spreadValues({}, rest), { style: styles, children }))
496
+ );
497
+ };
498
+
499
+ // src/data/Accordion/AccordionSummary.tsx
500
+ import styled8 from "styled-components";
501
+ import { ChevronRightIcon } from "@heroicons/react/24/solid";
502
+ import { jsx as jsx14, jsxs } from "react/jsx-runtime";
503
+ var StyledSummary = styled8(ClickableElement)`
504
+ width: 100%;
505
+ padding: ${({ theme: theme2 }) => `${theme2.space[2]} ${theme2.space[3]}`};
506
+ border-bottom: ${({ theme: theme2 }) => theme2.borders.border[1]};
507
+ border-left: ${({ theme: theme2 }) => theme2.borders.border[1]};
508
+ border-right: ${({ theme: theme2 }) => theme2.borders.border[1]};
509
+ background: ${({ theme: theme2 }) => theme2.colors.background};
510
+ place-content: flex-start;
511
+ border-radius: 0;
512
+ &:focus {
513
+ box-shadow: none;
514
+ }
515
+ &:first-of-type {
516
+ border-top: ${({ theme: theme2 }) => theme2.borders.border[1]};
517
+ border-top-left-radius: ${({ theme: theme2 }) => theme2.radii[3]};
518
+ border-top-right-radius: ${({ theme: theme2 }) => theme2.radii[3]};
519
+ }
520
+ &:last-of-type {
521
+ ${({ theme: theme2, isOpen }) => !isOpen && `
522
+ border-bottom-left-radius: ${theme2.radii[3]};
523
+ border-bottom-right-radius: ${theme2.radii[3]};
524
+ `}
525
+ }
526
+ `;
527
+ var StyledIcon = styled8(ChevronRightIcon)`
528
+ margin-right: ${({ theme: theme2 }) => theme2.space[3]};
529
+ transition-property: all;
530
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
531
+ transition-duration: 150ms;
532
+ ${({ isOpen }) => isOpen && `
533
+ transform: rotate(90deg);
534
+ `}
535
+ `;
536
+ var AccordionSummary = ({ isOpen, onClick, children }) => /* @__PURE__ */ jsxs(StyledSummary, { isOpen, onClick, children: [
537
+ /* @__PURE__ */ jsx14(
538
+ StyledIcon,
539
+ {
540
+ width: 16,
541
+ height: 16,
542
+ isOpen
543
+ }
544
+ ),
545
+ children
546
+ ] });
547
+
548
+ // src/data/Accordion/AccordionDetail.tsx
549
+ import styled9 from "styled-components";
550
+ var AccordionDetail = styled9.div`
551
+ background: ${({ theme: theme2 }) => theme2.colors.background};
552
+ padding: ${({ theme: theme2 }) => `${theme2.space[3]} ${theme2.space[2]}`};
553
+ border-bottom: ${({ theme: theme2 }) => theme2.borders.border[1]};
554
+ border-left: ${({ theme: theme2 }) => theme2.borders.border[1]};
555
+ border-right: ${({ theme: theme2 }) => theme2.borders.border[1]};
556
+ box-shadow: ${({ theme: theme2 }) => theme2.shadows.inner};
557
+ `;
558
+ var DetailsGrouping = styled9.div`
559
+ :last-of-type ${AccordionDetail} {
560
+ border-bottom-left-radius: ${({ theme: theme2 }) => theme2.radii[3]};
561
+ border-bottom-right-radius: ${({ theme: theme2 }) => theme2.radii[3]};
562
+ }
563
+ `;
564
+
565
+ // src/data/Accordion/Accordion.tsx
566
+ import { Fragment, jsx as jsx15, jsxs as jsxs2 } from "react/jsx-runtime";
567
+ var Accordion = ({
568
+ summary,
569
+ children,
570
+ onClick,
571
+ isOpen
572
+ }) => {
573
+ let accodingTitle = typeof summary === "string" ? /* @__PURE__ */ jsx15(AccordionSummary, { onClick, isOpen, children: summary }) : /* @__PURE__ */ jsx15(ClickableElement, { onClick, children: summary });
574
+ let details = typeof children === "string" ? /* @__PURE__ */ jsx15(AccordionDetail, { children }) : children;
575
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
576
+ accodingTitle,
577
+ /* @__PURE__ */ jsx15(DetailsGrouping, { children: /* @__PURE__ */ jsx15(Collapse, { inProp: isOpen, children: details }) })
578
+ ] });
579
+ };
580
+
581
+ // src/data/Box/Box.tsx
582
+ import styled10 from "styled-components";
583
+ import {
584
+ border as border2,
585
+ boxShadow as boxShadow2,
586
+ color as color2,
587
+ grid,
588
+ layout as layout2,
589
+ order,
590
+ space as space2,
591
+ flexbox as flexbox2,
592
+ position as position2,
593
+ typography as typography2
594
+ } from "styled-system";
595
+ var Box = styled10.div`
596
+ ${space2}
597
+ ${layout2}
598
+ ${color2}
599
+ ${boxShadow2}
600
+ ${border2}
601
+ ${order}
602
+ ${grid}
603
+ ${flexbox2}
604
+ ${position2}
605
+ ${typography2}
606
+ ${({ spaceXBetween: spaceXBetween2, theme: theme2 }) => spaceXBetween2 && theme2.spaceXBetween[spaceXBetween2]}
607
+ ${({ spaceYBetween: spaceYBetween2, theme: theme2 }) => spaceYBetween2 && theme2.spaceYBetween[spaceYBetween2]}
608
+ `;
609
+
610
+ // src/data/Cards/Card.tsx
611
+ import styled11 from "styled-components";
612
+ import { flexbox as flexbox3, layout as layout3, space as space3, color as color3, background } from "styled-system";
613
+ var Card = styled11.div`
614
+ background: ${({ theme: theme2 }) => theme2.colors.background};
615
+ border-radius: ${({ theme: theme2 }) => theme2.radii[3]};
616
+ box-shadow: ${({ theme: theme2 }) => theme2.shadows.base[0]};
617
+ border:${({ theme: theme2 }) => theme2.borders.border[1]};
618
+ overflow: hidden;
619
+ ${layout3}
620
+ ${flexbox3}
621
+ ${space3}
622
+ ${color3}
623
+ ${background}
624
+ `;
625
+
626
+ // src/data/Cards/CardContent.tsx
627
+ import styled12 from "styled-components";
628
+ import { border as border3, space as space4 } from "styled-system";
629
+ var CardContent = styled12.div`
630
+ padding-top: ${({ theme: theme2 }) => theme2.space[2]};
631
+ padding-bottom: ${({ theme: theme2 }) => theme2.space[2]};
632
+ padding-left: ${({ theme: theme2 }) => theme2.space[3]};
633
+ padding-right: ${({ theme: theme2 }) => theme2.space[3]};
634
+ ${space4}
635
+ ${border3}
636
+ `;
637
+
638
+ // src/data/Cards/CardMedia.tsx
639
+ import { useState } from "react";
640
+ import styled13 from "styled-components";
641
+ import { layout as layout4 } from "styled-system";
642
+ import { Fragment as Fragment2, jsx as jsx16 } from "react/jsx-runtime";
643
+ var MEDIA_COMPONENTS = ["video", "audio", "picture", "iframe", "img"];
644
+ var IMAGE_COMPONENTS = ["picture", "img"];
645
+ var Component = styled13.div`
646
+ ${layout4}
647
+ object-fit: ${({ isImageComponent }) => isImageComponent ? "cover" : "unset"};
648
+ display: block;
649
+ background-size: cover;
650
+ background-repeat: no-repeat;
651
+ background-position: center;
652
+ ${({ image, showBgImagine }) => showBgImagine ? `background-image: url("${image}");` : ""}
653
+ `;
654
+ var CardMedia = (_a) => {
655
+ var _b = _a, {
656
+ children,
657
+ as,
658
+ image,
659
+ src,
660
+ fallback: fallback2
661
+ } = _b, rest = __objRest(_b, [
662
+ "children",
663
+ "as",
664
+ "image",
665
+ "src",
666
+ "fallback"
667
+ ]);
668
+ let [errored, setError] = useState(false);
669
+ let isImageComponent = IMAGE_COMPONENTS.indexOf(as) !== -1;
670
+ let isMediaComponent = MEDIA_COMPONENTS.indexOf(as) !== -1;
671
+ let showBgImagine = !isMediaComponent && image !== void 0;
672
+ return errored ? /* @__PURE__ */ jsx16(Fragment2, { children: fallback2 }) : /* @__PURE__ */ jsx16(
673
+ Component,
674
+ __spreadProps(__spreadValues({
675
+ as,
676
+ onError: () => setError(true),
677
+ src,
678
+ isImageComponent,
679
+ isMediaComponent,
680
+ showBgImagine
681
+ }, rest), {
682
+ children
683
+ })
684
+ );
685
+ };
686
+
687
+ // src/data/Image/Image.tsx
688
+ import { useState as useState2 } from "react";
689
+ import styled14 from "styled-components";
690
+ import {
691
+ flexbox as flexbox4,
692
+ grid as grid2,
693
+ layout as layout5,
694
+ order as order2,
695
+ position as position3,
696
+ space as space5
697
+ } from "styled-system";
698
+ import { Fragment as Fragment3, jsx as jsx17 } from "react/jsx-runtime";
699
+ var Img = styled14.img`
700
+ ${space5}
701
+ ${layout5}
702
+ ${order2}
703
+ ${grid2}
704
+ ${flexbox4}
705
+ ${position3}
706
+ `;
707
+ var ImageComp = (_a) => {
708
+ var _b = _a, { fallback: fallback2 } = _b, rest = __objRest(_b, ["fallback"]);
709
+ let [hasError, setError] = useState2(false);
710
+ return hasError && fallback2 ? /* @__PURE__ */ jsx17(Fragment3, { children: fallback2 }) : /* @__PURE__ */ jsx17(Img, __spreadValues({ onError: () => setError(true) }, rest));
711
+ };
712
+
713
+ // src/data/List/List.tsx
714
+ import styled15 from "styled-components";
715
+ var List = styled15.ul`
716
+ list-style-position: inside;
717
+ list-style-type: none;
718
+ `;
719
+
720
+ // src/data/Typography/Typography.tsx
721
+ import styled16 from "styled-components";
722
+ import { color as color4, typography as typography3 } from "styled-system";
723
+ var Typography = styled16.p`
724
+ font-family: ${({ mono, theme: theme2 }) => mono ? theme2.fonts.mono : ""};
725
+ ${color4}
726
+ ${typography3}
727
+ `;
728
+
729
+ // src/data/Typography/Title.tsx
730
+ import styled17 from "styled-components";
731
+ import { color as color5, layout as layout6, typography as typography4, variant } from "styled-system";
732
+ var Title = styled17.h1`
733
+ color: ${({ theme: theme2 }) => theme2.colors.foreground};
734
+ font-weight: bold;
735
+ ${color5}
736
+ ${typography4}
737
+ ${layout6}
738
+ ${variant({
739
+ prop: "as",
740
+ variants: {
741
+ h1: { fontSize: 5 },
742
+ h2: { fontSize: 4 },
743
+ h3: { fontSize: 3 },
744
+ h4: { fontSize: 2 },
745
+ h5: { fontSize: 1 },
746
+ h6: { fontSize: 0 }
747
+ }
748
+ })}
749
+ `;
750
+
751
+ // src/data/List/ListItem.tsx
752
+ import { jsx as jsx18 } from "react/jsx-runtime";
753
+ var ListItem = (_a) => {
754
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
755
+ return /* @__PURE__ */ jsx18(Typography, __spreadProps(__spreadValues({ as: "li" }, rest), { children }));
756
+ };
757
+
758
+ // src/data/List/OrderedList.tsx
759
+ import styled18 from "styled-components";
760
+ var OrderedList = styled18.ol`
761
+ list-style-type: decimal;
762
+ list-style-position: inside;
763
+ *::marker {
764
+ color:${({ theme: theme2 }) => theme2.colors.foreground};
765
+ }
766
+ `;
767
+
768
+ // src/data/List/UnorderedList.tsx
769
+ import styled19 from "styled-components";
770
+ var UnorderedList = styled19.ul`
771
+ list-style-type: disc;
772
+ list-style-position: inside;
773
+ *::marker {
774
+ color:${({ theme: theme2 }) => theme2.colors.foreground};
775
+ }
776
+ `;
777
+
778
+ // src/data/Pagination/Pagination.tsx
779
+ import styled22 from "styled-components";
780
+
781
+ // src/data/Pagination/PaginationControls.tsx
782
+ import { useMemo } from "react";
783
+ import { ChevronLeftIcon, ChevronRightIcon as ChevronRightIcon2, EllipsisHorizontalIcon } from "@heroicons/react/24/outline";
784
+
785
+ // src/inputs/ButtonGroup/ButtonGroup.tsx
786
+ import styled20 from "styled-components";
787
+ import { jsx as jsx19 } from "react/jsx-runtime";
788
+ var Grouping = styled20.div`
789
+ ${StyledButton}:not([data-ignore-radius]) {
790
+ border-radius:0;
791
+ }
792
+ ${StyledButton} {
793
+ position: relative;
794
+ margin-right: -1px;
795
+ }
796
+ ${StyledButton}:first-of-type {
797
+ border-top-left-radius: ${({ theme: theme2 }) => theme2.radii[3]};
798
+ border-bottom-left-radius: ${({ theme: theme2 }) => theme2.radii[3]};
799
+ }
800
+
801
+ ${StyledButton}:last-of-type {
802
+ border-top-right-radius: ${({ theme: theme2 }) => theme2.radii[3]};
803
+ border-bottom-right-radius: ${({ theme: theme2 }) => theme2.radii[3]};
804
+ }
805
+ `;
806
+ var ButtonGroup = ({ children }) => /* @__PURE__ */ jsx19(Grouping, { children });
807
+
808
+ // src/data/Pagination/utils.ts
809
+ var arrayRange = (from, to) => Array.from(Array(Math.max(0, to - from + 1)), (_, idx) => idx + from);
810
+ var clamp = (value, min, max) => Math.max(min, Math.min(value, max));
811
+ var calculatePageNumbers = (totalPages, currentPage, ellipsis) => {
812
+ let pageNeighbours = 1;
813
+ let totalNumbers = 7;
814
+ let totalControls = totalNumbers + pageNeighbours;
815
+ if (totalPages < totalControls) {
816
+ return arrayRange(1, totalPages);
817
+ }
818
+ let minPageNumber = 3;
819
+ let maxPageNumber = totalPages - 2;
820
+ let startPage = clamp(currentPage - pageNeighbours, minPageNumber, totalPages - 4);
821
+ let endPage = clamp(currentPage + pageNeighbours, 5, maxPageNumber);
822
+ let hasLeftEllipsis = startPage > minPageNumber;
823
+ let hasRightEllipsis = endPage < maxPageNumber;
824
+ return [
825
+ 1,
826
+ hasLeftEllipsis ? ellipsis : 2,
827
+ ...arrayRange(startPage, endPage),
828
+ hasRightEllipsis ? ellipsis : totalPages - 1,
829
+ totalPages
830
+ ];
831
+ };
832
+
833
+ // src/data/Pagination/PaginationControls.tsx
834
+ import styled21 from "styled-components";
835
+ import { jsx as jsx20, jsxs as jsxs3 } from "react/jsx-runtime";
836
+ var StyledBtn = styled21(ClickableElement)`
837
+ :hover {
838
+ background: ${({ theme: theme2 }) => theme2.colors.accent};
839
+ }
840
+ `;
841
+ var ELLIPSIS_ELEMENT = /* @__PURE__ */ jsx20(EllipsisHorizontalIcon, { width: 16, height: 20 });
842
+ var PaginationControls = ({
843
+ skip,
844
+ limit,
845
+ itemCount,
846
+ setSkip
847
+ }) => {
848
+ let currentPage = skip === 0 ? 1 : Math.floor(skip / limit + 1);
849
+ let totalPages = Math.ceil(itemCount / limit);
850
+ let pages = useMemo(() => {
851
+ return calculatePageNumbers(totalPages, currentPage, ELLIPSIS_ELEMENT);
852
+ }, [totalPages, currentPage]);
853
+ let handlePageClick = (page) => {
854
+ let newSkip = 0;
855
+ if (typeof page === "number" && page !== 1) {
856
+ newSkip = limit * (page - 1);
857
+ }
858
+ setSkip(newSkip);
859
+ };
860
+ if (totalPages <= 1) {
861
+ return null;
862
+ }
863
+ return /* @__PURE__ */ jsxs3(ButtonGroup, { children: [
864
+ /* @__PURE__ */ jsx20(
865
+ Button,
866
+ {
867
+ verticalAlign: "bottom",
868
+ onClick: () => setSkip(skip - limit),
869
+ disabled: currentPage === 1,
870
+ children: /* @__PURE__ */ jsx20(ChevronLeftIcon, { width: 16, height: 20 })
871
+ }
872
+ ),
873
+ pages.map((page, idx) => /* @__PURE__ */ jsx20(
874
+ StyledBtn,
875
+ {
876
+ borderRadius: 2,
877
+ verticalAlign: "bottom",
878
+ zIndex: page === currentPage ? 30 : "unset",
879
+ width: "36px",
880
+ height: "36px",
881
+ border: page === currentPage ? "border.1" : "none",
882
+ onClick: () => handlePageClick(page),
883
+ disabled: page === ELLIPSIS_ELEMENT,
884
+ "data-ignore-radius": true,
885
+ children: page
886
+ },
887
+ page === ELLIPSIS_ELEMENT ? "ellipsis" + idx : page
888
+ )),
889
+ /* @__PURE__ */ jsx20(
890
+ Button,
891
+ {
892
+ verticalAlign: "bottom",
893
+ onClick: () => setSkip(skip + limit),
894
+ disabled: currentPage === totalPages,
895
+ children: /* @__PURE__ */ jsx20(ChevronRightIcon2, { width: 16, height: 20 })
896
+ }
897
+ )
898
+ ] });
899
+ };
900
+
901
+ // src/data/Pagination/Pagination.tsx
902
+ import { jsx as jsx21, jsxs as jsxs4 } from "react/jsx-runtime";
903
+ var Container2 = styled22.div`
904
+ width: 100%;
905
+ display: flex;
906
+ justify-content: space-between;
907
+ align-items: center;
908
+ min-height: 38px;
909
+ line-height: 1rem;
910
+ `;
911
+ var Strong = styled22.strong`
912
+ font-weight: 500;
913
+ `;
914
+ var Pagination = ({
915
+ limit,
916
+ skip,
917
+ setSkip,
918
+ itemCount
919
+ }) => {
920
+ let to = skip + limit > itemCount ? itemCount : skip + limit;
921
+ return /* @__PURE__ */ jsxs4(Container2, { children: [
922
+ /* @__PURE__ */ jsxs4("div", { children: [
923
+ "Showing ",
924
+ /* @__PURE__ */ jsx21(Strong, { children: skip + 1 }),
925
+ " to ",
926
+ /* @__PURE__ */ jsx21(Strong, { children: to }),
927
+ " of ",
928
+ /* @__PURE__ */ jsx21(Strong, { children: itemCount }),
929
+ " results"
930
+ ] }),
931
+ /* @__PURE__ */ jsx21("div", { children: /* @__PURE__ */ jsx21(PaginationControls, { itemCount, limit, skip, setSkip }) })
932
+ ] });
933
+ };
934
+
935
+ // src/data/Panel/Panel.tsx
936
+ import styled23 from "styled-components";
937
+ var Panel = styled23(Box)`
938
+ border-radius:${({ theme: theme2 }) => theme2.radii[4]};
939
+ border: ${({ theme: theme2 }) => theme2.borders.border[1]};
940
+ background: ${({ theme: theme2 }) => theme2.colors.offsetBackground};
941
+ `;
942
+
943
+ // src/data/Table/Table.tsx
944
+ import { forwardRef as forwardRef8 } from "react";
945
+ import styled24 from "styled-components";
946
+ import { jsx as jsx22, jsxs as jsxs5 } from "react/jsx-runtime";
947
+ var Container3 = styled24.div`
948
+ background: ${({ theme: theme2 }) => theme2.colors.background};
949
+ border: 1px solid ${({ theme: theme2 }) => theme2.colors.border};
950
+ border-radius: ${({ theme: theme2 }) => theme2.radii[3]};
951
+ contain: paint;
952
+ padding-bottom: ${({ footer, theme: theme2 }) => !footer ? theme2.space[1] : "0"};
953
+ `;
954
+ var StyledTable = styled24.table`
955
+ width: 100%;
956
+ position: relative;
957
+ border-collapse: collapse;
958
+ > :not([hidden]) ~ :not([hidden]) & :not(:last-child) {
959
+ border-top-width: 1px;
960
+ border-bottom-width: 1px;
961
+ border-color: ${({ theme: theme2 }) => theme2.colors.border}
962
+ }
963
+ `;
964
+ var Footer = styled24.div`
965
+ padding: ${({ theme: theme2 }) => `${theme2.space[2]} ${theme2.space[4]}`};
966
+ border-top-width: 1px;
967
+ border-color: ${({ theme: theme2 }) => theme2.colors.border};
968
+ `;
969
+ var Table = forwardRef8((_a, ref) => {
970
+ var _b = _a, { children, containerClasses, footer } = _b, rest = __objRest(_b, ["children", "containerClasses", "footer"]);
971
+ return /* @__PURE__ */ jsxs5(Container3, { footer, children: [
972
+ /* @__PURE__ */ jsx22(StyledTable, __spreadProps(__spreadValues({ ref }, rest), { children })),
973
+ footer && /* @__PURE__ */ jsx22(Footer, { children: footer })
974
+ ] });
975
+ });
976
+
977
+ // src/data/Table/TableBody.tsx
978
+ import styled25 from "styled-components";
979
+ var TableBody = styled25.tbody`
980
+ background: ${({ theme: theme2 }) => theme2.colors.background};
981
+ border-top-width: 1px;
982
+ > :not([hidden]) ~ :not([hidden]) {
983
+ border-top-width: 1px;
984
+ border-color: ${({ theme: theme2 }) => theme2.colors.border}
985
+ }
986
+ `;
987
+
988
+ // src/data/Table/TableCell.tsx
989
+ import styled26 from "styled-components";
990
+ var TableCell = styled26.td`
991
+ padding: ${({ theme: theme2 }) => `0.625rem ${theme2.space[3]}`}
992
+ `;
993
+
994
+ // src/data/Table/TableRow.tsx
995
+ import styled27 from "styled-components";
996
+ var TableRow = styled27.tr`
997
+ ${({ onClick, theme: theme2 }) => typeof onClick === "function" && `
998
+ cursor: pointer;
999
+ :hover {
1000
+ background: ${theme2.colors.accent};
1001
+ box-shadow: ${theme2.colors.primary} 3px 0px 0px 0px inset;
1002
+ }
1003
+ `}
1004
+ ${({ active, theme: theme2 }) => active && `
1005
+ cursor: pointer;
1006
+ background: ${theme2.colors.accent};
1007
+ box-shadow: ${theme2.colors.primary} 3px 0px 0px 0px inset;
1008
+ `}
1009
+ `;
1010
+
1011
+ // src/data/Table/TableHead.tsx
1012
+ import { forwardRef as forwardRef9 } from "react";
1013
+ import styled28 from "styled-components";
1014
+ import { jsx as jsx23 } from "react/jsx-runtime";
1015
+ var Thead = styled28.thead`
1016
+ text-align: left;
1017
+ background: ${({ theme: theme2 }) => theme2.colors.background};
1018
+ border-bottom: 1px solid ${({ theme: theme2 }) => theme2.colors.border};
1019
+ ${({ sticky, theme: theme2 }) => sticky && `
1020
+ position: sticky;
1021
+ top: 0;
1022
+ box-shadow: ${theme2.shadows.base[1]};
1023
+ `}
1024
+ `;
1025
+ var TableHeadItem = styled28.th`
1026
+ padding: ${({ theme: theme2 }) => theme2.space[3]};
1027
+ font-weight: 500;
1028
+ text-transform: uppercase;
1029
+ letter-spacing: 0.025em;
1030
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes[0]};
1031
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights[0]};
1032
+ color: ${({ theme: theme2 }) => theme2.colors.mutedForeground};
1033
+ `;
1034
+ var TableHead = forwardRef9((_a, ref) => {
1035
+ var _b = _a, { children, headers, sticky } = _b, rest = __objRest(_b, ["children", "headers", "sticky"]);
1036
+ if (!headers) {
1037
+ return /* @__PURE__ */ jsx23(Thead, __spreadProps(__spreadValues({ sticky, ref }, rest), { children }));
1038
+ }
1039
+ return /* @__PURE__ */ jsx23(Thead, { sticky, ref, children: /* @__PURE__ */ jsx23("tr", { children: headers.map((h) => /* @__PURE__ */ jsx23(TableHeadItem, { children: h }, h)) }) });
1040
+ });
1041
+
1042
+ // src/feedback/Alert/Alert.tsx
1043
+ import styled30 from "styled-components";
1044
+ import { ExclamationCircleIcon } from "@heroicons/react/24/outline";
1045
+
1046
+ // src/feedback/Alert/CloseBtn.tsx
1047
+ import styled29 from "styled-components";
1048
+ import { XMarkIcon } from "@heroicons/react/24/solid";
1049
+ import { jsx as jsx24 } from "react/jsx-runtime";
1050
+ var StyledButton7 = styled29(ClickableElement)`
1051
+ float:right;
1052
+ padding: ${({ theme: theme2 }) => `${theme2.sizes[1]} ${theme2.sizes[2]}`};
1053
+ `;
1054
+ var CloseBtn = ({ onClick }) => /* @__PURE__ */ jsx24(StyledButton7, { onClick, children: /* @__PURE__ */ jsx24(XMarkIcon, { width: 16, height: 16 }) });
1055
+
1056
+ // src/feedback/Alert/Alert.tsx
1057
+ import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs6 } from "react/jsx-runtime";
1058
+ var Container4 = styled30(Box)`
1059
+ border: 1px solid;
1060
+ border-color: ${({ theme: theme2, destructive }) => destructive ? theme2.colors.destructive : theme2.colors.border};
1061
+ background: ${({ theme: theme2, destructive }) => destructive ? theme2.colors.destructive : theme2.colors.background};
1062
+ h1, svg, p {
1063
+ color: ${({ theme: theme2, destructive }) => destructive ? theme2.colors.destructiveForeground : theme2.colors.foreground};
1064
+ }
1065
+ `;
1066
+ var Icon = styled30(Box)`
1067
+ float: left;
1068
+ :empty {
1069
+ margin: 0;
1070
+ }
1071
+ `;
1072
+ var Content = styled30(Typography)`
1073
+ min-width: 100%;
1074
+ margin-top: ${({ theme: theme2 }) => theme2.space[2]};
1075
+ :empty {
1076
+ margin-top: 0;
1077
+ }
1078
+ `;
1079
+ var Alert = (_a) => {
1080
+ var _b = _a, {
1081
+ destructive = false,
1082
+ title,
1083
+ icon,
1084
+ children,
1085
+ withClose
1086
+ } = _b, rest = __objRest(_b, [
1087
+ "destructive",
1088
+ "title",
1089
+ "icon",
1090
+ "children",
1091
+ "withClose"
1092
+ ]);
1093
+ let Icons = icon || (destructive ? /* @__PURE__ */ jsx25(ExclamationCircleIcon, { width: 20, height: 20 }) : /* @__PURE__ */ jsx25(Fragment4, {}));
1094
+ return /* @__PURE__ */ jsxs6(Container4, __spreadProps(__spreadValues({ p: 2, display: "flex", flexGrow: 1, alignItems: "center", borderRadius: "4", overflow: "hidden", position: "relative", width: 29, fontSize: 1, lineHeight: 1, flexWrap: "wrap", destructive }, rest), { boxShadow: "highlight", children: [
1095
+ /* @__PURE__ */ jsxs6(Box, { minWidth: "100%", children: [
1096
+ /* @__PURE__ */ jsx25(Icon, { mr: 3, mt: "1px", lineHeight: 5, alignSelf: "center", children: Icons }),
1097
+ /* @__PURE__ */ jsx25(Title, { display: "inline", fontWeight: "600", fontSize: 1, lineHeight: 2, letterSpacing: "0.025em", children: title }),
1098
+ withClose && /* @__PURE__ */ jsx25(CloseBtn, { onClick: withClose })
1099
+ ] }),
1100
+ /* @__PURE__ */ jsx25(Content, { children })
1101
+ ] }));
1102
+ };
1103
+
1104
+ // src/feedback/Badge/Badge.tsx
1105
+ import styled31 from "styled-components";
1106
+ import { jsx as jsx26, jsxs as jsxs7 } from "react/jsx-runtime";
1107
+ var getPosition = (position4) => {
1108
+ switch (position4) {
1109
+ case "N":
1110
+ return `
1111
+ top: 0;
1112
+ right: 50%;
1113
+ transform: translateY(-50%) translateX(50%);
1114
+ `;
1115
+ case "NE":
1116
+ return `
1117
+ top: 0;
1118
+ right: 0;
1119
+ transform: translateY(-50%) translateX(50%);
1120
+ `;
1121
+ case "E":
1122
+ return `
1123
+ top: 50%;
1124
+ right: 0;
1125
+ transform: translateY(-50%) translateX(50%);
1126
+ `;
1127
+ case "NW":
1128
+ return `
1129
+ top: 0;
1130
+ left: 0;
1131
+ transform: translateY(-50%) translateX(-50%);
1132
+ `;
1133
+ case "SE":
1134
+ return `
1135
+ right: 0;
1136
+ bottom: 0;
1137
+ transform: translateY(50%) translateX(50%);
1138
+ `;
1139
+ case "S":
1140
+ return `
1141
+ left: 50%;
1142
+ top: 50%;
1143
+ transform: translateY(50%) translateX(-50%);
1144
+ `;
1145
+ case "SW":
1146
+ return `
1147
+ left: 0;
1148
+ bottom: 0;
1149
+ transform: translateY(50%) translateX(-50%);
1150
+ `;
1151
+ case "W":
1152
+ return `
1153
+ right: 0;
1154
+ top: 0;
1155
+ transform: translateY(50%) translateX(-50%);
1156
+ `;
1157
+ }
1158
+ };
1159
+ var BadgeItem = styled31.div`
1160
+ position: absolute;
1161
+ border-radius: ${({ theme: theme2 }) => theme2.radii[8]};
1162
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes[0]};
1163
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights[0]};
1164
+ text-align: center;
1165
+ color: ${({ theme: theme2, destructive }) => destructive ? theme2.colors.destructiveForeground : theme2.colors.primaryForeground};
1166
+ background: ${({ theme: theme2, destructive }) => destructive ? theme2.colors.destructive : theme2.colors.primary};
1167
+ min-width: fit-content;
1168
+ width: ${({ theme: theme2 }) => theme2.sizes[5]};
1169
+ padding: calc(${({ theme: theme2 }) => theme2.space[1]} / 2) ${({ theme: theme2 }) => theme2.space[2]};
1170
+ z-index:9999;
1171
+ :empty {
1172
+ width: ${({ theme: theme2 }) => theme2.sizes[1]};
1173
+ height: ${({ theme: theme2 }) => theme2.sizes[2]};
1174
+ }
1175
+ ${({ position: position4 }) => getPosition(position4)}
1176
+ `;
1177
+ var Badge = ({ position: position4 = "NE", children, tag, destructive = false }) => /* @__PURE__ */ jsxs7(Box, { display: "inline-block", position: "relative", width: "fill-available", children: [
1178
+ /* @__PURE__ */ jsx26(BadgeItem, { position: position4, destructive, children: tag }),
1179
+ children
1180
+ ] });
1181
+
1182
+ // src/feedback/Chip/Chip.tsx
1183
+ import styled32 from "styled-components";
1184
+ import { jsx as jsx27 } from "react/jsx-runtime";
1185
+ var Container5 = styled32.div`
1186
+ border-radius: ${({ theme: theme2 }) => theme2.radii[3]};
1187
+ display: inline-flex;
1188
+ justify-content: center;
1189
+ align-items: center;
1190
+ width: fit-content;
1191
+ padding: calc(${({ theme: theme2 }) => theme2.space[1]} / 2) ${({ theme: theme2 }) => theme2.space[2]};
1192
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes[0]};
1193
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights[0]};
1194
+ font-weight: 700;
1195
+ color: ${({ theme: theme2, destructive }) => destructive ? theme2.colors.destructiveForeground : theme2.colors.primaryForeground};
1196
+ background: ${({ theme: theme2, destructive }) => destructive ? theme2.colors.destructive : theme2.colors.primary};
1197
+
1198
+ > :not([hidden]) ~ :not([hidden]) {
1199
+ margin-left: 0.5rem;
1200
+ }
1201
+ `;
1202
+ var Chip = ({
1203
+ destructive,
1204
+ children
1205
+ }) => /* @__PURE__ */ jsx27(Container5, { destructive, children: /* @__PURE__ */ jsx27(Typography, { children }) });
1206
+
1207
+ // src/feedback/Code/SyntaxHighlighter.tsx
1208
+ import { default as SH } from "react-syntax-highlighter";
1209
+
1210
+ // src/feedback/Code/theme.ts
1211
+ var githubLight = {
1212
+ "hljs": {
1213
+ "display": "block",
1214
+ "overflowX": "auto",
1215
+ "padding": "0.5em",
1216
+ "color": "#24292e",
1217
+ "background": "#ffffff"
1218
+ },
1219
+ "hljs-comment": {
1220
+ "color": "#6a737d",
1221
+ "fontStyle": "italic"
1222
+ },
1223
+ "hljs-quote": {
1224
+ "color": "#6a737d",
1225
+ "fontStyle": "italic"
1226
+ },
1227
+ "hljs-keyword": {
1228
+ "color": "#d73a49",
1229
+ "fontWeight": "bold"
1230
+ },
1231
+ "hljs-selector-tag": {
1232
+ "color": "#d73a49",
1233
+ "fontWeight": "bold"
1234
+ },
1235
+ "hljs-subst": {
1236
+ "color": "#24292e",
1237
+ "fontWeight": "normal"
1238
+ },
1239
+ "hljs-number": {
1240
+ "color": "#005cc5"
1241
+ },
1242
+ "hljs-literal": {
1243
+ "color": "#005cc5"
1244
+ },
1245
+ "hljs-variable": {
1246
+ "color": "#e36209"
1247
+ },
1248
+ "hljs-template-variable": {
1249
+ "color": "#e36209"
1250
+ },
1251
+ "hljs-tag .hljs-attr": {
1252
+ "color": "#005cc5"
1253
+ },
1254
+ "hljs-string": {
1255
+ "color": "#032f62"
1256
+ },
1257
+ "hljs-doctag": {
1258
+ "color": "#22863a"
1259
+ },
1260
+ "hljs-title": {
1261
+ "color": "#22863a",
1262
+ "fontWeight": "bold"
1263
+ },
1264
+ "hljs-section": {
1265
+ "color": "#22863a",
1266
+ "fontWeight": "bold"
1267
+ },
1268
+ "hljs-selector-id": {
1269
+ "color": "#22863a",
1270
+ "fontWeight": "bold"
1271
+ },
1272
+ "hljs-type": {
1273
+ "color": "#e36209",
1274
+ "fontWeight": "bold"
1275
+ },
1276
+ "hljs-class .hljs-title": {
1277
+ "color": "#e36209",
1278
+ "fontWeight": "bold"
1279
+ },
1280
+ "hljs-tag": {
1281
+ "color": "#22863a",
1282
+ "fontWeight": "normal"
1283
+ },
1284
+ "hljs-name": {
1285
+ "color": "#22863a",
1286
+ "fontWeight": "normal"
1287
+ },
1288
+ "hljs-attribute": {
1289
+ "color": "#005cc5",
1290
+ "fontWeight": "normal"
1291
+ },
1292
+ "hljs-regexp": {
1293
+ "color": "#032f62"
1294
+ },
1295
+ "hljs-link": {
1296
+ "color": "#032f62"
1297
+ },
1298
+ "hljs-symbol": {
1299
+ "color": "#22863a"
1300
+ },
1301
+ "hljs-bullet": {
1302
+ "color": "#22863a"
1303
+ },
1304
+ "hljs-built_in": {
1305
+ "color": "#e36209"
1306
+ },
1307
+ "hljs-builtin-name": {
1308
+ "color": "#e36209"
1309
+ },
1310
+ "hljs-meta": {
1311
+ "color": "#b31d28",
1312
+ "fontWeight": "bold"
1313
+ },
1314
+ "hljs-deletion": {
1315
+ "background": "#ffeef0"
1316
+ },
1317
+ "hljs-addition": {
1318
+ "background": "#f0fff4"
1319
+ },
1320
+ "hljs-emphasis": {
1321
+ "fontStyle": "italic"
1322
+ },
1323
+ "hljs-strong": {
1324
+ "fontWeight": "bold"
1325
+ }
1326
+ };
1327
+ var githubDark = {
1328
+ "hljs": {
1329
+ "display": "block",
1330
+ "overflowX": "auto",
1331
+ "padding": "0.5em",
1332
+ "color": "#adbac7",
1333
+ "background": "#22272e"
1334
+ },
1335
+ "hljs-comment": {
1336
+ "color": "#768390",
1337
+ "fontStyle": "italic"
1338
+ },
1339
+ "hljs-quote": {
1340
+ "color": "#768390",
1341
+ "fontStyle": "italic"
1342
+ },
1343
+ "hljs-keyword": {
1344
+ "color": "#f47067",
1345
+ "fontWeight": "bold"
1346
+ },
1347
+ "hljs-selector-tag": {
1348
+ "color": "#f47067",
1349
+ "fontWeight": "bold"
1350
+ },
1351
+ "hljs-subst": {
1352
+ "color": "#adbac7",
1353
+ "fontWeight": "normal"
1354
+ },
1355
+ "hljs-number": {
1356
+ "color": "#6cb6ff"
1357
+ },
1358
+ "hljs-literal": {
1359
+ "color": "#6cb6ff"
1360
+ },
1361
+ "hljs-variable": {
1362
+ "color": "#f69d50"
1363
+ },
1364
+ "hljs-template-variable": {
1365
+ "color": "#f69d50"
1366
+ },
1367
+ "hljs-tag .hljs-attr": {
1368
+ "color": "#6cb6ff"
1369
+ },
1370
+ "hljs-string": {
1371
+ "color": "#96d0ff"
1372
+ },
1373
+ "hljs-doctag": {
1374
+ "color": "#8ddb8c"
1375
+ },
1376
+ "hljs-title": {
1377
+ "color": "#8ddb8c",
1378
+ "fontWeight": "bold"
1379
+ },
1380
+ "hljs-section": {
1381
+ "color": "#8ddb8c",
1382
+ "fontWeight": "bold"
1383
+ },
1384
+ "hljs-selector-id": {
1385
+ "color": "#8ddb8c",
1386
+ "fontWeight": "bold"
1387
+ },
1388
+ "hljs-type": {
1389
+ "color": "#f69d50",
1390
+ "fontWeight": "bold"
1391
+ },
1392
+ "hljs-class .hljs-title": {
1393
+ "color": "#f69d50",
1394
+ "fontWeight": "bold"
1395
+ },
1396
+ "hljs-tag": {
1397
+ "color": "#8ddb8c",
1398
+ "fontWeight": "normal"
1399
+ },
1400
+ "hljs-name": {
1401
+ "color": "#8ddb8c",
1402
+ "fontWeight": "normal"
1403
+ },
1404
+ "hljs-attribute": {
1405
+ "color": "#6cb6ff",
1406
+ "fontWeight": "normal"
1407
+ },
1408
+ "hljs-regexp": {
1409
+ "color": "#96d0ff"
1410
+ },
1411
+ "hljs-link": {
1412
+ "color": "#96d0ff"
1413
+ },
1414
+ "hljs-symbol": {
1415
+ "color": "#8ddb8c"
1416
+ },
1417
+ "hljs-bullet": {
1418
+ "color": "#8ddb8c"
1419
+ },
1420
+ "hljs-built_in": {
1421
+ "color": "#f69d50"
1422
+ },
1423
+ "hljs-builtin-name": {
1424
+ "color": "#f69d50"
1425
+ },
1426
+ "hljs-meta": {
1427
+ "color": "#768390",
1428
+ "fontWeight": "bold"
1429
+ },
1430
+ "hljs-deletion": {
1431
+ "background": "#ffd8d3"
1432
+ },
1433
+ "hljs-addition": {
1434
+ "background": "#b4f1b4"
1435
+ },
1436
+ "hljs-emphasis": {
1437
+ "fontStyle": "italic"
1438
+ },
1439
+ "hljs-strong": {
1440
+ "fontWeight": "bold"
1441
+ }
1442
+ };
1443
+
1444
+ // src/feedback/Code/Wrapper.tsx
1445
+ import styled33 from "styled-components";
1446
+ import { Fragment as Fragment5, jsx as jsx28 } from "react/jsx-runtime";
1447
+ var StyledDiv = styled33.div`
1448
+ overflow: hidden;
1449
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes[1]};
1450
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights[1]};
1451
+ font-family: ${({ theme: theme2 }) => theme2.fonts.mono};
1452
+ border: ${({ theme: theme2 }) => theme2.borders.border[1]};
1453
+ box-shadow: ${({ theme: theme2 }) => theme2.shadows.base[1]};
1454
+ border-radius: ${({ theme: theme2 }) => theme2.radii[3]};
1455
+ background: ${({ theme: theme2 }) => theme2.colors.offsetBackground};
1456
+ `;
1457
+ var Wrapper = ({
1458
+ children,
1459
+ skip
1460
+ }) => skip ? /* @__PURE__ */ jsx28(Fragment5, { children }) : /* @__PURE__ */ jsx28(StyledDiv, { children });
1461
+
1462
+ // src/utils/index.ts
1463
+ var utils_exports = {};
1464
+ __export(utils_exports, {
1465
+ Backdrop: () => Backdrop,
1466
+ ClickOutside: () => ClickOutside,
1467
+ Collapse: () => Collapse,
1468
+ DarkTheme: () => DarkTheme,
1469
+ Fade: () => Fade,
1470
+ GlobalStyles: () => GlobalStyles,
1471
+ Grow: () => Grow,
1472
+ LightTheme: () => LightTheme,
1473
+ LinearSlide: () => LinearSlide,
1474
+ MuffledUI: () => MuffledUI,
1475
+ Open: () => Open,
1476
+ Portal: () => Portal,
1477
+ RadioIcon: () => RadioIcon,
1478
+ Scrollable: () => Scrollable,
1479
+ SettingsContext: () => SettingsContext,
1480
+ Slide: () => Slide,
1481
+ ThemeButton: () => ThemeButton,
1482
+ ThemeSwitch: () => ThemeSwitch,
1483
+ stopPropagation: () => stopPropagation,
1484
+ useMuffledSettings: () => useMuffledSettings
1485
+ });
1486
+
1487
+ // src/utils/Backdrop/Backdrop.tsx
1488
+ import { useCallback, useEffect as useEffect2, useState as useState3 } from "react";
1489
+ import FocusLock from "react-focus-lock";
1490
+
1491
+ // src/utils/Portal/Portal.tsx
1492
+ import { createPortal } from "react-dom";
1493
+ var Portal = ({ children, element }) => createPortal(children, element || (document.getElementById("portal-root") || document.body));
1494
+
1495
+ // src/utils/Backdrop/Backdrop.tsx
1496
+ import { jsx as jsx29 } from "react/jsx-runtime";
1497
+ var stopPropagation = (e) => e.stopPropagation();
1498
+ var Backdrop = (_a) => {
1499
+ var _b = _a, {
1500
+ children,
1501
+ onClick
1502
+ } = _b, rest = __objRest(_b, [
1503
+ "children",
1504
+ "onClick"
1505
+ ]);
1506
+ let [open, setOpen] = useState3(true);
1507
+ let handleClickBackdrop = useCallback(
1508
+ (e) => {
1509
+ e.stopPropagation();
1510
+ setOpen(false);
1511
+ },
1512
+ [setOpen]
1513
+ );
1514
+ let closeModalOnESC = useCallback(
1515
+ (e) => {
1516
+ if (e.key === "Escape") {
1517
+ e.stopPropagation();
1518
+ setOpen(false);
1519
+ }
1520
+ },
1521
+ [setOpen]
1522
+ );
1523
+ useEffect2(() => {
1524
+ window.addEventListener("keyup", closeModalOnESC);
1525
+ document.body.style.overflow = "hidden";
1526
+ return () => {
1527
+ window.removeEventListener("keyup", closeModalOnESC);
1528
+ document.body.style.overflow = "unset";
1529
+ };
1530
+ }, [closeModalOnESC]);
1531
+ return /* @__PURE__ */ jsx29(Portal, { children: /* @__PURE__ */ jsx29(FocusLock, { children: /* @__PURE__ */ jsx29(Fade, __spreadProps(__spreadValues({ inProp: open, onProps: onClick }, rest), { children: /* @__PURE__ */ jsx29(
1532
+ Box,
1533
+ {
1534
+ width: "100vw",
1535
+ height: "100%",
1536
+ position: "fixed",
1537
+ top: 0,
1538
+ left: 0,
1539
+ right: 0,
1540
+ bottom: 0,
1541
+ overflow: "auto",
1542
+ bg: "rgba(0, 0, 0, .8)",
1543
+ display: "flex",
1544
+ justifyContent: "center",
1545
+ alignItems: "center",
1546
+ zIndex: "9999",
1547
+ onClick: handleClickBackdrop,
1548
+ children
1549
+ }
1550
+ ) })) }) });
1551
+ };
1552
+
1553
+ // src/utils/ClickOutside/ClickOutside.tsx
1554
+ import { useEffect as useEffect3, useState as useState4, cloneElement } from "react";
1555
+ import { jsx as jsx30 } from "react/jsx-runtime";
1556
+ var ClickOutside = ({ children, handleClose, target, wrapper, inline = false }) => {
1557
+ let [isOpen, setOpen] = useState4(true);
1558
+ useEffect3(() => {
1559
+ function handleClick(e) {
1560
+ e.preventDefault();
1561
+ if (!(target == null ? void 0 : target.contains(e.target))) {
1562
+ setOpen(false);
1563
+ }
1564
+ }
1565
+ if (isOpen) {
1566
+ document.addEventListener("mousedown", handleClick);
1567
+ } else {
1568
+ document.removeEventListener("mousedown", handleClick);
1569
+ }
1570
+ return () => document.removeEventListener("mousedown", handleClick);
1571
+ }, [isOpen, handleClose, target]);
1572
+ let WrappedTransition = /* @__PURE__ */ jsx30(Grow, { inProp: isOpen, onDestroyed: handleClose, children });
1573
+ let content = wrapper ? cloneElement(wrapper, { children: WrappedTransition }) : WrappedTransition;
1574
+ return inline ? content : /* @__PURE__ */ jsx30(Portal, { children: content });
1575
+ };
1576
+
1577
+ // src/utils/FocusLock/index.ts
1578
+ var FocusLock_exports = {};
1579
+ __reExport(FocusLock_exports, react_focus_lock_star);
1580
+ import * as react_focus_lock_star from "react-focus-lock";
1581
+
1582
+ // src/utils/index.ts
1583
+ __reExport(utils_exports, FocusLock_exports);
1584
+
1585
+ // src/utils/Scrollable/Scrollable.tsx
1586
+ import { useEffect as useEffect4, useRef as useRef3, useState as useState5 } from "react";
1587
+ import styled34 from "styled-components";
1588
+ import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon3 } from "@heroicons/react/24/outline";
1589
+ import { Fragment as Fragment6, jsx as jsx31, jsxs as jsxs8 } from "react/jsx-runtime";
1590
+ var ScrollBox = styled34(Box)`
1591
+ white-space: nowrap;
1592
+ scroll-snap-type: x;
1593
+ `;
1594
+ var Scrollable = ({ children }) => {
1595
+ let [{ left, right }, setArrows] = useState5({ left: false, right: false });
1596
+ let [scrollable, setScrollable] = useState5(void 0);
1597
+ let ref = useRef3(null);
1598
+ let handleScroll = () => {
1599
+ var _a, _b, _c, _d;
1600
+ let rightShadow = ((_a = ref.current) == null ? void 0 : _a.scrollWidth) !== (((_b = ref.current) == null ? void 0 : _b.scrollLeft) || 0) + (((_c = ref.current) == null ? void 0 : _c.clientWidth) || 0);
1601
+ let leftShadow = (((_d = ref.current) == null ? void 0 : _d.scrollLeft) || 0) > 0;
1602
+ setArrows({
1603
+ left: leftShadow,
1604
+ right: rightShadow
1605
+ });
1606
+ };
1607
+ let checkIfScrollable = () => {
1608
+ var _a, _b;
1609
+ setScrollable((((_a = ref.current) == null ? void 0 : _a.scrollWidth) || 0) <= (((_b = ref.current) == null ? void 0 : _b.clientWidth) || 0));
1610
+ };
1611
+ useEffect4(() => {
1612
+ checkIfScrollable();
1613
+ handleScroll();
1614
+ }, []);
1615
+ if (!scrollable === false) {
1616
+ return /* @__PURE__ */ jsx31(Fragment6, { children });
1617
+ }
1618
+ return /* @__PURE__ */ jsxs8(Box, { position: "relative", px: "5", children: [
1619
+ left && /* @__PURE__ */ jsx31(Box, { height: "100%", width: "5", position: "absolute", left: "0", top: "0", zIndex: "50", display: "flex", alignItems: "center", color: "baseHighlight", children: /* @__PURE__ */ jsx31(ChevronLeftIcon2, { width: 16, height: 16 }) }),
1620
+ /* @__PURE__ */ jsx31(
1621
+ ScrollBox,
1622
+ {
1623
+ maxHeight: "100%",
1624
+ ref,
1625
+ overflowX: "auto",
1626
+ onScroll: handleScroll,
1627
+ children
1628
+ }
1629
+ ),
1630
+ right && /* @__PURE__ */ jsx31(Box, { height: "100%", width: "5", position: "absolute", right: "0", top: "0", zIndex: "50", display: "flex", alignItems: "center", justifyContent: "end", color: "baseHighlight", children: /* @__PURE__ */ jsx31(ChevronRightIcon3, { width: 16, height: 16 }) })
1631
+ ] });
1632
+ };
1633
+
1634
+ // src/utils/Icons/index.tsx
1635
+ import { jsx as jsx32 } from "react/jsx-runtime";
1636
+ var RadioIcon = (_a) => {
1637
+ var rest = __objRest(_a, []);
1638
+ return /* @__PURE__ */ jsx32("svg", __spreadProps(__spreadValues({ viewBox: "0 0 16 16", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg" }, rest), { children: /* @__PURE__ */ jsx32("circle", { cx: "8", cy: "8", r: "3" }) }));
1639
+ };
1640
+
1641
+ // src/utils/Theme/Borders.ts
1642
+ var generateBorders = (colors) => {
1643
+ let borderWidths = [0, 1, 3, 4];
1644
+ let borderColors = Object.keys(colors);
1645
+ return borderColors.reduce((borderObj, key) => {
1646
+ const colorKey = key;
1647
+ borderObj[colorKey] = borderWidths.map(
1648
+ (width) => `${width}px solid ${colors[colorKey]}`
1649
+ );
1650
+ return borderObj;
1651
+ }, {});
1652
+ };
1653
+ var radii = [
1654
+ 0,
1655
+ // 0 - none
1656
+ "0.125rem",
1657
+ // 1 - sm
1658
+ "0.25rem",
1659
+ // 2 -
1660
+ "0.375rem",
1661
+ // 3 - md
1662
+ "0.5rem",
1663
+ // 4 - lg
1664
+ "0.75rem",
1665
+ // 5 - xl
1666
+ "1rem",
1667
+ // 6 - 2xl
1668
+ "1.5rem",
1669
+ // 7 - 3xl
1670
+ "9999px"
1671
+ // 8 - full
1672
+ ];
1673
+
1674
+ // src/utils/Theme/Breakpoints.ts
1675
+ var breakpoints = ["640px", "768px", "1024px", "1280px"];
1676
+ breakpoints.sm = breakpoints[0];
1677
+ breakpoints.md = breakpoints[1];
1678
+ breakpoints.lg = breakpoints[2];
1679
+ breakpoints.xl = breakpoints[3];
1680
+
1681
+ // src/utils/Theme/Colors.ts
1682
+ var LightThemeColors = {
1683
+ background: "hsl(0, 0%, 100%)",
1684
+ foreground: "hsl(240, 10%, 3.9%)",
1685
+ card: "hsl(0, 0%, 100%)",
1686
+ cardForeground: "hsl(240, 10%, 3.9%)",
1687
+ popover: "hsl(0, 0%, 100%)",
1688
+ popoverForeground: "hsl(240, 10%, 3.9%)",
1689
+ primary: "hsl(240, 5.9%, 10%)",
1690
+ primaryForeground: "hsl(0, 0%, 98%)",
1691
+ secondary: "hsl(240, 4.8%, 95.9%)",
1692
+ secondaryForeground: "hsl(240, 5.9%, 10%)",
1693
+ muted: "hsl(240, 4.8%, 95.9%)",
1694
+ mutedForeground: "hsl(240, 3.8%, 46.1%)",
1695
+ accent: "hsl(240, 4.8%, 95.9%)",
1696
+ accentForeground: "hsl(240, 5.9%, 10%)",
1697
+ destructive: "hsl(0, 84.2%, 60.2%)",
1698
+ destructiveForeground: "hsl(0, 0%, 98%)",
1699
+ border: "hsl(240, 5.9%, 90%)",
1700
+ input: "hsl(240, 5.9%, 90%)",
1701
+ ring: "hsl(240, 5.9%, 10%)",
1702
+ offsetBackground: "hsl(0, 0%, 98%)",
1703
+ offsetForeground: "hsl(240, 5.3%, 26.1%)"
1704
+ };
1705
+ var DarkThemeColors = {
1706
+ background: "hsl(240, 10%, 3.9%)",
1707
+ foreground: "hsl(0, 0%, 98%)",
1708
+ card: "hsl(240, 10%, 3.9%)",
1709
+ cardForeground: "hsl(0, 0%, 98%)",
1710
+ popover: "hsl(240, 10%, 3.9%)",
1711
+ popoverForeground: "hsl(0, 0%, 98%)",
1712
+ primary: "hsl(0, 0%, 98%)",
1713
+ primaryForeground: "hsl(240, 5.9%, 10%)",
1714
+ secondary: "hsl(240, 3.7%, 15.9%)",
1715
+ secondaryForeground: "hsl(0, 0%, 98%)",
1716
+ muted: "hsl(240, 3.7%, 15.9%)",
1717
+ mutedForeground: "hsl(240, 5%, 64.9%)",
1718
+ accent: "hsl(240, 3.7%, 15.9%)",
1719
+ accentForeground: "hsl(0, 0%, 98%)",
1720
+ destructive: "hsl(0, 65.1%, 50.6%)",
1721
+ destructiveForeground: "hsl(0, 0%, 98%)",
1722
+ border: "hsl(240, 3.7%, 15.9%)",
1723
+ input: "hsl(240, 3.7%, 15.9%)",
1724
+ ring: "hsl(240, 4.9%, 83.9%)",
1725
+ offsetBackground: "hsl(240, 5.9%, 10%)",
1726
+ offsetForeground: "hsl(240, 4.8%, 95.9%)"
1727
+ };
1728
+
1729
+ // src/utils/Theme/Shadows.ts
1730
+ var ThemeBoxShadow = {
1731
+ error: "0 1px 2px 0 #fecaca",
1732
+ inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
1733
+ focus: "unset",
1734
+ highlight: "rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.1) 0px 4px 6px -4px",
1735
+ base: [
1736
+ "0 1px 2px 0 rgb(0 0 0 / 0.05)",
1737
+ "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
1738
+ "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
1739
+ "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
1740
+ "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"
1741
+ ]
1742
+ };
1743
+
1744
+ // src/utils/Theme/Animations.ts
1745
+ var animations = {
1746
+ spin: `
1747
+ animation: spin 1s linear infinite;
1748
+
1749
+ @keyframes spin {
1750
+ from {
1751
+ transform: rotate(0deg);
1752
+ }
1753
+ to {
1754
+ transform: rotate(360deg);
1755
+ }
1756
+ }
1757
+ `,
1758
+ pulse: `
1759
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
1760
+
1761
+ @keyframes pulse {
1762
+ 0%, 100% {
1763
+ opacity: 1;
1764
+ }
1765
+ 50% {
1766
+ opacity: .5;
1767
+ }
1768
+ }
1769
+ `,
1770
+ bounce: `
1771
+ animation: bounce 1s infinite;
1772
+
1773
+ @keyframes bounce {
1774
+ 0%, 100% {
1775
+ transform: translateY(-25%);
1776
+ animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
1777
+ }
1778
+ 50% {
1779
+ transform: translateY(0);
1780
+ animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
1781
+ }
1782
+ }
1783
+ `
1784
+ };
1785
+
1786
+ // src/utils/Theme/spaces.ts
1787
+ var spaces = [
1788
+ 0,
1789
+ "0.25rem",
1790
+ "0.5rem",
1791
+ "0.75rem",
1792
+ "1rem",
1793
+ "1.25rem",
1794
+ "1.5rem",
1795
+ "1.75rem",
1796
+ "2rem",
1797
+ "2.25rem",
1798
+ "2.5rem"
1799
+ ];
1800
+ var spaceYBetween = spaces.map((s) => `> :not(:first-child) {
1801
+ margin-top: ${s};
1802
+ }`);
1803
+ var spaceXBetween = spaces.map((s) => `> :not(:last-child) {
1804
+ margin-right: calc(${s}/2);
1805
+ }`);
1806
+
1807
+ // src/utils/Theme/Theme.ts
1808
+ var theme = {
1809
+ radii,
1810
+ shadows: ThemeBoxShadow,
1811
+ breakpoints,
1812
+ animations,
1813
+ lineHeights: [
1814
+ "1rem",
1815
+ "1.25rem",
1816
+ "1.5rem",
1817
+ "1.75rem",
1818
+ "2rem"
1819
+ ],
1820
+ fontSizes: [
1821
+ "0.75rem",
1822
+ "0.875rem",
1823
+ "1rem",
1824
+ "1.125rem",
1825
+ "1.25rem",
1826
+ "1.875rem"
1827
+ ],
1828
+ fonts: {
1829
+ base: "'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",
1830
+ mono: "ui-monospace, SFMono- Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"
1831
+ },
1832
+ space: spaces,
1833
+ sizes: [
1834
+ 0,
1835
+ "0.25rem",
1836
+ "0.5rem",
1837
+ "0.75rem",
1838
+ "1rem",
1839
+ "1.25rem",
1840
+ "1.5rem",
1841
+ "1.75rem",
1842
+ "2rem",
1843
+ "2.25rem",
1844
+ "2.5rem",
1845
+ "2.75rem",
1846
+ "3rem",
1847
+ "3.5rem",
1848
+ "4rem",
1849
+ "5rem",
1850
+ "6rem",
1851
+ "7rem",
1852
+ "8rem",
1853
+ "9rem",
1854
+ "10rem",
1855
+ "11rem",
1856
+ "12rem",
1857
+ "13rem",
1858
+ "14rem",
1859
+ "15rem",
1860
+ "16rem",
1861
+ "18rem",
1862
+ "20rem",
1863
+ "24rem"
1864
+ ],
1865
+ transition: "transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms;",
1866
+ spaceYBetween,
1867
+ spaceXBetween
1868
+ };
1869
+ var LightTheme = __spreadValues({
1870
+ name: "Light",
1871
+ colors: LightThemeColors,
1872
+ borders: generateBorders(LightThemeColors)
1873
+ }, theme);
1874
+ var DarkTheme = __spreadValues({
1875
+ name: "Dark",
1876
+ colors: DarkThemeColors,
1877
+ borders: generateBorders(DarkThemeColors)
1878
+ }, theme);
1879
+
1880
+ // src/utils/Theme/ThemeProvider.tsx
1881
+ import { ThemeProvider } from "styled-components";
1882
+
1883
+ // src/utils/Theme/GlobalStyles.ts
1884
+ import { createGlobalStyle } from "styled-components";
1885
+ var GlobalStyles = createGlobalStyle`
1886
+ *,
1887
+ ::before,
1888
+ ::after {
1889
+ box-sizing: border-box;
1890
+ border-width: 0;
1891
+ border-style: solid;
1892
+ border-color: ${({ theme: theme2 }) => theme2.colors.background}
1893
+ }
1894
+
1895
+ body {
1896
+ -webkit-font-smoothing: antialiased;
1897
+ -moz-osx-font-smoothing: grayscale;
1898
+ font-size: 14px;
1899
+ font-optical-sizing: auto;
1900
+ font-style: normal;
1901
+ font-variation-settings: "wdth" 100, "YTLC" 500;
1902
+ tab-size: 4;
1903
+ background: ${({ theme: theme2 }) => theme2.colors.background};
1904
+ font-family: ${({ theme: theme2 }) => theme2.fonts.base};
1905
+ color: ${({ theme: theme2 }) => theme2.colors.foreground};
1906
+ margin: 0;
1907
+ }
1908
+
1909
+ hr {
1910
+ height: 0;
1911
+ color: inherit;
1912
+ border-top-width: 1px;
1913
+ }
1914
+ abbr:where([title]) {
1915
+ text-decoration: underline dotted;
1916
+ }
1917
+
1918
+ h1,
1919
+ h2,
1920
+ h3,
1921
+ h4,
1922
+ h5,
1923
+ h6 {
1924
+ font-size: inherit;
1925
+ font-weight: inherit;
1926
+ }
1927
+
1928
+ a {
1929
+ color: inherit;
1930
+ text-decoration: inherit;
1931
+ }
1932
+
1933
+ b,
1934
+ strong {
1935
+ font-weight: bolder;
1936
+ }
1937
+
1938
+ code,
1939
+ kbd,
1940
+ samp,
1941
+ pre {
1942
+ font-family: ${({ theme: theme2 }) => theme2.fonts.mono};
1943
+ font-size: 1em;
1944
+ }
1945
+
1946
+ small {
1947
+ font-size: 80%;
1948
+ }
1949
+
1950
+ sub,
1951
+ sup {
1952
+ font-size: 75%;
1953
+ line-height: 0;
1954
+ position: relative;
1955
+ vertical-align: baseline;
1956
+ }
1957
+
1958
+ sub {
1959
+ bottom: -0.25em;
1960
+ }
1961
+
1962
+ sup {
1963
+ top: -0.5em;
1964
+ }
1965
+
1966
+ table {
1967
+ text-indent: 0;
1968
+ border-color: inherit;
1969
+ border-collapse: collapse;
1970
+ }
1971
+
1972
+ button,
1973
+ input,
1974
+ optgroup,
1975
+ select,
1976
+ textarea {
1977
+ font-family: inherit;
1978
+ font-size: 100%;
1979
+ font-weight: inherit;
1980
+ line-height: inherit;
1981
+ color: inherit;
1982
+ margin: 0;
1983
+ padding: 0;
1984
+ }
1985
+
1986
+ button,
1987
+ select {
1988
+ text-transform: none;
1989
+ }
1990
+
1991
+ button,
1992
+ [type='button'],
1993
+ [type='reset'],
1994
+ [type='submit'] {
1995
+ -webkit-appearance: button;
1996
+ }
1997
+
1998
+ :-moz-focusring {
1999
+ outline: auto;
2000
+ }
2001
+
2002
+ :-moz-ui-invalid {
2003
+ box-shadow: none;
2004
+ }
2005
+
2006
+ progress {
2007
+ vertical-align: baseline;
2008
+ }
2009
+
2010
+ ::-webkit-inner-spin-button,
2011
+ ::-webkit-outer-spin-button {
2012
+ height: auto;
2013
+ }
2014
+
2015
+ [type='search'] {
2016
+ -webkit-appearance: textfield;
2017
+ outline-offset: -2px;
2018
+ }
2019
+
2020
+ ::-webkit-search-decoration {
2021
+ -webkit-appearance: none;
2022
+ }
2023
+
2024
+ ::-webkit-file-upload-button {
2025
+ -webkit-appearance: button;
2026
+ font: inherit;
2027
+ }
2028
+
2029
+ summary {
2030
+ display: list-item;
2031
+ }
2032
+
2033
+ blockquote,
2034
+ dl,
2035
+ dd,
2036
+ h1,
2037
+ h2,
2038
+ h3,
2039
+ h4,
2040
+ h5,
2041
+ h6,
2042
+ hr,
2043
+ figure,
2044
+ p,
2045
+ pre {
2046
+ margin: 0;
2047
+ }
2048
+
2049
+ fieldset {
2050
+ margin: 0;
2051
+ padding: 0;
2052
+ }
2053
+
2054
+ legend {
2055
+ padding: 0;
2056
+ }
2057
+
2058
+ ol,
2059
+ ul,
2060
+ menu {
2061
+ list-style: none;
2062
+ margin: 0;
2063
+ padding: 0;
2064
+ }
2065
+
2066
+ textarea {
2067
+ resize: vertical;
2068
+ }
2069
+ input::placeholder,
2070
+ textarea::placeholder {
2071
+ opacity: 1;
2072
+ color: ${({ theme: theme2 }) => theme2.colors.mutedForeground};
2073
+ }
2074
+
2075
+ button,
2076
+ [role="button"] {
2077
+ cursor: pointer;
2078
+ }
2079
+
2080
+ img,
2081
+ svg,
2082
+ video,
2083
+ canvas,
2084
+ audio,
2085
+ iframe,
2086
+ embed,
2087
+ object {
2088
+ display: block;
2089
+ vertical-align: middle;
2090
+ }
2091
+
2092
+ img,
2093
+ video {
2094
+ max-width: 100%;
2095
+ height: auto;
2096
+ }
2097
+
2098
+ [hidden] {
2099
+ display: none;
2100
+ }
2101
+ `;
2102
+
2103
+ // src/utils/Theme/ThemeProvider.tsx
2104
+ import { createContext, useContext, useEffect as useEffect5, useState as useState6 } from "react";
2105
+
2106
+ // src/shared/preferColorScheme.ts
2107
+ var InheritedTheme = window.matchMedia("(prefers-color-scheme: light)").matches ? "Light" : "Dark";
2108
+
2109
+ // src/utils/Theme/ThemeProvider.tsx
2110
+ import { jsx as jsx33, jsxs as jsxs9 } from "react/jsx-runtime";
2111
+ var LocalStorageKey = "@muffled-ui/settings";
2112
+ var SettingsContext = createContext(void 0);
2113
+ var useMuffledSettings = () => {
2114
+ let context = useContext(SettingsContext);
2115
+ if (context === void 0) {
2116
+ throw new Error("useMuffledSettings must be used within a MuffledUI provider");
2117
+ }
2118
+ return context;
2119
+ };
2120
+ var MuffledUI = ({ children }) => {
2121
+ let [themeKey, setThemeKey] = useState6(() => {
2122
+ var _a;
2123
+ if (localStorage.getItem(LocalStorageKey) !== null) {
2124
+ return (_a = JSON.parse(localStorage.getItem(LocalStorageKey) || "")) == null ? void 0 : _a.theme;
2125
+ }
2126
+ return InheritedTheme;
2127
+ });
2128
+ let theme2 = themeKey === "Light" ? LightTheme : DarkTheme;
2129
+ useEffect5(() => {
2130
+ localStorage.setItem(LocalStorageKey, JSON.stringify({ theme: themeKey }));
2131
+ }, [themeKey]);
2132
+ return /* @__PURE__ */ jsx33(SettingsContext.Provider, { value: {
2133
+ theme: themeKey,
2134
+ setTheme: setThemeKey,
2135
+ toggleTheme: () => setThemeKey(themeKey == "Dark" ? "Light" : "Dark")
2136
+ }, children: /* @__PURE__ */ jsxs9(ThemeProvider, { theme: theme2, children: [
2137
+ /* @__PURE__ */ jsx33(GlobalStyles, { theme: theme2 }),
2138
+ children
2139
+ ] }) });
2140
+ };
2141
+
2142
+ // src/utils/Theme/ThemeToggle.tsx
2143
+ import { MoonIcon, SunIcon } from "@heroicons/react/16/solid";
2144
+
2145
+ // src/inputs/Controls/Checkbox/Checkbox.tsx
2146
+ import { CheckIcon } from "@heroicons/react/24/outline";
2147
+
2148
+ // src/inputs/Controls/BaseControl.tsx
2149
+ import styled35 from "styled-components";
2150
+ import { jsx as jsx34, jsxs as jsxs10 } from "react/jsx-runtime";
2151
+ var Label = styled35.label`
2152
+ display: flex;
2153
+ align-items: center;
2154
+ cursor: ${({ disabled }) => disabled ? "not-allowed" : "pointer"};
2155
+ color: ${({ theme: theme2, disabled }) => disabled ? theme2.colors.mutedForeground : theme2.colors.foreground};
2156
+ > :not([hidden]) ~ :not([hidden]) {
2157
+ margin-left: 0.5rem;
2158
+ }
2159
+ div > svg {
2160
+ ${({ theme: theme2, checked }) => checked && `
2161
+ color: ${theme2.colors.background};
2162
+ `}
2163
+ }
2164
+
2165
+ :hover div {
2166
+ ${({ theme: theme2, checked }) => `
2167
+ background: ${checked ? theme2.colors.foreground : theme2.colors.background};
2168
+ `}
2169
+ }
2170
+
2171
+ :hover div > svg {
2172
+ ${({ theme: theme2, checked }) => `
2173
+ color: ${checked ? theme2.colors.background : theme2.colors.foreground};
2174
+ `}
2175
+ }
2176
+ `;
2177
+ var Btn = styled35.div`
2178
+ position: relative;
2179
+ width: ${({ theme: theme2 }) => theme2.sizes[4]};
2180
+ height: ${({ theme: theme2 }) => theme2.sizes[4]};
2181
+ border: ${({ theme: theme2 }) => theme2.borders.background[1]};
2182
+ background: ${({ theme: theme2 }) => theme2.colors.background};
2183
+ overflow: hidden;
2184
+ border: ${({ theme: theme2 }) => theme2.borders.primary[1]};
2185
+ box-shadow: ${({ theme: theme2 }) => theme2.shadows.base[1]};
2186
+ display: flex;
2187
+ align-items: center;
2188
+ justify-content: center;
2189
+ margin-right: ${({ theme: theme2 }) => theme2.space[2]};
2190
+ border-radius: ${({ theme: theme2, rounded }) => rounded ? theme2.radii[8] : theme2.radii[2]};
2191
+ opacity: ${({ disabled }) => disabled ? 0.5 : 1};
2192
+ `;
2193
+ var Box2 = styled35.div`
2194
+ background: ${({ theme: theme2 }) => theme2.colors.background};
2195
+ width: 100%;
2196
+ height: 100%;
2197
+ position: absolute;
2198
+ ${({ checked, theme: theme2 }) => checked && `
2199
+ background: ${theme2.colors.primary};
2200
+ `}
2201
+
2202
+ `;
2203
+ var Icon2 = styled35.div`
2204
+ svg {
2205
+ color: transparent;
2206
+ z-index: 10;
2207
+ position: relative;
2208
+ }
2209
+ `;
2210
+ var Input = styled35.input`
2211
+ display: none;
2212
+ `;
2213
+ var BaseControl = (_a) => {
2214
+ var _b = _a, {
2215
+ labelText,
2216
+ icon,
2217
+ rounded = false,
2218
+ disabled = false
2219
+ } = _b, rest = __objRest(_b, [
2220
+ "labelText",
2221
+ "icon",
2222
+ "rounded",
2223
+ "disabled"
2224
+ ]);
2225
+ return /* @__PURE__ */ jsxs10(Label, { disabled, checked: rest.checked, children: [
2226
+ /* @__PURE__ */ jsxs10(Btn, { rounded, disabled, children: [
2227
+ /* @__PURE__ */ jsx34(Input, __spreadValues({ disabled }, rest)),
2228
+ /* @__PURE__ */ jsx34(Box2, __spreadValues({}, rest)),
2229
+ /* @__PURE__ */ jsx34(Icon2, __spreadProps(__spreadValues({ disabled }, rest), { children: icon }))
2230
+ ] }),
2231
+ labelText
2232
+ ] });
2233
+ };
2234
+
2235
+ // src/inputs/Controls/Checkbox/Checkbox.tsx
2236
+ import { jsx as jsx35 } from "react/jsx-runtime";
2237
+ var Checkbox = (_a) => {
2238
+ var rest = __objRest(_a, []);
2239
+ return /* @__PURE__ */ jsx35(BaseControl, __spreadValues({ icon: /* @__PURE__ */ jsx35(CheckIcon, { width: "12", height: "12" }), type: "checkbox" }, rest));
2240
+ };
2241
+
2242
+ // src/inputs/Controls/Radio/Radio.tsx
2243
+ import { jsx as jsx36 } from "react/jsx-runtime";
2244
+ var Radio = (_a) => {
2245
+ var rest = __objRest(_a, []);
2246
+ var _a2;
2247
+ return /* @__PURE__ */ jsx36(
2248
+ BaseControl,
2249
+ __spreadValues({
2250
+ icon: /* @__PURE__ */ jsx36(RadioIcon, { width: "16", height: "16" }),
2251
+ type: "radio",
2252
+ labelText: rest.labelText || ((_a2 = rest.value) == null ? void 0 : _a2.toString()),
2253
+ value: rest.value || rest.labelText,
2254
+ rounded: true
2255
+ }, rest)
2256
+ );
2257
+ };
2258
+
2259
+ // src/inputs/Datepicker/Base/BasePicker.tsx
2260
+ import { useState as useState10 } from "react";
2261
+ import Picker from "react-datepicker";
2262
+
2263
+ // src/inputs/Datepicker/Base/PopperContainer.tsx
2264
+ import { jsx as jsx37 } from "react/jsx-runtime";
2265
+ var PopperContainer = ({ children }) => /* @__PURE__ */ jsx37(Portal, { children });
2266
+
2267
+ // src/inputs/Datepicker/Base/DateHeader.tsx
2268
+ import { useState as useState8 } from "react";
2269
+ import styled36 from "styled-components";
2270
+ import { format, getYear } from "date-fns";
2271
+
2272
+ // src/navigation/Menu/Menu.tsx
2273
+ import { useState as useState7 } from "react";
2274
+ import { usePopper } from "react-popper";
2275
+ import { jsx as jsx38 } from "react/jsx-runtime";
2276
+ var Menu = (_a) => {
2277
+ var _b = _a, { children, isOpen, direction = "bottom-start", itemRef, handleClose, inline = false } = _b, rest = __objRest(_b, ["children", "isOpen", "direction", "itemRef", "handleClose", "inline"]);
2278
+ let [popperRef, setPopperRef] = useState7(null);
2279
+ let { styles, attributes } = usePopper(itemRef, popperRef, {
2280
+ placement: direction,
2281
+ modifiers: [
2282
+ {
2283
+ name: "offset",
2284
+ options: {
2285
+ offset: [0, 10]
2286
+ }
2287
+ }
2288
+ ]
2289
+ });
2290
+ let Popper = /* @__PURE__ */ jsx38("div", __spreadValues({ ref: setPopperRef, style: styles.popper }, attributes.popper));
2291
+ return isOpen ? /* @__PURE__ */ jsx38(ClickOutside, { handleClose, target: popperRef, wrapper: Popper, inline, children: /* @__PURE__ */ jsx38(Box, __spreadProps(__spreadValues({ bg: "background", borderRadius: "3", boxShadow: "base.0", border: "border.1", display: "flex", flexDirection: "column", py: "1", overflowY: "scroll" }, rest), { children })) }) : null;
2292
+ };
2293
+
2294
+ // src/navigation/Menu/MenuItem.tsx
2295
+ import { jsx as jsx39 } from "react/jsx-runtime";
2296
+ var MenuItem = ({ children, onClick }) => /* @__PURE__ */ jsx39(
2297
+ Button,
2298
+ {
2299
+ mx: "1",
2300
+ my: "0",
2301
+ borderRadius: "3",
2302
+ fontWeight: "400",
2303
+ onClick,
2304
+ children
2305
+ }
2306
+ );
2307
+
2308
+ // src/inputs/Datepicker/Base/DateNavigation.tsx
2309
+ import { ChevronLeftIcon as ChevronLeftIcon3, ChevronRightIcon as ChevronRightIcon4 } from "@heroicons/react/24/outline";
2310
+ import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs11 } from "react/jsx-runtime";
2311
+ var LeftNavigation = ({ decreaseYear, decreaseMonth }) => /* @__PURE__ */ jsxs11(Fragment7, { children: [
2312
+ decreaseYear && /* @__PURE__ */ jsx40(OutlineButton, { px: "5px", py: "5px", height: "inherit", onClick: decreaseYear, children: /* @__PURE__ */ jsx40(ChevronLeftIcon3, { width: 16, height: 16 }) }),
2313
+ decreaseMonth && /* @__PURE__ */ jsx40(OutlineButton, { px: "5px", py: "5px", height: "inherit", onClick: decreaseMonth, children: /* @__PURE__ */ jsx40(ChevronLeftIcon3, { width: 16, height: 16 }) })
2314
+ ] });
2315
+ var RightNavigation = ({ increaseYear, increaseMonth }) => /* @__PURE__ */ jsxs11(Fragment7, { children: [
2316
+ increaseMonth && /* @__PURE__ */ jsx40(OutlineButton, { px: "5px", py: "5px", height: "inherit", onClick: increaseMonth, children: /* @__PURE__ */ jsx40(ChevronRightIcon4, { width: 16, height: 16 }) }),
2317
+ increaseYear && /* @__PURE__ */ jsx40(OutlineButton, { px: "5px", py: "5px", height: "inherit", onClick: increaseYear, children: /* @__PURE__ */ jsx40(ChevronRightIcon4, { width: 16, height: 16 }) })
2318
+ ] });
2319
+
2320
+ // src/inputs/Datepicker/Base/DateHeader.tsx
2321
+ import { jsx as jsx41, jsxs as jsxs12 } from "react/jsx-runtime";
2322
+ var months = [
2323
+ "January",
2324
+ "February",
2325
+ "March",
2326
+ "April",
2327
+ "May",
2328
+ "June",
2329
+ "July",
2330
+ "August",
2331
+ "September",
2332
+ "October",
2333
+ "November",
2334
+ "December"
2335
+ ];
2336
+ var StyledMenu = styled36(Menu)`
2337
+ max-height: 200px;
2338
+ `;
2339
+ var getYearsPeriod = (date, yearItemNumber = 12) => {
2340
+ let endPeriod = Math.ceil(getYear(date) / yearItemNumber) * yearItemNumber;
2341
+ let startPeriod = endPeriod - (yearItemNumber - 1);
2342
+ return [startPeriod, endPeriod];
2343
+ };
2344
+ var DateHeader = ({
2345
+ monthsShown,
2346
+ monthDate,
2347
+ customHeaderCount,
2348
+ showMonthYearPicker,
2349
+ showYearPicker,
2350
+ date,
2351
+ decreaseMonth,
2352
+ increaseMonth,
2353
+ decreaseYear,
2354
+ increaseYear,
2355
+ changeMonth,
2356
+ changeYear
2357
+ }) => {
2358
+ let [monthMenuOpen, setMonthMenuOpen] = useState8(false);
2359
+ let [itemRef, setItemRef] = useState8(null);
2360
+ let showLeftNav = monthsShown === 1 || customHeaderCount === 0;
2361
+ let showRightNav = monthsShown === 1 || customHeaderCount === 1;
2362
+ let isOpen = showMonthYearPicker || showYearPicker ? false : monthMenuOpen;
2363
+ let formatting = showMonthYearPicker ? "yyyy" : "MMMM yyyy";
2364
+ let getFriendlyString = () => {
2365
+ if (showYearPicker) {
2366
+ let [start, end] = getYearsPeriod(date, 12);
2367
+ return `${start} - ${end}`;
2368
+ }
2369
+ return format(monthDate, formatting);
2370
+ };
2371
+ let handleMonthChange = (month) => {
2372
+ setMonthMenuOpen(false);
2373
+ changeMonth(month);
2374
+ };
2375
+ let canModifyMonths = (fn) => {
2376
+ if (showMonthYearPicker || showYearPicker) {
2377
+ return void 0;
2378
+ }
2379
+ return fn;
2380
+ };
2381
+ let canModifyYear = (fn) => {
2382
+ if (showMonthYearPicker || showYearPicker) {
2383
+ return fn;
2384
+ }
2385
+ return void 0;
2386
+ };
2387
+ let decreaseYearFn = showYearPicker ? () => changeYear(getYear(date) - 12) : decreaseYear;
2388
+ let increaseYearFn = showYearPicker ? () => changeYear(getYear(date) + 12) : increaseYear;
2389
+ return /* @__PURE__ */ jsxs12("div", { children: [
2390
+ /* @__PURE__ */ jsxs12(Box, { display: "flex", alignItems: "center", justifyContent: "center", py: "2", children: [
2391
+ showLeftNav && /* @__PURE__ */ jsx41(LeftNavigation, { decreaseMonth: canModifyMonths(decreaseMonth), decreaseYear: canModifyYear(decreaseYearFn) }),
2392
+ /* @__PURE__ */ jsx41(
2393
+ ClickableElement,
2394
+ {
2395
+ ref: setItemRef,
2396
+ flexGrow: "1",
2397
+ fontWeight: "500",
2398
+ justifyContent: "center",
2399
+ onClick: () => setMonthMenuOpen(true),
2400
+ children: getFriendlyString()
2401
+ }
2402
+ ),
2403
+ showRightNav && /* @__PURE__ */ jsx41(RightNavigation, { increaseMonth: canModifyMonths(increaseMonth), increaseYear: canModifyYear(increaseYearFn) })
2404
+ ] }),
2405
+ /* @__PURE__ */ jsx41(StyledMenu, { inline: true, handleClose: () => setMonthMenuOpen(false), itemRef, isOpen, children: months.map((month, idx) => /* @__PURE__ */ jsx41(MenuItem, { onClick: () => handleMonthChange(idx), children: month }, month)) })
2406
+ ] });
2407
+ };
2408
+
2409
+ // src/inputs/Datepicker/Base/DateInput.tsx
2410
+ import { forwardRef as forwardRef10 } from "react";
2411
+ import { CalendarIcon } from "@heroicons/react/24/outline";
2412
+ import styled37 from "styled-components";
2413
+ import { jsx as jsx42, jsxs as jsxs13 } from "react/jsx-runtime";
2414
+ var Container6 = styled37.div`
2415
+ display: flex;
2416
+ align-items: center;
2417
+ > :not([hidden]) ~ :not([hidden]) {
2418
+ margin-left: ${({ theme: theme2 }) => theme2.space[1]};
2419
+ margin-right:${({ theme: theme2 }) => theme2.space[4]};
2420
+ }
2421
+ `;
2422
+ var Icon3 = styled37(CalendarIcon)`
2423
+ color: ${({ theme: theme2 }) => theme2.colors.foreground};
2424
+ margin-right: ${({ theme: theme2 }) => theme2.space[2]};
2425
+ `;
2426
+ var ClearBtn = styled37(ClickableElement)`
2427
+ color: ${({ theme: theme2 }) => theme2.colors.foreground};
2428
+ :hover {
2429
+ color: ${({ theme: theme2 }) => theme2.colors.foreground};
2430
+ }
2431
+ `;
2432
+ var DateInput = forwardRef10(({
2433
+ value,
2434
+ placeholder,
2435
+ onClick,
2436
+ clear,
2437
+ showClear
2438
+ }, ref) => {
2439
+ let handleClear = (e) => {
2440
+ e.stopPropagation();
2441
+ clear == null ? void 0 : clear();
2442
+ };
2443
+ let displayValue = value ? /* @__PURE__ */ jsx42(Typography, { as: "span", children: value }) : /* @__PURE__ */ jsx42(Typography, { as: "span", color: "mutedForeground", children: placeholder });
2444
+ return /* @__PURE__ */ jsxs13(OutlineButton, { bg: "background", width: "100%", fontWeight: "400", lineHeight: "inherit", justifyContent: "space-between", ref, onClick, children: [
2445
+ /* @__PURE__ */ jsxs13(Container6, { children: [
2446
+ /* @__PURE__ */ jsx42(Icon3, { width: 16, height: 16 }),
2447
+ displayValue
2448
+ ] }),
2449
+ showClear && value && /* @__PURE__ */ jsx42(ClearBtn, { onClick: handleClear, as: "a", children: "Clear" })
2450
+ ] });
2451
+ });
2452
+
2453
+ // src/inputs/Datepicker/Base/DateContainer.tsx
2454
+ import { jsx as jsx43 } from "react/jsx-runtime";
2455
+ var DateContainer = ({ children }) => /* @__PURE__ */ jsx43(Box, { display: "flex", p: "3", bg: "background", borderRadius: "2", boxShadow: "base.1", border: "border.1", fontSize: "1", lineHeight: "1", children });
2456
+
2457
+ // src/inputs/Datepicker/Base/DateWrapper.tsx
2458
+ import { useState as useState9 } from "react";
2459
+ import { usePopper as usePopper2 } from "react-popper";
2460
+ import { jsx as jsx44 } from "react/jsx-runtime";
2461
+ var DateWrapper = ({ children, itemRef, direction = "bottom-start", handleClose, isOpen }) => {
2462
+ let [popperRef, setPopperRef] = useState9(null);
2463
+ let { styles, attributes } = usePopper2(itemRef, popperRef, {
2464
+ placement: direction,
2465
+ modifiers: [
2466
+ {
2467
+ name: "offset",
2468
+ options: {
2469
+ offset: [0, 10]
2470
+ }
2471
+ }
2472
+ ]
2473
+ });
2474
+ return isOpen ? /* @__PURE__ */ jsx44(ClickOutside, { handleClose, target: popperRef, children: /* @__PURE__ */ jsx44(Box, __spreadProps(__spreadValues({ ref: setPopperRef, style: styles.popper }, attributes.popper), { children })) }) : null;
2475
+ };
2476
+
2477
+ // src/inputs/Datepicker/Base/StylingBasePicker.tsx
2478
+ import { darken as darken3 } from "polished";
2479
+ import styled38 from "styled-components";
2480
+ var Container7 = styled38.div`
2481
+ /*
2482
+ --------------------------
2483
+ Day names
2484
+ --------------------------
2485
+ */
2486
+ .react-datepicker__day-names {
2487
+ display: grid;
2488
+ grid-template-columns: repeat(7, minmax(0, 1fr));
2489
+ justify-content: space-between;
2490
+ }
2491
+
2492
+ .react-datepicker__day-name {
2493
+ text-align: center;
2494
+ padding: ${({ theme: theme2 }) => theme2.space[1]};
2495
+ color: ${({ theme: theme2 }) => theme2.colors.mutedForeground};
2496
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes[1]};
2497
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights[1]};
2498
+ }
2499
+
2500
+ /*
2501
+ --------------------------
2502
+ Calander body
2503
+ --------------------------
2504
+ */
2505
+
2506
+ .react-datepicker__aria-live {
2507
+ display: none;
2508
+ }
2509
+
2510
+ .react-datepicker__month {
2511
+ margin-top:${({ theme: theme2 }) => theme2.space[2]};
2512
+ > :not([hidden]) ~ :not([hidden]) {
2513
+ margin-bottom: ${({ theme: theme2 }) => theme2.space[1]};
2514
+ margin-top: ${({ theme: theme2 }) => theme2.space[1]};
2515
+ }
2516
+ }
2517
+ .react-datepicker__week {
2518
+ display: grid;
2519
+ grid-template-columns: repeat(7, minmax(0, 1fr));
2520
+ width: 100%;
2521
+ justify-content: space-between;
2522
+ }
2523
+
2524
+ .react-datepicker__day,
2525
+ .react-datepicker__year-text,
2526
+ .react-datepicker__month-text {
2527
+ cursor: pointer;
2528
+ text-align: center;
2529
+ :hover {
2530
+ background: ${({ theme: theme2 }) => theme2.colors.accent};
2531
+ border-radius:${({ theme: theme2 }) => theme2.radii[3]};
2532
+ }
2533
+ }
2534
+
2535
+ .react-datepicker__day--today {
2536
+ font-weight: 700;
2537
+ }
2538
+
2539
+ .react-datepicker__day div {
2540
+ padding: 0.375rem;
2541
+ }
2542
+
2543
+ .react-datepicker__day--in-range div,
2544
+ .react-datepicker__month--in-range div {
2545
+ :hover {
2546
+ border-radius: 0px;
2547
+ }
2548
+ background: ${({ theme: theme2 }) => theme2.colors.accent};
2549
+ color: ${({ theme: theme2 }) => theme2.colors.foreground};
2550
+ }
2551
+
2552
+ .react-datepicker__month--selected,
2553
+ .react-datepicker__month--range-start,
2554
+ .react-datepicker__month--range-end,
2555
+ .react-datepicker__year-text--selected,
2556
+ .react-datepicker__day--selected,
2557
+ .react-datepicker__day--range-start div,
2558
+ .react-datepicker__day--range-end div {
2559
+ color: ${({ theme: theme2 }) => theme2.colors.background};
2560
+ }
2561
+
2562
+ .react-datepicker__day--range-start div,
2563
+ .react-datepicker__day--range-end div,
2564
+ .react-datepicker__day--selecting-range-start div,
2565
+ .react-datepicker__day--selecting-range-end div,
2566
+ .react-datepicker__day--selected div,
2567
+ .react-datepicker__month--selected,
2568
+ .react-datepicker__year-text--selected {
2569
+ border-radius: ${({ theme: theme2 }) => theme2.radii[3]};
2570
+ }
2571
+
2572
+ .react-datepicker__day--selected div,
2573
+ .react-datepicker__day--range-start div,
2574
+ .react-datepicker__day--range-end div,
2575
+ .react-datepicker__month--selected,
2576
+ .react-datepicker__month--range-start,
2577
+ .react-datepicker__month--range-end,
2578
+ .react-datepicker__year-text--selected {
2579
+ background: ${({ theme: theme2 }) => theme2.colors.primary};
2580
+ :hover {
2581
+ background: ${({ theme: theme2 }) => theme2.colors.primary};
2582
+ }
2583
+ }
2584
+
2585
+ .react-datepicker__day--outside-month {
2586
+ pointer-events: none;
2587
+ opacity: 0;
2588
+ }
2589
+ .react-datepicker__day--highlighted,
2590
+ .react-datepicker__month--highlighted {
2591
+ border-radius: ${({ theme: theme2 }) => theme2.radii[3]};
2592
+ background: ${({ theme: theme2 }) => theme2.colors.accent};
2593
+ color: ${({ theme: theme2 }) => theme2.colors.foreground};
2594
+ }
2595
+
2596
+ .react-datepicker__day--disabled,
2597
+ .react-datepicker__month--disabled,
2598
+ .react-datepicker__day--excluded,
2599
+ .react-datepicker__month--excluded {
2600
+ cursor: not-allowed;
2601
+ opacity:0.5;
2602
+ :hover {
2603
+ background-color: transparent;
2604
+ }
2605
+ color: ${({ theme: theme2 }) => theme2.colors.accent};
2606
+ }
2607
+
2608
+ .react-datepicker__day--in-selecting-range {
2609
+ :hover {
2610
+ border-radius: ${({ theme: theme2 }) => theme2.radii[3]};
2611
+ background: ${({ theme: theme2 }) => darken3(0.1, theme2.colors.accent)};
2612
+ }
2613
+ background: ${({ theme: theme2 }) => theme2.colors.accent};
2614
+ }
2615
+
2616
+ .react-datepicker__day--selecting-range-start div,
2617
+ .react-datepicker__day--selecting-range-end div {
2618
+ background: ${({ theme: theme2 }) => darken3(0.1, theme2.colors.primary)};
2619
+ color: ${({ theme: theme2 }) => theme2.colors.primaryForeground};
2620
+ }
2621
+
2622
+
2623
+ .react-datepicker__month-container:last-of-type:not(:first-of-type) {
2624
+ margin-left: ${({ theme: theme2 }) => theme2.sizes[4]};
2625
+ }
2626
+
2627
+ /*
2628
+ -------------------------
2629
+ month selector
2630
+ -------------------------
2631
+ */
2632
+ .react-datepicker__monthPicker {
2633
+ display: grid;
2634
+ flex-direction: column;
2635
+ }
2636
+
2637
+ .react-datepicker__month-wrapper {
2638
+ display: grid;
2639
+ grid-template-columns: repeat(3, minmax(0, 1fr));
2640
+ }
2641
+
2642
+ .react-datepicker__month-text {
2643
+ text-align: center;
2644
+ padding: ${({ theme: theme2 }) => theme2.space[1]};
2645
+ }
2646
+
2647
+ /*
2648
+ ------------------------
2649
+ year selector
2650
+ ------------------------
2651
+ */
2652
+ .react-datepicker__year {
2653
+ margin-top: ${({ theme: theme2 }) => theme2.space[2]};
2654
+ }
2655
+
2656
+ .react-datepicker__year--container {
2657
+ padding-bottom: ${({ theme: theme2 }) => theme2.space[2]};
2658
+ padding-left: ${({ theme: theme2 }) => theme2.space[2]};
2659
+ padding-right: ${({ theme: theme2 }) => theme2.space[2]};
2660
+ }
2661
+
2662
+ .react-datepicker__year-wrapper {
2663
+ display: grid;
2664
+ gap: 5px;
2665
+ grid-template-columns: repeat(3, minmax(0, 1fr));
2666
+ }
2667
+
2668
+ .react-datepicker__year-text {
2669
+ text-align: center;
2670
+ padding: ${({ theme: theme2 }) => theme2.space[1]};
2671
+ }
2672
+ `;
2673
+
2674
+ // src/inputs/Datepicker/Base/BasePicker.tsx
2675
+ import { Fragment as Fragment8, jsx as jsx45, jsxs as jsxs14 } from "react/jsx-runtime";
2676
+ var BasePicker = (_a) => {
2677
+ var _b = _a, {
2678
+ placeholder,
2679
+ handleClear,
2680
+ dateFormat = "dd/MM/yyyy",
2681
+ inputValue,
2682
+ monthsShown = 1,
2683
+ shouldCloseOnSelect = true,
2684
+ onChange,
2685
+ showMonthYearPicker,
2686
+ showYearPicker,
2687
+ showClear = false
2688
+ } = _b, rest = __objRest(_b, [
2689
+ "placeholder",
2690
+ "handleClear",
2691
+ "dateFormat",
2692
+ "inputValue",
2693
+ "monthsShown",
2694
+ "shouldCloseOnSelect",
2695
+ "onChange",
2696
+ "showMonthYearPicker",
2697
+ "showYearPicker",
2698
+ "showClear"
2699
+ ]);
2700
+ let [isOpen, setOpen] = useState10(false);
2701
+ let [wrappedRef, setWrappedRef] = useState10(null);
2702
+ let handleChange = (value, e) => {
2703
+ let isComplete = Array.isArray(value) && value[0] && value[1] || !Array.isArray(value) && value !== null;
2704
+ if (shouldCloseOnSelect && isComplete) {
2705
+ setOpen(false);
2706
+ }
2707
+ onChange(value, e);
2708
+ };
2709
+ let defaults = {
2710
+ dateFormat,
2711
+ monthsShown,
2712
+ showPopperArrow: false,
2713
+ inline: true,
2714
+ renderDayContents: (dayOfMonth) => /* @__PURE__ */ jsx45("div", { className: "in-month", children: dayOfMonth }),
2715
+ calendarContainer: DateContainer,
2716
+ popperContainer: PopperContainer,
2717
+ onChange: handleChange,
2718
+ showMonthYearPicker,
2719
+ showYearPicker,
2720
+ renderCustomHeader: (props) => /* @__PURE__ */ jsx45(DateHeader, __spreadValues({ showMonthYearPicker, monthsShown, showYearPicker }, props))
2721
+ };
2722
+ return /* @__PURE__ */ jsxs14(Fragment8, { children: [
2723
+ /* @__PURE__ */ jsx45(
2724
+ DateInput,
2725
+ {
2726
+ ref: setWrappedRef,
2727
+ clear: handleClear,
2728
+ onClick: () => setOpen(true),
2729
+ value: inputValue,
2730
+ placeholder,
2731
+ showClear
2732
+ }
2733
+ ),
2734
+ /* @__PURE__ */ jsx45(DateWrapper, { isOpen, handleClose: () => setOpen(false), itemRef: wrappedRef, children: /* @__PURE__ */ jsx45(Container7, { children: /* @__PURE__ */ jsx45(
2735
+ Picker,
2736
+ __spreadValues(__spreadValues({}, defaults), rest)
2737
+ ) }) })
2738
+ ] });
2739
+ };
2740
+
2741
+ // src/inputs/Datepicker/DateRangePicker.tsx
2742
+ import { useState as useState11 } from "react";
2743
+ import { format as format2 } from "date-fns";
2744
+ import { jsx as jsx46 } from "react/jsx-runtime";
2745
+ var DateRangePicker = (_a) => {
2746
+ var _b = _a, { defaultStartDate, defaultEndDate, onChange = () => {
2747
+ }, inputValueFormat = "dd/MM/yyyy", monthsShown = 2 } = _b, rest = __objRest(_b, ["defaultStartDate", "defaultEndDate", "onChange", "inputValueFormat", "monthsShown"]);
2748
+ let [startDate, setStartDate] = useState11(defaultStartDate || null);
2749
+ let [endDate, setEndDate] = useState11(defaultEndDate || null);
2750
+ let inputValue = startDate && endDate && `${format2(startDate, inputValueFormat)} - ${format2(endDate, inputValueFormat)}`;
2751
+ let clear = () => {
2752
+ setStartDate(null);
2753
+ setEndDate(null);
2754
+ };
2755
+ let handleChange = (dates, event) => {
2756
+ let [start, end] = dates;
2757
+ setStartDate(start);
2758
+ setEndDate(end);
2759
+ onChange == null ? void 0 : onChange(dates, event);
2760
+ };
2761
+ return /* @__PURE__ */ jsx46(
2762
+ BasePicker,
2763
+ __spreadProps(__spreadValues({}, rest), {
2764
+ inputValue: inputValue || void 0,
2765
+ startDate,
2766
+ endDate,
2767
+ selectsRange: true,
2768
+ handleClear: clear,
2769
+ monthsShown,
2770
+ onChange: handleChange
2771
+ })
2772
+ );
2773
+ };
2774
+
2775
+ // src/inputs/Datepicker/DatePicker.tsx
2776
+ import { useState as useState12 } from "react";
2777
+ import { format as format3 } from "date-fns";
2778
+ import { jsx as jsx47 } from "react/jsx-runtime";
2779
+ var DatePicker = (_a) => {
2780
+ var _b = _a, {
2781
+ defaultDate,
2782
+ onChange = () => {
2783
+ },
2784
+ inputValueFormat = "dd/MM/yyyy"
2785
+ } = _b, rest = __objRest(_b, [
2786
+ "defaultDate",
2787
+ "onChange",
2788
+ "inputValueFormat"
2789
+ ]);
2790
+ let [selectedDate, setSelectedDate] = useState12(defaultDate || null);
2791
+ let inputValue = selectedDate && format3(selectedDate, inputValueFormat);
2792
+ let clear = () => {
2793
+ setSelectedDate(null);
2794
+ };
2795
+ let handleChange = (date, event) => {
2796
+ setSelectedDate(date);
2797
+ onChange == null ? void 0 : onChange(date, event);
2798
+ };
2799
+ return /* @__PURE__ */ jsx47(
2800
+ BasePicker,
2801
+ __spreadProps(__spreadValues({}, rest), {
2802
+ inputValue: inputValue || void 0,
2803
+ selected: selectedDate,
2804
+ handleClear: clear,
2805
+ onChange: handleChange
2806
+ })
2807
+ );
2808
+ };
2809
+
2810
+ // src/inputs/Select/Select.tsx
2811
+ import Downshift from "downshift";
2812
+
2813
+ // src/inputs/Select/SelectContext.tsx
2814
+ import { useContext as useContext2, createContext as createContext2 } from "react";
2815
+ var SelectContext = createContext2(void 0);
2816
+ var useSelectContext = () => {
2817
+ let context = useContext2(SelectContext);
2818
+ if (context === void 0) {
2819
+ throw new Error("useSelectContext must be used within a SelectContext provider");
2820
+ }
2821
+ return context;
2822
+ };
2823
+
2824
+ // src/inputs/Select/Select.tsx
2825
+ import { jsx as jsx48 } from "react/jsx-runtime";
2826
+ var clearInputOnSelectItem = (state, changes) => {
2827
+ if (changes.type === Downshift.stateChangeTypes.clickButton) {
2828
+ return __spreadProps(__spreadValues({}, changes), {
2829
+ inputValue: ""
2830
+ });
2831
+ }
2832
+ return changes;
2833
+ };
2834
+ var Select = (_a) => {
2835
+ var _b = _a, { itemToString, children } = _b, rest = __objRest(_b, ["itemToString", "children"]);
2836
+ return /* @__PURE__ */ jsx48(Downshift, __spreadProps(__spreadValues({ itemToString, stateReducer: clearInputOnSelectItem }, rest), { children: (_a2) => {
2837
+ var _b2 = _a2, { getRootProps } = _b2, downshift = __objRest(_b2, ["getRootProps"]);
2838
+ return /* @__PURE__ */ jsx48(Box, __spreadProps(__spreadValues({ position: "relative", width: "100%" }, getRootProps()), { children: /* @__PURE__ */ jsx48(SelectContext.Provider, { value: __spreadValues(__spreadValues({}, downshift), getRootProps()), children }) }));
2839
+ } }));
2840
+ };
2841
+
2842
+ // src/inputs/Select/SelectButton.tsx
2843
+ import { ChevronUpDownIcon } from "@heroicons/react/24/outline";
2844
+ import styled39 from "styled-components";
2845
+ import { jsx as jsx49, jsxs as jsxs15 } from "react/jsx-runtime";
2846
+ var ClearBtn2 = styled39(ClickableElement)`
2847
+ color: ${({ theme: theme2 }) => theme2.colors.mutedForeground};
2848
+ margin-right: 3px;
2849
+ :hover {
2850
+ color: ${({ theme: theme2 }) => theme2.colors.foreground};
2851
+ }
2852
+ `;
2853
+ var Container8 = styled39(Box)`
2854
+ > {
2855
+ margin-right: ${({ theme: theme2 }) => theme2.space[4]};
2856
+ }
2857
+ > :last-child {
2858
+ margin-right: 0;
2859
+ }
2860
+ `;
2861
+ var SelectButton = (_a) => {
2862
+ var _b = _a, {
2863
+ isClearable,
2864
+ children,
2865
+ isFilterable,
2866
+ placeholder
2867
+ } = _b, rest = __objRest(_b, [
2868
+ "isClearable",
2869
+ "children",
2870
+ "isFilterable",
2871
+ "placeholder"
2872
+ ]);
2873
+ let {
2874
+ getToggleButtonProps,
2875
+ itemToString,
2876
+ selectedItem,
2877
+ clearSelection
2878
+ } = useSelectContext();
2879
+ let buttonText = children || itemToString && itemToString(selectedItem) || selectedItem && selectedItem.value || placeholder;
2880
+ let isClearableActive = isClearable && selectedItem;
2881
+ let clear = (e) => {
2882
+ e.stopPropagation();
2883
+ clearSelection();
2884
+ };
2885
+ return /* @__PURE__ */ jsxs15(
2886
+ OutlineButton,
2887
+ __spreadProps(__spreadValues(__spreadValues({
2888
+ width: "100%",
2889
+ bg: "background",
2890
+ justifyContent: "space-between"
2891
+ }, getToggleButtonProps()), rest), {
2892
+ children: [
2893
+ /* @__PURE__ */ jsx49(Typography, { fontWeight: "normal", children: buttonText }),
2894
+ /* @__PURE__ */ jsxs15(Container8, { display: "flex", alignItems: "center", children: [
2895
+ isClearableActive && /* @__PURE__ */ jsx49(ClearBtn2, { as: "a", onClick: clear, children: "Clear" }),
2896
+ /* @__PURE__ */ jsx49(ChevronUpDownIcon, { height: 16, width: 16 })
2897
+ ] })
2898
+ ]
2899
+ })
2900
+ );
2901
+ };
2902
+
2903
+ // src/inputs/Select/SelectFilter.tsx
2904
+ import { useEffect as useEffect6, useRef as useRef4 } from "react";
2905
+ import { ChevronUpDownIcon as ChevronUpDownIcon2 } from "@heroicons/react/24/outline";
2906
+
2907
+ // src/inputs/Input/Input.tsx
2908
+ import { forwardRef as forwardRef11 } from "react";
2909
+ import styled42 from "styled-components";
2910
+
2911
+ // src/inputs/Input/BaseInput.tsx
2912
+ import styled40 from "styled-components";
2913
+ var BaseInput = styled40.input`
2914
+ width: 100%;
2915
+ outline: 2px solid transparent;
2916
+ outline-offset: 2px;
2917
+ background: transparent;
2918
+ color: ${({ theme: theme2 }) => theme2.colors.foreground};
2919
+ padding: ${({ theme: theme2 }) => theme2.space[1]} ${({ theme: theme2 }) => theme2.space[3]};
2920
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes[1]};
2921
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights[1]};
2922
+ height: calc(${({ theme: theme2 }) => theme2.sizes[9]} - 2px);
2923
+ :placeholder {
2924
+ color: ${({ theme: theme2 }) => theme2.colors.mutedForeground};
2925
+ }
2926
+ `;
2927
+
2928
+ // src/inputs/Input/AddonElement.tsx
2929
+ import styled41 from "styled-components";
2930
+ import { jsx as jsx50 } from "react/jsx-runtime";
2931
+ var StyledBox = styled41(Box)`
2932
+ &:focus {
2933
+ z-index:0;
2934
+ outline: none;
2935
+ }
2936
+
2937
+ button:focus {
2938
+ outline: none;
2939
+ box-shadow: none;
2940
+ }
2941
+
2942
+ :hover {
2943
+ opacity: 0.8;
2944
+ }
2945
+ `;
2946
+ var AddonElement = ({
2947
+ addon,
2948
+ left,
2949
+ right
2950
+ }) => addon ? /* @__PURE__ */ jsx50(StyledBox, { bg: "offsetBackground", borderRight: right ? "none" : "border.1", borderLeft: left ? "none" : "border.1", display: "flex", alignItems: "center", children: addon }) : null;
2951
+
2952
+ // src/inputs/Input/OptionalIcon.tsx
2953
+ import { jsx as jsx51 } from "react/jsx-runtime";
2954
+ var OptionalIcon = ({ icon, left, right }) => icon ? /* @__PURE__ */ jsx51(
2955
+ Box,
2956
+ {
2957
+ bg: "offsetBackground",
2958
+ display: "flex",
2959
+ borderRight: right ? "none" : "border.1",
2960
+ borderLeft: left ? "none" : "border.1",
2961
+ alignItems: "center",
2962
+ px: "3",
2963
+ py: "2",
2964
+ children: icon
2965
+ }
2966
+ ) : null;
2967
+
2968
+ // src/inputs/Input/Input.tsx
2969
+ import { jsx as jsx52, jsxs as jsxs16 } from "react/jsx-runtime";
2970
+ var Container9 = styled42(Box)`
2971
+ overflow: hidden;
2972
+ :focus-within {
2973
+ border: ${({ theme: theme2 }) => theme2.borders.primary[1]};
2974
+ }
2975
+ ${({ disabled }) => disabled && `
2976
+ opacity: 0.5;
2977
+ cursor: not-allowed;
2978
+ div, svg, input {
2979
+ cursor: not-allowed;
2980
+ }
2981
+ `}
2982
+ `;
2983
+ var Input2 = forwardRef11((_a, ref) => {
2984
+ var _b = _a, {
2985
+ prefixMarkIcon: prefiXMarkIcon,
2986
+ suffixMarkIcon: suffiXMarkIcon,
2987
+ before,
2988
+ after,
2989
+ disabled = false
2990
+ } = _b, rest = __objRest(_b, [
2991
+ "prefixMarkIcon",
2992
+ "suffixMarkIcon",
2993
+ "before",
2994
+ "after",
2995
+ "disabled"
2996
+ ]);
2997
+ return /* @__PURE__ */ jsxs16(
2998
+ Container9,
2999
+ {
3000
+ disabled,
3001
+ bg: "background",
3002
+ display: "flex",
3003
+ borderRadius: "3",
3004
+ border: "border.1",
3005
+ boxShadow: "base.0",
3006
+ children: [
3007
+ /* @__PURE__ */ jsx52(OptionalIcon, { left: true, icon: prefiXMarkIcon }),
3008
+ /* @__PURE__ */ jsx52(AddonElement, { left: true, addon: before }),
3009
+ /* @__PURE__ */ jsx52(BaseInput, __spreadValues({ disabled, ref }, rest)),
3010
+ /* @__PURE__ */ jsx52(OptionalIcon, { right: true, icon: suffiXMarkIcon }),
3011
+ /* @__PURE__ */ jsx52(AddonElement, { right: true, addon: after })
3012
+ ]
3013
+ }
3014
+ );
3015
+ });
3016
+
3017
+ // src/inputs/Input/Password.tsx
3018
+ import { useState as useState13 } from "react";
3019
+ import { EyeIcon, EyeSlashIcon } from "@heroicons/react/24/outline";
3020
+ import { jsx as jsx53 } from "react/jsx-runtime";
3021
+ var Btn2 = (_a) => {
3022
+ var _b = _a, { showPassword, onClick } = _b, rest = __objRest(_b, ["showPassword", "onClick"]);
3023
+ return /* @__PURE__ */ jsx53(ClickableElement, __spreadProps(__spreadValues({ px: "3", py: "2", type: "button", onClick }, rest), { children: showPassword ? /* @__PURE__ */ jsx53(EyeSlashIcon, { width: 16 }) : /* @__PURE__ */ jsx53(EyeIcon, { width: 16 }) }));
3024
+ };
3025
+ var Password = (_a) => {
3026
+ var rest = __objRest(_a, []);
3027
+ let [showPassword, setToggle] = useState13(false);
3028
+ let onClick = () => setToggle(!showPassword);
3029
+ return /* @__PURE__ */ jsx53(
3030
+ Input2,
3031
+ __spreadProps(__spreadValues({}, rest), {
3032
+ after: /* @__PURE__ */ jsx53(Btn2, { showPassword, onClick }),
3033
+ type: showPassword ? "text" : "password"
3034
+ })
3035
+ );
3036
+ };
3037
+
3038
+ // src/inputs/Input/NumberField.tsx
3039
+ import { jsx as jsx54 } from "react/jsx-runtime";
3040
+ var NumberField = (_a) => {
3041
+ var rest = __objRest(_a, []);
3042
+ return /* @__PURE__ */ jsx54(Input2, __spreadValues({ type: "number" }, rest));
3043
+ };
3044
+
3045
+ // src/inputs/Select/SelectFilter.tsx
3046
+ import { jsx as jsx55 } from "react/jsx-runtime";
3047
+ var SelectFilter = (_a) => {
3048
+ var _b = _a, { textProps } = _b, rest = __objRest(_b, ["textProps"]);
3049
+ let ref = useRef4(null);
3050
+ let { getInputProps, isOpen } = useSelectContext();
3051
+ useEffect6(() => {
3052
+ var _a2;
3053
+ if (isOpen) {
3054
+ (_a2 = ref == null ? void 0 : ref.current) == null ? void 0 : _a2.focus();
3055
+ }
3056
+ }, [isOpen]);
3057
+ if (!isOpen) {
3058
+ return /* @__PURE__ */ jsx55(SelectButton, __spreadValues({}, rest));
3059
+ }
3060
+ return /* @__PURE__ */ jsx55(Input2, __spreadValues(__spreadValues({ suffixMarkIcon: /* @__PURE__ */ jsx55(ChevronUpDownIcon2, { height: 16, width: 16 }), ref }, textProps), getInputProps()));
3061
+ };
3062
+
3063
+ // src/inputs/Select/SelectItem.tsx
3064
+ import { useMemo as useMemo2 } from "react";
3065
+ import styled43 from "styled-components";
3066
+ import { jsx as jsx56 } from "react/jsx-runtime";
3067
+ var Item = styled43(ListItem)`
3068
+ cursor: pointer;
3069
+ padding: ${({ theme: theme2 }) => `${theme2.space[2]} ${theme2.space[4]}`};
3070
+ background: ${({ changeBg, theme: theme2 }) => changeBg ? theme2.colors.accent : "inherit"};
3071
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes[1]};
3072
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights[1]};
3073
+ border-radius: ${({ theme: theme2 }) => theme2.radii[3]};
3074
+ margin: 0px ${({ theme: theme2 }) => theme2.space[1]};
3075
+ &:hover {
3076
+ background: ${({ theme: theme2 }) => theme2.colors.accent};
3077
+ }
3078
+ `;
3079
+ var SelectItem = ({ children, item, index }) => {
3080
+ let {
3081
+ getItemProps,
3082
+ selectedItem,
3083
+ itemToString
3084
+ } = useSelectContext();
3085
+ let itemText = children || itemToString && itemToString(item) || item && item.value;
3086
+ let memoValue = useMemo2(() => itemToString(item), [item, itemToString]);
3087
+ let _a = getItemProps({
3088
+ key: item.value,
3089
+ item,
3090
+ index
3091
+ }), { key } = _a, itemProps = __objRest(_a, ["key"]);
3092
+ return /* @__PURE__ */ jsx56(
3093
+ Item,
3094
+ __spreadProps(__spreadValues({
3095
+ changeBg: selectedItem === item || itemToString(SelectItem) === memoValue
3096
+ }, itemProps), {
3097
+ children: itemText
3098
+ }),
3099
+ key
3100
+ );
3101
+ };
3102
+
3103
+ // src/inputs/Select/SelectList.tsx
3104
+ import styled44 from "styled-components";
3105
+ import { jsx as jsx57 } from "react/jsx-runtime";
3106
+ var StyledList = styled44(List)`
3107
+ padding-top: ${({ theme: theme2 }) => theme2.space[1]};
3108
+ padding-bottom: ${({ theme: theme2 }) => theme2.space[1]};
3109
+ border-radius: ${({ theme: theme2 }) => theme2.radii[3]};
3110
+ box-shadow: ${({ theme: theme2 }) => theme2.shadows.base[4]};
3111
+ border: ${({ theme: theme2 }) => theme2.borders.border[1]};
3112
+ background: ${({ theme: theme2 }) => theme2.colors.background};
3113
+ margin-top: ${({ theme: theme2 }) => theme2.space[2]};
3114
+ position: absolute;
3115
+ min-width: 100%;
3116
+ z-index:1000;
3117
+ `;
3118
+ var SelectList = ({ children }) => {
3119
+ let { isOpen } = useSelectContext();
3120
+ if (!isOpen) {
3121
+ return null;
3122
+ }
3123
+ return /* @__PURE__ */ jsx57(StyledList, { children });
3124
+ };
3125
+
3126
+ // src/inputs/Select/SimpleSelect/SimpleSelect.tsx
3127
+ import { useState as useState14 } from "react";
3128
+ import { jsx as jsx58, jsxs as jsxs17 } from "react/jsx-runtime";
3129
+ var SimpleSelect = (_a) => {
3130
+ var _b = _a, {
3131
+ values,
3132
+ isFilterable,
3133
+ disabled,
3134
+ isClearable,
3135
+ placeholder,
3136
+ onInputValueChange,
3137
+ itemToString = (item) => item || ""
3138
+ } = _b, rest = __objRest(_b, [
3139
+ "values",
3140
+ "isFilterable",
3141
+ "disabled",
3142
+ "isClearable",
3143
+ "placeholder",
3144
+ "onInputValueChange",
3145
+ "itemToString"
3146
+ ]);
3147
+ let [filter, setFilter] = useState14("");
3148
+ let filterOptions = values.filter((item) => itemToString(item).toLowerCase().includes(filter));
3149
+ const handleOnputValueChange = (inputValue, stateAndHelpers) => {
3150
+ if (onInputValueChange) {
3151
+ onInputValueChange(inputValue, stateAndHelpers);
3152
+ }
3153
+ setFilter(inputValue);
3154
+ };
3155
+ return /* @__PURE__ */ jsxs17(Select, __spreadProps(__spreadValues({ onInputValueChange: handleOnputValueChange, itemToString }, rest), { children: [
3156
+ isFilterable ? /* @__PURE__ */ jsx58(SelectFilter, { disabled, isClearable, placeholder }) : /* @__PURE__ */ jsx58(SelectButton, { disabled, isClearable, placeholder }),
3157
+ /* @__PURE__ */ jsx58(SelectList, { children: filterOptions.map((item, idx) => /* @__PURE__ */ jsx58(SelectItem, { item, index: idx }, `key_${JSON.stringify(item)}`)) })
3158
+ ] }));
3159
+ };
3160
+
3161
+ // src/inputs/Switch/Switch.tsx
3162
+ import styled45 from "styled-components";
3163
+ import { jsx as jsx59, jsxs as jsxs18 } from "react/jsx-runtime";
3164
+ var Label2 = styled45.label`
3165
+ position: relative;
3166
+ display: inline-flex;
3167
+ align-items: center;
3168
+ cursor: pointer;
3169
+ height: ${({ theme: theme2 }) => theme2.sizes[4]};
3170
+ width: ${({ theme: theme2 }) => theme2.sizes[8]};
3171
+ ${({ disabled }) => disabled && `
3172
+ cursor: not-allowed;
3173
+ opacity: 0.4;
3174
+ `}
3175
+ `;
3176
+ var Button2 = styled45.div`
3177
+ background: ${({ theme: theme2 }) => theme2.colors.background};
3178
+ position: absolute;
3179
+ border-radius: ${({ theme: theme2 }) => theme2.radii[8]};
3180
+ box-shadow: ${({ theme: theme2 }) => theme2.shadows.base[1]};
3181
+ right: 100%;
3182
+ transform: translateX(100%);
3183
+ height: ${({ theme: theme2 }) => theme2.sizes[4]};
3184
+ width: ${({ theme: theme2 }) => theme2.sizes[4]};
3185
+ ${({ checked }) => checked && `
3186
+ right: 0%;
3187
+ transform: translateX(0%);
3188
+ `}
3189
+ ${({ theme: theme2 }) => theme2.transition}
3190
+ `;
3191
+ var Input3 = styled45.input`
3192
+ display: none;
3193
+ `;
3194
+ var Backing = styled45.div`
3195
+ width: 100%;
3196
+ height: ${({ theme: theme2 }) => theme2.sizes[4]};
3197
+ border-radius: ${({ theme: theme2 }) => theme2.radii[8]};
3198
+ position: absolute;
3199
+ background: ${({ theme: theme2 }) => theme2.colors.input};
3200
+ box-shadow: ${({ theme: theme2 }) => theme2.colors.input} 0 0 0 2px;
3201
+ ${({ theme: theme2, checked }) => checked && `
3202
+ background: ${theme2.colors.primary};
3203
+ box-shadow: ${theme2.colors.primary} 0 0 0 2px;
3204
+ `}
3205
+ ${({ theme: theme2 }) => theme2.transition}
3206
+ `;
3207
+ var Switch = (_a) => {
3208
+ var _b = _a, { disabled = false } = _b, rest = __objRest(_b, ["disabled"]);
3209
+ return /* @__PURE__ */ jsxs18(Label2, { disabled, children: [
3210
+ /* @__PURE__ */ jsx59(Input3, __spreadValues({ type: "checkbox", disabled }, rest)),
3211
+ /* @__PURE__ */ jsx59(Backing, __spreadValues({}, rest)),
3212
+ /* @__PURE__ */ jsx59(Button2, __spreadValues({}, rest))
3213
+ ] });
3214
+ };
3215
+
3216
+ // src/inputs/TextArea/TextArea.tsx
3217
+ import styled46 from "styled-components";
3218
+ var TextArea = styled46.textarea`
3219
+ box-shadow: ${({ theme: theme2 }) => theme2.shadows.base[0]};
3220
+ border: ${({ theme: theme2 }) => theme2.borders.border[1]};
3221
+ padding: ${({ theme: theme2 }) => theme2.space[2]};
3222
+ width: 100%;
3223
+ min-height: ${({ theme: theme2 }) => theme2.sizes[16]};
3224
+ background: ${({ theme: theme2 }) => theme2.colors.background};
3225
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes[1]};
3226
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights[1]};
3227
+ border-radius: ${({ theme: theme2 }) => theme2.radii[3]};
3228
+ :focus {
3229
+ outline: 2px solid transparent;
3230
+ outline-offset: 2px;
3231
+ border-color: ${({ theme: theme2 }) => theme2.colors.primary};
3232
+ z-index: 10;
3233
+ }
3234
+ `;
3235
+
3236
+ // src/inputs/InputGroup/InputGroup.tsx
3237
+ import styled47 from "styled-components";
3238
+ import { jsx as jsx60 } from "react/jsx-runtime";
3239
+ var Group = styled47.div`
3240
+ > div {
3241
+ border-radius: 0;
3242
+ position: relative;
3243
+ }
3244
+
3245
+ > div:focus-within {
3246
+ z-index: 20;
3247
+ }
3248
+
3249
+ > :not(div:first-of-type) {
3250
+ margin-top: -1px;
3251
+ }
3252
+
3253
+ div:first-of-type {
3254
+ border-radius: ${({ theme: theme2 }) => `${theme2.radii[3]} ${theme2.radii[3]}`} 0 0 ;
3255
+ }
3256
+ div:last-of-type {
3257
+ border-radius: ${({ theme: theme2 }) => `0 0 ${theme2.radii[3]} ${theme2.radii[3]}`};
3258
+ }
3259
+ `;
3260
+ var InputGroup = ({ children }) => /* @__PURE__ */ jsx60(Group, { children });
3261
+
3262
+ // src/inputs/Upload/UploadZone.tsx
3263
+ import { useCallback as useCallback2 } from "react";
3264
+ import styled51 from "styled-components";
3265
+ import { ArrowUpTrayIcon } from "@heroicons/react/24/outline";
3266
+
3267
+ // src/inputs/Upload/TileItem.tsx
3268
+ import styled49 from "styled-components";
3269
+ import { PhotoIcon, TrashIcon } from "@heroicons/react/24/outline";
3270
+
3271
+ // src/feedback/Tooltip/Tooltip.tsx
3272
+ import { useState as useState15 } from "react";
3273
+ import { usePopper as usePopper3 } from "react-popper";
3274
+ import styled48 from "styled-components";
3275
+ import { Fragment as Fragment9, jsx as jsx61, jsxs as jsxs19 } from "react/jsx-runtime";
3276
+ var Popover = styled48.div`
3277
+ border-radius: ${({ theme: theme2 }) => theme2.radii[2]};
3278
+ box-shadow: ${({ theme: theme2 }) => theme2.shadows.base[0]};
3279
+ border: ${({ theme: theme2 }) => theme2.borders.border[1]};
3280
+ padding: ${({ theme: theme2 }) => `${theme2.space[2]} ${theme2.space[3]}`};
3281
+ z-index: 10;
3282
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes[1]};
3283
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights[1]};
3284
+ background: ${({ theme: theme2 }) => theme2.colors.background};
3285
+ `;
3286
+ var Tooltip = ({
3287
+ tooltip,
3288
+ children,
3289
+ direction = "top",
3290
+ as: Component2 = "div",
3291
+ disabled
3292
+ }) => {
3293
+ let [showTooltip, setTooltip] = useState15(false);
3294
+ let [wrappedRef, setWrappedRef] = useState15(null);
3295
+ let [popperRef, setPopperRef] = useState15(null);
3296
+ let { styles, attributes } = usePopper3(wrappedRef, popperRef, {
3297
+ placement: direction
3298
+ });
3299
+ let handleMouseEnter = () => setTooltip(true);
3300
+ let handleMouseLeave = () => setTooltip(false);
3301
+ return /* @__PURE__ */ jsxs19(Fragment9, { children: [
3302
+ /* @__PURE__ */ jsx61(
3303
+ Component2,
3304
+ {
3305
+ style: { cursor: "pointer" },
3306
+ ref: setWrappedRef,
3307
+ onMouseEnter: handleMouseEnter,
3308
+ onMouseLeave: handleMouseLeave,
3309
+ children
3310
+ }
3311
+ ),
3312
+ !disabled && showTooltip && /* @__PURE__ */ jsx61(Portal, { children: /* @__PURE__ */ jsx61(
3313
+ Popover,
3314
+ __spreadProps(__spreadValues({
3315
+ ref: setPopperRef,
3316
+ style: styles.popper
3317
+ }, attributes.popper), {
3318
+ children: tooltip
3319
+ })
3320
+ ) })
3321
+ ] });
3322
+ };
3323
+
3324
+ // src/inputs/Upload/TileItem.tsx
3325
+ import { jsx as jsx62, jsxs as jsxs20 } from "react/jsx-runtime";
3326
+ var fallback = /* @__PURE__ */ jsx62(
3327
+ Box,
3328
+ {
3329
+ width: "12",
3330
+ height: "12",
3331
+ display: "flex",
3332
+ alignItems: "center",
3333
+ justifyContent: "center",
3334
+ color: "baseHighlight",
3335
+ borderRadius: "2",
3336
+ bg: "background.2",
3337
+ children: /* @__PURE__ */ jsx62(PhotoIcon, { width: 30, height: 30 })
3338
+ }
3339
+ );
3340
+ var DeleteBtn = styled49(ClickableElement)`
3341
+ opacity: ${({ hasError }) => hasError ? 1 : 0};
3342
+ `;
3343
+ var BoxStyled = styled49(Box)`
3344
+ :hover button {
3345
+ opacity: 1;
3346
+ }
3347
+ `;
3348
+ var StyledImage = styled49(ImageComp)`
3349
+ width: ${({ theme: theme2 }) => theme2.sizes[12]};
3350
+ height: ${({ theme: theme2 }) => theme2.sizes[12]};
3351
+ object-fit: cover;
3352
+ border-radius: ${({ theme: theme2 }) => theme2.radii[2]};
3353
+ background: ${({ theme: theme2 }) => theme2.colors.background};
3354
+ `;
3355
+ var TileItem = ({ file, handleDelete }) => {
3356
+ var _a;
3357
+ let { name, bytes, type, extension } = file.meta;
3358
+ let imgSrc = URL.createObjectURL(file.file);
3359
+ let hasError = (((_a = file.errors) == null ? void 0 : _a.length) || 0) > 0;
3360
+ let errorMessage = hasError && file.errors.reduce((acc, curr) => acc += curr.message + " ", "");
3361
+ let meta = [bytes, type, extension].filter(Boolean).join(" - ");
3362
+ return /* @__PURE__ */ jsx62(Tooltip, { disabled: !hasError, as: "li", tooltip: errorMessage, children: /* @__PURE__ */ jsxs20(
3363
+ BoxStyled,
3364
+ {
3365
+ display: "flex",
3366
+ alignItems: "center",
3367
+ p: "2",
3368
+ overflow: "hidden",
3369
+ borderRadius: "3",
3370
+ border: hasError ? "error.1" : "background2.1",
3371
+ color: hasError ? "error" : "base",
3372
+ children: [
3373
+ /* @__PURE__ */ jsx62(StyledImage, { src: imgSrc, fallback }),
3374
+ /* @__PURE__ */ jsxs20(Box, { display: "flex", flexDirection: "column", ml: "2", children: [
3375
+ /* @__PURE__ */ jsx62(Typography, { as: "span", fontWeight: "700", children: name }),
3376
+ /* @__PURE__ */ jsx62(Typography, { fontSize: "0", lineHeight: "0", color: "baseHighlight", children: meta })
3377
+ ] }),
3378
+ /* @__PURE__ */ jsx62(Box, { display: "flex", flexGrow: "1", alignItems: "center", justifyContent: "end", children: /* @__PURE__ */ jsx62(DeleteBtn, { hasError, onClick: () => handleDelete(file.key), children: /* @__PURE__ */ jsx62(TrashIcon, { width: 16, height: 16 }) }) })
3379
+ ]
3380
+ }
3381
+ ) });
3382
+ };
3383
+
3384
+ // src/inputs/Upload/BasicItem.tsx
3385
+ import styled50 from "styled-components";
3386
+ import { PaperClipIcon, TrashIcon as TrashIcon2 } from "@heroicons/react/24/outline";
3387
+ import { jsx as jsx63, jsxs as jsxs21 } from "react/jsx-runtime";
3388
+ var BoxStyled2 = styled50(Box)`
3389
+ :hover button {
3390
+ opacity: 1;
3391
+ }
3392
+ `;
3393
+ var DeleteBtn2 = styled50(ClickableElement)`
3394
+ opacity: ${({ hasError }) => hasError ? 1 : 0};
3395
+ `;
3396
+ var SpacedBox = styled50(Box)`
3397
+ > :not([hidden]) ~ :not([hidden]) {
3398
+ margin-left: ${({ theme: theme2 }) => theme2.space[2]};
3399
+ }
3400
+ `;
3401
+ var BasicItem = ({ file, handleDelete }) => {
3402
+ var _a;
3403
+ let { bytes, name } = file.meta;
3404
+ let hasError = (((_a = file.errors) == null ? void 0 : _a.length) || 0) > 0;
3405
+ let errorMessage = hasError && file.errors.reduce((acc, curr) => acc += curr.message + " ", "");
3406
+ return /* @__PURE__ */ jsx63(Tooltip, { disabled: !hasError, as: "li", tooltip: errorMessage, children: /* @__PURE__ */ jsxs21(
3407
+ BoxStyled2,
3408
+ {
3409
+ display: "flex",
3410
+ alignItems: "center",
3411
+ justifyContent: "space-between",
3412
+ px: "1",
3413
+ borderRadius: "1",
3414
+ color: hasError ? "error" : "base",
3415
+ children: [
3416
+ /* @__PURE__ */ jsxs21(SpacedBox, { display: "flex", alignItems: "center", children: [
3417
+ /* @__PURE__ */ jsx63(PaperClipIcon, { widths: 16, height: 16 }),
3418
+ /* @__PURE__ */ jsx63(Typography, { as: "span", children: name }),
3419
+ !hasError && /* @__PURE__ */ jsx63(Typography, { as: "span", fontSize: 1, lineHeight: 1, children: bytes })
3420
+ ] }),
3421
+ /* @__PURE__ */ jsx63(SpacedBox, { display: "flex", alignItems: "center", children: /* @__PURE__ */ jsx63(DeleteBtn2, { hasError, onClick: () => handleDelete(file.key), children: /* @__PURE__ */ jsx63(TrashIcon2, { width: 16, height: 16 }) }) })
3422
+ ]
3423
+ }
3424
+ ) });
3425
+ };
3426
+
3427
+ // src/inputs/Upload/BaseUploader.tsx
3428
+ import { useEffect as useEffect7, useState as useState16 } from "react";
3429
+ import { useDropzone } from "react-dropzone";
3430
+
3431
+ // src/inputs/Upload/Utils.ts
3432
+ var formatBytes = (bytes, decimals = 2) => {
3433
+ if (bytes == 0) return "0 Bytes";
3434
+ let k = 1024, dm = decimals || 2, sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], i = Math.floor(Math.log(bytes) / Math.log(k));
3435
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
3436
+ };
3437
+ var getMeta = (file, errors) => {
3438
+ let rawType = file.type.split("/");
3439
+ let rawName = file.name.split(".");
3440
+ return {
3441
+ key: file.name,
3442
+ file,
3443
+ errors,
3444
+ meta: {
3445
+ name: file.name,
3446
+ type: rawType[0] || "text",
3447
+ extension: rawType[1] || rawName[1] || "",
3448
+ bytes: formatBytes(file.size)
3449
+ }
3450
+ };
3451
+ };
3452
+
3453
+ // src/inputs/Upload/BaseUploader.tsx
3454
+ import { Fragment as Fragment10, jsx as jsx64, jsxs as jsxs22 } from "react/jsx-runtime";
3455
+ var BaseUploader = ({
3456
+ container: Container13,
3457
+ options = {},
3458
+ renderUploader,
3459
+ filesRender,
3460
+ handleFileUpdate
3461
+ }) => {
3462
+ let [files, setFiles] = useState16([]);
3463
+ let _a = options, { onDrop } = _a, otherOptions = __objRest(_a, ["onDrop"]);
3464
+ let wrappedOnDrop = (acceptedFiles, fileRejections, event) => {
3465
+ onDrop == null ? void 0 : onDrop(acceptedFiles, fileRejections, event);
3466
+ let accepted = acceptedFiles.map((f) => getMeta(f, []));
3467
+ let rejected = fileRejections.map((f) => getMeta(f.file, f.errors));
3468
+ setFiles([...accepted, ...rejected]);
3469
+ };
3470
+ let { getRootProps, getInputProps, isDragActive, open } = useDropzone(__spreadValues({ onDrop: wrappedOnDrop }, otherOptions));
3471
+ let handleDelete = (key) => {
3472
+ setFiles(files.filter((f) => f.key !== key));
3473
+ };
3474
+ useEffect7(() => {
3475
+ handleFileUpdate == null ? void 0 : handleFileUpdate(files);
3476
+ }, [files, handleFileUpdate]);
3477
+ return /* @__PURE__ */ jsxs22(Fragment10, { children: [
3478
+ /* @__PURE__ */ jsxs22(Container13, __spreadProps(__spreadValues({ isDragActive }, getRootProps()), { children: [
3479
+ /* @__PURE__ */ jsx64("input", __spreadValues({}, getInputProps())),
3480
+ renderUploader == null ? void 0 : renderUploader(isDragActive, open)
3481
+ ] })),
3482
+ filesRender == null ? void 0 : filesRender(files, handleDelete)
3483
+ ] });
3484
+ };
3485
+
3486
+ // src/inputs/Upload/UploadZone.tsx
3487
+ import { Fragment as Fragment11, jsx as jsx65, jsxs as jsxs23 } from "react/jsx-runtime";
3488
+ var Container10 = styled51.div`
3489
+ width: 100%;
3490
+ display: flex;
3491
+ flex-direction: column;
3492
+ text-align: center;
3493
+ justify-content: center;
3494
+ align-items: center;
3495
+ cursor: pointer;
3496
+ border-radius: ${({ theme: theme2 }) => theme2.radii[2]};
3497
+ border-color: ${({ theme: theme2 }) => theme2.colors.border};
3498
+ border-width: 4px;
3499
+ border-style: dashed;
3500
+ padding: ${({ theme: theme2 }) => `${theme2.space[5]} ${theme2.space[2]}`};
3501
+
3502
+ > :not([hidden]) ~ :not([hidden]) {
3503
+ margin: ${({ theme: theme2 }) => theme2.space[1]} 0;
3504
+ }
3505
+
3506
+ ${({ isDragActive, theme: theme2 }) => isDragActive && `
3507
+ background: ${theme2.colors.muted};
3508
+ border-color: ${theme2.colors.accent};
3509
+ `}
3510
+ `;
3511
+ var StyledList2 = styled51(List)`
3512
+ margin-top: ${({ theme: theme2 }) => theme2.space[2]};
3513
+ > :not([hidden]) ~ :not([hidden]) {
3514
+ margin-top: ${({ theme: theme2 }) => theme2.space[2]};
3515
+ margin-bottom: ${({ theme: theme2 }) => theme2.space[2]};
3516
+ }
3517
+ :empty {
3518
+ margin: 0px;
3519
+ }
3520
+ `;
3521
+ var TrayIcon = styled51(ArrowUpTrayIcon)`
3522
+ color: ${({ theme: theme2 }) => theme2.colors.foreground};
3523
+ ${({ isDragActive, theme: theme2 }) => isDragActive && `
3524
+ color: ${theme2.colors.foreground};
3525
+ ${theme2.animations.bounce}
3526
+ `}
3527
+ `;
3528
+ var UploadZone = (_a) => {
3529
+ var _b = _a, {
3530
+ showAsTile,
3531
+ filesRender,
3532
+ bottomText = "Support for a single or bulk upload."
3533
+ } = _b, rest = __objRest(_b, [
3534
+ "showAsTile",
3535
+ "filesRender",
3536
+ "bottomText"
3537
+ ]);
3538
+ let Uploader = useCallback2((isDragActive) => /* @__PURE__ */ jsxs23(Fragment11, { children: [
3539
+ /* @__PURE__ */ jsx65(TrayIcon, { width: 30, height: 30, isDragActive }),
3540
+ isDragActive ? /* @__PURE__ */ jsx65(Typography, { fontWeight: "700", color: "base", children: "And drop your file to upload" }) : /* @__PURE__ */ jsxs23(Typography, { children: [
3541
+ "Drag and drop, or ",
3542
+ /* @__PURE__ */ jsx65(Typography, { as: "span", color: "primary", children: "click to find" }),
3543
+ " a file"
3544
+ ] }),
3545
+ /* @__PURE__ */ jsx65(
3546
+ Typography,
3547
+ {
3548
+ fontSize: "1",
3549
+ lineHeight: "1",
3550
+ color: isDragActive ? "baseAccent" : "baseHighlight",
3551
+ children: bottomText
3552
+ }
3553
+ )
3554
+ ] }), [bottomText]);
3555
+ let defaultRender = useCallback2((files, handleDelete) => /* @__PURE__ */ jsx65(StyledList2, { children: files.map((file) => showAsTile ? /* @__PURE__ */ jsx65(TileItem, { file, handleDelete }, file.key) : /* @__PURE__ */ jsx65(BasicItem, { file, handleDelete }, file.key)) }), [showAsTile]);
3556
+ return /* @__PURE__ */ jsx65(
3557
+ BaseUploader,
3558
+ __spreadProps(__spreadValues({}, rest), {
3559
+ container: Container10,
3560
+ renderUploader: Uploader,
3561
+ filesRender: filesRender || defaultRender
3562
+ })
3563
+ );
3564
+ };
3565
+
3566
+ // src/inputs/Upload/UploadButton.tsx
3567
+ import { useCallback as useCallback3 } from "react";
3568
+ import { ArrowUpTrayIcon as ArrowUpTrayIcon2 } from "@heroicons/react/24/outline";
3569
+ import styled52 from "styled-components";
3570
+ import { jsx as jsx66, jsxs as jsxs24 } from "react/jsx-runtime";
3571
+ var StyledList3 = styled52(List)`
3572
+ margin-top: ${({ theme: theme2 }) => theme2.space[2]};
3573
+ > :not([hidden]) ~ :not([hidden]) {
3574
+ margin-top: ${({ theme: theme2 }) => theme2.space[2]};
3575
+ margin-bottom: ${({ theme: theme2 }) => theme2.space[2]};
3576
+ }
3577
+ :empty {
3578
+ margin: 0px;
3579
+ }
3580
+ `;
3581
+ var UploadButton = (_a) => {
3582
+ var _b = _a, {
3583
+ buttonText = "Upload file"
3584
+ } = _b, rest = __objRest(_b, [
3585
+ "buttonText"
3586
+ ]);
3587
+ let Uploader = useCallback3((_, open) => /* @__PURE__ */ jsxs24(OutlineButton, { onClick: open, children: [
3588
+ /* @__PURE__ */ jsx66(ArrowUpTrayIcon2, { width: 16, height: 16 }),
3589
+ /* @__PURE__ */ jsx66("span", { children: buttonText })
3590
+ ] }), [buttonText]);
3591
+ let defaultRender = useCallback3((files, handleDelete) => /* @__PURE__ */ jsx66(StyledList3, { children: files.map((file) => /* @__PURE__ */ jsx66(BasicItem, { file, handleDelete }, file.key)) }), []);
3592
+ return /* @__PURE__ */ jsx66(
3593
+ BaseUploader,
3594
+ __spreadProps(__spreadValues({
3595
+ container: (_a2) => {
3596
+ var params = __objRest(_a2, []);
3597
+ return /* @__PURE__ */ jsx66("div", __spreadValues({}, params));
3598
+ }
3599
+ }, rest), {
3600
+ options: {
3601
+ noClick: true,
3602
+ noKeyboard: true
3603
+ },
3604
+ renderUploader: Uploader,
3605
+ filesRender: defaultRender
3606
+ })
3607
+ );
3608
+ };
3609
+
3610
+ // src/inputs/WithLabel/Label.tsx
3611
+ import { jsx as jsx67, jsxs as jsxs25 } from "react/jsx-runtime";
3612
+ var Label3 = ({ value, children, error }) => {
3613
+ let isRequired = children.props.required;
3614
+ return /* @__PURE__ */ jsxs25(Box, { as: "label", display: "block", children: [
3615
+ /* @__PURE__ */ jsxs25(Box, { color: error ? "destructive" : "inherit", display: "flex", fontSize: "1", lineHeight: "1", mt: "4", mb: "1", children: [
3616
+ value,
3617
+ " ",
3618
+ isRequired && /* @__PURE__ */ jsx67(Typography, { children: "*" })
3619
+ ] }),
3620
+ children
3621
+ ] });
3622
+ };
3623
+
3624
+ // src/utils/Theme/ThemeToggle.tsx
3625
+ import { jsx as jsx68, jsxs as jsxs26 } from "react/jsx-runtime";
3626
+ var ThemeSwitch = () => {
3627
+ let { theme: theme2, toggleTheme } = useMuffledSettings();
3628
+ return /* @__PURE__ */ jsxs26(Box, { display: "flex", alignSelf: "center", width: "120px", justifyContent: "space-between", borderRadius: "8", border: "border.1", px: "3", py: "3", bg: "background", children: [
3629
+ /* @__PURE__ */ jsx68(SunIcon, { width: "16px" }),
3630
+ /* @__PURE__ */ jsx68(Switch, { checked: theme2 === "Dark", onChange: toggleTheme }),
3631
+ /* @__PURE__ */ jsx68(MoonIcon, { width: "16px" })
3632
+ ] });
3633
+ };
3634
+ var ThemeButton = () => {
3635
+ let { theme: theme2, toggleTheme } = useMuffledSettings();
3636
+ return /* @__PURE__ */ jsxs26(OutlineButton, { onClick: toggleTheme, children: [
3637
+ theme2 === "Dark" && /* @__PURE__ */ jsx68(SunIcon, { width: "16px" }),
3638
+ theme2 === "Light" && /* @__PURE__ */ jsx68(MoonIcon, { width: "16px" })
3639
+ ] });
3640
+ };
3641
+
3642
+ // src/feedback/Code/SyntaxHighlighter.tsx
3643
+ import { jsx as jsx69 } from "react/jsx-runtime";
3644
+ var SyntaxHighlighter = ({
3645
+ language,
3646
+ code,
3647
+ withWrapper = true
3648
+ }) => {
3649
+ let { theme: theme2 } = useMuffledSettings();
3650
+ return /* @__PURE__ */ jsx69(Wrapper, { skip: !withWrapper, children: /* @__PURE__ */ jsx69(SH, { language, style: theme2 === "Light" ? githubLight : githubDark, children: code }) });
3651
+ };
3652
+
3653
+ // src/feedback/Loader/CircleLoader.tsx
3654
+ import styled53 from "styled-components";
3655
+ import { jsx as jsx70, jsxs as jsxs27 } from "react/jsx-runtime";
3656
+ var Svg = styled53.svg`
3657
+ ${({ theme: theme2 }) => theme2.animations.spin};
3658
+ stroke: currentColor;
3659
+ `;
3660
+ var OuterCircle = styled53.circle`
3661
+ color: ${({ theme: theme2 }) => theme2.colors.muted};
3662
+ `;
3663
+ var InnerCircle = styled53.circle`
3664
+ color: ${({ theme: theme2, destructive }) => destructive ? theme2.colors.destructive : theme2.colors.primary};
3665
+ `;
3666
+ var CircleLoader = (_a) => {
3667
+ var _b = _a, { height = 50, width = 50, destructive = false } = _b, rest = __objRest(_b, ["height", "width", "destructive"]);
3668
+ return /* @__PURE__ */ jsxs27(Svg, __spreadProps(__spreadValues({ viewBox: "25 25 50 50", height, width }, rest), { children: [
3669
+ /* @__PURE__ */ jsx70(OuterCircle, { cx: "50", cy: "50", r: "20", fill: "none", strokeWidth: "4" }),
3670
+ /* @__PURE__ */ jsx70(InnerCircle, { destructive, cx: "50", cy: "50", r: "20", fill: "none", strokeWidth: "4", strokeDashoffset: "-50", strokeDasharray: "60", strokeLinecap: "round" })
3671
+ ] }));
3672
+ };
3673
+
3674
+ // src/feedback/Loader/LinearLoader.tsx
3675
+ import styled54 from "styled-components";
3676
+ import { jsx as jsx71, jsxs as jsxs28 } from "react/jsx-runtime";
3677
+ var OuterLine = styled54.div`
3678
+ border-radius: ${({ theme: theme2 }) => theme2.radii[2]};
3679
+ width: 100%;
3680
+ height: 100%;
3681
+ position: absolute;
3682
+ top: 0px;
3683
+ right: 0px;
3684
+ bottom: 0px;
3685
+ left: 0px;
3686
+ background: ${({ theme: theme2 }) => theme2.colors.muted};
3687
+ `;
3688
+ var InnerLine = styled54.div`
3689
+ border-radius: ${({ theme: theme2 }) => theme2.radii[2]};
3690
+ background: ${({ theme: theme2, destructive }) => destructive ? theme2.colors.destructive : theme2.colors.primary};
3691
+ `;
3692
+ var StyledLinearSlider = styled54(LinearSlide)`
3693
+ width: 33.333333%;
3694
+ height: 100%;
3695
+ position: absolute;
3696
+ top: 0px;
3697
+ right: 0px;
3698
+ bottom: 0px;
3699
+ left: 0px;
3700
+ `;
3701
+ var LinearLoader = ({ height = 5, destructive = false }) => /* @__PURE__ */ jsxs28(Box, { overflow: "hidden", width: "100%", position: "relative", borderRadius: "8", style: { height }, children: [
3702
+ /* @__PURE__ */ jsx71(OuterLine, {}),
3703
+ /* @__PURE__ */ jsx71(StyledLinearSlider, { children: /* @__PURE__ */ jsx71(InnerLine, { destructive, style: { height } }) })
3704
+ ] });
3705
+
3706
+ // src/feedback/Modal/Modal.tsx
3707
+ import { useState as useState17 } from "react";
3708
+ import { XMarkIcon as XMarkIcon2 } from "@heroicons/react/24/outline";
3709
+ import { jsx as jsx72, jsxs as jsxs29 } from "react/jsx-runtime";
3710
+ var Header = ({ children, handleClose }) => /* @__PURE__ */ jsxs29(Box, { display: "inline-flex", pr: "2", pl: "4", pt: "3", alignItems: "center", width: "100%", justifyContent: "space-between", children: [
3711
+ /* @__PURE__ */ jsx72(Title, { as: "h3", children }),
3712
+ /* @__PURE__ */ jsx72(ClickableElement, { px: 3, py: 2, ml: 5, onClick: handleClose, children: /* @__PURE__ */ jsx72(XMarkIcon2, { width: 20, height: 20 }) })
3713
+ ] });
3714
+ var Modal = ({ handleClose, title, children, open }) => {
3715
+ let [isOpen, setOpen] = useState17(false);
3716
+ if (!open) {
3717
+ return null;
3718
+ }
3719
+ return /* @__PURE__ */ jsx72(Backdrop, { onClick: () => setOpen(!isOpen), onDestroyed: handleClose, children: /* @__PURE__ */ jsxs29(Panel, { minWidth: "200px", onClick: stopPropagation, children: [
3720
+ title && /* @__PURE__ */ jsx72(Header, { handleClose, children: title }),
3721
+ children
3722
+ ] }) });
3723
+ };
3724
+
3725
+ // src/feedback/Progress/CircleProgress.tsx
3726
+ import styled55 from "styled-components";
3727
+ import { jsx as jsx73, jsxs as jsxs30 } from "react/jsx-runtime";
3728
+ var Svg2 = styled55.svg`
3729
+ stroke: currentColor;
3730
+ transform: rotate(-90deg);
3731
+ `;
3732
+ var OuterCircle2 = styled55.circle`
3733
+ color: ${({ theme: theme2 }) => theme2.colors.muted};
3734
+ `;
3735
+ var InnerCircle2 = styled55.circle`
3736
+ color: ${({ theme: theme2 }) => theme2.colors.foreground};
3737
+ `;
3738
+ var CircleProgress = ({ height = 50, width = 50, percentage = 0 }) => {
3739
+ let circumference = 2 * Math.PI * ((50 - 4) / 2);
3740
+ let strokeDasharray = circumference.toFixed(3);
3741
+ let strokeDashoffset = `${((100 - percentage) / 100 * circumference).toFixed(3)}px`;
3742
+ return /* @__PURE__ */ jsxs30(Svg2, { viewBox: "25 25 50 50", height, width, children: [
3743
+ /* @__PURE__ */ jsx73(OuterCircle2, { cx: "50", cy: "50", r: "23", fill: "none", strokeWidth: "4" }),
3744
+ /* @__PURE__ */ jsx73(
3745
+ InnerCircle2,
3746
+ {
3747
+ cx: "50",
3748
+ cy: "50",
3749
+ r: "23",
3750
+ fill: "none",
3751
+ strokeWidth: "4",
3752
+ strokeLinecap: "round",
3753
+ strokeDashoffset,
3754
+ strokeDasharray
3755
+ }
3756
+ )
3757
+ ] });
3758
+ };
3759
+
3760
+ // src/feedback/Progress/LinearProgress.tsx
3761
+ import styled56 from "styled-components";
3762
+ import { jsx as jsx74, jsxs as jsxs31 } from "react/jsx-runtime";
3763
+ var OuterLine2 = styled56.div`
3764
+ border-radius: ${({ theme: theme2 }) => theme2.radii[8]};
3765
+ width: 100%;
3766
+ height: 100%;
3767
+ position: absolute;
3768
+ top: 0px;
3769
+ right: 0px;
3770
+ bottom: 0px;
3771
+ left: 0px;
3772
+ background: ${({ theme: theme2 }) => theme2.colors.muted};
3773
+ `;
3774
+ var InnerLine2 = styled56.div`
3775
+ border-radius: ${({ theme: theme2 }) => theme2.radii[2]};
3776
+ height: 100%;
3777
+ width: ${({ percentage }) => percentage}%;
3778
+ position: absolute;
3779
+ top: 0px;
3780
+ right: 0px;
3781
+ bottom: 0px;
3782
+ left: 0px;
3783
+ background: ${({ theme: theme2 }) => theme2.colors.foreground};
3784
+ `;
3785
+ var LinearProgress = ({ height = 5, percentage = 0 }) => /* @__PURE__ */ jsxs31(Box, { overflow: "hidden", width: "100%", position: "relative", borderRadius: "8", style: { height }, children: [
3786
+ /* @__PURE__ */ jsx74(OuterLine2, {}),
3787
+ /* @__PURE__ */ jsx74(InnerLine2, { percentage })
3788
+ ] });
3789
+
3790
+ // src/feedback/Skeleton/Skeleton.tsx
3791
+ import styled57 from "styled-components";
3792
+ import { rgba } from "polished";
3793
+ import { layout as layout7, space as space6, variant as variant2 } from "styled-system";
3794
+ import { jsx as jsx75 } from "react/jsx-runtime";
3795
+ var Comp = styled57.div`
3796
+ ${({ theme: theme2 }) => theme2.animations.pulse}
3797
+ background: ${({ theme: theme2 }) => rgba(theme2.colors.primary, 0.1)};
3798
+ ${layout7}
3799
+ ${space6}
3800
+ ${({ theme: theme2, height, width }) => variant2({
3801
+ prop: "variant",
3802
+ variants: {
3803
+ circle: {
3804
+ borderRadius: theme2.radii[8],
3805
+ height: height + "px",
3806
+ width: width + "px"
3807
+ },
3808
+ rectangle: {
3809
+ borderRadius: theme2.radii[3],
3810
+ height: height + "px",
3811
+ width: width + "px"
3812
+ },
3813
+ text: {
3814
+ display: "inline-flex",
3815
+ borderRadius: theme2.radii[3]
3816
+ }
3817
+ }
3818
+ })}
3819
+ `;
3820
+ var Skeleton = (_a) => {
3821
+ var rest = __objRest(_a, []);
3822
+ return /* @__PURE__ */ jsx75(Comp, __spreadProps(__spreadValues({}, rest), { children: "\xA0" }));
3823
+ };
3824
+
3825
+ // src/feedback/Snackbar/SnackbarProvider.tsx
3826
+ import { useState as useState19, useEffect as useEffect9 } from "react";
3827
+ import styled59 from "styled-components";
3828
+
3829
+ // src/feedback/Snackbar/SnackbarContext.tsx
3830
+ import { useContext as useContext3, createContext as createContext3 } from "react";
3831
+ var SnackbarContext = createContext3(void 0);
3832
+ var useSnackbar = () => {
3833
+ let context = useContext3(SnackbarContext);
3834
+ if (context === void 0) {
3835
+ throw new Error("useSnackbarCtx must be used within a SnackbarContext provider");
3836
+ }
3837
+ return context;
3838
+ };
3839
+
3840
+ // src/feedback/Snackbar/SnackbarItem.tsx
3841
+ import { useEffect as useEffect8, useState as useState18 } from "react";
3842
+ import styled58 from "styled-components";
3843
+ import { jsx as jsx76 } from "react/jsx-runtime";
3844
+ var StyledAlert = styled58(Alert)`
3845
+ margin: ${({ theme: theme2 }) => `${theme2.space[1]} ${theme2.space[4]}`};
3846
+ `;
3847
+ var SnackbarItem = (_a) => {
3848
+ var _b = _a, {
3849
+ body,
3850
+ handleClose,
3851
+ duration,
3852
+ title,
3853
+ persist
3854
+ } = _b, rest = __objRest(_b, [
3855
+ "body",
3856
+ "handleClose",
3857
+ "duration",
3858
+ "title",
3859
+ "persist"
3860
+ ]);
3861
+ let [open, setOpen] = useState18(true);
3862
+ useEffect8(() => {
3863
+ if (persist) {
3864
+ return;
3865
+ }
3866
+ let timeout = setTimeout(() => {
3867
+ setOpen(false);
3868
+ }, duration);
3869
+ return () => clearTimeout(timeout);
3870
+ }, [duration, persist]);
3871
+ return /* @__PURE__ */ jsx76(Slide, { inProp: open, onDestroyed: handleClose, children: /* @__PURE__ */ jsx76(
3872
+ StyledAlert,
3873
+ __spreadProps(__spreadValues({
3874
+ withClose: () => setOpen(false),
3875
+ title
3876
+ }, rest), {
3877
+ children: body
3878
+ })
3879
+ ) });
3880
+ };
3881
+
3882
+ // src/feedback/Snackbar/utils.ts
3883
+ var createId = () => {
3884
+ return Math.random().toString(36).substr(2, 9);
3885
+ };
3886
+ var getPosition2 = (position4) => {
3887
+ switch (position4) {
3888
+ case "NE":
3889
+ return `
3890
+ top: 0;
3891
+ right: 0;
3892
+ flex-direction: column;
3893
+ `;
3894
+ case "NW":
3895
+ return `
3896
+ top: 0;
3897
+ left: 0;
3898
+ flex-direction: column;
3899
+ `;
3900
+ case "SE":
3901
+ return `
3902
+ right: 0;
3903
+ bottom: 0;
3904
+ flex-direction: column-reverse;
3905
+ `;
3906
+ case "SW":
3907
+ return `
3908
+ left: 0;
3909
+ bottom: 0;
3910
+ flex-direction: column-reverse;
3911
+ `;
3912
+ }
3913
+ };
3914
+
3915
+ // src/feedback/Snackbar/SnackbarProvider.tsx
3916
+ import { jsx as jsx77, jsxs as jsxs32 } from "react/jsx-runtime";
3917
+ var Container11 = styled59.div`
3918
+ position: fixed;
3919
+ display: flex;
3920
+ z-index: 50;
3921
+ margin-bottom: ${({ theme: theme2 }) => theme2.space[1]};
3922
+ margin-top: ${({ theme: theme2 }) => theme2.space[1]};
3923
+ ${({ anchor }) => getPosition2(anchor)}
3924
+ `;
3925
+ var SnackbarProvider = ({
3926
+ anchor = "NE",
3927
+ children,
3928
+ max = 3,
3929
+ autoHideDuration = 5e3,
3930
+ portalLocation
3931
+ }) => {
3932
+ let [items, setItems] = useState19([]);
3933
+ let [queue, setQueue] = useState19([]);
3934
+ useEffect9(() => {
3935
+ if (queue.length <= 0) {
3936
+ return;
3937
+ }
3938
+ if (items.length < max) {
3939
+ let temp = queue;
3940
+ let item = temp.shift();
3941
+ setItems([...items, item]);
3942
+ setQueue(temp);
3943
+ }
3944
+ }, [items, queue, max]);
3945
+ let enqueue = (message, options) => {
3946
+ let item = __spreadProps(__spreadValues({
3947
+ title: message
3948
+ }, options), {
3949
+ id: (options == null ? void 0 : options.id) || createId()
3950
+ });
3951
+ if (items.length < max) {
3952
+ setItems([...items, item]);
3953
+ } else {
3954
+ setQueue([...queue, item]);
3955
+ }
3956
+ };
3957
+ let dequeue = (id) => {
3958
+ setItems([...items.filter((i) => i.id !== id)]);
3959
+ setQueue([...queue.filter((i) => i.id !== id)]);
3960
+ };
3961
+ let clearAll = () => {
3962
+ setItems([]);
3963
+ setQueue([]);
3964
+ };
3965
+ return /* @__PURE__ */ jsxs32(SnackbarContext.Provider, { value: {
3966
+ enqueue,
3967
+ dequeue,
3968
+ clearAll
3969
+ }, children: [
3970
+ /* @__PURE__ */ jsx77(Portal, { element: portalLocation, children: /* @__PURE__ */ jsx77(Container11, { anchor, children: items.map((_a) => {
3971
+ var _b = _a, { id, duration } = _b, rest = __objRest(_b, ["id", "duration"]);
3972
+ return /* @__PURE__ */ jsx77(
3973
+ SnackbarItem,
3974
+ __spreadValues({
3975
+ duration: duration || autoHideDuration,
3976
+ handleClose: () => dequeue(id)
3977
+ }, rest),
3978
+ id
3979
+ );
3980
+ }) }) }),
3981
+ children
3982
+ ] });
3983
+ };
3984
+
3985
+ // src/layout/CenteredWidget/CenteredWidget.tsx
3986
+ import styled60 from "styled-components";
3987
+ import { jsx as jsx78 } from "react/jsx-runtime";
3988
+ var CenteredDiv = styled60(Box)`
3989
+ margin: 0 auto;
3990
+ width: 36rem;
3991
+ `;
3992
+ var CenteredWidget = (_a) => {
3993
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
3994
+ return /* @__PURE__ */ jsx78(Box, { display: "flex", alignItems: "center", justifyItems: "center", height: "100vh", children: /* @__PURE__ */ jsx78(CenteredDiv, __spreadProps(__spreadValues({}, rest), { children })) });
3995
+ };
3996
+
3997
+ // src/layout/TwoColumns/TwoColumns.tsx
3998
+ import { jsxs as jsxs33 } from "react/jsx-runtime";
3999
+ var TwoColumns = ({ children, sideNav }) => /* @__PURE__ */ jsxs33(
4000
+ Box,
4001
+ {
4002
+ height: "100%",
4003
+ "m-width": "0",
4004
+ display: { md: "grid" },
4005
+ gridTemplateColumns: { md: "19.5rem auto" },
4006
+ gridAutoFlow: { md: "row" },
4007
+ children: [
4008
+ sideNav,
4009
+ children
4010
+ ]
4011
+ }
4012
+ );
4013
+
4014
+ // src/layout/ThreeColumns/ThreeColumns.tsx
4015
+ import { jsx as jsx79, jsxs as jsxs34 } from "react/jsx-runtime";
4016
+ var ThreeColumns = ({
4017
+ children,
4018
+ sideNav,
4019
+ mainNav
4020
+ }) => /* @__PURE__ */ jsx79(TwoColumns, { sideNav, children: /* @__PURE__ */ jsxs34(
4021
+ Box,
4022
+ {
4023
+ height: "100%",
4024
+ minWidth: "0",
4025
+ display: { md: "grid" },
4026
+ gridTemplateColumns: { md: "19.5rem auto" },
4027
+ gridAutoFlow: { md: "row" },
4028
+ children: [
4029
+ mainNav,
4030
+ children
4031
+ ]
4032
+ }
4033
+ ) });
4034
+
4035
+ // src/navigation/Breadcrumbs/Breadcrumbs.tsx
4036
+ import { useState as useState20, Children } from "react";
4037
+ import { EllipsisHorizontalIcon as EllipsisHorizontalIcon2 } from "@heroicons/react/24/outline";
4038
+
4039
+ // src/navigation/Breadcrumbs/Item.tsx
4040
+ import { jsx as jsx80, jsxs as jsxs35 } from "react/jsx-runtime";
4041
+ var Item2 = ({
4042
+ item,
4043
+ isLastItem = false,
4044
+ dividerIcon
4045
+ }) => {
4046
+ return /* @__PURE__ */ jsxs35(Box, { display: "inline-flex", alignItems: "center", color: isLastItem ? "inherit" : "mutedForeground", children: [
4047
+ item,
4048
+ !isLastItem && /* @__PURE__ */ jsx80(Box, { mx: "2", display: "inline-block", children: dividerIcon })
4049
+ ] });
4050
+ };
4051
+
4052
+ // src/navigation/Breadcrumbs/Breadcrumbs.tsx
4053
+ import { jsx as jsx81, jsxs as jsxs36 } from "react/jsx-runtime";
4054
+ var Breadcrumbs = ({
4055
+ children,
4056
+ maxItems = 8,
4057
+ itemsBefore = 1,
4058
+ itemsAfter = 1,
4059
+ dividerIcon = /* @__PURE__ */ jsx81("div", { children: "/" })
4060
+ }) => {
4061
+ let [showAll, setShow] = useState20(false);
4062
+ let items = Children.toArray(children);
4063
+ if (items.length <= maxItems) {
4064
+ return /* @__PURE__ */ jsx81("div", { children: items.map((c, idx) => /* @__PURE__ */ jsx81(Item2, { item: c, isLastItem: idx === items.length - 1, dividerIcon }, idx)) });
4065
+ }
4066
+ let beforeItems = items.slice(0, itemsBefore);
4067
+ let middleItems = items.slice(itemsBefore, -itemsAfter);
4068
+ let afterItems = items.slice(-itemsAfter);
4069
+ return /* @__PURE__ */ jsxs36(Box, { display: "flex", alignItems: "center", children: [
4070
+ beforeItems.map((c, idx) => /* @__PURE__ */ jsx81(Item2, { item: c, dividerIcon }, idx)),
4071
+ showAll ? middleItems.map((c, idx) => /* @__PURE__ */ jsx81(Item2, { item: c, dividerIcon }, idx)) : /* @__PURE__ */ jsxs36(Box, { display: "inline-flex", alignItems: "center", children: [
4072
+ /* @__PURE__ */ jsx81(ClickableElement, { onClick: () => setShow(true), children: /* @__PURE__ */ jsx81(EllipsisHorizontalIcon2, { height: 16, width: 16 }) }),
4073
+ /* @__PURE__ */ jsx81(Box, { display: "inline-block", color: "baseHighlight", mx: "2", children: dividerIcon })
4074
+ ] }),
4075
+ afterItems.map((c, idx) => /* @__PURE__ */ jsx81(Item2, { item: c, isLastItem: idx === afterItems.length - 1, dividerIcon }, idx))
4076
+ ] });
4077
+ };
4078
+
4079
+ // src/navigation/Drawer/Drawer.tsx
4080
+ import { useState as useState21 } from "react";
4081
+ import styled61 from "styled-components";
4082
+ import { jsx as jsx82 } from "react/jsx-runtime";
4083
+ var StyledOpen = styled61(Open)`
4084
+ position: fixed;
4085
+ width: 33.333333%;
4086
+ height: 100vh;
4087
+ top: 0px;
4088
+ ${({ direction }) => direction === "left" ? "left: 0px;" : "right: 0;"}
4089
+ `;
4090
+ var Container12 = styled61.div`
4091
+ width: 100%;
4092
+ height: 100%;
4093
+ background: ${({ theme: theme2 }) => theme2.colors.background};
4094
+ `;
4095
+ var Drawer = ({
4096
+ open,
4097
+ handleClose,
4098
+ direction = "right",
4099
+ children
4100
+ }) => {
4101
+ let [isOpen, setOpen] = useState21(false);
4102
+ if (!open) {
4103
+ return null;
4104
+ }
4105
+ return /* @__PURE__ */ jsx82(Backdrop, { config: { duration: 195 }, onClick: () => setOpen(!isOpen), onDestroyed: handleClose, children: /* @__PURE__ */ jsx82(StyledOpen, { inProp: isOpen, direction, "data-testId": "here", children: /* @__PURE__ */ jsx82(Container12, { onClick: stopPropagation, children }) }) });
4106
+ };
4107
+
4108
+ // src/navigation/Stepper/Stepper.tsx
4109
+ import styled62 from "styled-components";
4110
+
4111
+ // src/navigation/Stepper/StepperContext.ts
4112
+ import { useContext as useContext4, createContext as createContext4 } from "react";
4113
+ var StepperContext = createContext4(void 0);
4114
+ var useStepperContext = () => {
4115
+ let context = useContext4(StepperContext);
4116
+ if (context === void 0) {
4117
+ throw new Error("useStepperContext must be used within a StepperContext provider");
4118
+ }
4119
+ return context;
4120
+ };
4121
+
4122
+ // src/navigation/Stepper/Stepper.tsx
4123
+ import { Children as Children2, isValidElement, cloneElement as cloneElement2 } from "react";
4124
+ import { jsx as jsx83 } from "react/jsx-runtime";
4125
+ var parseChildren = (children, step) => {
4126
+ return Children2.toArray(children).map((node, idx) => {
4127
+ if (!isValidElement(node)) {
4128
+ return null;
4129
+ }
4130
+ let completed = step > idx && "completed";
4131
+ let active = step === idx && "active";
4132
+ return __spreadProps(__spreadValues({
4133
+ state: completed || active || "default",
4134
+ idx
4135
+ }, node.props), {
4136
+ node
4137
+ });
4138
+ });
4139
+ };
4140
+ var StyledDiv2 = styled62.div`
4141
+ display: flex;
4142
+ postion: relative;
4143
+ ${({ direction }) => direction === "vertical" && `
4144
+ flex-direction: column;
4145
+ height: 100%;
4146
+ alignItems: flex-start;
4147
+ `}
4148
+ `;
4149
+ var Stepper = (_a) => {
4150
+ var _b = _a, {
4151
+ children,
4152
+ direction = "horizontal",
4153
+ step
4154
+ } = _b, rest = __objRest(_b, [
4155
+ "children",
4156
+ "direction",
4157
+ "step"
4158
+ ]);
4159
+ let alternativeLabel = rest.hasOwnProperty("alternativeLabel") ? rest.alternativeLabel : false;
4160
+ let items = parseChildren(children, step);
4161
+ return /* @__PURE__ */ jsx83(StepperContext.Provider, { value: {
4162
+ noOfItems: items.length - 1,
4163
+ activeStep: step,
4164
+ direction,
4165
+ alternativeLabel
4166
+ }, children: /* @__PURE__ */ jsx83(StyledDiv2, { direction, children: items.map((_a2) => {
4167
+ var _b2 = _a2, { node } = _b2, itemRest = __objRest(_b2, ["node"]);
4168
+ return cloneElement2(node, __spreadValues({}, itemRest));
4169
+ }) }) });
4170
+ };
4171
+
4172
+ // src/navigation/Stepper/StepIcon.tsx
4173
+ import styled63 from "styled-components";
4174
+ import { CheckCircleIcon, ExclamationTriangleIcon } from "@heroicons/react/24/outline";
4175
+ import { Fragment as Fragment12, jsx as jsx84, jsxs as jsxs37 } from "react/jsx-runtime";
4176
+ var ErrorComp = styled63(ExclamationTriangleIcon)`
4177
+ width: 24px;
4178
+ height: 24px;
4179
+ color: ${({ theme: theme2 }) => theme2.colors.destructive};
4180
+ `;
4181
+ var DefaultSvg = styled63.svg`
4182
+ width: 30px;
4183
+ height: 30px;
4184
+ color: ${({ theme: theme2 }) => theme2.colors.primary};
4185
+ opacity: ${({ state }) => state === "default" ? "0.6" : "1"};
4186
+ `;
4187
+ var DefaultText = styled63.text`
4188
+ font-weight: 700;
4189
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes[0]};
4190
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights[0]};
4191
+ `;
4192
+ var Checkmark = styled63(CheckCircleIcon)`
4193
+ color: ${({ theme: theme2 }) => theme2.colors.primary};
4194
+ width: 30px;
4195
+ height: 30px;
4196
+ `;
4197
+ var InnerCirle = styled63.circle`
4198
+ color: ${({ theme: theme2 }) => theme2.colors.background};
4199
+ `;
4200
+ var StepIcon = ({
4201
+ state = "default",
4202
+ icon,
4203
+ number,
4204
+ error
4205
+ }) => {
4206
+ if (icon) {
4207
+ return /* @__PURE__ */ jsx84(Fragment12, { children: icon });
4208
+ }
4209
+ if (error) {
4210
+ return /* @__PURE__ */ jsx84(ErrorComp, {});
4211
+ }
4212
+ if (state === "active" || state === "default") {
4213
+ return /* @__PURE__ */ jsxs37(DefaultSvg, { fill: "currentColor", state, children: [
4214
+ /* @__PURE__ */ jsx84("circle", { cx: "50%", cy: "50%", r: "12" }),
4215
+ /* @__PURE__ */ jsx84(InnerCirle, { cx: "50%", cy: "50%", r: "10" }),
4216
+ /* @__PURE__ */ jsx84(DefaultText, { x: "50%", y: "65%", textAnchor: "middle", children: number })
4217
+ ] });
4218
+ }
4219
+ return /* @__PURE__ */ jsx84(Checkmark, {});
4220
+ };
4221
+
4222
+ // src/navigation/Stepper/StepLabel.tsx
4223
+ import styled64 from "styled-components";
4224
+ import { Fragment as Fragment13, jsx as jsx85, jsxs as jsxs38 } from "react/jsx-runtime";
4225
+ var Line = styled64.div`
4226
+ left: calc(-50% + 30px);
4227
+ right: calc(50% + 30px);
4228
+ background: ${({ theme: theme2 }) => theme2.colors.primary};
4229
+ opacity: 0.2;
4230
+ flex: 1 1 auto;
4231
+ width: 1px;
4232
+ ${({ direction }) => direction === "vertical" ? "height: 100%; width: 1px;" : "height: 1px;"}
4233
+ `;
4234
+ var AlternativeLine = styled64.div`
4235
+ left: calc(-50% + 30px);
4236
+ right: calc(50% + 30px);
4237
+ position: absolute;
4238
+ background: ${({ theme: theme2 }) => theme2.colors.primary};
4239
+ opacity: 0.2;
4240
+ top: ${({ theme: theme2 }) => theme2.sizes[3]};
4241
+ flex: 1 1 auto;
4242
+ ${({ direction }) => direction === "vertical" ? "height: 100%;" : "height: 1px;"}
4243
+ `;
4244
+ var Label4 = styled64.div`
4245
+ display: flex;
4246
+ align-items: center;
4247
+ justify-content: center;
4248
+ position: relative;
4249
+ font-size: ${({ theme: theme2 }) => theme2.fontSizes[0]};
4250
+ line-height: ${({ theme: theme2 }) => theme2.lineHeights[0]};
4251
+ ${({ alternativeLabel }) => alternativeLabel ? `
4252
+ flex-direction: column;
4253
+ flex: 1 1 0%;
4254
+ ` : `
4255
+ > :not([hidden]) ~ :not([hidden]) {
4256
+ margin-left: 0.5rem;
4257
+ }
4258
+ `}
4259
+ `;
4260
+ var LineContainer = styled64.div`
4261
+ flex: 1 1 auto;
4262
+ display: flex;
4263
+ width: 1px;
4264
+ align-items: center;
4265
+ margin-left: ${({ theme: theme2 }) => theme2.space[3]};
4266
+ margin-right: ${({ theme: theme2 }) => theme2.space[3]};
4267
+ ${({ direction, theme: theme2 }) => direction === "vertical" && `
4268
+ margin-top: ${theme2.space[3]};
4269
+ margin-bottom: ${theme2.space[3]};
4270
+ `}
4271
+ `;
4272
+ var StepLabel = ({
4273
+ icon,
4274
+ children,
4275
+ idx = 0,
4276
+ state,
4277
+ error
4278
+ }) => {
4279
+ let { direction, alternativeLabel, noOfItems } = useStepperContext();
4280
+ if (alternativeLabel) {
4281
+ return /* @__PURE__ */ jsxs38(Label4, { alternativeLabel, children: [
4282
+ idx !== 0 && /* @__PURE__ */ jsx85(AlternativeLine, { direction }),
4283
+ /* @__PURE__ */ jsx85(StepIcon, { number: idx + 1, icon, state, error }),
4284
+ children
4285
+ ] });
4286
+ }
4287
+ return /* @__PURE__ */ jsxs38(Fragment13, { children: [
4288
+ /* @__PURE__ */ jsxs38(Label4, { alternativeLabel: false, children: [
4289
+ /* @__PURE__ */ jsx85(StepIcon, { number: idx + 1, icon, state, error }),
4290
+ /* @__PURE__ */ jsx85(Typography, { opacity: state === "default" ? "0.6" : "1", children })
4291
+ ] }),
4292
+ idx !== noOfItems && /* @__PURE__ */ jsx85(LineContainer, { direction, children: /* @__PURE__ */ jsx85(Line, { direction }) })
4293
+ ] });
4294
+ };
4295
+
4296
+ // src/navigation/Tabs/Tabs.tsx
4297
+ import { useState as useState22, Children as Children3, isValidElement as isValidElement2 } from "react";
4298
+
4299
+ // src/navigation/Tabs/TabItems.tsx
4300
+ import styled65 from "styled-components";
4301
+ import { jsx as jsx86 } from "react/jsx-runtime";
4302
+ var StyledBtn2 = styled65(ClickableElement)`
4303
+ scroll-snap-align: start;
4304
+ border-radius: ${({ theme: theme2 }) => theme2.radii[2]};
4305
+ margin-right: ${({ theme: theme2 }) => theme2.space[1]};
4306
+ &:last-of-type {
4307
+ margin-right: 0;
4308
+ }
4309
+ :focus {
4310
+ outline: 0;
4311
+ }
4312
+ `;
4313
+ var TabItem = ({ children, selected, onClick }) => /* @__PURE__ */ jsx86(
4314
+ StyledBtn2,
4315
+ {
4316
+ px: "3",
4317
+ py: "1",
4318
+ position: "relative",
4319
+ boxShadow: selected ? "base.1" : "none",
4320
+ bg: selected ? "background" : "transparent",
4321
+ color: selected ? "foreground" : "mutedForeground",
4322
+ onClick,
4323
+ children
4324
+ }
4325
+ );
4326
+ var TabItems = ({ tabs, selected, onChange }) => /* @__PURE__ */ jsx86(Box, { bg: "muted", borderRadius: 4, px: "1", py: "1", display: "inline-flex", border: "muted.1", children: tabs.map(({ tab, key }) => /* @__PURE__ */ jsx86(
4327
+ TabItem,
4328
+ {
4329
+ selected: selected === key,
4330
+ onClick: () => onChange(key),
4331
+ children: tab
4332
+ },
4333
+ key
4334
+ )) });
4335
+
4336
+ // src/navigation/Tabs/TabPane.tsx
4337
+ import { jsx as jsx87 } from "react/jsx-runtime";
4338
+ var TabPane = (_a) => {
4339
+ var _b = _a, { children, selected } = _b, rest = __objRest(_b, ["children", "selected"]);
4340
+ return selected ? /* @__PURE__ */ jsx87(Box, __spreadProps(__spreadValues({ px: "4", py: "5" }, rest), { children })) : null;
4341
+ };
4342
+ var TabPaneList = ({ tabs, selected }) => {
4343
+ return /* @__PURE__ */ jsx87(Box, { children: tabs.map((_a) => {
4344
+ var _b = _a, { key, children } = _b, rest = __objRest(_b, ["key", "children"]);
4345
+ return /* @__PURE__ */ jsx87(
4346
+ TabPane,
4347
+ __spreadProps(__spreadValues({
4348
+ selected: selected === key
4349
+ }, rest), {
4350
+ children
4351
+ }),
4352
+ key
4353
+ );
4354
+ }) });
4355
+ };
4356
+
4357
+ // src/navigation/Tabs/Tabs.tsx
4358
+ import { Fragment as Fragment14, jsx as jsx88, jsxs as jsxs39 } from "react/jsx-runtime";
4359
+ var parseChildrenToTabs = (children) => {
4360
+ return Children3.toArray(children).map((node) => {
4361
+ if (!isValidElement2(node)) {
4362
+ return null;
4363
+ }
4364
+ let key = node.props.value || node.key;
4365
+ return __spreadProps(__spreadValues({
4366
+ key
4367
+ }, node.props), {
4368
+ node
4369
+ });
4370
+ });
4371
+ };
4372
+ var Tabs = ({ children: childrenProp, value }) => {
4373
+ let tabs = parseChildrenToTabs(childrenProp);
4374
+ let [selected, setSelected] = useState22(value || tabs[0].key);
4375
+ return /* @__PURE__ */ jsxs39(Fragment14, { children: [
4376
+ /* @__PURE__ */ jsx88(TabItems, { tabs, selected, onChange: setSelected }),
4377
+ /* @__PURE__ */ jsx88(TabPaneList, { tabs, selected })
4378
+ ] });
4379
+ };
4380
+
4381
+ // src/index.ts
4382
+ __reExport(index_exports, utils_exports);
4383
+ export {
4384
+ Accordion,
4385
+ AccordionDetail,
4386
+ AccordionSummary,
4387
+ Alert,
4388
+ Backdrop,
4389
+ Badge,
4390
+ BasePicker,
4391
+ BaseUploader,
4392
+ Box,
4393
+ Breadcrumbs,
4394
+ Button,
4395
+ ButtonGroup,
4396
+ Card,
4397
+ CardContent,
4398
+ CardMedia,
4399
+ CenteredWidget,
4400
+ Checkbox,
4401
+ Chip,
4402
+ CircleLoader,
4403
+ CircleProgress,
4404
+ ClickOutside,
4405
+ ClickableElement,
4406
+ Collapse,
4407
+ Container5 as Container,
4408
+ DarkTheme,
4409
+ DatePicker,
4410
+ DateRangePicker,
4411
+ DestructiveButton,
4412
+ DetailsGrouping,
4413
+ Drawer,
4414
+ Fade,
4415
+ GlobalStyles,
4416
+ Grow,
4417
+ ImageComp,
4418
+ Input2 as Input,
4419
+ InputGroup,
4420
+ Label3 as Label,
4421
+ LightTheme,
4422
+ LinearLoader,
4423
+ LinearProgress,
4424
+ LinearSlide,
4425
+ List,
4426
+ ListItem,
4427
+ Menu,
4428
+ MenuItem,
4429
+ Modal,
4430
+ MuffledUI,
4431
+ NumberField,
4432
+ Open,
4433
+ OrderedList,
4434
+ OutlineButton,
4435
+ Pagination,
4436
+ Panel,
4437
+ Password,
4438
+ Portal,
4439
+ PrimaryButton,
4440
+ Radio,
4441
+ RadioIcon,
4442
+ Scrollable,
4443
+ SecondaryButton,
4444
+ Select,
4445
+ SelectButton,
4446
+ SelectContext,
4447
+ SelectFilter,
4448
+ SelectItem,
4449
+ SelectList,
4450
+ SettingsContext,
4451
+ SimpleSelect,
4452
+ Skeleton,
4453
+ Slide,
4454
+ SnackbarContext,
4455
+ SnackbarItem,
4456
+ SnackbarProvider,
4457
+ StepIcon,
4458
+ StepLabel,
4459
+ Stepper,
4460
+ StepperContext,
4461
+ Switch,
4462
+ SyntaxHighlighter,
4463
+ TabItem,
4464
+ TabItems,
4465
+ TabPane,
4466
+ TabPaneList,
4467
+ Table,
4468
+ TableBody,
4469
+ TableCell,
4470
+ TableHead,
4471
+ TableRow,
4472
+ Tabs,
4473
+ TextArea,
4474
+ ThemeButton,
4475
+ ThemeSwitch,
4476
+ ThreeColumns,
4477
+ Title,
4478
+ Tooltip,
4479
+ TwoColumns,
4480
+ Typography,
4481
+ UnorderedList,
4482
+ UploadButton,
4483
+ UploadZone,
4484
+ clearInputOnSelectItem,
4485
+ stopPropagation,
4486
+ useMuffledSettings,
4487
+ useSelectContext,
4488
+ useSnackbar,
4489
+ useStepperContext
4490
+ };