@servicetitan/anvil2 3.12.1 → 3.13.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/{DataTable-DTAbOaPM.js → DataTable-ZczGbHZT.js} +14 -4
  3. package/dist/DataTable-ZczGbHZT.js.map +1 -0
  4. package/dist/{Drawer-C73Ka9ra.js → Drawer-CEsvth0Z.js} +2 -2
  5. package/dist/{Drawer-C73Ka9ra.js.map → Drawer-CEsvth0Z.js.map} +1 -1
  6. package/dist/Drawer.js +1 -1
  7. package/dist/{FilterBar-D2NDYqTs.js → FilterBar-lIGh4xIl.js} +2 -2
  8. package/dist/{FilterBar-D2NDYqTs.js.map → FilterBar-lIGh4xIl.js.map} +1 -1
  9. package/dist/FilterBar.js +1 -1
  10. package/dist/{Menu-BMn1CSr1.js → Menu-CM0EndhK.js} +22 -11
  11. package/dist/Menu-CM0EndhK.js.map +1 -0
  12. package/dist/Menu.js +1 -1
  13. package/dist/{Page-B5yLLq76.js → Page-D5NbV2Y8.js} +60 -48
  14. package/dist/Page-D5NbV2Y8.js.map +1 -0
  15. package/dist/Page.js +1 -1
  16. package/dist/{Pagination-BcW9WJ2b.js → Pagination-B4HCZNYw.js} +2 -2
  17. package/dist/{Pagination-BcW9WJ2b.js.map → Pagination-B4HCZNYw.js.map} +1 -1
  18. package/dist/Pagination.js +1 -1
  19. package/dist/{RichTextEditor-C8V3BajN.js → RichTextEditor-C7CCeqGW.js} +3 -3
  20. package/dist/{RichTextEditor-C8V3BajN.js.map → RichTextEditor-C7CCeqGW.js.map} +1 -1
  21. package/dist/RichTextEditor.js +1 -1
  22. package/dist/{SavedFiltersButton-ClghkFdA.js → SavedFiltersButton-BwnP6fuk.js} +2 -2
  23. package/dist/{SavedFiltersButton-ClghkFdA.js.map → SavedFiltersButton-BwnP6fuk.js.map} +1 -1
  24. package/dist/SavedFiltersButton.js +1 -1
  25. package/dist/Table.js +1 -1
  26. package/dist/{TimeField-BY_hasgp.js → TimeField-BZQP8KSf.js} +2 -2
  27. package/dist/{TimeField-BY_hasgp.js.map → TimeField-BZQP8KSf.js.map} +1 -1
  28. package/dist/TimeField.css +1 -3
  29. package/dist/TimeField.js +1 -1
  30. package/dist/beta.js +4 -4
  31. package/dist/{index-BY2uMI6I.js → index-lV_kQQH8.js} +2 -2
  32. package/dist/{index-BY2uMI6I.js.map → index-lV_kQQH8.js.map} +1 -1
  33. package/dist/index.js +5 -5
  34. package/dist/src/beta/components/Table/DataTable/internal/constants.d.ts +35 -0
  35. package/dist/src/components/Page/Page.d.ts +8 -2
  36. package/dist/src/components/Page/PageHeader.d.ts +15 -2
  37. package/package.json +3 -2
  38. package/dist/DataTable-DTAbOaPM.js.map +0 -1
  39. package/dist/Menu-BMn1CSr1.js.map +0 -1
  40. package/dist/Page-B5yLLq76.js.map +0 -1
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ export { D as Details } from './Details-CVA5zbrR.js';
24
24
  export { D as Dialog } from './Dialog-PcuDCqK7.js';
25
25
  export { D as Divider } from './Divider-C7fp5Xb6.js';
26
26
  export { D as Dnd } from './index-BwV_Pz7v.js';
