@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.
Files changed (158) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.md +10 -11
  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 +6 -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/ui/feedback/toast/toast-expressive.css +17 -0
  22. package/dist/components/ui/layout/app-shell/activity-backdrop-shapes.css +49 -0
  23. package/dist/components/ui/layout/app-shell/activity-backdrop.css +0 -17
  24. package/dist/components/ui/layout/sidebar/sidebar-tokens.css +7 -2
  25. package/dist/{components-BkF9N-Yx.js → components-yx1t_5_P.js} +13740 -13422
  26. package/dist/components.js +24 -24
  27. package/dist/{dialog-CkIYpJXk.js → dialog-BQp5IdFl.js} +147 -147
  28. package/dist/dnd.js +1 -1
  29. package/dist/{dropdown-menu-BC5Tbhb9.js → dropdown-menu-BsH9W_3C.js} +3 -3
  30. package/dist/editor-viewer.js +1 -1
  31. package/dist/editor.js +13 -13
  32. package/dist/{empty-state-SeAg2TOX.js → empty-state-WaU4-T2c.js} +5 -5
  33. package/dist/escape-owner-C4W_sOAU.js +116 -0
  34. package/dist/{field-blur-DPLsMufs.js → field-blur-CJHzVSh9.js} +1 -1
  35. package/dist/{field-blur-context-1ZwJgsHE.js → field-blur-context-Cft9s7Hg.js} +2 -2
  36. package/dist/{hover-card-Cox-tPDz.js → hover-card-C0fw2kLK.js} +72 -71
  37. package/dist/i18n.js +12 -12
  38. package/dist/{icon-badge-q3Ve8gra.js → icon-badge-DUAq9f7H.js} +4 -4
  39. package/dist/icon-button-ifTpXt0A.js +355 -0
  40. package/dist/{illustration-BfHRpVzM.js → illustration-BmQmvW_4.js} +1 -1
  41. package/dist/illustrations.js +2 -2
  42. package/dist/lib/components/ui/actions/button/button-tones.d.ts +16 -0
  43. package/dist/lib/components/ui/actions/button/button.d.ts +13 -0
  44. package/dist/lib/components/ui/actions/button/button.variants.d.ts +4 -3
  45. package/dist/lib/components/ui/actions/button-group/button-group-context.d.ts +16 -0
  46. package/dist/lib/components/ui/actions/button-group/button-group-reset.d.ts +13 -0
  47. package/dist/lib/components/ui/actions/button-group/button-group.d.ts +19 -2
  48. package/dist/lib/components/ui/actions/icon-button/icon-button-shape.d.ts +3 -2
  49. package/dist/lib/components/ui/actions/icon-button/icon-button.d.ts +18 -4
  50. package/dist/lib/components/ui/actions/icon-button/icon-button.variants.d.ts +34 -4
  51. package/dist/lib/components/ui/display/badge/badge.d.ts +7 -2
  52. package/dist/lib/components/ui/display/entity-header/entity-header.d.ts +9 -1
  53. package/dist/lib/components/ui/display/entity-header/entity-stats.d.ts +16 -0
  54. package/dist/lib/components/ui/display/entity-header/partials/entity-header-actions.d.ts +6 -0
  55. package/dist/lib/components/ui/display/entity-header/partials/entity-header-body.d.ts +14 -0
  56. package/dist/lib/components/ui/display/entity-header/partials/entity-header-icon.d.ts +6 -0
  57. package/dist/lib/components/ui/display/entity-header/partials/shown.d.ts +2 -0
  58. package/dist/lib/components/ui/display/list-tile/list-tile.d.ts +8 -1
  59. package/dist/lib/components/ui/display/list-tile/partials/list-tile-body.d.ts +2 -1
  60. package/dist/lib/components/ui/display/stat-card/index.d.ts +1 -1
  61. package/dist/lib/components/ui/display/stat-card/partials/stat-card-compact.d.ts +12 -0
  62. package/dist/lib/components/ui/display/stat-card/stat-card-classes.d.ts +3 -2
  63. package/dist/lib/components/ui/display/stat-card/stat-card.d.ts +2 -2
  64. package/dist/lib/components/ui/display/stat-card/types.d.ts +9 -0
  65. package/dist/lib/components/ui/feedback/alert/alert-variants.d.ts +18 -0
  66. package/dist/lib/components/ui/feedback/alert/alert.d.ts +2 -6
  67. package/dist/lib/components/ui/feedback/typing-indicator/typing-indicator.d.ts +1 -1
  68. package/dist/lib/components/ui/fields/slider/split-slider-props.d.ts +1 -1
  69. package/dist/lib/components/ui/fields/slider/use-slider-control.d.ts +1 -1
  70. package/dist/lib/components/ui/layout/app-shell/activity-column.d.ts +17 -0
  71. package/dist/lib/components/ui/layout/app-shell/activity-layout.d.ts +3 -106
  72. package/dist/lib/components/ui/layout/app-shell/activity-layout.types.d.ts +113 -0
  73. package/dist/lib/components/ui/layout/app-shell/app-breadcrumb.d.ts +2 -1
  74. package/dist/lib/components/ui/layout/app-shell/app-sidebar-icon-item.d.ts +13 -0
  75. package/dist/lib/components/ui/layout/app-shell/app-sidebar-label-item.d.ts +11 -0
  76. package/dist/lib/components/ui/layout/app-shell/keep-shapes-inside.d.ts +6 -0
  77. package/dist/lib/components/ui/layout/app-shell/observe-layout.d.ts +11 -0
  78. package/dist/lib/components/ui/layout/app-shell/shape-units.d.ts +16 -0
  79. package/dist/lib/components/ui/layout/app-shell/shapes-clear-content.d.ts +13 -0
  80. package/dist/lib/components/ui/layout/app-shell/types.d.ts +10 -0
  81. package/dist/lib/components/ui/layout/app-shell/use-keep-shapes-inside.d.ts +14 -0
  82. package/dist/lib/components/ui/layout/app-shell/watch-content.d.ts +19 -0
  83. package/dist/lib/components/ui/overlays/dialog/dialog-variants.d.ts +1 -1
  84. package/dist/lib/components/ui/primitives/toggle/toggle.d.ts +1 -1
  85. package/dist/lib/components/ui/primitives/typography/typography.d.ts +17 -7
  86. package/dist/lib/components/ui/primitives/typography/typography.variants.d.ts +55 -0
  87. package/dist/lib/components/ui/selection/choice-group/use-choice-group-field.d.ts +2 -2
  88. package/dist/lib/components/ui/tones.d.ts +1 -1
  89. package/dist/lib/i18n/translator.d.ts +1 -1
  90. package/dist/lib.js +2 -2
  91. package/dist/{line-path-BQeLQZ-P.js → line-path-C5pZGC49.js} +1 -1
  92. package/dist/main.js +29 -29
  93. package/dist/map.js +9 -9
  94. package/dist/material.css +1 -1
  95. package/dist/pdf-reader.js +1 -1
  96. package/dist/print.js +1 -1
  97. package/dist/{public-CtpsxV4I.js → public-B0Nq_yYV.js} +524 -524
  98. package/dist/{render-json-DyFYFIkZ.js → render-json-BOhvPnSv.js} +1 -1
  99. package/dist/{rich-code-block-C2Fp_FDU.js → rich-code-block-v7WmeZp9.js} +5 -5
  100. package/dist/{rich-text-viewer-LO1IZCWs.js → rich-text-viewer-W15XIwah.js} +2 -2
  101. package/dist/{skeleton-Bmp4gWAH.js → skeleton-DSdtr2qc.js} +1 -1
  102. package/dist/{sortable-provider-pVaEZzty.js → sortable-provider-CgDTolQR.js} +3 -3
  103. package/dist/{spinner-CsHcmcpF.js → spinner-BtSIYVrC.js} +3 -3
  104. package/dist/{state-scenes-SGNyZjTz.js → state-scenes-BX03WmSu.js} +1 -1
  105. package/dist/styles.css +2 -0
  106. package/dist/theme-picker.js +3 -3
  107. package/dist/{theme-toggle-oU-fh6WE.js → theme-toggle-B2Pehdhn.js} +2 -2
  108. package/dist/{toggle-group-j8zaxEg1.js → toggle-group-BMJNcFAC.js} +1 -1
  109. package/dist/{toolbar-items-CqHvlTU8.js → toolbar-items-rUHdVqAq.js} +399 -398
  110. package/dist/{tooltip-rhbqNmr3.js → tooltip-CkttDIab.js} +1 -1
  111. package/dist/{translate-material-CGZljjp1.js → translate-material-Bd_KgfB8.js} +1 -1
  112. package/dist/{translator-DCYO4Ij3.js → translator-Dje8HrNz.js} +5 -5
  113. package/dist/{use-chat-composer-nWWfVyrK.js → use-chat-composer-B0_STpQN.js} +4173 -4173
  114. package/dist/{use-material-translation-DkxcLbLM.js → use-material-translation-B3V_bz-5.js} +1 -1
  115. package/dist/{utils-Bcd2Z3ea.js → utils-BLfntITJ.js} +14 -1
  116. package/docs/components/buttons-and-actions.md +64 -15
  117. package/docs/components/data-display.md +40 -9
  118. package/docs/components/feedback-and-status.md +12 -1
  119. package/docs/components/navigation-and-layout.md +4 -3
  120. package/docs/components/primitives.md +52 -10
  121. package/docs/guides/app-shell.md +52 -8
  122. package/docs/guides/backgrounds.md +2 -0
  123. package/docs/guides/theming.md +55 -3
  124. package/docs/previews/buttons-actions-button.webp +0 -0
  125. package/docs/previews/buttons-actions-iconbutton.webp +0 -0
  126. package/docs/previews/data-display-badge.webp +0 -0
  127. package/docs/previews/data-display-entityheader.webp +0 -0
  128. package/docs/previews/data-display-listtile.webp +0 -0
  129. package/docs/previews/data-display-statcard.webp +0 -0
  130. package/docs/previews/feedback-status-banner.webp +0 -0
  131. package/docs/previews/navigation-layout-appshell-footer-icon.webp +0 -0
  132. package/docs/previews/navigation-layout-appshell-menu-badge.webp +0 -0
  133. package/docs/previews/navigation-layout-appshell.webp +0 -0
  134. package/docs/previews/navigation-layout-sidebar.webp +0 -0
  135. package/docs/previews/primitives-typography.webp +0 -0
  136. package/docs/roadmap.md +53 -4
  137. package/docs/troubleshooting.md +75 -4
  138. package/lib/components/base.css +21 -6
  139. package/lib/components/components.css +6 -2
  140. package/lib/components/type-scale.css +194 -0
  141. package/lib/components/ui/actions/button/button.css +156 -0
  142. package/lib/components/ui/actions/button-group/button-group-standard.css +131 -0
  143. package/lib/components/ui/actions/button-group/button-group.css +4 -1
  144. package/lib/components/ui/actions/icon-button/icon-button.css +115 -0
  145. package/lib/components/ui/actions/morph-fill.css +62 -0
  146. package/lib/components/ui/feedback/toast/toast-expressive.css +17 -0
  147. package/lib/components/ui/layout/app-shell/activity-backdrop-shapes.css +49 -0
  148. package/lib/components/ui/layout/app-shell/activity-backdrop.css +0 -17
  149. package/lib/components/ui/layout/sidebar/sidebar-tokens.css +7 -2
  150. package/lib/styles.css +2 -0
  151. package/package.json +2 -1
  152. package/dist/button-DbfdITBB.js +0 -322
  153. package/dist/components/ui/actions/icon-button/icon-button-morph-media.css +0 -65
  154. package/dist/components/ui/actions/icon-button/icon-button-morph.css +0 -152
  155. package/dist/escape-owner-CripBce_.js +0 -57
  156. package/dist/icon-button-DJcWpIhu.js +0 -319
  157. package/lib/components/ui/actions/icon-button/icon-button-morph-media.css +0 -65
  158. package/lib/components/ui/actions/icon-button/icon-button-morph.css +0 -152
