@nxgt/material 3.35.1 → 3.37.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 (55) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/{button-EMWOFSDB.js → button-CB4nSAMd.js} +2 -1
  4. package/dist/charts.js +1 -1
  5. package/dist/components/ui/actions/icon-button/icon-button.css +58 -0
  6. package/dist/{components-jh9l5bIA.js → components-mqgqmfvj.js} +19761 -19742
  7. package/dist/components.js +20 -20
  8. package/dist/{dialog-Cdv9IXVo.js → dialog-DR9rACzY.js} +1 -1
  9. package/dist/dnd.js +1 -1
  10. package/dist/editor.js +906 -907
  11. package/dist/{icon-badge-BFScQnp9.js → icon-badge-DXEBeS1y.js} +2 -2
  12. package/dist/{icon-button-ifTpXt0A.js → icon-button-CN9r5TNE.js} +51 -32
  13. package/dist/lib/components/ui/actions/button/button.d.ts +8 -0
  14. package/dist/lib/components/ui/actions/icon-button/icon-button.d.ts +14 -0
  15. package/dist/lib/components/ui/collections/data-table/hooks.d.ts +6 -1
  16. package/dist/lib/components/ui/collections/filter/bar/filter-bar-view.d.ts +1 -1
  17. package/dist/lib/components/ui/collections/filter/facets/filter-facets.d.ts +1 -1
  18. package/dist/lib/components/ui/collections/filter/facets/partials/filter-facets-footer.d.ts +4 -1
  19. package/dist/lib/components/ui/collections/filter/facets/partials/filter-facets-panel.d.ts +3 -1
  20. package/dist/lib/components/ui/collections/filter/filter-presets.d.ts +1 -1
  21. package/dist/lib/components/ui/collections/filter/query/types.d.ts +13 -0
  22. package/dist/lib/components/ui/collections/filter/sections/sheet/filter-sheet-footer.d.ts +3 -1
  23. package/dist/lib/components/ui/collections/filter/sections/sheet/filter-sheet.d.ts +3 -1
  24. package/dist/lib/components/ui/collections/filter/types-props.d.ts +3 -0
  25. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog.d.ts +7 -1
  26. package/dist/lib/components/ui/feedback/confirmation-dialog/confirmation-dialog.d.ts +7 -1
  27. package/dist/lib/components/ui/fields/attributes/attribute-dialog.d.ts +4 -1
  28. package/dist/lib/components/ui/fields/attributes/attributes-field/attributes-dialog-field.d.ts +4 -1
  29. package/dist/lib/components/ui/fields/attributes/attributes-field/attributes-inline-field.d.ts +1 -1
  30. package/dist/lib/components/ui/fields/contacts/contact-dialog.d.ts +4 -1
  31. package/dist/lib/components/ui/fields/contacts/contacts-dialog-form-field.d.ts +4 -1
  32. package/dist/lib/components/ui/fields/contacts/contacts-form-field.d.ts +4 -1
  33. package/dist/lib/components/ui/fields/opening-hours/opening-hours-dialog-form-field.d.ts +4 -1
  34. package/dist/lib/components/ui/fields/opening-hours/opening-hours-dialog.d.ts +4 -1
  35. package/dist/lib/components/ui/fields/opening-hours/opening-hours-form-field.d.ts +4 -1
  36. package/dist/lib/components/ui/fields/postal-address/postal-address-dialog.d.ts +4 -1
  37. package/dist/lib/components/ui/fields/postal-address/postal-address-form-field.d.ts +4 -1
  38. package/dist/lib/components/ui/media/image-cropper/image-cropper.d.ts +4 -1
  39. package/dist/lib/components/ui/widgets/rich-text-editor/types.d.ts +3 -0
  40. package/dist/main.js +32 -32
  41. package/dist/map.js +4 -4
  42. package/dist/material.css +1 -1
  43. package/dist/pdf-reader.js +1 -1
  44. package/dist/{public-CYdnlHqA.js → public-BdJCVnGS.js} +3 -3
  45. package/dist/{sortable-provider-CY_YD3Ee.js → sortable-provider-BshacF8v.js} +1 -1
  46. package/dist/{use-chat-composer-CoyqPKbt.js → use-chat-composer-C82hvxm4.js} +11 -10
  47. package/docs/components/buttons-and-actions.md +29 -1
  48. package/docs/components/data-table-filter-and-lists.md +10 -1
  49. package/docs/components/feedback-and-status.md +3 -1
  50. package/docs/components/form-fields.md +10 -4
  51. package/docs/components/media-and-files.md +1 -0
  52. package/docs/components/primitives.md +1 -1
  53. package/docs/components/rich-widgets.md +2 -2
  54. package/lib/components/ui/actions/icon-button/icon-button.css +58 -0
  55. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
- import { f as t } from "./dialog-Cdv9IXVo.js";
2
+ import { f as t } from "./dialog-DR9rACzY.js";
3
3
  import { a as n, i as r, n as i } from "./field-blur-context-Cft9s7Hg.js";
4
- import { t as a } from "./icon-button-ifTpXt0A.js";
4
+ import { t as a } from "./icon-button-CN9r5TNE.js";
5
5
  import { isValidElement as o, useId as s } from "react";
6
6
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
7
  import { describedBy as u } from "@nxgt/material-core/described-by";