27
- export { D as Drawer } from './Drawer-C73Ka9ra.js';
27
+ export { D as Drawer } from './Drawer-CEsvth0Z.js';
28
28
  export { D as DrillDown, b as DrillDownContent, c as DrillDownFooter, a as DrillDownHeader, d as DrillDownNextButton, e as DrillDownPrevButton, u as useDrillDown } from './useDrilldown-D5iDWSx7.js';
29
29
  export { E as EditCard } from './EditCard-CtWVEAsA.js';
30
30
  export { F as FieldLabel } from './FieldLabel-BFJdJP_W.js';
@@ -40,11 +40,11 @@ export { L as LinkButton } from './LinkButton-C0wps8r1.js';
40
40
  export { L as List } from './List-BvzfZ9TW.js';
41
41
  export { L as Listbox } from './Listbox-Of-WaRWI.js';
42
42
  export { L as ListView, a as ListViewOption, b as ListViewOptionCell } from './ListView-CPDHEpD-.js';
43
- export { M as Menu } from './Menu-BMn1CSr1.js';
43
+ export { M as Menu } from './Menu-CM0EndhK.js';
44
44
  export { N as NumberField } from './NumberField-ASyiQu5l.js';
45
45
  export { Overflow, OverflowText } from './Overflow.js';
46
- export { P as Page } from './Page-B5yLLq76.js';
47
- export { P as Pagination } from './Pagination-BcW9WJ2b.js';
46
+ export { P as Page } from './Page-D5NbV2Y8.js';
47
+ export { P as Pagination } from './Pagination-B4HCZNYw.js';
48
48
  export { P as Popover } from './Popover-CjsE5FG0.js';
49
49
  export { P as ProgressBar } from './ProgressBar-C_HXy_Hx.js';
50
50
  export { R as Radio } from './Radio-CBQpuxLP.js';
@@ -66,7 +66,7 @@ export { T as Tab } from './Tab-Bqfvg8Ce.js';
66
66
  export { T as Text } from './Text-CEJHoh0p.js';
67
67
  export { T as Textarea } from './Textarea-CSXwaDf6.js';
68
68
  export { T as TextField } from './TextField-DWbDQfHY.js';
69
- export { T as TimeField } from './TimeField-BY_hasgp.js';
69
+ export { T as TimeField } from './TimeField-BZQP8KSf.js';
70
70
  export { T as Toaster } from './Toaster-B1xZq1bs.js';
71
71
  export { t as toast } from './Toaster-C2z5rCrc.js';
72
72
  export { T as Toolbar } from './Toolbar-neulke7h.js';
@@ -11,3 +11,38 @@ export declare const INTERNAL_ROW_ACTION_PRIMARY_COLUMN_ID = "a2-table-internal-
11
11
  * in the primary action column instead).
12
12
  */
13
13
  export declare const INTERNAL_ROW_ACTION_SECONDARY_COLUMN_ID = "a2-table-internal-row-action-secondary";
14
+ /**
15
+ * Initial per-row height estimate used before measurement. Individual rows are
16
+ * measured via `measureElement` and corrected after first paint, so this value
17
+ * only affects the pre-measurement scroll range.
18
+ */
19
+ export declare const DEFAULT_ESTIMATED_ROW_HEIGHT = 35;
20
+ /**
21
+ * Upper bound for the estimated loading spacer height on the first load.
22
+ *
23
+ * The estimate is `rowsPerPage * DEFAULT_ESTIMATED_ROW_HEIGHT`, which is taller
24
+ * than most viewports at large page sizes (1750px at 50 rows per page) and
25
+ * renders as a large empty area with a spinner in it. There is no real height
26
+ * to preserve before the body has been measured, so cap the estimate at
27
+ * something that still reads as a table.
28
+ */
29
+ export declare const MAX_INITIAL_LOADING_HEIGHT = 400;
30
+ /**
31
+ * Lower bound for the estimated loading spacer height on the first load.
32
+ *
33
+ * The spacer centers a medium `Spinner`, which is 40px square, so a very small
34
+ * page size would otherwise render a spacer too short to contain its own
35
+ * spinner (35px at `rowsPerPage: 1`). Leave room for it.
36
+ */
37
+ export declare const MIN_INITIAL_LOADING_HEIGHT = 80;
38
+ /**
39
+ * Loading spacer height used on the first load when the page size cannot be
40
+ * turned into an estimate.
41
+ *
42
+ * `rowsPerPage` comes from `paginationObject?.rowsPerPage ?? 25`, and `??` only
43
+ * substitutes for null and undefined — an explicit `0`, a negative, or a `NaN`
44
+ * parsed from user input all survive it. Multiplying any of them out would
45
+ * render `0px`, a negative height, or `NaNpx`, collapsing the spacer that this
46
+ * exists to prevent.
47
+ */
48
+ export declare const DEFAULT_INITIAL_LOADING_HEIGHT = 200;
@@ -131,9 +131,15 @@ export declare const Page: import('react').ForwardRefExoticComponent<Omit<import
131
131
  chips?: import('..').ChipProps[];
