@deepnoid/ui 0.1.223 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/.turbo/turbo-build.log +266 -251
  2. package/dist/{chunk-NTNF5T5I.mjs → chunk-23KGTXH2.mjs} +1 -1
  3. package/dist/{chunk-SX3JDFTH.mjs → chunk-2K3HZMC6.mjs} +9 -9
  4. package/dist/{chunk-ZFC5O2V3.mjs → chunk-3JKORA4G.mjs} +1 -1
  5. package/dist/{chunk-HFOHFBZH.mjs → chunk-3N442F6I.mjs} +2 -2
  6. package/dist/{chunk-WA7CSZQ3.mjs → chunk-3QZPVRM5.mjs} +1 -1
  7. package/dist/{chunk-BH3I4LIZ.mjs → chunk-4V5D237Z.mjs} +1 -1
  8. package/dist/chunk-63JRWMWN.mjs +215 -0
  9. package/dist/{chunk-GDHLN463.mjs → chunk-6CNPC722.mjs} +2 -2
  10. package/dist/{chunk-4IEHQI5B.mjs → chunk-7JCCPTBU.mjs} +3 -3
  11. package/dist/chunk-A6UUVHC6.mjs +38 -0
  12. package/dist/{chunk-P5L4YI54.mjs → chunk-AOU4QX7H.mjs} +106 -40
  13. package/dist/{chunk-U7SYKG2C.mjs → chunk-BBCJTXGU.mjs} +1 -1
  14. package/dist/{chunk-4S4AAZFC.mjs → chunk-CBFUVFGI.mjs} +4 -4
  15. package/dist/{chunk-AGE57VDD.mjs → chunk-CBIV6KFQ.mjs} +22 -25
  16. package/dist/{chunk-KWHCUAFU.mjs → chunk-CGJBY53Q.mjs} +3 -3
  17. package/dist/{chunk-XZYQFBCT.mjs → chunk-DI7QXTYZ.mjs} +1 -1
  18. package/dist/{chunk-U4DJHAM5.mjs → chunk-DPWUIAVC.mjs} +413 -149
  19. package/dist/chunk-E4VJDQD5.mjs +142 -0
  20. package/dist/{chunk-TE5JU3WA.mjs → chunk-EAWNUQDB.mjs} +90 -133
  21. package/dist/{chunk-OXJX5G3O.mjs → chunk-EIVSXVP5.mjs} +2 -2
  22. package/dist/{chunk-JGG3ZUNG.mjs → chunk-GSOTTSR4.mjs} +1 -1
  23. package/dist/{chunk-NGRGAY42.mjs → chunk-HKF5BNPX.mjs} +1 -1
  24. package/dist/{chunk-2URJGQFC.mjs → chunk-JUKILR6X.mjs} +2 -2
  25. package/dist/{chunk-DW3BX4M2.mjs → chunk-KPOXK7NN.mjs} +1 -1
  26. package/dist/{chunk-5KC3IFNR.mjs → chunk-LJSGQO4B.mjs} +1 -1
  27. package/dist/{chunk-LH6Z7SDZ.mjs → chunk-M7V5YMM2.mjs} +1 -1
  28. package/dist/{chunk-44FMPRHV.mjs → chunk-MAGZDGUW.mjs} +67 -38
  29. package/dist/chunk-MV2WCFK7.mjs +1 -0
  30. package/dist/{chunk-U52FBRJ3.mjs → chunk-NJWXYTBQ.mjs} +1 -1
  31. package/dist/{chunk-3DCUMRYP.mjs → chunk-NPQBJO6G.mjs} +11 -39
  32. package/dist/chunk-OK34FKBQ.mjs +224 -0
  33. package/dist/{chunk-OC5C42CB.mjs → chunk-OPGGL4CG.mjs} +3 -3
  34. package/dist/{chunk-R2XKPG4K.mjs → chunk-OPSMMRA2.mjs} +1 -1
  35. package/dist/{chunk-4X35QQTI.mjs → chunk-P4GNXDMO.mjs} +1 -1
  36. package/dist/{chunk-MTT24BLX.mjs → chunk-PCWANNZ4.mjs} +3 -3
  37. package/dist/{chunk-V2YH54JQ.mjs → chunk-PXUYPS6M.mjs} +12 -2
  38. package/dist/chunk-RFHWRBAB.mjs +105 -0
  39. package/dist/{chunk-EJ4GDC6K.mjs → chunk-S2T4GHJA.mjs} +27 -27
  40. package/dist/{chunk-5VTYO3RF.mjs → chunk-TBI5O3OL.mjs} +1 -1
  41. package/dist/{chunk-FZYZSMSS.mjs → chunk-TBRF36RK.mjs} +1 -1
  42. package/dist/{chunk-Q3KBMVJS.mjs → chunk-TEERNFIT.mjs} +77 -46
  43. package/dist/{chunk-RH3AHG52.mjs → chunk-V5XX3CGL.mjs} +1 -1
  44. package/dist/{chunk-6WD32ERF.mjs → chunk-VO2ZIGIK.mjs} +1 -1
  45. package/dist/{chunk-H6ZQDMYU.mjs → chunk-VOOEH6OJ.mjs} +24 -38
  46. package/dist/{chunk-ACZ3DQVT.mjs → chunk-VUO5J2OK.mjs} +16 -15
  47. package/dist/{chunk-RY5VVXQ4.mjs → chunk-WYTAGN2P.mjs} +1 -1
  48. package/dist/{chunk-NDNIAALB.mjs → chunk-YBDQSEPV.mjs} +17 -18
  49. package/dist/chunk-Z4NO7SMY.mjs +460 -0
  50. package/dist/components/accordion/accordion.js +366 -4
  51. package/dist/components/accordion/accordion.mjs +2 -2
  52. package/dist/components/accordion/accordionItem.js +366 -4
  53. package/dist/components/accordion/accordionItem.mjs +2 -2
  54. package/dist/components/accordion/index.js +366 -4
  55. package/dist/components/accordion/index.mjs +3 -3
  56. package/dist/components/avatar/avatar.js +472 -44
  57. package/dist/components/avatar/avatar.mjs +3 -3
  58. package/dist/components/avatar/index.js +472 -44
  59. package/dist/components/avatar/index.mjs +3 -3
  60. package/dist/components/backdrop/backdrop.js +366 -4
  61. package/dist/components/backdrop/backdrop.mjs +2 -2
  62. package/dist/components/backdrop/index.js +366 -4
  63. package/dist/components/backdrop/index.mjs +2 -2
  64. package/dist/components/breadcrumb/breadcrumb.js +951 -74
  65. package/dist/components/breadcrumb/breadcrumb.mjs +10 -9
  66. package/dist/components/breadcrumb/index.js +951 -74
  67. package/dist/components/breadcrumb/index.mjs +10 -9
  68. package/dist/components/button/button-group.js +366 -4
  69. package/dist/components/button/button-group.mjs +2 -2
  70. package/dist/components/button/button.d.mts +82 -119
  71. package/dist/components/button/button.d.ts +82 -119
  72. package/dist/components/button/button.js +966 -355
  73. package/dist/components/button/button.mjs +6 -5
  74. package/dist/components/button/button.style.d.mts +89 -0
  75. package/dist/components/button/button.style.d.ts +89 -0
  76. package/dist/components/button/button.style.js +1172 -0
  77. package/dist/components/button/button.style.mjs +9 -0
  78. package/dist/components/button/icon-button.d.mts +45 -46
  79. package/dist/components/button/icon-button.d.ts +45 -46
  80. package/dist/components/button/icon-button.js +1125 -527
  81. package/dist/components/button/icon-button.mjs +6 -5
  82. package/dist/components/button/index.js +1154 -830
  83. package/dist/components/button/index.mjs +9 -8
  84. package/dist/components/button/text-button.d.mts +59 -39
  85. package/dist/components/button/text-button.d.ts +59 -39
  86. package/dist/components/button/text-button.js +831 -21
  87. package/dist/components/button/text-button.mjs +3 -2
  88. package/dist/components/charts/areaChart.js +366 -4
  89. package/dist/components/charts/areaChart.mjs +2 -2
  90. package/dist/components/charts/barChart.js +366 -4
  91. package/dist/components/charts/barChart.mjs +2 -2
  92. package/dist/components/charts/circularProgress.js +366 -4
  93. package/dist/components/charts/circularProgress.mjs +2 -2
  94. package/dist/components/charts/index.js +366 -4
  95. package/dist/components/charts/index.mjs +6 -6
  96. package/dist/components/charts/radarChart.js +366 -4
  97. package/dist/components/charts/radarChart.mjs +2 -2
  98. package/dist/components/charts/simpleBarChart.js +366 -4
  99. package/dist/components/charts/simpleBarChart.mjs +2 -2
  100. package/dist/components/checkbox/checkbox.js +376 -42
  101. package/dist/components/checkbox/checkbox.mjs +2 -2
  102. package/dist/components/checkbox/index.js +376 -42
  103. package/dist/components/checkbox/index.mjs +2 -2
  104. package/dist/components/chip/chip.d.mts +32 -0
  105. package/dist/components/chip/chip.d.ts +32 -0
  106. package/dist/components/chip/chip.js +496 -57
  107. package/dist/components/chip/chip.mjs +4 -4
  108. package/dist/components/chip/index.js +496 -57
  109. package/dist/components/chip/index.mjs +4 -4
  110. package/dist/components/drawer/drawer.js +366 -4
  111. package/dist/components/drawer/drawer.mjs +2 -2
  112. package/dist/components/drawer/index.js +366 -4
  113. package/dist/components/drawer/index.mjs +2 -2
  114. package/dist/components/fileUpload/fileUpload.js +1014 -402
  115. package/dist/components/fileUpload/fileUpload.mjs +12 -11
  116. package/dist/components/fileUpload/index.js +1014 -402
  117. package/dist/components/fileUpload/index.mjs +12 -11
  118. package/dist/components/icon/Icon.d.mts +23 -10
  119. package/dist/components/icon/Icon.d.ts +23 -10
  120. package/dist/components/icon/Icon.js +120 -53
  121. package/dist/components/icon/Icon.mjs +2 -2
  122. package/dist/components/icon/index.js +120 -53
  123. package/dist/components/icon/index.mjs +2 -2
  124. package/dist/components/icon/template.d.mts +5 -2
  125. package/dist/components/icon/template.d.ts +5 -2
  126. package/dist/components/icon/template.js +106 -40
  127. package/dist/components/icon/template.mjs +1 -1
  128. package/dist/components/input/index.js +511 -82
  129. package/dist/components/input/index.mjs +4 -4
  130. package/dist/components/input/input.js +511 -82
  131. package/dist/components/input/input.mjs +4 -4
  132. package/dist/components/list/index.js +486 -57
  133. package/dist/components/list/index.mjs +6 -6
  134. package/dist/components/list/list.js +366 -4
  135. package/dist/components/list/list.mjs +2 -2
  136. package/dist/components/list/listItem.js +486 -57
  137. package/dist/components/list/listItem.mjs +5 -5
  138. package/dist/components/modal/GlobalModalProvider.d.mts +2 -0
  139. package/dist/components/modal/GlobalModalProvider.d.ts +2 -0
  140. package/dist/components/modal/GlobalModalProvider.js +1028 -416
  141. package/dist/components/modal/GlobalModalProvider.mjs +12 -11
  142. package/dist/components/modal/index.d.mts +2 -0
  143. package/dist/components/modal/index.d.ts +2 -0
  144. package/dist/components/modal/index.js +1028 -416
  145. package/dist/components/modal/index.mjs +13 -12
  146. package/dist/components/modal/modal.d.mts +101 -29
  147. package/dist/components/modal/modal.d.ts +101 -29
  148. package/dist/components/modal/modal.js +1028 -416
  149. package/dist/components/modal/modal.mjs +11 -10
  150. package/dist/components/modal/useGlobalModal.d.mts +2 -0
  151. package/dist/components/modal/useGlobalModal.d.ts +2 -0
  152. package/dist/components/modal/useGlobalModal.mjs +13 -12
  153. package/dist/components/pagination/index.js +598 -212
  154. package/dist/components/pagination/index.mjs +5 -5
  155. package/dist/components/pagination/pagination.js +598 -212
  156. package/dist/components/pagination/pagination.mjs +5 -5
  157. package/dist/components/picker/datePicker.js +1029 -705
  158. package/dist/components/picker/datePicker.mjs +12 -11
  159. package/dist/components/picker/day.js +366 -4
  160. package/dist/components/picker/day.mjs +2 -2
  161. package/dist/components/picker/index.js +1027 -703
  162. package/dist/components/picker/index.mjs +15 -14
  163. package/dist/components/picker/timePicker/Panel.js +831 -21
  164. package/dist/components/picker/timePicker/Panel.mjs +10 -9
  165. package/dist/components/picker/timePicker/index.js +976 -99
  166. package/dist/components/picker/timePicker/index.mjs +12 -11
  167. package/dist/components/progress/index.js +381 -18
  168. package/dist/components/progress/index.mjs +2 -2
  169. package/dist/components/progress/progress.d.mts +21 -18
  170. package/dist/components/progress/progress.d.ts +21 -18
  171. package/dist/components/progress/progress.js +381 -18
  172. package/dist/components/progress/progress.mjs +2 -2
  173. package/dist/components/radio/index.js +389 -41
  174. package/dist/components/radio/index.mjs +2 -2
  175. package/dist/components/radio/radio.d.mts +33 -48
  176. package/dist/components/radio/radio.d.ts +33 -48
  177. package/dist/components/radio/radio.js +389 -41
  178. package/dist/components/radio/radio.mjs +2 -2
  179. package/dist/components/ripple/index.mjs +3 -3
  180. package/dist/components/select/index.js +819 -221
  181. package/dist/components/select/index.mjs +10 -9
  182. package/dist/components/select/select.js +819 -221
  183. package/dist/components/select/select.mjs +10 -9
  184. package/dist/components/slider/index.d.mts +4 -0
  185. package/dist/components/slider/index.d.ts +4 -0
  186. package/dist/components/slider/index.js +955 -0
  187. package/dist/components/slider/index.mjs +11 -0
  188. package/dist/components/slider/slider.d.mts +158 -0
  189. package/dist/components/slider/slider.d.ts +158 -0
  190. package/dist/components/slider/slider.js +949 -0
  191. package/dist/components/slider/slider.mjs +10 -0
  192. package/dist/components/starRating/index.js +486 -57
  193. package/dist/components/starRating/index.mjs +4 -4
  194. package/dist/components/starRating/starRating.js +486 -57
  195. package/dist/components/starRating/starRating.mjs +4 -4
  196. package/dist/components/switch/index.js +22 -25
  197. package/dist/components/switch/index.mjs +1 -1
  198. package/dist/components/switch/switch.d.mts +0 -18
  199. package/dist/components/switch/switch.d.ts +0 -18
  200. package/dist/components/switch/switch.js +22 -25
  201. package/dist/components/switch/switch.mjs +1 -1
  202. package/dist/components/table/definition-table.js +366 -4
  203. package/dist/components/table/definition-table.mjs +2 -2
  204. package/dist/components/table/form-table.js +366 -4
  205. package/dist/components/table/form-table.mjs +1 -1
  206. package/dist/components/table/index.js +679 -291
  207. package/dist/components/table/index.mjs +10 -10
  208. package/dist/components/table/table-body.js +679 -291
  209. package/dist/components/table/table-body.mjs +7 -7
  210. package/dist/components/table/table-head.js +679 -291
  211. package/dist/components/table/table-head.mjs +7 -7
  212. package/dist/components/table/table.d.mts +8 -29
  213. package/dist/components/table/table.d.ts +8 -29
  214. package/dist/components/table/table.js +679 -291
  215. package/dist/components/table/table.mjs +7 -7
  216. package/dist/components/tabs/index.js +366 -4
  217. package/dist/components/tabs/index.mjs +2 -2
  218. package/dist/components/tabs/tabs.js +366 -4
  219. package/dist/components/tabs/tabs.mjs +2 -2
  220. package/dist/components/textarea/index.js +67 -38
  221. package/dist/components/textarea/index.mjs +1 -1
  222. package/dist/components/textarea/textarea.d.mts +21 -0
  223. package/dist/components/textarea/textarea.d.ts +21 -0
  224. package/dist/components/textarea/textarea.js +67 -38
  225. package/dist/components/textarea/textarea.mjs +1 -1
  226. package/dist/components/timePicker/calendar.js +486 -57
  227. package/dist/components/timePicker/calendar.mjs +3 -3
  228. package/dist/components/toast/index.js +486 -57
  229. package/dist/components/toast/index.mjs +5 -5
  230. package/dist/components/toast/toast.js +486 -57
  231. package/dist/components/toast/toast.mjs +4 -4
  232. package/dist/components/toast/use-toast.js +486 -57
  233. package/dist/components/toast/use-toast.mjs +5 -5
  234. package/dist/components/tooltip/index.js +366 -4
  235. package/dist/components/tooltip/index.mjs +2 -2
  236. package/dist/components/tooltip/tooltip.js +366 -4
  237. package/dist/components/tooltip/tooltip.mjs +2 -2
  238. package/dist/components/tree/index.js +486 -57
  239. package/dist/components/tree/index.mjs +4 -4
  240. package/dist/components/tree/tree.js +486 -57
  241. package/dist/components/tree/tree.mjs +4 -4
  242. package/dist/index.d.mts +1 -0
  243. package/dist/index.d.ts +1 -0
  244. package/dist/index.js +1705 -1281
  245. package/dist/index.mjs +76 -70
  246. package/dist/utils/tailwind-variants.js +366 -4
  247. package/dist/utils/tailwind-variants.mjs +1 -1
  248. package/package.json +1 -1
  249. package/dist/chunk-6AID2NLT.mjs +0 -37
  250. package/dist/chunk-BBRO35V3.mjs +0 -385
  251. package/dist/chunk-EVJ46M3U.mjs +0 -141
  252. package/dist/chunk-SKX5QPUD.mjs +0 -482
