@uselets/ui 0.6.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -25
- package/dist/cli/uselets.mjs +2 -2
- package/dist/cli/uselets.mjs.map +1 -1
- package/dist/components/alert-dialog.d.ts +5 -3
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/anchor.js +1 -1
- package/dist/components/anchor.js.map +1 -1
- package/dist/components/avatar.d.ts +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/button.d.ts +7 -3
- package/dist/components/button.js +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.d.ts +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox.d.ts +14 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/combobox.d.ts +8 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/date-range-picker.d.ts +120 -0
- package/dist/components/date-range-picker.js +2 -0
- package/dist/components/date-range-picker.js.map +1 -0
- package/dist/components/grid.d.ts +37 -0
- package/dist/components/grid.js +2 -0
- package/dist/components/grid.js.map +1 -0
- package/dist/components/group.d.ts +2 -2
- package/dist/components/group.js +1 -1
- package/dist/components/group.js.map +1 -1
- package/dist/components/heading.js +1 -1
- package/dist/components/heading.js.map +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/label.js.map +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/list.js.map +1 -1
- package/dist/components/native-select.d.ts +1 -1
- package/dist/components/native-select.js +1 -1
- package/dist/components/native-select.js.map +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/radio-group.d.ts +23 -2
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/select.d.ts +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/simple-grid.d.ts +24 -0
- package/dist/components/simple-grid.js +2 -0
- package/dist/components/simple-grid.js.map +1 -0
- package/dist/components/spinner.d.ts +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/stack.d.ts +2 -2
- package/dist/components/stack.js +1 -1
- package/dist/components/stack.js.map +1 -1
- package/dist/components/switch.d.ts +11 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/switch.js.map +1 -1
- package/dist/components/tabs.d.ts +5 -2
- package/dist/components/tabs.js +1 -1
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/text.js.map +1 -1
- package/dist/components/toggle-group.d.ts +2 -0
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.d.ts +4 -2
- package/dist/components/toggle.js +1 -1
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/visibility.d.ts +25 -0
- package/dist/components/visibility.js +2 -0
- package/dist/components/visibility.js.map +1 -0
- package/dist/hooks/use-breakpoint-value.d.ts +9 -0
- package/dist/hooks/use-breakpoint-value.js +2 -0
- package/dist/hooks/use-breakpoint-value.js.map +1 -0
- package/dist/hooks/use-breakpoint-value.spec.d.ts +1 -0
- package/dist/hooks/use-breakpoint-value.spec.js +15 -0
- package/dist/hooks/use-breakpoint-value.spec.js.map +1 -0
- package/dist/hooks/use-breakpoint.d.ts +9 -0
- package/dist/hooks/use-breakpoint.js +2 -0
- package/dist/hooks/use-breakpoint.js.map +1 -0
- package/dist/hooks/use-breakpoint.spec.d.ts +1 -0
- package/dist/hooks/use-breakpoint.spec.js +2 -0
- package/dist/hooks/use-breakpoint.spec.js.map +1 -0
- package/dist/index.d.ts +10 -4
- package/dist/index.js +1 -1
- package/dist/lib/button.d.ts +12 -8
- package/dist/lib/button.js +1 -1
- package/dist/lib/button.js.map +1 -1
- package/dist/lib/color.d.ts +20 -0
- package/dist/lib/color.js +2 -0
- package/dist/lib/color.js.map +1 -0
- package/dist/skills/uselets-ui/SKILL.md +3 -3
- package/dist/skills/uselets-ui/references/component-catalog.md +34 -4
- package/dist/skills/uselets-ui/references/package-guide.md +51 -17
- package/dist/skills/uselets-ui/scripts/print-public-api.mjs +0 -1
- package/dist/styles/base.css +13 -0
- package/dist/styles/globals.css +8 -0
- package/dist/styles/gomax.css +202 -0
- package/dist/styles/max.css +203 -0
- package/dist/styles/theme.css +195 -0
- package/dist/themes/gomax.css +3 -2
- package/dist/themes/max.css +3 -2
- package/package.json +1 -2
- package/skills/uselets-ui/SKILL.md +3 -3
- package/skills/uselets-ui/references/component-catalog.md +34 -4
- package/skills/uselets-ui/references/package-guide.md +51 -17
- package/skills/uselets-ui/scripts/print-public-api.mjs +0 -1
- package/dist/components/sheet.d.ts +0 -61
- package/dist/components/sheet.js +0 -2
- package/dist/components/sheet.js.map +0 -1
- package/dist/styles.css +0 -2
|
@@ -6,19 +6,23 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
|
|
|
6
6
|
|
|
7
7
|
//#region src/components/button.d.ts
|
|
8
8
|
declare const buttonVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
10
|
-
color?: "brand" | "zinc" | "red" | "blue" | "indigo" | "pink" | "green" | null | undefined;
|
|
11
|
-
size?: "
|
|
9
|
+
variant?: "outline" | "ghost" | "link" | "solid" | "subtle" | null | undefined;
|
|
10
|
+
color?: "primary" | "brand" | "gray" | "zinc" | "red" | "yellow" | "blue" | "indigo" | "pink" | "green" | null | undefined;
|
|
11
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "icon-xl" | null | undefined;
|
|
12
12
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
14
14
|
asChild?: boolean;
|
|
15
|
+
loading?: boolean;
|
|
15
16
|
};
|
|
16
17
|
declare function Button({
|
|
18
|
+
children,
|
|
17
19
|
className,
|
|
18
20
|
variant,
|
|
19
21
|
color,
|
|
20
22
|
size,
|
|
21
23
|
asChild,
|
|
24
|
+
disabled,
|
|
25
|
+
loading,
|
|
22
26
|
...props
|
|
23
27
|
}: ButtonProps): _$react_jsx_runtime0.JSX.Element;
|
|
24
28
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{buttonColorVariants as t}from"../lib/button.js";import{
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{buttonColorVariants as t}from"../lib/button.js";import{Spinner as n}from"./spinner.js";import{Slot as r}from"radix-ui";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";const c=s(`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 relative rounded-full 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 [&_svg]:transition-colors disabled:pointer-events-none disabled:opacity-50 disabled:data-[loading=true]:pointer-events-auto disabled:data-[loading=true]:cursor-not-allowed disabled:data-[loading=true]:opacity-100 [&_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) data-[loading=true]:hover:bg-(--button-solid)`,outline:`border-(--button-outline-border) bg-background text-(--button-outline-foreground) hover:bg-(--button-solid) hover:text-(--button-solid-foreground) hover:[&_svg]:text-(--button-solid-foreground) data-[loading=true]:hover:bg-background data-[loading=true]:hover:text-(--button-outline-foreground) aria-expanded:bg-(--button-solid) aria-expanded:text-(--button-solid-foreground) aria-expanded:[&_svg]:text-(--button-solid-foreground)`,subtle:`bg-(--button-soft) text-(--button-soft-foreground) hover:bg-(--button-soft-hover) hover:text-(--button-soft-foreground) data-[loading=true]:hover:bg-(--button-soft) data-[loading=true]: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) data-[loading=true]:hover:bg-transparent data-[loading=true]:hover:text-(--button-ghost-foreground) aria-expanded:bg-(--button-ghost-hover) aria-expanded:text-(--button-ghost-foreground)`,link:`text-(--button-link-foreground) underline-offset-4 hover:underline data-[loading=true]:hover:no-underline`},color:t,size:{xs:`h-7 gap-1 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-8 gap-1 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`,md:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,xl:`h-11 gap-2 px-3 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4`,icon:`size-9`,"icon-xs":`size-7 in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-10`,"icon-xl":`size-11`}},defaultVariants:{variant:`solid`,color:`primary`,size:`md`}});function Button({children:t,className:s,variant:l=`solid`,color:u=`primary`,size:d=`md`,asChild:f=!1,disabled:p,loading:m=!1,...h}){return a(f?r.Root:`button`,{type:f?void 0:`button`,"data-slot":`button`,"data-variant":l,"data-color":u,"data-size":d,"data-loading":m,"aria-busy":m?!0:void 0,disabled:p||m,className:e(c({variant:l,color:u,size:d,className:s})),...h,children:m&&!f?o(i,{children:[a(`span`,{className:`invisible inline-flex items-center gap-[inherit]`,children:t}),a(`span`,{className:`absolute inset-0 inline-flex items-center justify-center`,children:a(n,{})})]}):m?a(n,{}):t})}export{Button,c 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 { 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-
|
|
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'\nimport { Spinner } from './spinner'\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 relative rounded-full 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 [&_svg]:transition-colors disabled:pointer-events-none disabled:opacity-50 disabled:data-[loading=true]:pointer-events-auto disabled:data-[loading=true]:cursor-not-allowed disabled:data-[loading=true]:opacity-100 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none\",\n {\n variants: {\n variant: {\n solid:\n 'bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover) data-[loading=true]:hover:bg-(--button-solid)',\n outline:\n 'border-(--button-outline-border) bg-background text-(--button-outline-foreground) hover:bg-(--button-solid) hover:text-(--button-solid-foreground) hover:[&_svg]:text-(--button-solid-foreground) data-[loading=true]:hover:bg-background data-[loading=true]:hover:text-(--button-outline-foreground) aria-expanded:bg-(--button-solid) aria-expanded:text-(--button-solid-foreground) aria-expanded:[&_svg]:text-(--button-solid-foreground)',\n subtle:\n 'bg-(--button-soft) text-(--button-soft-foreground) hover:bg-(--button-soft-hover) hover:text-(--button-soft-foreground) data-[loading=true]:hover:bg-(--button-soft) data-[loading=true]: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) data-[loading=true]:hover:bg-transparent data-[loading=true]:hover:text-(--button-ghost-foreground) aria-expanded:bg-(--button-ghost-hover) aria-expanded:text-(--button-ghost-foreground)',\n link: 'text-(--button-link-foreground) underline-offset-4 hover:underline data-[loading=true]:hover:no-underline'\n },\n color: buttonColorVariants,\n size: {\n xs: \"h-7 gap-1 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-8 gap-1 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 md: 'h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n lg: 'h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',\n xl: 'h-11 gap-2 px-3 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4',\n icon: 'size-9',\n 'icon-xs': \"size-7 in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-8 in-data-[slot=button-group]:rounded-lg',\n 'icon-lg': 'size-10',\n 'icon-xl': 'size-11'\n }\n },\n defaultVariants: {\n variant: 'solid',\n color: 'primary',\n size: 'md'\n }\n }\n)\n\nexport type ButtonProps = React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n loading?: boolean\n }\n\nfunction Button({\n children,\n className,\n variant = 'solid',\n color = 'primary',\n size = 'md',\n asChild = false,\n disabled,\n loading = false,\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot.Root : 'button'\n const isDisabled = disabled || loading\n\n return (\n <Comp\n type={!asChild ? 'button' : undefined}\n data-slot=\"button\"\n data-variant={variant}\n data-color={color}\n data-size={size}\n data-loading={loading}\n aria-busy={loading ? true : undefined}\n disabled={isDisabled}\n className={cn(buttonVariants({ variant, color, size, className }))}\n {...props}\n >\n {loading && !asChild ? (\n <>\n <span className=\"invisible inline-flex items-center gap-[inherit]\">{children}</span>\n <span className=\"absolute inset-0 inline-flex items-center justify-center\">\n <Spinner />\n </span>\n </>\n ) : loading ? (\n <Spinner />\n ) : (\n children\n )}\n </Comp>\n )\n}\n\nexport { Button, buttonVariants }\n"],"mappings":"+SASA,MAAM,EAAiB,EACrB,kuBACA,CACE,SAAU,CACR,QAAS,CACP,MACE,qIACF,QACE,ibACF,OACE,sTACF,MACE,qSACF,KAAM,4GACP,CACD,MAAO,EACP,KAAM,CACJ,GAAI,2KACJ,GAAI,qLACJ,GAAI,8HACJ,GAAI,wFACJ,GAAI,oFACJ,KAAM,SACN,UAAW,qFACX,UAAW,gDACX,UAAW,UACX,UAAW,UACZ,CACF,CACD,gBAAiB,CACf,QAAS,QACT,MAAO,UACP,KAAM,KACP,CACF,CACF,CAQD,SAAS,OAAO,CACd,WACA,YACA,UAAU,QACV,QAAQ,UACR,OAAO,KACP,UAAU,GACV,WACA,UAAU,GACV,GAAG,GACW,CAId,OACE,EAJW,EAAU,EAAK,KAAO,SAIjC,CACE,KAAO,EAAqB,IAAA,GAAX,SACjB,YAAU,SACV,eAAc,EACd,aAAY,EACZ,YAAW,EACX,eAAc,EACd,YAAW,EAAU,GAAO,IAAA,GAC5B,SAXe,GAAY,EAY3B,UAAW,EAAG,EAAe,CAAE,UAAS,QAAO,OAAM,YAAW,CAAC,CAAC,CAClE,GAAI,WAEH,GAAW,CAAC,EACX,EAAA,EAAA,CAAA,SAAA,CACE,EAAC,OAAD,CAAM,UAAU,mDAAoD,WAAgB,CAAA,CACpF,EAAC,OAAD,CAAM,UAAU,oEACd,EAAC,EAAD,EAAW,CAAA,CACN,CAAA,CACN,CAAA,CAAA,CACD,EACF,EAAC,EAAD,EAAW,CAAA,CAEX,EAEG,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
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
|
|
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 gap-4`,_.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) text-xs font-normal text-muted-foreground select-none`,_.week_number_header),week_number:e(`text-xs font-normal tabular-nums 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-primary-50 after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950`,_.range_start),range_middle:e(`rounded-none`,_.range_middle),range_end:e(`relative isolate z-0 rounded-r-(--cell-radius) bg-primary-50 after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950`,_.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 text-xs font-normal tabular-nums`,children:e})}),...h},...g})}function CalendarDayButton({className:n,day:r,modifiers:i,locale:a,...c}){let u=l(),d=r.date.getDay()===0||r.date.getDay()===6,f=s.useRef(null);return s.useEffect(()=>{i.focused&&f.current?.focus()},[i.focused]),o(t,{ref:f,variant:`ghost`,size:`icon`,color:`zinc`,"data-day":r.date.toLocaleDateString(a?.code),"data-weekend":d,"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 text-foreground leading-none font-normal`,`hover:bg-primary-50 hover:text-foreground dark:hover:bg-primary-950 dark:hover:text-foreground`,`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-[weekend=true]:text-destructive data-[weekend=true]:hover:bg-red-50 data-[weekend=true]:hover:text-destructive dark:data-[weekend=true]:hover:bg-red-950`,`data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-primary-50 data-[range-middle=true]:text-foreground data-[range-middle=true]:hover:bg-primary-50 data-[range-middle=true]:hover:text-foreground dark:data-[range-middle=true]:bg-primary-950 dark:data-[range-middle=true]:hover:bg-primary-950`,`data-[range-middle=true]:data-[weekend=true]:text-destructive data-[range-middle=true]:data-[weekend=true]:hover:bg-red-50 data-[range-middle=true]:data-[weekend=true]:hover:text-destructive dark:data-[range-middle=true]:data-[weekend=true]:hover:bg-red-950`,`data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary-500 data-[range-end=true]:text-white data-[range-end=true]:hover:bg-primary-500 data-[range-end=true]:hover:text-white dark:data-[range-end=true]:hover:bg-primary-500`,`data-[range-end=true]:data-[weekend=true]:text-white data-[range-end=true]:data-[weekend=true]:hover:text-white`,`data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary-500 data-[range-start=true]:text-white data-[range-start=true]:hover:bg-primary-500 data-[range-start=true]:hover:text-white dark:data-[range-start=true]:hover:bg-primary-500`,`data-[range-start=true]:data-[weekend=true]:text-white data-[range-start=true]:data-[weekend=true]:hover:text-white`,`data-[selected-single=true]:bg-primary-500 data-[selected-single=true]:text-white data-[selected-single=true]:hover:bg-primary-500 data-[selected-single=true]:hover:text-white dark:data-[selected-single=true]:hover:bg-primary-500`,`data-[selected-single=true]:data-[weekend=true]:text-white data-[selected-single=true]:data-[weekend=true]:hover:text-white`,`[&>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'\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
|
+
{"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 gap-4', 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(\n 'w-(--cell-size) text-xs font-normal text-muted-foreground select-none',\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n 'text-xs font-normal tabular-nums text-muted-foreground select-none',\n defaultClassNames.week_number\n ),\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-primary-50 after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950',\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-primary-50 after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950',\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 text-xs font-normal tabular-nums\">\n {children}\n </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 const isWeekend = day.date.getDay() === 0 || day.date.getDay() === 6\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-weekend={isWeekend}\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 text-foreground leading-none font-normal',\n 'hover:bg-primary-50 hover:text-foreground dark:hover:bg-primary-950 dark:hover:text-foreground',\n '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',\n 'data-[weekend=true]:text-destructive data-[weekend=true]:hover:bg-red-50 data-[weekend=true]:hover:text-destructive dark:data-[weekend=true]:hover:bg-red-950',\n 'data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-primary-50 data-[range-middle=true]:text-foreground data-[range-middle=true]:hover:bg-primary-50 data-[range-middle=true]:hover:text-foreground dark:data-[range-middle=true]:bg-primary-950 dark:data-[range-middle=true]:hover:bg-primary-950',\n 'data-[range-middle=true]:data-[weekend=true]:text-destructive data-[range-middle=true]:data-[weekend=true]:hover:bg-red-50 data-[range-middle=true]:data-[weekend=true]:hover:text-destructive dark:data-[range-middle=true]:data-[weekend=true]:hover:bg-red-950',\n 'data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary-500 data-[range-end=true]:text-white data-[range-end=true]:hover:bg-primary-500 data-[range-end=true]:hover:text-white dark:data-[range-end=true]:hover:bg-primary-500',\n 'data-[range-end=true]:data-[weekend=true]:text-white data-[range-end=true]:data-[weekend=true]:hover:text-white',\n 'data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary-500 data-[range-start=true]:text-white data-[range-start=true]:hover:bg-primary-500 data-[range-start=true]:hover:text-white dark:data-[range-start=true]:hover:bg-primary-500',\n 'data-[range-start=true]:data-[weekend=true]:text-white data-[range-start=true]:data-[weekend=true]:hover:text-white',\n 'data-[selected-single=true]:bg-primary-500 data-[selected-single=true]:text-white data-[selected-single=true]:hover:bg-primary-500 data-[selected-single=true]:hover:text-white dark:data-[selected-single=true]:hover:bg-primary-500',\n 'data-[selected-single=true]:data-[weekend=true]:text-white data-[selected-single=true]:data-[weekend=true]:hover:text-white',\n '[&>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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"}
|
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/card.d.ts
|
|
6
6
|
type CardProps = React.ComponentProps<'div'> & {
|
|
7
|
-
size?: '
|
|
7
|
+
size?: 'sm' | 'md';
|
|
8
8
|
};
|
|
9
9
|
type CardHeaderProps = React.ComponentProps<'div'>;
|
|
10
10
|
type CardTitleProps = React.ComponentProps<'div'>;
|
package/dist/components/card.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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=`
|
|
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=`md`,...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-lg leading-snug font-bold 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","names":[],"sources":["../../src/components/card.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\n\nexport type CardProps = React.ComponentProps<'div'> & { size?: '
|
|
1
|
+
{"version":3,"file":"card.js","names":[],"sources":["../../src/components/card.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\n\nexport type CardProps = React.ComponentProps<'div'> & { size?: 'sm' | 'md' }\n\nexport type CardHeaderProps = React.ComponentProps<'div'>\n\nexport type CardTitleProps = React.ComponentProps<'div'>\n\nexport type CardDescriptionProps = React.ComponentProps<'div'>\n\nexport type CardActionProps = React.ComponentProps<'div'>\n\nexport type CardContentProps = React.ComponentProps<'div'>\n\nexport type CardFooterProps = React.ComponentProps<'div'>\n\nfunction Card({ className, size = 'md', ...props }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n data-size={size}\n className={cn(\n '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',\n 'has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0',\n 'data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0',\n '*:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardHeader({ className, ...props }: CardHeaderProps) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4',\n 'group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3',\n 'has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardTitle({ className, ...props }: CardTitleProps) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('text-lg leading-snug font-bold group-data-[size=sm]/card:text-sm', className)}\n {...props}\n />\n )\n}\n\nfunction CardDescription({ className, ...props }: CardDescriptionProps) {\n return <div data-slot=\"card-description\" className={cn('text-muted-foreground text-sm', className)} {...props} />\n}\n\nfunction CardAction({ className, ...props }: CardActionProps) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n {...props}\n />\n )\n}\n\nfunction CardContent({ className, ...props }: CardContentProps) {\n return <div data-slot=\"card-content\" className={cn('px-4 group-data-[size=sm]/card:px-3', className)} {...props} />\n}\n\nfunction CardFooter({ className, ...props }: CardFooterProps) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\n 'bg-muted/50 flex items-center rounded-b-xl border-t p-4',\n 'group-data-[size=sm]/card:p-3',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }\n"],"mappings":"0GAkBA,SAAS,KAAK,CAAE,YAAW,OAAO,KAAM,GAAG,GAAoB,CAC7D,OACE,EAAC,MAAD,CACE,YAAU,OACV,YAAW,EACX,UAAW,EACT,gIACA,+DACA,2FACA,mEACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAD,CACE,YAAU,cACV,UAAW,EACT,kGACA,6FACA,0GACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,UAAU,CAAE,YAAW,GAAG,GAAyB,CAC1D,OACE,EAAC,MAAD,CACE,YAAU,aACV,UAAW,EAAG,mEAAoE,EAAU,CAC5F,GAAI,EACJ,CAAA,CAIN,SAAS,gBAAgB,CAAE,YAAW,GAAG,GAA+B,CACtE,OAAO,EAAC,MAAD,CAAK,YAAU,mBAAmB,UAAW,EAAG,gCAAiC,EAAU,CAAE,GAAI,EAAS,CAAA,CAGnH,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAD,CACE,YAAU,cACV,UAAW,EAAG,iEAAkE,EAAU,CAC1F,GAAI,EACJ,CAAA,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OAAO,EAAC,MAAD,CAAK,YAAU,eAAe,UAAW,EAAG,sCAAuC,EAAU,CAAE,GAAI,EAAS,CAAA,CAGrH,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAD,CACE,YAAU,cACV,UAAW,EACT,0DACA,gCACA,EACD,CACD,GAAI,EACJ,CAAA"}
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
|
+
import { UIColor } from "../lib/color.js";
|
|
3
|
+
import { LabelProps } from "./label.js";
|
|
2
4
|
import { Checkbox as Checkbox$1 } from "radix-ui";
|
|
3
5
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
6
|
import { VariantProps } from "class-variance-authority";
|
|
5
7
|
import * as React from "react";
|
|
8
|
+
import { ReactNode } from "react";
|
|
6
9
|
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
7
10
|
|
|
8
11
|
//#region src/components/checkbox.d.ts
|
|
9
12
|
declare const checkboxVariants: (props?: ({
|
|
10
|
-
|
|
13
|
+
color?: "primary" | "brand" | "gray" | "zinc" | "red" | "yellow" | "blue" | "indigo" | "pink" | "green" | null | undefined;
|
|
14
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
11
15
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
12
|
-
type CheckboxProps = React.ComponentProps<typeof Checkbox$1.Root> & VariantProps<typeof checkboxVariants
|
|
16
|
+
type CheckboxProps = React.ComponentProps<typeof Checkbox$1.Root> & VariantProps<typeof checkboxVariants> & {
|
|
17
|
+
color?: UIColor;
|
|
18
|
+
label?: ReactNode;
|
|
19
|
+
labelProps?: Omit<LabelProps, 'children' | 'htmlFor'>;
|
|
20
|
+
};
|
|
13
21
|
declare function Checkbox({
|
|
14
22
|
className,
|
|
23
|
+
color,
|
|
24
|
+
id,
|
|
25
|
+
label,
|
|
26
|
+
labelProps,
|
|
15
27
|
size,
|
|
16
28
|
...props
|
|
17
29
|
}: CheckboxProps): _$react_jsx_runtime0.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{selectionControlColorVariants as t}from"../lib/color.js";import{Label as n}from"./label.js";import{IconCheck as r}from"@tabler/icons-react";import{Checkbox as i}from"radix-ui";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";import{useId as c}from"react";const l=s(`border-input dark:bg-input/30 data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground) data-checked:border-(--selection-control) aria-invalid:aria-checked:border-(--selection-control) aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex items-center justify-center border transition-colors group-has-disabled/field:opacity-50 focus-visible:ring-3 aria-invalid:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,{variants:{color:t,size:{sm:`size-3.5 rounded-[3px] [&_[data-slot=checkbox-indicator]>svg]:size-3`,md:`size-4 rounded-[4px] [&_[data-slot=checkbox-indicator]>svg]:size-3.5`,lg:`size-5 rounded-[5px] [&_[data-slot=checkbox-indicator]>svg]:size-4`}},defaultVariants:{color:`primary`,size:`md`}}),u=s(``,{variants:{size:{sm:`text-xs`,md:`text-sm`,lg:`text-xl`}},defaultVariants:{size:`md`}});function Checkbox({className:t,color:s=`primary`,id:d,label:f,labelProps:p,size:m=`md`,...h}){let g=c(),_=f!==void 0,v=d??g,{className:y,...b}=p??{},x=a(i.Root,{"data-slot":`checkbox`,"data-color":s,"data-size":m,id:_?v:d,className:e(l({color:s,size:m}),t),...h,children:a(i.Indicator,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:a(r,{})})});return _?o(`div`,{"data-slot":`checkbox-field`,className:`flex items-center gap-2`,children:[x,a(n,{...b,htmlFor:v,className:e(u({size:m}),y),children:f})]}):x}export{Checkbox};
|
|
2
2
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","names":["CheckboxPrimitive"],"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconCheck } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nconst checkboxVariants = cva(\n 'border-input dark:bg-input/30 data-checked:bg-
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":["CheckboxPrimitive","Label"],"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["import type * as React from 'react'\nimport { type ReactNode, useId } from 'react'\n\nimport { IconCheck } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui'\n\nimport type { UIColor } from '../lib/color'\nimport { selectionControlColorVariants } from '../lib/color'\nimport { cn } from '../lib/utils'\nimport { Label, type LabelProps } from './label'\n\nconst checkboxVariants = cva(\n 'border-input dark:bg-input/30 data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground) data-checked:border-(--selection-control) aria-invalid:aria-checked:border-(--selection-control) aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex items-center justify-center border transition-colors group-has-disabled/field:opacity-50 focus-visible:ring-3 aria-invalid:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50',\n {\n variants: {\n color: selectionControlColorVariants,\n size: {\n sm: 'size-3.5 rounded-[3px] [&_[data-slot=checkbox-indicator]>svg]:size-3',\n md: 'size-4 rounded-[4px] [&_[data-slot=checkbox-indicator]>svg]:size-3.5',\n lg: 'size-5 rounded-[5px] [&_[data-slot=checkbox-indicator]>svg]:size-4'\n }\n },\n defaultVariants: {\n color: 'primary',\n size: 'md'\n }\n }\n)\n\nconst checkboxLabelVariants = cva('', {\n variants: {\n size: {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-xl'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nexport type CheckboxProps = React.ComponentProps<typeof CheckboxPrimitive.Root> &\n VariantProps<typeof checkboxVariants> & {\n color?: UIColor\n label?: ReactNode\n labelProps?: Omit<LabelProps, 'children' | 'htmlFor'>\n }\n\nfunction Checkbox({ className, color = 'primary', id, label, labelProps, size = 'md', ...props }: CheckboxProps) {\n const generatedId = useId()\n const hasLabel = label !== undefined\n const resolvedId = id ?? generatedId\n const { className: labelClassName, ...labelRootProps } = labelProps ?? {}\n\n const checkbox = (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n data-color={color}\n data-size={size}\n id={hasLabel ? resolvedId : id}\n className={cn(checkboxVariants({ color, size }), className)}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <IconCheck />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n\n if (!hasLabel) {\n return checkbox\n }\n\n return (\n <div data-slot=\"checkbox-field\" className=\"flex items-center gap-2\">\n {checkbox}\n <Label {...labelRootProps} htmlFor={resolvedId} className={cn(checkboxLabelVariants({ size }), labelClassName)}>\n {label}\n </Label>\n </div>\n )\n}\n\nexport { Checkbox }\n"],"mappings":"wXAYA,MAAM,EAAmB,EACvB,0qBACA,CACE,SAAU,CACR,MAAO,EACP,KAAM,CACJ,GAAI,uEACJ,GAAI,uEACJ,GAAI,qEACL,CACF,CACD,gBAAiB,CACf,MAAO,UACP,KAAM,KACP,CACF,CACF,CAEK,EAAwB,EAAI,GAAI,CACpC,SAAU,CACR,KAAM,CACJ,GAAI,UACJ,GAAI,UACJ,GAAI,UACL,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CAAC,CASF,SAAS,SAAS,CAAE,YAAW,QAAQ,UAAW,KAAI,QAAO,aAAY,OAAO,KAAM,GAAG,GAAwB,CAC/G,IAAM,EAAc,GAAO,CACrB,EAAW,IAAU,IAAA,GACrB,EAAa,GAAM,EACnB,CAAE,UAAW,EAAgB,GAAG,GAAmB,GAAc,EAAE,CAEnE,EACJ,EAACA,EAAkB,KAAnB,CACE,YAAU,WACV,aAAY,EACZ,YAAW,EACX,GAAI,EAAW,EAAa,EAC5B,UAAW,EAAG,EAAiB,CAAE,QAAO,OAAM,CAAC,CAAE,EAAU,CAC3D,GAAI,WAEJ,EAACA,EAAkB,UAAnB,CACE,YAAU,qBACV,UAAU,kEAEV,EAAC,EAAD,EAAa,CAAA,CACe,CAAA,CACP,CAAA,CAO3B,OAJK,EAKH,EAAC,MAAD,CAAK,YAAU,iBAAiB,UAAU,mCAA1C,CACG,EACD,EAACC,EAAD,CAAO,GAAI,EAAgB,QAAS,EAAY,UAAW,EAAG,EAAsB,CAAE,OAAM,CAAC,CAAE,EAAe,UAC3G,EACK,CAAA,CACJ,GATC"}
|
|
@@ -6,9 +6,13 @@ import { Combobox as Combobox$1 } from "@base-ui/react";
|
|
|
6
6
|
//#region src/components/combobox.d.ts
|
|
7
7
|
type ComboboxProps = React.ComponentProps<typeof Combobox$1.Root>;
|
|
8
8
|
type ComboboxValueProps = Combobox$1.Value.Props;
|
|
9
|
-
type ComboboxTriggerProps = Combobox$1.Trigger.Props
|
|
9
|
+
type ComboboxTriggerProps = Combobox$1.Trigger.Props & {
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
};
|
|
10
12
|
type ComboboxClearProps = Combobox$1.Clear.Props;
|
|
11
13
|
type ComboboxInputProps = Combobox$1.Input.Props & {
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
triggerIcon?: React.ReactNode;
|
|
12
16
|
showTrigger?: boolean;
|
|
13
17
|
showClear?: boolean;
|
|
14
18
|
};
|
|
@@ -32,6 +36,7 @@ declare function ComboboxValue({
|
|
|
32
36
|
declare function ComboboxTrigger({
|
|
33
37
|
className,
|
|
34
38
|
children,
|
|
39
|
+
icon,
|
|
35
40
|
...props
|
|
36
41
|
}: ComboboxTriggerProps): _$react_jsx_runtime0.JSX.Element;
|
|
37
42
|
declare function ComboboxClear({
|
|
@@ -42,8 +47,10 @@ declare function ComboboxInput({
|
|
|
42
47
|
className,
|
|
43
48
|
children,
|
|
44
49
|
disabled,
|
|
50
|
+
icon,
|
|
45
51
|
showTrigger,
|
|
46
52
|
showClear,
|
|
53
|
+
triggerIcon,
|
|
47
54
|
...props
|
|
48
55
|
}: ComboboxInputProps): _$react_jsx_runtime0.JSX.Element;
|
|
49
56
|
declare function ComboboxContent({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{InputGroup as n,InputGroupAddon as r,InputGroupButton as i,InputGroupInput as a}from"./input-group.js";import{IconCheck as o,
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{InputGroup as n,InputGroupAddon as r,InputGroupButton as i,InputGroupInput as a}from"./input-group.js";import{IconCheck as o,IconSelector as s,IconX as c}from"@tabler/icons-react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import*as d from"react";import{Combobox as f}from"@base-ui/react";const p=f.Root;function ComboboxValue({...e}){return l(f.Value,{"data-slot":`combobox-value`,...e})}function ComboboxTrigger({className:t,children:n,icon:r=l(s,{className:`pointer-events-none size-4 text-muted-foreground`}),...i}){return u(f.Trigger,{"data-slot":`combobox-trigger`,className:e(`[&_svg:not([class*='size-'])]:size-4`,t),...i,children:[n,r]})}function ComboboxClear({className:t,...n}){return l(f.Clear,{"data-slot":`combobox-clear`,render:l(i,{variant:`ghost`,size:`icon-xs`}),className:e(t),...n,children:l(c,{className:`pointer-events-none`})})}function ComboboxInput({className:t,children:o,disabled:s=!1,icon:c,showTrigger:d=!0,showClear:p=!1,triggerIcon:m,...h}){return u(n,{className:e(`w-auto`,t),children:[c&&l(r,{align:`inline-start`,children:c}),l(f.Input,{render:l(a,{disabled:s}),...h}),u(r,{align:`inline-end`,children:[d&&l(i,{size:`icon-xs`,variant:`ghost`,asChild:!0,"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:s,children:l(ComboboxTrigger,{icon:m})}),p&&l(ComboboxClear,{disabled:s})]}),o]})}function ComboboxContent({className:t,side:n=`bottom`,sideOffset:r=6,align:i=`start`,alignOffset:a=0,anchor:o,...s}){return l(f.Portal,{children:l(f.Positioner,{side:n,sideOffset:r,align:i,alignOffset:a,anchor:o,className:`isolate z-50`,children:l(f.Popup,{"data-slot":`combobox-content`,"data-chips":!!o,className:e(`group/combobox-content max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!`,t),...s})})})}function ComboboxList({className:t,...n}){return l(f.List,{"data-slot":`combobox-list`,className:e(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,t),...n})}function ComboboxItem({className:t,children:n,...r}){return u(f.Item,{"data-slot":`combobox-item`,className:e(`relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t),...r,children:[n,l(f.ItemIndicator,{render:l(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:l(o,{className:`pointer-events-none`})})]})}function ComboboxGroup({className:t,...n}){return l(f.Group,{"data-slot":`combobox-group`,className:e(t),...n})}function ComboboxLabel({className:t,...n}){return l(f.GroupLabel,{"data-slot":`combobox-label`,className:e(`px-2 py-1.5 text-xs text-muted-foreground`,t),...n})}function ComboboxCollection({...e}){return l(f.Collection,{"data-slot":`combobox-collection`,...e})}function ComboboxEmpty({className:t,...n}){return l(f.Empty,{"data-slot":`combobox-empty`,className:e(`hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex`,t),...n})}function ComboboxSeparator({className:t,...n}){return l(f.Separator,{"data-slot":`combobox-separator`,className:e(`-mx-1 my-1 h-px bg-border`,t),...n})}function ComboboxChips({className:t,...n}){return l(f.Chips,{"data-slot":`combobox-chips`,className:e(`flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40`,t),...n})}function ComboboxChip({className:n,children:r,showRemove:i=!0,...a}){return u(f.Chip,{"data-slot":`combobox-chip`,className:e(`flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0`,n),...a,children:[r,i&&l(f.ChipRemove,{render:l(t,{variant:`ghost`,color:`zinc`,size:`icon-xs`}),className:`-ml-1 opacity-50 hover:opacity-100`,"data-slot":`combobox-chip-remove`,children:l(c,{className:`pointer-events-none`})})]})}function ComboboxChipsInput({className:t,...n}){return l(f.Input,{"data-slot":`combobox-chip-input`,className:e(`min-w-16 flex-1 outline-none`,t),...n})}function useComboboxAnchor(){return d.useRef(null)}export{p as Combobox,ComboboxChip,ComboboxChips,ComboboxChipsInput,ComboboxClear,ComboboxCollection,ComboboxContent,ComboboxEmpty,ComboboxGroup,ComboboxInput,ComboboxItem,ComboboxLabel,ComboboxList,ComboboxSeparator,ComboboxTrigger,ComboboxValue,useComboboxAnchor};
|
|
2
2
|
//# sourceMappingURL=combobox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.js","names":["ComboboxPrimitive"],"sources":["../../src/components/combobox.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react'\nimport { IconCheck, IconChevronDown, IconX } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group'\n\nexport type ComboboxProps = React.ComponentProps<typeof ComboboxPrimitive.Root>\n\nexport type ComboboxValueProps = ComboboxPrimitive.Value.Props\n\nexport type ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props\n\nexport type ComboboxClearProps = ComboboxPrimitive.Clear.Props\n\nexport type ComboboxInputProps = ComboboxPrimitive.Input.Props & {\n showTrigger?: boolean\n showClear?: boolean\n}\n\nexport type ComboboxContentProps = ComboboxPrimitive.Popup.Props &\n Pick<ComboboxPrimitive.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'>\n\nexport type ComboboxListProps = ComboboxPrimitive.List.Props\n\nexport type ComboboxItemProps = ComboboxPrimitive.Item.Props\n\nexport type ComboboxGroupProps = ComboboxPrimitive.Group.Props\n\nexport type ComboboxLabelProps = ComboboxPrimitive.GroupLabel.Props\n\nexport type ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\n\nexport type ComboboxEmptyProps = ComboboxPrimitive.Empty.Props\n\nexport type ComboboxSeparatorProps = ComboboxPrimitive.Separator.Props\n\nexport type ComboboxChipsProps = React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &\n ComboboxPrimitive.Chips.Props\n\nexport type ComboboxChipProps = ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean\n}\n\nexport type ComboboxChipsInputProps = ComboboxPrimitive.Input.Props\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxValueProps) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />\n}\n\nfunction ComboboxTrigger({ className, children, ...props }: ComboboxTriggerProps) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className={cn(\"[&_svg:not([class*='size-'])]:size-4\", className)}\n {...props}\n >\n {children}\n <IconChevronDown className=\"pointer-events-none size-4 text-muted-foreground\" />\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxClearProps) {\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={<InputGroupButton variant=\"ghost\" size=\"icon-xs\" />}\n className={cn(className)}\n {...props}\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n showTrigger = true,\n showClear = false,\n ...props\n}: ComboboxInputProps) {\n return (\n <InputGroup className={cn('w-auto', className)}>\n <ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"ghost\"\n asChild\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n >\n <ComboboxTrigger />\n </InputGroupButton>\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n side = 'bottom',\n sideOffset = 6,\n align = 'start',\n alignOffset = 0,\n anchor,\n ...props\n}: ComboboxContentProps) {\n return (\n <ComboboxPrimitive.Portal>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n 'group/combobox-content max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!',\n className\n )}\n {...props}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxListProps) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n 'no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxItem({ className, children, ...props }: ComboboxItemProps) {\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={cn(\n \"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={<span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />}\n >\n <IconCheck className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxGroupProps) {\n return <ComboboxPrimitive.Group data-slot=\"combobox-group\" className={cn(className)} {...props} />\n}\n\nfunction ComboboxLabel({ className, ...props }: ComboboxLabelProps) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxCollectionProps) {\n return <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n 'hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({ className, ...props }: ComboboxSeparatorProps) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxChips({ className, ...props }: ComboboxChipsProps) {\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={cn(\n 'flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxChip({ className, children, showRemove = true, ...props }: ComboboxChipProps) {\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={cn(\n 'flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0',\n className\n )}\n {...props}\n >\n {children}\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"ghost\" color=\"zinc\" size=\"icon-xs\" />}\n className=\"-ml-1 opacity-50 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({ className, ...props }: ComboboxChipsInputProps) {\n return (\n <ComboboxPrimitive.Input\n data-slot=\"combobox-chip-input\"\n className={cn('min-w-16 flex-1 outline-none', className)}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxChip,\n ComboboxChips,\n ComboboxChipsInput,\n ComboboxClear,\n ComboboxCollection,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxInput,\n ComboboxItem,\n ComboboxLabel,\n ComboboxList,\n ComboboxSeparator,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"combobox.js","names":["ComboboxPrimitive"],"sources":["../../src/components/combobox.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react'\nimport { IconCheck, IconSelector, IconX } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group'\n\nexport type ComboboxProps = React.ComponentProps<typeof ComboboxPrimitive.Root>\n\nexport type ComboboxValueProps = ComboboxPrimitive.Value.Props\n\nexport type ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props & {\n icon?: React.ReactNode\n}\n\nexport type ComboboxClearProps = ComboboxPrimitive.Clear.Props\n\nexport type ComboboxInputProps = ComboboxPrimitive.Input.Props & {\n icon?: React.ReactNode\n triggerIcon?: React.ReactNode\n showTrigger?: boolean\n showClear?: boolean\n}\n\nexport type ComboboxContentProps = ComboboxPrimitive.Popup.Props &\n Pick<ComboboxPrimitive.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'>\n\nexport type ComboboxListProps = ComboboxPrimitive.List.Props\n\nexport type ComboboxItemProps = ComboboxPrimitive.Item.Props\n\nexport type ComboboxGroupProps = ComboboxPrimitive.Group.Props\n\nexport type ComboboxLabelProps = ComboboxPrimitive.GroupLabel.Props\n\nexport type ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\n\nexport type ComboboxEmptyProps = ComboboxPrimitive.Empty.Props\n\nexport type ComboboxSeparatorProps = ComboboxPrimitive.Separator.Props\n\nexport type ComboboxChipsProps = React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &\n ComboboxPrimitive.Chips.Props\n\nexport type ComboboxChipProps = ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean\n}\n\nexport type ComboboxChipsInputProps = ComboboxPrimitive.Input.Props\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxValueProps) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />\n}\n\nfunction ComboboxTrigger({\n className,\n children,\n icon = <IconSelector className=\"pointer-events-none size-4 text-muted-foreground\" />,\n ...props\n}: ComboboxTriggerProps) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className={cn(\"[&_svg:not([class*='size-'])]:size-4\", className)}\n {...props}\n >\n {children}\n {icon}\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxClearProps) {\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={<InputGroupButton variant=\"ghost\" size=\"icon-xs\" />}\n className={cn(className)}\n {...props}\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n icon,\n showTrigger = true,\n showClear = false,\n triggerIcon,\n ...props\n}: ComboboxInputProps) {\n return (\n <InputGroup className={cn('w-auto', className)}>\n {icon && <InputGroupAddon align=\"inline-start\">{icon}</InputGroupAddon>}\n <ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"ghost\"\n asChild\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n >\n <ComboboxTrigger icon={triggerIcon} />\n </InputGroupButton>\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n side = 'bottom',\n sideOffset = 6,\n align = 'start',\n alignOffset = 0,\n anchor,\n ...props\n}: ComboboxContentProps) {\n return (\n <ComboboxPrimitive.Portal>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n 'group/combobox-content max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!',\n className\n )}\n {...props}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxListProps) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n 'no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxItem({ className, children, ...props }: ComboboxItemProps) {\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={cn(\n \"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={<span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />}\n >\n <IconCheck className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxGroupProps) {\n return <ComboboxPrimitive.Group data-slot=\"combobox-group\" className={cn(className)} {...props} />\n}\n\nfunction ComboboxLabel({ className, ...props }: ComboboxLabelProps) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxCollectionProps) {\n return <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n 'hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({ className, ...props }: ComboboxSeparatorProps) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxChips({ className, ...props }: ComboboxChipsProps) {\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={cn(\n 'flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxChip({ className, children, showRemove = true, ...props }: ComboboxChipProps) {\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={cn(\n 'flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0',\n className\n )}\n {...props}\n >\n {children}\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"ghost\" color=\"zinc\" size=\"icon-xs\" />}\n className=\"-ml-1 opacity-50 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({ className, ...props }: ComboboxChipsInputProps) {\n return (\n <ComboboxPrimitive.Input\n data-slot=\"combobox-chip-input\"\n className={cn('min-w-16 flex-1 outline-none', className)}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxChip,\n ComboboxChips,\n ComboboxChipsInput,\n ComboboxClear,\n ComboboxCollection,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxInput,\n ComboboxItem,\n ComboboxLabel,\n ComboboxList,\n ComboboxSeparator,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
|
+
import { Button } from "./button.js";
|
|
3
|
+
import { Calendar, DateRange } from "./calendar.js";
|
|
4
|
+
import { Popover, PopoverContent } from "./popover.js";
|
|
5
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { Locale } from "react-day-picker";
|
|
8
|
+
|
|
9
|
+
//#region src/components/date-range-picker.d.ts
|
|
10
|
+
type DateRangePickerPresetOption = {
|
|
11
|
+
label: string;
|
|
12
|
+
getRange: () => DateRange;
|
|
13
|
+
};
|
|
14
|
+
type DateRangePickerProps = Omit<React.ComponentProps<typeof Popover>, 'open' | 'defaultOpen' | 'onOpenChange'> & {
|
|
15
|
+
value?: DateRange | null;
|
|
16
|
+
defaultValue?: DateRange | null;
|
|
17
|
+
onValueChange?: (range: DateRange | null) => void;
|
|
18
|
+
onApply?: (range: DateRange | null) => void;
|
|
19
|
+
onReset?: () => void;
|
|
20
|
+
open?: boolean;
|
|
21
|
+
defaultOpen?: boolean;
|
|
22
|
+
onOpenChange?: (open: boolean) => void;
|
|
23
|
+
locale?: Partial<Locale>;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
};
|
|
26
|
+
type DateRangePickerTriggerProps = React.ComponentProps<typeof Button> & {
|
|
27
|
+
asChild?: boolean;
|
|
28
|
+
};
|
|
29
|
+
type DateRangePickerValueProps = React.ComponentProps<'span'> & {
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
};
|
|
32
|
+
type DateRangePickerContentProps = React.ComponentProps<typeof PopoverContent>;
|
|
33
|
+
type DateRangePickerPresetsProps = React.ComponentProps<'div'> & {
|
|
34
|
+
presets?: DateRangePickerPresetOption[];
|
|
35
|
+
};
|
|
36
|
+
type DateRangePickerPresetProps = React.ComponentProps<'button'> & {
|
|
37
|
+
selected?: boolean;
|
|
38
|
+
};
|
|
39
|
+
type DateRangePickerCalendarProps = Omit<React.ComponentProps<typeof Calendar>, 'mode' | 'numberOfMonths' | 'selected' | 'onSelect' | 'month' | 'defaultMonth'>;
|
|
40
|
+
type DateRangePickerDateFieldsProps = React.ComponentProps<'div'>;
|
|
41
|
+
type DateRangePickerActionsProps = React.ComponentProps<'div'>;
|
|
42
|
+
type DateRangePickerApplyProps = React.ComponentProps<typeof Button>;
|
|
43
|
+
type DateRangePickerResetProps = React.ComponentProps<typeof Button>;
|
|
44
|
+
declare function DateRangePicker({
|
|
45
|
+
value: valueProp,
|
|
46
|
+
defaultValue,
|
|
47
|
+
onValueChange,
|
|
48
|
+
onApply,
|
|
49
|
+
onReset,
|
|
50
|
+
open: openProp,
|
|
51
|
+
defaultOpen,
|
|
52
|
+
onOpenChange,
|
|
53
|
+
locale,
|
|
54
|
+
placeholder,
|
|
55
|
+
children,
|
|
56
|
+
...props
|
|
57
|
+
}: DateRangePickerProps): _$react_jsx_runtime0.JSX.Element;
|
|
58
|
+
declare function DateRangePickerTrigger({
|
|
59
|
+
className,
|
|
60
|
+
children,
|
|
61
|
+
asChild,
|
|
62
|
+
variant,
|
|
63
|
+
color,
|
|
64
|
+
type,
|
|
65
|
+
...props
|
|
66
|
+
}: DateRangePickerTriggerProps): _$react_jsx_runtime0.JSX.Element;
|
|
67
|
+
declare function DateRangePickerValue({
|
|
68
|
+
className,
|
|
69
|
+
placeholder,
|
|
70
|
+
...props
|
|
71
|
+
}: DateRangePickerValueProps): _$react_jsx_runtime0.JSX.Element;
|
|
72
|
+
declare function DateRangePickerContent({
|
|
73
|
+
className,
|
|
74
|
+
align,
|
|
75
|
+
sideOffset,
|
|
76
|
+
children,
|
|
77
|
+
...props
|
|
78
|
+
}: DateRangePickerContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
79
|
+
declare function DateRangePickerPresets({
|
|
80
|
+
className,
|
|
81
|
+
presets,
|
|
82
|
+
...props
|
|
83
|
+
}: DateRangePickerPresetsProps): _$react_jsx_runtime0.JSX.Element;
|
|
84
|
+
declare function DateRangePickerPreset({
|
|
85
|
+
className,
|
|
86
|
+
selected,
|
|
87
|
+
...props
|
|
88
|
+
}: DateRangePickerPresetProps): _$react_jsx_runtime0.JSX.Element;
|
|
89
|
+
declare function DateRangePickerCalendar({
|
|
90
|
+
className,
|
|
91
|
+
showOutsideDays,
|
|
92
|
+
onMonthChange,
|
|
93
|
+
...props
|
|
94
|
+
}: DateRangePickerCalendarProps): _$react_jsx_runtime0.JSX.Element;
|
|
95
|
+
declare function DateRangePickerDateFields({
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}: DateRangePickerDateFieldsProps): _$react_jsx_runtime0.JSX.Element;
|
|
99
|
+
declare function DateRangePickerActions({
|
|
100
|
+
className,
|
|
101
|
+
children,
|
|
102
|
+
...props
|
|
103
|
+
}: DateRangePickerActionsProps): _$react_jsx_runtime0.JSX.Element;
|
|
104
|
+
declare function DateRangePickerApply({
|
|
105
|
+
children,
|
|
106
|
+
onClick,
|
|
107
|
+
className,
|
|
108
|
+
...props
|
|
109
|
+
}: DateRangePickerApplyProps): _$react_jsx_runtime0.JSX.Element;
|
|
110
|
+
declare function DateRangePickerReset({
|
|
111
|
+
children,
|
|
112
|
+
onClick,
|
|
113
|
+
variant,
|
|
114
|
+
color,
|
|
115
|
+
className,
|
|
116
|
+
...props
|
|
117
|
+
}: DateRangePickerResetProps): _$react_jsx_runtime0.JSX.Element;
|
|
118
|
+
//#endregion
|
|
119
|
+
export { type DateRange, DateRangePicker, DateRangePickerActions, DateRangePickerActionsProps, DateRangePickerApply, DateRangePickerApplyProps, DateRangePickerCalendar, DateRangePickerCalendarProps, DateRangePickerContent, DateRangePickerContentProps, DateRangePickerDateFields, DateRangePickerDateFieldsProps, DateRangePickerPreset, DateRangePickerPresetOption, DateRangePickerPresetProps, DateRangePickerPresets, DateRangePickerPresetsProps, DateRangePickerProps, DateRangePickerReset, DateRangePickerResetProps, DateRangePickerTrigger, DateRangePickerTriggerProps, DateRangePickerValue, DateRangePickerValueProps };
|
|
120
|
+
//# sourceMappingURL=date-range-picker.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{Calendar as n}from"./calendar.js";import{Input as r}from"./input.js";import{Popover as i,PopoverContent as a,PopoverTrigger as o}from"./popover.js";import{IconArrowRight as s,IconCalendar as c,IconChevronDown as l}from"@tabler/icons-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import*as p from"react";const m=p.createContext(null),h=[{label:`Hoje`,getRange:()=>{let e=startOfDay(new Date);return{from:e,to:e}}},{label:`Ontem`,getRange:()=>{let e=addDays(startOfDay(new Date),-1);return{from:e,to:e}}},{label:`Últimos 7 dias`,getRange:()=>{let e=startOfDay(new Date);return{from:addDays(e,-7),to:e}}},{label:`Últimos 15 dias`,getRange:()=>{let e=startOfDay(new Date);return{from:addDays(e,-15),to:e}}},{label:`Últimos 30 dias`,getRange:()=>{let e=startOfDay(new Date);return{from:addDays(e,-30),to:e}}},{label:`Últimos 60 dias`,getRange:()=>{let e=startOfDay(new Date);return{from:addDays(e,-60),to:e}}},{label:`Últimos 90 dias`,getRange:()=>{let e=startOfDay(new Date);return{from:addDays(e,-90),to:e}}},{label:`Semana passada`,getRange:()=>{let e=addDays(startOfWeek(new Date),-7);return{from:e,to:addDays(e,6)}}},{label:`Este mês`,getRange:()=>{let e=startOfDay(new Date);return{from:startOfMonth(e),to:e}}},{label:`Mês passado`,getRange:()=>{let e=new Date(new Date().getFullYear(),new Date().getMonth()-1,1);return{from:startOfMonth(e),to:endOfMonth(e)}}}];function DateRangePicker({value:e,defaultValue:t=null,onValueChange:n,onApply:r,onReset:a,open:o,defaultOpen:s=!1,onOpenChange:c,locale:l,placeholder:h=`Selecione um período`,children:g,..._}){let[v,y]=p.useState(t),[b,x]=p.useState(s),S=e!==void 0,C=o!==void 0,w=S?e??null:v,T=C?o:b,[E,D]=p.useState(()=>toDraft(w)),[O,k]=p.useState(()=>getRangeMonth(toDraft(w))),A=p.useCallback(e=>{let t=normalizeDraft(e);D(t);let n=getRangeMonth(t);n&&k(n)},[]),j=p.useCallback(e=>{S||y(e),n?.(e)},[S,n]),M=p.useCallback(e=>{if(e){let e=toDraft(w);D(e),k(getRangeMonth(e))}C||x(e),c?.(e)},[C,c,w]),N=p.useCallback(()=>{let e=toValue(E);j(e),r?.(e),M(!1)},[j,E,r,M]),P=p.useCallback(()=>{D(void 0),j(null),a?.(),M(!1)},[j,a,M]),F=p.useMemo(()=>({value:w,draft:E,month:O,locale:l,placeholder:h,setDraft:A,setMonth:k,apply:N,reset:P}),[N,E,l,O,h,P,A,w]);return d(m.Provider,{value:F,children:d(i,{open:T,onOpenChange:M,..._,children:g??f(u,{children:[d(DateRangePickerTrigger,{}),f(DateRangePickerContent,{children:[d(DateRangePickerPresets,{}),d(DateRangePickerDateFields,{}),d(DateRangePickerCalendar,{}),d(DateRangePickerActions,{})]})]})})})}function DateRangePickerTrigger({className:n,children:r,asChild:i=!1,variant:a=`outline`,color:s=`zinc`,type:p=`button`,...m}){return i?d(o,{asChild:!0,children:r}):d(o,{asChild:!0,children:d(t,{type:p,variant:a,color:s,className:e(`min-w-64 justify-between font-normal`,n),...m,children:r??f(u,{children:[d(c,{"data-icon":`inline-start`,className:`size-4 text-muted-foreground`}),d(DateRangePickerValue,{className:`flex-1 text-left`}),d(l,{"data-icon":`inline-end`,className:`size-4 text-muted-foreground`})]})})})}function DateRangePickerValue({className:t,placeholder:n,...r}){let{value:i,locale:a,placeholder:o}=useDateRangePicker();return d(`span`,{"data-slot":`date-range-picker-value`,className:e(`truncate`,t),...r,children:formatRange(i,a,n??o)})}function DateRangePickerContent({className:t,align:n=`start`,sideOffset:r=8,children:i,...o}){let s=p.Children.toArray(i),c=s.filter(isDateRangePickerPresetsElement),l=s.filter(e=>!isDateRangePickerPresetsElement(e));return d(a,{align:n,sideOffset:r,className:e(`w-[calc(100vw---spacing(4))] max-w-2xl p-2`,t),...o,children:f(`div`,{"data-slot":`date-range-picker-content`,className:`grid gap-3 md:grid-cols-[10rem_minmax(0,1fr)]`,children:[c,d(`div`,{className:`flex min-w-0 flex-col gap-3`,children:l})]})})}function DateRangePickerPresets({className:t,presets:n=h,...r}){let{draft:i,setDraft:a}=useDateRangePicker(),o=getRelativeDaysValue(i,`today`),s=getRelativeDaysValue(i,`yesterday`);return f(`div`,{"data-slot":`date-range-picker-presets`,className:e(`hidden flex-col border-border pr-3 md:flex md:border-r`,t),...r,children:[n.map(e=>{let t=e.getRange();return d(DateRangePickerPreset,{type:`button`,selected:isSameRange(i,t),onClick:()=>a(t),children:e.label},e.label)}),f(`div`,{className:`my-3 flex flex-col gap-2`,children:[d(DateRangePickerRelativeField,{label:`Dias até hoje`,value:o,onValueChange:e=>a(getRelativeDaysRange(e,`today`))}),d(DateRangePickerRelativeField,{label:`Dias até ontem`,value:s,onValueChange:e=>a(getRelativeDaysRange(e,`yesterday`))})]})]})}function DateRangePickerPreset({className:t,selected:n=!1,...r}){return d(`button`,{"data-slot":`date-range-picker-preset`,"data-selected":n,className:e(`flex h-8.5 w-full items-center border-l-3 border-border bg-transparent px-2 text-left text-sm text-foreground transition-colors outline-none`,`hover:border-primary hover:bg-primary-50 hover:text-primary-700 dark:hover:bg-primary-950 dark:hover:text-primary-300`,`focus-visible:border-primary focus-visible:ring-3 focus-visible:ring-ring/50`,`data-[selected=true]:border-primary data-[selected=true]:bg-primary-50 data-[selected=true]:text-primary-700 dark:data-[selected=true]:bg-primary-950 dark:data-[selected=true]:text-primary-300`,t),"aria-pressed":n,...r})}function DateRangePickerRelativeField({label:e,value:t,onValueChange:n}){let i=p.useId(),[a,o]=p.useState(()=>formatRelativeInputValue(t));return p.useEffect(()=>{o(formatRelativeInputValue(t))},[t]),f(`div`,{className:`flex items-center gap-2 text-sm text-foreground`,children:[d(r,{id:i,type:`number`,name:e,min:1,step:1,value:a,className:`h-7 w-9 rounded-md px-1 text-center [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none`,"aria-label":e,onChange:e=>{let t=e.target.value;if(o(t),t===``)return;let r=parsePositiveInteger(t);r&&n(r)}}),d(`label`,{htmlFor:i,children:e})]})}function DateRangePickerCalendar({className:t,showOutsideDays:r=!1,onMonthChange:i,...a}){let{draft:o,locale:s,month:c,setDraft:l,setMonth:u}=useDateRangePicker();return d(n,{mode:`range`,numberOfMonths:2,showOutsideDays:r,month:c,onMonthChange:e=>{u(e),i?.(e)},selected:o,onSelect:l,locale:s,className:e(`mx-auto bg-transparent p-0`,t),...a})}function DateRangePickerDateFields({className:t,...n}){let{draft:i,setDraft:a}=useDateRangePicker();return f(`div`,{"data-slot":`date-range-picker-date-fields`,className:e(`pb-2 border-b flex justify-between gap-2 flex-wrap flex-col sm:flex-row sm:items-center`,t),...n,children:[d(r,{type:`date`,value:formatInputDate(i?.from),className:`sm:w-max`,onChange:e=>{if(e.target.value===``){a(void 0);return}let t=parseInputDate(e.target.value);t&&a(normalizeDraft({from:t,to:i?.to}))}}),d(s,{className:`size-4 text-primary hidden sm:block`}),d(r,{type:`date`,value:formatInputDate(i?.to),className:`sm:w-max`,onChange:e=>{if(e.target.value===``){a(void 0);return}let t=parseInputDate(e.target.value);t&&a(normalizeDraft({from:i?.from,to:t}))}})]})}function DateRangePickerActions({className:t,children:n,...r}){return d(`div`,{"data-slot":`date-range-picker-actions`,className:e(`flex items-center gap-2 mt-auto`,t),...r,children:n??f(u,{children:[d(DateRangePickerReset,{}),d(DateRangePickerApply,{})]})})}function DateRangePickerApply({children:n=`Aplicar`,onClick:r,className:i,...a}){let{apply:o}=useDateRangePicker();return d(t,{size:`sm`,className:e(`flex-1`,i),onClick:e=>{r?.(e),e.defaultPrevented||o()},...a,children:n})}function DateRangePickerReset({children:n=`Resetar`,onClick:r,variant:i=`outline`,color:a=`zinc`,className:o,...s}){let{reset:c}=useDateRangePicker();return d(t,{size:`sm`,className:e(`flex-1`,o),variant:i,color:a,onClick:e=>{r?.(e),e.defaultPrevented||c()},...s,children:n})}function useDateRangePicker(){let e=p.useContext(m);if(!e)throw Error(`DateRangePicker components must be used within DateRangePicker.`);return e}function isDateRangePickerPresetsElement(e){return p.isValidElement(e)&&e.type===DateRangePickerPresets}function toDraft(e){return normalizeDraft(e??void 0)}function toValue(e){return normalizeDraft(e)??null}function getRangeMonth(e){return startOfDay(e?.from??e?.to??new Date)}function normalizeDraft(e){if(!(!e?.from&&!e?.to))return e.from&&e.to&&e.from>e.to?{from:startOfDay(e.to),to:startOfDay(e.from)}:{from:e.from?startOfDay(e.from):void 0,to:e.to?startOfDay(e.to):void 0}}function formatRange(e,t,n){return!e?.from&&!e?.to?n:e.from&&e.to?`${formatDisplayDate(e.from,t)} - ${formatDisplayDate(e.to,t)}`:formatDisplayDate(e.from??e.to,t)}function formatDisplayDate(e,t){return e?new Intl.DateTimeFormat(t?.code??`pt-BR`,{day:`2-digit`,month:`2-digit`,year:`numeric`}).format(e):``}function formatInputDate(e){return e?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`:``}function parseInputDate(e){if(!e)return;let t=/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/.exec(e);if(!t?.groups)return;let n=Number(t.groups.year),r=Number(t.groups.month),i=Number(t.groups.day),a=new Date(n,r-1,i);if(!(a.getFullYear()!==n||a.getMonth()!==r-1||a.getDate()!==i))return a}function parsePositiveInteger(e){if(!e)return;let t=Number(e);if(!(!Number.isInteger(t)||t<1))return t}function formatRelativeInputValue(e){return e?String(e):``}function getRelativeDaysRange(e,t){let n=startOfDay(new Date),r=t===`today`?addDays(n,-1):addDays(n,-2);return{from:addDays(r,-e+1),to:r}}function getRelativeDaysValue(e,t){if(!e?.from||!e.to)return;let n=startOfDay(new Date),r=t===`today`?addDays(n,-1):addDays(n,-2);if(!isSameDay(e.to,r))return;let i=differenceInCalendarDays(r,startOfDay(e.from))+1;return i>0?i:void 0}function isSameRange(e,t){return isSameDay(e?.from,t?.from)&&isSameDay(e?.to,t?.to)}function isSameDay(e,t){return!e||!t?e===t:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function startOfDay(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function startOfWeek(e){let t=startOfDay(e);return addDays(t,-t.getDay())}function startOfMonth(e){return new Date(e.getFullYear(),e.getMonth(),1)}function endOfMonth(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function differenceInCalendarDays(e,t){return Math.round((startOfDay(e).getTime()-startOfDay(t).getTime())/(1440*60*1e3))}function addDays(e,t){let n=startOfDay(e);return n.setDate(n.getDate()+t),n}export{DateRangePicker,DateRangePickerActions,DateRangePickerApply,DateRangePickerCalendar,DateRangePickerContent,DateRangePickerDateFields,DateRangePickerPreset,DateRangePickerPresets,DateRangePickerReset,DateRangePickerTrigger,DateRangePickerValue};
|
|
2
|
+
//# sourceMappingURL=date-range-picker.js.map
|