@deepnoid/ui 0.1.0 → 0.1.2

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 (135) hide show
  1. package/.turbo/turbo-build.log +173 -173
  2. package/dist/{chunk-VWMXZUR2.mjs → chunk-2TJDQIKB.mjs} +1 -1
  3. package/dist/{chunk-IE2BRM7Z.mjs → chunk-2ZT6V4QR.mjs} +0 -9
  4. package/dist/{chunk-PKVQXVCS.mjs → chunk-56VCX2QR.mjs} +1 -1
  5. package/dist/{chunk-UAMIPCUD.mjs → chunk-AMA53H3C.mjs} +2 -2
  6. package/dist/{chunk-XAA5KY6A.mjs → chunk-CF6O6TCF.mjs} +1 -1
  7. package/dist/{chunk-3AMZ55Y6.mjs → chunk-DNFBQYVG.mjs} +3 -3
  8. package/dist/{chunk-QNA2GDTN.mjs → chunk-GLBASISV.mjs} +1 -1
  9. package/dist/{chunk-QJHZJRSQ.mjs → chunk-HKXUNG3H.mjs} +1 -1
  10. package/dist/{chunk-XTGRSVYO.mjs → chunk-J5WJD6XZ.mjs} +1 -1
  11. package/dist/{chunk-MW6Y3FSE.mjs → chunk-KWWYMTJP.mjs} +4 -4
  12. package/dist/chunk-M2IRRTFM.mjs +79 -0
  13. package/dist/{chunk-Q5WACGVP.mjs → chunk-N4F3R6HG.mjs} +1 -1
  14. package/dist/chunk-OELLMF2V.mjs +283 -0
  15. package/dist/{chunk-WQBOPCH6.mjs → chunk-ON5SGXHZ.mjs} +1 -1
  16. package/dist/chunk-OQS4LGZK.mjs +27 -0
  17. package/dist/chunk-OYNGJ33M.mjs +285 -0
  18. package/dist/{chunk-KCYJYS66.mjs → chunk-RCU5MLBU.mjs} +1 -1
  19. package/dist/{chunk-X2MQCISM.mjs → chunk-S65S7QZ5.mjs} +1 -1
  20. package/dist/chunk-TMSBICKB.mjs +314 -0
  21. package/dist/{chunk-RRL6KBU4.mjs → chunk-U2YKMXVG.mjs} +1 -1
  22. package/dist/{chunk-CATOSBI7.mjs → chunk-VP3NVHFU.mjs} +2 -2
  23. package/dist/{chunk-VBFXKJTI.mjs → chunk-VRGHUYRU.mjs} +2 -2
  24. package/dist/{chunk-5S4XGPBB.mjs → chunk-VVOOYDJS.mjs} +1 -1
  25. package/dist/{chunk-FYJZ7Q5L.mjs → chunk-XIHAABHB.mjs} +1 -1
  26. package/dist/{chunk-2HSK6XGZ.mjs → chunk-YZNQ2QGK.mjs} +1 -1
  27. package/dist/{chunk-P5WT7WJO.mjs → chunk-ZEZ6ZA3N.mjs} +1 -1
  28. package/dist/components/avatar/avatar.js +0 -9
  29. package/dist/components/avatar/avatar.mjs +2 -2
  30. package/dist/components/avatar/index.js +0 -9
  31. package/dist/components/avatar/index.mjs +2 -2
  32. package/dist/components/backdrop/backdrop.js +0 -9
  33. package/dist/components/backdrop/backdrop.mjs +2 -2
  34. package/dist/components/backdrop/index.js +0 -9
  35. package/dist/components/backdrop/index.mjs +2 -2
  36. package/dist/components/breadcrumb/breadcrumb.js +0 -9
  37. package/dist/components/breadcrumb/breadcrumb.mjs +2 -2
  38. package/dist/components/breadcrumb/index.js +0 -9
  39. package/dist/components/breadcrumb/index.mjs +2 -2
  40. package/dist/components/button/button-group.js +0 -9
  41. package/dist/components/button/button-group.mjs +2 -2
  42. package/dist/components/button/button.js +0 -9
  43. package/dist/components/button/button.mjs +2 -2
  44. package/dist/components/button/index.js +0 -9
  45. package/dist/components/button/index.mjs +3 -3
  46. package/dist/components/checkbox/checkbox.js +0 -9
  47. package/dist/components/checkbox/checkbox.mjs +2 -2
  48. package/dist/components/checkbox/index.js +0 -9
  49. package/dist/components/checkbox/index.mjs +2 -2
  50. package/dist/components/chip/chip.js +0 -9
  51. package/dist/components/chip/chip.mjs +2 -2
  52. package/dist/components/chip/index.js +0 -9
  53. package/dist/components/chip/index.mjs +2 -2
  54. package/dist/components/dateTimePicker/calendar.js +0 -9
  55. package/dist/components/dateTimePicker/calendar.mjs +2 -2
  56. package/dist/components/dateTimePicker/dateTimePicker.js +0 -9
  57. package/dist/components/dateTimePicker/dateTimePicker.mjs +7 -7
  58. package/dist/components/dateTimePicker/index.js +0 -9
  59. package/dist/components/dateTimePicker/index.mjs +7 -7
  60. package/dist/components/dateTimePicker/timePicker.js +0 -9
  61. package/dist/components/dateTimePicker/timePicker.mjs +5 -5
  62. package/dist/components/input/index.d.mts +1 -1
  63. package/dist/components/input/index.d.ts +1 -1
  64. package/dist/components/input/index.js +429 -379
  65. package/dist/components/input/index.mjs +3 -2
  66. package/dist/components/input/input.d.mts +96 -81
  67. package/dist/components/input/input.d.ts +96 -81
  68. package/dist/components/input/input.js +429 -379
  69. package/dist/components/input/input.mjs +3 -2
  70. package/dist/components/list/index.js +0 -9
  71. package/dist/components/list/index.mjs +4 -4
  72. package/dist/components/list/list.js +0 -9
  73. package/dist/components/list/list.mjs +2 -2
  74. package/dist/components/list/listItem.js +0 -9
  75. package/dist/components/list/listItem.mjs +3 -3
  76. package/dist/components/modal/index.js +0 -9
  77. package/dist/components/modal/index.mjs +4 -4
  78. package/dist/components/modal/modal.js +0 -9
  79. package/dist/components/modal/modal.mjs +4 -4
  80. package/dist/components/pagination/index.d.mts +1 -1
  81. package/dist/components/pagination/index.d.ts +1 -1
  82. package/dist/components/pagination/index.js +320 -292
  83. package/dist/components/pagination/index.mjs +4 -3
  84. package/dist/components/pagination/pagination.d.mts +39 -95
  85. package/dist/components/pagination/pagination.d.ts +39 -95
  86. package/dist/components/pagination/pagination.js +322 -296
  87. package/dist/components/pagination/pagination.mjs +6 -7
  88. package/dist/components/radio/index.js +0 -9
  89. package/dist/components/radio/index.mjs +2 -2
  90. package/dist/components/radio/radio.js +0 -9
  91. package/dist/components/radio/radio.mjs +2 -2
  92. package/dist/components/select/index.js +0 -9
  93. package/dist/components/select/index.mjs +3 -3
  94. package/dist/components/select/option.js +0 -9
  95. package/dist/components/select/option.mjs +2 -2
  96. package/dist/components/select/select.js +0 -9
  97. package/dist/components/select/select.mjs +3 -3
  98. package/dist/components/table/index.js +1193 -775
  99. package/dist/components/table/index.mjs +10 -5
  100. package/dist/components/table/table-body.d.mts +10 -16
  101. package/dist/components/table/table-body.d.ts +10 -16
  102. package/dist/components/table/table-body.js +54 -3792
  103. package/dist/components/table/table-body.mjs +3 -6
  104. package/dist/components/table/table-head.d.mts +4 -6
  105. package/dist/components/table/table-head.d.ts +4 -6
  106. package/dist/components/table/table-head.js +6 -44
  107. package/dist/components/table/table-head.mjs +3 -3
  108. package/dist/components/table/table.d.mts +91 -231
  109. package/dist/components/table/table.d.ts +91 -231
  110. package/dist/components/table/table.js +1193 -775
  111. package/dist/components/table/table.mjs +10 -5
  112. package/dist/components/tabs/index.js +0 -9
  113. package/dist/components/tabs/index.mjs +2 -2
  114. package/dist/components/tabs/tabs.js +0 -9
  115. package/dist/components/tabs/tabs.mjs +2 -2
  116. package/dist/components/toast/index.js +0 -9
  117. package/dist/components/toast/index.mjs +3 -3
  118. package/dist/components/toast/toast.js +0 -9
  119. package/dist/components/toast/toast.mjs +2 -2
  120. package/dist/components/toast/use-toast.js +0 -9
  121. package/dist/components/toast/use-toast.mjs +3 -3
  122. package/dist/components/tooltip/index.js +0 -9
  123. package/dist/components/tooltip/index.mjs +2 -2
  124. package/dist/components/tooltip/tooltip.js +0 -9
  125. package/dist/components/tooltip/tooltip.mjs +2 -2
  126. package/dist/index.js +822 -958
  127. package/dist/index.mjs +56 -56
  128. package/dist/utils/tailwind-variants.js +0 -9
  129. package/dist/utils/tailwind-variants.mjs +1 -1
  130. package/package.json +1 -1
  131. package/dist/chunk-5IQKKLZY.mjs +0 -139
  132. package/dist/chunk-PFYYYUJW.mjs +0 -56
  133. package/dist/chunk-RQ76IOYC.mjs +0 -300
  134. package/dist/chunk-SK2A72R2.mjs +0 -263
  135. package/dist/chunk-YGOEKSNZ.mjs +0 -345
