@gnome-ui/react 1.45.1 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AboutDialog/AboutDialog.cjs +1 -1
- package/dist/components/AboutDialog/AboutDialog.cjs.map +1 -1
- package/dist/components/AboutDialog/AboutDialog.d.ts +1 -1
- package/dist/components/AboutDialog/AboutDialog.js +106 -108
- package/dist/components/AboutDialog/AboutDialog.js.map +1 -1
- package/dist/components/AboutDialog/AboutDialog.module.css.cjs +1 -1
- package/dist/components/AboutDialog/AboutDialog.module.css.js +28 -29
- package/dist/components/AboutDialog.cjs +1 -1
- package/dist/components/ActionRow/ActionRow.cjs +1 -1
- package/dist/components/ActionRow/ActionRow.cjs.map +1 -1
- package/dist/components/ActionRow/ActionRow.d.ts +1 -1
- package/dist/components/ActionRow/ActionRow.js +2 -2
- package/dist/components/ActionRow/ActionRow.js.map +1 -1
- package/dist/components/ActionRow.cjs +1 -1
- package/dist/components/Avatar/Avatar.cjs +1 -1
- package/dist/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.js +2 -2
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar.cjs +1 -1
- package/dist/components/AvatarRotator/AvatarRotator.cjs +1 -1
- package/dist/components/AvatarRotator/AvatarRotator.cjs.map +1 -1
- package/dist/components/AvatarRotator/AvatarRotator.d.ts +1 -1
- package/dist/components/AvatarRotator/AvatarRotator.js +2 -2
- package/dist/components/AvatarRotator/AvatarRotator.js.map +1 -1
- package/dist/components/AvatarRotator.cjs +1 -1
- package/dist/components/Badge/Badge.cjs +1 -1
- package/dist/components/Badge/Badge.cjs.map +1 -1
- package/dist/components/Badge/Badge.d.ts +1 -1
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge.cjs +1 -1
- package/dist/components/Banner/Banner.cjs +1 -1
- package/dist/components/Banner/Banner.cjs.map +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/Banner/Banner.js +34 -36
- package/dist/components/Banner/Banner.js.map +1 -1
- package/dist/components/Banner/Banner.module.css.cjs +1 -1
- package/dist/components/Banner/Banner.module.css.js +11 -12
- package/dist/components/Banner.cjs +1 -1
- package/dist/components/Bin/Bin.cjs +1 -1
- package/dist/components/Bin/Bin.cjs.map +1 -1
- package/dist/components/Bin/Bin.d.ts +1 -1
- package/dist/components/Bin/Bin.js +4 -6
- package/dist/components/Bin/Bin.js.map +1 -1
- package/dist/components/Bin.cjs +1 -1
- package/dist/components/Blockquote/Blockquote.cjs +1 -1
- package/dist/components/Blockquote/Blockquote.cjs.map +1 -1
- package/dist/components/Blockquote/Blockquote.d.ts +1 -1
- package/dist/components/Blockquote/Blockquote.js +24 -26
- package/dist/components/Blockquote/Blockquote.js.map +1 -1
- package/dist/components/Blockquote.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/components/BottomSheet/BottomSheet.js +37 -38
- package/dist/components/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.module.css.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.module.css.js +8 -9
- package/dist/components/BottomSheet.cjs +1 -1
- package/dist/components/Box/Box.cjs +1 -1
- package/dist/components/Box/Box.cjs.map +1 -1
- package/dist/components/Box/Box.d.ts +1 -1
- package/dist/components/Box/Box.js +2 -2
- package/dist/components/Box/Box.js.map +1 -1
- package/dist/components/Box.cjs +1 -1
- package/dist/components/BoxedList/BoxedList.cjs +1 -1
- package/dist/components/BoxedList/BoxedList.cjs.map +1 -1
- package/dist/components/BoxedList/BoxedList.d.ts +1 -1
- package/dist/components/BoxedList/BoxedList.js +2 -2
- package/dist/components/BoxedList/BoxedList.js.map +1 -1
- package/dist/components/BoxedList.cjs +1 -1
- package/dist/components/BreakpointBin/BreakpointBin.cjs +1 -1
- package/dist/components/BreakpointBin/BreakpointBin.cjs.map +1 -1
- package/dist/components/BreakpointBin/BreakpointBin.d.ts +1 -1
- package/dist/components/BreakpointBin/BreakpointBin.js +2 -2
- package/dist/components/BreakpointBin/BreakpointBin.js.map +1 -1
- package/dist/components/BreakpointBin.cjs +1 -1
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button.cjs +1 -1
- package/dist/components/ButtonContent/ButtonContent.cjs +1 -1
- package/dist/components/ButtonContent/ButtonContent.cjs.map +1 -1
- package/dist/components/ButtonContent/ButtonContent.d.ts +1 -1
- package/dist/components/ButtonContent/ButtonContent.js +24 -26
- package/dist/components/ButtonContent/ButtonContent.js.map +1 -1
- package/dist/components/ButtonContent.cjs +1 -1
- package/dist/components/ButtonRow/ButtonRow.cjs +1 -1
- package/dist/components/ButtonRow/ButtonRow.cjs.map +1 -1
- package/dist/components/ButtonRow/ButtonRow.d.ts +1 -1
- package/dist/components/ButtonRow/ButtonRow.js +22 -24
- package/dist/components/ButtonRow/ButtonRow.js.map +1 -1
- package/dist/components/ButtonRow.cjs +1 -1
- package/dist/components/Card/Card.cjs +1 -1
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.js +10 -12
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.module.css.cjs +1 -1
- package/dist/components/Card/Card.module.css.js +4 -5
- package/dist/components/Card.cjs +1 -1
- package/dist/components/Carousel/Carousel.cjs +1 -1
- package/dist/components/Carousel/Carousel.cjs.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +3 -3
- package/dist/components/Carousel/Carousel.js +28 -34
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel.cjs +1 -1
- package/dist/components/CheckRow/CheckRow.cjs +1 -1
- package/dist/components/CheckRow/CheckRow.cjs.map +1 -1
- package/dist/components/CheckRow/CheckRow.d.ts +1 -1
- package/dist/components/CheckRow/CheckRow.js +7 -7
- package/dist/components/CheckRow/CheckRow.js.map +1 -1
- package/dist/components/CheckRow.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +2 -2
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox.cjs +1 -1
- package/dist/components/Chip/Chip.cjs +1 -1
- package/dist/components/Chip/Chip.cjs.map +1 -1
- package/dist/components/Chip/Chip.d.ts +1 -1
- package/dist/components/Chip/Chip.js +2 -2
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Chip.cjs +1 -1
- package/dist/components/Clamp/Clamp.cjs +1 -1
- package/dist/components/Clamp/Clamp.cjs.map +1 -1
- package/dist/components/Clamp/Clamp.d.ts +1 -1
- package/dist/components/Clamp/Clamp.js +9 -11
- package/dist/components/Clamp/Clamp.js.map +1 -1
- package/dist/components/Clamp.cjs +1 -1
- package/dist/components/ColorPicker/ColorPicker.cjs +1 -1
- package/dist/components/ColorPicker/ColorPicker.cjs.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +2 -2
- package/dist/components/ColorPicker/ColorPicker.js +33 -37
- package/dist/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.module.css.cjs +1 -1
- package/dist/components/ColorPicker/ColorPicker.module.css.js +9 -10
- package/dist/components/ColorPicker.cjs +1 -1
- package/dist/components/ColumnView/ColumnView.cjs +1 -1
- package/dist/components/ColumnView/ColumnView.cjs.map +1 -1
- package/dist/components/ColumnView/ColumnView.d.ts +1 -1
- package/dist/components/ColumnView/ColumnView.js +24 -28
- package/dist/components/ColumnView/ColumnView.js.map +1 -1
- package/dist/components/ColumnView.cjs +1 -1
- package/dist/components/ComboRow/ComboRow.cjs +1 -1
- package/dist/components/ComboRow/ComboRow.cjs.map +1 -1
- package/dist/components/ComboRow/ComboRow.d.ts +1 -1
- package/dist/components/ComboRow/ComboRow.js +2 -2
- package/dist/components/ComboRow/ComboRow.js.map +1 -1
- package/dist/components/ComboRow/ComboRow.module.css.cjs +1 -1
- package/dist/components/ComboRow/ComboRow.module.css.js +24 -25
- package/dist/components/ComboRow.cjs +1 -1
- package/dist/components/ContributionGraph/ContributionGraph.cjs +1 -1
- package/dist/components/ContributionGraph/ContributionGraph.cjs.map +1 -1
- package/dist/components/ContributionGraph/ContributionGraph.d.ts +1 -1
- package/dist/components/ContributionGraph/ContributionGraph.js +2 -2
- package/dist/components/ContributionGraph/ContributionGraph.js.map +1 -1
- package/dist/components/ContributionGraph.cjs +1 -1
- package/dist/components/CountDownTimer/CountDownTimer.cjs +1 -1
- package/dist/components/CountDownTimer/CountDownTimer.cjs.map +1 -1
- package/dist/components/CountDownTimer/CountDownTimer.d.ts +1 -1
- package/dist/components/CountDownTimer/CountDownTimer.js +2 -2
- package/dist/components/CountDownTimer/CountDownTimer.js.map +1 -1
- package/dist/components/CountDownTimer.cjs +1 -1
- package/dist/components/Dialog/Dialog.cjs +1 -1
- package/dist/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/Dialog.js +51 -52
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dialog/Dialog.module.css.cjs +1 -1
- package/dist/components/Dialog/Dialog.module.css.js +8 -9
- package/dist/components/Dialog/dialogUtils.cjs +1 -1
- package/dist/components/Dialog/dialogUtils.cjs.map +1 -1
- package/dist/components/Dialog/dialogUtils.d.ts +6 -0
- package/dist/components/Dialog/dialogUtils.js +11 -2
- package/dist/components/Dialog/dialogUtils.js.map +1 -1
- package/dist/components/Dialog.cjs +1 -1
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +1 -1
- package/dist/components/Drawer/Drawer.js +2 -2
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/Drawer.module.css.cjs +1 -1
- package/dist/components/Drawer/Drawer.module.css.js +11 -12
- package/dist/components/Drawer.cjs +1 -1
- package/dist/components/Dropdown/Dropdown.cjs +1 -1
- package/dist/components/Dropdown/Dropdown.cjs.map +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.js +89 -85
- package/dist/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.module.css.cjs +1 -1
- package/dist/components/Dropdown/Dropdown.module.css.js +20 -21
- package/dist/components/Dropdown.cjs +1 -1
- package/dist/components/EntryRow/EntryRow.cjs +1 -1
- package/dist/components/EntryRow/EntryRow.cjs.map +1 -1
- package/dist/components/EntryRow/EntryRow.d.ts +1 -1
- package/dist/components/EntryRow/EntryRow.js +2 -2
- package/dist/components/EntryRow/EntryRow.js.map +1 -1
- package/dist/components/EntryRow.cjs +1 -1
- package/dist/components/ExpanderRow/ExpanderRow.cjs +1 -1
- package/dist/components/ExpanderRow/ExpanderRow.cjs.map +1 -1
- package/dist/components/ExpanderRow/ExpanderRow.d.ts +1 -1
- package/dist/components/ExpanderRow/ExpanderRow.js +2 -2
- package/dist/components/ExpanderRow/ExpanderRow.js.map +1 -1
- package/dist/components/ExpanderRow.cjs +1 -1
- package/dist/components/Footer/Footer.cjs +1 -1
- package/dist/components/Footer/Footer.cjs.map +1 -1
- package/dist/components/Footer/Footer.d.ts +1 -1
- package/dist/components/Footer/Footer.js +22 -24
- package/dist/components/Footer/Footer.js.map +1 -1
- package/dist/components/Footer.cjs +1 -1
- package/dist/components/Frame/Frame.cjs +1 -1
- package/dist/components/Frame/Frame.cjs.map +1 -1
- package/dist/components/Frame/Frame.d.ts +1 -1
- package/dist/components/Frame/Frame.js +5 -7
- package/dist/components/Frame/Frame.js.map +1 -1
- package/dist/components/Frame.cjs +1 -1
- package/dist/components/GnomeProvider/GnomeContext.cjs +1 -1
- package/dist/components/GnomeProvider/GnomeContext.cjs.map +1 -1
- package/dist/components/GnomeProvider/GnomeContext.js.map +1 -1
- package/dist/components/GnomeProvider/GnomeProvider.cjs +1 -1
- package/dist/components/GnomeProvider/GnomeProvider.cjs.map +1 -1
- package/dist/components/GnomeProvider/GnomeProvider.d.ts +1 -1
- package/dist/components/GnomeProvider/GnomeProvider.js +2 -2
- package/dist/components/GnomeProvider/GnomeProvider.js.map +1 -1
- package/dist/components/HeaderBar/HeaderBar.cjs +1 -1
- package/dist/components/HeaderBar/HeaderBar.cjs.map +1 -1
- package/dist/components/HeaderBar/HeaderBar.d.ts +1 -1
- package/dist/components/HeaderBar/HeaderBar.js +26 -28
- package/dist/components/HeaderBar/HeaderBar.js.map +1 -1
- package/dist/components/HeaderBar.cjs +1 -1
- package/dist/components/Icon/Icon.cjs +1 -1
- package/dist/components/Icon/Icon.cjs.map +1 -1
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/Icon.js +2 -2
- package/dist/components/Icon/Icon.js.map +1 -1
- package/dist/components/Icon.cjs +1 -1
- package/dist/components/IconButton/IconButton.cjs +1 -1
- package/dist/components/IconButton/IconButton.cjs.map +1 -1
- package/dist/components/IconButton/IconButton.js +4 -4
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/IconButton.cjs +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.cjs +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.cjs.map +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.d.ts +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.js +2 -2
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.js.map +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.cjs +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.cjs.map +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.d.ts +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.js +2 -2
- package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.js.map +1 -1
- package/dist/components/InlineViewSwitcher.cjs +1 -1
- package/dist/components/Link/Link.cjs +1 -1
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/Link/Link.js +2 -2
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/Link.cjs +1 -1
- package/dist/components/LinkedGroup/LinkedGroup.cjs +1 -1
- package/dist/components/LinkedGroup/LinkedGroup.cjs.map +1 -1
- package/dist/components/LinkedGroup/LinkedGroup.d.ts +1 -1
- package/dist/components/LinkedGroup/LinkedGroup.js +9 -11
- package/dist/components/LinkedGroup/LinkedGroup.js.map +1 -1
- package/dist/components/LinkedGroup.cjs +1 -1
- package/dist/components/NavigationSplitView/NavigationSplitView.cjs +1 -1
- package/dist/components/NavigationSplitView/NavigationSplitView.cjs.map +1 -1
- package/dist/components/NavigationSplitView/NavigationSplitView.d.ts +1 -1
- package/dist/components/NavigationSplitView/NavigationSplitView.js +2 -2
- package/dist/components/NavigationSplitView/NavigationSplitView.js.map +1 -1
- package/dist/components/NavigationSplitView.cjs +1 -1
- package/dist/components/NavigationView/NavigationView.cjs +1 -1
- package/dist/components/NavigationView/NavigationView.cjs.map +1 -1
- package/dist/components/NavigationView/NavigationView.d.ts +2 -2
- package/dist/components/NavigationView/NavigationView.js +3 -4
- package/dist/components/NavigationView/NavigationView.js.map +1 -1
- package/dist/components/NavigationView/NavigationView.module.css.cjs +1 -1
- package/dist/components/NavigationView/NavigationView.module.css.js +9 -10
- package/dist/components/NavigationView.cjs +1 -1
- package/dist/components/OverlaySplitView/OverlaySplitView.cjs +1 -1
- package/dist/components/OverlaySplitView/OverlaySplitView.cjs.map +1 -1
- package/dist/components/OverlaySplitView/OverlaySplitView.d.ts +1 -1
- package/dist/components/OverlaySplitView/OverlaySplitView.js +2 -2
- package/dist/components/OverlaySplitView/OverlaySplitView.js.map +1 -1
- package/dist/components/OverlaySplitView.cjs +1 -1
- package/dist/components/PasswordEntryRow/PasswordEntryRow.cjs +1 -1
- package/dist/components/PasswordEntryRow/PasswordEntryRow.cjs.map +1 -1
- package/dist/components/PasswordEntryRow/PasswordEntryRow.d.ts +1 -1
- package/dist/components/PasswordEntryRow/PasswordEntryRow.js +11 -10
- package/dist/components/PasswordEntryRow/PasswordEntryRow.js.map +1 -1
- package/dist/components/PasswordEntryRow.cjs +1 -1
- package/dist/components/PathBar/PathBar.cjs +1 -1
- package/dist/components/PathBar/PathBar.cjs.map +1 -1
- package/dist/components/PathBar/PathBar.d.ts +1 -1
- package/dist/components/PathBar/PathBar.js +48 -50
- package/dist/components/PathBar/PathBar.js.map +1 -1
- package/dist/components/PathBar.cjs +1 -1
- package/dist/components/Popover/Popover.cjs +1 -1
- package/dist/components/Popover/Popover.cjs.map +1 -1
- package/dist/components/Popover/Popover.d.ts +1 -1
- package/dist/components/Popover/Popover.js +5 -5
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Popover.cjs +1 -1
- package/dist/components/PreferencesDialog/PreferencesDialog.cjs +1 -1
- package/dist/components/PreferencesDialog/PreferencesDialog.cjs.map +1 -1
- package/dist/components/PreferencesDialog/PreferencesDialog.d.ts +1 -1
- package/dist/components/PreferencesDialog/PreferencesDialog.js +2 -2
- package/dist/components/PreferencesDialog/PreferencesDialog.js.map +1 -1
- package/dist/components/PreferencesDialog/PreferencesDialog.module.css.cjs +1 -1
- package/dist/components/PreferencesDialog/PreferencesDialog.module.css.js +18 -19
- package/dist/components/PreferencesDialog.cjs +1 -1
- package/dist/components/PreferencesGroup/PreferencesGroup.cjs +1 -1
- package/dist/components/PreferencesGroup/PreferencesGroup.cjs.map +1 -1
- package/dist/components/PreferencesGroup/PreferencesGroup.d.ts +1 -1
- package/dist/components/PreferencesGroup/PreferencesGroup.js +2 -2
- package/dist/components/PreferencesGroup/PreferencesGroup.js.map +1 -1
- package/dist/components/PreferencesGroup.cjs +1 -1
- package/dist/components/PreferencesPage/PreferencesPage.cjs +1 -1
- package/dist/components/PreferencesPage/PreferencesPage.cjs.map +1 -1
- package/dist/components/PreferencesPage/PreferencesPage.d.ts +1 -1
- package/dist/components/PreferencesPage/PreferencesPage.js +9 -11
- package/dist/components/PreferencesPage/PreferencesPage.js.map +1 -1
- package/dist/components/PreferencesPage.cjs +1 -1
- package/dist/components/ProgressBar/ProgressBar.cjs +1 -1
- package/dist/components/ProgressBar/ProgressBar.cjs.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +2 -2
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/ProgressBar.cjs +1 -1
- package/dist/components/RadioButton/RadioButton.cjs +1 -1
- package/dist/components/RadioButton/RadioButton.cjs.map +1 -1
- package/dist/components/RadioButton/RadioButton.d.ts +1 -1
- package/dist/components/RadioButton/RadioButton.js +5 -7
- package/dist/components/RadioButton/RadioButton.js.map +1 -1
- package/dist/components/RadioButton.cjs +1 -1
- package/dist/components/SearchBar/SearchBar.cjs +1 -1
- package/dist/components/SearchBar/SearchBar.cjs.map +1 -1
- package/dist/components/SearchBar/SearchBar.d.ts +1 -1
- package/dist/components/SearchBar/SearchBar.js +2 -2
- package/dist/components/SearchBar/SearchBar.js.map +1 -1
- package/dist/components/SearchBar.cjs +1 -1
- package/dist/components/SegmentedBar/SegmentedBar.cjs +1 -1
- package/dist/components/SegmentedBar/SegmentedBar.cjs.map +1 -1
- package/dist/components/SegmentedBar/SegmentedBar.js.map +1 -1
- package/dist/components/SegmentedBar.cjs +1 -1
- package/dist/components/Separator/Separator.cjs +1 -1
- package/dist/components/Separator/Separator.cjs.map +1 -1
- package/dist/components/Separator/Separator.d.ts +1 -1
- package/dist/components/Separator/Separator.js +2 -2
- package/dist/components/Separator/Separator.js.map +1 -1
- package/dist/components/Separator.cjs +1 -1
- package/dist/components/ShortcutLabel/ShortcutLabel.cjs +1 -1
- package/dist/components/ShortcutLabel/ShortcutLabel.cjs.map +1 -1
- package/dist/components/ShortcutLabel/ShortcutLabel.d.ts +1 -1
- package/dist/components/ShortcutLabel/ShortcutLabel.js +2 -3
- package/dist/components/ShortcutLabel/ShortcutLabel.js.map +1 -1
- package/dist/components/ShortcutLabel.cjs +1 -1
- package/dist/components/ShortcutsDialog/ShortcutsDialog.cjs +1 -1
- package/dist/components/ShortcutsDialog/ShortcutsDialog.cjs.map +1 -1
- package/dist/components/ShortcutsDialog/ShortcutsDialog.d.ts +1 -1
- package/dist/components/ShortcutsDialog/ShortcutsDialog.js +75 -76
- package/dist/components/ShortcutsDialog/ShortcutsDialog.js.map +1 -1
- package/dist/components/ShortcutsDialog/ShortcutsDialog.module.css.cjs +1 -1
- package/dist/components/ShortcutsDialog/ShortcutsDialog.module.css.js +21 -22
- package/dist/components/ShortcutsDialog.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.cjs.map +1 -1
- package/dist/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.js +2 -3
- package/dist/components/Sidebar/Sidebar.js.map +1 -1
- package/dist/components/Sidebar/Sidebar.module.css.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.module.css.js +33 -34
- package/dist/components/Sidebar/SidebarItem.cjs +1 -1
- package/dist/components/Sidebar/SidebarItem.cjs.map +1 -1
- package/dist/components/Sidebar/SidebarItem.d.ts +1 -1
- package/dist/components/Sidebar/SidebarItem.js +16 -16
- package/dist/components/Sidebar/SidebarItem.js.map +1 -1
- package/dist/components/Sidebar/SidebarSection.cjs +1 -1
- package/dist/components/Sidebar/SidebarSection.cjs.map +1 -1
- package/dist/components/Sidebar/SidebarSection.js.map +1 -1
- package/dist/components/Sidebar.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.js +9 -10
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Skeleton.cjs +1 -1
- package/dist/components/Slider/Slider.cjs +1 -1
- package/dist/components/Slider/Slider.cjs.map +1 -1
- package/dist/components/Slider/Slider.d.ts +1 -1
- package/dist/components/Slider/Slider.js +2 -2
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Slider.cjs +1 -1
- package/dist/components/SpinButton/SpinButton.cjs +1 -1
- package/dist/components/SpinButton/SpinButton.cjs.map +1 -1
- package/dist/components/SpinButton/SpinButton.d.ts +1 -1
- package/dist/components/SpinButton/SpinButton.js +2 -2
- package/dist/components/SpinButton/SpinButton.js.map +1 -1
- package/dist/components/SpinButton.cjs +1 -1
- package/dist/components/SpinRow/SpinRow.cjs +1 -1
- package/dist/components/SpinRow/SpinRow.cjs.map +1 -1
- package/dist/components/SpinRow/SpinRow.d.ts +1 -1
- package/dist/components/SpinRow/SpinRow.js +2 -2
- package/dist/components/SpinRow/SpinRow.js.map +1 -1
- package/dist/components/SpinRow.cjs +1 -1
- package/dist/components/Spinner/Spinner.cjs +1 -1
- package/dist/components/Spinner/Spinner.cjs.map +1 -1
- package/dist/components/Spinner/Spinner.d.ts +1 -1
- package/dist/components/Spinner/Spinner.js +2 -2
- package/dist/components/Spinner/Spinner.js.map +1 -1
- package/dist/components/Spinner.cjs +1 -1
- package/dist/components/SplitButton/SplitButton.cjs +1 -1
- package/dist/components/SplitButton/SplitButton.cjs.map +1 -1
- package/dist/components/SplitButton/SplitButton.d.ts +1 -1
- package/dist/components/SplitButton/SplitButton.js +2 -2
- package/dist/components/SplitButton/SplitButton.js.map +1 -1
- package/dist/components/SplitButton.cjs +1 -1
- package/dist/components/StatusBadge/StatusBadge.cjs +1 -1
- package/dist/components/StatusBadge/StatusBadge.cjs.map +1 -1
- package/dist/components/StatusBadge/StatusBadge.d.ts +1 -1
- package/dist/components/StatusBadge/StatusBadge.js +9 -11
- package/dist/components/StatusBadge/StatusBadge.js.map +1 -1
- package/dist/components/StatusBadge.cjs +1 -1
- package/dist/components/StatusPage/StatusPage.cjs +1 -1
- package/dist/components/StatusPage/StatusPage.cjs.map +1 -1
- package/dist/components/StatusPage/StatusPage.d.ts +1 -1
- package/dist/components/StatusPage/StatusPage.js +2 -2
- package/dist/components/StatusPage/StatusPage.js.map +1 -1
- package/dist/components/StatusPage.cjs +1 -1
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.cjs.map +1 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Switch/Switch.js +6 -8
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Switch.cjs +1 -1
- package/dist/components/SwitchRow/SwitchRow.cjs +1 -1
- package/dist/components/SwitchRow/SwitchRow.cjs.map +1 -1
- package/dist/components/SwitchRow/SwitchRow.d.ts +1 -1
- package/dist/components/SwitchRow/SwitchRow.js +7 -7
- package/dist/components/SwitchRow/SwitchRow.js.map +1 -1
- package/dist/components/SwitchRow.cjs +1 -1
- package/dist/components/Tabs/TabBar.cjs +1 -1
- package/dist/components/Tabs/TabBar.cjs.map +1 -1
- package/dist/components/Tabs/TabBar.d.ts +1 -1
- package/dist/components/Tabs/TabBar.js +2 -2
- package/dist/components/Tabs/TabBar.js.map +1 -1
- package/dist/components/Tabs/TabItem.cjs +1 -1
- package/dist/components/Tabs/TabItem.cjs.map +1 -1
- package/dist/components/Tabs/TabItem.js.map +1 -1
- package/dist/components/Tabs/TabPanel.cjs +1 -1
- package/dist/components/Tabs/TabPanel.cjs.map +1 -1
- package/dist/components/Tabs/TabPanel.d.ts +1 -1
- package/dist/components/Tabs/TabPanel.js +8 -10
- package/dist/components/Tabs/TabPanel.js.map +1 -1
- package/dist/components/Tabs.cjs +1 -1
- package/dist/components/TerminalView/TerminalView.cjs +1 -1
- package/dist/components/TerminalView/TerminalView.cjs.map +1 -1
- package/dist/components/TerminalView/TerminalView.d.ts +1 -1
- package/dist/components/TerminalView/TerminalView.js +2 -2
- package/dist/components/TerminalView/TerminalView.js.map +1 -1
- package/dist/components/TerminalView.cjs +1 -1
- package/dist/components/Text/Text.cjs +1 -1
- package/dist/components/Text/Text.cjs.map +1 -1
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/Text/Text.js +10 -13
- package/dist/components/Text/Text.js.map +1 -1
- package/dist/components/Text/Text.module.css.cjs +1 -1
- package/dist/components/Text/Text.module.css.js +9 -10
- package/dist/components/Text.cjs +1 -1
- package/dist/components/TextField/TextField.cjs +1 -1
- package/dist/components/TextField/TextField.cjs.map +1 -1
- package/dist/components/TextField/TextField.d.ts +1 -1
- package/dist/components/TextField/TextField.js +2 -2
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField.cjs +1 -1
- package/dist/components/Timeline/Timeline.cjs +1 -1
- package/dist/components/Timeline/Timeline.cjs.map +1 -1
- package/dist/components/Timeline/Timeline.d.ts +1 -1
- package/dist/components/Timeline/Timeline.js +2 -2
- package/dist/components/Timeline/Timeline.js.map +1 -1
- package/dist/components/Timeline.cjs +1 -1
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/Toast/Toast.js +2 -2
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toast/Toast.module.css.cjs +1 -1
- package/dist/components/Toast/Toast.module.css.js +10 -11
- package/dist/components/Toast/Toaster.cjs +1 -1
- package/dist/components/Toast/Toaster.cjs.map +1 -1
- package/dist/components/Toast/Toaster.d.ts +1 -1
- package/dist/components/Toast/Toaster.js +2 -2
- package/dist/components/Toast/Toaster.js.map +1 -1
- package/dist/components/Toast.cjs +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.cjs +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.cjs.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.js +2 -2
- package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroupItem.cjs +1 -1
- package/dist/components/ToggleGroup/ToggleGroupItem.cjs.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +1 -1
- package/dist/components/ToggleGroup/ToggleGroupItem.js +2 -2
- package/dist/components/ToggleGroup/ToggleGroupItem.js.map +1 -1
- package/dist/components/ToggleGroup.cjs +1 -1
- package/dist/components/Toolbar/Spacer.cjs +1 -1
- package/dist/components/Toolbar/Spacer.cjs.map +1 -1
- package/dist/components/Toolbar/Spacer.d.ts +1 -1
- package/dist/components/Toolbar/Spacer.js +5 -7
- package/dist/components/Toolbar/Spacer.js.map +1 -1
- package/dist/components/Toolbar/Toolbar.cjs +1 -1
- package/dist/components/Toolbar/Toolbar.cjs.map +1 -1
- package/dist/components/Toolbar/Toolbar.d.ts +1 -1
- package/dist/components/Toolbar/Toolbar.js +5 -7
- package/dist/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/Toolbar.cjs +1 -1
- package/dist/components/ToolbarView/ToolbarView.cjs +1 -1
- package/dist/components/ToolbarView/ToolbarView.cjs.map +1 -1
- package/dist/components/ToolbarView/ToolbarView.d.ts +1 -1
- package/dist/components/ToolbarView/ToolbarView.js +18 -20
- package/dist/components/ToolbarView/ToolbarView.js.map +1 -1
- package/dist/components/ToolbarView.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +2 -2
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip.cjs +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcher.cjs +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcher.cjs.map +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcher.d.ts +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcher.js +2 -2
- package/dist/components/ViewSwitcher/ViewSwitcher.js.map +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcherItem.cjs +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcherItem.cjs.map +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcherItem.d.ts +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcherItem.js +24 -26
- package/dist/components/ViewSwitcher/ViewSwitcherItem.js.map +1 -1
- package/dist/components/ViewSwitcher.cjs +1 -1
- package/dist/components/ViewSwitcherBar/ViewSwitcherBar.cjs +1 -1
- package/dist/components/ViewSwitcherBar/ViewSwitcherBar.cjs.map +1 -1
- package/dist/components/ViewSwitcherBar/ViewSwitcherBar.d.ts +1 -1
- package/dist/components/ViewSwitcherBar/ViewSwitcherBar.js +7 -9
- package/dist/components/ViewSwitcherBar/ViewSwitcherBar.js.map +1 -1
- package/dist/components/ViewSwitcherBar.cjs +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.cjs +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.cjs.map +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.d.ts +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.js +2 -2
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.js.map +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebarItem.cjs +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebarItem.cjs.map +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebarItem.d.ts +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebarItem.js +2 -2
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebarItem.js.map +1 -1
- package/dist/components/ViewSwitcherSidebar.cjs +1 -1
- package/dist/components/WindowTitle/WindowTitle.cjs +1 -1
- package/dist/components/WindowTitle/WindowTitle.cjs.map +1 -1
- package/dist/components/WindowTitle/WindowTitle.d.ts +1 -1
- package/dist/components/WindowTitle/WindowTitle.js +11 -13
- package/dist/components/WindowTitle/WindowTitle.js.map +1 -1
- package/dist/components/WindowTitle.cjs +1 -1
- package/dist/components/WrapBox/WrapBox.cjs +1 -1
- package/dist/components/WrapBox/WrapBox.cjs.map +1 -1
- package/dist/components/WrapBox/WrapBox.d.ts +1 -1
- package/dist/components/WrapBox/WrapBox.js +5 -5
- package/dist/components/WrapBox/WrapBox.js.map +1 -1
- package/dist/components/WrapBox.cjs +1 -1
- package/dist/hooks/useBreakpoint.cjs +1 -1
- package/dist/hooks/useBreakpoint.cjs.map +1 -1
- package/dist/hooks/useBreakpoint.js.map +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("../../hooks/useBreakpoint.cjs"),t=require("./OverlaySplitView.module.css.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=({sidebar:i,content:a,showSidebar:o=!1,onClose:s,collapsed:c=!1,sidebarPosition:l=`start`,minSidebarWidth:u=180,maxSidebarWidth:d=280,sidebarWidthFraction:f=.25,className:p,style:m,...h})=>{let{isNarrow:g}=e.useBreakpoint(),_=(0,n.useRef)(null),v=`clamp(${u}px, ${f*100}%, ${d}px)`;(0,n.useEffect)(()=>{if(!g||!o)return;let e=e=>{e.key===`Escape`&&s?.()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[g,o,s]),(0,n.useEffect)(()=>{!g||!o||(_.current?.querySelector(`button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`))?.focus()},[g,o]);let y=l===`end`;return(0,n.useEffect)(()=>{if(!g||!o)return;let e=_.current;if(!e)return;let t=0,n=e=>{t=e.touches[0].clientX},r=e=>{let n=e.changedTouches[0].clientX-t;(y?n>80:n<-80)&&s?.()};return e.addEventListener(`touchstart`,n,{passive:!0}),e.addEventListener(`touchend`,r,{passive:!0}),()=>{e.removeEventListener(`touchstart`,n),e.removeEventListener(`touchend`,r)}},[g,o,y,s]),(0,r.jsxs)(`div`,{className:[t.default.root,g?t.default.narrow:t.default.wide,!g&&c?t.default.collapsed:null,y?t.default.end:t.default.start,p].filter(Boolean).join(` `),style:{"--sidebar-width":v,...m},...h,children:[g&&(0,r.jsx)(`div`,{className:[t.default.backdrop,o?t.default.backdropVisible:null].filter(Boolean).join(` `),"aria-hidden":`true`,onClick:s}),(0,r.jsx)(`div`,{ref:_,className:[t.default.sidebar,g?o?t.default.sidebarOpen:t.default.sidebarClosed:null].filter(Boolean).join(` `),"aria-hidden":g&&!o,children:i}),(0,r.jsx)(`div`,{className:t.default.content,children:a})]})};exports.OverlaySplitView=i;
|
|
2
2
|
//# sourceMappingURL=OverlaySplitView.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlaySplitView.cjs","names":[],"sources":["../../../src/components/OverlaySplitView/OverlaySplitView.tsx"],"sourcesContent":["import { type CSSProperties, type HTMLAttributes, type ReactNode, useEffect, useRef } from 'react';\n\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\n\nimport styles from './OverlaySplitView.module.css';\n\nexport interface OverlaySplitViewProps extends Omit<HTMLAttributes<HTMLDivElement>, 'content'> {\n /**\n * The sidebar pane.\n * On wide screens it sits beside the content.\n * On narrow screens it slides over the content as an overlay.\n */\n sidebar: ReactNode;\n /** The main content pane — always visible. */\n content: ReactNode;\n /**\n * Whether the sidebar is shown.\n * - Wide screens: always both visible; this prop is ignored.\n * - Narrow screens (≤ 400 px): controls whether the overlay is open.\n */\n showSidebar?: boolean;\n /**\n * Called when the user clicks the backdrop (narrow screens only).\n * Use this to set `showSidebar` to false.\n */\n onClose?: () => void;\n /**\n * When `true`, collapses the sidebar to icon-only width on wide screens.\n * Has no effect in narrow (overlay) mode.\n * Pair with `collapsed` on the inner `<Sidebar>` component to hide labels.\n */\n collapsed?: boolean;\n /**\n * Which side the sidebar appears on. Defaults to `\"start\"` (left in LTR).\n */\n sidebarPosition?: 'start' | 'end';\n /**\n * Minimum sidebar width in px. Defaults to `180`.\n */\n minSidebarWidth?: number;\n /**\n * Maximum sidebar width in px. Defaults to `280`.\n */\n maxSidebarWidth?: number;\n /**\n * Fraction of total width given to the sidebar. Defaults to `0.25`.\n */\n sidebarWidthFraction?: number;\n}\n\n/**\n * Sidebar + content layout where the sidebar becomes a slide-over overlay\n * on narrow screens, mirroring the Adwaita `AdwOverlaySplitView` pattern.\n *\n * On **wide** screens (> 400 px) sidebar and content are side-by-side.\n * On **narrow** screens (≤ 400 px) the content fills the full width and\n * the sidebar slides in as an overlay when `showSidebar` is true,\n * with a translucent backdrop behind it.\n *\n * @example\n * const [open, setOpen] = useState(false);\n * <OverlaySplitView\n * showSidebar={open}\n * onClose={() => setOpen(false)}\n * sidebar={<Nav />}\n * content={<MainContent onMenuClick={() => setOpen(true)} />}\n * />\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.OverlaySplitView.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"OverlaySplitView.cjs","names":[],"sources":["../../../src/components/OverlaySplitView/OverlaySplitView.tsx"],"sourcesContent":["import { type CSSProperties, type HTMLAttributes, type ReactNode, useEffect, useRef } from 'react';\n\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\n\nimport styles from './OverlaySplitView.module.css';\n\nexport interface OverlaySplitViewProps extends Omit<HTMLAttributes<HTMLDivElement>, 'content'> {\n /**\n * The sidebar pane.\n * On wide screens it sits beside the content.\n * On narrow screens it slides over the content as an overlay.\n */\n sidebar: ReactNode;\n /** The main content pane — always visible. */\n content: ReactNode;\n /**\n * Whether the sidebar is shown.\n * - Wide screens: always both visible; this prop is ignored.\n * - Narrow screens (≤ 400 px): controls whether the overlay is open.\n */\n showSidebar?: boolean;\n /**\n * Called when the user clicks the backdrop (narrow screens only).\n * Use this to set `showSidebar` to false.\n */\n onClose?: () => void;\n /**\n * When `true`, collapses the sidebar to icon-only width on wide screens.\n * Has no effect in narrow (overlay) mode.\n * Pair with `collapsed` on the inner `<Sidebar>` component to hide labels.\n */\n collapsed?: boolean;\n /**\n * Which side the sidebar appears on. Defaults to `\"start\"` (left in LTR).\n */\n sidebarPosition?: 'start' | 'end';\n /**\n * Minimum sidebar width in px. Defaults to `180`.\n */\n minSidebarWidth?: number;\n /**\n * Maximum sidebar width in px. Defaults to `280`.\n */\n maxSidebarWidth?: number;\n /**\n * Fraction of total width given to the sidebar. Defaults to `0.25`.\n */\n sidebarWidthFraction?: number;\n}\n\n/**\n * Sidebar + content layout where the sidebar becomes a slide-over overlay\n * on narrow screens, mirroring the Adwaita `AdwOverlaySplitView` pattern.\n *\n * On **wide** screens (> 400 px) sidebar and content are side-by-side.\n * On **narrow** screens (≤ 400 px) the content fills the full width and\n * the sidebar slides in as an overlay when `showSidebar` is true,\n * with a translucent backdrop behind it.\n *\n * @example\n * const [open, setOpen] = useState(false);\n * <OverlaySplitView\n * showSidebar={open}\n * onClose={() => setOpen(false)}\n * sidebar={<Nav />}\n * content={<MainContent onMenuClick={() => setOpen(true)} />}\n * />\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.OverlaySplitView.html\n */\nexport const OverlaySplitView = ({\n sidebar,\n content,\n showSidebar = false,\n onClose,\n collapsed = false,\n sidebarPosition = 'start',\n minSidebarWidth = 180,\n maxSidebarWidth = 280,\n sidebarWidthFraction = 0.25,\n className,\n style,\n ...props\n}: OverlaySplitViewProps) => {\n const { isNarrow } = useBreakpoint();\n const sidebarRef = useRef<HTMLDivElement>(null);\n\n const sidebarWidth = `clamp(${minSidebarWidth}px, ${sidebarWidthFraction * 100}%, ${maxSidebarWidth}px)`;\n\n // Close on Escape in overlay mode\n useEffect(() => {\n if (!isNarrow || !showSidebar) {\n return;\n }\n\n const handler = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose?.();\n }\n };\n\n document.addEventListener('keydown', handler);\n\n return () => document.removeEventListener('keydown', handler);\n }, [isNarrow, showSidebar, onClose]);\n\n // Trap focus inside sidebar when open in overlay mode\n useEffect(() => {\n if (!isNarrow || !showSidebar) {\n return;\n }\n\n const first = sidebarRef.current?.querySelector<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n first?.focus();\n }, [isNarrow, showSidebar]);\n\n const isEnd = sidebarPosition === 'end';\n\n // Swipe-to-dismiss: drag the sidebar in the close direction to trigger onClose\n useEffect(() => {\n if (!isNarrow || !showSidebar) {\n return;\n }\n\n const el = sidebarRef.current;\n\n if (!el) {\n return;\n }\n\n let startX = 0;\n const THRESHOLD = 80;\n\n const onTouchStart = (e: TouchEvent) => {\n startX = e.touches[0].clientX;\n };\n const onTouchEnd = (e: TouchEvent) => {\n const dx = e.changedTouches[0].clientX - startX;\n const closeSwipe = isEnd ? dx > THRESHOLD : dx < -THRESHOLD;\n\n if (closeSwipe) {\n onClose?.();\n }\n };\n\n el.addEventListener('touchstart', onTouchStart, { passive: true });\n el.addEventListener('touchend', onTouchEnd, { passive: true });\n\n return () => {\n el.removeEventListener('touchstart', onTouchStart);\n el.removeEventListener('touchend', onTouchEnd);\n };\n }, [isNarrow, showSidebar, isEnd, onClose]);\n\n return (\n <div\n className={[\n styles.root,\n isNarrow ? styles.narrow : styles.wide,\n !isNarrow && collapsed ? styles.collapsed : null,\n isEnd ? styles.end : styles.start,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={{ '--sidebar-width': sidebarWidth, ...style } as CSSProperties}\n {...props}\n >\n {/* Backdrop — narrow mode only */}\n {isNarrow && (\n <div\n className={[styles.backdrop, showSidebar ? styles.backdropVisible : null]\n .filter(Boolean)\n .join(' ')}\n aria-hidden=\"true\"\n onClick={onClose}\n />\n )}\n\n {/* Sidebar */}\n <div\n ref={sidebarRef}\n className={[\n styles.sidebar,\n isNarrow ? (showSidebar ? styles.sidebarOpen : styles.sidebarClosed) : null,\n ]\n .filter(Boolean)\n .join(' ')}\n aria-hidden={isNarrow && !showSidebar}\n >\n {sidebar}\n </div>\n\n {/* Content */}\n <div className={styles.content}>{content}</div>\n </div>\n );\n};\n"],"mappings":"sJAsEA,IAAa,GAAoB,CAC/B,UACA,UACA,cAAc,GACd,UACA,YAAY,GACZ,kBAAkB,QAClB,kBAAkB,IAClB,kBAAkB,IAClB,uBAAuB,IACvB,YACA,QACA,GAAG,KACwB,CAC3B,GAAM,CAAE,YAAa,EAAA,cAAc,EAC7B,GAAA,EAAA,EAAA,QAAoC,IAAI,EAExC,EAAe,SAAS,EAAgB,MAAM,EAAuB,IAAI,KAAK,EAAgB,MAGpG,EAAA,EAAA,eAAgB,CACd,GAAI,CAAC,GAAY,CAAC,EAChB,OAGF,IAAM,EAAW,GAAqB,CAChC,EAAE,MAAQ,UACZ,IAAU,CAEd,EAIA,OAFA,SAAS,iBAAiB,UAAW,CAAO,MAE/B,SAAS,oBAAoB,UAAW,CAAO,CAC9D,EAAG,CAAC,EAAU,EAAa,CAAO,CAAC,GAGnC,EAAA,EAAA,eAAgB,CACV,CAAC,GAAY,CAAC,IAIJ,EAAW,SAAS,cAChC,0EACF,IAEO,MAAM,CACf,EAAG,CAAC,EAAU,CAAW,CAAC,EAE1B,IAAM,EAAQ,IAAoB,MAsClC,OAnCA,EAAA,EAAA,eAAgB,CACd,GAAI,CAAC,GAAY,CAAC,EAChB,OAGF,IAAM,EAAK,EAAW,QAEtB,GAAI,CAAC,EACH,OAGF,IAAI,EAAS,EAGP,EAAgB,GAAkB,CACtC,EAAS,EAAE,QAAQ,GAAG,OACxB,EACM,EAAc,GAAkB,CACpC,IAAM,EAAK,EAAE,eAAe,GAAG,QAAU,GACtB,EAAQ,EAAK,GAAY,EAAK,MAG/C,IAAU,CAEd,EAKA,OAHA,EAAG,iBAAiB,aAAc,EAAc,CAAE,QAAS,EAAK,CAAC,EACjE,EAAG,iBAAiB,WAAY,EAAY,CAAE,QAAS,EAAK,CAAC,MAEhD,CACX,EAAG,oBAAoB,aAAc,CAAY,EACjD,EAAG,oBAAoB,WAAY,CAAU,CAC/C,CACF,EAAG,CAAC,EAAU,EAAa,EAAO,CAAO,CAAC,GAGxC,EAAA,EAAA,MAAC,MAAD,CACE,UAAW,CACT,EAAA,QAAO,KACP,EAAW,EAAA,QAAO,OAAS,EAAA,QAAO,KAClC,CAAC,GAAY,EAAY,EAAA,QAAO,UAAY,KAC5C,EAAQ,EAAA,QAAO,IAAM,EAAA,QAAO,MAC5B,CACF,EACG,OAAO,OAAO,EACd,KAAK,GAAG,EACX,MAAO,CAAE,kBAAmB,EAAc,GAAG,CAAM,EACnD,GAAI,WAXN,CAcG,IACC,EAAA,EAAA,KAAC,MAAD,CACE,UAAW,CAAC,EAAA,QAAO,SAAU,EAAc,EAAA,QAAO,gBAAkB,IAAI,EACrE,OAAO,OAAO,EACd,KAAK,GAAG,EACX,cAAY,OACZ,QAAS,CACV,CAAA,GAIH,EAAA,EAAA,KAAC,MAAD,CACE,IAAK,EACL,UAAW,CACT,EAAA,QAAO,QACP,EAAY,EAAc,EAAA,QAAO,YAAc,EAAA,QAAO,cAAiB,IACzE,EACG,OAAO,OAAO,EACd,KAAK,GAAG,EACX,cAAa,GAAY,CAAC,WAEzB,CACE,CAAA,GAGL,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,EAAA,QAAO,iBAAU,CAAa,CAAA,CAC3C,GAET"}
|
|
@@ -62,4 +62,4 @@ export interface OverlaySplitViewProps extends Omit<HTMLAttributes<HTMLDivElemen
|
|
|
62
62
|
*
|
|
63
63
|
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.OverlaySplitView.html
|
|
64
64
|
*/
|
|
65
|
-
export declare
|
|
65
|
+
export declare const OverlaySplitView: ({ sidebar, content, showSidebar, onClose, collapsed, sidebarPosition, minSidebarWidth, maxSidebarWidth, sidebarWidthFraction, className, style, ...props }: OverlaySplitViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import t from "./OverlaySplitView.module.css.js";
|
|
|
3
3
|
import { useEffect as n, useRef as r } from "react";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/OverlaySplitView/OverlaySplitView.tsx
|
|
6
|
-
|
|
6
|
+
var o = ({ sidebar: o, content: s, showSidebar: c = !1, onClose: l, collapsed: u = !1, sidebarPosition: d = "start", minSidebarWidth: f = 180, maxSidebarWidth: p = 280, sidebarWidthFraction: m = .25, className: h, style: g, ..._ }) => {
|
|
7
7
|
let { isNarrow: v } = e(), y = r(null), b = `clamp(${f}px, ${m * 100}%, ${p}px)`;
|
|
8
8
|
n(() => {
|
|
9
9
|
if (!v || !c) return;
|
|
@@ -68,7 +68,7 @@ function o({ sidebar: o, content: s, showSidebar: c = !1, onClose: l, collapsed:
|
|
|
68
68
|
})
|
|
69
69
|
]
|
|
70
70
|
});
|
|
71
|
-
}
|
|
71
|
+
};
|
|
72
72
|
//#endregion
|
|
73
73
|
export { o as OverlaySplitView };
|
|
74
74
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlaySplitView.js","names":[],"sources":["../../../src/components/OverlaySplitView/OverlaySplitView.tsx"],"sourcesContent":["import { type CSSProperties, type HTMLAttributes, type ReactNode, useEffect, useRef } from 'react';\n\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\n\nimport styles from './OverlaySplitView.module.css';\n\nexport interface OverlaySplitViewProps extends Omit<HTMLAttributes<HTMLDivElement>, 'content'> {\n /**\n * The sidebar pane.\n * On wide screens it sits beside the content.\n * On narrow screens it slides over the content as an overlay.\n */\n sidebar: ReactNode;\n /** The main content pane — always visible. */\n content: ReactNode;\n /**\n * Whether the sidebar is shown.\n * - Wide screens: always both visible; this prop is ignored.\n * - Narrow screens (≤ 400 px): controls whether the overlay is open.\n */\n showSidebar?: boolean;\n /**\n * Called when the user clicks the backdrop (narrow screens only).\n * Use this to set `showSidebar` to false.\n */\n onClose?: () => void;\n /**\n * When `true`, collapses the sidebar to icon-only width on wide screens.\n * Has no effect in narrow (overlay) mode.\n * Pair with `collapsed` on the inner `<Sidebar>` component to hide labels.\n */\n collapsed?: boolean;\n /**\n * Which side the sidebar appears on. Defaults to `\"start\"` (left in LTR).\n */\n sidebarPosition?: 'start' | 'end';\n /**\n * Minimum sidebar width in px. Defaults to `180`.\n */\n minSidebarWidth?: number;\n /**\n * Maximum sidebar width in px. Defaults to `280`.\n */\n maxSidebarWidth?: number;\n /**\n * Fraction of total width given to the sidebar. Defaults to `0.25`.\n */\n sidebarWidthFraction?: number;\n}\n\n/**\n * Sidebar + content layout where the sidebar becomes a slide-over overlay\n * on narrow screens, mirroring the Adwaita `AdwOverlaySplitView` pattern.\n *\n * On **wide** screens (> 400 px) sidebar and content are side-by-side.\n * On **narrow** screens (≤ 400 px) the content fills the full width and\n * the sidebar slides in as an overlay when `showSidebar` is true,\n * with a translucent backdrop behind it.\n *\n * @example\n * const [open, setOpen] = useState(false);\n * <OverlaySplitView\n * showSidebar={open}\n * onClose={() => setOpen(false)}\n * sidebar={<Nav />}\n * content={<MainContent onMenuClick={() => setOpen(true)} />}\n * />\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.OverlaySplitView.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"OverlaySplitView.js","names":[],"sources":["../../../src/components/OverlaySplitView/OverlaySplitView.tsx"],"sourcesContent":["import { type CSSProperties, type HTMLAttributes, type ReactNode, useEffect, useRef } from 'react';\n\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\n\nimport styles from './OverlaySplitView.module.css';\n\nexport interface OverlaySplitViewProps extends Omit<HTMLAttributes<HTMLDivElement>, 'content'> {\n /**\n * The sidebar pane.\n * On wide screens it sits beside the content.\n * On narrow screens it slides over the content as an overlay.\n */\n sidebar: ReactNode;\n /** The main content pane — always visible. */\n content: ReactNode;\n /**\n * Whether the sidebar is shown.\n * - Wide screens: always both visible; this prop is ignored.\n * - Narrow screens (≤ 400 px): controls whether the overlay is open.\n */\n showSidebar?: boolean;\n /**\n * Called when the user clicks the backdrop (narrow screens only).\n * Use this to set `showSidebar` to false.\n */\n onClose?: () => void;\n /**\n * When `true`, collapses the sidebar to icon-only width on wide screens.\n * Has no effect in narrow (overlay) mode.\n * Pair with `collapsed` on the inner `<Sidebar>` component to hide labels.\n */\n collapsed?: boolean;\n /**\n * Which side the sidebar appears on. Defaults to `\"start\"` (left in LTR).\n */\n sidebarPosition?: 'start' | 'end';\n /**\n * Minimum sidebar width in px. Defaults to `180`.\n */\n minSidebarWidth?: number;\n /**\n * Maximum sidebar width in px. Defaults to `280`.\n */\n maxSidebarWidth?: number;\n /**\n * Fraction of total width given to the sidebar. Defaults to `0.25`.\n */\n sidebarWidthFraction?: number;\n}\n\n/**\n * Sidebar + content layout where the sidebar becomes a slide-over overlay\n * on narrow screens, mirroring the Adwaita `AdwOverlaySplitView` pattern.\n *\n * On **wide** screens (> 400 px) sidebar and content are side-by-side.\n * On **narrow** screens (≤ 400 px) the content fills the full width and\n * the sidebar slides in as an overlay when `showSidebar` is true,\n * with a translucent backdrop behind it.\n *\n * @example\n * const [open, setOpen] = useState(false);\n * <OverlaySplitView\n * showSidebar={open}\n * onClose={() => setOpen(false)}\n * sidebar={<Nav />}\n * content={<MainContent onMenuClick={() => setOpen(true)} />}\n * />\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.OverlaySplitView.html\n */\nexport const OverlaySplitView = ({\n sidebar,\n content,\n showSidebar = false,\n onClose,\n collapsed = false,\n sidebarPosition = 'start',\n minSidebarWidth = 180,\n maxSidebarWidth = 280,\n sidebarWidthFraction = 0.25,\n className,\n style,\n ...props\n}: OverlaySplitViewProps) => {\n const { isNarrow } = useBreakpoint();\n const sidebarRef = useRef<HTMLDivElement>(null);\n\n const sidebarWidth = `clamp(${minSidebarWidth}px, ${sidebarWidthFraction * 100}%, ${maxSidebarWidth}px)`;\n\n // Close on Escape in overlay mode\n useEffect(() => {\n if (!isNarrow || !showSidebar) {\n return;\n }\n\n const handler = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose?.();\n }\n };\n\n document.addEventListener('keydown', handler);\n\n return () => document.removeEventListener('keydown', handler);\n }, [isNarrow, showSidebar, onClose]);\n\n // Trap focus inside sidebar when open in overlay mode\n useEffect(() => {\n if (!isNarrow || !showSidebar) {\n return;\n }\n\n const first = sidebarRef.current?.querySelector<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n first?.focus();\n }, [isNarrow, showSidebar]);\n\n const isEnd = sidebarPosition === 'end';\n\n // Swipe-to-dismiss: drag the sidebar in the close direction to trigger onClose\n useEffect(() => {\n if (!isNarrow || !showSidebar) {\n return;\n }\n\n const el = sidebarRef.current;\n\n if (!el) {\n return;\n }\n\n let startX = 0;\n const THRESHOLD = 80;\n\n const onTouchStart = (e: TouchEvent) => {\n startX = e.touches[0].clientX;\n };\n const onTouchEnd = (e: TouchEvent) => {\n const dx = e.changedTouches[0].clientX - startX;\n const closeSwipe = isEnd ? dx > THRESHOLD : dx < -THRESHOLD;\n\n if (closeSwipe) {\n onClose?.();\n }\n };\n\n el.addEventListener('touchstart', onTouchStart, { passive: true });\n el.addEventListener('touchend', onTouchEnd, { passive: true });\n\n return () => {\n el.removeEventListener('touchstart', onTouchStart);\n el.removeEventListener('touchend', onTouchEnd);\n };\n }, [isNarrow, showSidebar, isEnd, onClose]);\n\n return (\n <div\n className={[\n styles.root,\n isNarrow ? styles.narrow : styles.wide,\n !isNarrow && collapsed ? styles.collapsed : null,\n isEnd ? styles.end : styles.start,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={{ '--sidebar-width': sidebarWidth, ...style } as CSSProperties}\n {...props}\n >\n {/* Backdrop — narrow mode only */}\n {isNarrow && (\n <div\n className={[styles.backdrop, showSidebar ? styles.backdropVisible : null]\n .filter(Boolean)\n .join(' ')}\n aria-hidden=\"true\"\n onClick={onClose}\n />\n )}\n\n {/* Sidebar */}\n <div\n ref={sidebarRef}\n className={[\n styles.sidebar,\n isNarrow ? (showSidebar ? styles.sidebarOpen : styles.sidebarClosed) : null,\n ]\n .filter(Boolean)\n .join(' ')}\n aria-hidden={isNarrow && !showSidebar}\n >\n {sidebar}\n </div>\n\n {/* Content */}\n <div className={styles.content}>{content}</div>\n </div>\n );\n};\n"],"mappings":";;;;;AAsEA,IAAa,KAAoB,EAC/B,YACA,YACA,iBAAc,IACd,YACA,eAAY,IACZ,qBAAkB,SAClB,qBAAkB,KAClB,qBAAkB,KAClB,0BAAuB,KACvB,cACA,UACA,GAAG,QACwB;CAC3B,IAAM,EAAE,gBAAa,EAAc,GAC7B,IAAa,EAAuB,IAAI,GAExC,IAAe,SAAS,EAAgB,MAAM,IAAuB,IAAI,KAAK,EAAgB;CAoBpG,AAjBA,QAAgB;EACd,IAAI,CAAC,KAAY,CAAC,GAChB;EAGF,IAAM,KAAW,MAAqB;GACpC,AAAI,EAAE,QAAQ,YACZ,IAAU;EAEd;EAIA,OAFA,SAAS,iBAAiB,WAAW,CAAO,SAE/B,SAAS,oBAAoB,WAAW,CAAO;CAC9D,GAAG;EAAC;EAAU;EAAa;CAAO,CAAC,GAGnC,QAAgB;EACV,CAAC,KAAY,CAAC,MAIJ,EAAW,SAAS,cAChC,4EACF,IAEO,MAAM;CACf,GAAG,CAAC,GAAU,CAAW,CAAC;CAE1B,IAAM,IAAQ,MAAoB;CAsClC,OAnCA,QAAgB;EACd,IAAI,CAAC,KAAY,CAAC,GAChB;EAGF,IAAM,IAAK,EAAW;EAEtB,IAAI,CAAC,GACH;EAGF,IAAI,IAAS,GAGP,KAAgB,MAAkB;GACtC,IAAS,EAAE,QAAQ,GAAG;EACxB,GACM,KAAc,MAAkB;GACpC,IAAM,IAAK,EAAE,eAAe,GAAG,UAAU;GAGzC,CAFmB,IAAQ,IAAK,KAAY,IAAK,QAG/C,IAAU;EAEd;EAKA,OAHA,EAAG,iBAAiB,cAAc,GAAc,EAAE,SAAS,GAAK,CAAC,GACjE,EAAG,iBAAiB,YAAY,GAAY,EAAE,SAAS,GAAK,CAAC,SAEhD;GAEX,AADA,EAAG,oBAAoB,cAAc,CAAY,GACjD,EAAG,oBAAoB,YAAY,CAAU;EAC/C;CACF,GAAG;EAAC;EAAU;EAAa;EAAO;CAAO,CAAC,GAGxC,kBAAC,OAAD;EACE,WAAW;GACT,EAAO;GACP,IAAW,EAAO,SAAS,EAAO;GAClC,CAAC,KAAY,IAAY,EAAO,YAAY;GAC5C,IAAQ,EAAO,MAAM,EAAO;GAC5B;EACF,EACG,OAAO,OAAO,EACd,KAAK,GAAG;EACX,OAAO;GAAE,mBAAmB;GAAc,GAAG;EAAM;EACnD,GAAI;YAXN;GAcG,KACC,kBAAC,OAAD;IACE,WAAW,CAAC,EAAO,UAAU,IAAc,EAAO,kBAAkB,IAAI,EACrE,OAAO,OAAO,EACd,KAAK,GAAG;IACX,eAAY;IACZ,SAAS;GACV,CAAA;GAIH,kBAAC,OAAD;IACE,KAAK;IACL,WAAW,CACT,EAAO,SACP,IAAY,IAAc,EAAO,cAAc,EAAO,gBAAiB,IACzE,EACG,OAAO,OAAO,EACd,KAAK,GAAG;IACX,eAAa,KAAY,CAAC;cAEzB;GACE,CAAA;GAGL,kBAAC,OAAD;IAAK,WAAW,EAAO;cAAU;GAAa,CAAA;EAC3C;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./OverlaySplitView/OverlaySplitView.cjs");exports.OverlaySplitView=e.OverlaySplitView;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("../Icon/Icon.cjs"),t=require("../EntryRow/EntryRow.cjs"),n=require("./PasswordEntryRow.module.css.cjs");let r=require("react"),i=require("react/jsx-runtime"),a=require("@gnome-ui/icons");var o=({trailing:o,disabled:s,autoComplete:c=`current-password`,...l})=>{let[u,d]=(0,r.useState)(!1),f=(0,i.jsx)(`button`,{type:`button`,className:n.default.revealButton,onClick:e=>{e.stopPropagation(),d(e=>!e)},"aria-label":u?`Conceal password`:`Reveal password`,"aria-pressed":u,disabled:s,children:(0,i.jsx)(e.Icon,{icon:u?a.ViewConceal:a.ViewReveal,size:`md`,"aria-hidden":!0})});return(0,i.jsx)(t.EntryRow,{...l,autoComplete:c,type:u?`text`:`password`,disabled:s,trailing:(0,i.jsxs)(i.Fragment,{children:[o,f]})})};exports.PasswordEntryRow=o;
|
|
2
2
|
//# sourceMappingURL=PasswordEntryRow.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordEntryRow.cjs","names":[],"sources":["../../../src/components/PasswordEntryRow/PasswordEntryRow.tsx"],"sourcesContent":["import { ViewConceal, ViewReveal } from '@gnome-ui/icons';\nimport { type ReactNode, useState } from 'react';\n\nimport { EntryRow, type EntryRowProps } from '../EntryRow';\nimport { Icon } from '../Icon';\n\nimport styles from './PasswordEntryRow.module.css';\n\nexport interface PasswordEntryRowProps extends Omit<EntryRowProps, 'type' | 'trailing'> {\n /** Additional trailing widgets placed before the reveal button. */\n trailing?: ReactNode;\n}\n\n/**\n * Password entry row with a built-in reveal/conceal toggle.\n *\n * Mirrors `AdwPasswordEntryRow` — an `EntryRow` variant that defaults to\n * `type=\"password\"` and provides a trailing icon button to reveal or conceal\n * the entered text. Use inside a `BoxedList` for password settings fields.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.PasswordEntryRow.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"PasswordEntryRow.cjs","names":[],"sources":["../../../src/components/PasswordEntryRow/PasswordEntryRow.tsx"],"sourcesContent":["import { ViewConceal, ViewReveal } from '@gnome-ui/icons';\nimport { type ReactNode, useState } from 'react';\n\nimport { EntryRow, type EntryRowProps } from '../EntryRow';\nimport { Icon } from '../Icon';\n\nimport styles from './PasswordEntryRow.module.css';\n\nexport interface PasswordEntryRowProps extends Omit<EntryRowProps, 'type' | 'trailing'> {\n /** Additional trailing widgets placed before the reveal button. */\n trailing?: ReactNode;\n}\n\n/**\n * Password entry row with a built-in reveal/conceal toggle.\n *\n * Mirrors `AdwPasswordEntryRow` — an `EntryRow` variant that defaults to\n * `type=\"password\"` and provides a trailing icon button to reveal or conceal\n * the entered text. Use inside a `BoxedList` for password settings fields.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.PasswordEntryRow.html\n */\nexport const PasswordEntryRow = ({\n trailing,\n disabled,\n // \"current-password\" lets password managers and mobile keyboards offer the\n // saved credential; pass \"new-password\" for registration / change forms.\n autoComplete = 'current-password',\n ...props\n}: PasswordEntryRowProps) => {\n const [revealed, setRevealed] = useState(false);\n\n const revealButton = (\n <button\n type=\"button\"\n className={styles.revealButton}\n onClick={(e) => {\n e.stopPropagation();\n setRevealed((v) => !v);\n }}\n aria-label={revealed ? 'Conceal password' : 'Reveal password'}\n aria-pressed={revealed}\n disabled={disabled}\n >\n <Icon icon={revealed ? ViewConceal : ViewReveal} size=\"md\" aria-hidden />\n </button>\n );\n\n return (\n <EntryRow\n {...props}\n autoComplete={autoComplete}\n type={revealed ? 'text' : 'password'}\n disabled={disabled}\n trailing={\n <>\n {trailing}\n {revealButton}\n </>\n }\n />\n );\n};\n"],"mappings":"4MAsBA,IAAa,GAAoB,CAC/B,WACA,WAGA,eAAe,mBACf,GAAG,KACwB,CAC3B,GAAM,CAAC,EAAU,IAAA,EAAA,EAAA,UAAwB,EAAK,EAExC,GACJ,EAAA,EAAA,KAAC,SAAD,CACE,KAAK,SACL,UAAW,EAAA,QAAO,aAClB,QAAU,GAAM,CACd,EAAE,gBAAgB,EAClB,EAAa,GAAM,CAAC,CAAC,CACvB,EACA,aAAY,EAAW,mBAAqB,kBAC5C,eAAc,EACJ,qBAEV,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,KAAM,EAAW,EAAA,YAAc,EAAA,WAAY,KAAK,KAAK,cAAA,EAAa,CAAA,CAClE,CAAA,EAGV,OACE,EAAA,EAAA,KAAC,EAAA,SAAD,CACE,GAAI,EACU,eACd,KAAM,EAAW,OAAS,WAChB,WACV,UACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,EACA,CACD,CAAA,CAAA,CAEL,CAAA,CAEL"}
|
|
@@ -13,4 +13,4 @@ export interface PasswordEntryRowProps extends Omit<EntryRowProps, 'type' | 'tra
|
|
|
13
13
|
*
|
|
14
14
|
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.PasswordEntryRow.html
|
|
15
15
|
*/
|
|
16
|
-
export declare
|
|
16
|
+
export declare const PasswordEntryRow: ({ trailing, disabled, autoComplete, ...props }: PasswordEntryRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,29 +5,30 @@ import { useState as r } from "react";
|
|
|
5
5
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
6
|
import { ViewConceal as s, ViewReveal as c } from "@gnome-ui/icons";
|
|
7
7
|
//#region src/components/PasswordEntryRow/PasswordEntryRow.tsx
|
|
8
|
-
|
|
9
|
-
let [
|
|
8
|
+
var l = ({ trailing: l, disabled: u, autoComplete: d = "current-password", ...f }) => {
|
|
9
|
+
let [p, m] = r(!1), h = /* @__PURE__ */ a("button", {
|
|
10
10
|
type: "button",
|
|
11
11
|
className: n.revealButton,
|
|
12
12
|
onClick: (e) => {
|
|
13
|
-
e.stopPropagation(),
|
|
13
|
+
e.stopPropagation(), m((e) => !e);
|
|
14
14
|
},
|
|
15
|
-
"aria-label":
|
|
16
|
-
"aria-pressed":
|
|
15
|
+
"aria-label": p ? "Conceal password" : "Reveal password",
|
|
16
|
+
"aria-pressed": p,
|
|
17
17
|
disabled: u,
|
|
18
18
|
children: /* @__PURE__ */ a(e, {
|
|
19
|
-
icon:
|
|
19
|
+
icon: p ? s : c,
|
|
20
20
|
size: "md",
|
|
21
21
|
"aria-hidden": !0
|
|
22
22
|
})
|
|
23
23
|
});
|
|
24
24
|
return /* @__PURE__ */ a(t, {
|
|
25
|
-
...
|
|
26
|
-
|
|
25
|
+
...f,
|
|
26
|
+
autoComplete: d,
|
|
27
|
+
type: p ? "text" : "password",
|
|
27
28
|
disabled: u,
|
|
28
|
-
trailing: /* @__PURE__ */ o(i, { children: [l,
|
|
29
|
+
trailing: /* @__PURE__ */ o(i, { children: [l, h] })
|
|
29
30
|
});
|
|
30
|
-
}
|
|
31
|
+
};
|
|
31
32
|
//#endregion
|
|
32
33
|
export { l as PasswordEntryRow };
|
|
33
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordEntryRow.js","names":[],"sources":["../../../src/components/PasswordEntryRow/PasswordEntryRow.tsx"],"sourcesContent":["import { ViewConceal, ViewReveal } from '@gnome-ui/icons';\nimport { type ReactNode, useState } from 'react';\n\nimport { EntryRow, type EntryRowProps } from '../EntryRow';\nimport { Icon } from '../Icon';\n\nimport styles from './PasswordEntryRow.module.css';\n\nexport interface PasswordEntryRowProps extends Omit<EntryRowProps, 'type' | 'trailing'> {\n /** Additional trailing widgets placed before the reveal button. */\n trailing?: ReactNode;\n}\n\n/**\n * Password entry row with a built-in reveal/conceal toggle.\n *\n * Mirrors `AdwPasswordEntryRow` — an `EntryRow` variant that defaults to\n * `type=\"password\"` and provides a trailing icon button to reveal or conceal\n * the entered text. Use inside a `BoxedList` for password settings fields.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.PasswordEntryRow.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"PasswordEntryRow.js","names":[],"sources":["../../../src/components/PasswordEntryRow/PasswordEntryRow.tsx"],"sourcesContent":["import { ViewConceal, ViewReveal } from '@gnome-ui/icons';\nimport { type ReactNode, useState } from 'react';\n\nimport { EntryRow, type EntryRowProps } from '../EntryRow';\nimport { Icon } from '../Icon';\n\nimport styles from './PasswordEntryRow.module.css';\n\nexport interface PasswordEntryRowProps extends Omit<EntryRowProps, 'type' | 'trailing'> {\n /** Additional trailing widgets placed before the reveal button. */\n trailing?: ReactNode;\n}\n\n/**\n * Password entry row with a built-in reveal/conceal toggle.\n *\n * Mirrors `AdwPasswordEntryRow` — an `EntryRow` variant that defaults to\n * `type=\"password\"` and provides a trailing icon button to reveal or conceal\n * the entered text. Use inside a `BoxedList` for password settings fields.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.PasswordEntryRow.html\n */\nexport const PasswordEntryRow = ({\n trailing,\n disabled,\n // \"current-password\" lets password managers and mobile keyboards offer the\n // saved credential; pass \"new-password\" for registration / change forms.\n autoComplete = 'current-password',\n ...props\n}: PasswordEntryRowProps) => {\n const [revealed, setRevealed] = useState(false);\n\n const revealButton = (\n <button\n type=\"button\"\n className={styles.revealButton}\n onClick={(e) => {\n e.stopPropagation();\n setRevealed((v) => !v);\n }}\n aria-label={revealed ? 'Conceal password' : 'Reveal password'}\n aria-pressed={revealed}\n disabled={disabled}\n >\n <Icon icon={revealed ? ViewConceal : ViewReveal} size=\"md\" aria-hidden />\n </button>\n );\n\n return (\n <EntryRow\n {...props}\n autoComplete={autoComplete}\n type={revealed ? 'text' : 'password'}\n disabled={disabled}\n trailing={\n <>\n {trailing}\n {revealButton}\n </>\n }\n />\n );\n};\n"],"mappings":";;;;;;;AAsBA,IAAa,KAAoB,EAC/B,aACA,aAGA,kBAAe,oBACf,GAAG,QACwB;CAC3B,IAAM,CAAC,GAAU,KAAe,EAAS,EAAK,GAExC,IACJ,kBAAC,UAAD;EACE,MAAK;EACL,WAAW,EAAO;EAClB,UAAU,MAAM;GAEd,AADA,EAAE,gBAAgB,GAClB,GAAa,MAAM,CAAC,CAAC;EACvB;EACA,cAAY,IAAW,qBAAqB;EAC5C,gBAAc;EACJ;YAEV,kBAAC,GAAD;GAAM,MAAM,IAAW,IAAc;GAAY,MAAK;GAAK,eAAA;EAAa,CAAA;CAClE,CAAA;CAGV,OACE,kBAAC,GAAD;EACE,GAAI;EACU;EACd,MAAM,IAAW,SAAS;EAChB;EACV,UACE,kBAAA,GAAA,EAAA,UAAA,CACG,GACA,CACD,EAAA,CAAA;CAEL,CAAA;AAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./PasswordEntryRow/PasswordEntryRow.cjs");exports.PasswordEntryRow=e.PasswordEntryRow;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("./PathBar.module.css.cjs");let t=require("react/jsx-runtime");var n=({segments:n,onNavigate:r,className:i,...a})=>(0,t.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:[e.default.pathBar,i].filter(Boolean).join(` `),...a,children:(0,t.jsx)(`ol`,{className:e.default.list,"aria-label":`Path segments`,children:n.map((i,a)=>{let o=a===n.length-1;return(0,t.jsxs)(`li`,{className:e.default.item,children:[a>0&&(0,t.jsx)(`span`,{className:e.default.separator,"aria-hidden":`true`,children:(0,t.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M4 2l4 4-4 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),o?(0,t.jsxs)(`span`,{className:e.default.current,"aria-current":`page`,children:[i.icon&&(0,t.jsx)(`span`,{className:e.default.icon,"aria-hidden":`true`,children:i.icon}),i.label]}):(0,t.jsxs)(`button`,{type:`button`,className:e.default.segment,onClick:()=>r?.(i.path,a),children:[i.icon&&(0,t.jsx)(`span`,{className:e.default.icon,"aria-hidden":`true`,children:i.icon}),i.label]})]},i.path)})})});exports.PathBar=n;
|
|
2
2
|
//# sourceMappingURL=PathBar.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathBar.cjs","names":[],"sources":["../../../src/components/PathBar/PathBar.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\n\nimport styles from './PathBar.module.css';\n\nexport interface PathBarSegment {\n /** Display label for this path segment. */\n label: string;\n /** Opaque path value passed to `onNavigate` when the segment is clicked. */\n path: string;\n /** Optional icon placed before the label (e.g. a folder icon). */\n icon?: ReactNode;\n}\n\nexport interface PathBarProps extends HTMLAttributes<HTMLElement> {\n /**\n * Ordered path segments from root to current location.\n * The last segment is the current folder and is rendered non-interactive.\n */\n segments: PathBarSegment[];\n /**\n * Called when the user clicks on a non-current segment.\n * Receives the `path` and zero-based `index` of the clicked segment.\n */\n onNavigate?: (path: string, index: number) => void;\n}\n\n/**\n * Breadcrumb path bar for navigating a hierarchical location.\n *\n * Mirrors the location bar in GNOME Files (Nautilus). Segments are separated\n * by chevron dividers. All segments except the last are interactive — clicking\n * them calls `onNavigate`. The last segment represents the current location and\n * is rendered as a static label.\n *\n * @see https://developer.gnome.org/hig/patterns/nav/search.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"PathBar.cjs","names":[],"sources":["../../../src/components/PathBar/PathBar.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\n\nimport styles from './PathBar.module.css';\n\nexport interface PathBarSegment {\n /** Display label for this path segment. */\n label: string;\n /** Opaque path value passed to `onNavigate` when the segment is clicked. */\n path: string;\n /** Optional icon placed before the label (e.g. a folder icon). */\n icon?: ReactNode;\n}\n\nexport interface PathBarProps extends HTMLAttributes<HTMLElement> {\n /**\n * Ordered path segments from root to current location.\n * The last segment is the current folder and is rendered non-interactive.\n */\n segments: PathBarSegment[];\n /**\n * Called when the user clicks on a non-current segment.\n * Receives the `path` and zero-based `index` of the clicked segment.\n */\n onNavigate?: (path: string, index: number) => void;\n}\n\n/**\n * Breadcrumb path bar for navigating a hierarchical location.\n *\n * Mirrors the location bar in GNOME Files (Nautilus). Segments are separated\n * by chevron dividers. All segments except the last are interactive — clicking\n * them calls `onNavigate`. The last segment represents the current location and\n * is rendered as a static label.\n *\n * @see https://developer.gnome.org/hig/patterns/nav/search.html\n */\nexport const PathBar = ({ segments, onNavigate, className, ...props }: PathBarProps) => {\n return (\n <nav\n aria-label=\"Breadcrumb\"\n className={[styles.pathBar, className].filter(Boolean).join(' ')}\n {...props}\n >\n <ol className={styles.list} aria-label=\"Path segments\">\n {segments.map((segment, index) => {\n const isCurrent = index === segments.length - 1;\n\n return (\n <li key={segment.path} className={styles.item}>\n {/* Separator chevron (not before the first segment) */}\n {index > 0 && (\n <span className={styles.separator} aria-hidden=\"true\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" focusable=\"false\">\n <path\n d=\"M4 2l4 4-4 4\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </span>\n )}\n\n {isCurrent ? (\n /* Current folder — non-interactive */\n <span className={styles.current} aria-current=\"page\">\n {segment.icon && (\n <span className={styles.icon} aria-hidden=\"true\">\n {segment.icon}\n </span>\n )}\n {segment.label}\n </span>\n ) : (\n /* Ancestor folder — clickable */\n <button\n type=\"button\"\n className={styles.segment}\n onClick={() => onNavigate?.(segment.path, index)}\n >\n {segment.icon && (\n <span className={styles.icon} aria-hidden=\"true\">\n {segment.icon}\n </span>\n )}\n {segment.label}\n </button>\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n};\n"],"mappings":"+EAoCA,IAAa,GAAW,CAAE,WAAU,aAAY,YAAW,GAAG,MAE1D,EAAA,EAAA,KAAC,MAAD,CACE,aAAW,aACX,UAAW,CAAC,EAAA,QAAO,QAAS,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAC/D,GAAI,YAEJ,EAAA,EAAA,KAAC,KAAD,CAAI,UAAW,EAAA,QAAO,KAAM,aAAW,yBACpC,EAAS,KAAK,EAAS,IAAU,CAChC,IAAM,EAAY,IAAU,EAAS,OAAS,EAE9C,OACE,EAAA,EAAA,MAAC,KAAD,CAAuB,UAAW,EAAA,QAAO,cAAzC,CAEG,EAAQ,IACP,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,UAAW,cAAY,iBAC7C,EAAA,EAAA,KAAC,MAAD,CAAK,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,UAAU,kBACxD,EAAA,EAAA,KAAC,OAAD,CACE,EAAE,eACF,KAAK,OACL,OAAO,eACP,YAAY,MACZ,cAAc,QACd,eAAe,OAChB,CAAA,CACE,CAAA,CACD,CAAA,EAGP,GAEC,EAAA,EAAA,MAAC,OAAD,CAAM,UAAW,EAAA,QAAO,QAAS,eAAa,gBAA9C,CACG,EAAQ,OACP,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,KAAM,cAAY,gBACvC,EAAQ,IACL,CAAA,EAEP,EAAQ,KACL,KAGN,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,SACL,UAAW,EAAA,QAAO,QAClB,YAAe,IAAa,EAAQ,KAAM,CAAK,WAHjD,CAKG,EAAQ,OACP,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,KAAM,cAAY,gBACvC,EAAQ,IACL,CAAA,EAEP,EAAQ,KACH,GAER,GA1CK,EAAQ,IA0Cb,CAER,CAAC,CACC,CAAA,CACD,CAAA"}
|
|
@@ -29,4 +29,4 @@ export interface PathBarProps extends HTMLAttributes<HTMLElement> {
|
|
|
29
29
|
*
|
|
30
30
|
* @see https://developer.gnome.org/hig/patterns/nav/search.html
|
|
31
31
|
*/
|
|
32
|
-
export declare
|
|
32
|
+
export declare const PathBar: ({ segments, onNavigate, className, ...props }: PathBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,58 +1,56 @@
|
|
|
1
1
|
import e from "./PathBar.module.css.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/PathBar/PathBar.tsx
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
strokeLinejoin: "round"
|
|
31
|
-
})
|
|
4
|
+
var r = ({ segments: r, onNavigate: i, className: a, ...o }) => /* @__PURE__ */ t("nav", {
|
|
5
|
+
"aria-label": "Breadcrumb",
|
|
6
|
+
className: [e.pathBar, a].filter(Boolean).join(" "),
|
|
7
|
+
...o,
|
|
8
|
+
children: /* @__PURE__ */ t("ol", {
|
|
9
|
+
className: e.list,
|
|
10
|
+
"aria-label": "Path segments",
|
|
11
|
+
children: r.map((a, o) => {
|
|
12
|
+
let s = o === r.length - 1;
|
|
13
|
+
return /* @__PURE__ */ n("li", {
|
|
14
|
+
className: e.item,
|
|
15
|
+
children: [o > 0 && /* @__PURE__ */ t("span", {
|
|
16
|
+
className: e.separator,
|
|
17
|
+
"aria-hidden": "true",
|
|
18
|
+
children: /* @__PURE__ */ t("svg", {
|
|
19
|
+
width: "12",
|
|
20
|
+
height: "12",
|
|
21
|
+
viewBox: "0 0 12 12",
|
|
22
|
+
focusable: "false",
|
|
23
|
+
children: /* @__PURE__ */ t("path", {
|
|
24
|
+
d: "M4 2l4 4-4 4",
|
|
25
|
+
fill: "none",
|
|
26
|
+
stroke: "currentColor",
|
|
27
|
+
strokeWidth: "1.5",
|
|
28
|
+
strokeLinecap: "round",
|
|
29
|
+
strokeLinejoin: "round"
|
|
32
30
|
})
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
})]
|
|
51
|
-
}
|
|
52
|
-
})
|
|
31
|
+
})
|
|
32
|
+
}), s ? /* @__PURE__ */ n("span", {
|
|
33
|
+
className: e.current,
|
|
34
|
+
"aria-current": "page",
|
|
35
|
+
children: [a.icon && /* @__PURE__ */ t("span", {
|
|
36
|
+
className: e.icon,
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
children: a.icon
|
|
39
|
+
}), a.label]
|
|
40
|
+
}) : /* @__PURE__ */ n("button", {
|
|
41
|
+
type: "button",
|
|
42
|
+
className: e.segment,
|
|
43
|
+
onClick: () => i?.(a.path, o),
|
|
44
|
+
children: [a.icon && /* @__PURE__ */ t("span", {
|
|
45
|
+
className: e.icon,
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
children: a.icon
|
|
48
|
+
}), a.label]
|
|
49
|
+
})]
|
|
50
|
+
}, a.path);
|
|
53
51
|
})
|
|
54
|
-
})
|
|
55
|
-
}
|
|
52
|
+
})
|
|
53
|
+
});
|
|
56
54
|
//#endregion
|
|
57
55
|
export { r as PathBar };
|
|
58
56
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathBar.js","names":[],"sources":["../../../src/components/PathBar/PathBar.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\n\nimport styles from './PathBar.module.css';\n\nexport interface PathBarSegment {\n /** Display label for this path segment. */\n label: string;\n /** Opaque path value passed to `onNavigate` when the segment is clicked. */\n path: string;\n /** Optional icon placed before the label (e.g. a folder icon). */\n icon?: ReactNode;\n}\n\nexport interface PathBarProps extends HTMLAttributes<HTMLElement> {\n /**\n * Ordered path segments from root to current location.\n * The last segment is the current folder and is rendered non-interactive.\n */\n segments: PathBarSegment[];\n /**\n * Called when the user clicks on a non-current segment.\n * Receives the `path` and zero-based `index` of the clicked segment.\n */\n onNavigate?: (path: string, index: number) => void;\n}\n\n/**\n * Breadcrumb path bar for navigating a hierarchical location.\n *\n * Mirrors the location bar in GNOME Files (Nautilus). Segments are separated\n * by chevron dividers. All segments except the last are interactive — clicking\n * them calls `onNavigate`. The last segment represents the current location and\n * is rendered as a static label.\n *\n * @see https://developer.gnome.org/hig/patterns/nav/search.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"PathBar.js","names":[],"sources":["../../../src/components/PathBar/PathBar.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\n\nimport styles from './PathBar.module.css';\n\nexport interface PathBarSegment {\n /** Display label for this path segment. */\n label: string;\n /** Opaque path value passed to `onNavigate` when the segment is clicked. */\n path: string;\n /** Optional icon placed before the label (e.g. a folder icon). */\n icon?: ReactNode;\n}\n\nexport interface PathBarProps extends HTMLAttributes<HTMLElement> {\n /**\n * Ordered path segments from root to current location.\n * The last segment is the current folder and is rendered non-interactive.\n */\n segments: PathBarSegment[];\n /**\n * Called when the user clicks on a non-current segment.\n * Receives the `path` and zero-based `index` of the clicked segment.\n */\n onNavigate?: (path: string, index: number) => void;\n}\n\n/**\n * Breadcrumb path bar for navigating a hierarchical location.\n *\n * Mirrors the location bar in GNOME Files (Nautilus). Segments are separated\n * by chevron dividers. All segments except the last are interactive — clicking\n * them calls `onNavigate`. The last segment represents the current location and\n * is rendered as a static label.\n *\n * @see https://developer.gnome.org/hig/patterns/nav/search.html\n */\nexport const PathBar = ({ segments, onNavigate, className, ...props }: PathBarProps) => {\n return (\n <nav\n aria-label=\"Breadcrumb\"\n className={[styles.pathBar, className].filter(Boolean).join(' ')}\n {...props}\n >\n <ol className={styles.list} aria-label=\"Path segments\">\n {segments.map((segment, index) => {\n const isCurrent = index === segments.length - 1;\n\n return (\n <li key={segment.path} className={styles.item}>\n {/* Separator chevron (not before the first segment) */}\n {index > 0 && (\n <span className={styles.separator} aria-hidden=\"true\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" focusable=\"false\">\n <path\n d=\"M4 2l4 4-4 4\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </span>\n )}\n\n {isCurrent ? (\n /* Current folder — non-interactive */\n <span className={styles.current} aria-current=\"page\">\n {segment.icon && (\n <span className={styles.icon} aria-hidden=\"true\">\n {segment.icon}\n </span>\n )}\n {segment.label}\n </span>\n ) : (\n /* Ancestor folder — clickable */\n <button\n type=\"button\"\n className={styles.segment}\n onClick={() => onNavigate?.(segment.path, index)}\n >\n {segment.icon && (\n <span className={styles.icon} aria-hidden=\"true\">\n {segment.icon}\n </span>\n )}\n {segment.label}\n </button>\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n};\n"],"mappings":";;;AAoCA,IAAa,KAAW,EAAE,aAAU,eAAY,cAAW,GAAG,QAE1D,kBAAC,OAAD;CACE,cAAW;CACX,WAAW,CAAC,EAAO,SAAS,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;CAC/D,GAAI;WAEJ,kBAAC,MAAD;EAAI,WAAW,EAAO;EAAM,cAAW;YACpC,EAAS,KAAK,GAAS,MAAU;GAChC,IAAM,IAAY,MAAU,EAAS,SAAS;GAE9C,OACE,kBAAC,MAAD;IAAuB,WAAW,EAAO;cAAzC,CAEG,IAAQ,KACP,kBAAC,QAAD;KAAM,WAAW,EAAO;KAAW,eAAY;eAC7C,kBAAC,OAAD;MAAK,OAAM;MAAK,QAAO;MAAK,SAAQ;MAAY,WAAU;gBACxD,kBAAC,QAAD;OACE,GAAE;OACF,MAAK;OACL,QAAO;OACP,aAAY;OACZ,eAAc;OACd,gBAAe;MAChB,CAAA;KACE,CAAA;IACD,CAAA,GAGP,IAEC,kBAAC,QAAD;KAAM,WAAW,EAAO;KAAS,gBAAa;eAA9C,CACG,EAAQ,QACP,kBAAC,QAAD;MAAM,WAAW,EAAO;MAAM,eAAY;gBACvC,EAAQ;KACL,CAAA,GAEP,EAAQ,KACL;SAGN,kBAAC,UAAD;KACE,MAAK;KACL,WAAW,EAAO;KAClB,eAAe,IAAa,EAAQ,MAAM,CAAK;eAHjD,CAKG,EAAQ,QACP,kBAAC,QAAD;MAAM,WAAW,EAAO;MAAM,eAAY;gBACvC,EAAQ;KACL,CAAA,GAEP,EAAQ,KACH;MAER;MA1CK,EAAQ,IA0Cb;EAER,CAAC;CACC,CAAA;AACD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./PathBar/PathBar.cjs");exports.PathBar=e.PathBar;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("./Popover.module.css.cjs");let t=require("react"),n=require("react-dom"),r=require("react/jsx-runtime");var i=8,a=10,o=6;function s(e,t,n){let r=window.innerWidth,s=window.innerHeight,c=[...new Set([n,n===`top`?`bottom`:n===`bottom`?`top`:n===`left`?`right`:`left`,`bottom`,`top`,`left`,`right`])];function l(n){return n===`bottom`?{top:e.bottom+i,left:e.left+e.width/2-t.width/2}:n===`top`?{top:e.top-t.height-i,left:e.left+e.width/2-t.width/2}:n===`left`?{top:e.top+e.height/2-t.height/2,left:e.left-t.width-i}:{top:e.top+e.height/2-t.height/2,left:e.right+i}}for(let n of c){let{top:i,left:o}=l(n),c=o>=a&&o+t.width<=r-a,u=i>=a&&i+t.height<=s-a;if(c&&u)return{top:i,left:o,placement:n,arrowOffset:n===`top`||n===`bottom`?e.left+e.width/2-o:e.top+e.height/2-i}}for(let n of c){let{top:i,left:c}=l(n),u=i>=a&&i+t.height<=s-a,d=c>=a&&c+t.width<=r-a;if((n===`top`||n===`bottom`)&&u){let s=Math.max(a,Math.min(c,r-t.width-a)),l=e.left+e.width/2-s;return{top:i,left:s,placement:n,arrowOffset:Math.max(10,Math.min(l,t.width-o-4))}}if((n===`left`||n===`right`)&&d){let r=Math.max(a,Math.min(i,s-t.height-a)),l=e.top+e.height/2-r;return{top:r,left:c,placement:n,arrowOffset:Math.max(10,Math.min(l,t.height-o-4))}}}let u=e.bottom+i,d=e.left+e.width/2-t.width/2,f=Math.max(a,Math.min(u,s-t.height-a)),p=Math.max(a,Math.min(d,r-t.width-a)),m=e.left+e.width/2-p;return{top:f,left:p,placement:`bottom`,arrowOffset:Math.max(10,Math.min(m,t.width-o-4))}}var c=({content:i,placement:a=`bottom`,open:c,onClose:l,onOpenChange:u,children:d})=>{let f=c!==void 0,[p,m]=(0,t.useState)(!1),h=f?c:p,[g,_]=(0,t.useState)(null),v=(0,t.useId)(),y=(0,t.useId)(),b=(0,t.useRef)(null),x=(0,t.useRef)(null),S=(0,t.useRef)(null),C=(0,t.useCallback)(()=>{f?l?.():m(!1),u?.(!1)},[f,l,u]),w=(0,t.useCallback)(()=>{h?C():(f||m(!0),u?.(!0))},[h,C,f,u]),T=(0,t.useCallback)(()=>{!b.current||!x.current||_(s(b.current.getBoundingClientRect(),x.current.getBoundingClientRect(),a))},[a]);(0,t.useEffect)(()=>{if(!h)return;let e=requestAnimationFrame(()=>{T(),window.addEventListener(`scroll`,T,{passive:!0,capture:!0}),window.addEventListener(`resize`,T,{passive:!0})});return()=>{cancelAnimationFrame(e),window.removeEventListener(`scroll`,T,{capture:!0}),window.removeEventListener(`resize`,T)}},[h,T]),(0,t.useEffect)(()=>{h?(S.current=document.activeElement,requestAnimationFrame(()=>{(x.current?.querySelector(`button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`)??x.current)?.focus()})):(S.current?.focus(),_(null))},[h]),(0,t.useEffect)(()=>{if(!h)return;let e=e=>{!b.current?.contains(e.target)&&!x.current?.contains(e.target)&&C()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[h,C]);let E=(0,t.useCallback)(e=>{e.key===`Escape`&&(e.stopPropagation(),C())},[C]),D=(0,t.cloneElement)(d,{ref:b,id:v,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":h?y:void 0,onClick:e=>{w(),d.props.onClick?.(e)}}),O=(0,r.jsxs)(`div`,{ref:x,id:y,role:`dialog`,"aria-labelledby":v,tabIndex:-1,className:[e.default.panel,g?e.default[g.placement]:null,h&&g?e.default.visible:null].filter(Boolean).join(` `),style:g?{top:g.top,left:g.left}:{visibility:`hidden`,pointerEvents:`none`,top:-9999,left:-9999},onKeyDown:E,children:[(0,r.jsx)(`div`,{className:e.default.arrow,"aria-hidden":`true`,style:g?.arrowOffset===void 0?void 0:g.placement===`top`||g.placement===`bottom`?{left:g.arrowOffset-o,marginLeft:0}:{top:g.arrowOffset-o,marginTop:0}}),i]});return(0,r.jsxs)(r.Fragment,{children:[D,h&&(typeof document<`u`?(0,n.createPortal)(O,document.body):O)]})};exports.Popover=c;
|
|
2
2
|
//# sourceMappingURL=Popover.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.cjs","names":[],"sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import {\n cloneElement,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type ReactElement,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\n\nimport { createPortal } from 'react-dom';\n\nimport styles from './Popover.module.css';\n\nexport type PopoverPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nexport interface PopoverProps {\n /**\n * The rich content rendered inside the popover panel.\n * Can include interactive elements (buttons, links, forms).\n */\n content: ReactNode;\n /**\n * Preferred placement relative to the trigger.\n * Flips automatically when there is not enough viewport space.\n * Defaults to `\"bottom\"`.\n */\n placement?: PopoverPlacement;\n /**\n * Whether the popover is open (controlled mode).\n * Omit to use uncontrolled mode where the trigger toggles it.\n */\n open?: boolean;\n /**\n * Called when the popover requests to be closed\n * (Escape key, outside click, or trigger click while open).\n */\n onClose?: () => void;\n /**\n * Called when open state should change (controlled mode).\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The trigger element. Must be a single React element that can\n * receive `ref` and click/keyboard event props.\n */\n children: ReactElement<HTMLAttributes<HTMLElement>>;\n}\n\ninterface Position {\n top: number;\n left: number;\n placement: PopoverPlacement;\n /** Arrow center offset in px from the near edge of the panel.\n * Horizontal (left) for top/bottom; vertical (top) for left/right.\n * Undefined means use the default 50% CSS. */\n arrowOffset?: number;\n}\n\nconst GAP = 8;\nconst MARGIN = 10;\nconst ARROW_HALF = 6; // half of the 12 px arrow\n\nfunction computePosition(\n trigger: DOMRect,\n popover: DOMRect,\n preferred: PopoverPlacement,\n): Position {\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n\n const order: PopoverPlacement[] = [\n preferred,\n preferred === 'top'\n ? 'bottom'\n : preferred === 'bottom'\n ? 'top'\n : preferred === 'left'\n ? 'right'\n : 'left',\n 'bottom',\n 'top',\n 'left',\n 'right',\n ];\n\n // De-duplicate while preserving order\n const candidates = [...new Set(order)];\n\n function calcRaw(p: PopoverPlacement): { top: number; left: number } {\n if (p === 'bottom') {\n return {\n top: trigger.bottom + GAP,\n left: trigger.left + trigger.width / 2 - popover.width / 2,\n };\n }\n\n if (p === 'top') {\n return {\n top: trigger.top - popover.height - GAP,\n left: trigger.left + trigger.width / 2 - popover.width / 2,\n };\n }\n\n if (p === 'left') {\n return {\n top: trigger.top + trigger.height / 2 - popover.height / 2,\n left: trigger.left - popover.width - GAP,\n };\n }\n\n return {\n top: trigger.top + trigger.height / 2 - popover.height / 2,\n left: trigger.right + GAP,\n };\n }\n\n // First pass: find a placement that fits both axes perfectly.\n for (const p of candidates) {\n const { top, left } = calcRaw(p);\n const fitsH = left >= MARGIN && left + popover.width <= vw - MARGIN;\n const fitsV = top >= MARGIN && top + popover.height <= vh - MARGIN;\n\n if (fitsH && fitsV) {\n // Always use pixel arrowOffset (never rely on CSS left:50%) so the arrow\n // points exactly at the trigger center regardless of sub-pixel rounding.\n const arrowOffset =\n p === 'top' || p === 'bottom'\n ? trigger.left + trigger.width / 2 - left\n : trigger.top + trigger.height / 2 - top;\n\n return { top, left, placement: p, arrowOffset };\n }\n }\n\n // Second pass: fits the primary axis; clamp the secondary axis and\n // shift the arrow so it still points at the trigger center.\n for (const p of candidates) {\n const { top, left } = calcRaw(p);\n const fitsV = top >= MARGIN && top + popover.height <= vh - MARGIN;\n const fitsH = left >= MARGIN && left + popover.width <= vw - MARGIN;\n\n if ((p === 'top' || p === 'bottom') && fitsV) {\n const clampedLeft = Math.max(MARGIN, Math.min(left, vw - popover.width - MARGIN));\n const rawOffset = trigger.left + trigger.width / 2 - clampedLeft;\n\n return {\n top,\n left: clampedLeft,\n placement: p,\n arrowOffset: Math.max(ARROW_HALF + 4, Math.min(rawOffset, popover.width - ARROW_HALF - 4)),\n };\n }\n\n if ((p === 'left' || p === 'right') && fitsH) {\n const clampedTop = Math.max(MARGIN, Math.min(top, vh - popover.height - MARGIN));\n const rawOffset = trigger.top + trigger.height / 2 - clampedTop;\n\n return {\n top: clampedTop,\n left,\n placement: p,\n arrowOffset: Math.max(ARROW_HALF + 4, Math.min(rawOffset, popover.height - ARROW_HALF - 4)),\n };\n }\n }\n\n // Fallback: clamp bottom placement and shift arrow to match trigger.\n const fbTop = trigger.bottom + GAP;\n const fbLeft = trigger.left + trigger.width / 2 - popover.width / 2;\n const clampedTop = Math.max(MARGIN, Math.min(fbTop, vh - popover.height - MARGIN));\n const clampedLeft = Math.max(MARGIN, Math.min(fbLeft, vw - popover.width - MARGIN));\n const rawArrowOffset = trigger.left + trigger.width / 2 - clampedLeft;\n\n return {\n top: clampedTop,\n left: clampedLeft,\n placement: 'bottom',\n arrowOffset: Math.max(ARROW_HALF + 4, Math.min(rawArrowOffset, popover.width - ARROW_HALF - 4)),\n };\n}\n\n/**\n * Floating panel anchored to a trigger element.\n *\n * Unlike `Tooltip`, a Popover can contain rich interactive content\n * (menus, forms, details). It follows the Adwaita `GtkPopover` pattern.\n *\n * - Supports both controlled (`open` + `onClose`) and uncontrolled modes.\n * - Auto-positions with viewport-aware flip.\n * - Closes on Escape, outside click, or trigger re-click.\n * - Focus is moved into the panel on open; returns to the trigger on close.\n * - `aria-haspopup=\"dialog\"` + `aria-expanded` wired to the trigger.\n * - `role=\"dialog\"` on the panel with `aria-labelledby` when a heading is present.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Popover.html\n */\nexport function Popover({\n content,\n placement: preferredPlacement = 'bottom',\n open: controlledOpen,\n onClose,\n onOpenChange,\n children,\n}: PopoverProps) {\n const isControlled = controlledOpen !== undefined;\n const [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n const open = isControlled ? controlledOpen : uncontrolledOpen;\n\n const [pos, setPos] = useState<Position | null>(null);\n\n const triggerId = useId();\n const popoverId = useId();\n const triggerRef = useRef<HTMLElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const previouslyFocused = useRef<Element | null>(null);\n\n const close = useCallback(() => {\n if (isControlled) {\n onClose?.();\n } else {\n setUncontrolledOpen(false);\n }\n\n onOpenChange?.(false);\n }, [isControlled, onClose, onOpenChange]);\n\n const toggle = useCallback(() => {\n if (open) {\n close();\n } else {\n if (!isControlled) {\n setUncontrolledOpen(true);\n }\n\n onOpenChange?.(true);\n }\n }, [open, close, isControlled, onOpenChange]);\n\n // Position panel\n const place = useCallback(() => {\n if (!triggerRef.current || !panelRef.current) {\n return;\n }\n\n setPos(\n computePosition(\n triggerRef.current.getBoundingClientRect(),\n panelRef.current.getBoundingClientRect(),\n preferredPlacement,\n ),\n );\n }, [preferredPlacement]);\n\n // Reposition on open, scroll, resize\n useEffect(() => {\n if (!open) {\n return;\n }\n\n // Two RAF: first lets panel mount with hidden styles so we can measure it;\n // second applies the measured position.\n const id = requestAnimationFrame(() => {\n place();\n window.addEventListener('scroll', place, { passive: true, capture: true });\n window.addEventListener('resize', place, { passive: true });\n });\n\n return () => {\n cancelAnimationFrame(id);\n window.removeEventListener('scroll', place, { capture: true });\n window.removeEventListener('resize', place);\n };\n }, [open, place]);\n\n // Save / restore focus\n useEffect(() => {\n if (open) {\n previouslyFocused.current = document.activeElement;\n requestAnimationFrame(() => {\n const first = panelRef.current?.querySelector<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n (first ?? panelRef.current)?.focus();\n });\n } else {\n (previouslyFocused.current as HTMLElement | null)?.focus();\n setPos(null);\n }\n }, [open]);\n\n // Close on outside pointer\n useEffect(() => {\n if (!open) {\n return;\n }\n\n const handler = (e: MouseEvent) => {\n if (\n !triggerRef.current?.contains(e.target as Node) &&\n !panelRef.current?.contains(e.target as Node)\n ) {\n close();\n }\n };\n\n document.addEventListener('mousedown', handler);\n\n return () => document.removeEventListener('mousedown', handler);\n }, [open, close]);\n\n // Escape key\n const handlePanelKeyDown = useCallback(\n (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n close();\n }\n },\n [close],\n );\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const trigger = cloneElement(children as any, {\n ref: triggerRef,\n id: triggerId,\n 'aria-haspopup': 'dialog',\n 'aria-expanded': open,\n 'aria-controls': open ? popoverId : undefined,\n onClick: (e: ReactMouseEvent<HTMLElement>) => {\n toggle();\n children.props.onClick?.(e);\n },\n });\n\n const panel = (\n <div\n ref={panelRef}\n id={popoverId}\n role=\"dialog\"\n aria-labelledby={triggerId}\n tabIndex={-1}\n className={[\n styles.panel,\n pos ? styles[pos.placement] : null,\n open && pos ? styles.visible : null,\n ]\n .filter(Boolean)\n .join(' ')}\n style={\n pos\n ? { top: pos.top, left: pos.left }\n : { visibility: 'hidden', pointerEvents: 'none', top: -9999, left: -9999 }\n }\n onKeyDown={handlePanelKeyDown}\n >\n {/* Arrow — offset shifts it to point at the trigger when the panel is clamped */}\n <div\n className={styles.arrow}\n aria-hidden=\"true\"\n style={\n pos?.arrowOffset !== undefined\n ? pos.placement === 'top' || pos.placement === 'bottom'\n ? { left: pos.arrowOffset - ARROW_HALF, marginLeft: 0 }\n : { top: pos.arrowOffset - ARROW_HALF, marginTop: 0 }\n : undefined\n }\n />\n {content}\n </div>\n );\n\n return (\n <>\n {trigger}\n {open && (typeof document !== 'undefined' ? createPortal(panel, document.body) : panel)}\n </>\n );\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Popover.cjs","names":[],"sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import {\n cloneElement,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactElement,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\n\nimport { createPortal } from 'react-dom';\n\nimport styles from './Popover.module.css';\n\nexport type PopoverPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nexport interface PopoverProps {\n /**\n * The rich content rendered inside the popover panel.\n * Can include interactive elements (buttons, links, forms).\n */\n content: ReactNode;\n /**\n * Preferred placement relative to the trigger.\n * Flips automatically when there is not enough viewport space.\n * Defaults to `\"bottom\"`.\n */\n placement?: PopoverPlacement;\n /**\n * Whether the popover is open (controlled mode).\n * Omit to use uncontrolled mode where the trigger toggles it.\n */\n open?: boolean;\n /**\n * Called when the popover requests to be closed\n * (Escape key, outside click, or trigger click while open).\n */\n onClose?: () => void;\n /**\n * Called when open state should change (controlled mode).\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The trigger element. Must be a single React element that can\n * receive `ref` and click/keyboard event props.\n */\n children: ReactElement<HTMLAttributes<HTMLElement>>;\n}\n\ninterface Position {\n top: number;\n left: number;\n placement: PopoverPlacement;\n /** Arrow center offset in px from the near edge of the panel.\n * Horizontal (left) for top/bottom; vertical (top) for left/right.\n * Undefined means use the default 50% CSS. */\n arrowOffset?: number;\n}\n\nconst GAP = 8;\nconst MARGIN = 10;\nconst ARROW_HALF = 6; // half of the 12 px arrow\n\nfunction computePosition(\n trigger: DOMRect,\n popover: DOMRect,\n preferred: PopoverPlacement,\n): Position {\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n\n const order: PopoverPlacement[] = [\n preferred,\n preferred === 'top'\n ? 'bottom'\n : preferred === 'bottom'\n ? 'top'\n : preferred === 'left'\n ? 'right'\n : 'left',\n 'bottom',\n 'top',\n 'left',\n 'right',\n ];\n\n // De-duplicate while preserving order\n const candidates = [...new Set(order)];\n\n function calcRaw(p: PopoverPlacement): { top: number; left: number } {\n if (p === 'bottom') {\n return {\n top: trigger.bottom + GAP,\n left: trigger.left + trigger.width / 2 - popover.width / 2,\n };\n }\n\n if (p === 'top') {\n return {\n top: trigger.top - popover.height - GAP,\n left: trigger.left + trigger.width / 2 - popover.width / 2,\n };\n }\n\n if (p === 'left') {\n return {\n top: trigger.top + trigger.height / 2 - popover.height / 2,\n left: trigger.left - popover.width - GAP,\n };\n }\n\n return {\n top: trigger.top + trigger.height / 2 - popover.height / 2,\n left: trigger.right + GAP,\n };\n }\n\n // First pass: find a placement that fits both axes perfectly.\n for (const p of candidates) {\n const { top, left } = calcRaw(p);\n const fitsH = left >= MARGIN && left + popover.width <= vw - MARGIN;\n const fitsV = top >= MARGIN && top + popover.height <= vh - MARGIN;\n\n if (fitsH && fitsV) {\n // Always use pixel arrowOffset (never rely on CSS left:50%) so the arrow\n // points exactly at the trigger center regardless of sub-pixel rounding.\n const arrowOffset =\n p === 'top' || p === 'bottom'\n ? trigger.left + trigger.width / 2 - left\n : trigger.top + trigger.height / 2 - top;\n\n return { top, left, placement: p, arrowOffset };\n }\n }\n\n // Second pass: fits the primary axis; clamp the secondary axis and\n // shift the arrow so it still points at the trigger center.\n for (const p of candidates) {\n const { top, left } = calcRaw(p);\n const fitsV = top >= MARGIN && top + popover.height <= vh - MARGIN;\n const fitsH = left >= MARGIN && left + popover.width <= vw - MARGIN;\n\n if ((p === 'top' || p === 'bottom') && fitsV) {\n const clampedLeft = Math.max(MARGIN, Math.min(left, vw - popover.width - MARGIN));\n const rawOffset = trigger.left + trigger.width / 2 - clampedLeft;\n\n return {\n top,\n left: clampedLeft,\n placement: p,\n arrowOffset: Math.max(ARROW_HALF + 4, Math.min(rawOffset, popover.width - ARROW_HALF - 4)),\n };\n }\n\n if ((p === 'left' || p === 'right') && fitsH) {\n const clampedTop = Math.max(MARGIN, Math.min(top, vh - popover.height - MARGIN));\n const rawOffset = trigger.top + trigger.height / 2 - clampedTop;\n\n return {\n top: clampedTop,\n left,\n placement: p,\n arrowOffset: Math.max(ARROW_HALF + 4, Math.min(rawOffset, popover.height - ARROW_HALF - 4)),\n };\n }\n }\n\n // Fallback: clamp bottom placement and shift arrow to match trigger.\n const fbTop = trigger.bottom + GAP;\n const fbLeft = trigger.left + trigger.width / 2 - popover.width / 2;\n const clampedTop = Math.max(MARGIN, Math.min(fbTop, vh - popover.height - MARGIN));\n const clampedLeft = Math.max(MARGIN, Math.min(fbLeft, vw - popover.width - MARGIN));\n const rawArrowOffset = trigger.left + trigger.width / 2 - clampedLeft;\n\n return {\n top: clampedTop,\n left: clampedLeft,\n placement: 'bottom',\n arrowOffset: Math.max(ARROW_HALF + 4, Math.min(rawArrowOffset, popover.width - ARROW_HALF - 4)),\n };\n}\n\n/**\n * Floating panel anchored to a trigger element.\n *\n * Unlike `Tooltip`, a Popover can contain rich interactive content\n * (menus, forms, details). It follows the Adwaita `GtkPopover` pattern.\n *\n * - Supports both controlled (`open` + `onClose`) and uncontrolled modes.\n * - Auto-positions with viewport-aware flip.\n * - Closes on Escape, outside click, or trigger re-click.\n * - Focus is moved into the panel on open; returns to the trigger on close.\n * - `aria-haspopup=\"dialog\"` + `aria-expanded` wired to the trigger.\n * - `role=\"dialog\"` on the panel with `aria-labelledby` when a heading is present.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Popover.html\n */\nexport const Popover = ({\n content,\n placement: preferredPlacement = 'bottom',\n open: controlledOpen,\n onClose,\n onOpenChange,\n children,\n}: PopoverProps) => {\n const isControlled = controlledOpen !== undefined;\n const [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n const open = isControlled ? controlledOpen : uncontrolledOpen;\n\n const [pos, setPos] = useState<Position | null>(null);\n\n const triggerId = useId();\n const popoverId = useId();\n const triggerRef = useRef<HTMLElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const previouslyFocused = useRef<Element | null>(null);\n\n const close = useCallback(() => {\n if (isControlled) {\n onClose?.();\n } else {\n setUncontrolledOpen(false);\n }\n\n onOpenChange?.(false);\n }, [isControlled, onClose, onOpenChange]);\n\n const toggle = useCallback(() => {\n if (open) {\n close();\n } else {\n if (!isControlled) {\n setUncontrolledOpen(true);\n }\n\n onOpenChange?.(true);\n }\n }, [open, close, isControlled, onOpenChange]);\n\n // Position panel\n const place = useCallback(() => {\n if (!triggerRef.current || !panelRef.current) {\n return;\n }\n\n setPos(\n computePosition(\n triggerRef.current.getBoundingClientRect(),\n panelRef.current.getBoundingClientRect(),\n preferredPlacement,\n ),\n );\n }, [preferredPlacement]);\n\n // Reposition on open, scroll, resize\n useEffect(() => {\n if (!open) {\n return;\n }\n\n // Two RAF: first lets panel mount with hidden styles so we can measure it;\n // second applies the measured position.\n const id = requestAnimationFrame(() => {\n place();\n window.addEventListener('scroll', place, { passive: true, capture: true });\n window.addEventListener('resize', place, { passive: true });\n });\n\n return () => {\n cancelAnimationFrame(id);\n window.removeEventListener('scroll', place, { capture: true });\n window.removeEventListener('resize', place);\n };\n }, [open, place]);\n\n // Save / restore focus\n useEffect(() => {\n if (open) {\n previouslyFocused.current = document.activeElement;\n requestAnimationFrame(() => {\n const first = panelRef.current?.querySelector<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n (first ?? panelRef.current)?.focus();\n });\n } else {\n (previouslyFocused.current as HTMLElement | null)?.focus();\n setPos(null);\n }\n }, [open]);\n\n // Close on outside pointer\n useEffect(() => {\n if (!open) {\n return;\n }\n\n const handler = (e: MouseEvent) => {\n if (\n !triggerRef.current?.contains(e.target as Node) &&\n !panelRef.current?.contains(e.target as Node)\n ) {\n close();\n }\n };\n\n document.addEventListener('mousedown', handler);\n\n return () => document.removeEventListener('mousedown', handler);\n }, [open, close]);\n\n // Escape key\n const handlePanelKeyDown = useCallback(\n (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n close();\n }\n },\n [close],\n );\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const trigger = cloneElement(children as any, {\n ref: triggerRef,\n id: triggerId,\n 'aria-haspopup': 'dialog',\n 'aria-expanded': open,\n 'aria-controls': open ? popoverId : undefined,\n onClick: (e: ReactMouseEvent<HTMLElement>) => {\n toggle();\n children.props.onClick?.(e);\n },\n });\n\n const panel = (\n <div\n ref={panelRef}\n id={popoverId}\n role=\"dialog\"\n aria-labelledby={triggerId}\n tabIndex={-1}\n className={[\n styles.panel,\n pos ? styles[pos.placement] : null,\n open && pos ? styles.visible : null,\n ]\n .filter(Boolean)\n .join(' ')}\n style={\n pos\n ? { top: pos.top, left: pos.left }\n : { visibility: 'hidden', pointerEvents: 'none', top: -9999, left: -9999 }\n }\n onKeyDown={handlePanelKeyDown}\n >\n {/* Arrow — offset shifts it to point at the trigger when the panel is clamped */}\n <div\n className={styles.arrow}\n aria-hidden=\"true\"\n style={\n pos?.arrowOffset !== undefined\n ? pos.placement === 'top' || pos.placement === 'bottom'\n ? { left: pos.arrowOffset - ARROW_HALF, marginLeft: 0 }\n : { top: pos.arrowOffset - ARROW_HALF, marginTop: 0 }\n : undefined\n }\n />\n {content}\n </div>\n );\n\n return (\n <>\n {trigger}\n {open && (typeof document !== 'undefined' ? createPortal(panel, document.body) : panel)}\n </>\n );\n};\n"],"mappings":"yHA+DA,IAAM,EAAM,EACN,EAAS,GACT,EAAa,EAEnB,SAAS,EACP,EACA,EACA,EACU,CACV,IAAM,EAAK,OAAO,WACZ,EAAK,OAAO,YAkBZ,EAAa,CAAC,GAAG,IAAI,IAAI,CAf7B,EACA,IAAc,MACV,SACA,IAAc,SACZ,MACA,IAAc,OACZ,QACA,OACR,SACA,MACA,OACA,OAI6B,CAAK,CAAC,EAErC,SAAS,EAAQ,EAAoD,CAsBnE,OArBI,IAAM,SACD,CACL,IAAK,EAAQ,OAAS,EACtB,KAAM,EAAQ,KAAO,EAAQ,MAAQ,EAAI,EAAQ,MAAQ,CAC3D,EAGE,IAAM,MACD,CACL,IAAK,EAAQ,IAAM,EAAQ,OAAS,EACpC,KAAM,EAAQ,KAAO,EAAQ,MAAQ,EAAI,EAAQ,MAAQ,CAC3D,EAGE,IAAM,OACD,CACL,IAAK,EAAQ,IAAM,EAAQ,OAAS,EAAI,EAAQ,OAAS,EACzD,KAAM,EAAQ,KAAO,EAAQ,MAAQ,CACvC,EAGK,CACL,IAAK,EAAQ,IAAM,EAAQ,OAAS,EAAI,EAAQ,OAAS,EACzD,KAAM,EAAQ,MAAQ,CACxB,CACF,CAGA,IAAK,IAAM,KAAK,EAAY,CAC1B,GAAM,CAAE,MAAK,QAAS,EAAQ,CAAC,EACzB,EAAQ,GAAQ,GAAU,EAAO,EAAQ,OAAS,EAAK,EACvD,EAAQ,GAAO,GAAU,EAAM,EAAQ,QAAU,EAAK,EAE5D,GAAI,GAAS,EAQX,MAAO,CAAE,MAAK,OAAM,UAAW,EAAG,YAJhC,IAAM,OAAS,IAAM,SACjB,EAAQ,KAAO,EAAQ,MAAQ,EAAI,EACnC,EAAQ,IAAM,EAAQ,OAAS,EAAI,CAEK,CAElD,CAIA,IAAK,IAAM,KAAK,EAAY,CAC1B,GAAM,CAAE,MAAK,QAAS,EAAQ,CAAC,EACzB,EAAQ,GAAO,GAAU,EAAM,EAAQ,QAAU,EAAK,EACtD,EAAQ,GAAQ,GAAU,EAAO,EAAQ,OAAS,EAAK,EAE7D,IAAK,IAAM,OAAS,IAAM,WAAa,EAAO,CAC5C,IAAM,EAAc,KAAK,IAAI,EAAQ,KAAK,IAAI,EAAM,EAAK,EAAQ,MAAQ,CAAM,CAAC,EAC1E,EAAY,EAAQ,KAAO,EAAQ,MAAQ,EAAI,EAErD,MAAO,CACL,MACA,KAAM,EACN,UAAW,EACX,YAAa,KAAK,IAAI,GAAgB,KAAK,IAAI,EAAW,EAAQ,MAAQ,EAAa,CAAC,CAAC,CAC3F,CACF,CAEA,IAAK,IAAM,QAAU,IAAM,UAAY,EAAO,CAC5C,IAAM,EAAa,KAAK,IAAI,EAAQ,KAAK,IAAI,EAAK,EAAK,EAAQ,OAAS,CAAM,CAAC,EACzE,EAAY,EAAQ,IAAM,EAAQ,OAAS,EAAI,EAErD,MAAO,CACL,IAAK,EACL,OACA,UAAW,EACX,YAAa,KAAK,IAAI,GAAgB,KAAK,IAAI,EAAW,EAAQ,OAAS,EAAa,CAAC,CAAC,CAC5F,CACF,CACF,CAGA,IAAM,EAAQ,EAAQ,OAAS,EACzB,EAAS,EAAQ,KAAO,EAAQ,MAAQ,EAAI,EAAQ,MAAQ,EAC5D,EAAa,KAAK,IAAI,EAAQ,KAAK,IAAI,EAAO,EAAK,EAAQ,OAAS,CAAM,CAAC,EAC3E,EAAc,KAAK,IAAI,EAAQ,KAAK,IAAI,EAAQ,EAAK,EAAQ,MAAQ,CAAM,CAAC,EAC5E,EAAiB,EAAQ,KAAO,EAAQ,MAAQ,EAAI,EAE1D,MAAO,CACL,IAAK,EACL,KAAM,EACN,UAAW,SACX,YAAa,KAAK,IAAI,GAAgB,KAAK,IAAI,EAAgB,EAAQ,MAAQ,EAAa,CAAC,CAAC,CAChG,CACF,CAiBA,IAAa,GAAW,CACtB,UACA,UAAW,EAAqB,SAChC,KAAM,EACN,UACA,eACA,cACkB,CAClB,IAAM,EAAe,IAAmB,IAAA,GAClC,CAAC,EAAkB,IAAA,EAAA,EAAA,UAAgC,EAAK,EACxD,EAAO,EAAe,EAAiB,EAEvC,CAAC,EAAK,IAAA,EAAA,EAAA,UAAoC,IAAI,EAE9C,GAAA,EAAA,EAAA,OAAkB,EAClB,GAAA,EAAA,EAAA,OAAkB,EAClB,GAAA,EAAA,EAAA,QAAiC,IAAI,EACrC,GAAA,EAAA,EAAA,QAAkC,IAAI,EACtC,GAAA,EAAA,EAAA,QAA2C,IAAI,EAE/C,GAAA,EAAA,EAAA,iBAA0B,CAC1B,EACF,IAAU,EAEV,EAAoB,EAAK,EAG3B,IAAe,EAAK,CACtB,EAAG,CAAC,EAAc,EAAS,CAAY,CAAC,EAElC,GAAA,EAAA,EAAA,iBAA2B,CAC3B,EACF,EAAM,GAED,GACH,EAAoB,EAAI,EAG1B,IAAe,EAAI,EAEvB,EAAG,CAAC,EAAM,EAAO,EAAc,CAAY,CAAC,EAGtC,GAAA,EAAA,EAAA,iBAA0B,CAC1B,CAAC,EAAW,SAAW,CAAC,EAAS,SAIrC,EACE,EACE,EAAW,QAAQ,sBAAsB,EACzC,EAAS,QAAQ,sBAAsB,EACvC,CACF,CACF,CACF,EAAG,CAAC,CAAkB,CAAC,GAGvB,EAAA,EAAA,eAAgB,CACd,GAAI,CAAC,EACH,OAKF,IAAM,EAAK,0BAA4B,CACrC,EAAM,EACN,OAAO,iBAAiB,SAAU,EAAO,CAAE,QAAS,GAAM,QAAS,EAAK,CAAC,EACzE,OAAO,iBAAiB,SAAU,EAAO,CAAE,QAAS,EAAK,CAAC,CAC5D,CAAC,EAED,UAAa,CACX,qBAAqB,CAAE,EACvB,OAAO,oBAAoB,SAAU,EAAO,CAAE,QAAS,EAAK,CAAC,EAC7D,OAAO,oBAAoB,SAAU,CAAK,CAC5C,CACF,EAAG,CAAC,EAAM,CAAK,CAAC,GAGhB,EAAA,EAAA,eAAgB,CACV,GACF,EAAkB,QAAU,SAAS,cACrC,0BAA4B,EACZ,EAAS,SAAS,cAC9B,0EACF,GAEU,EAAS,UAAU,MAAM,CACrC,CAAC,IAED,EAAmB,SAAgC,MAAM,EACzD,EAAO,IAAI,EAEf,EAAG,CAAC,CAAI,CAAC,GAGT,EAAA,EAAA,eAAgB,CACd,GAAI,CAAC,EACH,OAGF,IAAM,EAAW,GAAkB,CAE/B,CAAC,EAAW,SAAS,SAAS,EAAE,MAAc,GAC9C,CAAC,EAAS,SAAS,SAAS,EAAE,MAAc,GAE5C,EAAM,CAEV,EAIA,OAFA,SAAS,iBAAiB,YAAa,CAAO,MAEjC,SAAS,oBAAoB,YAAa,CAAO,CAChE,EAAG,CAAC,EAAM,CAAK,CAAC,EAGhB,IAAM,GAAA,EAAA,EAAA,aACH,GAAqC,CAChC,EAAE,MAAQ,WACZ,EAAE,gBAAgB,EAClB,EAAM,EAEV,EACA,CAAC,CAAK,CACR,EAGM,GAAA,EAAA,EAAA,cAAuB,EAAiB,CAC5C,IAAK,EACL,GAAI,EACJ,gBAAiB,SACjB,gBAAiB,EACjB,gBAAiB,EAAO,EAAY,IAAA,GACpC,QAAU,GAAoC,CAC5C,EAAO,EACP,EAAS,MAAM,UAAU,CAAC,CAC5B,CACF,CAAC,EAEK,GACJ,EAAA,EAAA,MAAC,MAAD,CACE,IAAK,EACL,GAAI,EACJ,KAAK,SACL,kBAAiB,EACjB,SAAU,GACV,UAAW,CACT,EAAA,QAAO,MACP,EAAM,EAAA,QAAO,EAAI,WAAa,KAC9B,GAAQ,EAAM,EAAA,QAAO,QAAU,IACjC,EACG,OAAO,OAAO,EACd,KAAK,GAAG,EACX,MACE,EACI,CAAE,IAAK,EAAI,IAAK,KAAM,EAAI,IAAK,EAC/B,CAAE,WAAY,SAAU,cAAe,OAAQ,IAAK,MAAO,KAAM,KAAM,EAE7E,UAAW,WAlBb,EAqBE,EAAA,EAAA,KAAC,MAAD,CACE,UAAW,EAAA,QAAO,MAClB,cAAY,OACZ,MACE,GAAK,cAAgB,IAAA,GAIjB,IAAA,GAHA,EAAI,YAAc,OAAS,EAAI,YAAc,SAC3C,CAAE,KAAM,EAAI,YAAc,EAAY,WAAY,CAAE,EACpD,CAAE,IAAK,EAAI,YAAc,EAAY,UAAW,CAAE,CAG3D,CAAA,EACA,CACE,IAGP,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,EACA,IAAS,OAAO,SAAa,KAAA,EAAA,EAAA,cAA2B,EAAO,SAAS,IAAI,EAAI,EACjF,CAAA,CAAA,CAEN"}
|
|
@@ -47,4 +47,4 @@ export interface PopoverProps {
|
|
|
47
47
|
*
|
|
48
48
|
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Popover.html
|
|
49
49
|
*/
|
|
50
|
-
export declare
|
|
50
|
+
export declare const Popover: ({ content, placement: preferredPlacement, open: controlledOpen, onClose, onOpenChange, children, }: PopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -45,7 +45,7 @@ function m(e, t, n) {
|
|
|
45
45
|
top: a,
|
|
46
46
|
left: i,
|
|
47
47
|
placement: n,
|
|
48
|
-
arrowOffset: Math.max(
|
|
48
|
+
arrowOffset: Math.max(10, Math.min(o, t.width - p - 4))
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
if ((n === "left" || n === "right") && l) {
|
|
@@ -54,7 +54,7 @@ function m(e, t, n) {
|
|
|
54
54
|
top: r,
|
|
55
55
|
left: s,
|
|
56
56
|
placement: n,
|
|
57
|
-
arrowOffset: Math.max(
|
|
57
|
+
arrowOffset: Math.max(10, Math.min(o, t.height - p - 4))
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -63,10 +63,10 @@ function m(e, t, n) {
|
|
|
63
63
|
top: l,
|
|
64
64
|
left: u,
|
|
65
65
|
placement: "bottom",
|
|
66
|
-
arrowOffset: Math.max(
|
|
66
|
+
arrowOffset: Math.max(10, Math.min(m, t.width - p - 4))
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
var h = ({ content: d, placement: f = "bottom", open: h, onClose: g, onOpenChange: _, children: v }) => {
|
|
70
70
|
let y = h !== void 0, [b, x] = o(!1), S = y ? h : b, [C, w] = o(null), T = i(), E = i(), D = a(null), O = a(null), k = a(null), A = n(() => {
|
|
71
71
|
y ? g?.() : x(!1), _?.(!1);
|
|
72
72
|
}, [
|
|
@@ -150,7 +150,7 @@ function h({ content: d, placement: f = "bottom", open: h, onClose: g, onOpenCha
|
|
|
150
150
|
}), d]
|
|
151
151
|
});
|
|
152
152
|
return /* @__PURE__ */ u(c, { children: [P, S && (typeof document < "u" ? s(F, document.body) : F)] });
|
|
153
|
-
}
|
|
153
|
+
};
|
|
154
154
|
//#endregion
|
|
155
155
|
export { h as Popover };
|
|
156
156
|
|