@sruim/nexus-design 0.0.1
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.md +195 -0
- package/dist/assets/grid.webp.js +3 -0
- package/dist/components/credits-button/index.d.ts +8 -0
- package/dist/components/credits-button/index.js +40 -0
- package/dist/components/icon/index.d.ts +7 -0
- package/dist/components/icon/index.js +32 -0
- package/dist/components/icon-button/index.d.ts +9 -0
- package/dist/components/icon-button/index.js +36 -0
- package/dist/components/img-uploader/index.d.ts +19 -0
- package/dist/components/img-uploader/index.js +107 -0
- package/dist/components/img-viewer/index.d.ts +16 -0
- package/dist/components/img-viewer/index.js +80 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/components/loadable/index.d.ts +8 -0
- package/dist/components/loadable/index.js +67 -0
- package/dist/components/loading/assets/loading.webp.js +3 -0
- package/dist/components/loading/index.d.ts +16 -0
- package/dist/components/loading/index.js +85 -0
- package/dist/components/model-uploader/index.d.ts +17 -0
- package/dist/components/model-uploader/index.js +93 -0
- package/dist/components/tree/index.d.ts +14 -0
- package/dist/components/tree/index.js +50 -0
- package/dist/components/tree/node.d.ts +23 -0
- package/dist/components/tree/node.js +185 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +43 -0
- package/dist/style.css +1193 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +96 -0
- package/dist/tokens/materials.d.ts +4 -0
- package/dist/tokens/materials.js +4 -0
- package/dist/tokens/nexus.d.ts +51 -0
- package/dist/tokens/nexus.js +42 -0
- package/dist/ui/avatar/index.d.ts +11 -0
- package/dist/ui/avatar/index.js +55 -0
- package/dist/ui/badge/index.d.ts +2 -0
- package/dist/ui/badge/index.js +45 -0
- package/dist/ui/button.d.ts +8 -0
- package/dist/ui/button.js +61 -0
- package/dist/ui/carousel/index.d.ts +43 -0
- package/dist/ui/carousel/index.js +186 -0
- package/dist/ui/checkbox/index.d.ts +4 -0
- package/dist/ui/checkbox/index.js +34 -0
- package/dist/ui/collapsible/index.d.ts +9 -0
- package/dist/ui/collapsible/index.js +7 -0
- package/dist/ui/dialog/confirm.d.ts +20 -0
- package/dist/ui/dialog/confirm.js +80 -0
- package/dist/ui/dialog/dialog.d.ts +26 -0
- package/dist/ui/dialog/dialog.js +97 -0
- package/dist/ui/dialog/index.d.ts +2 -0
- package/dist/ui/drawer.d.ts +22 -0
- package/dist/ui/drawer.js +98 -0
- package/dist/ui/form.d.ts +33 -0
- package/dist/ui/form.js +138 -0
- package/dist/ui/index.d.ts +24 -0
- package/dist/ui/input-otp.d.ts +14 -0
- package/dist/ui/input-otp.js +73 -0
- package/dist/ui/label.d.ts +4 -0
- package/dist/ui/label.js +32 -0
- package/dist/ui/masonry/index.d.ts +13 -0
- package/dist/ui/masonry/index.js +45 -0
- package/dist/ui/popover/index.d.ts +15 -0
- package/dist/ui/popover/index.js +78 -0
- package/dist/ui/progress.d.ts +6 -0
- package/dist/ui/progress.js +48 -0
- package/dist/ui/select/index.d.ts +21 -0
- package/dist/ui/select/index.js +127 -0
- package/dist/ui/slider/index.d.ts +9 -0
- package/dist/ui/slider/index.js +87 -0
- package/dist/ui/snap-input.d.ts +7 -0
- package/dist/ui/snap-input.js +38 -0
- package/dist/ui/sonner.d.ts +5 -0
- package/dist/ui/sonner.js +50 -0
- package/dist/ui/switch.d.ts +4 -0
- package/dist/ui/switch.js +33 -0
- package/dist/ui/table/index.d.ts +22 -0
- package/dist/ui/table/index.js +70 -0
- package/dist/ui/tabs/index.d.ts +12 -0
- package/dist/ui/tabs/index.js +60 -0
- package/dist/ui/toggle/index.d.ts +2 -0
- package/dist/ui/toggle/toggle-group.d.ts +9 -0
- package/dist/ui/toggle/toggle-group.js +54 -0
- package/dist/ui/toggle/toggle.d.ts +11 -0
- package/dist/ui/toggle/toggle.js +45 -0
- package/dist/ui/tooltip/index.d.ts +17 -0
- package/dist/ui/tooltip/index.js +68 -0
- package/dist/utils/config.d.ts +2 -0
- package/dist/utils/config.js +48 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/utils.d.ts +8 -0
- package/dist/utils/utils.js +91 -0
- package/package.json +148 -0
package/dist/ui/label.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from '../utils/config.js';
|
|
3
|
+
import '@radix-ui/react-portal';
|
|
4
|
+
import './avatar/index.js';
|
|
5
|
+
import './button.js';
|
|
6
|
+
import './carousel/index.js';
|
|
7
|
+
import './checkbox/index.js';
|
|
8
|
+
import './collapsible/index.js';
|
|
9
|
+
import './dialog/confirm.js';
|
|
10
|
+
import './dialog/dialog.js';
|
|
11
|
+
import './drawer.js';
|
|
12
|
+
import './form.js';
|
|
13
|
+
import './input-otp.js';
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import './popover/index.js';
|
|
16
|
+
import './progress.js';
|
|
17
|
+
import './select/index.js';
|
|
18
|
+
import './slider/index.js';
|
|
19
|
+
import './sonner.js';
|
|
20
|
+
import './switch.js';
|
|
21
|
+
import './table/index.js';
|
|
22
|
+
import './tabs/index.js';
|
|
23
|
+
import './toggle/toggle.js';
|
|
24
|
+
import './toggle/toggle-group.js';
|
|
25
|
+
import './tooltip/index.js';
|
|
26
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
27
|
+
|
|
28
|
+
const BaseStyle = "text-3.5 text-text-secondary peer-disabled:cursor-not-allowed peer-disabled:opacity-50";
|
|
29
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(LabelPrimitive.Root, { ref, className: cn(BaseStyle, className), ...props }));
|
|
30
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
31
|
+
|
|
32
|
+
export { Label };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface MasonryProps<T extends {
|
|
3
|
+
id: string | number;
|
|
4
|
+
}> {
|
|
5
|
+
data: T[];
|
|
6
|
+
render: (item: T, index: number) => React.ReactNode;
|
|
7
|
+
columnWidth?: number;
|
|
8
|
+
gap?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const Masonry: <T extends {
|
|
11
|
+
id: string | number;
|
|
12
|
+
}>({ data, render, columnWidth, gap, }: MasonryProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useState, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
const Masonry = ({
|
|
5
|
+
data,
|
|
6
|
+
render,
|
|
7
|
+
columnWidth = 250,
|
|
8
|
+
gap = 12
|
|
9
|
+
}) => {
|
|
10
|
+
const containerRef = useRef(null);
|
|
11
|
+
const [columns, setColumns] = useState(1);
|
|
12
|
+
const [columnData, setColumnData] = useState([]);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const calculateColumns = () => {
|
|
15
|
+
if (!containerRef.current) return;
|
|
16
|
+
const containerWidth = containerRef.current.offsetWidth;
|
|
17
|
+
const calculatedColumns = Math.max(
|
|
18
|
+
1,
|
|
19
|
+
Math.floor((containerWidth + gap) / (columnWidth + gap))
|
|
20
|
+
);
|
|
21
|
+
if (calculatedColumns !== columns) {
|
|
22
|
+
setColumns(calculatedColumns);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
calculateColumns();
|
|
26
|
+
window.addEventListener("resize", calculateColumns);
|
|
27
|
+
return () => window.removeEventListener("resize", calculateColumns);
|
|
28
|
+
}, [columnWidth, gap, columns]);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (columns === 0) return;
|
|
31
|
+
const newColumnData = Array.from({ length: columns }, () => []);
|
|
32
|
+
let index = 0;
|
|
33
|
+
data.forEach((item) => {
|
|
34
|
+
newColumnData[index].push(item);
|
|
35
|
+
index += 1;
|
|
36
|
+
if (index === newColumnData.length) {
|
|
37
|
+
index = 0;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
setColumnData(newColumnData);
|
|
41
|
+
}, [data, columns]);
|
|
42
|
+
return /* @__PURE__ */ jsx("div", { ref: containerRef, className: "w-full", children: /* @__PURE__ */ jsx("div", { className: "w-full flex", style: { gap: `${gap}px` }, children: columnData.map((column, columnIndex) => /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col", style: { gap: `${gap}px` }, children: column.map((item, itemIndex) => /* @__PURE__ */ jsx("div", { children: render(item, data.indexOf(item)) }, itemIndex)) }, columnIndex)) }) });
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export { Masonry };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Title: React.ForwardRefExoticComponent<React.HtmlHTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const Content: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
interface TPopover extends React.FC<PopoverPrimitive.PopoverProps> {
|
|
6
|
+
Trigger: typeof PopoverPrimitive.Trigger;
|
|
7
|
+
Content: typeof Content;
|
|
8
|
+
Portal: typeof PopoverPrimitive.Portal;
|
|
9
|
+
Anchor: typeof PopoverPrimitive.Anchor;
|
|
10
|
+
Arrow: typeof PopoverPrimitive.Arrow;
|
|
11
|
+
Close: typeof PopoverPrimitive.Close;
|
|
12
|
+
Title: typeof Title;
|
|
13
|
+
}
|
|
14
|
+
declare const Popover: TPopover;
|
|
15
|
+
export { Popover };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import '@radix-ui/react-portal';
|
|
3
|
+
import '../avatar/index.js';
|
|
4
|
+
import { cn } from '../../utils/config.js';
|
|
5
|
+
import '../button.js';
|
|
6
|
+
import '../carousel/index.js';
|
|
7
|
+
import '../checkbox/index.js';
|
|
8
|
+
import '../collapsible/index.js';
|
|
9
|
+
import '../dialog/confirm.js';
|
|
10
|
+
import '../dialog/dialog.js';
|
|
11
|
+
import '../drawer.js';
|
|
12
|
+
import '../form.js';
|
|
13
|
+
import '../input-otp.js';
|
|
14
|
+
import '../label.js';
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import '../progress.js';
|
|
17
|
+
import '../select/index.js';
|
|
18
|
+
import '../slider/index.js';
|
|
19
|
+
import '../sonner.js';
|
|
20
|
+
import '../switch.js';
|
|
21
|
+
import '../table/index.js';
|
|
22
|
+
import '../tabs/index.js';
|
|
23
|
+
import '../toggle/toggle.js';
|
|
24
|
+
import '../toggle/toggle-group.js';
|
|
25
|
+
import '../tooltip/index.js';
|
|
26
|
+
import { Icon } from '../../components/icon/index.js';
|
|
27
|
+
import '../../components/img-uploader/index.js';
|
|
28
|
+
import '../../components/img-viewer/index.js';
|
|
29
|
+
import '../../components/loading/index.js';
|
|
30
|
+
import '../../components/model-uploader/index.js';
|
|
31
|
+
import { FrostGlass } from '../../tokens/materials.js';
|
|
32
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
33
|
+
|
|
34
|
+
const AnimationBaseStyle = "duration-base ease-smooth data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0";
|
|
35
|
+
const AnimationInStyle = "data-[side=bottom]:slide-in-t-2 data-[side=left]:slide-in-r-2 data-[side=right]:slide-in-l-2 data-[side=top]:slide-in-b-2";
|
|
36
|
+
const AnimationOutStyle = "data-[side=bottom]:slide-out-t-2 data-[side=left]:slide-out-r-2 data-[side=right]:slide-out-l-2 data-[side=top]:slide-out-b-2";
|
|
37
|
+
const Title = React.forwardRef(
|
|
38
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref,
|
|
42
|
+
className: cn("relative mb-2 flex items-center justify-between", className),
|
|
43
|
+
...props,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx("div", { className: "leading-5", children }),
|
|
46
|
+
/* @__PURE__ */ jsx(PopoverPrimitive.Close, { children: /* @__PURE__ */ jsx(Icon, { icon: "i-nexus:close-monotone", className: "size-4 cursor-pointer text-text-secondary" }) })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
Title.displayName = "PopoverTitle";
|
|
52
|
+
const BaseStyle = cn("z-50 rounded-4 shadow-md outline-none", FrostGlass);
|
|
53
|
+
const Content = React.forwardRef(({ className, children, sideOffset = 12, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
54
|
+
PopoverPrimitive.Content,
|
|
55
|
+
{
|
|
56
|
+
ref,
|
|
57
|
+
sideOffset,
|
|
58
|
+
className: cn(BaseStyle, AnimationBaseStyle, AnimationInStyle, AnimationOutStyle, className),
|
|
59
|
+
onOpenAutoFocus: (event) => {
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
},
|
|
62
|
+
...props,
|
|
63
|
+
children
|
|
64
|
+
}
|
|
65
|
+
));
|
|
66
|
+
Content.displayName = PopoverPrimitive.Content.displayName;
|
|
67
|
+
const Popover = ({ children, ...props }) => {
|
|
68
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, { ...props, children });
|
|
69
|
+
};
|
|
70
|
+
Popover.Trigger = PopoverPrimitive.Trigger;
|
|
71
|
+
Popover.Content = Content;
|
|
72
|
+
Popover.Portal = PopoverPrimitive.Portal;
|
|
73
|
+
Popover.Anchor = PopoverPrimitive.Anchor;
|
|
74
|
+
Popover.Arrow = PopoverPrimitive.Arrow;
|
|
75
|
+
Popover.Close = PopoverPrimitive.Close;
|
|
76
|
+
Popover.Title = Title;
|
|
77
|
+
|
|
78
|
+
export { Popover };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Progress: React.ForwardRefExoticComponent<Omit<ProgressPrimitive.ProgressProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
4
|
+
indicator?: string;
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Progress };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from '../utils/config.js';
|
|
3
|
+
import '@radix-ui/react-portal';
|
|
4
|
+
import './avatar/index.js';
|
|
5
|
+
import './button.js';
|
|
6
|
+
import './carousel/index.js';
|
|
7
|
+
import './checkbox/index.js';
|
|
8
|
+
import './collapsible/index.js';
|
|
9
|
+
import './dialog/confirm.js';
|
|
10
|
+
import './dialog/dialog.js';
|
|
11
|
+
import './drawer.js';
|
|
12
|
+
import './form.js';
|
|
13
|
+
import './input-otp.js';
|
|
14
|
+
import './label.js';
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import './popover/index.js';
|
|
17
|
+
import './select/index.js';
|
|
18
|
+
import './slider/index.js';
|
|
19
|
+
import './sonner.js';
|
|
20
|
+
import './switch.js';
|
|
21
|
+
import './table/index.js';
|
|
22
|
+
import './tabs/index.js';
|
|
23
|
+
import './toggle/toggle.js';
|
|
24
|
+
import './toggle/toggle-group.js';
|
|
25
|
+
import './tooltip/index.js';
|
|
26
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
27
|
+
|
|
28
|
+
const Progress = React.forwardRef(({ className, value, indicator, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
29
|
+
ProgressPrimitive.Root,
|
|
30
|
+
{
|
|
31
|
+
ref,
|
|
32
|
+
className: cn("relative w-full mb-2 overflow-hidden rounded-full bg-white/8 h-1", className),
|
|
33
|
+
...props,
|
|
34
|
+
children: /* @__PURE__ */ jsx(
|
|
35
|
+
ProgressPrimitive.Indicator,
|
|
36
|
+
{
|
|
37
|
+
className: cn(
|
|
38
|
+
"size-full flex-1 bg-core-blue transition-all duration-base ease-smooth",
|
|
39
|
+
indicator
|
|
40
|
+
),
|
|
41
|
+
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
));
|
|
46
|
+
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
47
|
+
|
|
48
|
+
export { Progress };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface TSelect extends React.FC<SelectPrimitive.SelectProps> {
|
|
4
|
+
Trigger: typeof SelectPrimitive.Trigger;
|
|
5
|
+
Value: typeof SelectPrimitive.Value;
|
|
6
|
+
Separator: typeof SelectPrimitive.Separator;
|
|
7
|
+
Label: typeof SelectPrimitive.Label;
|
|
8
|
+
Group: typeof SelectPrimitive.Group;
|
|
9
|
+
Portal: typeof SelectPrimitive.Portal;
|
|
10
|
+
Arrow: typeof SelectPrimitive.Arrow;
|
|
11
|
+
ScrollUpButton: typeof ScrollUpButton;
|
|
12
|
+
ScrollDownButton: typeof ScrollDownButton;
|
|
13
|
+
Content: typeof Content;
|
|
14
|
+
Item: typeof Item;
|
|
15
|
+
}
|
|
16
|
+
declare const ScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const ScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const Content: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const Item: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const Select: TSelect;
|
|
21
|
+
export { Select };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import '@radix-ui/react-portal';
|
|
3
|
+
import '../avatar/index.js';
|
|
4
|
+
import { cn } from '../../utils/config.js';
|
|
5
|
+
import '../button.js';
|
|
6
|
+
import '../carousel/index.js';
|
|
7
|
+
import '../checkbox/index.js';
|
|
8
|
+
import '../collapsible/index.js';
|
|
9
|
+
import '../dialog/confirm.js';
|
|
10
|
+
import '../dialog/dialog.js';
|
|
11
|
+
import '../drawer.js';
|
|
12
|
+
import '../form.js';
|
|
13
|
+
import '../input-otp.js';
|
|
14
|
+
import '../label.js';
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import '../popover/index.js';
|
|
17
|
+
import '../progress.js';
|
|
18
|
+
import '../slider/index.js';
|
|
19
|
+
import '../sonner.js';
|
|
20
|
+
import '../switch.js';
|
|
21
|
+
import '../table/index.js';
|
|
22
|
+
import '../tabs/index.js';
|
|
23
|
+
import '../toggle/toggle.js';
|
|
24
|
+
import '../toggle/toggle-group.js';
|
|
25
|
+
import '../tooltip/index.js';
|
|
26
|
+
import { Icon } from '../../components/icon/index.js';
|
|
27
|
+
import '../../components/img-uploader/index.js';
|
|
28
|
+
import '../../components/img-viewer/index.js';
|
|
29
|
+
import '../../components/loading/index.js';
|
|
30
|
+
import '../../components/model-uploader/index.js';
|
|
31
|
+
import { FrostGlass } from '../../tokens/materials.js';
|
|
32
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
33
|
+
|
|
34
|
+
const Trigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
35
|
+
SelectPrimitive.Trigger,
|
|
36
|
+
{
|
|
37
|
+
ref,
|
|
38
|
+
className: cn(
|
|
39
|
+
"group w-full flex items-center justify-center gap-1 border border-white/8 rounded-3 py-3 transition-colors duration-fast ease-smooth [&>span]:line-clamp-1 focus:outline-none cursor-pointer",
|
|
40
|
+
className
|
|
41
|
+
),
|
|
42
|
+
...props,
|
|
43
|
+
children: [
|
|
44
|
+
children,
|
|
45
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
46
|
+
Icon,
|
|
47
|
+
{
|
|
48
|
+
icon: "i-nexus:arrow-monotone",
|
|
49
|
+
className: "transition duration-base ease-smooth group-data-[state=open]:rotate-180"
|
|
50
|
+
}
|
|
51
|
+
) })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
));
|
|
55
|
+
Trigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
56
|
+
const ScrollUpButton = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
57
|
+
SelectPrimitive.ScrollUpButton,
|
|
58
|
+
{
|
|
59
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
60
|
+
ref,
|
|
61
|
+
...props,
|
|
62
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: "i-nexus:arrow-monotone", className: "rotate-180" })
|
|
63
|
+
}
|
|
64
|
+
));
|
|
65
|
+
ScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
66
|
+
const ScrollDownButton = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
67
|
+
SelectPrimitive.ScrollDownButton,
|
|
68
|
+
{
|
|
69
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
70
|
+
ref,
|
|
71
|
+
...props,
|
|
72
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: "i-nexus:arrow-monotone" })
|
|
73
|
+
}
|
|
74
|
+
));
|
|
75
|
+
ScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
76
|
+
const AnimationInBaseStyle = "duration-base ease-smooth data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95";
|
|
77
|
+
const AnimationOutBaseStyle = "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95";
|
|
78
|
+
const AnimationSlideStyle = "data-[side=bottom]:slide-in-t-2 data-[side=left]:slide-in-r-2 data-[side=right]:slide-in-l-2 data-[side=top]:slide-in-b-2";
|
|
79
|
+
const Content = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
80
|
+
SelectPrimitive.Content,
|
|
81
|
+
{
|
|
82
|
+
ref,
|
|
83
|
+
className: cn(
|
|
84
|
+
"relative z-50 mt-3 max-h-[--radix-select-content-available-height] origin-[--radix-select-content-transform-origin] overflow-x-hidden overflow-y-auto rounded-3",
|
|
85
|
+
FrostGlass,
|
|
86
|
+
AnimationInBaseStyle,
|
|
87
|
+
AnimationOutBaseStyle,
|
|
88
|
+
AnimationSlideStyle,
|
|
89
|
+
className
|
|
90
|
+
),
|
|
91
|
+
position,
|
|
92
|
+
...props,
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ jsx(ScrollUpButton, {}),
|
|
95
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, { children }),
|
|
96
|
+
/* @__PURE__ */ jsx(ScrollDownButton, {})
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
) }));
|
|
100
|
+
Content.displayName = SelectPrimitive.Content.displayName;
|
|
101
|
+
const Item = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
102
|
+
SelectPrimitive.Item,
|
|
103
|
+
{
|
|
104
|
+
ref,
|
|
105
|
+
className: cn(
|
|
106
|
+
"relative w-full flex cursor-pointer select-none items-center justify-center py-3 text-3.5 outline-none transition-colors duration-fast ease-smooth data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[state=checked]:bg-core-blue/20! hover:bg-surface-hover",
|
|
107
|
+
className
|
|
108
|
+
),
|
|
109
|
+
...props,
|
|
110
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
111
|
+
}
|
|
112
|
+
));
|
|
113
|
+
Item.displayName = SelectPrimitive.Item.displayName;
|
|
114
|
+
const Select = SelectPrimitive.Root;
|
|
115
|
+
Select.Separator = SelectPrimitive.Separator;
|
|
116
|
+
Select.Label = SelectPrimitive.Label;
|
|
117
|
+
Select.Group = SelectPrimitive.Group;
|
|
118
|
+
Select.Value = SelectPrimitive.Value;
|
|
119
|
+
Select.Arrow = SelectPrimitive.Arrow;
|
|
120
|
+
Select.Portal = SelectPrimitive.Portal;
|
|
121
|
+
Select.Trigger = Trigger;
|
|
122
|
+
Select.ScrollUpButton = ScrollUpButton;
|
|
123
|
+
Select.ScrollDownButton = ScrollDownButton;
|
|
124
|
+
Select.Content = Content;
|
|
125
|
+
Select.Item = Item;
|
|
126
|
+
|
|
127
|
+
export { Select };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface Props {
|
|
4
|
+
showValue?: boolean;
|
|
5
|
+
showAuto?: boolean;
|
|
6
|
+
inputClassName?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Slider: React.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & Props & React.RefAttributes<HTMLSpanElement>>;
|
|
9
|
+
export { Slider };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from '../../utils/config.js';
|
|
3
|
+
import '@radix-ui/react-portal';
|
|
4
|
+
import '../avatar/index.js';
|
|
5
|
+
import '../button.js';
|
|
6
|
+
import '../carousel/index.js';
|
|
7
|
+
import '../checkbox/index.js';
|
|
8
|
+
import '../collapsible/index.js';
|
|
9
|
+
import '../dialog/confirm.js';
|
|
10
|
+
import '../dialog/dialog.js';
|
|
11
|
+
import '../drawer.js';
|
|
12
|
+
import '../form.js';
|
|
13
|
+
import '../input-otp.js';
|
|
14
|
+
import '../label.js';
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import '../popover/index.js';
|
|
17
|
+
import '../progress.js';
|
|
18
|
+
import '../select/index.js';
|
|
19
|
+
import { SnapInput } from '../snap-input.js';
|
|
20
|
+
import '../sonner.js';
|
|
21
|
+
import '../switch.js';
|
|
22
|
+
import '../table/index.js';
|
|
23
|
+
import '../tabs/index.js';
|
|
24
|
+
import '../toggle/toggle.js';
|
|
25
|
+
import '../toggle/toggle-group.js';
|
|
26
|
+
import '../tooltip/index.js';
|
|
27
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
28
|
+
|
|
29
|
+
const Slider = React.forwardRef(
|
|
30
|
+
({
|
|
31
|
+
className,
|
|
32
|
+
value,
|
|
33
|
+
showValue,
|
|
34
|
+
showAuto,
|
|
35
|
+
disabled,
|
|
36
|
+
inputClassName,
|
|
37
|
+
min = 0,
|
|
38
|
+
max = 100,
|
|
39
|
+
onValueChange,
|
|
40
|
+
...props
|
|
41
|
+
}, ref) => {
|
|
42
|
+
const displayValue = showAuto ? value?.[0] ? value[0] : "Auto" : value?.[0];
|
|
43
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", disabled && "opacity-50"), children: [
|
|
44
|
+
/* @__PURE__ */ jsxs(
|
|
45
|
+
SliderPrimitive.Root,
|
|
46
|
+
{
|
|
47
|
+
ref,
|
|
48
|
+
value,
|
|
49
|
+
onValueChange,
|
|
50
|
+
disabled,
|
|
51
|
+
className: cn(
|
|
52
|
+
"relative flex touch-none select-none items-center",
|
|
53
|
+
showValue ? "w-[calc(100%-4.625rem)]" : "w-full",
|
|
54
|
+
className
|
|
55
|
+
),
|
|
56
|
+
min,
|
|
57
|
+
max,
|
|
58
|
+
...props,
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsx(SliderPrimitive.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-full bg-surface-dim", children: /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: "absolute h-full bg-core-blue" }) }),
|
|
61
|
+
/* @__PURE__ */ jsx(SliderPrimitive.Thumb, { className: "block size-3.75 cursor-pointer border-2 border-white rounded-full bg-surface-primary transition-colors duration-fast ease-smooth focus-visible:outline-none" })
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
showValue && /* @__PURE__ */ jsx(
|
|
66
|
+
SnapInput,
|
|
67
|
+
{
|
|
68
|
+
type: "text",
|
|
69
|
+
className: cn(
|
|
70
|
+
"w-18.5 border border-white/8 rounded-2 bg-transparent py-2 text-center text-3",
|
|
71
|
+
inputClassName
|
|
72
|
+
),
|
|
73
|
+
disabled,
|
|
74
|
+
value: String(displayValue),
|
|
75
|
+
onChange: (stringValue) => {
|
|
76
|
+
const value2 = Number(stringValue);
|
|
77
|
+
if (isNaN(value2)) return;
|
|
78
|
+
onValueChange?.([Math.max(min, Math.min(max, value2))]);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] });
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
86
|
+
|
|
87
|
+
export { Slider };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
const SnapInput = ({ value, onChange, ...props }) => {
|
|
5
|
+
const [editValue, setEditValue] = useState(value);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
setEditValue(value);
|
|
8
|
+
}, [value]);
|
|
9
|
+
const handleInputChange = (e) => {
|
|
10
|
+
setEditValue(e.target.value);
|
|
11
|
+
};
|
|
12
|
+
const handleInputBlur = () => {
|
|
13
|
+
setEditValue(value);
|
|
14
|
+
onChange?.(editValue);
|
|
15
|
+
};
|
|
16
|
+
const handleInputKeyDown = (e) => {
|
|
17
|
+
if (e.key === "Enter") {
|
|
18
|
+
onChange?.(editValue);
|
|
19
|
+
} else if (e.key === "Escape") {
|
|
20
|
+
setEditValue(value);
|
|
21
|
+
onChange?.(editValue);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
"input",
|
|
26
|
+
{
|
|
27
|
+
...props,
|
|
28
|
+
type: "text",
|
|
29
|
+
value: editValue,
|
|
30
|
+
onChange: handleInputChange,
|
|
31
|
+
onBlur: handleInputBlur,
|
|
32
|
+
onKeyDown: handleInputKeyDown,
|
|
33
|
+
onClick: (e) => e.stopPropagation()
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { SnapInput };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { FrostGlass } from '../tokens/materials.js';
|
|
3
|
+
import { cn } from '../utils/config.js';
|
|
4
|
+
import '@radix-ui/react-portal';
|
|
5
|
+
import './avatar/index.js';
|
|
6
|
+
import './button.js';
|
|
7
|
+
import './carousel/index.js';
|
|
8
|
+
import './checkbox/index.js';
|
|
9
|
+
import './collapsible/index.js';
|
|
10
|
+
import './dialog/confirm.js';
|
|
11
|
+
import './dialog/dialog.js';
|
|
12
|
+
import './drawer.js';
|
|
13
|
+
import './form.js';
|
|
14
|
+
import './input-otp.js';
|
|
15
|
+
import './label.js';
|
|
16
|
+
import 'react';
|
|
17
|
+
import './popover/index.js';
|
|
18
|
+
import './progress.js';
|
|
19
|
+
import './select/index.js';
|
|
20
|
+
import './slider/index.js';
|
|
21
|
+
import './switch.js';
|
|
22
|
+
import './table/index.js';
|
|
23
|
+
import './tabs/index.js';
|
|
24
|
+
import './toggle/toggle.js';
|
|
25
|
+
import './toggle/toggle-group.js';
|
|
26
|
+
import './tooltip/index.js';
|
|
27
|
+
import { Toaster as Toaster$1 } from 'sonner';
|
|
28
|
+
export { toast } from 'sonner';
|
|
29
|
+
|
|
30
|
+
const toastStyle = cn(
|
|
31
|
+
"text-base text-text-primary px-5 py-3 rounded-10 w-fit flex gap-2 items-center shadow-2xl",
|
|
32
|
+
FrostGlass
|
|
33
|
+
);
|
|
34
|
+
const warningStyle = "bg-status-error";
|
|
35
|
+
const Toaster = (props) => /* @__PURE__ */ jsx(
|
|
36
|
+
Toaster$1,
|
|
37
|
+
{
|
|
38
|
+
offset: 72,
|
|
39
|
+
toastOptions: {
|
|
40
|
+
unstyled: true,
|
|
41
|
+
className: toastStyle,
|
|
42
|
+
classNames: {
|
|
43
|
+
warning: warningStyle
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
...props
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export { Toaster };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Switch };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from '../utils/config.js';
|
|
5
|
+
import '@radix-ui/react-portal';
|
|
6
|
+
import './avatar/index.js';
|
|
7
|
+
import './button.js';
|
|
8
|
+
import './carousel/index.js';
|
|
9
|
+
import './checkbox/index.js';
|
|
10
|
+
import './collapsible/index.js';
|
|
11
|
+
import './dialog/confirm.js';
|
|
12
|
+
import './dialog/dialog.js';
|
|
13
|
+
import './drawer.js';
|
|
14
|
+
import './form.js';
|
|
15
|
+
import './input-otp.js';
|
|
16
|
+
import './label.js';
|
|
17
|
+
import './popover/index.js';
|
|
18
|
+
import './progress.js';
|
|
19
|
+
import './select/index.js';
|
|
20
|
+
import './slider/index.js';
|
|
21
|
+
import './sonner.js';
|
|
22
|
+
import './table/index.js';
|
|
23
|
+
import './tabs/index.js';
|
|
24
|
+
import './toggle/toggle.js';
|
|
25
|
+
import './toggle/toggle-group.js';
|
|
26
|
+
import './tooltip/index.js';
|
|
27
|
+
|
|
28
|
+
const BaseStyle = "group inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border border-white/10 bg-white/10 transition-colors duration-fast ease-smooth data-[state=checked]:bg-core-blue/50";
|
|
29
|
+
const ThumbStyle = "pointer-events-none block size-5 rounded-full bg-white shadow-[0_0_4px_rgba(255,255,255,0.3)] transition-transform duration-fast ease-smooth data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0.5";
|
|
30
|
+
const Switch = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SwitchPrimitives.Root, { className: cn(BaseStyle, className), ...props, ref, children: /* @__PURE__ */ jsx(SwitchPrimitives.Thumb, { className: ThumbStyle }) }));
|
|
31
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
32
|
+
|
|
33
|
+
export { Switch };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as TanstackTable from '@tanstack/react-table';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const TableRoot: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
4
|
+
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
5
|
+
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
6
|
+
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
7
|
+
declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
|
|
8
|
+
declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
9
|
+
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
10
|
+
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
11
|
+
interface ITable extends React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>> {
|
|
12
|
+
Body: typeof TableBody;
|
|
13
|
+
Caption: typeof TableCaption;
|
|
14
|
+
Cell: typeof TableCell;
|
|
15
|
+
Footer: typeof TableFooter;
|
|
16
|
+
Head: typeof TableHead;
|
|
17
|
+
Header: typeof TableHeader;
|
|
18
|
+
Row: typeof TableRow;
|
|
19
|
+
Root: typeof TableRoot;
|
|
20
|
+
}
|
|
21
|
+
declare const Table: ITable;
|
|
22
|
+
export { Table, TanstackTable };
|