@pixpilot/shadcn-ui 0.31.1 → 0.33.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/index.cjs CHANGED
@@ -59,6 +59,7 @@ const require_ThemeModeSwitchOutside = require('./theme-toggle/ThemeModeSwitchOu
59
59
  const require_ThemeModeToggleButton = require('./theme-toggle/ThemeModeToggleButton.cjs');
60
60
  require('./theme-toggle/index.cjs');
61
61
  const require_toast = require('./toast/toast.cjs');
62
+ const require_ToastProvider = require('./toast/ToastProvider.cjs');
62
63
  require('./toast/index.cjs');
63
64
  let __pixpilot_shadcn = require("@pixpilot/shadcn");
64
65
  __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
@@ -107,6 +108,7 @@ exports.ThemeModeSwitchInside = require_ThemeModeSwitchInside.ThemeModeSwitchIns
107
108
  exports.ThemeModeSwitchOutside = require_ThemeModeSwitchOutside.ThemeModeSwitchOutside;
108
109
  exports.ThemeModeToggleButton = require_ThemeModeToggleButton.ThemeModeToggleButton;
109
110
  exports.ThemeProvider = require_ThemeProvider.ThemeProvider;
111
+ exports.Toaster = require_ToastProvider.Toaster;
110
112
  exports.cn = __pixpilot_shadcn.cn;
111
113
  exports.showConfirmDialog = require_confirmation_dialogs.showConfirmDialog;
112
114
  exports.toast = require_toast.toast;
package/dist/index.d.cts CHANGED
@@ -40,7 +40,7 @@ import "./layout/index.cjs";
40
40
  import { LoaderProps, LoadingOverlay } from "./LoadingOverlay.cjs";
41
41
  import { Pagination, PaginationProps } from "./pagination/Pagination.cjs";
42
42
  import "./pagination/index.cjs";
43
- import { RichTextEditor, RichTextEditorProps, ToolbarOption } from "./rich-text-editor/RichTextEditor.cjs";
43
+ import { RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ToolbarOption } from "./rich-text-editor/RichTextEditor.cjs";
44
44
  import "./rich-text-editor/index.cjs";
45
45
  import { ScaledPreview, ScaledPreviewProps, ScaledPreviewSize } from "./ScaledPreview.cjs";
46
46
  import { Select, SelectOption } from "./Select.cjs";
@@ -64,6 +64,7 @@ import { ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps } from "./theme-tog
64
64
  import { ThemeModeToggleButton, ThemeModeToggleButtonProps } from "./theme-toggle/ThemeModeToggleButton.cjs";
65
65
  import "./theme-toggle/index.cjs";
66
66
  import { DEFAULT_ALERT_DURATION, ToastMessage, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast/toast.cjs";
67
+ import { Toaster } from "./toast/ToastProvider.cjs";
67
68
  import "./toast/index.cjs";
68
69
  import { cn } from "@pixpilot/shadcn";
69
- export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, DialogProvider, DialogProviderProps, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, PopoverCloseButtonProps, PresetColor, RichTextEditor, RichTextEditorProps, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastMessage, ToolbarOption, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
70
+ export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, DialogProvider, DialogProviderProps, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, PopoverCloseButtonProps, PresetColor, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastMessage, Toaster, ToolbarOption, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
package/dist/index.d.ts CHANGED
@@ -42,7 +42,7 @@ import "./layout/index.js";
42
42
  import { LoaderProps, LoadingOverlay } from "./LoadingOverlay.js";
43
43
  import { Pagination, PaginationProps } from "./pagination/Pagination.js";
44
44
  import "./pagination/index.js";
45
- import { RichTextEditor, RichTextEditorProps, ToolbarOption } from "./rich-text-editor/RichTextEditor.js";
45
+ import { RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ToolbarOption } from "./rich-text-editor/RichTextEditor.js";
46
46
  import "./rich-text-editor/index.js";
47
47
  import { ScaledPreview, ScaledPreviewProps, ScaledPreviewSize } from "./ScaledPreview.js";
48
48
  import { Select, SelectOption } from "./Select.js";
@@ -66,6 +66,7 @@ import { ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps } from "./theme-tog
66
66
  import { ThemeModeToggleButton, ThemeModeToggleButtonProps } from "./theme-toggle/ThemeModeToggleButton.js";
67
67
  import "./theme-toggle/index.js";
68
68
  import { DEFAULT_ALERT_DURATION, ToastMessage, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast/toast.js";
69
+ import { Toaster } from "./toast/ToastProvider.js";
69
70
  import "./toast/index.js";
70
71
  import { cn } from "@pixpilot/shadcn";
71
- export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, DialogProvider, DialogProviderProps, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, PopoverCloseButtonProps, PresetColor, RichTextEditor, RichTextEditorProps, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastMessage, ToolbarOption, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
72
+ export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, DialogProvider, DialogProviderProps, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, PopoverCloseButtonProps, PresetColor, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastMessage, Toaster, ToolbarOption, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
package/dist/index.js CHANGED
@@ -60,7 +60,8 @@ import { ThemeModeSwitchOutside } from "./theme-toggle/ThemeModeSwitchOutside.js
60
60
  import { ThemeModeToggleButton } from "./theme-toggle/ThemeModeToggleButton.js";
61
61
  import "./theme-toggle/index.js";
62
62
  import { DEFAULT_ALERT_DURATION, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast/toast.js";
63
+ import { Toaster } from "./toast/ToastProvider.js";
63
64
  import "./toast/index.js";
64
65
  import { cn } from "@pixpilot/shadcn";
65
66
 
66
- export { AbsoluteFill, Alert, AvatarUpload, Button, CircleLoader, CloseButtonAbsolute, CloseButtonRounded, ColorPicker, ColorPickerBase, ColorSelect, Combobox, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DialogProvider, FileUpload, FileUploadInline, IconPicker, Input, Layout, LayoutFooter, LayoutHeader, LayoutMain, LoadingOverlay, Pagination, RichTextEditor, ScaledPreview, Select, Slider, SliderInput, SliderSelect, Tabs, TabsContent, TabsContext, TabsList, TabsTrigger, TagsInput, ThemeModeDropdown, ThemeModeSwitchInside, ThemeModeSwitchOutside, ThemeModeToggleButton, ThemeProvider, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
67
+ export { AbsoluteFill, Alert, AvatarUpload, Button, CircleLoader, CloseButtonAbsolute, CloseButtonRounded, ColorPicker, ColorPickerBase, ColorSelect, Combobox, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DialogProvider, FileUpload, FileUploadInline, IconPicker, Input, Layout, LayoutFooter, LayoutHeader, LayoutMain, LoadingOverlay, Pagination, RichTextEditor, ScaledPreview, Select, Slider, SliderInput, SliderSelect, Tabs, TabsContent, TabsContext, TabsList, TabsTrigger, TagsInput, ThemeModeDropdown, ThemeModeSwitchInside, ThemeModeSwitchOutside, ThemeModeToggleButton, ThemeProvider, Toaster, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
@@ -1,5 +1,6 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_predefined_toolbar_options = require('./predefined-toolbar-options.cjs');
3
+ const require_ToolbarButton = require('./ToolbarButton.cjs');
3
4
  let __pixpilot_shadcn = require("@pixpilot/shadcn");
4
5
  __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
5
6
  let react = require("react");
@@ -12,21 +13,6 @@ let __tiptap_starter_kit = require("@tiptap/starter-kit");
12
13
  __tiptap_starter_kit = require_rolldown_runtime.__toESM(__tiptap_starter_kit);
13
14
 
14
15
  //#region src/rich-text-editor/RichTextEditor.tsx
15
- const ToolbarButton = ({ onClick, isActive, disabled, children, tooltip }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TooltipTrigger, {
16
- asChild: true,
17
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Button, {
18
- type: "button",
19
- variant: isActive ? "default" : "ghost",
20
- size: "sm",
21
- onMouseDown: (event) => {
22
- event.preventDefault();
23
- },
24
- onClick,
25
- disabled,
26
- className: "h-8 w-8 p-0",
27
- children
28
- })
29
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TooltipContent, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: tooltip }) })] });
30
16
  const defaultExtensions = [];
