@mrpelz/uikit-ish 7.26.2 → 7.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/style.css +0 -3
- package/dist/components/activity-view/style.css +17 -17
- package/dist/components/alert/style.css +12 -10
- package/dist/components/avatar/style.css +2 -2
- package/dist/components/badge/style.css +1 -1
- package/dist/components/button/style.css +12 -12
- package/dist/components/card/buttons.d.ts +35 -0
- package/dist/components/card/buttons.d.ts.map +1 -0
- package/dist/components/card/buttons.js +60 -0
- package/dist/components/card/buttons.js.map +1 -0
- package/dist/components/card/channels.d.ts +43 -0
- package/dist/components/card/channels.d.ts.map +1 -0
- package/dist/components/card/channels.js +321 -0
- package/dist/components/card/channels.js.map +1 -0
- package/dist/components/card/color.d.ts +21 -0
- package/dist/components/card/color.d.ts.map +1 -0
- package/dist/components/card/color.js +100 -0
- package/dist/components/card/color.js.map +1 -0
- package/dist/components/card/main.d.ts +67 -39
- package/dist/components/card/main.d.ts.map +1 -1
- package/dist/components/card/main.js +79 -274
- package/dist/components/card/main.js.map +1 -1
- package/dist/components/card/parts.css +769 -0
- package/dist/components/card/press.d.ts +25 -0
- package/dist/components/card/press.d.ts.map +1 -0
- package/dist/components/card/press.js +111 -0
- package/dist/components/card/press.js.map +1 -0
- package/dist/components/card/progress.d.ts +43 -0
- package/dist/components/card/progress.d.ts.map +1 -0
- package/dist/components/card/progress.js +122 -0
- package/dist/components/card/progress.js.map +1 -0
- package/dist/components/card/props.d.ts +324 -14
- package/dist/components/card/props.d.ts.map +1 -1
- package/dist/components/card/root.d.ts +100 -0
- package/dist/components/card/root.d.ts.map +1 -0
- package/dist/components/card/root.js +388 -0
- package/dist/components/card/root.js.map +1 -0
- package/dist/components/card/rows.d.ts +19 -0
- package/dist/components/card/rows.d.ts.map +1 -0
- package/dist/components/card/rows.js +185 -0
- package/dist/components/card/rows.js.map +1 -0
- package/dist/components/card/segmented.d.ts +61 -0
- package/dist/components/card/segmented.d.ts.map +1 -0
- package/dist/components/card/segmented.js +289 -0
- package/dist/components/card/segmented.js.map +1 -0
- package/dist/components/card/shared.d.ts +55 -0
- package/dist/components/card/shared.d.ts.map +1 -0
- package/dist/components/card/shared.js +80 -0
- package/dist/components/card/shared.js.map +1 -0
- package/dist/components/card/slider.d.ts +16 -0
- package/dist/components/card/slider.d.ts.map +1 -0
- package/dist/components/card/slider.js +48 -0
- package/dist/components/card/slider.js.map +1 -0
- package/dist/components/card/stages.d.ts +18 -0
- package/dist/components/card/stages.d.ts.map +1 -0
- package/dist/components/card/stages.js +37 -0
- package/dist/components/card/stages.js.map +1 -0
- package/dist/components/card/style.css +125 -66
- package/dist/components/checkbox/style.css +10 -5
- package/dist/components/collapsible/style.css +0 -3
- package/dist/components/color-picker/color.d.ts +2 -2
- package/dist/components/color-picker/color.d.ts.map +1 -1
- package/dist/components/color-picker/color.js +7 -7
- package/dist/components/color-picker/color.js.map +1 -1
- package/dist/components/color-picker/main.d.ts +11 -5
- package/dist/components/color-picker/main.d.ts.map +1 -1
- package/dist/components/color-picker/main.js +128 -57
- package/dist/components/color-picker/main.js.map +1 -1
- package/dist/components/color-picker/props.d.ts +216 -6
- package/dist/components/color-picker/props.d.ts.map +1 -1
- package/dist/components/color-picker/style.css +8 -8
- package/dist/components/control-cards/main.d.ts +6 -17
- package/dist/components/control-cards/main.d.ts.map +1 -1
- package/dist/components/control-cards/main.js +119 -758
- package/dist/components/control-cards/main.js.map +1 -1
- package/dist/components/control-cards/props.d.ts +79 -250
- package/dist/components/control-cards/props.d.ts.map +1 -1
- package/dist/components/control-cards/style.css +2 -492
- package/dist/components/date-picker/main.d.ts +8 -3
- package/dist/components/date-picker/main.d.ts.map +1 -1
- package/dist/components/date-picker/main.js +71 -29
- package/dist/components/date-picker/main.js.map +1 -1
- package/dist/components/date-picker/pager.d.ts.map +1 -1
- package/dist/components/date-picker/pager.js +9 -2
- package/dist/components/date-picker/pager.js.map +1 -1
- package/dist/components/date-picker/props.d.ts +81 -5
- package/dist/components/date-picker/props.d.ts.map +1 -1
- package/dist/components/date-picker/style.css +24 -16
- package/dist/components/edit-menu/style.css +2 -2
- package/dist/components/glass/style.css +38 -5
- package/dist/components/grid/main.d.ts +1 -1
- package/dist/components/grid/main.d.ts.map +1 -1
- package/dist/components/grid/main.js +104 -21
- package/dist/components/grid/main.js.map +1 -1
- package/dist/components/grid/props.d.ts +75 -5
- package/dist/components/grid/props.d.ts.map +1 -1
- package/dist/components/grid/style.css +68 -38
- package/dist/components/header/style.css +12 -6
- package/dist/components/index.d.ts +10 -8
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +6 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/style.css +0 -3
- package/dist/components/list/main.d.ts +5 -3
- package/dist/components/list/main.d.ts.map +1 -1
- package/dist/components/list/main.js +42 -5
- package/dist/components/list/main.js.map +1 -1
- package/dist/components/list/props.d.ts +5 -0
- package/dist/components/list/props.d.ts.map +1 -1
- package/dist/components/list/reorder.d.ts +34 -0
- package/dist/components/list/reorder.d.ts.map +1 -1
- package/dist/components/list/reorder.js +40 -17
- package/dist/components/list/reorder.js.map +1 -1
- package/dist/components/list/style.css +101 -73
- package/dist/components/menu/style.css +38 -30
- package/dist/components/navigation/main.d.ts.map +1 -1
- package/dist/components/navigation/main.js +35 -13
- package/dist/components/navigation/main.js.map +1 -1
- package/dist/components/navigation/style.css +7 -0
- package/dist/components/page-control/main.d.ts.map +1 -1
- package/dist/components/page-control/main.js +32 -15
- package/dist/components/page-control/main.js.map +1 -1
- package/dist/components/page-control/props.d.ts +6 -0
- package/dist/components/page-control/props.d.ts.map +1 -1
- package/dist/components/page-control/style.css +36 -0
- package/dist/components/pager/main.d.ts +12 -0
- package/dist/components/pager/main.d.ts.map +1 -0
- package/dist/components/pager/main.js +368 -0
- package/dist/components/pager/main.js.map +1 -0
- package/dist/components/pager/props.d.ts +36 -0
- package/dist/components/pager/props.d.ts.map +1 -0
- package/dist/components/pager/props.js +2 -0
- package/dist/components/pager/props.js.map +1 -0
- package/dist/components/pager/style.css +42 -0
- package/dist/components/progress/main.d.ts.map +1 -1
- package/dist/components/progress/main.js +3 -2
- package/dist/components/progress/main.js.map +1 -1
- package/dist/components/progress/style.css +4 -10
- package/dist/components/roll/style.css +2 -2
- package/dist/components/segmented/style.css +16 -7
- package/dist/components/settings/main.d.ts +35 -1
- package/dist/components/settings/main.d.ts.map +1 -1
- package/dist/components/settings/main.js +297 -68
- package/dist/components/settings/main.js.map +1 -1
- package/dist/components/settings/props.d.ts +45 -4
- package/dist/components/settings/props.d.ts.map +1 -1
- package/dist/components/settings/region.d.ts +3 -0
- package/dist/components/settings/region.d.ts.map +1 -0
- package/dist/components/settings/region.js +120 -0
- package/dist/components/settings/region.js.map +1 -0
- package/dist/components/settings/style.css +2 -2
- package/dist/components/sheet/snap.d.ts.map +1 -1
- package/dist/components/sheet/snap.js +13 -5
- package/dist/components/sheet/snap.js.map +1 -1
- package/dist/components/sheet/style.css +48 -3
- package/dist/components/slider/main.d.ts.map +1 -1
- package/dist/components/slider/main.js +5 -2
- package/dist/components/slider/main.js.map +1 -1
- package/dist/components/slider/style.css +6 -6
- package/dist/components/stack/main.d.ts +8 -0
- package/dist/components/stack/main.d.ts.map +1 -0
- package/dist/components/stack/main.js +25 -0
- package/dist/components/stack/main.js.map +1 -0
- package/dist/components/stack/props.d.ts +42 -0
- package/dist/components/stack/props.d.ts.map +1 -0
- package/dist/components/stack/props.js +2 -0
- package/dist/components/stack/props.js.map +1 -0
- package/dist/components/stack/style.css +68 -0
- package/dist/components/stepper/main.d.ts +3 -1
- package/dist/components/stepper/main.d.ts.map +1 -1
- package/dist/components/stepper/main.js +4 -0
- package/dist/components/stepper/main.js.map +1 -1
- package/dist/components/stepper/style.css +2 -2
- package/dist/components/switch/main.d.ts.map +1 -1
- package/dist/components/switch/main.js +5 -1
- package/dist/components/switch/main.js.map +1 -1
- package/dist/components/switch/props.d.ts +4 -1
- package/dist/components/switch/props.d.ts.map +1 -1
- package/dist/components/tab-bar/style.css +36 -13
- package/dist/components/text-field/style.css +28 -17
- package/dist/components/toolbar/main.d.ts +5 -2
- package/dist/components/toolbar/main.d.ts.map +1 -1
- package/dist/components/toolbar/main.js +18 -0
- package/dist/components/toolbar/main.js.map +1 -1
- package/dist/components/toolbar/props.d.ts +15 -0
- package/dist/components/toolbar/props.d.ts.map +1 -1
- package/dist/components/toolbar/style.css +126 -10
- package/dist/components/tooltip/style.css +2 -2
- package/dist/components/typography/main.d.ts +1 -0
- package/dist/components/typography/main.d.ts.map +1 -1
- package/dist/components/typography/main.js +1 -0
- package/dist/components/typography/main.js.map +1 -1
- package/dist/components/typography/sizes.css +456 -0
- package/dist/components/typography/style.css +24 -456
- package/dist/components/utils/main.d.ts +23 -6
- package/dist/components/utils/main.d.ts.map +1 -1
- package/dist/components/utils/main.js +60 -7
- package/dist/components/utils/main.js.map +1 -1
- package/dist/components/viewport/edge-effect.d.ts.map +1 -1
- package/dist/components/viewport/edge-effect.js +6 -2
- package/dist/components/viewport/edge-effect.js.map +1 -1
- package/dist/components/viewport/focus-scroll.d.ts.map +1 -1
- package/dist/components/viewport/focus-scroll.js +2 -1
- package/dist/components/viewport/focus-scroll.js.map +1 -1
- package/dist/components/viewport/main.d.ts.map +1 -1
- package/dist/components/viewport/main.js +34 -2
- package/dist/components/viewport/main.js.map +1 -1
- package/dist/components/viewport/style.css +7 -13
- package/dist/styles.css +287 -120
- package/package.json +1 -1
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
import { colorSchemeStyle, useGlassScheme } from '../glass/main.js';
|
|
6
|
+
import { iconOf, polyline } from '../grid/icons.js';
|
|
7
|
+
import { Grid, startWithFrame, useGridItem, useGridItemLayout, } from '../grid/main.js';
|
|
8
|
+
import { ColorSchemeScope, useLocale } from '../settings/main.js';
|
|
9
|
+
import { Switch } from '../switch/main.js';
|
|
10
|
+
import { Symbol } from '../symbol/main.js';
|
|
11
|
+
import { cn, useForwardedRef, withStyle } from '../utils/main.js';
|
|
12
|
+
import { CardContext } from './shared.js';
|
|
13
|
+
/**
|
|
14
|
+
* A layer over the card's content where its parts draw a copy of
|
|
15
|
+
* themselves (`Card.Symbol`, `Card.CornerButton`): e.g. inside a slider's
|
|
16
|
+
* fill filling the card, in the fill's color scheme, clipped by its edge
|
|
17
|
+
* (see `Card.Slider`), registered by it (`setLayer`); the
|
|
18
|
+
* root marked `data-card-blend` while there is one (its originals under
|
|
19
|
+
* the fill, see style.css). None: no copies. Internal.
|
|
20
|
+
*/
|
|
21
|
+
export const CardBlendScope = createContext(undefined);
|
|
22
|
+
/**
|
|
23
|
+
* Its layer over its veil while editing (see `Root`): where its corner
|
|
24
|
+
* buttons shown then are (see `CornerButton`), outside its inert frame.
|
|
25
|
+
*/
|
|
26
|
+
const CardEditLayer = createContext(null);
|
|
27
|
+
/** The tile's shape (its item's effective size): wide, horizontal. */
|
|
28
|
+
export const useCardOrientation = () => {
|
|
29
|
+
const item = useGridItem();
|
|
30
|
+
if (!item)
|
|
31
|
+
return 'horizontal';
|
|
32
|
+
const [columns = '1', rows = '1'] = item.size.split('x');
|
|
33
|
+
return columns === '*' || Number(columns) >= Number(rows)
|
|
34
|
+
? 'horizontal'
|
|
35
|
+
: 'vertical';
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The sizes the library's kinds of cards support, for their items'
|
|
39
|
+
* `supportedSizes`: a binary display or control (a state, a switch), a
|
|
40
|
+
* numerical display (a value) or control (a slider: never square, so it
|
|
41
|
+
* has a direction), a choice of a few (segments: across a row, taller,
|
|
42
|
+
* upright, or 1x1 opening to choose), a summary (rows: never 1x1), a
|
|
43
|
+
* progress (a pill), a run of stages (along a line: never 1x1, too narrow
|
|
44
|
+
* for them).
|
|
45
|
+
*/
|
|
46
|
+
export const cardSizes = {
|
|
47
|
+
binaryControl: ['1x1', '2x1'],
|
|
48
|
+
binaryDisplay: ['1x1', '2x1'],
|
|
49
|
+
choiceControl: [
|
|
50
|
+
'1x1',
|
|
51
|
+
'2x1',
|
|
52
|
+
'3x1',
|
|
53
|
+
'4x1',
|
|
54
|
+
'1x2',
|
|
55
|
+
'2x2',
|
|
56
|
+
'3x2',
|
|
57
|
+
'4x2',
|
|
58
|
+
'1x3',
|
|
59
|
+
'2x3',
|
|
60
|
+
'1x4',
|
|
61
|
+
'2x4',
|
|
62
|
+
],
|
|
63
|
+
numericalControl: ['2x1', '3x1', '4x1', '1x2', '1x3'],
|
|
64
|
+
numericalDisplay: ['1x1', '2x1', '2x2'],
|
|
65
|
+
progressDisplay: ['1x1', '2x1', '3x1', '4x1', '2x2'],
|
|
66
|
+
stagesDisplay: ['2x1', '3x1', '4x1', '2x2', '4x2'],
|
|
67
|
+
summaryDisplay: ['2x1', '2x2', '3x2', '4x1', '4x2', '3x3', '4x3', '4x4'],
|
|
68
|
+
};
|
|
69
|
+
/** Its corner buttons' animations' id (see `useCornersFollowing`). */
|
|
70
|
+
const cornerId = 'uikit-card-corner';
|
|
71
|
+
/**
|
|
72
|
+
* Its corner buttons following its corners as its tile gets to a new box
|
|
73
|
+
* (see the top): laid out in its frame, at the size it's getting to, each
|
|
74
|
+
* at its trailing or bottom edge moved by as much as its glass's edge is
|
|
75
|
+
* off it, by its tile's timing (a translate added to any of its own).
|
|
76
|
+
*/
|
|
77
|
+
const useCornersFollowing = (rootRef) => {
|
|
78
|
+
useGridItemLayout({
|
|
79
|
+
onAfterChange: ({ duration, easing, from, to }) => {
|
|
80
|
+
const root = rootRef.current;
|
|
81
|
+
if (!root)
|
|
82
|
+
return;
|
|
83
|
+
const isRtl = getComputedStyle(root).direction === 'rtl';
|
|
84
|
+
const across = isRtl ? to.width - from.width : from.width - to.width;
|
|
85
|
+
const down = from.height - to.height;
|
|
86
|
+
for (const button of root.querySelectorAll(
|
|
87
|
+
// (Its copies too, over a slider's fill: on its glass, in the fill.)
|
|
88
|
+
':scope > .uikit-card-frame .uikit-card-corner-button')) {
|
|
89
|
+
for (const animation of button.getAnimations()) {
|
|
90
|
+
if (animation.id === cornerId)
|
|
91
|
+
animation.cancel();
|
|
92
|
+
}
|
|
93
|
+
// (Which edge it's at: by where it's laid out, in its frame.)
|
|
94
|
+
const center = button.offsetLeft + button.offsetWidth / 2;
|
|
95
|
+
const isAtEnd = center > to.width / 2 !== isRtl;
|
|
96
|
+
const isAtBottom = button.offsetTop + button.offsetHeight / 2 > to.height / 2;
|
|
97
|
+
const x = isAtEnd ? across : 0;
|
|
98
|
+
const y = isAtBottom ? down : 0;
|
|
99
|
+
if (x === 0 && y === 0)
|
|
100
|
+
continue;
|
|
101
|
+
// (With its tile: from the next frame, see Grid's reshape.ts.)
|
|
102
|
+
startWithFrame(button.animate([
|
|
103
|
+
{ translate: `${String(x)}px ${String(y)}px` },
|
|
104
|
+
{ translate: '0 0' },
|
|
105
|
+
], { composite: 'add', duration, easing, id: cornerId }));
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* How long a flashed card stays lit, and how long it fades back (see
|
|
112
|
+
* style.css).
|
|
113
|
+
*/
|
|
114
|
+
const flashTime = 150;
|
|
115
|
+
const fadeTime = 500;
|
|
116
|
+
/**
|
|
117
|
+
* The state of a switch in it (its layout's, see style.css): on, off, or
|
|
118
|
+
* none (no switch), as it changes (its `data-checked`, Switch's), before it
|
|
119
|
+
* paints.
|
|
120
|
+
*/
|
|
121
|
+
const useSwitchState = (rootRef) => {
|
|
122
|
+
const [state, setState] = useState(undefined);
|
|
123
|
+
useLayoutEffect(() => {
|
|
124
|
+
const { current: root } = rootRef;
|
|
125
|
+
if (!root)
|
|
126
|
+
return undefined;
|
|
127
|
+
const read = () => {
|
|
128
|
+
const control = root.querySelector(':scope > .uikit-card-frame > .uikit-card-layout > .uikit-switch-root');
|
|
129
|
+
setState(control ? Object.hasOwn(control.dataset, 'checked') : undefined);
|
|
130
|
+
};
|
|
131
|
+
read();
|
|
132
|
+
const observer = new MutationObserver(read);
|
|
133
|
+
observer.observe(root, {
|
|
134
|
+
attributeFilter: ['data-checked'],
|
|
135
|
+
childList: true,
|
|
136
|
+
subtree: true,
|
|
137
|
+
});
|
|
138
|
+
return () => observer.disconnect();
|
|
139
|
+
}, [rootRef]);
|
|
140
|
+
return state;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* A card flashed (by a press on a momentary one, or its `actionsRef`'s
|
|
144
|
+
* `flash`): lit as if active (`data-flashing`) for a moment, then fading
|
|
145
|
+
* back (`data-fading`, see style.css); flashed again meanwhile, lit as long
|
|
146
|
+
* again.
|
|
147
|
+
*/
|
|
148
|
+
const useFlash = (rootRef, actionsRef) => {
|
|
149
|
+
const timers = useRef([0, 0]);
|
|
150
|
+
const flash = useCallback(() => {
|
|
151
|
+
const root = rootRef.current;
|
|
152
|
+
if (!root)
|
|
153
|
+
return;
|
|
154
|
+
for (const timer of timers.current)
|
|
155
|
+
clearTimeout(timer);
|
|
156
|
+
delete root.dataset.fading;
|
|
157
|
+
root.dataset.flashing = '';
|
|
158
|
+
timers.current[0] = window.setTimeout(() => {
|
|
159
|
+
delete root.dataset.flashing;
|
|
160
|
+
root.dataset.fading = '';
|
|
161
|
+
timers.current[1] = window.setTimeout(() => {
|
|
162
|
+
delete root.dataset.fading;
|
|
163
|
+
}, fadeTime);
|
|
164
|
+
}, flashTime);
|
|
165
|
+
}, [rootRef]);
|
|
166
|
+
useImperativeHandle(
|
|
167
|
+
// (None given: nothing set; typed as one for Preact's types.)
|
|
168
|
+
actionsRef, () => ({ flash }), [flash]);
|
|
169
|
+
useEffect(() => () => {
|
|
170
|
+
for (const timer of timers.current)
|
|
171
|
+
clearTimeout(timer);
|
|
172
|
+
}, []);
|
|
173
|
+
return flash;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* The card: its glass, its parts on it; bright while `active` (or a switch
|
|
177
|
+
* in it is on); pressable as a whole with an `onClick` (its feedback, see
|
|
178
|
+
* style.css); in a grid's tile (its item's), inert and veiled while
|
|
179
|
+
* editing (see the top).
|
|
180
|
+
*/
|
|
181
|
+
const Root = forwardRef(({ actionsRef, active, children, className, context, momentary = false, onClick, render, style, ...props }, forwardedRef) => {
|
|
182
|
+
const item = useGridItem();
|
|
183
|
+
const isEditing = item?.editing === true;
|
|
184
|
+
const ref = useForwardedRef(forwardedRef);
|
|
185
|
+
useCornersFollowing(ref);
|
|
186
|
+
const flash = useFlash(ref, actionsRef);
|
|
187
|
+
// Switchable (`active` given, or a switch in it): on, lit; off, dark
|
|
188
|
+
// glass (in both schemes: its luminance telling which); else its
|
|
189
|
+
// glass's tone's (see Glass); none while editing (its veil, and its
|
|
190
|
+
// grid's controls on it, the page's, see style.css).
|
|
191
|
+
const switchState = useSwitchState(ref);
|
|
192
|
+
const state = active ?? switchState;
|
|
193
|
+
const toned = useGlassScheme(ref, context);
|
|
194
|
+
const schemeOfState = state ? 'light' : 'dark';
|
|
195
|
+
const stated = state === undefined ? toned : schemeOfState;
|
|
196
|
+
const scheme = isEditing ? undefined : stated;
|
|
197
|
+
// (A layer its parts draw their copies in, registered by what fills
|
|
198
|
+
// it, see `CardBlendScope`.)
|
|
199
|
+
const [blendLayer, setBlendLayer] = useState(null);
|
|
200
|
+
// (Editing: a layer over its veil, for its corner buttons shown then;
|
|
201
|
+
// see `CornerButton`.)
|
|
202
|
+
const [editLayer, setEditLayer] = useState(null);
|
|
203
|
+
// (Its title's id, for its parts named by it, see `Title`.)
|
|
204
|
+
const [titleId, setTitleId] = useState(undefined);
|
|
205
|
+
const card = useMemo(() => ({ setTitleId, titleId }), [titleId]);
|
|
206
|
+
const blend = useMemo(() => ({ layer: blendLayer, setLayer: setBlendLayer }), [blendLayer]);
|
|
207
|
+
// (Editing: not pressed, its presses the grid's.)
|
|
208
|
+
const flashed = momentary && onClick
|
|
209
|
+
? (event) => {
|
|
210
|
+
flash();
|
|
211
|
+
onClick(event);
|
|
212
|
+
}
|
|
213
|
+
: onClick;
|
|
214
|
+
const pressed = isEditing ? undefined : flashed;
|
|
215
|
+
return useRender({
|
|
216
|
+
defaultTagName: 'div',
|
|
217
|
+
props: {
|
|
218
|
+
...props,
|
|
219
|
+
// (Its parts on a layout of its own, in a frame: what its size
|
|
220
|
+
// queries ask, see style.css.)
|
|
221
|
+
children: (_jsx(ColorSchemeScope, { colorScheme: scheme, children: _jsx(CardContext.Provider, { value: card, children: _jsx(CardBlendScope.Provider, { value: blend, children: _jsxs(CardEditLayer.Provider, { value: isEditing ? editLayer : null, children: [_jsx("div", { className: "uikit-card-frame", inert: isEditing || undefined, children: _jsx("div", { className: "uikit-card-layout", children: children }) }), isEditing ? (_jsx("div", { ref: setEditLayer, className: "uikit-card-edit-layer" })) : null] }) }) }) })),
|
|
222
|
+
className: cn('uikit-card-root uikit-glass-medium uikit-glass-panel', className),
|
|
223
|
+
'data-active': state === true ? '' : undefined,
|
|
224
|
+
// (Its `active` given: its state, whatever a switch in it says
|
|
225
|
+
// (e.g. a dimmer's, never lit), see style.css.)
|
|
226
|
+
'data-active-given': active === undefined ? undefined : '',
|
|
227
|
+
'data-card-blend': blendLayer ? '' : undefined,
|
|
228
|
+
'data-card-part': 'root',
|
|
229
|
+
'data-color-scheme': scheme,
|
|
230
|
+
'data-momentary': momentary ? '' : undefined,
|
|
231
|
+
// (Pressed as a whole: its feedback, see style.css.)
|
|
232
|
+
'data-pressable': onClick ? '' : undefined,
|
|
233
|
+
'data-editing': isEditing ? '' : undefined,
|
|
234
|
+
onClick: pressed,
|
|
235
|
+
style: withStyle(colorSchemeStyle(scheme), style),
|
|
236
|
+
},
|
|
237
|
+
ref,
|
|
238
|
+
render,
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
/**
|
|
242
|
+
* Its symbol (e.g. a `Symbol`), at its top leading corner: on (its card lit,
|
|
243
|
+
* or its own `active`), in its tint, its `Symbol`'s emphasized icon (e.g.
|
|
244
|
+
* filled) shown; else its icon (e.g. outlined). Over a slider's fill (see
|
|
245
|
+
* `CardBlendScope`): in its text's color, drawn again in the
|
|
246
|
+
* fill, its emphasis on both.
|
|
247
|
+
*/
|
|
248
|
+
const CardSymbol = forwardRef(({ active = false, children, className, render, style, tint, ...props }, ref) => {
|
|
249
|
+
const blendLayer = useContext(CardBlendScope)?.layer ?? null;
|
|
250
|
+
const symbol = useRender({
|
|
251
|
+
defaultTagName: 'span',
|
|
252
|
+
props: {
|
|
253
|
+
...props,
|
|
254
|
+
children,
|
|
255
|
+
className: cn('uikit-card-symbol', className),
|
|
256
|
+
'data-active': active ? '' : undefined,
|
|
257
|
+
'data-card-part': 'symbol',
|
|
258
|
+
style: withStyle({ '--uikit-card-symbol-tint': tint }, style),
|
|
259
|
+
},
|
|
260
|
+
ref,
|
|
261
|
+
render,
|
|
262
|
+
});
|
|
263
|
+
return (_jsxs(_Fragment, { children: [symbol, blendLayer
|
|
264
|
+
? createPortal(_jsx("span", { className: cn('uikit-card-symbol', className), "data-active": active ? '' : undefined, "data-card-copy": "", children: children }), blendLayer)
|
|
265
|
+
: null] }));
|
|
266
|
+
});
|
|
267
|
+
/**
|
|
268
|
+
* Its switch (a `Switch.Root` with its thumb): its top trailing corner, the
|
|
269
|
+
* card's state (on, lit), on in the card's tint (`tint`; see style.css: on
|
|
270
|
+
* a slider's fill, or in a card never lit, a darker shade of it). A part of
|
|
271
|
+
* the card's (moved with its other parts as its tile changes, see
|
|
272
|
+
* `useGridItemLayout`).
|
|
273
|
+
*/
|
|
274
|
+
const CardSwitch = forwardRef(({ className, style, tint, ...props }, ref) => (_jsx(Switch.Root, { ref: ref, ...props, className: cn('uikit-card-switch', className), "data-card-part": "switch", style: withStyle({ '--uikit-card-switch-tint': tint }, style), children: _jsx(Switch.Thumb, {}) })));
|
|
275
|
+
/**
|
|
276
|
+
* What it is (e.g. a device's name), above its value; what its parts are
|
|
277
|
+
* named by (its id, its own or one of its card's, told the card).
|
|
278
|
+
*/
|
|
279
|
+
const Title = forwardRef(({ className, id, render, ...props }, ref) => {
|
|
280
|
+
const generatedId = useId();
|
|
281
|
+
const ownId = (typeof id === 'string' ? id : undefined) ?? generatedId;
|
|
282
|
+
const setTitleId = useContext(CardContext)?.setTitleId;
|
|
283
|
+
useLayoutEffect(() => {
|
|
284
|
+
setTitleId?.(ownId);
|
|
285
|
+
return () => setTitleId?.(undefined);
|
|
286
|
+
}, [ownId, setTitleId]);
|
|
287
|
+
return useRender({
|
|
288
|
+
defaultTagName: 'span',
|
|
289
|
+
props: {
|
|
290
|
+
...props,
|
|
291
|
+
className: cn('uikit-card-title', className),
|
|
292
|
+
'data-card-part': 'title',
|
|
293
|
+
id: ownId,
|
|
294
|
+
},
|
|
295
|
+
ref,
|
|
296
|
+
render,
|
|
297
|
+
});
|
|
298
|
+
});
|
|
299
|
+
/**
|
|
300
|
+
* Its value: a number formatted as the app says (`format`, `locale`:
|
|
301
|
+
* `Intl.NumberFormat`'s), what's given after it (e.g. a `Trend`); or,
|
|
302
|
+
* without a number, what's given instead (e.g. a state).
|
|
303
|
+
*/
|
|
304
|
+
const Value = forwardRef(({ children, className, format, locale: ownLocale, render, value, ...props }, ref) => {
|
|
305
|
+
const locale = useLocale(ownLocale);
|
|
306
|
+
return useRender({
|
|
307
|
+
defaultTagName: 'span',
|
|
308
|
+
props: {
|
|
309
|
+
...props,
|
|
310
|
+
// (A number, and what's given after it (e.g. a `Trend`); none,
|
|
311
|
+
// what's given.)
|
|
312
|
+
children: value === undefined ? (children) : (_jsxs(_Fragment, { children: [new Intl.NumberFormat(locale, format).format(value), children] })),
|
|
313
|
+
className: cn('uikit-card-value', className),
|
|
314
|
+
'data-card-part': 'value',
|
|
315
|
+
},
|
|
316
|
+
ref,
|
|
317
|
+
render,
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
/**
|
|
321
|
+
* Its subtitle: more words under its title (e.g. a program's), small, in
|
|
322
|
+
* its secondary text color; where there's room for them (in a tile a row
|
|
323
|
+
* tall beside a bar, stages or channels, none: see the CSS).
|
|
324
|
+
*/
|
|
325
|
+
const Subtitle = forwardRef(({ className, render, ...props }, ref) => useRender({
|
|
326
|
+
defaultTagName: 'span',
|
|
327
|
+
props: {
|
|
328
|
+
...props,
|
|
329
|
+
className: cn('uikit-card-subtitle', className),
|
|
330
|
+
'data-card-part': 'subtitle',
|
|
331
|
+
},
|
|
332
|
+
ref,
|
|
333
|
+
render,
|
|
334
|
+
}));
|
|
335
|
+
/** A trend's arrow (see `Trend`): pointing ahead, turned by its angle. */
|
|
336
|
+
const trendIcon = iconOf('card.trend', polyline([-4.5, 0], [4.5, 0]) + polyline([0.5, -4], [4.5, 0], [0.5, 4]));
|
|
337
|
+
/** A trend's words, by its angle (see `Trend`). */
|
|
338
|
+
const trendOf = (angle) => {
|
|
339
|
+
if (angle > 10)
|
|
340
|
+
return 'rising';
|
|
341
|
+
return angle < -10 ? 'falling' : 'steady';
|
|
342
|
+
};
|
|
343
|
+
/**
|
|
344
|
+
* A value's trend (in its `Value`, after its number): an arrow pointing up
|
|
345
|
+
* as steeply as it rises (`angle`, -90 to 90 degrees: 0 steady), named for
|
|
346
|
+
* assistive technology. It turns to a new angle by its own transform.
|
|
347
|
+
*/
|
|
348
|
+
const Trend = forwardRef(({ angle, className, render, style, ...props }, ref) => {
|
|
349
|
+
const clamped = Math.max(-90, Math.min(90, angle));
|
|
350
|
+
return useRender({
|
|
351
|
+
defaultTagName: 'span',
|
|
352
|
+
props: {
|
|
353
|
+
'aria-label': trendOf(clamped),
|
|
354
|
+
role: 'img',
|
|
355
|
+
...props,
|
|
356
|
+
children: _jsx(Symbol, { icon: trendIcon }),
|
|
357
|
+
className: cn('uikit-card-trend', className),
|
|
358
|
+
'data-card-part': 'trend',
|
|
359
|
+
style: withStyle({ '--uikit-card-trend': String(clamped) }, style),
|
|
360
|
+
},
|
|
361
|
+
ref,
|
|
362
|
+
render,
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
/**
|
|
366
|
+
* A button in its corner (see `Grid.CornerButton`): shown while its grid
|
|
367
|
+
* isn't editing (faded out, inert, while it is), or while it is too, or
|
|
368
|
+
* then only (`whileEditing`: over its veil then); and as `visible` says. A
|
|
369
|
+
* press on it is its own, not the card's (e.g. not toggling a switch in
|
|
370
|
+
* it, see `forwardClick`).
|
|
371
|
+
*/
|
|
372
|
+
const CornerButton = forwardRef(({ className, corner, icon, mirrored, onClick, visible = true, whileEditing = 'hide', ...props }, ref) => {
|
|
373
|
+
// (Over a slider's fill (see `CardBlendScope`): pressed, but
|
|
374
|
+
// drawn by its copies, one on its glass, under the fill, one in it.)
|
|
375
|
+
const blendLayer = useContext(CardBlendScope)?.layer ?? null;
|
|
376
|
+
// (Shown while editing (see `whileEditing`): over its card's veil, in
|
|
377
|
+
// its edit layer, outside its inert frame.)
|
|
378
|
+
const editLayer = useContext(CardEditLayer);
|
|
379
|
+
const isOnEditLayer = editLayer !== null && visible && whileEditing !== 'hide';
|
|
380
|
+
const copy = (_jsx(Grid.CornerButton, { "aria-hidden": true, inert: true, className: cn('uikit-card-corner-button', className), corner: corner, "data-card-copy": "", icon: icon, mirrored: mirrored, render: _jsx("span", {}), visible: visible, whileEditing: whileEditing }));
|
|
381
|
+
const button = (_jsx(Grid.CornerButton, { ref: ref, className: cn('uikit-card-corner-button', className), corner: corner, "data-card-part": "corner-button", icon: icon, mirrored: mirrored, visible: visible, whileEditing: whileEditing, ...props, onClick: (event) => {
|
|
382
|
+
event.stopPropagation();
|
|
383
|
+
onClick?.(event);
|
|
384
|
+
} }));
|
|
385
|
+
return (_jsxs(_Fragment, { children: [isOnEditLayer ? createPortal(button, editLayer) : button, blendLayer ? copy : null, blendLayer ? createPortal(copy, blendLayer) : null] }));
|
|
386
|
+
});
|
|
387
|
+
export { CardSwitch, CardSymbol, CornerButton, Root, Subtitle, Title, Trend, Value, };
|
|
388
|
+
//# sourceMappingURL=root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.js","sourceRoot":"","sources":["../../../src/components/card/root.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,aAAa,EACb,UAAU,EAIV,WAAW,EACX,UAAU,EACV,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,IAAI,EAEJ,cAAc,EACd,WAAW,EACX,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAclE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAW1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAwB,SAAS,CAAC,CAAC;AAE9E;;;GAGG;AACH,MAAM,aAAa,GAAG,aAAa,CAAqB,IAAI,CAAC,CAAC;AAE9D,sEAAsE;AACtE,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAoB,EAAE;IACtD,MAAM,IAAI,GAAG,WAAW,E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,YAAY,yBAEhB,KAAK,QACL,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,EACpD,MAAM,EAAE,MAAM,oBACC,EAAE,EACjB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,gBAAQ,EAChB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;IACF,MAAM,MAAM,GAAG,CACb,KAAC,IAAI,CAAC,YAAY,IAChB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,EACpD,MAAM,EAAE,MAAM,oBACC,eAAe,EAC9B,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,KACtB,KAAK,EACT,OAAO,EAAE,CAAC,KAAoC,EAAE,EAAE;YAChD,KAAK,CAAC,eAAe,EAAE,CAAC;YACxB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,GACD,CACH,CAAC;IACF,OAAO,CACL,8BACG,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EACxD,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EACxB,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,IAClD,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,KAAK,EACL,KAAK,GACN,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { CardRowProps, CardRowsProps } from './props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A card's row (in its `Rows`): its symbol (optional), its label (its
|
|
5
|
+
* children), its value; pressed (`onClick`), its label a button, a
|
|
6
|
+
* chevron after its value (List's `DrillIn`), its row its hit area.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Row: ({ children, icon, onClick, value, ...props }: CardRowProps) => ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* A card's rows (e.g. a room's, a device's details): a glass list (inset
|
|
11
|
+
* grouped, see Card) of its `Row`s in a well at its bottom, as many as fit
|
|
12
|
+
* whole. Rows left out, its last row counts them (`getMoreLabel`),
|
|
13
|
+
* expanding its tile (its grid item's `expandedSize`) or opening it (an
|
|
14
|
+
* item with an `openSize`); expanded, it makes it small again
|
|
15
|
+
* (`lessLabel`). Its last row's action is also a corner button over it, for
|
|
16
|
+
* its large hit area. None, nothing.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Rows: ({ children, className, getMoreLabel, lessLabel, ...props }: CardRowsProps) => ReactNode;
|
|
19
|
+
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../../src/components/card/rows.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAYf,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA+M9D;;;;GAIG;AACH,eAAO,MAAM,GAAG,GAAI,8CAMjB,YAAY,KAAG,SA+BjB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,GAAI,4DAMlB,aAAa,KAAG,SAqDlB,CAAC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Children, isValidElement, useLayoutEffect, useRef, useState, } from 'react';
|
|
3
|
+
import { gridIcons, reflowDuration, reflowEasing, startWithFrame, useGridItem, } from '../grid/main.js';
|
|
4
|
+
import { List } from '../list/main.js';
|
|
5
|
+
import { Symbol } from '../symbol/main.js';
|
|
6
|
+
import { cn, reducedMotionOf } from '../utils/main.js';
|
|
7
|
+
import { CornerButton } from './root.js';
|
|
8
|
+
// A card's rows (`Card.Rows` of `Card.Row`s): a glass list in a well at
|
|
9
|
+
// its bottom, as many rows as fit whole; its last row, while some are left
|
|
10
|
+
// out, counting them (expanding or opening its tile, by its grid item).
|
|
11
|
+
/**
|
|
12
|
+
* How many rows of its list fit in it whole (its box filling its room in
|
|
13
|
+
* the card, see Card; a row's height its `--uikit-list-row-min-height`, as
|
|
14
|
+
* Card sets it, opened above the page too): by its height, at least one;
|
|
15
|
+
* as the card's size changes too.
|
|
16
|
+
*/
|
|
17
|
+
const rowsIn = (list) => {
|
|
18
|
+
const row = Number.parseFloat(getComputedStyle(list).getPropertyValue('--uikit-list-row-min-height')) || 30;
|
|
19
|
+
return Math.max(1, Math.floor(list.clientHeight / row));
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Reads to do once a commit's layout effects have all run (a microtask,
|
|
23
|
+
* still before it's painted): together, so the page is styled and laid out
|
|
24
|
+
* for them once, not once per card between other effects' changes (e.g.
|
|
25
|
+
* a page of many cards with rows pushed).
|
|
26
|
+
*/
|
|
27
|
+
const pendingReads = new Set();
|
|
28
|
+
const readTogether = (read) => {
|
|
29
|
+
if (pendingReads.size === 0) {
|
|
30
|
+
queueMicrotask(() => {
|
|
31
|
+
const reads = [...pendingReads];
|
|
32
|
+
pendingReads.clear();
|
|
33
|
+
for (const each of reads)
|
|
34
|
+
each();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
pendingReads.add(read);
|
|
38
|
+
};
|
|
39
|
+
const useRowsThatFit = () => {
|
|
40
|
+
const [list, setList] = useState(null);
|
|
41
|
+
const [count, setCount] = useState(1);
|
|
42
|
+
useLayoutEffect(() => {
|
|
43
|
+
if (!list)
|
|
44
|
+
return undefined;
|
|
45
|
+
const observer = new ResizeObserver(() => setCount(rowsIn(list)));
|
|
46
|
+
observer.observe(list);
|
|
47
|
+
return () => observer.disconnect();
|
|
48
|
+
}, [list]);
|
|
49
|
+
// (Also after each render, before it's painted: its tile resized in it
|
|
50
|
+
// (e.g. collapsed), its rows counted at once, not a frame late (a frame
|
|
51
|
+
// of the rows of the size it had, its last row a new one after).)
|
|
52
|
+
// (Read with the others' (see `readTogether`): still before it's
|
|
53
|
+
// painted.)
|
|
54
|
+
useLayoutEffect(() => {
|
|
55
|
+
if (!list)
|
|
56
|
+
return undefined;
|
|
57
|
+
const read = () => {
|
|
58
|
+
if (list.isConnected)
|
|
59
|
+
setCount(rowsIn(list));
|
|
60
|
+
};
|
|
61
|
+
readTogether(read);
|
|
62
|
+
return () => {
|
|
63
|
+
pendingReads.delete(read);
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
return [setList, count, list];
|
|
67
|
+
};
|
|
68
|
+
/** Its last row's height's animation (see `useLastRowHeight`). */
|
|
69
|
+
const lastRowId = 'uikit-card-rows-last-row';
|
|
70
|
+
/**
|
|
71
|
+
* Its list's last row's height changing with how many rows there are (one
|
|
72
|
+
* only: taller, see Card), as its tile reshapes (Grid's reflow: its
|
|
73
|
+
* duration and easing): from the height it had, animated, started with
|
|
74
|
+
* the frames (see Grid's `startWithFrame`: a long task laying the page out
|
|
75
|
+
* anew, e.g. its tile expanding, not past it already, as a transition
|
|
76
|
+
* would be).
|
|
77
|
+
*/
|
|
78
|
+
const useLastRowHeight = (list, count) => {
|
|
79
|
+
const last = useRef(undefined);
|
|
80
|
+
// (Read with the others' (see `readTogether`): still before it's
|
|
81
|
+
// painted, its animation starting with its frame.)
|
|
82
|
+
useLayoutEffect(() => {
|
|
83
|
+
const measure = () => {
|
|
84
|
+
const row = list?.isConnected
|
|
85
|
+
? list.querySelector(':scope .uikit-list-item:last-child .uikit-list-row')
|
|
86
|
+
: null;
|
|
87
|
+
if (!row) {
|
|
88
|
+
last.current = undefined;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
for (const animation of row.getAnimations()) {
|
|
92
|
+
if (animation.id === lastRowId)
|
|
93
|
+
animation.cancel();
|
|
94
|
+
}
|
|
95
|
+
const height = getComputedStyle(row).minHeight;
|
|
96
|
+
const before = last.current;
|
|
97
|
+
last.current = { count, height };
|
|
98
|
+
if (!before ||
|
|
99
|
+
before.count === count ||
|
|
100
|
+
before.height === height ||
|
|
101
|
+
reducedMotionOf(row).matches) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
startWithFrame(row.animate([{ minHeight: before.height }, { minHeight: height }], {
|
|
105
|
+
duration: reflowDuration,
|
|
106
|
+
easing: reflowEasing,
|
|
107
|
+
id: lastRowId,
|
|
108
|
+
}));
|
|
109
|
+
};
|
|
110
|
+
readTogether(measure);
|
|
111
|
+
return () => {
|
|
112
|
+
pendingReads.delete(measure);
|
|
113
|
+
};
|
|
114
|
+
}, [count, list]);
|
|
115
|
+
};
|
|
116
|
+
const actionIcons = {
|
|
117
|
+
expand: gridIcons.expand,
|
|
118
|
+
less: gridIcons.collapse,
|
|
119
|
+
more: undefined,
|
|
120
|
+
open: gridIcons.open,
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* What its last row does (see `Rows`), by its grid item: open above the
|
|
124
|
+
* page, none; expanded, making it small again; rows left out, expanding
|
|
125
|
+
* it (only where that'd change its size, as `ExpandButton`), else opening
|
|
126
|
+
* it (an item that opens), else only counting them; none.
|
|
127
|
+
*/
|
|
128
|
+
const useRowsAction = (isLeftOut) => {
|
|
129
|
+
const item = useGridItem();
|
|
130
|
+
if (!item || item.open)
|
|
131
|
+
return undefined;
|
|
132
|
+
const { expandedSize } = item;
|
|
133
|
+
const canExpand = expandedSize !== undefined &&
|
|
134
|
+
item.sizeOf(item.requested).size !== item.sizeOf(expandedSize).size;
|
|
135
|
+
if (canExpand && item.expanded) {
|
|
136
|
+
return { kind: 'less', onPress: () => item.setExpanded(false) };
|
|
137
|
+
}
|
|
138
|
+
if (!isLeftOut)
|
|
139
|
+
return undefined;
|
|
140
|
+
if (canExpand) {
|
|
141
|
+
return { kind: 'expand', onPress: () => item.setExpanded(true) };
|
|
142
|
+
}
|
|
143
|
+
return item.canOpen
|
|
144
|
+
? { kind: 'open', onPress: () => item.setOpen(true) }
|
|
145
|
+
: { kind: 'more' };
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Its last row (see `Rows`): its label where its rows' are (after their
|
|
149
|
+
* symbols' room, if they have them), pressed doing its action; the corner
|
|
150
|
+
* symbol for it where a value is.
|
|
151
|
+
*/
|
|
152
|
+
const ActionRow = ({ action, hasIcons, label, }) => {
|
|
153
|
+
const icon = actionIcons[action.kind];
|
|
154
|
+
const isExpanding = action.kind === 'expand' || action.kind === 'less';
|
|
155
|
+
return (_jsxs(List.Item, { "data-card-part": "rows-action", children: [hasIcons ? (_jsx(List.Leading, { children: _jsx(List.Image, { variant: "symbol" }) })) : null, _jsx(List.Content, { children: _jsx(List.Title, { render: action.onPress ? (_jsx("button", { "aria-expanded": isExpanding ? action.kind === 'less' : undefined, type: "button", onClick: action.onPress })) : undefined, children: label }) }), icon ? (_jsx(List.Trailing, { children: _jsx(List.Detail, { children: _jsx(Symbol, { icon: icon }) }) })) : null] }));
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* A card's row (in its `Rows`): its symbol (optional), its label (its
|
|
159
|
+
* children), its value; pressed (`onClick`), its label a button, a
|
|
160
|
+
* chevron after its value (List's `DrillIn`), its row its hit area.
|
|
161
|
+
*/
|
|
162
|
+
export const Row = ({ children, icon, onClick, value, ...props }) => (_jsxs(List.Item, { ...props, "data-card-part": "row", children: [icon ? (_jsx(List.Leading, { children: _jsx(List.Image, { variant: "symbol", children: _jsx(Symbol, { icon: icon }) }) })) : null, _jsx(List.Content, { children: _jsx(List.Title, { render: onClick ? (_jsx("button", { type: "button", onClick: onClick })) : undefined, children: children }) }), _jsxs(List.Trailing, { children: [value === undefined ? null : _jsx(List.Detail, { children: value }), onClick ? _jsx(List.DrillIn, {}) : null] })] }));
|
|
163
|
+
/**
|
|
164
|
+
* A card's rows (e.g. a room's, a device's details): a glass list (inset
|
|
165
|
+
* grouped, see Card) of its `Row`s in a well at its bottom, as many as fit
|
|
166
|
+
* whole. Rows left out, its last row counts them (`getMoreLabel`),
|
|
167
|
+
* expanding its tile (its grid item's `expandedSize`) or opening it (an
|
|
168
|
+
* item with an `openSize`); expanded, it makes it small again
|
|
169
|
+
* (`lessLabel`). Its last row's action is also a corner button over it, for
|
|
170
|
+
* its large hit area. None, nothing.
|
|
171
|
+
*/
|
|
172
|
+
export const Rows = ({ children, className, getMoreLabel = (count) => `${String(count)} more`, lessLabel = 'Less', ...props }) => {
|
|
173
|
+
const rows = Children.toArray(children).filter((child) => isValidElement(child));
|
|
174
|
+
const [list, fit, listElement] = useRowsThatFit();
|
|
175
|
+
const action = useRowsAction(rows.length > fit);
|
|
176
|
+
// (Its last row the action's, if any: one row less.)
|
|
177
|
+
const shown = action ? rows.slice(0, fit - 1) : rows.slice(0, fit);
|
|
178
|
+
useLastRowHeight(listElement, shown.length + (action ? 1 : 0));
|
|
179
|
+
if (rows.length === 0)
|
|
180
|
+
return null;
|
|
181
|
+
return (_jsxs(_Fragment, { children: [_jsx(List.Root, { ...props, ref: list, className: cn('uikit-card-rows', className), "data-card-part": "rows", children: _jsx(List.Section, { children: _jsxs(List.Group, { children: [shown, action ? (_jsx(ActionRow, { action: action, hasIcons: rows.some((row) => row.props.icon !== undefined), label: action.kind === 'less'
|
|
182
|
+
? lessLabel
|
|
183
|
+
: getMoreLabel(rows.length - shown.length) }, "action")) : null] }) }) }), action?.onPress ? (_jsx(CornerButton, { "aria-hidden": true, className: "uikit-card-rows-hit-area", icon: actionIcons[action.kind] ?? gridIcons.open, tabIndex: -1, onClick: action.onPress })) : null] }));
|
|
184
|
+
};
|
|
185
|
+
//# sourceMappingURL=rows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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