@@ -8,8 +8,14 @@ import { t as f } from "./button-group-context-CaP0X5p_.js";
8
8
  import { shapeOutline as p, toSvgPath as m } from "@nxgt/material-core/shapes";
9
9
  import { useContext as h, useEffect as g, useRef as _ } from "react";
10
10
  import { jsx as v, jsxs as y } from "react/jsx-runtime";
11
+ //#region lib/components/ui/display/count-badge/format-count.ts
12
+ function b(e, t = 99) {
13
+ let n = Math.max(0, Math.round(e));
14
+ return n > t ? `${t}+` : String(n);
15
+ }
16
+ //#endregion
11
17
  //#region lib/components/ui/actions/icon-button/icon-button.compound-variants.ts
12
- var b = [
18
+ var x = [
13
19
  {
14
20
  variant: "filled",
15
21
  color: "primary",
@@ -185,7 +191,7 @@ var b = [
185
191
  color: "default",
186
192
  class: `${u.default} ${d.default} ${l.default} underline-offset-4 hover:underline hover:bg-foreground/10 active:bg-muted focus:bg-foreground/10`
187
193
  }
188
- ], x = i("inline-flex center gap-2 cursor-pointer whitespace-nowrap text-sm font-medium disabled:pointer-events-none [&_svg]:bg-transparent [&_svg]:text-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-(--btn-ic,1rem) shrink-0 [&_svg]:shrink-0", {
194
+ ], S = i("inline-flex center gap-2 cursor-pointer whitespace-nowrap text-sm font-medium disabled:pointer-events-none [&_svg]:bg-transparent [&_svg]:text-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-(--btn-ic,1rem) shrink-0 [&_svg]:shrink-0", {
189
195
  variants: {
190
196
  look: {
191
197
  btn: "nxgt-btn nxgt-morph-fill aria-invalid:[--btn-focus:var(--color-error)] aria-invalid:[--btn-line:var(--color-error)]",
@@ -220,22 +226,22 @@ var b = [
220
226
  size: "legacy",
221
227
  width: "default"
222
228
  },
223
- compoundVariants: [...b, {
229
+ compoundVariants: [...x, {
224
230
  look: "btn",
225
231
  size: "legacy",
226
232
  width: "default",
227
233
  class: "[--btn-round:50%]"
228
234
  }]
229
235
  });
230
- function S(e) {
231
- return (t) => x({
236
+ function C(e) {
237
+ return (t) => S({
232
238
  ...t,
233
239
  look: e,
234
240
  size: t?.size ?? "legacy",
235
241
  color: t?.variant === "ghost" && t.color == null ? "default" : t?.color
236
242
  });
237
243
  }
238
- var C = S("btn"), w = S("shaped"), T = {
244
+ var w = C("btn"), T = C("shaped"), E = {
239
245
  filled: {
240
246
  primary: "fill-primary",
241
247
  secondary: "fill-secondary dark:fill-[color-mix(in_oklab,var(--color-secondary)_70%,var(--color-background))]",
@@ -282,7 +288,7 @@ var C = S("btn"), w = S("shaped"), T = {
282
288
  default: "fill-transparent group-hover/icon-button:fill-accent dark:group-hover/icon-button:fill-accent/50"
283
289
  }
284
290
  };
285
- function E({ shape: n, variant: r, color: i }) {
291
+ function D({ shape: n, variant: r, color: i }) {
286
292
  let a = p(n), o = _(null);
287
293
  return t(o, a, !0), /* @__PURE__ */ v("svg", {
288
294
  "data-slot": "icon-button-shape",
@@ -295,61 +301,74 @@ function E({ shape: n, variant: r, color: i }) {
295
301
  d: m(a),
296
302
  vectorEffect: "non-scaling-stroke",
297
303
  paintOrder: "stroke",
298
- className: e("stroke-transparent stroke-1 transition-[fill]", T[r][i], "group-focus-visible/icon-button:stroke-ring/50 group-focus-visible/icon-button:stroke-[6px]", "forced-colors:fill-none forced-colors:stroke-[ButtonText] forced-colors:group-focus-visible/icon-button:stroke-[Highlight]")
304
+ className: e("stroke-transparent stroke-1 transition-[fill]", E[r][i], "group-focus-visible/icon-button:stroke-ring/50 group-focus-visible/icon-button:stroke-[6px]", "forced-colors:fill-none forced-colors:stroke-[ButtonText] forced-colors:group-focus-visible/icon-button:stroke-[Highlight]")
299
305
  })
300
306
  });
301
307
  }
302
308
  //#endregion
303
309
  //#region lib/components/ui/actions/icon-button/icon-button.tsx
304
- function D({ variant: t, color: i, size: a, width: c, className: l, asChild: u, type: d = "button", shape: p, morph: m = "pill", children: _, ...b }) {
305
- let x = u ? r : "button", S = h(f), T = a ?? S, D = !!(b["aria-label"] || b["aria-labelledby"]), O = !!p && c != null && c !== "default";
310
+ function O(e) {
311
+ return e === void 0 || !Number.isFinite(e) || e < .5 ? null : b(e);
312
+ }
313
+ function k({ variant: t, color: i, size: a, width: c, className: l, asChild: u, type: d = "button", shape: p, morph: m = "pill", badge: _, badgeTone: b = "primary", children: x, ...S }) {
314
+ let C = u ? r : "button", E = h(f), k = a ?? E, A = !!(S["aria-label"] || S["aria-labelledby"]), j = !!p && c != null && c !== "default";
306
315
  g(() => {
307
- O && !o() && console.warn("IconButton: `width` is ignored with `shape`; a shaped button is as wide as it is high.");
308
- }, [O]);
309
- let k = !p && m !== "none" && b["aria-pressed"] !== void 0, A = b["aria-pressed"] === !0 || b["aria-pressed"] === "true";
316
+ j && !o() && console.warn("IconButton: `width` is ignored with `shape`; a shaped button is as wide as it is high.");
317
+ }, [j]);
318
+ let M = !p && m !== "none" && S["aria-pressed"] !== void 0, N = O(_), P = S["aria-pressed"] === !0 || S["aria-pressed"] === "true";
310
319
  return /* @__PURE__ */ v(s, {
311
- value: D,
312
- children: /* @__PURE__ */ y(x, {
320
+ value: A,
321
+ children: /* @__PURE__ */ y(C, {
313
322
  "data-slot": "icon-button",
314
323
  "data-icon-button": "",
315
324
  "data-variant": t ?? "filled",
316
325
  "data-color": i,
317
326
  type: u ? void 0 : d,
318
- "data-size": T,
327
+ "data-size": k,
319
328
  "data-shape": p,
320
- "data-morph": k ? m : void 0,
321
- "data-selected": k && A ? "true" : void 0,
322
- className: e(p ? w({
329
+ "data-morph": M ? m : void 0,
330
+ "data-selected": M && P ? "true" : void 0,
331
+ className: e(p ? T({
323
332
  variant: t,
324
333
  color: i,
325
- size: T
326
- }) : C({
334
+ size: k
335
+ }) : w({
327
336
  variant: t,
328
337
  color: i,
329
- size: T,
338
+ size: k,
330
339
  width: c
331
340
  }), p && "group/icon-button nxgt-touch-target relative isolate bg-transparent! border-0! shadow-none! ring-0! focus-visible:ring-0! aria-invalid:ring-0! forced-colors:[&_svg]:stroke-[ButtonText] forced-colors:[&_svg]:text-[ButtonText]", l),
332
- ...b,
333
- children: [p ? /* @__PURE__ */ v(E, {
334
- shape: p,
335
- variant: t ?? "filled",
336
- color: i ?? (t === "ghost" ? "default" : "primary")
337
- }) : null, /* @__PURE__ */ v(n, { children: _ })]
341
+ ...S,
342
+ children: [
343
+ p ? /* @__PURE__ */ v(D, {
344
+ shape: p,
345
+ variant: t ?? "filled",
346
+ color: i ?? (t === "ghost" ? "default" : "primary")
347
+ }) : null,
348
+ /* @__PURE__ */ v(n, { children: x }),
349
+ N === null ? null : /* @__PURE__ */ v("span", {
350
+ "data-slot": "icon-button-badge",
351
+ "aria-hidden": "true",
352
+ "data-tone": b,
353
+ className: "nxgt-icon-button-badge",
354
+ children: N
355
+ })
356
+ ]
338
357
  })
339
358
  });
340
359
  }
341
- function O({ tooltip: e, "aria-label": t, ...n }) {
360
+ function A({ tooltip: e, "aria-label": t, ...n }) {
342
361
  let r = t ?? (typeof e == "string" ? e : void 0);
343
362
  return e ? /* @__PURE__ */ v(a, {
344
363
  content: e,
345
- children: /* @__PURE__ */ v(D, {
364
+ children: /* @__PURE__ */ v(k, {
346
365
  "aria-label": r,
347
366
  ...n
348
367
  })
349
- }) : /* @__PURE__ */ v(D, {
368
+ }) : /* @__PURE__ */ v(k, {
350
369
  "aria-label": r,
351
370
  ...n
352
371
  });
353
372
  }
354
373
  //#endregion
355
- export { C as n, O as t };
374
+ export { w as n, b as r, A as t };
@@ -41,5 +41,13 @@ export type ButtonProps = ComponentProps<'button'> & ButtonVariants & {
41
41
  tooltip?: string;
42
42
  };
43
43
  export declare function Button({ tooltip, ...props }: ButtonProps): import("react").JSX.Element;
44
+ /** One `variant` of `Button`: `filled`, `tonal`, `outlined`, `ghost` or `link`. */
45
+ export type ButtonVariant = NonNullable<ButtonVariants['variant']>;
46
+ /**
47
+ * The variant of the Cancel / Close button a component draws in its footer:
48
+ * `tonal`, under a filled Confirm. The components that draw one take a
49
+ * `cancelVariant` prop to restore another look (`'outlined'`, `'ghost'`).
50
+ */
51
+ export declare const DEFAULT_CANCEL_VARIANT: ButtonVariant;
44
52
  export type { ButtonVariants };
45
53
  export { buttonVariants };
@@ -37,6 +37,20 @@ export type IconButtonProps = {
37
37
  * are unaffected.
38
38
  */
39
39
  morph?: 'round' | 'pill' | 'none';
40
+ /**
41
+ * A count drawn on the button's top end corner (the top left in a
42
+ * right-to-left page): "99+" past 99, nothing at 0, below 0.5, when not
43
+ * finite or when unset. It takes no room, so the button keeps its size and
44
+ * its 44px touch target, and it is decorative (`aria-hidden`): give the
45
+ * button the full accessible name yourself, e.g.
46
+ * `aria-label="Publish 2 items"`. A `tooltip` string names the button too.
47
+ */
48
+ badge?: number;
49
+ /**
50
+ * The colour of the `badge`: `primary` (default: a count is not an
51
+ * alert), `error` (a notification) or `neutral` (the page's text colour).
52
+ */
53
+ badgeTone?: 'primary' | 'error' | 'neutral';
40
54
  };
41
55
  export declare function IconButton({ tooltip, 'aria-label': ariaLabel, ...props }: IconButtonProps): import("react").JSX.Element;
42
56
  export { variants as iconButtonVariants };
@@ -1,4 +1,5 @@
1
1
  import { Row, RowData } from '@tanstack/react-table';
2
+ import { ButtonVariant } from '../../actions/button/button.js';
2
3
  import { DataTableFeatures } from './features.js';
3
4
  export declare function useColumnHelpers<T extends RowData>(): {
4
5
  columnHelper: import('@tanstack/table-core').ColumnHelper<{
@@ -65,7 +66,11 @@ export type DeleteRowsHandler<T extends RowData> = (rows: Row<DataTableFeatures,
65
66
  * {confirmDialog}
66
67
  * ```
67
68
  */
68
- export declare function useDeleteRowsHandler<T extends RowData>(onDelete?: (rows: T[]) => void): {
69
+ export declare function useDeleteRowsHandler<T extends RowData>(onDelete?: (rows: T[]) => void,
70
+ /** `cancelVariant`: the Cancel button's variant, default `'tonal'`. */
71
+ options?: {
72
+ cancelVariant?: ButtonVariant;
73
+ }): {
69
74
  handleDelete: DeleteRowsHandler<T>;
70
75
  confirmDialog: import("react").JSX.Element;
71
76
  };
@@ -7,4 +7,4 @@ import { FilterViewProps } from '../query/types.js';
7
7
  * CSS from the first paint). The live region tells the count; `/` and `F`
8
8
  * are its shortcuts (`F` opens the sheet on a phone).
9
9
  */
10
- export declare function FilterBarView({ label, searchLabel, searchPlaceholder, className, detachedChips, sheetTrigger, bandDensity, }: FilterViewProps): import("react").JSX.Element;
10
+ export declare function FilterBarView({ label, searchLabel, searchPlaceholder, className, detachedChips, sheetTrigger, bandDensity, cancelVariant, }: FilterViewProps): import("react").JSX.Element;
@@ -6,4 +6,4 @@ import { FilterViewProps } from '../query/types.js';
6
6
  * (N)", which opens the same sheet with the same facets (mounted there
7
7
  * only; the server renders the panel, which a phone unmounts once hydrated). One live region, the bar's.
8
8
  */
9
- export declare function FilterFacets({ label, searchLabel, searchPlaceholder, className, }: FilterViewProps): import("react").JSX.Element;
9
+ export declare function FilterFacets({ label, searchLabel, searchPlaceholder, className, cancelVariant, }: FilterViewProps): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { ButtonVariant } from '../../../../actions/button/button.js';
1
2
  /**
2
3
  * `apply="staged"`: Reset drops the panel's edits, Apply hands them to the
3
4
  * page at once; the focus stays on the button, and the live region tells
@@ -5,4 +6,6 @@
5
6
  * focusable, and dimmed) while nothing changed; once something did,
6
7
  * "Changes not applied" starts their row and describes Apply.
7
8
  */
8
- export declare function FilterFacetsFooter(): import("react").JSX.Element;
9
+ export declare function FilterFacetsFooter({ cancelVariant, }: {
10
+ cancelVariant?: ButtonVariant;
11
+ }): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { FilterModelField } from '@nxgt/material-core/filter';
2
+ import { ButtonVariant } from '../../../../actions/button/button.js';
2
3
  /**
3
4
  * The wide panel, from 768px: its title and "Clear all", the page's locked
4
5
  * filters, a removable chip for each condition on a field it has no section
@@ -6,6 +7,7 @@ import { FilterModelField } from '@nxgt/material-core/filter';
6
7
  * section per field (the sheet's, in its order), and with `apply="staged"`
7
8
  * Reset and Apply.
8
9
  */
9
- export declare function FilterFacetsPanel({ sections, }: {
10
+ export declare function FilterFacetsPanel({ sections, cancelVariant, }: {
10
11
  sections: readonly FilterModelField[];
12
+ cancelVariant?: ButtonVariant;
11
13
  }): import("react").JSX.Element;
@@ -5,4 +5,4 @@ import { FilterPresetsProps } from './types.js';
5
5
  * @deprecated Saved views are planned as `ViewTabs` over the filter bar (see
6
6
  * the roadmap). Will be removed in a future major.
7
7
  */
8
- export declare function FilterPresets({ presets, currentPresetId, onLoad, onSave, onDelete, onSetDefault, maxPresets, disabled, className, }: FilterPresetsProps): import("react").JSX.Element;
8
+ export declare function FilterPresets({ presets, currentPresetId, onLoad, onSave, onDelete, onSetDefault, maxPresets, disabled, className, cancelVariant, }: FilterPresetsProps): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { FilterApply, FilterCountsOption, FilterDefaults, FilterFieldErrors, FilterLockedCondition, FilterModel, FilterPreviewCount, FilterQuery, FilterSearchApplyMode, FilterShortcutsOption } from '@nxgt/material-core/filter';
2
2
  import { ReactNode } from 'react';
3
+ import { ButtonVariant } from '../../../actions/button/button.js';
3
4
  import { FilterBarFieldProps } from '../editors/custom-types.js';
4
5
  /** The bar's spacing: `compact` draws small chips; every target stays 24px or more. */
5
6
  export type FilterDensity = 'comfortable' | 'compact';
@@ -24,6 +25,12 @@ export type FilterViewProps = {
24
25
  sheetTrigger?: boolean;
25
26
  /** `'compact'`: 6px back under the bar; see `FilterQueryProps`. */
26
27
  bandDensity?: 'comfortable' | 'compact';
28
+ /**
29
+ * The variant of the secondary button in the sheet's and the staged
30
+ * panel's footer ("Clear all", "Reset"). Default `'tonal'`; `'outlined'`
31
+ * restores the earlier look.
32
+ */
33
+ cancelVariant?: ButtonVariant;
27
34
  };
28
35
  /**
29
36
  * When the search text reaches the query: `'live'` (the default) as it is
@@ -141,6 +148,12 @@ export type FilterQueryProps = {
141
148
  * `variant="bar"` only.
142
149
  */
143
150
  bandDensity?: 'comfortable' | 'compact';
151
+ /**
152
+ * The variant of the secondary button in the sheet's and the staged
153
+ * panel's footer ("Clear all", "Reset"). Default `'tonal'`; `'outlined'`
154
+ * restores the earlier look.
155
+ */
156
+ cancelVariant?: ButtonVariant;
144
157
  /**
145
158
  * The quick filters' fields, as dashed "+ Field" pills (a switch or a
146
159
  * checkbox toggles); default: the fields declared `quick: true`.
@@ -1,3 +1,4 @@
1
+ import { ButtonVariant } from '../../../../actions/button/button.js';
1
2
  import { FilterSheetModel } from './use-filter-sheet.js';
2
3
  /**
3
4
  * The sheet's footer: "Clear all" (the conditions only, the locked ones and
@@ -5,6 +6,7 @@ import { FilterSheetModel } from './use-filter-sheet.js';
5
6
  * "Show N results", busy while the count is on its way, the focus left where
6
7
  * it is.
7
8
  */
8
- export declare function FilterSheetFooter({ sheet }: {
9
+ export declare function FilterSheetFooter({ sheet, cancelVariant, }: {
9
10
  sheet: FilterSheetModel;
11
+ cancelVariant?: ButtonVariant;
10
12
  }): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { ButtonVariant } from '../../../../actions/button/button.js';
1
2
  import { FilterSheetModel } from './use-filter-sheet.js';
2
3
  /**
3
4
  * The phone sheet, a bottom Drawer named "Filters", mounted below 768px
@@ -5,6 +6,7 @@ import { FilterSheetModel } from './use-filter-sheet.js';
5
6
  * on its first section (or the field asked); Close, Escape, a swipe, a click
6
7
  * outside or Back dismiss it, and the focus returns to the "Filters (N)" that opened it.
7
8
  */
8
- export declare function FilterSheet({ sheet }: {
9
+ export declare function FilterSheet({ sheet, cancelVariant, }: {
9
10
  sheet: FilterSheetModel;
11
+ cancelVariant?: ButtonVariant;
10
12
  }): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { ButtonVariant } from '../../actions/button/button.js';
2
3
  import { FilterPersistenceConfig, FilterPreset, FilterPresetConfig } from './types-persistence.js';
3
4
  import { FilterSchema } from './types-schema.js';
4
5
  import { FilterValues } from './types-values.js';
@@ -61,4 +62,6 @@ export type FilterPresetsProps = {
61
62
  maxPresets?: number;
62
63
  disabled?: boolean;
63
64
  className?: string;
65
+ /** The save dialog's Cancel button variant. Default `'tonal'`. */
66
+ cancelVariant?: ButtonVariant;
64
67
  };
@@ -1,3 +1,4 @@
1
+ import { ButtonVariant } from '../../actions/button/button.js';
1
2
  export interface ConfirmDialogProps {
2
3
  open: boolean;
3
4
  onOpenChange: (open: boolean) => void;
@@ -5,6 +6,11 @@ export interface ConfirmDialogProps {
5
6
  description: string;
6
7
  confirmLabel?: string;
7
8
  cancelLabel?: string;
9
+ /**
10
+ * The variant of the Cancel button. Default `'tonal'`; `'outlined'` or
11
+ * `'ghost'` restores the earlier look.
12
+ */
13
+ cancelVariant?: ButtonVariant;
8
14
  /**
9
15
  * Runs when the user confirms. The dialog stays open, with its buttons
10
16
  * disabled, until the returned promise settles. It closes on success; on
@@ -23,4 +29,4 @@ export interface ConfirmDialogProps {
23
29
  */
24
30
  lockOnRefusal?: boolean;
25
31
  }
26
- export declare function ConfirmDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, onConfirm, variant, loading, confirmDisabled, lockOnRefusal, }: ConfirmDialogProps): import("react").JSX.Element;
32
+ export declare function ConfirmDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, cancelVariant, onConfirm, variant, loading, confirmDisabled, lockOnRefusal, }: ConfirmDialogProps): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { DefaultValues, UseFormReturn } from 'react-hook-form';
3
3
  import { default as z } from 'zod';
4
+ import { ButtonVariant } from '../../actions/button/button.js';
4
5
  import { IconButtonProps } from '../../actions/icon-button/icon-button.js';
5
6
  import { CustomDialogProps } from '../custom-dialog/custom-dialog.js';
6
7
  /**
@@ -9,6 +10,11 @@ import { CustomDialogProps } from '../custom-dialog/custom-dialog.js';
9
10
  */
10
11
  export type ConfirmationDialogProps<T> = {
11
12
  cancelText?: ReactNode;
13
+ /**
14
+ * The variant of the Cancel button. Default `'tonal'`; `'outlined'` or
15
+ * `'ghost'` restores the earlier look.
16
+ */
17
+ cancelVariant?: ButtonVariant;
12
18
  confirmText?: ReactNode;
13
19
  /** Called with the schema's parsed output, only once the form is valid. */
14
20
  onConfirm?: T extends z.ZodObject<any> ? (values: z.infer<T>) => void : () => void;
@@ -19,4 +25,4 @@ export type ConfirmationDialogProps<T> = {
19
25
  } : never;
20
26
  iconProps?: IconButtonProps;
21
27
  } & Omit<CustomDialogProps, 'footer'> & Pick<IconButtonProps, 'variant' | 'color'>;
22
- export declare function ConfirmationDialog<T>({ children, formOptions, open, defaultOpen, onOpenChange, cancelText, confirmText, onConfirm, variant, color, iconProps, icon, ...props }: ConfirmationDialogProps<T>): import("react").JSX.Element;
28
+ export declare function ConfirmationDialog<T>({ children, formOptions, open, defaultOpen, onOpenChange, cancelText, cancelVariant, confirmText, onConfirm, variant, color, iconProps, icon, ...props }: ConfirmationDialogProps<T>): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { ButtonVariant } from '../../actions/button/button.js';
1
2
  import { Attribute } from './models/attribute.js';
2
3
  export type AttributeDialogProps = {
3
4
  open: boolean;
@@ -6,7 +7,9 @@ export type AttributeDialogProps = {
6
7
  onSave: (attribute: Attribute) => void;
7
8
  onDelete?: () => void;
8
9
  disabled?: boolean;
10
+ /** The Cancel button's variant. Default `'tonal'`; `'outlined'` restores the earlier look. */
11
+ cancelVariant?: ButtonVariant;
9
12
  /** The other attributes' names; the form refuses to save one of them. */
10
13
  otherNames?: string[];
11
14
  };
12
- export declare function AttributeDialog({ open, onOpenChange, attribute, onSave, onDelete, disabled, otherNames, }: AttributeDialogProps): import("react").JSX.Element;
15
+ export declare function AttributeDialog({ open, onOpenChange, attribute, onSave, onDelete, disabled, otherNames, cancelVariant, }: AttributeDialogProps): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { ComponentProps, ReactNode } from 'react';
2
+ import { ButtonVariant } from '../../../actions/button/button.js';
2
3
  import { Attribute } from '../models/attribute.js';
3
4
  export type AttributesDialogFieldProps = {
4
5
  attributes?: Attribute[];
@@ -9,6 +10,8 @@ export type AttributesDialogFieldProps = {
9
10
  /** Shows `helperText` as an error. */
10
11
  error?: boolean;
11
12
  helperText?: ReactNode;
13
+ /** The dialog's Cancel button variant. Default `'tonal'`; `'outlined'` restores the earlier look. */
14
+ cancelVariant?: ButtonVariant;
12
15
  } & ComponentProps<'div'>;
13
16
  /** The attributes as a list, and one dialog that edits one of them at a time. */
14
- export declare function AttributesDialogField({ attributes, onChange, readonly, disabled, label, error, helperText, className, ...props }: AttributesDialogFieldProps): import("react").JSX.Element;
17
+ export declare function AttributesDialogField({ attributes, onChange, readonly, disabled, label, error, helperText, className, cancelVariant, ...props }: AttributesDialogFieldProps): import("react").JSX.Element;
@@ -5,4 +5,4 @@ import { AttributesDialogFieldProps } from './attributes-dialog-field.js';
5
5
  * changes from outside (a form `reset`), without echoing it back. A new array
6
6
  * with the same content is not a change.
7
7
  */
8
- export declare function AttributesInlineField({ attributes, onChange, disabled, label, error, helperText, className, readonly: _readonly, ...props }: AttributesDialogFieldProps): import("react").JSX.Element;
8
+ export declare function AttributesInlineField({ attributes, onChange, disabled, label, error, helperText, className, readonly: _readonly, cancelVariant: _cancelVariant, ...props }: AttributesDialogFieldProps): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { ButtonVariant } from '../../actions/button/button.js';
1
2
  import { Contact } from './models.js';
2
3
  export type ContactDialogProps = {
3
4
  open: boolean;
@@ -6,5 +7,7 @@ export type ContactDialogProps = {
6
7
  onSave: (contact: Contact) => void;
7
8
  onDelete?: () => void;
8
9
  disabled?: boolean;
10
+ /** The Cancel button's variant. Default `'tonal'`; `'outlined'` restores the earlier look. */
11
+ cancelVariant?: ButtonVariant;
9
12
  };
10
- export declare function ContactDialog({ open, onOpenChange, contact, onSave, onDelete, disabled, }: ContactDialogProps): import("react").JSX.Element;
13
+ export declare function ContactDialog({ open, onOpenChange, contact, onSave, onDelete, disabled, cancelVariant, }: ContactDialogProps): import("react").JSX.Element;
@@ -1,9 +1,12 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { UseControllerProps } from 'react-hook-form';
3
+ import { ButtonVariant } from '../../actions/button/button.js';
3
4
  export type ContactsDialogFieldProps<T extends Record<string, any>> = Pick<UseControllerProps<T>, 'control' | 'name'> & {
4
5
  className?: string;
5
6
  disabled?: boolean;
6
7
  label?: string;
8
+ /** The dialog's Cancel button variant. Default `'tonal'`; `'outlined'` restores the earlier look. */
9
+ cancelVariant?: ButtonVariant;
7
10
  } & Omit<ComponentProps<'div'>, 'name'>;
8
11
  /** `ContactsFormField` with `editing="dialog"`: a list, and a dialog per contact. */
9
- export declare function ContactsDialogField<T extends Record<string, any>>({ control, name, className, disabled, label, ...props }: ContactsDialogFieldProps<T>): import("react").JSX.Element;
12
+ export declare function ContactsDialogField<T extends Record<string, any>>({ control, name, className, disabled, label, cancelVariant, ...props }: ContactsDialogFieldProps<T>): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { UseControllerProps } from 'react-hook-form';
3
+ import { ButtonVariant } from '../../actions/button/button.js';
3
4
  export type ContactsFormFieldProps<T extends Record<string, any>> = Pick<UseControllerProps<T>, 'control' | 'name'> & {
4
5
  className?: string;
5
6
  disabled?: boolean;
@@ -12,10 +13,12 @@ export type ContactsFormFieldProps<T extends Record<string, any>> = Pick<UseCont
12
13
  editing?: 'inline' | 'dialog';
13
14
  /** `editing="inline"` only: `'list'` (default) or `'cards'`. */
14
15
  variant?: 'list' | 'cards';
16
+ /** `editing="dialog"` only: the dialog's Cancel button variant. Default `'tonal'`. */
17
+ cancelVariant?: ButtonVariant;
15
18
  } & Omit<ComponentProps<'div'>, 'name'>;
16
19
  /**
17
20
  * Contacts in a React Hook Form field (an array of `{ type, value, label?,
18
21
  * primary? }`). Inline by default; `editing="dialog"` is today's list and
19
22
  * dialog.
20
23
  */
21
- export declare function ContactsFormField<T extends Record<string, any>>({ editing, variant, ...props }: ContactsFormFieldProps<T>): import("react").JSX.Element;
24
+ export declare function ContactsFormField<T extends Record<string, any>>({ editing, variant, cancelVariant, ...props }: ContactsFormFieldProps<T>): import("react").JSX.Element;
@@ -1,10 +1,13 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { UseControllerProps } from 'react-hook-form';
3
+ import { ButtonVariant } from '../../actions/button/button.js';
3
4
  export type OpeningHoursDialogFieldProps<T extends Record<string, any>> = Pick<UseControllerProps<T>, 'control' | 'name'> & {
4
5
  className?: string;
5
6
  disabled?: boolean;
6
7
  label?: string;
7
8
  showAddAllDays?: boolean;
9
+ /** The dialog's Cancel button variant. Default `'tonal'`; `'outlined'` restores the earlier look. */
10
+ cancelVariant?: ButtonVariant;
8
11
  } & Omit<ComponentProps<'div'>, 'name'>;
9
12
  /** `OpeningHoursFormField` with `editing="dialog"`: a list, and a dialog per range. */
10
- export declare function OpeningHoursDialogField<T extends Record<string, any>>({ control, name, className, disabled, label, showAddAllDays, ...props }: OpeningHoursDialogFieldProps<T>): import("react").JSX.Element;
13
+ export declare function OpeningHoursDialogField<T extends Record<string, any>>({ control, name, className, disabled, label, showAddAllDays, cancelVariant, ...props }: OpeningHoursDialogFieldProps<T>): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { ButtonVariant } from '../../actions/button/button.js';
1
2
  import { OpeningHour } from './models.js';
2
3
  export type OpeningHoursDialogProps = {
3
4
  open: boolean;
@@ -6,5 +7,7 @@ export type OpeningHoursDialogProps = {
6
7
  onSave: (value: OpeningHour) => void;
7
8
  onDelete?: () => void;
8
9
  disabled?: boolean;
10
+ /** The Cancel button's variant. Default `'tonal'`; `'outlined'` restores the earlier look. */
11
+ cancelVariant?: ButtonVariant;
9
12
  };
10
- export declare function OpeningHoursDialog({ open, onOpenChange, value, onSave, onDelete, disabled, }: OpeningHoursDialogProps): import("react").JSX.Element;
13
+ export declare function OpeningHoursDialog({ open, onOpenChange, value, onSave, onDelete, disabled, cancelVariant, }: OpeningHoursDialogProps): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { UseControllerProps } from 'react-hook-form';
3
+ import { ButtonVariant } from '../../actions/button/button.js';
3
4
  import { WeekStart } from './logic/week.js';
4
5
  export type OpeningHoursFormFieldProps<T extends Record<string, any>> = Pick<UseControllerProps<T>, 'control' | 'name'> & {
5
6
  className?: string;
@@ -13,6 +14,8 @@ export type OpeningHoursFormFieldProps<T extends Record<string, any>> = Pick<Use
13
14
  editing?: 'inline' | 'dialog';
14
15
  /** `editing="dialog"` only: the "Add All Days" button. */
15
16
  showAddAllDays?: boolean;
17
+ /** `editing="dialog"` only: the dialog's Cancel button variant. Default `'tonal'`. */
18
+ cancelVariant?: ButtonVariant;
16
19
  /** `editing="inline"` only: the first day of the week, `0` Sunday. */
17
20
  weekStartsOn?: WeekStart;
18
21
  /** `editing="inline"` only: the locale of day and time names. */
@@ -22,4 +25,4 @@ export type OpeningHoursFormFieldProps<T extends Record<string, any>> = Pick<Use
22
25
  * Opening hours in a React Hook Form field (an array of one entry per
23
26
  * range). Inline by default; `editing="dialog"` is today's list and dialog.
24
27
  */
25
- export declare function OpeningHoursFormField<T extends Record<string, any>>({ editing, showAddAllDays, weekStartsOn, locale, ...props }: OpeningHoursFormFieldProps<T>): import("react").JSX.Element;
28
+ export declare function OpeningHoursFormField<T extends Record<string, any>>({ editing, showAddAllDays, cancelVariant, weekStartsOn, locale, ...props }: OpeningHoursFormFieldProps<T>): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { ButtonVariant } from '../../actions/button/button.js';
1
2
  import { PostalAddressFieldValue } from './models.js';
2
3
  export type PostalAddressDialogProps = {
3
4
  open: boolean;
@@ -6,5 +7,7 @@ export type PostalAddressDialogProps = {
6
7
  onSave: (value: PostalAddressFieldValue) => void;
7
8
  onDelete?: () => void;
8
9
  disabled?: boolean;
10
+ /** The Cancel button's variant. Default `'tonal'`; `'outlined'` restores the earlier look. */
11
+ cancelVariant?: ButtonVariant;
9
12
  };
10
- export declare function PostalAddressDialog({ open, onOpenChange, value, onSave, onDelete, disabled, }: PostalAddressDialogProps): import("react").JSX.Element;
13
+ export declare function PostalAddressDialog({ open, onOpenChange, value, onSave, onDelete, disabled, cancelVariant, }: PostalAddressDialogProps): import("react").JSX.Element;
@@ -1,8 +1,11 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { UseControllerProps } from 'react-hook-form';
3
+ import { ButtonVariant } from '../../actions/button/button.js';
3
4
  export type PostalAddressFormFieldProps<T extends Record<string, any>> = Pick<UseControllerProps<T>, 'control' | 'name'> & {
4
5
  className?: string;
5
6
  disabled?: boolean;
6
7
  label?: string;
8
+ /** The dialog's Cancel button variant. Default `'tonal'`; `'outlined'` restores the earlier look. */
9
+ cancelVariant?: ButtonVariant;
7
10
  } & Omit<ComponentProps<'div'>, 'name'>;
8
- export declare function PostalAddressFormField<T extends Record<string, any>>({ control, name, className, disabled, label, ...props }: PostalAddressFormFieldProps<T>): import("react").JSX.Element;
11
+ export declare function PostalAddressFormField<T extends Record<string, any>>({ control, name, className, disabled, label, cancelVariant, ...props }: PostalAddressFormFieldProps<T>): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { ButtonVariant } from '../../actions/button/button.js';
1
2
  import { ImageCropResult, ImageCropShape } from './types.js';
2
3
  export type ImageCropperProps = {
3
4
  src: string;
@@ -6,6 +7,8 @@ export type ImageCropperProps = {
6
7
  fileName?: string;
7
8
  onCrop: (result: ImageCropResult) => void;
8
9
  onCancel?: () => void;
10
+ /** The Cancel button's variant. Default `'tonal'`; `'ghost'` restores the earlier look. */
11
+ cancelVariant?: ButtonVariant;
9
12
  className?: string;
10
13
  };
11
- export declare function ImageCropper({ src, aspect: aspectProp, cropShape, fileName, onCrop, onCancel, className, }: ImageCropperProps): import("react").JSX.Element;
14
+ export declare function ImageCropper({ src, aspect: aspectProp, cropShape, fileName, onCrop, onCancel, cancelVariant, className, }: ImageCropperProps): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { ButtonVariant } from '../../actions/button/button.js';
1
2
  import { RichTextMentionSuggestion } from '../editor/extensions/mention/mention-items.js';
2
3
  import { LegacyFeatureFlags } from '../editor/kit/legacy-flags.js';
3
4
  /** The 15 on/off flags of the old editor (`options.features`); the core owns the type. */
@@ -9,6 +10,8 @@ export interface RichTextEditorOptions {
9
10
  save?: string;
10
11
  cancel?: string;
11
12
  };
13
+ /** The Cancel button's variant. Default `'tonal'`; `'ghost'` restores the earlier look. */
14
+ cancelVariant?: ButtonVariant;
12
15
  /**
13
16
  * `@` suggestions: plain names, or `MentionItem`s (the type `MentionList`
14
17
  * and `ChatComposer` take). An item inserts its `id` and shows its `label`.