@veevarts/design-system 2.28.0 → 2.29.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/dist/index.cjs +6 -6
- package/dist/index.js +4604 -4536
- package/dist/patterns/DonationAmounts/index.d.ts +1 -1
- package/dist/patterns/DonationAmounts/styles.d.ts +19 -0
- package/dist/patterns/DonationAmounts/types.d.ts +24 -0
- package/dist/patterns/DonationAmounts/utils/currency.d.ts +16 -0
- package/dist/patterns/UnderlineTabs/UnderlineTabs.d.ts +11 -3
- package/dist/patterns/UnderlineTabs/styles.d.ts +7 -1
- package/dist/patterns/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
@@ -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
|
-
/**
|
|
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";
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -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';
|