asterui 0.12.29 → 0.12.31
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/chart.d.ts +2 -0
- package/dist/chart.js +5 -0
- package/dist/chart.js.map +1 -0
- package/dist/{index2.js → components/Affix.js} +1 -1
- package/dist/components/Affix.js.map +1 -0
- package/dist/{index4.js → components/Alert.js} +1 -1
- package/dist/components/Alert.js.map +1 -0
- package/dist/{index3.js → components/Anchor.js} +1 -1
- package/dist/components/Anchor.js.map +1 -0
- package/dist/{index5.js → components/Autocomplete.js} +1 -1
- package/dist/components/Autocomplete.js.map +1 -0
- package/dist/{index6.js → components/Avatar.js} +1 -1
- package/dist/components/Avatar.js.map +1 -0
- package/dist/{index7.js → components/Badge.js} +1 -1
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Breadcrumb.js +38 -0
- package/dist/components/Breadcrumb.js.map +1 -0
- package/dist/{index53.js → components/Browser.js} +1 -1
- package/dist/components/Browser.js.map +1 -0
- package/dist/{index9.js → components/Button.js} +1 -1
- package/dist/components/Button.js.map +1 -0
- package/dist/{index14.js → components/Card.js} +22 -22
- package/dist/{index14.js.map → components/Card.js.map} +1 -1
- package/dist/{index17.js → components/Carousel.js} +1 -1
- package/dist/components/Carousel.js.map +1 -0
- package/dist/{index15.js → components/Cascader.js} +1 -1
- package/dist/components/Cascader.js.map +1 -0
- package/dist/{index16.js → components/Chart.js} +1 -1
- package/dist/components/Chart.js.map +1 -0
- package/dist/{index12.js → components/Chat.js} +1 -1
- package/dist/{index12.js.map → components/Chat.js.map} +1 -1
- package/dist/{index11.js → components/Checkbox.js} +15 -15
- package/dist/components/Checkbox.js.map +1 -0
- package/dist/{index54.js → components/Code.js} +5 -5
- package/dist/{index54.js.map → components/Code.js.map} +1 -1
- package/dist/{index18.js → components/Collapse.js} +1 -1
- package/dist/components/Collapse.js.map +1 -0
- package/dist/components/ColorPicker.d.ts +8 -2
- package/dist/components/ColorPicker.js +366 -0
- package/dist/components/ColorPicker.js.map +1 -0
- package/dist/{index19.js → components/Container.js} +1 -1
- package/dist/components/Container.js.map +1 -0
- package/dist/{index20.js → components/ContextMenu.js} +9 -9
- package/dist/components/ContextMenu.js.map +1 -0
- package/dist/{index10.js → components/CopyButton.js} +2 -2
- package/dist/components/CopyButton.js.map +1 -0
- package/dist/{index21.js → components/Countdown.js} +1 -1
- package/dist/components/Countdown.js.map +1 -0
- package/dist/{index22.js → components/DatePicker.js} +2 -2
- package/dist/components/DatePicker.js.map +1 -0
- package/dist/{index23.js → components/Descriptions.js} +23 -23
- package/dist/components/Descriptions.js.map +1 -0
- package/dist/{index24.js → components/Diff.js} +1 -1
- package/dist/{index24.js.map → components/Diff.js.map} +1 -1
- package/dist/{index26.js → components/Divider.js} +1 -1
- package/dist/components/Divider.js.map +1 -0
- package/dist/{index25.js → components/Dock.js} +1 -1
- package/dist/{index25.js.map → components/Dock.js.map} +1 -1
- package/dist/{index27.js → components/Drawer.js} +1 -1
- package/dist/components/Drawer.js.map +1 -0
- package/dist/{index40.js → components/Dropdown.js} +31 -31
- package/dist/components/Dropdown.js.map +1 -0
- package/dist/{index41.js → components/Empty.js} +1 -1
- package/dist/components/Empty.js.map +1 -0
- package/dist/{index29.js → components/Fieldset.js} +1 -1
- package/dist/components/Fieldset.js.map +1 -0
- package/dist/{index30.js → components/FileInput.js} +1 -1
- package/dist/components/FileInput.js.map +1 -0
- package/dist/{index31.js → components/Filter.js} +1 -1
- package/dist/components/Filter.js.map +1 -0
- package/dist/{index32.js → components/Flex.js} +1 -1
- package/dist/{index32.js.map → components/Flex.js.map} +1 -1
- package/dist/{index33.js → components/FloatButton.js} +1 -1
- package/dist/components/FloatButton.js.map +1 -0
- package/dist/{index34.js → components/Footer.js} +1 -1
- package/dist/components/Footer.js.map +1 -0
- package/dist/{index35.js → components/Form.js} +1 -1
- package/dist/{index35.js.map → components/Form.js.map} +1 -1
- package/dist/{index36.js → components/Grid.js} +6 -6
- package/dist/{index36.js.map → components/Grid.js.map} +1 -1
- package/dist/{index37.js → components/Hero.js} +1 -1
- package/dist/{index37.js.map → components/Hero.js.map} +1 -1
- package/dist/{index38.js → components/HoverGallery.js} +1 -1
- package/dist/components/HoverGallery.js.map +1 -0
- package/dist/{index39.js → components/Image.js} +1 -1
- package/dist/components/Image.js.map +1 -0
- package/dist/{index42.js → components/Input.js} +1 -1
- package/dist/components/Input.js.map +1 -0
- package/dist/{index43.js → components/InputNumber.js} +1 -1
- package/dist/components/InputNumber.js.map +1 -0
- package/dist/components/Join.js +18 -0
- package/dist/{index44.js.map → components/Join.js.map} +1 -1
- package/dist/{index45.js → components/Kbd.js} +1 -1
- package/dist/components/Kbd.js.map +1 -0
- package/dist/{index46.js → components/Layout.js} +16 -16
- package/dist/components/Layout.js.map +1 -0
- package/dist/{index47.js → components/List.js} +17 -17
- package/dist/{index47.js.map → components/List.js.map} +1 -1
- package/dist/{index48.js → components/Loading.js} +1 -1
- package/dist/components/Loading.js.map +1 -0
- package/dist/{index49.js → components/Mask.js} +1 -1
- package/dist/{index49.js.map → components/Mask.js.map} +1 -1
- package/dist/{index50.js → components/Masonry.js} +19 -19
- package/dist/components/Masonry.js.map +1 -0
- package/dist/{index51.js → components/Mention.js} +1 -1
- package/dist/components/Mention.js.map +1 -0
- package/dist/{index52.js → components/Menu.js} +1 -1
- package/dist/{index52.js.map → components/Menu.js.map} +1 -1
- package/dist/{index57.js → components/Modal.js} +23 -23
- package/dist/components/Modal.js.map +1 -0
- package/dist/{index58.js → components/Navbar.js} +1 -1
- package/dist/components/Navbar.js.map +1 -0
- package/dist/{index59.js → components/Notification.js} +1 -1
- package/dist/components/Notification.js.map +1 -0
- package/dist/{index60.js → components/OTPInput.js} +1 -1
- package/dist/components/OTPInput.js.map +1 -0
- package/dist/{index62.js → components/PageLayout.js} +1 -1
- package/dist/components/PageLayout.js.map +1 -0
- package/dist/{index61.js → components/Pagination.js} +18 -18
- package/dist/components/Pagination.js.map +1 -0
- package/dist/{index55.js → components/Phone.js} +1 -1
- package/dist/components/Phone.js.map +1 -0
- package/dist/{index63.js → components/Popconfirm.js} +14 -14
- package/dist/components/Popconfirm.js.map +1 -0
- package/dist/{index64.js → components/Popover.js} +1 -1
- package/dist/components/Popover.js.map +1 -0
- package/dist/{index65.js → components/Progress.js} +1 -1
- package/dist/components/Progress.js.map +1 -0
- package/dist/{index66.js → components/QRCode.js} +1 -1
- package/dist/components/QRCode.js.map +1 -0
- package/dist/{index68.js → components/RadialProgress.js} +1 -1
- package/dist/components/RadialProgress.js.map +1 -0
- package/dist/{index67.js → components/Radio.js} +13 -13
- package/dist/components/Radio.js.map +1 -0
- package/dist/{index69.js → components/Range.js} +1 -1
- package/dist/components/Range.js.map +1 -0
- package/dist/{index70.js → components/Rating.js} +20 -20
- package/dist/components/Rating.js.map +1 -0
- package/dist/{index98.js → components/Responsive.js} +2 -2
- package/dist/components/Responsive.js.map +1 -0
- package/dist/{index71.js → components/Result.js} +1 -1
- package/dist/components/Result.js.map +1 -0
- package/dist/{index73.js → components/Segmented.js} +1 -1
- package/dist/components/Segmented.js.map +1 -0
- package/dist/{index72.js → components/Select.js} +1 -1
- package/dist/components/Select.js.map +1 -0
- package/dist/{index28.js → components/SidebarDrawer.js} +3 -3
- package/dist/components/SidebarDrawer.js.map +1 -0
- package/dist/{index74.js → components/Skeleton.js} +1 -1
- package/dist/components/Skeleton.js.map +1 -0
- package/dist/components/Space.js +61 -0
- package/dist/components/Space.js.map +1 -0
- package/dist/{index76.js → components/Splitter.js} +22 -22
- package/dist/components/Splitter.js.map +1 -0
- package/dist/{index77.js → components/Stat.js} +1 -1
- package/dist/{index77.js.map → components/Stat.js.map} +1 -1
- package/dist/{index78.js → components/Status.js} +1 -1
- package/dist/components/Status.js.map +1 -0
- package/dist/{index79.js → components/Steps.js} +14 -14
- package/dist/components/Steps.js.map +1 -0
- package/dist/{index80.js → components/Table.js} +92 -92
- package/dist/components/Table.js.map +1 -0
- package/dist/components/Tabs.js +83 -0
- package/dist/{index81.js.map → components/Tabs.js.map} +1 -1
- package/dist/{index84.js → components/Tag.js} +1 -1
- package/dist/components/Tag.js.map +1 -0
- package/dist/{index83.js → components/TextRotate.js} +1 -1
- package/dist/components/TextRotate.js.map +1 -0
- package/dist/{index82.js → components/Textarea.js} +1 -1
- package/dist/components/Textarea.js.map +1 -0
- package/dist/{index85.js → components/ThemeController.js} +1 -1
- package/dist/components/ThemeController.js.map +1 -0
- package/dist/{index86.js → components/TimePicker.js} +2 -2
- package/dist/components/TimePicker.js.map +1 -0
- package/dist/{index87.js → components/Timeline.js} +13 -13
- package/dist/components/Timeline.js.map +1 -0
- package/dist/{index88.js → components/Toggle.js} +1 -1
- package/dist/components/Toggle.js.map +1 -0
- package/dist/{index90.js → components/Tooltip.js} +1 -1
- package/dist/components/Tooltip.js.map +1 -0
- package/dist/{index89.js → components/Tour.js} +1 -1
- package/dist/{index89.js.map → components/Tour.js.map} +1 -1
- package/dist/{index91.js → components/Transfer.js} +1 -1
- package/dist/components/Transfer.js.map +1 -0
- package/dist/{index92.js → components/Tree.js} +1 -1
- package/dist/{index92.js.map → components/Tree.js.map} +1 -1
- package/dist/{index93.js → components/TreeSelect.js} +44 -44
- package/dist/components/TreeSelect.js.map +1 -0
- package/dist/{index94.js → components/Typography.js} +1 -1
- package/dist/components/Typography.js.map +1 -0
- package/dist/{index95.js → components/Upload.js} +1 -1
- package/dist/components/Upload.js.map +1 -0
- package/dist/{index96.js → components/VirtualList.js} +2 -2
- package/dist/components/VirtualList.js.map +1 -0
- package/dist/{index97.js → components/Watermark.js} +1 -1
- package/dist/components/Watermark.js.map +1 -0
- package/dist/{index56.js → components/Window.js} +1 -1
- package/dist/components/Window.js.map +1 -0
- package/dist/{index99.js → hooks/useBreakpoint.js} +1 -1
- package/dist/hooks/useBreakpoint.js.map +1 -0
- package/dist/{index104.js → hooks/useClickOutside.js} +1 -1
- package/dist/hooks/useClickOutside.js.map +1 -0
- package/dist/{index101.js → hooks/useClipboard.js} +1 -1
- package/dist/hooks/useClipboard.js.map +1 -0
- package/dist/{index103.js → hooks/useDebounce.js} +1 -1
- package/dist/hooks/useDebounce.js.map +1 -0
- package/dist/{index100.js → hooks/useDisclosure.js} +1 -1
- package/dist/hooks/useDisclosure.js.map +1 -0
- package/dist/{index106.js → hooks/useHover.js} +1 -1
- package/dist/hooks/useHover.js.map +1 -0
- package/dist/{index107.js → hooks/useKeyPress.js} +1 -1
- package/dist/hooks/useKeyPress.js.map +1 -0
- package/dist/{index102.js → hooks/useLocalStorage.js} +1 -1
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/{index105.js → hooks/usePrevious.js} +1 -1
- package/dist/hooks/usePrevious.js.map +1 -0
- package/dist/{index108.js → hooks/useWindowSize.js} +1 -1
- package/dist/hooks/useWindowSize.js.map +1 -0
- package/dist/index.d.ts +1 -7
- package/dist/index.js +204 -210
- package/dist/index.js.map +1 -1
- package/dist/qrcode.d.ts +2 -0
- package/dist/qrcode.js +5 -0
- package/dist/qrcode.js.map +1 -0
- package/dist/virtuallist.d.ts +2 -0
- package/dist/virtuallist.js +5 -0
- package/dist/virtuallist.js.map +1 -0
- package/package.json +13 -1
- package/dist/index10.js.map +0 -1
- package/dist/index100.js.map +0 -1
- package/dist/index101.js.map +0 -1
- package/dist/index102.js.map +0 -1
- package/dist/index103.js.map +0 -1
- package/dist/index104.js.map +0 -1
- package/dist/index105.js.map +0 -1
- package/dist/index106.js.map +0 -1
- package/dist/index107.js.map +0 -1
- package/dist/index108.js.map +0 -1
- package/dist/index109.js +0 -36
- package/dist/index109.js.map +0 -1
- package/dist/index11.js.map +0 -1
- package/dist/index110.js +0 -523
- package/dist/index110.js.map +0 -1
- package/dist/index111.js +0 -53
- package/dist/index111.js.map +0 -1
- package/dist/index13.js +0 -268
- package/dist/index13.js.map +0 -1
- package/dist/index15.js.map +0 -1
- package/dist/index16.js.map +0 -1
- package/dist/index17.js.map +0 -1
- package/dist/index18.js.map +0 -1
- package/dist/index19.js.map +0 -1
- package/dist/index2.js.map +0 -1
- package/dist/index20.js.map +0 -1
- package/dist/index21.js.map +0 -1
- package/dist/index22.js.map +0 -1
- package/dist/index23.js.map +0 -1
- package/dist/index26.js.map +0 -1
- package/dist/index27.js.map +0 -1
- package/dist/index28.js.map +0 -1
- package/dist/index29.js.map +0 -1
- package/dist/index3.js.map +0 -1
- package/dist/index30.js.map +0 -1
- package/dist/index31.js.map +0 -1
- package/dist/index33.js.map +0 -1
- package/dist/index34.js.map +0 -1
- package/dist/index38.js.map +0 -1
- package/dist/index39.js.map +0 -1
- package/dist/index4.js.map +0 -1
- package/dist/index40.js.map +0 -1
- package/dist/index41.js.map +0 -1
- package/dist/index42.js.map +0 -1
- package/dist/index43.js.map +0 -1
- package/dist/index44.js +0 -18
- package/dist/index45.js.map +0 -1
- package/dist/index46.js.map +0 -1
- package/dist/index48.js.map +0 -1
- package/dist/index5.js.map +0 -1
- package/dist/index50.js.map +0 -1
- package/dist/index51.js.map +0 -1
- package/dist/index53.js.map +0 -1
- package/dist/index55.js.map +0 -1
- package/dist/index56.js.map +0 -1
- package/dist/index57.js.map +0 -1
- package/dist/index58.js.map +0 -1
- package/dist/index59.js.map +0 -1
- package/dist/index6.js.map +0 -1
- package/dist/index60.js.map +0 -1
- package/dist/index61.js.map +0 -1
- package/dist/index62.js.map +0 -1
- package/dist/index63.js.map +0 -1
- package/dist/index64.js.map +0 -1
- package/dist/index65.js.map +0 -1
- package/dist/index66.js.map +0 -1
- package/dist/index67.js.map +0 -1
- package/dist/index68.js.map +0 -1
- package/dist/index69.js.map +0 -1
- package/dist/index7.js.map +0 -1
- package/dist/index70.js.map +0 -1
- package/dist/index71.js.map +0 -1
- package/dist/index72.js.map +0 -1
- package/dist/index73.js.map +0 -1
- package/dist/index74.js.map +0 -1
- package/dist/index75.js +0 -61
- package/dist/index75.js.map +0 -1
- package/dist/index76.js.map +0 -1
- package/dist/index78.js.map +0 -1
- package/dist/index79.js.map +0 -1
- package/dist/index8.js +0 -38
- package/dist/index8.js.map +0 -1
- package/dist/index80.js.map +0 -1
- package/dist/index81.js +0 -83
- package/dist/index82.js.map +0 -1
- package/dist/index83.js.map +0 -1
- package/dist/index84.js.map +0 -1
- package/dist/index85.js.map +0 -1
- package/dist/index86.js.map +0 -1
- package/dist/index87.js.map +0 -1
- package/dist/index88.js.map +0 -1
- package/dist/index9.js.map +0 -1
- package/dist/index90.js.map +0 -1
- package/dist/index91.js.map +0 -1
- package/dist/index93.js.map +0 -1
- package/dist/index94.js.map +0 -1
- package/dist/index95.js.map +0 -1
- package/dist/index96.js.map +0 -1
- package/dist/index97.js.map +0 -1
- package/dist/index98.js.map +0 -1
- package/dist/index99.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker.js","sources":["../../src/components/DatePicker.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\nimport { Input } from './Input'\n\nexport interface DatePickerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n value?: Date | null\n defaultValue?: Date | null\n onChange?: (date: Date | null) => void\n format?: string\n placeholder?: string\n disabled?: boolean\n size?: 'xs' | 'sm' | 'md' | 'lg'\n}\n\nconst DAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']\nconst MONTHS = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n]\n\nfunction formatDate(date: Date | null, format: string = 'MM/DD/YYYY'): string {\n if (!date) return ''\n\n const year = date.getFullYear()\n const month = String(date.getMonth() + 1).padStart(2, '0')\n const day = String(date.getDate()).padStart(2, '0')\n\n return format\n .replace('YYYY', String(year))\n .replace('MM', month)\n .replace('DD', day)\n}\n\nfunction getDaysInMonth(year: number, month: number): number {\n return new Date(year, month + 1, 0).getDate()\n}\n\nfunction getFirstDayOfMonth(year: number, month: number): number {\n return new Date(year, month, 1).getDay()\n}\n\nexport const DatePicker: React.FC<DatePickerProps> = ({\n value,\n defaultValue,\n onChange,\n format,\n placeholder = 'Select date',\n disabled = false,\n className = '',\n size = 'md',\n ...rest\n}) => {\n const [selectedDate, setSelectedDate] = useState<Date | null>(\n value || defaultValue || null\n )\n const [isOpen, setIsOpen] = useState(false)\n const [viewMonth, setViewMonth] = useState(\n selectedDate ? selectedDate.getMonth() : new Date().getMonth()\n )\n const [viewYear, setViewYear] = useState(\n selectedDate ? selectedDate.getFullYear() : new Date().getFullYear()\n )\n\n const containerRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (value !== undefined) {\n setSelectedDate(value)\n }\n }, [value])\n\n useEffect(() => {\n function handleClickOutside(event: MouseEvent) {\n if (containerRef.current && !containerRef.current.contains(event.target as Node)) {\n setIsOpen(false)\n }\n }\n\n if (isOpen) {\n document.addEventListener('mousedown', handleClickOutside)\n return () => document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [isOpen])\n\n const handleDateSelect = (day: number) => {\n const newDate = new Date(viewYear, viewMonth, day)\n setSelectedDate(newDate)\n onChange?.(newDate)\n setIsOpen(false)\n }\n\n const handlePrevMonth = () => {\n if (viewMonth === 0) {\n setViewMonth(11)\n setViewYear(viewYear - 1)\n } else {\n setViewMonth(viewMonth - 1)\n }\n }\n\n const handleNextMonth = () => {\n if (viewMonth === 11) {\n setViewMonth(0)\n setViewYear(viewYear + 1)\n } else {\n setViewMonth(viewMonth + 1)\n }\n }\n\n const daysInMonth = getDaysInMonth(viewYear, viewMonth)\n const firstDayOfMonth = getFirstDayOfMonth(viewYear, viewMonth)\n\n const calendarDays: (number | null)[] = []\n for (let i = 0; i < firstDayOfMonth; i++) {\n calendarDays.push(null)\n }\n for (let i = 1; i <= daysInMonth; i++) {\n calendarDays.push(i)\n }\n\n const isSelectedDay = (day: number | null): boolean => {\n if (!day || !selectedDate) return false\n return (\n selectedDate.getDate() === day &&\n selectedDate.getMonth() === viewMonth &&\n selectedDate.getFullYear() === viewYear\n )\n }\n\n const isToday = (day: number | null): boolean => {\n if (!day) return false\n const today = new Date()\n return (\n today.getDate() === day &&\n today.getMonth() === viewMonth &&\n today.getFullYear() === viewYear\n )\n }\n\n return (\n <div ref={containerRef} className={`relative ${className}`} data-state={isOpen ? 'open' : 'closed'} {...rest}>\n <Input\n value={formatDate(selectedDate, format)}\n placeholder={placeholder}\n disabled={disabled}\n size={size}\n readOnly\n onClick={() => !disabled && setIsOpen(!isOpen)}\n className=\"cursor-pointer\"\n />\n\n {isOpen && (\n <div className=\"absolute top-full left-0 mt-2 bg-base-100 border border-base-300 rounded-lg shadow-lg p-4 z-50 w-80\">\n {/* Header */}\n <div className=\"flex items-center justify-between mb-4\">\n <button\n type=\"button\"\n onClick={handlePrevMonth}\n className=\"btn btn-ghost btn-sm btn-square\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-5 w-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </button>\n\n <div className=\"text-base font-semibold\">\n {MONTHS[viewMonth]} {viewYear}\n </div>\n\n <button\n type=\"button\"\n onClick={handleNextMonth}\n className=\"btn btn-ghost btn-sm btn-square\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-5 w-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </button>\n </div>\n\n {/* Days of week */}\n <div className=\"grid grid-cols-7 gap-1 mb-2\">\n {DAYS.map((day) => (\n <div\n key={day}\n className=\"text-center text-xs font-semibold text-base-content/60 py-2\"\n >\n {day}\n </div>\n ))}\n </div>\n\n {/* Calendar grid */}\n <div className=\"grid grid-cols-7 gap-1\">\n {calendarDays.map((day, index) => (\n <button\n key={index}\n type=\"button\"\n disabled={!day}\n onClick={() => day && handleDateSelect(day)}\n className={`\n aspect-square flex items-center justify-center text-sm rounded-lg\n ${!day ? 'invisible' : 'hover:bg-base-200'}\n ${isSelectedDay(day) ? 'bg-primary text-primary-content hover:bg-primary/90' : ''}\n ${isToday(day) && !isSelectedDay(day) ? 'border border-primary' : ''}\n ${day ? 'cursor-pointer' : ''}\n `}\n >\n {day}\n </button>\n ))}\n </div>\n\n {/* Today button */}\n <div className=\"mt-4 flex justify-end\">\n <button\n type=\"button\"\n onClick={() => {\n const today = new Date()\n setSelectedDate(today)\n setViewMonth(today.getMonth())\n setViewYear(today.getFullYear())\n onChange?.(today)\n setIsOpen(false)\n }}\n className=\"btn btn-ghost btn-sm\"\n >\n Today\n </button>\n </div>\n </div>\n )}\n </div>\n )\n}\n"],"names":["DAYS","MONTHS","formatDate","date","format","year","month","day","getDaysInMonth","getFirstDayOfMonth","DatePicker","value","defaultValue","onChange","placeholder","disabled","className","size","rest","selectedDate","setSelectedDate","useState","isOpen","setIsOpen","viewMonth","setViewMonth","viewYear","setViewYear","containerRef","useRef","useEffect","handleClickOutside","event","handleDateSelect","newDate","handlePrevMonth","handleNextMonth","daysInMonth","firstDayOfMonth","calendarDays","i","isSelectedDay","isToday","today","jsxs","jsx","Input","index"],"mappings":";;;AAaA,MAAMA,IAAO,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,IAAI,GAChDC,IAAS;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAASC,EAAWC,GAAmBC,IAAiB,cAAsB;AAC5E,MAAI,CAACD,EAAM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AA,MAAA,EAED,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import y, { forwardRef as
|
|
3
|
-
function
|
|
2
|
+
import y, { forwardRef as B } from "react";
|
|
3
|
+
function H(c) {
|
|
4
4
|
return null;
|
|
5
5
|
}
|
|
6
|
-
const
|
|
6
|
+
const O = {
|
|
7
7
|
sm: "text-sm",
|
|
8
8
|
md: "text-base",
|
|
9
9
|
lg: "text-lg"
|
|
10
|
-
}, N =
|
|
10
|
+
}, N = B(
|
|
11
11
|
({
|
|
12
12
|
title: c,
|
|
13
13
|
extra: S,
|
|
@@ -22,7 +22,7 @@ const H = {
|
|
|
22
22
|
className: M = "",
|
|
23
23
|
style: R,
|
|
24
24
|
children: D,
|
|
25
|
-
"data-testid":
|
|
25
|
+
"data-testid": u = "descriptions",
|
|
26
26
|
...L
|
|
27
27
|
}, z) => {
|
|
28
28
|
const w = C || y.Children.toArray(D).filter(
|
|
@@ -41,12 +41,12 @@ const H = {
|
|
|
41
41
|
l + e > r ? (t.push(s), s = [n], l = e) : (s.push(n), l += e);
|
|
42
42
|
}), s.length > 0 && t.push(s), t.map((n, o) => /* @__PURE__ */ i(y.Fragment, { children: [
|
|
43
43
|
/* @__PURE__ */ a("tr", { children: n.map((e, f) => {
|
|
44
|
-
const h = e.span || 1, p = Math.min(h, r),
|
|
44
|
+
const h = e.span || 1, p = Math.min(h, r), m = e.labelStyle || x;
|
|
45
45
|
return /* @__PURE__ */ i(
|
|
46
46
|
"th",
|
|
47
47
|
{
|
|
48
48
|
className: `${d ? "border border-base-content/10" : ""} bg-base-200/50 font-semibold text-left px-4 py-2`,
|
|
49
|
-
style:
|
|
49
|
+
style: m,
|
|
50
50
|
colSpan: p,
|
|
51
51
|
scope: "col",
|
|
52
52
|
children: [
|
|
@@ -58,12 +58,12 @@ const H = {
|
|
|
58
58
|
);
|
|
59
59
|
}) }),
|
|
60
60
|
/* @__PURE__ */ a("tr", { children: n.map((e, f) => {
|
|
61
|
-
const h = e.span || 1, p = Math.min(h, r),
|
|
61
|
+
const h = e.span || 1, p = Math.min(h, r), m = e.contentStyle || v;
|
|
62
62
|
return /* @__PURE__ */ a(
|
|
63
63
|
"td",
|
|
64
64
|
{
|
|
65
65
|
className: `${d ? "border border-base-content/10" : ""} bg-base-100 px-4 py-2`,
|
|
66
|
-
style:
|
|
66
|
+
style: m,
|
|
67
67
|
colSpan: p,
|
|
68
68
|
children: e.children
|
|
69
69
|
},
|
|
@@ -71,20 +71,20 @@ const H = {
|
|
|
71
71
|
);
|
|
72
72
|
}) })
|
|
73
73
|
] }, o));
|
|
74
|
-
},
|
|
74
|
+
}, F = () => {
|
|
75
75
|
const t = [];
|
|
76
76
|
let s = [], l = 0;
|
|
77
77
|
return w.forEach((n) => {
|
|
78
78
|
const o = n.span || 1, e = Math.min(o, r);
|
|
79
79
|
l + e > r ? (t.push(s), s = [n], l = e) : (s.push(n), l += e);
|
|
80
80
|
}), s.length > 0 && t.push(s), t.map((n, o) => /* @__PURE__ */ a("tr", { children: n.map((e, f) => {
|
|
81
|
-
const h = e.span || 1, p = Math.min(h, r),
|
|
81
|
+
const h = e.span || 1, p = Math.min(h, r), m = e.labelStyle || x, A = e.contentStyle || v;
|
|
82
82
|
return /* @__PURE__ */ i(y.Fragment, { children: [
|
|
83
83
|
/* @__PURE__ */ i(
|
|
84
84
|
"th",
|
|
85
85
|
{
|
|
86
86
|
className: `${d ? "border border-base-content/10" : ""} bg-base-200/50 font-semibold text-left px-4 py-2 whitespace-nowrap`,
|
|
87
|
-
style:
|
|
87
|
+
style: m,
|
|
88
88
|
scope: "row",
|
|
89
89
|
children: [
|
|
90
90
|
e.label,
|
|
@@ -96,17 +96,17 @@ const H = {
|
|
|
96
96
|
"td",
|
|
97
97
|
{
|
|
98
98
|
className: `${d ? "border border-base-content/10" : ""} bg-base-100 px-4 py-2`,
|
|
99
|
-
style:
|
|
99
|
+
style: A,
|
|
100
100
|
colSpan: p > 1 ? p * 2 - 1 : 1,
|
|
101
101
|
children: e.children
|
|
102
102
|
}
|
|
103
103
|
)
|
|
104
104
|
] }, f);
|
|
105
105
|
}) }, o));
|
|
106
|
-
},
|
|
106
|
+
}, V = [
|
|
107
107
|
"w-full",
|
|
108
108
|
d && "border-collapse",
|
|
109
|
-
|
|
109
|
+
O[$],
|
|
110
110
|
M
|
|
111
111
|
].filter(Boolean).join(" ");
|
|
112
112
|
return /* @__PURE__ */ i(
|
|
@@ -114,21 +114,21 @@ const H = {
|
|
|
114
114
|
{
|
|
115
115
|
ref: z,
|
|
116
116
|
style: R,
|
|
117
|
-
"data-testid":
|
|
117
|
+
"data-testid": u,
|
|
118
118
|
...L,
|
|
119
119
|
children: [
|
|
120
|
-
(c || S) && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", "data-testid": `${
|
|
120
|
+
(c || S) && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", "data-testid": `${u}-header`, children: [
|
|
121
121
|
c && /* @__PURE__ */ a("div", { className: "text-lg font-semibold", children: c }),
|
|
122
|
-
S && /* @__PURE__ */ a("div", { "data-testid": `${
|
|
122
|
+
S && /* @__PURE__ */ a("div", { "data-testid": `${u}-extra`, children: S })
|
|
123
123
|
] }),
|
|
124
124
|
/* @__PURE__ */ a(
|
|
125
125
|
"table",
|
|
126
126
|
{
|
|
127
|
-
className:
|
|
127
|
+
className: V,
|
|
128
128
|
role: "table",
|
|
129
129
|
"aria-label": typeof c == "string" ? c : void 0,
|
|
130
|
-
"data-testid": `${
|
|
131
|
-
children: /* @__PURE__ */ a("tbody", { children: j === "vertical" ? E() :
|
|
130
|
+
"data-testid": `${u}-table`,
|
|
131
|
+
children: /* @__PURE__ */ a("tbody", { children: j === "vertical" ? E() : F() })
|
|
132
132
|
}
|
|
133
133
|
)
|
|
134
134
|
]
|
|
@@ -138,10 +138,10 @@ const H = {
|
|
|
138
138
|
);
|
|
139
139
|
N.displayName = "Descriptions";
|
|
140
140
|
const G = Object.assign(N, {
|
|
141
|
-
Item:
|
|
141
|
+
Item: H
|
|
142
142
|
});
|
|
143
143
|
export {
|
|
144
144
|
G as Descriptions,
|
|
145
145
|
G as default
|
|
146
146
|
};
|
|
147
|
-
//# sourceMappingURL=
|
|
147
|
+
//# sourceMappingURL=Descriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Descriptions.js","sources":["../../src/components/Descriptions.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nexport type DescriptionsSize = 'sm' | 'md' | 'lg'\nexport type DescriptionsLayout = 'horizontal' | 'vertical'\n\nexport interface DescriptionsItemProps {\n /** Label for the item */\n label?: React.ReactNode\n /** Number of columns to span */\n span?: number\n /** Content of the item */\n children?: React.ReactNode\n /** Custom label styles */\n labelStyle?: React.CSSProperties\n /** Custom content styles */\n contentStyle?: React.CSSProperties\n}\n\n/** Item configuration for the items prop */\nexport interface DescriptionsItemConfig {\n /** Label for the item */\n label: React.ReactNode\n /** Content of the item */\n children: React.ReactNode\n /** Number of columns to span */\n span?: number\n /** Custom label styles */\n labelStyle?: React.CSSProperties\n /** Custom content styles */\n contentStyle?: React.CSSProperties\n}\n\nexport interface DescriptionsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Title of the descriptions block */\n title?: React.ReactNode\n /** Extra content in the top-right corner */\n extra?: React.ReactNode\n /** Show borders around cells */\n bordered?: boolean\n /** Number of columns (or responsive config) */\n column?: number | {\n xs?: number\n sm?: number\n md?: number\n lg?: number\n xl?: number\n '2xl'?: number\n }\n /** Size variant */\n size?: DescriptionsSize\n /** Layout direction */\n layout?: DescriptionsLayout\n /** Show colon after labels */\n colon?: boolean\n /** Default label styles */\n labelStyle?: React.CSSProperties\n /** Default content styles */\n contentStyle?: React.CSSProperties\n /** Item configurations (alternative to children) */\n items?: DescriptionsItemConfig[]\n /** Children (Descriptions.Item elements) */\n children?: React.ReactNode\n /** Test ID for the component */\n 'data-testid'?: string\n}\n\nfunction DescriptionsItem(_props: DescriptionsItemProps) {\n return null\n}\n\nconst sizeClasses: Record<DescriptionsSize, string> = {\n sm: 'text-sm',\n md: 'text-base',\n lg: 'text-lg',\n}\n\nconst DescriptionsRoot = forwardRef<HTMLDivElement, DescriptionsProps>(\n (\n {\n title,\n extra,\n bordered = false,\n column = 3,\n size = 'md',\n layout = 'horizontal',\n colon = true,\n labelStyle,\n contentStyle,\n items: itemsProp,\n className = '',\n style,\n children,\n 'data-testid': testId = 'descriptions',\n ...rest\n },\n ref\n ) => {\n // Convert children to item configs, or use items prop\n const itemConfigs: DescriptionsItemConfig[] = itemsProp\n ? itemsProp\n : React.Children.toArray(children)\n .filter((child): child is React.ReactElement<DescriptionsItemProps> =>\n React.isValidElement(child)\n )\n .map((child) => ({\n label: child.props.label,\n children: child.props.children,\n span: child.props.span,\n labelStyle: child.props.labelStyle,\n contentStyle: child.props.contentStyle,\n }))\n\n const getColumnCount = () => {\n if (typeof column === 'number') {\n return column\n }\n return column.md || column.sm || column.xs || 3\n }\n\n const columnCount = getColumnCount()\n\n const renderVerticalLayout = () => {\n const rows: DescriptionsItemConfig[][] = []\n let currentRow: DescriptionsItemConfig[] = []\n let currentSpan = 0\n\n itemConfigs.forEach((item) => {\n const span = item.span || 1\n const effectiveSpan = Math.min(span, columnCount)\n\n if (currentSpan + effectiveSpan > columnCount) {\n rows.push(currentRow)\n currentRow = [item]\n currentSpan = effectiveSpan\n } else {\n currentRow.push(item)\n currentSpan += effectiveSpan\n }\n })\n\n if (currentRow.length > 0) {\n rows.push(currentRow)\n }\n\n return rows.map((row, rowIndex) => (\n <React.Fragment key={rowIndex}>\n <tr>\n {row.map((item, cellIndex) => {\n const span = item.span || 1\n const effectiveSpan = Math.min(span, columnCount)\n const itemLabelStyle = item.labelStyle || labelStyle\n\n return (\n <th\n key={cellIndex}\n className={`${bordered ? 'border border-base-content/10' : ''} bg-base-200/50 font-semibold text-left px-4 py-2`}\n style={itemLabelStyle}\n colSpan={effectiveSpan}\n scope=\"col\"\n >\n {item.label}\n {colon && item.label && ':'}\n </th>\n )\n })}\n </tr>\n <tr>\n {row.map((item, cellIndex) => {\n const span = item.span || 1\n const effectiveSpan = Math.min(span, columnCount)\n const itemContentStyle = item.contentStyle || contentStyle\n\n return (\n <td\n key={cellIndex}\n className={`${bordered ? 'border border-base-content/10' : ''} bg-base-100 px-4 py-2`}\n style={itemContentStyle}\n colSpan={effectiveSpan}\n >\n {item.children}\n </td>\n )\n })}\n </tr>\n </React.Fragment>\n ))\n }\n\n const renderHorizontalLayout = () => {\n const rows: DescriptionsItemConfig[][] = []\n let currentRow: DescriptionsItemConfig[] = []\n let currentSpan = 0\n\n itemConfigs.forEach((item) => {\n const span = item.span || 1\n const effectiveSpan = Math.min(span, columnCount)\n\n if (currentSpan + effectiveSpan > columnCount) {\n rows.push(currentRow)\n currentRow = [item]\n currentSpan = effectiveSpan\n } else {\n currentRow.push(item)\n currentSpan += effectiveSpan\n }\n })\n\n if (currentRow.length > 0) {\n rows.push(currentRow)\n }\n\n return rows.map((row, rowIndex) => (\n <tr key={rowIndex}>\n {row.map((item, cellIndex) => {\n const span = item.span || 1\n const effectiveSpan = Math.min(span, columnCount)\n const itemLabelStyle = item.labelStyle || labelStyle\n const itemContentStyle = item.contentStyle || contentStyle\n\n return (\n <React.Fragment key={cellIndex}>\n <th\n className={`${bordered ? 'border border-base-content/10' : ''} bg-base-200/50 font-semibold text-left px-4 py-2 whitespace-nowrap`}\n style={itemLabelStyle}\n scope=\"row\"\n >\n {item.label}\n {colon && item.label && ':'}\n </th>\n <td\n className={`${bordered ? 'border border-base-content/10' : ''} bg-base-100 px-4 py-2`}\n style={itemContentStyle}\n colSpan={effectiveSpan > 1 ? effectiveSpan * 2 - 1 : 1}\n >\n {item.children}\n </td>\n </React.Fragment>\n )\n })}\n </tr>\n ))\n }\n\n const containerClasses = [\n 'w-full',\n bordered && 'border-collapse',\n sizeClasses[size],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <div\n ref={ref}\n style={style}\n data-testid={testId}\n {...rest}\n >\n {(title || extra) && (\n <div className=\"flex items-center justify-between mb-4\" data-testid={`${testId}-header`}>\n {title && (\n <div className=\"text-lg font-semibold\">{title}</div>\n )}\n {extra && (\n <div data-testid={`${testId}-extra`}>{extra}</div>\n )}\n </div>\n )}\n <table\n className={containerClasses}\n role=\"table\"\n aria-label={typeof title === 'string' ? title : undefined}\n data-testid={`${testId}-table`}\n >\n <tbody>\n {layout === 'vertical' ? renderVerticalLayout() : renderHorizontalLayout()}\n </tbody>\n </table>\n </div>\n )\n }\n)\n\nDescriptionsRoot.displayName = 'Descriptions'\n\nexport const Descriptions = Object.assign(DescriptionsRoot, {\n Item: DescriptionsItem,\n})\n\nexport default Descriptions\n"],"names":["DescriptionsItem","_props","sizeClasses","DescriptionsRoot","forwardRef","title","extra","bordered","column","size","layout","colon","labelStyle","contentStyle","itemsProp","className","style","children","testId","rest","ref","itemConfigs","React","child","columnCount","renderVerticalLayout","rows","currentRow","currentSpan","item","span","effectiveSpan","row","rowIndex","jsxs","jsx","cellIndex","itemLabelStyle","itemContentStyle","renderHorizontalLayout","containerClasses","Descriptions"],"mappings":";;AAkEA,SAASA,EAAiBC,GAA+B;AACvD,SAAO;AACT;AAEA,MAAMC,IAAgD;AAAA,EACpD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEMC,IAAmBC;AAAA,EACvB,CACE;AAAA,IACE,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,QAAAC,IAAS;AAAA,IACT,MAAAC,IAAO;AAAA,IACP,QAAAC,IAAS;AAAA,IACT,OAAAC,IAAQ;AAAA,IACR,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,OAAOC;AAAA,IACP,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA,IACA,UAAAC;AAA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AAA;AAAA,cACC,WAAWK;AAAA,cACX,MAAK;AAAA,cACL,cAAY,OAAOnC,KAAU,WAAWA,IAAQ;AAAA,cAChD,eAAa,GAAGa,CAAM;AAAA,cAEtB,4BAAC,SAAA,EACE,UAAAR,MAAW,aAAae,MAAyBc,IAAuB,CAC3E;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEApC,EAAiB,cAAc;AAExB,MAAMsC,IAAe,OAAO,OAAOtC,GAAkB;AAAA,EAC1D,MAAMH;AACR,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"Diff.js","sources":["../../src/components/Diff.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface DiffProps {\n /** Left side content (revealed when dragging) */\n left: React.ReactNode\n /** Right side content (hidden when dragging) */\n right: React.ReactNode\n /** Aspect ratio class (e.g., \"aspect-16/9\", \"aspect-4/3\", \"aspect-square\") */\n aspect?: string\n /** Additional CSS classes */\n className?: string\n}\n\nexport const Diff: React.FC<DiffProps> = ({\n left,\n right,\n aspect = 'aspect-16/9',\n className = '',\n}) => {\n return (\n <figure\n className={`diff ${aspect} ${className}`.trim()}\n tabIndex={0}\n >\n <div className=\"diff-item-1\" role=\"img\" tabIndex={0}>\n {left}\n </div>\n <div className=\"diff-item-2\" role=\"img\">\n {right}\n </div>\n <div className=\"diff-resizer\" />\n </figure>\n )\n}\n"],"names":["Diff","left","right","aspect","className","jsxs","jsx"],"mappings":";AAaO,MAAMA,IAA4B,CAAC;AAAA,EACxC,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AACd,MAEI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,QAAQF,CAAM,IAAIC,CAAS,GAAG,KAAA;AAAA,IACzC,UAAU;AAAA,IAEV,UAAA;AAAA,MAAA,gBAAAE,EAAC,SAAI,WAAU,eAAc,MAAK,OAAM,UAAU,GAC/C,UAAAL,EAAA,CACH;AAAA,wBACC,OAAA,EAAI,WAAU,eAAc,MAAK,OAC/B,UAAAC,GACH;AAAA,MACA,gBAAAI,EAAC,OAAA,EAAI,WAAU,eAAA,CAAe;AAAA,IAAA;AAAA,EAAA;AAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.js","sources":["../../src/components/Divider.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface DividerProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode\n orientation?: 'horizontal' | 'vertical'\n position?: 'start' | 'center' | 'end'\n type?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'success' | 'warning' | 'info' | 'error'\n}\n\nexport function Divider({\n children,\n orientation = 'horizontal',\n position = 'center',\n type,\n className = '',\n ...rest\n}: DividerProps) {\n const positionClasses: Record<string, string> = {\n start: 'divider-start',\n center: '',\n end: 'divider-end',\n }\n\n const typeClasses: Record<string, string> = {\n neutral: 'divider-neutral',\n primary: 'divider-primary',\n secondary: 'divider-secondary',\n accent: 'divider-accent',\n success: 'divider-success',\n warning: 'divider-warning',\n info: 'divider-info',\n error: 'divider-error',\n }\n\n const classes = [\n 'divider',\n orientation === 'vertical' && 'divider-horizontal',\n positionClasses[position],\n type && typeClasses[type],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <div className={classes} {...rest}>{children}</div>\n}\n"],"names":["Divider","children","orientation","position","type","className","rest","positionClasses","typeClasses","classes"],"mappings":";AASO,SAASA,EAAQ;AAAA,EACtB,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,UAAAC,IAAW;AAAA,EACX,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAiB;AACf,QAAMC,IAA0C;AAAA,IAC9C,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,KAAK;AAAA,EAAA,GAGDC,IAAsC;AAAA,IAC1C,SAAS;AAAA,IACT,SAAS;AAAA,IACT,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,GAGHC,IAAU;AAAA,IACd;AAAA,IACAP,MAAgB,cAAc;AAAA,IAC9BK,EAAgBJ,CAAQ;AAAA,IACxBC,KAAQI,EAAYJ,CAAI;AAAA,IACxBC;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BAAQ,OAAA,EAAI,WAAWI,GAAU,GAAGH,GAAO,UAAAL,GAAS;AACtD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"Dock.js","sources":["../../src/components/Dock.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nexport interface DockItemConfig {\n /** Icon element */\n icon: React.ReactNode\n /** Label text */\n label?: string\n /** Whether this item is active */\n active?: boolean\n /** Whether this item is disabled */\n disabled?: boolean\n /** Click handler for this item */\n onClick?: () => void\n}\n\nexport interface DockProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /** Dock items configuration */\n items?: DockItemConfig[]\n /** Size variant */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /** Controlled active index */\n activeIndex?: number\n /** Callback when an item is clicked */\n onChange?: (index: number) => void\n /** Children (alternative to items prop) */\n children?: React.ReactNode\n /** Additional CSS classes */\n className?: string\n}\n\nexport interface DockItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Whether this item is active */\n active?: boolean\n /** Children (icon and optional label) */\n children: React.ReactNode\n /** Additional CSS classes */\n className?: string\n}\n\nconst DockItem = forwardRef<HTMLButtonElement, DockItemProps>(\n ({ active, children, className = '', ...props }, ref) => {\n const classes = [active && 'dock-active', className].filter(Boolean).join(' ')\n\n return (\n <button ref={ref} className={classes || undefined} {...props}>\n {children}\n </button>\n )\n }\n)\n\nDockItem.displayName = 'Dock.Item'\n\nconst DockRoot = forwardRef<HTMLDivElement, DockProps>(\n ({ items, size, activeIndex, onChange, children, className = '', ...props }, ref) => {\n const sizeClasses = {\n xs: 'dock-xs',\n sm: 'dock-sm',\n md: 'dock-md',\n lg: 'dock-lg',\n xl: 'dock-xl',\n }\n\n const classes = ['dock', size && sizeClasses[size], className].filter(Boolean).join(' ')\n\n // If items array is provided, render from config\n if (items) {\n return (\n <div ref={ref} className={classes} {...props}>\n {items.map((item, index) => {\n const isActive = activeIndex !== undefined ? activeIndex === index : item.active\n\n return (\n <button\n key={index}\n className={isActive ? 'dock-active' : undefined}\n disabled={item.disabled}\n onClick={() => {\n item.onClick?.()\n onChange?.(index)\n }}\n >\n {item.icon}\n {item.label && <span className=\"dock-label\">{item.label}</span>}\n </button>\n )\n })}\n </div>\n )\n }\n\n // Otherwise render children\n return (\n <div ref={ref} className={classes} {...props}>\n {children}\n </div>\n )\n }\n)\n\nDockRoot.displayName = 'Dock'\n\nexport const Dock = Object.assign(DockRoot, {\n Item: DockItem,\n})\n"],"names":["DockItem","forwardRef","active","children","className","props","ref","classes","jsx","DockRoot","items","size","activeIndex","onChange","item","index","isActive","jsxs","Dock"],"mappings":";;AAuCA,MAAMA,IAAWC;AAAA,EACf,CAAC,EAAE,QAAAC,GAAQ,UAAAC,GAAU,WAAAC,IAAY,IAAI,GAAGC,EAAA,GAASC,MAAQ;AACvD,UAAMC,IAAU,CAACL,KAAU,eAAeE,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE7E,WACE,gBAAAI,EAAC,YAAO,KAAAF,GAAU,WAAWC,KAAW,QAAY,GAAGF,GACpD,UAAAF,GACH;AAAA,EAEJ;AACF;AAEAH,EAAS,cAAc;AAEvB,MAAMS,IAAWR;AAAA,EACf,CAAC,EAAE,OAAAS,GAAO,MAAAC,GAAM,aAAAC,GAAa,UAAAC,GAAU,UAAAV,GAAU,WAAAC,IAAY,IAAI,GAAGC,EAAA,GAASC,MAAQ;AASnF,UAAMC,IAAU,CAAC,QAAQI,KARL;AAAA,MAClB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,EAGuCA,CAAI,GAAGP,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAGvF,WAAIM,IAEA,gBAAAF,EAAC,OAAA,EAAI,KAAAF,GAAU,WAAWC,GAAU,GAAGF,GACpC,UAAAK,EAAM,IAAI,CAACI,GAAMC,MAAU;AAC1B,YAAMC,IAAWJ,MAAgB,SAAYA,MAAgBG,IAAQD,EAAK;AAE1E,aACE,gBAAAG;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,WAAWD,IAAW,gBAAgB;AAAA,UACtC,UAAUF,EAAK;AAAA,UACf,SAAS,MAAM;AACb,YAAAA,EAAK,UAAA,GACLD,IAAWE,CAAK;AAAA,UAClB;AAAA,UAEC,UAAA;AAAA,YAAAD,EAAK;AAAA,YACLA,EAAK,SAAS,gBAAAN,EAAC,UAAK,WAAU,cAAc,YAAK,MAAA,CAAM;AAAA,UAAA;AAAA,QAAA;AAAA,QATnDO;AAAA,MAAA;AAAA,IAYX,CAAC,EAAA,CACH,sBAMD,OAAA,EAAI,KAAAT,GAAU,WAAWC,GAAU,GAAGF,GACpC,UAAAF,GACH;AAAA,EAEJ;AACF;AAEAM,EAAS,cAAc;AAEhB,MAAMS,IAAO,OAAO,OAAOT,GAAU;AAAA,EAC1C,MAAMT;AACR,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Drawer.js","sources":["../../src/components/Drawer.tsx"],"sourcesContent":["import React, { useEffect, useRef, useId, useCallback, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nexport type DrawerPlacement = 'top' | 'right' | 'bottom' | 'left'\nexport type DrawerSize = 'default' | 'large' | number\n\nexport interface DrawerProps {\n /** Drawer content */\n children: React.ReactNode\n /** Whether the drawer is visible */\n open?: boolean\n /** Callback when drawer is closed */\n onClose?: () => void\n /** Drawer title */\n title?: React.ReactNode\n /** Direction drawer slides from */\n placement?: DrawerPlacement\n /** Preset size or custom width/height in pixels */\n size?: DrawerSize\n /** Custom width (overrides size for left/right placement) */\n width?: number | string\n /** Custom height (overrides size for top/bottom placement) */\n height?: number | string\n /** Whether to show close button */\n closable?: boolean\n /** Whether to show mask/backdrop */\n mask?: boolean\n /** Whether clicking mask closes drawer */\n maskClosable?: boolean\n /** Whether ESC closes drawer */\n keyboard?: boolean\n /** Footer content */\n footer?: React.ReactNode\n /** Extra content in header (right side) */\n extra?: React.ReactNode\n /** CSS class for drawer panel */\n className?: string\n /** CSS class for drawer wrapper */\n rootClassName?: string\n /** Style for drawer panel */\n style?: React.CSSProperties\n /** z-index of drawer */\n zIndex?: number\n /** Destroy content when closed */\n destroyOnClose?: boolean\n /** Where to place initial focus */\n initialFocus?: 'close' | 'content'\n}\n\n/**\n * Drawer - A panel that slides in from the edge of the screen.\n * Use for forms, details, or task panels.\n * For responsive sidebar navigation, use SidebarDrawer instead.\n */\nexport function Drawer({\n children,\n open = false,\n onClose,\n title,\n placement = 'right',\n size = 'default',\n width,\n height,\n closable = true,\n mask = true,\n maskClosable = true,\n keyboard = true,\n footer,\n extra,\n className = '',\n rootClassName = '',\n style,\n zIndex = 1000,\n destroyOnClose = false,\n initialFocus = 'close',\n}: DrawerProps) {\n const drawerRef = useRef<HTMLDivElement>(null)\n const closeButtonRef = useRef<HTMLButtonElement>(null)\n const contentRef = useRef<HTMLDivElement>(null)\n const previousActiveElement = useRef<HTMLElement | null>(null)\n const titleId = useId()\n const contentId = useId()\n const [mounted, setMounted] = useState(false)\n const [shouldRender, setShouldRender] = useState(open)\n\n // Handle SSR - only render portal after mounting in browser\n useEffect(() => {\n setMounted(true)\n }, [])\n\n // Calculate dimensions\n const getSizeValue = (): number => {\n if (typeof size === 'number') return size\n return size === 'large' ? 736 : 378\n }\n\n const getDimension = (): { width?: string; height?: string } => {\n const isHorizontal = placement === 'left' || placement === 'right'\n const sizeValue = getSizeValue()\n\n if (isHorizontal) {\n const w = width ?? sizeValue\n return { width: typeof w === 'number' ? `${w}px` : w }\n } else {\n const h = height ?? sizeValue\n return { height: typeof h === 'number' ? `${h}px` : h }\n }\n }\n\n // Focus trap\n const trapFocus = useCallback((e: KeyboardEvent) => {\n if (!drawerRef.current || e.key !== 'Tab' || typeof document === 'undefined') return\n\n const focusableElements = drawerRef.current.querySelectorAll<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n )\n const firstElement = focusableElements[0]\n const lastElement = focusableElements[focusableElements.length - 1]\n\n if (e.shiftKey && document.activeElement === firstElement) {\n e.preventDefault()\n lastElement?.focus()\n } else if (!e.shiftKey && document.activeElement === lastElement) {\n e.preventDefault()\n firstElement?.focus()\n }\n }, [])\n\n // Handle ESC key\n const handleKeyDown = useCallback((e: KeyboardEvent) => {\n if (keyboard && e.key === 'Escape' && onClose) {\n e.preventDefault()\n onClose()\n }\n }, [keyboard, onClose])\n\n // Open/close effects\n useEffect(() => {\n if (typeof document === 'undefined') return\n\n if (open) {\n setShouldRender(true)\n previousActiveElement.current = document.activeElement as HTMLElement\n document.body.style.overflow = 'hidden'\n\n // Set initial focus\n const focusTimeout = setTimeout(() => {\n if (initialFocus === 'close' && closeButtonRef.current) {\n closeButtonRef.current.focus()\n } else if (contentRef.current) {\n const firstFocusable = contentRef.current.querySelector<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n )\n firstFocusable?.focus()\n }\n }, 0)\n\n // Add event listeners\n document.addEventListener('keydown', handleKeyDown)\n document.addEventListener('keydown', trapFocus)\n\n return () => {\n clearTimeout(focusTimeout)\n document.body.style.overflow = ''\n document.removeEventListener('keydown', handleKeyDown)\n document.removeEventListener('keydown', trapFocus)\n }\n } else {\n // Restore focus to previously focused element if it's still in the DOM\n const prevElement = previousActiveElement.current\n if (prevElement && document.body.contains(prevElement)) {\n prevElement.focus()\n }\n\n // Handle destroyOnClose\n if (destroyOnClose) {\n const timeout = setTimeout(() => setShouldRender(false), 300)\n return () => clearTimeout(timeout)\n }\n }\n }, [open, handleKeyDown, trapFocus, destroyOnClose, initialFocus])\n\n const handleMaskClick = () => {\n if (maskClosable && onClose) {\n onClose()\n }\n }\n\n // Position classes\n const placementClasses: Record<DrawerPlacement, string> = {\n top: 'inset-x-0 top-0',\n right: 'inset-y-0 right-0',\n bottom: 'inset-x-0 bottom-0',\n left: 'inset-y-0 left-0',\n }\n\n // Transform for animation\n const getTransform = (isOpen: boolean): string => {\n if (isOpen) return 'translate(0, 0)'\n switch (placement) {\n case 'top': return 'translateY(-100%)'\n case 'right': return 'translateX(100%)'\n case 'bottom': return 'translateY(100%)'\n case 'left': return 'translateX(-100%)'\n }\n }\n\n const dimension = getDimension()\n\n const drawerContent = (\n <div\n className={`fixed inset-0 ${open ? '' : 'pointer-events-none'} ${rootClassName}`}\n style={{ zIndex }}\n role=\"presentation\"\n data-state={open ? 'open' : 'closed'}\n >\n {/* Backdrop/Mask */}\n {mask && (\n <div\n className={`absolute inset-0 bg-black transition-opacity duration-300 ${\n open ? 'opacity-50' : 'opacity-0'\n }`}\n onClick={handleMaskClick}\n aria-hidden=\"true\"\n />\n )}\n\n {/* Drawer Panel */}\n <div\n ref={drawerRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? titleId : undefined}\n aria-describedby={contentId}\n className={`fixed flex flex-col bg-base-100 shadow-xl transition-transform duration-300 ease-in-out ${placementClasses[placement]} ${className}`}\n style={{\n ...dimension,\n transform: getTransform(open),\n ...style,\n }}\n >\n {/* Header */}\n {(title || closable || extra) && (\n <div className=\"flex items-center justify-between px-6 py-4 border-b border-base-300\">\n {title && (\n <h2 id={titleId} className=\"text-lg font-semibold\">\n {title}\n </h2>\n )}\n <div className=\"flex items-center gap-2 ml-auto\">\n {extra}\n {closable && (\n <button\n ref={closeButtonRef}\n type=\"button\"\n className=\"btn btn-ghost btn-sm btn-square\"\n onClick={onClose}\n aria-label=\"Close drawer\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-5 w-5\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </button>\n )}\n </div>\n </div>\n )}\n\n {/* Content */}\n <div\n ref={contentRef}\n id={contentId}\n className=\"flex-1 overflow-auto p-6\"\n >\n {children}\n </div>\n\n {/* Footer */}\n {footer && (\n <div className=\"px-6 py-4 border-t border-base-300\">\n {footer}\n </div>\n )}\n </div>\n </div>\n )\n\n // Don't render during SSR or when not needed\n if (!mounted || (!shouldRender && !open)) return null\n\n return createPortal(drawerContent, document.body)\n}\n"],"names":["Drawer","children","open","onClose","title","placement","size","width","height","closable","mask","maskClosable","keyboard","footer","extra","className","rootClassName","style","zIndex","destroyOnClose","initialFocus","drawerRef","useRef","closeButtonRef","contentRef","previousActiveElement","titleId","useId","contentId","mounted","setMounted","useState","shouldRender","setShouldRender","useEffect","getSizeValue","getDimension","isHorizontal","sizeValue","w","h","trapFocus","useCallback","focusableElements","firstElement","lastElement","handleKeyDown","focusTimeout","prevElement","timeout","handleMaskClick","placementClasses","getTransform","isOpen","dimension","drawerContent","jsxs","jsx","createPortal"],"mappings":";;;AAsDO,SAASA,GAAO;AAAA,EACrB,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,MAAAC,IAAO;AAAA,EACP,cAAAC,IAAe;AAAA,EACf,UAAAC,IAAW;AAAA,EACX,QAAAC;AAAA,EACA,OAAAC;AAAA,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1C;AAAA,kBACAL,KACC,gBAAAgD;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,KAAKlC;AAAA,sBACL,MAAK;AAAA,sBACL,WAAU;AAAA,sBACV,SAASpB;AAAA,sBACT,cAAW;AAAA,sBAEX,UAAA,gBAAAsD;AAAA,wBAAC;AAAA,wBAAA;AAAA,0BACC,OAAM;AAAA,0BACN,WAAU;AAAA,0BACV,MAAK;AAAA,0BACL,SAAQ;AAAA,0BACR,QAAO;AAAA,0BACP,eAAY;AAAA,0BAEZ,UAAA,gBAAAA;AAAA,4BAAC;AAAA,4BAAA;AAAA,8BACC,eAAc;AAAA,8BACd,gBAAe;AAAA,8BACf,aAAa;AAAA,8BACb,GAAE;AAAA,4BAAA;AAAA,0BAAA;AAAA,wBACJ;AAAA,sBAAA;AAAA,oBACF;AAAA,kBAAA;AAAA,gBACF,EAAA,CAEJ;AAAA,cAAA,GACF;AAAA,cAIF,gBAAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,KAAKjC;AAAA,kBACL,IAAII;AAAA,kBACJ,WAAU;AAAA,kBAET,UAAA3B;AAAA,gBAAA;AAAA,cAAA;AAAA,cAIFY,KACC,gBAAA4C,EAAC,OAAA,EAAI,WAAU,sCACZ,UAAA5C,EAAA,CACH;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAKJ,SAAI,CAACgB,KAAY,CAACG,KAAgB,CAAC9B,IAAc,OAE1CwD,EAAaH,GAAe,SAAS,IAAI;AAClD;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as B, Fragment as ie, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import D, { useId as q, useState as j, useRef as N, useCallback as R, useEffect as L, createContext as ue, useContext as de } from "react";
|
|
3
|
-
const
|
|
3
|
+
const _ = ue(void 0);
|
|
4
4
|
function V() {
|
|
5
|
-
const l = de(
|
|
5
|
+
const l = de(_);
|
|
6
6
|
if (!l)
|
|
7
7
|
throw new Error("Dropdown compound components must be used within Dropdown");
|
|
8
8
|
return l;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function pe({
|
|
11
11
|
children: l,
|
|
12
12
|
items: d,
|
|
13
13
|
hover: b = !1,
|
|
@@ -16,8 +16,8 @@ function fe({
|
|
|
16
16
|
align: u = "start",
|
|
17
17
|
open: n,
|
|
18
18
|
onOpenChange: r,
|
|
19
|
-
disabled:
|
|
20
|
-
arrow:
|
|
19
|
+
disabled: p = !1,
|
|
20
|
+
arrow: f = !1,
|
|
21
21
|
mouseEnterDelay: m = 0.15,
|
|
22
22
|
mouseLeaveDelay: c = 0.1,
|
|
23
23
|
getPopupContainer: y,
|
|
@@ -25,16 +25,16 @@ function fe({
|
|
|
25
25
|
className: k = "",
|
|
26
26
|
...S
|
|
27
27
|
}) {
|
|
28
|
-
const U = q(), v = q(), [e, I] = j(!1), [w, x] = j(-1), [T, P] = j(0), [Y,
|
|
29
|
-
|
|
30
|
-
}, [
|
|
28
|
+
const U = q(), v = q(), [e, I] = j(!1), [w, x] = j(-1), [T, P] = j(0), [Y, z] = j(!o), W = N(/* @__PURE__ */ new Map()), $ = N(null), C = N(null), M = b ? ["hover"] : h, F = n !== void 0, A = F ? n : e, g = R((t, E = "trigger") => {
|
|
29
|
+
p || (F || I(t), t && z(!0), r?.(t, { source: E }));
|
|
30
|
+
}, [p, F, r]), Z = R(() => {
|
|
31
31
|
g(!1, "menu"), x(-1), document.getElementById(v)?.focus();
|
|
32
32
|
}, [g, v]), H = R((t, E, a) => {
|
|
33
|
-
E ?
|
|
33
|
+
E ? W.current.set(t, { ref: E, disabled: a }) : W.current.delete(t);
|
|
34
34
|
}, []);
|
|
35
35
|
L(() => {
|
|
36
36
|
if (o && !A) {
|
|
37
|
-
const t = setTimeout(() =>
|
|
37
|
+
const t = setTimeout(() => z(!1), 300);
|
|
38
38
|
return () => clearTimeout(t);
|
|
39
39
|
}
|
|
40
40
|
}, [A, o]), L(() => {
|
|
@@ -67,7 +67,7 @@ function fe({
|
|
|
67
67
|
start: "",
|
|
68
68
|
center: "dropdown-center",
|
|
69
69
|
end: "dropdown-end"
|
|
70
|
-
}, se = typeof
|
|
70
|
+
}, se = typeof f == "boolean" ? f : !!f, ae = [
|
|
71
71
|
"dropdown",
|
|
72
72
|
re[s],
|
|
73
73
|
oe[u],
|
|
@@ -118,7 +118,7 @@ function fe({
|
|
|
118
118
|
(Y || !o) && /* @__PURE__ */ i(J, { children: le() })
|
|
119
119
|
] }) : l;
|
|
120
120
|
return /* @__PURE__ */ i(
|
|
121
|
-
|
|
121
|
+
_.Provider,
|
|
122
122
|
{
|
|
123
123
|
value: {
|
|
124
124
|
position: s,
|
|
@@ -132,7 +132,7 @@ function fe({
|
|
|
132
132
|
registerItem: H,
|
|
133
133
|
itemCount: T,
|
|
134
134
|
setItemCount: P,
|
|
135
|
-
disabled:
|
|
135
|
+
disabled: p,
|
|
136
136
|
arrow: se,
|
|
137
137
|
closeDropdown: Z
|
|
138
138
|
},
|
|
@@ -142,7 +142,7 @@ function fe({
|
|
|
142
142
|
ref: $,
|
|
143
143
|
className: ae,
|
|
144
144
|
"data-state": A ? "open" : "closed",
|
|
145
|
-
"aria-disabled":
|
|
145
|
+
"aria-disabled": p || void 0,
|
|
146
146
|
onMouseEnter: ee,
|
|
147
147
|
onMouseLeave: ne,
|
|
148
148
|
onContextMenu: te,
|
|
@@ -154,7 +154,7 @@ function fe({
|
|
|
154
154
|
);
|
|
155
155
|
}
|
|
156
156
|
function G({ children: l, className: d = "" }) {
|
|
157
|
-
const { menuId: b, triggerId: h, isOpen: s, setIsOpen: u, setFocusedIndex: n, itemCount: r, disabled:
|
|
157
|
+
const { menuId: b, triggerId: h, isOpen: s, setIsOpen: u, setFocusedIndex: n, itemCount: r, disabled: p } = V(), f = (o) => {
|
|
158
158
|
switch (o.key) {
|
|
159
159
|
case "Enter":
|
|
160
160
|
case " ":
|
|
@@ -173,7 +173,7 @@ function G({ children: l, className: d = "" }) {
|
|
|
173
173
|
}, c = D.Children.only(l), y = c.props;
|
|
174
174
|
return D.cloneElement(c, {
|
|
175
175
|
id: h,
|
|
176
|
-
tabIndex:
|
|
176
|
+
tabIndex: p ? -1 : 0,
|
|
177
177
|
"aria-haspopup": "menu",
|
|
178
178
|
"aria-expanded": s,
|
|
179
179
|
"aria-controls": b,
|
|
@@ -181,18 +181,18 @@ function G({ children: l, className: d = "" }) {
|
|
|
181
181
|
m(), y.onClick?.(o);
|
|
182
182
|
},
|
|
183
183
|
onKeyDown: (o) => {
|
|
184
|
-
|
|
184
|
+
f(o), y.onKeyDown?.(o);
|
|
185
185
|
},
|
|
186
186
|
className: `${y.className || ""} ${d}`.trim()
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
function J({ children: l, className: d = "" }) {
|
|
190
|
-
const { menuId: b, triggerId: h, isOpen: s, setIsOpen: u, focusedIndex: n, setFocusedIndex: r, setItemCount:
|
|
190
|
+
const { menuId: b, triggerId: h, isOpen: s, setIsOpen: u, focusedIndex: n, setFocusedIndex: r, setItemCount: p, arrow: f, position: m } = V(), c = N(null), y = D.Children.toArray(l).filter(
|
|
191
191
|
(e) => D.isValidElement(e) && e.type === O
|
|
192
192
|
);
|
|
193
193
|
L(() => {
|
|
194
|
-
|
|
195
|
-
}, [y.length,
|
|
194
|
+
p(y.length);
|
|
195
|
+
}, [y.length, p]), L(() => {
|
|
196
196
|
s && n >= 0 && c.current && c.current.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')[n]?.focus();
|
|
197
197
|
}, [s, n]);
|
|
198
198
|
const o = (e) => {
|
|
@@ -227,7 +227,7 @@ function J({ children: l, className: d = "" }) {
|
|
|
227
227
|
"z-50",
|
|
228
228
|
"shadow",
|
|
229
229
|
d
|
|
230
|
-
].filter(Boolean).join(" "), S = D.Children.map(l, (e, I) => D.isValidElement(e) && e.type === O ? D.cloneElement(e, { _index: I }) : e), v =
|
|
230
|
+
].filter(Boolean).join(" "), S = D.Children.map(l, (e, I) => D.isValidElement(e) && e.type === O ? D.cloneElement(e, { _index: I }) : e), v = f ? /* @__PURE__ */ i(
|
|
231
231
|
"span",
|
|
232
232
|
{
|
|
233
233
|
className: `absolute w-0 h-0 border-8 border-solid ${{
|
|
@@ -247,7 +247,7 @@ function J({ children: l, className: d = "" }) {
|
|
|
247
247
|
role: "menu",
|
|
248
248
|
"aria-labelledby": h,
|
|
249
249
|
tabIndex: -1,
|
|
250
|
-
className: `${k} ${
|
|
250
|
+
className: `${k} ${f ? "relative" : ""}`,
|
|
251
251
|
onKeyDown: o,
|
|
252
252
|
children: [
|
|
253
253
|
v,
|
|
@@ -265,10 +265,10 @@ function O({
|
|
|
265
265
|
active: u = !1,
|
|
266
266
|
disabled: n = !1,
|
|
267
267
|
danger: r = !1,
|
|
268
|
-
className:
|
|
268
|
+
className: p = ""
|
|
269
269
|
}) {
|
|
270
|
-
const { closeDropdown:
|
|
271
|
-
n || (s?.(),
|
|
270
|
+
const { closeDropdown: f } = V(), m = [u && "active", n && "disabled", p].filter(Boolean).join(" "), c = () => {
|
|
271
|
+
n || (s?.(), f());
|
|
272
272
|
};
|
|
273
273
|
return /* @__PURE__ */ i("li", { className: m, role: "none", "data-key": d, children: /* @__PURE__ */ B(
|
|
274
274
|
"a",
|
|
@@ -296,7 +296,7 @@ function Q({
|
|
|
296
296
|
disabled: s = !1,
|
|
297
297
|
className: u = ""
|
|
298
298
|
}) {
|
|
299
|
-
const [n, r] = j(!1),
|
|
299
|
+
const [n, r] = j(!1), p = N(null), f = N(null), m = N(null), c = q(), y = () => {
|
|
300
300
|
s || r(!0);
|
|
301
301
|
}, o = () => {
|
|
302
302
|
r(!1);
|
|
@@ -321,7 +321,7 @@ function Q({
|
|
|
321
321
|
switch (e.key) {
|
|
322
322
|
case "ArrowLeft":
|
|
323
323
|
case "Escape":
|
|
324
|
-
e.preventDefault(), e.stopPropagation(), r(!1),
|
|
324
|
+
e.preventDefault(), e.stopPropagation(), r(!1), f.current?.focus();
|
|
325
325
|
break;
|
|
326
326
|
case "ArrowDown":
|
|
327
327
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -344,7 +344,7 @@ function Q({
|
|
|
344
344
|
return /* @__PURE__ */ i(
|
|
345
345
|
"li",
|
|
346
346
|
{
|
|
347
|
-
ref:
|
|
347
|
+
ref: p,
|
|
348
348
|
className: v,
|
|
349
349
|
role: "none",
|
|
350
350
|
"data-key": d,
|
|
@@ -354,7 +354,7 @@ function Q({
|
|
|
354
354
|
/* @__PURE__ */ B(
|
|
355
355
|
"summary",
|
|
356
356
|
{
|
|
357
|
-
ref:
|
|
357
|
+
ref: f,
|
|
358
358
|
role: "menuitem",
|
|
359
359
|
tabIndex: s ? -1 : 0,
|
|
360
360
|
"aria-disabled": s || void 0,
|
|
@@ -388,7 +388,7 @@ function X({ className: l = "" }) {
|
|
|
388
388
|
const d = ["border-base-content/10", l].filter(Boolean).join(" ");
|
|
389
389
|
return /* @__PURE__ */ i("li", { role: "separator", className: "my-1", children: /* @__PURE__ */ i("hr", { className: d }) });
|
|
390
390
|
}
|
|
391
|
-
const be = Object.assign(
|
|
391
|
+
const be = Object.assign(pe, {
|
|
392
392
|
Trigger: G,
|
|
393
393
|
Menu: J,
|
|
394
394
|
Item: O,
|
|
@@ -398,4 +398,4 @@ const be = Object.assign(fe, {
|
|
|
398
398
|
export {
|
|
399
399
|
be as Dropdown
|
|
400
400
|
};
|
|
401
|
-
//# sourceMappingURL=
|
|
401
|
+
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sources":["../../src/components/Dropdown.tsx"],"sourcesContent":["import React, { createContext, useContext, useId, useRef, useState, useCallback, useEffect } from 'react'\n\n// Types for data-driven items prop\nexport type DropdownTriggerType = 'click' | 'hover' | 'contextMenu'\n\nexport interface DropdownMenuItem {\n key: string\n label: React.ReactNode\n icon?: React.ReactNode\n disabled?: boolean\n danger?: boolean\n onClick?: () => void\n children?: DropdownMenuItem[] // For submenus\n}\n\nexport interface DropdownMenuDivider {\n type: 'divider'\n key?: string\n}\n\nexport type DropdownMenuItemType = DropdownMenuItem | DropdownMenuDivider\n\ninterface DropdownContextValue {\n position?: 'top' | 'bottom' | 'left' | 'right'\n align?: 'start' | 'center' | 'end'\n menuId: string\n triggerId: string\n isOpen: boolean\n setIsOpen: (open: boolean) => void\n focusedIndex: number\n setFocusedIndex: (index: number) => void\n registerItem: (index: number, ref: HTMLElement | null, disabled: boolean) => void\n itemCount: number\n setItemCount: (count: number) => void\n disabled: boolean\n arrow: boolean\n closeDropdown: () => void\n}\n\nconst DropdownContext = createContext<DropdownContextValue | undefined>(undefined)\n\nfunction useDropdownContext() {\n const context = useContext(DropdownContext)\n if (!context) {\n throw new Error('Dropdown compound components must be used within Dropdown')\n }\n return context\n}\n\nexport interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Trigger element and dropdown content (compound pattern) */\n children?: React.ReactNode\n /** Menu items (data-driven pattern) */\n items?: DropdownMenuItemType[]\n /** @deprecated Use trigger={['hover']} instead */\n hover?: boolean\n /** Trigger mode(s) for dropdown */\n trigger?: DropdownTriggerType[]\n position?: 'top' | 'bottom' | 'left' | 'right'\n align?: 'start' | 'center' | 'end'\n /** Controlled open state */\n open?: boolean\n /** Callback when open state changes */\n onOpenChange?: (open: boolean, info?: { source: 'trigger' | 'menu' }) => void\n /** Disable the dropdown */\n disabled?: boolean\n /** Show arrow pointing to trigger */\n arrow?: boolean | { pointAtCenter?: boolean }\n /** Delay before showing dropdown on hover (seconds) */\n mouseEnterDelay?: number\n /** Delay before hiding dropdown on mouse leave (seconds) */\n mouseLeaveDelay?: number\n /** Container for the dropdown menu */\n getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement\n /** Destroy dropdown when hidden */\n destroyOnHidden?: boolean\n}\n\nexport interface DropdownTriggerProps {\n children: React.ReactNode\n className?: string\n}\n\nexport interface DropdownMenuProps {\n children?: React.ReactNode\n className?: string\n}\n\nexport interface DropdownItemProps {\n children?: React.ReactNode\n /** Unique key for the item */\n itemKey?: string\n /** Icon to display before label */\n icon?: React.ReactNode\n /** Item label (alternative to children) */\n label?: React.ReactNode\n onClick?: () => void\n active?: boolean\n disabled?: boolean\n danger?: boolean\n className?: string\n _index?: number // Internal prop passed by DropdownMenu\n}\n\nexport interface DropdownSubMenuProps {\n children: React.ReactNode\n /** Unique key for the submenu */\n itemKey?: string\n /** Submenu title/label */\n title: React.ReactNode\n /** Icon to display before title */\n icon?: React.ReactNode\n disabled?: boolean\n className?: string\n}\n\nexport interface DropdownDividerProps {\n className?: string\n}\n\nfunction DropdownRoot({\n children,\n items,\n hover = false,\n trigger = ['click'],\n position = 'bottom',\n align = 'start',\n open: controlledOpen,\n onOpenChange,\n disabled = false,\n arrow = false,\n mouseEnterDelay = 0.15,\n mouseLeaveDelay = 0.1,\n getPopupContainer,\n destroyOnHidden = false,\n className = '',\n ...rest\n}: DropdownProps) {\n const menuId = useId()\n const triggerId = useId()\n const [internalOpen, setInternalOpen] = useState(false)\n const [focusedIndex, setFocusedIndex] = useState(-1)\n const [itemCount, setItemCount] = useState(0)\n const [shouldRender, setShouldRender] = useState(!destroyOnHidden)\n const itemRefs = useRef<Map<number, { ref: HTMLElement | null; disabled: boolean }>>(new Map())\n const dropdownRef = useRef<HTMLDivElement>(null)\n const hoverTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n // Normalize trigger - support both hover boolean (deprecated) and trigger array\n const triggers = hover ? ['hover'] : trigger\n\n // Use controlled or uncontrolled open state\n const isControlled = controlledOpen !== undefined\n const isOpen = isControlled ? controlledOpen : internalOpen\n\n const setIsOpen = useCallback((open: boolean, source: 'trigger' | 'menu' = 'trigger') => {\n if (disabled) return\n if (!isControlled) {\n setInternalOpen(open)\n }\n if (open) {\n setShouldRender(true)\n }\n onOpenChange?.(open, { source })\n }, [disabled, isControlled, onOpenChange])\n\n const closeDropdown = useCallback(() => {\n setIsOpen(false, 'menu')\n setFocusedIndex(-1)\n document.getElementById(triggerId)?.focus()\n }, [setIsOpen, triggerId])\n\n const registerItem = useCallback((index: number, ref: HTMLElement | null, itemDisabled: boolean) => {\n if (ref) {\n itemRefs.current.set(index, { ref, disabled: itemDisabled })\n } else {\n itemRefs.current.delete(index)\n }\n }, [])\n\n // Handle destroyOnHidden\n useEffect(() => {\n if (destroyOnHidden && !isOpen) {\n const timeout = setTimeout(() => setShouldRender(false), 300)\n return () => clearTimeout(timeout)\n }\n }, [isOpen, destroyOnHidden])\n\n // Close dropdown when clicking outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {\n setIsOpen(false, 'trigger')\n setFocusedIndex(-1)\n }\n }\n\n if (isOpen) {\n document.addEventListener('mousedown', handleClickOutside)\n return () => document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [isOpen, setIsOpen])\n\n // Hover handlers with delay\n const handleMouseEnter = useCallback(() => {\n if (!triggers.includes('hover')) return\n if (hoverTimeoutRef.current) {\n clearTimeout(hoverTimeoutRef.current)\n }\n hoverTimeoutRef.current = setTimeout(() => {\n setIsOpen(true, 'trigger')\n }, mouseEnterDelay * 1000)\n }, [triggers, mouseEnterDelay, setIsOpen])\n\n const handleMouseLeave = useCallback(() => {\n if (!triggers.includes('hover')) return\n if (hoverTimeoutRef.current) {\n clearTimeout(hoverTimeoutRef.current)\n }\n hoverTimeoutRef.current = setTimeout(() => {\n setIsOpen(false, 'trigger')\n setFocusedIndex(-1)\n }, mouseLeaveDelay * 1000)\n }, [triggers, mouseLeaveDelay, setIsOpen])\n\n // Context menu handler\n const handleContextMenu = useCallback((event: React.MouseEvent) => {\n if (!triggers.includes('contextMenu')) return\n event.preventDefault()\n setIsOpen(true, 'trigger')\n }, [triggers, setIsOpen])\n\n // Cleanup timeout on unmount\n useEffect(() => {\n return () => {\n if (hoverTimeoutRef.current) {\n clearTimeout(hoverTimeoutRef.current)\n }\n }\n }, [])\n\n const positionClasses: Record<string, string> = {\n top: 'dropdown-top',\n bottom: 'dropdown-bottom',\n left: 'dropdown-left',\n right: 'dropdown-right',\n }\n\n const alignClasses: Record<string, string> = {\n start: '',\n center: 'dropdown-center',\n end: 'dropdown-end',\n }\n\n const showArrow = typeof arrow === 'boolean' ? arrow : !!arrow\n\n const dropdownClasses = [\n 'dropdown',\n positionClasses[position],\n alignClasses[align],\n triggers.includes('hover') && 'dropdown-hover',\n isOpen && 'dropdown-open',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n // Render items from data-driven prop\n const renderItems = () => {\n if (!items) return null\n return items.map((item, index) => {\n if ('type' in item && item.type === 'divider') {\n return <DropdownDivider key={item.key || `divider-${index}`} />\n }\n const menuItem = item as DropdownMenuItem\n if (menuItem.children && menuItem.children.length > 0) {\n return (\n <DropdownSubMenu\n key={menuItem.key}\n itemKey={menuItem.key}\n title={menuItem.label}\n icon={menuItem.icon}\n disabled={menuItem.disabled}\n >\n {menuItem.children.map((child) => (\n <DropdownItem\n key={child.key}\n itemKey={child.key}\n icon={child.icon}\n disabled={child.disabled}\n danger={child.danger}\n onClick={child.onClick}\n >\n {child.label}\n </DropdownItem>\n ))}\n </DropdownSubMenu>\n )\n }\n return (\n <DropdownItem\n key={menuItem.key}\n itemKey={menuItem.key}\n icon={menuItem.icon}\n disabled={menuItem.disabled}\n danger={menuItem.danger}\n onClick={menuItem.onClick}\n >\n {menuItem.label}\n </DropdownItem>\n )\n })\n }\n\n // Determine content - either compound children or items-generated menu\n const content = items ? (\n <>\n {React.Children.toArray(children).find(\n (child) => React.isValidElement(child) && child.type === DropdownTrigger\n )}\n {(shouldRender || !destroyOnHidden) && (\n <DropdownMenu>{renderItems()}</DropdownMenu>\n )}\n </>\n ) : (\n children\n )\n\n return (\n <DropdownContext.Provider\n value={{\n position,\n align,\n menuId,\n triggerId,\n isOpen,\n setIsOpen,\n focusedIndex,\n setFocusedIndex,\n registerItem,\n itemCount,\n setItemCount,\n disabled,\n arrow: showArrow,\n closeDropdown,\n }}\n >\n <div\n ref={dropdownRef}\n className={dropdownClasses}\n data-state={isOpen ? 'open' : 'closed'}\n aria-disabled={disabled || undefined}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onContextMenu={handleContextMenu}\n {...rest}\n >\n {content}\n </div>\n </DropdownContext.Provider>\n )\n}\n\nfunction DropdownTrigger({ children, className = '' }: DropdownTriggerProps) {\n const { menuId, triggerId, isOpen, setIsOpen, setFocusedIndex, itemCount, disabled } = useDropdownContext()\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n switch (event.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n event.preventDefault()\n setIsOpen(true)\n setFocusedIndex(0)\n break\n case 'ArrowUp':\n event.preventDefault()\n setIsOpen(true)\n setFocusedIndex(itemCount - 1)\n break\n case 'Escape':\n event.preventDefault()\n setIsOpen(false)\n setFocusedIndex(-1)\n break\n }\n }\n\n const handleClick = () => {\n setIsOpen(!isOpen)\n if (!isOpen) {\n setFocusedIndex(0)\n }\n }\n\n // Clone the child element to add event handlers and ARIA attributes\n const child = React.Children.only(children) as React.ReactElement<\n React.HTMLAttributes<HTMLElement> & {\n onClick?: (e: React.MouseEvent) => void\n onKeyDown?: (e: React.KeyboardEvent) => void\n className?: string\n }\n >\n\n const childProps = child.props\n\n return React.cloneElement(child, {\n id: triggerId,\n tabIndex: disabled ? -1 : 0,\n 'aria-haspopup': 'menu' as const,\n 'aria-expanded': isOpen,\n 'aria-controls': menuId,\n onClick: (e: React.MouseEvent) => {\n handleClick()\n childProps.onClick?.(e)\n },\n onKeyDown: (e: React.KeyboardEvent) => {\n handleKeyDown(e)\n childProps.onKeyDown?.(e)\n },\n className: `${childProps.className || ''} ${className}`.trim(),\n })\n}\n\nfunction DropdownMenu({ children, className = '' }: DropdownMenuProps) {\n const { menuId, triggerId, isOpen, setIsOpen, focusedIndex, setFocusedIndex, setItemCount, arrow, position } = useDropdownContext()\n const menuRef = useRef<HTMLUListElement>(null)\n\n // Count children and set item count\n const childArray = React.Children.toArray(children).filter(\n (child) => React.isValidElement(child) && (child.type === DropdownItem)\n )\n\n useEffect(() => {\n setItemCount(childArray.length)\n }, [childArray.length, setItemCount])\n\n // Focus management\n useEffect(() => {\n if (isOpen && focusedIndex >= 0 && menuRef.current) {\n const items = menuRef.current.querySelectorAll('[role=\"menuitem\"]:not([aria-disabled=\"true\"])')\n const item = items[focusedIndex] as HTMLElement\n item?.focus()\n }\n }, [isOpen, focusedIndex])\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n const enabledItems = childArray.filter(\n (child) => React.isValidElement(child) && !(child.props as DropdownItemProps).disabled\n )\n const enabledCount = enabledItems.length\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault()\n setFocusedIndex((focusedIndex + 1) % enabledCount)\n break\n case 'ArrowUp':\n event.preventDefault()\n setFocusedIndex((focusedIndex - 1 + enabledCount) % enabledCount)\n break\n case 'Home':\n event.preventDefault()\n setFocusedIndex(0)\n break\n case 'End':\n event.preventDefault()\n setFocusedIndex(enabledCount - 1)\n break\n case 'Escape':\n event.preventDefault()\n setIsOpen(false)\n setFocusedIndex(-1)\n // Return focus to trigger\n document.getElementById(triggerId)?.focus()\n break\n case 'Tab':\n setIsOpen(false)\n setFocusedIndex(-1)\n break\n }\n }\n\n const menuClasses = [\n 'dropdown-content',\n 'menu',\n 'bg-base-100',\n 'rounded-box',\n 'z-50',\n 'shadow',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n // Clone children to pass index\n const childrenWithIndex = React.Children.map(children, (child, index) => {\n if (React.isValidElement(child) && child.type === DropdownItem) {\n return React.cloneElement(child as React.ReactElement<any>, { _index: index })\n }\n return child\n })\n\n // Arrow position classes based on menu position\n const arrowPositionClasses: Record<string, string> = {\n top: 'bottom-0 left-1/2 -translate-x-1/2 translate-y-full border-t-base-100 border-l-transparent border-r-transparent border-b-transparent',\n bottom: 'top-0 left-1/2 -translate-x-1/2 -translate-y-full border-b-base-100 border-l-transparent border-r-transparent border-t-transparent',\n left: 'right-0 top-1/2 -translate-y-1/2 translate-x-full border-l-base-100 border-t-transparent border-b-transparent border-r-transparent',\n right: 'left-0 top-1/2 -translate-y-1/2 -translate-x-full border-r-base-100 border-t-transparent border-b-transparent border-l-transparent',\n }\n\n const arrowElement = arrow ? (\n <span\n className={`absolute w-0 h-0 border-8 border-solid ${arrowPositionClasses[position || 'bottom']}`}\n aria-hidden=\"true\"\n />\n ) : null\n\n return (\n <ul\n ref={menuRef}\n id={menuId}\n role=\"menu\"\n aria-labelledby={triggerId}\n tabIndex={-1}\n className={`${menuClasses} ${arrow ? 'relative' : ''}`}\n onKeyDown={handleKeyDown}\n >\n {arrowElement}\n {childrenWithIndex}\n </ul>\n )\n}\n\nfunction DropdownItem({\n children,\n itemKey,\n icon,\n label,\n onClick,\n active = false,\n disabled = false,\n danger = false,\n className = '',\n}: DropdownItemProps) {\n const { closeDropdown } = useDropdownContext()\n const itemClasses = [active && 'active', disabled && 'disabled', className].filter(Boolean).join(' ')\n\n const handleClick = () => {\n if (!disabled) {\n onClick?.()\n closeDropdown()\n }\n }\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if ((event.key === 'Enter' || event.key === ' ') && !disabled) {\n event.preventDefault()\n handleClick()\n }\n }\n\n const content = label || children\n\n return (\n <li className={itemClasses} role=\"none\" data-key={itemKey}>\n <a\n role=\"menuitem\"\n tabIndex={disabled ? -1 : 0}\n aria-disabled={disabled || undefined}\n className={danger ? 'text-error' : ''}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n {icon && <span className=\"mr-2 inline-flex items-center\">{icon}</span>}\n {content}\n </a>\n </li>\n )\n}\n\nfunction DropdownSubMenu({\n children,\n itemKey,\n title,\n icon,\n disabled = false,\n className = '',\n}: DropdownSubMenuProps) {\n const [isSubOpen, setIsSubOpen] = useState(false)\n const subMenuRef = useRef<HTMLLIElement>(null)\n const summaryRef = useRef<HTMLElement>(null)\n const subMenuListRef = useRef<HTMLUListElement>(null)\n const subMenuId = useId()\n\n const handleMouseEnter = () => {\n if (!disabled) setIsSubOpen(true)\n }\n\n const handleMouseLeave = () => {\n setIsSubOpen(false)\n }\n\n // Focus first item in submenu\n const focusFirstItem = () => {\n setTimeout(() => {\n const firstItem = subMenuListRef.current?.querySelector('[role=\"menuitem\"]:not([aria-disabled=\"true\"])') as HTMLElement\n firstItem?.focus()\n }, 0)\n }\n\n // Keyboard handler for summary (submenu trigger)\n const handleSummaryKeyDown = (event: React.KeyboardEvent) => {\n if (disabled) return\n\n switch (event.key) {\n case 'ArrowRight':\n case 'Enter':\n case ' ':\n event.preventDefault()\n event.stopPropagation()\n setIsSubOpen(true)\n focusFirstItem()\n break\n case 'ArrowLeft':\n case 'Escape':\n event.preventDefault()\n event.stopPropagation()\n setIsSubOpen(false)\n break\n }\n }\n\n // Keyboard handler for submenu items\n const handleSubMenuKeyDown = (event: React.KeyboardEvent) => {\n switch (event.key) {\n case 'ArrowLeft':\n case 'Escape':\n event.preventDefault()\n event.stopPropagation()\n setIsSubOpen(false)\n summaryRef.current?.focus()\n break\n case 'ArrowDown':\n event.preventDefault()\n event.stopPropagation()\n const items = subMenuListRef.current?.querySelectorAll('[role=\"menuitem\"]:not([aria-disabled=\"true\"])')\n if (items) {\n const currentIndex = Array.from(items).findIndex(item => item === document.activeElement)\n const nextIndex = (currentIndex + 1) % items.length\n ;(items[nextIndex] as HTMLElement)?.focus()\n }\n break\n case 'ArrowUp':\n event.preventDefault()\n event.stopPropagation()\n const itemsUp = subMenuListRef.current?.querySelectorAll('[role=\"menuitem\"]:not([aria-disabled=\"true\"])')\n if (itemsUp) {\n const currentIndexUp = Array.from(itemsUp).findIndex(item => item === document.activeElement)\n const prevIndex = (currentIndexUp - 1 + itemsUp.length) % itemsUp.length\n ;(itemsUp[prevIndex] as HTMLElement)?.focus()\n }\n break\n }\n }\n\n const itemClasses = [disabled && 'disabled', className].filter(Boolean).join(' ')\n\n return (\n <li\n ref={subMenuRef}\n className={itemClasses}\n role=\"none\"\n data-key={itemKey}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <details open={isSubOpen}>\n <summary\n ref={summaryRef}\n role=\"menuitem\"\n tabIndex={disabled ? -1 : 0}\n aria-disabled={disabled || undefined}\n aria-haspopup=\"menu\"\n aria-expanded={isSubOpen}\n aria-controls={subMenuId}\n onKeyDown={handleSummaryKeyDown}\n >\n {icon && <span className=\"mr-2 inline-flex items-center\">{icon}</span>}\n {title}\n </summary>\n <ul\n ref={subMenuListRef}\n id={subMenuId}\n className=\"menu bg-base-100 rounded-box z-50 shadow\"\n role=\"menu\"\n aria-label={typeof title === 'string' ? title : undefined}\n onKeyDown={handleSubMenuKeyDown}\n >\n {children}\n </ul>\n </details>\n </li>\n )\n}\n\nfunction DropdownDivider({ className = '' }: DropdownDividerProps) {\n const classes = ['border-base-content/10', className].filter(Boolean).join(' ')\n return (\n <li role=\"separator\" className=\"my-1\">\n <hr className={classes} />\n </li>\n )\n}\n\nexport const Dropdown = Object.assign(DropdownRoot, {\n Trigger: DropdownTrigger,\n Menu: DropdownMenu,\n Item: DropdownItem,\n SubMenu: DropdownSubMenu,\n Divider: DropdownDivider,\n})\n"],"names":["DropdownContext","createContext","useDropdownContext","context","useContext","DropdownRoot","children","items","hover","trigger","position","align","controlledOpen","onOpenChange","disabled","arrow","mouseEnterDelay","mouseLeaveDelay","getPopupContainer","destroyOnHidden","className","rest","menuId","useId","triggerId","internalOpen","setInternalOpen","useState","focusedIndex","setFocusedIndex","itemCount","setItemCount","shouldRender","setShouldRender","itemRefs","useRef","dropdownRef","hoverTimeoutRef","triggers","isControlled","isOpen","setIsOpen","useCallback","open","source","closeDropdown","registerItem","index","ref","itemDisabled","useEffect","timeout","handleClickOutside","event","handleMouseEnter","handleMouseLeave","handleContextMenu","positionClasses","alignClasses","showArrow","dropdownClasses","renderItems","item","DropdownDivider","menuItem","jsx","DropdownSubMenu","child","DropdownItem","content","jsxs","Fragment","React","DropdownTrigger","DropdownMenu","handleKeyDown","handleClick","childProps","e","menuRef","childArray","enabledCount","menuClasses","childrenWithIndex","arrowElement","itemKey","icon","label","onClick","active","danger","itemClasses","title","isSubOpen","setIsSubOpen","subMenuRef","summaryRef","subMenuListRef","subMenuId","focusFirstItem","handleSummaryKeyDown","handleSubMenuKeyDown","nextIndex","itemsUp","prevIndex","classes","Dropdown"],"mappings":";;AAuCA,MAAMA,IAAkBC,GAAgD,MAAS;AAEjF,SAASC,IAAqB;AAC5B,QAAMC,IAAUC,GAAWJ,CAAe;AAC1C,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,2DAA2D;AAE7E,SAAOA;AACT;AAyEA,SAASE,GAAa;AAAA,EACpB,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,SAAAC,IAAU,CAAC,OAAO;AAAA,EAClB,UAAAC,IAAW;AAAA,EACX,OAAAC,IAAQ;AAAA,EACR,MAAMC;AAAA,EACN,cAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,OAAAC,IAAQ;AAAA,EACR,iBAAAC,IAAkB;AAAA,EAClB,iBAAAC,IAAkB;AAAA,EAClB,mBAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAkB;AAChB,QAAMC,IAASC,EAAA,GACTC,IAAYD,EAAA,GACZ,CAACE,GAAcC,CAAe,IAAIC,EAAS,EAAK,GAChD,CAACC,GAAcC,CAAe,IAAIF,EAAS,EAAE,GAC7C,CAACG,GAAWC,CAAY,IAAIJ,EAAS,CAAC,GACtC,CAACK,GAAcC,CAAe,IAAIN,EAAS,CAACR,CAAe,GAC3De,IAAWC,EAAoE,oBAAI,KAAK,GACxFC,IAAcD,EAAuB,IAAI,GACzCE,IAAkBF,EAA6C,IAAI,GAGnEG,IAAW9B,IAAQ,CAAC,OAAO,IAAIC,GAG/B8B,IAAe3B,MA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