@pixpilot/shadcn-ui 1.34.0 → 1.35.0

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/Button.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
2
2
  import { Button, Tooltip, TooltipContent, TooltipTrigger, buttonVariants } from "@pixpilot/shadcn";
3
3
  import React from "react";
4
4
  import { VariantProps } from "class-variance-authority";
@@ -27,7 +27,7 @@ interface ButtonProps extends React.ComponentProps<typeof Button>, VariantProps<
27
27
  }
28
28
  declare function Button$1(props: ButtonProps & {
29
29
  ref?: React.Ref<HTMLButtonElement>;
30
- }): react_jsx_runtime0.JSX.Element;
30
+ }): react_jsx_runtime1.JSX.Element;
31
31
  declare namespace Button$1 {
32
32
  var displayName: string;
33
33
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
  import { Button, Tooltip, TooltipContent, TooltipTrigger, buttonVariants } from "@pixpilot/shadcn";
3
3
  import React from "react";
4
4
  import { VariantProps } from "class-variance-authority";
@@ -50,7 +50,7 @@ interface ButtonExtendedProps extends React.ComponentProps<typeof Button>, Varia
50
50
  }
51
51
  declare function ButtonExtended(props: ButtonExtendedProps & {
52
52
  ref?: React.Ref<HTMLButtonElement>;
53
- }): react_jsx_runtime1.JSX.Element;
53
+ }): react_jsx_runtime0.JSX.Element;
54
54
  declare namespace ButtonExtended {
55
55
  var displayName: string;
56
56
  }
@@ -13,25 +13,43 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
13
13
 
14
14
  //#region src/DatePicker.tsx
15
15
  function DatePicker(props) {
16
- const { id, value, onChange, placeholder = "Pick a date",...calendarProps } = props;
17
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Popover, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.PopoverTrigger, {
18
- asChild: true,
19
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Button, {
20
- id,
21
- variant: "outline",
22
- className: (0, __pixpilot_shadcn.cn)("w-full justify-start text-left font-normal", !value && "text-muted-foreground"),
23
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CalendarIcon, { className: "mr-2 h-4 w-4" }), value ? value.toLocaleDateString() : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: placeholder })]
24
- })
25
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.PopoverContent, {
26
- className: "w-auto p-0",
27
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Calendar, {
28
- mode: "single",
29
- selected: value,
30
- onSelect: onChange,
31
- initialFocus: true,
32
- ...calendarProps
33
- })
34
- })] });
16
+ const { id, value, onChange, placeholder = "Pick a date", showClearButton = true,...calendarProps } = props;
17
+ const [open, setOpen] = react.default.useState(false);
18
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
19
+ className: "relative flex items-center",
20
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Popover, {
21
+ open,
22
+ onOpenChange: setOpen,
23
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.PopoverTrigger, {
24
+ asChild: true,
25
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Button, {
26
+ id,
27
+ variant: "outline",
28
+ className: (0, __pixpilot_shadcn.cn)("w-full justify-start text-left font-normal", !value && "text-muted-foreground", showClearButton && value && "pr-8"),
29
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CalendarIcon, { className: "mr-2 h-4 w-4" }), value ? value.toLocaleDateString() : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: placeholder })]
30
+ })
31
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.PopoverContent, {
32
+ className: "w-auto p-0",
33
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Calendar, {
34
+ mode: "single",
35
+ selected: value,
36
+ onSelect: (date) => {
37
+ onChange?.(date);
38
+ setOpen(false);
39
+ },
40
+ initialFocus: true,
41
+ ...calendarProps
42
+ })
43
+ })]
44
+ }), showClearButton && value && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
45
+ type: "button",
46
+ "data-slot": "clear-button",
47
+ onClick: () => onChange?.(void 0),
48
+ className: "absolute right-2 text-muted-foreground hover:text-foreground",
49
+ "aria-label": "Clear date",
50
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.XIcon, { className: "h-4 w-4" })
51
+ })]
52
+ });
35
53
  }
