@mondrianai/runyourai-design-system 0.0.15 → 0.0.16

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/index.d.mts CHANGED
@@ -314,6 +314,17 @@ type DateRange = {
314
314
  start?: Date;
315
315
  end?: Date;
316
316
  };
317
+ /**
318
+ * A rule that disables one or more dates in the calendar:
319
+ * - `'past'` — all dates strictly before today
320
+ * - `'future'` — all dates strictly after today
321
+ * - `Date` — a specific single day
322
+ * - `{ start?, end? }` — an inclusive date range; omit either bound for an open-ended range
323
+ */
324
+ type DisabledDateRule = 'past' | 'future' | Date | {
325
+ start?: Date;
326
+ end?: Date;
327
+ };
317
328
  interface DatePickerProps {
318
329
  /** Controlled value (date / offset modes) */
319
330
  value?: Date;
@@ -333,7 +344,29 @@ interface DatePickerProps {
333
344
  defaultRange?: DateRange;
334
345
  /** Called when the selected range changes. Used when mode='range'. */
335
346
  onRangeChange?: (range: DateRange) => void;
336
- /** When true, dates before today cannot be selected and prev-month nav is blocked at current month */
347
+ /**
348
+ * One or more rules that disable specific dates in the calendar.
349
+ *
350
+ * ```tsx
351
+ * // 오늘 이후 선택 불가
352
+ * disabledDates="future"
353
+ *
354
+ * // 특정 날짜 하루 비활성화
355
+ * disabledDates={new Date(2025, 5, 10)}
356
+ *
357
+ * // 복합 규칙
358
+ * disabledDates={[
359
+ * 'past',
360
+ * new Date(2025, 5, 3),
361
+ * { start: new Date(2025, 4, 1), end: new Date(2025, 4, 5) },
362
+ * ]}
363
+ * ```
364
+ */
365
+ disabledDates?: DisabledDateRule | DisabledDateRule[];
366
+ /**
367
+ * @deprecated Use `disabledDates="past"` instead.
368
+ * When true, dates before today cannot be selected.
369
+ */
337
370
  disablePast?: boolean;
338
371
  locale?: DatePickerLocale;
339
372
  /** Override the placeholder shown when no date is selected */
@@ -348,7 +381,7 @@ interface DatePickerProps {
348
381
  showTodayLabel?: boolean;
349
382
  disabled?: boolean;
350
383
  }
351
- declare function DatePicker({ value, defaultValue, onChange, mode, range, defaultRange, onRangeChange, disablePast, locale, placeholder, className, yearRange, showTodayLabel, disabled, }: DatePickerProps): react_jsx_runtime.JSX.Element;
384
+ declare function DatePicker({ value, defaultValue, onChange, mode, range, defaultRange, onRangeChange, disabledDates, disablePast, locale, placeholder, className, yearRange, showTodayLabel, disabled, }: DatePickerProps): react_jsx_runtime.JSX.Element;
352
385
 
353
386
  interface FieldProps {
354
387
  /** 필드 레이블 */
@@ -644,8 +677,10 @@ interface SearchInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputEle
644
677
  onChange: (value: string) => void;
645
678
  placeholder?: string;
646
679
  className?: string;
680
+ /** onChange를 지연 호출할 ms. 지정하면 내부 draft 상태로 즉시 표시하고, 입력 완료 후 지연 커밋. */
681
+ debounce?: number;
647
682
  }
648
- declare function SearchInput({ value, onChange, placeholder, className, ...props }: SearchInputProps): react_jsx_runtime.JSX.Element;
683
+ declare function SearchInput({ value, onChange, placeholder, className, debounce: debounceMs, ...props }: SearchInputProps): react_jsx_runtime.JSX.Element;
649
684
 
650
685
  interface SelectOption {
651
686
  value: string;
@@ -1548,4 +1583,4 @@ declare function WordFileIcon({ className }: {
1548
1583
  className?: string;
1549
1584
  }): react_jsx_runtime.JSX.Element;
1550
1585
 
1551
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgentBlogIcon, AgentCsIcon, AgentDataIcon, AgentHrIcon, AgentMailIcon, AgentTrendIcon, AiAgentIcon, AiBuilderIcon, AiCloudIcon, AiDatacenterIcon, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlignJustifyIcon, AlignLeftIcon, ArrowDownIcon, Avatar, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarProps, type AvatarSize, BADGE_VARIANT_STYLES, Badge, type BadgeProps, type BadgeVariant, BlockquoteIcon, BoldIcon, BookOpenIcon, BookUpIcon, Breadcrumb, Button, type ButtonProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxCard, type CheckboxCardProps, type CheckboxProps, ChevronsUpDownIcon, ChoiceCardGroup, type ChoiceCardGroupProps, ChoiceCardItem, type ChoiceCardItemProps, CircleCheckFillIcon, CircleHelpIcon, CircleIndicator, type CircleIndicatorProps, CircleOutlineIcon, ClaudeIcon, CodeIcon, CodeSquareIcon, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleRoot, CollapsibleTrigger, type CollapsibleWorkspace, Combobox, type ComboboxOption, type ComboboxProps, CreditIcon, DataSection, type DataSectionProps, DatePicker, type DatePickerLocale, type DatePickerMode, type DatePickerProps, type DateRange, DeepSeekIcon, DownloadIcon, Drawer, type DrawerProps, DriveIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyTrayIcon, Field, FieldDivider, type FieldProps, FieldRow, type FieldRowProps, FieldSection, type FieldSectionProps, FileCodeIcon, FileSearchIcon, FileTypeCornerIcon, FolderAmberIcon, FolderBlueIcon, FolderClosedIcon, FolderGreenIcon, FolderVioletIcon, GeminiIcon, GoogleIcon, HangulFileIcon, Header, type HeaderNavItem, type HeaderProps, HeadingIcon, HtmlFileIcon, ICON_NODES, Icon, type IconProps, ImageIcon, ImportIcon, IndentIcon, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, ItalicIcon, KbCard, type KbCardMetadataItem, type KbCardProps, KeyRoundIcon, type LanguageItem, LayersIcon, LayoutGridIcon, LineChartIcon, LinkIcon, ListIcon, ListOrderedIcon, MarkdownFileIcon, MarkdownMessage, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarMenu, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MessageCircleIcon, MessageFooter, type MessageFooterProps, MessagesSquareIcon, Modal, type ModalProps, MyPageIcon, type NavDropdownItem, type NotificationItem, NumberBadge, type NumberBadgeProps, OpenAiIcon, OutdentIcon, Pagination, PanelLeftIcon, PdfFileIcon, PenLineIcon, PencilLineIcon, PresentationIcon, Progress, type ProgressProps, type ProgressThreshold, Providers, RefreshCwIcon, RyaiLogoIcon, SearchInput, type SearchInputProps, SegmentedControl, Select, type SelectGroup, type SelectOption, type SelectProps, Sheet, SheetFileIcon, ShoppingBagIcon, Sidebar, SidebarLink, type SidebarMainMenuItem, type SidebarSubMenuItem, type SidebarUtilityItem, Skeleton, type SkeletonProps, SlideFileIcon, Slider, SmileIcon, type SortDirection, SortIcon, SparklesIcon, SquareCheckIcon, SquareCheckOutlineIcon, StarIcon, Stepper, type StepperProps, StrikethroughIcon, Switch, SwitchField, type SwitchFieldProps, type TabItem, Table, type TableColumn, type TablePaginationConfig, TablePropertiesIcon, type TableProps, type TableSortingItem, Tabs, type TabsProps, Toggle, ToggleGroup, type ToggleGroupItemData, type ToggleGroupProps, type ToggleProps, Tooltip, type TooltipProps, TooltipProvider, TooltipWithIcon, type TooltipWithIconProps, TrashIcon, UpstageIcon, type UserMenuSection, type UserMenuSectionItem, UserMessageBubble, WandSparklesIcon, WordFileIcon, buttonVariants, toggleBaseClasses, toggleSizeClasses };
1586
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgentBlogIcon, AgentCsIcon, AgentDataIcon, AgentHrIcon, AgentMailIcon, AgentTrendIcon, AiAgentIcon, AiBuilderIcon, AiCloudIcon, AiDatacenterIcon, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlignJustifyIcon, AlignLeftIcon, ArrowDownIcon, Avatar, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarProps, type AvatarSize, BADGE_VARIANT_STYLES, Badge, type BadgeProps, type BadgeVariant, BlockquoteIcon, BoldIcon, BookOpenIcon, BookUpIcon, Breadcrumb, Button, type ButtonProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxCard, type CheckboxCardProps, type CheckboxProps, ChevronsUpDownIcon, ChoiceCardGroup, type ChoiceCardGroupProps, ChoiceCardItem, type ChoiceCardItemProps, CircleCheckFillIcon, CircleHelpIcon, CircleIndicator, type CircleIndicatorProps, CircleOutlineIcon, ClaudeIcon, CodeIcon, CodeSquareIcon, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleRoot, CollapsibleTrigger, type CollapsibleWorkspace, Combobox, type ComboboxOption, type ComboboxProps, CreditIcon, DataSection, type DataSectionProps, DatePicker, type DatePickerLocale, type DatePickerMode, type DatePickerProps, type DateRange, DeepSeekIcon, type DisabledDateRule, DownloadIcon, Drawer, type DrawerProps, DriveIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyTrayIcon, Field, FieldDivider, type FieldProps, FieldRow, type FieldRowProps, FieldSection, type FieldSectionProps, FileCodeIcon, FileSearchIcon, FileTypeCornerIcon, FolderAmberIcon, FolderBlueIcon, FolderClosedIcon, FolderGreenIcon, FolderVioletIcon, GeminiIcon, GoogleIcon, HangulFileIcon, Header, type HeaderNavItem, type HeaderProps, HeadingIcon, HtmlFileIcon, ICON_NODES, Icon, type IconProps, ImageIcon, ImportIcon, IndentIcon, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, ItalicIcon, KbCard, type KbCardMetadataItem, type KbCardProps, KeyRoundIcon, type LanguageItem, LayersIcon, LayoutGridIcon, LineChartIcon, LinkIcon, ListIcon, ListOrderedIcon, MarkdownFileIcon, MarkdownMessage, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarMenu, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MessageCircleIcon, MessageFooter, type MessageFooterProps, MessagesSquareIcon, Modal, type ModalProps, MyPageIcon, type NavDropdownItem, type NotificationItem, NumberBadge, type NumberBadgeProps, OpenAiIcon, OutdentIcon, Pagination, PanelLeftIcon, PdfFileIcon, PenLineIcon, PencilLineIcon, PresentationIcon, Progress, type ProgressProps, type ProgressThreshold, Providers, RefreshCwIcon, RyaiLogoIcon, SearchInput, type SearchInputProps, SegmentedControl, Select, type SelectGroup, type SelectOption, type SelectProps, Sheet, SheetFileIcon, ShoppingBagIcon, Sidebar, SidebarLink, type SidebarMainMenuItem, type SidebarSubMenuItem, type SidebarUtilityItem, Skeleton, type SkeletonProps, SlideFileIcon, Slider, SmileIcon, type SortDirection, SortIcon, SparklesIcon, SquareCheckIcon, SquareCheckOutlineIcon, StarIcon, Stepper, type StepperProps, StrikethroughIcon, Switch, SwitchField, type SwitchFieldProps, type TabItem, Table, type TableColumn, type TablePaginationConfig, TablePropertiesIcon, type TableProps, type TableSortingItem, Tabs, type TabsProps, Toggle, ToggleGroup, type ToggleGroupItemData, type ToggleGroupProps, type ToggleProps, Tooltip, type TooltipProps, TooltipProvider, TooltipWithIcon, type TooltipWithIconProps, TrashIcon, UpstageIcon, type UserMenuSection, type UserMenuSectionItem, UserMessageBubble, WandSparklesIcon, WordFileIcon, buttonVariants, toggleBaseClasses, toggleSizeClasses };
package/dist/index.d.ts CHANGED
@@ -314,6 +314,17 @@ type DateRange = {
314
314
  start?: Date;
315
315
  end?: Date;
316
316
  };
317
+ /**
318
+ * A rule that disables one or more dates in the calendar:
319
+ * - `'past'` — all dates strictly before today
320
+ * - `'future'` — all dates strictly after today
321
+ * - `Date` — a specific single day
322
+ * - `{ start?, end? }` — an inclusive date range; omit either bound for an open-ended range
323
+ */
324
+ type DisabledDateRule = 'past' | 'future' | Date | {
325
+ start?: Date;
326
+ end?: Date;
327
+ };
317
328
  interface DatePickerProps {
318
329
  /** Controlled value (date / offset modes) */
319
330
  value?: Date;
@@ -333,7 +344,29 @@ interface DatePickerProps {
333
344
  defaultRange?: DateRange;
334
345
  /** Called when the selected range changes. Used when mode='range'. */
335
346
  onRangeChange?: (range: DateRange) => void;
336
- /** When true, dates before today cannot be selected and prev-month nav is blocked at current month */
347
+ /**
348
+ * One or more rules that disable specific dates in the calendar.
349
+ *
350
+ * ```tsx
351
+ * // 오늘 이후 선택 불가
352
+ * disabledDates="future"
353
+ *
354
+ * // 특정 날짜 하루 비활성화
355
+ * disabledDates={new Date(2025, 5, 10)}
356
+ *
357
+ * // 복합 규칙
358
+ * disabledDates={[
359
+ * 'past',
360
+ * new Date(2025, 5, 3),
361
+ * { start: new Date(2025, 4, 1), end: new Date(2025, 4, 5) },
362
+ * ]}
363
+ * ```
364
+ */
365
+ disabledDates?: DisabledDateRule | DisabledDateRule[];
366
+ /**
367
+ * @deprecated Use `disabledDates="past"` instead.
368
+ * When true, dates before today cannot be selected.
369
+ */
337
370
  disablePast?: boolean;
338
371
  locale?: DatePickerLocale;
339
372
  /** Override the placeholder shown when no date is selected */
@@ -348,7 +381,7 @@ interface DatePickerProps {
348
381
  showTodayLabel?: boolean;
349
382
  disabled?: boolean;
350
383
  }
351
- declare function DatePicker({ value, defaultValue, onChange, mode, range, defaultRange, onRangeChange, disablePast, locale, placeholder, className, yearRange, showTodayLabel, disabled, }: DatePickerProps): react_jsx_runtime.JSX.Element;
384
+ declare function DatePicker({ value, defaultValue, onChange, mode, range, defaultRange, onRangeChange, disabledDates, disablePast, locale, placeholder, className, yearRange, showTodayLabel, disabled, }: DatePickerProps): react_jsx_runtime.JSX.Element;
352
385
 
353
386
  interface FieldProps {
354
387
  /** 필드 레이블 */
@@ -644,8 +677,10 @@ interface SearchInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputEle
644
677
  onChange: (value: string) => void;
645
678
  placeholder?: string;
646
679
  className?: string;
680
+ /** onChange를 지연 호출할 ms. 지정하면 내부 draft 상태로 즉시 표시하고, 입력 완료 후 지연 커밋. */
681
+ debounce?: number;
647
682
  }
648
- declare function SearchInput({ value, onChange, placeholder, className, ...props }: SearchInputProps): react_jsx_runtime.JSX.Element;
683
+ declare function SearchInput({ value, onChange, placeholder, className, debounce: debounceMs, ...props }: SearchInputProps): react_jsx_runtime.JSX.Element;
649
684
 
650
685
  interface SelectOption {
651
686
  value: string;
@@ -1548,4 +1583,4 @@ declare function WordFileIcon({ className }: {
1548
1583
  className?: string;
1549
1584
  }): react_jsx_runtime.JSX.Element;
1550
1585
 
1551
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgentBlogIcon, AgentCsIcon, AgentDataIcon, AgentHrIcon, AgentMailIcon, AgentTrendIcon, AiAgentIcon, AiBuilderIcon, AiCloudIcon, AiDatacenterIcon, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlignJustifyIcon, AlignLeftIcon, ArrowDownIcon, Avatar, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarProps, type AvatarSize, BADGE_VARIANT_STYLES, Badge, type BadgeProps, type BadgeVariant, BlockquoteIcon, BoldIcon, BookOpenIcon, BookUpIcon, Breadcrumb, Button, type ButtonProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxCard, type CheckboxCardProps, type CheckboxProps, ChevronsUpDownIcon, ChoiceCardGroup, type ChoiceCardGroupProps, ChoiceCardItem, type ChoiceCardItemProps, CircleCheckFillIcon, CircleHelpIcon, CircleIndicator, type CircleIndicatorProps, CircleOutlineIcon, ClaudeIcon, CodeIcon, CodeSquareIcon, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleRoot, CollapsibleTrigger, type CollapsibleWorkspace, Combobox, type ComboboxOption, type ComboboxProps, CreditIcon, DataSection, type DataSectionProps, DatePicker, type DatePickerLocale, type DatePickerMode, type DatePickerProps, type DateRange, DeepSeekIcon, DownloadIcon, Drawer, type DrawerProps, DriveIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyTrayIcon, Field, FieldDivider, type FieldProps, FieldRow, type FieldRowProps, FieldSection, type FieldSectionProps, FileCodeIcon, FileSearchIcon, FileTypeCornerIcon, FolderAmberIcon, FolderBlueIcon, FolderClosedIcon, FolderGreenIcon, FolderVioletIcon, GeminiIcon, GoogleIcon, HangulFileIcon, Header, type HeaderNavItem, type HeaderProps, HeadingIcon, HtmlFileIcon, ICON_NODES, Icon, type IconProps, ImageIcon, ImportIcon, IndentIcon, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, ItalicIcon, KbCard, type KbCardMetadataItem, type KbCardProps, KeyRoundIcon, type LanguageItem, LayersIcon, LayoutGridIcon, LineChartIcon, LinkIcon, ListIcon, ListOrderedIcon, MarkdownFileIcon, MarkdownMessage, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarMenu, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MessageCircleIcon, MessageFooter, type MessageFooterProps, MessagesSquareIcon, Modal, type ModalProps, MyPageIcon, type NavDropdownItem, type NotificationItem, NumberBadge, type NumberBadgeProps, OpenAiIcon, OutdentIcon, Pagination, PanelLeftIcon, PdfFileIcon, PenLineIcon, PencilLineIcon, PresentationIcon, Progress, type ProgressProps, type ProgressThreshold, Providers, RefreshCwIcon, RyaiLogoIcon, SearchInput, type SearchInputProps, SegmentedControl, Select, type SelectGroup, type SelectOption, type SelectProps, Sheet, SheetFileIcon, ShoppingBagIcon, Sidebar, SidebarLink, type SidebarMainMenuItem, type SidebarSubMenuItem, type SidebarUtilityItem, Skeleton, type SkeletonProps, SlideFileIcon, Slider, SmileIcon, type SortDirection, SortIcon, SparklesIcon, SquareCheckIcon, SquareCheckOutlineIcon, StarIcon, Stepper, type StepperProps, StrikethroughIcon, Switch, SwitchField, type SwitchFieldProps, type TabItem, Table, type TableColumn, type TablePaginationConfig, TablePropertiesIcon, type TableProps, type TableSortingItem, Tabs, type TabsProps, Toggle, ToggleGroup, type ToggleGroupItemData, type ToggleGroupProps, type ToggleProps, Tooltip, type TooltipProps, TooltipProvider, TooltipWithIcon, type TooltipWithIconProps, TrashIcon, UpstageIcon, type UserMenuSection, type UserMenuSectionItem, UserMessageBubble, WandSparklesIcon, WordFileIcon, buttonVariants, toggleBaseClasses, toggleSizeClasses };
1586
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgentBlogIcon, AgentCsIcon, AgentDataIcon, AgentHrIcon, AgentMailIcon, AgentTrendIcon, AiAgentIcon, AiBuilderIcon, AiCloudIcon, AiDatacenterIcon, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlignJustifyIcon, AlignLeftIcon, ArrowDownIcon, Avatar, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarProps, type AvatarSize, BADGE_VARIANT_STYLES, Badge, type BadgeProps, type BadgeVariant, BlockquoteIcon, BoldIcon, BookOpenIcon, BookUpIcon, Breadcrumb, Button, type ButtonProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxCard, type CheckboxCardProps, type CheckboxProps, ChevronsUpDownIcon, ChoiceCardGroup, type ChoiceCardGroupProps, ChoiceCardItem, type ChoiceCardItemProps, CircleCheckFillIcon, CircleHelpIcon, CircleIndicator, type CircleIndicatorProps, CircleOutlineIcon, ClaudeIcon, CodeIcon, CodeSquareIcon, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleRoot, CollapsibleTrigger, type CollapsibleWorkspace, Combobox, type ComboboxOption, type ComboboxProps, CreditIcon, DataSection, type DataSectionProps, DatePicker, type DatePickerLocale, type DatePickerMode, type DatePickerProps, type DateRange, DeepSeekIcon, type DisabledDateRule, DownloadIcon, Drawer, type DrawerProps, DriveIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyTrayIcon, Field, FieldDivider, type FieldProps, FieldRow, type FieldRowProps, FieldSection, type FieldSectionProps, FileCodeIcon, FileSearchIcon, FileTypeCornerIcon, FolderAmberIcon, FolderBlueIcon, FolderClosedIcon, FolderGreenIcon, FolderVioletIcon, GeminiIcon, GoogleIcon, HangulFileIcon, Header, type HeaderNavItem, type HeaderProps, HeadingIcon, HtmlFileIcon, ICON_NODES, Icon, type IconProps, ImageIcon, ImportIcon, IndentIcon, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, ItalicIcon, KbCard, type KbCardMetadataItem, type KbCardProps, KeyRoundIcon, type LanguageItem, LayersIcon, LayoutGridIcon, LineChartIcon, LinkIcon, ListIcon, ListOrderedIcon, MarkdownFileIcon, MarkdownMessage, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarMenu, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MessageCircleIcon, MessageFooter, type MessageFooterProps, MessagesSquareIcon, Modal, type ModalProps, MyPageIcon, type NavDropdownItem, type NotificationItem, NumberBadge, type NumberBadgeProps, OpenAiIcon, OutdentIcon, Pagination, PanelLeftIcon, PdfFileIcon, PenLineIcon, PencilLineIcon, PresentationIcon, Progress, type ProgressProps, type ProgressThreshold, Providers, RefreshCwIcon, RyaiLogoIcon, SearchInput, type SearchInputProps, SegmentedControl, Select, type SelectGroup, type SelectOption, type SelectProps, Sheet, SheetFileIcon, ShoppingBagIcon, Sidebar, SidebarLink, type SidebarMainMenuItem, type SidebarSubMenuItem, type SidebarUtilityItem, Skeleton, type SkeletonProps, SlideFileIcon, Slider, SmileIcon, type SortDirection, SortIcon, SparklesIcon, SquareCheckIcon, SquareCheckOutlineIcon, StarIcon, Stepper, type StepperProps, StrikethroughIcon, Switch, SwitchField, type SwitchFieldProps, type TabItem, Table, type TableColumn, type TablePaginationConfig, TablePropertiesIcon, type TableProps, type TableSortingItem, Tabs, type TabsProps, Toggle, ToggleGroup, type ToggleGroupItemData, type ToggleGroupProps, type ToggleProps, Tooltip, type TooltipProps, TooltipProvider, TooltipWithIcon, type TooltipWithIconProps, TrashIcon, UpstageIcon, type UserMenuSection, type UserMenuSectionItem, UserMessageBubble, WandSparklesIcon, WordFileIcon, buttonVariants, toggleBaseClasses, toggleSizeClasses };
package/dist/index.js CHANGED
@@ -2358,12 +2358,27 @@ function diffDays(selected, today) {
2358
2358
  (startOfDay(selected).getTime() - startOfDay(today).getTime()) / 864e5
2359
2359
  );
2360
2360
  }
2361
+ function isDateDisabled(date, rules, today) {
2362
+ const t = startOfDay(date).getTime();
2363
+ const todayT = startOfDay(today).getTime();
2364
+ return rules.some((rule) => {
2365
+ if (rule === "past") return t < todayT;
2366
+ if (rule === "future") return t > todayT;
2367
+ if (rule instanceof Date) return t === startOfDay(rule).getTime();
2368
+ const s = rule.start ? startOfDay(rule.start).getTime() : null;
2369
+ const e = rule.end ? startOfDay(rule.end).getTime() : null;
2370
+ if (s !== null && e !== null) return t >= s && t <= e;
2371
+ if (s !== null) return t >= s;
2372
+ if (e !== null) return t <= e;
2373
+ return false;
2374
+ });
2375
+ }
2361
2376
  function CalendarGrid({
2362
2377
  year,
2363
2378
  month,
2364
2379
  selected,
2365
2380
  today,
2366
- disablePast,
2381
+ disabledRules,
2367
2382
  onSelect,
2368
2383
  onYearChange,
2369
2384
  onMonthChange,
@@ -2378,6 +2393,8 @@ function CalendarGrid({
2378
2393
  const config = LOCALE_CONFIG[locale];
2379
2394
  const todayStart = startOfDay(today);
2380
2395
  const selectedStart = selected ? startOfDay(selected) : null;
2396
+ const hasPastRule = disabledRules.includes("past");
2397
+ const hasFutureRule = disabledRules.includes("future");
2381
2398
  const firstDay = new Date(year, month, 1).getDay();
2382
2399
  const daysInMonth = new Date(year, month + 1, 0).getDate();
2383
2400
  const daysInPrevMonth = new Date(year, month, 0).getDate();
@@ -2418,7 +2435,10 @@ function CalendarGrid({
2418
2435
  }
2419
2436
  const prevYear = month === 0 ? year - 1 : year;
2420
2437
  const prevMon = month === 0 ? 11 : month - 1;
2421
- const isPrevDisabled = disablePast && (prevYear < today.getFullYear() || prevYear === today.getFullYear() && prevMon < today.getMonth());
2438
+ const isPrevDisabled = hasPastRule && (prevYear < today.getFullYear() || prevYear === today.getFullYear() && prevMon < today.getMonth());
2439
+ const nextYear = month === 11 ? year + 1 : year;
2440
+ const nextMon = month === 11 ? 0 : month + 1;
2441
+ const isNextDisabled = hasFutureRule && (nextYear > today.getFullYear() || nextYear === today.getFullYear() && nextMon > today.getMonth());
2422
2442
  const rangeStartTime = rangeStart ? startOfDay(rangeStart).getTime() : null;
2423
2443
  const rangeEndTime = rangeEnd ? startOfDay(rangeEnd).getTime() : null;
2424
2444
  const visualEndTime = rangeEndTime != null ? rangeEndTime : rangeStartTime !== null && hoverDate ? startOfDay(hoverDate).getTime() : null;
@@ -2480,7 +2500,11 @@ function CalendarGrid({
2480
2500
  {
2481
2501
  type: "button",
2482
2502
  onClick: nextMonth,
2483
- className: "flex size-8 items-center justify-center rounded-md text-foreground transition-colors hover:bg-accent active:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-pointer",
2503
+ disabled: isNextDisabled,
2504
+ className: cn(
2505
+ "flex size-8 items-center justify-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
2506
+ isNextDisabled ? "text-muted-foreground opacity-30 cursor-not-allowed" : "text-foreground hover:bg-accent active:bg-accent cursor-pointer"
2507
+ ),
2484
2508
  children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: "chevron-right", className: "size-4" })
2485
2509
  }
2486
2510
  )
@@ -2502,8 +2526,7 @@ function CalendarGrid({
2502
2526
  const dateStart = startOfDay(date);
2503
2527
  const t = dateStart.getTime();
2504
2528
  const isToday = todayStart.getTime() === t;
2505
- const isPast = dateStart < todayStart;
2506
- const isDisabled = disablePast && isPast;
2529
+ const isDisabled = disabledRules.length > 0 && isDateDisabled(date, disabledRules, today);
2507
2530
  const isRangeStart = isRangeMode && rangeStartTime !== null && t === rangeStartTime;
2508
2531
  const isRangeEnd = isRangeMode && rangeEndTime !== null && t === rangeEndTime;
2509
2532
  const isInRange = isRangeMode && rangeStartTime !== null && visualEndTime !== null && !isRangeStart && !isRangeEnd && t > Math.min(rangeStartTime, visualEndTime) && t < Math.max(rangeStartTime, visualEndTime);
@@ -2537,6 +2560,7 @@ function DatePicker({
2537
2560
  range,
2538
2561
  defaultRange,
2539
2562
  onRangeChange,
2563
+ disabledDates,
2540
2564
  disablePast = false,
2541
2565
  locale = "en",
2542
2566
  placeholder,
@@ -2548,6 +2572,11 @@ function DatePicker({
2548
2572
  var _a;
2549
2573
  const today = React11.useMemo(() => /* @__PURE__ */ new Date(), []);
2550
2574
  const config = LOCALE_CONFIG[locale];
2575
+ const disabledRules = React11.useMemo(() => {
2576
+ const rules = disabledDates ? Array.isArray(disabledDates) ? disabledDates : [disabledDates] : [];
2577
+ if (disablePast && !rules.includes("past")) return [...rules, "past"];
2578
+ return rules;
2579
+ }, [disabledDates, disablePast]);
2551
2580
  const [open, setOpen] = React11.useState(false);
2552
2581
  const [selected, setSelected] = React11.useState(defaultValue);
2553
2582
  const activeDate = value !== void 0 ? value : selected;
@@ -2699,7 +2728,7 @@ function DatePicker({
2699
2728
  month: viewMonth,
2700
2729
  selected: activeDate,
2701
2730
  today,
2702
- disablePast,
2731
+ disabledRules,
2703
2732
  onSelect: handleSelect,
2704
2733
  onYearChange: setViewYear,
2705
2734
  onMonthChange: setViewMonth,
@@ -4749,19 +4778,55 @@ function SegmentedControl({
4749
4778
  }
4750
4779
 
4751
4780
  // src/components/ui/search-input.tsx
4781
+ var React20 = __toESM(require("react"));
4752
4782
  var import_jsx_runtime37 = require("react/jsx-runtime");
4753
4783
  function SearchInput(_a) {
4754
4784
  var _b = _a, {
4755
4785
  value,
4756
4786
  onChange,
4757
4787
  placeholder,
4758
- className
4788
+ className,
4789
+ debounce: debounceMs
4759
4790
  } = _b, props = __objRest(_b, [
4760
4791
  "value",
4761
4792
  "onChange",
4762
4793
  "placeholder",
4763
- "className"
4794
+ "className",
4795
+ "debounce"
4764
4796
  ]);
4797
+ const [draft, setDraft] = React20.useState(value);
4798
+ const pendingRef = React20.useRef(null);
4799
+ const latestDraftRef = React20.useRef(value);
4800
+ const onChangeRef = React20.useRef(onChange);
4801
+ onChangeRef.current = onChange;
4802
+ React20.useEffect(() => {
4803
+ if (debounceMs === void 0) return;
4804
+ const pending = pendingRef.current;
4805
+ if (pending !== null) {
4806
+ if (value === pending) pendingRef.current = null;
4807
+ else return;
4808
+ }
4809
+ latestDraftRef.current = value;
4810
+ setDraft(value);
4811
+ }, [value, debounceMs]);
4812
+ React20.useEffect(() => {
4813
+ if (debounceMs === void 0) return;
4814
+ const timer = window.setTimeout(() => {
4815
+ const next = latestDraftRef.current;
4816
+ if (next === value) return;
4817
+ pendingRef.current = next;
4818
+ onChangeRef.current(next);
4819
+ }, debounceMs);
4820
+ return () => window.clearTimeout(timer);
4821
+ }, [draft, debounceMs, value]);
4822
+ const handleChange = (nextValue) => {
4823
+ if (debounceMs !== void 0) {
4824
+ latestDraftRef.current = nextValue;
4825
+ setDraft(nextValue);
4826
+ } else {
4827
+ onChange(nextValue);
4828
+ }
4829
+ };
4765
4830
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("relative flex items-center", className), children: [
4766
4831
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4767
4832
  Icon,
@@ -4774,8 +4839,13 @@ function SearchInput(_a) {
4774
4839
  "input",
4775
4840
  __spreadValues({
4776
4841
  type: "text",
4777
- value,
4778
- onChange: (e) => onChange(e.target.value),
4842
+ value: debounceMs !== void 0 ? draft : value,
4843
+ onChange: (e) => {
4844
+ if (!e.nativeEvent.isComposing) handleChange(e.target.value);
4845
+ },
4846
+ onCompositionEnd: (e) => {
4847
+ handleChange(e.target.value);
4848
+ },
4779
4849
  placeholder,
4780
4850
  className: cn(
4781
4851
  "h-9 w-full rounded-lg border border-border bg-background pl-9 pr-3",
@@ -4788,14 +4858,14 @@ function SearchInput(_a) {
4788
4858
  }
4789
4859
 
4790
4860
  // src/components/ui/select.tsx
4791
- var React20 = __toESM(require("react"));
4861
+ var React21 = __toESM(require("react"));
4792
4862
  var import_radix_ui13 = require("radix-ui");
4793
4863
  var import_jsx_runtime38 = require("react/jsx-runtime");
4794
4864
  function Select(props) {
4795
4865
  var _a, _b, _c, _d;
4796
4866
  const { placeholder = "\uC120\uD0DD\uD574 \uC8FC\uC138\uC694", className, disabled = false } = props;
4797
- const [open, setOpen] = React20.useState(false);
4798
- const [selected, setSelected] = React20.useState(() => {
4867
+ const [open, setOpen] = React21.useState(false);
4868
+ const [selected, setSelected] = React21.useState(() => {
4799
4869
  var _a2;
4800
4870
  if (props.multiple) return new Set((_a2 = props.defaultValue) != null ? _a2 : []);
4801
4871
  const dv = props.defaultValue;
@@ -4805,13 +4875,13 @@ function Select(props) {
4805
4875
  const groupsProp = props.groups;
4806
4876
  const valueProp = props.value;
4807
4877
  const { multiple } = props;
4808
- const groups = React20.useMemo(() => {
4878
+ const groups = React21.useMemo(() => {
4809
4879
  if (groupsProp) return groupsProp;
4810
4880
  if (optionsProp) return [{ options: optionsProp }];
4811
4881
  return [];
4812
4882
  }, [groupsProp, optionsProp]);
4813
- const options = React20.useMemo(() => groups.flatMap((g) => g.options), [groups]);
4814
- const activeSet = React20.useMemo(() => {
4883
+ const options = React21.useMemo(() => groups.flatMap((g) => g.options), [groups]);
4884
+ const activeSet = React21.useMemo(() => {
4815
4885
  if (valueProp !== void 0) {
4816
4886
  return multiple ? new Set(valueProp) : /* @__PURE__ */ new Set([valueProp]);
4817
4887
  }
@@ -4945,10 +5015,10 @@ function Select(props) {
4945
5015
  }
4946
5016
 
4947
5017
  // src/components/ui/sheet.tsx
4948
- var React21 = __toESM(require("react"));
5018
+ var React22 = __toESM(require("react"));
4949
5019
  var import_jsx_runtime39 = require("react/jsx-runtime");
4950
5020
  function Sheet({ open, onClose, title, description, children, footer }) {
4951
- React21.useEffect(() => {
5021
+ React22.useEffect(() => {
4952
5022
  if (!open) return;
4953
5023
  const handler = (e) => {
4954
5024
  if (e.key === "Escape") onClose();
@@ -4991,7 +5061,7 @@ function Sheet({ open, onClose, title, description, children, footer }) {
4991
5061
  }
4992
5062
 
4993
5063
  // src/components/ui/sidebar.tsx
4994
- var React22 = __toESM(require("react"));
5064
+ var React23 = __toESM(require("react"));
4995
5065
  var import_lucide_react4 = require("lucide-react");
4996
5066
 
4997
5067
  // src/components/icons/custom/panel-left.tsx
@@ -5021,22 +5091,22 @@ var defaultSidebarLinkRender = ({
5021
5091
  onClick,
5022
5092
  children
5023
5093
  }) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("a", { href, className: cn(className), style, onClick, children });
5024
- var SidebarLinkContext = React22.createContext(
5094
+ var SidebarLinkContext = React23.createContext(
5025
5095
  defaultSidebarLinkRender
5026
5096
  );
5027
5097
  function SidebarLinkProvider({
5028
5098
  LinkComponent,
5029
5099
  children
5030
5100
  }) {
5031
- const linkRef = React22.useRef(LinkComponent);
5032
- React22.useLayoutEffect(() => {
5101
+ const linkRef = React23.useRef(LinkComponent);
5102
+ React23.useLayoutEffect(() => {
5033
5103
  linkRef.current = LinkComponent;
5034
5104
  });
5035
5105
  function sidebarLinkRender(props) {
5036
5106
  if (!linkRef.current) return defaultSidebarLinkRender(props);
5037
- return React22.createElement(linkRef.current, props);
5107
+ return React23.createElement(linkRef.current, props);
5038
5108
  }
5039
- const [stableRender] = React22.useState(
5109
+ const [stableRender] = React23.useState(
5040
5110
  () => sidebarLinkRender
5041
5111
  );
5042
5112
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SidebarLinkContext.Provider, { value: stableRender, children });
@@ -5048,7 +5118,7 @@ function SidebarLink({
5048
5118
  onClick,
5049
5119
  children
5050
5120
  }) {
5051
- const renderLink = React22.useContext(SidebarLinkContext);
5121
+ const renderLink = React23.useContext(SidebarLinkContext);
5052
5122
  return renderLink({ href, className, style, onClick, children });
5053
5123
  }
5054
5124
  function Sidebar({
@@ -5067,9 +5137,9 @@ function Sidebar({
5067
5137
  }) {
5068
5138
  var _a, _b, _c;
5069
5139
  const isControlled = isPanelOpenProp !== void 0;
5070
- const [internalIsPanelOpen, setInternalIsPanelOpen] = React22.useState(true);
5140
+ const [internalIsPanelOpen, setInternalIsPanelOpen] = React23.useState(true);
5071
5141
  const resolvedIsPanelOpen = isControlled ? isPanelOpenProp : internalIsPanelOpen;
5072
- const activeMenu = React22.useMemo(
5142
+ const activeMenu = React23.useMemo(
5073
5143
  () => {
5074
5144
  var _a2;
5075
5145
  return (_a2 = menus.filter((m) => m.type !== "divider").find((m) => m.isActive)) != null ? _a2 : null;
@@ -5078,15 +5148,15 @@ function Sidebar({
5078
5148
  );
5079
5149
  const subMenus = (_a = activeMenu == null ? void 0 : activeMenu.subMenus) != null ? _a : [];
5080
5150
  const panelVisible = isControlled ? resolvedIsPanelOpen : resolvedIsPanelOpen && subMenus.length > 0;
5081
- const handleSetPanelOpen = React22.useCallback(
5151
+ const handleSetPanelOpen = React23.useCallback(
5082
5152
  (open) => {
5083
5153
  if (!isControlled) setInternalIsPanelOpen(open);
5084
5154
  onPanelOpenChange == null ? void 0 : onPanelOpenChange(open);
5085
5155
  },
5086
5156
  [isControlled, onPanelOpenChange]
5087
5157
  );
5088
- const prevPanelVisibleRef = React22.useRef(null);
5089
- React22.useEffect(() => {
5158
+ const prevPanelVisibleRef = React23.useRef(null);
5159
+ React23.useEffect(() => {
5090
5160
  if (prevPanelVisibleRef.current !== panelVisible) {
5091
5161
  prevPanelVisibleRef.current = panelVisible;
5092
5162
  onPanelOpenChange == null ? void 0 : onPanelOpenChange(panelVisible);
@@ -5174,7 +5244,7 @@ function Sidebar({
5174
5244
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex flex-col flex-1 items-center justify-end min-h-0 min-w-0 px-4 py-3 gap-3 w-full", children: utilities == null ? void 0 : utilities.map((util) => {
5175
5245
  var _a2, _b2;
5176
5246
  if (util.popover) {
5177
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(React22.Fragment, { children: util.popover }, util.id);
5247
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(React23.Fragment, { children: util.popover }, util.id);
5178
5248
  }
5179
5249
  return util.href ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
5180
5250
  Tooltip,
@@ -5333,10 +5403,10 @@ function Skeleton(_a) {
5333
5403
  }
5334
5404
 
5335
5405
  // src/components/ui/slider.tsx
5336
- var React23 = __toESM(require("react"));
5406
+ var React24 = __toESM(require("react"));
5337
5407
  var import_radix_ui14 = require("radix-ui");
5338
5408
  var import_jsx_runtime43 = require("react/jsx-runtime");
5339
- var Slider = React23.forwardRef(
5409
+ var Slider = React24.forwardRef(
5340
5410
  (_a, ref) => {
5341
5411
  var _b = _a, {
5342
5412
  className,
@@ -5356,15 +5426,15 @@ var Slider = React23.forwardRef(
5356
5426
  "onValueCommit"
5357
5427
  ]);
5358
5428
  var _a2;
5359
- const [displayValues, setDisplayValues] = React23.useState(
5429
+ const [displayValues, setDisplayValues] = React24.useState(
5360
5430
  (_a2 = valueProp != null ? valueProp : defaultValue) != null ? _a2 : [0]
5361
5431
  );
5362
- const [visibleSet, setVisibleSet] = React23.useState(/* @__PURE__ */ new Set());
5363
- const hideTimers = React23.useRef(/* @__PURE__ */ new Map());
5364
- React23.useEffect(() => {
5432
+ const [visibleSet, setVisibleSet] = React24.useState(/* @__PURE__ */ new Set());
5433
+ const hideTimers = React24.useRef(/* @__PURE__ */ new Map());
5434
+ React24.useEffect(() => {
5365
5435
  if (valueProp !== void 0) setDisplayValues(valueProp);
5366
5436
  }, [valueProp]);
5367
- React23.useEffect(
5437
+ React24.useEffect(
5368
5438
  () => () => hideTimers.current.forEach((t) => clearTimeout(t)),
5369
5439
  []
5370
5440
  );
@@ -5384,7 +5454,7 @@ var Slider = React23.forwardRef(
5384
5454
  }, delay);
5385
5455
  hideTimers.current.set(i, t);
5386
5456
  };
5387
- const prevValuesRef = React23.useRef(displayValues);
5457
+ const prevValuesRef = React24.useRef(displayValues);
5388
5458
  const handleValueChange = (newVals) => {
5389
5459
  newVals.forEach((v, i) => {
5390
5460
  if (v !== prevValuesRef.current[i]) showThumb(i);
@@ -5866,17 +5936,17 @@ function SwitchField(_a) {
5866
5936
  }
5867
5937
 
5868
5938
  // src/components/ui/table.tsx
5869
- var React26 = __toESM(require("react"));
5939
+ var React27 = __toESM(require("react"));
5870
5940
  var import_react_table = require("@tanstack/react-table");
5871
5941
  var import_jsx_runtime50 = require("react/jsx-runtime");
5872
5942
  function EllipsisCell({ rendered, tooltip }) {
5873
- const [el, setEl] = React26.useState(null);
5874
- const [overflowing, setOverflowing] = React26.useState(false);
5943
+ const [el, setEl] = React27.useState(null);
5944
+ const [overflowing, setOverflowing] = React27.useState(false);
5875
5945
  const isPrimitiveText = typeof rendered === "string" || typeof rendered === "number";
5876
- const refCallback = React26.useCallback((node) => {
5946
+ const refCallback = React27.useCallback((node) => {
5877
5947
  setEl(node);
5878
5948
  }, []);
5879
- React26.useLayoutEffect(() => {
5949
+ React27.useLayoutEffect(() => {
5880
5950
  if (!el) return;
5881
5951
  const check = () => {
5882
5952
  const selfOverflow = el.scrollWidth > el.clientWidth;
@@ -6055,11 +6125,11 @@ function Table({
6055
6125
  className
6056
6126
  }) {
6057
6127
  var _a, _b, _c;
6058
- const getRowKey = React26.useCallback(
6128
+ const getRowKey = React27.useCallback(
6059
6129
  (row) => typeof rowKey === "function" ? rowKey(row) : String(row[rowKey]),
6060
6130
  [rowKey]
6061
6131
  );
6062
- const [internalRowSelection, setInternalRowSelection] = React26.useState({});
6132
+ const [internalRowSelection, setInternalRowSelection] = React27.useState({});
6063
6133
  const isControlledSelection = rowSelectionProp !== void 0;
6064
6134
  const effectiveRowSelection = isControlledSelection ? rowSelectionProp : internalRowSelection;
6065
6135
  const handleRowSelectionChange = (updater) => {
@@ -6070,7 +6140,7 @@ function Table({
6070
6140
  }
6071
6141
  onRowSelectionChange == null ? void 0 : onRowSelectionChange(updater);
6072
6142
  };
6073
- const [sorting, setSorting] = React26.useState(
6143
+ const [sorting, setSorting] = React27.useState(
6074
6144
  () => {
6075
6145
  var _a2;
6076
6146
  return (_a2 = defaultSorting == null ? void 0 : defaultSorting.map(({ key, desc }) => ({
@@ -6079,7 +6149,7 @@ function Table({
6079
6149
  }))) != null ? _a2 : [];
6080
6150
  }
6081
6151
  );
6082
- const handleSortingChange = React26.useCallback(
6152
+ const handleSortingChange = React27.useCallback(
6083
6153
  (updater) => {
6084
6154
  setSorting((prev) => {
6085
6155
  const next = typeof updater === "function" ? updater(prev) : updater;
@@ -6089,11 +6159,11 @@ function Table({
6089
6159
  },
6090
6160
  [onSortingChange]
6091
6161
  );
6092
- const [internalPagination, setInternalPagination] = React26.useState({
6162
+ const [internalPagination, setInternalPagination] = React27.useState({
6093
6163
  pageIndex: ((_a = pagination == null ? void 0 : pagination.currentPage) != null ? _a : 1) - 1,
6094
6164
  pageSize: (_b = pagination == null ? void 0 : pagination.pageSize) != null ? _b : 10
6095
6165
  });
6096
- React26.useEffect(() => {
6166
+ React27.useEffect(() => {
6097
6167
  if ((pagination == null ? void 0 : pagination.currentPage) !== void 0) {
6098
6168
  setInternalPagination((prev) => __spreadProps(__spreadValues({}, prev), {
6099
6169
  pageIndex: pagination.currentPage - 1
@@ -6107,7 +6177,7 @@ function Table({
6107
6177
  (_a2 = pagination == null ? void 0 : pagination.onPageChange) == null ? void 0 : _a2.call(pagination, next.pageIndex + 1);
6108
6178
  };
6109
6179
  const isSelectionActive = enableRowSelection === true;
6110
- const selectionColumn = React26.useMemo(
6180
+ const selectionColumn = React27.useMemo(
6111
6181
  () => ({
6112
6182
  id: "__select__",
6113
6183
  header: "__select_header__",
@@ -6125,7 +6195,7 @@ function Table({
6125
6195
  }),
6126
6196
  []
6127
6197
  );
6128
- const rowActionsColumn = React26.useMemo(
6198
+ const rowActionsColumn = React27.useMemo(
6129
6199
  () => ({
6130
6200
  id: "__row_actions__",
6131
6201
  header: "",
@@ -6134,7 +6204,7 @@ function Table({
6134
6204
  }),
6135
6205
  [rowActions]
6136
6206
  );
6137
- const tanstackColumns = React26.useMemo(
6207
+ const tanstackColumns = React27.useMemo(
6138
6208
  () => [
6139
6209
  ...isSelectionActive ? [selectionColumn] : [],
6140
6210
  ...columns.map((col) => {
@@ -6173,7 +6243,7 @@ function Table({
6173
6243
  }), (pagination == null ? void 0 : pagination.rowCount) !== void 0 && {
6174
6244
  rowCount: pagination.rowCount
6175
6245
  }));
6176
- const colMap = React26.useMemo(
6246
+ const colMap = React27.useMemo(
6177
6247
  () => Object.fromEntries(
6178
6248
  columns.map((c) => {
6179
6249
  var _a2, _b2, _c2, _d;
@@ -6353,12 +6423,12 @@ function Table({
6353
6423
  }
6354
6424
 
6355
6425
  // src/components/ui/user-message-bubble.tsx
6356
- var React27 = __toESM(require("react"));
6426
+ var React28 = __toESM(require("react"));
6357
6427
  var import_jsx_runtime51 = require("react/jsx-runtime");
6358
6428
  function UserMessageBubble({ content }) {
6359
- const textRef = React27.useRef(null);
6360
- const [multiLine, setMultiLine] = React27.useState(false);
6361
- React27.useEffect(() => {
6429
+ const textRef = React28.useRef(null);
6430
+ const [multiLine, setMultiLine] = React28.useState(false);
6431
+ React28.useEffect(() => {
6362
6432
  const el = textRef.current;
6363
6433
  if (!el) return;
6364
6434
  const check = () => setMultiLine(el.offsetHeight > 28);