@schandlergarcia/sf-web-components 1.0.11 → 1.0.13
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/components/library/index.d.ts +16 -16
- package/dist/components/library/ui/badge.js +23 -4
- package/dist/components/library/ui/badge.js.map +1 -1
- package/dist/components/library/ui/datePicker.js +88 -7
- package/dist/components/library/ui/datePicker.js.map +1 -1
- package/dist/components/library/ui/field.js +177 -20
- package/dist/components/library/ui/field.js.map +1 -1
- package/dist/components/library/ui/pagination.js +52 -39
- package/dist/components/library/ui/pagination.js.map +1 -1
- package/dist/components/library/ui/select.js +67 -61
- package/dist/components/library/ui/select.js.map +1 -1
- package/dist/components/library/ui/separator.js +27 -0
- package/dist/components/library/ui/separator.js.map +1 -0
- package/dist/components/library/ui/shadcn-exports.d.ts +2 -2
- package/dist/components/library/ui/skeleton.js +16 -0
- package/dist/components/library/ui/skeleton.js.map +1 -0
- package/dist/components/library/ui/sonner.js +4 -2
- package/dist/components/library/ui/sonner.js.map +1 -1
- package/dist/components/library/ui/tabs.js +33 -14
- package/dist/components/library/ui/tabs.js.map +1 -1
- package/dist/index.js +250 -246
- package/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +527 -436
- package/dist/node_modules/@radix-ui/react-select/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-separator/dist/index.js +25 -0
- package/dist/node_modules/@radix-ui/react-separator/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-primitive/dist/index.js +33 -0
- package/dist/node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +31 -30
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +4 -4
- package/dist/node_modules/sonner/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -29,7 +29,23 @@ export { default as HeroUIButton } from "./heroui/Button";
|
|
|
29
29
|
export { default as HeroUIInput } from "./heroui/Input";
|
|
30
30
|
export { default as HeroUICard } from "./heroui/Card";
|
|
31
31
|
export { default as HeroUIToggle } from "./heroui/Toggle";
|
|
32
|
+
export { default as HeroUITabs } from "./heroui/Tabs";
|
|
33
|
+
export { default as HeroUIAccordion } from "./heroui/Accordion";
|
|
34
|
+
export { default as HeroUIBreadcrumbs } from "./heroui/Breadcrumbs";
|
|
35
|
+
export { default as HeroUISeparator } from "./heroui/Separator";
|
|
36
|
+
export { default as HeroUIPagination } from "./heroui/Pagination";
|
|
37
|
+
export { default as HeroUIDrawer } from "./heroui/Drawer";
|
|
38
|
+
export { default as HeroUIModal } from "./heroui/Modal";
|
|
39
|
+
export { default as HeroUIDropdown } from "./heroui/Dropdown";
|
|
40
|
+
export { default as HeroUITooltip } from "./heroui/Tooltip";
|
|
41
|
+
export { default as HeroUIToast } from "./heroui/Toast";
|
|
32
42
|
export { default as HeroUIAlert } from "./heroui/Alert";
|
|
43
|
+
export { default as HeroUIBadge } from "./heroui/Badge";
|
|
44
|
+
export { default as HeroUIProgressBar } from "./heroui/ProgressBar";
|
|
45
|
+
export { default as HeroUIProgressCircle } from "./heroui/ProgressCircle";
|
|
46
|
+
export { default as HeroUIMeter } from "./heroui/Meter";
|
|
47
|
+
export { default as HeroUISkeleton } from "./heroui/Skeleton";
|
|
48
|
+
export { default as HeroUISelect } from "./heroui/Select";
|
|
33
49
|
export { default as AppThemeProvider, useThemeMode } from "./theme/AppThemeProvider";
|
|
34
50
|
export { Button as UIButton, Input as UIInput, Card as UICard, Spinner } from "./ui/shadcn-exports";
|
|
35
51
|
export { FormModal, FormRenderer, FormSection, FormField, useFormState } from "./forms";
|
|
@@ -37,21 +53,5 @@ export { FilterBar, SearchFilter, SelectFilter, ToggleFilter } from "./filters";
|
|
|
37
53
|
export { default as DataModeProvider, useDataMode } from "./data/DataModeProvider";
|
|
38
54
|
export { filterBySearch, filterByValue, filterByToggle, filterByDateRange, sortByKey, applyFilters } from "./data/filterUtils";
|
|
39
55
|
export { ChatPanel, ChatBar, ChatMessageList, ChatMessage, ChatInput, ChatTypingIndicator, ChatSuggestions, ChatToolCall, ChatWelcome, useChatState } from "./chat";
|
|
40
|
-
export { default as HeroUITabs, Tabs } from "./heroui/Tabs";
|
|
41
|
-
export { default as HeroUIAccordion, Accordion } from "./heroui/Accordion";
|
|
42
|
-
export { default as HeroUIBreadcrumbs, Breadcrumbs } from "./heroui/Breadcrumbs";
|
|
43
|
-
export { default as HeroUISeparator, Separator } from "./heroui/Separator";
|
|
44
|
-
export { default as HeroUIPagination, Pagination } from "./heroui/Pagination";
|
|
45
|
-
export { default as HeroUIDrawer, Drawer } from "./heroui/Drawer";
|
|
46
|
-
export { default as HeroUIModal, Modal } from "./heroui/Modal";
|
|
47
|
-
export { default as HeroUIDropdown, Dropdown } from "./heroui/Dropdown";
|
|
48
|
-
export { default as HeroUITooltip, Tooltip } from "./heroui/Tooltip";
|
|
49
|
-
export { default as HeroUIToast, Toast, toast } from "./heroui/Toast";
|
|
50
|
-
export { default as HeroUIBadge, Badge } from "./heroui/Badge";
|
|
51
|
-
export { default as HeroUIProgressBar, ProgressBar } from "./heroui/ProgressBar";
|
|
52
|
-
export { default as HeroUIProgressCircle, ProgressCircle } from "./heroui/ProgressCircle";
|
|
53
|
-
export { default as HeroUIMeter, Meter } from "./heroui/Meter";
|
|
54
|
-
export { default as HeroUISkeleton, Skeleton } from "./heroui/Skeleton";
|
|
55
|
-
export { default as HeroUISelect, Select } from "./heroui/Select";
|
|
56
56
|
export { default as HeroUIKbd, Kbd } from "./heroui/Kbd";
|
|
57
57
|
export { default as HeroUIScrollShadow, ScrollShadow } from "./heroui/ScrollShadow";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import { cva as
|
|
3
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { cva as o } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
3
|
+
import { cn as n } from "../../../lib/utils.js";
|
|
4
|
+
import { Root as s } from "../../../node_modules/radix-ui/node_modules/@radix-ui/react-slot/dist/index.js";
|
|
5
|
+
const d = o(
|
|
4
6
|
"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
5
7
|
{
|
|
6
8
|
variants: {
|
|
@@ -18,7 +20,24 @@ const i = e(
|
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
);
|
|
23
|
+
function l({
|
|
24
|
+
className: r,
|
|
25
|
+
variant: e = "default",
|
|
26
|
+
asChild: t = !1,
|
|
27
|
+
...i
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ a(
|
|
30
|
+
t ? s : "span",
|
|
31
|
+
{
|
|
32
|
+
"data-slot": "badge",
|
|
33
|
+
"data-variant": e,
|
|
34
|
+
className: n(d({ variant: e }), r),
|
|
35
|
+
...i
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
21
39
|
export {
|
|
22
|
-
|
|
40
|
+
l as Badge,
|
|
41
|
+
d as badgeVariants
|
|
23
42
|
};
|
|
24
43
|
//# sourceMappingURL=badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sources":["../../../../src/components/library/ui/badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\n\nimport { cn } from '../../../lib/utils';\n\nconst badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground [a&]:hover:bg-primary/90',\n secondary:\n 'bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',\n destructive:\n 'bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90',\n outline:\n 'border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',\n ghost: '[a&]:hover:bg-accent [a&]:hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 [a&]:hover:underline',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\nfunction Badge({\n className,\n variant = 'default',\n asChild = false,\n ...props\n}: React.ComponentProps<'span'> &\n VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot.Root : 'span';\n\n return (\n <Comp\n data-slot=\"badge\"\n data-variant={variant}\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nexport { Badge, badgeVariants };\n"],"names":["badgeVariants","cva"],"mappings":"
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../../../src/components/library/ui/badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\n\nimport { cn } from '../../../lib/utils';\n\nconst badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground [a&]:hover:bg-primary/90',\n secondary:\n 'bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',\n destructive:\n 'bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90',\n outline:\n 'border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',\n ghost: '[a&]:hover:bg-accent [a&]:hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 [a&]:hover:underline',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\nfunction Badge({\n className,\n variant = 'default',\n asChild = false,\n ...props\n}: React.ComponentProps<'span'> &\n VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot.Root : 'span';\n\n return (\n <Comp\n data-slot=\"badge\"\n data-variant={variant}\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nexport { Badge, badgeVariants };\n"],"names":["badgeVariants","cva","Badge","className","variant","asChild","props","jsx","Slot.Root","cn"],"mappings":";;;;AAMA,MAAMA,IAAgBC;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,WACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AAEA,SAASC,EAAM;AAAA,EACb,WAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,SAAAC,IAAU;AAAA,EACV,GAAGC;AACL,GAC8D;AAG5D,SACE,gBAAAC;AAAA,IAHWF,IAAUG,IAAY;AAAA,IAGhC;AAAA,MACC,aAAU;AAAA,MACV,gBAAcJ;AAAA,MACd,WAAWK,EAAGT,EAAc,EAAE,SAAAI,EAAA,CAAS,GAAGD,CAAS;AAAA,MAClD,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -1,11 +1,92 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "lucide-react";
|
|
3
|
-
import "
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as t, jsxs as l, Fragment as d } from "react/jsx-runtime";
|
|
2
|
+
import { Calendar as f } from "lucide-react";
|
|
3
|
+
import { cn as m } from "../../../lib/utils.js";
|
|
4
|
+
import { Button as s } from "./button.js";
|
|
5
|
+
import { Calendar as P } from "./calendar.js";
|
|
6
|
+
import { Popover as h, PopoverContent as k, PopoverTrigger as u } from "./popover.js";
|
|
7
|
+
import { format as n } from "../../../node_modules/date-fns/format.js";
|
|
8
|
+
function L({ ...e }) {
|
|
9
|
+
return /* @__PURE__ */ t(h, { "data-slot": "date-picker", ...e });
|
|
10
|
+
}
|
|
11
|
+
function N({
|
|
12
|
+
className: e,
|
|
13
|
+
children: a,
|
|
14
|
+
date: r,
|
|
15
|
+
placeholder: i = "Pick a date",
|
|
16
|
+
dateFormat: o = "PPP",
|
|
17
|
+
...c
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ t(u, { asChild: !0, children: /* @__PURE__ */ t(
|
|
20
|
+
s,
|
|
21
|
+
{
|
|
22
|
+
variant: "outline",
|
|
23
|
+
"data-slot": "date-picker-trigger",
|
|
24
|
+
"data-empty": !r,
|
|
25
|
+
className: m(
|
|
26
|
+
"w-[280px] justify-start text-left font-normal data-[empty=true]:text-muted-foreground",
|
|
27
|
+
e
|
|
28
|
+
),
|
|
29
|
+
...c,
|
|
30
|
+
children: a ?? /* @__PURE__ */ l(d, { children: [
|
|
31
|
+
/* @__PURE__ */ t(f, {}),
|
|
32
|
+
r ? n(r, o) : /* @__PURE__ */ t("span", { children: i })
|
|
33
|
+
] })
|
|
34
|
+
}
|
|
35
|
+
) });
|
|
36
|
+
}
|
|
37
|
+
function T({
|
|
38
|
+
className: e,
|
|
39
|
+
...a
|
|
40
|
+
}) {
|
|
41
|
+
return /* @__PURE__ */ t(
|
|
42
|
+
k,
|
|
43
|
+
{
|
|
44
|
+
"data-slot": "date-picker-content",
|
|
45
|
+
className: m("w-auto p-0", e),
|
|
46
|
+
...a
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
function w({
|
|
51
|
+
className: e,
|
|
52
|
+
children: a,
|
|
53
|
+
dateRange: r,
|
|
54
|
+
placeholder: i = "Pick a date",
|
|
55
|
+
dateFormat: o = "LLL dd, y",
|
|
56
|
+
...c
|
|
57
|
+
}) {
|
|
58
|
+
const p = r?.from != null;
|
|
59
|
+
return /* @__PURE__ */ t(u, { asChild: !0, children: /* @__PURE__ */ t(
|
|
60
|
+
s,
|
|
61
|
+
{
|
|
62
|
+
variant: "outline",
|
|
63
|
+
"data-slot": "date-picker-range-trigger",
|
|
64
|
+
"data-empty": !p,
|
|
65
|
+
className: m(
|
|
66
|
+
"justify-start text-left font-normal data-[empty=true]:text-muted-foreground",
|
|
67
|
+
e
|
|
68
|
+
),
|
|
69
|
+
...c,
|
|
70
|
+
children: a ?? /* @__PURE__ */ l(d, { children: [
|
|
71
|
+
/* @__PURE__ */ t(f, {}),
|
|
72
|
+
r?.from ? r.to ? /* @__PURE__ */ l(d, { children: [
|
|
73
|
+
n(r.from, o),
|
|
74
|
+
" –",
|
|
75
|
+
" ",
|
|
76
|
+
n(r.to, o)
|
|
77
|
+
] }) : n(r.from, o) : /* @__PURE__ */ t("span", { children: i })
|
|
78
|
+
] })
|
|
79
|
+
}
|
|
80
|
+
) });
|
|
81
|
+
}
|
|
82
|
+
function B(e) {
|
|
83
|
+
return /* @__PURE__ */ t(P, { "data-slot": "date-picker-calendar", ...e });
|
|
7
84
|
}
|
|
8
85
|
export {
|
|
9
|
-
|
|
86
|
+
L as DatePicker,
|
|
87
|
+
B as DatePickerCalendar,
|
|
88
|
+
T as DatePickerContent,
|
|
89
|
+
w as DatePickerRangeTrigger,
|
|
90
|
+
N as DatePickerTrigger
|
|
10
91
|
};
|
|
11
92
|
//# sourceMappingURL=datePicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datePicker.js","sources":["../../../../src/components/library/ui/datePicker.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { format } from 'date-fns';\nimport { Calendar as CalendarIcon } from 'lucide-react';\n\nimport type { DateRange, DayPickerProps } from 'react-day-picker';\n\nimport { cn } from '../../../lib/utils';\nimport { Button } from './button';\nimport { Calendar } from './calendar';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from './popover';\n\nfunction DatePicker({ ...props }: React.ComponentProps<typeof Popover>) {\n return <Popover data-slot=\"date-picker\" {...props} />;\n}\n\nfunction DatePickerTrigger({\n className,\n children,\n date,\n placeholder = 'Pick a date',\n dateFormat = 'PPP',\n ...props\n}: React.ComponentProps<typeof Button> & {\n date?: Date;\n placeholder?: string;\n dateFormat?: string;\n}) {\n return (\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n data-slot=\"date-picker-trigger\"\n data-empty={!date}\n className={cn(\n 'w-[280px] justify-start text-left font-normal data-[empty=true]:text-muted-foreground',\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n <CalendarIcon />\n {date ? format(date, dateFormat) : <span>{placeholder}</span>}\n </>\n )}\n </Button>\n </PopoverTrigger>\n );\n}\n\nfunction DatePickerContent({\n className,\n ...props\n}: React.ComponentProps<typeof PopoverContent>) {\n return (\n <PopoverContent\n data-slot=\"date-picker-content\"\n className={cn('w-auto p-0', className)}\n {...props}\n />\n );\n}\n\nfunction DatePickerRangeTrigger({\n className,\n children,\n dateRange,\n placeholder = 'Pick a date',\n dateFormat = 'LLL dd, y',\n ...props\n}: React.ComponentProps<typeof Button> & {\n dateRange?: DateRange;\n placeholder?: string;\n dateFormat?: string;\n}) {\n const hasDate = dateRange?.from != null;\n return (\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n data-slot=\"date-picker-range-trigger\"\n data-empty={!hasDate}\n className={cn(\n 'justify-start text-left font-normal data-[empty=true]:text-muted-foreground',\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n <CalendarIcon />\n {dateRange?.from ? (\n dateRange.to ? (\n <>\n {format(dateRange.from, dateFormat)} –{' '}\n {format(dateRange.to, dateFormat)}\n </>\n ) : (\n format(dateRange.from, dateFormat)\n )\n ) : (\n <span>{placeholder}</span>\n )}\n </>\n )}\n </Button>\n </PopoverTrigger>\n );\n}\n\nfunction DatePickerCalendar(props: DayPickerProps) {\n return <Calendar data-slot=\"date-picker-calendar\" {...props} />;\n}\n\nexport {\n DatePicker,\n DatePickerTrigger,\n DatePickerRangeTrigger,\n DatePickerContent,\n DatePickerCalendar,\n};\n"],"names":["DatePicker","props","jsx","Popover"],"mappings":"
|
|
1
|
+
{"version":3,"file":"datePicker.js","sources":["../../../../src/components/library/ui/datePicker.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { format } from 'date-fns';\nimport { Calendar as CalendarIcon } from 'lucide-react';\n\nimport type { DateRange, DayPickerProps } from 'react-day-picker';\n\nimport { cn } from '../../../lib/utils';\nimport { Button } from './button';\nimport { Calendar } from './calendar';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from './popover';\n\nfunction DatePicker({ ...props }: React.ComponentProps<typeof Popover>) {\n return <Popover data-slot=\"date-picker\" {...props} />;\n}\n\nfunction DatePickerTrigger({\n className,\n children,\n date,\n placeholder = 'Pick a date',\n dateFormat = 'PPP',\n ...props\n}: React.ComponentProps<typeof Button> & {\n date?: Date;\n placeholder?: string;\n dateFormat?: string;\n}) {\n return (\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n data-slot=\"date-picker-trigger\"\n data-empty={!date}\n className={cn(\n 'w-[280px] justify-start text-left font-normal data-[empty=true]:text-muted-foreground',\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n <CalendarIcon />\n {date ? format(date, dateFormat) : <span>{placeholder}</span>}\n </>\n )}\n </Button>\n </PopoverTrigger>\n );\n}\n\nfunction DatePickerContent({\n className,\n ...props\n}: React.ComponentProps<typeof PopoverContent>) {\n return (\n <PopoverContent\n data-slot=\"date-picker-content\"\n className={cn('w-auto p-0', className)}\n {...props}\n />\n );\n}\n\nfunction DatePickerRangeTrigger({\n className,\n children,\n dateRange,\n placeholder = 'Pick a date',\n dateFormat = 'LLL dd, y',\n ...props\n}: React.ComponentProps<typeof Button> & {\n dateRange?: DateRange;\n placeholder?: string;\n dateFormat?: string;\n}) {\n const hasDate = dateRange?.from != null;\n return (\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n data-slot=\"date-picker-range-trigger\"\n data-empty={!hasDate}\n className={cn(\n 'justify-start text-left font-normal data-[empty=true]:text-muted-foreground',\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n <CalendarIcon />\n {dateRange?.from ? (\n dateRange.to ? (\n <>\n {format(dateRange.from, dateFormat)} –{' '}\n {format(dateRange.to, dateFormat)}\n </>\n ) : (\n format(dateRange.from, dateFormat)\n )\n ) : (\n <span>{placeholder}</span>\n )}\n </>\n )}\n </Button>\n </PopoverTrigger>\n );\n}\n\nfunction DatePickerCalendar(props: DayPickerProps) {\n return <Calendar data-slot=\"date-picker-calendar\" {...props} />;\n}\n\nexport {\n DatePicker,\n DatePickerTrigger,\n DatePickerRangeTrigger,\n DatePickerContent,\n DatePickerCalendar,\n};\n"],"names":["DatePicker","props","jsx","Popover","DatePickerTrigger","className","children","date","placeholder","dateFormat","PopoverTrigger","Button","cn","jsxs","Fragment","CalendarIcon","format","DatePickerContent","PopoverContent","DatePickerRangeTrigger","dateRange","hasDate","DatePickerCalendar","Calendar"],"mappings":";;;;;;;AAiBA,SA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ACR,aAAU;AAAA,MACV,cAAY,CAACU;AAAA,MACb,WAAWT;AAAA,QACT;AAAA,QACAP;AAAA,MAAA;AAAA,MAED,GAAGJ;AAAA,MAEH,eACC,gBAAAY,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAZ,EAACa,GAAA,EAAa;AAAA,QACbK,GAAW,OACVA,EAAU,KACR,gBAAAP,EAAAC,GAAA,EACG,UAAA;AAAA,UAAAE,EAAOI,EAAU,MAAMX,CAAU;AAAA,UAAE;AAAA,UAAG;AAAA,UACtCO,EAAOI,EAAU,IAAIX,CAAU;AAAA,QAAA,EAAA,CAClC,IAEAO,EAAOI,EAAU,MAAMX,CAAU,IAGnC,gBAAAP,EAAC,UAAM,UAAAM,EAAA,CAAY;AAAA,MAAA,EAAA,CAEvB;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;AAEA,SAASc,EAAmBrB,GAAuB;AACjD,SAAO,gBAAAC,EAACqB,GAAA,EAAS,aAAU,wBAAwB,GAAGtB,GAAO;AAC/D;"}
|
|
@@ -1,21 +1,54 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "react";
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as a, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as u } from "react";
|
|
3
|
+
import { cva as c } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { cn as l } from "../../../lib/utils.js";
|
|
5
|
+
import { Label as m } from "./label.js";
|
|
6
|
+
import { Separator as p } from "./separator.js";
|
|
7
|
+
function k({ className: t, ...e }) {
|
|
8
|
+
return /* @__PURE__ */ a(
|
|
9
|
+
"fieldset",
|
|
10
|
+
{
|
|
11
|
+
"data-slot": "field-set",
|
|
12
|
+
className: l(
|
|
13
|
+
"gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col",
|
|
14
|
+
t
|
|
15
|
+
),
|
|
16
|
+
...e
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
function y({
|
|
21
|
+
className: t,
|
|
22
|
+
variant: e = "legend",
|
|
23
|
+
...o
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ a(
|
|
26
|
+
"legend",
|
|
27
|
+
{
|
|
28
|
+
"data-slot": "field-legend",
|
|
29
|
+
"data-variant": e,
|
|
30
|
+
className: l(
|
|
31
|
+
"mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",
|
|
32
|
+
t
|
|
33
|
+
),
|
|
34
|
+
...o
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function F({ className: t, ...e }) {
|
|
39
|
+
return /* @__PURE__ */ a(
|
|
7
40
|
"div",
|
|
8
41
|
{
|
|
9
42
|
"data-slot": "field-group",
|
|
10
|
-
className:
|
|
43
|
+
className: l(
|
|
11
44
|
"gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col",
|
|
12
|
-
|
|
45
|
+
t
|
|
13
46
|
),
|
|
14
|
-
...
|
|
47
|
+
...e
|
|
15
48
|
}
|
|
16
49
|
);
|
|
17
50
|
}
|
|
18
|
-
const
|
|
51
|
+
const g = c(
|
|
19
52
|
"data-[invalid=true]:text-destructive gap-2 group/field flex w-full",
|
|
20
53
|
{
|
|
21
54
|
variants: {
|
|
@@ -30,24 +63,148 @@ const i = r(
|
|
|
30
63
|
}
|
|
31
64
|
}
|
|
32
65
|
);
|
|
33
|
-
function
|
|
34
|
-
className:
|
|
35
|
-
orientation:
|
|
36
|
-
...
|
|
66
|
+
function L({
|
|
67
|
+
className: t,
|
|
68
|
+
orientation: e = "vertical",
|
|
69
|
+
...o
|
|
37
70
|
}) {
|
|
38
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ a(
|
|
39
72
|
"div",
|
|
40
73
|
{
|
|
41
74
|
role: "group",
|
|
42
75
|
"data-slot": "field",
|
|
43
|
-
"data-orientation":
|
|
44
|
-
className:
|
|
45
|
-
...
|
|
76
|
+
"data-orientation": e,
|
|
77
|
+
className: l(g({ orientation: e }), t),
|
|
78
|
+
...o
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
function S({ className: t, ...e }) {
|
|
83
|
+
return /* @__PURE__ */ a(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
"data-slot": "field-content",
|
|
87
|
+
className: l(
|
|
88
|
+
"gap-0.5 group/field-content flex flex-1 flex-col leading-snug",
|
|
89
|
+
t
|
|
90
|
+
),
|
|
91
|
+
...e
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
function j({
|
|
96
|
+
className: t,
|
|
97
|
+
...e
|
|
98
|
+
}) {
|
|
99
|
+
return /* @__PURE__ */ a(
|
|
100
|
+
m,
|
|
101
|
+
{
|
|
102
|
+
"data-slot": "field-label",
|
|
103
|
+
className: l(
|
|
104
|
+
"has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 group/field-label peer/field-label flex w-fit leading-snug",
|
|
105
|
+
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",
|
|
106
|
+
t
|
|
107
|
+
),
|
|
108
|
+
...e
|
|
46
109
|
}
|
|
47
110
|
);
|
|
48
111
|
}
|
|
112
|
+
function z({ className: t, ...e }) {
|
|
113
|
+
return /* @__PURE__ */ a(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
"data-slot": "field-label",
|
|
117
|
+
className: l(
|
|
118
|
+
"gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug",
|
|
119
|
+
t
|
|
120
|
+
),
|
|
121
|
+
...e
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
function E({ className: t, ...e }) {
|
|
126
|
+
return /* @__PURE__ */ a(
|
|
127
|
+
"p",
|
|
128
|
+
{
|
|
129
|
+
"data-slot": "field-description",
|
|
130
|
+
className: l(
|
|
131
|
+
"text-muted-foreground text-left text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance",
|
|
132
|
+
"last:mt-0 nth-last-2:-mt-1",
|
|
133
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
134
|
+
t
|
|
135
|
+
),
|
|
136
|
+
...e
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
function M({
|
|
141
|
+
children: t,
|
|
142
|
+
className: e,
|
|
143
|
+
...o
|
|
144
|
+
}) {
|
|
145
|
+
return /* @__PURE__ */ f(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
"data-slot": "field-separator",
|
|
149
|
+
"data-content": !!t,
|
|
150
|
+
className: l(
|
|
151
|
+
"-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative",
|
|
152
|
+
e
|
|
153
|
+
),
|
|
154
|
+
...o,
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ a(p, { className: "absolute inset-0 top-1/2" }),
|
|
157
|
+
t && /* @__PURE__ */ a(
|
|
158
|
+
"span",
|
|
159
|
+
{
|
|
160
|
+
className: "text-muted-foreground px-2 bg-background relative mx-auto block w-fit",
|
|
161
|
+
"data-slot": "field-separator-content",
|
|
162
|
+
children: t
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
function V({
|
|
170
|
+
className: t,
|
|
171
|
+
children: e,
|
|
172
|
+
errors: o,
|
|
173
|
+
...n
|
|
174
|
+
}) {
|
|
175
|
+
const i = u(() => {
|
|
176
|
+
if (e)
|
|
177
|
+
return e;
|
|
178
|
+
if (!o?.length)
|
|
179
|
+
return null;
|
|
180
|
+
const d = [
|
|
181
|
+
...new Map(o.map((r) => [r?.message, r])).values()
|
|
182
|
+
];
|
|
183
|
+
return d?.length == 1 ? d[0]?.message : /* @__PURE__ */ a("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: d.map(
|
|
184
|
+
(r, s) => r?.message && /* @__PURE__ */ a("li", { children: r.message }, s)
|
|
185
|
+
) });
|
|
186
|
+
}, [e, o]);
|
|
187
|
+
return i ? /* @__PURE__ */ a(
|
|
188
|
+
"div",
|
|
189
|
+
{
|
|
190
|
+
role: "alert",
|
|
191
|
+
"data-slot": "field-error",
|
|
192
|
+
className: l("text-destructive text-sm font-normal", t),
|
|
193
|
+
...n,
|
|
194
|
+
children: i
|
|
195
|
+
}
|
|
196
|
+
) : null;
|
|
197
|
+
}
|
|
49
198
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
199
|
+
L as Field,
|
|
200
|
+
S as FieldContent,
|
|
201
|
+
E as FieldDescription,
|
|
202
|
+
V as FieldError,
|
|
203
|
+
F as FieldGroup,
|
|
204
|
+
j as FieldLabel,
|
|
205
|
+
y as FieldLegend,
|
|
206
|
+
M as FieldSeparator,
|
|
207
|
+
k as FieldSet,
|
|
208
|
+
z as FieldTitle
|
|
52
209
|
};
|
|
53
210
|
//# sourceMappingURL=field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sources":["../../../../src/components/library/ui/field.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMemo } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../../lib/utils';\nimport { Label } from './label';\nimport { Separator } from './separator';\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n 'gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({\n className,\n variant = 'legend',\n ...props\n}: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n 'mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col',\n className\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva(\n 'data-[invalid=true]:text-destructive gap-2 group/field flex w-full',\n {\n variants: {\n orientation: {\n vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',\n horizontal:\n 'flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n responsive:\n 'flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n }\n);\n\nfunction Field({\n className,\n orientation = 'vertical',\n ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\n 'gap-0.5 group/field-content flex flex-1 flex-col leading-snug',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLabel({\n className,\n ...props\n}: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n 'has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 group/field-label peer/field-label flex w-fit leading-snug',\n 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n 'gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-muted-foreground text-left text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<'div'> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n '-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative',\n className\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"text-muted-foreground px-2 bg-background relative mx-auto block w-fit\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors?.length) {\n return null;\n }\n\n const uniqueErrors = [\n ...new Map(errors.map(error => [error?.message, error])).values(),\n ];\n\n if (uniqueErrors?.length == 1) {\n return uniqueErrors[0]?.message;\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map(\n (error, index) =>\n error?.message && <li key={index}>{error.message}</li>\n )}\n </ul>\n );\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn('text-destructive text-sm font-normal', className)}\n {...props}\n >\n {content}\n </div>\n );\n}\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n};\n"],"names":["
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../../../../src/components/library/ui/field.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMemo } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../../lib/utils';\nimport { Label } from './label';\nimport { Separator } from './separator';\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n 'gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({\n className,\n variant = 'legend',\n ...props\n}: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n 'mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col',\n className\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva(\n 'data-[invalid=true]:text-destructive gap-2 group/field flex w-full',\n {\n variants: {\n orientation: {\n vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',\n horizontal:\n 'flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n responsive:\n 'flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n }\n);\n\nfunction Field({\n className,\n orientation = 'vertical',\n ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\n 'gap-0.5 group/field-content flex flex-1 flex-col leading-snug',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLabel({\n className,\n ...props\n}: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n 'has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 group/field-label peer/field-label flex w-fit leading-snug',\n 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n 'gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-muted-foreground text-left text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<'div'> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n '-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative',\n className\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"text-muted-foreground px-2 bg-background relative mx-auto block w-fit\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors?.length) {\n return null;\n }\n\n const uniqueErrors = [\n ...new Map(errors.map(error => [error?.message, error])).values(),\n ];\n\n if (uniqueErrors?.length == 1) {\n return uniqueErrors[0]?.message;\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map(\n (error, index) =>\n error?.message && <li key={index}>{error.message}</li>\n )}\n </ul>\n );\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn('text-destructive text-sm font-normal', className)}\n {...props}\n >\n {content}\n </div>\n );\n}\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n};\n"],"names":["FieldSet","className","props","jsx","cn","FieldLegend","variant","FieldGroup","fieldVariants","cva","Field","orientation","FieldContent","FieldLabel","Label","FieldTitle","FieldDescription","FieldSeparator","children","jsxs","Separator","FieldError","errors","content","useMemo","uniqueErrors","error","index"],"mappings":";;;;;;AAQA,SAASA,EAAS,EAAE,WAAAC,GAAW,GAAGC,KAA2C;AAC3E,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASG,EAAY;AAAA,EACnB,WAAAJ;AAAA,EACA,SAAAK,IAAU;AAAA,EACV,GAAGJ;AACL,GAAsE;AACpE,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,gBAAcG;AAAA,MACd,WAAWF;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASK,EAAW,EAAE,WAAAN,GAAW,GAAGC,KAAsC;AACxE,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,MAAMM,IAAgBC;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,aAAa;AAAA,QACX,UAAU;AAAA,QACV,YACE;AAAA,QACF,YACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,aA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,EAAG,wCAAwCH,CAAS;AAAA,MAC9D,GAAGC;AAAA,MAEH,UAAAqB;AAAA,IAAA;AAAA,EAAA,IAVI;AAaX;"}
|
|
@@ -1,89 +1,101 @@
|
|
|
1
1
|
import { jsx as i, jsxs as o } from "react/jsx-runtime";
|
|
2
2
|
import { cn as t } from "../../../lib/utils.js";
|
|
3
|
-
import { Button as
|
|
4
|
-
import { MoreHorizontalIcon as c, ChevronRightIcon as
|
|
5
|
-
function h({
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { Button as s } from "./button.js";
|
|
4
|
+
import { MoreHorizontalIcon as c, ChevronRightIcon as u, ChevronLeftIcon as p } from "lucide-react";
|
|
5
|
+
function h({ className: a, ...n }) {
|
|
6
|
+
return /* @__PURE__ */ i(
|
|
7
|
+
"nav",
|
|
8
|
+
{
|
|
9
|
+
role: "navigation",
|
|
10
|
+
"aria-label": "pagination",
|
|
11
|
+
"data-slot": "pagination",
|
|
12
|
+
className: t("mx-auto flex w-full justify-center", a),
|
|
13
|
+
...n
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
function N({
|
|
18
|
+
className: a,
|
|
19
|
+
...n
|
|
8
20
|
}) {
|
|
9
21
|
return /* @__PURE__ */ i(
|
|
10
22
|
"ul",
|
|
11
23
|
{
|
|
12
24
|
"data-slot": "pagination-content",
|
|
13
|
-
className: t("gap-0.5 flex items-center",
|
|
14
|
-
...
|
|
25
|
+
className: t("gap-0.5 flex items-center", a),
|
|
26
|
+
...n
|
|
15
27
|
}
|
|
16
28
|
);
|
|
17
29
|
}
|
|
18
|
-
function
|
|
19
|
-
return /* @__PURE__ */ i("li", { "data-slot": "pagination-item", ...
|
|
30
|
+
function x({ ...a }) {
|
|
31
|
+
return /* @__PURE__ */ i("li", { "data-slot": "pagination-item", ...a });
|
|
20
32
|
}
|
|
21
|
-
function
|
|
22
|
-
className:
|
|
23
|
-
isActive:
|
|
33
|
+
function l({
|
|
34
|
+
className: a,
|
|
35
|
+
isActive: n,
|
|
24
36
|
size: e = "icon",
|
|
25
37
|
...r
|
|
26
38
|
}) {
|
|
27
39
|
return /* @__PURE__ */ i(
|
|
28
|
-
|
|
40
|
+
s,
|
|
29
41
|
{
|
|
30
42
|
asChild: !0,
|
|
31
|
-
variant:
|
|
43
|
+
variant: n ? "outline" : "ghost",
|
|
32
44
|
size: e,
|
|
33
|
-
className: t(
|
|
45
|
+
className: t(a),
|
|
34
46
|
children: /* @__PURE__ */ i(
|
|
35
47
|
"a",
|
|
36
48
|
{
|
|
37
|
-
"aria-current":
|
|
49
|
+
"aria-current": n ? "page" : void 0,
|
|
38
50
|
"data-slot": "pagination-link",
|
|
39
|
-
"data-active":
|
|
51
|
+
"data-active": n,
|
|
40
52
|
...r
|
|
41
53
|
}
|
|
42
54
|
)
|
|
43
55
|
}
|
|
44
56
|
);
|
|
45
57
|
}
|
|
46
|
-
function
|
|
47
|
-
className:
|
|
48
|
-
text:
|
|
58
|
+
function v({
|
|
59
|
+
className: a,
|
|
60
|
+
text: n = "Previous",
|
|
49
61
|
...e
|
|
50
62
|
}) {
|
|
51
63
|
return /* @__PURE__ */ o(
|
|
52
|
-
|
|
64
|
+
l,
|
|
53
65
|
{
|
|
54
66
|
"aria-label": "Go to previous page",
|
|
55
67
|
size: "default",
|
|
56
|
-
className: t("pl-1.5!",
|
|
68
|
+
className: t("pl-1.5!", a),
|
|
57
69
|
...e,
|
|
58
70
|
children: [
|
|
59
71
|
/* @__PURE__ */ i(p, { "data-icon": "inline-start", className: "cn-rtl-flip" }),
|
|
60
|
-
/* @__PURE__ */ i("span", { className: "hidden sm:block", children:
|
|
72
|
+
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n })
|
|
61
73
|
]
|
|
62
74
|
}
|
|
63
75
|
);
|
|
64
76
|
}
|
|
65
77
|
function P({
|
|
66
|
-
className:
|
|
67
|
-
text:
|
|
78
|
+
className: a,
|
|
79
|
+
text: n = "Next",
|
|
68
80
|
...e
|
|
69
81
|
}) {
|
|
70
82
|
return /* @__PURE__ */ o(
|
|
71
|
-
|
|
83
|
+
l,
|
|
72
84
|
{
|
|
73
85
|
"aria-label": "Go to next page",
|
|
74
86
|
size: "default",
|
|
75
|
-
className: t("pr-1.5!",
|
|
87
|
+
className: t("pr-1.5!", a),
|
|
76
88
|
...e,
|
|
77
89
|
children: [
|
|
78
|
-
/* @__PURE__ */ i("span", { className: "hidden sm:block", children:
|
|
79
|
-
/* @__PURE__ */ i(
|
|
90
|
+
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n }),
|
|
91
|
+
/* @__PURE__ */ i(u, { "data-icon": "inline-end", className: "cn-rtl-flip" })
|
|
80
92
|
]
|
|
81
93
|
}
|
|
82
94
|
);
|
|
83
95
|
}
|
|
84
|
-
function
|
|
85
|
-
className:
|
|
86
|
-
...
|
|
96
|
+
function z({
|
|
97
|
+
className: a,
|
|
98
|
+
...n
|
|
87
99
|
}) {
|
|
88
100
|
return /* @__PURE__ */ o(
|
|
89
101
|
"span",
|
|
@@ -92,9 +104,9 @@ function v({
|
|
|
92
104
|
"data-slot": "pagination-ellipsis",
|
|
93
105
|
className: t(
|
|
94
106
|
"size-8 [&_svg:not([class*='size-'])]:size-4 flex items-center justify-center",
|
|
95
|
-
|
|
107
|
+
a
|
|
96
108
|
),
|
|
97
|
-
...
|
|
109
|
+
...n,
|
|
98
110
|
children: [
|
|
99
111
|
/* @__PURE__ */ i(c, {}),
|
|
100
112
|
/* @__PURE__ */ i("span", { className: "sr-only", children: "More pages" })
|
|
@@ -103,11 +115,12 @@ function v({
|
|
|
103
115
|
);
|
|
104
116
|
}
|
|
105
117
|
export {
|
|
106
|
-
h as
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
118
|
+
h as Pagination,
|
|
119
|
+
N as PaginationContent,
|
|
120
|
+
z as PaginationEllipsis,
|
|
121
|
+
x as PaginationItem,
|
|
122
|
+
l as PaginationLink,
|
|
110
123
|
P as PaginationNext,
|
|
111
|
-
|
|
124
|
+
v as PaginationPrevious
|
|
112
125
|
};
|
|
113
126
|
//# sourceMappingURL=pagination.js.map
|