@mrpelz/uikit-ish 7.13.1 → 7.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/style.css +0 -3
- package/dist/components/action-sheet/main.d.ts.map +1 -1
- package/dist/components/action-sheet/main.js +9 -6
- package/dist/components/action-sheet/main.js.map +1 -1
- package/dist/components/action-sheet/props.d.ts +2 -1
- package/dist/components/action-sheet/props.d.ts.map +1 -1
- package/dist/components/activity-view/style.css +17 -17
- package/dist/components/alert/main.d.ts.map +1 -1
- package/dist/components/alert/main.js +12 -4
- package/dist/components/alert/main.js.map +1 -1
- package/dist/components/alert/props.d.ts +2 -1
- package/dist/components/alert/props.d.ts.map +1 -1
- package/dist/components/alert/style.css +39 -15
- package/dist/components/avatar/style.css +2 -2
- package/dist/components/badge/style.css +1 -1
- package/dist/components/button/main.js +1 -1
- package/dist/components/button/main.js.map +1 -1
- package/dist/components/button/props.d.ts +3 -2
- package/dist/components/button/props.d.ts.map +1 -1
- package/dist/components/button/style.css +18 -29
- package/dist/components/card/buttons.d.ts +35 -0
- package/dist/components/card/buttons.d.ts.map +1 -0
- package/dist/components/card/buttons.js +60 -0
- package/dist/components/card/buttons.js.map +1 -0
- package/dist/components/card/channels.d.ts +43 -0
- package/dist/components/card/channels.d.ts.map +1 -0
- package/dist/components/card/channels.js +321 -0
- package/dist/components/card/channels.js.map +1 -0
- package/dist/components/card/color.d.ts +21 -0
- package/dist/components/card/color.d.ts.map +1 -0
- package/dist/components/card/color.js +100 -0
- package/dist/components/card/color.js.map +1 -0
- package/dist/components/card/main.d.ts +81 -0
- package/dist/components/card/main.d.ts.map +1 -0
- package/dist/components/card/main.js +91 -0
- package/dist/components/card/main.js.map +1 -0
- package/dist/components/card/parts.css +769 -0
- package/dist/components/card/press.d.ts +25 -0
- package/dist/components/card/press.d.ts.map +1 -0
- package/dist/components/card/press.js +111 -0
- package/dist/components/card/press.js.map +1 -0
- package/dist/components/card/progress.d.ts +43 -0
- package/dist/components/card/progress.d.ts.map +1 -0
- package/dist/components/card/progress.js +122 -0
- package/dist/components/card/progress.js.map +1 -0
- package/dist/components/card/props.d.ts +393 -0
- package/dist/components/card/props.d.ts.map +1 -0
- package/dist/components/card/props.js +2 -0
- package/dist/components/card/props.js.map +1 -0
- package/dist/components/card/root.d.ts +100 -0
- package/dist/components/card/root.d.ts.map +1 -0
- package/dist/components/card/root.js +388 -0
- package/dist/components/card/root.js.map +1 -0
- package/dist/components/card/rows.d.ts +19 -0
- package/dist/components/card/rows.d.ts.map +1 -0
- package/dist/components/card/rows.js +185 -0
- package/dist/components/card/rows.js.map +1 -0
- package/dist/components/card/segmented.d.ts +61 -0
- package/dist/components/card/segmented.d.ts.map +1 -0
- package/dist/components/card/segmented.js +289 -0
- package/dist/components/card/segmented.js.map +1 -0
- package/dist/components/card/shared.d.ts +55 -0
- package/dist/components/card/shared.d.ts.map +1 -0
- package/dist/components/card/shared.js +80 -0
- package/dist/components/card/shared.js.map +1 -0
- package/dist/components/card/slider.d.ts +16 -0
- package/dist/components/card/slider.d.ts.map +1 -0
- package/dist/components/card/slider.js +48 -0
- package/dist/components/card/slider.js.map +1 -0
- package/dist/components/card/stages.d.ts +18 -0
- package/dist/components/card/stages.d.ts.map +1 -0
- package/dist/components/card/stages.js +37 -0
- package/dist/components/card/stages.js.map +1 -0
- package/dist/components/card/style.css +959 -0
- package/dist/components/checkbox/style.css +10 -5
- package/dist/components/collapsible/style.css +0 -3
- package/dist/components/color-picker/color.d.ts +2 -2
- package/dist/components/color-picker/color.d.ts.map +1 -1
- package/dist/components/color-picker/color.js +7 -7
- package/dist/components/color-picker/color.js.map +1 -1
- package/dist/components/color-picker/main.d.ts +11 -5
- package/dist/components/color-picker/main.d.ts.map +1 -1
- package/dist/components/color-picker/main.js +147 -89
- package/dist/components/color-picker/main.js.map +1 -1
- package/dist/components/color-picker/props.d.ts +216 -6
- package/dist/components/color-picker/props.d.ts.map +1 -1
- package/dist/components/color-picker/style.css +12 -31
- package/dist/components/contextual-menu/main.d.ts +6 -2
- package/dist/components/contextual-menu/main.d.ts.map +1 -1
- package/dist/components/contextual-menu/main.js +67 -43
- package/dist/components/contextual-menu/main.js.map +1 -1
- package/dist/components/contextual-menu/props.d.ts +2 -1
- package/dist/components/contextual-menu/props.d.ts.map +1 -1
- package/dist/components/contextual-menu/style.css +64 -2
- package/dist/components/control-cards/main.d.ts +38 -0
- package/dist/components/control-cards/main.d.ts.map +1 -0
- package/dist/components/control-cards/main.js +196 -0
- package/dist/components/control-cards/main.js.map +1 -0
- package/dist/components/control-cards/props.d.ts +238 -0
- package/dist/components/control-cards/props.d.ts.map +1 -0
- package/dist/components/control-cards/props.js +2 -0
- package/dist/components/control-cards/props.js.map +1 -0
- package/dist/components/control-cards/style.css +2 -0
- package/dist/components/date-picker/main.d.ts +8 -3
- package/dist/components/date-picker/main.d.ts.map +1 -1
- package/dist/components/date-picker/main.js +73 -30
- package/dist/components/date-picker/main.js.map +1 -1
- package/dist/components/date-picker/pager.d.ts.map +1 -1
- package/dist/components/date-picker/pager.js +9 -2
- package/dist/components/date-picker/pager.js.map +1 -1
- package/dist/components/date-picker/props.d.ts +81 -5
- package/dist/components/date-picker/props.d.ts.map +1 -1
- package/dist/components/date-picker/style.css +25 -17
- package/dist/components/drawer/style.css +6 -0
- package/dist/components/edit-menu/main.d.ts +2 -1
- package/dist/components/edit-menu/main.d.ts.map +1 -1
- package/dist/components/edit-menu/main.js +8 -4
- package/dist/components/edit-menu/main.js.map +1 -1
- package/dist/components/edit-menu/style.css +2 -2
- package/dist/components/glass/backdrop.d.ts +75 -0
- package/dist/components/glass/backdrop.d.ts.map +1 -0
- package/dist/components/glass/backdrop.js +608 -0
- package/dist/components/glass/backdrop.js.map +1 -0
- package/dist/components/glass/gradient.d.ts +17 -0
- package/dist/components/glass/gradient.d.ts.map +1 -0
- package/dist/components/glass/gradient.js +233 -0
- package/dist/components/glass/gradient.js.map +1 -0
- package/dist/components/glass/main.d.ts +60 -6
- package/dist/components/glass/main.d.ts.map +1 -1
- package/dist/components/glass/main.js +100 -122
- package/dist/components/glass/main.js.map +1 -1
- package/dist/components/glass/marker.d.ts +66 -0
- package/dist/components/glass/marker.d.ts.map +1 -0
- package/dist/components/glass/marker.js +268 -0
- package/dist/components/glass/marker.js.map +1 -0
- package/dist/components/glass/props.d.ts +33 -7
- package/dist/components/glass/props.d.ts.map +1 -1
- package/dist/components/glass/style.css +172 -75
- package/dist/components/grid/dashes.d.ts +15 -0
- package/dist/components/grid/dashes.d.ts.map +1 -0
- package/dist/components/grid/dashes.js +37 -0
- package/dist/components/grid/dashes.js.map +1 -0
- package/dist/components/grid/edit.d.ts +11 -0
- package/dist/components/grid/edit.d.ts.map +1 -0
- package/dist/components/grid/edit.js +1066 -0
- package/dist/components/grid/edit.js.map +1 -0
- package/dist/components/grid/handle.d.ts +123 -0
- package/dist/components/grid/handle.d.ts.map +1 -0
- package/dist/components/grid/handle.js +194 -0
- package/dist/components/grid/handle.js.map +1 -0
- package/dist/components/grid/icons.d.ts +40 -0
- package/dist/components/grid/icons.d.ts.map +1 -0
- package/dist/components/grid/icons.js +140 -0
- package/dist/components/grid/icons.js.map +1 -0
- package/dist/components/grid/layout.d.ts +111 -0
- package/dist/components/grid/layout.d.ts.map +1 -0
- package/dist/components/grid/layout.js +1257 -0
- package/dist/components/grid/layout.js.map +1 -0
- package/dist/components/grid/main.d.ts +63 -0
- package/dist/components/grid/main.d.ts.map +1 -0
- package/dist/components/grid/main.js +1977 -0
- package/dist/components/grid/main.js.map +1 -0
- package/dist/components/grid/overlay.d.ts +24 -0
- package/dist/components/grid/overlay.d.ts.map +1 -0
- package/dist/components/grid/overlay.js +312 -0
- package/dist/components/grid/overlay.js.map +1 -0
- package/dist/components/grid/plan.d.ts +78 -0
- package/dist/components/grid/plan.d.ts.map +1 -0
- package/dist/components/grid/plan.js +249 -0
- package/dist/components/grid/plan.js.map +1 -0
- package/dist/components/grid/props.d.ts +579 -0
- package/dist/components/grid/props.d.ts.map +1 -0
- package/dist/components/grid/props.js +2 -0
- package/dist/components/grid/props.js.map +1 -0
- package/dist/components/grid/reshape.d.ts +60 -0
- package/dist/components/grid/reshape.d.ts.map +1 -0
- package/dist/components/grid/reshape.js +214 -0
- package/dist/components/grid/reshape.js.map +1 -0
- package/dist/components/grid/style.css +1323 -0
- package/dist/components/header/main.d.ts.map +1 -1
- package/dist/components/header/main.js +97 -10
- package/dist/components/header/main.js.map +1 -1
- package/dist/components/header/props.d.ts +2 -2
- package/dist/components/header/props.d.ts.map +1 -1
- package/dist/components/header/style.css +40 -49
- package/dist/components/index.d.ts +16 -10
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +11 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/island/main.d.ts +2 -2
- package/dist/components/island/main.d.ts.map +1 -1
- package/dist/components/island/main.js +193 -41
- package/dist/components/island/main.js.map +1 -1
- package/dist/components/island/props.d.ts +4 -2
- package/dist/components/island/props.d.ts.map +1 -1
- package/dist/components/island/style.css +50 -3
- package/dist/components/layout/main.d.ts +3 -6
- package/dist/components/layout/main.d.ts.map +1 -1
- package/dist/components/layout/main.js +225 -56
- package/dist/components/layout/main.js.map +1 -1
- package/dist/components/layout/props.d.ts +43 -2
- package/dist/components/layout/props.d.ts.map +1 -1
- package/dist/components/layout/style.css +81 -23
- package/dist/components/list/main.d.ts +8 -6
- package/dist/components/list/main.d.ts.map +1 -1
- package/dist/components/list/main.js +132 -24
- package/dist/components/list/main.js.map +1 -1
- package/dist/components/list/props.d.ts +25 -0
- package/dist/components/list/props.d.ts.map +1 -1
- package/dist/components/list/reorder.d.ts +50 -2
- package/dist/components/list/reorder.d.ts.map +1 -1
- package/dist/components/list/reorder.js +40 -17
- package/dist/components/list/reorder.js.map +1 -1
- package/dist/components/list/style.css +160 -75
- package/dist/components/menu/main.d.ts +9 -5
- package/dist/components/menu/main.d.ts.map +1 -1
- package/dist/components/menu/main.js +87 -9
- package/dist/components/menu/main.js.map +1 -1
- package/dist/components/menu/props.d.ts +14 -0
- package/dist/components/menu/props.d.ts.map +1 -1
- package/dist/components/menu/style.css +41 -31
- package/dist/components/navigation/main.d.ts.map +1 -1
- package/dist/components/navigation/main.js +35 -13
- package/dist/components/navigation/main.js.map +1 -1
- package/dist/components/navigation/style.css +7 -0
- package/dist/components/page/main.d.ts.map +1 -1
- package/dist/components/page/main.js +6 -3
- package/dist/components/page/main.js.map +1 -1
- package/dist/components/page/props.d.ts +3 -2
- package/dist/components/page/props.d.ts.map +1 -1
- package/dist/components/page/style.css +8 -4
- package/dist/components/page-control/main.d.ts.map +1 -1
- package/dist/components/page-control/main.js +32 -15
- package/dist/components/page-control/main.js.map +1 -1
- package/dist/components/page-control/props.d.ts +9 -3
- package/dist/components/page-control/props.d.ts.map +1 -1
- package/dist/components/page-control/style.css +36 -0
- package/dist/components/pager/main.d.ts +12 -0
- package/dist/components/pager/main.d.ts.map +1 -0
- package/dist/components/pager/main.js +368 -0
- package/dist/components/pager/main.js.map +1 -0
- package/dist/components/pager/props.d.ts +36 -0
- package/dist/components/pager/props.d.ts.map +1 -0
- package/dist/components/pager/props.js +2 -0
- package/dist/components/pager/props.js.map +1 -0
- package/dist/components/pager/style.css +42 -0
- package/dist/components/popover/main.d.ts +10 -4
- package/dist/components/popover/main.d.ts.map +1 -1
- package/dist/components/popover/main.js +30 -19
- package/dist/components/popover/main.js.map +1 -1
- package/dist/components/popover/props.d.ts +2 -0
- package/dist/components/popover/props.d.ts.map +1 -1
- package/dist/components/popover/style.css +6 -2
- package/dist/components/progress/main.d.ts.map +1 -1
- package/dist/components/progress/main.js +3 -2
- package/dist/components/progress/main.js.map +1 -1
- package/dist/components/progress/style.css +4 -10
- package/dist/components/roll/main.d.ts.map +1 -1
- package/dist/components/roll/main.js +5 -3
- package/dist/components/roll/main.js.map +1 -1
- package/dist/components/roll/style.css +2 -2
- package/dist/components/segmented/main.d.ts.map +1 -1
- package/dist/components/segmented/main.js +4 -4
- package/dist/components/segmented/main.js.map +1 -1
- package/dist/components/segmented/props.d.ts +5 -2
- package/dist/components/segmented/props.d.ts.map +1 -1
- package/dist/components/segmented/style.css +17 -8
- package/dist/components/settings/main.d.ts +48 -1
- package/dist/components/settings/main.d.ts.map +1 -1
- package/dist/components/settings/main.js +311 -66
- package/dist/components/settings/main.js.map +1 -1
- package/dist/components/settings/props.d.ts +46 -4
- package/dist/components/settings/props.d.ts.map +1 -1
- package/dist/components/settings/region.d.ts +3 -0
- package/dist/components/settings/region.d.ts.map +1 -0
- package/dist/components/settings/region.js +120 -0
- package/dist/components/settings/region.js.map +1 -0
- package/dist/components/settings/style.css +2 -2
- package/dist/components/sheet/main.d.ts.map +1 -1
- package/dist/components/sheet/main.js +156 -45
- package/dist/components/sheet/main.js.map +1 -1
- package/dist/components/sheet/props.d.ts +4 -2
- package/dist/components/sheet/props.d.ts.map +1 -1
- package/dist/components/sheet/snap.d.ts +54 -0
- package/dist/components/sheet/snap.d.ts.map +1 -1
- package/dist/components/sheet/snap.js +261 -23
- package/dist/components/sheet/snap.js.map +1 -1
- package/dist/components/sheet/style.css +171 -20
- package/dist/components/sidebar/main.d.ts +2 -1
- package/dist/components/sidebar/main.d.ts.map +1 -1
- package/dist/components/sidebar/main.js +18 -6
- package/dist/components/sidebar/main.js.map +1 -1
- package/dist/components/sidebar/props.d.ts +2 -1
- package/dist/components/sidebar/props.d.ts.map +1 -1
- package/dist/components/sidebar/style.css +78 -0
- package/dist/components/slider/main.d.ts.map +1 -1
- package/dist/components/slider/main.js +55 -10
- package/dist/components/slider/main.js.map +1 -1
- package/dist/components/slider/props.d.ts +1 -0
- package/dist/components/slider/props.d.ts.map +1 -1
- package/dist/components/slider/style.css +15 -6
- package/dist/components/stack/main.d.ts +8 -0
- package/dist/components/stack/main.d.ts.map +1 -0
- package/dist/components/stack/main.js +25 -0
- package/dist/components/stack/main.js.map +1 -0
- package/dist/components/stack/props.d.ts +42 -0
- package/dist/components/stack/props.d.ts.map +1 -0
- package/dist/components/stack/props.js +2 -0
- package/dist/components/stack/props.js.map +1 -0
- package/dist/components/stack/style.css +68 -0
- package/dist/components/stepper/main.d.ts +3 -1
- package/dist/components/stepper/main.d.ts.map +1 -1
- package/dist/components/stepper/main.js +4 -0
- package/dist/components/stepper/main.js.map +1 -1
- package/dist/components/stepper/style.css +2 -2
- package/dist/components/switch/main.d.ts.map +1 -1
- package/dist/components/switch/main.js +9 -3
- package/dist/components/switch/main.js.map +1 -1
- package/dist/components/switch/props.d.ts +4 -1
- package/dist/components/switch/props.d.ts.map +1 -1
- package/dist/components/symbol/main.d.ts.map +1 -1
- package/dist/components/symbol/main.js +5 -1
- package/dist/components/symbol/main.js.map +1 -1
- package/dist/components/symbol/props.d.ts +10 -0
- package/dist/components/symbol/props.d.ts.map +1 -1
- package/dist/components/symbol/style.css +21 -3
- package/dist/components/tab-bar/main.d.ts.map +1 -1
- package/dist/components/tab-bar/main.js +8 -5
- package/dist/components/tab-bar/main.js.map +1 -1
- package/dist/components/tab-bar/props.d.ts +16 -12
- package/dist/components/tab-bar/props.d.ts.map +1 -1
- package/dist/components/tab-bar/style.css +38 -21
- package/dist/components/text-field/main.d.ts.map +1 -1
- package/dist/components/text-field/main.js +6 -3
- package/dist/components/text-field/main.js.map +1 -1
- package/dist/components/text-field/style.css +28 -17
- package/dist/components/toolbar/main.d.ts +5 -2
- package/dist/components/toolbar/main.d.ts.map +1 -1
- package/dist/components/toolbar/main.js +19 -1
- package/dist/components/toolbar/main.js.map +1 -1
- package/dist/components/toolbar/props.d.ts +18 -3
- package/dist/components/toolbar/props.d.ts.map +1 -1
- package/dist/components/toolbar/style.css +127 -11
- package/dist/components/tooltip/main.d.ts +6 -1
- package/dist/components/tooltip/main.d.ts.map +1 -1
- package/dist/components/tooltip/main.js +13 -7
- package/dist/components/tooltip/main.js.map +1 -1
- package/dist/components/tooltip/style.css +2 -2
- package/dist/components/typography/main.d.ts +1 -0
- package/dist/components/typography/main.d.ts.map +1 -1
- package/dist/components/typography/main.js +1 -0
- package/dist/components/typography/main.js.map +1 -1
- package/dist/components/typography/sizes.css +456 -0
- package/dist/components/typography/style.css +24 -456
- package/dist/components/utils/main.d.ts +50 -4
- package/dist/components/utils/main.d.ts.map +1 -1
- package/dist/components/utils/main.js +113 -3
- package/dist/components/utils/main.js.map +1 -1
- package/dist/components/viewport/current.d.ts +15 -0
- package/dist/components/viewport/current.d.ts.map +1 -0
- package/dist/components/viewport/current.js +74 -0
- package/dist/components/viewport/current.js.map +1 -0
- package/dist/components/viewport/edge-effect.d.ts.map +1 -1
- package/dist/components/viewport/edge-effect.js +58 -26
- package/dist/components/viewport/edge-effect.js.map +1 -1
- package/dist/components/viewport/edge.d.ts +7 -4
- package/dist/components/viewport/edge.d.ts.map +1 -1
- package/dist/components/viewport/edge.js +21 -7
- package/dist/components/viewport/edge.js.map +1 -1
- package/dist/components/viewport/focus-scroll.d.ts +21 -0
- package/dist/components/viewport/focus-scroll.d.ts.map +1 -0
- package/dist/components/viewport/focus-scroll.js +273 -0
- package/dist/components/viewport/focus-scroll.js.map +1 -0
- package/dist/components/viewport/input.d.ts +39 -1
- package/dist/components/viewport/input.d.ts.map +1 -1
- package/dist/components/viewport/input.js +122 -13
- package/dist/components/viewport/input.js.map +1 -1
- package/dist/components/viewport/main.d.ts +16 -1
- package/dist/components/viewport/main.d.ts.map +1 -1
- package/dist/components/viewport/main.js +276 -50
- package/dist/components/viewport/main.js.map +1 -1
- package/dist/components/viewport/padding.d.ts +1 -1
- package/dist/components/viewport/padding.d.ts.map +1 -1
- package/dist/components/viewport/padding.js +2 -2
- package/dist/components/viewport/props.d.ts +12 -2
- package/dist/components/viewport/props.d.ts.map +1 -1
- package/dist/components/viewport/status-bar.d.ts +9 -0
- package/dist/components/viewport/status-bar.d.ts.map +1 -0
- package/dist/components/viewport/status-bar.js +131 -0
- package/dist/components/viewport/status-bar.js.map +1 -0
- package/dist/components/viewport/style.css +67 -16
- package/dist/styles.css +371 -279
- package/package.json +5 -4
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import './style.css';
|
|
3
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
4
|
+
import { createContext, forwardRef, useContext, useEffect, useLayoutEffect, useRef, useState, } from 'react';
|
|
5
|
+
import { cn, smoothScrollOf, useForwardedRef } from '../utils/main.js';
|
|
6
|
+
// A pager: full-size pages in a strip, side by side or one below another,
|
|
7
|
+
// snapping natively a page at a time (a finger, a trackpad's momentum;
|
|
8
|
+
// `scroll-snap-stop`), dragged by the mouse too. Its page is the one mostly
|
|
9
|
+
// in view, reported as it's scrolled (a page control following the swipe);
|
|
10
|
+
// a page set by the app is scrolled to (at once, motion reduced). As the
|
|
11
|
+
// months of a date picker (see date-picker/pager.ts): nothing's written to
|
|
12
|
+
// its scroll while it's held or moving (iOS's scrolling fights it), only at
|
|
13
|
+
// rest; its pages' sizes fractional (not `clientWidth`'s, rounded); its
|
|
14
|
+
// pages out of view inert, changed at rest.
|
|
15
|
+
// On a page: this close to it (px; sizes are fractional).
|
|
16
|
+
const onPage = 1.5;
|
|
17
|
+
// At rest (without `scrollend`, e.g. older Safari): scrolls quiet this
|
|
18
|
+
// long (ms).
|
|
19
|
+
const restQuiet = 120;
|
|
20
|
+
// Scrolled to by the app: settled at the latest after this long (ms).
|
|
21
|
+
const settleLatest = 800;
|
|
22
|
+
// A key's scroll (see `reason`): within this long of it (ms).
|
|
23
|
+
const keyWindow = 1000;
|
|
24
|
+
// Dragged by the mouse: flicked this fast at least (px per ms), from this
|
|
25
|
+
// far (px).
|
|
26
|
+
const dragFlick = 0.4;
|
|
27
|
+
const dragSlop = 8;
|
|
28
|
+
/** Its axis's scroll position, size and direction (right to left: -1). */
|
|
29
|
+
const axisOf = (element, orientation) => {
|
|
30
|
+
const isVertical = orientation === 'vertical';
|
|
31
|
+
const style = getComputedStyle(element);
|
|
32
|
+
const direction = !isVertical && style.direction === 'rtl' ? -1 : 1;
|
|
33
|
+
// (As laid out, fractional; not transformed, e.g. a popover's scaling.)
|
|
34
|
+
const size = Number.parseFloat(isVertical ? style.height : style.width) || 1;
|
|
35
|
+
return {
|
|
36
|
+
direction,
|
|
37
|
+
get scroll() {
|
|
38
|
+
return isVertical ? element.scrollTop : element.scrollLeft;
|
|
39
|
+
},
|
|
40
|
+
set scroll(value) {
|
|
41
|
+
if (isVertical)
|
|
42
|
+
element.scrollTop = value;
|
|
43
|
+
else
|
|
44
|
+
element.scrollLeft = value;
|
|
45
|
+
},
|
|
46
|
+
size,
|
|
47
|
+
/** Scrolls to a page. */
|
|
48
|
+
to: (page, behavior) => element.scrollTo({
|
|
49
|
+
behavior,
|
|
50
|
+
[isVertical ? 'top' : 'left']: page * size * direction,
|
|
51
|
+
}),
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
/** The page at its scroll position, and how far off it (px). */
|
|
55
|
+
const pageAt = (element, orientation) => {
|
|
56
|
+
const { scroll, size } = axisOf(element, orientation);
|
|
57
|
+
const offset = Math.abs(scroll) / size;
|
|
58
|
+
const page = Math.min(Math.max(Math.round(offset), 0), Math.max(element.children.length - 1, 0));
|
|
59
|
+
return { off: Math.abs(offset - page) * size, page };
|
|
60
|
+
};
|
|
61
|
+
/** Not also the click a drag's released with. */
|
|
62
|
+
const swallow = (event) => event.stopPropagation();
|
|
63
|
+
/**
|
|
64
|
+
* Its strip dragged by the mouse (as by a finger; not snapping meanwhile):
|
|
65
|
+
* released, scrolled to the nearer page, or flicked, on to the next; not
|
|
66
|
+
* also the click it's released with.
|
|
67
|
+
*/
|
|
68
|
+
const useMouseDrag = (ref, orientation, strip) => {
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
const { current: element } = ref;
|
|
71
|
+
if (!element)
|
|
72
|
+
return undefined;
|
|
73
|
+
const isVertical = orientation === 'vertical';
|
|
74
|
+
let drag;
|
|
75
|
+
let start = { x: 0, y: 0 };
|
|
76
|
+
let timer;
|
|
77
|
+
// Snapping again, settled.
|
|
78
|
+
const done = () => {
|
|
79
|
+
clearTimeout(timer);
|
|
80
|
+
element.removeEventListener('scrollend', done);
|
|
81
|
+
element.style.removeProperty('scroll-snap-type');
|
|
82
|
+
strip.current.isHeld = false;
|
|
83
|
+
strip.current.settle();
|
|
84
|
+
};
|
|
85
|
+
const onDown = (event) => {
|
|
86
|
+
if (event.pointerType !== 'mouse' || event.button !== 0)
|
|
87
|
+
return;
|
|
88
|
+
done();
|
|
89
|
+
start = { x: event.clientX, y: event.clientY };
|
|
90
|
+
drag = {
|
|
91
|
+
at: isVertical ? event.clientY : event.clientX,
|
|
92
|
+
isMoved: false,
|
|
93
|
+
time: event.timeStamp,
|
|
94
|
+
velocity: 0,
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
const onMove = (event) => {
|
|
98
|
+
if (!drag)
|
|
99
|
+
return;
|
|
100
|
+
const along = isVertical ? event.clientY : event.clientX;
|
|
101
|
+
if (!drag.isMoved) {
|
|
102
|
+
const dx = event.clientX - start.x;
|
|
103
|
+
const dy = event.clientY - start.y;
|
|
104
|
+
if (Math.hypot(dx, dy) < dragSlop)
|
|
105
|
+
return;
|
|
106
|
+
// Across its axis first (e.g. selecting text, a page scrolled): not
|
|
107
|
+
// a drag.
|
|
108
|
+
if (Math.abs(isVertical ? dx : dy) > Math.abs(isVertical ? dy : dx)) {
|
|
109
|
+
drag = undefined;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
drag.isMoved = true;
|
|
113
|
+
strip.current.isHeld = true;
|
|
114
|
+
element.style.scrollSnapType = 'none';
|
|
115
|
+
element.setPointerCapture(event.pointerId);
|
|
116
|
+
}
|
|
117
|
+
const axis = axisOf(element, orientation);
|
|
118
|
+
const before = axis.scroll;
|
|
119
|
+
axis.scroll = before - (along - drag.at);
|
|
120
|
+
drag.velocity =
|
|
121
|
+
(axis.scroll - before) / Math.max(1, event.timeStamp - drag.time);
|
|
122
|
+
drag.time = event.timeStamp;
|
|
123
|
+
drag.at = along;
|
|
124
|
+
};
|
|
125
|
+
const onUp = () => {
|
|
126
|
+
const moved = drag;
|
|
127
|
+
drag = undefined;
|
|
128
|
+
if (!moved?.isMoved)
|
|
129
|
+
return;
|
|
130
|
+
element.addEventListener('click', swallow, { capture: true, once: true });
|
|
131
|
+
setTimeout(() => element.removeEventListener('click', swallow, true));
|
|
132
|
+
const axis = axisOf(element, orientation);
|
|
133
|
+
const offset = Math.abs(axis.scroll) / axis.size;
|
|
134
|
+
const towards = moved.velocity * axis.direction;
|
|
135
|
+
const flicked = Math.abs(moved.velocity) > dragFlick
|
|
136
|
+
? (towards > 0 ? Math.ceil : Math.floor)(offset)
|
|
137
|
+
: Math.round(offset);
|
|
138
|
+
const page = Math.min(Math.max(flicked, 0), element.children.length - 1);
|
|
139
|
+
axis.to(page, smoothScrollOf(element));
|
|
140
|
+
element.addEventListener('scrollend', done);
|
|
141
|
+
timer = setTimeout(done, settleLatest);
|
|
142
|
+
};
|
|
143
|
+
const listeners = [
|
|
144
|
+
['pointerdown', onDown],
|
|
145
|
+
['pointermove', onMove],
|
|
146
|
+
['pointerup', onUp],
|
|
147
|
+
['pointercancel', onUp],
|
|
148
|
+
];
|
|
149
|
+
for (const [type, listener] of listeners) {
|
|
150
|
+
element.addEventListener(type, listener);
|
|
151
|
+
}
|
|
152
|
+
return () => {
|
|
153
|
+
done();
|
|
154
|
+
for (const [type, listener] of listeners) {
|
|
155
|
+
element.removeEventListener(type, listener);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}, [orientation, ref, strip]);
|
|
159
|
+
};
|
|
160
|
+
/** Its pages' shared state: the page at rest (the others inert). */
|
|
161
|
+
const SettledContext = createContext(undefined);
|
|
162
|
+
/** Full-size pages, snapping a page at a time. */
|
|
163
|
+
const Root = forwardRef(({ className, defaultValue = 0, onValueChange, orientation = 'horizontal', render, value: valueProp, ...props }, forwardedRef) => {
|
|
164
|
+
const ref = useForwardedRef(forwardedRef);
|
|
165
|
+
const [state, setState] = useState(defaultValue);
|
|
166
|
+
const value = valueProp ?? state;
|
|
167
|
+
// The page at rest (its pages not inert, see `Page`).
|
|
168
|
+
const [settled, setSettled] = useState(value);
|
|
169
|
+
// The page it's at, or going to, as last reported or set (a `value`
|
|
170
|
+
// the same: its own report, nothing to scroll to); a page the app set,
|
|
171
|
+
// being scrolled to (not reported on the way); one set while it's held
|
|
172
|
+
// or moving, scrolled to at rest.
|
|
173
|
+
const reported = useRef(value);
|
|
174
|
+
const target = useRef(undefined);
|
|
175
|
+
const pending = useRef(undefined);
|
|
176
|
+
const strip = useRef({ isHeld: false, settle: () => undefined });
|
|
177
|
+
const moving = useRef(false);
|
|
178
|
+
const keyAt = useRef(-Infinity);
|
|
179
|
+
const latest = useRef({ onValueChange, valueProp });
|
|
180
|
+
useLayoutEffect(() => {
|
|
181
|
+
latest.current = { onValueChange, valueProp };
|
|
182
|
+
});
|
|
183
|
+
const goTo = (page, isInstant) => {
|
|
184
|
+
const { current: element } = ref;
|
|
185
|
+
if (!element)
|
|
186
|
+
return;
|
|
187
|
+
const at = pageAt(element, orientation);
|
|
188
|
+
if (at.page === page && at.off <= onPage) {
|
|
189
|
+
target.current = undefined;
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
target.current = isInstant ? undefined : page;
|
|
193
|
+
axisOf(element, orientation).to(page, isInstant ? 'instant' : smoothScrollOf(element));
|
|
194
|
+
};
|
|
195
|
+
// Shown on its page (at once) as it's laid out.
|
|
196
|
+
useLayoutEffect(() => {
|
|
197
|
+
goTo(reported.current, true);
|
|
198
|
+
// (Once: then by `value`, below.)
|
|
199
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
200
|
+
}, [orientation]);
|
|
201
|
+
// A page set by the app: scrolled to (at rest; held or moving, then).
|
|
202
|
+
useLayoutEffect(() => {
|
|
203
|
+
if (value === reported.current)
|
|
204
|
+
return;
|
|
205
|
+
reported.current = value;
|
|
206
|
+
if (strip.current.isHeld || moving.current) {
|
|
207
|
+
pending.current = value;
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
goTo(value, false);
|
|
211
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
212
|
+
}, [value]);
|
|
213
|
+
useEffect(() => {
|
|
214
|
+
const { current: element } = ref;
|
|
215
|
+
if (!element)
|
|
216
|
+
return undefined;
|
|
217
|
+
let rest;
|
|
218
|
+
let targetLatest;
|
|
219
|
+
const report = (page, event) => {
|
|
220
|
+
if (page === reported.current)
|
|
221
|
+
return;
|
|
222
|
+
reported.current = page;
|
|
223
|
+
if (latest.current.valueProp === undefined)
|
|
224
|
+
setState(page);
|
|
225
|
+
const reason = event.timeStamp - keyAt.current < keyWindow ? 'keyboard' : 'swipe';
|
|
226
|
+
latest.current.onValueChange?.(page, { event, reason });
|
|
227
|
+
};
|
|
228
|
+
// At rest (not held, on a page): its pages' inert ones changed, a
|
|
229
|
+
// page set meanwhile scrolled to.
|
|
230
|
+
const settle = () => {
|
|
231
|
+
clearTimeout(rest);
|
|
232
|
+
if (strip.current.isHeld)
|
|
233
|
+
return;
|
|
234
|
+
moving.current = false;
|
|
235
|
+
const at = pageAt(element, orientation);
|
|
236
|
+
if (at.off > onPage)
|
|
237
|
+
return;
|
|
238
|
+
target.current = undefined;
|
|
239
|
+
clearTimeout(targetLatest);
|
|
240
|
+
setSettled(at.page);
|
|
241
|
+
const { current: next } = pending;
|
|
242
|
+
pending.current = undefined;
|
|
243
|
+
if (next !== undefined && next !== at.page)
|
|
244
|
+
goTo(next, false);
|
|
245
|
+
};
|
|
246
|
+
strip.current.settle = settle;
|
|
247
|
+
const onScroll = (event) => {
|
|
248
|
+
moving.current = true;
|
|
249
|
+
clearTimeout(rest);
|
|
250
|
+
rest = setTimeout(settle, restQuiet);
|
|
251
|
+
// Scrolled to by the app: not reported on the way (unless held:
|
|
252
|
+
// taken over by a finger).
|
|
253
|
+
if (target.current !== undefined && !strip.current.isHeld) {
|
|
254
|
+
clearTimeout(targetLatest);
|
|
255
|
+
targetLatest = setTimeout(() => {
|
|
256
|
+
target.current = undefined;
|
|
257
|
+
}, settleLatest);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
report(pageAt(element, orientation).page, event);
|
|
261
|
+
};
|
|
262
|
+
const onTouchStart = () => {
|
|
263
|
+
strip.current.isHeld = true;
|
|
264
|
+
target.current = undefined;
|
|
265
|
+
};
|
|
266
|
+
const onTouchEnd = (event) => {
|
|
267
|
+
strip.current.isHeld = event.touches.length > 0;
|
|
268
|
+
clearTimeout(rest);
|
|
269
|
+
rest = setTimeout(settle, restQuiet);
|
|
270
|
+
};
|
|
271
|
+
const onKeyDown = (event) => {
|
|
272
|
+
keyAt.current = event.timeStamp;
|
|
273
|
+
};
|
|
274
|
+
// Resized (e.g. rotated, laid out once shown): on its page again
|
|
275
|
+
// (not while held).
|
|
276
|
+
let laidOut = 0;
|
|
277
|
+
const resizes = new ResizeObserver(() => {
|
|
278
|
+
const { size } = axisOf(element, orientation);
|
|
279
|
+
if (size === laidOut || strip.current.isHeld)
|
|
280
|
+
return;
|
|
281
|
+
laidOut = size;
|
|
282
|
+
goTo(reported.current, true);
|
|
283
|
+
});
|
|
284
|
+
resizes.observe(element);
|
|
285
|
+
const listeners = [
|
|
286
|
+
['scroll', onScroll],
|
|
287
|
+
['scrollend', settle],
|
|
288
|
+
['touchstart', onTouchStart],
|
|
289
|
+
['touchend', onTouchEnd],
|
|
290
|
+
['touchcancel', onTouchEnd],
|
|
291
|
+
['keydown', onKeyDown],
|
|
292
|
+
];
|
|
293
|
+
for (const [type, listener] of listeners) {
|
|
294
|
+
element.addEventListener(type, listener, {
|
|
295
|
+
passive: true,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
return () => {
|
|
299
|
+
clearTimeout(rest);
|
|
300
|
+
clearTimeout(targetLatest);
|
|
301
|
+
resizes.disconnect();
|
|
302
|
+
for (const [type, listener] of listeners) {
|
|
303
|
+
element.removeEventListener(type, listener);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
307
|
+
}, [orientation, ref]);
|
|
308
|
+
useMouseDrag(ref, orientation, strip);
|
|
309
|
+
const element = useRender({
|
|
310
|
+
defaultTagName: 'div',
|
|
311
|
+
props: {
|
|
312
|
+
'aria-roledescription': 'carousel',
|
|
313
|
+
role: 'region',
|
|
314
|
+
...props,
|
|
315
|
+
className: cn('uikit-pager-root', className),
|
|
316
|
+
'data-orientation': orientation,
|
|
317
|
+
'data-pager-part': 'root',
|
|
318
|
+
},
|
|
319
|
+
ref,
|
|
320
|
+
render,
|
|
321
|
+
});
|
|
322
|
+
return (_jsx(SettledContext.Provider, { value: settled, children: element }));
|
|
323
|
+
});
|
|
324
|
+
/**
|
|
325
|
+
* A page: as large as its pager, snapping; out of view at rest, inert.
|
|
326
|
+
* Named by its place ('2 of 5') unless named otherwise.
|
|
327
|
+
*/
|
|
328
|
+
const Page = forwardRef(({ 'aria-label': ariaLabel, className, render, ...props }, forwardedRef) => {
|
|
329
|
+
const ref = useForwardedRef(forwardedRef);
|
|
330
|
+
const settled = useContext(SettledContext);
|
|
331
|
+
// Its place among its pager's pages (by the DOM: pages may come from
|
|
332
|
+
// any components), as rendered: read each render (its siblings may
|
|
333
|
+
// have changed), set only as it changed.
|
|
334
|
+
const [place, setPlace] = useState({ count: 0, index: -1 });
|
|
335
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
336
|
+
useLayoutEffect(() => {
|
|
337
|
+
const { current: element } = ref;
|
|
338
|
+
const parent = element?.parentElement;
|
|
339
|
+
if (!element || !parent)
|
|
340
|
+
return;
|
|
341
|
+
const index = [...parent.children].indexOf(element);
|
|
342
|
+
const { length: count } = parent.children;
|
|
343
|
+
if (index !== place.index || count !== place.count) {
|
|
344
|
+
setPlace({ count, index });
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
return useRender({
|
|
348
|
+
defaultTagName: 'div',
|
|
349
|
+
props: {
|
|
350
|
+
'aria-label': ariaLabel ??
|
|
351
|
+
(place.index === -1
|
|
352
|
+
? undefined
|
|
353
|
+
: `${String(place.index + 1)} of ${String(place.count)}`),
|
|
354
|
+
'aria-roledescription': 'slide',
|
|
355
|
+
inert: settled !== undefined &&
|
|
356
|
+
place.index !== -1 &&
|
|
357
|
+
place.index !== settled,
|
|
358
|
+
role: 'group',
|
|
359
|
+
...props,
|
|
360
|
+
className: cn('uikit-pager-page', className),
|
|
361
|
+
'data-pager-part': 'page',
|
|
362
|
+
},
|
|
363
|
+
ref,
|
|
364
|
+
render,
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
export const Pager = { Page, Root };
|
|
368
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/components/pager/main.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,aAAa,EACb,UAAU,EAEV,UAAU,EACV,SAAS,EACT,eAAe,EACf,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAevE,0EAA0E;AAC1E,uEAAuE;AACvE,4EAA4E;AAC5E,2EAA2E;AAC3E,yEAAyE;AACzE,2EAA2E;AAC3E,4EAA4E;AAC5E,wEAAwE;AACxE,4CAA4C;AAE5C,0DAA0D;AAC1D,MAAM,MAAM,GAAG,GAAG,CAAC;AAEnB,uEAAuE;AACvE,aAAa;AACb,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB,sEAAsE;AACtE,MAAM,YAAY,GAAG,GAAG,CAAC;AAEzB,8DAA8D;AAC9D,MAAM,SAAS,GAAG,IAAI,CAAC;AAEvB,0EAA0E;AAC1E,YAAY;AACZ,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MA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MAAM;KACP,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
/** A pager's direction: pages side by side, or one below another. */
|
|
3
|
+
export type PagerOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
/** Why its page changed: scrolled (a finger, a trackpad, the mouse), or a key. */
|
|
5
|
+
export type PagerChangeEventDetails = {
|
|
6
|
+
event: Event;
|
|
7
|
+
reason: 'keyboard' | 'swipe';
|
|
8
|
+
};
|
|
9
|
+
export type PagerRootProps = Omit<useRender.ComponentProps<'div'>, 'defaultValue' | 'onChange'> & {
|
|
10
|
+
/** The initially current page (uncontrolled; from 0). */
|
|
11
|
+
defaultValue?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Called with the page mostly in view (from 0) as it's scrolled, and why;
|
|
14
|
+
* not while it's scrolled to a `value` set by the app.
|
|
15
|
+
*/
|
|
16
|
+
onValueChange?: (page: number, eventDetails: PagerChangeEventDetails) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Its direction: pages side by side (swiped sideways), or one below
|
|
19
|
+
* another (swiped up and down; it needs a height, e.g. its container's).
|
|
20
|
+
* @default 'horizontal'
|
|
21
|
+
*/
|
|
22
|
+
orientation?: PagerOrientation;
|
|
23
|
+
/**
|
|
24
|
+
* The current page (controlled; from 0). Set by the app (e.g. a page
|
|
25
|
+
* control's), it's scrolled to (at once, motion reduced).
|
|
26
|
+
*/
|
|
27
|
+
value?: number;
|
|
28
|
+
};
|
|
29
|
+
export type PagerPageProps = useRender.ComponentProps<'div'> & {
|
|
30
|
+
/**
|
|
31
|
+
* Its accessible name.
|
|
32
|
+
* @default its place, e.g. '2 of 5'
|
|
33
|
+
*/
|
|
34
|
+
'aria-label'?: string;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/components/pager/props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qEAAqE;AACrE,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,UAAU,CAAC;AAEzD,kFAAkF;AAClF,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,EAC/B,cAAc,GAAG,UAAU,CAC5B,GAAG;IACF,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC9E;;;;OAIG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7D;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../src/components/pager/props.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* Pager (see main.tsx). */
|
|
2
|
+
@layer uikit-ish {
|
|
3
|
+
/* A strip of pages, as wide as its container (as high, vertical: it
|
|
4
|
+
needs a height), scrolling along its axis, snapping a page at a time;
|
|
5
|
+
its scrolls kept to itself (not chained to a page's), its bars hidden. */
|
|
6
|
+
.uikit-pager-root {
|
|
7
|
+
display: flex;
|
|
8
|
+
overflow: auto hidden;
|
|
9
|
+
min-width: 0;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
inline-size: 100%;
|
|
12
|
+
overscroll-behavior-x: contain;
|
|
13
|
+
scroll-snap-type: x mandatory;
|
|
14
|
+
scrollbar-width: none;
|
|
15
|
+
|
|
16
|
+
&::-webkit-scrollbar {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&[data-orientation='vertical'] {
|
|
21
|
+
overflow: hidden auto;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
block-size: 100%;
|
|
24
|
+
overscroll-behavior: auto contain;
|
|
25
|
+
scroll-snap-type: y mandatory;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* A page: as large as its pager, snapping at its start, one a fling. */
|
|
30
|
+
.uikit-pager-page {
|
|
31
|
+
min-width: 0;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
flex: none;
|
|
34
|
+
inline-size: 100%;
|
|
35
|
+
scroll-snap-align: start;
|
|
36
|
+
scroll-snap-stop: always;
|
|
37
|
+
|
|
38
|
+
:where(.uikit-pager-root[data-orientation='vertical']) > & {
|
|
39
|
+
block-size: 100%;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -3,10 +3,16 @@ import '../menu/style.css';
|
|
|
3
3
|
import './style.css';
|
|
4
4
|
import { Popover as BasePopover } from '@base-ui/react/popover';
|
|
5
5
|
import { ReactElement } from 'react';
|
|
6
|
-
import
|
|
7
|
-
|
|
6
|
+
import { type GlassSurfaceProps } from '../glass/main.js';
|
|
7
|
+
import type { PopoverArrowProps, PopoverBodyProps, PopoverHandle, PopoverHeaderProps, PopoverPositionerProps } from './props.js';
|
|
8
|
+
export type { PopoverAlign, PopoverArrowProps, PopoverBodyProps, PopoverHandle, PopoverHeaderProps, PopoverPositionerProps, } from './props.js';
|
|
8
9
|
/** `Popover.createHandle`, in a component: made once, for its lifetime. */
|
|
9
10
|
export declare const useCreatePopoverHandle: <Payload = unknown>() => PopoverHandle<Payload>;
|
|
11
|
+
/**
|
|
12
|
+
* A popover (Base UI's `Popover`):
|
|
13
|
+
* a panel of the menus' glass at its trigger (or `anchor`), optionally with
|
|
14
|
+
* an arrow pointing at it.
|
|
15
|
+
*/
|
|
10
16
|
export declare const Popover: {
|
|
11
17
|
Root: <Payload>({ onOpenChange, ...props }: BasePopover.Root.Props<Payload>) => ReactElement;
|
|
12
18
|
Portal: import("preact").FunctionalComponent<import("react").PropsWithoutRef<Omit<import("@base-ui/react/popover").PopoverPortalProps, "ref">> & {
|
|
@@ -15,7 +21,7 @@ export declare const Popover: {
|
|
|
15
21
|
Positioner: import("preact").FunctionalComponent<import("react").PropsWithoutRef<PopoverPositionerProps> & {
|
|
16
22
|
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
17
23
|
}>;
|
|
18
|
-
Popup: import("preact").FunctionalComponent<import("react").PropsWithoutRef<Omit<import("@base-ui/react/popover").PopoverPopupProps, "ref"
|
|
24
|
+
Popup: import("preact").FunctionalComponent<import("react").PropsWithoutRef<Omit<import("@base-ui/react/popover").PopoverPopupProps, "ref"> & GlassSurfaceProps> & {
|
|
19
25
|
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
20
26
|
}>;
|
|
21
27
|
Arrow: import("preact").FunctionalComponent<import("react").PropsWithoutRef<PopoverArrowProps> & {
|
|
@@ -24,7 +30,7 @@ export declare const Popover: {
|
|
|
24
30
|
Header: import("preact").FunctionalComponent<import("react").PropsWithoutRef<PopoverHeaderProps> & {
|
|
25
31
|
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
26
32
|
}>;
|
|
27
|
-
Body: import("preact").FunctionalComponent<import("react").PropsWithoutRef<
|
|
33
|
+
Body: import("preact").FunctionalComponent<import("react").PropsWithoutRef<PopoverBodyProps> & {
|
|
28
34
|
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
29
35
|
}>;
|
|
30
36
|
createHandle: <Payload = unknown>() => PopoverHandle<Payload>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/popover/main.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/popover/main.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAGL,YAAY,EAOb,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,kBAAkB,CAAC;AAsB1B,OAAO,KAAK,EAEV,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EAEvB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AA0EpB,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,GACjC,OAAO,GAAG,OAAO,OACd,aAAa,CAAC,OAAO,CAGzB,CAAC;AA8YF;;;;GAIG;AACH,eAAO,MAAM,OAAO;WAxcN,OAAO,8BAGlB,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAG,YAAY;;;;;;;;;;;;;;;;;;;mBAyC3B,OAAO,iBAAgB,aAAa,CAAC,OAAO,CAAC;;;;;;;;CAsalE,CAAC"}
|
|
@@ -4,14 +4,14 @@ import '../menu/style.css';
|
|
|
4
4
|
import './style.css';
|
|
5
5
|
import { Popover as BasePopover } from '@base-ui/react/popover';
|
|
6
6
|
import { createContext, forwardRef, useCallback, useContext, useLayoutEffect, useMemo, useState, } from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { colorSchemeStyle, useGlassMode, useGlassScheme, } from '../glass/main.js';
|
|
8
|
+
import { ColorSchemeScope, useSettingsPortalProps } from '../settings/main.js';
|
|
8
9
|
import { cn, positionerSide, useCollision, useForwardedRef, useGrowAvoidance, useInitialFocus, usePortalContainer, withStyle, } from '../utils/main.js';
|
|
9
|
-
import { EdgeEffects, useAnchorRegistration, useScrollerRegistration, ViewportInsetContext, ViewportScopeContext, } from '../viewport/main.js';
|
|
10
|
-
// A panel with 13px
|
|
11
|
-
//
|
|
12
|
-
// its
|
|
13
|
-
//
|
|
14
|
-
// (see `DatePicker`): 8px from its anchor (its arrow's tip, with an arrow)
|
|
10
|
+
import { EdgeEffects, useAnchorRegistration, useCurrentLayer, useScrollerRegistration, useVisualViewport, Viewport, ViewportInsetContext, ViewportScopeContext, } from '../viewport/main.js';
|
|
11
|
+
// A panel with 13px corners, its arrow a rounded wedge 56px wide, 13px
|
|
12
|
+
// deep, on any side, at its start, center or end (Base UI's `Arrow`,
|
|
13
|
+
// pointing at its anchor's center), a glow along its outline (a drop
|
|
14
|
+
// shadow, see style.css). After the date picker's popover (see `DatePicker`): 8px from its anchor (its arrow's tip, with an arrow)
|
|
15
15
|
// and from the viewport's edges; centered (in a list row, aligned with
|
|
16
16
|
// the row's end: the app's `align`); scaling in from its anchor (as
|
|
17
17
|
// menus). Its bar (`Header`): 16px from its top.
|
|
@@ -66,10 +66,15 @@ const arrowDepth = 13;
|
|
|
66
66
|
const Positioner = forwardRef(({ align = 'center', className, collisionBoundary, collisionPadding, side, sideOffset, ...props }, forwardedRef) => {
|
|
67
67
|
const context = useContext(PopoverContext);
|
|
68
68
|
const ref = useForwardedRef(forwardedRef);
|
|
69
|
-
|
|
69
|
+
// (Clear of the home indicator, unless the keyboard covers it.)
|
|
70
|
+
const { keyboardInset } = useVisualViewport();
|
|
71
|
+
const collision = useCollision({ collisionBoundary, collisionPadding }, undefined, keyboardInset);
|
|
70
72
|
// Growing rather than scrolling (unless its own is given).
|
|
71
73
|
const [grow, growRef, isShifted] = useGrowAvoidance({}, ref);
|
|
72
|
-
return (_jsx(ShiftedContext.Provider, { value: isShifted, children: _jsx(BasePopover.Positioner, { ref: growRef, align: align, ...collision, collisionAvoidance: grow,
|
|
74
|
+
return (_jsx(ShiftedContext.Provider, { value: isShifted, children: _jsx(BasePopover.Positioner, { ref: growRef, align: align, ...collision, collisionAvoidance: grow,
|
|
75
|
+
// Lifted clear of the keyboard (as a whole) while a field in it is
|
|
76
|
+
// typed into (see Viewport's `KeyboardAccessory`).
|
|
77
|
+
render: _jsx(Viewport.KeyboardAccessory, {}), side: positionerSide(side), sideOffset: sideOffset ?? 8 + (context?.hasArrow ? arrowDepth : 0), ...props, className: cn('uikit-popover-positioner', className) }) }));
|
|
73
78
|
});
|
|
74
79
|
// The arrow's wedge: rounded at its tip and where it meets the popup, 28px
|
|
75
80
|
// to either side of its center; narrower (at least 10px) where that would
|
|
@@ -164,12 +169,14 @@ const outlines = Object.fromEntries([undefined, 'top', 'right', 'bottom', 'left'
|
|
|
164
169
|
];
|
|
165
170
|
}));
|
|
166
171
|
/** Its panel: the material (see above) behind its content. */
|
|
167
|
-
const Popup = forwardRef(({ className, children, initialFocus, style, ...props }, ref) => {
|
|
172
|
+
const Popup = forwardRef(({ className, children, context, initialFocus, style, ...props }, ref) => {
|
|
168
173
|
const popupRef = useForwardedRef(ref);
|
|
169
174
|
const focus = useInitialFocus(popupRef);
|
|
175
|
+
// Its glass's tone, its content's color scheme (see Glass).
|
|
176
|
+
const scheme = useGlassScheme(popupRef, context);
|
|
170
177
|
// Its anchors' scope (its header's): fixed to it (see Viewport.Padding).
|
|
171
178
|
const [scope] = useState(() => ({}));
|
|
172
|
-
return (_jsxs(BasePopover.Popup, { ref: popupRef, initialFocus: initialFocus ?? focus, style: withStyle(outlines, style), ...props, "data-popover-part": "popup", className: cn('uikit-popover-popup uikit-glass-medium uikit-popup-transition', className), children: [_jsxs("span", { "aria-hidden": "true", className: "uikit-popover-shape", "data-popover-part": "shape", children: [_jsx("span", { "data-layer": "fill" }), _jsx("span", { "data-layer": "rim" }), _jsx("span", { "data-layer": "highlight" })] }), _jsx(ViewportScopeContext.Provider, { value: scope, children: _jsx(ViewportInsetContext.Provider, { value: true, children: children }) })] }));
|
|
179
|
+
return (_jsxs(BasePopover.Popup, { ref: popupRef, "data-color-scheme": scheme, initialFocus: initialFocus ?? focus, style: withStyle({ ...outlines, ...colorSchemeStyle(scheme) }, style), ...props, "data-popover-part": "popup", className: cn('uikit-popover-popup uikit-glass-medium uikit-popup-transition', className), children: [_jsxs("span", { "aria-hidden": "true", className: "uikit-popover-shape", "data-popover-part": "shape", children: [_jsx("span", { "data-layer": "fill" }), _jsx("span", { "data-layer": "rim" }), _jsx("span", { "data-layer": "highlight" })] }), _jsx(ViewportScopeContext.Provider, { value: scope, children: _jsx(ViewportInsetContext.Provider, { value: true, children: _jsx(ColorSchemeScope, { colorScheme: scheme, children: children }) }) })] }));
|
|
173
180
|
});
|
|
174
181
|
/**
|
|
175
182
|
* The arrow's (physical) side of its popup: facing its anchor, away from the
|
|
@@ -285,22 +292,26 @@ const Header = forwardRef(({ className, edgeEffect = 'soft', edgeTint, ...props
|
|
|
285
292
|
* `Viewport`): beside it, not in it, so its mask (fading it out under the
|
|
286
293
|
* header, see style.css) leaves it be.
|
|
287
294
|
*/
|
|
288
|
-
const Body = forwardRef(({ className, ...props }, forwardedRef) => {
|
|
295
|
+
const Body = forwardRef(({ className, glass = 'auto', ...props }, forwardedRef) => {
|
|
289
296
|
const ref = useForwardedRef(forwardedRef);
|
|
290
|
-
|
|
291
|
-
|
|
297
|
+
// (An overlay's: never what a provider tracks, see Viewport.)
|
|
298
|
+
useScrollerRegistration(ref, true, true);
|
|
299
|
+
// (the current scroller while open, see Viewport's `useCurrentScroller`.)
|
|
300
|
+
useCurrentLayer(ref, 'overlay');
|
|
301
|
+
const glassMode = useGlassMode(ref, glass, false);
|
|
302
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: ref, className: cn('uikit-popover-body', className), "data-glass": glassMode, "data-popover-part": "body", "data-viewport-scroller": "", ...props }), _jsx(EdgeEffects, { scroller: ref })] }));
|
|
292
303
|
});
|
|
293
|
-
/**
|
|
294
|
-
* A popover (Base UI's `Popover`):
|
|
295
|
-
* a panel of the menus' glass at its trigger (or `anchor`), optionally with
|
|
296
|
-
* an arrow pointing at it.
|
|
297
|
-
*/
|
|
298
304
|
/**
|
|
299
305
|
* Its portal (Base UI's): no box of its own (\`display: contents\`), so
|
|
300
306
|
* rendered into a container (e.g. a screen laid out as a flex column) it
|
|
301
307
|
* doesn't shift its content.
|
|
302
308
|
*/
|
|
303
309
|
const Portal = forwardRef(({ className, container, ...props }, ref) => (_jsx(BasePopover.Portal, { ref: ref, ...useSettingsPortalProps(), container: usePortalContainer(container), ...props, className: cn('uikit-popover-portal', className) })));
|
|
310
|
+
/**
|
|
311
|
+
* A popover (Base UI's `Popover`):
|
|
312
|
+
* a panel of the menus' glass at its trigger (or `anchor`), optionally with
|
|
313
|
+
* an arrow pointing at it.
|
|
314
|
+
*/
|
|
304
315
|
export const Popover = {
|
|
305
316
|
...BasePopover,
|
|
306
317
|
Root,
|