@joewinke/jatui 0.1.33 → 0.2.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/CLAUDE.md +22 -0
- package/dist/actions/attention.d.ts +24 -0
- package/dist/actions/attention.js +94 -0
- package/dist/actions/floating.d.ts +53 -0
- package/dist/actions/floating.js +158 -0
- package/dist/actions/staggerEntrance.d.ts +28 -0
- package/dist/actions/staggerEntrance.js +71 -0
- package/dist/actions/tooltip.d.ts +28 -0
- package/dist/actions/tooltip.js +186 -0
- package/dist/assets/sounds/README.md +47 -0
- package/dist/assets/sounds/error.d.ts +1 -0
- package/dist/assets/sounds/error.js +4 -0
- package/dist/assets/sounds/notify.d.ts +1 -0
- package/dist/assets/sounds/notify.js +4 -0
- package/dist/assets/sounds/pop.d.ts +1 -0
- package/dist/assets/sounds/pop.js +4 -0
- package/dist/assets/sounds/send.d.ts +1 -0
- package/dist/assets/sounds/send.js +4 -0
- package/dist/assets/sounds/success.d.ts +1 -0
- package/dist/assets/sounds/success.js +4 -0
- package/dist/assets/sounds/toggle.d.ts +1 -0
- package/dist/assets/sounds/toggle.js +4 -0
- package/dist/components/AnimatedNumber.svelte +112 -0
- package/dist/components/AnimatedNumber.svelte.d.ts +8 -0
- package/dist/components/Badge.svelte +75 -4
- package/dist/components/Badge.svelte.d.ts +6 -1
- package/dist/components/Button.svelte +196 -21
- package/dist/components/Button.svelte.d.ts +10 -1
- package/dist/components/Carousel.svelte +265 -0
- package/dist/components/Carousel.svelte.d.ts +21 -0
- package/dist/components/ChipInput.svelte +63 -3
- package/dist/components/Collapse.svelte +70 -14
- package/dist/components/Collapse.svelte.d.ts +11 -0
- package/dist/components/ColorSelector.svelte +21 -24
- package/dist/components/CommandPalette.svelte +475 -0
- package/dist/components/CommandPalette.svelte.d.ts +3 -0
- package/dist/components/ContextMenu.svelte +9 -73
- package/dist/components/CopyButton.svelte +156 -0
- package/dist/components/CopyButton.svelte.d.ts +12 -0
- package/dist/components/HoldToConfirm.svelte +183 -0
- package/dist/components/HoldToConfirm.svelte.d.ts +11 -0
- package/dist/components/KeyboardShortcutsOverlay.svelte +54 -8
- package/dist/components/KeyboardShortcutsOverlay.svelte.d.ts +3 -0
- package/dist/components/PasswordMeter.svelte +87 -0
- package/dist/components/PasswordMeter.svelte.d.ts +8 -0
- package/dist/components/PinInput.svelte +186 -0
- package/dist/components/PinInput.svelte.d.ts +13 -0
- package/dist/components/QuantityStepper.svelte +185 -0
- package/dist/components/QuantityStepper.svelte.d.ts +12 -0
- package/dist/components/Skeleton.svelte +123 -0
- package/dist/components/Skeleton.svelte.d.ts +12 -0
- package/dist/components/SpeechForm.svelte +37 -0
- package/dist/components/StatusBadge.svelte +31 -3
- package/dist/components/StatusBadge.svelte.d.ts +0 -5
- package/dist/components/Tabs.svelte +270 -0
- package/dist/components/Tabs.svelte.d.ts +15 -0
- package/dist/components/TextInput.svelte +138 -38
- package/dist/components/TextInput.svelte.d.ts +9 -1
- package/dist/components/VoicePlayer.svelte +51 -0
- package/dist/components/basic/Alert.svelte +36 -0
- package/dist/components/basic/Alert.svelte.d.ts +9 -0
- package/dist/components/basic/Breadcrumb.svelte +27 -0
- package/dist/components/basic/Breadcrumb.svelte.d.ts +11 -0
- package/dist/components/basic/ButtonGroup.svelte +15 -0
- package/dist/components/basic/ButtonGroup.svelte.d.ts +8 -0
- package/dist/components/basic/Checkbox.svelte +85 -0
- package/dist/components/basic/Checkbox.svelte.d.ts +15 -0
- package/dist/components/basic/Empty.svelte +17 -0
- package/dist/components/basic/Empty.svelte.d.ts +8 -0
- package/dist/components/basic/Kbd.svelte +16 -0
- package/dist/components/basic/Kbd.svelte.d.ts +8 -0
- package/dist/components/basic/Pagination.svelte +104 -0
- package/dist/components/basic/Pagination.svelte.d.ts +12 -0
- package/dist/components/basic/RadioGroup.svelte +71 -0
- package/dist/components/basic/RadioGroup.svelte.d.ts +18 -0
- package/dist/components/basic/Separator.svelte +19 -0
- package/dist/components/basic/Separator.svelte.d.ts +8 -0
- package/dist/components/basic/Slider.svelte +72 -0
- package/dist/components/basic/Slider.svelte.d.ts +17 -0
- package/dist/components/basic/Switch.svelte +88 -0
- package/dist/components/basic/Switch.svelte.d.ts +14 -0
- package/dist/components/basic/Toggle.svelte +43 -0
- package/dist/components/basic/Toggle.svelte.d.ts +14 -0
- package/dist/components/graph/GraphCanvas.svelte +103 -0
- package/dist/components/graph/GraphCanvas.svelte.d.ts +22 -0
- package/dist/components/graph/JatuiNode.svelte +128 -0
- package/dist/components/graph/JatuiNode.svelte.d.ts +14 -0
- package/dist/components/graph/theme.d.ts +27 -0
- package/dist/components/graph/theme.js +136 -0
- package/dist/components/messaging/MessageItem.svelte +92 -0
- package/dist/components/messaging/MessageItem.svelte.d.ts +5 -0
- package/dist/components/messaging/TypingIndicator.svelte +63 -0
- package/dist/components/messaging/TypingIndicator.svelte.d.ts +7 -0
- package/dist/components/pipeline/PipelineColumn.svelte +44 -3
- package/dist/components/progress/ProgressBar.svelte +189 -0
- package/dist/components/progress/ProgressBar.svelte.d.ts +17 -0
- package/dist/components/progress/ProgressRing.svelte +138 -0
- package/dist/components/progress/ProgressRing.svelte.d.ts +12 -0
- package/dist/components/progress/Steps.svelte +195 -0
- package/dist/components/progress/Steps.svelte.d.ts +14 -0
- package/dist/components/shell/NavigationMenu.svelte +422 -0
- package/dist/components/shell/NavigationMenu.svelte.d.ts +43 -0
- package/dist/components/shell/Sidebar.svelte +276 -0
- package/dist/components/shell/Sidebar.svelte.d.ts +32 -0
- package/dist/components/shell/SidebarGroup.svelte +180 -0
- package/dist/components/shell/SidebarGroup.svelte.d.ts +19 -0
- package/dist/components/shell/SidebarItem.svelte +170 -0
- package/dist/components/shell/SidebarItem.svelte.d.ts +24 -0
- package/dist/components/shell/shell.d.ts +30 -0
- package/dist/components/shell/shell.js +65 -0
- package/dist/components/table/DataTable.svelte +364 -0
- package/dist/components/table/DataTable.svelte.d.ts +4 -0
- package/dist/components/table/flexRender.d.ts +31 -0
- package/dist/components/table/flexRender.js +32 -0
- package/dist/components/table/types.d.ts +28 -0
- package/dist/components/table/types.js +1 -0
- package/dist/components/toast/ToastHost.svelte +21 -0
- package/dist/components/toast/ToastHost.svelte.d.ts +3 -0
- package/dist/components/toast/ToastItem.svelte +287 -0
- package/dist/components/toast/ToastItem.svelte.d.ts +9 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +67 -0
- package/dist/showcase/AnimatedBeam.svelte +183 -0
- package/dist/showcase/AnimatedBeam.svelte.d.ts +26 -0
- package/dist/showcase/AuroraDrift.svelte +74 -0
- package/dist/showcase/AuroraDrift.svelte.d.ts +9 -0
- package/dist/showcase/BentoCard.svelte +50 -0
- package/dist/showcase/BentoCard.svelte.d.ts +14 -0
- package/dist/showcase/BentoGrid.svelte +43 -0
- package/dist/showcase/BentoGrid.svelte.d.ts +12 -0
- package/dist/showcase/BorderBeam.svelte +79 -0
- package/dist/showcase/BorderBeam.svelte.d.ts +12 -0
- package/dist/showcase/ClipWipe.svelte +82 -0
- package/dist/showcase/ClipWipe.svelte.d.ts +12 -0
- package/dist/showcase/Confetti.svelte +71 -0
- package/dist/showcase/Confetti.svelte.d.ts +10 -0
- package/dist/showcase/CursorSpotlight.svelte +85 -0
- package/dist/showcase/CursorSpotlight.svelte.d.ts +9 -0
- package/dist/showcase/DeviceMock.svelte +186 -0
- package/dist/showcase/DeviceMock.svelte.d.ts +11 -0
- package/dist/showcase/Dock.svelte +123 -0
- package/dist/showcase/Dock.svelte.d.ts +17 -0
- package/dist/showcase/FlipCard.svelte +103 -0
- package/dist/showcase/FlipCard.svelte.d.ts +10 -0
- package/dist/showcase/FocusReveal.svelte +83 -0
- package/dist/showcase/FocusReveal.svelte.d.ts +11 -0
- package/dist/showcase/Globe.svelte +202 -0
- package/dist/showcase/Globe.svelte.d.ts +16 -0
- package/dist/showcase/KenBurns.svelte +105 -0
- package/dist/showcase/KenBurns.svelte.d.ts +13 -0
- package/dist/showcase/Marquee.svelte +89 -0
- package/dist/showcase/Marquee.svelte.d.ts +9 -0
- package/dist/showcase/ParallaxTilt.svelte +98 -0
- package/dist/showcase/ParallaxTilt.svelte.d.ts +10 -0
- package/dist/showcase/ScrambleText.svelte +98 -0
- package/dist/showcase/ScrambleText.svelte.d.ts +11 -0
- package/dist/showcase/ShineSweep.svelte +81 -0
- package/dist/showcase/ShineSweep.svelte.d.ts +9 -0
- package/dist/showcase/Terminal.svelte +230 -0
- package/dist/showcase/Terminal.svelte.d.ts +18 -0
- package/dist/showcase/TextSplitReveal.svelte +146 -0
- package/dist/showcase/TextSplitReveal.svelte.d.ts +13 -0
- package/dist/showcase/TextWave.svelte +55 -0
- package/dist/showcase/TextWave.svelte.d.ts +8 -0
- package/dist/showcase/TypewriterText.svelte +130 -0
- package/dist/showcase/TypewriterText.svelte.d.ts +9 -0
- package/dist/showcase/backdrop/GrainGradient.svelte +126 -0
- package/dist/showcase/backdrop/GrainGradient.svelte.d.ts +23 -0
- package/dist/showcase/backdrop/MeshGradient.svelte +104 -0
- package/dist/showcase/backdrop/MeshGradient.svelte.d.ts +20 -0
- package/dist/showcase/backdrop/Metaballs.svelte +116 -0
- package/dist/showcase/backdrop/Metaballs.svelte.d.ts +18 -0
- package/dist/showcase/backdrop/NeuroNoise.svelte +115 -0
- package/dist/showcase/backdrop/NeuroNoise.svelte.d.ts +20 -0
- package/dist/showcase/backdrop/ShowcaseBackdrop.svelte +48 -0
- package/dist/showcase/backdrop/ShowcaseBackdrop.svelte.d.ts +12 -0
- package/dist/showcase/generative/GenerativeBackdrop.svelte +234 -0
- package/dist/showcase/generative/GenerativeBackdrop.svelte.d.ts +9 -0
- package/dist/showcase/generative/intent.d.ts +7 -0
- package/dist/showcase/generative/intent.js +67 -0
- package/dist/showcase/generative/manifest.d.ts +9 -0
- package/dist/showcase/generative/manifest.js +97 -0
- package/dist/showcase/generative/types.d.ts +48 -0
- package/dist/showcase/generative/types.js +8 -0
- package/dist/showcase/index.d.ts +36 -0
- package/dist/showcase/index.js +46 -0
- package/dist/showcase/scroll/SmoothScroll.svelte +49 -0
- package/dist/showcase/scroll/SmoothScroll.svelte.d.ts +12 -0
- package/dist/showcase/scroll/scrollProgress.d.ts +24 -0
- package/dist/showcase/scroll/scrollProgress.js +65 -0
- package/dist/showcase/scroll/scrollReveal.d.ts +30 -0
- package/dist/showcase/scroll/scrollReveal.js +70 -0
- package/dist/stores/commandPalette.svelte.d.ts +24 -0
- package/dist/stores/commandPalette.svelte.js +82 -0
- package/dist/stores/toast.svelte.d.ts +28 -0
- package/dist/stores/toast.svelte.js +33 -0
- package/dist/styles/motion.css +46 -0
- package/dist/styles/tokens.css +31 -0
- package/dist/transitions/glide.d.ts +31 -0
- package/dist/transitions/glide.js +58 -0
- package/dist/utils/sound.d.ts +6 -0
- package/dist/utils/sound.js +113 -0
- package/dist/utils/splitText.d.ts +25 -0
- package/dist/utils/splitText.js +94 -0
- package/dist/utils/themeWipe.d.ts +21 -0
- package/dist/utils/themeWipe.js +94 -0
- package/dist/utils/viewTransition.d.ts +23 -0
- package/dist/utils/viewTransition.js +75 -0
- package/package.json +50 -3
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Pattern after Splitting.js (MIT) — https://github.com/shshaw/Splitting
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Wraps text content of `node` into `<span>` elements and stamps CSS custom
|
|
13
|
+
* properties so pure-CSS animations can stagger by index.
|
|
14
|
+
*
|
|
15
|
+
* For `by: 'char'`: sets `--char-index` (0-based) and `--char-total`.
|
|
16
|
+
* For `by: 'word'`: sets `--word-index` (0-based) and `--word-total`.
|
|
17
|
+
* For `by: 'line'`: sets `--line-index` (0-based) and `--line-total`.
|
|
18
|
+
*
|
|
19
|
+
* Accessibility: stamps `aria-label` with the original text on `node` and
|
|
20
|
+
* marks every injected span as `aria-hidden="true"`.
|
|
21
|
+
*
|
|
22
|
+
* Re-splitting a node that has already been split is safe — previous spans
|
|
23
|
+
* are flattened back to text before the new split.
|
|
24
|
+
*/
|
|
25
|
+
export function splitText(node, options) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
var by = options.by;
|
|
28
|
+
// Capture original text and restore any previous split.
|
|
29
|
+
var originalText = (_b = (_a = node.getAttribute('data-split-original')) !== null && _a !== void 0 ? _a : node.textContent) !== null && _b !== void 0 ? _b : '';
|
|
30
|
+
restoreNode(node, originalText);
|
|
31
|
+
// Set accessibility label so the unsplit text is announced.
|
|
32
|
+
node.setAttribute('aria-label', originalText);
|
|
33
|
+
node.setAttribute('data-split-original', originalText);
|
|
34
|
+
node.setAttribute('data-split-by', by);
|
|
35
|
+
var count = 0;
|
|
36
|
+
if (by === 'char') {
|
|
37
|
+
var chars = __spreadArray([], originalText, true); // Unicode-aware
|
|
38
|
+
count = chars.length;
|
|
39
|
+
node.innerHTML = '';
|
|
40
|
+
for (var i = 0; i < chars.length; i++) {
|
|
41
|
+
node.appendChild(makeSpan(chars[i], '--char-index', i, '--char-total', count));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else if (by === 'word') {
|
|
45
|
+
// Split preserving whitespace tokens so spaces render correctly.
|
|
46
|
+
var tokens = originalText.split(/(\s+)/);
|
|
47
|
+
var words = tokens.filter(function (t) { return !/^\s+$/.test(t); });
|
|
48
|
+
count = words.length;
|
|
49
|
+
node.innerHTML = '';
|
|
50
|
+
var wordIdx = 0;
|
|
51
|
+
for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {
|
|
52
|
+
var token = tokens_1[_i];
|
|
53
|
+
if (/^\s+$/.test(token)) {
|
|
54
|
+
var space = document.createElement('span');
|
|
55
|
+
space.setAttribute('aria-hidden', 'true');
|
|
56
|
+
space.style.whiteSpace = 'pre';
|
|
57
|
+
space.textContent = token;
|
|
58
|
+
node.appendChild(space);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
node.appendChild(makeSpan(token, '--word-index', wordIdx++, '--word-total', count));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// 'line' — split by newline characters in the original text.
|
|
67
|
+
var lines = originalText.split('\n');
|
|
68
|
+
count = lines.length;
|
|
69
|
+
node.innerHTML = '';
|
|
70
|
+
for (var i = 0; i < lines.length; i++) {
|
|
71
|
+
if (i > 0)
|
|
72
|
+
node.appendChild(document.createTextNode('\n'));
|
|
73
|
+
node.appendChild(makeSpan(lines[i], '--line-index', i, '--line-total', count));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
count: count,
|
|
78
|
+
cleanup: function () { return restoreNode(node, originalText); }
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function makeSpan(text, indexVar, index, totalVar, total) {
|
|
82
|
+
var span = document.createElement('span');
|
|
83
|
+
span.setAttribute('aria-hidden', 'true');
|
|
84
|
+
span.style.setProperty(indexVar, String(index));
|
|
85
|
+
span.style.setProperty(totalVar, String(total));
|
|
86
|
+
span.textContent = text;
|
|
87
|
+
return span;
|
|
88
|
+
}
|
|
89
|
+
function restoreNode(node, originalText) {
|
|
90
|
+
node.textContent = originalText;
|
|
91
|
+
node.removeAttribute('aria-label');
|
|
92
|
+
node.removeAttribute('data-split-original');
|
|
93
|
+
node.removeAttribute('data-split-by');
|
|
94
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* themeWipe — circular View Transition reveal from a click origin.
|
|
3
|
+
*
|
|
4
|
+
* Wraps document.startViewTransition, computes a covering radius from the
|
|
5
|
+
* click point, and animates ::view-transition-new(root) with a clip-path
|
|
6
|
+
* circle via WAAPI (~500ms, var(--motion-glide)).
|
|
7
|
+
*
|
|
8
|
+
* Falls back gracefully: if startViewTransition is unsupported or
|
|
9
|
+
* prefers-reduced-motion is set, applyTheme() runs synchronously with no
|
|
10
|
+
* animation.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @param event - The click (or pointer) event that triggered the theme toggle.
|
|
14
|
+
* Used to anchor the reveal circle. Pass null to default to
|
|
15
|
+
* screen center.
|
|
16
|
+
* @param applyTheme - Callback that performs the actual theme mutation
|
|
17
|
+
* (e.g. set data-theme, update localStorage). Called
|
|
18
|
+
* inside the startViewTransition callback so the snapshot
|
|
19
|
+
* captures the old state and the new DOM is recorded after.
|
|
20
|
+
*/
|
|
21
|
+
export declare function themeWipe(event: MouseEvent | PointerEvent | null, applyTheme: () => void): Promise<void>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* themeWipe — circular View Transition reveal from a click origin.
|
|
3
|
+
*
|
|
4
|
+
* Wraps document.startViewTransition, computes a covering radius from the
|
|
5
|
+
* click point, and animates ::view-transition-new(root) with a clip-path
|
|
6
|
+
* circle via WAAPI (~500ms, var(--motion-glide)).
|
|
7
|
+
*
|
|
8
|
+
* Falls back gracefully: if startViewTransition is unsupported or
|
|
9
|
+
* prefers-reduced-motion is set, applyTheme() runs synchronously with no
|
|
10
|
+
* animation.
|
|
11
|
+
*/
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var DURATION = 500;
|
|
49
|
+
var EASING = 'cubic-bezier(0.16, 1, 0.3, 1)'; // --motion-glide fallback
|
|
50
|
+
/**
|
|
51
|
+
* @param event - The click (or pointer) event that triggered the theme toggle.
|
|
52
|
+
* Used to anchor the reveal circle. Pass null to default to
|
|
53
|
+
* screen center.
|
|
54
|
+
* @param applyTheme - Callback that performs the actual theme mutation
|
|
55
|
+
* (e.g. set data-theme, update localStorage). Called
|
|
56
|
+
* inside the startViewTransition callback so the snapshot
|
|
57
|
+
* captures the old state and the new DOM is recorded after.
|
|
58
|
+
*/
|
|
59
|
+
export function themeWipe(event, applyTheme) {
|
|
60
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
61
|
+
var prefersReduced, x, y, endRadius, transition, resolvedEasing;
|
|
62
|
+
return __generator(this, function (_a) {
|
|
63
|
+
switch (_a.label) {
|
|
64
|
+
case 0:
|
|
65
|
+
prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
66
|
+
if (prefersReduced || !document.startViewTransition) {
|
|
67
|
+
applyTheme();
|
|
68
|
+
return [2 /*return*/];
|
|
69
|
+
}
|
|
70
|
+
x = event ? event.clientX : window.innerWidth / 2;
|
|
71
|
+
y = event ? event.clientY : window.innerHeight / 2;
|
|
72
|
+
endRadius = Math.hypot(Math.max(x, window.innerWidth - x), Math.max(y, window.innerHeight - y));
|
|
73
|
+
transition = document.startViewTransition(applyTheme);
|
|
74
|
+
// Wait until both snapshots are captured before animating
|
|
75
|
+
return [4 /*yield*/, transition.ready];
|
|
76
|
+
case 1:
|
|
77
|
+
// Wait until both snapshots are captured before animating
|
|
78
|
+
_a.sent();
|
|
79
|
+
resolvedEasing = getComputedStyle(document.documentElement)
|
|
80
|
+
.getPropertyValue('--motion-glide')
|
|
81
|
+
.trim() || EASING;
|
|
82
|
+
document.documentElement.animate([
|
|
83
|
+
{ clipPath: "circle(0px at ".concat(x, "px ").concat(y, "px)") },
|
|
84
|
+
{ clipPath: "circle(".concat(endRadius, "px at ").concat(x, "px ").concat(y, "px)") }
|
|
85
|
+
], {
|
|
86
|
+
duration: DURATION,
|
|
87
|
+
easing: resolvedEasing,
|
|
88
|
+
pseudoElement: '::view-transition-new(root)'
|
|
89
|
+
});
|
|
90
|
+
return [2 /*return*/];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* viewTransition — SvelteKit onNavigate helper.
|
|
3
|
+
*
|
|
4
|
+
* Drop this into +layout.svelte to wrap each client-side navigation with
|
|
5
|
+
* document.startViewTransition, giving the browser a chance to animate
|
|
6
|
+
* between pages using the View Transitions API.
|
|
7
|
+
*
|
|
8
|
+
* Usage in +layout.svelte:
|
|
9
|
+
* <script>
|
|
10
|
+
* import { onNavigate } from '$app/navigation';
|
|
11
|
+
* import { viewTransition } from '../../../dist';
|
|
12
|
+
* viewTransition(onNavigate);
|
|
13
|
+
* </script>
|
|
14
|
+
*
|
|
15
|
+
* Falls back silently: if startViewTransition is unsupported, the navigation
|
|
16
|
+
* proceeds normally. prefers-reduced-motion is honoured automatically by the
|
|
17
|
+
* browser's View Transitions implementation; no extra guard is needed here.
|
|
18
|
+
*/
|
|
19
|
+
type OnNavigateCallback = (callback: (navigation: {
|
|
20
|
+
complete: Promise<void>;
|
|
21
|
+
}) => void | (() => void) | Promise<void | (() => void)>) => void;
|
|
22
|
+
export declare function viewTransition(onNavigate: OnNavigateCallback): void;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* viewTransition — SvelteKit onNavigate helper.
|
|
3
|
+
*
|
|
4
|
+
* Drop this into +layout.svelte to wrap each client-side navigation with
|
|
5
|
+
* document.startViewTransition, giving the browser a chance to animate
|
|
6
|
+
* between pages using the View Transitions API.
|
|
7
|
+
*
|
|
8
|
+
* Usage in +layout.svelte:
|
|
9
|
+
* <script>
|
|
10
|
+
* import { onNavigate } from '$app/navigation';
|
|
11
|
+
* import { viewTransition } from '../../../dist';
|
|
12
|
+
* viewTransition(onNavigate);
|
|
13
|
+
* </script>
|
|
14
|
+
*
|
|
15
|
+
* Falls back silently: if startViewTransition is unsupported, the navigation
|
|
16
|
+
* proceeds normally. prefers-reduced-motion is honoured automatically by the
|
|
17
|
+
* browser's View Transitions implementation; no extra guard is needed here.
|
|
18
|
+
*/
|
|
19
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
24
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
25
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
29
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
30
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
31
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
32
|
+
function step(op) {
|
|
33
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
34
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
35
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
36
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
37
|
+
switch (op[0]) {
|
|
38
|
+
case 0: case 1: t = op; break;
|
|
39
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
40
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
41
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
42
|
+
default:
|
|
43
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
44
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
45
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
46
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
47
|
+
if (t[2]) _.ops.pop();
|
|
48
|
+
_.trys.pop(); continue;
|
|
49
|
+
}
|
|
50
|
+
op = body.call(thisArg, _);
|
|
51
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
52
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
export function viewTransition(onNavigate) {
|
|
56
|
+
var _this = this;
|
|
57
|
+
onNavigate(function (navigation) {
|
|
58
|
+
if (!document.startViewTransition)
|
|
59
|
+
return;
|
|
60
|
+
return new Promise(function (resolve) {
|
|
61
|
+
document.startViewTransition(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
62
|
+
return __generator(this, function (_a) {
|
|
63
|
+
switch (_a.label) {
|
|
64
|
+
case 0:
|
|
65
|
+
resolve();
|
|
66
|
+
return [4 /*yield*/, navigation.complete];
|
|
67
|
+
case 1:
|
|
68
|
+
_a.sent();
|
|
69
|
+
return [2 /*return*/];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}); });
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joewinke/jatui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared Svelte 5 component library for JAT projects",
|
|
6
6
|
"type": "module",
|
|
@@ -17,7 +17,14 @@
|
|
|
17
17
|
"svelte": "./dist/dnd/index.js",
|
|
18
18
|
"default": "./dist/dnd/index.js"
|
|
19
19
|
},
|
|
20
|
-
"./styles/rail.css": "./dist/styles/rail.css"
|
|
20
|
+
"./styles/rail.css": "./dist/styles/rail.css",
|
|
21
|
+
"./showcase": {
|
|
22
|
+
"types": "./dist/showcase/index.d.ts",
|
|
23
|
+
"svelte": "./dist/showcase/index.js",
|
|
24
|
+
"default": "./dist/showcase/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./styles/motion.css": "./dist/styles/motion.css",
|
|
27
|
+
"./styles/tokens.css": "./dist/styles/tokens.css"
|
|
21
28
|
},
|
|
22
29
|
"files": [
|
|
23
30
|
"dist",
|
|
@@ -43,7 +50,15 @@
|
|
|
43
50
|
"d3": "^7.0.0",
|
|
44
51
|
"daisyui": "^5.0.0",
|
|
45
52
|
"svelte": "^5.0.0",
|
|
46
|
-
"tailwindcss": "^4.0.0"
|
|
53
|
+
"tailwindcss": "^4.0.0",
|
|
54
|
+
"@tanstack/table-core": "^8.0.0",
|
|
55
|
+
"@floating-ui/dom": "^1.0.0",
|
|
56
|
+
"@xyflow/svelte": "^1.0.0",
|
|
57
|
+
"cobe": "^2.0.0",
|
|
58
|
+
"@paper-design/shaders": ">=0.0.50",
|
|
59
|
+
"motion": "^12.0.0",
|
|
60
|
+
"lenis": "^1.0.0",
|
|
61
|
+
"embla-carousel-svelte": "^8.0.0"
|
|
47
62
|
},
|
|
48
63
|
"peerDependenciesMeta": {
|
|
49
64
|
"@atlaskit/pragmatic-drag-and-drop": {
|
|
@@ -66,6 +81,30 @@
|
|
|
66
81
|
},
|
|
67
82
|
"tailwindcss": {
|
|
68
83
|
"optional": false
|
|
84
|
+
},
|
|
85
|
+
"@tanstack/table-core": {
|
|
86
|
+
"optional": true
|
|
87
|
+
},
|
|
88
|
+
"@floating-ui/dom": {
|
|
89
|
+
"optional": true
|
|
90
|
+
},
|
|
91
|
+
"@xyflow/svelte": {
|
|
92
|
+
"optional": true
|
|
93
|
+
},
|
|
94
|
+
"cobe": {
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"@paper-design/shaders": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"motion": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"lenis": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"embla-carousel-svelte": {
|
|
107
|
+
"optional": true
|
|
69
108
|
}
|
|
70
109
|
},
|
|
71
110
|
"devDependencies": {
|
|
@@ -73,15 +112,23 @@
|
|
|
73
112
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "~3.0.0",
|
|
74
113
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "~2.0.0",
|
|
75
114
|
"@atlaskit/pragmatic-drag-and-drop-live-region": "~2.0.0",
|
|
115
|
+
"@floating-ui/dom": "^1.8.0",
|
|
116
|
+
"@paper-design/shaders": "^0.0.77",
|
|
76
117
|
"@sveltejs/adapter-auto": "^6.0.0",
|
|
77
118
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
78
119
|
"@sveltejs/kit": "^2.21.0",
|
|
79
120
|
"@sveltejs/package": "^2.5.8",
|
|
80
121
|
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
|
81
122
|
"@tailwindcss/vite": "^4.0.0",
|
|
123
|
+
"@tanstack/table-core": "^8.21.3",
|
|
82
124
|
"@types/d3": "^7.4.3",
|
|
125
|
+
"@xyflow/svelte": "^1.6.2",
|
|
126
|
+
"cobe": "^2.0.1",
|
|
83
127
|
"d3": "^7.9.0",
|
|
84
128
|
"daisyui": "^5.0.0",
|
|
129
|
+
"embla-carousel-svelte": "^8.6.0",
|
|
130
|
+
"lenis": "^1.3.25",
|
|
131
|
+
"motion": "^12.42.2",
|
|
85
132
|
"svelte": "^5.0.0",
|
|
86
133
|
"tailwindcss": "^4.0.0",
|
|
87
134
|
"typescript": "^5.0.0",
|