@pixpilot/shadcn-ui 3.6.1 → 3.8.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.
Files changed (41) hide show
  1. package/dist/absolute-fill/AbsoluteFill.d.ts +2 -2
  2. package/dist/button/Button.d.ts +2 -2
  3. package/dist/button-extended/ButtonExtended.d.cts +2 -2
  4. package/dist/button-extended/ButtonExtended.d.ts +2 -2
  5. package/dist/card/Card.d.cts +3 -3
  6. package/dist/card/Card.d.ts +3 -3
  7. package/dist/color-select/ColorSelect.d.cts +2 -2
  8. package/dist/color-select/ColorSelect.d.ts +2 -2
  9. package/dist/content-card/ContentCard.d.cts +2 -2
  10. package/dist/content-card/ContentCard.d.ts +2 -2
  11. package/dist/date-picker/DatePicker.d.cts +2 -2
  12. package/dist/date-picker/DatePicker.d.ts +2 -2
  13. package/dist/dialog/Dialog.cjs +10 -12
  14. package/dist/dialog/Dialog.d.cts +5 -14
  15. package/dist/dialog/Dialog.d.ts +5 -14
  16. package/dist/dialog/Dialog.js +10 -12
  17. package/dist/drawer/Drawer.cjs +7 -9
  18. package/dist/drawer/Drawer.d.cts +6 -9
  19. package/dist/drawer/Drawer.d.ts +0 -3
  20. package/dist/drawer/Drawer.js +7 -9
  21. package/dist/file-upload/FileUpload.d.cts +2 -2
  22. package/dist/file-upload-inline/FileUploadInline.d.cts +2 -2
  23. package/dist/file-upload-root/FileUploadRoot.d.cts +2 -2
  24. package/dist/input/Input.d.cts +2 -2
  25. package/dist/input/Input.d.ts +2 -2
  26. package/dist/overlay-panel/OverlayPanel.cjs +31 -0
  27. package/dist/overlay-panel/OverlayPanel.js +25 -0
  28. package/dist/rating/Rating.d.cts +4 -4
  29. package/dist/rating/Rating.d.ts +4 -4
  30. package/dist/rich-text-editor/RichTextEditor.cjs +33 -14
  31. package/dist/rich-text-editor/RichTextEditor.d.cts +12 -0
  32. package/dist/rich-text-editor/RichTextEditor.d.ts +12 -0
  33. package/dist/rich-text-editor/RichTextEditor.js +32 -14
  34. package/dist/rich-text-editor/mcp.js +9 -1
  35. package/dist/select/Select.d.cts +2 -2
  36. package/dist/select/Select.d.ts +2 -2
  37. package/dist/tags-input/TagsInputInline.d.ts +2 -2
  38. package/dist/theme-toggle/ThemeModeDropdown.d.cts +2 -2
  39. package/dist/theme-toggle/ThemeModeSwitchOutside.d.cts +2 -2
  40. package/dist/theme-toggle/ThemeModeToggleButton.d.cts +2 -2
  41. package/package.json +4 -3
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/absolute-fill/AbsoluteFill.d.ts
5
5
 
@@ -10,7 +10,7 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
10
10
  */
11
11
  declare function AbsoluteFill(props: React.HTMLAttributes<HTMLDivElement> & {
12
12
  ref?: React.Ref<HTMLDivElement>;
13
- }): react_jsx_runtime0.JSX.Element;
13
+ }): react_jsx_runtime1.JSX.Element;
14
14
  declare namespace AbsoluteFill {
15
15
  var displayName: string;
16
16
  }
@@ -1,6 +1,6 @@
1
1
  import { Button, Tooltip, TooltipContent, TooltipTrigger, buttonVariants } from "@pixpilot/shadcn";
2
2
  import React from "react";
3
- import * as react_jsx_runtime1 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
 
6
6
  //#region src/button/Button.d.ts
@@ -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_runtime1.JSX.Element;
30
+ }): react_jsx_runtime0.JSX.Element;
31
31
  declare namespace Button$1 {
32
32
  var displayName: string;
33
33
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 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";
@@ -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_runtime9.JSX.Element;
53
+ }): react_jsx_runtime1.JSX.Element;
54
54
  declare namespace ButtonExtended {
55
55
  var displayName: string;
56
56
  }
@@ -1,6 +1,6 @@
1
1
  import { Button, Tooltip, TooltipContent, TooltipTrigger, buttonVariants } from "@pixpilot/shadcn";
2
2
  import React from "react";
3
- import * as react_jsx_runtime2 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
 
6
6
  //#region src/button-extended/ButtonExtended.d.ts
@@ -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_runtime2.JSX.Element;
53
+ }): react_jsx_runtime3.JSX.Element;
54
54
  declare namespace ButtonExtended {
55
55
  var displayName: string;
56
56
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
2
2
  import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@pixpilot/shadcn";
3
3
  import React from "react";
4
4
 
@@ -6,10 +6,10 @@ import React from "react";
6
6
  declare function CardTitle$1({
7
7
  className,
8
8
  ...props
9
- }: React.ComponentProps<typeof CardTitle>): react_jsx_runtime10.JSX.Element;
9
+ }: React.ComponentProps<typeof CardTitle>): react_jsx_runtime3.JSX.Element;
10
10
  declare function CardHeader$1({
11
11
  className,
12
12
  ...props
13
- }: React.ComponentProps<typeof CardHeader>): react_jsx_runtime10.JSX.Element;
13
+ }: React.ComponentProps<typeof CardHeader>): react_jsx_runtime3.JSX.Element;
14
14
  //#endregion
15
15
  export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader$1 as CardHeader, CardTitle$1 as CardTitle };
@@ -1,15 +1,15 @@
1
1
  import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@pixpilot/shadcn";
2
2
  import React from "react";
3
- import * as react_jsx_runtime3 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/card/Card.d.ts
6
6
  declare function CardTitle$1({
7
7
  className,
8
8
  ...props
9
- }: React.ComponentProps<typeof CardTitle>): react_jsx_runtime3.JSX.Element;
9
+ }: React.ComponentProps<typeof CardTitle>): react_jsx_runtime4.JSX.Element;
10
10
  declare function CardHeader$1({
11
11
  className,
12
12
  ...props
13
- }: React.ComponentProps<typeof CardHeader>): react_jsx_runtime3.JSX.Element;
13
+ }: React.ComponentProps<typeof CardHeader>): react_jsx_runtime4.JSX.Element;
14
14
  //#endregion
15
15
  export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader$1 as CardHeader, CardTitle$1 as CardTitle };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
