@nexub/react 1.0.0 → 1.2.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-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-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-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-DGJE5MX5.js +102 -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-EVCTOIRS.js +66 -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-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-QRZV2FLW.js +106 -0
- package/dist/chunk-QURKXXNS.js +46 -0
- package/dist/chunk-RIDDJUPA.js +122 -0
- package/dist/chunk-ROZVVWPV.js +8 -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-VPZCQFVY.js +33 -0
- package/dist/chunk-VT7RKY46.js +49 -0
- package/dist/chunk-W4IEXUD4.js +127 -0
- package/dist/chunk-WCJNZ5ME.js +1593 -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-ZLSUVZM2.js +145 -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 +36 -14
- package/dist/index.js +479 -5896
- package/package.json +13 -13
- package/dist/index.cjs +0 -6112
- package/dist/index.d.cts +0 -1245
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import * as RadixPopover from "@radix-ui/react-popover";
|
|
9
|
+
import { DayPicker } from "react-day-picker";
|
|
10
|
+
import { format } from "date-fns";
|
|
11
|
+
import { CalendarDays, ChevronLeft, ChevronRight } from "@nexub/icons";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
function formatRange(range, placeholder) {
|
|
14
|
+
if (!range) return placeholder;
|
|
15
|
+
if (range.from && range.to) {
|
|
16
|
+
return `${format(range.from, "PP")} \u2013 ${format(range.to, "PP")}`;
|
|
17
|
+
}
|
|
18
|
+
if (range.from) return `${format(range.from, "PP")} \u2013 \u2026`;
|
|
19
|
+
return placeholder;
|
|
20
|
+
}
|
|
21
|
+
var calendarClassNames = {
|
|
22
|
+
months: "flex flex-col sm:flex-row gap-4",
|
|
23
|
+
month: "flex flex-col gap-4",
|
|
24
|
+
month_caption: "flex justify-center pt-1 relative items-center",
|
|
25
|
+
caption_label: "text-sm font-medium",
|
|
26
|
+
nav: "flex items-center gap-1",
|
|
27
|
+
button_previous: "absolute left-1 inline-flex h-7 w-7 items-center justify-center rounded-md border border-[var(--color-border-default)] hover:bg-[var(--color-bg-subtle)] disabled:pointer-events-none disabled:opacity-50",
|
|
28
|
+
button_next: "absolute right-1 inline-flex h-7 w-7 items-center justify-center rounded-md border border-[var(--color-border-default)] hover:bg-[var(--color-bg-subtle)] disabled:pointer-events-none disabled:opacity-50",
|
|
29
|
+
month_grid: "w-full border-collapse",
|
|
30
|
+
weekdays: "flex",
|
|
31
|
+
weekday: "text-[var(--color-text-muted)] rounded-md w-8 font-normal text-[0.8rem] flex-1 text-center",
|
|
32
|
+
week: "flex w-full mt-2",
|
|
33
|
+
day: "relative p-0 text-center text-sm flex-1 focus-within:relative focus-within:z-20",
|
|
34
|
+
day_button: "inline-flex h-8 w-8 items-center justify-center rounded-md text-sm hover:bg-[var(--color-bg-subtle)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)]",
|
|
35
|
+
selected: "bg-[var(--color-fill-primary)] text-white hover:bg-[var(--color-fill-primary-hover)]",
|
|
36
|
+
range_start: "rounded-l-md",
|
|
37
|
+
range_end: "rounded-r-md",
|
|
38
|
+
range_middle: "aria-selected:bg-[var(--color-bg-subtle)] aria-selected:text-[var(--color-text-primary)] rounded-none",
|
|
39
|
+
today: "bg-[var(--color-bg-subtle)]",
|
|
40
|
+
outside: "opacity-50",
|
|
41
|
+
disabled: "opacity-50",
|
|
42
|
+
hidden: "invisible"
|
|
43
|
+
};
|
|
44
|
+
var DateRangePicker = React.forwardRef(function DateRangePicker2({
|
|
45
|
+
value,
|
|
46
|
+
onChange,
|
|
47
|
+
placeholder = "Pick a date range",
|
|
48
|
+
disabled = false,
|
|
49
|
+
minDate,
|
|
50
|
+
maxDate,
|
|
51
|
+
className,
|
|
52
|
+
id,
|
|
53
|
+
"aria-label": ariaLabel
|
|
54
|
+
}, ref) {
|
|
55
|
+
const [open, setOpen] = React.useState(false);
|
|
56
|
+
const display = formatRange(value, placeholder);
|
|
57
|
+
const label = ariaLabel ? `${ariaLabel}: ${display}` : display;
|
|
58
|
+
return /* @__PURE__ */ jsxs(RadixPopover.Root, { open, onOpenChange: setOpen, children: [
|
|
59
|
+
/* @__PURE__ */ jsx(RadixPopover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
ref,
|
|
63
|
+
id,
|
|
64
|
+
disabled,
|
|
65
|
+
"aria-label": label,
|
|
66
|
+
className: cn(
|
|
67
|
+
"inline-flex h-9 w-full items-center justify-start gap-2 rounded-md border border-[var(--color-border-input)] bg-[var(--color-bg-default)] px-3 py-2 text-sm",
|
|
68
|
+
"hover:bg-[var(--color-bg-subtle)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)]",
|
|
69
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
70
|
+
!value && "text-[var(--color-text-muted)]",
|
|
71
|
+
className
|
|
72
|
+
),
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsx(CalendarDays, { size: "sm", "aria-hidden": "true" }),
|
|
75
|
+
display
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
) }),
|
|
79
|
+
/* @__PURE__ */ jsx(RadixPopover.Portal, { children: /* @__PURE__ */ jsx(
|
|
80
|
+
RadixPopover.Content,
|
|
81
|
+
{
|
|
82
|
+
align: "start",
|
|
83
|
+
className: cn(
|
|
84
|
+
"z-[var(--z-popover)] rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-default)] shadow-md",
|
|
85
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
86
|
+
"data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
87
|
+
"data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
88
|
+
),
|
|
89
|
+
children: /* @__PURE__ */ jsx(
|
|
90
|
+
DayPicker,
|
|
91
|
+
{
|
|
92
|
+
mode: "range",
|
|
93
|
+
selected: value,
|
|
94
|
+
onSelect: onChange,
|
|
95
|
+
numberOfMonths: 2,
|
|
96
|
+
startMonth: minDate,
|
|
97
|
+
endMonth: maxDate,
|
|
98
|
+
initialFocus: true,
|
|
99
|
+
showOutsideDays: true,
|
|
100
|
+
className: "p-3",
|
|
101
|
+
classNames: calendarClassNames,
|
|
102
|
+
components: {
|
|
103
|
+
Chevron: ({ orientation, ...rest }) => orientation === "left" ? /* @__PURE__ */ jsx(ChevronLeft, { size: "xs", "aria-hidden": "true" }) : orientation === "right" ? /* @__PURE__ */ jsx(ChevronRight, { size: "xs", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronRight, { size: "xs", "aria-hidden": "true", ...rest })
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
) })
|
|
109
|
+
] });
|
|
110
|
+
});
|
|
111
|
+
DateRangePicker.displayName = "DateRangePicker";
|
|
112
|
+
|
|
113
|
+
export {
|
|
114
|
+
DateRangePicker
|
|
115
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Link/Link.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
9
|
+
import { ExternalLink } from "@nexub/icons";
|
|
10
|
+
import { cva } from "class-variance-authority";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var linkVariants = cva(
|
|
13
|
+
[
|
|
14
|
+
"inline-flex items-center gap-1 transition-colors",
|
|
15
|
+
"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)] rounded-sm"
|
|
16
|
+
],
|
|
17
|
+
{
|
|
18
|
+
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
default: "text-[var(--color-brand-primary-500)] hover:text-[var(--color-brand-primary-600)]",
|
|
21
|
+
muted: "text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)]",
|
|
22
|
+
underlined: "text-[var(--color-brand-primary-500)] underline underline-offset-4 hover:text-[var(--color-brand-primary-600)]"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
variant: "default"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
var Link = React.forwardRef(
|
|
31
|
+
({ variant, external = false, asChild, className, children, target, rel, ...rest }, ref) => {
|
|
32
|
+
const resolvedTarget = external ? "_blank" : target;
|
|
33
|
+
const resolvedRel = resolvedTarget === "_blank" ? [.../* @__PURE__ */ new Set([...rel?.split(/\s+/).filter(Boolean) ?? [], "noopener", "noreferrer"])].join(" ") : rel;
|
|
34
|
+
const Comp = asChild ? Slot : "a";
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
Comp,
|
|
37
|
+
{
|
|
38
|
+
ref,
|
|
39
|
+
className: cn(linkVariants({ variant }), className),
|
|
40
|
+
...rest,
|
|
41
|
+
target: resolvedTarget,
|
|
42
|
+
rel: resolvedRel,
|
|
43
|
+
children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
|
+
children,
|
|
45
|
+
external && /* @__PURE__ */ jsx(ExternalLink, { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" })
|
|
46
|
+
] })
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
Link.displayName = "Link";
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
linkVariants,
|
|
55
|
+
Link
|
|
56
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Toggle/Toggle.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import * as RadixToggle from "@radix-ui/react-toggle";
|
|
9
|
+
import { cva } from "class-variance-authority";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var toggleVariants = cva(
|
|
12
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium 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 data-[state=on]:bg-[var(--color-bg-subtle)] data-[state=on]:text-[var(--color-text-primary)]",
|
|
13
|
+
{
|
|
14
|
+
variants: {
|
|
15
|
+
variant: {
|
|
16
|
+
default: "bg-transparent hover:bg-[var(--color-bg-subtle)] hover:text-[var(--color-text-primary)]",
|
|
17
|
+
outline: "border border-[var(--color-border-default)] bg-transparent hover:bg-[var(--color-bg-subtle)]"
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
sm: "h-8 px-2.5",
|
|
21
|
+
md: "h-9 px-3",
|
|
22
|
+
lg: "h-10 px-4"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: { variant: "default", size: "md" }
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
var Toggle = React.forwardRef(
|
|
29
|
+
({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
30
|
+
RadixToggle.Root,
|
|
31
|
+
{
|
|
32
|
+
ref,
|
|
33
|
+
className: cn(toggleVariants({ variant, size }), className),
|
|
34
|
+
...props
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
);
|
|
38
|
+
Toggle.displayName = "Toggle";
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
toggleVariants,
|
|
42
|
+
Toggle
|
|
43
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
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/Popover/Popover.tsx
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import * as RadixPopover from "@radix-ui/react-popover";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
var Root2 = RadixPopover.Root;
|
|
14
|
+
var Trigger2 = RadixPopover.Trigger;
|
|
15
|
+
var Portal2 = RadixPopover.Portal;
|
|
16
|
+
var Close2 = RadixPopover.Close;
|
|
17
|
+
var Content2 = React.forwardRef(
|
|
18
|
+
function PopoverContent({ className, sideOffset = 4, surface = "solid", ...props }, ref) {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
RadixPopover.Content,
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
sideOffset,
|
|
24
|
+
className: cn(
|
|
25
|
+
"z-[var(--z-popover)] rounded-lg border border-[var(--color-border-default)]",
|
|
26
|
+
"bg-[var(--color-bg-default)] p-4 shadow-md",
|
|
27
|
+
"outline-none",
|
|
28
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
29
|
+
"data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",
|
|
30
|
+
"data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95",
|
|
31
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
32
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
33
|
+
surface === "glass" && glassSurfaceClass,
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
37
|
+
...props
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
Content2.displayName = "Popover.Content";
|
|
43
|
+
var Arrow2 = React.forwardRef(
|
|
44
|
+
function PopoverArrow({ className, ...props }, ref) {
|
|
45
|
+
return /* @__PURE__ */ jsx(
|
|
46
|
+
RadixPopover.Arrow,
|
|
47
|
+
{
|
|
48
|
+
ref,
|
|
49
|
+
className: cn("fill-[var(--color-border-default)]", className),
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
Arrow2.displayName = "Popover.Arrow";
|
|
56
|
+
var Popover = {
|
|
57
|
+
Root: Root2,
|
|
58
|
+
Trigger: Trigger2,
|
|
59
|
+
Portal: Portal2,
|
|
60
|
+
Content: Content2,
|
|
61
|
+
Arrow: Arrow2,
|
|
62
|
+
Close: Close2
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
Popover
|
|
67
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
useIsomorphicLayoutEffect
|
|
4
|
+
} from "./chunk-NHUQLIHL.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-AT6RPKU3.js";
|
|
8
|
+
|
|
9
|
+
// src/components/Rating/Rating.tsx
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { cva } from "class-variance-authority";
|
|
12
|
+
|
|
13
|
+
// src/hooks/useControllableState.ts
|
|
14
|
+
import { useState, useCallback, useRef } from "react";
|
|
15
|
+
function useControllableState({
|
|
16
|
+
value: controlledValue,
|
|
17
|
+
defaultValue,
|
|
18
|
+
onChange
|
|
19
|
+
}) {
|
|
20
|
+
const [uncontrolled, setUncontrolled] = useState(defaultValue);
|
|
21
|
+
const isControlled = controlledValue !== void 0;
|
|
22
|
+
const value = isControlled ? controlledValue : uncontrolled;
|
|
23
|
+
const onChangeRef = useRef(onChange);
|
|
24
|
+
useIsomorphicLayoutEffect(() => {
|
|
25
|
+
onChangeRef.current = onChange;
|
|
26
|
+
});
|
|
27
|
+
const setValue = useCallback(
|
|
28
|
+
(next) => {
|
|
29
|
+
if (!isControlled) setUncontrolled(next);
|
|
30
|
+
onChangeRef.current?.(next);
|
|
31
|
+
},
|
|
32
|
+
[isControlled]
|
|
33
|
+
);
|
|
34
|
+
return [value, setValue];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// src/components/Rating/Rating.tsx
|
|
38
|
+
import { jsx } from "react/jsx-runtime";
|
|
39
|
+
var ratingVariants = cva("inline-flex items-center gap-0.5", {
|
|
40
|
+
variants: {
|
|
41
|
+
size: {
|
|
42
|
+
sm: "[&_svg]:h-4 [&_svg]:w-4",
|
|
43
|
+
md: "[&_svg]:h-5 [&_svg]:w-5",
|
|
44
|
+
lg: "[&_svg]:h-7 [&_svg]:w-7"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
size: "md"
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
var Rating = React.forwardRef(
|
|
52
|
+
({
|
|
53
|
+
className,
|
|
54
|
+
size,
|
|
55
|
+
value: controlledValue,
|
|
56
|
+
max = 5,
|
|
57
|
+
readOnly = false,
|
|
58
|
+
onValueChange,
|
|
59
|
+
...props
|
|
60
|
+
}, ref) => {
|
|
61
|
+
const [value, setValue] = useControllableState({
|
|
62
|
+
value: controlledValue,
|
|
63
|
+
defaultValue: 0,
|
|
64
|
+
onChange: onValueChange
|
|
65
|
+
});
|
|
66
|
+
const [hovered, setHovered] = React.useState(null);
|
|
67
|
+
const displayValue = hovered ?? value ?? 0;
|
|
68
|
+
const starRefs = React.useRef([]);
|
|
69
|
+
const tabStop = value && value > 0 ? value : 1;
|
|
70
|
+
const handleKeyDown = (e, starValue) => {
|
|
71
|
+
const next = e.key === "ArrowRight" || e.key === "ArrowUp" ? Math.min(max, starValue + 1) : e.key === "ArrowLeft" || e.key === "ArrowDown" ? Math.max(1, starValue - 1) : e.key === "Home" ? 1 : e.key === "End" ? max : null;
|
|
72
|
+
if (next === null) return;
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
setValue(next);
|
|
75
|
+
starRefs.current[next - 1]?.focus();
|
|
76
|
+
};
|
|
77
|
+
return /* @__PURE__ */ jsx(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
ref,
|
|
81
|
+
className: cn(ratingVariants({ size }), className),
|
|
82
|
+
role: "radiogroup",
|
|
83
|
+
"aria-label": "Rating",
|
|
84
|
+
"aria-readonly": readOnly || void 0,
|
|
85
|
+
...props,
|
|
86
|
+
children: Array.from({ length: max }, (_, i) => {
|
|
87
|
+
const starValue = i + 1;
|
|
88
|
+
const filled = starValue <= displayValue;
|
|
89
|
+
return /* @__PURE__ */ jsx(
|
|
90
|
+
"button",
|
|
91
|
+
{
|
|
92
|
+
ref: (el) => {
|
|
93
|
+
starRefs.current[i] = el;
|
|
94
|
+
},
|
|
95
|
+
type: "button",
|
|
96
|
+
role: "radio",
|
|
97
|
+
tabIndex: starValue === tabStop ? 0 : -1,
|
|
98
|
+
"aria-checked": starValue === (value ?? 0),
|
|
99
|
+
"aria-label": `${starValue} star${starValue !== 1 ? "s" : ""}`,
|
|
100
|
+
disabled: readOnly,
|
|
101
|
+
onClick: () => !readOnly && setValue(starValue),
|
|
102
|
+
onKeyDown: (e) => !readOnly && handleKeyDown(e, starValue),
|
|
103
|
+
onMouseEnter: () => !readOnly && setHovered(starValue),
|
|
104
|
+
onMouseLeave: () => !readOnly && setHovered(null),
|
|
105
|
+
className: cn(
|
|
106
|
+
"bg-transparent border-0 p-0 m-0 inline-flex items-center justify-center transition-transform",
|
|
107
|
+
!readOnly && "cursor-pointer hover:scale-110",
|
|
108
|
+
readOnly && "cursor-default",
|
|
109
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)] focus-visible:ring-offset-1 rounded-sm",
|
|
110
|
+
"disabled:pointer-events-none"
|
|
111
|
+
),
|
|
112
|
+
children: /* @__PURE__ */ jsx(
|
|
113
|
+
StarIcon,
|
|
114
|
+
{
|
|
115
|
+
filled,
|
|
116
|
+
"aria-hidden": "true"
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
},
|
|
120
|
+
starValue
|
|
121
|
+
);
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
Rating.displayName = "Rating";
|
|
128
|
+
function StarIcon({ filled, ...props }) {
|
|
129
|
+
return /* @__PURE__ */ jsx(
|
|
130
|
+
"svg",
|
|
131
|
+
{
|
|
132
|
+
viewBox: "0 0 20 20",
|
|
133
|
+
fill: filled ? "var(--color-founderub-500, #f59e0b)" : "none",
|
|
134
|
+
stroke: filled ? "var(--color-founderub-500, #f59e0b)" : "var(--color-border-default)",
|
|
135
|
+
strokeWidth: "1.5",
|
|
136
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
137
|
+
...props,
|
|
138
|
+
children: /* @__PURE__ */ jsx(
|
|
139
|
+
"path",
|
|
140
|
+
{
|
|
141
|
+
strokeLinejoin: "round",
|
|
142
|
+
d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export {
|
|
150
|
+
useControllableState,
|
|
151
|
+
ratingVariants,
|
|
152
|
+
Rating
|
|
153
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Text/Text.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
9
|
+
import { cva } from "class-variance-authority";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var textVariants = cva("", {
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
"body-lg": "text-lg leading-relaxed",
|
|
15
|
+
body: "text-base leading-relaxed",
|
|
16
|
+
"body-sm": "text-sm leading-relaxed",
|
|
17
|
+
caption: "text-xs leading-normal",
|
|
18
|
+
label: "text-sm leading-none font-medium"
|
|
19
|
+
},
|
|
20
|
+
tone: {
|
|
21
|
+
default: "text-[var(--color-text-primary)]",
|
|
22
|
+
secondary: "text-[var(--color-text-secondary)]",
|
|
23
|
+
muted: "text-[var(--color-text-muted)]",
|
|
24
|
+
subtle: "text-[var(--color-text-subtle)]",
|
|
25
|
+
inverse: "text-[var(--color-text-inverse)]"
|
|
26
|
+
},
|
|
27
|
+
weight: {
|
|
28
|
+
regular: "font-normal",
|
|
29
|
+
medium: "font-medium",
|
|
30
|
+
semibold: "font-semibold",
|
|
31
|
+
bold: "font-bold"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
size: "body",
|
|
36
|
+
tone: "default"
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
var Text = React.forwardRef(
|
|
40
|
+
({
|
|
41
|
+
size,
|
|
42
|
+
tone,
|
|
43
|
+
weight,
|
|
44
|
+
asChild = false,
|
|
45
|
+
truncate = false,
|
|
46
|
+
lineClamp,
|
|
47
|
+
className,
|
|
48
|
+
style,
|
|
49
|
+
children,
|
|
50
|
+
...rest
|
|
51
|
+
}, ref) => {
|
|
52
|
+
const Comp = asChild ? Slot : "p";
|
|
53
|
+
const clampStyle = lineClamp !== void 0 ? {
|
|
54
|
+
display: "-webkit-box",
|
|
55
|
+
WebkitLineClamp: lineClamp,
|
|
56
|
+
WebkitBoxOrient: "vertical",
|
|
57
|
+
overflow: "hidden"
|
|
58
|
+
} : {};
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
Comp,
|
|
61
|
+
{
|
|
62
|
+
ref,
|
|
63
|
+
className: cn(
|
|
64
|
+
textVariants({ size, tone, weight }),
|
|
65
|
+
truncate && "truncate",
|
|
66
|
+
className
|
|
67
|
+
),
|
|
68
|
+
style: { ...clampStyle, ...style },
|
|
69
|
+
...rest,
|
|
70
|
+
children
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
Text.displayName = "Text";
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
textVariants,
|
|
79
|
+
Text
|
|
80
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Flex/Flex.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var directionClass = {
|
|
11
|
+
row: "flex-row",
|
|
12
|
+
column: "flex-col",
|
|
13
|
+
"row-reverse": "flex-row-reverse",
|
|
14
|
+
"column-reverse": "flex-col-reverse"
|
|
15
|
+
};
|
|
16
|
+
var Flex = React.forwardRef(
|
|
17
|
+
({
|
|
18
|
+
gap,
|
|
19
|
+
align,
|
|
20
|
+
justify,
|
|
21
|
+
wrap = false,
|
|
22
|
+
direction = "row",
|
|
23
|
+
asChild = false,
|
|
24
|
+
className,
|
|
25
|
+
style,
|
|
26
|
+
children,
|
|
27
|
+
...rest
|
|
28
|
+
}, ref) => {
|
|
29
|
+
const Comp = asChild ? Slot : "div";
|
|
30
|
+
const inlineStyle = {
|
|
31
|
+
...gap !== void 0 ? { gap: typeof gap === "number" ? `${gap * 0.25}rem` : gap } : {},
|
|
32
|
+
...align ? { alignItems: align } : {},
|
|
33
|
+
...justify ? { justifyContent: justify } : {},
|
|
34
|
+
...style
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
Comp,
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
className: cn("flex", directionClass[direction], wrap && "flex-wrap", className),
|
|
41
|
+
style: inlineStyle,
|
|
42
|
+
...rest,
|
|
43
|
+
children
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
Flex.displayName = "Flex";
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
Flex
|
|
52
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Checkbox/Checkbox.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import * as RadixCheckbox from "@radix-ui/react-checkbox";
|
|
9
|
+
import { Check, Minus } from "@nexub/icons";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var Checkbox = React.forwardRef(
|
|
12
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
13
|
+
RadixCheckbox.Root,
|
|
14
|
+
{
|
|
15
|
+
ref,
|
|
16
|
+
className: cn(
|
|
17
|
+
"peer h-4 w-4 shrink-0 rounded-sm border border-[var(--color-border-input)]",
|
|
18
|
+
"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)]",
|
|
19
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
20
|
+
"data-[state=checked]:bg-[var(--color-fill-primary)] data-[state=checked]:border-[var(--color-fill-primary)] data-[state=checked]:text-white",
|
|
21
|
+
"data-[state=indeterminate]:bg-[var(--color-fill-primary)] data-[state=indeterminate]:border-[var(--color-fill-primary)] data-[state=indeterminate]:text-white",
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
...props,
|
|
25
|
+
children: /* @__PURE__ */ jsx(RadixCheckbox.Indicator, { className: "flex items-center justify-center", children: props.checked === "indeterminate" ? /* @__PURE__ */ jsx(Minus, { size: "xs" }) : /* @__PURE__ */ jsx(Check, { size: "xs" }) })
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
Checkbox.displayName = "Checkbox";
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
Checkbox
|
|
33
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
Combobox
|
|
4
|
+
} from "./chunk-2VDP2ML4.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Autocomplete/Autocomplete.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function Autocomplete({
|
|
10
|
+
options,
|
|
11
|
+
value,
|
|
12
|
+
onValueChange,
|
|
13
|
+
placeholder = "Search\u2026",
|
|
14
|
+
emptyText = "No results found.",
|
|
15
|
+
loading = false,
|
|
16
|
+
className
|
|
17
|
+
}) {
|
|
18
|
+
const selectedLabel = options.find((o) => o.value === value)?.label ?? "";
|
|
19
|
+
const [search, setSearch] = React.useState(selectedLabel);
|
|
20
|
+
const [prevValue, setPrevValue] = React.useState(value);
|
|
21
|
+
if (value !== prevValue) {
|
|
22
|
+
setPrevValue(value);
|
|
23
|
+
setSearch(selectedLabel);
|
|
24
|
+
}
|
|
25
|
+
return /* @__PURE__ */ jsxs(Combobox.Root, { className, children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Combobox.Input, { placeholder, value: search, onValueChange: setSearch }),
|
|
27
|
+
/* @__PURE__ */ jsx(Combobox.List, { children: loading ? /* @__PURE__ */ jsx("div", { className: "py-6 text-center text-sm text-[var(--color-text-muted)]", children: "Loading\u2026" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx(Combobox.Empty, { children: emptyText }),
|
|
29
|
+
options.map((opt) => /* @__PURE__ */ jsx(
|
|
30
|
+
Combobox.Item,
|
|
31
|
+
{
|
|
32
|
+
value: opt.label,
|
|
33
|
+
keywords: [opt.value],
|
|
34
|
+
onSelect: () => {
|
|
35
|
+
onValueChange?.(opt.value);
|
|
36
|
+
setSearch(opt.label);
|
|
37
|
+
},
|
|
38
|
+
children: opt.label
|
|
39
|
+
},
|
|
40
|
+
opt.value
|
|
41
|
+
))
|
|
42
|
+
] }) })
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
Autocomplete.displayName = "Autocomplete";
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
Autocomplete
|
|
49
|
+
};
|