@gnome-ui/react 1.45.1 → 1.45.2
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 +2 -3
- 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 +2 -3
- 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 +2 -2
- 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.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 +2 -2
- 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 +2 -2
- 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 +2 -3
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Frame.js","names":[],"sources":["../../../src/components/Frame/Frame.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\n\nimport styles from './Frame.module.css';\n\nexport interface FrameProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\n/**\n * Simple bordered surface with border-radius but no background fill.\n *\n * Use to visually delimit a region without adding the elevated appearance\n * of a `Card`. Mirrors `GtkFrame` default styling and the libadwaita\n * `.frame` style class.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/style-classes.html#frame-style-class\n */\nexport
|
|
1
|
+
{"version":3,"file":"Frame.js","names":[],"sources":["../../../src/components/Frame/Frame.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\n\nimport styles from './Frame.module.css';\n\nexport interface FrameProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\n/**\n * Simple bordered surface with border-radius but no background fill.\n *\n * Use to visually delimit a region without adding the elevated appearance\n * of a `Card`. Mirrors `GtkFrame` default styling and the libadwaita\n * `.frame` style class.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/style-classes.html#frame-style-class\n */\nexport const Frame = ({ children, className, ...props }: FrameProps) => {\n return (\n <div className={[styles.frame, className].filter(Boolean).join(' ')} {...props}>\n {children}\n </div>\n );\n};\n"],"mappings":";;;AAiBA,IAAa,KAAS,EAAE,aAAU,cAAW,GAAG,QAE5C,kBAAC,OAAD;CAAK,WAAW,CAAC,EAAO,OAAO,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;CAAG,GAAI;CACtE;AACE,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("./Frame/Frame.cjs");exports.Frame=e.Frame;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react");var t=(0,e.createContext)({locale:void 0,dir:`ltr`,numberFormat:void 0,dateTimeFormat:void 0,colorScheme:`system`,resolvedColorScheme:`light`,accentColor:`blue`});function n(){return(0,e.useContext)(t).locale}function r(){return(0,e.useContext)(t).dir}function i(n){let{locale:r,numberFormat:i}=(0,e.useContext)(t);return(0,e.useMemo)(()=>new Intl.NumberFormat(r,{...i,...n}),[r,i,n])}function a(n){let{locale:r,dateTimeFormat:i}=(0,e.useContext)(t);return(0,e.useMemo)(()=>new Intl.DateTimeFormat(r,{...i,...n}),[r,i,n])}function o(){return(0,e.useContext)(t).colorScheme}function s(){return(0,e.useContext)(t).resolvedColorScheme}function c(){return(0,e.useContext)(t).accentColor}exports.GnomeContext=t,exports.useAccentColor=c,exports.useColorScheme=o,exports.useDateTimeFormatter=a,exports.useDir=r,exports.useLocale=n,exports.useNumberFormatter=i,exports.useResolvedColorScheme=s;
|
|
2
2
|
//# sourceMappingURL=GnomeContext.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GnomeContext.cjs","names":[],"sources":["../../../src/components/GnomeProvider/GnomeContext.ts"],"sourcesContent":["import { createContext, useContext, useMemo } from 'react';\n\nexport type GnomeDir = 'ltr' | 'rtl';\nexport type GnomeColorScheme = 'light' | 'dark' | 'system';\nexport type GnomeNamedAccentColor =\n | 'blue'\n | 'green'\n | 'yellow'\n | 'orange'\n | 'red'\n | 'purple'\n | 'brown';\nexport type GnomeAccentColor = GnomeNamedAccentColor | (string & {});\n\nexport interface GnomeContextValue {\n locale: string | undefined;\n dir: GnomeDir;\n numberFormat: Intl.NumberFormatOptions | undefined;\n dateTimeFormat: Intl.DateTimeFormatOptions | undefined;\n colorScheme: GnomeColorScheme;\n resolvedColorScheme: 'light' | 'dark';\n accentColor: GnomeAccentColor;\n}\n\nexport const GnomeContext = createContext<GnomeContextValue>({\n locale: undefined,\n dir: 'ltr',\n numberFormat: undefined,\n dateTimeFormat: undefined,\n colorScheme: 'system',\n resolvedColorScheme: 'light',\n accentColor: 'blue',\n});\n\n/** Returns the locale set by the nearest `GnomeProvider`, or `undefined` to use the browser locale. */\nexport function useLocale(): string | undefined {\n return useContext(GnomeContext).locale;\n}\n\n/** Returns the text direction set by the nearest `GnomeProvider`. Defaults to `\"ltr\"`. */\nexport function useDir(): GnomeDir {\n return useContext(GnomeContext).dir;\n}\n\n/** Returns an `Intl.NumberFormat` configured from `GnomeProvider` defaults plus local overrides. */\nexport function useNumberFormatter(options?: Intl.NumberFormatOptions): Intl.NumberFormat {\n const { locale, numberFormat } = useContext(GnomeContext);\n\n return useMemo(\n () => new Intl.NumberFormat(locale, { ...numberFormat, ...options }),\n [locale, numberFormat, options],\n );\n}\n\n/** Returns an `Intl.DateTimeFormat` configured from `GnomeProvider` defaults plus local overrides. */\nexport function useDateTimeFormatter(options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n const { locale, dateTimeFormat } = useContext(GnomeContext);\n\n return useMemo(\n () => new Intl.DateTimeFormat(locale, { ...dateTimeFormat, ...options }),\n [locale, dateTimeFormat, options],\n );\n}\n\n/** Returns the color scheme preference set by the nearest `GnomeProvider`. Defaults to `\"system\"`. */\nexport function useColorScheme(): GnomeColorScheme {\n return useContext(GnomeContext).colorScheme;\n}\n\n/** Returns the resolved color scheme (`\"light\"` or `\"dark\"`), accounting for the system preference when `colorScheme` is `\"system\"`. */\nexport function useResolvedColorScheme(): 'light' | 'dark' {\n return useContext(GnomeContext).resolvedColorScheme;\n}\n\n/** Returns the accent color set by the nearest `GnomeProvider`. Defaults to `\"blue\"`. */\nexport function useAccentColor(): GnomeAccentColor {\n return useContext(GnomeContext).accentColor;\n}\n"],"mappings":"0FAwBA,IAAa,GAAA,EAAA,EAAA,eAAgD,CAC3D,OAAQ,IAAA,GACR,IAAK,MACL,aAAc,IAAA,GACd,eAAgB,IAAA,GAChB,YAAa,SACb,oBAAqB,QACrB,YAAa,
|
|
1
|
+
{"version":3,"file":"GnomeContext.cjs","names":[],"sources":["../../../src/components/GnomeProvider/GnomeContext.ts"],"sourcesContent":["import { createContext, useContext, useMemo } from 'react';\n\nexport type GnomeDir = 'ltr' | 'rtl';\nexport type GnomeColorScheme = 'light' | 'dark' | 'system';\nexport type GnomeNamedAccentColor =\n | 'blue'\n | 'green'\n | 'yellow'\n | 'orange'\n | 'red'\n | 'purple'\n | 'brown';\nexport type GnomeAccentColor = GnomeNamedAccentColor | (string & {});\n\nexport interface GnomeContextValue {\n locale: string | undefined;\n dir: GnomeDir;\n numberFormat: Intl.NumberFormatOptions | undefined;\n dateTimeFormat: Intl.DateTimeFormatOptions | undefined;\n colorScheme: GnomeColorScheme;\n resolvedColorScheme: 'light' | 'dark';\n accentColor: GnomeAccentColor;\n}\n\nexport const GnomeContext = createContext<GnomeContextValue>({\n locale: undefined,\n dir: 'ltr',\n numberFormat: undefined,\n dateTimeFormat: undefined,\n colorScheme: 'system',\n resolvedColorScheme: 'light',\n accentColor: 'blue',\n});\n\n/** Returns the locale set by the nearest `GnomeProvider`, or `undefined` to use the browser locale. */\nexport function useLocale(): string | undefined {\n return useContext(GnomeContext).locale;\n}\n\n/** Returns the text direction set by the nearest `GnomeProvider`. Defaults to `\"ltr\"`. */\nexport function useDir(): GnomeDir {\n return useContext(GnomeContext).dir;\n}\n\n/** Returns an `Intl.NumberFormat` configured from `GnomeProvider` defaults plus local overrides. */\nexport function useNumberFormatter(options?: Intl.NumberFormatOptions): Intl.NumberFormat {\n const { locale, numberFormat } = useContext(GnomeContext);\n\n return useMemo(\n () => new Intl.NumberFormat(locale, { ...numberFormat, ...options }),\n [locale, numberFormat, options],\n );\n}\n\n/** Returns an `Intl.DateTimeFormat` configured from `GnomeProvider` defaults plus local overrides. */\nexport function useDateTimeFormatter(options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n const { locale, dateTimeFormat } = useContext(GnomeContext);\n\n return useMemo(\n () => new Intl.DateTimeFormat(locale, { ...dateTimeFormat, ...options }),\n [locale, dateTimeFormat, options],\n );\n}\n\n/** Returns the color scheme preference set by the nearest `GnomeProvider`. Defaults to `\"system\"`. */\nexport function useColorScheme(): GnomeColorScheme {\n return useContext(GnomeContext).colorScheme;\n}\n\n/** Returns the resolved color scheme (`\"light\"` or `\"dark\"`), accounting for the system preference when `colorScheme` is `\"system\"`. */\nexport function useResolvedColorScheme(): 'light' | 'dark' {\n return useContext(GnomeContext).resolvedColorScheme;\n}\n\n/** Returns the accent color set by the nearest `GnomeProvider`. Defaults to `\"blue\"`. */\nexport function useAccentColor(): GnomeAccentColor {\n return useContext(GnomeContext).accentColor;\n}\n"],"mappings":"0FAwBA,IAAa,GAAA,EAAA,EAAA,eAAgD,CAC3D,OAAQ,IAAA,GACR,IAAK,MACL,aAAc,IAAA,GACd,eAAgB,IAAA,GAChB,YAAa,SACb,oBAAqB,QACrB,YAAa,MACf,CAAC,EAGD,SAAgB,GAAgC,CAC9C,OAAA,EAAA,EAAA,YAAkB,CAAY,EAAE,MAClC,CAGA,SAAgB,GAAmB,CACjC,OAAA,EAAA,EAAA,YAAkB,CAAY,EAAE,GAClC,CAGA,SAAgB,EAAmB,EAAuD,CACxF,GAAM,CAAE,SAAQ,iBAAA,EAAA,EAAA,YAA4B,CAAY,EAExD,OAAA,EAAA,EAAA,aACQ,IAAI,KAAK,aAAa,EAAQ,CAAE,GAAG,EAAc,GAAG,CAAQ,CAAC,EACnE,CAAC,EAAQ,EAAc,CAAO,CAChC,CACF,CAGA,SAAgB,EAAqB,EAA2D,CAC9F,GAAM,CAAE,SAAQ,mBAAA,EAAA,EAAA,YAA8B,CAAY,EAE1D,OAAA,EAAA,EAAA,aACQ,IAAI,KAAK,eAAe,EAAQ,CAAE,GAAG,EAAgB,GAAG,CAAQ,CAAC,EACvE,CAAC,EAAQ,EAAgB,CAAO,CAClC,CACF,CAGA,SAAgB,GAAmC,CACjD,OAAA,EAAA,EAAA,YAAkB,CAAY,EAAE,WAClC,CAGA,SAAgB,GAA2C,CACzD,OAAA,EAAA,EAAA,YAAkB,CAAY,EAAE,mBAClC,CAGA,SAAgB,GAAmC,CACjD,OAAA,EAAA,EAAA,YAAkB,CAAY,EAAE,WAClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GnomeContext.js","names":[],"sources":["../../../src/components/GnomeProvider/GnomeContext.ts"],"sourcesContent":["import { createContext, useContext, useMemo } from 'react';\n\nexport type GnomeDir = 'ltr' | 'rtl';\nexport type GnomeColorScheme = 'light' | 'dark' | 'system';\nexport type GnomeNamedAccentColor =\n | 'blue'\n | 'green'\n | 'yellow'\n | 'orange'\n | 'red'\n | 'purple'\n | 'brown';\nexport type GnomeAccentColor = GnomeNamedAccentColor | (string & {});\n\nexport interface GnomeContextValue {\n locale: string | undefined;\n dir: GnomeDir;\n numberFormat: Intl.NumberFormatOptions | undefined;\n dateTimeFormat: Intl.DateTimeFormatOptions | undefined;\n colorScheme: GnomeColorScheme;\n resolvedColorScheme: 'light' | 'dark';\n accentColor: GnomeAccentColor;\n}\n\nexport const GnomeContext = createContext<GnomeContextValue>({\n locale: undefined,\n dir: 'ltr',\n numberFormat: undefined,\n dateTimeFormat: undefined,\n colorScheme: 'system',\n resolvedColorScheme: 'light',\n accentColor: 'blue',\n});\n\n/** Returns the locale set by the nearest `GnomeProvider`, or `undefined` to use the browser locale. */\nexport function useLocale(): string | undefined {\n return useContext(GnomeContext).locale;\n}\n\n/** Returns the text direction set by the nearest `GnomeProvider`. Defaults to `\"ltr\"`. */\nexport function useDir(): GnomeDir {\n return useContext(GnomeContext).dir;\n}\n\n/** Returns an `Intl.NumberFormat` configured from `GnomeProvider` defaults plus local overrides. */\nexport function useNumberFormatter(options?: Intl.NumberFormatOptions): Intl.NumberFormat {\n const { locale, numberFormat } = useContext(GnomeContext);\n\n return useMemo(\n () => new Intl.NumberFormat(locale, { ...numberFormat, ...options }),\n [locale, numberFormat, options],\n );\n}\n\n/** Returns an `Intl.DateTimeFormat` configured from `GnomeProvider` defaults plus local overrides. */\nexport function useDateTimeFormatter(options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n const { locale, dateTimeFormat } = useContext(GnomeContext);\n\n return useMemo(\n () => new Intl.DateTimeFormat(locale, { ...dateTimeFormat, ...options }),\n [locale, dateTimeFormat, options],\n );\n}\n\n/** Returns the color scheme preference set by the nearest `GnomeProvider`. Defaults to `\"system\"`. */\nexport function useColorScheme(): GnomeColorScheme {\n return useContext(GnomeContext).colorScheme;\n}\n\n/** Returns the resolved color scheme (`\"light\"` or `\"dark\"`), accounting for the system preference when `colorScheme` is `\"system\"`. */\nexport function useResolvedColorScheme(): 'light' | 'dark' {\n return useContext(GnomeContext).resolvedColorScheme;\n}\n\n/** Returns the accent color set by the nearest `GnomeProvider`. Defaults to `\"blue\"`. */\nexport function useAccentColor(): GnomeAccentColor {\n return useContext(GnomeContext).accentColor;\n}\n"],"mappings":";;AAwBA,IAAa,IAAe,EAAiC;CAC3D,QAAQ,KAAA;CACR,KAAK;CACL,cAAc,KAAA;CACd,gBAAgB,KAAA;CAChB,aAAa;CACb,qBAAqB;CACrB,aAAa;
|
|
1
|
+
{"version":3,"file":"GnomeContext.js","names":[],"sources":["../../../src/components/GnomeProvider/GnomeContext.ts"],"sourcesContent":["import { createContext, useContext, useMemo } from 'react';\n\nexport type GnomeDir = 'ltr' | 'rtl';\nexport type GnomeColorScheme = 'light' | 'dark' | 'system';\nexport type GnomeNamedAccentColor =\n | 'blue'\n | 'green'\n | 'yellow'\n | 'orange'\n | 'red'\n | 'purple'\n | 'brown';\nexport type GnomeAccentColor = GnomeNamedAccentColor | (string & {});\n\nexport interface GnomeContextValue {\n locale: string | undefined;\n dir: GnomeDir;\n numberFormat: Intl.NumberFormatOptions | undefined;\n dateTimeFormat: Intl.DateTimeFormatOptions | undefined;\n colorScheme: GnomeColorScheme;\n resolvedColorScheme: 'light' | 'dark';\n accentColor: GnomeAccentColor;\n}\n\nexport const GnomeContext = createContext<GnomeContextValue>({\n locale: undefined,\n dir: 'ltr',\n numberFormat: undefined,\n dateTimeFormat: undefined,\n colorScheme: 'system',\n resolvedColorScheme: 'light',\n accentColor: 'blue',\n});\n\n/** Returns the locale set by the nearest `GnomeProvider`, or `undefined` to use the browser locale. */\nexport function useLocale(): string | undefined {\n return useContext(GnomeContext).locale;\n}\n\n/** Returns the text direction set by the nearest `GnomeProvider`. Defaults to `\"ltr\"`. */\nexport function useDir(): GnomeDir {\n return useContext(GnomeContext).dir;\n}\n\n/** Returns an `Intl.NumberFormat` configured from `GnomeProvider` defaults plus local overrides. */\nexport function useNumberFormatter(options?: Intl.NumberFormatOptions): Intl.NumberFormat {\n const { locale, numberFormat } = useContext(GnomeContext);\n\n return useMemo(\n () => new Intl.NumberFormat(locale, { ...numberFormat, ...options }),\n [locale, numberFormat, options],\n );\n}\n\n/** Returns an `Intl.DateTimeFormat` configured from `GnomeProvider` defaults plus local overrides. */\nexport function useDateTimeFormatter(options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n const { locale, dateTimeFormat } = useContext(GnomeContext);\n\n return useMemo(\n () => new Intl.DateTimeFormat(locale, { ...dateTimeFormat, ...options }),\n [locale, dateTimeFormat, options],\n );\n}\n\n/** Returns the color scheme preference set by the nearest `GnomeProvider`. Defaults to `\"system\"`. */\nexport function useColorScheme(): GnomeColorScheme {\n return useContext(GnomeContext).colorScheme;\n}\n\n/** Returns the resolved color scheme (`\"light\"` or `\"dark\"`), accounting for the system preference when `colorScheme` is `\"system\"`. */\nexport function useResolvedColorScheme(): 'light' | 'dark' {\n return useContext(GnomeContext).resolvedColorScheme;\n}\n\n/** Returns the accent color set by the nearest `GnomeProvider`. Defaults to `\"blue\"`. */\nexport function useAccentColor(): GnomeAccentColor {\n return useContext(GnomeContext).accentColor;\n}\n"],"mappings":";;AAwBA,IAAa,IAAe,EAAiC;CAC3D,QAAQ,KAAA;CACR,KAAK;CACL,cAAc,KAAA;CACd,gBAAgB,KAAA;CAChB,aAAa;CACb,qBAAqB;CACrB,aAAa;AACf,CAAC;AAGD,SAAgB,IAAgC;CAC9C,OAAO,EAAW,CAAY,EAAE;AAClC;AAGA,SAAgB,IAAmB;CACjC,OAAO,EAAW,CAAY,EAAE;AAClC;AAGA,SAAgB,EAAmB,GAAuD;CACxF,IAAM,EAAE,WAAQ,oBAAiB,EAAW,CAAY;CAExD,OAAO,QACC,IAAI,KAAK,aAAa,GAAQ;EAAE,GAAG;EAAc,GAAG;CAAQ,CAAC,GACnE;EAAC;EAAQ;EAAc;CAAO,CAChC;AACF;AAGA,SAAgB,EAAqB,GAA2D;CAC9F,IAAM,EAAE,WAAQ,sBAAmB,EAAW,CAAY;CAE1D,OAAO,QACC,IAAI,KAAK,eAAe,GAAQ;EAAE,GAAG;EAAgB,GAAG;CAAQ,CAAC,GACvE;EAAC;EAAQ;EAAgB;CAAO,CAClC;AACF;AAGA,SAAgB,IAAmC;CACjD,OAAO,EAAW,CAAY,EAAE;AAClC;AAGA,SAAgB,IAA2C;CACzD,OAAO,EAAW,CAAY,EAAE;AAClC;AAGA,SAAgB,IAAmC;CACjD,OAAO,EAAW,CAAY,EAAE;AAClC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./GnomeContext.cjs");let t=require("react"),n=require("react/jsx-runtime");var r=new Set([`blue`,`green`,`yellow`,`orange`,`red`,`purple`,`brown`]);function i(){return typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}var a=({locale:a,dir:o=`ltr`,numberFormat:s,dateTimeFormat:c,colorScheme:l=`system`,accentColor:u=`blue`,children:d})=>{let[,f]=(0,t.useReducer)(e=>e+1,0);(0,t.useEffect)(()=>{if(l!==`system`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);return e.addEventListener(`change`,f),()=>e.removeEventListener(`change`,f)},[l]),(0,t.useEffect)(()=>{let e=document.documentElement;l===`system`?e.removeAttribute(`data-theme`):e.setAttribute(`data-theme`,l)},[l]);let p=l===`system`?i()?`dark`:`light`:l;(0,t.useEffect)(()=>{let e=document.documentElement;if(u===`blue`){e.style.removeProperty(`--gnome-accent-color`),e.style.removeProperty(`--gnome-accent-bg-color`);return}if(r.has(u)){let t=p===`dark`?`2`:`3`;e.style.setProperty(`--gnome-accent-color`,`var(--gnome-${u}-${t})`),e.style.setProperty(`--gnome-accent-bg-color`,`var(--gnome-${u}-3)`)}else e.style.setProperty(`--gnome-accent-color`,u),e.style.setProperty(`--gnome-accent-bg-color`,u)},[u,p]);let m=(0,t.useMemo)(()=>({locale:a,dir:o,numberFormat:s,dateTimeFormat:c,colorScheme:l,resolvedColorScheme:p,accentColor:u}),[a,o,s,c,l,p,u]);return(0,n.jsx)(e.GnomeContext.Provider,{value:m,children:d})};exports.GnomeProvider=a;
|
|
2
2
|
//# sourceMappingURL=GnomeProvider.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GnomeProvider.cjs","names":[],"sources":["../../../src/components/GnomeProvider/GnomeProvider.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useMemo, useReducer } from 'react';\n\nimport {\n type GnomeAccentColor,\n type GnomeColorScheme,\n GnomeContext,\n type GnomeDir,\n} from './GnomeContext';\n\nconst NAMED_ACCENT_COLORS = new Set<string>([\n 'blue',\n 'green',\n 'yellow',\n 'orange',\n 'red',\n 'purple',\n 'brown',\n]);\n\nexport interface GnomeProviderProps {\n /**\n * BCP 47 locale tag (e.g. `\"es-ES\"`, `\"de-DE\"`).\n * When omitted, components fall back to the browser locale.\n */\n locale?: string;\n /** Text direction. Defaults to `\"ltr\"`. */\n dir?: GnomeDir;\n /**\n * Global defaults for number formatting.\n *\n * Use `{ notation: \"compact\", compactDisplay: \"short\" }` for compact\n * values such as `1K`; omit it or set `{ notation: \"standard\" }` for\n * full values such as `1,000`.\n */\n numberFormat?: Intl.NumberFormatOptions;\n /** Global defaults for date/time formatting. */\n dateTimeFormat?: Intl.DateTimeFormatOptions;\n /**\n * Color scheme preference. When set to `\"system\"` (default), the OS\n * preference is respected via `prefers-color-scheme`. When set to\n * `\"light\"` or `\"dark\"`, the `data-theme` attribute is applied to\n * `document.documentElement` to force that theme.\n */\n colorScheme?: GnomeColorScheme;\n /**\n * Accent color. Accepts a named GNOME palette color (`\"blue\"`, `\"green\"`,\n * `\"yellow\"`, `\"orange\"`, `\"red\"`, `\"purple\"`, `\"brown\"`) or any CSS color\n * string (e.g. `\"#ff0000\"`). Named colors are theme-aware and use the\n * correct shade for light/dark mode automatically. Defaults to `\"blue\"`.\n */\n accentColor?: GnomeAccentColor;\n children: ReactNode;\n}\n\nfunction getSystemIsDark(): boolean {\n return typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches;\n}\n\n/** Provides locale, text direction, color scheme, and accent color to all descendant gnome-ui components. */\nexport
|
|
1
|
+
{"version":3,"file":"GnomeProvider.cjs","names":[],"sources":["../../../src/components/GnomeProvider/GnomeProvider.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useMemo, useReducer } from 'react';\n\nimport {\n type GnomeAccentColor,\n type GnomeColorScheme,\n GnomeContext,\n type GnomeDir,\n} from './GnomeContext';\n\nconst NAMED_ACCENT_COLORS = new Set<string>([\n 'blue',\n 'green',\n 'yellow',\n 'orange',\n 'red',\n 'purple',\n 'brown',\n]);\n\nexport interface GnomeProviderProps {\n /**\n * BCP 47 locale tag (e.g. `\"es-ES\"`, `\"de-DE\"`).\n * When omitted, components fall back to the browser locale.\n */\n locale?: string;\n /** Text direction. Defaults to `\"ltr\"`. */\n dir?: GnomeDir;\n /**\n * Global defaults for number formatting.\n *\n * Use `{ notation: \"compact\", compactDisplay: \"short\" }` for compact\n * values such as `1K`; omit it or set `{ notation: \"standard\" }` for\n * full values such as `1,000`.\n */\n numberFormat?: Intl.NumberFormatOptions;\n /** Global defaults for date/time formatting. */\n dateTimeFormat?: Intl.DateTimeFormatOptions;\n /**\n * Color scheme preference. When set to `\"system\"` (default), the OS\n * preference is respected via `prefers-color-scheme`. When set to\n * `\"light\"` or `\"dark\"`, the `data-theme` attribute is applied to\n * `document.documentElement` to force that theme.\n */\n colorScheme?: GnomeColorScheme;\n /**\n * Accent color. Accepts a named GNOME palette color (`\"blue\"`, `\"green\"`,\n * `\"yellow\"`, `\"orange\"`, `\"red\"`, `\"purple\"`, `\"brown\"`) or any CSS color\n * string (e.g. `\"#ff0000\"`). Named colors are theme-aware and use the\n * correct shade for light/dark mode automatically. Defaults to `\"blue\"`.\n */\n accentColor?: GnomeAccentColor;\n children: ReactNode;\n}\n\nfunction getSystemIsDark(): boolean {\n return typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches;\n}\n\n/** Provides locale, text direction, color scheme, and accent color to all descendant gnome-ui components. */\nexport const GnomeProvider = ({\n locale,\n dir = 'ltr',\n numberFormat,\n dateTimeFormat,\n colorScheme = 'system',\n accentColor = 'blue',\n children,\n}: GnomeProviderProps) => {\n const [, forceUpdate] = useReducer((n: number) => n + 1, 0);\n\n useEffect(() => {\n if (colorScheme !== 'system') {\n return;\n }\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n\n mq.addEventListener('change', forceUpdate);\n\n return () => mq.removeEventListener('change', forceUpdate);\n }, [colorScheme]);\n\n useEffect(() => {\n const root = document.documentElement;\n\n if (colorScheme === 'system') {\n root.removeAttribute('data-theme');\n } else {\n root.setAttribute('data-theme', colorScheme);\n }\n }, [colorScheme]);\n\n const resolvedColorScheme =\n colorScheme === 'system' ? (getSystemIsDark() ? 'dark' : 'light') : colorScheme;\n\n useEffect(() => {\n const root = document.documentElement;\n\n if (accentColor === 'blue') {\n root.style.removeProperty('--gnome-accent-color');\n root.style.removeProperty('--gnome-accent-bg-color');\n\n return;\n }\n\n if (NAMED_ACCENT_COLORS.has(accentColor)) {\n const shade = resolvedColorScheme === 'dark' ? '2' : '3';\n\n root.style.setProperty('--gnome-accent-color', `var(--gnome-${accentColor}-${shade})`);\n root.style.setProperty('--gnome-accent-bg-color', `var(--gnome-${accentColor}-3)`);\n } else {\n root.style.setProperty('--gnome-accent-color', accentColor);\n root.style.setProperty('--gnome-accent-bg-color', accentColor);\n }\n }, [accentColor, resolvedColorScheme]);\n\n const value = useMemo(\n () => ({\n locale,\n dir,\n numberFormat,\n dateTimeFormat,\n colorScheme,\n resolvedColorScheme,\n accentColor,\n }),\n [locale, dir, numberFormat, dateTimeFormat, colorScheme, resolvedColorScheme, accentColor],\n );\n\n return <GnomeContext.Provider value={value}>{children}</GnomeContext.Provider>;\n};\n"],"mappings":"+JASA,IAAM,EAAsB,IAAI,IAAY,CAC1C,OACA,QACA,SACA,SACA,MACA,SACA,OACF,CAAC,EAqCD,SAAS,GAA2B,CAClC,OAAO,OAAO,OAAW,KAAe,OAAO,WAAW,8BAA8B,EAAE,OAC5F,CAGA,IAAa,GAAiB,CAC5B,SACA,MAAM,MACN,eACA,iBACA,cAAc,SACd,cAAc,OACd,cACwB,CACxB,GAAM,EAAG,IAAA,EAAA,EAAA,YAA2B,GAAc,EAAI,EAAG,CAAC,GAE1D,EAAA,EAAA,eAAgB,CACd,GAAI,IAAgB,SAClB,OAGF,IAAM,EAAK,OAAO,WAAW,8BAA8B,EAI3D,OAFA,EAAG,iBAAiB,SAAU,CAAW,MAE5B,EAAG,oBAAoB,SAAU,CAAW,CAC3D,EAAG,CAAC,CAAW,CAAC,GAEhB,EAAA,EAAA,eAAgB,CACd,IAAM,EAAO,SAAS,gBAElB,IAAgB,SAClB,EAAK,gBAAgB,YAAY,EAEjC,EAAK,aAAa,aAAc,CAAW,CAE/C,EAAG,CAAC,CAAW,CAAC,EAEhB,IAAM,EACJ,IAAgB,SAAY,EAAgB,EAAI,OAAS,QAAW,GAEtE,EAAA,EAAA,eAAgB,CACd,IAAM,EAAO,SAAS,gBAEtB,GAAI,IAAgB,OAAQ,CAC1B,EAAK,MAAM,eAAe,sBAAsB,EAChD,EAAK,MAAM,eAAe,yBAAyB,EAEnD,MACF,CAEA,GAAI,EAAoB,IAAI,CAAW,EAAG,CACxC,IAAM,EAAQ,IAAwB,OAAS,IAAM,IAErD,EAAK,MAAM,YAAY,uBAAwB,eAAe,EAAY,GAAG,EAAM,EAAE,EACrF,EAAK,MAAM,YAAY,0BAA2B,eAAe,EAAY,IAAI,CACnF,MACE,EAAK,MAAM,YAAY,uBAAwB,CAAW,EAC1D,EAAK,MAAM,YAAY,0BAA2B,CAAW,CAEjE,EAAG,CAAC,EAAa,CAAmB,CAAC,EAErC,IAAM,GAAA,EAAA,EAAA,cACG,CACL,SACA,MACA,eACA,iBACA,cACA,sBACA,aACF,GACA,CAAC,EAAQ,EAAK,EAAc,EAAgB,EAAa,EAAqB,CAAW,CAC3F,EAEA,OAAO,EAAA,EAAA,KAAC,EAAA,aAAa,SAAd,CAA8B,QAAQ,UAAgC,CAAA,CAC/E"}
|
|
@@ -35,4 +35,4 @@ export interface GnomeProviderProps {
|
|
|
35
35
|
children: ReactNode;
|
|
36
36
|
}
|
|
37
37
|
/** Provides locale, text direction, color scheme, and accent color to all descendant gnome-ui components. */
|
|
38
|
-
export declare
|
|
38
|
+
export declare const GnomeProvider: ({ locale, dir, numberFormat, dateTimeFormat, colorScheme, accentColor, children, }: GnomeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,7 +14,7 @@ var a = new Set([
|
|
|
14
14
|
function o() {
|
|
15
15
|
return typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
var s = ({ locale: s, dir: c = "ltr", numberFormat: l, dateTimeFormat: u, colorScheme: d = "system", accentColor: f = "blue", children: p }) => {
|
|
18
18
|
let [, m] = r((e) => e + 1, 0);
|
|
19
19
|
t(() => {
|
|
20
20
|
if (d !== "system") return;
|
|
@@ -57,7 +57,7 @@ function s({ locale: s, dir: c = "ltr", numberFormat: l, dateTimeFormat: u, colo
|
|
|
57
57
|
value: g,
|
|
58
58
|
children: p
|
|
59
59
|
});
|
|
60
|
-
}
|
|
60
|
+
};
|
|
61
61
|
//#endregion
|
|
62
62
|
export { s as GnomeProvider };
|
|
63
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GnomeProvider.js","names":[],"sources":["../../../src/components/GnomeProvider/GnomeProvider.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useMemo, useReducer } from 'react';\n\nimport {\n type GnomeAccentColor,\n type GnomeColorScheme,\n GnomeContext,\n type GnomeDir,\n} from './GnomeContext';\n\nconst NAMED_ACCENT_COLORS = new Set<string>([\n 'blue',\n 'green',\n 'yellow',\n 'orange',\n 'red',\n 'purple',\n 'brown',\n]);\n\nexport interface GnomeProviderProps {\n /**\n * BCP 47 locale tag (e.g. `\"es-ES\"`, `\"de-DE\"`).\n * When omitted, components fall back to the browser locale.\n */\n locale?: string;\n /** Text direction. Defaults to `\"ltr\"`. */\n dir?: GnomeDir;\n /**\n * Global defaults for number formatting.\n *\n * Use `{ notation: \"compact\", compactDisplay: \"short\" }` for compact\n * values such as `1K`; omit it or set `{ notation: \"standard\" }` for\n * full values such as `1,000`.\n */\n numberFormat?: Intl.NumberFormatOptions;\n /** Global defaults for date/time formatting. */\n dateTimeFormat?: Intl.DateTimeFormatOptions;\n /**\n * Color scheme preference. When set to `\"system\"` (default), the OS\n * preference is respected via `prefers-color-scheme`. When set to\n * `\"light\"` or `\"dark\"`, the `data-theme` attribute is applied to\n * `document.documentElement` to force that theme.\n */\n colorScheme?: GnomeColorScheme;\n /**\n * Accent color. Accepts a named GNOME palette color (`\"blue\"`, `\"green\"`,\n * `\"yellow\"`, `\"orange\"`, `\"red\"`, `\"purple\"`, `\"brown\"`) or any CSS color\n * string (e.g. `\"#ff0000\"`). Named colors are theme-aware and use the\n * correct shade for light/dark mode automatically. Defaults to `\"blue\"`.\n */\n accentColor?: GnomeAccentColor;\n children: ReactNode;\n}\n\nfunction getSystemIsDark(): boolean {\n return typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches;\n}\n\n/** Provides locale, text direction, color scheme, and accent color to all descendant gnome-ui components. */\nexport
|
|
1
|
+
{"version":3,"file":"GnomeProvider.js","names":[],"sources":["../../../src/components/GnomeProvider/GnomeProvider.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useMemo, useReducer } from 'react';\n\nimport {\n type GnomeAccentColor,\n type GnomeColorScheme,\n GnomeContext,\n type GnomeDir,\n} from './GnomeContext';\n\nconst NAMED_ACCENT_COLORS = new Set<string>([\n 'blue',\n 'green',\n 'yellow',\n 'orange',\n 'red',\n 'purple',\n 'brown',\n]);\n\nexport interface GnomeProviderProps {\n /**\n * BCP 47 locale tag (e.g. `\"es-ES\"`, `\"de-DE\"`).\n * When omitted, components fall back to the browser locale.\n */\n locale?: string;\n /** Text direction. Defaults to `\"ltr\"`. */\n dir?: GnomeDir;\n /**\n * Global defaults for number formatting.\n *\n * Use `{ notation: \"compact\", compactDisplay: \"short\" }` for compact\n * values such as `1K`; omit it or set `{ notation: \"standard\" }` for\n * full values such as `1,000`.\n */\n numberFormat?: Intl.NumberFormatOptions;\n /** Global defaults for date/time formatting. */\n dateTimeFormat?: Intl.DateTimeFormatOptions;\n /**\n * Color scheme preference. When set to `\"system\"` (default), the OS\n * preference is respected via `prefers-color-scheme`. When set to\n * `\"light\"` or `\"dark\"`, the `data-theme` attribute is applied to\n * `document.documentElement` to force that theme.\n */\n colorScheme?: GnomeColorScheme;\n /**\n * Accent color. Accepts a named GNOME palette color (`\"blue\"`, `\"green\"`,\n * `\"yellow\"`, `\"orange\"`, `\"red\"`, `\"purple\"`, `\"brown\"`) or any CSS color\n * string (e.g. `\"#ff0000\"`). Named colors are theme-aware and use the\n * correct shade for light/dark mode automatically. Defaults to `\"blue\"`.\n */\n accentColor?: GnomeAccentColor;\n children: ReactNode;\n}\n\nfunction getSystemIsDark(): boolean {\n return typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches;\n}\n\n/** Provides locale, text direction, color scheme, and accent color to all descendant gnome-ui components. */\nexport const GnomeProvider = ({\n locale,\n dir = 'ltr',\n numberFormat,\n dateTimeFormat,\n colorScheme = 'system',\n accentColor = 'blue',\n children,\n}: GnomeProviderProps) => {\n const [, forceUpdate] = useReducer((n: number) => n + 1, 0);\n\n useEffect(() => {\n if (colorScheme !== 'system') {\n return;\n }\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n\n mq.addEventListener('change', forceUpdate);\n\n return () => mq.removeEventListener('change', forceUpdate);\n }, [colorScheme]);\n\n useEffect(() => {\n const root = document.documentElement;\n\n if (colorScheme === 'system') {\n root.removeAttribute('data-theme');\n } else {\n root.setAttribute('data-theme', colorScheme);\n }\n }, [colorScheme]);\n\n const resolvedColorScheme =\n colorScheme === 'system' ? (getSystemIsDark() ? 'dark' : 'light') : colorScheme;\n\n useEffect(() => {\n const root = document.documentElement;\n\n if (accentColor === 'blue') {\n root.style.removeProperty('--gnome-accent-color');\n root.style.removeProperty('--gnome-accent-bg-color');\n\n return;\n }\n\n if (NAMED_ACCENT_COLORS.has(accentColor)) {\n const shade = resolvedColorScheme === 'dark' ? '2' : '3';\n\n root.style.setProperty('--gnome-accent-color', `var(--gnome-${accentColor}-${shade})`);\n root.style.setProperty('--gnome-accent-bg-color', `var(--gnome-${accentColor}-3)`);\n } else {\n root.style.setProperty('--gnome-accent-color', accentColor);\n root.style.setProperty('--gnome-accent-bg-color', accentColor);\n }\n }, [accentColor, resolvedColorScheme]);\n\n const value = useMemo(\n () => ({\n locale,\n dir,\n numberFormat,\n dateTimeFormat,\n colorScheme,\n resolvedColorScheme,\n accentColor,\n }),\n [locale, dir, numberFormat, dateTimeFormat, colorScheme, resolvedColorScheme, accentColor],\n );\n\n return <GnomeContext.Provider value={value}>{children}</GnomeContext.Provider>;\n};\n"],"mappings":";;;;AASA,IAAM,IAAsB,IAAI,IAAY;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAqCD,SAAS,IAA2B;CAClC,OAAO,OAAO,SAAW,OAAe,OAAO,WAAW,8BAA8B,EAAE;AAC5F;AAGA,IAAa,KAAiB,EAC5B,WACA,SAAM,OACN,iBACA,mBACA,iBAAc,UACd,iBAAc,QACd,kBACwB;CACxB,IAAM,GAAG,KAAe,GAAY,MAAc,IAAI,GAAG,CAAC;CAc1D,AAZA,QAAgB;EACd,IAAI,MAAgB,UAClB;EAGF,IAAM,IAAK,OAAO,WAAW,8BAA8B;EAI3D,OAFA,EAAG,iBAAiB,UAAU,CAAW,SAE5B,EAAG,oBAAoB,UAAU,CAAW;CAC3D,GAAG,CAAC,CAAW,CAAC,GAEhB,QAAgB;EACd,IAAM,IAAO,SAAS;EAEtB,AAAI,MAAgB,WAClB,EAAK,gBAAgB,YAAY,IAEjC,EAAK,aAAa,cAAc,CAAW;CAE/C,GAAG,CAAC,CAAW,CAAC;CAEhB,IAAM,IACJ,MAAgB,WAAY,EAAgB,IAAI,SAAS,UAAW;CAEtE,QAAgB;EACd,IAAM,IAAO,SAAS;EAEtB,IAAI,MAAgB,QAAQ;GAE1B,AADA,EAAK,MAAM,eAAe,sBAAsB,GAChD,EAAK,MAAM,eAAe,yBAAyB;GAEnD;EACF;EAEA,IAAI,EAAoB,IAAI,CAAW,GAAG;GACxC,IAAM,IAAQ,MAAwB,SAAS,MAAM;GAGrD,AADA,EAAK,MAAM,YAAY,wBAAwB,eAAe,EAAY,GAAG,EAAM,EAAE,GACrF,EAAK,MAAM,YAAY,2BAA2B,eAAe,EAAY,IAAI;EACnF,OAEE,AADA,EAAK,MAAM,YAAY,wBAAwB,CAAW,GAC1D,EAAK,MAAM,YAAY,2BAA2B,CAAW;CAEjE,GAAG,CAAC,GAAa,CAAmB,CAAC;CAErC,IAAM,IAAQ,SACL;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAQ;EAAK;EAAc;EAAgB;EAAa;EAAqB;CAAW,CAC3F;CAEA,OAAO,kBAAC,EAAa,UAAd;EAA8B;EAAQ;CAAgC,CAAA;AAC/E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("./HeaderBar.module.css.cjs");let t=require("react/jsx-runtime");var n=({title:n,start:r,end:i,flat:a=!1,className:o,...s})=>(0,t.jsxs)(`header`,{className:[e.default.headerBar,a?e.default.flat:null,o].filter(Boolean).join(` `),...s,children:[(0,t.jsx)(`div`,{className:e.default.slot,children:r}),(0,t.jsx)(`div`,{className:e.default.titleSlot,"aria-live":`polite`,children:typeof n==`string`?(0,t.jsx)(`span`,{className:e.default.title,children:n}):n}),(0,t.jsx)(`div`,{className:[e.default.slot,e.default.slotEnd].filter(Boolean).join(` `),children:i})]});exports.HeaderBar=n;
|
|
2
2
|
//# sourceMappingURL=HeaderBar.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderBar.cjs","names":[],"sources":["../../../src/components/HeaderBar/HeaderBar.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\n\nimport styles from './HeaderBar.module.css';\n\nexport interface HeaderBarProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {\n /** Centered title. Pass a string or a custom element. */\n title?: ReactNode;\n /** Controls placed at the leading (left) edge — back button, menu, etc. */\n start?: ReactNode;\n /** Controls placed at the trailing (right) edge — actions, overflow menu, etc. */\n end?: ReactNode;\n /**\n * When true the header bar blends into the window chrome\n * (no bottom border, slightly transparent background).\n * Use for the topmost bar of a full-window layout.\n */\n flat?: boolean;\n}\n\n/**\n * Title bar with centered title and leading/trailing action slots.\n *\n * Mirrors the Adwaita `AdwHeaderBar` pattern. Use `flat` buttons\n * (`<Button variant=\"flat\">`) inside the header bar per GNOME HIG.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.HeaderBar.html\n * @see https://developer.gnome.org/hig/patterns/containers/header-bars.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"HeaderBar.cjs","names":[],"sources":["../../../src/components/HeaderBar/HeaderBar.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\n\nimport styles from './HeaderBar.module.css';\n\nexport interface HeaderBarProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {\n /** Centered title. Pass a string or a custom element. */\n title?: ReactNode;\n /** Controls placed at the leading (left) edge — back button, menu, etc. */\n start?: ReactNode;\n /** Controls placed at the trailing (right) edge — actions, overflow menu, etc. */\n end?: ReactNode;\n /**\n * When true the header bar blends into the window chrome\n * (no bottom border, slightly transparent background).\n * Use for the topmost bar of a full-window layout.\n */\n flat?: boolean;\n}\n\n/**\n * Title bar with centered title and leading/trailing action slots.\n *\n * Mirrors the Adwaita `AdwHeaderBar` pattern. Use `flat` buttons\n * (`<Button variant=\"flat\">`) inside the header bar per GNOME HIG.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.HeaderBar.html\n * @see https://developer.gnome.org/hig/patterns/containers/header-bars.html\n */\nexport const HeaderBar = ({\n title,\n start,\n end,\n flat = false,\n className,\n ...props\n}: HeaderBarProps) => {\n return (\n <header\n className={[styles.headerBar, flat ? styles.flat : null, className].filter(Boolean).join(' ')}\n {...props}\n >\n {/* Leading slot */}\n <div className={styles.slot}>{start}</div>\n\n {/* Centered title */}\n <div className={styles.titleSlot} aria-live=\"polite\">\n {typeof title === 'string' ? <span className={styles.title}>{title}</span> : title}\n </div>\n\n {/* Trailing slot */}\n <div className={[styles.slot, styles.slotEnd].filter(Boolean).join(' ')}>{end}</div>\n </header>\n );\n};\n"],"mappings":"iFA4BA,IAAa,GAAa,CACxB,QACA,QACA,MACA,OAAO,GACP,YACA,GAAG,MAGD,EAAA,EAAA,MAAC,SAAD,CACE,UAAW,CAAC,EAAA,QAAO,UAAW,EAAO,EAAA,QAAO,KAAO,KAAM,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAC5F,GAAI,WAFN,EAKE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,EAAA,QAAO,cAAO,CAAW,CAAA,GAGzC,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,EAAA,QAAO,UAAW,YAAU,kBACzC,OAAO,GAAU,UAAW,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,eAAQ,CAAY,CAAA,EAAI,CAC1E,CAAA,GAGL,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,CAAC,EAAA,QAAO,KAAM,EAAA,QAAO,OAAO,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,WAAI,CAAS,CAAA,CAC7E"}
|
|
@@ -22,4 +22,4 @@ export interface HeaderBarProps extends Omit<HTMLAttributes<HTMLElement>, 'title
|
|
|
22
22
|
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.HeaderBar.html
|
|
23
23
|
* @see https://developer.gnome.org/hig/patterns/containers/header-bars.html
|
|
24
24
|
*/
|
|
25
|
-
export declare
|
|
25
|
+
export declare const HeaderBar: ({ title, start, end, flat, className, ...props }: HeaderBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
import e from "./HeaderBar.module.css.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/HeaderBar/HeaderBar.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
|
-
});
|
|
31
|
-
}
|
|
4
|
+
var r = ({ title: r, start: i, end: a, flat: o = !1, className: s, ...c }) => /* @__PURE__ */ n("header", {
|
|
5
|
+
className: [
|
|
6
|
+
e.headerBar,
|
|
7
|
+
o ? e.flat : null,
|
|
8
|
+
s
|
|
9
|
+
].filter(Boolean).join(" "),
|
|
10
|
+
...c,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ t("div", {
|
|
13
|
+
className: e.slot,
|
|
14
|
+
children: i
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ t("div", {
|
|
17
|
+
className: e.titleSlot,
|
|
18
|
+
"aria-live": "polite",
|
|
19
|
+
children: typeof r == "string" ? /* @__PURE__ */ t("span", {
|
|
20
|
+
className: e.title,
|
|
21
|
+
children: r
|
|
22
|
+
}) : r
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ t("div", {
|
|
25
|
+
className: [e.slot, e.slotEnd].filter(Boolean).join(" "),
|
|
26
|
+
children: a
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
});
|
|
32
30
|
//#endregion
|
|
33
31
|
export { r as HeaderBar };
|
|
34
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderBar.js","names":[],"sources":["../../../src/components/HeaderBar/HeaderBar.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\n\nimport styles from './HeaderBar.module.css';\n\nexport interface HeaderBarProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {\n /** Centered title. Pass a string or a custom element. */\n title?: ReactNode;\n /** Controls placed at the leading (left) edge — back button, menu, etc. */\n start?: ReactNode;\n /** Controls placed at the trailing (right) edge — actions, overflow menu, etc. */\n end?: ReactNode;\n /**\n * When true the header bar blends into the window chrome\n * (no bottom border, slightly transparent background).\n * Use for the topmost bar of a full-window layout.\n */\n flat?: boolean;\n}\n\n/**\n * Title bar with centered title and leading/trailing action slots.\n *\n * Mirrors the Adwaita `AdwHeaderBar` pattern. Use `flat` buttons\n * (`<Button variant=\"flat\">`) inside the header bar per GNOME HIG.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.HeaderBar.html\n * @see https://developer.gnome.org/hig/patterns/containers/header-bars.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"HeaderBar.js","names":[],"sources":["../../../src/components/HeaderBar/HeaderBar.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\n\nimport styles from './HeaderBar.module.css';\n\nexport interface HeaderBarProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {\n /** Centered title. Pass a string or a custom element. */\n title?: ReactNode;\n /** Controls placed at the leading (left) edge — back button, menu, etc. */\n start?: ReactNode;\n /** Controls placed at the trailing (right) edge — actions, overflow menu, etc. */\n end?: ReactNode;\n /**\n * When true the header bar blends into the window chrome\n * (no bottom border, slightly transparent background).\n * Use for the topmost bar of a full-window layout.\n */\n flat?: boolean;\n}\n\n/**\n * Title bar with centered title and leading/trailing action slots.\n *\n * Mirrors the Adwaita `AdwHeaderBar` pattern. Use `flat` buttons\n * (`<Button variant=\"flat\">`) inside the header bar per GNOME HIG.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.HeaderBar.html\n * @see https://developer.gnome.org/hig/patterns/containers/header-bars.html\n */\nexport const HeaderBar = ({\n title,\n start,\n end,\n flat = false,\n className,\n ...props\n}: HeaderBarProps) => {\n return (\n <header\n className={[styles.headerBar, flat ? styles.flat : null, className].filter(Boolean).join(' ')}\n {...props}\n >\n {/* Leading slot */}\n <div className={styles.slot}>{start}</div>\n\n {/* Centered title */}\n <div className={styles.titleSlot} aria-live=\"polite\">\n {typeof title === 'string' ? <span className={styles.title}>{title}</span> : title}\n </div>\n\n {/* Trailing slot */}\n <div className={[styles.slot, styles.slotEnd].filter(Boolean).join(' ')}>{end}</div>\n </header>\n );\n};\n"],"mappings":";;;AA4BA,IAAa,KAAa,EACxB,UACA,UACA,QACA,UAAO,IACP,cACA,GAAG,QAGD,kBAAC,UAAD;CACE,WAAW;EAAC,EAAO;EAAW,IAAO,EAAO,OAAO;EAAM;CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;CAC5F,GAAI;WAFN;EAKE,kBAAC,OAAD;GAAK,WAAW,EAAO;aAAO;EAAW,CAAA;EAGzC,kBAAC,OAAD;GAAK,WAAW,EAAO;GAAW,aAAU;aACzC,OAAO,KAAU,WAAW,kBAAC,QAAD;IAAM,WAAW,EAAO;cAAQ;GAAY,CAAA,IAAI;EAC1E,CAAA;EAGL,kBAAC,OAAD;GAAK,WAAW,CAAC,EAAO,MAAM,EAAO,OAAO,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;aAAI;EAAS,CAAA;CAC7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./HeaderBar/HeaderBar.cjs");exports.HeaderBar=e.HeaderBar;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let e=require(
|
|
1
|
+
let e=require("react/jsx-runtime");var t={sm:12,md:16,lg:20};function n(e){return`paths`in e&&Array.isArray(e.paths)}var r=({icon:r,size:i=`md`,label:a,width:o,height:s,...c})=>{let l=t[i],u=n(r)?r.viewBox:r.viewBox??`0 0 24 24`,d=n(r)?r.paths.map((t,n)=>(0,e.jsx)(`path`,{d:t.d,fillRule:t.fillRule,clipRule:t.clipRule,transform:t.transform},n)):[(0,e.jsx)(`path`,{d:r.path},0)];return(0,e.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:u,width:o??l,height:s??l,fill:`currentColor`,"aria-label":a,"aria-hidden":a?void 0:!0,role:a?`img`:void 0,focusable:`false`,...c,children:d})};exports.Icon=r;
|
|
2
2
|
//# sourceMappingURL=Icon.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.cjs","names":[],"sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { AnyIconDefinition, IconDefinition } from '@gnome-ui/icons';\nimport type { SVGAttributes } from 'react';\n\nexport type IconSize = 'sm' | 'md' | 'lg';\n\nexport interface IconProps extends SVGAttributes<SVGSVGElement> {\n /** Icon from `@gnome-ui/icons`, a `simple-icons` icon, or a raw `{ path }` object. */\n icon: AnyIconDefinition;\n /**\n * Rendered size.\n * - `sm` — 12 px\n * - `md` — 16 px (default)\n * - `lg` — 20 px\n *\n * Override with `width`/`height` for non-standard sizes.\n */\n size?: IconSize;\n /** Accessible label. Omit for decorative icons — they are hidden from screen readers. */\n label?: string;\n}\n\nconst SIZE_MAP: Record<IconSize, number> = { sm: 12, md: 16, lg: 20 };\n\nfunction isIconDefinition(icon: AnyIconDefinition): icon is IconDefinition {\n // When an object has both `path` and `paths`, `paths` wins.\n return 'paths' in icon && Array.isArray((icon as IconDefinition).paths);\n}\n\n/**\n * Renders an icon as an inline SVG.\n *\n * Accepts icons from `@gnome-ui/icons`, any `simple-icons` icon, or a plain\n * `{ path }` object. Uses `currentColor` so the icon inherits the text color\n * of its parent. Pass `label` only when the icon conveys meaning on its own.\n *\n * @example\n * import { Search } from \"@gnome-ui/icons\";\n * <Icon icon={Search} label=\"Search\" />\n *\n * @example\n * import { siGithub } from \"simple-icons\";\n * <Icon icon={siGithub} label=\"GitHub\" />\n */\nexport
|
|
1
|
+
{"version":3,"file":"Icon.cjs","names":[],"sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { AnyIconDefinition, IconDefinition } from '@gnome-ui/icons';\nimport type { SVGAttributes } from 'react';\n\nexport type IconSize = 'sm' | 'md' | 'lg';\n\nexport interface IconProps extends SVGAttributes<SVGSVGElement> {\n /** Icon from `@gnome-ui/icons`, a `simple-icons` icon, or a raw `{ path }` object. */\n icon: AnyIconDefinition;\n /**\n * Rendered size.\n * - `sm` — 12 px\n * - `md` — 16 px (default)\n * - `lg` — 20 px\n *\n * Override with `width`/`height` for non-standard sizes.\n */\n size?: IconSize;\n /** Accessible label. Omit for decorative icons — they are hidden from screen readers. */\n label?: string;\n}\n\nconst SIZE_MAP: Record<IconSize, number> = { sm: 12, md: 16, lg: 20 };\n\nfunction isIconDefinition(icon: AnyIconDefinition): icon is IconDefinition {\n // When an object has both `path` and `paths`, `paths` wins.\n return 'paths' in icon && Array.isArray((icon as IconDefinition).paths);\n}\n\n/**\n * Renders an icon as an inline SVG.\n *\n * Accepts icons from `@gnome-ui/icons`, any `simple-icons` icon, or a plain\n * `{ path }` object. Uses `currentColor` so the icon inherits the text color\n * of its parent. Pass `label` only when the icon conveys meaning on its own.\n *\n * @example\n * import { Search } from \"@gnome-ui/icons\";\n * <Icon icon={Search} label=\"Search\" />\n *\n * @example\n * import { siGithub } from \"simple-icons\";\n * <Icon icon={siGithub} label=\"GitHub\" />\n */\nexport const Icon = ({ icon, size = 'md', label, width, height, ...props }: IconProps) => {\n const px = SIZE_MAP[size];\n\n const resolvedViewBox = isIconDefinition(icon) ? icon.viewBox : (icon.viewBox ?? '0 0 24 24');\n\n const paths = isIconDefinition(icon)\n ? icon.paths.map((p, i) => (\n <path key={i} d={p.d} fillRule={p.fillRule} clipRule={p.clipRule} transform={p.transform} />\n ))\n : [<path key={0} d={icon.path} />];\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox={resolvedViewBox}\n width={width ?? px}\n height={height ?? px}\n fill=\"currentColor\"\n aria-label={label}\n aria-hidden={label ? undefined : true}\n role={label ? 'img' : undefined}\n focusable=\"false\"\n {...props}\n >\n {paths}\n </svg>\n );\n};\n"],"mappings":"mCAqBA,IAAM,EAAqC,CAAE,GAAI,GAAI,GAAI,GAAI,GAAI,EAAG,EAEpE,SAAS,EAAiB,EAAiD,CAEzE,MAAO,UAAW,GAAQ,MAAM,QAAS,EAAwB,KAAK,CACxE,CAiBA,IAAa,GAAQ,CAAE,OAAM,OAAO,KAAM,QAAO,QAAO,SAAQ,GAAG,KAAuB,CACxF,IAAM,EAAK,EAAS,GAEd,EAAkB,EAAiB,CAAI,EAAI,EAAK,QAAW,EAAK,SAAW,YAE3E,EAAQ,EAAiB,CAAI,EAC/B,EAAK,MAAM,KAAK,EAAG,KACjB,EAAA,EAAA,KAAC,OAAD,CAAc,EAAG,EAAE,EAAG,SAAU,EAAE,SAAU,SAAU,EAAE,SAAU,UAAW,EAAE,SAAY,EAAhF,CAAgF,CAC5F,EACD,EAAC,EAAA,EAAA,KAAC,OAAD,CAAc,EAAG,EAAK,IAAO,EAAlB,CAAkB,CAAC,EAEnC,OACE,EAAA,EAAA,KAAC,MAAD,CACE,MAAM,6BACN,QAAS,EACT,MAAO,GAAS,EAChB,OAAQ,GAAU,EAClB,KAAK,eACL,aAAY,EACZ,cAAa,EAAQ,IAAA,GAAY,GACjC,KAAM,EAAQ,MAAQ,IAAA,GACtB,UAAU,QACV,GAAI,WAEH,CACE,CAAA,CAET"}
|
|
@@ -31,4 +31,4 @@ export interface IconProps extends SVGAttributes<SVGSVGElement> {
|
|
|
31
31
|
* import { siGithub } from "simple-icons";
|
|
32
32
|
* <Icon icon={siGithub} label="GitHub" />
|
|
33
33
|
*/
|
|
34
|
-
export declare
|
|
34
|
+
export declare const Icon: ({ icon, size, label, width, height, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,7 +8,7 @@ var t = {
|
|
|
8
8
|
function n(e) {
|
|
9
9
|
return "paths" in e && Array.isArray(e.paths);
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
var r = ({ icon: r, size: i = "md", label: a, width: o, height: s, ...c }) => {
|
|
12
12
|
let l = t[i], u = n(r) ? r.viewBox : r.viewBox ?? "0 0 24 24", d = n(r) ? r.paths.map((t, n) => /* @__PURE__ */ e("path", {
|
|
13
13
|
d: t.d,
|
|
14
14
|
fillRule: t.fillRule,
|
|
@@ -28,7 +28,7 @@ function r({ icon: r, size: i = "md", label: a, width: o, height: s, ...c }) {
|
|
|
28
28
|
...c,
|
|
29
29
|
children: d
|
|
30
30
|
});
|
|
31
|
-
}
|
|
31
|
+
};
|
|
32
32
|
//#endregion
|
|
33
33
|
export { r as Icon };
|
|
34
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","names":[],"sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { AnyIconDefinition, IconDefinition } from '@gnome-ui/icons';\nimport type { SVGAttributes } from 'react';\n\nexport type IconSize = 'sm' | 'md' | 'lg';\n\nexport interface IconProps extends SVGAttributes<SVGSVGElement> {\n /** Icon from `@gnome-ui/icons`, a `simple-icons` icon, or a raw `{ path }` object. */\n icon: AnyIconDefinition;\n /**\n * Rendered size.\n * - `sm` — 12 px\n * - `md` — 16 px (default)\n * - `lg` — 20 px\n *\n * Override with `width`/`height` for non-standard sizes.\n */\n size?: IconSize;\n /** Accessible label. Omit for decorative icons — they are hidden from screen readers. */\n label?: string;\n}\n\nconst SIZE_MAP: Record<IconSize, number> = { sm: 12, md: 16, lg: 20 };\n\nfunction isIconDefinition(icon: AnyIconDefinition): icon is IconDefinition {\n // When an object has both `path` and `paths`, `paths` wins.\n return 'paths' in icon && Array.isArray((icon as IconDefinition).paths);\n}\n\n/**\n * Renders an icon as an inline SVG.\n *\n * Accepts icons from `@gnome-ui/icons`, any `simple-icons` icon, or a plain\n * `{ path }` object. Uses `currentColor` so the icon inherits the text color\n * of its parent. Pass `label` only when the icon conveys meaning on its own.\n *\n * @example\n * import { Search } from \"@gnome-ui/icons\";\n * <Icon icon={Search} label=\"Search\" />\n *\n * @example\n * import { siGithub } from \"simple-icons\";\n * <Icon icon={siGithub} label=\"GitHub\" />\n */\nexport
|
|
1
|
+
{"version":3,"file":"Icon.js","names":[],"sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { AnyIconDefinition, IconDefinition } from '@gnome-ui/icons';\nimport type { SVGAttributes } from 'react';\n\nexport type IconSize = 'sm' | 'md' | 'lg';\n\nexport interface IconProps extends SVGAttributes<SVGSVGElement> {\n /** Icon from `@gnome-ui/icons`, a `simple-icons` icon, or a raw `{ path }` object. */\n icon: AnyIconDefinition;\n /**\n * Rendered size.\n * - `sm` — 12 px\n * - `md` — 16 px (default)\n * - `lg` — 20 px\n *\n * Override with `width`/`height` for non-standard sizes.\n */\n size?: IconSize;\n /** Accessible label. Omit for decorative icons — they are hidden from screen readers. */\n label?: string;\n}\n\nconst SIZE_MAP: Record<IconSize, number> = { sm: 12, md: 16, lg: 20 };\n\nfunction isIconDefinition(icon: AnyIconDefinition): icon is IconDefinition {\n // When an object has both `path` and `paths`, `paths` wins.\n return 'paths' in icon && Array.isArray((icon as IconDefinition).paths);\n}\n\n/**\n * Renders an icon as an inline SVG.\n *\n * Accepts icons from `@gnome-ui/icons`, any `simple-icons` icon, or a plain\n * `{ path }` object. Uses `currentColor` so the icon inherits the text color\n * of its parent. Pass `label` only when the icon conveys meaning on its own.\n *\n * @example\n * import { Search } from \"@gnome-ui/icons\";\n * <Icon icon={Search} label=\"Search\" />\n *\n * @example\n * import { siGithub } from \"simple-icons\";\n * <Icon icon={siGithub} label=\"GitHub\" />\n */\nexport const Icon = ({ icon, size = 'md', label, width, height, ...props }: IconProps) => {\n const px = SIZE_MAP[size];\n\n const resolvedViewBox = isIconDefinition(icon) ? icon.viewBox : (icon.viewBox ?? '0 0 24 24');\n\n const paths = isIconDefinition(icon)\n ? icon.paths.map((p, i) => (\n <path key={i} d={p.d} fillRule={p.fillRule} clipRule={p.clipRule} transform={p.transform} />\n ))\n : [<path key={0} d={icon.path} />];\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox={resolvedViewBox}\n width={width ?? px}\n height={height ?? px}\n fill=\"currentColor\"\n aria-label={label}\n aria-hidden={label ? undefined : true}\n role={label ? 'img' : undefined}\n focusable=\"false\"\n {...props}\n >\n {paths}\n </svg>\n );\n};\n"],"mappings":";;AAqBA,IAAM,IAAqC;CAAE,IAAI;CAAI,IAAI;CAAI,IAAI;AAAG;AAEpE,SAAS,EAAiB,GAAiD;CAEzE,OAAO,WAAW,KAAQ,MAAM,QAAS,EAAwB,KAAK;AACxE;AAiBA,IAAa,KAAQ,EAAE,SAAM,UAAO,MAAM,UAAO,UAAO,WAAQ,GAAG,QAAuB;CACxF,IAAM,IAAK,EAAS,IAEd,IAAkB,EAAiB,CAAI,IAAI,EAAK,UAAW,EAAK,WAAW,aAE3E,IAAQ,EAAiB,CAAI,IAC/B,EAAK,MAAM,KAAK,GAAG,MACjB,kBAAC,QAAD;EAAc,GAAG,EAAE;EAAG,UAAU,EAAE;EAAU,UAAU,EAAE;EAAU,WAAW,EAAE;CAAY,GAAhF,CAAgF,CAC5F,IACD,CAAC,kBAAC,QAAD,EAAc,GAAG,EAAK,KAAO,GAAlB,CAAkB,CAAC;CAEnC,OACE,kBAAC,OAAD;EACE,OAAM;EACN,SAAS;EACT,OAAO,KAAS;EAChB,QAAQ,KAAU;EAClB,MAAK;EACL,cAAY;EACZ,eAAa,IAAQ,KAAA,IAAY;EACjC,MAAM,IAAQ,QAAQ,KAAA;EACtB,WAAU;EACV,GAAI;YAEH;CACE,CAAA;AAET"}
|
package/dist/components/Icon.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./Icon/Icon.cjs");exports.Icon=e.Icon;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("../Button/Button.cjs"),t=require("../Icon/Icon.cjs"),n=require("../Tooltip/Tooltip.cjs");let r=require("react"),i=require("react/jsx-runtime");var a={sm:`sm`,md:`md`,lg:`lg`},o=(0,r.forwardRef)(function({icon:r,label:o,variant:s=`default`,size:c=`md`,iconSize:l,tooltip:u,tooltipPlacement:d,tooltipDelay:f,...p},m){let h=(0,i.jsx)(e.Button,{ref:m,"aria-label":o,shape:`circular`,size:c,variant:s===`osd`?`flat`:s,osd:s===`osd`,...p,children:(0,i.jsx)(t.Icon,{icon:r,size:l??a[c]})});return u?(0,i.jsx)(n.Tooltip,{label:u,placement:d,delay:f,children:h}):h});exports.IconButton=o;
|
|
2
2
|
//# sourceMappingURL=IconButton.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.cjs","names":[],"sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import type { IconDefinition } from '@gnome-ui/icons';\nimport { forwardRef } from 'react';\n\nimport { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from '../Button';\nimport { Icon, type IconSize } from '../Icon';\nimport { Tooltip, type TooltipPlacement } from '../Tooltip';\n\nexport type IconButtonVariant = ButtonVariant | 'osd';\nexport type IconButtonSize = ButtonSize;\n\nexport interface IconButtonProps\n extends Omit<\n ButtonProps,\n 'aria-label' | 'children' | 'leadingIcon' | 'osd' | 'shape' | 'trailingIcon' | 'variant'\n > {\n /** Icon definition imported from `@gnome-ui/icons`. */\n icon: IconDefinition;\n /** Accessible name for the icon-only button. */\n label: string;\n /** Visual style of the button. Use `\"osd\"` for media overlay controls. */\n variant?: IconButtonVariant;\n /** Size of the button. */\n size?: IconButtonSize;\n /** Override the rendered icon size. Defaults to a size matched to `size`. */\n iconSize?: IconSize;\n /** Optional tooltip text shown on hover/focus. */\n tooltip?: string;\n /** Preferred tooltip placement. */\n tooltipPlacement?: TooltipPlacement;\n /** Tooltip delay in milliseconds. */\n tooltipDelay?: number;\n}\n\nconst ICON_SIZE_BY_BUTTON_SIZE: Record<IconButtonSize, IconSize> = {\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n};\n\n/**\n * Icon-only action button composed from `Button`, `Icon`, and optionally `Tooltip`.\n *\n * `label` is required because the button has no visible text.\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n {\n icon,\n label,\n variant = 'default',\n size = 'md',\n iconSize,\n tooltip,\n tooltipPlacement,\n tooltipDelay,\n ...props\n },\n ref,\n) {\n const buttonVariant = variant === 'osd' ? 'flat' : variant;\n\n const button = (\n <Button\n ref={ref}\n aria-label={label}\n shape=\"circular\"\n size={size}\n variant={buttonVariant}\n osd={variant === 'osd'}\n {...props}\n >\n <Icon icon={icon} size={iconSize ?? ICON_SIZE_BY_BUTTON_SIZE[size]} />\n </Button>\n );\n\n if (!tooltip) {\n return button;\n }\n\n return (\n <Tooltip label={tooltip} placement={tooltipPlacement} delay={tooltipDelay}>\n {button}\n </Tooltip>\n );\n});\n"],"mappings":"gKAiCA,IAAM,EAA6D,CACjE,GAAI,KACJ,GAAI,KACJ,GAAI,
|
|
1
|
+
{"version":3,"file":"IconButton.cjs","names":[],"sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import type { IconDefinition } from '@gnome-ui/icons';\nimport { forwardRef } from 'react';\n\nimport { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from '../Button';\nimport { Icon, type IconSize } from '../Icon';\nimport { Tooltip, type TooltipPlacement } from '../Tooltip';\n\nexport type IconButtonVariant = ButtonVariant | 'osd';\nexport type IconButtonSize = ButtonSize;\n\nexport interface IconButtonProps\n extends Omit<\n ButtonProps,\n 'aria-label' | 'children' | 'leadingIcon' | 'osd' | 'shape' | 'trailingIcon' | 'variant'\n > {\n /** Icon definition imported from `@gnome-ui/icons`. */\n icon: IconDefinition;\n /** Accessible name for the icon-only button. */\n label: string;\n /** Visual style of the button. Use `\"osd\"` for media overlay controls. */\n variant?: IconButtonVariant;\n /** Size of the button. */\n size?: IconButtonSize;\n /** Override the rendered icon size. Defaults to a size matched to `size`. */\n iconSize?: IconSize;\n /** Optional tooltip text shown on hover/focus. */\n tooltip?: string;\n /** Preferred tooltip placement. */\n tooltipPlacement?: TooltipPlacement;\n /** Tooltip delay in milliseconds. */\n tooltipDelay?: number;\n}\n\nconst ICON_SIZE_BY_BUTTON_SIZE: Record<IconButtonSize, IconSize> = {\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n};\n\n/**\n * Icon-only action button composed from `Button`, `Icon`, and optionally `Tooltip`.\n *\n * `label` is required because the button has no visible text.\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n {\n icon,\n label,\n variant = 'default',\n size = 'md',\n iconSize,\n tooltip,\n tooltipPlacement,\n tooltipDelay,\n ...props\n },\n ref,\n) {\n const buttonVariant = variant === 'osd' ? 'flat' : variant;\n\n const button = (\n <Button\n ref={ref}\n aria-label={label}\n shape=\"circular\"\n size={size}\n variant={buttonVariant}\n osd={variant === 'osd'}\n {...props}\n >\n <Icon icon={icon} size={iconSize ?? ICON_SIZE_BY_BUTTON_SIZE[size]} />\n </Button>\n );\n\n if (!tooltip) {\n return button;\n }\n\n return (\n <Tooltip label={tooltip} placement={tooltipPlacement} delay={tooltipDelay}>\n {button}\n </Tooltip>\n );\n});\n"],"mappings":"gKAiCA,IAAM,EAA6D,CACjE,GAAI,KACJ,GAAI,KACJ,GAAI,IACN,EAOa,GAAA,EAAA,EAAA,YAA4D,SACvE,CACE,OACA,QACA,UAAU,UACV,OAAO,KACP,WACA,UACA,mBACA,eACA,GAAG,GAEL,EACA,CAGA,IAAM,GACJ,EAAA,EAAA,KAAC,EAAA,OAAD,CACO,MACL,aAAY,EACZ,MAAM,WACA,OACN,QARkB,IAAY,MAAQ,OAAS,EAS/C,IAAK,IAAY,MACjB,GAAI,YAEJ,EAAA,EAAA,KAAC,EAAA,KAAD,CAAY,OAAM,KAAM,GAAY,EAAyB,EAAQ,CAAA,CAC/D,CAAA,EAOV,OAJK,GAKH,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,MAAO,EAAS,UAAW,EAAkB,MAAO,WAC1D,CACM,CAAA,EANF,CAQX,CAAC"}
|
|
@@ -9,12 +9,12 @@ var a = {
|
|
|
9
9
|
md: "md",
|
|
10
10
|
lg: "lg"
|
|
11
11
|
}, o = r(function({ icon: r, label: o, variant: s = "default", size: c = "md", iconSize: l, tooltip: u, tooltipPlacement: d, tooltipDelay: f, ...p }, m) {
|
|
12
|
-
let h =
|
|
12
|
+
let h = /* @__PURE__ */ i(e, {
|
|
13
13
|
ref: m,
|
|
14
14
|
"aria-label": o,
|
|
15
15
|
shape: "circular",
|
|
16
16
|
size: c,
|
|
17
|
-
variant:
|
|
17
|
+
variant: s === "osd" ? "flat" : s,
|
|
18
18
|
osd: s === "osd",
|
|
19
19
|
...p,
|
|
20
20
|
children: /* @__PURE__ */ i(t, {
|
|
@@ -26,8 +26,8 @@ var a = {
|
|
|
26
26
|
label: u,
|
|
27
27
|
placement: d,
|
|
28
28
|
delay: f,
|
|
29
|
-
children:
|
|
30
|
-
}) :
|
|
29
|
+
children: h
|
|
30
|
+
}) : h;
|
|
31
31
|
});
|
|
32
32
|
//#endregion
|
|
33
33
|
export { o as IconButton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","names":[],"sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import type { IconDefinition } from '@gnome-ui/icons';\nimport { forwardRef } from 'react';\n\nimport { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from '../Button';\nimport { Icon, type IconSize } from '../Icon';\nimport { Tooltip, type TooltipPlacement } from '../Tooltip';\n\nexport type IconButtonVariant = ButtonVariant | 'osd';\nexport type IconButtonSize = ButtonSize;\n\nexport interface IconButtonProps\n extends Omit<\n ButtonProps,\n 'aria-label' | 'children' | 'leadingIcon' | 'osd' | 'shape' | 'trailingIcon' | 'variant'\n > {\n /** Icon definition imported from `@gnome-ui/icons`. */\n icon: IconDefinition;\n /** Accessible name for the icon-only button. */\n label: string;\n /** Visual style of the button. Use `\"osd\"` for media overlay controls. */\n variant?: IconButtonVariant;\n /** Size of the button. */\n size?: IconButtonSize;\n /** Override the rendered icon size. Defaults to a size matched to `size`. */\n iconSize?: IconSize;\n /** Optional tooltip text shown on hover/focus. */\n tooltip?: string;\n /** Preferred tooltip placement. */\n tooltipPlacement?: TooltipPlacement;\n /** Tooltip delay in milliseconds. */\n tooltipDelay?: number;\n}\n\nconst ICON_SIZE_BY_BUTTON_SIZE: Record<IconButtonSize, IconSize> = {\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n};\n\n/**\n * Icon-only action button composed from `Button`, `Icon`, and optionally `Tooltip`.\n *\n * `label` is required because the button has no visible text.\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n {\n icon,\n label,\n variant = 'default',\n size = 'md',\n iconSize,\n tooltip,\n tooltipPlacement,\n tooltipDelay,\n ...props\n },\n ref,\n) {\n const buttonVariant = variant === 'osd' ? 'flat' : variant;\n\n const button = (\n <Button\n ref={ref}\n aria-label={label}\n shape=\"circular\"\n size={size}\n variant={buttonVariant}\n osd={variant === 'osd'}\n {...props}\n >\n <Icon icon={icon} size={iconSize ?? ICON_SIZE_BY_BUTTON_SIZE[size]} />\n </Button>\n );\n\n if (!tooltip) {\n return button;\n }\n\n return (\n <Tooltip label={tooltip} placement={tooltipPlacement} delay={tooltipDelay}>\n {button}\n </Tooltip>\n );\n});\n"],"mappings":";;;;;;AAiCA,IAAM,IAA6D;CACjE,IAAI;CACJ,IAAI;CACJ,IAAI;
|
|
1
|
+
{"version":3,"file":"IconButton.js","names":[],"sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import type { IconDefinition } from '@gnome-ui/icons';\nimport { forwardRef } from 'react';\n\nimport { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from '../Button';\nimport { Icon, type IconSize } from '../Icon';\nimport { Tooltip, type TooltipPlacement } from '../Tooltip';\n\nexport type IconButtonVariant = ButtonVariant | 'osd';\nexport type IconButtonSize = ButtonSize;\n\nexport interface IconButtonProps\n extends Omit<\n ButtonProps,\n 'aria-label' | 'children' | 'leadingIcon' | 'osd' | 'shape' | 'trailingIcon' | 'variant'\n > {\n /** Icon definition imported from `@gnome-ui/icons`. */\n icon: IconDefinition;\n /** Accessible name for the icon-only button. */\n label: string;\n /** Visual style of the button. Use `\"osd\"` for media overlay controls. */\n variant?: IconButtonVariant;\n /** Size of the button. */\n size?: IconButtonSize;\n /** Override the rendered icon size. Defaults to a size matched to `size`. */\n iconSize?: IconSize;\n /** Optional tooltip text shown on hover/focus. */\n tooltip?: string;\n /** Preferred tooltip placement. */\n tooltipPlacement?: TooltipPlacement;\n /** Tooltip delay in milliseconds. */\n tooltipDelay?: number;\n}\n\nconst ICON_SIZE_BY_BUTTON_SIZE: Record<IconButtonSize, IconSize> = {\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n};\n\n/**\n * Icon-only action button composed from `Button`, `Icon`, and optionally `Tooltip`.\n *\n * `label` is required because the button has no visible text.\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n {\n icon,\n label,\n variant = 'default',\n size = 'md',\n iconSize,\n tooltip,\n tooltipPlacement,\n tooltipDelay,\n ...props\n },\n ref,\n) {\n const buttonVariant = variant === 'osd' ? 'flat' : variant;\n\n const button = (\n <Button\n ref={ref}\n aria-label={label}\n shape=\"circular\"\n size={size}\n variant={buttonVariant}\n osd={variant === 'osd'}\n {...props}\n >\n <Icon icon={icon} size={iconSize ?? ICON_SIZE_BY_BUTTON_SIZE[size]} />\n </Button>\n );\n\n if (!tooltip) {\n return button;\n }\n\n return (\n <Tooltip label={tooltip} placement={tooltipPlacement} delay={tooltipDelay}>\n {button}\n </Tooltip>\n );\n});\n"],"mappings":";;;;;;AAiCA,IAAM,IAA6D;CACjE,IAAI;CACJ,IAAI;CACJ,IAAI;AACN,GAOa,IAAa,EAA+C,SACvE,EACE,SACA,UACA,aAAU,WACV,UAAO,MACP,aACA,YACA,qBACA,iBACA,GAAG,KAEL,GACA;CAGA,IAAM,IACJ,kBAAC,GAAD;EACO;EACL,cAAY;EACZ,OAAM;EACA;EACN,SARkB,MAAY,QAAQ,SAAS;EAS/C,KAAK,MAAY;EACjB,GAAI;YAEJ,kBAAC,GAAD;GAAY;GAAM,MAAM,KAAY,EAAyB;EAAQ,CAAA;CAC/D,CAAA;CAOV,OAJK,IAKH,kBAAC,GAAD;EAAS,OAAO;EAAS,WAAW;EAAkB,OAAO;YAC1D;CACM,CAAA,IANF;AAQX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./IconButton/IconButton.cjs");exports.IconButton=e.IconButton;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("./InlineViewSwitcher.module.css.cjs");let t=require("react"),n=require("react/jsx-runtime");var r=(0,t.createContext)(null);function i(){let e=(0,t.useContext)(r);if(!e)throw Error(`InlineViewSwitcherItem must be used inside InlineViewSwitcher`);return e}var a=({value:i,onValueChange:a,variant:o=`default`,"aria-label":s=`View switcher`,children:c,className:l,...u})=>{let d=(0,t.useRef)(null);function f(e){let t=Array.from(d.current?.querySelectorAll(`[role=radio]:not(:disabled)`)??[]),n=document.activeElement,r=n instanceof HTMLButtonElement?t.indexOf(n):-1;if(r===-1)return;let i=r;if(e.key===`ArrowRight`||e.key===`ArrowDown`)i=(r+1)%t.length;else if(e.key===`ArrowLeft`||e.key===`ArrowUp`)i=(r-1+t.length)%t.length;else if(e.key===`Home`)i=0;else if(e.key===`End`)i=t.length-1;else return;e.preventDefault(),t[i].focus(),t[i].click()}return(0,n.jsx)(r.Provider,{value:{value:i,onValueChange:a},children:(0,n.jsx)(`div`,{ref:d,role:`radiogroup`,"aria-label":s,onKeyDown:f,className:[e.default.switcher,e.default[o],l].filter(Boolean).join(` `),...u,children:c})})};exports.InlineViewSwitcher=a,exports.useInlineViewSwitcher=i;
|
|
2
2
|
//# sourceMappingURL=InlineViewSwitcher.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineViewSwitcher.cjs","names":[],"sources":["../../../src/components/InlineViewSwitcher/InlineViewSwitcher.tsx"],"sourcesContent":["import {\n createContext,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useContext,\n useRef,\n} from 'react';\n\nimport styles from './InlineViewSwitcher.module.css';\n\nexport type InlineViewSwitcherVariant = 'default' | 'flat' | 'round' | 'pill';\n\n// ─── Internal context ──────────────────────────────────────────────────────────\n\ninterface InlineViewSwitcherContextValue {\n value: string;\n onValueChange: (value: string) => void;\n}\n\nconst InlineViewSwitcherContext = createContext<InlineViewSwitcherContextValue | null>(null);\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport function useInlineViewSwitcher() {\n const ctx = useContext(InlineViewSwitcherContext);\n\n if (!ctx) {\n throw new Error('InlineViewSwitcherItem must be used inside InlineViewSwitcher');\n }\n\n return ctx;\n}\n\n// ─── InlineViewSwitcher ────────────────────────────────────────────────────────\n\nexport interface InlineViewSwitcherProps extends HTMLAttributes<HTMLDivElement> {\n /** Currently active view name. */\n value: string;\n /** Called with the new value when a view is selected. */\n onValueChange: (value: string) => void;\n /**\n * Visual style of the switcher.\n * - `default` — card background with border and shadow (same as `ToggleGroup`).\n * - `flat` — no background or border; active indicator only.\n * - `round` — pill-shaped container and items.\n * - `pill` — segmented-control style; active item appears lifted, no accent color.\n */\n variant?: InlineViewSwitcherVariant;\n /** Accessible label for the group. */\n 'aria-label'?: string;\n children?: ReactNode;\n}\n\n/**\n * Compact inline view switcher for placing inside content areas, cards, or\n * toolbars — wherever `ViewSwitcher` (header-bar sized) would be too heavy.\n *\n * Built on `ToggleGroup` internals with `flat` and `round` style variants.\n * Mirrors `AdwInlineViewSwitcher` (libadwaita 1.7 / GNOME 48).\n *\n * Compose with `InlineViewSwitcherItem`. Keyboard: ← / → cycle, Home / End jump.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.InlineViewSwitcher.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"InlineViewSwitcher.cjs","names":[],"sources":["../../../src/components/InlineViewSwitcher/InlineViewSwitcher.tsx"],"sourcesContent":["import {\n createContext,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useContext,\n useRef,\n} from 'react';\n\nimport styles from './InlineViewSwitcher.module.css';\n\nexport type InlineViewSwitcherVariant = 'default' | 'flat' | 'round' | 'pill';\n\n// ─── Internal context ──────────────────────────────────────────────────────────\n\ninterface InlineViewSwitcherContextValue {\n value: string;\n onValueChange: (value: string) => void;\n}\n\nconst InlineViewSwitcherContext = createContext<InlineViewSwitcherContextValue | null>(null);\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport function useInlineViewSwitcher() {\n const ctx = useContext(InlineViewSwitcherContext);\n\n if (!ctx) {\n throw new Error('InlineViewSwitcherItem must be used inside InlineViewSwitcher');\n }\n\n return ctx;\n}\n\n// ─── InlineViewSwitcher ────────────────────────────────────────────────────────\n\nexport interface InlineViewSwitcherProps extends HTMLAttributes<HTMLDivElement> {\n /** Currently active view name. */\n value: string;\n /** Called with the new value when a view is selected. */\n onValueChange: (value: string) => void;\n /**\n * Visual style of the switcher.\n * - `default` — card background with border and shadow (same as `ToggleGroup`).\n * - `flat` — no background or border; active indicator only.\n * - `round` — pill-shaped container and items.\n * - `pill` — segmented-control style; active item appears lifted, no accent color.\n */\n variant?: InlineViewSwitcherVariant;\n /** Accessible label for the group. */\n 'aria-label'?: string;\n children?: ReactNode;\n}\n\n/**\n * Compact inline view switcher for placing inside content areas, cards, or\n * toolbars — wherever `ViewSwitcher` (header-bar sized) would be too heavy.\n *\n * Built on `ToggleGroup` internals with `flat` and `round` style variants.\n * Mirrors `AdwInlineViewSwitcher` (libadwaita 1.7 / GNOME 48).\n *\n * Compose with `InlineViewSwitcherItem`. Keyboard: ← / → cycle, Home / End jump.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.InlineViewSwitcher.html\n */\nexport const InlineViewSwitcher = ({\n value,\n onValueChange,\n variant = 'default',\n 'aria-label': ariaLabel = 'View switcher',\n children,\n className,\n ...props\n}: InlineViewSwitcherProps) => {\n const groupRef = useRef<HTMLDivElement>(null);\n\n function handleKeyDown(e: KeyboardEvent<HTMLDivElement>) {\n const items = Array.from(\n groupRef.current?.querySelectorAll<HTMLButtonElement>('[role=radio]:not(:disabled)') ?? [],\n );\n const activeElement = document.activeElement;\n const idx = activeElement instanceof HTMLButtonElement ? items.indexOf(activeElement) : -1;\n\n if (idx === -1) {\n return;\n }\n\n let next = idx;\n if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n next = (idx + 1) % items.length;\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n next = (idx - 1 + items.length) % items.length;\n } else if (e.key === 'Home') {\n next = 0;\n } else if (e.key === 'End') {\n next = items.length - 1;\n } else {\n return;\n }\n\n e.preventDefault();\n items[next].focus();\n items[next].click();\n }\n\n return (\n <InlineViewSwitcherContext.Provider value={{ value, onValueChange }}>\n <div\n ref={groupRef}\n role=\"radiogroup\"\n aria-label={ariaLabel}\n onKeyDown={handleKeyDown}\n className={[styles.switcher, styles[variant], className].filter(Boolean).join(' ')}\n {...props}\n >\n {children}\n </div>\n </InlineViewSwitcherContext.Provider>\n );\n};\n"],"mappings":"6GAoBA,IAAM,GAAA,EAAA,EAAA,eAAiF,IAAI,EAG3F,SAAgB,GAAwB,CACtC,IAAM,GAAA,EAAA,EAAA,YAAiB,CAAyB,EAEhD,GAAI,CAAC,EACH,MAAU,MAAM,+DAA+D,EAGjF,OAAO,CACT,CAiCA,IAAa,GAAsB,CACjC,QACA,gBACA,UAAU,UACV,aAAc,EAAY,gBAC1B,WACA,YACA,GAAG,KAC0B,CAC7B,IAAM,GAAA,EAAA,EAAA,QAAkC,IAAI,EAE5C,SAAS,EAAc,EAAkC,CACvD,IAAM,EAAQ,MAAM,KAClB,EAAS,SAAS,iBAAoC,6BAA6B,GAAK,CAAC,CAC3F,EACM,EAAgB,SAAS,cACzB,EAAM,aAAyB,kBAAoB,EAAM,QAAQ,CAAa,EAAI,GAExF,GAAI,IAAQ,GACV,OAGF,IAAI,EAAO,EACX,GAAI,EAAE,MAAQ,cAAgB,EAAE,MAAQ,YACtC,GAAQ,EAAM,GAAK,EAAM,YACpB,GAAI,EAAE,MAAQ,aAAe,EAAE,MAAQ,UAC5C,GAAQ,EAAM,EAAI,EAAM,QAAU,EAAM,YACnC,GAAI,EAAE,MAAQ,OACnB,EAAO,OACF,GAAI,EAAE,MAAQ,MACnB,EAAO,EAAM,OAAS,OAEtB,OAGF,EAAE,eAAe,EACjB,EAAM,GAAM,MAAM,EAClB,EAAM,GAAM,MAAM,CACpB,CAEA,OACE,EAAA,EAAA,KAAC,EAA0B,SAA3B,CAAoC,MAAO,CAAE,QAAO,eAAc,YAChE,EAAA,EAAA,KAAC,MAAD,CACE,IAAK,EACL,KAAK,aACL,aAAY,EACZ,UAAW,EACX,UAAW,CAAC,EAAA,QAAO,SAAU,EAAA,QAAO,GAAU,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EACjF,GAAI,EAEH,UACE,CAAA,CAC6B,CAAA,CAExC"}
|
|
@@ -33,5 +33,5 @@ export interface InlineViewSwitcherProps extends HTMLAttributes<HTMLDivElement>
|
|
|
33
33
|
*
|
|
34
34
|
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.InlineViewSwitcher.html
|
|
35
35
|
*/
|
|
36
|
-
export declare
|
|
36
|
+
export declare const InlineViewSwitcher: ({ value, onValueChange, variant, "aria-label": ariaLabel, children, className, ...props }: InlineViewSwitcherProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
37
|
export {};
|
|
@@ -8,7 +8,7 @@ function o() {
|
|
|
8
8
|
if (!e) throw Error("InlineViewSwitcherItem must be used inside InlineViewSwitcher");
|
|
9
9
|
return e;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
var s = ({ value: t, onValueChange: n, variant: o = "default", "aria-label": s = "View switcher", children: c, className: l, ...u }) => {
|
|
12
12
|
let d = r(null);
|
|
13
13
|
function f(e) {
|
|
14
14
|
let t = Array.from(d.current?.querySelectorAll("[role=radio]:not(:disabled)") ?? []), n = document.activeElement, r = n instanceof HTMLButtonElement ? t.indexOf(n) : -1;
|
|
@@ -40,7 +40,7 @@ function s({ value: t, onValueChange: n, variant: o = "default", "aria-label": s
|
|
|
40
40
|
children: c
|
|
41
41
|
})
|
|
42
42
|
});
|
|
43
|
-
}
|
|
43
|
+
};
|
|
44
44
|
//#endregion
|
|
45
45
|
export { s as InlineViewSwitcher, o as useInlineViewSwitcher };
|
|
46
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineViewSwitcher.js","names":[],"sources":["../../../src/components/InlineViewSwitcher/InlineViewSwitcher.tsx"],"sourcesContent":["import {\n createContext,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useContext,\n useRef,\n} from 'react';\n\nimport styles from './InlineViewSwitcher.module.css';\n\nexport type InlineViewSwitcherVariant = 'default' | 'flat' | 'round' | 'pill';\n\n// ─── Internal context ──────────────────────────────────────────────────────────\n\ninterface InlineViewSwitcherContextValue {\n value: string;\n onValueChange: (value: string) => void;\n}\n\nconst InlineViewSwitcherContext = createContext<InlineViewSwitcherContextValue | null>(null);\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport function useInlineViewSwitcher() {\n const ctx = useContext(InlineViewSwitcherContext);\n\n if (!ctx) {\n throw new Error('InlineViewSwitcherItem must be used inside InlineViewSwitcher');\n }\n\n return ctx;\n}\n\n// ─── InlineViewSwitcher ────────────────────────────────────────────────────────\n\nexport interface InlineViewSwitcherProps extends HTMLAttributes<HTMLDivElement> {\n /** Currently active view name. */\n value: string;\n /** Called with the new value when a view is selected. */\n onValueChange: (value: string) => void;\n /**\n * Visual style of the switcher.\n * - `default` — card background with border and shadow (same as `ToggleGroup`).\n * - `flat` — no background or border; active indicator only.\n * - `round` — pill-shaped container and items.\n * - `pill` — segmented-control style; active item appears lifted, no accent color.\n */\n variant?: InlineViewSwitcherVariant;\n /** Accessible label for the group. */\n 'aria-label'?: string;\n children?: ReactNode;\n}\n\n/**\n * Compact inline view switcher for placing inside content areas, cards, or\n * toolbars — wherever `ViewSwitcher` (header-bar sized) would be too heavy.\n *\n * Built on `ToggleGroup` internals with `flat` and `round` style variants.\n * Mirrors `AdwInlineViewSwitcher` (libadwaita 1.7 / GNOME 48).\n *\n * Compose with `InlineViewSwitcherItem`. Keyboard: ← / → cycle, Home / End jump.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.InlineViewSwitcher.html\n */\nexport
|
|
1
|
+
{"version":3,"file":"InlineViewSwitcher.js","names":[],"sources":["../../../src/components/InlineViewSwitcher/InlineViewSwitcher.tsx"],"sourcesContent":["import {\n createContext,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useContext,\n useRef,\n} from 'react';\n\nimport styles from './InlineViewSwitcher.module.css';\n\nexport type InlineViewSwitcherVariant = 'default' | 'flat' | 'round' | 'pill';\n\n// ─── Internal context ──────────────────────────────────────────────────────────\n\ninterface InlineViewSwitcherContextValue {\n value: string;\n onValueChange: (value: string) => void;\n}\n\nconst InlineViewSwitcherContext = createContext<InlineViewSwitcherContextValue | null>(null);\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport function useInlineViewSwitcher() {\n const ctx = useContext(InlineViewSwitcherContext);\n\n if (!ctx) {\n throw new Error('InlineViewSwitcherItem must be used inside InlineViewSwitcher');\n }\n\n return ctx;\n}\n\n// ─── InlineViewSwitcher ────────────────────────────────────────────────────────\n\nexport interface InlineViewSwitcherProps extends HTMLAttributes<HTMLDivElement> {\n /** Currently active view name. */\n value: string;\n /** Called with the new value when a view is selected. */\n onValueChange: (value: string) => void;\n /**\n * Visual style of the switcher.\n * - `default` — card background with border and shadow (same as `ToggleGroup`).\n * - `flat` — no background or border; active indicator only.\n * - `round` — pill-shaped container and items.\n * - `pill` — segmented-control style; active item appears lifted, no accent color.\n */\n variant?: InlineViewSwitcherVariant;\n /** Accessible label for the group. */\n 'aria-label'?: string;\n children?: ReactNode;\n}\n\n/**\n * Compact inline view switcher for placing inside content areas, cards, or\n * toolbars — wherever `ViewSwitcher` (header-bar sized) would be too heavy.\n *\n * Built on `ToggleGroup` internals with `flat` and `round` style variants.\n * Mirrors `AdwInlineViewSwitcher` (libadwaita 1.7 / GNOME 48).\n *\n * Compose with `InlineViewSwitcherItem`. Keyboard: ← / → cycle, Home / End jump.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.InlineViewSwitcher.html\n */\nexport const InlineViewSwitcher = ({\n value,\n onValueChange,\n variant = 'default',\n 'aria-label': ariaLabel = 'View switcher',\n children,\n className,\n ...props\n}: InlineViewSwitcherProps) => {\n const groupRef = useRef<HTMLDivElement>(null);\n\n function handleKeyDown(e: KeyboardEvent<HTMLDivElement>) {\n const items = Array.from(\n groupRef.current?.querySelectorAll<HTMLButtonElement>('[role=radio]:not(:disabled)') ?? [],\n );\n const activeElement = document.activeElement;\n const idx = activeElement instanceof HTMLButtonElement ? items.indexOf(activeElement) : -1;\n\n if (idx === -1) {\n return;\n }\n\n let next = idx;\n if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n next = (idx + 1) % items.length;\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n next = (idx - 1 + items.length) % items.length;\n } else if (e.key === 'Home') {\n next = 0;\n } else if (e.key === 'End') {\n next = items.length - 1;\n } else {\n return;\n }\n\n e.preventDefault();\n items[next].focus();\n items[next].click();\n }\n\n return (\n <InlineViewSwitcherContext.Provider value={{ value, onValueChange }}>\n <div\n ref={groupRef}\n role=\"radiogroup\"\n aria-label={ariaLabel}\n onKeyDown={handleKeyDown}\n className={[styles.switcher, styles[variant], className].filter(Boolean).join(' ')}\n {...props}\n >\n {children}\n </div>\n </InlineViewSwitcherContext.Provider>\n );\n};\n"],"mappings":";;;;AAoBA,IAAM,IAA4B,EAAqD,IAAI;AAG3F,SAAgB,IAAwB;CACtC,IAAM,IAAM,EAAW,CAAyB;CAEhD,IAAI,CAAC,GACH,MAAU,MAAM,+DAA+D;CAGjF,OAAO;AACT;AAiCA,IAAa,KAAsB,EACjC,UACA,kBACA,aAAU,WACV,cAAc,IAAY,iBAC1B,aACA,cACA,GAAG,QAC0B;CAC7B,IAAM,IAAW,EAAuB,IAAI;CAE5C,SAAS,EAAc,GAAkC;EACvD,IAAM,IAAQ,MAAM,KAClB,EAAS,SAAS,iBAAoC,6BAA6B,KAAK,CAAC,CAC3F,GACM,IAAgB,SAAS,eACzB,IAAM,aAAyB,oBAAoB,EAAM,QAAQ,CAAa,IAAI;EAExF,IAAI,MAAQ,IACV;EAGF,IAAI,IAAO;EACX,IAAI,EAAE,QAAQ,gBAAgB,EAAE,QAAQ,aACtC,KAAQ,IAAM,KAAK,EAAM;OACpB,IAAI,EAAE,QAAQ,eAAe,EAAE,QAAQ,WAC5C,KAAQ,IAAM,IAAI,EAAM,UAAU,EAAM;OACnC,IAAI,EAAE,QAAQ,QACnB,IAAO;OACF,IAAI,EAAE,QAAQ,OACnB,IAAO,EAAM,SAAS;OAEtB;EAKF,AAFA,EAAE,eAAe,GACjB,EAAM,GAAM,MAAM,GAClB,EAAM,GAAM,MAAM;CACpB;CAEA,OACE,kBAAC,EAA0B,UAA3B;EAAoC,OAAO;GAAE;GAAO;EAAc;YAChE,kBAAC,OAAD;GACE,KAAK;GACL,MAAK;GACL,cAAY;GACZ,WAAW;GACX,WAAW;IAAC,EAAO;IAAU,EAAO;IAAU;GAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;GACjF,GAAI;GAEH;EACE,CAAA;CAC6B,CAAA;AAExC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("../Icon/Icon.cjs"),t=require("./InlineViewSwitcher.module.css.cjs"),n=require("./InlineViewSwitcher.cjs");let r=require("react/jsx-runtime");var i=({name:i,label:a,icon:o,disabled:s,className:c,...l})=>{let{value:u,onValueChange:d}=n.useInlineViewSwitcher(),f=u===i,p=o&&!a;return(0,r.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":f,tabIndex:f?0:-1,disabled:s,onClick:()=>d(i),className:[t.default.item,f?t.default.active:null,p?t.default.iconOnly:null,c].filter(Boolean).join(` `),...l,children:[o&&(0,r.jsx)(`span`,{className:t.default.itemIcon,children:(0,r.jsx)(e.Icon,{icon:o,size:`md`,"aria-hidden":!0})}),a&&(0,r.jsx)(`span`,{className:t.default.itemLabel,children:a})]})};exports.InlineViewSwitcherItem=i;
|
|
2
2
|
//# sourceMappingURL=InlineViewSwitcherItem.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineViewSwitcherItem.cjs","names":[],"sources":["../../../src/components/InlineViewSwitcher/InlineViewSwitcherItem.tsx"],"sourcesContent":["import type { IconDefinition } from '@gnome-ui/icons';\nimport type { ButtonHTMLAttributes } from 'react';\n\nimport { Icon } from '../Icon';\n\nimport { useInlineViewSwitcher } from './InlineViewSwitcher';\nimport styles from './InlineViewSwitcher.module.css';\n\nexport interface InlineViewSwitcherItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** String identifier — used as the switcher's `value` when this item is active. */\n name: string;\n /** Visible label. */\n label?: string;\n /** Icon from `@gnome-ui/icons`. */\n icon?: IconDefinition;\n}\n\n/**\n * Individual view option inside an `InlineViewSwitcher`.\n *\n * Can be icon-only, label-only, or icon + label. For icon-only items always\n * provide an `aria-label` so screen readers can identify the view.\n */\nexport
|
|
1
|
+
{"version":3,"file":"InlineViewSwitcherItem.cjs","names":[],"sources":["../../../src/components/InlineViewSwitcher/InlineViewSwitcherItem.tsx"],"sourcesContent":["import type { IconDefinition } from '@gnome-ui/icons';\nimport type { ButtonHTMLAttributes } from 'react';\n\nimport { Icon } from '../Icon';\n\nimport { useInlineViewSwitcher } from './InlineViewSwitcher';\nimport styles from './InlineViewSwitcher.module.css';\n\nexport interface InlineViewSwitcherItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** String identifier — used as the switcher's `value` when this item is active. */\n name: string;\n /** Visible label. */\n label?: string;\n /** Icon from `@gnome-ui/icons`. */\n icon?: IconDefinition;\n}\n\n/**\n * Individual view option inside an `InlineViewSwitcher`.\n *\n * Can be icon-only, label-only, or icon + label. For icon-only items always\n * provide an `aria-label` so screen readers can identify the view.\n */\nexport const InlineViewSwitcherItem = ({\n name,\n label,\n icon,\n disabled,\n className,\n ...props\n}: InlineViewSwitcherItemProps) => {\n const { value, onValueChange } = useInlineViewSwitcher();\n const active = value === name;\n const iconOnly = icon && !label;\n\n return (\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={active}\n tabIndex={active ? 0 : -1}\n disabled={disabled}\n onClick={() => onValueChange(name)}\n className={[\n styles.item,\n active ? styles.active : null,\n iconOnly ? styles.iconOnly : null,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n >\n {icon && (\n <span className={styles.itemIcon}>\n <Icon icon={icon} size=\"md\" aria-hidden />\n </span>\n )}\n {label && <span className={styles.itemLabel}>{label}</span>}\n </button>\n );\n};\n"],"mappings":"8JAuBA,IAAa,GAA0B,CACrC,OACA,QACA,OACA,WACA,YACA,GAAG,KAC8B,CACjC,GAAM,CAAE,QAAO,iBAAkB,EAAA,sBAAsB,EACjD,EAAS,IAAU,EACnB,EAAW,GAAQ,CAAC,EAE1B,OACE,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,SACL,KAAK,QACL,eAAc,EACd,SAAU,EAAS,EAAI,GACb,WACV,YAAe,EAAc,CAAI,EACjC,UAAW,CACT,EAAA,QAAO,KACP,EAAS,EAAA,QAAO,OAAS,KACzB,EAAW,EAAA,QAAO,SAAW,KAC7B,CACF,EACG,OAAO,OAAO,EACd,KAAK,GAAG,EACX,GAAI,WAfN,CAiBG,IACC,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,mBACtB,EAAA,EAAA,KAAC,EAAA,KAAD,CAAY,OAAM,KAAK,KAAK,cAAA,EAAa,CAAA,CACrC,CAAA,EAEP,IAAS,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,mBAAY,CAAY,CAAA,CACpD,GAEZ"}
|