@nxgt/material 3.52.0 → 3.53.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 (112) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +5 -4
  3. package/dist/{async-slice-BGtmF3K5.js → async-slice-DDSsekfm.js} +2 -2
  4. package/dist/{button-Ct0KRBsN.js → button-Ct8DSLVv.js} +1 -1
  5. package/dist/charts.js +1064 -932
  6. package/dist/{chip-Ca1SEd70.js → chip-BzoNsd-W.js} +2 -2
  7. package/dist/{code-editor-DtwRhK8B.js → code-editor-DsLQeiZc.js} +6 -6
  8. package/dist/code-editor.js +5 -5
  9. package/dist/{code-language-items-CEclGxhA.js → code-language-items-4zXlIEZ0.js} +2 -2
  10. package/dist/components/components.css +1 -5
  11. package/dist/components/ui/actions/action-card/action-card-tile.css +11 -2
  12. package/dist/components/ui/collections/data-table/data-table-items-record.css +27 -0
  13. package/dist/components/ui/collections/data-table/index.css +14 -0
  14. package/dist/{components-CzELzsOi.js → components-DZPMvc1w.js} +15976 -15821
  15. package/dist/components.js +26 -26
  16. package/dist/{dialog-BIy04Hpd.js → dialog-DwPmwmA3.js} +4 -4
  17. package/dist/dnd.js +1 -1
  18. package/dist/draw-animate.js +1 -1
  19. package/dist/{dropdown-menu-B0Kd8x3G.js → dropdown-menu-CDN6Nqx6.js} +1 -1
  20. package/dist/editor.js +9 -9
  21. package/dist/{empty-state-CKxORwFE.js → empty-state-Bb9W9did.js} +2 -2
  22. package/dist/{escape-owner-BGKjiglh.js → escape-owner-DI_lg2ID.js} +1 -1
  23. package/dist/{field-blur-Dz1zPaYK.js → field-blur-BcJH8H9B.js} +1 -1
  24. package/dist/{field-blur-context-1T6GkSNc.js → field-blur-context-Dg1nwWOV.js} +1 -1
  25. package/dist/hooks.js +2 -2
  26. package/dist/{hover-card-BwQ9IRxa.js → hover-card-Qse4gnop.js} +2 -2
  27. package/dist/i18n-provider-DlVPS58N.js +79 -0
  28. package/dist/i18n.js +5 -5
  29. package/dist/{icon-badge-D5Ns7ndZ.js → icon-badge-DVPBQOKe.js} +3 -3
  30. package/dist/{icon-button-VzdqY_Tv.js → icon-button-C3wDxsh6.js} +12 -12
  31. package/dist/lib/components/ui/actions/action-card/action-card-semantics.d.ts +17 -1
  32. package/dist/lib/components/ui/actions/action-card/action-card.d.ts +16 -2
  33. package/dist/lib/components/ui/actions/action-card/partials/action-card-text.d.ts +6 -2
  34. package/dist/lib/components/ui/actions/action-card/partials/action-card-title-button.d.ts +15 -1
  35. package/dist/lib/components/ui/actions/action-card/partials/action-card-trail.d.ts +2 -1
  36. package/dist/lib/components/ui/collections/data-grid/columns/column-codec.d.ts +3 -3
  37. package/dist/lib/components/ui/collections/data-grid/columns/column-edit.d.ts +5 -5
  38. package/dist/lib/components/ui/collections/data-grid/columns/row-meta.d.ts +22 -0
  39. package/dist/lib/components/ui/collections/data-grid/grid-meta.d.ts +10 -3
  40. package/dist/lib/components/ui/collections/data-table/data-table.d.ts +1 -1
  41. package/dist/lib/components/ui/collections/data-table/layout-types.d.ts +27 -0
  42. package/dist/lib/components/ui/collections/data-table/partials/layouts/data-table-item-context.d.ts +2 -0
  43. package/dist/lib/components/ui/collections/data-table/partials/layouts/data-table-item-row.d.ts +8 -0
  44. package/dist/lib/components/ui/collections/data-table/types.d.ts +1 -1
  45. package/dist/lib/components/ui/collections/filter/bar/filter-bar-classes.d.ts +7 -2
  46. package/dist/lib/components/ui/collections/server-table/partials/server-table-band-classes.d.ts +5 -0
  47. package/dist/lib/components/ui/display/list-tile/internal.d.ts +1 -0
  48. package/dist/lib/components/ui/display/list-tile/partials/list-tile-dense-text.d.ts +28 -0
  49. package/dist/lib/components/ui/feedback/toast/toast-text.d.ts +7 -0
  50. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  51. package/dist/lib/components/ui/forms/index.d.ts +2 -0
  52. package/dist/lib/components/ui/forms/use-fast-form.d.ts +25 -0
  53. package/dist/lib/components/ui/forms/use-focus-on-refusal.d.ts +14 -0
  54. package/dist/lib/components/ui/layout/app-shell/activity-content-aside.d.ts +3 -1
  55. package/dist/lib/components/ui/layout/app-shell/activity-content.d.ts +10 -1
  56. package/dist/lib/components/ui/selection/switcher/partials/switcher-trigger.d.ts +3 -1
  57. package/dist/lib/components/ui/selection/switcher/switcher.d.ts +1 -1
  58. package/dist/lib/components/ui/selection/switcher/types.d.ts +7 -0
  59. package/dist/lib/components/ui/widgets/native-charts/core/reference-text.d.ts +14 -6
  60. package/dist/lib/components/ui/widgets/native-charts/core/reference.d.ts +57 -10
  61. package/dist/lib/components/ui/widgets/native-charts/core/types.d.ts +13 -5
  62. package/dist/lib/components/ui/widgets/native-charts/hooks/chart-model-types.d.ts +3 -2
  63. package/dist/lib/components/ui/widgets/native-charts/index.d.ts +1 -1
  64. package/dist/lib/components/ui/widgets/native-charts/line-chart/line-chart-types.d.ts +6 -1
  65. package/dist/lib/components/ui/widgets/native-charts/line-chart/partials/reference-marks.d.ts +1 -1
  66. package/dist/lib/i18n/material-resources-registry.d.ts +21 -0
  67. package/dist/lib/i18n/resources/en/en.d.ts +4 -0
  68. package/dist/lib/i18n/resources/en/material.json.d.ts +5 -1
  69. package/dist/lib/i18n/resources/fr/fr.d.ts +4 -0
  70. package/dist/lib/i18n/resources/fr/material.json.d.ts +5 -1
  71. package/dist/lib/i18n/resources/resources.d.ts +8 -0
  72. package/dist/lib/i18n/translator.d.ts +1 -1
  73. package/dist/lib.js +1 -1
  74. package/dist/main.js +43 -43
  75. package/dist/map.js +8 -8
  76. package/dist/material.css +1 -1
  77. package/dist/pdf-reader.js +1 -1
  78. package/dist/print.js +2 -2
  79. package/dist/{public-D-J3nZFm.js → public-BoVE0ffh.js} +9 -9
  80. package/dist/{rich-code-block-Ig0ERAa2.js → rich-code-block-DAUM7Yh_.js} +5 -5
  81. package/dist/{sortable-provider-DfPkSN90.js → sortable-provider-BLXsGE_0.js} +2 -2
  82. package/dist/{spinner-KQb3YuR_.js → spinner-Rg4PnBPH.js} +1 -1
  83. package/dist/{stored-language-Cb9FMEwk.js → stored-language-B1lJMPbR.js} +10 -2
  84. package/dist/theme-picker.js +2 -2
  85. package/dist/{theme-toggle-BY-SpsFV.js → theme-toggle-jVdxF_mc.js} +1 -1
  86. package/dist/{toolbar-items-30w9rG5h.js → toolbar-items-BFY_hns5.js} +4 -4
  87. package/dist/{translate-material-BPl8TQLg.js → translate-material-q-JNxP1m.js} +2 -2
  88. package/dist/{translator-BnQXtpSZ.js → translator-BU1o3_l9.js} +1 -1
  89. package/dist/{use-chat-composer-BSKJRYMB.js → use-chat-composer-DGbDuIUa.js} +3758 -3716
  90. package/dist/{use-heading-spy-BgXA8uz6.js → use-heading-spy-CP63sAcS.js} +1 -1
  91. package/dist/{use-material-translation-ByM3gD9R.js → use-material-translation-nNF8fUXz.js} +2 -2
  92. package/dist/use-shape-morph-DXdy2X5g.js +35 -0
  93. package/docs/components/buttons-and-actions.md +30 -1
  94. package/docs/components/data-table-filter-and-lists.md +2 -2
  95. package/docs/components/navigation-and-layout.md +1 -0
  96. package/docs/components/rich-widgets.md +2 -1
  97. package/docs/components/selection-and-choice.md +20 -0
  98. package/docs/guides/app-shell.md +22 -0
  99. package/docs/guides/cards-and-tiles.md +40 -4
  100. package/docs/guides/charts.md +30 -2
  101. package/docs/guides/data-grid.md +42 -2
  102. package/docs/guides/forms.md +35 -0
  103. package/docs/guides/i18n.md +6 -2
  104. package/docs/roadmap.md +84 -684
  105. package/docs/troubleshooting.md +21 -0
  106. package/lib/components/components.css +1 -5
  107. package/lib/components/ui/actions/action-card/action-card-tile.css +11 -2
  108. package/lib/components/ui/collections/data-table/data-table-items-record.css +27 -0
  109. package/lib/components/ui/collections/data-table/index.css +14 -0
  110. package/package.json +1 -1
  111. package/dist/i18n-provider-BFNrM0Qu.js +0 -45
  112. package/dist/use-shape-morph-BKA_R5P5.js +0 -35
