@astra-kit/ui 0.0.0-stage → 0.0.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/CHANGELOG.md +15 -0
- package/LICENSE.md +21 -0
- package/README.md +384 -2
- package/THIRD_PARTY_NOTICES.md +31 -0
- package/assets/fonts/geist-LICENSE.txt +93 -0
- package/assets/fonts/geist-latin-variable.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-400.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-500.woff2 +0 -0
- package/assets/fonts/ibmplexmono-LICENSE.txt +93 -0
- package/assets/fonts/inter-LICENSE.txt +93 -0
- package/assets/fonts/inter-latin-variable.woff2 +0 -0
- package/dist/adapters/unpic-image.d.ts +3 -0
- package/dist/adapters/unpic-image.js +98 -0
- package/dist/components/account-menu.d.ts +67 -0
- package/dist/components/account-menu.js +440 -0
- package/dist/components/action-button.d.ts +25 -0
- package/dist/components/action-button.js +264 -0
- package/dist/components/alert.d.ts +31 -0
- package/dist/components/alert.js +503 -0
- package/dist/components/animated-collapse.d.ts +19 -0
- package/dist/components/animated-collapse.js +170 -0
- package/dist/components/animated-count.d.ts +13 -0
- package/dist/components/animated-count.js +105 -0
- package/dist/components/animated-list-item.d.ts +25 -0
- package/dist/components/animated-list-item.js +134 -0
- package/dist/components/animated-theme-toggler.d.ts +12 -0
- package/dist/components/animated-theme-toggler.js +200 -0
- package/dist/components/avatar.d.ts +65 -0
- package/dist/components/avatar.js +463 -0
- package/dist/components/badge.d.ts +21 -0
- package/dist/components/badge.js +297 -0
- package/dist/components/button-interaction.d.ts +23 -0
- package/dist/components/button-interaction.js +22 -0
- package/dist/components/button-label.d.ts +8 -0
- package/dist/components/button-label.js +203 -0
- package/dist/components/button.d.ts +23 -0
- package/dist/components/button.js +145 -0
- package/dist/components/calendar.d.ts +47 -0
- package/dist/components/calendar.js +155 -0
- package/dist/components/card.d.ts +38 -0
- package/dist/components/card.js +904 -0
- package/dist/components/carousel.d.ts +71 -0
- package/dist/components/carousel.js +585 -0
- package/dist/components/checkbox.d.ts +15 -0
- package/dist/components/checkbox.js +324 -0
- package/dist/components/control-button.d.ts +16 -0
- package/dist/components/control-button.js +215 -0
- package/dist/components/data-table.d.ts +118 -0
- package/dist/components/data-table.js +895 -0
- package/dist/components/dialog-surface.d.ts +49 -0
- package/dist/components/dialog-surface.js +220 -0
- package/dist/components/dialog.d.ts +92 -0
- package/dist/components/dialog.js +320 -0
- package/dist/components/dropdown-menu.d.ts +57 -0
- package/dist/components/dropdown-menu.js +107 -0
- package/dist/components/field.d.ts +53 -0
- package/dist/components/field.js +710 -0
- package/dist/components/file-upload.d.ts +88 -0
- package/dist/components/file-upload.js +776 -0
- package/dist/components/filter-presets-bar.d.ts +73 -0
- package/dist/components/filter-presets-bar.js +510 -0
- package/dist/components/filter-query-bar.d.ts +21 -0
- package/dist/components/filter-query-bar.js +881 -0
- package/dist/components/filter-query-grammar.d.ts +188 -0
- package/dist/components/filter-query-grammar.js +875 -0
- package/dist/components/form.d.ts +29 -0
- package/dist/components/form.js +330 -0
- package/dist/components/highlighter.d.ts +15 -0
- package/dist/components/highlighter.js +152 -0
- package/dist/components/hover-card.d.ts +50 -0
- package/dist/components/hover-card.js +80 -0
- package/dist/components/input-group.d.ts +16 -0
- package/dist/components/input-group.js +277 -0
- package/dist/components/input.d.ts +17 -0
- package/dist/components/input.js +120 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.js +43 -0
- package/dist/components/link.d.ts +9 -0
- package/dist/components/link.js +43 -0
- package/dist/components/morph-text.d.ts +14 -0
- package/dist/components/morph-text.js +210 -0
- package/dist/components/pagination.d.ts +59 -0
- package/dist/components/pagination.js +190 -0
- package/dist/components/popover.d.ts +17 -0
- package/dist/components/popover.js +40 -0
- package/dist/components/presence-swap.d.ts +22 -0
- package/dist/components/presence-swap.js +209 -0
- package/dist/components/primitives/alert-dialog.d.ts +68 -0
- package/dist/components/primitives/alert-dialog.js +629 -0
- package/dist/components/primitives/avatar.d.ts +46 -0
- package/dist/components/primitives/avatar.js +265 -0
- package/dist/components/primitives/calendar.d.ts +37 -0
- package/dist/components/primitives/calendar.js +1250 -0
- package/dist/components/primitives/carousel.d.ts +106 -0
- package/dist/components/primitives/carousel.js +928 -0
- package/dist/components/primitives/dialog.d.ts +62 -0
- package/dist/components/primitives/dialog.js +490 -0
- package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
- package/dist/components/primitives/dropdown-menu-items.js +265 -0
- package/dist/components/primitives/dropdown-menu.d.ts +64 -0
- package/dist/components/primitives/dropdown-menu.js +560 -0
- package/dist/components/primitives/hover-card.d.ts +50 -0
- package/dist/components/primitives/hover-card.js +507 -0
- package/dist/components/primitives/pagination.d.ts +65 -0
- package/dist/components/primitives/pagination.js +373 -0
- package/dist/components/primitives/popover.d.ts +22 -0
- package/dist/components/primitives/popover.js +213 -0
- package/dist/components/primitives/select.d.ts +37 -0
- package/dist/components/primitives/select.js +428 -0
- package/dist/components/primitives/tooltip.d.ts +30 -0
- package/dist/components/primitives/tooltip.js +277 -0
- package/dist/components/progress-ring.d.ts +20 -0
- package/dist/components/progress-ring.js +53 -0
- package/dist/components/radio-group.d.ts +34 -0
- package/dist/components/radio-group.js +392 -0
- package/dist/components/reaction-button.d.ts +30 -0
- package/dist/components/reaction-button.js +189 -0
- package/dist/components/rich-link-editor.d.ts +25 -0
- package/dist/components/rich-link-editor.js +320 -0
- package/dist/components/rich-markdown-content.d.ts +10 -0
- package/dist/components/rich-markdown-content.js +56 -0
- package/dist/components/rich-text-content.d.ts +19 -0
- package/dist/components/rich-text-content.js +26 -0
- package/dist/components/select.d.ts +55 -0
- package/dist/components/select.js +188 -0
- package/dist/components/separator.d.ts +3 -0
- package/dist/components/separator.js +48 -0
- package/dist/components/sheet.d.ts +19 -0
- package/dist/components/sheet.js +420 -0
- package/dist/components/sidebar-panel-context.d.ts +17 -0
- package/dist/components/sidebar-panel-context.js +14 -0
- package/dist/components/sidebar.d.ts +195 -0
- package/dist/components/sidebar.js +2041 -0
- package/dist/components/skeleton.d.ts +23 -0
- package/dist/components/skeleton.js +334 -0
- package/dist/components/split-button.d.ts +36 -0
- package/dist/components/split-button.js +306 -0
- package/dist/components/svgs/whatsappIcon.d.ts +3 -0
- package/dist/components/svgs/whatsappIcon.js +14 -0
- package/dist/components/switch.d.ts +13 -0
- package/dist/components/switch.js +444 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.js +298 -0
- package/dist/components/tabs.d.ts +36 -0
- package/dist/components/tabs.js +636 -0
- package/dist/components/textarea.d.ts +16 -0
- package/dist/components/textarea.js +111 -0
- package/dist/components/themed-toaster.d.ts +7 -0
- package/dist/components/themed-toaster.js +86 -0
- package/dist/components/toaster.d.ts +12 -0
- package/dist/components/toaster.js +62 -0
- package/dist/components/tooltip.d.ts +43 -0
- package/dist/components/tooltip.js +65 -0
- package/dist/components/typing-animation.d.ts +34 -0
- package/dist/components/typing-animation.js +389 -0
- package/dist/constants/action-button.d.ts +20 -0
- package/dist/constants/action-button.js +17 -0
- package/dist/constants/alert.d.ts +16 -0
- package/dist/constants/alert.js +13 -0
- package/dist/constants/avatar.d.ts +38 -0
- package/dist/constants/avatar.js +32 -0
- package/dist/constants/badge.d.ts +6 -0
- package/dist/constants/badge.js +6 -0
- package/dist/constants/button.d.ts +16 -0
- package/dist/constants/button.js +16 -0
- package/dist/constants/calendar.d.ts +36 -0
- package/dist/constants/calendar.js +34 -0
- package/dist/constants/card.d.ts +23 -0
- package/dist/constants/card.js +20 -0
- package/dist/constants/carousel.d.ts +55 -0
- package/dist/constants/carousel.js +74 -0
- package/dist/constants/checkbox.d.ts +17 -0
- package/dist/constants/checkbox.js +17 -0
- package/dist/constants/dialog.d.ts +11 -0
- package/dist/constants/dialog.js +10 -0
- package/dist/constants/dropdown-menu.d.ts +10 -0
- package/dist/constants/dropdown-menu.js +37 -0
- package/dist/constants/field.d.ts +24 -0
- package/dist/constants/field.js +24 -0
- package/dist/constants/hover-card.d.ts +37 -0
- package/dist/constants/hover-card.js +85 -0
- package/dist/constants/morph-text.d.ts +13 -0
- package/dist/constants/morph-text.js +13 -0
- package/dist/constants/motion.d.ts +12 -0
- package/dist/constants/motion.js +12 -0
- package/dist/constants/pagination.d.ts +20 -0
- package/dist/constants/pagination.js +20 -0
- package/dist/constants/popover.d.ts +7 -0
- package/dist/constants/popover.js +33 -0
- package/dist/constants/radio-group.d.ts +10 -0
- package/dist/constants/radio-group.js +10 -0
- package/dist/constants/select.d.ts +7 -0
- package/dist/constants/select.js +34 -0
- package/dist/constants/sidebar.d.ts +9 -0
- package/dist/constants/sidebar.js +17 -0
- package/dist/constants/skeleton.d.ts +17 -0
- package/dist/constants/skeleton.js +17 -0
- package/dist/constants/split-button.d.ts +7 -0
- package/dist/constants/split-button.js +5 -0
- package/dist/constants/switch.d.ts +33 -0
- package/dist/constants/switch.js +41 -0
- package/dist/constants/tabs.d.ts +17 -0
- package/dist/constants/tabs.js +17 -0
- package/dist/constants/toast.d.ts +3 -0
- package/dist/constants/toast.js +3 -0
- package/dist/constants/tooltip.d.ts +13 -0
- package/dist/constants/tooltip.js +52 -0
- package/dist/hooks/use-horizontal-swipe.d.ts +23 -0
- package/dist/hooks/use-horizontal-swipe.js +80 -0
- package/dist/hooks/use-is-hydrated.d.ts +6 -0
- package/dist/hooks/use-is-hydrated.js +20 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +19 -0
- package/dist/hooks/use-prefers-reduced-motion.d.ts +2 -0
- package/dist/hooks/use-prefers-reduced-motion.js +27 -0
- package/dist/hooks/use-rich-link-editor.d.ts +55 -0
- package/dist/hooks/use-rich-link-editor.js +515 -0
- package/dist/hooks/use-sidebar-persistence.d.ts +6 -0
- package/dist/hooks/use-sidebar-persistence.js +52 -0
- package/dist/hooks/use-today.d.ts +7 -0
- package/dist/hooks/use-today.js +50 -0
- package/dist/hooks/use-viewer-time-zone.d.ts +6 -0
- package/dist/hooks/use-viewer-time-zone.js +20 -0
- package/dist/hooks.d.ts +11 -0
- package/dist/hooks.js +11 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.js +69 -0
- package/dist/lib/browser-clipboard.d.ts +13 -0
- package/dist/lib/browser-clipboard.js +48 -0
- package/dist/lib/column-filter-value.d.ts +12 -0
- package/dist/lib/column-filter-value.js +52 -0
- package/dist/lib/file-acceptance.d.ts +43 -0
- package/dist/lib/file-acceptance.js +107 -0
- package/dist/lib/format-file-size.d.ts +16 -0
- package/dist/lib/format-file-size.js +34 -0
- package/dist/lib/fuzzy-search.d.ts +17 -0
- package/dist/lib/fuzzy-search.js +183 -0
- package/dist/lib/horizontal-swipe.d.ts +23 -0
- package/dist/lib/horizontal-swipe.js +29 -0
- package/dist/lib/image-dimensions.d.ts +2 -0
- package/dist/lib/image-dimensions.js +7 -0
- package/dist/lib/name-initials.d.ts +7 -0
- package/dist/lib/name-initials.js +11 -0
- package/dist/lib/rich-text/link-markdown-constants.d.ts +147 -0
- package/dist/lib/rich-text/link-markdown-constants.js +458 -0
- package/dist/lib/rich-text/link-markdown-types.d.ts +53 -0
- package/dist/lib/rich-text/link-markdown-types.js +1 -0
- package/dist/lib/rich-text/link-markdown.d.ts +193 -0
- package/dist/lib/rich-text/link-markdown.js +592 -0
- package/dist/lib/rich-text/rich-markdown.d.ts +41 -0
- package/dist/lib/rich-text/rich-markdown.js +105 -0
- package/dist/lib/rich-text/rich-text-editor-dom.d.ts +26 -0
- package/dist/lib/rich-text/rich-text-editor-dom.js +79 -0
- package/dist/lib/toast-layer.d.ts +24 -0
- package/dist/lib/toast-layer.js +76 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +2 -0
- package/dist/lib/year-month-filter.d.ts +16 -0
- package/dist/lib/year-month-filter.js +46 -0
- package/dist/motion/arc-floating-slot.d.ts +40 -0
- package/dist/motion/arc-floating-slot.js +177 -0
- package/dist/motion/arc-press.d.ts +6 -0
- package/dist/motion/arc-press.js +59 -0
- package/dist/motion/arc-swap.d.ts +22 -0
- package/dist/motion/arc-swap.js +49 -0
- package/dist/motion/arc-tokens.d.ts +53 -0
- package/dist/motion/arc-tokens.js +73 -0
- package/dist/motion/glide-indicator.d.ts +69 -0
- package/dist/motion/glide-indicator.js +309 -0
- package/dist/motion/glide-slot.d.ts +9 -0
- package/dist/motion/glide-slot.js +71 -0
- package/dist/motion/motion-slot.d.ts +12 -0
- package/dist/motion/motion-slot.js +376 -0
- package/dist/motion/overlay-warmth.d.ts +24 -0
- package/dist/motion/overlay-warmth.js +70 -0
- package/dist/motion/presence.d.ts +40 -0
- package/dist/motion/presence.js +101 -0
- package/dist/motion/surface-keyframes.d.ts +24 -0
- package/dist/motion/surface-keyframes.js +141 -0
- package/dist/motion/tokens.d.ts +81 -0
- package/dist/motion/tokens.js +67 -0
- package/dist/motion/use-attached-element.d.ts +7 -0
- package/dist/motion/use-attached-element.js +22 -0
- package/dist/motion/use-morph-width.d.ts +13 -0
- package/dist/motion/use-morph-width.js +59 -0
- package/dist/next.d.ts +14 -0
- package/dist/next.js +79 -0
- package/dist/providers/astra-ui-provider.d.ts +27 -0
- package/dist/providers/astra-ui-provider.js +100 -0
- package/dist/providers/native-provider.d.ts +4 -0
- package/dist/providers/native-provider.js +45 -0
- package/dist/sonner.d.ts +7 -0
- package/dist/sonner.js +8 -0
- package/dist/styles.css +2 -0
- package/dist/tanstack.d.ts +11 -0
- package/dist/tanstack.js +50 -0
- package/dist/theme.d.ts +3 -0
- package/dist/theme.js +1 -0
- package/dist/types/data-table.d.ts +27 -0
- package/dist/types/data-table.js +1 -0
- package/fonts.css +5 -0
- package/package.json +450 -4
- package/styles.css +4 -0
- package/theme.css +248 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Letter-by-letter label morph adapted from Arc (https://uiarc.dev), Copyright (c) 2026 Elia Kuratli, MIT License.
|
|
5
|
+
* The full license text ships in THIRD_PARTY_NOTICES.md. Internal: shared by `ActionButton` and `SplitButton`.
|
|
6
|
+
*/
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
9
|
+
import { MORPH_TEXT_GLYPH_OFFSET_PX, MORPH_TEXT_MAX_GLYPH_DELAY_S, MORPH_TEXT_MIN_SHARED_RUN } from "../constants/morph-text.js";
|
|
10
|
+
import { ARC_BLUR, ARC_DURATION, ARC_EASE, ARC_SPRING_MORPH, ARC_STAGGER } from "../motion/arc-tokens.js";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
const restState = {
|
|
13
|
+
opacity: 1,
|
|
14
|
+
y: 0,
|
|
15
|
+
filter: "blur(0px)"
|
|
16
|
+
};
|
|
17
|
+
/** Letters rise in from a soft blur and lift away a little faster. */
|
|
18
|
+
const glyphEnter = {
|
|
19
|
+
opacity: 0,
|
|
20
|
+
y: MORPH_TEXT_GLYPH_OFFSET_PX.enter,
|
|
21
|
+
filter: `blur(${ARC_BLUR.soft}px)`
|
|
22
|
+
};
|
|
23
|
+
const glyphExit = {
|
|
24
|
+
opacity: 0,
|
|
25
|
+
y: MORPH_TEXT_GLYPH_OFFSET_PX.exit,
|
|
26
|
+
filter: `blur(${ARC_BLUR.subtle}px)`,
|
|
27
|
+
transition: {
|
|
28
|
+
duration: ARC_DURATION.fast,
|
|
29
|
+
ease: [...ARC_EASE.standard]
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const reducedTransition = { duration: ARC_DURATION.instant };
|
|
33
|
+
const reducedEnter = {
|
|
34
|
+
...restState,
|
|
35
|
+
opacity: 0
|
|
36
|
+
};
|
|
37
|
+
const reducedExit = {
|
|
38
|
+
opacity: 0,
|
|
39
|
+
transition: reducedTransition
|
|
40
|
+
};
|
|
41
|
+
/** Grapheme segmenter created once; absent on runtimes without `Intl.Segmenter`. */
|
|
42
|
+
const graphemeSegmenter = typeof Intl.Segmenter === "function" ? new Intl.Segmenter(undefined, { granularity: "grapheme" }) : undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Splits text into user-perceived characters, so emoji sequences, flags and combining accents stay in one glyph.
|
|
45
|
+
* Falls back to code points when `Intl.Segmenter` is unavailable.
|
|
46
|
+
* @param text - Text to split.
|
|
47
|
+
* @returns Graphemes in reading order.
|
|
48
|
+
*/
|
|
49
|
+
function splitGraphemes(text) {
|
|
50
|
+
if (!graphemeSegmenter) return [...text];
|
|
51
|
+
return Array.from(graphemeSegmenter.segment(text), (segment) => segment.segment);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Turns characters into glyphs of one generation.
|
|
55
|
+
* @param characters - Characters to wrap.
|
|
56
|
+
* @param generation - Label generation, part of every glyph id.
|
|
57
|
+
* @returns Glyphs in reading order.
|
|
58
|
+
*/
|
|
59
|
+
function toGlyphs(characters, generation) {
|
|
60
|
+
return characters.map((character, order) => ({
|
|
61
|
+
id: `${generation}:${order}`,
|
|
62
|
+
character,
|
|
63
|
+
order
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Splits a label into glyphs, keeping the identity of the shared leading and trailing characters of the previous
|
|
68
|
+
* label, so `Copy page` → `Copied` only replaces the changed letters.
|
|
69
|
+
* @param text - Current label.
|
|
70
|
+
* @returns Glyphs of the label.
|
|
71
|
+
*/
|
|
72
|
+
function useGlyphs(text) {
|
|
73
|
+
const $ = _c(10);
|
|
74
|
+
let t0;
|
|
75
|
+
if ($[0] !== text) {
|
|
76
|
+
t0 = () => ({
|
|
77
|
+
text,
|
|
78
|
+
generation: 0,
|
|
79
|
+
glyphs: toGlyphs(splitGraphemes(text), 0)
|
|
80
|
+
});
|
|
81
|
+
$[0] = text;
|
|
82
|
+
$[1] = t0;
|
|
83
|
+
} else {
|
|
84
|
+
t0 = $[1];
|
|
85
|
+
}
|
|
86
|
+
const [glyphState, setGlyphState] = useState(t0);
|
|
87
|
+
if (glyphState.text === text) {
|
|
88
|
+
return glyphState.glyphs;
|
|
89
|
+
}
|
|
90
|
+
let t1;
|
|
91
|
+
if ($[2] !== glyphState.text) {
|
|
92
|
+
t1 = splitGraphemes(glyphState.text);
|
|
93
|
+
$[2] = glyphState.text;
|
|
94
|
+
$[3] = t1;
|
|
95
|
+
} else {
|
|
96
|
+
t1 = $[3];
|
|
97
|
+
}
|
|
98
|
+
const previous = t1;
|
|
99
|
+
let generation;
|
|
100
|
+
let t2;
|
|
101
|
+
if ($[4] !== glyphState.generation || $[5] !== glyphState.glyphs || $[6] !== previous || $[7] !== text) {
|
|
102
|
+
const next = splitGraphemes(text);
|
|
103
|
+
let sharedStart = 0;
|
|
104
|
+
let sharedEnd = 0;
|
|
105
|
+
while (sharedStart < previous.length && sharedStart < next.length && previous[sharedStart] === next[sharedStart]) {
|
|
106
|
+
sharedStart++;
|
|
107
|
+
}
|
|
108
|
+
while (sharedEnd < previous.length - sharedStart && sharedEnd < next.length - sharedStart && previous[previous.length - 1 - sharedEnd] === next[next.length - 1 - sharedEnd]) {
|
|
109
|
+
sharedEnd++;
|
|
110
|
+
}
|
|
111
|
+
if (sharedStart < MORPH_TEXT_MIN_SHARED_RUN) {
|
|
112
|
+
sharedStart = 0;
|
|
113
|
+
}
|
|
114
|
+
if (sharedEnd < MORPH_TEXT_MIN_SHARED_RUN) {
|
|
115
|
+
sharedEnd = 0;
|
|
116
|
+
}
|
|
117
|
+
generation = glyphState.generation + 1;
|
|
118
|
+
t2 = [
|
|
119
|
+
...glyphState.glyphs.slice(0, sharedStart),
|
|
120
|
+
...toGlyphs(next.slice(sharedStart, next.length - sharedEnd), generation),
|
|
121
|
+
...glyphState.glyphs.slice(glyphState.glyphs.length - sharedEnd)
|
|
122
|
+
];
|
|
123
|
+
$[4] = glyphState.generation;
|
|
124
|
+
$[5] = glyphState.glyphs;
|
|
125
|
+
$[6] = previous;
|
|
126
|
+
$[7] = text;
|
|
127
|
+
$[8] = generation;
|
|
128
|
+
$[9] = t2;
|
|
129
|
+
} else {
|
|
130
|
+
generation = $[8];
|
|
131
|
+
t2 = $[9];
|
|
132
|
+
}
|
|
133
|
+
const glyphs = t2;
|
|
134
|
+
setGlyphState({
|
|
135
|
+
text,
|
|
136
|
+
generation,
|
|
137
|
+
glyphs
|
|
138
|
+
});
|
|
139
|
+
return glyphs;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Morphs one label into the next: kept letters glide into place and new ones rise in from a soft blur. The row
|
|
143
|
+
* keeps its natural width; callers spring the slot around it.
|
|
144
|
+
* @param props - Label text, whether the user prefers reduced motion and an optional ref to the row.
|
|
145
|
+
* @returns The row of animated letters. Callers hide it from assistive tech and name their control otherwise.
|
|
146
|
+
*/
|
|
147
|
+
export function MorphText(t0) {
|
|
148
|
+
const $ = _c(12);
|
|
149
|
+
const { text, reduceMotion, ref } = t0;
|
|
150
|
+
const glyphs = useGlyphs(text);
|
|
151
|
+
let t1;
|
|
152
|
+
if ($[0] !== glyphs || $[1] !== reduceMotion || $[2] !== text) {
|
|
153
|
+
let t2;
|
|
154
|
+
if ($[4] !== reduceMotion || $[5] !== text) {
|
|
155
|
+
t2 = (glyph) => /* @__PURE__ */ _jsx(motion.span, {
|
|
156
|
+
className: "inline-block",
|
|
157
|
+
layout: reduceMotion ? false : "position",
|
|
158
|
+
layoutDependency: text,
|
|
159
|
+
initial: reduceMotion ? reducedEnter : glyphEnter,
|
|
160
|
+
animate: restState,
|
|
161
|
+
exit: reduceMotion ? reducedExit : glyphExit,
|
|
162
|
+
transition: reduceMotion ? reducedTransition : {
|
|
163
|
+
duration: ARC_DURATION.standard,
|
|
164
|
+
ease: [...ARC_EASE.enter],
|
|
165
|
+
delay: Math.min(glyph.order * ARC_STAGGER.char, MORPH_TEXT_MAX_GLYPH_DELAY_S),
|
|
166
|
+
layout: ARC_SPRING_MORPH
|
|
167
|
+
},
|
|
168
|
+
children: glyph.character
|
|
169
|
+
}, glyph.id);
|
|
170
|
+
$[4] = reduceMotion;
|
|
171
|
+
$[5] = text;
|
|
172
|
+
$[6] = t2;
|
|
173
|
+
} else {
|
|
174
|
+
t2 = $[6];
|
|
175
|
+
}
|
|
176
|
+
t1 = glyphs.map(t2);
|
|
177
|
+
$[0] = glyphs;
|
|
178
|
+
$[1] = reduceMotion;
|
|
179
|
+
$[2] = text;
|
|
180
|
+
$[3] = t1;
|
|
181
|
+
} else {
|
|
182
|
+
t1 = $[3];
|
|
183
|
+
}
|
|
184
|
+
let t2;
|
|
185
|
+
if ($[7] !== t1) {
|
|
186
|
+
t2 = /* @__PURE__ */ _jsx(AnimatePresence, {
|
|
187
|
+
mode: "popLayout",
|
|
188
|
+
initial: false,
|
|
189
|
+
children: t1
|
|
190
|
+
});
|
|
191
|
+
$[7] = t1;
|
|
192
|
+
$[8] = t2;
|
|
193
|
+
} else {
|
|
194
|
+
t2 = $[8];
|
|
195
|
+
}
|
|
196
|
+
let t3;
|
|
197
|
+
if ($[9] !== ref || $[10] !== t2) {
|
|
198
|
+
t3 = /* @__PURE__ */ _jsx("span", {
|
|
199
|
+
ref,
|
|
200
|
+
className: "relative inline-flex flex-none whitespace-pre",
|
|
201
|
+
children: t2
|
|
202
|
+
});
|
|
203
|
+
$[9] = ref;
|
|
204
|
+
$[10] = t2;
|
|
205
|
+
$[11] = t3;
|
|
206
|
+
} else {
|
|
207
|
+
t3 = $[11];
|
|
208
|
+
}
|
|
209
|
+
return t3;
|
|
210
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arc's Pagination (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): previous and next arrows around a
|
|
3
|
+
* sliding five page window, with a current-page mark that glides to the selected page. Arc's API (`page`,
|
|
4
|
+
* `pageCount`, `onPageChange`, `label`), with @astra-kit/ui's extensions: links through the provider's `Link` adapter
|
|
5
|
+
* (`getHref`), cursor paging without a page count (`hasNextPage`), arrow labels and Spanish copy.
|
|
6
|
+
*/
|
|
7
|
+
import type { MouseEvent } from "react";
|
|
8
|
+
/**
|
|
9
|
+
* Click that requested a page, from a page link or button or an arrow. Call `event.preventDefault()` on a link to keep
|
|
10
|
+
* the provider's `Link` from navigating, for example to page in place on plain clicks while modified clicks still
|
|
11
|
+
* open the address in a new tab.
|
|
12
|
+
*/
|
|
13
|
+
export type PaginationClickEvent = MouseEvent<HTMLAnchorElement | HTMLButtonElement>;
|
|
14
|
+
/** Called with the requested page and the click that requested it. */
|
|
15
|
+
export type PaginationPageChangeHandler = (page: number, event: PaginationClickEvent) => void;
|
|
16
|
+
/** Props shared by every way of paging. */
|
|
17
|
+
type PaginationBaseProps = {
|
|
18
|
+
/** Current page, 1-based. Clamped to the range. */
|
|
19
|
+
page: number;
|
|
20
|
+
/**
|
|
21
|
+
* Total pages. Zero renders an empty landmark. Leave it out for cursor paging: only the arrows render, and
|
|
22
|
+
* `hasNextPage` decides whether the next one is enabled.
|
|
23
|
+
*/
|
|
24
|
+
pageCount?: number;
|
|
25
|
+
/** Whether a page follows the current one, for cursor paging without `pageCount`. Ignored with `pageCount`. */
|
|
26
|
+
hasNextPage?: boolean;
|
|
27
|
+
/** Accessible name of the navigation landmark. Defaults to "Paginación". */
|
|
28
|
+
label?: string;
|
|
29
|
+
/** Visible label of the previous arrow, hidden on small screens. Defaults to "Anterior". */
|
|
30
|
+
previousLabel?: string;
|
|
31
|
+
/** Visible label of the next arrow, hidden on small screens. Defaults to "Siguiente". */
|
|
32
|
+
nextLabel?: string;
|
|
33
|
+
/** Classes of the navigation landmark. */
|
|
34
|
+
className?: string;
|
|
35
|
+
};
|
|
36
|
+
/** Props of `Pagination`: buttons that report the page, or links built with `getHref`. */
|
|
37
|
+
export type PaginationProps = PaginationBaseProps & ({
|
|
38
|
+
/** Called with the requested page and the click event. */
|
|
39
|
+
onPageChange: PaginationPageChangeHandler;
|
|
40
|
+
getHref?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
/**
|
|
43
|
+
* Called with the requested page and the click event when a link is clicked, before it navigates. Calling
|
|
44
|
+
* `event.preventDefault()` cancels the navigation of that link.
|
|
45
|
+
*/
|
|
46
|
+
onPageChange?: PaginationPageChangeHandler;
|
|
47
|
+
/**
|
|
48
|
+
* Builds the address of a page. Every control becomes a link rendered through the provider's `Link` adapter,
|
|
49
|
+
* so pages live in the URL and render on the server.
|
|
50
|
+
*/
|
|
51
|
+
getHref: (page: number) => string;
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Previous and next arrows around a five page window. Disabled arrows keep `aria-disabled` and never request a page.
|
|
55
|
+
* @param props - Current page, page count or next-page flag, handlers and copy.
|
|
56
|
+
* @returns The navigation landmark.
|
|
57
|
+
*/
|
|
58
|
+
declare function Pagination({ page, pageCount, hasNextPage, onPageChange, getHref, label, previousLabel, nextLabel, className, }: PaginationProps): import("react").JSX.Element;
|
|
59
|
+
export { Pagination };
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
import { PAGINATION_DEFAULT_COPY, PAGINATION_FIRST_PAGE, PAGINATION_WINDOW_SIZE } from "../constants/pagination.js";
|
|
4
|
+
import { PaginationButton, PaginationContent, PaginationItem, PaginationLink, PaginationRoot, PaginationStep } from "./primitives/pagination.js";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
/**
|
|
7
|
+
* Lists the pages of the window around the current page.
|
|
8
|
+
* @param currentPage - Clamped current page.
|
|
9
|
+
* @param pageCount - Total pages.
|
|
10
|
+
* @returns The visible page numbers, in order.
|
|
11
|
+
*/
|
|
12
|
+
function getVisiblePages(currentPage, pageCount) {
|
|
13
|
+
const halfWindow = Math.floor(PAGINATION_WINDOW_SIZE / 2);
|
|
14
|
+
const start = Math.max(PAGINATION_FIRST_PAGE, Math.min(pageCount - PAGINATION_WINDOW_SIZE + 1, currentPage - halfWindow));
|
|
15
|
+
return Array.from({ length: Math.min(pageCount, PAGINATION_WINDOW_SIZE) }, (_, index) => start + index);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Previous and next arrows around a five page window. Disabled arrows keep `aria-disabled` and never request a page.
|
|
19
|
+
* @param props - Current page, page count or next-page flag, handlers and copy.
|
|
20
|
+
* @returns The navigation landmark.
|
|
21
|
+
*/
|
|
22
|
+
function Pagination(t0) {
|
|
23
|
+
const $ = _c(43);
|
|
24
|
+
const { page, pageCount, hasNextPage: t1, onPageChange, getHref, label: t2, previousLabel: t3, nextLabel: t4, className } = t0;
|
|
25
|
+
const hasNextPage = t1 === undefined ? false : t1;
|
|
26
|
+
const label = t2 === undefined ? PAGINATION_DEFAULT_COPY.navigationLabel : t2;
|
|
27
|
+
const previousLabel = t3 === undefined ? PAGINATION_DEFAULT_COPY.previousText : t3;
|
|
28
|
+
const nextLabel = t4 === undefined ? PAGINATION_DEFAULT_COPY.nextText : t4;
|
|
29
|
+
const isCursor = pageCount === undefined;
|
|
30
|
+
const safePageCount = isCursor ? 0 : Math.max(0, Math.floor(pageCount));
|
|
31
|
+
if (!isCursor && safePageCount === 0) {
|
|
32
|
+
let t5;
|
|
33
|
+
if ($[0] !== className || $[1] !== label) {
|
|
34
|
+
t5 = /* @__PURE__ */ _jsx(PaginationRoot, {
|
|
35
|
+
"aria-label": label,
|
|
36
|
+
className
|
|
37
|
+
});
|
|
38
|
+
$[0] = className;
|
|
39
|
+
$[1] = label;
|
|
40
|
+
$[2] = t5;
|
|
41
|
+
} else {
|
|
42
|
+
t5 = $[2];
|
|
43
|
+
}
|
|
44
|
+
return t5;
|
|
45
|
+
}
|
|
46
|
+
const lowestPage = Math.max(PAGINATION_FIRST_PAGE, Math.floor(page));
|
|
47
|
+
const currentPage = isCursor ? lowestPage : Math.min(lowestPage, safePageCount);
|
|
48
|
+
const isFirst = currentPage <= PAGINATION_FIRST_PAGE;
|
|
49
|
+
const isLast = isCursor ? !hasNextPage : currentPage >= safePageCount;
|
|
50
|
+
let t5;
|
|
51
|
+
if ($[3] !== getHref) {
|
|
52
|
+
t5 = (target) => getHref?.(target);
|
|
53
|
+
$[3] = getHref;
|
|
54
|
+
$[4] = t5;
|
|
55
|
+
} else {
|
|
56
|
+
t5 = $[4];
|
|
57
|
+
}
|
|
58
|
+
const hrefOf = t5;
|
|
59
|
+
const t6 = previousLabel === PAGINATION_DEFAULT_COPY.previousText ? PAGINATION_DEFAULT_COPY.previousLabel : previousLabel;
|
|
60
|
+
const t7 = isFirst ? currentPage : currentPage - 1;
|
|
61
|
+
let t8;
|
|
62
|
+
if ($[5] !== hrefOf || $[6] !== t7) {
|
|
63
|
+
t8 = hrefOf(t7);
|
|
64
|
+
$[5] = hrefOf;
|
|
65
|
+
$[6] = t7;
|
|
66
|
+
$[7] = t8;
|
|
67
|
+
} else {
|
|
68
|
+
t8 = $[7];
|
|
69
|
+
}
|
|
70
|
+
let t9;
|
|
71
|
+
if ($[8] !== currentPage || $[9] !== onPageChange) {
|
|
72
|
+
t9 = (event) => onPageChange?.(currentPage - 1, event);
|
|
73
|
+
$[8] = currentPage;
|
|
74
|
+
$[9] = onPageChange;
|
|
75
|
+
$[10] = t9;
|
|
76
|
+
} else {
|
|
77
|
+
t9 = $[10];
|
|
78
|
+
}
|
|
79
|
+
let t10;
|
|
80
|
+
if ($[11] !== isFirst || $[12] !== previousLabel || $[13] !== t6 || $[14] !== t8 || $[15] !== t9) {
|
|
81
|
+
t10 = /* @__PURE__ */ _jsx(PaginationItem, { children: /* @__PURE__ */ _jsx(PaginationStep, {
|
|
82
|
+
direction: "previous",
|
|
83
|
+
text: previousLabel,
|
|
84
|
+
label: t6,
|
|
85
|
+
href: t8,
|
|
86
|
+
disabled: isFirst,
|
|
87
|
+
onClick: t9
|
|
88
|
+
}) });
|
|
89
|
+
$[11] = isFirst;
|
|
90
|
+
$[12] = previousLabel;
|
|
91
|
+
$[13] = t6;
|
|
92
|
+
$[14] = t8;
|
|
93
|
+
$[15] = t9;
|
|
94
|
+
$[16] = t10;
|
|
95
|
+
} else {
|
|
96
|
+
t10 = $[16];
|
|
97
|
+
}
|
|
98
|
+
let t11;
|
|
99
|
+
if ($[17] !== currentPage || $[18] !== getHref || $[19] !== isCursor || $[20] !== onPageChange || $[21] !== safePageCount) {
|
|
100
|
+
t11 = isCursor ? null : getVisiblePages(currentPage, safePageCount).map((pageNumber) => {
|
|
101
|
+
const controlProps = {
|
|
102
|
+
isActive: pageNumber === currentPage,
|
|
103
|
+
"aria-label": `${PAGINATION_DEFAULT_COPY.pageLabelPrefix} ${pageNumber}`,
|
|
104
|
+
onClick: (event_0) => onPageChange?.(pageNumber, event_0),
|
|
105
|
+
children: pageNumber
|
|
106
|
+
};
|
|
107
|
+
return /* @__PURE__ */ _jsx(PaginationItem, { children: getHref ? /* @__PURE__ */ _jsx(PaginationLink, {
|
|
108
|
+
href: getHref(pageNumber),
|
|
109
|
+
...controlProps
|
|
110
|
+
}) : /* @__PURE__ */ _jsx(PaginationButton, { ...controlProps }) }, pageNumber);
|
|
111
|
+
});
|
|
112
|
+
$[17] = currentPage;
|
|
113
|
+
$[18] = getHref;
|
|
114
|
+
$[19] = isCursor;
|
|
115
|
+
$[20] = onPageChange;
|
|
116
|
+
$[21] = safePageCount;
|
|
117
|
+
$[22] = t11;
|
|
118
|
+
} else {
|
|
119
|
+
t11 = $[22];
|
|
120
|
+
}
|
|
121
|
+
const t12 = nextLabel === PAGINATION_DEFAULT_COPY.nextText ? PAGINATION_DEFAULT_COPY.nextLabel : nextLabel;
|
|
122
|
+
const t13 = isLast ? currentPage : currentPage + 1;
|
|
123
|
+
let t14;
|
|
124
|
+
if ($[23] !== hrefOf || $[24] !== t13) {
|
|
125
|
+
t14 = hrefOf(t13);
|
|
126
|
+
$[23] = hrefOf;
|
|
127
|
+
$[24] = t13;
|
|
128
|
+
$[25] = t14;
|
|
129
|
+
} else {
|
|
130
|
+
t14 = $[25];
|
|
131
|
+
}
|
|
132
|
+
let t15;
|
|
133
|
+
if ($[26] !== currentPage || $[27] !== onPageChange) {
|
|
134
|
+
t15 = (event_1) => onPageChange?.(currentPage + 1, event_1);
|
|
135
|
+
$[26] = currentPage;
|
|
136
|
+
$[27] = onPageChange;
|
|
137
|
+
$[28] = t15;
|
|
138
|
+
} else {
|
|
139
|
+
t15 = $[28];
|
|
140
|
+
}
|
|
141
|
+
let t16;
|
|
142
|
+
if ($[29] !== isLast || $[30] !== nextLabel || $[31] !== t12 || $[32] !== t14 || $[33] !== t15) {
|
|
143
|
+
t16 = /* @__PURE__ */ _jsx(PaginationItem, { children: /* @__PURE__ */ _jsx(PaginationStep, {
|
|
144
|
+
direction: "next",
|
|
145
|
+
text: nextLabel,
|
|
146
|
+
label: t12,
|
|
147
|
+
href: t14,
|
|
148
|
+
disabled: isLast,
|
|
149
|
+
onClick: t15
|
|
150
|
+
}) });
|
|
151
|
+
$[29] = isLast;
|
|
152
|
+
$[30] = nextLabel;
|
|
153
|
+
$[31] = t12;
|
|
154
|
+
$[32] = t14;
|
|
155
|
+
$[33] = t15;
|
|
156
|
+
$[34] = t16;
|
|
157
|
+
} else {
|
|
158
|
+
t16 = $[34];
|
|
159
|
+
}
|
|
160
|
+
let t17;
|
|
161
|
+
if ($[35] !== t10 || $[36] !== t11 || $[37] !== t16) {
|
|
162
|
+
t17 = /* @__PURE__ */ _jsxs(PaginationContent, { children: [
|
|
163
|
+
t10,
|
|
164
|
+
t11,
|
|
165
|
+
t16
|
|
166
|
+
] });
|
|
167
|
+
$[35] = t10;
|
|
168
|
+
$[36] = t11;
|
|
169
|
+
$[37] = t16;
|
|
170
|
+
$[38] = t17;
|
|
171
|
+
} else {
|
|
172
|
+
t17 = $[38];
|
|
173
|
+
}
|
|
174
|
+
let t18;
|
|
175
|
+
if ($[39] !== className || $[40] !== label || $[41] !== t17) {
|
|
176
|
+
t18 = /* @__PURE__ */ _jsx(PaginationRoot, {
|
|
177
|
+
"aria-label": label,
|
|
178
|
+
className,
|
|
179
|
+
children: t17
|
|
180
|
+
});
|
|
181
|
+
$[39] = className;
|
|
182
|
+
$[40] = label;
|
|
183
|
+
$[41] = t17;
|
|
184
|
+
$[42] = t18;
|
|
185
|
+
} else {
|
|
186
|
+
t18 = $[42];
|
|
187
|
+
}
|
|
188
|
+
return t18;
|
|
189
|
+
}
|
|
190
|
+
export { Pagination };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arc's Popover (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a raised panel with Arc's panel radius
|
|
3
|
+
* and floating shadow that starts a few pixels toward its trigger and settles on a spring, leaving faster than it
|
|
4
|
+
* arrives. It follows Arc's composition: `Popover`, `PopoverTrigger`, `PopoverContent` and `PopoverClose`.
|
|
5
|
+
*/
|
|
6
|
+
import type { ComponentProps } from "react";
|
|
7
|
+
import { Popover, PopoverClose, PopoverContent as PopoverContentPrimitive, PopoverTrigger } from "./primitives/popover.js";
|
|
8
|
+
export type PopoverContentProps = ComponentProps<typeof PopoverContentPrimitive>;
|
|
9
|
+
/**
|
|
10
|
+
* Renders the portaled panel anchored to the trigger, kept inside the viewport; content taller than the room left
|
|
11
|
+
* scrolls inside the panel.
|
|
12
|
+
* @param props - Radix content properties. Arc's defaults: `align="start"`, a 6px `sideOffset` and a 10px
|
|
13
|
+
* `collisionPadding`.
|
|
14
|
+
* @returns The panel.
|
|
15
|
+
*/
|
|
16
|
+
declare function PopoverContent({ align, ...props }: PopoverContentProps): import("react").JSX.Element;
|
|
17
|
+
export { Popover, PopoverClose, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
import { Popover, PopoverClose, PopoverContent as PopoverContentPrimitive, PopoverTrigger } from "./primitives/popover.js";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
/**
|
|
6
|
+
* Renders the portaled panel anchored to the trigger, kept inside the viewport; content taller than the room left
|
|
7
|
+
* scrolls inside the panel.
|
|
8
|
+
* @param props - Radix content properties. Arc's defaults: `align="start"`, a 6px `sideOffset` and a 10px
|
|
9
|
+
* `collisionPadding`.
|
|
10
|
+
* @returns The panel.
|
|
11
|
+
*/
|
|
12
|
+
function PopoverContent(t0) {
|
|
13
|
+
const $ = _c(6);
|
|
14
|
+
let props;
|
|
15
|
+
let t1;
|
|
16
|
+
if ($[0] !== t0) {
|
|
17
|
+
({align: t1, ...props} = t0);
|
|
18
|
+
$[0] = t0;
|
|
19
|
+
$[1] = props;
|
|
20
|
+
$[2] = t1;
|
|
21
|
+
} else {
|
|
22
|
+
props = $[1];
|
|
23
|
+
t1 = $[2];
|
|
24
|
+
}
|
|
25
|
+
const align = t1 === undefined ? "start" : t1;
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[3] !== align || $[4] !== props) {
|
|
28
|
+
t2 = /* @__PURE__ */ _jsx(PopoverContentPrimitive, {
|
|
29
|
+
align,
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
$[3] = align;
|
|
33
|
+
$[4] = props;
|
|
34
|
+
$[5] = t2;
|
|
35
|
+
} else {
|
|
36
|
+
t2 = $[5];
|
|
37
|
+
}
|
|
38
|
+
return t2;
|
|
39
|
+
}
|
|
40
|
+
export { Popover, PopoverClose, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Cross-fades between states of the same region, such as idle, loading and result. */
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
declare const PRESENCE_SWAP_ELEMENTS: {
|
|
4
|
+
readonly div: import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>;
|
|
5
|
+
readonly span: import("motion/react").ForwardRefComponent<HTMLSpanElement, import("motion/react").HTMLMotionProps<"span">>;
|
|
6
|
+
};
|
|
7
|
+
export interface PresenceSwapProps {
|
|
8
|
+
/** Changing the key plays the exit of the previous content and the entry of the new one. */
|
|
9
|
+
presenceKey: string;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
as?: keyof typeof PRESENCE_SWAP_ELEMENTS;
|
|
12
|
+
className?: string;
|
|
13
|
+
/** `wait` swaps sequentially; `popLayout` overlaps them for inline content. */
|
|
14
|
+
mode?: "wait" | "popLayout";
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Swaps keyed content with Arc's swap (a short rise out of a blur); the first render is not animated.
|
|
18
|
+
* @param props - Key identifying the current state and its content.
|
|
19
|
+
* @returns The animated content.
|
|
20
|
+
*/
|
|
21
|
+
export declare function PresenceSwap({ presenceKey, children, as, className, mode }: PresenceSwapProps): import("react").JSX.Element;
|
|
22
|
+
export {};
|