@nxgt/material 2.14.0 → 2.15.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 (44) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/{blockDiagram-BEXU5L5S-Cn9cG3vt.js → blockDiagram-BEXU5L5S-BozTHxCb.js} +1 -1
  3. package/dist/{chunk-3FUC2YCW-XrT5pZo5.js → chunk-3FUC2YCW-zWkkqKwC.js} +1 -1
  4. package/dist/{chunk-7M6MHVWA-Uf-8NCRF.js → chunk-7M6MHVWA-CGHIsno5.js} +1 -1
  5. package/dist/{chunk-GNY47TPC-CGgBmY0O.js → chunk-GNY47TPC-BWB3R7nr.js} +4 -4
  6. package/dist/{chunk-NETBCI7D-g-jPsM9q.js → chunk-NETBCI7D-DwmNwFxb.js} +1 -1
  7. package/dist/{chunk-Z7XXMR3K-BzO1efzA.js → chunk-Z7XXMR3K-0DGn7Rxi.js} +1 -1
  8. package/dist/{classDiagram-v2-NBCMYWYE-7WgpfVcn.js → classDiagram-v2-NBCMYWYE-BERam5ND.js} +2 -2
  9. package/dist/{components-qTUjhFuo.js → components-B-xPQ6XX.js} +23123 -23116
  10. package/dist/components.js +2 -2
  11. package/dist/{dagre-6A5THRUB-BOuRxJdA.js → dagre-6A5THRUB-CnIZQoNt.js} +3 -3
  12. package/dist/{diagram-22UHCM2B-CF0vLJbn.js → diagram-22UHCM2B-DN4-okl5.js} +2 -2
  13. package/dist/{diagram-3UASUU5V-RLo-MTfV.js → diagram-3UASUU5V-DcrNf7TY.js} +1 -1
  14. package/dist/{elk-276RUBZZ-Dr2yBM7k.js → elk-276RUBZZ-B7yctkbs.js} +3 -3
  15. package/dist/{erDiagram-OPXOYQCR-l7kPZ4FO.js → erDiagram-OPXOYQCR-BVrTNrkn.js} +2 -2
  16. package/dist/{field-blur-BKGVq9_k.js → field-blur-DDfQkuSJ.js} +3 -3
  17. package/dist/{flowDiagram-KWPJA3E3-BQEK3XTl.js → flowDiagram-KWPJA3E3-BKxvqo0x.js} +3 -3
  18. package/dist/{ganttDiagram-FUAMR5RP-WYm8XV7U.js → ganttDiagram-FUAMR5RP-Cv9W4LOS.js} +1 -1
  19. package/dist/{journeyDiagram-ZHPQQLJL-p90NnenY.js → journeyDiagram-ZHPQQLJL-BwSv9L1j.js} +1 -1
  20. package/dist/lib/components/ui/dates/calendar/use-stable-component.d.ts +10 -0
  21. package/dist/lib/components/ui/dates/date-field/date-field-trigger.d.ts +1 -1
  22. package/dist/lib/components/ui/dates/date-range-field/date-range-field-trigger.d.ts +1 -1
  23. package/dist/lib/components/ui/dates/picker-trigger/use-trigger-locale.d.ts +10 -0
  24. package/dist/lib/components/ui/primitives/typography/typography.d.ts +7 -2
  25. package/dist/main.js +2 -2
  26. package/dist/map.js +1 -1
  27. package/dist/{mermaid.core-CW8DO1T1.js → mermaid.core-D_eXACPr.js} +21 -21
  28. package/dist/{mindmap-definition-NLK3R4M7-DJcCg9PL.js → mindmap-definition-NLK3R4M7-GMAPXP2T.js} +2 -2
  29. package/dist/{pieDiagram-5QR66LMP-b_dHXzkV.js → pieDiagram-5QR66LMP--qZHRFqG.js} +1 -1
  30. package/dist/{quadrantDiagram-O4NWA36T-BSqAcBs7.js → quadrantDiagram-O4NWA36T-BxFGymBB.js} +1 -1
  31. package/dist/{requirementDiagram-PLB6GJNP-BcxkmIFp.js → requirementDiagram-PLB6GJNP-D4aL7HiM.js} +2 -2
  32. package/dist/{sankeyDiagram-IPEJSGJF-aD5r_n1q.js → sankeyDiagram-IPEJSGJF-zX1FL2aL.js} +1 -1
  33. package/dist/{stateDiagram-v2-GCMORJYK-Ct9ylaoP.js → stateDiagram-v2-GCMORJYK-CDm1mDv2.js} +2 -2
  34. package/dist/{swimlanes-2SLR337P-BwCqwEoR.js → swimlanes-2SLR337P-DNwIhCCu.js} +3 -3
  35. package/dist/{swimlanesDiagram-TC7HE7FX-WxBGUt0w.js → swimlanesDiagram-TC7HE7FX-BaR9zAzq.js} +3 -3
  36. package/dist/{timeline-definition-EJHVYXUP-5Q8GU13Q.js → timeline-definition-EJHVYXUP-B6Xd8Spe.js} +1 -1
  37. package/dist/{usecaseDiagram-POWQR4AR-CzGOd4ic.js → usecaseDiagram-POWQR4AR-XW5of8Kj.js} +2 -2
  38. package/dist/{xychartDiagram-PMCCYNJV-Bh_1zZoW.js → xychartDiagram-PMCCYNJV-DTV6AzhO.js} +1 -1
  39. package/docs/components/date-and-time.md +6 -0
  40. package/docs/components/feedback-and-status.md +3 -1
  41. package/docs/components/primitives.md +10 -2
  42. package/docs/guides/i18n.md +2 -0
  43. package/docs/troubleshooting.md +41 -0
  44. package/package.json +1 -1