132
132
  description?: import('react').ReactNode;
133
133
  actions?: {
134
- primary?: Omit<import('..').ButtonProps, "appearance"> & {
134
+ primary?: (Omit<import('..').ButtonProps, "appearance"> & {
135
135
  label: string;
136
- };
136
+ }) | (Omit<Omit<import('..').ButtonProps, "appearance"> & {
137
+ label: string;
138
+ }, "onClick"> & {
139
+ items: (Omit<import('..').ButtonProps, "appearance"> & {
140
+ label: string;
141
+ })[];
142
+ });
137
143
  secondary?: (Omit<import('..').ButtonProps, "appearance"> & {
138
144
  label: string;
139
145
  })[];
@@ -10,14 +10,27 @@ type PageHeaderActionProps = Omit<ButtonProps, "appearance"> & {
10
10
  */
11
11
  label: string;
12
12
  };
13
+ /**
14
+ * Props for a page header action that opens a menu instead of invoking a single
15
+ * handler. `onClick` is omitted because the whole button opens the menu -- an
16
+ * action carrying both a handler and items would be a split button, which
17
+ * Anvil does not support.
18
+ */
19
+ type PageHeaderMenuActionProps = Omit<PageHeaderActionProps, "onClick"> & {
20
+ /**
21
+ * Actions listed in the menu this button opens
22
+ */
23
+ items: PageHeaderActionProps[];
24
+ };
13
25
  /**
14
26
  * Props for page header actions configuration
15
27
  */
16
28
  type PageHeaderActionsProps = {
17
29
  /**
18
- * Primary action button
30
+ * Primary action button. Pass `items` instead of `onClick` to render a
31
+ * primary button that opens a menu of actions.
19
32
  */
20
- primary?: PageHeaderActionProps;
33
+ primary?: PageHeaderActionProps | PageHeaderMenuActionProps;
21
34
  /**
22
35
  * Array of secondary action buttons
23
36
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/anvil2",
3
- "version": "3.12.1",
3
+ "version": "3.13.0",
4
4
  "type": "module",
5
5
  "types": "./dist/src/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -127,7 +127,7 @@
127
127
  "vite": "6.4.2",
128
128
  "vitest": "^3.2.4",
129
129
  "vitest-axe": "^0.1.0",
130
- "@servicetitan/anvil2-illustrations": "1.1.0"
130
+ "@servicetitan/anvil2-illustrations": "1.2.0"
131
131
  },
132
132
  "scripts": {
133
133
  "dev": "vite build --watch",
@@ -137,6 +137,7 @@
137
137
  "build:icons": "pnpm svgo:st-icons && node scripts/createIconIndexes.mjs",
138
138
  "build:vite": "vite build",
139
139
  "check-types": "tsc --noEmit --project tsconfig.build.json",
140
+ "typecheck": "pnpm check-types",
140
141
  "check-parts": "node ./scripts/check-anv-parts.mjs",
141
142
  "check-parts:selftest": "node ./scripts/check-anv-parts.mjs --selftest",
142
143
  "clean": "rimraf dist node_modules/.cache",