@veevarts/design-system 1.17.0-beta.6 → 1.17.0-beta.8

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.
Files changed (76) hide show
  1. package/dist/index.cjs +10 -4
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.js +5361 -4193
  4. package/dist/patterns/ActingAsToggle/ActingAsToggle.d.ts +3 -0
  5. package/dist/patterns/ActingAsToggle/index.d.ts +2 -0
  6. package/dist/patterns/ActingAsToggle/types.d.ts +13 -0
  7. package/dist/patterns/AdminTable/AdminTable.d.ts +42 -0
  8. package/dist/patterns/AdminTable/index.d.ts +3 -0
  9. package/dist/patterns/AdminTable/styles.d.ts +44 -0
  10. package/dist/patterns/AdminTextField/AdminTextField.d.ts +39 -0
  11. package/dist/patterns/AdminTextField/index.d.ts +3 -0
  12. package/dist/patterns/AdminTextField/styles.d.ts +35 -0
  13. package/dist/patterns/AdminToolbar/AdminToolbar.d.ts +20 -0
  14. package/dist/patterns/AdminToolbar/index.d.ts +2 -0
  15. package/dist/patterns/CustomAmountField/CustomAmountField.d.ts +3 -0
  16. package/dist/patterns/CustomAmountField/index.d.ts +2 -0
  17. package/dist/patterns/CustomAmountField/types.d.ts +21 -0
  18. package/dist/patterns/DimensionChip/index.d.ts +13 -2
  19. package/dist/patterns/FeedbackState/FeedbackState.d.ts +1 -1
  20. package/dist/patterns/FeedbackState/type.d.ts +15 -0
  21. package/dist/patterns/InstallmentFundAssignment/InstallmentFundAssignment.d.ts +1 -1
  22. package/dist/patterns/InstallmentFundAssignment/types.d.ts +1 -0
  23. package/dist/patterns/InstallmentSchedule/InstallmentTable.d.ts +1 -1
  24. package/dist/patterns/InstallmentSchedule/types.d.ts +12 -0
  25. package/dist/patterns/{DimensionChip/DimensionChip.d.ts → KeyValueChip/KeyValueChip.d.ts} +4 -4
  26. package/dist/patterns/KeyValueChip/index.d.ts +2 -0
  27. package/dist/patterns/MoneyBackMethods/MoneyBackMethods.d.ts +4 -0
  28. package/dist/patterns/MoneyBackMethods/index.d.ts +2 -0
  29. package/dist/patterns/MoneyBackMethods/types.d.ts +44 -0
  30. package/dist/patterns/NotesField/NotesField.d.ts +3 -0
  31. package/dist/patterns/NotesField/index.d.ts +2 -0
  32. package/dist/patterns/NotesField/types.d.ts +12 -0
  33. package/dist/patterns/PaginationSummary/PaginationSummary.d.ts +26 -0
  34. package/dist/patterns/PaginationSummary/index.d.ts +3 -0
  35. package/dist/patterns/PaginationSummary/page-range.d.ts +19 -0
  36. package/dist/patterns/PaymentSubAmountInput/PaymentSubAmountInput.d.ts +9 -0
  37. package/dist/patterns/PickerRow/PickerRow.d.ts +27 -0
  38. package/dist/patterns/PickerRow/index.d.ts +2 -0
  39. package/dist/patterns/ReasonSelect/ReasonSelect.d.ts +3 -0
  40. package/dist/patterns/ReasonSelect/index.d.ts +2 -0
  41. package/dist/patterns/ReasonSelect/types.d.ts +17 -0
  42. package/dist/patterns/RefundCompleteView/RefundCompleteView.d.ts +3 -0
  43. package/dist/patterns/RefundCompleteView/index.d.ts +2 -0
  44. package/dist/patterns/RefundCompleteView/types.d.ts +22 -0
  45. package/dist/patterns/RefundItemList/RefundItemList.d.ts +3 -0
  46. package/dist/patterns/RefundItemList/index.d.ts +2 -0
  47. package/dist/patterns/RefundItemList/types.d.ts +40 -0
  48. package/dist/patterns/RefundTotalBar/RefundTotalBar.d.ts +3 -0
  49. package/dist/patterns/RefundTotalBar/index.d.ts +2 -0
  50. package/dist/patterns/RefundTotalBar/types.d.ts +13 -0
  51. package/dist/patterns/RowActions/RowActions.d.ts +17 -0
  52. package/dist/patterns/RowActions/index.d.ts +2 -0
  53. package/dist/patterns/SplitRefundPanel/SplitRefundPanel.d.ts +4 -0
  54. package/dist/patterns/SplitRefundPanel/index.d.ts +2 -0
  55. package/dist/patterns/SplitRefundPanel/types.d.ts +51 -0
  56. package/dist/patterns/SupervisorPinField/SupervisorPinField.d.ts +3 -0
  57. package/dist/patterns/SupervisorPinField/index.d.ts +2 -0
  58. package/dist/patterns/SupervisorPinField/types.d.ts +12 -0
  59. package/dist/patterns/TableSkeleton/TableSkeleton.d.ts +32 -0
  60. package/dist/patterns/TableSkeleton/index.d.ts +2 -0
  61. package/dist/patterns/UnderlineTabs/UnderlineTabs.d.ts +18 -0
  62. package/dist/patterns/UnderlineTabs/index.d.ts +2 -0
  63. package/dist/patterns/WizardShell/WizardShell.d.ts +4 -0
  64. package/dist/patterns/WizardShell/index.d.ts +2 -0
  65. package/dist/patterns/WizardShell/types.d.ts +29 -0
  66. package/dist/patterns/grid-columns.d.ts +1 -1
  67. package/dist/patterns/index.d.ts +43 -4
  68. package/dist/patterns/refund-shared/index.d.ts +1 -0
  69. package/dist/patterns/refund-shared/types.d.ts +12 -0
  70. package/dist/tailwind/index.d.ts +4 -0
  71. package/dist/tailwind/index.js +68 -1
  72. package/dist/tokens/admin-surface.d.ts +58 -0
  73. package/dist/tokens/index.d.ts +2 -0
  74. package/package.json +1 -1
  75. package/dist/patterns/CheckboxCardGroup/CheckboxCardGroup.d.ts +0 -53
  76. package/dist/patterns/CheckboxCardGroup/index.d.ts +0 -2
