lecom-ui 5.0.11 → 5.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/badge.js +26 -0
- package/dist/button-dropdown.js +117 -0
- package/dist/button.js +104 -0
- package/dist/calendar.js +62 -0
- package/dist/card.js +56 -0
- package/dist/checkbox.js +55 -0
- package/dist/collapse.js +60 -0
- package/dist/collapsible.js +7 -0
- package/dist/command.js +107 -0
- package/dist/components/DataTable/Table.js +1 -1
- package/dist/components/Header/ModulesMenu.js +6 -3
- package/dist/data-table/data-table.js +490 -0
- package/dist/date-picker.js +92 -0
- package/dist/dialog.js +95 -0
- package/dist/dropdown-menu.js +138 -0
- package/dist/fonts/Montserrat-Bold.otf +0 -0
- package/dist/fonts/Montserrat-Medium.otf +0 -0
- package/dist/fonts/Montserrat-Regular.otf +0 -0
- package/dist/fonts/Roboto-Bold.otf +0 -0
- package/dist/fonts/Roboto-Light.otf +0 -0
- package/dist/fonts/Roboto-Medium.otf +0 -0
- package/dist/fonts/Roboto-Regular.otf +0 -0
- package/dist/form.js +102 -0
- package/dist/header.js +90 -0
- package/dist/hook/useDebounce.js +16 -0
- package/dist/icon-handler.js +72 -0
- package/dist/icons/brandModules.js +27 -0
- package/dist/icons/companyLogo.js +61 -0
- package/dist/icons/createUseAuxiliary.js +107 -0
- package/dist/icons/footerInfo.js +25 -0
- package/dist/icons/logo_lecom.svg.js +3 -0
- package/dist/icons/newUpdate.js +23 -0
- package/dist/icons/robertyRPA.js +30 -0
- package/dist/ilustrations/access_denied.js +252 -0
- package/dist/ilustrations/page_not_found.js +188 -0
- package/dist/index.d.ts +4 -3
- package/dist/input.js +42 -0
- package/dist/label.js +20 -0
- package/dist/modal.js +27 -0
- package/dist/pagination.js +474 -0
- package/dist/plugin/extend.ts +78 -78
- package/dist/plugin/fontFaces.ts +172 -172
- package/dist/plugin/general.ts +12 -12
- package/dist/plugin/pluginDev.cjs +5 -5
- package/dist/plugin/pluginNext.cjs +5 -5
- package/dist/plugin/pluginVite.cjs +5 -5
- package/dist/plugin/template.ts +31 -31
- package/dist/plugin/typographies.ts +152 -152
- package/dist/plugin/varsTheme.ts +79 -79
- package/dist/plugin.cjs +298 -0
- package/dist/popover.js +24 -0
- package/dist/radio-group.js +74 -0
- package/dist/range-picker.js +99 -0
- package/dist/scroll-area.js +37 -0
- package/dist/search-bar.js +151 -0
- package/dist/select.js +156 -0
- package/dist/separator.js +24 -0
- package/dist/sheet.js +106 -0
- package/dist/sidebar.js +188 -0
- package/dist/skeleton.js +17 -0
- package/dist/slider.js +23 -0
- package/dist/status-screen.js +71 -0
- package/dist/switch.js +27 -0
- package/dist/table.js +83 -0
- package/dist/tabs.js +44 -0
- package/dist/tag.js +33 -0
- package/dist/textarea.js +22 -0
- package/dist/toast.js +105 -0
- package/dist/toaster.js +23 -0
- package/dist/tooltip.js +133 -0
- package/dist/use-toast.js +121 -0
- package/package.json +1 -1
package/dist/plugin.cjs
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
const plugin = require('tailwindcss/plugin');
|
|
2
|
+
|
|
3
|
+
module.exports = plugin(
|
|
4
|
+
({ addBase }) => {
|
|
5
|
+
addBase({
|
|
6
|
+
':root': {
|
|
7
|
+
'--blue-brand': '230 55% 33%',
|
|
8
|
+
'--green-brand': '154 38% 56%',
|
|
9
|
+
'--pink-brand': '332, 71%, 63%',
|
|
10
|
+
'--background': '0 0% 100%',
|
|
11
|
+
'--foreground': '222.2 84% 4.9%',
|
|
12
|
+
'--card': '0 0% 100%',
|
|
13
|
+
'--card-foreground': '222.2 84% 4.9%',
|
|
14
|
+
'--popover': '0 0% 100%',
|
|
15
|
+
'--popover-foreground': '222.2 84% 4.9%',
|
|
16
|
+
'--primary': '221.2 83.2% 53.3%',
|
|
17
|
+
'--primary-foreground': '210 40% 98%',
|
|
18
|
+
'--secondary': '210 40% 96.1%',
|
|
19
|
+
'--secondary-foreground': '222.2 47.4% 11.2%',
|
|
20
|
+
'--muted': '210 40% 96.1%',
|
|
21
|
+
'--muted-foreground': '215.4 16.3% 46.9%',
|
|
22
|
+
'--accent': '210 40% 96.1%',
|
|
23
|
+
'--accent-foreground': '222.2 47.4% 11.2%',
|
|
24
|
+
'--destructive': '0 84.2% 60.2%',
|
|
25
|
+
'--destructive-foreground': '210 40% 98%',
|
|
26
|
+
'--border': '214.3 31.8% 91.4%',
|
|
27
|
+
'--input': '214.3 31.8% 91.4%',
|
|
28
|
+
'--ring': '221.2 83.2% 53.3%',
|
|
29
|
+
'--radius': '0.5rem',
|
|
30
|
+
'--default': '0 0% 30%',
|
|
31
|
+
'--magenta': '314.79 74.22% 44.12%',
|
|
32
|
+
'--red': '355.21 83.19% 44.31%',
|
|
33
|
+
'--red-light': '0, 100%, 85%, 1',
|
|
34
|
+
'--red-dark': '0, 99%, 64%, 1',
|
|
35
|
+
'--volcano': '12.96 88.44% 44.12%',
|
|
36
|
+
'--orange': '29.12 92.73% 43.14%',
|
|
37
|
+
'--gold': '37.86 94.5% 42.75%',
|
|
38
|
+
'--lime': '78.97 94.57% 36.08%',
|
|
39
|
+
'--green': '102.21 84.8% 33.53%',
|
|
40
|
+
'--green-light': '101, 100%, 92%, 1',
|
|
41
|
+
'--green-dark': '101, 49%, 64%, 1',
|
|
42
|
+
'--cyan': '182.03 90.24% 32.16%',
|
|
43
|
+
'--yellow-light': '49, 100%, 88%, 1',
|
|
44
|
+
'--yellow-dark': '50, 93%, 49%, 1',
|
|
45
|
+
'--blue': '217.21 92.04% 44.31%',
|
|
46
|
+
'--blue-light': '209, 100%, 92%, 1',
|
|
47
|
+
'--blue-dark': '215 100% 54%',
|
|
48
|
+
'--dodgerblue': '216, 57%, 51%, 0.2',
|
|
49
|
+
'--electricblue': '216, 57%, 51%, 0.3',
|
|
50
|
+
'--letterblue': '215 100% 40%',
|
|
51
|
+
'--geekblue': '219.94 74.22% 44.12%',
|
|
52
|
+
'--purple': '262.82 71% 39.22%',
|
|
53
|
+
'--transparency-light': '0, 0%, 0%, 0.1',
|
|
54
|
+
'--transparency-dark': '0, 0%, 100%, 0.2',
|
|
55
|
+
'--gray-05': '0, 0%, 0%, 0.0588',
|
|
56
|
+
'--gray-12': '0, 0%, 0%, 0.12',
|
|
57
|
+
'--gray-29': '0, 0%, 29%, 1',
|
|
58
|
+
'--gray-48': '0, 0%, 48%, 1',
|
|
59
|
+
'--gray-50': '0, 0%, 50%, 1',
|
|
60
|
+
'--gray-60': '0, 0%, 0%, 0.6',
|
|
61
|
+
'--gray-79': '0, 0%, 79%, 1',
|
|
62
|
+
'--gray-96': '0, 0%, 96%, 1',
|
|
63
|
+
'--gray-98': '0, 0%, 98%, 1',
|
|
64
|
+
},
|
|
65
|
+
'.dark': {
|
|
66
|
+
'--blue-brand': '230 55% 33%',
|
|
67
|
+
'--green-brand': '154 38% 56%',
|
|
68
|
+
'--pink-brand': '332, 71%, 63%',
|
|
69
|
+
'--background': '222.2 84% 4.9%',
|
|
70
|
+
'--foreground': '210 40% 98%',
|
|
71
|
+
'--card': '222.2 84% 4.9%',
|
|
72
|
+
'--card-foreground': '210 40% 98%',
|
|
73
|
+
'--popover': '222.2 84% 4.9%',
|
|
74
|
+
'--popover-foreground': '210 40% 98%',
|
|
75
|
+
'--primary': '217.2 91.2% 59.8%',
|
|
76
|
+
'--primary-foreground': '222.2 47.4% 11.2%',
|
|
77
|
+
'--secondary': '217.2 32.6% 17.5%',
|
|
78
|
+
'--secondary-foreground': '210 40% 98%',
|
|
79
|
+
'--muted': '217.2 32.6% 17.5%',
|
|
80
|
+
'--muted-foreground': '215 20.2% 65.1%',
|
|
81
|
+
'--accent': '217.2 32.6% 17.5%',
|
|
82
|
+
'--accent-foreground': '210 40% 98%',
|
|
83
|
+
'--destructive': '0 62.8% 30.6%',
|
|
84
|
+
'--destructive-foreground': '210 40% 98%',
|
|
85
|
+
'--border': '217.2 32.6% 17.5%',
|
|
86
|
+
'--input': '217.2 32.6% 17.5%',
|
|
87
|
+
'--ring': '224.3 76.3% 48%',
|
|
88
|
+
},
|
|
89
|
+
'.scrollbar-thin': {
|
|
90
|
+
'scrollbar-width': 'thin',
|
|
91
|
+
},
|
|
92
|
+
'.scrollbar-thin::-webkit-scrollbar': {
|
|
93
|
+
width: '8px',
|
|
94
|
+
height: '8px',
|
|
95
|
+
},
|
|
96
|
+
'.scrollbar-thin::-webkit-scrollbar-thumb': {
|
|
97
|
+
'background-color': 'rgba(0, 0, 0, 0.5)',
|
|
98
|
+
'border-radius': '10px',
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
theme: {
|
|
104
|
+
container: {
|
|
105
|
+
center: true,
|
|
106
|
+
padding: '2rem',
|
|
107
|
+
screens: {
|
|
108
|
+
'2xl': '1400px',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
extend: {
|
|
112
|
+
fontFamily: {
|
|
113
|
+
roboto: ['Roboto', 'sans-serif'],
|
|
114
|
+
montserrat: ['Montserrat', 'sans-serif'],
|
|
115
|
+
},
|
|
116
|
+
colors: {
|
|
117
|
+
brand: {
|
|
118
|
+
blue: 'hsl(var(--blue-brand))',
|
|
119
|
+
green: 'hsl(var(--green-brand))',
|
|
120
|
+
pink: 'hsl(var(--pink-brand))',
|
|
121
|
+
},
|
|
122
|
+
border: 'hsl(var(--border))',
|
|
123
|
+
input: 'hsl(var(--input))',
|
|
124
|
+
ring: 'hsl(var(--ring))',
|
|
125
|
+
background: 'hsl(var(--background))',
|
|
126
|
+
foreground: 'hsl(var(--foreground))',
|
|
127
|
+
primary: {
|
|
128
|
+
DEFAULT: 'hsl(var(--primary))',
|
|
129
|
+
foreground: 'hsl(var(--primary-foreground))',
|
|
130
|
+
},
|
|
131
|
+
secondary: {
|
|
132
|
+
DEFAULT: 'hsl(var(--secondary))',
|
|
133
|
+
foreground: 'hsl(var(--secondary-foreground))',
|
|
134
|
+
},
|
|
135
|
+
destructive: {
|
|
136
|
+
DEFAULT: 'hsl(var(--destructive))',
|
|
137
|
+
foreground: 'hsl(var(--destructive-foreground))',
|
|
138
|
+
},
|
|
139
|
+
muted: {
|
|
140
|
+
DEFAULT: 'hsl(var(--muted))',
|
|
141
|
+
foreground: 'hsl(var(--muted-foreground))',
|
|
142
|
+
},
|
|
143
|
+
accent: {
|
|
144
|
+
DEFAULT: 'hsl(var(--accent))',
|
|
145
|
+
foreground: 'hsl(var(--accent-foreground))',
|
|
146
|
+
},
|
|
147
|
+
popover: {
|
|
148
|
+
DEFAULT: 'hsl(var(--popover))',
|
|
149
|
+
foreground: 'hsl(var(--popover-foreground))',
|
|
150
|
+
},
|
|
151
|
+
card: {
|
|
152
|
+
DEFAULT: 'hsl(var(--card))',
|
|
153
|
+
foreground: 'hsl(var(--card-foreground))',
|
|
154
|
+
},
|
|
155
|
+
default: {
|
|
156
|
+
DEFAULT: 'hsl(var(--default))',
|
|
157
|
+
},
|
|
158
|
+
magenta: {
|
|
159
|
+
DEFAULT: 'hsl(var(--magenta))',
|
|
160
|
+
},
|
|
161
|
+
red: {
|
|
162
|
+
DEFAULT: 'hsl(var(--red))',
|
|
163
|
+
light: 'hsl(var(--red-light))',
|
|
164
|
+
dark: 'hsl(var(--red-dark))',
|
|
165
|
+
},
|
|
166
|
+
volcano: {
|
|
167
|
+
DEFAULT: 'hsl(var(--volcano))',
|
|
168
|
+
},
|
|
169
|
+
orange: {
|
|
170
|
+
DEFAULT: 'hsl(var(--orange))',
|
|
171
|
+
},
|
|
172
|
+
gold: {
|
|
173
|
+
DEFAULT: 'hsl(var(--gold))',
|
|
174
|
+
},
|
|
175
|
+
lime: {
|
|
176
|
+
DEFAULT: 'hsl(var(--lime))',
|
|
177
|
+
},
|
|
178
|
+
green: {
|
|
179
|
+
DEFAULT: 'hsl(var(--green))',
|
|
180
|
+
light: 'hsl(var(--green-light))',
|
|
181
|
+
dark: 'hsl(var(--green-dark))',
|
|
182
|
+
},
|
|
183
|
+
cyan: {
|
|
184
|
+
DEFAULT: 'hsl(var(--cyan))',
|
|
185
|
+
},
|
|
186
|
+
yellow: {
|
|
187
|
+
light: 'hsla(var(--yellow-light))',
|
|
188
|
+
dark: 'hsla(var(--yellow-dark))',
|
|
189
|
+
},
|
|
190
|
+
blue: {
|
|
191
|
+
DEFAULT: 'hsl(var(--blue))',
|
|
192
|
+
light: 'hsla(var(--blue-light))',
|
|
193
|
+
dark: 'hsla(var(--blue-dark))',
|
|
194
|
+
hover: 'hsla(var(--blue-hover))',
|
|
195
|
+
},
|
|
196
|
+
geekblue: {
|
|
197
|
+
DEFAULT: 'hsl(var(--geekblue))',
|
|
198
|
+
},
|
|
199
|
+
dodgerblue: {
|
|
200
|
+
DEFAULT: 'hsla(var(--dodgerblue))',
|
|
201
|
+
},
|
|
202
|
+
electricblue: {
|
|
203
|
+
DEFAULT: 'hsla(var(--electricblue))',
|
|
204
|
+
},
|
|
205
|
+
letterblue: {
|
|
206
|
+
DEFAULT: 'hsla(var(--letterblue))',
|
|
207
|
+
},
|
|
208
|
+
purple: {
|
|
209
|
+
DEFAULT: 'hsl(var(--purple))',
|
|
210
|
+
},
|
|
211
|
+
transparency: {
|
|
212
|
+
light: 'hsla(var(--transparency-light))',
|
|
213
|
+
dark: 'hsla(var(--transparency-dark))',
|
|
214
|
+
},
|
|
215
|
+
gray: {
|
|
216
|
+
scale05: 'hsla(var(--gray-05))',
|
|
217
|
+
scale12: 'hsla(var(--gray-12))',
|
|
218
|
+
scale29: 'hsla(var(--gray-29))',
|
|
219
|
+
scale48: 'hsla(var(--gray-48))',
|
|
220
|
+
scale50: 'hsla(var(--gray-50))',
|
|
221
|
+
scale60: 'hsla(var(--gray-60))',
|
|
222
|
+
scale79: 'hsla(var(--gray-79))',
|
|
223
|
+
scale96: 'hsla(var(--gray-96))',
|
|
224
|
+
scale98: 'hsla(var(--gray-98))',
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
borderRadius: {
|
|
228
|
+
lg: 'var(--radius)',
|
|
229
|
+
md: 'calc(var(--radius) - 2px)',
|
|
230
|
+
sm: 'calc(var(--radius) - 4px)',
|
|
231
|
+
},
|
|
232
|
+
keyframes: {
|
|
233
|
+
'accordion-down': {
|
|
234
|
+
from: { height: '0' },
|
|
235
|
+
to: { height: 'var(--radix-accordion-content-height)' },
|
|
236
|
+
},
|
|
237
|
+
'accordion-up': {
|
|
238
|
+
from: { height: 'var(--radix-accordion-content-height)' },
|
|
239
|
+
to: { height: '0' },
|
|
240
|
+
},
|
|
241
|
+
slide: {
|
|
242
|
+
'0%': {
|
|
243
|
+
transform: 'translateX(-100%)',
|
|
244
|
+
},
|
|
245
|
+
'100%': {
|
|
246
|
+
transform: 'translateX(100%)',
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
loading: {
|
|
250
|
+
'0%': {
|
|
251
|
+
transform: 'translateX(0)',
|
|
252
|
+
opacity: 0.5,
|
|
253
|
+
},
|
|
254
|
+
'50%': {
|
|
255
|
+
transform: 'translateX(50%)',
|
|
256
|
+
opacity: 0.1,
|
|
257
|
+
},
|
|
258
|
+
'100%': {
|
|
259
|
+
transform: 'translateX(100%)',
|
|
260
|
+
opacity: 0.5,
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
slideDownAndFade: {
|
|
264
|
+
from: { opacity: "0", transform: "translateY(-2px)" },
|
|
265
|
+
to: { opacity: "1", transform: "translateY(0)" },
|
|
266
|
+
},
|
|
267
|
+
slideLeftAndFade: {
|
|
268
|
+
from: { opacity: "0", transform: "translateX(2px)" },
|
|
269
|
+
to: { opacity: "1", transform: "translateX(0)" },
|
|
270
|
+
},
|
|
271
|
+
slideUpAndFade: {
|
|
272
|
+
from: { opacity: "0", transform: "translateY(2px)" },
|
|
273
|
+
to: { opacity: "1", transform: "translateY(0)" },
|
|
274
|
+
},
|
|
275
|
+
slideRightAndFade: {
|
|
276
|
+
from: { opacity: "0", transform: "translateX(-2px)" },
|
|
277
|
+
to: { opacity: "1", transform: "translateX(0)" },
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
animation: {
|
|
281
|
+
'accordion-down': 'accordion-down 0.2s ease-out',
|
|
282
|
+
'accordion-up': 'accordion-up 0.2s ease-out',
|
|
283
|
+
slide: 'slide 1s linear infinite',
|
|
284
|
+
loading: 'loading 1.5s infinite',
|
|
285
|
+
slideDownAndFade: "slideDownAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)",
|
|
286
|
+
slideLeftAndFade: "slideLeftAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)",
|
|
287
|
+
slideUpAndFade: "slideUpAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)",
|
|
288
|
+
slideRightAndFade: "slideRightAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)",
|
|
289
|
+
},
|
|
290
|
+
boxShadow: {
|
|
291
|
+
brand: {
|
|
292
|
+
blue: '0 0 2px #1890ff33',
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
}
|
|
298
|
+
);
|
package/dist/popover.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
4
|
+
import { cn } from './lib/utils.js';
|
|
5
|
+
|
|
6
|
+
const Popover = PopoverPrimitive.Root;
|
|
7
|
+
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
8
|
+
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
9
|
+
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
10
|
+
PopoverPrimitive.Content,
|
|
11
|
+
{
|
|
12
|
+
ref,
|
|
13
|
+
align,
|
|
14
|
+
sideOffset,
|
|
15
|
+
className: cn(
|
|
16
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
...props
|
|
20
|
+
}
|
|
21
|
+
) }));
|
|
22
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
23
|
+
|
|
24
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { CheckIcon } from '@radix-ui/react-icons';
|
|
4
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
5
|
+
import { cn } from './lib/utils.js';
|
|
6
|
+
|
|
7
|
+
const RadioGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
RadioGroupPrimitive.Root,
|
|
10
|
+
{
|
|
11
|
+
className: cn("grid gap-2", className),
|
|
12
|
+
...props,
|
|
13
|
+
ref
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
18
|
+
const RadioGroupItem = React.forwardRef(
|
|
19
|
+
({
|
|
20
|
+
className,
|
|
21
|
+
variantChecked = "check",
|
|
22
|
+
disabled,
|
|
23
|
+
onClick,
|
|
24
|
+
pulse = false,
|
|
25
|
+
...props
|
|
26
|
+
}, ref) => {
|
|
27
|
+
const [animate, setAnimate] = React.useState(false);
|
|
28
|
+
const handleClick = (event) => {
|
|
29
|
+
if (pulse) {
|
|
30
|
+
requestAnimationFrame(() => {
|
|
31
|
+
setAnimate(true);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (onClick) {
|
|
35
|
+
onClick(event);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
React.useEffect(() => {
|
|
39
|
+
if (animate) {
|
|
40
|
+
const timeout = setTimeout(() => {
|
|
41
|
+
setAnimate(false);
|
|
42
|
+
}, 300);
|
|
43
|
+
return () => clearTimeout(timeout);
|
|
44
|
+
}
|
|
45
|
+
}, [animate]);
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
RadioGroupPrimitive.Item,
|
|
48
|
+
{
|
|
49
|
+
ref,
|
|
50
|
+
className: cn(
|
|
51
|
+
"relative aspect-square h-4 w-4 rounded-full border text-primary border-gray-scale79 shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
52
|
+
animate && "pulse",
|
|
53
|
+
!disabled && "hover:border-primary data-[state=checked]:border-primary",
|
|
54
|
+
className
|
|
55
|
+
),
|
|
56
|
+
disabled,
|
|
57
|
+
onClick: handleClick,
|
|
58
|
+
...props,
|
|
59
|
+
children: variantChecked === "fill" ? /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: cn(
|
|
63
|
+
"absolute h-4 w-4 rounded-full",
|
|
64
|
+
disabled ? "bg-gray-scale79 border-white border-[3px]" : "bg-white border-primary border-[5px]"
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
) }) : /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(CheckIcon, { className: "h-3.5 w-3.5 fill-primary" }) })
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
73
|
+
|
|
74
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { parse, isValid, format } from 'date-fns';
|
|
4
|
+
import { ptBR } from 'date-fns/locale';
|
|
5
|
+
import { Calendar } from 'lucide-react';
|
|
6
|
+
import { cn } from './lib/utils.js';
|
|
7
|
+
import { Calendar as Calendar$1 } from './calendar.js';
|
|
8
|
+
import { Input } from './input.js';
|
|
9
|
+
import { Popover, PopoverTrigger, PopoverContent } from './popover.js';
|
|
10
|
+
|
|
11
|
+
function RangePicker({
|
|
12
|
+
selected,
|
|
13
|
+
onSelect,
|
|
14
|
+
format: format$1 = "dd/MM/yyyy",
|
|
15
|
+
placeholder = "",
|
|
16
|
+
className = "",
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
20
|
+
const [inputValue, setInputValue] = useState("");
|
|
21
|
+
const handleInputChange = (e) => {
|
|
22
|
+
setInputValue(e.currentTarget.value);
|
|
23
|
+
const range = (e.currentTarget.value || "").split(" - ");
|
|
24
|
+
const from = range[0];
|
|
25
|
+
const to = range[1];
|
|
26
|
+
const date = {
|
|
27
|
+
from: parse(from, format$1, /* @__PURE__ */ new Date()),
|
|
28
|
+
to: parse(to, format$1, /* @__PURE__ */ new Date())
|
|
29
|
+
};
|
|
30
|
+
if (isValid(date.from) && isValid(date.to) && typeof onSelect === "function") ;
|
|
31
|
+
};
|
|
32
|
+
const handleSelect = (range) => {
|
|
33
|
+
if (range?.from && range.to) {
|
|
34
|
+
setInputValue(
|
|
35
|
+
`${format(range.from, format$1)} - ${format(range.to, format$1)}`
|
|
36
|
+
);
|
|
37
|
+
setIsOpen(false);
|
|
38
|
+
} else {
|
|
39
|
+
setInputValue("");
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
43
|
+
Popover,
|
|
44
|
+
{
|
|
45
|
+
open: isOpen,
|
|
46
|
+
onOpenChange: (open) => {
|
|
47
|
+
setIsOpen(open);
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
PopoverTrigger,
|
|
52
|
+
{
|
|
53
|
+
onClick: (e) => {
|
|
54
|
+
if (isOpen) {
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
59
|
+
/* @__PURE__ */ jsx(Calendar, { className: "w-4 h-4 absolute right-[10px] top-[10px]" }),
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
Input,
|
|
62
|
+
{
|
|
63
|
+
placeholder,
|
|
64
|
+
value: inputValue,
|
|
65
|
+
onChange: handleInputChange,
|
|
66
|
+
className: cn("pr-8", className)
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] })
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
PopoverContent,
|
|
74
|
+
{
|
|
75
|
+
className: "w-auto p-0",
|
|
76
|
+
align: "start",
|
|
77
|
+
onOpenAutoFocus: (e) => {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
},
|
|
80
|
+
children: /* @__PURE__ */ jsx(
|
|
81
|
+
Calendar$1,
|
|
82
|
+
{
|
|
83
|
+
mode: "range",
|
|
84
|
+
locale: ptBR,
|
|
85
|
+
selected,
|
|
86
|
+
onSelect: handleSelect,
|
|
87
|
+
numberOfMonths: 2,
|
|
88
|
+
...props
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
RangePicker.displayName = "RangePicker";
|
|
98
|
+
|
|
99
|
+
export { RangePicker };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
4
|
+
import { cn } from './lib/utils.js';
|
|
5
|
+
|
|
6
|
+
const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
7
|
+
ScrollAreaPrimitive.Root,
|
|
8
|
+
{
|
|
9
|
+
ref,
|
|
10
|
+
className: cn("relative overflow-hidden", className),
|
|
11
|
+
...props,
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
14
|
+
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
15
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
));
|
|
19
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
20
|
+
const ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
21
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
orientation,
|
|
25
|
+
className: cn(
|
|
26
|
+
"flex touch-none select-none transition-colors",
|
|
27
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
28
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
...props,
|
|
32
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
33
|
+
}
|
|
34
|
+
));
|
|
35
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
36
|
+
|
|
37
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useState, useEffect } from 'react';
|
|
3
|
+
import { X, Loader, Search } from 'lucide-react';
|
|
4
|
+
import { useDebounce } from './hook/useDebounce.js';
|
|
5
|
+
import { cn } from './lib/utils.js';
|
|
6
|
+
import { Input } from './input.js';
|
|
7
|
+
|
|
8
|
+
const variantButtonClasses = {
|
|
9
|
+
"rounded-right": "border-r rounded-l",
|
|
10
|
+
"rounded-left": "border-l rounded-r"
|
|
11
|
+
};
|
|
12
|
+
const SearchBar = forwardRef((props, ref) => {
|
|
13
|
+
const {
|
|
14
|
+
onKeyPressSearch,
|
|
15
|
+
onChangeSearch,
|
|
16
|
+
className,
|
|
17
|
+
variant = "default",
|
|
18
|
+
size = "default",
|
|
19
|
+
pressButton = false,
|
|
20
|
+
disabled = false,
|
|
21
|
+
side = "right",
|
|
22
|
+
placeholder,
|
|
23
|
+
classNameIcon,
|
|
24
|
+
iconFill = "#7A7A7A",
|
|
25
|
+
defaultValue = "",
|
|
26
|
+
allowClear = false,
|
|
27
|
+
loading = false,
|
|
28
|
+
addonAfter,
|
|
29
|
+
addonBefore,
|
|
30
|
+
...restProps
|
|
31
|
+
} = props;
|
|
32
|
+
const [query, setQuery] = useState(defaultValue);
|
|
33
|
+
const debouncedValue = useDebounce(query, query.length > 0 ? 600 : 0);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
setQuery(defaultValue);
|
|
36
|
+
}, [defaultValue]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (onChangeSearch && (debouncedValue.length >= 3 || debouncedValue.length === 0)) {
|
|
39
|
+
const event = {
|
|
40
|
+
target: { value: debouncedValue }
|
|
41
|
+
};
|
|
42
|
+
onChangeSearch(event);
|
|
43
|
+
}
|
|
44
|
+
}, [debouncedValue, onChangeSearch]);
|
|
45
|
+
const handleSearchChange = (e) => {
|
|
46
|
+
const { value } = e.target;
|
|
47
|
+
setQuery(value);
|
|
48
|
+
if (onKeyPressSearch) {
|
|
49
|
+
onKeyPressSearch(value.trim().toLowerCase());
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const handleKeyPress = (event) => {
|
|
53
|
+
if (event.key === "Enter") {
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
if (onKeyPressSearch) {
|
|
56
|
+
onKeyPressSearch(query.trim().toLowerCase());
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const handleSearch = () => {
|
|
61
|
+
if (onKeyPressSearch) {
|
|
62
|
+
onKeyPressSearch(query.trim().toLowerCase());
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const clearSearch = () => {
|
|
66
|
+
setQuery("");
|
|
67
|
+
if (onChangeSearch) {
|
|
68
|
+
const event = { target: { value: "" } };
|
|
69
|
+
onChangeSearch(event);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return /* @__PURE__ */ jsxs(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: `flex items-center w-full border border-gray-300 rounded-lg`,
|
|
76
|
+
children: [
|
|
77
|
+
addonBefore && /* @__PURE__ */ jsx("div", { className: "flex items-center px-2 ", children: addonBefore }),
|
|
78
|
+
/* @__PURE__ */ jsxs("div", { className: `relative flex-grow`, children: [
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
Input,
|
|
81
|
+
{
|
|
82
|
+
...restProps,
|
|
83
|
+
ref,
|
|
84
|
+
type: "text",
|
|
85
|
+
placeholder,
|
|
86
|
+
value: query,
|
|
87
|
+
onChange: handleSearchChange,
|
|
88
|
+
onKeyDown: handleKeyPress,
|
|
89
|
+
variant,
|
|
90
|
+
size,
|
|
91
|
+
disabled: disabled || loading,
|
|
92
|
+
className: cn(
|
|
93
|
+
`text-[#262626] placeholder:text-[#C5C0BF] focus:border-transparent focus:shadow-brand-blue`,
|
|
94
|
+
{
|
|
95
|
+
"pl-14 pr-10": side === "left" && pressButton,
|
|
96
|
+
"pl-12 pr-10": side === "left" && !pressButton,
|
|
97
|
+
"pr-16": side === "right" && !pressButton,
|
|
98
|
+
"pr-20": side === "right" && pressButton
|
|
99
|
+
},
|
|
100
|
+
className
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
allowClear && query.length > 0 && !loading && /* @__PURE__ */ jsx(
|
|
105
|
+
"span",
|
|
106
|
+
{
|
|
107
|
+
className: cn(
|
|
108
|
+
"absolute flex items-center justify-center top-1/2 transform -translate-y-1/2 h-full",
|
|
109
|
+
{
|
|
110
|
+
"right-10": side === "right" && !pressButton,
|
|
111
|
+
"right-14": side === "right" && pressButton,
|
|
112
|
+
"right-4": side === "left"
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
onClick: clearSearch,
|
|
116
|
+
style: { zIndex: 2 },
|
|
117
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ jsx(
|
|
121
|
+
"span",
|
|
122
|
+
{
|
|
123
|
+
className: cn(
|
|
124
|
+
`absolute flex items-center justify-center top-1/2 transform -translate-y-1/2 h-full px-3 ${pressButton && `${side === "left" ? variantButtonClasses["rounded-right"] : variantButtonClasses["rounded-left"]}`}`,
|
|
125
|
+
{
|
|
126
|
+
"left-0": side === "left",
|
|
127
|
+
"right-0": side === "right" && !loading,
|
|
128
|
+
"cursor-pointer": pressButton,
|
|
129
|
+
"cursor-default": !pressButton
|
|
130
|
+
},
|
|
131
|
+
pressButton && classNameIcon
|
|
132
|
+
),
|
|
133
|
+
children: loading ? /* @__PURE__ */ jsx(Loader, { className: "animate-spin h-5 w-5" }) : typeof pressButton !== "boolean" ? /* @__PURE__ */ jsx("span", { className: "truncate", style: { maxWidth: "15ch" }, children: pressButton }) : /* @__PURE__ */ jsx(
|
|
134
|
+
Search,
|
|
135
|
+
{
|
|
136
|
+
onClick: handleSearch,
|
|
137
|
+
style: { color: pressButton && iconFill ? iconFill : void 0 },
|
|
138
|
+
className: "h-5 w-5 text-gray-scale48"
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
] }),
|
|
144
|
+
addonAfter && /* @__PURE__ */ jsx("div", { className: "flex items-center px-2", children: addonAfter })
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
});
|
|
149
|
+
SearchBar.displayName = "SearchBar";
|
|
150
|
+
|
|
151
|
+
export { SearchBar };
|