@deepnoid/ui 0.1.19 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/.turbo/turbo-build.log +202 -183
  2. package/dist/assets/images/cogwheel.d.mts +2 -0
  3. package/dist/assets/images/cogwheel.d.ts +2 -0
  4. package/dist/assets/images/cogwheel.js +4 -0
  5. package/dist/assets/images/cogwheel.mjs +8 -0
  6. package/dist/assets/images/folder.d.mts +2 -0
  7. package/dist/assets/images/folder.d.ts +2 -0
  8. package/dist/assets/images/folder.js +4 -0
  9. package/dist/assets/images/folder.mjs +8 -0
  10. package/dist/chunk-2DLKV6TT.mjs +168 -0
  11. package/dist/{chunk-7TXQPX4O.mjs → chunk-2Y7IBUAZ.mjs} +19 -8
  12. package/dist/chunk-3BKCODIL.mjs +49 -0
  13. package/dist/{chunk-A7OXEUCC.mjs → chunk-3IU2RPSM.mjs} +75 -9
  14. package/dist/{chunk-3TJAGKKY.mjs → chunk-7CFOD7G4.mjs} +11 -9
  15. package/dist/chunk-7KUFDVGL.mjs +71 -0
  16. package/dist/chunk-7USF56CT.mjs +8 -0
  17. package/dist/{chunk-5ANQDLRS.mjs → chunk-DUPQBPI2.mjs} +4 -4
  18. package/dist/{chunk-K7Z6PVXE.mjs → chunk-EWZAHXN7.mjs} +7 -7
  19. package/dist/{chunk-BFM3LPBK.mjs → chunk-FBAR75U4.mjs} +4 -4
  20. package/dist/{chunk-RPDPB4JP.mjs → chunk-HQLSHEK6.mjs} +4 -4
  21. package/dist/{chunk-DADMVOYI.mjs → chunk-HWL7TPUN.mjs} +1 -1
  22. package/dist/chunk-IZM66FHP.mjs +8 -0
  23. package/dist/{chunk-QIDZXCYP.mjs → chunk-JHDYQCEE.mjs} +6 -6
  24. package/dist/chunk-MBLZYQCN.mjs +1 -0
  25. package/dist/{chunk-7A5M7DRD.mjs → chunk-MQI5SZWO.mjs} +7 -7
  26. package/dist/{chunk-3DPVPTHL.mjs → chunk-MV7RSV4D.mjs} +3 -3
  27. package/dist/chunk-MW7CSRIE.mjs +348 -0
  28. package/dist/chunk-OV7CZNXU.mjs +135 -0
  29. package/dist/{chunk-AG7AWQKH.mjs → chunk-Q6BZ76DI.mjs} +4 -4
  30. package/dist/{chunk-63WXGSTV.mjs → chunk-QHWFHOW2.mjs} +24 -14
  31. package/dist/{chunk-FONJYZKH.mjs → chunk-SDHQUYFI.mjs} +7 -7
  32. package/dist/{chunk-UHFJ7ZFM.mjs → chunk-UTC2D6GV.mjs} +6 -6
  33. package/dist/chunk-XGYQ6D3S.mjs +82 -0
  34. package/dist/{chunk-UYPVP36M.mjs → chunk-XQGD4ZIX.mjs} +1 -1
  35. package/dist/cogwheel-U2B3CWEL.png +0 -0
  36. package/dist/components/avatar/avatar.js +75 -9
  37. package/dist/components/avatar/avatar.mjs +2 -2
  38. package/dist/components/avatar/index.js +75 -9
  39. package/dist/components/avatar/index.mjs +2 -2
  40. package/dist/components/backdrop/backdrop.mjs +2 -2
  41. package/dist/components/backdrop/index.mjs +2 -2
  42. package/dist/components/breadcrumb/breadcrumb.js +75 -9
  43. package/dist/components/breadcrumb/breadcrumb.mjs +9 -9
  44. package/dist/components/breadcrumb/index.js +75 -9
  45. package/dist/components/breadcrumb/index.mjs +9 -9
  46. package/dist/components/button/button.js +75 -9
  47. package/dist/components/button/button.mjs +5 -5
  48. package/dist/components/button/icon-button.js +75 -9
  49. package/dist/components/button/icon-button.mjs +5 -5
  50. package/dist/components/button/index.js +75 -9
  51. package/dist/components/button/index.mjs +9 -9
  52. package/dist/components/button/text-button.mjs +3 -3
  53. package/dist/components/checkbox/checkbox.mjs +3 -3
  54. package/dist/components/checkbox/index.mjs +3 -3
  55. package/dist/components/chip/chip.js +75 -9
  56. package/dist/components/chip/chip.mjs +4 -4
  57. package/dist/components/chip/index.js +75 -9
  58. package/dist/components/chip/index.mjs +4 -4
  59. package/dist/components/dateTimePicker/calendar.js +75 -9
  60. package/dist/components/dateTimePicker/calendar.mjs +4 -4
  61. package/dist/components/dateTimePicker/dateTimePicker.js +75 -9
  62. package/dist/components/dateTimePicker/dateTimePicker.mjs +9 -9
  63. package/dist/components/dateTimePicker/index.js +75 -9
  64. package/dist/components/dateTimePicker/index.mjs +9 -9
  65. package/dist/components/dateTimePicker/timePicker.js +75 -9
  66. package/dist/components/dateTimePicker/timePicker.mjs +7 -7
  67. package/dist/components/icon/Icon.d.mts +6 -2
  68. package/dist/components/icon/Icon.d.ts +6 -2
  69. package/dist/components/icon/Icon.js +75 -9
  70. package/dist/components/icon/Icon.mjs +2 -2
  71. package/dist/components/icon/index.js +75 -9
  72. package/dist/components/icon/index.mjs +2 -2
  73. package/dist/components/icon/template.d.mts +2 -1
  74. package/dist/components/icon/template.d.ts +2 -1
  75. package/dist/components/icon/template.js +75 -9
  76. package/dist/components/icon/template.mjs +1 -1
  77. package/dist/components/input/index.js +89 -12
  78. package/dist/components/input/index.mjs +5 -5
  79. package/dist/components/input/input.js +89 -12
  80. package/dist/components/input/input.mjs +5 -5
  81. package/dist/components/list/index.js +75 -9
  82. package/dist/components/list/index.mjs +8 -8
  83. package/dist/components/list/list.mjs +2 -2
  84. package/dist/components/list/listItem.js +75 -9
  85. package/dist/components/list/listItem.mjs +5 -5
  86. package/dist/components/modal/index.d.mts +0 -3
  87. package/dist/components/modal/index.d.ts +0 -3
  88. package/dist/components/modal/index.js +205 -158
  89. package/dist/components/modal/index.mjs +11 -9
  90. package/dist/components/modal/modal.d.mts +43 -105
  91. package/dist/components/modal/modal.d.ts +43 -105
  92. package/dist/components/modal/modal.js +206 -164
  93. package/dist/components/modal/modal.mjs +12 -12
  94. package/dist/components/pagination/index.js +89 -12
  95. package/dist/components/pagination/index.mjs +6 -6
  96. package/dist/components/pagination/pagination.js +89 -12
  97. package/dist/components/pagination/pagination.mjs +6 -6
  98. package/dist/components/radio/index.mjs +3 -3
  99. package/dist/components/radio/radio.mjs +3 -3
  100. package/dist/components/ripple/index.mjs +3 -3
  101. package/dist/components/select/index.d.mts +1 -1
  102. package/dist/components/select/index.d.ts +1 -1
  103. package/dist/components/select/index.js +376 -295
  104. package/dist/components/select/index.mjs +5 -6
  105. package/dist/components/select/select.d.mts +190 -177
  106. package/dist/components/select/select.d.ts +190 -177
  107. package/dist/components/select/select.js +376 -295
  108. package/dist/components/select/select.mjs +5 -6
  109. package/dist/components/table/form-table.d.mts +52 -0
  110. package/dist/components/table/form-table.d.ts +52 -0
  111. package/dist/components/table/form-table.js +365 -0
  112. package/dist/components/table/form-table.mjs +9 -0
  113. package/dist/components/table/index.d.mts +2 -0
  114. package/dist/components/table/index.d.ts +2 -0
  115. package/dist/components/table/index.js +162 -30
  116. package/dist/components/table/index.mjs +15 -11
  117. package/dist/components/table/table-body.d.mts +3 -2
  118. package/dist/components/table/table-body.d.ts +3 -2
  119. package/dist/components/table/table-body.js +23 -13
  120. package/dist/components/table/table-body.mjs +4 -4
  121. package/dist/components/table/table-head.d.mts +2 -2
  122. package/dist/components/table/table-head.d.ts +2 -2
  123. package/dist/components/table/table-head.js +2 -2
  124. package/dist/components/table/table-head.mjs +4 -4
  125. package/dist/components/table/table.d.mts +2 -1
  126. package/dist/components/table/table.d.ts +2 -1
  127. package/dist/components/table/table.js +119 -30
  128. package/dist/components/table/table.mjs +10 -10
  129. package/dist/components/tabs/index.mjs +2 -2
  130. package/dist/components/tabs/tabs.mjs +2 -2
  131. package/dist/components/toast/index.js +239 -97
  132. package/dist/components/toast/index.mjs +6 -5
  133. package/dist/components/toast/toast.d.mts +40 -81
  134. package/dist/components/toast/toast.d.ts +40 -81
  135. package/dist/components/toast/toast.js +210 -56
  136. package/dist/components/toast/toast.mjs +5 -4
  137. package/dist/components/toast/use-toast.d.mts +6 -10
  138. package/dist/components/toast/use-toast.d.ts +6 -10
  139. package/dist/components/toast/use-toast.js +239 -97
  140. package/dist/components/toast/use-toast.mjs +6 -5
  141. package/dist/components/tooltip/index.mjs +2 -2
  142. package/dist/components/tooltip/tooltip.mjs +2 -2
  143. package/dist/components/tree/index.d.mts +2 -0
  144. package/dist/components/tree/index.d.ts +2 -0
  145. package/dist/components/tree/index.js +4371 -0
  146. package/dist/components/tree/index.mjs +15 -0
  147. package/dist/components/tree/tree.d.mts +20 -0
  148. package/dist/components/tree/tree.d.ts +20 -0
  149. package/dist/components/{select/option.js → tree/tree.js} +146 -74
  150. package/dist/components/tree/tree.mjs +14 -0
  151. package/dist/folder-RO3QTLGS.svg +9 -0
  152. package/dist/index.d.mts +3 -0
  153. package/dist/index.d.ts +3 -0
  154. package/dist/index.js +681 -545
  155. package/dist/index.mjs +71 -62
  156. package/package.json +1 -1
  157. package/types/images.d.ts +14 -0
  158. package/dist/chunk-5OBP42D6.mjs +0 -117
  159. package/dist/chunk-HDNQOLUJ.mjs +0 -83
  160. package/dist/chunk-MJT6ZW4C.mjs +0 -255
  161. package/dist/chunk-P6NVCCBZ.mjs +0 -76
  162. package/dist/chunk-RXIFDECK.mjs +0 -213
  163. package/dist/chunk-S3QS5B7F.mjs +0 -61
  164. package/dist/components/select/option.d.mts +0 -17
  165. package/dist/components/select/option.d.ts +0 -17
  166. package/dist/components/select/option.mjs +0 -12
  167. package/dist/components/select/useSelect.d.mts +0 -31
  168. package/dist/components/select/useSelect.d.ts +0 -31
  169. package/dist/components/select/useSelect.js +0 -84
  170. package/dist/components/select/useSelect.mjs +0 -8
  171. package/dist/{chunk-D6QI3DJG.mjs → chunk-7H5XPHY6.mjs} +4 -4
  172. package/dist/{chunk-2UUH2MBF.mjs → chunk-DX3KXNP6.mjs} +0 -0
  173. package/dist/{chunk-Z2537DF6.mjs → chunk-IL5ENWCR.mjs} +3 -3
  174. package/dist/{chunk-WFMFC7R6.mjs → chunk-KCOHU7X7.mjs} +4 -4
  175. package/dist/{chunk-LL6F3WDX.mjs → chunk-P5QCU457.mjs} +3 -3
  176. package/dist/{chunk-2YMAKIZ6.mjs → chunk-SSMMWMQC.mjs} +3 -3
  177. package/dist/{chunk-HIVPDIEP.mjs → chunk-UFVQPPPW.mjs} +3 -3
  178. package/dist/{chunk-QIRL6HY6.mjs → chunk-YIIFWADW.mjs} +4 -4