@@ -0,0 +1,40 @@
1
+ import { Money } from '../../utils/money';
2
+ export type { Money } from '../../utils/money';
3
+ export type RefundItemState = 'selectable' | 'already_refunded' | 'non_refundable';
4
+ export interface RefundItemRestockView {
5
+ available: boolean;
6
+ unavailableHint?: string;
7
+ on: boolean;
8
+ }
9
+ export interface RefundItemView {
10
+ id: string;
11
+ name: string;
12
+ quantity: number;
13
+ paidAmount: Money;
14
+ state: RefundItemState;
15
+ warning?: string;
16
+ restock: RefundItemRestockView;
17
+ }
18
+ export interface ItemSelection {
19
+ selected: boolean;
20
+ mode: 'full' | 'partial';
21
+ partialAmount?: number;
22
+ }
23
+ export interface RefundItemListLabels {
24
+ refunded?: string;
25
+ ineligible?: string;
26
+ partialLink?: string;
27
+ partialOf?: string;
28
+ partialCancel?: string;
29
+ restockTitle?: string;
30
+ restockHint?: string;
31
+ }
32
+ export interface RefundItemListProps {
33
+ items: RefundItemView[];
34
+ selections: Record<string, ItemSelection>;
35
+ onSelectionChange: (itemId: string, selection: ItemSelection) => void;
36
+ onRestockToggle: (itemId: string, on: boolean) => void;
37
+ labels?: RefundItemListLabels;
38
+ className?: string;
39
+ 'data-testid'?: string;
40
+ }
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ import { RefundTotalBarProps } from './types';
3
+ export declare const RefundTotalBar: React.FC<RefundTotalBarProps>;
@@ -0,0 +1,2 @@
1
+ export { RefundTotalBar } from './RefundTotalBar';
2
+ export type { RefundTotalBarProps, RefundTotalBarLabels } from './types';
@@ -0,0 +1,13 @@
1
+ import { Money } from '../../utils/money';
2
+ export type { Money } from '../../utils/money';
3
+ export interface RefundTotalBarLabels {
4
+ title?: string;
5
+ partialBadge?: string;
6
+ }
7
+ export interface RefundTotalBarProps {
8
+ total: Money;
9
+ isPartial: boolean;
10
+ labels?: RefundTotalBarLabels;
11
+ className?: string;
12
+ 'data-testid'?: string;
13
+ }
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ export interface RowAction {
3
+ key: string;
4
+ /** Accessible name AND tooltip. Include the subject: "Edit Annual Fund", not "Edit". */
5
+ label: string;
6
+ icon: React.ReactNode;
7
+ onPress: () => void;
8
+ disabled?: boolean;
9
+ }
10
+ export interface RowActionsProps {
11
+ actions: RowAction[];
12
+ /** Button edge length. `'md'` (30px) by default, `'sm'` (24px) for dense rows. */
13
+ size?: 'sm' | 'md';
14
+ className?: string;
15
+ 'data-testid'?: string;
16
+ }
17
+ export declare const RowActions: React.FC<RowActionsProps>;
@@ -0,0 +1,2 @@
1
+ export { RowActions } from './RowActions';
2
+ export type { RowActionsProps, RowAction } from './RowActions';
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { SplitRefundPanelProps } from './types';
3
+ export declare const SplitRefundPanel: React.FC<SplitRefundPanelProps>;
4
+ export default SplitRefundPanel;
@@ -0,0 +1,2 @@
1
+ export { SplitRefundPanel } from './SplitRefundPanel';
2
+ export type { SplitRefundPanelProps, SplitRefundPanelLabels, SplitPartView } from './types';
@@ -0,0 +1,51 @@
1
+ import { Money } from '../../utils/money';
2
+ import { MoneyBackError } from '..';
3
+ export type { Money } from '../../utils/money';
4
+ export interface SplitPartView {
5
+ /** Stable identifier for the tender this part refunds to. */
6
+ tenderId: string;
7
+ /** One-line description, e.g. `'Visa •••4242'` or `'Cash'`. */
8
+ label: string;
9
+ /** Amount already refunded for this part. `null` = not executed yet. */
10
+ refunded: Money | null;
11
+ }
12
+ export interface SplitRefundPanelLabels {
13
+ title?: string;
14
+ refundedSoFar?: string;
15
+ remaining?: string;
16
+ amountForPart?: string;
17
+ submit?: string;
18
+ back?: string;
19
+ partDeclinedBody?: string;
20
+ partNetworkBody?: string;
21
+ retry?: string;
22
+ chooseDifferent?: string;
23
+ }
24
+ export interface SplitRefundPanelProps {
25
+ /** Every part of the split, executed and pending, in entry order. */
26
+ parts: SplitPartView[];
27
+ /** Sum already refunded across executed parts. */
28
+ refundedSoFar: Money;
29
+ /** Amount left to refund across the remaining parts. */
30
+ remaining: Money;
31
+ /** The part currently being entered. */
32
+ current: {
33
+ /** Tender selected for the part being entered. `null` = not chosen yet. */
34
+ tenderId: string | null;
35
+ /** Amount typed so far, in major units. */
36
+ amount: number;
37
+ /** Fires on every keystroke with the parsed major-unit amount. */
38
+ onAmountChange: (next: number) => void;
39
+ };
40
+ /** Fires when the cashier submits the current part. */
41
+ onRefundPart: () => void;
42
+ /** Processor-declined / network-error banner for the current part. */
43
+ partError?: MoneyBackError;
44
+ /** Fires when the cashier navigates back out of the split flow. */
45
+ onBack: () => void;
46
+ /** Disables the submit action and shows its loading state. */
47
+ busy?: boolean;
48
+ labels?: SplitRefundPanelLabels;
49
+ className?: string;
50
+ 'data-testid'?: string;
51
+ }
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ import { SupervisorPinFieldProps } from './types';
3
+ export declare const SupervisorPinField: React.FC<SupervisorPinFieldProps>;
@@ -0,0 +1,2 @@
1
+ export { SupervisorPinField } from './SupervisorPinField';
2
+ export type { SupervisorPinFieldProps, SupervisorPinFieldLabels } from './types';
@@ -0,0 +1,12 @@
1
+ export interface SupervisorPinFieldLabels {
2
+ label?: string;
3
+ placeholder?: string;
4
+ }
5
+ export interface SupervisorPinFieldProps {
6
+ pin: string;
7
+ onChange: (pin: string) => void;
8
+ error?: string;
9
+ labels?: SupervisorPinFieldLabels;
10
+ className?: string;
11
+ 'data-testid'?: string;
12
+ }
@@ -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,2 @@
1
+ export { TableSkeleton } from './TableSkeleton';
2
+ export type { TableSkeletonProps, TableSkeletonClassNames } from './TableSkeleton';
@@ -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,2 @@
1
+ export { UnderlineTabs } from './UnderlineTabs';
2
+ export type { UnderlineTabsProps, UnderlineTabItem } from './UnderlineTabs';
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { WizardShellProps } from './types';
3
+ export declare const WizardShell: React.FC<WizardShellProps>;
4
+ export default WizardShell;
@@ -0,0 +1,2 @@
1
+ export { WizardShell } from './WizardShell';
2
+ export type { WizardShellProps, WizardStep, WizardStepState, WizardShellPrimaryAction, WizardShellLabels, } from './types';
@@ -0,0 +1,29 @@
1
+ import { ReactNode } from 'react';
2
+ export type WizardStepState = 'upcoming' | 'active' | 'done' | 'skipped';
3
+ export interface WizardStep {
4
+ id: string;
5
+ label: string;
6
+ state: WizardStepState;
7
+ }
8
+ export interface WizardShellPrimaryAction {
9
+ label: string;
10
+ onClick: () => void;
11
+ disabled?: boolean;
12
+ loading?: boolean;
13
+ }
14
+ export interface WizardShellLabels {
15
+ back?: string;
16
+ close?: string;
17
+ }
18
+ export interface WizardShellProps {
19
+ onClose?: () => void;
20
+ steps: WizardStep[];
21
+ activeStepId: string;
22
+ onBack?: () => void;
23
+ primaryAction: WizardShellPrimaryAction;
24
+ footerSummary?: ReactNode;
25
+ labels?: WizardShellLabels;
26
+ className?: string;
27
+ 'data-testid'?: string;
28
+ children: ReactNode;
29
+ }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Shared responsive grid-column class maps for the card-picker patterns
3
- * (TileSelect single-select, CheckboxCardGroup multi-select). Kept in one
3
+ * (TileSelect, and previously CheckboxCardGroup). Kept in one
4
4
  * place so the two siblings never drift on breakpoints or column counts.
