@veevarts/design-system 2.1.0-beta.22 → 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.
@@ -5,5 +5,5 @@
5
5
  * Ensures exclusive selection (preset OR custom).
6
6
  */
7
7
  export { DonationAmounts } from './DonationAmounts';
8
- export type { DonationAmount, SelectedDonation, DonationLabels, DonationAmountsProps, DonationAmountsVariant, } from './types';
8
+ export type { DonationAmount, SelectedDonation, DonationLabels, DonationAmountsProps, DonationAmountsVariant, DonationAmountsCustomAmountPlacement, } from './types';
9
9
  export { formatCurrency, parseCurrency } from './utils/currency';
@@ -20,6 +20,25 @@ interface VariantSlots {
20
20
  input: string;
21
21
  }
22
22
  export declare const donationAmountsSlots: Record<TiledVariant, VariantSlots>;
23
+ /**
24
+ * `customAmountPlacement="inline"` on `tile`: the Quick entry amount row
25
+ * (`Main.dc.html`, `QMDonation.dc.html`), merged over the `tile` slots.
26
+ *
27
+ * One wrapping flex row instead of the grid: tiles `flex: 1 1 4.5rem`, the
28
+ * field `flex: 2 1 10rem`, 8px apart, as the mockup lays them out. Tiles and
29
+ * field are both the mockup's 3rem (`min-h-12` drops the tile's own padding
30
+ * height, `h-12` the field's `size` height), so the row lines up. The field
31
+ * keeps the `tile` hairline, radius, padding and focus ring; its digits are
32
+ * the mockup's 15px and the symbol beside them 14px in the neutral tone.
33
+ */
34
+ export declare const donationAmountsInline: {
35
+ row: string;
36
+ preset: string;
37
+ field: string;
38
+ inputWrapper: string;
39
+ input: string;
40
+ affix: string;
41
+ };
23
42
  /**
24
43
  * What `size` changes in `tile` and `pos`: the custom field's height and text.
25
44
  * `md` is the mockup's field (38px in `tile`, 40px in `pos`); `sm` and `lg`
@@ -39,6 +39,18 @@ export interface DonationAmount {
39
39
  * and a visible label over the custom input.
40
40
  */
41
41
  export type DonationAmountsVariant = 'pill' | 'tile' | 'pos';
42
+ /**
43
+ * Where the `tile` variant puts the custom amount field.
44
+ *
45
+ * - `below` (default): a row of its own under the preset grid.
46
+ * - `inline`: the last item of the preset row, the Quick entry amount row
47
+ * (`Main.dc.html`, `QMDonation.dc.html`). Tiles share the row evenly and
48
+ * the field takes twice a tile's share; the row wraps, so in a narrow
49
+ * column the field drops to a full-width line of its own. Tiles and field
50
+ * are both 48px tall, and the currency symbol sits beside the digits on the
51
+ * side the locale puts it, so the field shows "$ Other amount".
52
+ */
53
+ export type DonationAmountsCustomAmountPlacement = 'below' | 'inline';
42
54
  /**
43
55
  * Selected donation value (can be preset or custom)
44
56
  */
