beez-ui 2.5.0 → 2.6.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/CHANGELOG.md +63 -0
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/components/alert-dialog.d.ts +15 -4
- package/dist/components/alert-dialog.js +84 -44
- package/dist/components/alert.d.ts +30 -9
- package/dist/components/alert.js +360 -39
- package/dist/components/avatar.d.ts +33 -10
- package/dist/components/avatar.js +110 -30
- package/dist/components/badge.d.ts +39 -7
- package/dist/components/badge.js +348 -24
- package/dist/components/calendar.d.ts +29 -2
- package/dist/components/calendar.js +1035 -223
- package/dist/components/card.d.ts +17 -1
- package/dist/components/card.js +34 -8
- package/dist/components/carousel.d.ts +29 -2
- package/dist/components/carousel.js +471 -90
- package/dist/components/checkbox.d.ts +13 -2
- package/dist/components/checkbox.js +301 -41
- package/dist/components/dialog-surface.d.ts +27 -0
- package/dist/components/dialog-surface.js +137 -0
- package/dist/components/dialog.d.ts +21 -4
- package/dist/components/dialog.js +163 -96
- package/dist/components/dropdown-menu.d.ts +30 -16
- package/dist/components/dropdown-menu.js +139 -83
- package/dist/components/hover-card.d.ts +46 -3
- package/dist/components/hover-card.js +423 -60
- package/dist/components/pagination.d.ts +32 -14
- package/dist/components/pagination.js +136 -59
- package/dist/components/popover.d.ts +14 -5
- package/dist/components/popover.js +78 -36
- package/dist/components/radio-group.d.ts +19 -3
- package/dist/components/radio-group.js +400 -57
- package/dist/components/select.d.ts +17 -6
- package/dist/components/select.js +83 -71
- package/dist/components/sheet.js +37 -26
- package/dist/components/sidebar.js +11 -0
- package/dist/components/skeleton.d.ts +19 -5
- package/dist/components/skeleton.js +434 -14
- package/dist/components/switch.d.ts +14 -4
- package/dist/components/switch.js +424 -40
- package/dist/components/tabs.d.ts +38 -5
- package/dist/components/tabs.js +564 -97
- package/dist/components/themed-toaster.d.ts +6 -2
- package/dist/components/themed-toaster.js +80 -50
- package/dist/components/tooltip.d.ts +33 -2
- package/dist/components/tooltip.js +197 -69
- package/dist/constants/alert.d.ts +12 -0
- package/dist/constants/alert.js +9 -0
- package/dist/constants/avatar.d.ts +10 -0
- package/dist/constants/avatar.js +7 -0
- package/dist/constants/badge.d.ts +6 -0
- package/dist/constants/badge.js +6 -0
- package/dist/constants/calendar.d.ts +24 -0
- package/dist/constants/calendar.js +22 -0
- package/dist/constants/carousel.d.ts +37 -0
- package/dist/constants/carousel.js +53 -0
- package/dist/constants/checkbox.d.ts +17 -0
- package/dist/constants/checkbox.js +17 -0
- package/dist/constants/dialog.d.ts +6 -0
- package/dist/constants/dialog.js +6 -0
- package/dist/constants/dropdown-menu.d.ts +5 -0
- package/dist/constants/dropdown-menu.js +5 -0
- package/dist/constants/hover-card.d.ts +37 -0
- package/dist/constants/hover-card.js +85 -0
- package/dist/constants/pagination.d.ts +9 -0
- package/dist/constants/pagination.js +9 -0
- package/dist/constants/popover.d.ts +7 -0
- package/dist/constants/popover.js +39 -0
- package/dist/constants/radio-group.d.ts +10 -0
- package/dist/constants/radio-group.js +10 -0
- package/dist/constants/select.d.ts +3 -0
- package/dist/constants/select.js +3 -0
- package/dist/constants/skeleton.d.ts +17 -0
- package/dist/constants/skeleton.js +17 -0
- package/dist/constants/switch.d.ts +44 -0
- package/dist/constants/switch.js +49 -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/lib/toast-layer.d.ts +24 -0
- package/dist/lib/toast-layer.js +76 -0
- package/dist/motion/arc-floating-slot.d.ts +40 -0
- package/dist/motion/arc-floating-slot.js +167 -0
- package/dist/motion/glide-indicator.d.ts +6 -7
- package/dist/motion/glide-indicator.js +5 -3
- package/dist/motion/overlay-warmth.d.ts +24 -0
- package/dist/motion/overlay-warmth.js +70 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Tuning of `Calendar`, adapted from Arc's calendar (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md). */
|
|
2
|
+
/** Spring of a month sliding in: Arc's month strip, critically damped so it never overshoots or queues. */
|
|
3
|
+
export const CALENDAR_MONTH_SPRING = {
|
|
4
|
+
type: "spring",
|
|
5
|
+
visualDuration: .36,
|
|
6
|
+
bounce: 0,
|
|
7
|
+
restDelta: .002
|
|
8
|
+
};
|
|
9
|
+
/** Opacity a month starts from while it slides in, matching Arc's neighbouring pane one step off the strip. */
|
|
10
|
+
export const CALENDAR_MONTH_ENTER_OPACITY = .4;
|
|
11
|
+
/** Scale the selected disc grows from when the selection enters a month. */
|
|
12
|
+
export const CALENDAR_SELECTION_ENTER_SCALE = .6;
|
|
13
|
+
/** Duration, in seconds, of the selected disc fading out when the selection leaves a month. */
|
|
14
|
+
export const CALENDAR_SELECTION_EXIT_DURATION_S = .14;
|
|
15
|
+
/** Day button that holds a single selection, the only one the gliding disc follows. */
|
|
16
|
+
export const CALENDAR_SELECTED_DAY_SELECTOR = "[data-selected-single=\"true\"]";
|
|
17
|
+
/** Attribute the month sets while its disc paints the selection, so the selected day drops its own fill. */
|
|
18
|
+
export const CALENDAR_SELECTION_DISC_ATTRIBUTE = "data-selection-disc";
|
|
19
|
+
/** Default copy of the optional Today button. */
|
|
20
|
+
export const CALENDAR_COPY = { today: "Hoy" };
|
|
21
|
+
/** Months in a year, to compare dates by calendar month. */
|
|
22
|
+
export const CALENDAR_MONTHS_PER_YEAR = 12;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Tuning of `Carousel`, adapted from Arc's carousel (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md). */
|
|
2
|
+
/** Orientation of the slide track; vertical carousels move with the up and down arrows. */
|
|
3
|
+
export type CarouselOrientation = "horizontal" | "vertical";
|
|
4
|
+
/** Arrow keys that move to the previous and next slide along each axis. */
|
|
5
|
+
export declare const CAROUSEL_KEYS: {
|
|
6
|
+
readonly horizontal: {
|
|
7
|
+
readonly previous: "ArrowLeft";
|
|
8
|
+
readonly next: "ArrowRight";
|
|
9
|
+
};
|
|
10
|
+
readonly vertical: {
|
|
11
|
+
readonly previous: "ArrowUp";
|
|
12
|
+
readonly next: "ArrowDown";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
/** Keys that jump to the first and the last slide, as in Arc. */
|
|
16
|
+
export declare const CAROUSEL_EDGE_KEYS: {
|
|
17
|
+
readonly first: "Home";
|
|
18
|
+
readonly last: "End";
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Focused elements, and composite widgets around them, that own their arrow, Home and End keys instead of moving the
|
|
22
|
+
* carousel: text entry plus the ARIA widgets with their own keyboard navigation.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CAROUSEL_OWN_KEYBOARD_SELECTOR: string;
|
|
25
|
+
/** Length, in px, of a resting indicator dot and of the active pill it stretches into. */
|
|
26
|
+
export declare const CAROUSEL_INDICATOR_LENGTH_PX: {
|
|
27
|
+
readonly dot: 6;
|
|
28
|
+
readonly pill: 22;
|
|
29
|
+
};
|
|
30
|
+
/** Default copy of the slide indicators. */
|
|
31
|
+
export declare const CAROUSEL_COPY: {
|
|
32
|
+
readonly indicatorsLabel: "Elegir una diapositiva";
|
|
33
|
+
readonly slideLabelPrefix: "Diapositiva";
|
|
34
|
+
readonly slideLabelSeparator: "de";
|
|
35
|
+
};
|
|
36
|
+
/** Root of a carousel; a nested carousel owns the keys pressed inside it. */
|
|
37
|
+
export declare const CAROUSEL_ROOT_SELECTOR = "[data-slot=\"carousel\"]";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** Arrow keys that move to the previous and next slide along each axis. */
|
|
2
|
+
export const CAROUSEL_KEYS = {
|
|
3
|
+
horizontal: {
|
|
4
|
+
previous: "ArrowLeft",
|
|
5
|
+
next: "ArrowRight"
|
|
6
|
+
},
|
|
7
|
+
vertical: {
|
|
8
|
+
previous: "ArrowUp",
|
|
9
|
+
next: "ArrowDown"
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
/** Keys that jump to the first and the last slide, as in Arc. */
|
|
13
|
+
export const CAROUSEL_EDGE_KEYS = {
|
|
14
|
+
first: "Home",
|
|
15
|
+
last: "End"
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Focused elements, and composite widgets around them, that own their arrow, Home and End keys instead of moving the
|
|
19
|
+
* carousel: text entry plus the ARIA widgets with their own keyboard navigation.
|
|
20
|
+
*/
|
|
21
|
+
export const CAROUSEL_OWN_KEYBOARD_SELECTOR = [
|
|
22
|
+
"input",
|
|
23
|
+
"textarea",
|
|
24
|
+
"select",
|
|
25
|
+
"[contenteditable]:not([contenteditable=false])",
|
|
26
|
+
...[
|
|
27
|
+
"combobox",
|
|
28
|
+
"grid",
|
|
29
|
+
"listbox",
|
|
30
|
+
"menu",
|
|
31
|
+
"menubar",
|
|
32
|
+
"radiogroup",
|
|
33
|
+
"slider",
|
|
34
|
+
"spinbutton",
|
|
35
|
+
"tablist",
|
|
36
|
+
"toolbar",
|
|
37
|
+
"tree",
|
|
38
|
+
"treegrid"
|
|
39
|
+
].map((role) => `[role=${role}]`)
|
|
40
|
+
].join(", ");
|
|
41
|
+
/** Length, in px, of a resting indicator dot and of the active pill it stretches into. */
|
|
42
|
+
export const CAROUSEL_INDICATOR_LENGTH_PX = {
|
|
43
|
+
dot: 6,
|
|
44
|
+
pill: 22
|
|
45
|
+
};
|
|
46
|
+
/** Default copy of the slide indicators. */
|
|
47
|
+
export const CAROUSEL_COPY = {
|
|
48
|
+
indicatorsLabel: "Elegir una diapositiva",
|
|
49
|
+
slideLabelPrefix: "Diapositiva",
|
|
50
|
+
slideLabelSeparator: "de"
|
|
51
|
+
};
|
|
52
|
+
/** Root of a carousel; a nested carousel owns the keys pressed inside it. */
|
|
53
|
+
export const CAROUSEL_ROOT_SELECTOR = "[data-slot=\"carousel\"]";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Tuning of Arc's Checkbox mark, adapted from Arc (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md). */
|
|
2
|
+
/**
|
|
3
|
+
* The check and the dash share three points, so the mark morphs from one into the other instead of swapping. Both
|
|
4
|
+
* are drawn in the 18 by 18 view box of `CHECKBOX_MARK_VIEW_BOX`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CHECKBOX_MARK_PATH: {
|
|
7
|
+
readonly check: "M4.25 9.25 L7.25 12.25 L13.75 5.75";
|
|
8
|
+
readonly dash: "M4.75 9 L9 9 L13.25 9";
|
|
9
|
+
};
|
|
10
|
+
/** View box of the mark, matching the 18px square it is drawn on. */
|
|
11
|
+
export declare const CHECKBOX_MARK_VIEW_BOX = "0 0 18 18";
|
|
12
|
+
/** Stroke width of the mark, in view box units. */
|
|
13
|
+
export declare const CHECKBOX_MARK_STROKE_WIDTH = 1.75;
|
|
14
|
+
/** Scale the fill starts from when the box is checked and shrinks back to when it is cleared. */
|
|
15
|
+
export declare const CHECKBOX_FILL_HIDDEN_SCALE = 0.6;
|
|
16
|
+
/** Suffix of the id that ties the helper copy to the control through `aria-describedby`. */
|
|
17
|
+
export declare const CHECKBOX_DESCRIPTION_ID_SUFFIX = "description";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Tuning of Arc's Checkbox mark, adapted from Arc (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md). */
|
|
2
|
+
/**
|
|
3
|
+
* The check and the dash share three points, so the mark morphs from one into the other instead of swapping. Both
|
|
4
|
+
* are drawn in the 18 by 18 view box of `CHECKBOX_MARK_VIEW_BOX`.
|
|
5
|
+
*/
|
|
6
|
+
export const CHECKBOX_MARK_PATH = {
|
|
7
|
+
check: "M4.25 9.25 L7.25 12.25 L13.75 5.75",
|
|
8
|
+
dash: "M4.75 9 L9 9 L13.25 9"
|
|
9
|
+
};
|
|
10
|
+
/** View box of the mark, matching the 18px square it is drawn on. */
|
|
11
|
+
export const CHECKBOX_MARK_VIEW_BOX = "0 0 18 18";
|
|
12
|
+
/** Stroke width of the mark, in view box units. */
|
|
13
|
+
export const CHECKBOX_MARK_STROKE_WIDTH = 1.75;
|
|
14
|
+
/** Scale the fill starts from when the box is checked and shrinks back to when it is cleared. */
|
|
15
|
+
export const CHECKBOX_FILL_HIDDEN_SCALE = .6;
|
|
16
|
+
/** Suffix of the id that ties the helper copy to the control through `aria-describedby`. */
|
|
17
|
+
export const CHECKBOX_DESCRIPTION_ID_SUFFIX = "description";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Tuning shared by the Arc surfaces of `Dialog` and `AlertDialog`. */
|
|
2
|
+
/** Vertical offsets, in em, of a changed title or description rising in and lifting out while the dialog is open. */
|
|
3
|
+
export declare const DIALOG_TEXT_SWAP_OFFSET_EM: {
|
|
4
|
+
readonly enter: 0.3;
|
|
5
|
+
readonly exit: -0.3;
|
|
6
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Placement defaults of `DropdownMenuContent` and `DropdownMenuSubContent`, taken from Arc's Dropdown menu. */
|
|
2
|
+
/** Gap, in pixels, between the trigger and the menu. */
|
|
3
|
+
export declare const DROPDOWN_MENU_SIDE_OFFSET_PX = 6;
|
|
4
|
+
/** Minimum distance, in pixels, a menu or submenu keeps from the viewport edges. */
|
|
5
|
+
export declare const DROPDOWN_MENU_COLLISION_PADDING_PX = 12;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Placement defaults of `DropdownMenuContent` and `DropdownMenuSubContent`, taken from Arc's Dropdown menu. */
|
|
2
|
+
/** Gap, in pixels, between the trigger and the menu. */
|
|
3
|
+
export const DROPDOWN_MENU_SIDE_OFFSET_PX = 6;
|
|
4
|
+
/** Minimum distance, in pixels, a menu or submenu keeps from the viewport edges. */
|
|
5
|
+
export const DROPDOWN_MENU_COLLISION_PADDING_PX = 12;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ArcFloatingMotion } from "../motion/arc-floating-slot.js";
|
|
2
|
+
/** Milliseconds of hover before the first card opens. */
|
|
3
|
+
export declare const HOVER_CARD_OPEN_DELAY_MS = 500;
|
|
4
|
+
/** Milliseconds of grace after the pointer leaves, so it can travel into the card. */
|
|
5
|
+
export declare const HOVER_CARD_CLOSE_DELAY_MS = 140;
|
|
6
|
+
/** Moving to another trigger within this many milliseconds of a card closing opens the next one almost at once. */
|
|
7
|
+
export declare const HOVER_CARD_SKIP_WINDOW_MS = 300;
|
|
8
|
+
/**
|
|
9
|
+
* Even warm, a trigger waits this many milliseconds, so a pointer crossing it on the way into an open card does not
|
|
10
|
+
* steal the card.
|
|
11
|
+
*/
|
|
12
|
+
export declare const HOVER_CARD_WARM_OPEN_DELAY_MS = 80;
|
|
13
|
+
/** Gap, in px, between the card and its trigger. */
|
|
14
|
+
export declare const HOVER_CARD_SIDE_OFFSET_PX = 8;
|
|
15
|
+
/** Distance, in px, the card keeps from the viewport edges before it flips or shifts. */
|
|
16
|
+
export declare const HOVER_CARD_COLLISION_PADDING_PX = 12;
|
|
17
|
+
/** Delay, in seconds, before the first row of `HoverCardProfile` settles in. */
|
|
18
|
+
export declare const HOVER_CARD_PROFILE_SETTLE_DELAY_S = 0.04;
|
|
19
|
+
/** Stagger, in seconds, between the rows of `HoverCardProfile`. */
|
|
20
|
+
export declare const HOVER_CARD_PROFILE_STAGGER_S = 0.035;
|
|
21
|
+
/** Distance, in px, each row of `HoverCardProfile` rises while it settles in. */
|
|
22
|
+
export declare const HOVER_CARD_PROFILE_SETTLE_DISTANCE_PX = 4;
|
|
23
|
+
/** Rows of `HoverCardProfile`, in the order they settle in. */
|
|
24
|
+
export declare const HOVER_CARD_PROFILE_ROW_ORDER: {
|
|
25
|
+
readonly head: 0;
|
|
26
|
+
readonly bio: 1;
|
|
27
|
+
readonly stats: 2;
|
|
28
|
+
readonly meta: 3;
|
|
29
|
+
};
|
|
30
|
+
/** Initials shown in place of a missing portrait: the first letter of up to this many words of the name. */
|
|
31
|
+
export declare const HOVER_CARD_PROFILE_INITIALS_LENGTH = 2;
|
|
32
|
+
/** Side, in px, of the square portrait of `HoverCardProfile`. */
|
|
33
|
+
export declare const HOVER_CARD_PROFILE_PORTRAIT_SIZE_PX = 48;
|
|
34
|
+
/** The card grows from the trigger edge: 4px of travel and a .96 scale on one smooth spring, with a leading fade. */
|
|
35
|
+
export declare const HOVER_CARD_MOTION: ArcFloatingMotion;
|
|
36
|
+
/** Within the skip window the next card opens in place and only fades. */
|
|
37
|
+
export declare const HOVER_CARD_INSTANT_MOTION: ArcFloatingMotion;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ARC_DURATION, ARC_EASE, ARC_SPRING_SMOOTH } from "../motion/arc-tokens.js";
|
|
2
|
+
/** Milliseconds of hover before the first card opens. */
|
|
3
|
+
export const HOVER_CARD_OPEN_DELAY_MS = 500;
|
|
4
|
+
/** Milliseconds of grace after the pointer leaves, so it can travel into the card. */
|
|
5
|
+
export const HOVER_CARD_CLOSE_DELAY_MS = 140;
|
|
6
|
+
/** Moving to another trigger within this many milliseconds of a card closing opens the next one almost at once. */
|
|
7
|
+
export const HOVER_CARD_SKIP_WINDOW_MS = 300;
|
|
8
|
+
/**
|
|
9
|
+
* Even warm, a trigger waits this many milliseconds, so a pointer crossing it on the way into an open card does not
|
|
10
|
+
* steal the card.
|
|
11
|
+
*/
|
|
12
|
+
export const HOVER_CARD_WARM_OPEN_DELAY_MS = 80;
|
|
13
|
+
/** Gap, in px, between the card and its trigger. */
|
|
14
|
+
export const HOVER_CARD_SIDE_OFFSET_PX = 8;
|
|
15
|
+
/** Distance, in px, the card keeps from the viewport edges before it flips or shifts. */
|
|
16
|
+
export const HOVER_CARD_COLLISION_PADDING_PX = 12;
|
|
17
|
+
/** Delay, in seconds, before the first row of `HoverCardProfile` settles in. */
|
|
18
|
+
export const HOVER_CARD_PROFILE_SETTLE_DELAY_S = .04;
|
|
19
|
+
/** Stagger, in seconds, between the rows of `HoverCardProfile`. */
|
|
20
|
+
export const HOVER_CARD_PROFILE_STAGGER_S = .035;
|
|
21
|
+
/** Distance, in px, each row of `HoverCardProfile` rises while it settles in. */
|
|
22
|
+
export const HOVER_CARD_PROFILE_SETTLE_DISTANCE_PX = 4;
|
|
23
|
+
/** Rows of `HoverCardProfile`, in the order they settle in. */
|
|
24
|
+
export const HOVER_CARD_PROFILE_ROW_ORDER = {
|
|
25
|
+
head: 0,
|
|
26
|
+
bio: 1,
|
|
27
|
+
stats: 2,
|
|
28
|
+
meta: 3
|
|
29
|
+
};
|
|
30
|
+
/** Initials shown in place of a missing portrait: the first letter of up to this many words of the name. */
|
|
31
|
+
export const HOVER_CARD_PROFILE_INITIALS_LENGTH = 2;
|
|
32
|
+
/** Side, in px, of the square portrait of `HoverCardProfile`. */
|
|
33
|
+
export const HOVER_CARD_PROFILE_PORTRAIT_SIZE_PX = 48;
|
|
34
|
+
const exitTween = {
|
|
35
|
+
duration: .12,
|
|
36
|
+
ease: [...ARC_EASE.standard]
|
|
37
|
+
};
|
|
38
|
+
/** The card grows from the trigger edge: 4px of travel and a .96 scale on one smooth spring, with a leading fade. */
|
|
39
|
+
export const HOVER_CARD_MOTION = {
|
|
40
|
+
enterFrom: {
|
|
41
|
+
travel: 4,
|
|
42
|
+
scale: .96,
|
|
43
|
+
opacity: 0
|
|
44
|
+
},
|
|
45
|
+
enter: {
|
|
46
|
+
transform: ARC_SPRING_SMOOTH,
|
|
47
|
+
opacity: {
|
|
48
|
+
duration: ARC_DURATION.fast,
|
|
49
|
+
ease: [...ARC_EASE.enter]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
exitTo: {
|
|
53
|
+
travel: 4,
|
|
54
|
+
scale: .96,
|
|
55
|
+
opacity: 0
|
|
56
|
+
},
|
|
57
|
+
exit: {
|
|
58
|
+
transform: exitTween,
|
|
59
|
+
opacity: exitTween
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
/** Within the skip window the next card opens in place and only fades. */
|
|
63
|
+
export const HOVER_CARD_INSTANT_MOTION = {
|
|
64
|
+
enterFrom: {
|
|
65
|
+
travel: 0,
|
|
66
|
+
scale: 1,
|
|
67
|
+
opacity: 0
|
|
68
|
+
},
|
|
69
|
+
enter: {
|
|
70
|
+
transform: {
|
|
71
|
+
duration: .14,
|
|
72
|
+
ease: [...ARC_EASE.enter]
|
|
73
|
+
},
|
|
74
|
+
opacity: {
|
|
75
|
+
duration: .09,
|
|
76
|
+
ease: [...ARC_EASE.enter]
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
exitTo: {
|
|
80
|
+
travel: 0,
|
|
81
|
+
scale: 1,
|
|
82
|
+
opacity: 0
|
|
83
|
+
},
|
|
84
|
+
exit: HOVER_CARD_MOTION.exit
|
|
85
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Default Spanish copy of Pagination; every value can be overridden through props. */
|
|
2
|
+
export declare const PAGINATION_DEFAULT_COPY: {
|
|
3
|
+
readonly navigationLabel: "Paginación";
|
|
4
|
+
readonly previousText: "Anterior";
|
|
5
|
+
readonly nextText: "Siguiente";
|
|
6
|
+
readonly previousLabel: "Ir a la página anterior";
|
|
7
|
+
readonly nextLabel: "Ir a la página siguiente";
|
|
8
|
+
readonly morePages: "Más páginas";
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Default Spanish copy of Pagination; every value can be overridden through props. */
|
|
2
|
+
export const PAGINATION_DEFAULT_COPY = {
|
|
3
|
+
navigationLabel: "Paginación",
|
|
4
|
+
previousText: "Anterior",
|
|
5
|
+
nextText: "Siguiente",
|
|
6
|
+
previousLabel: "Ir a la página anterior",
|
|
7
|
+
nextLabel: "Ir a la página siguiente",
|
|
8
|
+
morePages: "Más páginas"
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ArcFloatingMotion } from "../motion/arc-floating-slot.js";
|
|
2
|
+
/** Gap, in px, between the panel and its trigger. */
|
|
3
|
+
export declare const POPOVER_SIDE_OFFSET_PX = 6;
|
|
4
|
+
/** Distance, in px, the panel keeps from the viewport edges before it flips or shifts. */
|
|
5
|
+
export declare const POPOVER_COLLISION_PADDING_PX = 10;
|
|
6
|
+
/** The panel starts 5px toward its trigger at .97, settles on a spring, and leaves faster than it arrives. */
|
|
7
|
+
export declare const POPOVER_MOTION: ArcFloatingMotion;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ARC_DURATION, ARC_EASE } from "../motion/arc-tokens.js";
|
|
2
|
+
/** Gap, in px, between the panel and its trigger. */
|
|
3
|
+
export const POPOVER_SIDE_OFFSET_PX = 6;
|
|
4
|
+
/** Distance, in px, the panel keeps from the viewport edges before it flips or shifts. */
|
|
5
|
+
export const POPOVER_COLLISION_PADDING_PX = 10;
|
|
6
|
+
/** Arc's CSS spring (`--ease-spring`, bounce .15) as a Motion spring: the panel settles with a gentle overshoot. */
|
|
7
|
+
const POPOVER_SETTLE_SPRING = {
|
|
8
|
+
type: "spring",
|
|
9
|
+
visualDuration: .34,
|
|
10
|
+
bounce: .15
|
|
11
|
+
};
|
|
12
|
+
const exitTween = {
|
|
13
|
+
duration: ARC_DURATION.fast,
|
|
14
|
+
ease: [...ARC_EASE.standard]
|
|
15
|
+
};
|
|
16
|
+
/** The panel starts 5px toward its trigger at .97, settles on a spring, and leaves faster than it arrives. */
|
|
17
|
+
export const POPOVER_MOTION = {
|
|
18
|
+
enterFrom: {
|
|
19
|
+
travel: 5,
|
|
20
|
+
scale: .97,
|
|
21
|
+
opacity: 0
|
|
22
|
+
},
|
|
23
|
+
enter: {
|
|
24
|
+
transform: POPOVER_SETTLE_SPRING,
|
|
25
|
+
opacity: {
|
|
26
|
+
duration: ARC_DURATION.fast,
|
|
27
|
+
ease: [...ARC_EASE.enter]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
exitTo: {
|
|
31
|
+
travel: 2.5,
|
|
32
|
+
scale: .98,
|
|
33
|
+
opacity: 0
|
|
34
|
+
},
|
|
35
|
+
exit: {
|
|
36
|
+
transform: exitTween,
|
|
37
|
+
opacity: exitTween
|
|
38
|
+
}
|
|
39
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Tuning of Arc's RadioGroup, adapted from Arc (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md). */
|
|
2
|
+
/** Scale the dot shrinks to when its option is cleared, and springs up from when it is chosen. */
|
|
3
|
+
export declare const RADIO_GROUP_DOT_HIDDEN_SCALE = 0.4;
|
|
4
|
+
/** Attribute the group sets once its highlight is placed, which drops the static fallback look of the checked row. */
|
|
5
|
+
export declare const RADIO_GROUP_READY_ATTRIBUTE = "data-ready";
|
|
6
|
+
/** Suffixes of the ids that tie an option row's copy to its radio. */
|
|
7
|
+
export declare const RADIO_GROUP_OPTION_ID_SUFFIX: {
|
|
8
|
+
readonly label: "label";
|
|
9
|
+
readonly description: "description";
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Tuning of Arc's RadioGroup, adapted from Arc (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md). */
|
|
2
|
+
/** Scale the dot shrinks to when its option is cleared, and springs up from when it is chosen. */
|
|
3
|
+
export const RADIO_GROUP_DOT_HIDDEN_SCALE = .4;
|
|
4
|
+
/** Attribute the group sets once its highlight is placed, which drops the static fallback look of the checked row. */
|
|
5
|
+
export const RADIO_GROUP_READY_ATTRIBUTE = "data-ready";
|
|
6
|
+
/** Suffixes of the ids that tie an option row's copy to its radio. */
|
|
7
|
+
export const RADIO_GROUP_OPTION_ID_SUFFIX = {
|
|
8
|
+
label: "label",
|
|
9
|
+
description: "description"
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Defaults and tuning of Arc's Skeleton placeholder. */
|
|
2
|
+
/** Default Spanish label announced while the composed placeholder is busy. */
|
|
3
|
+
export declare const SKELETON_DEFAULT_LABEL = "Cargando contenido";
|
|
4
|
+
/** Text lines the composed placeholder draws when `lines` is not set. */
|
|
5
|
+
export declare const SKELETON_DEFAULT_LINES = 3;
|
|
6
|
+
/** Bounds of `lines`, so a placeholder never collapses or turns into a wall of bars. */
|
|
7
|
+
export declare const SKELETON_LINE_LIMITS: {
|
|
8
|
+
readonly min: 1;
|
|
9
|
+
readonly max: 6;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* After loading flips, resizes inside this window spring to the new height; later resizes (a font swap, a parent
|
|
13
|
+
* reflow) follow at once.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SKELETON_MORPH_WINDOW_MS = 120;
|
|
16
|
+
/** Vertical travel, in pixels, of revealed content rising into place. */
|
|
17
|
+
export declare const SKELETON_REVEAL_OFFSET_PX = 4;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Defaults and tuning of Arc's Skeleton placeholder. */
|
|
2
|
+
/** Default Spanish label announced while the composed placeholder is busy. */
|
|
3
|
+
export const SKELETON_DEFAULT_LABEL = "Cargando contenido";
|
|
4
|
+
/** Text lines the composed placeholder draws when `lines` is not set. */
|
|
5
|
+
export const SKELETON_DEFAULT_LINES = 3;
|
|
6
|
+
/** Bounds of `lines`, so a placeholder never collapses or turns into a wall of bars. */
|
|
7
|
+
export const SKELETON_LINE_LIMITS = {
|
|
8
|
+
min: 1,
|
|
9
|
+
max: 6
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* After loading flips, resizes inside this window spring to the new height; later resizes (a font swap, a parent
|
|
13
|
+
* reflow) follow at once.
|
|
14
|
+
*/
|
|
15
|
+
export const SKELETON_MORPH_WINDOW_MS = 120;
|
|
16
|
+
/** Vertical travel, in pixels, of revealed content rising into place. */
|
|
17
|
+
export const SKELETON_REVEAL_OFFSET_PX = 4;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Tuning of Arc's Switch thumb, adapted from Arc (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md). */
|
|
2
|
+
/** Sizes the switch accepts; `default` is Arc's 42 by 24 track and `sm` a compact one for dense rows. */
|
|
3
|
+
export type SwitchSize = "default" | "sm";
|
|
4
|
+
/**
|
|
5
|
+
* Thumb geometry per size, in pixels: its resting width and how far it travels, which is the track's inner width
|
|
6
|
+
* minus the thumb. Keep in sync with the track and thumb sizes in `switch.tsx`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SWITCH_THUMB_GEOMETRY_PX: {
|
|
9
|
+
readonly default: {
|
|
10
|
+
readonly size: 18;
|
|
11
|
+
readonly travel: 18;
|
|
12
|
+
};
|
|
13
|
+
readonly sm: {
|
|
14
|
+
readonly size: 14;
|
|
15
|
+
readonly travel: 14;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
/** How far, in pixels, the thumb widens toward the other side while it is held down. */
|
|
19
|
+
export declare const SWITCH_PRESS_STRETCH_PX: {
|
|
20
|
+
readonly default: 5;
|
|
21
|
+
readonly sm: 4;
|
|
22
|
+
};
|
|
23
|
+
/** Critically damped glide: the thumb lands on its end without overshooting the state it reports. */
|
|
24
|
+
export declare const SWITCH_THUMB_GLIDE_SPRING: {
|
|
25
|
+
readonly type: "spring";
|
|
26
|
+
readonly visualDuration: 0.3;
|
|
27
|
+
readonly bounce: 0;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Brief horizontal stretch played when the state changes without a press (a controlled update or a label click), so
|
|
31
|
+
* the thumb reads as moving mass rather than a sliding dot.
|
|
32
|
+
*/
|
|
33
|
+
export declare const SWITCH_CHANGE_STRETCH: {
|
|
34
|
+
readonly scaleX: readonly [1, 1.16, 1];
|
|
35
|
+
readonly duration: 0.34;
|
|
36
|
+
readonly times: readonly [0, 0.4, 1];
|
|
37
|
+
readonly ease: readonly ["easeOut", "easeInOut"];
|
|
38
|
+
};
|
|
39
|
+
/** Window, in milliseconds, after a pointer or Space release in which a state change counts as caused by that press. */
|
|
40
|
+
export declare const SWITCH_PRESS_RELEASE_WINDOW_MS = 250;
|
|
41
|
+
/** Key that toggles a focused switch and stretches its thumb while held. */
|
|
42
|
+
export declare const SWITCH_TOGGLE_KEY = " ";
|
|
43
|
+
/** Mouse button that presses the switch: the primary one. */
|
|
44
|
+
export declare const SWITCH_PRIMARY_POINTER_BUTTON = 0;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thumb geometry per size, in pixels: its resting width and how far it travels, which is the track's inner width
|
|
3
|
+
* minus the thumb. Keep in sync with the track and thumb sizes in `switch.tsx`.
|
|
4
|
+
*/
|
|
5
|
+
export const SWITCH_THUMB_GEOMETRY_PX = {
|
|
6
|
+
default: {
|
|
7
|
+
size: 18,
|
|
8
|
+
travel: 18
|
|
9
|
+
},
|
|
10
|
+
sm: {
|
|
11
|
+
size: 14,
|
|
12
|
+
travel: 14
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/** How far, in pixels, the thumb widens toward the other side while it is held down. */
|
|
16
|
+
export const SWITCH_PRESS_STRETCH_PX = {
|
|
17
|
+
default: 5,
|
|
18
|
+
sm: 4
|
|
19
|
+
};
|
|
20
|
+
/** Critically damped glide: the thumb lands on its end without overshooting the state it reports. */
|
|
21
|
+
export const SWITCH_THUMB_GLIDE_SPRING = {
|
|
22
|
+
type: "spring",
|
|
23
|
+
visualDuration: .3,
|
|
24
|
+
bounce: 0
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Brief horizontal stretch played when the state changes without a press (a controlled update or a label click), so
|
|
28
|
+
* the thumb reads as moving mass rather than a sliding dot.
|
|
29
|
+
*/
|
|
30
|
+
export const SWITCH_CHANGE_STRETCH = {
|
|
31
|
+
scaleX: [
|
|
32
|
+
1,
|
|
33
|
+
1.16,
|
|
34
|
+
1
|
|
35
|
+
],
|
|
36
|
+
duration: .34,
|
|
37
|
+
times: [
|
|
38
|
+
0,
|
|
39
|
+
.4,
|
|
40
|
+
1
|
|
41
|
+
],
|
|
42
|
+
ease: ["easeOut", "easeInOut"]
|
|
43
|
+
};
|
|
44
|
+
/** Window, in milliseconds, after a pointer or Space release in which a state change counts as caused by that press. */
|
|
45
|
+
export const SWITCH_PRESS_RELEASE_WINDOW_MS = 250;
|
|
46
|
+
/** Key that toggles a focused switch and stretches its thumb while held. */
|
|
47
|
+
export const SWITCH_TOGGLE_KEY = " ";
|
|
48
|
+
/** Mouse button that presses the switch: the primary one. */
|
|
49
|
+
export const SWITCH_PRIMARY_POINTER_BUTTON = 0;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Tuning of Arc's Tabs: directional panel motion, height morph and active-tab reveal. */
|
|
2
|
+
/** Sign of the travel between two tabs: forward when the new tab sits after the previous one. */
|
|
3
|
+
export declare const TABS_DIRECTION: {
|
|
4
|
+
readonly forward: 1;
|
|
5
|
+
readonly backward: -1;
|
|
6
|
+
};
|
|
7
|
+
/** Distance, in px, an entering panel slides in from and a leaving panel slides out to. */
|
|
8
|
+
export declare const TABS_PANEL_OFFSET_PX: {
|
|
9
|
+
readonly enter: 8;
|
|
10
|
+
readonly exit: 6;
|
|
11
|
+
};
|
|
12
|
+
/** Fade-out, in seconds, of a leaving panel when motion is reduced. */
|
|
13
|
+
export declare const TABS_PANEL_REDUCED_EXIT_DURATION_S = 0.1;
|
|
14
|
+
/** Height differences up to this many px between panels jump instead of morphing. */
|
|
15
|
+
export declare const TABS_PANEL_HEIGHT_TOLERANCE_PX = 1;
|
|
16
|
+
/** Space, in px, kept between a revealed tab and the scrolled list edge: the list padding. */
|
|
17
|
+
export declare const TABS_REVEAL_MARGIN_PX = 4;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Tuning of Arc's Tabs: directional panel motion, height morph and active-tab reveal. */
|
|
2
|
+
/** Sign of the travel between two tabs: forward when the new tab sits after the previous one. */
|
|
3
|
+
export const TABS_DIRECTION = {
|
|
4
|
+
forward: 1,
|
|
5
|
+
backward: -1
|
|
6
|
+
};
|
|
7
|
+
/** Distance, in px, an entering panel slides in from and a leaving panel slides out to. */
|
|
8
|
+
export const TABS_PANEL_OFFSET_PX = {
|
|
9
|
+
enter: 8,
|
|
10
|
+
exit: 6
|
|
11
|
+
};
|
|
12
|
+
/** Fade-out, in seconds, of a leaving panel when motion is reduced. */
|
|
13
|
+
export const TABS_PANEL_REDUCED_EXIT_DURATION_S = .1;
|
|
14
|
+
/** Height differences up to this many px between panels jump instead of morphing. */
|
|
15
|
+
export const TABS_PANEL_HEIGHT_TOLERANCE_PX = 1;
|
|
16
|
+
/** Space, in px, kept between a revealed tab and the scrolled list edge: the list padding. */
|
|
17
|
+
export const TABS_REVEAL_MARGIN_PX = 4;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ArcFloatingMotion } from "../motion/arc-floating-slot.js";
|
|
2
|
+
/** Milliseconds of hover or focus before the first tooltip opens. */
|
|
3
|
+
export declare const TOOLTIP_OPEN_DELAY_MS = 250;
|
|
4
|
+
/** While a tooltip is open, and this many milliseconds after the last one closes, the next opens at once and only fades. */
|
|
5
|
+
export declare const TOOLTIP_SKIP_WINDOW_MS = 300;
|
|
6
|
+
/** Gap, in px, between the bubble and its trigger. */
|
|
7
|
+
export declare const TOOLTIP_SIDE_OFFSET_PX = 8;
|
|
8
|
+
/** Distance, in px, the bubble keeps from the viewport edges before it flips or shifts. */
|
|
9
|
+
export declare const TOOLTIP_COLLISION_PADDING_PX = 12;
|
|
10
|
+
/** The first tooltip rises 3px from its trigger while it scales up from .97. */
|
|
11
|
+
export declare const TOOLTIP_MOTION: ArcFloatingMotion;
|
|
12
|
+
/** Within the skip window the next tooltip only fades in, on the instant timing. */
|
|
13
|
+
export declare const TOOLTIP_INSTANT_MOTION: ArcFloatingMotion;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ARC_DURATION, ARC_EASE } from "../motion/arc-tokens.js";
|
|
2
|
+
/** Milliseconds of hover or focus before the first tooltip opens. */
|
|
3
|
+
export const TOOLTIP_OPEN_DELAY_MS = 250;
|
|
4
|
+
/** While a tooltip is open, and this many milliseconds after the last one closes, the next opens at once and only fades. */
|
|
5
|
+
export const TOOLTIP_SKIP_WINDOW_MS = 300;
|
|
6
|
+
/** Gap, in px, between the bubble and its trigger. */
|
|
7
|
+
export const TOOLTIP_SIDE_OFFSET_PX = 8;
|
|
8
|
+
/** Distance, in px, the bubble keeps from the viewport edges before it flips or shifts. */
|
|
9
|
+
export const TOOLTIP_COLLISION_PADDING_PX = 12;
|
|
10
|
+
const enterTween = {
|
|
11
|
+
duration: ARC_DURATION.fast,
|
|
12
|
+
ease: [...ARC_EASE.enter]
|
|
13
|
+
};
|
|
14
|
+
const instantTween = {
|
|
15
|
+
duration: ARC_DURATION.instant,
|
|
16
|
+
ease: [...ARC_EASE.standard]
|
|
17
|
+
};
|
|
18
|
+
/** The first tooltip rises 3px from its trigger while it scales up from .97. */
|
|
19
|
+
export const TOOLTIP_MOTION = {
|
|
20
|
+
enterFrom: {
|
|
21
|
+
travel: 3,
|
|
22
|
+
scale: .97,
|
|
23
|
+
opacity: 0
|
|
24
|
+
},
|
|
25
|
+
enter: {
|
|
26
|
+
transform: enterTween,
|
|
27
|
+
opacity: enterTween
|
|
28
|
+
},
|
|
29
|
+
exitTo: {
|
|
30
|
+
travel: 0,
|
|
31
|
+
scale: .98,
|
|
32
|
+
opacity: 0
|
|
33
|
+
},
|
|
34
|
+
exit: {
|
|
35
|
+
transform: instantTween,
|
|
36
|
+
opacity: instantTween
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
/** Within the skip window the next tooltip only fades in, on the instant timing. */
|
|
40
|
+
export const TOOLTIP_INSTANT_MOTION = {
|
|
41
|
+
enterFrom: {
|
|
42
|
+
travel: 0,
|
|
43
|
+
scale: 1,
|
|
44
|
+
opacity: 0
|
|
45
|
+
},
|
|
46
|
+
enter: {
|
|
47
|
+
transform: instantTween,
|
|
48
|
+
opacity: instantTween
|
|
49
|
+
},
|
|
50
|
+
exitTo: TOOLTIP_MOTION.exitTo,
|
|
51
|
+
exit: TOOLTIP_MOTION.exit
|
|
52
|
+
};
|