@arolariu/components 0.2.0 → 0.3.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/changelog.md +11 -0
- package/dist/components/ui/accordion.d.ts +4 -4
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +19 -27
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +17 -11
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +38 -61
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts +4 -5
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +17 -20
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/aspect-ratio.d.ts +1 -2
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui/aspect-ratio.js +1 -8
- package/dist/components/ui/aspect-ratio.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +3 -3
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +16 -19
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +3 -3
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +7 -10
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +16 -8
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +28 -35
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/button-group.d.ts +13 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +47 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +3 -2
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +15 -14
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +20 -20
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.d.ts +7 -8
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +31 -44
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.d.ts +5 -6
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +30 -21
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.d.ts +35 -27
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +28 -26
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +10 -12
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/collapsible.d.ts +3 -4
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +3 -20
- package/dist/components/ui/collapsible.js.map +1 -1
- package/dist/components/ui/command.d.ts +78 -16
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +47 -72
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +21 -19
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +57 -101
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +16 -12
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +36 -64
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts +19 -10
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +32 -57
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +21 -19
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +64 -108
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdrawer.d.ts +1 -1
- package/dist/components/ui/dropdrawer.d.ts.map +1 -1
- package/dist/components/ui/dropdrawer.js +2 -5
- package/dist/components/ui/dropdrawer.js.map +1 -1
- package/dist/components/ui/empty.d.ts +13 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +65 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +135 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/form.d.ts +5 -6
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +28 -27
- package/dist/components/ui/form.js.map +1 -1
- package/dist/components/ui/hover-card.d.ts +3 -3
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/hover-card.js +11 -25
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +91 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +30 -7
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js +23 -26
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +6 -7
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +122 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +5 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +21 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +2 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +8 -7
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.d.ts +18 -16
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +73 -93
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +8 -10
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +37 -55
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.d.ts +24 -9
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +33 -45
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.d.ts +4 -4
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +9 -25
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +1 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +5 -7
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +16 -19
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.d.ts +20 -5
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +9 -21
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +2 -2
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +12 -16
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select.d.ts +10 -12
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +54 -77
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.d.ts +1 -1
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +6 -7
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.d.ts +23 -11
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +54 -66
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +34 -38
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +113 -122
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +1 -2
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.d.ts +1 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +11 -30
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/sonner.d.ts +4 -2
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +7 -4
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +16 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +7 -9
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts +8 -8
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +36 -45
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +4 -4
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +17 -26
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.d.ts +1 -1
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +6 -7
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +8 -3
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +11 -15
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.d.ts +4 -1
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +7 -8
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +4 -4
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +13 -38
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/ui/typewriter.d.ts.map +1 -1
- package/dist/components/ui/typewriter.js +2 -6
- package/dist/components/ui/typewriter.js.map +1 -1
- package/dist/index.css +839 -1126
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -3
- package/package.json +37 -2
- package/src/components/ui/accordion.tsx +43 -44
- package/src/components/ui/alert-dialog.tsx +88 -99
- package/src/components/ui/alert.tsx +23 -25
- package/src/components/ui/aspect-ratio.tsx +1 -9
- package/src/components/ui/avatar.tsx +29 -24
- package/src/components/ui/badge.tsx +8 -16
- package/src/components/ui/breadcrumb.tsx +70 -73
- package/src/components/ui/button-group.tsx +69 -0
- package/src/components/ui/button.tsx +18 -24
- package/src/components/ui/calendar.tsx +20 -22
- package/src/components/ui/card.tsx +52 -71
- package/src/components/ui/carousel.tsx +145 -133
- package/src/components/ui/chart.tsx +173 -183
- package/src/components/ui/checkbox.tsx +18 -18
- package/src/components/ui/collapsible.tsx +3 -25
- package/src/components/ui/command.tsx +100 -99
- package/src/components/ui/context-menu.tsx +150 -193
- package/src/components/ui/dialog.tsx +75 -110
- package/src/components/ui/drawer.tsx +74 -102
- package/src/components/ui/dropdown-menu.tsx +153 -200
- package/src/components/ui/dropdrawer.tsx +0 -5
- package/src/components/ui/empty.tsx +86 -0
- package/src/components/ui/field.tsx +198 -0
- package/src/components/ui/form.tsx +47 -48
- package/src/components/ui/hover-card.tsx +18 -37
- package/src/components/ui/input-group.tsx +145 -0
- package/src/components/ui/input-otp.tsx +49 -59
- package/src/components/ui/input.tsx +5 -6
- package/src/components/ui/item.tsx +163 -0
- package/src/components/ui/kbd.tsx +31 -0
- package/src/components/ui/label.tsx +14 -12
- package/src/components/ui/menubar.tsx +178 -201
- package/src/components/ui/navigation-menu.tsx +85 -100
- package/src/components/ui/pagination.tsx +74 -85
- package/src/components/ui/popover.tsx +19 -38
- package/src/components/ui/progress.tsx +15 -14
- package/src/components/ui/radio-group.tsx +19 -13
- package/src/components/ui/resizable.tsx +23 -37
- package/src/components/ui/scroll-area.tsx +32 -35
- package/src/components/ui/select.tsx +112 -127
- package/src/components/ui/separator.tsx +17 -19
- package/src/components/ui/sheet.tsx +87 -108
- package/src/components/ui/sidebar.tsx +262 -271
- package/src/components/ui/skeleton.tsx +2 -3
- package/src/components/ui/slider.tsx +10 -36
- package/src/components/ui/sonner.tsx +15 -9
- package/src/components/ui/spinner.tsx +18 -0
- package/src/components/ui/switch.tsx +18 -17
- package/src/components/ui/table.tsx +66 -71
- package/src/components/ui/tabs.tsx +36 -36
- package/src/components/ui/textarea.tsx +5 -4
- package/src/components/ui/toggle-group.tsx +21 -34
- package/src/components/ui/toggle.tsx +14 -16
- package/src/components/ui/tooltip.tsx +19 -43
- package/src/components/ui/typewriter.tsx +3 -4
- package/src/index.css +6 -6
- package/src/index.ts +43 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\ui\\calendar.js","sources":["webpack://@arolariu/components/./src/components/ui/calendar.tsx"],"sourcesContent":["\r\n\r\n/* eslint-disable */\r\n\r\nimport {ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon} from \"lucide-react\";\r\nimport * as React from \"react\";\r\nimport {DayButton, DayPicker, getDefaultClassNames} from \"react-day-picker\";\r\n\r\nimport {Button, buttonVariants} from \"@/components/ui/button\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nfunction Calendar({\r\n className,\r\n classNames,\r\n showOutsideDays = true,\r\n captionLayout = \"label\",\r\n buttonVariant = \"ghost\",\r\n formatters,\r\n components,\r\n ...props\r\n}: React.ComponentProps<typeof DayPicker> & {\r\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"];\r\n}) {\r\n const defaultClassNames = getDefaultClassNames();\r\n\r\n return (\r\n <DayPicker\r\n showOutsideDays={showOutsideDays}\r\n className={cn(\r\n \"group/calendar bg-white p-3 [--cell-size:--spacing(8)] dark:bg-neutral-950 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent\",\r\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\r\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\r\n className,\r\n )}\r\n captionLayout={captionLayout}\r\n formatters={{\r\n formatMonthDropdown: (date) => date.toLocaleString(\"default\", {month: \"short\"}),\r\n ...formatters,\r\n }}\r\n classNames={{\r\n root: cn(\"w-fit\", defaultClassNames.root),\r\n months: cn(\"flex gap-4 flex-col md:flex-row relative\", defaultClassNames.months),\r\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\r\n nav: cn(\"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\", defaultClassNames.nav),\r\n button_previous: cn(\r\n buttonVariants({variant: buttonVariant}),\r\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\r\n defaultClassNames.button_previous,\r\n ),\r\n button_next: cn(\r\n buttonVariants({variant: buttonVariant}),\r\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\r\n defaultClassNames.button_next,\r\n ),\r\n month_caption: cn(\"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)\", defaultClassNames.month_caption),\r\n dropdowns: cn(\"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5\", defaultClassNames.dropdowns),\r\n dropdown_root: cn(\r\n \"relative has-focus:border-neutral-950 border border-neutral-200 shadow-xs has-focus:ring-neutral-950/50 has-focus:ring-[3px] rounded-md dark:has-focus:border-neutral-300 dark:border-neutral-800 dark:has-focus:ring-neutral-300/50\",\r\n defaultClassNames.dropdown_root,\r\n ),\r\n dropdown: cn(\"absolute bg-white inset-0 opacity-0 dark:bg-neutral-950\", defaultClassNames.dropdown),\r\n caption_label: cn(\r\n \"select-none font-medium\",\r\n captionLayout === \"label\"\r\n ? \"text-sm\"\r\n : \"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-neutral-500 [&>svg]:size-3.5 dark:[&>svg]:text-neutral-400\",\r\n defaultClassNames.caption_label,\r\n ),\r\n table: \"w-full border-collapse\",\r\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\r\n weekday: cn(\r\n \"text-neutral-500 rounded-md flex-1 font-normal text-[0.8rem] select-none dark:text-neutral-400\",\r\n defaultClassNames.weekday,\r\n ),\r\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\r\n week_number_header: cn(\"select-none w-(--cell-size)\", defaultClassNames.week_number_header),\r\n week_number: cn(\"text-[0.8rem] select-none text-neutral-500 dark:text-neutral-400\", defaultClassNames.week_number),\r\n day: cn(\r\n \"relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none\",\r\n defaultClassNames.day,\r\n ),\r\n range_start: cn(\"rounded-l-md bg-neutral-100 dark:bg-neutral-800\", defaultClassNames.range_start),\r\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\r\n range_end: cn(\"rounded-r-md bg-neutral-100 dark:bg-neutral-800\", defaultClassNames.range_end),\r\n today: cn(\r\n \"bg-neutral-100 text-neutral-900 rounded-md data-[selected=true]:rounded-none dark:bg-neutral-800 dark:text-neutral-50\",\r\n defaultClassNames.today,\r\n ),\r\n outside: cn(\r\n \"text-neutral-500 aria-selected:text-neutral-500 dark:text-neutral-400 dark:aria-selected:text-neutral-400\",\r\n defaultClassNames.outside,\r\n ),\r\n disabled: cn(\"text-neutral-500 opacity-50 dark:text-neutral-400\", defaultClassNames.disabled),\r\n hidden: cn(\"invisible\", defaultClassNames.hidden),\r\n ...classNames,\r\n }}\r\n components={{\r\n Root: ({className, rootRef, ...props}) => {\r\n return (\r\n <div\r\n data-slot='calendar'\r\n ref={rootRef}\r\n className={cn(className)}\r\n {...props}\r\n />\r\n );\r\n },\r\n Chevron: ({className, orientation, ...props}) => {\r\n if (orientation === \"left\") {\r\n return (\r\n <ChevronLeftIcon\r\n className={cn(\"size-4\", className)}\r\n {...props}\r\n />\r\n );\r\n }\r\n\r\n if (orientation === \"right\") {\r\n return (\r\n <ChevronRightIcon\r\n className={cn(\"size-4\", className)}\r\n {...props}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n <ChevronDownIcon\r\n className={cn(\"size-4\", className)}\r\n {...props}\r\n />\r\n );\r\n },\r\n DayButton: CalendarDayButton,\r\n WeekNumber: ({children, ...props}) => {\r\n return (\r\n <td {...props}>\r\n <div className='flex size-(--cell-size) items-center justify-center text-center'>{children}</div>\r\n </td>\r\n );\r\n },\r\n ...components,\r\n }}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction CalendarDayButton({className, day, modifiers, ...props}: React.ComponentProps<typeof DayButton>) {\r\n const defaultClassNames = getDefaultClassNames();\r\n\r\n const ref = React.useRef<HTMLButtonElement>(null);\r\n React.useEffect(() => {\r\n if (modifiers[\"focused\"]) ref.current?.focus();\r\n }, [modifiers[\"focused\"]]);\r\n\r\n return (\r\n <Button\r\n ref={ref}\r\n variant='ghost'\r\n size='icon'\r\n data-day={day.date.toLocaleDateString()}\r\n data-selected-single={modifiers[\"selected\"] && !modifiers[\"range_start\"] && !modifiers[\"range_end\"] && !modifiers[\"range_middle\"]}\r\n data-range-start={modifiers[\"range_start\"]}\r\n data-range-end={modifiers[\"range_end\"]}\r\n data-range-middle={modifiers[\"range_middle\"]}\r\n className={cn(\r\n \"group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-neutral-900 data-[range-end=true]:text-neutral-50 data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-neutral-100 data-[range-middle=true]:text-neutral-900 data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-neutral-900 data-[range-start=true]:text-neutral-50 data-[selected-single=true]:bg-neutral-900 data-[selected-single=true]:text-neutral-50 dark:dark:hover:text-neutral-50 dark:hover:text-neutral-900 dark:data-[range-end=true]:bg-neutral-50 dark:data-[range-end=true]:text-neutral-900 dark:data-[range-middle=true]:bg-neutral-800 dark:data-[range-middle=true]:text-neutral-50 dark:data-[range-start=true]:bg-neutral-50 dark:data-[range-start=true]:text-neutral-900 dark:data-[selected-single=true]:bg-neutral-50 dark:data-[selected-single=true]:text-neutral-900 [&>span]:text-xs [&>span]:opacity-70\",\r\n defaultClassNames.day,\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport {Calendar, CalendarDayButton};\r\n"],"names":["Calendar","className","classNames","showOutsideDays","captionLayout","buttonVariant","formatters","components","props","defaultClassNames","getDefaultClassNames","DayPicker","cn","String","date","buttonVariants","rootRef","orientation","ChevronLeftIcon","ChevronRightIcon","ChevronDownIcon","CalendarDayButton","children","day","modifiers","ref","React","Button"],"mappings":";;;;;;;AAWA,SAASA,SAAS,EAChBC,SAAS,EACTC,UAAU,EACVC,kBAAkB,IAAI,EACtBC,gBAAgB,OAAO,EACvBC,gBAAgB,OAAO,EACvBC,UAAU,EACVC,UAAU,EACV,GAAGC,OAGJ;IACC,MAAMC,oBAAoBC;IAE1B,OAAO,WAAP,GACE,IAACC,WAASA;QACR,iBAAiBR;QACjB,WAAWS,GACT,yKACAC,OAAO,GAAG,CAAC,yCAAyC,CAAC,EAC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AAS,CAAC,cAAc,IAAI,CAACA,SAAS,CAAC,YAAY,IAAI,CAACA,SAAS,CAAC,eAAe;QACjI,oBAAkBA,SAAS,CAAC,cAAc;QAC1C,kBAAgBA,SAAS,CAAC,YAAY;QACtC,qBAAmBA,SAAS,CAAC,eAAe;QAC5C,WAAWZ,GACT,2uCACAH,kBAAkB,GAAG,EACrBR;QAED,GAAGO,KAAK;;AAGf"}
|
|
1
|
+
{"version":3,"file":"components\\ui\\calendar.js","sources":["webpack://@arolariu/components/./src/components/ui/calendar.tsx"],"sourcesContent":["\r\n\r\nimport {ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon} from \"lucide-react\";\r\nimport * as React from \"react\";\r\nimport {DayButton, DayPicker, getDefaultClassNames} from \"react-day-picker\";\r\n\r\nimport {Button, buttonVariants} from \"@/components/ui/button\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nfunction Calendar({\r\n className,\r\n classNames,\r\n showOutsideDays = true,\r\n captionLayout = \"label\",\r\n buttonVariant = \"ghost\",\r\n formatters,\r\n components,\r\n ...props\r\n}: React.ComponentProps<typeof DayPicker> & {\r\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"];\r\n}) {\r\n const defaultClassNames = getDefaultClassNames();\r\n\r\n return (\r\n <DayPicker\r\n showOutsideDays={showOutsideDays}\r\n className={cn(\r\n \"group/calendar bg-white p-3 [--cell-size:2rem] dark:bg-neutral-950 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent\",\r\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\r\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\r\n className,\r\n )}\r\n captionLayout={captionLayout}\r\n formatters={{\r\n formatMonthDropdown: (date) => date.toLocaleString(\"default\", {month: \"short\"}),\r\n ...formatters,\r\n }}\r\n classNames={{\r\n root: cn(\"w-fit\", defaultClassNames.root),\r\n months: cn(\"relative flex flex-col gap-4 md:flex-row\", defaultClassNames.months),\r\n month: cn(\"flex w-full flex-col gap-4\", defaultClassNames.month),\r\n nav: cn(\"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1\", defaultClassNames.nav),\r\n button_previous: cn(\r\n buttonVariants({variant: buttonVariant}),\r\n \"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50\",\r\n defaultClassNames.button_previous,\r\n ),\r\n button_next: cn(\r\n buttonVariants({variant: buttonVariant}),\r\n \"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50\",\r\n defaultClassNames.button_next,\r\n ),\r\n month_caption: cn(\"flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]\", defaultClassNames.month_caption),\r\n dropdowns: cn(\"flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium\", defaultClassNames.dropdowns),\r\n dropdown_root: cn(\r\n \"has-focus:border-neutral-950 border-neutral-200 shadow-xs has-focus:ring-neutral-950/50 has-focus:ring-[3px] relative rounded-md border dark:has-focus:border-neutral-300 dark:border-neutral-800 dark:has-focus:ring-neutral-300/50\",\r\n defaultClassNames.dropdown_root,\r\n ),\r\n dropdown: cn(\"bg-white absolute inset-0 opacity-0 dark:bg-neutral-950\", defaultClassNames.dropdown),\r\n caption_label: cn(\r\n \"select-none font-medium\",\r\n captionLayout === \"label\"\r\n ? \"text-sm\"\r\n : \"[&>svg]:text-neutral-500 flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5 dark:[&>svg]:text-neutral-400\",\r\n defaultClassNames.caption_label,\r\n ),\r\n table: \"w-full border-collapse\",\r\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\r\n weekday: cn(\r\n \"text-neutral-500 flex-1 select-none rounded-md text-[0.8rem] font-normal dark:text-neutral-400\",\r\n defaultClassNames.weekday,\r\n ),\r\n week: cn(\"mt-2 flex w-full\", defaultClassNames.week),\r\n week_number_header: cn(\"w-[--cell-size] select-none\", defaultClassNames.week_number_header),\r\n week_number: cn(\"text-neutral-500 select-none text-[0.8rem] dark:text-neutral-400\", defaultClassNames.week_number),\r\n day: cn(\r\n \"group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md\",\r\n defaultClassNames.day,\r\n ),\r\n range_start: cn(\"bg-neutral-100 rounded-l-md dark:bg-neutral-800\", defaultClassNames.range_start),\r\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\r\n range_end: cn(\"bg-neutral-100 rounded-r-md dark:bg-neutral-800\", defaultClassNames.range_end),\r\n today: cn(\r\n \"bg-neutral-100 text-neutral-900 rounded-md data-[selected=true]:rounded-none dark:bg-neutral-800 dark:text-neutral-50\",\r\n defaultClassNames.today,\r\n ),\r\n outside: cn(\r\n \"text-neutral-500 aria-selected:text-neutral-500 dark:text-neutral-400 dark:aria-selected:text-neutral-400\",\r\n defaultClassNames.outside,\r\n ),\r\n disabled: cn(\"text-neutral-500 opacity-50 dark:text-neutral-400\", defaultClassNames.disabled),\r\n hidden: cn(\"invisible\", defaultClassNames.hidden),\r\n ...classNames,\r\n }}\r\n components={{\r\n Root: ({className, rootRef, ...props}) => {\r\n return (\r\n <div\r\n data-slot='calendar'\r\n ref={rootRef}\r\n className={cn(className)}\r\n {...props}\r\n />\r\n );\r\n },\r\n Chevron: ({className, orientation, ...props}) => {\r\n if (orientation === \"left\") {\r\n return (\r\n <ChevronLeftIcon\r\n className={cn(\"size-4\", className)}\r\n {...props}\r\n />\r\n );\r\n }\r\n\r\n if (orientation === \"right\") {\r\n return (\r\n <ChevronRightIcon\r\n className={cn(\"size-4\", className)}\r\n {...props}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n <ChevronDownIcon\r\n className={cn(\"size-4\", className)}\r\n {...props}\r\n />\r\n );\r\n },\r\n DayButton: CalendarDayButton,\r\n WeekNumber: ({children, ...props}) => {\r\n return (\r\n <td {...props}>\r\n <div className='flex size-[--cell-size] items-center justify-center text-center'>{children}</div>\r\n </td>\r\n );\r\n },\r\n ...components,\r\n }}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction CalendarDayButton({className, day, modifiers, ...props}: React.ComponentProps<typeof DayButton>) {\r\n const defaultClassNames = getDefaultClassNames();\r\n\r\n const ref = React.useRef<HTMLButtonElement>(null);\r\n React.useEffect(() => {\r\n if (modifiers[\"focused\"]) ref.current?.focus();\r\n }, [modifiers[\"focused\"]]);\r\n\r\n return (\r\n <Button\r\n ref={ref}\r\n variant='ghost'\r\n size='icon'\r\n data-day={day.date.toLocaleDateString()}\r\n data-selected-single={modifiers[\"selected\"] && !modifiers[\"range_start\"] && !modifiers[\"range_end\"] && !modifiers[\"range_middle\"]}\r\n data-range-start={modifiers[\"range_start\"]}\r\n data-range-end={modifiers[\"range_end\"]}\r\n data-range-middle={modifiers[\"range_middle\"]}\r\n className={cn(\r\n \"group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:bg-neutral-900 data-[range-end=true]:text-neutral-50 data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-neutral-100 data-[range-middle=true]:text-neutral-900 data-[range-start=true]:rounded-md data-[range-start=true]:bg-neutral-900 data-[range-start=true]:text-neutral-50 data-[selected-single=true]:bg-neutral-900 data-[selected-single=true]:text-neutral-50 dark:data-[range-end=true]:bg-neutral-50 dark:data-[range-end=true]:text-neutral-900 dark:data-[range-middle=true]:bg-neutral-800 dark:data-[range-middle=true]:text-neutral-50 dark:data-[range-start=true]:bg-neutral-50 dark:data-[range-start=true]:text-neutral-900 dark:data-[selected-single=true]:bg-neutral-50 dark:data-[selected-single=true]:text-neutral-900 [&>span]:text-xs [&>span]:opacity-70\",\r\n defaultClassNames.day,\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport {Calendar, CalendarDayButton};\r\n"],"names":["Calendar","className","classNames","showOutsideDays","captionLayout","buttonVariant","formatters","components","props","defaultClassNames","getDefaultClassNames","DayPicker","cn","String","date","buttonVariants","rootRef","orientation","ChevronLeftIcon","ChevronRightIcon","ChevronDownIcon","CalendarDayButton","children","day","modifiers","ref","React","Button"],"mappings":";;;;;;;AASA,SAASA,SAAS,EAChBC,SAAS,EACTC,UAAU,EACVC,kBAAkB,IAAI,EACtBC,gBAAgB,OAAO,EACvBC,gBAAgB,OAAO,EACvBC,UAAU,EACVC,UAAU,EACV,GAAGC,OAGJ;IACC,MAAMC,oBAAoBC;IAE1B,OAAO,WAAP,GACE,IAACC,WAASA;QACR,iBAAiBR;QACjB,WAAWS,GACT,iKACAC,OAAO,GAAG,CAAC,yCAAyC,CAAC,EACrDA,OAAO,GAAG,CAAC,6CAA6C,CAAC,EACzDZ;QAEF,eAAeG;QACf,YAAY;YACV,qBAAqB,CAACU,OAASA,KAAK,cAAc,CAAC,WAAW;oBAAC,OAAO;gBAAO;YAC7E,GAAGR,UAAU;QACf;QACA,YAAY;YACV,MAAMM,GAAG,SAASH,kBAAkB,IAAI;YACxC,QAAQG,GAAG,4CAA4CH,kBAAkB,MAAM;YAC/E,OAAOG,GAAG,8BAA8BH,kBAAkB,KAAK;YAC/D,KAAKG,GAAG,2EAA2EH,kBAAkB,GAAG;YACxG,iBAAiBG,GACfG,eAAe;gBAAC,SAASV;YAAa,IACtC,4EACAI,kBAAkB,eAAe;YAEnC,aAAaG,GACXG,eAAe;gBAAC,SAASV;YAAa,IACtC,4EACAI,kBAAkB,WAAW;YAE/B,eAAeG,GAAG,4EAA4EH,kBAAkB,aAAa;YAC7H,WAAWG,GAAG,uFAAuFH,kBAAkB,SAAS;YAChI,eAAeG,GACb,wOACAH,kBAAkB,aAAa;YAEjC,UAAUG,GAAG,2DAA2DH,kBAAkB,QAAQ;YAClG,eAAeG,GACb,2BACAR,YAAAA,gBACI,Y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E,IAAC;oBAAI,GAAGA,KAAK;8BACX,kBAAC;wBAAI,WAAU;kCAAmEc;;;YAIxF,GAAGf,UAAU;QACf;QACC,GAAGC,KAAK;;AAGf;AAEA,SAASa,kBAAkB,EAACpB,SAAS,EAAEsB,GAAG,EAAEC,SAAS,EAAE,GAAGhB,OAA8C;IACtG,MAAMC,oBAAoBC;IAE1B,MAAMe,MAAMC,OAAgC;IAC5CA,UAAgB;QACd,IAAIF,SAAS,CAAC,UAAU,EAAEC,IAAI,OAAO,EAAE;IACzC,GAAG;QAACD,SAAS,CAAC,UAAU;KAAC;IAEzB,OAAO,WAAP,GACE,IAACG,QAAMA;QACL,KAAKF;QACL,SAAQ;QACR,MAAK;QACL,YAAUF,IAAI,IAAI,CAAC,kBAAkB;QACrC,wBAAsBC,SAAS,CAAC,WAAW,IAAI,CAACA,SAAS,CAAC,cAAc,IAAI,CAACA,SAAS,CAAC,YAAY,IAAI,CAACA,SAAS,CAAC,eAAe;QACjI,oBAAkBA,SAAS,CAAC,cAAc;QAC1C,kBAAgBA,SAAS,CAAC,YAAY;QACtC,qBAAmBA,SAAS,CAAC,eAAe;QAC5C,WAAWZ,GACT,omCACAH,kBAAkB,GAAG,EACrBR;QAED,GAAGO,KAAK;;AAGf"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare
|
|
3
|
-
declare
|
|
4
|
-
declare
|
|
5
|
-
declare
|
|
6
|
-
declare
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
10
9
|
//# sourceMappingURL=card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,IAAI,6GASR,CAAC;AAGH,QAAA,MAAM,UAAU,6GAMd,CAAC;AAGH,QAAA,MAAM,SAAS,6GAMb,CAAC;AAGH,QAAA,MAAM,eAAe,6GAMnB,CAAC;AAGH,QAAA,MAAM,WAAW,6GAMf,CAAC;AAGH,QAAA,MAAM,UAAU,6GAMd,CAAC;AAGH,OAAO,EAAC,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC,CAAC"}
|
|
@@ -1,56 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import "react";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
4
|
import { cn } from "../../lib/utilities.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
className: cn("flex flex-col gap-6 rounded-xl border border-neutral-200 bg-white py-6 text-neutral-950 shadow-sm dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50", className),
|
|
5
|
+
const Card = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
6
|
+
ref: ref,
|
|
7
|
+
className: cn("rounded-xl border border-neutral-200 bg-white text-neutral-950 shadow dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50", className),
|
|
9
8
|
...props
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
|
|
9
|
+
}));
|
|
10
|
+
Card.displayName = "Card";
|
|
11
|
+
const CardHeader = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
12
|
+
ref: ref,
|
|
13
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
16
14
|
...props
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
className: cn("leading-none font-semibold", className),
|
|
15
|
+
}));
|
|
16
|
+
CardHeader.displayName = "CardHeader";
|
|
17
|
+
const CardTitle = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
18
|
+
ref: ref,
|
|
19
|
+
className: cn("leading-none font-semibold tracking-tight", className),
|
|
23
20
|
...props
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"data-slot": "card-description",
|
|
21
|
+
}));
|
|
22
|
+
CardTitle.displayName = "CardTitle";
|
|
23
|
+
const CardDescription = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
24
|
+
ref: ref,
|
|
29
25
|
className: cn("text-sm text-neutral-500 dark:text-neutral-400", className),
|
|
30
26
|
...props
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
|
|
27
|
+
}));
|
|
28
|
+
CardDescription.displayName = "CardDescription";
|
|
29
|
+
const CardContent = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
30
|
+
ref: ref,
|
|
31
|
+
className: cn("p-6 pt-0", className),
|
|
37
32
|
...props
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
className: cn("px-6", className),
|
|
33
|
+
}));
|
|
34
|
+
CardContent.displayName = "CardContent";
|
|
35
|
+
const CardFooter = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
36
|
+
ref: ref,
|
|
37
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
44
38
|
...props
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return /*#__PURE__*/ jsx("div", {
|
|
49
|
-
"data-slot": "card-footer",
|
|
50
|
-
className: cn("flex items-center px-6 [.border-t]:pt-6", className),
|
|
51
|
-
...props
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
39
|
+
}));
|
|
40
|
+
CardFooter.displayName = "CardFooter";
|
|
41
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
55
42
|
|
|
56
43
|
//# sourceMappingURL=card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\ui\\card.js","sources":["webpack://@arolariu/components/./src/components/ui/card.tsx"],"sourcesContent":["\r\n\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\
|
|
1
|
+
{"version":3,"file":"components\\ui\\card.js","sources":["webpack://@arolariu/components/./src/components/ui/card.tsx"],"sourcesContent":["\r\n\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n className={cn(\r\n \"rounded-xl border border-neutral-200 bg-white text-neutral-950 shadow dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nCard.displayName = \"Card\";\r\n\r\nconst CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n className={cn(\"flex flex-col space-y-1.5 p-6\", className)}\r\n {...props}\r\n />\r\n));\r\nCardHeader.displayName = \"CardHeader\";\r\n\r\nconst CardTitle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n className={cn(\"leading-none font-semibold tracking-tight\", className)}\r\n {...props}\r\n />\r\n));\r\nCardTitle.displayName = \"CardTitle\";\r\n\r\nconst CardDescription = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n className={cn(\"text-sm text-neutral-500 dark:text-neutral-400\", className)}\r\n {...props}\r\n />\r\n));\r\nCardDescription.displayName = \"CardDescription\";\r\n\r\nconst CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n className={cn(\"p-6 pt-0\", className)}\r\n {...props}\r\n />\r\n));\r\nCardContent.displayName = \"CardContent\";\r\n\r\nconst CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n className={cn(\"flex items-center p-6 pt-0\", className)}\r\n {...props}\r\n />\r\n));\r\nCardFooter.displayName = \"CardFooter\";\r\n\r\nexport {Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle};\r\n"],"names":["Card","React","className","props","ref","cn","CardHeader","CardTitle","CardDescription","CardContent","CardFooter"],"mappings":";;;;AAMA,MAAMA,OAAO,WAAPA,GAAOC,WAAuE,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GAC1G,IAAC;QACC,KAAKA;QACL,WAAWC,GACT,0IACAH;QAED,GAAGC,KAAK;;AAGbH,KAAK,WAAW,GAAG;AAEnB,MAAMM,aAAa,WAAbA,GAAaL,WAAuE,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GAChH,IAAC;QACC,KAAKA;QACL,WAAWC,GAAG,iCAAiCH;QAC9C,GAAGC,KAAK;;AAGbG,WAAW,WAAW,GAAG;AAEzB,MAAMC,YAAY,WAAZA,GAAYN,WAAuE,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GAC/G,IAAC;QACC,KAAKA;QACL,WAAWC,GAAG,6CAA6CH;QAC1D,GAAGC,KAAK;;AAGbI,UAAU,WAAW,GAAG;AAExB,MAAMC,kBAAkB,WAAlBA,GAAkBP,WAAuE,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACrH,IAAC;QACC,KAAKA;QACL,WAAWC,GAAG,kDAAkDH;QAC/D,GAAGC,KAAK;;AAGbK,gBAAgB,WAAW,GAAG;AAE9B,MAAMC,cAAc,WAAdA,GAAcR,WAAuE,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACjH,IAAC;QACC,KAAKA;QACL,WAAWC,GAAG,YAAYH;QACzB,GAAGC,KAAK;;AAGbM,YAAY,WAAW,GAAG;AAE1B,MAAMC,aAAa,WAAbA,GAAaT,WAAuE,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GAChH,IAAC;QACC,KAAKA;QACL,WAAWC,GAAG,8BAA8BH;QAC3C,GAAGC,KAAK;;AAGbO,WAAW,WAAW,GAAG"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { Button } from "./button";
|
|
4
3
|
type CarouselApi = UseEmblaCarouselType[1];
|
|
5
4
|
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
6
5
|
type CarouselOptions = UseCarouselParameters[0];
|
|
@@ -11,10 +10,10 @@ type CarouselProps = {
|
|
|
11
10
|
orientation?: "horizontal" | "vertical";
|
|
12
11
|
setApi?: (api: CarouselApi) => void;
|
|
13
12
|
};
|
|
14
|
-
declare
|
|
15
|
-
declare
|
|
16
|
-
declare
|
|
17
|
-
declare
|
|
18
|
-
declare
|
|
13
|
+
declare const Carousel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const CarouselContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const CarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("./button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("./button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
19
18
|
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CarouselApi };
|
|
20
19
|
//# sourceMappingURL=carousel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/components/ui/carousel.tsx"],"names":[],"mappings":"AAEA,OAAO,gBAAgB,EAAE,EAAC,KAAK,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAEjF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/components/ui/carousel.tsx"],"names":[],"mappings":"AAEA,OAAO,gBAAgB,EAAE,EAAC,KAAK,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAEjF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,KAAK,WAAW,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAC3C,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACjE,KAAK,eAAe,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAChD,KAAK,cAAc,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAE/C,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAC;CACrC,CAAC;AAuBF,QAAA,MAAM,QAAQ,6HAwFb,CAAC;AAGF,QAAA,MAAM,eAAe,6GAcnB,CAAC;AAGH,QAAA,MAAM,YAAY,6GAYhB,CAAC;AAGH,QAAA,MAAM,gBAAgB,8KAsBrB,CAAC;AAGF,QAAA,MAAM,YAAY,8KAsBjB,CAAC;AAGF,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,KAAK,WAAW,EAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import embla_carousel_react from "embla-carousel-react";
|
|
4
4
|
import { ArrowLeft, ArrowRight } from "lucide-react";
|
|
5
|
-
import { createContext, useCallback, useContext, useEffect, useState } from "react";
|
|
5
|
+
import { createContext, forwardRef, useCallback, useContext, useEffect, useState } from "react";
|
|
6
6
|
import { Button } from "./button.js";
|
|
7
7
|
import { cn } from "../../lib/utilities.js";
|
|
8
8
|
const CarouselContext = /*#__PURE__*/ createContext(null);
|
|
@@ -11,7 +11,7 @@ function useCarousel() {
|
|
|
11
11
|
if (!context) throw new Error("useCarousel must be used within a <Carousel />");
|
|
12
12
|
return context;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
const Carousel = /*#__PURE__*/ forwardRef(({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }, ref)=>{
|
|
15
15
|
const [carouselRef, api] = embla_carousel_react({
|
|
16
16
|
...opts,
|
|
17
17
|
axis: "horizontal" === orientation ? "x" : "y"
|
|
@@ -67,7 +67,7 @@ function Carousel({ orientation = "horizontal", opts, setApi, plugins, className
|
|
|
67
67
|
return /*#__PURE__*/ jsx(CarouselContext.Provider, {
|
|
68
68
|
value: {
|
|
69
69
|
carouselRef,
|
|
70
|
-
api,
|
|
70
|
+
api: api,
|
|
71
71
|
opts,
|
|
72
72
|
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
73
73
|
scrollPrev,
|
|
@@ -76,76 +76,85 @@ function Carousel({ orientation = "horizontal", opts, setApi, plugins, className
|
|
|
76
76
|
canScrollNext
|
|
77
77
|
},
|
|
78
78
|
children: /*#__PURE__*/ jsx("div", {
|
|
79
|
+
ref: ref,
|
|
79
80
|
onKeyDownCapture: handleKeyDown,
|
|
80
81
|
className: cn("relative", className),
|
|
81
82
|
role: "region",
|
|
82
83
|
"aria-roledescription": "carousel",
|
|
83
|
-
"data-slot": "carousel",
|
|
84
84
|
...props,
|
|
85
85
|
children: children
|
|
86
86
|
})
|
|
87
87
|
});
|
|
88
|
-
}
|
|
89
|
-
|
|
88
|
+
});
|
|
89
|
+
Carousel.displayName = "Carousel";
|
|
90
|
+
const CarouselContent = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
90
91
|
const { carouselRef, orientation } = useCarousel();
|
|
91
92
|
return /*#__PURE__*/ jsx("div", {
|
|
92
93
|
ref: carouselRef,
|
|
93
94
|
className: "overflow-hidden",
|
|
94
|
-
"data-slot": "carousel-content",
|
|
95
95
|
children: /*#__PURE__*/ jsx("div", {
|
|
96
|
+
ref: ref,
|
|
96
97
|
className: cn("flex", "horizontal" === orientation ? "-ml-4" : "-mt-4 flex-col", className),
|
|
97
98
|
...props
|
|
98
99
|
})
|
|
99
100
|
});
|
|
100
|
-
}
|
|
101
|
-
|
|
101
|
+
});
|
|
102
|
+
CarouselContent.displayName = "CarouselContent";
|
|
103
|
+
const CarouselItem = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
102
104
|
const { orientation } = useCarousel();
|
|
103
105
|
return /*#__PURE__*/ jsx("div", {
|
|
106
|
+
ref: ref,
|
|
104
107
|
role: "group",
|
|
105
108
|
"aria-roledescription": "slide",
|
|
106
|
-
"data-slot": "carousel-item",
|
|
107
109
|
className: cn("min-w-0 shrink-0 grow-0 basis-full", "horizontal" === orientation ? "pl-4" : "pt-4", className),
|
|
108
110
|
...props
|
|
109
111
|
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
+
});
|
|
113
|
+
CarouselItem.displayName = "CarouselItem";
|
|
114
|
+
const CarouselPrevious = /*#__PURE__*/ forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref)=>{
|
|
112
115
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
113
116
|
return /*#__PURE__*/ jsxs(Button, {
|
|
114
|
-
|
|
117
|
+
ref: ref,
|
|
115
118
|
variant: variant,
|
|
116
119
|
size: size,
|
|
117
|
-
className: cn("absolute
|
|
120
|
+
className: cn("absolute h-8 w-8 rounded-full", "horizontal" === orientation ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
118
121
|
disabled: !canScrollPrev,
|
|
119
122
|
onClick: scrollPrev,
|
|
120
123
|
...props,
|
|
121
124
|
children: [
|
|
122
|
-
/*#__PURE__*/ jsx(ArrowLeft, {
|
|
125
|
+
/*#__PURE__*/ jsx(ArrowLeft, {
|
|
126
|
+
className: "h-4 w-4"
|
|
127
|
+
}),
|
|
123
128
|
/*#__PURE__*/ jsx("span", {
|
|
124
129
|
className: "sr-only",
|
|
125
130
|
children: "Previous slide"
|
|
126
131
|
})
|
|
127
132
|
]
|
|
128
133
|
});
|
|
129
|
-
}
|
|
130
|
-
|
|
134
|
+
});
|
|
135
|
+
CarouselPrevious.displayName = "CarouselPrevious";
|
|
136
|
+
const CarouselNext = /*#__PURE__*/ forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref)=>{
|
|
131
137
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
132
138
|
return /*#__PURE__*/ jsxs(Button, {
|
|
133
|
-
|
|
139
|
+
ref: ref,
|
|
134
140
|
variant: variant,
|
|
135
141
|
size: size,
|
|
136
|
-
className: cn("absolute
|
|
142
|
+
className: cn("absolute h-8 w-8 rounded-full", "horizontal" === orientation ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
137
143
|
disabled: !canScrollNext,
|
|
138
144
|
onClick: scrollNext,
|
|
139
145
|
...props,
|
|
140
146
|
children: [
|
|
141
|
-
/*#__PURE__*/ jsx(ArrowRight, {
|
|
147
|
+
/*#__PURE__*/ jsx(ArrowRight, {
|
|
148
|
+
className: "h-4 w-4"
|
|
149
|
+
}),
|
|
142
150
|
/*#__PURE__*/ jsx("span", {
|
|
143
151
|
className: "sr-only",
|
|
144
152
|
children: "Next slide"
|
|
145
153
|
})
|
|
146
154
|
]
|
|
147
155
|
});
|
|
148
|
-
}
|
|
156
|
+
});
|
|
157
|
+
CarouselNext.displayName = "CarouselNext";
|
|
149
158
|
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious };
|
|
150
159
|
|
|
151
160
|
//# sourceMappingURL=carousel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\ui\\carousel.js","sources":["webpack://@arolariu/components/./src/components/ui/carousel.tsx"],"sourcesContent":["\r\n\r\nimport useEmblaCarousel, {type UseEmblaCarouselType} from \"embla-carousel-react\";\r\nimport {ArrowLeft, ArrowRight} from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {Button} from \"@/components/ui/button\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\ntype CarouselApi = UseEmblaCarouselType[1];\r\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\r\ntype CarouselOptions = UseCarouselParameters[0];\r\ntype CarouselPlugin = UseCarouselParameters[1];\r\n\r\ntype CarouselProps = {\r\n opts?: CarouselOptions;\r\n plugins?: CarouselPlugin;\r\n orientation?: \"horizontal\" | \"vertical\";\r\n setApi?: (api: CarouselApi) => void;\r\n};\r\n\r\ntype CarouselContextProps = {\r\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\r\n api: ReturnType<typeof useEmblaCarousel>[1];\r\n scrollPrev: () => void;\r\n scrollNext: () => void;\r\n canScrollPrev: boolean;\r\n canScrollNext: boolean;\r\n} & CarouselProps;\r\n\r\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\r\n\r\nfunction useCarousel() {\r\n const context = React.useContext(CarouselContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useCarousel must be used within a <Carousel />\");\r\n }\r\n\r\n return context;\r\n}\r\n\r\nfunction Carousel({\r\n orientation = \"horizontal\",\r\n opts,\r\n setApi,\r\n plugins,\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<\"div\"> & CarouselProps) {\r\n const [carouselRef, api] = useEmblaCarousel(\r\n {\r\n ...opts,\r\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\r\n },\r\n plugins,\r\n );\r\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\r\n const [canScrollNext, setCanScrollNext] = React.useState(false);\r\n\r\n const onSelect = React.useCallback((api: CarouselApi) => {\r\n if (!api) return;\r\n setCanScrollPrev(api.canScrollPrev());\r\n setCanScrollNext(api.canScrollNext());\r\n }, []);\r\n\r\n const scrollPrev = React.useCallback(() => {\r\n api?.scrollPrev();\r\n }, [api]);\r\n\r\n const scrollNext = React.useCallback(() => {\r\n api?.scrollNext();\r\n }, [api]);\r\n\r\n const handleKeyDown = React.useCallback(\r\n (event: React.KeyboardEvent<HTMLDivElement>) => {\r\n if (event.key === \"ArrowLeft\") {\r\n event.preventDefault();\r\n scrollPrev();\r\n } else if (event.key === \"ArrowRight\") {\r\n event.preventDefault();\r\n scrollNext();\r\n }\r\n },\r\n [scrollPrev, scrollNext],\r\n );\r\n\r\n React.useEffect(() => {\r\n if (!api || !setApi) return;\r\n setApi(api);\r\n }, [api, setApi]);\r\n\r\n React.useEffect(() => {\r\n if (!api) return;\r\n onSelect(api);\r\n api.on(\"reInit\", onSelect);\r\n api.on(\"select\", onSelect);\r\n\r\n return () => {\r\n api?.off(\"select\", onSelect);\r\n };\r\n }, [api, onSelect]);\r\n\r\n return (\r\n <CarouselContext.Provider\r\n value={{\r\n carouselRef,\r\n api,\r\n opts,\r\n orientation: orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\r\n scrollPrev,\r\n scrollNext,\r\n canScrollPrev,\r\n canScrollNext,\r\n }}>\r\n <div\r\n onKeyDownCapture={handleKeyDown}\r\n className={cn(\"relative\", className)}\r\n role='region'\r\n aria-roledescription='carousel'\r\n data-slot='carousel'\r\n {...props}>\r\n {children}\r\n </div>\r\n </CarouselContext.Provider>\r\n );\r\n}\r\n\r\nfunction CarouselContent({className, ...props}: React.ComponentProps<\"div\">) {\r\n const {carouselRef, orientation} = useCarousel();\r\n\r\n return (\r\n <div\r\n ref={carouselRef}\r\n className='overflow-hidden'\r\n data-slot='carousel-content'>\r\n <div\r\n className={cn(\"flex\", orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\", className)}\r\n {...props}\r\n />\r\n </div>\r\n );\r\n}\r\n\r\nfunction CarouselItem({className, ...props}: React.ComponentProps<\"div\">) {\r\n const {orientation} = useCarousel();\r\n\r\n return (\r\n <div\r\n role='group'\r\n aria-roledescription='slide'\r\n data-slot='carousel-item'\r\n className={cn(\"min-w-0 shrink-0 grow-0 basis-full\", orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction CarouselPrevious({className, variant = \"outline\", size = \"icon\", ...props}: React.ComponentProps<typeof Button>) {\r\n const {orientation, scrollPrev, canScrollPrev} = useCarousel();\r\n\r\n return (\r\n <Button\r\n data-slot='carousel-previous'\r\n variant={variant}\r\n size={size}\r\n className={cn(\r\n \"absolute size-8 rounded-full\",\r\n orientation === \"horizontal\" ? \"top-1/2 -left-12 -translate-y-1/2\" : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\r\n className,\r\n )}\r\n disabled={!canScrollPrev}\r\n onClick={scrollPrev}\r\n {...props}>\r\n <ArrowLeft />\r\n <span className='sr-only'>Previous slide</span>\r\n </Button>\r\n );\r\n}\r\n\r\nfunction CarouselNext({className, variant = \"outline\", size = \"icon\", ...props}: React.ComponentProps<typeof Button>) {\r\n const {orientation, scrollNext, canScrollNext} = useCarousel();\r\n\r\n return (\r\n <Button\r\n data-slot='carousel-next'\r\n variant={variant}\r\n size={size}\r\n className={cn(\r\n \"absolute size-8 rounded-full\",\r\n orientation === \"horizontal\" ? \"top-1/2 -right-12 -translate-y-1/2\" : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\r\n className,\r\n )}\r\n disabled={!canScrollNext}\r\n onClick={scrollNext}\r\n {...props}>\r\n <ArrowRight />\r\n <span className='sr-only'>Next slide</span>\r\n </Button>\r\n );\r\n}\r\n\r\nexport {Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CarouselApi};\r\n"],"names":["CarouselContext","React","useCarousel","context","Error","Carousel","orientation","opts","setApi","plugins","className","children","props","carouselRef","api","useEmblaCarousel","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","onSelect","scrollPrev","scrollNext","handleKeyDown","event","cn","CarouselContent","CarouselItem","CarouselPrevious","variant","size","Button","ArrowLeft","CarouselNext","ArrowRight"],"mappings":";;;;;;;AA8BA,MAAMA,kBAAkB,WAAlBA,GAAkBC,cAAiD;AAEzE,SAASC;IACP,MAAMC,UAAUF,WAAiBD;IAEjC,IAAI,CAACG,SACH,MAAM,IAAIC,MAAM;IAGlB,OAAOD;AACT;AAEA,SAASE,SAAS,EAChBC,cAAc,YAAY,EAC1BC,IAAI,EACJC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,QAAQ,EACR,GAAGC,OACyC;IAC5C,MAAM,CAACC,aAAaC,IAAI,GAAGC,qBACzB;QACE,GAAGR,IAAI;QACP,MAAMD,iBAAAA,cAA+B,MAAM;IAC7C,GACAG;IAEF,MAAM,CAACO,eAAeC,iBAAiB,GAAGhB,SAAe;IACzD,MAAM,CAACiB,eAAeC,iBAAiB,GAAGlB,SAAe;IAEzD,MAAMmB,WAAWnB,YAAkB,CAACa;QAClC,IAAI,CAACA,KAAK;QACVG,iBAAiBH,IAAI,aAAa;QAClCK,iBAAiBL,IAAI,aAAa;IACpC,GAAG,EAAE;IAEL,MAAMO,aAAapB,YAAkB;QACnCa,KAAK;IACP,GAAG;QAACA;KAAI;IAER,MAAMQ,aAAarB,YAAkB;QACnCa,KAAK;IACP,GAAG;QAACA;KAAI;IAER,MAAMS,gBAAgBtB,YACpB,CAACuB;QACC,IAAIA,gBAAAA,MAAM,GAAG,EAAkB;YAC7BA,MAAM,cAAc;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SAAS,EAAEmB,UAAU,SAAS,EAAEC,OAAO,MAAM,EAAE,GAAGlB,OAA2C;IACtH,MAAM,EAACN,WAAW,EAAEe,UAAU,EAAEL,aAAa,EAAC,GAAGd;IAEjD,OAAO,WAAP,GACE,KAAC6B,QAAMA;QACL,aAAU;QACV,SAASF;QACT,MAAMC;QACN,WAAWL,GACT,gCACAnB,iBAAAA,cAA+B,sCAAsC,+CACrEI;QAEF,UAAU,CAACM;QACX,SAASK;QACR,GAAGT,KAAK;;0BACT,IAACoB,WAASA,CAAAA;0BACV,IAAC;gBAAK,WAAU;0BAAU;;;;AAGhC;AAEA,SAASC,aAAa,EAACvB,SAAS,EAAEmB,UAAU,SAAS,EAAEC,OAAO,MAAM,EAAE,GAAGlB,OAA2C;IAClH,MAAM,EAACN,WAAW,EAAEgB,UAAU,EAAEJ,aAAa,EAAC,GAAGhB;IAEjD,OAAO,WAAP,GACE,KAAC6B,QAAMA;QACL,aAAU;QACV,SAASF;QACT,MAAMC;QACN,WAAWL,GACT,gCACAnB,iBAAAA,cAA+B,uCAAuC,kDACtEI;QAEF,UAAU,CAACQ;QACX,SAASI;QACR,GAAGV,KAAK;;0BACT,IAACsB,YAAUA,CAAAA;0BACX,IAAC;gBAAK,WAAU;0BAAU;;;;AAGhC"}
|
|
1
|
+
{"version":3,"file":"components\\ui\\carousel.js","sources":["webpack://@arolariu/components/./src/components/ui/carousel.tsx"],"sourcesContent":["\r\n\r\nimport useEmblaCarousel, {type UseEmblaCarouselType} from \"embla-carousel-react\";\r\nimport {ArrowLeft, ArrowRight} from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {Button} from \"@/components/ui/button\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\ntype CarouselApi = UseEmblaCarouselType[1];\r\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\r\ntype CarouselOptions = UseCarouselParameters[0];\r\ntype CarouselPlugin = UseCarouselParameters[1];\r\n\r\ntype CarouselProps = {\r\n opts?: CarouselOptions;\r\n plugins?: CarouselPlugin;\r\n orientation?: \"horizontal\" | \"vertical\";\r\n setApi?: (api: CarouselApi) => void;\r\n};\r\n\r\ntype CarouselContextProps = {\r\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\r\n api: ReturnType<typeof useEmblaCarousel>[1];\r\n scrollPrev: () => void;\r\n scrollNext: () => void;\r\n canScrollPrev: boolean;\r\n canScrollNext: boolean;\r\n} & CarouselProps;\r\n\r\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\r\n\r\nfunction useCarousel() {\r\n const context = React.useContext(CarouselContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useCarousel must be used within a <Carousel />\");\r\n }\r\n\r\n return context;\r\n}\r\n\r\nconst Carousel = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & CarouselProps>(\r\n ({orientation = \"horizontal\", opts, setApi, plugins, className, children, ...props}, ref) => {\r\n const [carouselRef, api] = useEmblaCarousel(\r\n {\r\n ...opts,\r\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\r\n },\r\n plugins,\r\n );\r\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\r\n const [canScrollNext, setCanScrollNext] = React.useState(false);\r\n\r\n const onSelect = React.useCallback((api: CarouselApi) => {\r\n if (!api) {\r\n return;\r\n }\r\n\r\n setCanScrollPrev(api.canScrollPrev());\r\n setCanScrollNext(api.canScrollNext());\r\n }, []);\r\n\r\n const scrollPrev = React.useCallback(() => {\r\n api?.scrollPrev();\r\n }, [api]);\r\n\r\n const scrollNext = React.useCallback(() => {\r\n api?.scrollNext();\r\n }, [api]);\r\n\r\n const handleKeyDown = React.useCallback(\r\n (event: React.KeyboardEvent<HTMLDivElement>) => {\r\n if (event.key === \"ArrowLeft\") {\r\n event.preventDefault();\r\n scrollPrev();\r\n } else if (event.key === \"ArrowRight\") {\r\n event.preventDefault();\r\n scrollNext();\r\n }\r\n },\r\n [scrollPrev, scrollNext],\r\n );\r\n\r\n React.useEffect(() => {\r\n if (!api || !setApi) {\r\n return;\r\n }\r\n\r\n setApi(api);\r\n }, [api, setApi]);\r\n\r\n React.useEffect(() => {\r\n if (!api) {\r\n return;\r\n }\r\n\r\n onSelect(api);\r\n api.on(\"reInit\", onSelect);\r\n api.on(\"select\", onSelect);\r\n\r\n return () => {\r\n api?.off(\"select\", onSelect);\r\n };\r\n }, [api, onSelect]);\r\n\r\n return (\r\n <CarouselContext.Provider\r\n value={{\r\n carouselRef,\r\n api: api,\r\n opts,\r\n orientation: orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\r\n scrollPrev,\r\n scrollNext,\r\n canScrollPrev,\r\n canScrollNext,\r\n }}>\r\n <div\r\n ref={ref}\r\n onKeyDownCapture={handleKeyDown}\r\n className={cn(\"relative\", className)}\r\n role='region'\r\n aria-roledescription='carousel'\r\n {...props}>\r\n {children}\r\n </div>\r\n </CarouselContext.Provider>\r\n );\r\n },\r\n);\r\nCarousel.displayName = \"Carousel\";\r\n\r\nconst CarouselContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({className, ...props}, ref) => {\r\n const {carouselRef, orientation} = useCarousel();\r\n\r\n return (\r\n <div\r\n ref={carouselRef}\r\n className='overflow-hidden'>\r\n <div\r\n ref={ref}\r\n className={cn(\"flex\", orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\", className)}\r\n {...props}\r\n />\r\n </div>\r\n );\r\n});\r\nCarouselContent.displayName = \"CarouselContent\";\r\n\r\nconst CarouselItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({className, ...props}, ref) => {\r\n const {orientation} = useCarousel();\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n role='group'\r\n aria-roledescription='slide'\r\n className={cn(\"min-w-0 shrink-0 grow-0 basis-full\", orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\", className)}\r\n {...props}\r\n />\r\n );\r\n});\r\nCarouselItem.displayName = \"CarouselItem\";\r\n\r\nconst CarouselPrevious = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(\r\n ({className, variant = \"outline\", size = \"icon\", ...props}, ref) => {\r\n const {orientation, scrollPrev, canScrollPrev} = useCarousel();\r\n\r\n return (\r\n <Button\r\n ref={ref}\r\n variant={variant}\r\n size={size}\r\n className={cn(\r\n \"absolute h-8 w-8 rounded-full\",\r\n orientation === \"horizontal\" ? \"top-1/2 -left-12 -translate-y-1/2\" : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\r\n className,\r\n )}\r\n disabled={!canScrollPrev}\r\n onClick={scrollPrev}\r\n {...props}>\r\n <ArrowLeft className='h-4 w-4' />\r\n <span className='sr-only'>Previous slide</span>\r\n </Button>\r\n );\r\n },\r\n);\r\nCarouselPrevious.displayName = \"CarouselPrevious\";\r\n\r\nconst CarouselNext = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(\r\n ({className, variant = \"outline\", size = \"icon\", ...props}, ref) => {\r\n const {orientation, scrollNext, canScrollNext} = useCarousel();\r\n\r\n return (\r\n <Button\r\n ref={ref}\r\n variant={variant}\r\n size={size}\r\n className={cn(\r\n \"absolute h-8 w-8 rounded-full\",\r\n orientation === \"horizontal\" ? \"top-1/2 -right-12 -translate-y-1/2\" : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\r\n className,\r\n )}\r\n disabled={!canScrollNext}\r\n onClick={scrollNext}\r\n {...props}>\r\n <ArrowRight className='h-4 w-4' />\r\n <span className='sr-only'>Next slide</span>\r\n </Button>\r\n );\r\n },\r\n);\r\nCarouselNext.displayName = \"CarouselNext\";\r\n\r\nexport {Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CarouselApi};\r\n"],"names":["CarouselContext","React","useCarousel","context","Error","Carousel","orientation","opts","setApi","plugins","className","children","props","ref","carouselRef","api","useEmblaCarousel","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","onSelect","scrollPrev","scrollNext","handleKeyDown","event","cn","CarouselContent","CarouselItem","CarouselPrevious","variant","size","Button","ArrowLeft","CarouselNext","ArrowRight"],"mappings":";;;;;;;AA8BA,MAAMA,kBAAkB,WAAlBA,GAAkBC,cAAiD;AAEzE,SAASC;IACP,MAAMC,UAAUF,WAAiBD;IAEjC,IAAI,CAACG,SACH,MAAM,IAAIC,MAAM;IAGlB,OAAOD;AACT;AAEA,MAAME,WAAW,WAAXA,GAAWJ,WACf,CAAC,EAACK,cAAc,YAAY,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,OAAM,EAAEC;IACnF,MAAM,CAACC,aAAaC,IAAI,GAAGC,qBACzB;QACE,GAAGT,IAAI;QACP,MAAMD,iBAAAA,cAA+B,MAAM;IAC7C,GACAG;IAEF,MAAM,CAACQ,eAAeC,iBAAiB,GAAGjB,SAAe;IACzD,MAAM,CAACkB,eAAeC,iBAAiB,GAAGnB,SAAe;IAEzD,MAAMoB,WAAWpB,YAAkB,CAACc;QAClC,IAAI,CAACA,KACH;QAGFG,iBAAiBH,IAAI,aAAa;QAClCK,iBAAiBL,IAAI,aAAa;IACpC,GAAG,EAAE;IAEL,MAAMO,aAAarB,YAAkB;QACnCc,KAAK;IACP,GAAG;QAACA;KAAI;IAER,MAAMQ,aAAatB,YAAkB;QACnCc,KAAK;IACP,GAAG;QAACA;KAAI;IAER,MAAMS,gBAAgBvB,YACpB,CAACwB;QACC,IAAIA,gBAAAA,MAAM,GAAG,EAAkB;YAC7BA,MAAM,cAAc;YACpBH;QACF,OAAO,IAAIG,iBAAAA,MAAM,GAAG,EAAmB;YACrCA,MAAM,cAAc;YACpBF;QACF;IACF,GACA;QAACD;QAAYC;KAAW;IAG1BtB,UAAgB;QACd,IAAI,CAACc,OAAO,CAACP,QACX;QAGFA,OAAOO;IACT,GAAG;QAACA;QAAKP;KAAO;IAEhBP,UAAgB;QACd,IAAI,CAACc,KACH;QAGFM,SAASN;QACTA,IAAI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MAAM,EAACP,WAAW,EAAEgB,UAAU,EAAEL,aAAa,EAAC,GAAGf;IAEjD,OAAO,WAAP,GACE,KAAC8B,QAAMA;QACL,KAAKnB;QACL,SAASiB;QACT,MAAMC;QACN,WAAWL,GACT,iCACApB,iBAAAA,cAA+B,sCAAsC,+CACrEI;QAEF,UAAU,CAACO;QACX,SAASK;QACR,GAAGV,KAAK;;0BACT,IAACqB,WAASA;gBAAC,WAAU;;0BACrB,IAAC;gBAAK,WAAU;0BAAU;;;;AAGhC;AAEFJ,iBAAiB,WAAW,GAAG;AAE/B,MAAMK,eAAe,WAAfA,GAAejC,WACnB,CAAC,EAACS,SAAS,EAAEoB,UAAU,SAAS,EAAEC,OAAO,MAAM,EAAE,GAAGnB,OAAM,EAAEC;IAC1D,MAAM,EAACP,WAAW,EAAEiB,UAAU,EAAEJ,aAAa,EAAC,GAAGjB;IAEjD,OAAO,WAAP,GACE,KAAC8B,QAAMA;QACL,KAAKnB;QACL,SAASiB;QACT,MAAMC;QACN,WAAWL,GACT,iCACApB,iBAAAA,cAA+B,uCAAuC,kDACtEI;QAEF,UAAU,CAACS;QACX,SAASI;QACR,GAAGX,KAAK;;0BACT,IAACuB,YAAUA;gBAAC,WAAU;;0BACtB,IAAC;gBAAK,WAAU;0BAAU;;;;AAGhC;AAEFD,aAAa,WAAW,GAAG"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as RechartsPrimitive from "recharts";
|
|
3
|
-
import type { LegendPayload } from "recharts/types/component/DefaultLegendContent";
|
|
4
|
-
import { NameType, Payload, ValueType } from "recharts/types/component/DefaultTooltipContent";
|
|
5
|
-
import type { Props as LegendProps } from "recharts/types/component/Legend";
|
|
6
|
-
import { TooltipContentProps } from "recharts/types/component/Tooltip";
|
|
7
3
|
declare const THEMES: {
|
|
8
4
|
readonly light: "";
|
|
9
5
|
readonly dark: ".dark";
|
|
@@ -20,36 +16,48 @@ export type ChartConfig = {
|
|
|
20
16
|
theme: Record<keyof typeof THEMES, string>;
|
|
21
17
|
});
|
|
22
18
|
};
|
|
23
|
-
|
|
24
|
-
className?: string;
|
|
25
|
-
hideLabel?: boolean;
|
|
26
|
-
hideIndicator?: boolean;
|
|
27
|
-
indicator?: "line" | "dot" | "dashed";
|
|
28
|
-
nameKey?: string;
|
|
29
|
-
labelKey?: string;
|
|
30
|
-
labelFormatter?: (label: TooltipContentProps<number, string>["label"], payload: TooltipContentProps<number, string>["payload"]) => React.ReactNode;
|
|
31
|
-
formatter?: (value: number | string, name: string, item: Payload<number | string, string>, index: number, payload: ReadonlyArray<Payload<number | string, string>>) => React.ReactNode;
|
|
32
|
-
labelClassName?: string;
|
|
33
|
-
color?: string;
|
|
34
|
-
};
|
|
35
|
-
export type ChartLegendContentProps = {
|
|
36
|
-
className?: string;
|
|
37
|
-
hideIcon?: boolean;
|
|
38
|
-
verticalAlign?: LegendProps["verticalAlign"];
|
|
39
|
-
payload?: LegendPayload[];
|
|
40
|
-
nameKey?: string;
|
|
41
|
-
};
|
|
42
|
-
declare function ChartContainer({ id, className, children, config, ...props }: React.ComponentProps<"div"> & {
|
|
19
|
+
declare const ChartContainer: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
43
20
|
config: ChartConfig;
|
|
44
21
|
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
45
|
-
}
|
|
22
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
46
23
|
declare const ChartStyle: ({ id, config }: {
|
|
47
24
|
id: string;
|
|
48
25
|
config: ChartConfig;
|
|
49
26
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
50
27
|
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
51
|
-
declare
|
|
28
|
+
declare const ChartTooltipContent: React.ForwardRefExoticComponent<Omit<RechartsPrimitive.DefaultTooltipContentProps<import("recharts/types/component/DefaultTooltipContent").ValueType, import("recharts/types/component/DefaultTooltipContent").NameType> & {
|
|
29
|
+
accessibilityLayer?: boolean;
|
|
30
|
+
active?: boolean | undefined;
|
|
31
|
+
includeHidden?: boolean | undefined;
|
|
32
|
+
allowEscapeViewBox?: import("recharts/types/util/types").AllowInDimension;
|
|
33
|
+
animationDuration?: import("recharts/types/util/types").AnimationDuration;
|
|
34
|
+
animationEasing?: import("recharts/types/util/types").AnimationTiming;
|
|
35
|
+
content?: import("recharts/types/component/Tooltip").ContentType<import("recharts/types/component/DefaultTooltipContent").ValueType, import("recharts/types/component/DefaultTooltipContent").NameType>;
|
|
36
|
+
coordinate?: Partial<import("recharts/types/util/types").Coordinate>;
|
|
37
|
+
cursor?: boolean | React.ReactElement | React.SVGProps<SVGElement>;
|
|
38
|
+
filterNull?: boolean;
|
|
39
|
+
defaultIndex?: number;
|
|
40
|
+
isAnimationActive?: boolean;
|
|
41
|
+
offset?: number;
|
|
42
|
+
payloadUniqBy?: import("recharts/types/util/payload/getUniqPayload").UniqueOption<import("recharts/types/component/DefaultTooltipContent").Payload<import("recharts/types/component/DefaultTooltipContent").ValueType, import("recharts/types/component/DefaultTooltipContent").NameType>>;
|
|
43
|
+
position?: Partial<import("recharts/types/util/types").Coordinate>;
|
|
44
|
+
reverseDirection?: import("recharts/types/util/types").AllowInDimension;
|
|
45
|
+
shared?: boolean;
|
|
46
|
+
trigger?: "hover" | "click";
|
|
47
|
+
useTranslate3d?: boolean;
|
|
48
|
+
viewBox?: import("recharts/types/util/types").CartesianViewBox;
|
|
49
|
+
wrapperStyle?: React.CSSProperties;
|
|
50
|
+
} & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
51
|
+
hideLabel?: boolean;
|
|
52
|
+
hideIndicator?: boolean;
|
|
53
|
+
indicator?: "line" | "dot" | "dashed";
|
|
54
|
+
nameKey?: string;
|
|
55
|
+
labelKey?: string;
|
|
56
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
52
57
|
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
53
|
-
declare
|
|
58
|
+
declare const ChartLegendContent: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
|
|
59
|
+
hideIcon?: boolean;
|
|
60
|
+
nameKey?: string;
|
|
61
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
54
62
|
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
|
|
55
63
|
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/components/ui/chart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/components/ui/chart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,UAAU,CAAC;AAK9C,QAAA,MAAM,MAAM;;;CAAsC,CAAC;AAEnD,MAAM,MAAM,WAAW,GAAG;KACvB,CAAC,IAAI,MAAM,GAAG;QACb,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACxB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC5B,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG;QAAC,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,OAAO,MAAM,EAAE,MAAM,CAAC,CAAA;KAAC,CAAC;CACpG,CAAC;AAkBF,QAAA,MAAM,cAAc;YAGR,WAAW;cACT,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,mBAAmB,CAAC,CAAC,UAAU,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