@@ -196,6 +208,18 @@ export interface DonationAmountsProps {
196
208
  * @default 'pill'
197
209
  */
198
210
  variant?: DonationAmountsVariant;
211
+ /**
212
+ * Where the custom amount field sits. See
213
+ * {@link DonationAmountsCustomAmountPlacement}. `tile` variant only.
214
+ *
215
+ * `inline` lays the presets out as one wrapping row, so `mobileColumns`
216
+ * and `desktopColumns` do not apply, and it has no room for
217
+ * `labels.customAmountLabel` above the field: when set, that label names
218
+ * the field instead. The preset group then holds the field too, so name it
219
+ * for the whole amount (`labels.title` or `labels.presetsAriaLabel`).
220
+ * @default 'below'
221
+ */
222
+ customAmountPlacement?: DonationAmountsCustomAmountPlacement;
199
223
  /**
200
224
  * Marks the title as required with a danger asterisk (`tile` and `pos`
201
225
  * variants). The asterisk is decorative; announce the requirement through
@@ -17,6 +17,22 @@
17
17
  * formatCurrency(5, 'en-US', 'USD', false) // "$5.00"
18
18
  */
19
19
  export declare function formatCurrency(amount: number, locale?: string, currency?: string, trimZeroCents?: boolean): string;
20
+ /**
21
+ * What a field that draws the currency symbol beside the digits needs: the
22
+ * symbol, the side of the digits `locale` puts it on ("$" before in en-US,
23
+ * "$" after in fr-CA), and number formatting with the currency's own fraction
24
+ * digits but no symbol, so the field never shows it twice.
25
+ *
26
+ * @example
27
+ * currencyAffix('en-US', 'USD') // { symbol: '$', position: 'start', formatOptions: { ..., minimumFractionDigits: 2 } }
28
+ * currencyAffix('fr-FR', 'EUR') // { symbol: '€', position: 'end', ... }
29
+ * currencyAffix('ja-JP', 'JPY') // { symbol: '¥', position: 'start', formatOptions: { ..., maximumFractionDigits: 0 } }
30
+ */
31
+ export declare function currencyAffix(locale?: string, currency?: string): {
32
+ symbol: string;
33
+ position: 'start' | 'end';
34
+ formatOptions: Intl.NumberFormatOptions;
35
+ };
20
36
  /**
21
37
  * Parses a currency string to a number
22
38
  * @param value - The currency string to parse
@@ -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>;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- export type UnderlineTabsSize = 'md' | 'sm';
2
+ export type UnderlineTabsSize = 'md' | 'lg' | 'sm';
3
3
  /**
4
4
  * `primary`: the page's own tabs; the selected label turns ink.
5
5
  * `secondary`: tabs nested inside a section; flush, padded, semibold, the
@@ -37,14 +37,22 @@ export interface UnderlineTabsProps<K extends string = string> {
37
37
  onChange: (key: K) => void;
38
38
  /** Names the tablist. Required — an unnamed tablist gives no context. */
39
39
  ariaLabel: string;
40
- /** `md` (default): the back-office strip. `sm`: the Quick Donation / Quick Membership strip. */
40
+ /**
41
+ * `md` (default): the back-office strip. `sm`: the Quick Donation / Quick
42
+ * Membership strip. `lg`: the Quick entry header strip.
43
+ */
41
44
  size?: UnderlineTabsSize;
42
45
  /** See {@link UnderlineTabsLevel}. Default `primary`. Read by `size="sm"` only. */
43
46
  level?: UnderlineTabsLevel;
47
+ /**
48
+ * `true` (default): the strip draws its hairline and keeps its gap to what
49
+ * follows. `false`: neither, for a strip at the foot of a card.
50
+ */
51
+ showDivider?: boolean;
44
52
  className?: string;
45
53
  'data-testid'?: string;
46
54
  }
47
- export declare function UnderlineTabs<K extends string = string>({ items, value, onChange, ariaLabel, size, level, className, 'data-testid': dataTestId, }: UnderlineTabsProps<K>): import("react/jsx-runtime").JSX.Element;
55
+ export declare function UnderlineTabs<K extends string = string>({ items, value, onChange, ariaLabel, size, level, showDivider, className, 'data-testid': dataTestId, }: UnderlineTabsProps<K>): import("react/jsx-runtime").JSX.Element;
48
56
  export declare namespace UnderlineTabs {
49
57
  var displayName: string;
50
58
  }
@@ -5,6 +5,12 @@ export interface UnderlineTabsSlots {
5
5
  tab: string;
6
6
  tabContent: string;
7
7
  }
8
- export declare const underlineTabsSlots: Record<'md' | 'sm-primary' | 'sm-secondary', UnderlineTabsSlots>;
8
+ export declare const underlineTabsSlots: Record<'md' | 'lg' | 'sm-primary' | 'sm-secondary', UnderlineTabsSlots>;
9
+ /**
10
+ * Merged over any look by `showDivider={false}`: no hairline under the strip
11
+ * and no gap after it. `md` draws its hairline on the list, the other looks on
12
+ * `base`, so both slots drop theirs (and `-mb-px`, which only overlapped it).
13
+ */
14
+ export declare const underlineTabsNoDivider: Pick<UnderlineTabsSlots, 'base' | 'tabList'>;
9
15
  /** Added to the `md` cursor under reduced motion: it jumps instead of sliding. */
10
16
  export declare const stillCursorClass = "data-[animated=true]:transition-none";
@@ -12,7 +12,7 @@ export type { MultiselectProps } from './Multiselect';
12
12
  export { RichTextArea, RICH_TEXT_PRESETS } from './RichText';
13
13
  export type { RichTextAreaProps } from './RichText';
14
14
  export { DonationAmounts } from './DonationAmounts';
15
- export type { DonationAmountsProps, DonationAmount, SelectedDonation, DonationLabels, DonationAmountsVariant, } from './DonationAmounts';
15
+ export type { DonationAmountsProps, DonationAmount, SelectedDonation, DonationLabels, DonationAmountsVariant, DonationAmountsCustomAmountPlacement, } from './DonationAmounts';
16
16
  export { ExpireCartTimer } from './ExpireCartTimer';
17
17
  export type { ExpireCartTimerProps } from './ExpireCartTimer';
18
18
  export { EventDetails } from './Programs/EventDetails';
@@ -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. A `toastProps.classNames.title` you pass
8
- * is merged after the default, so it can still restyle the title.
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` without a `title` key brings
14
- * the truncation back for that toast.
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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veevarts/design-system",
3
3
  "private": false,
4
- "version": "2.1.0-beta.22",
4
+ "version": "2.1.0-beta.24",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",