@nxgt/material 3.10.1 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +4 -4
  3. package/dist/{async-slice-DDjaJY_F.js → async-slice-4qbER86I.js} +1 -1
  4. package/dist/button-BNjw-pnE.js +327 -0
  5. package/dist/button-group-context-CaP0X5p_.js +5 -0
  6. package/dist/{button-tones-BgZJ1tkD.js → button-tones-BwuVvAmd.js} +9 -1
  7. package/dist/{callout-view-DdJPdFrP.js → callout-view-C6voDS00.js} +1 -1
  8. package/dist/charts.js +5 -5
  9. package/dist/{chip-DpySRqCy.js → chip-DLgQTJBZ.js} +4 -4
  10. package/dist/{code-editor-BiA14xua.js → code-editor-BZbaYLvo.js} +8 -8
  11. package/dist/code-editor.js +7 -7
  12. package/dist/{code-language-items-C_dJ6GVs.js → code-language-items-BT5BO5w6.js} +2 -2
  13. package/dist/components/base.css +21 -6
  14. package/dist/components/components.css +5 -2
  15. package/dist/components/type-scale.css +194 -0
  16. package/dist/components/ui/actions/button/button.css +156 -0
  17. package/dist/components/ui/actions/button-group/button-group-standard.css +131 -0
  18. package/dist/components/ui/actions/button-group/button-group.css +4 -1
  19. package/dist/components/ui/actions/icon-button/icon-button.css +115 -0
  20. package/dist/components/ui/actions/morph-fill.css +62 -0
  21. package/dist/{components-fqz7csN3.js → components-1GK7YIhY.js} +14685 -14688
  22. package/dist/components.js +23 -23
  23. package/dist/{dialog-CkIYpJXk.js → dialog-BQp5IdFl.js} +147 -147
  24. package/dist/dnd.js +1 -1
  25. package/dist/{dropdown-menu-BC5Tbhb9.js → dropdown-menu-BsH9W_3C.js} +3 -3
  26. package/dist/editor-viewer.js +1 -1
  27. package/dist/editor.js +13 -13
  28. package/dist/empty-state-WaU4-T2c.js +117 -0
  29. package/dist/escape-owner-C4W_sOAU.js +116 -0
  30. package/dist/{field-blur-DPLsMufs.js → field-blur-CJHzVSh9.js} +1 -1
  31. package/dist/{field-blur-context-1ZwJgsHE.js → field-blur-context-Cft9s7Hg.js} +2 -2
  32. package/dist/{hover-card-Cox-tPDz.js → hover-card-C0fw2kLK.js} +72 -71
  33. package/dist/i18n.js +12 -12
  34. package/dist/{icon-badge-q3Ve8gra.js → icon-badge-DUAq9f7H.js} +4 -4
  35. package/dist/icon-button-ifTpXt0A.js +355 -0
  36. package/dist/{illustration-Hj-Q9se9.js → illustration-BmQmvW_4.js} +36 -30
  37. package/dist/illustrations.js +2 -2
  38. package/dist/lib/components/ui/actions/button/button-tones.d.ts +16 -0
  39. package/dist/lib/components/ui/actions/button/button.d.ts +13 -0
  40. package/dist/lib/components/ui/actions/button/button.variants.d.ts +4 -3
  41. package/dist/lib/components/ui/actions/button-group/button-group-context.d.ts +16 -0
  42. package/dist/lib/components/ui/actions/button-group/button-group-reset.d.ts +13 -0
  43. package/dist/lib/components/ui/actions/button-group/button-group.d.ts +19 -2
  44. package/dist/lib/components/ui/actions/icon-button/icon-button-shape.d.ts +3 -2
  45. package/dist/lib/components/ui/actions/icon-button/icon-button.d.ts +18 -4
  46. package/dist/lib/components/ui/actions/icon-button/icon-button.variants.d.ts +34 -4
  47. package/dist/lib/components/ui/feedback/state-frame/state-scene-illustration.d.ts +4 -2
  48. package/dist/lib/components/ui/feedback/typing-indicator/typing-indicator.d.ts +1 -1
  49. package/dist/lib/components/ui/fields/slider/split-slider-props.d.ts +1 -1
  50. package/dist/lib/components/ui/fields/slider/use-slider-control.d.ts +1 -1
  51. package/dist/lib/components/ui/overlays/dialog/dialog-variants.d.ts +1 -1
  52. package/dist/lib/components/ui/primitives/toggle/toggle.d.ts +1 -1
  53. package/dist/lib/components/ui/primitives/typography/typography.d.ts +17 -7
  54. package/dist/lib/components/ui/primitives/typography/typography.variants.d.ts +55 -0
  55. package/dist/lib/components/ui/selection/choice-group/use-choice-group-field.d.ts +2 -2
  56. package/dist/lib/i18n/translator.d.ts +1 -1
  57. package/dist/lib/illustrations/lazy-chunk.d.ts +9 -0
  58. package/dist/lib.js +2 -2
  59. package/dist/{line-path-BQeLQZ-P.js → line-path-C5pZGC49.js} +1 -1
  60. package/dist/main.js +29 -29
  61. package/dist/map.js +9 -9
  62. package/dist/material.css +1 -1
  63. package/dist/pdf-reader.js +1 -1
  64. package/dist/{plated-illustration-B7fcgOED.js → plated-illustration-iNO6KYTL.js} +9 -2
  65. package/dist/print.js +1 -1
  66. package/dist/{public-Cl4dLDHQ.js → public-B0Nq_yYV.js} +524 -524
  67. package/dist/{render-json-DyFYFIkZ.js → render-json-BOhvPnSv.js} +1 -1
  68. package/dist/{rich-code-block-C2Fp_FDU.js → rich-code-block-v7WmeZp9.js} +5 -5
  69. package/dist/{rich-text-viewer-LO1IZCWs.js → rich-text-viewer-W15XIwah.js} +2 -2
  70. package/dist/{skeleton-Bmp4gWAH.js → skeleton-DSdtr2qc.js} +1 -1
  71. package/dist/{sortable-provider-pVaEZzty.js → sortable-provider-CgDTolQR.js} +3 -3
  72. package/dist/{spinner-CsHcmcpF.js → spinner-BtSIYVrC.js} +3 -3
  73. package/dist/{state-scenes-Be9w_3an.js → state-scenes-BX03WmSu.js} +54 -41
  74. package/dist/styles.css +2 -0
  75. package/dist/theme-picker.js +3 -3
  76. package/dist/{theme-toggle-oU-fh6WE.js → theme-toggle-B2Pehdhn.js} +2 -2
  77. package/dist/{toggle-group-j8zaxEg1.js → toggle-group-BMJNcFAC.js} +1 -1
  78. package/dist/{toolbar-items-CqHvlTU8.js → toolbar-items-rUHdVqAq.js} +399 -398
  79. package/dist/{tooltip-rhbqNmr3.js → tooltip-CkttDIab.js} +1 -1
  80. package/dist/{translate-material-CGZljjp1.js → translate-material-Bd_KgfB8.js} +1 -1
  81. package/dist/{translator-DCYO4Ij3.js → translator-Dje8HrNz.js} +5 -5
  82. package/dist/{use-chat-composer-UHlGFSm0.js → use-chat-composer-Bt2ULsv6.js} +4172 -4172
  83. package/dist/{use-material-translation-DkxcLbLM.js → use-material-translation-B3V_bz-5.js} +1 -1
  84. package/dist/{utils-Bcd2Z3ea.js → utils-BLfntITJ.js} +14 -1
  85. package/docs/components/buttons-and-actions.md +64 -15
  86. package/docs/components/navigation-and-layout.md +1 -1
  87. package/docs/components/primitives.md +52 -10
  88. package/docs/guides/illustrations.md +12 -0
  89. package/docs/guides/theming.md +51 -0
  90. package/docs/previews/buttons-actions-button.webp +0 -0
  91. package/docs/previews/buttons-actions-iconbutton.webp +0 -0
  92. package/docs/previews/feedback-status-circularprogress.webp +0 -0
  93. package/docs/previews/feedback-status-hydrateloading.webp +0 -0
  94. package/docs/previews/feedback-status-notifications.webp +0 -0
  95. package/docs/previews/feedback-status-progress.webp +0 -0
  96. package/docs/previews/feedback-status-skeleton.webp +0 -0
  97. package/docs/previews/feedback-status-spinner.webp +0 -0
  98. package/docs/previews/feedback-status-typingindicator.webp +0 -0
  99. package/docs/previews/primitives-typography.webp +0 -0
  100. package/docs/roadmap.md +35 -4
  101. package/docs/troubleshooting.md +71 -2
  102. package/lib/components/base.css +21 -6
  103. package/lib/components/components.css +5 -2
  104. package/lib/components/type-scale.css +194 -0
  105. package/lib/components/ui/actions/button/button.css +156 -0
  106. package/lib/components/ui/actions/button-group/button-group-standard.css +131 -0
  107. package/lib/components/ui/actions/button-group/button-group.css +4 -1
  108. package/lib/components/ui/actions/icon-button/icon-button.css +115 -0
  109. package/lib/components/ui/actions/morph-fill.css +62 -0
  110. package/lib/styles.css +2 -0
  111. package/package.json +1 -1
  112. package/dist/button-DbfdITBB.js +0 -322
  113. package/dist/components/ui/actions/icon-button/icon-button-morph-media.css +0 -65
  114. package/dist/components/ui/actions/icon-button/icon-button-morph.css +0 -152
  115. package/dist/empty-state-BOZWBC5q.js +0 -98
  116. package/dist/escape-owner-CripBce_.js +0 -57
  117. package/dist/icon-button-DJcWpIhu.js +0 -319
  118. package/lib/components/ui/actions/icon-button/icon-button-morph-media.css +0 -65
  119. package/lib/components/ui/actions/icon-button/icon-button-morph.css +0 -152
