@pixpilot/shadcn-ui 0.10.0 → 0.12.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/ScaledPreview.cjs +44 -0
- package/dist/ScaledPreview.d.cts +23 -0
- package/dist/ScaledPreview.d.ts +23 -0
- package/dist/ScaledPreview.js +41 -0
- package/dist/index.cjs +5 -0
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +3 -1
- package/dist/tabs/TabsContext.cjs +13 -0
- package/dist/tabs/TabsContext.d.cts +11 -0
- package/dist/tabs/TabsContext.d.ts +11 -0
- package/dist/tabs/TabsContext.js +10 -0
- package/dist/tabs/TabsList.cjs +17 -7
- package/dist/tabs/TabsList.d.cts +3 -3
- package/dist/tabs/TabsList.d.ts +3 -3
- package/dist/tabs/TabsList.js +18 -8
- package/dist/tabs/TabsTrigger.cjs +4 -1
- package/dist/tabs/TabsTrigger.d.cts +2 -2
- package/dist/tabs/TabsTrigger.d.ts +2 -2
- package/dist/tabs/TabsTrigger.js +4 -1
- package/dist/tabs/index.cjs +1 -0
- package/dist/tabs/index.d.cts +3 -1
- package/dist/tabs/index.d.ts +3 -1
- package/dist/tabs/index.js +1 -0
- package/dist/tabs/types.d.cts +2 -2
- package/dist/tabs/types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
6
|
+
|
|
7
|
+
//#region src/ScaledPreview.tsx
|
|
8
|
+
const DEFAULT_BASE_SIZE = {
|
|
9
|
+
width: 1e3,
|
|
10
|
+
height: 1e3
|
|
11
|
+
};
|
|
12
|
+
const DEFAULT_PADDING = 0;
|
|
13
|
+
const PADDING_SIDES = 2;
|
|
14
|
+
const ScaledPreview = ({ baseSize = DEFAULT_BASE_SIZE, scaleFactor, previewBoxSize, padding = DEFAULT_PADDING, forceScale, children,...rest }) => {
|
|
15
|
+
const calculatedPreviewBoxSize = previewBoxSize || {
|
|
16
|
+
width: scaleFactor * baseSize.width,
|
|
17
|
+
height: scaleFactor * baseSize.height
|
|
18
|
+
};
|
|
19
|
+
const calculatedScale = Math.min((calculatedPreviewBoxSize.width - padding * PADDING_SIDES) / baseSize.width, (calculatedPreviewBoxSize.height - padding * PADDING_SIDES) / baseSize.height);
|
|
20
|
+
const finalScale = forceScale ?? calculatedScale;
|
|
21
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22
|
+
...rest,
|
|
23
|
+
style: {
|
|
24
|
+
width: calculatedPreviewBoxSize.width,
|
|
25
|
+
height: calculatedPreviewBoxSize.height,
|
|
26
|
+
position: "relative",
|
|
27
|
+
...rest.style
|
|
28
|
+
},
|
|
29
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
30
|
+
className: "absolute top-1/2 left-1/2",
|
|
31
|
+
style: {
|
|
32
|
+
width: baseSize.width,
|
|
33
|
+
height: baseSize.height,
|
|
34
|
+
transform: `translate(-50%, -50%) scale(${finalScale})`,
|
|
35
|
+
transformOrigin: "center"
|
|
36
|
+
},
|
|
37
|
+
children
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
ScaledPreview.displayName = "ScaledPreview";
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
exports.ScaledPreview = ScaledPreview;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/ScaledPreview.d.ts
|
|
4
|
+
interface ScaledPreviewSize {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
interface ScaledPreviewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
/** Base content dimensions. Defaults to 1000×1000. */
|
|
10
|
+
baseSize?: ScaledPreviewSize;
|
|
11
|
+
/** Scale factor for preview box (e.g., 0.5 = 50% of baseSize). */
|
|
12
|
+
scaleFactor: number;
|
|
13
|
+
/** Explicit preview box size. If provided, ignores scaleFactor. */
|
|
14
|
+
previewBoxSize?: ScaledPreviewSize;
|
|
15
|
+
/** Padding in pixels (reduces available space for content scaling). */
|
|
16
|
+
padding?: number;
|
|
17
|
+
/** Manual content scale override (bypasses automatic fit calculation). */
|
|
18
|
+
forceScale?: number;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
declare const ScaledPreview: React.FC<ScaledPreviewProps>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { ScaledPreview, ScaledPreviewProps, ScaledPreviewSize };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/ScaledPreview.d.ts
|
|
4
|
+
interface ScaledPreviewSize {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
interface ScaledPreviewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
/** Base content dimensions. Defaults to 1000×1000. */
|
|
10
|
+
baseSize?: ScaledPreviewSize;
|
|
11
|
+
/** Scale factor for preview box (e.g., 0.5 = 50% of baseSize). */
|
|
12
|
+
scaleFactor: number;
|
|
13
|
+
/** Explicit preview box size. If provided, ignores scaleFactor. */
|
|
14
|
+
previewBoxSize?: ScaledPreviewSize;
|
|
15
|
+
/** Padding in pixels (reduces available space for content scaling). */
|
|
16
|
+
padding?: number;
|
|
17
|
+
/** Manual content scale override (bypasses automatic fit calculation). */
|
|
18
|
+
forceScale?: number;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
declare const ScaledPreview: React.FC<ScaledPreviewProps>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { ScaledPreview, ScaledPreviewProps, ScaledPreviewSize };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/ScaledPreview.tsx
|
|
5
|
+
const DEFAULT_BASE_SIZE = {
|
|
6
|
+
width: 1e3,
|
|
7
|
+
height: 1e3
|
|
8
|
+
};
|
|
9
|
+
const DEFAULT_PADDING = 0;
|
|
10
|
+
const PADDING_SIDES = 2;
|
|
11
|
+
const ScaledPreview = ({ baseSize = DEFAULT_BASE_SIZE, scaleFactor, previewBoxSize, padding = DEFAULT_PADDING, forceScale, children,...rest }) => {
|
|
12
|
+
const calculatedPreviewBoxSize = previewBoxSize || {
|
|
13
|
+
width: scaleFactor * baseSize.width,
|
|
14
|
+
height: scaleFactor * baseSize.height
|
|
15
|
+
};
|
|
16
|
+
const calculatedScale = Math.min((calculatedPreviewBoxSize.width - padding * PADDING_SIDES) / baseSize.width, (calculatedPreviewBoxSize.height - padding * PADDING_SIDES) / baseSize.height);
|
|
17
|
+
const finalScale = forceScale ?? calculatedScale;
|
|
18
|
+
return /* @__PURE__ */ jsx("div", {
|
|
19
|
+
...rest,
|
|
20
|
+
style: {
|
|
21
|
+
width: calculatedPreviewBoxSize.width,
|
|
22
|
+
height: calculatedPreviewBoxSize.height,
|
|
23
|
+
position: "relative",
|
|
24
|
+
...rest.style
|
|
25
|
+
},
|
|
26
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: "absolute top-1/2 left-1/2",
|
|
28
|
+
style: {
|
|
29
|
+
width: baseSize.width,
|
|
30
|
+
height: baseSize.height,
|
|
31
|
+
transform: `translate(-50%, -50%) scale(${finalScale})`,
|
|
32
|
+
transformOrigin: "center"
|
|
33
|
+
},
|
|
34
|
+
children
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
ScaledPreview.displayName = "ScaledPreview";
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
export { ScaledPreview };
|
package/dist/index.cjs
CHANGED
|
@@ -32,8 +32,10 @@ const require_Pagination = require('./pagination/Pagination.cjs');
|
|
|
32
32
|
require('./pagination/index.cjs');
|
|
33
33
|
const require_RichTextEditor = require('./rich-text-editor/RichTextEditor.cjs');
|
|
34
34
|
require('./rich-text-editor/index.cjs');
|
|
35
|
+
const require_ScaledPreview = require('./ScaledPreview.cjs');
|
|
35
36
|
const require_Select = require('./Select.cjs');
|
|
36
37
|
const require_Slider = require('./Slider.cjs');
|
|
38
|
+
const require_TabsContext = require('./tabs/TabsContext.cjs');
|
|
37
39
|
const require_TabsList = require('./tabs/TabsList.cjs');
|
|
38
40
|
const require_TabsTrigger = require('./tabs/TabsTrigger.cjs');
|
|
39
41
|
require('./tabs/index.cjs');
|
|
@@ -70,10 +72,12 @@ exports.LayoutMain = require_LayoutMain.LayoutMain;
|
|
|
70
72
|
exports.LoadingOverlay = require_LoadingOverlay.LoadingOverlay;
|
|
71
73
|
exports.Pagination = require_Pagination.Pagination;
|
|
72
74
|
exports.RichTextEditor = require_RichTextEditor.RichTextEditor;
|
|
75
|
+
exports.ScaledPreview = require_ScaledPreview.ScaledPreview;
|
|
73
76
|
exports.Select = require_Select.Select;
|
|
74
77
|
exports.Slider = require_Slider.Slider;
|
|
75
78
|
exports.Tabs = __pixpilot_shadcn.Tabs;
|
|
76
79
|
exports.TabsContent = __pixpilot_shadcn.TabsContent;
|
|
80
|
+
exports.TabsContext = require_TabsContext.TabsContext;
|
|
77
81
|
exports.TabsList = require_TabsList.TabsList;
|
|
78
82
|
exports.TabsTrigger = require_TabsTrigger.TabsTrigger;
|
|
79
83
|
exports.TagsInput = require_tags_input.TagsInput;
|
|
@@ -87,6 +91,7 @@ exports.toastInfo = require_toast.toastInfo;
|
|
|
87
91
|
exports.toastSuccess = require_toast.toastSuccess;
|
|
88
92
|
exports.toastWarning = require_toast.toastWarning;
|
|
89
93
|
exports.useMediaQuery = require_use_media_query.useMediaQuery;
|
|
94
|
+
exports.useTabsContext = require_TabsContext.useTabsContext;
|
|
90
95
|
Object.defineProperty(exports, 'useTheme', {
|
|
91
96
|
enumerable: true,
|
|
92
97
|
get: function () {
|
package/dist/index.d.cts
CHANGED
|
@@ -34,11 +34,14 @@ import { Pagination, PaginationProps } from "./pagination/Pagination.cjs";
|
|
|
34
34
|
import "./pagination/index.cjs";
|
|
35
35
|
import { RichTextEditor, RichTextEditorProps, ToolbarOption } from "./rich-text-editor/RichTextEditor.cjs";
|
|
36
36
|
import "./rich-text-editor/index.cjs";
|
|
37
|
+
import { ScaledPreview, ScaledPreviewProps, ScaledPreviewSize } from "./ScaledPreview.cjs";
|
|
37
38
|
import { Select, SelectOption } from "./Select.cjs";
|
|
38
39
|
import { Slider, SliderProps } from "./Slider.cjs";
|
|
39
40
|
import { Tabs } from "./tabs/Tabs.cjs";
|
|
40
41
|
import { TabsContent } from "./tabs/TabsContent.cjs";
|
|
41
|
-
import {
|
|
42
|
+
import { BaseTabsTriggerProps, TabsVariant } from "./tabs/types.cjs";
|
|
43
|
+
import { TabsContext, TabsContextValue, useTabsContext } from "./tabs/TabsContext.cjs";
|
|
44
|
+
import { TabsList, TabsListProps } from "./tabs/TabsList.cjs";
|
|
42
45
|
import { TabsTrigger, TabsTriggerProps } from "./tabs/TabsTrigger.cjs";
|
|
43
46
|
import "./tabs/index.cjs";
|
|
44
47
|
import { TagsInput, TagsInputProps } from "./tags-input.cjs";
|
|
@@ -48,4 +51,4 @@ import { ThemeToggle } from "./ThemeToggle.cjs";
|
|
|
48
51
|
import { DEFAULT_ALERT_DURATION, ToastMessage, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast/toast.cjs";
|
|
49
52
|
import "./toast/index.cjs";
|
|
50
53
|
import { cn } from "@pixpilot/shadcn";
|
|
51
|
-
export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, 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, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, PopoverCloseButtonProps, RichTextEditor, RichTextEditorProps, Select, SelectOption, SingleFileUploadProps, Slider, SliderProps, Tabs, TabsContent, TabsList, TabsListProps,
|
|
54
|
+
export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, 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, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, PopoverCloseButtonProps, RichTextEditor, RichTextEditorProps, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectOption, SingleFileUploadProps, Slider, SliderProps, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeProvider, ThemeProviderProps, ThemeToggle, ToastMessage, ToolbarOption, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useTabsContext, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,11 +35,14 @@ import { Pagination, PaginationProps } from "./pagination/Pagination.js";
|
|
|
35
35
|
import "./pagination/index.js";
|
|
36
36
|
import { RichTextEditor, RichTextEditorProps, ToolbarOption } from "./rich-text-editor/RichTextEditor.js";
|
|
37
37
|
import "./rich-text-editor/index.js";
|
|
38
|
+
import { ScaledPreview, ScaledPreviewProps, ScaledPreviewSize } from "./ScaledPreview.js";
|
|
38
39
|
import { Select, SelectOption } from "./Select.js";
|
|
39
40
|
import { Slider, SliderProps } from "./Slider.js";
|
|
40
41
|
import { Tabs } from "./tabs/Tabs.js";
|
|
41
42
|
import { TabsContent } from "./tabs/TabsContent.js";
|
|
42
|
-
import {
|
|
43
|
+
import { BaseTabsTriggerProps, TabsVariant } from "./tabs/types.js";
|
|
44
|
+
import { TabsContext, TabsContextValue, useTabsContext } from "./tabs/TabsContext.js";
|
|
45
|
+
import { TabsList, TabsListProps } from "./tabs/TabsList.js";
|
|
43
46
|
import { TabsTrigger, TabsTriggerProps } from "./tabs/TabsTrigger.js";
|
|
44
47
|
import "./tabs/index.js";
|
|
45
48
|
import { TagsInput, TagsInputProps } from "./tags-input.js";
|
|
@@ -49,4 +52,4 @@ import { ThemeToggle } from "./ThemeToggle.js";
|
|
|
49
52
|
import { DEFAULT_ALERT_DURATION, ToastMessage, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast/toast.js";
|
|
50
53
|
import "./toast/index.js";
|
|
51
54
|
import { cn } from "@pixpilot/shadcn";
|
|
52
|
-
export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, 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, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, PopoverCloseButtonProps, RichTextEditor, RichTextEditorProps, Select, SelectOption, SingleFileUploadProps, Slider, SliderProps, Tabs, TabsContent, TabsList, TabsListProps,
|
|
55
|
+
export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, 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, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, PopoverCloseButtonProps, RichTextEditor, RichTextEditorProps, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectOption, SingleFileUploadProps, Slider, SliderProps, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeProvider, ThemeProviderProps, ThemeToggle, ToastMessage, ToolbarOption, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useTabsContext, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -31,10 +31,12 @@ import { Pagination } from "./pagination/Pagination.js";
|
|
|
31
31
|
import "./pagination/index.js";
|
|
32
32
|
import { RichTextEditor } from "./rich-text-editor/RichTextEditor.js";
|
|
33
33
|
import "./rich-text-editor/index.js";
|
|
34
|
+
import { ScaledPreview } from "./ScaledPreview.js";
|
|
34
35
|
import { Select } from "./Select.js";
|
|
35
36
|
import { Slider } from "./Slider.js";
|
|
36
37
|
import { Tabs } from "./tabs/Tabs.js";
|
|
37
38
|
import { TabsContent } from "./tabs/TabsContent.js";
|
|
39
|
+
import { TabsContext, useTabsContext } from "./tabs/TabsContext.js";
|
|
38
40
|
import { TabsList } from "./tabs/TabsList.js";
|
|
39
41
|
import { TabsTrigger } from "./tabs/TabsTrigger.js";
|
|
40
42
|
import "./tabs/index.js";
|
|
@@ -46,4 +48,4 @@ import { DEFAULT_ALERT_DURATION, toast, toastError, toastInfo, toastSuccess, toa
|
|
|
46
48
|
import "./toast/index.js";
|
|
47
49
|
import { cn } from "@pixpilot/shadcn";
|
|
48
50
|
|
|
49
|
-
export { AbsoluteFill, Alert, AvatarUpload, Button, CircleLoader, CloseButtonAbsolute, CloseButtonRounded, Combobox, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DialogProvider, FileUpload, FileUploadInline, IconPicker, Layout, LayoutFooter, LayoutHeader, LayoutMain, LoadingOverlay, Pagination, RichTextEditor, Select, Slider, Tabs, TabsContent, TabsList, TabsTrigger, TagsInput, ThemeProvider, ThemeToggle, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useTheme };
|
|
51
|
+
export { AbsoluteFill, Alert, AvatarUpload, Button, CircleLoader, CloseButtonAbsolute, CloseButtonRounded, Combobox, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DialogProvider, FileUpload, FileUploadInline, IconPicker, Layout, LayoutFooter, LayoutHeader, LayoutMain, LoadingOverlay, Pagination, RichTextEditor, ScaledPreview, Select, Slider, Tabs, TabsContent, TabsContext, TabsList, TabsTrigger, TagsInput, ThemeProvider, ThemeToggle, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useTabsContext, useTheme };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
+
|
|
5
|
+
//#region src/tabs/TabsContext.tsx
|
|
6
|
+
const TabsContext = react.default.createContext(void 0);
|
|
7
|
+
function useTabsContext() {
|
|
8
|
+
return react.default.use(TabsContext);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.TabsContext = TabsContext;
|
|
13
|
+
exports.useTabsContext = useTabsContext;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TabsVariant } from "./types.cjs";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/tabs/TabsContext.d.ts
|
|
5
|
+
interface TabsContextValue {
|
|
6
|
+
variant?: TabsVariant;
|
|
7
|
+
}
|
|
8
|
+
declare const TabsContext: React.Context<TabsContextValue | undefined>;
|
|
9
|
+
declare function useTabsContext(): TabsContextValue | undefined;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { TabsContext, TabsContextValue, useTabsContext };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TabsVariant } from "./types.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/tabs/TabsContext.d.ts
|
|
5
|
+
interface TabsContextValue {
|
|
6
|
+
variant?: TabsVariant;
|
|
7
|
+
}
|
|
8
|
+
declare const TabsContext: React.Context<TabsContextValue | undefined>;
|
|
9
|
+
declare function useTabsContext(): TabsContextValue | undefined;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { TabsContext, TabsContextValue, useTabsContext };
|
package/dist/tabs/TabsList.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_TabsContext = require('./TabsContext.cjs');
|
|
2
3
|
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
3
4
|
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
4
5
|
let react = require("react");
|
|
@@ -8,14 +9,23 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
8
9
|
|
|
9
10
|
//#region src/tabs/TabsList.tsx
|
|
10
11
|
const TabsList = (props) => {
|
|
11
|
-
const { variant,...rest } = props;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const { variant, children,...rest } = props;
|
|
13
|
+
const contextValue = react.default.useMemo(() => ({ variant }), [variant]);
|
|
14
|
+
if (variant === "underline") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TabsContext.TabsContext, {
|
|
15
|
+
value: contextValue,
|
|
16
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TabsList, {
|
|
17
|
+
...rest,
|
|
18
|
+
className: (0, __pixpilot_shadcn.cn)("bg-transparent p-0 h-auto rounded-none border-b border-border w-full", rest.className),
|
|
19
|
+
children
|
|
20
|
+
})
|
|
15
21
|
});
|
|
16
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TabsContext.TabsContext, {
|
|
23
|
+
value: contextValue,
|
|
24
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TabsList, {
|
|
25
|
+
...rest,
|
|
26
|
+
variant,
|
|
27
|
+
children
|
|
28
|
+
})
|
|
19
29
|
});
|
|
20
30
|
};
|
|
21
31
|
|
package/dist/tabs/TabsList.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { TabsVariant } from "./types.cjs";
|
|
1
2
|
import { TabsList } from "@pixpilot/shadcn";
|
|
2
3
|
import React from "react";
|
|
3
4
|
|
|
4
5
|
//#region src/tabs/TabsList.d.ts
|
|
5
|
-
type TabsListVariant = 'default' | 'underline' | 'outline' | 'ghost' | 'pill';
|
|
6
6
|
interface TabsListProps extends Omit<React.ComponentProps<typeof TabsList>, 'variant'> {
|
|
7
|
-
variant?:
|
|
7
|
+
variant?: TabsVariant;
|
|
8
8
|
}
|
|
9
9
|
declare const TabsList$1: React.FC<TabsListProps>;
|
|
10
10
|
//#endregion
|
|
11
|
-
export { TabsList$1 as TabsList, TabsListProps
|
|
11
|
+
export { TabsList$1 as TabsList, TabsListProps };
|
package/dist/tabs/TabsList.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { TabsVariant } from "./types.js";
|
|
1
2
|
import { TabsList } from "@pixpilot/shadcn";
|
|
2
3
|
import React from "react";
|
|
3
4
|
|
|
4
5
|
//#region src/tabs/TabsList.d.ts
|
|
5
|
-
type TabsListVariant = 'default' | 'underline' | 'outline' | 'ghost' | 'pill';
|
|
6
6
|
interface TabsListProps extends Omit<React.ComponentProps<typeof TabsList>, 'variant'> {
|
|
7
|
-
variant?:
|
|
7
|
+
variant?: TabsVariant;
|
|
8
8
|
}
|
|
9
9
|
declare const TabsList$1: React.FC<TabsListProps>;
|
|
10
10
|
//#endregion
|
|
11
|
-
export { TabsList$1 as TabsList, TabsListProps
|
|
11
|
+
export { TabsList$1 as TabsList, TabsListProps };
|
package/dist/tabs/TabsList.js
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TabsContext } from "./TabsContext.js";
|
|
2
|
+
import { TabsList, cn } from "@pixpilot/shadcn";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
|
|
5
6
|
//#region src/tabs/TabsList.tsx
|
|
6
7
|
const TabsList$1 = (props) => {
|
|
7
|
-
const { variant,...rest } = props;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const { variant, children,...rest } = props;
|
|
9
|
+
const contextValue = React.useMemo(() => ({ variant }), [variant]);
|
|
10
|
+
if (variant === "underline") return /* @__PURE__ */ jsx(TabsContext, {
|
|
11
|
+
value: contextValue,
|
|
12
|
+
children: /* @__PURE__ */ jsx(TabsList, {
|
|
13
|
+
...rest,
|
|
14
|
+
className: cn("bg-transparent p-0 h-auto rounded-none border-b border-border w-full", rest.className),
|
|
15
|
+
children
|
|
16
|
+
})
|
|
11
17
|
});
|
|
12
|
-
return /* @__PURE__ */ jsx(
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
return /* @__PURE__ */ jsx(TabsContext, {
|
|
19
|
+
value: contextValue,
|
|
20
|
+
children: /* @__PURE__ */ jsx(TabsList, {
|
|
21
|
+
...rest,
|
|
22
|
+
variant,
|
|
23
|
+
children
|
|
24
|
+
})
|
|
15
25
|
});
|
|
16
26
|
};
|
|
17
27
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_TabsContext = require('./TabsContext.cjs');
|
|
2
3
|
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
3
4
|
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
4
5
|
let react = require("react");
|
|
@@ -8,7 +9,9 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
8
9
|
|
|
9
10
|
//#region src/tabs/TabsTrigger.tsx
|
|
10
11
|
const TabsTrigger = (props) => {
|
|
11
|
-
const { variant,...rest } = props;
|
|
12
|
+
const { variant: propVariant,...rest } = props;
|
|
13
|
+
const context = require_TabsContext.useTabsContext();
|
|
14
|
+
const variant = propVariant || context?.variant;
|
|
12
15
|
const underlineClasses = (0, __pixpilot_shadcn.cn)("data-[state=active]:border-primary m-0 mb-[-1px] rounded-none border-0 border-b-2 bg-transparent py-2 px-3 shadow-none");
|
|
13
16
|
if (variant === "underline") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TabsTrigger, {
|
|
14
17
|
...rest,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseTabsTriggerProps,
|
|
1
|
+
import { BaseTabsTriggerProps, TabsVariant } from "./types.cjs";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/tabs/TabsTrigger.d.ts
|
|
5
5
|
interface TabsTriggerProps extends Omit<BaseTabsTriggerProps, 'variant'> {
|
|
6
|
-
variant?:
|
|
6
|
+
variant?: TabsVariant;
|
|
7
7
|
}
|
|
8
8
|
declare const TabsTrigger: React.FC<TabsTriggerProps>;
|
|
9
9
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseTabsTriggerProps,
|
|
1
|
+
import { BaseTabsTriggerProps, TabsVariant } from "./types.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/tabs/TabsTrigger.d.ts
|
|
5
5
|
interface TabsTriggerProps extends Omit<BaseTabsTriggerProps, 'variant'> {
|
|
6
|
-
variant?:
|
|
6
|
+
variant?: TabsVariant;
|
|
7
7
|
}
|
|
8
8
|
declare const TabsTrigger: React.FC<TabsTriggerProps>;
|
|
9
9
|
//#endregion
|
package/dist/tabs/TabsTrigger.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { useTabsContext } from "./TabsContext.js";
|
|
1
2
|
import { TabsTrigger, cn } from "@pixpilot/shadcn";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
|
|
5
6
|
//#region src/tabs/TabsTrigger.tsx
|
|
6
7
|
const TabsTrigger$1 = (props) => {
|
|
7
|
-
const { variant,...rest } = props;
|
|
8
|
+
const { variant: propVariant,...rest } = props;
|
|
9
|
+
const context = useTabsContext();
|
|
10
|
+
const variant = propVariant || context?.variant;
|
|
8
11
|
const underlineClasses = cn("data-[state=active]:border-primary m-0 mb-[-1px] rounded-none border-0 border-b-2 bg-transparent py-2 px-3 shadow-none");
|
|
9
12
|
if (variant === "underline") return /* @__PURE__ */ jsx(TabsTrigger, {
|
|
10
13
|
...rest,
|
package/dist/tabs/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
require('./Tabs.cjs');
|
|
3
3
|
require('./TabsContent.cjs');
|
|
4
|
+
const require_TabsContext = require('./TabsContext.cjs');
|
|
4
5
|
const require_TabsList = require('./TabsList.cjs');
|
|
5
6
|
const require_TabsTrigger = require('./TabsTrigger.cjs');
|
|
6
7
|
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
package/dist/tabs/index.d.cts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Tabs } from "./Tabs.cjs";
|
|
2
2
|
import { TabsContent } from "./TabsContent.cjs";
|
|
3
|
-
import {
|
|
3
|
+
import { BaseTabsTriggerProps, TabsVariant } from "./types.cjs";
|
|
4
|
+
import { TabsContext, TabsContextValue, useTabsContext } from "./TabsContext.cjs";
|
|
5
|
+
import { TabsList, TabsListProps } from "./TabsList.cjs";
|
|
4
6
|
import { TabsTrigger, TabsTriggerProps } from "./TabsTrigger.cjs";
|
package/dist/tabs/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Tabs } from "./Tabs.js";
|
|
2
2
|
import { TabsContent } from "./TabsContent.js";
|
|
3
|
-
import {
|
|
3
|
+
import { BaseTabsTriggerProps, TabsVariant } from "./types.js";
|
|
4
|
+
import { TabsContext, TabsContextValue, useTabsContext } from "./TabsContext.js";
|
|
5
|
+
import { TabsList, TabsListProps } from "./TabsList.js";
|
|
4
6
|
import { TabsTrigger, TabsTriggerProps } from "./TabsTrigger.js";
|
package/dist/tabs/index.js
CHANGED
package/dist/tabs/types.d.cts
CHANGED
|
@@ -2,6 +2,6 @@ import { TabsTrigger } from "@pixpilot/shadcn";
|
|
|
2
2
|
|
|
3
3
|
//#region src/tabs/types.d.ts
|
|
4
4
|
type BaseTabsTriggerProps = React.ComponentProps<typeof TabsTrigger>;
|
|
5
|
-
type
|
|
5
|
+
type TabsVariant = 'default' | 'underline' | BaseTabsTriggerProps['variant'];
|
|
6
6
|
//#endregion
|
|
7
|
-
export { BaseTabsTriggerProps,
|
|
7
|
+
export { BaseTabsTriggerProps, TabsVariant };
|
package/dist/tabs/types.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import { TabsTrigger } from "@pixpilot/shadcn";
|
|
|
2
2
|
|
|
3
3
|
//#region src/tabs/types.d.ts
|
|
4
4
|
type BaseTabsTriggerProps = React.ComponentProps<typeof TabsTrigger>;
|
|
5
|
-
type
|
|
5
|
+
type TabsVariant = 'default' | 'underline' | BaseTabsTriggerProps['variant'];
|
|
6
6
|
//#endregion
|
|
7
|
-
export { BaseTabsTriggerProps,
|
|
7
|
+
export { BaseTabsTriggerProps, TabsVariant };
|
package/package.json
CHANGED