@nithish_atum/atum 1.0.1 → 1.0.3

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 CHANGED
@@ -1,14 +1,78 @@
1
- // src/components/Button.tsx
1
+ // src/components/Box.tsx
2
2
  import styled, { css } from "styled-components";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var baseStyle = css`
5
+ display: flex;
6
+ flex-direction: row;
7
+ width: fit-content;
8
+ height: fit-content;
9
+ padding: 1em 1em;
10
+ border: 1px solid lightgray;
11
+ justify-self: center;
12
+ `;
13
+ var variantStyles = {
14
+ default: css`
15
+ transition: none;
16
+ `,
17
+ elevated: css`
18
+ transition: box-shadow 300ms ease;
19
+ &:hover {
20
+ box-shadow: rgba(36, 40, 45, 0.2) 0px 8px 24px;
21
+ }
22
+ `
23
+ };
24
+ var justifyStyles = {
25
+ row: css`
26
+ flex-direction: row;
27
+ `,
28
+ col: css`
29
+ flex-direction: column;
30
+ `
31
+ };
32
+ var gapStyles = {
33
+ xs: css`
34
+ gap: 0.5em;
35
+ `,
36
+ sm: css`
37
+ gap: 1em;
38
+ `,
39
+ md: css`
40
+ gap: 1.5em;
41
+ `,
42
+ lg: css`
43
+ gap: 2.5em;
44
+ `
45
+ };
46
+ var CustomDiv = styled.div`
47
+ ${baseStyle}
48
+ ${({ $flex, $gap, $variant }) => css`
49
+ ${justifyStyles[$flex]}
50
+ ${gapStyles[$gap]}
51
+ ${variantStyles[$variant]}
52
+ `}
53
+ `;
54
+ var Box = ({
55
+ flex = "row",
56
+ gap = "xs",
57
+ variant = "default",
58
+ children,
59
+ ...rest
60
+ }) => {
61
+ return /* @__PURE__ */ jsx(CustomDiv, { $flex: flex, $gap: gap, $variant: variant, ...rest, children });
62
+ };
63
+ var Box_default = Box;
64
+
65
+ // src/components/Button.tsx
66
+ import styled2, { css as css2 } from "styled-components";
67
+ import { jsx as jsx2 } from "react/jsx-runtime";
68
+ var baseStyle2 = css2`
5
69
  padding: 1em;
6
70
  cursor: pointer;
7
71
  font-weight: 600;
8
72
  transistion: all 900ms;
9
73
  `;
