@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,149 +1,153 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/Icon.js";
|
|
2
2
|
import t from "./Dropdown.module.css.js";
|
|
3
|
-
import { useCallback as n, useEffect as r, useId as i,
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { Check as
|
|
3
|
+
import { useCallback as n, useEffect as r, useId as i, useLayoutEffect as a, useRef as o, useState as s } from "react";
|
|
4
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
|
+
import { Check as u, PanDown as d } from "@gnome-ui/icons";
|
|
6
6
|
//#region src/components/Dropdown/Dropdown.tsx
|
|
7
|
-
|
|
8
|
-
let [
|
|
9
|
-
if (!
|
|
10
|
-
let e =
|
|
11
|
-
|
|
12
|
-
}, [
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
let e =
|
|
16
|
-
|
|
7
|
+
var f = ({ options: f, value: p, onChange: m, placeholder: h = "Select an option", disabled: g, className: _, ...v }) => {
|
|
8
|
+
let [y, b] = s(!1), [x, S] = s(-1), [C, w] = s(!1), T = i(), E = i(), D = o(null), O = o(null), k = f.find((e) => e.value === p), A = n(() => {
|
|
9
|
+
if (!D.current) return;
|
|
10
|
+
let e = D.current.getBoundingClientRect(), t = window.innerHeight - e.bottom, n = Math.min(f.length * 48 + 8, 280);
|
|
11
|
+
w(t < n && e.top > n);
|
|
12
|
+
}, [f.length]), j = n(() => {
|
|
13
|
+
if (g) return;
|
|
14
|
+
A(), b(!0);
|
|
15
|
+
let e = f.findIndex((e) => e.value === p && !e.disabled);
|
|
16
|
+
S(e >= 0 ? e : f.findIndex((e) => !e.disabled));
|
|
17
17
|
}, [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
]),
|
|
23
|
-
|
|
24
|
-
}, []),
|
|
25
|
-
e.disabled || (
|
|
26
|
-
}, [
|
|
27
|
-
|
|
28
|
-
!
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
g,
|
|
19
|
+
A,
|
|
20
|
+
f,
|
|
21
|
+
p
|
|
22
|
+
]), M = n(() => {
|
|
23
|
+
b(!1), S(-1), D.current?.focus();
|
|
24
|
+
}, []), N = n((e) => {
|
|
25
|
+
e.disabled || (m?.(e.value), M());
|
|
26
|
+
}, [m, M]);
|
|
27
|
+
a(() => {
|
|
28
|
+
if (!y || !D.current || !O.current) return;
|
|
29
|
+
let e = D.current.getBoundingClientRect(), t = O.current.offsetHeight;
|
|
30
|
+
w(window.innerHeight - e.bottom < t && e.top > t);
|
|
31
|
+
}, [y]), r(() => {
|
|
32
|
+
!y || x < 0 || !O.current || O.current.children[x]?.scrollIntoView({ block: "nearest" });
|
|
33
|
+
}, [x, y]), r(() => {
|
|
34
|
+
if (!y) return;
|
|
31
35
|
let e = (e) => {
|
|
32
|
-
!
|
|
36
|
+
!D.current?.contains(e.target) && !O.current?.contains(e.target) && M();
|
|
33
37
|
};
|
|
34
38
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
35
|
-
}, [
|
|
36
|
-
let
|
|
39
|
+
}, [y, M]);
|
|
40
|
+
let P = n((e) => {
|
|
37
41
|
switch (e.key) {
|
|
38
42
|
case "Enter":
|
|
39
43
|
case " ":
|
|
40
44
|
case "ArrowDown":
|
|
41
|
-
e.preventDefault(),
|
|
45
|
+
e.preventDefault(), j();
|
|
42
46
|
break;
|
|
43
47
|
case "ArrowUp":
|
|
44
|
-
e.preventDefault(),
|
|
48
|
+
e.preventDefault(), A(), b(!0), S(f.reduce((e, t, n) => t.disabled ? e : n, -1));
|
|
45
49
|
break;
|
|
46
50
|
}
|
|
47
51
|
}, [
|
|
52
|
+
j,
|
|
48
53
|
A,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
let t = d.map((e, t) => ({
|
|
54
|
+
f
|
|
55
|
+
]), F = n((e) => {
|
|
56
|
+
let t = f.map((e, t) => ({
|
|
53
57
|
o: e,
|
|
54
58
|
i: t
|
|
55
|
-
})).filter(({ o: e }) => !e.disabled).map(({ i: e }) => e), n = t.indexOf(
|
|
59
|
+
})).filter(({ o: e }) => !e.disabled).map(({ i: e }) => e), n = t.indexOf(x);
|
|
56
60
|
switch (e.key) {
|
|
57
61
|
case "ArrowDown": {
|
|
58
62
|
e.preventDefault();
|
|
59
63
|
let r = t[Math.min(n + 1, t.length - 1)];
|
|
60
|
-
|
|
64
|
+
S(r ?? x);
|
|
61
65
|
break;
|
|
62
66
|
}
|
|
63
67
|
case "ArrowUp": {
|
|
64
68
|
e.preventDefault();
|
|
65
69
|
let r = t[Math.max(n - 1, 0)];
|
|
66
|
-
|
|
70
|
+
S(r ?? x);
|
|
67
71
|
break;
|
|
68
72
|
}
|
|
69
73
|
case "Home":
|
|
70
|
-
e.preventDefault(),
|
|
74
|
+
e.preventDefault(), S(t[0] ?? -1);
|
|
71
75
|
break;
|
|
72
76
|
case "End":
|
|
73
|
-
e.preventDefault(),
|
|
77
|
+
e.preventDefault(), S(t[t.length - 1] ?? -1);
|
|
74
78
|
break;
|
|
75
79
|
case "Enter":
|
|
76
80
|
case " ":
|
|
77
|
-
e.preventDefault(),
|
|
81
|
+
e.preventDefault(), x >= 0 && N(f[x]);
|
|
78
82
|
break;
|
|
79
83
|
case "Escape":
|
|
80
84
|
case "Tab":
|
|
81
|
-
|
|
85
|
+
M();
|
|
82
86
|
break;
|
|
83
87
|
}
|
|
84
88
|
}, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
f,
|
|
90
|
+
x,
|
|
91
|
+
N,
|
|
92
|
+
M
|
|
89
93
|
]);
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
className: [t.wrapper,
|
|
92
|
-
...
|
|
93
|
-
children: [/* @__PURE__ */
|
|
94
|
-
ref:
|
|
95
|
-
id:
|
|
94
|
+
return /* @__PURE__ */ l("div", {
|
|
95
|
+
className: [t.wrapper, _].filter(Boolean).join(" "),
|
|
96
|
+
...v,
|
|
97
|
+
children: [/* @__PURE__ */ l("button", {
|
|
98
|
+
ref: D,
|
|
99
|
+
id: T,
|
|
96
100
|
type: "button",
|
|
97
101
|
role: "combobox",
|
|
98
102
|
"aria-haspopup": "listbox",
|
|
99
|
-
"aria-expanded":
|
|
100
|
-
"aria-controls":
|
|
101
|
-
"aria-activedescendant":
|
|
102
|
-
disabled:
|
|
103
|
-
className: [t.trigger,
|
|
104
|
-
onClick: () =>
|
|
105
|
-
onKeyDown:
|
|
106
|
-
children: [/* @__PURE__ */
|
|
107
|
-
className: [t.triggerLabel,
|
|
108
|
-
children:
|
|
109
|
-
}), /* @__PURE__ */
|
|
110
|
-
icon:
|
|
103
|
+
"aria-expanded": y,
|
|
104
|
+
"aria-controls": E,
|
|
105
|
+
"aria-activedescendant": y && x >= 0 ? `${E}-opt-${x}` : void 0,
|
|
106
|
+
disabled: g,
|
|
107
|
+
className: [t.trigger, y ? t.triggerOpen : null].filter(Boolean).join(" "),
|
|
108
|
+
onClick: () => y ? M() : j(),
|
|
109
|
+
onKeyDown: P,
|
|
110
|
+
children: [/* @__PURE__ */ c("span", {
|
|
111
|
+
className: [t.triggerLabel, k ? null : t.placeholder].filter(Boolean).join(" "),
|
|
112
|
+
children: k?.label ?? h
|
|
113
|
+
}), /* @__PURE__ */ c(e, {
|
|
114
|
+
icon: d,
|
|
111
115
|
size: "md",
|
|
112
116
|
"aria-hidden": !0,
|
|
113
|
-
className: [t.chevron,
|
|
117
|
+
className: [t.chevron, y ? t.chevronOpen : null].filter(Boolean).join(" ")
|
|
114
118
|
})]
|
|
115
|
-
}),
|
|
116
|
-
ref:
|
|
117
|
-
id:
|
|
119
|
+
}), y && /* @__PURE__ */ c("ul", {
|
|
120
|
+
ref: O,
|
|
121
|
+
id: E,
|
|
118
122
|
role: "listbox",
|
|
119
|
-
"aria-labelledby":
|
|
123
|
+
"aria-labelledby": T,
|
|
120
124
|
tabIndex: -1,
|
|
121
|
-
className: [t.list,
|
|
122
|
-
onKeyDown:
|
|
123
|
-
children:
|
|
124
|
-
id: `${
|
|
125
|
+
className: [t.list, C ? t.listUp : t.listDown].filter(Boolean).join(" "),
|
|
126
|
+
onKeyDown: F,
|
|
127
|
+
children: f.map((n, r) => /* @__PURE__ */ l("li", {
|
|
128
|
+
id: `${E}-opt-${r}`,
|
|
125
129
|
role: "option",
|
|
126
|
-
"aria-selected": n.value ===
|
|
130
|
+
"aria-selected": n.value === p,
|
|
127
131
|
"aria-disabled": n.disabled,
|
|
128
132
|
className: [
|
|
129
133
|
t.option,
|
|
130
|
-
n.value ===
|
|
131
|
-
r ===
|
|
134
|
+
n.value === p ? t.optionSelected : null,
|
|
135
|
+
r === x ? t.optionActive : null,
|
|
132
136
|
n.disabled ? t.optionDisabled : null
|
|
133
137
|
].filter(Boolean).join(" "),
|
|
134
|
-
onMouseEnter: () => !n.disabled &&
|
|
135
|
-
onClick: () =>
|
|
136
|
-
children: [/* @__PURE__ */
|
|
138
|
+
onMouseEnter: () => !n.disabled && S(r),
|
|
139
|
+
onClick: () => N(n),
|
|
140
|
+
children: [/* @__PURE__ */ l("span", {
|
|
137
141
|
className: t.optionText,
|
|
138
|
-
children: [/* @__PURE__ */
|
|
142
|
+
children: [/* @__PURE__ */ c("span", {
|
|
139
143
|
className: t.optionLabel,
|
|
140
144
|
children: n.label
|
|
141
|
-
}), n.description && /* @__PURE__ */
|
|
145
|
+
}), n.description && /* @__PURE__ */ c("span", {
|
|
142
146
|
className: t.optionDesc,
|
|
143
147
|
children: n.description
|
|
144
148
|
})]
|
|
145
|
-
}), n.value ===
|
|
146
|
-
icon:
|
|
149
|
+
}), n.value === p && /* @__PURE__ */ c(e, {
|
|
150
|
+
icon: u,
|
|
147
151
|
size: "md",
|
|
148
152
|
"aria-hidden": !0,
|
|
149
153
|
className: t.checkIcon
|
|
@@ -151,8 +155,8 @@ function d({ options: d, value: f, onChange: p, placeholder: m = "Select an opti
|
|
|
151
155
|
}, n.value))
|
|
152
156
|
})]
|
|
153
157
|
});
|
|
154
|
-
}
|
|
158
|
+
};
|
|
155
159
|
//#endregion
|
|
156
|
-
export {
|
|
160
|
+
export { f as Dropdown };
|
|
157
161
|
|
|
158
162
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","names":[],"sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import { Check, PanDown } from '@gnome-ui/icons';\nimport {\n type HTMLAttributes,\n type KeyboardEvent,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\n\nimport { Icon } from '../Icon';\n\nimport styles from './Dropdown.module.css';\n\nexport interface DropdownOption<V extends string = string> {\n /** The value submitted / returned on selection. */\n value: V;\n /** Display label shown in the list and trigger. */\n label: string;\n /** Optional descriptive text shown below the label. */\n description?: string;\n /** Whether the option is selectable. */\n disabled?: boolean;\n}\n\nexport interface DropdownProps<V extends string = string>\n extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /** The list of selectable options. */\n options: DropdownOption<V>[];\n /** The currently selected value. */\n value?: V;\n /** Called when the user selects an option. */\n onChange?: (value: V) => void;\n /** Placeholder shown when no option is selected. */\n placeholder?: string;\n /** Accessible label for the control (used as `aria-label`). */\n 'aria-label'?: string;\n /** Disables the entire control. */\n disabled?: boolean;\n}\n\n/**\n * Expandable option list following the Adwaita combo-row / drop-down pattern.\n *\n * - Fully keyboard-navigable: Space/Enter opens; ↑/↓ navigate; Enter selects; Escape closes.\n * - Uses `role=\"combobox\"` + `role=\"listbox\"` + `role=\"option\"` ARIA pattern.\n * - Closes when clicking outside or pressing Escape.\n * - The list flips above the trigger when there is not enough space below.\n *\n * @see https://developer.gnome.org/hig/patterns/controls/drop-down-lists.html\n */\nexport function Dropdown<V extends string = string>({\n options,\n value,\n onChange,\n placeholder = 'Select an option',\n disabled,\n className,\n ...props\n}: DropdownProps<V>) {\n const [open, setOpen] = useState(false);\n const [activeIndex, setActiveIndex] = useState<number>(-1);\n const [flipUp, setFlipUp] = useState(false);\n\n const triggerId = useId();\n const listboxId = useId();\n const triggerRef = useRef<HTMLButtonElement>(null);\n const listRef = useRef<HTMLUListElement>(null);\n\n const selected = options.find((o) => o.value === value);\n\n // Compute flip direction when opening\n const computeFlip = useCallback(() => {\n if (!triggerRef.current) {\n return;\n }\n\n const rect = triggerRef.current.getBoundingClientRect();\n const spaceBelow = window.innerHeight - rect.bottom;\n const listH = Math.min(options.length * 48 + 8, 280);\n\n setFlipUp(spaceBelow < listH && rect.top > listH);\n }, [options.length]);\n\n const openList = useCallback(() => {\n if (disabled) {\n return;\n }\n\n computeFlip();\n setOpen(true);\n const idx = options.findIndex((o) => o.value === value && !o.disabled);\n\n setActiveIndex(idx >= 0 ? idx : options.findIndex((o) => !o.disabled));\n }, [disabled, computeFlip, options, value]);\n\n const closeList = useCallback(() => {\n setOpen(false);\n setActiveIndex(-1);\n triggerRef.current?.focus();\n }, []);\n\n const selectOption = useCallback(\n (opt: DropdownOption<V>) => {\n if (opt.disabled) {\n return;\n }\n\n onChange?.(opt.value);\n closeList();\n },\n [onChange, closeList],\n );\n\n // Scroll active item into view\n useEffect(() => {\n if (!open || activeIndex < 0 || !listRef.current) {\n return;\n }\n\n const item = listRef.current.children[activeIndex] as HTMLElement | undefined;\n\n item?.scrollIntoView({ block: 'nearest' });\n }, [activeIndex, open]);\n\n // Close on outside click\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 !listRef.current?.contains(e.target as Node)\n ) {\n closeList();\n }\n };\n\n document.addEventListener('mousedown', handler);\n\n return () => document.removeEventListener('mousedown', handler);\n }, [open, closeList]);\n\n // Trigger keyboard handler\n const handleTriggerKeyDown = useCallback(\n (e: KeyboardEvent<HTMLButtonElement>) => {\n switch (e.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n e.preventDefault();\n openList();\n break;\n case 'ArrowUp':\n e.preventDefault();\n computeFlip();\n setOpen(true);\n setActiveIndex(options.reduce((last, o, i) => (!o.disabled ? i : last), -1));\n break;\n }\n },\n [openList, computeFlip, options],\n );\n\n // Listbox keyboard handler\n const handleListKeyDown = useCallback(\n (e: KeyboardEvent<HTMLUListElement>) => {\n const enabledIndexes = options\n .map((o, i) => ({ o, i }))\n .filter(({ o }) => !o.disabled)\n .map(({ i }) => i);\n\n const currentPos = enabledIndexes.indexOf(activeIndex);\n\n switch (e.key) {\n case 'ArrowDown': {\n e.preventDefault();\n const next = enabledIndexes[Math.min(currentPos + 1, enabledIndexes.length - 1)];\n\n setActiveIndex(next ?? activeIndex);\n break;\n }\n case 'ArrowUp': {\n e.preventDefault();\n const prev = enabledIndexes[Math.max(currentPos - 1, 0)];\n\n setActiveIndex(prev ?? activeIndex);\n break;\n }\n case 'Home':\n e.preventDefault();\n setActiveIndex(enabledIndexes[0] ?? -1);\n break;\n case 'End':\n e.preventDefault();\n setActiveIndex(enabledIndexes[enabledIndexes.length - 1] ?? -1);\n break;\n case 'Enter':\n case ' ': {\n e.preventDefault();\n if (activeIndex >= 0) {\n selectOption(options[activeIndex]);\n }\n\n break;\n }\n case 'Escape':\n case 'Tab':\n closeList();\n break;\n }\n },\n [options, activeIndex, selectOption, closeList],\n );\n\n return (\n <div className={[styles.wrapper, className].filter(Boolean).join(' ')} {...props}>\n {/* Trigger button */}\n <button\n ref={triggerRef}\n id={triggerId}\n type=\"button\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-controls={listboxId}\n aria-activedescendant={\n open && activeIndex >= 0 ? `${listboxId}-opt-${activeIndex}` : undefined\n }\n disabled={disabled}\n className={[styles.trigger, open ? styles.triggerOpen : null].filter(Boolean).join(' ')}\n onClick={() => (open ? closeList() : openList())}\n onKeyDown={handleTriggerKeyDown}\n >\n <span\n className={[styles.triggerLabel, !selected ? styles.placeholder : null]\n .filter(Boolean)\n .join(' ')}\n >\n {selected?.label ?? placeholder}\n </span>\n <Icon\n icon={PanDown}\n size=\"md\"\n aria-hidden\n className={[styles.chevron, open ? styles.chevronOpen : null].filter(Boolean).join(' ')}\n />\n </button>\n\n {/* Listbox */}\n {open && (\n <ul\n ref={listRef}\n id={listboxId}\n role=\"listbox\"\n aria-labelledby={triggerId}\n tabIndex={-1}\n className={[styles.list, flipUp ? styles.listUp : styles.listDown]\n .filter(Boolean)\n .join(' ')}\n onKeyDown={handleListKeyDown}\n >\n {options.map((opt, i) => (\n <li\n key={opt.value}\n id={`${listboxId}-opt-${i}`}\n role=\"option\"\n aria-selected={opt.value === value}\n aria-disabled={opt.disabled}\n className={[\n styles.option,\n opt.value === value ? styles.optionSelected : null,\n i === activeIndex ? styles.optionActive : null,\n opt.disabled ? styles.optionDisabled : null,\n ]\n .filter(Boolean)\n .join(' ')}\n onMouseEnter={() => !opt.disabled && setActiveIndex(i)}\n onClick={() => selectOption(opt)}\n >\n <span className={styles.optionText}>\n <span className={styles.optionLabel}>{opt.label}</span>\n {opt.description && <span className={styles.optionDesc}>{opt.description}</span>}\n </span>\n {opt.value === value && (\n <Icon icon={Check} size=\"md\" aria-hidden className={styles.checkIcon} />\n )}\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAoDA,SAAgB,EAAoC,EAClD,YACA,UACA,aACA,iBAAc,oBACd,aACA,cACA,GAAG,KACgB;CACnB,IAAM,CAAC,GAAM,KAAW,EAAS,GAAM,EACjC,CAAC,GAAa,KAAkB,EAAiB,GAAG,EACpD,CAAC,GAAQ,KAAa,EAAS,GAAM,EAErC,IAAY,GAAO,EACnB,IAAY,GAAO,EACnB,IAAa,EAA0B,KAAK,EAC5C,IAAU,EAAyB,KAAK,EAExC,IAAW,EAAQ,MAAM,MAAM,EAAE,UAAU,EAAM,EAGjD,IAAc,QAAkB;AACpC,MAAI,CAAC,EAAW,QACd;EAGF,IAAM,IAAO,EAAW,QAAQ,uBAAuB,EACjD,IAAa,OAAO,cAAc,EAAK,QACvC,IAAQ,KAAK,IAAI,EAAQ,SAAS,KAAK,GAAG,IAAI;AAEpD,IAAU,IAAa,KAAS,EAAK,MAAM,EAAM;IAChD,CAAC,EAAQ,OAAO,CAAC,EAEd,IAAW,QAAkB;AACjC,MAAI,EACF;AAIF,EADA,GAAa,EACb,EAAQ,GAAK;EACb,IAAM,IAAM,EAAQ,WAAW,MAAM,EAAE,UAAU,KAAS,CAAC,EAAE,SAAS;AAEtE,IAAe,KAAO,IAAI,IAAM,EAAQ,WAAW,MAAM,CAAC,EAAE,SAAS,CAAC;IACrE;EAAC;EAAU;EAAa;EAAS;EAAM,CAAC,EAErC,IAAY,QAAkB;AAGlC,EAFA,EAAQ,GAAM,EACd,EAAe,GAAG,EAClB,EAAW,SAAS,OAAO;IAC1B,EAAE,CAAC,EAEA,IAAe,GAClB,MAA2B;AACtB,IAAI,aAIR,IAAW,EAAI,MAAM,EACrB,GAAW;IAEb,CAAC,GAAU,EAAU,CACtB;AAcD,CAXA,QAAgB;AACV,GAAC,KAAQ,IAAc,KAAK,C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KAAK,GAAK,MACjB,kBAAC,MAAD;IAEE,IAAI,GAAG,EAAU,OAAO;IACxB,MAAK;IACL,iBAAe,EAAI,UAAU;IAC7B,iBAAe,EAAI;IACnB,WAAW;KACT,EAAO;KACP,EAAI,UAAU,IAAQ,EAAO,iBAAiB;KAC9C,MAAM,IAAc,EAAO,eAAe;KAC1C,EAAI,WAAW,EAAO,iBAAiB;KACxC,CACE,OAAO,QAAQ,CACf,KAAK,IAAI;IACZ,oBAAoB,CAAC,EAAI,YAAY,EAAe,EAAE;IACtD,eAAe,EAAa,EAAI;cAflC,CAiBE,kBAAC,QAAD;KAAM,WAAW,EAAO;eAAxB,CACE,kBAAC,QAAD;MAAM,WAAW,EAAO;gBAAc,EAAI;MAAa,CAAA,EACtD,EAAI,eAAe,kBAAC,QAAD;MAAM,WAAW,EAAO;gBAAa,EAAI;MAAmB,CAAA,CAC3E;QACN,EAAI,UAAU,KACb,kBAAC,GAAD;KAAM,MAAM;KAAO,MAAK;KAAK,eAAA;KAAY,WAAW,EAAO;KAAa,CAAA,CAEvE;MAvBE,EAAI,MAuBN,CACL;GACC,CAAA,CAEH"}
|
|
1
|
+
{"version":3,"file":"Dropdown.js","names":[],"sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import { Check, PanDown } from '@gnome-ui/icons';\nimport {\n type HTMLAttributes,\n type KeyboardEvent,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { Icon } from '../Icon';\n\nimport styles from './Dropdown.module.css';\n\nexport interface DropdownOption<V extends string = string> {\n /** The value submitted / returned on selection. */\n value: V;\n /** Display label shown in the list and trigger. */\n label: string;\n /** Optional descriptive text shown below the label. */\n description?: string;\n /** Whether the option is selectable. */\n disabled?: boolean;\n}\n\nexport interface DropdownProps<V extends string = string>\n extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /** The list of selectable options. */\n options: DropdownOption<V>[];\n /** The currently selected value. */\n value?: V;\n /** Called when the user selects an option. */\n onChange?: (value: V) => void;\n /** Placeholder shown when no option is selected. */\n placeholder?: string;\n /** Accessible label for the control (used as `aria-label`). */\n 'aria-label'?: string;\n /** Disables the entire control. */\n disabled?: boolean;\n}\n\n/**\n * Expandable option list following the Adwaita combo-row / drop-down pattern.\n *\n * - Fully keyboard-navigable: Space/Enter opens; ↑/↓ navigate; Enter selects; Escape closes.\n * - Uses `role=\"combobox\"` + `role=\"listbox\"` + `role=\"option\"` ARIA pattern.\n * - Closes when clicking outside or pressing Escape.\n * - The list flips above the trigger when there is not enough space below.\n *\n * @see https://developer.gnome.org/hig/patterns/controls/drop-down-lists.html\n */\nexport const Dropdown = <V extends string = string>({\n options,\n value,\n onChange,\n placeholder = 'Select an option',\n disabled,\n className,\n ...props\n}: DropdownProps<V>) => {\n const [open, setOpen] = useState(false);\n const [activeIndex, setActiveIndex] = useState<number>(-1);\n const [flipUp, setFlipUp] = useState(false);\n\n const triggerId = useId();\n const listboxId = useId();\n const triggerRef = useRef<HTMLButtonElement>(null);\n const listRef = useRef<HTMLUListElement>(null);\n\n const selected = options.find((o) => o.value === value);\n\n // Compute flip direction when opening\n const computeFlip = useCallback(() => {\n if (!triggerRef.current) {\n return;\n }\n\n const rect = triggerRef.current.getBoundingClientRect();\n const spaceBelow = window.innerHeight - rect.bottom;\n const listH = Math.min(options.length * 48 + 8, 280);\n\n setFlipUp(spaceBelow < listH && rect.top > listH);\n }, [options.length]);\n\n const openList = useCallback(() => {\n if (disabled) {\n return;\n }\n\n computeFlip();\n setOpen(true);\n const idx = options.findIndex((o) => o.value === value && !o.disabled);\n\n setActiveIndex(idx >= 0 ? idx : options.findIndex((o) => !o.disabled));\n }, [disabled, computeFlip, options, value]);\n\n const closeList = useCallback(() => {\n setOpen(false);\n setActiveIndex(-1);\n triggerRef.current?.focus();\n }, []);\n\n const selectOption = useCallback(\n (opt: DropdownOption<V>) => {\n if (opt.disabled) {\n return;\n }\n\n onChange?.(opt.value);\n closeList();\n },\n [onChange, closeList],\n );\n\n // Refine the flip with the real list height once it has rendered — the\n // pre-open estimate can't account for option descriptions or wrapped labels.\n useLayoutEffect(() => {\n if (!open || !triggerRef.current || !listRef.current) {\n return;\n }\n\n const rect = triggerRef.current.getBoundingClientRect();\n const listH = listRef.current.offsetHeight;\n\n setFlipUp(window.innerHeight - rect.bottom < listH && rect.top > listH);\n }, [open]);\n\n // Scroll active item into view\n useEffect(() => {\n if (!open || activeIndex < 0 || !listRef.current) {\n return;\n }\n\n const item = listRef.current.children[activeIndex] as HTMLElement | undefined;\n\n item?.scrollIntoView({ block: 'nearest' });\n }, [activeIndex, open]);\n\n // Close on outside click\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 !listRef.current?.contains(e.target as Node)\n ) {\n closeList();\n }\n };\n\n document.addEventListener('mousedown', handler);\n\n return () => document.removeEventListener('mousedown', handler);\n }, [open, closeList]);\n\n // Trigger keyboard handler\n const handleTriggerKeyDown = useCallback(\n (e: KeyboardEvent<HTMLButtonElement>) => {\n switch (e.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n e.preventDefault();\n openList();\n break;\n case 'ArrowUp':\n e.preventDefault();\n computeFlip();\n setOpen(true);\n setActiveIndex(options.reduce((last, o, i) => (!o.disabled ? i : last), -1));\n break;\n }\n },\n [openList, computeFlip, options],\n );\n\n // Listbox keyboard handler\n const handleListKeyDown = useCallback(\n (e: KeyboardEvent<HTMLUListElement>) => {\n const enabledIndexes = options\n .map((o, i) => ({ o, i }))\n .filter(({ o }) => !o.disabled)\n .map(({ i }) => i);\n\n const currentPos = enabledIndexes.indexOf(activeIndex);\n\n switch (e.key) {\n case 'ArrowDown': {\n e.preventDefault();\n const next = enabledIndexes[Math.min(currentPos + 1, enabledIndexes.length - 1)];\n\n setActiveIndex(next ?? activeIndex);\n break;\n }\n case 'ArrowUp': {\n e.preventDefault();\n const prev = enabledIndexes[Math.max(currentPos - 1, 0)];\n\n setActiveIndex(prev ?? activeIndex);\n break;\n }\n case 'Home':\n e.preventDefault();\n setActiveIndex(enabledIndexes[0] ?? -1);\n break;\n case 'End':\n e.preventDefault();\n setActiveIndex(enabledIndexes[enabledIndexes.length - 1] ?? -1);\n break;\n case 'Enter':\n case ' ': {\n e.preventDefault();\n if (activeIndex >= 0) {\n selectOption(options[activeIndex]);\n }\n\n break;\n }\n case 'Escape':\n case 'Tab':\n closeList();\n break;\n }\n },\n [options, activeIndex, selectOption, closeList],\n );\n\n return (\n <div className={[styles.wrapper, className].filter(Boolean).join(' ')} {...props}>\n {/* Trigger button */}\n <button\n ref={triggerRef}\n id={triggerId}\n type=\"button\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-controls={listboxId}\n aria-activedescendant={\n open && activeIndex >= 0 ? `${listboxId}-opt-${activeIndex}` : undefined\n }\n disabled={disabled}\n className={[styles.trigger, open ? styles.triggerOpen : null].filter(Boolean).join(' ')}\n onClick={() => (open ? closeList() : openList())}\n onKeyDown={handleTriggerKeyDown}\n >\n <span\n className={[styles.triggerLabel, !selected ? styles.placeholder : null]\n .filter(Boolean)\n .join(' ')}\n >\n {selected?.label ?? placeholder}\n </span>\n <Icon\n icon={PanDown}\n size=\"md\"\n aria-hidden\n className={[styles.chevron, open ? styles.chevronOpen : null].filter(Boolean).join(' ')}\n />\n </button>\n\n {/* Listbox */}\n {open && (\n <ul\n ref={listRef}\n id={listboxId}\n role=\"listbox\"\n aria-labelledby={triggerId}\n tabIndex={-1}\n className={[styles.list, flipUp ? styles.listUp : styles.listDown]\n .filter(Boolean)\n .join(' ')}\n onKeyDown={handleListKeyDown}\n >\n {options.map((opt, i) => (\n <li\n key={opt.value}\n id={`${listboxId}-opt-${i}`}\n role=\"option\"\n aria-selected={opt.value === value}\n aria-disabled={opt.disabled}\n className={[\n styles.option,\n opt.value === value ? styles.optionSelected : null,\n i === activeIndex ? styles.optionActive : null,\n opt.disabled ? styles.optionDisabled : null,\n ]\n .filter(Boolean)\n .join(' ')}\n onMouseEnter={() => !opt.disabled && setActiveIndex(i)}\n onClick={() => selectOption(opt)}\n >\n <span className={styles.optionText}>\n <span className={styles.optionLabel}>{opt.label}</span>\n {opt.description && <span className={styles.optionDesc}>{opt.description}</span>}\n </span>\n {opt.value === value && (\n <Icon icon={Check} size=\"md\" aria-hidden className={styles.checkIcon} />\n )}\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;AAqDA,IAAa,KAAuC,EAClD,YACA,UACA,aACA,iBAAc,oBACd,aACA,cACA,GAAG,QACmB;CACtB,IAAM,CAAC,GAAM,KAAW,EAAS,EAAK,GAChC,CAAC,GAAa,KAAkB,EAAiB,EAAE,GACnD,CAAC,GAAQ,KAAa,EAAS,EAAK,GAEpC,IAAY,EAAM,GAClB,IAAY,EAAM,GAClB,IAAa,EAA0B,IAAI,GAC3C,IAAU,EAAyB,IAAI,GAEvC,IAAW,EAAQ,MAAM,MAAM,EAAE,UAAU,CAAK,GAGhD,IAAc,QAAkB;EACpC,IAAI,CAAC,EAAW,SACd;EAGF,IAAM,IAAO,EAAW,QAAQ,sBAAsB,GAChD,IAAa,OAAO,cAAc,EAAK,QACvC,IAAQ,KAAK,IAAI,EAAQ,SAAS,KAAK,GAAG,GAAG;EAEnD,EAAU,IAAa,KAAS,EAAK,MAAM,CAAK;CAClD,GAAG,CAAC,EAAQ,MAAM,CAAC,GAEb,IAAW,QAAkB;EACjC,IAAI,GACF;EAIF,AADA,EAAY,GACZ,EAAQ,EAAI;EACZ,IAAM,IAAM,EAAQ,WAAW,MAAM,EAAE,UAAU,KAAS,CAAC,EAAE,QAAQ;EAErE,EAAe,KAAO,IAAI,IAAM,EAAQ,WAAW,MAAM,CAAC,EAAE,QAAQ,CAAC;CACvE,GAAG;EAAC;EAAU;EAAa;EAAS;CAAK,CAAC,GAEpC,IAAY,QAAkB;EAGlC,AAFA,EAAQ,EAAK,GACb,EAAe,EAAE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rapper:`_wrapper_15m1u_3`,trigger:`_trigger_15m1u_11`,triggerOpen:`_triggerOpen_15m1u_63`,triggerLabel:`_triggerLabel_15m1u_73`,placeholder:`_placeholder_15m1u_81`,chevron:`_chevron_15m1u_87`,chevronOpen:`_chevronOpen_15m1u_94`,list:`_list_15m1u_100`,"list-in":`_list-in_15m1u_1`,listDown:`_listDown_15m1u_137`,listUp:`_listUp_15m1u_141`,"list-in-up":`_list-in-up_15m1u_1`,option:`_option_15m1u_161`,optionActive:`_optionActive_15m1u_178`,optionSelected:`_optionSelected_15m1u_182`,optionDisabled:`_optionDisabled_15m1u_186`,optionText:`_optionText_15m1u_194`,optionLabel:`_optionLabel_15m1u_202`,optionDesc:`_optionDesc_15m1u_208`,checkIcon:`_checkIcon_15m1u_218`};exports.default=e;
|
|
2
2
|
//# sourceMappingURL=Dropdown.module.css.cjs.map
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
list: s,
|
|
1
|
+
var e = {
|
|
2
|
+
wrapper: "_wrapper_15m1u_3",
|
|
3
|
+
trigger: "_trigger_15m1u_11",
|
|
4
|
+
triggerOpen: "_triggerOpen_15m1u_63",
|
|
5
|
+
triggerLabel: "_triggerLabel_15m1u_73",
|
|
6
|
+
placeholder: "_placeholder_15m1u_81",
|
|
7
|
+
chevron: "_chevron_15m1u_87",
|
|
8
|
+
chevronOpen: "_chevronOpen_15m1u_94",
|
|
9
|
+
list: "_list_15m1u_100",
|
|
11
10
|
"list-in": "_list-in_15m1u_1",
|
|
12
|
-
listDown:
|
|
13
|
-
listUp:
|
|
11
|
+
listDown: "_listDown_15m1u_137",
|
|
12
|
+
listUp: "_listUp_15m1u_141",
|
|
14
13
|
"list-in-up": "_list-in-up_15m1u_1",
|
|
15
|
-
option:
|
|
16
|
-
optionActive:
|
|
17
|
-
optionSelected:
|
|
18
|
-
optionDisabled:
|
|
19
|
-
optionText:
|
|
20
|
-
optionLabel:
|
|
21
|
-
optionDesc:
|
|
22
|
-
checkIcon:
|
|
14
|
+
option: "_option_15m1u_161",
|
|
15
|
+
optionActive: "_optionActive_15m1u_178",
|
|
16
|
+
optionSelected: "_optionSelected_15m1u_182",
|
|
17
|
+
optionDisabled: "_optionDisabled_15m1u_186",
|
|
18
|
+
optionText: "_optionText_15m1u_194",
|
|
19
|
+
optionLabel: "_optionLabel_15m1u_202",
|
|
20
|
+
optionDesc: "_optionDesc_15m1u_208",
|
|
21
|
+
checkIcon: "_checkIcon_15m1u_218"
|
|
23
22
|
};
|
|
24
23
|
//#endregion
|
|
25
|
-
export {
|
|
24
|
+
export { e as default };
|
|
26
25
|
|
|
27
26
|
//# sourceMappingURL=Dropdown.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./Dropdown/Dropdown.cjs");exports.Dropdown=e.Dropdown;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("./EntryRow.module.css.cjs");let t=require("react"),n=require("react/jsx-runtime");var r=({title:r,value:i,defaultValue:a=``,onValueChange:o,leading:s,trailing:c,disabled:l,className:u,id:d,onChange:f,...p})=>{let m=(0,t.useId)(),h=d??m,g=i!==void 0,[_,v]=(0,t.useState)(String(a)),y=g?String(i):_,[b,x]=(0,t.useState)(!1),S=(0,t.useRef)(null),C=b||y.length>0;return(0,n.jsxs)(`div`,{className:[e.default.row,b?e.default.focused:null,l?e.default.disabled:null,u].filter(Boolean).join(` `),onClick:()=>S.current?.focus(),children:[s&&(0,n.jsx)(`span`,{className:e.default.leading,children:s}),(0,n.jsxs)(`span`,{className:e.default.fieldWrap,children:[(0,n.jsx)(`label`,{htmlFor:h,className:[e.default.label,C?e.default.labelFloated:null].filter(Boolean).join(` `),children:r}),(0,n.jsx)(`input`,{ref:S,id:h,className:[e.default.input,C?e.default.inputFloated:null].filter(Boolean).join(` `),value:y,disabled:l,onFocus:()=>x(!0),onBlur:()=>x(!1),onChange:e=>{g||v(e.target.value),o?.(e.target.value),f?.(e)},...p})]}),c&&(0,n.jsx)(`span`,{className:e.default.trailing,children:c})]})};exports.EntryRow=r;
|
|
2
2
|
//# sourceMappingURL=EntryRow.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntryRow.cjs","names":[],"sources":["../../../src/components/EntryRow/EntryRow.tsx"],"sourcesContent":["import {\n type ChangeEvent,\n type InputHTMLAttributes,\n type ReactNode,\n useId,\n useRef,\n useState,\n} from 'react';\n\nimport styles from './EntryRow.module.css';\n\nexport interface EntryRowProps extends InputHTMLAttributes<HTMLInputElement> {\n /**\n * Acts as a floating label: shown small above the input when the field has\n * content or focus, shown as a placeholder when empty and unfocused.\n */\n title: string;\n /** Called when the input value changes. */\n onValueChange?: (value: string) => void;\n /** Icon or widget placed at the leading edge. */\n leading?: ReactNode;\n /** Icon or widget placed at the trailing edge (e.g. a clear button, copy button). */\n trailing?: ReactNode;\n}\n\n/**\n * Row with an inline text entry field.\n *\n * Mirrors `AdwEntryRow` — the `title` floats up as a small label when the\n * field is focused or has content, acting as a placeholder when empty and\n * unfocused. Use inside a `BoxedList` for inline settings that require text input.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.EntryRow.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"EntryRow.cjs","names":[],"sources":["../../../src/components/EntryRow/EntryRow.tsx"],"sourcesContent":["import {\n type ChangeEvent,\n type InputHTMLAttributes,\n type ReactNode,\n useId,\n useRef,\n useState,\n} from 'react';\n\nimport styles from './EntryRow.module.css';\n\nexport interface EntryRowProps extends InputHTMLAttributes<HTMLInputElement> {\n /**\n * Acts as a floating label: shown small above the input when the field has\n * content or focus, shown as a placeholder when empty and unfocused.\n */\n title: string;\n /** Called when the input value changes. */\n onValueChange?: (value: string) => void;\n /** Icon or widget placed at the leading edge. */\n leading?: ReactNode;\n /** Icon or widget placed at the trailing edge (e.g. a clear button, copy button). */\n trailing?: ReactNode;\n}\n\n/**\n * Row with an inline text entry field.\n *\n * Mirrors `AdwEntryRow` — the `title` floats up as a small label when the\n * field is focused or has content, acting as a placeholder when empty and\n * unfocused. Use inside a `BoxedList` for inline settings that require text input.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.EntryRow.html\n */\nexport const EntryRow = ({\n title,\n value: controlledValue,\n defaultValue = '',\n onValueChange,\n leading,\n trailing,\n disabled,\n className,\n id: externalId,\n onChange,\n ...props\n}: EntryRowProps) => {\n const generatedId = useId();\n const inputId = externalId ?? generatedId;\n\n const isControlled = controlledValue !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(String(defaultValue));\n const inputValue = isControlled ? String(controlledValue) : uncontrolledValue;\n\n const [focused, setFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n const floated = focused || inputValue.length > 0;\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n if (!isControlled) {\n setUncontrolledValue(e.target.value);\n }\n\n onValueChange?.(e.target.value);\n onChange?.(e);\n };\n\n return (\n <div\n className={[\n styles.row,\n focused ? styles.focused : null,\n disabled ? styles.disabled : null,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={() => inputRef.current?.focus()}\n >\n {leading && <span className={styles.leading}>{leading}</span>}\n\n <span className={styles.fieldWrap}>\n <label\n htmlFor={inputId}\n className={[styles.label, floated ? styles.labelFloated : null].filter(Boolean).join(' ')}\n >\n {title}\n </label>\n <input\n ref={inputRef}\n id={inputId}\n className={[styles.input, floated ? styles.inputFloated : null].filter(Boolean).join(' ')}\n value={inputValue}\n disabled={disabled}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n onChange={handleChange}\n {...props}\n />\n </span>\n\n {trailing && <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AK,EAGrC,IAAgB,EAAE,OAAO,KAAK,EAC9B,IAAW,CAAC,CACd,EAgCQ,GAAI,CACL,CAAA,CACG,IAEL,IAAY,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,kBAAW,CAAe,CAAA,CAC5D,GAET"}
|
|
@@ -21,4 +21,4 @@ export interface EntryRowProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
21
21
|
*
|
|
22
22
|
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.EntryRow.html
|
|
23
23
|
*/
|
|
24
|
-
export declare
|
|
24
|
+
export declare const EntryRow: ({ title, value: controlledValue, defaultValue, onValueChange, leading, trailing, disabled, className, id: externalId, onChange, ...props }: EntryRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import e from "./EntryRow.module.css.js";
|
|
|
2
2
|
import { useId as t, useRef as n, useState as r } from "react";
|
|
3
3
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/EntryRow/EntryRow.tsx
|
|
5
|
-
|
|
5
|
+
var o = ({ title: o, value: s, defaultValue: c = "", onValueChange: l, leading: u, trailing: d, disabled: f, className: p, id: m, onChange: h, ...g }) => {
|
|
6
6
|
let _ = t(), v = m ?? _, y = s !== void 0, [b, x] = r(String(c)), S = y ? String(s) : b, [C, w] = r(!1), T = n(null), E = C || S.length > 0;
|
|
7
7
|
return /* @__PURE__ */ a("div", {
|
|
8
8
|
className: [
|
|
@@ -43,7 +43,7 @@ function o({ title: o, value: s, defaultValue: c = "", onValueChange: l, leading
|
|
|
43
43
|
})
|
|
44
44
|
]
|
|
45
45
|
});
|
|
46
|
-
}
|
|
46
|
+
};
|
|
47
47
|
//#endregion
|
|
48
48
|
export { o as EntryRow };
|
|
49
49
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntryRow.js","names":[],"sources":["../../../src/components/EntryRow/EntryRow.tsx"],"sourcesContent":["import {\n type ChangeEvent,\n type InputHTMLAttributes,\n type ReactNode,\n useId,\n useRef,\n useState,\n} from 'react';\n\nimport styles from './EntryRow.module.css';\n\nexport interface EntryRowProps extends InputHTMLAttributes<HTMLInputElement> {\n /**\n * Acts as a floating label: shown small above the input when the field has\n * content or focus, shown as a placeholder when empty and unfocused.\n */\n title: string;\n /** Called when the input value changes. */\n onValueChange?: (value: string) => void;\n /** Icon or widget placed at the leading edge. */\n leading?: ReactNode;\n /** Icon or widget placed at the trailing edge (e.g. a clear button, copy button). */\n trailing?: ReactNode;\n}\n\n/**\n * Row with an inline text entry field.\n *\n * Mirrors `AdwEntryRow` — the `title` floats up as a small label when the\n * field is focused or has content, acting as a placeholder when empty and\n * unfocused. Use inside a `BoxedList` for inline settings that require text input.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.EntryRow.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"EntryRow.js","names":[],"sources":["../../../src/components/EntryRow/EntryRow.tsx"],"sourcesContent":["import {\n type ChangeEvent,\n type InputHTMLAttributes,\n type ReactNode,\n useId,\n useRef,\n useState,\n} from 'react';\n\nimport styles from './EntryRow.module.css';\n\nexport interface EntryRowProps extends InputHTMLAttributes<HTMLInputElement> {\n /**\n * Acts as a floating label: shown small above the input when the field has\n * content or focus, shown as a placeholder when empty and unfocused.\n */\n title: string;\n /** Called when the input value changes. */\n onValueChange?: (value: string) => void;\n /** Icon or widget placed at the leading edge. */\n leading?: ReactNode;\n /** Icon or widget placed at the trailing edge (e.g. a clear button, copy button). */\n trailing?: ReactNode;\n}\n\n/**\n * Row with an inline text entry field.\n *\n * Mirrors `AdwEntryRow` — the `title` floats up as a small label when the\n * field is focused or has content, acting as a placeholder when empty and\n * unfocused. Use inside a `BoxedList` for inline settings that require text input.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.EntryRow.html\n */\nexport const EntryRow = ({\n title,\n value: controlledValue,\n defaultValue = '',\n onValueChange,\n leading,\n trailing,\n disabled,\n className,\n id: externalId,\n onChange,\n ...props\n}: EntryRowProps) => {\n const generatedId = useId();\n const inputId = externalId ?? generatedId;\n\n const isControlled = controlledValue !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(String(defaultValue));\n const inputValue = isControlled ? String(controlledValue) : uncontrolledValue;\n\n const [focused, setFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n const floated = focused || inputValue.length > 0;\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n if (!isControlled) {\n setUncontrolledValue(e.target.value);\n }\n\n onValueChange?.(e.target.value);\n onChange?.(e);\n };\n\n return (\n <div\n className={[\n styles.row,\n focused ? styles.focused : null,\n disabled ? styles.disabled : null,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={() => inputRef.current?.focus()}\n >\n {leading && <span className={styles.leading}>{leading}</span>}\n\n <span className={styles.fieldWrap}>\n <label\n htmlFor={inputId}\n className={[styles.label, floated ? styles.labelFloated : null].filter(Boolean).join(' ')}\n >\n {title}\n </label>\n <input\n ref={inputRef}\n id={inputId}\n className={[styles.input, floated ? styles.inputFloated : null].filter(Boolean).join(' ')}\n value={inputValue}\n disabled={disabled}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n onChange={handleChange}\n {...props}\n />\n </span>\n\n {trailing && <span className={styles.trailing}>{trailing}</span>}\n </div>\n );\n};\n"],"mappings":";;;;AAkCA,IAAa,KAAY,EACvB,UACA,OAAO,GACP,kBAAe,IACf,kBACA,YACA,aACA,aACA,cACA,IAAI,GACJ,aACA,GAAG,QACgB;CACnB,IAAM,IAAc,EAAM,GACpB,IAAU,KAAc,GAExB,IAAe,MAAoB,KAAA,GACnC,CAAC,GAAmB,KAAwB,EAAS,OAAO,CAAY,CAAC,GACzE,IAAa,IAAe,OAAO,CAAe,IAAI,GAEtD,CAAC,GAAS,KAAc,EAAS,EAAK,GACtC,IAAW,EAAyB,IAAI,GAExC,IAAU,KAAW,EAAW,SAAS;CAW/C,OACE,kBAAC,OAAD;EACE,WAAW;GACT,EAAO;GACP,IAAU,EAAO,UAAU;GAC3B,IAAW,EAAO,WAAW;GAC7B;EACF,EACG,OAAO,OAAO,EACd,KAAK,GAAG;EACX,eAAe,EAAS,SAAS,MAAM;YATzC;GAWG,KAAW,kBAAC,QAAD;IAAM,WAAW,EAAO;cAAU;GAAc,CAAA;GAE5D,kBAAC,QAAD;IAAM,WAAW,EAAO;cAAxB,CACE,kBAAC,SAAD;KACE,SAAS;KACT,WAAW,CAAC,EAAO,OAAO,IAAU,EAAO,eAAe,IAAI,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;eAEvF;IACI,CAAA,GACP,kBAAC,SAAD;KACE,KAAK;KACL,IAAI;KACJ,WAAW,CAAC,EAAO,OAAO,IAAU,EAAO,eAAe,IAAI,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;KACxF,OAAO;KACG;KACV,eAAe,EAAW,EAAI;KAC9B,cAAc,EAAW,EAAK;KAC9B,WAtCc,MAAqC;MAMzD,AALK,KACH,EAAqB,EAAE,OAAO,KAAK,GAGrC,IAAgB,EAAE,OAAO,KAAK,GAC9B,IAAW,CAAC;KACd;KAgCQ,GAAI;IACL,CAAA,CACG;;GAEL,KAAY,kBAAC,QAAD;IAAM,WAAW,EAAO;cAAW;GAAe,CAAA;EAC5D;;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("./EntryRow/EntryRow.cjs");exports.EntryRow=e.EntryRow;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("../Separator/Separator.cjs"),t=require("./ExpanderRow.module.css.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=({title:i,subtitle:a,leading:o,trailing:s,children:c,expanded:l,defaultExpanded:u=!1,onExpandedChange:d,className:f,...p})=>{let m=l!==void 0,[h,g]=(0,n.useState)(u),_=m?l:h,v=(0,n.useId)(),y=(0,n.useId)(),b=()=>{let e=!_;m||g(e),d?.(e)},x=n.Children.toArray(c).filter(Boolean);return(0,r.jsxs)(`div`,{className:[t.default.expanderRow,_?t.default.expanded:null,f].filter(Boolean).join(` `),...p,children:[(0,r.jsxs)(`button`,{id:y,className:t.default.header,"aria-expanded":_,"aria-controls":v,onClick:b,children:[o&&(0,r.jsx)(`span`,{className:t.default.leading,children:o}),(0,r.jsxs)(`span`,{className:t.default.content,children:[(0,r.jsx)(`span`,{className:t.default.title,children:i}),a&&(0,r.jsx)(`span`,{className:t.default.subtitle,children:a})]}),s&&(0,r.jsx)(`span`,{className:t.default.trailing,children:s}),(0,r.jsx)(`span`,{className:[t.default.chevronWrap,_?t.default.chevronOpen:null].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,r.jsx)(`svg`,{className:t.default.chevron,width:`16`,height:`16`,viewBox:`0 0 16 16`,focusable:`false`,children:(0,r.jsx)(`path`,{d:`M4 6l4 4 4-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]}),(0,r.jsx)(`div`,{id:v,role:`region`,"aria-labelledby":y,className:t.default.panel,children:(0,r.jsx)(`div`,{className:t.default.panelInner,children:x.map((n,i)=>(0,r.jsxs)(`div`,{className:t.default.childItem,children:[(0,r.jsx)(e.Separator,{"aria-hidden":`true`}),n]},i))})})]})};exports.ExpanderRow=i;
|
|
2
2
|
//# sourceMappingURL=ExpanderRow.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpanderRow.cjs","names":[],"sources":["../../../src/components/ExpanderRow/ExpanderRow.tsx"],"sourcesContent":["import { Children, type HTMLAttributes, type ReactNode, useId, useState } from 'react';\n\nimport { Separator } from '../Separator';\n\nimport styles from './ExpanderRow.module.css';\n\nexport interface ExpanderRowProps extends HTMLAttributes<HTMLDivElement> {\n /** Primary label. */\n title: string;\n /** Secondary line below the title. */\n subtitle?: string;\n /** Icon or image placed at the leading edge of the header row. */\n leading?: ReactNode;\n /**\n * Widget placed at the trailing edge of the header row, before the chevron\n * (e.g. a value label or a Switch). Stop event propagation inside it so the\n * row's toggle isn't triggered.\n */\n trailing?: ReactNode;\n /**\n * Nested rows revealed when expanded. Use `ActionRow`, `ButtonRow`, or any\n * row-shaped element — separators are inserted automatically.\n */\n children?: ReactNode;\n /** Controlled expanded state. */\n expanded?: boolean;\n /** Initial expanded state when uncontrolled. Defaults to `false`. */\n defaultExpanded?: boolean;\n /** Called when the expanded state changes. */\n onExpandedChange?: (expanded: boolean) => void;\n}\n\n/**\n * Collapsible `ActionRow` that reveals nested rows on activation.\n *\n * Mirrors `AdwExpanderRow` — the header row toggles a reveal animation exposing\n * child rows. Supports both controlled and uncontrolled expand state.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ExpanderRow.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"ExpanderRow.cjs","names":[],"sources":["../../../src/components/ExpanderRow/ExpanderRow.tsx"],"sourcesContent":["import { Children, type HTMLAttributes, type ReactNode, useId, useState } from 'react';\n\nimport { Separator } from '../Separator';\n\nimport styles from './ExpanderRow.module.css';\n\nexport interface ExpanderRowProps extends HTMLAttributes<HTMLDivElement> {\n /** Primary label. */\n title: string;\n /** Secondary line below the title. */\n subtitle?: string;\n /** Icon or image placed at the leading edge of the header row. */\n leading?: ReactNode;\n /**\n * Widget placed at the trailing edge of the header row, before the chevron\n * (e.g. a value label or a Switch). Stop event propagation inside it so the\n * row's toggle isn't triggered.\n */\n trailing?: ReactNode;\n /**\n * Nested rows revealed when expanded. Use `ActionRow`, `ButtonRow`, or any\n * row-shaped element — separators are inserted automatically.\n */\n children?: ReactNode;\n /** Controlled expanded state. */\n expanded?: boolean;\n /** Initial expanded state when uncontrolled. Defaults to `false`. */\n defaultExpanded?: boolean;\n /** Called when the expanded state changes. */\n onExpandedChange?: (expanded: boolean) => void;\n}\n\n/**\n * Collapsible `ActionRow` that reveals nested rows on activation.\n *\n * Mirrors `AdwExpanderRow` — the header row toggles a reveal animation exposing\n * child rows. Supports both controlled and uncontrolled expand state.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ExpanderRow.html\n */\nexport const ExpanderRow = ({\n title,\n subtitle,\n leading,\n trailing,\n children,\n expanded: controlledExpanded,\n defaultExpanded = false,\n onExpandedChange,\n className,\n ...props\n}: ExpanderRowProps) => {\n const isControlled = controlledExpanded !== undefined;\n const [uncontrolledExpanded, setUncontrolledExpanded] = useState(defaultExpanded);\n const expanded = isControlled ? controlledExpanded : uncontrolledExpanded;\n\n const panelId = useId();\n const headerId = useId();\n\n const toggle = () => {\n const next = !expanded;\n\n if (!isControlled) {\n setUncontrolledExpanded(next);\n }\n\n onExpandedChange?.(next);\n };\n\n const childItems = Children.toArray(children).filter(Boolean);\n\n return (\n <div\n className={[styles.expanderRow, expanded ? styles.expanded : null, className]\n .filter(Boolean)\n .join(' ')}\n {...props}\n >\n {/* ─── Header (toggle button) ─────────────────────────────────────── */}\n <button\n id={headerId}\n className={styles.header}\n aria-expanded={expanded}\n aria-controls={panelId}\n onClick={toggle}\n >\n {leading && <span className={styles.leading}>{leading}</span>}\n\n <span className={styles.content}>\n <span className={styles.title}>{title}</span>\n {subtitle && <span className={styles.subtitle}>{subtitle}</span>}\n </span>\n\n {trailing && <span className={styles.trailing}>{trailing}</span>}\n\n <span\n className={[styles.chevronWrap, expanded ? styles.chevronOpen : null]\n .filter(Boolean)\n .join(' ')}\n aria-hidden=\"true\"\n >\n <svg\n className={styles.chevron}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n focusable=\"false\"\n >\n <path\n d=\"M4 6l4 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 </button>\n\n {/* ─── Reveal panel ───────────────────────────────────────────────── */}\n <div id={panelId} role=\"region\" aria-labelledby={headerId} className={styles.panel}>\n <div className={styles.panelInner}>\n {childItems.map((child, i) => (\n <div key={i} className={styles.childItem}>\n <Separator aria-hidden=\"true\" />\n {child}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":"8IAwCA,IAAa,GAAe,CAC1B,QACA,WACA,UACA,WACA,WACA,SAAU,EACV,kBAAkB,GAClB,mBACA,YACA,GAAG,KACmB,CACtB,IAAM,EAAe,IAAuB,IAAA,GACtC,CAAC,EAAsB,IAAA,EAAA,EAAA,UAAoC,CAAe,EAC1E,EAAW,EAAe,EAAqB,EAE/C,GAAA,EAAA,EAAA,OAAgB,EAChB,GAAA,EAAA,EAAA,OAAiB,EAEjB,MAAe,CACnB,IAAM,EAAO,CAAC,EAET,GACH,EAAwB,CAAI,EAG9B,IAAmB,CAAI,CACzB,EAEM,EAAa,EAAA,SAAS,QAAQ,CAAQ,EAAE,OAAO,OAAO,EAE5D,OACE,EAAA,EAAA,MAAC,MAAD,CACE,UAAW,CAAC,EAAA,QAAO,YAAa,EAAW,EAAA,QAAO,SAAW,KAAM,CAAS,EACzE,OAAO,OAAO,EACd,KAAK,GAAG,EACX,GAAI,WAJN,EAOE,EAAA,EAAA,MAAC,SAAD,CACE,GAAI,EACJ,UAAW,EAAA,QAAO,OAClB,gBAAe,EACf,gBAAe,EACf,QAAS,WALX,CAOG,IAAW,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,iBAAU,CAAc,CAAA,GAE5D,EAAA,EAAA,MAAC,OAAD,CAAM,UAAW,EAAA,QAAO,iBAAxB,EACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,eAAQ,CAAY,CAAA,EAC3C,IAAY,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,kBAAW,CAAe,CAAA,CAC3D,IAEL,IAAY,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,kBAAW,CAAe,CAAA,GAE/D,EAAA,EAAA,KAAC,OAAD,CACE,UAAW,CAAC,EAAA,QAAO,YAAa,EAAW,EAAA,QAAO,YAAc,IAAI,EACjE,OAAO,OAAO,EACd,KAAK,GAAG,EACX,cAAY,iBAEZ,EAAA,EAAA,KAAC,MAAD,CACE,UAAW,EAAA,QAAO,QAClB,MAAM,KACN,OAAO,KACP,QAAQ,YACR,UAAU,kBAEV,EAAA,EAAA,KAAC,OAAD,CACE,EAAE,eACF,KAAK,OACL,OAAO,eACP,YAAY,MACZ,cAAc,QACd,eAAe,OAChB,CAAA,CACE,CAAA,CACD,CAAA,CACA,KAGR,EAAA,EAAA,KAAC,MAAD,CAAK,GAAI,EAAS,KAAK,SAAS,kBAAiB,EAAU,UAAW,EAAA,QAAO,gBAC3E,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,EAAA,QAAO,oBACpB,EAAW,KAAK,EAAO,KACtB,EAAA,EAAA,MAAC,MAAD,CAAa,UAAW,EAAA,QAAO,mBAA/B,EACE,EAAA,EAAA,KAAC,EAAA,UAAD,CAAW,cAAY,MAAQ,CAAA,EAC9B,CACE,GAHK,CAGL,CACN,CACE,CAAA,CACF,CAAA,CACF,GAET"}
|
|
@@ -32,4 +32,4 @@ export interface ExpanderRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
32
32
|
*
|
|
33
33
|
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ExpanderRow.html
|
|
34
34
|
*/
|
|
35
|
-
export declare
|
|
35
|
+
export declare const ExpanderRow: ({ title, subtitle, leading, trailing, children, expanded: controlledExpanded, defaultExpanded, onExpandedChange, className, ...props }: ExpanderRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import t from "./ExpanderRow.module.css.js";
|
|
|
3
3
|
import { Children as n, useId as r, useState as i } from "react";
|
|
4
4
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/ExpanderRow/ExpanderRow.tsx
|
|
6
|
-
|
|
6
|
+
var s = ({ title: s, subtitle: c, leading: l, trailing: u, children: d, expanded: f, defaultExpanded: p = !1, onExpandedChange: m, className: h, ...g }) => {
|
|
7
7
|
let _ = f !== void 0, [v, y] = i(p), b = _ ? f : v, x = r(), S = r(), C = () => {
|
|
8
8
|
let e = !b;
|
|
9
9
|
_ || y(e), m?.(e);
|
|
@@ -74,7 +74,7 @@ function s({ title: s, subtitle: c, leading: l, trailing: u, children: d, expand
|
|
|
74
74
|
})
|
|
75
75
|
})]
|
|
76
76
|
});
|
|
77
|
-
}
|
|
77
|
+
};
|
|
78
78
|
//#endregion
|
|
79
79
|
export { s as ExpanderRow };
|
|
80
80
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpanderRow.js","names":[],"sources":["../../../src/components/ExpanderRow/ExpanderRow.tsx"],"sourcesContent":["import { Children, type HTMLAttributes, type ReactNode, useId, useState } from 'react';\n\nimport { Separator } from '../Separator';\n\nimport styles from './ExpanderRow.module.css';\n\nexport interface ExpanderRowProps extends HTMLAttributes<HTMLDivElement> {\n /** Primary label. */\n title: string;\n /** Secondary line below the title. */\n subtitle?: string;\n /** Icon or image placed at the leading edge of the header row. */\n leading?: ReactNode;\n /**\n * Widget placed at the trailing edge of the header row, before the chevron\n * (e.g. a value label or a Switch). Stop event propagation inside it so the\n * row's toggle isn't triggered.\n */\n trailing?: ReactNode;\n /**\n * Nested rows revealed when expanded. Use `ActionRow`, `ButtonRow`, or any\n * row-shaped element — separators are inserted automatically.\n */\n children?: ReactNode;\n /** Controlled expanded state. */\n expanded?: boolean;\n /** Initial expanded state when uncontrolled. Defaults to `false`. */\n defaultExpanded?: boolean;\n /** Called when the expanded state changes. */\n onExpandedChange?: (expanded: boolean) => void;\n}\n\n/**\n * Collapsible `ActionRow` that reveals nested rows on activation.\n *\n * Mirrors `AdwExpanderRow` — the header row toggles a reveal animation exposing\n * child rows. Supports both controlled and uncontrolled expand state.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ExpanderRow.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"ExpanderRow.js","names":[],"sources":["../../../src/components/ExpanderRow/ExpanderRow.tsx"],"sourcesContent":["import { Children, type HTMLAttributes, type ReactNode, useId, useState } from 'react';\n\nimport { Separator } from '../Separator';\n\nimport styles from './ExpanderRow.module.css';\n\nexport interface ExpanderRowProps extends HTMLAttributes<HTMLDivElement> {\n /** Primary label. */\n title: string;\n /** Secondary line below the title. */\n subtitle?: string;\n /** Icon or image placed at the leading edge of the header row. */\n leading?: ReactNode;\n /**\n * Widget placed at the trailing edge of the header row, before the chevron\n * (e.g. a value label or a Switch). Stop event propagation inside it so the\n * row's toggle isn't triggered.\n */\n trailing?: ReactNode;\n /**\n * Nested rows revealed when expanded. Use `ActionRow`, `ButtonRow`, or any\n * row-shaped element — separators are inserted automatically.\n */\n children?: ReactNode;\n /** Controlled expanded state. */\n expanded?: boolean;\n /** Initial expanded state when uncontrolled. Defaults to `false`. */\n defaultExpanded?: boolean;\n /** Called when the expanded state changes. */\n onExpandedChange?: (expanded: boolean) => void;\n}\n\n/**\n * Collapsible `ActionRow` that reveals nested rows on activation.\n *\n * Mirrors `AdwExpanderRow` — the header row toggles a reveal animation exposing\n * child rows. Supports both controlled and uncontrolled expand state.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ExpanderRow.html\n */\nexport const ExpanderRow = ({\n title,\n subtitle,\n leading,\n trailing,\n children,\n expanded: controlledExpanded,\n defaultExpanded = false,\n onExpandedChange,\n className,\n ...props\n}: ExpanderRowProps) => {\n const isControlled = controlledExpanded !== undefined;\n const [uncontrolledExpanded, setUncontrolledExpanded] = useState(defaultExpanded);\n const expanded = isControlled ? controlledExpanded : uncontrolledExpanded;\n\n const panelId = useId();\n const headerId = useId();\n\n const toggle = () => {\n const next = !expanded;\n\n if (!isControlled) {\n setUncontrolledExpanded(next);\n }\n\n onExpandedChange?.(next);\n };\n\n const childItems = Children.toArray(children).filter(Boolean);\n\n return (\n <div\n className={[styles.expanderRow, expanded ? styles.expanded : null, className]\n .filter(Boolean)\n .join(' ')}\n {...props}\n >\n {/* ─── Header (toggle button) ─────────────────────────────────────── */}\n <button\n id={headerId}\n className={styles.header}\n aria-expanded={expanded}\n aria-controls={panelId}\n onClick={toggle}\n >\n {leading && <span className={styles.leading}>{leading}</span>}\n\n <span className={styles.content}>\n <span className={styles.title}>{title}</span>\n {subtitle && <span className={styles.subtitle}>{subtitle}</span>}\n </span>\n\n {trailing && <span className={styles.trailing}>{trailing}</span>}\n\n <span\n className={[styles.chevronWrap, expanded ? styles.chevronOpen : null]\n .filter(Boolean)\n .join(' ')}\n aria-hidden=\"true\"\n >\n <svg\n className={styles.chevron}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n focusable=\"false\"\n >\n <path\n d=\"M4 6l4 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 </button>\n\n {/* ─── Reveal panel ───────────────────────────────────────────────── */}\n <div id={panelId} role=\"region\" aria-labelledby={headerId} className={styles.panel}>\n <div className={styles.panelInner}>\n {childItems.map((child, i) => (\n <div key={i} className={styles.childItem}>\n <Separator aria-hidden=\"true\" />\n {child}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;AAwCA,IAAa,KAAe,EAC1B,UACA,aACA,YACA,aACA,aACA,UAAU,GACV,qBAAkB,IAClB,qBACA,cACA,GAAG,QACmB;CACtB,IAAM,IAAe,MAAuB,KAAA,GACtC,CAAC,GAAsB,KAA2B,EAAS,CAAe,GAC1E,IAAW,IAAe,IAAqB,GAE/C,IAAU,EAAM,GAChB,IAAW,EAAM,GAEjB,UAAe;EACnB,IAAM,IAAO,CAAC;EAMd,AAJK,KACH,EAAwB,CAAI,GAG9B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
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./ExpanderRow/ExpanderRow.cjs");exports.ExpanderRow=e.ExpanderRow;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("./Footer.module.css.cjs");let t=require("react/jsx-runtime");var n=({start:n,end:r,children:i,flat:a=!1,className:o,...s})=>(0,t.jsxs)(`footer`,{className:[e.default.footer,a?e.default.flat:null,o].filter(Boolean).join(` `),...s,children:[(0,t.jsx)(`div`,{className:e.default.slot,children:n}),i!=null&&(0,t.jsx)(`div`,{className:e.default.center,children:i}),(0,t.jsx)(`div`,{className:[e.default.slot,e.default.slotEnd].filter(Boolean).join(` `),children:r})]});exports.Footer=n;
|
|
2
2
|
//# sourceMappingURL=Footer.cjs.map
|