@g4rcez/components 0.0.37 → 0.0.39
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/core/button.d.ts +2 -7
- package/dist/components/core/button.d.ts.map +1 -1
- package/dist/components/core/button.js +13 -10
- package/dist/components/core/tag.d.ts +2 -2
- package/dist/components/core/tag.d.ts.map +1 -1
- package/dist/components/core/tag.js +9 -10
- package/dist/components/display/alert.d.ts +1 -1
- package/dist/components/display/notifications.d.ts +1 -1
- package/dist/components/display/tabs.d.ts.map +1 -1
- package/dist/components/display/tabs.js +7 -25
- package/dist/components/floating/expand.js +1 -1
- package/dist/components/floating/menu.d.ts +11 -5
- package/dist/components/floating/menu.d.ts.map +1 -1
- package/dist/components/floating/menu.js +10 -8
- package/dist/components/floating/modal.js +1 -1
- package/dist/components/floating/toolbar.d.ts +6 -0
- package/dist/components/floating/toolbar.d.ts.map +1 -0
- package/dist/components/floating/toolbar.js +4 -0
- package/dist/components/form/input-field.js +1 -1
- package/dist/components/form/input.js +1 -1
- package/dist/components/form/select.d.ts.map +1 -1
- package/dist/components/form/switch.d.ts.map +1 -1
- package/dist/components/form/switch.js +7 -8
- package/dist/components/index.d.ts +4 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -3
- package/dist/components/table/index.d.ts +7 -4
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/index.js +25 -10
- package/dist/components/table/table-lib.d.ts +4 -1
- package/dist/components/table/table-lib.d.ts.map +1 -1
- package/dist/components/table/thead.d.ts +1 -1
- package/dist/components/table/thead.d.ts.map +1 -1
- package/dist/components/table/thead.js +7 -7
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -0
- package/dist/hooks/use-form.d.ts.map +1 -1
- package/dist/hooks/use-form.js +3 -2
- package/dist/index.css +1 -1
- package/dist/index.js +201 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6503 -6361
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +43 -43
- package/dist/index.umd.js.map +1 -1
- package/dist/preset/preset.tailwind.d.ts.map +1 -1
- package/dist/preset/preset.tailwind.js +3 -3
- package/dist/preset/src/styles/theme.d.ts.map +1 -1
- package/dist/preset/src/styles/theme.js +145 -21
- package/dist/preset/src/styles/theme.types.d.ts +12 -13
- package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
- package/dist/preset.tailwind.d.ts +10 -0
- package/dist/preset.tailwind.d.ts.map +1 -0
- package/dist/preset.tailwind.js +53 -0
- package/dist/src/components/core/button.d.ts +16 -0
- package/dist/src/components/core/button.d.ts.map +1 -0
- package/dist/src/components/core/button.js +43 -0
- package/dist/src/components/core/polymorph.d.ts +10 -0
- package/dist/src/components/core/polymorph.d.ts.map +1 -0
- package/dist/src/components/core/polymorph.js +8 -0
- package/dist/src/components/core/resizable.d.ts +3 -0
- package/dist/src/components/core/resizable.d.ts.map +1 -0
- package/dist/src/components/core/resizable.js +50 -0
- package/dist/src/components/core/tag.d.ts +19 -0
- package/dist/src/components/core/tag.d.ts.map +1 -0
- package/dist/src/components/core/tag.js +45 -0
- package/dist/src/components/display/alert.d.ts +19 -0
- package/dist/src/components/display/alert.d.ts.map +1 -0
- package/dist/src/components/display/alert.js +34 -0
- package/dist/src/components/display/calendar.d.ts +42 -0
- package/dist/src/components/display/calendar.d.ts.map +1 -0
- package/dist/src/components/display/calendar.js +215 -0
- package/dist/src/components/display/card.d.ts +10 -0
- package/dist/src/components/display/card.d.ts.map +1 -0
- package/dist/src/components/display/card.js +8 -0
- package/dist/src/components/display/list.d.ts +16 -0
- package/dist/src/components/display/list.d.ts.map +1 -0
- package/dist/src/components/display/list.js +31 -0
- package/dist/src/components/display/notifications.d.ts +25 -0
- package/dist/src/components/display/notifications.d.ts.map +1 -0
- package/dist/src/components/display/notifications.js +70 -0
- package/dist/src/components/display/stats.d.ts +10 -0
- package/dist/src/components/display/stats.d.ts.map +1 -0
- package/dist/src/components/display/stats.js +5 -0
- package/dist/src/components/display/step.d.ts +14 -0
- package/dist/src/components/display/step.d.ts.map +1 -0
- package/dist/src/components/display/step.js +59 -0
- package/dist/src/components/display/tabs.d.ts +20 -0
- package/dist/src/components/display/tabs.d.ts.map +1 -0
- package/dist/src/components/display/tabs.js +67 -0
- package/dist/src/components/display/timeline.d.ts +32 -0
- package/dist/src/components/display/timeline.d.ts.map +1 -0
- package/dist/src/components/display/timeline.js +21 -0
- package/dist/src/components/floating/dropdown.d.ts +14 -0
- package/dist/src/components/floating/dropdown.d.ts.map +1 -0
- package/dist/src/components/floating/dropdown.js +39 -0
- package/dist/src/components/floating/expand.d.ts +9 -0
- package/dist/src/components/floating/expand.d.ts.map +1 -0
- package/dist/src/components/floating/expand.js +25 -0
- package/dist/src/components/floating/menu.d.ts +52 -0
- package/dist/src/components/floating/menu.d.ts.map +1 -0
- package/dist/src/components/floating/menu.js +126 -0
- package/dist/src/components/floating/modal.d.ts +19 -0
- package/dist/src/components/floating/modal.d.ts.map +1 -0
- package/dist/src/components/floating/modal.js +102 -0
- package/dist/src/components/floating/toolbar.d.ts +6 -0
- package/dist/src/components/floating/toolbar.d.ts.map +1 -0
- package/dist/src/components/floating/toolbar.js +4 -0
- package/dist/src/components/floating/tooltip.d.ts +12 -0
- package/dist/src/components/floating/tooltip.d.ts.map +1 -0
- package/dist/src/components/floating/tooltip.js +28 -0
- package/dist/src/components/form/autocomplete.d.ts +17 -0
- package/dist/src/components/form/autocomplete.d.ts.map +1 -0
- package/dist/src/components/form/autocomplete.js +152 -0
- package/dist/src/components/form/checkbox.d.ts +11 -0
- package/dist/src/components/form/checkbox.d.ts.map +1 -0
- package/dist/src/components/form/checkbox.js +8 -0
- package/dist/src/components/form/date-picker.d.ts +61 -0
- package/dist/src/components/form/date-picker.d.ts.map +1 -0
- package/dist/src/components/form/date-picker.js +78 -0
- package/dist/src/components/form/file-upload.d.ts +12 -0
- package/dist/src/components/form/file-upload.d.ts.map +1 -0
- package/dist/src/components/form/file-upload.js +62 -0
- package/dist/src/components/form/form.d.ts +4 -0
- package/dist/src/components/form/form.d.ts.map +1 -0
- package/dist/src/components/form/form.js +28 -0
- package/dist/src/components/form/input-field.d.ts +30 -0
- package/dist/src/components/form/input-field.d.ts.map +1 -0
- package/dist/src/components/form/input-field.js +14 -0
- package/dist/src/components/form/input.d.ts +9 -0
- package/dist/src/components/form/input.d.ts.map +1 -0
- package/dist/src/components/form/input.js +38 -0
- package/dist/src/components/form/radiobox.d.ts +7 -0
- package/dist/src/components/form/radiobox.d.ts.map +1 -0
- package/dist/src/components/form/radiobox.js +7 -0
- package/dist/src/components/form/select.d.ts +13 -0
- package/dist/src/components/form/select.d.ts.map +1 -0
- package/dist/src/components/form/select.js +33 -0
- package/dist/src/components/form/switch.d.ts +8 -0
- package/dist/src/components/form/switch.d.ts.map +1 -0
- package/dist/src/components/form/switch.js +39 -0
- package/dist/src/components/form/task-list.d.ts +3 -0
- package/dist/src/components/form/task-list.d.ts.map +1 -0
- package/dist/src/components/form/task-list.js +26 -0
- package/dist/src/components/form/transfer-list.d.ts +14 -0
- package/dist/src/components/form/transfer-list.d.ts.map +1 -0
- package/dist/src/components/form/transfer-list.js +21 -0
- package/dist/src/components/index.d.ts +30 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/index.js +29 -0
- package/dist/src/components/table/filter.d.ts +41 -0
- package/dist/src/components/table/filter.d.ts.map +1 -0
- package/dist/src/components/table/filter.js +91 -0
- package/dist/src/components/table/group.d.ts +17 -0
- package/dist/src/components/table/group.d.ts.map +1 -0
- package/dist/src/components/table/group.js +43 -0
- package/dist/src/components/table/index.d.ts +38 -0
- package/dist/src/components/table/index.d.ts.map +1 -0
- package/dist/src/components/table/index.js +145 -0
- package/dist/src/components/table/metadata.d.ts +3 -0
- package/dist/src/components/table/metadata.d.ts.map +1 -0
- package/dist/src/components/table/metadata.js +10 -0
- package/dist/src/components/table/pagination.d.ts +3 -0
- package/dist/src/components/table/pagination.d.ts.map +1 -0
- package/dist/src/components/table/pagination.js +43 -0
- package/dist/src/components/table/sort.d.ts +28 -0
- package/dist/src/components/table/sort.d.ts.map +1 -0
- package/dist/src/components/table/sort.js +79 -0
- package/dist/src/components/table/table-lib.d.ts +122 -0
- package/dist/src/components/table/table-lib.d.ts.map +1 -0
- package/dist/src/components/table/table-lib.js +51 -0
- package/dist/src/components/table/thead.d.ts +8 -0
- package/dist/src/components/table/thead.d.ts.map +1 -0
- package/dist/src/components/table/thead.js +29 -0
- package/dist/src/constants.d.ts +3 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +2 -0
- package/dist/src/hooks/use-callback-ref.d.ts +3 -0
- package/dist/src/hooks/use-callback-ref.d.ts.map +1 -0
- package/dist/src/hooks/use-callback-ref.js +8 -0
- package/dist/src/hooks/use-click-outside.d.ts +3 -0
- package/dist/src/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/src/hooks/use-click-outside.js +17 -0
- package/dist/src/hooks/use-debounce.d.ts +4 -0
- package/dist/src/hooks/use-debounce.d.ts.map +1 -0
- package/dist/src/hooks/use-debounce.js +12 -0
- package/dist/src/hooks/use-form.d.ts +41 -0
- package/dist/src/hooks/use-form.d.ts.map +1 -0
- package/dist/src/hooks/use-form.js +169 -0
- package/dist/src/hooks/use-hover.d.ts +3 -0
- package/dist/src/hooks/use-hover.d.ts.map +1 -0
- package/dist/src/hooks/use-hover.js +18 -0
- package/dist/src/hooks/use-media-query.d.ts +2 -0
- package/dist/src/hooks/use-media-query.d.ts.map +1 -0
- package/dist/src/hooks/use-media-query.js +25 -0
- package/dist/src/hooks/use-mutable-state.d.ts +2 -0
- package/dist/src/hooks/use-mutable-state.d.ts.map +1 -0
- package/dist/src/hooks/use-mutable-state.js +8 -0
- package/dist/src/hooks/use-on-event.d.ts +4 -0
- package/dist/src/hooks/use-on-event.d.ts.map +1 -0
- package/dist/src/hooks/use-on-event.js +7 -0
- package/dist/src/hooks/use-parent.d.ts +3 -0
- package/dist/src/hooks/use-parent.d.ts.map +1 -0
- package/dist/src/hooks/use-parent.js +21 -0
- package/dist/src/hooks/use-previous.d.ts +2 -0
- package/dist/src/hooks/use-previous.d.ts.map +1 -0
- package/dist/src/hooks/use-previous.js +8 -0
- package/dist/src/hooks/use-reactive.d.ts +2 -0
- package/dist/src/hooks/use-reactive.d.ts.map +1 -0
- package/dist/src/hooks/use-reactive.js +8 -0
- package/dist/src/hooks/use-stable-ref.d.ts +2 -0
- package/dist/src/hooks/use-stable-ref.d.ts.map +1 -0
- package/dist/src/hooks/use-stable-ref.js +8 -0
- package/dist/src/hooks/use-translate-context.d.ts +103 -0
- package/dist/src/hooks/use-translate-context.d.ts.map +1 -0
- package/dist/src/hooks/use-translate-context.js +63 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +10 -0
- package/dist/src/lib/dom.d.ts +9 -0
- package/dist/src/lib/dom.d.ts.map +1 -0
- package/dist/src/lib/dom.js +34 -0
- package/dist/src/lib/fns.d.ts +7 -0
- package/dist/src/lib/fns.d.ts.map +1 -0
- package/dist/src/lib/fns.js +26 -0
- package/dist/src/styles/design-tokens.d.ts +19 -0
- package/dist/src/styles/design-tokens.d.ts.map +1 -0
- package/dist/src/styles/design-tokens.js +52 -0
- package/dist/src/styles/theme.d.ts +4 -0
- package/dist/src/styles/theme.d.ts.map +1 -0
- package/dist/src/styles/theme.js +294 -0
- package/dist/src/styles/theme.types.d.ts +101 -0
- package/dist/src/styles/theme.types.d.ts.map +1 -0
- package/dist/src/styles/theme.types.js +1 -0
- package/dist/src/types.d.ts +10 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +1 -0
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/theme.js +145 -21
- package/dist/styles/theme.types.d.ts +12 -13
- package/dist/styles/theme.types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset.tailwind.d.ts","sourceRoot":"","sources":["../../preset.tailwind.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,eAAO,MAAM,GAAG;;qCAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"preset.tailwind.d.ts","sourceRoot":"","sources":["../../preset.tailwind.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,eAAO,MAAM,GAAG;;qCAAa,CAAC;AAI9B,QAAA,MAAM,MAAM,EAAE,OAAO,CAAC,MAAM,CA2C3B,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAEzD,eAAe,MAAM,CAAC"}
|
|
@@ -15,6 +15,7 @@ import { createDesignTokens, parsers } from "./src/styles/design-tokens";
|
|
|
15
15
|
import { defaultDarkTheme } from "./src/styles/theme";
|
|
16
16
|
var COLORS = createDesignTokens(defaultDarkTheme.colors, parsers.formatWithVar("hsla"));
|
|
17
17
|
export var css = String.raw;
|
|
18
|
+
var spacing = createDesignTokens(defaultDarkTheme.spacing, parsers.cssVariable);
|
|
18
19
|
var config = {
|
|
19
20
|
theme: {
|
|
20
21
|
extend: {
|
|
@@ -22,6 +23,7 @@ var config = {
|
|
|
22
23
|
DEFAULT: "cubic-bezier(0,0,.58,1)",
|
|
23
24
|
normal: "cubic-bezier(.25,.1,.25,1)",
|
|
24
25
|
},
|
|
26
|
+
spacing: spacing,
|
|
25
27
|
transitionDuration: { DEFAULT: "375ms" },
|
|
26
28
|
minWidth: { xs: "20rem", screen: "100vh" },
|
|
27
29
|
borderRadius: createDesignTokens(defaultDarkTheme.rounded, parsers.cssVariable),
|
|
@@ -55,9 +57,7 @@ var config = {
|
|
|
55
57
|
":merge(.group[data-error=true][data-interactive=true]):has(.input) &",
|
|
56
58
|
":merge(.group[data-error=true][data-interactive=true]):has(.input[data-initialized=true]) &",
|
|
57
59
|
]);
|
|
58
|
-
addVariant("group-checkbox-checked", [
|
|
59
|
-
":merge(&:has(.form-checkbox[type=checkbox]:checked))",
|
|
60
|
-
]);
|
|
60
|
+
addVariant("group-checkbox-checked", [":merge(&:has(.form-checkbox[type=checkbox]:checked))"]);
|
|
61
61
|
}),
|
|
62
62
|
],
|
|
63
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/styles/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/styles/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAoB7C,eAAO,MAAM,gBAAgB,EAAE,YA0I9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YA0I/B,CAAC"}
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
+
var rounded = {
|
|
2
|
+
button: "0.4rem",
|
|
3
|
+
pill: "2rem",
|
|
4
|
+
card: "0.75rem",
|
|
5
|
+
full: "9999px",
|
|
6
|
+
};
|
|
7
|
+
var spacing = {
|
|
8
|
+
base: "1rem",
|
|
9
|
+
lg: "1.5rem",
|
|
10
|
+
sm: "0.75rem",
|
|
11
|
+
"input-height": "2.5rem",
|
|
12
|
+
"input-x": "0.5rem",
|
|
13
|
+
"input-y": "0.25rem",
|
|
14
|
+
"input-inline": "0.25rem",
|
|
15
|
+
"input-gap": "0.375rem",
|
|
16
|
+
};
|
|
1
17
|
export var defaultDarkTheme = {
|
|
2
18
|
name: "dark",
|
|
3
|
-
|
|
19
|
+
rounded: rounded,
|
|
20
|
+
spacing: spacing,
|
|
4
21
|
shadow: {
|
|
5
22
|
floating: "rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 5px 12px",
|
|
6
23
|
},
|
|
7
|
-
rounded: {
|
|
8
|
-
pill: "2rem",
|
|
9
|
-
card: "0.75rem",
|
|
10
|
-
full: "9999px",
|
|
11
|
-
},
|
|
12
24
|
colors: {
|
|
13
25
|
foreground: "hsla(210, 50%, 98%)",
|
|
14
26
|
background: "hsla(0, 0%, 9%)",
|
|
@@ -52,7 +64,7 @@ export var defaultDarkTheme = {
|
|
|
52
64
|
subtle: "hsla(160, 75%, 75%)",
|
|
53
65
|
hover: "hsla(160, 91%, 27%)",
|
|
54
66
|
foreground: "hsla(160, 91%, 50%)",
|
|
55
|
-
notification: "hsla(161,62%,17%)"
|
|
67
|
+
notification: "hsla(161,62%,17%)",
|
|
56
68
|
},
|
|
57
69
|
input: {
|
|
58
70
|
border: "hsla(240, 4%, 25%)",
|
|
@@ -79,27 +91,79 @@ export var defaultDarkTheme = {
|
|
|
79
91
|
background: "hsla(0, 0%, 15%)",
|
|
80
92
|
border: "hsla(240, 4%, 33%)",
|
|
81
93
|
},
|
|
94
|
+
button: {
|
|
95
|
+
primary: {
|
|
96
|
+
text: "hsla(200,98%,60%)",
|
|
97
|
+
bg: "hsla(200,28%,19%)",
|
|
98
|
+
},
|
|
99
|
+
warn: {
|
|
100
|
+
text: "hsla(26,100%,67%)",
|
|
101
|
+
bg: "hsla(37,100%,15%)",
|
|
102
|
+
},
|
|
103
|
+
info: {
|
|
104
|
+
text: "hsla(200,80%,70%)",
|
|
105
|
+
bg: "hsla(206,66%,24%)",
|
|
106
|
+
},
|
|
107
|
+
success: {
|
|
108
|
+
text: "hsla(151,65%,54%)",
|
|
109
|
+
bg: "hsla(154,52%,19%)",
|
|
110
|
+
},
|
|
111
|
+
danger: {
|
|
112
|
+
text: "hsla(2,100%,90%)",
|
|
113
|
+
bg: "hsla(5,62%,23%)",
|
|
114
|
+
},
|
|
115
|
+
neutral: {
|
|
116
|
+
text: "hsla(200,98%,60%)",
|
|
117
|
+
bg: "hsla(200,28%,19%)",
|
|
118
|
+
},
|
|
119
|
+
secondary: {
|
|
120
|
+
text: "hsla(216,10%,90%)",
|
|
121
|
+
bg: "hsla(214,7%,19%)",
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
tag: {
|
|
125
|
+
primary: {
|
|
126
|
+
text: "hsla(200,98%,60%)",
|
|
127
|
+
bg: "hsla(200,28%,19%)",
|
|
128
|
+
},
|
|
129
|
+
warn: {
|
|
130
|
+
text: "hsla(26,100%,67%)",
|
|
131
|
+
bg: "hsla(37,100%,15%)",
|
|
132
|
+
},
|
|
133
|
+
info: {
|
|
134
|
+
text: "hsla(200,80%,70%)",
|
|
135
|
+
bg: "hsla(206,66%,24%)",
|
|
136
|
+
},
|
|
137
|
+
success: {
|
|
138
|
+
text: "hsla(151,65%,54%)",
|
|
139
|
+
bg: "hsla(154,52%,19%)",
|
|
140
|
+
},
|
|
141
|
+
danger: {
|
|
142
|
+
text: "hsla(2,100%,79%)",
|
|
143
|
+
bg: "hsla(5,62%,23%)",
|
|
144
|
+
},
|
|
145
|
+
neutral: {
|
|
146
|
+
text: "hsla(200,98%,60%)",
|
|
147
|
+
bg: "hsla(200,28%,19%)",
|
|
148
|
+
},
|
|
149
|
+
secondary: {
|
|
150
|
+
text: "hsla(216,10%,90%)",
|
|
151
|
+
bg: "hsla(214,7%,19%)",
|
|
152
|
+
},
|
|
153
|
+
},
|
|
82
154
|
},
|
|
83
155
|
};
|
|
84
156
|
export var defaultLightTheme = {
|
|
85
157
|
name: "light",
|
|
158
|
+
rounded: rounded,
|
|
159
|
+
spacing: spacing,
|
|
86
160
|
shadow: {
|
|
87
161
|
floating: "rgba(50, 50, 50, 0.1) 0px 0px 0px 1px, rgba(50, 50, 50, 0.1) 0px 3px 6px, rgba(50, 50, 50, 0.1) 0px 2px 3px",
|
|
88
162
|
},
|
|
89
|
-
spacing: {
|
|
90
|
-
base: "1rem",
|
|
91
|
-
lg: "1.5rem",
|
|
92
|
-
sm: "0.75rem",
|
|
93
|
-
},
|
|
94
|
-
rounded: {
|
|
95
|
-
pill: "2rem",
|
|
96
|
-
card: "0.75rem",
|
|
97
|
-
full: "9999px",
|
|
98
|
-
},
|
|
99
163
|
colors: {
|
|
100
|
-
foreground: "hsla(217, 15%,
|
|
164
|
+
foreground: "hsla(217, 15%, 30%)",
|
|
101
165
|
background: "hsla(210, 34%, 96%)",
|
|
102
|
-
disabled: "hsla(240, 10%,
|
|
166
|
+
disabled: "hsla(240, 10%, 78%)",
|
|
103
167
|
primary: {
|
|
104
168
|
foreground: "hsla(210, 40%, 98%)",
|
|
105
169
|
DEFAULT: "hsla(199, 89%, 54%)",
|
|
@@ -142,7 +206,7 @@ export var defaultLightTheme = {
|
|
|
142
206
|
notification: "hsla(160, 75%, 80%)",
|
|
143
207
|
},
|
|
144
208
|
input: {
|
|
145
|
-
border: "hsla(218, 22%,
|
|
209
|
+
border: "hsla(218, 22%, 85%)",
|
|
146
210
|
placeholder: "hsla(210, 24%, 71%)",
|
|
147
211
|
"mask-error": "hsla(0, 94%, 81%)",
|
|
148
212
|
"switch-bg": "hsla(0, 0%, 45%)",
|
|
@@ -160,11 +224,71 @@ export var defaultLightTheme = {
|
|
|
160
224
|
tooltip: {
|
|
161
225
|
foreground: "hsla(217, 15%, 20%)",
|
|
162
226
|
background: "hsla(210, 25%, 98%)",
|
|
163
|
-
border: "hsla(
|
|
227
|
+
border: "hsla(200, 1%, 80%)",
|
|
164
228
|
},
|
|
165
229
|
table: {
|
|
166
230
|
background: "hsla(0, 0%, 100%)",
|
|
167
231
|
border: "hsla(210, 25%, 88%)",
|
|
168
232
|
},
|
|
233
|
+
button: {
|
|
234
|
+
primary: {
|
|
235
|
+
text: "hsla(0, 0%, 100%)",
|
|
236
|
+
bg: "hsla(207,96%,48%)",
|
|
237
|
+
},
|
|
238
|
+
warn: {
|
|
239
|
+
bg: "hsla(26,90%,60%)",
|
|
240
|
+
text: "hsla(0, 0%, 100%)",
|
|
241
|
+
},
|
|
242
|
+
info: {
|
|
243
|
+
text: "hsla(0, 0%, 100%)",
|
|
244
|
+
bg: "hsla(210,60%,60%)",
|
|
245
|
+
},
|
|
246
|
+
success: {
|
|
247
|
+
text: "hsla(0, 0%, 100%)",
|
|
248
|
+
bg: "hsla(152,56%,39%)",
|
|
249
|
+
},
|
|
250
|
+
danger: {
|
|
251
|
+
text: "hsla(0, 0%, 100%)",
|
|
252
|
+
bg: "hsla(10,78%,54%)",
|
|
253
|
+
},
|
|
254
|
+
neutral: {
|
|
255
|
+
text: "hsla(200,98%,60%)",
|
|
256
|
+
bg: "hsla(200,28%,19%)",
|
|
257
|
+
},
|
|
258
|
+
secondary: {
|
|
259
|
+
text: "hsla(216,10%,90%)",
|
|
260
|
+
bg: "hsla(214,7%,19%)",
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
tag: {
|
|
264
|
+
primary: {
|
|
265
|
+
text: "hsla(0, 0%, 100%)",
|
|
266
|
+
bg: "hsla(207,70%,55%)",
|
|
267
|
+
},
|
|
268
|
+
warn: {
|
|
269
|
+
bg: "hsla(30,100%,82%)",
|
|
270
|
+
text: "hsla(23,100%,40%)",
|
|
271
|
+
},
|
|
272
|
+
info: {
|
|
273
|
+
text: "hsla(196,100%,20%)",
|
|
274
|
+
bg: "hsla(197,65%,80%)",
|
|
275
|
+
},
|
|
276
|
+
success: {
|
|
277
|
+
text: "hsla(154,52%,19%)",
|
|
278
|
+
bg: "hsla(152,56%,80%)",
|
|
279
|
+
},
|
|
280
|
+
danger: {
|
|
281
|
+
text: "hsla(10,82%,45%)",
|
|
282
|
+
bg: "hsla(359,94%,92%)",
|
|
283
|
+
},
|
|
284
|
+
neutral: {
|
|
285
|
+
text: "hsla(200,98%,60%)",
|
|
286
|
+
bg: "hsla(200,28%,19%)",
|
|
287
|
+
},
|
|
288
|
+
secondary: {
|
|
289
|
+
text: "hsla(216,10%,90%)",
|
|
290
|
+
bg: "hsla(214,7%,19%)",
|
|
291
|
+
},
|
|
292
|
+
},
|
|
169
293
|
},
|
|
170
294
|
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
export type GeneralTokens = {
|
|
2
2
|
[K in string]: string | GeneralTokens;
|
|
3
3
|
};
|
|
4
|
+
type ThemeState = "primary" | "warn" | "secondary" | "info" | "danger" | "success" | "neutral";
|
|
4
5
|
export type DesignTokens = {
|
|
5
6
|
name: string;
|
|
6
|
-
shadow:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
rounded: {
|
|
10
|
-
full: string;
|
|
11
|
-
pill: string;
|
|
12
|
-
card: string;
|
|
13
|
-
};
|
|
14
|
-
spacing: {
|
|
15
|
-
base: string;
|
|
16
|
-
lg: string;
|
|
17
|
-
sm: string;
|
|
18
|
-
};
|
|
7
|
+
shadow: Record<"floating", string>;
|
|
8
|
+
rounded: Record<"button" | "full" | "pill" | "card", string>;
|
|
9
|
+
spacing: Record<"base" | "lg" | "sm", string>;
|
|
19
10
|
colors: {
|
|
11
|
+
tag: Record<ThemeState, {
|
|
12
|
+
text: string;
|
|
13
|
+
bg: string;
|
|
14
|
+
}>;
|
|
15
|
+
button: Record<ThemeState, {
|
|
16
|
+
text: string;
|
|
17
|
+
bg: string;
|
|
18
|
+
}>;
|
|
20
19
|
foreground: string;
|
|
21
20
|
background: string;
|
|
22
21
|
disabled: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.types.d.ts","sourceRoot":"","sources":["../../../../src/styles/theme.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;KAAG,CAAC,IAAI,MAAM,GAAG,MAAM,GAAG,aAAa;CAAE,CAAC;AAEtE,MAAM,MAAM,YAAY,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"theme.types.d.ts","sourceRoot":"","sources":["../../../../src/styles/theme.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Config } from "tailwindcss";
|
|
2
|
+
import { createDesignTokens, parsers } from "./src/styles/design-tokens";
|
|
3
|
+
import { defaultDarkTheme } from "./src/styles/theme";
|
|
4
|
+
export declare const css: (template: {
|
|
5
|
+
raw: readonly string[] | ArrayLike<string>;
|
|
6
|
+
}, ...substitutions: any[]) => string;
|
|
7
|
+
declare const config: Partial<Config>;
|
|
8
|
+
export { createDesignTokens, parsers, defaultDarkTheme };
|
|
9
|
+
export default config;
|
|
10
|
+
//# sourceMappingURL=preset.tailwind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset.tailwind.d.ts","sourceRoot":"","sources":["../preset.tailwind.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,eAAO,MAAM,GAAG;;qCAAa,CAAC;AAI9B,QAAA,MAAM,MAAM,EAAE,OAAO,CAAC,MAAM,CA2C3B,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAEzD,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import forms from "@tailwindcss/forms";
|
|
2
|
+
import plugin from "tailwindcss/plugin";
|
|
3
|
+
import { createDesignTokens, parsers } from "./src/styles/design-tokens";
|
|
4
|
+
import { defaultDarkTheme } from "./src/styles/theme";
|
|
5
|
+
const COLORS = createDesignTokens(defaultDarkTheme.colors, parsers.formatWithVar("hsla"));
|
|
6
|
+
export const css = String.raw;
|
|
7
|
+
const spacing = createDesignTokens(defaultDarkTheme.spacing, parsers.cssVariable);
|
|
8
|
+
const config = {
|
|
9
|
+
theme: {
|
|
10
|
+
extend: {
|
|
11
|
+
transitionTimingFunction: {
|
|
12
|
+
DEFAULT: "cubic-bezier(0,0,.58,1)",
|
|
13
|
+
normal: "cubic-bezier(.25,.1,.25,1)",
|
|
14
|
+
},
|
|
15
|
+
spacing,
|
|
16
|
+
transitionDuration: { DEFAULT: "375ms" },
|
|
17
|
+
minWidth: { xs: "20rem", screen: "100vh" },
|
|
18
|
+
borderRadius: createDesignTokens(defaultDarkTheme.rounded, parsers.cssVariable),
|
|
19
|
+
fill: COLORS,
|
|
20
|
+
colors: COLORS,
|
|
21
|
+
placeholderColor: COLORS,
|
|
22
|
+
borderColors: Object.assign(Object.assign({}, COLORS), { DEFAULT: COLORS.card.border }),
|
|
23
|
+
zIndex: {
|
|
24
|
+
normal: "1",
|
|
25
|
+
tooltip: "13",
|
|
26
|
+
floating: "12",
|
|
27
|
+
overlay: "11",
|
|
28
|
+
navbar: "10",
|
|
29
|
+
calendar: "2",
|
|
30
|
+
},
|
|
31
|
+
boxShadow: {
|
|
32
|
+
floating: "rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 5px 12px",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
plugins: [
|
|
37
|
+
forms({ strategy: "class" }),
|
|
38
|
+
plugin(function ({ addVariant }) {
|
|
39
|
+
addVariant("link", ["&:hover", "&:active"]);
|
|
40
|
+
addVariant("landing", ["&"]);
|
|
41
|
+
addVariant("group-assert", [`:merge(.group):valid:has(.input:valid:not(:placeholder-shown)) &`]);
|
|
42
|
+
addVariant("group-error", [
|
|
43
|
+
`:merge(.group):invalid:has(.input:not(:focus):invalid[data-initialized=true]) &`,
|
|
44
|
+
`:merge(.group[data-error=true]:has(.input[data-initialized=true])) &`,
|
|
45
|
+
`:merge(.group[data-error=true][data-interactive=true]):has(.input) &`,
|
|
46
|
+
`:merge(.group[data-error=true][data-interactive=true]):has(.input[data-initialized=true]) &`,
|
|
47
|
+
]);
|
|
48
|
+
addVariant("group-checkbox-checked", [`:merge(&:has(.form-checkbox[type=checkbox]:checked))`]);
|
|
49
|
+
}),
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
export { createDesignTokens, parsers, defaultDarkTheme };
|
|
53
|
+
export default config;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { type Label } from "../../types";
|
|
4
|
+
import { PolymorphicProps } from "./polymorph";
|
|
5
|
+
declare const buttonVariants: (props?: ({
|
|
6
|
+
size?: "big" | "small" | "min" | "default" | "icon" | null | undefined;
|
|
7
|
+
rounded?: "circle" | "default" | "rough" | "squared" | null | undefined;
|
|
8
|
+
theme?: "main" | "disabled" | "loading" | "raw" | "danger" | "info" | "neutral" | "primary" | "secondary" | "success" | "warn" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
|
+
export type ButtonProps<T extends React.ElementType = "button"> = PolymorphicProps<VariantProps<typeof buttonVariants> & Partial<{
|
|
11
|
+
icon: Label;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
}>, T>;
|
|
14
|
+
export declare const Button: <T extends React.ElementType = "button">(props: ButtonProps<T>) => any;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/core/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D,QAAA,MAAM,cAAc;;;;mFAiCnB,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI,gBAAgB,CAC9E,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,EAChF,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,GAsB7E,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { css } from "../../lib/dom";
|
|
6
|
+
import { Polymorph } from "./polymorph";
|
|
7
|
+
const buttonVariants = cva("inline-flex duration-500 enabled:hover:bg-opacity-70 data-[loading=true]:opacity-30 data-[loading=true]:animate-pulse gap-1.5 border-2 border-transparent items-center justify-center align-middle cursor-pointer whitespace-nowrap font-medium transition-colors ease-in disabled:cursor-not-allowed disabled:bg-opacity-40 disabled:text-opacity-80 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring ease-normal", {
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
default: "h-10 px-4 py-2",
|
|
11
|
+
big: "h-12 px-6 py-4",
|
|
12
|
+
small: "h-8 p-2 text-sm",
|
|
13
|
+
min: "h-7 px-2 py-1 text-sm",
|
|
14
|
+
icon: "p-1",
|
|
15
|
+
},
|
|
16
|
+
rounded: {
|
|
17
|
+
rough: "rounded-sm",
|
|
18
|
+
default: "rounded-button",
|
|
19
|
+
squared: "rounded-none",
|
|
20
|
+
circle: "rounded-full aspect-square",
|
|
21
|
+
},
|
|
22
|
+
theme: {
|
|
23
|
+
raw: "",
|
|
24
|
+
danger: "bg-button-danger-bg text-button-danger-text",
|
|
25
|
+
disabled: "bg-disabled duration-700 opacity-70",
|
|
26
|
+
info: "bg-button-info-bg text-button-info-text",
|
|
27
|
+
loading: "animate-pulse bg-disabled duration-700 opacity-70",
|
|
28
|
+
main: "bg-primary text-primary-foreground",
|
|
29
|
+
neutral: "bg-transparent border border-card-border",
|
|
30
|
+
primary: "bg-button-primary-bg text-button-primary-text",
|
|
31
|
+
secondary: "bg-button-secondary-bg text-button-secondary-text",
|
|
32
|
+
success: "bg-button-success-bg text-button-success-text",
|
|
33
|
+
warn: "bg-button-warn-bg text-button-warn-text",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: { theme: "main", size: "default", rounded: "default" },
|
|
37
|
+
});
|
|
38
|
+
export const Button = forwardRef(function Button(_a, ref) {
|
|
39
|
+
var _b;
|
|
40
|
+
var { className, icon, loading, theme, type = "button", size, rounded } = _a, props = __rest(_a, ["className", "icon", "loading", "theme", "type", "size", "rounded"]);
|
|
41
|
+
const disabled = loading || props.disabled;
|
|
42
|
+
return (_jsxs(Polymorph, Object.assign({}, props, { ref: ref, type: type, "data-theme": theme, "data-loading": loading, disabled: disabled, "aria-busy": disabled || loading, as: (_b = props.as) !== null && _b !== void 0 ? _b : "button", onClick: disabled ? undefined : props.onClick, className: css(buttonVariants({ size, rounded, theme }), className), children: [icon, props.children] })));
|
|
43
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Override } from "../../types";
|
|
3
|
+
type Polymorphism<T extends React.ElementType> = React.PropsWithChildren<{
|
|
4
|
+
as?: T;
|
|
5
|
+
}>;
|
|
6
|
+
type Props<T extends React.ElementType = React.ElementType> = Polymorphism<T> & Omit<React.ComponentPropsWithRef<T>, keyof Polymorphism<T>>;
|
|
7
|
+
export type PolymorphicProps<P extends {}, T extends React.ElementType = React.ElementType> = Omit<T extends string ? Override<React.ComponentProps<T> & Props<T>, P> : Override<Props<T>, P>, keyof Polymorphism<T>> & Polymorphism<T>;
|
|
8
|
+
export declare const Polymorph: React.ForwardRefExoticComponent<Omit<Props<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<any>>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=polymorph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polymorph.d.ts","sourceRoot":"","sources":["../../../../src/components/core/polymorph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,KAAK,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,iBAAiB,CAAC;IAAE,EAAE,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAErF,KAAK,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5I,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,IAAI,CAC9F,CAAC,SAAS,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAC1F,MAAM,YAAY,CAAC,CAAC,CAAC,CACxB,GACG,YAAY,CAAC,CAAC,CAAC,CAAC;AAEpB,eAAO,MAAM,SAAS,2IAGpB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
export const Polymorph = forwardRef(function Polymorph(_a, ref) {
|
|
5
|
+
var { as } = _a, props = __rest(_a, ["as"]);
|
|
6
|
+
const Component = as || "span";
|
|
7
|
+
return _jsx(Component, Object.assign({}, props, { ref: ref }));
|
|
8
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../../../src/components/core/resizable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAoD5D,eAAO,MAAM,SAAS,iBAAkB,KAAK,CAAC,iBAAiB,4CAQ9D,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { motion, useMotionValue } from "framer-motion";
|
|
4
|
+
import { useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { isSsr } from "../../lib/fns";
|
|
6
|
+
const defaultState = {
|
|
7
|
+
x: 0,
|
|
8
|
+
y: 0,
|
|
9
|
+
width: 0,
|
|
10
|
+
height: 0,
|
|
11
|
+
top: 0,
|
|
12
|
+
left: 0,
|
|
13
|
+
bottom: 0,
|
|
14
|
+
right: 0,
|
|
15
|
+
};
|
|
16
|
+
const useElementRect = () => {
|
|
17
|
+
const [element, ref] = useState(null);
|
|
18
|
+
const motion = useMotionValue(defaultState);
|
|
19
|
+
const observer = useMemo(() => isSsr()
|
|
20
|
+
? null
|
|
21
|
+
: new window.ResizeObserver((entries) => {
|
|
22
|
+
if (entries[0]) {
|
|
23
|
+
const rect = entries[0].contentRect;
|
|
24
|
+
motion.set({
|
|
25
|
+
x: rect.x,
|
|
26
|
+
y: rect.y,
|
|
27
|
+
width: rect.width,
|
|
28
|
+
height: rect.height,
|
|
29
|
+
top: rect.top,
|
|
30
|
+
left: rect.left,
|
|
31
|
+
bottom: rect.bottom,
|
|
32
|
+
right: rect.right,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}), []);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (!element)
|
|
38
|
+
return;
|
|
39
|
+
if (observer === null)
|
|
40
|
+
return;
|
|
41
|
+
observer.observe(element);
|
|
42
|
+
return () => observer.disconnect();
|
|
43
|
+
}, [element]);
|
|
44
|
+
return [ref, motion];
|
|
45
|
+
};
|
|
46
|
+
export const Resizable = ({ children }) => {
|
|
47
|
+
const [ref, bounds] = useElementRect();
|
|
48
|
+
const h = bounds.get().height;
|
|
49
|
+
return (_jsx(motion.div, { animate: { height: h > 0 ? h : "auto" }, children: _jsx("div", { ref: ref, children: children }) }));
|
|
50
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Label } from "../../types";
|
|
4
|
+
import { PolymorphicProps } from "./polymorph";
|
|
5
|
+
declare const indicatorVariant: (props?: ({
|
|
6
|
+
theme?: "main" | "danger" | "info" | "secondary" | "success" | "warn" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare const tagVariants: (props?: ({
|
|
9
|
+
size?: "big" | "small" | "default" | "icon" | null | undefined;
|
|
10
|
+
theme?: "disabled" | "loading" | "danger" | "info" | "neutral" | "primary" | "secondary" | "success" | "warn" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
12
|
+
export type TagProps<T extends React.ElementType = "span"> = PolymorphicProps<VariantProps<typeof tagVariants> & Partial<{
|
|
13
|
+
icon: Label;
|
|
14
|
+
loading: boolean;
|
|
15
|
+
indicator: VariantProps<typeof indicatorVariant>["theme"];
|
|
16
|
+
}>, T>;
|
|
17
|
+
export declare const Tag: <T extends React.ElementType = "span">(props: TagProps<T>) => any;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/components/core/tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D,QAAA,MAAM,gBAAgB;;mFAWpB,CAAC;AAEH,QAAA,MAAM,WAAW;;;mFAqBf,CAAC;AAEH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,IAAI,gBAAgB,CACzE,YAAY,CAAC,OAAO,WAAW,CAAC,GAC5B,OAAO,CAAC;IACJ,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC;CAC7D,CAAC,EACN,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,GAWrE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { css } from "../../lib/dom";
|
|
6
|
+
import { Polymorph } from "./polymorph";
|
|
7
|
+
const indicatorVariant = cva("size-2.5 aspect-square rounded-full border-0", {
|
|
8
|
+
variants: {
|
|
9
|
+
theme: {
|
|
10
|
+
warn: "bg-warn",
|
|
11
|
+
info: "bg-info",
|
|
12
|
+
main: "bg-primary",
|
|
13
|
+
danger: "bg-danger",
|
|
14
|
+
success: "bg-success",
|
|
15
|
+
secondary: "bg-secondary",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
const tagVariants = cva("inline-flex rounded-pill gap-1.5 border-2 border-transparent items-center justify-center align-middle whitespace-nowrap", {
|
|
20
|
+
variants: {
|
|
21
|
+
size: {
|
|
22
|
+
icon: "p-1",
|
|
23
|
+
big: "h-12 px-6 py-4",
|
|
24
|
+
default: "h-8 px-4 py-2",
|
|
25
|
+
small: "h-6 p-2 px-3 text-sm",
|
|
26
|
+
},
|
|
27
|
+
theme: {
|
|
28
|
+
primary: "bg-tag-primary-bg text-tag-primary-text",
|
|
29
|
+
danger: "bg-tag-danger-bg text-tag-danger-text",
|
|
30
|
+
info: "bg-tag-info-bg text-tag-info-text",
|
|
31
|
+
success: "bg-tag-success-bg text-tag-success-text",
|
|
32
|
+
secondary: "bg-tag-secondary-bg text-tag-secondary-text",
|
|
33
|
+
warn: "bg-tag-warn-bg text-tag-warn-text",
|
|
34
|
+
neutral: "bg-transparent border border-card-border",
|
|
35
|
+
disabled: "bg-disabled duration-700 opacity-70",
|
|
36
|
+
loading: "animate-pulse bg-disabled duration-700 opacity-70",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: { theme: "primary", size: "default" },
|
|
40
|
+
});
|
|
41
|
+
export const Tag = forwardRef(function Tag(_a, ref) {
|
|
42
|
+
var _b;
|
|
43
|
+
var { className, indicator = undefined, icon, loading, theme, size } = _a, props = __rest(_a, ["className", "indicator", "icon", "loading", "theme", "size"]);
|
|
44
|
+
return (_jsxs(Polymorph, Object.assign({}, props, { ref: ref, "data-theme": theme, as: (_b = props.as) !== null && _b !== void 0 ? _b : "span", className: css(tagVariants({ size, theme }), className), children: [indicator ? _jsx("span", { className: indicatorVariant({ theme: indicator }) }) : null, icon, props.children] })));
|
|
45
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { HTMLMotionProps } from "framer-motion";
|
|
3
|
+
import React, { PropsWithChildren } from "react";
|
|
4
|
+
import { PolymorphicProps } from "../core/polymorph";
|
|
5
|
+
type CollapseProps = {
|
|
6
|
+
open: boolean;
|
|
7
|
+
} & HTMLMotionProps<"section">;
|
|
8
|
+
export declare const Collapse: (props: PropsWithChildren<CollapseProps>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const alertVariants: (props?: ({
|
|
10
|
+
theme?: "danger" | "info" | "neutral" | "success" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
12
|
+
export type AlertProps<T extends React.ElementType = "div"> = PolymorphicProps<VariantProps<typeof alertVariants> & Partial<{
|
|
13
|
+
container: string;
|
|
14
|
+
open?: boolean;
|
|
15
|
+
onClose: (nextState: boolean) => void;
|
|
16
|
+
}>, T>;
|
|
17
|
+
export declare const Alert: <T extends React.ElementType = "div">(props: AlertProps<T>) => any;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/display/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAU,MAAM,eAAe,CAAC;AAExD,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAahE,KAAK,aAAa,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;AAEpE,eAAO,MAAM,QAAQ,UAAW,iBAAiB,CAAC,aAAa,CAAC,4CAgB/D,CAAC;AAEF,QAAA,MAAM,aAAa;;mFAUjB,CAAC;AAEH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,gBAAgB,CAC1E,YAAY,CAAC,OAAO,aAAa,CAAC,GAC9B,OAAO,CAAC;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC,EACN,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,GAuCxE,CAAC"}
|