10
- var variantStyles = {
11
- primary_solid: css`
74
+ var variantStyles2 = {
75
+ primary_solid: css2`
12
76
  background-color: #2d8eff;
13
77
  color: white;
14
78
  border: 1px solid #2d8eff;
@@ -23,12 +87,12 @@ var variantStyles = {
23
87
  // letter-spacing: 4px;
24
88
  //}
25
89
  `,
26
- primary_outline: css`
90
+ primary_outline: css2`
27
91
  background-color: transparent;
28
92
  color: #2d8eff;
29
93
  border: 1px solid #2d8eff;
30
94
  `,
31
- primary_text: css`
95
+ primary_text: css2`
32
96
  background-color: transparent;
33
97
  color: #2d8eff;
34
98
  border: none;
@@ -39,8 +103,1155 @@ var variantStyles = {
39
103
  // }
40
104
  `
41
105
  };
42
- var StyledButton = styled.button`
43
- ${baseStyle}
44
- ${({ $variant }) => variantStyles[$variant]}
106
+ var StyledButton = styled2.button`
107
+ ${baseStyle2}
108
+ ${({ $variant }) => variantStyles2[$variant]}
109
+ `;
110
+ var Button = ({
111
+ variant = "primary_solid",
112
+ children,
113
+ ...rest
114
+ }) => {
115
+ return /* @__PURE__ */ jsx2(StyledButton, { $variant: variant, ...rest, children });
116
+ };
117
+ var Button_default = Button;
118
+
119
+ // src/components/Card.tsx
120
+ import styled3, { css as css3 } from "styled-components";
121
+ import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
122
+ var baseStyle3 = css3`
123
+ display: flex;
124
+ flex-direction: row;
125
+ width: fit-content;
126
+ height: fit-content;
127
+ background-color: rgb(255, 255, 255);
128
+ padding: 1em 1em;
129
+ border-radius: 0.8em;
130
+ box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
131
+ transition: all 0.9s ease;
132
+ &:hover {
133
+ box-shadow: rgba(36, 40, 45, 0.2) 0px 8px 24px;
134
+ }
135
+ `;
136
+ var justifyStyles2 = {
137
+ row: css3`
138
+ flex-direction: row;
139
+ `,
140
+ col: css3`
141
+ flex-direction: column;
142
+ `
143
+ };
144
+ var gapStyles2 = {
145
+ xs: css3`
146
+ gap: 0.5em;
147
+ `,
148
+ sm: css3`
149
+ gap: 1em;
150
+ `,
151
+ md: css3`
152
+ gap: 1.5em;
153
+ `,
154
+ lg: css3`
155
+ gap: 2.5em;
156
+ `
157
+ };
158
+ var CustomDiv2 = styled3.div`
159
+ ${baseStyle3}
160
+ ${({ $direction, $gap }) => css3`
161
+ ${justifyStyles2[$direction]}
162
+ ${gapStyles2[$gap]}
163
+ `}
164
+ `;
165
+ var Card = ({
166
+ direction = "col",
167
+ gap = "xs",
168
+ Imagealt = "card-image",
169
+ Imageurl = "",
170
+ children,
171
+ ...rest
172
+ }) => {
173
+ return /* @__PURE__ */ jsx3(CustomDiv2, { $direction: direction, $gap: gap, ...rest, children: Imageurl.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
174
+ /* @__PURE__ */ jsx3("div", { style: {
175
+ width: "100%",
176
+ height: "200px",
177
+ backgroundImage: `url(${Imageurl})`,
178
+ backgroundPosition: "center",
179
+ backgroundSize: "cover",
180
+ borderRadius: "12px",
181
+ border: "1px solid #f1f1f1"
182
+ } }),
183
+ children
184
+ ] }) : children });
185
+ };
186
+ var Card_default = Card;
187
+
188
+ // src/components/Checkbox.tsx
189
+ import { useEffect, useRef } from "react";
190
+ import styled4, { css as css4 } from "styled-components";
191
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
192
+ var Wrapper = styled4.label`
193
+ display: inline-flex;
194
+ align-items: center;
195
+ gap: 0.5rem;
196
+ cursor: pointer;
197
+ user-select: none;
198
+ `;
199
+ var HiddenInput = styled4.input.attrs({ type: "checkbox" })`
200
+ position: absolute;
201
+ opacity: 0;
202
+ pointer-events: none;
203
+ `;
204
+ var boxBase = css4`
205
+ width: 16px;
206
+ height: 16px;
207
+ border-radius: 4px;
208
+ border: 1px solid #ccc;
209
+ display: flex;
210
+ align-items: center;
211
+ justify-content: center;
212
+ transition: all 0.15s ease;
213
+ `;
214
+ var Box2 = styled4.span`
215
+ ${boxBase}
216
+ background-color: ${({ $checked }) => $checked ? "#2d8eff" : "#fff"};
217
+ border-color: ${({ $checked }) => $checked ? "#2d8eff" : "#ccc"};
218
+ opacity: ${({ $disabled }) => $disabled ? 0.6 : 1};
219
+
220
+ ${Wrapper}:hover & {
221
+ border-color: #2d8eff;
222
+ }
223
+ `;
224
+ var CheckMark = styled4.span`
225
+ width: 8px;
226
+ height: 8px;
227
+ background: white;
228
+ border-radius: 2px;
229
+ `;
230
+ var Checkbox = ({
231
+ checked = false,
232
+ indeterminate = false,
233
+ disabled = false,
234
+ label,
235
+ ...rest
236
+ }) => {
237
+ const inputRef = useRef(null);
238
+ useEffect(() => {
239
+ if (inputRef.current) {
240
+ inputRef.current.indeterminate = indeterminate;
241
+ }
242
+ }, [indeterminate]);
243
+ return /* @__PURE__ */ jsxs2(Wrapper, { children: [
244
+ /* @__PURE__ */ jsx4(
245
+ HiddenInput,
246
+ {
247
+ ref: inputRef,
248
+ checked,
249
+ disabled,
250
+ ...rest
251
+ }
252
+ ),
253
+ /* @__PURE__ */ jsx4(Box2, { $checked: checked || indeterminate, $disabled: disabled, children: (checked || indeterminate) && /* @__PURE__ */ jsx4(CheckMark, {}) }),
254
+ label && /* @__PURE__ */ jsx4("span", { children: label })
255
+ ] });
256
+ };
257
+ var Checkbox_default = Checkbox;
258
+
259
+ // src/components/DatePicker.tsx
260
+ import { useEffect as useEffect2, useRef as useRef2, useState } from "react";
261
+ import styled5 from "styled-components";
262
+ import { createPortal } from "react-dom";
263
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
264
+ var isSameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
265
+ var getDaysInMonth = (year, month) => new Date(year, month + 1, 0).getDate();
266
+ var formatDate = (date) => date.toISOString().split("T")[0];
267
+ var Wrapper2 = styled5.div`
268
+ position: relative;
269
+ width: 100%;
270
+ `;
271
+ var InputBox = styled5.div`
272
+ border: 1px solid #ccc;
273
+ border-radius: 6px;
274
+ padding: 0.5rem 0.75rem;
275
+ cursor: pointer;
276
+ background: #fff;
45
277
  `;
