@deepnoid/ui 0.1.55 → 0.1.57

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.
Files changed (113) hide show
  1. package/.turbo/turbo-build.log +178 -168
  2. package/dist/chunk-32GA3YW4.mjs +1 -0
  3. package/dist/{chunk-ZVGVLD3T.mjs → chunk-3I7QA57V.mjs} +23 -0
  4. package/dist/{chunk-X3A2QD6L.mjs → chunk-3ONHMYAP.mjs} +1 -1
  5. package/dist/{chunk-7XFHA2U5.mjs → chunk-4T7R3PEH.mjs} +1 -1
  6. package/dist/{chunk-PVFDO2WN.mjs → chunk-73RWXO3Y.mjs} +1 -1
  7. package/dist/{chunk-5SNPCI6I.mjs → chunk-C4AGYO7C.mjs} +1 -1
  8. package/dist/{chunk-FKKDEWW3.mjs → chunk-DFBPLQMN.mjs} +4 -4
  9. package/dist/{chunk-LF4SL2LJ.mjs → chunk-DLFXCMUU.mjs} +1 -1
  10. package/dist/{chunk-YUMQWCQ3.mjs → chunk-DLQGQUCD.mjs} +1 -1
  11. package/dist/{chunk-YQ2ULGET.mjs → chunk-DN6AW7DN.mjs} +12 -14
  12. package/dist/{chunk-LTNDSCRA.mjs → chunk-DZ6QJCDZ.mjs} +1 -1
  13. package/dist/{chunk-RQ6ADHCR.mjs → chunk-GL5J2BKI.mjs} +1 -1
  14. package/dist/{chunk-GMNQDNPW.mjs → chunk-HHRKPSO6.mjs} +1 -1
  15. package/dist/{chunk-GC3GYCKY.mjs → chunk-JDWX2LKJ.mjs} +1 -1
  16. package/dist/{chunk-Y3FMWQ7R.mjs → chunk-L3RCWZTV.mjs} +1 -1
  17. package/dist/{chunk-RBQEUS4K.mjs → chunk-LDRIZFBK.mjs} +3 -3
  18. package/dist/{chunk-OTEWHVER.mjs → chunk-LQEA2HU5.mjs} +2 -2
  19. package/dist/chunk-LSO5QZIT.mjs +174 -0
  20. package/dist/{chunk-T43IV3GD.mjs → chunk-N4TTHIUT.mjs} +2 -2
  21. package/dist/{chunk-NWV5ELFP.mjs → chunk-PMZH6GPQ.mjs} +3 -3
  22. package/dist/{chunk-FDBWNO2X.mjs → chunk-UETBYMGS.mjs} +1 -1
  23. package/dist/{chunk-MXLJ3B4K.mjs → chunk-YZDZYMBP.mjs} +2 -2
  24. package/dist/components/avatar/avatar.js +23 -0
  25. package/dist/components/avatar/avatar.mjs +2 -2
  26. package/dist/components/avatar/index.js +23 -0
  27. package/dist/components/avatar/index.mjs +2 -2
  28. package/dist/components/breadcrumb/breadcrumb.js +23 -0
  29. package/dist/components/breadcrumb/breadcrumb.mjs +6 -6
  30. package/dist/components/breadcrumb/index.js +23 -0
  31. package/dist/components/breadcrumb/index.mjs +6 -6
  32. package/dist/components/button/button.d.mts +3 -9
  33. package/dist/components/button/button.d.ts +3 -9
  34. package/dist/components/button/button.js +31 -10
  35. package/dist/components/button/button.mjs +4 -4
  36. package/dist/components/button/icon-button.js +23 -0
  37. package/dist/components/button/icon-button.mjs +4 -4
  38. package/dist/components/button/index.js +31 -10
  39. package/dist/components/button/index.mjs +5 -5
  40. package/dist/components/chip/chip.js +23 -0
  41. package/dist/components/chip/chip.mjs +3 -3
  42. package/dist/components/chip/index.js +23 -0
  43. package/dist/components/chip/index.mjs +3 -3
  44. package/dist/components/dateTimePicker/calendar.js +23 -0
  45. package/dist/components/dateTimePicker/calendar.mjs +3 -3
  46. package/dist/components/dateTimePicker/dateTimePicker.js +23 -0
  47. package/dist/components/dateTimePicker/dateTimePicker.mjs +7 -7
  48. package/dist/components/dateTimePicker/index.js +23 -0
  49. package/dist/components/dateTimePicker/index.mjs +7 -7
  50. package/dist/components/dateTimePicker/timePicker.js +23 -0
  51. package/dist/components/dateTimePicker/timePicker.mjs +5 -5
  52. package/dist/components/drawer/drawer.d.mts +89 -0
  53. package/dist/components/drawer/drawer.d.ts +89 -0
  54. package/dist/components/drawer/drawer.js +544 -0
  55. package/dist/components/drawer/drawer.mjs +11 -0
  56. package/dist/components/drawer/index.d.mts +4 -0
  57. package/dist/components/drawer/index.d.ts +4 -0
  58. package/dist/components/drawer/index.js +550 -0
  59. package/dist/components/drawer/index.mjs +12 -0
  60. package/dist/components/fileUpload/fileUpload.js +31 -10
  61. package/dist/components/fileUpload/fileUpload.mjs +7 -7
  62. package/dist/components/fileUpload/index.js +31 -10
  63. package/dist/components/fileUpload/index.mjs +7 -7
  64. package/dist/components/icon/Icon.d.mts +4 -0
  65. package/dist/components/icon/Icon.d.ts +4 -0
  66. package/dist/components/icon/Icon.js +23 -0
  67. package/dist/components/icon/Icon.mjs +2 -2
  68. package/dist/components/icon/index.js +23 -0
  69. package/dist/components/icon/index.mjs +2 -2
  70. package/dist/components/icon/template.d.mts +1 -0
  71. package/dist/components/icon/template.d.ts +1 -0
  72. package/dist/components/icon/template.js +23 -0
  73. package/dist/components/icon/template.mjs +1 -1
  74. package/dist/components/input/index.js +23 -0
  75. package/dist/components/input/index.mjs +3 -3
  76. package/dist/components/input/input.js +23 -0
  77. package/dist/components/input/input.mjs +3 -3
  78. package/dist/components/list/index.js +23 -0
  79. package/dist/components/list/index.mjs +4 -4
  80. package/dist/components/list/listItem.js +23 -0
  81. package/dist/components/list/listItem.mjs +4 -4
  82. package/dist/components/modal/index.js +31 -10
  83. package/dist/components/modal/index.mjs +6 -6
  84. package/dist/components/modal/modal.js +31 -10
  85. package/dist/components/modal/modal.mjs +6 -6
  86. package/dist/components/pagination/index.js +23 -0
  87. package/dist/components/pagination/index.mjs +4 -4
  88. package/dist/components/pagination/pagination.js +23 -0
  89. package/dist/components/pagination/pagination.mjs +4 -4
  90. package/dist/components/ripple/index.mjs +3 -3
  91. package/dist/components/select/index.js +23 -0
  92. package/dist/components/select/index.mjs +3 -3
  93. package/dist/components/select/select.js +23 -0
  94. package/dist/components/select/select.mjs +3 -3
  95. package/dist/components/table/index.js +23 -0
  96. package/dist/components/table/index.mjs +10 -10
  97. package/dist/components/table/table.js +23 -0
  98. package/dist/components/table/table.mjs +7 -7
  99. package/dist/components/toast/index.js +23 -0
  100. package/dist/components/toast/index.mjs +4 -4
  101. package/dist/components/toast/toast.js +23 -0
  102. package/dist/components/toast/toast.mjs +3 -3
  103. package/dist/components/toast/use-toast.js +23 -0
  104. package/dist/components/toast/use-toast.mjs +4 -4
  105. package/dist/components/tree/index.js +23 -0
  106. package/dist/components/tree/index.mjs +3 -3
  107. package/dist/components/tree/tree.js +23 -0
  108. package/dist/components/tree/tree.mjs +3 -3
  109. package/dist/index.d.mts +1 -0
  110. package/dist/index.d.ts +1 -0
  111. package/dist/index.js +408 -225
  112. package/dist/index.mjs +38 -33
  113. package/package.json +1 -1
