@deepnoid/ui 0.1.83 → 0.1.86
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/.turbo/turbo-build.log +143 -143
- package/dist/{chunk-4ORPRDPL.mjs → chunk-D6OJWEZM.mjs} +1 -1
- package/dist/{chunk-7GFYCPP3.mjs → chunk-Q3JMHIW5.mjs} +2 -2
- package/dist/{chunk-B6YYZVT6.mjs → chunk-V5OCV42N.mjs} +35 -8
- package/dist/{chunk-FKHKYVZH.mjs → chunk-VSURAISO.mjs} +40 -10
- package/dist/components/accordion/accordionItem.d.mts +2 -5
- package/dist/components/accordion/accordionItem.d.ts +2 -5
- package/dist/components/accordion/accordionItem.js +34 -4646
- package/dist/components/accordion/accordionItem.mjs +1 -4
- package/dist/components/accordion/index.d.mts +0 -3
- package/dist/components/accordion/index.d.ts +0 -3
- package/dist/components/accordion/index.js +33 -4647
- package/dist/components/accordion/index.mjs +1 -4
- package/dist/components/breadcrumb/breadcrumb.mjs +3 -3
- package/dist/components/breadcrumb/index.mjs +3 -3
- package/dist/components/button/button.d.mts +4 -2
- package/dist/components/button/button.d.ts +4 -2
- package/dist/components/button/button.js +26 -5
- package/dist/components/button/button.mjs +2 -2
- package/dist/components/button/icon-button.mjs +2 -2
- package/dist/components/button/index.js +26 -5
- package/dist/components/button/index.mjs +3 -3
- package/dist/components/fileUpload/fileUpload.js +26 -5
- package/dist/components/fileUpload/fileUpload.mjs +4 -4
- package/dist/components/fileUpload/index.js +26 -5
- package/dist/components/fileUpload/index.mjs +4 -4
- package/dist/components/modal/index.js +26 -5
- package/dist/components/modal/index.mjs +4 -4
- package/dist/components/modal/modal.js +26 -5
- package/dist/components/modal/modal.mjs +4 -4
- package/dist/components/ripple/index.mjs +3 -3
- package/dist/components/table/index.mjs +3 -3
- package/dist/index.js +804 -759
- package/dist/index.mjs +17 -17
- package/package.json +1 -1
- package/dist/{chunk-Z6IOS3S6.mjs → chunk-P6CRHHI3.mjs} +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useRipple
|
|
4
|
-
} from "./chunk-6PNKRBUT.mjs";
|
|
5
2
|
import {
|
|
6
3
|
ripple_default
|
|
7
4
|
} from "./chunk-LXHUO6VM.mjs";
|
|
5
|
+
import {
|
|
6
|
+
useRipple
|
|
7
|
+
} from "./chunk-6PNKRBUT.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Icon_default
|
|
10
10
|
} from "./chunk-JP4TEWP7.mjs";
|
|
@@ -16,11 +16,17 @@ import {
|
|
|
16
16
|
} from "./chunk-CDXBML6O.mjs";
|
|
17
17
|
|
|
18
18
|
// src/components/button/button.tsx
|
|
19
|
-
import
|
|
19
|
+
import {
|
|
20
|
+
forwardRef,
|
|
21
|
+
useMemo,
|
|
22
|
+
useCallback,
|
|
23
|
+
isValidElement,
|
|
24
|
+
cloneElement
|
|
25
|
+
} from "react";
|
|
20
26
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
27
|
var Button = forwardRef((originalProps, ref) => {
|
|
22
28
|
const [props, variantProps] = mapPropsVariants(originalProps, buttonStyle.variantKeys);
|
|
23
|
-
const { classNames, startContent, endContent, disableRipple, children, ...buttonProps } = props;
|
|
29
|
+
const { classNames, startContent, endContent, disableRipple, asChild, children, ...buttonProps } = props;
|
|
24
30
|
const slots = useMemo(() => buttonStyle({ ...variantProps }), [variantProps]);
|
|
25
31
|
const { onPress: onRipplePressHandler, onClear: onClearRipple, ripples } = useRipple();
|
|
26
32
|
const handlePress = useCallback(
|
|
@@ -62,25 +68,46 @@ var Button = forwardRef((originalProps, ref) => {
|
|
|
62
68
|
[slots, classNames, originalProps.size]
|
|
63
69
|
);
|
|
64
70
|
const renderContent = (content) => {
|
|
65
|
-
if (
|
|
71
|
+
if (isValidElement(content)) {
|
|
66
72
|
const _content = content;
|
|
67
73
|
const existingProps = _content.props;
|
|
68
74
|
const mergedProps = {
|
|
69
75
|
...getContentProps(),
|
|
70
76
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
71
77
|
};
|
|
72
|
-
return
|
|
78
|
+
return cloneElement(content, mergedProps);
|
|
73
79
|
} else {
|
|
74
80
|
const contentProps = getContentProps();
|
|
75
81
|
return /* @__PURE__ */ jsx("div", { ...contentProps, children: content });
|
|
76
82
|
}
|
|
77
83
|
};
|
|
78
|
-
|
|
84
|
+
const buttonContent = /* @__PURE__ */ jsx(Fragment, { children: originalProps.isLoading ? renderContent(/* @__PURE__ */ jsx(Icon_default, { name: "loading", className: "animate-spin" })) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
79
85
|
startContent && renderContent(startContent),
|
|
80
86
|
children,
|
|
81
87
|
endContent && renderContent(endContent),
|
|
82
88
|
!disableRipple && /* @__PURE__ */ jsx(ripple_default, { ...getRippleProps() })
|
|
83
89
|
] }) });
|
|
90
|
+
if (asChild && isValidElement(children)) {
|
|
91
|
+
const childElement = children;
|
|
92
|
+
const baseProps = getBaseProps();
|
|
93
|
+
const mergedProps = {
|
|
94
|
+
...childElement.props,
|
|
95
|
+
...baseProps,
|
|
96
|
+
className: `${baseProps.className || ""} ${childElement.props.className || ""}`.trim(),
|
|
97
|
+
onClick: (e) => {
|
|
98
|
+
var _a, _b, _c;
|
|
99
|
+
(_b = (_a = childElement.props).onClick) == null ? void 0 : _b.call(_a, e);
|
|
100
|
+
(_c = baseProps.onClick) == null ? void 0 : _c.call(baseProps, e);
|
|
101
|
+
},
|
|
102
|
+
onMouseDown: (e) => {
|
|
103
|
+
var _a, _b, _c;
|
|
104
|
+
(_b = (_a = childElement.props).onMouseDown) == null ? void 0 : _b.call(_a, e);
|
|
105
|
+
(_c = baseProps.onMouseDown) == null ? void 0 : _c.call(baseProps, e);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
return cloneElement(childElement, mergedProps);
|
|
109
|
+
}
|
|
110
|
+
return /* @__PURE__ */ jsx("button", { ...getBaseProps(), children: buttonContent });
|
|
84
111
|
});
|
|
85
112
|
Button.displayName = "Button";
|
|
86
113
|
var button_default = Button;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
Icon_default
|
|
4
|
-
} from "./chunk-JP4TEWP7.mjs";
|
|
5
2
|
import {
|
|
6
3
|
mapPropsVariants
|
|
7
4
|
} from "./chunk-E3G5QXSH.mjs";
|
|
@@ -10,11 +7,29 @@ import {
|
|
|
10
7
|
} from "./chunk-CDXBML6O.mjs";
|
|
11
8
|
|
|
12
9
|
// src/components/accordion/accordionItem.tsx
|
|
13
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
forwardRef,
|
|
12
|
+
useCallback,
|
|
13
|
+
useMemo,
|
|
14
|
+
useRef,
|
|
15
|
+
useState,
|
|
16
|
+
useEffect,
|
|
17
|
+
isValidElement,
|
|
18
|
+
cloneElement
|
|
19
|
+
} from "react";
|
|
14
20
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
21
|
var AccordionItem = forwardRef((originalProps, ref) => {
|
|
16
22
|
const [props, variantProps] = mapPropsVariants(originalProps, accordionItem.variantKeys);
|
|
17
|
-
const {
|
|
23
|
+
const {
|
|
24
|
+
title,
|
|
25
|
+
children,
|
|
26
|
+
startContent,
|
|
27
|
+
endContent,
|
|
28
|
+
classNames,
|
|
29
|
+
isOpen = false,
|
|
30
|
+
onToggle,
|
|
31
|
+
disableAnimation
|
|
32
|
+
} = {
|
|
18
33
|
...props,
|
|
19
34
|
...variantProps
|
|
20
35
|
};
|
|
@@ -29,7 +44,22 @@ var AccordionItem = forwardRef((originalProps, ref) => {
|
|
|
29
44
|
setContentHeight(isOpen ? `${contentRef.current.scrollHeight}px` : "0px");
|
|
30
45
|
}
|
|
31
46
|
}, [isOpen]);
|
|
32
|
-
const
|
|
47
|
+
const handleToggle = useCallback(() => {
|
|
48
|
+
onToggle == null ? void 0 : onToggle();
|
|
49
|
+
}, [onToggle]);
|
|
50
|
+
const renderContent = (content) => {
|
|
51
|
+
const actualContent = typeof content === "function" ? content(isOpen) : content;
|
|
52
|
+
if (isValidElement(actualContent)) {
|
|
53
|
+
const _content = actualContent;
|
|
54
|
+
const existingProps = _content.props;
|
|
55
|
+
const mergedProps = {
|
|
56
|
+
className: `${slots.icon({ class: classNames == null ? void 0 : classNames.icon }) || ""} ${existingProps.className || ""}`.trim()
|
|
57
|
+
};
|
|
58
|
+
return cloneElement(actualContent, mergedProps);
|
|
59
|
+
} else {
|
|
60
|
+
return /* @__PURE__ */ jsx("div", { className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }), children: actualContent });
|
|
61
|
+
}
|
|
62
|
+
};
|
|
33
63
|
const getContentProps = useCallback(() => {
|
|
34
64
|
if (disableAnimation) {
|
|
35
65
|
return {
|
|
@@ -50,10 +80,10 @@ var AccordionItem = forwardRef((originalProps, ref) => {
|
|
|
50
80
|
};
|
|
51
81
|
}, [slots, classNames == null ? void 0 : classNames.content, contentHeight, isOpen, disableAnimation]);
|
|
52
82
|
return /* @__PURE__ */ jsxs("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
53
|
-
/* @__PURE__ */ jsxs("div", { "data-isOpen": isOpen, className: slots.header({ class: classNames == null ? void 0 : classNames.header }), onClick:
|
|
54
|
-
|
|
83
|
+
/* @__PURE__ */ jsxs("div", { "data-isOpen": isOpen, className: slots.header({ class: classNames == null ? void 0 : classNames.header }), onClick: handleToggle, children: [
|
|
84
|
+
startContent && renderContent(startContent),
|
|
55
85
|
/* @__PURE__ */ jsx("span", { className: slots.headerTitle({ class: classNames == null ? void 0 : classNames.headerTitle }), children: title }),
|
|
56
|
-
|
|
86
|
+
endContent && renderContent(endContent)
|
|
57
87
|
] }),
|
|
58
88
|
isOpen && /* @__PURE__ */ jsx("div", { ref: contentRef, ...getContentProps(), children })
|
|
59
89
|
] });
|
|
@@ -62,7 +92,7 @@ AccordionItem.displayName = "AccordionItem";
|
|
|
62
92
|
var accordionItem_default = AccordionItem;
|
|
63
93
|
var accordionItem = tv({
|
|
64
94
|
slots: {
|
|
65
|
-
base: ["group/accordion", "w-full", "flex", "flex-col", "gap-[12px]", "p-[12px]"],
|
|
95
|
+
base: ["group/accordion", "w-full", "flex", "flex-col", "gap-[12px]", "p-[12px]", "bg-body-background"],
|
|
66
96
|
header: [
|
|
67
97
|
"flex",
|
|
68
98
|
"justify-between",
|
|
@@ -3,15 +3,12 @@ import { VariantProps } from 'tailwind-variants';
|
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import { SlotsToClasses } from '../../utils/types.mjs';
|
|
6
|
-
import { IconName } from '../icon/Icon.mjs';
|
|
7
|
-
import 'react/jsx-runtime';
|
|
8
|
-
import '../icon/template.mjs';
|
|
9
6
|
|
|
10
7
|
interface Props {
|
|
11
8
|
title?: string;
|
|
12
9
|
children?: ReactNode;
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
startContent?: ReactNode | ((isOpen: boolean) => ReactNode);
|
|
11
|
+
endContent?: ReactNode | ((isOpen: boolean) => ReactNode);
|
|
15
12
|
classNames?: SlotsToClasses<AccordionItemSlots>;
|
|
16
13
|
isOpen?: boolean;
|
|
17
14
|
onToggle?: () => void;
|
|
@@ -3,15 +3,12 @@ import { VariantProps } from 'tailwind-variants';
|
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import { SlotsToClasses } from '../../utils/types.js';
|
|
6
|
-
import { IconName } from '../icon/Icon.js';
|
|
7
|
-
import 'react/jsx-runtime';
|
|
8
|
-
import '../icon/template.js';
|
|
9
6
|
|
|
10
7
|
interface Props {
|
|
11
8
|
title?: string;
|
|
12
9
|
children?: ReactNode;
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
startContent?: ReactNode | ((isOpen: boolean) => ReactNode);
|
|
11
|
+
endContent?: ReactNode | ((isOpen: boolean) => ReactNode);
|
|
15
12
|
classNames?: SlotsToClasses<AccordionItemSlots>;
|
|
16
13
|
isOpen?: boolean;
|
|
17
14
|
onToggle?: () => void;
|