278
+ var Panel = styled5.div`
279
+ position: absolute;
280
+ top: calc(100% + 6px);
281
+ left: 0;
282
+ background: white;
283
+ border-radius: 8px;
284
+ padding: 0.75rem;
285
+ box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
286
+ z-index: 1000;
287
+ `;
288
+ var Header = styled5.div`
289
+ display: flex;
290
+ justify-content: space-between;
291
+ align-items: center;
292
+ margin-bottom: 0.5rem;
293
+ `;
294
+ var Grid = styled5.div`
295
+ display: grid;
296
+ grid-template-columns: repeat(7, 32px);
297
+ gap: 4px;
298
+ `;
299
+ var Day = styled5.div`
300
+ text-align: center;
301
+ padding: 0.35rem 0;
302
+ border-radius: 4px;
303
+ cursor: pointer;
304
+ background: ${({ $selected }) => $selected ? "#2d8eff" : "transparent"};
305
+ color: ${({ $selected }) => $selected ? "#fff" : "inherit"};
306
+
307
+ &:hover {
308
+ background: #f0f0f0;
309
+ }
310
+ `;
311
+ var DatePicker = ({
312
+ value,
313
+ onChange,
314
+ placeholder = "Select date"
315
+ }) => {
316
+ const [open, setOpen] = useState(false);
317
+ const [current, setCurrent] = useState(
318
+ value || /* @__PURE__ */ new Date()
319
+ );
320
+ const ref = useRef2(null);
321
+ useEffect2(() => {
322
+ const handler = (e) => {
323
+ if (ref.current && !ref.current.contains(e.target)) {
324
+ setOpen(false);
325
+ }
326
+ };
327
+ document.addEventListener("mousedown", handler);
328
+ return () => document.removeEventListener("mousedown", handler);
329
+ }, []);
330
+ const year = current.getFullYear();
331
+ const month = current.getMonth();
332
+ const daysInMonth = getDaysInMonth(year, month);
333
+ const days = Array.from({ length: daysInMonth }, (_, i) => {
334
+ const date = new Date(year, month, i + 1);
335
+ return date;
336
+ });
337
+ return /* @__PURE__ */ jsxs3(Wrapper2, { ref, children: [
338
+ /* @__PURE__ */ jsx5(InputBox, { onClick: () => setOpen(!open), children: value ? formatDate(value) : placeholder }),
339
+ open && createPortal(
340
+ /* @__PURE__ */ jsxs3(Panel, { children: [
341
+ /* @__PURE__ */ jsxs3(Header, { children: [
342
+ /* @__PURE__ */ jsx5(
343
+ "button",
344
+ {
345
+ onClick: () => setCurrent(
346
+ new Date(year, month - 1, 1)
347
+ ),
348
+ children: "\u25C0"
349
+ }
350
+ ),
351
+ /* @__PURE__ */ jsxs3("strong", { children: [
352
+ current.toLocaleString("default", {
353
+ month: "long"
354
+ }),
355
+ " ",
356
+ year
357
+ ] }),
358
+ /* @__PURE__ */ jsx5(
359
+ "button",
360
+ {
361
+ onClick: () => setCurrent(
362
+ new Date(year, month + 1, 1)
363
+ ),
364
+ children: "\u25B6"
365
+ }
366
+ )
367
+ ] }),
368
+ /* @__PURE__ */ jsx5(Grid, { children: days.map((d) => /* @__PURE__ */ jsx5(
369
+ Day,
370
+ {
371
+ $selected: value ? isSameDay(d, value) : false,
372
+ onClick: () => {
373
+ onChange?.(d);
374
+ setOpen(false);
375
+ },
376
+ children: d.getDate()
377
+ },
378
+ d.toISOString()
379
+ )) })
380
+ ] }),
381
+ document.body
382
+ )
383
+ ] });
384
+ };
385
+ var DatePicker_default = DatePicker;
386
+
387
+ // src/components/Divider.tsx
388
+ import styled6, { css as css5 } from "styled-components";
389
+ import { jsx as jsx6 } from "react/jsx-runtime";
390
+ var baseStyle4 = css5`
391
+ background-color: rgba(0, 0, 0, 0.12);
392
+ flex-shrink: 0;
393
+ `;
394
+ var orientationStyles = {
395
+ horizontal: css5`
396
+ width: 100%;
397
+ height: 1px;
398
+ `,
399
+ vertical: css5`
400
+ height: 100%;
401
+ width: 1px;
402
+ `
403
+ };
404
+ var sizeStyles = {
405
+ thin: css5`
406
+ opacity: 0.6;
407
+ `,
408
+ medium: css5`
409
+ opacity: 1;
410
+ `
411
+ };
412
+ var gapStyles3 = {
413
+ xs: css5`
414
+ margin: 0.5rem 0;
415
+ `,
416
+ sm: css5`
417
+ margin: 1rem 0;
418
+ `,
419
+ md: css5`
420
+ margin: 2rem 0;
421
+ `,
422
+ lg: css5`
423
+ margin: 3rem 0;
424
+ `
425
+ };
426
+ var StyledDivider = styled6.div`
427
+ ${baseStyle4}
428
+ ${({ $orientation }) => orientationStyles[$orientation]}
429
+ ${({ $size }) => sizeStyles[$size]}
430
+ ${({ $gap, $orientation }) => $orientation === "horizontal" ? gapStyles3[$gap] : css5`
431
+ margin: 0 ${gapStyles3[$gap].styles?.margin?.split(" ")[0] || "1rem"};
432
+ `}
433
+ `;
434
+ var Divider = ({
435
+ orientation = "horizontal",
436
+ size = "thin",
437
+ gap = "sm",
438
+ ...rest
439
+ }) => {
440
+ return /* @__PURE__ */ jsx6(
441
+ StyledDivider,
442
+ {
443
+ role: "separator",
444
+ $orientation: orientation,
445
+ $size: size,
446
+ $gap: gap,
447
+ ...rest
448
+ }
449
+ );
450
+ };
451
+ var Divider_default = Divider;
452
+
453
+ // src/components/Drawer.tsx
454
+ import { useEffect as useEffect3 } from "react";
455
+ import { createPortal as createPortal2 } from "react-dom";
456
+ import styled7, { css as css6 } from "styled-components";
457
+ import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
458
+ var Overlay = styled7.div`
459
+ position: fixed;
460
+ inset: 0;
461
+ background: rgba(0, 0, 0, 0.45);
462
+ z-index: 1000;
463
+ `;
464
+ var baseDrawer = css6`
465
+ position: fixed;
466
+ background: #fff;
467
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
468
+ z-index: 1001;
469
+ display: flex;
470
+ flex-direction: column;
471
+ `;
472
+ var placementStyles = {
473
+ right: css6`
474
+ top: 0;
475
+ right: 0;
476
+ height: 100%;
477
+ `,
478
+ left: css6`
479
+ top: 0;
480
+ left: 0;
481
+ height: 100%;
482
+ `,
483
+ bottom: css6`
484
+ left: 0;
485
+ bottom: 0;
486
+ width: 100%;
487
+ `
488
+ };
489
+ var DrawerContainer = styled7.div`
490
+ ${baseDrawer}
491
+ ${({ $placement }) => placementStyles[$placement]}
492
+
493
+ ${({ $placement, $width }) => ($placement === "left" || $placement === "right") && css6`
494
+ width: ${typeof $width === "number" ? `${$width}px` : $width || "360px"};
495
+ `}
496
+
497
+ ${({ $placement, $height }) => $placement === "bottom" && css6`
498
+ height: ${typeof $height === "number" ? `${$height}px` : $height || "320px"};
499
+ `}
500
+ `;
501
+ var Header2 = styled7.div`
502
+ display: flex;
503
+ justify-content: flex-end;
504
+ padding: 0.75rem;
505
+ border-bottom: 1px solid #eee;
506
+ `;
507
+ var CloseButton = styled7.button`
508
+ background: none;
509
+ border: none;
510
+ font-size: 1.25rem;
511
+ cursor: pointer;
512
+ `;
513
+ var Drawer = ({
514
+ open,
515
+ onClose,
516
+ placement = "right",
517
+ width,
518
+ height,
519
+ children
520
+ }) => {
521
+ useEffect3(() => {
522
+ if (!open) return;
523
+ const handleKeyDown = (e) => {
524
+ if (e.key === "Escape") {
525
+ onClose?.();
526
+ }
527
+ };
528
+ document.addEventListener("keydown", handleKeyDown);
529
+ return () => document.removeEventListener("keydown", handleKeyDown);
530
+ }, [open, onClose]);
531
+ if (!open) return null;
532
+ return createPortal2(
533
+ /* @__PURE__ */ jsxs4(Fragment2, { children: [
534
+ /* @__PURE__ */ jsx7(Overlay, { onClick: onClose }),
535
+ /* @__PURE__ */ jsxs4(
536
+ DrawerContainer,
537
+ {
538
+ $placement: placement,
539
+ $width: width,
540
+ $height: height,
541
+ children: [
542
+ /* @__PURE__ */ jsx7(Header2, { children: /* @__PURE__ */ jsx7(CloseButton, { onClick: onClose, children: "\xD7" }) }),
543
+ children
544
+ ]
545
+ }
546
+ )
547
+ ] }),
548
+ document.body
549
+ );
550
+ };
551
+ var Drawer_default = Drawer;
552
+
553
+ // src/components/Flex.tsx
554
+ import styled8, { css as css7 } from "styled-components";
555
+ import { jsx as jsx8 } from "react/jsx-runtime";
556
+ var baseStyle5 = css7`
557
+ width: 100%;
558
+ height: 100%;
559
+ display: flex;
560
+ `;
561
+ var FlexDirectionStyle = {
562
+ row: css7`
563
+ flex-direction: row;
564
+ `,
565
+ col: css7`
566
+ flex-direction: column;
567
+ `
568
+ };
569
+ var JustifyStyle = {
570
+ center: css7`
571
+ justify-content: center;
572
+ `,
573
+ between: css7`
574
+ justify-content: space-between;
575
+ `,
576
+ around: css7`
577
+ justify-content: space-around;
578
+ `,
579
+ start: css7`
580
+ justify-content: flex-start;
581
+ `,
582
+ end: css7`
583
+ justify-content: flex-end;
584
+ `,
585
+ even: css7`
586
+ justify-content: space-evenly;
587
+ `
588
+ };
589
+ var AlignStyle = {
590
+ center: css7`
591
+ align-items: center;
592
+ `,
593
+ between: css7`
594
+ align-items: space-between;
595
+ `,
596
+ around: css7`
597
+ align-items: space-around;
598
+ `,
599
+ start: css7`
600
+ align-items: flex-start;
601
+ `,
602
+ end: css7`
603
+ align-items: flex-end;
604
+ `,
605
+ even: css7`
606
+ align-items: space-evenly;
607
+ `
608
+ };
609
+ var GapStyle = {
610
+ small: css7`
611
+ gap: 1em;
612
+ `,
613
+ medium: css7`
614
+ gap: 2em;
615
+ `,
616
+ large: css7`
617
+ gap: 3em;
618
+ `
619
+ };
620
+ var StyledDiv = styled8.div`
621
+ ${baseStyle5}
622
+ ${({ $flexDirection, $gap, $justify, $align }) => css7`
623
+ ${FlexDirectionStyle[$flexDirection]}
624
+ ${GapStyle[$gap]}
625
+ ${AlignStyle[$align]}
626
+ ${JustifyStyle[$justify]}
627
+ `}
628
+ `;
629
+ var Flex = ({
630
+ gap = "small",
631
+ justify = "center",
632
+ align = "center",
633
+ flexDirection = "col",
634
+ children,
635
+ ...rest
636
+ }) => {
637
+ return /* @__PURE__ */ jsx8(StyledDiv, { $gap: gap, $justify: justify, $align: align, $flexDirection: flexDirection, ...rest, children });
638
+ };
639
+ var Flex_default = Flex;
640
+
641
+ // src/components/Form.tsx
642
+ import styled9 from "styled-components";
643
+ import { jsx as jsx9 } from "react/jsx-runtime";
644
+ var StyledForm = styled9.form`
645
+ width: 100%;
646
+ `;
647
+ var Form = ({ children, ...rest }) => {
648
+ return /* @__PURE__ */ jsx9(StyledForm, { ...rest, children });
649
+ };
650
+ var Form_default = Form;
651
+
652
+ // src/components/FormControl.tsx
653
+ import styled10 from "styled-components";
654
+ import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
655
+ var Wrapper3 = styled10.div`
656
+ display: flex;
657
+ flex-direction: column;
658
+ gap: 0.25rem;
659
+ width: 100%;
660
+ `;
661
+ var Label = styled10.label`
662
+ font-size: 0.875rem;
663
+ font-weight: 500;
664
+ color: ${({ $error }) => $error ? "#e53935" : "inherit"};
665
+ `;
666
+ var RequiredMark = styled10.span`
667
+ color: #e53935;
668
+ margin-left: 0.25rem;
669
+ `;
670
+ var Helper = styled10.span`
671
+ font-size: 0.75rem;
672
+ color: #666;
673
+ `;
674
+ var ErrorText = styled10.span`
675
+ font-size: 0.75rem;
676
+ color: #e53935;
677
+ `;
678
+ var FormControl = ({
679
+ label,
680
+ error,
681
+ helperText,
682
+ required = false,
683
+ children
684
+ }) => {
685
+ return /* @__PURE__ */ jsxs5(Wrapper3, { children: [
686
+ label && /* @__PURE__ */ jsxs5(Label, { $error: !!error, children: [
687
+ label,
688
+ required && /* @__PURE__ */ jsx10(RequiredMark, { children: "*" })
689
+ ] }),
690
+ children,
691
+ error ? /* @__PURE__ */ jsx10(ErrorText, { children: error }) : helperText && /* @__PURE__ */ jsx10(Helper, { children: helperText })
692
+ ] });
693
+ };
694
+ var FormControl_default = FormControl;
695
+
696
+ // src/components/Heading.tsx
697
+ import styled11, { css as css9 } from "styled-components";
698
+ import { jsx as jsx11 } from "react/jsx-runtime";
699
+ var levelStyles = {
700
+ 1: css9`font-size: 2rem;`,
701
+ 2: css9`font-size: 1.75rem;`,
702
+ 3: css9`font-size: 1.5rem;`,
703
+ 4: css9`font-size: 1.25rem;`,
704
+ 5: css9`font-size: 1.1rem;`,
705
+ 6: css9`font-size: 1rem;`
706
+ };
707
+ var Base = styled11.div`
708
+ margin: 0;
709
+ font-weight: 600;
710
+ ${({ $level }) => levelStyles[$level]}
711
+ `;
712
+ var Heading = ({
713
+ level = 1,
714
+ children,
715
+ ...rest
716
+ }) => {
717
+ const Tag = `h${level}`;
718
+ return /* @__PURE__ */ jsx11(
719
+ Base,
720
+ {
721
+ as: Tag,
722
+ $level: level,
723
+ ...rest,
724
+ children
725
+ }
726
+ );
727
+ };
728
+ var Heading_default = Heading;
729
+
730
+ // src/components/Input.tsx
731
+ import styled12, { css as css10 } from "styled-components";
732
+ import { jsx as jsx12 } from "react/jsx-runtime";
733
+ var sizeStyles2 = {
734
+ xs: css10`padding: 0.25rem 0.5rem; font-size: 0.75rem;`,
735
+ sm: css10`padding: 0.4rem 0.6rem; font-size: 0.875rem;`,
736
+ md: css10`padding: 0.5rem 0.75rem; font-size: 1rem;`,
737
+ lg: css10`padding: 0.65rem 0.9rem; font-size: 1.1rem;`
738
+ };
739
+ var StyledInput = styled12.input`
740
+ width: 100%;
741
+ border-radius: 6px;
742
+ border: 1px solid
743
+ ${({ $state }) => $state === "error" ? "#e53935" : "#ccc"};
744
+ outline: none;
745
+
746
+ ${({ $inputSize }) => sizeStyles2[$inputSize]}
747
+
748
+ &:focus {
749
+ border-color: #2d8eff;
750
+ }
751
+ `;
752
+ var Input = ({
753
+ inputSize = "md",
754
+ state = "default",
755
+ ...rest
756
+ }) => {
757
+ return /* @__PURE__ */ jsx12(
758
+ StyledInput,
759
+ {
760
+ $inputSize: inputSize,
761
+ $state: state,
762
+ ...rest
763
+ }
764
+ );
765
+ };
766
+ var Input_default = Input;
767
+
768
+ // src/components/Link.tsx
769
+ import styled13, { css as css11 } from "styled-components";
770
+ import { jsx as jsx13 } from "react/jsx-runtime";
771
+ var baseStyle6 = css11`
772
+ color: inherit;
773
+ text-decoration: underline;
774
+ cursor: pointer;
775
+ transition: color 0.2s ease, text-decoration-color 0.2s ease;
776
+
777
+ &:hover {
778
+ text-decoration-thickness: 2px;
779
+ }
780
+
781
+ &:focus-visible {
782
+ outline: 2px solid currentColor;
783
+ outline-offset: 2px;
784
+ }
785
+ `;
786
+ var variantStyles3 = {
787
+ default: css11`
788
+ opacity: 1;
789
+ `,
790
+ muted: css11`
791
+ opacity: 0.7;
792
+
793
+ &:hover {
794
+ opacity: 1;
795
+ }
796
+ `
797
+ };
798
+ var StyledLink = styled13.a`
799
+ ${baseStyle6}
800
+ ${({ $variant }) => variantStyles3[$variant]}
801
+ `;
802
+ var Link = ({
803
+ variant = "default",
804
+ external = false,
805
+ children,
806
+ ...rest
807
+ }) => {
808
+ return /* @__PURE__ */ jsx13(
809
+ StyledLink,
810
+ {
811
+ $variant: variant,
812
+ target: external ? "_blank" : rest.target,
813
+ rel: external ? "noopener noreferrer" : rest.rel,
814
+ ...rest,
815
+ children
816
+ }
817
+ );
818
+ };
819
+ var Link_default = Link;
820
+
821
+ // src/components/Modal.tsx
822
+ import { useEffect as useEffect4 } from "react";
823
+ import { createPortal as createPortal3 } from "react-dom";
824
+ import styled14 from "styled-components";
825
+ import { jsx as jsx14 } from "react/jsx-runtime";
826
+ var Overlay2 = styled14.div`
827
+ position: fixed;
828
+ inset: 0;
829
+ background: rgba(0, 0, 0, 0.45);
830
+ display: flex;
831
+ align-items: center;
832
+ justify-content: center;
833
+ z-index: 1000;
834
+ `;
835
+ var Content = styled14.div`
836
+ background: #fff;
837
+ border-radius: 8px;
838
+ width: 100%;
839
+ max-width: 500px;
840
+ padding: 1.5rem;
841
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
842
+ `;
843
+ var Modal = ({
844
+ open,
845
+ onClose,
846
+ children
847
+ }) => {
848
+ useEffect4(() => {
849
+ if (!open) return;
850
+ const handleKeyDown = (e) => {
851
+ if (e.key === "Escape") {
852
+ onClose?.();
853
+ }
854
+ };
855
+ document.addEventListener("keydown", handleKeyDown);
856
+ return () => document.removeEventListener("keydown", handleKeyDown);
857
+ }, [open, onClose]);
858
+ if (!open) return null;
859
+ return createPortal3(
860
+ /* @__PURE__ */ jsx14(Overlay2, { onClick: onClose, children: /* @__PURE__ */ jsx14(Content, { onClick: (e) => e.stopPropagation(), children }) }),
861
+ document.body
862
+ );
863
+ };
864
+ var Modal_default = Modal;
865
+
866
+ // src/components/Paragraph.tsx
867
+ import styled15 from "styled-components";
868
+ import { jsx as jsx15 } from "react/jsx-runtime";
869
+ var StyledParagraph = styled15.p`
870
+ margin: 0;
871
+ font-size: 1rem;
872
+ line-height: 1.6;
873
+ color: inherit;
874
+ `;
875
+ var Paragraph = ({ children, ...rest }) => {
876
+ return /* @__PURE__ */ jsx15(StyledParagraph, { ...rest, children });
877
+ };
878
+ var Paragraph_default = Paragraph;
879
+
880
+ // src/components/Radio.tsx
881
+ import styled16, { css as css12 } from "styled-components";
882
+ import { jsx as jsx16, jsxs as jsxs6 } from "react/jsx-runtime";
883
+ var Wrapper4 = styled16.label`
884
+ display: inline-flex;
885
+ align-items: center;
886
+ gap: 0.5rem;
887
+ cursor: pointer;
888
+ user-select: none;
889
+ `;
890
+ var HiddenInput2 = styled16.input.attrs({ type: "radio" })`
891
+ position: absolute;
892
+ opacity: 0;
893
+ pointer-events: none;
894
+ `;
895
+ var circleBase = css12`
896
+ width: 16px;
897
+ height: 16px;
898
+ border-radius: 50%;
899
+ border: 2px solid #ccc;
900
+ display: flex;
901
+ align-items: center;
902
+ justify-content: center;
903
+ transition: all 0.15s ease;
904
+ `;
905
+ var Circle = styled16.span`
906
+ ${circleBase}
907
+ border-color: ${({ $checked }) => $checked ? "#2d8eff" : "#ccc"};
908
+ opacity: ${({ $disabled }) => $disabled ? 0.6 : 1};
909
+
910
+ ${Wrapper4}:hover & {
911
+ border-color: #2d8eff;
912
+ }
913
+ `;
914
+ var Dot = styled16.span`
915
+ width: 8px;
916
+ height: 8px;
917
+ background: #2d8eff;
918
+ border-radius: 50%;
919
+ `;
920
+ var Radio = ({
921
+ checked = false,
922
+ disabled = false,
923
+ label,
924
+ ...rest
925
+ }) => {
926
+ return /* @__PURE__ */ jsxs6(Wrapper4, { children: [
927
+ /* @__PURE__ */ jsx16(
928
+ HiddenInput2,
929
+ {
930
+ checked,
931
+ disabled,
932
+ ...rest
933
+ }
934
+ ),
935
+ /* @__PURE__ */ jsx16(Circle, { $checked: checked, $disabled: disabled, children: checked && /* @__PURE__ */ jsx16(Dot, {}) }),
936
+ label && /* @__PURE__ */ jsx16("span", { children: label })
937
+ ] });
938
+ };
939
+ var Radio_default = Radio;
940
+
941
+ // src/components/Select.tsx
942
+ import React5, {
943
+ useEffect as useEffect5,
944
+ useRef as useRef3,
945
+ useState as useState2
946
+ } from "react";
947
+ import styled17 from "styled-components";
948
+ import { createPortal as createPortal4 } from "react-dom";
949
+ import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
950
+ var Option = () => null;
951
+ Option.displayName = "SelectOption";
952
+ var Trigger = styled17.div`
953
+ border: 1px solid
954
+ ${({ $state }) => $state === "error" ? "#e53935" : "#ccc"};
955
+ border-radius: 6px;
956
+ padding: ${({ $size }) => $size === "sm" ? "0.4rem 0.6rem" : $size === "lg" ? "0.7rem 0.9rem" : "0.55rem 0.75rem"};
957
+ cursor: pointer;
958
+ background: #fff;
959
+ `;
960
+ var Dropdown = styled17.div`
961
+ position: fixed;
962
+ min-width: 200px;
963
+ background: white;
964
+ border-radius: 6px;
965
+ box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
966
+ padding: 0.25rem;
967
+ z-index: 1000;
968
+ `;
969
+ var Item = styled17.div`
970
+ padding: 0.4rem 0.6rem;
971
+ border-radius: 4px;
972
+ cursor: pointer;
973
+ background: ${({ $active }) => $active ? "#2d8eff" : "transparent"};
974
+ color: ${({ $active }) => $active ? "#fff" : "inherit"};
975
+
976
+ &:hover {
977
+ background: ${({ $active }) => $active ? "#2d8eff" : "#f5f5f5"};
978
+ }
979
+ `;
980
+ var Select = ({
981
+ value,
982
+ placeholder = "Select",
983
+ options,
984
+ onChange,
985
+ selectSize = "md",
986
+ state = "default",
987
+ children,
988
+ ...rest
989
+ }) => {
990
+ const ref = useRef3(null);
991
+ const [open, setOpen] = useState2(false);
992
+ const [pos, setPos] = useState2({ top: 0, left: 0 });
993
+ const childOptions = React5.Children.toArray(children).filter(
994
+ (child) => React5.isValidElement(child) && child.type === Option
995
+ ).map((child) => ({
996
+ value: child.props.value,
997
+ label: child.props.children
998
+ }));
999
+ const finalOptions = options ?? childOptions;
1000
+ const selected = finalOptions.find((o) => o.value === value)?.label ?? placeholder;
1001
+ const openDropdown = () => {
1002
+ if (!ref.current) return;
1003
+ const rect = ref.current.getBoundingClientRect();
1004
+ setPos({
1005
+ top: rect.bottom + 6,
1006
+ left: rect.left
1007
+ });
1008
+ setOpen(true);
1009
+ };
1010
+ useEffect5(() => {
1011
+ const handler = (e) => {
1012
+ if (ref.current && !ref.current.contains(e.target)) {
1013
+ setOpen(false);
1014
+ }
1015
+ };
1016
+ document.addEventListener("mousedown", handler);
1017
+ return () => document.removeEventListener("mousedown", handler);
1018
+ }, []);
1019
+ return /* @__PURE__ */ jsxs7(Fragment3, { children: [
1020
+ /* @__PURE__ */ jsx17(
1021
+ Trigger,
1022
+ {
1023
+ ref,
1024
+ onClick: openDropdown,
1025
+ $size: selectSize,
1026
+ $state: state,
1027
+ ...rest,
1028
+ children: selected
1029
+ }
1030
+ ),
1031
+ open && createPortal4(
1032
+ /* @__PURE__ */ jsx17(
1033
+ Dropdown,
1034
+ {
1035
+ style: {
1036
+ top: pos.top,
1037
+ left: pos.left
1038
+ },
1039
+ children: finalOptions.map((opt) => /* @__PURE__ */ jsx17(
1040
+ Item,
1041
+ {
1042
+ $active: opt.value === value,
1043
+ onClick: () => {
1044
+ onChange?.(opt.value);
1045
+ setOpen(false);
1046
+ },
1047
+ children: opt.label
1048
+ },
1049
+ opt.value
1050
+ ))
1051
+ }
1052
+ ),
1053
+ document.body
1054
+ )
1055
+ ] });
1056
+ };
1057
+ Select.Option = Option;
1058
+ var Select_default = Select;
1059
+
1060
+ // src/components/Switch.tsx
1061
+ import styled18, { css as css13 } from "styled-components";
1062
+ import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
1063
+ var Wrapper5 = styled18.label`
1064
+ display: inline-flex;
1065
+ align-items: center;
1066
+ gap: 0.5rem;
1067
+ cursor: pointer;
1068
+ user-select: none;
1069
+ `;
1070
+ var HiddenInput3 = styled18.input.attrs({ type: "checkbox" })`
1071
+ position: absolute;
1072
+ opacity: 0;
1073
+ pointer-events: none;
1074
+ `;
1075
+ var trackBase = css13`
1076
+ width: 36px;
1077
+ height: 20px;
1078
+ border-radius: 999px;
1079
+ background-color: #ccc;
1080
+ position: relative;
1081
+ transition: background-color 0.2s ease;
1082
+ `;
1083
+ var Track = styled18.span`
1084
+ ${trackBase}
1085
+ background-color: ${({ $checked }) => $checked ? "#2d8eff" : "#ccc"};
1086
+ opacity: ${({ $disabled }) => $disabled ? 0.6 : 1};
1087
+ `;
1088
+ var Thumb = styled18.span`
1089
+ width: 16px;
1090
+ height: 16px;
1091
+ background-color: #fff;
1092
+ border-radius: 50%;
1093
+ position: absolute;
1094
+ top: 2px;
1095
+ left: 2px;
1096
+ transition: transform 0.2s ease;
1097
+
1098
+ transform: ${({ $checked }) => $checked ? "translateX(16px)" : "translateX(0)"};
1099
+ `;
1100
+ var Switch = ({
1101
+ checked = false,
1102
+ disabled = false,
1103
+ label,
1104
+ ...rest
1105
+ }) => {
1106
+ return /* @__PURE__ */ jsxs8(Wrapper5, { children: [
1107
+ /* @__PURE__ */ jsx18(
1108
+ HiddenInput3,
1109
+ {
1110
+ checked,
1111
+ disabled,
1112
+ ...rest
1113
+ }
1114
+ ),
1115
+ /* @__PURE__ */ jsx18(Track, { $checked: checked, $disabled: disabled, children: /* @__PURE__ */ jsx18(Thumb, { $checked: checked }) }),
1116
+ label && /* @__PURE__ */ jsx18("span", { children: label })
1117
+ ] });
1118
+ };
1119
+ var Switch_default = Switch;
1120
+
1121
+ // src/components/Text.tsx
1122
+ import styled19, { css as css14 } from "styled-components";
1123
+ import { jsx as jsx19 } from "react/jsx-runtime";
1124
+ var baseStyle7 = css14`
1125
+ font-size: 12px;
1126
+ `;
1127
+ var variantStyles4 = {
1128
+ h1: css14`
1129
+ font-size: 2em;
1130
+ font-weight: bold;
1131
+ `,
1132
+ h2: css14`
1133
+ font-size: 1.5em;
1134
+ font-weight: bold;
1135
+ `,
1136
+ h3: css14`
1137
+ font-size: 1.17em;
1138
+ font-weight: bold;
1139
+ `,
1140
+ h4: css14`
1141
+ font-size: 1em;
1142
+ font-weight: bold;
1143
+ `,
1144
+ h5: css14`
1145
+ font-size: 0.83em;
1146
+ font-weight: bold;
1147
+ `,
1148
+ h6: css14`
1149
+ font-size: 0.67em;
1150
+ font-weight: bold;
1151
+ `,
1152
+ p: css14`
1153
+ font-size: 0.875em;
1154
+ `
1155
+ };
1156
+ var StyledButton2 = styled19.span`
1157
+ ${baseStyle7}
1158
+ ${({ $variant }) => variantStyles4[$variant]}
1159
+ `;
1160
+ var Text = ({
1161
+ fontVariant = "p",
1162
+ children,
1163
+ ...rest
1164
+ }) => {
1165
+ return /* @__PURE__ */ jsx19(StyledButton2, { $variant: fontVariant, ...rest, children });
1166
+ };
1167
+ var Text_default = Text;
1168
+
1169
+ // src/components/Textarea.tsx
1170
+ import styled20, { css as css15 } from "styled-components";
1171
+ import { jsx as jsx20 } from "react/jsx-runtime";
1172
+ var baseStyle8 = css15`
1173
+ width: 100%;
1174
+ font-family: inherit;
1175
+ border-radius: 6px;
1176
+ border: 1px solid #ccc;
1177
+ background-color: #fff;
1178
+ color: inherit;
1179
+ outline: none;
1180
+ resize: vertical;
1181
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
1182
+
1183
+ &:focus {
1184
+ border-color: #2d8eff;
1185
+ box-shadow: 0 0 0 2px rgba(45, 142, 255, 0.2);
1186
+ }
1187
+
1188
+ &:disabled {
1189
+ background-color: #f5f5f5;
1190
+ cursor: not-allowed;
1191
+ opacity: 0.7;
1192
+ }
1193
+ `;
1194
+ var sizeStyles3 = {
1195
+ sm: css15`
1196
+ padding: 0.4rem 0.6rem;
1197
+ font-size: 0.875rem;
1198
+ min-height: 80px;
1199
+ `,
1200
+ md: css15`
1201
+ padding: 0.5rem 0.75rem;
1202
+ font-size: 1rem;
1203
+ min-height: 120px;
1204
+ `,
1205
+ lg: css15`
1206
+ padding: 0.65rem 0.9rem;
1207
+ font-size: 1.125rem;
1208
+ min-height: 160px;
1209
+ `
1210
+ };
1211
+ var stateStyles = {
1212
+ default: css15``,
1213
+ error: css15`
1214
+ border-color: #e53935;
1215
+
1216
+ &:focus {
1217
+ border-color: #e53935;
1218
+ box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.2);
1219
+ }
1220
+ `
1221
+ };
1222
+ var StyledTextarea = styled20.textarea`
1223
+ ${baseStyle8}
1224
+ ${({ $size }) => sizeStyles3[$size]}
1225
+ ${({ $state }) => stateStyles[$state]}
1226
+ `;
1227
+ var Textarea = ({
1228
+ size = "md",
1229
+ state = "default",
1230
+ ...rest
1231
+ }) => {
1232
+ return /* @__PURE__ */ jsx20(StyledTextarea, { $size: size, $state: state, ...rest });
1233
+ };
1234
+ var Textarea_default = Textarea;
1235
+ export {
1236
+ Box_default as Box,
1237
+ Button_default as Button,
1238
+ Card_default as Card,
1239
+ Checkbox_default as Checkbox,
1240
+ DatePicker_default as DatePicker,
1241
+ Divider_default as Divider,
1242
+ Drawer_default as Drawer,
1243
+ Flex_default as Flex,
1244
+ Form_default as Form,
1245
+ FormControl_default as FormControl,
1246
+ Heading_default as Heading,
1247
+ Input_default as Input,
1248
+ Link_default as Link,
1249
+ Modal_default as Modal,
1250
+ Paragraph_default as Paragraph,
1251
+ Radio_default as Radio,
1252
+ Select_default as Select,
1253
+ Switch_default as Switch,
1254
+ Text_default as Text,
1255
+ Textarea_default as Textarea
1256
+ };
46
1257
  //# sourceMappingURL=index.mjs.map