@fragments-sdk/ui 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/ui.css +1642 -1679
- package/dist/chart.cjs.map +1 -1
- package/dist/chart.js.map +1 -1
- package/dist/codeblock.cjs +26 -18
- package/dist/codeblock.cjs.map +1 -1
- package/dist/codeblock.js +26 -18
- package/dist/codeblock.js.map +1 -1
- package/dist/components/Accordion/Accordion.module.scss.cjs +8 -8
- package/dist/components/Accordion/Accordion.module.scss.js +8 -8
- package/dist/components/Accordion/index.cjs +7 -3
- package/dist/components/Accordion/index.cjs.map +1 -1
- package/dist/components/Accordion/index.d.ts +24 -11
- package/dist/components/Accordion/index.d.ts.map +1 -1
- package/dist/components/Accordion/index.js +7 -3
- package/dist/components/Accordion/index.js.map +1 -1
- package/dist/components/Alert/Alert.module.scss.cjs +12 -12
- package/dist/components/Alert/Alert.module.scss.js +12 -12
- package/dist/components/Alert/index.cjs +37 -15
- package/dist/components/Alert/index.cjs.map +1 -1
- package/dist/components/Alert/index.d.ts +15 -22
- package/dist/components/Alert/index.d.ts.map +1 -1
- package/dist/components/Alert/index.js +37 -15
- package/dist/components/Alert/index.js.map +1 -1
- package/dist/components/AppShell/AppShell.module.scss.cjs +14 -14
- package/dist/components/AppShell/AppShell.module.scss.js +14 -14
- package/dist/components/AppShell/index.cjs +3 -1
- package/dist/components/AppShell/index.cjs.map +1 -1
- package/dist/components/AppShell/index.d.ts.map +1 -1
- package/dist/components/AppShell/index.js +3 -1
- package/dist/components/AppShell/index.js.map +1 -1
- package/dist/components/Avatar/index.cjs +9 -1
- package/dist/components/Avatar/index.cjs.map +1 -1
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Avatar/index.d.ts.map +1 -1
- package/dist/components/Avatar/index.js +9 -1
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/Badge/index.cjs +4 -2
- package/dist/components/Badge/index.cjs.map +1 -1
- package/dist/components/Badge/index.d.ts +3 -0
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js +4 -2
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/BentoGrid/BentoGrid.module.scss.cjs +11 -11
- package/dist/components/BentoGrid/BentoGrid.module.scss.js +11 -11
- package/dist/components/BentoGrid/index.cjs +8 -5
- package/dist/components/BentoGrid/index.cjs.map +1 -1
- package/dist/components/BentoGrid/index.d.ts +2 -8
- package/dist/components/BentoGrid/index.d.ts.map +1 -1
- package/dist/components/BentoGrid/index.js +8 -5
- package/dist/components/BentoGrid/index.js.map +1 -1
- package/dist/components/Box/index.cjs +12 -2
- package/dist/components/Box/index.cjs.map +1 -1
- package/dist/components/Box/index.d.ts +1 -1
- package/dist/components/Box/index.d.ts.map +1 -1
- package/dist/components/Box/index.js +12 -2
- package/dist/components/Box/index.js.map +1 -1
- package/dist/components/Breadcrumbs/index.cjs +3 -1
- package/dist/components/Breadcrumbs/index.cjs.map +1 -1
- package/dist/components/Breadcrumbs/index.d.ts +3 -1
- package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/index.js +3 -1
- package/dist/components/Breadcrumbs/index.js.map +1 -1
- package/dist/components/Button/Button.module.scss.cjs +11 -11
- package/dist/components/Button/Button.module.scss.js +11 -11
- package/dist/components/Button/index.cjs +5 -2
- package/dist/components/Button/index.cjs.map +1 -1
- package/dist/components/Button/index.d.ts +3 -3
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +5 -2
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/ButtonGroup/index.cjs +3 -2
- package/dist/components/ButtonGroup/index.cjs.map +1 -1
- package/dist/components/ButtonGroup/index.d.ts +1 -2
- package/dist/components/ButtonGroup/index.d.ts.map +1 -1
- package/dist/components/ButtonGroup/index.js +3 -2
- package/dist/components/ButtonGroup/index.js.map +1 -1
- package/dist/components/Card/Card.module.scss.cjs +14 -14
- package/dist/components/Card/Card.module.scss.js +14 -14
- package/dist/components/Card/index.cjs +3 -22
- package/dist/components/Card/index.cjs.map +1 -1
- package/dist/components/Card/index.d.ts +6 -11
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/Card/index.js +3 -22
- package/dist/components/Card/index.js.map +1 -1
- package/dist/components/Chart/Chart.module.scss.cjs +15 -15
- package/dist/components/Chart/Chart.module.scss.js +15 -15
- package/dist/components/Chart/index.d.ts +3 -3
- package/dist/components/Chart/index.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.scss.cjs +10 -10
- package/dist/components/Checkbox/Checkbox.module.scss.js +10 -10
- package/dist/components/Checkbox/index.cjs +11 -4
- package/dist/components/Checkbox/index.cjs.map +1 -1
- package/dist/components/Checkbox/index.d.ts +6 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +11 -4
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Chip/index.cjs +11 -3
- package/dist/components/Chip/index.cjs.map +1 -1
- package/dist/components/Chip/index.d.ts +1 -2
- package/dist/components/Chip/index.d.ts.map +1 -1
- package/dist/components/Chip/index.js +11 -3
- package/dist/components/Chip/index.js.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.module.scss.cjs +20 -20
- package/dist/components/CodeBlock/CodeBlock.module.scss.js +20 -20
- package/dist/components/CodeBlock/index.d.ts +8 -2
- package/dist/components/CodeBlock/index.d.ts.map +1 -1
- package/dist/components/Collapsible/Collapsible.module.scss.cjs +10 -10
- package/dist/components/Collapsible/Collapsible.module.scss.js +10 -10
- package/dist/components/Combobox/Combobox.module.scss.cjs +15 -15
- package/dist/components/Combobox/Combobox.module.scss.js +15 -15
- package/dist/components/Combobox/index.cjs +68 -18
- package/dist/components/Combobox/index.cjs.map +1 -1
- package/dist/components/Combobox/index.d.ts +32 -11
- package/dist/components/Combobox/index.d.ts.map +1 -1
- package/dist/components/Combobox/index.js +68 -18
- package/dist/components/Combobox/index.js.map +1 -1
- package/dist/components/Command/Command.module.scss.cjs +11 -11
- package/dist/components/Command/Command.module.scss.js +11 -11
- package/dist/components/Command/index.cjs +4 -4
- package/dist/components/Command/index.cjs.map +1 -1
- package/dist/components/Command/index.d.ts +1 -1
- package/dist/components/Command/index.d.ts.map +1 -1
- package/dist/components/Command/index.js +4 -4
- package/dist/components/Command/index.js.map +1 -1
- package/dist/components/ConversationList/ConversationList.module.scss.cjs +10 -10
- package/dist/components/ConversationList/ConversationList.module.scss.js +10 -10
- package/dist/components/ConversationList/index.cjs +6 -3
- package/dist/components/ConversationList/index.cjs.map +1 -1
- package/dist/components/ConversationList/index.d.ts +1 -1
- package/dist/components/ConversationList/index.d.ts.map +1 -1
- package/dist/components/ConversationList/index.js +6 -3
- package/dist/components/ConversationList/index.js.map +1 -1
- package/dist/components/DataTable/DataTable.module.scss.cjs +26 -26
- package/dist/components/DataTable/DataTable.module.scss.js +26 -26
- package/dist/components/DataTable/index.cjs +13 -4
- package/dist/components/DataTable/index.cjs.map +1 -1
- package/dist/components/DataTable/index.d.ts +7 -2
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DataTable/index.js +13 -4
- package/dist/components/DataTable/index.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.module.scss.cjs +26 -26
- package/dist/components/DatePicker/DatePicker.module.scss.js +26 -26
- package/dist/components/DatePicker/index.d.ts +2 -2
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.module.scss.cjs +14 -14
- package/dist/components/Dialog/Dialog.module.scss.js +14 -14
- package/dist/components/Dialog/index.cjs +2 -1
- package/dist/components/Dialog/index.cjs.map +1 -1
- package/dist/components/Dialog/index.d.ts +20 -7
- package/dist/components/Dialog/index.d.ts.map +1 -1
- package/dist/components/Dialog/index.js +2 -1
- package/dist/components/Dialog/index.js.map +1 -1
- package/dist/components/Drawer/Drawer.module.scss.cjs +26 -26
- package/dist/components/Drawer/Drawer.module.scss.js +26 -26
- package/dist/components/Drawer/index.cjs +30 -3
- package/dist/components/Drawer/index.cjs.map +1 -1
- package/dist/components/Drawer/index.d.ts +3 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +13 -3
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Editor/Editor.module.scss.cjs +17 -17
- package/dist/components/Editor/Editor.module.scss.js +17 -17
- package/dist/components/Editor/index.cjs +32 -7
- package/dist/components/Editor/index.cjs.map +1 -1
- package/dist/components/Editor/index.d.ts +16 -3
- package/dist/components/Editor/index.d.ts.map +1 -1
- package/dist/components/Editor/index.js +32 -7
- package/dist/components/Editor/index.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.module.scss.cjs +8 -8
- package/dist/components/EmptyState/EmptyState.module.scss.js +8 -8
- package/dist/components/EmptyState/index.cjs +12 -8
- package/dist/components/EmptyState/index.cjs.map +1 -1
- package/dist/components/EmptyState/index.d.ts +8 -12
- package/dist/components/EmptyState/index.d.ts.map +1 -1
- package/dist/components/EmptyState/index.js +12 -8
- package/dist/components/EmptyState/index.js.map +1 -1
- package/dist/components/Fieldset/index.cjs +2 -2
- package/dist/components/Fieldset/index.cjs.map +1 -1
- package/dist/components/Fieldset/index.d.ts +2 -3
- package/dist/components/Fieldset/index.d.ts.map +1 -1
- package/dist/components/Fieldset/index.js +2 -2
- package/dist/components/Fieldset/index.js.map +1 -1
- package/dist/components/Form/index.cjs +13 -13
- package/dist/components/Form/index.cjs.map +1 -1
- package/dist/components/Form/index.d.ts +5 -2
- package/dist/components/Form/index.d.ts.map +1 -1
- package/dist/components/Form/index.js +13 -13
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Grid/Grid.module.scss.cjs +57 -57
- package/dist/components/Grid/Grid.module.scss.js +57 -57
- package/dist/components/Grid/index.cjs +7 -4
- package/dist/components/Grid/index.cjs.map +1 -1
- package/dist/components/Grid/index.d.ts +5 -3
- package/dist/components/Grid/index.d.ts.map +1 -1
- package/dist/components/Grid/index.js +7 -4
- package/dist/components/Grid/index.js.map +1 -1
- package/dist/components/Header/Header.module.scss.cjs +21 -21
- package/dist/components/Header/Header.module.scss.js +21 -21
- package/dist/components/Header/index.cjs +61 -23
- package/dist/components/Header/index.cjs.map +1 -1
- package/dist/components/Header/index.d.ts +27 -34
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +61 -23
- package/dist/components/Header/index.js.map +1 -1
- package/dist/components/Icon/index.cjs +11 -1
- package/dist/components/Icon/index.cjs.map +1 -1
- package/dist/components/Icon/index.d.ts +28 -9
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +11 -1
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Image/index.cjs +15 -4
- package/dist/components/Image/index.cjs.map +1 -1
- package/dist/components/Image/index.d.ts +7 -1
- package/dist/components/Image/index.d.ts.map +1 -1
- package/dist/components/Image/index.js +15 -4
- package/dist/components/Image/index.js.map +1 -1
- package/dist/components/Input/Input.module.scss.cjs +13 -13
- package/dist/components/Input/Input.module.scss.js +13 -13
- package/dist/components/Input/index.cjs +79 -31
- package/dist/components/Input/index.cjs.map +1 -1
- package/dist/components/Input/index.d.ts +17 -3
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +79 -31
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Link/index.cjs +17 -0
- package/dist/components/Link/index.cjs.map +1 -1
- package/dist/components/Link/index.d.ts.map +1 -1
- package/dist/components/Link/index.js +17 -0
- package/dist/components/Link/index.js.map +1 -1
- package/dist/components/Listbox/Listbox.module.scss.cjs +8 -8
- package/dist/components/Listbox/Listbox.module.scss.js +8 -8
- package/dist/components/Listbox/index.cjs +10 -6
- package/dist/components/Listbox/index.cjs.map +1 -1
- package/dist/components/Listbox/index.d.ts +2 -2
- package/dist/components/Listbox/index.d.ts.map +1 -1
- package/dist/components/Listbox/index.js +10 -6
- package/dist/components/Listbox/index.js.map +1 -1
- package/dist/components/Markdown/Markdown.module.scss.cjs +1 -1
- package/dist/components/Markdown/Markdown.module.scss.js +1 -1
- package/dist/components/Markdown/index.d.ts +4 -2
- package/dist/components/Markdown/index.d.ts.map +1 -1
- package/dist/components/Menu/Menu.module.scss.cjs +13 -13
- package/dist/components/Menu/Menu.module.scss.js +13 -13
- package/dist/components/Menu/index.cjs +12 -1
- package/dist/components/Menu/index.cjs.map +1 -1
- package/dist/components/Menu/index.d.ts +9 -4
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +12 -1
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Message/Message.module.scss.cjs +18 -18
- package/dist/components/Message/Message.module.scss.js +18 -18
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.cjs +28 -28
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.js +28 -28
- package/dist/components/NavigationMenu/NavigationMenuContext.cjs.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenuContext.d.ts +8 -0
- package/dist/components/NavigationMenu/NavigationMenuContext.d.ts.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenuContext.js.map +1 -1
- package/dist/components/NavigationMenu/index.cjs +49 -10
- package/dist/components/NavigationMenu/index.cjs.map +1 -1
- package/dist/components/NavigationMenu/index.d.ts +5 -1
- package/dist/components/NavigationMenu/index.d.ts.map +1 -1
- package/dist/components/NavigationMenu/index.js +49 -10
- package/dist/components/NavigationMenu/index.js.map +1 -1
- package/dist/components/Pagination/index.cjs +37 -9
- package/dist/components/Pagination/index.cjs.map +1 -1
- package/dist/components/Pagination/index.d.ts +2 -3
- package/dist/components/Pagination/index.d.ts.map +1 -1
- package/dist/components/Pagination/index.js +37 -9
- package/dist/components/Pagination/index.js.map +1 -1
- package/dist/components/Popover/Popover.module.scss.cjs +10 -10
- package/dist/components/Popover/Popover.module.scss.js +10 -10
- package/dist/components/Popover/index.cjs +43 -2
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.ts +16 -6
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +26 -2
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/Progress/index.cjs +3 -1
- package/dist/components/Progress/index.cjs.map +1 -1
- package/dist/components/Progress/index.d.ts.map +1 -1
- package/dist/components/Progress/index.js +3 -1
- package/dist/components/Progress/index.js.map +1 -1
- package/dist/components/Prompt/Prompt.module.scss.cjs +14 -14
- package/dist/components/Prompt/Prompt.module.scss.js +14 -14
- package/dist/components/Prompt/index.cjs +14 -2
- package/dist/components/Prompt/index.cjs.map +1 -1
- package/dist/components/Prompt/index.d.ts +8 -5
- package/dist/components/Prompt/index.d.ts.map +1 -1
- package/dist/components/Prompt/index.js +14 -2
- package/dist/components/Prompt/index.js.map +1 -1
- package/dist/components/RadioGroup/index.cjs +14 -6
- package/dist/components/RadioGroup/index.cjs.map +1 -1
- package/dist/components/RadioGroup/index.d.ts +12 -2
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js +14 -6
- package/dist/components/RadioGroup/index.js.map +1 -1
- package/dist/components/Select/Select.module.scss.cjs +10 -10
- package/dist/components/Select/Select.module.scss.js +10 -10
- package/dist/components/Select/index.cjs +37 -24
- package/dist/components/Select/index.cjs.map +1 -1
- package/dist/components/Select/index.d.ts +6 -2
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +37 -24
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Sidebar/Sidebar.module.scss.cjs +42 -42
- package/dist/components/Sidebar/Sidebar.module.scss.js +42 -42
- package/dist/components/Sidebar/index.cjs +2 -2
- package/dist/components/Sidebar/index.cjs.map +1 -1
- package/dist/components/Sidebar/index.d.ts +3 -3
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/index.js +2 -2
- package/dist/components/Sidebar/index.js.map +1 -1
- package/dist/components/Skeleton/index.cjs +6 -3
- package/dist/components/Skeleton/index.cjs.map +1 -1
- package/dist/components/Skeleton/index.d.ts +3 -7
- package/dist/components/Skeleton/index.d.ts.map +1 -1
- package/dist/components/Skeleton/index.js +6 -3
- package/dist/components/Skeleton/index.js.map +1 -1
- package/dist/components/Slider/Slider.module.scss.cjs +13 -10
- package/dist/components/Slider/Slider.module.scss.cjs.map +1 -1
- package/dist/components/Slider/Slider.module.scss.js +13 -10
- package/dist/components/Slider/Slider.module.scss.js.map +1 -1
- package/dist/components/Slider/index.cjs +33 -1
- package/dist/components/Slider/index.cjs.map +1 -1
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Slider/index.d.ts.map +1 -1
- package/dist/components/Slider/index.js +33 -1
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Stack/index.cjs +12 -2
- package/dist/components/Stack/index.cjs.map +1 -1
- package/dist/components/Stack/index.d.ts +3 -2
- package/dist/components/Stack/index.d.ts.map +1 -1
- package/dist/components/Stack/index.js +12 -2
- package/dist/components/Stack/index.js.map +1 -1
- package/dist/components/Table/Table.module.scss.cjs +16 -16
- package/dist/components/Table/Table.module.scss.js +16 -16
- package/dist/components/Table/index.d.ts +10 -4
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/TableOfContents/index.cjs +8 -5
- package/dist/components/TableOfContents/index.cjs.map +1 -1
- package/dist/components/TableOfContents/index.d.ts +2 -2
- package/dist/components/TableOfContents/index.d.ts.map +1 -1
- package/dist/components/TableOfContents/index.js +8 -5
- package/dist/components/TableOfContents/index.js.map +1 -1
- package/dist/components/Tabs/Tabs.module.scss.cjs +9 -9
- package/dist/components/Tabs/Tabs.module.scss.js +9 -9
- package/dist/components/Tabs/index.cjs +9 -6
- package/dist/components/Tabs/index.cjs.map +1 -1
- package/dist/components/Tabs/index.d.ts +4 -1
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.js +9 -6
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Textarea/index.cjs +61 -43
- package/dist/components/Textarea/index.cjs.map +1 -1
- package/dist/components/Textarea/index.d.ts +9 -1
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +61 -43
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Theme/index.cjs +3 -1
- package/dist/components/Theme/index.cjs.map +1 -1
- package/dist/components/Theme/index.d.ts +2 -4
- package/dist/components/Theme/index.d.ts.map +1 -1
- package/dist/components/Theme/index.js +3 -1
- package/dist/components/Theme/index.js.map +1 -1
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.cjs +22 -22
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.js +22 -22
- package/dist/components/Toast/Toast.module.scss.cjs +20 -20
- package/dist/components/Toast/Toast.module.scss.js +20 -20
- package/dist/components/Toast/index.cjs +15 -14
- package/dist/components/Toast/index.cjs.map +1 -1
- package/dist/components/Toast/index.d.ts +9 -5
- package/dist/components/Toast/index.d.ts.map +1 -1
- package/dist/components/Toast/index.js +15 -14
- package/dist/components/Toast/index.js.map +1 -1
- package/dist/components/Toggle/Toggle.module.scss.cjs +11 -11
- package/dist/components/Toggle/Toggle.module.scss.js +11 -11
- package/dist/components/Toggle/index.cjs +1 -1
- package/dist/components/Toggle/index.cjs.map +1 -1
- package/dist/components/Toggle/index.js +1 -1
- package/dist/components/Toggle/index.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.cjs +17 -17
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.js +17 -17
- package/dist/components/ToggleGroup/index.cjs +27 -8
- package/dist/components/ToggleGroup/index.cjs.map +1 -1
- package/dist/components/ToggleGroup/index.d.ts +8 -3
- package/dist/components/ToggleGroup/index.d.ts.map +1 -1
- package/dist/components/ToggleGroup/index.js +27 -8
- package/dist/components/ToggleGroup/index.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.scss.cjs +3 -3
- package/dist/components/Tooltip/Tooltip.module.scss.js +3 -3
- package/dist/components/Tooltip/index.cjs +20 -4
- package/dist/components/Tooltip/index.cjs.map +1 -1
- package/dist/components/Tooltip/index.d.ts +3 -1
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/components/Tooltip/index.js +20 -4
- package/dist/components/Tooltip/index.js.map +1 -1
- package/dist/components/VisuallyHidden/index.cjs +10 -2
- package/dist/components/VisuallyHidden/index.cjs.map +1 -1
- package/dist/components/VisuallyHidden/index.d.ts +1 -1
- package/dist/components/VisuallyHidden/index.d.ts.map +1 -1
- package/dist/components/VisuallyHidden/index.js +10 -2
- package/dist/components/VisuallyHidden/index.js.map +1 -1
- package/dist/datepicker.cjs +8 -1
- package/dist/datepicker.cjs.map +1 -1
- package/dist/datepicker.js +8 -1
- package/dist/datepicker.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +5 -5
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.js +5 -5
- package/dist/markdown.js.map +1 -1
- package/dist/table.cjs +19 -3
- package/dist/table.cjs.map +1 -1
- package/dist/table.js +19 -3
- package/dist/table.js.map +1 -1
- package/fragments.json +1 -1
- package/package.json +2 -2
- package/src/blocks/AccountSettings.block.ts +1 -1
- package/src/blocks/ActivityFeed.block.ts +1 -1
- package/src/blocks/ActivityFeedSkeleton.block.ts +1 -1
- package/src/blocks/BlogEditor.block.ts +1 -1
- package/src/blocks/ChatInterface.block.ts +1 -1
- package/src/blocks/ChatMessages.block.ts +1 -1
- package/src/blocks/CheckoutForm.block.ts +1 -1
- package/src/blocks/CommandPalette.block.ts +1 -1
- package/src/blocks/ContactForm.block.ts +1 -1
- package/src/blocks/DashboardLayout.block.ts +1 -1
- package/src/blocks/DashboardPage.block.ts +1 -1
- package/src/blocks/DashboardSkeleton.block.ts +1 -1
- package/src/blocks/DataTable.block.ts +1 -1
- package/src/blocks/EmptyState.block.ts +1 -1
- package/src/blocks/FAQSection.block.ts +1 -1
- package/src/blocks/FeatureGrid.block.ts +1 -1
- package/src/blocks/HeroSection.block.ts +1 -1
- package/src/blocks/LoginForm.block.ts +1 -1
- package/src/blocks/NavigationHeader.block.ts +1 -1
- package/src/blocks/PaginatedTable.block.ts +1 -1
- package/src/blocks/PricingComparison.block.ts +1 -1
- package/src/blocks/ProductCard.block.ts +1 -1
- package/src/blocks/RegistrationForm.block.ts +1 -1
- package/src/blocks/SettingsDrawer.block.ts +1 -1
- package/src/blocks/SettingsPanel.block.ts +1 -1
- package/src/blocks/ShoppingCart.block.ts +1 -1
- package/src/blocks/StatsCard.block.ts +1 -1
- package/src/blocks/StatsCardSkeleton.block.ts +1 -1
- package/src/blocks/TableSkeleton.block.ts +1 -1
- package/src/blocks/ThinkingStates.block.ts +1 -1
- package/src/components/Accordion/Accordion.fragment.tsx +7 -7
- package/src/components/Accordion/Accordion.module.scss +2 -2
- package/src/components/Accordion/Accordion.test.tsx +8 -5
- package/src/components/Accordion/index.tsx +33 -13
- package/src/components/Alert/Alert.fragment.tsx +5 -1
- package/src/components/Alert/Alert.module.scss +1 -1
- package/src/components/Alert/Alert.test.tsx +25 -0
- package/src/components/Alert/index.tsx +49 -30
- package/src/components/AppShell/AppShell.fragment.tsx +1 -1
- package/src/components/AppShell/AppShell.module.scss +5 -5
- package/src/components/AppShell/AppShell.test.tsx +12 -0
- package/src/components/AppShell/index.tsx +2 -0
- package/src/components/Avatar/Avatar.fragment.tsx +7 -1
- package/src/components/Avatar/Avatar.test.tsx +24 -2
- package/src/components/Avatar/index.tsx +13 -1
- package/src/components/Badge/Badge.fragment.tsx +16 -1
- package/src/components/Badge/Badge.test.tsx +8 -1
- package/src/components/Badge/index.tsx +7 -2
- package/src/components/BentoGrid/BentoGrid.fragment.tsx +3 -1
- package/src/components/BentoGrid/BentoGrid.module.scss +52 -16
- package/src/components/BentoGrid/BentoGrid.test.tsx +20 -0
- package/src/components/BentoGrid/index.tsx +9 -12
- package/src/components/Box/Box.fragment.tsx +3 -1
- package/src/components/Box/Box.test.tsx +14 -0
- package/src/components/Box/index.tsx +8 -2
- package/src/components/Breadcrumbs/Breadcrumbs.fragment.tsx +19 -1
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +13 -0
- package/src/components/Breadcrumbs/index.tsx +5 -1
- package/src/components/Button/Button.fragment.tsx +28 -6
- package/src/components/Button/Button.module.scss +3 -3
- package/src/components/Button/Button.test.tsx +11 -0
- package/src/components/Button/index.tsx +16 -6
- package/src/components/ButtonGroup/ButtonGroup.fragment.tsx +4 -2
- package/src/components/ButtonGroup/ButtonGroup.test.tsx +10 -0
- package/src/components/ButtonGroup/index.tsx +3 -3
- package/src/components/Card/Card.fragment.tsx +24 -9
- package/src/components/Card/Card.module.scss +8 -8
- package/src/components/Card/Card.test.tsx +4 -5
- package/src/components/Card/index.tsx +8 -38
- package/src/components/Chart/Chart.fragment.tsx +5 -3
- package/src/components/Chart/Chart.module.scss +1 -1
- package/src/components/Chart/index.tsx +12 -10
- package/src/components/Checkbox/Checkbox.fragment.tsx +27 -1
- package/src/components/Checkbox/Checkbox.module.scss +3 -3
- package/src/components/Checkbox/index.tsx +16 -3
- package/src/components/Chip/Chip.fragment.tsx +20 -3
- package/src/components/Chip/Chip.test.tsx +28 -0
- package/src/components/Chip/index.tsx +14 -6
- package/src/components/CodeBlock/CodeBlock.fragment.tsx +3 -1
- package/src/components/CodeBlock/CodeBlock.module.scss +9 -9
- package/src/components/CodeBlock/CodeBlock.test.tsx +21 -0
- package/src/components/CodeBlock/index.tsx +23 -9
- package/src/components/Collapsible/Collapsible.fragment.tsx +1 -1
- package/src/components/Collapsible/Collapsible.module.scss +1 -1
- package/src/components/ColorPicker/ColorPicker.fragment.tsx +1 -1
- package/src/components/Combobox/Combobox.fragment.tsx +63 -9
- package/src/components/Combobox/Combobox.module.scss +4 -7
- package/src/components/Combobox/Combobox.test.tsx +24 -3
- package/src/components/Combobox/index.tsx +117 -34
- package/src/components/Command/Command.fragment.tsx +3 -3
- package/src/components/Command/Command.module.scss +5 -5
- package/src/components/Command/Command.test.tsx +17 -0
- package/src/components/Command/index.tsx +8 -5
- package/src/components/ConversationList/ConversationList.fragment.tsx +4 -3
- package/src/components/ConversationList/ConversationList.module.scss +5 -5
- package/src/components/ConversationList/ConversationList.test.tsx +21 -0
- package/src/components/ConversationList/index.tsx +8 -4
- package/src/components/DataTable/DataTable.fragment.tsx +12 -2
- package/src/components/DataTable/DataTable.module.scss +3 -3
- package/src/components/DataTable/DataTable.test.tsx +23 -2
- package/src/components/DataTable/index.tsx +23 -5
- package/src/components/DatePicker/DatePicker.fragment.tsx +3 -1
- package/src/components/DatePicker/DatePicker.module.scss +1 -1
- package/src/components/DatePicker/DatePicker.test.tsx +17 -0
- package/src/components/DatePicker/index.tsx +9 -2
- package/src/components/Dialog/Dialog.fragment.tsx +28 -1
- package/src/components/Dialog/Dialog.module.scss +6 -6
- package/src/components/Dialog/index.tsx +25 -7
- package/src/components/Drawer/Drawer.fragment.tsx +4 -1
- package/src/components/Drawer/Drawer.module.scss +3 -3
- package/src/components/Drawer/Drawer.test.tsx +8 -0
- package/src/components/Drawer/index.tsx +15 -3
- package/src/components/Editor/Editor.fragment.tsx +10 -3
- package/src/components/Editor/Editor.module.scss +4 -4
- package/src/components/Editor/Editor.test.tsx +68 -1
- package/src/components/Editor/index.tsx +60 -9
- package/src/components/EmptyState/EmptyState.fragment.tsx +3 -1
- package/src/components/EmptyState/EmptyState.module.scss +3 -3
- package/src/components/EmptyState/EmptyState.test.tsx +18 -0
- package/src/components/EmptyState/index.tsx +16 -16
- package/src/components/Field/Field.fragment.tsx +1 -1
- package/src/components/Fieldset/Fieldset.fragment.tsx +3 -1
- package/src/components/Fieldset/Fieldset.test.tsx +14 -0
- package/src/components/Fieldset/index.tsx +3 -4
- package/src/components/Form/Form.fragment.tsx +12 -7
- package/src/components/Form/index.tsx +13 -17
- package/src/components/Grid/Grid.fragment.tsx +4 -3
- package/src/components/Grid/Grid.module.scss +3 -3
- package/src/components/Grid/index.tsx +11 -6
- package/src/components/Header/Header.fragment.tsx +31 -1
- package/src/components/Header/Header.module.scss +6 -6
- package/src/components/Header/Header.test.tsx +95 -1
- package/src/components/Header/index.tsx +95 -46
- package/src/components/Icon/Icon.fragment.tsx +21 -8
- package/src/components/Icon/Icon.test.tsx +27 -3
- package/src/components/Icon/index.tsx +39 -15
- package/src/components/Image/Image.fragment.tsx +15 -1
- package/src/components/Image/Image.test.tsx +32 -1
- package/src/components/Image/index.tsx +24 -4
- package/src/components/Input/Input.fragment.tsx +49 -1
- package/src/components/Input/Input.module.scss +4 -2
- package/src/components/Input/Input.test.tsx +3 -3
- package/src/components/Input/index.tsx +103 -37
- package/src/components/Link/Link.fragment.tsx +7 -6
- package/src/components/Link/Link.test.tsx +17 -1
- package/src/components/Link/index.tsx +22 -0
- package/src/components/List/List.fragment.tsx +1 -1
- package/src/components/Listbox/Listbox.fragment.tsx +3 -3
- package/src/components/Listbox/Listbox.module.scss +4 -4
- package/src/components/Listbox/Listbox.test.tsx +14 -0
- package/src/components/Listbox/index.tsx +12 -2
- package/src/components/Loading/Loading.fragment.tsx +1 -1
- package/src/components/Markdown/Markdown.fragment.tsx +5 -3
- package/src/components/Markdown/Markdown.module.scss +5 -5
- package/src/components/Markdown/Markdown.test.tsx +6 -0
- package/src/components/Markdown/index.tsx +12 -9
- package/src/components/Menu/Menu.fragment.tsx +19 -1
- package/src/components/Menu/Menu.module.scss +11 -11
- package/src/components/Menu/index.tsx +19 -7
- package/src/components/Message/Message.fragment.tsx +1 -1
- package/src/components/Message/Message.module.scss +3 -3
- package/src/components/NavigationMenu/NavigationMenu.fragment.tsx +9 -1
- package/src/components/NavigationMenu/NavigationMenu.module.scss +7 -7
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +48 -0
- package/src/components/NavigationMenu/NavigationMenuContext.ts +14 -0
- package/src/components/NavigationMenu/index.tsx +70 -7
- package/src/components/Pagination/Pagination.fragment.tsx +4 -1
- package/src/components/Pagination/Pagination.test.tsx +39 -0
- package/src/components/Pagination/index.tsx +36 -10
- package/src/components/Popover/Popover.fragment.tsx +18 -1
- package/src/components/Popover/Popover.module.scss +13 -13
- package/src/components/Popover/index.tsx +33 -8
- package/src/components/Progress/Progress.fragment.tsx +3 -1
- package/src/components/Progress/Progress.test.tsx +8 -0
- package/src/components/Progress/index.tsx +9 -1
- package/src/components/Prompt/Prompt.fragment.tsx +4 -1
- package/src/components/Prompt/Prompt.module.scss +3 -3
- package/src/components/Prompt/Prompt.test.tsx +19 -0
- package/src/components/Prompt/index.tsx +24 -6
- package/src/components/RadioGroup/RadioGroup.fragment.tsx +31 -1
- package/src/components/RadioGroup/index.tsx +22 -3
- package/src/components/ScrollArea/ScrollArea.fragment.tsx +1 -1
- package/src/components/Select/Select.fragment.tsx +30 -3
- package/src/components/Select/Select.module.scss +3 -3
- package/src/components/Select/index.tsx +46 -33
- package/src/components/Separator/Separator.fragment.tsx +1 -1
- package/src/components/Sidebar/Sidebar.fragment.tsx +3 -1
- package/src/components/Sidebar/Sidebar.module.scss +20 -20
- package/src/components/Sidebar/Sidebar.test.tsx +25 -0
- package/src/components/Sidebar/index.tsx +7 -7
- package/src/components/Skeleton/Skeleton.fragment.tsx +3 -1
- package/src/components/Skeleton/Skeleton.test.tsx +12 -0
- package/src/components/Skeleton/index.tsx +6 -7
- package/src/components/Slider/Slider.fragment.tsx +21 -1
- package/src/components/Slider/Slider.module.scss +31 -0
- package/src/components/Slider/Slider.test.tsx +16 -0
- package/src/components/Slider/index.tsx +40 -1
- package/src/components/Stack/Stack.fragment.tsx +3 -1
- package/src/components/Stack/index.tsx +13 -6
- package/src/components/Table/Table.fragment.tsx +43 -2
- package/src/components/Table/Table.module.scss +2 -2
- package/src/components/Table/index.tsx +23 -5
- package/src/components/TableOfContents/TableOfContents.fragment.tsx +4 -2
- package/src/components/TableOfContents/TableOfContents.test.tsx +34 -9
- package/src/components/TableOfContents/index.tsx +9 -5
- package/src/components/Tabs/Tabs.fragment.tsx +33 -8
- package/src/components/Tabs/Tabs.module.scss +8 -8
- package/src/components/Tabs/index.tsx +22 -14
- package/src/components/Text/Text.fragment.tsx +1 -1
- package/src/components/Textarea/Textarea.fragment.tsx +27 -1
- package/src/components/Textarea/index.tsx +39 -14
- package/src/components/Theme/Theme.fragment.tsx +3 -1
- package/src/components/Theme/Theme.test.tsx +11 -0
- package/src/components/Theme/index.tsx +3 -3
- package/src/components/ThinkingIndicator/ThinkingIndicator.fragment.tsx +1 -1
- package/src/components/ThinkingIndicator/ThinkingIndicator.module.scss +1 -1
- package/src/components/Toast/Toast.fragment.tsx +6 -3
- package/src/components/Toast/Toast.module.scss +8 -6
- package/src/components/Toast/index.tsx +24 -20
- package/src/components/Toggle/Toggle.fragment.tsx +1 -1
- package/src/components/Toggle/Toggle.module.scss +61 -21
- package/src/components/Toggle/index.tsx +3 -3
- package/src/components/ToggleGroup/ToggleGroup.fragment.tsx +33 -8
- package/src/components/ToggleGroup/ToggleGroup.module.scss +3 -3
- package/src/components/ToggleGroup/index.tsx +29 -9
- package/src/components/Tooltip/Tooltip.fragment.tsx +16 -1
- package/src/components/Tooltip/Tooltip.module.scss +1 -1
- package/src/components/Tooltip/index.tsx +16 -1
- package/src/components/VisuallyHidden/VisuallyHidden.fragment.tsx +3 -1
- package/src/components/VisuallyHidden/VisuallyHidden.test.tsx +12 -0
- package/src/components/VisuallyHidden/index.tsx +7 -3
- package/src/index.ts +3 -2
- package/src/tokens/_computed.scss +1 -19
- package/src/tokens/_density.scss +0 -42
- package/src/tokens/_mixins.scss +4 -0
- package/src/tokens/_variables.scss +12 -114
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Menu/index.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Menu as BaseMenu } from '@base-ui/react/menu';\nimport styles from './Menu.module.scss';\n\n// ============================================\n// Types\n// ============================================\n\nexport interface MenuProps {\n children: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n modal?: boolean;\n}\n\nexport interface MenuTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n children: React.ReactNode;\n asChild?: boolean;\n}\n\nexport interface MenuContentProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode;\n side?: 'top' | 'bottom' | 'left' | 'right';\n align?: 'start' | 'center' | 'end';\n sideOffset?: number;\n}\n\nexport interface MenuItemProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children' | 'onSelect'> {\n children: React.ReactNode;\n disabled?: boolean;\n danger?: boolean;\n onSelect?: (...args: any[]) => void;\n icon?: React.ReactNode;\n shortcut?: string;\n /** When passed, renders a check indicator. `true` shows a checkmark, `false` reserves space. */\n checked?: boolean;\n}\n\nexport interface MenuCheckboxItemProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children' | 'onChange'> {\n children: React.ReactNode;\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n disabled?: boolean;\n}\n\nexport interface MenuRadioGroupProps {\n children: React.ReactNode;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n}\n\nexport interface MenuRadioItemProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {\n children: React.ReactNode;\n value: string;\n disabled?: boolean;\n}\n\nexport interface MenuGroupProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode;\n}\n\nexport interface MenuGroupLabelProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode;\n}\n\nexport interface MenuSeparatorProps extends React.HTMLAttributes<HTMLElement> {}\n\nexport interface MenuSubmenuProps {\n children: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nexport interface MenuSubmenuTriggerProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode;\n disabled?: boolean;\n icon?: React.ReactNode;\n}\n\n// ============================================\n// Icons\n// ============================================\n\nfunction CheckmarkIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M5 13l4 4L19 7\" />\n </svg>\n );\n}\n\nfunction DotIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"5\" />\n </svg>\n );\n}\n\n// ============================================\n// Components\n// ============================================\n\nfunction MenuRoot({\n children,\n open,\n defaultOpen,\n onOpenChange,\n modal = true,\n}: MenuProps) {\n return (\n <BaseMenu.Root\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n modal={modal}\n >\n {children}\n </BaseMenu.Root>\n );\n}\n\nfunction MenuTrigger({ children, asChild, className, ...htmlProps }: MenuTriggerProps) {\n if (asChild) {\n return (\n <BaseMenu.Trigger {...htmlProps} className={className} render={children as React.ReactElement}>\n {null}\n </BaseMenu.Trigger>\n );\n }\n\n return (\n <BaseMenu.Trigger {...htmlProps} className={className}>\n {children}\n </BaseMenu.Trigger>\n );\n}\n\nfunction MenuContent({\n children,\n className,\n side = 'bottom',\n align = 'start',\n sideOffset = 4,\n ...htmlProps\n}: MenuContentProps) {\n const popupClasses = [styles.popup, className].filter(Boolean).join(' ');\n\n return (\n <BaseMenu.Portal>\n <BaseMenu.Positioner\n side={side}\n align={align}\n sideOffset={sideOffset}\n className={styles.positioner}\n >\n <BaseMenu.Popup {...htmlProps} className={popupClasses}>\n {children}\n </BaseMenu.Popup>\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n );\n}\n\nfunction MenuItem({\n children,\n disabled,\n danger,\n onSelect,\n className,\n icon,\n shortcut,\n checked,\n ...htmlProps\n}: MenuItemProps) {\n const handleClick = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n (htmlProps.onClick as React.MouseEventHandler<HTMLElement> | undefined)?.(event);\n onSelect?.(event);\n },\n [htmlProps, onSelect],\n );\n\n const hasChecked = checked !== undefined;\n const classes = [\n styles.item,\n danger && styles.itemDanger,\n className,\n ].filter(Boolean).join(' ');\n\n return (\n <BaseMenu.Item\n {...htmlProps}\n disabled={disabled}\n onClick={handleClick as any}\n className={classes}\n >\n {hasChecked && (\n <span className={styles.checkIndicator}>\n {checked ? <CheckmarkIcon /> : null}\n </span>\n )}\n {icon && <span className={styles.itemIcon}>{icon}</span>}\n <span className={styles.itemLabel}>{children}</span>\n {shortcut && <span className={styles.itemShortcut}>{shortcut}</span>}\n </BaseMenu.Item>\n );\n}\n\nfunction MenuCheckboxItem({\n children,\n checked: checkedProp,\n defaultChecked,\n onCheckedChange,\n disabled,\n className,\n ...htmlProps\n}: MenuCheckboxItemProps) {\n const isControlled = checkedProp !== undefined;\n const [internalChecked, setInternalChecked] = React.useState(defaultChecked ?? false);\n const visualChecked = isControlled ? checkedProp : internalChecked;\n\n const handleCheckedChange = React.useCallback(\n (value: boolean) => {\n if (!isControlled) setInternalChecked(value);\n onCheckedChange?.(value);\n },\n [isControlled, onCheckedChange],\n );\n\n const classes = [styles.item, styles.checkboxItem, className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <BaseMenu.CheckboxItem\n {...htmlProps}\n checked={checkedProp}\n defaultChecked={defaultChecked}\n onCheckedChange={handleCheckedChange}\n disabled={disabled}\n className={classes}\n >\n <span className={styles.checkIndicator}>\n {visualChecked ? <CheckmarkIcon /> : null}\n </span>\n <span className={styles.itemLabel}>{children}</span>\n </BaseMenu.CheckboxItem>\n );\n}\n\nfunction MenuRadioGroup({\n children,\n value,\n defaultValue,\n onValueChange,\n}: MenuRadioGroupProps) {\n return (\n <BaseMenu.RadioGroup\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n >\n {children}\n </BaseMenu.RadioGroup>\n );\n}\n\nfunction MenuRadioItem({\n children,\n value,\n disabled,\n className,\n ...htmlProps\n}: MenuRadioItemProps) {\n const classes = [styles.item, styles.radioItem, className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <BaseMenu.RadioItem {...htmlProps} value={value} disabled={disabled} className={classes}>\n <span className={styles.radioIndicator}>\n <DotIcon />\n </span>\n <span className={styles.itemLabel}>{children}</span>\n </BaseMenu.RadioItem>\n );\n}\n\nfunction MenuGroup({ children, className, ...htmlProps }: MenuGroupProps) {\n const classes = [styles.group, className].filter(Boolean).join(' ');\n return <BaseMenu.Group {...htmlProps} className={classes}>{children}</BaseMenu.Group>;\n}\n\nfunction MenuGroupLabel({ children, className, ...htmlProps }: MenuGroupLabelProps) {\n const classes = [styles.groupLabel, className].filter(Boolean).join(' ');\n return <BaseMenu.GroupLabel {...htmlProps} className={classes}>{children}</BaseMenu.GroupLabel>;\n}\n\nfunction MenuSeparator({ className, ...htmlProps }: MenuSeparatorProps) {\n const classes = [styles.separator, className].filter(Boolean).join(' ');\n return <BaseMenu.Separator {...htmlProps} className={classes} />;\n}\n\nfunction MenuSubmenu({\n children,\n open,\n defaultOpen,\n onOpenChange,\n}: MenuSubmenuProps) {\n return (\n <BaseMenu.SubmenuRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange as any}\n >\n {children}\n </BaseMenu.SubmenuRoot>\n );\n}\n\nfunction MenuSubmenuTrigger({\n children,\n disabled,\n className,\n icon,\n ...htmlProps\n}: MenuSubmenuTriggerProps) {\n const classes = [styles.item, styles.submenuTrigger, className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <BaseMenu.SubmenuTrigger {...htmlProps} disabled={disabled} className={classes}>\n {icon && <span className={styles.itemIcon}>{icon}</span>}\n <span className={styles.itemLabel}>{children}</span>\n </BaseMenu.SubmenuTrigger>\n );\n}\n\n// ============================================\n// Export compound component\n// ============================================\n\nexport const Menu = Object.assign(MenuRoot, {\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n CheckboxItem: MenuCheckboxItem,\n RadioGroup: MenuRadioGroup,\n RadioItem: MenuRadioItem,\n Group: MenuGroup,\n GroupLabel: MenuGroupLabel,\n Separator: MenuSeparator,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n});\n\n// Re-export individual components\nexport {\n MenuRoot,\n MenuTrigger,\n MenuContent,\n MenuItem,\n MenuCheckboxItem,\n MenuRadioGroup,\n MenuRadioItem,\n MenuGroup,\n MenuGroupLabel,\n MenuSeparator,\n MenuSubmenu,\n MenuSubmenuTrigger,\n};\n"],"names":["BaseMenu"],"mappings":";;;;AAyFA,SAAS,gBAAgB;AACvB,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAa;AAAA,MACb,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,eAAY;AAAA,MAEZ,UAAA,oBAAC,QAAA,EAAK,GAAE,iBAAA,CAAiB;AAAA,IAAA;AAAA,EAAA;AAG/B;AAEA,SAAS,UAAU;AACjB,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,eAAY;AAAA,MAEZ,8BAAC,UAAA,EAAO,IAAG,MAAK,IAAG,MAAK,GAAE,IAAA,CAAI;AAAA,IAAA;AAAA,EAAA;AAGpC;AAMA,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACV,GAAc;AACZ,SACE;AAAA,IAACA,OAAS;AAAA,IAAT;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA,IAAA;AAAA,EAAA;AAGP;AAEA,SAAS,YAAY,EAAE,UAAU,SAAS,WAAW,GAAG,aAA+B;A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AA,MACA;AAAA,MACA;AAAA,MAEC;AAAA,IAAA;AAAA,EAAA;AAGP;AAEA,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA4B;AAC1B,QAAM,UAAU,CAAC,OAAO,MAAM,OAAO,gBAAgB,SAAS,EAC3D,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,qBAACA,OAAS,gBAAT,EAAyB,GAAG,WAAW,UAAoB,WAAW,SACpE,UAAA;AAAA,IAAA,QAAQ,oBAAC,QAAA,EAAK,WAAW,OAAO,UAAW,UAAA,MAAK;AAAA,IACjD,oBAAC,QAAA,EAAK,WAAW,OAAO,WAAY,SAAA,CAAS;AAAA,EAAA,GAC/C;AAEJ;AAMO,MAAM,OAAO,OAAO,OAAO,UAAU;AAAA,EAC1C,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,gBAAgB;AAClB,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Menu/index.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Menu as BaseMenu } from '@base-ui/react/menu';\nimport styles from './Menu.module.scss';\n\n// ============================================\n// Types\n// ============================================\n\nexport interface MenuProps {\n children: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n modal?: boolean;\n}\n\ntype MenuTriggerAsButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n children: React.ReactNode;\n asChild?: false;\n};\ntype MenuTriggerAsChildProps = Omit<React.HTMLAttributes<HTMLElement>, 'children'> & {\n children: React.ReactElement;\n asChild: true;\n};\nexport type MenuTriggerProps = MenuTriggerAsButtonProps | MenuTriggerAsChildProps;\n\nexport interface MenuContentProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode;\n side?: 'top' | 'bottom' | 'left' | 'right';\n align?: 'start' | 'center' | 'end';\n sideOffset?: number;\n}\n\nexport interface MenuItemProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children' | 'onSelect'> {\n children: React.ReactNode;\n disabled?: boolean;\n danger?: boolean;\n onSelect?: (event: React.MouseEvent<HTMLElement>) => void;\n icon?: React.ReactNode;\n shortcut?: string;\n /** When passed, renders a check indicator. `true` shows a checkmark, `false` reserves space. */\n checked?: boolean;\n}\n\nexport interface MenuCheckboxItemProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children' | 'onChange'> {\n children: React.ReactNode;\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n disabled?: boolean;\n}\n\nexport interface MenuRadioGroupProps {\n children: React.ReactNode;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n}\n\nexport interface MenuRadioItemProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {\n children: React.ReactNode;\n value: string;\n disabled?: boolean;\n}\n\nexport interface MenuGroupProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode;\n}\n\nexport interface MenuGroupLabelProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode;\n}\n\nexport interface MenuSeparatorProps extends React.HTMLAttributes<HTMLElement> {}\n\nexport interface MenuSubmenuProps {\n children: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nexport interface MenuSubmenuTriggerProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode;\n disabled?: boolean;\n icon?: React.ReactNode;\n}\n\n// ============================================\n// Icons\n// ============================================\n\nfunction CheckmarkIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M5 13l4 4L19 7\" />\n </svg>\n );\n}\n\nfunction DotIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"5\" />\n </svg>\n );\n}\n\n// ============================================\n// Components\n// ============================================\n\nfunction MenuRoot({\n children,\n open,\n defaultOpen,\n onOpenChange,\n modal = true,\n}: MenuProps) {\n return (\n <BaseMenu.Root\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n modal={modal}\n >\n {children}\n </BaseMenu.Root>\n );\n}\n\nfunction MenuTrigger({ children, asChild, className, ...htmlProps }: MenuTriggerProps) {\n if (asChild) {\n if (!React.isValidElement(children)) {\n throw new Error('Menu.Trigger with asChild requires a single valid React element child.');\n }\n return (\n <BaseMenu.Trigger {...htmlProps} className={className} render={children as React.ReactElement}>\n {null}\n </BaseMenu.Trigger>\n );\n }\n\n return (\n <BaseMenu.Trigger\n {...htmlProps}\n type={(htmlProps as React.ButtonHTMLAttributes<HTMLButtonElement>).type ?? 'button'}\n className={className}\n >\n {children}\n </BaseMenu.Trigger>\n );\n}\n\nfunction MenuContent({\n children,\n className,\n side = 'bottom',\n align = 'start',\n sideOffset = 4,\n ...htmlProps\n}: MenuContentProps) {\n const popupClasses = [styles.popup, className].filter(Boolean).join(' ');\n\n return (\n <BaseMenu.Portal>\n <BaseMenu.Positioner\n side={side}\n align={align}\n sideOffset={sideOffset}\n className={styles.positioner}\n >\n <BaseMenu.Popup {...htmlProps} className={popupClasses}>\n {children}\n </BaseMenu.Popup>\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n );\n}\n\nfunction MenuItem({\n children,\n disabled,\n danger,\n onSelect,\n className,\n icon,\n shortcut,\n checked,\n ...htmlProps\n}: MenuItemProps) {\n const handleClick = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n (htmlProps.onClick as React.MouseEventHandler<HTMLElement> | undefined)?.(event);\n onSelect?.(event);\n },\n [htmlProps, onSelect],\n );\n\n const hasChecked = checked !== undefined;\n const classes = [\n styles.item,\n danger && styles.itemDanger,\n className,\n ].filter(Boolean).join(' ');\n\n return (\n <BaseMenu.Item\n {...htmlProps}\n disabled={disabled}\n onClick={handleClick as React.MouseEventHandler<HTMLElement>}\n className={classes}\n >\n {hasChecked && (\n <span className={styles.checkIndicator}>\n {checked ? <CheckmarkIcon /> : null}\n </span>\n )}\n {icon && <span className={styles.itemIcon}>{icon}</span>}\n <span className={styles.itemLabel}>{children}</span>\n {shortcut && <span className={styles.itemShortcut}>{shortcut}</span>}\n </BaseMenu.Item>\n );\n}\n\nfunction MenuCheckboxItem({\n children,\n checked: checkedProp,\n defaultChecked,\n onCheckedChange,\n disabled,\n className,\n ...htmlProps\n}: MenuCheckboxItemProps) {\n const isControlled = checkedProp !== undefined;\n const [internalChecked, setInternalChecked] = React.useState(defaultChecked ?? false);\n const visualChecked = isControlled ? checkedProp : internalChecked;\n\n const handleCheckedChange = React.useCallback(\n (value: boolean) => {\n if (!isControlled) setInternalChecked(value);\n onCheckedChange?.(value);\n },\n [isControlled, onCheckedChange],\n );\n\n const classes = [styles.item, styles.checkboxItem, className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <BaseMenu.CheckboxItem\n {...htmlProps}\n checked={checkedProp}\n defaultChecked={defaultChecked}\n onCheckedChange={handleCheckedChange}\n disabled={disabled}\n className={classes}\n >\n <span className={styles.checkIndicator}>\n {visualChecked ? <CheckmarkIcon /> : null}\n </span>\n <span className={styles.itemLabel}>{children}</span>\n </BaseMenu.CheckboxItem>\n );\n}\n\nfunction MenuRadioGroup({\n children,\n value,\n defaultValue,\n onValueChange,\n}: MenuRadioGroupProps) {\n return (\n <BaseMenu.RadioGroup\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n >\n {children}\n </BaseMenu.RadioGroup>\n );\n}\n\nfunction MenuRadioItem({\n children,\n value,\n disabled,\n className,\n ...htmlProps\n}: MenuRadioItemProps) {\n const classes = [styles.item, styles.radioItem, className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <BaseMenu.RadioItem {...htmlProps} value={value} disabled={disabled} className={classes}>\n <span className={styles.radioIndicator}>\n <DotIcon />\n </span>\n <span className={styles.itemLabel}>{children}</span>\n </BaseMenu.RadioItem>\n );\n}\n\nfunction MenuGroup({ children, className, ...htmlProps }: MenuGroupProps) {\n const classes = [styles.group, className].filter(Boolean).join(' ');\n return <BaseMenu.Group {...htmlProps} className={classes}>{children}</BaseMenu.Group>;\n}\n\nfunction MenuGroupLabel({ children, className, ...htmlProps }: MenuGroupLabelProps) {\n const classes = [styles.groupLabel, className].filter(Boolean).join(' ');\n return <BaseMenu.GroupLabel {...htmlProps} className={classes}>{children}</BaseMenu.GroupLabel>;\n}\n\nfunction MenuSeparator({ className, ...htmlProps }: MenuSeparatorProps) {\n const classes = [styles.separator, className].filter(Boolean).join(' ');\n return <BaseMenu.Separator {...htmlProps} className={classes} />;\n}\n\nfunction MenuSubmenu({\n children,\n open,\n defaultOpen,\n onOpenChange,\n}: MenuSubmenuProps) {\n return (\n <BaseMenu.SubmenuRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n >\n {children}\n </BaseMenu.SubmenuRoot>\n );\n}\n\nfunction MenuSubmenuTrigger({\n children,\n disabled,\n className,\n icon,\n ...htmlProps\n}: MenuSubmenuTriggerProps) {\n const classes = [styles.item, styles.submenuTrigger, className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <BaseMenu.SubmenuTrigger {...htmlProps} disabled={disabled} className={classes}>\n {icon && <span className={styles.itemIcon}>{icon}</span>}\n <span className={styles.itemLabel}>{children}</span>\n </BaseMenu.SubmenuTrigger>\n );\n}\n\n// ============================================\n// Export compound component\n// ============================================\n\nexport const Menu = Object.assign(MenuRoot, {\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n CheckboxItem: MenuCheckboxItem,\n RadioGroup: MenuRadioGroup,\n RadioItem: MenuRadioItem,\n Group: MenuGroup,\n GroupLabel: MenuGroupLabel,\n Separator: MenuSeparator,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n});\n\n// Re-export individual components\nexport {\n MenuRoot,\n MenuTrigger,\n MenuContent,\n MenuItem,\n MenuCheckboxItem,\n MenuRadioGroup,\n MenuRadioItem,\n MenuGroup,\n MenuGroupLabel,\n MenuSeparator,\n MenuSubmenu,\n MenuSubmenuTrigger,\n};\n"],"names":["BaseMenu"],"mappings":";;;;AA8FA,SAAS,gBAAgB;AACvB,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAa;AAAA,MACb,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,eAAY;AAAA,MAEZ,UAAA,oBAAC,QAAA,EAAK,GAAE,iBAAA,CAAiB;AAAA,IAAA;AAAA,EAAA;AAG/B;AAEA,SAAS,UAAU;AACjB,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,eAAY;AAAA,MAEZ,8BAAC,UAAA,EAAO,IAAG,MAAK,IAAG,MAAK,GAAE,IAAA,CAAI;AAAA,IAAA;AAAA,EAAA;AAGpC;AAMA,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACV,GAAc;AACZ,SACE;AAAA,IAACA,OAAS;AAAA,IAAT;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA,IAAA;AAAA,EAAA;AAGP;AA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,OAAO,OAAO,EAAE,KAAK,GAAG;AACtE,6BAAQA,OAAS,WAAT,EAAoB,GAAG,WAAW,WAAW,SAAS;AAChE;AAEA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAqB;AACnB,SACE;AAAA,IAACA,OAAS;AAAA,IAAT;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA,IAAA;AAAA,EAAA;AAGP;AAEA,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA4B;AAC1B,QAAM,UAAU,CAAC,OAAO,MAAM,OAAO,gBAAgB,SAAS,EAC3D,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,qBAACA,OAAS,gBAAT,EAAyB,GAAG,WAAW,UAAoB,WAAW,SACpE,UAAA;AAAA,IAAA,QAAQ,oBAAC,QAAA,EAAK,WAAW,OAAO,UAAW,UAAA,MAAK;AAAA,IACjD,oBAAC,QAAA,EAAK,WAAW,OAAO,WAAY,SAAA,CAAS;AAAA,EAAA,GAC/C;AAEJ;AAMO,MAAM,OAAO,OAAO,OAAO,UAAU;AAAA,EAC1C,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,gBAAgB;AAClB,CAAC;"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const message = "
|
|
4
|
-
const actions = "
|
|
5
|
-
const user = "
|
|
6
|
-
const body = "
|
|
7
|
-
const content = "
|
|
8
|
-
const assistant = "
|
|
9
|
-
const system = "
|
|
10
|
-
const avatar = "
|
|
11
|
-
const error = "
|
|
12
|
-
const sending = "
|
|
13
|
-
const avatarUser = "
|
|
14
|
-
const avatarAssistant = "
|
|
15
|
-
const avatarSystem = "
|
|
16
|
-
const avatarImage = "
|
|
17
|
-
const avatarImg = "
|
|
18
|
-
const streaming = "
|
|
19
|
-
const blink = "
|
|
20
|
-
const timestamp = "
|
|
3
|
+
const message = "_message_7tbia_1";
|
|
4
|
+
const actions = "_actions_7tbia_8";
|
|
5
|
+
const user = "_user_7tbia_15";
|
|
6
|
+
const body = "_body_7tbia_19";
|
|
7
|
+
const content = "_content_7tbia_22";
|
|
8
|
+
const assistant = "_assistant_7tbia_27";
|
|
9
|
+
const system = "_system_7tbia_32";
|
|
10
|
+
const avatar = "_avatar_7tbia_42";
|
|
11
|
+
const error = "_error_7tbia_46";
|
|
12
|
+
const sending = "_sending_7tbia_52";
|
|
13
|
+
const avatarUser = "_avatarUser_7tbia_72";
|
|
14
|
+
const avatarAssistant = "_avatarAssistant_7tbia_77";
|
|
15
|
+
const avatarSystem = "_avatarSystem_7tbia_82";
|
|
16
|
+
const avatarImage = "_avatarImage_7tbia_87";
|
|
17
|
+
const avatarImg = "_avatarImg_7tbia_92";
|
|
18
|
+
const streaming = "_streaming_7tbia_148";
|
|
19
|
+
const blink = "_blink_7tbia_1";
|
|
20
|
+
const timestamp = "_timestamp_7tbia_174";
|
|
21
21
|
const styles = {
|
|
22
22
|
message,
|
|
23
23
|
actions,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
const message = "
|
|
2
|
-
const actions = "
|
|
3
|
-
const user = "
|
|
4
|
-
const body = "
|
|
5
|
-
const content = "
|
|
6
|
-
const assistant = "
|
|
7
|
-
const system = "
|
|
8
|
-
const avatar = "
|
|
9
|
-
const error = "
|
|
10
|
-
const sending = "
|
|
11
|
-
const avatarUser = "
|
|
12
|
-
const avatarAssistant = "
|
|
13
|
-
const avatarSystem = "
|
|
14
|
-
const avatarImage = "
|
|
15
|
-
const avatarImg = "
|
|
16
|
-
const streaming = "
|
|
17
|
-
const blink = "
|
|
18
|
-
const timestamp = "
|
|
1
|
+
const message = "_message_7tbia_1";
|
|
2
|
+
const actions = "_actions_7tbia_8";
|
|
3
|
+
const user = "_user_7tbia_15";
|
|
4
|
+
const body = "_body_7tbia_19";
|
|
5
|
+
const content = "_content_7tbia_22";
|
|
6
|
+
const assistant = "_assistant_7tbia_27";
|
|
7
|
+
const system = "_system_7tbia_32";
|
|
8
|
+
const avatar = "_avatar_7tbia_42";
|
|
9
|
+
const error = "_error_7tbia_46";
|
|
10
|
+
const sending = "_sending_7tbia_52";
|
|
11
|
+
const avatarUser = "_avatarUser_7tbia_72";
|
|
12
|
+
const avatarAssistant = "_avatarAssistant_7tbia_77";
|
|
13
|
+
const avatarSystem = "_avatarSystem_7tbia_82";
|
|
14
|
+
const avatarImage = "_avatarImage_7tbia_87";
|
|
15
|
+
const avatarImg = "_avatarImg_7tbia_92";
|
|
16
|
+
const streaming = "_streaming_7tbia_148";
|
|
17
|
+
const blink = "_blink_7tbia_1";
|
|
18
|
+
const timestamp = "_timestamp_7tbia_174";
|
|
19
19
|
const styles = {
|
|
20
20
|
message,
|
|
21
21
|
actions,
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const root = "
|
|
4
|
-
const rootVertical = "
|
|
5
|
-
const list = "
|
|
6
|
-
const listVertical = "
|
|
7
|
-
const trigger = "
|
|
8
|
-
const triggerChevron = "
|
|
9
|
-
const content = "
|
|
10
|
-
const link = "
|
|
11
|
-
const linkActive = "
|
|
12
|
-
const linkStructured = "
|
|
13
|
-
const linkIcon = "
|
|
14
|
-
const linkBody = "
|
|
15
|
-
const linkTitle = "
|
|
16
|
-
const linkDescription = "
|
|
17
|
-
const linkFeatured = "
|
|
18
|
-
const indicator = "
|
|
19
|
-
const viewport = "
|
|
20
|
-
const hamburger = "
|
|
21
|
-
const drawerBackdrop = "
|
|
22
|
-
const drawer = "
|
|
23
|
-
const drawerHeader = "
|
|
24
|
-
const drawerClose = "
|
|
25
|
-
const drawerBody = "
|
|
26
|
-
const drawerNav = "
|
|
27
|
-
const drawerLink = "
|
|
28
|
-
const drawerSectionLabel = "
|
|
29
|
-
const drawerCollapsibleTrigger = "
|
|
30
|
-
const drawerCollapsibleContent = "
|
|
3
|
+
const root = "_root_djefa_1";
|
|
4
|
+
const rootVertical = "_rootVertical_djefa_7";
|
|
5
|
+
const list = "_list_djefa_12";
|
|
6
|
+
const listVertical = "_listVertical_djefa_26";
|
|
7
|
+
const trigger = "_trigger_djefa_31";
|
|
8
|
+
const triggerChevron = "_triggerChevron_djefa_83";
|
|
9
|
+
const content = "_content_djefa_91";
|
|
10
|
+
const link = "_link_djefa_150";
|
|
11
|
+
const linkActive = "_linkActive_djefa_176";
|
|
12
|
+
const linkStructured = "_linkStructured_djefa_186";
|
|
13
|
+
const linkIcon = "_linkIcon_djefa_198";
|
|
14
|
+
const linkBody = "_linkBody_djefa_209";
|
|
15
|
+
const linkTitle = "_linkTitle_djefa_216";
|
|
16
|
+
const linkDescription = "_linkDescription_djefa_223";
|
|
17
|
+
const linkFeatured = "_linkFeatured_djefa_229";
|
|
18
|
+
const indicator = "_indicator_djefa_238";
|
|
19
|
+
const viewport = "_viewport_djefa_248";
|
|
20
|
+
const hamburger = "_hamburger_djefa_278";
|
|
21
|
+
const drawerBackdrop = "_drawerBackdrop_djefa_325";
|
|
22
|
+
const drawer = "_drawer_djefa_325";
|
|
23
|
+
const drawerHeader = "_drawerHeader_djefa_359";
|
|
24
|
+
const drawerClose = "_drawerClose_djefa_368";
|
|
25
|
+
const drawerBody = "_drawerBody_djefa_406";
|
|
26
|
+
const drawerNav = "_drawerNav_djefa_412";
|
|
27
|
+
const drawerLink = "_drawerLink_djefa_417";
|
|
28
|
+
const drawerSectionLabel = "_drawerSectionLabel_djefa_451";
|
|
29
|
+
const drawerCollapsibleTrigger = "_drawerCollapsibleTrigger_djefa_462";
|
|
30
|
+
const drawerCollapsibleContent = "_drawerCollapsibleContent_djefa_505";
|
|
31
31
|
const styles = {
|
|
32
32
|
root,
|
|
33
33
|
rootVertical,
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
const root = "
|
|
2
|
-
const rootVertical = "
|
|
3
|
-
const list = "
|
|
4
|
-
const listVertical = "
|
|
5
|
-
const trigger = "
|
|
6
|
-
const triggerChevron = "
|
|
7
|
-
const content = "
|
|
8
|
-
const link = "
|
|
9
|
-
const linkActive = "
|
|
10
|
-
const linkStructured = "
|
|
11
|
-
const linkIcon = "
|
|
12
|
-
const linkBody = "
|
|
13
|
-
const linkTitle = "
|
|
14
|
-
const linkDescription = "
|
|
15
|
-
const linkFeatured = "
|
|
16
|
-
const indicator = "
|
|
17
|
-
const viewport = "
|
|
18
|
-
const hamburger = "
|
|
19
|
-
const drawerBackdrop = "
|
|
20
|
-
const drawer = "
|
|
21
|
-
const drawerHeader = "
|
|
22
|
-
const drawerClose = "
|
|
23
|
-
const drawerBody = "
|
|
24
|
-
const drawerNav = "
|
|
25
|
-
const drawerLink = "
|
|
26
|
-
const drawerSectionLabel = "
|
|
27
|
-
const drawerCollapsibleTrigger = "
|
|
28
|
-
const drawerCollapsibleContent = "
|
|
1
|
+
const root = "_root_djefa_1";
|
|
2
|
+
const rootVertical = "_rootVertical_djefa_7";
|
|
3
|
+
const list = "_list_djefa_12";
|
|
4
|
+
const listVertical = "_listVertical_djefa_26";
|
|
5
|
+
const trigger = "_trigger_djefa_31";
|
|
6
|
+
const triggerChevron = "_triggerChevron_djefa_83";
|
|
7
|
+
const content = "_content_djefa_91";
|
|
8
|
+
const link = "_link_djefa_150";
|
|
9
|
+
const linkActive = "_linkActive_djefa_176";
|
|
10
|
+
const linkStructured = "_linkStructured_djefa_186";
|
|
11
|
+
const linkIcon = "_linkIcon_djefa_198";
|
|
12
|
+
const linkBody = "_linkBody_djefa_209";
|
|
13
|
+
const linkTitle = "_linkTitle_djefa_216";
|
|
14
|
+
const linkDescription = "_linkDescription_djefa_223";
|
|
15
|
+
const linkFeatured = "_linkFeatured_djefa_229";
|
|
16
|
+
const indicator = "_indicator_djefa_238";
|
|
17
|
+
const viewport = "_viewport_djefa_248";
|
|
18
|
+
const hamburger = "_hamburger_djefa_278";
|
|
19
|
+
const drawerBackdrop = "_drawerBackdrop_djefa_325";
|
|
20
|
+
const drawer = "_drawer_djefa_325";
|
|
21
|
+
const drawerHeader = "_drawerHeader_djefa_359";
|
|
22
|
+
const drawerClose = "_drawerClose_djefa_368";
|
|
23
|
+
const drawerBody = "_drawerBody_djefa_406";
|
|
24
|
+
const drawerNav = "_drawerNav_djefa_412";
|
|
25
|
+
const drawerLink = "_drawerLink_djefa_417";
|
|
26
|
+
const drawerSectionLabel = "_drawerSectionLabel_djefa_451";
|
|
27
|
+
const drawerCollapsibleTrigger = "_drawerCollapsibleTrigger_djefa_462";
|
|
28
|
+
const drawerCollapsibleContent = "_drawerCollapsibleContent_djefa_505";
|
|
29
29
|
const styles = {
|
|
30
30
|
root,
|
|
31
31
|
rootVertical,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuContext.cjs","sources":["../../../src/components/NavigationMenu/NavigationMenuContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\n// ============================================\n// Item Info (for mobile drawer auto-conversion)\n// ============================================\n\nexport interface NavigationMenuItemInfo {\n value: string;\n triggerLabel: string;\n contentChildren: React.ReactNode;\n linkHref?: string;\n}\n\n// ============================================\n// Root Context\n// ============================================\n\nexport interface NavigationMenuContextValue {\n value: string;\n setValue: (value: string) => void;\n orientation: 'horizontal' | 'vertical';\n delayDuration: number;\n skipDelayDuration: number;\n\n // Timer refs\n openTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;\n closeTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;\n isRecentlyOpenRef: React.MutableRefObject<boolean>;\n skipDelayTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;\n\n // Trigger registry for keyboard nav + indicator\n triggerRefs: React.MutableRefObject<Map<string, HTMLButtonElement>>;\n triggerOrder: React.MutableRefObject<string[]>;\n\n // Full item order (includes items without triggers)\n itemOrder: React.MutableRefObject<string[]>;\n\n // Item info registry (for mobile drawer)\n itemInfoMap: React.MutableRefObject<Map<string, NavigationMenuItemInfo>>;\n\n // Viewport size for animated transitions\n viewportSize: { width: number; height: number };\n setViewportSize: (size: { width: number; height: number }) => void;\n\n // Viewport ref for portal\n viewportRef: React.RefObject<HTMLDivElement | null>;\n\n // Track previous value for motion direction\n previousValue: React.MutableRefObject<string>;\n\n // Mobile state\n isMobile: boolean;\n mobileOpen: boolean;\n setMobileOpen: (open: boolean) => void;\n mobileContentChildren: React.ReactNode;\n setMobileContentChildren: (children: React.ReactNode) => void;\n mobileBrandChildren: React.ReactNode;\n setMobileBrandChildren: (children: React.ReactNode) => void;\n\n // Root nav id\n rootId: string;\n}\n\nexport const NavigationMenuContext = React.createContext<NavigationMenuContextValue | null>(null);\n\nexport function useNavigationMenuContext(): NavigationMenuContextValue {\n const ctx = React.useContext(NavigationMenuContext);\n if (!ctx) {\n throw new Error('NavigationMenu compound components must be used within NavigationMenu');\n }\n return ctx;\n}\n\n// ============================================\n// Item Context\n// ============================================\n\nexport interface NavigationMenuItemContextValue {\n value: string;\n triggerId: string;\n contentId: string;\n}\n\nexport const NavigationMenuItemContext = React.createContext<NavigationMenuItemContextValue | null>(null);\n\nexport function useNavigationMenuItemContext(): NavigationMenuItemContextValue {\n const ctx = React.useContext(NavigationMenuItemContext);\n if (!ctx) {\n throw new Error('NavigationMenu.Trigger/Content must be used within NavigationMenu.Item');\n }\n return ctx;\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"NavigationMenuContext.cjs","sources":["../../../src/components/NavigationMenu/NavigationMenuContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\n// ============================================\n// Item Info (for mobile drawer auto-conversion)\n// ============================================\n\nexport interface NavigationMenuItemInfo {\n value: string;\n triggerLabel: string;\n contentChildren: React.ReactNode;\n linkHref?: string;\n}\n\nexport interface NavigationMenuIconRenderState {\n slot: 'triggerChevron' | 'mobileMenu' | 'mobileClose' | 'drawerClose';\n open?: boolean;\n isMobile?: boolean;\n}\n\nexport type NavigationMenuIconSlot =\n | React.ReactNode\n | ((state: NavigationMenuIconRenderState) => React.ReactNode);\n\nexport type NavigationMenuIcons =\n Partial<Record<NavigationMenuIconRenderState['slot'], NavigationMenuIconSlot>>;\n\n// ============================================\n// Root Context\n// ============================================\n\nexport interface NavigationMenuContextValue {\n value: string;\n setValue: (value: string) => void;\n orientation: 'horizontal' | 'vertical';\n delayDuration: number;\n skipDelayDuration: number;\n\n // Timer refs\n openTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;\n closeTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;\n isRecentlyOpenRef: React.MutableRefObject<boolean>;\n skipDelayTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;\n\n // Trigger registry for keyboard nav + indicator\n triggerRefs: React.MutableRefObject<Map<string, HTMLButtonElement>>;\n triggerOrder: React.MutableRefObject<string[]>;\n\n // Full item order (includes items without triggers)\n itemOrder: React.MutableRefObject<string[]>;\n\n // Item info registry (for mobile drawer)\n itemInfoMap: React.MutableRefObject<Map<string, NavigationMenuItemInfo>>;\n\n // Viewport size for animated transitions\n viewportSize: { width: number; height: number };\n setViewportSize: (size: { width: number; height: number }) => void;\n\n // Viewport ref for portal\n viewportRef: React.RefObject<HTMLDivElement | null>;\n\n // Track previous value for motion direction\n previousValue: React.MutableRefObject<string>;\n\n // Mobile state\n isMobile: boolean;\n mobileOpen: boolean;\n setMobileOpen: (open: boolean) => void;\n mobileContentChildren: React.ReactNode;\n setMobileContentChildren: (children: React.ReactNode) => void;\n mobileBrandChildren: React.ReactNode;\n setMobileBrandChildren: (children: React.ReactNode) => void;\n\n // Root nav id\n rootId: string;\n icons?: NavigationMenuIcons;\n}\n\nexport const NavigationMenuContext = React.createContext<NavigationMenuContextValue | null>(null);\n\nexport function useNavigationMenuContext(): NavigationMenuContextValue {\n const ctx = React.useContext(NavigationMenuContext);\n if (!ctx) {\n throw new Error('NavigationMenu compound components must be used within NavigationMenu');\n }\n return ctx;\n}\n\n// ============================================\n// Item Context\n// ============================================\n\nexport interface NavigationMenuItemContextValue {\n value: string;\n triggerId: string;\n contentId: string;\n}\n\nexport const NavigationMenuItemContext = React.createContext<NavigationMenuItemContextValue | null>(null);\n\nexport function useNavigationMenuItemContext(): NavigationMenuItemContextValue {\n const ctx = React.useContext(NavigationMenuItemContext);\n if (!ctx) {\n throw new Error('NavigationMenu.Trigger/Content must be used within NavigationMenu.Item');\n }\n return ctx;\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+EO,MAAM,wBAAwBA,iBAAM,cAAiD,IAAI;AAEzF,SAAS,2BAAuD;AACrE,QAAM,MAAMA,iBAAM,WAAW,qBAAqB;AAClD,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,uEAAuE;AAAA,EACzF;AACA,SAAO;AACT;AAYO,MAAM,4BAA4BA,iBAAM,cAAqD,IAAI;AAEjG,SAAS,+BAA+D;AAC7E,QAAM,MAAMA,iBAAM,WAAW,yBAAyB;AACtD,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,wEAAwE;AAAA,EAC1F;AACA,SAAO;AACT;;;;;"}
|
|
@@ -5,6 +5,13 @@ export interface NavigationMenuItemInfo {
|
|
|
5
5
|
contentChildren: React.ReactNode;
|
|
6
6
|
linkHref?: string;
|
|
7
7
|
}
|
|
8
|
+
export interface NavigationMenuIconRenderState {
|
|
9
|
+
slot: 'triggerChevron' | 'mobileMenu' | 'mobileClose' | 'drawerClose';
|
|
10
|
+
open?: boolean;
|
|
11
|
+
isMobile?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export type NavigationMenuIconSlot = React.ReactNode | ((state: NavigationMenuIconRenderState) => React.ReactNode);
|
|
14
|
+
export type NavigationMenuIcons = Partial<Record<NavigationMenuIconRenderState['slot'], NavigationMenuIconSlot>>;
|
|
8
15
|
export interface NavigationMenuContextValue {
|
|
9
16
|
value: string;
|
|
10
17
|
setValue: (value: string) => void;
|
|
@@ -37,6 +44,7 @@ export interface NavigationMenuContextValue {
|
|
|
37
44
|
mobileBrandChildren: React.ReactNode;
|
|
38
45
|
setMobileBrandChildren: (children: React.ReactNode) => void;
|
|
39
46
|
rootId: string;
|
|
47
|
+
icons?: NavigationMenuIcons;
|
|
40
48
|
}
|
|
41
49
|
export declare const NavigationMenuContext: React.Context<NavigationMenuContextValue | null>;
|
|
42
50
|
export declare function useNavigationMenuContext(): NavigationMenuContextValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuContext.d.ts","sourceRoot":"","sources":["../../../src/components/NavigationMenu/NavigationMenuContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"NavigationMenuContext.d.ts","sourceRoot":"","sources":["../../../src/components/NavigationMenu/NavigationMenuContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,gBAAgB,GAAG,YAAY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":["'use client';\n\nimport * as React from 'react';\n\n// ============================================\n// Item Info (for mobile drawer auto-conversion)\n// ============================================\n\nexport interface NavigationMenuItemInfo {\n value: string;\n triggerLabel: string;\n contentChildren: React.ReactNode;\n linkHref?: string;\n}\n\n// ============================================\n// Root Context\n// ============================================\n\nexport interface NavigationMenuContextValue {\n value: string;\n setValue: (value: string) => void;\n orientation: 'horizontal' | 'vertical';\n delayDuration: number;\n skipDelayDuration: number;\n\n // Timer refs\n openTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;\n closeTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;\n isRecentlyOpenRef: React.MutableRefObject<boolean>;\n skipDelayTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;\n\n // Trigger registry for keyboard nav + indicator\n triggerRefs: React.MutableRefObject<Map<string, HTMLButtonElement>>;\n triggerOrder: React.MutableRefObject<string[]>;\n\n // Full item order (includes items without triggers)\n itemOrder: React.MutableRefObject<string[]>;\n\n // Item info registry (for mobile drawer)\n itemInfoMap: React.MutableRefObject<Map<string, NavigationMenuItemInfo>>;\n\n // Viewport size for animated transitions\n viewportSize: { width: number; height: number };\n setViewportSize: (size: { width: number; height: number }) => void;\n\n // Viewport ref for portal\n viewportRef: React.RefObject<HTMLDivElement | null>;\n\n // Track previous value for motion direction\n previousValue: React.MutableRefObject<string>;\n\n // Mobile state\n isMobile: boolean;\n mobileOpen: boolean;\n setMobileOpen: (open: boolean) => void;\n mobileContentChildren: React.ReactNode;\n setMobileContentChildren: (children: React.ReactNode) => void;\n mobileBrandChildren: React.ReactNode;\n setMobileBrandChildren: (children: React.ReactNode) => void;\n\n // Root nav id\n rootId: string;\n}\n\nexport const NavigationMenuContext = React.createContext<NavigationMenuContextValue | null>(null);\n\nexport function useNavigationMenuContext(): NavigationMenuContextValue {\n const ctx = React.useContext(NavigationMenuContext);\n if (!ctx) {\n throw new Error('NavigationMenu compound components must be used within NavigationMenu');\n }\n return ctx;\n}\n\n// ============================================\n// Item Context\n// ============================================\n\nexport interface NavigationMenuItemContextValue {\n value: string;\n triggerId: string;\n contentId: string;\n}\n\nexport const NavigationMenuItemContext = React.createContext<NavigationMenuItemContextValue | null>(null);\n\nexport function useNavigationMenuItemContext(): NavigationMenuItemContextValue {\n const ctx = React.useContext(NavigationMenuItemContext);\n if (!ctx) {\n throw new Error('NavigationMenu.Trigger/Content must be used within NavigationMenu.Item');\n }\n return ctx;\n}\n"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"NavigationMenuContext.js","sources":["../../../src/components/NavigationMenu/NavigationMenuContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\n// ============================================\n// Item Info (for mobile drawer auto-conversion)\n// ============================================\n\nexport interface NavigationMenuItemInfo {\n value: string;\n triggerLabel: string;\n contentChildren: React.ReactNode;\n linkHref?: string;\n}\n\nexport interface NavigationMenuIconRenderState {\n slot: 'triggerChevron' | 'mobileMenu' | 'mobileClose' | 'drawerClose';\n open?: boolean;\n isMobile?: boolean;\n}\n\nexport type NavigationMenuIconSlot =\n | React.ReactNode\n | ((state: NavigationMenuIconRenderState) => React.ReactNode);\n\nexport type NavigationMenuIcons =\n Partial<Record<NavigationMenuIconRenderState['slot'], NavigationMenuIconSlot>>;\n\n// ============================================\n// Root Context\n// ============================================\n\nexport interface NavigationMenuContextValue {\n value: string;\n setValue: (value: string) => void;\n orientation: 'horizontal' | 'vertical';\n delayDuration: number;\n skipDelayDuration: number;\n\n // Timer refs\n openTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;\n closeTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;\n isRecentlyOpenRef: React.MutableRefObject<boolean>;\n skipDelayTimerRef: React.MutableRefObject<ReturnType<typeof setTimeout> | null>;\n\n // Trigger registry for keyboard nav + indicator\n triggerRefs: React.MutableRefObject<Map<string, HTMLButtonElement>>;\n triggerOrder: React.MutableRefObject<string[]>;\n\n // Full item order (includes items without triggers)\n itemOrder: React.MutableRefObject<string[]>;\n\n // Item info registry (for mobile drawer)\n itemInfoMap: React.MutableRefObject<Map<string, NavigationMenuItemInfo>>;\n\n // Viewport size for animated transitions\n viewportSize: { width: number; height: number };\n setViewportSize: (size: { width: number; height: number }) => void;\n\n // Viewport ref for portal\n viewportRef: React.RefObject<HTMLDivElement | null>;\n\n // Track previous value for motion direction\n previousValue: React.MutableRefObject<string>;\n\n // Mobile state\n isMobile: boolean;\n mobileOpen: boolean;\n setMobileOpen: (open: boolean) => void;\n mobileContentChildren: React.ReactNode;\n setMobileContentChildren: (children: React.ReactNode) => void;\n mobileBrandChildren: React.ReactNode;\n setMobileBrandChildren: (children: React.ReactNode) => void;\n\n // Root nav id\n rootId: string;\n icons?: NavigationMenuIcons;\n}\n\nexport const NavigationMenuContext = React.createContext<NavigationMenuContextValue | null>(null);\n\nexport function useNavigationMenuContext(): NavigationMenuContextValue {\n const ctx = React.useContext(NavigationMenuContext);\n if (!ctx) {\n throw new Error('NavigationMenu compound components must be used within NavigationMenu');\n }\n return ctx;\n}\n\n// ============================================\n// Item Context\n// ============================================\n\nexport interface NavigationMenuItemContextValue {\n value: string;\n triggerId: string;\n contentId: string;\n}\n\nexport const NavigationMenuItemContext = React.createContext<NavigationMenuItemContextValue | null>(null);\n\nexport function useNavigationMenuItemContext(): NavigationMenuItemContextValue {\n const ctx = React.useContext(NavigationMenuItemContext);\n if (!ctx) {\n throw new Error('NavigationMenu.Trigger/Content must be used within NavigationMenu.Item');\n }\n return ctx;\n}\n"],"names":[],"mappings":";AA+EO,MAAM,wBAAwB,MAAM,cAAiD,IAAI;AAEzF,SAAS,2BAAuD;AACrE,QAAM,MAAM,MAAM,WAAW,qBAAqB;AAClD,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,uEAAuE;AAAA,EACzF;AACA,SAAO;AACT;AAYO,MAAM,4BAA4B,MAAM,cAAqD,IAAI;AAEjG,SAAS,+BAA+D;AAC7E,QAAM,MAAM,MAAM,WAAW,yBAAyB;AACtD,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,wEAAwE;AAAA,EAC1F;AACA,SAAO;AACT;"}
|
|
@@ -27,6 +27,13 @@ function _interopNamespaceDefault(e) {
|
|
|
27
27
|
return Object.freeze(n);
|
|
28
28
|
}
|
|
29
29
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
30
|
+
function composeNavMenuClickHandlers(childHandler, internalHandler) {
|
|
31
|
+
return (event) => {
|
|
32
|
+
childHandler == null ? void 0 : childHandler(event);
|
|
33
|
+
if (event.defaultPrevented) return;
|
|
34
|
+
internalHandler(event);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
30
37
|
function useIsMobile() {
|
|
31
38
|
const [isMobile, setIsMobile] = React__namespace.useState(false);
|
|
32
39
|
React__namespace.useEffect(() => {
|
|
@@ -39,6 +46,10 @@ function useIsMobile() {
|
|
|
39
46
|
}, []);
|
|
40
47
|
return isMobile;
|
|
41
48
|
}
|
|
49
|
+
function renderNavigationMenuIcon(slot, state) {
|
|
50
|
+
if (slot === void 0) return void 0;
|
|
51
|
+
return typeof slot === "function" ? slot(state) : slot;
|
|
52
|
+
}
|
|
42
53
|
function NavigationMenuRoot({
|
|
43
54
|
children,
|
|
44
55
|
value: controlledValue,
|
|
@@ -47,6 +58,7 @@ function NavigationMenuRoot({
|
|
|
47
58
|
orientation = "horizontal",
|
|
48
59
|
delayDuration = 200,
|
|
49
60
|
skipDelayDuration = 300,
|
|
61
|
+
icons,
|
|
50
62
|
className,
|
|
51
63
|
"aria-label": ariaLabel = "Main navigation",
|
|
52
64
|
...htmlProps
|
|
@@ -70,9 +82,10 @@ function NavigationMenuRoot({
|
|
|
70
82
|
...state,
|
|
71
83
|
orientation,
|
|
72
84
|
isMobile,
|
|
73
|
-
rootId
|
|
85
|
+
rootId,
|
|
86
|
+
icons
|
|
74
87
|
}),
|
|
75
|
-
[state, orientation, isMobile, rootId]
|
|
88
|
+
[state, orientation, isMobile, rootId, icons]
|
|
76
89
|
);
|
|
77
90
|
return /* @__PURE__ */ jsxRuntime.jsx(NavigationMenuContext.NavigationMenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs("nav", { ...htmlProps, className: classes, "aria-label": ariaLabel, "data-orientation": orientation, children: [
|
|
78
91
|
children,
|
|
@@ -150,6 +163,7 @@ function NavigationMenuItem({ children, value: valueProp, className }) {
|
|
|
150
163
|
return /* @__PURE__ */ jsxRuntime.jsx(NavigationMenuContext.NavigationMenuItemContext.Provider, { value: itemCtx, children: /* @__PURE__ */ jsxRuntime.jsx("li", { className, children }) });
|
|
151
164
|
}
|
|
152
165
|
function NavigationMenuTrigger({ children, className }) {
|
|
166
|
+
var _a;
|
|
153
167
|
const ctx = NavigationMenuContext.useNavigationMenuContext();
|
|
154
168
|
const itemCtx = NavigationMenuContext.useNavigationMenuItemContext();
|
|
155
169
|
const isOpen = ctx.value === itemCtx.value;
|
|
@@ -201,7 +215,7 @@ function NavigationMenuTrigger({ children, className }) {
|
|
|
201
215
|
}, ctx.delayDuration);
|
|
202
216
|
};
|
|
203
217
|
const handleKeyDown = (e) => {
|
|
204
|
-
var
|
|
218
|
+
var _a2;
|
|
205
219
|
if (e.key === "Enter" || e.key === " ") {
|
|
206
220
|
e.preventDefault();
|
|
207
221
|
ctx.setValue(isOpen ? "" : itemCtx.value);
|
|
@@ -209,10 +223,15 @@ function NavigationMenuTrigger({ children, className }) {
|
|
|
209
223
|
if (e.key === "Escape" && isOpen) {
|
|
210
224
|
e.preventDefault();
|
|
211
225
|
ctx.setValue("");
|
|
212
|
-
(
|
|
226
|
+
(_a2 = triggerRef.current) == null ? void 0 : _a2.focus();
|
|
213
227
|
}
|
|
214
228
|
};
|
|
215
229
|
const classes = [NavigationMenu_module.default.trigger, className].filter(Boolean).join(" ");
|
|
230
|
+
const chevronOverride = renderNavigationMenuIcon((_a = ctx.icons) == null ? void 0 : _a.triggerChevron, {
|
|
231
|
+
slot: "triggerChevron",
|
|
232
|
+
open: isOpen,
|
|
233
|
+
isMobile: ctx.isMobile
|
|
234
|
+
});
|
|
216
235
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
217
236
|
"button",
|
|
218
237
|
{
|
|
@@ -230,7 +249,7 @@ function NavigationMenuTrigger({ children, className }) {
|
|
|
230
249
|
onKeyDown: handleKeyDown,
|
|
231
250
|
children: [
|
|
232
251
|
children,
|
|
233
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.CaretDown, { size: 12, className: NavigationMenu_module.default.triggerChevron, "aria-hidden": true })
|
|
252
|
+
chevronOverride ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: NavigationMenu_module.default.triggerChevron, "aria-hidden": true, children: chevronOverride }) : /* @__PURE__ */ jsxRuntime.jsx(react.CaretDown, { size: 12, className: NavigationMenu_module.default.triggerChevron, "aria-hidden": true })
|
|
234
253
|
]
|
|
235
254
|
}
|
|
236
255
|
);
|
|
@@ -343,6 +362,7 @@ function NavigationMenuLink({
|
|
|
343
362
|
}, [ctx, itemCtx, children, title, href]);
|
|
344
363
|
const handleClick = (e) => {
|
|
345
364
|
onClick == null ? void 0 : onClick(e);
|
|
365
|
+
if (e.defaultPrevented) return;
|
|
346
366
|
if ((ctx == null ? void 0 : ctx.isMobile) && ctx.mobileOpen) {
|
|
347
367
|
ctx.setMobileOpen(false);
|
|
348
368
|
}
|
|
@@ -366,9 +386,11 @@ function NavigationMenuLink({
|
|
|
366
386
|
onClick: handleClick
|
|
367
387
|
};
|
|
368
388
|
if (asChild && React__namespace.isValidElement(children)) {
|
|
389
|
+
const childProps = children.props;
|
|
369
390
|
return React__namespace.cloneElement(children, {
|
|
370
391
|
...linkProps2,
|
|
371
|
-
|
|
392
|
+
onClick: composeNavMenuClickHandlers(childProps.onClick, handleClick),
|
|
393
|
+
className: [classes2, childProps.className].filter(Boolean).join(" "),
|
|
372
394
|
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
373
395
|
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: NavigationMenu_module.default.linkIcon, children: icon }),
|
|
374
396
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: NavigationMenu_module.default.linkBody, children: [
|
|
@@ -399,9 +421,11 @@ function NavigationMenuLink({
|
|
|
399
421
|
onClick: handleClick
|
|
400
422
|
};
|
|
401
423
|
if (asChild && React__namespace.isValidElement(children)) {
|
|
424
|
+
const childProps = children.props;
|
|
402
425
|
return React__namespace.cloneElement(children, {
|
|
403
426
|
...linkProps,
|
|
404
|
-
|
|
427
|
+
onClick: composeNavMenuClickHandlers(childProps.onClick, handleClick),
|
|
428
|
+
className: [classes, childProps.className].filter(Boolean).join(" ")
|
|
405
429
|
});
|
|
406
430
|
}
|
|
407
431
|
return /* @__PURE__ */ jsxRuntime.jsx("a", { ...linkProps, children });
|
|
@@ -498,7 +522,17 @@ function NavigationMenuMobileSection({ children, label }) {
|
|
|
498
522
|
] });
|
|
499
523
|
}
|
|
500
524
|
function MobileHamburger() {
|
|
501
|
-
|
|
525
|
+
var _a, _b;
|
|
526
|
+
const ctx = NavigationMenuContext.useNavigationMenuContext();
|
|
527
|
+
const { mobileOpen, setMobileOpen } = ctx;
|
|
528
|
+
const iconOverride = renderNavigationMenuIcon(
|
|
529
|
+
mobileOpen ? (_a = ctx.icons) == null ? void 0 : _a.mobileClose : (_b = ctx.icons) == null ? void 0 : _b.mobileMenu,
|
|
530
|
+
{
|
|
531
|
+
slot: mobileOpen ? "mobileClose" : "mobileMenu",
|
|
532
|
+
open: mobileOpen,
|
|
533
|
+
isMobile: true
|
|
534
|
+
}
|
|
535
|
+
);
|
|
502
536
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
503
537
|
"button",
|
|
504
538
|
{
|
|
@@ -507,11 +541,12 @@ function MobileHamburger() {
|
|
|
507
541
|
onClick: () => setMobileOpen(!mobileOpen),
|
|
508
542
|
"aria-label": "Toggle navigation",
|
|
509
543
|
"aria-expanded": mobileOpen,
|
|
510
|
-
children: mobileOpen ? /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 24, "aria-hidden": true }) : /* @__PURE__ */ jsxRuntime.jsx(react.List, { size: 24, "aria-hidden": true })
|
|
544
|
+
children: iconOverride ?? (mobileOpen ? /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 24, "aria-hidden": true }) : /* @__PURE__ */ jsxRuntime.jsx(react.List, { size: 24, "aria-hidden": true }))
|
|
511
545
|
}
|
|
512
546
|
);
|
|
513
547
|
}
|
|
514
548
|
function MobileDrawer() {
|
|
549
|
+
var _a;
|
|
515
550
|
const ctx = NavigationMenuContext.useNavigationMenuContext();
|
|
516
551
|
const drawerRef = React__namespace.useRef(null);
|
|
517
552
|
a11y.useFocusTrap(drawerRef, true);
|
|
@@ -565,7 +600,11 @@ function MobileDrawer() {
|
|
|
565
600
|
className: NavigationMenu_module.default.drawerClose,
|
|
566
601
|
onClick: () => ctx.setMobileOpen(false),
|
|
567
602
|
"aria-label": "Close navigation",
|
|
568
|
-
children:
|
|
603
|
+
children: renderNavigationMenuIcon((_a = ctx.icons) == null ? void 0 : _a.drawerClose, {
|
|
604
|
+
slot: "drawerClose",
|
|
605
|
+
open: ctx.mobileOpen,
|
|
606
|
+
isMobile: true
|
|
607
|
+
}) ?? /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 20, "aria-hidden": true })
|
|
569
608
|
}
|
|
570
609
|
)
|
|
571
610
|
] }),
|