@veevarts/design-system 2.1.0-beta.23 → 2.1.0-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/components/Skeleton/Skeleton.d.ts +37 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.cjs +5 -5
- package/dist/index.js +2463 -2433
- package/dist/patterns/EntityRow/EntityList.d.ts +6 -0
- package/dist/providers/ToastProvider.d.ts +9 -4
- package/dist/test/reducedMotionCss.d.ts +40 -0
- package/package.json +1 -1
|
@@ -5,5 +5,11 @@ export declare const EntityList: React.FC<EntityListProps>;
|
|
|
5
5
|
* The list in skeleton form, at the same row height so nothing shifts when the
|
|
6
6
|
* rows arrive. The placeholder rows are hidden from assistive tech; `label` is
|
|
7
7
|
* announced once through a `role="status"` region instead.
|
|
8
|
+
*
|
|
9
|
+
* The root is `aria-busy`: the area is loading. `role="status"` stays on the
|
|
10
|
+
* label, not on the root, so the live region itself is never busy, which would
|
|
11
|
+
* let a screen reader hold its announcement back.
|
|
12
|
+
*
|
|
13
|
+
* The bars are the DS `Skeleton`, so their shimmer stops under reduced motion.
|
|
8
14
|
*/
|
|
9
15
|
export declare const EntityListSkeleton: React.FC<EntityListSkeletonProps>;
|
|
@@ -4,13 +4,18 @@ export type ToastProviderProps = ComponentProps<typeof BaseToastProvider>;
|
|
|
4
4
|
/**
|
|
5
5
|
* Drop-in for HeroUI's `ToastProvider` (same props, same `addToast` queue).
|
|
6
6
|
*
|
|
7
|
-
* - Titles wrap instead of truncating.
|
|
8
|
-
*
|
|
7
|
+
* - Titles wrap instead of truncating.
|
|
8
|
+
* - From `sm` up the toast takes the width its text needs, between 356px and
|
|
9
|
+
* `min(32rem, 100vw - 11rem)`, so it keeps up with a larger root font size.
|
|
10
|
+
* - The close button sits inside the toast, beside the title, always visible,
|
|
11
|
+
* as a 44px target.
|
|
12
|
+
* - A `toastProps.classNames` you pass is merged after these defaults, slot by
|
|
13
|
+
* slot, so it can still restyle any of them.
|
|
9
14
|
* - Animation is off when the OS or the POS asks for reduced motion, unless
|
|
10
15
|
* `disableAnimation` is passed.
|
|
11
16
|
*
|
|
12
17
|
* HeroUI merges an `addToast({ classNames })` over the provider's `classNames`
|
|
13
|
-
* as a whole object, so a per-toast `classNames`
|
|
14
|
-
*
|
|
18
|
+
* as a whole object, so a per-toast `classNames` drops these defaults for that
|
|
19
|
+
* toast: its title truncates again and its close button floats on the corner.
|
|
15
20
|
*/
|
|
16
21
|
export declare function ToastProvider({ toastProps, disableAnimation, ...props }: ToastProviderProps): JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Story helpers for checking a `motion-reduce:` utility in a real browser without changing the
|
|
3
|
+
* browser's media.
|
|
4
|
+
*
|
|
5
|
+
* A page cannot turn `prefers-reduced-motion` on for itself, and emulating it through the
|
|
6
|
+
* runner's CDP session changes the whole page, which Vitest shares between story files running
|
|
7
|
+
* in parallel: another story measuring its own animation in that window would read `none`. So
|
|
8
|
+
* the reduced-motion half is proved from the page's compiled CSS instead, which is what the
|
|
9
|
+
* browser applies anyway:
|
|
10
|
+
*
|
|
11
|
+
* 1. the element carries the still class;
|
|
12
|
+
* 2. that class sets `animation-name: none` inside `@media (prefers-reduced-motion: reduce)`;
|
|
13
|
+
* 3. it comes later in the stylesheet than the rule that starts the animation. Both are one class
|
|
14
|
+
* (plus the same pseudo-element), so at equal specificity the later rule wins.
|
|
15
|
+
*
|
|
16
|
+
* The motion-allowed half is read straight off `getComputedStyle`.
|
|
17
|
+
*/
|
|
18
|
+
export interface ReducedMotionCascade {
|
|
19
|
+
/** The element carries both classes. */
|
|
20
|
+
carriesBoth: boolean;
|
|
21
|
+
/** `animation-name` of the rule that starts the motion (e.g. `shimmer`), or `undefined`. */
|
|
22
|
+
movingAnimation: string | undefined;
|
|
23
|
+
/** `animation-name` the still class sets under reduced motion (`none`), or `undefined`. */
|
|
24
|
+
stillAnimation: string | undefined;
|
|
25
|
+
/** The still rule is later in the cascade than the moving one, so it wins. */
|
|
26
|
+
stillComesLater: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* What the stylesheets say happens to `movingClass`'s animation on `element` (or its `pseudo`)
|
|
30
|
+
* when the OS asks for reduced motion and `stillClass` is the utility meant to stop it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function reducedMotionCascade(element: Element, { movingClass, stillClass, pseudo }: {
|
|
33
|
+
movingClass: string;
|
|
34
|
+
stillClass: string;
|
|
35
|
+
pseudo?: '' | '::before';
|
|
36
|
+
}): ReducedMotionCascade;
|
|
37
|
+
/** Whether the reader's OS currently asks for reduced motion (the Storybook UI is theirs). */
|
|
38
|
+
export declare function osReducesMotion(): boolean;
|
|
39
|
+
/** The `animation-name` running on an element's `::before`, where HeroUI draws the skeleton shimmer. */
|
|
40
|
+
export declare function beforeAnimationName(element: Element): string;
|