2
2
  import { Select, SelectContent } from "@pixpilot/shadcn";
3
3
  import React, { ComponentProps } from "react";
4
4
 
@@ -17,6 +17,6 @@ type BaseColorSelectProps = {
17
17
  keyboardMode?: 'cycle' | 'dropdown';
18
18
  className?: string;
19
19
  } & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children'>;
20
- declare function ColorSelect(props: BaseColorSelectProps): react_jsx_runtime1.JSX.Element;
20
+ declare function ColorSelect(props: BaseColorSelectProps): react_jsx_runtime6.JSX.Element;
21
21
  //#endregion
22
22
  export { BaseColorSelectProps, ColorSelect, ColorSelectOption };
@@ -1,6 +1,6 @@
1
1
  import { Select, SelectContent } from "@pixpilot/shadcn";
2
2
  import React, { ComponentProps } from "react";
3
- import * as react_jsx_runtime5 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/color-select/ColorSelect.d.ts
6
6
  interface ColorSelectOption {
@@ -17,6 +17,6 @@ type BaseColorSelectProps = {
17
17
  keyboardMode?: 'cycle' | 'dropdown';
18
18
  className?: string;
19
19
  } & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children'>;
20
- declare function ColorSelect(props: BaseColorSelectProps): react_jsx_runtime5.JSX.Element;
20
+ declare function ColorSelect(props: BaseColorSelectProps): react_jsx_runtime6.JSX.Element;
21
21
  //#endregion
22
22
  export { BaseColorSelectProps, ColorSelect, ColorSelectOption };
@@ -1,6 +1,6 @@
1
1
  import { Card } from "../card/Card.cjs";
2
2
  import "../card/index.cjs";
3
- import * as react_jsx_runtime16 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
4
4
  import React, { ReactNode } from "react";
5
5
 
6
6
  //#region src/content-card/ContentCard.d.ts
@@ -9,7 +9,7 @@ interface SectionCardProps extends React.ComponentProps<typeof Card> {
9
9
  children: ReactNode;
10
10
  marginBottom?: boolean;
11
11
  }
12
- declare function ContentCard(props: SectionCardProps): react_jsx_runtime16.JSX.Element;
12
+ declare function ContentCard(props: SectionCardProps): react_jsx_runtime11.JSX.Element;
13
13
  declare namespace ContentCard {
14
14
  var displayName: string;
15
15
  }
@@ -1,7 +1,7 @@
1
1
  import { Card } from "../card/Card.js";
2
2
  import "../card/index.js";
3
3
  import React, { ReactNode } from "react";
4
- import * as react_jsx_runtime6 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
5
5
 
6
6
  //#region src/content-card/ContentCard.d.ts
7
7
  interface SectionCardProps extends React.ComponentProps<typeof Card> {
@@ -9,7 +9,7 @@ interface SectionCardProps extends React.ComponentProps<typeof Card> {
9
9
  children: ReactNode;
10
10
  marginBottom?: boolean;
11
11
  }
12
- declare function ContentCard(props: SectionCardProps): react_jsx_runtime6.JSX.Element;
12
+ declare function ContentCard(props: SectionCardProps): react_jsx_runtime2.JSX.Element;
13
13
  declare namespace ContentCard {
14
14
  var displayName: string;
15
15
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime21 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
2
2
  import { Calendar } from "@pixpilot/shadcn";
3
3
  import { ComponentProps } from "react";
4
4
 
@@ -10,7 +10,7 @@ type DatePickerProps = {
10
10
  placeholder?: string;
11
11
  showClearButton?: boolean;
12
12
  } & Omit<ComponentProps<typeof Calendar>, 'selected' | 'onSelect' | 'mode'>;
13
- declare function DatePicker(props: DatePickerProps): react_jsx_runtime21.JSX.Element;
13
+ declare function DatePicker(props: DatePickerProps): react_jsx_runtime12.JSX.Element;
14
14
  declare namespace DatePicker {
15
15
  var displayName: string;
16
16
  }
@@ -1,6 +1,6 @@
1
1
  import { Calendar } from "@pixpilot/shadcn";
2
2
  import { ComponentProps } from "react";
3
- import * as react_jsx_runtime11 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/date-picker/DatePicker.d.ts
6
6
  type DatePickerProps = {
@@ -10,7 +10,7 @@ type DatePickerProps = {
10
10
  placeholder?: string;
11
11
  showClearButton?: boolean;
12
12
  } & Omit<ComponentProps<typeof Calendar>, 'selected' | 'onSelect' | 'mode'>;
13
- declare function DatePicker(props: DatePickerProps): react_jsx_runtime11.JSX.Element;
13
+ declare function DatePicker(props: DatePickerProps): react_jsx_runtime7.JSX.Element;
14
14
  declare namespace DatePicker {
15
15
  var displayName: string;
16
16
  }
@@ -1,4 +1,5 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_OverlayPanel = require('../overlay-panel/OverlayPanel.cjs');
2
3
  let __pixpilot_shadcn = require("@pixpilot/shadcn");
3
4
  __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
4
5
  let react = require("react");
@@ -13,24 +14,21 @@ const DialogContent = react.forwardRef(({ className, fullscreen = false,...props
13
14
  ...props
14
15
  }));
15
16
  DialogContent.displayName = "DialogContent";
16
- function DialogHeader({ className,...props }) {
17
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
18
- "data-slot": "header",
19
- className: (0, __pixpilot_shadcn.cn)("flex shrink-0 flex-col gap-2.5", className),
17
+ function DialogHeader(props) {
18
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OverlayPanel.OverlayPanelHeader, {
19
+ "data-slot": "dialog-header",
20
20
  ...props
21
21
  });
22
22
  }
23
- function DialogBody({ className,...props }) {
24
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
25
- "data-slot": "body",
26
- className: (0, __pixpilot_shadcn.cn)("min-h-0 flex-1 overflow-auto -mx-6 px-6", className),
23
+ function DialogBody(props) {
24
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OverlayPanel.OverlayPanelBody, {
25
+ "data-slot": "dialog-body",
27
26
  ...props
28
27
  });
29
28
  }
30
- function DialogFooter({ className,...props }) {
31
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
32
- "data-slot": "footer",
33
- className: (0, __pixpilot_shadcn.cn)("flex shrink-0 justify-end space-x-2", className),
29
+ function DialogFooter(props) {
30
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OverlayPanel.OverlayPanelFooter, {
31
+ "data-slot": "dialog-footer",
34
32
  ...props
35
33
  });
36
34
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime17 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
2
2
  import { DialogClose, DialogContent } from "@pixpilot/shadcn";
3
3
  import * as React$1 from "react";
4
4
 
@@ -7,21 +7,12 @@ interface DialogContentProps extends React$1.ComponentPropsWithoutRef<typeof Dia
7
7
  fullscreen?: boolean;
8
8
  }
9
9
  declare const DialogContent$1: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
10
- declare function DialogHeader({
11
- className,
12
- ...props
13
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime17.JSX.Element;
14
- declare function DialogBody({
15
- className,
16
- ...props
17
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime17.JSX.Element;
18
- declare function DialogFooter({
19
- className,
20
- ...props
21
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime17.JSX.Element;
10
+ declare function DialogHeader(props: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime7.JSX.Element;
11
+ declare function DialogBody(props: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime7.JSX.Element;
12
+ declare function DialogFooter(props: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime7.JSX.Element;
22
13
  declare function DialogClose$1({
23
14
  className,
24
15
  ...props
25
- }: React$1.ComponentPropsWithoutRef<typeof DialogClose>): react_jsx_runtime17.JSX.Element;
16
+ }: React$1.ComponentPropsWithoutRef<typeof DialogClose>): react_jsx_runtime7.JSX.Element;
26
17
  //#endregion
27
18
  export { DialogBody, DialogClose$1 as DialogClose, DialogContent$1 as DialogContent, DialogContentProps, DialogFooter, DialogHeader };
@@ -1,27 +1,18 @@
1
1
  import { DialogClose, DialogContent } from "@pixpilot/shadcn";
2
2
  import * as React$1 from "react";
3
- import * as react_jsx_runtime7 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/dialog/Dialog.d.ts
6
6
  interface DialogContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogContent> {
7
7
  fullscreen?: boolean;
8
8
  }
9
9
  declare const DialogContent$1: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
10
- declare function DialogHeader$1({
11
- className,
12
- ...props
13
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime7.JSX.Element;
14
- declare function DialogBody({
15
- className,
16
- ...props
17
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime7.JSX.Element;
18
- declare function DialogFooter$1({
19
- className,
20
- ...props
21
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime7.JSX.Element;
10
+ declare function DialogHeader$1(props: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
11
+ declare function DialogBody(props: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
12
+ declare function DialogFooter$1(props: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
22
13
  declare function DialogClose$1({
23
14
  className,
24
15
  ...props
25
- }: React$1.ComponentPropsWithoutRef<typeof DialogClose>): react_jsx_runtime7.JSX.Element;
16
+ }: React$1.ComponentPropsWithoutRef<typeof DialogClose>): react_jsx_runtime8.JSX.Element;
26
17
  //#endregion
27
18
  export { DialogBody, DialogClose$1 as DialogClose, DialogContent$1 as DialogContent, DialogContentProps, DialogFooter$1 as DialogFooter, DialogHeader$1 as DialogHeader };
@@ -1,3 +1,4 @@
1
+ import { OverlayPanelBody, OverlayPanelFooter, OverlayPanelHeader } from "../overlay-panel/OverlayPanel.js";
1
2
  import { DialogClose, DialogContent, cn } from "@pixpilot/shadcn";
2
3
  import * as React$1 from "react";
3
4
  import { jsx } from "react/jsx-runtime";
@@ -9,24 +10,21 @@ const DialogContent$1 = React$1.forwardRef(({ className, fullscreen = false,...p
9
10
  ...props
10
11
  }));
11
12
  DialogContent$1.displayName = "DialogContent";
12
- function DialogHeader$1({ className,...props }) {
13
- return /* @__PURE__ */ jsx("div", {
14
- "data-slot": "header",
15
- className: cn("flex shrink-0 flex-col gap-2.5", className),
13
+ function DialogHeader$1(props) {
14
+ return /* @__PURE__ */ jsx(OverlayPanelHeader, {
15
+ "data-slot": "dialog-header",
16
16
  ...props
17
17
  });
18
18
  }
19
- function DialogBody({ className,...props }) {
20
- return /* @__PURE__ */ jsx("div", {
21
- "data-slot": "body",
22
- className: cn("min-h-0 flex-1 overflow-auto -mx-6 px-6", className),
19
+ function DialogBody(props) {
20
+ return /* @__PURE__ */ jsx(OverlayPanelBody, {
21
+ "data-slot": "dialog-body",
23
22
  ...props
24
23
  });
25
24
  }
26
- function DialogFooter$1({ className,...props }) {
27
- return /* @__PURE__ */ jsx("div", {
28
- "data-slot": "footer",
29
- className: cn("flex shrink-0 justify-end space-x-2", className),
25
+ function DialogFooter$1(props) {
26
+ return /* @__PURE__ */ jsx(OverlayPanelFooter, {
27
+ "data-slot": "dialog-footer",
30
28
  ...props
31
29
  });
32
30
  }
@@ -1,4 +1,5 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_OverlayPanel = require('../overlay-panel/OverlayPanel.cjs');
2
3
  let __pixpilot_shadcn = require("@pixpilot/shadcn");
3
4
  __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
4
5
  let lucide_react = require("lucide-react");
@@ -60,26 +61,23 @@ const DrawerContent = react.forwardRef(({ className, floating = true, showCloseB
60
61
  })]
61
62
  }));
62
63
  DrawerContent.displayName = "DrawerContent";
63
- function DrawerHeader({ className, noDrag,...props }) {
64
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
64
+ function DrawerHeader({ noDrag,...props }) {
65
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OverlayPanel.OverlayPanelHeader, {
65
66
  "data-slot": "drawer-header",
66
- className: (0, __pixpilot_shadcn.cn)("flex shrink-0 flex-col gap-2.5", className),
67
67
  ...useNoDragProps(noDrag),
68
68
  ...props
69
69
  });
70
70
  }
71
- function DrawerBody({ className, noDrag,...props }) {
72
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
71
+ function DrawerBody({ noDrag,...props }) {
72
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OverlayPanel.OverlayPanelBody, {
73
73
  "data-slot": "drawer-body",
74
- className: (0, __pixpilot_shadcn.cn)("min-h-0 flex-1 overflow-auto -mx-6 px-6", className),
75
74
  ...useNoDragProps(noDrag),
76
75
  ...props
77
76
  });
78
77
  }
79
- function DrawerFooter({ className, noDrag,...props }) {
80
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
78
+ function DrawerFooter({ noDrag,...props }) {
79
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OverlayPanel.OverlayPanelFooter, {
81
80
  "data-slot": "drawer-footer",
82
- className: (0, __pixpilot_shadcn.cn)("flex shrink-0 justify-end space-x-2", className),
83
81
  ...useNoDragProps(noDrag),
84
82
  ...props
85
83
  });
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
2
2
  import { Drawer, DrawerClose, DrawerContent } from "@pixpilot/shadcn";
3
3
  import * as React$1 from "react";
4
4
  import * as _radix_ui_react_dialog0 from "@radix-ui/react-dialog";
@@ -22,7 +22,7 @@ type DrawerProps = React$1.ComponentProps<typeof Drawer> & NoDragProps;
22
22
  declare function Drawer$1({
23
23
  noDrag,
24
24
  ...props
25
- }: DrawerProps): react_jsx_runtime2.JSX.Element;
25
+ }: DrawerProps): react_jsx_runtime13.JSX.Element;
26
26
  type DrawerContentProps = React$1.ComponentPropsWithoutRef<typeof DrawerContent> & NoDragProps & {
27
27
  /**
28
28
  * Detach the drawer from the viewport edges: adds a gap on every side and
@@ -42,24 +42,21 @@ declare const DrawerContent$1: React$1.ForwardRefExoticComponent<Omit<Omit<_radi
42
42
  showCloseButton?: boolean;
43
43
  } & React$1.RefAttributes<HTMLDivElement>>;
44
44
  declare function DrawerHeader({
45
- className,
46
45
  noDrag,
47
46
  ...props
48
- }: React$1.HTMLAttributes<HTMLDivElement> & NoDragProps): react_jsx_runtime2.JSX.Element;
47
+ }: React$1.HTMLAttributes<HTMLDivElement> & NoDragProps): react_jsx_runtime13.JSX.Element;
49
48
  declare function DrawerBody({
50
- className,
51
49
  noDrag,
52
50
  ...props
53
- }: React$1.HTMLAttributes<HTMLDivElement> & NoDragProps): react_jsx_runtime2.JSX.Element;
51
+ }: React$1.HTMLAttributes<HTMLDivElement> & NoDragProps): react_jsx_runtime13.JSX.Element;
54
52
  declare function DrawerFooter({
55
- className,
56
53
  noDrag,
57
54
  ...props
58
- }: React$1.HTMLAttributes<HTMLDivElement> & NoDragProps): react_jsx_runtime2.JSX.Element;
55
+ }: React$1.HTMLAttributes<HTMLDivElement> & NoDragProps): react_jsx_runtime13.JSX.Element;
59
56
  declare function DrawerClose$1({
60
57
  className,
61
58
  noDrag,
62
59
  ...props
63
- }: React$1.ComponentPropsWithoutRef<typeof DrawerClose> & NoDragProps): react_jsx_runtime2.JSX.Element;
60
+ }: React$1.ComponentPropsWithoutRef<typeof DrawerClose> & NoDragProps): react_jsx_runtime13.JSX.Element;
64
61
  //#endregion
65
62
  export { Drawer$1 as Drawer, DrawerBody, DrawerClose$1 as DrawerClose, DrawerContent$1 as DrawerContent, DrawerContentProps, DrawerFooter, DrawerHeader, DrawerProps };
@@ -42,17 +42,14 @@ declare const DrawerContent$1: React$1.ForwardRefExoticComponent<Omit<Omit<_radi
42
42
  showCloseButton?: boolean;
43
43
  } & React$1.RefAttributes<HTMLDivElement>>;
44
44
  declare function DrawerHeader({
45
- className,
46
45
  noDrag,
47
46
  ...props
48
47
  }: React$1.HTMLAttributes<HTMLDivElement> & NoDragProps): react_jsx_runtime12.JSX.Element;
49
48
  declare function DrawerBody({
50
- className,
51
49
  noDrag,
52
50
  ...props
53
51
  }: React$1.HTMLAttributes<HTMLDivElement> & NoDragProps): react_jsx_runtime12.JSX.Element;
54
52
  declare function DrawerFooter({
55
- className,
56
53
  noDrag,
57
54
  ...props
58
55
  }: React$1.HTMLAttributes<HTMLDivElement> & NoDragProps): react_jsx_runtime12.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { OverlayPanelBody, OverlayPanelFooter, OverlayPanelHeader } from "../overlay-panel/OverlayPanel.js";
1
2
  import { Drawer, DrawerClose, DrawerContent, cn } from "@pixpilot/shadcn";
2
3
  import { XIcon } from "lucide-react";
3
4
  import * as React$1 from "react";
@@ -55,26 +56,23 @@ const DrawerContent$1 = React$1.forwardRef(({ className, floating = true, showCl
55
56
  })]
56
57
  }));
57
58
  DrawerContent$1.displayName = "DrawerContent";
58
- function DrawerHeader({ className, noDrag,...props }) {
59
- return /* @__PURE__ */ jsx("div", {
59
+ function DrawerHeader({ noDrag,...props }) {
60
+ return /* @__PURE__ */ jsx(OverlayPanelHeader, {
60
61
  "data-slot": "drawer-header",
61
- className: cn("flex shrink-0 flex-col gap-2.5", className),
62
62
  ...useNoDragProps(noDrag),
63
63
  ...props
64
64
  });
65
65
  }
66
- function DrawerBody({ className, noDrag,...props }) {
67
- return /* @__PURE__ */ jsx("div", {
66
+ function DrawerBody({ noDrag,...props }) {
67
+ return /* @__PURE__ */ jsx(OverlayPanelBody, {
68
68
  "data-slot": "drawer-body",
69
- className: cn("min-h-0 flex-1 overflow-auto -mx-6 px-6", className),
70
69
  ...useNoDragProps(noDrag),
71
70
  ...props
72
71
  });
73
72
  }
74
- function DrawerFooter({ className, noDrag,...props }) {
75
- return /* @__PURE__ */ jsx("div", {
73
+ function DrawerFooter({ noDrag,...props }) {
74
+ return /* @__PURE__ */ jsx(OverlayPanelFooter, {
76
75
  "data-slot": "drawer-footer",
77
- className: cn("flex shrink-0 justify-end space-x-2", className),
78
76
  ...useNoDragProps(noDrag),
79
77
  ...props
80
78
  });
@@ -1,7 +1,7 @@
1
1
  import { FileUploadProps } from "./types/index.cjs";
2
- import * as react_jsx_runtime13 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload/FileUpload.d.ts
5
- declare function FileUpload(props: FileUploadProps): react_jsx_runtime13.JSX.Element;
5
+ declare function FileUpload(props: FileUploadProps): react_jsx_runtime2.JSX.Element;
6
6
  //#endregion
7
7
  export { FileUpload };
@@ -1,10 +1,10 @@
1
1
  import { FileUploadInlineProps } from "./types.cjs";
2
- import * as react_jsx_runtime7 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime18 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload-inline/FileUploadInline.d.ts
5
5
  /**
6
6
  * FileUploadInline - An inline file upload component using FileUpload primitives
7
7
  */
8
- declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime7.JSX.Element;
8
+ declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime18.JSX.Element;
9
9
  //#endregion
10
10
  export { FileUploadInline };
@@ -1,11 +1,11 @@
1
1
  import { FileUploadRootProps } from "./types.cjs";
2
- import * as react_jsx_runtime8 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime19 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_runtime8.JSX.Element;
8
+ declare function FileUploadRoot(props: FileUploadRootProps): react_jsx_runtime19.JSX.Element;
9
9
  declare namespace FileUploadRoot {
10
10
  var displayName: string;
11
11
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime12 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime20 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_runtime12.JSX.Element;
13
+ declare function Input(props: InputProps$1): react_jsx_runtime20.JSX.Element;
14
14
  //#endregion
15
15
  export { Input, InputProps$1 as InputProps };
@@ -1,6 +1,6 @@
1
1
  import { InputProps } from "@pixpilot/shadcn";
2
2
  import * as React$1 from "react";
3
- import * as react_jsx_runtime19 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime23 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/input/Input.d.ts
6
6
  type InputProps$1 = InputProps & {
@@ -10,6 +10,6 @@ type InputProps$1 = InputProps & {
10
10
  prefixClassName?: string;
11
11
  suffixClassName?: string;
12
12
  };
13
- declare function Input$1(props: InputProps$1): react_jsx_runtime19.JSX.Element;
13
+ declare function Input$1(props: InputProps$1): react_jsx_runtime23.JSX.Element;
14
14
  //#endregion
15
15
  export { Input$1 as Input, InputProps$1 as InputProps };
@@ -0,0 +1,31 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ let __pixpilot_shadcn = require("@pixpilot/shadcn");
3
+ __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
4
+ let react = require("react");
5
+ react = require_rolldown_runtime.__toESM(react);
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
8
+
9
+ //#region src/overlay-panel/OverlayPanel.tsx
10
+ /**
11
+ * Shared layout building blocks for panel-style overlays (Dialog, Drawer).
12
+ * Centralizes the header/body/footer styling so both stay visually
13
+ * consistent; each overlay wraps these with its own `data-slot` value and
14
+ * any overlay-specific behavior (e.g. Drawer's drag-to-dismiss opt-out).
15
+ */
16
+ function createOverlayPanelPart(baseClassName) {
17
+ return function OverlayPanelPart({ className,...props }) {
18
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
19
+ className: (0, __pixpilot_shadcn.cn)(baseClassName, className),
20
+ ...props
21
+ });
22
+ };
23
+ }
24
+ const OverlayPanelHeader = createOverlayPanelPart("flex shrink-0 flex-col gap-2.5");
25
+ const OverlayPanelBody = createOverlayPanelPart("min-h-0 flex-1 overflow-auto -mx-6 px-6 py-1.5 -my-1.5");
26
+ const OverlayPanelFooter = createOverlayPanelPart("flex shrink-0 justify-end space-x-2");
27
+
28
+ //#endregion
29
+ exports.OverlayPanelBody = OverlayPanelBody;
30
+ exports.OverlayPanelFooter = OverlayPanelFooter;
31
+ exports.OverlayPanelHeader = OverlayPanelHeader;
@@ -0,0 +1,25 @@
1
+ import { cn } from "@pixpilot/shadcn";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+
5
+ //#region src/overlay-panel/OverlayPanel.tsx
6
+ /**
7
+ * Shared layout building blocks for panel-style overlays (Dialog, Drawer).
8
+ * Centralizes the header/body/footer styling so both stay visually
9
+ * consistent; each overlay wraps these with its own `data-slot` value and
10
+ * any overlay-specific behavior (e.g. Drawer's drag-to-dismiss opt-out).
11
+ */
12
+ function createOverlayPanelPart(baseClassName) {
13
+ return function OverlayPanelPart({ className,...props }) {
14
+ return /* @__PURE__ */ jsx("div", {
15
+ className: cn(baseClassName, className),
16
+ ...props
17
+ });
18
+ };
19
+ }
20
+ const OverlayPanelHeader = createOverlayPanelPart("flex shrink-0 flex-col gap-2.5");
21
+ const OverlayPanelBody = createOverlayPanelPart("min-h-0 flex-1 overflow-auto -mx-6 px-6 py-1.5 -my-1.5");
22
+ const OverlayPanelFooter = createOverlayPanelPart("flex shrink-0 justify-end space-x-2");
23
+
24
+ //#endregion
25
+ export { OverlayPanelBody, OverlayPanelFooter, OverlayPanelHeader };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime14 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime21 from "react/jsx-runtime";
2
2
  import * as React$1 from "react";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  import * as class_variance_authority_types0 from "class-variance-authority/types";
@@ -10,7 +10,7 @@ interface RatingOption {
10
10
  value: number;
11
11
  }
12
12
  declare const ratingVariants: (props?: ({
13
- size?: "default" | "sm" | "lg" | "xl" | null | undefined;
13
+ size?: "sm" | "default" | "lg" | "xl" | null | undefined;
14
14
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
15
15
  type RatingSize = VariantProps<typeof ratingVariants>['size'];
16
16
  type IconType = 'star' | 'circle';
@@ -35,7 +35,7 @@ declare function RatingButton({
35
35
  index,
36
36
  className,
37
37
  ...props
38
- }: RatingButtonProps): react_jsx_runtime14.JSX.Element;
38
+ }: RatingButtonProps): react_jsx_runtime21.JSX.Element;
39
39
  declare function Rating({
40
40
  value: valueProp,
41
41
  defaultValue,
@@ -53,6 +53,6 @@ declare function Rating({
53
53
  children,
54
54
  id,
55
55
  ...props
56
- }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime14.JSX.Element;
56
+ }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime21.JSX.Element;
57
57
  //#endregion
58
58
  export { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps };
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from "react";
2
- import * as react_jsx_runtime21 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime19 from "react/jsx-runtime";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  import * as class_variance_authority_types0 from "class-variance-authority/types";
5
5
 
@@ -10,7 +10,7 @@ interface RatingOption {
10
10
  value: number;
11
11
  }
12
12
  declare const ratingVariants: (props?: ({
13
- size?: "default" | "sm" | "lg" | "xl" | null | undefined;
13
+ size?: "sm" | "default" | "lg" | "xl" | null | undefined;
14
14
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
15
15
  type RatingSize = VariantProps<typeof ratingVariants>['size'];
16
16
  type IconType = 'star' | 'circle';
@@ -35,7 +35,7 @@ declare function RatingButton({
35
35
  index,
36
36
  className,
37
37
  ...props
38
- }: RatingButtonProps): react_jsx_runtime21.JSX.Element;
38
+ }: RatingButtonProps): react_jsx_runtime19.JSX.Element;
39
39
  declare function Rating({
40
40
  value: valueProp,
41
41
  defaultValue,
@@ -53,6 +53,6 @@ declare function Rating({
53
53
  children,
54
54
  id,
55
55
  ...props
56
- }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime21.JSX.Element;
56
+ }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime19.JSX.Element;
57
57
  //#endregion
58
58
  export { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps };
@@ -12,6 +12,8 @@ let __tiptap_extension_placeholder = require("@tiptap/extension-placeholder");
12
12
  __tiptap_extension_placeholder = require_rolldown_runtime.__toESM(__tiptap_extension_placeholder);
13
13
  let __tiptap_extension_text_align = require("@tiptap/extension-text-align");
14
14
  __tiptap_extension_text_align = require_rolldown_runtime.__toESM(__tiptap_extension_text_align);
15
+ let __tiptap_extensions_character_count = require("@tiptap/extensions/character-count");
16
+ __tiptap_extensions_character_count = require_rolldown_runtime.__toESM(__tiptap_extensions_character_count);
15
17
  let __tiptap_react = require("@tiptap/react");
16
18
  __tiptap_react = require_rolldown_runtime.__toESM(__tiptap_react);
17
19
  let __tiptap_starter_kit = require("@tiptap/starter-kit");
@@ -66,7 +68,7 @@ function useEditorProps(slots, customEditorProps, openOnClick = false) {
66
68
  openOnClick
67
69
  ]);
68
70
  }
69
- const RichTextEditor = ({ value, onChange, extensions = defaultExtensions, editable = true, slots, showToolbar = true, toolbarItems = defaultToolbarItems, editorProps: customEditorProps, immediatelyRender = false, tooltipMode = "native", placeholder, allowLinkTarget = false, openOnClick = false, className }) => {
71
+ const RichTextEditor = ({ value, onChange, extensions = defaultExtensions, editable = true, slots, showToolbar = true, toolbarItems = defaultToolbarItems, editorProps: customEditorProps, immediatelyRender = false, tooltipMode = "native", placeholder, maxLength, allowLinkTarget = false, openOnClick = false, className }) => {
70
72
  const [renderTick, forceRender] = react.default.useReducer((x) => x + 1, 0);
71
73
  const mergedEditorProps = useEditorProps(slots, customEditorProps, openOnClick);
72
74
  const onChangeRef = react.default.useRef(onChange);
@@ -88,10 +90,12 @@ const RichTextEditor = ({ value, onChange, extensions = defaultExtensions, edita
88
90
  __tiptap_extension_text_align.default.configure({ types: ["heading", "paragraph"] })
89
91
  ];
90
92
  if (placeholder != null) baseExtensions.push(__tiptap_extension_placeholder.default.configure({ placeholder }));
93
+ if (maxLength != null) baseExtensions.push(__tiptap_extensions_character_count.CharacterCount.configure({ limit: maxLength }));
91
94
  return baseExtensions.concat(extensions);
92
95
  }, [
93
96
  extensions,
94
97
  placeholder,
98
+ maxLength,
95
99
  openOnClick
96
100
  ]),
97
101
  content: value,
@@ -117,29 +121,44 @@ const RichTextEditor = ({ value, onChange, extensions = defaultExtensions, edita
117
121
  };
118
122
  }, [editorInstance]);
119
123
  if (editorInstance == null) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
124
+ "data-slot": "rich-text-editor",
120
125
  className: (0, __pixpilot_shadcn.cn)("flex flex-col overflow-hidden border rounded-md bg-background", slots?.root?.className),
121
126
  children: [showToolbar && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, __pixpilot_shadcn.cn)("flex flex-wrap items-center gap-1 border-b p-2 h-10 shrink-0", slots?.toolbar?.className) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
122
127
  className: (0, __pixpilot_shadcn.cn)("flex-1 overflow-y-auto min-h-[200px] p-4 text-sm leading-relaxed", slots?.content?.className),
123
128
  children: "Loading editor..."
124
129
  })]
125
130
  });
131
+ const characterCount = maxLength == null ? 0 : editorInstance.storage.characterCount.characters();
126
132
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
133
+ "data-slot": "rich-text-editor",
127
134
  className: (0, __pixpilot_shadcn.cn)("flex flex-col overflow-hidden border rounded-md bg-background", slots?.root?.className, className),
128
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_RichTextEditorToolbar.RichTextEditorToolbar, {
129
- editor: editorInstance,
130
- toolbarItems,
131
- slots,
132
- showToolbar,
133
- renderTick,
134
- tooltipMode,
135
- allowLinkTarget
136
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
137
- className: "flex-1 min-h-0 overflow-y-auto",
138
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tiptap_react.EditorContent, {
135
+ children: [
136
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_RichTextEditorToolbar.RichTextEditorToolbar, {
139
137
  editor: editorInstance,
140
- "data-slot": "editor-content"
138
+ toolbarItems,
139
+ slots,
140
+ showToolbar,
141
+ renderTick,
142
+ tooltipMode,
143
+ allowLinkTarget
144
+ }),
145
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
146
+ className: "flex-1 min-h-0 overflow-y-auto",
147
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tiptap_react.EditorContent, {
148
+ editor: editorInstance,
149
+ "data-slot": "editor-content"
150
+ })
151
+ }),
152
+ maxLength != null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
153
+ "data-slot": "character-count",
154
+ className: (0, __pixpilot_shadcn.cn)("shrink-0 border-t px-3 py-1.5 text-xs tabular-nums text-muted-foreground text-right", characterCount >= maxLength && "text-destructive", slots?.characterCount?.className),
155
+ children: [
156
+ characterCount,
157
+ " / ",
158
+ maxLength
159
+ ]
141
160
  })
142
- })]
161
+ ]
143
162
  });
144
163
  };
145
164
  RichTextEditor.displayName = "RichTextEditor";
@@ -27,6 +27,9 @@ interface RichTextEditorSlots {
27
27
  content?: {
28
28
  className?: string;
29
29
  };
30
+ characterCount?: {
31
+ className?: string;
32
+ };
30
33
  }
31
34
  interface RichTextEditorProps {
32
35
  /**
@@ -58,6 +61,7 @@ interface RichTextEditorProps {
58
61
  * - `slots.toolbar.button.className`: each toolbar button
59
62
  * - `slots.toolbar.separator.className`: separators (`|`)
60
63
  * - `slots.content.className`: editor content area (merged into TipTap `editorProps.attributes.class`)
64
+ * - `slots.characterCount.className`: character counter shown when `maxLength` is set
61
65
  */
62
66
  slots?: RichTextEditorSlots;
63
67
  /**
@@ -89,6 +93,14 @@ interface RichTextEditorProps {
89
93
  * Placeholder text to show when the editor is empty
90
94
  */
91
95
  placeholder?: string;
96
+ /**
97
+ * Maximum number of characters allowed in the editor. When set, input beyond
98
+ * the limit is rejected and a `current / max` counter is rendered below the
99
+ * content area.
100
+ *
101
+ * The count is based on the plain text content, not the HTML markup.
102
+ */
103
+ maxLength?: number;
92
104
  /**
93
105
  * Whether the link popover should expose target controls.
94
106
  * When false, links are always written without `target` and `rel`.
@@ -27,6 +27,9 @@ interface RichTextEditorSlots {
27
27
  content?: {
28
28
  className?: string;
29
29
  };
30
+ characterCount?: {
31
+ className?: string;
32
+ };
30
33
  }
31
34
  interface RichTextEditorProps {
32
35
  /**
@@ -58,6 +61,7 @@ interface RichTextEditorProps {
58
61
  * - `slots.toolbar.button.className`: each toolbar button
59
62
  * - `slots.toolbar.separator.className`: separators (`|`)
60
63
  * - `slots.content.className`: editor content area (merged into TipTap `editorProps.attributes.class`)
64
+ * - `slots.characterCount.className`: character counter shown when `maxLength` is set
61
65
  */
62
66
  slots?: RichTextEditorSlots;
63
67
  /**
@@ -89,6 +93,14 @@ interface RichTextEditorProps {
89
93
  * Placeholder text to show when the editor is empty
90
94
  */
91
95
  placeholder?: string;
96
+ /**
97
+ * Maximum number of characters allowed in the editor. When set, input beyond
98
+ * the limit is rejected and a `current / max` counter is rendered below the
99
+ * content area.
100
+ *
101
+ * The count is based on the plain text content, not the HTML markup.
102
+ */
103
+ maxLength?: number;
92
104
  /**
93
105
  * Whether the link popover should expose target controls.
94
106
  * When false, links are always written without `target` and `rel`.
@@ -5,6 +5,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import Link from "@tiptap/extension-link";
6
6
  import Placeholder from "@tiptap/extension-placeholder";
7
7
  import TextAlign from "@tiptap/extension-text-align";
8
+ import { CharacterCount } from "@tiptap/extensions/character-count";
8
9
  import { EditorContent, useEditor } from "@tiptap/react";
9
10
  import StarterKit from "@tiptap/starter-kit";
10
11
 
@@ -57,7 +58,7 @@ function useEditorProps(slots, customEditorProps, openOnClick = false) {
57
58
  openOnClick
58
59
  ]);
59
60
  }
60
- const RichTextEditor = ({ value, onChange, extensions = defaultExtensions, editable = true, slots, showToolbar = true, toolbarItems = defaultToolbarItems, editorProps: customEditorProps, immediatelyRender = false, tooltipMode = "native", placeholder, allowLinkTarget = false, openOnClick = false, className }) => {
61
+ const RichTextEditor = ({ value, onChange, extensions = defaultExtensions, editable = true, slots, showToolbar = true, toolbarItems = defaultToolbarItems, editorProps: customEditorProps, immediatelyRender = false, tooltipMode = "native", placeholder, maxLength, allowLinkTarget = false, openOnClick = false, className }) => {
61
62
  const [renderTick, forceRender] = React.useReducer((x) => x + 1, 0);
62
63
  const mergedEditorProps = useEditorProps(slots, customEditorProps, openOnClick);
63
64
  const onChangeRef = React.useRef(onChange);
@@ -79,10 +80,12 @@ const RichTextEditor = ({ value, onChange, extensions = defaultExtensions, edita
79
80
  TextAlign.configure({ types: ["heading", "paragraph"] })
80
81
  ];
81
82
  if (placeholder != null) baseExtensions.push(Placeholder.configure({ placeholder }));
83
+ if (maxLength != null) baseExtensions.push(CharacterCount.configure({ limit: maxLength }));
82
84
  return baseExtensions.concat(extensions);
83
85
  }, [
84
86
  extensions,
85
87
  placeholder,
88
+ maxLength,
86
89
  openOnClick
87
90
  ]),
88
91
  content: value,
@@ -108,29 +111,44 @@ const RichTextEditor = ({ value, onChange, extensions = defaultExtensions, edita
108
111
  };
109
112
  }, [editorInstance]);
110
113
  if (editorInstance == null) return /* @__PURE__ */ jsxs("div", {
114
+ "data-slot": "rich-text-editor",
111
115
  className: cn("flex flex-col overflow-hidden border rounded-md bg-background", slots?.root?.className),
112
116
  children: [showToolbar && /* @__PURE__ */ jsx("div", { className: cn("flex flex-wrap items-center gap-1 border-b p-2 h-10 shrink-0", slots?.toolbar?.className) }), /* @__PURE__ */ jsx("div", {
113
117
  className: cn("flex-1 overflow-y-auto min-h-[200px] p-4 text-sm leading-relaxed", slots?.content?.className),
114
118
  children: "Loading editor..."
115
119
  })]
116
120
  });
121
+ const characterCount = maxLength == null ? 0 : editorInstance.storage.characterCount.characters();
117
122
  return /* @__PURE__ */ jsxs("div", {
123
+ "data-slot": "rich-text-editor",
118
124
  className: cn("flex flex-col overflow-hidden border rounded-md bg-background", slots?.root?.className, className),
119
- children: [/* @__PURE__ */ jsx(RichTextEditorToolbar, {
120
- editor: editorInstance,
121
- toolbarItems,
122
- slots,
123
- showToolbar,
124
- renderTick,
125
- tooltipMode,
126
- allowLinkTarget
127
- }), /* @__PURE__ */ jsx("div", {
128
- className: "flex-1 min-h-0 overflow-y-auto",
129
- children: /* @__PURE__ */ jsx(EditorContent, {
125
+ children: [
126
+ /* @__PURE__ */ jsx(RichTextEditorToolbar, {
130
127
  editor: editorInstance,
131
- "data-slot": "editor-content"
128
+ toolbarItems,
129
+ slots,
130
+ showToolbar,
131
+ renderTick,
132
+ tooltipMode,
133
+ allowLinkTarget
134
+ }),
135
+ /* @__PURE__ */ jsx("div", {
136
+ className: "flex-1 min-h-0 overflow-y-auto",
137
+ children: /* @__PURE__ */ jsx(EditorContent, {
138
+ editor: editorInstance,
139
+ "data-slot": "editor-content"
140
+ })
141
+ }),
142
+ maxLength != null && /* @__PURE__ */ jsxs("div", {
143
+ "data-slot": "character-count",
144
+ className: cn("shrink-0 border-t px-3 py-1.5 text-xs tabular-nums text-muted-foreground text-right", characterCount >= maxLength && "text-destructive", slots?.characterCount?.className),
145
+ children: [
146
+ characterCount,
147
+ " / ",
148
+ maxLength
149
+ ]
132
150
  })
133
- })]
151
+ ]
134
152
  });
135
153
  };
136
154
  RichTextEditor.displayName = "RichTextEditor";
@@ -27,8 +27,12 @@ const meta = {
27
27
  toolbarItems: "Explicit toolbar items: predefined command strings, \"|\" separators, or custom button objects.",
28
28
  extensions: "Additional TipTap extensions appended to the built-in ones (StarterKit, Link, TextAlign, Placeholder). Accepts any TipTap Extension, Node, or Mark — official packages or your own custom ones. See the \"Add a custom extension\" example.",
29
29
  editorProps: "Custom TipTap editorProps merged into the defaults.",
30
- slots: "Class overrides for the root, toolbar (and its buttons/separators), and content area.",
30
+ slots: "Class overrides for the root, toolbar (and its buttons/separators), content area, and character counter.",
31
31
  placeholder: "Placeholder text shown when the editor is empty.",
32
+ maxLength: {
33
+ description: "Maximum number of characters allowed. Input beyond the limit is rejected and a \"current / max\" counter is rendered below the content area. Counts plain text, not HTML markup.",
34
+ type: "number"
35
+ },
32
36
  tooltipMode: {
33
37
  description: "How toolbar button tooltips are rendered.",
34
38
  type: "ToolbarButtonTooltipMode",
@@ -67,6 +71,10 @@ const meta = {
67
71
  title: "Custom toolbar",
68
72
  code: "<RichTextEditor value={html} onChange={setHtml} toolbarItems={[\"bold\", \"italic\", \"|\", \"bulletList\"]} />"
69
73
  },
74
+ {
75
+ title: "Limit the content length",
76
+ code: "<RichTextEditor value={html} onChange={setHtml} maxLength={280} />"
77
+ },
70
78
  {
71
79
  title: "Add an official extension",
72
80
  code: `// npm i @tiptap/extension-highlight
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime22 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
2
2
  import { Select, SelectContent, SelectTrigger } from "@pixpilot/shadcn";
3
3
  import React, { ComponentProps } from "react";
4
4
 
@@ -60,6 +60,6 @@ type BaseSelectProps = {
60
60
  /** Styles the visible trigger. */
61
61
  className?: string;
62
62
  } & Omit<ComponentProps<typeof SelectTrigger>, 'onChange' | 'value'>;
63
- declare function Select$1(props: BaseSelectProps): react_jsx_runtime22.JSX.Element;
63
+ declare function Select$1(props: BaseSelectProps): react_jsx_runtime5.JSX.Element;
64
64
  //#endregion
65
65
  export { BaseSelectProps, Select$1 as Select, SelectContentProps, SelectOption };
@@ -1,6 +1,6 @@
1
1
  import { Select, SelectContent, SelectTrigger } from "@pixpilot/shadcn";
2
2
  import React, { ComponentProps } from "react";
3
- import * as react_jsx_runtime20 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime21 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/select/Select.d.ts
6
6
  interface SelectOption {
@@ -60,6 +60,6 @@ type BaseSelectProps = {
60
60
  /** Styles the visible trigger. */
61
61
  className?: string;
62
62
  } & Omit<ComponentProps<typeof SelectTrigger>, 'onChange' | 'value'>;
63
- declare function Select$1(props: BaseSelectProps): react_jsx_runtime20.JSX.Element;
63
+ declare function Select$1(props: BaseSelectProps): react_jsx_runtime21.JSX.Element;
64
64
  //#endregion
65
65
  export { BaseSelectProps, Select$1 as Select, SelectContentProps, SelectOption };
@@ -1,5 +1,5 @@
1
1
  import { ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, Ref } from "react";
2
- import * as react_jsx_runtime23 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime22 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_runtime23.JSX.Element;
80
+ }: TagsInputInlineProps): react_jsx_runtime22.JSX.Element;
81
81
  //#endregion
82
82
  export { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime25 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime26 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_runtime25.JSX.Element;
21
+ declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime26.JSX.Element;
22
22
  declare namespace ThemeModeDropdown {
23
23
  var displayName: string;
24
24
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime26 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime28 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_runtime26.JSX.Element;
26
+ declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime28.JSX.Element;
27
27
  declare namespace ThemeModeSwitchOutside {
28
28
  var displayName: string;
29
29
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime28 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime25 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_runtime28.JSX.Element;
17
+ declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime25.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": "3.6.1",
4
+ "version": "3.8.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",
@@ -46,10 +46,11 @@
46
46
  "@tiptap/extension-link": "^3.22.3",
47
47
  "@tiptap/extension-placeholder": "^3.22.3",
48
48
  "@tiptap/extension-text-align": "^3.22.3",
49
+ "@tiptap/extensions": "^3.22.3",
49
50
  "@tiptap/react": "^3.22.3",
50
51
  "@tiptap/starter-kit": "^3.22.3",
51
52
  "class-variance-authority": "^0.7.1",
52
- "lucide-react": "1.25.0",
53
+ "lucide-react": "1.26.0",
53
54
  "next-themes": "0.4.6",
54
55
  "pretty-bytes": "^7.1.0",
55
56
  "react-responsive": "^10.0.1",
@@ -74,8 +75,8 @@
74
75
  "@internal/eslint-config": "0.3.0",
75
76
  "@internal/mcp": "0.0.0",
76
77
  "@internal/prettier-config": "0.0.1",
77
- "@internal/tsconfig": "0.1.0",
78
78
  "@internal/hooks": "0.0.0",
79
+ "@internal/tsconfig": "0.1.0",
79
80
  "@internal/tsdown-config": "0.1.0",
80
81
  "@internal/vitest-config": "0.1.0"
81
82
  },