@nxgt/material 3.25.1 → 3.26.1

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 (78) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1 -0
  3. package/dist/{async-slice-nTRgm_ct.js → async-slice-gAbGnQT8.js} +2 -2
  4. package/dist/{button-rdIhY2BT.js → button-Cr9GIIj4.js} +1 -1
  5. package/dist/charts.js +3 -3
  6. package/dist/{chip-CEau88ZV.js → chip-s11lOfxB.js} +1 -1
  7. package/dist/{code-editor-DHB5ytUz.js → code-editor-DGIjL8Hr.js} +4 -4
  8. package/dist/code-editor.js +4 -4
  9. package/dist/{code-language-items-Dww9amx_.js → code-language-items-DCOQnaCo.js} +2 -2
  10. package/dist/{components-wLKi88Su.js → components-BEN2FVD-.js} +12019 -11384
  11. package/dist/components.js +26 -26
  12. package/dist/{dialog-B2GXKBp3.js → dialog-Crvg-MN5.js} +1 -1
  13. package/dist/dnd.js +1 -1
  14. package/dist/{dropdown-menu-mTDyFwbQ.js → dropdown-menu-B71aggp0.js} +1 -1
  15. package/dist/editor.js +7 -7
  16. package/dist/{empty-state-lj7vjYWG.js → empty-state-8LddxMU4.js} +1 -1
  17. package/dist/hooks.js +2 -2
  18. package/dist/{i18n-provider-BpZOKh7U.js → i18n-provider-BDi9-6DO.js} +1 -1
  19. package/dist/i18n.js +5 -5
  20. package/dist/{icon-badge-CiWXvKCs.js → icon-badge-DG7wLnHh.js} +1 -1
  21. package/dist/lib/components/ui/display/change-history/change-history.d.ts +16 -0
  22. package/dist/lib/components/ui/display/change-history/change-history.test-data.d.ts +8 -0
  23. package/dist/lib/components/ui/display/change-history/change-history.utils.d.ts +16 -0
  24. package/dist/lib/components/ui/display/change-history/index.d.ts +2 -0
  25. package/dist/lib/components/ui/display/change-history/kinds.d.ts +9 -0
  26. package/dist/lib/components/ui/display/change-history/partials/card-changes.d.ts +7 -0
  27. package/dist/lib/components/ui/display/change-history/partials/card-entry.d.ts +3 -0
  28. package/dist/lib/components/ui/display/change-history/partials/changes-collapse.d.ts +22 -0
  29. package/dist/lib/components/ui/display/change-history/partials/day-heading.d.ts +11 -0
  30. package/dist/lib/components/ui/display/change-history/partials/entry-list.d.ts +12 -0
  31. package/dist/lib/components/ui/display/change-history/partials/entry-time.d.ts +8 -0
  32. package/dist/lib/components/ui/display/change-history/partials/footer.d.ts +9 -0
  33. package/dist/lib/components/ui/display/change-history/partials/history-body.d.ts +8 -0
  34. package/dist/lib/components/ui/display/change-history/partials/rail-changes.d.ts +9 -0
  35. package/dist/lib/components/ui/display/change-history/partials/rail-entry.d.ts +5 -0
  36. package/dist/lib/components/ui/display/change-history/partials/skeleton.d.ts +6 -0
  37. package/dist/lib/components/ui/display/change-history/partials/use-load-more-focus.d.ts +12 -0
  38. package/dist/lib/components/ui/display/change-history/partials/values.d.ts +4 -0
  39. package/dist/lib/components/ui/display/change-history/types.d.ts +95 -0
  40. package/dist/lib/components/ui/display/change-history/use-entry-summary.d.ts +8 -0
  41. package/dist/lib/components/ui/display/change-history/zoned.d.ts +12 -0
  42. package/dist/lib/components/ui/display/day-separator/day-separator.d.ts +6 -1
  43. package/dist/lib/components/ui/display/index.d.ts +1 -0
  44. package/dist/lib/components/ui/display/timeline/relative-time.d.ts +12 -1
  45. package/dist/lib/components/ui/primitives/tabs/partials/tabs-list.d.ts +6 -1
  46. package/dist/lib/components/ui/primitives/tabs/partials/tabs-scroll-buttons.d.ts +12 -0
  47. package/dist/lib/components/ui/primitives/tabs/tabs-overflow-classes.d.ts +6 -0
  48. package/dist/lib/components/ui/primitives/tabs/use-tabs-overflow.d.ts +25 -0
  49. package/dist/lib/i18n/resources/en/en.d.ts +40 -0
  50. package/dist/lib/i18n/resources/en/material.json.d.ts +40 -0
  51. package/dist/lib/i18n/resources/fr/fr.d.ts +40 -0
  52. package/dist/lib/i18n/resources/fr/material.json.d.ts +40 -0
  53. package/dist/lib/i18n/resources/resources.d.ts +80 -0
  54. package/dist/lib/i18n/translator.d.ts +1 -1
  55. package/dist/lib.js +1 -1
  56. package/dist/main.js +43 -43
  57. package/dist/map.js +4 -4
  58. package/dist/material.css +1 -1
  59. package/dist/pdf-reader.js +1 -1
  60. package/dist/print.js +2 -2
  61. package/dist/{public-DAF5SCWH.js → public-QUiFLEoj.js} +6 -6
  62. package/dist/{rich-code-block-CLkufAhI.js → rich-code-block-CjD54THr.js} +4 -4
  63. package/dist/{sortable-provider-BofwO9zZ.js → sortable-provider-DYnyzfgR.js} +1 -1
  64. package/dist/{spinner-B7HCQMFr.js → spinner-CJtTRNAX.js} +1 -1
  65. package/dist/{stored-language-CJn_iWwG.js → stored-language-ClkfkueV.js} +80 -0
  66. package/dist/theme-picker.js +2 -2
  67. package/dist/{theme-toggle-mQzIR1hw.js → theme-toggle-ufQL3SO6.js} +1 -1
  68. package/dist/{toolbar-items-Tn3MMu-s.js → toolbar-items-DlioFgpM.js} +2 -2
  69. package/dist/{translate-material-CCyVEi_f.js → translate-material-O-uasx3u.js} +2 -2
  70. package/dist/{translator-1THr41fc.js → translator-C0uxN1Nh.js} +1 -1
  71. package/dist/{use-chat-composer-B0ze1cU9.js → use-chat-composer-DzVO5mwz.js} +1762 -1640
  72. package/dist/{use-heading-spy-DNFfHQJs.js → use-heading-spy-BHCVdJfr.js} +1 -1
  73. package/dist/{use-material-translation-BFQODuQz.js → use-material-translation-B4Frk3vC.js} +2 -2
  74. package/docs/components/data-display.md +102 -2
  75. package/docs/components/primitives.md +6 -1
  76. package/docs/guides/i18n.md +2 -1
  77. package/docs/previews/data-display-changehistory.webp +0 -0
  78. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { r as e } from "./i18n-provider-BpZOKh7U.js";
