@mrpelz/uikit-ish 7.8.0 → 7.10.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/main.d.ts +12 -0
- package/dist/components/accordion/main.d.ts.map +1 -0
- package/dist/components/accordion/main.js +20 -0
- package/dist/components/accordion/main.js.map +1 -0
- package/dist/components/accordion/style.css +23 -0
- package/dist/components/action-sheet/main.d.ts +22 -16
- package/dist/components/action-sheet/main.d.ts.map +1 -1
- package/dist/components/action-sheet/main.js +89 -19
- package/dist/components/action-sheet/main.js.map +1 -1
- package/dist/components/action-sheet/props.d.ts +17 -5
- package/dist/components/action-sheet/props.d.ts.map +1 -1
- package/dist/components/action-sheet/style.css +24 -0
- package/dist/components/activity-view/main.d.ts +15 -4
- package/dist/components/activity-view/main.d.ts.map +1 -1
- package/dist/components/activity-view/main.js +27 -14
- package/dist/components/activity-view/main.js.map +1 -1
- package/dist/components/activity-view/props.d.ts +2 -10
- package/dist/components/activity-view/props.d.ts.map +1 -1
- package/dist/components/activity-view/style.css +29 -67
- package/dist/components/alert/main.d.ts +8 -7
- package/dist/components/alert/main.d.ts.map +1 -1
- package/dist/components/alert/main.js +32 -19
- package/dist/components/alert/main.js.map +1 -1
- package/dist/components/alert/props.d.ts +13 -2
- package/dist/components/alert/props.d.ts.map +1 -1
- package/dist/components/alert/style.css +36 -50
- package/dist/components/avatar/main.d.ts +5 -3
- package/dist/components/avatar/main.d.ts.map +1 -1
- package/dist/components/avatar/main.js +10 -8
- package/dist/components/avatar/main.js.map +1 -1
- package/dist/components/avatar/props.d.ts +4 -0
- package/dist/components/avatar/props.d.ts.map +1 -1
- package/dist/components/avatar/style.css +1 -7
- package/dist/components/badge/main.d.ts +3 -3
- package/dist/components/badge/main.d.ts.map +1 -1
- package/dist/components/badge/main.js +9 -9
- package/dist/components/badge/main.js.map +1 -1
- package/dist/components/badge/props.d.ts +4 -3
- package/dist/components/badge/props.d.ts.map +1 -1
- package/dist/components/badge/style.css +10 -4
- package/dist/components/button/main.d.ts.map +1 -1
- package/dist/components/button/main.js +15 -15
- package/dist/components/button/main.js.map +1 -1
- package/dist/components/button/props.d.ts +8 -8
- package/dist/components/button/props.d.ts.map +1 -1
- package/dist/components/button/style.css +37 -55
- package/dist/components/checkbox/main.d.ts.map +1 -1
- package/dist/components/checkbox/main.js +5 -7
- package/dist/components/checkbox/main.js.map +1 -1
- package/dist/components/checkbox/style.css +5 -8
- package/dist/components/collapsible/main.d.ts +9 -0
- package/dist/components/collapsible/main.d.ts.map +1 -0
- package/dist/components/collapsible/main.js +19 -0
- package/dist/components/collapsible/main.js.map +1 -0
- package/dist/components/collapsible/style.css +23 -0
- package/dist/components/color-picker/main.d.ts +27 -4
- package/dist/components/color-picker/main.d.ts.map +1 -1
- package/dist/components/color-picker/main.js +292 -110
- package/dist/components/color-picker/main.js.map +1 -1
- package/dist/components/color-picker/props.d.ts +64 -15
- package/dist/components/color-picker/props.d.ts.map +1 -1
- package/dist/components/color-picker/style.css +133 -65
- package/dist/components/contextual-menu/main.d.ts +11 -7
- package/dist/components/contextual-menu/main.d.ts.map +1 -1
- package/dist/components/contextual-menu/main.js +207 -202
- package/dist/components/contextual-menu/main.js.map +1 -1
- package/dist/components/contextual-menu/props.d.ts +21 -34
- package/dist/components/contextual-menu/props.d.ts.map +1 -1
- package/dist/components/contextual-menu/style.css +63 -34
- package/dist/components/date-picker/handle.d.ts +41 -0
- package/dist/components/date-picker/handle.d.ts.map +1 -0
- package/dist/components/date-picker/handle.js +47 -0
- package/dist/components/date-picker/handle.js.map +1 -0
- package/dist/components/date-picker/main.d.ts +31 -49
- package/dist/components/date-picker/main.d.ts.map +1 -1
- package/dist/components/date-picker/main.js +373 -178
- package/dist/components/date-picker/main.js.map +1 -1
- package/dist/components/date-picker/pager.d.ts +24 -0
- package/dist/components/date-picker/pager.d.ts.map +1 -0
- package/dist/components/date-picker/pager.js +307 -0
- package/dist/components/date-picker/pager.js.map +1 -0
- package/dist/components/date-picker/props.d.ts +98 -27
- package/dist/components/date-picker/props.d.ts.map +1 -1
- package/dist/components/date-picker/style.css +110 -118
- package/dist/components/drawer/main.d.ts +31 -0
- package/dist/components/drawer/main.d.ts.map +1 -0
- package/dist/components/drawer/main.js +119 -0
- package/dist/components/drawer/main.js.map +1 -0
- package/dist/components/drawer/props.d.ts +39 -0
- package/dist/components/drawer/props.d.ts.map +1 -0
- package/dist/components/drawer/props.js +2 -0
- package/dist/components/drawer/props.js.map +1 -0
- package/dist/components/drawer/style.css +135 -0
- package/dist/components/edit-menu/main.d.ts +7 -7
- package/dist/components/edit-menu/main.d.ts.map +1 -1
- package/dist/components/edit-menu/main.js +57 -40
- package/dist/components/edit-menu/main.js.map +1 -1
- package/dist/components/edit-menu/props.d.ts +14 -1
- package/dist/components/edit-menu/props.d.ts.map +1 -1
- package/dist/components/edit-menu/style.css +15 -8
- package/dist/components/form/main.d.ts +8 -0
- package/dist/components/form/main.d.ts.map +1 -1
- package/dist/components/form/main.js +18 -5
- package/dist/components/form/main.js.map +1 -1
- package/dist/components/form/props.d.ts +1 -2
- package/dist/components/form/props.d.ts.map +1 -1
- package/dist/components/glass/main.d.ts +1 -1
- package/dist/components/glass/main.js +4 -4
- package/dist/components/glass/main.js.map +1 -1
- package/dist/components/glass/props.d.ts +5 -5
- package/dist/components/glass/props.d.ts.map +1 -1
- package/dist/components/glass/style.css +176 -161
- package/dist/components/header/main.d.ts +5 -4
- package/dist/components/header/main.d.ts.map +1 -1
- package/dist/components/header/main.js +64 -34
- package/dist/components/header/main.js.map +1 -1
- package/dist/components/header/props.d.ts +2 -3
- package/dist/components/header/props.d.ts.map +1 -1
- package/dist/components/header/style.css +46 -65
- package/dist/components/index.d.ts +27 -23
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +17 -13
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/main.d.ts +2 -2
- package/dist/components/layout/main.d.ts.map +1 -1
- package/dist/components/layout/main.js +63 -167
- package/dist/components/layout/main.js.map +1 -1
- package/dist/components/layout/props.d.ts +2 -20
- package/dist/components/layout/props.d.ts.map +1 -1
- package/dist/components/layout/style.css +20 -91
- package/dist/components/list/main.d.ts +58 -10
- package/dist/components/list/main.d.ts.map +1 -1
- package/dist/components/list/main.js +1022 -465
- package/dist/components/list/main.js.map +1 -1
- package/dist/components/list/props.d.ts +211 -21
- package/dist/components/list/props.d.ts.map +1 -1
- package/dist/components/list/reorder.d.ts +146 -0
- package/dist/components/list/reorder.d.ts.map +1 -0
- package/dist/components/list/reorder.js +819 -0
- package/dist/components/list/reorder.js.map +1 -0
- package/dist/components/list/select.d.ts +6 -0
- package/dist/components/list/select.d.ts.map +1 -0
- package/dist/components/list/select.js +141 -0
- package/dist/components/list/select.js.map +1 -0
- package/dist/components/list/style.css +492 -507
- package/dist/components/list/swipe-actions-handle.d.ts +40 -0
- package/dist/components/list/swipe-actions-handle.d.ts.map +1 -0
- package/dist/components/list/swipe-actions-handle.js +51 -0
- package/dist/components/list/swipe-actions-handle.js.map +1 -0
- package/dist/components/menu/main.d.ts +102 -32
- package/dist/components/menu/main.d.ts.map +1 -1
- package/dist/components/menu/main.js +510 -99
- package/dist/components/menu/main.js.map +1 -1
- package/dist/components/menu/props.d.ts +5 -5
- package/dist/components/menu/props.d.ts.map +1 -1
- package/dist/components/menu/style.css +35 -43
- package/dist/components/navigation/main.d.ts +14 -2
- package/dist/components/navigation/main.d.ts.map +1 -1
- package/dist/components/navigation/main.js +437 -119
- package/dist/components/navigation/main.js.map +1 -1
- package/dist/components/navigation/props.d.ts +53 -3
- package/dist/components/navigation/props.d.ts.map +1 -1
- package/dist/components/navigation/style.css +56 -9
- package/dist/components/page/main.d.ts.map +1 -1
- package/dist/components/page/main.js +13 -8
- package/dist/components/page/main.js.map +1 -1
- package/dist/components/page/props.d.ts +8 -0
- package/dist/components/page/props.d.ts.map +1 -1
- package/dist/components/page/style.css +39 -4
- package/dist/components/page-control/main.d.ts +2 -2
- package/dist/components/page-control/main.d.ts.map +1 -1
- package/dist/components/page-control/main.js +66 -32
- package/dist/components/page-control/main.js.map +1 -1
- package/dist/components/page-control/props.d.ts +10 -2
- package/dist/components/page-control/props.d.ts.map +1 -1
- package/dist/components/page-control/style.css +7 -2
- package/dist/components/popover/main.d.ts +11 -6
- package/dist/components/popover/main.d.ts.map +1 -1
- package/dist/components/popover/main.js +63 -38
- package/dist/components/popover/main.js.map +1 -1
- package/dist/components/popover/props.d.ts +7 -6
- package/dist/components/popover/props.d.ts.map +1 -1
- package/dist/components/popover/style.css +54 -4
- package/dist/components/progress/main.d.ts +2 -3
- package/dist/components/progress/main.d.ts.map +1 -1
- package/dist/components/progress/main.js +148 -29
- package/dist/components/progress/main.js.map +1 -1
- package/dist/components/progress/props.d.ts +43 -9
- package/dist/components/progress/props.d.ts.map +1 -1
- package/dist/components/progress/style.css +82 -50
- package/dist/components/roll/main.d.ts +1 -1
- package/dist/components/roll/main.d.ts.map +1 -1
- package/dist/components/roll/main.js +90 -34
- package/dist/components/roll/main.js.map +1 -1
- package/dist/components/roll/props.d.ts +25 -8
- package/dist/components/roll/props.d.ts.map +1 -1
- package/dist/components/roll/style.css +12 -24
- package/dist/components/segmented/main.d.ts.map +1 -1
- package/dist/components/segmented/main.js +47 -30
- package/dist/components/segmented/main.js.map +1 -1
- package/dist/components/segmented/style.css +16 -23
- package/dist/components/sheet/main.d.ts +25 -15
- package/dist/components/sheet/main.d.ts.map +1 -1
- package/dist/components/sheet/main.js +66 -78
- package/dist/components/sheet/main.js.map +1 -1
- package/dist/components/sheet/props.d.ts +37 -3
- package/dist/components/sheet/props.d.ts.map +1 -1
- package/dist/components/sheet/style.css +183 -45
- package/dist/components/sidebar/main.d.ts.map +1 -1
- package/dist/components/sidebar/main.js +9 -13
- package/dist/components/sidebar/main.js.map +1 -1
- package/dist/components/sidebar/style.css +20 -14
- package/dist/components/slider/main.d.ts.map +1 -1
- package/dist/components/slider/main.js +23 -22
- package/dist/components/slider/main.js.map +1 -1
- package/dist/components/slider/props.d.ts +1 -2
- package/dist/components/slider/props.d.ts.map +1 -1
- package/dist/components/slider/style.css +27 -53
- package/dist/components/stepper/main.d.ts +4 -6
- package/dist/components/stepper/main.d.ts.map +1 -1
- package/dist/components/stepper/main.js +29 -25
- package/dist/components/stepper/main.js.map +1 -1
- package/dist/components/stepper/style.css +12 -16
- package/dist/components/switch/main.d.ts.map +1 -1
- package/dist/components/switch/main.js +40 -28
- package/dist/components/switch/main.js.map +1 -1
- package/dist/components/switch/props.d.ts +7 -5
- package/dist/components/switch/props.d.ts.map +1 -1
- package/dist/components/switch/style.css +40 -17
- package/dist/components/symbol/main.d.ts +2 -2
- package/dist/components/symbol/main.d.ts.map +1 -1
- package/dist/components/symbol/main.js +36 -28
- package/dist/components/symbol/main.js.map +1 -1
- package/dist/components/symbol/props.d.ts +39 -4
- package/dist/components/symbol/props.d.ts.map +1 -1
- package/dist/components/symbol/style.css +26 -5
- package/dist/components/tab-bar/main.d.ts +2 -2
- package/dist/components/tab-bar/main.d.ts.map +1 -1
- package/dist/components/tab-bar/main.js +133 -101
- package/dist/components/tab-bar/main.js.map +1 -1
- package/dist/components/tab-bar/props.d.ts +6 -6
- package/dist/components/tab-bar/props.d.ts.map +1 -1
- package/dist/components/tab-bar/style.css +113 -99
- package/dist/components/text-field/main.d.ts +3 -2
- package/dist/components/text-field/main.d.ts.map +1 -1
- package/dist/components/text-field/main.js +29 -30
- package/dist/components/text-field/main.js.map +1 -1
- package/dist/components/text-field/props.d.ts +23 -1
- package/dist/components/text-field/props.d.ts.map +1 -1
- package/dist/components/text-field/style.css +122 -82
- package/dist/components/toolbar/main.js +27 -27
- package/dist/components/toolbar/main.js.map +1 -1
- package/dist/components/toolbar/props.d.ts +10 -4
- package/dist/components/toolbar/props.d.ts.map +1 -1
- package/dist/components/toolbar/style.css +39 -33
- package/dist/components/tooltip/main.d.ts +10 -9
- package/dist/components/tooltip/main.d.ts.map +1 -1
- package/dist/components/tooltip/main.js +39 -10
- package/dist/components/tooltip/main.js.map +1 -1
- package/dist/components/tooltip/props.d.ts +2 -0
- package/dist/components/tooltip/props.d.ts.map +1 -1
- package/dist/components/tooltip/style.css +16 -16
- package/dist/components/typography/main.d.ts +2 -2
- package/dist/components/typography/main.d.ts.map +1 -1
- package/dist/components/typography/main.js +24 -16
- package/dist/components/typography/main.js.map +1 -1
- package/dist/components/typography/props.d.ts +11 -18
- package/dist/components/typography/props.d.ts.map +1 -1
- package/dist/components/typography/style.css +503 -623
- package/dist/components/utils/main.d.ts +78 -8
- package/dist/components/utils/main.d.ts.map +1 -1
- package/dist/components/utils/main.js +235 -16
- package/dist/components/utils/main.js.map +1 -1
- package/dist/components/utils/props.d.ts +27 -4
- package/dist/components/utils/props.d.ts.map +1 -1
- package/dist/components/utils/style.css +31 -18
- package/dist/components/viewport/edge-effect.d.ts +10 -0
- package/dist/components/viewport/edge-effect.d.ts.map +1 -0
- package/dist/components/viewport/edge-effect.js +100 -0
- package/dist/components/viewport/edge-effect.js.map +1 -0
- package/dist/components/viewport/edge.d.ts +39 -0
- package/dist/components/viewport/edge.d.ts.map +1 -0
- package/dist/components/viewport/edge.js +151 -0
- package/dist/components/viewport/edge.js.map +1 -0
- package/dist/components/viewport/input.d.ts +39 -0
- package/dist/components/viewport/input.d.ts.map +1 -0
- package/dist/components/viewport/input.js +280 -0
- package/dist/components/viewport/input.js.map +1 -0
- package/dist/components/viewport/main.d.ts +47 -9
- package/dist/components/viewport/main.d.ts.map +1 -1
- package/dist/components/viewport/main.js +745 -86
- package/dist/components/viewport/main.js.map +1 -1
- package/dist/components/viewport/padding.d.ts +78 -0
- package/dist/components/viewport/padding.d.ts.map +1 -0
- package/dist/components/viewport/padding.js +321 -0
- package/dist/components/viewport/padding.js.map +1 -0
- package/dist/components/viewport/props.d.ts +220 -11
- package/dist/components/viewport/props.d.ts.map +1 -1
- package/dist/components/viewport/style.css +377 -6
- package/dist/main.d.ts +0 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js.map +1 -1
- package/dist/styles.css +318 -302
- package/dist/styles.d.ts +2 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +2 -1
- package/dist/styles.js.map +1 -1
- package/package.json +8 -16
|
@@ -4,41 +4,41 @@ import './style.css';
|
|
|
4
4
|
import { Radio as BaseRadio } from '@base-ui/react/radio';
|
|
5
5
|
import { RadioGroup as BaseRadioGroup } from '@base-ui/react/radio-group';
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
|
-
import { cn, usePointerDrag, useSecondaryClick } from '../utils/main.js';
|
|
8
|
-
//
|
|
9
|
-
// appearance), with Figma colors mapped to UIKit semantic colors where they
|
|
7
|
+
import { cn, delayLens, isKeyboardFocus, usePointerDrag, useSecondaryClick, } from '../utils/main.js';
|
|
8
|
+
// The segmented control, light and dark, in the semantic colors where they
|
|
10
9
|
// match: track `tertiarySystemFill`, labels `label`, separators `systemGray`.
|
|
11
10
|
// The highlight (`#fff`/`#6c6c71`) has no semantic equivalent.
|
|
12
|
-
// Behavior
|
|
11
|
+
// Behavior comes from Framework7
|
|
13
12
|
// `components/button/button.less` (`.segmented-strong`,
|
|
14
|
-
// `.segmented-highlight`) and `button-vars.less` (iOS values): disabled
|
|
13
|
+
// `.segmented-highlight`) and `button-vars.less` (its iOS theme's values): disabled
|
|
15
14
|
// opacity, transition durations, `z-index`, item `min-width`
|
|
16
15
|
// (`--f7-button-min-width`).
|
|
17
16
|
// Additions from Konsta UI `shared/classes/SegmentedClasses.js`:
|
|
18
17
|
// `width: 100%`, `pointer-events: none` on the highlight.
|
|
19
18
|
//
|
|
20
|
-
//
|
|
19
|
+
// Also:
|
|
21
20
|
// - The track height (36px) is a minimum, not a fixed size.
|
|
22
|
-
// - Items are laid out in equal grid columns
|
|
23
|
-
// `flex-grow: 1`), so every column fits the widest label when the
|
|
21
|
+
// - Items are laid out in equal grid columns, so every column fits the widest label when the
|
|
24
22
|
// control sizes to its content.
|
|
25
|
-
// - Items are fully rounded
|
|
26
|
-
// - The highlight extends 4px on both sides of its item
|
|
27
|
-
// -3.67px right, a rounding artifact of the 117.33px item width).
|
|
23
|
+
// - Items are fully rounded.
|
|
24
|
+
// - The highlight extends 4px on both sides of its item.
|
|
28
25
|
// - Separators are drawn at the start of the following item instead of being
|
|
29
26
|
// 1px flex items of their own; item labels are wrapped in a span that
|
|
30
27
|
// handles overflow, so the rounded item does not clip its separator.
|
|
31
28
|
// - Chained sibling combinators replace Framework7's `:nth-child()`, as Base UI
|
|
32
29
|
// renders a hidden `<input>` next to each radio.
|
|
33
30
|
// - The highlight is hidden while no item is checked.
|
|
34
|
-
// - The browser's default focus ring is kept (Framework7 removes it)
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
31
|
+
// - The browser's default focus ring is kept (Framework7 removes it), on
|
|
32
|
+
// keyboard focus only (an item focused when pressed matches :focus-visible
|
|
33
|
+
// on touch).
|
|
34
|
+
// - Pressing an item (held a moment or dragged; a quick tap only checks it)
|
|
35
|
+
// turns the selection into a glass lens that follows the pointer and
|
|
36
|
+
// checks the closest item on release (Framework7 has no lens here; it's
|
|
37
|
+
// the tab bar's, see `tab-bar/main.tsx`). It replaces Framework7's pressed
|
|
38
|
+
// background. The lens is drawn above the items and outside the track, so
|
|
39
|
+
// the track doesn't clip its content; the highlight clips itself (and its
|
|
40
|
+
// shadow) to the track. Sideways, it grows by at most twice as much as
|
|
41
|
+
// vertically (wide items).
|
|
42
42
|
const isEnabled = (item) => !Object.hasOwn(item.dataset, 'disabled');
|
|
43
43
|
const getItems = (root) => [...root.querySelectorAll('[role="radio"]')].filter((item) => item instanceof HTMLElement);
|
|
44
44
|
// Moves the lens to the pointer, clamped to the highlight's range, and
|
|
@@ -93,18 +93,25 @@ const release = (root, item) => {
|
|
|
93
93
|
* The track, containing `Segmented.Item`s and a `Segmented.Highlight`.
|
|
94
94
|
* Renders the glass lens shown while an item is pressed.
|
|
95
95
|
*/
|
|
96
|
-
const Root = forwardRef(({ className, children, hideSeparators, onLostPointerCapture, onPointerCancel, onPointerDown, onPointerMove, onPointerUp, ...props }, ref) => {
|
|
96
|
+
const Root = forwardRef(({ className, children, hideSeparators, onFocus, onLostPointerCapture, onPointerCancel, onPointerDown, onPointerMove, onPointerUp, onTouchMove, ...props }, ref) => {
|
|
97
97
|
const handlers = usePointerDrag({
|
|
98
|
-
end: (root, state,
|
|
99
|
-
const { item } = state;
|
|
100
|
-
|
|
98
|
+
end: (root, state, isCancelled) => {
|
|
99
|
+
const { item, lens } = state;
|
|
100
|
+
lens.cancel();
|
|
101
|
+
if (!isCancelled && item) {
|
|
101
102
|
if (!Object.hasOwn(item.dataset, 'checked'))
|
|
102
103
|
item.click();
|
|
103
104
|
item.focus({ preventScroll: true });
|
|
104
105
|
}
|
|
105
|
-
release(root,
|
|
106
|
+
release(root, isCancelled ? undefined : item);
|
|
107
|
+
},
|
|
108
|
+
// Held (its lens shown), the touch doesn't scroll.
|
|
109
|
+
isHolding: ({ lens }, position) => {
|
|
110
|
+
lens.move(position);
|
|
111
|
+
return lens.isShown();
|
|
106
112
|
},
|
|
107
113
|
move: (root, state, event) => {
|
|
114
|
+
state.lens.move(event);
|
|
108
115
|
state.item = press(root, event.clientX);
|
|
109
116
|
},
|
|
110
117
|
start: (root, event) => {
|
|
@@ -115,12 +122,12 @@ const Root = forwardRef(({ className, children, hideSeparators, onLostPointerCap
|
|
|
115
122
|
return undefined;
|
|
116
123
|
}
|
|
117
124
|
// Place the lens at the pointer without a transition, then let it
|
|
118
|
-
// follow without delay; only opacity and scale animate.
|
|
125
|
+
// follow without delay; only opacity and scale animate. Shown a
|
|
126
|
+
// moment later (a quick tap only selects, see `delayLens`).
|
|
119
127
|
root.style.setProperty('--uikit-segmented-lens-move-duration', '0s');
|
|
120
128
|
const item = press(root, event.clientX);
|
|
121
|
-
root.
|
|
122
|
-
|
|
123
|
-
return { item };
|
|
129
|
+
const lens = delayLens(event, () => root.style.setProperty('--uikit-segmented-pressed', '1'));
|
|
130
|
+
return { item, lens };
|
|
124
131
|
},
|
|
125
132
|
}, {
|
|
126
133
|
onLostPointerCapture,
|
|
@@ -128,14 +135,24 @@ const Root = forwardRef(({ className, children, hideSeparators, onLostPointerCap
|
|
|
128
135
|
onPointerDown,
|
|
129
136
|
onPointerMove,
|
|
130
137
|
onPointerUp,
|
|
138
|
+
onTouchMove,
|
|
131
139
|
});
|
|
132
|
-
return (_jsxs(BaseRadioGroup, { ref: ref, "data-glass-context": "auto", "data-hide-separators": hideSeparators ? '' : undefined,
|
|
140
|
+
return (_jsxs(BaseRadioGroup, { ref: ref, "data-glass-context": "auto", "data-hide-separators": hideSeparators ? '' : undefined,
|
|
141
|
+
// Focused by a pointer (its item pressed, see `end`), no ring.
|
|
142
|
+
onFocus: (event) => {
|
|
143
|
+
onFocus?.(event);
|
|
144
|
+
if (isKeyboardFocus()) {
|
|
145
|
+
delete event.currentTarget.dataset.pointerFocus;
|
|
146
|
+
}
|
|
147
|
+
else
|
|
148
|
+
event.currentTarget.dataset.pointerFocus = '';
|
|
149
|
+
}, ...props, ...handlers, className: cn('uikit-segmented-root', className), "data-base-ui-swipe-ignore": "", "data-segmented-part": "root", children: [children, _jsx("span", { "aria-hidden": "true", className: "uikit-segmented-lens", "data-segmented-part": "lens" })] }));
|
|
133
150
|
});
|
|
134
151
|
const Item = forwardRef(({ children, className, ...props }, ref) => {
|
|
135
152
|
const itemProps = useSecondaryClick(props);
|
|
136
153
|
return (_jsx(BaseRadio.Root, { ref: ref, className: cn('uikit-segmented-item', className), "data-segmented-part": "item", ...itemProps, children: _jsxs("span", { className: "uikit-segmented-label", "data-segmented-part": "label", children: [_jsx("span", { className: "uikit-segmented-label-text", "data-segmented-part": "label-text", children: children }), _jsx("span", { "aria-hidden": "true", className: "uikit-segmented-label-reserve", "data-segmented-part": "label-reserve", children: children })] }) }));
|
|
137
154
|
});
|
|
138
|
-
// Clipped to the track (
|
|
155
|
+
// Clipped to the track (its shadow too): in the highlight's
|
|
139
156
|
// own box, an item is as wide as the highlight minus its outsets, and the
|
|
140
157
|
// track's edges are that many items (plus padding) away. Framework7
|
|
141
158
|
// supports up to 10 buttons: each rule at its end matches when at least
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/components/segmented/main.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/components/segmented/main.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EACL,EAAE,EAEF,SAAS,EACT,eAAe,EACf,cAAc,EACd,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAK1B,2EAA2E;AAC3E,8EAA8E;AAC9E,+DAA+D;AAC/D,iCAAiC;AACjC,wDAAwD;AACxD,oFAAoF;AACpF,6DAA6D;AAC7D,6BAA6B;AAC7B,iEAAiE;AACjE,0DAA0D;AAC1D,EAAE;AACF,QAAQ;AACR,4DAA4D;AAC5D,6FAA6F;AAC7F,kCAAkC;AAClC,6BAA6B;AAC7B,yDAAyD;AACzD,6EAA6E;AAC7E,wEAAwE;AACxE,uEAAuE;AACvE,gFAAgF;AAChF,mDAAmD;AACnD,sD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-11,7 +11,7 @@
|
|
|
11
11
|
items); sized, not scaled, so it stays a capsule. */
|
|
12
12
|
width: calc(
|
|
13
13
|
var(--uikit-segmented-lens-width, 0px) +
|
|
14
|
-
(var(--glass-
|
|
14
|
+
(var(--glass-ui-lens-scale) - 1) *
|
|
15
15
|
min(
|
|
16
16
|
var(--uikit-segmented-lens-width, 0px),
|
|
17
17
|
2 * var(--uikit-segmented-lens-height, 0px)
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
);
|
|
21
21
|
height: calc(
|
|
22
22
|
var(--uikit-segmented-lens-height, 0px) +
|
|
23
|
-
(var(--glass-
|
|
23
|
+
(var(--glass-ui-lens-scale) - 1) *
|
|
24
24
|
var(--uikit-segmented-lens-height, 0px) *
|
|
25
25
|
var(--uikit-segmented-pressed, 0)
|
|
26
26
|
);
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
opacity: var(--uikit-segmented-pressed, 0);
|
|
31
31
|
pointer-events: none;
|
|
32
32
|
transition-duration:
|
|
33
|
-
var(--uikit-segmented-lens-move-duration, var(--glass-
|
|
34
|
-
var(--glass-
|
|
35
|
-
var(--glass-
|
|
33
|
+
var(--uikit-segmented-lens-move-duration, var(--glass-ui-lens-duration)),
|
|
34
|
+
var(--glass-ui-lens-duration), var(--glass-ui-lens-duration),
|
|
35
|
+
var(--glass-ui-lens-duration);
|
|
36
36
|
transition-property: translate, opacity, width, height;
|
|
37
37
|
transition-timing-function: ease-out;
|
|
38
38
|
translate: calc(var(--uikit-segmented-lens-x, 0px) - 50%)
|
|
@@ -56,35 +56,36 @@
|
|
|
56
56
|
margin: 0;
|
|
57
57
|
appearance: none;
|
|
58
58
|
background-color: transparent;
|
|
59
|
-
color: var(--color-
|
|
59
|
+
color: var(--color-ui-label);
|
|
60
60
|
font-family: inherit;
|
|
61
61
|
font-size: 14px;
|
|
62
62
|
font-variation-settings: 'wght' 510;
|
|
63
63
|
font-weight: round(down, 510, 100);
|
|
64
64
|
letter-spacing: -0.08px;
|
|
65
65
|
line-height: 18px;
|
|
66
|
-
stroke: currentcolor;
|
|
67
|
-
stroke-linejoin: round;
|
|
68
|
-
stroke-width: max(0px, (510 - 400) / 326 * 1px);
|
|
69
66
|
text-align: center;
|
|
70
67
|
text-transform: none;
|
|
71
68
|
transform: translate3d(0, 0, 0);
|
|
72
69
|
transition-duration: 100ms;
|
|
70
|
+
-webkit-user-select: none;
|
|
73
71
|
user-select: none;
|
|
74
72
|
|
|
75
|
-
--uikit-symbol-thinning: max(0px, (400 - 510) / 326 * 1px);
|
|
76
|
-
|
|
77
73
|
@media (hover: hover) {
|
|
78
74
|
cursor: var(--uikit-utils-cursor);
|
|
79
75
|
}
|
|
80
76
|
|
|
77
|
+
/* The browser's ring, on keyboard focus only (see main.tsx). */
|
|
78
|
+
[data-pointer-focus] &:focus-visible {
|
|
79
|
+
outline: none;
|
|
80
|
+
}
|
|
81
|
+
|
|
81
82
|
[role='radio'] ~ &::before {
|
|
82
83
|
position: absolute;
|
|
83
84
|
top: 0;
|
|
84
85
|
bottom: 0;
|
|
85
86
|
width: 1px;
|
|
86
87
|
border-radius: 0.5px;
|
|
87
|
-
background-color: var(--color-
|
|
88
|
+
background-color: var(--color-ui-system-gray);
|
|
88
89
|
content: '';
|
|
89
90
|
inset-inline-start: 0;
|
|
90
91
|
opacity: 0.3;
|
|
@@ -106,11 +107,8 @@
|
|
|
106
107
|
&[data-checked] {
|
|
107
108
|
font-variation-settings: 'wght' 590;
|
|
108
109
|
font-weight: round(down, 590, 100);
|
|
109
|
-
stroke: currentcolor;
|
|
110
|
-
stroke-linejoin: round;
|
|
111
|
-
stroke-width: max(0px, (590 - 400) / 326 * 1px);
|
|
112
110
|
|
|
113
|
-
--uikit-symbol-
|
|
111
|
+
--uikit-symbol-emphasis: 1;
|
|
114
112
|
}
|
|
115
113
|
|
|
116
114
|
&[data-disabled] {
|
|
@@ -137,14 +135,9 @@
|
|
|
137
135
|
font-variation-settings: 'wght' 590;
|
|
138
136
|
font-weight: round(down, 590, 100);
|
|
139
137
|
grid-area: 1 / 1;
|
|
140
|
-
stroke: currentcolor;
|
|
141
|
-
stroke-linejoin: round;
|
|
142
|
-
stroke-width: max(0px, (590 - 400) / 326 * 1px);
|
|
143
138
|
text-overflow: ellipsis;
|
|
144
139
|
visibility: hidden;
|
|
145
140
|
white-space: nowrap;
|
|
146
|
-
|
|
147
|
-
--uikit-symbol-thinning: max(0px, (400 - 590) / 326 * 1px);
|
|
148
141
|
}
|
|
149
142
|
|
|
150
143
|
.uikit-segmented-root {
|
|
@@ -162,7 +155,7 @@
|
|
|
162
155
|
padding: var(--uikit-segmented-padding-block)
|
|
163
156
|
var(--uikit-segmented-padding-inline);
|
|
164
157
|
border-radius: 100px;
|
|
165
|
-
background-color: var(--color-
|
|
158
|
+
background-color: var(--color-ui-tertiary-system-fill);
|
|
166
159
|
grid-auto-columns: 1fr;
|
|
167
160
|
grid-auto-flow: column;
|
|
168
161
|
touch-action: pan-y;
|
|
@@ -190,7 +183,7 @@
|
|
|
190
183
|
);
|
|
191
184
|
height: calc(100% - var(--uikit-segmented-padding-block) * 2);
|
|
192
185
|
border-radius: 20px;
|
|
193
|
-
background-color: var(--color-
|
|
186
|
+
background-color: var(--color-ui-segmented-selection);
|
|
194
187
|
box-shadow: 0 2px 20px rgb(0 0 0 / 6%);
|
|
195
188
|
clip-path: inset(
|
|
196
189
|
calc(var(--uikit-segmented-padding-block) * -1)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import '../glass/style.css';
|
|
2
2
|
import './style.css';
|
|
3
|
-
import {
|
|
4
|
-
import type { SheetPopupProps } from './props.js';
|
|
5
|
-
export type { SheetDetent, SheetPopupProps } from './props.js';
|
|
3
|
+
import { Drawer as BaseDrawer } from '@base-ui/react/drawer';
|
|
4
|
+
import type { SheetContentProps, SheetGrabberProps, SheetHandle, SheetPopupProps } from './props.js';
|
|
5
|
+
export type { SheetContentProps, SheetDetent, SheetGrabberProps, SheetHandle, SheetPopupProps, } from './props.js';
|
|
6
|
+
/** `Sheet.createHandle`, in a component: made once, for its lifetime. */
|
|
7
|
+
export declare const useCreateSheetHandle: <Payload = unknown>() => SheetHandle<Payload>;
|
|
6
8
|
/**
|
|
7
|
-
* A sheet (
|
|
9
|
+
* A sheet (Base UI's `Drawer`): a
|
|
8
10
|
* modal panel for a scoped task, from the bottom (large or medium), or a
|
|
9
11
|
* form sheet in a regular width.
|
|
10
12
|
*/
|
|
@@ -15,18 +17,26 @@ export declare const Sheet: {
|
|
|
15
17
|
Header: import("preact").FunctionalComponent<import("react").PropsWithoutRef<import("preact").HTMLAttributes<HTMLDivElement>> & {
|
|
16
18
|
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
17
19
|
}>;
|
|
18
|
-
|
|
20
|
+
Grabber: import("preact").FunctionalComponent<import("react").PropsWithoutRef<SheetGrabberProps> & {
|
|
19
21
|
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
20
22
|
}>;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
Content: import("preact").FunctionalComponent<import("react").PropsWithoutRef<SheetContentProps> & {
|
|
24
|
+
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
createHandle: <Payload = unknown>() => SheetHandle<Payload>;
|
|
27
|
+
Backdrop: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/drawer").DrawerBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
Close: BaseDrawer.Close;
|
|
29
|
+
Description: BaseDrawer.Description;
|
|
30
|
+
Indent: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/drawer").DrawerIndentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
31
|
+
IndentBackground: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/drawer").DrawerIndentBackgroundProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
32
|
+
Portal: BaseDrawer.Portal;
|
|
33
|
+
Provider: typeof BaseDrawer.Provider;
|
|
34
|
+
Root: typeof BaseDrawer.Root;
|
|
35
|
+
SwipeArea: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/drawer").DrawerSwipeAreaProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
36
|
+
Title: BaseDrawer.Title;
|
|
37
|
+
Trigger: BaseDrawer.Trigger;
|
|
38
|
+
Viewport: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/drawer").DrawerViewportProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
39
|
+
VirtualKeyboardProvider: typeof BaseDrawer.VirtualKeyboardProvider;
|
|
40
|
+
Handle: typeof BaseDrawer.Handle;
|
|
31
41
|
};
|
|
32
42
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/sheet/main.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/sheet/main.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAU7D,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,eAAe,GAChB,MAAM,YAAY,CAAC;AAsJpB,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,GAC/B,OAAO,GAAG,OAAO,OACd,WAAW,CAAC,OAAO,CAIvB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;mBAjBI,OAAO,iBAAgB,WAAW,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;CAwBhE,CAAC"}
|
|
@@ -1,101 +1,89 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import '../glass/style.css';
|
|
3
3
|
import './style.css';
|
|
4
|
-
import {
|
|
5
|
-
import { forwardRef,
|
|
6
|
-
import { cn } from '../utils/main.js';
|
|
7
|
-
|
|
8
|
-
// dark: 48%):
|
|
9
|
-
// - large
|
|
4
|
+
import { Drawer as BaseDrawer } from '@base-ui/react/drawer';
|
|
5
|
+
import { forwardRef, useState } from 'react';
|
|
6
|
+
import { cn, useForwardedRef, usePortalContainer } from '../utils/main.js';
|
|
7
|
+
import { EdgeEffects, useScrollerRegistration, useSizeClass, ViewportScopeContext, } from '../viewport/main.js';
|
|
8
|
+
// Sheets, over the page dimmed (black, 20%; dark: 48%):
|
|
9
|
+
// - large: opaque (elevated background:
|
|
10
10
|
// white; dark: #1c1c1e), from 10px below the top to the bottom, its top
|
|
11
11
|
// corners 38px, its shadow 0 15px 75px at 18%;
|
|
12
|
-
// - medium
|
|
12
|
+
// - medium: glass, 6px from the sides and the
|
|
13
13
|
// bottom, as high as its content, its corners 34px;
|
|
14
|
-
// - in a regular width (
|
|
15
|
-
// opaque, centered, up to 936px by 852px, its
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
14
|
+
// - in a regular width (the window from 768px, or not `compact`), a form
|
|
15
|
+
// sheet: opaque, centered, up to 936px by 852px, its
|
|
16
|
+
// corners 38px.
|
|
17
|
+
// Its header: a grabber (`Grabber`, 36px by 5px, 5px from
|
|
18
|
+
// the top, #cfcfcf; optional) above the app's content (e.g. a `Toolbar`: a 44px title and
|
|
19
|
+
// controls). Base UI's `Drawer` (a `Dialog` with gestures): modal,
|
|
20
|
+
// dismissed by a press outside it (or Escape); swiped down (anywhere, its
|
|
21
|
+
// content scrolled to its top), far enough or flung, too, otherwise
|
|
22
|
+
// springing back.
|
|
21
23
|
//
|
|
22
|
-
//
|
|
24
|
+
// Also:
|
|
23
25
|
// - The glass is the menus' (see `Menu`).
|
|
24
26
|
// - Detents don't change by dragging (`detent` is the app's), and the page
|
|
25
|
-
// behind a large sheet doesn't shrink back (
|
|
26
|
-
// Opaque,
|
|
27
|
-
//
|
|
28
|
-
//
|
|
27
|
+
// behind a large sheet doesn't shrink back (no stacked look).
|
|
28
|
+
// Opaque, grouped (`background`, for grouped lists, as a page's): on the
|
|
29
|
+
// grouped background, a list in it without its own (which would end with
|
|
30
|
+
// it, the sheet's around it). In it,
|
|
31
|
+
// the elevated backgrounds (dark mode: #1c1c1e, groups #2c2c2e), as
|
|
32
|
+
// tokens for all its content (e.g. a navigation's pages).
|
|
29
33
|
/** The sheet, the page dimmed behind it. */
|
|
30
|
-
const Popup = forwardRef(({
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
34
|
+
const Popup = forwardRef(({ background = 'plain', className, compact: compactProp, container, detent = 'large', ...props }, ref) => {
|
|
35
|
+
// (By the window's size class, see Viewport.)
|
|
36
|
+
const sizeClass = useSizeClass();
|
|
37
|
+
const isCompact = compactProp ?? sizeClass === 'compact';
|
|
38
|
+
// Its anchors' scope: fixed to it (see Viewport.Padding).
|
|
39
|
+
const [scope] = useState(() => ({}));
|
|
40
|
+
return (_jsx(ViewportScopeContext.Provider, { value: scope, children: _jsxs(BaseDrawer.Portal, { className: "uikit-sheet-portal", container: usePortalContainer(container), children: [_jsx(BaseDrawer.Backdrop, { className: "uikit-sheet-backdrop", "data-sheet-part": "backdrop" }), _jsx(BaseDrawer.Viewport, { className: "uikit-sheet-viewport", "data-sheet-part": "viewport", children: _jsx(BaseDrawer.Popup, { ref: ref, "data-background": background, "data-compact": isCompact ? '' : undefined, "data-detent": detent, "data-sheet-part": "popup", className: cn('uikit-sheet-popup', isCompact && detent === 'medium'
|
|
41
|
+
? cn('uikit-glass-medium', className)
|
|
42
|
+
: className), ...props }) })] }) }));
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Its header: its grabber (`Grabber`), above the app's content (e.g. a
|
|
46
|
+
* `Toolbar`); with only a grabber, over the content (see style.css).
|
|
47
|
+
*/
|
|
48
|
+
const Header = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, "data-sheet-part": "header", ...props, className: cn('uikit-sheet-header', className) })));
|
|
49
|
+
/**
|
|
50
|
+
* Its grabber (36px by 5px, 5px from the top): showing the sheet
|
|
51
|
+
* can be swiped (it can be anywhere); left out, a cleaner top.
|
|
52
|
+
*/
|
|
53
|
+
const Grabber = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, "aria-hidden": "true", "data-sheet-part": "grabber", ...props, className: cn('uikit-sheet-grabber', className) })));
|
|
35
54
|
/**
|
|
36
|
-
* Its
|
|
37
|
-
*
|
|
55
|
+
* Its content, scrolling (Base UI's `Drawer.Content`: its text selectable by
|
|
56
|
+
* a mouse without swiping the sheet); a scroller (registered), drawing its
|
|
57
|
+
* bars' edge effects (see `Viewport`).
|
|
38
58
|
*/
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
// Not from its controls.
|
|
44
|
-
if (event.defaultPrevented ||
|
|
45
|
-
event.button !== 0 ||
|
|
46
|
-
(event.target instanceof Element &&
|
|
47
|
-
event.target.closest('button, a, input, [role=button]'))) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const popup = event.currentTarget.closest('[data-detent]');
|
|
51
|
-
if (!popup)
|
|
52
|
-
return;
|
|
53
|
-
const start = event.clientY;
|
|
54
|
-
let last = { time: event.timeStamp, y: start };
|
|
55
|
-
let speed = 0;
|
|
56
|
-
const header = event.currentTarget;
|
|
57
|
-
header.setPointerCapture(event.pointerId);
|
|
58
|
-
popup.toggleAttribute('data-dragging', true);
|
|
59
|
-
const move = (moveEvent) => {
|
|
60
|
-
const distance = Math.max(0, moveEvent.clientY - start);
|
|
61
|
-
const elapsed = moveEvent.timeStamp - last.time;
|
|
62
|
-
if (elapsed > 0)
|
|
63
|
-
speed = (moveEvent.clientY - last.y) / elapsed;
|
|
64
|
-
last = { time: moveEvent.timeStamp, y: moveEvent.clientY };
|
|
65
|
-
popup.style.setProperty('--uikit-sheet-drag', `${String(distance)}px`);
|
|
66
|
-
};
|
|
67
|
-
const end = (endEvent) => {
|
|
68
|
-
header.removeEventListener('pointermove', move);
|
|
69
|
-
header.removeEventListener('pointerup', end);
|
|
70
|
-
header.removeEventListener('pointercancel', end);
|
|
71
|
-
delete popup.dataset.dragging;
|
|
72
|
-
const distance = Math.max(0, endEvent.clientY - start);
|
|
73
|
-
const dismissed = endEvent.type === 'pointerup' &&
|
|
74
|
-
(distance > popup.offsetHeight * dismissShare ||
|
|
75
|
-
(speed > flingSpeed && distance > 0));
|
|
76
|
-
// Dismissed, it leaves from where it is; otherwise it springs back.
|
|
77
|
-
if (dismissed)
|
|
78
|
-
closeRef.current?.click();
|
|
79
|
-
else
|
|
80
|
-
popup.style.removeProperty('--uikit-sheet-drag');
|
|
81
|
-
};
|
|
82
|
-
header.addEventListener('pointermove', move);
|
|
83
|
-
header.addEventListener('pointerup', end);
|
|
84
|
-
header.addEventListener('pointercancel', end);
|
|
85
|
-
};
|
|
86
|
-
return (_jsxs("div", { ref: ref, "data-sheet-part": "header", ...props, className: cn('uikit-sheet-header', className), onPointerDown: handlePointerDown, children: [children, _jsx(BaseDialog.Close, { ref: closeRef, hidden: true, tabIndex: -1 })] }));
|
|
59
|
+
const Content = forwardRef(({ children, className, ...props }, forwardedRef) => {
|
|
60
|
+
const ref = useForwardedRef(forwardedRef);
|
|
61
|
+
useScrollerRegistration(ref);
|
|
62
|
+
return (_jsxs(BaseDrawer.Content, { ref: ref, className: cn('uikit-sheet-content', className), "data-sheet-part": "content", "data-viewport-scroller": "", ...props, children: [children, _jsx(EdgeEffects, { scroller: ref })] }));
|
|
87
63
|
});
|
|
88
|
-
// Its content, scrolling.
|
|
89
|
-
const Content = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('uikit-sheet-content', className), "data-sheet-part": "content", ...props })));
|
|
90
64
|
/**
|
|
91
|
-
* A
|
|
65
|
+
* A handle linking a sheet (its `handle`) to its triggers outside it, and
|
|
66
|
+
* opening or closing it imperatively (Base UI's `Drawer.createHandle`):
|
|
67
|
+
* made once, e.g. at a module's top level (in a component:
|
|
68
|
+
* `useCreateSheetHandle`).
|
|
69
|
+
*/
|
|
70
|
+
const createHandle = () => BaseDrawer.createHandle();
|
|
71
|
+
/** `Sheet.createHandle`, in a component: made once, for its lifetime. */
|
|
72
|
+
export const useCreateSheetHandle = () => {
|
|
73
|
+
const [handle] = useState(() => createHandle());
|
|
74
|
+
return handle;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* A sheet (Base UI's `Drawer`): a
|
|
92
78
|
* modal panel for a scoped task, from the bottom (large or medium), or a
|
|
93
79
|
* form sheet in a regular width.
|
|
94
80
|
*/
|
|
95
81
|
export const Sheet = {
|
|
96
|
-
...
|
|
82
|
+
...BaseDrawer,
|
|
97
83
|
Popup,
|
|
98
84
|
Header,
|
|
85
|
+
Grabber,
|
|
99
86
|
Content,
|
|
87
|
+
createHandle,
|
|
100
88
|
};
|
|
101
89
|
//# sourceMappingURL=main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/components/sheet/main.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAkB,UAAU,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AM,OAAO,GAAG,UAAU,CACxB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE;IAClD,MAAM,GAAG,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;IAC1C,uBAAuB,CAAC,GAAG,CAAC,CAAC;IAE7B,OAAO,CACL,MAAC,UAAU,CAAC,OAAO,IACjB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,qBAC/B,SAAS,4BACF,EAAE,KACrB,KAAK,aAER,QAAqB,EACtB,KAAC,WAAW,IAAC,QAAQ,EAAE,GAAG,GAAI,IACX,CACtB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,YAAY,GAAG,GAA6C,EAAE,CAClE,UAAU,CAAC,YAAY,EAAW,CAAC;AAErC,yEAAyE;AACzE,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAEV,EAAE;IAC1B,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,YAAY,EAAW,CAAC,CAAC;IAEzD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,GAAG,UAAU;IACb,KAAK;IACL,MAAM;IACN,OAAO;IACP,OAAO;IACP,YAAY;CACb,CAAC"}
|
|
@@ -1,11 +1,45 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Drawer as BaseDrawer } from '@base-ui/react/drawer';
|
|
2
|
+
import type { Properties } from 'csstype';
|
|
3
|
+
import type { ComponentProps } from 'react';
|
|
2
4
|
export type SheetDetent = 'large' | 'medium';
|
|
3
|
-
export type SheetPopupProps = Omit<
|
|
5
|
+
export type SheetPopupProps = Omit<BaseDrawer.Popup.Props, 'ref'> & {
|
|
4
6
|
/**
|
|
5
|
-
* Its
|
|
7
|
+
* Its background (as a page's, see `Page.Root`): `grouped` for grouped
|
|
8
|
+
* lists in it (their own background then transparent), `plain` for plain
|
|
9
|
+
* lists and other content. Not the medium detent's (glass).
|
|
10
|
+
* @default 'plain'
|
|
11
|
+
*/
|
|
12
|
+
background?: 'grouped' | 'plain';
|
|
13
|
+
/**
|
|
14
|
+
* A sheet from the bottom (`detent`), or (not compact) a form sheet,
|
|
15
|
+
* centered.
|
|
16
|
+
* @default by the window's width (compact below 768px)
|
|
17
|
+
*/
|
|
18
|
+
compact?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Where its portal renders it (Base UI's `Drawer.Portal`), e.g. a
|
|
21
|
+
* frame of the app's, fixed to it if it's a containing block (and
|
|
22
|
+
* `overflow: clip`, not `hidden`: focus moving into the sheet, still
|
|
23
|
+
* below it, would scroll it).
|
|
24
|
+
* @default document.body
|
|
25
|
+
*/
|
|
26
|
+
container?: BaseDrawer.Portal.Props['container'];
|
|
27
|
+
/**
|
|
28
|
+
* Its height in a compact width (a phone's): the whole screen, or its
|
|
6
29
|
* content's (a floating glass panel).
|
|
7
30
|
* @default 'large'
|
|
8
31
|
*/
|
|
9
32
|
detent?: SheetDetent;
|
|
10
33
|
};
|
|
34
|
+
export type SheetContentProps = Omit<BaseDrawer.Content.Props, 'ref'>;
|
|
35
|
+
/** A handle linking a sheet to its triggers outside it. */
|
|
36
|
+
export type SheetHandle<Payload = unknown> = BaseDrawer.Handle<Payload>;
|
|
37
|
+
export type SheetGrabberProps = ComponentProps<'div'> & {
|
|
38
|
+
/**
|
|
39
|
+
* The cursor (where the pointer hovers; while the sheet is swiped,
|
|
40
|
+
* `grabbing`).
|
|
41
|
+
* @default 'grab'
|
|
42
|
+
*/
|
|
43
|
+
cursor?: Properties['cursor'];
|
|
44
|
+
};
|
|
11
45
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/components/sheet/props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/components/sheet/props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG;IAClE;;;;;OAKG;IACH,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACjC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACjD;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEtE,2DAA2D;AAC3D,MAAM,MAAM,WAAW,CAAC,OAAO,GAAG,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAExE,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACtD;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;CAC/B,CAAC"}
|