@nxgt/material 2.7.1 → 2.9.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/CHANGELOG.md +201 -0
- package/README.md +9 -6
- package/dist/{_Uint8Array-JRUmWcRr.js → _Uint8Array-azThpjEP.js} +1 -1
- package/dist/{_overRest-DvC5rm5s.js → _overRest-DMn4Dt71.js} +1 -1
- package/dist/{abnfDiagram-O67JEVCF-Cl4ukf6a.js → abnfDiagram-O67JEVCF-D-rmT4BY.js} +4 -4
- package/dist/{architectureDiagram-NJMV4G6O-WmFlBQF5.js → architectureDiagram-NJMV4G6O-DOc_c_T9.js} +7 -7
- package/dist/{async-slice-OftEOtMA.js → async-slice-DhZDjEtw.js} +2 -2
- package/dist/{blockDiagram-BEXU5L5S-BM-gkWAO.js → blockDiagram-BEXU5L5S-BOsyK4E_.js} +11 -11
- package/dist/{c4Diagram-YGBWAQC7-D9xSt2QO.js → c4Diagram-YGBWAQC7-El4SkIzX.js} +8 -8
- package/dist/{channel-Dg92Hoym.js → channel-CnLB6790.js} +1 -1
- package/dist/{chunk-3FUC2YCW-Cf18L00V.js → chunk-3FUC2YCW-BCsKm3ZT.js} +8 -8
- package/dist/{chunk-5DYCD2WN-Cja1INgd.js → chunk-5DYCD2WN-Cd1zazNp.js} +3 -3
- package/dist/{chunk-6AEJRKK7-3YWRP4aV.js → chunk-6AEJRKK7-BLBlw8ui.js} +2 -2
- package/dist/{chunk-742MDFTN-Cs1qGiTK.js → chunk-742MDFTN-CsUjFyzK.js} +2 -2
- package/dist/{chunk-7INBJB4K-BY5n77ka.js → chunk-7INBJB4K-k-I67NSP.js} +6 -6
- package/dist/{chunk-7M6MHVWA-C3x6E3yT.js → chunk-7M6MHVWA-C3qpW8zM.js} +9 -9
- package/dist/{chunk-7PRAP22T-_Av9vcXz.js → chunk-7PRAP22T-0C6_H8Li.js} +1 -1
- package/dist/{chunk-GNY47TPC-D1E6DHDV.js → chunk-GNY47TPC-CzPNLW5k.js} +11 -11
- package/dist/{chunk-GTNCS2PH-BZ9WMD1v.js → chunk-GTNCS2PH-AJi9PVT7.js} +3 -3
- package/dist/{chunk-GWA4HPMP-Co-A6dtV.js → chunk-GWA4HPMP-B8jXI0Tl.js} +3 -3
- package/dist/{chunk-MBY4JIJT-C3RQP_Nk.js → chunk-MBY4JIJT-BFIqOe-8.js} +4 -4
- package/dist/{chunk-NETBCI7D-DJUuN4EY.js → chunk-NETBCI7D-tNinefdn.js} +1 -1
- package/dist/{chunk-O7XYJQB3-A66QSOPA.js → chunk-O7XYJQB3-BChweQ_V.js} +1 -1
- package/dist/{chunk-UA2S7LBM-BNeHeMx9.js → chunk-UA2S7LBM-ChuksCDg.js} +6 -6
- package/dist/{chunk-WEXAMYUT-CucJfehv.js → chunk-WEXAMYUT-CbFOhEve.js} +2 -2
- package/dist/{chunk-XXDRQBXY-FgXU14Bh.js → chunk-XXDRQBXY-dKXxu_aj.js} +1 -1
- package/dist/{chunk-Z7XXMR3K-DMTBxZxM.js → chunk-Z7XXMR3K-C9P-XjM2.js} +8 -8
- package/dist/{chunk-ZIGJFQKS-C3xUAXJq.js → chunk-ZIGJFQKS-9VXArDKF.js} +3 -3
- package/dist/{classDiagram-v2-NBCMYWYE-BDaxYvDy.js → classDiagram-v2-NBCMYWYE-D00ZobEC.js} +14 -14
- package/dist/clsx-CbxlCXZ3.js +16 -0
- package/dist/components/base-content.css +139 -0
- package/dist/components/base.css +150 -0
- package/dist/components/components.css +2 -0
- package/dist/components/reduced-motion.css +56 -0
- package/dist/components/theme-tokens.css +116 -0
- package/dist/components/ui/actions/button-group/button-group.css +1 -1
- package/dist/components/ui/feedback/toast/toast.css +21 -0
- package/dist/components/ui/primitives/label/label.css +33 -0
- package/dist/{components-DrStgM4J.js → components-km60bAdr.js} +34658 -34218
- package/dist/components.js +6 -6
- package/dist/{cose-bilkent-JH36ORCC-DRUT3qBb.js → cose-bilkent-JH36ORCC-P94vkHv_.js} +2 -2
- package/dist/{cynefinDiagram-VND7K2PF-B9HrdQW8.js → cynefinDiagram-VND7K2PF-EIpXbLXm.js} +4 -4
- package/dist/{dagre-6A5THRUB-DZF0nICj.js → dagre-6A5THRUB-D_F3_LlW.js} +20 -20
- package/dist/{diagram-22UHCM2B-CVZYpeev.js → diagram-22UHCM2B-CsxOExpW.js} +15 -15
- package/dist/{diagram-3UASUU5V-D7MmBJbM.js → diagram-3UASUU5V-Dl7AETV1.js} +7 -7
- package/dist/{diagram-ATOU4E4O-CNY-8kl0.js → diagram-ATOU4E4O-isL7nwg2.js} +3 -3
- package/dist/{diagram-CDSNMT55-C8Mk1smi.js → diagram-CDSNMT55-Bnhlo5at.js} +5 -5
- package/dist/{diagram-MLGK6HIB-CpfeILwW.js → diagram-MLGK6HIB-DvBcyz8v.js} +4 -4
- package/dist/{diagram-MPIPVDR6-Do7bUnTd.js → diagram-MPIPVDR6-iTevwmNE.js} +4 -4
- package/dist/{dist-C3YK_ean.js → dist-B6_-RPZ3.js} +1 -1
- package/dist/{dist-CRbPtqwD.js → dist-BvUQHUs_.js} +4 -4
- package/dist/dnd.js +1 -1
- package/dist/{ebnfDiagram-ZINNZB2B-1GewX9Zq.js → ebnfDiagram-ZINNZB2B-RVuQIpm0.js} +4 -4
- package/dist/{elk-276RUBZZ-DI4eicFj.js → elk-276RUBZZ-BK-NMLiI.js} +26 -26
- package/dist/{erDiagram-OPXOYQCR-CUbpVns3.js → erDiagram-OPXOYQCR-DC1GgS4l.js} +14 -14
- package/dist/field-blur--x_n3oMy.js +3637 -0
- package/dist/flowDiagram-KWPJA3E3-BUSlDNQP.js +17 -0
- package/dist/{ganttDiagram-FUAMR5RP-D3vmspam.js → ganttDiagram-FUAMR5RP-DOp1p_x0.js} +6 -6
- package/dist/{gitGraphDiagram-X574FWY7-80yOq8dE.js → gitGraphDiagram-X574FWY7-DerJL1Q-.js} +3 -3
- package/dist/{graphlib-DLJn7qS3.js → graphlib-DLjE3QPd.js} +6 -6
- package/dist/hooks.js +3 -3
- package/dist/{i18n-provider-DBFRz5uH.js → i18n-provider-CQL7fqLy.js} +1 -1
- package/dist/i18n.js +6 -6
- package/dist/icon-button-G9zdQ3Ix.js +2753 -0
- package/dist/{infoDiagram-VRGFBTTK-Cboh-B9n.js → infoDiagram-VRGFBTTK-CtVsLyCQ.js} +3 -3
- package/dist/{isArrayLikeObject-CO5xeuaJ.js → isArrayLikeObject-CO-5KAzG.js} +3 -3
- package/dist/{isEmpty-DOC38Ces.js → isEmpty-Bl1drJE7.js} +3 -3
- package/dist/{ishikawaDiagram-OU5B5YK6-DwTd1YxL.js → ishikawaDiagram-OU5B5YK6-D1n8vp8C.js} +4 -4
- package/dist/{journeyDiagram-ZHPQQLJL-Dxvl3oeN.js → journeyDiagram-ZHPQQLJL-DuQ9Th0y.js} +4 -4
- package/dist/{kanban-definition-PNTS6WVX-S8plI4wn.js → kanban-definition-PNTS6WVX-D1-Owjil.js} +10 -10
- package/dist/lib/components/ui/actions/button/busy-click-capture.d.ts +11 -0
- package/dist/lib/components/ui/actions/button/button-tones.d.ts +36 -0
- package/dist/lib/components/ui/actions/button/button.d.ts +19 -0
- package/dist/lib/components/ui/actions/button/button.wrap.d.ts +8 -0
- package/dist/lib/components/ui/actions/button/label-text.d.ts +10 -0
- package/dist/lib/components/ui/actions/button/use-click-lock.d.ts +18 -0
- package/dist/lib/components/ui/actions/copy-button/copy-button.d.ts +5 -1
- package/dist/lib/components/ui/actions/icon-button/icon-button.compound-variants.d.ts +114 -0
- package/dist/lib/components/ui/collections/data-table/hooks.d.ts +13 -13
- package/dist/lib/components/ui/collections/data-table/partials/data-table-empty-row.d.ts +5 -1
- package/dist/lib/components/ui/collections/data-table/partials/data-table-scroll-region.d.ts +16 -0
- package/dist/lib/components/ui/collections/data-table/partials/data-table-toolbar.d.ts +24 -0
- package/dist/lib/components/ui/collections/data-table/select-checkbox.d.ts +10 -0
- package/dist/lib/components/ui/collections/data-table/types.d.ts +9 -0
- package/dist/lib/components/ui/collections/data-table/use-data-table.d.ts +12 -1
- package/dist/lib/components/ui/collections/data-table/use-scroll-edges.d.ts +22 -0
- package/dist/lib/components/ui/dates/calendar/calendar-day.d.ts +8 -0
- package/dist/lib/components/ui/dates/calendar/calendar.d.ts +3 -3
- package/dist/lib/components/ui/dates/calendar/calendar.utils.d.ts +8 -0
- package/dist/lib/components/ui/dates/calendar/use-calendar-labels.d.ts +22 -0
- package/dist/lib/components/ui/display/description/description.d.ts +2 -1
- package/dist/lib/components/ui/display/list-tile/list-tile.d.ts +9 -1
- package/dist/lib/components/ui/display/list-tile/partials/list-tile-body.d.ts +11 -0
- package/dist/lib/components/ui/display/list-tile/partials/list-tile-classes.d.ts +10 -0
- package/dist/lib/components/ui/feedback/alert-dialog/alert-dialog.d.ts +1 -1
- package/dist/lib/components/ui/feedback/toast/partials/toast-actions.d.ts +3 -0
- package/dist/lib/components/ui/feedback/toast/toast.d.ts +27 -3
- package/dist/lib/components/ui/feedback/toast/toaster.d.ts +19 -0
- package/dist/lib/components/ui/feedback/toast/toasts.d.ts +3 -0
- package/dist/lib/components/ui/forms/field-blur.d.ts +7 -2
- package/dist/lib/components/ui/forms/use-field-blur.d.ts +8 -1
- package/dist/lib/components/ui/layout/app-shell/activity-content.d.ts +10 -1
- package/dist/lib/components/ui/layout/app-shell/activity-layout.d.ts +26 -2
- package/dist/lib/components/ui/layout/app-shell/app-header.d.ts +8 -2
- package/dist/lib/components/ui/layout/app-shell/app-sidebar.d.ts +8 -2
- package/dist/lib/components/ui/layout/app-shell/types.d.ts +3 -0
- package/dist/lib/components/ui/layout/app-shell/use-content-scroll.d.ts +10 -0
- package/dist/lib/components/ui/layout/app-shell/use-navigation-sheet.d.ts +19 -0
- package/dist/lib/components/ui/layout/sidebar/index.d.ts +5 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-content.d.ts +2 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-context.d.ts +7 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-footer.d.ts +2 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-header.d.ts +2 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-menu-item-tooltip.d.ts +7 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-menu-item.d.ts +31 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-menu-label.d.ts +4 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar.d.ts +1 -12
- package/dist/lib/components/ui/overlays/context-menu/context-menu-items.d.ts +10 -0
- package/dist/lib/components/ui/overlays/context-menu/context-menu-sub.d.ts +8 -0
- package/dist/lib/components/ui/overlays/context-menu/context-menu.d.ts +4 -14
- package/dist/lib/components/ui/overlays/dialog/dialog-outside.d.ts +6 -0
- package/dist/lib/components/ui/overlays/dialog/dialog-scroll-content.d.ts +1 -1
- package/dist/lib/components/ui/overlays/dialog/dialog.d.ts +1 -1
- package/dist/lib/components/ui/overlays/dialog/use-return-focus.d.ts +3 -2
- package/dist/lib/components/ui/overlays/drawer/drawer.d.ts +1 -1
- package/dist/lib/components/ui/overlays/dropdown-menu/dropdown-menu-items.d.ts +11 -0
- package/dist/lib/components/ui/overlays/dropdown-menu/dropdown-menu-sub.d.ts +8 -0
- package/dist/lib/components/ui/overlays/dropdown-menu/dropdown-menu.d.ts +6 -21
- package/dist/lib/components/ui/overlays/popover/popover.d.ts +1 -1
- package/dist/lib/components/ui/overlays/sheet/sheet.d.ts +1 -1
- package/dist/lib/components/ui/primitives/card/card.d.ts +10 -1
- package/dist/lib/components/ui/primitives/link/link-component.d.ts +14 -0
- package/dist/lib/components/ui/primitives/tabs/partials/tabs-content.d.ts +3 -0
- package/dist/lib/components/ui/primitives/tabs/partials/tabs-indicator.d.ts +13 -0
- package/dist/lib/components/ui/primitives/tabs/partials/tabs-list.d.ts +3 -0
- package/dist/lib/components/ui/primitives/tabs/partials/tabs-trigger.d.ts +6 -0
- package/dist/lib/components/ui/primitives/tabs/tabs-classes.d.ts +27 -0
- package/dist/lib/components/ui/primitives/tabs/tabs-variant.d.ts +5 -0
- package/dist/lib/components/ui/primitives/tabs/tabs.d.ts +11 -7
- package/dist/lib/components/ui/selection/select/select.d.ts +1 -1
- package/dist/lib/components/ui/selection/select-chip-field/select-chip-field.d.ts +1 -1
- package/dist/lib/components/ui/widgets/emoji/types.d.ts +1 -6
- package/dist/lib/i18n/resources/en/en.d.ts +23 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +28 -5
- package/dist/lib/i18n/resources/fr/fr.d.ts +23 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +28 -5
- package/dist/lib/i18n/resources/resources.d.ts +46 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/lib/redux/status-slice.d.ts +1 -1
- package/dist/lib.js +39 -55
- package/dist/main.js +13 -13
- package/dist/map.js +35 -35
- package/dist/material.css +1 -1
- package/dist/{merge-CuDTNgpm.js → merge-CwwtONfp.js} +4 -4
- package/dist/{mermaid.core-O7mtb1-p.js → mermaid.core-Dfr4zfuP.js} +49 -49
- package/dist/{mindmap-definition-NLK3R4M7-CO0E97EZ.js → mindmap-definition-NLK3R4M7-_qKWGSrk.js} +13 -13
- package/dist/{pegDiagram-GJSIUBJH-CAO6aYvj.js → pegDiagram-GJSIUBJH-CWKobqLl.js} +4 -4
- package/dist/{pieDiagram-5QR66LMP-BXxVfv5K.js → pieDiagram-5QR66LMP-B6at48Bd.js} +5 -5
- package/dist/print.js +2 -2
- package/dist/{quadrantDiagram-O4NWA36T-BbidZDM8.js → quadrantDiagram-O4NWA36T-Cr9bA0xJ.js} +3 -3
- package/dist/{railroadDiagram-XR7U4H2S-DmKDXg8V.js → railroadDiagram-XR7U4H2S-fsZ7oqPG.js} +4 -4
- package/dist/{requirementDiagram-PLB6GJNP-wFvgSWJP.js → requirementDiagram-PLB6GJNP-BBs-lByV.js} +13 -13
- package/dist/rolldown-runtime-BFFgcFxR.js +30 -0
- package/dist/{sankeyDiagram-IPEJSGJF-Cka5t09q.js → sankeyDiagram-IPEJSGJF-BzX37jGY.js} +3 -3
- package/dist/{sequenceDiagram-PO4LG4MO-B2qb55A5.js → sequenceDiagram-PO4LG4MO-Bgx1kuGA.js} +5 -5
- package/dist/{sortable-provider-C5VYhY8u.js → sortable-provider-WZT5I34N.js} +24 -24
- package/dist/{src-C9kQSo6K.js → src-CsLQInsN.js} +1 -1
- package/dist/{stateDiagram-v2-GCMORJYK-EMa7q3ju.js → stateDiagram-v2-GCMORJYK-Chc9Z6Mr.js} +14 -14
- package/dist/{stored-language-B0o4cBh8.js → stored-language-BW32owje.js} +56 -10
- package/dist/styles.css +10 -368
- package/dist/{swimlanes-2SLR337P-BtZ7Di5u.js → swimlanes-2SLR337P-D0yLvfot.js} +12 -12
- package/dist/swimlanesDiagram-TC7HE7FX-BOd0Czfs.js +28 -0
- package/dist/{timeline-definition-EJHVYXUP-2Z6UABw8.js → timeline-definition-EJHVYXUP-nDNR-Dt-.js} +5 -5
- package/dist/{translate-material-BCwQrt2G.js → translate-material-ZEzF-LKH.js} +2 -2
- package/dist/{translator-CwpmpI24.js → translator-BfqVlNGW.js} +1 -1
- package/dist/{use-heading-spy-BtBJiU63.js → use-heading-spy-DvZVu15k.js} +37 -37
- package/dist/{use-material-translation-DG_7z3Q7.js → use-material-translation-B2GUtxUY.js} +2 -2
- package/dist/{usecaseDiagram-POWQR4AR-DT56cp_B.js → usecaseDiagram-POWQR4AR-Bwen99ay.js} +13 -13
- package/dist/{utils-UBn-46YY.js → utils-DC8bw9A_.js} +346 -360
- package/dist/{vennDiagram-UO4OBE2U-CO0yFCI8.js → vennDiagram-UO4OBE2U-BpgP__1T.js} +4 -4
- package/dist/{wardleyDiagram-VNRHLVJA-QkwghAYo.js → wardleyDiagram-VNRHLVJA-CYqKMb2f.js} +4 -4
- package/dist/{xychartDiagram-PMCCYNJV-B2aZlrno.js → xychartDiagram-PMCCYNJV-b-Quuxoi.js} +7 -7
- package/docs/components/buttons-and-actions.md +60 -10
- package/docs/components/data-display.md +24 -2
- package/docs/components/data-table-filter-and-lists.md +88 -10
- package/docs/components/date-and-time.md +24 -0
- package/docs/components/feedback-and-status.md +85 -8
- package/docs/components/form-fields.md +14 -5
- package/docs/components/media-and-files.md +7 -0
- package/docs/components/navigation-and-layout.md +21 -3
- package/docs/components/overlays-and-menus.md +21 -6
- package/docs/components/primitives.md +96 -7
- package/docs/components/rich-widgets.md +10 -0
- package/docs/components/selection-and-choice.md +13 -2
- package/docs/getting-started.md +4 -2
- package/docs/guides/app-shell.md +97 -4
- package/docs/guides/forms.md +54 -5
- package/docs/guides/helpers.md +2 -2
- package/docs/guides/i18n.md +24 -4
- package/docs/guides/ssr.md +1 -1
- package/docs/guides/theming.md +147 -5
- package/docs/previews/data-display-codegroup.webp +0 -0
- package/docs/previews/data-display-description.webp +0 -0
- package/docs/previews/feedback-status-toast.webp +0 -0
- package/docs/previews/primitives-tabs.webp +0 -0
- package/docs/previews/rich-widgets-emojipicker.webp +0 -0
- package/docs/roadmap.md +29 -1
- package/docs/troubleshooting.md +937 -11
- package/lib/components/base-content.css +139 -0
- package/lib/components/base.css +150 -0
- package/lib/components/components.css +2 -0
- package/lib/components/reduced-motion.css +56 -0
- package/lib/components/theme-tokens.css +116 -0
- package/lib/components/ui/actions/button-group/button-group.css +1 -1
- package/lib/components/ui/feedback/toast/toast.css +21 -0
- package/lib/components/ui/primitives/label/label.css +33 -0
- package/lib/styles.css +10 -368
- package/package.json +2 -2
- package/dist/field-blur-DWQtxiAe.js +0 -3483
- package/dist/flowDiagram-KWPJA3E3-DZxumFfu.js +0 -17
- package/dist/icon-button-BxySFfrr.js +0 -2718
- package/dist/lib/components/ui/widgets/emoji/emoji.groups.d.ts +0 -6
- package/dist/swimlanesDiagram-TC7HE7FX-CROh8GTF.js +0 -28
package/docs/guides/ssr.md
CHANGED
|
@@ -105,7 +105,7 @@ State the server cannot know must be resolved the same way on both sides:
|
|
|
105
105
|
| Language | no `localStorage`: `defaultLanguage` | Resolve it from the request and pass `initialLanguage` to `I18nProvider`. See [i18n](i18n.md#server-rendering) |
|
|
106
106
|
| Theme | no preference: light | An inline boot script in `<head>`, and `suppressHydrationWarning` on `<html>`. See [theming](theming.md#no-flash-on-load-a-boot-script) |
|
|
107
107
|
| `formatAmount`, `formatDate` | the server's locale and time zone, unless you pass them | Use `useFormatters({ timeZone })`, which follows the `I18nProvider` language, or pass `locale` and `timeZone` (`createFormatters` binds them). A date-only `YYYY-MM-DD` is the same everywhere. See [printing](printing.md#formatamount-and-formatdate) |
|
|
108
|
-
| Screen width, `prefers-color-scheme` (`useIsMobile`, `useTheme`, `AppHeader`, `DataTable`, `
|
|
108
|
+
| Screen width, `prefers-color-scheme` (`useIsMobile`, `useTheme`, `AppHeader`, `DataTable`, `TimeField`, `Stepper`, `PaneLayout`, `ListDetailsLayout`, the code blocks, …) | no screen: a desktop, light | Nothing: a hydrating client renders the same, then switches on a phone or a dark screen |
|
|
109
109
|
| Step form (`createStepFormSlice`) | no `localStorage`: step 0 | Nothing with `useSliceReducer`: a hydrating client renders step 0, then resumes. A slice in a Redux store: see [forms](forms.md#a-multi-step-form) |
|
|
110
110
|
| Zod messages | no `localStorage`: English | Pass the request's language, `zodLocaleError({ language })`, where the server formats messages. See [forms](forms.md#validation-messages) |
|
|
111
111
|
|
package/docs/guides/theming.md
CHANGED
|
@@ -33,8 +33,9 @@ at the top are needed is in [getting started](../getting-started.md#styles).
|
|
|
33
33
|
highlight.js (`RichTextEditor` code blocks), react-easy-crop
|
|
34
34
|
(`ImageCropper`), the `CodeBlock` theme, and the `nxgt-*` classes of
|
|
35
35
|
`ButtonGroup`, `BottomAppBar`, `ContactItem`, `OpeningHoursItem`,
|
|
36
|
-
`AttributeForm` and `AttributeValuesForm
|
|
37
|
-
dependencies, the rest ship in
|
|
36
|
+
`AttributeForm` and `AttributeValuesForm`, and the required-field mark drawn
|
|
37
|
+
after a `Label` (the first three are dependencies, the rest ship in
|
|
38
|
+
`lib/components/`);
|
|
38
39
|
- the **tokens**: CSS variables on `:root`, and their dark values on `.dark`
|
|
39
40
|
and `[data-theme="dark"]`;
|
|
40
41
|
- a `@theme` block that maps each token to a Tailwind colour, so `bg-primary`,
|
|
@@ -51,9 +52,11 @@ at the top are needed is in [getting started](../getting-started.md#styles).
|
|
|
51
52
|
| `--primary`, `--primary-foreground` | `bg-primary`, `text-primary-foreground` | filled buttons, active states, focus |
|
|
52
53
|
| `--secondary`, `--secondary-foreground` | `bg-secondary`, … | the secondary colour |
|
|
53
54
|
| `--muted`, `--muted-foreground` | `bg-muted`, `text-muted-foreground` | quiet surfaces, hints, placeholders |
|
|
55
|
+
| `--track`, `--track-fill` | `bg-track`, `bg-track-fill`, `border-track-fill` | the empty part of a slider or meter, the drawer handle; the slider range and thumb |
|
|
54
56
|
| `--accent`, `--accent-foreground` | `bg-accent`, … | hover surfaces |
|
|
55
57
|
| `--error`, `--success`, `--info`, `--warning` (+ `-foreground`) | `bg-error`, `text-success`, … | the status colours of `Button`, `Alert`, `Badge`, toasts |
|
|
56
|
-
| `--
|
|
58
|
+
| `--error-text` | `text-error-text` | error drawn as text: field messages, `HelperText` in its error state, form and dialog errors, `variant="error"` menu items |
|
|
59
|
+
| `--destructive` | `bg-destructive`, `text-destructive` | deprecated alias of `--error`: the light theme sets it to `var(--error)`, the dark theme keeps its own value; use `--error` |
|
|
57
60
|
| `--card`, `--popover`, `--tooltip` (+ `-foreground`) | `bg-card`, `bg-popover`, `bg-tooltip` | surfaces |
|
|
58
61
|
| `--border`, `--input`, `--ring` | `border-border`, `border-input`, `ring-ring` | outlines |
|
|
59
62
|
| `--chart-1` … `--chart-5` | `bg-chart-1`, … | chart series (the charts read them at runtime) |
|
|
@@ -90,20 +93,159 @@ Redefine the variables **after** the import, for light and dark separately:
|
|
|
90
93
|
Override the variable, not the `@theme` entry: `--color-primary` is defined as
|
|
91
94
|
`var(--primary)`, so one change reaches both modes and every derived colour.
|
|
92
95
|
|
|
93
|
-
For a single area of the page, set the variables on a wrapper
|
|
96
|
+
For a single area of the page, set the `--color-*` variables on a wrapper
|
|
97
|
+
(the `@theme` entries are resolved on the root, so setting `--primary` on an
|
|
98
|
+
element below it changes nothing):
|
|
94
99
|
|
|
95
100
|
```tsx
|
|
96
101
|
import { Button } from '@nxgt/material/components';
|
|
97
102
|
|
|
98
103
|
export function DangerZone() {
|
|
99
104
|
return (
|
|
100
|
-
<section style={{ ['--primary' as string]: 'var(--error)' }}>
|
|
105
|
+
<section style={{ ['--color-primary' as string]: 'var(--error)' }}>
|
|
101
106
|
<Button>Delete workspace</Button>
|
|
102
107
|
</section>
|
|
103
108
|
);
|
|
104
109
|
}
|
|
105
110
|
```
|
|
106
111
|
|
|
112
|
+
## Contrast and reduced motion
|
|
113
|
+
|
|
114
|
+
**Contrast.** The shipped light palette keeps the text of every filled status
|
|
115
|
+
colour at 4.5:1 or more (WCAG 1.4.3): `--secondary` 5.7:1, `--success` 5.6:1,
|
|
116
|
+
`--info` 5.8:1 and `--warning` 5.3:1 against their `-foreground`, and
|
|
117
|
+
`--secondary` as text (a `tonal`, `outlined` or `link` `Button`) 6.0:1 on
|
|
118
|
+
`--background`, 4.8:1 on its own 15 % `tonal` tint.
|
|
119
|
+
|
|
120
|
+
The dark theme keeps brighter values, read as text on the dark surfaces: the
|
|
121
|
+
dark `--secondary` (`oklch(0.66 0.1135 245.65)`) is 6.5:1 on `--background`
|
|
122
|
+
and 5.8:1 on `--card` (a `tonal` secondary `Button` 5.4:1 and 4.6:1). Under
|
|
123
|
+
near-white text those brights are too light, so every filled surface built on
|
|
124
|
+
them is tinted in the dark theme: a filled `secondary` `Button`, `IconButton`
|
|
125
|
+
or `Badge` at 70 % (5.2:1 on `--background`, 4.9:1 on `--card`), a filled
|
|
126
|
+
`success`, `info` or `warning` one at 60 % (7.3:1, 5.7:1 and 7.5:1 on
|
|
127
|
+
`--background`; 6.7:1, 5.3:1 and 7.0:1 on `--card`). Their hover, focus and
|
|
128
|
+
pressed states are tinted further down, so they only gain contrast.
|
|
129
|
+
|
|
130
|
+
In the light theme the filled `primary`, `secondary`, `success`, `info`,
|
|
131
|
+
`warning` and `error` buttons darken when hovered, focused or pressed (mixed
|
|
132
|
+
with 10, 15 and 20 % black) rather than fading toward the page, so their
|
|
133
|
+
near-white text only gains contrast (the filled `default` variant's states are
|
|
134
|
+
unchanged); a `tonal` button's focus tint is 10 %
|
|
135
|
+
(lighter than its 15 % rest), an `outlined` one's 15 %, and its hover keeps the
|
|
136
|
+
text colour.
|
|
137
|
+
|
|
138
|
+
The `tonal`, `outlined` and `link` variants of `Button` and `IconButton` draw
|
|
139
|
+
their text and icon in one tone per colour, read on `--background`, on
|
|
140
|
+
`--card` and on the variant's own tint (15 % at most, at rest or focused). In
|
|
141
|
+
the light theme `primary`, `secondary`, `info` and `success` use the token
|
|
142
|
+
itself (5.8, 4.8, 4.9 and 4.7:1 at their lowest) and `warning` and `error` the
|
|
143
|
+
token mixed with 15 % black (6.0 and 5.4:1). In the dark theme `primary` is
|
|
144
|
+
mixed with 60 % white (8.1:1 on `--card`: the token itself is a dark indigo,
|
|
145
|
+
2.2:1), `success` and `warning` with 15 % white (5.0 and 5.4:1), `error` with
|
|
146
|
+
30 % white (5.9:1), and `secondary` and `info` use the token (4.6 and 5.3:1).
|
|
147
|
+
The tones are mixed from the tokens (`color-mix(in oklab, var(--color-error)
|
|
148
|
+
85%, black)`), so an override of a token moves its tone with it; a text colour
|
|
149
|
+
of your own on one of those buttons (`className="text-primary"`) replaces the tone
|
|
150
|
+
and is yours to check.
|
|
151
|
+
|
|
152
|
+
A `Badge` used as a link (`asChild` around an `<a>`) darkens on hover like a filled
|
|
153
|
+
button (mixed with 10 % black; in the dark theme its tint drops by ten
|
|
154
|
+
points) rather than fading toward the page. A selected `ListTile` draws its
|
|
155
|
+
subtitle in `text-foreground/70` (7.0:1 on the selected tint, where the muted
|
|
156
|
+
colour gave 4.4:1). The light `--error` is `oklch(0.56 0.245 27.325)`, a shade
|
|
157
|
+
darker than the dark theme's: a filled `error` button's near-white text reaches
|
|
158
|
+
4.8:1 (it was 4.6:1). The dark `--error` keeps `0.577`: a lighter value drops
|
|
159
|
+
the filled surface's near-white text below 4.5:1 (`0.62` gives 3.85:1).
|
|
160
|
+
|
|
161
|
+
**Error text has a token of its own**, `--error-text` (`text-error-text`), so
|
|
162
|
+
the fill can stay dark while the text is light enough to read. The light value
|
|
163
|
+
is `color-mix(in oklab, var(--error) 94%, black)` (5.7:1 on `--background`
|
|
164
|
+
and `--card`, 4.8:1 on the `bg-error/10` tint of a focused menu item, where
|
|
165
|
+
`--error` gives 5.0 and 4.2:1); the dark one is
|
|
166
|
+
`color-mix(in oklab, var(--error) 80%, white)`, 5.9:1 on `--background` and
|
|
167
|
+
5.3:1 on `--card`, where `--error` itself gives 4.2 and 3.8:1. Field messages,
|
|
168
|
+
`HelperText` in its error state, form, dialog and upload errors, a textarea's
|
|
169
|
+
counter over its limit, the error lines of `Terminal`, a
|
|
170
|
+
`variant="error"` menu item and the falling values of the metric cards use it.
|
|
171
|
+
|
|
172
|
+
Which one to use:
|
|
173
|
+
|
|
174
|
+
- **`text-error-text`** for an error written as text on a page, card or
|
|
175
|
+
popover surface (your own validation message, a failed row, an inline
|
|
176
|
+
error), and for an icon drawn beside that text, so the two match.
|
|
177
|
+
- **`text-error`** (with `bg-error`, `border-error`, `ring-error`,
|
|
178
|
+
`stroke-error`) for fills, borders, rings and icons that stand alone: those
|
|
179
|
+
need 3:1 (WCAG 1.4.11), which `--error` reaches in both themes. Text on a
|
|
180
|
+
filled error surface is `text-error-foreground`.
|
|
181
|
+
|
|
182
|
+
`--error-text` is computed where it is declared, on the root, and `@theme`
|
|
183
|
+
resolves `--color-error-text` there too: an override of `--error` under `:root`
|
|
184
|
+
and `.dark, [data-theme="dark"]` moves it, but setting `--error-text` or
|
|
185
|
+
`--error` on an element below the root changes nothing. Below the root, set
|
|
186
|
+
`--color-error-text` (and `--color-error` for fills) on that element, or put
|
|
187
|
+
the override on the root.
|
|
188
|
+
|
|
189
|
+
Storybook's `Guides/Theming/Contrast` measures all of this in both themes:
|
|
190
|
+
the surfaces' text, the error text (`HelperText` and a field's message on
|
|
191
|
+
`--background` and `--card`), the `Alert`s and the `Timeline`, `Button` and
|
|
192
|
+
`IconButton` in every variant and colour, and a `Badge` link in every colour,
|
|
193
|
+
at rest, hovered, focused and pressed, the tracks and the tabs;
|
|
194
|
+
`Data display/ListTile` measures the selected tile. Run them against your own
|
|
195
|
+
tokens after an override.
|
|
196
|
+
|
|
197
|
+
**Tabs.** An `underline` tab's active label is `--primary` in the light
|
|
198
|
+
theme (7.3:1 on `--background` and `--card`, 6.7:1 on `--muted`) and
|
|
199
|
+
`--primary` mixed with 60 % white in the dark one (10.0:1, 9.0:1 and 7.4:1);
|
|
200
|
+
its bar and every tab's focus outline are `--primary` in the light theme and
|
|
201
|
+
`--track-fill` in the dark one (at least 6.7:1 and 9.0:1 on those surfaces).
|
|
202
|
+
An inactive label is `--muted-foreground`, and turns to `--foreground` when
|
|
203
|
+
hovered. A `segmented` tab's active label is `--foreground` on the raised
|
|
204
|
+
surface (19.9:1 light, 17.0:1 dark); that surface is only 1.1:1 to 1.2:1 on
|
|
205
|
+
the track, so it has a `--muted-foreground` border (5.0:1 light, 4.7:1 dark
|
|
206
|
+
on the track), and the label also changes colour and weight. Storybook's
|
|
207
|
+
`Guides/Theming/Contrast` story `Tabs` measures each label at rest, hovered
|
|
208
|
+
and focused, the outline, the bar and the border, on the three surfaces, in
|
|
209
|
+
both themes.
|
|
210
|
+
|
|
211
|
+
`--muted-foreground` is 5.5:1 on `--background` and `--card`, 5.1:1 on the
|
|
212
|
+
"paper" tint (`bg-background-paper`, 5 % primary) and 5.0:1 on `--muted` in
|
|
213
|
+
the light theme; in the dark theme it is 6.4:1 on `--background`, 5.7:1 on
|
|
214
|
+
`--card`, 6.3:1 on the paper tint and 4.7:1 on `--muted`. The dark `--muted`
|
|
215
|
+
is a dark surface (`oklch(0.279 0.041 260.031)`, it was the light value, a
|
|
216
|
+
near-white block on a dark page) and `--foreground` on it reaches 14.0:1.
|
|
217
|
+
|
|
218
|
+
**Tracks.** The empty part of a `Slider`, of the password strength meter and
|
|
219
|
+
the `Drawer` handle use `--track` (`bg-track`), and the `Slider`'s range and
|
|
220
|
+
thumb border `--track-fill` (`bg-track-fill`, `border-track-fill`). In the
|
|
221
|
+
dark theme the track reaches 3.6:1 on `--background` and 3.2:1 on `--card`
|
|
222
|
+
(WCAG 1.4.11; `bg-muted`, a dark surface now, gave 1.4:1 and 1.2:1), and the
|
|
223
|
+
fill 3.4:1 on the track. The light theme keeps a pale track (`--track` is the
|
|
224
|
+
light `--muted`) and `--track-fill` is `--primary`: the thumb, 7.3:1 on the
|
|
225
|
+
page, shows the value. A track, bar, handle or divider of your own drawn with
|
|
226
|
+
`bg-muted` is near invisible in the dark theme now that `--muted` is a dark
|
|
227
|
+
surface: draw it with `bg-track`.
|
|
228
|
+
|
|
229
|
+
When you override one of these tokens, keep its pair at 4.5:1 (3:1 for an
|
|
230
|
+
icon or a border), or the `Badge`, `Button`, `Alert` and toast text built on it fails
|
|
231
|
+
an accessibility audit. The muted text of a highlighted menu entry (a
|
|
232
|
+
`DropdownMenuShortcut`, the code in `LanguageSwitcher`) switches to
|
|
233
|
+
`--accent-foreground` while the entry is highlighted, so a `--muted-foreground`
|
|
234
|
+
of your own does not have to pass on the highlight colour.
|
|
235
|
+
|
|
236
|
+
**Reduced motion.** `styles.css` imports `components/reduced-motion.css`: one
|
|
237
|
+
`@media (prefers-reduced-motion: reduce)` rule that turns off the transitions
|
|
238
|
+
and animations of every catalogue component (everything under a `data-slot`,
|
|
239
|
+
and the toasts): dialogs, sheets and menus appear without sliding or fading,
|
|
240
|
+
buttons and toasts without transitions. The `Spinner` and any `animate-spin` element (a spinning
|
|
241
|
+
loading icon) keep turning: they are the only sign that something is loading.
|
|
242
|
+
The rule is `!important` but unlayered and with a specificity of 0, so a
|
|
243
|
+
component's own `duration-*` utility does not outrank it, and your own
|
|
244
|
+
`!important` rule on a class does; to keep one motion for everyone, override it
|
|
245
|
+
on that element with that rule inside `@media (prefers-reduced-motion: reduce)`.
|
|
246
|
+
Your own components outside a `data-slot` are yours: use Tailwind's
|
|
247
|
+
`motion-reduce:` variant on them.
|
|
248
|
+
|
|
107
249
|
## Dark mode
|
|
108
250
|
|
|
109
251
|
Dark values apply under a `.dark` class **or** a `data-theme="dark"`
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/roadmap.md
CHANGED
|
@@ -18,6 +18,9 @@ Nothing in progress right now; see Next.
|
|
|
18
18
|
|
|
19
19
|
## Later
|
|
20
20
|
|
|
21
|
+
- **Next major: `ListTile`'s `data-slot` becomes `list-tile`** — it is
|
|
22
|
+
`item-detail` today, so the name matches the component like every other
|
|
23
|
+
slot. Breaking for a selector or a test that looks for `item-detail`.
|
|
21
24
|
- **3.0: the same amounts and dates on every machine** — `formatAmount` and
|
|
22
25
|
`formatDate` stop falling back to the runtime's locale when you pass none, so
|
|
23
26
|
a server and a browser always print the same string.
|
|
@@ -85,6 +88,31 @@ Nothing in progress right now; see Next.
|
|
|
85
88
|
|
|
86
89
|
## Shipped
|
|
87
90
|
|
|
91
|
+
- **Tabs in two looks** — `underline`, the new default, whose bar slides to
|
|
92
|
+
the active tab, and a neutral `segmented` pill; a list that scrolls
|
|
93
|
+
sideways on a phone instead of widening the page, right-to-left, a visible
|
|
94
|
+
focus ring, labels that read 4.5:1 in both themes, and an indicator that
|
|
95
|
+
stops sliding under `prefers-reduced-motion`. `bar` and `line` still work,
|
|
96
|
+
as deprecated aliases of `underline` and `segmented`. 2.9.0.
|
|
97
|
+
|
|
98
|
+
- **Accessible by default** — error text in its own `--error-text` colour that
|
|
99
|
+
reads 4.5:1 in both themes, the empty part of sliders and meters in a
|
|
100
|
+
`--track` colour that reads 3:1, buttons, badges and status colours that
|
|
101
|
+
reach WCAG contrast, animations that honour `prefers-reduced-motion`, the
|
|
102
|
+
page behind a modal layer made `inert`, focus on the first invalid field
|
|
103
|
+
after a failed submit, Escape that reaches the layer below while one
|
|
104
|
+
closes, and a `Toaster` at the top of a phone whose toasts a tap does not
|
|
105
|
+
pause and whose actions work over a dialog. 2.8.0.
|
|
106
|
+
- **Fits a phone** — `DataTable` with no height cap by default (`maxHeight`
|
|
107
|
+
when it should scroll in a box), a header row at every width, and wide
|
|
108
|
+
columns that scroll sideways in one region a keyboard can reach; a `Button`
|
|
109
|
+
never wider than its container (a long label ends in "…", or wraps with
|
|
110
|
+
`wrap`); `OtpField` slots that shrink to fit a narrow card. 2.8.0.
|
|
111
|
+
- **App shell links, landmarks and scrolling** — menu entries that are real
|
|
112
|
+
links (middle-click, before hydration, `aria-current="page"`, your router's
|
|
113
|
+
link through `linkComponent`), one `<main>` landmark, and a shell
|
|
114
|
+
that lets the document scroll, with `scroll="container"` for a full-height
|
|
115
|
+
screen. 2.8.0.
|
|
88
116
|
- **DataTable server-side data** — hand the table one page from your loader
|
|
89
117
|
(`manual`): no client paging or sorting, controlled sorting and selection by
|
|
90
118
|
row id (`sorting`, `rowSelection`, `getRowId`), a footer with "41–60 of 133"
|
|
@@ -146,7 +174,7 @@ Nothing in progress right now; see Next.
|
|
|
146
174
|
- **Accessible names, ids and focus across the catalogue** — every field is
|
|
147
175
|
named by its label and says it is required on the element a screen reader
|
|
148
176
|
lands on (the input, the picker's `combobox`, the slider thumbs, the
|
|
149
|
-
group), with the asterisk
|
|
177
|
+
group), with the asterisk drawn by CSS, so in no name or label text; groups are named by their question
|
|
150
178
|
and describe their error instead of carrying `aria-invalid` where ARIA does
|
|
151
179
|
not allow it; ids are generated rather than taken from a field's `name` or
|
|
152
180
|
an option's `value`, so two forms on one page no longer collide; icon
|