@@ -0,0 +1,355 @@
1
+ import { t as e } from "./utils-BLfntITJ.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-CkttDIab.js";
5
+ import { t as o } from "./is-production-GLw59WU8.js";
6
+ import { a as s, i as c, n as l, r as u, t as d } from "./button-tones-BwuVvAmd.js";
7
+ import { t as f } from "./button-group-context-CaP0X5p_.js";
8
+ import { shapeOutline as p, toSvgPath as m } from "@nxgt/material-core/shapes";
9
+ import { useContext as h, useEffect as g, useRef as _ } from "react";
10
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
11
+ //#region lib/components/ui/actions/icon-button/icon-button.compound-variants.ts
12
+ var b = [
13
+ {
14
+ variant: "filled",
15
+ color: "primary",
16
+ 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)]"
17
+ },
18
+ {
19
+ variant: "filled",
20
+ color: "secondary",
21
+ 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))]"
22
+ },
23
+ {
24
+ variant: "filled",
25
+ color: "success",
26
+ 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))]"
27
+ },
28
+ {
29
+ variant: "filled",
30
+ color: "info",
31
+ 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))]"
32
+ },
33
+ {
34
+ variant: "filled",
35
+ color: "warning",
36
+ 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))]"
37
+ },
38
+ {
39
+ variant: "filled",
40
+ color: "error",
41
+ 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)]"
42
+ },
43
+ {
44
+ variant: "filled",
45
+ color: "default",
46
+ 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))]"
47
+ },
48
+ {
49
+ variant: "tonal",
50
+ color: "primary",
51
+ class: `${u.primary} ${d.primary} ${l.primary} bg-primary/15 hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/10`
52
+ },
53
+ {
54
+ variant: "tonal",
55
+ color: "secondary",
56
+ class: `${u.secondary} ${d.secondary} ${l.secondary} bg-secondary/15 hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
57
+ },
58
+ {
59
+ variant: "tonal",
60
+ color: "success",
61
+ class: `${u.success} ${d.success} ${l.success} bg-success/15 hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
62
+ },
63
+ {
64
+ variant: "tonal",
65
+ color: "info",
66
+ class: `${u.info} ${d.info} ${l.info} bg-info/15 hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
67
+ },
68
+ {
69
+ variant: "tonal",
70
+ color: "warning",
71
+ class: `${u.warning} ${d.warning} ${l.warning} bg-warning/15 hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
72
+ },
73
+ {
74
+ variant: "tonal",
75
+ color: "error",
76
+ class: `${u.error} ${d.error} ${l.error} bg-error/15 hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
77
+ },
78
+ {
79
+ variant: "tonal",
80
+ color: "default",
81
+ class: `${u.default} ${d.default} ${l.default} bg-foreground/15 hover:bg-foreground/10 active:bg-muted focus:bg-muted`
82
+ },
83
+ {
84
+ variant: "ghost",
85
+ color: "primary",
86
+ class: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50"
87
+ },
88
+ {
89
+ variant: "ghost",
90
+ color: "default",
91
+ class: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50"
92
+ },
93
+ {
94
+ variant: "ghost",
95
+ color: "secondary",
96
+ class: `${u.secondary} ${d.secondary} ${l.secondary} hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
97
+ },
98
+ {
99
+ variant: "ghost",
100
+ color: "success",
101
+ class: `${u.success} ${d.success} ${l.success} hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
102
+ },
103
+ {
104
+ variant: "ghost",
105
+ color: "info",
106
+ class: `${u.info} ${d.info} ${l.info} hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
107
+ },
108
+ {
109
+ variant: "ghost",
110
+ color: "warning",
111
+ class: `${u.warning} ${d.warning} ${l.warning} hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
112
+ },
113
+ {
114
+ variant: "ghost",
115
+ color: "error",
116
+ class: `${u.error} ${d.error} ${l.error} hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
117
+ },
118
+ {
119
+ variant: "outlined",
120
+ color: "primary",
121
+ class: `${u.primary} ${d.primary} ${l.primary} focus:bg-primary/10 hover:bg-primary/10`
122
+ },
123
+ {
124
+ variant: "outlined",
125
+ color: "secondary",
126
+ class: `${u.secondary} ${d.secondary} ${l.secondary} focus:bg-secondary/10 hover:bg-secondary/10`
127
+ },
128
+ {
129
+ variant: "outlined",
130
+ color: "success",
131
+ class: `${u.success} ${d.success} ${l.success} focus:bg-success/10 hover:bg-success/10`
132
+ },
133
+ {
134
+ variant: "outlined",
135
+ color: "info",
136
+ class: `${u.info} ${d.info} ${l.info} focus:bg-info/10 hover:bg-info/10`
137
+ },
138
+ {
139
+ variant: "outlined",
140
+ color: "warning",
141
+ class: `${u.warning} ${d.warning} ${l.warning} focus:bg-warning/10 hover:bg-warning/10`
142
+ },
143
+ {
144
+ variant: "outlined",
145
+ color: "error",
146
+ class: `${u.error} ${d.error} ${l.error} focus:bg-error/10 hover:bg-error/10`
147
+ },
148
+ {
149
+ variant: "outlined",
150
+ color: "default",
151
+ class: `${u.default} ${d.default} ${l.default} focus:bg-foreground/10 hover:bg-foreground/10`
152
+ },
153
+ {
154
+ variant: "link",
155
+ color: "primary",
156
+ class: `${u.primary} ${d.primary} ${l.primary} underline-offset-4 hover:underline hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/10`
157
+ },
158
+ {
159
+ variant: "link",
160
+ color: "secondary",
161
+ class: `${u.secondary} ${d.secondary} ${l.secondary} underline-offset-4 hover:underline hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
162
+ },
163
+ {
164
+ variant: "link",
165
+ color: "success",
166
+ class: `${u.success} ${d.success} ${l.success} underline-offset-4 hover:underline hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
167
+ },
168
+ {
169
+ variant: "link",
170
+ color: "info",
171
+ class: `${u.info} ${d.info} ${l.info} underline-offset-4 hover:underline hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
172
+ },
173
+ {
174
+ variant: "link",
175
+ color: "warning",
176
+ class: `${u.warning} ${d.warning} ${l.warning} underline-offset-4 hover:underline hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
177
+ },
178
+ {
179
+ variant: "link",
180
+ color: "error",
181
+ class: `${u.error} ${d.error} ${l.error} underline-offset-4 hover:underline hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
182
+ },
183
+ {
184
+ variant: "link",
185
+ color: "default",
186
+ class: `${u.default} ${d.default} ${l.default} underline-offset-4 hover:underline hover:bg-foreground/10 active:bg-muted focus:bg-foreground/10`
187
+ }
188
+ ], x = i("inline-flex center gap-2 cursor-pointer whitespace-nowrap text-sm font-medium disabled:pointer-events-none [&_svg]:bg-transparent [&_svg]:text-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-(--btn-ic,1rem) shrink-0 [&_svg]:shrink-0", {
189
+ variants: {
190
+ look: {
191
+ btn: "nxgt-btn nxgt-morph-fill aria-invalid:[--btn-focus:var(--color-error)] aria-invalid:[--btn-line:var(--color-error)]",
192
+ shaped: "transition-all disabled:opacity-50 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 aspect-square rounded-full"
193
+ },
194
+ size: {
195
+ legacy: "h-9 w-[calc(2.25rem*var(--ib-k,1))] [--btn-h:2.25rem] [--btn-sq:10px] [--btn-ic:1rem] has-[[data-slot=icon]]:p-1.5",
196
+ xs: "h-(--btn-h) w-[calc(var(--btn-h)*var(--ib-k,1))] [--btn-h:24px] [--btn-sq:6px] [--btn-ic:14px]",
197
+ sm: "h-(--btn-h) w-[calc(var(--btn-h)*var(--ib-k,1))] [--btn-h:32px] [--btn-sq:8px] [--btn-ic:16px]",
198
+ default: "h-(--btn-h) w-[calc(var(--btn-h)*var(--ib-k,1))] [--btn-h:36px] [--btn-sq:10px] [--btn-ic:18px]",
199
+ lg: "h-(--btn-h) w-[calc(var(--btn-h)*var(--ib-k,1))] [--btn-h:40px] [--btn-sq:12px] [--btn-ic:20px]",
200
+ xl: "h-(--btn-h) w-[calc(var(--btn-h)*var(--ib-k,1))] [--btn-h:56px] [--btn-sq:16px] [--btn-ic:28px]"
201
+ },
202
+ width: {
203
+ narrow: "[--ib-k:0.78]",
204
+ default: "",
205
+ wide: "[--ib-k:1.45]"
206
+ },
207
+ variant: {
208
+ filled: "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)]",
209
+ tonal: "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",
210
+ ghost: "nxgt-btn-bare",
211
+ outlined: "shadow-[inset_0_0_0_1.5px_color-mix(in_oklab,var(--btn-line,currentColor)_55%,transparent)] text-primary-text [&_svg]:data-[slot=icon]:text-primary-text [&_svg]:stroke-primary-text focus:bg-primary/10 hover:bg-primary/10",
212
+ link: "nxgt-btn-bare 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"
213
+ },
214
+ color: c
215
+ },
216
+ defaultVariants: {
217
+ variant: "filled",
218
+ color: "primary",
219
+ look: "btn",
220
+ size: "legacy",
221
+ width: "default"
222
+ },
223
+ compoundVariants: [...b, {
224
+ look: "btn",
225
+ size: "legacy",
226
+ width: "default",
227
+ class: "[--btn-round:50%]"
228
+ }]
229
+ });
230
+ function S(e) {
231
+ return (t) => x({
232
+ ...t,
233
+ look: e,
234
+ size: t?.size ?? "legacy",
235
+ color: t?.variant === "ghost" && t.color == null ? "default" : t?.color
236
+ });
237
+ }
238
+ var C = S("btn"), w = S("shaped"), T = {
239
+ filled: {
240
+ primary: "fill-primary",
241
+ secondary: "fill-secondary dark:fill-[color-mix(in_oklab,var(--color-secondary)_70%,var(--color-background))]",
242
+ success: "fill-success dark:fill-[color-mix(in_oklab,var(--color-success)_60%,var(--color-background))]",
243
+ info: "fill-info dark:fill-[color-mix(in_oklab,var(--color-info)_60%,var(--color-background))]",
244
+ warning: "fill-warning dark:fill-[color-mix(in_oklab,var(--color-warning)_60%,var(--color-background))]",
245
+ error: "fill-error",
246
+ default: "fill-foreground"
247
+ },
248
+ tonal: {
249
+ primary: "fill-primary/15 group-hover/icon-button:fill-primary/10 group-active/icon-button:fill-primary/5",
250
+ secondary: "fill-secondary/15 group-hover/icon-button:fill-secondary/10 group-active/icon-button:fill-secondary/5",
251
+ success: "fill-success/15 group-hover/icon-button:fill-success/10 group-active/icon-button:fill-success/5",
252
+ info: "fill-info/15 group-hover/icon-button:fill-info/10 group-active/icon-button:fill-info/5",
253
+ warning: "fill-warning/15 group-hover/icon-button:fill-warning/10 group-active/icon-button:fill-warning/5",
254
+ error: "fill-error/15 group-hover/icon-button:fill-error/10 group-active/icon-button:fill-error/5",
255
+ default: "fill-foreground/15 group-hover/icon-button:fill-foreground/10 group-active/icon-button:fill-foreground/5"
256
+ },
257
+ outlined: {
258
+ primary: "fill-transparent stroke-primary/50 group-hover/icon-button:fill-primary/10 group-active/icon-button:fill-primary/5",
259
+ secondary: "fill-transparent stroke-secondary/50 group-hover/icon-button:fill-secondary/10 group-active/icon-button:fill-secondary/5",
260
+ success: "fill-transparent stroke-success/50 group-hover/icon-button:fill-success/10 group-active/icon-button:fill-success/5",
261
+ info: "fill-transparent stroke-info/50 group-hover/icon-button:fill-info/10 group-active/icon-button:fill-info/5",
262
+ warning: "fill-transparent stroke-warning/50 group-hover/icon-button:fill-warning/10 group-active/icon-button:fill-warning/5",
263
+ error: "fill-transparent stroke-error/50 group-hover/icon-button:fill-error/10 group-active/icon-button:fill-error/5",
264
+ default: "fill-transparent stroke-foreground/50 group-hover/icon-button:fill-foreground/10 group-active/icon-button:fill-foreground/5"
265
+ },
266
+ ghost: {
267
+ primary: "fill-transparent group-hover/icon-button:fill-accent dark:group-hover/icon-button:fill-accent/50",
268
+ secondary: "fill-transparent group-hover/icon-button:fill-secondary/10 group-active/icon-button:fill-secondary/5",
269
+ success: "fill-transparent group-hover/icon-button:fill-success/10 group-active/icon-button:fill-success/5",
270
+ info: "fill-transparent group-hover/icon-button:fill-info/10 group-active/icon-button:fill-info/5",
271
+ warning: "fill-transparent group-hover/icon-button:fill-warning/10 group-active/icon-button:fill-warning/5",
272
+ error: "fill-transparent group-hover/icon-button:fill-error/10 group-active/icon-button:fill-error/5",
273
+ default: "fill-transparent group-hover/icon-button:fill-accent dark:group-hover/icon-button:fill-accent/50"
274
+ },
275
+ link: {
276
+ primary: "fill-transparent group-hover/icon-button:fill-accent dark:group-hover/icon-button:fill-accent/50",
277
+ secondary: "fill-transparent group-hover/icon-button:fill-secondary/10 group-active/icon-button:fill-secondary/5",
278
+ success: "fill-transparent group-hover/icon-button:fill-success/10 group-active/icon-button:fill-success/5",
279
+ info: "fill-transparent group-hover/icon-button:fill-info/10 group-active/icon-button:fill-info/5",
280
+ warning: "fill-transparent group-hover/icon-button:fill-warning/10 group-active/icon-button:fill-warning/5",
281
+ error: "fill-transparent group-hover/icon-button:fill-error/10 group-active/icon-button:fill-error/5",
282
+ default: "fill-transparent group-hover/icon-button:fill-accent dark:group-hover/icon-button:fill-accent/50"
283
+ }
284
+ };
285
+ function E({ shape: n, variant: r, color: i }) {
286
+ let a = p(n), o = _(null);
287
+ return t(o, a, !0), /* @__PURE__ */ v("svg", {
288
+ "data-slot": "icon-button-shape",
289
+ viewBox: "0 0 100 100",
290
+ "aria-hidden": "true",
291
+ focusable: "false",
292
+ 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"),
293
+ children: /* @__PURE__ */ v("path", {
294
+ ref: o,
295
+ d: m(a),
296
+ vectorEffect: "non-scaling-stroke",
297
+ paintOrder: "stroke",
298
+ className: e("stroke-transparent stroke-1 transition-[fill]", T[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]")
299
+ })
300
+ });
301
+ }
302
+ //#endregion
303
+ //#region lib/components/ui/actions/icon-button/icon-button.tsx
304
+ function D({ variant: t, color: i, size: a, width: c, className: l, asChild: u, type: d = "button", shape: p, morph: m = "pill", children: _, ...b }) {
305
+ let x = u ? r : "button", S = h(f), T = a ?? S, D = !!(b["aria-label"] || b["aria-labelledby"]), O = !!p && c != null && c !== "default";
306
+ g(() => {
307
+ O && !o() && console.warn("IconButton: `width` is ignored with `shape`; a shaped button is as wide as it is high.");
308
+ }, [O]);
309
+ let k = !p && m !== "none" && b["aria-pressed"] !== void 0, A = b["aria-pressed"] === !0 || b["aria-pressed"] === "true";
310
+ return /* @__PURE__ */ v(s, {
311
+ value: D,
312
+ children: /* @__PURE__ */ y(x, {
313
+ "data-slot": "icon-button",
314
+ "data-icon-button": "",
315
+ "data-variant": t ?? "filled",
316
+ "data-color": i,
317
+ type: u ? void 0 : d,
318
+ "data-size": T,
319
+ "data-shape": p,
320
+ "data-morph": k ? m : void 0,
321
+ "data-selected": k && A ? "true" : void 0,
322
+ className: e(p ? w({
323
+ variant: t,
324
+ color: i,
325
+ size: T
326
+ }) : C({
327
+ variant: t,
328
+ color: i,
329
+ size: T,
330
+ width: c
331
+ }), p && "group/icon-button nxgt-touch-target 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]", l),
332
+ ...b,
333
+ children: [p ? /* @__PURE__ */ v(E, {
334
+ shape: p,
335
+ variant: t ?? "filled",
336
+ color: i ?? (t === "ghost" ? "default" : "primary")
337
+ }) : null, /* @__PURE__ */ v(n, { children: _ })]
338
+ })
339
+ });
340
+ }
341
+ function O({ tooltip: e, "aria-label": t, ...n }) {
342
+ let r = t ?? (typeof e == "string" ? e : void 0);
343
+ return e ? /* @__PURE__ */ v(a, {
344
+ content: e,
345
+ children: /* @__PURE__ */ v(D, {
346
+ "aria-label": r,
347
+ ...n
348
+ })
349
+ }) : /* @__PURE__ */ v(D, {
350
+ "aria-label": r,
351
+ ...n
352
+ });
353
+ }
354
+ //#endregion
355
+ export { C as n, O as t };
@@ -1,7 +1,7 @@
1
1
  import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
2
2
  import { t } from "./is-production-GLw59WU8.js";
3
3
  import { n, r } from "./icon-sprites-FxHyqyhg.js";
4
- import { a as i, c as a, i as o, l as s, t as c, u as l } from "./state-scenes-SGNyZjTz.js";
4
+ import { a as i, c as a, i as o, l as s, t as c, u as l } from "./state-scenes-BX03WmSu.js";
5
5
  import { t as u } from "./scene-svg-DJKa5vsg.js";
6
6
  import { Suspense as d, useId as f, useMemo as p } from "react";
7
7
  import { jsx as m } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { s as e } from "./state-scenes-SGNyZjTz.js";
2
- import { t } from "./illustration-BfHRpVzM.js";
1
+ import { s as e } from "./state-scenes-BX03WmSu.js";
2
+ import { t } from "./illustration-BmQmvW_4.js";
3
3
  import { ILLUSTRATION_SCENES as n, SUGGESTED_ICONS as r } from "@nxgt/material-core/illustrations";
4
4
  export { n as ILLUSTRATION_SCENES, t as Illustration, e as IllustrationDefaults, r as SUGGESTED_ICONS };
@@ -34,3 +34,19 @@ export declare const toneStroke: {
34
34
  readonly error: "[&_svg]:stroke-[color-mix(in_oklab,var(--color-error)_85%,black)] dark:[&_svg]:stroke-[color-mix(in_oklab,var(--color-error)_70%,white)]";
35
35
  readonly default: "[&_svg]:stroke-foreground";
36
36
  };
37
+ /**
38
+ * The per-`color` variables the expressive look of `Button` reads (and
39
+ * `IconButton` will, in the same names): `--morph-on` / `--morph-on-fg` the
40
+ * solid fill of a selected button and its text, `--btn-focus` the focus
41
+ * outline, `--btn-line` the outlined variant's line. They follow the filled
42
+ * variant's fills and the tone text above, dark theme included.
43
+ */
44
+ export declare const toneVars: {
45
+ readonly primary: "[--morph-on:var(--color-primary)] [--morph-on-fg:var(--color-primary-foreground)] [--btn-focus:var(--color-primary-text)] [--btn-line:var(--color-primary)]";
46
+ readonly secondary: "[--morph-on:var(--color-secondary)] dark:[--morph-on:color-mix(in_oklab,var(--color-secondary)_70%,var(--color-background))] [--morph-on-fg:var(--color-secondary-foreground)] [--btn-focus:var(--color-secondary)] [--btn-line:var(--color-secondary)]";
47
+ readonly success: "[--morph-on:var(--color-success)] dark:[--morph-on:color-mix(in_oklab,var(--color-success)_60%,var(--color-background))] [--morph-on-fg:var(--color-success-foreground)] [--btn-focus:var(--color-success)] dark:[--btn-focus:color-mix(in_oklab,var(--color-success)_85%,white)] [--btn-line:var(--color-success)]";
48
+ readonly info: "[--morph-on:var(--color-info)] dark:[--morph-on:color-mix(in_oklab,var(--color-info)_60%,var(--color-background))] [--morph-on-fg:var(--color-info-foreground)] [--btn-focus:var(--color-info)] [--btn-line:var(--color-info)]";
49
+ readonly warning: "[--morph-on:var(--color-warning)] dark:[--morph-on:color-mix(in_oklab,var(--color-warning)_60%,var(--color-background))] [--morph-on-fg:var(--color-warning-foreground)] [--btn-focus:color-mix(in_oklab,var(--color-warning)_85%,black)] dark:[--btn-focus:color-mix(in_oklab,var(--color-warning)_85%,white)] [--btn-line:var(--color-warning)]";
50
+ readonly error: "[--morph-on:var(--color-error)] [--morph-on-fg:var(--color-error-foreground)] [--btn-focus:color-mix(in_oklab,var(--color-error)_85%,black)] dark:[--btn-focus:color-mix(in_oklab,var(--color-error)_70%,white)] [--btn-line:var(--color-error)]";
51
+ readonly default: "[--morph-on:var(--color-foreground)] [--morph-on-fg:var(--color-background)] [--btn-focus:var(--color-foreground)] [--btn-line:var(--color-foreground)]";
52
+ };
@@ -24,6 +24,19 @@ export type ButtonProps = ComponentProps<'button'> & ButtonVariants & {
24
24
  * shorter than its `size`. Without it a long label is truncated.
25
25
  */
26
26
  wrap?: boolean;
27
+ /**
28
+ * `round` (default) rests as a pill and squares when pressed; `square`
29
+ * rests with the size's corner radius and rounds when pressed. Every
30
+ * corner springs, and stays at least 4px. Reduced motion: no squeeze.
31
+ */
32
+ shape?: 'round' | 'square';
33
+ /**
34
+ * A toggle: sets `aria-pressed` and `data-selected`, takes the other
35
+ * shape and a solid fill of its colour. Leave it out for a plain
36
+ * button. Ignored with `asChild` (the child owns its attributes; a
37
+ * warning in development).
38
+ */
39
+ selected?: boolean;
27
40
  } & {
28
41
  tooltip?: string;
29
42
  };
@@ -2,11 +2,12 @@ import { VariantProps } from 'class-variance-authority';
2
2
  declare const buttonVariantsByColor: (props?: ({
3
3
  variant?: "tonal" | "filled" | "link" | "ghost" | "outlined" | null | undefined;
4
4
  color?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "default" | null | undefined;
5
- size?: "default" | "sm" | "icon" | "xs" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
5
+ size?: "lg" | "sm" | "default" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "xs" | "xl" | "2xl" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  /**
8
- * On a ghost one, `color: null` reads as the default colour, so it keeps
9
- * its neutral hover (cva matches no compound variant on `null`).
8
+ * On a ghost one, no `color` (or `null`) is the neutral look: the default
9
+ * colour's, a hover tint of the page. A ghost button tinted by a colour is one
10
+ * given its `color` (cva matches no compound variant on `null`).
10
11
  */
11
12
  export declare const buttonVariants: typeof buttonVariantsByColor;
12
13
  export type ButtonVariants = VariantProps<typeof buttonVariants>;
@@ -0,0 +1,16 @@
1
+ import { ButtonVariants } from '../button/button.variants.js';
2
+ import { IconButtonSize } from '../icon-button/icon-button.variants.js';
3
+ /**
4
+ * The sizes a group can share: the ladder `Button` and `IconButton` have in
5
+ * common (`xs`, `sm`, `default`, `lg`, `xl`), taken from both types so a size
6
+ * added to one and not the other drops out of it instead of drifting.
7
+ */
8
+ export type ButtonGroupSize = Extract<NonNullable<ButtonVariants['size']>, IconButtonSize>;
9
+ /**
10
+ * The `size` of the enclosing `ButtonGroup`, read by `Button` and
11
+ * `IconButton` when they get no `size` of their own (an explicit one wins).
12
+ * `undefined` outside a group, or in one without a `size`.
13
+ *
14
+ * Internal: not exported from the barrel.
15
+ */
16
+ export declare const ButtonGroupContext: import('react').Context<ButtonGroupSize | undefined>;
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Puts the shared `ButtonGroup` size back to "none" for what it wraps. React
4
+ * context crosses a portal, so an overlay opened from a button inside a
5
+ * `ButtonGroup size="xs"` would give its own buttons that size; the overlay
6
+ * contents (Dialog, Sheet, Drawer, Popover, AlertDialog) wrap themselves in
7
+ * this.
8
+ *
9
+ * Internal: not exported from the barrel.
10
+ */
11
+ export declare function ButtonGroupReset({ children }: {
12
+ children: ReactNode;
13
+ }): import("react").JSX.Element;
@@ -1,3 +1,20 @@
1
1
  import { ComponentProps } from 'react';
2
- export type ButtonGroupProps = {} & ComponentProps<'div'>;
3
- export declare function ButtonGroup({ children, className, ...props }: ButtonGroupProps): import("react").JSX.Element;
2
+ import { ButtonGroupSize } from './button-group-context.js';
3
+ export type { ButtonGroupSize } from './button-group-context.js';
4
+ export type ButtonGroupProps = {
5
+ /**
6
+ * `standard`: the Material 3 Expressive action group. The buttons keep
7
+ * their own look, 8px apart, and a pressed one widens by 14px on each side
8
+ * (less at `xs`, `sm` and `default`) while its neighbours give the width back, so the
9
+ * group never changes width. Reduced motion: no exchange. Unset: the
10
+ * original group (a bare `<div>` that tints and rounds its buttons). `standard` becomes
11
+ * the default in the next major, with `look="legacy"` to keep the original.
12
+ */
13
+ look?: 'standard';
14
+ /**
15
+ * The `size` every `Button` and `IconButton` in the group takes; one with
16
+ * a `size` of its own keeps it. Works with either look.
17
+ */
18
+ size?: ButtonGroupSize;
19
+ } & ComponentProps<'div'>;
20
+ export declare function ButtonGroup({ children, className, look, size, ...props }: ButtonGroupProps): import("react").JSX.Element;
@@ -5,11 +5,12 @@ export type IconButtonColor = keyof (typeof SURFACE)['filled'];
5
5
  /**
6
6
  * What a shaped `IconButton` adds to its classes: its own background,
7
7
  * border and box-shadow (the focus ring) give way to the surface below,
8
- * so nothing is clipped and the ring follows the shape. In forced colours
8
+ * so nothing is clipped and the ring follows the shape; `nxgt-touch-target`
9
+ * gives it the 44px hit area of a coarse pointer. In forced colours
9
10
  * the icon takes `ButtonText`: a filled variant's light stroke would
10
11
  * vanish on the forced background.
11
12
  */
12
- export declare const SHAPED_BUTTON = "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]";
13
+ export declare const SHAPED_BUTTON = "group/icon-button nxgt-touch-target 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]";
13
14
  /**
14
15
  * The surface of a shaped `IconButton`: one SVG path behind the icon,
15
16
  * filled in the variant's colour, lighter or darker on hover and press,
@@ -1,17 +1,31 @@
1
1
  import { ShapeName } from '@nxgt/material-core/shapes';
2
- import { VariantProps } from 'class-variance-authority';
3
2
  import { ComponentProps, ReactNode } from 'react';
4
- import { variants } from './icon-button.variants.js';
3
+ import { IconButtonVariants, variants } from './icon-button.variants.js';
5
4
  export { variants } from './icon-button.variants.js';
6
5
  export type IconButtonProps = {
7
6
  asChild?: boolean;
8
- } & ComponentProps<'button'> & VariantProps<typeof variants> & {
7
+ } & ComponentProps<'button'> & Omit<IconButtonVariants, 'size' | 'width'> & {
8
+ /**
9
+ * `xs` 24px, `sm` 32px, `default` 36px, `lg` 40px or `xl` 56px, with an
10
+ * icon of 14, 16, 18, 20 or 28px (a glyph without its own `size-*` class;
11
+ * an `Icon` is 16px unless sized). Unset: the 36px button with a 16px
12
+ * icon it always was, so an explicit `default` has an 18px icon and unset
13
+ * a 16px one (a `size-*` class still resizes it).
14
+ */
15
+ size?: IconButtonVariants['size'];
16
+ /**
17
+ * The width as a factor of the height: `narrow` 0.78, `default` 1,
18
+ * `wide` 1.45; always a pill. Ignored with `shape` (a warning in
19
+ * development).
20
+ */
21
+ width?: IconButtonVariants['width'];
9
22
  tooltip?: ReactNode;
10
23
  /**
11
24
  * Draws the button as one of the expressive shapes (`cookie-9`,
12
25
  * `sunny`, `squircle`…) instead of a circle. The shape carries the
13
26
  * variant's colours and the focus ring, and morphs when it changes
14
- * (a selected state). Unset: the round button, unchanged.
27
+ * (a selected state). Unset: the round button, unchanged. A shaped
28
+ * button ignores `width` (a warning in development).
15
29
  */
16
30
  shape?: ShapeName;
17
31
  /**
@@ -1,11 +1,41 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ /**
3
+ * The classes of each `size`, written out whole so Tailwind finds them. A
4
+ * ladder of variables, read by `button.css` (the shared look) and
5
+ * `icon-button.css`: `--btn-h` the height (and so the round radius,
6
+ * `--btn-h / 2`), `--ib-k` the width as a factor of it (`width`), `--btn-ic`
7
+ * the icon, `--btn-sq` the square radius. `legacy` is a button without a
8
+ * `size`: the 36px, 16px-icon button it always was, in rem like `size-9`.
9
+ * `scripts/button-radius.spec.ts` reads the heights and radii back from here.
10
+ */
11
+ export declare const iconButtonSizeClasses: {
12
+ readonly legacy: "h-9 w-[calc(2.25rem*var(--ib-k,1))] [--btn-h:2.25rem] [--btn-sq:10px] [--btn-ic:1rem] has-[[data-slot=icon]]:p-1.5";
13
+ readonly xs: "h-(--btn-h) w-[calc(var(--btn-h)*var(--ib-k,1))] [--btn-h:24px] [--btn-sq:6px] [--btn-ic:14px]";
14
+ readonly sm: "h-(--btn-h) w-[calc(var(--btn-h)*var(--ib-k,1))] [--btn-h:32px] [--btn-sq:8px] [--btn-ic:16px]";
15
+ readonly default: "h-(--btn-h) w-[calc(var(--btn-h)*var(--ib-k,1))] [--btn-h:36px] [--btn-sq:10px] [--btn-ic:18px]";
16
+ readonly lg: "h-(--btn-h) w-[calc(var(--btn-h)*var(--ib-k,1))] [--btn-h:40px] [--btn-sq:12px] [--btn-ic:20px]";
17
+ readonly xl: "h-(--btn-h) w-[calc(var(--btn-h)*var(--ib-k,1))] [--btn-h:56px] [--btn-sq:16px] [--btn-ic:28px]";
18
+ };
19
+ export type IconButtonSize = Exclude<keyof typeof iconButtonSizeClasses, 'legacy'>;
20
+ export type IconButtonWidth = 'narrow' | 'default' | 'wide';
1
21
  declare const variantsByColor: (props?: ({
22
+ look?: "btn" | "shaped" | null | undefined;
23
+ size?: "lg" | "sm" | "default" | "xs" | "xl" | "legacy" | null | undefined;
24
+ width?: "default" | "narrow" | "wide" | null | undefined;
2
25
  variant?: "tonal" | "filled" | "link" | "ghost" | "outlined" | null | undefined;
3
26
  color?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "default" | null | undefined;
4
27
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
28
+ type Props = Parameters<typeof variantsByColor>[0];
29
+ /** What `iconButtonVariants` takes: `size` is optional and has no `legacy`. */
30
+ export type IconButtonVariantProps = Omit<NonNullable<Props>, 'look' | 'size'> & {
31
+ size?: IconButtonSize | null;
32
+ };
5
33
  /**
6
- * `IconButton`'s variant × color classes. On a ghost one, `color: null`
7
- * reads as the default colour, so it keeps its neutral hover (cva matches
8
- * no compound variant on `null`).
34
+ * `IconButton`'s variant x color x size x width classes. On a ghost one,
35
+ * `color: null` reads as the default colour, so it keeps its neutral hover.
9
36
  */
10
- export declare const variants: typeof variantsByColor;
37
+ export declare const variants: (props?: IconButtonVariantProps) => string;
38
+ /** The same classes for a button drawn as a shape (`shape`): it keeps its own ring and surface. */
39
+ export declare const shapedVariants: (props?: IconButtonVariantProps) => string;
40
+ export type IconButtonVariants = VariantProps<typeof variants>;
11
41
  export {};
@@ -1,9 +1,14 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import { ComponentProps } from 'react';
3
+ import { Tone } from '../../tones.js';
3
4
  declare const badgeVariants: (props?: ({
4
- variant?: "secondary" | "success" | "info" | "warning" | "error" | "default" | "outlined" | null | undefined;
5
+ variant?: "secondary" | "success" | "info" | "warning" | "error" | "default" | "outlined" | "soft" | null | undefined;
5
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
- declare function Badge({ className, variant, asChild, ...props }: ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
+ /** The tone of a `soft` or `outlined` badge: a named tone or one the app declared in `AppTones`. */
8
+ export type BadgeTone = Tone;
9
+ declare function Badge({ className, variant, tone, asChild, ...props }: ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
10
  asChild?: boolean;
11
+ /** The colour of a `soft` or `outlined` badge (neutral without one). */
12
+ tone?: BadgeTone;
8
13
  }): import("react").JSX.Element;
9
14
  export { Badge, badgeVariants };
@@ -1,5 +1,7 @@
1
1
  import { IconButtonProps } from '../../actions/icon-button/icon-button.js';
2
2
  import { ResponsiveButtonProps } from '../../actions/responsive-button/responsive-button.js';
3
+ import { EntityStat } from './entity-stats.js';
4
+ export type { EntityStat } from './entity-stats.js';
3
5
  export type EntityHeaderProps = {
4
6
  icon?: React.ReactNode;
5
7
  /**
@@ -13,6 +15,12 @@ export type EntityHeaderProps = {
13
15
  label: string;
14
16
  value: React.ReactNode;
15
17
  }[];
18
+ /**
19
+ * Figures (counts, a mean) shown as compact tiles in a wrapping row under
20
+ * the metadata; facts (dates, names) stay in `metadata`. A `tone` paints
21
+ * the tile; `0` is a figure, an empty value drops the tile.
22
+ */
23
+ stats?: EntityStat[];
16
24
  actions?: ResponsiveButtonProps[] | React.ReactNode;
17
25
  } & Pick<IconButtonProps, 'variant' | 'color'> & Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>;
18
- export declare function EntityHeader({ color, variant, icon, title, status, metadata, actions, className, children, ...props }: EntityHeaderProps): import("react").JSX.Element;
26
+ export declare function EntityHeader({ color, variant, icon, title, status, metadata, stats, actions, className, children, ...props }: EntityHeaderProps): import("react").JSX.Element;