@codefast/ui 0.3.4 → 0.3.5
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 +30 -0
- package/dist/cjs/components/accordion.cjs +1 -1
- package/dist/cjs/components/accordion.cjs.map +1 -1
- package/dist/cjs/components/alert/alert-variants.cjs.map +1 -1
- package/dist/cjs/components/alert/alert.cjs +1 -1
- package/dist/cjs/components/alert/alert.cjs.map +1 -1
- package/dist/cjs/components/alert/index.cjs +2 -1
- package/dist/cjs/components/alert/index.cjs.map +1 -0
- package/dist/cjs/components/alert-dialog.cjs +1 -1
- package/dist/cjs/components/alert-dialog.cjs.map +1 -1
- package/dist/cjs/components/aspect-ratio.cjs.map +1 -1
- package/dist/cjs/components/avatar.cjs +1 -1
- package/dist/cjs/components/avatar.cjs.map +1 -1
- package/dist/cjs/components/badge/badge-variants.cjs.map +1 -1
- package/dist/cjs/components/badge/badge.cjs.map +1 -1
- package/dist/cjs/components/badge/index.cjs +2 -1
- package/dist/cjs/components/badge/index.cjs.map +1 -0
- package/dist/cjs/components/blockquote.cjs.map +1 -1
- package/dist/cjs/components/box.cjs.map +1 -1
- package/dist/cjs/components/breadcrumb.cjs +1 -1
- package/dist/cjs/components/breadcrumb.cjs.map +1 -1
- package/dist/cjs/components/button/button-variants.cjs.map +1 -1
- package/dist/cjs/components/button/button.cjs.map +1 -1
- package/dist/cjs/components/button/index.cjs +2 -1
- package/dist/cjs/components/button/index.cjs.map +1 -0
- package/dist/cjs/components/calendar.cjs.map +1 -1
- package/dist/cjs/components/card.cjs +1 -1
- package/dist/cjs/components/card.cjs.map +1 -1
- package/dist/cjs/components/carousel.cjs +1 -1
- package/dist/cjs/components/carousel.cjs.map +1 -1
- package/dist/cjs/components/chart.cjs +1 -1
- package/dist/cjs/components/chart.cjs.map +1 -1
- package/dist/cjs/components/checkbox-cards.cjs +1 -1
- package/dist/cjs/components/checkbox-cards.cjs.map +1 -1
- package/dist/cjs/components/checkbox-group.cjs.map +1 -1
- package/dist/cjs/components/checkbox.cjs.map +1 -1
- package/dist/cjs/components/code.cjs.map +1 -1
- package/dist/cjs/components/collapsible.cjs +1 -1
- package/dist/cjs/components/collapsible.cjs.map +1 -1
- package/dist/cjs/components/command.cjs +1 -1
- package/dist/cjs/components/command.cjs.map +1 -1
- package/dist/cjs/components/container.cjs.map +1 -1
- package/dist/cjs/components/context-menu.cjs +1 -1
- package/dist/cjs/components/context-menu.cjs.map +1 -1
- package/dist/cjs/components/dialog.cjs +1 -1
- package/dist/cjs/components/dialog.cjs.map +1 -1
- package/dist/cjs/components/drawer.cjs +1 -1
- package/dist/cjs/components/drawer.cjs.map +1 -1
- package/dist/cjs/components/dropdown-menu.cjs +1 -1
- package/dist/cjs/components/dropdown-menu.cjs.map +1 -1
- package/dist/cjs/components/em.cjs.map +1 -1
- package/dist/cjs/components/form.cjs +1 -1
- package/dist/cjs/components/form.cjs.map +1 -1
- package/dist/cjs/components/heading.cjs.map +1 -1
- package/dist/cjs/components/hover-card.cjs +1 -1
- package/dist/cjs/components/hover-card.cjs.map +1 -1
- package/dist/cjs/components/inline.cjs.map +1 -1
- package/dist/cjs/components/input/index.cjs +2 -1
- package/dist/cjs/components/input/index.cjs.map +1 -0
- package/dist/cjs/components/input/input-variants.cjs.map +1 -1
- package/dist/cjs/components/input/input.cjs.map +1 -1
- package/dist/cjs/components/input-date.cjs +2 -1
- package/dist/cjs/components/input-date.cjs.map +1 -0
- package/dist/cjs/components/input-number.cjs +1 -1
- package/dist/cjs/components/input-number.cjs.map +1 -1
- package/dist/cjs/components/input-otp.cjs +1 -1
- package/dist/cjs/components/input-otp.cjs.map +1 -1
- package/dist/cjs/components/input-password.cjs.map +1 -1
- package/dist/cjs/components/input-search.cjs +1 -1
- package/dist/cjs/components/input-search.cjs.map +1 -1
- package/dist/cjs/components/input-time.cjs +2 -1
- package/dist/cjs/components/input-time.cjs.map +1 -0
- package/dist/cjs/components/kbd.cjs.map +1 -1
- package/dist/cjs/components/label.cjs.map +1 -1
- package/dist/cjs/components/menubar.cjs +1 -1
- package/dist/cjs/components/menubar.cjs.map +1 -1
- package/dist/cjs/components/navigation-menu/index.cjs +2 -1
- package/dist/cjs/components/navigation-menu/index.cjs.map +1 -0
- package/dist/cjs/components/navigation-menu/navigation-menu-trigger-style.cjs.map +1 -1
- package/dist/cjs/components/navigation-menu/navigation-menu.cjs +1 -1
- package/dist/cjs/components/navigation-menu/navigation-menu.cjs.map +1 -1
- package/dist/cjs/components/pagination.cjs +1 -1
- package/dist/cjs/components/pagination.cjs.map +1 -1
- package/dist/cjs/components/popover.cjs.map +1 -1
- package/dist/cjs/components/pre.cjs.map +1 -1
- package/dist/cjs/components/progress-circle/index.cjs +2 -1
- package/dist/cjs/components/progress-circle/index.cjs.map +1 -0
- package/dist/cjs/components/progress-circle/progress-circle-variants.cjs.map +1 -1
- package/dist/cjs/components/progress-circle/progress-circle.cjs.map +1 -1
- package/dist/cjs/components/progress.cjs.map +1 -1
- package/dist/cjs/components/quote.cjs.map +1 -1
- package/dist/cjs/components/radio-cards.cjs.map +1 -1
- package/dist/cjs/components/radio-group.cjs.map +1 -1
- package/dist/cjs/components/radio.cjs.map +1 -1
- package/dist/cjs/components/resizable.cjs.map +1 -1
- package/dist/cjs/components/scroll-area/index.cjs +2 -1
- package/dist/cjs/components/scroll-area/index.cjs.map +1 -0
- package/dist/cjs/components/scroll-area/scroll-area-scrollbar-variants.cjs.map +1 -1
- package/dist/cjs/components/scroll-area/scroll-area.cjs.map +1 -1
- package/dist/cjs/components/section.cjs.map +1 -1
- package/dist/cjs/components/select.cjs +1 -1
- package/dist/cjs/components/select.cjs.map +1 -1
- package/dist/cjs/components/separator/index.cjs +2 -1
- package/dist/cjs/components/separator/index.cjs.map +1 -0
- package/dist/cjs/components/separator/separator-variants.cjs.map +1 -1
- package/dist/cjs/components/separator/separator.cjs +1 -1
- package/dist/cjs/components/separator/separator.cjs.map +1 -1
- package/dist/cjs/components/sheet/index.cjs +2 -1
- package/dist/cjs/components/sheet/index.cjs.map +1 -0
- package/dist/cjs/components/sheet/sheet-content-variants.cjs.map +1 -1
- package/dist/cjs/components/sheet/sheet.cjs +1 -1
- package/dist/cjs/components/sheet/sheet.cjs.map +1 -1
- package/dist/cjs/components/sidebar/index.cjs +2 -1
- package/dist/cjs/components/sidebar/index.cjs.map +1 -0
- package/dist/cjs/components/sidebar/sidebar-menu-button-variants.cjs.map +1 -1
- package/dist/cjs/components/sidebar/sidebar.cjs +1 -1
- package/dist/cjs/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/cjs/components/skeleton.cjs.map +1 -1
- package/dist/cjs/components/slider.cjs.map +1 -1
- package/dist/cjs/components/sonner.cjs +1 -1
- package/dist/cjs/components/sonner.cjs.map +1 -1
- package/dist/cjs/components/spinner.cjs.map +1 -1
- package/dist/cjs/components/strong.cjs.map +1 -1
- package/dist/cjs/components/switch.cjs.map +1 -1
- package/dist/cjs/components/table.cjs +1 -1
- package/dist/cjs/components/table.cjs.map +1 -1
- package/dist/cjs/components/tabs.cjs +1 -1
- package/dist/cjs/components/tabs.cjs.map +1 -1
- package/dist/cjs/components/text.cjs.map +1 -1
- package/dist/cjs/components/textarea.cjs.map +1 -1
- package/dist/cjs/components/toggle/index.cjs +2 -1
- package/dist/cjs/components/toggle/index.cjs.map +1 -0
- package/dist/cjs/components/toggle/toggle-variants.cjs.map +1 -1
- package/dist/cjs/components/toggle/toggle.cjs.map +1 -1
- package/dist/cjs/components/toggle-group.cjs +1 -1
- package/dist/cjs/components/toggle-group.cjs.map +1 -1
- package/dist/cjs/components/tooltip.cjs +1 -1
- package/dist/cjs/components/tooltip.cjs.map +1 -1
- package/dist/cjs/index.cjs +2 -1
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/lib/utils.cjs.map +1 -1
- package/dist/esm/components/accordion.js +1 -1
- package/dist/esm/components/accordion.js.map +1 -1
- package/dist/esm/components/alert/alert-variants.js +1 -1
- package/dist/esm/components/alert/alert-variants.js.map +1 -1
- package/dist/esm/components/alert/alert.js +1 -1
- package/dist/esm/components/alert/alert.js.map +1 -1
- package/dist/esm/components/alert-dialog.js +1 -1
- package/dist/esm/components/alert-dialog.js.map +1 -1
- package/dist/esm/components/aspect-ratio.js +1 -1
- package/dist/esm/components/aspect-ratio.js.map +1 -1
- package/dist/esm/components/avatar.js +1 -1
- package/dist/esm/components/avatar.js.map +1 -1
- package/dist/esm/components/badge/badge-variants.js +1 -1
- package/dist/esm/components/badge/badge-variants.js.map +1 -1
- package/dist/esm/components/badge/badge.js +1 -1
- package/dist/esm/components/badge/badge.js.map +1 -1
- package/dist/esm/components/blockquote.js +1 -1
- package/dist/esm/components/blockquote.js.map +1 -1
- package/dist/esm/components/box.js +1 -1
- package/dist/esm/components/box.js.map +1 -1
- package/dist/esm/components/breadcrumb.js +1 -1
- package/dist/esm/components/breadcrumb.js.map +1 -1
- package/dist/esm/components/button/button-variants.js +1 -1
- package/dist/esm/components/button/button-variants.js.map +1 -1
- package/dist/esm/components/button/button.js +1 -1
- package/dist/esm/components/button/button.js.map +1 -1
- package/dist/esm/components/calendar.js +1 -1
- package/dist/esm/components/calendar.js.map +1 -1
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/card.js.map +1 -1
- package/dist/esm/components/carousel.js +1 -1
- package/dist/esm/components/carousel.js.map +1 -1
- package/dist/esm/components/chart.js +1 -1
- package/dist/esm/components/chart.js.map +1 -1
- package/dist/esm/components/checkbox-cards.js +1 -1
- package/dist/esm/components/checkbox-cards.js.map +1 -1
- package/dist/esm/components/checkbox-group.js +1 -1
- package/dist/esm/components/checkbox-group.js.map +1 -1
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.js.map +1 -1
- package/dist/esm/components/code.js +1 -1
- package/dist/esm/components/code.js.map +1 -1
- package/dist/esm/components/collapsible.js +1 -1
- package/dist/esm/components/collapsible.js.map +1 -1
- package/dist/esm/components/command.js +1 -1
- package/dist/esm/components/command.js.map +1 -1
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/components/container.js.map +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/context-menu.js.map +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +1 -1
- package/dist/esm/components/drawer.js +1 -1
- package/dist/esm/components/drawer.js.map +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/dropdown-menu.js.map +1 -1
- package/dist/esm/components/em.js +1 -1
- package/dist/esm/components/em.js.map +1 -1
- package/dist/esm/components/form.js +1 -1
- package/dist/esm/components/form.js.map +1 -1
- package/dist/esm/components/heading.js +1 -1
- package/dist/esm/components/heading.js.map +1 -1
- package/dist/esm/components/hover-card.js +1 -1
- package/dist/esm/components/hover-card.js.map +1 -1
- package/dist/esm/components/inline.js +1 -1
- package/dist/esm/components/inline.js.map +1 -1
- package/dist/esm/components/input/input-variants.js +1 -1
- package/dist/esm/components/input/input-variants.js.map +1 -1
- package/dist/esm/components/input/input.js +1 -1
- package/dist/esm/components/input/input.js.map +1 -1
- package/dist/esm/components/input-number.js +1 -1
- package/dist/esm/components/input-number.js.map +1 -1
- package/dist/esm/components/input-otp.js +1 -1
- package/dist/esm/components/input-otp.js.map +1 -1
- package/dist/esm/components/input-password.js +1 -1
- package/dist/esm/components/input-password.js.map +1 -1
- package/dist/esm/components/input-search.js +1 -1
- package/dist/esm/components/input-search.js.map +1 -1
- package/dist/esm/components/kbd.js +1 -1
- package/dist/esm/components/kbd.js.map +1 -1
- package/dist/esm/components/label.js +1 -1
- package/dist/esm/components/label.js.map +1 -1
- package/dist/esm/components/menubar.js +1 -1
- package/dist/esm/components/menubar.js.map +1 -1
- package/dist/esm/components/navigation-menu/navigation-menu-trigger-style.js +1 -1
- package/dist/esm/components/navigation-menu/navigation-menu-trigger-style.js.map +1 -1
- package/dist/esm/components/navigation-menu/navigation-menu.js +1 -1
- package/dist/esm/components/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/esm/components/pagination.js +1 -1
- package/dist/esm/components/pagination.js.map +1 -1
- package/dist/esm/components/popover.js +1 -1
- package/dist/esm/components/popover.js.map +1 -1
- package/dist/esm/components/pre.js +1 -1
- package/dist/esm/components/pre.js.map +1 -1
- package/dist/esm/components/progress-circle/progress-circle-variants.js +1 -1
- package/dist/esm/components/progress-circle/progress-circle-variants.js.map +1 -1
- package/dist/esm/components/progress-circle/progress-circle.js +1 -1
- package/dist/esm/components/progress-circle/progress-circle.js.map +1 -1
- package/dist/esm/components/progress.js +1 -1
- package/dist/esm/components/progress.js.map +1 -1
- package/dist/esm/components/quote.js +1 -1
- package/dist/esm/components/quote.js.map +1 -1
- package/dist/esm/components/radio-cards.js +1 -1
- package/dist/esm/components/radio-cards.js.map +1 -1
- package/dist/esm/components/radio-group.js +1 -1
- package/dist/esm/components/radio-group.js.map +1 -1
- package/dist/esm/components/radio.js +1 -1
- package/dist/esm/components/radio.js.map +1 -1
- package/dist/esm/components/resizable.js +1 -1
- package/dist/esm/components/resizable.js.map +1 -1
- package/dist/esm/components/scroll-area/scroll-area-scrollbar-variants.js +1 -1
- package/dist/esm/components/scroll-area/scroll-area-scrollbar-variants.js.map +1 -1
- package/dist/esm/components/scroll-area/scroll-area.js +1 -1
- package/dist/esm/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/esm/components/section.js +1 -1
- package/dist/esm/components/section.js.map +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/select.js.map +1 -1
- package/dist/esm/components/separator/separator-variants.js +1 -1
- package/dist/esm/components/separator/separator-variants.js.map +1 -1
- package/dist/esm/components/separator/separator.js +1 -1
- package/dist/esm/components/separator/separator.js.map +1 -1
- package/dist/esm/components/sheet/sheet-content-variants.js +1 -1
- package/dist/esm/components/sheet/sheet-content-variants.js.map +1 -1
- package/dist/esm/components/sheet/sheet.js +1 -1
- package/dist/esm/components/sheet/sheet.js.map +1 -1
- package/dist/esm/components/sidebar/sidebar-menu-button-variants.js +1 -1
- package/dist/esm/components/sidebar/sidebar-menu-button-variants.js.map +1 -1
- package/dist/esm/components/sidebar/sidebar.js +1 -1
- package/dist/esm/components/sidebar/sidebar.js.map +1 -1
- package/dist/esm/components/skeleton.js +1 -1
- package/dist/esm/components/skeleton.js.map +1 -1
- package/dist/esm/components/slider.js +1 -1
- package/dist/esm/components/slider.js.map +1 -1
- package/dist/esm/components/sonner.js +1 -1
- package/dist/esm/components/sonner.js.map +1 -1
- package/dist/esm/components/spinner.js +1 -1
- package/dist/esm/components/spinner.js.map +1 -1
- package/dist/esm/components/strong.js +1 -1
- package/dist/esm/components/strong.js.map +1 -1
- package/dist/esm/components/switch.js +1 -1
- package/dist/esm/components/switch.js.map +1 -1
- package/dist/esm/components/table.js +1 -1
- package/dist/esm/components/table.js.map +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/tabs.js.map +1 -1
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/text.js.map +1 -1
- package/dist/esm/components/textarea.js +1 -1
- package/dist/esm/components/textarea.js.map +1 -1
- package/dist/esm/components/toggle/toggle-variants.js +1 -1
- package/dist/esm/components/toggle/toggle-variants.js.map +1 -1
- package/dist/esm/components/toggle/toggle.js +1 -1
- package/dist/esm/components/toggle/toggle.js.map +1 -1
- package/dist/esm/components/toggle-group.js +1 -1
- package/dist/esm/components/toggle-group.js.map +1 -1
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/tooltip.js.map +1 -1
- package/dist/esm/lib/utils.js +1 -1
- package/dist/esm/lib/utils.js.map +1 -1
- package/package.json +50 -50
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/calendar.cjs","sources":["webpack://@codefast/ui/./src/components/calendar.tsx"],"sourcesContent":["\n\nimport type { ComponentProps, JSX, ReactNode } from \"react\";\nimport type { CustomComponents, DateRange } from \"react-day-picker\";\n\nimport { format } from \"date-fns\";\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, DotIcon } from \"lucide-react\";\nimport { DayFlag, DayPicker, SelectionState, UI } from \"react-day-picker\";\n\nimport { buttonVariants } from \"@/components/button\";\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Chevron\n * -------------------------------------------------------------------------- */\n\nfunction Chevron({ orientation, className, ...props }: ComponentProps<CustomComponents[\"Chevron\"]>): JSX.Element {\n switch (orientation) {\n case \"up\": {\n return <ChevronUpIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n case \"down\": {\n return <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n case \"left\": {\n return <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n case \"right\": {\n return <ChevronRightIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n default: {\n return <DotIcon className={cn(\"size-4\", className)} {...props} />;\n }\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Component: Calendar\n * -------------------------------------------------------------------------- */\n\nfunction Calendar({ showOutsideDays = true, classNames, ...props }: ComponentProps<typeof DayPicker>): JSX.Element {\n const isInteractive = props.mode !== undefined || props.onDayClick !== undefined;\n\n return (\n <DayPicker\n classNames={{\n [UI.Root]: cn(\"p-3\", classNames?.[UI.Root]),\n [UI.Chevron]: cn(classNames?.[UI.Chevron]),\n [UI.Day]: cn(\n \"grid place-items-center text-center text-sm\",\n isInteractive ? \"min-w-8.5 has-focus-visible:z-20 group\" : \"min-w-8.5 h-8\",\n classNames?.[UI.Day],\n ),\n [UI.DayButton]: cn(\n \"group-[.is-outside]:text-muted-foreground hover:not-disabled:not-group-aria-selected:bg-secondary hover:not-disabled:not-group-aria-selected:text-secondary-foreground group-data-today:not-group-aria-selected:bg-secondary group-data-today:not-group-aria-selected:text-secondary-foreground group-aria-selected:not-group-[.is-range-middle]:bg-primary group-aria-selected:not-group-[.is-range-middle]:text-primary-foreground outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 group-[.is-selected]:not-group-[.is-range-middle]:focus-visible:ring-primary/20 dark:group-[.is-selected]:not-group-[.is-range-middle]:focus-visible:ring-primary/40 group-[.is-selected]:not-group-[.is-range-middle]:focus-visible:border-primary size-8 rounded-lg border border-transparent disabled:opacity-50\",\n classNames?.[UI.DayButton],\n ),\n [UI.CaptionLabel]: cn(\"flex items-center gap-2 [&>svg]:opacity-50\", classNames?.[UI.CaptionLabel]),\n [UI.Dropdowns]: cn(\"flex gap-4\", classNames?.[UI.Dropdowns]),\n [UI.Dropdown]: cn(\"absolute opacity-0\", classNames?.[UI.Dropdown]),\n [UI.DropdownRoot]: cn(\"relative\", classNames?.[UI.DropdownRoot]),\n [UI.Footer]: cn(classNames?.[UI.Footer]),\n [UI.MonthGrid]: cn(classNames?.[UI.MonthGrid]),\n [UI.MonthCaption]: cn(\"py-1 text-sm font-medium\", classNames?.[UI.MonthCaption]),\n [UI.MonthsDropdown]: cn(classNames?.[UI.MonthsDropdown]),\n [UI.Month]: cn(\"flex flex-col gap-4\", classNames?.[UI.Month]),\n [UI.Months]: cn(\"relative flex gap-4\", classNames?.[UI.Months]),\n [UI.Nav]: cn(\"absolute end-0 flex gap-2\", classNames?.[UI.Nav]),\n [UI.NextMonthButton]: buttonVariants({\n variant: \"ghost\",\n size: \"icon\",\n className: [\"size-7\", classNames?.[UI.NextMonthButton]],\n }),\n [UI.PreviousMonthButton]: buttonVariants({\n variant: \"ghost\",\n size: \"icon\",\n className: [\"size-7\", classNames?.[UI.PreviousMonthButton]],\n }),\n [UI.Week]: cn(\"mt-2 flex justify-between\", classNames?.[UI.Week]),\n [UI.Weeks]: cn(classNames?.[UI.Weeks]),\n [UI.Weekday]: cn(\"text-muted-foreground min-w-8.5 text-xs font-medium\", classNames?.[UI.Weekday]),\n [UI.Weekdays]: cn(\"flex w-full justify-between\", classNames?.[UI.Weekdays]),\n [UI.WeekNumber]: cn(\n \"text-muted-foreground min-w-8.5 grid h-8 place-items-center text-xs font-normal [&+*]:rounded-l-lg\",\n classNames?.[UI.WeekNumber],\n ),\n [UI.WeekNumberHeader]: cn(\"min-w-8.5\", classNames?.[UI.WeekNumberHeader]),\n [UI.YearsDropdown]: cn(classNames?.[UI.YearsDropdown]),\n\n [SelectionState.range_end]: cn(\n \"to-secondary is-range-end rounded-r-lg bg-gradient-to-l first:rounded-l-lg\",\n classNames?.[SelectionState.range_end],\n ),\n [SelectionState.range_middle]: cn(\n \"is-range-middle bg-secondary text-secondary-foreground first:rounded-l-lg last:rounded-r-lg\",\n classNames?.[SelectionState.range_middle],\n ),\n [SelectionState.range_start]: cn(\n \"to-secondary is-range-start rounded-l-lg bg-gradient-to-r last:rounded-r-lg\",\n classNames?.[SelectionState.range_start],\n ),\n [SelectionState.selected]: cn(\"is-selected\", classNames?.[SelectionState.selected]),\n\n [DayFlag.disabled]: cn(\"is-disabled\", classNames?.[DayFlag.disabled]),\n [DayFlag.focused]: cn(\"is-focused\", classNames?.[DayFlag.focused]),\n [DayFlag.hidden]: cn(\"is-hidden size-8\", classNames?.[DayFlag.hidden]),\n [DayFlag.outside]: cn(\"is-outside\", classNames?.[DayFlag.outside]),\n [DayFlag.today]: cn(\"is-today\", classNames?.[DayFlag.today]),\n }}\n components={{\n Chevron,\n }}\n showOutsideDays={showOutsideDays}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CalendarRangeLabel\n * -------------------------------------------------------------------------- */\n\nfunction CalendarRangeLabel({\n date,\n formatStr = \"LLL dd, y\",\n placeholder = \"Pick a date\",\n}: {\n date: DateRange | undefined;\n formatStr?: string;\n placeholder?: string;\n}): ReactNode {\n if (!date?.from) {\n return <span className=\"truncate\">{placeholder}</span>;\n }\n\n const formattedFromDate = format(date.from, formatStr);\n\n if (!date.to) {\n return <span className=\"truncate\">{formattedFromDate}</span>;\n }\n\n const formattedToDate = format(date.to, formatStr);\n\n return (\n <span className=\"truncate\">\n {formattedFromDate} - {formattedToDate}\n </span>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CalendarLabel\n * -------------------------------------------------------------------------- */\n\nfunction CalendarLabel({\n date,\n formatStr = \"PPP\",\n placeholder = \"Pick a date\",\n}: {\n date: Date | undefined;\n formatStr?: string;\n placeholder?: string;\n}): ReactNode {\n if (!date) {\n return <span className=\"truncate\">{placeholder}</span>;\n }\n\n return <span className=\"truncate\">{format(date, formatStr)}</span>;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport type { DateRange, Matcher } from \"react-day-picker\";\nexport { Calendar, CalendarLabel, CalendarRangeLabel };\n"],"names":["Chevron","orientation","className","props","ChevronUpIcon","cn","ChevronDownIcon","ChevronLeftIcon","ChevronRightIcon","DotIcon","Calendar","showOutsideDays","classNames","isInteractive","undefined","DayPicker","UI","buttonVariants","SelectionState","DayFlag","CalendarRangeLabel","date","formatStr","placeholder","formattedFromDate","format","formattedToDate","CalendarLabel"],"mappings":";mtCAgBA,SAASA,QAAQ,CAAEC,YAAAA,CAAW,CAAEC,UAAAA,CAAS,CAAE,GAAGC,EAAoD,EAChG,OAAQF,GACN,IAAK,KACH,MAAO,oCAACG,sCAAAA,aAAaA,CAAAA,CAAC,UAAWC,GAAAA,0BAAAA,EAAAA,EAAG,SAAUH,GAAa,GAAGC,CAAK,EAGrE,KAAK,OACH,MAAO,oCAACG,sCAAAA,eAAeA,CAAAA,CAAC,UAAWD,GAAAA,0BAAAA,EAAAA,EAAG,SAAUH,GAAa,GAAGC,CAAK,EAGvE,KAAK,OACH,MAAO,oCAACI,sCAAAA,eAAeA,CAAAA,CAAC,UAAWF,GAAAA,0BAAAA,EAAAA,EAAG,SAAUH,GAAa,GAAGC,CAAK,EAGvE,KAAK,QACH,MAAO,oCAACK,sCAAAA,gBAAgBA,CAAAA,CAAC,UAAWH,GAAAA,0BAAAA,EAAAA,EAAG,SAAUH,GAAa,GAAGC,CAAK,EAGxE,SACE,MAAO,oCAACM,sCAAAA,OAAOA,CAAAA,CAAC,UAAWJ,GAAAA,0BAAAA,EAAAA,EAAG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AC,CAC7D,EACA,WAAY,CACVnB,OACF,EACA,gBAAiBW,EAChB,GAAGR,CAAK,EAGf,CAMA,SAASiB,mBAAmB,CAC1BC,KAAAA,CAAI,CACJC,UAAAA,EAAY,WAAW,CACvBC,YAAAA,EAAc,aAAa,CAK5B,EACC,GAAI,CAACF,GAAM,KACT,MAAO,oCAAC,QAAK,UAAU,W,SAAYE,C,GAGrC,IAAMC,EAAoBC,GAAAA,kCAAAA,MAAAA,EAAOJ,EAAK,IAAI,CAAEC,GAE5C,GAAI,CAACD,EAAK,EAAE,CACV,MAAO,oCAAC,QAAK,UAAU,W,SAAYG,C,GAGrC,IAAME,EAAkBD,GAAAA,kCAAAA,MAAAA,EAAOJ,EAAK,EAAE,CAAEC,GAExC,MACE,qCAAC,QAAK,UAAU,W,UACbE,EAAkB,MAAIE,E,EAG7B,CAMA,SAASC,cAAc,CACrBN,KAAAA,CAAI,CACJC,UAAAA,EAAY,KAAK,CACjBC,YAAAA,EAAc,aAAa,CAK5B,SACC,EAIO,oCAAC,QAAK,UAAU,W,SAAYE,GAAAA,kCAAAA,MAAAA,EAAOJ,EAAMC,E,GAHvC,oCAAC,QAAK,UAAU,W,SAAYC,C,EAIvC,C"}
|
|
1
|
+
{"version":3,"file":"components/calendar.cjs","sources":["webpack://@codefast/ui/webpack/runtime/define_property_getters","webpack://@codefast/ui/webpack/runtime/has_own_property","webpack://@codefast/ui/webpack/runtime/make_namespace_object","webpack://@codefast/ui/./src/components/calendar.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\n\nimport type { ComponentProps, JSX, ReactNode } from \"react\";\nimport type { CustomComponents, DateRange } from \"react-day-picker\";\n\nimport { format } from \"date-fns\";\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, DotIcon } from \"lucide-react\";\nimport { DayFlag, DayPicker, SelectionState, UI } from \"react-day-picker\";\n\nimport { buttonVariants } from \"@/components/button\";\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Chevron\n * -------------------------------------------------------------------------- */\n\nfunction Chevron({ orientation, className, ...props }: ComponentProps<CustomComponents[\"Chevron\"]>): JSX.Element {\n switch (orientation) {\n case \"up\": {\n return <ChevronUpIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n case \"down\": {\n return <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n case \"left\": {\n return <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n case \"right\": {\n return <ChevronRightIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n default: {\n return <DotIcon className={cn(\"size-4\", className)} {...props} />;\n }\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Component: Calendar\n * -------------------------------------------------------------------------- */\n\nfunction Calendar({ showOutsideDays = true, classNames, ...props }: ComponentProps<typeof DayPicker>): JSX.Element {\n const isInteractive = props.mode !== undefined || props.onDayClick !== undefined;\n\n return (\n <DayPicker\n classNames={{\n [UI.Root]: cn(\"p-3\", classNames?.[UI.Root]),\n [UI.Chevron]: cn(classNames?.[UI.Chevron]),\n [UI.Day]: cn(\n \"grid place-items-center text-center text-sm\",\n isInteractive ? \"min-w-8.5 has-focus-visible:z-20 group\" : \"min-w-8.5 h-8\",\n classNames?.[UI.Day],\n ),\n [UI.DayButton]: cn(\n \"group-[.is-outside]:text-muted-foreground hover:not-disabled:not-group-aria-selected:bg-secondary hover:not-disabled:not-group-aria-selected:text-secondary-foreground group-data-today:not-group-aria-selected:bg-secondary group-data-today:not-group-aria-selected:text-secondary-foreground group-aria-selected:not-group-[.is-range-middle]:bg-primary group-aria-selected:not-group-[.is-range-middle]:text-primary-foreground outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 group-[.is-selected]:not-group-[.is-range-middle]:focus-visible:ring-primary/20 dark:group-[.is-selected]:not-group-[.is-range-middle]:focus-visible:ring-primary/40 group-[.is-selected]:not-group-[.is-range-middle]:focus-visible:border-primary size-8 rounded-lg border border-transparent disabled:opacity-50\",\n classNames?.[UI.DayButton],\n ),\n [UI.CaptionLabel]: cn(\"flex items-center gap-2 [&>svg]:opacity-50\", classNames?.[UI.CaptionLabel]),\n [UI.Dropdowns]: cn(\"flex gap-4\", classNames?.[UI.Dropdowns]),\n [UI.Dropdown]: cn(\"absolute opacity-0\", classNames?.[UI.Dropdown]),\n [UI.DropdownRoot]: cn(\"relative\", classNames?.[UI.DropdownRoot]),\n [UI.Footer]: cn(classNames?.[UI.Footer]),\n [UI.MonthGrid]: cn(classNames?.[UI.MonthGrid]),\n [UI.MonthCaption]: cn(\"py-1 text-sm font-medium\", classNames?.[UI.MonthCaption]),\n [UI.MonthsDropdown]: cn(classNames?.[UI.MonthsDropdown]),\n [UI.Month]: cn(\"flex flex-col gap-4\", classNames?.[UI.Month]),\n [UI.Months]: cn(\"relative flex gap-4\", classNames?.[UI.Months]),\n [UI.Nav]: cn(\"absolute end-0 flex gap-2\", classNames?.[UI.Nav]),\n [UI.NextMonthButton]: buttonVariants({\n variant: \"ghost\",\n size: \"icon\",\n className: [\"size-7\", classNames?.[UI.NextMonthButton]],\n }),\n [UI.PreviousMonthButton]: buttonVariants({\n variant: \"ghost\",\n size: \"icon\",\n className: [\"size-7\", classNames?.[UI.PreviousMonthButton]],\n }),\n [UI.Week]: cn(\"mt-2 flex justify-between\", classNames?.[UI.Week]),\n [UI.Weeks]: cn(classNames?.[UI.Weeks]),\n [UI.Weekday]: cn(\"text-muted-foreground min-w-8.5 text-xs font-medium\", classNames?.[UI.Weekday]),\n [UI.Weekdays]: cn(\"flex w-full justify-between\", classNames?.[UI.Weekdays]),\n [UI.WeekNumber]: cn(\n \"text-muted-foreground min-w-8.5 grid h-8 place-items-center text-xs font-normal [&+*]:rounded-l-lg\",\n classNames?.[UI.WeekNumber],\n ),\n [UI.WeekNumberHeader]: cn(\"min-w-8.5\", classNames?.[UI.WeekNumberHeader]),\n [UI.YearsDropdown]: cn(classNames?.[UI.YearsDropdown]),\n\n [SelectionState.range_end]: cn(\n \"to-secondary is-range-end rounded-r-lg bg-gradient-to-l first:rounded-l-lg\",\n classNames?.[SelectionState.range_end],\n ),\n [SelectionState.range_middle]: cn(\n \"is-range-middle bg-secondary text-secondary-foreground first:rounded-l-lg last:rounded-r-lg\",\n classNames?.[SelectionState.range_middle],\n ),\n [SelectionState.range_start]: cn(\n \"to-secondary is-range-start rounded-l-lg bg-gradient-to-r last:rounded-r-lg\",\n classNames?.[SelectionState.range_start],\n ),\n [SelectionState.selected]: cn(\"is-selected\", classNames?.[SelectionState.selected]),\n\n [DayFlag.disabled]: cn(\"is-disabled\", classNames?.[DayFlag.disabled]),\n [DayFlag.focused]: cn(\"is-focused\", classNames?.[DayFlag.focused]),\n [DayFlag.hidden]: cn(\"is-hidden size-8\", classNames?.[DayFlag.hidden]),\n [DayFlag.outside]: cn(\"is-outside\", classNames?.[DayFlag.outside]),\n [DayFlag.today]: cn(\"is-today\", classNames?.[DayFlag.today]),\n }}\n components={{\n Chevron,\n }}\n showOutsideDays={showOutsideDays}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CalendarRangeLabel\n * -------------------------------------------------------------------------- */\n\nfunction CalendarRangeLabel({\n date,\n formatStr = \"LLL dd, y\",\n placeholder = \"Pick a date\",\n}: {\n date: DateRange | undefined;\n formatStr?: string;\n placeholder?: string;\n}): ReactNode {\n if (!date?.from) {\n return <span className=\"truncate\">{placeholder}</span>;\n }\n\n const formattedFromDate = format(date.from, formatStr);\n\n if (!date.to) {\n return <span className=\"truncate\">{formattedFromDate}</span>;\n }\n\n const formattedToDate = format(date.to, formatStr);\n\n return (\n <span className=\"truncate\">\n {formattedFromDate} - {formattedToDate}\n </span>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CalendarLabel\n * -------------------------------------------------------------------------- */\n\nfunction CalendarLabel({\n date,\n formatStr = \"PPP\",\n placeholder = \"Pick a date\",\n}: {\n date: Date | undefined;\n formatStr?: string;\n placeholder?: string;\n}): ReactNode {\n if (!date) {\n return <span className=\"truncate\">{placeholder}</span>;\n }\n\n return <span className=\"truncate\">{format(date, formatStr)}</span>;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport type { DateRange, Matcher } from \"react-day-picker\";\nexport { Calendar, CalendarLabel, CalendarRangeLabel };\n"],"names":["__webpack_require__","e","Object","Symbol","Chevron","orientation","className","props","ChevronUpIcon","cn","ChevronDownIcon","ChevronLeftIcon","ChevronRightIcon","DotIcon","Calendar","showOutsideDays","classNames","isInteractive","undefined","DayPicker","UI","buttonVariants","SelectionState","DayFlag","CalendarRangeLabel","date","formatStr","placeholder","formattedFromDate","format","formattedToDate","CalendarLabel"],"mappings":";+PAAAA,CAAAA,oBAAoB,CAAC,CAAG,CAACC,EAAS,KACjC,IAAI,IAAI,KAAO,EACLD,oBAAoB,CAAC,CAAC,EAAY,IAAQ,CAACA,oBAAoB,CAAC,CAACC,EAAS,IACzEC,OAAO,cAAc,CAACD,EAAS,EAAK,CAAE,WAAY,GAAM,IAAK,CAAU,CAAC,EAAI,EAGxF,ECNAD,oBAAoB,CAAC,CAAG,CAAC,EAAK,IAAUE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAK,GCClFF,oBAAoB,CAAC,CAAG,IACpB,oBAAOG,QAA0BA,OAAO,WAAW,EACrDD,OAAO,cAAc,CAACD,EAASE,OAAO,WAAW,CAAE,CAAE,MAAO,QAAS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,W,UACbE,EAAkB,MAAIE,E,EAG7B,CAMA,SAASC,cAAc,CACrBN,KAAAA,CAAI,CACJC,UAAAA,EAAY,KAAK,CACjBC,YAAAA,EAAc,aAAa,CAK5B,SACC,EAIO,oCAAC,QAAK,UAAU,W,SAAYE,GAAAA,kCAAAA,MAAAA,EAAOJ,EAAMC,E,GAHvC,oCAAC,QAAK,UAAU,W,SAAYC,C,EAIvC,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,r)=>{for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{
|
|
1
|
+
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,r)=>{for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CardFooter:()=>CardFooter,CardAction:()=>CardAction,CardHeader:()=>CardHeader,CardContent:()=>CardContent,CardDescription:()=>CardDescription,CardTitle:()=>CardTitle,Card:()=>Card});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),utils_cjs_namespaceObject=require("../lib/utils.cjs");function Card({className:e,...r}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("bg-card text-card-foreground flex flex-col gap-6 overflow-auto rounded-xl border py-6 shadow-sm",e),"data-slot":"card",...r})}function CardHeader({className:e,...r}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("@container/card-header [.border-b]:pb-6 grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-[data-slot=card-action]:grid-cols-[1fr_auto]",e),"data-slot":"card-header",...r})}function CardTitle({children:e,className:r,...t}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("font-semibold leading-none",r),"data-slot":"card-title",...t,children:e})}function CardDescription({className:e,...r}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("text-muted-foreground text-sm",e),"data-slot":"card-description",...r})}function CardContent({className:e,...r}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("px-6",e),"data-slot":"card-content",...r})}function CardFooter({className:e,...r}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("[.border-t]:pt-6 flex items-center px-6",e),"data-slot":"card-footer",...r})}function CardAction({className:e,...r}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),"data-slot":"card-action",...r})}for(var __webpack_i__ in exports.Card=__webpack_exports__.Card,exports.CardAction=__webpack_exports__.CardAction,exports.CardContent=__webpack_exports__.CardContent,exports.CardDescription=__webpack_exports__.CardDescription,exports.CardFooter=__webpack_exports__.CardFooter,exports.CardHeader=__webpack_exports__.CardHeader,exports.CardTitle=__webpack_exports__.CardTitle,__webpack_exports__)-1===["Card","CardAction","CardContent","CardDescription","CardFooter","CardHeader","CardTitle"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
2
2
|
//# sourceMappingURL=card.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/card.cjs","sources":["webpack://@codefast/ui/./src/components/card.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Card\n * -------------------------------------------------------------------------- */\n\nfunction Card({ className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return (\n <div\n className={cn(\n \"bg-card text-card-foreground flex flex-col gap-6 overflow-auto rounded-xl border py-6 shadow-sm\",\n className,\n )}\n data-slot=\"card\"\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CardHeader\n * -------------------------------------------------------------------------- */\n\nfunction CardHeader({ className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return (\n <div\n className={cn(\n \"@container/card-header [.border-b]:pb-6 grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-[data-slot=card-action]:grid-cols-[1fr_auto]\",\n className,\n )}\n data-slot=\"card-header\"\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CardTitle\n * -------------------------------------------------------------------------- */\n\nfunction CardTitle({ children, className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return (\n <div className={cn(\"font-semibold leading-none\", className)} data-slot=\"card-title\" {...props}>\n {children}\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CardDescription\n * -------------------------------------------------------------------------- */\n\nfunction CardDescription({ className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return <div className={cn(\"text-muted-foreground text-sm\", className)} data-slot=\"card-description\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CardContent\n * -------------------------------------------------------------------------- */\n\nfunction CardContent({ className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return <div className={cn(\"px-6\", className)} data-slot=\"card-content\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CardFooter\n * -------------------------------------------------------------------------- */\n\nfunction CardFooter({ className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return (\n <div className={cn(\"[.border-t]:pt-6 flex items-center px-6\", className)} data-slot=\"card-footer\" {...props} />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CardAction\n * -------------------------------------------------------------------------- */\n\nfunction CardAction({ className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return (\n <div\n className={cn(\"col-start-2 row-span-2 row-start-1 self-start justify-self-end\", className)}\n data-slot=\"card-action\"\n {...props}\n />\n );\n}\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };\n"],"names":["Card","className","props","cn","CardHeader","CardTitle","children","CardDescription","CardContent","CardFooter","CardAction"],"mappings":"
|
|
1
|
+
{"version":3,"file":"components/card.cjs","sources":["webpack://@codefast/ui/webpack/runtime/define_property_getters","webpack://@codefast/ui/webpack/runtime/has_own_property","webpack://@codefast/ui/webpack/runtime/make_namespace_object","webpack://@codefast/ui/./src/components/card.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { ComponentProps, JSX } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Card\n * -------------------------------------------------------------------------- */\n\nfunction Card({ className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return (\n <div\n className={cn(\n \"bg-card text-card-foreground flex flex-col gap-6 overflow-auto rounded-xl border py-6 shadow-sm\",\n className,\n )}\n data-slot=\"card\"\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CardHeader\n * -------------------------------------------------------------------------- */\n\nfunction CardHeader({ className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return (\n <div\n className={cn(\n \"@container/card-header [.border-b]:pb-6 grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-[data-slot=card-action]:grid-cols-[1fr_auto]\",\n className,\n )}\n data-slot=\"card-header\"\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CardTitle\n * -------------------------------------------------------------------------- */\n\nfunction CardTitle({ children, className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return (\n <div className={cn(\"font-semibold leading-none\", className)} data-slot=\"card-title\" {...props}>\n {children}\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CardDescription\n * -------------------------------------------------------------------------- */\n\nfunction CardDescription({ className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return <div className={cn(\"text-muted-foreground text-sm\", className)} data-slot=\"card-description\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CardContent\n * -------------------------------------------------------------------------- */\n\nfunction CardContent({ className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return <div className={cn(\"px-6\", className)} data-slot=\"card-content\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CardFooter\n * -------------------------------------------------------------------------- */\n\nfunction CardFooter({ className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return (\n <div className={cn(\"[.border-t]:pt-6 flex items-center px-6\", className)} data-slot=\"card-footer\" {...props} />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CardAction\n * -------------------------------------------------------------------------- */\n\nfunction CardAction({ className, ...props }: ComponentProps<\"div\">): JSX.Element {\n return (\n <div\n className={cn(\"col-start-2 row-span-2 row-start-1 self-start justify-self-end\", className)}\n data-slot=\"card-action\"\n {...props}\n />\n );\n}\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };\n"],"names":["__webpack_require__","e","Object","Symbol","Card","className","props","cn","CardHeader","CardTitle","children","CardDescription","CardContent","CardFooter","CardAction"],"mappings":"+PAAAA,CAAAA,oBAAoB,CAAC,CAAG,CAACC,EAAS,KACjC,IAAI,IAAI,KAAO,EACLD,oBAAoB,CAAC,CAAC,EAAY,IAAQ,CAACA,oBAAoB,CAAC,CAACC,EAAS,IACzEC,OAAO,cAAc,CAACD,EAAS,EAAK,CAAE,WAAY,GAAM,IAAK,CAAU,CAAC,EAAI,AAAC,EAGzF,ECNAD,oBAAoB,CAAC,CAAG,CAAC,EAAK,IAAUE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAK,GCClFF,oBAAoB,CAAC,CAAG,AAACC,IACrB,AAAkB,aAAlB,OAAOE,QAA0BA,OAAO,WAAW,EACrDD,OAAO,cAAc,CAACD,EAASE,OAAO,WAAW,CAAE,CAAE,MAAO,QAAS,GAEtED,OAAO,cAAc,CAACD,EAAS,aAAc,CAAE,MAAO,EAAK,EAC5D,E,0ZCEA,SAASG,KAAK,CAAEC,UAAAA,CAAS,CAAE,GAAGC,EAA8B,EAC1D,MACE,oCAAC,OACC,UAAWC,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EACT,kGACAF,GAEF,YAAU,OACT,GAAGC,CAAK,A,EAGf,CAMA,SAASE,WAAW,CAAEH,UAAAA,CAAS,CAAE,GAAGC,EAA8B,EAChE,MACE,oCAAC,OACC,UAAWC,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EACT,6JACAF,GAEF,YAAU,cACT,GAAGC,CAAK,A,EAGf,CAMA,SAASG,UAAU,CAAEC,SAAAA,CAAQ,CAAEL,UAAAA,CAAS,CAAE,GAAGC,EAA8B,EACzE,MACE,oCAAC,OAAI,UAAWC,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EAAG,6BAA8BF,GAAY,YAAU,aAAc,GAAGC,CAAK,C,SAC1FI,C,EAGP,CAMA,SAASC,gBAAgB,CAAEN,UAAAA,CAAS,CAAE,GAAGC,EAA8B,EACrE,MAAO,oCAAC,OAAI,UAAWC,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EAAG,gCAAiCF,GAAY,YAAU,mBAAoB,GAAGC,CAAK,A,EAC/G,CAMA,SAASM,YAAY,CAAEP,UAAAA,CAAS,CAAE,GAAGC,EAA8B,EACjE,MAAO,oCAAC,OAAI,UAAWC,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EAAG,OAAQF,GAAY,YAAU,eAAgB,GAAGC,CAAK,A,EAClF,CAMA,SAASO,WAAW,CAAER,UAAAA,CAAS,CAAE,GAAGC,EAA8B,EAChE,MACE,oCAAC,OAAI,UAAWC,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EAAG,0CAA2CF,GAAY,YAAU,cAAe,GAAGC,CAAK,A,EAE/G,CAMA,SAASQ,WAAW,CAAET,UAAAA,CAAS,CAAE,GAAGC,EAA8B,EAChE,MACE,oCAAC,OACC,UAAWC,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EAAG,iEAAkEF,GAChF,YAAU,cACT,GAAGC,CAAK,A,EAGf,C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(a,{a:a}),a},__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CarouselNext:()=>CarouselNext,
|
|
2
|
+
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(a,{a:a}),a},__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CarouselNext:()=>CarouselNext,CarouselPrevious:()=>CarouselPrevious,createCarouselScope:()=>createCarouselScope,CarouselContent:()=>CarouselContent,CarouselItem:()=>CarouselItem,Carousel:()=>Carousel});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),react_context_namespaceObject=require("@radix-ui/react-context"),external_embla_carousel_react_namespaceObject=require("embla-carousel-react");var external_embla_carousel_react_default=__webpack_require__.n(external_embla_carousel_react_namespaceObject);let external_lucide_react_namespaceObject=require("lucide-react"),external_react_namespaceObject=require("react"),index_cjs_namespaceObject=require("./button/index.cjs"),utils_cjs_namespaceObject=require("../lib/utils.cjs"),CAROUSEL_NAME="Carousel",[createCarouselContext,createCarouselScope]=(0,react_context_namespaceObject.createContextScope)(CAROUSEL_NAME),[CarouselContextProvider,useCarouselContext]=createCarouselContext(CAROUSEL_NAME);function Carousel({__scopeCarousel:e,children:a,className:t,opts:r,orientation:s,plugins:c,setApi:_,...o}){let[l,n]=external_embla_carousel_react_default()({...r,axis:"vertical"===s?"y":"x"},c),[u,i]=(0,external_react_namespaceObject.useState)(!1),[p,x]=(0,external_react_namespaceObject.useState)(!1),b=(0,external_react_namespaceObject.useCallback)(e=>{e&&(i(e.canScrollPrev()),x(e.canScrollNext()))},[]),m=(0,external_react_namespaceObject.useCallback)(()=>{n?.scrollPrev()},[n]),C=(0,external_react_namespaceObject.useCallback)(()=>{n?.scrollNext()},[n]),j=(0,external_react_namespaceObject.useCallback)(e=>{"ArrowLeft"===e.key?(e.preventDefault(),m()):"ArrowRight"===e.key&&(e.preventDefault(),C())},[m,C]);return(0,external_react_namespaceObject.useEffect)(()=>{n&&_&&_(n)},[n,_]),(0,external_react_namespaceObject.useEffect)(()=>{if(n)return b(n),n.on("reInit",b),n.on("select",b),()=>{n.off("select",b)}},[n,b]),(0,jsx_runtime_namespaceObject.jsx)(CarouselContextProvider,{api:n,canScrollNext:p,canScrollPrev:u,carouselRef:l,opts:r,orientation:s??(r?.axis==="y"?"vertical":"horizontal"),scope:e,scrollNext:C,scrollPrev:m,children:(0,jsx_runtime_namespaceObject.jsx)("div",{"aria-roledescription":"carousel",className:(0,utils_cjs_namespaceObject.cn)("relative",t),"data-slot":"carousel",role:"region",onKeyDownCapture:j,...o,children:a})})}let CAROUSEL_CONTENT_NAME="CarouselContent";function CarouselContent({__scopeCarousel:e,className:a,classNames:t,...r}){let{carouselRef:s,orientation:c}=useCarouselContext("CarouselContent",e);return(0,jsx_runtime_namespaceObject.jsx)("div",{ref:s,className:(0,utils_cjs_namespaceObject.cn)("overflow-hidden",t?.wrapper),"data-slot":"carousel-content",children:(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("flex","horizontal"===c?"-ml-4":"-mt-4 flex-col",t?.content,a),...r})})}let CAROUSEL_ITEM_NAME="CarouselItem";function CarouselItem({__scopeCarousel:e,className:a,...t}){let{orientation:r}=useCarouselContext("CarouselItem",e);return(0,jsx_runtime_namespaceObject.jsx)("div",{"aria-roledescription":"slide",className:(0,utils_cjs_namespaceObject.cn)("min-w-0 shrink-0 grow-0 basis-full","horizontal"===r?"pl-4":"pt-4",a),"data-slot":"carousel-item",role:"group",...t})}let CAROUSEL_PREVIOUS_NAME="CarouselPrevious";function CarouselPrevious({__scopeCarousel:e,className:a,size:t="icon",variant:r="outline",...s}){let{canScrollPrev:c,orientation:_,scrollPrev:o}=useCarouselContext("CarouselPrevious",e);return(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Button,{"aria-label":"Previous slide",className:(0,utils_cjs_namespaceObject.cn)("absolute size-8 shadow-none","horizontal"===_?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",a),"data-slot":"carousel-previous",disabled:!c,prefix:(0,jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ArrowLeftIcon,{}),size:t,variant:r,onClick:o,...s,children:(0,jsx_runtime_namespaceObject.jsx)("span",{className:"sr-only",children:"Previous slide"})})}let CAROUSEL_NEXT_NAME="CarouselNext";function CarouselNext({__scopeCarousel:e,className:a,size:t="icon",variant:r="outline",...s}){let{canScrollNext:c,orientation:_,scrollNext:o}=useCarouselContext("CarouselNext",e);return(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Button,{"aria-label":"Next slide",className:(0,utils_cjs_namespaceObject.cn)("absolute size-8 shadow-none","horizontal"===_?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",a),"data-slot":"carousel-next",disabled:!c,prefix:(0,jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ArrowRightIcon,{}),size:t,variant:r,onClick:o,...s,children:(0,jsx_runtime_namespaceObject.jsx)("span",{className:"sr-only",children:"Next slide"})})}for(var __webpack_i__ in exports.Carousel=__webpack_exports__.Carousel,exports.CarouselContent=__webpack_exports__.CarouselContent,exports.CarouselItem=__webpack_exports__.CarouselItem,exports.CarouselNext=__webpack_exports__.CarouselNext,exports.CarouselPrevious=__webpack_exports__.CarouselPrevious,exports.createCarouselScope=__webpack_exports__.createCarouselScope,__webpack_exports__)-1===["Carousel","CarouselContent","CarouselItem","CarouselNext","CarouselPrevious","createCarouselScope"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
3
3
|
//# sourceMappingURL=carousel.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/carousel.cjs","sources":["webpack://@codefast/ui/./src/components/carousel.tsx"],"sourcesContent":["\n\nimport type { Scope } from \"@radix-ui/react-context\";\nimport type { ComponentProps, JSX, KeyboardEvent } from \"react\";\n\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport useEmblaCarousel, { type UseEmblaCarouselType } from \"embla-carousel-react\";\nimport { ArrowLeftIcon, ArrowRightIcon } from \"lucide-react\";\nimport { useCallback, useEffect, useState } from \"react\";\n\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Context: Carousel\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_NAME = \"Carousel\";\n\ntype ScopedProps<P> = P & { __scopeCarousel?: Scope };\n\nconst [createCarouselContext, createCarouselScope] = createContextScope(CAROUSEL_NAME);\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ninterface BaseCarouselProps {\n opts?: CarouselOptions;\n orientation?: \"horizontal\" | \"vertical\";\n plugins?: CarouselPlugin;\n setApi?: (api: CarouselApi) => void;\n}\n\ntype CarouselContextValue = BaseCarouselProps & {\n api: ReturnType<typeof useEmblaCarousel>[1];\n canScrollNext: boolean;\n canScrollPrev: boolean;\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n scrollNext: () => void;\n scrollPrev: () => void;\n};\n\nconst [CarouselContextProvider, useCarouselContext] = createCarouselContext<CarouselContextValue>(CAROUSEL_NAME);\n\n/* -----------------------------------------------------------------------------\n * Component: Carousel\n * -------------------------------------------------------------------------- */\n\nfunction Carousel({\n __scopeCarousel,\n children,\n className,\n opts,\n orientation,\n plugins,\n setApi,\n ...props\n}: ScopedProps<BaseCarouselProps & ComponentProps<\"div\">>): JSX.Element {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"vertical\" ? \"y\" : \"x\",\n },\n plugins,\n );\n\n const [canScrollPrev, setCanScrollPrev] = useState(false);\n const [canScrollNext, setCanScrollNext] = useState(false);\n\n const onSelect = useCallback((carouselApi: CarouselApi) => {\n if (!carouselApi) {\n return;\n }\n\n setCanScrollPrev(carouselApi.canScrollPrev());\n setCanScrollNext(carouselApi.canScrollNext());\n }, []);\n\n const scrollPrev = useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n\n setApi(api);\n }, [api, setApi]);\n\n useEffect(() => {\n if (!api) {\n return;\n }\n\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContextProvider\n api={api}\n canScrollNext={canScrollNext}\n canScrollPrev={canScrollPrev}\n carouselRef={carouselRef}\n opts={opts}\n orientation={orientation ?? (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\")}\n scope={__scopeCarousel}\n scrollNext={scrollNext}\n scrollPrev={scrollPrev}\n >\n <div\n aria-roledescription=\"carousel\"\n className={cn(\"relative\", className)}\n data-slot=\"carousel\"\n role=\"region\"\n onKeyDownCapture={handleKeyDown}\n {...props}\n >\n {children}\n </div>\n </CarouselContextProvider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CarouselContent\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_CONTENT_NAME = \"CarouselContent\";\n\nfunction CarouselContent({\n __scopeCarousel,\n className,\n classNames,\n ...props\n}: ScopedProps<\n ComponentProps<\"div\"> & {\n classNames?: {\n content?: string;\n wrapper?: string;\n };\n }\n>): JSX.Element {\n const { carouselRef, orientation } = useCarouselContext(CAROUSEL_CONTENT_NAME, __scopeCarousel);\n\n return (\n <div ref={carouselRef} className={cn(\"overflow-hidden\", classNames?.wrapper)} data-slot=\"carousel-content\">\n <div\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n classNames?.content,\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CarouselItem\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_ITEM_NAME = \"CarouselItem\";\n\nfunction CarouselItem({ __scopeCarousel, className, ...props }: ScopedProps<ComponentProps<\"div\">>): JSX.Element {\n const { orientation } = useCarouselContext(CAROUSEL_ITEM_NAME, __scopeCarousel);\n\n return (\n <div\n aria-roledescription=\"slide\"\n className={cn(\"min-w-0 shrink-0 grow-0 basis-full\", orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\", className)}\n data-slot=\"carousel-item\"\n role=\"group\"\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CarouselPrevious\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_PREVIOUS_NAME = \"CarouselPrevious\";\n\nfunction CarouselPrevious({\n __scopeCarousel,\n className,\n size = \"icon\",\n variant = \"outline\",\n ...props\n}: ScopedProps<ComponentProps<typeof Button>>): JSX.Element {\n const { canScrollPrev, orientation, scrollPrev } = useCarouselContext(CAROUSEL_PREVIOUS_NAME, __scopeCarousel);\n\n return (\n <Button\n aria-label=\"Previous slide\"\n className={cn(\n \"absolute size-8 shadow-none\",\n orientation === \"horizontal\"\n ? \"-left-12 top-1/2 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n data-slot=\"carousel-previous\"\n disabled={!canScrollPrev}\n prefix={<ArrowLeftIcon />}\n size={size}\n variant={variant}\n onClick={scrollPrev}\n {...props}\n >\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CarouselNext\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_NEXT_NAME = \"CarouselNext\";\n\nfunction CarouselNext({\n __scopeCarousel,\n className,\n size = \"icon\",\n variant = \"outline\",\n ...props\n}: ScopedProps<ComponentProps<typeof Button>>): JSX.Element {\n const { canScrollNext, orientation, scrollNext } = useCarouselContext(CAROUSEL_NEXT_NAME, __scopeCarousel);\n\n return (\n <Button\n aria-label=\"Next slide\"\n className={cn(\n \"absolute size-8 shadow-none\",\n orientation === \"horizontal\"\n ? \"-right-12 top-1/2 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n data-slot=\"carousel-next\"\n disabled={!canScrollNext}\n prefix={<ArrowRightIcon />}\n size={size}\n variant={variant}\n onClick={scrollNext}\n {...props}\n >\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport type { CarouselApi };\nexport { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, createCarouselScope };\n"],"names":["CAROUSEL_NAME","createCarouselContext","createCarouselScope","createContextScope","CarouselContextProvider","useCarouselContext","Carousel","__scopeCarousel","children","className","opts","orientation","plugins","setApi","props","carouselRef","api","useEmblaCarousel","canScrollPrev","setCanScrollPrev","useState","canScrollNext","setCanScrollNext","onSelect","useCallback","carouselApi","scrollPrev","scrollNext","handleKeyDown","event","useEffect","cn","CAROUSEL_CONTENT_NAME","CarouselContent","classNames","CAROUSEL_ITEM_NAME","CarouselItem","CAROUSEL_PREVIOUS_NAME","CarouselPrevious","size","variant","Button","ArrowLeftIcon","CAROUSEL_NEXT_NAME","CarouselNext","ArrowRightIcon"],"mappings":";8lDAiBMA,cAAgB,WAIhB,CAACC,sBAAuBC,oBAAoB,CAAGC,GAAAA,8BAAAA,kBAAAA,EAAmBH,eAuBlE,CAACI,wBAAyBC,mBAAmB,CAAGJ,sBAA4CD,eAMlG,SAASM,SAAS,CAChBC,gBAAAA,CAAe,CACfC,SAAAA,CAAQ,CACRC,UAAAA,CAAS,CACTC,KAAAA,CAAI,CACJC,YAAAA,CAAW,CACXC,QAAAA,CAAO,CACPC,OAAAA,CAAM,CACN,GAAGC,EACoD,EACvD,GAAM,CAACC,EAAaC,EAAI,CAAGC,wCACzB,CACE,GAAGP,CAAI,CACP,KAAMC,aAAAA,EAA6B,IAAM,GAC3C,EACAC,GAGI,CAACM,EAAeC,EAAiB,CAAGC,GAAAA,+BAAAA,QAAAA,EAAS,IAC7C,CAACC,EAAeC,EAAiB,CAAGF,GAAAA,+BAAAA,QAAAA,EAAS,IAE7CG,EAAWC,GAAAA,+BAAAA,WAAAA,EAAY,IACtBC,IAILN,EAAiBM,EAAY,aAAa,IAC1CH,EAAiBG,EAAY,aAAa,IA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,CACbC,QAAAA,EAAU,SAAS,CACnB,GAAG1B,EACwC,EAC3C,GAAM,CAAEO,cAAAA,CAAa,CAAEV,YAAAA,CAAW,CAAEgB,WAAAA,CAAU,CAAE,CAAGtB,mBAT1B,eASiEE,GAE1F,MACE,oCAACkC,0BAAAA,MAAMA,CAAAA,CACL,aAAW,aACX,UAAWV,GAAAA,0BAAAA,EAAAA,EACT,8BACApB,eAAAA,EACI,qCACA,iDACJF,GAEF,YAAU,gBACV,SAAU,CAACY,EACX,OAAQ,oCAACwB,sCAAAA,cAAcA,CAAAA,CAAAA,GACvB,KAAMN,EACN,QAASC,EACT,QAASb,EACR,GAAGb,CAAK,C,SAET,oCAAC,QAAK,UAAU,U,SAAU,Y,IAGhC,C"}
|
|
1
|
+
{"version":3,"file":"components/carousel.cjs","sources":["webpack://@codefast/ui/webpack/runtime/compat_get_default_export","webpack://@codefast/ui/webpack/runtime/define_property_getters","webpack://@codefast/ui/webpack/runtime/has_own_property","webpack://@codefast/ui/webpack/runtime/make_namespace_object","webpack://@codefast/ui/./src/components/carousel.tsx"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\n\nimport type { Scope } from \"@radix-ui/react-context\";\nimport type { ComponentProps, JSX, KeyboardEvent } from \"react\";\n\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport useEmblaCarousel, { type UseEmblaCarouselType } from \"embla-carousel-react\";\nimport { ArrowLeftIcon, ArrowRightIcon } from \"lucide-react\";\nimport { useCallback, useEffect, useState } from \"react\";\n\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Context: Carousel\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_NAME = \"Carousel\";\n\ntype ScopedProps<P> = P & { __scopeCarousel?: Scope };\n\nconst [createCarouselContext, createCarouselScope] = createContextScope(CAROUSEL_NAME);\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ninterface BaseCarouselProps {\n opts?: CarouselOptions;\n orientation?: \"horizontal\" | \"vertical\";\n plugins?: CarouselPlugin;\n setApi?: (api: CarouselApi) => void;\n}\n\ntype CarouselContextValue = BaseCarouselProps & {\n api: ReturnType<typeof useEmblaCarousel>[1];\n canScrollNext: boolean;\n canScrollPrev: boolean;\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n scrollNext: () => void;\n scrollPrev: () => void;\n};\n\nconst [CarouselContextProvider, useCarouselContext] = createCarouselContext<CarouselContextValue>(CAROUSEL_NAME);\n\n/* -----------------------------------------------------------------------------\n * Component: Carousel\n * -------------------------------------------------------------------------- */\n\nfunction Carousel({\n __scopeCarousel,\n children,\n className,\n opts,\n orientation,\n plugins,\n setApi,\n ...props\n}: ScopedProps<BaseCarouselProps & ComponentProps<\"div\">>): JSX.Element {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"vertical\" ? \"y\" : \"x\",\n },\n plugins,\n );\n\n const [canScrollPrev, setCanScrollPrev] = useState(false);\n const [canScrollNext, setCanScrollNext] = useState(false);\n\n const onSelect = useCallback((carouselApi: CarouselApi) => {\n if (!carouselApi) {\n return;\n }\n\n setCanScrollPrev(carouselApi.canScrollPrev());\n setCanScrollNext(carouselApi.canScrollNext());\n }, []);\n\n const scrollPrev = useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n\n setApi(api);\n }, [api, setApi]);\n\n useEffect(() => {\n if (!api) {\n return;\n }\n\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContextProvider\n api={api}\n canScrollNext={canScrollNext}\n canScrollPrev={canScrollPrev}\n carouselRef={carouselRef}\n opts={opts}\n orientation={orientation ?? (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\")}\n scope={__scopeCarousel}\n scrollNext={scrollNext}\n scrollPrev={scrollPrev}\n >\n <div\n aria-roledescription=\"carousel\"\n className={cn(\"relative\", className)}\n data-slot=\"carousel\"\n role=\"region\"\n onKeyDownCapture={handleKeyDown}\n {...props}\n >\n {children}\n </div>\n </CarouselContextProvider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CarouselContent\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_CONTENT_NAME = \"CarouselContent\";\n\nfunction CarouselContent({\n __scopeCarousel,\n className,\n classNames,\n ...props\n}: ScopedProps<\n ComponentProps<\"div\"> & {\n classNames?: {\n content?: string;\n wrapper?: string;\n };\n }\n>): JSX.Element {\n const { carouselRef, orientation } = useCarouselContext(CAROUSEL_CONTENT_NAME, __scopeCarousel);\n\n return (\n <div ref={carouselRef} className={cn(\"overflow-hidden\", classNames?.wrapper)} data-slot=\"carousel-content\">\n <div\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n classNames?.content,\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CarouselItem\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_ITEM_NAME = \"CarouselItem\";\n\nfunction CarouselItem({ __scopeCarousel, className, ...props }: ScopedProps<ComponentProps<\"div\">>): JSX.Element {\n const { orientation } = useCarouselContext(CAROUSEL_ITEM_NAME, __scopeCarousel);\n\n return (\n <div\n aria-roledescription=\"slide\"\n className={cn(\"min-w-0 shrink-0 grow-0 basis-full\", orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\", className)}\n data-slot=\"carousel-item\"\n role=\"group\"\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CarouselPrevious\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_PREVIOUS_NAME = \"CarouselPrevious\";\n\nfunction CarouselPrevious({\n __scopeCarousel,\n className,\n size = \"icon\",\n variant = \"outline\",\n ...props\n}: ScopedProps<ComponentProps<typeof Button>>): JSX.Element {\n const { canScrollPrev, orientation, scrollPrev } = useCarouselContext(CAROUSEL_PREVIOUS_NAME, __scopeCarousel);\n\n return (\n <Button\n aria-label=\"Previous slide\"\n className={cn(\n \"absolute size-8 shadow-none\",\n orientation === \"horizontal\"\n ? \"-left-12 top-1/2 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n data-slot=\"carousel-previous\"\n disabled={!canScrollPrev}\n prefix={<ArrowLeftIcon />}\n size={size}\n variant={variant}\n onClick={scrollPrev}\n {...props}\n >\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CarouselNext\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_NEXT_NAME = \"CarouselNext\";\n\nfunction CarouselNext({\n __scopeCarousel,\n className,\n size = \"icon\",\n variant = \"outline\",\n ...props\n}: ScopedProps<ComponentProps<typeof Button>>): JSX.Element {\n const { canScrollNext, orientation, scrollNext } = useCarouselContext(CAROUSEL_NEXT_NAME, __scopeCarousel);\n\n return (\n <Button\n aria-label=\"Next slide\"\n className={cn(\n \"absolute size-8 shadow-none\",\n orientation === \"horizontal\"\n ? \"-right-12 top-1/2 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n data-slot=\"carousel-next\"\n disabled={!canScrollNext}\n prefix={<ArrowRightIcon />}\n size={size}\n variant={variant}\n onClick={scrollNext}\n {...props}\n >\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport type { CarouselApi };\nexport { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, createCarouselScope };\n"],"names":["__webpack_require__","e","Object","Symbol","CAROUSEL_NAME","createCarouselContext","createCarouselScope","createContextScope","CarouselContextProvider","useCarouselContext","Carousel","__scopeCarousel","children","className","opts","orientation","plugins","setApi","props","carouselRef","api","useEmblaCarousel","canScrollPrev","setCanScrollPrev","useState","canScrollNext","setCanScrollNext","onSelect","useCallback","carouselApi","scrollPrev","scrollNext","handleKeyDown","event","useEffect","cn","CAROUSEL_CONTENT_NAME","CarouselContent","classNames","CAROUSEL_ITEM_NAME","CarouselItem","CAROUSEL_PREVIOUS_NAME","CarouselPrevious","size","variant","Button","ArrowLeftIcon","CAROUSEL_NEXT_NAME","CarouselNext","ArrowRightIcon"],"mappings":";+PACAA,CAAAA,oBAAoB,CAAC,CAAG,IACvB,IAAI,EAAS,GAAU,EAAO,UAAU,CACvC,IAAO,EAAO,OAAU,CACxB,IAAO,EAER,OADAA,oBAAoB,CAAC,CAAC,EAAQ,CAAE,EAAG,CAAO,GACnC,CACR,EC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AEO,cAAAA,CAAa,CAAEV,YAAAA,CAAW,CAAEgB,WAAAA,CAAU,CAAE,CAAGtB,mBAT1B,eASiEE,GAE1F,MACE,oCAACkC,0BAAAA,MAAMA,CAAAA,CACL,aAAW,aACX,UAAWV,GAAAA,0BAAAA,EAAAA,EACT,8BACApB,eAAAA,EACI,qCACA,iDACJF,GAEF,YAAU,gBACV,SAAU,CAACY,EACX,OAAQ,oCAACwB,sCAAAA,cAAcA,CAAAA,CAAAA,GACvB,KAAMN,EACN,QAASC,EACT,QAASb,EACR,GAAGb,CAAK,C,SAET,oCAAC,QAAK,UAAU,U,SAAU,Y,IAGhC,C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{
|
|
2
|
+
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ChartTooltip:()=>ChartTooltip,ChartContainer:()=>ChartContainer,ChartLegendContent:()=>ChartLegendContent,ChartTooltipContent:()=>ChartTooltipContent,ChartLegend:()=>ChartLegend,createChartScope:()=>createChartScope,ChartStyle:()=>ChartStyle});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),react_context_namespaceObject=require("@radix-ui/react-context"),external_react_namespaceObject=require("react"),external_recharts_namespaceObject=require("recharts"),utils_cjs_namespaceObject=require("../lib/utils.cjs"),CHART_PROVIDER_NAME="ChartProvider",THEMES={dark:".dark",light:""},[createChartContext,createChartScope]=(0,react_context_namespaceObject.createContextScope)(CHART_PROVIDER_NAME),[ChartContextProvider,useChartContext]=createChartContext(CHART_PROVIDER_NAME);function ChartContainer({__scopeChart:e,id:t,children:r,className:a,config:n,...c}){let s=(0,external_react_namespaceObject.useId)(),o=`chart-${t||s}`;return(0,jsx_runtime_namespaceObject.jsx)(ChartContextProvider,{config:n,scope:e,children:(0,jsx_runtime_namespaceObject.jsxs)("div",{className:(0,utils_cjs_namespaceObject.cn)("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-surface]:outline-hidden flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-sector[stroke='#fff']]:stroke-transparent",a),"data-chart":o,"data-slot":"chart",...c,children:[(0,jsx_runtime_namespaceObject.jsx)(ChartStyle,{config:n,id:o}),(0,jsx_runtime_namespaceObject.jsx)(external_recharts_namespaceObject.ResponsiveContainer,{children:r})]})})}function ChartStyle({id:e,config:t}){let r=(0,external_react_namespaceObject.useMemo)(()=>generateCSS(e,t),[e,t]);return(0,jsx_runtime_namespaceObject.jsx)("style",{dangerouslySetInnerHTML:{__html:r}})}let ChartTooltip=external_recharts_namespaceObject.Tooltip,CHART_TOOLTIP_CONTENT_NAME="ChartTooltipContent";function ChartTooltipContent({__scopeChart:e,active:t,className:r,color:a,formatter:n,hideIndicator:c=!1,hideLabel:s=!1,indicator:o="dot",label:_,labelClassName:i,labelFormatter:l,labelKey:p,nameKey:d,payload:u}){let{config:m}=useChartContext("ChartTooltipContent",e),h=(0,external_react_namespaceObject.useMemo)(()=>{if(s||!u?.length)return null;let[e]=u,t=`${p||e.dataKey||e.name||"value"}`,r=getPayloadConfigFromPayload(m,e,t),a=p||"string"!=typeof _?r?.label:m[_]?.label||_;return l?(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("font-medium",i),children:l(a,u)}):a?(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("font-medium",i),children:a}):null},[m,s,_,i,l,p,u]);if(!t||!u?.length)return null;let j=1===u.length&&"dot"!==o;return(0,jsx_runtime_namespaceObject.jsxs)("div",{className:(0,utils_cjs_namespaceObject.cn)("bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",r),children:[j?null:h,(0,jsx_runtime_namespaceObject.jsx)("div",{className:"grid gap-1.5",children:u.map((e,t)=>{let r=`${d||e.name||e.dataKey||"value"}`,s=getPayloadConfigFromPayload(m,e,r),_=a||e.payload.fill||e.color;return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:size-2.5","dot"===o&&"items-center"),children:n&&void 0!==e.value&&e.name?n(e.value,e.name,e,t,e.payload):(0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment,{children:[s?.icon?(0,jsx_runtime_namespaceObject.jsx)(s.icon,{}):!c&&(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("border-(--color-border) bg-(--color-bg) rounded-xs shrink-0",{"h-2.5 w-2.5":"dot"===o,"my-0.5":j&&"dashed"===o,"w-0 border border-dashed bg-transparent":"dashed"===o,"w-1":"line"===o}),style:{"--color-bg":_,"--color-border":_}}),(0,jsx_runtime_namespaceObject.jsxs)("div",{className:(0,utils_cjs_namespaceObject.cn)("flex flex-1 justify-between leading-none",j?"items-end":"items-center"),children:[(0,jsx_runtime_namespaceObject.jsxs)("div",{className:"grid gap-1.5",children:[j?h:null,(0,jsx_runtime_namespaceObject.jsx)("span",{className:"text-muted-foreground",children:s?.label||e.name})]}),e.value?(0,jsx_runtime_namespaceObject.jsx)("span",{className:"text-foreground font-mono font-medium tabular-nums",children:e.value.toLocaleString()}):null]})]})},e.dataKey)})})]})}let ChartLegend=external_recharts_namespaceObject.Legend,CHART_LEGEND_CONTENT_NAME="ChartLegendContent";function ChartLegendContent({__scopeChart:e,className:t,hideIcon:r=!1,nameKey:a,payload:n,verticalAlign:c="bottom"}){let{config:s}=useChartContext("ChartLegendContent",e);return n?.length?(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,utils_cjs_namespaceObject.cn)("flex items-center justify-center gap-4","top"===c?"pb-3":"pt-3",t),children:n.map(e=>{let t="value";a?t=a:e.dataKey&&(t=String(e.dataKey));let n=getPayloadConfigFromPayload(s,e,t);return(0,jsx_runtime_namespaceObject.jsxs)("div",{className:(0,utils_cjs_namespaceObject.cn)("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3"),children:[n?.icon&&!r?(0,jsx_runtime_namespaceObject.jsx)(n.icon,{}):(0,jsx_runtime_namespaceObject.jsx)("div",{className:"size-2 shrink-0 rounded-md",style:{backgroundColor:e.color}}),n?.label]},String(e.value))})}):null}function getPayloadConfigFromPayload(e,t,r){if(!isValidObject(t))return;let a="payload"in t&&isValidObject(t.payload)?t.payload:void 0,n=getConfigLabelKey(t,a,r);return n in e?e[n]:e[r]}function isValidObject(e){return"object"==typeof e&&null!==e}function getConfigLabelKey(e,t,r){return r in e&&"string"==typeof e[r]?e[r]:t&&r in t&&"string"==typeof t[r]?t[r]:r}function generateThemeCSS(e,t,r){let a=[];for(let[n,c]of(a.push(`${THEMES[e]} [data-chart=${t}] {`),r)){let t=c?.theme?.[e]||c?.color;t&&a.push(` --color-${n}: ${t};`)}return a.push("}"),a.join("\n")}function generateCSS(e,t){let r=Object.entries(t).filter(([e,t])=>t?.theme||t?.color),a=[];for(let t of Object.keys(THEMES)){let n=generateThemeCSS(t,e,r);a.push(n)}return a.join("\n")}for(var __webpack_i__ in exports.ChartContainer=__webpack_exports__.ChartContainer,exports.ChartLegend=__webpack_exports__.ChartLegend,exports.ChartLegendContent=__webpack_exports__.ChartLegendContent,exports.ChartStyle=__webpack_exports__.ChartStyle,exports.ChartTooltip=__webpack_exports__.ChartTooltip,exports.ChartTooltipContent=__webpack_exports__.ChartTooltipContent,exports.createChartScope=__webpack_exports__.createChartScope,__webpack_exports__)-1===["ChartContainer","ChartLegend","ChartLegendContent","ChartStyle","ChartTooltip","ChartTooltipContent","createChartScope"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
3
3
|
//# sourceMappingURL=chart.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/chart.cjs","sources":["webpack://@codefast/ui/./src/components/chart.tsx"],"sourcesContent":["\n\nimport type { Scope } from \"@radix-ui/react-context\";\nimport type { ComponentProps, ComponentType, CSSProperties, JSX, ReactNode } from \"react\";\nimport type { NameType, Payload, ValueType } from \"recharts/types/component/DefaultTooltipContent\";\n\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId, useMemo } from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\n\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Context: ChartProvider\n * ---------------------------------------------------------------------------*/\n\nconst CHART_PROVIDER_NAME = \"ChartProvider\";\n\ntype ScopedProps<P> = P & { __scopeChart?: Scope };\n\n/**\n * Supported themes in the application\n */\ntype Theme = \"dark\" | \"light\";\n\n/**\n * Mapping between themes and their corresponding CSS classes\n */\nconst THEMES: Record<Theme, string> = {\n dark: \".dark\",\n light: \"\",\n};\n\n/**\n * Configuration for icon and label display in charts\n */\ninterface IconLabelConfig {\n /** Icon to display with data */\n icon?: ComponentType;\n /** Label to display with data */\n label?: ReactNode;\n}\n\n/**\n * Single color configuration for chart elements\n */\ntype ColorConfig = {\n /** Valid CSS color (hex, rgba, etc.) */\n color?: string;\n} & { theme?: never };\n\n/**\n * Theme-based color configuration for chart elements\n */\ntype ThemeConfig = {\n /** Map of colors for each theme mode */\n theme: Record<Theme, string>;\n} & { color?: never };\n\n/**\n * Complete configuration for a chart element\n */\ntype ChartConfigItem = (ColorConfig | ThemeConfig) & IconLabelConfig;\n\n/**\n * Configuration for the entire chart organized by series/data keys\n * Where keys are the names of data in the chart\n */\ntype ChartConfig = Record<string, ChartConfigItem | undefined>;\n\n/**\n * Value provided by Chart Context\n */\ninterface ChartContextValue {\n /** Display configuration for the chart */\n config: ChartConfig;\n}\n\nconst [createChartContext, createChartScope] = createContextScope(CHART_PROVIDER_NAME);\n\nconst [ChartContextProvider, useChartContext] = createChartContext<ChartContextValue>(CHART_PROVIDER_NAME);\n\n/* -----------------------------------------------------------------------------\n * Component: Chart\n * -------------------------------------------------------------------------- */\n\nfunction ChartContainer({\n __scopeChart,\n id,\n children,\n className,\n config,\n ...props\n}: ScopedProps<\n ComponentProps<\"div\"> & {\n children: ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>[\"children\"];\n config: ChartConfig;\n }\n>): JSX.Element {\n const uniqueId = useId();\n const chartId = `chart-${id || uniqueId}`;\n\n return (\n <ChartContextProvider config={config} scope={__scopeChart}>\n <div\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-surface]:outline-hidden flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-sector[stroke='#fff']]:stroke-transparent\",\n className,\n )}\n data-chart={chartId}\n data-slot=\"chart\"\n {...props}\n >\n <ChartStyle config={config} id={chartId} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContextProvider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ChartStyle\n * -------------------------------------------------------------------------- */\n\nfunction ChartStyle({ id, config }: { config: ChartConfig; id: string }): ReactNode {\n const cssString = useMemo(() => generateCSS(id, config), [id, config]);\n\n return <style dangerouslySetInnerHTML={{ __html: cssString }} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltip\n * -------------------------------------------------------------------------- */\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltipContent\n * -------------------------------------------------------------------------- */\n\nconst CHART_TOOLTIP_CONTENT_NAME = \"ChartTooltipContent\";\n\nfunction ChartTooltipContent({\n __scopeChart,\n active,\n className,\n color,\n formatter,\n hideIndicator = false,\n hideLabel = false,\n indicator = \"dot\",\n label,\n labelClassName,\n labelFormatter,\n labelKey,\n nameKey,\n payload,\n}: ScopedProps<\n ComponentProps<typeof RechartsPrimitive.Tooltip> &\n Omit<ComponentProps<\"div\">, \"content\"> & {\n hideIndicator?: boolean;\n hideLabel?: boolean;\n indicator?: \"dashed\" | \"dot\" | \"line\";\n labelKey?: string;\n nameKey?: string;\n }\n>): ReactNode {\n const { config } = useChartContext(CHART_TOOLTIP_CONTENT_NAME, __scopeChart);\n\n const tooltipLabel = useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n\n const key = `${labelKey || item.dataKey || item.name || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value = !labelKey && typeof label === \"string\" ? config[label]?.label || label : itemConfig?.label;\n\n if (labelFormatter) {\n return <div className={cn(\"font-medium\", labelClassName)}>{labelFormatter(value, payload)}</div>;\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn(\"font-medium\", labelClassName)}>{value}</div>;\n }, [config, hideLabel, label, labelClassName, labelFormatter, labelKey, payload]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== \"dot\";\n\n return (\n <div\n className={cn(\n \"bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl\",\n className,\n )}\n >\n {nestLabel ? null : tooltipLabel}\n <div className=\"grid gap-1.5\">\n {payload.map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || (item.payload as { fill?: string }).fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n \"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:size-2.5\",\n indicator === \"dot\" && \"items-center\",\n )}\n >\n {formatter && item.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload as Payload<ValueType, NameType>[])\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\"border-(--color-border) bg-(--color-bg) rounded-xs shrink-0\", {\n \"h-2.5 w-2.5\": indicator === \"dot\",\n \"my-0.5\": nestLabel && indicator === \"dashed\",\n \"w-0 border border-dashed bg-transparent\": indicator === \"dashed\",\n \"w-1\": indicator === \"line\",\n })}\n style={\n {\n \"--color-bg\": indicatorColor,\n \"--color-border\": indicatorColor,\n } as CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\"flex flex-1 justify-between leading-none\", nestLabel ? \"items-end\" : \"items-center\")}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value ? (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n ) : null}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegend\n * -------------------------------------------------------------------------- */\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegendContent\n * -------------------------------------------------------------------------- */\n\nconst CHART_LEGEND_CONTENT_NAME = \"ChartLegendContent\";\n\nfunction ChartLegendContent({\n __scopeChart,\n className,\n hideIcon = false,\n nameKey,\n payload,\n verticalAlign = \"bottom\",\n}: ScopedProps<\n ComponentProps<\"div\"> &\n Pick<RechartsPrimitive.LegendProps, \"payload\" | \"verticalAlign\"> & {\n hideIcon?: boolean;\n nameKey?: string;\n }\n>): ReactNode {\n const { config } = useChartContext(CHART_LEGEND_CONTENT_NAME, __scopeChart);\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div className={cn(\"flex items-center justify-center gap-4\", verticalAlign === \"top\" ? \"pb-3\" : \"pt-3\", className)}>\n {payload.map((item) => {\n let key = \"value\";\n\n if (nameKey) {\n key = nameKey;\n } else if (item.dataKey) {\n key = String(item.dataKey);\n }\n\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={String(item.value)}\n className={cn(\"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3\")}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"size-2 shrink-0 rounded-md\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Helpers\n * -------------------------------------------------------------------------- */\n\n/**\n * Extracts and returns the appropriate configuration object from\n * the payload based on the specified key.\n *\n * @param config - The chart configuration object that contains various\n * settings.\n * @param payload - The payload object that might contain nested payload data.\n * @param key - The key used to retrieve the specific configuration from the\n * chart config.\n * @returns Returns a configuration object with optional properties `icon`,\n * `label`, `color` or `theme`, or `undefined` if the payload is invalid or\n * no configuration is found for the provided key.\n */\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string): ChartConfigItem | undefined {\n if (!isValidObject(payload)) {\n return undefined;\n }\n\n const nestedPayload = \"payload\" in payload && isValidObject(payload.payload) ? payload.payload : undefined;\n\n const configLabelKey = getConfigLabelKey(payload, nestedPayload, key);\n\n return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\n/**\n * Checks if the provided value is a valid object.\n *\n * @param obj - The value to check.\n * @returns - Returns true if the value is an object and not null, false\n * otherwise.\n */\nfunction isValidObject(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === \"object\" && obj !== null;\n}\n\n/**\n * Retrieves the configuration label key from either the payload or\n * nestedPayload. If the key exists in the payload and is a string, the\n * corresponding value is returned. Otherwise, if the key exists in the\n * nestedPayload and is a string, its value is returned. If the key is not\n * found as a string in either object, the key itself is returned.\n *\n * @param payload - The primary payload containing key-value pairs.\n * @param nestedPayload - An optional nested payload containing additional\n * key-value pairs.\n * @param key - The key to search for within the payload and nestedPayload.\n *\n * @returns The string value associated with the key if found; otherwise, the\n * key itself.\n */\nfunction getConfigLabelKey(\n payload: Record<string, unknown>,\n nestedPayload: Record<string, unknown> | undefined,\n key: string,\n): string {\n if (key in payload && typeof payload[key] === \"string\") {\n return payload[key];\n }\n\n if (nestedPayload && key in nestedPayload && typeof nestedPayload[key] === \"string\") {\n return nestedPayload[key];\n }\n\n return key;\n}\n\n/**\n * Generates CSS for a specified theme and chart configuration.\n *\n * @param theme - The theme to be used (for example, 'light', 'dark').\n * @param id - The unique identifier of the chart.\n * @param configEntries - A list of configuration entries, each containing a\n * key and a chart configuration.\n * @returns The generated CSS as a string.\n */\nfunction generateThemeCSS(theme: Theme, id: string, configEntries: [string, ChartConfig[string]][]): string {\n const rules: string[] = [];\n\n rules.push(`${THEMES[theme]} [data-chart=${id}] {`);\n\n for (const [key, itemConfig] of configEntries) {\n const color = itemConfig?.theme?.[theme] || itemConfig?.color;\n\n if (color) {\n rules.push(` --color-${key}: ${color};`);\n }\n }\n\n rules.push(\"}\");\n\n return rules.join(\"\\n\");\n}\n\n/**\n * Generates CSS styles for a chart based on the provided configuration and\n * themes.\n *\n * @param id - The unique identifier for the chart element.\n * @param config - Configuration object for the chart. This includes theme and\n * color settings.\n * @returns A string containing the generated CSS rules.\n */\nfunction generateCSS(id: string, config: ChartConfig): string {\n const themeOrColorConfig = Object.entries(config).filter(([_, itemConfig]) => itemConfig?.theme || itemConfig?.color);\n\n const allRules: string[] = [];\n\n for (const theme of Object.keys(THEMES)) {\n const themeCSS = generateThemeCSS(theme as Theme, id, themeOrColorConfig);\n\n allRules.push(themeCSS);\n }\n\n return allRules.join(\"\\n\");\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport type { ChartConfig };\nexport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n ChartTooltip,\n ChartTooltipContent,\n createChartScope,\n};\n"],"names":["CHART_PROVIDER_NAME","THEMES","createChartContext","createChartScope","createContextScope","ChartContextProvider","useChartContext","ChartContainer","__scopeChart","id","children","className","config","props","uniqueId","useId","chartId","cn","ChartStyle","RechartsPrimitive","cssString","useMemo","generateCSS","ChartTooltip","CHART_TOOLTIP_CONTENT_NAME","ChartTooltipContent","active","color","formatter","hideIndicator","hideLabel","indicator","label","labelClassName","labelFormatter","labelKey","nameKey","payload","tooltipLabel","item","key","itemConfig","getPayloadConfigFromPayload","value","nestLabel","index","indicatorColor","undefined","ChartLegend","CHART_LEGEND_CONTENT_NAME","ChartLegendContent","hideIcon","verticalAlign","String","isValidObject","nestedPayload","configLabelKey","getConfigLabelKey","obj","generateThemeCSS","theme","configEntries","rules","themeOrColorConfig","Object","_","allRules","themeCSS"],"mappings":";0xCAgBMA,oBAAsB,gBAYtBC,OAAgC,CACpC,KAAM,QACN,MAAO,EACT,EA+CM,CAACC,mBAAoBC,iBAAiB,CAAGC,GAAAA,8BAAAA,kBAAAA,EAAmBJ,qBAE5D,CAACK,qBAAsBC,gBAAgB,CAAGJ,mBAAsCF,qBAMtF,SAASO,eAAe,CACtBC,aAAAA,CAAY,CACZC,GAAAA,CAAE,CACFC,SAAAA,CAAQ,CACRC,UAAAA,CAAS,CACTC,OAAAA,CAAM,CACN,GAAGC,EAMJ,EACC,IAAMC,EAAWC,GAAAA,+BAAAA,KAAAA,IACXC,EAAU,CAAC,MAAM,EAAEP,GAAMK,EAAS,CAAC,CAEzC,MACE,oCAACT,qBAAAA,CAAqB,OAAQO,EAAQ,MAAOJ,E,SAC3C,qCAAC,OACC,UAAWS,GAAAA,0BAAAA,EAAAA,EACT,8pBACAN,GAEF,aAAYK,EACZ,YAAU,QACT,GAAGH,CAAK,C,UAET,oCAACK,WAAAA,CAAW,OAAQN,EAAQ,GAAII,C,GAChC,oCAACG,kCAAAA,mBAAqC,E,SAAET,C,OAIhD,CAMA,SAASQ,WAAW,CAAET,GAAAA,CAAE,CAAEG,OAAAA,CAAM,CAAuC,EACrE,IAAMQ,EAAYC,GAAAA,+BAAAA,OAAAA,EAAQ,IAAMC,YAAYb,EAAIG,GAAS,CAACH,EA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G,EAAI,CAGjBe,GAAiBf,KAAOe,GAAiB,iBAAOA,CAAa,CAACf,EAAI,CAC7De,CAAa,CAACf,EAAI,CAGpBA,CACT,CAWA,SAASmB,iBAAiBC,CAAY,CAAEnD,CAAU,CAAEoD,CAA8C,EAChG,IAAMC,EAAkB,EAAE,CAI1B,IAAK,GAAM,CAACtB,EAAKC,EAAW,GAF5BqB,EAAM,IAAI,CAAC,CAAC,EAAE7D,MAAM,CAAC2D,EAAM,CAAC,aAAa,EAAEnD,EAAG,GAAG,CAAC,EAElBoD,GAAe,CAC7C,IAAMlC,EAAQc,GAAY,OAAO,CAACmB,EAAM,EAAInB,GAAY,KAEpDd,CAAAA,GACFmC,EAAM,IAAI,CAAC,CAAC,UAAU,EAAEtB,EAAI,EAAE,EAAEb,EAAM,CAAC,CAAC,CAE5C,CAIA,OAFAmC,EAAM,IAAI,CAAC,KAEJA,EAAM,IAAI,CAAC,KACpB,CAWA,SAASxC,YAAYb,CAAU,CAAEG,CAAmB,EAClD,IAAMmD,EAAqBC,OAAO,OAAO,CAACpD,GAAQ,MAAM,CAAC,CAAC,CAACqD,EAAGxB,EAAW,GAAKA,GAAY,OAASA,GAAY,OAEzGyB,EAAqB,EAAE,CAE7B,IAAK,IAAMN,KAASI,OAAO,IAAI,CAAC/D,QAAS,CACvC,IAAMkE,EAAWR,iBAAiBC,EAAgBnD,EAAIsD,GAEtDG,EAAS,IAAI,CAACC,EAChB,CAEA,OAAOD,EAAS,IAAI,CAAC,KACvB,C"}
|
|
1
|
+
{"version":3,"file":"components/chart.cjs","sources":["webpack://@codefast/ui/webpack/runtime/define_property_getters","webpack://@codefast/ui/webpack/runtime/has_own_property","webpack://@codefast/ui/webpack/runtime/make_namespace_object","webpack://@codefast/ui/./src/components/chart.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\n\nimport type { Scope } from \"@radix-ui/react-context\";\nimport type { ComponentProps, ComponentType, CSSProperties, JSX, ReactNode } from \"react\";\nimport type { NameType, Payload, ValueType } from \"recharts/types/component/DefaultTooltipContent\";\n\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId, useMemo } from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\n\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Context: ChartProvider\n * ---------------------------------------------------------------------------*/\n\nconst CHART_PROVIDER_NAME = \"ChartProvider\";\n\ntype ScopedProps<P> = P & { __scopeChart?: Scope };\n\n/**\n * Supported themes in the application\n */\ntype Theme = \"dark\" | \"light\";\n\n/**\n * Mapping between themes and their corresponding CSS classes\n */\nconst THEMES: Record<Theme, string> = {\n dark: \".dark\",\n light: \"\",\n};\n\n/**\n * Configuration for icon and label display in charts\n */\ninterface IconLabelConfig {\n /** Icon to display with data */\n icon?: ComponentType;\n /** Label to display with data */\n label?: ReactNode;\n}\n\n/**\n * Single color configuration for chart elements\n */\ntype ColorConfig = {\n /** Valid CSS color (hex, rgba, etc.) */\n color?: string;\n} & { theme?: never };\n\n/**\n * Theme-based color configuration for chart elements\n */\ntype ThemeConfig = {\n /** Map of colors for each theme mode */\n theme: Record<Theme, string>;\n} & { color?: never };\n\n/**\n * Complete configuration for a chart element\n */\ntype ChartConfigItem = (ColorConfig | ThemeConfig) & IconLabelConfig;\n\n/**\n * Configuration for the entire chart organized by series/data keys\n * Where keys are the names of data in the chart\n */\ntype ChartConfig = Record<string, ChartConfigItem | undefined>;\n\n/**\n * Value provided by Chart Context\n */\ninterface ChartContextValue {\n /** Display configuration for the chart */\n config: ChartConfig;\n}\n\nconst [createChartContext, createChartScope] = createContextScope(CHART_PROVIDER_NAME);\n\nconst [ChartContextProvider, useChartContext] = createChartContext<ChartContextValue>(CHART_PROVIDER_NAME);\n\n/* -----------------------------------------------------------------------------\n * Component: Chart\n * -------------------------------------------------------------------------- */\n\nfunction ChartContainer({\n __scopeChart,\n id,\n children,\n className,\n config,\n ...props\n}: ScopedProps<\n ComponentProps<\"div\"> & {\n children: ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>[\"children\"];\n config: ChartConfig;\n }\n>): JSX.Element {\n const uniqueId = useId();\n const chartId = `chart-${id || uniqueId}`;\n\n return (\n <ChartContextProvider config={config} scope={__scopeChart}>\n <div\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-surface]:outline-hidden flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-sector[stroke='#fff']]:stroke-transparent\",\n className,\n )}\n data-chart={chartId}\n data-slot=\"chart\"\n {...props}\n >\n <ChartStyle config={config} id={chartId} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContextProvider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ChartStyle\n * -------------------------------------------------------------------------- */\n\nfunction ChartStyle({ id, config }: { config: ChartConfig; id: string }): ReactNode {\n const cssString = useMemo(() => generateCSS(id, config), [id, config]);\n\n return <style dangerouslySetInnerHTML={{ __html: cssString }} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltip\n * -------------------------------------------------------------------------- */\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltipContent\n * -------------------------------------------------------------------------- */\n\nconst CHART_TOOLTIP_CONTENT_NAME = \"ChartTooltipContent\";\n\nfunction ChartTooltipContent({\n __scopeChart,\n active,\n className,\n color,\n formatter,\n hideIndicator = false,\n hideLabel = false,\n indicator = \"dot\",\n label,\n labelClassName,\n labelFormatter,\n labelKey,\n nameKey,\n payload,\n}: ScopedProps<\n ComponentProps<typeof RechartsPrimitive.Tooltip> &\n Omit<ComponentProps<\"div\">, \"content\"> & {\n hideIndicator?: boolean;\n hideLabel?: boolean;\n indicator?: \"dashed\" | \"dot\" | \"line\";\n labelKey?: string;\n nameKey?: string;\n }\n>): ReactNode {\n const { config } = useChartContext(CHART_TOOLTIP_CONTENT_NAME, __scopeChart);\n\n const tooltipLabel = useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n\n const key = `${labelKey || item.dataKey || item.name || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value = !labelKey && typeof label === \"string\" ? config[label]?.label || label : itemConfig?.label;\n\n if (labelFormatter) {\n return <div className={cn(\"font-medium\", labelClassName)}>{labelFormatter(value, payload)}</div>;\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn(\"font-medium\", labelClassName)}>{value}</div>;\n }, [config, hideLabel, label, labelClassName, labelFormatter, labelKey, payload]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== \"dot\";\n\n return (\n <div\n className={cn(\n \"bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl\",\n className,\n )}\n >\n {nestLabel ? null : tooltipLabel}\n <div className=\"grid gap-1.5\">\n {payload.map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || (item.payload as { fill?: string }).fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n \"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:size-2.5\",\n indicator === \"dot\" && \"items-center\",\n )}\n >\n {formatter && item.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload as Payload<ValueType, NameType>[])\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\"border-(--color-border) bg-(--color-bg) rounded-xs shrink-0\", {\n \"h-2.5 w-2.5\": indicator === \"dot\",\n \"my-0.5\": nestLabel && indicator === \"dashed\",\n \"w-0 border border-dashed bg-transparent\": indicator === \"dashed\",\n \"w-1\": indicator === \"line\",\n })}\n style={\n {\n \"--color-bg\": indicatorColor,\n \"--color-border\": indicatorColor,\n } as CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\"flex flex-1 justify-between leading-none\", nestLabel ? \"items-end\" : \"items-center\")}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value ? (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n ) : null}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegend\n * -------------------------------------------------------------------------- */\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegendContent\n * -------------------------------------------------------------------------- */\n\nconst CHART_LEGEND_CONTENT_NAME = \"ChartLegendContent\";\n\nfunction ChartLegendContent({\n __scopeChart,\n className,\n hideIcon = false,\n nameKey,\n payload,\n verticalAlign = \"bottom\",\n}: ScopedProps<\n ComponentProps<\"div\"> &\n Pick<RechartsPrimitive.LegendProps, \"payload\" | \"verticalAlign\"> & {\n hideIcon?: boolean;\n nameKey?: string;\n }\n>): ReactNode {\n const { config } = useChartContext(CHART_LEGEND_CONTENT_NAME, __scopeChart);\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div className={cn(\"flex items-center justify-center gap-4\", verticalAlign === \"top\" ? \"pb-3\" : \"pt-3\", className)}>\n {payload.map((item) => {\n let key = \"value\";\n\n if (nameKey) {\n key = nameKey;\n } else if (item.dataKey) {\n key = String(item.dataKey);\n }\n\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={String(item.value)}\n className={cn(\"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3\")}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"size-2 shrink-0 rounded-md\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Helpers\n * -------------------------------------------------------------------------- */\n\n/**\n * Extracts and returns the appropriate configuration object from\n * the payload based on the specified key.\n *\n * @param config - The chart configuration object that contains various\n * settings.\n * @param payload - The payload object that might contain nested payload data.\n * @param key - The key used to retrieve the specific configuration from the\n * chart config.\n * @returns Returns a configuration object with optional properties `icon`,\n * `label`, `color` or `theme`, or `undefined` if the payload is invalid or\n * no configuration is found for the provided key.\n */\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string): ChartConfigItem | undefined {\n if (!isValidObject(payload)) {\n return undefined;\n }\n\n const nestedPayload = \"payload\" in payload && isValidObject(payload.payload) ? payload.payload : undefined;\n\n const configLabelKey = getConfigLabelKey(payload, nestedPayload, key);\n\n return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\n/**\n * Checks if the provided value is a valid object.\n *\n * @param obj - The value to check.\n * @returns - Returns true if the value is an object and not null, false\n * otherwise.\n */\nfunction isValidObject(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === \"object\" && obj !== null;\n}\n\n/**\n * Retrieves the configuration label key from either the payload or\n * nestedPayload. If the key exists in the payload and is a string, the\n * corresponding value is returned. Otherwise, if the key exists in the\n * nestedPayload and is a string, its value is returned. If the key is not\n * found as a string in either object, the key itself is returned.\n *\n * @param payload - The primary payload containing key-value pairs.\n * @param nestedPayload - An optional nested payload containing additional\n * key-value pairs.\n * @param key - The key to search for within the payload and nestedPayload.\n *\n * @returns The string value associated with the key if found; otherwise, the\n * key itself.\n */\nfunction getConfigLabelKey(\n payload: Record<string, unknown>,\n nestedPayload: Record<string, unknown> | undefined,\n key: string,\n): string {\n if (key in payload && typeof payload[key] === \"string\") {\n return payload[key];\n }\n\n if (nestedPayload && key in nestedPayload && typeof nestedPayload[key] === \"string\") {\n return nestedPayload[key];\n }\n\n return key;\n}\n\n/**\n * Generates CSS for a specified theme and chart configuration.\n *\n * @param theme - The theme to be used (for example, 'light', 'dark').\n * @param id - The unique identifier of the chart.\n * @param configEntries - A list of configuration entries, each containing a\n * key and a chart configuration.\n * @returns The generated CSS as a string.\n */\nfunction generateThemeCSS(theme: Theme, id: string, configEntries: [string, ChartConfig[string]][]): string {\n const rules: string[] = [];\n\n rules.push(`${THEMES[theme]} [data-chart=${id}] {`);\n\n for (const [key, itemConfig] of configEntries) {\n const color = itemConfig?.theme?.[theme] || itemConfig?.color;\n\n if (color) {\n rules.push(` --color-${key}: ${color};`);\n }\n }\n\n rules.push(\"}\");\n\n return rules.join(\"\\n\");\n}\n\n/**\n * Generates CSS styles for a chart based on the provided configuration and\n * themes.\n *\n * @param id - The unique identifier for the chart element.\n * @param config - Configuration object for the chart. This includes theme and\n * color settings.\n * @returns A string containing the generated CSS rules.\n */\nfunction generateCSS(id: string, config: ChartConfig): string {\n const themeOrColorConfig = Object.entries(config).filter(([_, itemConfig]) => itemConfig?.theme || itemConfig?.color);\n\n const allRules: string[] = [];\n\n for (const theme of Object.keys(THEMES)) {\n const themeCSS = generateThemeCSS(theme as Theme, id, themeOrColorConfig);\n\n allRules.push(themeCSS);\n }\n\n return allRules.join(\"\\n\");\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport type { ChartConfig };\nexport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n ChartTooltip,\n ChartTooltipContent,\n createChartScope,\n};\n"],"names":["__webpack_require__","e","Object","Symbol","CHART_PROVIDER_NAME","THEMES","createChartContext","createChartScope","createContextScope","ChartContextProvider","useChartContext","ChartContainer","__scopeChart","id","children","className","config","props","uniqueId","useId","chartId","cn","ChartStyle","RechartsPrimitive","cssString","useMemo","generateCSS","ChartTooltip","CHART_TOOLTIP_CONTENT_NAME","ChartTooltipContent","active","color","formatter","hideIndicator","hideLabel","indicator","label","labelClassName","labelFormatter","labelKey","nameKey","payload","tooltipLabel","item","key","itemConfig","getPayloadConfigFromPayload","value","nestLabel","index","indicatorColor","undefined","ChartLegend","CHART_LEGEND_CONTENT_NAME","ChartLegendContent","hideIcon","verticalAlign","String","isValidObject","nestedPayload","configLabelKey","getConfigLabelKey","obj","generateThemeCSS","theme","configEntries","rules","themeOrColorConfig","_","allRules","themeCSS"],"mappings":";+PAAAA,CAAAA,oBAAoB,CAAC,CAAG,CAACC,EAAS,KACjC,IAAI,IAAI,KAAO,EACLD,oBAAoB,CAAC,CAAC,EAAY,IAAQ,CAACA,oBAAoB,CAAC,CAACC,EAAS,IACzEC,OAAO,cAAc,CAACD,EAAS,EAAK,CAAE,WAAY,GAAM,IAAK,CAAU,CAAC,EAAI,EAGxF,ECNAD,oBAAoB,CAAC,CAAG,CAAC,EAAK,IAAUE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAK,GCClFF,oBAAoB,CAAC,CAAG,IACpB,oBAAOG,QAA0BA,OAAO,WAAW,EACrDD,OAAO,cAAc,CAACD,EAASE,OAAO,WAAW,CAAE,CAAE,MAAO,QAAS,GAEtED,OAAO,cAAc,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,IAAMlC,EAAQc,GAAY,OAAO,CAACmB,EAAM,EAAInB,GAAY,KAEpDd,CAAAA,GACFmC,EAAM,IAAI,CAAC,CAAC,UAAU,EAAEtB,EAAI,EAAE,EAAEb,EAAM,CAAC,CAAC,CAE5C,CAIA,OAFAmC,EAAM,IAAI,CAAC,KAEJA,EAAM,IAAI,CAAC,KACpB,CAWA,SAASxC,YAAYb,CAAU,CAAEG,CAAmB,EAClD,IAAMmD,EAAqBjE,OAAO,OAAO,CAACc,GAAQ,MAAM,CAAC,CAAC,CAACoD,EAAGvB,EAAW,GAAKA,GAAY,OAASA,GAAY,OAEzGwB,EAAqB,EAAE,CAE7B,IAAK,IAAML,KAAS9D,OAAO,IAAI,CAACG,QAAS,CACvC,IAAMiE,EAAWP,iBAAiBC,EAAgBnD,EAAIsD,GAEtDE,EAAS,IAAI,CAACC,EAChB,CAEA,OAAOD,EAAS,IAAI,CAAC,KACvB,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,r)=>{for(var c in r)__webpack_require__.o(r,c)&&!__webpack_require__.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:r[c]})},__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{
|
|
1
|
+
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,r)=>{for(var c in r)__webpack_require__.o(r,c)&&!__webpack_require__.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:r[c]})},__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CheckboxCardsItem:()=>CheckboxCardsItem,CheckboxCards:()=>CheckboxCards});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),checkbox_group_namespaceObject=require("@codefast-ui/checkbox-group"),external_lucide_react_namespaceObject=require("lucide-react"),external_label_cjs_namespaceObject=require("./label.cjs"),utils_cjs_namespaceObject=require("../lib/utils.cjs");function CheckboxCards(e){return(0,jsx_runtime_namespaceObject.jsx)(checkbox_group_namespaceObject.Root,{"data-slot":"checkbox-cards",...e})}function CheckboxCardsItem({checkboxClassName:e,children:r,className:c,...a}){return(0,jsx_runtime_namespaceObject.jsxs)(external_label_cjs_namespaceObject.Label,{className:(0,utils_cjs_namespaceObject.cn)("border-input hover:not-has-disabled:not-has-aria-checked:bg-secondary has-aria-checked:bg-primary/10 has-aria-checked:border-primary has-focus-visible:border-ring has-disabled:opacity-50 flex items-start gap-3 rounded-lg border p-3 transition",c),"data-slot":"checkbox-card",children:[(0,jsx_runtime_namespaceObject.jsx)(checkbox_group_namespaceObject.Item,{className:(0,utils_cjs_namespaceObject.cn)("border-input text-primary-foreground shadow-xs outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 focus-visible:aria-checked:ring-primary/20 dark:focus-visible:aria-checked:ring-primary/40 aria-checked:border-primary aria-checked:bg-primary dark:bg-input/30 peer flex size-4 shrink-0 rounded-sm border transition",e),"data-slot":"checkbox-card-item",...a,children:(0,jsx_runtime_namespaceObject.jsx)(checkbox_group_namespaceObject.CheckboxGroupIndicator,{"data-slot":"checkbox-card-indicator",children:(0,jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.CheckIcon,{className:"size-3.5"})})}),r]})}for(var __webpack_i__ in exports.CheckboxCards=__webpack_exports__.CheckboxCards,exports.CheckboxCardsItem=__webpack_exports__.CheckboxCardsItem,__webpack_exports__)-1===["CheckboxCards","CheckboxCardsItem"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
2
2
|
//# sourceMappingURL=checkbox-cards.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/checkbox-cards.cjs","sources":["webpack://@codefast/ui/./src/components/checkbox-cards.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from \"react\";\n\nimport * as CheckboxGroupPrimitive from \"@codefast-ui/checkbox-group\";\nimport { CheckIcon } from \"lucide-react\";\n\nimport { Label } from \"@/components/label\";\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: CheckboxCards\n * -------------------------------------------------------------------------- */\n\nfunction CheckboxCards(props: ComponentProps<typeof CheckboxGroupPrimitive.Root>): JSX.Element {\n return <CheckboxGroupPrimitive.Root data-slot=\"checkbox-cards\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CheckboxCardsItem\n * -------------------------------------------------------------------------- */\n\nfunction CheckboxCardsItem({\n checkboxClassName,\n children,\n className,\n ...props\n}: ComponentProps<typeof CheckboxGroupPrimitive.Item> & {\n checkboxClassName?: string;\n}): JSX.Element {\n return (\n <Label\n className={cn(\n \"border-input hover:not-has-disabled:not-has-aria-checked:bg-secondary has-aria-checked:bg-primary/10 has-aria-checked:border-primary has-focus-visible:border-ring has-disabled:opacity-50 flex items-start gap-3 rounded-lg border p-3 transition\",\n className,\n )}\n data-slot=\"checkbox-card\"\n >\n <CheckboxGroupPrimitive.Item\n className={cn(\n \"border-input text-primary-foreground shadow-xs outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 focus-visible:aria-checked:ring-primary/20 dark:focus-visible:aria-checked:ring-primary/40 aria-checked:border-primary aria-checked:bg-primary dark:bg-input/30 peer flex size-4 shrink-0 rounded-sm border transition\",\n checkboxClassName,\n )}\n data-slot=\"checkbox-card-item\"\n {...props}\n >\n <CheckboxGroupPrimitive.CheckboxGroupIndicator data-slot=\"checkbox-card-indicator\">\n <CheckIcon className=\"size-3.5\" />\n </CheckboxGroupPrimitive.CheckboxGroupIndicator>\n </CheckboxGroupPrimitive.Item>\n {children}\n </Label>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { CheckboxCards, CheckboxCardsItem };\n"],"names":["CheckboxCards","props","CheckboxGroupPrimitive","CheckboxCardsItem","checkboxClassName","children","className","Label","cn","CheckIcon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"components/checkbox-cards.cjs","sources":["webpack://@codefast/ui/webpack/runtime/define_property_getters","webpack://@codefast/ui/webpack/runtime/has_own_property","webpack://@codefast/ui/webpack/runtime/make_namespace_object","webpack://@codefast/ui/./src/components/checkbox-cards.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { ComponentProps, JSX } from \"react\";\n\nimport * as CheckboxGroupPrimitive from \"@codefast-ui/checkbox-group\";\nimport { CheckIcon } from \"lucide-react\";\n\nimport { Label } from \"@/components/label\";\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: CheckboxCards\n * -------------------------------------------------------------------------- */\n\nfunction CheckboxCards(props: ComponentProps<typeof CheckboxGroupPrimitive.Root>): JSX.Element {\n return <CheckboxGroupPrimitive.Root data-slot=\"checkbox-cards\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CheckboxCardsItem\n * -------------------------------------------------------------------------- */\n\nfunction CheckboxCardsItem({\n checkboxClassName,\n children,\n className,\n ...props\n}: ComponentProps<typeof CheckboxGroupPrimitive.Item> & {\n checkboxClassName?: string;\n}): JSX.Element {\n return (\n <Label\n className={cn(\n \"border-input hover:not-has-disabled:not-has-aria-checked:bg-secondary has-aria-checked:bg-primary/10 has-aria-checked:border-primary has-focus-visible:border-ring has-disabled:opacity-50 flex items-start gap-3 rounded-lg border p-3 transition\",\n className,\n )}\n data-slot=\"checkbox-card\"\n >\n <CheckboxGroupPrimitive.Item\n className={cn(\n \"border-input text-primary-foreground shadow-xs outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 focus-visible:aria-checked:ring-primary/20 dark:focus-visible:aria-checked:ring-primary/40 aria-checked:border-primary aria-checked:bg-primary dark:bg-input/30 peer flex size-4 shrink-0 rounded-sm border transition\",\n checkboxClassName,\n )}\n data-slot=\"checkbox-card-item\"\n {...props}\n >\n <CheckboxGroupPrimitive.CheckboxGroupIndicator data-slot=\"checkbox-card-indicator\">\n <CheckIcon className=\"size-3.5\" />\n </CheckboxGroupPrimitive.CheckboxGroupIndicator>\n </CheckboxGroupPrimitive.Item>\n {children}\n </Label>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { CheckboxCards, CheckboxCardsItem };\n"],"names":["__webpack_require__","e","Object","Symbol","CheckboxCards","props","CheckboxGroupPrimitive","CheckboxCardsItem","checkboxClassName","children","className","Label","cn","CheckIcon"],"mappings":"+PAAAA,CAAAA,oBAAoB,CAAC,CAAG,CAACC,EAAS,KACjC,IAAI,IAAI,KAAO,EACLD,oBAAoB,CAAC,CAAC,EAAY,IAAQ,CAACA,oBAAoB,CAAC,CAACC,EAAS,IACzEC,OAAO,cAAc,CAACD,EAAS,EAAK,CAAE,WAAY,GAAM,IAAK,CAAU,CAAC,EAAI,AAAC,EAGzF,ECNAD,oBAAoB,CAAC,CAAG,CAAC,EAAK,IAAUE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAK,GCClFF,oBAAoB,CAAC,CAAG,AAACC,IACrB,AAAkB,aAAlB,OAAOE,QAA0BA,OAAO,WAAW,EACrDD,OAAO,cAAc,CAACD,EAASE,OAAO,WAAW,CAAE,CAAE,MAAO,QAAS,GAEtED,OAAO,cAAc,CAACD,EAAS,aAAc,CAAE,MAAO,EAAK,EAC5D,E,4eCMA,SAASG,cAAcC,CAAyD,EAC9E,MAAO,oCAACC,+BAAAA,IAA2B,EAAC,YAAU,iBAAkB,GAAGD,CAAK,A,EAC1E,CAMA,SAASE,kBAAkB,CACzBC,kBAAAA,CAAiB,CACjBC,SAAAA,CAAQ,CACRC,UAAAA,CAAS,CACT,GAAGL,EAGJ,EACC,MACE,qCAACM,mCAAAA,KAAKA,CAAAA,CACJ,UAAWC,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EACT,qPACAF,GAEF,YAAU,gB,UAEV,oCAACJ,+BAAAA,IAA2B,EAC1B,UAAWM,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EACT,iWACAJ,GAEF,YAAU,qBACT,GAAGH,CAAK,C,SAET,oCAACC,+BAAAA,sBAA6C,EAAC,YAAU,0B,SACvD,oCAACO,sCAAAA,SAASA,CAAAA,CAAC,UAAU,U,OAGxBJ,E,EAGP,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/checkbox-group.cjs","sources":["webpack://@codefast/ui/./src/components/checkbox-group.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from \"react\";\n\nimport * as CheckboxGroupPrimitive from \"@codefast-ui/checkbox-group\";\nimport { CheckIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: CheckboxGroup\n * -------------------------------------------------------------------------- */\n\nfunction CheckboxGroup({ className, ...props }: ComponentProps<typeof CheckboxGroupPrimitive.Root>): JSX.Element {\n return <CheckboxGroupPrimitive.Root className={cn(\"grid gap-2\", className)} data-slot=\"checkbox-group\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CheckboxGroupItem\n * -------------------------------------------------------------------------- */\n\nfunction CheckboxGroupItem({ className, ...props }: ComponentProps<typeof CheckboxGroupPrimitive.Item>): JSX.Element {\n return (\n <CheckboxGroupPrimitive.Item\n className={cn(\n \"border-input text-primary-foreground shadow-xs outline-hidden hover:not-disabled:not-aria-checked:border-ring/60 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 focus-visible:aria-checked:ring-primary/20 dark:focus-visible:aria-checked:ring-primary/40 aria-checked:border-primary aria-checked:bg-primary aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-checked:aria-invalid:bg-destructive hover:not-disabled:not-aria-checked:aria-invalid:border-destructive/60 dark:bg-input/30 peer flex size-4 shrink-0 items-center justify-center rounded-sm border transition disabled:opacity-50\",\n className,\n )}\n data-slot=\"checkbox-group-item\"\n {...props}\n >\n <CheckboxGroupPrimitive.CheckboxGroupIndicator\n className=\"flex items-center justify-center text-current transition-none\"\n data-slot=\"checkbox-group-indicator\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxGroupPrimitive.CheckboxGroupIndicator>\n </CheckboxGroupPrimitive.Item>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { CheckboxGroup, CheckboxGroupItem };\n"],"names":["CheckboxGroup","className","props","CheckboxGroupPrimitive","cn","CheckboxGroupItem","CheckIcon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"components/checkbox-group.cjs","sources":["webpack://@codefast/ui/webpack/runtime/define_property_getters","webpack://@codefast/ui/webpack/runtime/has_own_property","webpack://@codefast/ui/webpack/runtime/make_namespace_object","webpack://@codefast/ui/./src/components/checkbox-group.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { ComponentProps, JSX } from \"react\";\n\nimport * as CheckboxGroupPrimitive from \"@codefast-ui/checkbox-group\";\nimport { CheckIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: CheckboxGroup\n * -------------------------------------------------------------------------- */\n\nfunction CheckboxGroup({ className, ...props }: ComponentProps<typeof CheckboxGroupPrimitive.Root>): JSX.Element {\n return <CheckboxGroupPrimitive.Root className={cn(\"grid gap-2\", className)} data-slot=\"checkbox-group\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CheckboxGroupItem\n * -------------------------------------------------------------------------- */\n\nfunction CheckboxGroupItem({ className, ...props }: ComponentProps<typeof CheckboxGroupPrimitive.Item>): JSX.Element {\n return (\n <CheckboxGroupPrimitive.Item\n className={cn(\n \"border-input text-primary-foreground shadow-xs outline-hidden hover:not-disabled:not-aria-checked:border-ring/60 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 focus-visible:aria-checked:ring-primary/20 dark:focus-visible:aria-checked:ring-primary/40 aria-checked:border-primary aria-checked:bg-primary aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-checked:aria-invalid:bg-destructive hover:not-disabled:not-aria-checked:aria-invalid:border-destructive/60 dark:bg-input/30 peer flex size-4 shrink-0 items-center justify-center rounded-sm border transition disabled:opacity-50\",\n className,\n )}\n data-slot=\"checkbox-group-item\"\n {...props}\n >\n <CheckboxGroupPrimitive.CheckboxGroupIndicator\n className=\"flex items-center justify-center text-current transition-none\"\n data-slot=\"checkbox-group-indicator\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxGroupPrimitive.CheckboxGroupIndicator>\n </CheckboxGroupPrimitive.Item>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { CheckboxGroup, CheckboxGroupItem };\n"],"names":["__webpack_require__","e","Object","Symbol","CheckboxGroup","className","props","CheckboxGroupPrimitive","cn","CheckboxGroupItem","CheckIcon"],"mappings":"+PAAAA,CAAAA,oBAAoB,CAAC,CAAG,CAACC,EAAS,KACjC,IAAI,IAAI,KAAO,EACLD,oBAAoB,CAAC,CAAC,EAAY,IAAQ,CAACA,oBAAoB,CAAC,CAACC,EAAS,IACzEC,OAAO,cAAc,CAACD,EAAS,EAAK,CAAE,WAAY,GAAM,IAAK,CAAU,CAAC,EAAI,AAAC,EAGzF,ECNAD,oBAAoB,CAAC,CAAG,CAAC,EAAK,IAAUE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAK,GCClFF,oBAAoB,CAAC,CAAG,AAACC,IACrB,AAAkB,aAAlB,OAAOE,QAA0BA,OAAO,WAAW,EACrDD,OAAO,cAAc,CAACD,EAASE,OAAO,WAAW,CAAE,CAAE,MAAO,QAAS,GAEtED,OAAO,cAAc,CAACD,EAAS,aAAc,CAAE,MAAO,EAAK,EAC5D,E,kbCKA,SAASG,cAAc,CAAEC,UAAAA,CAAS,CAAE,GAAGC,EAA2D,EAChG,MAAO,oCAACC,+BAAAA,IAA2B,EAAC,UAAWC,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EAAG,aAAcH,GAAY,YAAU,iBAAkB,GAAGC,CAAK,A,EAClH,CAMA,SAASG,kBAAkB,CAAEJ,UAAAA,CAAS,CAAE,GAAGC,EAA2D,EACpG,MACE,oCAACC,+BAAAA,IAA2B,EAC1B,UAAWC,AAAAA,GAAAA,0BAAAA,EAAAA,AAAAA,EACT,2pBACAH,GAEF,YAAU,sBACT,GAAGC,CAAK,C,SAET,oCAACC,+BAAAA,sBAA6C,EAC5C,UAAU,gEACV,YAAU,2B,SAEV,oCAACG,sCAAAA,SAASA,CAAAA,CAAC,UAAU,U,MAI7B,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/checkbox.cjs","sources":["webpack://@codefast/ui/./src/components/checkbox.tsx"],"sourcesContent":["\n\nimport type { ComponentProps, JSX } from \"react\";\n\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Checkbox\n * -------------------------------------------------------------------------- */\n\nfunction Checkbox({ className, ...props }: ComponentProps<typeof CheckboxPrimitive.Root>): JSX.Element {\n return (\n <CheckboxPrimitive.Root\n className={cn(\n \"border-input text-primary-foreground shadow-xs outline-hidden hover:not-disabled:not-aria-checked:border-ring/60 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-checked:focus-visible:ring-primary/20 dark:aria-checked:focus-visible:ring-primary/40 aria-checked:border-primary aria-checked:aria-invalid:bg-destructive aria-checked:bg-primary aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 hover:not-disabled:not-aria-checked:aria-invalid:border-destructive/60 dark:bg-input/30 peer flex size-4 shrink-0 items-center justify-center rounded-sm border transition disabled:opacity-50\",\n className,\n )}\n data-slot=\"checkbox\"\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className=\"flex items-center justify-center text-current transition-none\"\n data-slot=\"checkbox-indicator\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Checkbox };\n"],"names":["Checkbox","className","props","CheckboxPrimitive","cn","CheckIcon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"components/checkbox.cjs","sources":["webpack://@codefast/ui/webpack/runtime/define_property_getters","webpack://@codefast/ui/webpack/runtime/has_own_property","webpack://@codefast/ui/webpack/runtime/make_namespace_object","webpack://@codefast/ui/./src/components/checkbox.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\n\nimport type { ComponentProps, JSX } from \"react\";\n\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Checkbox\n * -------------------------------------------------------------------------- */\n\nfunction Checkbox({ className, ...props }: ComponentProps<typeof CheckboxPrimitive.Root>): JSX.Element {\n return (\n <CheckboxPrimitive.Root\n className={cn(\n \"border-input text-primary-foreground shadow-xs outline-hidden hover:not-disabled:not-aria-checked:border-ring/60 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-checked:focus-visible:ring-primary/20 dark:aria-checked:focus-visible:ring-primary/40 aria-checked:border-primary aria-checked:aria-invalid:bg-destructive aria-checked:bg-primary aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 hover:not-disabled:not-aria-checked:aria-invalid:border-destructive/60 dark:bg-input/30 peer flex size-4 shrink-0 items-center justify-center rounded-sm border transition disabled:opacity-50\",\n className,\n )}\n data-slot=\"checkbox\"\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className=\"flex items-center justify-center text-current transition-none\"\n data-slot=\"checkbox-indicator\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Checkbox };\n"],"names":["__webpack_require__","e","Object","Symbol","Checkbox","className","props","CheckboxPrimitive","cn","CheckIcon"],"mappings":";+PAAAA,CAAAA,oBAAoB,CAAC,CAAG,CAACC,EAAS,KACjC,IAAI,IAAI,KAAO,EACLD,oBAAoB,CAAC,CAAC,EAAY,IAAQ,CAACA,oBAAoB,CAAC,CAACC,EAAS,IACzEC,OAAO,cAAc,CAACD,EAAS,EAAK,CAAE,WAAY,GAAM,IAAK,CAAU,CAAC,EAAI,EAGxF,ECNAD,oBAAoB,CAAC,CAAG,CAAC,EAAK,IAAUE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAK,GCClFF,oBAAoB,CAAC,CAAG,IACpB,oBAAOG,QAA0BA,OAAO,WAAW,EACrDD,OAAO,cAAc,CAACD,EAASE,OAAO,WAAW,CAAE,CAAE,MAAO,QAAS,GAEtED,OAAO,cAAc,CAACD,EAAS,aAAc,CAAE,MAAO,EAAK,EAC5D,E,6XCOA,SAASG,SAAS,CAAEC,UAAAA,CAAS,CAAE,GAAGC,EAAsD,EACtF,MACE,oCAACC,+BAAAA,IAAsB,EACrB,UAAWC,GAAAA,0BAAAA,EAAAA,EACT,2pBACAH,GAEF,YAAU,WACT,GAAGC,CAAK,C,SAET,oCAACC,+BAAAA,SAA2B,EAC1B,UAAU,gEACV,YAAU,qB,SAEV,oCAACE,sCAAAA,SAASA,CAAAA,CAAC,UAAU,U,MAI7B,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/code.cjs","sources":["webpack://@codefast/ui/./src/components/code.tsx"],"sourcesContent":["\n\nimport type { ComponentProps, JSX } from \"react\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/* -----------------------------------------------------------------------------\n * Component: Code\n * -------------------------------------------------------------------------- */\n\nfunction Code({\n asChild,\n ...props\n}: ComponentProps<\"code\"> & {\n asChild?: boolean;\n}): JSX.Element {\n const Component = asChild ? Slot : \"code\";\n\n return <Component data-slot=\"code\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Code };\n"],"names":["Code","asChild","props","Component","Slot"],"mappings":"
|
|
1
|
+
{"version":3,"file":"components/code.cjs","sources":["webpack://@codefast/ui/webpack/runtime/define_property_getters","webpack://@codefast/ui/webpack/runtime/has_own_property","webpack://@codefast/ui/webpack/runtime/make_namespace_object","webpack://@codefast/ui/./src/components/code.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\n\nimport type { ComponentProps, JSX } from \"react\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/* -----------------------------------------------------------------------------\n * Component: Code\n * -------------------------------------------------------------------------- */\n\nfunction Code({\n asChild,\n ...props\n}: ComponentProps<\"code\"> & {\n asChild?: boolean;\n}): JSX.Element {\n const Component = asChild ? Slot : \"code\";\n\n return <Component data-slot=\"code\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Code };\n"],"names":["__webpack_require__","e","Object","Symbol","Code","asChild","props","Component","Slot"],"mappings":";+PAAAA,CAAAA,oBAAoB,CAAC,CAAG,CAACC,EAAS,KACjC,IAAI,IAAI,KAAO,EACLD,oBAAoB,CAAC,CAAC,EAAY,IAAQ,CAACA,oBAAoB,CAAC,CAACC,EAAS,IACzEC,OAAO,cAAc,CAACD,EAAS,EAAK,CAAE,WAAY,GAAM,IAAK,CAAU,CAAC,EAAI,EAGxF,ECNAD,oBAAoB,CAAC,CAAG,CAAC,EAAK,IAAUE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAK,GCClFF,oBAAoB,CAAC,CAAG,IACpB,oBAAOG,QAA0BA,OAAO,WAAW,EACrDD,OAAO,cAAc,CAACD,EAASE,OAAO,WAAW,CAAE,CAAE,MAAO,QAAS,GAEtED,OAAO,cAAc,CAACD,EAAS,aAAc,CAAE,MAAO,EAAK,EAC5D,E,yPCIA,SAASG,KAAK,CACZC,QAAAA,CAAO,CACP,GAAGC,EAGJ,EACC,IAAMC,EAAYF,EAAUG,2BAAAA,IAAIA,CAAG,OAEnC,MAAO,oCAACD,EAAAA,CAAU,YAAU,OAAQ,GAAGD,CAAK,EAC9C,C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,_)=>{for(var l in _)__webpack_require__.o(_,l)&&!__webpack_require__.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:_[l]})},__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{
|
|
2
|
+
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,_)=>{for(var l in _)__webpack_require__.o(_,l)&&!__webpack_require__.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:_[l]})},__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CollapsibleContent:()=>CollapsibleContent,Collapsible:()=>Collapsible,CollapsibleTrigger:()=>CollapsibleTrigger});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),react_collapsible_namespaceObject=require("@radix-ui/react-collapsible");function Collapsible({...e}){return(0,jsx_runtime_namespaceObject.jsx)(react_collapsible_namespaceObject.Root,{"data-slot":"collapsible",...e})}function CollapsibleTrigger({...e}){return(0,jsx_runtime_namespaceObject.jsx)(react_collapsible_namespaceObject.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...e})}function CollapsibleContent({...e}){return(0,jsx_runtime_namespaceObject.jsx)(react_collapsible_namespaceObject.CollapsibleContent,{"data-slot":"collapsible-content",...e})}for(var __webpack_i__ in exports.Collapsible=__webpack_exports__.Collapsible,exports.CollapsibleContent=__webpack_exports__.CollapsibleContent,exports.CollapsibleTrigger=__webpack_exports__.CollapsibleTrigger,__webpack_exports__)-1===["Collapsible","CollapsibleContent","CollapsibleTrigger"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
3
3
|
//# sourceMappingURL=collapsible.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/collapsible.cjs","sources":["webpack://@codefast/ui/./src/components/collapsible.tsx"],"sourcesContent":["\n\nimport type { ComponentProps, JSX } from \"react\";\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\n\n/* -----------------------------------------------------------------------------\n * Component: Collapsible\n * -------------------------------------------------------------------------- */\n\nfunction Collapsible({ ...props }: ComponentProps<typeof CollapsiblePrimitive.Root>): JSX.Element {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CollapsibleTrigger\n * -------------------------------------------------------------------------- */\n\nfunction CollapsibleTrigger({ ...props }: ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): JSX.Element {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CollapsibleContent\n * -------------------------------------------------------------------------- */\n\nfunction CollapsibleContent({ ...props }: ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): JSX.Element {\n return <CollapsiblePrimitive.CollapsibleContent data-slot=\"collapsible-content\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger };\n"],"names":["Collapsible","props","CollapsiblePrimitive","CollapsibleTrigger","CollapsibleContent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"components/collapsible.cjs","sources":["webpack://@codefast/ui/webpack/runtime/define_property_getters","webpack://@codefast/ui/webpack/runtime/has_own_property","webpack://@codefast/ui/webpack/runtime/make_namespace_object","webpack://@codefast/ui/./src/components/collapsible.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\n\nimport type { ComponentProps, JSX } from \"react\";\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\n\n/* -----------------------------------------------------------------------------\n * Component: Collapsible\n * -------------------------------------------------------------------------- */\n\nfunction Collapsible({ ...props }: ComponentProps<typeof CollapsiblePrimitive.Root>): JSX.Element {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CollapsibleTrigger\n * -------------------------------------------------------------------------- */\n\nfunction CollapsibleTrigger({ ...props }: ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): JSX.Element {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CollapsibleContent\n * -------------------------------------------------------------------------- */\n\nfunction CollapsibleContent({ ...props }: ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): JSX.Element {\n return <CollapsiblePrimitive.CollapsibleContent data-slot=\"collapsible-content\" {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger };\n"],"names":["__webpack_require__","e","Object","Symbol","Collapsible","props","CollapsiblePrimitive","CollapsibleTrigger","CollapsibleContent"],"mappings":";+PAAAA,CAAAA,oBAAoB,CAAC,CAAG,CAACC,EAAS,KACjC,IAAI,IAAI,KAAO,EACLD,oBAAoB,CAAC,CAAC,EAAY,IAAQ,CAACA,oBAAoB,CAAC,CAACC,EAAS,IACzEC,OAAO,cAAc,CAACD,EAAS,EAAK,CAAE,WAAY,GAAM,IAAK,CAAU,CAAC,EAAI,EAGxF,ECNAD,oBAAoB,CAAC,CAAG,CAAC,EAAK,IAAUE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAK,GCClFF,oBAAoB,CAAC,CAAG,IACpB,oBAAOG,QAA0BA,OAAO,WAAW,EACrDD,OAAO,cAAc,CAACD,EAASE,OAAO,WAAW,CAAE,CAAE,MAAO,QAAS,GAEtED,OAAO,cAAc,CAACD,EAAS,aAAc,CAAE,MAAO,EAAK,EAC5D,E,yWCIA,SAASG,YAAY,CAAE,GAAGC,EAAyD,EACjF,MAAO,oCAACC,kCAAAA,IAAyB,EAAC,YAAU,cAAe,GAAGD,CAAK,EACrE,CAMA,SAASE,mBAAmB,CAAE,GAAGF,EAAuE,EACtG,MAAO,oCAACC,kCAAAA,kBAAuC,EAAC,YAAU,sBAAuB,GAAGD,CAAK,EAC3F,CAMA,SAASG,mBAAmB,CAAE,GAAGH,EAAuE,EACtG,MAAO,oCAACC,kCAAAA,kBAAuC,EAAC,YAAU,sBAAuB,GAAGD,CAAK,EAC3F,C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{
|
|
2
|
+
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CommandEmpty:()=>CommandEmpty,CommandLoading:()=>CommandLoading,CommandShortcut:()=>CommandShortcut,Command:()=>Command,CommandInput:()=>CommandInput,CommandList:()=>CommandList,CommandGroup:()=>CommandGroup,CommandItem:()=>CommandItem,CommandSeparator:()=>CommandSeparator,CommandDialog:()=>CommandDialog});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),react_visually_hidden_namespaceObject=require("@radix-ui/react-visually-hidden"),external_cmdk_namespaceObject=require("cmdk"),external_lucide_react_namespaceObject=require("lucide-react"),external_dialog_cjs_namespaceObject=require("./dialog.cjs"),utils_cjs_namespaceObject=require("../lib/utils.cjs");function Command({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command,{className:(0,utils_cjs_namespaceObject.cn)("bg-popover text-popover-foreground outline-hidden flex flex-col overflow-hidden rounded-[inherit]",e),"data-slot":"command",...a})}function CommandDialog({children:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_dialog_cjs_namespaceObject.Dialog,{"data-slot":"command-dialog",...a,children:(0,jsx_runtime_namespaceObject.jsxs)(external_dialog_cjs_namespaceObject.DialogContent,{className:"rounded-t-lg sm:rounded-lg","data-slot":"command-dialog-content",children:[(0,jsx_runtime_namespaceObject.jsxs)(react_visually_hidden_namespaceObject.VisuallyHidden,{children:[(0,jsx_runtime_namespaceObject.jsx)(external_dialog_cjs_namespaceObject.DialogTitle,{children:"Search command"}),(0,jsx_runtime_namespaceObject.jsx)(external_dialog_cjs_namespaceObject.DialogDescription,{children:"Use the search bar to find and select the desired command."})]}),(0,jsx_runtime_namespaceObject.jsx)(Command,{className:"[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input]]:h-12",children:e})]})})}function CommandInput({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsxs)("div",{className:"flex items-center gap-2 border-b px-3","cmdk-input-wrapper":"","data-slot":"command-input-wrapper",children:[(0,jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Input,{className:(0,utils_cjs_namespaceObject.cn)("placeholder:text-muted-foreground outline-hidden flex h-10 w-full text-base disabled:opacity-50 md:text-sm",e),"data-slot":"command-input",...a})]})}function CommandList({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.List,{className:(0,utils_cjs_namespaceObject.cn)("max-h-75 overflow-y-auto overflow-x-hidden",e),"data-slot":"command-list",...a})}function CommandEmpty({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Empty,{className:(0,utils_cjs_namespaceObject.cn)("py-6 text-center text-sm",e),"data-slot":"command-empty",...a})}function CommandGroup({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Group,{className:(0,utils_cjs_namespaceObject.cn)("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),"data-slot":"command-group",...a})}function CommandSeparator({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Separator,{className:(0,utils_cjs_namespaceObject.cn)("bg-border -mx-1 h-px",e),"data-slot":"command-separator",...a})}function CommandItem({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Item,{className:(0,utils_cjs_namespaceObject.cn)("aria-selected:bg-accent aria-selected:text-accent-foreground outline-hidden group/command-item [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default select-none items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",e),"data-slot":"command-item",...a})}function CommandLoading({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_cmdk_namespaceObject.Command.Loading,{className:(0,utils_cjs_namespaceObject.cn)("flex justify-center p-2",e),"data-slot":"command-loading",...a})}function CommandShortcut({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)("span",{className:(0,utils_cjs_namespaceObject.cn)("text-muted-foreground ml-auto text-xs tracking-widest",e),"data-slot":"command-shortcut",...a})}for(var __webpack_i__ in exports.Command=__webpack_exports__.Command,exports.CommandDialog=__webpack_exports__.CommandDialog,exports.CommandEmpty=__webpack_exports__.CommandEmpty,exports.CommandGroup=__webpack_exports__.CommandGroup,exports.CommandInput=__webpack_exports__.CommandInput,exports.CommandItem=__webpack_exports__.CommandItem,exports.CommandList=__webpack_exports__.CommandList,exports.CommandLoading=__webpack_exports__.CommandLoading,exports.CommandSeparator=__webpack_exports__.CommandSeparator,exports.CommandShortcut=__webpack_exports__.CommandShortcut,__webpack_exports__)-1===["Command","CommandDialog","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","CommandLoading","CommandSeparator","CommandShortcut"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
3
3
|
//# sourceMappingURL=command.cjs.map
|