31
17
  const defaultToolbarOptions = [
32
18
  "bold",
@@ -45,9 +31,9 @@ const defaultToolbarOptions = [
45
31
  "blockquote",
46
32
  "codeBlock"
47
33
  ];
48
- const RichTextEditor = ({ content, onChange, extensions = defaultExtensions, editable = true, className, contentClassName, showToolbar = true, toolbarOptions = defaultToolbarOptions, editorProps: customEditorProps }) => {
34
+ const RichTextEditor = ({ value, onChange, extensions = defaultExtensions, editable = true, slots, showToolbar = true, toolbarOptions = defaultToolbarOptions, editorProps: customEditorProps, immediatelyRender = false }) => {
49
35
  const [, forceRender] = react.default.useReducer((x) => x + 1, 0);
50
- const defaultEditorProps = { attributes: { class: (0, __pixpilot_shadcn.cn)("min-h-[200px] p-4 text-sm leading-relaxed focus:outline-none", "[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:leading-tight [&_h1]:my-2", "[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:leading-tight [&_h2]:my-2", "[&_h3]:text-xl [&_h3]:font-bold [&_h3]:leading-tight [&_h3]:my-2", "[&_p]:my-2", "[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:my-2", "[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:my-2", "[&_blockquote]:border-l-4 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:my-2 [&_blockquote]:italic", "[&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-[0.875em] [&_code]:font-mono", "[&_pre]:bg-muted [&_pre]:p-4 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:font-mono", contentClassName) } };
36
+ const defaultEditorProps = { attributes: { class: (0, __pixpilot_shadcn.cn)("min-h-[200px] p-4 text-sm leading-relaxed focus:outline-none", "[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:leading-tight [&_h1]:mt-8 [&_h1]:mb-4 [&_h1:first-child]:mt-0", "[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:leading-tight [&_h2]:mt-6 [&_h2]:mb-3 [&_h2:first-child]:mt-0", "[&_h3]:text-xl [&_h3]:font-bold [&_h3]:leading-tight [&_h3]:mt-4 [&_h3]:mb-2 [&_h3:first-child]:mt-0", "[&_p]:mb-3", "[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:mb-3", "[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:mb-3", "[&_blockquote]:border-l-4 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:mb-4 [&_blockquote]:italic [&_blockquote:first-child]:mt-0", "[&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-[0.875em] [&_code]:font-mono", "[&_pre]:bg-muted [&_pre]:p-4 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:font-mono [&_pre]:mb-4", "[&_*:last-child]:mb-0", slots?.content?.className) } };
51
37
  const mergedEditorProps = {
52
38
  ...defaultEditorProps,
53
39
  ...customEditorProps,
@@ -59,11 +45,12 @@ const RichTextEditor = ({ content, onChange, extensions = defaultExtensions, edi
59
45
  };
60
46
  const editorInstance = (0, __tiptap_react.useEditor)({
61
47
  extensions: [__tiptap_starter_kit.default].concat(extensions),
62
- content,
48
+ content: value,
63
49
  editable,
64
50
  onUpdate: ({ editor: updatedEditor }) => {
65
51
  onChange?.(updatedEditor.getHTML());
66
52
  },
53
+ immediatelyRender,
67
54
  editorProps: mergedEditorProps
68
55
  });
69
56
  react.default.useEffect(() => {
@@ -83,9 +70,9 @@ const RichTextEditor = ({ content, onChange, extensions = defaultExtensions, edi
83
70
  };
84
71
  }, [editorInstance]);
85
72
  if (editorInstance == null) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
86
- className: (0, __pixpilot_shadcn.cn)("border rounded-md bg-background", className),
87
- children: [showToolbar && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "flex flex-wrap items-center gap-1 border-b p-2 h-10" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
88
- className: "min-h-[200px] p-4 text-sm leading-relaxed",
73
+ className: (0, __pixpilot_shadcn.cn)("border rounded-md bg-background", slots?.root?.className),
74
+ 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", slots?.toolbar?.className) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
75
+ className: (0, __pixpilot_shadcn.cn)("min-h-[200px] p-4 text-sm leading-relaxed", slots?.content?.className),
89
76
  children: "Loading editor..."
90
77
  })]
91
78
  });
@@ -97,32 +84,40 @@ const RichTextEditor = ({ content, onChange, extensions = defaultExtensions, edi
97
84
  const renderToolbar = () => {
98
85
  if (!showToolbar) return null;
99
86
  const isEditorFocused = editorInstance.isFocused;
87
+ let separatorCount = 0;
88
+ let customCount = 0;
100
89
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
101
- className: "flex flex-wrap items-center gap-1 border-b p-2",
102
- children: toolbarOptions.map((option, index) => {
103
- if (option === "|") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "mx-1 h-6 w-px bg-border" }, `separator-${index}`);
90
+ className: (0, __pixpilot_shadcn.cn)("flex flex-wrap items-center gap-1 border-b p-2", slots?.toolbar?.className),
91
+ children: toolbarOptions.map((option) => {
92
+ if (option === "|") {
93
+ separatorCount += 1;
94
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, __pixpilot_shadcn.cn)("mx-1 h-6 w-px bg-border", slots?.toolbar?.separator?.className) }, `separator-${separatorCount}`);
95
+ }
104
96
  if (typeof option === "string") {
105
97
  const predefinedOption = require_predefined_toolbar_options.predefinedToolbarOptions[option];
106
98
  if (!predefinedOption) return null;
107
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
99
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ToolbarButton.ToolbarButton, {
108
100
  onClick: () => handleCommand(() => predefinedOption.onClick(editorInstance)),
109
101
  isActive: isEditorFocused && (predefinedOption.isActive?.(editorInstance) ?? false),
110
102
  tooltip: predefinedOption.tooltip,
103
+ className: slots?.toolbar?.button?.className,
111
104
  children: predefinedOption.icon
112
105
  }, option);
113
106
  }
114
107
  const customOption = option;
115
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
108
+ customCount += 1;
109
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ToolbarButton.ToolbarButton, {
116
110
  onClick: () => handleCommand(() => customOption.onClick(editorInstance)),
117
111
  isActive: isEditorFocused && (customOption.isActive?.(editorInstance) ?? false),
118
112
  tooltip: customOption.tooltip,
113
+ className: slots?.toolbar?.button?.className,
119
114
  children: customOption.icon
120
- }, `custom-${index}-${customOption.tooltip}`);
115
+ }, `custom-${customCount}-${customOption.tooltip}`);
121
116
  })
