@arqel-dev/types 0.10.1 → 0.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.
package/dist/actions.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { FieldSchema } from './fields.js';
2
+
1
3
  /**
2
4
  * Action schema mirroring `arqel-dev/actions` PHP serialisation.
3
5
  *
@@ -5,6 +7,7 @@
5
7
  * `array_filter(... !== null)` — so optional fields are simply
6
8
  * absent from the payload rather than `null`.
7
9
  */
10
+
8
11
  type ActionType = 'row' | 'bulk' | 'toolbar' | 'header';
9
12
  type ActionColor = 'primary' | 'secondary' | 'destructive' | 'success' | 'warning' | 'info';
10
13
  type ActionVariant = 'default' | 'outline' | 'ghost' | 'destructive';
@@ -60,8 +63,19 @@ interface ActionSchema {
60
63
  requiresConfirmation?: true;
61
64
  /** Modal config; absent when confirmation is not required. */
62
65
  confirmation?: ConfirmationConfig;
63
- /** Form modal field schema; absent when the action has no form. */
66
+ /**
67
+ * Form modal *layout* — the `{name, type}` order in which fields are
68
+ * rendered. The rich per-field payload arrives in `formFields` (#213).
69
+ */
64
70
  form?: ActionFormField[];
71
+ /**
72
+ * Full FieldSchema for each form field (options, label, validation,
73
+ * per-type props), serialised server-side from `Action::form()` via
74
+ * `FieldSchemaSerializer`. Joined to `form` by `name` so the modal
75
+ * renders real inputs instead of blanks. Absent when the action has
76
+ * no form (#213).
77
+ */
78
+ formFields?: FieldSchema[];
65
79
  /** Modal size for form actions. */
66
80
  modalSize?: ModalSize;
67
81
  /** Flash message shown on successful execution. */
package/dist/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export { ColumnsEntry, ColumnsProps, FieldEntry, FieldsetEntry, FieldsetProps, F
4
4
  export { ArqelMeta, ArqelPageProps, AuthPayload, AuthUserPayload, FlashPayload, PanelPayload, SharedProps } from './inertia.js';
5
5
  export { PaginationMeta, PlainResourceIndexProps, RecordType, ResourceCreateProps, ResourceDetailProps, ResourceEditProps, ResourceIndexProps, ResourceMeta } from './resources.js';
6
6
  export { BadgeColumnProps, BadgeColumnSchema, BadgeOption, BooleanColumnProps, BooleanColumnSchema, ColumnAlign, ColumnSchema, ColumnType, ComputedColumnProps, ComputedColumnSchema, DateColumnMode, DateColumnProps, DateColumnSchema, DateRangeFilterProps, DateRangeFilterSchema, FilterSchema, FilterType, IconColumnProps, IconColumnSchema, ImageColumnProps, ImageColumnSchema, ImageColumnShape, MultiSelectFilterSchema, NumberColumnProps, NumberColumnSchema, RelationshipColumnProps, RelationshipColumnSchema, ScopeFilterSchema, SelectFilterProps, SelectFilterSchema, SortDirection, TableSort, TernaryFilterProps, TernaryFilterSchema, TernaryState, TextColumnProps, TextColumnSchema, TextFilterSchema } from './tables.js';
7
+ export { TenantContextProps, TenantSummary } from './tenant.js';
@@ -17,6 +17,22 @@ type RecordType = Record<string, unknown> & {
17
17
  arqel?: {
18
18
  title?: string;
19
19
  subtitle?: string | null;
20
+ /**
21
+ * Names of row actions visible + executable for this record
22
+ * (`InertiaDataBuilder::resolveVisibleActionNames`).
23
+ */
24
+ actions?: string[];
25
+ /**
26
+ * Per-record overrides for row actions whose `url` or `disabled`
27
+ * state depends on the record — a `url(Closure)` or
28
+ * `disabled(Closure)` resolved against the actual row (#140). Keyed
29
+ * by action name; only record-dependent actions appear here, so
30
+ * stock `{id}`-template actions carry no override.
31
+ */
32
+ actionOverrides?: Record<string, {
33
+ url?: string;
34
+ disabled?: true;
35
+ }>;
20
36
  };
21
37
  };
22
38
  /**
package/dist/tables.d.ts CHANGED
@@ -36,6 +36,10 @@ interface BadgeOption {
36
36
  interface BadgeColumnProps {
37
37
  options?: BadgeOption[];
38
38
  pill?: boolean;
39
+ /** Map of cell value → colour token (e.g. `{ published: 'green' }`). */
40
+ colors?: Record<string, string>;
41
+ /** Map of cell value → lucide icon name (e.g. `{ draft: 'pencil' }`). */
42
+ icons?: Record<string, string>;
39
43
  }
40
44
  interface BooleanColumnProps {
41
45
  trueIcon?: string;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Tenant context types — mirror of Arqel\Tenant\Http\Controllers\TenantSwitcherController::serialise.
3
+ */
4
+ interface TenantSummary {
5
+ id: string | number;
6
+ name: string | null;
7
+ slug: string | null;
8
+ logo: string | null;
9
+ }
10
+ interface TenantContextProps {
11
+ current: TenantSummary | null;
12
+ available: ReadonlyArray<TenantSummary>;
13
+ }
14
+
15
+ export type { TenantContextProps, TenantSummary };
package/dist/tenant.js ADDED
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=tenant.js.map
3
+ //# sourceMappingURL=tenant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"tenant.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arqel-dev/types",
3
- "version": "0.10.1",
3
+ "version": "0.13.0",
4
4
  "description": "Shared TypeScript types for Arqel — fields, resources, tables, forms, actions, and Inertia shared props.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://arqel.dev",
@@ -46,6 +46,10 @@
46
46
  "./inertia": {
47
47
  "types": "./dist/inertia.d.ts",
48
48
  "import": "./dist/inertia.js"
49
+ },
50
+ "./tenant": {
51
+ "types": "./dist/tenant.d.ts",
52
+ "import": "./dist/tenant.js"
49
53
  }
50
54
  },
51
55
  "files": [
@@ -57,7 +61,7 @@
57
61
  "expect-type": "^1.2.2",
58
62
  "tsup": "^8.5.0",
59
63
  "typescript": "^5.6.3",
60
- "vitest": "^3.0.0"
64
+ "vitest": "^4.1.0"
61
65
  },
62
66
  "publishConfig": {
63
67
  "access": "public"