package/dist/index.mjs CHANGED
@@ -1,33 +1,40 @@
1
1
  "use client";
2
+ import "./chunk-LUWGOKLG.mjs";
3
+ import {
4
+ ToastProvider,
5
+ useToast
6
+ } from "./chunk-7KUFDVGL.mjs";
7
+ import "./chunk-ZOTHPHXA.mjs";
8
+ import {
9
+ toast_default
10
+ } from "./chunk-2DLKV6TT.mjs";
11
+ import "./chunk-RRAZM5D3.mjs";
12
+ import {
13
+ textarea_default
14
+ } from "./chunk-BKE6QF6W.mjs";
2
15
  import "./chunk-HIE2YRGA.mjs";
3
16
  import {
4
17
  tooltip_default
5
- } from "./chunk-Z2537DF6.mjs";
18
+ } from "./chunk-IL5ENWCR.mjs";
6
19
  import "./chunk-ZMOAFSYE.mjs";
7
20
  import "./chunk-WSIADHVC.mjs";
8
- import "./chunk-2UUH2MBF.mjs";
21
+ import "./chunk-MBLZYQCN.mjs";
22
+ import {
23
+ tree_default
24
+ } from "./chunk-XGYQ6D3S.mjs";
25
+ import "./chunk-DX3KXNP6.mjs";
26
+ import {
27
+ form_table_default
28
+ } from "./chunk-3BKCODIL.mjs";
9
29
  import {
10
30
  table_default
11
- } from "./chunk-3TJAGKKY.mjs";
12
- import "./chunk-63WXGSTV.mjs";
13
- import "./chunk-3DPVPTHL.mjs";
31
+ } from "./chunk-7CFOD7G4.mjs";
32
+ import "./chunk-QHWFHOW2.mjs";
33
+ import "./chunk-MV7RSV4D.mjs";
14
34
  import "./chunk-3MY6LO7N.mjs";