@@ -273,6 +273,7 @@ words in your error.
273
273
  - [A `SwitchFormField` shows no validation message](#a-switchformfield-shows-no-validation-message)
274
274
  - [A `TimeFormField` shows its error on a desktop but not on a phone](#a-timeformfield-shows-its-error-on-a-desktop-but-not-on-a-phone)
275
275
  - [`setError(…, { shouldFocus: true })` or a failed submit does not focus the field](#seterror--shouldfocus-true--or-a-failed-submit-does-not-focus-the-field)
276
+ - [`useFastForm` does not focus the first field](#usefastform-does-not-focus-the-first-field)
276
277
  - [`touchedFields` stays empty after leaving a field, or `mode: 'onBlur'` never validates](#touchedfields-stays-empty-after-leaving-a-field-or-mode-onblur-never-validates)
277
278
  - ["Required" shows as soon as the calendar opens, or while a date is being picked](#required-shows-as-soon-as-the-calendar-opens-or-while-a-date-is-being-picked)
278
279
  - [`TypeError: values.map is not a function` (a `SliderFormField`)](#typeerror-valuesmap-is-not-a-function)
@@ -4736,6 +4737,26 @@ open the section before calling `setError`.
4736
4737
  `PasswordFormField` or `OtpFormField` (Storybook: `Guides/Forms/Focus on
4737
4738
  error`, `Set Focus Password` and `Set Focus Otp`).
4738
4739
 
4740
+ ### `useFastForm` does not focus the first field
4741
+
4742
+ **When:** a form on `useFastForm(props, 'email')` opens and the focus stays
4743
+ where it was, or in a dialog it ends on the dialog instead of the field.
4744
+ **Why:** `useFastForm` calls `setFocus(first)`, which needs the field's `ref`:
4745
+ the field must be a `*FormField` of this form (or give `field.ref` to its
4746
+ control), and it must be mounted. The hook asks again each frame for about half
4747
+ a second, then gives up; it also stops at once when the focus moved, the
4748
+ user's own move included. A form whose hook stays mounted while its dialog is
4749
+ closed focuses only when `active` turns true.
4750
+ **Fix:** pass the dialog's `open` as the third argument, and make sure `first`
4751
+ names a mounted field:
4752
+
4753
+ ```tsx
4754
+ const form = useFastForm<Values>({ defaultValues }, 'email', open);
4755
+ ```
4756
+
4757
+ Storybook: `Guides/Forms/useFastForm`. See
4758
+ [forms](guides/forms.md#a-form-that-is-quick-to-fill).
4759
+
4739
4760
  ### `touchedFields` stays empty after leaving a field, or `mode: 'onBlur'` never validates
4740
4761
 
4741
4762
  **When:** a `*FormField` keeps `formState.touchedFields` (and
@@ -58,11 +58,7 @@
58
58
  @import "./ui/layout/app-shell/activity-backdrop-shapes.css";
59
59
  @import "./ui/layout/auth-card/auth-card-backdrop.css";
60
60
  /* DataTable cards and tiles: the item shell (hairline, tint, start bar, columns by the list's width). */
61
- @import "./ui/collections/data-table/data-table-items.css";
62
- @import "./ui/collections/data-table/data-table-items-compact.css";
63
- @import "./ui/collections/data-table/data-table-items-bar.css";
64
- @import "./ui/collections/data-table/data-table-items-forced.css";
65
- @import "./ui/collections/data-table/data-table-items-tiles.css";
61
+ @import "./ui/collections/data-table/index.css";
66
62
  /* ServerTable's second header row on a phone: select-all, sort, Filters and the actions. */
67
63
  @import "./ui/collections/server-table/server-table-phone-row.css";
68
64
  /* Checkbox and Radio: the check that draws in, the dot that springs in, the state layer. */
@@ -76,7 +76,7 @@
76
76
  * wrapper dissolves so its children take the areas. */
77
77
  .nxgt-action-card[data-size="tile"] {
78
78
  grid-template-columns: minmax(0, 1fr) auto;
79
- grid-template-areas: "title act" "status status" "desc desc" "meta meta";
79
+ grid-template-areas: "title act" "status status" "desc desc" "meta meta" "foot foot";
80
80
  align-items: start;
81
81
  /* A taller neighbour stretches the card: keep the rows at the top. */
82
82
  align-content: start;
@@ -93,7 +93,8 @@
93
93
  "icon title act"
94
94
  ". status status"
95
95
  ". desc desc"
96
- ". meta meta";
96
+ ". meta meta"
97
+ ". foot foot";
97
98
  }
98
99
  .nxgt-action-card[data-size="tile"] .nxgt-action-card-icon {
99
100
  width: 36px;
@@ -119,6 +120,14 @@
119
120
  .nxgt-action-card[data-size="tile"] .nxgt-action-card-meta {
120
121
  grid-area: meta;
121
122
  }
123
+ /* The footer: secondary links, above the stretched title link or button. */
124
+ .nxgt-action-card-footer {
125
+ grid-area: foot;
126
+ position: relative;
127
+ z-index: 1;
128
+ min-width: 0;
129
+ margin-top: 2px;
130
+ }
122
131
  .nxgt-action-card[data-size="tile"][data-has-action]
123
132
  .nxgt-action-card-action {
124
133
  align-self: start;
@@ -0,0 +1,27 @@
1
+ /* The compact record row of a tile (`item.Row`, data-table-item-row.tsx): the
2
+ * dense row of ListTile inside the tile's shell. Direction "A Refined" for the
3
+ * shell; the row is 36px tall under a fine pointer and 44px under a coarse one
4
+ * (the link's `::after` covers the tile, so the whole tile is the target).
5
+ * The title is 13px medium like ListTile's `size="sm"`; a selected tile's
6
+ * title keeps the primary text of data-table-items.css. */
7
+ @layer components {
8
+ [data-slot="data-table-tiles"]
9
+ > [data-slot="data-table-item"]:has([data-slot="data-table-record"]) {
10
+ min-height: 2.25rem;
11
+ padding-block: 0.375rem;
12
+ }
13
+ @media (pointer: coarse) {
14
+ [data-slot="data-table-tiles"]
15
+ > [data-slot="data-table-item"]:has([data-slot="data-table-record"]) {
16
+ min-height: 2.75rem;
17
+ /* The link's 44px box, centred on the title's first line, stays inside
18
+ * the tile when the subtitle and the chips stack under it. */
19
+ padding-block: 0.75rem;
20
+ }
21
+ }
22
+ [data-slot="data-table-record"] [data-slot="data-table-item-title"] {
23
+ font-size: 0.8125rem;
24
+ font-weight: 500;
25
+ line-height: 1.4;
26
+ }
27
+ }
@@ -0,0 +1,14 @@
1
+ /* DataTable cards and tiles, one file per role, in cascade order:
2
+ *
3
+ * data-table-items.css the item shell (hairline, tint, start bar, columns)
4
+ * data-table-items-compact.css compact cards
5
+ * data-table-items-bar.css the list bar
6
+ * data-table-items-forced.css forced colours
7
+ * data-table-items-tiles.css tiles: one column, one surface
8
+ * data-table-items-record.css the compact record row of a tile (item.Row) */
9
+ @import "./data-table-items.css";
10
+ @import "./data-table-items-compact.css";
11
+ @import "./data-table-items-bar.css";
12
+ @import "./data-table-items-forced.css";
13
+ @import "./data-table-items-tiles.css";
14
+ @import "./data-table-items-record.css";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material",
3
- "version": "3.52.0",
3
+ "version": "3.53.0",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"
@@ -1,45 +0,0 @@
1
- import { i as e, r as t, t as n } from "./stored-language-Cb9FMEwk.js";
2
- import { createContext as r, useCallback as i, useContext as a, useMemo as o, useState as s } from "react";
3
- import { jsx as c } from "react/jsx-runtime";
4
- //#region lib/i18n/i18n-provider.tsx
5
- var l = r(null);
6
- function u({ children: r, defaultLanguage: a = "en", storageKey: u = t, supportedLanguages: d = e, onLanguageChange: f, initialLanguage: p, resources: m }) {
7
- let [h, g] = s(() => p && d.includes(p) ? p : n(u, a, d)), _ = i((e) => {
8
- if (!d.includes(e)) {
9
- console.warn(`[@nxgt/material] Unsupported language: "${e}".`);
10
- return;
11
- }
12
- if (typeof localStorage < "u") try {
13
- localStorage.setItem(u, e);
14
- } catch {}
15
- g(e), f?.(e);
16
- }, [
17
- u,
18
- d,
19
- f
20
- ]), v = o(() => ({
21
- language: h,
22
- changeLanguage: _,
23
- supportedLanguages: d,
24
- resources: m
25
- }), [
26
- h,
27
- _,
28
- d,
29
- m
30
- ]);
31
- return /* @__PURE__ */ c(l.Provider, {
32
- value: v,
33
- children: r
34
- });
35
- }
36
- function d() {
37
- let e = a(l);
38
- if (!e) throw Error("useI18nContext must be used within an I18nProvider");
39
- return e;
40
- }
41
- function f() {
42
- return a(l);
43
- }
44
- //#endregion
45
- export { d as n, f as r, u as t };
@@ -1,35 +0,0 @@
1
- import { morph as e, morphAt as t, toSvgPath as n } from "@nxgt/material-core/shapes";
2
- import { useLayoutEffect as r, useRef as i } from "react";
3
- //#region lib/components/ui/display/shape/use-shape-morph.ts
4
- var a = .8, o = 14, s = o * Math.sqrt(1 - a * a);
5
- function c(e) {
6
- let t = e / 1e3;
7
- return 1 - Math.exp(-.8 * o * t) * (Math.cos(s * t) + a * o / s * Math.sin(s * t));
8
- }
9
- var l = () => typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
10
- function u(a, o, s) {
11
- let u = i(o);
12
- r(() => {
13
- let r = a.current, i = u.current;
14
- if (!r || i === o || !s || l()) {
15
- r && i !== o && r.setAttribute("d", n(o)), u.current = o;
16
- return;
17
- }
18
- let d = e(i, o), f = n(o), p = 0, m = performance.now(), h = (e) => {
19
- let i = e - m;
20
- if (i >= 520) {
21
- u.current = o, r.setAttribute("d", f);
22
- return;
23
- }
24
- let a = t(d, c(i));
25
- u.current = a, r.setAttribute("d", n(a)), p = requestAnimationFrame(h);
26
- };
27
- return r.setAttribute("d", n(d.from)), p = requestAnimationFrame(h), () => cancelAnimationFrame(p);
28
- }, [
29
- a,
30
- o,
31
- s
32
- ]);
33
- }
34
- //#endregion
35
- export { u as n, c as t };