tw-react-components 0.0.185 → 0.0.190
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 -6
- package/index.css +2 -2
- package/index.esm.js +460 -484
- package/package.json +3 -3
- package/src/components/Accordion/index.d.ts +19 -0
- package/src/components/Form/controls/primitive/BasicInput.d.ts +0 -1
- package/src/components/Form/controls/with-form.d.ts +1 -0
- package/src/components/Spinner/index.d.ts +1 -0
- package/src/components/index.d.ts +1 -0
- package/src/components/types.d.ts +1 -1
- /package/{index.esm.d.ts → index.d.ts} +0 -0
package/index.esm.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
|
+
import { ChevronDownIcon, HelpCircle, XIcon, AtSignIcon, EyeIcon, EyeOffIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CalendarIcon, ClockIcon, CheckIcon, CircleIcon, CloudUploadIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsDownUpIcon, ChevronsUpDownIcon, ArrowUpDownIcon, SortAscIcon, SortDescIcon, MinusIcon, PlusIcon, PanelLeft, GripVertical, MoonIcon, SunIcon, MonitorIcon, X } from 'lucide-react';
|
|
2
4
|
import { clsx } from 'clsx';
|
|
3
5
|
import { twMerge } from 'tailwind-merge';
|
|
4
6
|
import dayjs from 'dayjs';
|
|
5
7
|
import 'dayjs/locale/en.js';
|
|
6
8
|
import advancedFormat from 'dayjs/plugin/advancedFormat.js';
|
|
7
9
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
8
|
-
import { HelpCircle, XIcon, AtSignIcon, EyeIcon, EyeOffIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronDownIcon, CalendarIcon, ClockIcon, CheckIcon, CircleIcon, CloudUploadIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsDownUpIcon, ChevronsUpDownIcon, ArrowUpDownIcon, SortAscIcon, SortDescIcon, MinusIcon, PlusIcon, PanelLeft, GripVertical, MoonIcon, SunIcon, MonitorIcon, X } from 'lucide-react';
|
|
9
10
|
import { useMemo, useState, useEffect, useId, useCallback, useRef, createContext, useContext } from 'react';
|
|
10
11
|
import localeData from 'dayjs/plugin/localeData.js';
|
|
11
12
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
@@ -143,471 +144,432 @@ function resolveTargetObject(payload, fieldChain, defaultValue) {
|
|
|
143
144
|
return resolveTargetObject(payload[key], rest, defaultValue);
|
|
144
145
|
}
|
|
145
146
|
|
|
146
|
-
const
|
|
147
|
-
var {
|
|
148
|
-
return (jsx(
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
const directionClasses = {
|
|
152
|
-
row: {
|
|
153
|
-
normal: 'flex-row',
|
|
154
|
-
reverse: 'flex-row-reverse',
|
|
155
|
-
},
|
|
156
|
-
column: {
|
|
157
|
-
normal: 'flex-col',
|
|
158
|
-
reverse: 'flex-col-reverse',
|
|
159
|
-
},
|
|
147
|
+
const $Accordion = (_a) => {
|
|
148
|
+
var { dataTestId = 'accordion' } = _a, props = __rest(_a, ["dataTestId"]);
|
|
149
|
+
return (jsx(AccordionPrimitive.Root, Object.assign({ "data-testid": dataTestId, "data-slot": "accordion" }, props)));
|
|
160
150
|
};
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
end: 'items-end',
|
|
151
|
+
const AccordionItem = (_a) => {
|
|
152
|
+
var { className, dataTestId = 'accordion-item' } = _a, props = __rest(_a, ["className", "dataTestId"]);
|
|
153
|
+
return (jsx(AccordionPrimitive.Item, Object.assign({ className: cn('border-b last:border-b-0', className), "data-slot": "accordion-item", "data-testid": dataTestId }, props)));
|
|
165
154
|
};
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
between: 'justify-between',
|
|
170
|
-
end: 'justify-end',
|
|
155
|
+
const AccordionTrigger = (_a) => {
|
|
156
|
+
var { className, children, dataTestId = 'accordion-trigger' } = _a, props = __rest(_a, ["className", "children", "dataTestId"]);
|
|
157
|
+
return (jsx(AccordionPrimitive.Header, { className: "flex", children: jsxs(AccordionPrimitive.Trigger, Object.assign({ className: cn('focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 cursor-pointer items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180', className), "data-slot": "accordion-trigger", "data-testid": dataTestId }, props, { children: [children, jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })] })) }));
|
|
171
158
|
};
|
|
172
|
-
const
|
|
173
|
-
var {
|
|
174
|
-
return (jsx(
|
|
159
|
+
const AccordionContent = (_a) => {
|
|
160
|
+
var { className, children, dataTestId = 'accordion-content' } = _a, props = __rest(_a, ["className", "children", "dataTestId"]);
|
|
161
|
+
return (jsx(AccordionPrimitive.Content, Object.assign({ className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm", "data-slot": "accordion-content", "data-testid": dataTestId }, props, { children: jsx("div", { className: cn('pt-0 pb-4', className), children: children }) })));
|
|
175
162
|
};
|
|
163
|
+
const Accordion = Object.assign($Accordion, {
|
|
164
|
+
Item: AccordionItem,
|
|
165
|
+
Trigger: AccordionTrigger,
|
|
166
|
+
Content: AccordionContent,
|
|
167
|
+
});
|
|
176
168
|
|
|
177
|
-
const Spinner = ({ className, fullScreen, dataTestId = 'spinner' }) => (jsx("div", { className: cn('flex w-full items-center justify-center bg-white dark:bg-slate-900', {
|
|
169
|
+
const Spinner = ({ className, spinnerClassName, fullScreen, dataTestId = 'spinner', }) => (jsx("div", { className: cn('flex w-full items-center justify-center bg-white dark:bg-slate-900', {
|
|
178
170
|
'h-screen': fullScreen,
|
|
179
171
|
'h-full': !fullScreen,
|
|
180
|
-
}, className), "data-testid": dataTestId, children: jsxs("svg", { className:
|
|
172
|
+
}, className), "data-testid": dataTestId, children: jsxs("svg", { className: cn('h-8 w-8 animate-spin text-black dark:text-white', spinnerClassName), fill: "none", viewBox: "0 0 24 24", children: [jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }) }));
|
|
181
173
|
|
|
182
174
|
const variantClassNames = {
|
|
183
175
|
filled: {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
176
|
+
base: 'shadow-xs',
|
|
177
|
+
colors: {
|
|
178
|
+
primary: {
|
|
179
|
+
base: 'bg-primary text-primary-foreground',
|
|
180
|
+
hover: 'hover:bg-primary/90',
|
|
181
|
+
focus: 'focus:bg-primary/90',
|
|
182
|
+
active: 'active:bg-primary/90',
|
|
183
|
+
},
|
|
184
|
+
secondary: {
|
|
185
|
+
base: 'bg-secondary text-secondary-foreground',
|
|
186
|
+
hover: 'hover:bg-secondary/80',
|
|
187
|
+
focus: 'focus:bg-secondary/80',
|
|
188
|
+
active: 'active:bg-secondary/80',
|
|
189
|
+
},
|
|
190
|
+
slate: {
|
|
191
|
+
base: 'bg-slate-100 dark:bg-slate-900/70',
|
|
192
|
+
hover: 'hover:bg-slate-200 dark:hover:bg-slate-700',
|
|
193
|
+
focus: 'focus:bg-slate-200 dark:focus:bg-slate-700',
|
|
194
|
+
active: 'active:bg-slate-300 dark:active:bg-slate-800/50',
|
|
195
|
+
},
|
|
196
|
+
gray: {
|
|
197
|
+
base: 'text-white bg-gray-500 dark:bg-gray-600',
|
|
198
|
+
hover: 'hover:bg-gray-400 dark:hover:bg-gray-500',
|
|
199
|
+
focus: 'focus:bg-gray-400 dark:focus:bg-gray-500',
|
|
200
|
+
active: 'active:bg-gray-600 dark:active:bg-gray-700',
|
|
201
|
+
},
|
|
202
|
+
zinc: {
|
|
203
|
+
base: 'text-white bg-zinc-500 dark:bg-zinc-600',
|
|
204
|
+
hover: 'hover:bg-zinc-400 dark:hover:bg-zinc-500',
|
|
205
|
+
focus: 'focus:bg-zinc-400 dark:focus:bg-zinc-500',
|
|
206
|
+
active: 'active:bg-zinc-600 dark:active:bg-zinc-700',
|
|
207
|
+
},
|
|
208
|
+
neutral: {
|
|
209
|
+
base: 'text-white bg-neutral-500 dark:bg-neutral-600',
|
|
210
|
+
hover: 'hover:bg-neutral-400 dark:hover:bg-neutral-500',
|
|
211
|
+
focus: 'focus:bg-neutral-400 dark:focus:bg-neutral-500',
|
|
212
|
+
active: 'active:bg-neutral-600 dark:active:bg-neutral-700',
|
|
213
|
+
},
|
|
214
|
+
stone: {
|
|
215
|
+
base: 'text-white bg-stone-500 dark:bg-stone-600',
|
|
216
|
+
hover: 'hover:bg-stone-400 dark:hover:bg-stone-500',
|
|
217
|
+
focus: 'focus:bg-stone-400 dark:focus:bg-stone-500',
|
|
218
|
+
active: 'active:bg-stone-600 dark:active:bg-stone-700',
|
|
219
|
+
},
|
|
220
|
+
red: {
|
|
221
|
+
base: 'text-white bg-red-500 dark:bg-red-600',
|
|
222
|
+
hover: 'hover:bg-red-400 dark:hover:bg-red-500',
|
|
223
|
+
focus: 'focus:bg-red-400 dark:focus:bg-red-500',
|
|
224
|
+
active: 'active:bg-red-600 dark:active:bg-red-700',
|
|
225
|
+
},
|
|
226
|
+
orange: {
|
|
227
|
+
base: 'text-white bg-orange-500 dark:bg-orange-600',
|
|
228
|
+
hover: 'hover:bg-orange-400 dark:hover:bg-orange-500',
|
|
229
|
+
focus: 'focus:bg-orange-400 dark:focus:bg-orange-500',
|
|
230
|
+
active: 'active:bg-orange-600 dark:active:bg-orange-700',
|
|
231
|
+
},
|
|
232
|
+
amber: {
|
|
233
|
+
base: 'text-white bg-amber-500 dark:bg-amber-600',
|
|
234
|
+
hover: 'hover:bg-amber-400 dark:hover:bg-amber-500',
|
|
235
|
+
focus: 'focus:bg-amber-400 dark:focus:bg-amber-500',
|
|
236
|
+
active: 'active:bg-amber-600 dark:active:bg-amber-700',
|
|
237
|
+
},
|
|
238
|
+
yellow: {
|
|
239
|
+
base: 'text-white bg-yellow-500 dark:bg-yellow-600',
|
|
240
|
+
hover: 'hover:bg-yellow-400 dark:hover:bg-yellow-500',
|
|
241
|
+
focus: 'focus:bg-yellow-400 dark:focus:bg-yellow-500',
|
|
242
|
+
active: 'active:bg-yellow-600 dark:active:bg-yellow-700',
|
|
243
|
+
},
|
|
244
|
+
lime: {
|
|
245
|
+
base: 'text-white bg-lime-500 dark:bg-lime-600',
|
|
246
|
+
hover: 'hover:bg-lime-400 dark:hover:bg-lime-500',
|
|
247
|
+
focus: 'focus:bg-lime-400 dark:focus:bg-lime-500',
|
|
248
|
+
active: 'active:bg-lime-600 dark:active:bg-lime-700',
|
|
249
|
+
},
|
|
250
|
+
green: {
|
|
251
|
+
base: 'text-white bg-green-500 dark:bg-green-600',
|
|
252
|
+
hover: 'hover:bg-green-400 dark:hover:bg-green-500',
|
|
253
|
+
focus: 'focus:bg-green-400 dark:focus:bg-green-500',
|
|
254
|
+
active: 'active:bg-green-600 dark:active:bg-green-700',
|
|
255
|
+
},
|
|
256
|
+
emerald: {
|
|
257
|
+
base: 'text-white bg-emerald-500 dark:bg-emerald-600',
|
|
258
|
+
hover: 'hover:bg-emerald-400 dark:hover:bg-emerald-500',
|
|
259
|
+
focus: 'focus:bg-emerald-400 dark:focus:bg-emerald-500',
|
|
260
|
+
active: 'active:bg-emerald-600 dark:active:bg-emerald-700',
|
|
261
|
+
},
|
|
262
|
+
teal: {
|
|
263
|
+
base: 'text-white bg-teal-500 dark:bg-teal-600',
|
|
264
|
+
hover: 'hover:bg-teal-400 dark:hover:bg-teal-500',
|
|
265
|
+
focus: 'focus:bg-teal-400 dark:focus:bg-teal-500',
|
|
266
|
+
active: 'active:bg-teal-600 dark:active:bg-teal-700',
|
|
267
|
+
},
|
|
268
|
+
cyan: {
|
|
269
|
+
base: 'text-white bg-cyan-500 dark:bg-cyan-600',
|
|
270
|
+
hover: 'hover:bg-cyan-400 dark:hover:bg-cyan-500',
|
|
271
|
+
focus: 'focus:bg-cyan-400 dark:focus:bg-cyan-500',
|
|
272
|
+
active: 'active:bg-cyan-600 dark:active:bg-cyan-700',
|
|
273
|
+
},
|
|
274
|
+
sky: {
|
|
275
|
+
base: 'text-white bg-sky-500 dark:bg-sky-600',
|
|
276
|
+
hover: 'hover:bg-sky-400 dark:hover:bg-sky-500',
|
|
277
|
+
focus: 'focus:bg-sky-400 dark:focus:bg-sky-500',
|
|
278
|
+
active: 'active:bg-sky-600 dark:active:bg-sky-700',
|
|
279
|
+
},
|
|
280
|
+
blue: {
|
|
281
|
+
base: 'text-white bg-blue-500 dark:bg-blue-600',
|
|
282
|
+
hover: 'hover:bg-blue-400 dark:hover:bg-blue-500',
|
|
283
|
+
focus: 'focus:bg-blue-400 dark:focus:bg-blue-500',
|
|
284
|
+
active: 'active:bg-blue-600 dark:active:bg-blue-700',
|
|
285
|
+
},
|
|
286
|
+
indigo: {
|
|
287
|
+
base: 'text-white bg-indigo-500 dark:bg-indigo-600',
|
|
288
|
+
hover: 'hover:bg-indigo-400 dark:hover:bg-indigo-500',
|
|
289
|
+
focus: 'focus:bg-indigo-400 dark:focus:bg-indigo-500',
|
|
290
|
+
active: 'active:bg-indigo-600 dark:active:bg-indigo-700',
|
|
291
|
+
},
|
|
292
|
+
violet: {
|
|
293
|
+
base: 'text-white bg-violet-500 dark:bg-violet-600',
|
|
294
|
+
hover: 'hover:bg-violet-400 dark:hover:bg-violet-500',
|
|
295
|
+
focus: 'focus:bg-violet-400 dark:focus:bg-violet-500',
|
|
296
|
+
active: 'active:bg-violet-600 dark:active:bg-violet-700',
|
|
297
|
+
},
|
|
298
|
+
fuchsia: {
|
|
299
|
+
base: 'text-white bg-fuchsia-500 dark:bg-fuchsia-600',
|
|
300
|
+
hover: 'hover:bg-fuchsia-400 dark:hover:bg-fuchsia-500',
|
|
301
|
+
focus: 'focus:bg-fuchsia-400 dark:focus:bg-fuchsia-500',
|
|
302
|
+
active: 'active:bg-fuchsia-600 dark:active:bg-fuchsia-700',
|
|
303
|
+
},
|
|
304
|
+
purple: {
|
|
305
|
+
base: 'text-white bg-purple-500 dark:bg-purple-600',
|
|
306
|
+
hover: 'hover:bg-purple-400 dark:hover:bg-purple-500',
|
|
307
|
+
focus: 'focus:bg-purple-400 dark:focus:bg-purple-500',
|
|
308
|
+
active: 'active:bg-purple-600 dark:active:bg-purple-700',
|
|
309
|
+
},
|
|
310
|
+
pink: {
|
|
311
|
+
base: 'text-white bg-pink-500 dark:bg-pink-600',
|
|
312
|
+
hover: 'hover:bg-pink-400 dark:hover:bg-pink-500',
|
|
313
|
+
focus: 'focus:bg-pink-400 dark:focus:bg-pink-500',
|
|
314
|
+
active: 'active:bg-pink-600 dark:active:bg-pink-700',
|
|
315
|
+
},
|
|
316
|
+
rose: {
|
|
317
|
+
base: 'text-white bg-rose-500 dark:bg-rose-600',
|
|
318
|
+
hover: 'hover:bg-rose-400 dark:hover:bg-rose-500',
|
|
319
|
+
focus: 'focus:bg-rose-400 dark:focus:bg-rose-500',
|
|
320
|
+
active: 'active:bg-rose-600 dark:active:bg-rose-700',
|
|
321
|
+
},
|
|
315
322
|
},
|
|
316
323
|
},
|
|
317
324
|
outlined: {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
325
|
+
base: 'border bg-background shadow-xs dark:bg-input/30 dark:hover:bg-input/50',
|
|
326
|
+
colors: {
|
|
327
|
+
primary: {
|
|
328
|
+
base: 'border-primary dark:text-accent-foreground',
|
|
329
|
+
hover: 'hover:bg-primary/90 hover:text-primary-foreground',
|
|
330
|
+
focus: 'focus:bg-primary/90 focus:text-primary-foreground',
|
|
331
|
+
active: 'active:bg-primary/90 active:text-primary-foreground',
|
|
332
|
+
},
|
|
333
|
+
secondary: {
|
|
334
|
+
base: 'border-secondary text-secondary-foreground',
|
|
335
|
+
hover: 'hover:bg-secondary/80',
|
|
336
|
+
focus: 'focus:bg-secondary/80',
|
|
337
|
+
active: 'active:bg-secondary/80',
|
|
338
|
+
},
|
|
339
|
+
slate: {
|
|
340
|
+
base: 'dark:border-slate-600',
|
|
341
|
+
hover: 'hover:bg-slate-200 dark:hover:bg-slate-600',
|
|
342
|
+
focus: 'focus:bg-slate-200 dark:focus:bg-slate-600',
|
|
343
|
+
active: 'active:bg-slate-300 active:border-slate-300 dark:active:bg-slate-700 dark:active:border-slate-700',
|
|
344
|
+
},
|
|
345
|
+
gray: {
|
|
346
|
+
base: 'border-gray-500 text-gray-600 dark:border-gray-600 dark:text-gray-500',
|
|
347
|
+
hover: 'hover:text-white hover:bg-gray-500 dark:hover:text-white dark:hover:bg-gray-600',
|
|
348
|
+
focus: 'focus:text-white focus:bg-gray-500 dark:focus:text-white dark:focus:bg-gray-600',
|
|
349
|
+
active: 'active:bg-gray-600 active:border-gray-600 dark:active:bg-gray-700 dark:active:border-gray-700',
|
|
350
|
+
},
|
|
351
|
+
zinc: {
|
|
352
|
+
base: 'border-zinc-500 text-zinc-600 dark:border-zinc-600 dark:text-zinc-500',
|
|
353
|
+
hover: 'hover:text-white hover:bg-zinc-500 dark:hover:text-white dark:hover:bg-zinc-600',
|
|
354
|
+
focus: 'focus:text-white focus:bg-zinc-500 dark:focus:text-white dark:focus:bg-zinc-600',
|
|
355
|
+
active: 'active:bg-zinc-600 active:border-zinc-600 dark:active:bg-zinc-700 dark:active:border-zinc-700',
|
|
356
|
+
},
|
|
357
|
+
neutral: {
|
|
358
|
+
base: 'border-neutral-500 text-neutral-600 dark:border-neutral-600 dark:text-neutral-500',
|
|
359
|
+
hover: 'hover:text-white hover:bg-neutral-500 dark:hover:text-white dark:hover:bg-neutral-600',
|
|
360
|
+
focus: 'focus:text-white focus:bg-neutral-500 dark:focus:text-white dark:focus:bg-neutral-600',
|
|
361
|
+
active: 'active:bg-neutral-600 active:border-neutral-600 dark:active:bg-neutral-700 dark:active:border-neutral-700',
|
|
362
|
+
},
|
|
363
|
+
stone: {
|
|
364
|
+
base: 'border-stone-500 text-stone-600 dark:border-stone-600 dark:text-stone-500',
|
|
365
|
+
hover: 'hover:text-white hover:bg-stone-500 dark:hover:text-white dark:hover:bg-stone-600',
|
|
366
|
+
focus: 'focus:text-white focus:bg-stone-500 dark:focus:text-white dark:focus:bg-stone-600',
|
|
367
|
+
active: 'active:bg-stone-600 active:border-stone-600 dark:active:bg-stone-700 dark:active:border-stone-700',
|
|
368
|
+
},
|
|
369
|
+
red: {
|
|
370
|
+
base: 'border-red-500 text-red-600 dark:border-red-600 dark:text-red-500',
|
|
371
|
+
hover: 'hover:text-white hover:bg-red-500 dark:hover:text-white dark:hover:bg-red-600',
|
|
372
|
+
focus: 'focus:text-white focus:bg-red-500 dark:focus:text-white dark:focus:bg-red-600',
|
|
373
|
+
active: 'active:bg-red-600 active:border-red-600 dark:active:bg-red-700 dark:active:border-red-700',
|
|
374
|
+
},
|
|
375
|
+
orange: {
|
|
376
|
+
base: 'border-orange-500 text-orange-600 dark:border-orange-600 dark:text-orange-500',
|
|
377
|
+
hover: 'hover:text-white hover:bg-orange-500 dark:hover:text-white dark:hover:bg-orange-600',
|
|
378
|
+
focus: 'focus:text-white focus:bg-orange-500 dark:focus:text-white dark:focus:bg-orange-600',
|
|
379
|
+
active: 'active:bg-orange-600 active:border-orange-600 dark:active:bg-orange-700 dark:active:border-orange-700',
|
|
380
|
+
},
|
|
381
|
+
amber: {
|
|
382
|
+
base: 'border-amber-500 text-amber-600 dark:border-amber-600 dark:text-amber-500',
|
|
383
|
+
hover: 'hover:text-white hover:bg-amber-500 dark:hover:text-white dark:hover:bg-amber-600',
|
|
384
|
+
focus: 'focus:text-white focus:bg-amber-500 dark:focus:text-white dark:focus:bg-amber-600',
|
|
385
|
+
active: 'active:bg-amber-600 active:border-amber-600 dark:active:bg-amber-700 dark:active:border-amber-700',
|
|
386
|
+
},
|
|
387
|
+
yellow: {
|
|
388
|
+
base: 'border-yellow-500 text-yellow-600 dark:border-yellow-600 dark:text-yellow-500',
|
|
389
|
+
hover: 'hover:text-white hover:bg-yellow-500 dark:hover:text-white dark:hover:bg-yellow-600',
|
|
390
|
+
focus: 'focus:text-white focus:bg-yellow-500 dark:focus:text-white dark:focus:bg-yellow-600',
|
|
391
|
+
active: 'active:bg-yellow-600 active:border-yellow-600 dark:active:bg-yellow-700 dark:active:border-yellow-700',
|
|
392
|
+
},
|
|
393
|
+
lime: {
|
|
394
|
+
base: 'border-lime-500 text-lime-600 dark:border-lime-600 dark:text-lime-500',
|
|
395
|
+
hover: 'hover:text-white hover:bg-lime-500 dark:hover:text-white dark:hover:bg-lime-600',
|
|
396
|
+
focus: 'focus:text-white focus:bg-lime-500 dark:focus:text-white dark:focus:bg-lime-600',
|
|
397
|
+
active: 'active:bg-lime-600 active:border-lime-600 dark:active:bg-lime-700 dark:active:border-lime-700',
|
|
398
|
+
},
|
|
399
|
+
green: {
|
|
400
|
+
base: 'border-green-500 text-green-600 dark:border-green-600 dark:text-green-500',
|
|
401
|
+
hover: 'hover:text-white hover:bg-green-500 dark:hover:text-white dark:hover:bg-green-600',
|
|
402
|
+
focus: 'focus:text-white focus:bg-green-500 dark:focus:text-white dark:focus:bg-green-600',
|
|
403
|
+
active: 'active:bg-green-600 active:border-green-600 dark:active:bg-green-700 dark:active:border-green-700',
|
|
404
|
+
},
|
|
405
|
+
emerald: {
|
|
406
|
+
base: 'border-emerald-500 text-emerald-600 dark:border-emerald-600 dark:text-emerald-500',
|
|
407
|
+
hover: 'hover:text-white hover:bg-emerald-500 dark:hover:text-white dark:hover:bg-emerald-600',
|
|
408
|
+
focus: 'focus:text-white focus:bg-emerald-500 dark:focus:text-white dark:focus:bg-emerald-600',
|
|
409
|
+
active: 'active:bg-emerald-600 active:border-emerald-600 dark:active:bg-emerald-700 dark:active:border-emerald-700',
|
|
410
|
+
},
|
|
411
|
+
teal: {
|
|
412
|
+
base: 'border-teal-500 text-teal-600 dark:border-teal-600 dark:text-teal-500',
|
|
413
|
+
hover: 'hover:text-white hover:bg-teal-500 dark:hover:text-white dark:hover:bg-teal-600',
|
|
414
|
+
focus: 'focus:text-white focus:bg-teal-500 dark:focus:text-white dark:focus:bg-teal-600',
|
|
415
|
+
active: 'active:bg-teal-600 active:border-teal-600 dark:active:bg-teal-700 dark:active:border-teal-700',
|
|
416
|
+
},
|
|
417
|
+
cyan: {
|
|
418
|
+
base: 'border-cyan-500 text-cyan-600 dark:border-cyan-600 dark:text-cyan-500',
|
|
419
|
+
hover: 'hover:text-white hover:bg-cyan-500 dark:hover:text-white dark:hover:bg-cyan-600',
|
|
420
|
+
focus: 'focus:text-white focus:bg-cyan-500 dark:focus:text-white dark:focus:bg-cyan-600',
|
|
421
|
+
active: 'active:bg-cyan-600 active:border-cyan-600 dark:active:bg-cyan-700 dark:active:border-cyan-700',
|
|
422
|
+
},
|
|
423
|
+
sky: {
|
|
424
|
+
base: 'border-sky-500 text-sky-600 dark:border-sky-600 dark:text-sky-500',
|
|
425
|
+
hover: 'hover:text-white hover:bg-sky-500 dark:hover:text-white dark:hover:bg-sky-600',
|
|
426
|
+
focus: 'focus:text-white focus:bg-sky-500 dark:focus:text-white dark:focus:bg-sky-600',
|
|
427
|
+
active: 'active:bg-sky-600 active:border-sky-600 dark:active:bg-sky-700 dark:active:border-sky-700',
|
|
428
|
+
},
|
|
429
|
+
blue: {
|
|
430
|
+
base: 'border-blue-500 text-blue-600 dark:border-blue-600 dark:text-blue-500',
|
|
431
|
+
hover: 'hover:text-white hover:bg-blue-500 dark:hover:text-white dark:hover:bg-blue-600',
|
|
432
|
+
focus: 'focus:text-white focus:bg-blue-500 dark:focus:text-white dark:focus:bg-blue-600',
|
|
433
|
+
active: 'active:bg-blue-600 active:border-blue-600 dark:active:bg-blue-700 dark:active:border-blue-700',
|
|
434
|
+
},
|
|
435
|
+
indigo: {
|
|
436
|
+
base: 'border-indigo-500 text-indigo-600 dark:border-indigo-600 dark:text-indigo-500',
|
|
437
|
+
hover: 'hover:text-white hover:bg-indigo-500 dark:hover:text-white dark:hover:bg-indigo-600',
|
|
438
|
+
focus: 'focus:text-white focus:bg-indigo-500 dark:focus:text-white dark:focus:bg-indigo-600',
|
|
439
|
+
active: 'active:bg-indigo-600 active:border-indigo-600 dark:active:bg-indigo-700 dark:active:border-indigo-700',
|
|
440
|
+
},
|
|
441
|
+
violet: {
|
|
442
|
+
base: 'border-violet-500 text-violet-600 dark:border-violet-600 dark:text-violet-500',
|
|
443
|
+
hover: 'hover:text-white hover:bg-violet-500 dark:hover:text-white dark:hover:bg-violet-600',
|
|
444
|
+
focus: 'focus:text-white focus:bg-violet-500 dark:focus:text-white dark:focus:bg-violet-600',
|
|
445
|
+
active: 'active:bg-violet-600 active:border-violet-600 dark:active:bg-violet-700 dark:active:border-violet-700',
|
|
446
|
+
},
|
|
447
|
+
fuchsia: {
|
|
448
|
+
base: 'border-fuchsia-500 text-fuchsia-600 dark:border-fuchsia-600 dark:text-fuchsia-500',
|
|
449
|
+
hover: 'hover:text-white hover:bg-fuchsia-500 dark:hover:text-white dark:hover:bg-fuchsia-600',
|
|
450
|
+
focus: 'focus:text-white focus:bg-fuchsia-500 dark:focus:text-white dark:focus:bg-fuchsia-600',
|
|
451
|
+
active: 'active:bg-fuchsia-600 active:border-fuchsia-600 dark:active:bg-fuchsia-700 dark:active:border-fuchsia-700',
|
|
452
|
+
},
|
|
453
|
+
purple: {
|
|
454
|
+
base: 'border-purple-500 text-purple-600 dark:border-purple-600 dark:text-purple-500',
|
|
455
|
+
hover: 'hover:text-white hover:bg-purple-500 dark:hover:text-white dark:hover:bg-purple-600',
|
|
456
|
+
focus: 'focus:text-white focus:bg-purple-500 dark:focus:text-white dark:focus:bg-purple-600',
|
|
457
|
+
active: 'active:bg-purple-600 active:border-purple-600 dark:active:bg-purple-700 dark:active:border-purple-700',
|
|
458
|
+
},
|
|
459
|
+
pink: {
|
|
460
|
+
base: 'border-pink-500 text-pink-600 dark:border-pink-600 dark:text-pink-500',
|
|
461
|
+
hover: 'hover:text-white hover:bg-pink-500 dark:hover:text-white dark:hover:bg-pink-600',
|
|
462
|
+
focus: 'focus:text-white focus:bg-pink-500 dark:focus:text-white dark:focus:bg-pink-600',
|
|
463
|
+
active: 'active:bg-pink-600 active:border-pink-600 dark:active:bg-pink-700 dark:active:border-pink-700',
|
|
464
|
+
},
|
|
465
|
+
rose: {
|
|
466
|
+
base: 'border-rose-500 text-rose-600 dark:border-rose-600 dark:text-rose-500',
|
|
467
|
+
hover: 'hover:text-white hover:bg-rose-500 dark:hover:text-white dark:hover:bg-rose-600',
|
|
468
|
+
focus: 'focus:text-white focus:bg-rose-500 dark:focus:text-white dark:focus:bg-rose-600',
|
|
469
|
+
active: 'active:bg-rose-600 active:border-rose-600 dark:active:bg-rose-700 dark:active:border-rose-700',
|
|
470
|
+
},
|
|
449
471
|
},
|
|
450
472
|
},
|
|
451
473
|
text: {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
hover: 'hover:text-white hover:bg-teal-500 dark:hover:bg-teal-600',
|
|
527
|
-
focus: 'focus:text-white focus:bg-teal-500 dark:focus:bg-teal-600',
|
|
528
|
-
active: 'active:bg-teal-600 dark:active:bg-teal-700',
|
|
529
|
-
},
|
|
530
|
-
cyan: {
|
|
531
|
-
base: 'bg-transparent',
|
|
532
|
-
hover: 'hover:text-white hover:bg-cyan-500 dark:hover:bg-cyan-600',
|
|
533
|
-
focus: 'focus:text-white focus:bg-cyan-500 dark:focus:bg-cyan-600',
|
|
534
|
-
active: 'active:bg-cyan-600 dark:active:bg-cyan-700',
|
|
535
|
-
},
|
|
536
|
-
sky: {
|
|
537
|
-
base: 'bg-transparent',
|
|
538
|
-
hover: 'hover:text-white hover:bg-sky-500 dark:hover:bg-sky-600',
|
|
539
|
-
focus: 'focus:text-white focus:bg-sky-500 dark:focus:bg-sky-600',
|
|
540
|
-
active: 'active:bg-sky-600 dark:active:bg-sky-700',
|
|
541
|
-
},
|
|
542
|
-
blue: {
|
|
543
|
-
base: 'bg-transparent',
|
|
544
|
-
hover: 'hover:text-white hover:bg-blue-500 dark:hover:bg-blue-600',
|
|
545
|
-
focus: 'focus:text-white focus:bg-blue-500 dark:focus:bg-blue-600',
|
|
546
|
-
active: 'active:bg-blue-600 dark:active:bg-blue-700',
|
|
547
|
-
},
|
|
548
|
-
indigo: {
|
|
549
|
-
base: 'bg-transparent',
|
|
550
|
-
hover: 'hover:text-white hover:bg-indigo-500 dark:hover:bg-indigo-600',
|
|
551
|
-
focus: 'focus:text-white focus:bg-indigo-500 dark:focus:bg-indigo-600',
|
|
552
|
-
active: 'active:bg-indigo-600 dark:active:bg-indigo-700',
|
|
553
|
-
},
|
|
554
|
-
violet: {
|
|
555
|
-
base: 'bg-transparent',
|
|
556
|
-
hover: 'hover:text-white hover:bg-violet-500 dark:hover:bg-violet-600',
|
|
557
|
-
focus: 'focus:text-white focus:bg-violet-500 dark:focus:bg-violet-600',
|
|
558
|
-
active: 'active:bg-violet-600 dark:active:bg-violet-700',
|
|
559
|
-
},
|
|
560
|
-
fuchsia: {
|
|
561
|
-
base: 'bg-transparent',
|
|
562
|
-
hover: 'hover:text-white hover:bg-fuchsia-500 dark:hover:bg-fuchsia-600',
|
|
563
|
-
focus: 'focus:text-white focus:bg-fuchsia-500 dark:focus:bg-fuchsia-600',
|
|
564
|
-
active: 'active:bg-fuchsia-600 dark:active:bg-fuchsia-700',
|
|
565
|
-
},
|
|
566
|
-
purple: {
|
|
567
|
-
base: 'bg-transparent',
|
|
568
|
-
hover: 'hover:text-white hover:bg-purple-500 dark:hover:bg-purple-600',
|
|
569
|
-
focus: 'focus:text-white focus:bg-purple-500 dark:focus:bg-purple-600',
|
|
570
|
-
active: 'active:bg-purple-600 dark:active:bg-purple-700',
|
|
571
|
-
},
|
|
572
|
-
pink: {
|
|
573
|
-
base: 'bg-transparent',
|
|
574
|
-
hover: 'hover:text-white hover:bg-pink-500 dark:hover:bg-pink-600',
|
|
575
|
-
focus: 'focus:text-white focus:bg-pink-500 dark:focus:bg-pink-600',
|
|
576
|
-
active: 'active:bg-pink-600 dark:active:bg-pink-700',
|
|
577
|
-
},
|
|
578
|
-
rose: {
|
|
579
|
-
base: 'bg-transparent',
|
|
580
|
-
hover: 'hover:text-white hover:bg-rose-500 dark:hover:bg-rose-600',
|
|
581
|
-
focus: 'focus:text-white focus:bg-rose-500 dark:focus:bg-rose-600',
|
|
582
|
-
active: 'active:bg-rose-600 dark:active:bg-rose-700',
|
|
474
|
+
base: 'bg-transparent underline-offset-4 hover:underline',
|
|
475
|
+
colors: {
|
|
476
|
+
primary: {
|
|
477
|
+
base: 'dark:text-accent-foreground',
|
|
478
|
+
},
|
|
479
|
+
secondary: {
|
|
480
|
+
base: 'text-secondary-foreground',
|
|
481
|
+
},
|
|
482
|
+
slate: {
|
|
483
|
+
base: 'text-slate-600 dark:text-slate-400',
|
|
484
|
+
},
|
|
485
|
+
gray: {
|
|
486
|
+
base: 'text-gray-600 dark:text-gray-400',
|
|
487
|
+
},
|
|
488
|
+
zinc: {
|
|
489
|
+
base: 'text-zinc-600 dark:text-zinc-400',
|
|
490
|
+
},
|
|
491
|
+
neutral: {
|
|
492
|
+
base: 'text-neutral-600 dark:text-neutral-400',
|
|
493
|
+
},
|
|
494
|
+
stone: {
|
|
495
|
+
base: 'text-stone-600 dark:text-stone-400',
|
|
496
|
+
},
|
|
497
|
+
red: {
|
|
498
|
+
base: 'text-red-600 dark:text-red-400',
|
|
499
|
+
},
|
|
500
|
+
orange: {
|
|
501
|
+
base: 'text-orange-600 dark:text-orange-400',
|
|
502
|
+
},
|
|
503
|
+
amber: {
|
|
504
|
+
base: 'text-amber-600 dark:text-amber-400',
|
|
505
|
+
},
|
|
506
|
+
yellow: {
|
|
507
|
+
base: 'text-yellow-600 dark:text-yellow-400',
|
|
508
|
+
},
|
|
509
|
+
lime: {
|
|
510
|
+
base: 'text-lime-600 dark:text-lime-400',
|
|
511
|
+
},
|
|
512
|
+
green: {
|
|
513
|
+
base: 'text-green-600 dark:text-green-400',
|
|
514
|
+
},
|
|
515
|
+
emerald: {
|
|
516
|
+
base: 'text-emerald-600 dark:text-emerald-400',
|
|
517
|
+
},
|
|
518
|
+
teal: {
|
|
519
|
+
base: 'text-teal-600 dark:text-teal-400',
|
|
520
|
+
},
|
|
521
|
+
cyan: {
|
|
522
|
+
base: 'text-cyan-600 dark:text-cyan-400',
|
|
523
|
+
},
|
|
524
|
+
sky: {
|
|
525
|
+
base: 'text-sky-600 dark:text-sky-400',
|
|
526
|
+
},
|
|
527
|
+
blue: {
|
|
528
|
+
base: 'text-blue-600 dark:text-blue-400',
|
|
529
|
+
},
|
|
530
|
+
indigo: {
|
|
531
|
+
base: 'text-indigo-600 dark:text-indigo-400',
|
|
532
|
+
},
|
|
533
|
+
violet: {
|
|
534
|
+
base: 'text-violet-600 dark:text-violet-400',
|
|
535
|
+
},
|
|
536
|
+
fuchsia: {
|
|
537
|
+
base: 'text-fuchsia-600 dark:text-fuchsia-400',
|
|
538
|
+
},
|
|
539
|
+
purple: {
|
|
540
|
+
base: 'text-purple-600 dark:text-purple-400',
|
|
541
|
+
},
|
|
542
|
+
pink: {
|
|
543
|
+
base: 'text-pink-600 dark:text-pink-400',
|
|
544
|
+
},
|
|
545
|
+
rose: {
|
|
546
|
+
base: 'text-rose-600 dark:text-rose-400',
|
|
547
|
+
},
|
|
583
548
|
},
|
|
584
549
|
},
|
|
585
550
|
};
|
|
586
551
|
const sizeClassNames = {
|
|
587
552
|
small: {
|
|
588
|
-
base: 'gap-1 text-
|
|
589
|
-
withChildren: 'px-1
|
|
553
|
+
base: 'gap-1 text-xs h-6',
|
|
554
|
+
withChildren: 'px-2 gap-1',
|
|
590
555
|
icon: {
|
|
591
556
|
base: 'h-3 w-3',
|
|
592
|
-
withChildren: 'h-2 w-2',
|
|
557
|
+
withChildren: 'h-2.5 w-2.5',
|
|
593
558
|
},
|
|
594
559
|
},
|
|
595
560
|
medium: {
|
|
596
|
-
base: 'gap-
|
|
597
|
-
withChildren: 'px-
|
|
561
|
+
base: 'gap-2 text-sm font-medium h-9 py-2',
|
|
562
|
+
withChildren: 'px-4 has-[>svg]:px-3',
|
|
598
563
|
icon: {
|
|
599
|
-
base: 'h-
|
|
600
|
-
withChildren: 'h-
|
|
564
|
+
base: 'h-5 w-5',
|
|
565
|
+
withChildren: 'h-4 w-4',
|
|
601
566
|
},
|
|
602
567
|
},
|
|
603
568
|
};
|
|
604
569
|
const Button = (_a) => {
|
|
605
570
|
var { children, className, size = 'medium', color = 'slate', variant = 'filled', rounded, loading, disabled, prefixIcon: PrefixIcon, suffixIcon: SuffixIcon, unstyled, dataTestId = 'button' } = _a, props = __rest(_a, ["children", "className", "size", "color", "variant", "rounded", "loading", "disabled", "prefixIcon", "suffixIcon", "unstyled", "dataTestId"]);
|
|
606
|
-
return (jsxs("button", Object.assign({ className: cn('
|
|
607
|
-
|
|
608
|
-
: !unstyled
|
|
609
|
-
? `${variantClassNames[variant][color].hover} ${variantClassNames[variant][color].focus} ${variantClassNames[variant][color].active} cursor-pointer`
|
|
610
|
-
: 'cursor-default', children ? `${sizeClassNames[size].withChildren} aspect-[initial]` : 'justify-center', className), "data-testid": dataTestId, type: "button", disabled: disabled || loading }, props, { children: [loading && (jsx(Flex, { className: cn('absolute inset-0', rounded ? 'rounded-full' : 'rounded-md'), align: "center", justify: "center", children: jsx(Spinner, { className: "h-5 w-5 animate-spin bg-transparent dark:bg-transparent", dataTestId: `${dataTestId}-spinner` }) })), PrefixIcon && (jsx(PrefixIcon, { className: children ? sizeClassNames[size].icon.withChildren : sizeClassNames[size].icon.base })), children, SuffixIcon && (jsx(SuffixIcon, { className: children ? sizeClassNames[size].icon.withChildren : sizeClassNames[size].icon.base }))] })));
|
|
571
|
+
return (jsxs("button", Object.assign({ className: cn('inline-flex aspect-square shrink-0 items-center justify-center font-medium whitespace-nowrap transition-all outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0', 'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive focus-visible:ring-[3px]', sizeClassNames[size].base, variantClassNames[variant].base, variantClassNames[variant].colors[color].base, !unstyled &&
|
|
572
|
+
`${variantClassNames[variant].colors[color].hover} ${variantClassNames[variant].colors[color].focus} ${variantClassNames[variant].colors[color].active} cursor-pointer`, unstyled && 'cursor-default', rounded ? 'rounded-full' : 'rounded-md', children ? `${sizeClassNames[size].withChildren} aspect-[initial]` : 'justify-center', className), "data-testid": dataTestId, type: "button", disabled: disabled || loading }, props, { children: [PrefixIcon && !loading && (jsx(PrefixIcon, { className: children ? sizeClassNames[size].icon.withChildren : sizeClassNames[size].icon.base })), loading && (jsx(Spinner, { className: "bg-transparent dark:bg-transparent", spinnerClassName: children ? sizeClassNames[size].icon.withChildren : sizeClassNames[size].icon.base, dataTestId: `${dataTestId}-spinner` })), children, SuffixIcon && !loading && (jsx(SuffixIcon, { className: children ? sizeClassNames[size].icon.withChildren : sizeClassNames[size].icon.base }))] })));
|
|
611
573
|
};
|
|
612
574
|
|
|
613
575
|
const Badge = (_a) => {
|
|
@@ -615,6 +577,11 @@ const Badge = (_a) => {
|
|
|
615
577
|
return (jsx(Button, Object.assign({ size: size, dataTestId: dataTestId }, props)));
|
|
616
578
|
};
|
|
617
579
|
|
|
580
|
+
const Block = (_a) => {
|
|
581
|
+
var { children, className, centered, container, fullWidth, fullHeight, dataTestId = 'block' } = _a, props = __rest(_a, ["children", "className", "centered", "container", "fullWidth", "fullHeight", "dataTestId"]);
|
|
582
|
+
return (jsx("div", Object.assign({ "data-testid": dataTestId, className: cn(centered && 'mx-auto', container && 'container', fullWidth && 'w-full', fullHeight && 'h-full', className) }, props, { children: children })));
|
|
583
|
+
};
|
|
584
|
+
|
|
618
585
|
const Card = (_a) => {
|
|
619
586
|
var { children, className, dataTestId = 'card' } = _a, blockProps = __rest(_a, ["children", "className", "dataTestId"]);
|
|
620
587
|
return (jsx(Block, Object.assign({ className: cn('bg-background rounded-lg border p-2 dark:border-slate-700', className), dataTestId: dataTestId }, blockProps, { children: children })));
|
|
@@ -637,6 +604,32 @@ const Collapsible = Object.assign(CollapsibleRoot, {
|
|
|
637
604
|
Content: CollapsibleContent,
|
|
638
605
|
});
|
|
639
606
|
|
|
607
|
+
const directionClasses = {
|
|
608
|
+
row: {
|
|
609
|
+
normal: 'flex-row',
|
|
610
|
+
reverse: 'flex-row-reverse',
|
|
611
|
+
},
|
|
612
|
+
column: {
|
|
613
|
+
normal: 'flex-col',
|
|
614
|
+
reverse: 'flex-col-reverse',
|
|
615
|
+
},
|
|
616
|
+
};
|
|
617
|
+
const alignClasses = {
|
|
618
|
+
start: 'items-start',
|
|
619
|
+
center: 'items-center',
|
|
620
|
+
end: 'items-end',
|
|
621
|
+
};
|
|
622
|
+
const justifyClasses = {
|
|
623
|
+
start: 'justify-start',
|
|
624
|
+
center: 'justify-center',
|
|
625
|
+
between: 'justify-between',
|
|
626
|
+
end: 'justify-end',
|
|
627
|
+
};
|
|
628
|
+
const Flex = (_a) => {
|
|
629
|
+
var { children, className, reverse, wrap, direction = 'row', align = 'start', justify = 'start', dataTestId = 'flex' } = _a, blockProps = __rest(_a, ["children", "className", "reverse", "wrap", "direction", "align", "justify", "dataTestId"]);
|
|
630
|
+
return (jsx(Block, Object.assign({ className: cn('flex gap-2', wrap && 'flex-wrap', directionClasses[direction][reverse ? 'reverse' : 'normal'], alignClasses[align], justifyClasses[justify], className), dataTestId: dataTestId }, blockProps, { children: children })));
|
|
631
|
+
};
|
|
632
|
+
|
|
640
633
|
dayjs.extend(localeData);
|
|
641
634
|
function useDays(locale = 'en') {
|
|
642
635
|
return useMemo(() => {
|
|
@@ -789,6 +782,12 @@ function usePagination(currentIndex, totalPages) {
|
|
|
789
782
|
|
|
790
783
|
const TOAST_LIMIT = 1;
|
|
791
784
|
const TOAST_REMOVE_DELAY = 5000; // 5 seconds
|
|
785
|
+
const actionTypes = {
|
|
786
|
+
ADD_TOAST: 'ADD_TOAST',
|
|
787
|
+
UPDATE_TOAST: 'UPDATE_TOAST',
|
|
788
|
+
DISMISS_TOAST: 'DISMISS_TOAST',
|
|
789
|
+
REMOVE_TOAST: 'REMOVE_TOAST',
|
|
790
|
+
};
|
|
792
791
|
let count = 0;
|
|
793
792
|
function genId() {
|
|
794
793
|
count = (count + 1) % Number.MAX_SAFE_INTEGER;
|
|
@@ -810,11 +809,11 @@ const addToRemoveQueue = (toastId) => {
|
|
|
810
809
|
};
|
|
811
810
|
const reducer = (state, action) => {
|
|
812
811
|
switch (action.type) {
|
|
813
|
-
case
|
|
812
|
+
case actionTypes.ADD_TOAST:
|
|
814
813
|
return Object.assign(Object.assign({}, state), { toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT) });
|
|
815
|
-
case
|
|
814
|
+
case actionTypes.UPDATE_TOAST:
|
|
816
815
|
return Object.assign(Object.assign({}, state), { toasts: state.toasts.map((t) => (t.id === action.toast.id ? Object.assign(Object.assign({}, t), action.toast) : t)) });
|
|
817
|
-
case
|
|
816
|
+
case actionTypes.DISMISS_TOAST: {
|
|
818
817
|
const { toastId } = action;
|
|
819
818
|
// ! Side effects ! - This could be extracted into a dismissToast() action,
|
|
820
819
|
// but I'll keep it here for simplicity
|
|
@@ -829,7 +828,7 @@ const reducer = (state, action) => {
|
|
|
829
828
|
return Object.assign(Object.assign({}, state), { toasts: state.toasts.map((t) => t.id === toastId || toastId === undefined
|
|
830
829
|
? Object.assign(Object.assign({}, t), { open: false }) : t) });
|
|
831
830
|
}
|
|
832
|
-
case
|
|
831
|
+
case actionTypes.REMOVE_TOAST:
|
|
833
832
|
if (action.toastId === undefined) {
|
|
834
833
|
return Object.assign(Object.assign({}, state), { toasts: [] });
|
|
835
834
|
}
|
|
@@ -848,12 +847,12 @@ function toast(_a) {
|
|
|
848
847
|
var props = __rest(_a, []);
|
|
849
848
|
const id = genId();
|
|
850
849
|
const update = (props) => dispatch({
|
|
851
|
-
type:
|
|
850
|
+
type: actionTypes.UPDATE_TOAST,
|
|
852
851
|
toast: Object.assign(Object.assign({}, props), { id }),
|
|
853
852
|
});
|
|
854
|
-
const dismiss = () => dispatch({ type:
|
|
853
|
+
const dismiss = () => dispatch({ type: actionTypes.DISMISS_TOAST, toastId: id });
|
|
855
854
|
dispatch({
|
|
856
|
-
type:
|
|
855
|
+
type: actionTypes.ADD_TOAST,
|
|
857
856
|
toast: Object.assign(Object.assign({}, props), { id, open: true, onOpenChange: (open) => {
|
|
858
857
|
if (!open)
|
|
859
858
|
dismiss();
|
|
@@ -876,7 +875,7 @@ function useToast() {
|
|
|
876
875
|
}
|
|
877
876
|
};
|
|
878
877
|
}, [state]);
|
|
879
|
-
return Object.assign(Object.assign({}, state), { toast, dismiss: (toastId) => dispatch({ type:
|
|
878
|
+
return Object.assign(Object.assign({}, state), { toast, dismiss: (toastId) => dispatch({ type: actionTypes.DISMISS_TOAST, toastId }) });
|
|
880
879
|
}
|
|
881
880
|
|
|
882
881
|
const Tooltip = ({ children, className, content, asChild, placement, dataTestId = 'tooltip', }) => (jsx(TooltipPrimitive.Provider, { delayDuration: 200, children: jsxs(TooltipPrimitive.Root, { children: [jsx(TooltipPrimitive.Trigger, { asChild: asChild, "data-testid": `${dataTestId}-trigger`, children: children }), jsx(TooltipPrimitive.Portal, { children: jsx(TooltipPrimitive.Content, { className: cn('animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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', 'z-[101] overflow-hidden rounded-md border bg-white px-3 py-1.5 text-sm shadow-md dark:border-slate-700 dark:bg-slate-800 dark:text-white', className), side: placement, sideOffset: 5, "data-testid": `${dataTestId}-content`, children: content }) })] }) }));
|
|
@@ -888,24 +887,13 @@ const Label = ({ children, className, description, required, hasErrors, htmlFor,
|
|
|
888
887
|
}, className), htmlFor: htmlFor, "data-testid": dataTestId, children: [children, description && (jsx(Tooltip, { content: jsx("div", { className: "max-w-xs", children: description }), placement: "top", asChild: true, dataTestId: `${dataTestId}-description-tooltip`, children: jsx(HelpCircle, { className: "h-4 w-4", "data-testid": `${dataTestId}-description-tooltip-icon` }) })), required && jsx("span", { className: "text-red-600", children: "*" })] }));
|
|
889
888
|
};
|
|
890
889
|
|
|
891
|
-
const
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
disabled: 'opacity-60',
|
|
895
|
-
},
|
|
896
|
-
withoutErrors: {
|
|
897
|
-
input: 'border-slate-300 dark:border-slate-700 focus:border-blue-500 dark:focus:border-blue-600 dark:placeholder-slate-400',
|
|
898
|
-
extension: 'bg-white dark:bg-transparent border-slate-300 text-slate-600 peer-focus:border-blue-500 dark:peer-focus:border-blue-600 dark:border-slate-700 dark:text-white',
|
|
899
|
-
},
|
|
900
|
-
withErrors: {
|
|
901
|
-
input: 'text-red-600 border-red-500 placeholder-red-500 focus:border-red-500 dark:border-red-600 dark:peer-focus:border-red-600 dark:placeholder-red-600',
|
|
902
|
-
extension: 'text-red-600 border-red-500 peer-focus:border-red-500 dark:border-red-600 dark:peer-focus:border-red-600 dark:text-red-500',
|
|
903
|
-
},
|
|
904
|
-
};
|
|
890
|
+
const baseInputClasses = 'peer file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex w-full min-w-0 rounded-md border bg-transparent' +
|
|
891
|
+
'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 transition-color outline-none file:inline-flex file:border-0 file:bg-transparent file:font-medium' +
|
|
892
|
+
'border-input focus:ring-0';
|
|
905
893
|
const sizeClasses = {
|
|
906
894
|
small: {
|
|
907
895
|
label: 'text-xs',
|
|
908
|
-
input: 'text-xs py-
|
|
896
|
+
input: 'text-sm md:text-xs py-0.5 px-2 h-6 file:h-5 file:text-xs',
|
|
909
897
|
checkbox: {
|
|
910
898
|
input: 'w-3 h-3',
|
|
911
899
|
wrapper: 'h-6 gap-1',
|
|
@@ -921,7 +909,7 @@ const sizeClasses = {
|
|
|
921
909
|
},
|
|
922
910
|
medium: {
|
|
923
911
|
label: 'text-sm',
|
|
924
|
-
input: 'text-sm py-
|
|
912
|
+
input: 'text-base md:text-sm py-1 px-3 h-9 file:h-7 file:text-sm',
|
|
925
913
|
checkbox: {
|
|
926
914
|
input: 'w-4 h-4',
|
|
927
915
|
wrapper: 'h-8 gap-2',
|
|
@@ -947,31 +935,17 @@ const BasicInput = (_a) => {
|
|
|
947
935
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, { target: { value: '', checked: false } });
|
|
948
936
|
};
|
|
949
937
|
return (jsxs("div", { className: cn('w-full dark:text-white', className), "data-testid": dataTestId, children: [type !== 'checkbox' && memoLabel, jsxs("div", { className: cn('group relative flex', {
|
|
938
|
+
errors: hasErrors,
|
|
950
939
|
'mt-1': label && type !== 'checkbox',
|
|
951
940
|
[`items-center ${sizeClasses[size].checkbox.wrapper}`]: type === 'checkbox',
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
'rounded-r-none border-r-0': SuffixIcon,
|
|
957
|
-
}, inputClassName) }, props, { value: props.value, "data-testid": `${dataTestId}-textarea` }))) : type === 'checkbox' ? (jsx("input", Object.assign({ id: id, className: cn('rounded-sm border-slate-300 text-blue-600', sizeClasses[size].checkbox.input, {
|
|
958
|
-
[inputClasses.base.disabled]: props.disabled,
|
|
959
|
-
'bg-red-100': hasErrors,
|
|
960
|
-
}, inputClassName), type: type, checked: Boolean(props.value) }, props, { "data-testid": `${dataTestId}-checkbox` }))) : (jsx("input", Object.assign({ id: id, className: cn(inputClasses.base.input, sizeClasses[size].input, {
|
|
961
|
-
[inputClasses.base.disabled]: props.disabled,
|
|
962
|
-
[inputClasses.withoutErrors.input]: !hasErrors,
|
|
963
|
-
[inputClasses.withErrors.input]: hasErrors,
|
|
964
|
-
'rounded-r-none border-r-0': SuffixIcon,
|
|
965
|
-
}, inputClassName), type: type !== null && type !== void 0 ? type : 'text' }, props, { value: props.value, "data-testid": `${dataTestId}-input` }))), type === 'checkbox' && memoLabel, clearable && (onClear || !!props.value) && !props.disabled && (jsx(XIcon, { className: cn('absolute top-1/2 right-2 -translate-y-1/2 cursor-pointer rounded-full bg-white p-0.5 opacity-0 duration-200 group-hover:opacity-100 hover:bg-slate-200 dark:bg-slate-700 dark:hover:bg-slate-800', sizeClasses[size].clearButton.base, {
|
|
941
|
+
'has-[input:focus-visible]:border-ring has-[input:focus-visible]:ring-ring/50 has-[textarea:focus-visible]:border-ring has-[textarea:focus-visible]:ring-ring/50 rounded-md has-[input:focus-visible]:ring-[3px] has-[textarea:focus-visible]:ring-[3px]': type !== 'checkbox',
|
|
942
|
+
'aria-invalid:!ring-destructive/20 dark:aria-invalid:!ring-destructive/40 aria-invalid:[&>input,&>textarea,&>div]:border-destructive': type !== 'checkbox',
|
|
943
|
+
'shadow-xs transition-[color,box-shadow]': type !== 'checkbox',
|
|
944
|
+
}), title: type !== 'textarea' && typeof props.value === 'string' ? props.value : undefined, "data-testid": `${dataTestId}-wrapper`, "aria-invalid": hasErrors, children: [type === 'textarea' ? (jsx("textarea", Object.assign({ id: id, className: cn(baseInputClasses, sizeClasses[size].input.replace(/ h-\d/g, ''), 'field-sizing-content min-h-16 py-2', SuffixIcon && 'rounded-r-none border-r-0', inputClassName) }, props, { value: props.value, "data-testid": `${dataTestId}-textarea` }))) : type === 'checkbox' ? (jsx("input", Object.assign({ id: id, className: cn('border-input rounded-sm disabled:opacity-50', 'focus:ring-ring/50 focus:border-ring focus:ring-[3px] focus:ring-offset-0', 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40', sizeClasses[size].checkbox.input, hasErrors && 'bg-red-100', inputClassName), type: type, checked: Boolean(props.value) }, props, { "data-testid": `${dataTestId}-checkbox`, "aria-invalid": hasErrors }))) : (jsx("input", Object.assign({ id: id, className: cn(baseInputClasses, sizeClasses[size].input, SuffixIcon && 'rounded-r-none border-r-0', inputClassName), type: type !== null && type !== void 0 ? type : 'text' }, props, { value: props.value, "data-testid": `${dataTestId}-input` }))), type === 'checkbox' && memoLabel, clearable && (onClear || !!props.value) && !props.disabled && (jsx(XIcon, { className: cn('absolute top-1/2 right-2 -translate-y-1/2 cursor-pointer rounded-full bg-white p-0.5 opacity-0 duration-200 group-hover:opacity-100 hover:bg-slate-200 dark:bg-slate-700 dark:hover:bg-slate-800', sizeClasses[size].clearButton.base, {
|
|
966
945
|
[sizeClasses[size].clearButton.withSuffixIcon]: SuffixIcon,
|
|
967
|
-
}), onClick: handleClear, onPointerDown: (event) => event.stopPropagation(), "data-testid": `${dataTestId}-clear` })), type !== 'checkbox' && SuffixIcon && (jsx(BasicInputExtension, { className: extensionClassName,
|
|
946
|
+
}), onClick: handleClear, onPointerDown: (event) => event.stopPropagation(), "data-testid": `${dataTestId}-clear` })), type !== 'checkbox' && SuffixIcon && (jsx(BasicInputExtension, { className: extensionClassName, size: size, disabled: props.disabled, onClick: onSuffixIconClick, dataTestId: `${dataTestId}-suffix`, children: jsx(SuffixIcon, { className: sizeClasses[size].suffix.icon }) }))] })] }));
|
|
968
947
|
};
|
|
969
|
-
const BasicInputExtension = ({ children, className, size,
|
|
970
|
-
[inputClasses.base.disabled]: disabled,
|
|
971
|
-
[inputClasses.withoutErrors.extension]: !hasErrors,
|
|
972
|
-
[inputClasses.withErrors.extension]: hasErrors,
|
|
973
|
-
'cursor-pointer': onClick,
|
|
974
|
-
}, className), onClick: !disabled ? onClick : undefined, onPointerDown: (event) => event.stopPropagation(), "data-testid": dataTestId, children: children }));
|
|
948
|
+
const BasicInputExtension = ({ children, className, size, disabled, onClick, dataTestId }) => (jsx("div", { className: cn('dark:bg-input/30 border-input flex aspect-square items-center justify-center rounded-r-md border border-l-0 bg-transparent aria-disabled:opacity-50', sizeClasses[size].suffix.wrapper, onClick && 'cursor-pointer', className), onClick: !disabled ? onClick : undefined, onPointerDown: (event) => event.stopPropagation(), "data-testid": dataTestId, "aria-disabled": disabled, children: children }));
|
|
975
949
|
|
|
976
950
|
const CheckboxInput = (_a) => {
|
|
977
951
|
var { dataTestId = 'checkbox-input' } = _a, props = __rest(_a, ["dataTestId"]);
|
|
@@ -1250,7 +1224,7 @@ const DateTimeInput = (_a) => {
|
|
|
1250
1224
|
setIsOpen(false);
|
|
1251
1225
|
}
|
|
1252
1226
|
};
|
|
1253
|
-
return (jsxs("div", { className: cn('relative w-full', className), ref: ref, children: [jsx(
|
|
1227
|
+
return (jsxs("div", { className: cn('relative w-full', className), ref: ref, children: [jsx(TextInput, Object.assign({}, props, { readOnly: true, value: displayDate !== null && displayDate !== void 0 ? displayDate : '', hasErrors: hasErrors, onClick: handleOnClick, onKeyUp: handleOnKeyUp, clearable: clearable && !!displayDate, onClear: clearDate, suffixIcon: (type === null || type === void 0 ? void 0 : type.includes('date')) ? CalendarIcon : ClockIcon, onSuffixIconClick: handleOnClick, dataTestId: dataTestId })), isOpen && (jsxs("div", { className: "absolute z-20 mt-2 flex origin-top-left flex-col rounded-md border bg-white shadow-sm duration-200 dark:border-slate-700 dark:bg-slate-900 dark:text-white", tabIndex: 0, onBlur: handleOnBlur, ref: calendarRef, "data-testid": `${dataTestId}-popup`, children: [(type === null || type === void 0 ? void 0 : type.includes('date')) && (jsx(DateSelector, { date: date, value: value, minDate: minDate, maxDate: maxDate, locale: displayLocale, calendarView: calendarView, setCalendarView: setCalendarView, setNewDate: setNewDate, dataTestId: `${dataTestId}-date-selector` })), calendarView === 'days' && (jsxs("div", { className: "flex items-center justify-end gap-2 px-3 py-2 select-none", "data-testid": `${dataTestId}-time-selector`, children: [(type === null || type === void 0 ? void 0 : type.includes('time')) && (jsx(TimeSelector, { date: date, step: step, minDate: minDate, maxDate: maxDate, setNewDate: setNewDate, dataTestId: `${dataTestId}-time-selector` })), jsx("div", { className: "cursor-pointer rounded-lg border border-transparent p-1 text-sm font-bold text-blue-600 uppercase transition duration-100 ease-in-out hover:bg-slate-100 dark:text-blue-500 dark:hover:bg-slate-700", onClick: () => setIsOpen(false), "data-testid": `${dataTestId}-ok`, children: "OK" })] }))] }))] }));
|
|
1254
1228
|
};
|
|
1255
1229
|
|
|
1256
1230
|
const ListContent = (_a) => {
|
|
@@ -1452,7 +1426,7 @@ const SelectInput = (_a) => {
|
|
|
1452
1426
|
handleOnSelect(option.id);
|
|
1453
1427
|
}, dataTestId: option.dataTestId, children: jsx("span", { children: renderItem(option, isNotNullOrUndefined(selectedMap[option.id])) }) }));
|
|
1454
1428
|
}, [ItemComponent, handleOnSelect, multiple, renderItem, selectedMap]);
|
|
1455
|
-
return (jsxs(DropdownMenu, { open: open, onOpenChange: setOpen, children: [jsx(DropdownMenu.Trigger, { className: cn('w-full', className), dataTestId: `${dataTestId}-trigger`, children: jsx(TextInput, Object.assign({ className: "[&>div>*]:cursor-pointer", inputClassName:
|
|
1429
|
+
return (jsxs(DropdownMenu, { open: open, onOpenChange: setOpen, children: [jsx(DropdownMenu.Trigger, { className: cn('w-full', className), dataTestId: `${dataTestId}-trigger`, children: jsx(TextInput, Object.assign({}, props, { readOnly: true, className: "[&>div>*]:cursor-pointer", inputClassName: cn('text-left', props.inputClassName), value: text !== null && text !== void 0 ? text : '', clearable: clearable && !!selectedItems.length, onClear: handleOnClear, suffixIcon: ChevronDownIcon, onSuffixIconClick: () => setOpen((open) => !open), dataTestId: dataTestId })) }), jsxs(DropdownMenu.Content, { className: "flex max-h-80 w-[calc(var(--radix-popper-anchor-width))] flex-col overflow-hidden", dataTestId: `${dataTestId}-content`, children: [search && (jsxs(Fragment, { children: [jsx(TextInput, { autoFocus: true, value: searchValue, placeholder: "Search...", size: props.size, onChange: handleOnSearchValueChange, onKeyUp: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), clearable: !!searchValue.length, onClear: clearSearchValue, dataTestId: `${dataTestId}-search` }), jsx(DropdownMenu.Separator, { className: "w-full", dataTestId: `${dataTestId}-separator` })] })), filteredItems.length === 0 &&
|
|
1456
1430
|
(allowAddition && searchValue ? (jsxs("button", { className: "rounded-sm bg-slate-100 py-1.5 text-center hover:bg-slate-200 dark:bg-slate-900/30 dark:hover:bg-slate-700/30", onClick: handleOnAddItemClicked, "data-testid": `${dataTestId}-add-button`, children: ["Add '", searchValue, "'"] })) : (jsx("div", { className: "py-1.5 text-center text-slate-500", "data-testid": `${dataTestId}-no-items`, children: "No items" }))), jsx(GroupComponent, { className: "flex flex-col gap-1 overflow-auto", value: !multiple && selectedItems.length ? String(selectedItems[0].id) : undefined, dataTestId: `${dataTestId}-group`, children: filteredItems.map((item, index) => item.group ? (jsxs(Flex, { className: "gap-1", direction: "column", fullWidth: true, children: [jsx(DropdownMenu.Label, { className: "sticky top-0 z-[51] w-full rounded-md border bg-white py-1 dark:bg-slate-900", dataTestId: `${dataTestId}-group-label-${item.id}`, children: item.label }), item.items.map((subItem) => (jsx(RenderOption, Object.assign({}, subItem, { dataTestId: `${dataTestId}-item-${subItem.id}` }), subItem.id))), index < filteredItems.length - 1 && (jsx("div", { className: "mb-1 h-px w-full bg-slate-200 dark:bg-slate-700" }))] }, item.id)) : (jsx(RenderOption, Object.assign({}, item, { dataTestId: `${dataTestId}-item-${item.id}` }), item.id))) })] })] }));
|
|
1457
1431
|
};
|
|
1458
1432
|
function isNotNullOrUndefined(value) {
|
|
@@ -1494,11 +1468,12 @@ function withForm(Component) {
|
|
|
1494
1468
|
return (jsx(Component, Object.assign({}, restProps, field, { onChange: Component === NumberInput
|
|
1495
1469
|
? (value) => field.onChange(value.target.valueAsNumber)
|
|
1496
1470
|
: field.onChange, value: (_a = field.value) !== null && _a !== void 0 ? _a : '', disabled: ((_b = field.disabled) !== null && _b !== void 0 ? _b : restProps.disabled) ||
|
|
1497
|
-
formState.isSubmitting, hasErrors: fieldState.error })));
|
|
1471
|
+
formState.isSubmitting, hasErrors: !!fieldState.error })));
|
|
1498
1472
|
} }));
|
|
1499
1473
|
};
|
|
1500
1474
|
}
|
|
1501
1475
|
const FormInputs = {
|
|
1476
|
+
BasicInput: withForm(BasicInput),
|
|
1502
1477
|
Text: withForm(TextInput),
|
|
1503
1478
|
Email: withForm(EmailInput),
|
|
1504
1479
|
Password: withForm(PasswordInput),
|
|
@@ -1529,6 +1504,8 @@ const dotSizeClassNames = {
|
|
|
1529
1504
|
},
|
|
1530
1505
|
};
|
|
1531
1506
|
const colorClassNames = {
|
|
1507
|
+
primary: 'bg-primary text-primary-foreground',
|
|
1508
|
+
secondary: 'bg-secondary text-secondary-foreground',
|
|
1532
1509
|
slate: 'bg-slate-500 dark:bg-slate-600',
|
|
1533
1510
|
gray: 'bg-gray-500 dark:bg-gray-600',
|
|
1534
1511
|
zinc: 'bg-zinc-500 dark:bg-zinc-600',
|
|
@@ -1964,7 +1941,6 @@ const SidebarContextProvider = (_a) => {
|
|
|
1964
1941
|
var { defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children } = _a, props = __rest(_a, ["defaultOpen", "open", "onOpenChange", "className", "style", "children"]);
|
|
1965
1942
|
const isMobile = useIsMobile();
|
|
1966
1943
|
const [openMobile, setOpenMobile] = useState(false);
|
|
1967
|
-
useRef(typeof document === 'undefined' ? null : document.documentElement);
|
|
1968
1944
|
// This is the internal state of the sidebar.
|
|
1969
1945
|
// We use openProp and setOpenProp for control from outside the component.
|
|
1970
1946
|
const [_open, _setOpen] = useState(getValueFromCookie(SIDEBAR_COOKIE_NAME, defaultOpen));
|
|
@@ -2422,4 +2398,4 @@ function Toaster() {
|
|
|
2422
2398
|
}), jsx(Toast.Viewport, {})] }));
|
|
2423
2399
|
}
|
|
2424
2400
|
|
|
2425
|
-
export { Badge, BasicInput, BasicInputExtension, Block, Button, Card, CheckboxInput, Collapsible, ConfirmDialog, DataTable, DateTimeInput, Dialog, DropdownMenu, EmailInput, FileInput, Flex, FormDialog, FormGroup, FormInputs, Hint, Label, Layout, LayoutContext, LayoutContextProvider, List, ListSorter, ListSorterDialog, Navbar, NumberInput, Pagination, PasswordInput, PdfViewerDialog, Popover, Resizable, SHOW_IDS_COOKIE_MAX_AGE, SHOW_IDS_COOKIE_NAME, SIDEBAR_COOKIE_MAX_AGE, SIDEBAR_COOKIE_NAME, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SIDEBAR_WIDTH_MOBILE, SelectInput, Separator, Sheet, Sidebar, SidebarContext, SidebarContextProvider, Skeleton, Spinner, Switch, THEME_COOKIE_MAX_AGE, THEME_COOKIE_NAME, THEME_MEDIA_QUERY, Table, Tabs, TextInput, TextareaInput, ThemeSelector, Toast, Toaster, Tooltip, cn, compareDates, generalComparator, getDisplayDate, getValueFromCookie, isEmpty, reducer, resolveTargetObject, toast, useDays, useIsMobile, useLayoutContext, useLongPress, useMonths, useOnSwipe, useOutsideClick, usePagination, useSidebar, useToast };
|
|
2401
|
+
export { Accordion, Badge, BasicInput, BasicInputExtension, Block, Button, Card, CheckboxInput, Collapsible, ConfirmDialog, DataTable, DateTimeInput, Dialog, DropdownMenu, EmailInput, FileInput, Flex, FormDialog, FormGroup, FormInputs, Hint, Label, Layout, LayoutContext, LayoutContextProvider, List, ListSorter, ListSorterDialog, Navbar, NumberInput, Pagination, PasswordInput, PdfViewerDialog, Popover, Resizable, SHOW_IDS_COOKIE_MAX_AGE, SHOW_IDS_COOKIE_NAME, SIDEBAR_COOKIE_MAX_AGE, SIDEBAR_COOKIE_NAME, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SIDEBAR_WIDTH_MOBILE, SelectInput, Separator, Sheet, Sidebar, SidebarContext, SidebarContextProvider, Skeleton, Spinner, Switch, THEME_COOKIE_MAX_AGE, THEME_COOKIE_NAME, THEME_MEDIA_QUERY, Table, Tabs, TextInput, TextareaInput, ThemeSelector, Toast, Toaster, Tooltip, cn, compareDates, generalComparator, getDisplayDate, getValueFromCookie, isEmpty, reducer, resolveTargetObject, toast, useDays, useIsMobile, useLayoutContext, useLongPress, useMonths, useOnSwipe, useOutsideClick, usePagination, useSidebar, useToast };
|