122
117
  });
123
118
  };
124
119
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
125
- className: (0, __pixpilot_shadcn.cn)("border rounded-md bg-background", className),
120
+ className: (0, __pixpilot_shadcn.cn)("border rounded-md bg-background", slots?.root?.className),
126
121
  children: [renderToolbar(), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tiptap_react.EditorContent, { editor: editorInstance })]
127
122
  });
128
123
  };
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { Editor, Extension } from "@tiptap/core";
3
+ import { UseEditorOptions } from "@tiptap/react";
3
4
 
4
5
  //#region src/rich-text-editor/RichTextEditor.d.ts
5
6
  type EditorProps = Editor['options']['editorProps'];
@@ -9,11 +10,29 @@ type ToolbarOption = string | '|' | {
9
10
  onClick: (editor: any) => void;
10
11
  isActive?: (editor: any) => boolean;
11
12
  };
13
+ interface RichTextEditorSlots {
14
+ root?: {
15
+ className?: string;
16
+ };
17
+ toolbar?: {
18
+ className?: string;
19
+ button?: {
20
+ className?: string;
21
+ };
22
+ separator?: {
23
+ className?: string;
24
+ };
25
+ };
26
+ content?: {
27
+ className?: string;
28
+ };
29
+ }
12
30
  interface RichTextEditorProps {
13
31
  /**
14
- * The initial content of the editor
32
+ * The HTML value of the editor.
33
+ * TipTap uses `content` internally, but this component follows React input conventions.
15
34
  */
16
- content?: string;
35
+ value?: string;
17
36
  /**
18
37
  * Callback when the content changes
19
38
  */
@@ -28,13 +47,15 @@ interface RichTextEditorProps {
28
47
  */
29
48
  editable?: boolean;
30
49
  /**
31
- * Custom class name for the editor container
32
- */
33
- className?: string;
34
- /**
35
- * Custom class name for the editor content
50
+ * Slots for styling different parts of the editor.
51
+ *
52
+ * - `slots.root.className`: outer container
53
+ * - `slots.toolbar.className`: toolbar wrapper
54
+ * - `slots.toolbar.button.className`: each toolbar button
55
+ * - `slots.toolbar.separator.className`: separators (`|`)
56
+ * - `slots.content.className`: editor content area (merged into TipTap `editorProps.attributes.class`)
36
57
  */
37
- contentClassName?: string;
58
+ slots?: RichTextEditorSlots;
38
59
  /**
39
60
  * Whether to show the toolbar
40
61
  * @default true
@@ -49,7 +70,13 @@ interface RichTextEditorProps {
49
70
  * Custom editor props to pass to the editor
50
71
  */
51
72
  editorProps?: EditorProps;
73
+ /**
74
+ * If true, the editor will render immediately on mount.
75
+ * This can help with SSR or hydration issues in some cases.
76
+ * @default false
77
+ */
78
+ immediatelyRender?: UseEditorOptions['immediatelyRender'];
52
79
  }
53
80
  declare const RichTextEditor: React.FC<RichTextEditorProps>;
54
81
  //#endregion
55
- export { RichTextEditor, RichTextEditorProps, ToolbarOption };
82
+ export { RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ToolbarOption };
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { UseEditorOptions } from "@tiptap/react";
2
3
  import { Editor, Extension } from "@tiptap/core";
3
4
 
4
5
  //#region src/rich-text-editor/RichTextEditor.d.ts
@@ -9,11 +10,29 @@ type ToolbarOption = string | '|' | {
9
10
  onClick: (editor: any) => void;
10
11
  isActive?: (editor: any) => boolean;
11
12
  };
13
+ interface RichTextEditorSlots {
14
+ root?: {
15
+ className?: string;
16
+ };
17
+ toolbar?: {
18
+ className?: string;
19
+ button?: {
20
+ className?: string;
21
+ };
22
+ separator?: {
23
+ className?: string;
24
+ };
25
+ };
26
+ content?: {
27
+ className?: string;
28
+ };
29
+ }
12
30
  interface RichTextEditorProps {
13
31
  /**
14
- * The initial content of the editor
32
+ * The HTML value of the editor.
33
+ * TipTap uses `content` internally, but this component follows React input conventions.
15
34
  */
16
- content?: string;
35
+ value?: string;
17
36
  /**
18
37
  * Callback when the content changes
19
38
  */
@@ -28,13 +47,15 @@ interface RichTextEditorProps {
28
47
  */
29
48
  editable?: boolean;
30
49
  /**
31
- * Custom class name for the editor container
32
- */
33
- className?: string;
34
- /**
35
- * Custom class name for the editor content
50
+ * Slots for styling different parts of the editor.
51
+ *
52
+ * - `slots.root.className`: outer container
53
+ * - `slots.toolbar.className`: toolbar wrapper
54
+ * - `slots.toolbar.button.className`: each toolbar button
55
+ * - `slots.toolbar.separator.className`: separators (`|`)
56
+ * - `slots.content.className`: editor content area (merged into TipTap `editorProps.attributes.class`)
36
57
  */
37
- contentClassName?: string;
58
+ slots?: RichTextEditorSlots;
38
59
  /**
39
60
  * Whether to show the toolbar
40
61
  * @default true
@@ -49,7 +70,13 @@ interface RichTextEditorProps {
49
70
  * Custom editor props to pass to the editor
50
71
  */
51
72
  editorProps?: EditorProps;
73
+ /**
74
+ * If true, the editor will render immediately on mount.
75
+ * This can help with SSR or hydration issues in some cases.
76
+ * @default false
77
+ */
78
+ immediatelyRender?: UseEditorOptions['immediatelyRender'];
52
79
  }
53
80
  declare const RichTextEditor: React.FC<RichTextEditorProps>;
54
81
  //#endregion
55
- export { RichTextEditor, RichTextEditorProps, ToolbarOption };
82
+ export { RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ToolbarOption };
@@ -1,26 +1,12 @@
1
1
  import { predefinedToolbarOptions } from "./predefined-toolbar-options.js";
2
- import { Button, Tooltip, TooltipContent, TooltipTrigger, cn } from "@pixpilot/shadcn";
2
+ import { ToolbarButton } from "./ToolbarButton.js";
3
+ import { cn } from "@pixpilot/shadcn";
3
4
  import React from "react";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { EditorContent, useEditor } from "@tiptap/react";
6
7
  import StarterKit from "@tiptap/starter-kit";
7
8
 
8
9
  //#region src/rich-text-editor/RichTextEditor.tsx
9
- const ToolbarButton = ({ onClick, isActive, disabled, children, tooltip }) => /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
10
- asChild: true,
11
- children: /* @__PURE__ */ jsx(Button, {
12
- type: "button",
13
- variant: isActive ? "default" : "ghost",
14
- size: "sm",
15
- onMouseDown: (event) => {
16
- event.preventDefault();
17
- },
18
- onClick,
19
- disabled,
20
- className: "h-8 w-8 p-0",
21
- children
22
- })
23
- }), /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: tooltip }) })] });
24
10
  const defaultExtensions = [];
