@pixpilot/shadcn-ui 0.47.0 → 0.48.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/dialog/Dialog.d.cts +4 -4
- package/dist/dialog/Dialog.d.ts +4 -4
- package/dist/file-upload/FileUpload.d.cts +2 -2
- package/dist/file-upload/FileUpload.d.ts +2 -2
- package/dist/file-upload-inline/FileUploadInline.d.cts +2 -2
- package/dist/file-upload-inline/FileUploadInline.d.ts +2 -2
- package/dist/index.cjs +4 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/input/Input.d.cts +2 -2
- package/dist/input/Input.d.ts +2 -2
- package/dist/{TagsInput.cjs → tags-input/TagsInput.cjs} +100 -66
- package/dist/{TagsInput.d.ts → tags-input/TagsInput.d.cts} +7 -5
- package/dist/{TagsInput.d.cts → tags-input/TagsInput.d.ts} +7 -5
- package/dist/{TagsInput.js → tags-input/TagsInput.js} +100 -66
- package/dist/tags-input/TagsInputInline.cjs +81 -0
- package/dist/tags-input/TagsInputInline.d.cts +80 -0
- package/dist/tags-input/TagsInputInline.d.ts +80 -0
- package/dist/tags-input/TagsInputInline.js +76 -0
- package/dist/tags-input/index.cjs +2 -0
- package/dist/tags-input/index.d.cts +2 -0
- package/dist/tags-input/index.d.ts +2 -0
- package/dist/tags-input/index.js +2 -0
- package/dist/theme-toggle/ThemeModeDropdown.d.cts +2 -2
- package/dist/theme-toggle/ThemeModeDropdown.d.ts +2 -2
- package/dist/theme-toggle/ThemeModeSwitchInside.d.cts +2 -2
- package/dist/theme-toggle/ThemeModeSwitchInside.d.ts +2 -2
- package/dist/theme-toggle/ThemeModeSwitchOutside.d.cts +2 -2
- package/dist/theme-toggle/ThemeModeSwitchOutside.d.ts +2 -2
- package/dist/theme-toggle/ThemeModeToggleButton.d.cts +2 -2
- package/dist/theme-toggle/ThemeModeToggleButton.d.ts +2 -2
- package/package.json +3 -3
package/dist/dialog/Dialog.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
import * as _radix_ui_react_dialog0 from "@radix-ui/react-dialog";
|
|
4
4
|
|
|
@@ -9,14 +9,14 @@ declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<_radix_ui_re
|
|
|
9
9
|
declare function DialogHeader({
|
|
10
10
|
className,
|
|
11
11
|
...props
|
|
12
|
-
}: React$1.HTMLAttributes<HTMLDivElement>):
|
|
12
|
+
}: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
|
|
13
13
|
declare function DialogBody({
|
|
14
14
|
className,
|
|
15
15
|
...props
|
|
16
|
-
}: React$1.HTMLAttributes<HTMLDivElement>):
|
|
16
|
+
}: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
|
|
17
17
|
declare function DialogFooter({
|
|
18
18
|
className,
|
|
19
19
|
...props
|
|
20
|
-
}: React$1.HTMLAttributes<HTMLDivElement>):
|
|
20
|
+
}: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { DialogBody, DialogContent, DialogFooter, DialogHeader };
|
package/dist/dialog/Dialog.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
3
3
|
import * as _radix_ui_react_dialog0 from "@radix-ui/react-dialog";
|
|
4
4
|
|
|
5
5
|
//#region src/dialog/Dialog.d.ts
|
|
@@ -9,14 +9,14 @@ declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<_radix_ui_re
|
|
|
9
9
|
declare function DialogHeader({
|
|
10
10
|
className,
|
|
11
11
|
...props
|
|
12
|
-
}: React$1.HTMLAttributes<HTMLDivElement>):
|
|
12
|
+
}: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime7.JSX.Element;
|
|
13
13
|
declare function DialogBody({
|
|
14
14
|
className,
|
|
15
15
|
...props
|
|
16
|
-
}: React$1.HTMLAttributes<HTMLDivElement>):
|
|
16
|
+
}: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime7.JSX.Element;
|
|
17
17
|
declare function DialogFooter({
|
|
18
18
|
className,
|
|
19
19
|
...props
|
|
20
|
-
}: React$1.HTMLAttributes<HTMLDivElement>):
|
|
20
|
+
}: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime7.JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { DialogBody, DialogContent, DialogFooter, DialogHeader };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FileUploadProps } from "./types/index.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/file-upload/FileUpload.d.ts
|
|
5
|
-
declare function FileUpload(props: FileUploadProps):
|
|
5
|
+
declare function FileUpload(props: FileUploadProps): react_jsx_runtime7.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { FileUpload };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FileUploadProps } from "./types/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/file-upload/FileUpload.d.ts
|
|
5
|
-
declare function FileUpload(props: FileUploadProps):
|
|
5
|
+
declare function FileUpload(props: FileUploadProps): react_jsx_runtime18.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { FileUpload };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FileUploadInlineProps } from "./types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime11 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):
|
|
8
|
+
declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime11.JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { FileUploadInline };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FileUploadInlineProps } from "./types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime10 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):
|
|
8
|
+
declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime10.JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { FileUploadInline };
|
package/dist/index.cjs
CHANGED
|
@@ -58,7 +58,9 @@ const require_TabsContext = require('./tabs/TabsContext.cjs');
|
|
|
58
58
|
const require_TabsList = require('./tabs/TabsList.cjs');
|
|
59
59
|
const require_TabsTrigger = require('./tabs/TabsTrigger.cjs');
|
|
60
60
|
require('./tabs/index.cjs');
|
|
61
|
-
const
|
|
61
|
+
const require_TagsInputInline = require('./tags-input/TagsInputInline.cjs');
|
|
62
|
+
const require_TagsInput = require('./tags-input/TagsInput.cjs');
|
|
63
|
+
require('./tags-input/index.cjs');
|
|
62
64
|
const require_ThemeProvider = require('./theme-provider/ThemeProvider.cjs');
|
|
63
65
|
require('./theme-provider/index.cjs');
|
|
64
66
|
const require_ThemeModeDropdown = require('./theme-toggle/ThemeModeDropdown.cjs');
|
|
@@ -131,6 +133,7 @@ exports.TabsContext = require_TabsContext.TabsContext;
|
|
|
131
133
|
exports.TabsList = require_TabsList.TabsList;
|
|
132
134
|
exports.TabsTrigger = require_TabsTrigger.TabsTrigger;
|
|
133
135
|
exports.TagsInput = require_TagsInput.TagsInput;
|
|
136
|
+
exports.TagsInputInline = require_TagsInputInline.TagsInputInline;
|
|
134
137
|
exports.ThemeModeDropdown = require_ThemeModeDropdown.ThemeModeDropdown;
|
|
135
138
|
exports.ThemeModeSwitchInside = require_ThemeModeSwitchInside.ThemeModeSwitchInside;
|
|
136
139
|
exports.ThemeModeSwitchOutside = require_ThemeModeSwitchOutside.ThemeModeSwitchOutside;
|
package/dist/index.d.cts
CHANGED
|
@@ -62,7 +62,9 @@ import { TabsContext, TabsContextValue, useTabsContext } from "./tabs/TabsContex
|
|
|
62
62
|
import { TabsList, TabsListProps } from "./tabs/TabsList.cjs";
|
|
63
63
|
import { TabsTrigger, TabsTriggerProps } from "./tabs/TabsTrigger.cjs";
|
|
64
64
|
import "./tabs/index.cjs";
|
|
65
|
-
import { TagsInput, TagsInputProps } from "./TagsInput.cjs";
|
|
65
|
+
import { TagsInput, TagsInputProps } from "./tags-input/TagsInput.cjs";
|
|
66
|
+
import { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps } from "./tags-input/TagsInputInline.cjs";
|
|
67
|
+
import "./tags-input/index.cjs";
|
|
66
68
|
import { ThemeProvider, ThemeProviderProps } from "./theme-provider/ThemeProvider.cjs";
|
|
67
69
|
import { useTheme } from "./theme-provider/index.cjs";
|
|
68
70
|
import { ThemeModeDropdown, ThemeModeDropdownProps } from "./theme-toggle/ThemeModeDropdown.cjs";
|
|
@@ -76,4 +78,4 @@ import "./toast/index.cjs";
|
|
|
76
78
|
import { ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleGroupValue } from "./ToggleGroup.cjs";
|
|
77
79
|
import { isSvgMarkupString, svgMarkupToMaskUrl } from "./utils/svg.cjs";
|
|
78
80
|
import { cn } from "@pixpilot/shadcn";
|
|
79
|
-
export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupText, 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, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogProviderProps, DialogTitle, DialogTrigger, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, IconToggle, IconToggleProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverTrigger, PresetColor, Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectContentProps, 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, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleGroupValue, ToolbarItems, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
|
|
81
|
+
export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupText, 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, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogProviderProps, DialogTitle, DialogTrigger, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, IconToggle, IconToggleProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverTrigger, PresetColor, Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectContentProps, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputInline, TagsInputInlineItem, TagsInputInlineProps, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastMessage, Toaster, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleGroupValue, ToolbarItems, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -64,7 +64,9 @@ import { TabsContext, TabsContextValue, useTabsContext } from "./tabs/TabsContex
|
|
|
64
64
|
import { TabsList, TabsListProps } from "./tabs/TabsList.js";
|
|
65
65
|
import { TabsTrigger, TabsTriggerProps } from "./tabs/TabsTrigger.js";
|
|
66
66
|
import "./tabs/index.js";
|
|
67
|
-
import { TagsInput, TagsInputProps } from "./TagsInput.js";
|
|
67
|
+
import { TagsInput, TagsInputProps } from "./tags-input/TagsInput.js";
|
|
68
|
+
import { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps } from "./tags-input/TagsInputInline.js";
|
|
69
|
+
import "./tags-input/index.js";
|
|
68
70
|
import { ThemeProvider, ThemeProviderProps } from "./theme-provider/ThemeProvider.js";
|
|
69
71
|
import { useTheme } from "./theme-provider/index.js";
|
|
70
72
|
import { ThemeModeDropdown, ThemeModeDropdownProps } from "./theme-toggle/ThemeModeDropdown.js";
|
|
@@ -78,4 +80,4 @@ import "./toast/index.js";
|
|
|
78
80
|
import { ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleGroupValue } from "./ToggleGroup.js";
|
|
79
81
|
import { isSvgMarkupString, svgMarkupToMaskUrl } from "./utils/svg.js";
|
|
80
82
|
import { cn } from "@pixpilot/shadcn";
|
|
81
|
-
export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupText, 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, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogProviderProps, DialogTitle, DialogTrigger, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, IconToggle, IconToggleProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverTrigger, PresetColor, Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectContentProps, 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, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleGroupValue, ToolbarItems, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
|
|
83
|
+
export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupText, 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, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogProviderProps, DialogTitle, DialogTrigger, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, IconToggle, IconToggleProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverTrigger, PresetColor, Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectContentProps, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputInline, TagsInputInlineItem, TagsInputInlineProps, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastMessage, Toaster, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleGroupValue, ToolbarItems, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,9 @@ import { TabsContext, useTabsContext } from "./tabs/TabsContext.js";
|
|
|
59
59
|
import { TabsList } from "./tabs/TabsList.js";
|
|
60
60
|
import { TabsTrigger } from "./tabs/TabsTrigger.js";
|
|
61
61
|
import "./tabs/index.js";
|
|
62
|
-
import {
|
|
62
|
+
import { TagsInputInline } from "./tags-input/TagsInputInline.js";
|
|
63
|
+
import { TagsInput } from "./tags-input/TagsInput.js";
|
|
64
|
+
import "./tags-input/index.js";
|
|
63
65
|
import { ThemeProvider } from "./theme-provider/ThemeProvider.js";
|
|
64
66
|
import { useTheme } from "./theme-provider/index.js";
|
|
65
67
|
import { ThemeModeDropdown } from "./theme-toggle/ThemeModeDropdown.js";
|
|
@@ -73,4 +75,4 @@ import "./toast/index.js";
|
|
|
73
75
|
import { ToggleGroup, ToggleGroupItem } from "./ToggleGroup.js";
|
|
74
76
|
import { cn } from "@pixpilot/shadcn";
|
|
75
77
|
|
|
76
|
-
export { AbsoluteFill, Alert, AvatarUpload, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CircleLoader, CloseButtonAbsolute, CloseButtonRounded, ColorPicker, ColorPickerBase, ColorSelect, Combobox, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogTitle, DialogTrigger, FileUpload, FileUploadInline, IconPicker, IconToggle, Input, Layout, LayoutFooter, LayoutHeader, LayoutMain, LoadingOverlay, Pagination, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Rating, RatingButton, RichTextEditor, ScaledPreview, Select, Slider, SliderInput, SliderSelect, Tabs, TabsContent, TabsContext, TabsList, TabsTrigger, TagsInput, ThemeModeDropdown, ThemeModeSwitchInside, ThemeModeSwitchOutside, ThemeModeToggleButton, ThemeProvider, Toaster, ToggleGroup, ToggleGroupItem, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
|
|
78
|
+
export { AbsoluteFill, Alert, AvatarUpload, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CircleLoader, CloseButtonAbsolute, CloseButtonRounded, ColorPicker, ColorPickerBase, ColorSelect, Combobox, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogTitle, DialogTrigger, FileUpload, FileUploadInline, IconPicker, IconToggle, Input, Layout, LayoutFooter, LayoutHeader, LayoutMain, LoadingOverlay, Pagination, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Rating, RatingButton, RichTextEditor, ScaledPreview, Select, Slider, SliderInput, SliderSelect, Tabs, TabsContent, TabsContext, TabsList, TabsTrigger, TagsInput, TagsInputInline, ThemeModeDropdown, ThemeModeSwitchInside, ThemeModeSwitchOutside, ThemeModeToggleButton, ThemeProvider, Toaster, ToggleGroup, ToggleGroupItem, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
|
package/dist/input/Input.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime12 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):
|
|
13
|
+
declare function Input(props: InputProps$1): react_jsx_runtime12.JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { Input, InputProps$1 as InputProps };
|
package/dist/input/Input.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputProps } from "@pixpilot/shadcn";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime11 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):
|
|
13
|
+
declare function Input$1(props: InputProps$1): react_jsx_runtime11.JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { Input$1 as Input, InputProps$1 as InputProps };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
const require_rolldown_runtime = require('
|
|
5
|
-
const require_CommandOptionList = require('
|
|
4
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
5
|
+
const require_CommandOptionList = require('../CommandOptionList.cjs');
|
|
6
|
+
const require_TagsInputInline = require('./TagsInputInline.cjs');
|
|
6
7
|
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
7
8
|
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
8
9
|
let react = require("react");
|
|
@@ -10,7 +11,7 @@ react = require_rolldown_runtime.__toESM(react);
|
|
|
10
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
12
|
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
12
13
|
|
|
13
|
-
//#region src/TagsInput.tsx
|
|
14
|
+
//#region src/tags-input/TagsInput.tsx
|
|
14
15
|
const EMPTY_ARRAY = [];
|
|
15
16
|
const EMPTY_OPTIONS = [];
|
|
16
17
|
/**
|
|
@@ -29,9 +30,10 @@ const EMPTY_OPTIONS = [];
|
|
|
29
30
|
* - Options support with dropdown (like Select)
|
|
30
31
|
* - freeSolo mode for custom tags (like MUI Autocomplete)
|
|
31
32
|
*/
|
|
32
|
-
function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, freeSolo = true, placeholder = "Add tags...", emptyText = "No options found.", className, disabled = false, readOnly = false, maxTags, allowDuplicates = false, editable = false, label, delimiter = ",", addOnPaste = true, addOnTab = true, onValidate }) {
|
|
33
|
+
function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, freeSolo = true, placeholder = "Add tags...", emptyText = "No options found.", className, disabled = false, readOnly = false, maxTags, allowDuplicates = false, editable = false, label, delimiter = ",", addOnPaste = true, addOnTab = true, onValidate, addButtonVisibility = "touch" }) {
|
|
33
34
|
const [open, setOpen] = (0, react.useState)(false);
|
|
34
35
|
const [searchValue, setSearchValue] = (0, react.useState)("");
|
|
36
|
+
const [freeInputValue, setFreeInputValue] = (0, react.useState)("");
|
|
35
37
|
const inputRef = (0, react.useRef)(null);
|
|
36
38
|
const hasOptions = options.length > 0;
|
|
37
39
|
(0, react.useEffect)(() => {
|
|
@@ -64,6 +66,7 @@ function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, fre
|
|
|
64
66
|
]);
|
|
65
67
|
const handleValueChange = (0, react.useCallback)((newTags) => {
|
|
66
68
|
setSearchValue("");
|
|
69
|
+
setFreeInputValue("");
|
|
67
70
|
if (hasOptions) {
|
|
68
71
|
const convertedValues = newTags.map((tag) => {
|
|
69
72
|
return options.find((opt) => String(opt.value) === tag)?.value ?? tag;
|
|
@@ -93,6 +96,25 @@ function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, fre
|
|
|
93
96
|
freeSolo,
|
|
94
97
|
options
|
|
95
98
|
]);
|
|
99
|
+
const handleAddCurrentInput = (0, react.useCallback)(() => {
|
|
100
|
+
if (disabled || readOnly) return;
|
|
101
|
+
const nextValue = (hasOptions ? searchValue : freeInputValue).trim();
|
|
102
|
+
if (!nextValue) return;
|
|
103
|
+
if (!handleValidate(nextValue)) return;
|
|
104
|
+
handleValueChange([...stringValues, nextValue]);
|
|
105
|
+
inputRef.current?.focus();
|
|
106
|
+
}, [
|
|
107
|
+
disabled,
|
|
108
|
+
readOnly,
|
|
109
|
+
hasOptions,
|
|
110
|
+
searchValue,
|
|
111
|
+
freeInputValue,
|
|
112
|
+
handleValidate,
|
|
113
|
+
handleValueChange,
|
|
114
|
+
stringValues
|
|
115
|
+
]);
|
|
116
|
+
const currentInputValue = hasOptions ? searchValue : freeInputValue;
|
|
117
|
+
const canAddCurrentValue = Boolean(currentInputValue.trim()) && handleValidate(currentInputValue.trim());
|
|
96
118
|
const handleSelectOption = (0, react.useCallback)((optionValue) => {
|
|
97
119
|
const isSelected = value.some((v) => String(v) === String(optionValue));
|
|
98
120
|
let newValues;
|
|
@@ -101,7 +123,18 @@ function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, fre
|
|
|
101
123
|
onChange?.(newValues);
|
|
102
124
|
setSearchValue("");
|
|
103
125
|
}, [value, onChange]);
|
|
104
|
-
|
|
126
|
+
const inlineItems = (0, react.useMemo)(() => (hasOptions ? value : stringValues).map((tag) => ({
|
|
127
|
+
key: String(tag),
|
|
128
|
+
value: String(tag),
|
|
129
|
+
label: hasOptions ? getLabel(tag) : String(tag)
|
|
130
|
+
})), [
|
|
131
|
+
getLabel,
|
|
132
|
+
hasOptions,
|
|
133
|
+
stringValues,
|
|
134
|
+
value
|
|
135
|
+
]);
|
|
136
|
+
if (!hasOptions) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TagsInputInline.TagsInputInline, {
|
|
137
|
+
label,
|
|
105
138
|
className,
|
|
106
139
|
disabled,
|
|
107
140
|
editable,
|
|
@@ -113,14 +146,17 @@ function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, fre
|
|
|
113
146
|
delimiter,
|
|
114
147
|
addOnPaste,
|
|
115
148
|
addOnTab,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
149
|
+
items: inlineItems,
|
|
150
|
+
inputRef,
|
|
151
|
+
inputPlaceholder: placeholder,
|
|
152
|
+
inputValue: freeInputValue,
|
|
153
|
+
onInputChange: (e) => {
|
|
154
|
+
setFreeInputValue(e.target.value);
|
|
155
|
+
},
|
|
156
|
+
addButtonVisibility,
|
|
157
|
+
canAddCurrentValue,
|
|
158
|
+
onAddCurrentInput: handleAddCurrentInput,
|
|
159
|
+
showClear: value.length > 0 && !disabled && !readOnly
|
|
124
160
|
});
|
|
125
161
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
126
162
|
className: (0, __pixpilot_shadcn.cn)("relative", className),
|
|
@@ -131,7 +167,9 @@ function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, fre
|
|
|
131
167
|
asChild: true,
|
|
132
168
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
133
169
|
className: "w-full",
|
|
134
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.
|
|
170
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TagsInputInline.TagsInputInline, {
|
|
171
|
+
label,
|
|
172
|
+
showLabel: false,
|
|
135
173
|
disabled,
|
|
136
174
|
editable,
|
|
137
175
|
max: maxTags,
|
|
@@ -142,61 +180,57 @@ function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, fre
|
|
|
142
180
|
delimiter: freeSolo ? delimiter : void 0,
|
|
143
181
|
addOnPaste: freeSolo ? addOnPaste : false,
|
|
144
182
|
addOnTab: freeSolo ? addOnTab : false,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
183
|
+
items: inlineItems,
|
|
184
|
+
onListClick: (e) => {
|
|
185
|
+
if (!disabled && !readOnly) {
|
|
186
|
+
e.stopPropagation();
|
|
187
|
+
setOpen(true);
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
inputRef,
|
|
191
|
+
inputPlaceholder: placeholder,
|
|
192
|
+
inputValue: searchValue,
|
|
193
|
+
onInputFocus: (e) => {
|
|
194
|
+
e.stopPropagation();
|
|
195
|
+
setOpen(true);
|
|
196
|
+
},
|
|
197
|
+
onInputChange: (e) => {
|
|
198
|
+
e.stopPropagation();
|
|
199
|
+
setSearchValue(e.target.value);
|
|
200
|
+
},
|
|
201
|
+
onInputKeyDown: (e) => {
|
|
202
|
+
if (open && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
203
|
+
e.preventDefault();
|
|
204
|
+
e.stopPropagation();
|
|
205
|
+
const command = document.querySelector("[cmdk-root]");
|
|
206
|
+
if (command) {
|
|
207
|
+
const event = new KeyboardEvent("keydown", {
|
|
208
|
+
key: e.key,
|
|
209
|
+
bubbles: true,
|
|
210
|
+
cancelable: true
|
|
211
|
+
});
|
|
212
|
+
command.dispatchEvent(event);
|
|
150
213
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}, String(val));
|
|
158
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TagsInputInLineInput, {
|
|
159
|
-
ref: inputRef,
|
|
160
|
-
placeholder,
|
|
161
|
-
onFocus: (e) => {
|
|
162
|
-
e.stopPropagation();
|
|
163
|
-
setOpen(true);
|
|
164
|
-
},
|
|
165
|
-
onChange: (e) => {
|
|
166
|
-
e.stopPropagation();
|
|
167
|
-
setSearchValue(e.target.value);
|
|
168
|
-
},
|
|
169
|
-
onKeyDown: (e) => {
|
|
170
|
-
if (open && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
171
|
-
e.preventDefault();
|
|
172
|
-
e.stopPropagation();
|
|
173
|
-
const command = document.querySelector("[cmdk-root]");
|
|
174
|
-
if (command) {
|
|
175
|
-
const event = new KeyboardEvent("keydown", {
|
|
176
|
-
key: e.key,
|
|
177
|
-
bubbles: true,
|
|
178
|
-
cancelable: true
|
|
179
|
-
});
|
|
180
|
-
command.dispatchEvent(event);
|
|
181
|
-
}
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
if (open && e.key === "Enter") {
|
|
185
|
-
const selectedItem = document.querySelector("[cmdk-item][data-selected=\"true\"]");
|
|
186
|
-
if (selectedItem) {
|
|
187
|
-
e.preventDefault();
|
|
188
|
-
e.stopPropagation();
|
|
189
|
-
selectedItem.click();
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
e.stopPropagation();
|
|
194
|
-
},
|
|
195
|
-
onMouseDown: (e) => {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (open && e.key === "Enter") {
|
|
217
|
+
const selectedItem = document.querySelector("[cmdk-item][data-selected=\"true\"]");
|
|
218
|
+
if (selectedItem) {
|
|
219
|
+
e.preventDefault();
|
|
196
220
|
e.stopPropagation();
|
|
221
|
+
selectedItem.click();
|
|
222
|
+
return;
|
|
197
223
|
}
|
|
198
|
-
}
|
|
199
|
-
|
|
224
|
+
}
|
|
225
|
+
e.stopPropagation();
|
|
226
|
+
},
|
|
227
|
+
onInputMouseDown: (e) => {
|
|
228
|
+
e.stopPropagation();
|
|
229
|
+
},
|
|
230
|
+
addButtonVisibility,
|
|
231
|
+
canAddCurrentValue,
|
|
232
|
+
onAddCurrentInput: handleAddCurrentInput,
|
|
233
|
+
showClear: value.length > 0 && !disabled && !readOnly
|
|
200
234
|
})
|
|
201
235
|
})
|
|
202
236
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.PopoverContent, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CommandOptionListItem } from "
|
|
2
|
-
import * as
|
|
1
|
+
import { CommandOptionListItem } from "../CommandOptionList.cjs";
|
|
2
|
+
import * as react_jsx_runtime14 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
|
-
//#region src/TagsInput.d.ts
|
|
4
|
+
//#region src/tags-input/TagsInput.d.ts
|
|
5
5
|
interface TagsInputProps {
|
|
6
6
|
value?: Array<string | number>;
|
|
7
7
|
onChange?: (value: Array<string | number>) => void;
|
|
@@ -20,6 +20,7 @@ interface TagsInputProps {
|
|
|
20
20
|
addOnPaste?: boolean;
|
|
21
21
|
addOnTab?: boolean;
|
|
22
22
|
onValidate?: (value: string) => boolean;
|
|
23
|
+
addButtonVisibility?: 'always' | 'touch' | 'never';
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* TagsInput component - Inline tags input based on DiceUI
|
|
@@ -54,7 +55,8 @@ declare function TagsInput({
|
|
|
54
55
|
delimiter,
|
|
55
56
|
addOnPaste,
|
|
56
57
|
addOnTab,
|
|
57
|
-
onValidate
|
|
58
|
-
|
|
58
|
+
onValidate,
|
|
59
|
+
addButtonVisibility
|
|
60
|
+
}: TagsInputProps): react_jsx_runtime14.JSX.Element;
|
|
59
61
|
//#endregion
|
|
60
62
|
export { TagsInput, TagsInputProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CommandOptionListItem } from "
|
|
2
|
-
import * as
|
|
1
|
+
import { CommandOptionListItem } from "../CommandOptionList.js";
|
|
2
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
|
-
//#region src/TagsInput.d.ts
|
|
4
|
+
//#region src/tags-input/TagsInput.d.ts
|
|
5
5
|
interface TagsInputProps {
|
|
6
6
|
value?: Array<string | number>;
|
|
7
7
|
onChange?: (value: Array<string | number>) => void;
|
|
@@ -20,6 +20,7 @@ interface TagsInputProps {
|
|
|
20
20
|
addOnPaste?: boolean;
|
|
21
21
|
addOnTab?: boolean;
|
|
22
22
|
onValidate?: (value: string) => boolean;
|
|
23
|
+
addButtonVisibility?: 'always' | 'touch' | 'never';
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* TagsInput component - Inline tags input based on DiceUI
|
|
@@ -54,7 +55,8 @@ declare function TagsInput({
|
|
|
54
55
|
delimiter,
|
|
55
56
|
addOnPaste,
|
|
56
57
|
addOnTab,
|
|
57
|
-
onValidate
|
|
58
|
-
|
|
58
|
+
onValidate,
|
|
59
|
+
addButtonVisibility
|
|
60
|
+
}: TagsInputProps): react_jsx_runtime12.JSX.Element;
|
|
59
61
|
//#endregion
|
|
60
62
|
export { TagsInput, TagsInputProps };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
import { CommandOptionList } from "
|
|
5
|
-
import {
|
|
4
|
+
import { CommandOptionList } from "../CommandOptionList.js";
|
|
5
|
+
import { TagsInputInline } from "./TagsInputInline.js";
|
|
6
|
+
import { Command, Popover, PopoverContent, PopoverTrigger, TagsInputInLineLabel, cn } from "@pixpilot/shadcn";
|
|
6
7
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
|
|
9
|
-
//#region src/TagsInput.tsx
|
|
10
|
+
//#region src/tags-input/TagsInput.tsx
|
|
10
11
|
const EMPTY_ARRAY = [];
|
|
11
12
|
const EMPTY_OPTIONS = [];
|
|
12
13
|
/**
|
|
@@ -25,9 +26,10 @@ const EMPTY_OPTIONS = [];
|
|
|
25
26
|
* - Options support with dropdown (like Select)
|
|
26
27
|
* - freeSolo mode for custom tags (like MUI Autocomplete)
|
|
27
28
|
*/
|
|
28
|
-
function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, freeSolo = true, placeholder = "Add tags...", emptyText = "No options found.", className, disabled = false, readOnly = false, maxTags, allowDuplicates = false, editable = false, label, delimiter = ",", addOnPaste = true, addOnTab = true, onValidate }) {
|
|
29
|
+
function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, freeSolo = true, placeholder = "Add tags...", emptyText = "No options found.", className, disabled = false, readOnly = false, maxTags, allowDuplicates = false, editable = false, label, delimiter = ",", addOnPaste = true, addOnTab = true, onValidate, addButtonVisibility = "touch" }) {
|
|
29
30
|
const [open, setOpen] = useState(false);
|
|
30
31
|
const [searchValue, setSearchValue] = useState("");
|
|
32
|
+
const [freeInputValue, setFreeInputValue] = useState("");
|
|
31
33
|
const inputRef = useRef(null);
|
|
32
34
|
const hasOptions = options.length > 0;
|
|
33
35
|
useEffect(() => {
|
|
@@ -60,6 +62,7 @@ function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, fre
|
|
|
60
62
|
]);
|
|
61
63
|
const handleValueChange = useCallback((newTags) => {
|
|
62
64
|
setSearchValue("");
|
|
65
|
+
setFreeInputValue("");
|
|
63
66
|
if (hasOptions) {
|
|
64
67
|
const convertedValues = newTags.map((tag) => {
|
|
65
68
|
return options.find((opt) => String(opt.value) === tag)?.value ?? tag;
|
|
@@ -89,6 +92,25 @@ function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, fre
|
|
|
89
92
|
freeSolo,
|
|
90
93
|
options
|
|
91
94
|
]);
|
|
95
|
+
const handleAddCurrentInput = useCallback(() => {
|
|
96
|
+
if (disabled || readOnly) return;
|
|
97
|
+
const nextValue = (hasOptions ? searchValue : freeInputValue).trim();
|
|
98
|
+
if (!nextValue) return;
|
|
99
|
+
if (!handleValidate(nextValue)) return;
|
|
100
|
+
handleValueChange([...stringValues, nextValue]);
|
|
101
|
+
inputRef.current?.focus();
|
|
102
|
+
}, [
|
|
103
|
+
disabled,
|
|
104
|
+
readOnly,
|
|
105
|
+
hasOptions,
|
|
106
|
+
searchValue,
|
|
107
|
+
freeInputValue,
|
|
108
|
+
handleValidate,
|
|
109
|
+
handleValueChange,
|
|
110
|
+
stringValues
|
|
111
|
+
]);
|
|
112
|
+
const currentInputValue = hasOptions ? searchValue : freeInputValue;
|
|
113
|
+
const canAddCurrentValue = Boolean(currentInputValue.trim()) && handleValidate(currentInputValue.trim());
|
|
92
114
|
const handleSelectOption = useCallback((optionValue) => {
|
|
93
115
|
const isSelected = value.some((v) => String(v) === String(optionValue));
|
|
94
116
|
let newValues;
|
|
@@ -97,7 +119,18 @@ function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, fre
|
|
|
97
119
|
onChange?.(newValues);
|
|
98
120
|
setSearchValue("");
|
|
99
121
|
}, [value, onChange]);
|
|
100
|
-
|
|
122
|
+
const inlineItems = useMemo(() => (hasOptions ? value : stringValues).map((tag) => ({
|
|
123
|
+
key: String(tag),
|
|
124
|
+
value: String(tag),
|
|
125
|
+
label: hasOptions ? getLabel(tag) : String(tag)
|
|
126
|
+
})), [
|
|
127
|
+
getLabel,
|
|
128
|
+
hasOptions,
|
|
129
|
+
stringValues,
|
|
130
|
+
value
|
|
131
|
+
]);
|
|
132
|
+
if (!hasOptions) return /* @__PURE__ */ jsx(TagsInputInline, {
|
|
133
|
+
label,
|
|
101
134
|
className,
|
|
102
135
|
disabled,
|
|
103
136
|
editable,
|
|
@@ -109,14 +142,17 @@ function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, fre
|
|
|
109
142
|
delimiter,
|
|
110
143
|
addOnPaste,
|
|
111
144
|
addOnTab,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
145
|
+
items: inlineItems,
|
|
146
|
+
inputRef,
|
|
147
|
+
inputPlaceholder: placeholder,
|
|
148
|
+
inputValue: freeInputValue,
|
|
149
|
+
onInputChange: (e) => {
|
|
150
|
+
setFreeInputValue(e.target.value);
|
|
151
|
+
},
|
|
152
|
+
addButtonVisibility,
|
|
153
|
+
canAddCurrentValue,
|
|
154
|
+
onAddCurrentInput: handleAddCurrentInput,
|
|
155
|
+
showClear: value.length > 0 && !disabled && !readOnly
|
|
120
156
|
});
|
|
121
157
|
return /* @__PURE__ */ jsxs("div", {
|
|
122
158
|
className: cn("relative", className),
|
|
@@ -127,7 +163,9 @@ function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, fre
|
|
|
127
163
|
asChild: true,
|
|
128
164
|
children: /* @__PURE__ */ jsx("div", {
|
|
129
165
|
className: "w-full",
|
|
130
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ jsx(TagsInputInline, {
|
|
167
|
+
label,
|
|
168
|
+
showLabel: false,
|
|
131
169
|
disabled,
|
|
132
170
|
editable,
|
|
133
171
|
max: maxTags,
|
|
@@ -138,61 +176,57 @@ function TagsInput({ value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, fre
|
|
|
138
176
|
delimiter: freeSolo ? delimiter : void 0,
|
|
139
177
|
addOnPaste: freeSolo ? addOnPaste : false,
|
|
140
178
|
addOnTab: freeSolo ? addOnTab : false,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
179
|
+
items: inlineItems,
|
|
180
|
+
onListClick: (e) => {
|
|
181
|
+
if (!disabled && !readOnly) {
|
|
182
|
+
e.stopPropagation();
|
|
183
|
+
setOpen(true);
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
inputRef,
|
|
187
|
+
inputPlaceholder: placeholder,
|
|
188
|
+
inputValue: searchValue,
|
|
189
|
+
onInputFocus: (e) => {
|
|
190
|
+
e.stopPropagation();
|
|
191
|
+
setOpen(true);
|
|
192
|
+
},
|
|
193
|
+
onInputChange: (e) => {
|
|
194
|
+
e.stopPropagation();
|
|
195
|
+
setSearchValue(e.target.value);
|
|
196
|
+
},
|
|
197
|
+
onInputKeyDown: (e) => {
|
|
198
|
+
if (open && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
199
|
+
e.preventDefault();
|
|
200
|
+
e.stopPropagation();
|
|
201
|
+
const command = document.querySelector("[cmdk-root]");
|
|
202
|
+
if (command) {
|
|
203
|
+
const event = new KeyboardEvent("keydown", {
|
|
204
|
+
key: e.key,
|
|
205
|
+
bubbles: true,
|
|
206
|
+
cancelable: true
|
|
207
|
+
});
|
|
208
|
+
command.dispatchEvent(event);
|
|
146
209
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}, String(val));
|
|
154
|
-
}), /* @__PURE__ */ jsx(TagsInputInLineInput, {
|
|
155
|
-
ref: inputRef,
|
|
156
|
-
placeholder,
|
|
157
|
-
onFocus: (e) => {
|
|
158
|
-
e.stopPropagation();
|
|
159
|
-
setOpen(true);
|
|
160
|
-
},
|
|
161
|
-
onChange: (e) => {
|
|
162
|
-
e.stopPropagation();
|
|
163
|
-
setSearchValue(e.target.value);
|
|
164
|
-
},
|
|
165
|
-
onKeyDown: (e) => {
|
|
166
|
-
if (open && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
167
|
-
e.preventDefault();
|
|
168
|
-
e.stopPropagation();
|
|
169
|
-
const command = document.querySelector("[cmdk-root]");
|
|
170
|
-
if (command) {
|
|
171
|
-
const event = new KeyboardEvent("keydown", {
|
|
172
|
-
key: e.key,
|
|
173
|
-
bubbles: true,
|
|
174
|
-
cancelable: true
|
|
175
|
-
});
|
|
176
|
-
command.dispatchEvent(event);
|
|
177
|
-
}
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
if (open && e.key === "Enter") {
|
|
181
|
-
const selectedItem = document.querySelector("[cmdk-item][data-selected=\"true\"]");
|
|
182
|
-
if (selectedItem) {
|
|
183
|
-
e.preventDefault();
|
|
184
|
-
e.stopPropagation();
|
|
185
|
-
selectedItem.click();
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
e.stopPropagation();
|
|
190
|
-
},
|
|
191
|
-
onMouseDown: (e) => {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (open && e.key === "Enter") {
|
|
213
|
+
const selectedItem = document.querySelector("[cmdk-item][data-selected=\"true\"]");
|
|
214
|
+
if (selectedItem) {
|
|
215
|
+
e.preventDefault();
|
|
192
216
|
e.stopPropagation();
|
|
217
|
+
selectedItem.click();
|
|
218
|
+
return;
|
|
193
219
|
}
|
|
194
|
-
}
|
|
195
|
-
|
|
220
|
+
}
|
|
221
|
+
e.stopPropagation();
|
|
222
|
+
},
|
|
223
|
+
onInputMouseDown: (e) => {
|
|
224
|
+
e.stopPropagation();
|
|
225
|
+
},
|
|
226
|
+
addButtonVisibility,
|
|
227
|
+
canAddCurrentValue,
|
|
228
|
+
onAddCurrentInput: handleAddCurrentInput,
|
|
229
|
+
showClear: value.length > 0 && !disabled && !readOnly
|
|
196
230
|
})
|
|
197
231
|
})
|
|
198
232
|
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
5
|
+
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
6
|
+
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
7
|
+
let lucide_react = require("lucide-react");
|
|
8
|
+
lucide_react = require_rolldown_runtime.__toESM(lucide_react);
|
|
9
|
+
let react = require("react");
|
|
10
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
11
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
13
|
+
|
|
14
|
+
//#region src/tags-input/TagsInputInline.tsx
|
|
15
|
+
function TagsInputInline({ label, showLabel = true, className, disabled = false, editable, max, onValueChange, onValidate, readOnly = false, value, delimiter, addOnPaste, addOnTab, items, onListClick, inputRef, inputPlaceholder, inputValue, onInputFocus, onInputChange, onInputKeyDown, onInputMouseDown, addButtonVisibility = "touch", slots, canAddCurrentValue = false, onAddCurrentInput, showClear = false }) {
|
|
16
|
+
const addButtonVisibilityClassName = (0, react.useMemo)(() => {
|
|
17
|
+
if (addButtonVisibility === "always") return "inline-flex";
|
|
18
|
+
if (addButtonVisibility === "touch") return "hidden pointer-coarse:inline-flex";
|
|
19
|
+
return "hidden";
|
|
20
|
+
}, [addButtonVisibility]);
|
|
21
|
+
const isAddDisabled = disabled || readOnly || !canAddCurrentValue;
|
|
22
|
+
const { className: listClassName,...listRest } = slots?.list || {};
|
|
23
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.TagsInputInLineRoot, {
|
|
24
|
+
className,
|
|
25
|
+
disabled,
|
|
26
|
+
editable,
|
|
27
|
+
max,
|
|
28
|
+
onValueChange,
|
|
29
|
+
onValidate,
|
|
30
|
+
readOnly,
|
|
31
|
+
value,
|
|
32
|
+
delimiter,
|
|
33
|
+
addOnPaste,
|
|
34
|
+
addOnTab,
|
|
35
|
+
children: [
|
|
36
|
+
showLabel && label !== void 0 && label !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TagsInputInLineLabel, {
|
|
37
|
+
...slots?.label || {},
|
|
38
|
+
children: label
|
|
39
|
+
}) : null,
|
|
40
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.TagsInputInLineList, {
|
|
41
|
+
...listRest,
|
|
42
|
+
className: (0, __pixpilot_shadcn.cn)("relative pr-10", listClassName),
|
|
43
|
+
onClick: onListClick,
|
|
44
|
+
children: [
|
|
45
|
+
items.map((item) => /* @__PURE__ */ (0, react.createElement)(__pixpilot_shadcn.TagsInputInLineItem, {
|
|
46
|
+
...slots?.item || {},
|
|
47
|
+
key: item.key,
|
|
48
|
+
value: item.value
|
|
49
|
+
}, item.label)),
|
|
50
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TagsInputInLineInput, {
|
|
51
|
+
...slots?.input || {},
|
|
52
|
+
ref: inputRef,
|
|
53
|
+
placeholder: inputPlaceholder,
|
|
54
|
+
value: inputValue,
|
|
55
|
+
onFocus: onInputFocus,
|
|
56
|
+
onChange: onInputChange,
|
|
57
|
+
onKeyDown: onInputKeyDown,
|
|
58
|
+
onMouseDown: onInputMouseDown
|
|
59
|
+
}),
|
|
60
|
+
addButtonVisibility !== "never" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Button, {
|
|
61
|
+
...slots?.addButton,
|
|
62
|
+
type: "button",
|
|
63
|
+
size: "icon",
|
|
64
|
+
variant: "ghost",
|
|
65
|
+
className: (0, __pixpilot_shadcn.cn)("absolute top-1/2 right-1.5 h-8 w-8 -translate-y-1/2 shrink-0", slots?.addButton?.className, addButtonVisibilityClassName),
|
|
66
|
+
disabled: isAddDisabled,
|
|
67
|
+
onClick: onAddCurrentInput,
|
|
68
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Plus, { className: "size-5" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
69
|
+
className: "sr-only",
|
|
70
|
+
children: "Add tag"
|
|
71
|
+
})]
|
|
72
|
+
}) : null
|
|
73
|
+
]
|
|
74
|
+
}),
|
|
75
|
+
showClear ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TagsInputInLineClear, { ...slots?.clear || {} }) : null
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
exports.TagsInputInline = TagsInputInline;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
2
|
+
import { ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, Ref } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/tags-input/TagsInputInline.d.ts
|
|
5
|
+
interface TagsInputInlineItem {
|
|
6
|
+
key: string;
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
interface TagsInputInlineProps {
|
|
11
|
+
label?: string;
|
|
12
|
+
showLabel?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
editable?: boolean;
|
|
16
|
+
max?: number;
|
|
17
|
+
onValueChange: (value: string[]) => void;
|
|
18
|
+
onValidate: (value: string) => boolean;
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
value: string[];
|
|
21
|
+
delimiter?: string;
|
|
22
|
+
addOnPaste?: boolean;
|
|
23
|
+
addOnTab?: boolean;
|
|
24
|
+
items: TagsInputInlineItem[];
|
|
25
|
+
onListClick?: MouseEventHandler<HTMLDivElement>;
|
|
26
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
27
|
+
inputPlaceholder?: string;
|
|
28
|
+
inputValue: string;
|
|
29
|
+
onInputFocus?: FocusEventHandler<HTMLInputElement>;
|
|
30
|
+
onInputChange?: ChangeEventHandler<HTMLInputElement>;
|
|
31
|
+
onInputKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
32
|
+
onInputMouseDown?: MouseEventHandler<HTMLInputElement>;
|
|
33
|
+
addButtonVisibility?: 'always' | 'touch' | 'never';
|
|
34
|
+
slots?: {
|
|
35
|
+
list?: {
|
|
36
|
+
className?: string;
|
|
37
|
+
};
|
|
38
|
+
label?: Record<string, any>;
|
|
39
|
+
item?: Record<string, any>;
|
|
40
|
+
input?: Record<string, any>;
|
|
41
|
+
addButton?: {
|
|
42
|
+
className?: string;
|
|
43
|
+
};
|
|
44
|
+
clear?: Record<string, any>;
|
|
45
|
+
};
|
|
46
|
+
canAddCurrentValue?: boolean;
|
|
47
|
+
onAddCurrentInput?: () => void;
|
|
48
|
+
showClear?: boolean;
|
|
49
|
+
}
|
|
50
|
+
declare function TagsInputInline({
|
|
51
|
+
label,
|
|
52
|
+
showLabel,
|
|
53
|
+
className,
|
|
54
|
+
disabled,
|
|
55
|
+
editable,
|
|
56
|
+
max,
|
|
57
|
+
onValueChange,
|
|
58
|
+
onValidate,
|
|
59
|
+
readOnly,
|
|
60
|
+
value,
|
|
61
|
+
delimiter,
|
|
62
|
+
addOnPaste,
|
|
63
|
+
addOnTab,
|
|
64
|
+
items,
|
|
65
|
+
onListClick,
|
|
66
|
+
inputRef,
|
|
67
|
+
inputPlaceholder,
|
|
68
|
+
inputValue,
|
|
69
|
+
onInputFocus,
|
|
70
|
+
onInputChange,
|
|
71
|
+
onInputKeyDown,
|
|
72
|
+
onInputMouseDown,
|
|
73
|
+
addButtonVisibility,
|
|
74
|
+
slots,
|
|
75
|
+
canAddCurrentValue,
|
|
76
|
+
onAddCurrentInput,
|
|
77
|
+
showClear
|
|
78
|
+
}: TagsInputInlineProps): react_jsx_runtime13.JSX.Element;
|
|
79
|
+
//#endregion
|
|
80
|
+
export { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, Ref } from "react";
|
|
2
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/tags-input/TagsInputInline.d.ts
|
|
5
|
+
interface TagsInputInlineItem {
|
|
6
|
+
key: string;
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
interface TagsInputInlineProps {
|
|
11
|
+
label?: string;
|
|
12
|
+
showLabel?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
editable?: boolean;
|
|
16
|
+
max?: number;
|
|
17
|
+
onValueChange: (value: string[]) => void;
|
|
18
|
+
onValidate: (value: string) => boolean;
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
value: string[];
|
|
21
|
+
delimiter?: string;
|
|
22
|
+
addOnPaste?: boolean;
|
|
23
|
+
addOnTab?: boolean;
|
|
24
|
+
items: TagsInputInlineItem[];
|
|
25
|
+
onListClick?: MouseEventHandler<HTMLDivElement>;
|
|
26
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
27
|
+
inputPlaceholder?: string;
|
|
28
|
+
inputValue: string;
|
|
29
|
+
onInputFocus?: FocusEventHandler<HTMLInputElement>;
|
|
30
|
+
onInputChange?: ChangeEventHandler<HTMLInputElement>;
|
|
31
|
+
onInputKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
32
|
+
onInputMouseDown?: MouseEventHandler<HTMLInputElement>;
|
|
33
|
+
addButtonVisibility?: 'always' | 'touch' | 'never';
|
|
34
|
+
slots?: {
|
|
35
|
+
list?: {
|
|
36
|
+
className?: string;
|
|
37
|
+
};
|
|
38
|
+
label?: Record<string, any>;
|
|
39
|
+
item?: Record<string, any>;
|
|
40
|
+
input?: Record<string, any>;
|
|
41
|
+
addButton?: {
|
|
42
|
+
className?: string;
|
|
43
|
+
};
|
|
44
|
+
clear?: Record<string, any>;
|
|
45
|
+
};
|
|
46
|
+
canAddCurrentValue?: boolean;
|
|
47
|
+
onAddCurrentInput?: () => void;
|
|
48
|
+
showClear?: boolean;
|
|
49
|
+
}
|
|
50
|
+
declare function TagsInputInline({
|
|
51
|
+
label,
|
|
52
|
+
showLabel,
|
|
53
|
+
className,
|
|
54
|
+
disabled,
|
|
55
|
+
editable,
|
|
56
|
+
max,
|
|
57
|
+
onValueChange,
|
|
58
|
+
onValidate,
|
|
59
|
+
readOnly,
|
|
60
|
+
value,
|
|
61
|
+
delimiter,
|
|
62
|
+
addOnPaste,
|
|
63
|
+
addOnTab,
|
|
64
|
+
items,
|
|
65
|
+
onListClick,
|
|
66
|
+
inputRef,
|
|
67
|
+
inputPlaceholder,
|
|
68
|
+
inputValue,
|
|
69
|
+
onInputFocus,
|
|
70
|
+
onInputChange,
|
|
71
|
+
onInputKeyDown,
|
|
72
|
+
onInputMouseDown,
|
|
73
|
+
addButtonVisibility,
|
|
74
|
+
slots,
|
|
75
|
+
canAddCurrentValue,
|
|
76
|
+
onAddCurrentInput,
|
|
77
|
+
showClear
|
|
78
|
+
}: TagsInputInlineProps): react_jsx_runtime13.JSX.Element;
|
|
79
|
+
//#endregion
|
|
80
|
+
export { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { Button, TagsInputInLineClear, TagsInputInLineInput, TagsInputInLineItem, TagsInputInLineLabel, TagsInputInLineList, TagsInputInLineRoot, cn } from "@pixpilot/shadcn";
|
|
5
|
+
import { Plus } from "lucide-react";
|
|
6
|
+
import { createElement, useMemo } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/tags-input/TagsInputInline.tsx
|
|
10
|
+
function TagsInputInline({ label, showLabel = true, className, disabled = false, editable, max, onValueChange, onValidate, readOnly = false, value, delimiter, addOnPaste, addOnTab, items, onListClick, inputRef, inputPlaceholder, inputValue, onInputFocus, onInputChange, onInputKeyDown, onInputMouseDown, addButtonVisibility = "touch", slots, canAddCurrentValue = false, onAddCurrentInput, showClear = false }) {
|
|
11
|
+
const addButtonVisibilityClassName = useMemo(() => {
|
|
12
|
+
if (addButtonVisibility === "always") return "inline-flex";
|
|
13
|
+
if (addButtonVisibility === "touch") return "hidden pointer-coarse:inline-flex";
|
|
14
|
+
return "hidden";
|
|
15
|
+
}, [addButtonVisibility]);
|
|
16
|
+
const isAddDisabled = disabled || readOnly || !canAddCurrentValue;
|
|
17
|
+
const { className: listClassName,...listRest } = slots?.list || {};
|
|
18
|
+
return /* @__PURE__ */ jsxs(TagsInputInLineRoot, {
|
|
19
|
+
className,
|
|
20
|
+
disabled,
|
|
21
|
+
editable,
|
|
22
|
+
max,
|
|
23
|
+
onValueChange,
|
|
24
|
+
onValidate,
|
|
25
|
+
readOnly,
|
|
26
|
+
value,
|
|
27
|
+
delimiter,
|
|
28
|
+
addOnPaste,
|
|
29
|
+
addOnTab,
|
|
30
|
+
children: [
|
|
31
|
+
showLabel && label !== void 0 && label !== "" ? /* @__PURE__ */ jsx(TagsInputInLineLabel, {
|
|
32
|
+
...slots?.label || {},
|
|
33
|
+
children: label
|
|
34
|
+
}) : null,
|
|
35
|
+
/* @__PURE__ */ jsxs(TagsInputInLineList, {
|
|
36
|
+
...listRest,
|
|
37
|
+
className: cn("relative pr-10", listClassName),
|
|
38
|
+
onClick: onListClick,
|
|
39
|
+
children: [
|
|
40
|
+
items.map((item) => /* @__PURE__ */ createElement(TagsInputInLineItem, {
|
|
41
|
+
...slots?.item || {},
|
|
42
|
+
key: item.key,
|
|
43
|
+
value: item.value
|
|
44
|
+
}, item.label)),
|
|
45
|
+
/* @__PURE__ */ jsx(TagsInputInLineInput, {
|
|
46
|
+
...slots?.input || {},
|
|
47
|
+
ref: inputRef,
|
|
48
|
+
placeholder: inputPlaceholder,
|
|
49
|
+
value: inputValue,
|
|
50
|
+
onFocus: onInputFocus,
|
|
51
|
+
onChange: onInputChange,
|
|
52
|
+
onKeyDown: onInputKeyDown,
|
|
53
|
+
onMouseDown: onInputMouseDown
|
|
54
|
+
}),
|
|
55
|
+
addButtonVisibility !== "never" ? /* @__PURE__ */ jsxs(Button, {
|
|
56
|
+
...slots?.addButton,
|
|
57
|
+
type: "button",
|
|
58
|
+
size: "icon",
|
|
59
|
+
variant: "ghost",
|
|
60
|
+
className: cn("absolute top-1/2 right-1.5 h-8 w-8 -translate-y-1/2 shrink-0", slots?.addButton?.className, addButtonVisibilityClassName),
|
|
61
|
+
disabled: isAddDisabled,
|
|
62
|
+
onClick: onAddCurrentInput,
|
|
63
|
+
children: [/* @__PURE__ */ jsx(Plus, { className: "size-5" }), /* @__PURE__ */ jsx("span", {
|
|
64
|
+
className: "sr-only",
|
|
65
|
+
children: "Add tag"
|
|
66
|
+
})]
|
|
67
|
+
}) : null
|
|
68
|
+
]
|
|
69
|
+
}),
|
|
70
|
+
showClear ? /* @__PURE__ */ jsx(TagsInputInLineClear, { ...slots?.clear || {} }) : null
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { TagsInputInline };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime16 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):
|
|
20
|
+
declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime16.JSX.Element;
|
|
21
21
|
declare namespace ThemeModeDropdown {
|
|
22
22
|
var displayName: string;
|
|
23
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime15 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):
|
|
20
|
+
declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime15.JSX.Element;
|
|
21
21
|
declare namespace ThemeModeDropdown {
|
|
22
22
|
var displayName: string;
|
|
23
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime17 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):
|
|
28
|
+
declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime17.JSX.Element;
|
|
29
29
|
declare namespace ThemeModeSwitchInside {
|
|
30
30
|
var displayName: string;
|
|
31
31
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime16 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):
|
|
28
|
+
declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime16.JSX.Element;
|
|
29
29
|
declare namespace ThemeModeSwitchInside {
|
|
30
30
|
var displayName: string;
|
|
31
31
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime18 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):
|
|
25
|
+
declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime18.JSX.Element;
|
|
26
26
|
declare namespace ThemeModeSwitchOutside {
|
|
27
27
|
var displayName: string;
|
|
28
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime17 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):
|
|
25
|
+
declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime17.JSX.Element;
|
|
26
26
|
declare namespace ThemeModeSwitchOutside {
|
|
27
27
|
var displayName: string;
|
|
28
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime15 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):
|
|
16
|
+
declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime15.JSX.Element;
|
|
17
17
|
declare namespace ThemeModeToggleButton {
|
|
18
18
|
var displayName: string;
|
|
19
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime14 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):
|
|
16
|
+
declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime14.JSX.Element;
|
|
17
17
|
declare namespace ThemeModeToggleButton {
|
|
18
18
|
var displayName: string;
|
|
19
19
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixpilot/shadcn-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.48.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",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"@internal/eslint-config": "0.3.0",
|
|
64
64
|
"@internal/hooks": "0.0.0",
|
|
65
65
|
"@internal/prettier-config": "0.0.1",
|
|
66
|
-
"@internal/tsconfig": "0.1.0",
|
|
67
66
|
"@internal/tsdown-config": "0.1.0",
|
|
68
|
-
"@internal/vitest-config": "0.1.0"
|
|
67
|
+
"@internal/vitest-config": "0.1.0",
|
|
68
|
+
"@internal/tsconfig": "0.1.0"
|
|
69
69
|
},
|
|
70
70
|
"prettier": "@internal/prettier-config",
|
|
71
71
|
"scripts": {
|