@mrpelz/uikit-ish 7.9.0 → 7.11.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/action-sheet/main.d.ts +1 -2
- package/dist/components/action-sheet/main.d.ts.map +1 -1
- package/dist/components/action-sheet/main.js +12 -12
- package/dist/components/action-sheet/main.js.map +1 -1
- package/dist/components/action-sheet/props.d.ts +2 -2
- package/dist/components/action-sheet/props.d.ts.map +1 -1
- package/dist/components/action-sheet/style.css +10 -1
- package/dist/components/activity-view/main.d.ts +1 -1
- package/dist/components/activity-view/main.d.ts.map +1 -1
- package/dist/components/activity-view/main.js +9 -11
- package/dist/components/activity-view/main.js.map +1 -1
- package/dist/components/activity-view/style.css +21 -21
- package/dist/components/alert/main.d.ts +2 -3
- package/dist/components/alert/main.d.ts.map +1 -1
- package/dist/components/alert/main.js +12 -15
- package/dist/components/alert/main.js.map +1 -1
- package/dist/components/alert/props.d.ts +3 -3
- package/dist/components/alert/style.css +23 -23
- package/dist/components/avatar/main.d.ts.map +1 -1
- package/dist/components/avatar/main.js +7 -8
- package/dist/components/avatar/main.js.map +1 -1
- package/dist/components/avatar/style.css +1 -1
- package/dist/components/badge/main.d.ts +1 -1
- package/dist/components/badge/main.js +4 -4
- package/dist/components/badge/main.js.map +1 -1
- package/dist/components/badge/style.css +7 -2
- package/dist/components/button/main.d.ts.map +1 -1
- package/dist/components/button/main.js +9 -9
- 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 +27 -29
- 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 +3 -3
- package/dist/components/color-picker/color.d.ts +23 -0
- package/dist/components/color-picker/color.d.ts.map +1 -0
- package/dist/components/color-picker/color.js +150 -0
- package/dist/components/color-picker/color.js.map +1 -0
- package/dist/components/color-picker/main.d.ts +41 -5
- package/dist/components/color-picker/main.d.ts.map +1 -1
- package/dist/components/color-picker/main.js +633 -99
- package/dist/components/color-picker/main.js.map +1 -1
- package/dist/components/color-picker/named-colors.d.ts +3 -0
- package/dist/components/color-picker/named-colors.d.ts.map +1 -0
- package/dist/components/color-picker/named-colors.js +152 -0
- package/dist/components/color-picker/named-colors.js.map +1 -0
- package/dist/components/color-picker/props.d.ts +97 -14
- package/dist/components/color-picker/props.d.ts.map +1 -1
- package/dist/components/color-picker/style.css +316 -50
- package/dist/components/contextual-menu/main.d.ts.map +1 -1
- package/dist/components/contextual-menu/main.js +189 -236
- package/dist/components/contextual-menu/main.js.map +1 -1
- package/dist/components/contextual-menu/props.d.ts +10 -33
- package/dist/components/contextual-menu/props.d.ts.map +1 -1
- package/dist/components/contextual-menu/style.css +60 -34
- package/dist/components/date-picker/main.d.ts.map +1 -1
- package/dist/components/date-picker/main.js +100 -66
- package/dist/components/date-picker/main.js.map +1 -1
- package/dist/components/date-picker/props.d.ts +10 -10
- package/dist/components/date-picker/props.d.ts.map +1 -1
- package/dist/components/date-picker/style.css +51 -47
- package/dist/components/drawer/main.d.ts.map +1 -1
- package/dist/components/drawer/main.js +52 -7
- package/dist/components/drawer/main.js.map +1 -1
- package/dist/components/drawer/style.css +1 -1
- package/dist/components/edit-menu/main.d.ts.map +1 -1
- package/dist/components/edit-menu/main.js +41 -30
- package/dist/components/edit-menu/main.js.map +1 -1
- package/dist/components/edit-menu/props.d.ts +4 -4
- package/dist/components/edit-menu/props.d.ts.map +1 -1
- package/dist/components/edit-menu/style.css +27 -1
- package/dist/components/form/main.js +3 -3
- package/dist/components/form/main.js.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 +157 -157
- package/dist/components/header/main.d.ts.map +1 -1
- package/dist/components/header/main.js +27 -26
- package/dist/components/header/main.js.map +1 -1
- package/dist/components/header/style.css +13 -52
- package/dist/components/index.d.ts +6 -6
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/main.js +5 -5
- package/dist/components/layout/main.js.map +1 -1
- package/dist/components/layout/style.css +2 -2
- package/dist/components/list/main.d.ts +11 -3
- package/dist/components/list/main.d.ts.map +1 -1
- package/dist/components/list/main.js +296 -300
- package/dist/components/list/main.js.map +1 -1
- package/dist/components/list/props.d.ts +49 -16
- 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 +206 -158
- package/dist/components/menu/main.d.ts +81 -30
- package/dist/components/menu/main.d.ts.map +1 -1
- package/dist/components/menu/main.js +568 -93
- package/dist/components/menu/main.js.map +1 -1
- package/dist/components/menu/props.d.ts +3 -4
- package/dist/components/menu/props.d.ts.map +1 -1
- package/dist/components/menu/style.css +30 -12
- package/dist/components/navigation/main.d.ts +5 -2
- package/dist/components/navigation/main.d.ts.map +1 -1
- package/dist/components/navigation/main.js +287 -57
- package/dist/components/navigation/main.js.map +1 -1
- package/dist/components/navigation/props.d.ts +37 -4
- package/dist/components/navigation/props.d.ts.map +1 -1
- package/dist/components/navigation/style.css +32 -2
- package/dist/components/page/main.d.ts.map +1 -1
- package/dist/components/page/main.js +12 -7
- package/dist/components/page/main.js.map +1 -1
- package/dist/components/page/props.d.ts +1 -1
- package/dist/components/page/style.css +3 -6
- package/dist/components/page-control/main.d.ts +1 -1
- package/dist/components/page-control/main.js +9 -9
- package/dist/components/page-control/main.js.map +1 -1
- package/dist/components/page-control/style.css +2 -2
- package/dist/components/popover/main.d.ts +1 -1
- package/dist/components/popover/main.d.ts.map +1 -1
- package/dist/components/popover/main.js +41 -17
- package/dist/components/popover/main.js.map +1 -1
- package/dist/components/popover/props.d.ts +2 -2
- package/dist/components/popover/style.css +10 -1
- package/dist/components/progress/main.d.ts +1 -2
- package/dist/components/progress/main.d.ts.map +1 -1
- package/dist/components/progress/main.js +45 -19
- package/dist/components/progress/main.js.map +1 -1
- package/dist/components/progress/props.d.ts +22 -8
- package/dist/components/progress/props.d.ts.map +1 -1
- package/dist/components/progress/style.css +15 -15
- package/dist/components/roll/main.js +10 -10
- package/dist/components/roll/main.js.map +1 -1
- package/dist/components/roll/props.d.ts +1 -1
- package/dist/components/roll/style.css +11 -11
- package/dist/components/segmented/main.d.ts.map +1 -1
- package/dist/components/segmented/main.js +183 -31
- package/dist/components/segmented/main.js.map +1 -1
- package/dist/components/segmented/props.d.ts +7 -0
- package/dist/components/segmented/props.d.ts.map +1 -1
- package/dist/components/segmented/style.css +148 -14
- package/dist/components/sheet/main.d.ts +6 -5
- package/dist/components/sheet/main.d.ts.map +1 -1
- package/dist/components/sheet/main.js +53 -27
- package/dist/components/sheet/main.js.map +1 -1
- package/dist/components/sheet/props.d.ts +29 -1
- package/dist/components/sheet/props.d.ts.map +1 -1
- package/dist/components/sheet/style.css +138 -33
- 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 +8 -8
- package/dist/components/slider/main.d.ts.map +1 -1
- package/dist/components/slider/main.js +19 -19
- 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 +25 -25
- package/dist/components/stepper/main.d.ts.map +1 -1
- package/dist/components/stepper/main.js +13 -15
- package/dist/components/stepper/main.js.map +1 -1
- package/dist/components/stepper/style.css +8 -8
- package/dist/components/switch/main.d.ts.map +1 -1
- package/dist/components/switch/main.js +25 -18
- package/dist/components/switch/main.js.map +1 -1
- package/dist/components/switch/props.d.ts +5 -3
- package/dist/components/switch/props.d.ts.map +1 -1
- package/dist/components/switch/style.css +13 -17
- package/dist/components/symbol/main.d.ts +1 -1
- package/dist/components/symbol/main.d.ts.map +1 -1
- package/dist/components/symbol/main.js +6 -5
- package/dist/components/symbol/main.js.map +1 -1
- package/dist/components/symbol/props.d.ts +3 -3
- package/dist/components/symbol/style.css +1 -1
- 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 +78 -59
- package/dist/components/tab-bar/main.js.map +1 -1
- package/dist/components/tab-bar/props.d.ts +3 -3
- package/dist/components/tab-bar/style.css +92 -56
- 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 +26 -28
- package/dist/components/text-field/main.js.map +1 -1
- package/dist/components/text-field/props.d.ts +16 -1
- package/dist/components/text-field/props.d.ts.map +1 -1
- package/dist/components/text-field/style.css +105 -31
- package/dist/components/toolbar/main.d.ts.map +1 -1
- package/dist/components/toolbar/main.js +18 -20
- 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 +13 -13
- package/dist/components/tooltip/main.js +4 -4
- package/dist/components/tooltip/main.js.map +1 -1
- package/dist/components/tooltip/style.css +5 -5
- 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 +10 -12
- package/dist/components/typography/main.js.map +1 -1
- package/dist/components/typography/props.d.ts +9 -9
- package/dist/components/typography/props.d.ts.map +1 -1
- package/dist/components/typography/style.css +503 -503
- package/dist/components/utils/main.d.ts +52 -6
- package/dist/components/utils/main.d.ts.map +1 -1
- package/dist/components/utils/main.js +163 -6
- package/dist/components/utils/main.js.map +1 -1
- package/dist/components/utils/props.d.ts +24 -3
- package/dist/components/utils/props.d.ts.map +1 -1
- package/dist/components/utils/style.css +4 -4
- 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 +19 -3
- package/dist/components/viewport/input.d.ts.map +1 -1
- package/dist/components/viewport/input.js +197 -12
- package/dist/components/viewport/input.js.map +1 -1
- package/dist/components/viewport/main.d.ts +10 -5
- package/dist/components/viewport/main.d.ts.map +1 -1
- package/dist/components/viewport/main.js +327 -90
- package/dist/components/viewport/main.js.map +1 -1
- package/dist/components/viewport/padding.d.ts +31 -3
- package/dist/components/viewport/padding.d.ts.map +1 -1
- package/dist/components/viewport/padding.js +116 -17
- package/dist/components/viewport/padding.js.map +1 -1
- package/dist/components/viewport/props.d.ts +69 -8
- package/dist/components/viewport/props.d.ts.map +1 -1
- package/dist/components/viewport/style.css +230 -6
- package/dist/styles.css +285 -302
- package/package.json +4 -4
|
@@ -1,62 +1,87 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import '../glass/style.css';
|
|
3
3
|
import './style.css';
|
|
4
4
|
import { Drawer as BaseDrawer } from '@base-ui/react/drawer';
|
|
5
|
-
import { forwardRef, useState } from 'react';
|
|
6
|
-
import { cn, usePortalContainer } from '../utils/main.js';
|
|
7
|
-
import { useSizeClass, ViewportScopeContext } from '../viewport/main.js';
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
// - large (Figma “Full Screen - iPhone”): opaque (elevated background:
|
|
5
|
+
import { Children, createContext, forwardRef, isValidElement, useContext, useState, } from 'react';
|
|
6
|
+
import { cn, useForwardedRef, usePortalContainer } from '../utils/main.js';
|
|
7
|
+
import { EdgeEffects, useAnchorRegistration, useScrollerRegistration, useSizeClass, ViewportScopeContext, } from '../viewport/main.js';
|
|
8
|
+
// Sheets, over the page dimmed (black, 20%; dark: 48%):
|
|
9
|
+
// - large: opaque (elevated background:
|
|
11
10
|
// white; dark: #1c1c1e), from 10px below the top to the bottom, its top
|
|
12
11
|
// corners 38px, its shadow 0 15px 75px at 18%;
|
|
13
|
-
// - medium
|
|
14
|
-
// bottom, as high as its
|
|
15
|
-
//
|
|
16
|
-
//
|
|
12
|
+
// - medium: glass, 6px from the sides, on the bottom safe area (the home
|
|
13
|
+
// indicator below it; without one, 6px from the bottom), as high as its
|
|
14
|
+
// content, its corners 34px;
|
|
15
|
+
// - in a regular width (the window from 768px, or not `compact`), a form
|
|
16
|
+
// sheet: opaque, centered, up to 936px by 852px, its
|
|
17
17
|
// corners 38px.
|
|
18
|
-
// Its header
|
|
19
|
-
// the top, #cfcfcf; optional) above the app's content (e.g. a `Toolbar`:
|
|
20
|
-
//
|
|
18
|
+
// Its header: a grabber (`Grabber`, 36px by 5px, 5px from
|
|
19
|
+
// the top, #cfcfcf; optional) above the app's content (e.g. a `Toolbar`: a 44px title and
|
|
20
|
+
// controls). Base UI's `Drawer` (a `Dialog` with gestures): modal,
|
|
21
21
|
// dismissed by a press outside it (or Escape); swiped down (anywhere, its
|
|
22
22
|
// content scrolled to its top), far enough or flung, too, otherwise
|
|
23
23
|
// springing back.
|
|
24
24
|
//
|
|
25
|
-
//
|
|
25
|
+
// Also:
|
|
26
26
|
// - The glass is the menus' (see `Menu`).
|
|
27
27
|
// - Detents don't change by dragging (`detent` is the app's), and the page
|
|
28
|
-
// behind a large sheet doesn't shrink back (
|
|
28
|
+
// behind a large sheet doesn't shrink back (no stacked look).
|
|
29
29
|
// Opaque, grouped (`background`, for grouped lists, as a page's): on the
|
|
30
30
|
// grouped background, a list in it without its own (which would end with
|
|
31
31
|
// it, the sheet's around it). In it,
|
|
32
|
-
//
|
|
32
|
+
// the elevated backgrounds (dark mode: #1c1c1e, groups #2c2c2e), as
|
|
33
33
|
// tokens for all its content (e.g. a navigation's pages).
|
|
34
|
+
/** Its root's `swipeDirection`: `none`, not swiped away at all. */
|
|
35
|
+
const NoSwipeContext = createContext(false);
|
|
36
|
+
/**
|
|
37
|
+
* Base UI's `Drawer.Root`, its `swipeDirection` also `none`: its popup
|
|
38
|
+
* then ignored by its swipes (Base UI's swipe ignore, see `Popup`).
|
|
39
|
+
*/
|
|
40
|
+
const Root = ({ swipeDirection, ...props }) => (_jsx(NoSwipeContext.Provider, { value: swipeDirection === 'none', children: _jsx(BaseDrawer.Root, { swipeDirection: swipeDirection === 'none' ? undefined : swipeDirection, ...props }) }));
|
|
34
41
|
/** The sheet, the page dimmed behind it. */
|
|
35
42
|
const Popup = forwardRef(({ background = 'plain', className, compact: compactProp, container, detent = 'large', ...props }, ref) => {
|
|
36
43
|
// (By the window's size class, see Viewport.)
|
|
37
44
|
const sizeClass = useSizeClass();
|
|
45
|
+
const isNotSwiped = useContext(NoSwipeContext);
|
|
38
46
|
const isCompact = compactProp ?? sizeClass === 'compact';
|
|
39
47
|
// Its anchors' scope: fixed to it (see Viewport.Padding).
|
|
40
48
|
const [scope] = useState(() => ({}));
|
|
41
|
-
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'
|
|
49
|
+
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-base-ui-swipe-ignore": isNotSwiped ? '' : undefined, "data-compact": isCompact ? '' : undefined, "data-detent": detent, "data-sheet-part": "popup", className: cn('uikit-sheet-popup', isCompact && detent === 'medium'
|
|
42
50
|
? cn('uikit-glass-medium', className)
|
|
43
51
|
: className), ...props }) })] }) }));
|
|
44
52
|
});
|
|
45
53
|
/**
|
|
46
|
-
* Its
|
|
47
|
-
* `Toolbar`); with only a grabber, over the content (see style.css).
|
|
48
|
-
*/
|
|
49
|
-
const Header = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, "data-sheet-part": "header", ...props, className: cn('uikit-sheet-header', className) })));
|
|
50
|
-
/**
|
|
51
|
-
* Its grabber (Figma: 36px by 5px, 5px from the top): showing the sheet
|
|
54
|
+
* Its grabber (36px by 5px, 5px from the top): showing the sheet
|
|
52
55
|
* can be swiped (it can be anywhere); left out, a cleaner top.
|
|
53
56
|
*/
|
|
54
57
|
const Grabber = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, "aria-hidden": "true", "data-sheet-part": "grabber", ...props, className: cn('uikit-sheet-grabber', className) })));
|
|
58
|
+
/** Not registered (see `Header`). */
|
|
59
|
+
const noElement = { current: null };
|
|
60
|
+
/**
|
|
61
|
+
* Its header: its grabber (`Grabber`), above the app's content (e.g. a
|
|
62
|
+
* `Toolbar`). Over the content, which scrolls under it (its edge effect,
|
|
63
|
+
* see `EdgeEffects`): a bar of the sheet's (a block-start anchor in its
|
|
64
|
+
* scope), its content making room with a `Viewport.Padding` (as a page
|
|
65
|
+
* under its toolbar). Only a grabber: over the content too, no bar (the
|
|
66
|
+
* content's own bars below it, see style.css).
|
|
67
|
+
*/
|
|
68
|
+
const Header = forwardRef(({ children, className, edgeEffect = 'soft', edgeTint, ...props }, forwardedRef) => {
|
|
69
|
+
const ref = useForwardedRef(forwardedRef);
|
|
70
|
+
const isGrabberOnly = Children.toArray(children).every((child) => isValidElement(child) && child.type === Grabber);
|
|
71
|
+
useAnchorRegistration(isGrabberOnly ? noElement : ref, 'block-start', undefined, { effect: edgeEffect, tint: edgeTint });
|
|
72
|
+
return (_jsx("div", { ref: ref, "data-sheet-part": "header", ...props, className: cn('uikit-sheet-header', className), children: children }));
|
|
73
|
+
});
|
|
55
74
|
/**
|
|
56
75
|
* Its content, scrolling (Base UI's `Drawer.Content`: its text selectable by
|
|
57
|
-
* a mouse without swiping the sheet)
|
|
76
|
+
* a mouse without swiping the sheet); a scroller (registered), drawing its
|
|
77
|
+
* bars' edge effects (see `Viewport`): beside it, not in it, so its mask
|
|
78
|
+
* (fading it out under the header, see style.css) leaves them be.
|
|
58
79
|
*/
|
|
59
|
-
const Content = forwardRef(({ className, ...props },
|
|
80
|
+
const Content = forwardRef(({ children, className, ...props }, forwardedRef) => {
|
|
81
|
+
const ref = useForwardedRef(forwardedRef);
|
|
82
|
+
useScrollerRegistration(ref);
|
|
83
|
+
return (_jsxs(_Fragment, { children: [_jsx(BaseDrawer.Content, { ref: ref, className: cn('uikit-sheet-content', className), "data-sheet-part": "content", "data-viewport-scroller": "", ...props, children: children }), _jsx(EdgeEffects, { scroller: ref })] }));
|
|
84
|
+
});
|
|
60
85
|
/**
|
|
61
86
|
* A handle linking a sheet (its `handle`) to its triggers outside it, and
|
|
62
87
|
* opening or closing it imperatively (Base UI's `Drawer.createHandle`):
|
|
@@ -70,12 +95,13 @@ export const useCreateSheetHandle = () => {
|
|
|
70
95
|
return handle;
|
|
71
96
|
};
|
|
72
97
|
/**
|
|
73
|
-
* A sheet (
|
|
98
|
+
* A sheet (Base UI's `Drawer`): a
|
|
74
99
|
* modal panel for a scoped task, from the bottom (large or medium), or a
|
|
75
100
|
* form sheet in a regular width.
|
|
76
101
|
*/
|
|
77
102
|
export const Sheet = {
|
|
78
103
|
...BaseDrawer,
|
|
104
|
+
Root,
|
|
79
105
|
Popup,
|
|
80
106
|
Header,
|
|
81
107
|
Grabber,
|
|
@@ -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,
|
|
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,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,cAAc,EAEd,UAAU,EACV,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,uBAAuB,EACvB,YAAY,EACZ,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAqB7B,wDAAwD;AACxD,wCAAwC;AACxC,0EAA0E;AAC1E,iDAAiD;AACjD,yEAAyE;AACzE,0EAA0E;AAC1E,+BAA+B;AAC/B,yEAAyE;AACzE,uDAAuD;AACvD,kBAAkB;AAClB,0DAA0D;AAC1D,0FAA0F;AAC1F,mEAAmE;AACnE,0EAA0E;AAC1E,oEAAoE;AACpE,kBAAkB;AAClB,EAAE;AACF,QAAQ;AACR,0CAA0C;AA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,KAAK;IACL,MAAM;IACN,OAAO;IACP,OAAO;IACP,YAAY;CACb,CAAC"}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import type { Drawer as BaseDrawer } from '@base-ui/react/drawer';
|
|
2
2
|
import type { Properties } from 'csstype';
|
|
3
3
|
import type { ComponentProps } from 'react';
|
|
4
|
+
import type { ViewportEdgeEffect } from '../viewport/main.js';
|
|
4
5
|
export type SheetDetent = 'large' | 'medium';
|
|
6
|
+
/**
|
|
7
|
+
* The direction a sheet is swiped away in (Base UI's `Drawer`'s), or
|
|
8
|
+
* `none`: not swiped away at all.
|
|
9
|
+
*/
|
|
10
|
+
export type SheetSwipeDirection = 'down' | 'left' | 'none' | 'right' | 'up';
|
|
11
|
+
export type SheetRootProps<Payload = unknown> = Omit<BaseDrawer.Root.Props<Payload>, 'swipeDirection'> & {
|
|
12
|
+
/**
|
|
13
|
+
* The direction it's swiped away in (also its exit then: following the
|
|
14
|
+
* flick, out through that edge), or `none`: not swiped away (closed by
|
|
15
|
+
* a press outside it, Escape, or its close button only).
|
|
16
|
+
* @default 'down'
|
|
17
|
+
*/
|
|
18
|
+
swipeDirection?: SheetSwipeDirection;
|
|
19
|
+
};
|
|
5
20
|
export type SheetPopupProps = Omit<BaseDrawer.Popup.Props, 'ref'> & {
|
|
6
21
|
/**
|
|
7
22
|
* Its background (as a page's, see `Page.Root`): `grouped` for grouped
|
|
@@ -25,12 +40,25 @@ export type SheetPopupProps = Omit<BaseDrawer.Popup.Props, 'ref'> & {
|
|
|
25
40
|
*/
|
|
26
41
|
container?: BaseDrawer.Portal.Props['container'];
|
|
27
42
|
/**
|
|
28
|
-
* Its height
|
|
43
|
+
* Its height in a compact width (a phone's): the whole screen, or its
|
|
29
44
|
* content's (a floating glass panel).
|
|
30
45
|
* @default 'large'
|
|
31
46
|
*/
|
|
32
47
|
detent?: SheetDetent;
|
|
33
48
|
};
|
|
49
|
+
export type SheetHeaderProps = ComponentProps<'div'> & {
|
|
50
|
+
/**
|
|
51
|
+
* Its scroll edge effect, as the content scrolls under it (see
|
|
52
|
+
* `Viewport.Anchor`): `soft`, a blur fading out away from it; `hard`, a
|
|
53
|
+
* solid backing with a dividing line; `none`. Only a grabber: none.
|
|
54
|
+
* @default 'soft'
|
|
55
|
+
*/
|
|
56
|
+
edgeEffect?: ViewportEdgeEffect;
|
|
57
|
+
/**
|
|
58
|
+
* A color for its edge effect, shown at rest too (see `Viewport.Anchor`).
|
|
59
|
+
*/
|
|
60
|
+
edgeTint?: string;
|
|
61
|
+
};
|
|
34
62
|
export type SheetContentProps = Omit<BaseDrawer.Content.Props, 'ref'>;
|
|
35
63
|
/** A handle linking a sheet to its triggers outside it. */
|
|
36
64
|
export type SheetHandle<Payload = unknown> = BaseDrawer.Handle<Payload>;
|
|
@@ -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;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,CA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;;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,gBAAgB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACrD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,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"}
|
|
@@ -43,27 +43,27 @@
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.uikit-sheet-popup {
|
|
46
|
-
/*
|
|
46
|
+
/* An elevated level (a modal presentation's): in dark mode, the
|
|
47
47
|
backgrounds a step lighter, for everything in it (its lists, pages,
|
|
48
48
|
a navigation's). */
|
|
49
|
-
--color-
|
|
50
|
-
--color-
|
|
49
|
+
--color-ui-system-background: light-dark(rgb(255 255 255), rgb(28 28 30));
|
|
50
|
+
--color-ui-secondary-system-background: light-dark(
|
|
51
51
|
rgb(242 242 247),
|
|
52
52
|
rgb(44 44 46)
|
|
53
53
|
);
|
|
54
|
-
--color-
|
|
54
|
+
--color-ui-tertiary-system-background: light-dark(
|
|
55
55
|
rgb(255 255 255),
|
|
56
56
|
rgb(58 58 60)
|
|
57
57
|
);
|
|
58
|
-
--color-
|
|
58
|
+
--color-ui-system-grouped-background: light-dark(
|
|
59
59
|
rgb(242 242 247),
|
|
60
60
|
rgb(28 28 30)
|
|
61
61
|
);
|
|
62
|
-
--color-
|
|
62
|
+
--color-ui-secondary-system-grouped-background: light-dark(
|
|
63
63
|
rgb(255 255 255),
|
|
64
64
|
rgb(44 44 46)
|
|
65
65
|
);
|
|
66
|
-
--color-
|
|
66
|
+
--color-ui-tertiary-system-grouped-background: light-dark(
|
|
67
67
|
rgb(242 242 247),
|
|
68
68
|
rgb(58 58 60)
|
|
69
69
|
);
|
|
@@ -74,14 +74,15 @@
|
|
|
74
74
|
overflow: hidden;
|
|
75
75
|
box-sizing: border-box;
|
|
76
76
|
flex-direction: column;
|
|
77
|
-
color: var(--color-
|
|
77
|
+
color: var(--color-ui-label);
|
|
78
78
|
outline: none;
|
|
79
79
|
pointer-events: auto;
|
|
80
80
|
|
|
81
|
-
/*
|
|
81
|
+
/* A critically damped spring; swiped,
|
|
82
82
|
following the finger (a transform: Base UI's own while it's swiped,
|
|
83
83
|
overriding this one). */
|
|
84
|
-
transform:
|
|
84
|
+
transform: translate(
|
|
85
|
+
var(--drawer-swipe-movement-x, 0),
|
|
85
86
|
calc(
|
|
86
87
|
var(--drawer-snap-point-offset, 0px) +
|
|
87
88
|
var(--drawer-swipe-movement-y, 0px)
|
|
@@ -94,6 +95,22 @@
|
|
|
94
95
|
transform: translateY(100%);
|
|
95
96
|
}
|
|
96
97
|
|
|
98
|
+
/* Swiped away another way (`swipeDirection`): on from the flick, out
|
|
99
|
+
through that edge (a screen's length past it, wherever it is). */
|
|
100
|
+
&[data-ending-style][data-swipe-dismiss] {
|
|
101
|
+
&[data-swipe-direction='up'] {
|
|
102
|
+
transform: translateY(-100lvh);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&[data-swipe-direction='left'] {
|
|
106
|
+
transform: translateX(-100lvw);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&[data-swipe-direction='right'] {
|
|
110
|
+
transform: translateX(100lvw);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
97
114
|
/* Let go (swiped): as fast as it was flung. */
|
|
98
115
|
&[data-ending-style] {
|
|
99
116
|
transition-duration: calc(var(--drawer-swipe-strength, 1) * 500ms);
|
|
@@ -115,13 +132,10 @@
|
|
|
115
132
|
/* The screen's bottom inset, for its content (see below). */
|
|
116
133
|
--uikit-sheet-inset-bottom: var(--uikit-safe-area-inset-bottom, 0px);
|
|
117
134
|
|
|
118
|
-
/* Medium (
|
|
119
|
-
|
|
135
|
+
/* Medium (on the bottom inset, see below): none left; a form sheet:
|
|
136
|
+
none. */
|
|
120
137
|
&[data-detent='medium'] > * {
|
|
121
|
-
--uikit-safe-area-inset-bottom:
|
|
122
|
-
0px,
|
|
123
|
-
var(--uikit-sheet-inset-bottom) - 6px
|
|
124
|
-
);
|
|
138
|
+
--uikit-safe-area-inset-bottom: 0px;
|
|
125
139
|
}
|
|
126
140
|
|
|
127
141
|
&:not([data-compact]) > * {
|
|
@@ -133,9 +147,17 @@
|
|
|
133
147
|
--uikit-safe-area-inset-bottom: 0px;
|
|
134
148
|
}
|
|
135
149
|
|
|
150
|
+
/* (Its background, for its header's edge effect: see Viewport.) */
|
|
151
|
+
--uikit-viewport-edge-background: var(--color-ui-system-background);
|
|
152
|
+
|
|
153
|
+
/* A heavier veil than a page's (a secondary scroller): its content
|
|
154
|
+
hidden under more of its bars, the header's (see the content) and
|
|
155
|
+
those in it (e.g. a navigation's). */
|
|
156
|
+
--uikit-viewport-edge-veil: 0.75;
|
|
157
|
+
|
|
136
158
|
&[data-detent='large'] {
|
|
137
159
|
border-radius: 38px 38px 0 0;
|
|
138
|
-
background-color: var(--color-
|
|
160
|
+
background-color: var(--color-ui-system-background);
|
|
139
161
|
box-shadow: 0 15px 75px rgb(0 0 0 / 18%);
|
|
140
162
|
inset: calc(10px + var(--uikit-safe-area-inset-top, 0px)) 0 0;
|
|
141
163
|
}
|
|
@@ -144,17 +166,40 @@
|
|
|
144
166
|
without its own (which would end with it, the sheet's around it). */
|
|
145
167
|
&[data-detent='large'][data-background='grouped'] {
|
|
146
168
|
--uikit-list-container-background: transparent;
|
|
169
|
+
--uikit-viewport-edge-background: var(
|
|
170
|
+
--color-ui-system-grouped-background
|
|
171
|
+
);
|
|
147
172
|
|
|
148
|
-
background-color: var(--color-
|
|
173
|
+
background-color: var(--color-ui-system-grouped-background);
|
|
149
174
|
}
|
|
150
175
|
|
|
176
|
+
/* On the bottom inset (the home indicator below it, not under it);
|
|
177
|
+
without one, 6px from the edge. */
|
|
151
178
|
&[data-detent='medium'] {
|
|
152
179
|
right: 6px;
|
|
153
|
-
bottom: 6px;
|
|
180
|
+
bottom: max(6px, var(--uikit-sheet-inset-bottom));
|
|
154
181
|
left: 6px;
|
|
155
|
-
|
|
182
|
+
|
|
183
|
+
/* Up to the screen but 64px, nor into the top inset (below it as a
|
|
184
|
+
large one, at most). */
|
|
185
|
+
max-height: min(
|
|
186
|
+
100% - 64px,
|
|
187
|
+
100% - max(6px, var(--uikit-sheet-inset-bottom)) -
|
|
188
|
+
var(--uikit-safe-area-inset-top, 0px) - 10px
|
|
189
|
+
);
|
|
156
190
|
border-radius: 34px;
|
|
157
191
|
color: var(--uikit-glass-content);
|
|
192
|
+
|
|
193
|
+
/* (None: its glass translucent, painted over itself again it'd
|
|
194
|
+
lighten; its content fading out under its header instead, see the
|
|
195
|
+
content.) */
|
|
196
|
+
--uikit-viewport-edge-background: transparent;
|
|
197
|
+
|
|
198
|
+
/* Nor a blur (its backdrop the glass's tint, blurred over it: the
|
|
199
|
+
tint twice). */
|
|
200
|
+
& > .uikit-viewport-edge-effect[data-edge-effect='soft']::before {
|
|
201
|
+
backdrop-filter: none;
|
|
202
|
+
}
|
|
158
203
|
}
|
|
159
204
|
|
|
160
205
|
/* A form sheet (not compact: a regular width, see main.tsx). */
|
|
@@ -162,16 +207,21 @@
|
|
|
162
207
|
width: min(936px, calc(100% - 64px));
|
|
163
208
|
height: min(852px, calc(100% - 64px));
|
|
164
209
|
border-radius: 38px;
|
|
165
|
-
background-color: var(--color-
|
|
210
|
+
background-color: var(--color-ui-system-background);
|
|
166
211
|
box-shadow: 0 15px 75px rgb(0 0 0 / 18%);
|
|
167
|
-
color: var(--color-
|
|
212
|
+
color: var(--color-ui-label);
|
|
168
213
|
inset: 50% auto auto 50%;
|
|
169
214
|
translate: -50% -50%;
|
|
170
215
|
|
|
216
|
+
--uikit-viewport-edge-background: var(--color-ui-system-background);
|
|
217
|
+
|
|
171
218
|
&[data-background='grouped'] {
|
|
172
219
|
--uikit-list-container-background: transparent;
|
|
220
|
+
--uikit-viewport-edge-background: var(
|
|
221
|
+
--color-ui-system-grouped-background
|
|
222
|
+
);
|
|
173
223
|
|
|
174
|
-
background-color: var(--color-
|
|
224
|
+
background-color: var(--color-ui-system-grouped-background);
|
|
175
225
|
}
|
|
176
226
|
|
|
177
227
|
&[data-starting-style],
|
|
@@ -181,26 +231,42 @@
|
|
|
181
231
|
}
|
|
182
232
|
}
|
|
183
233
|
|
|
234
|
+
/* Over the content, which scrolls under it (a bar of the sheet's, its
|
|
235
|
+
edge effect the content's, beneath it: see main.tsx), its content
|
|
236
|
+
making room for it (its `Viewport.Padding`). Composited itself: the
|
|
237
|
+
content scrolls (iOS composites it), and Safari otherwise relies on its
|
|
238
|
+
overlap testing to draw the header after it, which misses it far down a
|
|
239
|
+
scrolled document (e.g. an inline demo), leaving it hidden (until
|
|
240
|
+
something recomposites, e.g. a button's press). Its spacing in its
|
|
241
|
+
content box (as its size, measured: see `Viewport.Anchor`). */
|
|
184
242
|
.uikit-sheet-header {
|
|
243
|
+
position: absolute;
|
|
244
|
+
z-index: 10;
|
|
185
245
|
display: flex;
|
|
186
|
-
flex: none;
|
|
187
246
|
flex-direction: column;
|
|
188
247
|
align-items: stretch;
|
|
189
|
-
|
|
248
|
+
inset: 0 0 auto;
|
|
190
249
|
-webkit-user-select: none;
|
|
191
250
|
user-select: none;
|
|
251
|
+
will-change: transform;
|
|
252
|
+
|
|
253
|
+
/* 10px below its content. */
|
|
254
|
+
&::after {
|
|
255
|
+
height: 10px;
|
|
256
|
+
flex: none;
|
|
257
|
+
content: '';
|
|
258
|
+
}
|
|
192
259
|
|
|
193
260
|
/* Without a grabber: its content where it'd be with one (16px down). */
|
|
194
|
-
&:not(:has(> .uikit-sheet-grabber)) {
|
|
195
|
-
|
|
261
|
+
&:not(:has(> .uikit-sheet-grabber))::before {
|
|
262
|
+
height: 16px;
|
|
263
|
+
flex: none;
|
|
264
|
+
content: '';
|
|
196
265
|
}
|
|
197
266
|
|
|
198
|
-
/* Only a grabber:
|
|
199
|
-
&:has(> .uikit-sheet-grabber:only-child) {
|
|
200
|
-
|
|
201
|
-
z-index: 1;
|
|
202
|
-
inset: 0 0 auto;
|
|
203
|
-
padding-block-end: 0;
|
|
267
|
+
/* Only a grabber: no bar (the content's own bars below it). */
|
|
268
|
+
&:has(> .uikit-sheet-grabber:only-child)::after {
|
|
269
|
+
display: none;
|
|
204
270
|
}
|
|
205
271
|
}
|
|
206
272
|
|
|
@@ -232,6 +298,27 @@
|
|
|
232
298
|
}
|
|
233
299
|
}
|
|
234
300
|
|
|
301
|
+
/* Its content's edge effects (see Sheet.Content: beside it, the popup's
|
|
302
|
+
children), within its corners: rounded as the popup's at their edge,
|
|
303
|
+
as browsers don't all clip a backdrop filter to its rounded overflow
|
|
304
|
+
(WebKit). */
|
|
305
|
+
.uikit-sheet-popup > .uikit-viewport-edge-effect {
|
|
306
|
+
&[data-edge='block-start'] {
|
|
307
|
+
border-start-end-radius: inherit;
|
|
308
|
+
border-start-start-radius: inherit;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
&[data-edge='block-end'] {
|
|
312
|
+
border-end-end-radius: inherit;
|
|
313
|
+
border-end-start-radius: inherit;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
&::before,
|
|
317
|
+
&::after {
|
|
318
|
+
border-radius: inherit;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
235
322
|
.uikit-sheet-content {
|
|
236
323
|
overflow: auto;
|
|
237
324
|
min-height: 0;
|
|
@@ -244,6 +331,24 @@
|
|
|
244
331
|
List). */
|
|
245
332
|
padding-block-end: var(--uikit-safe-area-inset-bottom, 0);
|
|
246
333
|
|
|
334
|
+
/* Under its header (a bar, not only a grabber), fading out: hidden
|
|
335
|
+
under the share of it the veil is (`--uikit-viewport-edge-veil`),
|
|
336
|
+
showing past it and its soft effect's reach (16px), whatever the
|
|
337
|
+
sheet's background (its glass too, not lightened by a veil's). */
|
|
338
|
+
.uikit-sheet-popup:has(
|
|
339
|
+
> .uikit-sheet-header > :not(.uikit-sheet-grabber)
|
|
340
|
+
)
|
|
341
|
+
> & {
|
|
342
|
+
mask-image: linear-gradient(
|
|
343
|
+
transparent
|
|
344
|
+
calc(
|
|
345
|
+
var(--uikit-viewport-padding-block-start, 0px) *
|
|
346
|
+
var(--uikit-viewport-edge-veil, 0.75)
|
|
347
|
+
),
|
|
348
|
+
#000 calc(var(--uikit-viewport-padding-block-start, 0px) + 16px)
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
|
|
247
352
|
/* Its header only a grabber (its content's own bars, e.g. a
|
|
248
353
|
navigation's): over the content, which starts at the sheet's top
|
|
249
354
|
(nothing of those bars clipped), its bars below the grabber. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/main.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAWrB,YAAY,EACV,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/main.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAWrB,YAAY,EACV,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AA4DpB,eAAO,MAAM,OAAO;;;;;;;;;;CAInB,CAAC"}
|
|
@@ -3,10 +3,9 @@ import '../glass/style.css';
|
|
|
3
3
|
import './style.css';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { cn } from '../utils/main.js';
|
|
6
|
-
//
|
|
7
|
-
// panel of glass (Figma “Liquid Glass - Large”), its corners 20px, 11px from
|
|
6
|
+
// A sidebar: a floating panel of glass, its corners 20px, 11px from
|
|
8
7
|
// its top, 16px from its sides, 10px from its bottom; its content e.g. a
|
|
9
|
-
// toolbar (
|
|
8
|
+
// toolbar (borderless buttons, Body, symbols 510, the
|
|
10
9
|
// trailing ones 24px apart; 20px above what follows), a search field
|
|
11
10
|
// (`TextField.Search`: 44px high, on the secondary fill) and a list
|
|
12
11
|
// (`List.Root` of style `sidebar`: capsule rows, sections without a shape of
|
|
@@ -14,25 +13,22 @@ import { cn } from '../utils/main.js';
|
|
|
14
13
|
// over the other columns; compact: a drawer, swiped in), which places and sizes
|
|
15
14
|
// it.
|
|
16
15
|
//
|
|
17
|
-
//
|
|
18
|
-
// - The glass is the menus' (`glassMedium`:
|
|
19
|
-
//
|
|
20
|
-
// the sidebar alone); in dark mode, a light rim and a glow outside it (the
|
|
16
|
+
// Also:
|
|
17
|
+
// - The glass is the menus' (`glassMedium`: a fill and a soft glow, without
|
|
18
|
+
// blend modes), 8px from the column's edges; in dark mode, a light rim and a glow outside it (the
|
|
21
19
|
// glass' inner shadow would look inset).
|
|
22
20
|
/**
|
|
23
|
-
* A sidebar
|
|
21
|
+
* A sidebar: a floating glass panel, its
|
|
24
22
|
* content (e.g. a `TextField.Search`, a `List.Root` of style `sidebar`)
|
|
25
23
|
* scrolling inside it; in a `Layout` column (see there).
|
|
26
24
|
*/
|
|
27
25
|
const Root = forwardRef(({ className, ...props }, ref) => (_jsx("nav", { ref: ref, "data-sidebar-part": "root", ...props, className: cn('uikit-sidebar-root uikit-glass-medium', className) })));
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
// top to what follows (Figma: 11px, a 23px row, 20px). Its buttons' shapes
|
|
26
|
+
// Its toolbar: its parts at its ends, their content at the sidebar's (16px
|
|
27
|
+
// in); 54px from the panel's top to what follows. Its buttons' shapes
|
|
31
28
|
// (highlights) evenly 8px from the panel's top and sides, as nested shapes
|
|
32
29
|
// are (text buttons 8px in, symbols as circles).
|
|
33
30
|
const Toolbar = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('uikit-sidebar-toolbar', className), "data-sidebar-part": "toolbar", ...props })));
|
|
34
|
-
// Its buttons at one end
|
|
35
|
-
// apart; here, 34px circles 18px apart).
|
|
31
|
+
// Its buttons at one end: 34px circles 18px apart.
|
|
36
32
|
const ToolbarGroup = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('uikit-sidebar-toolbar-group', className), "data-sidebar-part": "toolbar-group", ...props })));
|
|
37
33
|
export const Sidebar = {
|
|
38
34
|
Root,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/components/sidebar/main.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAatC,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/components/sidebar/main.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAatC,oEAAoE;AACpE,yEAAyE;AACzE,sDAAsD;AACtD,qEAAqE;AACrE,oEAAoE;AACpE,6EAA6E;AAC7E,4EAA4E;AAC5E,gFAAgF;AAChF,MAAM;AACN,EAAE;AACF,QAAQ;AACR,4EAA4E;AAC5E,oGAAoG;AACpG,2CAA2C;AAE3C;;;;GAIG;AACH,MAAM,IAAI,GAAG,UAAU,CACrB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,cACE,GAAG,EAAE,GAAG,uBACU,MAAM,KACpB,KAAK,EACT,SAAS,EAAE,EAAE,CAAC,uCAAuC,EAAE,SAAS,CAAC,GACjE,CACH,CACF,CAAC;AAEF,2EAA2E;AAC3E,sEAAsE;AACtE,2EAA2E;AAC3E,iDAAiD;AACjD,MAAM,OAAO,GAAG,UAAU,CACxB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,cACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,uBAC/B,SAAS,KACvB,KAAK,GACT,CACH,CACF,CAAC;AAEF,mDAAmD;AACnD,MAAM,YAAY,GAAG,UAAU,CAC7B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,cACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,6BAA6B,EAAE,SAAS,CAAC,uBACrC,eAAe,KAC7B,KAAK,GACT,CACH,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI;IACJ,OAAO;IACP,YAAY;CACb,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* Sidebar (see main.tsx). */
|
|
2
2
|
@layer uikit-ish {
|
|
3
3
|
.uikit-sidebar-toolbar {
|
|
4
|
-
--uikit-button-plain-size: var(--font-
|
|
5
|
-
--uikit-button-plain-line-height: var(--font-
|
|
6
|
-
--uikit-button-plain-tracking: var(--font-
|
|
4
|
+
--uikit-button-plain-size: var(--font-ui-body-size);
|
|
5
|
+
--uikit-button-plain-line-height: var(--font-ui-body-line-height);
|
|
6
|
+
--uikit-button-plain-tracking: var(--font-ui-body-tracking);
|
|
7
7
|
--uikit-button-plain-symbol-weight: 510;
|
|
8
8
|
--uikit-button-plain-padding-inline: 8px;
|
|
9
9
|
--uikit-button-plain-background-pressed: var(--uikit-sidebar-selection);
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
|
|
27
27
|
.uikit-sidebar-root {
|
|
28
28
|
/* Its selection's fill (selected and pressed rows, pressed toolbar
|
|
29
|
-
buttons
|
|
29
|
+
buttons). Dark: floating (a light rim, a
|
|
30
30
|
glow outside; the glass' dark inner bands would make the large panel
|
|
31
|
-
look inset
|
|
31
|
+
look inset). */
|
|
32
32
|
--uikit-sidebar-selection: light-dark(
|
|
33
33
|
rgb(0 0 0 / 7%),
|
|
34
34
|
rgb(255 255 255 / 12%)
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
0 0 25px rgb(0 0 0 / 30%);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
/* Its search field (see TextField.Search):
|
|
57
|
+
/* Its search field (see TextField.Search): a fill blended with the
|
|
58
58
|
glass (plus-darker, plus-lighter in dark mode) as a flat color; its
|
|
59
59
|
symbol and placeholder in the glass' secondary content color (#999). */
|
|
60
60
|
--uikit-text-field-search-height: 44px;
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
padding: 11px 16px 10px;
|
|
71
71
|
border-radius: 20px;
|
|
72
72
|
margin: var(--uikit-sidebar-margin, 8px);
|
|
73
|
-
color: var(--color-
|
|
73
|
+
color: var(--color-ui-label);
|
|
74
74
|
|
|
75
|
-
/* Clear of the safe area insets (in a regular layout, e.g.
|
|
75
|
+
/* Clear of the safe area insets (in a regular layout, e.g. a tablet's
|
|
76
76
|
status bar). */
|
|
77
77
|
margin-block: max(
|
|
78
78
|
var(--uikit-sidebar-margin, 8px),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/slider/main.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAiBrB,OAAO,KAAK,EAEV,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAGjB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/slider/main.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAiBrB,OAAO,KAAK,EAEV,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAGjB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAiVpB,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWlB,CAAC"}
|