@@ -1,300 +0,0 @@
1
- "use client";
2
- import {
3
- usePagination_default
4
- } from "./chunk-F3HENRVM.mjs";
5
- import {
6
- input_default
7
- } from "./chunk-SK2A72R2.mjs";
8
- import {
9
- tv
10
- } from "./chunk-IE2BRM7Z.mjs";
11
- import {
12
- mapPropsVariants
13
- } from "./chunk-E3G5QXSH.mjs";
14
-
15
- // src/components/pagination/pagination.tsx
16
- import { forwardRef, useCallback, useMemo } from "react";
17
- import { jsx, jsxs } from "react/jsx-runtime";
18
- var Pagination = forwardRef((originalProps, ref) => {
19
- const [props, variantProps] = mapPropsVariants(originalProps, pagination.variantKeys);
20
- const {
21
- classNames,
22
- currentPage,
23
- groupSize,
24
- totalPage,
25
- showPageNumber = true,
26
- showPageLabel,
27
- showPageInput,
28
- showFirstLastButtons,
29
- handleChangePage
30
- } = props;
31
- const { startPage, endPage, pageList, handleClickMovePage } = usePagination_default({
32
- currentPage,
33
- totalPage,
34
- groupSize,
35
- handleChangePage
36
- });
37
- const slots = useMemo(() => pagination({ ...variantProps }), [variantProps]);
38
- const getBaseProps = useCallback(() => ({ className: slots.base({ class: classNames == null ? void 0 : classNames.base }) }), [slots, classNames]);
39
- const getLabelProps = useCallback(
40
- () => ({ className: `${slots.label({ class: classNames == null ? void 0 : classNames.label })} + ${showPageInput && " !min-w-[55px]"}` }),
41
- [slots, classNames, showPageInput]
42
- );
43
- const getWrapperProps = useCallback(
44
- () => ({ className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }) }),
45
- [slots, classNames]
46
- );
47
- const getIconProps = useCallback(() => ({ className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }) }), [slots, classNames]);
48
- const getButtonProps = useCallback(
49
- () => ({ className: slots.button({ class: classNames == null ? void 0 : classNames.button }) }),
50
- [slots, classNames]
51
- );
52
- const getLabelWrapperProps = useCallback(
53
- () => ({
54
- className: "flex shrink-0",
55
- onSubmit: (e) => {
56
- e.preventDefault();
57
- if (showPageInput && handleChangePage) {
58
- const formData = new FormData(e.target);
59
- const page = formData.get("pagination-input");
60
- if (page) handleChangePage(+page);
61
- }
62
- }
63
- }),
64
- [handleChangePage, showPageInput]
65
- );
66
- const getInputProps = useCallback(
67
- () => ({
68
- defaultValue: currentPage,
69
- size: "sm",
70
- name: "pagination-input",
71
- type: "number",
72
- max: totalPage,
73
- min: 1,
74
- classNames: { inputWrapper: "!w-[48px] h-[20px] px-[6px]", input: "input-arrow-hide" }
75
- }),
76
- [currentPage, totalPage]
77
- );
78
- return /* @__PURE__ */ jsxs("div", { ...getBaseProps(), children: [
79
- showPageLabel && /* @__PURE__ */ jsx("span", { ...getLabelProps(), children: `${currentPage} of ${totalPage}` }),
80
- /* @__PURE__ */ jsxs("form", { ...getLabelWrapperProps(), children: [
81
- showPageInput && /* @__PURE__ */ jsx(input_default, { ...getInputProps() }, `${currentPage}+pagination-input`),
82
- showPageLabel && /* @__PURE__ */ jsxs("span", { ...getLabelProps(), children: [
83
- !showPageInput && currentPage,
84
- ` of ${totalPage}`
85
- ] })
86
- ] }),
87
- /* @__PURE__ */ jsxs("div", { ...getWrapperProps(), children: [
88
- showFirstLastButtons && /* @__PURE__ */ jsx(
89
- "div",
90
- {
91
- "aria-label": "firstPage",
92
- "data-is-active": currentPage > 1,
93
- ...getIconProps(),
94
- onClick: currentPage > 1 ? handleClickMovePage(1) : void 0,
95
- children: "<<"
96
- }
97
- ),
98
- /* @__PURE__ */ jsx(
99
- "div",
100
- {
101
- "aria-label": "prevPage",
102
- "data-is-active": currentPage > 1,
103
- ...getIconProps(),
104
- onClick: currentPage > 1 ? handleClickMovePage(currentPage - 1) : void 0,
105
- children: "<"
106
- }
107
- ),
108
- showPageNumber && pageList.map((page, index) => /* @__PURE__ */ jsx(
109
- "div",
110
- {
111
- ...getButtonProps(),
112
- "data-selected": currentPage === page,
113
- onClick: handleClickMovePage(page),
114
- children: page
115
- },
116
- index
117
- )),
118
- /* @__PURE__ */ jsx(
119
- "div",
120
- {
121
- "aria-label": "nextPage",
122
- "data-is-active": currentPage < totalPage,
123
- ...getIconProps(),
124
- onClick: currentPage < totalPage ? handleClickMovePage(currentPage + 1) : void 0,
125
- children: ">"
126
- }
127
- ),
128
- showFirstLastButtons && /* @__PURE__ */ jsx(
129
- "div",
130
- {
131
- "aria-label": "lastPage",
132
- "data-is-active": currentPage < totalPage,
133
- ...getIconProps(),
134
- onClick: currentPage < totalPage ? handleClickMovePage(totalPage) : void 0,
135
- children: ">>"
136
- }
137
- ),
138
- /* @__PURE__ */ jsxs("form", { ...getLabelWrapperProps(), children: [
139
- showPageInput && /* @__PURE__ */ jsx(input_default, { ...getInputProps() }, `${currentPage}+pagination-input`),
140
- showPageLabel && /* @__PURE__ */ jsxs("span", { ...getLabelProps(), children: [
141
- !showPageInput && currentPage,
142
- ` of ${totalPage}`
143
- ] })
144
- ] })
145
- ] })
146
- ] });
147
- });
148
- Pagination.displayName = "Pagination";
149
- var pagination_default = Pagination;
150
- var pagination = tv(
151
- {
152
- slots: {
153
- base: "flex items-center select-none",
154
- label: "text-primary-main text-right whitespace-nowrap",
155
- wrapper: "flex overflow-hidden flex items-center",
156
- icon: "flex items-center justify-center cursor-pointer",
157
- button: "flex items-center justify-center cursor-pointer data-[selected=true]:font-[600] transition duration-200"
158
- },
159
- variants: {
160
- variant: {
161
- solid: {
162
- button: ["text-neutral-dark"],
163
- icon: "text-neutral-dark data-[is-active=false]:text-neutral-light data-[is-active=false]:cursor-default"
164
- },
165
- line: {
166
- wrapper: "!gap-0",
167
- button: ["text-foreground"],
168
- icon: "text-foreground data-[is-active=false]:text-neutral-light data-[is-active=false]:cursor-default first-of-type:border-l-0"
169
- }
170
- },
171
- size: {
172
- sm: {
173
- wrapper: "gap-[6px]",
174
- label: "min-w-[85px] text-sm mr-[10px]",
175
- icon: ["h-[15px] text-sm"],
176
- button: ["min-w-[28px] h-[15px] text-sm"]
177
- },
178
- md: {
179
- wrapper: "gap-[8px]",
180
- label: "min-w-[95px] text-md mr-[12px]",
181
- icon: ["h-[17px] text-md"],
182
- button: ["min-w-[32px] h-[17px] text-md"]
183
- },
184
- lg: {
185
- wrapper: "gap-[10px]",
186
- label: "min-w-[105px] text-lg mr-[14px]",
187
- icon: ["h-[20px] text-lg"],
188
- button: ["min-w-[37px] h-[20px] text-lg"]
189
- },
190
- xl: {
191
- wrapper: "gap-[10px]",
192
- label: "min-w-[105px] text-lg mr-[14px]",
193
- icon: ["h-[20px] text-lg"],
194
- button: ["min-w-[37px] h-[20px] text-lg"]
195
- }
196
- },
197
- color: {
198
- primary: {
199
- label: "text-primary-main"
200
- },
201
- secondary: {
202
- label: "text-secondary-main"
203
- }
204
- },
205
- isDisabled: {
206
- true: {
207
- icon: "!text-neutral-light !cursor-default",
208
- button: "!text-neutral-light !cursor-default"
209
- }
210
- }
211
- },
212
- defaultVariants: {
213
- variant: "solid",
214
- color: "primary",
215
- size: "md",
216
- isDisabled: false
217
- },
218
- compoundVariants: [
219
- {
220
- variant: "solid",
221
- color: "primary",
222
- class: {
223
- button: "hover:text-primary-main data-[selected=true]:text-primary-main data-[selected=true]:border-primary-main",
224
- icon: "hover:text-primary-main"
225
- }
226
- },
227
- {
228
- variant: "solid",
229
- color: "secondary",
230
- class: {
231
- button: "hover:text-secondary-main data-[selected=true]:text-secondary-main data-[selected=true]:border-secondary-main",
232
- icon: "hover:text-secondary-main"
233
- }
234
- },
235
- {
236
- variant: "line",
237
- size: "sm",
238
- class: {
239
- wrapper: "border rounded-sm gap-0",
240
- button: "!min-w-[40px] h-[20px] border-l",
241
- icon: "min-w-[40px] h-[20px] border-l"
242
- }
243
- },
244
- {
245
- variant: "line",
246
- size: "md",
247
- class: {
248
- wrapper: "border rounded-md gap-0",
249
- button: "!min-w-[45px] h-[22px] border-l",
250
- icon: "min-w-[45px] h-[22px] border-l"
251
- }
252
- },
253
- {
254
- variant: "line",
255
- size: "lg",
256
- class: {
257
- wrapper: "border rounded-lg gap-0",
258
- button: "!min-w-[50px] h-[24px] border-l",
259
- icon: "min-w-[50px] h-[24px] border-l"
260
- }
261
- },
262
- {
263
- variant: "line",
264
- size: "xl",
265
- class: {
266
- wrapper: "border rounded-lg gap-0",
267
- button: "!min-w-[50px] h-[24px] border-l",
268
- icon: "min-w-[50px] h-[24px] border-l"
269
- }
270
- },
271
- {
272
- variant: "line",
273
- color: "primary",
274
- class: {
275
- wrapper: "border-primary-main",
276
- button: "border-primary-main hover:bg-primary-soft hover:text-primary-main data-[selected=true]:bg-primary-soft data-[selected=true]:text-primary-main",
277
- icon: "border-primary-main data-[selected=true]:bg-primary-soft data-[selected=true]:text-primary-main data-[is-active=true]:hover:text-primary-main data-[is-active=true]:hover:bg-primary-soft"
278
- }
279
- },
280
- {
281
- variant: "line",
282
- color: "secondary",
283
- class: {
284
- wrapper: "border-secondary-main",
285
- button: "border-secondary-main hover:bg-secondary-soft hover:text-secondary-main data-[selected=true]:bg-secondary-soft data-[selected=true]:text-secondary-main",
286
- icon: "border-secondary-main data-[selected=true]:bg-secondary-soft data-[selected=true]:text-secondary-main data-[is-active=true]:hover:text-secondary-main data-[is-active=true]:hover:bg-secondary-soft"
287
- }
288
- }
289
- ]
290
- },
291
- {
292
- twMerge: false
293
- }
294
- );
295
-
296
- export {
297
- Pagination,
298
- pagination_default,
299
- pagination
300
- };
@@ -1,263 +0,0 @@
1
- "use client";
2
- import {
3
- Icon_default
4
- } from "./chunk-24NQEB73.mjs";
5
- import {
6
- tv
7
- } from "./chunk-IE2BRM7Z.mjs";
8
- import {
9
- mapPropsVariants
10
- } from "./chunk-E3G5QXSH.mjs";
11
-
12
- // src/components/input/input.tsx
13
- import React, { forwardRef, useRef, useCallback, useMemo } from "react";
14
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
- var Input = forwardRef((originalProps, ref) => {
16
- const [props, variantProps] = mapPropsVariants(originalProps, inputStyle.variantKeys);
17
- const { classNames, label, errorMessage, startContent, endContent, ...inputProps } = props;
18
- const inputRef = useRef(null);
19
- const slots = useMemo(() => inputStyle({ ...variantProps }), [variantProps]);
20
- const getBaseProps = useCallback(
21
- () => ({
22
- className: slots.base({ class: classNames == null ? void 0 : classNames.base })
23
- }),
24
- [slots, classNames]
25
- );
26
- const getLabelProps = useCallback(
27
- () => ({
28
- className: slots.label({ class: classNames == null ? void 0 : classNames.label })
29
- }),
30
- [slots, classNames]
31
- );
32
- const getInnerWrapperProps = useCallback(
33
- () => ({
34
- className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
35
- }),
36
- [slots, classNames]
37
- );
38
- const getInputWrapperProps = useCallback(
39
- () => ({
40
- className: slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper })
41
- }),
42
- [slots, classNames]
43
- );
44
- const getInputProps = useCallback(
45
- () => ({
46
- ...inputProps,
47
- ref: ref || inputRef,
48
- className: slots.input({ class: classNames == null ? void 0 : classNames.input }),
49
- size: 0
50
- }),
51
- [slots, classNames, inputProps, ref]
52
- );
53
- const getContentProps = useCallback(
54
- () => ({
55
- className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
56
- size: originalProps.size
57
- }),
58
- [slots, classNames, originalProps.size]
59
- );
60
- const getErrorMessageProps = useCallback(
61
- () => ({
62
- className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
63
- }),
64
- [slots, classNames]
65
- );
66
- const renderStartContent = () => {
67
- if (React.isValidElement(startContent)) {
68
- const existingProps = startContent.props;
69
- const mergedProps = {
70
- ...getContentProps(),
71
- className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
72
- };
73
- return React.cloneElement(startContent, mergedProps);
74
- } else {
75
- const contentProps = getContentProps();
76
- return /* @__PURE__ */ jsx("div", { ...contentProps, children: startContent });
77
- }
78
- };
79
- const renderDateTimePickerIcon = () => /* @__PURE__ */ jsx(
80
- "div",
81
- {
82
- ...getContentProps(),
83
- onClick: () => {
84
- const target = ref && "current" in ref ? ref.current : inputRef.current;
85
- target == null ? void 0 : target.focus();
86
- target == null ? void 0 : target.showPicker();
87
- },
88
- children: /* @__PURE__ */ jsx(Icon_default, { name: props.type === "time" ? "clock" : "calendar", size: originalProps.size, className: "cursor-pointer" })
89
- }
90
- );
91
- const renderContentWithIcon = () => {
92
- if (React.isValidElement(endContent)) {
93
- const existingProps = endContent.props;
94
- const mergedProps = {
95
- ...getContentProps(),
96
- className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
97
- };
98
- return React.cloneElement(endContent, mergedProps);
99
- } else if (errorMessage) {
100
- const iconProps = { ...getContentProps(), className: getContentProps().className };
101
- return /* @__PURE__ */ jsx("div", { ...iconProps, children: /* @__PURE__ */ jsx(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
102
- } else {
103
- return /* @__PURE__ */ jsx(Fragment, {});
104
- }
105
- };
106
- const renderEndContent = () => {
107
- switch (props.type) {
108
- case "date":
109
- case "datetime-local":
110
- case "month":
111
- case "week":
112
- case "time":
113
- return renderDateTimePickerIcon();
114
- default:
115
- return renderContentWithIcon();
116
- }
117
- };
118
- return /* @__PURE__ */ jsxs("div", { ...getBaseProps(), children: [
119
- label && /* @__PURE__ */ jsx("label", { ...getLabelProps(), children: label }),
120
- /* @__PURE__ */ jsxs("div", { ...getInnerWrapperProps(), children: [
121
- /* @__PURE__ */ jsxs("div", { ...getInputWrapperProps(), children: [
122
- startContent && renderStartContent(),
123
- /* @__PURE__ */ jsx("input", { ...getInputProps() }),
124
- renderEndContent()
125
- ] }),
126
- errorMessage && /* @__PURE__ */ jsx("p", { ...getErrorMessageProps(), children: errorMessage })
127
- ] })
128
- ] });
129
- });
130
- Input.displayName = "Input";
131
- var input_default = Input;
132
- var inputStyle = tv({
133
- slots: {
134
- base: ["group/input", "flex", "flex-col"],
135
- label: ["flex", "items-center"],
136
- innerWrapper: ["flex", "flex-col"],
137
- inputWrapper: [
138
- "flex",
139
- "items-center",
140
- "transition",
141
- "duration-200",
142
- "group-has-[p]/input:border-danger-main",
143
- "group-has-[p]/input:bg-danger-soft"
144
- ],
145
- input: ["w-full", "h-full", "bg-transparent", "placeholder:text-neutral-main", "focus-visible:outline-none"],
146
- content: ["flex", "items-center", "select-none", "group-has-[p]/input:text-danger-main"],
147
- errorMessage: ["text-danger-main"]
148
- },
149
- variants: {
150
- variant: {
151
- solid: {
152
- inputWrapper: ["bg-trans-soft", "hover:bg-trans-light", "has-[:focus]:bg-trans-light"]
153
- },
154
- normal: {
155
- inputWrapper: [
156
- "bg-transparent",
157
- "border",
158
- "border-neutral-main",
159
- "hover:bg-trans-soft",
160
- "has-[:focus]:bg-trans-soft"
161
- ]
162
- },
163
- line: {
164
- inputWrapper: [
165
- "bg-transparent",
166
- "border-b",
167
- "border-neutral-main",
168
- "!rounded-none",
169
- "hover:bg-trans-soft",
170
- "has-[:focus]:bg-trans-soft"
171
- ]
172
- }
173
- },
174
- color: {
175
- primary: {
176
- inputWrapper: ["has-[:focus]:border-primary-main"],
177
- content: ["text-primary-main"]
178
- },
179
- secondary: {
180
- inputWrapper: ["has-[:focus]:border-secondary-main"],
181
- content: ["text-secondary-main"]
182
- }
183
- },
184
- size: {
185
- sm: {
186
- base: ["text-sm", "gap-[6px]"],
187
- innerWrapper: ["group-has-[p]/input:gap-[6px]"],
188
- inputWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[6px]", "py-[4.5px]", "gap-[6px]"],
189
- errorMessage: ["text-sm"]
190
- },
191
- md: {
192
- base: ["text-md", "gap-[8px]"],
193
- innerWrapper: ["group-has-[p]/input:gap-[8px]"],
194
- inputWrapper: ["w-[240px]", "h-[30px]", "rounded-md", "px-[8px]", "py-[6.5px]", "gap-[8px]"],
195
- errorMessage: ["text-md"]
196
- },
197
- lg: {
198
- base: ["text-lg", "gap-[10px]"],
199
- innerWrapper: ["group-has-[p]/input:gap-[10px]"],
200
- inputWrapper: ["w-[240px]", "h-[36px]", "rounded-lg", "px-[10px]", "py-[8px]", "gap-[10px]"],
201
- errorMessage: ["text-lg"]
202
- },
203
- xl: {
204
- base: ["text-xl", "gap-[10px]"],
205
- innerWrapper: ["group-has-[p]/input:gap-[10px]"],
206
- inputWrapper: ["w-[240px]", "h-[36px]", "rounded-xl", "px-[10px]", "py-[8px]", "gap-[10px]"],
207
- errorMessage: ["text-xl"]
208
- }
209
- },
210
- radius: {
211
- default: "",
212
- none: {
213
- inputWrapper: ["rounded-none"]
214
- },
215
- full: {
216
- inputWrapper: ["rounded-full"]
217
- }
218
- },
219
- fullWidth: {
220
- true: {
221
- base: ["w-full"],
222
- innerWrapper: ["flex-1"],
223
- inputWrapper: ["w-full"]
224
- }
225
- },
226
- isDisabled: {
227
- true: {
228
- label: ["text-neutral-light"],
229
- inputWrapper: ["bg-neutral-soft", "border-neutral-light", "pointer-events-none"],
230
- input: ["text-neutral-light", "placeholder:text-neutral-light"],
231
- content: ["text-neutral-light", "group-has-[p]/input:text-danger-light"],
232
- errorMessage: ["text-danger-light"]
233
- }
234
- },
235
- isRequired: {
236
- true: {
237
- label: ["after:content-['*']", "after:text-danger-main", "after:ml-0.5"]
238
- }
239
- }
240
- },
241
- defaultVariants: {
242
- variant: "solid",
243
- color: "primary",
244
- size: "md",
245
- fullWidth: false,
246
- isDisabled: false,
247
- isRequired: false
248
- },
249
- compoundVariants: [
250
- {
251
- isDisabled: true,
252
- isRequired: true,
253
- class: {
254
- label: ["after:text-danger-light"]
255
- }
256
- }
257
- ]
258
- });
259
-
260
- export {
261
- input_default,
262
- inputStyle
263
- };