@gnome-ui/react 1.49.0 → 1.49.1
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.module.css.cjs +1 -1
- package/dist/components/AboutDialog/AboutDialog.module.css.cjs.map +1 -1
- package/dist/components/AboutDialog/AboutDialog.module.css.js +28 -28
- package/dist/components/AboutDialog/AboutDialog.module.css.js.map +1 -1
- package/dist/components/ActionRow/ActionRow.module.css.cjs +1 -1
- package/dist/components/ActionRow/ActionRow.module.css.cjs.map +1 -1
- package/dist/components/ActionRow/ActionRow.module.css.js +9 -9
- package/dist/components/ActionRow/ActionRow.module.css.js.map +1 -1
- package/dist/components/Avatar/Avatar.module.css.cjs +1 -1
- package/dist/components/Avatar/Avatar.module.css.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.module.css.js +16 -16
- package/dist/components/Avatar/Avatar.module.css.js.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.module.css.cjs +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.module.css.cjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.module.css.js +7 -7
- package/dist/components/AvatarGroup/AvatarGroup.module.css.js.map +1 -1
- package/dist/components/Badge/Badge.module.css.cjs +1 -1
- package/dist/components/Badge/Badge.module.css.cjs.map +1 -1
- package/dist/components/Badge/Badge.module.css.js +9 -9
- package/dist/components/Badge/Badge.module.css.js.map +1 -1
- package/dist/components/Banner/Banner.module.css.cjs +1 -1
- package/dist/components/Banner/Banner.module.css.cjs.map +1 -1
- package/dist/components/Banner/Banner.module.css.js +13 -13
- package/dist/components/Banner/Banner.module.css.js.map +1 -1
- package/dist/components/Blockquote/Blockquote.module.css.cjs +1 -1
- package/dist/components/Blockquote/Blockquote.module.css.cjs.map +1 -1
- package/dist/components/Blockquote/Blockquote.module.css.js +11 -11
- package/dist/components/Blockquote/Blockquote.module.css.js.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.js +1 -1
- 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.cjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.module.css.js +13 -13
- package/dist/components/BottomSheet/BottomSheet.module.css.js.map +1 -1
- package/dist/components/BoxedList/BoxedList.module.css.cjs +1 -1
- package/dist/components/BoxedList/BoxedList.module.css.cjs.map +1 -1
- package/dist/components/BoxedList/BoxedList.module.css.js +5 -5
- package/dist/components/BoxedList/BoxedList.module.css.js.map +1 -1
- package/dist/components/BreakpointBin/BreakpointBin.cjs +1 -1
- package/dist/components/BreakpointBin/BreakpointBin.cjs.map +1 -1
- package/dist/components/BreakpointBin/BreakpointBin.js +1 -1
- package/dist/components/BreakpointBin/BreakpointBin.js.map +1 -1
- package/dist/components/Button/Button.module.css.cjs +1 -1
- package/dist/components/Button/Button.module.css.cjs.map +1 -1
- package/dist/components/Button/Button.module.css.js +11 -11
- package/dist/components/Button/Button.module.css.js.map +1 -1
- package/dist/components/ButtonRow/ButtonRow.module.css.cjs +1 -1
- package/dist/components/ButtonRow/ButtonRow.module.css.cjs.map +1 -1
- package/dist/components/ButtonRow/ButtonRow.module.css.js +7 -7
- package/dist/components/ButtonRow/ButtonRow.module.css.js.map +1 -1
- package/dist/components/Card/Card.module.css.cjs +1 -1
- package/dist/components/Card/Card.module.css.cjs.map +1 -1
- package/dist/components/Card/Card.module.css.js +6 -6
- package/dist/components/Card/Card.module.css.js.map +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 +9 -3
- package/dist/components/Carousel/Carousel.js +99 -42
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/Carousel.module.css.cjs +1 -1
- package/dist/components/Carousel/Carousel.module.css.cjs.map +1 -1
- package/dist/components/Carousel/Carousel.module.css.js +11 -10
- package/dist/components/Carousel/Carousel.module.css.js.map +1 -1
- package/dist/components/CheckRow/CheckRow.module.css.cjs +1 -1
- package/dist/components/CheckRow/CheckRow.module.css.cjs.map +1 -1
- package/dist/components/CheckRow/CheckRow.module.css.js +10 -10
- package/dist/components/CheckRow/CheckRow.module.css.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.css.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.module.css.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.css.js +1 -1
- package/dist/components/Checkbox/Checkbox.module.css.js.map +1 -1
- package/dist/components/Chip/Chip.module.css.cjs +1 -1
- package/dist/components/Chip/Chip.module.css.cjs.map +1 -1
- package/dist/components/Chip/Chip.module.css.js +7 -7
- package/dist/components/Chip/Chip.module.css.js.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.cjs +1 -1
- package/dist/components/ColorPicker/ColorPicker.cjs.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +1 -1
- 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.cjs.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.module.css.js +10 -10
- package/dist/components/ColorPicker/ColorPicker.module.css.js.map +1 -1
- package/dist/components/ColumnView/ColumnView.module.css.cjs +1 -1
- package/dist/components/ColumnView/ColumnView.module.css.cjs.map +1 -1
- package/dist/components/ColumnView/ColumnView.module.css.js +22 -22
- package/dist/components/ColumnView/ColumnView.module.css.js.map +1 -1
- package/dist/components/ComboRow/ComboRow.module.css.cjs +1 -1
- package/dist/components/ComboRow/ComboRow.module.css.cjs.map +1 -1
- package/dist/components/ComboRow/ComboRow.module.css.js +24 -24
- package/dist/components/ComboRow/ComboRow.module.css.js.map +1 -1
- package/dist/components/ContributionGraph/ContributionGraph.module.css.cjs +1 -1
- package/dist/components/ContributionGraph/ContributionGraph.module.css.cjs.map +1 -1
- package/dist/components/ContributionGraph/ContributionGraph.module.css.js +9 -9
- package/dist/components/ContributionGraph/ContributionGraph.module.css.js.map +1 -1
- package/dist/components/CountDownTimer/CountDownTimer.module.css.cjs +1 -1
- package/dist/components/CountDownTimer/CountDownTimer.module.css.cjs.map +1 -1
- package/dist/components/CountDownTimer/CountDownTimer.module.css.js +7 -7
- package/dist/components/CountDownTimer/CountDownTimer.module.css.js.map +1 -1
- package/dist/components/Dialog/Dialog.module.css.cjs +1 -1
- package/dist/components/Dialog/Dialog.module.css.cjs.map +1 -1
- package/dist/components/Dialog/Dialog.module.css.js +11 -11
- package/dist/components/Dialog/Dialog.module.css.js.map +1 -1
- package/dist/components/Dialog/dialogUtils.cjs +1 -1
- package/dist/components/Dialog/dialogUtils.cjs.map +1 -1
- package/dist/components/Dialog/dialogUtils.js +1 -1
- package/dist/components/Dialog/dialogUtils.js.map +1 -1
- package/dist/components/Drawer/Drawer.module.css.cjs +1 -1
- package/dist/components/Drawer/Drawer.module.css.cjs.map +1 -1
- package/dist/components/Drawer/Drawer.module.css.js +12 -12
- package/dist/components/Drawer/Drawer.module.css.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.module.css.cjs +1 -1
- package/dist/components/Dropdown/Dropdown.module.css.cjs.map +1 -1
- package/dist/components/Dropdown/Dropdown.module.css.js +20 -20
- package/dist/components/Dropdown/Dropdown.module.css.js.map +1 -1
- package/dist/components/EntryRow/EntryRow.module.css.cjs +1 -1
- package/dist/components/EntryRow/EntryRow.module.css.cjs.map +1 -1
- package/dist/components/EntryRow/EntryRow.module.css.js +10 -10
- package/dist/components/EntryRow/EntryRow.module.css.js.map +1 -1
- package/dist/components/ExpanderRow/ExpanderRow.module.css.cjs +1 -1
- package/dist/components/ExpanderRow/ExpanderRow.module.css.cjs.map +1 -1
- package/dist/components/ExpanderRow/ExpanderRow.module.css.js +14 -14
- package/dist/components/ExpanderRow/ExpanderRow.module.css.js.map +1 -1
- package/dist/components/Footer/Footer.module.css.cjs +1 -1
- package/dist/components/Footer/Footer.module.css.cjs.map +1 -1
- package/dist/components/Footer/Footer.module.css.js +5 -5
- package/dist/components/Footer/Footer.module.css.js.map +1 -1
- package/dist/components/Frame/Frame.module.css.cjs +1 -1
- package/dist/components/Frame/Frame.module.css.cjs.map +1 -1
- package/dist/components/Frame/Frame.module.css.js +1 -1
- package/dist/components/Frame/Frame.module.css.js.map +1 -1
- package/dist/components/HeaderBar/HeaderBar.module.css.cjs +1 -1
- package/dist/components/HeaderBar/HeaderBar.module.css.cjs.map +1 -1
- package/dist/components/HeaderBar/HeaderBar.module.css.js +6 -6
- package/dist/components/HeaderBar/HeaderBar.module.css.js.map +1 -1
- package/dist/components/Icon/Icon.module.css.cjs +1 -1
- package/dist/components/Icon/Icon.module.css.cjs.map +1 -1
- package/dist/components/Icon/Icon.module.css.js +7 -7
- package/dist/components/Icon/Icon.module.css.js.map +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.cjs +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.cjs.map +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.js +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.js.map +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.module.css.cjs +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.module.css.cjs.map +1 -1
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.module.css.js +22 -22
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.module.css.js.map +1 -1
- package/dist/components/Link/Link.module.css.cjs +1 -1
- package/dist/components/Link/Link.module.css.cjs.map +1 -1
- package/dist/components/Link/Link.module.css.js +2 -2
- package/dist/components/Link/Link.module.css.js.map +1 -1
- package/dist/components/Modal/Modal.module.css.cjs +1 -1
- package/dist/components/Modal/Modal.module.css.cjs.map +1 -1
- package/dist/components/Modal/Modal.module.css.js +17 -17
- package/dist/components/Modal/Modal.module.css.js.map +1 -1
- package/dist/components/NavigationSplitView/NavigationSplitView.module.css.cjs +1 -1
- package/dist/components/NavigationSplitView/NavigationSplitView.module.css.cjs.map +1 -1
- package/dist/components/NavigationSplitView/NavigationSplitView.module.css.js +8 -8
- package/dist/components/NavigationSplitView/NavigationSplitView.module.css.js.map +1 -1
- package/dist/components/NavigationView/NavigationView.module.css.cjs +1 -1
- package/dist/components/NavigationView/NavigationView.module.css.cjs.map +1 -1
- package/dist/components/NavigationView/NavigationView.module.css.js +9 -9
- package/dist/components/NavigationView/NavigationView.module.css.js.map +1 -1
- package/dist/components/OverlaySplitView/OverlaySplitView.module.css.cjs +1 -1
- package/dist/components/OverlaySplitView/OverlaySplitView.module.css.cjs.map +1 -1
- package/dist/components/OverlaySplitView/OverlaySplitView.module.css.js +12 -12
- package/dist/components/OverlaySplitView/OverlaySplitView.module.css.js.map +1 -1
- package/dist/components/PasswordEntryRow/PasswordEntryRow.module.css.cjs +1 -1
- package/dist/components/PasswordEntryRow/PasswordEntryRow.module.css.cjs.map +1 -1
- package/dist/components/PasswordEntryRow/PasswordEntryRow.module.css.js +1 -1
- package/dist/components/PasswordEntryRow/PasswordEntryRow.module.css.js.map +1 -1
- package/dist/components/PathBar/PathBar.module.css.cjs +1 -1
- package/dist/components/PathBar/PathBar.module.css.cjs.map +1 -1
- package/dist/components/PathBar/PathBar.module.css.js +7 -7
- package/dist/components/PathBar/PathBar.module.css.js.map +1 -1
- package/dist/components/Popover/Popover.module.css.cjs +1 -1
- package/dist/components/Popover/Popover.module.css.cjs.map +1 -1
- package/dist/components/Popover/Popover.module.css.js +7 -7
- package/dist/components/Popover/Popover.module.css.js.map +1 -1
- package/dist/components/PreferencesDialog/PreferencesDialog.cjs +1 -1
- package/dist/components/PreferencesDialog/PreferencesDialog.cjs.map +1 -1
- package/dist/components/PreferencesDialog/PreferencesDialog.js +1 -1
- 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.cjs.map +1 -1
- package/dist/components/PreferencesDialog/PreferencesDialog.module.css.js +18 -18
- package/dist/components/PreferencesDialog/PreferencesDialog.module.css.js.map +1 -1
- package/dist/components/PreferencesGroup/PreferencesGroup.module.css.cjs +1 -1
- package/dist/components/PreferencesGroup/PreferencesGroup.module.css.cjs.map +1 -1
- package/dist/components/PreferencesGroup/PreferencesGroup.module.css.js +7 -7
- package/dist/components/PreferencesGroup/PreferencesGroup.module.css.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.module.css.cjs +1 -1
- package/dist/components/ProgressBar/ProgressBar.module.css.cjs.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.module.css.js +8 -8
- package/dist/components/ProgressBar/ProgressBar.module.css.js.map +1 -1
- package/dist/components/RadioButton/RadioButton.module.css.cjs +1 -1
- package/dist/components/RadioButton/RadioButton.module.css.cjs.map +1 -1
- package/dist/components/RadioButton/RadioButton.module.css.js +1 -1
- package/dist/components/RadioButton/RadioButton.module.css.js.map +1 -1
- package/dist/components/SearchBar/SearchBar.module.css.cjs +1 -1
- package/dist/components/SearchBar/SearchBar.module.css.cjs.map +1 -1
- package/dist/components/SearchBar/SearchBar.module.css.js +13 -13
- package/dist/components/SearchBar/SearchBar.module.css.js.map +1 -1
- package/dist/components/SegmentedBar/SegmentedBar.module.css.cjs +1 -1
- package/dist/components/SegmentedBar/SegmentedBar.module.css.cjs.map +1 -1
- package/dist/components/SegmentedBar/SegmentedBar.module.css.js +12 -12
- package/dist/components/SegmentedBar/SegmentedBar.module.css.js.map +1 -1
- package/dist/components/Separator/Separator.module.css.cjs +1 -1
- package/dist/components/Separator/Separator.module.css.cjs.map +1 -1
- package/dist/components/Separator/Separator.module.css.js +3 -3
- package/dist/components/Separator/Separator.module.css.js.map +1 -1
- package/dist/components/ShortcutLabel/ShortcutLabel.module.css.cjs +1 -1
- package/dist/components/ShortcutLabel/ShortcutLabel.module.css.cjs.map +1 -1
- package/dist/components/ShortcutLabel/ShortcutLabel.module.css.js +2 -2
- package/dist/components/ShortcutLabel/ShortcutLabel.module.css.js.map +1 -1
- package/dist/components/ShortcutsDialog/ShortcutsDialog.cjs +1 -1
- package/dist/components/ShortcutsDialog/ShortcutsDialog.cjs.map +1 -1
- package/dist/components/ShortcutsDialog/ShortcutsDialog.js +1 -1
- 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.cjs.map +1 -1
- package/dist/components/ShortcutsDialog/ShortcutsDialog.module.css.js +21 -21
- package/dist/components/ShortcutsDialog/ShortcutsDialog.module.css.js.map +1 -1
- package/dist/components/Sidebar/Sidebar.module.css.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.module.css.cjs.map +1 -1
- package/dist/components/Sidebar/Sidebar.module.css.js +32 -32
- package/dist/components/Sidebar/Sidebar.module.css.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.module.css.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.module.css.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.module.css.js +7 -7
- package/dist/components/Skeleton/Skeleton.module.css.js.map +1 -1
- package/dist/components/Slider/Slider.module.css.cjs +1 -1
- package/dist/components/Slider/Slider.module.css.cjs.map +1 -1
- package/dist/components/Slider/Slider.module.css.js +9 -9
- package/dist/components/Slider/Slider.module.css.js.map +1 -1
- package/dist/components/SpinButton/SpinButton.module.css.cjs +1 -1
- package/dist/components/SpinButton/SpinButton.module.css.cjs.map +1 -1
- package/dist/components/SpinButton/SpinButton.module.css.js +4 -4
- package/dist/components/SpinButton/SpinButton.module.css.js.map +1 -1
- package/dist/components/SpinRow/SpinRow.module.css.cjs +1 -1
- package/dist/components/SpinRow/SpinRow.module.css.cjs.map +1 -1
- package/dist/components/SpinRow/SpinRow.module.css.js +9 -9
- package/dist/components/SpinRow/SpinRow.module.css.js.map +1 -1
- package/dist/components/Spinner/Spinner.module.css.cjs +1 -1
- package/dist/components/Spinner/Spinner.module.css.cjs.map +1 -1
- package/dist/components/Spinner/Spinner.module.css.js +5 -5
- package/dist/components/Spinner/Spinner.module.css.js.map +1 -1
- package/dist/components/SplitButton/SplitButton.module.css.cjs +1 -1
- package/dist/components/SplitButton/SplitButton.module.css.cjs.map +1 -1
- package/dist/components/SplitButton/SplitButton.module.css.js +10 -10
- package/dist/components/SplitButton/SplitButton.module.css.js.map +1 -1
- package/dist/components/StatusBadge/StatusBadge.module.css.cjs +1 -1
- package/dist/components/StatusBadge/StatusBadge.module.css.cjs.map +1 -1
- package/dist/components/StatusBadge/StatusBadge.module.css.js +7 -7
- package/dist/components/StatusBadge/StatusBadge.module.css.js.map +1 -1
- package/dist/components/StatusPage/StatusPage.module.css.cjs +1 -1
- package/dist/components/StatusPage/StatusPage.module.css.cjs.map +1 -1
- package/dist/components/StatusPage/StatusPage.module.css.js +6 -6
- package/dist/components/StatusPage/StatusPage.module.css.js.map +1 -1
- package/dist/components/Switch/Switch.module.css.cjs +1 -1
- package/dist/components/Switch/Switch.module.css.cjs.map +1 -1
- package/dist/components/Switch/Switch.module.css.js +1 -1
- package/dist/components/Switch/Switch.module.css.js.map +1 -1
- package/dist/components/SwitchRow/SwitchRow.module.css.cjs +1 -1
- package/dist/components/SwitchRow/SwitchRow.module.css.cjs.map +1 -1
- package/dist/components/SwitchRow/SwitchRow.module.css.js +9 -9
- package/dist/components/SwitchRow/SwitchRow.module.css.js.map +1 -1
- package/dist/components/Tabs/TabBar.cjs +1 -1
- package/dist/components/Tabs/TabBar.cjs.map +1 -1
- package/dist/components/Tabs/TabBar.js +1 -1
- package/dist/components/Tabs/TabBar.js.map +1 -1
- package/dist/components/Tabs/Tabs.module.css.cjs +1 -1
- package/dist/components/Tabs/Tabs.module.css.cjs.map +1 -1
- package/dist/components/Tabs/Tabs.module.css.js +10 -10
- package/dist/components/Tabs/Tabs.module.css.js.map +1 -1
- package/dist/components/TerminalView/TerminalView.module.css.cjs +1 -1
- package/dist/components/TerminalView/TerminalView.module.css.cjs.map +1 -1
- package/dist/components/TerminalView/TerminalView.module.css.js +6 -6
- package/dist/components/TerminalView/TerminalView.module.css.js.map +1 -1
- package/dist/components/Text/Text.module.css.cjs +1 -1
- package/dist/components/Text/Text.module.css.cjs.map +1 -1
- package/dist/components/Text/Text.module.css.js +20 -20
- package/dist/components/Text/Text.module.css.js.map +1 -1
- package/dist/components/TextField/TextField.module.css.cjs +1 -1
- package/dist/components/TextField/TextField.module.css.cjs.map +1 -1
- package/dist/components/TextField/TextField.module.css.js +7 -7
- package/dist/components/TextField/TextField.module.css.js.map +1 -1
- package/dist/components/Timeline/Timeline.module.css.cjs +1 -1
- package/dist/components/Timeline/Timeline.module.css.cjs.map +1 -1
- package/dist/components/Timeline/Timeline.module.css.js +13 -13
- package/dist/components/Timeline/Timeline.module.css.js.map +1 -1
- package/dist/components/Toast/Toast.module.css.cjs +1 -1
- package/dist/components/Toast/Toast.module.css.cjs.map +1 -1
- package/dist/components/Toast/Toast.module.css.js +9 -9
- package/dist/components/Toast/Toast.module.css.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.cjs +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.cjs.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.js +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.module.css.cjs +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.module.css.cjs.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.module.css.js +6 -6
- package/dist/components/ToggleGroup/ToggleGroup.module.css.js.map +1 -1
- package/dist/components/Toolbar/Toolbar.module.css.cjs +1 -1
- package/dist/components/Toolbar/Toolbar.module.css.cjs.map +1 -1
- package/dist/components/Toolbar/Toolbar.module.css.js +2 -2
- package/dist/components/Toolbar/Toolbar.module.css.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.css.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.module.css.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.css.js +6 -6
- package/dist/components/Tooltip/Tooltip.module.css.js.map +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcher.cjs +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcher.cjs.map +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcher.js +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcher.js.map +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcher.module.css.cjs +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcher.module.css.cjs.map +1 -1
- package/dist/components/ViewSwitcher/ViewSwitcher.module.css.js +5 -5
- package/dist/components/ViewSwitcher/ViewSwitcher.module.css.js.map +1 -1
- package/dist/components/ViewSwitcherBar/ViewSwitcherBar.module.css.cjs +1 -1
- package/dist/components/ViewSwitcherBar/ViewSwitcherBar.module.css.cjs.map +1 -1
- package/dist/components/ViewSwitcherBar/ViewSwitcherBar.module.css.js +1 -1
- package/dist/components/ViewSwitcherBar/ViewSwitcherBar.module.css.js.map +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.cjs +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.cjs.map +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.js +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.js.map +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.module.css.cjs +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.module.css.cjs.map +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.module.css.js +14 -14
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.module.css.js.map +1 -1
- package/dist/components/WindowTitle/WindowTitle.module.css.cjs +1 -1
- package/dist/components/WindowTitle/WindowTitle.module.css.cjs.map +1 -1
- package/dist/components/WindowTitle/WindowTitle.module.css.js +3 -3
- package/dist/components/WindowTitle/WindowTitle.module.css.js.map +1 -1
- package/dist/components/WrapBox/WrapBox.module.css.cjs +1 -1
- package/dist/components/WrapBox/WrapBox.module.css.cjs.map +1 -1
- package/dist/components/WrapBox/WrapBox.module.css.js +2 -2
- package/dist/components/WrapBox/WrapBox.module.css.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
row: "
|
|
3
|
-
title: "
|
|
4
|
-
leading: "
|
|
5
|
-
trailing: "
|
|
6
|
-
default: "
|
|
7
|
-
suggested: "
|
|
8
|
-
destructive: "
|
|
2
|
+
row: "_row_i8gww_3",
|
|
3
|
+
title: "_title_i8gww_46",
|
|
4
|
+
leading: "_leading_i8gww_57",
|
|
5
|
+
trailing: "_trailing_i8gww_58",
|
|
6
|
+
default: "_default_i8gww_66",
|
|
7
|
+
suggested: "_suggested_i8gww_75",
|
|
8
|
+
destructive: "_destructive_i8gww_84"
|
|
9
9
|
};
|
|
10
10
|
//#endregion
|
|
11
11
|
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonRow.module.css.js","names":[],"sources":["../../../src/components/ButtonRow/ButtonRow.module.css"],"sourcesContent":["/* ─── Base row ─────────────────────────────────────────────────────────────── */\n\n.row {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--gnome-space-2, 12px);\n padding: var(--gnome-space-2, 12px) var(--gnome-space-4, 24px);\n min-height: 52px;\n width: 100%;\n\n /* Reset button */\n appearance: none;\n
|
|
1
|
+
{"version":3,"file":"ButtonRow.module.css.js","names":[],"sources":["../../../src/components/ButtonRow/ButtonRow.module.css"],"sourcesContent":["/* ─── Base row ─────────────────────────────────────────────────────────────── */\n\n.row {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--gnome-space-2, 12px);\n padding: var(--gnome-space-2, 12px) var(--gnome-space-4, 24px);\n min-height: 52px;\n width: 100%;\n\n /* Reset button */\n appearance: none;\n background: transparent;\n border: none;\n font: inherit;\n outline: none;\n cursor: pointer;\n text-align: center;\n transition: background-color var(--gnome-duration-fast) var(--gnome-easing-default);\n}\n\n.row:hover {\n background-color: var(--gnome-hover-overlay);\n}\n\n.row:active {\n background-color: var(--gnome-active-overlay);\n}\n\n.row:focus-visible {\n box-shadow:\n inset 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-window-bg-color, #fafafa),\n inset 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 3px))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n.row:disabled {\n opacity: var(--gnome-opacity-disabled, 0.5);\n cursor: not-allowed;\n pointer-events: none;\n}\n\n/* ─── Title ─────────────────────────────────────────────────────────────────── */\n\n.title {\n font-family: var(--gnome-font-family);\n font-size: var(--gnome-font-size-body, 1rem);\n font-weight: var(--gnome-font-weight-semibold, 600);\n line-height: var(--gnome-line-height-body, 1.5);\n flex: 1;\n text-align: center;\n}\n\n/* ─── Leading / trailing icons ─────────────────────────────────────────────── */\n\n.leading,\n.trailing {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n\n/* ─── Variants ─────────────────────────────────────────────────────────────── */\n\n.default .title {\n color: var(--gnome-window-fg-color, rgb(0 0 0 / 0.8));\n}\n\n.default .leading,\n.default .trailing {\n color: var(--gnome-window-fg-color, rgb(0 0 0 / 0.8));\n}\n\n.suggested .title {\n color: var(--gnome-accent-color, #3584e4);\n}\n\n.suggested .leading,\n.suggested .trailing {\n color: var(--gnome-accent-color, #3584e4);\n}\n\n.destructive .title {\n color: var(--gnome-destructive-color, #e01b24);\n}\n\n.destructive .leading,\n.destructive .trailing {\n color: var(--gnome-destructive-color, #e01b24);\n}\n\n/* ─── High contrast ─────────────────────────────────────────────────────────── */\n\n@media (prefers-contrast: more) {\n .row:focus-visible {\n box-shadow:\n inset 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-window-bg-color, #fafafa),\n inset 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 3px))\n var(--gnome-focus-ring-color, #3584e4),\n inset 0 0 0\n calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 3px) + 1px)\n var(--gnome-window-bg-color, #fafafa);\n }\n}\n"],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={card:`
|
|
1
|
+
var e={card:`_card_vvaqp_1`,"padding-none":`_padding-none_vvaqp_12`,"padding-sm":`_padding-sm_vvaqp_16`,"padding-md":`_padding-md_vvaqp_20`,"padding-lg":`_padding-lg_vvaqp_24`,interactive:`_interactive_vvaqp_30`};exports.default=e;
|
|
2
2
|
//# sourceMappingURL=Card.module.css.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.module.css.cjs","names":[],"sources":["../../../src/components/Card/Card.module.css"],"sourcesContent":[".card {\n background-color: var(--gnome-card-bg-color, #
|
|
1
|
+
{"version":3,"file":"Card.module.css.cjs","names":[],"sources":["../../../src/components/Card/Card.module.css"],"sourcesContent":[".card {\n background-color: var(--gnome-card-bg-color, #fff);\n color: var(--gnome-card-fg-color, rgb(0 0 0 / 0.8));\n border: 1px solid var(--gnome-card-shade-color, rgb(0 0 0 / 0.07));\n border-radius: var(--gnome-radius-lg);\n overflow: hidden;\n position: relative;\n}\n\n/* ─── Padding ─────────────────────────────────────────────────── */\n\n.padding-none {\n padding: 0;\n}\n\n.padding-sm {\n padding: var(--gnome-space-2);\n}\n\n.padding-md {\n padding: var(--gnome-space-4);\n}\n\n.padding-lg {\n padding: var(--gnome-space-5);\n}\n\n/* ─── Interactive (activatable) ───────────────────────────────── */\n\n.interactive {\n cursor: pointer;\n user-select: none;\n outline: none;\n\n /* Reset button styles when rendered as <button> */\n appearance: none;\n border: 1px solid var(--gnome-card-shade-color, rgb(0 0 0 / 0.07));\n font: inherit;\n text-align: inherit;\n width: 100%;\n transition:\n background-color var(--gnome-duration-fast) var(--gnome-easing-default),\n box-shadow var(--gnome-duration-fast) var(--gnome-easing-default);\n}\n\n.interactive:hover {\n background-color: color-mix(in srgb, var(--gnome-card-bg-color, #fff) 94%, black 6%);\n}\n\n.interactive:active {\n background-color: color-mix(in srgb, var(--gnome-card-bg-color, #fff) 88%, black 12%);\n}\n\n.interactive:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset) var(--gnome-window-bg-color, #fafafa),\n 0 0 0 calc(var(--gnome-focus-ring-offset) + var(--gnome-focus-ring-width))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n.interactive:disabled {\n opacity: var(--gnome-opacity-disabled);\n cursor: not-allowed;\n pointer-events: none;\n}\n\n@media (prefers-color-scheme: dark) {\n .interactive:hover {\n background-color: color-mix(\n in srgb,\n var(--gnome-card-bg-color, rgb(255 255 255 / 0.08)) 85%,\n white 15%\n );\n }\n\n .interactive:active {\n background-color: color-mix(\n in srgb,\n var(--gnome-card-bg-color, rgb(255 255 255 / 0.08)) 75%,\n white 25%\n );\n }\n}\n\n[data-theme=\"dark\"] {\n .interactive:hover {\n background-color: color-mix(\n in srgb,\n var(--gnome-card-bg-color, rgb(255 255 255 / 0.08)) 85%,\n white 15%\n );\n }\n\n .interactive:active {\n background-color: color-mix(\n in srgb,\n var(--gnome-card-bg-color, rgb(255 255 255 / 0.08)) 75%,\n white 25%\n );\n }\n}\n"],"mappings":""}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
card: "
|
|
3
|
-
"padding-none": "_padding-
|
|
4
|
-
"padding-sm": "_padding-
|
|
5
|
-
"padding-md": "_padding-
|
|
6
|
-
"padding-lg": "_padding-
|
|
7
|
-
interactive: "
|
|
2
|
+
card: "_card_vvaqp_1",
|
|
3
|
+
"padding-none": "_padding-none_vvaqp_12",
|
|
4
|
+
"padding-sm": "_padding-sm_vvaqp_16",
|
|
5
|
+
"padding-md": "_padding-md_vvaqp_20",
|
|
6
|
+
"padding-lg": "_padding-lg_vvaqp_24",
|
|
7
|
+
interactive: "_interactive_vvaqp_30"
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
10
10
|
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.module.css.js","names":[],"sources":["../../../src/components/Card/Card.module.css"],"sourcesContent":[".card {\n background-color: var(--gnome-card-bg-color, #
|
|
1
|
+
{"version":3,"file":"Card.module.css.js","names":[],"sources":["../../../src/components/Card/Card.module.css"],"sourcesContent":[".card {\n background-color: var(--gnome-card-bg-color, #fff);\n color: var(--gnome-card-fg-color, rgb(0 0 0 / 0.8));\n border: 1px solid var(--gnome-card-shade-color, rgb(0 0 0 / 0.07));\n border-radius: var(--gnome-radius-lg);\n overflow: hidden;\n position: relative;\n}\n\n/* ─── Padding ─────────────────────────────────────────────────── */\n\n.padding-none {\n padding: 0;\n}\n\n.padding-sm {\n padding: var(--gnome-space-2);\n}\n\n.padding-md {\n padding: var(--gnome-space-4);\n}\n\n.padding-lg {\n padding: var(--gnome-space-5);\n}\n\n/* ─── Interactive (activatable) ───────────────────────────────── */\n\n.interactive {\n cursor: pointer;\n user-select: none;\n outline: none;\n\n /* Reset button styles when rendered as <button> */\n appearance: none;\n border: 1px solid var(--gnome-card-shade-color, rgb(0 0 0 / 0.07));\n font: inherit;\n text-align: inherit;\n width: 100%;\n transition:\n background-color var(--gnome-duration-fast) var(--gnome-easing-default),\n box-shadow var(--gnome-duration-fast) var(--gnome-easing-default);\n}\n\n.interactive:hover {\n background-color: color-mix(in srgb, var(--gnome-card-bg-color, #fff) 94%, black 6%);\n}\n\n.interactive:active {\n background-color: color-mix(in srgb, var(--gnome-card-bg-color, #fff) 88%, black 12%);\n}\n\n.interactive:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset) var(--gnome-window-bg-color, #fafafa),\n 0 0 0 calc(var(--gnome-focus-ring-offset) + var(--gnome-focus-ring-width))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n.interactive:disabled {\n opacity: var(--gnome-opacity-disabled);\n cursor: not-allowed;\n pointer-events: none;\n}\n\n@media (prefers-color-scheme: dark) {\n .interactive:hover {\n background-color: color-mix(\n in srgb,\n var(--gnome-card-bg-color, rgb(255 255 255 / 0.08)) 85%,\n white 15%\n );\n }\n\n .interactive:active {\n background-color: color-mix(\n in srgb,\n var(--gnome-card-bg-color, rgb(255 255 255 / 0.08)) 75%,\n white 25%\n );\n }\n}\n\n[data-theme=\"dark\"] {\n .interactive:hover {\n background-color: color-mix(\n in srgb,\n var(--gnome-card-bg-color, rgb(255 255 255 / 0.08)) 85%,\n white 15%\n );\n }\n\n .interactive:active {\n background-color: color-mix(\n in srgb,\n var(--gnome-card-bg-color, rgb(255 255 255 / 0.08)) 75%,\n white 25%\n );\n }\n}\n"],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./Carousel.module.css.cjs");let t=require("react"),n=require("react/jsx-runtime");var r=({pages:t,currentPage:r,onPageSelected:i,className:a,...o})=>(0,n.jsx)(`div`,{className:[e.default.indicatorDots,a].filter(Boolean).join(` `),role:`tablist`,"aria-label":`Carousel pages`,...o,children:Array.from({length:t},(t,a)=>(0,n.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===r,"aria-label":`Page ${a+1}`,className:[e.default.dot,a===r?e.default.dotActive:null].filter(Boolean).join(` `),onClick:()=>i?.(a)},a))}),i=({pages:t,currentPage:r,onPageSelected:i,className:a,...o})=>(0,n.jsx)(`div`,{className:[e.default.indicatorLines,a].filter(Boolean).join(` `),role:`tablist`,"aria-label":`Carousel pages`,...o,children:Array.from({length:t},(t,a)=>(0,n.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===r,"aria-label":`Page ${a+1}`,className:[e.default.line,a===r?e.default.lineActive:null].filter(Boolean).join(` `),onClick:()=>i?.(a)},a))}),a=({children:r,orientation:i=`horizontal`,spacing:a=0,loop:o=!1,
|
|
1
|
+
const e=require("./Carousel.module.css.cjs");let t=require("react"),n=require("react/jsx-runtime");var r=({pages:t,currentPage:r,onPageSelected:i,className:a,...o})=>(0,n.jsx)(`div`,{className:[e.default.indicatorDots,a].filter(Boolean).join(` `),role:`tablist`,"aria-label":`Carousel pages`,...o,children:Array.from({length:t},(t,a)=>(0,n.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===r,"aria-label":`Page ${a+1}`,className:[e.default.dot,a===r?e.default.dotActive:null].filter(Boolean).join(` `),onClick:()=>i?.(a)},a))}),i=({pages:t,currentPage:r,onPageSelected:i,className:a,...o})=>(0,n.jsx)(`div`,{className:[e.default.indicatorLines,a].filter(Boolean).join(` `),role:`tablist`,"aria-label":`Carousel pages`,...o,children:Array.from({length:t},(t,a)=>(0,n.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===r,"aria-label":`Page ${a+1}`,className:[e.default.line,a===r?e.default.lineActive:null].filter(Boolean).join(` `),onClick:()=>i?.(a)},a))}),a=({children:r,orientation:i=`horizontal`,spacing:a=0,loop:o=!1,visibleSlides:s=1,onPageChanged:c,page:l,className:u,...d})=>{let f=(0,t.useRef)(null),p=t.Children.count(r),[m,h]=(0,t.useState)(0),[g,_]=(0,t.useState)(!1),v=l!==void 0,y=v?l:m,b=(0,t.useRef)(!1),x=(0,t.useRef)(!1),S=(0,t.useRef)({pos:0,scroll:0,time:0}),C=(0,t.useRef)(0),w=(0,t.useCallback)(()=>{let e=f.current;return e?((i===`horizontal`?e.clientWidth:e.clientHeight)+a)/s:1},[i,a,s]),T=(0,t.useCallback)((e,t=`smooth`)=>{let n=f.current;if(!n)return;let r=w()*e;i===`horizontal`?n.scrollTo({left:r,behavior:t}):n.scrollTo({top:r,behavior:t})},[i,w]);(0,t.useEffect)(()=>{v&&T(l,`smooth`)},[l,T,v]),(0,t.useEffect)(()=>{let e=f.current;if(!e)return;let t=()=>{if(b.current)return;let t=w(),n=i===`horizontal`?e.scrollLeft:e.scrollTop,r=Math.round(n/t),a=Math.max(0,Math.min(r,p-1));v||h(a),c?.(a)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[i,p,v,c,w]);let E=(0,t.useCallback)(e=>{let t=i===`horizontal`?e.key===`ArrowRight`:e.key===`ArrowDown`,n=i===`horizontal`?e.key===`ArrowLeft`:e.key===`ArrowUp`;if(!t&&!n)return;e.preventDefault();let r=t?o?(y+1)%p:Math.min(y+1,p-1):o?(y-1+p)%p:Math.max(y-1,0);T(r),v||h(r),c?.(r)},[y,p,o,i,T,v,c]),D=(0,t.useCallback)(e=>{if(e.pointerType===`mouse`&&e.button!==0)return;let t=f.current;t&&(window.clearTimeout(C.current),t.style.scrollSnapType=`none`,e.currentTarget.setPointerCapture(e.pointerId),b.current=!0,x.current=!1,_(!0),S.current={pos:i===`horizontal`?e.clientX:e.clientY,scroll:i===`horizontal`?t.scrollLeft:t.scrollTop,time:Date.now()})},[i]),O=(0,t.useCallback)(e=>{if(!b.current)return;let t=f.current;if(!t)return;let n=i===`horizontal`?e.clientX:e.clientY,r=S.current.pos-n;Math.abs(r)>4&&(x.current=!0);let a=i===`horizontal`?t.scrollWidth-t.clientWidth:t.scrollHeight-t.clientHeight,o=S.current.scroll+r;o<0?o*=.3:o>a&&(o=a+(o-a)*.3),i===`horizontal`?t.scrollLeft=o:t.scrollTop=o},[i]),k=(0,t.useCallback)(e=>{if(!b.current)return;b.current=!1,_(!1);let t=f.current;if(!x.current||!t){t?.style.removeProperty(`scroll-snap-type`);return}let n=e.type===`pointercancel`,r=n?S.current.pos:i===`horizontal`?e.clientX:e.clientY,a=S.current.pos-r,s=Math.max(Date.now()-S.current.time,1),l=n?0:a/s,u=w(),d=i===`horizontal`?t.scrollLeft:t.scrollTop,m;m=Math.abs(l)>.3?l>0?Math.ceil(d/u):Math.floor(d/u):Math.round(d/u),m=o?(m%p+p)%p:Math.max(0,Math.min(m,p-1)),T(m),v||h(m),c?.(m),C.current=window.setTimeout(()=>{t.style.removeProperty(`scroll-snap-type`)},350)},[i,w,o,p,T,v,c]);(0,t.useEffect)(()=>()=>window.clearTimeout(C.current),[]);let A=(0,t.useCallback)(e=>{x.current&&=(e.preventDefault(),e.stopPropagation(),!1)},[]),j=i===`horizontal`,M=s===1?void 0:`calc((100% - ${a*(s-1)}px) / ${s})`;return(0,n.jsx)(`div`,{ref:f,role:`region`,"aria-roledescription":`carousel`,tabIndex:0,className:[e.default.carousel,j?e.default.horizontal:e.default.vertical,g?e.default.dragging:null,u].filter(Boolean).join(` `),style:j?{columnGap:a||void 0}:{rowGap:a||void 0},onKeyDown:E,onPointerDown:D,onPointerMove:O,onPointerUp:k,onPointerCancel:k,onClick:A,...d,children:t.Children.map(r,(t,r)=>(0,n.jsx)(`div`,{className:e.default.slide,role:`group`,"aria-roledescription":`slide`,"aria-label":`${r+1} of ${p}`,style:M?{flex:`0 0 ${M}`}:void 0,children:t},r))})};exports.Carousel=a,exports.CarouselIndicatorDots=r,exports.CarouselIndicatorLines=i;
|
|
2
2
|
//# sourceMappingURL=Carousel.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.cjs","names":[],"sources":["../../../src/components/Carousel/Carousel.tsx"],"sourcesContent":["import {\n Children,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport styles from './Carousel.module.css';\n\n// ─── CarouselIndicatorDots ────────────────────────────────────────────────────\n\nexport interface CarouselIndicatorDotsProps extends HTMLAttributes<HTMLDivElement> {\n /** Total number of pages. */\n pages: number;\n /** Zero-based index of the current page. */\n currentPage: number;\n /** Called when the user clicks a dot. */\n onPageSelected?: (index: number) => void;\n}\n\n/**\n * Dot-style page indicator for `Carousel`.\n * Mirrors `AdwCarouselIndicatorDots`.\n */\nexport const CarouselIndicatorDots = ({\n pages,\n currentPage,\n onPageSelected,\n className,\n ...props\n}: CarouselIndicatorDotsProps) => {\n return (\n <div\n className={[styles.indicatorDots, className].filter(Boolean).join(' ')}\n role=\"tablist\"\n aria-label=\"Carousel pages\"\n {...props}\n >\n {Array.from({ length: pages }, (_, i) => (\n <button\n key={i}\n type=\"button\"\n role=\"tab\"\n aria-selected={i === currentPage}\n aria-label={`Page ${i + 1}`}\n className={[styles.dot, i === currentPage ? styles.dotActive : null]\n .filter(Boolean)\n .join(' ')}\n onClick={() => onPageSelected?.(i)}\n />\n ))}\n </div>\n );\n};\n\n// ─── CarouselIndicatorLines ───────────────────────────────────────────────────\n\nexport interface CarouselIndicatorLinesProps extends HTMLAttributes<HTMLDivElement> {\n /** Total number of pages. */\n pages: number;\n /** Zero-based index of the current page. */\n currentPage: number;\n /** Called when the user clicks a line. */\n onPageSelected?: (index: number) => void;\n}\n\n/**\n * Line-style page indicator for `Carousel`.\n * Mirrors `AdwCarouselIndicatorLines`.\n */\nexport const CarouselIndicatorLines = ({\n pages,\n currentPage,\n onPageSelected,\n className,\n ...props\n}: CarouselIndicatorLinesProps) => {\n return (\n <div\n className={[styles.indicatorLines, className].filter(Boolean).join(' ')}\n role=\"tablist\"\n aria-label=\"Carousel pages\"\n {...props}\n >\n {Array.from({ length: pages }, (_, i) => (\n <button\n key={i}\n type=\"button\"\n role=\"tab\"\n aria-selected={i === currentPage}\n aria-label={`Page ${i + 1}`}\n className={[styles.line, i === currentPage ? styles.lineActive : null]\n .filter(Boolean)\n .join(' ')}\n onClick={() => onPageSelected?.(i)}\n />\n ))}\n </div>\n );\n};\n\n// ─── Carousel ─────────────────────────────────────────────────────────────────\n\nexport interface CarouselProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n /**\n * Scroll orientation.\n * @default \"horizontal\"\n */\n orientation?: 'horizontal' | 'vertical';\n /**\n * Gap between pages in px.\n * @default 0\n */\n spacing?: number;\n /**\n * Allow infinite looping (wraps around on the last/first page).\n * @default false\n */\n loop?: boolean;\n /** Called whenever the visible page changes. */\n onPageChanged?: (index: number) => void;\n /**\n * Controlled current page index.\n * When omitted the carousel manages page state internally.\n */\n page?: number;\n}\n\n/**\n * Swipeable content carousel.\n *\n * Mirrors `AdwCarousel`. Uses CSS scroll-snapping for smooth, native-feeling\n * page transitions. Supports keyboard navigation (arrow keys) and touch/mouse\n * drag via the browser's native scroll handling.\n *\n * Pair with `CarouselIndicatorDots` or `CarouselIndicatorLines` for pagination UI.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Carousel.html\n */\nexport const Carousel = ({\n children,\n orientation = 'horizontal',\n spacing = 0,\n loop = false,\n onPageChanged,\n page: controlledPage,\n className,\n ...props\n}: CarouselProps) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const pageCount = Children.count(children);\n const [internalPage, setInternalPage] = useState(0);\n const isControlled = controlledPage !== undefined;\n const currentPage = isControlled ? controlledPage : internalPage;\n\n const scrollToPage = useCallback(\n (index: number, behavior: ScrollBehavior = 'smooth') => {\n const el = scrollRef.current;\n\n if (!el) {\n return;\n }\n\n if (orientation === 'horizontal') {\n el.scrollTo({ left: el.clientWidth * index, behavior });\n } else {\n el.scrollTo({ top: el.clientHeight * index, behavior });\n }\n },\n [orientation],\n );\n\n // Scroll to the controlled page when it changes externally\n useEffect(() => {\n if (!isControlled) {\n return;\n }\n\n scrollToPage(controlledPage, 'smooth');\n }, [controlledPage, scrollToPage, isControlled]);\n\n // Detect page changes via IntersectionObserver on each child\n useEffect(() => {\n const el = scrollRef.current;\n\n if (!el) {\n return;\n }\n\n const handleScroll = () => {\n const pages = Array.from(el.children) as HTMLElement[];\n const size = orientation === 'horizontal' ? el.clientWidth : el.clientHeight;\n const scroll = orientation === 'horizontal' ? el.scrollLeft : el.scrollTop;\n const idx = Math.round(scroll / (size || 1));\n const clamped = Math.max(0, Math.min(idx, pageCount - 1));\n\n if (!isControlled) {\n setInternalPage(clamped);\n }\n\n onPageChanged?.(clamped);\n void pages; // suppress lint\n };\n\n el.addEventListener('scroll', handleScroll, { passive: true });\n\n return () => el.removeEventListener('scroll', handleScroll);\n }, [orientation, pageCount, isControlled, onPageChanged]);\n\n // Keyboard navigation\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n const isForward =\n orientation === 'horizontal' ? e.key === 'ArrowRight' : e.key === 'ArrowDown';\n const isBack = orientation === 'horizontal' ? e.key === 'ArrowLeft' : e.key === 'ArrowUp';\n\n if (isForward) {\n e.preventDefault();\n const next = loop\n ? (currentPage + 1) % pageCount\n : Math.min(currentPage + 1, pageCount - 1);\n\n scrollToPage(next);\n if (!isControlled) {\n setInternalPage(next);\n }\n\n onPageChanged?.(next);\n } else if (isBack) {\n e.preventDefault();\n const prev = loop\n ? (currentPage - 1 + pageCount) % pageCount\n : Math.max(currentPage - 1, 0);\n\n scrollToPage(prev);\n if (!isControlled) {\n setInternalPage(prev);\n }\n\n onPageChanged?.(prev);\n }\n },\n [currentPage, pageCount, loop, orientation, scrollToPage, isControlled, onPageChanged],\n );\n\n const isHorizontal = orientation === 'horizontal';\n\n return (\n <div\n ref={scrollRef}\n role=\"region\"\n aria-roledescription=\"carousel\"\n className={[styles.carousel, isHorizontal ? styles.horizontal : styles.vertical, className]\n .filter(Boolean)\n .join(' ')}\n style={isHorizontal ? { columnGap: spacing || undefined } : { rowGap: spacing || undefined }}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {Children.map(children, (child, i) => (\n <div\n key={i}\n className={styles.slide}\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label={`${i + 1} of ${pageCount}`}\n >\n {child}\n </div>\n ))}\n </div>\n );\n};\n"],"mappings":"mGA4BA,IAAa,GAAyB,CACpC,QACA,cACA,iBACA,YACA,GAAG,MAGD,EAAA,EAAA,KAAC,MAAD,CACE,UAAW,CAAC,EAAA,QAAO,cAAe,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EACrE,KAAK,UACL,aAAW,iBACX,GAAI,WAEH,MAAM,KAAK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F,EACA,CAAC,EAAa,EAAW,EAAM,EAAa,EAAc,EAAc,CAAa,CACvF,EAEM,EAAe,IAAgB,aAErC,OACE,EAAA,EAAA,KAAC,MAAD,CACE,IAAK,EACL,KAAK,SACL,uBAAqB,WACrB,UAAW,CAAC,EAAA,QAAO,SAAU,EAAe,EAAA,QAAO,WAAa,EAAA,QAAO,SAAU,CAAS,EACvF,OAAO,OAAO,EACd,KAAK,GAAG,EACX,MAAO,EAAe,CAAE,UAAW,GAAW,IAAA,EAAU,EAAI,CAAE,OAAQ,GAAW,IAAA,EAAU,EAC3F,UAAW,EACX,GAAI,WAEH,EAAA,SAAS,IAAI,GAAW,EAAO,KAC9B,EAAA,EAAA,KAAC,MAAD,CAEE,UAAW,EAAA,QAAO,MAClB,KAAK,QACL,uBAAqB,QACrB,aAAY,GAAG,EAAI,EAAE,MAAM,aAE1B,CACE,EAPE,CAOF,CACN,CACE,CAAA,CAET"}
|
|
1
|
+
{"version":3,"file":"Carousel.cjs","names":[],"sources":["../../../src/components/Carousel/Carousel.tsx"],"sourcesContent":["import {\n Children,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport styles from './Carousel.module.css';\n\n// ─── CarouselIndicatorDots ────────────────────────────────────────────────────\n\nexport interface CarouselIndicatorDotsProps extends HTMLAttributes<HTMLDivElement> {\n /** Total number of pages. */\n pages: number;\n /** Zero-based index of the current page. */\n currentPage: number;\n /** Called when the user clicks a dot. */\n onPageSelected?: (index: number) => void;\n}\n\n/**\n * Dot-style page indicator for `Carousel`.\n * Mirrors `AdwCarouselIndicatorDots`.\n */\nexport const CarouselIndicatorDots = ({\n pages,\n currentPage,\n onPageSelected,\n className,\n ...props\n}: CarouselIndicatorDotsProps) => {\n return (\n <div\n className={[styles.indicatorDots, className].filter(Boolean).join(' ')}\n role=\"tablist\"\n aria-label=\"Carousel pages\"\n {...props}\n >\n {Array.from({ length: pages }, (_, i) => (\n <button\n key={i}\n type=\"button\"\n role=\"tab\"\n aria-selected={i === currentPage}\n aria-label={`Page ${i + 1}`}\n className={[styles.dot, i === currentPage ? styles.dotActive : null]\n .filter(Boolean)\n .join(' ')}\n onClick={() => onPageSelected?.(i)}\n />\n ))}\n </div>\n );\n};\n\n// ─── CarouselIndicatorLines ───────────────────────────────────────────────────\n\nexport interface CarouselIndicatorLinesProps extends HTMLAttributes<HTMLDivElement> {\n /** Total number of pages. */\n pages: number;\n /** Zero-based index of the current page. */\n currentPage: number;\n /** Called when the user clicks a line. */\n onPageSelected?: (index: number) => void;\n}\n\n/**\n * Line-style page indicator for `Carousel`.\n * Mirrors `AdwCarouselIndicatorLines`.\n */\nexport const CarouselIndicatorLines = ({\n pages,\n currentPage,\n onPageSelected,\n className,\n ...props\n}: CarouselIndicatorLinesProps) => {\n return (\n <div\n className={[styles.indicatorLines, className].filter(Boolean).join(' ')}\n role=\"tablist\"\n aria-label=\"Carousel pages\"\n {...props}\n >\n {Array.from({ length: pages }, (_, i) => (\n <button\n key={i}\n type=\"button\"\n role=\"tab\"\n aria-selected={i === currentPage}\n aria-label={`Page ${i + 1}`}\n className={[styles.line, i === currentPage ? styles.lineActive : null]\n .filter(Boolean)\n .join(' ')}\n onClick={() => onPageSelected?.(i)}\n />\n ))}\n </div>\n );\n};\n\n// ─── Carousel ─────────────────────────────────────────────────────────────────\n\nexport interface CarouselProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n /**\n * Scroll orientation.\n * @default \"horizontal\"\n */\n orientation?: 'horizontal' | 'vertical';\n /**\n * Gap between pages in px.\n * @default 0\n */\n spacing?: number;\n /**\n * Allow infinite looping (wraps around on the last/first page).\n * @default false\n */\n loop?: boolean;\n /**\n * Number of slides visible at once. Supports fractional values (e.g. `1.5`)\n * to peek at the edge of the next slide.\n * @default 1\n */\n visibleSlides?: number;\n /** Called whenever the visible page changes. */\n onPageChanged?: (index: number) => void;\n /**\n * Controlled current page index.\n * When omitted the carousel manages page state internally.\n */\n page?: number;\n}\n\n/**\n * Swipeable content carousel.\n *\n * Mirrors `AdwCarousel`. Uses CSS scroll-snapping for smooth, native-feeling\n * page transitions. Supports keyboard navigation (arrow keys), touch/mouse drag,\n * and velocity-based flick gestures.\n *\n * Pair with `CarouselIndicatorDots` or `CarouselIndicatorLines` for pagination UI.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Carousel.html\n */\nexport const Carousel = ({\n children,\n orientation = 'horizontal',\n spacing = 0,\n loop = false,\n visibleSlides = 1,\n onPageChanged,\n page: controlledPage,\n className,\n ...props\n}: CarouselProps) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const pageCount = Children.count(children);\n const [internalPage, setInternalPage] = useState(0);\n const [isDragging, setIsDragging] = useState(false);\n const isControlled = controlledPage !== undefined;\n const currentPage = isControlled ? controlledPage : internalPage;\n\n // Refs for drag state — avoids stale closures in pointer handlers\n const draggingRef = useRef(false);\n const hasDraggedRef = useRef(false);\n const dragStartRef = useRef({ pos: 0, scroll: 0, time: 0 });\n const snapRestoreTimerRef = useRef(0);\n\n // Scroll distance per page: (containerSize - spacing*(visibleSlides-1)) / visibleSlides + spacing\n // Simplifies to: (containerSize + spacing) / visibleSlides\n const getPageSize = useCallback(() => {\n const el = scrollRef.current;\n if (!el) {\n return 1;\n }\n const containerSize = orientation === 'horizontal' ? el.clientWidth : el.clientHeight;\n return (containerSize + spacing) / visibleSlides;\n }, [orientation, spacing, visibleSlides]);\n\n const scrollToPage = useCallback(\n (index: number, behavior: ScrollBehavior = 'smooth') => {\n const el = scrollRef.current;\n if (!el) {\n return;\n }\n const offset = getPageSize() * index;\n if (orientation === 'horizontal') {\n el.scrollTo({ left: offset, behavior });\n } else {\n el.scrollTo({ top: offset, behavior });\n }\n },\n [orientation, getPageSize],\n );\n\n // Scroll to the controlled page when it changes externally\n useEffect(() => {\n if (!isControlled) {\n return;\n }\n scrollToPage(controlledPage, 'smooth');\n }, [controlledPage, scrollToPage, isControlled]);\n\n // Detect page changes from native scroll (touch) — skipped during mouse drag\n useEffect(() => {\n const el = scrollRef.current;\n if (!el) {\n return;\n }\n\n const handleScroll = () => {\n if (draggingRef.current) {\n return;\n }\n const pageSize = getPageSize();\n const scroll = orientation === 'horizontal' ? el.scrollLeft : el.scrollTop;\n const idx = Math.round(scroll / pageSize);\n const clamped = Math.max(0, Math.min(idx, pageCount - 1));\n if (!isControlled) {\n setInternalPage(clamped);\n }\n onPageChanged?.(clamped);\n };\n\n el.addEventListener('scroll', handleScroll, { passive: true });\n return () => el.removeEventListener('scroll', handleScroll);\n }, [orientation, pageCount, isControlled, onPageChanged, getPageSize]);\n\n // ── Keyboard navigation ───────────────────────────────────────────────────\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLDivElement>) => {\n const isForward =\n orientation === 'horizontal' ? e.key === 'ArrowRight' : e.key === 'ArrowDown';\n const isBack = orientation === 'horizontal' ? e.key === 'ArrowLeft' : e.key === 'ArrowUp';\n\n if (!isForward && !isBack) {\n return;\n }\n e.preventDefault();\n\n const next = isForward\n ? loop\n ? (currentPage + 1) % pageCount\n : Math.min(currentPage + 1, pageCount - 1)\n : loop\n ? (currentPage - 1 + pageCount) % pageCount\n : Math.max(currentPage - 1, 0);\n\n scrollToPage(next);\n if (!isControlled) {\n setInternalPage(next);\n }\n onPageChanged?.(next);\n },\n [currentPage, pageCount, loop, orientation, scrollToPage, isControlled, onPageChanged],\n );\n\n // ── Drag (mouse + touch + pen) ───────────────────────────────────────────\n\n const handlePointerDown = useCallback(\n (e: PointerEvent<HTMLDivElement>) => {\n // Ignore non-primary mouse buttons\n if (e.pointerType === 'mouse' && e.button !== 0) {\n return;\n }\n const el = scrollRef.current;\n if (!el) {\n return;\n }\n\n // Disable scroll-snap immediately via DOM — not via React state, which would\n // only apply after the next render, letting scroll-snap fight the first moves.\n window.clearTimeout(snapRestoreTimerRef.current);\n el.style.scrollSnapType = 'none';\n\n // Capture so pointermove/up fire even when the pointer leaves the element\n e.currentTarget.setPointerCapture(e.pointerId);\n draggingRef.current = true;\n hasDraggedRef.current = false;\n setIsDragging(true);\n dragStartRef.current = {\n pos: orientation === 'horizontal' ? e.clientX : e.clientY,\n scroll: orientation === 'horizontal' ? el.scrollLeft : el.scrollTop,\n time: Date.now(),\n };\n },\n [orientation],\n );\n\n const handlePointerMove = useCallback(\n (e: PointerEvent<HTMLDivElement>) => {\n if (!draggingRef.current) {\n return;\n }\n const el = scrollRef.current;\n if (!el) {\n return;\n }\n\n const pos = orientation === 'horizontal' ? e.clientX : e.clientY;\n const delta = dragStartRef.current.pos - pos;\n\n if (Math.abs(delta) > 4) {\n hasDraggedRef.current = true;\n }\n\n // Apply boundary resistance: dampen movement past first/last slide\n const maxScroll =\n orientation === 'horizontal'\n ? el.scrollWidth - el.clientWidth\n : el.scrollHeight - el.clientHeight;\n let newScroll = dragStartRef.current.scroll + delta;\n\n if (newScroll < 0) {\n newScroll *= 0.3;\n } else if (newScroll > maxScroll) {\n newScroll = maxScroll + (newScroll - maxScroll) * 0.3;\n }\n\n if (orientation === 'horizontal') {\n el.scrollLeft = newScroll;\n } else {\n el.scrollTop = newScroll;\n }\n },\n [orientation],\n );\n\n const handlePointerUp = useCallback(\n (e: PointerEvent<HTMLDivElement>) => {\n if (!draggingRef.current) {\n return;\n }\n\n draggingRef.current = false;\n setIsDragging(false);\n\n const el = scrollRef.current;\n\n if (!hasDraggedRef.current || !el) {\n // No real drag — restore snap immediately\n el?.style.removeProperty('scroll-snap-type');\n return;\n }\n\n const isCancel = e.type === 'pointercancel';\n const pos = isCancel\n ? dragStartRef.current.pos\n : orientation === 'horizontal'\n ? e.clientX\n : e.clientY;\n\n const delta = dragStartRef.current.pos - pos;\n const elapsed = Math.max(Date.now() - dragStartRef.current.time, 1);\n const velocity = isCancel ? 0 : delta / elapsed; // px/ms, positive = forward\n const pageSize = getPageSize();\n const scroll = orientation === 'horizontal' ? el.scrollLeft : el.scrollTop;\n\n let target: number;\n if (Math.abs(velocity) > 0.3) {\n // Flick gesture — advance in the swipe direction\n target = velocity > 0 ? Math.ceil(scroll / pageSize) : Math.floor(scroll / pageSize);\n } else {\n // Slow drag — snap to nearest page\n target = Math.round(scroll / pageSize);\n }\n\n if (loop) {\n target = ((target % pageCount) + pageCount) % pageCount;\n } else {\n target = Math.max(0, Math.min(target, pageCount - 1));\n }\n\n // Scroll to target while snap is still disabled, then re-enable once settled\n scrollToPage(target);\n if (!isControlled) {\n setInternalPage(target);\n }\n onPageChanged?.(target);\n\n // Re-enable snap after the smooth scroll animation completes (~300 ms)\n snapRestoreTimerRef.current = window.setTimeout(() => {\n el.style.removeProperty('scroll-snap-type');\n }, 350);\n },\n [orientation, getPageSize, loop, pageCount, scrollToPage, isControlled, onPageChanged],\n );\n\n // Clean up the snap-restore timer on unmount\n useEffect(() => {\n return () => window.clearTimeout(snapRestoreTimerRef.current);\n }, []);\n\n // Prevent click events that fire after a drag (e.g. links/buttons inside slides)\n const handleClick = useCallback((e: MouseEvent) => {\n if (hasDraggedRef.current) {\n e.preventDefault();\n e.stopPropagation();\n hasDraggedRef.current = false;\n }\n }, []);\n\n const isHorizontal = orientation === 'horizontal';\n\n // Slide width when showing more than one at a time\n const slideFlexBasis =\n visibleSlides !== 1\n ? `calc((100% - ${spacing * (visibleSlides - 1)}px) / ${visibleSlides})`\n : undefined;\n\n return (\n <div\n ref={scrollRef}\n role=\"region\"\n aria-roledescription=\"carousel\"\n tabIndex={0}\n className={[\n styles.carousel,\n isHorizontal ? styles.horizontal : styles.vertical,\n isDragging ? styles.dragging : null,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={isHorizontal ? { columnGap: spacing || undefined } : { rowGap: spacing || undefined }}\n onKeyDown={handleKeyDown}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerUp}\n onClick={handleClick}\n {...props}\n >\n {Children.map(children, (child, i) => (\n <div\n key={i}\n className={styles.slide}\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label={`${i + 1} of ${pageCount}`}\n style={slideFlexBasis ? { flex: `0 0 ${slideFlexBasis}` } : undefined}\n >\n {child}\n </div>\n ))}\n </div>\n );\n};\n"],"mappings":"mGA8BA,IAAa,GAAyB,CACpC,QACA,cACA,iBACA,YACA,GAAG,MAGD,EAAA,EAAA,KAAC,MAAD,CACE,UAAW,CAAC,EAAA,QAAO,cAAe,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EACrE,KAAK,UACL,aAAW,iBACX,GAAI,WAEH,MAAM,KAAK,CAAE,OAAQ,CAAM,GAAI,EAAG,KACjC,EAAA,EAAA,KAAC,SAAD,CAEE,KAAK,SACL,KAAK,MACL,gBAAe,IAAM,EACrB,aAAY,QAAQ,EAAI,IACxB,UAAW,CAAC,EAAA,QAAO,IAAK,IAAM,EAAc,EAAA,QAAO,UAAY,IAAI,EAChE,OAAO,OAAO,EACd,KAAK,GAAG,EACX,YAAe,IAAiB,CAAC,CAClC,EATM,CASN,CACF,CACE,CAAA,EAmBI,GAA0B,CACrC,QACA,cACA,iBACA,YACA,GAAG,MAGD,EAAA,EAAA,KAAC,MAAD,CACE,UAAW,CAAC,EAAA,QAAO,eAAgB,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EACtE,KAAK,UACL,aAAW,iBACX,GAAI,WAEH,MAAM,KAAK,CAAE,OAAQ,CAAM,GAAI,EAAG,KACjC,EAAA,EAAA,KAAC,SAAD,CAEE,KAAK,SACL,KAAK,MACL,gBAAe,IAAM,EACrB,aAAY,QAAQ,EAAI,IACxB,UAAW,CAAC,EAAA,QAAO,KAAM,IAAM,EAAc,EAAA,QAAO,WAAa,IAAI,EAClE,OAAO,OAAO,EACd,KAAK,GAAG,EACX,YAAe,IAAiB,CAAC,CAClC,EATM,CASN,CACF,CACE,CAAA,EAiDI,GAAY,CACvB,WACA,cAAc,aACd,UAAU,EACV,OAAO,GACP,gBAAgB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default false
|
|
43
43
|
*/
|
|
44
44
|
loop?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Number of slides visible at once. Supports fractional values (e.g. `1.5`)
|
|
47
|
+
* to peek at the edge of the next slide.
|
|
48
|
+
* @default 1
|
|
49
|
+
*/
|
|
50
|
+
visibleSlides?: number;
|
|
45
51
|
/** Called whenever the visible page changes. */
|
|
46
52
|
onPageChanged?: (index: number) => void;
|
|
47
53
|
/**
|
|
@@ -54,11 +60,11 @@ export interface CarouselProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
54
60
|
* Swipeable content carousel.
|
|
55
61
|
*
|
|
56
62
|
* Mirrors `AdwCarousel`. Uses CSS scroll-snapping for smooth, native-feeling
|
|
57
|
-
* page transitions. Supports keyboard navigation (arrow keys)
|
|
58
|
-
*
|
|
63
|
+
* page transitions. Supports keyboard navigation (arrow keys), touch/mouse drag,
|
|
64
|
+
* and velocity-based flick gestures.
|
|
59
65
|
*
|
|
60
66
|
* Pair with `CarouselIndicatorDots` or `CarouselIndicatorLines` for pagination UI.
|
|
61
67
|
*
|
|
62
68
|
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Carousel.html
|
|
63
69
|
*/
|
|
64
|
-
export declare const Carousel: ({ children, orientation, spacing, loop, onPageChanged, page: controlledPage, className, ...props }: CarouselProps) => import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
export declare const Carousel: ({ children, orientation, spacing, loop, visibleSlides, onPageChanged, page: controlledPage, className, ...props }: CarouselProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -28,75 +28,132 @@ var s = ({ pages: t, currentPage: n, onPageSelected: r, className: i, ...a }) =>
|
|
|
28
28
|
className: [e.line, i === n ? e.lineActive : null].filter(Boolean).join(" "),
|
|
29
29
|
onClick: () => r?.(i)
|
|
30
30
|
}, i))
|
|
31
|
-
}), l = ({ children: s, orientation: c = "horizontal", spacing: l = 0, loop: u = !1,
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
}), l = ({ children: s, orientation: c = "horizontal", spacing: l = 0, loop: u = !1, visibleSlides: d = 1, onPageChanged: f, page: p, className: m, ...h }) => {
|
|
32
|
+
let g = i(null), _ = t.count(s), [v, y] = a(0), [b, x] = a(!1), S = p !== void 0, C = S ? p : v, w = i(!1), T = i(!1), E = i({
|
|
33
|
+
pos: 0,
|
|
34
|
+
scroll: 0,
|
|
35
|
+
time: 0
|
|
36
|
+
}), D = i(0), O = n(() => {
|
|
37
|
+
let e = g.current;
|
|
38
|
+
return e ? ((c === "horizontal" ? e.clientWidth : e.clientHeight) + l) / d : 1;
|
|
39
|
+
}, [
|
|
40
|
+
c,
|
|
41
|
+
l,
|
|
42
|
+
d
|
|
43
|
+
]), k = n((e, t = "smooth") => {
|
|
44
|
+
let n = g.current;
|
|
45
|
+
if (!n) return;
|
|
46
|
+
let r = O() * e;
|
|
47
|
+
c === "horizontal" ? n.scrollTo({
|
|
48
|
+
left: r,
|
|
36
49
|
behavior: t
|
|
37
50
|
}) : n.scrollTo({
|
|
38
|
-
top:
|
|
51
|
+
top: r,
|
|
39
52
|
behavior: t
|
|
40
|
-
})
|
|
41
|
-
}, [c]);
|
|
53
|
+
});
|
|
54
|
+
}, [c, O]);
|
|
42
55
|
r(() => {
|
|
43
|
-
|
|
56
|
+
S && k(p, "smooth");
|
|
44
57
|
}, [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
58
|
+
p,
|
|
59
|
+
k,
|
|
60
|
+
S
|
|
48
61
|
]), r(() => {
|
|
49
|
-
let e =
|
|
62
|
+
let e = g.current;
|
|
50
63
|
if (!e) return;
|
|
51
64
|
let t = () => {
|
|
52
|
-
|
|
53
|
-
let t =
|
|
54
|
-
|
|
65
|
+
if (w.current) return;
|
|
66
|
+
let t = O(), n = c === "horizontal" ? e.scrollLeft : e.scrollTop, r = Math.round(n / t), i = Math.max(0, Math.min(r, _ - 1));
|
|
67
|
+
S || y(i), f?.(i);
|
|
55
68
|
};
|
|
56
69
|
return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
57
70
|
}, [
|
|
58
71
|
c,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
72
|
+
_,
|
|
73
|
+
S,
|
|
74
|
+
f,
|
|
75
|
+
O
|
|
62
76
|
]);
|
|
63
|
-
let
|
|
77
|
+
let A = n((e) => {
|
|
64
78
|
let t = c === "horizontal" ? e.key === "ArrowRight" : e.key === "ArrowDown", n = c === "horizontal" ? e.key === "ArrowLeft" : e.key === "ArrowUp";
|
|
65
|
-
if (t)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
} else if (n) {
|
|
70
|
-
e.preventDefault();
|
|
71
|
-
let t = u ? (b - 1 + g) % g : Math.max(b - 1, 0);
|
|
72
|
-
x(t), y || v(t), d?.(t);
|
|
73
|
-
}
|
|
79
|
+
if (!t && !n) return;
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
let r = t ? u ? (C + 1) % _ : Math.min(C + 1, _ - 1) : u ? (C - 1 + _) % _ : Math.max(C - 1, 0);
|
|
82
|
+
k(r), S || y(r), f?.(r);
|
|
74
83
|
}, [
|
|
75
|
-
|
|
76
|
-
|
|
84
|
+
C,
|
|
85
|
+
_,
|
|
77
86
|
u,
|
|
78
87
|
c,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
]),
|
|
88
|
+
k,
|
|
89
|
+
S,
|
|
90
|
+
f
|
|
91
|
+
]), j = n((e) => {
|
|
92
|
+
if (e.pointerType === "mouse" && e.button !== 0) return;
|
|
93
|
+
let t = g.current;
|
|
94
|
+
t && (window.clearTimeout(D.current), t.style.scrollSnapType = "none", e.currentTarget.setPointerCapture(e.pointerId), w.current = !0, T.current = !1, x(!0), E.current = {
|
|
95
|
+
pos: c === "horizontal" ? e.clientX : e.clientY,
|
|
96
|
+
scroll: c === "horizontal" ? t.scrollLeft : t.scrollTop,
|
|
97
|
+
time: Date.now()
|
|
98
|
+
});
|
|
99
|
+
}, [c]), M = n((e) => {
|
|
100
|
+
if (!w.current) return;
|
|
101
|
+
let t = g.current;
|
|
102
|
+
if (!t) return;
|
|
103
|
+
let n = c === "horizontal" ? e.clientX : e.clientY, r = E.current.pos - n;
|
|
104
|
+
Math.abs(r) > 4 && (T.current = !0);
|
|
105
|
+
let i = c === "horizontal" ? t.scrollWidth - t.clientWidth : t.scrollHeight - t.clientHeight, a = E.current.scroll + r;
|
|
106
|
+
a < 0 ? a *= .3 : a > i && (a = i + (a - i) * .3), c === "horizontal" ? t.scrollLeft = a : t.scrollTop = a;
|
|
107
|
+
}, [c]), N = n((e) => {
|
|
108
|
+
if (!w.current) return;
|
|
109
|
+
w.current = !1, x(!1);
|
|
110
|
+
let t = g.current;
|
|
111
|
+
if (!T.current || !t) {
|
|
112
|
+
t?.style.removeProperty("scroll-snap-type");
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
let n = e.type === "pointercancel", r = n ? E.current.pos : c === "horizontal" ? e.clientX : e.clientY, i = E.current.pos - r, a = Math.max(Date.now() - E.current.time, 1), o = n ? 0 : i / a, s = O(), l = c === "horizontal" ? t.scrollLeft : t.scrollTop, d;
|
|
116
|
+
d = Math.abs(o) > .3 ? o > 0 ? Math.ceil(l / s) : Math.floor(l / s) : Math.round(l / s), d = u ? (d % _ + _) % _ : Math.max(0, Math.min(d, _ - 1)), k(d), S || y(d), f?.(d), D.current = window.setTimeout(() => {
|
|
117
|
+
t.style.removeProperty("scroll-snap-type");
|
|
118
|
+
}, 350);
|
|
119
|
+
}, [
|
|
120
|
+
c,
|
|
121
|
+
O,
|
|
122
|
+
u,
|
|
123
|
+
_,
|
|
124
|
+
k,
|
|
125
|
+
S,
|
|
126
|
+
f
|
|
127
|
+
]);
|
|
128
|
+
r(() => () => window.clearTimeout(D.current), []);
|
|
129
|
+
let P = n((e) => {
|
|
130
|
+
T.current &&= (e.preventDefault(), e.stopPropagation(), !1);
|
|
131
|
+
}, []), F = c === "horizontal", I = d === 1 ? void 0 : `calc((100% - ${l * (d - 1)}px) / ${d})`;
|
|
83
132
|
return /* @__PURE__ */ o("div", {
|
|
84
|
-
ref:
|
|
133
|
+
ref: g,
|
|
85
134
|
role: "region",
|
|
86
135
|
"aria-roledescription": "carousel",
|
|
136
|
+
tabIndex: 0,
|
|
87
137
|
className: [
|
|
88
138
|
e.carousel,
|
|
89
|
-
|
|
90
|
-
|
|
139
|
+
F ? e.horizontal : e.vertical,
|
|
140
|
+
b ? e.dragging : null,
|
|
141
|
+
m
|
|
91
142
|
].filter(Boolean).join(" "),
|
|
92
|
-
style:
|
|
93
|
-
onKeyDown:
|
|
94
|
-
|
|
143
|
+
style: F ? { columnGap: l || void 0 } : { rowGap: l || void 0 },
|
|
144
|
+
onKeyDown: A,
|
|
145
|
+
onPointerDown: j,
|
|
146
|
+
onPointerMove: M,
|
|
147
|
+
onPointerUp: N,
|
|
148
|
+
onPointerCancel: N,
|
|
149
|
+
onClick: P,
|
|
150
|
+
...h,
|
|
95
151
|
children: t.map(s, (t, n) => /* @__PURE__ */ o("div", {
|
|
96
152
|
className: e.slide,
|
|
97
153
|
role: "group",
|
|
98
154
|
"aria-roledescription": "slide",
|
|
99
|
-
"aria-label": `${n + 1} of ${
|
|
155
|
+
"aria-label": `${n + 1} of ${_}`,
|
|
156
|
+
style: I ? { flex: `0 0 ${I}` } : void 0,
|
|
100
157
|
children: t
|
|
101
158
|
}, n))
|
|
102
159
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.js","names":[],"sources":["../../../src/components/Carousel/Carousel.tsx"],"sourcesContent":["import {\n Children,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport styles from './Carousel.module.css';\n\n// ─── CarouselIndicatorDots ────────────────────────────────────────────────────\n\nexport interface CarouselIndicatorDotsProps extends HTMLAttributes<HTMLDivElement> {\n /** Total number of pages. */\n pages: number;\n /** Zero-based index of the current page. */\n currentPage: number;\n /** Called when the user clicks a dot. */\n onPageSelected?: (index: number) => void;\n}\n\n/**\n * Dot-style page indicator for `Carousel`.\n * Mirrors `AdwCarouselIndicatorDots`.\n */\nexport const CarouselIndicatorDots = ({\n pages,\n currentPage,\n onPageSelected,\n className,\n ...props\n}: CarouselIndicatorDotsProps) => {\n return (\n <div\n className={[styles.indicatorDots, className].filter(Boolean).join(' ')}\n role=\"tablist\"\n aria-label=\"Carousel pages\"\n {...props}\n >\n {Array.from({ length: pages }, (_, i) => (\n <button\n key={i}\n type=\"button\"\n role=\"tab\"\n aria-selected={i === currentPage}\n aria-label={`Page ${i + 1}`}\n className={[styles.dot, i === currentPage ? styles.dotActive : null]\n .filter(Boolean)\n .join(' ')}\n onClick={() => onPageSelected?.(i)}\n />\n ))}\n </div>\n );\n};\n\n// ─── CarouselIndicatorLines ───────────────────────────────────────────────────\n\nexport interface CarouselIndicatorLinesProps extends HTMLAttributes<HTMLDivElement> {\n /** Total number of pages. */\n pages: number;\n /** Zero-based index of the current page. */\n currentPage: number;\n /** Called when the user clicks a line. */\n onPageSelected?: (index: number) => void;\n}\n\n/**\n * Line-style page indicator for `Carousel`.\n * Mirrors `AdwCarouselIndicatorLines`.\n */\nexport const CarouselIndicatorLines = ({\n pages,\n currentPage,\n onPageSelected,\n className,\n ...props\n}: CarouselIndicatorLinesProps) => {\n return (\n <div\n className={[styles.indicatorLines, className].filter(Boolean).join(' ')}\n role=\"tablist\"\n aria-label=\"Carousel pages\"\n {...props}\n >\n {Array.from({ length: pages }, (_, i) => (\n <button\n key={i}\n type=\"button\"\n role=\"tab\"\n aria-selected={i === currentPage}\n aria-label={`Page ${i + 1}`}\n className={[styles.line, i === currentPage ? styles.lineActive : null]\n .filter(Boolean)\n .join(' ')}\n onClick={() => onPageSelected?.(i)}\n />\n ))}\n </div>\n );\n};\n\n// ─── Carousel ─────────────────────────────────────────────────────────────────\n\nexport interface CarouselProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n /**\n * Scroll orientation.\n * @default \"horizontal\"\n */\n orientation?: 'horizontal' | 'vertical';\n /**\n * Gap between pages in px.\n * @default 0\n */\n spacing?: number;\n /**\n * Allow infinite looping (wraps around on the last/first page).\n * @default false\n */\n loop?: boolean;\n /** Called whenever the visible page changes. */\n onPageChanged?: (index: number) => void;\n /**\n * Controlled current page index.\n * When omitted the carousel manages page state internally.\n */\n page?: number;\n}\n\n/**\n * Swipeable content carousel.\n *\n * Mirrors `AdwCarousel`. Uses CSS scroll-snapping for smooth, native-feeling\n * page transitions. Supports keyboard navigation (arrow keys) and touch/mouse\n * drag via the browser's native scroll handling.\n *\n * Pair with `CarouselIndicatorDots` or `CarouselIndicatorLines` for pagination UI.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Carousel.html\n */\nexport const Carousel = ({\n children,\n orientation = 'horizontal',\n spacing = 0,\n loop = false,\n onPageChanged,\n page: controlledPage,\n className,\n ...props\n}: CarouselProps) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const pageCount = Children.count(children);\n const [internalPage, setInternalPage] = useState(0);\n const isControlled = controlledPage !== undefined;\n const currentPage = isControlled ? controlledPage : internalPage;\n\n const scrollToPage = useCallback(\n (index: number, behavior: ScrollBehavior = 'smooth') => {\n const el = scrollRef.current;\n\n if (!el) {\n return;\n }\n\n if (orientation === 'horizontal') {\n el.scrollTo({ left: el.clientWidth * index, behavior });\n } else {\n el.scrollTo({ top: el.clientHeight * index, behavior });\n }\n },\n [orientation],\n );\n\n // Scroll to the controlled page when it changes externally\n useEffect(() => {\n if (!isControlled) {\n return;\n }\n\n scrollToPage(controlledPage, 'smooth');\n }, [controlledPage, scrollToPage, isControlled]);\n\n // Detect page changes via IntersectionObserver on each child\n useEffect(() => {\n const el = scrollRef.current;\n\n if (!el) {\n return;\n }\n\n const handleScroll = () => {\n const pages = Array.from(el.children) as HTMLElement[];\n const size = orientation === 'horizontal' ? el.clientWidth : el.clientHeight;\n const scroll = orientation === 'horizontal' ? el.scrollLeft : el.scrollTop;\n const idx = Math.round(scroll / (size || 1));\n const clamped = Math.max(0, Math.min(idx, pageCount - 1));\n\n if (!isControlled) {\n setInternalPage(clamped);\n }\n\n onPageChanged?.(clamped);\n void pages; // suppress lint\n };\n\n el.addEventListener('scroll', handleScroll, { passive: true });\n\n return () => el.removeEventListener('scroll', handleScroll);\n }, [orientation, pageCount, isControlled, onPageChanged]);\n\n // Keyboard navigation\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n const isForward =\n orientation === 'horizontal' ? e.key === 'ArrowRight' : e.key === 'ArrowDown';\n const isBack = orientation === 'horizontal' ? e.key === 'ArrowLeft' : e.key === 'ArrowUp';\n\n if (isForward) {\n e.preventDefault();\n const next = loop\n ? (currentPage + 1) % pageCount\n : Math.min(currentPage + 1, pageCount - 1);\n\n scrollToPage(next);\n if (!isControlled) {\n setInternalPage(next);\n }\n\n onPageChanged?.(next);\n } else if (isBack) {\n e.preventDefault();\n const prev = loop\n ? (currentPage - 1 + pageCount) % pageCount\n : Math.max(currentPage - 1, 0);\n\n scrollToPage(prev);\n if (!isControlled) {\n setInternalPage(prev);\n }\n\n onPageChanged?.(prev);\n }\n },\n [currentPage, pageCount, loop, orientation, scrollToPage, isControlled, onPageChanged],\n );\n\n const isHorizontal = orientation === 'horizontal';\n\n return (\n <div\n ref={scrollRef}\n role=\"region\"\n aria-roledescription=\"carousel\"\n className={[styles.carousel, isHorizontal ? styles.horizontal : styles.vertical, className]\n .filter(Boolean)\n .join(' ')}\n style={isHorizontal ? { columnGap: spacing || undefined } : { rowGap: spacing || undefined }}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {Children.map(children, (child, i) => (\n <div\n key={i}\n className={styles.slide}\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label={`${i + 1} of ${pageCount}`}\n >\n {child}\n </div>\n ))}\n </div>\n );\n};\n"],"mappings":";;;;AA4BA,IAAa,KAA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AAa,CAAI,GACZ,KACH,EAAgB,CAAI,GAGtB,IAAgB,CAAI;EACtB;CACF,GACA;EAAC;EAAa;EAAW;EAAM;EAAa;EAAc;EAAc;CAAa,CACvF,GAEM,IAAe,MAAgB;CAErC,OACE,kBAAC,OAAD;EACE,KAAK;EACL,MAAK;EACL,wBAAqB;EACrB,WAAW;GAAC,EAAO;GAAU,IAAe,EAAO,aAAa,EAAO;GAAU;EAAS,EACvF,OAAO,OAAO,EACd,KAAK,GAAG;EACX,OAAO,IAAe,EAAE,WAAW,KAAW,KAAA,EAAU,IAAI,EAAE,QAAQ,KAAW,KAAA,EAAU;EAC3F,WAAW;EACX,GAAI;YAEH,EAAS,IAAI,IAAW,GAAO,MAC9B,kBAAC,OAAD;GAEE,WAAW,EAAO;GAClB,MAAK;GACL,wBAAqB;GACrB,cAAY,GAAG,IAAI,EAAE,MAAM;aAE1B;EACE,GAPE,CAOF,CACN;CACE,CAAA;AAET"}
|
|
1
|
+
{"version":3,"file":"Carousel.js","names":[],"sources":["../../../src/components/Carousel/Carousel.tsx"],"sourcesContent":["import {\n Children,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport styles from './Carousel.module.css';\n\n// ─── CarouselIndicatorDots ────────────────────────────────────────────────────\n\nexport interface CarouselIndicatorDotsProps extends HTMLAttributes<HTMLDivElement> {\n /** Total number of pages. */\n pages: number;\n /** Zero-based index of the current page. */\n currentPage: number;\n /** Called when the user clicks a dot. */\n onPageSelected?: (index: number) => void;\n}\n\n/**\n * Dot-style page indicator for `Carousel`.\n * Mirrors `AdwCarouselIndicatorDots`.\n */\nexport const CarouselIndicatorDots = ({\n pages,\n currentPage,\n onPageSelected,\n className,\n ...props\n}: CarouselIndicatorDotsProps) => {\n return (\n <div\n className={[styles.indicatorDots, className].filter(Boolean).join(' ')}\n role=\"tablist\"\n aria-label=\"Carousel pages\"\n {...props}\n >\n {Array.from({ length: pages }, (_, i) => (\n <button\n key={i}\n type=\"button\"\n role=\"tab\"\n aria-selected={i === currentPage}\n aria-label={`Page ${i + 1}`}\n className={[styles.dot, i === currentPage ? styles.dotActive : null]\n .filter(Boolean)\n .join(' ')}\n onClick={() => onPageSelected?.(i)}\n />\n ))}\n </div>\n );\n};\n\n// ─── CarouselIndicatorLines ───────────────────────────────────────────────────\n\nexport interface CarouselIndicatorLinesProps extends HTMLAttributes<HTMLDivElement> {\n /** Total number of pages. */\n pages: number;\n /** Zero-based index of the current page. */\n currentPage: number;\n /** Called when the user clicks a line. */\n onPageSelected?: (index: number) => void;\n}\n\n/**\n * Line-style page indicator for `Carousel`.\n * Mirrors `AdwCarouselIndicatorLines`.\n */\nexport const CarouselIndicatorLines = ({\n pages,\n currentPage,\n onPageSelected,\n className,\n ...props\n}: CarouselIndicatorLinesProps) => {\n return (\n <div\n className={[styles.indicatorLines, className].filter(Boolean).join(' ')}\n role=\"tablist\"\n aria-label=\"Carousel pages\"\n {...props}\n >\n {Array.from({ length: pages }, (_, i) => (\n <button\n key={i}\n type=\"button\"\n role=\"tab\"\n aria-selected={i === currentPage}\n aria-label={`Page ${i + 1}`}\n className={[styles.line, i === currentPage ? styles.lineActive : null]\n .filter(Boolean)\n .join(' ')}\n onClick={() => onPageSelected?.(i)}\n />\n ))}\n </div>\n );\n};\n\n// ─── Carousel ─────────────────────────────────────────────────────────────────\n\nexport interface CarouselProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n /**\n * Scroll orientation.\n * @default \"horizontal\"\n */\n orientation?: 'horizontal' | 'vertical';\n /**\n * Gap between pages in px.\n * @default 0\n */\n spacing?: number;\n /**\n * Allow infinite looping (wraps around on the last/first page).\n * @default false\n */\n loop?: boolean;\n /**\n * Number of slides visible at once. Supports fractional values (e.g. `1.5`)\n * to peek at the edge of the next slide.\n * @default 1\n */\n visibleSlides?: number;\n /** Called whenever the visible page changes. */\n onPageChanged?: (index: number) => void;\n /**\n * Controlled current page index.\n * When omitted the carousel manages page state internally.\n */\n page?: number;\n}\n\n/**\n * Swipeable content carousel.\n *\n * Mirrors `AdwCarousel`. Uses CSS scroll-snapping for smooth, native-feeling\n * page transitions. Supports keyboard navigation (arrow keys), touch/mouse drag,\n * and velocity-based flick gestures.\n *\n * Pair with `CarouselIndicatorDots` or `CarouselIndicatorLines` for pagination UI.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Carousel.html\n */\nexport const Carousel = ({\n children,\n orientation = 'horizontal',\n spacing = 0,\n loop = false,\n visibleSlides = 1,\n onPageChanged,\n page: controlledPage,\n className,\n ...props\n}: CarouselProps) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const pageCount = Children.count(children);\n const [internalPage, setInternalPage] = useState(0);\n const [isDragging, setIsDragging] = useState(false);\n const isControlled = controlledPage !== undefined;\n const currentPage = isControlled ? controlledPage : internalPage;\n\n // Refs for drag state — avoids stale closures in pointer handlers\n const draggingRef = useRef(false);\n const hasDraggedRef = useRef(false);\n const dragStartRef = useRef({ pos: 0, scroll: 0, time: 0 });\n const snapRestoreTimerRef = useRef(0);\n\n // Scroll distance per page: (containerSize - spacing*(visibleSlides-1)) / visibleSlides + spacing\n // Simplifies to: (containerSize + spacing) / visibleSlides\n const getPageSize = useCallback(() => {\n const el = scrollRef.current;\n if (!el) {\n return 1;\n }\n const containerSize = orientation === 'horizontal' ? el.clientWidth : el.clientHeight;\n return (containerSize + spacing) / visibleSlides;\n }, [orientation, spacing, visibleSlides]);\n\n const scrollToPage = useCallback(\n (index: number, behavior: ScrollBehavior = 'smooth') => {\n const el = scrollRef.current;\n if (!el) {\n return;\n }\n const offset = getPageSize() * index;\n if (orientation === 'horizontal') {\n el.scrollTo({ left: offset, behavior });\n } else {\n el.scrollTo({ top: offset, behavior });\n }\n },\n [orientation, getPageSize],\n );\n\n // Scroll to the controlled page when it changes externally\n useEffect(() => {\n if (!isControlled) {\n return;\n }\n scrollToPage(controlledPage, 'smooth');\n }, [controlledPage, scrollToPage, isControlled]);\n\n // Detect page changes from native scroll (touch) — skipped during mouse drag\n useEffect(() => {\n const el = scrollRef.current;\n if (!el) {\n return;\n }\n\n const handleScroll = () => {\n if (draggingRef.current) {\n return;\n }\n const pageSize = getPageSize();\n const scroll = orientation === 'horizontal' ? el.scrollLeft : el.scrollTop;\n const idx = Math.round(scroll / pageSize);\n const clamped = Math.max(0, Math.min(idx, pageCount - 1));\n if (!isControlled) {\n setInternalPage(clamped);\n }\n onPageChanged?.(clamped);\n };\n\n el.addEventListener('scroll', handleScroll, { passive: true });\n return () => el.removeEventListener('scroll', handleScroll);\n }, [orientation, pageCount, isControlled, onPageChanged, getPageSize]);\n\n // ── Keyboard navigation ───────────────────────────────────────────────────\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLDivElement>) => {\n const isForward =\n orientation === 'horizontal' ? e.key === 'ArrowRight' : e.key === 'ArrowDown';\n const isBack = orientation === 'horizontal' ? e.key === 'ArrowLeft' : e.key === 'ArrowUp';\n\n if (!isForward && !isBack) {\n return;\n }\n e.preventDefault();\n\n const next = isForward\n ? loop\n ? (currentPage + 1) % pageCount\n : Math.min(currentPage + 1, pageCount - 1)\n : loop\n ? (currentPage - 1 + pageCount) % pageCount\n : Math.max(currentPage - 1, 0);\n\n scrollToPage(next);\n if (!isControlled) {\n setInternalPage(next);\n }\n onPageChanged?.(next);\n },\n [currentPage, pageCount, loop, orientation, scrollToPage, isControlled, onPageChanged],\n );\n\n // ── Drag (mouse + touch + pen) ───────────────────────────────────────────\n\n const handlePointerDown = useCallback(\n (e: PointerEvent<HTMLDivElement>) => {\n // Ignore non-primary mouse buttons\n if (e.pointerType === 'mouse' && e.button !== 0) {\n return;\n }\n const el = scrollRef.current;\n if (!el) {\n return;\n }\n\n // Disable scroll-snap immediately via DOM — not via React state, which would\n // only apply after the next render, letting scroll-snap fight the first moves.\n window.clearTimeout(snapRestoreTimerRef.current);\n el.style.scrollSnapType = 'none';\n\n // Capture so pointermove/up fire even when the pointer leaves the element\n e.currentTarget.setPointerCapture(e.pointerId);\n draggingRef.current = true;\n hasDraggedRef.current = false;\n setIsDragging(true);\n dragStartRef.current = {\n pos: orientation === 'horizontal' ? e.clientX : e.clientY,\n scroll: orientation === 'horizontal' ? el.scrollLeft : el.scrollTop,\n time: Date.now(),\n };\n },\n [orientation],\n );\n\n const handlePointerMove = useCallback(\n (e: PointerEvent<HTMLDivElement>) => {\n if (!draggingRef.current) {\n return;\n }\n const el = scrollRef.current;\n if (!el) {\n return;\n }\n\n const pos = orientation === 'horizontal' ? e.clientX : e.clientY;\n const delta = dragStartRef.current.pos - pos;\n\n if (Math.abs(delta) > 4) {\n hasDraggedRef.current = true;\n }\n\n // Apply boundary resistance: dampen movement past first/last slide\n const maxScroll =\n orientation === 'horizontal'\n ? el.scrollWidth - el.clientWidth\n : el.scrollHeight - el.clientHeight;\n let newScroll = dragStartRef.current.scroll + delta;\n\n if (newScroll < 0) {\n newScroll *= 0.3;\n } else if (newScroll > maxScroll) {\n newScroll = maxScroll + (newScroll - maxScroll) * 0.3;\n }\n\n if (orientation === 'horizontal') {\n el.scrollLeft = newScroll;\n } else {\n el.scrollTop = newScroll;\n }\n },\n [orientation],\n );\n\n const handlePointerUp = useCallback(\n (e: PointerEvent<HTMLDivElement>) => {\n if (!draggingRef.current) {\n return;\n }\n\n draggingRef.current = false;\n setIsDragging(false);\n\n const el = scrollRef.current;\n\n if (!hasDraggedRef.current || !el) {\n // No real drag — restore snap immediately\n el?.style.removeProperty('scroll-snap-type');\n return;\n }\n\n const isCancel = e.type === 'pointercancel';\n const pos = isCancel\n ? dragStartRef.current.pos\n : orientation === 'horizontal'\n ? e.clientX\n : e.clientY;\n\n const delta = dragStartRef.current.pos - pos;\n const elapsed = Math.max(Date.now() - dragStartRef.current.time, 1);\n const velocity = isCancel ? 0 : delta / elapsed; // px/ms, positive = forward\n const pageSize = getPageSize();\n const scroll = orientation === 'horizontal' ? el.scrollLeft : el.scrollTop;\n\n let target: number;\n if (Math.abs(velocity) > 0.3) {\n // Flick gesture — advance in the swipe direction\n target = velocity > 0 ? Math.ceil(scroll / pageSize) : Math.floor(scroll / pageSize);\n } else {\n // Slow drag — snap to nearest page\n target = Math.round(scroll / pageSize);\n }\n\n if (loop) {\n target = ((target % pageCount) + pageCount) % pageCount;\n } else {\n target = Math.max(0, Math.min(target, pageCount - 1));\n }\n\n // Scroll to target while snap is still disabled, then re-enable once settled\n scrollToPage(target);\n if (!isControlled) {\n setInternalPage(target);\n }\n onPageChanged?.(target);\n\n // Re-enable snap after the smooth scroll animation completes (~300 ms)\n snapRestoreTimerRef.current = window.setTimeout(() => {\n el.style.removeProperty('scroll-snap-type');\n }, 350);\n },\n [orientation, getPageSize, loop, pageCount, scrollToPage, isControlled, onPageChanged],\n );\n\n // Clean up the snap-restore timer on unmount\n useEffect(() => {\n return () => window.clearTimeout(snapRestoreTimerRef.current);\n }, []);\n\n // Prevent click events that fire after a drag (e.g. links/buttons inside slides)\n const handleClick = useCallback((e: MouseEvent) => {\n if (hasDraggedRef.current) {\n e.preventDefault();\n e.stopPropagation();\n hasDraggedRef.current = false;\n }\n }, []);\n\n const isHorizontal = orientation === 'horizontal';\n\n // Slide width when showing more than one at a time\n const slideFlexBasis =\n visibleSlides !== 1\n ? `calc((100% - ${spacing * (visibleSlides - 1)}px) / ${visibleSlides})`\n : undefined;\n\n return (\n <div\n ref={scrollRef}\n role=\"region\"\n aria-roledescription=\"carousel\"\n tabIndex={0}\n className={[\n styles.carousel,\n isHorizontal ? styles.horizontal : styles.vertical,\n isDragging ? styles.dragging : null,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={isHorizontal ? { columnGap: spacing || undefined } : { rowGap: spacing || undefined }}\n onKeyDown={handleKeyDown}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerUp}\n onClick={handleClick}\n {...props}\n >\n {Children.map(children, (child, i) => (\n <div\n key={i}\n className={styles.slide}\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label={`${i + 1} of ${pageCount}`}\n style={slideFlexBasis ? { flex: `0 0 ${slideFlexBasis}` } : undefined}\n >\n {child}\n </div>\n ))}\n </div>\n );\n};\n"],"mappings":";;;;AA8BA,IAAa,KAAyB,EACpC,UACA,gBACA,mBACA,cACA,GAAG,QAGD,kBAAC,OAAD;CACE,WAAW,CAAC,EAAO,eAAe,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;CACrE,MAAK;CACL,cAAW;CACX,GAAI;WAEH,MAAM,KAAK,EAAE,QAAQ,EAAM,IAAI,GAAG,MACjC,kBAAC,UAAD;EAEE,MAAK;EACL,MAAK;EACL,iBAAe,MAAM;EACrB,cAAY,QAAQ,IAAI;EACxB,WAAW,CAAC,EAAO,KAAK,MAAM,IAAc,EAAO,YAAY,IAAI,EAChE,OAAO,OAAO,EACd,KAAK,GAAG;EACX,eAAe,IAAiB,CAAC;CAClC,GATM,CASN,CACF;AACE,CAAA,GAmBI,KAA0B,EACrC,UACA,gBACA,mBACA,cACA,GAAG,QAGD,kBAAC,OAAD;CACE,WAAW,CAAC,EAAO,gBAAgB,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;CACtE,MAAK;CACL,cAAW;CACX,GAAI;WAEH,MAAM,KAAK,EAAE,QAAQ,EAAM,IAAI,GAAG,MACjC,kBAAC,UAAD;EAEE,MAAK;EACL,MAAK;EACL,iBAAe,MAAM;EACrB,cAAY,QAAQ,IAAI;EACxB,WAAW,CAAC,EAAO,MAAM,MAAM,IAAc,EAAO,aAAa,IAAI,EAClE,OAAO,OAAO,EACd,KAAK,GAAG;EACX,eAAe,IAAiB,CAAC;CAClC,GATM,CASN,CACF;AACE,CAAA,GAiDI,KAAY,EACvB,aACA,iBAAc,cACd,aAAU,GACV,UAAO,IACP,mBAAgB,GAChB,kBACA,MAAM,GACN,cACA,GAAG,QACgB;CACnB,IAAM,IAAY,EAAuB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EAAc;CAAa,CACvF;CAGA,cACe,OAAO,aAAa,EAAoB,OAAO,GAC3D,CAAC,CAAC;CAGL,IAAM,IAAc,GAAa,MAAkB;EACjD,AAGE,EAAc,aAFd,EAAE,eAAe,GACjB,EAAE,gBAAgB,GACM;CAE5B,GAAG,CAAC,CAAC,GAEC,IAAe,MAAgB,cAG/B,IACJ,MAAkB,IAEd,KAAA,IADA,gBAAgB,KAAW,IAAgB,GAAG,QAAQ,EAAc;CAG1E,OACE,kBAAC,OAAD;EACE,KAAK;EACL,MAAK;EACL,wBAAqB;EACrB,UAAU;EACV,WAAW;GACT,EAAO;GACP,IAAe,EAAO,aAAa,EAAO;GAC1C,IAAa,EAAO,WAAW;GAC/B;EACF,EACG,OAAO,OAAO,EACd,KAAK,GAAG;EACX,OAAO,IAAe,EAAE,WAAW,KAAW,KAAA,EAAU,IAAI,EAAE,QAAQ,KAAW,KAAA,EAAU;EAC3F,WAAW;EACX,eAAe;EACf,eAAe;EACf,aAAa;EACb,iBAAiB;EACjB,SAAS;EACT,GAAI;YAEH,EAAS,IAAI,IAAW,GAAO,MAC9B,kBAAC,OAAD;GAEE,WAAW,EAAO;GAClB,MAAK;GACL,wBAAqB;GACrB,cAAY,GAAG,IAAI,EAAE,MAAM;GAC3B,OAAO,IAAiB,EAAE,MAAM,OAAO,IAAiB,IAAI,KAAA;aAE3D;EACE,GARE,CAQF,CACN;CACE,CAAA;AAET"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={carousel:`
|
|
1
|
+
var e={carousel:`_carousel_1yojd_3`,horizontal:`_horizontal_1yojd_25`,vertical:`_vertical_1yojd_34`,dragging:`_dragging_1yojd_44`,slide:`_slide_1yojd_53`,indicatorDots:`_indicatorDots_1yojd_62`,dot:`_dot_1yojd_70`,dotActive:`_dotActive_1yojd_89`,indicatorLines:`_indicatorLines_1yojd_101`,line:`_line_1yojd_109`,lineActive:`_lineActive_1yojd_126`};exports.default=e;
|
|
2
2
|
//# sourceMappingURL=Carousel.module.css.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.module.css.cjs","names":[],"sources":["../../../src/components/Carousel/Carousel.module.css"],"sourcesContent":["/* ─── Carousel container ────────────────────────────────────────────────────── */\n\n.carousel {\n display: flex;\n overflow: hidden;\n
|
|
1
|
+
{"version":3,"file":"Carousel.module.css.cjs","names":[],"sources":["../../../src/components/Carousel/Carousel.module.css"],"sourcesContent":["/* ─── Carousel container ────────────────────────────────────────────────────── */\n\n.carousel {\n display: flex;\n overflow: hidden;\n overscroll-behavior: contain;\n outline: none;\n width: 100%;\n cursor: grab;\n scrollbar-width: none; /* Firefox */\n}\n\n.carousel::-webkit-scrollbar {\n display: none; /* Chrome / Safari / Edge */\n}\n\n.carousel:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-window-bg-color, #fafafa),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 3px))\n var(--gnome-focus-ring-color, #3584e4);\n border-radius: var(--gnome-radius-md, 8px);\n}\n\n.horizontal {\n flex-direction: row;\n overflow: scroll hidden;\n scroll-snap-type: x mandatory;\n\n /* pan-y: browser handles vertical page scroll; we handle horizontal drag */\n touch-action: pan-y;\n}\n\n.vertical {\n flex-direction: column;\n overflow: hidden scroll;\n scroll-snap-type: y mandatory;\n\n /* pan-x: browser handles horizontal page scroll; we handle vertical drag */\n touch-action: pan-x;\n}\n\n/* Active mouse drag state */\n.dragging {\n cursor: grabbing;\n user-select: none;\n\n /* scroll-snap-type is disabled via inline style during drag */\n}\n\n/* ─── Slide ─────────────────────────────────────────────────────────────────── */\n\n.slide {\n flex: 0 0 100%;\n scroll-snap-align: start;\n min-width: 0;\n min-height: 0;\n}\n\n/* ─── Dot indicators ────────────────────────────────────────────────────────── */\n\n.indicatorDots {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: var(--gnome-space-2, 12px) 0;\n}\n\n.dot {\n appearance: none;\n border: none;\n padding: 0;\n cursor: pointer;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: var(--gnome-window-fg-color, rgb(0 0 0 / 0.8));\n opacity: 0.2;\n transition:\n opacity var(--gnome-duration-fast) var(--gnome-easing-default),\n transform var(--gnome-duration-fast) var(--gnome-easing-default);\n}\n\n.dot:hover {\n opacity: 0.5;\n}\n\n.dotActive {\n opacity: 1;\n transform: scale(1.15);\n}\n\n.dot:focus-visible {\n outline: 2px solid var(--gnome-focus-ring-color, #3584e4);\n outline-offset: 2px;\n}\n\n/* ─── Line indicators ───────────────────────────────────────────────────────── */\n\n.indicatorLines {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n padding: var(--gnome-space-2, 12px) 0;\n}\n\n.line {\n appearance: none;\n border: none;\n padding: 0;\n cursor: pointer;\n width: 24px;\n height: 3px;\n border-radius: 2px;\n background-color: var(--gnome-window-fg-color, rgb(0 0 0 / 0.8));\n opacity: 0.2;\n transition: opacity var(--gnome-duration-fast) var(--gnome-easing-default);\n}\n\n.line:hover {\n opacity: 0.5;\n}\n\n.lineActive {\n opacity: 1;\n}\n\n.line:focus-visible {\n outline: 2px solid var(--gnome-focus-ring-color, #3584e4);\n outline-offset: 2px;\n}\n\n/* ─── Reduced motion ────────────────────────────────────────────────────────── */\n\n@media (prefers-reduced-motion: reduce) {\n .carousel {\n scroll-behavior: auto;\n }\n\n .dot,\n .line {\n transition: none;\n }\n}\n"],"mappings":""}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
carousel: "
|
|
3
|
-
horizontal: "
|
|
4
|
-
vertical: "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
carousel: "_carousel_1yojd_3",
|
|
3
|
+
horizontal: "_horizontal_1yojd_25",
|
|
4
|
+
vertical: "_vertical_1yojd_34",
|
|
5
|
+
dragging: "_dragging_1yojd_44",
|
|
6
|
+
slide: "_slide_1yojd_53",
|
|
7
|
+
indicatorDots: "_indicatorDots_1yojd_62",
|
|
8
|
+
dot: "_dot_1yojd_70",
|
|
9
|
+
dotActive: "_dotActive_1yojd_89",
|
|
10
|
+
indicatorLines: "_indicatorLines_1yojd_101",
|
|
11
|
+
line: "_line_1yojd_109",
|
|
12
|
+
lineActive: "_lineActive_1yojd_126"
|
|
12
13
|
};
|
|
13
14
|
//#endregion
|
|
14
15
|
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.module.css.js","names":[],"sources":["../../../src/components/Carousel/Carousel.module.css"],"sourcesContent":["/* ─── Carousel container ────────────────────────────────────────────────────── */\n\n.carousel {\n display: flex;\n overflow: hidden;\n
|
|
1
|
+
{"version":3,"file":"Carousel.module.css.js","names":[],"sources":["../../../src/components/Carousel/Carousel.module.css"],"sourcesContent":["/* ─── Carousel container ────────────────────────────────────────────────────── */\n\n.carousel {\n display: flex;\n overflow: hidden;\n overscroll-behavior: contain;\n outline: none;\n width: 100%;\n cursor: grab;\n scrollbar-width: none; /* Firefox */\n}\n\n.carousel::-webkit-scrollbar {\n display: none; /* Chrome / Safari / Edge */\n}\n\n.carousel:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-window-bg-color, #fafafa),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 3px))\n var(--gnome-focus-ring-color, #3584e4);\n border-radius: var(--gnome-radius-md, 8px);\n}\n\n.horizontal {\n flex-direction: row;\n overflow: scroll hidden;\n scroll-snap-type: x mandatory;\n\n /* pan-y: browser handles vertical page scroll; we handle horizontal drag */\n touch-action: pan-y;\n}\n\n.vertical {\n flex-direction: column;\n overflow: hidden scroll;\n scroll-snap-type: y mandatory;\n\n /* pan-x: browser handles horizontal page scroll; we handle vertical drag */\n touch-action: pan-x;\n}\n\n/* Active mouse drag state */\n.dragging {\n cursor: grabbing;\n user-select: none;\n\n /* scroll-snap-type is disabled via inline style during drag */\n}\n\n/* ─── Slide ─────────────────────────────────────────────────────────────────── */\n\n.slide {\n flex: 0 0 100%;\n scroll-snap-align: start;\n min-width: 0;\n min-height: 0;\n}\n\n/* ─── Dot indicators ────────────────────────────────────────────────────────── */\n\n.indicatorDots {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: var(--gnome-space-2, 12px) 0;\n}\n\n.dot {\n appearance: none;\n border: none;\n padding: 0;\n cursor: pointer;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: var(--gnome-window-fg-color, rgb(0 0 0 / 0.8));\n opacity: 0.2;\n transition:\n opacity var(--gnome-duration-fast) var(--gnome-easing-default),\n transform var(--gnome-duration-fast) var(--gnome-easing-default);\n}\n\n.dot:hover {\n opacity: 0.5;\n}\n\n.dotActive {\n opacity: 1;\n transform: scale(1.15);\n}\n\n.dot:focus-visible {\n outline: 2px solid var(--gnome-focus-ring-color, #3584e4);\n outline-offset: 2px;\n}\n\n/* ─── Line indicators ───────────────────────────────────────────────────────── */\n\n.indicatorLines {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n padding: var(--gnome-space-2, 12px) 0;\n}\n\n.line {\n appearance: none;\n border: none;\n padding: 0;\n cursor: pointer;\n width: 24px;\n height: 3px;\n border-radius: 2px;\n background-color: var(--gnome-window-fg-color, rgb(0 0 0 / 0.8));\n opacity: 0.2;\n transition: opacity var(--gnome-duration-fast) var(--gnome-easing-default);\n}\n\n.line:hover {\n opacity: 0.5;\n}\n\n.lineActive {\n opacity: 1;\n}\n\n.line:focus-visible {\n outline: 2px solid var(--gnome-focus-ring-color, #3584e4);\n outline-offset: 2px;\n}\n\n/* ─── Reduced motion ────────────────────────────────────────────────────────── */\n\n@media (prefers-reduced-motion: reduce) {\n .carousel {\n scroll-behavior: auto;\n }\n\n .dot,\n .line {\n transition: none;\n }\n}\n"],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={row:`
|
|
1
|
+
var e={row:`_row_rq5l1_3`,disabled:`_disabled_rq5l1_38`,checkboxWrap:`_checkboxWrap_rq5l1_46`,checkbox:`_checkbox_rq5l1_46`,checkboxChecked:`_checkboxChecked_rq5l1_68`,checkmark:`_checkmark_rq5l1_74`,leading:`_leading_rq5l1_81`,content:`_content_rq5l1_90`,title:`_title_rq5l1_98`,subtitle:`_subtitle_rq5l1_109`};exports.default=e;
|
|
2
2
|
//# sourceMappingURL=CheckRow.module.css.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckRow.module.css.cjs","names":[],"sources":["../../../src/components/CheckRow/CheckRow.module.css"],"sourcesContent":["/* ─── Row button ────────────────────────────────────────────────────────────── */\n\n.row {\n display: flex;\n align-items: center;\n gap: var(--gnome-space-2, 12px);\n padding: var(--gnome-space-2, 12px) var(--gnome-space-4, 24px);\n min-height: 52px;\n width: 100%;\n
|
|
1
|
+
{"version":3,"file":"CheckRow.module.css.cjs","names":[],"sources":["../../../src/components/CheckRow/CheckRow.module.css"],"sourcesContent":["/* ─── Row button ────────────────────────────────────────────────────────────── */\n\n.row {\n display: flex;\n align-items: center;\n gap: var(--gnome-space-2, 12px);\n padding: var(--gnome-space-2, 12px) var(--gnome-space-4, 24px);\n min-height: 52px;\n width: 100%;\n appearance: none;\n background: transparent;\n border: none;\n font: inherit;\n outline: none;\n cursor: pointer;\n text-align: start;\n color: var(--gnome-card-fg-color, rgb(0 0 0 / 0.8));\n transition: background-color var(--gnome-duration-fast) var(--gnome-easing-default);\n}\n\n.row:hover {\n background-color: var(--gnome-hover-overlay);\n}\n\n.row:active {\n background-color: var(--gnome-active-overlay);\n}\n\n.row:focus-visible {\n box-shadow:\n inset 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-window-bg-color, #fafafa),\n inset 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 3px))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n/* ─── Disabled ──────────────────────────────────────────────────────────────── */\n\n.disabled {\n opacity: var(--gnome-opacity-disabled, 0.5);\n cursor: not-allowed;\n pointer-events: none;\n}\n\n/* ─── Checkbox visual ───────────────────────────────────────────────────────── */\n\n.checkboxWrap {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n\n.checkbox {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n border-radius: var(--gnome-radius-sm, 4px);\n border: 1.5px solid var(--gnome-border-subtle, rgb(0 0 0 / 0.25));\n background-color: transparent;\n color: transparent;\n transition:\n background-color var(--gnome-duration-fast) var(--gnome-easing-default),\n border-color var(--gnome-duration-fast) var(--gnome-easing-default),\n color var(--gnome-duration-fast) var(--gnome-easing-default);\n}\n\n.checkboxChecked {\n background-color: var(--gnome-accent-bg-color, #3584e4);\n border-color: var(--gnome-accent-bg-color, #3584e4);\n color: #fff;\n}\n\n.checkmark {\n display: block;\n flex-shrink: 0;\n}\n\n/* ─── Leading icon/avatar ───────────────────────────────────────────────────── */\n\n.leading {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n color: var(--gnome-window-fg-color, rgb(0 0 0 / 0.8));\n}\n\n/* ─── Text content ──────────────────────────────────────────────────────────── */\n\n.content {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n gap: 2px;\n}\n\n.title {\n font-family: var(--gnome-font-family);\n font-size: var(--gnome-font-size-body, 1rem);\n font-weight: var(--gnome-font-weight-normal, 400);\n line-height: var(--gnome-line-height-body, 1.5);\n color: var(--gnome-card-fg-color, rgb(0 0 0 / 0.8));\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.subtitle {\n font-family: var(--gnome-font-family);\n font-size: var(--gnome-font-size-caption, 0.75rem);\n font-weight: var(--gnome-font-weight-normal, 400);\n line-height: var(--gnome-line-height-body, 1.5);\n color: var(--gnome-window-fg-color, rgb(0 0 0 / 0.55));\n opacity: var(--gnome-opacity-dim, 0.55);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/* ─── High contrast ─────────────────────────────────────────────────────────── */\n\n@media (prefers-contrast: more) {\n .row:focus-visible {\n box-shadow:\n inset 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-window-bg-color, #fafafa),\n inset 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 3px))\n var(--gnome-focus-ring-color, #3584e4),\n inset 0 0 0\n calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 3px) + 1px)\n var(--gnome-window-bg-color, #fafafa);\n }\n\n .checkbox {\n border-width: 2px;\n }\n}\n\n/* ─── Reduced motion ────────────────────────────────────────────────────────── */\n\n@media (prefers-reduced-motion: reduce) {\n .checkbox {\n transition: none;\n }\n}\n"],"mappings":""}
|