@@ -1,98 +0,0 @@
1
- import { t as e } from "./utils-Bcd2Z3ea.js";
2
- import { t } from "./use-material-translation-DkxcLbLM.js";
3
- import { i as n } from "./escape-owner-CripBce_.js";
4
- import { a as r, i, l as a, n as o, r as s, s as c } from "./state-scenes-Be9w_3an.js";
5
- import { AlertCircle as l, Construction as u, FileQuestion as d, PackageOpen as f, Search as p, ShieldAlert as m, WifiOff as h } from "lucide-react";
6
- import { Suspense as g, lazy as _ } from "react";
7
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
8
- import { STATE_ACCENT as b, STATE_ICON as x, stateCopy as S } from "@nxgt/material-core/states";
9
- //#region lib/components/ui/feedback/state-frame/state-icon.tsx
10
- var C = {
11
- "package-open": f,
12
- search: p,
13
- "file-question": d,
14
- "shield-alert": m,
15
- "alert-circle": l,
16
- "wifi-off": h,
17
- construction: u
18
- };
19
- function w({ kind: e }) {
20
- let t = C[x[e]];
21
- return /* @__PURE__ */ v(t, { "aria-hidden": "true" });
22
- }
23
- //#endregion
24
- //#region lib/components/ui/feedback/state-frame/state-scene-illustration.tsx
25
- var T = _(async () => ({ default: (await import("./illustration-Hj-Q9se9.js").then((e) => e.n)).Illustration }));
26
- function E({ scene: e, size: t }) {
27
- return /* @__PURE__ */ v(g, {
28
- fallback: /* @__PURE__ */ v("div", {
29
- "data-slot": "illustration",
30
- "data-size": t,
31
- "aria-hidden": "true"
32
- }),
33
- children: /* @__PURE__ */ v(T, {
34
- scene: e,
35
- size: t
36
- })
37
- });
38
- }
39
- //#endregion
40
- //#region lib/components/ui/feedback/state-frame/state-frame.tsx
41
- function D({ kind: t, size: l = "default", illustration: u, icon: d, title: f, headingLevel: p, description: m, actions: h, className: g, children: _, ...x }) {
42
- let S = l === "inline", C = l === "compact" || S, T = e("flex shrink-0 items-center justify-center rounded", r[b[t]], S ? "size-8 rounded-full [&_svg]:size-4" : C ? "size-10 [&_svg]:size-5" : "size-16 [&_svg]:size-7"), D = a(), O = u === !0 || s(u, D?.sets) ? s(u, D?.sets) ? u : o[t] : null, k = u == null && d == null && l === "default" ? c(D, o[t]) : void 0, A = S ? null : O ?? (k ? o[t] : null), j = null;
43
- return j = u === !1 ? null : A ? /* @__PURE__ */ v(E, {
44
- scene: A,
45
- size: C ? "sm" : "md"
46
- }) : u != null && u !== !0 && !s(u, D?.sets) ? u : d == null ? C ? /* @__PURE__ */ v("div", {
47
- className: T,
48
- children: /* @__PURE__ */ v(w, { kind: t })
49
- }) : /* @__PURE__ */ v(i, { kind: t }) : /* @__PURE__ */ v("div", {
50
- className: T,
51
- children: d
52
- }), /* @__PURE__ */ y("div", {
53
- "data-kind": t,
54
- "data-size": l,
55
- className: e("flex text-foreground", S ? "flex-row items-center gap-3 px-3 py-2.5 text-start" : "flex-col items-center justify-center text-center", !S && (C ? "gap-3 px-4 py-6" : "min-h-[22rem] gap-5 p-8"), g),
56
- ...x,
57
- children: [
58
- j,
59
- (f != null || m != null) && /* @__PURE__ */ y("div", {
60
- className: e("flex flex-col", S ? "min-w-0 flex-1 gap-0.5" : "max-w-sm gap-2"),
61
- children: [f != null && /* @__PURE__ */ v(n, {
62
- as: p ? `h${p}` : void 0,
63
- variant: S ? "normal" : C ? "title-medium" : "headline-small",
64
- className: e("tracking-tight text-balance", S && "font-medium"),
65
- children: f
66
- }), m != null && /* @__PURE__ */ v(n, {
67
- variant: S ? "body-small" : "body-medium",
68
- className: "text-pretty",
69
- children: m
70
- })]
71
- }),
72
- _,
73
- h != null && /* @__PURE__ */ v("div", {
74
- className: e("flex flex-wrap items-center gap-2", S ? "shrink-0" : "mt-1 justify-center"),
75
- children: h
76
- })
77
- ]
78
- });
79
- }
80
- //#endregion
81
- //#region lib/components/ui/feedback/empty-state/empty-state.tsx
82
- function O({ kind: e = "empty", size: n = "default", illustration: r, icon: i, title: a, description: o, action: s, ...c }) {
83
- let l = S(e, "empty-state"), { t: u } = t(), d = o ?? (a == null ? u(l.descriptionKey, l.description) : void 0);
84
- return /* @__PURE__ */ v(D, {
85
- "data-slot": "empty-state",
86
- "data-variant": e,
87
- kind: e,
88
- size: n,
89
- illustration: r,
90
- icon: i,
91
- title: a ?? u(l.titleKey, l.title),
92
- description: d,
93
- actions: s,
94
- ...c
95
- });
96
- }
97
- //#endregion
98
- export { D as n, O as t };
@@ -1,57 +0,0 @@
1
- import { t as e } from "./utils-Bcd2Z3ea.js";
2
- import { t } from "./dist-DVRQkaTK.js";
3
- import { o as n } from "./tooltip-rhbqNmr3.js";
4
- import { jsx as r } from "react/jsx-runtime";
5
- //#region lib/components/ui/primitives/typography/typography.tsx
6
- var i = n("", {
7
- variants: {
8
- variant: {
9
- normal: "text-sm",
10
- "huge-larger": "text-8xl font-semibold",
11
- "huge-large": "text-8xl font-semibold",
12
- "huge-medium": "text-7xl font-semibold",
13
- "huge-small": "text-6xl font-semibold",
14
- "headline-larger": "text-5xl font-semibold",
15
- "headline-large": "text-4xl font-semibold",
16
- "headline-medium": "text-3xl font-semibold",
17
- "headline-small": "text-2xl font-semibold",
18
- "title-large": "text-xl font-semibold",
19
- "title-medium": "text-lg font-semibold",
20
- "title-small": "text-base font-semibold",
21
- "body-medium": "text-sm",
22
- "body-small": "text-xs",
23
- caption: "text-[10px] text-muted-foreground"
24
- },
25
- tone: {
26
- default: "",
27
- muted: "text-muted-foreground",
28
- primary: "text-primary-text",
29
- error: "text-error-text"
30
- }
31
- },
32
- defaultVariants: {
33
- variant: "normal",
34
- tone: "default"
35
- }
36
- });
37
- function a({ className: n, variant: a, tone: o, as: s = "div", asChild: c = !1, ...l }) {
38
- return /* @__PURE__ */ r(c ? t : s, {
39
- "data-test": "typography",
40
- className: e(i({
41
- variant: a,
42
- tone: o,
43
- className: n
44
- })),
45
- ...l
46
- });
47
- }
48
- //#endregion
49
- //#region lib/components/ui/overlays/dialog/escape-owner.ts
50
- var o = /* @__PURE__ */ new WeakSet(), s = "data-escape-owner";
51
- function c(e, t) {
52
- let n = e.target?.closest?.(`[${s}]`);
53
- !n || n === t || !t?.contains(n) || (o.add(e), e.preventDefault());
54
- }
55
- var l = (e) => o.has(e);
56
- //#endregion
57
- export { i as a, a as i, l as n, c as r, s as t };
@@ -1,319 +0,0 @@
1
- import { t as e } from "./utils-Bcd2Z3ea.js";
2
- import { n as t } from "./use-shape-morph-BKA_R5P5.js";
3
- import { n, t as r } from "./dist-DVRQkaTK.js";
4
- import { o as i, t as a } from "./tooltip-rhbqNmr3.js";
5
- import { i as o, n as s, r as c, t as l } from "./button-tones-BgZJ1tkD.js";
6
- import { shapeOutline as u, toSvgPath as d } from "@nxgt/material-core/shapes";
7
- import { useRef as f } from "react";
8
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
9
- //#endregion
10
- //#region lib/components/ui/actions/icon-button/icon-button.variants.ts
11
- var h = i("inline-flex size-9 center gap-2 cursor-pointer whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:bg-transparent [&_svg]:text-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error has-[[data-slot=icon]]:p-1.5 aspect-square rounded-full", {
12
- variants: {
13
- variant: {
14
- filled: "shadow-xs bg-primary text-primary-foreground [&_svg]:data-[slot=icon]:text-primary-foreground [&_svg]:stroke-primary-foreground hover:bg-[color-mix(in_oklab,var(--color-primary)_90%,black)] active:bg-[color-mix(in_oklab,var(--color-primary)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-primary)_85%,black)]",
15
- tonal: "shadow-xs bg-primary/15 [&_svg]:data-[slot=icon]:text-primary-text [&_svg]:stroke-primary-text text-primary-text hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/10",
16
- ghost: "",
17
- outlined: "border shadow-xs text-primary-text [&_svg]:data-[slot=icon]:text-primary-text [&_svg]:stroke-primary-text border-primary/50 focus:bg-primary/10 hover:bg-primary/10",
18
- link: "text-primary-text [&_svg]:data-[slot=icon]:text-primary-text [&_svg]:stroke-primary-text underline-offset-4 hover:underline hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/10 focus:underline"
19
- },
20
- color: {
21
- primary: null,
22
- secondary: null,
23
- info: null,
24
- warning: null,
25
- default: null,
26
- error: null,
27
- success: null
28
- }
29
- },
30
- defaultVariants: {
31
- variant: "filled",
32
- color: "primary"
33
- },
34
- compoundVariants: [
35
- {
36
- variant: "filled",
37
- color: "primary",
38
- class: "bg-primary text-primary-foreground [&_svg]:data-[slot=icon]:text-primary-foreground [&_svg]:stroke-primary-foreground hover:bg-[color-mix(in_oklab,var(--color-primary)_90%,black)] active:bg-[color-mix(in_oklab,var(--color-primary)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-primary)_85%,black)]"
39
- },
40
- {
41
- variant: "filled",
42
- color: "secondary",
43
- class: "bg-secondary text-secondary-foreground [&_svg]:data-[slot=icon]:text-secondary-foreground [&_svg]:stroke-secondary-foreground hover:bg-[color-mix(in_oklab,var(--color-secondary)_90%,black)] active:bg-[color-mix(in_oklab,var(--color-secondary)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-secondary)_85%,black)] dark:bg-[color-mix(in_oklab,var(--color-secondary)_70%,var(--color-background))] dark:hover:bg-[color-mix(in_oklab,var(--color-secondary)_60%,var(--color-background))] dark:active:bg-[color-mix(in_oklab,var(--color-secondary)_50%,var(--color-background))] dark:focus:bg-[color-mix(in_oklab,var(--color-secondary)_60%,var(--color-background))]"
44
- },
45
- {
46
- variant: "filled",
47
- color: "success",
48
- class: "bg-success text-success-foreground [&_svg]:data-[slot=icon]:text-success-foreground [&_svg]:stroke-success-foreground hover:bg-[color-mix(in_oklab,var(--color-success)_90%,black)] active:bg-[color-mix(in_oklab,var(--color-success)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-success)_85%,black)] dark:bg-[color-mix(in_oklab,var(--color-success)_60%,var(--color-background))] dark:hover:bg-[color-mix(in_oklab,var(--color-success)_50%,var(--color-background))] dark:active:bg-[color-mix(in_oklab,var(--color-success)_40%,var(--color-background))] dark:focus:bg-[color-mix(in_oklab,var(--color-success)_50%,var(--color-background))]"
49
- },
50
- {
51
- variant: "filled",
52
- color: "info",
53
- class: "bg-info text-info-foreground [&_svg]:data-[slot=icon]:text-info-foreground [&_svg]:stroke-info-foreground hover:bg-[color-mix(in_oklab,var(--color-info)_90%,black)] active:bg-[color-mix(in_oklab,var(--color-info)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-info)_85%,black)] dark:bg-[color-mix(in_oklab,var(--color-info)_60%,var(--color-background))] dark:hover:bg-[color-mix(in_oklab,var(--color-info)_50%,var(--color-background))] dark:active:bg-[color-mix(in_oklab,var(--color-info)_40%,var(--color-background))] dark:focus:bg-[color-mix(in_oklab,var(--color-info)_50%,var(--color-background))]"
54
- },
55
- {
56
- variant: "filled",
57
- color: "warning",
58
- class: "bg-warning text-warning-foreground [&_svg]:data-[slot=icon]:text-warning-foreground [&_svg]:stroke-warning-foreground hover:bg-[color-mix(in_oklab,var(--color-warning)_90%,black)] active:bg-[color-mix(in_oklab,var(--color-warning)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-warning)_85%,black)] dark:bg-[color-mix(in_oklab,var(--color-warning)_60%,var(--color-background))] dark:hover:bg-[color-mix(in_oklab,var(--color-warning)_50%,var(--color-background))] dark:active:bg-[color-mix(in_oklab,var(--color-warning)_40%,var(--color-background))] dark:focus:bg-[color-mix(in_oklab,var(--color-warning)_50%,var(--color-background))]"
59
- },
60
- {
61
- variant: "filled",
62
- color: "error",
63
- class: "bg-error text-error-foreground [&_svg]:data-[slot=icon]:text-error-foreground [&_svg]:stroke-error-foreground hover:bg-[color-mix(in_oklab,var(--color-error)_90%,black)] active:bg-[color-mix(in_oklab,var(--color-error)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-error)_85%,black)]"
64
- },
65
- {
66
- variant: "filled",
67
- color: "default",
68
- class: "bg-foreground text-background [&_svg]:data-[slot=icon]:text-background [&_svg]:stroke-background hover:bg-[color-mix(in_oklab,var(--color-foreground)_90%,var(--color-background))] active:bg-[color-mix(in_oklab,var(--color-foreground)_70%,var(--color-background))] focus:bg-[color-mix(in_oklab,var(--color-foreground)_80%,var(--color-background))]"
69
- },
70
- {
71
- variant: "tonal",
72
- color: "primary",
73
- class: `${c.primary} ${l.primary} ${s.primary} bg-primary/15 hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/10`
74
- },
75
- {
76
- variant: "tonal",
77
- color: "secondary",
78
- class: `${c.secondary} ${l.secondary} ${s.secondary} bg-secondary/15 hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
79
- },
80
- {
81
- variant: "tonal",
82
- color: "success",
83
- class: `${c.success} ${l.success} ${s.success} bg-success/15 hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
84
- },
85
- {
86
- variant: "tonal",
87
- color: "info",
88
- class: `${c.info} ${l.info} ${s.info} bg-info/15 hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
89
- },
90
- {
91
- variant: "tonal",
92
- color: "warning",
93
- class: `${c.warning} ${l.warning} ${s.warning} bg-warning/15 hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
94
- },
95
- {
96
- variant: "tonal",
97
- color: "error",
98
- class: `${c.error} ${l.error} ${s.error} bg-error/15 hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
99
- },
100
- {
101
- variant: "tonal",
102
- color: "default",
103
- class: `${c.default} ${l.default} ${s.default} bg-foreground/15 hover:bg-foreground/10 active:bg-muted focus:bg-muted`
104
- },
105
- {
106
- variant: "ghost",
107
- color: "primary",
108
- class: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50"
109
- },
110
- {
111
- variant: "ghost",
112
- color: "default",
113
- class: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50"
114
- },
115
- {
116
- variant: "ghost",
117
- color: "secondary",
118
- class: `${c.secondary} ${l.secondary} ${s.secondary} hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
119
- },
120
- {
121
- variant: "ghost",
122
- color: "success",
123
- class: `${c.success} ${l.success} ${s.success} hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
124
- },
125
- {
126
- variant: "ghost",
127
- color: "info",
128
- class: `${c.info} ${l.info} ${s.info} hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
129
- },
130
- {
131
- variant: "ghost",
132
- color: "warning",
133
- class: `${c.warning} ${l.warning} ${s.warning} hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
134
- },
135
- {
136
- variant: "ghost",
137
- color: "error",
138
- class: `${c.error} ${l.error} ${s.error} hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
139
- },
140
- {
141
- variant: "outlined",
142
- color: "primary",
143
- class: `${c.primary} ${l.primary} ${s.primary} border-primary/50 focus:bg-primary/10 hover:bg-primary/10`
144
- },
145
- {
146
- variant: "outlined",
147
- color: "secondary",
148
- class: `${c.secondary} ${l.secondary} ${s.secondary} border-secondary/50 focus:bg-secondary/10 hover:bg-secondary/10`
149
- },
150
- {
151
- variant: "outlined",
152
- color: "success",
153
- class: `${c.success} ${l.success} ${s.success} border-success/50 focus:bg-success/10 hover:bg-success/10`
154
- },
155
- {
156
- variant: "outlined",
157
- color: "info",
158
- class: `${c.info} ${l.info} ${s.info} border-info/50 focus:bg-info/10 hover:bg-info/10`
159
- },
160
- {
161
- variant: "outlined",
162
- color: "warning",
163
- class: `${c.warning} ${l.warning} ${s.warning} border-warning/50 focus:bg-warning/10 hover:bg-warning/10`
164
- },
165
- {
166
- variant: "outlined",
167
- color: "error",
168
- class: `${c.error} ${l.error} ${s.error} border-error/50 focus:bg-error/10 hover:bg-error/10`
169
- },
170
- {
171
- variant: "outlined",
172
- color: "default",
173
- class: `${c.default} ${l.default} ${s.default} border-foreground/50 focus:bg-foreground/10 hover:bg-foreground/10`
174
- },
175
- {
176
- variant: "link",
177
- color: "primary",
178
- class: `${c.primary} ${l.primary} ${s.primary} underline-offset-4 hover:underline hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/10`
179
- },
180
- {
181
- variant: "link",
182
- color: "secondary",
183
- class: `${c.secondary} ${l.secondary} ${s.secondary} underline-offset-4 hover:underline hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
184
- },
185
- {
186
- variant: "link",
187
- color: "success",
188
- class: `${c.success} ${l.success} ${s.success} underline-offset-4 hover:underline hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
189
- },
190
- {
191
- variant: "link",
192
- color: "info",
193
- class: `${c.info} ${l.info} ${s.info} underline-offset-4 hover:underline hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
194
- },
195
- {
196
- variant: "link",
197
- color: "warning",
198
- class: `${c.warning} ${l.warning} ${s.warning} underline-offset-4 hover:underline hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
199
- },
200
- {
201
- variant: "link",
202
- color: "error",
203
- class: `${c.error} ${l.error} ${s.error} underline-offset-4 hover:underline hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
204
- },
205
- {
206
- variant: "link",
207
- color: "default",
208
- class: `${c.default} ${l.default} ${s.default} underline-offset-4 hover:underline hover:bg-foreground/10 active:bg-muted focus:bg-foreground/10`
209
- }
210
- ]
211
- }), g = ((e) => h(e?.variant === "ghost" && e.color === null ? {
212
- ...e,
213
- color: void 0
214
- } : e)), _ = {
215
- filled: {
216
- primary: "fill-primary",
217
- secondary: "fill-secondary dark:fill-[color-mix(in_oklab,var(--color-secondary)_70%,var(--color-background))]",
218
- success: "fill-success dark:fill-[color-mix(in_oklab,var(--color-success)_60%,var(--color-background))]",
219
- info: "fill-info dark:fill-[color-mix(in_oklab,var(--color-info)_60%,var(--color-background))]",
220
- warning: "fill-warning dark:fill-[color-mix(in_oklab,var(--color-warning)_60%,var(--color-background))]",
221
- error: "fill-error",
222
- default: "fill-foreground"
223
- },
224
- tonal: {
225
- primary: "fill-primary/15 group-hover/icon-button:fill-primary/10 group-active/icon-button:fill-primary/5",
226
- secondary: "fill-secondary/15 group-hover/icon-button:fill-secondary/10 group-active/icon-button:fill-secondary/5",
227
- success: "fill-success/15 group-hover/icon-button:fill-success/10 group-active/icon-button:fill-success/5",
228
- info: "fill-info/15 group-hover/icon-button:fill-info/10 group-active/icon-button:fill-info/5",
229
- warning: "fill-warning/15 group-hover/icon-button:fill-warning/10 group-active/icon-button:fill-warning/5",
230
- error: "fill-error/15 group-hover/icon-button:fill-error/10 group-active/icon-button:fill-error/5",
231
- default: "fill-foreground/15 group-hover/icon-button:fill-foreground/10 group-active/icon-button:fill-foreground/5"
232
- },
233
- outlined: {
234
- primary: "fill-transparent stroke-primary/50 group-hover/icon-button:fill-primary/10 group-active/icon-button:fill-primary/5",
235
- secondary: "fill-transparent stroke-secondary/50 group-hover/icon-button:fill-secondary/10 group-active/icon-button:fill-secondary/5",
236
- success: "fill-transparent stroke-success/50 group-hover/icon-button:fill-success/10 group-active/icon-button:fill-success/5",
237
- info: "fill-transparent stroke-info/50 group-hover/icon-button:fill-info/10 group-active/icon-button:fill-info/5",
238
- warning: "fill-transparent stroke-warning/50 group-hover/icon-button:fill-warning/10 group-active/icon-button:fill-warning/5",
239
- error: "fill-transparent stroke-error/50 group-hover/icon-button:fill-error/10 group-active/icon-button:fill-error/5",
240
- default: "fill-transparent stroke-foreground/50 group-hover/icon-button:fill-foreground/10 group-active/icon-button:fill-foreground/5"
241
- },
242
- ghost: {
243
- primary: "fill-transparent group-hover/icon-button:fill-accent dark:group-hover/icon-button:fill-accent/50",
244
- secondary: "fill-transparent group-hover/icon-button:fill-secondary/10 group-active/icon-button:fill-secondary/5",
245
- success: "fill-transparent group-hover/icon-button:fill-success/10 group-active/icon-button:fill-success/5",
246
- info: "fill-transparent group-hover/icon-button:fill-info/10 group-active/icon-button:fill-info/5",
247
- warning: "fill-transparent group-hover/icon-button:fill-warning/10 group-active/icon-button:fill-warning/5",
248
- error: "fill-transparent group-hover/icon-button:fill-error/10 group-active/icon-button:fill-error/5",
249
- default: "fill-transparent group-hover/icon-button:fill-accent dark:group-hover/icon-button:fill-accent/50"
250
- },
251
- link: {
252
- primary: "fill-transparent group-hover/icon-button:fill-accent dark:group-hover/icon-button:fill-accent/50",
253
- secondary: "fill-transparent group-hover/icon-button:fill-secondary/10 group-active/icon-button:fill-secondary/5",
254
- success: "fill-transparent group-hover/icon-button:fill-success/10 group-active/icon-button:fill-success/5",
255
- info: "fill-transparent group-hover/icon-button:fill-info/10 group-active/icon-button:fill-info/5",
256
- warning: "fill-transparent group-hover/icon-button:fill-warning/10 group-active/icon-button:fill-warning/5",
257
- error: "fill-transparent group-hover/icon-button:fill-error/10 group-active/icon-button:fill-error/5",
258
- default: "fill-transparent group-hover/icon-button:fill-accent dark:group-hover/icon-button:fill-accent/50"
259
- }
260
- };
261
- function v({ shape: n, variant: r, color: i }) {
262
- let a = u(n), o = f(null);
263
- return t(o, a, !0), /* @__PURE__ */ p("svg", {
264
- "data-slot": "icon-button-shape",
265
- viewBox: "0 0 100 100",
266
- "aria-hidden": "true",
267
- focusable: "false",
268
- className: e("-z-10 pointer-events-none absolute inset-0 size-full overflow-visible transition-[filter]", r === "filled" && "group-hover/icon-button:brightness-90 group-active/icon-button:brightness-80"),
269
- children: /* @__PURE__ */ p("path", {
270
- ref: o,
271
- d: d(a),
272
- vectorEffect: "non-scaling-stroke",
273
- paintOrder: "stroke",
274
- className: e("stroke-transparent stroke-1 transition-[fill]", _[r][i], "group-focus-visible/icon-button:stroke-ring/50 group-focus-visible/icon-button:stroke-[6px]", "forced-colors:fill-none forced-colors:stroke-[ButtonText] forced-colors:group-focus-visible/icon-button:stroke-[Highlight]")
275
- })
276
- });
277
- }
278
- //#endregion
279
- //#region lib/components/ui/actions/icon-button/icon-button.tsx
280
- function y({ variant: t, color: i, className: a, asChild: s, type: c = "button", shape: l, morph: u = "pill", children: d, ...f }) {
281
- let h = s ? r : "button";
282
- return /* @__PURE__ */ p(o, {
283
- value: !!(f["aria-label"] || f["aria-labelledby"]),
284
- children: /* @__PURE__ */ m(h, {
285
- "data-slot": "icon-button",
286
- "data-icon-button": "",
287
- "data-variant": t,
288
- "data-color": i,
289
- type: s ? void 0 : c,
290
- "data-shape": l,
291
- "data-morph": !l && u !== "none" && f["aria-pressed"] !== void 0 ? u : void 0,
292
- className: e(g({
293
- variant: t,
294
- color: i
295
- }), l && "group/icon-button relative isolate bg-transparent! border-0! shadow-none! ring-0! focus-visible:ring-0! aria-invalid:ring-0! forced-colors:[&_svg]:stroke-[ButtonText] forced-colors:[&_svg]:text-[ButtonText]", a),
296
- ...f,
297
- children: [l ? /* @__PURE__ */ p(v, {
298
- shape: l,
299
- variant: t ?? "filled",
300
- color: i ?? (t === "ghost" ? "default" : "primary")
301
- }) : null, /* @__PURE__ */ p(n, { children: d })]
302
- })
303
- });
304
- }
305
- function b({ tooltip: e, "aria-label": t, ...n }) {
306
- let r = t ?? (typeof e == "string" ? e : void 0);
307
- return e ? /* @__PURE__ */ p(a, {
308
- content: e,
309
- children: /* @__PURE__ */ p(y, {
310
- "aria-label": r,
311
- ...n
312
- })
313
- }) : /* @__PURE__ */ p(y, {
314
- "aria-label": r,
315
- ...n
316
- });
317
- }
318
- //#endregion
319
- export { g as n, b as t };
@@ -1,65 +0,0 @@
1
- /* A morph `IconButton` toggle (icon-button-morph.css) by medium: the 14px
2
- * widening from 600px wide, the colour change only under reduced motion,
3
- * `SelectedItem` in forced colours. */
4
- @layer utilities {
5
- @media (min-width: 600px) {
6
- [data-icon-button][data-morph]:not(
7
- [data-shape],
8
- .nxgt-toolbar-item,
9
- [data-toolbar-item]
10
- ) {
11
- --ib-morph: 14px;
12
- }
13
- }
14
- @media (prefers-reduced-motion: reduce) {
15
- [data-icon-button][data-morph]:not(
16
- [data-shape],
17
- .nxgt-toolbar-item,
18
- [data-toolbar-item]
19
- ),
20
- [data-icon-button][data-morph]:not(
21
- [data-shape],
22
- .nxgt-toolbar-item,
23
- [data-toolbar-item]
24
- )::before {
25
- transition:
26
- background-color 180ms var(--nxgt-ease-effects),
27
- color 180ms var(--nxgt-ease-effects);
28
- }
29
- }
30
- @media (forced-colors: active) {
31
- [data-icon-button][data-morph][aria-pressed="true"]:not(
32
- [data-shape],
33
- .nxgt-toolbar-item,
34
- [data-toolbar-item]
35
- ) {
36
- color: SelectedItemText;
37
- forced-color-adjust: none;
38
- }
39
- [data-icon-button][data-morph][aria-pressed="true"]:not(
40
- [data-shape],
41
- .nxgt-toolbar-item,
42
- [data-toolbar-item]
43
- )::before {
44
- background: SelectedItem;
45
- }
46
- [data-icon-button][data-morph][aria-pressed="true"]:not(
47
- [data-shape],
48
- .nxgt-toolbar-item,
49
- [data-toolbar-item]
50
- )
51
- svg {
52
- color: SelectedItemText;
53
- stroke: SelectedItemText;
54
- }
55
- [data-icon-button][data-morph][aria-pressed="true"]:not(
56
- [data-shape],
57
- .nxgt-toolbar-item,
58
- [data-toolbar-item]
59
- ):focus-visible::before {
60
- box-shadow: none;
61
- outline: 2px solid Highlight;
62
- outline-offset: 2px;
63
- }
64
- }
65
- }