@cognite/aura 1.49038.0 → 1.49189.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/core/accordion/accordion.js +1 -1
- package/dist/components/ui/core/accordion/accordion.js.map +1 -1
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +4 -4
- package/dist/components/ui/core/action-toolbar/action-toolbar.js.map +1 -1
- package/dist/components/ui/core/alert/alert.js +3 -3
- package/dist/components/ui/core/alert/alert.js.map +1 -1
- package/dist/components/ui/core/avatar/avatar.js +2 -2
- package/dist/components/ui/core/avatar/avatar.js.map +1 -1
- package/dist/components/ui/core/badge/badge.js +2 -2
- package/dist/components/ui/core/badge/badge.js.map +1 -1
- package/dist/components/ui/core/banner/banner.js +3 -3
- package/dist/components/ui/core/banner/banner.js.map +1 -1
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/ui/core/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/core/button/button.gallery.js +1 -1
- package/dist/components/ui/core/button/button.gallery.js.map +1 -1
- package/dist/components/ui/core/button/button.js +1 -1
- package/dist/components/ui/core/button/button.js.map +1 -1
- package/dist/components/ui/core/button-group/button-group.gallery.js +1 -1
- package/dist/components/ui/core/button-group/button-group.gallery.js.map +1 -1
- package/dist/components/ui/core/button-group/button-group.js +2 -2
- package/dist/components/ui/core/button-group/button-group.js.map +1 -1
- package/dist/components/ui/core/calendar/calendar-header.js +3 -3
- package/dist/components/ui/core/calendar/calendar-header.js.map +1 -1
- package/dist/components/ui/core/calendar/calendar.js +1 -1
- package/dist/components/ui/core/calendar/calendar.js.map +1 -1
- package/dist/components/ui/core/card/card.gallery.js +2 -2
- package/dist/components/ui/core/card/card.gallery.js.map +1 -1
- package/dist/components/ui/core/card/card.js +3 -3
- package/dist/components/ui/core/card/card.js.map +1 -1
- package/dist/components/ui/core/chart/chart.js +1 -1
- package/dist/components/ui/core/chart/chart.js.map +1 -1
- package/dist/components/ui/core/checkbox/checkbox.js +1 -1
- package/dist/components/ui/core/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/core/code-block/code-block.js +3 -3
- package/dist/components/ui/core/code-block/code-block.js.map +1 -1
- package/dist/components/ui/core/collapsible/collapsible.gallery.js +2 -2
- package/dist/components/ui/core/collapsible/collapsible.gallery.js.map +1 -1
- package/dist/components/ui/core/collapsible/collapsible.js +1 -1
- package/dist/components/ui/core/collapsible/collapsible.js.map +1 -1
- package/dist/components/ui/core/combobox/combobox.js +4 -4
- package/dist/components/ui/core/combobox/combobox.js.map +1 -1
- package/dist/components/ui/core/command/command.js +4 -4
- package/dist/components/ui/core/command/command.js.map +1 -1
- package/dist/components/ui/core/conversation/conversation.js +2 -2
- package/dist/components/ui/core/conversation/conversation.js.map +1 -1
- package/dist/components/ui/core/count/count.js +1 -1
- package/dist/components/ui/core/count/count.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid-cell.js +1 -1
- package/dist/components/ui/core/data-grid/data-grid-cell.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid-column-menu.js +4 -4
- package/dist/components/ui/core/data-grid/data-grid-column-menu.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid-column-resizer.js +1 -1
- package/dist/components/ui/core/data-grid/data-grid-column-resizer.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid-filter-panel.js +4 -4
- package/dist/components/ui/core/data-grid/data-grid-filter-panel.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid-footer.js +1 -1
- package/dist/components/ui/core/data-grid/data-grid-footer.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid-header-row.js +2 -2
- package/dist/components/ui/core/data-grid/data-grid-header-row.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid-header.js +1 -1
- package/dist/components/ui/core/data-grid/data-grid-header.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid-pagination.js +3 -3
- package/dist/components/ui/core/data-grid/data-grid-pagination.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid-row.js +2 -2
- package/dist/components/ui/core/data-grid/data-grid-row.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid-selection-toolbar.js +3 -3
- package/dist/components/ui/core/data-grid/data-grid-selection-toolbar.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid.fixtures.js +1 -1
- package/dist/components/ui/core/data-grid/data-grid.fixtures.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid.js +7 -7
- package/dist/components/ui/core/data-grid/data-grid.js.map +1 -1
- package/dist/components/ui/core/data-grid/data-grid.utils.js +1 -1
- package/dist/components/ui/core/data-grid/data-grid.utils.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +7 -7
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +2 -2
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +7 -7
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +3 -3
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.js +9 -9
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.js +4 -4
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +10 -10
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +5 -5
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/index.js +7 -7
- package/dist/components/ui/core/date-time-pickers/index.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +2 -2
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +2 -2
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +2 -2
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +2 -2
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +3 -3
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +4 -4
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +7 -7
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +3 -3
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.js +7 -7
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.js.map +1 -1
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.js +4 -4
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.js.map +1 -1
- package/dist/components/ui/core/dialog/dialog.js +3 -3
- package/dist/components/ui/core/dialog/dialog.js.map +1 -1
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +3 -3
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/core/empty-state/empty-state.js +1 -1
- package/dist/components/ui/core/empty-state/empty-state.js.map +1 -1
- package/dist/components/ui/core/helper-text/helper-text.js +1 -1
- package/dist/components/ui/core/helper-text/helper-text.js.map +1 -1
- package/dist/components/ui/core/hover-card/hover-card.js +2 -2
- package/dist/components/ui/core/hover-card/hover-card.js.map +1 -1
- package/dist/components/ui/core/inline-citation/inline-citation.js +3 -3
- package/dist/components/ui/core/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/ui/core/input/input.gallery.js +2 -2
- package/dist/components/ui/core/input/input.gallery.js.map +1 -1
- package/dist/components/ui/core/input/input.js +1 -1
- package/dist/components/ui/core/input/input.js.map +1 -1
- package/dist/components/ui/core/input-group/input-group.js +4 -4
- package/dist/components/ui/core/input-group/input-group.js.map +1 -1
- package/dist/components/ui/core/item/item.js +2 -2
- package/dist/components/ui/core/item/item.js.map +1 -1
- package/dist/components/ui/core/kbd/kbd.js +1 -1
- package/dist/components/ui/core/kbd/kbd.js.map +1 -1
- package/dist/components/ui/core/label/examples/label.gallery.js +2 -2
- package/dist/components/ui/core/label/examples/label.gallery.js.map +1 -1
- package/dist/components/ui/core/label/label.js +1 -1
- package/dist/components/ui/core/label/label.js.map +1 -1
- package/dist/components/ui/core/loader/loader.js +1 -1
- package/dist/components/ui/core/loader/loader.js.map +1 -1
- package/dist/components/ui/core/message/message-response-table-footer.js +3 -3
- package/dist/components/ui/core/message/message-response-table-footer.js.map +1 -1
- package/dist/components/ui/core/message/message-response-table.js +6 -6
- package/dist/components/ui/core/message/message-response-table.js.map +1 -1
- package/dist/components/ui/core/message/message.js +6 -6
- package/dist/components/ui/core/message/message.js.map +1 -1
- package/dist/components/ui/core/overflow-list/overflow-list.js +2 -2
- package/dist/components/ui/core/overflow-list/overflow-list.js.map +1 -1
- package/dist/components/ui/core/pagination/pagination-teleport.js +2 -2
- package/dist/components/ui/core/pagination/pagination-teleport.js.map +1 -1
- package/dist/components/ui/core/pagination/pagination.js +4 -4
- package/dist/components/ui/core/pagination/pagination.js.map +1 -1
- package/dist/components/ui/core/popover/popover.gallery.js +1 -1
- package/dist/components/ui/core/popover/popover.gallery.js.map +1 -1
- package/dist/components/ui/core/popover/popover.js +3 -3
- package/dist/components/ui/core/popover/popover.js.map +1 -1
- package/dist/components/ui/core/progress/progress.js +1 -1
- package/dist/components/ui/core/progress/progress.js.map +1 -1
- package/dist/components/ui/core/prompt-input/prompt-input.js +7 -7
- package/dist/components/ui/core/prompt-input/prompt-input.js.map +1 -1
- package/dist/components/ui/core/radio-group/radio-group.js +1 -1
- package/dist/components/ui/core/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/core/reasoning/reasoning.js +1 -1
- package/dist/components/ui/core/reasoning/reasoning.js.map +1 -1
- package/dist/components/ui/core/scroll-area/scroll-area.js +1 -1
- package/dist/components/ui/core/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/ui/core/search/search.js +2 -2
- package/dist/components/ui/core/search/search.js.map +1 -1
- package/dist/components/ui/core/segmented-control/segmented-control.js +1 -1
- package/dist/components/ui/core/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/ui/core/select/select.js +4 -4
- package/dist/components/ui/core/select/select.js.map +1 -1
- package/dist/components/ui/core/separator/separator.js +1 -1
- package/dist/components/ui/core/separator/separator.js.map +1 -1
- package/dist/components/ui/core/shimmer/shimmer.js +1 -1
- package/dist/components/ui/core/shimmer/shimmer.js.map +1 -1
- package/dist/components/ui/core/skeleton/skeleton.js +1 -1
- package/dist/components/ui/core/skeleton/skeleton.js.map +1 -1
- package/dist/components/ui/core/slider/slider.gallery.js +1 -1
- package/dist/components/ui/core/slider/slider.gallery.js.map +1 -1
- package/dist/components/ui/core/slider/slider.js +1 -1
- package/dist/components/ui/core/slider/slider.js.map +1 -1
- package/dist/components/ui/core/sonner-toast/sonner-toast.js +1 -1
- package/dist/components/ui/core/sonner-toast/sonner-toast.js.map +1 -1
- package/dist/components/ui/core/sources/sources.js +2 -2
- package/dist/components/ui/core/sources/sources.js.map +1 -1
- package/dist/components/ui/core/status-text/status-text.js +1 -1
- package/dist/components/ui/core/status-text/status-text.js.map +1 -1
- package/dist/components/ui/core/switch/switch.gallery.js +1 -1
- package/dist/components/ui/core/switch/switch.gallery.js.map +1 -1
- package/dist/components/ui/core/switch/switch.js +2 -2
- package/dist/components/ui/core/switch/switch.js.map +1 -1
- package/dist/components/ui/core/tabs/tabs.js +2 -2
- package/dist/components/ui/core/tabs/tabs.js.map +1 -1
- package/dist/components/ui/core/textarea/textarea.gallery.js +2 -2
- package/dist/components/ui/core/textarea/textarea.gallery.js.map +1 -1
- package/dist/components/ui/core/textarea/textarea.js +1 -1
- package/dist/components/ui/core/textarea/textarea.js.map +1 -1
- package/dist/components/ui/core/toggle/count-badge.js +1 -1
- package/dist/components/ui/core/toggle/count-badge.js.map +1 -1
- package/dist/components/ui/core/toggle/toggle.js +1 -1
- package/dist/components/ui/core/toggle/toggle.js.map +1 -1
- package/dist/components/ui/core/tool/tool.js +5 -5
- package/dist/components/ui/core/tool/tool.js.map +1 -1
- package/dist/components/ui/core/toolbar/toolbar.js +3 -3
- package/dist/components/ui/core/toolbar/toolbar.js.map +1 -1
- package/dist/components/ui/core/tooltip/tooltip.gallery.js +1 -1
- package/dist/components/ui/core/tooltip/tooltip.gallery.js.map +1 -1
- package/dist/components/ui/core/tooltip/tooltip.js +2 -2
- package/dist/components/ui/core/tooltip/tooltip.js.map +1 -1
- package/dist/components/ui/core/topbar/topbar.js +5 -5
- package/dist/components/ui/core/topbar/topbar.js.map +1 -1
- package/dist/components/ui/core/tree/tree.js +3 -3
- package/dist/components/ui/core/tree/tree.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/ui/core/pagination/pagination.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentProps,\n type ComponentRef,\n type MouseEvent,\n type ReactNode,\n forwardRef,\n} from 'react';\n\nimport type { SelectTriggerProps } from '@base-ui/react';\nimport {\n IconChevronLeft,\n IconChevronRight,\n IconChevronsLeft,\n IconChevronsRight,\n IconDots,\n} from '@tabler/icons-react';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../../../lib/utils';\nimport { Button } from '../button/button';\nimport { SelectTrigger } from '../select/select';\nimport { StatusText } from '../status-text/status-text';\n\nimport {\n type PaginationSize,\n PaginationSizeContext,\n usePaginationSize,\n} from './pagination-size-context';\nimport { PaginationTeleport } from './pagination-teleport';\n\nexport type PaginationNavLabels = {\n first?: string;\n previous?: string;\n next?: string;\n last?: string;\n};\n\nconst paginationLinkVariants = cva(\n 'border border-transparent text-base font-normal leading-5 tracking-tightest focus-visible:shadow-focus-ring',\n {\n variants: {\n size: {\n default: '',\n small: 'text-sm leading-4.5 tracking-tight',\n },\n active: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n {\n active: false,\n className:\n 'text-medium-foreground hover:bg-base-background-hover hover:text-base-foreground focus-visible:bg-medium-background focus-visible:text-base-foreground',\n },\n {\n active: true,\n className:\n 'border-emphasized bg-secondary-background text-secondary-foreground hover:bg-base-background-hover hover:text-secondary-foreground focus-visible:bg-secondary-background focus-visible:text-secondary-foreground',\n },\n ],\n defaultVariants: {\n size: 'default',\n active: false,\n },\n }\n);\n\nconst paginationEllipsisVariants = cva(\n 'flex items-center justify-center text-medium-foreground',\n {\n variants: {\n size: {\n default: 'h-9 w-9',\n small: 'h-7 w-7',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\nconst paginationSelectTriggerVariants = cva(\n 'w-auto whitespace-nowrap min-h-0',\n {\n variants: {\n size: {\n default: 'h-9 gap-2 rounded-lg px-3 min-w-19',\n sm: 'h-7 gap-1.5 rounded-md px-2 min-w-16',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\nconst ICON_BUTTON_WIDTH_BY_SIZE: Record<PaginationSize, string> = {\n small: 'max-w-7',\n default: 'max-w-9',\n};\n\nconst TEXT_LINK_WIDTH_BY_SIZE: Record<PaginationSize, string> = {\n small: 'min-w-7',\n default: 'min-w-9',\n};\n\ntype PaginationButtonSize = 'default' | 'sm';\ntype PaginationRadiusClass = 'rounded-md' | 'rounded-lg';\n\nconst getPaginationButtonStyles = (size: PaginationSize = 'default') => {\n const buttonSize: PaginationButtonSize = size === 'small' ? 'sm' : 'default';\n const radiusClass: PaginationRadiusClass =\n size === 'small' ? 'rounded-md' : 'rounded-lg';\n const iconButtonWidth = ICON_BUTTON_WIDTH_BY_SIZE[size];\n const textLinkWidth = TEXT_LINK_WIDTH_BY_SIZE[size];\n\n return {\n buttonSize,\n radiusClass,\n iconButtonWidth,\n textLinkWidth,\n };\n};\n\nconst Pagination: ForwardRefExoticComponent<\n Omit<\n ComponentProps<'nav'> & {\n size?: PaginationSize;\n },\n 'ref'\n > &\n RefAttributes<HTMLElement>\n> = forwardRef<\n ComponentRef<'nav'>,\n ComponentProps<'nav'> & { size?: PaginationSize }\n>(({ className, size = 'default', ...props }, ref) => {\n return (\n <PaginationSizeContext.Provider value={size}>\n <nav\n ref={ref}\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn('mx-auto flex w-full justify-center gap-2', className)}\n {...props}\n />\n </PaginationSizeContext.Provider>\n );\n});\nPagination.displayName = 'Pagination';\n\nconst PaginationContent: ForwardRefExoticComponent<\n Omit<\n ComponentProps<'ul'> & {\n size?: PaginationSize;\n },\n 'ref'\n > &\n RefAttributes<HTMLUListElement>\n> = forwardRef<\n ComponentRef<'ul'>,\n ComponentProps<'ul'> & { size?: PaginationSize }\n>(({ className, size, ...props }, ref) => {\n const inheritedSize = usePaginationSize();\n const resolvedSize = size ?? inheritedSize;\n return (\n <PaginationSizeContext.Provider value={resolvedSize}>\n <ul\n ref={ref}\n data-slot=\"pagination-content\"\n data-size={resolvedSize}\n className={cn('flex flex-row items-center gap-1', className)}\n {...props}\n />\n </PaginationSizeContext.Provider>\n );\n});\nPaginationContent.displayName = 'PaginationContent';\n\nconst PaginationItem: ForwardRefExoticComponent<\n ComponentProps<'li'> & RefAttributes<HTMLLIElement>\n> = forwardRef<ComponentRef<'li'>, ComponentProps<'li'>>((props, ref) => {\n return <li ref={ref} data-slot=\"pagination-item\" {...props} />;\n});\nPaginationItem.displayName = 'PaginationItem';\n\nconst PaginationStatus: ForwardRefExoticComponent<\n ComponentProps<'output'> & RefAttributes<HTMLOutputElement>\n> = forwardRef<ComponentRef<'output'>, ComponentProps<'output'>>(\n (props, ref) => {\n return <StatusText ref={ref} data-slot=\"pagination-status\" {...props} />;\n }\n);\nPaginationStatus.displayName = 'PaginationStatus';\n\nconst PaginationSelectTrigger: ForwardRefExoticComponent<\n Omit<\n SelectTriggerProps & {\n size?: 'sm' | 'default';\n errorMessage?: string;\n },\n 'ref'\n > &\n RefAttributes<HTMLButtonElement>\n> = forwardRef<\n ComponentRef<typeof SelectTrigger>,\n ComponentProps<typeof SelectTrigger>\n>(({ className, size, style, ...props }, ref) => {\n const inheritedSize = usePaginationSize();\n const isPaginationSmall = inheritedSize === 'small' && size === undefined;\n const resolvedSize = size ?? (isPaginationSmall ? 'sm' : 'default');\n\n return (\n <SelectTrigger\n ref={ref}\n size={resolvedSize}\n data-slot=\"pagination-select-trigger\"\n style={style}\n className={cn(\n paginationSelectTriggerVariants({ size: resolvedSize }),\n className\n )}\n {...props}\n />\n );\n});\nPaginationSelectTrigger.displayName = 'PaginationSelectTrigger';\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n isDisabled?: boolean;\n size?: PaginationSize;\n} & ComponentProps<'a'>;\n\nconst PaginationLink: ForwardRefExoticComponent<\n Omit<PaginationLinkProps, 'ref'> & RefAttributes<HTMLAnchorElement>\n> = forwardRef<ComponentRef<'a'>, PaginationLinkProps>(\n (\n { children, className, isActive, isDisabled, onClick, size, ...props },\n ref\n ) => {\n const inheritedSize = usePaginationSize();\n const resolvedSize = size ?? inheritedSize;\n const { buttonSize, radiusClass, textLinkWidth } =\n getPaginationButtonStyles(resolvedSize);\n const handleClick = (event: MouseEvent<HTMLAnchorElement>) => {\n if (isDisabled) {\n event.preventDefault();\n return;\n }\n\n onClick?.(event);\n };\n\n return (\n <Button\n variant=\"ghost\"\n size={buttonSize}\n data-slot=\"pagination-link\"\n data-active={isActive}\n className={cn(\n radiusClass,\n textLinkWidth,\n paginationLinkVariants({ size: resolvedSize, active: isActive }),\n isDisabled && 'pointer-events-none text-base-foreground-disabled',\n className\n )}\n render={\n <a\n ref={ref}\n aria-current={isActive ? 'page' : undefined}\n aria-disabled={isDisabled || undefined}\n onClick={handleClick}\n tabIndex={isDisabled ? -1 : undefined}\n {...props}\n >\n {children}\n </a>\n }\n />\n );\n }\n);\nPaginationLink.displayName = 'PaginationLink';\n\ntype PaginationIconLinkProps = {\n ariaLabel: string;\n dataSlot: string;\n icon: ReactNode;\n isDisabled?: boolean;\n size?: PaginationSize;\n} & Omit<ComponentProps<'a'>, 'children'>;\n\nconst PaginationIconLink = forwardRef<\n ComponentRef<'a'>,\n PaginationIconLinkProps\n>(\n (\n {\n ariaLabel,\n className,\n dataSlot,\n icon,\n isDisabled,\n onClick,\n size,\n ...linkProps\n },\n ref\n ) => {\n const inheritedSize = usePaginationSize();\n const resolvedSize = size ?? inheritedSize;\n const { buttonSize, radiusClass, iconButtonWidth } =\n getPaginationButtonStyles(resolvedSize);\n const handleClick = (event: MouseEvent<HTMLAnchorElement>) => {\n if (isDisabled) {\n event.preventDefault();\n return;\n }\n\n onClick?.(event);\n };\n\n return (\n <Button\n variant=\"ghost\"\n size={buttonSize}\n data-slot={dataSlot}\n className={cn(\n radiusClass,\n iconButtonWidth,\n paginationLinkVariants({ size: resolvedSize, active: false }),\n isDisabled && 'pointer-events-none text-base-foreground-disabled',\n className\n )}\n render={\n <a\n ref={ref}\n aria-label={ariaLabel}\n aria-disabled={isDisabled || undefined}\n onClick={handleClick}\n tabIndex={isDisabled ? -1 : undefined}\n {...linkProps}\n >\n {icon}\n </a>\n }\n />\n );\n }\n);\nPaginationIconLink.displayName = 'PaginationIconLink';\n\nconst PaginationFirst: ForwardRefExoticComponent<\n Omit<\n Omit<PaginationLinkProps, 'isActive'> & {\n label?: string;\n },\n 'ref'\n > &\n RefAttributes<HTMLAnchorElement>\n> = forwardRef<\n ComponentRef<'a'>,\n Omit<PaginationLinkProps, 'isActive'> & { label?: string }\n>(({ className, size, label = 'Go to first page', ...props }, ref) => {\n return (\n <PaginationIconLink\n ref={ref}\n dataSlot=\"pagination-first\"\n ariaLabel={label}\n icon={<IconChevronsLeft />}\n className={className}\n size={size}\n {...props}\n />\n );\n});\nPaginationFirst.displayName = 'PaginationFirst';\n\nconst PaginationPrevious: ForwardRefExoticComponent<\n Omit<\n Omit<PaginationLinkProps, 'isActive'> & {\n label?: string;\n },\n 'ref'\n > &\n RefAttributes<HTMLAnchorElement>\n> = forwardRef<\n ComponentRef<'a'>,\n Omit<PaginationLinkProps, 'isActive'> & { label?: string }\n>(({ className, size, label = 'Go to previous page', ...props }, ref) => {\n return (\n <PaginationIconLink\n ref={ref}\n dataSlot=\"pagination-previous\"\n ariaLabel={label}\n icon={<IconChevronLeft />}\n className={className}\n size={size}\n {...props}\n />\n );\n});\nPaginationPrevious.displayName = 'PaginationPrevious';\n\nconst PaginationNext: ForwardRefExoticComponent<\n Omit<\n Omit<PaginationLinkProps, 'isActive'> & {\n label?: string;\n },\n 'ref'\n > &\n RefAttributes<HTMLAnchorElement>\n> = forwardRef<\n ComponentRef<'a'>,\n Omit<PaginationLinkProps, 'isActive'> & { label?: string }\n>(({ className, size, label = 'Go to next page', ...props }, ref) => {\n return (\n <PaginationIconLink\n ref={ref}\n dataSlot=\"pagination-next\"\n ariaLabel={label}\n icon={<IconChevronRight />}\n className={className}\n size={size}\n {...props}\n />\n );\n});\nPaginationNext.displayName = 'PaginationNext';\n\nconst PaginationLast: ForwardRefExoticComponent<\n Omit<\n Omit<PaginationLinkProps, 'isActive'> & {\n label?: string;\n },\n 'ref'\n > &\n RefAttributes<HTMLAnchorElement>\n> = forwardRef<\n ComponentRef<'a'>,\n Omit<PaginationLinkProps, 'isActive'> & { label?: string }\n>(({ className, size, label = 'Go to last page', ...props }, ref) => {\n return (\n <PaginationIconLink\n ref={ref}\n dataSlot=\"pagination-last\"\n ariaLabel={label}\n icon={<IconChevronsRight />}\n className={className}\n size={size}\n {...props}\n />\n );\n});\nPaginationLast.displayName = 'PaginationLast';\n\nconst PaginationEllipsis: ForwardRefExoticComponent<\n Omit<\n ComponentProps<'span'> & {\n size?: PaginationSize;\n label?: string;\n },\n 'ref'\n > &\n RefAttributes<HTMLSpanElement>\n> = forwardRef<\n ComponentRef<'span'>,\n ComponentProps<'span'> & { size?: PaginationSize; label?: string }\n>(({ className, size, label = 'More pages', ...props }, ref) => {\n const inheritedSize = usePaginationSize();\n const resolvedSize = size ?? inheritedSize;\n const { iconButtonWidth } = getPaginationButtonStyles(resolvedSize);\n\n return (\n <span\n ref={ref}\n data-slot=\"pagination-ellipsis\"\n className={cn(\n iconButtonWidth,\n paginationEllipsisVariants({ size: resolvedSize }),\n className\n )}\n {...props}\n >\n <IconDots aria-hidden=\"true\" className=\"h-4 w-4\" />\n <span className=\"sr-only\">{label}</span>\n </span>\n );\n});\nPaginationEllipsis.displayName = 'PaginationEllipsis';\n\nconst PaginationResultsPerPage: ForwardRefExoticComponent<\n ComponentProps<'li'> & RefAttributes<HTMLLIElement>\n> = forwardRef<ComponentRef<'li'>, ComponentProps<'li'>>(\n ({ className, ...props }, ref) => {\n return (\n <li\n ref={ref}\n data-slot=\"pagination-results-per-page\"\n className={cn('flex items-center gap-2 pl-3', className)}\n {...props}\n />\n );\n }\n);\nPaginationResultsPerPage.displayName = 'PaginationResultsPerPage';\n\nconst PaginationResultsPerPageLabel: ForwardRefExoticComponent<\n ComponentProps<'span'> & RefAttributes<HTMLSpanElement>\n> = forwardRef<ComponentRef<'span'>, ComponentProps<'span'>>(\n ({ className, ...props }, ref) => {\n return (\n <span\n ref={ref}\n data-slot=\"pagination-results-per-page-label\"\n className={cn(\n 'text-sm leading-4.5 tracking-tight font-normal text-muted-foreground',\n className\n )}\n {...props}\n />\n );\n }\n);\nPaginationResultsPerPageLabel.displayName = 'PaginationResultsPerPageLabel';\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationFirst,\n PaginationItem,\n PaginationLast,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n PaginationResultsPerPage,\n PaginationResultsPerPageLabel,\n PaginationSelectTrigger,\n PaginationStatus,\n PaginationTeleport,\n};\n"],"names":["forwardRef","IconChevronLeft","IconChevronRight","IconChevronsLeft","IconChevronsRight","IconDots","cva","cn","Button","SelectTrigger","StatusText","PaginationSizeContext","usePaginationSize","PaginationTeleport","paginationLinkVariants","variants","size","default","small","active","true","false","compoundVariants","className","defaultVariants","paginationEllipsisVariants","paginationSelectTriggerVariants","sm","ICON_BUTTON_WIDTH_BY_SIZE","TEXT_LINK_WIDTH_BY_SIZE","getPaginationButtonStyles","buttonSize","radiusClass","iconButtonWidth","textLinkWidth","Pagination","props","ref","Provider","value","nav","aria-label","data-slot","displayName","PaginationContent","inheritedSize","resolvedSize","ul","data-size","PaginationItem","li","PaginationStatus","PaginationSelectTrigger","style","isPaginationSmall","undefined","PaginationLink","children","isActive","isDisabled","onClick","handleClick","event","preventDefault","variant","data-active","render","a","aria-current","aria-disabled","tabIndex","PaginationIconLink","ariaLabel","dataSlot","icon","linkProps","PaginationFirst","label","PaginationPrevious","PaginationNext","PaginationLast","PaginationEllipsis","span","aria-hidden","PaginationResultsPerPage","PaginationResultsPerPageLabel"],"mappings":";AAAA,SAOEA,UAAU,Q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;AAE5C,SACER,UAAU,EACVS,iBAAiB,EACjBqC,kBAAkB,EAClBL,eAAe,EACf3B,cAAc,EACd+B,cAAc,EACdxB,cAAc,EACduB,cAAc,EACdD,kBAAkB,EAClBM,wBAAwB,EACxBC,6BAA6B,EAC7BjC,uBAAuB,EACvBD,gBAAgB,EAChBtC,kBAAkB,GAClB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/pagination/pagination.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentProps,\n type ComponentRef,\n type MouseEvent,\n type ReactNode,\n forwardRef,\n} from 'react';\n\nimport type { SelectTriggerProps } from '@base-ui/react';\nimport {\n IconChevronLeft,\n IconChevronRight,\n IconChevronsLeft,\n IconChevronsRight,\n IconDots,\n} from '@tabler/icons-react';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../../../lib/utils';\nimport { Button } from '../button/button';\nimport { SelectTrigger } from '../select/select';\nimport { StatusText } from '../status-text/status-text';\n\nimport {\n type PaginationSize,\n PaginationSizeContext,\n usePaginationSize,\n} from './pagination-size-context';\nimport { PaginationTeleport } from './pagination-teleport';\n\nexport type PaginationNavLabels = {\n first?: string;\n previous?: string;\n next?: string;\n last?: string;\n};\n\nconst paginationLinkVariants = cva(\n 'border border-transparent text-base font-normal leading-5 tracking-tightest focus-visible:shadow-focus-ring',\n {\n variants: {\n size: {\n default: '',\n small: 'text-sm leading-4.5 tracking-tight',\n },\n active: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n {\n active: false,\n className:\n 'text-medium-foreground hover:bg-base-background-hover hover:text-base-foreground focus-visible:bg-medium-background focus-visible:text-base-foreground',\n },\n {\n active: true,\n className:\n 'border-emphasized bg-secondary-background text-secondary-foreground hover:bg-base-background-hover hover:text-secondary-foreground focus-visible:bg-secondary-background focus-visible:text-secondary-foreground',\n },\n ],\n defaultVariants: {\n size: 'default',\n active: false,\n },\n }\n);\n\nconst paginationEllipsisVariants = cva(\n 'flex items-center justify-center text-medium-foreground',\n {\n variants: {\n size: {\n default: 'h-9 w-9',\n small: 'h-7 w-7',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\nconst paginationSelectTriggerVariants = cva(\n 'w-auto whitespace-nowrap min-h-0',\n {\n variants: {\n size: {\n default: 'h-9 gap-2 rounded-lg px-3 min-w-19',\n sm: 'h-7 gap-1.5 rounded-md px-2 min-w-16',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\nconst ICON_BUTTON_WIDTH_BY_SIZE: Record<PaginationSize, string> = {\n small: 'max-w-7',\n default: 'max-w-9',\n};\n\nconst TEXT_LINK_WIDTH_BY_SIZE: Record<PaginationSize, string> = {\n small: 'min-w-7',\n default: 'min-w-9',\n};\n\ntype PaginationButtonSize = 'default' | 'sm';\ntype PaginationRadiusClass = 'rounded-md' | 'rounded-lg';\n\nconst getPaginationButtonStyles = (size: PaginationSize = 'default') => {\n const buttonSize: PaginationButtonSize = size === 'small' ? 'sm' : 'default';\n const radiusClass: PaginationRadiusClass =\n size === 'small' ? 'rounded-md' : 'rounded-lg';\n const iconButtonWidth = ICON_BUTTON_WIDTH_BY_SIZE[size];\n const textLinkWidth = TEXT_LINK_WIDTH_BY_SIZE[size];\n\n return {\n buttonSize,\n radiusClass,\n iconButtonWidth,\n textLinkWidth,\n };\n};\n\nconst Pagination: ForwardRefExoticComponent<\n Omit<\n ComponentProps<'nav'> & {\n size?: PaginationSize;\n },\n 'ref'\n > &\n RefAttributes<HTMLElement>\n> = forwardRef<\n ComponentRef<'nav'>,\n ComponentProps<'nav'> & { size?: PaginationSize }\n>(({ className, size = 'default', ...props }, ref) => {\n return (\n <PaginationSizeContext.Provider value={size}>\n <nav\n ref={ref}\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn('mx-auto flex w-full justify-center gap-2', className)}\n {...props}\n />\n </PaginationSizeContext.Provider>\n );\n});\nPagination.displayName = 'Pagination';\n\nconst PaginationContent: ForwardRefExoticComponent<\n Omit<\n ComponentProps<'ul'> & {\n size?: PaginationSize;\n },\n 'ref'\n > &\n RefAttributes<HTMLUListElement>\n> = forwardRef<\n ComponentRef<'ul'>,\n ComponentProps<'ul'> & { size?: PaginationSize }\n>(({ className, size, ...props }, ref) => {\n const inheritedSize = usePaginationSize();\n const resolvedSize = size ?? inheritedSize;\n return (\n <PaginationSizeContext.Provider value={resolvedSize}>\n <ul\n ref={ref}\n data-slot=\"pagination-content\"\n data-size={resolvedSize}\n className={cn('flex flex-row items-center gap-1', className)}\n {...props}\n />\n </PaginationSizeContext.Provider>\n );\n});\nPaginationContent.displayName = 'PaginationContent';\n\nconst PaginationItem: ForwardRefExoticComponent<\n ComponentProps<'li'> & RefAttributes<HTMLLIElement>\n> = forwardRef<ComponentRef<'li'>, ComponentProps<'li'>>((props, ref) => {\n return <li ref={ref} data-slot=\"pagination-item\" {...props} />;\n});\nPaginationItem.displayName = 'PaginationItem';\n\nconst PaginationStatus: ForwardRefExoticComponent<\n ComponentProps<'output'> & RefAttributes<HTMLOutputElement>\n> = forwardRef<ComponentRef<'output'>, ComponentProps<'output'>>(\n (props, ref) => {\n return <StatusText ref={ref} data-slot=\"pagination-status\" {...props} />;\n }\n);\nPaginationStatus.displayName = 'PaginationStatus';\n\nconst PaginationSelectTrigger: ForwardRefExoticComponent<\n Omit<\n SelectTriggerProps & {\n size?: 'sm' | 'default';\n errorMessage?: string;\n },\n 'ref'\n > &\n RefAttributes<HTMLButtonElement>\n> = forwardRef<\n ComponentRef<typeof SelectTrigger>,\n ComponentProps<typeof SelectTrigger>\n>(({ className, size, style, ...props }, ref) => {\n const inheritedSize = usePaginationSize();\n const isPaginationSmall = inheritedSize === 'small' && size === undefined;\n const resolvedSize = size ?? (isPaginationSmall ? 'sm' : 'default');\n\n return (\n <SelectTrigger\n ref={ref}\n size={resolvedSize}\n data-slot=\"pagination-select-trigger\"\n style={style}\n className={cn(\n paginationSelectTriggerVariants({ size: resolvedSize }),\n className\n )}\n {...props}\n />\n );\n});\nPaginationSelectTrigger.displayName = 'PaginationSelectTrigger';\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n isDisabled?: boolean;\n size?: PaginationSize;\n} & ComponentProps<'a'>;\n\nconst PaginationLink: ForwardRefExoticComponent<\n Omit<PaginationLinkProps, 'ref'> & RefAttributes<HTMLAnchorElement>\n> = forwardRef<ComponentRef<'a'>, PaginationLinkProps>(\n (\n { children, className, isActive, isDisabled, onClick, size, ...props },\n ref\n ) => {\n const inheritedSize = usePaginationSize();\n const resolvedSize = size ?? inheritedSize;\n const { buttonSize, radiusClass, textLinkWidth } =\n getPaginationButtonStyles(resolvedSize);\n const handleClick = (event: MouseEvent<HTMLAnchorElement>) => {\n if (isDisabled) {\n event.preventDefault();\n return;\n }\n\n onClick?.(event);\n };\n\n return (\n <Button\n variant=\"ghost\"\n size={buttonSize}\n data-slot=\"pagination-link\"\n data-active={isActive}\n className={cn(\n radiusClass,\n textLinkWidth,\n paginationLinkVariants({ size: resolvedSize, active: isActive }),\n isDisabled && 'pointer-events-none text-base-foreground-disabled',\n className\n )}\n render={\n <a\n ref={ref}\n aria-current={isActive ? 'page' : undefined}\n aria-disabled={isDisabled || undefined}\n onClick={handleClick}\n tabIndex={isDisabled ? -1 : undefined}\n {...props}\n >\n {children}\n </a>\n }\n />\n );\n }\n);\nPaginationLink.displayName = 'PaginationLink';\n\ntype PaginationIconLinkProps = {\n ariaLabel: string;\n dataSlot: string;\n icon: ReactNode;\n isDisabled?: boolean;\n size?: PaginationSize;\n} & Omit<ComponentProps<'a'>, 'children'>;\n\nconst PaginationIconLink = forwardRef<\n ComponentRef<'a'>,\n PaginationIconLinkProps\n>(\n (\n {\n ariaLabel,\n className,\n dataSlot,\n icon,\n isDisabled,\n onClick,\n size,\n ...linkProps\n },\n ref\n ) => {\n const inheritedSize = usePaginationSize();\n const resolvedSize = size ?? inheritedSize;\n const { buttonSize, radiusClass, iconButtonWidth } =\n getPaginationButtonStyles(resolvedSize);\n const handleClick = (event: MouseEvent<HTMLAnchorElement>) => {\n if (isDisabled) {\n event.preventDefault();\n return;\n }\n\n onClick?.(event);\n };\n\n return (\n <Button\n variant=\"ghost\"\n size={buttonSize}\n data-slot={dataSlot}\n className={cn(\n radiusClass,\n iconButtonWidth,\n paginationLinkVariants({ size: resolvedSize, active: false }),\n isDisabled && 'pointer-events-none text-base-foreground-disabled',\n className\n )}\n render={\n <a\n ref={ref}\n aria-label={ariaLabel}\n aria-disabled={isDisabled || undefined}\n onClick={handleClick}\n tabIndex={isDisabled ? -1 : undefined}\n {...linkProps}\n >\n {icon}\n </a>\n }\n />\n );\n }\n);\nPaginationIconLink.displayName = 'PaginationIconLink';\n\nconst PaginationFirst: ForwardRefExoticComponent<\n Omit<\n Omit<PaginationLinkProps, 'isActive'> & {\n label?: string;\n },\n 'ref'\n > &\n RefAttributes<HTMLAnchorElement>\n> = forwardRef<\n ComponentRef<'a'>,\n Omit<PaginationLinkProps, 'isActive'> & { label?: string }\n>(({ className, size, label = 'Go to first page', ...props }, ref) => {\n return (\n <PaginationIconLink\n ref={ref}\n dataSlot=\"pagination-first\"\n ariaLabel={label}\n icon={<IconChevronsLeft />}\n className={className}\n size={size}\n {...props}\n />\n );\n});\nPaginationFirst.displayName = 'PaginationFirst';\n\nconst PaginationPrevious: ForwardRefExoticComponent<\n Omit<\n Omit<PaginationLinkProps, 'isActive'> & {\n label?: string;\n },\n 'ref'\n > &\n RefAttributes<HTMLAnchorElement>\n> = forwardRef<\n ComponentRef<'a'>,\n Omit<PaginationLinkProps, 'isActive'> & { label?: string }\n>(({ className, size, label = 'Go to previous page', ...props }, ref) => {\n return (\n <PaginationIconLink\n ref={ref}\n dataSlot=\"pagination-previous\"\n ariaLabel={label}\n icon={<IconChevronLeft />}\n className={className}\n size={size}\n {...props}\n />\n );\n});\nPaginationPrevious.displayName = 'PaginationPrevious';\n\nconst PaginationNext: ForwardRefExoticComponent<\n Omit<\n Omit<PaginationLinkProps, 'isActive'> & {\n label?: string;\n },\n 'ref'\n > &\n RefAttributes<HTMLAnchorElement>\n> = forwardRef<\n ComponentRef<'a'>,\n Omit<PaginationLinkProps, 'isActive'> & { label?: string }\n>(({ className, size, label = 'Go to next page', ...props }, ref) => {\n return (\n <PaginationIconLink\n ref={ref}\n dataSlot=\"pagination-next\"\n ariaLabel={label}\n icon={<IconChevronRight />}\n className={className}\n size={size}\n {...props}\n />\n );\n});\nPaginationNext.displayName = 'PaginationNext';\n\nconst PaginationLast: ForwardRefExoticComponent<\n Omit<\n Omit<PaginationLinkProps, 'isActive'> & {\n label?: string;\n },\n 'ref'\n > &\n RefAttributes<HTMLAnchorElement>\n> = forwardRef<\n ComponentRef<'a'>,\n Omit<PaginationLinkProps, 'isActive'> & { label?: string }\n>(({ className, size, label = 'Go to last page', ...props }, ref) => {\n return (\n <PaginationIconLink\n ref={ref}\n dataSlot=\"pagination-last\"\n ariaLabel={label}\n icon={<IconChevronsRight />}\n className={className}\n size={size}\n {...props}\n />\n );\n});\nPaginationLast.displayName = 'PaginationLast';\n\nconst PaginationEllipsis: ForwardRefExoticComponent<\n Omit<\n ComponentProps<'span'> & {\n size?: PaginationSize;\n label?: string;\n },\n 'ref'\n > &\n RefAttributes<HTMLSpanElement>\n> = forwardRef<\n ComponentRef<'span'>,\n ComponentProps<'span'> & { size?: PaginationSize; label?: string }\n>(({ className, size, label = 'More pages', ...props }, ref) => {\n const inheritedSize = usePaginationSize();\n const resolvedSize = size ?? inheritedSize;\n const { iconButtonWidth } = getPaginationButtonStyles(resolvedSize);\n\n return (\n <span\n ref={ref}\n data-slot=\"pagination-ellipsis\"\n className={cn(\n iconButtonWidth,\n paginationEllipsisVariants({ size: resolvedSize }),\n className\n )}\n {...props}\n >\n <IconDots aria-hidden=\"true\" className=\"h-4 w-4\" />\n <span className=\"sr-only\">{label}</span>\n </span>\n );\n});\nPaginationEllipsis.displayName = 'PaginationEllipsis';\n\nconst PaginationResultsPerPage: ForwardRefExoticComponent<\n ComponentProps<'li'> & RefAttributes<HTMLLIElement>\n> = forwardRef<ComponentRef<'li'>, ComponentProps<'li'>>(\n ({ className, ...props }, ref) => {\n return (\n <li\n ref={ref}\n data-slot=\"pagination-results-per-page\"\n className={cn('flex items-center gap-2 pl-3', className)}\n {...props}\n />\n );\n }\n);\nPaginationResultsPerPage.displayName = 'PaginationResultsPerPage';\n\nconst PaginationResultsPerPageLabel: ForwardRefExoticComponent<\n ComponentProps<'span'> & RefAttributes<HTMLSpanElement>\n> = forwardRef<ComponentRef<'span'>, ComponentProps<'span'>>(\n ({ className, ...props }, ref) => {\n return (\n <span\n ref={ref}\n data-slot=\"pagination-results-per-page-label\"\n className={cn(\n 'text-sm leading-4.5 tracking-tight font-normal text-muted-foreground',\n className\n )}\n {...props}\n />\n );\n }\n);\nPaginationResultsPerPageLabel.displayName = 'PaginationResultsPerPageLabel';\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationFirst,\n PaginationItem,\n PaginationLast,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n PaginationResultsPerPage,\n PaginationResultsPerPageLabel,\n PaginationSelectTrigger,\n PaginationStatus,\n PaginationTeleport,\n};\n"],"names":["forwardRef","IconChevronLeft","IconChevronRight","IconChevronsLeft","IconChevronsRight","IconDots","cva","cn","Button","SelectTrigger","StatusText","PaginationSizeContext","usePaginationSize","PaginationTeleport","paginationLinkVariants","variants","size","default","small","active","true","false","compoundVariants","className","defaultVariants","paginationEllipsisVariants","paginationSelectTriggerVariants","sm","ICON_BUTTON_WIDTH_BY_SIZE","TEXT_LINK_WIDTH_BY_SIZE","getPaginationButtonStyles","buttonSize","radiusClass","iconButtonWidth","textLinkWidth","Pagination","props","ref","Provider","value","nav","aria-label","data-slot","displayName","PaginationContent","inheritedSize","resolvedSize","ul","data-size","PaginationItem","li","PaginationStatus","PaginationSelectTrigger","style","isPaginationSmall","undefined","PaginationLink","children","isActive","isDisabled","onClick","handleClick","event","preventDefault","variant","data-active","render","a","aria-current","aria-disabled","tabIndex","PaginationIconLink","ariaLabel","dataSlot","icon","linkProps","PaginationFirst","label","PaginationPrevious","PaginationNext","PaginationLast","PaginationEllipsis","span","aria-hidden","PaginationResultsPerPage","PaginationResultsPerPageLabel"],"mappings":";AAAA,SAOEA,UAAU,QACL,QAAQ;AAGf,SACEC,eAAe,EACfC,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,EACjBC,QAAQ,QACH,sBAAsB;AAC7B,SAASC,GAAG,QAAQ,2BAA2B;AAE/C,SAASC,EAAE,QAAQ,wBAAwB;AAC3C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,UAAU,QAAQ,6BAA6B;AAExD,SAEEC,qBAAqB,EACrBC,iBAAiB,QACZ,+BAA4B;AACnC,SAASC,kBAAkB,QAAQ,2BAAwB;AAS3D,MAAMC,yBAAyBR,IAC7B,+GACA;IACES,UAAU;QACRC,MAAM;YACJC,SAAS;YACTC,OAAO;QACT;QACAC,QAAQ;YACNC,MAAM;YACNC,OAAO;QACT;IACF;IACAC,kBAAkB;QAChB;YACEH,QAAQ;YACRI,WACE;QACJ;QACA;YACEJ,QAAQ;YACRI,WACE;QACJ;KACD;IACDC,iBAAiB;QACfR,MAAM;QACNG,QAAQ;IACV;AACF;AAGF,MAAMM,6BAA6BnB,IACjC,2DACA;IACES,UAAU;QACRC,MAAM;YACJC,SAAS;YACTC,OAAO;QACT;IACF;IACAM,iBAAiB;QACfR,MAAM;IACR;AACF;AAGF,MAAMU,kCAAkCpB,IACtC,oCACA;IACES,UAAU;QACRC,MAAM;YACJC,SAAS;YACTU,IAAI;QACN;IACF;IACAH,iBAAiB;QACfR,MAAM;IACR;AACF;AAGF,MAAMY,4BAA4D;IAChEV,OAAO;IACPD,SAAS;AACX;AAEA,MAAMY,0BAA0D;IAC9DX,OAAO;IACPD,SAAS;AACX;AAKA,MAAMa,4BAA4B,CAACd,OAAuB,SAAS;IACjE,MAAMe,aAAmCf,SAAS,UA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,EAAE,GAAGa,OAAO,EAAEC;IACxB,qBACE,KAAC6C;QACC7C,KAAKA;QACLK,aAAU;QACVnB,WAAWhB,GACT,wEACAgB;QAED,GAAGa,KAAK;;AAGf;AAEFiD,8BAA8B1C,WAAW,GAAG;AAE5C,SACER,UAAU,EACVS,iBAAiB,EACjBqC,kBAAkB,EAClBL,eAAe,EACf3B,cAAc,EACd+B,cAAc,EACdxB,cAAc,EACduB,cAAc,EACdD,kBAAkB,EAClBM,wBAAwB,EACxBC,6BAA6B,EAC7BjC,uBAAuB,EACvBD,gBAAgB,EAChBtC,kBAAkB,GAClB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from "../button/button
|
|
2
|
+
import { Button } from "../button/button";
|
|
3
3
|
import { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverHeader, PopoverHeaderContent, PopoverSlot, PopoverTitle, PopoverTrigger } from "./popover.js";
|
|
4
4
|
export function PopoverGallery() {
|
|
5
5
|
return /*#__PURE__*/ _jsx("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/ui/core/popover/popover.gallery.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\n\nimport { Button } from '../button/button';\n\nimport {\n Popover,\n PopoverClose,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverHeaderContent,\n PopoverSlot,\n PopoverTitle,\n PopoverTrigger,\n} from './popover';\n\nexport function PopoverGallery(): ReactElement {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <Popover>\n <PopoverTrigger render={<Button>Open Popover</Button>} />\n <PopoverContent aria-label=\"Getting started\">\n <PopoverHeader>\n <PopoverHeaderContent>\n <PopoverTitle>Getting started</PopoverTitle>\n <PopoverClose />\n </PopoverHeaderContent>\n <PopoverDescription>\n This popover provides helpful information and guidance to help you\n understand key features and workflows.\n </PopoverDescription>\n </PopoverHeader>\n <PopoverSlot>\n <Button variant=\"outline\" size=\"sm\">\n Explore\n </Button>\n </PopoverSlot>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n"],"names":["Button","Popover","PopoverClose","PopoverContent","PopoverDescription","PopoverHeader","PopoverHeaderContent","PopoverSlot","PopoverTitle","PopoverTrigger","PopoverGallery","div","className","render","aria-label","variant","size"],"mappings":";AAEA,SAASA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/popover/popover.gallery.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\n\nimport { Button } from '../button/button';\n\nimport {\n Popover,\n PopoverClose,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverHeaderContent,\n PopoverSlot,\n PopoverTitle,\n PopoverTrigger,\n} from './popover';\n\nexport function PopoverGallery(): ReactElement {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <Popover>\n <PopoverTrigger render={<Button>Open Popover</Button>} />\n <PopoverContent aria-label=\"Getting started\">\n <PopoverHeader>\n <PopoverHeaderContent>\n <PopoverTitle>Getting started</PopoverTitle>\n <PopoverClose />\n </PopoverHeaderContent>\n <PopoverDescription>\n This popover provides helpful information and guidance to help you\n understand key features and workflows.\n </PopoverDescription>\n </PopoverHeader>\n <PopoverSlot>\n <Button variant=\"outline\" size=\"sm\">\n Explore\n </Button>\n </PopoverSlot>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n"],"names":["Button","Popover","PopoverClose","PopoverContent","PopoverDescription","PopoverHeader","PopoverHeaderContent","PopoverSlot","PopoverTitle","PopoverTrigger","PopoverGallery","div","className","render","aria-label","variant","size"],"mappings":";AAEA,SAASA,MAAM,QAAQ,mBAAmB;AAE1C,SACEC,OAAO,EACPC,YAAY,EACZC,cAAc,EACdC,kBAAkB,EAClBC,aAAa,EACbC,oBAAoB,EACpBC,WAAW,EACXC,YAAY,EACZC,cAAc,QACT,eAAY;AAEnB,OAAO,SAASC;IACd,qBACE,KAACC;QAAIC,WAAU;kBACb,cAAA,MAACX;;8BACC,KAACQ;oBAAeI,sBAAQ,KAACb;kCAAO;;;8BAChC,MAACG;oBAAeW,cAAW;;sCACzB,MAACT;;8CACC,MAACC;;sDACC,KAACE;sDAAa;;sDACd,KAACN;;;8CAEH,KAACE;8CAAmB;;;;sCAKtB,KAACG;sCACC,cAAA,KAACP;gCAAOe,SAAQ;gCAAUC,MAAK;0CAAK;;;;;;;;AAQhD"}
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
4
4
|
import { IconX } from "@tabler/icons-react";
|
|
5
|
-
import { usePortalContainer } from "../../../../lib/portal-container-context
|
|
6
|
-
import { cn } from "../../../../lib/utils
|
|
7
|
-
import { Button } from "../button/button
|
|
5
|
+
import { usePortalContainer } from "../../../../lib/portal-container-context";
|
|
6
|
+
import { cn } from "../../../../lib/utils";
|
|
7
|
+
import { Button } from "../button/button";
|
|
8
8
|
function Popover(props) {
|
|
9
9
|
return /*#__PURE__*/ _jsx(PopoverPrimitive.Root, {
|
|
10
10
|
"data-slot": "popover",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/ui/core/popover/popover.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentProps,\n type ComponentRef,\n type ReactNode,\n forwardRef,\n} from 'react';\n\nimport type {\n PopoverPopupProps,\n PopoverPositionerProps,\n} from '@base-ui/react/popover';\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover';\nimport { IconX } from '@tabler/icons-react';\n\nimport { usePortalContainer } from '../../../../lib/portal-container-context';\nimport { cn } from '../../../../lib/utils';\nimport { Button } from '../button/button';\n\nfunction Popover(props: PopoverPrimitive.Root.Props): ReactNode {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({\n children,\n ...props\n}: PopoverPrimitive.Trigger.Props): ReactNode {\n return (\n <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props}>\n {children}\n </PopoverPrimitive.Trigger>\n );\n}\n\nconst PopoverHeader: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<HTMLDivElement, ComponentProps<'div'>>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-slot=\"popover-header\"\n className={cn(\n 'flex flex-col items-start gap-2 self-stretch',\n className\n )}\n {...props}\n />\n );\n }\n);\nPopoverHeader.displayName = 'PopoverHeader';\n\nconst PopoverHeaderContent: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<HTMLDivElement, ComponentProps<'div'>>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-slot=\"popover-header-content\"\n className={cn(\n 'flex items-start justify-between self-stretch',\n className\n )}\n {...props}\n />\n );\n }\n);\nPopoverHeaderContent.displayName = 'PopoverHeaderContent';\n\nconst PopoverTitle: ForwardRefExoticComponent<\n ComponentProps<'h3'> & RefAttributes<HTMLHeadingElement>\n> = forwardRef<HTMLHeadingElement, ComponentProps<'h3'>>(\n ({ className, children, ...props }, ref) => {\n return (\n <h3\n ref={ref}\n data-slot=\"popover-title\"\n className={cn(\n 'flex h-7 flex-1 flex-col justify-center self-stretch overflow-hidden text-ellipsis whitespace-nowrap text-base font-medium text-popover-foreground leading-5 tracking-tighter',\n className\n )}\n {...props}\n >\n {children}\n </h3>\n );\n }\n);\nPopoverTitle.displayName = 'PopoverTitle';\n\nconst PopoverDescription: ForwardRefExoticComponent<\n ComponentProps<'p'> & RefAttributes<HTMLParagraphElement>\n> = forwardRef<HTMLParagraphElement, ComponentProps<'p'>>(\n ({ className, ...props }, ref) => {\n return (\n <p\n ref={ref}\n data-slot=\"popover-description\"\n className={cn(\n 'self-stretch text-sm font-normal text-muted-foreground leading-[18px] tracking-tight',\n className\n )}\n {...props}\n />\n );\n }\n);\nPopoverDescription.displayName = 'PopoverDescription';\n\nconst PopoverSlot: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<HTMLDivElement, ComponentProps<'div'>>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-slot=\"popover-slot\"\n className={cn(\n 'flex flex-col items-start gap-3 self-stretch',\n className\n )}\n {...props}\n />\n );\n }\n);\nPopoverSlot.displayName = 'PopoverSlot';\n\nconst PopoverClose: ForwardRefExoticComponent<\n Omit<ComponentProps<typeof Button>, 'ref'> & RefAttributes<HTMLElement>\n> = forwardRef<ComponentRef<typeof Button>, ComponentProps<typeof Button>>(\n (\n { className, children, 'aria-label': ariaLabel = 'Close', ...props },\n ref\n ) => {\n return (\n <PopoverPrimitive.Close\n data-slot=\"popover-close\"\n render={\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon-sm\"\n className={cn('h-7 w-7 shrink-0', className)}\n aria-label={ariaLabel}\n {...props}\n >\n {children ?? <IconX className=\"h-4 w-4\" />}\n </Button>\n }\n />\n );\n }\n);\nPopoverClose.displayName = 'PopoverClose';\n\nconst PopoverContent: ForwardRefExoticComponent<\n Omit<\n PopoverPopupProps &\n Pick<\n PopoverPositionerProps,\n 'align' | 'alignOffset' | 'anchor' | 'side' | 'sideOffset'\n >,\n 'ref'\n > &\n RefAttributes<HTMLDivElement>\n> = forwardRef<\n ComponentRef<typeof PopoverPrimitive.Popup>,\n PopoverPrimitive.Popup.Props &\n Pick<\n PopoverPrimitive.Positioner.Props,\n 'align' | 'alignOffset' | 'anchor' | 'side' | 'sideOffset'\n >\n>(\n (\n {\n className,\n align = 'center',\n alignOffset = 0,\n anchor,\n side = 'bottom',\n sideOffset = 4,\n ...props\n },\n ref\n ) => {\n const container = usePortalContainer();\n return (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <PopoverPrimitive.Popup\n ref={ref}\n data-slot=\"popover-content\"\n className={cn(\n 'bg-popover-background text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 flex w-72 flex-col items-start origin-[var(--transform-origin)] rounded-xl border border-default p-4 gap-2 shadow-default outline-none',\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n );\n }\n);\nPopoverContent.displayName = 'PopoverContent';\n\nexport {\n Popover,\n PopoverClose,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverHeaderContent,\n PopoverSlot,\n PopoverTitle,\n PopoverTrigger,\n};\n"],"names":["forwardRef","Popover","PopoverPrimitive","IconX","usePortalContainer","cn","Button","props","Root","data-slot","PopoverTrigger","children","Trigger","PopoverHeader","className","ref","div","displayName","PopoverHeaderContent","PopoverTitle","h3","PopoverDescription","p","PopoverSlot","PopoverClose","ariaLabel","Close","render","variant","size","aria-label","PopoverContent","align","alignOffset","anchor","side","sideOffset","container","Portal","Positioner","Popup"],"mappings":";AAAA,SAMEA,UAAU,QACL,QAAQ;AAMf,SAASC,WAAWC,gBAAgB,QAAQ,yBAAyB;AACrE,SAASC,KAAK,QAAQ,sBAAsB;AAE5C,SAASC,kBAAkB,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/popover/popover.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentProps,\n type ComponentRef,\n type ReactNode,\n forwardRef,\n} from 'react';\n\nimport type {\n PopoverPopupProps,\n PopoverPositionerProps,\n} from '@base-ui/react/popover';\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover';\nimport { IconX } from '@tabler/icons-react';\n\nimport { usePortalContainer } from '../../../../lib/portal-container-context';\nimport { cn } from '../../../../lib/utils';\nimport { Button } from '../button/button';\n\nfunction Popover(props: PopoverPrimitive.Root.Props): ReactNode {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({\n children,\n ...props\n}: PopoverPrimitive.Trigger.Props): ReactNode {\n return (\n <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props}>\n {children}\n </PopoverPrimitive.Trigger>\n );\n}\n\nconst PopoverHeader: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<HTMLDivElement, ComponentProps<'div'>>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-slot=\"popover-header\"\n className={cn(\n 'flex flex-col items-start gap-2 self-stretch',\n className\n )}\n {...props}\n />\n );\n }\n);\nPopoverHeader.displayName = 'PopoverHeader';\n\nconst PopoverHeaderContent: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<HTMLDivElement, ComponentProps<'div'>>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-slot=\"popover-header-content\"\n className={cn(\n 'flex items-start justify-between self-stretch',\n className\n )}\n {...props}\n />\n );\n }\n);\nPopoverHeaderContent.displayName = 'PopoverHeaderContent';\n\nconst PopoverTitle: ForwardRefExoticComponent<\n ComponentProps<'h3'> & RefAttributes<HTMLHeadingElement>\n> = forwardRef<HTMLHeadingElement, ComponentProps<'h3'>>(\n ({ className, children, ...props }, ref) => {\n return (\n <h3\n ref={ref}\n data-slot=\"popover-title\"\n className={cn(\n 'flex h-7 flex-1 flex-col justify-center self-stretch overflow-hidden text-ellipsis whitespace-nowrap text-base font-medium text-popover-foreground leading-5 tracking-tighter',\n className\n )}\n {...props}\n >\n {children}\n </h3>\n );\n }\n);\nPopoverTitle.displayName = 'PopoverTitle';\n\nconst PopoverDescription: ForwardRefExoticComponent<\n ComponentProps<'p'> & RefAttributes<HTMLParagraphElement>\n> = forwardRef<HTMLParagraphElement, ComponentProps<'p'>>(\n ({ className, ...props }, ref) => {\n return (\n <p\n ref={ref}\n data-slot=\"popover-description\"\n className={cn(\n 'self-stretch text-sm font-normal text-muted-foreground leading-[18px] tracking-tight',\n className\n )}\n {...props}\n />\n );\n }\n);\nPopoverDescription.displayName = 'PopoverDescription';\n\nconst PopoverSlot: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<HTMLDivElement, ComponentProps<'div'>>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-slot=\"popover-slot\"\n className={cn(\n 'flex flex-col items-start gap-3 self-stretch',\n className\n )}\n {...props}\n />\n );\n }\n);\nPopoverSlot.displayName = 'PopoverSlot';\n\nconst PopoverClose: ForwardRefExoticComponent<\n Omit<ComponentProps<typeof Button>, 'ref'> & RefAttributes<HTMLElement>\n> = forwardRef<ComponentRef<typeof Button>, ComponentProps<typeof Button>>(\n (\n { className, children, 'aria-label': ariaLabel = 'Close', ...props },\n ref\n ) => {\n return (\n <PopoverPrimitive.Close\n data-slot=\"popover-close\"\n render={\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon-sm\"\n className={cn('h-7 w-7 shrink-0', className)}\n aria-label={ariaLabel}\n {...props}\n >\n {children ?? <IconX className=\"h-4 w-4\" />}\n </Button>\n }\n />\n );\n }\n);\nPopoverClose.displayName = 'PopoverClose';\n\nconst PopoverContent: ForwardRefExoticComponent<\n Omit<\n PopoverPopupProps &\n Pick<\n PopoverPositionerProps,\n 'align' | 'alignOffset' | 'anchor' | 'side' | 'sideOffset'\n >,\n 'ref'\n > &\n RefAttributes<HTMLDivElement>\n> = forwardRef<\n ComponentRef<typeof PopoverPrimitive.Popup>,\n PopoverPrimitive.Popup.Props &\n Pick<\n PopoverPrimitive.Positioner.Props,\n 'align' | 'alignOffset' | 'anchor' | 'side' | 'sideOffset'\n >\n>(\n (\n {\n className,\n align = 'center',\n alignOffset = 0,\n anchor,\n side = 'bottom',\n sideOffset = 4,\n ...props\n },\n ref\n ) => {\n const container = usePortalContainer();\n return (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <PopoverPrimitive.Popup\n ref={ref}\n data-slot=\"popover-content\"\n className={cn(\n 'bg-popover-background text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 flex w-72 flex-col items-start origin-[var(--transform-origin)] rounded-xl border border-default p-4 gap-2 shadow-default outline-none',\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n );\n }\n);\nPopoverContent.displayName = 'PopoverContent';\n\nexport {\n Popover,\n PopoverClose,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverHeaderContent,\n PopoverSlot,\n PopoverTitle,\n PopoverTrigger,\n};\n"],"names":["forwardRef","Popover","PopoverPrimitive","IconX","usePortalContainer","cn","Button","props","Root","data-slot","PopoverTrigger","children","Trigger","PopoverHeader","className","ref","div","displayName","PopoverHeaderContent","PopoverTitle","h3","PopoverDescription","p","PopoverSlot","PopoverClose","ariaLabel","Close","render","variant","size","aria-label","PopoverContent","align","alignOffset","anchor","side","sideOffset","container","Portal","Positioner","Popup"],"mappings":";AAAA,SAMEA,UAAU,QACL,QAAQ;AAMf,SAASC,WAAWC,gBAAgB,QAAQ,yBAAyB;AACrE,SAASC,KAAK,QAAQ,sBAAsB;AAE5C,SAASC,kBAAkB,QAAQ,2CAA2C;AAC9E,SAASC,EAAE,QAAQ,wBAAwB;AAC3C,SAASC,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;;AAGf;AAEFgB,YAAYN,WAAW,GAAG;AAE1B,MAAMO,6BAEFxB,WACF,CACE,EAAEc,SAAS,EAAEH,QAAQ,EAAE,cAAcc,YAAY,OAAO,EAAE,GAAGlB,OAAO,EACpEQ;IAEA,qBACE,KAACb,iBAAiBwB,KAAK;QACrBjB,aAAU;QACVkB,sBACE,KAACrB;YACCS,KAAKA;YACLa,SAAQ;YACRC,MAAK;YACLf,WAAWT,GAAG,oBAAoBS;YAClCgB,cAAYL;YACX,GAAGlB,KAAK;sBAERI,0BAAY,KAACR;gBAAMW,WAAU;;;;AAKxC;AAEFU,aAAaP,WAAW,GAAG;AAE3B,MAAMc,+BAUF/B,WAQF,CACE,EACEc,SAAS,EACTkB,QAAQ,QAAQ,EAChBC,cAAc,CAAC,EACfC,MAAM,EACNC,OAAO,QAAQ,EACfC,aAAa,CAAC,EACd,GAAG7B,OACJ,EACDQ;IAEA,MAAMsB,YAAYjC;IAClB,qBACE,KAACF,iBAAiBoC,MAAM;QAACD,WAAWA;kBAClC,cAAA,KAACnC,iBAAiBqC,UAAU;YAC1BP,OAAOA;YACPC,aAAaA;YACbC,QAAQA;YACRC,MAAMA;YACNC,YAAYA;YACZtB,WAAU;sBAEV,cAAA,KAACZ,iBAAiBsC,KAAK;gBACrBzB,KAAKA;gBACLN,aAAU;gBACVK,WAAWT,GACT,8dACAS;gBAED,GAAGP,KAAK;;;;AAKnB;AAEFwB,eAAed,WAAW,GAAG;AAE7B,SACEhB,OAAO,EACPuB,YAAY,EACZO,cAAc,EACdV,kBAAkB,EAClBR,aAAa,EACbK,oBAAoB,EACpBK,WAAW,EACXJ,YAAY,EACZT,cAAc,GACd"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
|
-
import { cn } from "../../../../lib/utils
|
|
5
|
+
import { cn } from "../../../../lib/utils";
|
|
6
6
|
const progressTrackVariants = cva('relative w-full overflow-hidden rounded-full bg-medium-background', {
|
|
7
7
|
variants: {
|
|
8
8
|
size: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/ui/core/progress/progress.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentRef,\n forwardRef,\n} from 'react';\n\nimport { Progress as ProgressPrimitive } from '@base-ui/react/progress';\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport type { ClassProp } from 'class-variance-authority/types';\n\nimport { cn } from '../../../../lib/utils';\n\ninterface ProgressTrackVariantProps {\n size?: 'default' | 'sm' | null;\n}\n\nconst progressTrackVariants: (\n props?: (ProgressTrackVariantProps & ClassProp) | undefined\n) => string = cva(\n 'relative w-full overflow-hidden rounded-full bg-medium-background',\n {\n variants: {\n size: {\n default: 'h-2',\n sm: 'h-1',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\nconst progressIndicatorClasses =\n 'bg-primary-background h-full transition-[width]';\n\ntype ProgressProps = ProgressPrimitive.Root.Props &\n VariantProps<typeof progressTrackVariants> & { max?: number };\n\nconst Progress: ForwardRefExoticComponent<\n Omit<ProgressProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n (\n {\n className,\n value = 0,\n max = 100,\n size,\n 'aria-label': ariaLabel,\n ...props\n },\n ref\n ) => {\n const safeValue = value ?? 0;\n const safeMax = max > 0 ? max : 100;\n const clampedValue = Math.max(0, Math.min(safeValue, safeMax));\n const percentage = (clampedValue * 100) / safeMax;\n const indicatorStyle = { width: `${percentage}%` };\n const defaultAriaLabel = `Progress: ${Math.round(percentage)}%`;\n\n return (\n <ProgressPrimitive.Root\n ref={ref}\n data-slot=\"progress\"\n className={cn('block w-full', className)}\n value={clampedValue}\n max={safeMax}\n aria-label={ariaLabel ?? defaultAriaLabel}\n {...props}\n >\n <ProgressPrimitive.Track\n data-slot=\"progress-track\"\n className={cn(progressTrackVariants({ size }))}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className={progressIndicatorClasses}\n style={indicatorStyle}\n />\n </ProgressPrimitive.Track>\n </ProgressPrimitive.Root>\n );\n }\n);\n\nProgress.displayName = 'Progress';\n\nexport { Progress, progressIndicatorClasses, progressTrackVariants };\n"],"names":["forwardRef","Progress","ProgressPrimitive","cva","cn","progressTrackVariants","variants","size","default","sm","defaultVariants","progressIndicatorClasses","className","value","max","ariaLabel","props","ref","safeValue","safeMax","clampedValue","Math","min","percentage","indicatorStyle","width","defaultAriaLabel","round","Root","data-slot","aria-label","Track","Indicator","style","displayName"],"mappings":";AAAA,SAIEA,UAAU,QACL,QAAQ;AAEf,SAASC,YAAYC,iBAAiB,QAAQ,0BAA0B;AACxE,SAA4BC,GAAG,QAAQ,2BAA2B;AAGlE,SAASC,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/progress/progress.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentRef,\n forwardRef,\n} from 'react';\n\nimport { Progress as ProgressPrimitive } from '@base-ui/react/progress';\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport type { ClassProp } from 'class-variance-authority/types';\n\nimport { cn } from '../../../../lib/utils';\n\ninterface ProgressTrackVariantProps {\n size?: 'default' | 'sm' | null;\n}\n\nconst progressTrackVariants: (\n props?: (ProgressTrackVariantProps & ClassProp) | undefined\n) => string = cva(\n 'relative w-full overflow-hidden rounded-full bg-medium-background',\n {\n variants: {\n size: {\n default: 'h-2',\n sm: 'h-1',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\nconst progressIndicatorClasses =\n 'bg-primary-background h-full transition-[width]';\n\ntype ProgressProps = ProgressPrimitive.Root.Props &\n VariantProps<typeof progressTrackVariants> & { max?: number };\n\nconst Progress: ForwardRefExoticComponent<\n Omit<ProgressProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n (\n {\n className,\n value = 0,\n max = 100,\n size,\n 'aria-label': ariaLabel,\n ...props\n },\n ref\n ) => {\n const safeValue = value ?? 0;\n const safeMax = max > 0 ? max : 100;\n const clampedValue = Math.max(0, Math.min(safeValue, safeMax));\n const percentage = (clampedValue * 100) / safeMax;\n const indicatorStyle = { width: `${percentage}%` };\n const defaultAriaLabel = `Progress: ${Math.round(percentage)}%`;\n\n return (\n <ProgressPrimitive.Root\n ref={ref}\n data-slot=\"progress\"\n className={cn('block w-full', className)}\n value={clampedValue}\n max={safeMax}\n aria-label={ariaLabel ?? defaultAriaLabel}\n {...props}\n >\n <ProgressPrimitive.Track\n data-slot=\"progress-track\"\n className={cn(progressTrackVariants({ size }))}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className={progressIndicatorClasses}\n style={indicatorStyle}\n />\n </ProgressPrimitive.Track>\n </ProgressPrimitive.Root>\n );\n }\n);\n\nProgress.displayName = 'Progress';\n\nexport { Progress, progressIndicatorClasses, progressTrackVariants };\n"],"names":["forwardRef","Progress","ProgressPrimitive","cva","cn","progressTrackVariants","variants","size","default","sm","defaultVariants","progressIndicatorClasses","className","value","max","ariaLabel","props","ref","safeValue","safeMax","clampedValue","Math","min","percentage","indicatorStyle","width","defaultAriaLabel","round","Root","data-slot","aria-label","Track","Indicator","style","displayName"],"mappings":";AAAA,SAIEA,UAAU,QACL,QAAQ;AAEf,SAASC,YAAYC,iBAAiB,QAAQ,0BAA0B;AACxE,SAA4BC,GAAG,QAAQ,2BAA2B;AAGlE,SAASC,EAAE,QAAQ,wBAAwB;AAM3C,MAAMC,wBAEQF,IACZ,qEACA;IACEG,UAAU;QACRC,MAAM;YACJC,SAAS;YACTC,IAAI;QACN;IACF;IACAC,iBAAiB;QACfH,MAAM;IACR;AACF;AAGF,MAAMI,2BACJ;AAKF,MAAMV,yBAEFD,WACF,CACE,EACEY,SAAS,EACTC,QAAQ,CAAC,EACTC,MAAM,GAAG,EACTP,IAAI,EACJ,cAAcQ,SAAS,EACvB,GAAGC,OACJ,EACDC;IAEA,MAAMC,YAAYL,SAAS;IAC3B,MAAMM,UAAUL,MAAM,IAAIA,MAAM;IAChC,MAAMM,eAAeC,KAAKP,GAAG,CAAC,GAAGO,KAAKC,GAAG,CAACJ,WAAWC;IACrD,MAAMI,aAAa,AAACH,eAAe,MAAOD;IAC1C,MAAMK,iBAAiB;QAAEC,OAAO,GAAGF,WAAW,CAAC,CAAC;IAAC;IACjD,MAAMG,mBAAmB,CAAC,UAAU,EAAEL,KAAKM,KAAK,CAACJ,YAAY,CAAC,CAAC;IAE/D,qBACE,KAACrB,kBAAkB0B,IAAI;QACrBX,KAAKA;QACLY,aAAU;QACVjB,WAAWR,GAAG,gBAAgBQ;QAC9BC,OAAOO;QACPN,KAAKK;QACLW,cAAYf,aAAaW;QACxB,GAAGV,KAAK;kBAET,cAAA,KAACd,kBAAkB6B,KAAK;YACtBF,aAAU;YACVjB,WAAWR,GAAGC,sBAAsB;gBAAEE;YAAK;sBAE3C,cAAA,KAACL,kBAAkB8B,SAAS;gBAC1BH,aAAU;gBACVjB,WAAWD;gBACXsB,OAAOT;;;;AAKjB;AAGFvB,SAASiC,WAAW,GAAG;AAEvB,SAASjC,QAAQ,EAAEU,wBAAwB,EAAEN,qBAAqB,GAAG"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, forwardRef, useCallback, useContext, useMemo, useState } from "react";
|
|
3
3
|
import { IconInfoCircle, IconLoader2, IconPlus, IconSend, IconSquare, IconX } from "@tabler/icons-react";
|
|
4
|
-
import { cn } from "../../../../lib/utils
|
|
5
|
-
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "../command/command
|
|
6
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../dropdown-menu/dropdown-menu
|
|
7
|
-
import { HelperText } from "../helper-text/helper-text
|
|
8
|
-
import { HoverCard, HoverCardContent, HoverCardTrigger } from "../hover-card/hover-card
|
|
9
|
-
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupTextarea } from "../input-group/input-group
|
|
10
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../select/select
|
|
4
|
+
import { cn } from "../../../../lib/utils";
|
|
5
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "../command/command";
|
|
6
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../dropdown-menu/dropdown-menu";
|
|
7
|
+
import { HelperText } from "../helper-text/helper-text";
|
|
8
|
+
import { HoverCard, HoverCardContent, HoverCardTrigger } from "../hover-card/hover-card";
|
|
9
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupTextarea } from "../input-group/input-group";
|
|
10
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../select/select";
|
|
11
11
|
// eslint-disable-next-line @eslint-react/naming-convention/context-name
|
|
12
12
|
const PromptInputController = /*#__PURE__*/ createContext(null);
|
|
13
13
|
const usePromptInputController = ()=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/ui/core/prompt-input/prompt-input.tsx"],"sourcesContent":["import {\n type FC,\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ChangeEvent,\n type ComponentProps,\n type ComponentRef,\n type HTMLAttributes,\n type KeyboardEventHandler,\n type PropsWithChildren,\n type ReactNode,\n type SyntheticEvent,\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react';\n\nimport {\n IconInfoCircle,\n IconLoader2,\n IconPlus,\n IconSend,\n IconSquare,\n IconX,\n} from '@tabler/icons-react';\n\nimport type { ChatStatus } from '../../../../lib/ai/types';\nimport { cn } from '../../../../lib/utils';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n} from '../command/command';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '../dropdown-menu/dropdown-menu';\nimport { HelperText } from '../helper-text/helper-text';\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from '../hover-card/hover-card';\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupTextarea,\n} from '../input-group/input-group';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '../select/select';\n\ntype TextInputContext = {\n value: string;\n setInput: (v: string) => void;\n clear: () => void;\n};\n\ntype PromptInputControllerProps = {\n textInput: TextInputContext;\n};\n\n// eslint-disable-next-line @eslint-react/naming-convention/context-name\nconst PromptInputController = createContext<PromptInputControllerProps | null>(\n null\n);\n\nconst usePromptInputController = (): PromptInputControllerProps => {\n const ctx = useContext(PromptInputController);\n if (!ctx) {\n throw new Error(\n 'Wrap your component inside <PromptInputProvider> to use usePromptInputController().'\n );\n }\n return ctx;\n};\n\nconst useOptionalPromptInputController = () =>\n useContext(PromptInputController);\n\ntype PromptInputProviderProps = PropsWithChildren<{\n initialInput?: string;\n}>;\n\nfunction PromptInputProvider({\n initialInput: initialTextInput = '',\n children,\n}: PromptInputProviderProps): ReactNode {\n const [textInput, setTextInput] = useState(initialTextInput);\n const clearInput = useCallback(() => setTextInput(''), []);\n\n const controller = useMemo<PromptInputControllerProps>(\n () => ({\n textInput: {\n value: textInput,\n setInput: setTextInput,\n clear: clearInput,\n },\n }),\n [textInput, clearInput]\n );\n\n return (\n <PromptInputController.Provider value={controller}>\n {children}\n </PromptInputController.Provider>\n );\n}\n\ntype PromptInputMessage = {\n text?: string;\n};\n\ntype PromptInputProps = Omit<HTMLAttributes<HTMLFormElement>, 'onSubmit'> & {\n onSubmit: (\n message: PromptInputMessage,\n event: SyntheticEvent<HTMLFormElement>\n ) => void | Promise<void>;\n helperText?: ReactNode | false;\n errorMessage?: string;\n};\n\nconst PromptInput: FC<PromptInputProps> = ({\n className,\n onSubmit,\n helperText,\n errorMessage,\n children,\n ...props\n}) => {\n const controller = useOptionalPromptInputController();\n const [submissionError, setSubmissionError] = useState<string | null>(null);\n\n const handleSubmit = (event: SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n\n const form = event.currentTarget;\n const text = controller\n ? controller.textInput.value\n : (() => {\n const formData = new FormData(form);\n const entry = formData.get('message');\n return typeof entry === 'string' ? entry : '';\n })();\n\n if (!controller) {\n form.reset();\n }\n\n try {\n const result = onSubmit({ text }, event);\n\n if (result instanceof Promise) {\n result\n .then(() => {\n setSubmissionError(null);\n controller?.textInput.clear();\n })\n .catch((error) => {\n console.error('PromptInput: Submission error:', error);\n setSubmissionError(\n error instanceof Error\n ? error.message\n : 'Failed to submit. Please try again.'\n );\n });\n } else {\n setSubmissionError(null);\n controller?.textInput.clear();\n }\n } catch (error) {\n console.error('PromptInput: Submission error:', error);\n setSubmissionError(\n error instanceof Error\n ? error.message\n : 'Failed to submit. Please try again.'\n );\n }\n };\n\n const defaultHelperText = (\n <HelperText size=\"xs\" icon={<IconInfoCircle />}>\n AI doesn't always get it right. Be sure to check results\n </HelperText>\n );\n\n const helperTextToRender =\n helperText === false ? null : (helperText ?? defaultHelperText);\n\n return (\n <div className=\"w-full flex flex-col gap-2\">\n <form\n data-slot=\"prompt-input\"\n className={cn('w-full', className)}\n onSubmit={handleSubmit}\n {...props}\n >\n <InputGroup className=\"shadow-none rounded-xl has-[[data-slot=input-group-control]:is(:read-only,[aria-disabled=true])]:border-transparent has-[[data-slot=input-group-control]:is(:read-only,[aria-disabled=true])]:bg-medium-background has-[[data-slot=input-group-control]:is(:read-only,[aria-disabled=true])]:shadow-none hover:has-[[data-slot=input-group-control]:is(:read-only,[aria-disabled=true])]:border-transparent hover:has-[[data-slot=input-group-control]:is(:read-only,[aria-disabled=true])]:bg-medium-background-hover hover:has-[[data-slot=input-group-control]:is(:read-only,[aria-disabled=true])]:text-muted-foreground\">\n {children}\n </InputGroup>\n </form>\n {errorMessage || submissionError ? (\n <HelperText size=\"xs\" isError>\n {errorMessage || submissionError}\n </HelperText>\n ) : (\n helperTextToRender\n )}\n </div>\n );\n};\nPromptInput.displayName = 'PromptInput';\n\ntype PromptInputBodyProps = HTMLAttributes<HTMLDivElement>;\n\nconst PromptInputBody: ForwardRefExoticComponent<\n PromptInputBodyProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, PromptInputBodyProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"prompt-input-body\"\n className={cn('contents', className)}\n {...props}\n />\n )\n);\nPromptInputBody.displayName = 'PromptInputBody';\n\ntype PromptInputTextareaProps = ComponentProps<typeof InputGroupTextarea>;\n\nconst PromptInputTextarea: ForwardRefExoticComponent<\n Omit<PromptInputTextareaProps, 'ref'> & RefAttributes<HTMLTextAreaElement>\n> = forwardRef<\n ComponentRef<typeof InputGroupTextarea>,\n PromptInputTextareaProps\n>(\n (\n { onChange, className, placeholder = 'Type your message...', ...props },\n ref\n ) => {\n const controller = useOptionalPromptInputController();\n const [isComposing, setIsComposing] = useState(false);\n\n const handleKeyDown: KeyboardEventHandler<HTMLTextAreaElement> = (e) => {\n if (e.key === 'Enter') {\n if (isComposing || e.nativeEvent.isComposing) {\n return;\n }\n if (e.shiftKey) {\n return;\n }\n e.preventDefault();\n e.currentTarget.form?.requestSubmit();\n }\n };\n\n const controlledProps = controller\n ? {\n value: controller.textInput.value,\n onChange: (e: ChangeEvent<HTMLTextAreaElement>) => {\n controller.textInput.setInput(e.currentTarget.value);\n onChange?.(e);\n },\n }\n : {\n onChange,\n };\n\n return (\n <InputGroupTextarea\n ref={ref}\n className={cn(\n 'field-sizing-content max-h-48 min-h-18 rounded-t-xl md:text-base tracking-tightest p-2.75 leading-5',\n className\n )}\n name=\"message\"\n onCompositionEnd={() => setIsComposing(false)}\n onCompositionStart={() => setIsComposing(true)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n {...props}\n {...controlledProps}\n />\n );\n }\n);\nPromptInputTextarea.displayName = 'PromptInputTextarea';\n\ntype PromptInputHeaderProps = Omit<\n ComponentProps<typeof InputGroupAddon>,\n 'align'\n>;\n\nconst PromptInputHeader: ForwardRefExoticComponent<\n Omit<PromptInputHeaderProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<typeof InputGroupAddon>, PromptInputHeaderProps>(\n ({ className, ...props }, ref) => (\n <InputGroupAddon\n ref={ref}\n align=\"block-end\"\n className={cn('order-first flex-wrap gap-1', className)}\n {...props}\n />\n )\n);\nPromptInputHeader.displayName = 'PromptInputHeader';\n\ntype PromptInputFooterProps = Omit<\n ComponentProps<typeof InputGroupAddon>,\n 'align'\n>;\n\nconst PromptInputFooter: ForwardRefExoticComponent<\n Omit<PromptInputFooterProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<typeof InputGroupAddon>, PromptInputFooterProps>(\n ({ className, ...props }, ref) => (\n <InputGroupAddon\n ref={ref}\n align=\"block-end\"\n className={cn('justify-between gap-1 p-2.75', className)}\n {...props}\n />\n )\n);\nPromptInputFooter.displayName = 'PromptInputFooter';\n\ntype PromptInputToolsProps = HTMLAttributes<HTMLDivElement>;\n\nconst PromptInputTools: ForwardRefExoticComponent<\n PromptInputToolsProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, PromptInputToolsProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"prompt-input-tools\"\n className={cn('flex items-center gap-2', className)}\n {...props}\n />\n )\n);\nPromptInputTools.displayName = 'PromptInputTools';\n\ntype PromptInputButtonProps = ComponentProps<typeof InputGroupButton>;\n\nconst PromptInputButton: ForwardRefExoticComponent<\n Omit<PromptInputButtonProps, 'ref'> & RefAttributes<HTMLElement>\n> = forwardRef<ComponentRef<typeof InputGroupButton>, PromptInputButtonProps>(\n ({ variant = 'ghost', className, size, ...props }, ref) => {\n const childCount =\n props.children === undefined || props.children === null\n ? 0\n : Array.isArray(props.children)\n ? props.children.length\n : 1;\n const newSize = size ?? (childCount > 1 ? 'sm' : 'icon-sm');\n\n return (\n <InputGroupButton\n ref={ref}\n className={cn(className)}\n size={newSize}\n type=\"button\"\n variant={variant}\n {...props}\n />\n );\n }\n);\nPromptInputButton.displayName = 'PromptInputButton';\n\ntype PromptInputActionMenuProps = ComponentProps<typeof DropdownMenu>;\nconst PromptInputActionMenu: FC<PromptInputActionMenuProps> = (props) => (\n <DropdownMenu {...props} />\n);\nPromptInputActionMenu.displayName = 'PromptInputActionMenu';\n\ntype PromptInputActionMenuTriggerProps = PromptInputButtonProps;\n\nconst PromptInputActionMenuTrigger: FC<PromptInputActionMenuTriggerProps> = ({\n className,\n children,\n ...props\n}) => (\n <DropdownMenuTrigger\n render={\n <PromptInputButton className={className} {...props}>\n {children ?? <IconPlus className=\"size-4\" />}\n </PromptInputButton>\n }\n />\n);\nPromptInputActionMenuTrigger.displayName = 'PromptInputActionMenuTrigger';\n\ntype PromptInputActionMenuContentProps = ComponentProps<\n typeof DropdownMenuContent\n>;\nconst PromptInputActionMenuContent: FC<PromptInputActionMenuContentProps> = ({\n className,\n ...props\n}) => (\n <DropdownMenuContent align=\"start\" className={cn(className)} {...props} />\n);\nPromptInputActionMenuContent.displayName = 'PromptInputActionMenuContent';\n\ntype PromptInputActionMenuItemProps = ComponentProps<typeof DropdownMenuItem>;\nconst PromptInputActionMenuItem: FC<PromptInputActionMenuItemProps> = ({\n className,\n ...props\n}) => <DropdownMenuItem className={cn(className)} {...props} />;\nPromptInputActionMenuItem.displayName = 'PromptInputActionMenuItem';\n\ntype PromptInputSubmitProps = ComponentProps<typeof InputGroupButton> & {\n status?: ChatStatus;\n};\n\nconst PromptInputSubmit: ForwardRefExoticComponent<\n Omit<PromptInputSubmitProps, 'ref'> & RefAttributes<HTMLElement>\n> = forwardRef<ComponentRef<typeof InputGroupButton>, PromptInputSubmitProps>(\n (\n {\n className,\n variant = 'default',\n size = 'icon-sm',\n status,\n children,\n ...props\n },\n ref\n ) => {\n let Icon = <IconSend className=\"size-4\" />;\n\n if (status === 'submitted') {\n Icon = <IconLoader2 className=\"size-4 animate-spin\" />;\n } else if (status === 'streaming') {\n Icon = <IconSquare className=\"size-4\" />;\n } else if (status === 'error') {\n Icon = <IconX className=\"size-4\" />;\n }\n\n return (\n <InputGroupButton\n ref={ref}\n aria-label=\"Submit\"\n className={cn(className)}\n data-status={status}\n size={size}\n type=\"submit\"\n variant={variant}\n {...props}\n >\n {children ?? Icon}\n </InputGroupButton>\n );\n }\n);\nPromptInputSubmit.displayName = 'PromptInputSubmit';\n\ntype PromptInputModelSelectProps = ComponentProps<typeof Select>;\n\nconst PromptInputModelSelect: FC<PromptInputModelSelectProps> = (props) => (\n <Select {...props} />\n);\nPromptInputModelSelect.displayName = 'PromptInputModelSelect';\n\ntype PromptInputModelSelectTriggerProps = ComponentProps<typeof SelectTrigger>;\n\nconst PromptInputModelSelectTrigger: FC<PromptInputModelSelectTriggerProps> = ({\n className,\n ...props\n}) => (\n <SelectTrigger\n className={cn(\n 'border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors',\n 'hover:bg-base-background-hover hover:text-base-foreground aria-expanded:bg-base-background-hover aria-expanded:text-base-foreground',\n className\n )}\n {...props}\n />\n);\nPromptInputModelSelectTrigger.displayName = 'PromptInputModelSelectTrigger';\n\ntype PromptInputModelSelectContentProps = ComponentProps<typeof SelectContent>;\n\nconst PromptInputModelSelectContent: FC<PromptInputModelSelectContentProps> = ({\n className,\n ...props\n}) => <SelectContent className={cn(className)} {...props} />;\nPromptInputModelSelectContent.displayName = 'PromptInputModelSelectContent';\n\ntype PromptInputModelSelectItemProps = ComponentProps<typeof SelectItem>;\n\nconst PromptInputModelSelectItem: FC<PromptInputModelSelectItemProps> = ({\n className,\n ...props\n}) => <SelectItem className={cn(className)} {...props} />;\nPromptInputModelSelectItem.displayName = 'PromptInputModelSelectItem';\n\ntype PromptInputModelSelectValueProps = ComponentProps<typeof SelectValue>;\n\nconst PromptInputModelSelectValue: FC<PromptInputModelSelectValueProps> = ({\n className,\n ...props\n}) => <SelectValue className={cn(className)} {...props} />;\nPromptInputModelSelectValue.displayName = 'PromptInputModelSelectValue';\n\ntype PromptInputHoverCardProps = ComponentProps<typeof HoverCard>;\n\nconst PromptInputHoverCard: FC<PromptInputHoverCardProps> = ({\n openDelay = 0,\n closeDelay = 0,\n ...props\n}) => <HoverCard closeDelay={closeDelay} openDelay={openDelay} {...props} />;\nPromptInputHoverCard.displayName = 'PromptInputHoverCard';\n\ntype PromptInputHoverCardTriggerProps = ComponentProps<typeof HoverCardTrigger>;\n\nconst PromptInputHoverCardTrigger: FC<PromptInputHoverCardTriggerProps> = (\n props\n) => <HoverCardTrigger {...props} />;\nPromptInputHoverCardTrigger.displayName = 'PromptInputHoverCardTrigger';\n\ntype PromptInputHoverCardContentProps = ComponentProps<typeof HoverCardContent>;\n\nconst PromptInputHoverCardContent: FC<PromptInputHoverCardContentProps> = ({\n align = 'start',\n ...props\n}) => <HoverCardContent align={align} {...props} />;\nPromptInputHoverCardContent.displayName = 'PromptInputHoverCardContent';\n\ntype PromptInputTabsListProps = HTMLAttributes<HTMLDivElement>;\n\nconst PromptInputTabsList: ForwardRefExoticComponent<\n PromptInputTabsListProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, PromptInputTabsListProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"prompt-input-tabs-list\"\n className={cn(className)}\n {...props}\n />\n )\n);\nPromptInputTabsList.displayName = 'PromptInputTabsList';\n\ntype PromptInputTabProps = HTMLAttributes<HTMLDivElement>;\n\nconst PromptInputTab: ForwardRefExoticComponent<\n PromptInputTabProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, PromptInputTabProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"prompt-input-tab\"\n className={cn(className)}\n {...props}\n />\n )\n);\nPromptInputTab.displayName = 'PromptInputTab';\n\ntype PromptInputTabLabelProps = HTMLAttributes<HTMLHeadingElement>;\n\nconst PromptInputTabLabel: ForwardRefExoticComponent<\n PromptInputTabLabelProps & RefAttributes<HTMLHeadingElement>\n> = forwardRef<ComponentRef<'h3'>, PromptInputTabLabelProps>(\n ({ className, children, ...props }, ref) => (\n <h3\n ref={ref}\n data-slot=\"prompt-input-tab-label\"\n className={cn(\n 'mb-2 px-3 font-medium text-muted-foreground text-xs',\n className\n )}\n {...props}\n >\n {children}\n </h3>\n )\n);\nPromptInputTabLabel.displayName = 'PromptInputTabLabel';\n\ntype PromptInputTabBodyProps = HTMLAttributes<HTMLDivElement>;\n\nconst PromptInputTabBody: ForwardRefExoticComponent<\n PromptInputTabBodyProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, PromptInputTabBodyProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"prompt-input-tab-body\"\n className={cn('space-y-1', className)}\n {...props}\n />\n )\n);\nPromptInputTabBody.displayName = 'PromptInputTabBody';\n\ntype PromptInputTabItemProps = HTMLAttributes<HTMLDivElement>;\n\nconst PromptInputTabItem: ForwardRefExoticComponent<\n PromptInputTabItemProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, PromptInputTabItemProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"prompt-input-tab-item\"\n className={cn(\n 'flex items-center gap-2 px-3 py-2 text-xs hover:bg-base-background-hover',\n className\n )}\n {...props}\n />\n )\n);\nPromptInputTabItem.displayName = 'PromptInputTabItem';\n\ntype PromptInputCommandProps = ComponentProps<typeof Command>;\n\nconst PromptInputCommand: FC<PromptInputCommandProps> = ({\n className,\n ...props\n}) => <Command className={cn(className)} {...props} />;\nPromptInputCommand.displayName = 'PromptInputCommand';\n\ntype PromptInputCommandInputProps = ComponentProps<typeof CommandInput>;\n\nconst PromptInputCommandInput: FC<PromptInputCommandInputProps> = ({\n className,\n ...props\n}) => <CommandInput className={cn(className)} {...props} />;\nPromptInputCommandInput.displayName = 'PromptInputCommandInput';\n\ntype PromptInputCommandListProps = ComponentProps<typeof CommandList>;\n\nconst PromptInputCommandList: FC<PromptInputCommandListProps> = ({\n className,\n ...props\n}) => <CommandList className={cn(className)} {...props} />;\nPromptInputCommandList.displayName = 'PromptInputCommandList';\n\ntype PromptInputCommandEmptyProps = ComponentProps<typeof CommandEmpty>;\n\nconst PromptInputCommandEmpty: FC<PromptInputCommandEmptyProps> = ({\n className,\n ...props\n}) => <CommandEmpty className={cn(className)} {...props} />;\nPromptInputCommandEmpty.displayName = 'PromptInputCommandEmpty';\n\ntype PromptInputCommandGroupProps = ComponentProps<typeof CommandGroup>;\n\nconst PromptInputCommandGroup: FC<PromptInputCommandGroupProps> = ({\n className,\n ...props\n}) => <CommandGroup className={cn(className)} {...props} />;\nPromptInputCommandGroup.displayName = 'PromptInputCommandGroup';\n\ntype PromptInputCommandItemProps = ComponentProps<typeof CommandItem>;\n\nconst PromptInputCommandItem: FC<PromptInputCommandItemProps> = ({\n className,\n ...props\n}) => <CommandItem className={cn(className)} {...props} />;\nPromptInputCommandItem.displayName = 'PromptInputCommandItem';\n\ntype PromptInputCommandSeparatorProps = ComponentProps<typeof CommandSeparator>;\n\nconst PromptInputCommandSeparator: FC<PromptInputCommandSeparatorProps> = ({\n className,\n ...props\n}) => <CommandSeparator className={cn(className)} {...props} />;\nPromptInputCommandSeparator.displayName = 'PromptInputCommandSeparator';\n\nexport {\n usePromptInputController,\n PromptInputProvider,\n PromptInput,\n PromptInputBody,\n PromptInputTextarea,\n PromptInputHeader,\n PromptInputFooter,\n PromptInputTools,\n PromptInputButton,\n PromptInputActionMenu,\n PromptInputActionMenuTrigger,\n PromptInputActionMenuContent,\n PromptInputActionMenuItem,\n PromptInputSubmit,\n PromptInputModelSelect,\n PromptInputModelSelectTrigger,\n PromptInputModelSelectContent,\n PromptInputModelSelectItem,\n PromptInputModelSelectValue,\n PromptInputHoverCard,\n PromptInputHoverCardTrigger,\n PromptInputHoverCardContent,\n PromptInputTabsList,\n PromptInputTab,\n PromptInputTabLabel,\n PromptInputTabBody,\n PromptInputTabItem,\n PromptInputCommand,\n PromptInputCommandInput,\n PromptInputCommandList,\n PromptInputCommandEmpty,\n PromptInputCommandGroup,\n PromptInputCommandItem,\n PromptInputCommandSeparator,\n};\n"],"names":["createContext","forwardRef","useCallback","useContext","useMemo","useState","IconInfoCircle","IconLoader2","IconPlus","IconSend","IconSquare","IconX","cn","Command","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","CommandSeparator","DropdownMenu","DropdownMenuContent","DropdownMenuItem","DropdownMenuTrigger","HelperText","HoverCard","HoverCardContent","HoverCardTrigger","InputGroup","InputGroupAddon","InputGroupButton","InputGroupTextarea","Select","SelectContent","SelectItem","SelectTrigger","SelectValue","PromptInputController","usePromptInputController","ctx","Error","useOptionalPromptInputController","PromptInputProvider","initialInput","initialTextInput","children","textInput","setTextInput","clearInput","controller","value","setInput","clear","Provider","PromptInput","className","onSubmit","helperText","errorMessage","props","submissionError","setSubmissionError","handleSubmit","event","preventDefault","form","currentTarget","text","formData","FormData","entry","get","reset","result","Promise","then","catch","error","console","message","defaultHelperText","size","icon","helperTextToRender","div","data-slot","isError","displayName","PromptInputBody","ref","PromptInputTextarea","onChange","placeholder","isComposing","setIsComposing","handleKeyDown","e","key","nativeEvent","shiftKey","requestSubmit","controlledProps","name","onCompositionEnd","onCompositionStart","onKeyDown","PromptInputHeader","align","PromptInputFooter","PromptInputTools","PromptInputButton","variant","childCount","undefined","Array","isArray","length","newSize","type","PromptInputActionMenu","PromptInputActionMenuTrigger","render","PromptInputActionMenuContent","PromptInputActionMenuItem","PromptInputSubmit","status","Icon","aria-label","data-status","PromptInputModelSelect","PromptInputModelSelectTrigger","PromptInputModelSelectContent","PromptInputModelSelectItem","PromptInputModelSelectValue","PromptInputHoverCard","openDelay","closeDelay","PromptInputHoverCardTrigger","PromptInputHoverCardContent","PromptInputTabsList","PromptInputTab","PromptInputTabLabel","h3","PromptInputTabBody","PromptInputTabItem","PromptInputCommand","PromptInputCommandInput","PromptInputCommandList","PromptInputCommandEmpty","PromptInputCommandGroup","PromptInputCommandItem","PromptInputCommandSeparator"],"mappings":";AAAA,SAYEA,aAAa,EACbC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,QAAQ,QACH,QAAQ;AAEf,SACEC,cAAc,EACdC,WAAW,EACXC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,KAAK,QACA,sBAAsB;AAG7B,SAASC,EAAE,QAAQ,2BAAwB;AAC3C,SACEC,OAAO,EACPC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,WAAW,EACXC,WAAW,EACXC,gBAAgB,QACX,wBAAqB;AAC5B,SACEC,YAAY,EACZC,mBAAmB,EACnBC,gBAAgB,EAChBC,mBAAmB,QACd,oCAAiC;AACxC,SAASC,UAAU,QAAQ,gCAA6B;AACxD,SACEC,SAAS,EACTC,gBAAgB,EAChBC,gBAAgB,QACX,8BAA2B;AAClC,SACEC,UAAU,EACVC,eAAe,EACfC,gBAAgB,EAChBC,kBAAkB,QACb,gCAA6B;AACpC,SACEC,MAAM,EACNC,aAAa,EACbC,UAAU,EACVC,aAAa,EACbC,WAAW,QACN,sBAAmB;AAY1B,wEAAwE;AACxE,MAAMC,sCAAwBrC,cAC5B;AAGF,MAAMsC,2BAA2B;IAC/B,MAAMC,MAAMpC,WAAWkC;IACvB,IAAI,CAACE,KAAK;QACR,MAAM,IAAIC,MACR;IAEJ;IACA,OAAOD;AACT;AAEA,MAAME,mCAAmC,IACvCtC,WAAWkC;AAMb,SAASK,oBAAoB,EAC3BC,cAAcC,mBAAmB,EAAE,EACnCC,QAAQ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BAAyB,EACzBC,iBAAiB,EACjBK,sBAAsB,EACtBC,6BAA6B,EAC7BC,6BAA6B,EAC7BC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,oBAAoB,EACpBG,2BAA2B,EAC3BC,2BAA2B,EAC3BC,mBAAmB,EACnBC,cAAc,EACdC,mBAAmB,EACnBE,kBAAkB,EAClBC,kBAAkB,EAClBC,kBAAkB,EAClBC,uBAAuB,EACvBC,sBAAsB,EACtBC,uBAAuB,EACvBC,uBAAuB,EACvBC,sBAAsB,EACtBC,2BAA2B,GAC3B"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/prompt-input/prompt-input.tsx"],"sourcesContent":["import {\n type FC,\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ChangeEvent,\n type ComponentProps,\n type ComponentRef,\n type HTMLAttributes,\n type KeyboardEventHandler,\n type PropsWithChildren,\n type ReactNode,\n type SyntheticEvent,\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react';\n\nimport {\n IconInfoCircle,\n IconLoader2,\n IconPlus,\n IconSend,\n IconSquare,\n IconX,\n} from '@tabler/icons-react';\n\nimport type { ChatStatus } from '../../../../lib/ai/types';\nimport { cn } from '../../../../lib/utils';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n} from '../command/command';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '../dropdown-menu/dropdown-menu';\nimport { HelperText } from '../helper-text/helper-text';\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from '../hover-card/hover-card';\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupTextarea,\n} from '../input-group/input-group';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '../select/select';\n\ntype TextInputContext = {\n value: string;\n setInput: (v: string) => void;\n clear: () => void;\n};\n\ntype PromptInputControllerProps = {\n textInput: TextInputContext;\n};\n\n// eslint-disable-next-line @eslint-react/naming-convention/context-name\nconst PromptInputController = createContext<PromptInputControllerProps | null>(\n null\n);\n\nconst usePromptInputController = (): PromptInputControllerProps => {\n const ctx = useContext(PromptInputController);\n if (!ctx) {\n throw new Error(\n 'Wrap your component inside <PromptInputProvider> to use usePromptInputController().'\n );\n }\n return ctx;\n};\n\nconst useOptionalPromptInputController = () =>\n useContext(PromptInputController);\n\ntype PromptInputProviderProps = PropsWithChildren<{\n initialInput?: string;\n}>;\n\nfunction PromptInputProvider({\n initialInput: initialTextInput = '',\n children,\n}: PromptInputProviderProps): ReactNode {\n const [textInput, setTextInput] = useState(initialTextInput);\n const clearInput = useCallback(() => setTextInput(''), []);\n\n const controller = useMemo<PromptInputControllerProps>(\n () => ({\n textInput: {\n value: textInput,\n setInput: setTextInput,\n clear: clearInput,\n },\n }),\n [textInput, clearInput]\n );\n\n return (\n <PromptInputController.Provider value={controller}>\n {children}\n </PromptInputController.Provider>\n );\n}\n\ntype PromptInputMessage = {\n text?: string;\n};\n\ntype PromptInputProps = Omit<HTMLAttributes<HTMLFormElement>, 'onSubmit'> & {\n onSubmit: (\n message: PromptInputMessage,\n event: SyntheticEvent<HTMLFormElement>\n ) => void | Promise<void>;\n helperText?: ReactNode | false;\n errorMessage?: string;\n};\n\nconst PromptInput: FC<PromptInputProps> = ({\n className,\n onSubmit,\n helperText,\n errorMessage,\n children,\n ...props\n}) => {\n const controller = useOptionalPromptInputController();\n const [submissionError, setSubmissionError] = useState<string | null>(null);\n\n const handleSubmit = (event: SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n\n const form = event.currentTarget;\n const text = controller\n ? controller.textInput.value\n : (() => {\n const formData = new FormData(form);\n const entry = formData.get('message');\n return typeof entry === 'string' ? entry : '';\n })();\n\n if (!controller) {\n form.reset();\n }\n\n try {\n const result = onSubmit({ text }, event);\n\n if (result instanceof Promise) {\n result\n .then(() => {\n setSubmissionError(null);\n controller?.textInput.clear();\n })\n .catch((error) => {\n console.error('PromptInput: Submission error:', error);\n setSubmissionError(\n error instanceof Error\n ? error.message\n : 'Failed to submit. Please try again.'\n );\n });\n } else {\n setSubmissionError(null);\n controller?.textInput.clear();\n }\n } catch (error) {\n console.error('PromptInput: Submission error:', error);\n setSubmissionError(\n error instanceof Error\n ? error.message\n : 'Failed to submit. Please try again.'\n );\n }\n };\n\n const defaultHelperText = (\n <HelperText size=\"xs\" icon={<IconInfoCircle />}>\n AI doesn't always get it right. Be sure to check results\n </HelperText>\n );\n\n const helperTextToRender =\n helperText === false ? null : (helperText ?? defaultHelperText);\n\n return (\n <div className=\"w-full flex flex-col gap-2\">\n <form\n data-slot=\"prompt-input\"\n className={cn('w-full', className)}\n onSubmit={handleSubmit}\n {...props}\n >\n <InputGroup className=\"shadow-none rounded-xl has-[[data-slot=input-group-control]:is(:read-only,[aria-disabled=true])]:border-transparent has-[[data-slot=input-group-control]:is(:read-only,[aria-disabled=true])]:bg-medium-background has-[[data-slot=input-group-control]:is(:read-only,[aria-disabled=true])]:shadow-none hover:has-[[data-slot=input-group-control]:is(:read-only,[aria-disabled=true])]:border-transparent hover:has-[[data-slot=input-group-control]:is(:read-only,[aria-disabled=true])]:bg-medium-background-hover hover:has-[[data-slot=input-group-control]:is(:read-only,[aria-disabled=true])]:text-muted-foreground\">\n {children}\n </InputGroup>\n </form>\n {errorMessage || submissionError ? (\n <HelperText size=\"xs\" isError>\n {errorMessage || submissionError}\n </HelperText>\n ) : (\n helperTextToRender\n )}\n </div>\n );\n};\nPromptInput.displayName = 'PromptInput';\n\ntype PromptInputBodyProps = HTMLAttributes<HTMLDivElement>;\n\nconst PromptInputBody: ForwardRefExoticComponent<\n PromptInputBodyProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, PromptInputBodyProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"prompt-input-body\"\n className={cn('contents', className)}\n {...props}\n />\n )\n);\nPromptInputBody.displayName = 'PromptInputBody';\n\ntype PromptInputTextareaProps = ComponentProps<typeof InputGroupTextarea>;\n\nconst PromptInputTextarea: ForwardRefExoticComponent<\n Omit<PromptInputTextareaProps, 'ref'> & RefAttributes<HTMLTextAreaElement>\n> = forwardRef<\n ComponentRef<typeof InputGroupTextarea>,\n PromptInputTextareaProps\n>(\n (\n { onChange, className, placeholder = 'Type your message...', ...props },\n ref\n ) => {\n const controller = useOptionalPromptInputController();\n const [isComposing, setIsComposing] = useState(false);\n\n const handleKeyDown: KeyboardEventHandler<HTMLTextAreaElement> = (e) => {\n if (e.key === 'Enter') {\n if (isComposing || e.nativeEvent.isComposing) {\n return;\n }\n if (e.shiftKey) {\n return;\n }\n e.preventDefault();\n e.currentTarget.form?.requestSubmit();\n }\n };\n\n const controlledProps = controller\n ? {\n value: controller.textInput.value,\n onChange: (e: ChangeEvent<HTMLTextAreaElement>) => {\n controller.textInput.setInput(e.currentTarget.value);\n onChange?.(e);\n },\n }\n : {\n onChange,\n };\n\n return (\n <InputGroupTextarea\n ref={ref}\n className={cn(\n 'field-sizing-content max-h-48 min-h-18 rounded-t-xl md:text-base tracking-tightest p-2.75 leading-5',\n className\n )}\n name=\"message\"\n onCompositionEnd={() => setIsComposing(false)}\n onCompositionStart={() => setIsComposing(true)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n {...props}\n {...controlledProps}\n />\n );\n }\n);\nPromptInputTextarea.displayName = 'PromptInputTextarea';\n\ntype PromptInputHeaderProps = Omit<\n ComponentProps<typeof InputGroupAddon>,\n 'align'\n>;\n\nconst PromptInputHeader: ForwardRefExoticComponent<\n Omit<PromptInputHeaderProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<typeof InputGroupAddon>, PromptInputHeaderProps>(\n ({ className, ...props }, ref) => (\n <InputGroupAddon\n ref={ref}\n align=\"block-end\"\n className={cn('order-first flex-wrap gap-1', className)}\n {...props}\n />\n )\n);\nPromptInputHeader.displayName = 'PromptInputHeader';\n\ntype PromptInputFooterProps = Omit<\n ComponentProps<typeof InputGroupAddon>,\n 'align'\n>;\n\nconst PromptInputFooter: ForwardRefExoticComponent<\n Omit<PromptInputFooterProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<typeof InputGroupAddon>, PromptInputFooterProps>(\n ({ className, ...props }, ref) => (\n <InputGroupAddon\n ref={ref}\n align=\"block-end\"\n className={cn('justify-between gap-1 p-2.75', className)}\n {...props}\n />\n )\n);\nPromptInputFooter.displayName = 'PromptInputFooter';\n\ntype PromptInputToolsProps = HTMLAttributes<HTMLDivElement>;\n\nconst PromptInputTools: ForwardRefExoticComponent<\n PromptInputToolsProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, PromptInputToolsProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"prompt-input-tools\"\n className={cn('flex items-center gap-2', className)}\n {...props}\n />\n )\n);\nPromptInputTools.displayName = 'PromptInputTools';\n\ntype PromptInputButtonProps = ComponentProps<typeof InputGroupButton>;\n\nconst PromptInputButton: ForwardRefExoticComponent<\n Omit<PromptInputButtonProps, 'ref'> & RefAttributes<HTMLElement>\n> = forwardRef<ComponentRef<typeof InputGroupButton>, PromptInputButtonProps>(\n ({ variant = 'ghost', className, size, ...props }, ref) => {\n const childCount =\n props.children === undefined || props.children === null\n ? 0\n : Array.isArray(props.children)\n ? props.children.length\n : 1;\n const newSize = size ?? (childCount > 1 ? 'sm' : 'icon-sm');\n\n return (\n <InputGroupButton\n ref={ref}\n className={cn(className)}\n size={newSize}\n type=\"button\"\n variant={variant}\n {...props}\n />\n );\n }\n);\nPromptInputButton.displayName = 'PromptInputButton';\n\ntype PromptInputActionMenuProps = ComponentProps<typeof DropdownMenu>;\nconst PromptInputActionMenu: FC<PromptInputActionMenuProps> = (props) => (\n <DropdownMenu {...props} />\n);\nPromptInputActionMenu.displayName = 'PromptInputActionMenu';\n\ntype PromptInputActionMenuTriggerProps = PromptInputButtonProps;\n\nconst PromptInputActionMenuTrigger: FC<PromptInputActionMenuTriggerProps> = ({\n className,\n children,\n ...props\n}) => (\n <DropdownMenuTrigger\n render={\n <PromptInputButton className={className} {...props}>\n {children ?? <IconPlus className=\"size-4\" />}\n </PromptInputButton>\n }\n />\n);\nPromptInputActionMenuTrigger.displayName = 'PromptInputActionMenuTrigger';\n\ntype PromptInputActionMenuContentProps = ComponentProps<\n typeof DropdownMenuContent\n>;\nconst PromptInputActionMenuContent: FC<PromptInputActionMenuContentProps> = ({\n className,\n ...props\n}) => (\n <DropdownMenuContent align=\"start\" className={cn(className)} {...props} />\n);\nPromptInputActionMenuContent.displayName = 'PromptInputActionMenuContent';\n\ntype PromptInputActionMenuItemProps = ComponentProps<typeof DropdownMenuItem>;\nconst PromptInputActionMenuItem: FC<PromptInputActionMenuItemProps> = ({\n className,\n ...props\n}) => <DropdownMenuItem className={cn(className)} {...props} />;\nPromptInputActionMenuItem.displayName = 'PromptInputActionMenuItem';\n\ntype PromptInputSubmitProps = ComponentProps<typeof InputGroupButton> & {\n status?: ChatStatus;\n};\n\nconst PromptInputSubmit: ForwardRefExoticComponent<\n Omit<PromptInputSubmitProps, 'ref'> & RefAttributes<HTMLElement>\n> = forwardRef<ComponentRef<typeof InputGroupButton>, PromptInputSubmitProps>(\n (\n {\n className,\n variant = 'default',\n size = 'icon-sm',\n status,\n children,\n ...props\n },\n ref\n ) => {\n let Icon = <IconSend className=\"size-4\" />;\n\n if (status === 'submitted') {\n Icon = <IconLoader2 className=\"size-4 animate-spin\" />;\n } else if (status === 'streaming') {\n Icon = <IconSquare className=\"size-4\" />;\n } else if (status === 'error') {\n Icon = <IconX className=\"size-4\" />;\n }\n\n return (\n <InputGroupButton\n ref={ref}\n aria-label=\"Submit\"\n className={cn(className)}\n data-status={status}\n size={size}\n type=\"submit\"\n variant={variant}\n {...props}\n >\n {children ?? Icon}\n </InputGroupButton>\n );\n }\n);\nPromptInputSubmit.displayName = 'PromptInputSubmit';\n\ntype PromptInputModelSelectProps = ComponentProps<typeof Select>;\n\nconst PromptInputModelSelect: FC<PromptInputModelSelectProps> = (props) => (\n <Select {...props} />\n);\nPromptInputModelSelect.displayName = 'PromptInputModelSelect';\n\ntype PromptInputModelSelectTriggerProps = ComponentProps<typeof SelectTrigger>;\n\nconst PromptInputModelSelectTrigger: FC<PromptInputModelSelectTriggerProps> = ({\n className,\n ...props\n}) => (\n <SelectTrigger\n className={cn(\n 'border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors',\n 'hover:bg-base-background-hover hover:text-base-foreground aria-expanded:bg-base-background-hover aria-expanded:text-base-foreground',\n className\n )}\n {...props}\n />\n);\nPromptInputModelSelectTrigger.displayName = 'PromptInputModelSelectTrigger';\n\ntype PromptInputModelSelectContentProps = ComponentProps<typeof SelectContent>;\n\nconst PromptInputModelSelectContent: FC<PromptInputModelSelectContentProps> = ({\n className,\n ...props\n}) => <SelectContent className={cn(className)} {...props} />;\nPromptInputModelSelectContent.displayName = 'PromptInputModelSelectContent';\n\ntype PromptInputModelSelectItemProps = ComponentProps<typeof SelectItem>;\n\nconst PromptInputModelSelectItem: FC<PromptInputModelSelectItemProps> = ({\n className,\n ...props\n}) => <SelectItem className={cn(className)} {...props} />;\nPromptInputModelSelectItem.displayName = 'PromptInputModelSelectItem';\n\ntype PromptInputModelSelectValueProps = ComponentProps<typeof SelectValue>;\n\nconst PromptInputModelSelectValue: FC<PromptInputModelSelectValueProps> = ({\n className,\n ...props\n}) => <SelectValue className={cn(className)} {...props} />;\nPromptInputModelSelectValue.displayName = 'PromptInputModelSelectValue';\n\ntype PromptInputHoverCardProps = ComponentProps<typeof HoverCard>;\n\nconst PromptInputHoverCard: FC<PromptInputHoverCardProps> = ({\n openDelay = 0,\n closeDelay = 0,\n ...props\n}) => <HoverCard closeDelay={closeDelay} openDelay={openDelay} {...props} />;\nPromptInputHoverCard.displayName = 'PromptInputHoverCard';\n\ntype PromptInputHoverCardTriggerProps = ComponentProps<typeof HoverCardTrigger>;\n\nconst PromptInputHoverCardTrigger: FC<PromptInputHoverCardTriggerProps> = (\n props\n) => <HoverCardTrigger {...props} />;\nPromptInputHoverCardTrigger.displayName = 'PromptInputHoverCardTrigger';\n\ntype PromptInputHoverCardContentProps = ComponentProps<typeof HoverCardContent>;\n\nconst PromptInputHoverCardContent: FC<PromptInputHoverCardContentProps> = ({\n align = 'start',\n ...props\n}) => <HoverCardContent align={align} {...props} />;\nPromptInputHoverCardContent.displayName = 'PromptInputHoverCardContent';\n\ntype PromptInputTabsListProps = HTMLAttributes<HTMLDivElement>;\n\nconst PromptInputTabsList: ForwardRefExoticComponent<\n PromptInputTabsListProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, PromptInputTabsListProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"prompt-input-tabs-list\"\n className={cn(className)}\n {...props}\n />\n )\n);\nPromptInputTabsList.displayName = 'PromptInputTabsList';\n\ntype PromptInputTabProps = HTMLAttributes<HTMLDivElement>;\n\nconst PromptInputTab: ForwardRefExoticComponent<\n PromptInputTabProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, PromptInputTabProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"prompt-input-tab\"\n className={cn(className)}\n {...props}\n />\n )\n);\nPromptInputTab.displayName = 'PromptInputTab';\n\ntype PromptInputTabLabelProps = HTMLAttributes<HTMLHeadingElement>;\n\nconst PromptInputTabLabel: ForwardRefExoticComponent<\n PromptInputTabLabelProps & RefAttributes<HTMLHeadingElement>\n> = forwardRef<ComponentRef<'h3'>, PromptInputTabLabelProps>(\n ({ className, children, ...props }, ref) => (\n <h3\n ref={ref}\n data-slot=\"prompt-input-tab-label\"\n className={cn(\n 'mb-2 px-3 font-medium text-muted-foreground text-xs',\n className\n )}\n {...props}\n >\n {children}\n </h3>\n )\n);\nPromptInputTabLabel.displayName = 'PromptInputTabLabel';\n\ntype PromptInputTabBodyProps = HTMLAttributes<HTMLDivElement>;\n\nconst PromptInputTabBody: ForwardRefExoticComponent<\n PromptInputTabBodyProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, PromptInputTabBodyProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"prompt-input-tab-body\"\n className={cn('space-y-1', className)}\n {...props}\n />\n )\n);\nPromptInputTabBody.displayName = 'PromptInputTabBody';\n\ntype PromptInputTabItemProps = HTMLAttributes<HTMLDivElement>;\n\nconst PromptInputTabItem: ForwardRefExoticComponent<\n PromptInputTabItemProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, PromptInputTabItemProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"prompt-input-tab-item\"\n className={cn(\n 'flex items-center gap-2 px-3 py-2 text-xs hover:bg-base-background-hover',\n className\n )}\n {...props}\n />\n )\n);\nPromptInputTabItem.displayName = 'PromptInputTabItem';\n\ntype PromptInputCommandProps = ComponentProps<typeof Command>;\n\nconst PromptInputCommand: FC<PromptInputCommandProps> = ({\n className,\n ...props\n}) => <Command className={cn(className)} {...props} />;\nPromptInputCommand.displayName = 'PromptInputCommand';\n\ntype PromptInputCommandInputProps = ComponentProps<typeof CommandInput>;\n\nconst PromptInputCommandInput: FC<PromptInputCommandInputProps> = ({\n className,\n ...props\n}) => <CommandInput className={cn(className)} {...props} />;\nPromptInputCommandInput.displayName = 'PromptInputCommandInput';\n\ntype PromptInputCommandListProps = ComponentProps<typeof CommandList>;\n\nconst PromptInputCommandList: FC<PromptInputCommandListProps> = ({\n className,\n ...props\n}) => <CommandList className={cn(className)} {...props} />;\nPromptInputCommandList.displayName = 'PromptInputCommandList';\n\ntype PromptInputCommandEmptyProps = ComponentProps<typeof CommandEmpty>;\n\nconst PromptInputCommandEmpty: FC<PromptInputCommandEmptyProps> = ({\n className,\n ...props\n}) => <CommandEmpty className={cn(className)} {...props} />;\nPromptInputCommandEmpty.displayName = 'PromptInputCommandEmpty';\n\ntype PromptInputCommandGroupProps = ComponentProps<typeof CommandGroup>;\n\nconst PromptInputCommandGroup: FC<PromptInputCommandGroupProps> = ({\n className,\n ...props\n}) => <CommandGroup className={cn(className)} {...props} />;\nPromptInputCommandGroup.displayName = 'PromptInputCommandGroup';\n\ntype PromptInputCommandItemProps = ComponentProps<typeof CommandItem>;\n\nconst PromptInputCommandItem: FC<PromptInputCommandItemProps> = ({\n className,\n ...props\n}) => <CommandItem className={cn(className)} {...props} />;\nPromptInputCommandItem.displayName = 'PromptInputCommandItem';\n\ntype PromptInputCommandSeparatorProps = ComponentProps<typeof CommandSeparator>;\n\nconst PromptInputCommandSeparator: FC<PromptInputCommandSeparatorProps> = ({\n className,\n ...props\n}) => <CommandSeparator className={cn(className)} {...props} />;\nPromptInputCommandSeparator.displayName = 'PromptInputCommandSeparator';\n\nexport {\n usePromptInputController,\n PromptInputProvider,\n PromptInput,\n PromptInputBody,\n PromptInputTextarea,\n PromptInputHeader,\n PromptInputFooter,\n PromptInputTools,\n PromptInputButton,\n PromptInputActionMenu,\n PromptInputActionMenuTrigger,\n PromptInputActionMenuContent,\n PromptInputActionMenuItem,\n PromptInputSubmit,\n PromptInputModelSelect,\n PromptInputModelSelectTrigger,\n PromptInputModelSelectContent,\n PromptInputModelSelectItem,\n PromptInputModelSelectValue,\n PromptInputHoverCard,\n PromptInputHoverCardTrigger,\n PromptInputHoverCardContent,\n PromptInputTabsList,\n PromptInputTab,\n PromptInputTabLabel,\n PromptInputTabBody,\n PromptInputTabItem,\n PromptInputCommand,\n PromptInputCommandInput,\n PromptInputCommandList,\n PromptInputCommandEmpty,\n PromptInputCommandGroup,\n PromptInputCommandItem,\n PromptInputCommandSeparator,\n};\n"],"names":["createContext","forwardRef","useCallback","useContext","useMemo","useState","IconInfoCircle","IconLoader2","IconPlus","IconSend","IconSquare","IconX","cn","Command","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","CommandSeparator","DropdownMenu","DropdownMenuContent","DropdownMenuItem","DropdownMenuTrigger","HelperText","HoverCard","HoverCardContent","HoverCardTrigger","InputGroup","InputGroupAddon","InputGroupButton","InputGroupTextarea","Select","SelectContent","SelectItem","SelectTrigger","SelectValue","PromptInputController","usePromptInputController","ctx","Error","useOptionalPromptInputController","PromptInputProvider","initialInput","initialTextInput","children","textInput","setTextInput","clearInput","controller","value","setInput","clear","Provider","PromptInput","className","onSubmit","helperText","errorMessage","props","submissionError","setSubmissionError","handleSubmit","event","preventDefault","form","currentTarget","text","formData","FormData","entry","get","reset","result","Promise","then","catch","error","console","message","defaultHelperText","size","icon","helperTextToRender","div","data-slot","isError","displayName","PromptInputBody","ref","PromptInputTextarea","onChange","placeholder","isComposing","setIsComposing","handleKeyDown","e","key","nativeEvent","shiftKey","requestSubmit","controlledProps","name","onCompositionEnd","onCompositionStart","onKeyDown","PromptInputHeader","align","PromptInputFooter","PromptInputTools","PromptInputButton","variant","childCount","undefined","Array","isArray","length","newSize","type","PromptInputActionMenu","PromptInputActionMenuTrigger","render","PromptInputActionMenuContent","PromptInputActionMenuItem","PromptInputSubmit","status","Icon","aria-label","data-status","PromptInputModelSelect","PromptInputModelSelectTrigger","PromptInputModelSelectContent","PromptInputModelSelectItem","PromptInputModelSelectValue","PromptInputHoverCard","openDelay","closeDelay","PromptInputHoverCardTrigger","PromptInputHoverCardContent","PromptInputTabsList","PromptInputTab","PromptInputTabLabel","h3","PromptInputTabBody","PromptInputTabItem","PromptInputCommand","PromptInputCommandInput","PromptInputCommandList","PromptInputCommandEmpty","PromptInputCommandGroup","PromptInputCommandItem","PromptInputCommandSeparator"],"mappings":";AAAA,SAYEA,aAAa,EACbC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,QAAQ,QACH,QAAQ;AAEf,SACEC,cAAc,EACdC,WAAW,EACXC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,KAAK,QACA,sBAAsB;AAG7B,SAASC,EAAE,QAAQ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Aa,GAAGI,KAAK;;AACvDyF,wBAAwB7D,WAAW,GAAG;AAItC,MAAM8D,0BAA4D,CAAC,EACjE9F,SAAS,EACT,GAAGI,OACJ,iBAAK,KAAC5C;QAAawC,WAAW3C,GAAG2C;QAAa,GAAGI,KAAK;;AACvD0F,wBAAwB9D,WAAW,GAAG;AAItC,MAAM+D,yBAA0D,CAAC,EAC/D/F,SAAS,EACT,GAAGI,OACJ,iBAAK,KAAC1C;QAAYsC,WAAW3C,GAAG2C;QAAa,GAAGI,KAAK;;AACtD2F,uBAAuB/D,WAAW,GAAG;AAIrC,MAAMgE,8BAAoE,CAAC,EACzEhG,SAAS,EACT,GAAGI,OACJ,iBAAK,KAACxC;QAAiBoC,WAAW3C,GAAG2C;QAAa,GAAGI,KAAK;;AAC3D4F,4BAA4BhE,WAAW,GAAG;AAE1C,SACEjD,wBAAwB,EACxBI,mBAAmB,EACnBY,WAAW,EACXkC,eAAe,EACfE,mBAAmB,EACnBgB,iBAAiB,EACjBE,iBAAiB,EACjBC,gBAAgB,EAChBC,iBAAiB,EACjBS,qBAAqB,EACrBC,4BAA4B,EAC5BE,4BAA4B,EAC5BC,yBAAyB,EACzBC,iBAAiB,EACjBK,sBAAsB,EACtBC,6BAA6B,EAC7BC,6BAA6B,EAC7BC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,oBAAoB,EACpBG,2BAA2B,EAC3BC,2BAA2B,EAC3BC,mBAAmB,EACnBC,cAAc,EACdC,mBAAmB,EACnBE,kBAAkB,EAClBC,kBAAkB,EAClBC,kBAAkB,EAClBC,uBAAuB,EACvBC,sBAAsB,EACtBC,uBAAuB,EACvBC,uBAAuB,EACvBC,sBAAsB,EACtBC,2BAA2B,GAC3B"}
|
|
@@ -3,7 +3,7 @@ import { createContext, forwardRef, useContext, useId } from "react";
|
|
|
3
3
|
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
4
4
|
import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
|
-
import { cn, focusState, selectionItemBase, selectionItemCard, selectionItemDefault, selectionItemDescription, selectionItemLabel } from "../../../../lib/utils
|
|
6
|
+
import { cn, focusState, selectionItemBase, selectionItemCard, selectionItemDefault, selectionItemDescription, selectionItemLabel } from "../../../../lib/utils";
|
|
7
7
|
const RadioGroup = /*#__PURE__*/ forwardRef(({ className, orientation = 'vertical', ...props }, ref)=>{
|
|
8
8
|
return /*#__PURE__*/ _jsx(RadioGroupPrimitive, {
|
|
9
9
|
ref: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/ui/core/radio-group/radio-group.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentRef,\n type HTMLAttributes,\n createContext,\n forwardRef,\n useContext,\n useId,\n} from 'react';\n\nimport { Radio as RadioPrimitive } from '@base-ui/react/radio';\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport type { ClassProp } from 'class-variance-authority/types';\n\nimport {\n cn,\n focusState,\n selectionItemBase,\n selectionItemCard,\n selectionItemDefault,\n selectionItemDescription,\n selectionItemLabel,\n} from '../../../../lib/utils';\n\ntype Orientation = 'horizontal' | 'vertical';\n\ntype RadioGroupProps = RadioGroupPrimitive.Props & {\n orientation?: Orientation;\n};\n\nconst RadioGroup: ForwardRefExoticComponent<\n Omit<RadioGroupProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<typeof RadioGroupPrimitive>, RadioGroupProps>(\n ({ className, orientation = 'vertical', ...props }, ref) => {\n return (\n <RadioGroupPrimitive\n ref={ref}\n data-slot=\"radio-group\"\n data-orientation={orientation}\n aria-orientation={orientation}\n className={cn(\n orientation === 'horizontal'\n ? 'flex items-center gap-2'\n : 'grid has-[[data-variant=card]]:gap-2',\n className\n )}\n {...props}\n />\n );\n }\n);\nRadioGroup.displayName = 'RadioGroup';\n\nconst RadioGroupItemLabelIdContext = createContext<string | undefined>(\n undefined\n);\n\ninterface RadioGroupItemVariantProps {\n variant?: 'default' | 'card' | null;\n}\n\nconst radioGroupItemVariants: (\n props?: (RadioGroupItemVariantProps & ClassProp) | undefined\n) => string = cva(cn('group/radio-group-item', selectionItemBase), {\n variants: {\n variant: {\n default: selectionItemDefault,\n card: selectionItemCard,\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\ntype RadioGroupItemProps = HTMLAttributes<HTMLLabelElement> &\n VariantProps<typeof radioGroupItemVariants>;\n\nconst RadioGroupItem: ForwardRefExoticComponent<\n Omit<RadioGroupItemProps, 'ref'> & RefAttributes<HTMLLabelElement>\n> = forwardRef<ComponentRef<'label'>, RadioGroupItemProps>(\n ({ className, variant, children, ...props }, ref) => {\n const labelId = useId();\n return (\n <RadioGroupItemLabelIdContext.Provider value={labelId}>\n <label\n ref={ref}\n data-slot=\"radio-group-item\"\n data-variant={variant ?? 'default'}\n className={cn(radioGroupItemVariants({ variant }), className)}\n {...props}\n >\n {children}\n </label>\n </RadioGroupItemLabelIdContext.Provider>\n );\n }\n);\nRadioGroupItem.displayName = 'RadioGroupItem';\n\nconst RadioGroupItemControl: ForwardRefExoticComponent<\n Omit<RadioPrimitive.Root.Props<unknown>, 'ref'> & RefAttributes<HTMLElement>\n> = forwardRef<\n ComponentRef<typeof RadioPrimitive.Root>,\n RadioPrimitive.Root.Props\n>(\n (\n {\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n },\n ref\n ) => {\n const labelId = useContext(RadioGroupItemLabelIdContext);\n return (\n <RadioPrimitive.Root\n ref={ref}\n data-slot=\"radio-group-item-control\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy ?? (ariaLabel ? undefined : labelId)}\n className={cn(\n \"group relative flex size-4 shrink-0 items-center justify-center rounded-full bg-transparent outline-none before:pointer-events-none before:absolute before:inset-0 before:z-0 before:box-border before:rounded-full before:border-[1.5px] before:border-muted-foreground before:bg-transparent before:transition-[background-color,border-color,box-shadow] before:content-['']\",\n 'data-[checked]:not-data-disabled:before:border-primary-background data-[checked]:not-data-disabled:before:bg-transparent',\n 'hover:before:border-muted-foreground-hover group-hover/radio-group-item:before:border-muted-foreground-hover',\n 'data-[checked]:not-data-disabled:hover:before:border-primary-background-hover',\n 'data-[checked]:not-data-disabled:group-hover/radio-group-item:before:border-primary-background-hover',\n 'data-disabled:not-data-checked:before:border-disabled data-disabled:not-data-checked:before:bg-transparent',\n 'data-disabled:not-data-checked:hover:before:border-disabled data-disabled:not-data-checked:group-hover/radio-group-item:before:border-disabled data-disabled:not-data-checked:group-hover/radio-group-item:before:bg-transparent',\n 'data-disabled:data-checked:before:border-base-foreground-disabled data-disabled:data-checked:before:bg-transparent',\n 'data-disabled:data-checked:hover:before:border-base-foreground-disabled data-disabled:data-checked:group-hover/radio-group-item:before:border-base-foreground-disabled',\n focusState,\n className\n )}\n {...props}\n >\n <RadioPrimitive.Indicator\n data-slot=\"radio-group-item-indicator\"\n className=\"relative z-10 flex items-center justify-center size-full\"\n >\n <span className=\"size-2.5 rounded-full group-not-data-[disabled]:bg-primary-background group-not-data-[disabled]:group-hover:bg-primary-background-hover group-data-[disabled]:bg-base-foreground-disabled\" />\n </RadioPrimitive.Indicator>\n </RadioPrimitive.Root>\n );\n }\n);\nRadioGroupItemControl.displayName = 'RadioGroupItemControl';\n\nconst RadioGroupItemLabel: ForwardRefExoticComponent<\n HTMLAttributes<HTMLSpanElement> & RefAttributes<HTMLSpanElement>\n> = forwardRef<ComponentRef<'span'>, HTMLAttributes<HTMLSpanElement>>(\n ({ className, ...props }, ref) => {\n const labelId = useContext(RadioGroupItemLabelIdContext);\n return (\n <span\n ref={ref}\n data-slot=\"radio-group-item-label\"\n className={cn(\n selectionItemLabel,\n 'group-has-[[data-checked]]/radio-group-item:text-base-foreground',\n 'group-has-[[data-disabled]]/radio-group-item:text-base-foreground-disabled',\n className\n )}\n {...props}\n id={labelId}\n />\n );\n }\n);\nRadioGroupItemLabel.displayName = 'RadioGroupItemLabel';\n\nconst RadioGroupItemDescription: ForwardRefExoticComponent<\n HTMLAttributes<HTMLSpanElement> & RefAttributes<HTMLSpanElement>\n> = forwardRef<ComponentRef<'span'>, HTMLAttributes<HTMLSpanElement>>(\n ({ className, ...props }, ref) => {\n return (\n <span\n ref={ref}\n data-slot=\"radio-group-item-description\"\n className={cn(\n selectionItemDescription,\n 'group-has-[[data-disabled]]/radio-group-item:text-base-foreground-disabled',\n className\n )}\n {...props}\n />\n );\n }\n);\nRadioGroupItemDescription.displayName = 'RadioGroupItemDescription';\n\nexport {\n RadioGroup,\n RadioGroupItem,\n RadioGroupItemControl,\n RadioGroupItemDescription,\n RadioGroupItemLabel,\n};\n"],"names":["createContext","forwardRef","useContext","useId","Radio","RadioPrimitive","RadioGroup","RadioGroupPrimitive","cva","cn","focusState","selectionItemBase","selectionItemCard","selectionItemDefault","selectionItemDescription","selectionItemLabel","className","orientation","props","ref","data-slot","data-orientation","aria-orientation","displayName","RadioGroupItemLabelIdContext","undefined","radioGroupItemVariants","variants","variant","default","card","defaultVariants","RadioGroupItem","children","labelId","Provider","value","label","data-variant","RadioGroupItemControl","ariaLabel","ariaLabelledBy","Root","aria-label","aria-labelledby","Indicator","span","RadioGroupItemLabel","id","RadioGroupItemDescription"],"mappings":";AAAA,SAKEA,aAAa,EACbC,UAAU,EACVC,UAAU,EACVC,KAAK,QACA,QAAQ;AAEf,SAASC,SAASC,cAAc,QAAQ,uBAAuB;AAC/D,SAASC,cAAcC,mBAAmB,QAAQ,6BAA6B;AAC/E,SAA4BC,GAAG,QAAQ,2BAA2B;AAGlE,SACEC,EAAE,EACFC,UAAU,EACVC,iBAAiB,EACjBC,iBAAiB,EACjBC,oBAAoB,EACpBC,wBAAwB,EACxBC,kBAAkB,QACb,2BAAwB;AAQ/B,MAAMT,2BAEFL,WACF,CAAC,EAAEe,SAAS,EAAEC,cAAc,UAAU,EA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xB;AAEFuB,sBAAsBhB,WAAW,GAAG;AAEpC,MAAMwB,oCAEF9C,WACF,CAAC,EAAEe,SAAS,EAAE,GAAGE,OAAO,EAAEC;IACxB,MAAMe,UAAUhC,WAAWsB;IAC3B,qBACE,KAACsB;QACC3B,KAAKA;QACLC,aAAU;QACVJ,WAAWP,GACTM,oBACA,oEACA,8EACAC;QAED,GAAGE,KAAK;QACT8B,IAAId;;AAGV;AAEFa,oBAAoBxB,WAAW,GAAG;AAElC,MAAM0B,0CAEFhD,WACF,CAAC,EAAEe,SAAS,EAAE,GAAGE,OAAO,EAAEC;IACxB,qBACE,KAAC2B;QACC3B,KAAKA;QACLC,aAAU;QACVJ,WAAWP,GACTK,0BACA,8EACAE;QAED,GAAGE,KAAK;;AAGf;AAEF+B,0BAA0B1B,WAAW,GAAG;AAExC,SACEjB,UAAU,EACV0B,cAAc,EACdO,qBAAqB,EACrBU,yBAAyB,EACzBF,mBAAmB,GACnB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/radio-group/radio-group.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentRef,\n type HTMLAttributes,\n createContext,\n forwardRef,\n useContext,\n useId,\n} from 'react';\n\nimport { Radio as RadioPrimitive } from '@base-ui/react/radio';\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport type { ClassProp } from 'class-variance-authority/types';\n\nimport {\n cn,\n focusState,\n selectionItemBase,\n selectionItemCard,\n selectionItemDefault,\n selectionItemDescription,\n selectionItemLabel,\n} from '../../../../lib/utils';\n\ntype Orientation = 'horizontal' | 'vertical';\n\ntype RadioGroupProps = RadioGroupPrimitive.Props & {\n orientation?: Orientation;\n};\n\nconst RadioGroup: ForwardRefExoticComponent<\n Omit<RadioGroupProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<typeof RadioGroupPrimitive>, RadioGroupProps>(\n ({ className, orientation = 'vertical', ...props }, ref) => {\n return (\n <RadioGroupPrimitive\n ref={ref}\n data-slot=\"radio-group\"\n data-orientation={orientation}\n aria-orientation={orientation}\n className={cn(\n orientation === 'horizontal'\n ? 'flex items-center gap-2'\n : 'grid has-[[data-variant=card]]:gap-2',\n className\n )}\n {...props}\n />\n );\n }\n);\nRadioGroup.displayName = 'RadioGroup';\n\nconst RadioGroupItemLabelIdContext = createContext<string | undefined>(\n undefined\n);\n\ninterface RadioGroupItemVariantProps {\n variant?: 'default' | 'card' | null;\n}\n\nconst radioGroupItemVariants: (\n props?: (RadioGroupItemVariantProps & ClassProp) | undefined\n) => string = cva(cn('group/radio-group-item', selectionItemBase), {\n variants: {\n variant: {\n default: selectionItemDefault,\n card: selectionItemCard,\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\ntype RadioGroupItemProps = HTMLAttributes<HTMLLabelElement> &\n VariantProps<typeof radioGroupItemVariants>;\n\nconst RadioGroupItem: ForwardRefExoticComponent<\n Omit<RadioGroupItemProps, 'ref'> & RefAttributes<HTMLLabelElement>\n> = forwardRef<ComponentRef<'label'>, RadioGroupItemProps>(\n ({ className, variant, children, ...props }, ref) => {\n const labelId = useId();\n return (\n <RadioGroupItemLabelIdContext.Provider value={labelId}>\n <label\n ref={ref}\n data-slot=\"radio-group-item\"\n data-variant={variant ?? 'default'}\n className={cn(radioGroupItemVariants({ variant }), className)}\n {...props}\n >\n {children}\n </label>\n </RadioGroupItemLabelIdContext.Provider>\n );\n }\n);\nRadioGroupItem.displayName = 'RadioGroupItem';\n\nconst RadioGroupItemControl: ForwardRefExoticComponent<\n Omit<RadioPrimitive.Root.Props<unknown>, 'ref'> & RefAttributes<HTMLElement>\n> = forwardRef<\n ComponentRef<typeof RadioPrimitive.Root>,\n RadioPrimitive.Root.Props\n>(\n (\n {\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n },\n ref\n ) => {\n const labelId = useContext(RadioGroupItemLabelIdContext);\n return (\n <RadioPrimitive.Root\n ref={ref}\n data-slot=\"radio-group-item-control\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy ?? (ariaLabel ? undefined : labelId)}\n className={cn(\n \"group relative flex size-4 shrink-0 items-center justify-center rounded-full bg-transparent outline-none before:pointer-events-none before:absolute before:inset-0 before:z-0 before:box-border before:rounded-full before:border-[1.5px] before:border-muted-foreground before:bg-transparent before:transition-[background-color,border-color,box-shadow] before:content-['']\",\n 'data-[checked]:not-data-disabled:before:border-primary-background data-[checked]:not-data-disabled:before:bg-transparent',\n 'hover:before:border-muted-foreground-hover group-hover/radio-group-item:before:border-muted-foreground-hover',\n 'data-[checked]:not-data-disabled:hover:before:border-primary-background-hover',\n 'data-[checked]:not-data-disabled:group-hover/radio-group-item:before:border-primary-background-hover',\n 'data-disabled:not-data-checked:before:border-disabled data-disabled:not-data-checked:before:bg-transparent',\n 'data-disabled:not-data-checked:hover:before:border-disabled data-disabled:not-data-checked:group-hover/radio-group-item:before:border-disabled data-disabled:not-data-checked:group-hover/radio-group-item:before:bg-transparent',\n 'data-disabled:data-checked:before:border-base-foreground-disabled data-disabled:data-checked:before:bg-transparent',\n 'data-disabled:data-checked:hover:before:border-base-foreground-disabled data-disabled:data-checked:group-hover/radio-group-item:before:border-base-foreground-disabled',\n focusState,\n className\n )}\n {...props}\n >\n <RadioPrimitive.Indicator\n data-slot=\"radio-group-item-indicator\"\n className=\"relative z-10 flex items-center justify-center size-full\"\n >\n <span className=\"size-2.5 rounded-full group-not-data-[disabled]:bg-primary-background group-not-data-[disabled]:group-hover:bg-primary-background-hover group-data-[disabled]:bg-base-foreground-disabled\" />\n </RadioPrimitive.Indicator>\n </RadioPrimitive.Root>\n );\n }\n);\nRadioGroupItemControl.displayName = 'RadioGroupItemControl';\n\nconst RadioGroupItemLabel: ForwardRefExoticComponent<\n HTMLAttributes<HTMLSpanElement> & RefAttributes<HTMLSpanElement>\n> = forwardRef<ComponentRef<'span'>, HTMLAttributes<HTMLSpanElement>>(\n ({ className, ...props }, ref) => {\n const labelId = useContext(RadioGroupItemLabelIdContext);\n return (\n <span\n ref={ref}\n data-slot=\"radio-group-item-label\"\n className={cn(\n selectionItemLabel,\n 'group-has-[[data-checked]]/radio-group-item:text-base-foreground',\n 'group-has-[[data-disabled]]/radio-group-item:text-base-foreground-disabled',\n className\n )}\n {...props}\n id={labelId}\n />\n );\n }\n);\nRadioGroupItemLabel.displayName = 'RadioGroupItemLabel';\n\nconst RadioGroupItemDescription: ForwardRefExoticComponent<\n HTMLAttributes<HTMLSpanElement> & RefAttributes<HTMLSpanElement>\n> = forwardRef<ComponentRef<'span'>, HTMLAttributes<HTMLSpanElement>>(\n ({ className, ...props }, ref) => {\n return (\n <span\n ref={ref}\n data-slot=\"radio-group-item-description\"\n className={cn(\n selectionItemDescription,\n 'group-has-[[data-disabled]]/radio-group-item:text-base-foreground-disabled',\n className\n )}\n {...props}\n />\n );\n }\n);\nRadioGroupItemDescription.displayName = 'RadioGroupItemDescription';\n\nexport {\n RadioGroup,\n RadioGroupItem,\n RadioGroupItemControl,\n RadioGroupItemDescription,\n RadioGroupItemLabel,\n};\n"],"names":["createContext","forwardRef","useContext","useId","Radio","RadioPrimitive","RadioGroup","RadioGroupPrimitive","cva","cn","focusState","selectionItemBase","selectionItemCard","selectionItemDefault","selectionItemDescription","selectionItemLabel","className","orientation","props","ref","data-slot","data-orientation","aria-orientation","displayName","RadioGroupItemLabelIdContext","undefined","radioGroupItemVariants","variants","variant","default","card","defaultVariants","RadioGroupItem","children","labelId","Provider","value","label","data-variant","RadioGroupItemControl","ariaLabel","ariaLabelledBy","Root","aria-label","aria-labelledby","Indicator","span","RadioGroupItemLabel","id","RadioGroupItemDescription"],"mappings":";AAAA,SAKEA,aAAa,EACbC,UAAU,EACVC,UAAU,EACVC,KAAK,QACA,QAAQ;AAEf,SAASC,SAASC,cAAc,QAAQ,uBAAuB;AAC/D,SAASC,cAAcC,mBAAmB,QAAQ,6BAA6B;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AAAA,YAAYf,YAAYS,OAAM;QAClElB,WAAWP,GACT,mXACA,4HACA,gHACA,iFACA,wGACA,8GACA,oOACA,sHACA,0KACAC,YACAM;QAED,GAAGE,KAAK;kBAET,cAAA,KAACb,eAAewC,SAAS;YACvBzB,aAAU;YACVJ,WAAU;sBAEV,cAAA,KAAC8B;gBAAK9B,WAAU;;;;AAIxB;AAEFuB,sBAAsBhB,WAAW,GAAG;AAEpC,MAAMwB,oCAEF9C,WACF,CAAC,EAAEe,SAAS,EAAE,GAAGE,OAAO,EAAEC;IACxB,MAAMe,UAAUhC,WAAWsB;IAC3B,qBACE,KAACsB;QACC3B,KAAKA;QACLC,aAAU;QACVJ,WAAWP,GACTM,oBACA,oEACA,8EACAC;QAED,GAAGE,KAAK;QACT8B,IAAId;;AAGV;AAEFa,oBAAoBxB,WAAW,GAAG;AAElC,MAAM0B,0CAEFhD,WACF,CAAC,EAAEe,SAAS,EAAE,GAAGE,OAAO,EAAEC;IACxB,qBACE,KAAC2B;QACC3B,KAAKA;QACLC,aAAU;QACVJ,WAAWP,GACTK,0BACA,8EACAE;QAED,GAAGE,KAAK;;AAGf;AAEF+B,0BAA0B1B,WAAW,GAAG;AAExC,SACEjB,UAAU,EACV0B,cAAc,EACdO,qBAAqB,EACrBU,yBAAyB,EACzBF,mBAAmB,GACnB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, forwardRef, useContext } from "react";
|
|
3
3
|
import { IconBrain } from "@tabler/icons-react";
|
|
4
|
-
import { cn } from "../../../../lib/utils
|
|
4
|
+
import { cn } from "../../../../lib/utils";
|
|
5
5
|
const ReasoningDecorationsContext = /*#__PURE__*/ createContext(true);
|
|
6
6
|
const useReasoningDecorations = ()=>useContext(ReasoningDecorationsContext);
|
|
7
7
|
const Reasoning = /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ _jsx("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/ui/core/reasoning/reasoning.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentProps,\n type ComponentRef,\n createContext,\n forwardRef,\n useContext,\n} from 'react';\n\nimport { IconBrain } from '@tabler/icons-react';\n\nimport { cn } from '../../../../lib/utils';\n\nconst ReasoningDecorationsContext = createContext<boolean>(true);\nconst useReasoningDecorations = () => useContext(ReasoningDecorationsContext);\n\ntype ReasoningProps = ComponentProps<'div'>;\n\nconst Reasoning: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, ReasoningProps>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"reasoning\"\n className={cn(\n 'relative flex w-full flex-col gap-2 not-prose py-2',\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n);\nReasoning.displayName = 'Reasoning';\n\ntype ReasoningHeaderProps = ComponentProps<'div'> & {\n title?: string;\n};\n\nconst ReasoningHeader: ForwardRefExoticComponent<\n Omit<ReasoningHeaderProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, ReasoningHeaderProps>(\n ({ className, title = 'Reasoning', children, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"reasoning-header\"\n className={cn(\n 'flex items-center gap-2 text-base leading-5 tracking-tighter text-muted-foreground',\n className\n )}\n {...props}\n >\n <IconBrain className=\"size-4 shrink-0\" />\n {children ?? <span>{title}</span>}\n </div>\n )\n);\nReasoningHeader.displayName = 'ReasoningHeader';\n\ntype ReasoningContentProps = ComponentProps<'div'>;\n\nconst ReasoningContent: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, ReasoningContentProps>(\n ({ className, children, ...props }, ref) => {\n const hasMultipleChildren =\n Array.isArray(children) && children.filter(Boolean).length > 1;\n return (\n <ReasoningDecorationsContext.Provider value={hasMultipleChildren}>\n <ReasoningContentInner ref={ref} className={className} {...props}>\n {children}\n </ReasoningContentInner>\n </ReasoningDecorationsContext.Provider>\n );\n }\n);\nReasoningContent.displayName = 'ReasoningContent';\n\nconst ReasoningContentInner = forwardRef<\n ComponentRef<'div'>,\n ReasoningContentProps\n>(({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"reasoning-content-inner\"\n className={cn('relative flex flex-col gap-0 pl-4', className)}\n {...props}\n >\n {children}\n </div>\n));\nReasoningContentInner.displayName = 'ReasoningContentInner';\n\ntype ReasoningItemProps = ComponentProps<'div'>;\n\nconst ReasoningItem: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, ReasoningItemProps>(\n ({ className, children, ...props }, ref) => {\n const showDecorations = useReasoningDecorations();\n\n return (\n <div\n ref={ref}\n data-slot=\"reasoning-item\"\n className={cn(\n 'relative',\n showDecorations && [\n 'before:absolute before:-left-2.75 before:top-4 before:z-10 before:size-1.75 before:rounded-full before:bg-default',\n 'after:absolute after:-left-2 after:top-0 after:bottom-0 after:w-px after:bg-default',\n 'first:after:top-4',\n 'last:after:bottom-auto last:after:h-4',\n ],\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\nReasoningItem.displayName = 'ReasoningItem';\n\nexport { Reasoning, ReasoningContent, ReasoningHeader, ReasoningItem };\n"],"names":["createContext","forwardRef","useContext","IconBrain","cn","ReasoningDecorationsContext","useReasoningDecorations","Reasoning","className","children","props","ref","div","data-slot","displayName","ReasoningHeader","title","span","ReasoningContent","hasMultipleChildren","Array","isArray","filter","Boolean","length","Provider","value","ReasoningContentInner","ReasoningItem","showDecorations"],"mappings":";AAAA,SAKEA,aAAa,EACbC,UAAU,EACVC,UAAU,QACL,QAAQ;AAEf,SAASC,SAAS,QAAQ,sBAAsB;AAEhD,SAASC,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/reasoning/reasoning.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentProps,\n type ComponentRef,\n createContext,\n forwardRef,\n useContext,\n} from 'react';\n\nimport { IconBrain } from '@tabler/icons-react';\n\nimport { cn } from '../../../../lib/utils';\n\nconst ReasoningDecorationsContext = createContext<boolean>(true);\nconst useReasoningDecorations = () => useContext(ReasoningDecorationsContext);\n\ntype ReasoningProps = ComponentProps<'div'>;\n\nconst Reasoning: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, ReasoningProps>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"reasoning\"\n className={cn(\n 'relative flex w-full flex-col gap-2 not-prose py-2',\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n);\nReasoning.displayName = 'Reasoning';\n\ntype ReasoningHeaderProps = ComponentProps<'div'> & {\n title?: string;\n};\n\nconst ReasoningHeader: ForwardRefExoticComponent<\n Omit<ReasoningHeaderProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, ReasoningHeaderProps>(\n ({ className, title = 'Reasoning', children, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"reasoning-header\"\n className={cn(\n 'flex items-center gap-2 text-base leading-5 tracking-tighter text-muted-foreground',\n className\n )}\n {...props}\n >\n <IconBrain className=\"size-4 shrink-0\" />\n {children ?? <span>{title}</span>}\n </div>\n )\n);\nReasoningHeader.displayName = 'ReasoningHeader';\n\ntype ReasoningContentProps = ComponentProps<'div'>;\n\nconst ReasoningContent: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, ReasoningContentProps>(\n ({ className, children, ...props }, ref) => {\n const hasMultipleChildren =\n Array.isArray(children) && children.filter(Boolean).length > 1;\n return (\n <ReasoningDecorationsContext.Provider value={hasMultipleChildren}>\n <ReasoningContentInner ref={ref} className={className} {...props}>\n {children}\n </ReasoningContentInner>\n </ReasoningDecorationsContext.Provider>\n );\n }\n);\nReasoningContent.displayName = 'ReasoningContent';\n\nconst ReasoningContentInner = forwardRef<\n ComponentRef<'div'>,\n ReasoningContentProps\n>(({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"reasoning-content-inner\"\n className={cn('relative flex flex-col gap-0 pl-4', className)}\n {...props}\n >\n {children}\n </div>\n));\nReasoningContentInner.displayName = 'ReasoningContentInner';\n\ntype ReasoningItemProps = ComponentProps<'div'>;\n\nconst ReasoningItem: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, ReasoningItemProps>(\n ({ className, children, ...props }, ref) => {\n const showDecorations = useReasoningDecorations();\n\n return (\n <div\n ref={ref}\n data-slot=\"reasoning-item\"\n className={cn(\n 'relative',\n showDecorations && [\n 'before:absolute before:-left-2.75 before:top-4 before:z-10 before:size-1.75 before:rounded-full before:bg-default',\n 'after:absolute after:-left-2 after:top-0 after:bottom-0 after:w-px after:bg-default',\n 'first:after:top-4',\n 'last:after:bottom-auto last:after:h-4',\n ],\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\nReasoningItem.displayName = 'ReasoningItem';\n\nexport { Reasoning, ReasoningContent, ReasoningHeader, ReasoningItem };\n"],"names":["createContext","forwardRef","useContext","IconBrain","cn","ReasoningDecorationsContext","useReasoningDecorations","Reasoning","className","children","props","ref","div","data-slot","displayName","ReasoningHeader","title","span","ReasoningContent","hasMultipleChildren","Array","isArray","filter","Boolean","length","Provider","value","ReasoningContentInner","ReasoningItem","showDecorations"],"mappings":";AAAA,SAKEA,aAAa,EACbC,UAAU,EACVC,UAAU,QACL,QAAQ;AAEf,SAASC,SAAS,QAAQ,sBAAsB;AAEhD,SAASC,EAAE,QAAQ,wBAAwB;AAE3C,MAAMC,4CAA8BL,cAAuB;AAC3D,M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ACLE,aAAU;QACVL,WAAWJ,GACT,YACAyB,mBAAmB;YACjB;YACA;YACA;YACA;SACD,EACDrB;QAED,GAAGE,KAAK;kBAERD;;AAGP;AAEFmB,cAAcd,WAAW,GAAG;AAE5B,SAASP,SAAS,EAAEW,gBAAgB,EAAEH,eAAe,EAAEa,aAAa,GAAG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
|
|
4
|
-
import { cn, focusRing } from "../../../../lib/utils
|
|
4
|
+
import { cn, focusRing } from "../../../../lib/utils";
|
|
5
5
|
const ScrollArea = /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>{
|
|
6
6
|
return /*#__PURE__*/ _jsxs(ScrollAreaPrimitive.Root, {
|
|
7
7
|
ref: ref,
|