15
35
  import {
16
36
  tabs_default
17
- } from "./chunk-2YMAKIZ6.mjs";
18
- import "./chunk-RRAZM5D3.mjs";
19
- import {
20
- textarea_default
21
- } from "./chunk-BKE6QF6W.mjs";
22
- import "./chunk-LUWGOKLG.mjs";
23
- import {
24
- ToastProvider,
25
- useToast
26
- } from "./chunk-HDNQOLUJ.mjs";
27
- import "./chunk-ZOTHPHXA.mjs";
28
- import {
29
- toast_default
30
- } from "./chunk-5OBP42D6.mjs";
37
+ } from "./chunk-SSMMWMQC.mjs";
31
38
  import "./chunk-DQRAFUDA.mjs";
32
39
  import {
33
40
  scrollArea_default
@@ -35,93 +42,93 @@ import {
35
42
  import "./chunk-QCEKPS7U.mjs";
36
43
  import {
37
44
  select_default
38
- } from "./chunk-MJT6ZW4C.mjs";
39
- import "./chunk-P6NVCCBZ.mjs";
40
- import "./chunk-S3QS5B7F.mjs";
45
+ } from "./chunk-MW7CSRIE.mjs";
41
46
  import "./chunk-LVFI2NOH.mjs";
42
47
  import {
43
48
  switch_default
44
49
  } from "./chunk-Z74QNVPG.mjs";
50
+ import "./chunk-DJOG6Z35.mjs";
51
+ import {
52
+ modal_default
53
+ } from "./chunk-OV7CZNXU.mjs";
45
54
  import "./chunk-7B7LRG5J.mjs";
46
55
  import {
47
56
  pagination_default
48
- } from "./chunk-UHFJ7ZFM.mjs";
57
+ } from "./chunk-UTC2D6GV.mjs";
49
58
  import "./chunk-F3HENRVM.mjs";