@@ -8,11 +8,11 @@ import "./chunk-7PRAP22T-0C6_H8Li.js";
8
8
  import { a as g, i as _, o as v, r as y } from "./chunk-J5ZVWO5B-DmRRmhon.js";
9
9
  import "./chunk-7INBJB4K-k-I67NSP.js";
10
10
  import "./chunk-5DYCD2WN-Cd1zazNp.js";
11
- import "./chunk-Z7XXMR3K-BzO1efzA.js";
11
+ import "./chunk-Z7XXMR3K-0DGn7Rxi.js";
12
12
  import { t as ee } from "./chunk-XXDRQBXY-dKXxu_aj.js";
13
13
  import { t as te } from "./chunk-WEXAMYUT-CbFOhEve.js";
14
14
  import "./chunk-UA2S7LBM-ChuksCDg.js";
15
- import { r as ne, t as re } from "./chunk-GNY47TPC-CGgBmY0O.js";
15
+ import { r as ne, t as re } from "./chunk-GNY47TPC-BWB3R7nr.js";
16
16
  //#region ../../node_modules/chevrotain/node_modules/lodash-es/_freeGlobal.js
17
17
  var ie = typeof global == "object" && global && global.Object === Object && global, ae = typeof self == "object" && self && self.Object === Object && self, b = ie || ae || Function("return this")(), oe = b.Symbol, se = Object.prototype, ce = se.hasOwnProperty, le = se.toString, ue = oe ? oe.toStringTag : void 0;
18
18
  function de(e) {
@@ -1,4 +1,4 @@
1
- import { at as e, rt as t, st as n } from "./components-qTUjhFuo.js";
1
+ import { at as e, rt as t, st as n } from "./components-B-xPQ6XX.js";
2
2
  import { n as r } from "./src-CsLQInsN.js";
3
3
  import { i } from "./chunk-ZIGJFQKS-9VXArDKF.js";
4
4
  import { n as a } from "./chunk-Y2CYZVJY-BAad7w_K.js";
@@ -88,6 +88,8 @@ CalendarContrast).
88
88
 
89
89
  Labelled trigger that opens a calendar popover, with an optional time picker.
90
90
 
91
+ The trigger writes the date in the field's `locale`, else the `I18nProvider` language, else English.
92
+
91
93
  ```tsx
92
94
  import { DateField } from '@nxgt/material/components';
93
95
  import { useState } from 'react';
@@ -146,6 +148,8 @@ calendar is labelled by the trigger, so named by the label.
146
148
 
147
149
  From / to range picked in a popover calendar, with presets and times.
148
150
 
151
+ The trigger writes each date in the field's `locale`, else the `I18nProvider` language, else English.
152
+
149
153
  ```tsx
150
154
  import { type DateRange, DateRangeField } from '@nxgt/material/components';
151
155
  import { useState } from 'react';
@@ -288,6 +292,8 @@ second day is picked.
288
292
 
289
293
  Opens a `TimePicker` in a popover, or in a dialog on mobile.
290
294
 
