@jbpark/ui-kit 2.5.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +1 -0
- package/README.md +1 -0
- package/dist/components/atoms/Checkbox/index.mjs +3 -3
- package/dist/components/atoms/Checkbox/index.mjs.map +1 -1
- package/dist/components/atoms/Radio/index.mjs +2 -2
- package/dist/components/atoms/Tag/index.d.mts +17 -0
- package/dist/components/atoms/Tag/index.d.mts.map +1 -0
- package/dist/components/atoms/Tag/index.mjs +29 -0
- package/dist/components/atoms/Tag/index.mjs.map +1 -0
- package/dist/components/atoms/index.d.mts +2 -1
- package/dist/components/atoms/index.mjs +1 -0
- package/dist/components/molecules/Card/index.mjs +1 -1
- package/dist/components/molecules/Card/index.mjs.map +1 -1
- package/dist/components/molecules/Marquees/Item/index.mjs +2 -2
- package/dist/components/molecules/Marquees/Item/index.mjs.map +1 -1
- package/dist/components/molecules/Space/index.mjs +2 -2
- package/dist/components/molecules/Space/index.mjs.map +1 -1
- package/dist/components/molecules/Splitter/index.d.mts +31 -0
- package/dist/components/molecules/Splitter/index.d.mts.map +1 -0
- package/dist/components/molecules/Splitter/index.mjs +37 -0
- package/dist/components/molecules/Splitter/index.mjs.map +1 -0
- package/dist/components/molecules/index.d.mts +1 -0
- package/dist/components/molecules/index.mjs +1 -0
- package/dist/components/organisms/Drawer/index.d.mts +7 -2
- package/dist/components/organisms/Drawer/index.d.mts.map +1 -1
- package/dist/components/organisms/Drawer/index.mjs +46 -22
- package/dist/components/organisms/Drawer/index.mjs.map +1 -1
- package/dist/components/organisms/Modal/index.mjs +3 -3
- package/dist/components/organisms/Modal/index.mjs.map +1 -1
- package/dist/components/organisms/index.d.mts +1 -1
- package/dist/components/templates/Layout/Content/index.d.mts +7 -1
- package/dist/components/templates/Layout/Content/index.d.mts.map +1 -0
- package/dist/components/templates/Layout/Content/index.mjs +2 -2
- package/dist/components/templates/Layout/Content/index.mjs.map +1 -1
- package/dist/components/templates/Layout/Footer/index.d.mts +7 -1
- package/dist/components/templates/Layout/Footer/index.d.mts.map +1 -0
- package/dist/components/templates/Layout/Footer/index.mjs +2 -2
- package/dist/components/templates/Layout/Footer/index.mjs.map +1 -1
- package/dist/components/templates/Layout/Header/index.d.mts +1 -1
- package/dist/components/templates/Layout/Header/index.mjs +2 -2
- package/dist/components/templates/Layout/Header/index.mjs.map +1 -1
- package/dist/components/templates/Layout/Sider/index.d.mts +19 -1
- package/dist/components/templates/Layout/Sider/index.d.mts.map +1 -0
- package/dist/components/templates/Layout/Sider/index.mjs +32 -5
- package/dist/components/templates/Layout/Sider/index.mjs.map +1 -1
- package/dist/components/templates/Layout/index.d.mts +18 -8
- package/dist/components/templates/Layout/index.d.mts.map +1 -1
- package/dist/components/templates/Layout/index.mjs +3 -1
- package/dist/components/templates/Layout/index.mjs.map +1 -1
- package/dist/core/resizable.d.mts +24 -0
- package/dist/core/resizable.d.mts.map +1 -0
- package/dist/core/resizable.mjs +52 -0
- package/dist/core/resizable.mjs.map +1 -0
- package/dist/core.d.mts +2 -1
- package/dist/core.mjs +2 -1
- package/dist/index.d.mts +7 -5
- package/dist/index.mjs +5 -3
- package/dist/providers/Config/context.d.mts +8 -0
- package/dist/providers/Config/context.d.mts.map +1 -0
- package/dist/providers/Config/context.mjs +11 -0
- package/dist/providers/Config/context.mjs.map +1 -0
- package/dist/providers/{ConfigProvider → Config}/index.d.mts +4 -4
- package/dist/providers/Config/index.d.mts.map +1 -0
- package/dist/providers/{ConfigProvider → Config}/index.mjs +5 -5
- package/dist/providers/Config/index.mjs.map +1 -0
- package/dist/providers/{ConfigProvider → Config}/types.d.mts +3 -3
- package/dist/providers/Config/types.d.mts.map +1 -0
- package/dist/providers/index.d.mts +3 -3
- package/dist/providers/index.mjs +2 -2
- package/dist/style.css +226 -9
- package/package.json +15 -11
- package/dist/node_modules/gsap/CSSPlugin.mjs +0 -920
- package/dist/node_modules/gsap/CSSPlugin.mjs.map +0 -1
- package/dist/node_modules/gsap/gsap-core.mjs +0 -2723
- package/dist/node_modules/gsap/gsap-core.mjs.map +0 -1
- package/dist/node_modules/gsap/index.mjs +0 -9
- package/dist/node_modules/gsap/index.mjs.map +0 -1
- package/dist/providers/ConfigProvider/ConfigContext.d.mts +0 -8
- package/dist/providers/ConfigProvider/ConfigContext.d.mts.map +0 -1
- package/dist/providers/ConfigProvider/ConfigContext.mjs +0 -11
- package/dist/providers/ConfigProvider/ConfigContext.mjs.map +0 -1
- package/dist/providers/ConfigProvider/index.d.mts.map +0 -1
- package/dist/providers/ConfigProvider/index.mjs.map +0 -1
- package/dist/providers/ConfigProvider/types.d.mts.map +0 -1
package/README.ko.md
CHANGED
package/README.md
CHANGED
|
@@ -51,6 +51,7 @@ Basic UI building blocks
|
|
|
51
51
|
| **Skeleton** | Loading skeleton | `Button`, `Node` |
|
|
52
52
|
| **Spin** | Loading spinner | - |
|
|
53
53
|
| **Switch** | Toggle switch component | - |
|
|
54
|
+
| **Tag** | Pill-style label/tag | - |
|
|
54
55
|
| **Typography** | Text components | `Link`, `Paragraph`, `Text`, `Title` |
|
|
55
56
|
|
|
56
57
|
## 🔬 Molecules
|
|
@@ -7,7 +7,7 @@ import "../../../core.mjs";
|
|
|
7
7
|
import Group from "./Group/index.mjs";
|
|
8
8
|
import { Square, SquareCheck } from "lucide-react";
|
|
9
9
|
import { useId, useState } from "react";
|
|
10
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
|
|
12
12
|
//#region src/components/atoms/Checkbox/index.tsx
|
|
13
13
|
const { Checkbox: CoreCheckbox } = checkbox_exports;
|
|
@@ -24,7 +24,7 @@ const Checkbox = ({ placement = "left", value = "", children, className, icons,
|
|
|
24
24
|
if (!controlled) setUncontrolledChecked(next);
|
|
25
25
|
_onChange(next);
|
|
26
26
|
};
|
|
27
|
-
const renderContent = icons ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
|
+
const renderContent = icons ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
28
28
|
/* @__PURE__ */ jsx("input", {
|
|
29
29
|
id,
|
|
30
30
|
hidden: true,
|
|
@@ -46,7 +46,7 @@ const Checkbox = ({ placement = "left", value = "", children, className, icons,
|
|
|
46
46
|
htmlFor: id,
|
|
47
47
|
children
|
|
48
48
|
})
|
|
49
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CoreCheckbox, {
|
|
49
|
+
] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CoreCheckbox, {
|
|
50
50
|
id,
|
|
51
51
|
checked,
|
|
52
52
|
disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["checkbox","label"],"sources":["../../../../src/components/atoms/Checkbox/index.tsx"],"sourcesContent":["'use client';\n\nimport { useId, useState } from 'react';\n\nimport { Square, SquareCheck } from 'lucide-react';\n\nimport { checkbox, label } from '@repo/ui/core';\nimport { cn } from '@repo/ui/utils';\n\nimport Group, { type OptionValue } from './Group';\n\nconst { Checkbox: CoreCheckbox } = checkbox;\nconst { Label: CoreLabel } = label;\n\nexport interface Props extends Omit<\n React.ComponentPropsWithoutRef<'div'>,\n 'onChange'\n> {\n placement?: 'left' | 'right';\n defaultChecked?: boolean;\n checked?: boolean;\n value?: OptionValue;\n disabled?: boolean;\n icons?: { checked: React.ReactNode; unchecked: React.ReactNode };\n children?: React.ReactNode;\n onChange?: (checked: boolean) => void;\n}\n\nconst Checkbox = ({\n placement = 'left',\n value = '',\n children,\n className,\n icons,\n disabled,\n defaultChecked,\n checked: _checked,\n onChange: _onChange = () => {},\n ...props\n}: Props) => {\n const [uncontrolledChecked, setUncontrolledChecked] = useState<boolean>(\n defaultChecked || false,\n );\n\n const reactId = useId();\n\n const id = typeof value === 'boolean' || !value ? reactId : String(value);\n const controlled = _checked !== undefined;\n const checked = controlled ? _checked : uncontrolledChecked;\n\n const cursorClassName = disabled ? 'cursor-not-allowed' : 'cursor-pointer';\n\n const onChange = (next: boolean) => {\n if (disabled) {\n return;\n }\n\n if (!controlled) {\n setUncontrolledChecked(next);\n }\n _onChange(next);\n };\n\n const renderContent = icons ? (\n <>\n <input\n id={id}\n hidden\n type=\"checkbox\"\n checked={checked}\n onChange={e => {\n onChange(e.target.checked);\n }}\n />\n <span\n className={cn(cursorClassName, disabled && 'opacity-50')}\n onClick={() => {\n document.getElementById(id)?.click();\n }}\n >\n {checked\n ? (icons.checked ?? <SquareCheck />)\n : (icons.unchecked ?? <Square />)}\n </span>\n {children && (\n <label\n className={cn(cursorClassName, disabled && 'opacity-50')}\n htmlFor={id}\n >\n {children}\n </label>\n )}\n </>\n ) : (\n <>\n <CoreCheckbox\n id={id}\n checked={checked}\n disabled={disabled}\n className={cn(cursorClassName)}\n onCheckedChange={onChange}\n />\n {children && (\n <CoreLabel htmlFor={id} className={cn(cursorClassName, 'text-left')}>\n {children}\n </CoreLabel>\n )}\n </>\n );\n\n return (\n <div\n className={cn(\n 'flex items-center gap-x-2',\n placement === 'right' && 'flex-row-reverse',\n cursorClassName,\n className,\n //\n )}\n {...props}\n >\n {renderContent}\n </div>\n );\n};\n\nCheckbox.Group = Group;\n\nexport default Checkbox;\n"],"mappings":";;;;;;;;;;;;AAWA,MAAM,EAAE,UAAU,iBAAiBA;AACnC,MAAM,EAAE,OAAO,cAAcC;AAgB7B,MAAM,YAAY,EAChB,YAAY,QACZ,QAAQ,IACR,UACA,WACA,OACA,UACA,gBACA,SAAS,UACT,UAAU,kBAAkB,IAC5B,GAAG,YACQ;CACX,MAAM,CAAC,qBAAqB,0BAA0B,SACpD,kBAAkB,MACnB;CAED,MAAM,UAAU,OAAO;CAEvB,MAAM,KAAK,OAAO,UAAU,aAAa,CAAC,QAAQ,UAAU,OAAO,MAAM;CACzE,MAAM,aAAa,aAAa;CAChC,MAAM,UAAU,aAAa,WAAW;CAExC,MAAM,kBAAkB,WAAW,uBAAuB;CAE1D,MAAM,YAAY,SAAkB;AAClC,MAAI,SACF;AAGF,MAAI,CAAC,WACH,wBAAuB,KAAK;AAE9B,YAAU,KAAK;;CAGjB,MAAM,gBAAgB,QACpB;EACE,oBAAC;GACK;GACJ;GACA,MAAK;GACI;GACT,WAAU,MAAK;AACb,aAAS,EAAE,OAAO,QAAQ;;IAE5B;EACF,oBAAC;GACC,WAAW,GAAG,iBAAiB,YAAY,aAAa;GACxD,eAAe;AACb,aAAS,eAAe,GAAG,EAAE,OAAO;;aAGrC,UACI,MAAM,WAAW,oBAAC,gBAAc,GAChC,MAAM,aAAa,oBAAC,WAAS;IAC7B;EACN,YACC,oBAAC;GACC,WAAW,GAAG,iBAAiB,YAAY,aAAa;GACxD,SAAS;GAER;IACK;KAET,GAEH,
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["checkbox","label"],"sources":["../../../../src/components/atoms/Checkbox/index.tsx"],"sourcesContent":["'use client';\n\nimport { useId, useState } from 'react';\n\nimport { Square, SquareCheck } from 'lucide-react';\n\nimport { checkbox, label } from '@repo/ui/core';\nimport { cn } from '@repo/ui/utils';\n\nimport Group, { type OptionValue } from './Group';\n\nconst { Checkbox: CoreCheckbox } = checkbox;\nconst { Label: CoreLabel } = label;\n\nexport interface Props extends Omit<\n React.ComponentPropsWithoutRef<'div'>,\n 'onChange'\n> {\n placement?: 'left' | 'right';\n defaultChecked?: boolean;\n checked?: boolean;\n value?: OptionValue;\n disabled?: boolean;\n icons?: { checked: React.ReactNode; unchecked: React.ReactNode };\n children?: React.ReactNode;\n onChange?: (checked: boolean) => void;\n}\n\nconst Checkbox = ({\n placement = 'left',\n value = '',\n children,\n className,\n icons,\n disabled,\n defaultChecked,\n checked: _checked,\n onChange: _onChange = () => {},\n ...props\n}: Props) => {\n const [uncontrolledChecked, setUncontrolledChecked] = useState<boolean>(\n defaultChecked || false,\n );\n\n const reactId = useId();\n\n const id = typeof value === 'boolean' || !value ? reactId : String(value);\n const controlled = _checked !== undefined;\n const checked = controlled ? _checked : uncontrolledChecked;\n\n const cursorClassName = disabled ? 'cursor-not-allowed' : 'cursor-pointer';\n\n const onChange = (next: boolean) => {\n if (disabled) {\n return;\n }\n\n if (!controlled) {\n setUncontrolledChecked(next);\n }\n _onChange(next);\n };\n\n const renderContent = icons ? (\n <>\n <input\n id={id}\n hidden\n type=\"checkbox\"\n checked={checked}\n onChange={e => {\n onChange(e.target.checked);\n }}\n />\n <span\n className={cn(cursorClassName, disabled && 'opacity-50')}\n onClick={() => {\n document.getElementById(id)?.click();\n }}\n >\n {checked\n ? (icons.checked ?? <SquareCheck />)\n : (icons.unchecked ?? <Square />)}\n </span>\n {children && (\n <label\n className={cn(cursorClassName, disabled && 'opacity-50')}\n htmlFor={id}\n >\n {children}\n </label>\n )}\n </>\n ) : (\n <>\n <CoreCheckbox\n id={id}\n checked={checked}\n disabled={disabled}\n className={cn(cursorClassName)}\n onCheckedChange={onChange}\n />\n {children && (\n <CoreLabel htmlFor={id} className={cn(cursorClassName, 'text-left')}>\n {children}\n </CoreLabel>\n )}\n </>\n );\n\n return (\n <div\n className={cn(\n 'flex items-center gap-x-2',\n placement === 'right' && 'flex-row-reverse',\n cursorClassName,\n className,\n //\n )}\n {...props}\n >\n {renderContent}\n </div>\n );\n};\n\nCheckbox.Group = Group;\n\nexport default Checkbox;\n"],"mappings":";;;;;;;;;;;;AAWA,MAAM,EAAE,UAAU,iBAAiBA;AACnC,MAAM,EAAE,OAAO,cAAcC;AAgB7B,MAAM,YAAY,EAChB,YAAY,QACZ,QAAQ,IACR,UACA,WACA,OACA,UACA,gBACA,SAAS,UACT,UAAU,kBAAkB,IAC5B,GAAG,YACQ;CACX,MAAM,CAAC,qBAAqB,0BAA0B,SACpD,kBAAkB,MACnB;CAED,MAAM,UAAU,OAAO;CAEvB,MAAM,KAAK,OAAO,UAAU,aAAa,CAAC,QAAQ,UAAU,OAAO,MAAM;CACzE,MAAM,aAAa,aAAa;CAChC,MAAM,UAAU,aAAa,WAAW;CAExC,MAAM,kBAAkB,WAAW,uBAAuB;CAE1D,MAAM,YAAY,SAAkB;AAClC,MAAI,SACF;AAGF,MAAI,CAAC,WACH,wBAAuB,KAAK;AAE9B,YAAU,KAAK;;CAGjB,MAAM,gBAAgB,QACpB;EACE,oBAAC;GACK;GACJ;GACA,MAAK;GACI;GACT,WAAU,MAAK;AACb,aAAS,EAAE,OAAO,QAAQ;;IAE5B;EACF,oBAAC;GACC,WAAW,GAAG,iBAAiB,YAAY,aAAa;GACxD,eAAe;AACb,aAAS,eAAe,GAAG,EAAE,OAAO;;aAGrC,UACI,MAAM,WAAW,oBAAC,gBAAc,GAChC,MAAM,aAAa,oBAAC,WAAS;IAC7B;EACN,YACC,oBAAC;GACC,WAAW,GAAG,iBAAiB,YAAY,aAAa;GACxD,SAAS;GAER;IACK;KAET,GAEH,8CACE,oBAAC;EACK;EACK;EACC;EACV,WAAW,GAAG,gBAAgB;EAC9B,iBAAiB;GACjB,EACD,YACC,oBAAC;EAAU,SAAS;EAAI,WAAW,GAAG,iBAAiB,YAAY;EAChE;GACS,IAEb;AAGL,QACE,oBAAC;EACC,WAAW,GACT,6BACA,cAAc,WAAW,oBACzB,iBACA,UAED;EACD,GAAI;YAEH;GACG;;AAIV,SAAS,QAAQ"}
|
|
@@ -7,7 +7,7 @@ import "../../../core.mjs";
|
|
|
7
7
|
import RadioGroup from "./Group/index.mjs";
|
|
8
8
|
import { Circle, CircleCheck } from "lucide-react";
|
|
9
9
|
import { useId, useState } from "react";
|
|
10
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
|
|
12
12
|
//#region src/components/atoms/Radio/index.tsx
|
|
13
13
|
const { RadioGroup: Core, RadioGroupItem: Item } = radio_group_exports;
|
|
@@ -24,7 +24,7 @@ const Radio = ({ placement = "left", value = "", children, className, icons, dis
|
|
|
24
24
|
if (!controlled) setUncontrolledChecked(next);
|
|
25
25
|
_onChange(next);
|
|
26
26
|
};
|
|
27
|
-
const renderContent = icons ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
|
+
const renderContent = icons ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
28
28
|
/* @__PURE__ */ jsx("input", {
|
|
29
29
|
id,
|
|
30
30
|
hidden: true,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/atoms/Tag/index.d.ts
|
|
4
|
+
interface Props extends React.ComponentPropsWithoutRef<'span'> {
|
|
5
|
+
variant?: 'default' | 'outlined';
|
|
6
|
+
color?: 'default' | 'primary' | 'success' | 'warning' | 'danger';
|
|
7
|
+
}
|
|
8
|
+
declare const Tag: ({
|
|
9
|
+
className,
|
|
10
|
+
variant,
|
|
11
|
+
color,
|
|
12
|
+
children,
|
|
13
|
+
...props
|
|
14
|
+
}: Props) => react_jsx_runtime0.JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Tag };
|
|
17
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/components/atoms/Tag/index.tsx"],"mappings":";;;UAEiB,KAAA,SAAc,KAAA,CAAM,wBAAA;EACnC,OAAA;EACA,KAAA;AAAA;AAAA,cAmBI,GAAA;EAAO,SAAA;EAAA,OAAA;EAAA,KAAA;EAAA,QAAA;EAAA,GAAA;AAAA,GAMV,KAAA,KAAK,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cn } from "../../../utils.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/atoms/Tag/index.tsx
|
|
5
|
+
const fillColorClasses = {
|
|
6
|
+
default: "bg-muted text-muted-foreground",
|
|
7
|
+
primary: "bg-primary/10 text-primary",
|
|
8
|
+
success: "bg-green-500/10 text-green-600 dark:text-green-400",
|
|
9
|
+
warning: "bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",
|
|
10
|
+
danger: "bg-destructive/10 text-destructive"
|
|
11
|
+
};
|
|
12
|
+
const outlinedColorClasses = {
|
|
13
|
+
default: "border-border text-foreground",
|
|
14
|
+
primary: "border-primary text-primary",
|
|
15
|
+
success: "border-green-500 text-green-600 dark:text-green-400",
|
|
16
|
+
warning: "border-yellow-500 text-yellow-600 dark:text-yellow-400",
|
|
17
|
+
danger: "border-destructive text-destructive"
|
|
18
|
+
};
|
|
19
|
+
const Tag = ({ className, variant = "default", color = "default", children, ...props }) => {
|
|
20
|
+
return /* @__PURE__ */ jsx("span", {
|
|
21
|
+
className: cn("inline-flex items-center", "rounded-full px-2.5 py-1", "text-xs font-medium", variant === "default" && fillColorClasses[color], variant === "outlined" && ["border", outlinedColorClasses[color]], className),
|
|
22
|
+
...props,
|
|
23
|
+
children
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Tag as default };
|
|
29
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/atoms/Tag/index.tsx"],"sourcesContent":["import { cn } from '@repo/ui/utils';\n\nexport interface Props extends React.ComponentPropsWithoutRef<'span'> {\n variant?: 'default' | 'outlined';\n color?: 'default' | 'primary' | 'success' | 'warning' | 'danger';\n}\n\nconst fillColorClasses: Record<string, string> = {\n default: 'bg-muted text-muted-foreground',\n primary: 'bg-primary/10 text-primary',\n success: 'bg-green-500/10 text-green-600 dark:text-green-400',\n warning: 'bg-yellow-500/10 text-yellow-600 dark:text-yellow-400',\n danger: 'bg-destructive/10 text-destructive',\n};\n\nconst outlinedColorClasses: Record<string, string> = {\n default: 'border-border text-foreground',\n primary: 'border-primary text-primary',\n success: 'border-green-500 text-green-600 dark:text-green-400',\n warning: 'border-yellow-500 text-yellow-600 dark:text-yellow-400',\n danger: 'border-destructive text-destructive',\n};\n\nconst Tag = ({\n className,\n variant = 'default',\n color = 'default',\n children,\n ...props\n}: Props) => {\n return (\n <span\n className={cn(\n 'inline-flex items-center',\n 'rounded-full px-2.5 py-1',\n 'text-xs font-medium',\n variant === 'default' && fillColorClasses[color],\n variant === 'outlined' && ['border', outlinedColorClasses[color]],\n className,\n //\n )}\n {...props}\n >\n {children}\n </span>\n );\n};\n\nexport default Tag;\n"],"mappings":";;;;AAOA,MAAM,mBAA2C;CAC/C,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACT;AAED,MAAM,uBAA+C;CACnD,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACT;AAED,MAAM,OAAO,EACX,WACA,UAAU,WACV,QAAQ,WACR,UACA,GAAG,YACQ;AACX,QACE,oBAAC;EACC,WAAW,GACT,4BACA,4BACA,uBACA,YAAY,aAAa,iBAAiB,QAC1C,YAAY,cAAc,CAAC,UAAU,qBAAqB,OAAO,EACjE,UAED;EACD,GAAI;EAEH;GACI"}
|
|
@@ -10,4 +10,5 @@ import { Radio } from "./Radio/index.mjs";
|
|
|
10
10
|
import { Select } from "./Select/index.mjs";
|
|
11
11
|
import { Skeleton } from "./Skeleton/index.mjs";
|
|
12
12
|
import { Spin } from "./Spin/index.mjs";
|
|
13
|
-
import { Switch } from "./Switch/index.mjs";
|
|
13
|
+
import { Switch } from "./Switch/index.mjs";
|
|
14
|
+
import { Tag } from "./Tag/index.mjs";
|
|
@@ -4,7 +4,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
//#region src/components/molecules/Card/index.tsx
|
|
5
5
|
const Card = ({ title, children, className, classNames, variant = "outlined", ...props }) => {
|
|
6
6
|
return /* @__PURE__ */ jsxs("div", {
|
|
7
|
-
className: cn("w-full", "rounded-lg p-4", "bg-
|
|
7
|
+
className: cn("w-full", "rounded-lg p-4", "bg-card text-card-foreground shadow-sm transition-all", variant === "outlined" && "border-border border", className),
|
|
8
8
|
...props,
|
|
9
9
|
children: [renderConditional(title, (v) => /* @__PURE__ */ jsx("div", {
|
|
10
10
|
className: cn("mb-4 font-bold", classNames?.title),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/molecules/Card/index.tsx"],"sourcesContent":["import { cn, renderConditional } from '@repo/ui/utils';\n\ninterface Props extends Omit<React.ComponentPropsWithRef<'div'>, 'title'> {\n title?: React.ReactNode;\n variant?: 'outlined' | 'borderless';\n classNames?: {\n title?: string;\n body?: string;\n };\n}\n\nconst Card = ({\n title,\n children,\n className,\n classNames,\n variant = 'outlined',\n ...props\n}: Props) => {\n return (\n <div\n className={cn(\n 'w-full',\n 'rounded-lg p-4',\n 'bg-
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/molecules/Card/index.tsx"],"sourcesContent":["import { cn, renderConditional } from '@repo/ui/utils';\n\ninterface Props extends Omit<React.ComponentPropsWithRef<'div'>, 'title'> {\n title?: React.ReactNode;\n variant?: 'outlined' | 'borderless';\n classNames?: {\n title?: string;\n body?: string;\n };\n}\n\nconst Card = ({\n title,\n children,\n className,\n classNames,\n variant = 'outlined',\n ...props\n}: Props) => {\n return (\n <div\n className={cn(\n 'w-full',\n 'rounded-lg p-4',\n 'bg-card text-card-foreground shadow-sm transition-all',\n variant === 'outlined' && 'border-border border',\n className,\n //\n )}\n {...props}\n >\n {renderConditional(title, v => (\n <div\n className={cn(\n 'mb-4 font-bold',\n classNames?.title,\n //\n )}\n >\n {v}\n </div>\n ))}\n <div\n className={cn(\n classNames?.body,\n //\n )}\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport default Card;\n"],"mappings":";;;;AAWA,MAAM,QAAQ,EACZ,OACA,UACA,WACA,YACA,UAAU,YACV,GAAG,YACQ;AACX,QACE,qBAAC;EACC,WAAW,GACT,UACA,kBACA,yDACA,YAAY,cAAc,wBAC1B,UAED;EACD,GAAI;aAEH,kBAAkB,QAAO,MACxB,oBAAC;GACC,WAAW,GACT,kBACA,YAAY,MAEb;aAEA;IACG,CACN,EACF,oBAAC;GACC,WAAW,GACT,YAAY,KAEb;GAEA;IACG;GACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { gsapWithCSS } from "../../../../node_modules/gsap/index.mjs";
|
|
2
1
|
import { useEffect, useRef, useState } from "react";
|
|
3
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { useGSAP } from "@gsap/react";
|
|
4
|
+
import { gsap } from "gsap";
|
|
5
5
|
|
|
6
6
|
//#region src/components/molecules/Marquees/Item/index.tsx
|
|
7
7
|
const Item = ({ width: _width, speed = 100, autoFill = false, pause: _pause = false, pauseOnHover = false, children }) => {
|
|
@@ -47,7 +47,7 @@ const Item = ({ width: _width, speed = 100, autoFill = false, pause: _pause = fa
|
|
|
47
47
|
useGSAP(() => {
|
|
48
48
|
if (!containerRef.current || typeof width === "string") return;
|
|
49
49
|
if (tweenRef.current) tweenRef.current.kill();
|
|
50
|
-
tweenRef.current =
|
|
50
|
+
tweenRef.current = gsap.fromTo(containerRef.current, { x: 0 }, {
|
|
51
51
|
x: -width,
|
|
52
52
|
duration: width / speed,
|
|
53
53
|
repeat: -1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/components/molecules/Marquees/Item/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport { useGSAP } from '@gsap/react';\nimport { gsap } from 'gsap';\n\nexport interface ItemProps {\n key?: React.Key;\n speed?: number;\n autoFill?: boolean | number;\n pause?: boolean;\n pauseOnHover?: boolean;\n children?: React.ReactNode;\n}\n\nexport interface Props\n extends Omit<React.ComponentPropsWithoutRef<'div'>, 'key'>, ItemProps {\n width: string | number;\n}\n\nconst Item = ({\n width: _width,\n speed = 100,\n autoFill = false,\n pause: _pause = false,\n pauseOnHover = false,\n children,\n}: Props) => {\n const itemRefs = useRef<HTMLDivElement[]>([]);\n const containerRef = useRef<HTMLDivElement>(null);\n const tweenRef = useRef<gsap.core.Tween | null>(null);\n\n const [width, setWidth] = useState<string | number>(_width);\n const [pause, setPause] = useState(false);\n const [repeatCount, setRepeatCount] = useState(\n autoFill ? (typeof autoFill === 'boolean' ? 100 : autoFill) : 0,\n );\n\n const isPaused = _pause || pause;\n\n const hoverEvents = pauseOnHover\n ? {\n onMouseEnter: () => {\n setPause(true);\n },\n onMouseLeave: () => {\n setPause(false);\n },\n }\n : {};\n\n useEffect(() => {\n if (\n !autoFill ||\n !children ||\n !itemRefs.current[0] ||\n typeof width === 'string'\n ) {\n return;\n }\n\n const itemWidth = itemRefs.current[0].offsetWidth;\n\n if (itemWidth >= width) {\n setWidth(itemWidth);\n setRepeatCount(0);\n return;\n }\n\n let totalWidth = 0;\n let repeatCount = 0;\n\n while (totalWidth < width) {\n totalWidth += itemWidth;\n repeatCount += 1;\n }\n\n setWidth(totalWidth);\n setRepeatCount(repeatCount - 1);\n }, [autoFill, width, children]);\n\n useEffect(() => {\n setWidth(_width);\n }, [_width]);\n\n useGSAP(\n () => {\n if (!containerRef.current || typeof width === 'string') {\n return;\n }\n\n if (tweenRef.current) {\n tweenRef.current.kill();\n }\n\n tweenRef.current = gsap.fromTo(\n containerRef.current,\n { x: 0 },\n {\n x: -width,\n duration: width / speed,\n repeat: -1,\n ease: 'linear',\n },\n );\n\n return () => {\n tweenRef.current?.kill();\n };\n },\n {\n scope: containerRef,\n dependencies: [width, speed],\n },\n );\n\n useEffect(() => {\n if (!tweenRef.current) {\n return;\n }\n\n if (isPaused) {\n tweenRef.current.pause();\n } else {\n tweenRef.current.play();\n }\n }, [isPaused]);\n\n useEffect(() => {\n setRepeatCount(\n autoFill ? (typeof autoFill === 'boolean' ? 100 : autoFill) : 0,\n );\n }, [autoFill]);\n\n useEffect(() => {\n const onResize = () => {\n if (!tweenRef.current || !containerRef.current) {\n return;\n }\n tweenRef.current.pause();\n };\n\n window.addEventListener('resize', onResize);\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n return (\n <div\n className=\"flex overflow-hidden\"\n {...hoverEvents}\n //\n >\n <div ref={containerRef} className=\"flex flex-nowrap\">\n {[...Array(2)].map((_, index) => (\n <div\n key={index}\n style={{ minWidth: width }}\n className=\"flex flex-nowrap\"\n >\n <div\n ref={el => {\n if (el) {\n itemRefs.current[index] = el;\n }\n }}\n >\n {children}\n </div>\n {[\n ...Array(typeof autoFill === 'number' ? autoFill : repeatCount),\n ].map((_, i) => (\n <div key={i}>{children}</div>\n ))}\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nexport default Item;\n"],"mappings":";;;;;;AAmBA,MAAM,QAAQ,EACZ,OAAO,QACP,QAAQ,KACR,WAAW,OACX,OAAO,SAAS,OAChB,eAAe,OACf,eACW;CACX,MAAM,WAAW,OAAyB,EAAE,CAAC;CAC7C,MAAM,eAAe,OAAuB,KAAK;CACjD,MAAM,WAAW,OAA+B,KAAK;CAErD,MAAM,CAAC,OAAO,YAAY,SAA0B,OAAO;CAC3D,MAAM,CAAC,OAAO,YAAY,SAAS,MAAM;CACzC,MAAM,CAAC,aAAa,kBAAkB,SACpC,WAAY,OAAO,aAAa,YAAY,MAAM,WAAY,EAC/D;CAED,MAAM,WAAW,UAAU;CAE3B,MAAM,cAAc,eAChB;EACE,oBAAoB;AAClB,YAAS,KAAK;;EAEhB,oBAAoB;AAClB,YAAS,MAAM;;EAElB,GACD,EAAE;AAEN,iBAAgB;AACd,MACE,CAAC,YACD,CAAC,YACD,CAAC,SAAS,QAAQ,MAClB,OAAO,UAAU,SAEjB;EAGF,MAAM,YAAY,SAAS,QAAQ,GAAG;AAEtC,MAAI,aAAa,OAAO;AACtB,YAAS,UAAU;AACnB,kBAAe,EAAE;AACjB;;EAGF,IAAI,aAAa;EACjB,IAAI,cAAc;AAElB,SAAO,aAAa,OAAO;AACzB,iBAAc;AACd,kBAAe;;AAGjB,WAAS,WAAW;AACpB,iBAAe,cAAc,EAAE;IAC9B;EAAC;EAAU;EAAO;EAAS,CAAC;AAE/B,iBAAgB;AACd,WAAS,OAAO;IACf,CAAC,OAAO,CAAC;AAEZ,eACQ;AACJ,MAAI,CAAC,aAAa,WAAW,OAAO,UAAU,SAC5C;AAGF,MAAI,SAAS,QACX,UAAS,QAAQ,MAAM;AAGzB,WAAS,UAAU,KAAK,OACtB,aAAa,SACb,EAAE,GAAG,GAAG,EACR;GACE,GAAG,CAAC;GACJ,UAAU,QAAQ;GAClB,QAAQ;GACR,MAAM;GACP,CACF;AAED,eAAa;AACX,YAAS,SAAS,MAAM;;IAG5B;EACE,OAAO;EACP,cAAc,CAAC,OAAO,MAAM;EAC7B,CACF;AAED,iBAAgB;AACd,MAAI,CAAC,SAAS,QACZ;AAGF,MAAI,SACF,UAAS,QAAQ,OAAO;MAExB,UAAS,QAAQ,MAAM;IAExB,CAAC,SAAS,CAAC;AAEd,iBAAgB;AACd,iBACE,WAAY,OAAO,aAAa,YAAY,MAAM,WAAY,EAC/D;IACA,CAAC,SAAS,CAAC;AAEd,iBAAgB;EACd,MAAM,iBAAiB;AACrB,OAAI,CAAC,SAAS,WAAW,CAAC,aAAa,QACrC;AAEF,YAAS,QAAQ,OAAO;;AAG1B,SAAO,iBAAiB,UAAU,SAAS;AAE3C,eAAa;AACX,UAAO,oBAAoB,UAAU,SAAS;;IAE/C,EAAE,CAAC;AAEN,QACE,oBAAC;EACC,WAAU;EACV,GAAI;YAGJ,oBAAC;GAAI,KAAK;GAAc,WAAU;aAC/B,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC,KAAK,GAAG,UACrB,qBAAC;IAEC,OAAO,EAAE,UAAU,OAAO;IAC1B,WAAU;eAEV,oBAAC;KACC,MAAK,OAAM;AACT,UAAI,GACF,UAAS,QAAQ,SAAS;;KAI7B;MACG,EACL,CACC,GAAG,MAAM,OAAO,aAAa,WAAW,WAAW,YAAY,CAChE,CAAC,KAAK,GAAG,MACR,oBAAC,SAAa,YAAJ,EAAmB,CAC7B;MAjBG,MAkBD,CACN;IACE;GACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../../utils.mjs";
|
|
2
2
|
import Skeleton from "../../atoms/Skeleton/index.mjs";
|
|
3
3
|
import { Children } from "react";
|
|
4
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/molecules/Space/index.tsx
|
|
7
7
|
const sizes = {
|
|
@@ -32,7 +32,7 @@ const Space = ({ loading, loader, children, size = "middle", orientation = "hori
|
|
|
32
32
|
...style
|
|
33
33
|
},
|
|
34
34
|
...props,
|
|
35
|
-
children: Children.map(children, (child, i) => /* @__PURE__ */ jsxs(Fragment, { children: [child, split && i < count - 1 && split] }))
|
|
35
|
+
children: Children.map(children, (child, i) => /* @__PURE__ */ jsxs(Fragment$1, { children: [child, split && i < count - 1 && split] }))
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/molecules/Space/index.tsx"],"sourcesContent":["import { Children } from 'react';\n\nimport { cn } from '@repo/ui/utils';\n\nimport Skeleton from '../../atoms/Skeleton';\n\ninterface Props extends React.ComponentPropsWithRef<'div'> {\n loading?: boolean;\n loader?: React.ReactNode;\n orientation?: 'horizontal' | 'vertical';\n size?: 'small' | 'middle' | 'large' | number | number[];\n align?: 'start' | 'end' | 'center' | 'baseline';\n wrap?: boolean;\n split?: React.ReactNode;\n grid?: {\n rows?: number;\n cols?: number;\n };\n}\n\nconst sizes: Record<string, number[]> = {\n small: [4, 4],\n middle: [8, 8],\n large: [16, 16],\n};\n\nconst aligns: Record<string, string> = {\n start: 'items-start text-start',\n end: 'items-end text-end',\n center: 'items-center text-center',\n baseline: 'items-baseline text-baseline',\n};\n\nconst Space = ({\n loading,\n loader,\n children,\n size = 'middle',\n orientation = 'horizontal',\n align = 'center',\n wrap = false,\n split,\n className,\n grid,\n hidden,\n style,\n ...props\n}: Props) => {\n const [x, y] =\n typeof size === 'string'\n ? sizes[size] || [0, 0]\n : Array.isArray(size)\n ? size\n : [size, size];\n const count = Children.count(children);\n\n if (loading) {\n return <div className={cn(className)}>{loader || <Skeleton />}</div>;\n }\n\n return (\n <div\n className={cn(\n 'flex flex-nowrap',\n orientation === 'horizontal' ? 'flex-row' : 'flex-col',\n wrap && 'flex-wrap',\n aligns[align],\n grid && 'grid',\n hidden && 'hidden',\n className,\n )}\n style={{\n columnGap: x,\n rowGap: y,\n gridTemplateRows: grid?.rows\n ? `repeat(${grid.rows}, minmax(0, 1fr))`\n : undefined,\n gridTemplateColumns: grid?.cols\n ? `repeat(${grid.cols}, minmax(0, 1fr))`\n : undefined,\n ...style,\n }}\n {...props}\n >\n {Children.map(children, (child, i) => (\n <>\n {child}\n {split && i < count - 1 && split}\n </>\n ))}\n </div>\n );\n};\n\nexport default Space;\n"],"mappings":";;;;;;AAoBA,MAAM,QAAkC;CACtC,OAAO,CAAC,GAAG,EAAE;CACb,QAAQ,CAAC,GAAG,EAAE;CACd,OAAO,CAAC,IAAI,GAAG;CAChB;AAED,MAAM,SAAiC;CACrC,OAAO;CACP,KAAK;CACL,QAAQ;CACR,UAAU;CACX;AAED,MAAM,SAAS,EACb,SACA,QACA,UACA,OAAO,UACP,cAAc,cACd,QAAQ,UACR,OAAO,OACP,OACA,WACA,MACA,QACA,OACA,GAAG,YACQ;CACX,MAAM,CAAC,GAAG,KACR,OAAO,SAAS,WACZ,MAAM,SAAS,CAAC,GAAG,EAAE,GACrB,MAAM,QAAQ,KAAK,GACjB,OACA,CAAC,MAAM,KAAK;CACpB,MAAM,QAAQ,SAAS,MAAM,SAAS;AAEtC,KAAI,QACF,QAAO,oBAAC;EAAI,WAAW,GAAG,UAAU;YAAG,UAAU,oBAAC,aAAW;GAAO;AAGtE,QACE,oBAAC;EACC,WAAW,GACT,oBACA,gBAAgB,eAAe,aAAa,YAC5C,QAAQ,aACR,OAAO,QACP,QAAQ,QACR,UAAU,UACV,UACD;EACD,OAAO;GACL,WAAW;GACX,QAAQ;GACR,kBAAkB,MAAM,OACpB,UAAU,KAAK,KAAK,qBACpB;GACJ,qBAAqB,MAAM,OACvB,UAAU,KAAK,KAAK,qBACpB;GACJ,GAAG;GACJ;EACD,GAAI;YAEH,SAAS,IAAI,WAAW,OAAO,MAC9B,
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/molecules/Space/index.tsx"],"sourcesContent":["import { Children } from 'react';\n\nimport { cn } from '@repo/ui/utils';\n\nimport Skeleton from '../../atoms/Skeleton';\n\ninterface Props extends React.ComponentPropsWithRef<'div'> {\n loading?: boolean;\n loader?: React.ReactNode;\n orientation?: 'horizontal' | 'vertical';\n size?: 'small' | 'middle' | 'large' | number | number[];\n align?: 'start' | 'end' | 'center' | 'baseline';\n wrap?: boolean;\n split?: React.ReactNode;\n grid?: {\n rows?: number;\n cols?: number;\n };\n}\n\nconst sizes: Record<string, number[]> = {\n small: [4, 4],\n middle: [8, 8],\n large: [16, 16],\n};\n\nconst aligns: Record<string, string> = {\n start: 'items-start text-start',\n end: 'items-end text-end',\n center: 'items-center text-center',\n baseline: 'items-baseline text-baseline',\n};\n\nconst Space = ({\n loading,\n loader,\n children,\n size = 'middle',\n orientation = 'horizontal',\n align = 'center',\n wrap = false,\n split,\n className,\n grid,\n hidden,\n style,\n ...props\n}: Props) => {\n const [x, y] =\n typeof size === 'string'\n ? sizes[size] || [0, 0]\n : Array.isArray(size)\n ? size\n : [size, size];\n const count = Children.count(children);\n\n if (loading) {\n return <div className={cn(className)}>{loader || <Skeleton />}</div>;\n }\n\n return (\n <div\n className={cn(\n 'flex flex-nowrap',\n orientation === 'horizontal' ? 'flex-row' : 'flex-col',\n wrap && 'flex-wrap',\n aligns[align],\n grid && 'grid',\n hidden && 'hidden',\n className,\n )}\n style={{\n columnGap: x,\n rowGap: y,\n gridTemplateRows: grid?.rows\n ? `repeat(${grid.rows}, minmax(0, 1fr))`\n : undefined,\n gridTemplateColumns: grid?.cols\n ? `repeat(${grid.cols}, minmax(0, 1fr))`\n : undefined,\n ...style,\n }}\n {...props}\n >\n {Children.map(children, (child, i) => (\n <>\n {child}\n {split && i < count - 1 && split}\n </>\n ))}\n </div>\n );\n};\n\nexport default Space;\n"],"mappings":";;;;;;AAoBA,MAAM,QAAkC;CACtC,OAAO,CAAC,GAAG,EAAE;CACb,QAAQ,CAAC,GAAG,EAAE;CACd,OAAO,CAAC,IAAI,GAAG;CAChB;AAED,MAAM,SAAiC;CACrC,OAAO;CACP,KAAK;CACL,QAAQ;CACR,UAAU;CACX;AAED,MAAM,SAAS,EACb,SACA,QACA,UACA,OAAO,UACP,cAAc,cACd,QAAQ,UACR,OAAO,OACP,OACA,WACA,MACA,QACA,OACA,GAAG,YACQ;CACX,MAAM,CAAC,GAAG,KACR,OAAO,SAAS,WACZ,MAAM,SAAS,CAAC,GAAG,EAAE,GACrB,MAAM,QAAQ,KAAK,GACjB,OACA,CAAC,MAAM,KAAK;CACpB,MAAM,QAAQ,SAAS,MAAM,SAAS;AAEtC,KAAI,QACF,QAAO,oBAAC;EAAI,WAAW,GAAG,UAAU;YAAG,UAAU,oBAAC,aAAW;GAAO;AAGtE,QACE,oBAAC;EACC,WAAW,GACT,oBACA,gBAAgB,eAAe,aAAa,YAC5C,QAAQ,aACR,OAAO,QACP,QAAQ,QACR,UAAU,UACV,UACD;EACD,OAAO;GACL,WAAW;GACX,QAAQ;GACR,kBAAkB,MAAM,OACpB,UAAU,KAAK,KAAK,qBACpB;GACJ,qBAAqB,MAAM,OACvB,UAAU,KAAK,KAAK,qBACpB;GACJ,GAAG;GACJ;EACD,GAAI;YAEH,SAAS,IAAI,WAAW,OAAO,MAC9B,8CACG,OACA,SAAS,IAAI,QAAQ,KAAK,SAC1B,CACH;GACE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ResizablePanel as ResizablePanel$1, ResizablePanelGroup as ResizablePanelGroup$1 } from "../../../core/resizable.mjs";
|
|
2
|
+
import "../../../core.mjs";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/molecules/Splitter/index.d.ts
|
|
6
|
+
declare const ResizablePanel: typeof ResizablePanel$1, ResizablePanelGroup: typeof ResizablePanelGroup$1;
|
|
7
|
+
type SplitterLayout = Parameters<NonNullable<React.ComponentProps<typeof ResizablePanelGroup>['onLayoutChanged']>>[0];
|
|
8
|
+
interface SplitterPanelProps extends React.ComponentProps<typeof ResizablePanel> {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
interface Props extends Omit<React.ComponentProps<typeof ResizablePanelGroup>, 'children' | 'orientation' | 'onLayoutChange' | 'onLayoutChanged' | 'onResize'> {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
orientation?: 'horizontal' | 'vertical';
|
|
14
|
+
withHandle?: boolean;
|
|
15
|
+
handle?: React.ReactNode;
|
|
16
|
+
handleClassName?: string;
|
|
17
|
+
onResize?: (layout: SplitterLayout) => void;
|
|
18
|
+
onResizeEnd?: (layout: SplitterLayout) => void;
|
|
19
|
+
}
|
|
20
|
+
type SplitterComponent = ((props: Props) => React.ReactNode) & {
|
|
21
|
+
Panel: typeof SplitterPanel;
|
|
22
|
+
};
|
|
23
|
+
declare const SplitterPanel: ({
|
|
24
|
+
children,
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: SplitterPanelProps) => react_jsx_runtime0.JSX.Element;
|
|
28
|
+
declare const Splitter: SplitterComponent;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Splitter };
|
|
31
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/components/molecules/Splitter/index.tsx"],"mappings":";;;;;cAOyB,cAAA,SAAc,gBAAA,EAAE,mBAAA,SAAmB,qBAAA;AAAA,KAEvD,cAAA,GAAiB,UAAA,CACpB,WAAA,CACE,KAAA,CAAM,cAAA,QAAsB,mBAAA;AAAA,UAIf,kBAAA,SAA2B,KAAA,CAAM,cAAA,QACzC,cAAA;EAEP,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,UAGD,KAAA,SAAc,IAAA,CAC7B,KAAA,CAAM,cAAA,QAAsB,mBAAA;EAG5B,QAAA,EAAU,KAAA,CAAM,SAAA;EAChB,WAAA;EACA,UAAA;EACA,MAAA,GAAS,KAAA,CAAM,SAAA;EACf,eAAA;EACA,QAAA,IAAY,MAAA,EAAQ,cAAA;EACpB,WAAA,IAAe,MAAA,EAAQ,cAAA;AAAA;AAAA,KAGpB,iBAAA,KAAsB,KAAA,EAAO,KAAA,KAAU,KAAA,CAAM,SAAA;EAChD,KAAA,SAAc,aAAA;AAAA;AAAA,cAGV,aAAA;EAAiB,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,GAIpB,kBAAA,KAAkB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAWf,QAAA,EA0CA,iBAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../utils.mjs";
|
|
4
|
+
import { resizable_exports } from "../../../core/resizable.mjs";
|
|
5
|
+
import "../../../core.mjs";
|
|
6
|
+
import { Children, Fragment } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/components/molecules/Splitter/index.tsx
|
|
10
|
+
const { ResizableHandle, ResizablePanel, ResizablePanelGroup } = resizable_exports;
|
|
11
|
+
const SplitterPanel = ({ children, className, ...props }) => {
|
|
12
|
+
return /* @__PURE__ */ jsx(ResizablePanel, {
|
|
13
|
+
className: cn("min-h-0 min-w-0 overflow-auto", className),
|
|
14
|
+
...props,
|
|
15
|
+
children
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const Splitter = (({ children, className, orientation = "horizontal", withHandle = true, handle, handleClassName, onResize, onResizeEnd, ...props }) => {
|
|
19
|
+
const panels = Children.toArray(children);
|
|
20
|
+
return /* @__PURE__ */ jsx(ResizablePanelGroup, {
|
|
21
|
+
className: cn("border-border/60 h-full w-full rounded-lg border", className),
|
|
22
|
+
orientation,
|
|
23
|
+
onLayoutChange: onResize,
|
|
24
|
+
onLayoutChanged: onResizeEnd,
|
|
25
|
+
...props,
|
|
26
|
+
children: panels.map((panel, index) => /* @__PURE__ */ jsxs(Fragment, { children: [panel, index < panels.length - 1 && /* @__PURE__ */ jsx(ResizableHandle, {
|
|
27
|
+
className: cn("hover:bg-border/80 data-separator-active:bg-border transition-colors", handleClassName),
|
|
28
|
+
withHandle: withHandle && handle === void 0,
|
|
29
|
+
children: handle
|
|
30
|
+
})] }, index))
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
Splitter.Panel = SplitterPanel;
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { Splitter as default };
|
|
37
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["resizable"],"sources":["../../../../src/components/molecules/Splitter/index.tsx"],"sourcesContent":["'use client';\n\nimport { Children, Fragment } from 'react';\n\nimport { resizable } from '@repo/ui/core';\nimport { cn } from '@repo/ui/utils';\n\nconst { ResizableHandle, ResizablePanel, ResizablePanelGroup } = resizable;\n\ntype SplitterLayout = Parameters<\n NonNullable<\n React.ComponentProps<typeof ResizablePanelGroup>['onLayoutChanged']\n >\n>[0];\n\nexport interface SplitterPanelProps extends React.ComponentProps<\n typeof ResizablePanel\n> {\n children: React.ReactNode;\n}\n\nexport interface Props extends Omit<\n React.ComponentProps<typeof ResizablePanelGroup>,\n 'children' | 'orientation' | 'onLayoutChange' | 'onLayoutChanged' | 'onResize'\n> {\n children: React.ReactNode;\n orientation?: 'horizontal' | 'vertical';\n withHandle?: boolean;\n handle?: React.ReactNode;\n handleClassName?: string;\n onResize?: (layout: SplitterLayout) => void;\n onResizeEnd?: (layout: SplitterLayout) => void;\n}\n\ntype SplitterComponent = ((props: Props) => React.ReactNode) & {\n Panel: typeof SplitterPanel;\n};\n\nconst SplitterPanel = ({\n children,\n className,\n ...props\n}: SplitterPanelProps) => {\n return (\n <ResizablePanel\n className={cn('min-h-0 min-w-0 overflow-auto', className)}\n {...props}\n >\n {children}\n </ResizablePanel>\n );\n};\n\nconst Splitter = (({\n children,\n className,\n orientation = 'horizontal',\n withHandle = true,\n handle,\n handleClassName,\n onResize,\n onResizeEnd,\n ...props\n}: Props) => {\n const panels = Children.toArray(children);\n\n return (\n <ResizablePanelGroup\n className={cn(\n 'border-border/60 h-full w-full rounded-lg border',\n className,\n )}\n orientation={orientation}\n onLayoutChange={onResize}\n onLayoutChanged={onResizeEnd}\n {...props}\n >\n {panels.map((panel, index) => (\n <Fragment key={index}>\n {panel}\n {index < panels.length - 1 && (\n <ResizableHandle\n className={cn(\n 'hover:bg-border/80 data-separator-active:bg-border transition-colors',\n handleClassName,\n )}\n withHandle={withHandle && handle === undefined}\n >\n {handle}\n </ResizableHandle>\n )}\n </Fragment>\n ))}\n </ResizablePanelGroup>\n );\n}) as SplitterComponent;\n\nSplitter.Panel = SplitterPanel;\n\nexport default Splitter;\n"],"mappings":";;;;;;;;;AAOA,MAAM,EAAE,iBAAiB,gBAAgB,wBAAwBA;AA+BjE,MAAM,iBAAiB,EACrB,UACA,WACA,GAAG,YACqB;AACxB,QACE,oBAAC;EACC,WAAW,GAAG,iCAAiC,UAAU;EACzD,GAAI;EAEH;GACc;;AAIrB,MAAM,aAAa,EACjB,UACA,WACA,cAAc,cACd,aAAa,MACb,QACA,iBACA,UACA,aACA,GAAG,YACQ;CACX,MAAM,SAAS,SAAS,QAAQ,SAAS;AAEzC,QACE,oBAAC;EACC,WAAW,GACT,oDACA,UACD;EACY;EACb,gBAAgB;EAChB,iBAAiB;EACjB,GAAI;YAEH,OAAO,KAAK,OAAO,UAClB,qBAAC,uBACE,OACA,QAAQ,OAAO,SAAS,KACvB,oBAAC;GACC,WAAW,GACT,wEACA,gBACD;GACD,YAAY,cAAc,WAAW;aAEpC;IACe,KAXP,MAaJ,CACX;GACkB;;AAI1B,SAAS,QAAQ"}
|
|
@@ -4,4 +4,5 @@ import { Card } from "./Card/index.mjs";
|
|
|
4
4
|
import { Collapse } from "./Collapse/index.mjs";
|
|
5
5
|
import { Dropdown } from "./Dropdown/index.mjs";
|
|
6
6
|
import { Marquees } from "./Marquees/index.mjs";
|
|
7
|
+
import { Splitter } from "./Splitter/index.mjs";
|
|
7
8
|
import { Space } from "./Space/index.mjs";
|
|
@@ -4,6 +4,7 @@ import Menu from "../../Menu.mjs";
|
|
|
4
4
|
import Dropdown from "./Dropdown/index.mjs";
|
|
5
5
|
import Marquees from "./Marquees/index.mjs";
|
|
6
6
|
import Reveals from "../../Reveals.mjs";
|
|
7
|
+
import Splitter from "./Splitter/index.mjs";
|
|
7
8
|
import Space from "./Space/index.mjs";
|
|
8
9
|
|
|
9
10
|
export { };
|
|
@@ -5,10 +5,12 @@ interface Props {
|
|
|
5
5
|
open: boolean;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
title?: React.ReactNode;
|
|
8
|
+
extra?: React.ReactNode;
|
|
8
9
|
footer?: React.ReactNode;
|
|
9
10
|
closable?: boolean;
|
|
10
11
|
closeIcon?: React.ReactNode;
|
|
11
12
|
direction?: 'top' | 'bottom' | 'left' | 'right';
|
|
13
|
+
size?: 'small' | 'medium' | 'large' | 'full' | string;
|
|
12
14
|
maskClosable?: boolean;
|
|
13
15
|
handlebar?: boolean;
|
|
14
16
|
draggable?: boolean;
|
|
@@ -23,6 +25,7 @@ interface Props {
|
|
|
23
25
|
header?: string;
|
|
24
26
|
title?: string;
|
|
25
27
|
close?: string;
|
|
28
|
+
extra?: string;
|
|
26
29
|
body?: string;
|
|
27
30
|
footer?: string;
|
|
28
31
|
};
|
|
@@ -32,10 +35,12 @@ interface Props {
|
|
|
32
35
|
declare const Drawer: ({
|
|
33
36
|
open,
|
|
34
37
|
title,
|
|
38
|
+
extra,
|
|
35
39
|
footer,
|
|
36
40
|
closable,
|
|
37
41
|
closeIcon,
|
|
38
42
|
direction,
|
|
43
|
+
size,
|
|
39
44
|
maskClosable,
|
|
40
45
|
handlebar,
|
|
41
46
|
draggable,
|
|
@@ -48,7 +53,7 @@ declare const Drawer: ({
|
|
|
48
53
|
container,
|
|
49
54
|
onClose,
|
|
50
55
|
...props
|
|
51
|
-
}: Props) => react_jsx_runtime0.JSX.Element
|
|
56
|
+
}: Props) => react_jsx_runtime0.JSX.Element;
|
|
52
57
|
//#endregion
|
|
53
|
-
export { Drawer };
|
|
58
|
+
export { Drawer, Props };
|
|
54
59
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/components/organisms/Drawer/index.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/components/organisms/Drawer/index.tsx"],"mappings":";;;UAoBiB,KAAA;EACf,IAAA;EACA,QAAA,GAAW,KAAA,CAAM,SAAA;EACjB,KAAA,GAAQ,KAAA,CAAM,SAAA;EACd,KAAA,GAAQ,KAAA,CAAM,SAAA;EACd,MAAA,GAAS,KAAA,CAAM,SAAA;EACf,QAAA;EACA,SAAA,GAAY,KAAA,CAAM,SAAA;EAClB,SAAA;EACA,IAAA;EACA,YAAA;EACA,SAAA;EACA,SAAA;EACA,OAAA;EACA,IAAA;EACA,SAAA;EACA,KAAA,GAAQ,KAAA,CAAM,aAAA;EACd,UAAA;IACE,IAAA;IACA,OAAA;IACA,SAAA;IACA,MAAA;IACA,KAAA;IACA,KAAA;IACA,KAAA;IACA,IAAA;IACA,MAAA;EAAA;EAEF,SAAA,GAAY,WAAA;EACZ,OAAA;AAAA;AAAA,cAqBI,MAAA;EAAU,IAAA;EAAA,KAAA;EAAA,KAAA;EAAA,MAAA;EAAA,QAAA;EAAA,SAAA;EAAA,SAAA;EAAA,IAAA;EAAA,YAAA;EAAA,SAAA;EAAA,SAAA;EAAA,OAAA;EAAA,IAAA;EAAA,SAAA;EAAA,UAAA;EAAA,KAAA;EAAA,QAAA;EAAA,SAAA;EAAA,OAAA;EAAA,GAAA;AAAA,GAqBb,KAAA,KAAK,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -3,27 +3,35 @@
|
|
|
3
3
|
import { cn, renderConditional } from "../../../utils.mjs";
|
|
4
4
|
import { drawer_exports } from "../../../core/drawer.mjs";
|
|
5
5
|
import "../../../core.mjs";
|
|
6
|
+
import Button from "../../atoms/Button/index.mjs";
|
|
6
7
|
import { X } from "lucide-react";
|
|
7
8
|
import { useEffect } from "react";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
|
|
10
11
|
//#region src/components/organisms/Drawer/index.tsx
|
|
11
12
|
const { DrawerContent, Drawer: DrawerCore, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle } = drawer_exports;
|
|
12
|
-
const
|
|
13
|
+
const SIZES = {
|
|
14
|
+
small: "30%",
|
|
15
|
+
medium: "50%",
|
|
16
|
+
large: "75%",
|
|
17
|
+
full: "90%"
|
|
18
|
+
};
|
|
19
|
+
const getSizeStyles = (direction, size) => {
|
|
20
|
+
const value = SIZES[size] || size;
|
|
21
|
+
return direction === "top" || direction === "bottom" ? { height: value } : { width: value };
|
|
22
|
+
};
|
|
23
|
+
const Drawer = ({ open, title, extra, footer, closable = true, closeIcon, direction = "bottom", size = "medium", maskClosable = true, handlebar = true, draggable = false, rounded = false, mask = true, className, classNames, style, children, container, onClose, ...props }) => {
|
|
13
24
|
useEffect(() => {
|
|
14
|
-
if (!open) return;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
+
if (!open || mask) return;
|
|
26
|
+
const originalPointerEvents = document.body.style.pointerEvents;
|
|
27
|
+
const raf = window.requestAnimationFrame(() => {
|
|
28
|
+
document.body.style.pointerEvents = "auto";
|
|
29
|
+
});
|
|
30
|
+
return () => {
|
|
31
|
+
window.cancelAnimationFrame(raf);
|
|
32
|
+
document.body.style.pointerEvents = originalPointerEvents;
|
|
33
|
+
};
|
|
25
34
|
}, [open, mask]);
|
|
26
|
-
if (typeof window === "undefined") return null;
|
|
27
35
|
return /* @__PURE__ */ jsx(DrawerCore, {
|
|
28
36
|
open,
|
|
29
37
|
direction,
|
|
@@ -38,20 +46,36 @@ const Drawer = ({ open, title, footer, closable = true, closeIcon, direction = "
|
|
|
38
46
|
handlebar,
|
|
39
47
|
mask,
|
|
40
48
|
classNames: {
|
|
41
|
-
mask:
|
|
42
|
-
handlebar:
|
|
49
|
+
mask: classNames?.mask || "",
|
|
50
|
+
handlebar: classNames?.handlebar || ""
|
|
51
|
+
},
|
|
52
|
+
style: {
|
|
53
|
+
...getSizeStyles(direction, size),
|
|
54
|
+
...style
|
|
43
55
|
},
|
|
44
|
-
style,
|
|
45
56
|
children: [
|
|
46
57
|
/* @__PURE__ */ jsxs(DrawerHeader, {
|
|
47
58
|
className: cn(classNames?.header, !title && "p-0"),
|
|
48
|
-
children: [/* @__PURE__ */ jsxs(
|
|
49
|
-
className:
|
|
50
|
-
children: [
|
|
51
|
-
|
|
59
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
60
|
+
className: "flex items-start gap-2",
|
|
61
|
+
children: [renderConditional(closable ? closeIcon || /* @__PURE__ */ jsx(X, {}) : null, (v) => /* @__PURE__ */ jsx(Button, {
|
|
62
|
+
type: "text",
|
|
63
|
+
shape: "circle",
|
|
64
|
+
size: "small",
|
|
65
|
+
"aria-label": "닫기",
|
|
66
|
+
icon: v,
|
|
52
67
|
onClick: onClose,
|
|
53
|
-
|
|
54
|
-
}))
|
|
68
|
+
className: cn(classNames?.close)
|
|
69
|
+
})), /* @__PURE__ */ jsxs("div", {
|
|
70
|
+
className: "flex flex-1 items-start justify-between gap-2",
|
|
71
|
+
children: [/* @__PURE__ */ jsx(DrawerTitle, {
|
|
72
|
+
className: cn(classNames?.title),
|
|
73
|
+
children: title
|
|
74
|
+
}), renderConditional(extra, (v) => /* @__PURE__ */ jsx("div", {
|
|
75
|
+
className: cn("shrink-0", classNames?.extra),
|
|
76
|
+
children: v
|
|
77
|
+
}))]
|
|
78
|
+
})]
|
|
55
79
|
}), /* @__PURE__ */ jsx(DrawerDescription, { className: "hidden" })]
|
|
56
80
|
}),
|
|
57
81
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["drawer"],"sources":["../../../../src/components/organisms/Drawer/index.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\nimport { X } from 'lucide-react';\n\nimport { drawer } from '@repo/ui/core';\nimport { cn, renderConditional } from '@repo/ui/utils';\n\nconst {\n DrawerContent,\n Drawer: DrawerCore,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n} = drawer;\n\
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["drawer"],"sources":["../../../../src/components/organisms/Drawer/index.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\nimport { X } from 'lucide-react';\n\nimport { drawer } from '@repo/ui/core';\nimport { cn, renderConditional } from '@repo/ui/utils';\n\nimport Button from '../../atoms/Button';\n\nconst {\n DrawerContent,\n Drawer: DrawerCore,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n} = drawer;\n\nexport interface Props {\n open: boolean;\n children?: React.ReactNode;\n title?: React.ReactNode;\n extra?: React.ReactNode;\n footer?: React.ReactNode;\n closable?: boolean;\n closeIcon?: React.ReactNode;\n direction?: 'top' | 'bottom' | 'left' | 'right';\n size?: 'small' | 'medium' | 'large' | 'full' | string;\n maskClosable?: boolean;\n handlebar?: boolean;\n draggable?: boolean;\n rounded?: boolean;\n mask?: boolean;\n className?: string;\n style?: React.CSSProperties;\n classNames?: {\n mask?: string;\n content?: string;\n handlebar?: string;\n header?: string;\n title?: string;\n close?: string;\n extra?: string;\n body?: string;\n footer?: string;\n };\n container?: HTMLElement;\n onClose: () => void;\n}\n\nconst SIZES: Record<string, string> = {\n small: '30%',\n medium: '50%',\n large: '75%',\n full: '90%',\n};\n\nconst getSizeStyles = (\n direction: 'top' | 'bottom' | 'left' | 'right',\n size: string,\n): React.CSSProperties => {\n const value = SIZES[size] || size;\n\n return direction === 'top' || direction === 'bottom'\n ? { height: value }\n : { width: value };\n};\n\nconst Drawer = ({\n open,\n title,\n extra,\n footer,\n closable = true,\n closeIcon,\n direction = 'bottom',\n size = 'medium',\n maskClosable = true,\n handlebar = true,\n draggable = false,\n rounded = false,\n mask = true,\n className,\n classNames,\n style,\n children,\n container,\n onClose,\n ...props\n}: Props) => {\n useEffect(() => {\n if (!open || mask) {\n return;\n }\n\n const originalPointerEvents = document.body.style.pointerEvents;\n\n const raf = window.requestAnimationFrame(() => {\n document.body.style.pointerEvents = 'auto';\n });\n\n return () => {\n window.cancelAnimationFrame(raf);\n document.body.style.pointerEvents = originalPointerEvents;\n };\n }, [open, mask]);\n\n return (\n <DrawerCore\n open={open}\n direction={direction}\n handleOnly={!draggable}\n container={container}\n onOpenChange={open => {\n if (!open && maskClosable) {\n onClose();\n }\n }}\n {...props}\n >\n <DrawerContent\n className={cn(\n 'border-none outline-none',\n rounded ? 'rounded-t-[30px]!' : 'rounded-none!',\n classNames?.content,\n className,\n //\n )}\n handlebar={handlebar}\n mask={mask}\n classNames={{\n mask: classNames?.mask || '',\n handlebar: classNames?.handlebar || '',\n }}\n style={{\n ...getSizeStyles(direction, size),\n ...style,\n }}\n >\n <DrawerHeader\n className={cn(\n classNames?.header,\n !title && 'p-0',\n //\n )}\n >\n <div className=\"flex items-start gap-2\">\n {renderConditional(closable ? closeIcon || <X /> : null, v => (\n <Button\n type=\"text\"\n shape=\"circle\"\n size=\"small\"\n aria-label=\"닫기\"\n icon={v}\n onClick={onClose}\n className={cn(classNames?.close)}\n />\n ))}\n <div className=\"flex flex-1 items-start justify-between gap-2\">\n <DrawerTitle className={cn(classNames?.title)}>\n {title}\n </DrawerTitle>\n {renderConditional(extra, v => (\n <div className={cn('shrink-0', classNames?.extra)}>{v}</div>\n ))}\n </div>\n </div>\n <DrawerDescription className=\"hidden\" />\n </DrawerHeader>\n <div\n className={cn(\n 'overflow-auto p-5',\n classNames?.body,\n //\n )}\n >\n {children}\n </div>\n {renderConditional(footer, v => (\n <DrawerFooter className={cn(classNames?.footer)}>{v}</DrawerFooter>\n ))}\n </DrawerContent>\n </DrawerCore>\n );\n};\n\nexport default Drawer;\n"],"mappings":";;;;;;;;;;;AAWA,MAAM,EACJ,eACA,QAAQ,YACR,mBACA,cACA,cACA,gBACEA;AAkCJ,MAAM,QAAgC;CACpC,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACP;AAED,MAAM,iBACJ,WACA,SACwB;CACxB,MAAM,QAAQ,MAAM,SAAS;AAE7B,QAAO,cAAc,SAAS,cAAc,WACxC,EAAE,QAAQ,OAAO,GACjB,EAAE,OAAO,OAAO;;AAGtB,MAAM,UAAU,EACd,MACA,OACA,OACA,QACA,WAAW,MACX,WACA,YAAY,UACZ,OAAO,UACP,eAAe,MACf,YAAY,MACZ,YAAY,OACZ,UAAU,OACV,OAAO,MACP,WACA,YACA,OACA,UACA,WACA,SACA,GAAG,YACQ;AACX,iBAAgB;AACd,MAAI,CAAC,QAAQ,KACX;EAGF,MAAM,wBAAwB,SAAS,KAAK,MAAM;EAElD,MAAM,MAAM,OAAO,4BAA4B;AAC7C,YAAS,KAAK,MAAM,gBAAgB;IACpC;AAEF,eAAa;AACX,UAAO,qBAAqB,IAAI;AAChC,YAAS,KAAK,MAAM,gBAAgB;;IAErC,CAAC,MAAM,KAAK,CAAC;AAEhB,QACE,oBAAC;EACO;EACK;EACX,YAAY,CAAC;EACF;EACX,eAAc,SAAQ;AACpB,OAAI,CAAC,QAAQ,aACX,UAAS;;EAGb,GAAI;YAEJ,qBAAC;GACC,WAAW,GACT,4BACA,UAAU,sBAAsB,iBAChC,YAAY,SACZ,UAED;GACU;GACL;GACN,YAAY;IACV,MAAM,YAAY,QAAQ;IAC1B,WAAW,YAAY,aAAa;IACrC;GACD,OAAO;IACL,GAAG,cAAc,WAAW,KAAK;IACjC,GAAG;IACJ;;IAED,qBAAC;KACC,WAAW,GACT,YAAY,QACZ,CAAC,SAAS,MAEX;gBAED,qBAAC;MAAI,WAAU;iBACZ,kBAAkB,WAAW,aAAa,oBAAC,MAAI,GAAG,OAAM,MACvD,oBAAC;OACC,MAAK;OACL,OAAM;OACN,MAAK;OACL,cAAW;OACX,MAAM;OACN,SAAS;OACT,WAAW,GAAG,YAAY,MAAM;QAChC,CACF,EACF,qBAAC;OAAI,WAAU;kBACb,oBAAC;QAAY,WAAW,GAAG,YAAY,MAAM;kBAC1C;SACW,EACb,kBAAkB,QAAO,MACxB,oBAAC;QAAI,WAAW,GAAG,YAAY,YAAY,MAAM;kBAAG;SAAQ,CAC5D;QACE;OACF,EACN,oBAAC,qBAAkB,WAAU,WAAW;MAC3B;IACf,oBAAC;KACC,WAAW,GACT,qBACA,YAAY,KAEb;KAEA;MACG;IACL,kBAAkB,SAAQ,MACzB,oBAAC;KAAa,WAAW,GAAG,YAAY,OAAO;eAAG;MAAiB,CACnE;;IACY;GACL"}
|
|
@@ -7,7 +7,7 @@ import Button from "../../atoms/Button/index.mjs";
|
|
|
7
7
|
import "../../../index.mjs";
|
|
8
8
|
import { Check, CircleQuestionMark, Info, OctagonAlert, OctagonX } from "lucide-react";
|
|
9
9
|
import React, { useEffect, useState } from "react";
|
|
10
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { createPortal } from "react-dom";
|
|
12
12
|
import { createRoot } from "react-dom/client";
|
|
13
13
|
import { v4 } from "uuid";
|
|
@@ -63,7 +63,7 @@ const Modal = ({ open = false, maskClosable = false, closable = false, closeIcon
|
|
|
63
63
|
}),
|
|
64
64
|
footer !== null && /* @__PURE__ */ jsx(DialogFooter, {
|
|
65
65
|
className: cn("flex-row justify-end gap-x-2", classNames?.footer),
|
|
66
|
-
children: footer || /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
|
|
66
|
+
children: footer || /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
67
67
|
onClick: onOk,
|
|
68
68
|
children: okText
|
|
69
69
|
}), /* @__PURE__ */ jsx(Button, {
|
|
@@ -137,7 +137,7 @@ const ModalStackRenderer = () => {
|
|
|
137
137
|
updateStack = null;
|
|
138
138
|
};
|
|
139
139
|
}, []);
|
|
140
|
-
return /* @__PURE__ */ jsx(Fragment, { children: modalStack.map(({ id, ...props }) => /* @__PURE__ */ jsx(StaticModal, {
|
|
140
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: modalStack.map(({ id, ...props }) => /* @__PURE__ */ jsx(StaticModal, {
|
|
141
141
|
id,
|
|
142
142
|
...props
|
|
143
143
|
}, id)) });
|