50
59
  import "./chunk-TPFN22HR.mjs";
51
60
  import {
52
61
  radio_default
53
- } from "./chunk-QIRL6HY6.mjs";
62
+ } from "./chunk-YIIFWADW.mjs";
54
63
  import "./chunk-2GCSFWHD.mjs";
55
64
  import {
56
65
  input_default
57
- } from "./chunk-7TXQPX4O.mjs";
58
- import "./chunk-DJOG6Z35.mjs";
59
- import {
60
- modal_default
61
- } from "./chunk-RXIFDECK.mjs";
66
+ } from "./chunk-2Y7IBUAZ.mjs";
67
+ import "./chunk-QZ3LVYJW.mjs";
62
68
  import "./chunk-MGEWSREV.mjs";
69
+ import {
70
+ chip_default
71
+ } from "./chunk-FBAR75U4.mjs";
63
72
  import "./chunk-75HLCORR.mjs";
64
73
  import {
65
74
  dateTimePicker_default
66
- } from "./chunk-QIDZXCYP.mjs";
67
- import "./chunk-5ANQDLRS.mjs";
68
- import "./chunk-AG7AWQKH.mjs";
75
+ } from "./chunk-JHDYQCEE.mjs";
76
+ import "./chunk-DUPQBPI2.mjs";
77
+ import "./chunk-Q6BZ76DI.mjs";
69
78
  import "./chunk-7MVEAQ7Z.mjs";
70
- import {
71
- list_default
72
- } from "./chunk-HIVPDIEP.mjs";
73
79
  import {
74
80
  listItem_default
75
- } from "./chunk-FONJYZKH.mjs";
81
+ } from "./chunk-SDHQUYFI.mjs";
82
+ import {
83
+ list_default
84
+ } from "./chunk-UFVQPPPW.mjs";
76
85
  import "./chunk-FWJ2ZKH6.mjs";
77
86
  import "./chunk-P732YGHO.mjs";
78
- import "./chunk-QZ3LVYJW.mjs";
79
- import {
80
- checkbox_default
81
- } from "./chunk-D6QI3DJG.mjs";
82
- import {
83
- chip_default
84
- } from "./chunk-BFM3LPBK.mjs";
85
- import "./chunk-7DLOYKVC.mjs";
86
- import {
87
- avatar_default
88
- } from "./chunk-UYPVP36M.mjs";
89
- import "./chunk-SE5TU755.mjs";
90
- import {
91
- backdrop_default
92
- } from "./chunk-LL6F3WDX.mjs";
93
87
  import "./chunk-KYIODWXL.mjs";
94
88
  import {
95
89
  breadcrumb_default
96
- } from "./chunk-RPDPB4JP.mjs";
90
+ } from "./chunk-HQLSHEK6.mjs";
97
91
  import "./chunk-MY5U63QO.mjs";
98
92
  import {
99
93
  button_group_default
100
94
  } from "./chunk-LPZOH3RP.mjs";
101
95
  import {
102
96
  button_default
103
- } from "./chunk-7A5M7DRD.mjs";
97
+ } from "./chunk-MQI5SZWO.mjs";
104
98
  import {
105
99
  icon_button_default
106
- } from "./chunk-K7Z6PVXE.mjs";
100
+ } from "./chunk-EWZAHXN7.mjs";
107
101
  import "./chunk-6WSACUIB.mjs";
108
- import "./chunk-6PNKRBUT.mjs";
109
102
  import "./chunk-LXHUO6VM.mjs";
110
- import {
111
- text_button_default
112
- } from "./chunk-WFMFC7R6.mjs";
103
+ import "./chunk-6PNKRBUT.mjs";
113
104
  import "./chunk-ZYIIXWVY.mjs";
