@veevarts/design-system 1.17.0-beta.5 → 1.17.0-beta.7

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 (47) hide show
  1. package/dist/components/AppliedCodeCard/AppliedCodeCard.d.ts +13 -0
  2. package/dist/components/AppliedCodeCard/index.d.ts +2 -0
  3. package/dist/components/RedeemCodeInput/RedeemCodeInput.d.ts +21 -0
  4. package/dist/components/RedeemCodeInput/index.d.ts +2 -0
  5. package/dist/components/index.d.ts +4 -0
  6. package/dist/index.cjs +10 -4
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.js +7214 -6671
  9. package/dist/patterns/AdminTable/AdminTable.d.ts +42 -0
  10. package/dist/patterns/AdminTable/index.d.ts +3 -0
  11. package/dist/patterns/AdminTable/styles.d.ts +34 -0
  12. package/dist/patterns/AdminTextField/AdminTextField.d.ts +39 -0
  13. package/dist/patterns/AdminTextField/index.d.ts +3 -0
  14. package/dist/patterns/AdminTextField/styles.d.ts +35 -0
  15. package/dist/patterns/AdminToolbar/AdminToolbar.d.ts +18 -0
  16. package/dist/patterns/AdminToolbar/index.d.ts +2 -0
  17. package/dist/patterns/DimensionChip/index.d.ts +13 -2
  18. package/dist/patterns/InstallmentFundAssignment/InstallmentFundAssignment.d.ts +1 -1
  19. package/dist/patterns/InstallmentFundAssignment/types.d.ts +1 -0
  20. package/dist/patterns/InstallmentSchedule/InstallmentTable.d.ts +1 -1
  21. package/dist/patterns/InstallmentSchedule/types.d.ts +12 -0
  22. package/dist/patterns/{DimensionChip/DimensionChip.d.ts → KeyValueChip/KeyValueChip.d.ts} +4 -4
  23. package/dist/patterns/KeyValueChip/index.d.ts +2 -0
  24. package/dist/patterns/PaginationSummary/PaginationSummary.d.ts +26 -0
  25. package/dist/patterns/PaginationSummary/index.d.ts +3 -0
  26. package/dist/patterns/PaginationSummary/page-range.d.ts +19 -0
  27. package/dist/patterns/PickerRow/PickerRow.d.ts +27 -0
  28. package/dist/patterns/PickerRow/index.d.ts +2 -0
  29. package/dist/patterns/RowActions/RowActions.d.ts +17 -0
  30. package/dist/patterns/RowActions/index.d.ts +2 -0
  31. package/dist/patterns/StatusChip/StatusChip.d.ts +9 -5
  32. package/dist/patterns/Summary/components/TotalsLineRow.d.ts +6 -2
  33. package/dist/patterns/Summary/index.d.ts +1 -1
  34. package/dist/patterns/Summary/types.d.ts +31 -6
  35. package/dist/patterns/TableSkeleton/TableSkeleton.d.ts +32 -0
  36. package/dist/patterns/TableSkeleton/index.d.ts +2 -0
  37. package/dist/patterns/UnderlineTabs/UnderlineTabs.d.ts +18 -0
  38. package/dist/patterns/UnderlineTabs/index.d.ts +2 -0
  39. package/dist/patterns/grid-columns.d.ts +1 -1
  40. package/dist/patterns/index.d.ts +19 -3
  41. package/dist/tailwind/index.d.ts +4 -0
  42. package/dist/tailwind/index.js +68 -1
  43. package/dist/tokens/admin-surface.d.ts +58 -0
  44. package/dist/tokens/index.d.ts +2 -0
  45. package/package.json +1 -1
  46. package/dist/patterns/CheckboxCardGroup/CheckboxCardGroup.d.ts +0 -53
  47. package/dist/patterns/CheckboxCardGroup/index.d.ts +0 -2
@@ -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.5",
4
+ "version": "1.17.0-beta.7",
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';