doom-design-system 0.1.14 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.d.ts +7 -6
- package/dist/components/Accordion/Accordion.js +36 -28
- package/dist/components/Accordion/Accordion.module.css +78 -22
- package/dist/components/Avatar/Avatar.d.ts +4 -4
- package/dist/components/Avatar/Avatar.js +6 -6
- package/dist/components/Badge/Badge.module.css +3 -3
- package/dist/components/Button/Button.module.css +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.js +7 -7
- package/dist/components/Drawer/Drawer.js +5 -3
- package/dist/components/Drawer/Drawer.module.css +8 -6
- package/dist/components/Form/Form.module.css +1 -0
- package/dist/components/Input/Input.d.ts +3 -2
- package/dist/components/Input/Input.js +15 -3
- package/dist/components/Input/Input.module.css +33 -0
- package/dist/components/Modal/Modal.d.ts +5 -4
- package/dist/components/Modal/Modal.js +13 -6
- package/dist/components/Modal/Modal.module.css +64 -29
- package/dist/components/Popover/Popover.d.ts +3 -3
- package/dist/components/Popover/Popover.js +38 -36
- package/dist/components/ProgressBar/ProgressBar.d.ts +2 -1
- package/dist/components/ProgressBar/ProgressBar.js +10 -5
- package/dist/components/ProgressBar/ProgressBar.module.css +7 -0
- package/dist/components/Select/Select.js +6 -4
- package/dist/components/Select/Select.module.css +2 -2
- package/dist/components/Sheet/Sheet.d.ts +2 -2
- package/dist/components/Sheet/Sheet.js +18 -16
- package/dist/components/Sheet/Sheet.module.css +1 -2
- package/dist/components/Slider/Slider.d.ts +3 -3
- package/dist/components/Slider/Slider.js +11 -7
- package/dist/components/Slider/Slider.module.css +1 -1
- package/dist/components/SplitButton/SplitButton.d.ts +2 -2
- package/dist/components/SplitButton/SplitButton.js +8 -8
- package/dist/components/Tabs/Tabs.js +2 -2
- package/dist/components/Tabs/Tabs.module.css +9 -7
- package/dist/components/Textarea/Textarea.d.ts +8 -3
- package/dist/components/Textarea/Textarea.js +25 -6
- package/dist/components/Textarea/Textarea.module.css +71 -0
- package/dist/styles/globals.css +138 -1
- package/dist/styles/themes/definitions.d.ts +312 -300
- package/dist/styles/themes/definitions.js +60 -60
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +2 -2
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
3
|
var t = {};
|
|
4
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -10,10 +10,29 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import React, { useState, useId } from "react";
|
|
15
|
+
import clsx from "clsx";
|
|
16
|
+
import { Label } from "../Label/Label.js";
|
|
17
|
+
import styles from "./Textarea.module.css";
|
|
16
18
|
export function Textarea(_a) {
|
|
17
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
-
|
|
19
|
+
var { label, error, helperText, showCount, className, style, id, required, maxLength, value, defaultValue, onChange } = _a, props = __rest(_a, ["label", "error", "helperText", "showCount", "className", "style", "id", "required", "maxLength", "value", "defaultValue", "onChange"]);
|
|
20
|
+
const reactId = useId();
|
|
21
|
+
const textareaId = id || `textarea-${reactId}`;
|
|
22
|
+
const helperId = `${textareaId}-helper`;
|
|
23
|
+
const errorId = `${textareaId}-error`;
|
|
24
|
+
const [charCount, setCharCount] = useState(((value === null || value === void 0 ? void 0 : value.toString()) || (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.toString()) || "").length);
|
|
25
|
+
const handleChange = (e) => {
|
|
26
|
+
setCharCount(e.target.value.length);
|
|
27
|
+
if (onChange)
|
|
28
|
+
onChange(e);
|
|
29
|
+
};
|
|
30
|
+
// Sync charCount if value is updated externally (controlled)
|
|
31
|
+
React.useEffect(() => {
|
|
32
|
+
if (value !== undefined) {
|
|
33
|
+
setCharCount(value.toString().length);
|
|
34
|
+
}
|
|
35
|
+
}, [value]);
|
|
36
|
+
const describedBy = clsx(helperText && helperId, error && errorId) || undefined;
|
|
37
|
+
return (_jsxs("div", { className: clsx(styles.container, className), style: style, children: [label && (_jsx(Label, { htmlFor: textareaId, required: required, children: label })), _jsx("textarea", Object.assign({ className: clsx(styles.textarea, error && styles.error), id: textareaId, required: required, maxLength: maxLength, value: value, defaultValue: defaultValue, onChange: handleChange, "aria-invalid": !!error, "aria-describedby": describedBy }, props)), (error || helperText || (showCount !== null && showCount !== void 0 ? showCount : maxLength !== undefined)) && (_jsxs("div", { className: styles.bottomRow, children: [_jsx("div", { className: styles.messageArea, children: error ? (_jsx("span", { id: errorId, className: clsx(styles.helperText, styles.error), role: "alert", children: error })) : (helperText && (_jsx("span", { id: helperId, className: styles.helperText, children: helperText }))) }), (showCount !== null && showCount !== void 0 ? showCount : maxLength !== undefined) && (_jsxs("span", { className: styles.counter, children: [charCount, maxLength !== undefined ? ` / ${maxLength}` : ""] }))] }))] }));
|
|
19
38
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 0.5rem;
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
1
8
|
.textarea {
|
|
2
9
|
width: 100%;
|
|
3
10
|
padding: 0.75rem 1rem;
|
|
@@ -6,6 +13,7 @@
|
|
|
6
13
|
color: var(--foreground);
|
|
7
14
|
font-family: inherit;
|
|
8
15
|
resize: vertical;
|
|
16
|
+
min-height: 100px;
|
|
9
17
|
border: var(--border-width) solid var(--card-border);
|
|
10
18
|
border-radius: var(--radius);
|
|
11
19
|
box-shadow: var(--shadow-hard);
|
|
@@ -21,3 +29,66 @@
|
|
|
21
29
|
.textarea::placeholder {
|
|
22
30
|
color: var(--muted);
|
|
23
31
|
}
|
|
32
|
+
.textarea.error {
|
|
33
|
+
border-color: var(--error);
|
|
34
|
+
box-shadow: 5px 5px 0px 0px var(--shadow-error);
|
|
35
|
+
}
|
|
36
|
+
.textarea.error:focus, .textarea.error:focus-visible {
|
|
37
|
+
border-color: var(--error);
|
|
38
|
+
box-shadow: 7px 7px 0px 0px var(--shadow-error);
|
|
39
|
+
}
|
|
40
|
+
.textarea:disabled {
|
|
41
|
+
cursor: not-allowed;
|
|
42
|
+
opacity: 0.7;
|
|
43
|
+
background-color: var(--muted);
|
|
44
|
+
background-image: linear-gradient(45deg, transparent 25%, rgba(0, 0, 0, 0.05) 25%, rgba(0, 0, 0, 0.05) 50%, transparent 50%, transparent 75%, rgba(0, 0, 0, 0.05) 75%, rgba(0, 0, 0, 0.05));
|
|
45
|
+
background-size: 20px 20px;
|
|
46
|
+
box-shadow: none;
|
|
47
|
+
transform: none;
|
|
48
|
+
color: var(--muted-foreground);
|
|
49
|
+
}
|
|
50
|
+
.textarea:disabled::placeholder {
|
|
51
|
+
color: var(--muted-foreground);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.bottomRow {
|
|
55
|
+
display: flex;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
align-items: flex-start;
|
|
58
|
+
gap: 1rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.messageArea {
|
|
62
|
+
flex: 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.helperText {
|
|
66
|
+
font-size: var(--text-xs);
|
|
67
|
+
font-weight: var(--font-medium);
|
|
68
|
+
color: var(--muted-foreground);
|
|
69
|
+
display: block;
|
|
70
|
+
}
|
|
71
|
+
.helperText.error {
|
|
72
|
+
color: var(--error);
|
|
73
|
+
font-weight: var(--font-bold);
|
|
74
|
+
text-transform: uppercase;
|
|
75
|
+
animation: textarea-shake 0.3s ease-in-out;
|
|
76
|
+
}
|
|
77
|
+
@keyframes textarea-shake {
|
|
78
|
+
0%, 100% {
|
|
79
|
+
transform: translateX(0);
|
|
80
|
+
}
|
|
81
|
+
25% {
|
|
82
|
+
transform: translateX(-4px);
|
|
83
|
+
}
|
|
84
|
+
75% {
|
|
85
|
+
transform: translateX(4px);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.counter {
|
|
90
|
+
font-size: var(--text-xs);
|
|
91
|
+
font-weight: var(--font-medium);
|
|
92
|
+
color: var(--muted-foreground);
|
|
93
|
+
white-space: nowrap;
|
|
94
|
+
}
|
package/dist/styles/globals.css
CHANGED
|
@@ -31,7 +31,12 @@ p, h1, h2, h3, h4, h5, h6 {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/* Typography Base Styles */
|
|
34
|
-
h1,
|
|
34
|
+
h1,
|
|
35
|
+
h2,
|
|
36
|
+
h3,
|
|
37
|
+
h4,
|
|
38
|
+
h5,
|
|
39
|
+
h6 {
|
|
35
40
|
font-family: var(--font-heading, var(--font-montserrat)), sans-serif;
|
|
36
41
|
font-weight: var(--heading-weight, 700);
|
|
37
42
|
text-transform: var(--heading-transform, none);
|
|
@@ -356,6 +361,18 @@ body .py-0 {
|
|
|
356
361
|
padding-top: 0;
|
|
357
362
|
padding-bottom: 0;
|
|
358
363
|
}
|
|
364
|
+
body .top-0 {
|
|
365
|
+
top: 0;
|
|
366
|
+
}
|
|
367
|
+
body .bottom-0 {
|
|
368
|
+
bottom: 0;
|
|
369
|
+
}
|
|
370
|
+
body .left-0 {
|
|
371
|
+
left: 0;
|
|
372
|
+
}
|
|
373
|
+
body .right-0 {
|
|
374
|
+
right: 0;
|
|
375
|
+
}
|
|
359
376
|
body .gap-1 {
|
|
360
377
|
gap: 0.25rem;
|
|
361
378
|
}
|
|
@@ -411,6 +428,18 @@ body .py-1 {
|
|
|
411
428
|
padding-top: 0.25rem;
|
|
412
429
|
padding-bottom: 0.25rem;
|
|
413
430
|
}
|
|
431
|
+
body .top-1 {
|
|
432
|
+
top: 0.25rem;
|
|
433
|
+
}
|
|
434
|
+
body .bottom-1 {
|
|
435
|
+
bottom: 0.25rem;
|
|
436
|
+
}
|
|
437
|
+
body .left-1 {
|
|
438
|
+
left: 0.25rem;
|
|
439
|
+
}
|
|
440
|
+
body .right-1 {
|
|
441
|
+
right: 0.25rem;
|
|
442
|
+
}
|
|
414
443
|
body .gap-2 {
|
|
415
444
|
gap: 0.5rem;
|
|
416
445
|
}
|
|
@@ -466,6 +495,18 @@ body .py-2 {
|
|
|
466
495
|
padding-top: 0.5rem;
|
|
467
496
|
padding-bottom: 0.5rem;
|
|
468
497
|
}
|
|
498
|
+
body .top-2 {
|
|
499
|
+
top: 0.5rem;
|
|
500
|
+
}
|
|
501
|
+
body .bottom-2 {
|
|
502
|
+
bottom: 0.5rem;
|
|
503
|
+
}
|
|
504
|
+
body .left-2 {
|
|
505
|
+
left: 0.5rem;
|
|
506
|
+
}
|
|
507
|
+
body .right-2 {
|
|
508
|
+
right: 0.5rem;
|
|
509
|
+
}
|
|
469
510
|
body .gap-3 {
|
|
470
511
|
gap: 0.75rem;
|
|
471
512
|
}
|
|
@@ -521,6 +562,18 @@ body .py-3 {
|
|
|
521
562
|
padding-top: 0.75rem;
|
|
522
563
|
padding-bottom: 0.75rem;
|
|
523
564
|
}
|
|
565
|
+
body .top-3 {
|
|
566
|
+
top: 0.75rem;
|
|
567
|
+
}
|
|
568
|
+
body .bottom-3 {
|
|
569
|
+
bottom: 0.75rem;
|
|
570
|
+
}
|
|
571
|
+
body .left-3 {
|
|
572
|
+
left: 0.75rem;
|
|
573
|
+
}
|
|
574
|
+
body .right-3 {
|
|
575
|
+
right: 0.75rem;
|
|
576
|
+
}
|
|
524
577
|
body .gap-4 {
|
|
525
578
|
gap: 1rem;
|
|
526
579
|
}
|
|
@@ -576,6 +629,18 @@ body .py-4 {
|
|
|
576
629
|
padding-top: 1rem;
|
|
577
630
|
padding-bottom: 1rem;
|
|
578
631
|
}
|
|
632
|
+
body .top-4 {
|
|
633
|
+
top: 1rem;
|
|
634
|
+
}
|
|
635
|
+
body .bottom-4 {
|
|
636
|
+
bottom: 1rem;
|
|
637
|
+
}
|
|
638
|
+
body .left-4 {
|
|
639
|
+
left: 1rem;
|
|
640
|
+
}
|
|
641
|
+
body .right-4 {
|
|
642
|
+
right: 1rem;
|
|
643
|
+
}
|
|
579
644
|
body .gap-5 {
|
|
580
645
|
gap: 1.25rem;
|
|
581
646
|
}
|
|
@@ -631,6 +696,18 @@ body .py-5 {
|
|
|
631
696
|
padding-top: 1.25rem;
|
|
632
697
|
padding-bottom: 1.25rem;
|
|
633
698
|
}
|
|
699
|
+
body .top-5 {
|
|
700
|
+
top: 1.25rem;
|
|
701
|
+
}
|
|
702
|
+
body .bottom-5 {
|
|
703
|
+
bottom: 1.25rem;
|
|
704
|
+
}
|
|
705
|
+
body .left-5 {
|
|
706
|
+
left: 1.25rem;
|
|
707
|
+
}
|
|
708
|
+
body .right-5 {
|
|
709
|
+
right: 1.25rem;
|
|
710
|
+
}
|
|
634
711
|
body .gap-6 {
|
|
635
712
|
gap: 1.5rem;
|
|
636
713
|
}
|
|
@@ -686,6 +763,18 @@ body .py-6 {
|
|
|
686
763
|
padding-top: 1.5rem;
|
|
687
764
|
padding-bottom: 1.5rem;
|
|
688
765
|
}
|
|
766
|
+
body .top-6 {
|
|
767
|
+
top: 1.5rem;
|
|
768
|
+
}
|
|
769
|
+
body .bottom-6 {
|
|
770
|
+
bottom: 1.5rem;
|
|
771
|
+
}
|
|
772
|
+
body .left-6 {
|
|
773
|
+
left: 1.5rem;
|
|
774
|
+
}
|
|
775
|
+
body .right-6 {
|
|
776
|
+
right: 1.5rem;
|
|
777
|
+
}
|
|
689
778
|
body .gap-7 {
|
|
690
779
|
gap: 1.75rem;
|
|
691
780
|
}
|
|
@@ -741,6 +830,18 @@ body .py-7 {
|
|
|
741
830
|
padding-top: 1.75rem;
|
|
742
831
|
padding-bottom: 1.75rem;
|
|
743
832
|
}
|
|
833
|
+
body .top-7 {
|
|
834
|
+
top: 1.75rem;
|
|
835
|
+
}
|
|
836
|
+
body .bottom-7 {
|
|
837
|
+
bottom: 1.75rem;
|
|
838
|
+
}
|
|
839
|
+
body .left-7 {
|
|
840
|
+
left: 1.75rem;
|
|
841
|
+
}
|
|
842
|
+
body .right-7 {
|
|
843
|
+
right: 1.75rem;
|
|
844
|
+
}
|
|
744
845
|
body .gap-8 {
|
|
745
846
|
gap: 2rem;
|
|
746
847
|
}
|
|
@@ -796,6 +897,18 @@ body .py-8 {
|
|
|
796
897
|
padding-top: 2rem;
|
|
797
898
|
padding-bottom: 2rem;
|
|
798
899
|
}
|
|
900
|
+
body .top-8 {
|
|
901
|
+
top: 2rem;
|
|
902
|
+
}
|
|
903
|
+
body .bottom-8 {
|
|
904
|
+
bottom: 2rem;
|
|
905
|
+
}
|
|
906
|
+
body .left-8 {
|
|
907
|
+
left: 2rem;
|
|
908
|
+
}
|
|
909
|
+
body .right-8 {
|
|
910
|
+
right: 2rem;
|
|
911
|
+
}
|
|
799
912
|
body .gap-9 {
|
|
800
913
|
gap: 2.25rem;
|
|
801
914
|
}
|
|
@@ -851,6 +964,18 @@ body .py-9 {
|
|
|
851
964
|
padding-top: 2.25rem;
|
|
852
965
|
padding-bottom: 2.25rem;
|
|
853
966
|
}
|
|
967
|
+
body .top-9 {
|
|
968
|
+
top: 2.25rem;
|
|
969
|
+
}
|
|
970
|
+
body .bottom-9 {
|
|
971
|
+
bottom: 2.25rem;
|
|
972
|
+
}
|
|
973
|
+
body .left-9 {
|
|
974
|
+
left: 2.25rem;
|
|
975
|
+
}
|
|
976
|
+
body .right-9 {
|
|
977
|
+
right: 2.25rem;
|
|
978
|
+
}
|
|
854
979
|
body .gap-10 {
|
|
855
980
|
gap: 2.5rem;
|
|
856
981
|
}
|
|
@@ -906,6 +1031,18 @@ body .py-10 {
|
|
|
906
1031
|
padding-top: 2.5rem;
|
|
907
1032
|
padding-bottom: 2.5rem;
|
|
908
1033
|
}
|
|
1034
|
+
body .top-10 {
|
|
1035
|
+
top: 2.5rem;
|
|
1036
|
+
}
|
|
1037
|
+
body .bottom-10 {
|
|
1038
|
+
bottom: 2.5rem;
|
|
1039
|
+
}
|
|
1040
|
+
body .left-10 {
|
|
1041
|
+
left: 2.5rem;
|
|
1042
|
+
}
|
|
1043
|
+
body .right-10 {
|
|
1044
|
+
right: 2.5rem;
|
|
1045
|
+
}
|
|
909
1046
|
@media (min-width: 640px) {
|
|
910
1047
|
body .sm\:hidden {
|
|
911
1048
|
display: none;
|