114
105
  import {
115
106
  Icon_default,
116
107
  iconTemplate
117
- } from "./chunk-DADMVOYI.mjs";
118
- import "./chunk-A7OXEUCC.mjs";
108
+ } from "./chunk-HWL7TPUN.mjs";
109
+ import {
110
+ text_button_default
111
+ } from "./chunk-KCOHU7X7.mjs";
112
+ import {
113
+ checkbox_default
114
+ } from "./chunk-7H5XPHY6.mjs";
115
+ import "./chunk-E3G5QXSH.mjs";
116
+ import "./chunk-7DLOYKVC.mjs";
117
+ import {
118
+ avatar_default
119
+ } from "./chunk-XQGD4ZIX.mjs";
120
+ import "./chunk-3IU2RPSM.mjs";
121
+ import "./chunk-SE5TU755.mjs";
122
+ import {
123
+ backdrop_default
124
+ } from "./chunk-P5QCU457.mjs";
125
+ import "./chunk-27Y6K5NK.mjs";
119
126
  import {
120
127
  deepnoidUi,
121
128
  tv
122
129
  } from "./chunk-4ZJFD3L3.mjs";
123
- import "./chunk-27Y6K5NK.mjs";
124
- import "./chunk-E3G5QXSH.mjs";
130
+ import "./chunk-7USF56CT.mjs";
131
+ import "./chunk-IZM66FHP.mjs";
125
132
  import "./chunk-AC6TWLRT.mjs";