@@ -1,37 +0,0 @@
1
- "use client";
2
- import {
3
- template
4
- } from "./chunk-P5L4YI54.mjs";
5
-
6
- // src/components/icon/Icon.tsx
7
- import { jsx } from "react/jsx-runtime";
8
- var iconTemplate = template;
9
- var Icon = ({ name, size = "md", fill = false, className, onClick, ...props }) => {
10
- const SVGIcon = template[name];
11
- const getInputIconSize = (size2) => {
12
- switch (size2) {
13
- case "sm":
14
- return "size-[18px]";
15
- case "md":
16
- return "size-[21px] stroke-[1.25px]";
17
- case "lg":
18
- return "size-[24px] stroke-[1.5px]";
19
- case "xl":
20
- return "size-[27px] stroke-[1.5px]";
21
- }
22
- };
23
- return /* @__PURE__ */ jsx("div", { className: "h-fit w-fit", onClick, children: /* @__PURE__ */ jsx(
24
- SVGIcon,
25
- {
26
- fill,
27
- className: className ? `${getInputIconSize(size)} ${className}` : `${getInputIconSize(size)}`,
28
- ...props
29
- }
30
- ) });
31
- };
32
- var Icon_default = Icon;
33
-
34
- export {
35
- iconTemplate,
36
- Icon_default
37
- };
@@ -1,385 +0,0 @@
1
- "use client";
2
- import {
3
- useRipple
4
- } from "./chunk-SZL743JC.mjs";
5
- import {
6
- ripple_default
7
- } from "./chunk-LXHUO6VM.mjs";
8
- import {
9
- Icon_default
10
- } from "./chunk-6AID2NLT.mjs";
11
- import {
12
- mapPropsVariants
13
- } from "./chunk-E3G5QXSH.mjs";
14
- import {
15
- tv
16
- } from "./chunk-U4DJHAM5.mjs";
17
-
18
- // src/components/button/icon-button.tsx
19
- import { forwardRef, useMemo, useCallback } from "react";
20
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
- var IconButton = forwardRef((props, ref) => {
22
- const [localProps, variantProps] = mapPropsVariants(props, iconButtonStyle.variantKeys);
23
- const { classNames, name, disableRipple, disabled, isLoading, size, full, isInGroup, onMouseDown, ...buttonProps } = {
24
- ...localProps,
25
- ...variantProps
26
- };
27
- const slots = useMemo(() => iconButtonStyle({ ...variantProps }), [variantProps]);
28
- const { onPress, onClear, ripples } = useRipple();
29
- const handleRipple = useCallback(
30
- (e) => {
31
- if (!disableRipple && !disabled) {
32
- onPress(e);
33
- }
34
- },
35
- [disableRipple, disabled, onPress]
36
- );
37
- const handleMouseDown = useCallback(
38
- (e) => {
39
- onMouseDown == null ? void 0 : onMouseDown(e);
40
- handleRipple(e);
41
- },
42
- [onMouseDown, handleRipple]
43
- );
44
- const rippleProps = useMemo(() => ({ ripples, onClear }), [ripples, onClear]);
45
- return /* @__PURE__ */ jsx(
46
- "button",
47
- {
48
- ...buttonProps,
49
- onMouseDown: handleMouseDown,
50
- ref,
51
- disabled: disabled || isLoading,
52
- "data-loading": isLoading,
53
- className: slots.base({ class: classNames == null ? void 0 : classNames.base }),
54
- children: isLoading ? /* @__PURE__ */ jsx(Icon_default, { name: "loading", size, className: "animate-spin" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
55
- /* @__PURE__ */ jsx(Icon_default, { name, size }),
56
- !disableRipple && /* @__PURE__ */ jsx(ripple_default, { ...rippleProps })
57
- ] })
58
- }
59
- );
60
- });
61
- IconButton.displayName = "IconButton";
62
- var icon_button_default = IconButton;
63
- var iconButtonStyle = tv({
64
- slots: {
65
- base: [
66
- "relative",
67
- "flex",
68
- "items-center",
69
- "justify-center",
70
- "whitespace-nowrap",
71
- "transition",
72
- "duration-200",
73
- "select-none",
74
- "overflow-hidden",
75
- "box-border"
76
- ]
77
- },
78
- variants: {
79
- variant: {
80
- solid: [],
81
- soft: [],
82
- outline: [],
83
- ghost: []
84
- },
85
- color: {
86
- primary: [],
87
- secondary: [],
88
- neutral: [],
89
- info: [],
90
- success: [],
91
- warning: [],
92
- danger: []
93
- },
94
- size: {
95
- sm: {
96
- base: ["w-[24px]", "h-[24px]", "rounded-sm"]
97
- },
98
- md: {
99
- base: ["w-[32px]", "h-[32px]", "rounded-md"]
100
- },
101
- lg: {
102
- base: ["w-[40px]", "h-[40px]", "rounded-lg"]
103
- },
104
- xl: {
105
- base: ["w-[50px]", "h-[50px]", "rounded-xl"]
106
- }
107
- },
108
- isLoading: {
109
- true: {}
110
- },
111
- disabled: {
112
- true: {
113
- base: ["!bg-neutral-soft", "!border-neutral-soft", "!text-neutral-light", "pointer-events-none"]
114
- }
115
- },
116
- isInGroup: {
117
- true: {
118
- base: [
119
- "[&:not(:first-child):not(:last-child)]:rounded-none",
120
- "first:rounded-r-none",
121
- "last:rounded-l-none",
122
- "[&:not(:first-child)]:border-l-0"
123
- ]
124
- }
125
- }
126
- },
127
- compoundVariants: [
128
- {
129
- variant: "solid",
130
- color: "primary",
131
- class: {
132
- base: ["text-white", "bg-primary-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
133
- }
134
- },
135
- {
136
- variant: "solid",
137
- color: "secondary",
138
- class: {
139
- base: ["text-white", "bg-secondary-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
140
- }
141
- },
142
- {
143
- variant: "solid",
144
- color: "neutral",
145
- class: {
146
- base: ["text-white", "bg-neutral-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
147
- }
148
- },
149
- {
150
- variant: "solid",
151
- color: "info",
152
- class: {
153
- base: ["text-white", "bg-info-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
154
- }
155
- },
156
- {
157
- variant: "solid",
158
- color: "success",
159
- class: {
160
- base: ["text-white", "bg-success-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
161
- }
162
- },
163
- {
164
- variant: "solid",
165
- color: "warning",
166
- class: {
167
- base: ["text-white", "bg-warning-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
168
- }
169
- },
170
- {
171
- variant: "solid",
172
- color: "danger",
173
- class: {
174
- base: ["text-white", "bg-danger-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
175
- }
176
- },
177
- // soft
178
- {
179
- variant: "soft",
180
- color: "primary",
181
- class: {
182
- base: ["text-primary-main", "bg-primary-soft", "!border-primary-soft", "hover:!border-primary-light"]
183
- }
184
- },
185
- {
186
- variant: "soft",
187
- color: "secondary",
188
- class: {
189
- base: ["text-secondary-main", "bg-secondary-soft", "!border-secondary-soft", "hover:!border-secondary-light"]
190
- }
191
- },
192
- {
193
- variant: "soft",
194
- color: "neutral",
195
- class: {
196
- base: ["text-neutral-main", "bg-neutral-soft", "!border-neutral-soft", "hover:!border-neutral-light"]
197
- }
198
- },
199
- {
200
- variant: "soft",
201
- color: "info",
202
- class: {
203
- base: ["text-info-main", "bg-info-soft", "!border-info-soft", "hover:!border-info-light"]
204
- }
205
- },
206
- {
207
- variant: "soft",
208
- color: "success",
209
- class: {
210
- base: ["text-success-main", "bg-success-soft", "!border-success-soft", "hover:!border-success-light"]
211
- }
212
- },
213
- {
214
- variant: "soft",
215
- color: "warning",
216
- class: {
217
- base: ["text-warning-main", "bg-warning-soft", "!border-warning-soft", "hover:!border-warning-light"]
218
- }
219
- },
220
- {
221
- variant: "soft",
222
- color: "danger",
223
- class: {
224
- base: ["text-danger-main", "bg-danger-soft", "!border-danger-soft", "hover:!border-danger-light"]
225
- }
226
- },
227
- // outline
228
- {
229
- variant: "outline",
230
- color: "primary",
231
- class: {
232
- base: ["bg-body-background", "!border-primary-main", "text-primary-main", "hover:bg-primary-soft"]
233
- }
234
- },
235
- {
236
- variant: "outline",
237
- color: "secondary",
238
- class: {
239
- base: ["bg-body-background", "!border-secondary-main", "text-secondary-main", "hover:bg-secondary-soft"]
240
- }
241
- },
242
- {
243
- variant: "outline",
244
- color: "neutral",
245
- class: {
246
- base: ["bg-body-background", "!border-neutral-light", "text-neutral-main", "hover:bg-neutral-soft"]
247
- }
248
- },
249
- {
250
- variant: "outline",
251
- color: "info",
252
- class: {
253
- base: ["bg-body-background", "!border-info-main", "text-info-main", "hover:bg-info-soft"]
254
- }
255
- },
256
- {
257
- variant: "outline",
258
- color: "success",
259
- class: {
260
- base: ["bg-body-background", "!border-success-main", "text-success-main", "hover:bg-success-soft"]
261
- }
262
- },
263
- {
264
- variant: "outline",
265
- color: "warning",
266
- class: {
267
- base: ["bg-body-background", "!border-warning-main", "text-warning-main", "hover:bg-warning-soft"]
268
- }
269
- },
270
- {
271
- variant: "outline",
272
- color: "danger",
273
- class: {
274
- base: ["bg-body-background", "!border-danger-main", "text-danger-main", "hover:bg-danger-soft"]
275
- }
276
- },
277
- // ghost
278
- {
279
- variant: "ghost",
280
- color: "primary",
281
- class: {
282
- base: ["text-primary-main", "border-transparent", "hover:bg-primary-soft"]
283
- }
284
- },
285
- {
286
- variant: "ghost",
287
- color: "secondary",
288
- class: {
289
- base: ["text-secondary-main", "border-transparent", "hover:bg-secondary-soft"]
290
- }
291
- },
292
- {
293
- variant: "ghost",
294
- color: "neutral",
295
- class: {
296
- base: ["text-neutral-main", "border-transparent", "hover:bg-neutral-soft"]
297
- }
298
- },
299
- {
300
- variant: "ghost",
301
- color: "info",
302
- class: {
303
- base: ["text-info-main", "border-transparent", "hover:bg-info-soft"]
304
- }
305
- },
306
- {
307
- variant: "ghost",
308
- color: "success",
309
- class: {
310
- base: ["text-success-main", "border-transparent", "hover:bg-success-soft"]
311
- }
312
- },
313
- {
314
- variant: "ghost",
315
- color: "warning",
316
- class: {
317
- base: ["text-warning-main", "border-transparent", "hover:bg-warning-soft"]
318
- }
319
- },
320
- {
321
- variant: "ghost",
322
- color: "danger",
323
- class: {
324
- base: ["text-danger-main", "border-transparent", "hover:bg-danger-soft"]
325
- }
326
- },
327
- // soft/outline + size
328
- {
329
- variant: ["soft", "outline"],
330
- size: "sm",
331
- class: {
332
- base: ["border-sm"]
333
- }
334
- },
335
- {
336
- variant: ["soft", "outline"],
337
- size: "md",
338
- class: {
339
- base: ["border-md"]
340
- }
341
- },
342
- {
343
- variant: ["soft", "outline"],
344
- size: "lg",
345
- class: {
346
- base: ["border-lg"]
347
- }
348
- },
349
- {
350
- variant: ["soft", "outline"],
351
- size: "xl",
352
- class: {
353
- base: ["border-xl"]
354
- }
355
- },
356
- // disabled + variant
357
- {
358
- variant: ["soft", "ghost"],
359
- disabled: true,
360
- class: {
361
- base: ["!border-neutral-soft"]
362
- }
363
- },
364
- {
365
- variant: ["outline"],
366
- disabled: true,
367
- class: {
368
- base: ["!border-neutral-light"]
369
- }
370
- }
371
- ],
372
- defaultVariants: {
373
- size: "md",
374
- variant: "solid",
375
- color: "primary",
376
- full: false,
377
- disabled: false,
378
- isLoading: false,
379
- isInGroup: false
380
- }
381
- });
382
-
383
- export {
384
- icon_button_default
385
- };
@@ -1,141 +0,0 @@
1
- "use client";
2
- import {
3
- backdrop_default
4
- } from "./chunk-4X35QQTI.mjs";
5
- import {
6
- button_default
7
- } from "./chunk-SKX5QPUD.mjs";
8
- import {
9
- Icon_default
10
- } from "./chunk-6AID2NLT.mjs";
11
- import {
12
- mapPropsVariants
13
- } from "./chunk-E3G5QXSH.mjs";
14
- import {
15
- tv
16
- } from "./chunk-U4DJHAM5.mjs";
17
-
18
- // src/components/modal/modal.tsx
19
- import { forwardRef, useMemo, useEffect } from "react";
20
- import { createPortal } from "react-dom";
21
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
22
- var Modal = forwardRef((props, ref) => {
23
- const [localProps, variantProps] = mapPropsVariants(props, modal.variantKeys);
24
- const {
25
- classNames,
26
- isOpen,
27
- title,
28
- content,
29
- confirmButtonText,
30
- cancelButtonText,
31
- showCloseButton = true,
32
- isKeyboardDismissDisabled = false,
33
- onConfirm,
34
- onCancel,
35
- extraFooter
36
- } = localProps;
37
- const slots = useMemo(() => modal(variantProps), [variantProps]);
38
- useEffect(() => {
39
- document.body.classList.toggle("overflow-hidden", !!isOpen);
40
- if (!isOpen || isKeyboardDismissDisabled) return;
41
- const handleKeyDown = (e) => {
42
- if (e.key === "Escape") onCancel == null ? void 0 : onCancel();
43
- };
44
- document.addEventListener("keydown", handleKeyDown);
45
- return () => {
46
- document.removeEventListener("keydown", handleKeyDown);
47
- document.body.classList.remove("overflow-hidden");
48
- };
49
- }, [isOpen, isKeyboardDismissDisabled, onCancel]);
50
- if (!isOpen) return null;
51
- return createPortal(
52
- /* @__PURE__ */ jsxs(Fragment, { children: [
53
- /* @__PURE__ */ jsx(backdrop_default, { open: true }),
54
- /* @__PURE__ */ jsx("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: /* @__PURE__ */ jsxs("div", { className: slots.modalWrapper({ class: classNames == null ? void 0 : classNames.modalWrapper }), children: [
55
- showCloseButton && /* @__PURE__ */ jsx(
56
- Icon_default,
57
- {
58
- size: "xl",
59
- name: "close",
60
- className: slots.closeIcon({ class: classNames == null ? void 0 : classNames.closeIcon }),
61
- onClick: onCancel
62
- }
63
- ),
64
- /* @__PURE__ */ jsxs("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
65
- title && /* @__PURE__ */ jsx("div", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title }),
66
- typeof content === "string" ? /* @__PURE__ */ jsx("div", { className: slots.content({ class: classNames == null ? void 0 : classNames.content }), children: content }) : content,
67
- (cancelButtonText || confirmButtonText) && /* @__PURE__ */ jsxs("div", { className: slots.footerWrapper({ class: classNames == null ? void 0 : classNames.footerWrapper }), children: [
68
- /* @__PURE__ */ jsxs("div", { className: slots.footer({ class: classNames == null ? void 0 : classNames.footer }), children: [
69
- cancelButtonText && /* @__PURE__ */ jsx(button_default, { variant: "soft", color: "neutral", full: true, onClick: onCancel, children: cancelButtonText }),
70
- confirmButtonText && /* @__PURE__ */ jsx(button_default, { color: props.color, full: true, onClick: onConfirm, children: confirmButtonText })
71
- ] }),
72
- extraFooter
73
- ] })
74
- ] })
75
- ] }) })
76
- ] }),
77
- document.body
78
- );
79
- });
80
- Modal.displayName = "Modal";
81
- var modal_default = Modal;
82
- var modal = tv({
83
- slots: {
84
- base: [
85
- "group/modal",
86
- "absolute",
87
- "fixed",
88
- "top-1/2",
89
- "-translate-y-1/2",
90
- "left-1/2",
91
- "-translate-x-1/2",
92
- "z-[50]",
93
- "bg-body-background"
94
- ],
95
- modalWrapper: [
96
- "min-w-[450px]",
97
- "flex",
98
- "flex-col",
99
- "justify-center",
100
- "p-[30px]",
101
- "bg-background",
102
- "shadow-drop",
103
- "shadow-foreground/20",
104
- "rounded-xlg",
105
- "overflow-hidden",
106
- "group-data-[icon-visibility=true]/modal:mt-[0]",
107
- "group-data-[icon-visibility=true]/modal:pt-[60px]"
108
- ],
109
- wrapper: ["flex", "flex-col", "gap-[30px]"],
110
- title: ["text-xl", "font-extrabold", "text-foreground"],
111
- content: ["text-md", "font-bold", "text-center", "break-words", "bg-neutral-soft", "rounded-[5px]", "p-[10px]"],
112
- footerWrapper: ["flex", "flex-col", "gap-[5px]"],
113
- footer: ["flex", "gap-[10px]"],
114
- closeIcon: [
115
- "absolute",
116
- "top-[30px]",
117
- "right-[30px]",
118
- "cursor-pointer",
119
- "z-60",
120
- "group-data-[icon-visibility=true]/modal:top-[80px]"
121
- ]
122
- },
123
- variants: {
124
- color: {
125
- primary: {},
126
- secondary: {},
127
- neutral: {},
128
- success: {},
129
- info: {},
130
- warning: {},
131
- danger: {}
132
- }
133
- },
134
- defaultVariants: {
135
- color: "primary"
136
- }
137
- });
138
-
139
- export {
140
- modal_default
141
- };