@slotted/react 0.1.0-beta.26 → 0.1.0-beta.27
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/dist/{action-bar-DckD0Sug.js → action-bar-CAtXzym2.js} +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/{cascader-47GYpojH.js → cascader-CwwtJs3W.js} +189 -189
- package/dist/cascader.js +1 -1
- package/dist/{color-picker-BbyW5ALf.js → color-picker-2i3A60vD.js} +1 -1
- package/dist/color-picker.js +1 -1
- package/dist/{column-manager-Bz0bb4mq.js → column-manager-D4HIwXPi.js} +1 -1
- package/dist/column-manager.js +1 -1
- package/dist/{combobox-BA2nvbnA.js → combobox-BpZ8i-61.js} +86 -86
- package/dist/combobox.js +1 -1
- package/dist/{command-palette-DEKWsUFR.js → command-palette-BxbhO044.js} +11 -11
- package/dist/command-palette.js +1 -1
- package/dist/{context-menu-CfEEqDKr.js → context-menu-BJyDD17g.js} +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/{dashboard-grid-WinSY-q3.js → dashboard-grid-De6al1Mj.js} +1 -1
- package/dist/dashboard-grid.js +1 -1
- package/dist/{data-grid-BWWvixwB.js → data-grid-CuHnCT01.js} +33 -33
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-iw9K_oiz.js → data-list-CuzWmmGp.js} +5 -5
- package/dist/data-list.js +1 -1
- package/dist/docs/chart.json +2 -0
- package/dist/docs/chart.md +1 -1
- package/dist/docs/combobox.json +1 -0
- package/dist/docs/combobox.md +1 -1
- package/dist/docs/dialog.json +23 -4
- package/dist/docs/dialog.md +2 -60
- package/dist/docs/dialog.props.md +68 -0
- package/dist/docs/drawer.json +2 -0
- package/dist/docs/drawer.md +1 -1
- package/dist/docs/menu.json +1 -0
- package/dist/docs/menu.md +1 -1
- package/dist/docs/multi-select.json +1 -0
- package/dist/docs/multi-select.md +1 -1
- package/dist/docs/select.json +1 -0
- package/dist/docs/select.md +1 -1
- package/dist/docs/skills/theme-app/SKILL.md +4 -1
- package/dist/{entity-picker-WkBLvR2T.js → entity-picker-BYAlDJL-.js} +25 -25
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-BaPllnNk.js → event-calendar-BuZg4ghj.js} +2 -2
- package/dist/event-calendar.js +1 -1
- package/dist/{filter-bar-DRQEl4-J.js → filter-bar-DeBYLpbg.js} +3 -3
- package/dist/filter-bar.js +1 -1
- package/dist/{import-export-center-C1t2tkzg.js → import-export-center-CTliNoT9.js} +1 -1
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +26 -26
- package/dist/{listbox-B9cBuitS.js → listbox-BSx90S2g.js} +10 -10
- package/dist/listbox.js +1 -1
- package/dist/{menu-parts-7F8syoFE.js → menu-parts-DNQDoJnd.js} +203 -204
- package/dist/menu.js +1 -1
- package/dist/{menubar-DzVGFn_I.js → menubar-CY8oxV0V.js} +1 -1
- package/dist/menubar.js +1 -1
- package/dist/{multi-select-DnOAXeuF.js → multi-select-Dh2gOp42.js} +68 -68
- package/dist/multi-select.js +1 -1
- package/dist/{saved-views-CsVRZTwK.js → saved-views-BKhAqvhI.js} +1 -1
- package/dist/saved-views.js +1 -1
- package/dist/{select-De77allF.js → select-BcTau8q3.js} +263 -263
- package/dist/select.js +1 -1
- package/dist/{split-button-DA1wcDJB.js → split-button-CgfY606Z.js} +1 -1
- package/dist/split-button.js +1 -1
- package/dist/styles/action-bar.css +1 -1
- package/dist/styles/action-sheet.css +1 -1
- package/dist/styles/card.css +1 -1
- package/dist/styles/cascader.css +1 -1
- package/dist/styles/chart.css +1 -1
- package/dist/styles/checkbox-group.css +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/color-picker.css +3 -3
- package/dist/styles/column-manager.css +4 -4
- package/dist/styles/combobox.css +2 -2
- package/dist/styles/command-palette.css +1 -1
- package/dist/styles/context-menu.css +1 -1
- package/dist/styles/currency-field.css +1 -1
- package/dist/styles/dashboard-grid.css +2 -2
- package/dist/styles/data-grid.css +5 -5
- package/dist/styles/data-list.css +2 -2
- package/dist/styles/date-field.css +1 -1
- package/dist/styles/date-picker.css +1 -1
- package/dist/styles/date-range-picker.css +1 -1
- package/dist/styles/datetime-field.css +1 -1
- package/dist/styles/datetime-picker.css +1 -1
- package/dist/styles/datetime-range-picker.css +1 -1
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/drawer.css +1 -1
- package/dist/styles/entity-picker.css +2 -2
- package/dist/styles/event-calendar.css +4 -4
- package/dist/styles/field-group.css +1 -1
- package/dist/styles/field.css +1 -1
- package/dist/styles/filter-bar.css +6 -6
- package/dist/styles/hover-card.css +1 -1
- package/dist/styles/import-export-center.css +3 -3
- package/dist/styles/index.css +10 -10
- package/dist/styles/listbox.css +1 -1
- package/dist/styles/markdown.css +1 -1
- package/dist/styles/menu.css +1 -1
- package/dist/styles/menubar.css +1 -1
- package/dist/styles/multi-select.css +2 -2
- package/dist/styles/notification-center.css +1 -1
- package/dist/styles/number-field.css +1 -1
- package/dist/styles/otp-input.css +1 -1
- package/dist/styles/popover.css +1 -1
- package/dist/styles/prompt-composer.css +1 -1
- package/dist/styles/radio-group.css +1 -1
- package/dist/styles/rating.css +1 -1
- package/dist/styles/saved-views.css +3 -3
- package/dist/styles/segmented-control.css +1 -1
- package/dist/styles/select.css +2 -2
- package/dist/styles/side-navigation.css +1 -1
- package/dist/styles/slider.css +1 -1
- package/dist/styles/split-button.css +1 -1
- package/dist/styles/switch.css +1 -1
- package/dist/styles/table.css +3 -3
- package/dist/styles/tags-input.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/textarea.css +1 -1
- package/dist/styles/time-field.css +1 -1
- package/dist/styles/time-picker.css +1 -1
- package/dist/styles/time-range-picker.css +1 -1
- package/dist/styles/toggle-group.css +1 -1
- package/dist/styles/toolbar.css +1 -1
- package/dist/styles/tooltip.css +1 -1
- package/dist/styles/top-navigation.css +1 -1
- package/dist/styles/transfer.css +1 -1
- package/dist/styles/upload.css +2 -2
- package/dist/styles.css +1 -1
- package/dist/{table-C3cjkzps.js → table-Dx-RQ64i.js} +208 -208
- package/dist/table.js +1 -1
- package/dist/{tags-input-DEhtpizX.js → tags-input-hZs5oaT1.js} +9 -9
- package/dist/tags-input.js +1 -1
- package/dist/{toolbar-CtSZ88HI.js → toolbar-CSiDqC8L.js} +1 -1
- package/dist/toolbar.js +1 -1
- package/dist/{transfer-BMRyopEw.js → transfer-DHjPhRlH.js} +5 -5
- package/dist/transfer.js +1 -1
- package/dist/{tree-DBirM2v9.js → tree-D-y-0TrL.js} +14 -14
- package/dist/tree.js +1 -1
- package/dist/types/menu/menu-parts.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as e, r as t } from "./i18n-D7xXDd8-.js";
|
|
2
2
|
import { n, t as r } from "./icon-D04-_QFA.js";
|
|
3
|
-
import { _ as i, c as a, g as o, n as s, t as c } from "./menu-parts-
|
|
3
|
+
import { _ as i, c as a, g as o, n as s, t as c } from "./menu-parts-DNQDoJnd.js";
|
|
4
4
|
import { n as l } from "./icon-button-DERKFHX1.js";
|
|
5
5
|
import { a as u, i as d, n as f, r as p } from "./tooltip-DrFiRlH8.js";
|
|
6
6
|
import { t as m } from "./checkbox-Dw9R1CGR.js";
|
|
@@ -15,10 +15,10 @@ import { t as fe } from "./date-range-picker-BhQwOKkE.js";
|
|
|
15
15
|
import { t as pe } from "./datetime-picker-C-PwlBW5.js";
|
|
16
16
|
import { t as me } from "./datetime-field-CvKPkvaE.js";
|
|
17
17
|
import { t as he } from "./datetime-range-picker-0xs12Cf1.js";
|
|
18
|
-
import { a as ge, i as _e, n as ve, s as ye } from "./multi-select-
|
|
18
|
+
import { a as ge, i as _e, n as ve, s as ye } from "./multi-select-Dh2gOp42.js";
|
|
19
19
|
import { t as be } from "./number-field-C20-8yda.js";
|
|
20
20
|
import { a as xe, t as Se } from "./segmented-control-Dae5wU9X.js";
|
|
21
|
-
import { c as Ce, i as we, n as Te, o as Ee, s as De } from "./select-
|
|
21
|
+
import { c as Ce, i as we, n as Te, o as Ee, s as De } from "./select-BcTau8q3.js";
|
|
22
22
|
import { t as Oe } from "./time-picker-Da_UhP9X.js";
|
|
23
23
|
import { t as ke } from "./time-field-xkxX8JF6.js";
|
|
24
24
|
import { t as Ae } from "./time-range-picker-CfVzD53N.js";
|
|
@@ -28,10 +28,10 @@ import { createContext as Pe, createElement as Fe, memo as Ie, useCallback as y,
|
|
|
28
28
|
import { Fragment as He, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
29
29
|
import { createScrollAffordance as Ue } from "@slotted/core/overflow";
|
|
30
30
|
import { dataGridMessages as We, dragMessages as Ge } from "@slotted/core/i18n";
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
31
|
+
import { createRowMetrics as Ke, nextSelection as qe, virtualWindow as Je } from "@slotted/core/collection";
|
|
32
|
+
import { COMPACT_BELOW as Ye } from "@slotted/core/measure";
|
|
33
|
+
import { getLiveAnnouncer as Xe } from "@slotted/core/live-announcer";
|
|
34
|
+
import { isPlainDate as Ze, isPlainDateTime as Qe, isPlainTime as $e, parseISODate as et, parseISODateTime as tt, parseISOTime as nt, toISODate as rt, toISODateTime as it, toISOTime as at } from "@slotted/core/date";
|
|
35
35
|
import { writeToClipboard as ot } from "@slotted/core/clipboard";
|
|
36
36
|
import { createDragController as st } from "@slotted/core/drag";
|
|
37
37
|
import { FILTER_ROW as ct, GROUP_ROW_PREFIX as lt, HEADER_ROW as ut, POPIN_COLUMN_ID as dt, RESIZE_STEP as ft, SUMMARY_ROW as pt, applyQuery as mt, cellText as ht, cellValue as gt, clampWidth as _t, columnRange as vt, columnTemplate as yt, columnsOutOfSpace as bt, emptyGridView as xt, emptyQuery as St, groupInOrder as Ct, isGroupCursorRow as wt, moveCursor as Tt, normalizeColumnState as Et, parseGridView as Dt, rangeBounds as Ot, rangeCells as kt, rangeEdges as At, rangeToText as jt, resolveColumnOverflow as Mt, resolveColumns as Nt, rowRange as Pt, sameCell as E, serializeGridView as Ft, serializeQuery as It, settleCursor as Lt, toCsv as Rt, wholeRange as zt, withColumnFilter as Bt, withColumnHidden as Vt, withColumnMoved as Ht, withColumnPinned as Ut, withColumnWidth as Wt, withSort as Gt, withSortPress as Kt, withoutFilters as qt, zoneOf as Jt } from "@slotted/core/grid";
|
|
@@ -763,15 +763,15 @@ function Wn(e) {
|
|
|
763
763
|
function Gn(e) {
|
|
764
764
|
if (!e) return null;
|
|
765
765
|
let t = String(e);
|
|
766
|
-
return
|
|
766
|
+
return nt(/^\d{2}$/.test(t) ? `${t}:00` : t);
|
|
767
767
|
}
|
|
768
768
|
function Kn(e) {
|
|
769
769
|
if (!e) return null;
|
|
770
770
|
let t = String(e);
|
|
771
|
-
return /^\d{4}-\d{2}-\d{2}$/.test(t) ?
|
|
771
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(t) ? tt(`${t}T00:00`) : /^\d{4}-\d{2}-\d{2}T\d{2}$/.test(t) ? tt(`${t}:00`) : tt(t);
|
|
772
772
|
}
|
|
773
773
|
function qn(e) {
|
|
774
|
-
return e ?
|
|
774
|
+
return e ? et(String(e)) : null;
|
|
775
775
|
}
|
|
776
776
|
function Jn(e, t, n) {
|
|
777
777
|
let { column: r, draft: i, setDraft: a, invalid: o, message: s } = e, c = r.kind ?? "text", l = r.label, u = {
|
|
@@ -800,19 +800,19 @@ function Jn(e, t, n) {
|
|
|
800
800
|
});
|
|
801
801
|
case "date": return /* @__PURE__ */ w(de, {
|
|
802
802
|
...u,
|
|
803
|
-
onValueChange: (e) => a(
|
|
803
|
+
onValueChange: (e) => a(Ze(e) ? rt(e) : null),
|
|
804
804
|
value: qn(i),
|
|
805
805
|
...n === void 0 ? {} : { locale: n }
|
|
806
806
|
});
|
|
807
807
|
case "time": return /* @__PURE__ */ w(ke, {
|
|
808
808
|
...u,
|
|
809
|
-
onValueChange: (e) => a(
|
|
809
|
+
onValueChange: (e) => a($e(e) ? at(e, "minute") : null),
|
|
810
810
|
value: Gn(i),
|
|
811
811
|
...n === void 0 ? {} : { locale: n }
|
|
812
812
|
});
|
|
813
813
|
case "datetime": return /* @__PURE__ */ w(me, {
|
|
814
814
|
...u,
|
|
815
|
-
onValueChange: (e) => a(
|
|
815
|
+
onValueChange: (e) => a(Qe(e) ? it(e) : null),
|
|
816
816
|
value: Kn(i),
|
|
817
817
|
...n === void 0 ? {} : { locale: n }
|
|
818
818
|
});
|
|
@@ -884,7 +884,7 @@ function Qn({ kind: e, start: t, end: n, onChange: r, t: i, locale: a, variant:
|
|
|
884
884
|
return e === "time" ? /* @__PURE__ */ w(Ae, {
|
|
885
885
|
...c,
|
|
886
886
|
...l,
|
|
887
|
-
onValueChange: (e) => r(
|
|
887
|
+
onValueChange: (e) => r($e(e?.start) ? at(e.start, "minute") : null, $e(e?.end) ? at(e.end, "minute") : null),
|
|
888
888
|
value: {
|
|
889
889
|
start: Gn(t),
|
|
890
890
|
end: Gn(n)
|
|
@@ -892,7 +892,7 @@ function Qn({ kind: e, start: t, end: n, onChange: r, t: i, locale: a, variant:
|
|
|
892
892
|
}) : e === "datetime" ? /* @__PURE__ */ w(he, {
|
|
893
893
|
...c,
|
|
894
894
|
...l,
|
|
895
|
-
onValueChange: (e) => r(
|
|
895
|
+
onValueChange: (e) => r(Qe(e?.start) ? it(e.start) : null, Qe(e?.end) ? it(e.end) : null),
|
|
896
896
|
value: {
|
|
897
897
|
start: Kn(t),
|
|
898
898
|
end: Kn(n)
|
|
@@ -903,7 +903,7 @@ function Qn({ kind: e, start: t, end: n, onChange: r, t: i, locale: a, variant:
|
|
|
903
903
|
end: i("filterTo"),
|
|
904
904
|
start: i("filterFrom")
|
|
905
905
|
},
|
|
906
|
-
onValueChange: (e) => r(
|
|
906
|
+
onValueChange: (e) => r(Ze(e?.start) ? rt(e.start) : null, Ze(e?.end) ? rt(e.end) : null),
|
|
907
907
|
value: {
|
|
908
908
|
start: qn(t),
|
|
909
909
|
end: qn(n)
|
|
@@ -929,17 +929,17 @@ function $n({ autoFocus: e, column: t, counts: n, kind: r, label: i, t: a, local
|
|
|
929
929
|
});
|
|
930
930
|
case "date": return /* @__PURE__ */ w(ue, {
|
|
931
931
|
...f,
|
|
932
|
-
onValueChange: (e) => s(
|
|
932
|
+
onValueChange: (e) => s(Ze(e) ? rt(e) : null),
|
|
933
933
|
value: qn(u)
|
|
934
934
|
});
|
|
935
935
|
case "time": return /* @__PURE__ */ w(Oe, {
|
|
936
936
|
...f,
|
|
937
|
-
onValueChange: (e) => s(
|
|
937
|
+
onValueChange: (e) => s($e(e) ? at(e, "minute") : null),
|
|
938
938
|
value: Gn(u)
|
|
939
939
|
});
|
|
940
940
|
case "datetime": return /* @__PURE__ */ w(pe, {
|
|
941
941
|
...f,
|
|
942
|
-
onValueChange: (e) => s(
|
|
942
|
+
onValueChange: (e) => s(Qe(e) ? it(e) : null),
|
|
943
943
|
value: Kn(u)
|
|
944
944
|
});
|
|
945
945
|
case "boolean": return /* @__PURE__ */ T(Ce, {
|
|
@@ -1840,7 +1840,7 @@ function kr(e) {
|
|
|
1840
1840
|
}
|
|
1841
1841
|
return i + Math.max(0, a - 1) * r + n;
|
|
1842
1842
|
}
|
|
1843
|
-
function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow: a, dataSource: o, columnState: s, columns: c, current: u, density: d, defaultColumnState: f, defaultCurrent: p, defaultExpanded: m, defaultExpandedGroups: h, defaultQuery: g, defaultRange: _, defaultValue: ee, disabledKeys: te, editMode: ne, editorRenderers: re, error: ie, expandable: v, expanded: ue, expandedGroups: de, filterDebounce: fe, filterRow: pe, footer: me, handle: he, hasMore: ge, height: _e, highlightChanges: ve, labelledBy: ye, loadMoreThreshold: be, loadMoreTrigger: xe, loadMoreFailed: Se, loading: Ce, locale: we, messages: Te, mode: Ee, onActivate: De, onColumnStateChange: Oe, onCurrentChange: ke, onEditCancel: Ae, onEditCommit: je, onEditStart: Me, onExpandedChange: Ne, onExpandedGroupsChange: Pe, onLoadChildren: Fe, onRowsReorder: Ie, onKeyDown: Le, onLoadMore: Ve, onManageColumns: He, onOutOfSpaceChange:
|
|
1843
|
+
function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow: a, dataSource: o, columnState: s, columns: c, current: u, density: d, defaultColumnState: f, defaultCurrent: p, defaultExpanded: m, defaultExpandedGroups: h, defaultQuery: g, defaultRange: _, defaultValue: ee, disabledKeys: te, editMode: ne, editorRenderers: re, error: ie, expandable: v, expanded: ue, expandedGroups: de, filterDebounce: fe, filterRow: pe, footer: me, handle: he, hasMore: ge, height: _e, highlightChanges: ve, labelledBy: ye, loadMoreThreshold: be, loadMoreTrigger: xe, loadMoreFailed: Se, loading: Ce, locale: we, messages: Te, mode: Ee, onActivate: De, onColumnStateChange: Oe, onCurrentChange: ke, onEditCancel: Ae, onEditCommit: je, onEditStart: Me, onExpandedChange: Ne, onExpandedGroupsChange: Pe, onLoadChildren: Fe, onRowsReorder: Ie, onKeyDown: Le, onLoadMore: Ve, onManageColumns: He, onOutOfSpaceChange: Ze, onQueryChange: Qe, onRangeChange: $e, onRetry: et, onValueChange: tt, overscan: nt, pinnedRows: rt, pageSizes: it, query: at, range: _t, ref: xt, renderCell: Dt, renderDetail: Ft, renderEditor: It, renderEmpty: Xt, renderFilterOperand: Zt, renderGroup: Qt, renderHeader: $t, rowHeight: en, rowKey: tn, rowsReorderable: nn, rows: rn, selectionMode: on, showRange: sn, skeletonRows: cn, stickyHeader: mn, stickyTo: hn, striped: D, style: yn, timeZone: bn, totalCount: Sn, tree: Cn, value: wn, variant: En, virtualize: An, ...jn }) {
|
|
1844
1844
|
let O = Bn(), Mn = Re(), k = S(null), Nn = S(null), Pn = S({
|
|
1845
1845
|
cellRenderers: r,
|
|
1846
1846
|
editorRenderers: re,
|
|
@@ -1859,7 +1859,7 @@ function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow:
|
|
|
1859
1859
|
Cn === void 0,
|
|
1860
1860
|
qn,
|
|
1861
1861
|
Yn
|
|
1862
|
-
]), j = t(We, Te), Xn = t(Ge), Zn = e(), Qn = En ?? O.variant ?? "ruled", $n = D ?? O.striped ?? !1, er = mn ?? O.stickyHeader ?? !0, tr = hn ?? O.stickyTo ?? "scroll", M = on ?? O.selectionMode ?? "none", rr = ne ?? O.editMode ?? "cell", ir = pe ?? O.filterRow ?? !1, ar = An ?? O.virtualize ?? "auto", or = en ?? O.rowHeight, sr = a ?? O.columnOverflow ?? "auto", cr =
|
|
1862
|
+
]), j = t(We, Te), Xn = t(Ge), Zn = e(), Qn = En ?? O.variant ?? "ruled", $n = D ?? O.striped ?? !1, er = mn ?? O.stickyHeader ?? !0, tr = hn ?? O.stickyTo ?? "scroll", M = on ?? O.selectionMode ?? "none", rr = ne ?? O.editMode ?? "cell", ir = pe ?? O.filterRow ?? !1, ar = An ?? O.virtualize ?? "auto", or = en ?? O.rowHeight, sr = a ?? O.columnOverflow ?? "auto", cr = nt ?? O.overscan ?? 6, lr = fe ?? O.filterDebounce ?? 300, ur = be ?? O.loadMoreThreshold ?? 20, Ar = xe ?? O.loadMoreTrigger ?? "scroll", Nr = cn ?? O.skeletonRows ?? 8, N = we ?? Zn, Pr = n ?? !1, P = y((e) => typeof tn == "function" ? tn(e) : String(e[tn]), [tn]), Fr = j("filterYes"), Ir = j("filterNo"), Lr = x(() => ({
|
|
1863
1863
|
locale: N,
|
|
1864
1864
|
timeZone: bn,
|
|
1865
1865
|
booleans: {
|
|
@@ -1875,7 +1875,7 @@ function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow:
|
|
|
1875
1875
|
if (zr.has(P(t))) return !1;
|
|
1876
1876
|
let n = e.editable;
|
|
1877
1877
|
return typeof n == "function" ? n(t) : n === !0;
|
|
1878
|
-
}, [zr, P]), Vr = x(() => c.some((e) => e.editable), [c]), Hr = y((e) => Rn ? v === void 0 ? !0 : typeof v == "function" ? v(e) : v : !1, [v, Rn]), [I, Ur] = dr(
|
|
1878
|
+
}, [zr, P]), Vr = x(() => c.some((e) => e.editable), [c]), Hr = y((e) => Rn ? v === void 0 ? !0 : typeof v == "function" ? v(e) : v : !1, [v, Rn]), [I, Ur] = dr(at, g ?? St(), Qe, Cr), Wr = Un(o, I), L = o ? Wr.rows : rn ?? Or, Gr = o ? Wr.total : Sn, Kr = o ? Wr.hasMore : ge, qr = o ? Wr.loading : Ce, Jr = qr !== void 0 && qr !== !1, Yr = o ? Wr.error : ie, Xr = o ? Wr.retry : et, Zr = Ee ?? (o || Gr !== void 0 || Kr !== void 0 ? "server" : "client"), Qr = x(() => Et(s ?? f, c), [s, c]), [$r, ei] = dr(s === void 0 ? void 0 : Qr, Qr, Oe, wr), R = x(() => Et($r, c), [$r, c]), [ti, ni] = dr(wn, ee ?? (M === "multiple" ? [] : null), tt, Dr), [ri, ii] = dr(_t, _ ?? null, $e, Er), [z, ai] = dr(u, p ?? null, ke, E), [oi, si] = dr(ue, m ?? [], Ne, Tr), [ci, li] = dr(de, h ?? "all", Pe, Tr), ui = M === "single" || M === "multiple", di = nn === !0, fi = Rn !== void 0, pi = x(() => {
|
|
1879
1879
|
let e = [];
|
|
1880
1880
|
return ui && e.push(48), di && e.push(40), fi && e.push(40), e;
|
|
1881
1881
|
}, [
|
|
@@ -1908,8 +1908,8 @@ function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow:
|
|
|
1908
1908
|
]), Si = x(() => B.popin.length === 0 ? [] : hi.filter((e) => B.popin.includes(e.id)), [hi, B]), Ci = Si.length > 0, wi = S(_r);
|
|
1909
1909
|
b(() => {
|
|
1910
1910
|
let e = wi.current;
|
|
1911
|
-
Tr(B.popin, e.popin) && Tr(B.hidden, e.hidden) || (wi.current = B,
|
|
1912
|
-
}, [B,
|
|
1911
|
+
Tr(B.popin, e.popin) && Tr(B.hidden, e.hidden) || (wi.current = B, Ze?.(B));
|
|
1912
|
+
}, [B, Ze]);
|
|
1913
1913
|
let H = x(() => new Map(V.map((e) => [e.id, e])), [V]), U = x(() => [
|
|
1914
1914
|
...ui ? [un] : [],
|
|
1915
1915
|
...di ? [fn] : [],
|
|
@@ -1921,7 +1921,7 @@ function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow:
|
|
|
1921
1921
|
fi,
|
|
1922
1922
|
V
|
|
1923
1923
|
]), Ti = U.length + +!!Ci, Ei = U.length + 1, Di = x(() => Ci ? [...U, dt] : U, [Ci, U]), Oi = x(() => yt(V, pi), [V, pi]), W = x(() => {
|
|
1924
|
-
let e =
|
|
1924
|
+
let e = rt?.top ?? [], t = rt?.bottom ?? [];
|
|
1925
1925
|
if (e.length === 0 && t.length === 0) return {
|
|
1926
1926
|
top: [],
|
|
1927
1927
|
bottom: [],
|
|
@@ -1949,7 +1949,7 @@ function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow:
|
|
|
1949
1949
|
keys: /* @__PURE__ */ new Set([...e, ...t])
|
|
1950
1950
|
};
|
|
1951
1951
|
}, [
|
|
1952
|
-
|
|
1952
|
+
rt,
|
|
1953
1953
|
L,
|
|
1954
1954
|
P
|
|
1955
1955
|
]), ki = x(() => W.keys ? L.filter((e) => !W.keys.has(P(e))) : L, [
|
|
@@ -2018,7 +2018,7 @@ function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow:
|
|
|
2018
2018
|
width: 0,
|
|
2019
2019
|
height: 0
|
|
2020
2020
|
}), [Gi, Ki] = C(null), [qi, Ji] = C(/* @__PURE__ */ new Map()), Yi = or === "auto" || Ci, q = typeof or == "number" ? or : Gi ?? fr, Xi = ar === !0 || ar === "auto" && G.length > pr, Zi = x(() => {
|
|
2021
|
-
if (Yi) return
|
|
2021
|
+
if (Yi) return Ke(G.map((e, t) => qi.get(t) ?? q));
|
|
2022
2022
|
}, [
|
|
2023
2023
|
Yi,
|
|
2024
2024
|
G,
|
|
@@ -2031,7 +2031,7 @@ function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow:
|
|
|
2031
2031
|
startOffset: 0,
|
|
2032
2032
|
totalSize: 0
|
|
2033
2033
|
};
|
|
2034
|
-
let e =
|
|
2034
|
+
let e = Je({
|
|
2035
2035
|
itemCount: G.length,
|
|
2036
2036
|
itemSize: q,
|
|
2037
2037
|
metrics: Zi,
|
|
@@ -2093,7 +2093,7 @@ function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow:
|
|
|
2093
2093
|
ni(r, t, n);
|
|
2094
2094
|
}, [M, ni]), pa = y((e, t) => {
|
|
2095
2095
|
if (M === "none" || M === "range" || zr.has(e)) return;
|
|
2096
|
-
let n =
|
|
2096
|
+
let n = qe({
|
|
2097
2097
|
action: t.range ? "range" : "toggle",
|
|
2098
2098
|
mode: M,
|
|
2099
2099
|
selected: aa,
|
|
@@ -2111,7 +2111,7 @@ function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow:
|
|
|
2111
2111
|
fa
|
|
2112
2112
|
]), ma = y((e) => {
|
|
2113
2113
|
if (M !== "multiple") return;
|
|
2114
|
-
let t =
|
|
2114
|
+
let t = qe({
|
|
2115
2115
|
action: "all",
|
|
2116
2116
|
mode: "multiple",
|
|
2117
2117
|
selected: aa,
|
|
@@ -2162,7 +2162,7 @@ function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow:
|
|
|
2162
2162
|
ri,
|
|
2163
2163
|
ii
|
|
2164
2164
|
]), Z = y((e) => {
|
|
2165
|
-
|
|
2165
|
+
Xe(k.current?.ownerDocument).announce(e);
|
|
2166
2166
|
}, []), [Sa, Ca] = C(!1), wa = S(null), Ta = y((e) => {
|
|
2167
2167
|
let t = k.current?.querySelector(`[data-row="${CSS.escape(e.row)}"] [data-column="${CSS.escape(e.column)}"]`);
|
|
2168
2168
|
if (!t) return !1;
|
|
@@ -3071,7 +3071,7 @@ function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow:
|
|
|
3071
3071
|
}
|
|
3072
3072
|
if ((o === "a" || o === "A") && (e.ctrlKey || e.metaKey) && !a) {
|
|
3073
3073
|
if (M === "multiple") {
|
|
3074
|
-
e.preventDefault(), (
|
|
3074
|
+
e.preventDefault(), (qe({
|
|
3075
3075
|
action: "all",
|
|
3076
3076
|
mode: "multiple",
|
|
3077
3077
|
selected: aa,
|
|
@@ -3654,7 +3654,7 @@ function Ar({ activatable: n, cellRenderers: r, columnGroups: i, columnOverflow:
|
|
|
3654
3654
|
"data-part": "root",
|
|
3655
3655
|
"data-part-root": "",
|
|
3656
3656
|
"data-popin": Ci ? B.popin.length : void 0,
|
|
3657
|
-
"data-narrow": K.width > 0 && K.width <
|
|
3657
|
+
"data-narrow": K.width > 0 && K.width < Ye ? "" : void 0,
|
|
3658
3658
|
"data-rows": Yi ? "auto" : "fixed",
|
|
3659
3659
|
"data-slotted-density": d ?? void 0,
|
|
3660
3660
|
"data-ui": "data-grid",
|
package/dist/data-grid.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./data-grid-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./data-grid-CuHnCT01.js";
|
|
2
2
|
export { e as DRAG_COLUMN, n as DataGrid, i as DataGridDefaultsProvider, r as EXPANDER_COLUMN, a as SELECTION_COLUMN, t as useDataGridDefaults, o as usePersistedGridView };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as e, r as t } from "./i18n-D7xXDd8-.js";
|
|
2
2
|
import { n, t as r } from "./icon-D04-_QFA.js";
|
|
3
|
-
import { _ as i, g as a, h as o, m as s, n as c, o as l, t as ee } from "./menu-parts-
|
|
3
|
+
import { _ as i, g as a, h as o, m as s, n as c, o as l, t as ee } from "./menu-parts-DNQDoJnd.js";
|
|
4
4
|
import { n as u } from "./icon-button-DERKFHX1.js";
|
|
5
5
|
import { t as te } from "./checkbox-Dw9R1CGR.js";
|
|
6
6
|
import { i as d, n as f } from "./skeleton-DeEOmm1y.js";
|
|
@@ -12,8 +12,8 @@ import { withSelectorKey as me } from "@slotted/core/selector-key";
|
|
|
12
12
|
import { Fragment as he, createContext as ge, useContext as _e, useEffect as ve, useId as ye, useImperativeHandle as be, useLayoutEffect as xe, useMemo as Se, useRef as g, useState as _ } from "react";
|
|
13
13
|
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
14
14
|
import { dataListMessages as Ce } from "@slotted/core/i18n";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { nextSelection as we } from "@slotted/core/collection";
|
|
16
|
+
import { getLiveAnnouncer as Te } from "@slotted/core/live-announcer";
|
|
17
17
|
import { applyQuery as Ee, cellValue as De, emptyQuery as Oe, isQueryActive as ke, sameQuery as Ae } from "@slotted/core/grid";
|
|
18
18
|
import { DEFAULT_DATA_LIST_FIELDS as je, dataListFieldText as Me, dataListKeys as Ne, dataListNodes as Pe, describeDataListSort as Fe, resolveDataListLayout as Ie, withDataListSortColumn as Le, withDataListSortDirection as Re } from "@slotted/core/data-list";
|
|
19
19
|
//#region src/data-list/data-list-defaults.tsx
|
|
@@ -145,7 +145,7 @@ function Je({ activatable: ge, className: _e, columnState: je, columns: b, curre
|
|
|
145
145
|
}, [J]);
|
|
146
146
|
let Y = J || Jt, Xt = Y ? null : C && E.length === 0 ? "error" : W.length > 0 ? null : E.length === 0 && !ke(I) ? "empty" : "no-results";
|
|
147
147
|
function Zt(e) {
|
|
148
|
-
|
|
148
|
+
Te(F.current?.ownerDocument).announce(e);
|
|
149
149
|
}
|
|
150
150
|
let X = I.sort[0], Qt = X ? b.find((e) => e.id === X.column) ?? null : null;
|
|
151
151
|
function $t(e, t, n) {
|
|
@@ -159,7 +159,7 @@ function Je({ activatable: ge, className: _e, columnState: je, columns: b, curre
|
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
161
|
if (t && R.current !== void 0) {
|
|
162
|
-
let t =
|
|
162
|
+
let t = we({
|
|
163
163
|
action: "range",
|
|
164
164
|
mode: "multiple",
|
|
165
165
|
selected: K,
|
package/dist/data-list.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./data-list-
|
|
1
|
+
import { n as e, r as t, t as n } from "./data-list-CuzWmmGp.js";
|
|
2
2
|
export { n as DataList, e as DataListDefaultsProvider, t as useDataListDefaults };
|
package/dist/docs/chart.json
CHANGED
|
@@ -1005,6 +1005,8 @@
|
|
|
1005
1005
|
"--slotted-chart-sequential-color",
|
|
1006
1006
|
"--slotted-chart-skeleton-hole",
|
|
1007
1007
|
"--slotted-chart-surface",
|
|
1008
|
+
"--slotted-chart-table-header-surface",
|
|
1009
|
+
"--slotted-chart-table-surface",
|
|
1008
1010
|
"--slotted-chart-tooltip-surface",
|
|
1009
1011
|
"--slotted-control-border-color",
|
|
1010
1012
|
"--slotted-control-font-size-sm",
|
package/dist/docs/chart.md
CHANGED
|
@@ -185,7 +185,7 @@ Excerpt — not a complete module
|
|
|
185
185
|
|
|
186
186
|
## Tokens
|
|
187
187
|
|
|
188
|
-
`--slotted-border-strong`, `--slotted-border-subtle`, `--slotted-border-width-medium`, `--slotted-border-width-thick`, `--slotted-border-width-thin`, `--slotted-chart-area-opacity`, `--slotted-chart-axis-color`, `--slotted-chart-band-color`, `--slotted-chart-bar-radius`, `--slotted-chart-card-padding-block`, `--slotted-chart-card-padding-inline`, `--slotted-chart-card-radius`, `--slotted-chart-color-1`, `--slotted-chart-color-2`, `--slotted-chart-color-3`, `--slotted-chart-color-4`, `--slotted-chart-color-5`, `--slotted-chart-color-6`, `--slotted-chart-color-7`, `--slotted-chart-color-8`, `--slotted-chart-crosshair-color`, `--slotted-chart-focus-color`, `--slotted-chart-gap`, `--slotted-chart-grid-color`, `--slotted-chart-inset`, `--slotted-chart-label-color`, `--slotted-chart-label-size`, `--slotted-chart-line-width`, `--slotted-chart-marker-size`, `--slotted-chart-overlay-backdrop-filter`, `--slotted-chart-plot-block-size`, `--slotted-chart-plot-block-size-lg`, `--slotted-chart-plot-block-size-sm`, `--slotted-chart-radius`, `--slotted-chart-reference-color`, `--slotted-chart-sequential-color`, `--slotted-chart-skeleton-hole`, `--slotted-chart-surface`, `--slotted-chart-tooltip-surface`, `--slotted-control-border-color`, `--slotted-control-font-size-sm`, `--slotted-control-gap-md`, `--slotted-control-gap-sm`, `--slotted-control-height-sm`, `--slotted-control-inner-size-sm`, `--slotted-control-radius`, `--slotted-data-1`, `--slotted-data-2`, `--slotted-data-3`, `--slotted-data-4`, `--slotted-data-5`, `--slotted-data-6`, `--slotted-data-7`, `--slotted-data-8`, `--slotted-duration-instant`, `--slotted-duration-long`, `--slotted-duration-short`, `--slotted-easing-standard`, `--slotted-focus-ring-color`, `--slotted-focus-ring-offset`, `--slotted-focus-ring-width`, `--slotted-font-family-heading`, `--slotted-font-family-sans`, `--slotted-font-size-2xl`, `--slotted-font-size-lg`, `--slotted-font-size-md`, `--slotted-font-size-sm`, `--slotted-font-size-xl`, `--slotted-font-size-xs`, `--slotted-font-weight-medium`, `--slotted-font-weight-semibold`, `--slotted-line-height-2xl`, `--slotted-line-height-lg`, `--slotted-line-height-md`, `--slotted-line-height-sm`, `--slotted-line-height-xs`, `--slotted-radius-full`, `--slotted-radius-lg`, `--slotted-radius-md`, `--slotted-radius-sm`, `--slotted-radius-xs`, `--slotted-shadow-md`, `--slotted-space-1`, `--slotted-space-12`, `--slotted-space-2`, `--slotted-space-3`, `--slotted-space-4`, `--slotted-space-5`, `--slotted-space-6`, `--slotted-space-8`, `--slotted-space-9`, `--slotted-surface`, `--slotted-surface-raised`, `--slotted-target-comfortable`, `--slotted-target-min`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-accent-text`, `--slotted-tone-danger-text`, `--slotted-tone-info-text`, `--slotted-tone-secondary-subtle-hover`, `--slotted-tone-secondary-surface`, `--slotted-tone-secondary-text`, `--slotted-tone-success-text`, `--slotted-tone-warning-text`, `--slotted-z-index-overlay`, `--slotted-z-index-popover`
|
|
188
|
+
`--slotted-border-strong`, `--slotted-border-subtle`, `--slotted-border-width-medium`, `--slotted-border-width-thick`, `--slotted-border-width-thin`, `--slotted-chart-area-opacity`, `--slotted-chart-axis-color`, `--slotted-chart-band-color`, `--slotted-chart-bar-radius`, `--slotted-chart-card-padding-block`, `--slotted-chart-card-padding-inline`, `--slotted-chart-card-radius`, `--slotted-chart-color-1`, `--slotted-chart-color-2`, `--slotted-chart-color-3`, `--slotted-chart-color-4`, `--slotted-chart-color-5`, `--slotted-chart-color-6`, `--slotted-chart-color-7`, `--slotted-chart-color-8`, `--slotted-chart-crosshair-color`, `--slotted-chart-focus-color`, `--slotted-chart-gap`, `--slotted-chart-grid-color`, `--slotted-chart-inset`, `--slotted-chart-label-color`, `--slotted-chart-label-size`, `--slotted-chart-line-width`, `--slotted-chart-marker-size`, `--slotted-chart-overlay-backdrop-filter`, `--slotted-chart-plot-block-size`, `--slotted-chart-plot-block-size-lg`, `--slotted-chart-plot-block-size-sm`, `--slotted-chart-radius`, `--slotted-chart-reference-color`, `--slotted-chart-sequential-color`, `--slotted-chart-skeleton-hole`, `--slotted-chart-surface`, `--slotted-chart-table-header-surface`, `--slotted-chart-table-surface`, `--slotted-chart-tooltip-surface`, `--slotted-control-border-color`, `--slotted-control-font-size-sm`, `--slotted-control-gap-md`, `--slotted-control-gap-sm`, `--slotted-control-height-sm`, `--slotted-control-inner-size-sm`, `--slotted-control-radius`, `--slotted-data-1`, `--slotted-data-2`, `--slotted-data-3`, `--slotted-data-4`, `--slotted-data-5`, `--slotted-data-6`, `--slotted-data-7`, `--slotted-data-8`, `--slotted-duration-instant`, `--slotted-duration-long`, `--slotted-duration-short`, `--slotted-easing-standard`, `--slotted-focus-ring-color`, `--slotted-focus-ring-offset`, `--slotted-focus-ring-width`, `--slotted-font-family-heading`, `--slotted-font-family-sans`, `--slotted-font-size-2xl`, `--slotted-font-size-lg`, `--slotted-font-size-md`, `--slotted-font-size-sm`, `--slotted-font-size-xl`, `--slotted-font-size-xs`, `--slotted-font-weight-medium`, `--slotted-font-weight-semibold`, `--slotted-line-height-2xl`, `--slotted-line-height-lg`, `--slotted-line-height-md`, `--slotted-line-height-sm`, `--slotted-line-height-xs`, `--slotted-radius-full`, `--slotted-radius-lg`, `--slotted-radius-md`, `--slotted-radius-sm`, `--slotted-radius-xs`, `--slotted-shadow-md`, `--slotted-space-1`, `--slotted-space-12`, `--slotted-space-2`, `--slotted-space-3`, `--slotted-space-4`, `--slotted-space-5`, `--slotted-space-6`, `--slotted-space-8`, `--slotted-space-9`, `--slotted-surface`, `--slotted-surface-raised`, `--slotted-target-comfortable`, `--slotted-target-min`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-accent-text`, `--slotted-tone-danger-text`, `--slotted-tone-info-text`, `--slotted-tone-secondary-subtle-hover`, `--slotted-tone-secondary-surface`, `--slotted-tone-secondary-text`, `--slotted-tone-success-text`, `--slotted-tone-warning-text`, `--slotted-z-index-overlay`, `--slotted-z-index-popover`
|
|
189
189
|
|
|
190
190
|
## Examples
|
|
191
191
|
|
package/dist/docs/combobox.json
CHANGED
|
@@ -831,6 +831,7 @@
|
|
|
831
831
|
"--slotted-combobox-disabled-background",
|
|
832
832
|
"--slotted-combobox-disabled-border-color",
|
|
833
833
|
"--slotted-combobox-disabled-color",
|
|
834
|
+
"--slotted-combobox-group-label-height",
|
|
834
835
|
"--slotted-combobox-highlight",
|
|
835
836
|
"--slotted-combobox-highlight-active",
|
|
836
837
|
"--slotted-combobox-highlight-ring",
|
package/dist/docs/combobox.md
CHANGED
|
@@ -190,7 +190,7 @@ export default function ComboboxBasic() {
|
|
|
190
190
|
|
|
191
191
|
## Tokens
|
|
192
192
|
|
|
193
|
-
`--slotted-border-subtle`, `--slotted-border-width-thin`, `--slotted-combobox-action-active-background`, `--slotted-combobox-action-color`, `--slotted-combobox-action-hover-background`, `--slotted-combobox-action-size`, `--slotted-combobox-arrow-color`, `--slotted-combobox-autofill-background`, `--slotted-combobox-background`, `--slotted-combobox-border-color`, `--slotted-combobox-color`, `--slotted-combobox-completion-background`, `--slotted-combobox-completion-color`, `--slotted-combobox-content-backdrop-filter`, `--slotted-combobox-content-border-color`, `--slotted-combobox-content-padding-block`, `--slotted-combobox-content-padding-inline`, `--slotted-combobox-content-radius`, `--slotted-combobox-content-shadow`, `--slotted-combobox-content-text`, `--slotted-combobox-content-text-muted`, `--slotted-combobox-disabled-background`, `--slotted-combobox-disabled-border-color`, `--slotted-combobox-disabled-color`, `--slotted-combobox-highlight`, `--slotted-combobox-highlight-active`, `--slotted-combobox-highlight-ring`, `--slotted-combobox-hover-border-color`, `--slotted-combobox-icon-size-min`, `--slotted-combobox-invalid-border-color`, `--slotted-combobox-invalid-edge-width`, `--slotted-combobox-invalid-focus-ring-color`, `--slotted-combobox-item-radius`, `--slotted-combobox-measure`, `--slotted-combobox-open-border-color`, `--slotted-combobox-placeholder-color`, `--slotted-combobox-plain-hover-background`, `--slotted-combobox-radius`, `--slotted-combobox-readonly-background`, `--slotted-combobox-selected-color`, `--slotted-combobox-separator-color`, `--slotted-combobox-shadow`, `--slotted-combobox-subtle-background`, `--slotted-combobox-subtle-border-color`, `--slotted-combobox-subtle-hover-background`, `--slotted-combobox-surface`, `--slotted-control-border-color`, `--slotted-control-border-width`, `--slotted-control-focus-ring-offset`, `--slotted-control-font-family`, `--slotted-control-font-size-lg`, `--slotted-control-font-size-md`, `--slotted-control-font-size-sm`, `--slotted-control-gap-lg`, `--slotted-control-gap-md`, `--slotted-control-gap-sm`, `--slotted-control-height-lg`, `--slotted-control-height-md`, `--slotted-control-height-sm`, `--slotted-control-icon-size-lg`, `--slotted-control-icon-size-md`, `--slotted-control-icon-size-sm`, `--slotted-control-inner-size-lg`, `--slotted-control-inner-size-md`, `--slotted-control-inner-size-sm`, `--slotted-control-invalid-edge-width`, `--slotted-control-padding-inline-lg`, `--slotted-control-padding-inline-md`, `--slotted-control-padding-inline-sm`, `--slotted-control-radius`, `--slotted-control-shadow`, `--slotted-control-shadow-focus-geometry`, `--slotted-control-surface`, `--slotted-control-transition-duration`, `--slotted-control-transition-easing`, `--slotted-disabled-background`, `--slotted-disabled-border`, `--slotted-disabled-foreground`, `--slotted-duration-medium`, `--slotted-duration-short`, `--slotted-easing-enter`, `--slotted-easing-exit`, `--slotted-easing-standard`, `--slotted-focus-ring-color`, `--slotted-focus-ring-color-invalid`, `--slotted-focus-ring-offset`, `--slotted-focus-ring-width`, `--slotted-font-family-sans`, `--slotted-font-size-xs`, `--slotted-font-weight-medium`, `--slotted-font-weight-semibold`, `--slotted-line-height-md`, `--slotted-line-height-sm`, `--slotted-radius-lg`, `--slotted-radius-none`, `--slotted-shadow-md`, `--slotted-space-1`, `--slotted-space-2`, `--slotted-space-5`, `--slotted-surface-raised`, `--slotted-surface-sunken`, `--slotted-target-comfortable`, `--slotted-target-min`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-accent-border`, `--slotted-tone-accent-surface`, `--slotted-tone-accent-text`, `--slotted-tone-danger-border`, `--slotted-tone-secondary-subtle-active`, `--slotted-tone-secondary-subtle-hover`, `--slotted-z-index-popover`
|
|
193
|
+
`--slotted-border-subtle`, `--slotted-border-width-thin`, `--slotted-combobox-action-active-background`, `--slotted-combobox-action-color`, `--slotted-combobox-action-hover-background`, `--slotted-combobox-action-size`, `--slotted-combobox-arrow-color`, `--slotted-combobox-autofill-background`, `--slotted-combobox-background`, `--slotted-combobox-border-color`, `--slotted-combobox-color`, `--slotted-combobox-completion-background`, `--slotted-combobox-completion-color`, `--slotted-combobox-content-backdrop-filter`, `--slotted-combobox-content-border-color`, `--slotted-combobox-content-padding-block`, `--slotted-combobox-content-padding-inline`, `--slotted-combobox-content-radius`, `--slotted-combobox-content-shadow`, `--slotted-combobox-content-text`, `--slotted-combobox-content-text-muted`, `--slotted-combobox-disabled-background`, `--slotted-combobox-disabled-border-color`, `--slotted-combobox-disabled-color`, `--slotted-combobox-group-label-height`, `--slotted-combobox-highlight`, `--slotted-combobox-highlight-active`, `--slotted-combobox-highlight-ring`, `--slotted-combobox-hover-border-color`, `--slotted-combobox-icon-size-min`, `--slotted-combobox-invalid-border-color`, `--slotted-combobox-invalid-edge-width`, `--slotted-combobox-invalid-focus-ring-color`, `--slotted-combobox-item-radius`, `--slotted-combobox-measure`, `--slotted-combobox-open-border-color`, `--slotted-combobox-placeholder-color`, `--slotted-combobox-plain-hover-background`, `--slotted-combobox-radius`, `--slotted-combobox-readonly-background`, `--slotted-combobox-selected-color`, `--slotted-combobox-separator-color`, `--slotted-combobox-shadow`, `--slotted-combobox-subtle-background`, `--slotted-combobox-subtle-border-color`, `--slotted-combobox-subtle-hover-background`, `--slotted-combobox-surface`, `--slotted-control-border-color`, `--slotted-control-border-width`, `--slotted-control-focus-ring-offset`, `--slotted-control-font-family`, `--slotted-control-font-size-lg`, `--slotted-control-font-size-md`, `--slotted-control-font-size-sm`, `--slotted-control-gap-lg`, `--slotted-control-gap-md`, `--slotted-control-gap-sm`, `--slotted-control-height-lg`, `--slotted-control-height-md`, `--slotted-control-height-sm`, `--slotted-control-icon-size-lg`, `--slotted-control-icon-size-md`, `--slotted-control-icon-size-sm`, `--slotted-control-inner-size-lg`, `--slotted-control-inner-size-md`, `--slotted-control-inner-size-sm`, `--slotted-control-invalid-edge-width`, `--slotted-control-padding-inline-lg`, `--slotted-control-padding-inline-md`, `--slotted-control-padding-inline-sm`, `--slotted-control-radius`, `--slotted-control-shadow`, `--slotted-control-shadow-focus-geometry`, `--slotted-control-surface`, `--slotted-control-transition-duration`, `--slotted-control-transition-easing`, `--slotted-disabled-background`, `--slotted-disabled-border`, `--slotted-disabled-foreground`, `--slotted-duration-medium`, `--slotted-duration-short`, `--slotted-easing-enter`, `--slotted-easing-exit`, `--slotted-easing-standard`, `--slotted-focus-ring-color`, `--slotted-focus-ring-color-invalid`, `--slotted-focus-ring-offset`, `--slotted-focus-ring-width`, `--slotted-font-family-sans`, `--slotted-font-size-xs`, `--slotted-font-weight-medium`, `--slotted-font-weight-semibold`, `--slotted-line-height-md`, `--slotted-line-height-sm`, `--slotted-radius-lg`, `--slotted-radius-none`, `--slotted-shadow-md`, `--slotted-space-1`, `--slotted-space-2`, `--slotted-space-5`, `--slotted-surface-raised`, `--slotted-surface-sunken`, `--slotted-target-comfortable`, `--slotted-target-min`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-accent-border`, `--slotted-tone-accent-surface`, `--slotted-tone-accent-text`, `--slotted-tone-danger-border`, `--slotted-tone-secondary-subtle-active`, `--slotted-tone-secondary-subtle-hover`, `--slotted-z-index-popover`
|
|
194
194
|
|
|
195
195
|
## Examples
|
|
196
196
|
|
package/dist/docs/dialog.json
CHANGED
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
"type": "'sm' | 'md' | 'lg' | 'xl' | 'full'",
|
|
273
273
|
"defaultValue": "md",
|
|
274
274
|
"appliesTo": "Dialog, DialogDefaultsProvider",
|
|
275
|
-
"description": "The maximum width of the panel:
|
|
275
|
+
"description": "The maximum width of the panel: 32rem, the form measure plus the panel padding (43rem by default), 48rem, 56rem, or the whole layer less its padding. For another width, set --slotted-dialog-measure, or --slotted-dialog-measure-sm, -md, -lg or -xl for one step."
|
|
276
276
|
},
|
|
277
277
|
{
|
|
278
278
|
"name": "placement",
|
|
@@ -414,7 +414,14 @@
|
|
|
414
414
|
"type": "length",
|
|
415
415
|
"defaultValue": "from size",
|
|
416
416
|
"appliesTo": "the root part",
|
|
417
|
-
"description": "The maximum width of the panel, for a width the five sizes do not hold, such as a two-column form at 46rem. Set it with a style attribute on one dialog, with a rule for a region, or once in the theme. It takes precedence over size."
|
|
417
|
+
"description": "The maximum width of the panel, for a width the five sizes do not hold, such as a two-column form at 46rem. Set it with a style attribute on one dialog, with a rule for a region, or once in the theme. It takes precedence over size, and a step token takes precedence over it."
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"name": "--slotted-dialog-measure-sm, -md, -lg, -xl",
|
|
421
|
+
"type": "length",
|
|
422
|
+
"defaultValue": "from size",
|
|
423
|
+
"appliesTo": "the root part",
|
|
424
|
+
"description": "The maximum width of one size step, read before --slotted-dialog-measure, so a theme widens one step and keeps the others."
|
|
418
425
|
},
|
|
419
426
|
{
|
|
420
427
|
"name": "container",
|
|
@@ -574,7 +581,7 @@
|
|
|
574
581
|
"type": "'sm' | 'md' | 'lg' | 'xl' | 'full'",
|
|
575
582
|
"defaultValue": "sm",
|
|
576
583
|
"appliesTo": "AlertDialog",
|
|
577
|
-
"description": "The maximum width of the panel. AlertDialog defaults to sm,
|
|
584
|
+
"description": "The maximum width of the panel. AlertDialog defaults to sm, 32rem."
|
|
578
585
|
},
|
|
579
586
|
{
|
|
580
587
|
"name": "placement",
|
|
@@ -702,7 +709,14 @@
|
|
|
702
709
|
"type": "length",
|
|
703
710
|
"defaultValue": "from size",
|
|
704
711
|
"appliesTo": "the root part",
|
|
705
|
-
"description": "The maximum width of the panel, for a width the five sizes do not hold, such as a two-column form at 46rem. Set it with a style attribute on one dialog, with a rule for a region, or once in the theme. It takes precedence over size."
|
|
712
|
+
"description": "The maximum width of the panel, for a width the five sizes do not hold, such as a two-column form at 46rem. Set it with a style attribute on one dialog, with a rule for a region, or once in the theme. It takes precedence over size, and a step token takes precedence over it."
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"name": "--slotted-dialog-measure-sm, -md, -lg, -xl",
|
|
716
|
+
"type": "length",
|
|
717
|
+
"defaultValue": "from size",
|
|
718
|
+
"appliesTo": "the root part",
|
|
719
|
+
"description": "The maximum width of one size step, read before --slotted-dialog-measure, so a theme widens one step and keeps the others."
|
|
706
720
|
},
|
|
707
721
|
{
|
|
708
722
|
"name": "container",
|
|
@@ -778,6 +792,10 @@
|
|
|
778
792
|
"--slotted-dialog-description-color",
|
|
779
793
|
"--slotted-dialog-footer-surface",
|
|
780
794
|
"--slotted-dialog-measure",
|
|
795
|
+
"--slotted-dialog-measure-lg",
|
|
796
|
+
"--slotted-dialog-measure-md",
|
|
797
|
+
"--slotted-dialog-measure-sm",
|
|
798
|
+
"--slotted-dialog-measure-xl",
|
|
781
799
|
"--slotted-dialog-padding-block",
|
|
782
800
|
"--slotted-dialog-padding-block-sm",
|
|
783
801
|
"--slotted-dialog-padding-inline",
|
|
@@ -802,6 +820,7 @@
|
|
|
802
820
|
"--slotted-font-size-md",
|
|
803
821
|
"--slotted-font-size-xl",
|
|
804
822
|
"--slotted-font-weight-semibold",
|
|
823
|
+
"--slotted-form-measure",
|
|
805
824
|
"--slotted-line-height-md",
|
|
806
825
|
"--slotted-radius-lg",
|
|
807
826
|
"--slotted-radius-sm",
|
package/dist/docs/dialog.md
CHANGED
|
@@ -132,65 +132,7 @@ export default function DialogBasic() {
|
|
|
132
132
|
|
|
133
133
|
## Props
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
| Name | Type | Default | Applies to | Description |
|
|
138
|
-
| --- | --- | --- | --- | --- |
|
|
139
|
-
| `open` | `boolean` | — | Dialog, AlertDialog | Whether the dialog is open. Passing it makes the state controlled: the dialog asks through onOpenChange and waits for the new value. |
|
|
140
|
-
| `defaultOpen` | `boolean` | — | Dialog, AlertDialog | Whether an uncontrolled dialog starts open. Read once. |
|
|
141
|
-
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | md | Dialog, DialogDefaultsProvider | The maximum width of the panel: 24rem, 32rem, 42rem, 56rem, or the whole layer less its padding. For another width, set --slotted-dialog-measure. |
|
|
142
|
-
| `placement` | `'center' \| 'top'` | center | Dialog, AlertDialog, DialogDefaultsProvider | Where the panel sits in the layer. Use top for content that grows while the reader types, so the panel does not move with each new line. |
|
|
143
|
-
| `scroll` | `'content' \| 'viewport'` | content | Dialog, AlertDialog, DialogDefaultsProvider | What scrolls when the content is long. content keeps the panel inside the layer and scrolls the body, so the actions stay on screen; viewport lets the panel grow and scrolls the layer. With content, the layer still scrolls when the header and footer alone are taller than it. |
|
|
144
|
-
| `mount` | `'active' \| 'lazy' \| 'eager'` | active | Dialog, AlertDialog, DialogDefaultsProvider | When the layer is in the document. active renders it while open and removes it after the closing animation, lazy renders it on the first open and keeps it, eager renders it from the start and hides it with content-visibility and inert while closed. |
|
|
145
|
-
| `escape` | `'close' \| 'none'` | close | Dialog, AlertDialog, DialogDefaultsProvider | Whether Escape asks the dialog to close. Escape reaches the topmost dialog only. |
|
|
146
|
-
| `loading` | `boolean` | false | Dialog, AlertDialog | Marks the body with aria-busy and gives it a minimum height while the content is on its way. The header, the close button and Escape stay available. |
|
|
147
|
-
| `messages` | `Partial<DialogMessages>` | — | Dialog, AlertDialog | Replaces words of the language in force, key by key: the accessible names of the close and full-screen buttons (close, fullScreen). An aria-label on DialogClose takes precedence. |
|
|
148
|
-
| `initialFocus` | `'first' \| 'container' \| 'cancel' \| RefObject \| false` | first | Dialog | Where focus goes when the dialog opens: the first focusable element, the panel itself (container), the cancel part, the element of a ref, or nowhere (false). Use container for content that is read before it is used, such as a list or a table. |
|
|
149
|
-
| `finalFocus` | `RefObject \| false` | — | Dialog, AlertDialog | Where focus goes when the dialog closes. Unset, focus returns to the element that had it when the dialog opened, usually the trigger. false leaves focus where it is. |
|
|
150
|
-
| `value` | `string` | — | DialogClose, AlertDialogCancel, AlertDialogAction | The result this button closes the dialog with, read from request.result in onOpenChange. AlertDialogCancel defaults to "cancel" and AlertDialogAction to "confirm". |
|
|
151
|
-
| `modal` | `boolean` | true | Dialog, DialogDefaultsProvider | Whether the page behind is inert, its scroll locked and focus kept inside the panel. false does none of this, paints no scrim, lets the pointer reach the page and writes no aria-modal. |
|
|
152
|
-
| `outsidePress` | `'close' \| 'none'` | close | Dialog, DialogDefaultsProvider | Whether a press outside the panel asks the dialog to close. AlertDialog fixes it at none. |
|
|
153
|
-
| `back` | `'close' \| 'none'` | close | Dialog, DialogDefaultsProvider | Whether the browser’s way back, a back button or a phone’s back gesture, closes a modal dialog instead of leaving the page. Each open modal dialog holds one close watcher where the browser has CloseWatcher, and adds one history entry elsewhere; the close request carries the reason back. A dialog opened without a press shares the way back with the layer opened before it. |
|
|
154
|
-
| `surface` | `'panel' \| 'plain'` | panel | Dialog, DialogDefaultsProvider | Whether Dialog paints the panel. plain removes the background, border, radius, shadow, rows and padding, and keeps the portal, the scrim, focus handling and the dismissal policy, for a panel of your own such as a Card or an image viewer. A plain panel does not keep its footer on screen for a long body. |
|
|
155
|
-
| `fullScreen` | `'never' \| 'narrow' \| 'always'` | narrow | Dialog, DialogDefaultsProvider | When the panel fills the whole layer, without margins or radius. narrow does so while the layer is narrower than 480 pixels, measured with a container query on the layer. |
|
|
156
|
-
| `fullscreenToggle` | `boolean` | false | Dialog | Adds a button to the header that expands the panel to the whole layer and restores it, for content the reader wants more room for. |
|
|
157
|
-
| `fullscreen` | `boolean` | — | Dialog | Whether the panel is expanded by the toggle. Passing it makes the state controlled, with onFullscreenChange. |
|
|
158
|
-
| `defaultFullscreen` | `boolean` | false | Dialog | Whether an uncontrolled panel opens expanded. Read once. |
|
|
159
|
-
| `render` | `(props) => ReactNode` | — | every part | Replaces the element a part renders and passes it every attribute the part writes. Use it to make the trigger, the cancel and the action a Button. |
|
|
160
|
-
| `ref` | `Ref<DialogHandle> on Dialog, Ref<HTMLElement> on every part` | — | Dialog, AlertDialog, every part | On a part, the element. On Dialog and AlertDialog, a handle with open(), close(result), focus() and content, the panel element once it is rendered. |
|
|
161
|
-
| `--slotted-dialog-measure` | `length` | from size | the root part | The maximum width of the panel, for a width the five sizes do not hold, such as a two-column form at 46rem. Set it with a style attribute on one dialog, with a rule for a region, or once in the theme. It takes precedence over size. |
|
|
162
|
-
| `container` | `Element \| null` | — | Dialog, AlertDialog | The element this dialog is rendered into, instead of the shared portal root. To change the portal root for the whole document, call setPortalContainer from @slotted/core/portal. |
|
|
163
|
-
| `useDialog()` | `() => DialogContextValue` | — | inside Dialog or AlertDialog | What the parts read: the open state, the ids, the resolved axes and close(reason, result). It throws outside Dialog and AlertDialog. |
|
|
164
|
-
| `DialogDefaultsProvider` | `{ size, placement, scroll, surface, mount, fullScreen, modal, escape, outsidePress, back }` | — | a subtree | Sets these ten values once for every dialog under it. A value set on one dialog takes precedence. |
|
|
165
|
-
|
|
166
|
-
### alertDialog
|
|
167
|
-
|
|
168
|
-
| Name | Type | Default | Applies to | Description |
|
|
169
|
-
| --- | --- | --- | --- | --- |
|
|
170
|
-
| `open` | `boolean` | — | Dialog, AlertDialog | Whether the dialog is open. Passing it makes the state controlled: the dialog asks through onOpenChange and waits for the new value. |
|
|
171
|
-
| `defaultOpen` | `boolean` | — | Dialog, AlertDialog | Whether an uncontrolled dialog starts open. Read once. |
|
|
172
|
-
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | sm | AlertDialog | The maximum width of the panel. AlertDialog defaults to sm, 24rem. |
|
|
173
|
-
| `placement` | `'center' \| 'top'` | center | Dialog, AlertDialog, DialogDefaultsProvider | Where the panel sits in the layer. Use top for content that grows while the reader types, so the panel does not move with each new line. |
|
|
174
|
-
| `scroll` | `'content' \| 'viewport'` | content | Dialog, AlertDialog, DialogDefaultsProvider | What scrolls when the content is long. content keeps the panel inside the layer and scrolls the body, so the actions stay on screen; viewport lets the panel grow and scrolls the layer. With content, the layer still scrolls when the header and footer alone are taller than it. |
|
|
175
|
-
| `mount` | `'active' \| 'lazy' \| 'eager'` | active | Dialog, AlertDialog, DialogDefaultsProvider | When the layer is in the document. active renders it while open and removes it after the closing animation, lazy renders it on the first open and keeps it, eager renders it from the start and hides it with content-visibility and inert while closed. |
|
|
176
|
-
| `escape` | `'close' \| 'none'` | close | Dialog, AlertDialog, DialogDefaultsProvider | Whether Escape asks the dialog to close. Escape reaches the topmost dialog only. |
|
|
177
|
-
| `loading` | `boolean` | false | Dialog, AlertDialog | Marks the body with aria-busy and gives it a minimum height while the content is on its way. The header, the close button and Escape stay available. |
|
|
178
|
-
| `messages` | `Partial<DialogMessages>` | — | Dialog, AlertDialog | Replaces words of the language in force, key by key: the accessible names of the close and full-screen buttons (close, fullScreen). An aria-label on DialogClose takes precedence. |
|
|
179
|
-
| `initialFocus` | `'first' \| 'container' \| 'cancel' \| RefObject \| false` | cancel | AlertDialog | Where focus goes when the dialog opens. The default, cancel, is the least destructive answer. |
|
|
180
|
-
| `finalFocus` | `RefObject \| false` | — | Dialog, AlertDialog | Where focus goes when the dialog closes. Unset, focus returns to the element that had it when the dialog opened, usually the trigger. false leaves focus where it is. |
|
|
181
|
-
| `value` | `string` | — | DialogClose, AlertDialogCancel, AlertDialogAction | The result this button closes the dialog with, read from request.result in onOpenChange. AlertDialogCancel defaults to "cancel" and AlertDialogAction to "confirm". |
|
|
182
|
-
| `tone` | `'accent' \| 'secondary' \| 'info' \| 'success' \| 'warning' \| 'danger'` | danger | AlertDialog | The kind of decision. It sets the mark AlertDialogIcon draws and its colour. |
|
|
183
|
-
| `modal` | `boolean` | true | AlertDialog | Fixed: an alert dialog is always modal. |
|
|
184
|
-
| `outsidePress` | `'close' \| 'none'` | none | AlertDialog | Fixed: a press outside never closes an alert dialog. |
|
|
185
|
-
| `back` | `'close' \| 'none'` | close | AlertDialog | Whether the browser’s way back cancels the confirmation, as Escape does. The close request carries the reason back. |
|
|
186
|
-
| `surface` | `'panel' \| 'plain'` | panel | AlertDialog | Whether AlertDialog paints the panel. plain removes the paint and keeps the behaviour. |
|
|
187
|
-
| `fullScreen` | `'never' \| 'narrow' \| 'always'` | never | AlertDialog | When the panel fills the whole layer. AlertDialog keeps its margins at every width by default. |
|
|
188
|
-
| `render` | `(props) => ReactNode` | — | every part | Replaces the element a part renders and passes it every attribute the part writes. Use it to make the trigger, the cancel and the action a Button. |
|
|
189
|
-
| `ref` | `Ref<DialogHandle> on Dialog, Ref<HTMLElement> on every part` | — | Dialog, AlertDialog, every part | On a part, the element. On Dialog and AlertDialog, a handle with open(), close(result), focus() and content, the panel element once it is rendered. |
|
|
190
|
-
| `--slotted-dialog-measure` | `length` | from size | the root part | The maximum width of the panel, for a width the five sizes do not hold, such as a two-column form at 46rem. Set it with a style attribute on one dialog, with a rule for a region, or once in the theme. It takes precedence over size. |
|
|
191
|
-
| `container` | `Element \| null` | — | Dialog, AlertDialog | The element this dialog is rendered into, instead of the shared portal root. To change the portal root for the whole document, call setPortalContainer from @slotted/core/portal. |
|
|
192
|
-
| `useDialog()` | `() => DialogContextValue` | — | inside Dialog or AlertDialog | What the parts read: the open state, the ids, the resolved axes and close(reason, result). It throws outside Dialog and AlertDialog. |
|
|
193
|
-
| `DialogDefaultsProvider` | `{ size, placement, scroll, surface, mount, fullScreen, modal, escape, outsidePress, back }` | — | a subtree | Sets these ten values once for every dialog under it. A value set on one dialog takes precedence. |
|
|
135
|
+
See [dialog.props.md](./dialog.props.md).
|
|
194
136
|
|
|
195
137
|
## Events
|
|
196
138
|
|
|
@@ -247,7 +189,7 @@ export default function DialogBasic() {
|
|
|
247
189
|
|
|
248
190
|
## Tokens
|
|
249
191
|
|
|
250
|
-
`--slotted-border-subtle`, `--slotted-border-width-thick`, `--slotted-border-width-thin`, `--slotted-control-font-family`, `--slotted-control-icon-size-lg`, `--slotted-control-inner-size-lg`, `--slotted-control-radius`, `--slotted-control-transition-duration`, `--slotted-control-transition-easing`, `--slotted-dialog-backdrop-filter`, `--slotted-dialog-body-color`, `--slotted-dialog-border-color`, `--slotted-dialog-close-active-background`, `--slotted-dialog-close-color`, `--slotted-dialog-close-hover-background`, `--slotted-dialog-color`, `--slotted-dialog-description-color`, `--slotted-dialog-footer-surface`, `--slotted-dialog-measure`, `--slotted-dialog-padding-block`, `--slotted-dialog-padding-block-sm`, `--slotted-dialog-padding-inline`, `--slotted-dialog-padding-inline-sm`, `--slotted-dialog-radius`, `--slotted-dialog-rule-color`, `--slotted-dialog-scrim`, `--slotted-dialog-surface`, `--slotted-dialog-title-color`, `--slotted-dialog-title-font-family`, `--slotted-duration-long`, `--slotted-duration-medium`, `--slotted-duration-short`, `--slotted-easing-exit`, `--slotted-easing-standard`, `--slotted-focus-ring-color`, `--slotted-focus-ring-offset`, `--slotted-focus-ring-width`, `--slotted-font-family-heading`, `--slotted-font-family-sans`, `--slotted-font-size-lg`, `--slotted-font-size-md`, `--slotted-font-size-xl`, `--slotted-font-weight-semibold`, `--slotted-line-height-md`, `--slotted-radius-lg`, `--slotted-radius-sm`, `--slotted-scrim`, `--slotted-shadow-lg`, `--slotted-space-12`, `--slotted-space-2`, `--slotted-space-4`, `--slotted-space-5`, `--slotted-space-6`, `--slotted-space-7`, `--slotted-space-8`, `--slotted-surface-raised`, `--slotted-surface-sunken`, `--slotted-target-comfortable`, `--slotted-target-min`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-accent-text`, `--slotted-tone-danger-text`, `--slotted-tone-info-text`, `--slotted-tone-secondary-subtle-active`, `--slotted-tone-secondary-subtle-hover`, `--slotted-tone-secondary-text`, `--slotted-tone-success-text`, `--slotted-tone-warning-text`, `--slotted-z-index-overlay`
|
|
192
|
+
`--slotted-border-subtle`, `--slotted-border-width-thick`, `--slotted-border-width-thin`, `--slotted-control-font-family`, `--slotted-control-icon-size-lg`, `--slotted-control-inner-size-lg`, `--slotted-control-radius`, `--slotted-control-transition-duration`, `--slotted-control-transition-easing`, `--slotted-dialog-backdrop-filter`, `--slotted-dialog-body-color`, `--slotted-dialog-border-color`, `--slotted-dialog-close-active-background`, `--slotted-dialog-close-color`, `--slotted-dialog-close-hover-background`, `--slotted-dialog-color`, `--slotted-dialog-description-color`, `--slotted-dialog-footer-surface`, `--slotted-dialog-measure`, `--slotted-dialog-measure-lg`, `--slotted-dialog-measure-md`, `--slotted-dialog-measure-sm`, `--slotted-dialog-measure-xl`, `--slotted-dialog-padding-block`, `--slotted-dialog-padding-block-sm`, `--slotted-dialog-padding-inline`, `--slotted-dialog-padding-inline-sm`, `--slotted-dialog-radius`, `--slotted-dialog-rule-color`, `--slotted-dialog-scrim`, `--slotted-dialog-surface`, `--slotted-dialog-title-color`, `--slotted-dialog-title-font-family`, `--slotted-duration-long`, `--slotted-duration-medium`, `--slotted-duration-short`, `--slotted-easing-exit`, `--slotted-easing-standard`, `--slotted-focus-ring-color`, `--slotted-focus-ring-offset`, `--slotted-focus-ring-width`, `--slotted-font-family-heading`, `--slotted-font-family-sans`, `--slotted-font-size-lg`, `--slotted-font-size-md`, `--slotted-font-size-xl`, `--slotted-font-weight-semibold`, `--slotted-form-measure`, `--slotted-line-height-md`, `--slotted-radius-lg`, `--slotted-radius-sm`, `--slotted-scrim`, `--slotted-shadow-lg`, `--slotted-space-12`, `--slotted-space-2`, `--slotted-space-4`, `--slotted-space-5`, `--slotted-space-6`, `--slotted-space-7`, `--slotted-space-8`, `--slotted-surface-raised`, `--slotted-surface-sunken`, `--slotted-target-comfortable`, `--slotted-target-min`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-accent-text`, `--slotted-tone-danger-text`, `--slotted-tone-info-text`, `--slotted-tone-secondary-subtle-active`, `--slotted-tone-secondary-subtle-hover`, `--slotted-tone-secondary-text`, `--slotted-tone-success-text`, `--slotted-tone-warning-text`, `--slotted-z-index-overlay`
|
|
251
193
|
|
|
252
194
|
## Examples
|
|
253
195
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<!-- index: ./index.md -->
|
|
2
|
+
# dialog
|
|
3
|
+
|
|
4
|
+
`data-ui="dialog"` · Modal dialog and alert dialog.
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
### dialog
|
|
9
|
+
|
|
10
|
+
| Name | Type | Default | Applies to | Description |
|
|
11
|
+
| --- | --- | --- | --- | --- |
|
|
12
|
+
| `open` | `boolean` | — | Dialog, AlertDialog | Whether the dialog is open. Passing it makes the state controlled: the dialog asks through onOpenChange and waits for the new value. |
|
|
13
|
+
| `defaultOpen` | `boolean` | — | Dialog, AlertDialog | Whether an uncontrolled dialog starts open. Read once. |
|
|
14
|
+
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | md | Dialog, DialogDefaultsProvider | The maximum width of the panel: 32rem, the form measure plus the panel padding (43rem by default), 48rem, 56rem, or the whole layer less its padding. For another width, set --slotted-dialog-measure, or --slotted-dialog-measure-sm, -md, -lg or -xl for one step. |
|
|
15
|
+
| `placement` | `'center' \| 'top'` | center | Dialog, AlertDialog, DialogDefaultsProvider | Where the panel sits in the layer. Use top for content that grows while the reader types, so the panel does not move with each new line. |
|
|
16
|
+
| `scroll` | `'content' \| 'viewport'` | content | Dialog, AlertDialog, DialogDefaultsProvider | What scrolls when the content is long. content keeps the panel inside the layer and scrolls the body, so the actions stay on screen; viewport lets the panel grow and scrolls the layer. With content, the layer still scrolls when the header and footer alone are taller than it. |
|
|
17
|
+
| `mount` | `'active' \| 'lazy' \| 'eager'` | active | Dialog, AlertDialog, DialogDefaultsProvider | When the layer is in the document. active renders it while open and removes it after the closing animation, lazy renders it on the first open and keeps it, eager renders it from the start and hides it with content-visibility and inert while closed. |
|
|
18
|
+
| `escape` | `'close' \| 'none'` | close | Dialog, AlertDialog, DialogDefaultsProvider | Whether Escape asks the dialog to close. Escape reaches the topmost dialog only. |
|
|
19
|
+
| `loading` | `boolean` | false | Dialog, AlertDialog | Marks the body with aria-busy and gives it a minimum height while the content is on its way. The header, the close button and Escape stay available. |
|
|
20
|
+
| `messages` | `Partial<DialogMessages>` | — | Dialog, AlertDialog | Replaces words of the language in force, key by key: the accessible names of the close and full-screen buttons (close, fullScreen). An aria-label on DialogClose takes precedence. |
|
|
21
|
+
| `initialFocus` | `'first' \| 'container' \| 'cancel' \| RefObject \| false` | first | Dialog | Where focus goes when the dialog opens: the first focusable element, the panel itself (container), the cancel part, the element of a ref, or nowhere (false). Use container for content that is read before it is used, such as a list or a table. |
|
|
22
|
+
| `finalFocus` | `RefObject \| false` | — | Dialog, AlertDialog | Where focus goes when the dialog closes. Unset, focus returns to the element that had it when the dialog opened, usually the trigger. false leaves focus where it is. |
|
|
23
|
+
| `value` | `string` | — | DialogClose, AlertDialogCancel, AlertDialogAction | The result this button closes the dialog with, read from request.result in onOpenChange. AlertDialogCancel defaults to "cancel" and AlertDialogAction to "confirm". |
|
|
24
|
+
| `modal` | `boolean` | true | Dialog, DialogDefaultsProvider | Whether the page behind is inert, its scroll locked and focus kept inside the panel. false does none of this, paints no scrim, lets the pointer reach the page and writes no aria-modal. |
|
|
25
|
+
| `outsidePress` | `'close' \| 'none'` | close | Dialog, DialogDefaultsProvider | Whether a press outside the panel asks the dialog to close. AlertDialog fixes it at none. |
|
|
26
|
+
| `back` | `'close' \| 'none'` | close | Dialog, DialogDefaultsProvider | Whether the browser’s way back, a back button or a phone’s back gesture, closes a modal dialog instead of leaving the page. Each open modal dialog holds one close watcher where the browser has CloseWatcher, and adds one history entry elsewhere; the close request carries the reason back. A dialog opened without a press shares the way back with the layer opened before it. |
|
|
27
|
+
| `surface` | `'panel' \| 'plain'` | panel | Dialog, DialogDefaultsProvider | Whether Dialog paints the panel. plain removes the background, border, radius, shadow, rows and padding, and keeps the portal, the scrim, focus handling and the dismissal policy, for a panel of your own such as a Card or an image viewer. A plain panel does not keep its footer on screen for a long body. |
|
|
28
|
+
| `fullScreen` | `'never' \| 'narrow' \| 'always'` | narrow | Dialog, DialogDefaultsProvider | When the panel fills the whole layer, without margins or radius. narrow does so while the layer is narrower than 480 pixels, measured with a container query on the layer. |
|
|
29
|
+
| `fullscreenToggle` | `boolean` | false | Dialog | Adds a button to the header that expands the panel to the whole layer and restores it, for content the reader wants more room for. |
|
|
30
|
+
| `fullscreen` | `boolean` | — | Dialog | Whether the panel is expanded by the toggle. Passing it makes the state controlled, with onFullscreenChange. |
|
|
31
|
+
| `defaultFullscreen` | `boolean` | false | Dialog | Whether an uncontrolled panel opens expanded. Read once. |
|
|
32
|
+
| `render` | `(props) => ReactNode` | — | every part | Replaces the element a part renders and passes it every attribute the part writes. Use it to make the trigger, the cancel and the action a Button. |
|
|
33
|
+
| `ref` | `Ref<DialogHandle> on Dialog, Ref<HTMLElement> on every part` | — | Dialog, AlertDialog, every part | On a part, the element. On Dialog and AlertDialog, a handle with open(), close(result), focus() and content, the panel element once it is rendered. |
|
|
34
|
+
| `--slotted-dialog-measure` | `length` | from size | the root part | The maximum width of the panel, for a width the five sizes do not hold, such as a two-column form at 46rem. Set it with a style attribute on one dialog, with a rule for a region, or once in the theme. It takes precedence over size, and a step token takes precedence over it. |
|
|
35
|
+
| `--slotted-dialog-measure-sm, -md, -lg, -xl` | `length` | from size | the root part | The maximum width of one size step, read before --slotted-dialog-measure, so a theme widens one step and keeps the others. |
|
|
36
|
+
| `container` | `Element \| null` | — | Dialog, AlertDialog | The element this dialog is rendered into, instead of the shared portal root. To change the portal root for the whole document, call setPortalContainer from @slotted/core/portal. |
|
|
37
|
+
| `useDialog()` | `() => DialogContextValue` | — | inside Dialog or AlertDialog | What the parts read: the open state, the ids, the resolved axes and close(reason, result). It throws outside Dialog and AlertDialog. |
|
|
38
|
+
| `DialogDefaultsProvider` | `{ size, placement, scroll, surface, mount, fullScreen, modal, escape, outsidePress, back }` | — | a subtree | Sets these ten values once for every dialog under it. A value set on one dialog takes precedence. |
|
|
39
|
+
|
|
40
|
+
### alertDialog
|
|
41
|
+
|
|
42
|
+
| Name | Type | Default | Applies to | Description |
|
|
43
|
+
| --- | --- | --- | --- | --- |
|
|
44
|
+
| `open` | `boolean` | — | Dialog, AlertDialog | Whether the dialog is open. Passing it makes the state controlled: the dialog asks through onOpenChange and waits for the new value. |
|
|
45
|
+
| `defaultOpen` | `boolean` | — | Dialog, AlertDialog | Whether an uncontrolled dialog starts open. Read once. |
|
|
46
|
+
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | sm | AlertDialog | The maximum width of the panel. AlertDialog defaults to sm, 32rem. |
|
|
47
|
+
| `placement` | `'center' \| 'top'` | center | Dialog, AlertDialog, DialogDefaultsProvider | Where the panel sits in the layer. Use top for content that grows while the reader types, so the panel does not move with each new line. |
|
|
48
|
+
| `scroll` | `'content' \| 'viewport'` | content | Dialog, AlertDialog, DialogDefaultsProvider | What scrolls when the content is long. content keeps the panel inside the layer and scrolls the body, so the actions stay on screen; viewport lets the panel grow and scrolls the layer. With content, the layer still scrolls when the header and footer alone are taller than it. |
|
|
49
|
+
| `mount` | `'active' \| 'lazy' \| 'eager'` | active | Dialog, AlertDialog, DialogDefaultsProvider | When the layer is in the document. active renders it while open and removes it after the closing animation, lazy renders it on the first open and keeps it, eager renders it from the start and hides it with content-visibility and inert while closed. |
|
|
50
|
+
| `escape` | `'close' \| 'none'` | close | Dialog, AlertDialog, DialogDefaultsProvider | Whether Escape asks the dialog to close. Escape reaches the topmost dialog only. |
|
|
51
|
+
| `loading` | `boolean` | false | Dialog, AlertDialog | Marks the body with aria-busy and gives it a minimum height while the content is on its way. The header, the close button and Escape stay available. |
|
|
52
|
+
| `messages` | `Partial<DialogMessages>` | — | Dialog, AlertDialog | Replaces words of the language in force, key by key: the accessible names of the close and full-screen buttons (close, fullScreen). An aria-label on DialogClose takes precedence. |
|
|
53
|
+
| `initialFocus` | `'first' \| 'container' \| 'cancel' \| RefObject \| false` | cancel | AlertDialog | Where focus goes when the dialog opens. The default, cancel, is the least destructive answer. |
|
|
54
|
+
| `finalFocus` | `RefObject \| false` | — | Dialog, AlertDialog | Where focus goes when the dialog closes. Unset, focus returns to the element that had it when the dialog opened, usually the trigger. false leaves focus where it is. |
|
|
55
|
+
| `value` | `string` | — | DialogClose, AlertDialogCancel, AlertDialogAction | The result this button closes the dialog with, read from request.result in onOpenChange. AlertDialogCancel defaults to "cancel" and AlertDialogAction to "confirm". |
|
|
56
|
+
| `tone` | `'accent' \| 'secondary' \| 'info' \| 'success' \| 'warning' \| 'danger'` | danger | AlertDialog | The kind of decision. It sets the mark AlertDialogIcon draws and its colour. |
|
|
57
|
+
| `modal` | `boolean` | true | AlertDialog | Fixed: an alert dialog is always modal. |
|
|
58
|
+
| `outsidePress` | `'close' \| 'none'` | none | AlertDialog | Fixed: a press outside never closes an alert dialog. |
|
|
59
|
+
| `back` | `'close' \| 'none'` | close | AlertDialog | Whether the browser’s way back cancels the confirmation, as Escape does. The close request carries the reason back. |
|
|
60
|
+
| `surface` | `'panel' \| 'plain'` | panel | AlertDialog | Whether AlertDialog paints the panel. plain removes the paint and keeps the behaviour. |
|
|
61
|
+
| `fullScreen` | `'never' \| 'narrow' \| 'always'` | never | AlertDialog | When the panel fills the whole layer. AlertDialog keeps its margins at every width by default. |
|
|
62
|
+
| `render` | `(props) => ReactNode` | — | every part | Replaces the element a part renders and passes it every attribute the part writes. Use it to make the trigger, the cancel and the action a Button. |
|
|
63
|
+
| `ref` | `Ref<DialogHandle> on Dialog, Ref<HTMLElement> on every part` | — | Dialog, AlertDialog, every part | On a part, the element. On Dialog and AlertDialog, a handle with open(), close(result), focus() and content, the panel element once it is rendered. |
|
|
64
|
+
| `--slotted-dialog-measure` | `length` | from size | the root part | The maximum width of the panel, for a width the five sizes do not hold, such as a two-column form at 46rem. Set it with a style attribute on one dialog, with a rule for a region, or once in the theme. It takes precedence over size, and a step token takes precedence over it. |
|
|
65
|
+
| `--slotted-dialog-measure-sm, -md, -lg, -xl` | `length` | from size | the root part | The maximum width of one size step, read before --slotted-dialog-measure, so a theme widens one step and keeps the others. |
|
|
66
|
+
| `container` | `Element \| null` | — | Dialog, AlertDialog | The element this dialog is rendered into, instead of the shared portal root. To change the portal root for the whole document, call setPortalContainer from @slotted/core/portal. |
|
|
67
|
+
| `useDialog()` | `() => DialogContextValue` | — | inside Dialog or AlertDialog | What the parts read: the open state, the ids, the resolved axes and close(reason, result). It throws outside Dialog and AlertDialog. |
|
|
68
|
+
| `DialogDefaultsProvider` | `{ size, placement, scroll, surface, mount, fullScreen, modal, escape, outsidePress, back }` | — | a subtree | Sets these ten values once for every dialog under it. A value set on one dialog takes precedence. |
|