1
+ import { r as e } from "./i18n-provider-BDi9-6DO.js";
2
2
  import { _ as t, g as n, h as r, n as i, v as a, y as o } from "./number.utils-BG_eEt5g.js";
3
3
  import { useCallback as s, useEffect as c, useMemo as l, useRef as u } from "react";
4
4
  //#region ../../node_modules/date-fns/locale/fr/_lib/formatDistance.js
@@ -1,5 +1,5 @@
1
- import { r as e } from "./i18n-provider-BpZOKh7U.js";
2
- import { t } from "./translate-material-CCyVEi_f.js";
1
+ import { r as e } from "./i18n-provider-BDi9-6DO.js";
2
+ import { t } from "./translate-material-O-uasx3u.js";
3
3
  import { useCallback as n } from "react";
4
4
  //#region lib/i18n/use-material-translation.ts
5
5
  function r() {
@@ -25,6 +25,7 @@ from `@nxgt/material/components`.
25
25
  | <img src="../previews/data-display-listtile.webp" width="96" alt=""> | [ListTile](#listtile) | Row with leading / trailing slots, row actions, chips and a divided variant |
26
26
  | <img src="../previews/data-display-accordioncard.webp" width="96" alt=""> | [AccordionCard](#accordioncard) | Accordion rendered from `items` |
27
27
  | <img src="../previews/data-display-timeline.webp" width="96" alt=""> | [Timeline](#timeline) | Vertical event timeline with relative times |
28
+ | <img src="../previews/data-display-changehistory.webp" width="96" alt=""> | [ChangeHistory](#changehistory) | History of the changes made to anything, as a rail or as cards |
28
29
  | <img src="../previews/data-display-eventchip.webp" width="96" alt=""> | [EventChip](#eventchip) | Calendar event pill, soft, solid or outlined |
29
30
  | <img src="../previews/data-display-codeblock.webp" width="96" alt=""> | [CodeBlock](#codeblock) | Code, JSON tree and tabbed samples |
30
31
  | <img src="../previews/data-display-markdown.webp" width="96" alt=""> | [Markdown](#markdown) | GFM with math and mermaid |
@@ -297,6 +298,7 @@ import { DaySeparator, isNewDay } from '@nxgt/material/components';
297
298
  | `badge` | `ReactNode` | — | a count after the label |
298
299
  | `variant` | `'pill' \| 'line'` | `'pill'` | the label in a pill, or bare |
299
300
  | `sticky` | `boolean` | `false` | stays at the top of its scroll box while its day scrolls by |
301
+ | `as` | `'div' \| 'h2'` to `'h6'` | `'div'` | a real heading of that level (the hairlines stay decorative) |
300
302
  | `now` / `locale` | `DayInput` / `string` | now / the provider's language | the reference day and the date's language |
301
303
 
302
304
  `formatDayLabel(date, { today, yesterday, locale, now })`, `isNewDay(previous,
@@ -971,7 +973,7 @@ const items: TimelineItemData[] = [
971
973
  ```
972
974
 
973
975
  Parts: `Timeline`, `TimelineItem` (one row, for your own list),
974
- `RelativeTime` (`date`, `addSuffix`; the exact date is its `title`).
976
+ `RelativeTime` (`date`, `addSuffix`, `now`; the exact date is its `title`, or with `tooltip` a tooltip on hover and, with `focusable`, on keyboard focus; it takes a `ref`).
975
977
 
976
978
  | Prop | Type | Default | Effect |
977
979
  | --- | --- | --- | --- |
@@ -979,7 +981,105 @@ Parts: `Timeline`, `TimelineItem` (one row, for your own list),
979
981
  | `loading` | `boolean` | `false` | skeleton rows |
980
982
  | `empty` | `ReactNode` | "No activity yet" | shown when `items` is empty |
981
983
 
982
- **Storybook:** `Data display/Timeline` · **Vue:** `Timeline`, `TimelineItem`, `RelativeTime`
984
+ **Storybook:** `Data display/Timeline` · **Vue:** `Timeline`, `TimelineItem`, `RelativeTime` (without `now`, `tooltip`, `focusable` and `ref`, React only)
985
+
986
+ ---
987
+
988
+ ## ChangeHistory
989
+
990
+ ![ChangeHistory](../previews/data-display-changehistory.webp)
991
+
992
+ A history of the changes made to anything (a document, a project's
993
+ settings, a file): who changed what and when, with the values before and after.
994
+ As a rail (default): toned dot icons, one row per entry, the old value struck
995
+ through and the new one in a tinted pill. As cards: a card tinted by kind with a
996
+ Before / After block that spells its words, so colour is never the only signal.
997
+ Entries group under a heading per day (sticky on the rail), newest first.
998
+
999
+ ```tsx
1000
+ import { Rocket } from 'lucide-react';
1001
+ import { ChangeHistory, type ChangeHistoryEntry } from '@nxgt/material/components';
1002
+
1003
+ const createdAt = new Date('2026-10-01T09:00:00Z');
1004
+ const updatedAt = new Date('2026-10-02T14:30:00Z');
1005
+ const loadNextPage = () => {};
1006
+
1007
+ const entries: ChangeHistoryEntry[] = [
1008
+ {
1009
+ id: 'e2',
1010
+ kind: 'updated',
1011
+ at: updatedAt,
1012
+ author: { name: 'Ada Lovelace' },
1013
+ changes: [
1014
+ { field: 'Visibility', before: 'Private', after: 'Public' },
1015
+ { field: 'Webhook secret', redacted: true },
1016
+ ],
1017
+ },
1018
+ {
1019
+ id: 'e1',
1020
+ kind: 'created',
1021
+ at: createdAt,
1022
+ author: { name: 'Grace Hopper', src: '/grace.jpg' },
1023
+ changes: [{ field: 'Name', after: 'Billing service' }],
1024
+ },
1025
+ ];
1026
+
1027
+ <ChangeHistory
1028
+ entries={entries}
1029
+ kinds={{ deployed: { label: 'Deployed', verb: 'deployed', icon: <Rocket />, tone: 'primary' } }}
1030
+ total={27}
1031
+ hasMore
1032
+ onLoadMore={loadNextPage}
1033
+ />
1034
+ ```
1035
+
1036
+ `kind` names a key of `kinds`, which is merged over the built-in ones:
1037
+ `created` (success), `updated` (neutral), `archived` and `restored` (warning),
1038
+ `purged` and `deleted` (error). Override one part of a built-in
1039
+ (`updated: { tone: 'info' }`) or add your own; the app's labels and verbs are
1040
+ yours, the component names no domain.
1041
+
1042
+ | Prop | Type | Default | Effect |
1043
+ | --- | --- | --- | --- |
1044
+ | `entries` | `ChangeHistoryEntry[]` | — | `id`, `kind`, `at` (`Date`, string or number), `author` (`name`, `src`), `changes` (`ChangeHistoryChange[]`: `field`, `before`, `after`, `redacted`) |
1045
+ | `kinds` | `Record<string, ChangeHistoryKindOverride>` | built-ins | `label`, `verb`, `icon` (`null` removes it), `tone` per kind; `creation` (default true for `created`) makes an entry list values only |
1046
+ | `variant` | `'rail' \| 'cards'` | `'rail'` | the look |
1047
+ | `groupBy` | `'day' \| 'none'` | `'day'` | a heading per day (sticky on the rail), or one list in the order given |
1048
+ | `collapseAfter` | `number` | `3` | an entry with more changes collapses behind "N fields changed" (a creation: "N fields set") and a preview of the names, as a button with `aria-expanded` |
1049
+ | `filter` | `ReactNode` | — | a slot above the list, for a `Filter` bar |
1050
+ | `loading` | `boolean` | `false` | skeleton entries |
1051
+ | `hasMore` | `boolean` | — | shows the Load more button |
1052
+ | `onLoadMore` | `() => void` | — | called by Load more |
1053
+ | `total` | `number` | — | the count over all pages: "Showing X of Y" |
1054
+ | `empty` | `ReactNode` | "No history yet" | shown when `entries` is empty |
1055
+ | `now` | `Date \| string \| number` | now | the reference instant for "Today" and "5 minutes ago"; pass it from the server |
1056
+ | `timeZone` | `string` | the machine's zone | an IANA zone (`Europe/Paris`) for the day grouping, the day heading, the entry summary and the exact time; pass it from the server |
1057
+ | `headingLevel` | `2 \| 3 \| 4 \| 5 \| 6` | `3` | the level of the day headings |
1058
+ | `aria-label` | `string` | "Change history" | the region's name |
1059
+ | `className` | `string` | — | on the region |
1060
+
1061
+ A `redacted` change shows "Hidden" and never renders `before` or `after`. A
1062
+ `created` entry shows values only, with no "Empty →". Each entry is an
1063
+ `article` in an `ol`, labelled "{kind} by {author}, {date and time}"; the day
1064
+ headings are real headings (`h3`, or `headingLevel`); the author's avatar is
1065
+ decorative (`aria-hidden`), so the initials are not read; "Showing X of Y" is
1066
+ announced through a polite live region, and when Load more takes the last page
1067
+ and its button goes away, the focus moves to the first new entry (an `article`
1068
+ with `tabIndex={-1}`); the relative time takes keyboard focus and shows the
1069
+ exact time in a tooltip on hover and on focus (`RelativeTime` with `focusable`
1070
+ and `tooltip`). Strings are the `material.history.*` keys (en, fr).
1071
+
1072
+ **Server rendering:** the day grouping, the "Today" and "Yesterday" labels and
1073
+ the relative times read the clock and the time zone of the machine that renders,
1074
+ so a server and a browser in other zones can group and label an entry
1075
+ differently. Pass `now` and `timeZone` from the server (the request's instant
1076
+ and the user's zone) and both sides agree:
1077
+
1078
+ ```tsx
1079
+ <ChangeHistory entries={entries} now={loaderData.now} timeZone={loaderData.timeZone} />
1080
+ ```
1081
+
1082
+ **Storybook:** `Data display/ChangeHistory` · **Vue:** not yet (tracked as a `vue` issue)
983
1083
 
984
1084
  ---
985
1085
 
@@ -732,7 +732,12 @@ Parts: `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent`. `TabsList` and
732
732
  **`underline`** (the default) lays the tabs over a border; the active one
733
733
  takes the primary colour, and a bar under it slides to the tab clicked or
734
734
  reached with the arrow keys. The list scrolls sideways when the tabs do not
735
- fit (its scrollbar hidden), which suits a phone or a narrow popover.
735
+ fit (its scrollbar hidden), which suits a phone or a narrow popover. While it
736
+ overflows, each side with hidden tabs fades and gets a small scroll button
737
+ ("Scroll tabs left" / "Scroll tabs right", from `material.tabs.*`; out of the
738
+ tab order, 44px on a touch screen); the selected and the focused tab are
739
+ scrolled into view, instantly under reduced motion. A list that fits has
740
+ neither, and neither is in the server markup. `segmented` does the same.
736
741
 
737
742
  **`segmented`** is a neutral pill track: the active tab sits on a raised
738
743
  surface that slides between tabs, and its label turns to the foreground
@@ -240,7 +240,8 @@ presets and `Min`/`Max` fields, the `variant="4"` spinner's label,
240
240
  `material.slider.minimum` / `maximum` ("Minimum", "Maximum"), and a
241
241
  single value's input, when nothing names the slider, `material.slider.value`
242
242
  ("Value", "Valeur"). `CopyButton` reads `material.copy.copy`, `copied` and `failed` ("Copy", "Copied",
243
- "Copy failed"). The other icon-only buttons are named from it too: the
243
+ "Copy failed"). An overflowing `TabsList`'s scroll buttons read
244
+ `material.tabs.scroll-left` / `scroll-right` ("Scroll tabs left" / "Scroll tabs right"). The other icon-only buttons are named from it too: the
244
245
  `Sidebar` toggle (`material.sidebar.toggle`), the data table's row expander
245
246
  (`material.table.labels.toggle-row`) and its header, a hidden "Expand" / "Déplier"
246
247
  (`material.table.labels.expand`), its loading status, "Loading data…" /
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material",
3
- "version": "3.25.1",
3
+ "version": "3.26.1",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"