laif-ds 0.2.52 → 0.2.54
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/dist/components/ui/app-select.js +102 -99
- package/dist/components/ui/app-tooltip.js +123 -0
- package/dist/components/ui/async-select.js +54 -53
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/date-picker.js +96 -86
- package/dist/components/ui/file-preview.js +233 -286
- package/dist/components/ui/input.js +28 -29
- package/dist/index.d.ts +56 -1
- package/dist/index.js +41 -39
- package/dist/lib/design-tokens.js +3 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as f, jsx as
|
|
2
|
+
import { jsxs as f, jsx as l } from "react/jsx-runtime";
|
|
3
3
|
import { Label as se } from "./label.js";
|
|
4
4
|
import { designTokens as o } from "../../lib/design-tokens.js";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { cva as
|
|
5
|
+
import { cn as n } from "../../lib/utils.js";
|
|
6
|
+
import { cva as j } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
7
7
|
import * as a from "react";
|
|
8
8
|
import { Icon as N } from "./icon.js";
|
|
9
9
|
import { Typo as te } from "./typo.js";
|
|
10
|
-
const ae =
|
|
11
|
-
|
|
10
|
+
const ae = j(
|
|
11
|
+
n(
|
|
12
12
|
o.input.base,
|
|
13
13
|
o.radius.default,
|
|
14
14
|
"items-center gap-2 px-3",
|
|
15
|
-
|
|
16
|
-
"focus-within:ring-d-ring/50 focus-within:ring-[3px] focus-within:border-d-ring outline-none",
|
|
15
|
+
o.focusRingWithin,
|
|
17
16
|
o.input.invalid
|
|
18
17
|
),
|
|
19
18
|
{
|
|
@@ -28,8 +27,8 @@ const ae = R(
|
|
|
28
27
|
size: "default"
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
|
-
), re =
|
|
32
|
-
|
|
30
|
+
), re = j(
|
|
31
|
+
n(
|
|
33
32
|
o.text.base,
|
|
34
33
|
"shadow-none flex-1 min-w-0 bg-transparent outline-none border-0 p-0 overflow-hidden text-ellipsis",
|
|
35
34
|
"file:text-d-foreground file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
@@ -43,7 +42,7 @@ const ae = R(
|
|
|
43
42
|
size: {
|
|
44
43
|
default: "file:h-7",
|
|
45
44
|
sm: "text-xs file:h-6",
|
|
46
|
-
lg: "text-
|
|
45
|
+
lg: "text-base file:h-8"
|
|
47
46
|
}
|
|
48
47
|
},
|
|
49
48
|
defaultVariants: {
|
|
@@ -55,7 +54,7 @@ const ae = R(
|
|
|
55
54
|
hide: "Nascondi password"
|
|
56
55
|
}, fe = a.forwardRef(
|
|
57
56
|
({
|
|
58
|
-
className:
|
|
57
|
+
className: A,
|
|
59
58
|
type: p,
|
|
60
59
|
label: T,
|
|
61
60
|
labelClassName: D,
|
|
@@ -77,7 +76,7 @@ const ae = R(
|
|
|
77
76
|
validityI18n: e,
|
|
78
77
|
...$
|
|
79
78
|
}, J) => {
|
|
80
|
-
const [u, K] = a.useState(!1), [h, k] = a.useState(!0), [Q, L] = a.useState(!1), [U, V] = a.useState(""), X = a.useId(), w = G ?? X,
|
|
79
|
+
const [u, K] = a.useState(!1), [h, k] = a.useState(!0), [Q, L] = a.useState(!1), [U, V] = a.useState(""), X = a.useId(), w = G ?? X, R = `${w}-validity`, x = a.useRef(null), b = p === "password", Y = b ? u ? "text" : "password" : p, W = F ?? (!h && Q ? !0 : void 0), Z = [H, B && R].filter(Boolean).join(" ").trim() || void 0;
|
|
81
80
|
a.useImperativeHandle(J, () => x.current);
|
|
82
81
|
const q = a.useCallback(
|
|
83
82
|
(t) => {
|
|
@@ -128,39 +127,39 @@ const ae = R(
|
|
|
128
127
|
},
|
|
129
128
|
[z, c]
|
|
130
129
|
);
|
|
131
|
-
return /* @__PURE__ */ f("div", { className:
|
|
132
|
-
T && /* @__PURE__ */ f(se, { htmlFor: w, className:
|
|
130
|
+
return /* @__PURE__ */ f("div", { className: n("flex flex-col gap-1.5", A), children: [
|
|
131
|
+
T && /* @__PURE__ */ f(se, { htmlFor: w, className: n("gap-0.5", D), children: [
|
|
133
132
|
T,
|
|
134
|
-
C && h && /* @__PURE__ */
|
|
135
|
-
!h && /* @__PURE__ */
|
|
133
|
+
C && h && /* @__PURE__ */ l("div", { children: "*" }),
|
|
134
|
+
!h && /* @__PURE__ */ l("div", { className: "text-d-destructive", children: "*" })
|
|
136
135
|
] }),
|
|
137
136
|
/* @__PURE__ */ f(
|
|
138
137
|
"div",
|
|
139
138
|
{
|
|
140
|
-
className:
|
|
139
|
+
className: n(
|
|
141
140
|
ae({ size: g }),
|
|
142
141
|
d ? "cursor-not-allowed opacity-50" : "cursor-text"
|
|
143
142
|
),
|
|
144
|
-
"aria-invalid":
|
|
143
|
+
"aria-invalid": W,
|
|
145
144
|
onClick: q,
|
|
146
145
|
children: [
|
|
147
146
|
(v || S) && /* @__PURE__ */ f("div", { className: "text-d-muted-foreground flex shrink-0 items-center gap-2", children: [
|
|
148
|
-
v && /* @__PURE__ */
|
|
147
|
+
v && /* @__PURE__ */ l(N, { name: v, size: g === "lg" ? "sm" : "xs" }),
|
|
149
148
|
S
|
|
150
149
|
] }),
|
|
151
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ l(
|
|
152
151
|
"input",
|
|
153
152
|
{
|
|
154
153
|
id: w,
|
|
155
154
|
type: Y,
|
|
156
155
|
"data-slot": "input",
|
|
157
|
-
className:
|
|
156
|
+
className: n(re({ size: g })),
|
|
158
157
|
ref: x,
|
|
159
158
|
disabled: d,
|
|
160
159
|
onChange: y,
|
|
161
160
|
onBlur: I,
|
|
162
161
|
onInvalid: ee,
|
|
163
|
-
"aria-invalid":
|
|
162
|
+
"aria-invalid": W,
|
|
164
163
|
"aria-describedby": Z,
|
|
165
164
|
required: C,
|
|
166
165
|
step: p === "number" ? "any" : void 0,
|
|
@@ -174,7 +173,7 @@ const ae = R(
|
|
|
174
173
|
onClick: (t) => {
|
|
175
174
|
t.stopPropagation(), t.preventDefault(), K((s) => !s);
|
|
176
175
|
},
|
|
177
|
-
className:
|
|
176
|
+
className: n(
|
|
178
177
|
"text-d-muted-foreground flex shrink-0 cursor-pointer items-center",
|
|
179
178
|
d && "cursor-not-allowed"
|
|
180
179
|
),
|
|
@@ -184,31 +183,31 @@ const ae = R(
|
|
|
184
183
|
title: u ? m.hide : m.show,
|
|
185
184
|
disabled: d,
|
|
186
185
|
children: [
|
|
187
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ l(
|
|
188
187
|
N,
|
|
189
188
|
{
|
|
190
189
|
name: u ? "EyeOff" : "Eye",
|
|
191
190
|
size: g === "lg" ? "sm" : "xs"
|
|
192
191
|
}
|
|
193
192
|
),
|
|
194
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ l("span", { className: "sr-only", children: u ? m.hide : m.show })
|
|
195
194
|
]
|
|
196
195
|
}
|
|
197
196
|
) : (M || E) && /* @__PURE__ */ f("div", { className: "text-d-muted-foreground flex shrink-0 items-center gap-2", children: [
|
|
198
197
|
E,
|
|
199
|
-
M && /* @__PURE__ */
|
|
198
|
+
M && /* @__PURE__ */ l(N, { name: M, size: g === "lg" ? "sm" : "xs" })
|
|
200
199
|
] })
|
|
201
200
|
]
|
|
202
201
|
}
|
|
203
202
|
),
|
|
204
|
-
B && U.length > 0 && /* @__PURE__ */
|
|
203
|
+
B && U.length > 0 && /* @__PURE__ */ l(
|
|
205
204
|
te,
|
|
206
205
|
{
|
|
207
206
|
variant: "caption",
|
|
208
|
-
id:
|
|
207
|
+
id: R,
|
|
209
208
|
role: h ? "status" : "alert",
|
|
210
209
|
"aria-live": "polite",
|
|
211
|
-
className:
|
|
210
|
+
className: n(
|
|
212
211
|
"max-w-full min-w-0 text-wrap",
|
|
213
212
|
h ? "text-d-success" : "text-d-destructive"
|
|
214
213
|
),
|
package/dist/index.d.ts
CHANGED
|
@@ -306,6 +306,53 @@ declare interface AppStepperProps extends Omit<StepperProps, "children"> {
|
|
|
306
306
|
indicators?: StepIndicators_2;
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
+
export declare function AppTooltip({ content, children, label, labelClassName, header, variant, triggerVariant, size, className, wrpClassName, contentClassName, side, align, sideOffset, matchTriggerWidth, delayDuration, disabled, asChild, }: AppTooltipProps): JSX.Element;
|
|
310
|
+
|
|
311
|
+
export declare type AppTooltipAlign = "start" | "center" | "end";
|
|
312
|
+
|
|
313
|
+
declare interface AppTooltipProps {
|
|
314
|
+
/** Content displayed inside the tooltip */
|
|
315
|
+
content: React_2.ReactNode;
|
|
316
|
+
/** Element that triggers the tooltip on hover/focus */
|
|
317
|
+
children: React_2.ReactNode;
|
|
318
|
+
/** Optional label displayed above the tooltip trigger */
|
|
319
|
+
label?: string | React_2.ReactNode;
|
|
320
|
+
/** Optional header displayed at the top of the tooltip content */
|
|
321
|
+
header?: string | React_2.ReactNode;
|
|
322
|
+
/** Tooltip content variant - affects background and styling */
|
|
323
|
+
variant?: AppTooltipVariant;
|
|
324
|
+
/** Trigger element variant - affects hover states */
|
|
325
|
+
triggerVariant?: VariantProps<typeof tooltipTriggerVariants>["variant"];
|
|
326
|
+
/** Size of the trigger element */
|
|
327
|
+
size?: VariantProps<typeof tooltipTriggerVariants>["size"];
|
|
328
|
+
/** Additional className for the trigger wrapper */
|
|
329
|
+
className?: string;
|
|
330
|
+
/** Additional className for the outer wrapper (includes label) */
|
|
331
|
+
wrpClassName?: string;
|
|
332
|
+
/** Additional className for the tooltip content */
|
|
333
|
+
contentClassName?: string;
|
|
334
|
+
/** Additional className for the label */
|
|
335
|
+
labelClassName?: string;
|
|
336
|
+
/** Side where the tooltip appears */
|
|
337
|
+
side?: AppTooltipSide;
|
|
338
|
+
/** Alignment of the tooltip relative to the trigger */
|
|
339
|
+
align?: AppTooltipAlign;
|
|
340
|
+
/** Offset from the trigger in pixels */
|
|
341
|
+
sideOffset?: number;
|
|
342
|
+
/** Whether the tooltip should match the trigger's width */
|
|
343
|
+
matchTriggerWidth?: boolean;
|
|
344
|
+
/** Delay before showing tooltip (ms) */
|
|
345
|
+
delayDuration?: number;
|
|
346
|
+
/** Whether to disable the tooltip */
|
|
347
|
+
disabled?: boolean;
|
|
348
|
+
/** Whether to use asChild pattern for trigger (for custom elements) */
|
|
349
|
+
asChild?: boolean;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export declare type AppTooltipSide = "top" | "right" | "bottom" | "left";
|
|
353
|
+
|
|
354
|
+
export declare type AppTooltipVariant = "primary" | "card";
|
|
355
|
+
|
|
309
356
|
export declare function AspectRatio({ ...props }: AspectRatioProps): JSX.Element;
|
|
310
357
|
|
|
311
358
|
declare type AspectRatioProps = React.ComponentProps<typeof AspectRatioPrimitive.Root>;
|
|
@@ -422,6 +469,7 @@ declare type BaseProps = {
|
|
|
422
469
|
maxSelectedMessage?: (max: number) => string;
|
|
423
470
|
label?: string | React.ReactNode;
|
|
424
471
|
className?: string;
|
|
472
|
+
labelClassName?: string;
|
|
425
473
|
wrpClassName?: string;
|
|
426
474
|
searchable?: boolean;
|
|
427
475
|
creatable?: boolean;
|
|
@@ -1421,7 +1469,7 @@ export declare interface DataTableState {
|
|
|
1421
1469
|
computedSorting?: DataTableSorting;
|
|
1422
1470
|
}
|
|
1423
1471
|
|
|
1424
|
-
export declare function DatePicker({ value, onChange, placeholder, dateFormat, className, disabled, size, firstDate, lastDate, availableDates, locale, initialCalendarMonth, customCalendarProps, }: DatePickerProps): JSX.Element;
|
|
1472
|
+
export declare function DatePicker({ value, onChange, placeholder, dateFormat, className, disabled, size, firstDate, lastDate, availableDates, locale, initialCalendarMonth, customCalendarProps, label, wrpClassName, }: DatePickerProps): JSX.Element;
|
|
1425
1473
|
|
|
1426
1474
|
export declare interface DatePickerProps {
|
|
1427
1475
|
value?: Date;
|
|
@@ -1438,6 +1486,8 @@ export declare interface DatePickerProps {
|
|
|
1438
1486
|
locale?: Partial<Locale>;
|
|
1439
1487
|
initialCalendarMonth?: Date;
|
|
1440
1488
|
customCalendarProps?: React_2.ComponentProps<typeof Calendar>;
|
|
1489
|
+
label?: string | React_2.ReactNode;
|
|
1490
|
+
wrpClassName?: string;
|
|
1441
1491
|
}
|
|
1442
1492
|
|
|
1443
1493
|
/**
|
|
@@ -2584,6 +2634,11 @@ export declare function TooltipProvider({ delayDuration, ...props }: React_2.Com
|
|
|
2584
2634
|
|
|
2585
2635
|
export declare function TooltipTrigger({ ...props }: React_2.ComponentProps<typeof TooltipPrimitive.Trigger>): JSX.Element;
|
|
2586
2636
|
|
|
2637
|
+
declare const tooltipTriggerVariants: (props?: ({
|
|
2638
|
+
variant?: "default" | "secondary" | "ghost" | "primary" | "muted" | "accent" | null | undefined;
|
|
2639
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
2640
|
+
} & ClassProp) | undefined) => string;
|
|
2641
|
+
|
|
2587
2642
|
declare const tooltipVariants: (props?: ({
|
|
2588
2643
|
variant?: "primary" | "card" | null | undefined;
|
|
2589
2644
|
} & ClassProp) | undefined) => string;
|
package/dist/index.js
CHANGED
|
@@ -90,13 +90,14 @@ import { WeeklyCalendar as Hn } from "./components/ui/weekly-calendar/weekly-cal
|
|
|
90
90
|
import { cn as yn, downloadFile as Nn, hexContrast as On, hexToRgba as Vn, previewFile as zn, stringToHexColor as En } from "./lib/utils.js";
|
|
91
91
|
import { AppKanban as Kn } from "./components/ui/app-kanban.js";
|
|
92
92
|
import { AppStepper as Wn } from "./components/ui/app-stepper.js";
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
93
|
+
import { AppTooltip as Jn } from "./components/ui/app-tooltip.js";
|
|
94
|
+
import { createActionColumn as Xn, createBooleanColumn as Yn, createBooleanFilter as Zn, createComputedColumn as _n, createDateColumn as $n, createDateFilter as ei, createDateTimeColumn as ri, createDateTimeFilter as oi, createDisplayColumn as ti, createFilterBadge as ai, createFilterBadges as ni, createInitialState as ii, createListFilter as pi, createMultiSelectColumn as li, createNumberColumn as mi, createNumberFilter as ui, createSingleSelectColumn as xi, createSorting as di, createStringColumn as Ci, createStringFilter as gi, getColumnIds as fi, isValidOperatorForType as bi, pinColumns as si, toSelectOptions as ci, toSelectOptionsFromObjects as Si, updateColumnListOptions as Mi } from "./components/ui/tables/data-table/data-table.utils.js";
|
|
95
|
+
import { useAudioRecording as Di } from "./hooks/use-audio-recording.js";
|
|
96
|
+
import { useAutoScroll as Fi } from "./hooks/use-auto-scroll.js";
|
|
97
|
+
import { useAutosizeTextArea as Pi } from "./hooks/use-autosize-textarea.js";
|
|
98
|
+
import { useCopyToClipboard as vi } from "./hooks/use-copy-to-clipboard.js";
|
|
99
|
+
import { useDebounce as Gi } from "./hooks/use-debounce.js";
|
|
100
|
+
import { useIsMobile as Li } from "./hooks/use-mobile.js";
|
|
100
101
|
export {
|
|
101
102
|
pe as Accordion,
|
|
102
103
|
le as AccordionContent,
|
|
@@ -122,6 +123,7 @@ export {
|
|
|
122
123
|
pa as AppSelect,
|
|
123
124
|
ma as AppSidebar,
|
|
124
125
|
Wn as AppStepper,
|
|
126
|
+
Jn as AppTooltip,
|
|
125
127
|
a as AspectRatio,
|
|
126
128
|
Pe as AsyncSelect,
|
|
127
129
|
Ot as AudioVisualizer,
|
|
@@ -363,47 +365,47 @@ export {
|
|
|
363
365
|
g as buttonVariants,
|
|
364
366
|
yn as cn,
|
|
365
367
|
Sa as confirm,
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
368
|
+
Xn as createActionColumn,
|
|
369
|
+
Yn as createBooleanColumn,
|
|
370
|
+
Zn as createBooleanFilter,
|
|
371
|
+
_n as createComputedColumn,
|
|
372
|
+
$n as createDateColumn,
|
|
373
|
+
ei as createDateFilter,
|
|
374
|
+
ri as createDateTimeColumn,
|
|
375
|
+
oi as createDateTimeFilter,
|
|
376
|
+
ti as createDisplayColumn,
|
|
377
|
+
ai as createFilterBadge,
|
|
378
|
+
ni as createFilterBadges,
|
|
379
|
+
ii as createInitialState,
|
|
380
|
+
pi as createListFilter,
|
|
381
|
+
li as createMultiSelectColumn,
|
|
382
|
+
mi as createNumberColumn,
|
|
383
|
+
ui as createNumberFilter,
|
|
384
|
+
xi as createSingleSelectColumn,
|
|
385
|
+
di as createSorting,
|
|
386
|
+
Ci as createStringColumn,
|
|
387
|
+
gi as createStringFilter,
|
|
386
388
|
Nn as downloadFile,
|
|
387
|
-
|
|
389
|
+
fi as getColumnIds,
|
|
388
390
|
On as hexContrast,
|
|
389
391
|
Vn as hexToRgba,
|
|
390
|
-
|
|
391
|
-
|
|
392
|
+
bi as isValidOperatorForType,
|
|
393
|
+
si as pinColumns,
|
|
392
394
|
zn as previewFile,
|
|
393
395
|
Da as previewFileModal,
|
|
394
396
|
Aa as safePreviewFileModal,
|
|
395
397
|
En as stringToHexColor,
|
|
396
|
-
|
|
397
|
-
|
|
398
|
+
ci as toSelectOptions,
|
|
399
|
+
Si as toSelectOptionsFromObjects,
|
|
398
400
|
_ as toggleVariants,
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
401
|
+
Mi as updateColumnListOptions,
|
|
402
|
+
Di as useAudioRecording,
|
|
403
|
+
Fi as useAutoScroll,
|
|
404
|
+
Pi as useAutosizeTextArea,
|
|
405
|
+
vi as useCopyToClipboard,
|
|
406
|
+
Gi as useDebounce,
|
|
405
407
|
$t as useEditorModal,
|
|
406
408
|
yr as useFormField,
|
|
407
|
-
|
|
409
|
+
Li as useIsMobile,
|
|
408
410
|
Dn as useSidebar
|
|
409
411
|
};
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
const e = {
|
|
3
3
|
// Interaction states
|
|
4
4
|
focusRing: "focus-visible:ring-d-ring/50 focus-visible:ring-[3px] focus-visible:border-d-ring outline-none transition-all duration-200",
|
|
5
|
+
focusRingWithin: "focus-within:ring-d-ring/50 focus-within:ring-[3px] focus-within:border-d-ring outline-none transition-all duration-200",
|
|
6
|
+
activeRing: "ring-d-ring/50 ring-[3px] border-d-ring",
|
|
5
7
|
// Base shapes
|
|
6
8
|
radius: {
|
|
7
9
|
default: "rounded-md",
|
|
@@ -11,7 +13,7 @@ const e = {
|
|
|
11
13
|
},
|
|
12
14
|
// Input & Button heights/paddings
|
|
13
15
|
sizes: {
|
|
14
|
-
default: "h-9 px-3 py-2",
|
|
16
|
+
default: "h-9 px-3 py-2 text-sm",
|
|
15
17
|
sm: "h-8 px-2.5 py-1.5 text-xs",
|
|
16
18
|
lg: "h-10 px-4 py-2 text-base",
|
|
17
19
|
icon: {
|