@uselets/ui 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -7
- package/dist/chunk-CHh1Zzun.js +1 -0
- package/dist/cli/uselets.mjs +7 -0
- package/dist/cli/uselets.mjs.map +1 -0
- package/dist/components/accordion.d.ts +6 -6
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.d.ts +14 -14
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.d.ts +8 -8
- package/dist/components/alert.js +1 -1
- package/dist/components/anchor.d.ts +24 -0
- package/dist/components/anchor.js +2 -0
- package/dist/components/anchor.js.map +1 -0
- package/dist/components/avatar.d.ts +8 -8
- package/dist/components/avatar.js +1 -1
- package/dist/components/badge.d.ts +5 -5
- package/dist/components/badge.js +1 -1
- package/dist/components/breadcrumb.d.ts +9 -9
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.d.ts +7 -7
- package/dist/components/button-group.js +1 -1
- package/dist/components/button.d.ts +9 -7
- package/dist/components/button.js +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.d.ts +7 -6
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.d.ts +9 -9
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.d.ts +9 -7
- package/dist/components/carousel.js +1 -1
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/center.d.ts +6 -6
- package/dist/components/center.js +1 -1
- package/dist/components/chart.d.ts +90 -90
- package/dist/components/chart.js +1 -1
- package/dist/components/chart.js.map +1 -1
- package/dist/components/checkbox.d.ts +6 -6
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code.d.ts +13 -0
- package/dist/components/code.js +2 -0
- package/dist/components/code.js.map +1 -0
- package/dist/components/collapsible.d.ts +5 -5
- package/dist/components/collapsible.js +1 -1
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.d.ts +17 -17
- package/dist/components/combobox.js +1 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.d.ts +11 -11
- package/dist/components/command.js +1 -1
- package/dist/components/command.js.map +1 -1
- package/dist/components/container.d.ts +6 -6
- package/dist/components/container.js +1 -1
- package/dist/components/dialog.d.ts +15 -15
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.d.ts +15 -15
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.d.ts +17 -17
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/dropzone.d.ts +107 -0
- package/dist/components/dropzone.js +2 -0
- package/dist/components/dropzone.js.map +1 -0
- package/dist/components/empty.d.ts +10 -10
- package/dist/components/empty.js +1 -1
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +1 -1
- package/dist/components/group.d.ts +6 -6
- package/dist/components/group.js +1 -1
- package/dist/components/heading.d.ts +22 -0
- package/dist/components/heading.js +2 -0
- package/dist/components/heading.js.map +1 -0
- package/dist/components/hover-card.d.ts +5 -5
- package/dist/components/hover-card.js +1 -1
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/input-group.d.ts +12 -11
- package/dist/components/input-group.js +1 -1
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +1 -1
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.d.ts +3 -3
- package/dist/components/input.js +1 -1
- package/dist/components/kbd.d.ts +4 -4
- package/dist/components/kbd.js +1 -1
- package/dist/components/label.d.ts +3 -3
- package/dist/components/label.js +1 -1
- package/dist/components/list.d.ts +44 -0
- package/dist/components/list.js +2 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/native-select.d.ts +5 -5
- package/dist/components/native-select.js +1 -1
- package/dist/components/navigation-menu.d.ts +12 -12
- package/dist/components/navigation-menu.js +1 -1
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/pagination.d.ts +11 -10
- package/dist/components/pagination.js +1 -1
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.d.ts +9 -9
- package/dist/components/popover.js +1 -1
- package/dist/components/progress.d.ts +3 -3
- package/dist/components/progress.js +1 -1
- package/dist/components/radio-group.d.ts +4 -4
- package/dist/components/radio-group.js +1 -1
- package/dist/components/resizable.d.ts +5 -5
- package/dist/components/resizable.js +1 -1
- package/dist/components/scroll-area.d.ts +4 -4
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/select.d.ts +12 -12
- package/dist/components/select.js +1 -1
- package/dist/components/separator.d.ts +3 -3
- package/dist/components/separator.js +1 -1
- package/dist/components/sheet.d.ts +12 -12
- package/dist/components/sheet.js +1 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.d.ts +28 -28
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton.d.ts +3 -3
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.d.ts +3 -3
- package/dist/components/slider.js +1 -1
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +1 -1
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/spinner.d.ts +6 -6
- package/dist/components/spinner.js +1 -1
- package/dist/components/stack.d.ts +6 -6
- package/dist/components/stack.js +1 -1
- package/dist/components/switch.d.ts +3 -3
- package/dist/components/switch.js +1 -1
- package/dist/components/table.d.ts +10 -10
- package/dist/components/table.js +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.d.ts +8 -8
- package/dist/components/tabs.js +1 -1
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/text.d.ts +22 -0
- package/dist/components/text.js +2 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/textarea.d.ts +3 -3
- package/dist/components/textarea.js +1 -1
- package/dist/components/theme.d.ts +4 -4
- package/dist/components/theme.js +1 -1
- package/dist/components/timeline.d.ts +63 -0
- package/dist/components/timeline.js +2 -0
- package/dist/components/timeline.js.map +1 -0
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle.d.ts +6 -6
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.d.ts +6 -6
- package/dist/components/tooltip.js +1 -1
- package/dist/hooks/use-disclosure.d.ts +23 -0
- package/dist/hooks/use-disclosure.js +2 -0
- package/dist/hooks/use-disclosure.js.map +1 -0
- package/dist/hooks/use-disclosure.spec.d.ts +1 -0
- package/dist/hooks/use-disclosure.spec.js +2 -0
- package/dist/hooks/use-disclosure.spec.js.map +1 -0
- package/dist/hooks/use-document-visibility.d.ts +7 -0
- package/dist/hooks/use-document-visibility.js +2 -0
- package/dist/hooks/use-document-visibility.js.map +1 -0
- package/dist/hooks/use-document-visibility.spec.d.ts +1 -0
- package/dist/hooks/use-document-visibility.spec.js +2 -0
- package/dist/hooks/use-document-visibility.spec.js.map +1 -0
- package/dist/hooks/use-idle.d.ts +14 -0
- package/dist/hooks/use-idle.js +2 -0
- package/dist/hooks/use-idle.js.map +1 -0
- package/dist/hooks/use-idle.spec.d.ts +1 -0
- package/dist/hooks/use-idle.spec.js +2 -0
- package/dist/hooks/use-idle.spec.js.map +1 -0
- package/dist/hooks/use-interval.d.ts +22 -0
- package/dist/hooks/use-interval.js +2 -0
- package/dist/hooks/use-interval.js.map +1 -0
- package/dist/hooks/use-interval.spec.d.ts +1 -0
- package/dist/hooks/use-interval.spec.js +2 -0
- package/dist/hooks/use-interval.spec.js.map +1 -0
- package/dist/hooks/use-local-storage.d.ts +17 -0
- package/dist/hooks/use-local-storage.js +2 -0
- package/dist/hooks/use-local-storage.js.map +1 -0
- package/dist/hooks/use-local-storage.spec.d.ts +1 -0
- package/dist/hooks/use-local-storage.spec.js +2 -0
- package/dist/hooks/use-local-storage.spec.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +1 -1
- package/dist/hooks/use-mobile.js +1 -1
- package/dist/hooks/use-mobile.spec.d.ts +1 -0
- package/dist/hooks/use-mobile.spec.js +2 -0
- package/dist/hooks/use-mobile.spec.js.map +1 -0
- package/dist/index.d.ts +16 -3
- package/dist/index.js +1 -1
- package/dist/lib/button.d.ts +16 -0
- package/dist/lib/button.js +2 -0
- package/dist/lib/button.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -2
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/react.esm-BuxkFT_p.js +59 -0
- package/dist/react.esm-BuxkFT_p.js.map +1 -0
- package/dist/styles.css +2 -1437
- package/dist/themes/gomax.css +2 -0
- package/dist/themes/max.css +2 -0
- package/package.json +43 -27
- package/dist/chunk-IpJEthwI.js +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
6
|
|
|
7
7
|
//#region src/components/badge.d.ts
|
|
8
8
|
declare const badgeVariants: (props?: ({
|
|
9
9
|
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
|
|
10
|
-
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
type BadgeProps = React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
|
|
12
12
|
asChild?: boolean;
|
|
13
13
|
};
|
|
@@ -16,7 +16,7 @@ declare function Badge({
|
|
|
16
16
|
variant,
|
|
17
17
|
asChild,
|
|
18
18
|
...props
|
|
19
|
-
}: BadgeProps): react_jsx_runtime0.JSX.Element;
|
|
19
|
+
}: BadgeProps): _$react_jsx_runtime0.JSX.Element;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { Badge, BadgeProps, badgeVariants };
|
|
22
22
|
//# sourceMappingURL=badge.d.ts.map
|
package/dist/components/badge.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Badge({className:r,variant:a=`default`,asChild:o=!1,...s}){return n(o?t.Root:`span`,{"data-slot":`badge`,"data-variant":a,className:e(i({variant:a}),r),...s})}export{Badge,i as badgeVariants};
|
|
2
2
|
//# sourceMappingURL=badge.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/breadcrumb.d.ts
|
|
@@ -15,33 +15,33 @@ type BreadcrumbEllipsisProps = React.ComponentProps<'span'>;
|
|
|
15
15
|
declare function Breadcrumb({
|
|
16
16
|
className,
|
|
17
17
|
...props
|
|
18
|
-
}: BreadcrumbProps): react_jsx_runtime0.JSX.Element;
|
|
18
|
+
}: BreadcrumbProps): _$react_jsx_runtime0.JSX.Element;
|
|
19
19
|
declare function BreadcrumbList({
|
|
20
20
|
className,
|
|
21
21
|
...props
|
|
22
|
-
}: BreadcrumbListProps): react_jsx_runtime0.JSX.Element;
|
|
22
|
+
}: BreadcrumbListProps): _$react_jsx_runtime0.JSX.Element;
|
|
23
23
|
declare function BreadcrumbItem({
|
|
24
24
|
className,
|
|
25
25
|
...props
|
|
26
|
-
}: BreadcrumbItemProps): react_jsx_runtime0.JSX.Element;
|
|
26
|
+
}: BreadcrumbItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
27
27
|
declare function BreadcrumbLink({
|
|
28
28
|
asChild,
|
|
29
29
|
className,
|
|
30
30
|
...props
|
|
31
|
-
}: BreadcrumbLinkProps): react_jsx_runtime0.JSX.Element;
|
|
31
|
+
}: BreadcrumbLinkProps): _$react_jsx_runtime0.JSX.Element;
|
|
32
32
|
declare function BreadcrumbPage({
|
|
33
33
|
className,
|
|
34
34
|
...props
|
|
35
|
-
}: BreadcrumbPageProps): react_jsx_runtime0.JSX.Element;
|
|
35
|
+
}: BreadcrumbPageProps): _$react_jsx_runtime0.JSX.Element;
|
|
36
36
|
declare function BreadcrumbSeparator({
|
|
37
37
|
children,
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: BreadcrumbSeparatorProps): react_jsx_runtime0.JSX.Element;
|
|
40
|
+
}: BreadcrumbSeparatorProps): _$react_jsx_runtime0.JSX.Element;
|
|
41
41
|
declare function BreadcrumbEllipsis({
|
|
42
42
|
className,
|
|
43
43
|
...props
|
|
44
|
-
}: BreadcrumbEllipsisProps): react_jsx_runtime0.JSX.Element;
|
|
44
|
+
}: BreadcrumbEllipsisProps): _$react_jsx_runtime0.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisProps, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbListProps, BreadcrumbPage, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorProps };
|
|
47
47
|
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{IconChevronRight as t,IconDots as n}from"@tabler/icons-react";import{Slot as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";function Breadcrumb({className:t,...n}){return i(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,className:e(t),...n})}function BreadcrumbList({className:t,...n}){return i(`ol`,{"data-slot":`breadcrumb-list`,className:e(`flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground`,t),...n})}function BreadcrumbItem({className:t,...n}){return i(`li`,{"data-slot":`breadcrumb-item`,className:e(`inline-flex items-center gap-1`,t),...n})}function BreadcrumbLink({asChild:t,className:n,...a}){return i(t?r.Root:`a`,{"data-slot":`breadcrumb-link`,className:e(`transition-colors hover:text-foreground`,n),...a})}function BreadcrumbPage({className:t,...n}){return i(`span`,{"data-slot":`breadcrumb-page`,"aria-current":`page`,className:e(`font-normal text-foreground`,t),...n})}function BreadcrumbSeparator({children:n,className:r,...a}){return i(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:e(`[&>svg]:size-3.5`,r),...a,children:n??i(t,{})})}function BreadcrumbEllipsis({className:t,...r}){return a(`span`,{"data-slot":`breadcrumb-ellipsis`,role:`presentation`,"aria-hidden":`true`,className:e(`flex size-5 items-center justify-center [&>svg]:size-4`,t),...r,children:[i(n,{}),i(`span`,{className:`sr-only`,children:`More`})]})}export{Breadcrumb,BreadcrumbEllipsis,BreadcrumbItem,BreadcrumbLink,BreadcrumbList,BreadcrumbPage,BreadcrumbSeparator};
|
|
2
2
|
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.js","names":[],"sources":["../../src/components/breadcrumb.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconChevronRight, IconDots } from '@tabler/icons-react'\nimport { Slot } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type BreadcrumbProps = React.ComponentProps<'nav'>\n\nexport type BreadcrumbListProps = React.ComponentProps<'ol'>\n\nexport type BreadcrumbItemProps = React.ComponentProps<'li'>\n\nexport type BreadcrumbLinkProps = React.ComponentProps<'a'> & {\n asChild?: boolean\n}\n\nexport type BreadcrumbPageProps = React.ComponentProps<'span'>\n\nexport type BreadcrumbSeparatorProps = React.ComponentProps<'li'>\n\nexport type BreadcrumbEllipsisProps = React.ComponentProps<'span'>\n\nfunction Breadcrumb({ className, ...props }: BreadcrumbProps) {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" className={cn(className)} {...props} />\n}\n\nfunction BreadcrumbList({ className, ...props }: BreadcrumbListProps) {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn('flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbItem({ className, ...props }: BreadcrumbItemProps) {\n return <li data-slot=\"breadcrumb-item\" className={cn('inline-flex items-center gap-1', className)} {...props} />\n}\n\nfunction BreadcrumbLink({ asChild, className, ...props }: BreadcrumbLinkProps) {\n const Comp = asChild ? Slot.Root : 'a'\n\n return (\n <Comp data-slot=\"breadcrumb-link\" className={cn('transition-colors hover:text-foreground', className)} {...props} />\n )\n}\n\nfunction BreadcrumbPage({ className, ...props }: BreadcrumbPageProps) {\n return (\n <span\n data-slot=\"breadcrumb-page\"\n aria-current=\"page\"\n className={cn('font-normal text-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps) {\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn('[&>svg]:size-3.5', className)}\n {...props}\n >\n {children ?? <IconChevronRight />}\n </li>\n )\n}\n\nfunction BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps) {\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn('flex size-5 items-center justify-center [&>svg]:size-4', className)}\n {...props}\n >\n <IconDots />\n <span className=\"sr-only\">More</span>\n </span>\n )\n}\n\nexport {\n Breadcrumb,\n
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","names":[],"sources":["../../src/components/breadcrumb.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconChevronRight, IconDots } from '@tabler/icons-react'\nimport { Slot } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type BreadcrumbProps = React.ComponentProps<'nav'>\n\nexport type BreadcrumbListProps = React.ComponentProps<'ol'>\n\nexport type BreadcrumbItemProps = React.ComponentProps<'li'>\n\nexport type BreadcrumbLinkProps = React.ComponentProps<'a'> & {\n asChild?: boolean\n}\n\nexport type BreadcrumbPageProps = React.ComponentProps<'span'>\n\nexport type BreadcrumbSeparatorProps = React.ComponentProps<'li'>\n\nexport type BreadcrumbEllipsisProps = React.ComponentProps<'span'>\n\nfunction Breadcrumb({ className, ...props }: BreadcrumbProps) {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" className={cn(className)} {...props} />\n}\n\nfunction BreadcrumbList({ className, ...props }: BreadcrumbListProps) {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn('flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbItem({ className, ...props }: BreadcrumbItemProps) {\n return <li data-slot=\"breadcrumb-item\" className={cn('inline-flex items-center gap-1', className)} {...props} />\n}\n\nfunction BreadcrumbLink({ asChild, className, ...props }: BreadcrumbLinkProps) {\n const Comp = asChild ? Slot.Root : 'a'\n\n return (\n <Comp data-slot=\"breadcrumb-link\" className={cn('transition-colors hover:text-foreground', className)} {...props} />\n )\n}\n\nfunction BreadcrumbPage({ className, ...props }: BreadcrumbPageProps) {\n return (\n <span\n data-slot=\"breadcrumb-page\"\n aria-current=\"page\"\n className={cn('font-normal text-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps) {\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn('[&>svg]:size-3.5', className)}\n {...props}\n >\n {children ?? <IconChevronRight />}\n </li>\n )\n}\n\nfunction BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps) {\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn('flex size-5 items-center justify-center [&>svg]:size-4', className)}\n {...props}\n >\n <IconDots />\n <span className=\"sr-only\">More</span>\n </span>\n )\n}\n\nexport {\n Breadcrumb,\n BreadcrumbEllipsis,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator\n}\n"],"mappings":"yNAuBA,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OAAO,EAAC,MAAD,CAAK,aAAW,aAAa,YAAU,aAAa,UAAW,EAAG,EAAU,CAAE,GAAI,EAAS,CAAA,CAGpG,SAAS,eAAe,CAAE,YAAW,GAAG,GAA8B,CACpE,OACE,EAAC,KAAD,CACE,YAAU,kBACV,UAAW,EAAG,oFAAqF,EAAU,CAC7G,GAAI,EACJ,CAAA,CAIN,SAAS,eAAe,CAAE,YAAW,GAAG,GAA8B,CACpE,OAAO,EAAC,KAAD,CAAI,YAAU,kBAAkB,UAAW,EAAG,iCAAkC,EAAU,CAAE,GAAI,EAAS,CAAA,CAGlH,SAAS,eAAe,CAAE,UAAS,YAAW,GAAG,GAA8B,CAG7E,OACE,EAHW,EAAU,EAAK,KAAO,IAGjC,CAAM,YAAU,kBAAkB,UAAW,EAAG,0CAA2C,EAAU,CAAE,GAAI,EAAS,CAAA,CAIxH,SAAS,eAAe,CAAE,YAAW,GAAG,GAA8B,CACpE,OACE,EAAC,OAAD,CACE,YAAU,kBACV,eAAa,OACb,UAAW,EAAG,8BAA+B,EAAU,CACvD,GAAI,EACJ,CAAA,CAIN,SAAS,oBAAoB,CAAE,WAAU,YAAW,GAAG,GAAmC,CACxF,OACE,EAAC,KAAD,CACE,YAAU,uBACV,KAAK,eACL,cAAY,OACZ,UAAW,EAAG,mBAAoB,EAAU,CAC5C,GAAI,WAEH,GAAY,EAAC,EAAD,EAAoB,CAAA,CAC9B,CAAA,CAIT,SAAS,mBAAmB,CAAE,YAAW,GAAG,GAAkC,CAC5E,OACE,EAAC,OAAD,CACE,YAAU,sBACV,KAAK,eACL,cAAY,OACZ,UAAW,EAAG,yDAA0D,EAAU,CAClF,GAAI,WALN,CAOE,EAAC,EAAD,EAAY,CAAA,CACZ,EAAC,OAAD,CAAM,UAAU,mBAAU,OAAW,CAAA,CAChC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
2
|
import { Separator } from "./separator.js";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
|
-
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
6
|
|
|
7
7
|
//#region src/components/button-group.d.ts
|
|
8
8
|
declare const buttonGroupVariants: (props?: ({
|
|
9
9
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
10
|
-
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
type ButtonGroupProps = React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>;
|
|
12
12
|
type ButtonGroupTextProps = React.ComponentProps<'div'> & {
|
|
13
13
|
asChild?: boolean;
|
|
@@ -17,17 +17,17 @@ declare function ButtonGroup({
|
|
|
17
17
|
className,
|
|
18
18
|
orientation,
|
|
19
19
|
...props
|
|
20
|
-
}: ButtonGroupProps): react_jsx_runtime0.JSX.Element;
|
|
20
|
+
}: ButtonGroupProps): _$react_jsx_runtime0.JSX.Element;
|
|
21
21
|
declare function ButtonGroupText({
|
|
22
22
|
className,
|
|
23
23
|
asChild,
|
|
24
24
|
...props
|
|
25
|
-
}: ButtonGroupTextProps): react_jsx_runtime0.JSX.Element;
|
|
25
|
+
}: ButtonGroupTextProps): _$react_jsx_runtime0.JSX.Element;
|
|
26
26
|
declare function ButtonGroupSeparator({
|
|
27
27
|
className,
|
|
28
28
|
orientation,
|
|
29
29
|
...props
|
|
30
|
-
}: ButtonGroupSeparatorProps): react_jsx_runtime0.JSX.Element;
|
|
30
|
+
}: ButtonGroupSeparatorProps): _$react_jsx_runtime0.JSX.Element;
|
|
31
31
|
//#endregion
|
|
32
32
|
export { ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupSeparatorProps, ButtonGroupText, ButtonGroupTextProps, buttonGroupVariants };
|
|
33
33
|
//# sourceMappingURL=button-group.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Separator as t}from"./separator.js";import{Slot as n}from"radix-ui";import{jsx as r}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";const a=i(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function ButtonGroup({className:t,orientation:n,...i}){return r(`div`,{"data-slot":`button-group`,"data-orientation":n,className:e(a({orientation:n}),t),...i})}function ButtonGroupText({className:t,asChild:i=!1,...a}){return r(i?n.Root:`div`,{className:e(`flex items-center gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,t),...a})}function ButtonGroupSeparator({className:n,orientation:i=`vertical`,...a}){return r(t,{"data-slot":`button-group-separator`,orientation:i,className:e(`relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto`,n),...a})}export{ButtonGroup,ButtonGroupSeparator,ButtonGroupText,a as buttonGroupVariants};
|
|
2
2
|
//# sourceMappingURL=button-group.js.map
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
6
|
|
|
7
7
|
//#region src/components/button.d.ts
|
|
8
8
|
declare const buttonVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
variant?: "destructive" | "outline" | "ghost" | "link" | "solid" | "subtle" | null | undefined;
|
|
10
|
+
color?: "brand" | "zinc" | "red" | "blue" | "indigo" | "pink" | "green" | null | undefined;
|
|
11
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
12
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
12
13
|
type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
13
14
|
asChild?: boolean;
|
|
14
15
|
};
|
|
15
16
|
declare function Button({
|
|
16
17
|
className,
|
|
17
18
|
variant,
|
|
19
|
+
color,
|
|
18
20
|
size,
|
|
19
21
|
asChild,
|
|
20
22
|
...props
|
|
21
|
-
}: ButtonProps): react_jsx_runtime0.JSX.Element;
|
|
23
|
+
}: ButtonProps): _$react_jsx_runtime0.JSX.Element;
|
|
22
24
|
//#endregion
|
|
23
25
|
export { Button, ButtonProps, buttonVariants };
|
|
24
26
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{buttonColorVariants as t}from"../lib/button.js";import{Slot as n}from"radix-ui";import{jsx as r}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";const a=i(`focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none`,{variants:{variant:{solid:`bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover)`,outline:`border-(--button-outline-border) bg-background text-(--button-outline-foreground) hover:bg-(--button-outline-hover) hover:text-(--button-outline-foreground) aria-expanded:bg-(--button-outline-hover) aria-expanded:text-(--button-outline-foreground)`,subtle:`bg-(--button-soft) text-(--button-soft-foreground) hover:bg-(--button-soft-hover) hover:text-(--button-soft-foreground) aria-expanded:bg-(--button-soft-hover) aria-expanded:text-(--button-soft-foreground)`,ghost:`text-(--button-ghost-foreground) hover:bg-(--button-ghost-hover) hover:text-(--button-ghost-foreground) aria-expanded:bg-(--button-ghost-hover) aria-expanded:text-(--button-ghost-foreground)`,destructive:`bg-(--button-accent) text-(--button-accent-foreground) hover:bg-(--button-accent-hover) hover:text-(--button-accent-foreground)`,link:`text-(--button-link-foreground) underline-offset-4 hover:underline`},color:t,size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`solid`,color:`brand`,size:`default`}});function Button({className:t,variant:i=`solid`,color:o=`brand`,size:s=`default`,asChild:c=!1,...l}){return r(c?n.Root:`button`,{"data-slot":`button`,"data-variant":i,"data-color":o,"data-size":s,className:e(a({variant:i,color:o,size:s,className:t})),...l})}export{Button,a as buttonVariants};
|
|
2
2
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":[],"sources":["../../src/components/button.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nconst buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none\",\n {\n variants: {\n variant: {\n
|
|
1
|
+
{"version":3,"file":"button.js","names":[],"sources":["../../src/components/button.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { buttonColorVariants } from '../lib/button'\nimport { cn } from '../lib/utils'\n\nconst buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none\",\n {\n variants: {\n variant: {\n solid: 'bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover)',\n outline:\n 'border-(--button-outline-border) bg-background text-(--button-outline-foreground) hover:bg-(--button-outline-hover) hover:text-(--button-outline-foreground) aria-expanded:bg-(--button-outline-hover) aria-expanded:text-(--button-outline-foreground)',\n subtle:\n 'bg-(--button-soft) text-(--button-soft-foreground) hover:bg-(--button-soft-hover) hover:text-(--button-soft-foreground) aria-expanded:bg-(--button-soft-hover) aria-expanded:text-(--button-soft-foreground)',\n ghost:\n 'text-(--button-ghost-foreground) hover:bg-(--button-ghost-hover) hover:text-(--button-ghost-foreground) aria-expanded:bg-(--button-ghost-hover) aria-expanded:text-(--button-ghost-foreground)',\n destructive:\n 'bg-(--button-accent) text-(--button-accent-foreground) hover:bg-(--button-accent-hover) hover:text-(--button-accent-foreground)',\n link: 'text-(--button-link-foreground) underline-offset-4 hover:underline'\n },\n color: buttonColorVariants,\n size: {\n default: 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n xs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',\n icon: 'size-8',\n 'icon-xs':\n \"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',\n 'icon-lg': 'size-9'\n }\n },\n defaultVariants: {\n variant: 'solid',\n color: 'brand',\n size: 'default'\n }\n }\n)\n\nexport type ButtonProps = React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }\n\nfunction Button({\n className,\n variant = 'solid',\n color = 'brand',\n size = 'default',\n asChild = false,\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot.Root : 'button'\n\n return (\n <Comp\n data-slot=\"button\"\n data-variant={variant}\n data-color={color}\n data-size={size}\n className={cn(buttonVariants({ variant, color, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n"],"mappings":"gPAQA,MAAM,EAAiB,EACrB,mjBACA,CACE,SAAU,CACR,QAAS,CACP,MAAO,uFACP,QACE,0PACF,OACE,+MACF,MACE,iMACF,YACE,kIACF,KAAM,qEACP,CACD,MAAO,EACP,KAAM,CACJ,QAAS,uFACT,GAAI,gNACJ,GAAI,0NACJ,GAAI,uFACJ,KAAM,SACN,UACE,0HACF,UAAW,qFACX,UAAW,SACZ,CACF,CACD,gBAAiB,CACf,QAAS,QACT,MAAO,QACP,KAAM,UACP,CACF,CACF,CAOD,SAAS,OAAO,CACd,YACA,UAAU,QACV,QAAQ,QACR,OAAO,UACP,UAAU,GACV,GAAG,GACW,CAGd,OACE,EAHW,EAAU,EAAK,KAAO,SAGjC,CACE,YAAU,SACV,eAAc,EACd,aAAY,EACZ,YAAW,EACX,UAAW,EAAG,EAAe,CAAE,UAAS,QAAO,OAAM,YAAW,CAAC,CAAC,CAClE,GAAI,EACJ,CAAA"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
2
|
import { Button } from "./button.js";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { DateRange, DayButton, DayPicker, Locale } from "react-day-picker";
|
|
6
|
+
import * as locale from "react-day-picker/locale";
|
|
6
7
|
|
|
7
8
|
//#region src/components/calendar.d.ts
|
|
8
9
|
type CalendarProps = React.ComponentProps<typeof DayPicker> & {
|
|
9
10
|
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
10
11
|
};
|
|
11
|
-
type CalendarDayButtonProps = React.ComponentProps<typeof DayButton> & {
|
|
12
|
+
type CalendarDayButtonProps = Omit<React.ComponentProps<typeof DayButton>, 'color'> & {
|
|
12
13
|
locale?: Partial<Locale>;
|
|
13
14
|
};
|
|
14
15
|
declare function Calendar({
|
|
@@ -21,14 +22,14 @@ declare function Calendar({
|
|
|
21
22
|
formatters,
|
|
22
23
|
components,
|
|
23
24
|
...props
|
|
24
|
-
}: CalendarProps): react_jsx_runtime0.JSX.Element;
|
|
25
|
+
}: CalendarProps): _$react_jsx_runtime0.JSX.Element;
|
|
25
26
|
declare function CalendarDayButton({
|
|
26
27
|
className,
|
|
27
28
|
day,
|
|
28
29
|
modifiers,
|
|
29
30
|
locale,
|
|
30
31
|
...props
|
|
31
|
-
}: CalendarDayButtonProps): react_jsx_runtime0.JSX.Element;
|
|
32
|
+
}: CalendarDayButtonProps): _$react_jsx_runtime0.JSX.Element;
|
|
32
33
|
//#endregion
|
|
33
|
-
export { Calendar, CalendarDayButton, CalendarDayButtonProps, CalendarProps, type DateRange };
|
|
34
|
+
export { Calendar, CalendarDayButton, CalendarDayButtonProps, CalendarProps, type DateRange, locale };
|
|
34
35
|
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t,buttonVariants as n}from"./button.js";import{IconChevronDown as r,IconChevronLeft as i,IconChevronRight as a}from"@tabler/icons-react";import{jsx as o}from"react/jsx-runtime";import*as s from"react";import{DayPicker as c,getDefaultClassNames as l}from"react-day-picker";import*as u from"react-day-picker/locale";function Calendar({className:t,classNames:s,showOutsideDays:u=!0,captionLayout:d=`label`,buttonVariant:f=`ghost`,locale:p,formatters:m,components:h,...g}){let _=l();return o(c,{showOutsideDays:u,className:e(`group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:d,locale:p,formatters:{formatMonthDropdown:e=>e.toLocaleString(p?.code,{month:`short`}),...m},classNames:{root:e(`w-fit`,_.root),months:e(`relative flex flex-col gap-4 md:flex-row`,_.months),month:e(`flex w-full flex-col gap-4`,_.month),nav:e(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,_.nav),button_previous:e(n({variant:f}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,_.button_previous),button_next:e(n({variant:f}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,_.button_next),month_caption:e(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,_.month_caption),dropdowns:e(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,_.dropdowns),dropdown_root:e(`relative rounded-(--cell-radius)`,_.dropdown_root),dropdown:e(`absolute inset-0 bg-popover opacity-0`,_.dropdown),caption_label:e(`font-medium select-none`,d===`label`?`text-sm`:`flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground`,_.caption_label),table:`w-full border-collapse`,weekdays:e(`flex`,_.weekdays),weekday:e(`flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none`,_.weekday),week:e(`mt-2 flex w-full`,_.week),week_number_header:e(`w-(--cell-size) select-none`,_.week_number_header),week_number:e(`text-[0.8rem] text-muted-foreground select-none`,_.week_number),day:e(`group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)`,g.showWeekNumber?`[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)`:`[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)`,_.day),range_start:e(`relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted`,_.range_start),range_middle:e(`rounded-none`,_.range_middle),range_end:e(`relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted`,_.range_end),today:e(`rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none`,_.today),outside:e(`text-muted-foreground aria-selected:text-muted-foreground`,_.outside),disabled:e(`text-muted-foreground opacity-50`,_.disabled),hidden:e(`invisible`,_.hidden),...s},components:{Root:({className:t,rootRef:n,...r})=>o(`div`,{"data-slot":`calendar`,ref:n,className:e(t),...r}),Chevron:({className:t,orientation:n,...s})=>o(n===`left`?i:n===`right`?a:r,{className:e(`size-4`,t),...s}),DayButton:({...e})=>o(CalendarDayButton,{locale:p,...e}),WeekNumber:({children:e,...t})=>o(`td`,{...t,children:o(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:e})}),...h},...g})}function CalendarDayButton({className:n,day:r,modifiers:i,locale:a,...c}){let u=l(),d=s.useRef(null);return s.useEffect(()=>{i.focused&&d.current?.focus()},[i.focused]),o(t,{ref:d,variant:`ghost`,size:`icon`,color:`zinc`,"data-day":r.date.toLocaleDateString(a?.code),"data-selected-single":i.selected&&!i.range_start&&!i.range_end&&!i.range_middle,"data-range-start":i.range_start,"data-range-end":i.range_end,"data-range-middle":i.range_middle,className:e(`relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70`,u.day,n),...c})}export{Calendar,CalendarDayButton,u as locale};
|
|
2
2
|
//# sourceMappingURL=calendar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","names":[],"sources":["../../src/components/calendar.tsx"],"sourcesContent":["import * as React from 'react'\nimport { type DateRange, type DayButton, DayPicker, getDefaultClassNames, type Locale } from 'react-day-picker'\n\nimport { IconChevronDown, IconChevronLeft, IconChevronRight } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { Button, buttonVariants } from './button'\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>['variant']\n}\n\nexport type CalendarDayButtonProps = React.ComponentProps<typeof DayButton> & {\n locale?: Partial<Locale>\n}\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n locale,\n formatters,\n components,\n ...props\n}: CalendarProps) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n 'group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent',\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n locale={locale}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: 'short' }),\n ...formatters\n }}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn('absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1', defaultClassNames.nav),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_next\n ),\n month_caption: cn(\n 'flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)',\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n 'flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn('relative rounded-(--cell-radius)', defaultClassNames.dropdown_root),\n dropdown: cn('absolute inset-0 bg-popover opacity-0', defaultClassNames.dropdown),\n caption_label: cn(\n 'font-medium select-none',\n captionLayout === 'label'\n ? 'text-sm'\n : 'flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',\n defaultClassNames.caption_label\n ),\n table: 'w-full border-collapse',\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none',\n defaultClassNames.weekday\n ),\n week: cn('mt-2 flex w-full', defaultClassNames.week),\n week_number_header: cn('w-(--cell-size) select-none', defaultClassNames.week_number_header),\n week_number: cn('text-[0.8rem] text-muted-foreground select-none', defaultClassNames.week_number),\n day: cn(\n 'group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)',\n props.showWeekNumber\n ? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'\n : '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)',\n defaultClassNames.day\n ),\n range_start: cn(\n 'relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted',\n defaultClassNames.range_start\n ),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn(\n 'relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted',\n defaultClassNames.range_end\n ),\n today: cn(\n 'rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none',\n defaultClassNames.today\n ),\n outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),\n disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div data-slot=\"calendar\" ref={rootRef as React.Ref<HTMLDivElement>} className={cn(className)} {...props} />\n )\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === 'left') {\n return <IconChevronLeft className={cn('size-4', className)} {...props} />\n }\n\n if (orientation === 'right') {\n return <IconChevronRight className={cn('size-4', className)} {...props} />\n }\n\n return <IconChevronDown className={cn('size-4', className)} {...props} />\n },\n DayButton: ({ ...props }) => <CalendarDayButton locale={locale} {...props} />,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">{children}</div>\n </td>\n )\n },\n ...components\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({ className, day, modifiers, locale, ...props }: CalendarDayButtonProps) {\n const defaultClassNames = getDefaultClassNames()\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString(locale?.code)}\n data-selected-single={\n modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n 'relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70',\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton, type DateRange }\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"calendar.js","names":[],"sources":["../../src/components/calendar.tsx"],"sourcesContent":["import * as React from 'react'\nimport { type DateRange, type DayButton, DayPicker, getDefaultClassNames, type Locale } from 'react-day-picker'\nimport * as locale from 'react-day-picker/locale'\n\nimport { IconChevronDown, IconChevronLeft, IconChevronRight } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { Button, buttonVariants } from './button'\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>['variant']\n}\n\nexport type CalendarDayButtonProps = Omit<React.ComponentProps<typeof DayButton>, 'color'> & {\n locale?: Partial<Locale>\n}\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n locale,\n formatters,\n components,\n ...props\n}: CalendarProps) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n 'group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent',\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n locale={locale}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: 'short' }),\n ...formatters\n }}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn('absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1', defaultClassNames.nav),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_next\n ),\n month_caption: cn(\n 'flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)',\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n 'flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn('relative rounded-(--cell-radius)', defaultClassNames.dropdown_root),\n dropdown: cn('absolute inset-0 bg-popover opacity-0', defaultClassNames.dropdown),\n caption_label: cn(\n 'font-medium select-none',\n captionLayout === 'label'\n ? 'text-sm'\n : 'flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',\n defaultClassNames.caption_label\n ),\n table: 'w-full border-collapse',\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none',\n defaultClassNames.weekday\n ),\n week: cn('mt-2 flex w-full', defaultClassNames.week),\n week_number_header: cn('w-(--cell-size) select-none', defaultClassNames.week_number_header),\n week_number: cn('text-[0.8rem] text-muted-foreground select-none', defaultClassNames.week_number),\n day: cn(\n 'group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)',\n props.showWeekNumber\n ? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'\n : '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)',\n defaultClassNames.day\n ),\n range_start: cn(\n 'relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted',\n defaultClassNames.range_start\n ),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn(\n 'relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted',\n defaultClassNames.range_end\n ),\n today: cn(\n 'rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none',\n defaultClassNames.today\n ),\n outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),\n disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div data-slot=\"calendar\" ref={rootRef as React.Ref<HTMLDivElement>} className={cn(className)} {...props} />\n )\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === 'left') {\n return <IconChevronLeft className={cn('size-4', className)} {...props} />\n }\n\n if (orientation === 'right') {\n return <IconChevronRight className={cn('size-4', className)} {...props} />\n }\n\n return <IconChevronDown className={cn('size-4', className)} {...props} />\n },\n DayButton: ({ ...props }) => <CalendarDayButton locale={locale} {...props} />,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">{children}</div>\n </td>\n )\n },\n ...components\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({ className, day, modifiers, locale, ...props }: CalendarDayButtonProps) {\n const defaultClassNames = getDefaultClassNames()\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n color=\"zinc\"\n data-day={day.date.toLocaleDateString(locale?.code)}\n data-selected-single={\n modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n 'relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70',\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton, type DateRange, locale }\n"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/card.d.ts
|
|
@@ -16,31 +16,31 @@ declare function Card({
|
|
|
16
16
|
className,
|
|
17
17
|
size,
|
|
18
18
|
...props
|
|
19
|
-
}: CardProps): react_jsx_runtime0.JSX.Element;
|
|
19
|
+
}: CardProps): _$react_jsx_runtime0.JSX.Element;
|
|
20
20
|
declare function CardHeader({
|
|
21
21
|
className,
|
|
22
22
|
...props
|
|
23
|
-
}: CardHeaderProps): react_jsx_runtime0.JSX.Element;
|
|
23
|
+
}: CardHeaderProps): _$react_jsx_runtime0.JSX.Element;
|
|
24
24
|
declare function CardTitle({
|
|
25
25
|
className,
|
|
26
26
|
...props
|
|
27
|
-
}: CardTitleProps): react_jsx_runtime0.JSX.Element;
|
|
27
|
+
}: CardTitleProps): _$react_jsx_runtime0.JSX.Element;
|
|
28
28
|
declare function CardDescription({
|
|
29
29
|
className,
|
|
30
30
|
...props
|
|
31
|
-
}: CardDescriptionProps): react_jsx_runtime0.JSX.Element;
|
|
31
|
+
}: CardDescriptionProps): _$react_jsx_runtime0.JSX.Element;
|
|
32
32
|
declare function CardAction({
|
|
33
33
|
className,
|
|
34
34
|
...props
|
|
35
|
-
}: CardActionProps): react_jsx_runtime0.JSX.Element;
|
|
35
|
+
}: CardActionProps): _$react_jsx_runtime0.JSX.Element;
|
|
36
36
|
declare function CardContent({
|
|
37
37
|
className,
|
|
38
38
|
...props
|
|
39
|
-
}: CardContentProps): react_jsx_runtime0.JSX.Element;
|
|
39
|
+
}: CardContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
40
40
|
declare function CardFooter({
|
|
41
41
|
className,
|
|
42
42
|
...props
|
|
43
|
-
}: CardFooterProps): react_jsx_runtime0.JSX.Element;
|
|
43
|
+
}: CardFooterProps): _$react_jsx_runtime0.JSX.Element;
|
|
44
44
|
//#endregion
|
|
45
45
|
export { Card, CardAction, CardActionProps, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps };
|
|
46
46
|
//# sourceMappingURL=card.d.ts.map
|
package/dist/components/card.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{jsx as t}from"react/jsx-runtime";function Card({className:n,size:r=`default`,...i}){return t(`div`,{"data-slot":`card`,"data-size":r,className:e(`group/card flex flex-col gap-4 overflow-hidden rounded-xl py-4 text-sm bg-card text-card-foreground ring-foreground/10 ring-1`,`has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0`,`data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0`,`*:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,n),...i})}function CardHeader({className:n,...r}){return t(`div`,{"data-slot":`card-header`,className:e(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4`,`group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,`has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]`,n),...r})}function CardTitle({className:n,...r}){return t(`div`,{"data-slot":`card-title`,className:e(`text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,n),...r})}function CardDescription({className:n,...r}){return t(`div`,{"data-slot":`card-description`,className:e(`text-muted-foreground text-sm`,n),...r})}function CardAction({className:n,...r}){return t(`div`,{"data-slot":`card-action`,className:e(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,n),...r})}function CardContent({className:n,...r}){return t(`div`,{"data-slot":`card-content`,className:e(`px-4 group-data-[size=sm]/card:px-3`,n),...r})}function CardFooter({className:n,...r}){return t(`div`,{"data-slot":`card-footer`,className:e(`bg-muted/50 flex items-center rounded-b-xl border-t p-4`,`group-data-[size=sm]/card:p-3`,n),...r})}export{Card,CardAction,CardContent,CardDescription,CardFooter,CardHeader,CardTitle};
|
|
2
2
|
//# sourceMappingURL=card.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
2
|
import { Button } from "./button.js";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
6
6
|
|
|
@@ -36,27 +36,29 @@ declare function Carousel({
|
|
|
36
36
|
className,
|
|
37
37
|
children,
|
|
38
38
|
...props
|
|
39
|
-
}: CarouselProps): react_jsx_runtime0.JSX.Element;
|
|
39
|
+
}: CarouselProps): _$react_jsx_runtime0.JSX.Element;
|
|
40
40
|
declare function CarouselContent({
|
|
41
41
|
className,
|
|
42
42
|
...props
|
|
43
|
-
}: CarouselContentProps): react_jsx_runtime0.JSX.Element;
|
|
43
|
+
}: CarouselContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
44
44
|
declare function CarouselItem({
|
|
45
45
|
className,
|
|
46
46
|
...props
|
|
47
|
-
}: CarouselItemProps): react_jsx_runtime0.JSX.Element;
|
|
47
|
+
}: CarouselItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
48
48
|
declare function CarouselPrevious({
|
|
49
49
|
className,
|
|
50
50
|
variant,
|
|
51
51
|
size,
|
|
52
|
+
color,
|
|
52
53
|
...props
|
|
53
|
-
}: CarouselPreviousProps): react_jsx_runtime0.JSX.Element;
|
|
54
|
+
}: CarouselPreviousProps): _$react_jsx_runtime0.JSX.Element;
|
|
54
55
|
declare function CarouselNext({
|
|
55
56
|
className,
|
|
56
57
|
variant,
|
|
57
58
|
size,
|
|
59
|
+
color,
|
|
58
60
|
...props
|
|
59
|
-
}: CarouselNextProps): react_jsx_runtime0.JSX.Element;
|
|
61
|
+
}: CarouselNextProps): _$react_jsx_runtime0.JSX.Element;
|
|
60
62
|
//#endregion
|
|
61
63
|
export { Carousel, CarouselApi, CarouselContent, CarouselContentProps, CarouselItem, CarouselItemProps, CarouselNext, CarouselNextProps, CarouselPrevious, CarouselPreviousProps, CarouselProps, useCarousel };
|
|
62
64
|
//# sourceMappingURL=carousel.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{IconChevronLeft as n,IconChevronRight as r}from"@tabler/icons-react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import*as o from"react";import s from"embla-carousel-react";const c=o.createContext(null);function useCarousel(){let e=o.useContext(c);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function Carousel({orientation:t=`horizontal`,opts:n,setApi:r,plugins:a,className:l,children:u,...d}){let[f,p]=s({...n,axis:t===`horizontal`?`x`:`y`},a),[m,h]=o.useState(!1),[g,_]=o.useState(!1),v=o.useCallback(e=>{e&&(h(e.canScrollPrev()),_(e.canScrollNext()))},[]),y=o.useCallback(()=>{p?.scrollPrev()},[p]),b=o.useCallback(()=>{p?.scrollNext()},[p]),x=o.useCallback(e=>{e.key===`ArrowLeft`?(e.preventDefault(),y()):e.key===`ArrowRight`&&(e.preventDefault(),b())},[y,b]);return o.useEffect(()=>{!p||!r||r(p)},[p,r]),o.useEffect(()=>{if(p)return v(p),p.on(`reInit`,v),p.on(`select`,v),()=>{p?.off(`select`,v)}},[p,v]),i(c.Provider,{value:{carouselRef:f,api:p,opts:n,orientation:t||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:y,scrollNext:b,canScrollPrev:m,canScrollNext:g},children:i(`section`,{onKeyDownCapture:x,className:e(`relative`,l),"data-slot":`carousel`,...d,children:u})})}function CarouselContent({className:t,...n}){let{carouselRef:r,orientation:a}=useCarousel();return i(`div`,{ref:r,className:`overflow-hidden`,"data-slot":`carousel-content`,children:i(`div`,{className:e(`flex`,a===`horizontal`?`-ml-4`:`-mt-4 flex-col`,t),...n})})}function CarouselItem({className:t,...n}){let{orientation:r}=useCarousel();return i(`div`,{"data-slot":`carousel-item`,className:e(`min-w-0 shrink-0 grow-0 basis-full`,r===`horizontal`?`pl-4`:`pt-4`,t),...n})}function CarouselPrevious({className:r,variant:o=`outline`,size:s=`icon-sm`,color:c=`zinc`,...l}){let{orientation:u,scrollPrev:d,canScrollPrev:f}=useCarousel();return a(t,{"data-slot":`carousel-previous`,color:c,variant:o,size:s,className:e(`absolute touch-manipulation rounded-full`,u===`horizontal`?`top-1/2 -left-12 -translate-y-1/2`:`-top-12 left-1/2 -translate-x-1/2 rotate-90`,r),disabled:!f,onClick:d,...l,children:[i(n,{}),i(`span`,{className:`sr-only`,children:`Previous slide`})]})}function CarouselNext({className:n,variant:o=`outline`,size:s=`icon-sm`,color:c=`zinc`,...l}){let{orientation:u,scrollNext:d,canScrollNext:f}=useCarousel();return a(t,{"data-slot":`carousel-next`,color:c,variant:o,size:s,className:e(`absolute touch-manipulation rounded-full`,u===`horizontal`?`top-1/2 -right-12 -translate-y-1/2`:`-bottom-12 left-1/2 -translate-x-1/2 rotate-90`,n),disabled:!f,onClick:d,...l,children:[i(r,{}),i(`span`,{className:`sr-only`,children:`Next slide`})]})}export{Carousel,CarouselContent,CarouselItem,CarouselNext,CarouselPrevious,useCarousel};
|
|
2
2
|
//# sourceMappingURL=carousel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","names":[],"sources":["../../src/components/carousel.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconChevronLeft, IconChevronRight } from '@tabler/icons-react'\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>\ntype CarouselOptions = UseCarouselParameters[0]\ntype CarouselPlugin = UseCarouselParameters[1]\n\nexport type CarouselApi = UseEmblaCarouselType[1]\n\nexport type CarouselProps = React.ComponentProps<'div'> & {\n opts?: CarouselOptions\n plugins?: CarouselPlugin\n orientation?: 'horizontal' | 'vertical'\n setApi?: (api: CarouselApi) => void\n}\n\nexport type CarouselContentProps = React.ComponentProps<'div'>\n\nexport type CarouselItemProps = React.ComponentProps<'div'>\n\nexport type CarouselPreviousProps = React.ComponentProps<typeof Button>\n\nexport type CarouselNextProps = React.ComponentProps<typeof Button>\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0]\n api: ReturnType<typeof useEmblaCarousel>[1]\n scrollPrev: () => void\n scrollNext: () => void\n canScrollPrev: boolean\n canScrollNext: boolean\n} & CarouselProps\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null)\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext)\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />')\n }\n\n return context\n}\n\nfunction Carousel({ orientation = 'horizontal', opts, setApi, plugins, className, children, ...props }: CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y'\n },\n plugins\n )\n const [canScrollPrev, setCanScrollPrev] = React.useState(false)\n const [canScrollNext, setCanScrollNext] = React.useState(false)\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return\n setCanScrollPrev(api.canScrollPrev())\n setCanScrollNext(api.canScrollNext())\n }, [])\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev()\n }, [api])\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext()\n }, [api])\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault()\n scrollPrev()\n } else if (event.key === 'ArrowRight') {\n event.preventDefault()\n scrollNext()\n }\n },\n [scrollPrev, scrollNext]\n )\n\n React.useEffect(() => {\n if (!api || !setApi) return\n setApi(api)\n }, [api, setApi])\n\n React.useEffect(() => {\n if (!api) return\n onSelect(api)\n api.on('reInit', onSelect)\n api.on('select', onSelect)\n\n return () => {\n api?.off('select', onSelect)\n }\n }, [api, onSelect])\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext\n }}\n >\n <section onKeyDownCapture={handleKeyDown} className={cn('relative', className)} data-slot=\"carousel\" {...props}>\n {children}\n </section>\n </CarouselContext.Provider>\n )\n}\n\nfunction CarouselContent({ className, ...props }: CarouselContentProps) {\n const { carouselRef, orientation } = useCarousel()\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n )\n}\n\nfunction CarouselItem({ className, ...props }: CarouselItemProps) {\n const { orientation } = useCarousel()\n\n return (\n <div\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}\n {...props}\n />\n )\n}\n\nfunction CarouselPrevious({
|
|
1
|
+
{"version":3,"file":"carousel.js","names":[],"sources":["../../src/components/carousel.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconChevronLeft, IconChevronRight } from '@tabler/icons-react'\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>\ntype CarouselOptions = UseCarouselParameters[0]\ntype CarouselPlugin = UseCarouselParameters[1]\n\nexport type CarouselApi = UseEmblaCarouselType[1]\n\nexport type CarouselProps = React.ComponentProps<'div'> & {\n opts?: CarouselOptions\n plugins?: CarouselPlugin\n orientation?: 'horizontal' | 'vertical'\n setApi?: (api: CarouselApi) => void\n}\n\nexport type CarouselContentProps = React.ComponentProps<'div'>\n\nexport type CarouselItemProps = React.ComponentProps<'div'>\n\nexport type CarouselPreviousProps = React.ComponentProps<typeof Button>\n\nexport type CarouselNextProps = React.ComponentProps<typeof Button>\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0]\n api: ReturnType<typeof useEmblaCarousel>[1]\n scrollPrev: () => void\n scrollNext: () => void\n canScrollPrev: boolean\n canScrollNext: boolean\n} & CarouselProps\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null)\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext)\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />')\n }\n\n return context\n}\n\nfunction Carousel({ orientation = 'horizontal', opts, setApi, plugins, className, children, ...props }: CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y'\n },\n plugins\n )\n const [canScrollPrev, setCanScrollPrev] = React.useState(false)\n const [canScrollNext, setCanScrollNext] = React.useState(false)\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return\n setCanScrollPrev(api.canScrollPrev())\n setCanScrollNext(api.canScrollNext())\n }, [])\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev()\n }, [api])\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext()\n }, [api])\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault()\n scrollPrev()\n } else if (event.key === 'ArrowRight') {\n event.preventDefault()\n scrollNext()\n }\n },\n [scrollPrev, scrollNext]\n )\n\n React.useEffect(() => {\n if (!api || !setApi) return\n setApi(api)\n }, [api, setApi])\n\n React.useEffect(() => {\n if (!api) return\n onSelect(api)\n api.on('reInit', onSelect)\n api.on('select', onSelect)\n\n return () => {\n api?.off('select', onSelect)\n }\n }, [api, onSelect])\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext\n }}\n >\n <section onKeyDownCapture={handleKeyDown} className={cn('relative', className)} data-slot=\"carousel\" {...props}>\n {children}\n </section>\n </CarouselContext.Provider>\n )\n}\n\nfunction CarouselContent({ className, ...props }: CarouselContentProps) {\n const { carouselRef, orientation } = useCarousel()\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n )\n}\n\nfunction CarouselItem({ className, ...props }: CarouselItemProps) {\n const { orientation } = useCarousel()\n\n return (\n <div\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}\n {...props}\n />\n )\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'outline',\n size = 'icon-sm',\n color = 'zinc',\n ...props\n}: CarouselPreviousProps) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel()\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n color={color}\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? 'top-1/2 -left-12 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <IconChevronLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n )\n}\n\nfunction CarouselNext({\n className,\n variant = 'outline',\n size = 'icon-sm',\n color = 'zinc',\n ...props\n}: CarouselNextProps) {\n const { orientation, scrollNext, canScrollNext } = useCarousel()\n\n return (\n <Button\n data-slot=\"carousel-next\"\n color={color}\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? 'top-1/2 -right-12 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <IconChevronRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n )\n}\n\nexport { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel }\n"],"mappings":"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"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
6
|
|
|
7
7
|
//#region src/components/center.d.ts
|
|
8
8
|
declare const centerVariants: (props?: ({
|
|
9
9
|
direction?: "horizontal" | "vertical" | null | undefined;
|
|
10
|
-
size?: "xs" | "sm" | "
|
|
11
|
-
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
11
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
12
12
|
type CenterProps = React.ComponentProps<'div'> & VariantProps<typeof centerVariants>;
|
|
13
13
|
declare function Center({
|
|
14
14
|
className,
|
|
15
15
|
direction,
|
|
16
16
|
size,
|
|
17
17
|
...props
|
|
18
|
-
}: CenterProps): react_jsx_runtime0.JSX.Element;
|
|
18
|
+
}: CenterProps): _$react_jsx_runtime0.JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { Center, CenterProps, centerVariants };
|
|
21
21
|
//# sourceMappingURL=center.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";const r=n(`flex items-center justify-center`,{variants:{direction:{horizontal:`flex-row`,vertical:`flex-col`},size:{xs:`gap-1`,sm:`gap-2`,md:`gap-3`,lg:`gap-4`,xl:`gap-6`}},defaultVariants:{direction:`horizontal`,size:`md`}});function Center({className:n,direction:i=`horizontal`,size:a=`md`,...o}){return t(`div`,{"data-slot":`center`,"data-direction":i,"data-size":a,className:e(r({direction:i,size:a}),n),...o})}export{Center,r as centerVariants};
|
|
2
2
|
//# sourceMappingURL=center.js.map
|