36
54
  DatePicker.displayName = "DatePicker";
37
55
 
@@ -8,6 +8,7 @@ type DatePickerProps = {
8
8
  value?: Date;
9
9
  onChange?: (date: Date | undefined) => void;
10
10
  placeholder?: string;
11
+ showClearButton?: boolean;
11
12
  } & Omit<ComponentProps<typeof Calendar>, 'selected' | 'onSelect' | 'mode'>;
12
13
  declare function DatePicker(props: DatePickerProps): react_jsx_runtime6.JSX.Element;
13
14
  declare namespace DatePicker {
@@ -8,6 +8,7 @@ type DatePickerProps = {
8
8
  value?: Date;
9
9
  onChange?: (date: Date | undefined) => void;
10
10
  placeholder?: string;
11
+ showClearButton?: boolean;
11
12
  } & Omit<ComponentProps<typeof Calendar>, 'selected' | 'onSelect' | 'mode'>;
12
13
  declare function DatePicker(props: DatePickerProps): react_jsx_runtime6.JSX.Element;
13
14
  declare namespace DatePicker {
@@ -2,31 +2,49 @@
2
2
 
3
3
 
4
4
  import { Button, Calendar, Popover, PopoverContent, PopoverTrigger, cn } from "@pixpilot/shadcn";
5
- import { CalendarIcon } from "lucide-react";
5
+ import { CalendarIcon, XIcon } from "lucide-react";
6
6
  import React from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
 
9
9
  //#region src/DatePicker.tsx
10
10
  function DatePicker(props) {
11
- const { id, value, onChange, placeholder = "Pick a date",...calendarProps } = props;
12
- return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
13
- asChild: true,
14
- children: /* @__PURE__ */ jsxs(Button, {
15
- id,
16
- variant: "outline",
17
- className: cn("w-full justify-start text-left font-normal", !value && "text-muted-foreground"),
18
- children: [/* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }), value ? value.toLocaleDateString() : /* @__PURE__ */ jsx("span", { children: placeholder })]
19
- })
20
- }), /* @__PURE__ */ jsx(PopoverContent, {
21
- className: "w-auto p-0",
22
- children: /* @__PURE__ */ jsx(Calendar, {
23
- mode: "single",
24
- selected: value,
25
- onSelect: onChange,
26
- initialFocus: true,
27
- ...calendarProps
28
- })
29
- })] });
11
+ const { id, value, onChange, placeholder = "Pick a date", showClearButton = true,...calendarProps } = props;
12
+ const [open, setOpen] = React.useState(false);
13
+ return /* @__PURE__ */ jsxs("div", {
14
+ className: "relative flex items-center",
15
+ children: [/* @__PURE__ */ jsxs(Popover, {
16
+ open,
17
+ onOpenChange: setOpen,
18
+ children: [/* @__PURE__ */ jsx(PopoverTrigger, {
19
+ asChild: true,
20
+ children: /* @__PURE__ */ jsxs(Button, {
21
+ id,
22
+ variant: "outline",
23
+ className: cn("w-full justify-start text-left font-normal", !value && "text-muted-foreground", showClearButton && value && "pr-8"),
24
+ children: [/* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }), value ? value.toLocaleDateString() : /* @__PURE__ */ jsx("span", { children: placeholder })]
25
+ })
26
+ }), /* @__PURE__ */ jsx(PopoverContent, {
27
+ className: "w-auto p-0",
28
+ children: /* @__PURE__ */ jsx(Calendar, {
29
+ mode: "single",
30
+ selected: value,
31
+ onSelect: (date) => {
32
+ onChange?.(date);
33
+ setOpen(false);
34
+ },
35
+ initialFocus: true,
36
+ ...calendarProps
37
+ })
38
+ })]
39
+ }), showClearButton && value && /* @__PURE__ */ jsx("button", {
40
+ type: "button",
41
+ "data-slot": "clear-button",
42
+ onClick: () => onChange?.(void 0),
43
+ className: "absolute right-2 text-muted-foreground hover:text-foreground",
44
+ "aria-label": "Clear date",
45
+ children: /* @__PURE__ */ jsx(XIcon, { className: "h-4 w-4" })
46
+ })]
47
+ });
30
48
  }
