@veevarts/design-system 1.16.0 → 1.17.0-alpha.2
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 +12 -0
- package/dist/components/AppliedCodeCard/AppliedCodeCard.d.ts +13 -0
- package/dist/components/AppliedCodeCard/index.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.d.ts +17 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/RedeemCodeInput/RedeemCodeInput.d.ts +21 -0
- package/dist/components/RedeemCodeInput/index.d.ts +2 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/index.cjs +10 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8346 -7160
- package/dist/patterns/AdminTable/AdminTable.d.ts +42 -0
- package/dist/patterns/AdminTable/index.d.ts +3 -0
- package/dist/patterns/AdminTable/styles.d.ts +34 -0
- package/dist/patterns/AdminTextField/AdminTextField.d.ts +39 -0
- package/dist/patterns/AdminTextField/index.d.ts +3 -0
- package/dist/patterns/AdminTextField/styles.d.ts +35 -0
- package/dist/patterns/AdminToolbar/AdminToolbar.d.ts +18 -0
- package/dist/patterns/AdminToolbar/index.d.ts +2 -0
- package/dist/patterns/ConfirmDialog/ConfirmDialog.d.ts +22 -9
- package/dist/patterns/ConfirmDialog/index.d.ts +1 -1
- package/dist/patterns/DimensionChip/index.d.ts +13 -0
- package/dist/patterns/InstallmentFundAssignment/InstallmentFundAssignment.d.ts +1 -1
- package/dist/patterns/InstallmentFundAssignment/types.d.ts +1 -0
- package/dist/patterns/InstallmentSchedule/InstallmentTable.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/index.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/types.d.ts +14 -1
- package/dist/patterns/KeyValueChip/KeyValueChip.d.ts +12 -0
- package/dist/patterns/KeyValueChip/index.d.ts +2 -0
- package/dist/patterns/ListPanel/ListPanel.d.ts +45 -0
- package/dist/patterns/ListPanel/index.d.ts +2 -0
- package/dist/patterns/OfferCard/OfferCard.d.ts +1 -1
- package/dist/patterns/OfferCard/types.d.ts +23 -0
- package/dist/patterns/PageHeader/PageHeader.d.ts +33 -0
- package/dist/patterns/PageHeader/index.d.ts +2 -0
- package/dist/patterns/PaginationSummary/PaginationSummary.d.ts +26 -0
- package/dist/patterns/PaginationSummary/index.d.ts +3 -0
- package/dist/patterns/PaginationSummary/page-range.d.ts +19 -0
- package/dist/patterns/PickerRow/PickerRow.d.ts +27 -0
- package/dist/patterns/PickerRow/index.d.ts +2 -0
- package/dist/patterns/RowActions/RowActions.d.ts +17 -0
- package/dist/patterns/RowActions/index.d.ts +2 -0
- package/dist/patterns/StatusChip/StatusChip.d.ts +28 -0
- package/dist/patterns/StatusChip/index.d.ts +2 -0
- package/dist/patterns/Summary/components/CollapseHeader.d.ts +6 -0
- package/dist/patterns/Summary/components/TotalsLineRow.d.ts +6 -2
- package/dist/patterns/Summary/index.d.ts +1 -1
- package/dist/patterns/Summary/types.d.ts +31 -6
- package/dist/patterns/TableSkeleton/TableSkeleton.d.ts +32 -0
- package/dist/patterns/TableSkeleton/index.d.ts +2 -0
- package/dist/patterns/UnderlineTabs/UnderlineTabs.d.ts +18 -0
- package/dist/patterns/UnderlineTabs/index.d.ts +2 -0
- package/dist/patterns/grid-columns.d.ts +10 -0
- package/dist/patterns/index.d.ts +28 -2
- package/dist/tailwind/index.d.ts +4 -0
- package/dist/tailwind/index.js +68 -1
- package/dist/tokens/admin-surface.d.ts +58 -0
- package/dist/tokens/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Total + CTA, and a compact mobile bottom-bar.
|
|
5
5
|
*/
|
|
6
6
|
export { Summary } from './Summary';
|
|
7
|
-
export type { SummaryProps, SummaryLineItem, SummaryItemDetail, SummaryServiceFee, SummaryTotalRow, SummaryPrimaryAction, SummaryLabels, Money, } from './types';
|
|
7
|
+
export type { SummaryProps, SummaryLineItem, SummaryItemDetail, SummaryServiceFee, SummaryTotalRow, SummaryPostTotalRow, SummaryPrimaryAction, SummaryLabels, Money, } from './types';
|
|
@@ -73,6 +73,16 @@ export interface SummaryTotalRow {
|
|
|
73
73
|
label: ReactNode;
|
|
74
74
|
amount: Money;
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* A post-total row — the same flat shape as {@link SummaryTotalRow}, plus an
|
|
78
|
+
* optional `id` that (together with `onRemovePostTotalRow`) enables the same
|
|
79
|
+
* trash remove control the line items use. Kept as its own interface so the
|
|
80
|
+
* pre-total `rows` — where an id/remove has no meaning — stay untouched.
|
|
81
|
+
*/
|
|
82
|
+
export interface SummaryPostTotalRow extends SummaryTotalRow {
|
|
83
|
+
/** Stable id; when set and `onRemovePostTotalRow` exists, the row shows the remove control. */
|
|
84
|
+
id?: string;
|
|
85
|
+
}
|
|
76
86
|
/** The primary call-to-action (orange pill + arrow). */
|
|
77
87
|
export interface SummaryPrimaryAction {
|
|
78
88
|
label: ReactNode;
|
|
@@ -84,6 +94,8 @@ export interface SummaryPrimaryAction {
|
|
|
84
94
|
export interface SummaryLabels {
|
|
85
95
|
/** Aria label for the per-item remove control. Default "Remove item". */
|
|
86
96
|
removeAriaLabel?: string;
|
|
97
|
+
/** Aria label for the per-post-total-row remove control. Default "Remove applied code". */
|
|
98
|
+
removePostTotalRowAriaLabel?: string;
|
|
87
99
|
/** Aria label for the collapse/expand press target. Default "Toggle summary". */
|
|
88
100
|
toggleAriaLabel?: string;
|
|
89
101
|
/** Aria label for the mobile cart button. Default "View cart". */
|
|
@@ -146,9 +158,19 @@ export interface SummaryProps {
|
|
|
146
158
|
amount: Money;
|
|
147
159
|
};
|
|
148
160
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
161
|
+
* Optional flat rows rendered BETWEEN the Total and the secondary total —
|
|
162
|
+
* e.g. applied gift cards as tenders ("Gift Card · …XWDG −$50.00"). Same
|
|
163
|
+
* shape and flat style as `rows`; negative amounts are passed as data,
|
|
164
|
+
* exactly like a Discounts line. The Total itself is never affected. Rows
|
|
165
|
+
* with an `id` show the trash remove control when `onRemovePostTotalRow`
|
|
166
|
+
* is provided (same gating as the item remove, incl. `showRemoveButton`).
|
|
167
|
+
*/
|
|
168
|
+
postTotalRows?: SummaryPostTotalRow[];
|
|
169
|
+
/**
|
|
170
|
+
* An optional secondary total rendered under the Total (after any
|
|
171
|
+
* `postTotalRows`), in the primary color (e.g. "Due Today"). Purely
|
|
172
|
+
* presentational — the host supplies both the label and the
|
|
173
|
+
* already-computed amount.
|
|
152
174
|
*/
|
|
153
175
|
secondaryTotal?: {
|
|
154
176
|
label: ReactNode;
|
|
@@ -160,9 +182,10 @@ export interface SummaryProps {
|
|
|
160
182
|
*/
|
|
161
183
|
ctaCaption?: ReactNode;
|
|
162
184
|
/**
|
|
163
|
-
* Whether the
|
|
164
|
-
*
|
|
165
|
-
* `onRemoveItem`
|
|
185
|
+
* Whether the remove (trash) controls are shown — per-item and
|
|
186
|
+
* per-post-total-row alike. Defaults to `true`; pass `false` to hide them
|
|
187
|
+
* even when `onRemoveItem` / `onRemovePostTotalRow` are wired. Independent
|
|
188
|
+
* of the handlers so a host can keep them but suppress the controls.
|
|
166
189
|
*/
|
|
167
190
|
showRemoveButton?: boolean;
|
|
168
191
|
/**
|
|
@@ -190,6 +213,8 @@ export interface SummaryProps {
|
|
|
190
213
|
primaryAction?: SummaryPrimaryAction;
|
|
191
214
|
/** When provided, item rows show a red trash remove control. */
|
|
192
215
|
onRemoveItem?: (id: string) => void;
|
|
216
|
+
/** When provided, post-total rows with an `id` show the same red trash remove control. */
|
|
217
|
+
onRemovePostTotalRow?: (id: string) => void;
|
|
193
218
|
/**
|
|
194
219
|
* Layout: full card (`'main'`) or the bottom-sheet / compact bar (`'mobile'`).
|
|
195
220
|
* When OMITTED the layout is auto-detected from the viewport (below `md`
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface TableSkeletonClassNames {
|
|
3
|
+
base?: string;
|
|
4
|
+
row?: string;
|
|
5
|
+
bar?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TableSkeletonProps {
|
|
8
|
+
/**
|
|
9
|
+
* One entry per column, giving that column's bar width.
|
|
10
|
+
*
|
|
11
|
+
* A number is a pixel width; `'fill'` makes the column take the remaining
|
|
12
|
+
* space, for the one text column that should stretch. Widths approximating
|
|
13
|
+
* the real content are what stop the layout shifting on load.
|
|
14
|
+
*/
|
|
15
|
+
columns: Array<number | 'fill'>;
|
|
16
|
+
/** How many placeholder rows to draw. Default 6. */
|
|
17
|
+
rows?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Announced while loading. Give it something specific ("Loading
|
|
20
|
+
* dimensions"); it is the only thing a screen reader gets from this
|
|
21
|
+
* component, since the bars themselves are hidden.
|
|
22
|
+
*/
|
|
23
|
+
label?: string;
|
|
24
|
+
/** Height of each bar in pixels. Default 12. */
|
|
25
|
+
barHeight?: number;
|
|
26
|
+
/** Right-aligns the last column's bar, for a trailing numeric or actions column. */
|
|
27
|
+
alignLastRight?: boolean;
|
|
28
|
+
className?: string;
|
|
29
|
+
classNames?: TableSkeletonClassNames;
|
|
30
|
+
'data-testid'?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const TableSkeleton: React.FC<TableSkeletonProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface UnderlineTabItem<K extends string = string> {
|
|
3
|
+
key: K;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export interface UnderlineTabsProps<K extends string = string> {
|
|
7
|
+
items: UnderlineTabItem<K>[];
|
|
8
|
+
value: K;
|
|
9
|
+
onChange: (key: K) => void;
|
|
10
|
+
/** Names the tablist. Required — an unnamed tablist gives no context. */
|
|
11
|
+
ariaLabel: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
'data-testid'?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function UnderlineTabs<K extends string = string>({ items, value, onChange, ariaLabel, className, 'data-testid': dataTestId, }: UnderlineTabsProps<K>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare namespace UnderlineTabs {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared responsive grid-column class maps for the card-picker patterns
|
|
3
|
+
* (TileSelect, and previously CheckboxCardGroup). Kept in one
|
|
4
|
+
* place so the two siblings never drift on breakpoints or column counts.
|
|
5
|
+
*
|
|
6
|
+
* The literal Tailwind classes must stay spelled out (not interpolated) so
|
|
7
|
+
* the JIT scanner keeps generating them.
|
|
8
|
+
*/
|
|
9
|
+
export declare const GRID_DESKTOP_COLS: Record<2 | 3 | 4, string>;
|
|
10
|
+
export declare const GRID_MOBILE_COLS: Record<1 | 2, string>;
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -41,6 +41,32 @@ export { FilterPopover } from './FilterPopover';
|
|
|
41
41
|
export type * from './FilterPopover';
|
|
42
42
|
export { SessionTimeline } from './SessionTimeline';
|
|
43
43
|
export type * from './SessionTimeline';
|
|
44
|
+
export { PageHeader } from './PageHeader';
|
|
45
|
+
export type { PageHeaderProps, PageHeaderClassNames } from './PageHeader';
|
|
46
|
+
export { StatusChip } from './StatusChip';
|
|
47
|
+
export type { StatusChipProps, StatusChipStatus } from './StatusChip';
|
|
48
|
+
export { KeyValueChip } from './KeyValueChip';
|
|
49
|
+
export type { KeyValueChipProps } from './KeyValueChip';
|
|
50
|
+
export { DimensionChip } from './DimensionChip';
|
|
51
|
+
export type { DimensionChipProps } from './DimensionChip';
|
|
52
|
+
export { TableSkeleton } from './TableSkeleton';
|
|
53
|
+
export type { TableSkeletonProps, TableSkeletonClassNames } from './TableSkeleton';
|
|
54
|
+
export { AdminTable, adminRowClass, adminTableClass, adminTableFooterClass, adminTdClass, adminThClass, } from './AdminTable';
|
|
55
|
+
export type { AdminTableProps, AdminTableColumn, AdminTableClassNames } from './AdminTable';
|
|
56
|
+
export { AdminToolbar } from './AdminToolbar';
|
|
57
|
+
export type { AdminToolbarProps } from './AdminToolbar';
|
|
58
|
+
export { UnderlineTabs } from './UnderlineTabs';
|
|
59
|
+
export type { UnderlineTabsProps, UnderlineTabItem } from './UnderlineTabs';
|
|
60
|
+
export { AdminTextField, adminFieldErrorClass, adminFieldHintClass, adminFieldLabelClass, adminInputClass, adminInputReadOnlyClass, adminInputWrapperClass, } from './AdminTextField';
|
|
61
|
+
export type { AdminTextFieldProps } from './AdminTextField';
|
|
62
|
+
export { RowActions } from './RowActions';
|
|
63
|
+
export type { RowActionsProps, RowAction } from './RowActions';
|
|
64
|
+
export { PickerRow } from './PickerRow';
|
|
65
|
+
export type { PickerRowProps } from './PickerRow';
|
|
66
|
+
export { PaginationSummary, pageRange } from './PaginationSummary';
|
|
67
|
+
export type { PaginationSummaryProps, PaginationSummaryClassNames } from './PaginationSummary';
|
|
68
|
+
export { ListPanel } from './ListPanel';
|
|
69
|
+
export type { ListPanelProps, ListPanelClassNames } from './ListPanel';
|
|
44
70
|
export { CashTenderForm } from './CashTenderForm';
|
|
45
71
|
export type { CashTenderFormProps, CashTenderValue, CashTenderLabels, } from './CashTenderForm';
|
|
46
72
|
export { CheckTenderForm } from './CheckTenderForm';
|
|
@@ -64,6 +90,6 @@ export type { PaymentCashChangeBannerProps } from './PaymentCashChangeBanner';
|
|
|
64
90
|
export { PaymentSubAmountInput } from './PaymentSubAmountInput';
|
|
65
91
|
export type { PaymentSubAmountInputProps } from './PaymentSubAmountInput';
|
|
66
92
|
export { ConfirmDialog } from './ConfirmDialog';
|
|
67
|
-
export type { ConfirmDialogProps } from './ConfirmDialog';
|
|
93
|
+
export type { ConfirmDialogProps, ConfirmDialogVariant } from './ConfirmDialog';
|
|
68
94
|
export { Summary } from './Summary';
|
|
69
|
-
export type { SummaryProps, SummaryLineItem, SummaryItemDetail, SummaryServiceFee, SummaryTotalRow, SummaryPrimaryAction, SummaryLabels, } from './Summary';
|
|
95
|
+
export type { SummaryProps, SummaryLineItem, SummaryItemDetail, SummaryServiceFee, SummaryTotalRow, SummaryPostTotalRow, SummaryPrimaryAction, SummaryLabels, } from './Summary';
|
package/dist/tailwind/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { colors } from '../tokens/colors';
|
|
|
2
2
|
import { typography } from '../tokens/typography';
|
|
3
3
|
import { spacing } from '../tokens/spacing';
|
|
4
4
|
export { colors, typography, spacing };
|
|
5
|
+
export { adminSurfaceCss, adminSurfaceTokens, adminSurfaceTailwindColors } from '../tokens/admin-surface';
|
|
5
6
|
export interface ColorPalette {
|
|
6
7
|
50: string;
|
|
7
8
|
100: string;
|
|
@@ -45,6 +46,7 @@ export interface HeroUIConfig {
|
|
|
45
46
|
*/
|
|
46
47
|
export declare const tailwindTheme: {
|
|
47
48
|
colors: {
|
|
49
|
+
acct: Record<string, string>;
|
|
48
50
|
secondary: "#000000";
|
|
49
51
|
success: "#057A54";
|
|
50
52
|
warning: "#F5A524";
|
|
@@ -245,6 +247,7 @@ export declare const veevartPreset: {
|
|
|
245
247
|
theme: {
|
|
246
248
|
extend: {
|
|
247
249
|
colors: {
|
|
250
|
+
acct: Record<string, string>;
|
|
248
251
|
secondary: "#000000";
|
|
249
252
|
success: "#057A54";
|
|
250
253
|
warning: "#F5A524";
|
|
@@ -475,6 +478,7 @@ export declare const tokens: {
|
|
|
475
478
|
};
|
|
476
479
|
tailwindTheme: {
|
|
477
480
|
colors: {
|
|
481
|
+
acct: Record<string, string>;
|
|
478
482
|
secondary: "#000000";
|
|
479
483
|
success: "#057A54";
|
|
480
484
|
warning: "#F5A524";
|
package/dist/tailwind/index.js
CHANGED
|
@@ -20,6 +20,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/tailwind/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
adminSurfaceCss: () => adminSurfaceCss,
|
|
24
|
+
adminSurfaceTailwindColors: () => adminSurfaceTailwindColors,
|
|
25
|
+
adminSurfaceTokens: () => adminSurfaceTokens,
|
|
23
26
|
colors: () => colors,
|
|
24
27
|
createHeroUIConfig: () => createHeroUIConfig,
|
|
25
28
|
deepMerge: () => deepMerge,
|
|
@@ -209,12 +212,73 @@ var spacing = {
|
|
|
209
212
|
// 128px
|
|
210
213
|
};
|
|
211
214
|
|
|
215
|
+
// src/tokens/admin-surface.ts
|
|
216
|
+
var { gray } = colors.neutral;
|
|
217
|
+
var WARNING_TEXT = colors.palettes.warning[700];
|
|
218
|
+
var WARNING_FILL = colors.palettes.warning[100];
|
|
219
|
+
var SIGNED_OFF = {
|
|
220
|
+
rustFill: "#FBEBE4",
|
|
221
|
+
rustBorder: "#EBC3B1",
|
|
222
|
+
page: "#F6F7F8",
|
|
223
|
+
border: "#E7E9EC",
|
|
224
|
+
hair: "#EEF0F2",
|
|
225
|
+
okFill: "#E6F4EF",
|
|
226
|
+
dangerFill: "#FBEAE8",
|
|
227
|
+
infoFill: "#E8EEFC"
|
|
228
|
+
};
|
|
229
|
+
var adminSurfaceTokens = {
|
|
230
|
+
// Brand — the 500 already matches the scale exactly.
|
|
231
|
+
"--rust": colors.brand.primary[500],
|
|
232
|
+
"--rust-fill": SIGNED_OFF.rustFill,
|
|
233
|
+
"--rust-border": SIGNED_OFF.rustBorder,
|
|
234
|
+
// Chrome
|
|
235
|
+
"--page": SIGNED_OFF.page,
|
|
236
|
+
"--surface": colors.neutral.white,
|
|
237
|
+
"--border": SIGNED_OFF.border,
|
|
238
|
+
"--hair": SIGNED_OFF.hair,
|
|
239
|
+
// Text — all four match the scale's grays exactly.
|
|
240
|
+
"--ink": gray[900],
|
|
241
|
+
"--ink2": gray[700],
|
|
242
|
+
"--sub": gray[500],
|
|
243
|
+
"--muted": gray[400],
|
|
244
|
+
// Semantic — text tone paired with the tint it sits on.
|
|
245
|
+
"--ok": colors.semantic.success,
|
|
246
|
+
"--ok-fill": SIGNED_OFF.okFill,
|
|
247
|
+
"--warn": WARNING_TEXT,
|
|
248
|
+
"--warn-fill": WARNING_FILL,
|
|
249
|
+
"--danger": colors.semantic.danger,
|
|
250
|
+
"--danger-fill": SIGNED_OFF.dangerFill,
|
|
251
|
+
"--info": colors.semantic.info,
|
|
252
|
+
"--info-fill": SIGNED_OFF.infoFill
|
|
253
|
+
};
|
|
254
|
+
var adminSurfaceTailwindColors = Object.fromEntries(
|
|
255
|
+
Object.entries(adminSurfaceTokens).map(([name, value]) => [name.replace(/^--/, ""), value])
|
|
256
|
+
);
|
|
257
|
+
function adminSurfaceCss({
|
|
258
|
+
scope = ".acct",
|
|
259
|
+
fontFamily = "'NeueMontreal', system-ui, sans-serif"
|
|
260
|
+
} = {}) {
|
|
261
|
+
const declarations = Object.entries(adminSurfaceTokens).map(([name, value]) => ` ${name}: ${value};`).join("\n");
|
|
262
|
+
const typography2 = fontFamily ? `
|
|
263
|
+
font-family: ${fontFamily};
|
|
264
|
+
color: var(--ink);` : "";
|
|
265
|
+
return `${scope} {
|
|
266
|
+
${declarations}${typography2}
|
|
267
|
+
}
|
|
268
|
+
`;
|
|
269
|
+
}
|
|
270
|
+
|
|
212
271
|
// src/tailwind/index.ts
|
|
213
272
|
var tailwindTheme = {
|
|
214
273
|
colors: {
|
|
215
274
|
...colors.brand,
|
|
216
275
|
...colors.neutral,
|
|
217
|
-
...colors.semantic
|
|
276
|
+
...colors.semantic,
|
|
277
|
+
// Back-office surface palette, namespaced so `border`/`page`/`info` do
|
|
278
|
+
// not collide with Tailwind's own utility grammar. Sourced from the
|
|
279
|
+
// same object that emits the CSS custom properties, so the utility and
|
|
280
|
+
// the property cannot disagree. See src/tokens/admin-surface.ts.
|
|
281
|
+
acct: adminSurfaceTailwindColors
|
|
218
282
|
},
|
|
219
283
|
fontFamily: typography.fontFamily,
|
|
220
284
|
spacing,
|
|
@@ -298,6 +362,9 @@ var tokens = {
|
|
|
298
362
|
};
|
|
299
363
|
// Annotate the CommonJS export names for ESM import in node:
|
|
300
364
|
0 && (module.exports = {
|
|
365
|
+
adminSurfaceCss,
|
|
366
|
+
adminSurfaceTailwindColors,
|
|
367
|
+
adminSurfaceTokens,
|
|
301
368
|
colors,
|
|
302
369
|
createHeroUIConfig,
|
|
303
370
|
deepMerge,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The admin-surface palette, as CSS custom properties.
|
|
3
|
+
*
|
|
4
|
+
* WHY A SECOND OUTPUT FORMAT. The rest of the Design System reaches its colours
|
|
5
|
+
* through Tailwind utilities, which only works when the consuming app scans the
|
|
6
|
+
* DS `dist` in its Tailwind `content` globs. The domain packages that render
|
|
7
|
+
* back-office screens cannot rely on that: `@veevart/accounting` is absent from
|
|
8
|
+
* the portal's globs, so any utility class written there is purged from the
|
|
9
|
+
* bundle, and the Salesforce Canvas embed builds its CSS separately again. Those
|
|
10
|
+
* surfaces therefore style through inline styles over a scoped `<style>` block,
|
|
11
|
+
* and what they need from us is custom properties, not classes.
|
|
12
|
+
*
|
|
13
|
+
* The values come from `colors` — the same object that feeds the Tailwind
|
|
14
|
+
* preset. That is the whole point: before this existed, the admin palette lived
|
|
15
|
+
* inside `@veevart/accounting` as a hand-written block, got copied to a second
|
|
16
|
+
* screen, then a third and a fourth, and had already lost a token in one copy
|
|
17
|
+
* and forked `warning` away from ours. A palette owned by a domain package is a
|
|
18
|
+
* palette that forks.
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* <style dangerouslySetInnerHTML={{ __html: adminSurfaceCss() }} />
|
|
22
|
+
* <div className="acct">…</div>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
/** Token name → value. Exported so tests and tooling can assert on it directly. */
|
|
26
|
+
export declare const adminSurfaceTokens: Record<string, string>;
|
|
27
|
+
/**
|
|
28
|
+
* Pairs whose contrast is NOT yet at WCAG AA, with the reason each is tolerated.
|
|
29
|
+
*
|
|
30
|
+
* `--info` on its tint measures 4.45:1 against the 4.5 threshold. It predates
|
|
31
|
+
* this module and no one has agreed to change it; raising the text to the
|
|
32
|
+
* scale's 700 would fix it the same way `--warn` was fixed, but that is a
|
|
33
|
+
* separate design call on a separate set of screens. Listed here rather than
|
|
34
|
+
* left to be rediscovered, so the guard below stays meaningful for the rest.
|
|
35
|
+
*/
|
|
36
|
+
export declare const KNOWN_CONTRAST_DEBT: readonly ["--info"];
|
|
37
|
+
/**
|
|
38
|
+
* The same palette as a Tailwind colour scale, namespaced under `acct`.
|
|
39
|
+
*
|
|
40
|
+
* This is what the admin primitives actually style with — `text-acct-ink`,
|
|
41
|
+
* `bg-acct-surface`, `border-acct-hair`. Feeding it into the preset from the
|
|
42
|
+
* same object as {@link adminSurfaceTokens} is what keeps the utility and the
|
|
43
|
+
* custom property from ever disagreeing.
|
|
44
|
+
*
|
|
45
|
+
* Namespaced deliberately. Several of these names (`border`, `page`, `info`)
|
|
46
|
+
* would collide with Tailwind's own utility grammar unprefixed: a colour
|
|
47
|
+
* literally called `border` produces `border-border`, and `text-info` would
|
|
48
|
+
* read as a size to anyone skimming.
|
|
49
|
+
*/
|
|
50
|
+
export declare const adminSurfaceTailwindColors: Record<string, string>;
|
|
51
|
+
export interface AdminSurfaceCssOptions {
|
|
52
|
+
/** Class the properties are scoped to. Defaults to `.acct`. */
|
|
53
|
+
scope?: string;
|
|
54
|
+
/** Base font stack for the surface. Pass `false` to leave typography alone. */
|
|
55
|
+
fontFamily?: string | false;
|
|
56
|
+
}
|
|
57
|
+
/** The palette as a `<style>`-ready rule. */
|
|
58
|
+
export declare function adminSurfaceCss({ scope, fontFamily, }?: AdminSurfaceCssOptions): string;
|
package/dist/tokens/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { colors } from './colors';
|
|
2
2
|
export { spacing } from './spacing';
|
|
3
3
|
export { typography } from './typography';
|
|
4
|
+
export { adminSurfaceCss, adminSurfaceTokens } from './admin-surface';
|
|
4
5
|
export type { ColorToken } from './colors';
|
|
6
|
+
export type { AdminSurfaceCssOptions } from './admin-surface';
|