@nexub/react 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-24CZFBTG.js +83 -0
- package/dist/chunk-2MKB5FQI.js +122 -0
- package/dist/chunk-2RLSIOGB.js +173 -0
- package/dist/chunk-2VDP2ML4.js +105 -0
- package/dist/chunk-3CSKW56L.js +44 -0
- package/dist/chunk-3U54QLYB.js +87 -0
- package/dist/chunk-46CFSBEO.js +48 -0
- package/dist/chunk-4BTP4464.js +92 -0
- package/dist/chunk-4NGB7XIM.js +88 -0
- package/dist/chunk-4OCXGNP3.js +85 -0
- package/dist/chunk-52KTX5A7.js +119 -0
- package/dist/chunk-6AZP6VBM.js +62 -0
- package/dist/chunk-6Y734SXN.js +51 -0
- package/dist/chunk-7B4FS7VQ.js +150 -0
- package/dist/chunk-7W2YDJ5W.js +128 -0
- package/dist/chunk-A7L75YXY.js +61 -0
- package/dist/chunk-ADO2DB6Q.js +1 -0
- package/dist/chunk-AHZQQ7OT.js +83 -0
- package/dist/chunk-AT6RPKU3.js +12 -0
- package/dist/chunk-BBVOB4EC.js +36 -0
- package/dist/chunk-BGY23Y5O.js +104 -0
- package/dist/chunk-BJKW3G2L.js +99 -0
- package/dist/chunk-BMVAZIAJ.js +187 -0
- package/dist/chunk-BTZW34TX.js +76 -0
- package/dist/chunk-BUBYXAJK.js +20 -0
- package/dist/chunk-BV3U3ATL.js +1 -0
- package/dist/chunk-BYCTJHXY.js +75 -0
- package/dist/chunk-BYF223HT.js +92 -0
- package/dist/chunk-CPV367VS.js +106 -0
- package/dist/chunk-CVBAWKNG.js +124 -0
- package/dist/chunk-CZUNTABW.js +25 -0
- package/dist/chunk-DAXDAFNG.js +92 -0
- package/dist/chunk-DD6XCW6R.js +53 -0
- package/dist/chunk-DEH2Z27F.js +50 -0
- package/dist/chunk-DOHXBNOP.js +119 -0
- package/dist/chunk-DR2Y3PIT.js +91 -0
- package/dist/chunk-ELC2NBGH.js +89 -0
- package/dist/chunk-EV43I5J6.js +1 -0
- package/dist/chunk-FS4XKWFA.js +308 -0
- package/dist/chunk-FUJOSPNQ.js +38 -0
- package/dist/chunk-GTQIA62H.js +60 -0
- package/dist/chunk-H4MXRAXP.js +37 -0
- package/dist/chunk-HW3I7I3R.js +29 -0
- package/dist/chunk-HY3JWSG4.js +1 -0
- package/dist/chunk-I5Z3A7N3.js +40 -0
- package/dist/chunk-IBCYG6HR.js +55 -0
- package/dist/chunk-IHW2L532.js +175 -0
- package/dist/chunk-IU76LV3W.js +101 -0
- package/dist/chunk-IZ6ZPEZ2.js +1 -0
- package/dist/chunk-JCUVWDUC.js +57 -0
- package/dist/chunk-JKTZMWWC.js +63 -0
- package/dist/chunk-JQDLCN5D.js +66 -0
- package/dist/chunk-K7CUCLLI.js +43 -0
- package/dist/chunk-KBB7M6WO.js +65 -0
- package/dist/chunk-KLTQJZOX.js +1 -0
- package/dist/chunk-KWWV3CM3.js +62 -0
- package/dist/chunk-KZW37FQZ.js +40 -0
- package/dist/chunk-L6GBZ2HB.js +145 -0
- package/dist/chunk-LAWZQ6R6.js +76 -0
- package/dist/chunk-LOP63AVE.js +49 -0
- package/dist/chunk-MY6XUJ5P.js +216 -0
- package/dist/chunk-N2GIMMTF.js +98 -0
- package/dist/chunk-NAIZ7R2L.js +59 -0
- package/dist/chunk-NHUQLIHL.js +9 -0
- package/dist/chunk-NZ7UK3G6.js +1 -0
- package/dist/chunk-OUBBOOZE.js +34 -0
- package/dist/chunk-OZPPL76D.js +82 -0
- package/dist/chunk-P6BZNFVU.js +38 -0
- package/dist/chunk-PANDAMD2.js +54 -0
- package/dist/chunk-PBLEGOLM.js +71 -0
- package/dist/chunk-PER3O4FD.js +33 -0
- package/dist/chunk-PICMOOAZ.js +1 -0
- package/dist/chunk-POBSY7EZ.js +155 -0
- package/dist/chunk-POFKKYHY.js +37 -0
- package/dist/chunk-QF7GUDOE.js +67 -0
- package/dist/chunk-QHJ43Q2T.js +70 -0
- package/dist/chunk-QURKXXNS.js +46 -0
- package/dist/chunk-ROZVVWPV.js +8 -0
- package/dist/chunk-S344IRK4.js +63 -0
- package/dist/chunk-SZKUSLHI.js +176 -0
- package/dist/chunk-T4IVMVMQ.js +32 -0
- package/dist/chunk-TCTFQYLH.js +115 -0
- package/dist/chunk-U3AEA4BZ.js +56 -0
- package/dist/chunk-U3EGB3JL.js +43 -0
- package/dist/chunk-UALYS4XI.js +67 -0
- package/dist/chunk-UTBUIBEP.js +153 -0
- package/dist/chunk-UWWL5FPC.js +80 -0
- package/dist/chunk-V3FZHIEB.js +52 -0
- package/dist/chunk-V6GZZFTV.js +106 -0
- package/dist/chunk-VPZCQFVY.js +33 -0
- package/dist/chunk-VT7RKY46.js +49 -0
- package/dist/chunk-W4IEXUD4.js +127 -0
- package/dist/chunk-WPPNDU2E.js +36 -0
- package/dist/chunk-XNDCVVNE.js +45 -0
- package/dist/chunk-Y45JAJKW.js +44 -0
- package/dist/chunk-YAGVMERC.js +81 -0
- package/dist/chunk-YGOR3KT7.js +46 -0
- package/dist/chunk-YJD66LTV.js +54 -0
- package/dist/chunk-YJU4ZRQZ.js +1 -0
- package/dist/chunk-YUFCNHZF.js +27 -0
- package/dist/chunk-YUNWZAAD.js +57 -0
- package/dist/chunk-ZFVBFCYV.js +84 -0
- package/dist/chunk-ZXLACKEB.js +8 -0
- package/dist/components/Accordion/index.js +8 -0
- package/dist/components/Alert/index.js +10 -0
- package/dist/components/AlertDialog/index.js +8 -0
- package/dist/components/AppShell/index.js +8 -0
- package/dist/components/AspectRatio/index.js +8 -0
- package/dist/components/Autocomplete/index.js +9 -0
- package/dist/components/Avatar/index.js +11 -0
- package/dist/components/AvatarGroup/index.js +11 -0
- package/dist/components/Badge/index.js +10 -0
- package/dist/components/Banner/index.js +10 -0
- package/dist/components/Box/index.js +8 -0
- package/dist/components/Breadcrumb/index.js +8 -0
- package/dist/components/Button/index.js +10 -0
- package/dist/components/ButtonGroup/index.js +8 -0
- package/dist/components/Callout/index.js +10 -0
- package/dist/components/Card/index.js +11 -0
- package/dist/components/CheckList/index.js +10 -0
- package/dist/components/Checkbox/index.js +8 -0
- package/dist/components/Chip/index.js +10 -0
- package/dist/components/Code/index.js +8 -0
- package/dist/components/Collapsible/index.js +8 -0
- package/dist/components/Combobox/index.js +9 -0
- package/dist/components/CommandPalette/index.js +8 -0
- package/dist/components/Container/index.js +10 -0
- package/dist/components/ContextMenu/index.js +8 -0
- package/dist/components/CountryBadge/index.js +9 -0
- package/dist/components/DataTable/index.js +8 -0
- package/dist/components/DatePicker/index.js +8 -0
- package/dist/components/DateRangePicker/index.js +8 -0
- package/dist/components/Dialog/index.js +9 -0
- package/dist/components/Drawer/index.js +11 -0
- package/dist/components/DropdownMenu/index.js +8 -0
- package/dist/components/EmptyState/index.js +8 -0
- package/dist/components/ErrorState/index.js +8 -0
- package/dist/components/EyebrowChip/index.js +8 -0
- package/dist/components/FileUpload/index.js +8 -0
- package/dist/components/FilterChip/index.js +8 -0
- package/dist/components/Flag/index.js +9 -0
- package/dist/components/Flex/index.js +8 -0
- package/dist/components/FormError/index.js +9 -0
- package/dist/components/FormField/index.js +11 -0
- package/dist/components/GradientDivider/index.js +8 -0
- package/dist/components/Grid/index.js +8 -0
- package/dist/components/Heading/index.js +10 -0
- package/dist/components/HelperText/index.js +9 -0
- package/dist/components/HoverCard/index.js +8 -0
- package/dist/components/IconButton/index.js +10 -0
- package/dist/components/Input/index.js +15 -0
- package/dist/components/Kbd/index.js +9 -0
- package/dist/components/KeyboardShortcut/index.js +9 -0
- package/dist/components/Label/index.js +11 -0
- package/dist/components/Link/index.js +10 -0
- package/dist/components/Logo/index.js +10 -0
- package/dist/components/Menubar/index.js +8 -0
- package/dist/components/Motion/index.js +13 -0
- package/dist/components/NavigationMenu/index.js +8 -0
- package/dist/components/NumberInput/index.js +9 -0
- package/dist/components/PageHeader/index.js +8 -0
- package/dist/components/Pagination/index.js +8 -0
- package/dist/components/PasswordInput/index.js +9 -0
- package/dist/components/Popover/index.js +9 -0
- package/dist/components/Progress/index.js +12 -0
- package/dist/components/RadioGroup/index.js +8 -0
- package/dist/components/Rating/index.js +11 -0
- package/dist/components/ScrollArea/index.js +8 -0
- package/dist/components/SearchInput/index.js +9 -0
- package/dist/components/Section/index.js +10 -0
- package/dist/components/SegmentedControl/index.js +8 -0
- package/dist/components/Select/index.js +8 -0
- package/dist/components/Separator/index.js +10 -0
- package/dist/components/Sidebar/index.js +8 -0
- package/dist/components/Skeleton/index.js +10 -0
- package/dist/components/Slider/index.js +8 -0
- package/dist/components/Spinner/index.js +10 -0
- package/dist/components/Stack/index.js +8 -0
- package/dist/components/StatusPill/index.js +10 -0
- package/dist/components/Switch/index.js +8 -0
- package/dist/components/Table/index.js +8 -0
- package/dist/components/Tabs/index.js +8 -0
- package/dist/components/Tag/index.js +10 -0
- package/dist/components/Text/index.js +10 -0
- package/dist/components/TextGradient/index.js +8 -0
- package/dist/components/Textarea/index.js +10 -0
- package/dist/components/ThemeProvider/index.js +10 -0
- package/dist/components/Toast/index.js +14 -0
- package/dist/components/Toggle/index.js +11 -0
- package/dist/components/ToggleGroup/index.js +9 -0
- package/dist/components/Toolbar/index.js +8 -0
- package/dist/components/Tooltip/index.js +16 -0
- package/dist/components/TopNav/index.js +9 -0
- package/dist/components/VisuallyHidden/index.js +7 -0
- package/dist/index.d.ts +28 -11
- package/dist/index.js +479 -5896
- package/package.json +12 -12
- package/dist/index.cjs +0 -6112
- package/dist/index.d.cts +0 -1245
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Toolbar/Toolbar.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import * as RadixToolbar from "@radix-ui/react-toolbar";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var Root2 = React.forwardRef(
|
|
11
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
12
|
+
RadixToolbar.Root,
|
|
13
|
+
{
|
|
14
|
+
ref,
|
|
15
|
+
className: cn(
|
|
16
|
+
"flex items-center gap-1 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-default)] p-1",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
...props
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
Root2.displayName = "Toolbar.Root";
|
|
24
|
+
var ToolbarButton = React.forwardRef(
|
|
25
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
26
|
+
RadixToolbar.Button,
|
|
27
|
+
{
|
|
28
|
+
ref,
|
|
29
|
+
className: cn(
|
|
30
|
+
"inline-flex h-8 items-center justify-center rounded-md px-3 text-sm font-medium transition-colors",
|
|
31
|
+
"hover:bg-[var(--color-bg-subtle)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)]",
|
|
32
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
33
|
+
className
|
|
34
|
+
),
|
|
35
|
+
...props
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
ToolbarButton.displayName = "Toolbar.Button";
|
|
40
|
+
var Separator2 = React.forwardRef(
|
|
41
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
42
|
+
RadixToolbar.Separator,
|
|
43
|
+
{
|
|
44
|
+
ref,
|
|
45
|
+
className: cn("mx-1 w-px self-stretch bg-[var(--color-border-default)]", className),
|
|
46
|
+
...props
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
Separator2.displayName = "Toolbar.Separator";
|
|
51
|
+
var ToggleGroup2 = React.forwardRef(
|
|
52
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
53
|
+
RadixToolbar.ToggleGroup,
|
|
54
|
+
{
|
|
55
|
+
ref,
|
|
56
|
+
className: cn("flex items-center gap-0.5", className),
|
|
57
|
+
...props
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
ToggleGroup2.displayName = "Toolbar.ToggleGroup";
|
|
62
|
+
var ToggleItem2 = React.forwardRef(
|
|
63
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
64
|
+
RadixToolbar.ToggleItem,
|
|
65
|
+
{
|
|
66
|
+
ref,
|
|
67
|
+
className: cn(
|
|
68
|
+
"inline-flex h-8 w-8 items-center justify-center rounded-md text-sm transition-colors",
|
|
69
|
+
"hover:bg-[var(--color-bg-subtle)] data-[state=on]:bg-[var(--color-bg-subtle)]",
|
|
70
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)]",
|
|
71
|
+
className
|
|
72
|
+
),
|
|
73
|
+
...props
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
);
|
|
77
|
+
ToggleItem2.displayName = "Toolbar.ToggleItem";
|
|
78
|
+
var Toolbar = { Root: Root2, Button: ToolbarButton, Separator: Separator2, ToggleGroup: ToggleGroup2, ToggleItem: ToggleItem2 };
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
Toolbar
|
|
82
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Slider/Slider.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import * as RadixSlider from "@radix-ui/react-slider";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var Slider = React.forwardRef(
|
|
11
|
+
({ className, thumbLabels, "aria-label": ariaLabel, ...props }, ref) => {
|
|
12
|
+
const count = (props.value ?? props.defaultValue ?? [0]).length;
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
|
+
RadixSlider.Root,
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
className: cn("relative flex w-full touch-none select-none items-center", className),
|
|
18
|
+
...props,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ jsx(RadixSlider.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-[var(--color-bg-muted)]", children: /* @__PURE__ */ jsx(RadixSlider.Range, { className: "absolute h-full bg-[var(--color-fill-primary)]" }) }),
|
|
21
|
+
Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx(
|
|
22
|
+
RadixSlider.Thumb,
|
|
23
|
+
{
|
|
24
|
+
"aria-label": thumbLabels?.[i] ?? ariaLabel,
|
|
25
|
+
className: "block h-5 w-5 rounded-full border-2 border-[var(--color-fill-primary)] bg-[var(--color-bg-default)] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)] focus-visible:ring-offset-2 ring-offset-[var(--color-ring-offset)] disabled:pointer-events-none disabled:opacity-50"
|
|
26
|
+
},
|
|
27
|
+
i
|
|
28
|
+
))
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
Slider.displayName = "Slider";
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
Slider
|
|
38
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/CheckList/CheckList.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { Check } from "@nexub/icons";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var CheckList = React.forwardRef(
|
|
11
|
+
({ className, items, children, ...props }, ref) => {
|
|
12
|
+
return /* @__PURE__ */ jsxs(
|
|
13
|
+
"ul",
|
|
14
|
+
{
|
|
15
|
+
ref,
|
|
16
|
+
className: cn("flex flex-col gap-2 list-none m-0 p-0", className),
|
|
17
|
+
...props,
|
|
18
|
+
children: [
|
|
19
|
+
items?.map((item, index) => /* @__PURE__ */ jsx(CheckListItem, { children: item }, index)),
|
|
20
|
+
children
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
CheckList.displayName = "CheckList";
|
|
27
|
+
var CheckListItem = React.forwardRef(
|
|
28
|
+
({ className, children, ...props }, ref) => {
|
|
29
|
+
return /* @__PURE__ */ jsxs(
|
|
30
|
+
"li",
|
|
31
|
+
{
|
|
32
|
+
ref,
|
|
33
|
+
className: cn("flex items-start gap-2 text-[var(--color-text-primary)]", className),
|
|
34
|
+
...props,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 inline-flex items-center justify-center mt-0.5 h-4 w-4 rounded-full bg-[var(--color-semantic-success-default)]/10", children: /* @__PURE__ */ jsx(
|
|
37
|
+
Check,
|
|
38
|
+
{
|
|
39
|
+
className: "h-3 w-3 text-[var(--color-semantic-success-default)]",
|
|
40
|
+
"aria-hidden": "true"
|
|
41
|
+
}
|
|
42
|
+
) }),
|
|
43
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children })
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
CheckListItem.displayName = "CheckListItem";
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
CheckList,
|
|
53
|
+
CheckListItem
|
|
54
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
glassSurfaceClass
|
|
4
|
+
} from "./chunk-ROZVVWPV.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-AT6RPKU3.js";
|
|
8
|
+
|
|
9
|
+
// src/components/Card/Card.tsx
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
12
|
+
import { cva } from "class-variance-authority";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var cardVariants = cva(
|
|
15
|
+
"rounded-lg bg-[var(--color-bg-default)] border border-[var(--color-border-default)] text-[var(--color-text-primary)]",
|
|
16
|
+
{
|
|
17
|
+
variants: {
|
|
18
|
+
variant: {
|
|
19
|
+
flat: "",
|
|
20
|
+
surface: "shadow-[var(--shadow-card,0_1px_3px_0_rgb(0_0_0/0.1),0_1px_2px_-1px_rgb(0_0_0/0.1))]",
|
|
21
|
+
interactive: "cursor-pointer shadow-[var(--shadow-sm)] transition-all duration-200 hover:shadow-[var(--shadow-md)] hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)] focus-visible:ring-offset-2 ring-offset-[var(--color-ring-offset)]"
|
|
22
|
+
},
|
|
23
|
+
// Material. 'glass' needs data-material="glass" on the element (set in the
|
|
24
|
+
// component) for the --glass-* vars to resolve. Single box-shadow carries
|
|
25
|
+
// both the inset specular highlight and the drop shadow so neither clobbers
|
|
26
|
+
// the other. Listed after `variant` so tailwind-merge lets it win on bg/border.
|
|
27
|
+
surface: {
|
|
28
|
+
solid: "",
|
|
29
|
+
glass: glassSurfaceClass
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
variant: "flat",
|
|
34
|
+
surface: "solid"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
var toneBorderMap = {
|
|
39
|
+
neutral: "",
|
|
40
|
+
info: "border-l-4 border-l-[var(--color-semantic-info-default)]",
|
|
41
|
+
success: "border-l-4 border-l-[var(--color-semantic-success-default)]",
|
|
42
|
+
warning: "border-l-4 border-l-[var(--color-semantic-warning-default)]",
|
|
43
|
+
danger: "border-l-4 border-l-[var(--color-semantic-error-default)]",
|
|
44
|
+
leap: "border-l-4 border-l-[var(--color-leap-500)]",
|
|
45
|
+
bookub: "border-l-4 border-l-[var(--color-bookub-500)]",
|
|
46
|
+
payub: "border-l-4 border-l-[var(--color-payub-500)]",
|
|
47
|
+
founderub: "border-l-4 border-l-[var(--color-founderub-500)]"
|
|
48
|
+
};
|
|
49
|
+
var Card = React.forwardRef(
|
|
50
|
+
({ className, variant = "flat", surface = "solid", tone, asChild = false, children, ...props }, ref) => {
|
|
51
|
+
const Comp = asChild ? Slot : "div";
|
|
52
|
+
const toneStyle = tone ? toneBorderMap[tone] : "";
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
Comp,
|
|
55
|
+
{
|
|
56
|
+
ref,
|
|
57
|
+
className: cn(cardVariants({ variant, surface }), toneStyle, className),
|
|
58
|
+
"data-tone": tone,
|
|
59
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
60
|
+
...props,
|
|
61
|
+
children
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
Card.displayName = "Card";
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
cardVariants,
|
|
70
|
+
Card
|
|
71
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Kbd/Kbd.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var Kbd = React.forwardRef(
|
|
10
|
+
({ className, children, ...rest }, ref) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"kbd",
|
|
13
|
+
{
|
|
14
|
+
ref,
|
|
15
|
+
className: cn(
|
|
16
|
+
"inline-flex items-center justify-center font-mono text-xs",
|
|
17
|
+
"px-1.5 py-0.5 min-w-[1.5rem]",
|
|
18
|
+
"rounded border border-[var(--color-border-default)]",
|
|
19
|
+
"bg-[var(--color-bg-subtle)] text-[var(--color-text-secondary)]",
|
|
20
|
+
"shadow-[0_1px_0_var(--color-border-default)]",
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
...rest,
|
|
24
|
+
children
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
Kbd.displayName = "Kbd";
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
Kbd
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/FileUpload/FileUpload.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { Upload, X } from "@nexub/icons";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var FileUploadContext = React.createContext(null);
|
|
11
|
+
function useFileUpload() {
|
|
12
|
+
const ctx = React.useContext(FileUploadContext);
|
|
13
|
+
if (!ctx) throw new Error("FileUpload parts must be used inside FileUpload.Root");
|
|
14
|
+
return ctx;
|
|
15
|
+
}
|
|
16
|
+
var Root = React.forwardRef(
|
|
17
|
+
({ className, accept, maxFiles, onFilesChange, children, ...props }, ref) => {
|
|
18
|
+
const [files, setFiles] = React.useState([]);
|
|
19
|
+
const [isDragging, setIsDragging] = React.useState(false);
|
|
20
|
+
const addFiles = React.useCallback(
|
|
21
|
+
(newFiles) => {
|
|
22
|
+
setFiles((prev) => {
|
|
23
|
+
const next = [...prev, ...newFiles].slice(0, maxFiles);
|
|
24
|
+
onFilesChange?.(next);
|
|
25
|
+
return next;
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
[maxFiles, onFilesChange]
|
|
29
|
+
);
|
|
30
|
+
const removeFile = React.useCallback(
|
|
31
|
+
(index) => {
|
|
32
|
+
setFiles((prev) => {
|
|
33
|
+
const next = prev.filter((_, i) => i !== index);
|
|
34
|
+
onFilesChange?.(next);
|
|
35
|
+
return next;
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
[onFilesChange]
|
|
39
|
+
);
|
|
40
|
+
const contextValue = React.useMemo(
|
|
41
|
+
() => ({ accept, maxFiles, onFilesChange, files, addFiles, removeFile, isDragging, setIsDragging }),
|
|
42
|
+
[accept, maxFiles, onFilesChange, files, addFiles, removeFile, isDragging, setIsDragging]
|
|
43
|
+
);
|
|
44
|
+
return /* @__PURE__ */ jsx(FileUploadContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col gap-4", className), ...props, children }) });
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
Root.displayName = "FileUpload.Root";
|
|
48
|
+
var Dropzone = React.forwardRef(
|
|
49
|
+
({ className, children, ...props }, ref) => {
|
|
50
|
+
const { accept, addFiles, isDragging, setIsDragging } = useFileUpload();
|
|
51
|
+
const inputRef = React.useRef(null);
|
|
52
|
+
function handleDrop(e) {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
setIsDragging(false);
|
|
55
|
+
const dropped = Array.from(e.dataTransfer.files);
|
|
56
|
+
addFiles(dropped);
|
|
57
|
+
}
|
|
58
|
+
return /* @__PURE__ */ jsxs(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
ref,
|
|
62
|
+
role: "button",
|
|
63
|
+
tabIndex: 0,
|
|
64
|
+
"aria-label": "Upload files",
|
|
65
|
+
onClick: () => inputRef.current?.click(),
|
|
66
|
+
onKeyDown: (e) => {
|
|
67
|
+
if (e.key === "Enter" || e.key === " ") inputRef.current?.click();
|
|
68
|
+
},
|
|
69
|
+
onDragOver: (e) => {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
setIsDragging(true);
|
|
72
|
+
},
|
|
73
|
+
onDragLeave: () => setIsDragging(false),
|
|
74
|
+
onDrop: handleDrop,
|
|
75
|
+
className: cn(
|
|
76
|
+
"flex cursor-pointer flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed p-8 text-center transition-colors",
|
|
77
|
+
isDragging ? "border-[var(--color-brand-primary-500)] bg-[var(--color-brand-primary-500)]/5" : "border-[var(--color-border-input)] hover:border-[var(--color-brand-primary-500)] hover:bg-[var(--color-bg-subtle)]",
|
|
78
|
+
className
|
|
79
|
+
),
|
|
80
|
+
...props,
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsx(Upload, { size: "lg", className: "text-[var(--color-text-muted)]", "aria-hidden": "true" }),
|
|
83
|
+
children ?? /* @__PURE__ */ jsxs("p", { className: "text-sm text-[var(--color-text-muted)]", children: [
|
|
84
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold text-[var(--color-brand-primary-500)]", children: "Click to upload" }),
|
|
85
|
+
" ",
|
|
86
|
+
"or drag and drop"
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
"input",
|
|
90
|
+
{
|
|
91
|
+
ref: inputRef,
|
|
92
|
+
type: "file",
|
|
93
|
+
className: "sr-only",
|
|
94
|
+
multiple: true,
|
|
95
|
+
accept: accept?.join(","),
|
|
96
|
+
onChange: (e) => {
|
|
97
|
+
if (e.target.files) addFiles(Array.from(e.target.files));
|
|
98
|
+
e.target.value = "";
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
Dropzone.displayName = "FileUpload.Dropzone";
|
|
108
|
+
var List = React.forwardRef(
|
|
109
|
+
({ className, ...props }, ref) => {
|
|
110
|
+
const { files } = useFileUpload();
|
|
111
|
+
if (files.length === 0) return null;
|
|
112
|
+
return /* @__PURE__ */ jsx("ul", { ref, className: cn("flex flex-col gap-2", className), ...props });
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
List.displayName = "FileUpload.List";
|
|
116
|
+
var Item = React.forwardRef(({ className, index, ...props }, ref) => {
|
|
117
|
+
const { files, removeFile } = useFileUpload();
|
|
118
|
+
const file = files[index];
|
|
119
|
+
if (!file) return null;
|
|
120
|
+
return /* @__PURE__ */ jsxs(
|
|
121
|
+
"li",
|
|
122
|
+
{
|
|
123
|
+
ref,
|
|
124
|
+
className: cn(
|
|
125
|
+
"flex items-center justify-between gap-3 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-default)] p-3",
|
|
126
|
+
className
|
|
127
|
+
),
|
|
128
|
+
...props,
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
131
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-sm font-medium text-[var(--color-text-primary)]", children: file.name }),
|
|
132
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-[var(--color-text-muted)]", children: [
|
|
133
|
+
(file.size / 1024).toFixed(1),
|
|
134
|
+
" KB"
|
|
135
|
+
] })
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ jsx(
|
|
138
|
+
"button",
|
|
139
|
+
{
|
|
140
|
+
onClick: () => removeFile(index),
|
|
141
|
+
"aria-label": `Remove ${file.name}`,
|
|
142
|
+
className: "shrink-0 rounded p-1 text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] transition-colors",
|
|
143
|
+
children: /* @__PURE__ */ jsx(X, { size: "sm", "aria-hidden": "true" })
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
});
|
|
150
|
+
Item.displayName = "FileUpload.Item";
|
|
151
|
+
var FileUpload = { Root, Dropzone, List, Item };
|
|
152
|
+
|
|
153
|
+
export {
|
|
154
|
+
FileUpload
|
|
155
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Flag/Flag.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function countryCodeToEmoji(code) {
|
|
10
|
+
return code.toUpperCase().split("").map((c) => String.fromCodePoint(c.charCodeAt(0) - 65 + 127462)).join("");
|
|
11
|
+
}
|
|
12
|
+
var sizeClass = {
|
|
13
|
+
sm: "text-base",
|
|
14
|
+
md: "text-xl",
|
|
15
|
+
lg: "text-3xl"
|
|
16
|
+
};
|
|
17
|
+
var Flag = React.forwardRef(
|
|
18
|
+
({ code, size = "md", className, ...rest }, ref) => {
|
|
19
|
+
const emoji = countryCodeToEmoji(code);
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
"span",
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
role: "img",
|
|
25
|
+
"aria-label": code,
|
|
26
|
+
className: cn("inline-block leading-none", sizeClass[size], className),
|
|
27
|
+
...rest,
|
|
28
|
+
children: emoji
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
Flag.displayName = "Flag";
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
Flag
|
|
37
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Skeleton/Skeleton.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var skeletonVariants = cva(
|
|
11
|
+
"bg-[var(--color-bg-muted)]",
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
shape: {
|
|
15
|
+
line: "rounded",
|
|
16
|
+
rect: "rounded-md",
|
|
17
|
+
circle: "rounded-full"
|
|
18
|
+
},
|
|
19
|
+
animated: {
|
|
20
|
+
true: "animate-pulse"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
shape: "line",
|
|
25
|
+
animated: true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
var Skeleton = React.forwardRef(
|
|
30
|
+
({
|
|
31
|
+
className,
|
|
32
|
+
shape = "line",
|
|
33
|
+
width,
|
|
34
|
+
height,
|
|
35
|
+
animated = true,
|
|
36
|
+
style,
|
|
37
|
+
...props
|
|
38
|
+
}, ref) => {
|
|
39
|
+
const defaultHeight = shape === "line" ? "1em" : shape === "circle" ? void 0 : void 0;
|
|
40
|
+
const resolvedWidth = width !== void 0 ? typeof width === "number" ? `${width}px` : width : shape === "circle" ? height !== void 0 ? typeof height === "number" ? `${height}px` : height : "2.5rem" : "100%";
|
|
41
|
+
const resolvedHeight = height !== void 0 ? typeof height === "number" ? `${height}px` : height : shape === "circle" ? resolvedWidth : defaultHeight;
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
"span",
|
|
44
|
+
{
|
|
45
|
+
ref,
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
className: cn(
|
|
48
|
+
skeletonVariants({ shape, animated }),
|
|
49
|
+
"block",
|
|
50
|
+
className
|
|
51
|
+
),
|
|
52
|
+
style: {
|
|
53
|
+
width: resolvedWidth,
|
|
54
|
+
height: resolvedHeight,
|
|
55
|
+
...style
|
|
56
|
+
},
|
|
57
|
+
...props
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
Skeleton.displayName = "Skeleton";
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
skeletonVariants,
|
|
66
|
+
Skeleton
|
|
67
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Spinner/Spinner.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var spinnerVariants = cva(
|
|
11
|
+
[
|
|
12
|
+
"inline-block rounded-full border-2 border-solid",
|
|
13
|
+
"animate-spin",
|
|
14
|
+
// One transparent segment gives the illusion of rotation
|
|
15
|
+
"border-t-transparent"
|
|
16
|
+
],
|
|
17
|
+
{
|
|
18
|
+
variants: {
|
|
19
|
+
size: {
|
|
20
|
+
xs: "h-3 w-3 border-[1.5px]",
|
|
21
|
+
sm: "h-4 w-4 border-2",
|
|
22
|
+
md: "h-6 w-6 border-2",
|
|
23
|
+
lg: "h-8 w-8 border-[3px]",
|
|
24
|
+
xl: "h-10 w-10 border-4"
|
|
25
|
+
},
|
|
26
|
+
tone: {
|
|
27
|
+
neutral: "border-[var(--color-neutral-500)]",
|
|
28
|
+
info: "border-[var(--color-semantic-info-default)]",
|
|
29
|
+
success: "border-[var(--color-semantic-success-default)]",
|
|
30
|
+
warning: "border-[var(--color-semantic-warning-default)]",
|
|
31
|
+
danger: "border-[var(--color-semantic-error-default)]",
|
|
32
|
+
leap: "border-[var(--color-leap-500)]",
|
|
33
|
+
bookub: "border-[var(--color-bookub-500)]",
|
|
34
|
+
payub: "border-[var(--color-payub-500)]",
|
|
35
|
+
founderub: "border-[var(--color-founderub-500)]"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
size: "md",
|
|
40
|
+
tone: "neutral"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
var Spinner = React.forwardRef(
|
|
45
|
+
({ className, size, tone = "neutral", label = "Loading\u2026", ...props }, ref) => {
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
"span",
|
|
48
|
+
{
|
|
49
|
+
ref,
|
|
50
|
+
role: "status",
|
|
51
|
+
"aria-label": label,
|
|
52
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
53
|
+
...props,
|
|
54
|
+
children: /* @__PURE__ */ jsx(
|
|
55
|
+
"span",
|
|
56
|
+
{
|
|
57
|
+
className: cn(spinnerVariants({ size, tone })),
|
|
58
|
+
"aria-hidden": "true"
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
Spinner.displayName = "Spinner";
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
spinnerVariants,
|
|
69
|
+
Spinner
|
|
70
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/ButtonGroup/ButtonGroup.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var ButtonGroup = React.forwardRef(
|
|
10
|
+
({ className, orientation = "horizontal", attached = false, children, ...props }, ref) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
ref,
|
|
15
|
+
role: "group",
|
|
16
|
+
"data-orientation": orientation,
|
|
17
|
+
"data-attached": attached || void 0,
|
|
18
|
+
className: cn(
|
|
19
|
+
"flex",
|
|
20
|
+
orientation === "vertical" ? "flex-col" : "flex-row",
|
|
21
|
+
attached ? [
|
|
22
|
+
"gap-0",
|
|
23
|
+
"[&>*:not(:first-child):not(:last-child)]:rounded-none",
|
|
24
|
+
orientation === "horizontal" ? [
|
|
25
|
+
"[&>*:first-child]:rounded-r-none",
|
|
26
|
+
"[&>*:last-child]:rounded-l-none",
|
|
27
|
+
"[&>*:not(:first-child)]:border-l-0"
|
|
28
|
+
] : [
|
|
29
|
+
"[&>*:first-child]:rounded-b-none",
|
|
30
|
+
"[&>*:last-child]:rounded-t-none",
|
|
31
|
+
"[&>*:not(:first-child)]:border-t-0"
|
|
32
|
+
]
|
|
33
|
+
] : "gap-2",
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
...props,
|
|
37
|
+
children
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
ButtonGroup.displayName = "ButtonGroup";
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
ButtonGroup
|
|
46
|
+
};
|