31
49
  DatePicker.displayName = "DatePicker";
32
50
 
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime11 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
2
2
  import { DialogClose, DialogContent } from "@pixpilot/shadcn";
3
3
  import * as React$1 from "react";
4
4
 
@@ -10,18 +10,18 @@ declare const DialogContent$1: React$1.ForwardRefExoticComponent<DialogContentPr
10
10
  declare function DialogHeader({
11
11
  className,
12
12
  ...props
13
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime11.JSX.Element;
13
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime10.JSX.Element;
14
14
  declare function DialogBody({
15
15
  className,
16
16
  ...props
17
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime11.JSX.Element;
17
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime10.JSX.Element;
18
18
  declare function DialogFooter({
19
19
  className,
20
20
  ...props
21
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime11.JSX.Element;
21
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime10.JSX.Element;
22
22
  declare function DialogClose$1({
23
23
  className,
24
24
  ...props
25
- }: React$1.ComponentPropsWithoutRef<typeof DialogClose>): react_jsx_runtime11.JSX.Element;
25
+ }: React$1.ComponentPropsWithoutRef<typeof DialogClose>): react_jsx_runtime10.JSX.Element;
26
26
  //#endregion
27
27
  export { DialogBody, DialogClose$1 as DialogClose, DialogContent$1 as DialogContent, DialogContentProps, DialogFooter, DialogHeader };
@@ -1,7 +1,7 @@
1
1
  import { FileUploadProps } from "./types/index.cjs";
2
- import * as react_jsx_runtime10 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime17 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload/FileUpload.d.ts
5
- declare function FileUpload(props: FileUploadProps): react_jsx_runtime10.JSX.Element;
5
+ declare function FileUpload(props: FileUploadProps): react_jsx_runtime17.JSX.Element;
6
6
  //#endregion
7
7
  export { FileUpload };
@@ -1,11 +1,11 @@
1
1
  import { FileUploadRootProps } from "./types.cjs";
2
- import * as react_jsx_runtime17 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload-root/FileUploadRoot.d.ts
5
5
  /**
6
6
  * FileUploadInline - An inline file upload component using FileUpload primitives
7
7
  */
8
- declare function FileUploadRoot(props: FileUploadRootProps): react_jsx_runtime17.JSX.Element;
8
+ declare function FileUploadRoot(props: FileUploadRootProps): react_jsx_runtime16.JSX.Element;
9
9
  declare namespace FileUploadRoot {
10
10
  var displayName: string;
11
11
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime16 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
2
2
  import { InputProps } from "@pixpilot/shadcn";
3
3
  import * as React$1 from "react";
4
4
 
@@ -10,6 +10,6 @@ type InputProps$1 = InputProps & {
10
10
  prefixClassName?: string;
11
11
  suffixClassName?: string;
12
12
  };
13
- declare function Input(props: InputProps$1): react_jsx_runtime16.JSX.Element;
13
+ declare function Input(props: InputProps$1): react_jsx_runtime14.JSX.Element;
14
14
  //#endregion
15
15
  export { Input, InputProps$1 as InputProps };
@@ -1,5 +1,5 @@
1
1
  import { CommandOptionListItem } from "../CommandOptionList.js";
2
- import * as react_jsx_runtime19 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime18 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/tags-input/TagsInput.d.ts
5
5
  interface TagsInputProps {
@@ -59,6 +59,6 @@ declare function TagsInput({
59
59
  addOnTab,
60
60
  onValidate,
61
61
  addButtonVisibility
62
- }: TagsInputProps): react_jsx_runtime19.JSX.Element;
62
+ }: TagsInputProps): react_jsx_runtime18.JSX.Element;
63
63
  //#endregion
64
64
  export { TagsInput, TagsInputProps };
@@ -1,5 +1,5 @@
1
1
  import { ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, Ref } from "react";
2
- import * as react_jsx_runtime18 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime19 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/tags-input/TagsInputInline.d.ts
5
5
  interface TagsInputInlineItem {
@@ -77,6 +77,6 @@ declare function TagsInputInline({
77
77
  canAddCurrentValue,
78
78
  onAddCurrentInput,
79
79
  showClear
80
- }: TagsInputInlineProps): react_jsx_runtime18.JSX.Element;
80
+ }: TagsInputInlineProps): react_jsx_runtime19.JSX.Element;
81
81
  //#endregion
82
82
  export { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime21 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime20 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeDropdown.d.ts
4
4
  interface ThemeModeDropdownProps {
@@ -18,7 +18,7 @@ interface ThemeModeDropdownProps {
18
18
  * Provides Light / Dark / System options.
19
19
  * Pure component - requires themeValue and onChange props.
20
20
  */
21
- declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime21.JSX.Element;
21
+ declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime20.JSX.Element;
22
22
  declare namespace ThemeModeDropdown {
23
23
  var displayName: string;
24
24
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime22 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime21 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeSwitchInside.d.ts
4
4
  type ThemeModeSwitchInsideSize = 'sm' | 'md' | 'lg';
@@ -26,7 +26,7 @@ interface ThemeModeSwitchInsideProps {
26
26
  * Icons are embedded within the switch control.
27
27
  * Pure component - requires value and onChange props.
28
28
  */
29
- declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime22.JSX.Element;
29
+ declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime21.JSX.Element;
30
30
  declare namespace ThemeModeSwitchInside {
31
31
  var displayName: string;
32
32
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime23 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime22 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeSwitchOutside.d.ts
4
4
  interface ThemeModeSwitchOutsideProps {
@@ -23,7 +23,7 @@ interface ThemeModeSwitchOutsideProps {
23
23
  * Icons flank the switch control on either side.
24
24
  * Pure component - requires value and onChange props.
25
25
  */
26
- declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime23.JSX.Element;
26
+ declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime22.JSX.Element;
27
27
  declare namespace ThemeModeSwitchOutside {
28
28
  var displayName: string;
29
29
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime20 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime23 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeToggleButton.d.ts
4
4
  interface ThemeModeToggleButtonProps {
@@ -14,7 +14,7 @@ interface ThemeModeToggleButtonProps {
14
14
  * Light/Dark toggle button.
15
15
  * Pure component - toggles between light and dark.
16
16
  */
17
- declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime20.JSX.Element;
17
+ declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime23.JSX.Element;
18
18
  declare namespace ThemeModeToggleButton {
19
19
  var displayName: string;
20
20
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/shadcn-ui",
3
3
  "type": "module",
4
- "version": "1.34.0",
4
+ "version": "1.35.0",
5
5
  "description": "Custom UI components and utilities built with shadcn/ui.",
6
6
  "author": "m.doaie <m.doaie@hotmail.com>",
7
7
  "license": "MIT",
@@ -65,11 +65,11 @@
65
65
  "tsdown": "^0.15.12",
66
66
  "typescript": "^5.9.3",
67
67
  "@internal/eslint-config": "0.3.0",
68
- "@internal/hooks": "0.0.0",
69
68
  "@internal/prettier-config": "0.0.1",
70
69
  "@internal/tsconfig": "0.1.0",
71
70
  "@internal/tsdown-config": "0.1.0",
72
- "@internal/vitest-config": "0.1.0"
71
+ "@internal/vitest-config": "0.1.0",
72
+ "@internal/hooks": "0.0.0"
73
73
  },
74
74
  "prettier": "@internal/prettier-config",
75
75
  "scripts": {