126
133
  export {
127
134
  avatar_default as Avatar,
@@ -132,6 +139,7 @@ export {
132
139
  checkbox_default as CheckBox,
133
140
  chip_default as Chip,
134
141
  dateTimePicker_default as DateTimePicker,
142
+ form_table_default as FormTable,
135
143
  Icon_default as Icon,
136
144
  icon_button_default as IconButton,
137
145
  input_default as Input,
@@ -150,6 +158,7 @@ export {
150
158
  toast_default as Toast,
151
159
  ToastProvider,
152
160
  tooltip_default as Tooltip,
161
+ tree_default as Tree,
153
162
  deepnoidUi,
154
163
  iconTemplate,
155
164
  tv,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepnoid/ui",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -0,0 +1,14 @@
1
+ declare module "*.png" {
2
+ const value: string;
3
+ export default value;
4
+ }
5
+
6
+ declare module "*.jpg" {
7
+ const value: string;
8
+ export default value;
9
+ }
10
+
11
+ declare module "*.svg" {
12
+ const value: string;
13
+ export default value;
14
+ }
@@ -1,117 +0,0 @@
1
- "use client";
2
- import {
3
- Icon_default
4
- } from "./chunk-DADMVOYI.mjs";
5
- import {
6
- tv
7
- } from "./chunk-4ZJFD3L3.mjs";
8
- import {
9
- mapPropsVariants
10
- } from "./chunk-E3G5QXSH.mjs";
11
-
12
- // src/components/toast/toast.tsx
13
- import { forwardRef, useCallback, useImperativeHandle, useMemo, useRef } from "react";
14
- import { jsx, jsxs } from "react/jsx-runtime";
15
- var Toast = forwardRef((originalProps, ref) => {
16
- const [props, variantProps] = mapPropsVariants(originalProps, toast.variantKeys);
17
- const { width = 300, placement, classNames, showIcon = true, showCloseButton = true, onClose, ...toastProps } = props;
18
- const slots = useMemo(() => toast({ ...variantProps }), [variantProps]);
19
- const toastRef = useRef(null);
20
- useImperativeHandle(
21
- ref,
22
- () => ({
23
- getWidth: () => {
24
- if (toastRef.current) {
25
- return toastRef.current.offsetWidth;
26
- }
27
- }
28
- }),
29
- []
30
- );
31
- const getBaseProps = useCallback(
32
- () => ({
33
- className: slots.base({
34
- class: [
35
- classNames == null ? void 0 : classNames.base,
36
- width ? `w-[${width}px]` : "",
37
- (placement == null ? void 0 : placement.includes("top")) ? "animate-slideInFromTop" : "animate-slideInFromBottom"
38
- ]
39
- })
40
- }),
41
- [slots, classNames == null ? void 0 : classNames.base]
42
- );
43
- return /* @__PURE__ */ jsxs("div", { ref: toastRef, ...getBaseProps(), children: [
44
- showIcon && /* @__PURE__ */ jsx(Icon_default, { name: originalProps.icon || "info-circle", fill: true, className: "mt-[2px]" }),
45
- /* @__PURE__ */ jsx("div", { className: "flex-1 select-none", children: props.content }),
46
- showCloseButton && /* @__PURE__ */ jsx(Icon_default, { name: "close", className: "cursor-pointer mt-[2px]", onClick: onClose })
47
- ] });
48
- });
49
- Toast.displayName = "Toast";
50
- var toast_default = Toast;
51
- var toast = tv({
52
- slots: {
53
- base: [
54
- "relative",
55
- "inline-flex",
56
- "items-start",
57
- "border",
58
- "rounded-md",
59
- "text-md",
60
- "p-[10px]",
61
- "gap-[5px]",
62
- "z-0",
63
- "transition-all",
64
- "duration-300",
65
- "overflow-auto"
66
- ],
67
- content: [
68
- "absolute",
69
- "top-0",
70
- "left-0",
71
- "inline-flex",
72
- "items-center",
73
- "justify-center",
74
- "font-[500]",
75
- "text-white",
76
- "bg-trans-strong"
77
- ]
78
- },
79
- variants: {
80
- color: {
81
- primary: {
82
- base: "bg-primary-soft border-primary-light text-primary-main"
83
- },
84
- secondary: {
85
- base: "bg-secondary-soft border-secondary-light text-secondary-main"
86
- },
87
- default: {
88
- base: "bg-default-soft border-default-light text-default-main"
89
- },
90
- success: {
91
- base: "bg-success-soft border-success-light text-success-main"
92
- },
93
- info: {
94
- base: "bg-info-soft border-info-light text-info-main"
95
- },
96
- warning: {
97
- base: "bg-warning-soft border-warning-light text-warning-main"
98
- },
99
- danger: {
100
- base: "bg-danger-soft border-danger-light text-danger-main"
101
- }
102
- },
103
- disableAnimation: {
104
- true: {
105
- base: "animate-none"
106
- }
107
- }
108
- },
109
- defaultVariants: {
110
- color: "default",
111
- disableAnimation: false
112
- }
113
- });
114
-
115
- export {
116
- toast_default
117
- };
@@ -1,83 +0,0 @@
1
- "use client";
2
- import {
3
- getToastPosition
4
- } from "./chunk-ZOTHPHXA.mjs";
5
- import {
6
- toast_default
7
- } from "./chunk-5OBP42D6.mjs";
8
-
9
- // src/components/toast/use-toast.tsx
10
- import { createContext, useContext, useState, useCallback, useEffect, useRef } from "react";
11
- import { jsx, jsxs } from "react/jsx-runtime";
12
- var ToastContext = createContext(null);
13
- var useToast = () => {
14
- const context = useContext(ToastContext);
15
- if (!context) {
16
- throw new Error("useToast must be used within a ToastProvider");
17
- }
18
- return context;
19
- };
20
- var ToastProvider = ({
21
- globalOptions,
22
- children
23
- }) => {
24
- const [toasts, setToasts] = useState([]);
25
- const [containerStyle, setContainerStyle] = useState({});
26
- const toastRef = useRef(null);
27
- const addToast = useCallback((content, options) => {
28
- const id = Date.now() + Math.floor(Math.random() * 1e5);
29
- const newToast = {
30
- id,
31
- content,
32
- ...options
33
- };
34
- setToasts((prevToasts) => [...prevToasts, newToast]);
35
- setTimeout(() => {
36
- setToasts((prevToasts) => prevToasts.filter((toast) => toast.id !== id));
37
- }, options.duration || 3e3);
38
- }, []);
39
- const removeToast = useCallback((id) => {
40
- setToasts((prevToasts) => prevToasts.filter((toast) => toast.id !== id));
41
- }, []);
42
- const value = {
43
- default: (content, options) => addToast(content, { type: "default", icon: "info-circle", color: "default", ...globalOptions, ...options }),
44
- info: (content, options) => addToast(content, { type: "info", icon: "info-circle", color: "info", ...globalOptions, ...options }),
45
- success: (content, options) => addToast(content, { type: "success", icon: "check-circle", color: "success", ...globalOptions, ...options }),
46
- warning: (content, options) => addToast(content, {
47
- type: "warning",
48
- icon: "exclamation-triangle",
49
- color: "warning",
50
- ...globalOptions,
51
- ...options
52
- }),
53
- error: (content, options) => addToast(content, { type: "error", icon: "exclamation-circle", color: "danger", ...globalOptions, ...options })
54
- };
55
- useEffect(() => {
56
- var _a;
57
- const width = (globalOptions == null ? void 0 : globalOptions.width) ? globalOptions == null ? void 0 : globalOptions.width : typeof ((_a = toastRef.current) == null ? void 0 : _a.getWidth) === "function" ? toastRef.current.getWidth() : 300;
58
- const offset = 20;
59
- const calculatePosition = () => {
60
- const placement = (globalOptions == null ? void 0 : globalOptions.placement) || "bottom-right";
61
- const { top, left, bottom, right } = getToastPosition(placement, width, offset);
62
- setContainerStyle({
63
- position: "fixed",
64
- top: top !== void 0 ? `${top}px` : void 0,
65
- left: left !== void 0 ? `${left}px` : void 0,
66
- bottom: bottom !== void 0 ? `${bottom}px` : void 0,
67
- right: right !== void 0 ? `${right}px` : void 0
68
- });
69
- };
70
- calculatePosition();
71
- window.addEventListener("resize", calculatePosition);
72
- return () => window.removeEventListener("resize", calculatePosition);
73
- }, [globalOptions == null ? void 0 : globalOptions.placement, globalOptions == null ? void 0 : globalOptions.width]);
74
- return /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
75
- children,
76
- /* @__PURE__ */ jsx("div", { id: "deepnoid-toast-container", className: "flex flex-col gap-[10px]", style: containerStyle, children: toasts.map((toast) => /* @__PURE__ */ jsx(toast_default, { ref: toastRef, onClose: () => removeToast(toast.id), ...toast }, toast.id)) })
77
- ] });
78
- };
79
-
80
- export {
81
- useToast,
82
- ToastProvider
83
- };
@@ -1,255 +0,0 @@
1
- "use client";
2
- import {
3
- option_default
4
- } from "./chunk-P6NVCCBZ.mjs";
5
- import {
6
- useSelect
7
- } from "./chunk-S3QS5B7F.mjs";
8
- import {
9
- Icon_default
10
- } from "./chunk-DADMVOYI.mjs";
11
- import {
12
- tv
13
- } from "./chunk-4ZJFD3L3.mjs";
14
- import {
15
- mapPropsVariants
16
- } from "./chunk-E3G5QXSH.mjs";
17
-
18
- // src/components/select/select.tsx
19
- import { forwardRef, useMemo, useCallback } from "react";
20
- import { createPortal } from "react-dom";
21
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
22
- var Select = forwardRef((originalProps, ref) => {
23
- const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
24
- const { classNames, options, defaultOption, onChange, ...inputProps } = props;
25
- const slots = useMemo(() => select({ ...variantProps }), [variantProps]);
26
- const {
27
- targetRect,
28
- selectedOption,
29
- optionWrapperHeight,
30
- selectWrapperRef,
31
- optionWrapperRef,
32
- handleToggleSelect,
33
- handleChangeOption,
34
- calculatePositionWithScroll
35
- } = useSelect({
36
- options,
37
- defaultOption,
38
- onChange
39
- });
40
- const position = targetRect ? calculatePositionWithScroll(targetRect, optionWrapperHeight) : null;
41
- const getBaseProps = useCallback(
42
- () => ({
43
- className: slots.base({ class: classNames == null ? void 0 : classNames.base })
44
- }),
45
- [slots, classNames]
46
- );
47
- const getLabelProps = useCallback(
48
- () => ({
49
- className: slots.label({ class: classNames == null ? void 0 : classNames.label })
50
- }),
51
- [slots, classNames]
52
- );
53
- const getSelectWrapperProps = useCallback(
54
- () => ({
55
- className: slots.selectWrapper({ class: classNames == null ? void 0 : classNames.selectWrapper }),
56
- ref: selectWrapperRef,
57
- onClick: handleToggleSelect
58
- }),
59
- [slots, classNames]
60
- );
61
- const getSelectProps = useCallback(
62
- () => ({
63
- ...inputProps,
64
- ref,
65
- className: slots.select({ class: classNames == null ? void 0 : classNames.select }),
66
- value: (selectedOption == null ? void 0 : selectedOption.value) || "",
67
- readOnly: true,
68
- size: 0
69
- }),
70
- [slots, classNames, inputProps, selectedOption, ref]
71
- );
72
- const getOptionsWrapperProps = useCallback(
73
- () => ({
74
- className: slots.optionsWrapper({ class: classNames == null ? void 0 : classNames.optionsWrapper }),
75
- ref: optionWrapperRef
76
- }),
77
- [slots, classNames]
78
- );
79
- const getErrorMessageProps = useCallback(
80
- () => ({
81
- className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
82
- }),
83
- [slots, classNames]
84
- );
85
- return /* @__PURE__ */ jsxs(Fragment, { children: [
86
- /* @__PURE__ */ jsxs("div", { ...getBaseProps(), children: [
87
- props.label && /* @__PURE__ */ jsx("label", { ...getLabelProps(), children: props.label }),
88
- /* @__PURE__ */ jsxs("div", { "data-expanded": !!targetRect, ...getSelectWrapperProps(), children: [
89
- /* @__PURE__ */ jsx("input", { ...getSelectProps() }),
90
- /* @__PURE__ */ jsx(Icon_default, { name: !!targetRect ? "arrow-triangle-up" : "arrow-triangle-down", size: originalProps.size, fill: true })
91
- ] }),
92
- props.errorMessage && /* @__PURE__ */ jsx("p", { ...getErrorMessageProps(), children: props.errorMessage })
93
- ] }),
94
- targetRect && /* @__PURE__ */ jsx(Fragment, { children: createPortal(
95
- /* @__PURE__ */ jsx(
96
- "div",
97
- {
98
- ...getOptionsWrapperProps(),
99
- style: {
100
- position: "absolute",
101
- top: position == null ? void 0 : position.top,
102
- left: position == null ? void 0 : position.left,
103
- width: targetRect.width
104
- },
105
- children: options.map((option) => /* @__PURE__ */ jsx(
106
- option_default,
107
- {
108
- variant: originalProps.variant,
109
- size: originalProps.size,
110
- color: originalProps.color,
111
- option,
112
- isSelected: (selectedOption == null ? void 0 : selectedOption.key) === option.key,
113
- onClick: () => handleChangeOption(option),
114
- children: option.value
115
- },
116
- option.key
117
- ))
118
- }
119
- ),
120
- document.body
121
- ) })
122
- ] });
123
- });
124
- Select.displayName = "Select";
125
- var select_default = Select;
126
- var select = tv({
127
- slots: {
128
- base: ["group/select", "flex flex-col"],
129
- label: ["flex", "items-center"],
130
- selectWrapper: [
131
- "flex",
132
- "items-center",
133
- "bg-transparent",
134
- "border-neutral-main",
135
- "transition duration-200",
136
- "group-has-[p]/select:border-danger-main",
137
- "group-has-[p]/select:text-danger-main",
138
- "group-has-[p]/select:bg-danger-soft"
139
- ],
140
- select: [
141
- "w-full",
142
- "bg-transparent",
143
- "text-foreground",
144
- "cursor-inherit",
145
- "cursor-pointer",
146
- "placeholder:text-neutral-main",
147
- "group-has-[p]/select:text-danger-main",
148
- "focus-visible:outline-none"
149
- ],
150
- optionsWrapper: ["w-[240px]", "border", "bg-background", "cursor-pointer", "overflow-y-auto"],
151
- errorMessage: ["text-danger-main"]
152
- },
153
- variants: {
154
- variant: {
155
- solid: {
156
- selectWrapper: "bg-trans-soft hover:bg-trans-light data-[expanded=true]:bg-trans-light group-has-[p]/select:bg-danger-soft"
157
- },
158
- normal: {
159
- selectWrapper: "border hover:bg-trans-soft data-[expanded=true]:bg-trans-soft"
160
- },
161
- line: {
162
- selectWrapper: "border-b !rounded-none hover:bg-trans-soft data-[expanded=true]:bg-trans-soft",
163
- optionsWrapper: "!rounded-none"
164
- }
165
- },
166
- color: {
167
- primary: {
168
- selectWrapper: "data-[expanded=true]:border-primary-main text-primary-main",
169
- optionsWrapper: "border-primary-main",
170
- select: "data-[expanded=true]:text-primary-main"
171
- },
172
- secondary: {
173
- selectWrapper: "data-[expanded=true]:border-secondary-main text-secondary-main",
174
- optionsWrapper: "border-secondary-main",
175
- select: "data-[expanded=true]:text-secondary-main"
176
- }
177
- },
178
- size: {
179
- sm: {
180
- base: "text-sm gap-[6px]",
181
- selectWrapper: "w-[240px] h-[24px] px-[6px] py-[4.5px] gap-[6px] rounded-sm",
182
- optionsWrapper: "max-h-[96px] rounded-sm",
183
- errorMessage: "text-sm"
184
- },
185
- md: {
186
- base: "text-md gap-[8px]",
187
- selectWrapper: "w-[240px] h-[30px] px-[8px] py-[6.5px] gap-[8px] rounded-md",
188
- optionsWrapper: "max-h-[120px] rounded-md",
189
- errorMessage: "text-md"
190
- },
191
- lg: {
192
- base: "text-lg gap-[10px]",
193
- selectWrapper: "w-[240px] h-[36px] px-[10px] py-[8px] gap-[10px] rounded-lg",
194
- optionsWrapper: "max-h-[144px] rounded-lg",
195
- errorMessage: "text-lg"
196
- },
197
- xl: {
198
- base: "text-lg gap-[10px]",
199
- selectWrapper: "w-[240px] h-[36px] px-[10px] py-[8px] gap-[10px] rounded-xl",
200
- optionsWrapper: "max-h-[144px] rounded-xl",
201
- errorMessage: "text-xl"
202
- }
203
- },
204
- radius: {
205
- default: "",
206
- none: {
207
- selectWrapper: "rounded-none",
208
- optionsWrapper: "rounded-none"
209
- },
210
- full: {
211
- selectWrapper: "rounded-full"
212
- }
213
- },
214
- fullWidth: {
215
- true: {
216
- selectWrapper: "w-full",
217
- optionsWrapper: "w-full"
218
- }
219
- },
220
- isDisabled: {
221
- true: {
222
- base: "cursor-default",
223
- selectWrapper: "bg-neutral-soft border-neutral-light text-neutral-light pointer-events-none",
224
- select: "text-neutral-light focus:text-neutral-light",
225
- label: "text-neutral-light"
226
- }
227
- },
228
- isRequired: {
229
- true: {
230
- label: "after:content-['*'] after:text-danger-main after:ml-0.5"
231
- }
232
- }
233
- },
234
- defaultVariants: {
235
- variant: "solid",
236
- color: "primary",
237
- size: "md",
238
- fullWidth: false,
239
- isDisabled: false,
240
- isRequired: false
241
- },
242
- compoundVariants: [
243
- {
244
- isDisabled: true,
245
- isRequired: true,
246
- class: {
247
- label: "after:text-danger-light"
248
- }
249
- }
250
- ]
251
- });
252
-
253
- export {
254
- select_default
255
- };