25
11
  const defaultToolbarOptions = [
26
12
  "bold",
@@ -39,9 +25,9 @@ const defaultToolbarOptions = [
39
25
  "blockquote",
40
26
  "codeBlock"
41
27
  ];
42
- const RichTextEditor = ({ content, onChange, extensions = defaultExtensions, editable = true, className, contentClassName, showToolbar = true, toolbarOptions = defaultToolbarOptions, editorProps: customEditorProps }) => {
28
+ const RichTextEditor = ({ value, onChange, extensions = defaultExtensions, editable = true, slots, showToolbar = true, toolbarOptions = defaultToolbarOptions, editorProps: customEditorProps, immediatelyRender = false }) => {
43
29
  const [, forceRender] = React.useReducer((x) => x + 1, 0);
44
- const defaultEditorProps = { attributes: { class: cn("min-h-[200px] p-4 text-sm leading-relaxed focus:outline-none", "[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:leading-tight [&_h1]:my-2", "[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:leading-tight [&_h2]:my-2", "[&_h3]:text-xl [&_h3]:font-bold [&_h3]:leading-tight [&_h3]:my-2", "[&_p]:my-2", "[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:my-2", "[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:my-2", "[&_blockquote]:border-l-4 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:my-2 [&_blockquote]:italic", "[&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-[0.875em] [&_code]:font-mono", "[&_pre]:bg-muted [&_pre]:p-4 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:font-mono", contentClassName) } };
30
+ const defaultEditorProps = { attributes: { class: cn("min-h-[200px] p-4 text-sm leading-relaxed focus:outline-none", "[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:leading-tight [&_h1]:mt-8 [&_h1]:mb-4 [&_h1:first-child]:mt-0", "[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:leading-tight [&_h2]:mt-6 [&_h2]:mb-3 [&_h2:first-child]:mt-0", "[&_h3]:text-xl [&_h3]:font-bold [&_h3]:leading-tight [&_h3]:mt-4 [&_h3]:mb-2 [&_h3:first-child]:mt-0", "[&_p]:mb-3", "[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:mb-3", "[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:mb-3", "[&_blockquote]:border-l-4 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:mb-4 [&_blockquote]:italic [&_blockquote:first-child]:mt-0", "[&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-[0.875em] [&_code]:font-mono", "[&_pre]:bg-muted [&_pre]:p-4 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:font-mono [&_pre]:mb-4", "[&_*:last-child]:mb-0", slots?.content?.className) } };
45
31
  const mergedEditorProps = {
46
32
  ...defaultEditorProps,
47
33
  ...customEditorProps,
@@ -53,11 +39,12 @@ const RichTextEditor = ({ content, onChange, extensions = defaultExtensions, edi
53
39
  };
54
40
  const editorInstance = useEditor({
55
41
  extensions: [StarterKit].concat(extensions),
56
- content,
42
+ content: value,
57
43
  editable,
58
44
  onUpdate: ({ editor: updatedEditor }) => {
59
45
  onChange?.(updatedEditor.getHTML());
60
46
  },
47
+ immediatelyRender,
61
48
  editorProps: mergedEditorProps
62
49
  });
63
50
  React.useEffect(() => {
@@ -77,9 +64,9 @@ const RichTextEditor = ({ content, onChange, extensions = defaultExtensions, edi
77
64
  };
78
65
  }, [editorInstance]);
79
66
  if (editorInstance == null) return /* @__PURE__ */ jsxs("div", {
80
- className: cn("border rounded-md bg-background", className),
81
- children: [showToolbar && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-1 border-b p-2 h-10" }), /* @__PURE__ */ jsx("div", {
82
- className: "min-h-[200px] p-4 text-sm leading-relaxed",
67
+ className: cn("border rounded-md bg-background", slots?.root?.className),
68
+ children: [showToolbar && /* @__PURE__ */ jsx("div", { className: cn("flex flex-wrap items-center gap-1 border-b p-2 h-10", slots?.toolbar?.className) }), /* @__PURE__ */ jsx("div", {
69
+ className: cn("min-h-[200px] p-4 text-sm leading-relaxed", slots?.content?.className),
83
70
  children: "Loading editor..."
84
71
  })]
85
72
  });
@@ -91,10 +78,15 @@ const RichTextEditor = ({ content, onChange, extensions = defaultExtensions, edi
91
78
  const renderToolbar = () => {
92
79
  if (!showToolbar) return null;
93
80
  const isEditorFocused = editorInstance.isFocused;
81
+ let separatorCount = 0;
82
+ let customCount = 0;
94
83
  return /* @__PURE__ */ jsx("div", {
95
- className: "flex flex-wrap items-center gap-1 border-b p-2",
96
- children: toolbarOptions.map((option, index) => {
97
- if (option === "|") return /* @__PURE__ */ jsx("div", { className: "mx-1 h-6 w-px bg-border" }, `separator-${index}`);
84
+ className: cn("flex flex-wrap items-center gap-1 border-b p-2", slots?.toolbar?.className),
85
+ children: toolbarOptions.map((option) => {
86
+ if (option === "|") {
87
+ separatorCount += 1;
88
+ return /* @__PURE__ */ jsx("div", { className: cn("mx-1 h-6 w-px bg-border", slots?.toolbar?.separator?.className) }, `separator-${separatorCount}`);
89
+ }
98
90
  if (typeof option === "string") {
99
91
  const predefinedOption = predefinedToolbarOptions[option];
100
92
  if (!predefinedOption) return null;
@@ -102,21 +94,24 @@ const RichTextEditor = ({ content, onChange, extensions = defaultExtensions, edi
102
94
  onClick: () => handleCommand(() => predefinedOption.onClick(editorInstance)),
103
95
  isActive: isEditorFocused && (predefinedOption.isActive?.(editorInstance) ?? false),
104
96
  tooltip: predefinedOption.tooltip,
97
+ className: slots?.toolbar?.button?.className,
105
98
  children: predefinedOption.icon
106
99
  }, option);
107
100
  }
108
101
  const customOption = option;
102
+ customCount += 1;
109
103
  return /* @__PURE__ */ jsx(ToolbarButton, {
110
104
  onClick: () => handleCommand(() => customOption.onClick(editorInstance)),
111
105
  isActive: isEditorFocused && (customOption.isActive?.(editorInstance) ?? false),
112
106
  tooltip: customOption.tooltip,
107
+ className: slots?.toolbar?.button?.className,
113
108
  children: customOption.icon
114
- }, `custom-${index}-${customOption.tooltip}`);
109
+ }, `custom-${customCount}-${customOption.tooltip}`);
115
110
  })
116
111
  });
117
112
  };
118
113
  return /* @__PURE__ */ jsxs("div", {
119
- className: cn("border rounded-md bg-background", className),
114
+ className: cn("border rounded-md bg-background", slots?.root?.className),
120
115
  children: [renderToolbar(), /* @__PURE__ */ jsx(EditorContent, { editor: editorInstance })]
121
116
  });
122
117
  };
@@ -0,0 +1,50 @@
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/rich-text-editor/ToolbarButton.tsx
10
+ function isSvgMarkupString(value) {
11
+ if (typeof value !== "string") return false;
12
+ const trimmed = value.trim();
13
+ return trimmed.startsWith("<svg") && trimmed.endsWith("</svg>");
14
+ }
15
+ function svgMarkupToMaskUrl(svgMarkup) {
16
+ return `url("data:image/svg+xml,${encodeURIComponent(svgMarkup).replace(/'/gu, "%27").replace(/"/gu, "%22")}")`;
17
+ }
18
+ const ToolbarButton = ({ onClick, isActive, disabled, className, children, tooltip }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TooltipTrigger, {
19
+ asChild: true,
20
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Button, {
21
+ type: "button",
22
+ variant: isActive ? "default" : "ghost",
23
+ size: "sm",
24
+ onMouseDown: (event) => {
25
+ event.preventDefault();
26
+ },
27
+ onClick,
28
+ disabled,
29
+ className: (0, __pixpilot_shadcn.cn)("h-8 w-8 p-0", className),
30
+ children: isSvgMarkupString(children) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
31
+ "data-slot": "svg-mask",
32
+ "aria-hidden": "true",
33
+ className: "inline-block h-4 w-4",
34
+ style: {
35
+ backgroundColor: "currentColor",
36
+ WebkitMaskImage: svgMarkupToMaskUrl(children),
37
+ maskImage: svgMarkupToMaskUrl(children),
38
+ WebkitMaskRepeat: "no-repeat",
39
+ maskRepeat: "no-repeat",
40
+ WebkitMaskPosition: "center",
41
+ maskPosition: "center",
42
+ WebkitMaskSize: "contain",
43
+ maskSize: "contain"
44
+ }
45
+ }) : children
46
+ })
47
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TooltipContent, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: tooltip }) })] });
48
+
49
+ //#endregion
50
+ exports.ToolbarButton = ToolbarButton;
@@ -0,0 +1,46 @@
1
+ import { Button, Tooltip, TooltipContent, TooltipTrigger, cn } from "@pixpilot/shadcn";
2
+ import React from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+
5
+ //#region src/rich-text-editor/ToolbarButton.tsx
6
+ function isSvgMarkupString(value) {
7
+ if (typeof value !== "string") return false;
8
+ const trimmed = value.trim();
9
+ return trimmed.startsWith("<svg") && trimmed.endsWith("</svg>");
10
+ }
11
+ function svgMarkupToMaskUrl(svgMarkup) {
12
+ return `url("data:image/svg+xml,${encodeURIComponent(svgMarkup).replace(/'/gu, "%27").replace(/"/gu, "%22")}")`;
13
+ }
14
+ const ToolbarButton = ({ onClick, isActive, disabled, className, children, tooltip }) => /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
15
+ asChild: true,
16
+ children: /* @__PURE__ */ jsx(Button, {
17
+ type: "button",
18
+ variant: isActive ? "default" : "ghost",
19
+ size: "sm",
20
+ onMouseDown: (event) => {
21
+ event.preventDefault();
22
+ },
23
+ onClick,
24
+ disabled,
25
+ className: cn("h-8 w-8 p-0", className),
26
+ children: isSvgMarkupString(children) ? /* @__PURE__ */ jsx("span", {
27
+ "data-slot": "svg-mask",
28
+ "aria-hidden": "true",
29
+ className: "inline-block h-4 w-4",
30
+ style: {
31
+ backgroundColor: "currentColor",
32
+ WebkitMaskImage: svgMarkupToMaskUrl(children),
33
+ maskImage: svgMarkupToMaskUrl(children),
34
+ WebkitMaskRepeat: "no-repeat",
35
+ maskRepeat: "no-repeat",
36
+ WebkitMaskPosition: "center",
37
+ maskPosition: "center",
38
+ WebkitMaskSize: "contain",
39
+ maskSize: "contain"
40
+ }
41
+ }) : children
42
+ })
43
+ }), /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: tooltip }) })] });
44
+
45
+ //#endregion
46
+ export { ToolbarButton };
@@ -1 +1 @@
1
- import { RichTextEditor, RichTextEditorProps, ToolbarOption } from "./RichTextEditor.cjs";
1
+ import { RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ToolbarOption } from "./RichTextEditor.cjs";
@@ -1 +1 @@
1
- import { RichTextEditor, RichTextEditorProps, ToolbarOption } from "./RichTextEditor.js";
1
+ import { RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ToolbarOption } from "./RichTextEditor.js";
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeDropdown.d.ts
4
4
  interface ThemeModeDropdownProps {
@@ -17,7 +17,7 @@ interface ThemeModeDropdownProps {
17
17
  * Provides Light / Dark / System options.
18
18
  * Pure component - requires themeValue and onChange props.
19
19
  */
20
- declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime10.JSX.Element;
20
+ declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime9.JSX.Element;
21
21
  declare namespace ThemeModeDropdown {
22
22
  var displayName: string;
23
23
  }
@@ -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
 
3
3
  //#region src/theme-toggle/ThemeModeSwitchInside.d.ts
4
4
  type ThemeModeSwitchInsideSize = 'sm' | 'md' | 'lg';
@@ -25,7 +25,7 @@ interface ThemeModeSwitchInsideProps {
25
25
  * Icons are embedded within the switch control.
26
26
  * Pure component - requires value and onChange props.
27
27
  */
28
- declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime11.JSX.Element;
28
+ declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime10.JSX.Element;
29
29
  declare namespace ThemeModeSwitchInside {
30
30
  var displayName: string;
31
31
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime12 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeSwitchOutside.d.ts
4
4
  interface ThemeModeSwitchOutsideProps {
@@ -22,7 +22,7 @@ interface ThemeModeSwitchOutsideProps {
22
22
  * Icons flank the switch control on either side.
23
23
  * Pure component - requires value and onChange props.
24
24
  */
25
- declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime12.JSX.Element;
25
+ declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime11.JSX.Element;
26
26
  declare namespace ThemeModeSwitchOutside {
27
27
  var displayName: string;
28
28
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeToggleButton.d.ts
4
4
  interface ThemeModeToggleButtonProps {
@@ -13,7 +13,7 @@ interface ThemeModeToggleButtonProps {
13
13
  * Light/Dark toggle button.
14
14
  * Pure component - toggles between light and dark.
15
15
  */
16
- declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime9.JSX.Element;
16
+ declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime12.JSX.Element;
17
17
  declare namespace ThemeModeToggleButton {
18
18
  var displayName: string;
19
19
  }
@@ -0,0 +1,9 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ let sonner = require("sonner");
3
+ sonner = require_rolldown_runtime.__toESM(sonner);
4
+
5
+ //#region src/toast/ToastProvider.tsx
6
+ const Toaster = sonner.Toaster;
7
+
8
+ //#endregion
9
+ exports.Toaster = Toaster;
@@ -0,0 +1,7 @@
1
+ import * as react0 from "react";
2
+ import * as sonner0 from "sonner";
3
+
4
+ //#region src/toast/ToastProvider.d.ts
5
+ declare const Toaster: react0.ForwardRefExoticComponent<sonner0.ToasterProps & react0.RefAttributes<HTMLElement>>;
6
+ //#endregion
7
+ export { Toaster };
@@ -0,0 +1,7 @@
1
+ import * as react0 from "react";
2
+ import * as sonner0 from "sonner";
3
+
4
+ //#region src/toast/ToastProvider.d.ts
5
+ declare const Toaster$1: react0.ForwardRefExoticComponent<sonner0.ToasterProps & react0.RefAttributes<HTMLElement>>;
6
+ //#endregion
7
+ export { Toaster$1 as Toaster };
@@ -0,0 +1,7 @@
1
+ import { Toaster } from "sonner";
2
+
3
+ //#region src/toast/ToastProvider.tsx
4
+ const Toaster$1 = Toaster;
5
+
6
+ //#endregion
7
+ export { Toaster$1 as Toaster };
@@ -1 +1,2 @@
1
1
  const require_toast = require('./toast.cjs');
2
+ const require_ToastProvider = require('./ToastProvider.cjs');
@@ -1 +1,2 @@
1
- import { DEFAULT_ALERT_DURATION, ToastMessage, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast.cjs";
1
+ import { DEFAULT_ALERT_DURATION, ToastMessage, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast.cjs";
2
+ import { Toaster } from "./ToastProvider.cjs";
@@ -1 +1,2 @@
1
- import { DEFAULT_ALERT_DURATION, ToastMessage, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast.js";
1
+ import { DEFAULT_ALERT_DURATION, ToastMessage, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast.js";
2
+ import { Toaster } from "./ToastProvider.js";
@@ -1 +1,2 @@
1
1
  import { DEFAULT_ALERT_DURATION, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast.js";
2
+ import { Toaster } from "./ToastProvider.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/shadcn-ui",
3
3
  "type": "module",
4
- "version": "0.31.1",
4
+ "version": "0.33.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",