vireuikit 0.6.0 → 0.7.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/README.md +56 -1
- package/dist/{chunk-I3BD3XGC.js → chunk-AR2AM3BR.js} +179 -14
- package/dist/chunk-AR2AM3BR.js.map +1 -0
- package/dist/index.cjs +190 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +165 -4
- package/dist/index.d.ts +165 -4
- package/dist/index.js +1 -1
- package/dist/web.cjs +1087 -21
- package/dist/web.cjs.map +1 -1
- package/dist/web.d.cts +12 -2
- package/dist/web.d.ts +12 -2
- package/dist/web.js +786 -14
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-I3BD3XGC.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -156,9 +156,9 @@ type GrowthState = {
|
|
|
156
156
|
};
|
|
157
157
|
declare const createGrowthState: () => GrowthState;
|
|
158
158
|
declare const growthPhase: (state: GrowthState) => GrowthPhase;
|
|
159
|
-
/** Durations are client-specific:
|
|
160
|
-
* atom at a different scale (an icon opening into a sheet)
|
|
161
|
-
* shape of the transition is shared regardless. */
|
|
159
|
+
/** Durations are client-specific: the default is fitted to the menu growing out of its toolbar at
|
|
160
|
+
* M 5:11 (docs/acceptance.md, N9), and an atom at a different scale (an icon opening into a sheet)
|
|
161
|
+
* isn't obligated to match it. The shape of the transition is shared regardless. */
|
|
162
162
|
type GrowthTiming = {
|
|
163
163
|
shrinkOpen: number;
|
|
164
164
|
shrinkClose: number;
|
|
@@ -183,6 +183,154 @@ declare function stepControlVisual(visual: ControlVisual, dt: number, state: Con
|
|
|
183
183
|
declare function visualAtomState(visual: ControlVisual, state: ControlState): VireUIKitAtomState;
|
|
184
184
|
declare function settleControlVisual(visual: ControlVisual, state: ControlState): void;
|
|
185
185
|
|
|
186
|
+
/**
|
|
187
|
+
* `disabled`: cannot be chosen. `focusable` (default: not disabled): whether focus can land on it. A native
|
|
188
|
+
* disabled button cannot take focus, so the keyboard passes over it; an aria-disabled one can (WAI-ARIA APG).
|
|
189
|
+
*/
|
|
190
|
+
type MenuItem = {
|
|
191
|
+
label: string;
|
|
192
|
+
disabled: boolean;
|
|
193
|
+
focusable?: boolean;
|
|
194
|
+
};
|
|
195
|
+
type MenuState = {
|
|
196
|
+
open: boolean;
|
|
197
|
+
/** The active item, or -1 while the menu itself holds focus. */
|
|
198
|
+
active: number;
|
|
199
|
+
typed: string;
|
|
200
|
+
/** Seconds, on whatever clock the events carry. */
|
|
201
|
+
typedAt: number;
|
|
202
|
+
};
|
|
203
|
+
declare const MENU_CLOSED: MenuState;
|
|
204
|
+
type MenuDismissal = 'escape' | 'outside' | 'tab' | 'trigger';
|
|
205
|
+
type MenuEvent = {
|
|
206
|
+
type: 'open';
|
|
207
|
+
focus: 'menu' | 'first' | 'last';
|
|
208
|
+
} | {
|
|
209
|
+
type: 'move';
|
|
210
|
+
to: 'next' | 'previous' | 'first' | 'last';
|
|
211
|
+
} | {
|
|
212
|
+
type: 'point';
|
|
213
|
+
index: number;
|
|
214
|
+
} | {
|
|
215
|
+
type: 'type';
|
|
216
|
+
key: string;
|
|
217
|
+
at: number;
|
|
218
|
+
} | {
|
|
219
|
+
type: 'choose';
|
|
220
|
+
index: number;
|
|
221
|
+
} | {
|
|
222
|
+
type: 'dismiss';
|
|
223
|
+
reason: MenuDismissal;
|
|
224
|
+
};
|
|
225
|
+
/** Where focus goes after a step. `none` leaves it where the person put it (a press outside). */
|
|
226
|
+
type MenuFocus = {
|
|
227
|
+
to: 'item';
|
|
228
|
+
index: number;
|
|
229
|
+
} | {
|
|
230
|
+
to: 'menu';
|
|
231
|
+
} | {
|
|
232
|
+
to: 'trigger';
|
|
233
|
+
} | {
|
|
234
|
+
to: 'none';
|
|
235
|
+
} | {
|
|
236
|
+
to: 'stay';
|
|
237
|
+
};
|
|
238
|
+
type MenuStep = {
|
|
239
|
+
state: MenuState;
|
|
240
|
+
focus: MenuFocus;
|
|
241
|
+
chosen: number | null;
|
|
242
|
+
};
|
|
243
|
+
declare const TYPEAHEAD_SECONDS = 0.5;
|
|
244
|
+
declare function stepMenu(state: MenuState, event: MenuEvent, items: readonly MenuItem[]): MenuStep;
|
|
245
|
+
type Rect = {
|
|
246
|
+
x: number;
|
|
247
|
+
y: number;
|
|
248
|
+
width: number;
|
|
249
|
+
height: number;
|
|
250
|
+
};
|
|
251
|
+
type Size = {
|
|
252
|
+
width: number;
|
|
253
|
+
height: number;
|
|
254
|
+
};
|
|
255
|
+
/** -1 is left or top, 1 is right or bottom. */
|
|
256
|
+
type MenuCorner = {
|
|
257
|
+
x: -1 | 1;
|
|
258
|
+
y: -1 | 1;
|
|
259
|
+
};
|
|
260
|
+
declare const MENU_CORNERS: {
|
|
261
|
+
readonly 'top-left': {
|
|
262
|
+
readonly x: -1;
|
|
263
|
+
readonly y: -1;
|
|
264
|
+
};
|
|
265
|
+
readonly 'top-right': {
|
|
266
|
+
readonly x: 1;
|
|
267
|
+
readonly y: -1;
|
|
268
|
+
};
|
|
269
|
+
readonly 'bottom-left': {
|
|
270
|
+
readonly x: -1;
|
|
271
|
+
readonly y: 1;
|
|
272
|
+
};
|
|
273
|
+
readonly 'bottom-right': {
|
|
274
|
+
readonly x: 1;
|
|
275
|
+
readonly y: 1;
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
type MenuPlacement = {
|
|
279
|
+
rect: Rect;
|
|
280
|
+
corner: MenuCorner;
|
|
281
|
+
/** The menu's corner on the pinned side: where its growth ends. */
|
|
282
|
+
anchor: GrowthPoint;
|
|
283
|
+
};
|
|
284
|
+
/** The trigger's corner nearest the viewport corner it sits in: the open space lies away from it. */
|
|
285
|
+
declare function menuCorner(trigger: Rect, viewport: Size): MenuCorner;
|
|
286
|
+
/**
|
|
287
|
+
* The menu shares a corner with its trigger and covers it. An automatic corner flips on an axis
|
|
288
|
+
* where the menu would leave the viewport and the other side fits; then it slides in.
|
|
289
|
+
*/
|
|
290
|
+
declare function menuPlacement(trigger: Rect, menu: Size, viewport: Size, options?: {
|
|
291
|
+
corner?: MenuCorner | undefined;
|
|
292
|
+
margin?: number;
|
|
293
|
+
}): MenuPlacement;
|
|
294
|
+
type RoundedRect = Rect & {
|
|
295
|
+
radius: number;
|
|
296
|
+
};
|
|
297
|
+
type MenuSurfaceFrame = {
|
|
298
|
+
/** The surface's box this frame: the growth frame's body. */
|
|
299
|
+
box: RoundedRect;
|
|
300
|
+
/** The second shape for the lens's `setMorph`, offset from the box's centre; undefined once there is one body. */
|
|
301
|
+
morph: VireGlassMorph | undefined;
|
|
302
|
+
/** Where the content's origin sits relative to the box's: it keeps its final place while the box moves. */
|
|
303
|
+
content: {
|
|
304
|
+
x: number;
|
|
305
|
+
y: number;
|
|
306
|
+
};
|
|
307
|
+
ink: GrowthInk;
|
|
308
|
+
/** How much of a drop the surface is: 0 as the trigger and as the menu, highest in between. */
|
|
309
|
+
activity: number;
|
|
310
|
+
};
|
|
311
|
+
declare function menuActivity(phase: GrowthPhase): number;
|
|
312
|
+
declare function menuSurfaceFrame(trigger: RoundedRect, menu: RoundedRect, anchor: GrowthPoint, phase: GrowthPhase): MenuSurfaceFrame;
|
|
313
|
+
/** A menu is a larger piece of the same glass, and a larger piece scatters light more softly (M 7:19): it
|
|
314
|
+
* takes the core's sheet scattering, which turns text under it into soft spots without turning it to mush. */
|
|
315
|
+
declare function menuGlass(base: VireGlassMaterial): VireGlassMaterial;
|
|
316
|
+
/** The drop is the medium at its active end, the menu at rest is the resting glass. */
|
|
317
|
+
declare function menuMaterial(base: VireGlassMaterial, activity: number): VireGlassMaterial;
|
|
318
|
+
/** The gathered medium lit by a concentrate of its surroundings: about 0.2 lighter than what it covers at
|
|
319
|
+
* M 5:11, so white over a light backdrop, and only brighter over a dark one. */
|
|
320
|
+
declare const MENU_DROP_BODY: AtomBody;
|
|
321
|
+
declare function menuBody(base: VireGlassMaterial, activity: number, frost?: boolean): AtomBody;
|
|
322
|
+
type MenuItemState = {
|
|
323
|
+
active: boolean;
|
|
324
|
+
pressed: boolean;
|
|
325
|
+
disabled: boolean;
|
|
326
|
+
};
|
|
327
|
+
/** Ink laid on the glass under an item, as a fraction of the ink colour. */
|
|
328
|
+
declare const MENU_ITEM_FILL: {
|
|
329
|
+
readonly active: 0.1;
|
|
330
|
+
readonly pressed: 0.18;
|
|
331
|
+
};
|
|
332
|
+
declare function menuItemFill(state: MenuItemState): number;
|
|
333
|
+
|
|
186
334
|
type PressResponse = {
|
|
187
335
|
/** Fraction of its own size the body adds at full press. */
|
|
188
336
|
grow: number;
|
|
@@ -207,6 +355,19 @@ declare const BUTTON_SIZES: Readonly<Record<ControlSize, SizeSpec>>;
|
|
|
207
355
|
declare function iconButtonSize(size: ControlSize): SizeSpec & {
|
|
208
356
|
width: number;
|
|
209
357
|
};
|
|
358
|
+
type MenuSizeSpec = {
|
|
359
|
+
/** Row height; the glyph sits centred in a square of it. */
|
|
360
|
+
row: number;
|
|
361
|
+
padding: number;
|
|
362
|
+
/** The active item's highlight. */
|
|
363
|
+
itemRadius: number;
|
|
364
|
+
/** Concentric with the highlight: its radius plus the padding. */
|
|
365
|
+
radius: number;
|
|
366
|
+
icon: number;
|
|
367
|
+
/** The label's inset in an item without a glyph. */
|
|
368
|
+
labelPad: number;
|
|
369
|
+
};
|
|
370
|
+
declare function menuSize(size: ControlSize): MenuSizeSpec;
|
|
210
371
|
declare function nestedRadius(outerRadius: number, inset: number, minimum?: number): number;
|
|
211
372
|
declare function defaultSize(input: {
|
|
212
373
|
touch: boolean;
|
|
@@ -216,4 +377,4 @@ declare function minTarget(input: {
|
|
|
216
377
|
touch: boolean;
|
|
217
378
|
}): number;
|
|
218
379
|
|
|
219
|
-
export { ATOM_AT_REST, type AtomBody, BUTTON_SIZES, CONTROL_IDLE, CONTROL_SIZES, type ControlEvent, type ControlSize, type ControlState, type ControlStep, type ControlTargets, type ControlVisual, DEFAULT_GROWTH_TIMING, type FocusChange, type GrowthFrame, type GrowthInk, type GrowthPhase, type GrowthPoint, type GrowthShape, type GrowthState, type GrowthTiming, type HoverChange, type InputCaps, MIN_POINTER_TARGET_DP, MIN_TOUCH_TARGET_DP, POINTER_INPUT, PRESS_IDLE, type PressEvent, type PressResponse, type PressSource, type PressState, type PressStep, type SizeSpec, type Spring, TOUCH_INPUT, type VireUIKitAtomKind, type VireUIKitAtomState, atomAtRest, atomBody, atomLift, atomMaterial, controlTargets, createControlVisual, createGrowthState, defaultSize, growthFrame, growthInk, growthPhase, hitSlop, iconButtonSize, minTarget, nestedRadius, pressResponse, settleControlVisual, smoothstep, stepControl, stepControlVisual, stepFocus, stepGrowth, stepHover, stepPress, stepSpring, visualAtomState };
|
|
380
|
+
export { ATOM_AT_REST, type AtomBody, BUTTON_SIZES, CONTROL_IDLE, CONTROL_SIZES, type ControlEvent, type ControlSize, type ControlState, type ControlStep, type ControlTargets, type ControlVisual, DEFAULT_GROWTH_TIMING, type FocusChange, type GrowthFrame, type GrowthInk, type GrowthPhase, type GrowthPoint, type GrowthShape, type GrowthState, type GrowthTiming, type HoverChange, type InputCaps, MENU_CLOSED, MENU_CORNERS, MENU_DROP_BODY, MENU_ITEM_FILL, MIN_POINTER_TARGET_DP, MIN_TOUCH_TARGET_DP, type MenuCorner, type MenuDismissal, type MenuEvent, type MenuFocus, type MenuItem, type MenuItemState, type MenuPlacement, type MenuSizeSpec, type MenuState, type MenuStep, type MenuSurfaceFrame, POINTER_INPUT, PRESS_IDLE, type PressEvent, type PressResponse, type PressSource, type PressState, type PressStep, type Rect, type RoundedRect, type Size, type SizeSpec, type Spring, TOUCH_INPUT, TYPEAHEAD_SECONDS, type VireUIKitAtomKind, type VireUIKitAtomState, atomAtRest, atomBody, atomLift, atomMaterial, controlTargets, createControlVisual, createGrowthState, defaultSize, growthFrame, growthInk, growthPhase, hitSlop, iconButtonSize, menuActivity, menuBody, menuCorner, menuGlass, menuItemFill, menuMaterial, menuPlacement, menuSize, menuSurfaceFrame, minTarget, nestedRadius, pressResponse, settleControlVisual, smoothstep, stepControl, stepControlVisual, stepFocus, stepGrowth, stepHover, stepMenu, stepPress, stepSpring, visualAtomState };
|
package/dist/index.d.ts
CHANGED
|
@@ -156,9 +156,9 @@ type GrowthState = {
|
|
|
156
156
|
};
|
|
157
157
|
declare const createGrowthState: () => GrowthState;
|
|
158
158
|
declare const growthPhase: (state: GrowthState) => GrowthPhase;
|
|
159
|
-
/** Durations are client-specific:
|
|
160
|
-
* atom at a different scale (an icon opening into a sheet)
|
|
161
|
-
* shape of the transition is shared regardless. */
|
|
159
|
+
/** Durations are client-specific: the default is fitted to the menu growing out of its toolbar at
|
|
160
|
+
* M 5:11 (docs/acceptance.md, N9), and an atom at a different scale (an icon opening into a sheet)
|
|
161
|
+
* isn't obligated to match it. The shape of the transition is shared regardless. */
|
|
162
162
|
type GrowthTiming = {
|
|
163
163
|
shrinkOpen: number;
|
|
164
164
|
shrinkClose: number;
|
|
@@ -183,6 +183,154 @@ declare function stepControlVisual(visual: ControlVisual, dt: number, state: Con
|
|
|
183
183
|
declare function visualAtomState(visual: ControlVisual, state: ControlState): VireUIKitAtomState;
|
|
184
184
|
declare function settleControlVisual(visual: ControlVisual, state: ControlState): void;
|
|
185
185
|
|
|
186
|
+
/**
|
|
187
|
+
* `disabled`: cannot be chosen. `focusable` (default: not disabled): whether focus can land on it. A native
|
|
188
|
+
* disabled button cannot take focus, so the keyboard passes over it; an aria-disabled one can (WAI-ARIA APG).
|
|
189
|
+
*/
|
|
190
|
+
type MenuItem = {
|
|
191
|
+
label: string;
|
|
192
|
+
disabled: boolean;
|
|
193
|
+
focusable?: boolean;
|
|
194
|
+
};
|
|
195
|
+
type MenuState = {
|
|
196
|
+
open: boolean;
|
|
197
|
+
/** The active item, or -1 while the menu itself holds focus. */
|
|
198
|
+
active: number;
|
|
199
|
+
typed: string;
|
|
200
|
+
/** Seconds, on whatever clock the events carry. */
|
|
201
|
+
typedAt: number;
|
|
202
|
+
};
|
|
203
|
+
declare const MENU_CLOSED: MenuState;
|
|
204
|
+
type MenuDismissal = 'escape' | 'outside' | 'tab' | 'trigger';
|
|
205
|
+
type MenuEvent = {
|
|
206
|
+
type: 'open';
|
|
207
|
+
focus: 'menu' | 'first' | 'last';
|
|
208
|
+
} | {
|
|
209
|
+
type: 'move';
|
|
210
|
+
to: 'next' | 'previous' | 'first' | 'last';
|
|
211
|
+
} | {
|
|
212
|
+
type: 'point';
|
|
213
|
+
index: number;
|
|
214
|
+
} | {
|
|
215
|
+
type: 'type';
|
|
216
|
+
key: string;
|
|
217
|
+
at: number;
|
|
218
|
+
} | {
|
|
219
|
+
type: 'choose';
|
|
220
|
+
index: number;
|
|
221
|
+
} | {
|
|
222
|
+
type: 'dismiss';
|
|
223
|
+
reason: MenuDismissal;
|
|
224
|
+
};
|
|
225
|
+
/** Where focus goes after a step. `none` leaves it where the person put it (a press outside). */
|
|
226
|
+
type MenuFocus = {
|
|
227
|
+
to: 'item';
|
|
228
|
+
index: number;
|
|
229
|
+
} | {
|
|
230
|
+
to: 'menu';
|
|
231
|
+
} | {
|
|
232
|
+
to: 'trigger';
|
|
233
|
+
} | {
|
|
234
|
+
to: 'none';
|
|
235
|
+
} | {
|
|
236
|
+
to: 'stay';
|
|
237
|
+
};
|
|
238
|
+
type MenuStep = {
|
|
239
|
+
state: MenuState;
|
|
240
|
+
focus: MenuFocus;
|
|
241
|
+
chosen: number | null;
|
|
242
|
+
};
|
|
243
|
+
declare const TYPEAHEAD_SECONDS = 0.5;
|
|
244
|
+
declare function stepMenu(state: MenuState, event: MenuEvent, items: readonly MenuItem[]): MenuStep;
|
|
245
|
+
type Rect = {
|
|
246
|
+
x: number;
|
|
247
|
+
y: number;
|
|
248
|
+
width: number;
|
|
249
|
+
height: number;
|
|
250
|
+
};
|
|
251
|
+
type Size = {
|
|
252
|
+
width: number;
|
|
253
|
+
height: number;
|
|
254
|
+
};
|
|
255
|
+
/** -1 is left or top, 1 is right or bottom. */
|
|
256
|
+
type MenuCorner = {
|
|
257
|
+
x: -1 | 1;
|
|
258
|
+
y: -1 | 1;
|
|
259
|
+
};
|
|
260
|
+
declare const MENU_CORNERS: {
|
|
261
|
+
readonly 'top-left': {
|
|
262
|
+
readonly x: -1;
|
|
263
|
+
readonly y: -1;
|
|
264
|
+
};
|
|
265
|
+
readonly 'top-right': {
|
|
266
|
+
readonly x: 1;
|
|
267
|
+
readonly y: -1;
|
|
268
|
+
};
|
|
269
|
+
readonly 'bottom-left': {
|
|
270
|
+
readonly x: -1;
|
|
271
|
+
readonly y: 1;
|
|
272
|
+
};
|
|
273
|
+
readonly 'bottom-right': {
|
|
274
|
+
readonly x: 1;
|
|
275
|
+
readonly y: 1;
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
type MenuPlacement = {
|
|
279
|
+
rect: Rect;
|
|
280
|
+
corner: MenuCorner;
|
|
281
|
+
/** The menu's corner on the pinned side: where its growth ends. */
|
|
282
|
+
anchor: GrowthPoint;
|
|
283
|
+
};
|
|
284
|
+
/** The trigger's corner nearest the viewport corner it sits in: the open space lies away from it. */
|
|
285
|
+
declare function menuCorner(trigger: Rect, viewport: Size): MenuCorner;
|
|
286
|
+
/**
|
|
287
|
+
* The menu shares a corner with its trigger and covers it. An automatic corner flips on an axis
|
|
288
|
+
* where the menu would leave the viewport and the other side fits; then it slides in.
|
|
289
|
+
*/
|
|
290
|
+
declare function menuPlacement(trigger: Rect, menu: Size, viewport: Size, options?: {
|
|
291
|
+
corner?: MenuCorner | undefined;
|
|
292
|
+
margin?: number;
|
|
293
|
+
}): MenuPlacement;
|
|
294
|
+
type RoundedRect = Rect & {
|
|
295
|
+
radius: number;
|
|
296
|
+
};
|
|
297
|
+
type MenuSurfaceFrame = {
|
|
298
|
+
/** The surface's box this frame: the growth frame's body. */
|
|
299
|
+
box: RoundedRect;
|
|
300
|
+
/** The second shape for the lens's `setMorph`, offset from the box's centre; undefined once there is one body. */
|
|
301
|
+
morph: VireGlassMorph | undefined;
|
|
302
|
+
/** Where the content's origin sits relative to the box's: it keeps its final place while the box moves. */
|
|
303
|
+
content: {
|
|
304
|
+
x: number;
|
|
305
|
+
y: number;
|
|
306
|
+
};
|
|
307
|
+
ink: GrowthInk;
|
|
308
|
+
/** How much of a drop the surface is: 0 as the trigger and as the menu, highest in between. */
|
|
309
|
+
activity: number;
|
|
310
|
+
};
|
|
311
|
+
declare function menuActivity(phase: GrowthPhase): number;
|
|
312
|
+
declare function menuSurfaceFrame(trigger: RoundedRect, menu: RoundedRect, anchor: GrowthPoint, phase: GrowthPhase): MenuSurfaceFrame;
|
|
313
|
+
/** A menu is a larger piece of the same glass, and a larger piece scatters light more softly (M 7:19): it
|
|
314
|
+
* takes the core's sheet scattering, which turns text under it into soft spots without turning it to mush. */
|
|
315
|
+
declare function menuGlass(base: VireGlassMaterial): VireGlassMaterial;
|
|
316
|
+
/** The drop is the medium at its active end, the menu at rest is the resting glass. */
|
|
317
|
+
declare function menuMaterial(base: VireGlassMaterial, activity: number): VireGlassMaterial;
|
|
318
|
+
/** The gathered medium lit by a concentrate of its surroundings: about 0.2 lighter than what it covers at
|
|
319
|
+
* M 5:11, so white over a light backdrop, and only brighter over a dark one. */
|
|
320
|
+
declare const MENU_DROP_BODY: AtomBody;
|
|
321
|
+
declare function menuBody(base: VireGlassMaterial, activity: number, frost?: boolean): AtomBody;
|
|
322
|
+
type MenuItemState = {
|
|
323
|
+
active: boolean;
|
|
324
|
+
pressed: boolean;
|
|
325
|
+
disabled: boolean;
|
|
326
|
+
};
|
|
327
|
+
/** Ink laid on the glass under an item, as a fraction of the ink colour. */
|
|
328
|
+
declare const MENU_ITEM_FILL: {
|
|
329
|
+
readonly active: 0.1;
|
|
330
|
+
readonly pressed: 0.18;
|
|
331
|
+
};
|
|
332
|
+
declare function menuItemFill(state: MenuItemState): number;
|
|
333
|
+
|
|
186
334
|
type PressResponse = {
|
|
187
335
|
/** Fraction of its own size the body adds at full press. */
|
|
188
336
|
grow: number;
|
|
@@ -207,6 +355,19 @@ declare const BUTTON_SIZES: Readonly<Record<ControlSize, SizeSpec>>;
|
|
|
207
355
|
declare function iconButtonSize(size: ControlSize): SizeSpec & {
|
|
208
356
|
width: number;
|
|
209
357
|
};
|
|
358
|
+
type MenuSizeSpec = {
|
|
359
|
+
/** Row height; the glyph sits centred in a square of it. */
|
|
360
|
+
row: number;
|
|
361
|
+
padding: number;
|
|
362
|
+
/** The active item's highlight. */
|
|
363
|
+
itemRadius: number;
|
|
364
|
+
/** Concentric with the highlight: its radius plus the padding. */
|
|
365
|
+
radius: number;
|
|
366
|
+
icon: number;
|
|
367
|
+
/** The label's inset in an item without a glyph. */
|
|
368
|
+
labelPad: number;
|
|
369
|
+
};
|
|
370
|
+
declare function menuSize(size: ControlSize): MenuSizeSpec;
|
|
210
371
|
declare function nestedRadius(outerRadius: number, inset: number, minimum?: number): number;
|
|
211
372
|
declare function defaultSize(input: {
|
|
212
373
|
touch: boolean;
|
|
@@ -216,4 +377,4 @@ declare function minTarget(input: {
|
|
|
216
377
|
touch: boolean;
|
|
217
378
|
}): number;
|
|
218
379
|
|
|
219
|
-
export { ATOM_AT_REST, type AtomBody, BUTTON_SIZES, CONTROL_IDLE, CONTROL_SIZES, type ControlEvent, type ControlSize, type ControlState, type ControlStep, type ControlTargets, type ControlVisual, DEFAULT_GROWTH_TIMING, type FocusChange, type GrowthFrame, type GrowthInk, type GrowthPhase, type GrowthPoint, type GrowthShape, type GrowthState, type GrowthTiming, type HoverChange, type InputCaps, MIN_POINTER_TARGET_DP, MIN_TOUCH_TARGET_DP, POINTER_INPUT, PRESS_IDLE, type PressEvent, type PressResponse, type PressSource, type PressState, type PressStep, type SizeSpec, type Spring, TOUCH_INPUT, type VireUIKitAtomKind, type VireUIKitAtomState, atomAtRest, atomBody, atomLift, atomMaterial, controlTargets, createControlVisual, createGrowthState, defaultSize, growthFrame, growthInk, growthPhase, hitSlop, iconButtonSize, minTarget, nestedRadius, pressResponse, settleControlVisual, smoothstep, stepControl, stepControlVisual, stepFocus, stepGrowth, stepHover, stepPress, stepSpring, visualAtomState };
|
|
380
|
+
export { ATOM_AT_REST, type AtomBody, BUTTON_SIZES, CONTROL_IDLE, CONTROL_SIZES, type ControlEvent, type ControlSize, type ControlState, type ControlStep, type ControlTargets, type ControlVisual, DEFAULT_GROWTH_TIMING, type FocusChange, type GrowthFrame, type GrowthInk, type GrowthPhase, type GrowthPoint, type GrowthShape, type GrowthState, type GrowthTiming, type HoverChange, type InputCaps, MENU_CLOSED, MENU_CORNERS, MENU_DROP_BODY, MENU_ITEM_FILL, MIN_POINTER_TARGET_DP, MIN_TOUCH_TARGET_DP, type MenuCorner, type MenuDismissal, type MenuEvent, type MenuFocus, type MenuItem, type MenuItemState, type MenuPlacement, type MenuSizeSpec, type MenuState, type MenuStep, type MenuSurfaceFrame, POINTER_INPUT, PRESS_IDLE, type PressEvent, type PressResponse, type PressSource, type PressState, type PressStep, type Rect, type RoundedRect, type Size, type SizeSpec, type Spring, TOUCH_INPUT, TYPEAHEAD_SECONDS, type VireUIKitAtomKind, type VireUIKitAtomState, atomAtRest, atomBody, atomLift, atomMaterial, controlTargets, createControlVisual, createGrowthState, defaultSize, growthFrame, growthInk, growthPhase, hitSlop, iconButtonSize, menuActivity, menuBody, menuCorner, menuGlass, menuItemFill, menuMaterial, menuPlacement, menuSize, menuSurfaceFrame, minTarget, nestedRadius, pressResponse, settleControlVisual, smoothstep, stepControl, stepControlVisual, stepFocus, stepGrowth, stepHover, stepMenu, stepPress, stepSpring, visualAtomState };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A11Y_NONE, ATOM_AT_REST, BUTTON_SIZES, CONTROL_IDLE, CONTROL_SIZES, DEFAULT_GROWTH_TIMING, MIN_POINTER_TARGET_DP, MIN_TOUCH_TARGET_DP, POINTER_INPUT, PRESS_IDLE, TOUCH_INPUT, atomAtRest, atomBody, atomLift, atomMaterial, controlTargets, createControlVisual, createGrowthState, defaultSize, growthFrame, growthInk, growthPhase, hitSlop, iconButtonSize, minTarget, nestedRadius, presentationFor, pressResponse, resolveA11y, sameA11y, settleControlVisual, smoothstep, stepControl, stepControlVisual, stepFocus, stepGrowth, stepHover, stepPress, stepSpring, visualAtomState } from './chunk-
|
|
1
|
+
export { A11Y_NONE, ATOM_AT_REST, BUTTON_SIZES, CONTROL_IDLE, CONTROL_SIZES, DEFAULT_GROWTH_TIMING, MENU_CLOSED, MENU_CORNERS, MENU_DROP_BODY, MENU_ITEM_FILL, MIN_POINTER_TARGET_DP, MIN_TOUCH_TARGET_DP, POINTER_INPUT, PRESS_IDLE, TOUCH_INPUT, TYPEAHEAD_SECONDS, atomAtRest, atomBody, atomLift, atomMaterial, controlTargets, createControlVisual, createGrowthState, defaultSize, growthFrame, growthInk, growthPhase, hitSlop, iconButtonSize, menuActivity, menuBody, menuCorner, menuGlass, menuItemFill, menuMaterial, menuPlacement, menuSize, menuSurfaceFrame, minTarget, nestedRadius, presentationFor, pressResponse, resolveA11y, sameA11y, settleControlVisual, smoothstep, stepControl, stepControlVisual, stepFocus, stepGrowth, stepHover, stepMenu, stepPress, stepSpring, visualAtomState } from './chunk-AR2AM3BR.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|