5
5
  *
6
6
  * The literal Tailwind classes must stay spelled out (not interpolated) so
@@ -45,14 +45,30 @@ export { PageHeader } from './PageHeader';
45
45
  export type { PageHeaderProps, PageHeaderClassNames } from './PageHeader';
46
46
  export { StatusChip } from './StatusChip';
47
47
  export type { StatusChipProps, StatusChipStatus } from './StatusChip';
48
+ export { KeyValueChip } from './KeyValueChip';
49
+ export type { KeyValueChipProps } from './KeyValueChip';
48
50
  export { DimensionChip } from './DimensionChip';
49
51
  export type { DimensionChipProps } from './DimensionChip';
50
- export { CheckboxCardGroup } from './CheckboxCardGroup';
51
- export type { CheckboxCardGroupProps, CheckboxCardOption } from './CheckboxCardGroup';
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';
52
68
  export { ListPanel } from './ListPanel';
53
69
  export type { ListPanelProps, ListPanelClassNames } from './ListPanel';
54
70
  export { CashTenderForm } from './CashTenderForm';
55
- export type { CashTenderFormProps, CashTenderValue, CashTenderLabels, } from './CashTenderForm';
71
+ export type { CashTenderFormProps, CashTenderValue, CashTenderLabels } from './CashTenderForm';
56
72
  export { CheckTenderForm } from './CheckTenderForm';