295
+ The trigger writes the time in the `I18nProvider` language, else English.
296
+
291
297
  ```tsx
292
298
  import { TimeField } from '@nxgt/material/components';
293
299
  import { useState } from 'react';
@@ -310,9 +310,11 @@ import { Button, EmptyState } from '@nxgt/material/components';
310
310
  | --- | --- | --- | --- |
311
311
  | `variant` | `'not-found' \| 'unauthorized' \| 'generic' \| 'empty' \| 'offline' \| 'search' \| 'maintenance'` | `'generic'` | preset icon, well colour, title and description |
312
312
  | `icon` | `ReactNode` | the preset's | replaces the icon |
313
- | `title` / `description` | `ReactNode` | the preset's (translated) | replace the preset text |
313
+ | `title` / `description` | `ReactNode` | the preset's (translated) | replace the preset text; see below |
314
314
  | `action` | `ReactNode` | — | shown under the text |
315
315
 
316
+ The preset's description is the companion of its title: with your own `title` and no `description`, no description is rendered. Pass `description` to keep a line under your own title.
317
+
316
318
  **Storybook:** `Feedback & status/EmptyState` · **Vue:** `EmptyState`
317
319
 
318
320
  ---
@@ -176,9 +176,17 @@ import { Typography } from '@nxgt/material/components';
176
176
  | Prop | Type | Default | Effect |
177
177
  | --- | --- | --- | --- |
178
178
  | `variant` | `'huge-large' \| 'huge-medium' \| 'huge-small' \| 'headline-larger' \| 'headline-large' \| 'headline-medium' \| 'headline-small' \| 'title-large' \| 'title-medium' \| 'title-small' \| 'body-medium' \| 'body-small' \| 'caption' \| 'normal'` | `'normal'` | size and weight; `caption` is also muted |
179
+ | `as` | an intrinsic tag name (`keyof JSX.IntrinsicElements`) | `'div'` | the element to render, keeping the variant, e.g. `as="h2"` or `as="span"` |
180
+ | `asChild` | `boolean` | `false` | merge the classes onto the single child instead of rendering an element |
179
181
 
180
- It renders a `<div>`; the variants are also exported as `typographyVariants`
181
- for use on your own elements.
182
+ It renders a `<div>` unless `as` or `asChild` says otherwise:
183
+
184
+ ```tsx
185
+ <Typography as="span" variant="title-small">Inline</Typography>
186
+ <Typography asChild variant="body-medium"><a href="/docs">Docs</a></Typography>
187
+ ```
188
+
189
+ The variants are also exported as `typographyVariants` for use on your own elements.
182
190
 
183
191
  **Storybook:** `Primitives/Typography` · **Vue:** `Typography`
184
192
 
@@ -449,6 +449,8 @@ and dates shown to a user, `useFormatters()` (`formatAmount`, `formatDate`)
449
449
  prints what the PDF builders print, with the decimals `CurrencyField` shows. See
450
450
  [helpers](helpers.md#nxgtmaterialhooks).
451
451
 
452
+ The trigger of a `DateField`, `DateRangeField` or `TimeField` follows the same language (a `DateField`'s own `locale` wins): `01/09/2028` on a French page, `09/01/2028` in English.
453
+
452
454
  ## Reference
453
455
 
454
456
  Everything `@nxgt/material/i18n` exports is listed in
@@ -123,6 +123,7 @@ words in your error.
123
123
  - [A test that finds a chip by `aria-selected` or `getByRole('option')` no longer finds it](#a-test-that-finds-a-chip-by-aria-selected-or-getbyroleoption-no-longer-finds-it)
124
124
  - [The `ref` of a `SelectChipField` focuses nothing](#the-ref-of-a-selectchipfield-focuses-nothing)
125
125
  - [`touchedFields` stays empty after leaving a field, or `mode: 'onBlur'` never validates](#touchedfields-stays-empty-after-leaving-a-field-or-mode-onblur-never-validates)
126
+ - ["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)
126
127
  - [`TypeError: values.map is not a function` (a `SliderFormField`)](#typeerror-valuesmap-is-not-a-function)
127
128
  - [An end-to-end test no longer finds `aria-expanded` on a `ResponsiveButton`](#an-end-to-end-test-no-longer-finds-aria-expanded-on-a-responsivebutton)
128
129
  - [A multi-step form reopens at a later step](#a-multi-step-form-reopens-at-a-later-step)
@@ -135,6 +136,7 @@ words in your error.
135
136
  - [A button named "Icon plus Add" is now named "Add"](#a-button-named-icon-plus-add-is-now-named-add)
136
137
  - [`An invalid form control with name='…' is not focusable` (an `UploadField`)](#an-invalid-form-control-with-name-is-not-focusable)
137
138
  - [A `DateField` or `DateRangeField` with `disabled` still opens](#a-datefield-or-daterangefield-with-disabled-still-opens)
139
+ - [The date field shows MM/DD/YYYY on a French page](#the-date-field-shows-mmddyyyy-on-a-french-page)
138
140
  - [An `id`, `aria-describedby` or `data-testid` on a `DateField`, `DateRangeField` or `TimeField` is not on the trigger](#an-id-aria-describedby-or-data-testid-on-a-datefield-daterangefield-or-timefield-is-not-on-the-trigger)
139
141
  - [A test no longer finds the label or helper text inside a date or time picker's trigger](#a-test-no-longer-finds-the-label-or-helper-text-inside-a-date-or-time-pickers-trigger)
140
142
  - [A test no longer finds a `DurationField` input by the field's label, or a `Slider`'s `aria-label` on its root](#a-test-no-longer-finds-a-durationfield-input-by-the-fields-label-or-a-sliders-aria-label-on-its-root)
@@ -2261,6 +2263,24 @@ For a field of your own, pass `field.onBlur` to the control that loses focus:
2261
2263
  What counts as leaving, per kind of field:
2262
2264
  [forms](guides/forms.md#touched-on-blur).
2263
2265
 
2266
+ ### "Required" shows as soon as the calendar opens, or while a date is being picked
2267
+
2268
+ **When:** a `DateFormField` or `DateRangeFormField` that is empty and required,
2269
+ in a form with `mode: 'onTouched'` or `'onBlur'`, shows its error (and
2270
+ `touchedFields` flips) after the user changes the month, opens the year view
2271
+ or goes to today, before any date is chosen. 2.14.0 and earlier.
2272
+
2273
+ **Why:** `Calendar` gave `react-day-picker` new `Nav`, `CaptionLabel` and
2274
+ `MonthGrid` components each time the month or the view changed. The button that
2275
+ had focus was unmounted, focus fell to the page, and the field, which is
2276
+ touched when focus leaves it and its popover, took that for leaving.
2277
+
2278
+ **Fix:** upgrade to 2.15.0 or later. Until then, validate on
2279
+ submit (`mode: 'onSubmit'`) or hide the message until the popover is closed.
2280
+ From that version, opening, moving in the calendar, Escape and picking leave
2281
+ the field untouched; it is touched when the popover closes without a value by a
2282
+ click outside, or when the trigger loses focus with the popover closed.
2283
+
2264
2284
  ### `TypeError: values.map is not a function`
2265
2285
 
2266
2286
  **When:** a `SliderFormField` with one thumb crashes (in `SliderReadout`) as
@@ -2565,6 +2585,27 @@ react-day-picker's day rule, so `true` meant "every day".
2565
2585
  The same release moves `id`, `aria-describedby` and `data-*` to the trigger:
2566
2586
  see the next entry.
2567
2587
 
2588
+ ### The date field shows MM/DD/YYYY on a French page
2589
+
2590
+ **When:** a `DateField`, `DateFormField`, `DateRangeField` or `DateRangeFormField` (and a `TimeField`, which shows `2:30 PM` instead of `14:30`) under a French
2591
+ `I18nProvider` shows 1 September 2028 as `09/01/2028` in its trigger, while the
2592
+ calendar inside it is in French. No error is printed.
2593
+ **Why:** the trigger formatted the date without a locale, so it was always
2594
+ English (`MM/DD/YYYY`), whatever the language of the page.
2595
+ **Fix:** upgrade: the trigger now writes the date (and the time, for a
2596
+ `TimeField` or a `DateRangeField` with `withTime`) in the language of the
2597
+ calendar: the field's own `locale`, else the `I18nProvider` language, else
2598
+ English. Mount the provider above the field:
2599
+
2600
+ ```tsx
2601
+ <I18nProvider initialLanguage="fr">
2602
+ <DateField label="Livraison" value={value} onValueChange={setValue} />
2603
+ </I18nProvider>
2604
+ ```
2605
+
2606
+ With no provider, or in English, the output is unchanged (`09/01/2028`). The
2607
+ document's `<html lang>` and the browser's language are not read.
2608
+
2568
2609
  ### An `id`, `aria-describedby` or `data-testid` on a `DateField`, `DateRangeField` or `TimeField` is not on the trigger
2569
2610
 
2570
2611
  **When:** before 2.2.0: `getByTestId` finds the calendar (and only while the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material",
3
- "version": "2.14.0",
3
+ "version": "2.15.0",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"