@@ -0,0 +1,89 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from 'tailwind-variants';
3
+ import * as react from 'react';
4
+ import { ReactNode } from 'react';
5
+ import { SlotsToClasses } from '../../utils/types.mjs';
6
+
7
+ interface DrawerProps extends VariantProps<typeof drawer> {
8
+ isOpen?: boolean;
9
+ position?: "left" | "right" | "top" | "bottom";
10
+ content?: ReactNode | string;
11
+ isKeyboardDismissDisabled?: boolean;
12
+ onClose?: () => void;
13
+ classNames?: SlotsToClasses<DrawerSlots>;
14
+ backdrop?: boolean;
15
+ }
16
+ declare const Drawer: react.ForwardRefExoticComponent<DrawerProps & react.RefAttributes<HTMLDivElement>>;
17
+ declare const drawer: tailwind_variants.TVReturnType<{
18
+ position: {
19
+ left: {
20
+ base: string;
21
+ drawerWrapper: string;
22
+ };
23
+ right: {
24
+ base: string;
25
+ drawerWrapper: string;
26
+ };
27
+ top: {
28
+ base: string;
29
+ drawerWrapper: string;
30
+ };
31
+ bottom: {
32
+ base: string;
33
+ drawerWrapper: string;
34
+ };
35
+ };
36
+ }, {
37
+ base: string[];
38
+ drawerWrapper: string[];
39
+ wrapper: string[];
40
+ }, undefined, {
41
+ position: {
42
+ left: {
43
+ base: string;
44
+ drawerWrapper: string;
45
+ };
46
+ right: {
47
+ base: string;
48
+ drawerWrapper: string;
49
+ };
50
+ top: {
51
+ base: string;
52
+ drawerWrapper: string;
53
+ };
54
+ bottom: {
55
+ base: string;
56
+ drawerWrapper: string;
57
+ };
58
+ };
59
+ }, {
60
+ base: string[];
61
+ drawerWrapper: string[];
62
+ wrapper: string[];
63
+ }, tailwind_variants.TVReturnType<{
64
+ position: {
65
+ left: {
66
+ base: string;
67
+ drawerWrapper: string;
68
+ };
69
+ right: {
70
+ base: string;
71
+ drawerWrapper: string;
72
+ };
73
+ top: {
74
+ base: string;
75
+ drawerWrapper: string;
76
+ };
77
+ bottom: {
78
+ base: string;
79
+ drawerWrapper: string;
80
+ };
81
+ };
82
+ }, {
83
+ base: string[];
84
+ drawerWrapper: string[];
85
+ wrapper: string[];
86
+ }, undefined, unknown, unknown, undefined>>;
87
+ type DrawerSlots = keyof ReturnType<typeof drawer>;
88
+
89
+ export { type DrawerProps, Drawer as default };
@@ -0,0 +1,89 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from 'tailwind-variants';
3
+ import * as react from 'react';
4
+ import { ReactNode } from 'react';
5
+ import { SlotsToClasses } from '../../utils/types.js';
6
+
7
+ interface DrawerProps extends VariantProps<typeof drawer> {
8
+ isOpen?: boolean;
9
+ position?: "left" | "right" | "top" | "bottom";
10
+ content?: ReactNode | string;
11
+ isKeyboardDismissDisabled?: boolean;
12
+ onClose?: () => void;
13
+ classNames?: SlotsToClasses<DrawerSlots>;
14
+ backdrop?: boolean;
15
+ }
16
+ declare const Drawer: react.ForwardRefExoticComponent<DrawerProps & react.RefAttributes<HTMLDivElement>>;
17
+ declare const drawer: tailwind_variants.TVReturnType<{
18
+ position: {
19
+ left: {
20
+ base: string;
21
+ drawerWrapper: string;
22
+ };
23
+ right: {
24
+ base: string;
25
+ drawerWrapper: string;
26
+ };
27
+ top: {
28
+ base: string;
29
+ drawerWrapper: string;
30
+ };
31
+ bottom: {
32
+ base: string;
33
+ drawerWrapper: string;
34
+ };
35
+ };
36
+ }, {
37
+ base: string[];
38
+ drawerWrapper: string[];
39
+ wrapper: string[];
40
+ }, undefined, {
41
+ position: {
42
+ left: {
43
+ base: string;
44
+ drawerWrapper: string;
45
+ };
46
+ right: {
47
+ base: string;
48
+ drawerWrapper: string;
49
+ };
50
+ top: {
51
+ base: string;
52
+ drawerWrapper: string;
53
+ };
54
+ bottom: {
55
+ base: string;
56
+ drawerWrapper: string;
57
+ };
58
+ };
59
+ }, {
60
+ base: string[];
61
+ drawerWrapper: string[];
62
+ wrapper: string[];
63
+ }, tailwind_variants.TVReturnType<{
64
+ position: {
65
+ left: {
66
+ base: string;
67
+ drawerWrapper: string;
68
+ };
69
+ right: {
70
+ base: string;
71
+ drawerWrapper: string;
72
+ };
73
+ top: {
74
+ base: string;
75
+ drawerWrapper: string;
76
+ };
77
+ bottom: {
78
+ base: string;
79
+ drawerWrapper: string;
80
+ };
81
+ };
82
+ }, {
83
+ base: string[];
84
+ drawerWrapper: string[];
85
+ wrapper: string[];
86
+ }, undefined, unknown, unknown, undefined>>;
87
+ type DrawerSlots = keyof ReturnType<typeof drawer>;
88
+
89
+ export { type DrawerProps, Drawer as default };
@@ -0,0 +1,544 @@
1
+ "use client";
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __commonJS = (cb, mod) => function __require() {
10
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
+ };
12
+ var __export = (target, all) => {
13
+ for (var name in all)
14
+ __defProp(target, name, { get: all[name], enumerable: true });
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+
34
+ // ../../node_modules/tailwindcss/lib/util/createPlugin.js
35
+ var require_createPlugin = __commonJS({
36
+ "../../node_modules/tailwindcss/lib/util/createPlugin.js"(exports2) {
37
+ "use strict";
38
+ Object.defineProperty(exports2, "__esModule", {
39
+ value: true
40
+ });
41
+ Object.defineProperty(exports2, "default", {
42
+ enumerable: true,
43
+ get: function() {
44
+ return _default;
45
+ }
46
+ });
47
+ function createPlugin(plugin2, config) {
48
+ return {
49
+ handler: plugin2,
50
+ config
51
+ };
52
+ }
53
+ createPlugin.withOptions = function(pluginFunction, configFunction = () => ({})) {
54
+ const optionsFunction = function(options) {
55
+ return {
56
+ __options: options,
57
+ handler: pluginFunction(options),
58
+ config: configFunction(options)
59
+ };
60
+ };
61
+ optionsFunction.__isOptionsFunction = true;
62
+ optionsFunction.__pluginFunction = pluginFunction;
63
+ optionsFunction.__configFunction = configFunction;
64
+ return optionsFunction;
65
+ };
66
+ var _default = createPlugin;
67
+ }
68
+ });
69
+
70
+ // ../../node_modules/tailwindcss/lib/public/create-plugin.js
71
+ var require_create_plugin = __commonJS({
72
+ "../../node_modules/tailwindcss/lib/public/create-plugin.js"(exports2) {
73
+ "use strict";
74
+ Object.defineProperty(exports2, "__esModule", {
75
+ value: true
76
+ });
77
+ Object.defineProperty(exports2, "default", {
78
+ enumerable: true,
79
+ get: function() {
80
+ return _default;
81
+ }
82
+ });
83
+ var _createPlugin = /* @__PURE__ */ _interop_require_default(require_createPlugin());
84
+ function _interop_require_default(obj) {
85
+ return obj && obj.__esModule ? obj : {
86
+ default: obj
87
+ };
88
+ }
89
+ var _default = _createPlugin.default;
90
+ }
91
+ });
92
+
93
+ // ../../node_modules/tailwindcss/plugin.js
94
+ var require_plugin = __commonJS({
95
+ "../../node_modules/tailwindcss/plugin.js"(exports2, module2) {
96
+ "use strict";
97
+ var createPlugin = require_create_plugin();
98
+ module2.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default;
99
+ }
100
+ });
101
+
102
+ // src/components/drawer/drawer.tsx
103
+ var drawer_exports = {};
104
+ __export(drawer_exports, {
105
+ default: () => drawer_default
106
+ });
107
+ module.exports = __toCommonJS(drawer_exports);
108
+ var import_react = require("react");
109
+ var import_react_dom = require("react-dom");
110
+
111
+ // src/utils/tailwind-variants.ts
112
+ var import_tailwind_variants = require("tailwind-variants");
113
+
114
+ // ../tailwind-config/src/plugin.ts
115
+ var import_plugin = __toESM(require_plugin());
116
+
117
+ // ../tailwind-config/src/typography/font.ts
118
+ var fontSize = {
119
+ h1: [
120
+ "40px",
121
+ {
122
+ fontWeight: "700"
123
+ }
124
+ ],
125
+ h2: [
126
+ "34px",
127
+ {
128
+ fontWeight: "700"
129
+ }
130
+ ],
131
+ h3: [
132
+ "28px",
133
+ {
134
+ fontWeight: "700"
135
+ }
136
+ ],
137
+ h4: [
138
+ "24px",
139
+ {
140
+ fontWeight: "700"
141
+ }
142
+ ],
143
+ h5: [
144
+ "20px",
145
+ {
146
+ fontWeight: "600"
147
+ }
148
+ ],
149
+ sm: [
150
+ "12px",
151
+ {
152
+ lineHeight: "18px",
153
+ fontWeight: "400"
154
+ }
155
+ ],
156
+ md: [
157
+ "14px",
158
+ {
159
+ lineHeight: "21px",
160
+ fontWeight: "400"
161
+ }
162
+ ],
163
+ lg: [
164
+ "16px",
165
+ {
166
+ lineHeight: "24px",
167
+ fontWeight: "400"
168
+ }
169
+ ],
170
+ xl: [
171
+ "18px",
172
+ {
173
+ lineHeight: "27px",
174
+ fontWeight: "400"
175
+ }
176
+ ]
177
+ };
178
+
179
+ // ../tailwind-config/src/animation/slide.ts
180
+ var sliceAnimation = {
181
+ slideInFromTop: "slideInFromTop 0.5s ease-out",
182
+ slideInFromBottom: "slideInFromBottom 0.5s ease-out",
183
+ slideInFromLeft: "slideInFromLeft 0.5s ease-out",
184
+ slideInFromRight: "slideInFromRight 0.5s ease-out",
185
+ slideOutToTop: "slideOutToTop 0.5s ease-in",
186
+ slideOutToBottom: "slideOutToBottom 0.5s ease-in",
187
+ slideOutToLeft: "slideOutToLeft 0.5s ease-in",
188
+ slideOutToRight: "slideOutToRight 0.5s ease-in"
189
+ };
190
+ var sliceKeyframe = {
191
+ slideInFromTop: {
192
+ "0%": {
193
+ transform: "translateY(-10px)",
194
+ opacity: "0"
195
+ },
196
+ "100%": {
197
+ transform: "translateY(0)",
198
+ opacity: "1"
199
+ }
200
+ },
201
+ slideInFromBottom: {
202
+ "0%": {
203
+ transform: "translateY(10px)",
204
+ opacity: "0"
205
+ },
206
+ "100%": {
207
+ transform: "translateY(0)",
208
+ opacity: "1"
209
+ }
210
+ },
211
+ slideInFromLeft: {
212
+ "0%": {
213
+ transform: "translateX(-10px)",
214
+ opacity: "0"
215
+ },
216
+ "100%": {
217
+ transform: "translateX(0)",
218
+ opacity: "1"
219
+ }
220
+ },
221
+ slideInFromRight: {
222
+ "0%": {
223
+ transform: "translateX(10px)",
224
+ opacity: "0"
225
+ },
226
+ "100%": {
227
+ transform: "translateX(0)",
228
+ opacity: "1"
229
+ }
230
+ },
231
+ slideOutToTop: {
232
+ "0%": {
233
+ transform: "translateY(0)",
234
+ opacity: "1"
235
+ },
236
+ "100%": {
237
+ transform: "translateY(-10px)",
238
+ opacity: "0"
239
+ }
240
+ },
241
+ slideOutToBottom: {
242
+ "0%": {
243
+ transform: "translateY(0)",
244
+ opacity: "1"
245
+ },
246
+ "100%": {
247
+ transform: "translateY(10px)",
248
+ opacity: "0"
249
+ }
250
+ },
251
+ slideOutToLeft: {
252
+ "0%": {
253
+ transform: "translateX(0)",
254
+ opacity: "1"
255
+ },
256
+ "100%": {
257
+ transform: "translateX(-10px)",
258
+ opacity: "0"
259
+ }
260
+ },
261
+ slideOutToRight: {
262
+ "0%": {
263
+ transform: "translateX(0)",
264
+ opacity: "1"
265
+ },
266
+ "100%": {
267
+ transform: "translateX(10px)",
268
+ opacity: "0"
269
+ }
270
+ }
271
+ };
272
+
273
+ // ../tailwind-config/src/animation/index.ts
274
+ var animation = { ...sliceAnimation };
275
+ var keyframes = { ...sliceKeyframe };
276
+
277
+ // ../tailwind-config/src/shadow/index.ts
278
+ var boxShadow = {
279
+ "border-1": "inner 0 0 0 1px inset",
280
+ "border-2": "inner 0 0 0 2px inset",
281
+ "border-3": "inner 0 0 0 3px inset",
282
+ "border-4": "inner 0 0 0 4px inset",
283
+ "border-5": "inner 0 0 0 5px inset",
284
+ "border-6": "inner 0 0 0 6px inset",
285
+ "border-7": "inner 0 0 0 7px inset",
286
+ "border-8": "inner 0 0 0 8px inset",
287
+ "border-9": "inner 0 0 0 9px inset",
288
+ "border-10": "inner 0 0 0 10px inset",
289
+ inner: "inset 0 4px 8px 0 rgba(36, 39, 44, 0.2)",
290
+ drop: "0 20px 40px 0 rgba(36, 39, 44, 0.2)"
291
+ };
292
+
293
+ // ../tailwind-config/src/border/radius.ts
294
+ var borderRadius = {
295
+ sm: "4px",
296
+ md: "6px",
297
+ lg: "8px",
298
+ xl: "10px",
299
+ none: "0",
300
+ full: "9999px"
301
+ };
302
+
303
+ // ../tailwind-config/src/space/gap.ts
304
+ var gap = {
305
+ sm: "4px",
306
+ md: "6px",
307
+ lg: "8px",
308
+ xl: "10px"
309
+ };
310
+
311
+ // src/utils/tailwind-variants.ts
312
+ function typedKeys(obj) {
313
+ return Object.keys(obj);
314
+ }
315
+ var COMMON_SIZE = ["sm", "md", "lg", "xl"];
316
+ var tv = (0, import_tailwind_variants.createTV)({
317
+ twMergeConfig: {
318
+ classGroups: {
319
+ fontSize: [{ text: [...typedKeys(fontSize)] }],
320
+ borderRadius: [{ rounded: [...typedKeys(borderRadius)] }],
321
+ boxShadow: [{ shadow: [...typedKeys(boxShadow)] }],
322
+ padding: [{ p: [...COMMON_SIZE] }],
323
+ gap: [{ gap: [...typedKeys(gap)] }]
324
+ }
325
+ }
326
+ });
327
+
328
+ // src/utils/props.ts
329
+ var mapPropsVariants = (props, variantKeys, removeVariantProps = true) => {
330
+ if (!variantKeys) {
331
+ return [props, {}];
332
+ }
333
+ const picked = variantKeys.reduce((acc, key) => {
334
+ if (key in props) {
335
+ return { ...acc, [key]: props[key] };
336
+ } else {
337
+ return acc;
338
+ }
339
+ }, {});
340
+ if (removeVariantProps) {
341
+ const omitted = Object.keys(props).filter((key) => !variantKeys.includes(key)).reduce((acc, key) => ({ ...acc, [key]: props[key] }), {});
342
+ return [omitted, picked];
343
+ } else {
344
+ return [props, picked];
345
+ }
346
+ };
347
+
348
+ // src/utils/clsx.ts
349
+ function clsx(...args) {
350
+ var i = 0, tmp, x, str = "";
351
+ while (i < args.length) {
352
+ if (tmp = args[i++]) {
353
+ if (x = toVal(tmp)) {
354
+ str && (str += " ");
355
+ str += x;
356
+ }
357
+ }
358
+ }
359
+ return str;
360
+ }
361
+ function toVal(mix) {
362
+ var k, y, str = "";
363
+ if (typeof mix === "string" || typeof mix === "number") {
364
+ str += mix;
365
+ } else if (typeof mix === "object") {
366
+ if (Array.isArray(mix)) {
367
+ var len = mix.length;
368
+ for (k = 0; k < len; k++) {
369
+ if (mix[k]) {
370
+ if (y = toVal(mix[k])) {
371
+ str && (str += " ");
372
+ str += y;
373
+ }
374
+ }
375
+ }
376
+ } else {
377
+ for (y in mix) {
378
+ if (mix[y]) {
379
+ str && (str += " ");
380
+ str += y;
381
+ }
382
+ }
383
+ }
384
+ }
385
+ return str;
386
+ }
387
+
388
+ // src/components/drawer/drawer.tsx
389
+ var import_jsx_runtime = require("react/jsx-runtime");
390
+ var Drawer = (0, import_react.forwardRef)((props, ref) => {
391
+ const [localProps, variantProps] = mapPropsVariants(props, drawer.variantKeys);
392
+ const { classNames, isOpen, content, isKeyboardDismissDisabled = false, onClose, backdrop = true } = localProps;
393
+ const position = props.position || "right";
394
+ const [shouldRender, setShouldRender] = (0, import_react.useState)(isOpen);
395
+ const [isAnimating, setIsAnimating] = (0, import_react.useState)(isOpen);
396
+ const [isContentAnimating, setIsContentAnimating] = (0, import_react.useState)(isOpen);
397
+ const slots = (0, import_react.useMemo)(() => drawer(variantProps), [variantProps]);
398
+ (0, import_react.useEffect)(() => {
399
+ if (isOpen) {
400
+ setShouldRender(true);
401
+ requestAnimationFrame(() => {
402
+ setIsAnimating(true);
403
+ setTimeout(() => {
404
+ setIsContentAnimating(true);
405
+ }, 50);
406
+ });
407
+ } else {
408
+ setIsContentAnimating(false);
409
+ setIsAnimating(false);
410
+ const timer = setTimeout(() => {
411
+ setShouldRender(false);
412
+ }, 300);
413
+ return () => clearTimeout(timer);
414
+ }
415
+ }, [isOpen]);
416
+ (0, import_react.useEffect)(() => {
417
+ if (shouldRender) {
418
+ document.body.classList.add("overflow-hidden");
419
+ } else {
420
+ document.body.classList.remove("overflow-hidden");
421
+ }
422
+ if (!isOpen || isKeyboardDismissDisabled) return;
423
+ const handleKeyDown = (e) => {
424
+ if (e.key === "Escape") onClose == null ? void 0 : onClose();
425
+ };
426
+ document.addEventListener("keydown", handleKeyDown);
427
+ return () => {
428
+ document.removeEventListener("keydown", handleKeyDown);
429
+ };
430
+ }, [shouldRender, isOpen, isKeyboardDismissDisabled, onClose]);
431
+ const getAnimationClasses = () => {
432
+ const baseTransition = "transform transition-all duration-300 ease-in-out";
433
+ if (!isContentAnimating) {
434
+ switch (position) {
435
+ case "left":
436
+ return `${baseTransition} -translate-x-full`;
437
+ case "right":
438
+ return `${baseTransition} translate-x-full`;
439
+ case "top":
440
+ return `${baseTransition} -translate-y-full`;
441
+ case "bottom":
442
+ return `${baseTransition} translate-y-full`;
443
+ default:
444
+ return `${baseTransition} translate-x-full`;
445
+ }
446
+ }
447
+ return `${baseTransition} translate-x-0 translate-y-0`;
448
+ };
449
+ if (!shouldRender) return null;
450
+ return (0, import_react_dom.createPortal)(
451
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
452
+ "div",
453
+ {
454
+ ref,
455
+ className: slots.base({
456
+ class: clsx(
457
+ classNames == null ? void 0 : classNames.base,
458
+ isAnimating ? "visible opacity-100" : "invisible opacity-0",
459
+ "transition-all duration-300 ease-in-out"
460
+ )
461
+ }),
462
+ "aria-labelledby": "drawer",
463
+ role: "dialog",
464
+ "aria-modal": "true",
465
+ children: [
466
+ backdrop && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-black/50 backdrop-blur-sm", onClick: onClose }),
467
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
468
+ "div",
469
+ {
470
+ className: slots.drawerWrapper({
471
+ class: clsx(classNames == null ? void 0 : classNames.drawerWrapper, getAnimationClasses())
472
+ }),
473
+ onClick: (e) => e.stopPropagation(),
474
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: content })
475
+ }
476
+ )
477
+ ]
478
+ }
479
+ ),
480
+ document.body
481
+ );
482
+ });
483
+ Drawer.displayName = "Drawer";
484
+ var drawer = tv({
485
+ slots: {
486
+ base: ["fixed", "inset-0", "z-50", "flex", "transition-all", "duration-300", "ease-in-out"],
487
+ drawerWrapper: ["relative", "flex", "flex-col", "bg-white", "shadow-xl", "overflow-hidden", "z-10"],
488
+ wrapper: ["flex", "flex-col", "h-full", "overflow-y-auto"]
489
+ },
490
+ variants: {
491
+ position: {
492
+ left: {
493
+ base: "justify-start",
494
+ drawerWrapper: "h-full border-r"
495
+ },
496
+ right: {
497
+ base: "justify-end",
498
+ drawerWrapper: "h-full border-l"
499
+ },
500
+ top: {
501
+ base: "items-start",
502
+ drawerWrapper: "w-full border-b"
503
+ },
504
+ bottom: {
505
+ base: "items-end",
506
+ drawerWrapper: "w-full border-t"
507
+ }
508
+ }
509
+ },
510
+ compoundVariants: [
511
+ {
512
+ position: ["top", "bottom"],
513
+ size: "sm",
514
+ class: {
515
+ drawerWrapper: "max-h-[25vh] max-w-none w-full"
516
+ }
517
+ },
518
+ {
519
+ position: ["top", "bottom"],
520
+ size: "md",
521
+ class: {
522
+ drawerWrapper: "max-h-[40vh] max-w-none w-full"
523
+ }
524
+ },
525
+ {
526
+ position: ["top", "bottom"],
527
+ size: "lg",
528
+ class: {
529
+ drawerWrapper: "max-h-[60vh] max-w-none w-full"
530
+ }
531
+ },
532
+ {
533
+ position: ["top", "bottom"],
534
+ size: "xl",
535
+ class: {
536
+ drawerWrapper: "max-h-[80vh] max-w-none w-full"
537
+ }
538
+ }
539
+ ],
540
+ defaultVariants: {
541
+ position: "right"
542
+ }
543
+ });
544
+ var drawer_default = Drawer;