@nxgt/material 3.48.0 → 3.50.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 +32 -0
- package/README.md +3 -3
- package/dist/{async-slice-DlvKCKAa.js → async-slice-3loEtzUY.js} +2 -2
- package/dist/{button-yaltbQmC.js → button-BRUaHD8z.js} +81 -112
- package/dist/charts.js +144 -144
- package/dist/{chip-BqWbbr1b.js → chip-DneTrtNj.js} +56 -56
- package/dist/{code-editor-C9qBNoYb.js → code-editor-R_nPN_-d.js} +308 -308
- package/dist/code-editor.js +47 -47
- package/dist/{code-language-items-DAHtfQ7W.js → code-language-items-BKEUhQlF.js} +2 -2
- package/dist/components/components.css +1 -0
- package/dist/components/ui/actions/action-card/action-card-indicator.css +48 -0
- package/dist/components/ui/actions/action-card/action-card-modes.css +4 -1
- package/dist/components/ui/actions/action-card/action-card-tile.css +141 -0
- package/dist/components/ui/actions/action-card/action-card.css +33 -3
- package/dist/{components-Ox6FHmpx.js → components-D6xFLcoE.js} +17646 -17567
- package/dist/components.js +26 -27
- package/dist/{dialog-CCCcnTIx.js → dialog-S7dLsYRZ.js} +16 -16
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-Df8785nt.js → dropdown-menu-XLlxfDgq.js} +271 -272
- package/dist/editor.js +1028 -1028
- package/dist/{empty-state-DcF4TBzi.js → empty-state-Dsf6R-Zo.js} +37 -37
- package/dist/{escape-owner-C4W_sOAU.js → escape-owner-B9eCwjLw.js} +1 -1
- package/dist/{field-blur-CJHzVSh9.js → field-blur-5uRDFHvB.js} +1 -1
- package/dist/{field-blur-context-Cft9s7Hg.js → field-blur-context-Cwt4TuBq.js} +1 -1
- package/dist/hooks.js +4 -4
- package/dist/{hover-card-C0fw2kLK.js → hover-card-PHUgRSjJ.js} +24 -24
- package/dist/{i18n-provider-C0fB0sEL.js → i18n-provider-DPM_ALQ4.js} +1 -1
- package/dist/i18n.js +5 -5
- package/dist/{icon-badge-aJ22mKGh.js → icon-badge-Dh6-FNOF.js} +3 -3
- package/dist/{icon-button-CN9r5TNE.js → icon-button-DSC2-IAG.js} +118 -86
- package/dist/lib/components/ui/actions/action-card/action-card-semantics.d.ts +25 -2
- package/dist/lib/components/ui/actions/action-card/action-card.d.ts +18 -2
- package/dist/lib/components/ui/actions/action-card/partials/action-card-icon.d.ts +6 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-meta.d.ts +15 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-status.d.ts +6 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-text.d.ts +20 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-title-button.d.ts +14 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-trail.d.ts +6 -0
- package/dist/lib/components/ui/actions/action-card/use-action-card-names.d.ts +22 -0
- package/dist/lib/components/ui/actions/action-card/use-reveal.d.ts +23 -0
- package/dist/lib/components/ui/actions/button/button.variants.d.ts +1 -1
- package/dist/lib/components/ui/actions/icon-button/icon-button-busy.d.ts +22 -0
- package/dist/lib/components/ui/actions/icon-button/icon-button-shape.d.ts +2 -0
- package/dist/lib/components/ui/actions/icon-button/icon-button.d.ts +7 -0
- package/dist/lib/components/ui/actions/icon-button/icon-button.variants.d.ts +1 -1
- package/dist/lib/components/ui/collections/filter/bar/partials/filter-quick-toggle.d.ts +3 -2
- package/dist/lib/components/ui/collections/filter/sections/filter-sections-classes.d.ts +7 -1
- package/dist/lib/components/ui/collections/page-footer/page-footer.d.ts +6 -1
- package/dist/lib/components/ui/collections/row-menu/row-menu-trigger.d.ts +5 -2
- package/dist/lib/components/ui/collections/row-menu/row-menu.d.ts +1 -1
- package/dist/lib/components/ui/collections/server-table/index.d.ts +1 -1
- package/dist/lib/components/ui/collections/server-table/partials/server-table-empty-chips.d.ts +5 -3
- package/dist/lib/components/ui/collections/server-table/types-paging.d.ts +17 -0
- package/dist/lib/components/ui/collections/server-table/types.d.ts +3 -10
- package/dist/lib/components/ui/dates/duration-field/partials/use-duration-box.d.ts +1 -1
- package/dist/lib/components/ui/display/badge/badge.d.ts +1 -1
- package/dist/lib/components/ui/display/day-separator/day-separator.d.ts +1 -1
- package/dist/lib/components/ui/feedback/step-up-dialog/partials/step-up-body.d.ts +5 -3
- package/dist/lib/components/ui/feedback/step-up-dialog/partials/step-up-request-error.d.ts +15 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/step-up-dialog.d.ts +6 -3
- package/dist/lib/components/ui/feedback/step-up-dialog/types.d.ts +12 -1
- package/dist/lib/components/ui/feedback/step-up-dialog/use-retry-focus.d.ts +27 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/use-retry.d.ts +11 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/slider/split-slider-props.d.ts +20 -20
- package/dist/lib/components/ui/fields/slider/use-slider-control.d.ts +20 -20
- package/dist/lib/components/ui/fields/verification-code/use-settled-focus.d.ts +10 -0
- package/dist/lib/components/ui/layout/app-shell/route-transition.d.ts +1 -1
- package/dist/lib/components/ui/media/carousel/use-carousel-engine.d.ts +1 -1
- package/dist/lib/components/ui/media/media-player/engine/use-queue-actions.d.ts +1 -1
- package/dist/lib/components/ui/media/pdf-reader/pdf-reader.slice.d.ts +1 -1
- package/dist/lib/components/ui/selection/choice-group/use-choice-group-field.d.ts +34 -34
- package/dist/lib/components/ui/widgets/chat/chat-message.variants.d.ts +2 -2
- package/dist/lib/components/ui/widgets/event-calendar/use-event-calendar.d.ts +1 -1
- package/dist/lib/i18n/resources/en/en.d.ts +1 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +2 -1
- package/dist/lib/i18n/resources/fr/fr.d.ts +1 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +2 -1
- package/dist/lib/i18n/resources/resources.d.ts +2 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +43 -44
- package/dist/map.js +79 -79
- package/dist/material.css +1 -1
- package/dist/nxgt-theme-ivgNca3z.js +37 -0
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +2 -2
- package/dist/{public-zVb_Nq_D.js → public-vxiijIJF.js} +82 -82
- package/dist/{rich-code-block-DMWZZJma.js → rich-code-block-BwvCXPqq.js} +52 -52
- package/dist/{sortable-provider-DstbgMVf.js → sortable-provider-D2pAFWQB.js} +218 -218
- package/dist/{tooltip-CkttDIab.js → spinner-BpVwI1ps.js} +503 -278
- package/dist/{stored-language-IaL1Ftn_.js → stored-language-Beyj2ult.js} +4 -2
- package/dist/theme-picker.js +45 -45
- package/dist/{theme-store-CSl51uNH.js → theme-store-BdPp43cV.js} +13 -13
- package/dist/{theme-toggle-CGW2_K54.js → theme-toggle-BTYRPkP4.js} +16 -16
- package/dist/themes.js +17 -17
- package/dist/{toggle-group-BMJNcFAC.js → toggle-group-BkH23Jk4.js} +11 -11
- package/dist/{toolbar-items-CsLGJMEJ.js → toolbar-items-CIMo4F9q.js} +421 -421
- package/dist/{translate-material-v9u-e7Kd.js → translate-material-DEUlaL_1.js} +2 -2
- package/dist/{translator-Dk4_qE6U.js → translator-CBgIb3zP.js} +1 -1
- package/dist/{use-chat-composer-Brcb5f7r.js → use-chat-composer-D8UAsX0f.js} +6228 -5999
- package/dist/{button-tones-BwuVvAmd.js → use-click-lock-BZYtTmVt.js} +37 -7
- package/dist/{use-heading-spy-DjKixjLm.js → use-heading-spy-C5LXtA8Z.js} +1 -1
- package/dist/{use-material-translation-DOkTaWK_.js → use-material-translation-DWWeeg-B.js} +2 -2
- package/dist/{use-theme-DMcyJ52N.js → use-theme-BCLireTd.js} +1 -1
- package/docs/components/buttons-and-actions.md +64 -5
- package/docs/components/data-table-filter-and-lists.md +30 -10
- package/docs/components/feedback-and-status.md +22 -3
- package/docs/components/form-fields.md +7 -0
- package/docs/guides/cards-and-tiles.md +60 -0
- package/docs/guides/server-lists-url.md +3 -2
- package/docs/roadmap.md +11 -0
- package/lib/components/components.css +1 -0
- package/lib/components/ui/actions/action-card/action-card-indicator.css +48 -0
- package/lib/components/ui/actions/action-card/action-card-modes.css +4 -1
- package/lib/components/ui/actions/action-card/action-card-tile.css +141 -0
- package/lib/components/ui/actions/action-card/action-card.css +33 -3
- package/package.json +1 -1
- package/dist/nxgt-theme-ZS945iMP.js +0 -37
- package/dist/spinner-C4CgDEYm.js +0 -229
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
import { t as
|
|
8
|
-
import { shapeOutline as
|
|
9
|
-
import { useContext as
|
|
10
|
-
import { jsx as
|
|
2
|
+
import { t } from "./is-production-GLw59WU8.js";
|
|
3
|
+
import { n } from "./use-shape-morph-BKA_R5P5.js";
|
|
4
|
+
import { n as r, t as i } from "./dist-DVRQkaTK.js";
|
|
5
|
+
import { n as a, r as o, t as s } from "./spinner-BpVwI1ps.js";
|
|
6
|
+
import { a as c, i as l, n as u, o as d, r as f, s as p, t as m } from "./use-click-lock-BZYtTmVt.js";
|
|
7
|
+
import { t as h } from "./button-group-context-CaP0X5p_.js";
|
|
8
|
+
import { shapeOutline as g, toSvgPath as _ } from "@nxgt/material-core/shapes";
|
|
9
|
+
import { useContext as v, useEffect as y, useRef as b } from "react";
|
|
10
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
11
11
|
//#region lib/components/ui/display/count-badge/format-count.ts
|
|
12
|
-
function
|
|
12
|
+
function C(e, t = 99) {
|
|
13
13
|
let n = Math.max(0, Math.round(e));
|
|
14
14
|
return n > t ? `${t}+` : String(n);
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region lib/components/ui/actions/icon-button/icon-button.compound-variants.ts
|
|
18
|
-
var
|
|
18
|
+
var w = [
|
|
19
19
|
{
|
|
20
20
|
variant: "filled",
|
|
21
21
|
color: "primary",
|
|
@@ -54,37 +54,37 @@ var x = [
|
|
|
54
54
|
{
|
|
55
55
|
variant: "tonal",
|
|
56
56
|
color: "primary",
|
|
57
|
-
class: `${
|
|
57
|
+
class: `${l.primary} ${u.primary} ${f.primary} bg-primary/15 hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/10`
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
variant: "tonal",
|
|
61
61
|
color: "secondary",
|
|
62
|
-
class: `${
|
|
62
|
+
class: `${l.secondary} ${u.secondary} ${f.secondary} bg-secondary/15 hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
variant: "tonal",
|
|
66
66
|
color: "success",
|
|
67
|
-
class: `${
|
|
67
|
+
class: `${l.success} ${u.success} ${f.success} bg-success/15 hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
variant: "tonal",
|
|
71
71
|
color: "info",
|
|
72
|
-
class: `${
|
|
72
|
+
class: `${l.info} ${u.info} ${f.info} bg-info/15 hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
variant: "tonal",
|
|
76
76
|
color: "warning",
|
|
77
|
-
class: `${
|
|
77
|
+
class: `${l.warning} ${u.warning} ${f.warning} bg-warning/15 hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
variant: "tonal",
|
|
81
81
|
color: "error",
|
|
82
|
-
class: `${
|
|
82
|
+
class: `${l.error} ${u.error} ${f.error} bg-error/15 hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
variant: "tonal",
|
|
86
86
|
color: "default",
|
|
87
|
-
class: `${
|
|
87
|
+
class: `${l.default} ${u.default} ${f.default} bg-foreground/15 hover:bg-foreground/10 active:bg-muted focus:bg-muted`
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
variant: "ghost",
|
|
@@ -99,99 +99,99 @@ var x = [
|
|
|
99
99
|
{
|
|
100
100
|
variant: "ghost",
|
|
101
101
|
color: "secondary",
|
|
102
|
-
class: `${
|
|
102
|
+
class: `${l.secondary} ${u.secondary} ${f.secondary} hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
variant: "ghost",
|
|
106
106
|
color: "success",
|
|
107
|
-
class: `${
|
|
107
|
+
class: `${l.success} ${u.success} ${f.success} hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
variant: "ghost",
|
|
111
111
|
color: "info",
|
|
112
|
-
class: `${
|
|
112
|
+
class: `${l.info} ${u.info} ${f.info} hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
variant: "ghost",
|
|
116
116
|
color: "warning",
|
|
117
|
-
class: `${
|
|
117
|
+
class: `${l.warning} ${u.warning} ${f.warning} hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
variant: "ghost",
|
|
121
121
|
color: "error",
|
|
122
|
-
class: `${
|
|
122
|
+
class: `${l.error} ${u.error} ${f.error} hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
variant: "outlined",
|
|
126
126
|
color: "primary",
|
|
127
|
-
class: `${
|
|
127
|
+
class: `${l.primary} ${u.primary} ${f.primary} focus:bg-primary/10 hover:bg-primary/10`
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
variant: "outlined",
|
|
131
131
|
color: "secondary",
|
|
132
|
-
class: `${
|
|
132
|
+
class: `${l.secondary} ${u.secondary} ${f.secondary} focus:bg-secondary/10 hover:bg-secondary/10`
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
variant: "outlined",
|
|
136
136
|
color: "success",
|
|
137
|
-
class: `${
|
|
137
|
+
class: `${l.success} ${u.success} ${f.success} focus:bg-success/10 hover:bg-success/10`
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
variant: "outlined",
|
|
141
141
|
color: "info",
|
|
142
|
-
class: `${
|
|
142
|
+
class: `${l.info} ${u.info} ${f.info} focus:bg-info/10 hover:bg-info/10`
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
variant: "outlined",
|
|
146
146
|
color: "warning",
|
|
147
|
-
class: `${
|
|
147
|
+
class: `${l.warning} ${u.warning} ${f.warning} focus:bg-warning/10 hover:bg-warning/10`
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
variant: "outlined",
|
|
151
151
|
color: "error",
|
|
152
|
-
class: `${
|
|
152
|
+
class: `${l.error} ${u.error} ${f.error} focus:bg-error/10 hover:bg-error/10`
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
155
|
variant: "outlined",
|
|
156
156
|
color: "default",
|
|
157
|
-
class: `${
|
|
157
|
+
class: `${l.default} ${u.default} ${f.default} focus:bg-foreground/10 hover:bg-foreground/10`
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
variant: "link",
|
|
161
161
|
color: "primary",
|
|
162
|
-
class: `${
|
|
162
|
+
class: `${l.primary} ${u.primary} ${f.primary} underline-offset-4 hover:underline hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/10`
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
variant: "link",
|
|
166
166
|
color: "secondary",
|
|
167
|
-
class: `${
|
|
167
|
+
class: `${l.secondary} ${u.secondary} ${f.secondary} underline-offset-4 hover:underline hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
170
|
variant: "link",
|
|
171
171
|
color: "success",
|
|
172
|
-
class: `${
|
|
172
|
+
class: `${l.success} ${u.success} ${f.success} underline-offset-4 hover:underline hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
|
|
173
173
|
},
|
|
174
174
|
{
|
|
175
175
|
variant: "link",
|
|
176
176
|
color: "info",
|
|
177
|
-
class: `${
|
|
177
|
+
class: `${l.info} ${u.info} ${f.info} underline-offset-4 hover:underline hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
180
|
variant: "link",
|
|
181
181
|
color: "warning",
|
|
182
|
-
class: `${
|
|
182
|
+
class: `${l.warning} ${u.warning} ${f.warning} underline-offset-4 hover:underline hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
variant: "link",
|
|
186
186
|
color: "error",
|
|
187
|
-
class: `${
|
|
187
|
+
class: `${l.error} ${u.error} ${f.error} underline-offset-4 hover:underline hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
|
|
188
188
|
},
|
|
189
189
|
{
|
|
190
190
|
variant: "link",
|
|
191
191
|
color: "default",
|
|
192
|
-
class: `${
|
|
192
|
+
class: `${l.default} ${u.default} ${f.default} underline-offset-4 hover:underline hover:bg-foreground/10 active:bg-muted focus:bg-foreground/10`
|
|
193
193
|
}
|
|
194
|
-
],
|
|
194
|
+
], T = a("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", {
|
|
195
195
|
variants: {
|
|
196
196
|
look: {
|
|
197
197
|
btn: "nxgt-btn nxgt-morph-fill aria-invalid:[--btn-focus:var(--color-error)] aria-invalid:[--btn-line:var(--color-error)]",
|
|
@@ -226,22 +226,45 @@ var x = [
|
|
|
226
226
|
size: "legacy",
|
|
227
227
|
width: "default"
|
|
228
228
|
},
|
|
229
|
-
compoundVariants: [...
|
|
229
|
+
compoundVariants: [...w, {
|
|
230
230
|
look: "btn",
|
|
231
231
|
size: "legacy",
|
|
232
232
|
width: "default",
|
|
233
233
|
class: "[--btn-round:50%]"
|
|
234
234
|
}]
|
|
235
235
|
});
|
|
236
|
-
function
|
|
237
|
-
return (t) =>
|
|
236
|
+
function E(e) {
|
|
237
|
+
return (t) => T({
|
|
238
238
|
...t,
|
|
239
239
|
look: e,
|
|
240
240
|
size: t?.size ?? "legacy",
|
|
241
241
|
color: t?.variant === "ghost" && t.color == null ? "default" : t?.color
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
|
-
var
|
|
244
|
+
var D = E("btn"), O = E("shaped");
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region lib/components/ui/actions/icon-button/icon-button-busy.tsx
|
|
247
|
+
function k(e, t) {
|
|
248
|
+
let n = m(!1, e);
|
|
249
|
+
return {
|
|
250
|
+
busyClassName: e ? "relative [&_[data-slot=icon]]:invisible" : void 0,
|
|
251
|
+
hostProps: {
|
|
252
|
+
"aria-disabled": e || t["aria-disabled"],
|
|
253
|
+
"aria-busy": e || t["aria-busy"],
|
|
254
|
+
onClickCapture: d(e, n, t.onClickCapture)
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
function A({ variant: e, color: t }) {
|
|
259
|
+
return /* @__PURE__ */ x(s, {
|
|
260
|
+
variant: "2",
|
|
261
|
+
color: e === "filled" ? "light" : t ?? (e === "ghost" ? "default" : "primary"),
|
|
262
|
+
className: "absolute inset-0 m-auto size-(--btn-ic,1rem)"
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region lib/components/ui/actions/icon-button/icon-button-surface.ts
|
|
267
|
+
var j = {
|
|
245
268
|
filled: {
|
|
246
269
|
primary: "fill-primary",
|
|
247
270
|
secondary: "fill-secondary dark:fill-[color-mix(in_oklab,var(--color-secondary)_70%,var(--color-background))]",
|
|
@@ -288,87 +311,96 @@ var w = C("btn"), T = C("shaped"), E = {
|
|
|
288
311
|
default: "fill-transparent group-hover/icon-button:fill-accent dark:group-hover/icon-button:fill-accent/50"
|
|
289
312
|
}
|
|
290
313
|
};
|
|
291
|
-
function
|
|
292
|
-
let a =
|
|
293
|
-
return
|
|
314
|
+
function M({ shape: t, variant: r, color: i }) {
|
|
315
|
+
let a = g(t), o = b(null);
|
|
316
|
+
return n(o, a, !0), /* @__PURE__ */ x("svg", {
|
|
294
317
|
"data-slot": "icon-button-shape",
|
|
295
318
|
viewBox: "0 0 100 100",
|
|
296
319
|
"aria-hidden": "true",
|
|
297
320
|
focusable: "false",
|
|
298
321
|
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"),
|
|
299
|
-
children: /* @__PURE__ */
|
|
322
|
+
children: /* @__PURE__ */ x("path", {
|
|
300
323
|
ref: o,
|
|
301
|
-
d:
|
|
324
|
+
d: _(a),
|
|
302
325
|
vectorEffect: "non-scaling-stroke",
|
|
303
326
|
paintOrder: "stroke",
|
|
304
|
-
className: e("stroke-transparent stroke-1 transition-[fill]",
|
|
327
|
+
className: e("stroke-transparent stroke-1 transition-[fill]", j[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]")
|
|
305
328
|
})
|
|
306
329
|
});
|
|
307
330
|
}
|
|
331
|
+
function N(e, n) {
|
|
332
|
+
let r = !!e && n != null && n !== "default";
|
|
333
|
+
y(() => {
|
|
334
|
+
r && !t() && console.warn("IconButton: `width` is ignored with `shape`; a shaped button is as wide as it is high.");
|
|
335
|
+
}, [r]);
|
|
336
|
+
}
|
|
308
337
|
//#endregion
|
|
309
338
|
//#region lib/components/ui/actions/icon-button/icon-button.tsx
|
|
310
|
-
function
|
|
311
|
-
return e === void 0 || !Number.isFinite(e) || e < .5 ? null :
|
|
339
|
+
function P(e) {
|
|
340
|
+
return e === void 0 || !Number.isFinite(e) || e < .5 ? null : C(e);
|
|
312
341
|
}
|
|
313
|
-
function
|
|
314
|
-
let
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
value: A,
|
|
321
|
-
children: /* @__PURE__ */ y(C, {
|
|
342
|
+
function F({ variant: t, color: n, size: a, width: o, className: s, asChild: c, type: l = "button", shape: u, morph: d = "pill", badge: f, badgeTone: m = "primary", loading: g = !1, children: _, ...y }) {
|
|
343
|
+
let b = c ? i : "button", C = v(h), w = a ?? C, T = !!(y["aria-label"] || y["aria-labelledby"]);
|
|
344
|
+
N(u, o);
|
|
345
|
+
let E = !u && d !== "none" && y["aria-pressed"] != null, j = P(f), F = String(y["aria-pressed"]) === "true", I = k(g, y);
|
|
346
|
+
return /* @__PURE__ */ x(p, {
|
|
347
|
+
value: T,
|
|
348
|
+
children: /* @__PURE__ */ S(b, {
|
|
322
349
|
"data-slot": "icon-button",
|
|
323
350
|
"data-icon-button": "",
|
|
324
351
|
"data-variant": t ?? "filled",
|
|
325
|
-
"data-color":
|
|
326
|
-
type:
|
|
327
|
-
"data-size":
|
|
328
|
-
"data-shape":
|
|
329
|
-
"data-morph":
|
|
330
|
-
"data-selected":
|
|
331
|
-
className: e(
|
|
352
|
+
"data-color": n,
|
|
353
|
+
type: c ? void 0 : l,
|
|
354
|
+
"data-size": w,
|
|
355
|
+
"data-shape": u,
|
|
356
|
+
"data-morph": E ? d : void 0,
|
|
357
|
+
"data-selected": E && F ? "true" : void 0,
|
|
358
|
+
className: e(u ? O({
|
|
332
359
|
variant: t,
|
|
333
|
-
color:
|
|
334
|
-
size:
|
|
335
|
-
}) :
|
|
360
|
+
color: n,
|
|
361
|
+
size: w
|
|
362
|
+
}) : D({
|
|
336
363
|
variant: t,
|
|
337
|
-
color:
|
|
338
|
-
size:
|
|
339
|
-
width:
|
|
340
|
-
}),
|
|
341
|
-
...
|
|
364
|
+
color: n,
|
|
365
|
+
size: w,
|
|
366
|
+
width: o
|
|
367
|
+
}), u && "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]", I.busyClassName, s),
|
|
368
|
+
...y,
|
|
369
|
+
...I.hostProps,
|
|
342
370
|
children: [
|
|
343
|
-
|
|
344
|
-
shape:
|
|
371
|
+
u ? /* @__PURE__ */ x(M, {
|
|
372
|
+
shape: u,
|
|
345
373
|
variant: t ?? "filled",
|
|
346
|
-
color:
|
|
374
|
+
color: n ?? (t === "ghost" ? "default" : "primary")
|
|
347
375
|
}) : null,
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
|
|
376
|
+
/* @__PURE__ */ x(r, { children: _ }),
|
|
377
|
+
g && /* @__PURE__ */ x(A, {
|
|
378
|
+
variant: t ?? "filled",
|
|
379
|
+
color: n
|
|
380
|
+
}),
|
|
381
|
+
j === null ? null : /* @__PURE__ */ x("span", {
|
|
350
382
|
"data-slot": "icon-button-badge",
|
|
351
383
|
"aria-hidden": "true",
|
|
352
|
-
"data-tone":
|
|
384
|
+
"data-tone": m,
|
|
353
385
|
className: "nxgt-icon-button-badge",
|
|
354
|
-
children:
|
|
386
|
+
children: j
|
|
355
387
|
})
|
|
356
388
|
]
|
|
357
389
|
})
|
|
358
390
|
});
|
|
359
391
|
}
|
|
360
|
-
function
|
|
392
|
+
function I({ tooltip: e, "aria-label": t, ...n }) {
|
|
361
393
|
let r = t ?? (typeof e == "string" ? e : void 0);
|
|
362
|
-
return e ? /* @__PURE__ */
|
|
394
|
+
return e ? /* @__PURE__ */ x(o, {
|
|
363
395
|
content: e,
|
|
364
|
-
children: /* @__PURE__ */
|
|
396
|
+
children: /* @__PURE__ */ x(F, {
|
|
365
397
|
"aria-label": r,
|
|
366
398
|
...n
|
|
367
399
|
})
|
|
368
|
-
}) : /* @__PURE__ */
|
|
400
|
+
}) : /* @__PURE__ */ x(F, {
|
|
369
401
|
"aria-label": r,
|
|
370
402
|
...n
|
|
371
403
|
});
|
|
372
404
|
}
|
|
373
405
|
//#endregion
|
|
374
|
-
export {
|
|
406
|
+
export { D as n, C as r, I as t };
|
|
@@ -8,16 +8,33 @@ type Div = ComponentProps<'div'>;
|
|
|
8
8
|
* the tag of the title (a button's children are presentational: a heading only
|
|
9
9
|
* where the card is plain).
|
|
10
10
|
*/
|
|
11
|
-
export declare function actionCardSemantics({ active, disabled, hasIcon, role, tabIndex, onClick, onKeyDown, onKeyUp, }: {
|
|
11
|
+
export declare function actionCardSemantics({ hasAction, active, disabled, hasIcon, role, ariaChecked, tabIndex, onClick, onKeyDown, onKeyUp, }: {
|
|
12
|
+
/** The card has an `action`: the title becomes its one button and the root stays plain. */
|
|
13
|
+
hasAction?: boolean;
|
|
12
14
|
active: boolean | undefined;
|
|
13
15
|
disabled: boolean;
|
|
14
16
|
hasIcon: boolean;
|
|
17
|
+
/** The caller's `aria-checked`: it follows a `role` other than `button` onto the title button. */
|
|
18
|
+
ariaChecked?: Div['aria-checked'];
|
|
15
19
|
} & Pick<Div, 'role' | 'tabIndex' | 'onClick' | 'onKeyDown' | 'onKeyUp'>): {
|
|
16
|
-
Title: "span"
|
|
20
|
+
Title: "span";
|
|
21
|
+
button: Pick<ComponentProps<"button">, "role" | "aria-checked" | "aria-pressed" | "disabled" | "onClick" | "onKeyDown" | "onKeyUp">;
|
|
22
|
+
attributes: {
|
|
23
|
+
'data-slot': string;
|
|
24
|
+
'data-icon': string | undefined;
|
|
25
|
+
'data-has-action': string;
|
|
26
|
+
'data-disabled': string | undefined;
|
|
27
|
+
'data-active': string | undefined;
|
|
28
|
+
'data-interactive': string;
|
|
29
|
+
};
|
|
30
|
+
} | {
|
|
31
|
+
Title: "h3" | "span";
|
|
32
|
+
button: undefined;
|
|
17
33
|
attributes: {
|
|
18
34
|
onClick: (event: import('react').MouseEvent<HTMLDivElement>) => void;
|
|
19
35
|
onKeyDown: (event: import('react').KeyboardEvent<HTMLDivElement>) => void;
|
|
20
36
|
onKeyUp: (event: import('react').KeyboardEvent<HTMLDivElement>) => void;
|
|
37
|
+
'data-has-action': string | undefined;
|
|
21
38
|
'data-slot': string;
|
|
22
39
|
'data-icon': string | undefined;
|
|
23
40
|
role: import('react').AriaRole | undefined;
|
|
@@ -29,4 +46,10 @@ export declare function actionCardSemantics({ active, disabled, hasIcon, role, t
|
|
|
29
46
|
'data-interactive': string | undefined;
|
|
30
47
|
};
|
|
31
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* The props that stay on the root: with a title button it owns the role, the
|
|
51
|
+
* state and the name, so the caller's `aria-checked` and `aria-label` are not
|
|
52
|
+
* applied to the plain `div`.
|
|
53
|
+
*/
|
|
54
|
+
export declare function actionCardRootProps<P extends Div>(props: P, hasButton: boolean): P;
|
|
32
55
|
export {};
|
|
@@ -2,9 +2,25 @@ import { ComponentProps, ReactNode } from 'react';
|
|
|
2
2
|
export type ActionCardProps = {
|
|
3
3
|
active?: boolean;
|
|
4
4
|
icon?: ReactNode;
|
|
5
|
-
|
|
5
|
+
/** `tile` is a compact grid cell: no minimum width, no indicator unless `withIndicator`. */
|
|
6
|
+
variant?: 'sm' | 'md' | 'tile';
|
|
6
7
|
title?: ReactNode;
|
|
7
8
|
description?: ReactNode;
|
|
9
|
+
/** A line under the title: a string or number becomes a soft `Badge`, a node is shown as given (pass a toned `Badge`). */
|
|
10
|
+
status?: ReactNode;
|
|
11
|
+
/** A secondary line, one line with an ellipsis; a tooltip shows it whole only while it is clipped. */
|
|
12
|
+
meta?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* A trailing control (a `RowMenu`, an `IconButton`) in its own area, outside
|
|
15
|
+
* the card's press surface. With it, a card that chooses or reacts is a
|
|
16
|
+
* plain `div` whose title is the one button, named after the title, the
|
|
17
|
+
* status and the meta and described by the `description`; the action is its
|
|
18
|
+
* second tab stop. `title` is required then. A `role` (`switch`, `checkbox`,
|
|
19
|
+
* `radio`) and its `aria-checked` move to the button; `aria-label` is not
|
|
20
|
+
* applied. The card's `disabled` does not reach the action: disable its
|
|
21
|
+
* control too. Without it, nothing changes.
|
|
22
|
+
*/
|
|
23
|
+
action?: ReactNode;
|
|
8
24
|
withIndicator?: boolean;
|
|
9
25
|
/**
|
|
10
26
|
* Out of reach: `aria-disabled`, off the Tab order, no click and no key.
|
|
@@ -12,4 +28,4 @@ export type ActionCardProps = {
|
|
|
12
28
|
*/
|
|
13
29
|
disabled?: boolean;
|
|
14
30
|
} & Omit<ComponentProps<'div'>, 'title'>;
|
|
15
|
-
export declare function ActionCard({ icon, active, className, title, description, variant, tabIndex, withIndicator, disabled, role, onClick, onKeyDown, onKeyUp, ...props }: ActionCardProps): import("react").JSX.Element;
|
|
31
|
+
export declare function ActionCard({ icon, active, className, title, description, status, meta, action, variant, tabIndex, withIndicator, disabled, role, onClick, onKeyDown, onKeyUp, ...props }: ActionCardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** The card's leading icon in a circle that morphs to a filled cookie when chosen. */
|
|
3
|
+
export declare function ActionCardIcon({ active, children, }: {
|
|
4
|
+
active: boolean | undefined;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The card's secondary line: one line with an ellipsis, the full text always
|
|
4
|
+
* in the DOM. Its tooltip shows the whole text only while the line is clipped
|
|
5
|
+
* and the card's pressable element is `revealed` (hovered or focused), and it
|
|
6
|
+
* takes no tab stop of its own. The pointer crossing the line or leaving the
|
|
7
|
+
* tooltip changes nothing (the card owns hover and focus): only Escape
|
|
8
|
+
* dismisses it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ActionCardMeta({ id, revealed, onDismiss, children, }: {
|
|
11
|
+
id: string;
|
|
12
|
+
revealed: boolean;
|
|
13
|
+
onDismiss: () => void;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentProps, ElementType, ReactNode } from 'react';
|
|
2
|
+
import { useActionCardNames } from '../use-action-card-names.js';
|
|
3
|
+
import { useReveal } from '../use-reveal.js';
|
|
4
|
+
import { ActionCardTitleButton } from './action-card-title-button.js';
|
|
5
|
+
/**
|
|
6
|
+
* The card's text block: the title (the card's one button when it has an
|
|
7
|
+
* `action`, else a heading or a span), the description, the status and the
|
|
8
|
+
* meta line. With an `action` the button is always there, named after the
|
|
9
|
+
* status and the meta when there is no title.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ActionCardText({ title, description, status, meta, Title, button, names, reveal, }: {
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
description: ReactNode;
|
|
14
|
+
status: ReactNode;
|
|
15
|
+
meta: ReactNode;
|
|
16
|
+
Title: ElementType;
|
|
17
|
+
button: Omit<ComponentProps<typeof ActionCardTitleButton>, 'id' | 'labelledBy' | 'describedBy' | 'children'> | undefined;
|
|
18
|
+
names: ReturnType<typeof useActionCardNames>;
|
|
19
|
+
reveal: ReturnType<typeof useReveal>;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The title of a card that has an `action`: the card's one button. Its
|
|
4
|
+
* `::after` is stretched over the card (action-card-tile.css), so the whole
|
|
5
|
+
* card presses it, and the action sits above it as a sibling, never inside.
|
|
6
|
+
* Named after the title, the status and the meta line together, and described
|
|
7
|
+
* by the card's description.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ActionCardTitleButton({ id, labelledBy, describedBy, children, ...props }: {
|
|
10
|
+
id: string;
|
|
11
|
+
labelledBy: string | undefined;
|
|
12
|
+
describedBy: string | undefined;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
} & Omit<ComponentProps<'button'>, 'children' | 'id'>): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** The card's trailing parts: its `action` in its own area, then the indicator. */
|
|
3
|
+
export declare function ActionCardTrail({ action, withIndicator, }: {
|
|
4
|
+
action: ReactNode;
|
|
5
|
+
withIndicator: boolean;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ids a card's parts carry, and what the button of a card with an
|
|
3
|
+
* `action` is named and described after: the title, then the status, then the
|
|
4
|
+
* meta line for its name (only those the card shows; undefined when none is,
|
|
5
|
+
* as an empty string would give the button no name at all), and the
|
|
6
|
+
* description for its description.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useActionCardNames(has: {
|
|
9
|
+
title: boolean;
|
|
10
|
+
description: boolean;
|
|
11
|
+
status: boolean;
|
|
12
|
+
meta: boolean;
|
|
13
|
+
}): {
|
|
14
|
+
ids: {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
status: string;
|
|
18
|
+
meta: string;
|
|
19
|
+
};
|
|
20
|
+
labelledBy: string | undefined;
|
|
21
|
+
describedBy: string | undefined;
|
|
22
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FocusEvent, PointerEvent } from 'react';
|
|
2
|
+
type Own = {
|
|
3
|
+
onPointerEnter?: (event: PointerEvent<never>) => void;
|
|
4
|
+
onPointerLeave?: (event: PointerEvent<never>) => void;
|
|
5
|
+
onFocus?: (event: FocusEvent<never>) => void;
|
|
6
|
+
onBlur?: (event: FocusEvent<never>) => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Whether a card's meta line is revealed: its pressable element is hovered by
|
|
10
|
+
* a mouse or a pen (a tap leaves no hover) or has focus. `bind(own)` returns
|
|
11
|
+
* the four handlers, calling the caller's own first. `dismiss` clears both.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useReveal(): {
|
|
14
|
+
revealed: boolean;
|
|
15
|
+
dismiss: () => void;
|
|
16
|
+
bind: (own?: Own) => {
|
|
17
|
+
onPointerEnter: (event: PointerEvent<never>) => void;
|
|
18
|
+
onPointerLeave: (event: PointerEvent<never>) => void;
|
|
19
|
+
onFocus: (event: FocusEvent<never>) => void;
|
|
20
|
+
onBlur: (event: FocusEvent<never>) => void;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
declare const buttonVariantsByColor: (props?: ({
|
|
3
|
-
variant?: "
|
|
3
|
+
variant?: "link" | "tonal" | "filled" | "ghost" | "outlined" | null | undefined;
|
|
4
4
|
color?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "default" | null | undefined;
|
|
5
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;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
type Props = ComponentProps<'button'>;
|
|
3
|
+
/**
|
|
4
|
+
* What `loading` adds to an `IconButton`'s host, as `Button`'s: `aria-busy`
|
|
5
|
+
* and `aria-disabled` (which win over the caller's while busy, and stand when
|
|
6
|
+
* idle), every click blocked, and the classes that hide the icon and anchor the
|
|
7
|
+
* spinner. Spread it after the caller's props.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useBusyProps(loading: boolean, props: Props): {
|
|
10
|
+
busyClassName: string | undefined;
|
|
11
|
+
hostProps: {
|
|
12
|
+
'aria-disabled': (boolean | "false" | "true") | undefined;
|
|
13
|
+
'aria-busy': (boolean | "false" | "true") | undefined;
|
|
14
|
+
onClickCapture: (event: import('react').MouseEvent<HTMLButtonElement>) => void;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/** The busy spinner, over the icon's place; the icon keeps its room, hidden. */
|
|
18
|
+
export declare function IconButtonSpinner({ variant, color, }: {
|
|
19
|
+
variant: string;
|
|
20
|
+
color: string | null | undefined;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -22,3 +22,5 @@ export declare function IconButtonShape({ shape, variant, color, }: {
|
|
|
22
22
|
variant: IconButtonVariant;
|
|
23
23
|
color: IconButtonColor;
|
|
24
24
|
}): import("react").JSX.Element;
|
|
25
|
+
/** A `width` other than the default is ignored with a `shape`: a warning in development. */
|
|
26
|
+
export declare function useIgnoredWidthWarning(shape: ShapeName | undefined, width: string | null | undefined): void;
|