@noxlovette/material 0.4.8 → 0.5.1
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/animation/Shapes.stories.svelte +56 -0
- package/dist/animation/Shapes.stories.svelte.d.ts +3 -0
- package/dist/animation/TransitionPatterns.stories.svelte +359 -0
- package/dist/animation/TransitionPatterns.stories.svelte.d.ts +3 -0
- package/dist/animation/containerTransform.d.ts +35 -12
- package/dist/animation/containerTransform.js +31 -138
- package/dist/animation/enterExit.d.ts +30 -3
- package/dist/animation/enterExit.js +69 -22
- package/dist/animation/index.d.ts +2 -1
- package/dist/animation/index.js +2 -1
- package/dist/animation/presence.svelte.d.ts +47 -0
- package/dist/animation/presence.svelte.js +84 -0
- package/dist/animation/shapeMorph.svelte.d.ts +52 -0
- package/dist/animation/shapeMorph.svelte.js +112 -0
- package/dist/animation/shapesAnimatableSmall.d.ts +28 -22
- package/dist/animation/shapesAnimatableSmall.js +32 -23
- package/dist/animation/sharedAxisTransition.d.ts +57 -37
- package/dist/animation/sharedAxisTransition.js +74 -22
- package/dist/animation/skeleton.d.ts +16 -0
- package/dist/animation/skeleton.js +28 -0
- package/dist/animation/spring.d.ts +61 -0
- package/dist/animation/spring.js +53 -0
- package/dist/animation/springValue.svelte.d.ts +22 -0
- package/dist/animation/springValue.svelte.js +42 -0
- package/dist/animation/transition.d.ts +3 -1
- package/dist/animation/transition.js +3 -1
- package/dist/attachments/clickOutside.d.ts +13 -0
- package/dist/attachments/clickOutside.js +18 -0
- package/dist/attachments/index.d.ts +1 -0
- package/dist/attachments/index.js +1 -0
- package/dist/components/buttons/FAB.svelte +23 -16
- package/dist/components/buttons/FABMenu.svelte +24 -29
- package/dist/components/buttons/FABMenu.svelte.d.ts +2 -1
- package/dist/components/buttons/FABMenuItem.svelte +23 -20
- package/dist/components/buttons/FABMenuItem.svelte.d.ts +5 -1
- package/dist/components/buttons/split-button/SplitButton.svelte +10 -17
- package/dist/components/buttons/split-button/theme.js +1 -1
- package/dist/components/buttons/types.d.ts +3 -3
- package/dist/components/cards/theme.js +1 -1
- package/dist/components/containers/bottom-sheet/BottomSheet.stories.svelte +8 -12
- package/dist/components/containers/bottom-sheet/BottomSheet.svelte +67 -55
- package/dist/components/containers/bottom-sheet/BottomSheet.svelte.d.ts +1 -1
- package/dist/components/containers/bottom-sheet/types.d.ts +8 -2
- package/dist/components/containers/context-menu/ContextMenu.svelte +23 -36
- package/dist/components/containers/context-menu/theme.js +2 -2
- package/dist/components/containers/dialogue/Dialogue.svelte +49 -65
- package/dist/components/containers/link-preview/LinkPreview.svelte +12 -23
- package/dist/components/containers/link-preview/theme.d.ts +3 -3
- package/dist/components/containers/menu/Menu.svelte +14 -21
- package/dist/components/containers/menu/MenuSub.svelte +10 -17
- package/dist/components/containers/pane/DraggablePane.svelte +90 -5
- package/dist/components/containers/pane/DraggablePane.svelte.d.ts +1 -1
- package/dist/components/containers/pane/theme.js +2 -2
- package/dist/components/containers/popover/Popover.svelte +31 -42
- package/dist/components/containers/popover/theme.d.ts +3 -3
- package/dist/components/containers/scroll-area/theme.js +2 -2
- package/dist/components/containers/side-sheet/SideSheet.stories.svelte +10 -15
- package/dist/components/containers/side-sheet/SideSheet.svelte +44 -44
- package/dist/components/containers/side-sheet/SideSheet.svelte.d.ts +4 -3
- package/dist/components/containers/side-sheet/types.d.ts +8 -2
- package/dist/components/date/DateField.svelte +99 -92
- package/dist/components/date/DateField.svelte.d.ts +4 -5
- package/dist/components/date/DateRangeField.svelte +127 -155
- package/dist/components/date/DateRangeField.svelte.d.ts +4 -5
- package/dist/components/date/calendarMotion.d.ts +9 -0
- package/dist/components/date/calendarMotion.js +23 -0
- package/dist/components/date/theme.d.ts +95 -0
- package/dist/components/date/theme.js +103 -14
- package/dist/components/date/types.d.ts +13 -0
- package/dist/components/forms/checkbox/theme.js +2 -2
- package/dist/components/forms/command/theme.d.ts +3 -3
- package/dist/components/forms/command/theme.js +1 -1
- package/dist/components/forms/pin/theme.js +2 -2
- package/dist/components/forms/radio-group/theme.js +2 -2
- package/dist/components/forms/select/Select.svelte +42 -54
- package/dist/components/forms/select/theme.js +4 -4
- package/dist/components/forms/slider/Slider.svelte +144 -126
- package/dist/components/forms/slider/Slider.svelte.d.ts +3 -0
- package/dist/components/forms/slider/theme.d.ts +154 -48
- package/dist/components/forms/slider/theme.js +60 -20
- package/dist/components/forms/slider/types.d.ts +1 -1
- package/dist/components/forms/switch/theme.js +4 -4
- package/dist/components/forms/textfield/Textfield.svelte +1 -1
- package/dist/components/forms/textfield/theme.d.ts +12 -0
- package/dist/components/forms/textfield/theme.js +30 -10
- package/dist/components/forms/toggle-group/theme.js +1 -1
- package/dist/components/forms/tooltip/Tooltip.svelte +24 -35
- package/dist/components/nav/breadcrumb/theme.js +1 -1
- package/dist/components/nav/navbar/theme.js +2 -2
- package/dist/components/nav/rail/Rail.svelte +4 -5
- package/dist/components/nav/rail/theme.js +7 -7
- package/dist/components/nav/tabs/TabHolder.svelte +29 -3
- package/dist/components/nav/tabs/TabHolder.svelte.d.ts +3 -1
- package/dist/components/nav/tabs/theme.js +1 -1
- package/dist/components/progress/CircularProgress.svelte +78 -4
- package/dist/components/progress/CircularProgress.svelte.d.ts +5 -0
- package/dist/components/progress/LinearProgress.svelte +70 -7
- package/dist/components/progress/LinearProgress.svelte.d.ts +5 -0
- package/dist/components/progress/WavyLinearProgress.svelte +27 -3
- package/dist/components/progress/WavyLinearProgress.svelte.d.ts +3 -0
- package/dist/components/progress/_wavy.d.ts +2 -0
- package/dist/components/progress/_wavy.js +3 -1
- package/dist/components/snackbar/Snackbar.svelte +13 -17
- package/dist/components/table/TableBody.svelte +3 -16
- package/dist/components/table/TableBody.svelte.d.ts +1 -5
- package/dist/components/table/TableHeader.svelte +1 -1
- package/dist/components/table/theme.js +1 -1
- package/dist/components/table/types.d.ts +0 -7
- package/dist/components/time/TimeField.stories.svelte +41 -0
- package/dist/components/time/TimeField.stories.svelte.d.ts +19 -0
- package/dist/components/time/TimeField.svelte +69 -62
- package/dist/components/time/TimeField.svelte.d.ts +6 -0
- package/dist/components/time/TimepickerInput.svelte +8 -4
- package/dist/components/time/types.d.ts +11 -1
- package/dist/components/toolbar/theme.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles/component.css +21 -22
- package/dist/styles/motion.css +317 -38
- package/dist/utils/Layer.svelte +16 -29
- package/dist/utils/icon/LoadingIndicator.svelte +61 -22
- package/dist/utils/icon/loadingShapes.d.ts +1 -0
- package/dist/utils/icon/loadingShapes.js +16 -0
- package/package.json +5 -2
- package/dist/actions/clickOutside.d.ts +0 -3
- package/dist/actions/clickOutside.js +0 -13
- package/dist/actions/floating.d.ts +0 -20
- package/dist/actions/floating.js +0 -87
- package/dist/actions/index.d.ts +0 -6
- package/dist/actions/index.js +0 -6
- package/dist/actions/keyboard.d.ts +0 -3
- package/dist/actions/keyboard.js +0 -14
- package/dist/actions/portal.d.ts +0 -3
- package/dist/actions/portal.js +0 -8
- package/dist/actions/positionFloating.d.ts +0 -10
- package/dist/actions/positionFloating.js +0 -59
- package/dist/actions/rovingFocusGroup.d.ts +0 -20
- package/dist/actions/rovingFocusGroup.js +0 -82
- package/dist/animation/easing.d.ts +0 -6
- package/dist/animation/easing.js +0 -78
- package/dist/animation/outroClass.d.ts +0 -3
- package/dist/animation/outroClass.js +0 -20
- package/dist/animation/transitionTypes.d.ts +0 -8
- package/dist/animation/transitionTypes.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LOADING_SHAPES: readonly ["m37.4 24.7 0.5 0.7 0.8 0.9 0.8 1.0 0.6 1.0 -0.1 0.8 -0.0 0.1 -0.6 0.7 -1.1 0.5 -1.3 0.3 -1.0 0.2 -0.9 0.4 -0.7 1.1 0.1 1.0 0.1 1.1 0.0 1.2 -0.2 1.1 -0.4 0.5 -0.3 0.2 -0.8 0.2 -1.2 -0.4 -1.2 -0.4 -1.0 -0.5 -0.8 -0.1 -1.3 0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9 -0.1 1.0 -0.1 0.9 0.0 0.9 0.1 0.9 0.1 0.9 0.3 0.9 0.3 0.8 0.4 0.8 0.6 0.7 0.6 -0.0 0.0 0.6 0.7 0.6 0.8 0.4 0.8 0.3 0.9 0.3 0.9 0.1 0.9 0.1 0.9 -0.0 0.9 -0.1 1.0 -0.1 0.9 -0.1 0.8 -0.2 0.8 -0.3 0.9 -0.3 0.7 z"];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { pathAnimatableSmallFourSidedCookie, pathAnimatableSmallNineSidedCookie, pathAnimatableSmallOval, pathAnimatableSmallPentagon, pathAnimatableSmallPill, pathAnimatableSmallSoftBurst, pathAnimatableSmallSunny } from '../../animation/shapesAnimatableSmall.js';
|
|
2
|
+
/*
|
|
3
|
+
The seven shapes the M3 loading indicator morphs through, in a 48 × 48 viewBox. They come from the
|
|
4
|
+
small animatable set, so every path has the same command structure (120 relative points) and
|
|
5
|
+
Motion's `mix` can interpolate between any two.
|
|
6
|
+
https://m3.material.io/components/loading-indicator/specs
|
|
7
|
+
*/
|
|
8
|
+
export const LOADING_SHAPES = [
|
|
9
|
+
pathAnimatableSmallSoftBurst,
|
|
10
|
+
pathAnimatableSmallNineSidedCookie,
|
|
11
|
+
pathAnimatableSmallPentagon,
|
|
12
|
+
pathAnimatableSmallPill,
|
|
13
|
+
pathAnimatableSmallSunny,
|
|
14
|
+
pathAnimatableSmallFourSidedCookie,
|
|
15
|
+
pathAnimatableSmallOval
|
|
16
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noxlovette/material",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Material Design 3 component library for Svelte, built on Bits UI.",
|
|
6
6
|
"keywords": [
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"url": "https://github.com/noxlovette/material/issues"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "svelte-package",
|
|
26
|
+
"build": "bun run generate:springs && svelte-package",
|
|
27
|
+
"generate:springs": "bun scripts/generate-motion-springs.ts && prettier --write src/lib/styles/motion.css",
|
|
27
28
|
"build:site": "vite build",
|
|
28
29
|
"watch": "svelte-package --watch",
|
|
29
30
|
"prepublishOnly": "bun run build",
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
"eslint-config-prettier": "^10.1.8",
|
|
82
83
|
"eslint-plugin-svelte": "^3.23.0",
|
|
83
84
|
"globals": "^17.11.0",
|
|
85
|
+
"jsdom": "^30.1.1",
|
|
84
86
|
"lefthook": "^2.1.12",
|
|
85
87
|
"prettier": "^3.9.6",
|
|
86
88
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
@@ -110,6 +112,7 @@
|
|
|
110
112
|
"bits-ui": "^2.19.0",
|
|
111
113
|
"clsx": "^2.1.1",
|
|
112
114
|
"mode-watcher": "^1.1.0",
|
|
115
|
+
"motion": "^13.4.0",
|
|
113
116
|
"nanoid": "^6.0.1",
|
|
114
117
|
"tailwind-merge": "^3.6.0",
|
|
115
118
|
"tailwind-variants": "^3.3.1"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function clickOutside(node, callback) {
|
|
2
|
-
const handleClick = (event) => {
|
|
3
|
-
if (!node.contains(event.target)) {
|
|
4
|
-
callback();
|
|
5
|
-
}
|
|
6
|
-
};
|
|
7
|
-
document.addEventListener('click', handleClick, true);
|
|
8
|
-
return {
|
|
9
|
-
destroy() {
|
|
10
|
-
document.removeEventListener('click', handleClick, true);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type Middleware, type Placement } from '@floating-ui/dom';
|
|
2
|
-
export type FloatingParams = {
|
|
3
|
-
reference: HTMLElement;
|
|
4
|
-
placement?: Placement;
|
|
5
|
-
strategy?: 'absolute' | 'fixed';
|
|
6
|
-
offsetPx?: number;
|
|
7
|
-
middleware?: Middleware[];
|
|
8
|
-
arrowEl?: HTMLElement | null;
|
|
9
|
-
arrowPadding?: number;
|
|
10
|
-
enabled?: boolean;
|
|
11
|
-
onUpdate?: (data: {
|
|
12
|
-
x: number;
|
|
13
|
-
y: number;
|
|
14
|
-
placement: Placement;
|
|
15
|
-
}) => void;
|
|
16
|
-
};
|
|
17
|
-
export declare function floating(node: HTMLElement, params: FloatingParams): {
|
|
18
|
-
update(next: FloatingParams): void;
|
|
19
|
-
destroy(): void;
|
|
20
|
-
};
|
package/dist/actions/floating.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { arrow as arrowMw, autoUpdate, computePosition, offset, shift } from '@floating-ui/dom';
|
|
2
|
-
export function floating(node, params) {
|
|
3
|
-
let cleanup = null;
|
|
4
|
-
let p = { ...params };
|
|
5
|
-
p.strategy ??= 'absolute';
|
|
6
|
-
p.offsetPx ??= 8;
|
|
7
|
-
p.enabled ??= true;
|
|
8
|
-
async function update() {
|
|
9
|
-
if (!p.enabled)
|
|
10
|
-
return;
|
|
11
|
-
if (!p.reference)
|
|
12
|
-
return;
|
|
13
|
-
const middleware = [
|
|
14
|
-
offset(p.offsetPx ?? 8),
|
|
15
|
-
shift({ padding: 8 }),
|
|
16
|
-
...(p.middleware ?? [])
|
|
17
|
-
];
|
|
18
|
-
if (p.arrowEl) {
|
|
19
|
-
middleware.push(arrowMw({
|
|
20
|
-
element: p.arrowEl,
|
|
21
|
-
padding: p.arrowPadding ?? 6
|
|
22
|
-
}));
|
|
23
|
-
}
|
|
24
|
-
const { x, y, placement, middlewareData } = await computePosition(p.reference, node, {
|
|
25
|
-
placement: p.placement,
|
|
26
|
-
strategy: p.strategy,
|
|
27
|
-
middleware
|
|
28
|
-
});
|
|
29
|
-
Object.assign(node.style, {
|
|
30
|
-
position: p.strategy,
|
|
31
|
-
left: `${x}px`,
|
|
32
|
-
top: `${y}px`
|
|
33
|
-
});
|
|
34
|
-
// Optional arrow positioning
|
|
35
|
-
if (p.arrowEl && middlewareData.arrow) {
|
|
36
|
-
const { x: ax, y: ay } = middlewareData.arrow;
|
|
37
|
-
const side = placement.split('-')[0]; // 'top'|'bottom'|'left'|'right'
|
|
38
|
-
const staticSide = {
|
|
39
|
-
top: 'bottom',
|
|
40
|
-
bottom: 'top',
|
|
41
|
-
left: 'right',
|
|
42
|
-
right: 'left'
|
|
43
|
-
};
|
|
44
|
-
Object.assign(p.arrowEl.style, {
|
|
45
|
-
left: ax != null ? `${ax}px` : '',
|
|
46
|
-
top: ay != null ? `${ay}px` : '',
|
|
47
|
-
right: '',
|
|
48
|
-
bottom: '',
|
|
49
|
-
[staticSide[side]]: `-4px` // arrow size tweak
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
p.onUpdate?.({ x, y, placement: placement });
|
|
53
|
-
}
|
|
54
|
-
function startAutoUpdate() {
|
|
55
|
-
stopAutoUpdate();
|
|
56
|
-
if (!p.enabled || !p.reference)
|
|
57
|
-
return;
|
|
58
|
-
cleanup = autoUpdate(p.reference, node, update, {
|
|
59
|
-
// works well for scroll containers too
|
|
60
|
-
ancestorScroll: true,
|
|
61
|
-
ancestorResize: true,
|
|
62
|
-
elementResize: true,
|
|
63
|
-
layoutShift: true,
|
|
64
|
-
animationFrame: false
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
function stopAutoUpdate() {
|
|
68
|
-
cleanup?.();
|
|
69
|
-
cleanup = null;
|
|
70
|
-
}
|
|
71
|
-
// init
|
|
72
|
-
startAutoUpdate();
|
|
73
|
-
void update();
|
|
74
|
-
return {
|
|
75
|
-
update(next) {
|
|
76
|
-
p = { ...p, ...next };
|
|
77
|
-
p.strategy ??= 'absolute';
|
|
78
|
-
p.offsetPx ??= 8;
|
|
79
|
-
p.enabled ??= true;
|
|
80
|
-
startAutoUpdate();
|
|
81
|
-
void update();
|
|
82
|
-
},
|
|
83
|
-
destroy() {
|
|
84
|
-
stopAutoUpdate();
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
}
|
package/dist/actions/index.d.ts
DELETED
package/dist/actions/index.js
DELETED
package/dist/actions/keyboard.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function keyEscape(node, callback) {
|
|
2
|
-
const handleKeydown = (event) => {
|
|
3
|
-
if (event.key === 'Escape') {
|
|
4
|
-
event.preventDefault();
|
|
5
|
-
callback();
|
|
6
|
-
}
|
|
7
|
-
};
|
|
8
|
-
window.addEventListener('keydown', handleKeydown);
|
|
9
|
-
return {
|
|
10
|
-
destroy() {
|
|
11
|
-
window.removeEventListener('keydown', handleKeydown);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
}
|
package/dist/actions/portal.d.ts
DELETED
package/dist/actions/portal.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type FloatingOptions = {
|
|
2
|
-
anchor: HTMLElement;
|
|
3
|
-
offset?: number;
|
|
4
|
-
viewportPadding?: number;
|
|
5
|
-
};
|
|
6
|
-
export declare function positionFloating(node: HTMLElement, options: FloatingOptions): {
|
|
7
|
-
update(newOptions: FloatingOptions): void;
|
|
8
|
-
destroy(): void;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export function positionFloating(node, options) {
|
|
2
|
-
let { anchor, offset = 8, viewportPadding = 8 } = options;
|
|
3
|
-
function updatePosition() {
|
|
4
|
-
if (!anchor || !node)
|
|
5
|
-
return;
|
|
6
|
-
const anchorRect = anchor.getBoundingClientRect();
|
|
7
|
-
const pickerRect = node.getBoundingClientRect();
|
|
8
|
-
const vh = window.innerHeight;
|
|
9
|
-
const vw = window.innerWidth;
|
|
10
|
-
const spaceBelow = vh - anchorRect.bottom;
|
|
11
|
-
const spaceAbove = anchorRect.top;
|
|
12
|
-
let placement = 'bottom';
|
|
13
|
-
if (spaceBelow < pickerRect.height && spaceAbove > spaceBelow) {
|
|
14
|
-
placement = 'top';
|
|
15
|
-
}
|
|
16
|
-
let top;
|
|
17
|
-
if (placement === 'bottom') {
|
|
18
|
-
top = anchorRect.bottom + offset;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
top = anchorRect.top - pickerRect.height - offset;
|
|
22
|
-
}
|
|
23
|
-
node.style.position = 'fixed';
|
|
24
|
-
const maxWidth = Math.max(vw - viewportPadding * 2, 0);
|
|
25
|
-
const maxHeight = Math.max(vh - viewportPadding * 2, 0);
|
|
26
|
-
const minWidth = Math.min(anchorRect.width, maxWidth);
|
|
27
|
-
const clamp = (value, min, max) => max < min ? min : Math.min(Math.max(value, min), max);
|
|
28
|
-
const clampedTop = clamp(top, viewportPadding, vh - pickerRect.height - viewportPadding);
|
|
29
|
-
const clampedLeft = clamp(anchorRect.left, viewportPadding, vw - pickerRect.width - viewportPadding);
|
|
30
|
-
node.style.top = `${isFinite(clampedTop) ? clampedTop : viewportPadding}px`;
|
|
31
|
-
node.style.left = `${isFinite(clampedLeft) ? clampedLeft : viewportPadding}px`;
|
|
32
|
-
node.style.minWidth = `${minWidth}px`;
|
|
33
|
-
node.style.maxWidth = `${maxWidth}px`;
|
|
34
|
-
node.style.maxHeight = `${maxHeight}px`;
|
|
35
|
-
node.style.overflow = 'auto';
|
|
36
|
-
node.dataset.placement = placement;
|
|
37
|
-
}
|
|
38
|
-
const ro = new ResizeObserver(() => updatePosition());
|
|
39
|
-
ro.observe(node);
|
|
40
|
-
ro.observe(anchor);
|
|
41
|
-
const onScroll = () => updatePosition();
|
|
42
|
-
const onResize = () => updatePosition();
|
|
43
|
-
window.addEventListener('scroll', onScroll, true);
|
|
44
|
-
window.addEventListener('resize', onResize);
|
|
45
|
-
queueMicrotask(updatePosition);
|
|
46
|
-
return {
|
|
47
|
-
update(newOptions) {
|
|
48
|
-
anchor = newOptions.anchor;
|
|
49
|
-
offset = newOptions.offset ?? 8;
|
|
50
|
-
viewportPadding = newOptions.viewportPadding ?? 8;
|
|
51
|
-
updatePosition();
|
|
52
|
-
},
|
|
53
|
-
destroy() {
|
|
54
|
-
ro.disconnect();
|
|
55
|
-
window.removeEventListener('scroll', onScroll, true);
|
|
56
|
-
window.removeEventListener('resize', onResize);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type RovingFocusGroupParams = {
|
|
2
|
-
/** CSS selector (relative to the node) matching the focusable candidates. */
|
|
3
|
-
candidateSelector: string;
|
|
4
|
-
/** Loop from the last candidate back to the first (and vice versa). */
|
|
5
|
-
loop?: boolean;
|
|
6
|
-
/** Disable the group without unmounting it (leaves existing tabindex/focus alone). */
|
|
7
|
-
enabled?: boolean;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Roving-tabindex keyboard navigation for a group of sibling elements (e.g. table rows,
|
|
11
|
-
* list items): only one candidate is ever a Tab stop, and ArrowDown/ArrowUp (plus the
|
|
12
|
-
* j/k vim aliases) move focus — and the roving tab stop — between candidates. Tab and
|
|
13
|
-
* Shift+Tab keep working natively since they only ever see the single active tabindex=0
|
|
14
|
-
* candidate. Modeled on bits-ui's RovingFocusGroup (packages/bits-ui/src/lib/internal/
|
|
15
|
-
* roving-focus-group.ts), adapted to a plain Svelte action instead of a headless class.
|
|
16
|
-
*/
|
|
17
|
-
export declare function rovingFocusGroup(node: HTMLElement, params: RovingFocusGroupParams): {
|
|
18
|
-
update(newParams: RovingFocusGroupParams): void;
|
|
19
|
-
destroy(): void;
|
|
20
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
const NEXT_KEYS = new Set(['ArrowDown', 'j']);
|
|
2
|
-
const PREV_KEYS = new Set(['ArrowUp', 'k']);
|
|
3
|
-
/**
|
|
4
|
-
* Roving-tabindex keyboard navigation for a group of sibling elements (e.g. table rows,
|
|
5
|
-
* list items): only one candidate is ever a Tab stop, and ArrowDown/ArrowUp (plus the
|
|
6
|
-
* j/k vim aliases) move focus — and the roving tab stop — between candidates. Tab and
|
|
7
|
-
* Shift+Tab keep working natively since they only ever see the single active tabindex=0
|
|
8
|
-
* candidate. Modeled on bits-ui's RovingFocusGroup (packages/bits-ui/src/lib/internal/
|
|
9
|
-
* roving-focus-group.ts), adapted to a plain Svelte action instead of a headless class.
|
|
10
|
-
*/
|
|
11
|
-
export function rovingFocusGroup(node, params) {
|
|
12
|
-
let p = params;
|
|
13
|
-
function candidates() {
|
|
14
|
-
return Array.from(node.querySelectorAll(p.candidateSelector));
|
|
15
|
-
}
|
|
16
|
-
function setup() {
|
|
17
|
-
if (!p.enabled)
|
|
18
|
-
return;
|
|
19
|
-
const items = candidates();
|
|
20
|
-
if (!items.length)
|
|
21
|
-
return;
|
|
22
|
-
const active = items.includes(document.activeElement)
|
|
23
|
-
? document.activeElement
|
|
24
|
-
: items[0];
|
|
25
|
-
for (const item of items) {
|
|
26
|
-
item.tabIndex = item === active ? 0 : -1;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function handleFocusIn(event) {
|
|
30
|
-
if (!p.enabled)
|
|
31
|
-
return;
|
|
32
|
-
const items = candidates();
|
|
33
|
-
const target = event.target;
|
|
34
|
-
if (!items.includes(target))
|
|
35
|
-
return;
|
|
36
|
-
for (const item of items) {
|
|
37
|
-
item.tabIndex = item === target ? 0 : -1;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function handleKeydown(event) {
|
|
41
|
-
if (!p.enabled)
|
|
42
|
-
return;
|
|
43
|
-
const target = event.target;
|
|
44
|
-
const items = candidates();
|
|
45
|
-
const index = items.indexOf(target);
|
|
46
|
-
if (index === -1)
|
|
47
|
-
return;
|
|
48
|
-
let nextIndex;
|
|
49
|
-
if (NEXT_KEYS.has(event.key))
|
|
50
|
-
nextIndex = index + 1;
|
|
51
|
-
else if (PREV_KEYS.has(event.key))
|
|
52
|
-
nextIndex = index - 1;
|
|
53
|
-
else if (event.key === 'Home')
|
|
54
|
-
nextIndex = 0;
|
|
55
|
-
else if (event.key === 'End')
|
|
56
|
-
nextIndex = items.length - 1;
|
|
57
|
-
if (nextIndex === undefined)
|
|
58
|
-
return;
|
|
59
|
-
if (nextIndex < 0)
|
|
60
|
-
nextIndex = p.loop ? items.length - 1 : 0;
|
|
61
|
-
else if (nextIndex >= items.length)
|
|
62
|
-
nextIndex = p.loop ? 0 : items.length - 1;
|
|
63
|
-
const nextItem = items[nextIndex];
|
|
64
|
-
if (!nextItem || nextItem === target)
|
|
65
|
-
return;
|
|
66
|
-
event.preventDefault();
|
|
67
|
-
nextItem.focus();
|
|
68
|
-
}
|
|
69
|
-
setup();
|
|
70
|
-
node.addEventListener('keydown', handleKeydown);
|
|
71
|
-
node.addEventListener('focusin', handleFocusIn);
|
|
72
|
-
return {
|
|
73
|
-
update(newParams) {
|
|
74
|
-
p = newParams;
|
|
75
|
-
setup();
|
|
76
|
-
},
|
|
77
|
-
destroy() {
|
|
78
|
-
node.removeEventListener('keydown', handleKeydown);
|
|
79
|
-
node.removeEventListener('focusin', handleFocusIn);
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const easeEmphasized: (t: number) => number;
|
|
2
|
-
export declare const easeEmphasizedDecel: (t: number) => number;
|
|
3
|
-
export declare const easeEmphasizedAccel: (t: number) => number;
|
|
4
|
-
export declare const easeStandard: (t: number) => number;
|
|
5
|
-
export declare const easeStandardDecel: (t: number) => number;
|
|
6
|
-
export declare const easeStandardAccel: (t: number) => number;
|
package/dist/animation/easing.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// TODO: update for Expressive
|
|
2
|
-
const createBezierLUT = (points, pointCount = 100) => {
|
|
3
|
-
const lut = [];
|
|
4
|
-
for (let t = 0; t < 1; t += 1 / pointCount) {
|
|
5
|
-
const a = (1 - t) * (1 - t) * (1 - t);
|
|
6
|
-
const b = (1 - t) * (1 - t) * t;
|
|
7
|
-
const c = (1 - t) * t * t;
|
|
8
|
-
const d = t * t * t;
|
|
9
|
-
const x = a * points[0][0] + 3 * b * points[1][0] + 3 * c * points[2][0] + d * points[3][0];
|
|
10
|
-
const y = a * points[0][1] + 3 * b * points[1][1] + 3 * c * points[2][1] + d * points[3][1];
|
|
11
|
-
lut.push([x, y]);
|
|
12
|
-
}
|
|
13
|
-
return lut;
|
|
14
|
-
};
|
|
15
|
-
const createEase = (lutOptions) => {
|
|
16
|
-
let lut;
|
|
17
|
-
return (t) => {
|
|
18
|
-
if (!lut)
|
|
19
|
-
lut = lutOptions.map((args) => createBezierLUT(args)).flat();
|
|
20
|
-
const closestPoint = lut.find((p) => p[0] >= t);
|
|
21
|
-
const closestY = closestPoint ? closestPoint[1] : 1;
|
|
22
|
-
return closestY;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export const easeEmphasized = createEase([
|
|
26
|
-
[
|
|
27
|
-
[0, 0],
|
|
28
|
-
[0.05, 0],
|
|
29
|
-
[0.133, 0.06],
|
|
30
|
-
[0.166, 0.4]
|
|
31
|
-
],
|
|
32
|
-
[
|
|
33
|
-
[0.166, 0.4],
|
|
34
|
-
[0.208, 0.82],
|
|
35
|
-
[0.25, 1],
|
|
36
|
-
[1, 1]
|
|
37
|
-
]
|
|
38
|
-
]);
|
|
39
|
-
export const easeEmphasizedDecel = createEase([
|
|
40
|
-
[
|
|
41
|
-
[0, 0],
|
|
42
|
-
[0.05, 0.7],
|
|
43
|
-
[0.1, 1],
|
|
44
|
-
[1, 1]
|
|
45
|
-
]
|
|
46
|
-
]);
|
|
47
|
-
export const easeEmphasizedAccel = createEase([
|
|
48
|
-
[
|
|
49
|
-
[0, 0],
|
|
50
|
-
[0.3, 0],
|
|
51
|
-
[0.8, 0.15],
|
|
52
|
-
[1, 1]
|
|
53
|
-
]
|
|
54
|
-
]);
|
|
55
|
-
export const easeStandard = createEase([
|
|
56
|
-
[
|
|
57
|
-
[0, 0],
|
|
58
|
-
[0.2, 0],
|
|
59
|
-
[0, 1],
|
|
60
|
-
[1, 1]
|
|
61
|
-
]
|
|
62
|
-
]);
|
|
63
|
-
export const easeStandardDecel = createEase([
|
|
64
|
-
[
|
|
65
|
-
[0, 0],
|
|
66
|
-
[0, 0],
|
|
67
|
-
[0, 1],
|
|
68
|
-
[1, 1]
|
|
69
|
-
]
|
|
70
|
-
]);
|
|
71
|
-
export const easeStandardAccel = createEase([
|
|
72
|
-
[
|
|
73
|
-
[0, 0],
|
|
74
|
-
[0.3, 0],
|
|
75
|
-
[1, 1],
|
|
76
|
-
[1, 1]
|
|
77
|
-
]
|
|
78
|
-
]);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export const outroClass = (node) => {
|
|
2
|
-
const addClass = (e) => {
|
|
3
|
-
if (!(e.target instanceof Element))
|
|
4
|
-
return;
|
|
5
|
-
e.target.classList.add('leaving');
|
|
6
|
-
};
|
|
7
|
-
const removeClass = (e) => {
|
|
8
|
-
if (!(e.target instanceof Element))
|
|
9
|
-
return;
|
|
10
|
-
e.target.classList.remove('leaving');
|
|
11
|
-
};
|
|
12
|
-
node.addEventListener('outrostart', addClass);
|
|
13
|
-
node.addEventListener('outroend', removeClass);
|
|
14
|
-
return {
|
|
15
|
-
destroy() {
|
|
16
|
-
node.removeEventListener('outrostart', addClass);
|
|
17
|
-
node.removeEventListener('outroend', removeClass);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { cubicOut } from 'svelte/easing';
|
|
2
|
-
export type TransitionMode = 'fade' | 'scale' | 'slide-up' | 'dialog' | 'dialog-m3';
|
|
3
|
-
export interface TransitionOptions {
|
|
4
|
-
delay?: number;
|
|
5
|
-
duration?: number;
|
|
6
|
-
easing?: typeof cubicOut;
|
|
7
|
-
mode?: TransitionMode;
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|