57
73
  export type { CheckTenderFormProps, CheckTenderValue, CheckTenderLabels } from './CheckTenderForm';
58
74
  export { OtherTenderForm } from './OtherTenderForm';
@@ -60,7 +76,7 @@ export type { OtherTenderFormProps, OtherTenderValue, OtherTenderLabels, OtherTe
60
76
  export { SplitPaymentSummary } from './SplitPaymentSummary';
61
77
  export type { SplitPaymentSummaryProps, SplitPaymentSummaryLabels, TenderRow, TenderRowStatus, TenderRowType, } from './SplitPaymentSummary';
62
78
  export { ModalShell, ModalShellHeader, ModalShellFooter } from './ModalShell';
63
- export type { ModalShellProps, ModalShellHeaderProps, ModalShellFooterProps, } from './ModalShell';
79
+ export type { ModalShellProps, ModalShellHeaderProps, ModalShellFooterProps } from './ModalShell';
64
80
  export { TileSelect } from './TileSelect';
65
81
  export type { TileSelectProps, TileSelectOption } from './TileSelect';
66
82
  export { PaymentTotalBanner } from './PaymentTotalBanner';
@@ -77,3 +93,26 @@ export { ConfirmDialog } from './ConfirmDialog';
77
93
  export type { ConfirmDialogProps, ConfirmDialogVariant } from './ConfirmDialog';
78
94
  export { Summary } from './Summary';
79
95
  export type { SummaryProps, SummaryLineItem, SummaryItemDetail, SummaryServiceFee, SummaryTotalRow, SummaryPostTotalRow, SummaryPrimaryAction, SummaryLabels, } from './Summary';
96
+ export { WizardShell } from './WizardShell';
97
+ export type { WizardShellProps, WizardStep, WizardStepState, WizardShellPrimaryAction, WizardShellLabels, } from './WizardShell';
98
+ export type { MoneyBackError, RefundDestinationLine, RefundDestinationStatus } from './refund-shared';
99
+ export { RefundItemList } from './RefundItemList';
100
+ export type { RefundItemListProps, RefundItemView, ItemSelection, RefundItemState, RefundItemRestockView, RefundItemListLabels, } from './RefundItemList';
101
+ export { CustomAmountField } from './CustomAmountField';
102
+ export type { CustomAmountFieldProps, CustomAmountFieldLabels, CustomAmountFieldValue } from './CustomAmountField';
103
+ export { RefundTotalBar } from './RefundTotalBar';
104
+ export type { RefundTotalBarProps, RefundTotalBarLabels } from './RefundTotalBar';
105
+ export { ReasonSelect } from './ReasonSelect';
106
+ export type { ReasonSelectProps, ReasonOption, ReasonSelectLabels } from './ReasonSelect';
107
+ export { NotesField } from './NotesField';
108
+ export type { NotesFieldProps, NotesFieldLabels } from './NotesField';
109
+ export { ActingAsToggle } from './ActingAsToggle';
110
+ export type { ActingAsToggleProps, ActingRole, ActingAsToggleLabels } from './ActingAsToggle';
111
+ export { MoneyBackMethods } from './MoneyBackMethods';
112
+ export type { MoneyBackMethodsProps, TenderView, TenderKind, MoneyBackMethodsLabels } from './MoneyBackMethods';
113
+ export { SplitRefundPanel } from './SplitRefundPanel';
114
+ export type { SplitRefundPanelProps, SplitPartView, SplitRefundPanelLabels } from './SplitRefundPanel';
115
+ export { SupervisorPinField } from './SupervisorPinField';
116
+ export type { SupervisorPinFieldProps, SupervisorPinFieldLabels } from './SupervisorPinField';
117
+ export { RefundCompleteView } from './RefundCompleteView';
118
+ export type { RefundCompleteViewProps, RefundCompleteViewLabels } from './RefundCompleteView';
@@ -0,0 +1 @@
1
+ export type { MoneyBackError, RefundDestinationLine, RefundDestinationStatus } from './types';
@@ -0,0 +1,12 @@
1
+ import { Money } from '../../utils/money';
2
+ export interface MoneyBackError {
3
+ kind: 'processor_declined' | 'network';
4
+ onRetry: () => void;
5
+ onChooseDifferent: () => void;
6
+ }
7
+ export type RefundDestinationStatus = 'succeeded' | 'pending';
8
+ export interface RefundDestinationLine {
9
+ label: string;
10
+ amount: Money;
11
+ status: RefundDestinationStatus;
12
+ }
@@ -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";
@@ -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;
@@ -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';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veevarts/design-system",
3
3
  "private": false,
4
- "version": "1.17.0-beta.6",
4
+ "version": "1.17.0-beta.8",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -1,53 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface CheckboxCardOption {
3
- /** Stable identifier surfaced through `onChange`. */
4
- key: string;
5
- /** Visible label. */
6
- label: string;
7
- /** Optional secondary line under the label. */
8
- description?: string;
9
- /** Iconify name (`'solar:ticket-outline'`) or a custom node. */
10
- icon?: string | React.ReactNode;
11
- /** Disable just this card. */
12
- isDisabled?: boolean;
13
- /** Override per-card test id; defaults to `${dataTestId}-${key}`. */
14
- 'data-testid'?: string;
15
- }
16
- export interface CheckboxCardGroupClassNames {
17
- base?: string;
18
- grid?: string;
19
- card?: string;
20
- hint?: string;
21
- }
22
- export interface CheckboxCardGroupProps {
23
- /** Options to render in order. */
24
- options: readonly CheckboxCardOption[];
25
- /** Currently selected option keys. */
26
- selectedKeys: readonly string[];
27
- /** Fires with the next full selection whenever a card is toggled. Keys are emitted in the original option order (not selection order); any selected key not present in `options` is preserved. */
28
- onChange: (keys: string[]) => void;
29
- /** Optional heading rendered above the grid (labels the group). */
30
- heading?: string;
31
- /** `aria-label` for the group when `heading` is omitted. Default `'Select options'`. */
32
- ariaLabel?: string;
33
- /** Grid columns on >= sm. Default `2`. */
34
- columnsDesktop?: 2 | 3 | 4;
35
- /** Grid columns on mobile. Default `1`. */
36
- columnsMobile?: 1 | 2;
37
- /**
38
- * Minimum number of selections. When set, the group auto-derives its
39
- * invalid state (`selectedKeys.length < minSelected`) and a default hint,
40
- * unless `isInvalid` / `hint` are explicitly supplied.
41
- */
42
- minSelected?: number;
43
- /** Helper text under the grid. Overrides the `minSelected` default hint. */
44
- hint?: React.ReactNode;
45
- /** Error styling + `aria-invalid`. Overrides the `minSelected`-derived state. */
46
- isInvalid?: boolean;
47
- /** Disable every card. */
48
- isDisabled?: boolean;
49
- className?: string;
50
- classNames?: CheckboxCardGroupClassNames;
51
- 'data-testid'?: string;
52
- }
53
- export declare const CheckboxCardGroup: React.FC<CheckboxCardGroupProps>;
@@ -1,2 +0,0 @@
1
- export { CheckboxCardGroup } from './CheckboxCardGroup';
2
- export type { CheckboxCardGroupProps, CheckboxCardGroupClassNames, CheckboxCardOption, } from './CheckboxCardGroup';