@nxgt/material 3.10.2 → 3.12.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 +96 -0
- package/README.md +10 -11
- package/dist/{async-slice-DDjaJY_F.js → async-slice-4qbER86I.js} +1 -1
- package/dist/button-BNjw-pnE.js +327 -0
- package/dist/button-group-context-CaP0X5p_.js +5 -0
- package/dist/{button-tones-BgZJ1tkD.js → button-tones-BwuVvAmd.js} +9 -1
- package/dist/{callout-view-DdJPdFrP.js → callout-view-C6voDS00.js} +1 -1
- package/dist/charts.js +5 -5
- package/dist/{chip-DpySRqCy.js → chip-DLgQTJBZ.js} +4 -4
- package/dist/{code-editor-BiA14xua.js → code-editor-BZbaYLvo.js} +8 -8
- package/dist/code-editor.js +7 -7
- package/dist/{code-language-items-C_dJ6GVs.js → code-language-items-BT5BO5w6.js} +2 -2
- package/dist/components/base.css +21 -6
- package/dist/components/components.css +6 -2
- package/dist/components/type-scale.css +194 -0
- package/dist/components/ui/actions/button/button.css +156 -0
- package/dist/components/ui/actions/button-group/button-group-standard.css +131 -0
- package/dist/components/ui/actions/button-group/button-group.css +4 -1
- package/dist/components/ui/actions/icon-button/icon-button.css +115 -0
- package/dist/components/ui/actions/morph-fill.css +62 -0
- package/dist/components/ui/feedback/toast/toast-expressive.css +17 -0
- package/dist/components/ui/layout/app-shell/activity-backdrop-shapes.css +49 -0
- package/dist/components/ui/layout/app-shell/activity-backdrop.css +0 -17
- package/dist/components/ui/layout/sidebar/sidebar-tokens.css +7 -2
- package/dist/{components-BkF9N-Yx.js → components-yx1t_5_P.js} +13740 -13422
- package/dist/components.js +24 -24
- package/dist/{dialog-CkIYpJXk.js → dialog-BQp5IdFl.js} +147 -147
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-BC5Tbhb9.js → dropdown-menu-BsH9W_3C.js} +3 -3
- package/dist/editor-viewer.js +1 -1
- package/dist/editor.js +13 -13
- package/dist/{empty-state-SeAg2TOX.js → empty-state-WaU4-T2c.js} +5 -5
- package/dist/escape-owner-C4W_sOAU.js +116 -0
- package/dist/{field-blur-DPLsMufs.js → field-blur-CJHzVSh9.js} +1 -1
- package/dist/{field-blur-context-1ZwJgsHE.js → field-blur-context-Cft9s7Hg.js} +2 -2
- package/dist/{hover-card-Cox-tPDz.js → hover-card-C0fw2kLK.js} +72 -71
- package/dist/i18n.js +12 -12
- package/dist/{icon-badge-q3Ve8gra.js → icon-badge-DUAq9f7H.js} +4 -4
- package/dist/icon-button-ifTpXt0A.js +355 -0
- package/dist/{illustration-BfHRpVzM.js → illustration-BmQmvW_4.js} +1 -1
- package/dist/illustrations.js +2 -2
- package/dist/lib/components/ui/actions/button/button-tones.d.ts +16 -0
- package/dist/lib/components/ui/actions/button/button.d.ts +13 -0
- package/dist/lib/components/ui/actions/button/button.variants.d.ts +4 -3
- package/dist/lib/components/ui/actions/button-group/button-group-context.d.ts +16 -0
- package/dist/lib/components/ui/actions/button-group/button-group-reset.d.ts +13 -0
- package/dist/lib/components/ui/actions/button-group/button-group.d.ts +19 -2
- package/dist/lib/components/ui/actions/icon-button/icon-button-shape.d.ts +3 -2
- package/dist/lib/components/ui/actions/icon-button/icon-button.d.ts +18 -4
- package/dist/lib/components/ui/actions/icon-button/icon-button.variants.d.ts +34 -4
- package/dist/lib/components/ui/display/badge/badge.d.ts +7 -2
- package/dist/lib/components/ui/display/entity-header/entity-header.d.ts +9 -1
- package/dist/lib/components/ui/display/entity-header/entity-stats.d.ts +16 -0
- package/dist/lib/components/ui/display/entity-header/partials/entity-header-actions.d.ts +6 -0
- package/dist/lib/components/ui/display/entity-header/partials/entity-header-body.d.ts +14 -0
- package/dist/lib/components/ui/display/entity-header/partials/entity-header-icon.d.ts +6 -0
- package/dist/lib/components/ui/display/entity-header/partials/shown.d.ts +2 -0
- package/dist/lib/components/ui/display/list-tile/list-tile.d.ts +8 -1
- package/dist/lib/components/ui/display/list-tile/partials/list-tile-body.d.ts +2 -1
- package/dist/lib/components/ui/display/stat-card/index.d.ts +1 -1
- package/dist/lib/components/ui/display/stat-card/partials/stat-card-compact.d.ts +12 -0
- package/dist/lib/components/ui/display/stat-card/stat-card-classes.d.ts +3 -2
- package/dist/lib/components/ui/display/stat-card/stat-card.d.ts +2 -2
- package/dist/lib/components/ui/display/stat-card/types.d.ts +9 -0
- package/dist/lib/components/ui/feedback/alert/alert-variants.d.ts +18 -0
- package/dist/lib/components/ui/feedback/alert/alert.d.ts +2 -6
- package/dist/lib/components/ui/feedback/typing-indicator/typing-indicator.d.ts +1 -1
- package/dist/lib/components/ui/fields/slider/split-slider-props.d.ts +1 -1
- package/dist/lib/components/ui/fields/slider/use-slider-control.d.ts +1 -1
- package/dist/lib/components/ui/layout/app-shell/activity-column.d.ts +17 -0
- package/dist/lib/components/ui/layout/app-shell/activity-layout.d.ts +3 -106
- package/dist/lib/components/ui/layout/app-shell/activity-layout.types.d.ts +113 -0
- package/dist/lib/components/ui/layout/app-shell/app-breadcrumb.d.ts +2 -1
- package/dist/lib/components/ui/layout/app-shell/app-sidebar-icon-item.d.ts +13 -0
- package/dist/lib/components/ui/layout/app-shell/app-sidebar-label-item.d.ts +11 -0
- package/dist/lib/components/ui/layout/app-shell/keep-shapes-inside.d.ts +6 -0
- package/dist/lib/components/ui/layout/app-shell/observe-layout.d.ts +11 -0
- package/dist/lib/components/ui/layout/app-shell/shape-units.d.ts +16 -0
- package/dist/lib/components/ui/layout/app-shell/shapes-clear-content.d.ts +13 -0
- package/dist/lib/components/ui/layout/app-shell/types.d.ts +10 -0
- package/dist/lib/components/ui/layout/app-shell/use-keep-shapes-inside.d.ts +14 -0
- package/dist/lib/components/ui/layout/app-shell/watch-content.d.ts +19 -0
- package/dist/lib/components/ui/overlays/dialog/dialog-variants.d.ts +1 -1
- package/dist/lib/components/ui/primitives/toggle/toggle.d.ts +1 -1
- package/dist/lib/components/ui/primitives/typography/typography.d.ts +17 -7
- package/dist/lib/components/ui/primitives/typography/typography.variants.d.ts +55 -0
- package/dist/lib/components/ui/selection/choice-group/use-choice-group-field.d.ts +2 -2
- package/dist/lib/components/ui/tones.d.ts +1 -1
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +2 -2
- package/dist/{line-path-BQeLQZ-P.js → line-path-C5pZGC49.js} +1 -1
- package/dist/main.js +29 -29
- package/dist/map.js +9 -9
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +1 -1
- package/dist/{public-CtpsxV4I.js → public-B0Nq_yYV.js} +524 -524
- package/dist/{render-json-DyFYFIkZ.js → render-json-BOhvPnSv.js} +1 -1
- package/dist/{rich-code-block-C2Fp_FDU.js → rich-code-block-v7WmeZp9.js} +5 -5
- package/dist/{rich-text-viewer-LO1IZCWs.js → rich-text-viewer-W15XIwah.js} +2 -2
- package/dist/{skeleton-Bmp4gWAH.js → skeleton-DSdtr2qc.js} +1 -1
- package/dist/{sortable-provider-pVaEZzty.js → sortable-provider-CgDTolQR.js} +3 -3
- package/dist/{spinner-CsHcmcpF.js → spinner-BtSIYVrC.js} +3 -3
- package/dist/{state-scenes-SGNyZjTz.js → state-scenes-BX03WmSu.js} +1 -1
- package/dist/styles.css +2 -0
- package/dist/theme-picker.js +3 -3
- package/dist/{theme-toggle-oU-fh6WE.js → theme-toggle-B2Pehdhn.js} +2 -2
- package/dist/{toggle-group-j8zaxEg1.js → toggle-group-BMJNcFAC.js} +1 -1
- package/dist/{toolbar-items-CqHvlTU8.js → toolbar-items-rUHdVqAq.js} +399 -398
- package/dist/{tooltip-rhbqNmr3.js → tooltip-CkttDIab.js} +1 -1
- package/dist/{translate-material-CGZljjp1.js → translate-material-Bd_KgfB8.js} +1 -1
- package/dist/{translator-DCYO4Ij3.js → translator-Dje8HrNz.js} +5 -5
- package/dist/{use-chat-composer-nWWfVyrK.js → use-chat-composer-B0_STpQN.js} +4173 -4173
- package/dist/{use-material-translation-DkxcLbLM.js → use-material-translation-B3V_bz-5.js} +1 -1
- package/dist/{utils-Bcd2Z3ea.js → utils-BLfntITJ.js} +14 -1
- package/docs/components/buttons-and-actions.md +64 -15
- package/docs/components/data-display.md +40 -9
- package/docs/components/feedback-and-status.md +12 -1
- package/docs/components/navigation-and-layout.md +4 -3
- package/docs/components/primitives.md +52 -10
- package/docs/guides/app-shell.md +52 -8
- package/docs/guides/backgrounds.md +2 -0
- package/docs/guides/theming.md +55 -3
- package/docs/previews/buttons-actions-button.webp +0 -0
- package/docs/previews/buttons-actions-iconbutton.webp +0 -0
- package/docs/previews/data-display-badge.webp +0 -0
- package/docs/previews/data-display-entityheader.webp +0 -0
- package/docs/previews/data-display-listtile.webp +0 -0
- package/docs/previews/data-display-statcard.webp +0 -0
- package/docs/previews/feedback-status-banner.webp +0 -0
- package/docs/previews/navigation-layout-appshell-footer-icon.webp +0 -0
- package/docs/previews/navigation-layout-appshell-menu-badge.webp +0 -0
- package/docs/previews/navigation-layout-appshell.webp +0 -0
- package/docs/previews/navigation-layout-sidebar.webp +0 -0
- package/docs/previews/primitives-typography.webp +0 -0
- package/docs/roadmap.md +53 -4
- package/docs/troubleshooting.md +75 -4
- package/lib/components/base.css +21 -6
- package/lib/components/components.css +6 -2
- package/lib/components/type-scale.css +194 -0
- package/lib/components/ui/actions/button/button.css +156 -0
- package/lib/components/ui/actions/button-group/button-group-standard.css +131 -0
- package/lib/components/ui/actions/button-group/button-group.css +4 -1
- package/lib/components/ui/actions/icon-button/icon-button.css +115 -0
- package/lib/components/ui/actions/morph-fill.css +62 -0
- package/lib/components/ui/feedback/toast/toast-expressive.css +17 -0
- package/lib/components/ui/layout/app-shell/activity-backdrop-shapes.css +49 -0
- package/lib/components/ui/layout/app-shell/activity-backdrop.css +0 -17
- package/lib/components/ui/layout/sidebar/sidebar-tokens.css +7 -2
- package/lib/styles.css +2 -0
- package/package.json +2 -1
- package/dist/button-DbfdITBB.js +0 -322
- package/dist/components/ui/actions/icon-button/icon-button-morph-media.css +0 -65
- package/dist/components/ui/actions/icon-button/icon-button-morph.css +0 -152
- package/dist/escape-owner-CripBce_.js +0 -57
- package/dist/icon-button-DJcWpIhu.js +0 -319
- package/lib/components/ui/actions/icon-button/icon-button-morph-media.css +0 -65
- package/lib/components/ui/actions/icon-button/icon-button-morph.css +0 -152
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./utils-
|
|
2
|
-
import { t } from "./tooltip-
|
|
3
|
-
import { t as n } from "./use-material-translation-
|
|
4
|
-
import {
|
|
1
|
+
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
+
import { t } from "./tooltip-CkttDIab.js";
|
|
3
|
+
import { t as n } from "./use-material-translation-B3V_bz-5.js";
|
|
4
|
+
import { a as r } from "./button-tones-BwuVvAmd.js";
|
|
5
5
|
import { t as i } from "./react-node-text-Crkpfpco.js";
|
|
6
6
|
import { Check as a, X as o } from "lucide-react";
|
|
7
7
|
import { cloneElement as s, isValidElement as c } from "react";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
|
-
import { t } from "./utils-
|
|
2
|
+
import { t } from "./utils-BLfntITJ.js";
|
|
3
3
|
import { a as n } from "./dist-lmHmz_bu.js";
|
|
4
|
-
import { c as r, d as i, f as a, n as o, t as s } from "./dropdown-menu-
|
|
5
|
-
import { a as c, i as l, n as u } from "./field-blur-context-
|
|
6
|
-
import { a as d, d as f, r as p, t as m, u as h } from "./toolbar-items-
|
|
4
|
+
import { c as r, d as i, f as a, n as o, t as s } from "./dropdown-menu-BsH9W_3C.js";
|
|
5
|
+
import { a as c, i as l, n as u } from "./field-blur-context-Cft9s7Hg.js";
|
|
6
|
+
import { a as d, d as f, r as p, t as m, u as h } from "./toolbar-items-rUHdVqAq.js";
|
|
7
7
|
import { t as g } from "./is-production-GLw59WU8.js";
|
|
8
|
-
import { t as _ } from "./use-material-translation-
|
|
9
|
-
import { i as v, n as y, o as b, t as x } from "./code-language-items-
|
|
8
|
+
import { t as _ } from "./use-material-translation-B3V_bz-5.js";
|
|
9
|
+
import { i as v, n as y, o as b, t as x } from "./code-language-items-BT5BO5w6.js";
|
|
10
10
|
import { t as S } from "./useIsomorphicLayoutEffect-DfgAhWcH.js";
|
|
11
|
-
import { n as C, t as w } from "./escape-owner-
|
|
12
|
-
import { t as T } from "./skeleton-
|
|
11
|
+
import { n as C, t as w } from "./escape-owner-C4W_sOAU.js";
|
|
12
|
+
import { t as T } from "./skeleton-DSdtr2qc.js";
|
|
13
13
|
import { t as E } from "./react-node-text-Crkpfpco.js";
|
|
14
14
|
import { Check as D, ChevronDown as O, CircleAlert as ee, Copy as k, FileCode2 as te, Lock as ne, Maximize2 as re, Minimize2 as A, Search as ie, TriangleAlert as ae, WandSparkles as oe, WrapText as se } from "lucide-react";
|
|
15
15
|
import j, { memo as ce, useCallback as le, useEffect as M, useId as ue, useImperativeHandle as de, useMemo as fe, useRef as N, useState as P } from "react";
|
package/dist/code-editor.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { t as e } from "./utils-
|
|
1
|
+
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
2
|
import { a as t } from "./dist-lmHmz_bu.js";
|
|
3
|
-
import { d as n, r, t as i, u as a } from "./toolbar-items-
|
|
4
|
-
import { t as o } from "./use-material-translation-
|
|
5
|
-
import { i as s, n as c, o as l } from "./code-language-items-
|
|
6
|
-
import { r as u, t as d } from "./field-blur-
|
|
7
|
-
import { t as f } from "./skeleton-
|
|
3
|
+
import { d as n, r, t as i, u as a } from "./toolbar-items-rUHdVqAq.js";
|
|
4
|
+
import { t as o } from "./use-material-translation-B3V_bz-5.js";
|
|
5
|
+
import { i as s, n as c, o as l } from "./code-language-items-BT5BO5w6.js";
|
|
6
|
+
import { r as u, t as d } from "./field-blur-CJHzVSh9.js";
|
|
7
|
+
import { t as f } from "./skeleton-DSdtr2qc.js";
|
|
8
8
|
import { t as p } from "./live-status-BGPaN8r8.js";
|
|
9
9
|
import { t as m } from "./use-mobile-BDro060N.js";
|
|
10
10
|
import { t as h } from "./react-node-text-Crkpfpco.js";
|
|
11
|
-
import { a as g, c as _, d as v, f as y, i as b, l as x, m as S, o as C, p as w, r as T, s as E, t as D, u as O } from "./code-editor-
|
|
11
|
+
import { a as g, c as _, d as v, f as y, i as b, l as x, m as S, o as C, p as w, r as T, s as E, t as D, u as O } from "./code-editor-BZbaYLvo.js";
|
|
12
12
|
import { ChevronDown as k, ChevronUp as A, Columns2 as j } from "lucide-react";
|
|
13
13
|
import { useEffect as M, useRef as N, useState as P } from "react";
|
|
14
14
|
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as e, f as t } from "./dropdown-menu-
|
|
2
|
-
import { t as n } from "./use-material-translation-
|
|
1
|
+
import { d as e, f as t } from "./dropdown-menu-BsH9W_3C.js";
|
|
2
|
+
import { t as n } from "./use-material-translation-B3V_bz-5.js";
|
|
3
3
|
import { t as r } from "./live-status-BGPaN8r8.js";
|
|
4
4
|
import { useEffect as i, useRef as a, useState as o } from "react";
|
|
5
5
|
import { jsx as s } from "react/jsx-runtime";
|
package/dist/components/base.css
CHANGED
|
@@ -31,28 +31,43 @@
|
|
|
31
31
|
@apply dark:fill-foreground;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/* h1 to h6 read the type scale (type-scale.css); the fallbacks keep the
|
|
35
|
+
old sizes where the scale is not loaded (this file is shared with
|
|
36
|
+
@nxgt/material-vue, which has no scale yet). */
|
|
34
37
|
h1 {
|
|
35
|
-
font-size: var(--text-2xl);
|
|
38
|
+
font-size: var(--text-headline-md, var(--text-2xl));
|
|
39
|
+
line-height: var(--text-headline-md--line-height, inherit);
|
|
40
|
+
letter-spacing: var(--text-headline-md--letter-spacing, inherit);
|
|
36
41
|
font-weight: var(--font-weight-medium);
|
|
37
42
|
}
|
|
38
43
|
h2 {
|
|
39
|
-
font-size: var(--text-xl);
|
|
44
|
+
font-size: var(--text-headline-sm, var(--text-xl));
|
|
45
|
+
line-height: var(--text-headline-sm--line-height, inherit);
|
|
46
|
+
letter-spacing: var(--text-headline-sm--letter-spacing, inherit);
|
|
40
47
|
font-weight: var(--font-weight-medium);
|
|
41
48
|
}
|
|
42
49
|
h3 {
|
|
43
|
-
font-size: var(--text-lg);
|
|
50
|
+
font-size: var(--text-title-lg, var(--text-lg));
|
|
51
|
+
line-height: var(--text-title-lg--line-height, inherit);
|
|
52
|
+
letter-spacing: var(--text-title-lg--letter-spacing, inherit);
|
|
44
53
|
font-weight: var(--font-weight-medium);
|
|
45
54
|
}
|
|
46
55
|
h4 {
|
|
47
|
-
font-size: var(--text-base);
|
|
56
|
+
font-size: var(--text-title-md, var(--text-base));
|
|
57
|
+
line-height: var(--text-title-md--line-height, inherit);
|
|
58
|
+
letter-spacing: var(--text-title-md--letter-spacing, inherit);
|
|
48
59
|
font-weight: var(--font-weight-medium);
|
|
49
60
|
}
|
|
50
61
|
h5 {
|
|
51
|
-
font-size: var(--text-sm);
|
|
62
|
+
font-size: var(--text-title-sm, var(--text-sm));
|
|
63
|
+
line-height: var(--text-title-sm--line-height, inherit);
|
|
64
|
+
letter-spacing: var(--text-title-sm--letter-spacing, inherit);
|
|
52
65
|
font-weight: var(--font-weight-medium);
|
|
53
66
|
}
|
|
54
67
|
h6 {
|
|
55
|
-
font-size: var(--text-xs);
|
|
68
|
+
font-size: var(--text-label-md, var(--text-xs));
|
|
69
|
+
line-height: var(--text-label-md--line-height, inherit);
|
|
70
|
+
letter-spacing: var(--text-label-md--letter-spacing, inherit);
|
|
56
71
|
font-weight: var(--font-weight-medium);
|
|
57
72
|
}
|
|
58
73
|
/* A sidebar entry is a link styled as a menu entry: the prose link style
|
|
@@ -51,9 +51,11 @@
|
|
|
51
51
|
@import "./ui/widgets/editor/extensions/code/code-block.css";
|
|
52
52
|
@import "./ui/widgets/editor/extensions/code/code-block-head.css";
|
|
53
53
|
@import "./ui/actions/button-group/button-group.css";
|
|
54
|
+
@import "./ui/actions/button-group/button-group-standard.css";
|
|
54
55
|
/* ActivityLayout: the route transition (cross-fade, none under reduced motion). */
|
|
55
56
|
@import "./ui/layout/app-shell/route-transition.css";
|
|
56
57
|
@import "./ui/layout/app-shell/activity-backdrop.css";
|
|
58
|
+
@import "./ui/layout/app-shell/activity-backdrop-shapes.css";
|
|
57
59
|
/* DataTable cards and tiles: the item shell (hairline, tint, start bar, columns by the list's width). */
|
|
58
60
|
@import "./ui/collections/data-table/data-table-items.css";
|
|
59
61
|
@import "./ui/collections/data-table/data-table-items-compact.css";
|
|
@@ -79,8 +81,10 @@
|
|
|
79
81
|
@import "./ui/actions/split-button/split-button-sizes.css";
|
|
80
82
|
@import "./ui/actions/split-button/split-button-colors.css";
|
|
81
83
|
@import "./ui/actions/split-button/split-button-states.css";
|
|
82
|
-
|
|
83
|
-
@import "./ui/actions/
|
|
84
|
+
/* Button (sizes, shape morph, selected), the selected fill it shares with IconButton, and IconButton's own rules. */
|
|
85
|
+
@import "./ui/actions/morph-fill.css";
|
|
86
|
+
@import "./ui/actions/button/button.css";
|
|
87
|
+
@import "./ui/actions/icon-button/icon-button.css";
|
|
84
88
|
@import "./ui/actions/fab/fab.css";
|
|
85
89
|
@import "./ui/actions/fab/fab-tones.css";
|
|
86
90
|
@import "./ui/actions/fab/fab-menu.css";
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/* The type scale of @nxgt/material (Material 3 Expressive), imported by
|
|
2
|
+
* lib/styles.css: display, headline, title, body and label, each large, medium
|
|
3
|
+
* and small, as Tailwind tokens. Each role-size has a size, a line height, a
|
|
4
|
+
* tracking and a weight, so `text-title-md` sets all four; `text-title-md-em`
|
|
5
|
+
* keeps the size, line height and tracking and takes the emphasized (heavier)
|
|
6
|
+
* weight. The weights are numbers, so a variable font (Inter) reads them on
|
|
7
|
+
* its wght axis; `font-optical-sizing: auto` (the browser default) picks the
|
|
8
|
+
* opsz axis from the size. No font-variation-settings, no new font.
|
|
9
|
+
*
|
|
10
|
+
* Retune a token with a CSS variable on :root or on a zone, after importing
|
|
11
|
+
* the stylesheet; the utilities read the variable where they are used:
|
|
12
|
+
* :root { --text-title-md: 1.125rem; --text-title-md--line-height: 1.5rem; }
|
|
13
|
+
* The emphasized variants read the base size, line height and tracking, so an
|
|
14
|
+
* override of the base reaches them; their weight is
|
|
15
|
+
* `--text-<role>-<size>--font-weight-em`.
|
|
16
|
+
*
|
|
17
|
+
* Typography (variant="title-md", emphasized) is the component for it. Static:
|
|
18
|
+
* every token is on :root even when no utility uses it. Not shared with
|
|
19
|
+
* @nxgt/material-vue. scripts/type-scale.spec.ts keeps the values. */
|
|
20
|
+
@theme static {
|
|
21
|
+
--text-display-lg: 3.5625rem;
|
|
22
|
+
--text-display-lg--line-height: 4rem;
|
|
23
|
+
--text-display-lg--letter-spacing: -0.0044em;
|
|
24
|
+
--text-display-lg--font-weight: 400;
|
|
25
|
+
--text-display-lg--font-weight-em: 540;
|
|
26
|
+
|
|
27
|
+
--text-display-md: 2.8125rem;
|
|
28
|
+
--text-display-md--line-height: 3.25rem;
|
|
29
|
+
--text-display-md--letter-spacing: 0em;
|
|
30
|
+
--text-display-md--font-weight: 400;
|
|
31
|
+
--text-display-md--font-weight-em: 540;
|
|
32
|
+
|
|
33
|
+
--text-display-sm: 2.25rem;
|
|
34
|
+
--text-display-sm--line-height: 2.75rem;
|
|
35
|
+
--text-display-sm--letter-spacing: 0em;
|
|
36
|
+
--text-display-sm--font-weight: 400;
|
|
37
|
+
--text-display-sm--font-weight-em: 540;
|
|
38
|
+
|
|
39
|
+
--text-headline-lg: 2rem;
|
|
40
|
+
--text-headline-lg--line-height: 2.5rem;
|
|
41
|
+
--text-headline-lg--letter-spacing: 0em;
|
|
42
|
+
--text-headline-lg--font-weight: 400;
|
|
43
|
+
--text-headline-lg--font-weight-em: 560;
|
|
44
|
+
|
|
45
|
+
--text-headline-md: 1.75rem;
|
|
46
|
+
--text-headline-md--line-height: 2.25rem;
|
|
47
|
+
--text-headline-md--letter-spacing: 0em;
|
|
48
|
+
--text-headline-md--font-weight: 400;
|
|
49
|
+
--text-headline-md--font-weight-em: 560;
|
|
50
|
+
|
|
51
|
+
--text-headline-sm: 1.5rem;
|
|
52
|
+
--text-headline-sm--line-height: 2rem;
|
|
53
|
+
--text-headline-sm--letter-spacing: 0em;
|
|
54
|
+
--text-headline-sm--font-weight: 400;
|
|
55
|
+
--text-headline-sm--font-weight-em: 560;
|
|
56
|
+
|
|
57
|
+
--text-title-lg: 1.375rem;
|
|
58
|
+
--text-title-lg--line-height: 1.75rem;
|
|
59
|
+
--text-title-lg--letter-spacing: 0em;
|
|
60
|
+
--text-title-lg--font-weight: 400;
|
|
61
|
+
--text-title-lg--font-weight-em: 580;
|
|
62
|
+
|
|
63
|
+
--text-title-md: 1rem;
|
|
64
|
+
--text-title-md--line-height: 1.5rem;
|
|
65
|
+
--text-title-md--letter-spacing: 0.0094em;
|
|
66
|
+
--text-title-md--font-weight: 500;
|
|
67
|
+
--text-title-md--font-weight-em: 680;
|
|
68
|
+
|
|
69
|
+
--text-title-sm: 0.875rem;
|
|
70
|
+
--text-title-sm--line-height: 1.25rem;
|
|
71
|
+
--text-title-sm--letter-spacing: 0.0071em;
|
|
72
|
+
--text-title-sm--font-weight: 500;
|
|
73
|
+
--text-title-sm--font-weight-em: 680;
|
|
74
|
+
|
|
75
|
+
--text-body-lg: 1rem;
|
|
76
|
+
--text-body-lg--line-height: 1.5rem;
|
|
77
|
+
--text-body-lg--letter-spacing: 0.031em;
|
|
78
|
+
--text-body-lg--font-weight: 400;
|
|
79
|
+
--text-body-lg--font-weight-em: 520;
|
|
80
|
+
|
|
81
|
+
--text-body-md: 0.875rem;
|
|
82
|
+
--text-body-md--line-height: 1.25rem;
|
|
83
|
+
--text-body-md--letter-spacing: 0.0179em;
|
|
84
|
+
--text-body-md--font-weight: 400;
|
|
85
|
+
--text-body-md--font-weight-em: 520;
|
|
86
|
+
|
|
87
|
+
--text-body-sm: 0.75rem;
|
|
88
|
+
--text-body-sm--line-height: 1rem;
|
|
89
|
+
--text-body-sm--letter-spacing: 0.0333em;
|
|
90
|
+
--text-body-sm--font-weight: 400;
|
|
91
|
+
--text-body-sm--font-weight-em: 520;
|
|
92
|
+
|
|
93
|
+
--text-label-lg: 0.875rem;
|
|
94
|
+
--text-label-lg--line-height: 1.25rem;
|
|
95
|
+
--text-label-lg--letter-spacing: 0.0071em;
|
|
96
|
+
--text-label-lg--font-weight: 500;
|
|
97
|
+
--text-label-lg--font-weight-em: 700;
|
|
98
|
+
|
|
99
|
+
--text-label-md: 0.75rem;
|
|
100
|
+
--text-label-md--line-height: 1rem;
|
|
101
|
+
--text-label-md--letter-spacing: 0.0417em;
|
|
102
|
+
--text-label-md--font-weight: 500;
|
|
103
|
+
--text-label-md--font-weight-em: 700;
|
|
104
|
+
|
|
105
|
+
--text-label-sm: 0.6875rem;
|
|
106
|
+
--text-label-sm--line-height: 1rem;
|
|
107
|
+
--text-label-sm--letter-spacing: 0.0455em;
|
|
108
|
+
--text-label-sm--font-weight: 500;
|
|
109
|
+
--text-label-sm--font-weight-em: 700;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Emphasized: the base size, line height and tracking, read where used, and the heavier weight. */
|
|
113
|
+
@theme inline {
|
|
114
|
+
--text-display-lg-em: var(--text-display-lg);
|
|
115
|
+
--text-display-lg-em--line-height: var(--text-display-lg--line-height);
|
|
116
|
+
--text-display-lg-em--letter-spacing: var(--text-display-lg--letter-spacing);
|
|
117
|
+
--text-display-lg-em--font-weight: var(--text-display-lg--font-weight-em);
|
|
118
|
+
|
|
119
|
+
--text-display-md-em: var(--text-display-md);
|
|
120
|
+
--text-display-md-em--line-height: var(--text-display-md--line-height);
|
|
121
|
+
--text-display-md-em--letter-spacing: var(--text-display-md--letter-spacing);
|
|
122
|
+
--text-display-md-em--font-weight: var(--text-display-md--font-weight-em);
|
|
123
|
+
|
|
124
|
+
--text-display-sm-em: var(--text-display-sm);
|
|
125
|
+
--text-display-sm-em--line-height: var(--text-display-sm--line-height);
|
|
126
|
+
--text-display-sm-em--letter-spacing: var(--text-display-sm--letter-spacing);
|
|
127
|
+
--text-display-sm-em--font-weight: var(--text-display-sm--font-weight-em);
|
|
128
|
+
|
|
129
|
+
--text-headline-lg-em: var(--text-headline-lg);
|
|
130
|
+
--text-headline-lg-em--line-height: var(--text-headline-lg--line-height);
|
|
131
|
+
--text-headline-lg-em--letter-spacing: var(
|
|
132
|
+
--text-headline-lg--letter-spacing
|
|
133
|
+
);
|
|
134
|
+
--text-headline-lg-em--font-weight: var(--text-headline-lg--font-weight-em);
|
|
135
|
+
|
|
136
|
+
--text-headline-md-em: var(--text-headline-md);
|
|
137
|
+
--text-headline-md-em--line-height: var(--text-headline-md--line-height);
|
|
138
|
+
--text-headline-md-em--letter-spacing: var(
|
|
139
|
+
--text-headline-md--letter-spacing
|
|
140
|
+
);
|
|
141
|
+
--text-headline-md-em--font-weight: var(--text-headline-md--font-weight-em);
|
|
142
|
+
|
|
143
|
+
--text-headline-sm-em: var(--text-headline-sm);
|
|
144
|
+
--text-headline-sm-em--line-height: var(--text-headline-sm--line-height);
|
|
145
|
+
--text-headline-sm-em--letter-spacing: var(
|
|
146
|
+
--text-headline-sm--letter-spacing
|
|
147
|
+
);
|
|
148
|
+
--text-headline-sm-em--font-weight: var(--text-headline-sm--font-weight-em);
|
|
149
|
+
|
|
150
|
+
--text-title-lg-em: var(--text-title-lg);
|
|
151
|
+
--text-title-lg-em--line-height: var(--text-title-lg--line-height);
|
|
152
|
+
--text-title-lg-em--letter-spacing: var(--text-title-lg--letter-spacing);
|
|
153
|
+
--text-title-lg-em--font-weight: var(--text-title-lg--font-weight-em);
|
|
154
|
+
|
|
155
|
+
--text-title-md-em: var(--text-title-md);
|
|
156
|
+
--text-title-md-em--line-height: var(--text-title-md--line-height);
|
|
157
|
+
--text-title-md-em--letter-spacing: var(--text-title-md--letter-spacing);
|
|
158
|
+
--text-title-md-em--font-weight: var(--text-title-md--font-weight-em);
|
|
159
|
+
|
|
160
|
+
--text-title-sm-em: var(--text-title-sm);
|
|
161
|
+
--text-title-sm-em--line-height: var(--text-title-sm--line-height);
|
|
162
|
+
--text-title-sm-em--letter-spacing: var(--text-title-sm--letter-spacing);
|
|
163
|
+
--text-title-sm-em--font-weight: var(--text-title-sm--font-weight-em);
|
|
164
|
+
|
|
165
|
+
--text-body-lg-em: var(--text-body-lg);
|
|
166
|
+
--text-body-lg-em--line-height: var(--text-body-lg--line-height);
|
|
167
|
+
--text-body-lg-em--letter-spacing: var(--text-body-lg--letter-spacing);
|
|
168
|
+
--text-body-lg-em--font-weight: var(--text-body-lg--font-weight-em);
|
|
169
|
+
|
|
170
|
+
--text-body-md-em: var(--text-body-md);
|
|
171
|
+
--text-body-md-em--line-height: var(--text-body-md--line-height);
|
|
172
|
+
--text-body-md-em--letter-spacing: var(--text-body-md--letter-spacing);
|
|
173
|
+
--text-body-md-em--font-weight: var(--text-body-md--font-weight-em);
|
|
174
|
+
|
|
175
|
+
--text-body-sm-em: var(--text-body-sm);
|
|
176
|
+
--text-body-sm-em--line-height: var(--text-body-sm--line-height);
|
|
177
|
+
--text-body-sm-em--letter-spacing: var(--text-body-sm--letter-spacing);
|
|
178
|
+
--text-body-sm-em--font-weight: var(--text-body-sm--font-weight-em);
|
|
179
|
+
|
|
180
|
+
--text-label-lg-em: var(--text-label-lg);
|
|
181
|
+
--text-label-lg-em--line-height: var(--text-label-lg--line-height);
|
|
182
|
+
--text-label-lg-em--letter-spacing: var(--text-label-lg--letter-spacing);
|
|
183
|
+
--text-label-lg-em--font-weight: var(--text-label-lg--font-weight-em);
|
|
184
|
+
|
|
185
|
+
--text-label-md-em: var(--text-label-md);
|
|
186
|
+
--text-label-md-em--line-height: var(--text-label-md--line-height);
|
|
187
|
+
--text-label-md-em--letter-spacing: var(--text-label-md--letter-spacing);
|
|
188
|
+
--text-label-md-em--font-weight: var(--text-label-md--font-weight-em);
|
|
189
|
+
|
|
190
|
+
--text-label-sm-em: var(--text-label-sm);
|
|
191
|
+
--text-label-sm-em--line-height: var(--text-label-sm--line-height);
|
|
192
|
+
--text-label-sm-em--letter-spacing: var(--text-label-sm--letter-spacing);
|
|
193
|
+
--text-label-sm-em--font-weight: var(--text-label-sm--font-weight-em);
|
|
194
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/* Button (Material 3 Expressive): the radius is a variable of the height
|
|
2
|
+
* (`--btn-h`, set by the size, 36px without one), a round button is a pill
|
|
3
|
+
* (`--btn-h / 2`, never 999px, so it can morph) and a square one has the
|
|
4
|
+
* size's `--btn-sq`. Pressed, a button squeezes toward the other shape and
|
|
5
|
+
* scales to .97 (.985 at 2xl); selected (`data-selected`) it takes the other
|
|
6
|
+
* shape, and the fill of morph-fill.css. The radius springs on `spatial-fast`
|
|
7
|
+
* (every corner stays >= 4px at the overshoot, scripts/button-radius.spec.ts);
|
|
8
|
+
* colour and outline change on `effects-fast`.
|
|
9
|
+
*
|
|
10
|
+
* Rules on `:where(.nxgt-btn)` have no specificity, so an app's utility
|
|
11
|
+
* (`rounded-md`, `text-lg`) still wins. Toolbar items keep the Toolbar's own
|
|
12
|
+
* look. `.is-press` freezes the pressed state for the stories (as the Toolbar's
|
|
13
|
+
* does). The class is on `buttonVariants` too: Pagination, AlertDialog and the
|
|
14
|
+
* calendar's date picker get the same look. */
|
|
15
|
+
@layer utilities {
|
|
16
|
+
:where(.nxgt-btn) {
|
|
17
|
+
--btn-round: calc(var(--btn-h, 36px) / 2);
|
|
18
|
+
--btn-square: var(--btn-sq, 10px);
|
|
19
|
+
position: relative;
|
|
20
|
+
border-radius: var(--btn-rad, var(--btn-round));
|
|
21
|
+
font-size: var(--btn-fs, 0.875rem);
|
|
22
|
+
line-height: var(--btn-lh, 1.25rem);
|
|
23
|
+
letter-spacing: var(--btn-ls, normal);
|
|
24
|
+
font-weight: var(--btn-fw, 500);
|
|
25
|
+
transition:
|
|
26
|
+
border-radius var(--nxgt-motion-spatial-fast-duration)
|
|
27
|
+
var(--nxgt-motion-spatial-fast),
|
|
28
|
+
padding-inline var(--nxgt-motion-spatial-fast-duration)
|
|
29
|
+
var(--nxgt-motion-spatial-fast),
|
|
30
|
+
width var(--nxgt-motion-spatial-fast-duration)
|
|
31
|
+
var(--nxgt-motion-spatial-fast),
|
|
32
|
+
transform var(--nxgt-motion-spatial-fast-duration)
|
|
33
|
+
var(--nxgt-motion-spatial-fast),
|
|
34
|
+
background-color var(--nxgt-motion-effects-fast-duration)
|
|
35
|
+
var(--nxgt-motion-effects-fast),
|
|
36
|
+
color var(--nxgt-motion-effects-fast-duration)
|
|
37
|
+
var(--nxgt-motion-effects-fast),
|
|
38
|
+
box-shadow var(--nxgt-motion-effects-fast-duration)
|
|
39
|
+
var(--nxgt-motion-effects-fast),
|
|
40
|
+
outline-color var(--nxgt-motion-effects-fast-duration)
|
|
41
|
+
var(--nxgt-motion-effects-fast);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* The label is what is cut with an ellipsis, not the button (so the
|
|
45
|
+
* focus outline and the hit area are never clipped). */
|
|
46
|
+
:where(.nxgt-btn > [data-slot="button-label"]) {
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
text-overflow: ellipsis;
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
min-width: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:where(.nxgt-btn:not(.nxgt-toolbar-item, [data-toolbar-item])):focus-visible {
|
|
54
|
+
outline: 2px solid var(--btn-focus, var(--color-ring));
|
|
55
|
+
outline-offset: 2px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Shape: round (default) rests as a pill, pressed it squares; square rests
|
|
59
|
+
* square, pressed it rounds. Selected is the other shape. */
|
|
60
|
+
:where(.nxgt-btn:not(.nxgt-toolbar-item, [data-toolbar-item])) {
|
|
61
|
+
--btn-rest: var(--btn-round);
|
|
62
|
+
--btn-press: var(--btn-square);
|
|
63
|
+
--btn-flip: var(--btn-square);
|
|
64
|
+
border-radius: var(--btn-rad, var(--btn-rest));
|
|
65
|
+
|
|
66
|
+
&[data-shape="square"] {
|
|
67
|
+
--btn-rest: var(--btn-square);
|
|
68
|
+
--btn-press: var(--btn-round);
|
|
69
|
+
--btn-flip: var(--btn-round);
|
|
70
|
+
}
|
|
71
|
+
&[data-selected] {
|
|
72
|
+
--btn-rad: var(--btn-flip);
|
|
73
|
+
}
|
|
74
|
+
&:is(:active, .is-press):not(:disabled, [aria-busy="true"]) {
|
|
75
|
+
--btn-rad: var(--btn-press);
|
|
76
|
+
transform: scale(var(--btn-scale, 0.97));
|
|
77
|
+
}
|
|
78
|
+
/* A pressed selected button goes back to where a click leads. */
|
|
79
|
+
&[data-selected]:is(:active, .is-press):not(:disabled, [aria-busy="true"]) {
|
|
80
|
+
--btn-rad: var(--btn-rest);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Disabled: 40 % text whatever the variant and colour, and a neutral 12 %
|
|
85
|
+
* fill except on ghost and link (`nxgt-btn-bare`), which stay transparent.
|
|
86
|
+
* Doubled class: it beats the variant's colour utilities. */
|
|
87
|
+
.nxgt-btn.nxgt-btn:disabled:not(.nxgt-toolbar-item, [data-toolbar-item]) {
|
|
88
|
+
color: color-mix(in oklab, var(--color-foreground) 40%, transparent);
|
|
89
|
+
box-shadow: none;
|
|
90
|
+
text-decoration: none;
|
|
91
|
+
}
|
|
92
|
+
.nxgt-btn.nxgt-btn:disabled:not(
|
|
93
|
+
.nxgt-toolbar-item,
|
|
94
|
+
[data-toolbar-item],
|
|
95
|
+
.nxgt-btn-bare
|
|
96
|
+
) {
|
|
97
|
+
background-color: color-mix(
|
|
98
|
+
in oklab,
|
|
99
|
+
var(--color-foreground) 12%,
|
|
100
|
+
transparent
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
.nxgt-btn.nxgt-btn:disabled:not(.nxgt-toolbar-item, [data-toolbar-item]) svg {
|
|
104
|
+
color: color-mix(in oklab, var(--color-foreground) 40%, transparent);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* 44px of hit area on a coarse pointer, whatever the size. */
|
|
108
|
+
@media (pointer: coarse) {
|
|
109
|
+
:where(.nxgt-btn:not(.nxgt-toolbar-item, [data-toolbar-item]))::after {
|
|
110
|
+
content: "";
|
|
111
|
+
position: absolute;
|
|
112
|
+
inset-block: min(0px, calc((100% - 44px) / 2));
|
|
113
|
+
inset-inline: min(0px, calc((100% - 44px) / 2));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Safari has no `overflow-clip-margin`: an `asChild` host's `overflow: clip`
|
|
118
|
+
* would cut the 44px hit area above, so on a coarse pointer it does not
|
|
119
|
+
* clip (and its text has no ellipsis: put a label that needs one in a span). */
|
|
120
|
+
@supports not (overflow-clip-margin: 0px) {
|
|
121
|
+
@media (pointer: coarse) {
|
|
122
|
+
.nxgt-btn.nxgt-btn-as-child {
|
|
123
|
+
overflow: visible;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Reduced motion: colour and fill only, no squeeze. */
|
|
129
|
+
@media (prefers-reduced-motion: reduce) {
|
|
130
|
+
:where(.nxgt-btn:not(.nxgt-toolbar-item, [data-toolbar-item])) {
|
|
131
|
+
&:is(:active, .is-press):not(:disabled, [aria-busy="true"]) {
|
|
132
|
+
--btn-rad: var(--btn-rest);
|
|
133
|
+
transform: none;
|
|
134
|
+
}
|
|
135
|
+
&[data-selected]:is(:active, .is-press):not(
|
|
136
|
+
:disabled,
|
|
137
|
+
[aria-busy="true"]
|
|
138
|
+
) {
|
|
139
|
+
--btn-rad: var(--btn-flip);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Forced colours: the outlined line is an inset shadow, which they remove. */
|
|
145
|
+
@media (forced-colors: active) {
|
|
146
|
+
.nxgt-btn[data-variant="outlined"]:not(
|
|
147
|
+
.nxgt-toolbar-item,
|
|
148
|
+
[data-toolbar-item],
|
|
149
|
+
:disabled,
|
|
150
|
+
:focus-visible
|
|
151
|
+
) {
|
|
152
|
+
outline: 1.5px solid ButtonText;
|
|
153
|
+
outline-offset: -1.5px;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/* ButtonGroup `look="standard"` (Material 3 Expressive): a row of buttons 8px
|
|
2
|
+
* apart that keep their own look. A pressed one widens by `--bg-d` on each
|
|
3
|
+
* side and its neighbours give the same width back (half each with two, the
|
|
4
|
+
* whole with one), so the group's width never changes: the toggle group's
|
|
5
|
+
* connected squish (toggle-group-squish.css) with the group's own numbers.
|
|
6
|
+
* The widening is `--btn-dx`, which Button reads in its padding (button.variants)
|
|
7
|
+
* and which IconButton gets as width here; both spring on `spatial-fast`.
|
|
8
|
+
*
|
|
9
|
+
* `--bg-d` is the group's, from its `size`, and is the most a button of that
|
|
10
|
+
* size can give back at the end of the group with its padding staying above 0
|
|
11
|
+
* through the spring's ~10 % overshoot (xs 7, sm 10, default 11, 14 from lg),
|
|
12
|
+
* 10 without a `size`. A child with a `size` of its own keeps it,
|
|
13
|
+
* and then trades the group's amount, not its own. `.is-press` freezes a
|
|
14
|
+
* pressed child for the stories, as button.css does.
|
|
15
|
+
*
|
|
16
|
+
* Coarse pointer: the gap is max(8px, 44px - the size's height), so every
|
|
17
|
+
* button's 44px hit area (button.css) fits without touching its neighbour's
|
|
18
|
+
* (each reaches half the gap past its edge), across and between wrapped rows.
|
|
19
|
+
* Reduced motion: no exchange. */
|
|
20
|
+
@layer utilities {
|
|
21
|
+
[data-slot="button-group"][data-look="standard"] {
|
|
22
|
+
--bg-gap: 8px;
|
|
23
|
+
--bg-d: 10px;
|
|
24
|
+
--bg-h: 36px;
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: var(--bg-gap);
|
|
29
|
+
max-width: 100%;
|
|
30
|
+
|
|
31
|
+
&[data-size="xs"] {
|
|
32
|
+
--bg-d: 7px;
|
|
33
|
+
--bg-h: 24px;
|
|
34
|
+
}
|
|
35
|
+
&[data-size="sm"] {
|
|
36
|
+
--bg-d: 10px;
|
|
37
|
+
--bg-h: 32px;
|
|
38
|
+
}
|
|
39
|
+
&[data-size="default"] {
|
|
40
|
+
--bg-d: 11px;
|
|
41
|
+
--bg-h: 36px;
|
|
42
|
+
}
|
|
43
|
+
&[data-size="lg"] {
|
|
44
|
+
--bg-d: 14px;
|
|
45
|
+
--bg-h: 40px;
|
|
46
|
+
}
|
|
47
|
+
&[data-size="xl"] {
|
|
48
|
+
--bg-d: 14px;
|
|
49
|
+
--bg-h: 56px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* The pressed child widens ... */
|
|
54
|
+
[data-slot="button-group"][data-look="standard"]
|
|
55
|
+
> :is(:active, .is-press):not(:disabled, [aria-busy="true"]) {
|
|
56
|
+
--btn-dx: var(--bg-d);
|
|
57
|
+
}
|
|
58
|
+
/* ... its neighbours give half each ... */
|
|
59
|
+
[data-slot="button-group"][data-look="standard"]
|
|
60
|
+
> :has(+ :is(:active, .is-press):not(:disabled, [aria-busy="true"])),
|
|
61
|
+
[data-slot="button-group"][data-look="standard"]
|
|
62
|
+
> :is(:active, .is-press):not(:disabled, [aria-busy="true"])
|
|
63
|
+
+ * {
|
|
64
|
+
--btn-dx: calc(var(--bg-d) / -2);
|
|
65
|
+
}
|
|
66
|
+
/* ... or the whole of it when it is the only one (the pressed child is
|
|
67
|
+
* at an end). */
|
|
68
|
+
[data-slot="button-group"][data-look="standard"]
|
|
69
|
+
> :first-child:is(:active, .is-press):not(:disabled, [aria-busy="true"])
|
|
70
|
+
+ *,
|
|
71
|
+
[data-slot="button-group"][data-look="standard"]
|
|
72
|
+
> :has(
|
|
73
|
+
+ :last-child:is(:active, .is-press):not(:disabled, [aria-busy="true"])
|
|
74
|
+
) {
|
|
75
|
+
--btn-dx: calc(var(--bg-d) * -1);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* An IconButton, and a Button of the icon sizes, have a width of their
|
|
79
|
+
* own (a factor of the height): the exchange is added to it. A pill toggle
|
|
80
|
+
* keeps its extra 14px. A shaped one does not trade. */
|
|
81
|
+
[data-slot="button-group"][data-look="standard"]
|
|
82
|
+
> [data-icon-button]:not(
|
|
83
|
+
[data-shape],
|
|
84
|
+
.nxgt-toolbar-item,
|
|
85
|
+
[data-toolbar-item]
|
|
86
|
+
),
|
|
87
|
+
[data-slot="button-group"][data-look="standard"]
|
|
88
|
+
> [data-slot="button"]:is([data-size="icon"], [data-size^="icon-"]) {
|
|
89
|
+
width: calc(
|
|
90
|
+
var(--btn-h, 2.25rem) *
|
|
91
|
+
var(--ib-k, 1) +
|
|
92
|
+
2 *
|
|
93
|
+
var(--btn-dx, 0px)
|
|
94
|
+
);
|
|
95
|
+
/* A neighbour never gives up so much that its icon sticks out: its
|
|
96
|
+
* floor is the icon and 4px each side, never above its width at rest
|
|
97
|
+
* (an icon-only one at the end of the group, which gives the whole
|
|
98
|
+
* exchange, may then give back less than asked, and the group widens by
|
|
99
|
+
* the difference). */
|
|
100
|
+
min-width: min(
|
|
101
|
+
calc(var(--btn-h, 2.25rem) * var(--ib-k, 1)),
|
|
102
|
+
calc(var(--btn-ic, 1rem) + 4px)
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
[data-slot="button-group"][data-look="standard"]
|
|
106
|
+
> [data-icon-button][data-morph="pill"][data-selected]:not(
|
|
107
|
+
[data-shape],
|
|
108
|
+
.nxgt-toolbar-item,
|
|
109
|
+
[data-toolbar-item]
|
|
110
|
+
) {
|
|
111
|
+
width: calc(
|
|
112
|
+
var(--btn-h, 2.25rem) *
|
|
113
|
+
var(--ib-k, 1) +
|
|
114
|
+
var(--ib-morph, 0px) +
|
|
115
|
+
2 *
|
|
116
|
+
var(--btn-dx, 0px)
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@media (pointer: coarse) {
|
|
121
|
+
[data-slot="button-group"][data-look="standard"] {
|
|
122
|
+
--bg-gap: max(8px, calc(44px - var(--bg-h)));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@media (prefers-reduced-motion: reduce) {
|
|
127
|
+
[data-slot="button-group"][data-look="standard"] {
|
|
128
|
+
--bg-d: 0px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/* ButtonGroup, the original look (no `look`): children forced to a tinted,
|
|
2
|
+
* rounded button. Scoped to `:not(:where([data-look]))` (the `:where` keeps the specificity at one class, so an app's override still wins), so `look="standard"`
|
|
3
|
+
* (button-group-standard.css) is not touched by it. */
|
|
4
|
+
.nxgt-button-group:not(:where([data-look])) {
|
|
2
5
|
@apply inline-flex bg-background p-2 gap-1 transition-all **:transition-all items-center w-full;
|
|
3
6
|
:is([data-slot="button"], [data-slot="icon-button"]) {
|
|
4
7
|
@apply rounded bg-primary/15 shadow-none hover:bg-primary/10 hover:shadow w-max max-w-max;
|