laif-ds 0.2.69 → 0.2.71

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.
@@ -1,35 +1,36 @@
1
1
  "use client";
2
- import { jsxs as c, jsx as r } from "react/jsx-runtime";
3
- import { designTokens as t } from "../design-tokens.js";
4
- import { Label as m } from "./label.js";
5
- import { cn as s } from "../../lib/utils.js";
6
- function b({
2
+ import { jsxs as m, jsx as r } from "react/jsx-runtime";
3
+ import { designTokens as e } from "../design-tokens.js";
4
+ import { Label as x } from "./label.js";
5
+ import { cn as a } from "../../lib/utils.js";
6
+ function h({
7
7
  wrpClassName: o,
8
- className: a,
9
- label: e,
8
+ className: s,
9
+ label: t,
10
10
  labelClassName: n,
11
11
  id: d,
12
12
  ...l
13
13
  }) {
14
- const i = d || (e ? `textarea-${Math.random().toString(36).substring(2, 9)}` : void 0);
15
- return /* @__PURE__ */ c("div", { className: s("space-y-1.5", o), children: [
16
- e && /* @__PURE__ */ r(m, { htmlFor: i, className: n, children: e }),
14
+ const i = d || (t ? `textarea-${Math.random().toString(36).substring(2, 9)}` : void 0);
15
+ return /* @__PURE__ */ m("div", { className: a("space-y-1.5", o), children: [
16
+ t && /* @__PURE__ */ r(x, { htmlFor: i, className: n, children: t }),
17
17
  /* @__PURE__ */ r(
18
18
  "textarea",
19
19
  {
20
20
  id: i,
21
21
  "data-slot": "textarea",
22
- className: s(
23
- t.input.base,
24
- t.radius.default,
25
- t.text.base,
26
- t.text.placeholder,
27
- t.interaction.disabled,
28
- "flex field-sizing-content min-h-16 w-full px-3 py-2 shadow-xs transition-[color,box-shadow] outline-none md:text-sm",
22
+ className: a(
23
+ e.input.base,
24
+ e.radius.default,
25
+ e.text.base,
26
+ e.text.placeholder,
27
+ e.interaction.disabled,
28
+ "flex min-h-16 w-full min-w-0 max-w-full px-3 py-2 shadow-xs transition-[color,box-shadow] outline-none md:text-sm",
29
+ "whitespace-pre-wrap break-words overflow-x-hidden",
29
30
  // Focus states
30
31
  "focus-visible:ring-d-ring/50 focus-visible:border-d-ring focus-visible:ring-[3px]",
31
- t.input.invalid,
32
- a
32
+ e.input.invalid,
33
+ s
33
34
  ),
34
35
  ...l
35
36
  }
@@ -37,5 +38,5 @@ function b({
37
38
  ] });
38
39
  }
39
40
  export {
40
- b as Textarea
41
+ h as Textarea
41
42
  };
package/dist/index.d.ts CHANGED
@@ -264,6 +264,7 @@ export declare function AppKanban<T = any>({ columns, initialTasks, onTaskMove,
264
264
  export declare type AppKanbanColumn = {
265
265
  id: string;
266
266
  label: string;
267
+ disabled?: boolean;
267
268
  };
268
269
 
269
270
  export declare type AppKanbanConfig<T = any> = {
@@ -386,6 +387,51 @@ export declare interface AppStepperProps extends Omit<StepperProps, "children">
386
387
  "data-testid"?: string;
387
388
  }
388
389
 
390
+ export declare function AppTimePicker(props: AppTimePickerProps): JSX.Element;
391
+
392
+ export declare interface AppTimePickerProps {
393
+ /** The currently selected time as a Date object (controlled). */
394
+ value?: Date;
395
+ /** Callback fired when the selected time changes. */
396
+ onChange?: (date: Date | undefined) => void;
397
+ /** Callback fired when the value is cleared. */
398
+ onClear?: () => void;
399
+ /** Label displayed above the trigger. */
400
+ label?: string | React.ReactNode;
401
+ /** Placeholder text shown when no time is selected. @default "Seleziona orario" */
402
+ placeholder?: string;
403
+ /** Disables the time picker. @default false */
404
+ disabled?: boolean;
405
+ /** Show a clear button to reset the selection. @default false */
406
+ clearable?: boolean;
407
+ /** Additional CSS classes applied to the trigger element. */
408
+ className?: string;
409
+ /** CSS classes for the label element. */
410
+ labelClassName?: string;
411
+ /** CSS classes for the outer wrapper `<div>`. */
412
+ wrpClassName?: string;
413
+ /** Size variant of the trigger. @default "default" */
414
+ size?: AppTimePickerSize;
415
+ /** Visual variant of the trigger. @default "default" */
416
+ variant?: AppTimePickerVariant;
417
+ /** Use UTC time instead of local time. @default false */
418
+ useUtc?: boolean;
419
+ /** Show seconds column in the time picker. @default false */
420
+ withSeconds?: boolean;
421
+ /** HTML `id` for the trigger element. */
422
+ id?: string;
423
+ /** `data-testid` attribute for E2E testing (e.g. Playwright). */
424
+ "data-testid"?: string;
425
+ /** Minimum selectable time. Hours/minutes/seconds before this are disabled. */
426
+ minTime?: Date;
427
+ /** Maximum selectable time. Hours/minutes/seconds after this are disabled. */
428
+ maxTime?: Date;
429
+ }
430
+
431
+ export declare type AppTimePickerSize = "sm" | "default" | "lg";
432
+
433
+ export declare type AppTimePickerVariant = "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
434
+
389
435
  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;
390
436
 
391
437
  export declare type AppTooltipAlign = TooltipContentProps_2["align"];
@@ -1554,39 +1600,82 @@ export declare interface DataTableState<TData = Record<string, unknown>> {
1554
1600
  export declare function DatePicker(props: DatePickerProps): JSX.Element;
1555
1601
 
1556
1602
  declare interface DatePickerBaseProps {
1603
+ /** Placeholder text shown when no date is selected. @default "Seleziona data" */
1557
1604
  placeholder?: string;
1605
+ /** Display format string (date-fns). @default "dd/MM/yyyy" (or "dd/MM/yyyy HH:mm" with showTime) */
1558
1606
  dateFormat?: string;
1607
+ /** Additional CSS classes applied to the trigger element. */
1559
1608
  className?: string;
1609
+ /**
1610
+ * @deprecated This prop is unused. Use `className` to style the trigger instead.
1611
+ */
1560
1612
  buttonVariant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
1613
+ /** Disables the date picker. @default false */
1561
1614
  disabled?: boolean;
1615
+ /** Size variant of the trigger. @default "default" */
1562
1616
  size?: "sm" | "default" | "lg";
1617
+ /**
1618
+ * @deprecated Use `minDate` instead.
1619
+ * Minimum selectable date.
1620
+ */
1563
1621
  firstDate?: Date;
1622
+ /**
1623
+ * @deprecated Use `maxDate` instead.
1624
+ * Maximum selectable date.
1625
+ */
1564
1626
  lastDate?: Date;
1627
+ /** Restrict selection to only these specific dates. All other dates will be disabled. */
1565
1628
  availableDates?: Date[];
1629
+ /** date-fns locale for formatting and calendar labels. @default it (Italian) */
1566
1630
  locale?: Partial<Locale>;
1631
+ /** Month to display when the calendar first opens (overridden by `value` if set). */
1567
1632
  initialCalendarMonth?: Date;
1633
+ /** Additional props forwarded to the underlying `<Calendar>` component. */
1568
1634
  customCalendarProps?: React_2.ComponentProps<typeof Calendar>;
1635
+ /** Label displayed above the trigger. */
1569
1636
  label?: string | React_2.ReactNode;
1637
+ /** CSS classes for the label element. */
1638
+ labelClassName?: string;
1639
+ /** CSS classes for the outer wrapper `<div>`. */
1570
1640
  wrpClassName?: string;
1641
+ /** HTML `id` for the trigger element. Auto-generated if omitted. */
1571
1642
  id?: string;
1643
+ /** `data-testid` attribute for E2E testing (e.g. Playwright). */
1572
1644
  "data-testid"?: string;
1645
+ /** Minimum selectable date. Dates before this are disabled. */
1573
1646
  minDate?: Date;
1647
+ /** Maximum selectable date. Dates after this are disabled. */
1574
1648
  maxDate?: Date;
1649
+ /** Number of months to display side-by-side. @default 1 */
1575
1650
  numberOfMonths?: number;
1651
+ /** Show a clear button to reset the selection. @default false */
1652
+ clearable?: boolean;
1653
+ /** Callback fired when the value is cleared via the clear button. */
1654
+ onClear?: () => void;
1576
1655
  }
1577
1656
 
1578
1657
  export declare type DatePickerProps = DatePickerSingleProps | DatePickerRangeProps;
1579
1658
 
1580
1659
  declare interface DatePickerRangeProps extends DatePickerBaseProps {
1660
+ /** Selection mode set to range. */
1581
1661
  mode: "range";
1662
+ /** The currently selected date range (controlled). */
1582
1663
  value?: DateRange;
1664
+ /** Callback fired when the selected range changes. */
1583
1665
  onChange?: (range: DateRange | undefined) => void;
1584
1666
  }
1585
1667
 
1586
1668
  declare interface DatePickerSingleProps extends DatePickerBaseProps {
1669
+ /** Selection mode. @default "single" */
1587
1670
  mode?: "single";
1671
+ /** The currently selected date (controlled). */
1588
1672
  value?: Date;
1673
+ /** Callback fired when the selected date changes. */
1589
1674
  onChange?: (date: Date | undefined) => void;
1675
+ /** Show time picker columns alongside the calendar. @default false */
1676
+ showTime?: boolean;
1677
+ /** Show seconds column in the time picker (requires `showTime`). @default false */
1678
+ withSeconds?: boolean;
1590
1679
  }
1591
1680
 
1592
1681
  /**
package/dist/index.js CHANGED
@@ -94,13 +94,14 @@ import { AppDialog as ti } from "./components/ui/app-dialog.js";
94
94
  import { AppKanban as ni } from "./components/ui/app-kanban.js";
95
95
  import { AppStepper as pi } from "./components/ui/app-stepper.js";
96
96
  import { AppTooltip as mi } from "./components/ui/app-tooltip.js";
97
- import { createActionColumn as xi, createBooleanColumn as di, createBooleanFilter as Ci, createComputedColumn as gi, createDateColumn as fi, createDateFilter as bi, createDateTimeColumn as si, createDateTimeFilter as ci, createDisplayColumn as Si, createFilterBadge as Mi, createFilterBadges as Ti, createInitialState as Di, createListFilter as Ai, createMultiSelectColumn as Fi, createNumberColumn as Ii, createNumberFilter as wi, createSingleSelectColumn as Pi, createSorting as hi, createStringColumn as vi, createStringFilter as Gi, getColumnIds as Bi, isValidOperatorForType as Li, pinColumns as Ri, toSelectOptions as ki, toSelectOptionsFromObjects as Hi, updateColumnListOptions as yi } from "./components/ui/tables/data-table/data-table.utils.js";
98
- import { useAudioRecording as Oi } from "./hooks/use-audio-recording.js";
99
- import { useAutoScroll as zi } from "./hooks/use-auto-scroll.js";
100
- import { useAutosizeTextArea as ji } from "./hooks/use-autosize-textarea.js";
101
- import { useCopyToClipboard as Ui } from "./hooks/use-copy-to-clipboard.js";
102
- import { useDebounce as qi } from "./hooks/use-debounce.js";
103
- import { useIsMobile as Qi } from "./hooks/use-mobile.js";
97
+ import { AppTimePicker as xi } from "./components/ui/app-time-picker.js";
98
+ import { createActionColumn as Ci, createBooleanColumn as gi, createBooleanFilter as fi, createComputedColumn as bi, createDateColumn as si, createDateFilter as ci, createDateTimeColumn as Si, createDateTimeFilter as Mi, createDisplayColumn as Ti, createFilterBadge as Di, createFilterBadges as Ai, createInitialState as Fi, createListFilter as Ii, createMultiSelectColumn as wi, createNumberColumn as Pi, createNumberFilter as hi, createSingleSelectColumn as vi, createSorting as Gi, createStringColumn as Bi, createStringFilter as Li, getColumnIds as Ri, isValidOperatorForType as ki, pinColumns as Hi, toSelectOptions as yi, toSelectOptionsFromObjects as Ni, updateColumnListOptions as Oi } from "./components/ui/tables/data-table/data-table.utils.js";
99
+ import { useAudioRecording as zi } from "./hooks/use-audio-recording.js";
100
+ import { useAutoScroll as ji } from "./hooks/use-auto-scroll.js";
101
+ import { useAutosizeTextArea as Ui } from "./hooks/use-autosize-textarea.js";
102
+ import { useCopyToClipboard as qi } from "./hooks/use-copy-to-clipboard.js";
103
+ import { useDebounce as Qi } from "./hooks/use-debounce.js";
104
+ import { useIsMobile as Yi } from "./hooks/use-mobile.js";
104
105
  export {
105
106
  ne as Accordion,
106
107
  ie as AccordionContent,
@@ -128,6 +129,7 @@ export {
128
129
  sa as AppSelect,
129
130
  Sa as AppSidebar,
130
131
  pi as AppStepper,
132
+ xi as AppTimePicker,
131
133
  mi as AppTooltip,
132
134
  a as AspectRatio,
133
135
  Fe as AsyncSelect,
@@ -380,48 +382,48 @@ export {
380
382
  g as buttonVariants,
381
383
  Yn as cn,
382
384
  va as confirm,
383
- xi as createActionColumn,
384
- di as createBooleanColumn,
385
- Ci as createBooleanFilter,
386
- gi as createComputedColumn,
387
- fi as createDateColumn,
388
- bi as createDateFilter,
389
- si as createDateTimeColumn,
390
- ci as createDateTimeFilter,
391
- Si as createDisplayColumn,
392
- Mi as createFilterBadge,
393
- Ti as createFilterBadges,
394
- Di as createInitialState,
395
- Ai as createListFilter,
396
- Fi as createMultiSelectColumn,
397
- Ii as createNumberColumn,
398
- wi as createNumberFilter,
399
- Pi as createSingleSelectColumn,
400
- hi as createSorting,
401
- vi as createStringColumn,
402
- Gi as createStringFilter,
385
+ Ci as createActionColumn,
386
+ gi as createBooleanColumn,
387
+ fi as createBooleanFilter,
388
+ bi as createComputedColumn,
389
+ si as createDateColumn,
390
+ ci as createDateFilter,
391
+ Si as createDateTimeColumn,
392
+ Mi as createDateTimeFilter,
393
+ Ti as createDisplayColumn,
394
+ Di as createFilterBadge,
395
+ Ai as createFilterBadges,
396
+ Fi as createInitialState,
397
+ Ii as createListFilter,
398
+ wi as createMultiSelectColumn,
399
+ Pi as createNumberColumn,
400
+ hi as createNumberFilter,
401
+ vi as createSingleSelectColumn,
402
+ Gi as createSorting,
403
+ Bi as createStringColumn,
404
+ Li as createStringFilter,
403
405
  Zn as downloadFile,
404
- Bi as getColumnIds,
406
+ Ri as getColumnIds,
405
407
  _n as hexContrast,
406
408
  $n as hexToRgba,
407
- Li as isValidOperatorForType,
408
- Ri as pinColumns,
409
+ ki as isValidOperatorForType,
410
+ Hi as pinColumns,
409
411
  ei as previewFile,
410
412
  La as previewFileModal,
411
413
  Ra as safePreviewFileModal,
412
414
  ri as stringToHexColor,
413
- ki as toSelectOptions,
414
- Hi as toSelectOptionsFromObjects,
415
+ yi as toSelectOptions,
416
+ Ni as toSelectOptionsFromObjects,
415
417
  Un as toast,
416
418
  Y as toggleVariants,
417
- yi as updateColumnListOptions,
418
- Oi as useAudioRecording,
419
- zi as useAutoScroll,
420
- ji as useAutosizeTextArea,
421
- Ui as useCopyToClipboard,
422
- qi as useDebounce,
419
+ Oi as updateColumnListOptions,
420
+ zi as useAudioRecording,
421
+ ji as useAutoScroll,
422
+ Ui as useAutosizeTextArea,
423
+ qi as useCopyToClipboard,
424
+ Qi as useDebounce,
423
425
  pa as useEditorModal,
424
426
  Hr as useFormField,
425
- Qi as useIsMobile,
427
+ Yi as useIsMobile,
426
428
  Ln as useSidebar
427
429
  };