@sylwellsoftware/fray 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +51 -27
  2. package/colors/README.md +28 -13
  3. package/colors/gray/colors.css +54 -26
  4. package/colors/green/colors.css +54 -26
  5. package/colors/iceblue/colors.css +54 -26
  6. package/colors/ocean/colors.css +54 -26
  7. package/colors/orange/colors.css +54 -26
  8. package/colors/purple/colors.css +54 -26
  9. package/colors/red/colors.css +54 -26
  10. package/colors/yellow/colors.css +54 -26
  11. package/dist/Components/data/descriptionList.d.ts.map +1 -1
  12. package/dist/Components/data/listview/listview.d.ts.map +1 -1
  13. package/dist/Components/data/table/DataTable.d.ts.map +1 -1
  14. package/dist/Components/data/table/FilterPanel.d.ts.map +1 -1
  15. package/dist/Components/data/table/TableHeaderCell.d.ts.map +1 -1
  16. package/dist/Components/data/treeview/treeview.d.ts.map +1 -1
  17. package/dist/Components/dialog/dialog.d.ts.map +1 -1
  18. package/dist/Components/layout/panel.d.ts +0 -1
  19. package/dist/Components/layout/panel.d.ts.map +1 -1
  20. package/dist/Components/layout/sidebar.d.ts +0 -1
  21. package/dist/Components/layout/sidebar.d.ts.map +1 -1
  22. package/dist/Components/layout/tabpanel/tabline.d.ts.map +1 -1
  23. package/dist/Components/layout/tabpanel/tabpanel.d.ts.map +1 -1
  24. package/dist/Components/lineinputs/checkbox/Checkbox.d.ts.map +1 -1
  25. package/dist/Components/lineinputs/dropdown.d.ts.map +1 -1
  26. package/dist/Components/lineinputs/textbox.d.ts.map +1 -1
  27. package/dist/Components/lineinputs/toggle.d.ts.map +1 -1
  28. package/dist/Components/menu/toolbar.d.ts +0 -1
  29. package/dist/Components/menu/toolbar.d.ts.map +1 -1
  30. package/dist/Components/status/progressBar.d.ts.map +1 -1
  31. package/dist/Components/theme/stylesheetPicker.d.ts.map +1 -1
  32. package/dist/index.js +1226 -1421
  33. package/dist/index.js.map +1 -1
  34. package/dist/{jsx-dev-runtime-pzseD2Sz.js → jsx-dev-runtime-CqunwZ8j.js} +404 -486
  35. package/dist/jsx-dev-runtime-CqunwZ8j.js.map +1 -0
  36. package/dist/jsx-dev-runtime.js +1 -1
  37. package/dist/jsx-runtime.js +1 -1
  38. package/dist/styling/baseStyleDefinitions.d.ts +0 -82
  39. package/dist/styling/baseStyleDefinitions.d.ts.map +1 -1
  40. package/dist/styling/theme.d.ts +3 -3
  41. package/dist/styling/theme.d.ts.map +1 -1
  42. package/package.json +3 -3
  43. package/styles/structural.css +72 -413
  44. package/themes/README.md +68 -66
  45. package/themes/dark.css +48 -1
  46. package/themes/java/theme.css +410 -135
  47. package/themes/light.css +48 -1
  48. package/themes/minimal/theme.css +408 -125
  49. package/themes/shiny/theme.css +484 -294
  50. package/dist/jsx-dev-runtime-pzseD2Sz.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  var Ye = Object.defineProperty;
2
- var _e = (t, r, e) => r in t ? Ye(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
- var s = (t, r, e) => _e(t, typeof r != "symbol" ? r + "" : r, e);
4
- import { C as g, j as u, c as v, a as w, i as ie } from "./jsx-dev-runtime-pzseD2Sz.js";
5
- import { F as pr, b as mr, S as br, d as yr, e as gr, f as wr, g as Er, h as vr, k as Sr, l as kr, m as Ir, n as xr, p as Tr, s as Rr } from "./jsx-dev-runtime-pzseD2Sz.js";
6
- import { Emitter as I, DerivedEmitter as le, FetchState as k, QueryArg as ke, LiveQuery as Xe, RestQueryHandler as Ze } from "@sylwellsoftware/glue";
7
- class ze extends g {
2
+ var Xe = (t, r, e) => r in t ? Ye(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
+ var o = (t, r, e) => Xe(t, typeof r != "symbol" ? r + "" : r, e);
4
+ import { C as y, j as u, c as S, a as w, i as ie } from "./jsx-dev-runtime-CqunwZ8j.js";
5
+ import { F as br, b as gr, S as yr, d as wr, e as Er, f as Sr, g as Ir, h as kr, k as xr, l as vr, m as Tr, n as Rr, p as Nr, s as $r } from "./jsx-dev-runtime-CqunwZ8j.js";
6
+ import { Emitter as x, DerivedEmitter as ae, FetchState as k, QueryArg as ve, LiveQuery as Ze, RestQueryHandler as et } from "@sylwellsoftware/glue";
7
+ class qe extends y {
8
8
  render() {
9
9
  return this.props.children ?? [];
10
10
  }
11
11
  }
12
- const y = {
12
+ const b = {
13
13
  /** Deny mode: Excludes items that match the filter. */
14
14
  Deny: "deny",
15
15
  /** Require mode: Includes only items that match the filter. */
@@ -19,27 +19,30 @@ const y = {
19
19
  /** Neutral mode: Does not affect the inclusion or exclusion of items. */
20
20
  Neutral: "neutral"
21
21
  };
22
- function de(t) {
23
- return Object.values(y).some((r) => r === t);
22
+ function le(t) {
23
+ return Object.values(b).some((r) => r === t);
24
24
  }
25
- let et = 1;
26
- function j(t, r) {
27
- return r != null && String(r).length > 0 ? String(r) : `fray-${t}-${et++}`;
25
+ let tt = 1;
26
+ function F(t, r) {
27
+ return r != null && String(r).length > 0 ? String(r) : `fray-${t}-${tt++}`;
28
28
  }
29
- function M(t, r, e, a) {
29
+ function z(t, r, e, i) {
30
30
  if (r.valueEmitter != null)
31
- return tt(r.valueEmitter, "valueEmitter"), r.valueEmitter;
32
- const i = r.defaultValue ?? r.value ?? r.initialValue ?? e, n = { owner: t, purpose: a };
33
- return new I(i, n);
31
+ return rt(r.valueEmitter, "valueEmitter"), r.valueEmitter;
32
+ const s = r.defaultValue ?? r.value ?? r.initialValue ?? e, n = { owner: t, purpose: i };
33
+ return new x(s, n);
34
34
  }
35
- function tt(t, r = "emitter") {
35
+ function rt(t, r = "emitter") {
36
36
  if (t == null || typeof t != "object" && typeof t != "function" || typeof Reflect.get(t, "get") != "function" || typeof Reflect.get(t, "set") != "function" || typeof Reflect.get(t, "subscribe") != "function")
37
37
  throw new TypeError(`${r} must be an emitter`);
38
38
  }
39
+ function R(...t) {
40
+ return t.flatMap((r) => typeof r == "string" ? r.split(/\s+/) : []).filter(Boolean).join(" ");
41
+ }
39
42
  function E(t) {
40
43
  return t.className ?? t.class ?? "";
41
44
  }
42
- function C(t, ...r) {
45
+ function K(t, ...r) {
43
46
  if (t != null) {
44
47
  if (typeof t != "function") throw new TypeError("Control callback must be a function");
45
48
  t(...r);
@@ -48,54 +51,53 @@ function C(t, ...r) {
48
51
  function fe(t, r = "options") {
49
52
  if (!Array.isArray(t)) throw new TypeError(`${r} must be an array`);
50
53
  }
51
- function rt(t) {
52
- return de(t) ? t : String(t);
54
+ function it(t) {
55
+ return le(t) ? t : String(t);
53
56
  }
54
- class L extends g {
57
+ class V extends y {
55
58
  constructor(e = {}) {
56
59
  var n;
57
60
  super(e);
58
- s(this, "valueEmitter");
59
- s(this, "activeTabEmitter");
60
- const a = e.tabs ?? [];
61
- Ie(a);
62
- const i = { ...e };
63
- i.valueEmitter == null && e.activeTabEmitter != null && (i.valueEmitter = e.activeTabEmitter), i.defaultValue == null && e.initialActiveTabId != null && (i.defaultValue = e.initialActiveTabId), this.valueEmitter = M(
61
+ o(this, "valueEmitter");
62
+ o(this, "activeTabEmitter");
63
+ const i = e.tabs ?? [];
64
+ Te(i);
65
+ const s = { ...e };
66
+ s.valueEmitter == null && e.activeTabEmitter != null && (s.valueEmitter = e.activeTabEmitter), s.defaultValue == null && e.initialActiveTabId != null && (s.defaultValue = e.initialActiveTabId), this.valueEmitter = z(
64
67
  this,
65
- i,
66
- ((n = a.find((o) => !o.disabled)) == null ? void 0 : n.id) ?? null,
68
+ s,
69
+ ((n = i.find((a) => !a.disabled)) == null ? void 0 : n.id) ?? null,
67
70
  "active tab"
68
71
  ), this.activeTabEmitter = this.valueEmitter;
69
72
  }
70
73
  initialize() {
71
74
  this.watch(this.valueEmitter);
72
75
  }
73
- selectTab(e, a = null) {
74
- e == null || e.disabled || (this.valueEmitter.set(e.id, "tab selected"), C(this.props.onChange, e.id, a));
76
+ selectTab(e, i = null) {
77
+ e == null || e.disabled || (this.valueEmitter.set(e.id, "tab selected"), K(this.props.onChange, e.id, i));
75
78
  }
76
79
  render() {
77
- const { tabs: e = [], label: a = "Sections", baseId: i = "fray-tabs" } = this.props;
78
- Ie(e);
79
- const n = this.valueEmitter.get(), o = this.Host;
80
+ const { tabs: e = [], label: i = "Sections", baseId: s = "fray-tabs" } = this.props;
81
+ Te(e);
82
+ const n = this.valueEmitter.get(), a = this.Host;
80
83
  return /* @__PURE__ */ u(
81
- o,
84
+ a,
82
85
  {
83
86
  role: "tablist",
84
87
  className: E(this.props) || null,
85
- "aria-label": a,
86
- children: e.map((l, d) => /* @__PURE__ */ u(
88
+ "aria-label": i,
89
+ children: e.map((l, c) => /* @__PURE__ */ u(
87
90
  "button",
88
91
  {
89
- id: qe(i, l.id),
92
+ id: Le(s, l.id),
90
93
  type: "button",
91
94
  role: "tab",
92
95
  disabled: !!l.disabled,
93
- "data-part": "tab",
94
96
  "aria-selected": Object.is(n, l.id) ? "true" : "false",
95
- "aria-controls": Le(i, l.id),
97
+ "aria-controls": Ve(s, l.id),
96
98
  tabIndex: Object.is(n, l.id) ? 0 : -1,
97
99
  onClick: (h) => this.selectTab(l, h),
98
- onKeyDown: (h) => this.handleKeyDown(h, d, e),
100
+ onKeyDown: (h) => this.handleKeyDown(h, c, e),
99
101
  children: l.label ?? String(l.id)
100
102
  },
101
103
  String(l.id)
@@ -103,59 +105,46 @@ class L extends g {
103
105
  }
104
106
  );
105
107
  }
106
- handleKeyDown(e, a, i) {
107
- const n = i.map((d, h) => ({ tab: d, tabIndex: h })).filter(({ tab: d }) => !d.disabled);
108
+ handleKeyDown(e, i, s) {
109
+ const n = s.map((c, h) => ({ tab: c, tabIndex: h })).filter(({ tab: c }) => !c.disabled);
108
110
  if (n.length === 0) return;
109
- const o = Math.max(
111
+ const a = Math.max(
110
112
  0,
111
- n.findIndex(({ tabIndex: d }) => d === a)
113
+ n.findIndex(({ tabIndex: c }) => c === i)
112
114
  );
113
115
  let l;
114
116
  if (e.key === "ArrowRight" || e.key === "ArrowDown")
115
- l = n[(o + 1) % n.length];
117
+ l = n[(a + 1) % n.length];
116
118
  else if (e.key === "ArrowLeft" || e.key === "ArrowUp")
117
- l = n[(o - 1 + n.length) % n.length];
119
+ l = n[(a - 1 + n.length) % n.length];
118
120
  else if (e.key === "Home") l = n[0];
119
121
  else if (e.key === "End") l = n.at(-1);
120
122
  else return;
121
123
  if (l != null && (e.preventDefault(), this.selectTab(l.tab, e), this.dom instanceof Element)) {
122
- const d = this.dom.querySelectorAll('[role="tab"]')[l.tabIndex];
123
- d == null || d.focus();
124
+ const c = this.dom.querySelectorAll('[role="tab"]')[l.tabIndex];
125
+ c == null || c.focus();
124
126
  }
125
127
  }
126
128
  }
127
- s(L, "hostName", "tab-line"), s(L, "standaloneHostName", "tab-line"), s(L, "baseStyles", [
128
- ['& > [data-part="tab"]', ["uiline", "button"]]
129
- ]), s(L, "css", v`
129
+ o(V, "hostName", "tab-line"), o(V, "standaloneHostName", "tab-line"), o(V, "baseStyles", [
130
+ ['& > button[role="tab"]', ["uiline", "button"]]
131
+ ]), o(V, "css", S`
130
132
  & {
131
133
  display: flex;
132
134
  flex-flow: row wrap;
133
135
  padding-top: 3px;
134
- background: var(--fray-tabline-background, var(--tabline-bg));
135
- }
136
-
137
- & > [data-part="tab"] {
138
- background: var(--fray-tab-button-background, var(--fray-button-background));
139
- border-radius: var(--fray-radius-md, var(--ui-border-radius)) var(--fray-radius-md, var(--ui-border-radius)) 0 0;
140
- }
141
-
142
- & > [data-part="tab"][aria-selected="true"] {
143
- background: var(
144
- --fray-tab-button-background-active,
145
- var(--fray-tab-active-background, var(--tab-bg-active))
146
- );
147
136
  }
148
137
  `);
149
- function qe(t, r) {
150
- return `${t}-tab-${Ve(r)}`;
151
- }
152
138
  function Le(t, r) {
153
- return `${t}-panel-${Ve(r)}`;
139
+ return `${t}-tab-${Ue(r)}`;
154
140
  }
155
- function Ve(t) {
141
+ function Ve(t, r) {
142
+ return `${t}-panel-${Ue(r)}`;
143
+ }
144
+ function Ue(t) {
156
145
  return encodeURIComponent(String(t)).replaceAll("%", "-");
157
146
  }
158
- function Ie(t) {
147
+ function Te(t) {
159
148
  if (!Array.isArray(t)) throw new TypeError("TabLine tabs must be an array");
160
149
  const r = /* @__PURE__ */ new Set();
161
150
  for (const e of t) {
@@ -164,44 +153,44 @@ function Ie(t) {
164
153
  r.add(e.id);
165
154
  }
166
155
  }
167
- class J extends g {
156
+ class _ extends y {
168
157
  constructor(e = {}) {
169
158
  var n;
170
159
  super(e);
171
- s(this, "valueEmitter");
172
- s(this, "activeTabEmitter");
173
- s(this, "baseId");
174
- const a = Y(e), i = { ...e };
175
- i.valueEmitter == null && e.activeTabEmitter != null && (i.valueEmitter = e.activeTabEmitter), i.defaultValue == null && e.initialActiveTabId != null && (i.defaultValue = e.initialActiveTabId), this.valueEmitter = M(
160
+ o(this, "valueEmitter");
161
+ o(this, "activeTabEmitter");
162
+ o(this, "baseId");
163
+ const i = Y(e), s = { ...e };
164
+ s.valueEmitter == null && e.activeTabEmitter != null && (s.valueEmitter = e.activeTabEmitter), s.defaultValue == null && e.initialActiveTabId != null && (s.defaultValue = e.initialActiveTabId), this.valueEmitter = z(
176
165
  this,
177
- i,
178
- ((n = a.find((o) => !o.disabled)) == null ? void 0 : n.id) ?? null,
166
+ s,
167
+ ((n = i.find((a) => !a.disabled)) == null ? void 0 : n.id) ?? null,
179
168
  "active tab"
180
- ), this.activeTabEmitter = this.valueEmitter, this.baseId = j("tabs", e.id);
169
+ ), this.activeTabEmitter = this.valueEmitter, this.baseId = F("tabs", e.id);
181
170
  }
182
171
  initialize() {
183
- var a;
172
+ var i;
184
173
  const e = Y(this.props);
185
- e.some(({ id: i }) => Object.is(i, this.valueEmitter.get())) || this.valueEmitter.set(((a = e.find((i) => !i.disabled)) == null ? void 0 : a.id) ?? null), this.watch(this.valueEmitter);
174
+ e.some(({ id: s }) => Object.is(s, this.valueEmitter.get())) || this.valueEmitter.set(((i = e.find((s) => !s.disabled)) == null ? void 0 : i.id) ?? null), this.watch(this.valueEmitter);
186
175
  }
187
176
  setProps(e) {
188
- var i;
177
+ var s;
189
178
  super.setProps(e);
190
- const a = Y(e);
191
- return a.some(({ id: n }) => Object.is(n, this.valueEmitter.get())) || this.valueEmitter.set(((i = a.find((n) => !n.disabled)) == null ? void 0 : i.id) ?? null), this;
179
+ const i = Y(e);
180
+ return i.some(({ id: n }) => Object.is(n, this.valueEmitter.get())) || this.valueEmitter.set(((s = i.find((n) => !n.disabled)) == null ? void 0 : s.id) ?? null), this;
192
181
  }
193
182
  render() {
194
- const e = Y(this.props), a = e.find(({ id: n }) => Object.is(n, this.valueEmitter.get())) ?? e.find((n) => !n.disabled) ?? null, i = this.Host;
183
+ const e = Y(this.props), i = e.find(({ id: n }) => Object.is(n, this.valueEmitter.get())) ?? e.find((n) => !n.disabled) ?? null, s = this.Host;
195
184
  return /* @__PURE__ */ w(
196
- i,
185
+ s,
197
186
  {
198
187
  id: this.baseId,
199
- className: E(this.props) || null,
188
+ className: R("panellike", E(this.props)),
200
189
  children: [
201
190
  /* @__PURE__ */ u(
202
- L,
191
+ V,
203
192
  {
204
- tabs: e.map(({ id: n, label: o, disabled: l }) => ({ id: n, label: o, disabled: l })),
193
+ tabs: e.map(({ id: n, label: a, disabled: l }) => ({ id: n, label: a, disabled: l })),
205
194
  valueEmitter: this.valueEmitter,
206
195
  baseId: this.baseId,
207
196
  ...this.props.label == null ? {} : { label: this.props.label },
@@ -209,33 +198,30 @@ class J extends g {
209
198
  },
210
199
  "tab-list"
211
200
  ),
212
- a == null ? null : /* @__PURE__ */ u(
201
+ i == null ? null : /* @__PURE__ */ u(
213
202
  "div",
214
203
  {
215
- id: Le(this.baseId, a.id),
204
+ id: Ve(this.baseId, i.id),
216
205
  role: "tabpanel",
217
206
  "data-part": "content",
218
- "aria-labelledby": qe(this.baseId, a.id),
207
+ "aria-labelledby": Le(this.baseId, i.id),
219
208
  tabIndex: 0,
220
- children: a.content
209
+ children: i.content
221
210
  },
222
- String(a.id)
211
+ String(i.id)
223
212
  )
224
213
  ]
225
214
  }
226
215
  );
227
216
  }
228
217
  }
229
- s(J, "dependencies", [L, ze]), s(J, "hostName", "tab-panel"), s(J, "standaloneHostName", "tab-panel"), s(J, "css", v`
218
+ o(_, "dependencies", [V, qe]), o(_, "hostName", "tab-panel"), o(_, "standaloneHostName", "tab-panel"), o(_, "css", S`
230
219
  & {
231
220
  display: flex;
232
221
  flex-direction: column;
233
222
  width: 100%;
234
223
  min-height: 0;
235
224
  overflow: hidden;
236
- background: var(--fray-panel-background, var(--panel-bg, transparent));
237
- border-radius: var(--fray-panel-radius, var(--panel-radius));
238
- box-shadow: var(--fray-panel-shadow, var(--panel-shadow, none));
239
225
  }
240
226
 
241
227
  & > [data-part="content"] {
@@ -243,75 +229,71 @@ s(J, "dependencies", [L, ze]), s(J, "hostName", "tab-panel"), s(J, "standaloneHo
243
229
  flex-direction: column;
244
230
  flex: 1;
245
231
  overflow: auto;
246
- background: var(--fray-panel-background, var(--panel-bg, transparent));
247
232
  }
248
233
  `);
249
234
  function Y(t) {
250
235
  const r = t.tabs ?? [];
251
236
  if (!Array.isArray(r)) throw new TypeError("TabPanel tabs must be an array");
252
- const a = (Array.isArray(t.children) ? t.children : t.children == null ? [] : [t.children]).filter((o) => ie(o) && o.type === ze).map((o, l) => {
253
- if (!ie(o)) throw new TypeError("TabPanel children must be Tab nodes");
254
- const d = o.props;
237
+ const i = (Array.isArray(t.children) ? t.children : t.children == null ? [] : [t.children]).filter((a) => ie(a) && a.type === qe).map((a, l) => {
238
+ if (!ie(a)) throw new TypeError("TabPanel children must be Tab nodes");
239
+ const c = a.props;
255
240
  return {
256
- id: d.id ?? `tab-${l + 1}`,
257
- label: d.label ?? `Tab ${l + 1}`,
258
- disabled: !!d.disabled,
259
- content: d.children ?? []
241
+ id: c.id ?? `tab-${l + 1}`,
242
+ label: c.label ?? `Tab ${l + 1}`,
243
+ disabled: !!c.disabled,
244
+ content: c.children ?? []
260
245
  };
261
- }), i = r.length > 0 ? r.map((o) => ({
262
- ...o,
263
- label: o.label ?? String(o.id),
264
- disabled: !!o.disabled,
265
- content: o.content ?? o.component ?? []
266
- })) : a, n = /* @__PURE__ */ new Set();
267
- for (const o of i) {
268
- if ((o == null ? void 0 : o.id) == null) throw new TypeError("Each tab requires an id");
269
- if (n.has(o.id)) throw new Error(`Duplicate tab id: ${String(o.id)}`);
270
- n.add(o.id);
271
- }
272
- return i;
273
- }
274
- class _ extends g {
246
+ }), s = r.length > 0 ? r.map((a) => ({
247
+ ...a,
248
+ label: a.label ?? String(a.id),
249
+ disabled: !!a.disabled,
250
+ content: a.content ?? a.component ?? []
251
+ })) : i, n = /* @__PURE__ */ new Set();
252
+ for (const a of s) {
253
+ if ((a == null ? void 0 : a.id) == null) throw new TypeError("Each tab requires an id");
254
+ if (n.has(a.id)) throw new Error(`Duplicate tab id: ${String(a.id)}`);
255
+ n.add(a.id);
256
+ }
257
+ return s;
258
+ }
259
+ class ce extends y {
275
260
  constructor(e = {}) {
276
261
  super(e);
277
- s(this, "panelId");
278
- s(this, "headerId");
279
- this.panelId = j("panel", e.id), this.headerId = `${this.panelId}-title`;
262
+ o(this, "panelId");
263
+ o(this, "headerId");
264
+ this.panelId = F("panel", e.id), this.headerId = `${this.panelId}-title`;
280
265
  }
281
266
  render() {
282
267
  const {
283
268
  header: e = null,
284
- toolbar: a = null,
285
- children: i = [],
269
+ toolbar: i = null,
270
+ children: s = [],
286
271
  orientation: n = "vertical",
287
- disabled: o = !1
272
+ disabled: a = !1
288
273
  } = this.props;
289
274
  if (!["horizontal", "vertical"].includes(n))
290
275
  throw new TypeError("Panel orientation must be horizontal or vertical");
291
- const l = this.Host, d = e == null ? null : /* @__PURE__ */ u("header", { "data-part": "header", children: typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ u("h2", { id: this.headerId, children: e }) : /* @__PURE__ */ u("div", { id: this.headerId, children: e }) });
276
+ const l = this.Host, c = e == null ? null : /* @__PURE__ */ u("header", { children: typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ u("h2", { id: this.headerId, children: e }) : /* @__PURE__ */ u("div", { id: this.headerId, children: e }) });
292
277
  return /* @__PURE__ */ w(
293
278
  l,
294
279
  {
295
280
  id: this.panelId,
296
281
  role: e == null ? null : "region",
297
- className: E(this.props) || null,
282
+ className: R("panellike", E(this.props)),
298
283
  "data-orientation": n,
299
- "data-disabled": o ? "" : null,
300
- "aria-disabled": o ? "true" : null,
284
+ "data-disabled": a ? "" : null,
285
+ "aria-disabled": a ? "true" : null,
301
286
  "aria-labelledby": e == null ? null : this.headerId,
302
287
  children: [
303
- d,
304
- a,
305
- /* @__PURE__ */ u("div", { "data-part": "content", "data-orientation": n, children: i })
288
+ c,
289
+ i,
290
+ /* @__PURE__ */ u("div", { "data-part": "content", "data-orientation": n, children: s })
306
291
  ]
307
292
  }
308
293
  );
309
294
  }
310
295
  }
311
- s(_, "hostName", "panel"), s(_, "standaloneHostName", "layout-panel"), s(_, "baseStyles", [
312
- ["&", ["panel"]],
313
- ['& > [data-part="header"]', ["sectionheader"]]
314
- ]), s(_, "css", v`
296
+ o(ce, "hostName", "panel"), o(ce, "standaloneHostName", "layout-panel"), o(ce, "css", S`
315
297
  & {
316
298
  display: flex;
317
299
  flex-direction: column;
@@ -319,24 +301,11 @@ s(_, "hostName", "panel"), s(_, "standaloneHostName", "layout-panel"), s(_, "bas
319
301
  flex: 0 0 auto;
320
302
  }
321
303
 
322
- & > [data-part="header"] h2 {
304
+ & > header h2 {
323
305
  margin: 0;
324
306
  font: inherit;
325
307
  }
326
308
 
327
- & > [data-part="header"] {
328
- background: var(
329
- --fray-panel-header-background,
330
- var(--fray-section-header-background, var(--fray-header-background))
331
- );
332
- color: var(
333
- --fray-panel-header-color,
334
- var(--fray-section-header-color, var(--fray-header-color))
335
- );
336
- border: var(--fray-section-header-border, var(--fray-header-border));
337
- box-shadow: var(--fray-section-header-shadow, var(--fray-header-shadow));
338
- }
339
-
340
309
  & > [data-part="content"] {
341
310
  display: flex;
342
311
  flex: 1;
@@ -353,42 +322,39 @@ s(_, "hostName", "panel"), s(_, "standaloneHostName", "layout-panel"), s(_, "bas
353
322
  flex-direction: column;
354
323
  }
355
324
  `);
356
- class xe extends g {
325
+ class st extends y {
357
326
  constructor(e = {}) {
358
327
  super(e);
359
- s(this, "sidebarId");
360
- s(this, "headerId");
361
- this.sidebarId = j("sidebar", e.id), this.headerId = `${this.sidebarId}-title`;
328
+ o(this, "sidebarId");
329
+ o(this, "headerId");
330
+ this.sidebarId = F("sidebar", e.id), this.headerId = `${this.sidebarId}-title`;
362
331
  }
363
332
  render() {
364
333
  const {
365
334
  header: e = null,
366
- toolbar: a = null,
367
- ariaLabel: i,
335
+ toolbar: i = null,
336
+ ariaLabel: s,
368
337
  children: n = []
369
- } = this.props, o = e == null ? null : /* @__PURE__ */ u("header", { "data-part": "header", children: typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ u("h2", { id: this.headerId, children: e }) : /* @__PURE__ */ u("div", { id: this.headerId, children: e }) });
338
+ } = this.props, a = e == null ? null : /* @__PURE__ */ u("header", { children: typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ u("h2", { id: this.headerId, children: e }) : /* @__PURE__ */ u("div", { id: this.headerId, children: e }) });
370
339
  return /* @__PURE__ */ w(
371
340
  "aside",
372
341
  {
373
342
  id: this.sidebarId,
374
343
  className: E(this.props) || void 0,
375
344
  "data-fray-component": "sidebar",
376
- "aria-label": e == null ? i : null,
345
+ "aria-label": e == null ? s : null,
377
346
  "aria-labelledby": e == null ? null : this.headerId,
378
347
  children: [
379
- o,
380
- a == null ? null : /* @__PURE__ */ u("div", { "data-part": "toolbar", children: a }),
348
+ a,
349
+ i == null ? null : /* @__PURE__ */ u("div", { "data-part": "toolbar", children: i }),
381
350
  /* @__PURE__ */ u("div", { "data-part": "content", tabIndex: 0, children: n })
382
351
  ]
383
352
  }
384
353
  );
385
354
  }
386
355
  }
387
- s(xe, "baseStyles", [
388
- ['aside[data-fray-component="sidebar"]', ["panel"]],
389
- ['aside[data-fray-component="sidebar"] > [data-part="header"]', ["sectionheader"]]
390
- ]), s(xe, "css", v`
391
- aside[data-fray-component="sidebar"] {
356
+ o(st, "css", S`
357
+ aside {
392
358
  display: flex;
393
359
  flex-direction: column;
394
360
  min-width: 0;
@@ -396,17 +362,17 @@ s(xe, "baseStyles", [
396
362
  overflow: hidden;
397
363
  }
398
364
 
399
- aside[data-fray-component="sidebar"] > [data-part="header"],
400
- aside[data-fray-component="sidebar"] > [data-part="toolbar"] {
365
+ aside > header,
366
+ aside > [data-part="toolbar"] {
401
367
  flex: 0 0 auto;
402
368
  }
403
369
 
404
- aside[data-fray-component="sidebar"] > [data-part="header"] h2 {
370
+ aside > header h2 {
405
371
  margin: 0;
406
372
  font: inherit;
407
373
  }
408
374
 
409
- aside[data-fray-component="sidebar"] > [data-part="content"] {
375
+ aside > [data-part="content"] {
410
376
  flex: 1 1 auto;
411
377
  min-width: 0;
412
378
  min-height: 0;
@@ -414,27 +380,27 @@ s(xe, "baseStyles", [
414
380
  overflow-y: auto;
415
381
  }
416
382
  `);
417
- class ce extends g {
383
+ class de extends y {
418
384
  render() {
419
385
  const {
420
386
  primary: r = null,
421
387
  secondary: e = null,
422
- direction: a = "horizontal",
423
- primarySize: i,
388
+ direction: i = "horizontal",
389
+ primarySize: s,
424
390
  primaryLabel: n,
425
- secondaryLabel: o
391
+ secondaryLabel: a
426
392
  } = this.props;
427
- if (a !== "horizontal" && a !== "vertical")
393
+ if (i !== "horizontal" && i !== "vertical")
428
394
  throw new TypeError("SplitView direction must be horizontal or vertical");
429
- if (i != null && (typeof i != "string" || i.length === 0))
395
+ if (s != null && (typeof s != "string" || s.length === 0))
430
396
  throw new TypeError("SplitView primarySize must be a non-empty CSS size");
431
397
  const l = this.Host;
432
398
  return /* @__PURE__ */ w(
433
399
  l,
434
400
  {
435
401
  className: E(this.props) || null,
436
- "data-direction": a,
437
- style: i == null ? void 0 : { "--split-primary-size": i },
402
+ "data-direction": i,
403
+ style: s == null ? void 0 : { "--split-primary-size": s },
438
404
  children: [
439
405
  /* @__PURE__ */ u(
440
406
  "div",
@@ -449,8 +415,8 @@ class ce extends g {
449
415
  "div",
450
416
  {
451
417
  "data-part": "secondary",
452
- role: o == null ? null : "region",
453
- "aria-label": o,
418
+ role: a == null ? null : "region",
419
+ "aria-label": a,
454
420
  children: e ?? this.props.children ?? []
455
421
  }
456
422
  )
@@ -459,7 +425,7 @@ class ce extends g {
459
425
  );
460
426
  }
461
427
  }
462
- s(ce, "hostName", "split-view"), s(ce, "standaloneHostName", "split-view"), s(ce, "css", v`
428
+ o(de, "hostName", "split-view"), o(de, "standaloneHostName", "split-view"), o(de, "css", S`
463
429
  & {
464
430
  display: grid;
465
431
  flex: 1 1 auto;
@@ -494,9 +460,9 @@ s(ce, "hostName", "split-view"), s(ce, "standaloneHostName", "split-view"), s(ce
494
460
  border-block-end: 1px solid var(--ui-border-color);
495
461
  }
496
462
  `);
497
- class Ue extends g {
463
+ class Pe extends y {
498
464
  render() {
499
- const { term: r, value: e, children: a = [] } = this.props;
465
+ const { term: r, value: e, children: i = [] } = this.props;
500
466
  return /* @__PURE__ */ w(
501
467
  "div",
502
468
  {
@@ -504,45 +470,39 @@ class Ue extends g {
504
470
  "data-fray-component": "description-item",
505
471
  children: [
506
472
  /* @__PURE__ */ u("dt", { children: r }),
507
- /* @__PURE__ */ u("dd", { children: e ?? a })
473
+ /* @__PURE__ */ u("dd", { children: e ?? i })
508
474
  ]
509
475
  }
510
476
  );
511
477
  }
512
478
  }
513
- s(Ue, "css", v`
514
- div[data-fray-component="description-item"] {
479
+ o(Pe, "css", S`
480
+ div:has(> dt + dd) {
515
481
  display: grid;
516
482
  grid-template-columns: minmax(7rem, 0.7fr) minmax(0, 1.3fr);
517
483
  gap: var(--spacing-small, 0.5rem);
518
484
  padding-block: var(--spacing-small, 0.5rem);
519
- border-block-end: 1px solid var(--ui-border-color);
520
485
  }
521
486
 
522
- div[data-fray-component="description-item"] > dt {
523
- color: var(--ui-muted-text-color, var(--ui-text-color));
524
- font-weight: 600;
525
- }
526
-
527
- div[data-fray-component="description-item"] > dd {
487
+ div:has(> dt + dd) > dd {
528
488
  min-width: 0;
529
489
  margin: 0;
530
490
  overflow-wrap: anywhere;
531
491
  }
532
492
 
533
493
  @media (max-width: 36rem) {
534
- div[data-fray-component="description-item"] {
494
+ div:has(> dt + dd) {
535
495
  grid-template-columns: minmax(0, 1fr);
536
496
  gap: 0.15rem;
537
497
  }
538
498
  }
539
499
  `);
540
- class Te extends g {
500
+ class Re extends y {
541
501
  render() {
542
502
  return /* @__PURE__ */ u(
543
503
  "dl",
544
504
  {
545
- className: E(this.props) || void 0,
505
+ className: R("datacomponentlike", E(this.props)),
546
506
  "data-fray-component": "description-list",
547
507
  "aria-label": this.props.label,
548
508
  children: this.props.children ?? []
@@ -550,21 +510,21 @@ class Te extends g {
550
510
  );
551
511
  }
552
512
  }
553
- s(Te, "dependencies", [Ue]), s(Te, "css", v`
554
- dl[data-fray-component="description-list"] {
513
+ o(Re, "dependencies", [Pe]), o(Re, "css", S`
514
+ dl:has(> div > dt + dd) {
555
515
  display: grid;
556
516
  margin: 0;
557
517
  }
558
518
  `);
559
- class H extends g {
519
+ class M extends y {
560
520
  render() {
561
- const r = at(this.props.width ?? 65), e = this.Host;
521
+ const r = nt(this.props.width ?? 65), e = this.Host;
562
522
  return /* @__PURE__ */ u(e, { style: { width: `${r}%` }, "aria-hidden": "true" });
563
523
  }
564
524
  }
565
- s(H, "hostName", "placeholder"), s(H, "standaloneHostName", "loading-placeholder"), s(H, "baseStyles", [
525
+ o(M, "hostName", "placeholder"), o(M, "standaloneHostName", "loading-placeholder"), o(M, "baseStyles", [
566
526
  ["&::after", ["after", "working"]]
567
- ]), s(H, "css", v`
527
+ ]), o(M, "css", S`
568
528
  & {
569
529
  display: block;
570
530
  min-width: 3rem;
@@ -581,182 +541,182 @@ s(H, "hostName", "placeholder"), s(H, "standaloneHostName", "loading-placeholder
581
541
  to { background-position: 2rem 0; }
582
542
  }
583
543
  `);
584
- function at(t) {
544
+ function nt(t) {
585
545
  const r = Number(t);
586
546
  if (!Number.isFinite(r)) throw new TypeError("Placeholder width must be numeric");
587
547
  return Math.min(100, Math.max(10, r));
588
548
  }
589
- function Pe(t, r, e) {
590
- ye(e);
591
- for (const a of e) {
592
- const i = r[a.key];
593
- if (i == null) continue;
594
- const n = a.options.flatMap((d) => {
595
- const h = i[d.key];
596
- return h == null || h === y.Neutral ? [] : [{ option: d, mode: h }];
549
+ function Be(t, r, e) {
550
+ we(e);
551
+ for (const i of e) {
552
+ const s = r[i.key];
553
+ if (s == null) continue;
554
+ const n = i.options.flatMap((c) => {
555
+ const h = s[c.key];
556
+ return h == null || h === b.Neutral ? [] : [{ option: c, mode: h }];
597
557
  });
598
- if (n.some(({ option: d, mode: h }) => h === y.Deny && d.matches(t)) || n.filter(({ mode: d }) => d === y.Require).some(({ option: d }) => !d.matches(t)))
558
+ if (n.some(({ option: c, mode: h }) => h === b.Deny && c.matches(t)) || n.filter(({ mode: c }) => c === b.Require).some(({ option: c }) => !c.matches(t)))
599
559
  return !1;
600
- const l = n.filter(({ mode: d }) => d === y.Prefer);
601
- if (l.length > 0 && !l.some(({ option: d }) => d.matches(t)))
560
+ const l = n.filter(({ mode: c }) => c === b.Prefer);
561
+ if (l.length > 0 && !l.some(({ option: c }) => c.matches(t)))
602
562
  return !1;
603
563
  }
604
564
  return !0;
605
565
  }
606
- function it(t, r, e) {
566
+ function ot(t, r, e) {
607
567
  if (!Array.isArray(t)) throw new TypeError("Filtered items must be an array");
608
- return t.filter((a) => Pe(a, r, e));
568
+ return t.filter((i) => Be(i, r, e));
609
569
  }
610
- function ar(t, r, e = null) {
611
- return ye(r), new le(
570
+ function nr(t, r, e = null) {
571
+ return we(r), new ae(
612
572
  [t],
613
- ([a]) => (i) => Pe(i, a, r),
573
+ ([i]) => (s) => Be(s, i, r),
614
574
  { owner: e, purpose: "filter predicate" }
615
575
  );
616
576
  }
617
- function ir(t, r, e, a = null) {
618
- return ye(e), new le(
577
+ function or(t, r, e, i = null) {
578
+ return we(e), new ae(
619
579
  [t, r],
620
- ([i, n]) => it(i, n, e),
621
- { owner: a, purpose: "filtered items" }
580
+ ([s, n]) => ot(s, n, e),
581
+ { owner: i, purpose: "filtered items" }
622
582
  );
623
583
  }
624
- function nr(t) {
625
- nt(t);
584
+ function ar(t) {
585
+ at(t);
626
586
  const r = {};
627
587
  for (const e of Object.keys(t).sort()) {
628
- const a = {}, i = t[e];
629
- for (const n of Object.keys(i).sort())
630
- a[n] = i[n];
631
- r[e] = a;
588
+ const i = {}, s = t[e];
589
+ for (const n of Object.keys(s).sort())
590
+ i[n] = s[n];
591
+ r[e] = i;
632
592
  }
633
593
  return { version: 1, dimensions: r };
634
594
  }
635
- function sr(t) {
636
- if (!Q(t) || t.version !== 1 || !Q(t.dimensions))
595
+ function lr(t) {
596
+ if (!W(t) || t.version !== 1 || !W(t.dimensions))
637
597
  throw new TypeError("Filter state must use version 1 with a dimensions object");
638
598
  const r = {};
639
- for (const [e, a] of Object.entries(t.dimensions)) {
640
- if (U(e, "Filter dimension"), !Q(a))
599
+ for (const [e, i] of Object.entries(t.dimensions)) {
600
+ if (P(e, "Filter dimension"), !W(i))
641
601
  throw new TypeError(`Filter dimension ${e} must be an object`);
642
- const i = {};
643
- for (const [n, o] of Object.entries(a)) {
644
- if (U(n, `Filter option in ${e}`), !de(o))
602
+ const s = {};
603
+ for (const [n, a] of Object.entries(i)) {
604
+ if (P(n, `Filter option in ${e}`), !le(a))
645
605
  throw new TypeError(
646
- `Unknown filter mode for ${e}.${n}: ${String(o)}`
606
+ `Unknown filter mode for ${e}.${n}: ${String(a)}`
647
607
  );
648
- i[n] = o;
608
+ s[n] = a;
649
609
  }
650
- r[e] = i;
610
+ r[e] = s;
651
611
  }
652
612
  return r;
653
613
  }
654
- function nt(t) {
655
- if (!Q(t)) throw new TypeError("Filter state must be an object");
614
+ function at(t) {
615
+ if (!W(t)) throw new TypeError("Filter state must be an object");
656
616
  for (const [r, e] of Object.entries(t)) {
657
- if (U(r, "Filter dimension"), !Q(e))
617
+ if (P(r, "Filter dimension"), !W(e))
658
618
  throw new TypeError(`Filter dimension ${r} must be an object`);
659
- for (const [a, i] of Object.entries(e))
660
- if (U(a, `Filter option in ${r}`), !de(i))
619
+ for (const [i, s] of Object.entries(e))
620
+ if (P(i, `Filter option in ${r}`), !le(s))
661
621
  throw new TypeError(
662
- `Unknown filter mode for ${r}.${a}: ${String(i)}`
622
+ `Unknown filter mode for ${r}.${i}: ${String(s)}`
663
623
  );
664
624
  }
665
625
  }
666
- function ye(t) {
626
+ function we(t) {
667
627
  if (!Array.isArray(t)) throw new TypeError("Filter dimensions must be an array");
668
628
  const r = /* @__PURE__ */ new Set();
669
629
  for (const e of t) {
670
- if (U(e.key, "Filter dimension"), r.has(e.key))
630
+ if (P(e.key, "Filter dimension"), r.has(e.key))
671
631
  throw new Error(`Duplicate filter dimension: ${e.key}`);
672
632
  if (r.add(e.key), !Array.isArray(e.options))
673
633
  throw new TypeError(`Filter dimension ${e.key} options must be an array`);
674
- const a = /* @__PURE__ */ new Set();
675
- for (const i of e.options) {
676
- if (U(i.key, `Filter option in ${e.key}`), a.has(i.key))
677
- throw new Error(`Duplicate filter option: ${e.key}.${i.key}`);
678
- if (a.add(i.key), typeof i.matches != "function")
679
- throw new TypeError(`Filter matcher ${e.key}.${i.key} must be a function`);
634
+ const i = /* @__PURE__ */ new Set();
635
+ for (const s of e.options) {
636
+ if (P(s.key, `Filter option in ${e.key}`), i.has(s.key))
637
+ throw new Error(`Duplicate filter option: ${e.key}.${s.key}`);
638
+ if (i.add(s.key), typeof s.matches != "function")
639
+ throw new TypeError(`Filter matcher ${e.key}.${s.key} must be a function`);
680
640
  }
681
641
  }
682
642
  }
683
- function U(t, r) {
643
+ function P(t, r) {
684
644
  if (t.length === 0 || t === "__proto__" || t === "prototype" || t === "constructor")
685
645
  throw new TypeError(`${r} key is not safe for persisted state`);
686
646
  }
687
- function Q(t) {
647
+ function W(t) {
688
648
  return t != null && typeof t == "object" && !Array.isArray(t);
689
649
  }
690
- class Be {
650
+ class Ge {
691
651
  constructor({
692
652
  getItems: r,
693
- getKey: e = we,
694
- selectedItemsEmitter: a,
695
- owner: i = null
653
+ getKey: e = Se,
654
+ selectedItemsEmitter: i,
655
+ owner: s = null
696
656
  }) {
697
- s(this, "getItems");
698
- s(this, "getKey");
699
- s(this, "selectedItemsEmitter");
700
- s(this, "selectedItems$");
701
- s(this, "ownsSelectedItemsEmitter");
702
- s(this, "rows", []);
703
- s(this, "rowCleanups", []);
704
- s(this, "activeIndex", 0);
705
- s(this, "anchorIndex", null);
706
- s(this, "dragStartIndex", null);
707
- s(this, "dragOriginEvent", null);
708
- s(this, "dragMoved", !1);
709
- s(this, "dragCleanup", null);
710
- s(this, "suppressNextClick", !1);
711
- s(this, "suppressClickTimer", null);
712
- s(this, "destroyed", !1);
713
- s(this, "ownedSelectedItemsEmitter");
657
+ o(this, "getItems");
658
+ o(this, "getKey");
659
+ o(this, "selectedItemsEmitter");
660
+ o(this, "selectedItems$");
661
+ o(this, "ownsSelectedItemsEmitter");
662
+ o(this, "rows", []);
663
+ o(this, "rowCleanups", []);
664
+ o(this, "activeIndex", 0);
665
+ o(this, "anchorIndex", null);
666
+ o(this, "dragStartIndex", null);
667
+ o(this, "dragOriginEvent", null);
668
+ o(this, "dragMoved", !1);
669
+ o(this, "dragCleanup", null);
670
+ o(this, "suppressNextClick", !1);
671
+ o(this, "suppressClickTimer", null);
672
+ o(this, "destroyed", !1);
673
+ o(this, "ownedSelectedItemsEmitter");
714
674
  if (typeof r != "function")
715
675
  throw new TypeError("Selection handler getItems must be a function");
716
676
  if (typeof e != "function")
717
677
  throw new TypeError("Selection handler getKey must be a function");
718
- this.getItems = r, this.getKey = e, this.ownedSelectedItemsEmitter = a == null ? new I([], { owner: i, purpose: "selected items" }) : null, this.selectedItemsEmitter = a ?? this.ownedSelectedItemsEmitter, this.selectedItems$ = this.selectedItemsEmitter, this.ownsSelectedItemsEmitter = this.ownedSelectedItemsEmitter != null;
678
+ this.getItems = r, this.getKey = e, this.ownedSelectedItemsEmitter = i == null ? new x([], { owner: s, purpose: "selected items" }) : null, this.selectedItemsEmitter = i ?? this.ownedSelectedItemsEmitter, this.selectedItems$ = this.selectedItemsEmitter, this.ownsSelectedItemsEmitter = this.ownedSelectedItemsEmitter != null;
719
679
  }
720
680
  rowsUpdated(r) {
721
- this.destroyed || (this.releaseRows(), this.rows = Array.from(r ?? []), this.rows.forEach((e, a) => this.wireRow(e, a)), this.activeIndex = lt(this.activeIndex, this.rows.length), this.reconcileSelectedItems(), this.syncRows());
681
+ this.destroyed || (this.releaseRows(), this.rows = Array.from(r ?? []), this.rows.forEach((e, i) => this.wireRow(e, i)), this.activeIndex = dt(this.activeIndex, this.rows.length), this.reconcileSelectedItems(), this.syncRows());
722
682
  }
723
683
  wireRow(r, e) {
724
- const a = (l) => this.handleClick(e, l), i = (l) => this.handleKeyDown(e, l), n = (l) => this.handleMouseDown(e, l, r), o = (l) => this.handleMouseEnter(e, l);
725
- r.addEventListener("click", a), r.addEventListener("keydown", i), r.addEventListener("mousedown", n), r.addEventListener("mouseenter", o), this.rowCleanups.push(() => {
726
- r.removeEventListener("click", a), r.removeEventListener("keydown", i), r.removeEventListener("mousedown", n), r.removeEventListener("mouseenter", o);
684
+ const i = (l) => this.handleClick(e, l), s = (l) => this.handleKeyDown(e, l), n = (l) => this.handleMouseDown(e, l, r), a = (l) => this.handleMouseEnter(e, l);
685
+ r.addEventListener("click", i), r.addEventListener("keydown", s), r.addEventListener("mousedown", n), r.addEventListener("mouseenter", a), this.rowCleanups.push(() => {
686
+ r.removeEventListener("click", i), r.removeEventListener("keydown", s), r.removeEventListener("mousedown", n), r.removeEventListener("mouseenter", a);
727
687
  });
728
688
  }
729
689
  handleClick(r, e) {
730
- var a;
690
+ var i;
731
691
  if (e.preventDefault(), this.suppressNextClick) {
732
692
  this.clearClickSuppression();
733
693
  return;
734
694
  }
735
- this.activeIndex = r, this.selectIndex(r, e), (a = this.rows[r]) == null || a.focus();
695
+ this.activeIndex = r, this.selectIndex(r, e), (i = this.rows[r]) == null || i.focus();
736
696
  }
737
- handleMouseDown(r, e, a) {
697
+ handleMouseDown(r, e, i) {
738
698
  if (e.button !== 0 || !this.supportsDragSelection()) return;
739
699
  this.finishDrag(!1), this.clearClickSuppression(), this.dragStartIndex = r, this.dragOriginEvent = e, this.dragMoved = !1;
740
- const i = a.ownerDocument, n = () => this.finishDrag(this.dragMoved);
741
- i.addEventListener("mouseup", n), this.dragCleanup = () => i.removeEventListener("mouseup", n);
700
+ const s = i.ownerDocument, n = () => this.finishDrag(this.dragMoved);
701
+ s.addEventListener("mouseup", n), this.dragCleanup = () => s.removeEventListener("mouseup", n);
742
702
  }
743
703
  handleMouseEnter(r, e) {
744
- var a;
745
- this.dragStartIndex != null && (r === this.dragStartIndex && !this.dragMoved || r === this.activeIndex && this.dragMoved || (e.preventDefault(), this.dragMoved = !0, this.activeIndex = r, this.selectDragRange(this.dragStartIndex, r, this.dragOriginEvent ?? e), (a = this.rows[r]) == null || a.focus()));
704
+ var i;
705
+ this.dragStartIndex != null && (r === this.dragStartIndex && !this.dragMoved || r === this.activeIndex && this.dragMoved || (e.preventDefault(), this.dragMoved = !0, this.activeIndex = r, this.selectDragRange(this.dragStartIndex, r, this.dragOriginEvent ?? e), (i = this.rows[r]) == null || i.focus()));
746
706
  }
747
707
  handleKeyDown(r, e) {
748
708
  var n;
749
- const a = this.rows.length - 1;
750
- let i;
751
- if (e.key === "ArrowDown") i = Math.min(r + 1, a);
752
- else if (e.key === "ArrowUp") i = Math.max(r - 1, 0);
753
- else if (e.key === "Home") i = 0;
754
- else if (e.key === "End") i = a;
709
+ const i = this.rows.length - 1;
710
+ let s;
711
+ if (e.key === "ArrowDown") s = Math.min(r + 1, i);
712
+ else if (e.key === "ArrowUp") s = Math.max(r - 1, 0);
713
+ else if (e.key === "Home") s = 0;
714
+ else if (e.key === "End") s = i;
755
715
  else if (e.key === " " || e.key === "Enter") {
756
716
  e.preventDefault(), this.activeIndex = r, this.selectIndex(r, e);
757
717
  return;
758
718
  } else return;
759
- e.preventDefault(), this.activeIndex = i, this.onKeyboardMove(i, e), this.syncRows(), (n = this.rows[i]) == null || n.focus();
719
+ e.preventDefault(), this.activeIndex = s, this.onKeyboardMove(s, e), this.syncRows(), (n = this.rows[s]) == null || n.focus();
760
720
  }
761
721
  onKeyboardMove(r, e) {
762
722
  this.selectIndex(r, e);
@@ -764,7 +724,7 @@ class Be {
764
724
  supportsDragSelection() {
765
725
  return !1;
766
726
  }
767
- selectDragRange(r, e, a) {
727
+ selectDragRange(r, e, i) {
768
728
  }
769
729
  selectIndex(r, e) {
770
730
  }
@@ -780,14 +740,14 @@ class Be {
780
740
  reconcileSelectedItems() {
781
741
  const r = this.getSelectedItems();
782
742
  if (r.length === 0) return;
783
- const e = new Set(r.map((i, n) => this.getKey(i, n))), a = this.getItems().filter((i, n) => e.has(this.getKey(i, n)));
784
- (a.length !== r.length || a.some((i, n) => !Object.is(i, r[n]))) && this.selectedItemsEmitter.set([...a], "selection reconciled with rows");
743
+ const e = new Set(r.map((s, n) => this.getKey(s, n))), i = this.getItems().filter((s, n) => e.has(this.getKey(s, n)));
744
+ (i.length !== r.length || i.some((s, n) => !Object.is(s, r[n]))) && this.selectedItemsEmitter.set([...i], "selection reconciled with rows");
785
745
  }
786
746
  syncRows() {
787
- const r = new Set(this.getSelectedItems().map((a, i) => this.getKey(a, i))), e = this.getItems();
788
- this.rows.forEach((a, i) => {
789
- const n = e[i], o = n !== void 0 && r.has(this.getKey(n, i));
790
- a.classList.toggle("selected", o), a.setAttribute("aria-selected", String(o)), a.tabIndex = i === this.activeIndex ? 0 : -1;
747
+ const r = new Set(this.getSelectedItems().map((i, s) => this.getKey(i, s))), e = this.getItems();
748
+ this.rows.forEach((i, s) => {
749
+ const n = e[s], a = n !== void 0 && r.has(this.getKey(n, s));
750
+ i.classList.toggle("selected", a), i.setAttribute("aria-selected", String(a)), i.tabIndex = s === this.activeIndex ? 0 : -1;
791
751
  });
792
752
  }
793
753
  releaseRows() {
@@ -806,26 +766,26 @@ class Be {
806
766
  this.destroyed || (this.destroyed = !0, this.finishDrag(!1), this.clearClickSuppression(), this.releaseRows(), (r = this.ownedSelectedItemsEmitter) == null || r.dispose());
807
767
  }
808
768
  }
809
- class ge extends Be {
769
+ class Ee extends Ge {
810
770
  constructor(e) {
811
- const a = e.selectedItemEmitter == null ? new I(null, {
771
+ const i = e.selectedItemEmitter == null ? new x(null, {
812
772
  owner: e.owner,
813
773
  purpose: "selected item"
814
- }) : null, i = e.selectedItemEmitter ?? a;
774
+ }) : null, s = e.selectedItemEmitter ?? i;
815
775
  super({
816
776
  getItems: e.getItems,
817
777
  ...e.getKey == null ? {} : { getKey: e.getKey },
818
778
  ...e.owner === void 0 ? {} : { owner: e.owner },
819
- selectedItemsEmitter: new ot(i)
779
+ selectedItemsEmitter: new ct(s)
820
780
  });
821
- s(this, "selectedItemEmitter");
822
- s(this, "selectedItem$");
823
- s(this, "ownedSelectedItemEmitter");
824
- this.ownedSelectedItemEmitter = a, this.selectedItemEmitter = i, this.selectedItem$ = i;
781
+ o(this, "selectedItemEmitter");
782
+ o(this, "selectedItem$");
783
+ o(this, "ownedSelectedItemEmitter");
784
+ this.ownedSelectedItemEmitter = i, this.selectedItemEmitter = s, this.selectedItem$ = s;
825
785
  }
826
786
  selectIndex(e) {
827
- const a = this.getItems()[e];
828
- a !== void 0 && (this.anchorIndex = e, this.setSelectedItems([a], "single selection changed"));
787
+ const i = this.getItems()[e];
788
+ i !== void 0 && (this.anchorIndex = e, this.setSelectedItems([i], "single selection changed"));
829
789
  }
830
790
  getSelectedItem() {
831
791
  return this.selectedItemEmitter.get();
@@ -835,21 +795,21 @@ class ge extends Be {
835
795
  super.destroy(), (e = this.ownedSelectedItemEmitter) == null || e.dispose();
836
796
  }
837
797
  }
838
- class st extends Be {
798
+ class lt extends Ge {
839
799
  selectIndex(r, e) {
840
- const a = this.getItems(), i = a[r];
841
- if (i !== void 0) {
800
+ const i = this.getItems(), s = i[r];
801
+ if (s !== void 0) {
842
802
  if (e.shiftKey && this.anchorIndex != null) {
843
- const n = Math.min(this.anchorIndex, r), o = Math.max(this.anchorIndex, r), l = a.slice(n, o + 1), d = ue(e) ? Re(this.getSelectedItems(), l, this.getKey) : [...l];
844
- this.setSelectedItems(d, "range selection changed");
803
+ const n = Math.min(this.anchorIndex, r), a = Math.max(this.anchorIndex, r), l = i.slice(n, a + 1), c = ue(e) ? Ne(this.getSelectedItems(), l, this.getKey) : [...l];
804
+ this.setSelectedItems(c, "range selection changed");
845
805
  return;
846
806
  }
847
807
  if (ue(e) || "key" in e && e.key === " ") {
848
- const n = this.getSelectedItems(), o = this.getKey(i, r), d = n.some((h, f) => Object.is(this.getKey(h, f), o)) ? n.filter((h, f) => !Object.is(this.getKey(h, f), o)) : [...n, i];
849
- this.anchorIndex = r, this.setSelectedItems(d, "multi selection toggled");
808
+ const n = this.getSelectedItems(), a = this.getKey(s, r), c = n.some((h, p) => Object.is(this.getKey(h, p), a)) ? n.filter((h, p) => !Object.is(this.getKey(h, p), a)) : [...n, s];
809
+ this.anchorIndex = r, this.setSelectedItems(c, "multi selection toggled");
850
810
  return;
851
811
  }
852
- this.anchorIndex = r, this.setSelectedItems([i], "multi selection changed");
812
+ this.anchorIndex = r, this.setSelectedItems([s], "multi selection changed");
853
813
  }
854
814
  }
855
815
  onKeyboardMove(r, e) {
@@ -858,15 +818,15 @@ class st extends Be {
858
818
  supportsDragSelection() {
859
819
  return !0;
860
820
  }
861
- selectDragRange(r, e, a) {
862
- const i = this.getItems(), n = Math.min(r, e), o = Math.max(r, e), l = i.slice(n, o + 1), d = ue(a) ? Re(this.getSelectedItems(), l, this.getKey) : [...l];
863
- this.anchorIndex = r, this.setSelectedItems(d, "drag selection changed");
821
+ selectDragRange(r, e, i) {
822
+ const s = this.getItems(), n = Math.min(r, e), a = Math.max(r, e), l = s.slice(n, a + 1), c = ue(i) ? Ne(this.getSelectedItems(), l, this.getKey) : [...l];
823
+ this.anchorIndex = r, this.setSelectedItems(c, "drag selection changed");
864
824
  }
865
825
  }
866
- function ne(t) {
867
- return t.multiSelect ? new st(t) : new ge(t);
826
+ function se(t) {
827
+ return t.multiSelect ? new lt(t) : new Ee(t);
868
828
  }
869
- class ot {
829
+ class ct {
870
830
  constructor(r) {
871
831
  this.source = r;
872
832
  }
@@ -884,13 +844,13 @@ class ot {
884
844
  return this.source.set(r[0] ?? null, e);
885
845
  }
886
846
  subscribe(r, e) {
887
- return this.source.subscribe((a) => r({
888
- ...a,
889
- value: a.value == null ? [] : [a.value]
847
+ return this.source.subscribe((i) => r({
848
+ ...i,
849
+ value: i.value == null ? [] : [i.value]
890
850
  }), e);
891
851
  }
892
852
  }
893
- function we(t, r) {
853
+ function Se(t, r) {
894
854
  if (t != null && typeof t == "object") {
895
855
  const e = Reflect.get(t, "id");
896
856
  if (e != null) return e;
@@ -903,44 +863,44 @@ function we(t, r) {
903
863
  function ue(t) {
904
864
  return !!(t.ctrlKey || t.metaKey);
905
865
  }
906
- function lt(t, r) {
866
+ function dt(t, r) {
907
867
  return r <= 0 ? 0 : Math.min(Math.max(t, 0), r - 1);
908
868
  }
909
- function Re(t, r, e) {
910
- const a = [...t], i = new Set(t.map((n, o) => e(n, o)));
869
+ function Ne(t, r, e) {
870
+ const i = [...t], s = new Set(t.map((n, a) => e(n, a)));
911
871
  for (const n of r) {
912
- const o = e(n, a.length);
913
- i.has(o) || (i.add(o), a.push(n));
872
+ const a = e(n, i.length);
873
+ s.has(a) || (s.add(a), i.push(n));
914
874
  }
915
- return a;
875
+ return i;
916
876
  }
917
- class G extends g {
877
+ class Q extends y {
918
878
  constructor(e = {}) {
919
879
  super(e);
920
- s(this, "itemsEmitter");
921
- s(this, "items$");
922
- s(this, "selectedItemsEmitter");
923
- s(this, "selectedItems$");
924
- s(this, "selectedItemEmitter");
925
- s(this, "selectedItem$");
926
- s(this, "getItemKey");
927
- s(this, "selectionHandler");
928
- s(this, "ownedItemsEmitter");
929
- ct(e.items) ? (this.itemsEmitter = e.items, this.ownedItemsEmitter = null) : (this.ownedItemsEmitter = new I(e.items ?? [], {
880
+ o(this, "itemsEmitter");
881
+ o(this, "items$");
882
+ o(this, "selectedItemsEmitter");
883
+ o(this, "selectedItems$");
884
+ o(this, "selectedItemEmitter");
885
+ o(this, "selectedItem$");
886
+ o(this, "getItemKey");
887
+ o(this, "selectionHandler");
888
+ o(this, "ownedItemsEmitter");
889
+ ht(e.items) ? (this.itemsEmitter = e.items, this.ownedItemsEmitter = null) : (this.ownedItemsEmitter = new x(e.items ?? [], {
930
890
  owner: this,
931
891
  purpose: "list items"
932
- }), this.itemsEmitter = this.ownedItemsEmitter), this.items$ = this.itemsEmitter, this.getItemKey = dt(e.itemKey), this.selectionHandler = e.multiSelect === !0 ? ne({
892
+ }), this.itemsEmitter = this.ownedItemsEmitter), this.items$ = this.itemsEmitter, this.getItemKey = ut(e.itemKey), this.selectionHandler = e.multiSelect === !0 ? se({
933
893
  owner: this,
934
894
  multiSelect: !0,
935
895
  ...e.selectedItemsEmitter == null ? {} : { selectedItemsEmitter: e.selectedItemsEmitter },
936
896
  getItems: () => this.itemsEmitter.get(),
937
897
  getKey: this.getItemKey
938
- }) : ne({
898
+ }) : se({
939
899
  owner: this,
940
900
  ...e.selectedItemEmitter == null ? {} : { selectedItemEmitter: e.selectedItemEmitter },
941
901
  getItems: () => this.itemsEmitter.get(),
942
902
  getKey: this.getItemKey
943
- }), this.selectedItemsEmitter = this.selectionHandler.selectedItemsEmitter, this.selectedItems$ = this.selectedItemsEmitter, this.selectedItemEmitter = this.selectionHandler instanceof ge ? this.selectionHandler.selectedItemEmitter : null, this.selectedItem$ = this.selectedItemEmitter;
903
+ }), this.selectedItemsEmitter = this.selectionHandler.selectedItemsEmitter, this.selectedItems$ = this.selectedItemsEmitter, this.selectedItemEmitter = this.selectionHandler instanceof Ee ? this.selectionHandler.selectedItemEmitter : null, this.selectedItem$ = this.selectedItemEmitter;
944
904
  }
945
905
  initialize() {
946
906
  this.watch(this.itemsEmitter, this.selectedItemsEmitter);
@@ -948,40 +908,38 @@ class G extends g {
948
908
  render() {
949
909
  const e = this.itemsEmitter.get();
950
910
  if (!Array.isArray(e)) throw new TypeError("ListView items must be an array");
951
- const a = this.itemsEmitter.getFetchState(), i = this.itemsEmitter.getError(), n = a === k.Initial || a === k.Loading, o = new Set(this.selectedItemsEmitter.get().map((d, h) => this.getItemKey(d, h))), l = this.Host;
911
+ const i = this.itemsEmitter.getFetchState(), s = this.itemsEmitter.getError(), n = i === k.Initial || i === k.Loading, a = new Set(this.selectedItemsEmitter.get().map((c, h) => this.getItemKey(c, h))), l = this.Host;
952
912
  return /* @__PURE__ */ w(
953
913
  l,
954
914
  {
955
- className: E(this.props) || null,
915
+ className: R("datacomponentlike", E(this.props)),
956
916
  children: [
957
- a === k.Error ? /* @__PURE__ */ u("p", { role: "alert", "data-part": "error", children: ft(i, "Unable to load items") }) : null,
917
+ i === k.Error ? /* @__PURE__ */ u("p", { role: "alert", children: ft(s, "Unable to load items") }) : null,
958
918
  n && e.length === 0 ? /* @__PURE__ */ w("div", { role: "status", "data-part": "loading", children: [
959
919
  /* @__PURE__ */ u("span", { children: "Loading items…" }),
960
- Array.from({ length: this.props.placeholderCount ?? 5 }, (d, h) => /* @__PURE__ */ u("div", { "data-part": "placeholder-row", children: /* @__PURE__ */ u(H, { width: 45 + h * 7 }) }, `placeholder-${h}`))
920
+ Array.from({ length: this.props.placeholderCount ?? 5 }, (c, h) => /* @__PURE__ */ u("div", { "data-part": "placeholder-row", children: /* @__PURE__ */ u(M, { width: 45 + h * 7 }) }, `placeholder-${h}`))
961
921
  ] }) : null,
962
- a === k.Ready && e.length === 0 ? /* @__PURE__ */ u("p", { role: "status", "data-part": "empty", children: "No items" }) : null,
922
+ i === k.Ready && e.length === 0 ? /* @__PURE__ */ u("p", { role: "status", children: "No items" }) : null,
963
923
  e.length > 0 ? /* @__PURE__ */ u(
964
924
  "div",
965
925
  {
966
926
  role: "listbox",
967
- "data-part": "list",
968
927
  "aria-label": this.props.label ?? "Items",
969
928
  "aria-busy": n ? "true" : null,
970
929
  "aria-multiselectable": this.props.multiSelect ? "true" : null,
971
- children: e.map((d, h) => {
972
- const f = this.getItemKey(d, h), p = o.has(f), m = this.props.renderItem ? this.props.renderItem(d, h) : ut(d);
930
+ children: e.map((c, h) => {
931
+ const p = this.getItemKey(c, h), f = a.has(p), g = this.props.renderItem ? this.props.renderItem(c, h) : pt(c);
973
932
  return /* @__PURE__ */ u(
974
933
  "div",
975
934
  {
976
935
  role: "option",
977
- "data-part": "row",
978
936
  "data-fray-selectable-row": "",
979
937
  "data-index": h,
980
- "aria-selected": String(p),
938
+ "aria-selected": String(f),
981
939
  tabIndex: h === 0 ? 0 : -1,
982
- children: m
940
+ children: g
983
941
  },
984
- String(f)
942
+ String(p)
985
943
  );
986
944
  })
987
945
  }
@@ -991,8 +949,8 @@ class G extends g {
991
949
  );
992
950
  }
993
951
  afterUpdate(e) {
994
- const a = e instanceof Element ? e.querySelectorAll("[data-fray-selectable-row]") : [];
995
- this.selectionHandler.rowsUpdated(a);
952
+ const i = e instanceof Element ? e.querySelectorAll("[data-fray-selectable-row]") : [];
953
+ this.selectionHandler.rowsUpdated(i);
996
954
  }
997
955
  getSelectedItems() {
998
956
  return this.selectionHandler.getSelectedItems();
@@ -1012,10 +970,10 @@ class G extends g {
1012
970
  this.selectionHandler.destroy(), (e = this.ownedItemsEmitter) == null || e.dispose();
1013
971
  }
1014
972
  }
1015
- s(G, "dependencies", [H]), s(G, "hostName", "list-view"), s(G, "standaloneHostName", "list-view"), s(G, "baseStyles", [
973
+ o(Q, "dependencies", [M]), o(Q, "hostName", "list-view"), o(Q, "standaloneHostName", "list-view"), o(Q, "baseStyles", [
1016
974
  ["&", "inputlike"],
1017
- ['& > [data-part="list"] > [data-part="row"]', "inputline"]
1018
- ]), s(G, "css", v`
975
+ ['& > [role="listbox"] > [role="option"]', "inputline"]
976
+ ]), o(Q, "css", S`
1019
977
  & {
1020
978
  display: flex;
1021
979
  flex-direction: column;
@@ -1023,127 +981,110 @@ s(G, "dependencies", [H]), s(G, "hostName", "list-view"), s(G, "standaloneHostNa
1023
981
  min-height: 0;
1024
982
  }
1025
983
 
1026
- & > [data-part="list"],
984
+ & > [role="listbox"],
1027
985
  & > [data-part="loading"] {
1028
986
  display: flex;
1029
987
  flex-direction: column;
1030
988
  }
1031
989
 
1032
- & > [data-part="list"] > [data-part="row"] {
990
+ & > [role="listbox"] > [role="option"] {
1033
991
  cursor: default;
1034
992
  user-select: none;
1035
993
  }
1036
994
 
1037
- & > [data-part="list"] > [data-part="row"]:hover,
1038
- & > [data-part="list"] > [data-part="row"]:focus-visible {
1039
- background: var(--button-background-hover);
1040
- outline: 2px solid var(--ui-accent-color);
1041
- outline-offset: -2px;
1042
- }
1043
-
1044
- & > [data-part="list"] > [data-part="row"][aria-selected="true"] {
1045
- color: var(--toggle-selected-text);
1046
- background: var(--toggle-selected-bg);
1047
- }
1048
-
1049
- & > [data-part="empty"],
1050
- & > [data-part="error"] {
995
+ & > [role="status"],
996
+ & > [role="alert"] {
1051
997
  margin: 0;
1052
998
  padding: var(--ui-padding);
1053
999
  }
1054
-
1055
- & > [data-part="error"] {
1056
- color: var(--error-color);
1057
- }
1058
1000
  `);
1059
- function dt(t) {
1060
- if (t == null) return we;
1001
+ function ut(t) {
1002
+ if (t == null) return Se;
1061
1003
  if (typeof t == "function") return t;
1062
1004
  if (typeof t == "string" && t.length > 0)
1063
1005
  return (r, e) => {
1064
1006
  if (r == null || typeof r != "object" && typeof r != "function")
1065
1007
  throw new TypeError(`ListView item at index ${e} lacks ${t}`);
1066
- const a = Reflect.get(r, t);
1067
- if (a == null)
1008
+ const i = Reflect.get(r, t);
1009
+ if (i == null)
1068
1010
  throw new TypeError(`ListView item at index ${e} lacks ${t}`);
1069
- return a;
1011
+ return i;
1070
1012
  };
1071
1013
  throw new TypeError("ListView itemKey must be a function or property name");
1072
1014
  }
1073
- function ct(t) {
1015
+ function ht(t) {
1074
1016
  return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
1075
1017
  }
1076
- function ut(t) {
1018
+ function pt(t) {
1077
1019
  if (t != null && (typeof t == "object" || typeof t == "function")) {
1078
1020
  const r = Reflect.get(t, "label");
1079
- if (ht(r)) return r;
1021
+ if (mt(r)) return r;
1080
1022
  }
1081
1023
  return String(t);
1082
1024
  }
1083
- function ht(t) {
1025
+ function mt(t) {
1084
1026
  return t == null || typeof t == "string" || typeof t == "number";
1085
1027
  }
1086
1028
  function ft(t, r) {
1087
1029
  return t instanceof Error ? t.message : t == null ? r : String(t);
1088
1030
  }
1089
- class D extends g {
1031
+ class D extends y {
1090
1032
  constructor(e = {}) {
1091
1033
  super(e);
1092
- s(this, "symbols");
1093
- s(this, "valueEmitter");
1094
- s(this, "semanticStateEmitter");
1095
- const a = this.constructor;
1096
- this.symbols = e.symbols ?? a.symbols, pt(this.symbols);
1097
- const i = e.initialSemanticState ?? a.defaultSemanticState ?? this.symbols[0][1], n = { ...e };
1098
- n.defaultValue == null && e.initialSemanticState != null && (n.defaultValue = e.initialSemanticState), this.valueEmitter = M(
1034
+ o(this, "symbols");
1035
+ o(this, "valueEmitter");
1036
+ o(this, "semanticStateEmitter");
1037
+ const i = this.constructor;
1038
+ this.symbols = e.symbols ?? i.symbols, bt(this.symbols);
1039
+ const s = e.initialSemanticState ?? i.defaultSemanticState ?? this.symbols[0][1], n = { ...e };
1040
+ n.defaultValue == null && e.initialSemanticState != null && (n.defaultValue = e.initialSemanticState), this.valueEmitter = z(
1099
1041
  this,
1100
1042
  n,
1101
- i,
1043
+ s,
1102
1044
  "checkbox semantic state"
1103
1045
  ), this.semanticStateEmitter = this.valueEmitter;
1104
1046
  }
1105
1047
  initialize() {
1106
1048
  this.watch(this.valueEmitter);
1107
1049
  }
1108
- cycleState(e = 1, a = null) {
1050
+ cycleState(e = 1, i = null) {
1109
1051
  if (this.props.disabled) return;
1110
- const i = this.symbols.findIndex(([, d]) => Object.is(d, this.valueEmitter.get())), o = ((i < 0 ? 0 : i) + e + this.symbols.length) % this.symbols.length, l = this.symbols[o][1];
1111
- this.valueEmitter.set(l, "checkbox state changed"), C(this.props.onChange, l, a);
1052
+ const s = this.symbols.findIndex(([, c]) => Object.is(c, this.valueEmitter.get())), a = ((s < 0 ? 0 : s) + e + this.symbols.length) % this.symbols.length, l = this.symbols[a][1];
1053
+ this.valueEmitter.set(l, "checkbox state changed"), K(this.props.onChange, l, i);
1112
1054
  }
1113
1055
  render() {
1114
1056
  const {
1115
1057
  label: e = this.props.value ?? "Option",
1116
- disabled: a = !1,
1117
- required: i = !1,
1058
+ disabled: i = !1,
1059
+ required: s = !1,
1118
1060
  name: n,
1119
- value: o
1120
- } = this.props, l = this.valueEmitter.get(), [d] = this.symbols.find(([, m]) => Object.is(m, l)) ?? ["?", l], h = rt(l), f = l === y.Prefer || l === y.Require, p = this.Host;
1061
+ value: a
1062
+ } = this.props, l = this.valueEmitter.get(), c = this.symbols.findIndex(([, m]) => Object.is(m, l)), [h] = this.symbols[c] ?? ["?", l], p = it(l), f = l === b.Prefer || l === b.Require || this.symbols.length === 2 && c === 1, g = this.Host;
1121
1063
  return /* @__PURE__ */ u(
1122
- p,
1064
+ g,
1123
1065
  {
1124
1066
  className: E(this.props) || null,
1125
- "data-disabled": a ? "" : null,
1126
- "data-required": i ? "" : null,
1127
- "data-state": h,
1067
+ "data-disabled": i ? "" : null,
1068
+ "data-required": s ? "" : null,
1069
+ "data-state": p,
1128
1070
  children: /* @__PURE__ */ w(
1129
1071
  "button",
1130
1072
  {
1131
1073
  type: "button",
1132
1074
  role: "checkbox",
1133
- disabled: a,
1075
+ disabled: i,
1134
1076
  name: n,
1135
- value: o == null ? void 0 : String(o),
1136
- "data-part": "control",
1077
+ value: a == null ? void 0 : String(a),
1137
1078
  "aria-checked": f ? "true" : "false",
1138
- "aria-required": i ? "true" : null,
1139
- "aria-label": `${e}: ${h}`,
1079
+ "aria-required": s ? "true" : null,
1080
+ "aria-label": `${e}: ${p}`,
1140
1081
  onClick: (m) => this.cycleState(1, m),
1141
1082
  onKeyDown: (m) => {
1142
1083
  m.key === "ArrowRight" || m.key === "ArrowDown" ? (m.preventDefault(), this.cycleState(1, m)) : (m.key === "ArrowLeft" || m.key === "ArrowUp") && (m.preventDefault(), this.cycleState(-1, m));
1143
1084
  },
1144
1085
  children: [
1145
- /* @__PURE__ */ u("span", { "data-part": "symbol", "aria-hidden": "true", children: d }),
1146
- /* @__PURE__ */ u("span", { "data-part": "label", children: e })
1086
+ /* @__PURE__ */ u("span", { className: "inputshell", "aria-hidden": "true", children: h }),
1087
+ /* @__PURE__ */ u("span", { children: e })
1147
1088
  ]
1148
1089
  }
1149
1090
  )
@@ -1151,15 +1092,14 @@ class D extends g {
1151
1092
  );
1152
1093
  }
1153
1094
  }
1154
- s(D, "symbols", [
1155
- ["☐", y.Neutral],
1156
- ["✓", y.Prefer]
1157
- ]), s(D, "defaultSemanticState", y.Neutral), s(D, "hostName", "checkbox"), s(D, "standaloneHostName", "check-box"), s(D, "baseStyles", [
1095
+ o(D, "symbols", [
1096
+ ["☐", b.Neutral],
1097
+ ["✓", b.Prefer]
1098
+ ]), o(D, "defaultSemanticState", b.Neutral), o(D, "hostName", "checkbox"), o(D, "standaloneHostName", "check-box"), o(D, "baseStyles", [
1158
1099
  ["&", ["inputline"]],
1159
- ['& > [data-part="control"]', ["input", "inputline"]],
1160
- ["&[data-disabled]", ["disabled"]]
1161
- ]), s(D, "css", v`
1162
- & > [data-part="control"] {
1100
+ ['& > [role="checkbox"]', ["input", "inputline"]]
1101
+ ]), o(D, "css", S`
1102
+ & > [role="checkbox"] {
1163
1103
  display: inline-flex;
1164
1104
  align-items: center;
1165
1105
  gap: 0.35em;
@@ -1167,66 +1107,55 @@ s(D, "symbols", [
1167
1107
  font-family: inherit;
1168
1108
  }
1169
1109
 
1170
- & [data-part="symbol"] {
1110
+ & .inputshell {
1171
1111
  display: inline-grid;
1172
1112
  width: 1em;
1173
1113
  height: 1em;
1174
1114
  line-height: 1;
1175
1115
  place-items: center;
1176
- color: var(--fray-checkbox-symbol-color, currentColor);
1177
- background: var(--fray-checkbox-box-background, transparent);
1178
- border: var(--fray-checkbox-box-border, var(--cbx-o-border));
1179
- border-radius: var(--cbx-border-radius, var(--fray-radius-sm));
1180
- }
1181
-
1182
- & [data-part="control"][aria-checked="true"] [data-part="symbol"] {
1183
- background: var(
1184
- --fray-checkbox-box-background-checked,
1185
- var(--fray-selection-background)
1186
- );
1187
1116
  }
1188
1117
  `);
1189
- function pt(t) {
1118
+ function bt(t) {
1190
1119
  if (!Array.isArray(t) || t.length === 0)
1191
1120
  throw new TypeError("Checkbox symbols must be a non-empty tuple array");
1192
1121
  for (const r of t)
1193
1122
  if (!Array.isArray(r) || r.length < 2)
1194
1123
  throw new TypeError("Checkbox symbols must be [symbol, state] tuples");
1195
1124
  }
1196
- class V extends g {
1125
+ class U extends y {
1197
1126
  constructor(e = {}) {
1198
1127
  super(e);
1199
- s(this, "optionsEmitter");
1200
- s(this, "optionStateEmitters", /* @__PURE__ */ new Map());
1201
- s(this, "staleOptionValues", /* @__PURE__ */ new Set());
1202
- s(this, "placementTimer", null);
1203
- this.optionsEmitter = wt(e.options) ? e.options : null;
1128
+ o(this, "optionsEmitter");
1129
+ o(this, "optionStateEmitters", /* @__PURE__ */ new Map());
1130
+ o(this, "staleOptionValues", /* @__PURE__ */ new Set());
1131
+ o(this, "placementTimer", null);
1132
+ this.optionsEmitter = St(e.options) ? e.options : null;
1204
1133
  }
1205
1134
  initialize() {
1206
1135
  this.optionsEmitter && this.watch(this.optionsEmitter);
1207
1136
  }
1208
1137
  render() {
1209
- var f, p, m;
1210
- const e = ((f = this.optionsEmitter) == null ? void 0 : f.get()) ?? (Array.isArray(this.props.options) ? this.props.options : []);
1138
+ var p, f, g;
1139
+ const e = ((p = this.optionsEmitter) == null ? void 0 : p.get()) ?? (Array.isArray(this.props.options) ? this.props.options : []);
1211
1140
  if (!Array.isArray(e))
1212
1141
  throw new TypeError("FilterPanel options must be an array or emitter of arrays");
1213
- const a = ((p = this.optionsEmitter) == null ? void 0 : p.getFetchState()) ?? k.Ready, i = (m = this.optionsEmitter) == null ? void 0 : m.getError(), n = Ne(this.props.filters), o = this.props.filterModes ?? D.symbols, l = this.props.defaultSemanticState ?? y.Neutral, d = new Set(e.map(pe));
1142
+ const i = ((f = this.optionsEmitter) == null ? void 0 : f.getFetchState()) ?? k.Ready, s = (g = this.optionsEmitter) == null ? void 0 : g.getError(), n = $e(this.props.filters), a = this.props.filterModes ?? D.symbols, l = this.props.defaultSemanticState ?? b.Neutral, c = new Set(e.map(be));
1214
1143
  this.staleOptionValues = new Set(
1215
- [...this.optionStateEmitters.keys()].filter((b) => !d.has(b))
1144
+ [...this.optionStateEmitters.keys()].filter((m) => !c.has(m))
1216
1145
  );
1217
1146
  const h = this.Host;
1218
- return a === k.Error ? /* @__PURE__ */ u(
1147
+ return i === k.Error ? /* @__PURE__ */ u(
1219
1148
  h,
1220
1149
  {
1221
- className: E(this.props) || null,
1150
+ className: R("panellike", E(this.props)),
1222
1151
  role: "alert",
1223
1152
  "data-state": "error",
1224
- children: Et(i, "Unable to load filter options")
1153
+ children: It(s, "Unable to load filter options")
1225
1154
  }
1226
- ) : (a === k.Initial || a === k.Loading) && e.length === 0 ? /* @__PURE__ */ u(
1155
+ ) : (i === k.Initial || i === k.Loading) && e.length === 0 ? /* @__PURE__ */ u(
1227
1156
  h,
1228
1157
  {
1229
- className: E(this.props) || null,
1158
+ className: R("panellike", E(this.props)),
1230
1159
  role: "status",
1231
1160
  "data-state": "loading",
1232
1161
  children: "Loading filter options…"
@@ -1234,34 +1163,34 @@ class V extends g {
1234
1163
  ) : /* @__PURE__ */ u(
1235
1164
  h,
1236
1165
  {
1237
- className: E(this.props) || null,
1166
+ className: R("panellike", E(this.props)),
1238
1167
  role: "group",
1239
1168
  "aria-label": this.props.label ?? "Filter options",
1240
- children: e.length === 0 ? /* @__PURE__ */ u("span", { children: "No filter options" }) : e.map((b) => {
1241
- const S = pe(b), x = bt(b), O = n.get(S) ?? l, $ = this.optionEmitter(S, O);
1169
+ children: e.length === 0 ? /* @__PURE__ */ u("span", { children: "No filter options" }) : e.map((m) => {
1170
+ const I = be(m), v = yt(m), O = n.get(I) ?? l, C = this.optionEmitter(I, O);
1242
1171
  return /* @__PURE__ */ u(
1243
- mt,
1172
+ gt,
1244
1173
  {
1245
- label: x,
1246
- valueEmitter: $,
1247
- symbols: o,
1248
- onChange: (K, A) => {
1249
- var T, B;
1174
+ label: v,
1175
+ valueEmitter: C,
1176
+ symbols: a,
1177
+ onChange: (j, A) => {
1178
+ var T, G;
1250
1179
  A == null || A.stopPropagation();
1251
- const F = Ne(this.props.filters);
1252
- K === y.Neutral ? F.delete(S) : F.set(S, K), (B = (T = this.props).onChange) == null || B.call(T, F, A);
1180
+ const H = $e(this.props.filters);
1181
+ j === b.Neutral ? H.delete(I) : H.set(I, j), (G = (T = this.props).onChange) == null || G.call(T, H, A);
1253
1182
  }
1254
1183
  },
1255
- yt(S)
1184
+ wt(I)
1256
1185
  );
1257
1186
  })
1258
1187
  }
1259
1188
  );
1260
1189
  }
1261
1190
  afterUpdate(e) {
1262
- var a;
1263
- for (const i of this.staleOptionValues)
1264
- (a = this.optionStateEmitters.get(i)) == null || a.dispose(), this.optionStateEmitters.delete(i);
1191
+ var i;
1192
+ for (const s of this.staleOptionValues)
1193
+ (i = this.optionStateEmitters.get(s)) == null || i.dispose(), this.optionStateEmitters.delete(s);
1265
1194
  this.staleOptionValues.clear(), this.placementTimer != null && clearTimeout(this.placementTimer), this.placementTimer = setTimeout(() => {
1266
1195
  this.placementTimer = null, this.placeInsideViewport(e);
1267
1196
  }, 0);
@@ -1271,26 +1200,26 @@ class V extends g {
1271
1200
  for (const e of this.optionStateEmitters.values()) e.dispose();
1272
1201
  this.optionStateEmitters.clear();
1273
1202
  }
1274
- optionEmitter(e, a) {
1275
- const i = this.optionStateEmitters.get(e);
1276
- if (i != null)
1277
- return i.get() !== a && i.set(a, "filter option synchronized"), i;
1278
- const n = new I(a, { owner: this, purpose: `filter option ${String(e)}` });
1203
+ optionEmitter(e, i) {
1204
+ const s = this.optionStateEmitters.get(e);
1205
+ if (s != null)
1206
+ return s.get() !== i && s.set(i, "filter option synchronized"), s;
1207
+ const n = new x(i, { owner: this, purpose: `filter option ${String(e)}` });
1279
1208
  return this.optionStateEmitters.set(e, n), n;
1280
1209
  }
1281
1210
  placeInsideViewport(e) {
1282
1211
  if (!(e instanceof HTMLElement) || e.parentElement == null) return;
1283
- const a = e.ownerDocument.defaultView;
1284
- if (a == null || a.innerHeight <= 0) return;
1285
- const i = e.parentElement.getBoundingClientRect();
1212
+ const i = e.ownerDocument.defaultView;
1213
+ if (i == null || i.innerHeight <= 0) return;
1214
+ const s = e.parentElement.getBoundingClientRect();
1286
1215
  e.style.removeProperty("max-height");
1287
- const n = e.getBoundingClientRect(), o = i.top, l = Math.max(0, a.innerHeight - i.bottom), d = n.height > l && o > l;
1288
- d ? (e.dataset.placement = "above", e.style.insetBlockStart = `${Math.max(8, i.top - n.height)}px`) : (delete e.dataset.placement, e.style.insetBlockStart = `${i.bottom}px`), e.style.insetInlineEnd = `${Math.max(8, a.innerWidth - i.right)}px`;
1289
- const h = d ? o : l;
1216
+ const n = e.getBoundingClientRect(), a = s.top, l = Math.max(0, i.innerHeight - s.bottom), c = n.height > l && a > l;
1217
+ c ? (e.dataset.placement = "above", e.style.insetBlockStart = `${Math.max(8, s.top - n.height)}px`) : (delete e.dataset.placement, e.style.insetBlockStart = `${s.bottom}px`), e.style.insetInlineEnd = `${Math.max(8, i.innerWidth - s.right)}px`;
1218
+ const h = c ? a : l;
1290
1219
  e.style.maxHeight = `${Math.max(48, h - 8)}px`;
1291
1220
  }
1292
1221
  }
1293
- s(V, "dependencies", [D]), s(V, "hostName", "filter-panel"), s(V, "standaloneHostName", "filter-panel"), s(V, "css", v`
1222
+ o(U, "dependencies", [D]), o(U, "hostName", "filter-panel"), o(U, "standaloneHostName", "filter-panel"), o(U, "css", S`
1294
1223
  & {
1295
1224
  position: fixed;
1296
1225
  z-index: 1100;
@@ -1301,23 +1230,18 @@ s(V, "dependencies", [D]), s(V, "hostName", "filter-panel"), s(V, "standaloneHos
1301
1230
  padding: var(--ui-padding);
1302
1231
  flex-flow: column nowrap;
1303
1232
  align-items: stretch;
1304
- color: var(--panel-color);
1305
- background: var(--panel-bg);
1306
- border: var(--panel-border);
1307
- border-radius: var(--panel-radius);
1308
- box-shadow: var(--panel-shadow);
1309
1233
  overflow-y: auto;
1310
1234
  }
1311
1235
 
1312
1236
  `);
1313
- const mt = D;
1314
- function Ne(t) {
1237
+ const gt = D;
1238
+ function $e(t) {
1315
1239
  if (t == null) return /* @__PURE__ */ new Map();
1316
1240
  if (t instanceof Map) return new Map(t);
1317
1241
  if (Array.isArray(t)) return new Map(t);
1318
1242
  throw new TypeError("FilterPanel filters must be a Map or tuple array");
1319
1243
  }
1320
- function pe(t) {
1244
+ function be(t) {
1321
1245
  if (typeof t == "string" || typeof t == "number") return t;
1322
1246
  if (t != null && typeof t == "object") {
1323
1247
  const r = Reflect.get(t, "value");
@@ -1325,30 +1249,30 @@ function pe(t) {
1325
1249
  }
1326
1250
  throw new TypeError("Filter options must be strings, numbers, or value/label objects");
1327
1251
  }
1328
- function bt(t) {
1252
+ function yt(t) {
1329
1253
  if (t != null && typeof t == "object") {
1330
1254
  const r = Reflect.get(t, "label");
1331
- if (r != null) return gt(r) ? r : String(r);
1255
+ if (r != null) return Et(r) ? r : String(r);
1332
1256
  }
1333
- return String(pe(t));
1257
+ return String(be(t));
1334
1258
  }
1335
- function yt(t) {
1259
+ function wt(t) {
1336
1260
  return `${typeof t}:${String(t)}`;
1337
1261
  }
1338
- function gt(t) {
1262
+ function Et(t) {
1339
1263
  return typeof t == "string" || typeof t == "number";
1340
1264
  }
1341
- function wt(t) {
1265
+ function St(t) {
1342
1266
  return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
1343
1267
  }
1344
- function Et(t, r) {
1268
+ function It(t, r) {
1345
1269
  return t instanceof Error ? t.message : t == null ? r : String(t);
1346
1270
  }
1347
- class W extends g {
1271
+ class J extends y {
1348
1272
  constructor() {
1349
1273
  super(...arguments);
1350
- s(this, "filterVisible", !1);
1351
- s(this, "onGlobalClick", (e) => {
1274
+ o(this, "filterVisible", !1);
1275
+ o(this, "onGlobalClick", (e) => {
1352
1276
  this.filterVisible && this.dom instanceof Node && e.target instanceof Node && !this.dom.contains(e.target) && (this.filterVisible = !1, this.update());
1353
1277
  });
1354
1278
  }
@@ -1358,29 +1282,29 @@ class W extends g {
1358
1282
  toggleSort() {
1359
1283
  if (!this.props.sortable) return;
1360
1284
  const e = this.props.sortEmitter.get();
1361
- let a;
1362
- (e == null ? void 0 : e.field) !== this.props.field ? a = { field: this.props.field, direction: "asc" } : e.direction === "asc" ? a = { field: this.props.field, direction: "desc" } : a = null, this.props.sortEmitter.set(a, "table sort changed");
1285
+ let i;
1286
+ (e == null ? void 0 : e.field) !== this.props.field ? i = { field: this.props.field, direction: "asc" } : e.direction === "asc" ? i = { field: this.props.field, direction: "desc" } : i = null, this.props.sortEmitter.set(i, "table sort changed");
1363
1287
  }
1364
1288
  toggleFilterPanel(e) {
1365
1289
  e.stopPropagation(), this.filterVisible = !this.filterVisible, this.update();
1366
1290
  }
1367
- updateFilters(e, a) {
1368
- var n, o;
1369
- const i = { ...this.props.filtersEmitter.get() };
1370
- e.size === 0 ? delete i[this.props.field] : i[this.props.field] = [...e.entries()], this.props.filtersEmitter.set(i, "table filters changed"), (o = (n = this.props).onFilterChange) == null || o.call(n, i, a);
1291
+ updateFilters(e, i) {
1292
+ var n, a;
1293
+ const s = { ...this.props.filtersEmitter.get() };
1294
+ e.size === 0 ? delete s[this.props.field] : s[this.props.field] = [...e.entries()], this.props.filtersEmitter.set(s, "table filters changed"), (a = (n = this.props).onFilterChange) == null || a.call(n, s, i);
1371
1295
  }
1372
1296
  render() {
1373
- const e = this.props.sortEmitter.get(), a = (e == null ? void 0 : e.field) === this.props.field ? e.direction : null, i = new Map(
1374
- (this.props.filtersEmitter.get()[this.props.field] ?? []).filter(vt)
1375
- ), n = this.props.label ?? String(this.props.field), o = `Filter ${String(n)}`;
1297
+ const e = this.props.sortEmitter.get(), i = (e == null ? void 0 : e.field) === this.props.field ? e.direction : null, s = new Map(
1298
+ (this.props.filtersEmitter.get()[this.props.field] ?? []).filter(kt)
1299
+ ), n = this.props.label ?? String(this.props.field), a = `Filter ${String(n)}`;
1376
1300
  let l = null;
1377
1301
  return this.filterVisible && this.props.filterOptions != null && (l = /* @__PURE__ */ u(
1378
- V,
1302
+ U,
1379
1303
  {
1380
- label: o,
1304
+ label: a,
1381
1305
  options: this.props.filterOptions,
1382
- filters: i,
1383
- onChange: (d, h) => this.updateFilters(d, h),
1306
+ filters: s,
1307
+ onChange: (c, h) => this.updateFilters(c, h),
1384
1308
  ...this.props.filterModes == null ? {} : { filterModes: this.props.filterModes },
1385
1309
  ...this.props.defaultSemanticState == null ? {} : { defaultSemanticState: this.props.defaultSemanticState }
1386
1310
  },
@@ -1390,7 +1314,7 @@ class W extends g {
1390
1314
  {
1391
1315
  scope: "col",
1392
1316
  "data-fray-component": "table-header-cell",
1393
- "aria-sort": a === "asc" ? "ascending" : a === "desc" ? "descending" : "none",
1317
+ "aria-sort": i === "asc" ? "ascending" : i === "desc" ? "descending" : "none",
1394
1318
  style: { zIndex: this.filterVisible ? 1200 : null },
1395
1319
  children: [
1396
1320
  this.props.sortable ? /* @__PURE__ */ w(
@@ -1401,18 +1325,18 @@ class W extends g {
1401
1325
  onClick: () => this.toggleSort(),
1402
1326
  children: [
1403
1327
  n,
1404
- a === "asc" ? " ▲" : a === "desc" ? " ▼" : ""
1328
+ i === "asc" ? " ▲" : i === "desc" ? " ▼" : ""
1405
1329
  ]
1406
1330
  }
1407
- ) : /* @__PURE__ */ u("span", { "data-part": "label", children: n }),
1331
+ ) : /* @__PURE__ */ u("span", { children: n }),
1408
1332
  this.props.filterOptions == null ? null : /* @__PURE__ */ u(
1409
1333
  "button",
1410
1334
  {
1411
1335
  type: "button",
1412
1336
  "data-part": "filter-toggle",
1413
- "aria-label": o,
1337
+ "aria-label": a,
1414
1338
  "aria-expanded": String(this.filterVisible),
1415
- onClick: (d) => this.toggleFilterPanel(d),
1339
+ onClick: (c) => this.toggleFilterPanel(c),
1416
1340
  children: "Filter"
1417
1341
  }
1418
1342
  ),
@@ -1422,49 +1346,34 @@ class W extends g {
1422
1346
  );
1423
1347
  }
1424
1348
  }
1425
- s(W, "dependencies", [V]), s(W, "baseStyles", [
1426
- ['th[data-fray-component="table-header-cell"]', "noselect"],
1427
- ['th[data-fray-component="table-header-cell"] > [data-part="sort"]', ["uiline", "button"]],
1428
- ['th[data-fray-component="table-header-cell"] > [data-part="filter-toggle"]', ["uiline", "button"]]
1429
- ]), s(W, "css", v`
1430
- th[data-fray-component="table-header-cell"] {
1349
+ o(J, "dependencies", [U]), o(J, "baseStyles", [
1350
+ ["th[aria-sort]", "noselect"],
1351
+ ['th[aria-sort] > [data-part="sort"]', ["uiline", "button"]],
1352
+ ['th[aria-sort] > [data-part="filter-toggle"]', ["uiline", "button"]]
1353
+ ]), o(J, "css", S`
1354
+ th[aria-sort] {
1431
1355
  position: relative;
1432
1356
  text-align: start;
1433
- color: var(
1434
- --fray-table-header-color,
1435
- var(--fray-section-header-color, var(--fray-header-color))
1436
- );
1437
- background: var(
1438
- --fray-table-header-background,
1439
- var(--fray-section-header-background, var(--fray-header-background))
1440
- );
1441
- border-block-end: var(--fray-section-header-border, var(--fray-header-border));
1442
- box-shadow: var(--fray-section-header-shadow, var(--fray-header-shadow));
1443
1357
  }
1444
1358
 
1445
- th[data-fray-component="table-header-cell"] > [data-part="sort"],
1446
- th[data-fray-component="table-header-cell"] > [data-part="filter-toggle"] {
1359
+ th[aria-sort] > [data-part="sort"],
1360
+ th[aria-sort] > [data-part="filter-toggle"] {
1447
1361
  width: auto;
1448
1362
  font-family: inherit;
1449
- color: inherit;
1450
- background: var(
1451
- --fray-table-header-button-background,
1452
- var(--fray-button-background)
1453
- );
1454
1363
  }
1455
1364
 
1456
- th[data-fray-component="table-header-cell"] > [data-part="filter-toggle"] {
1365
+ th[aria-sort] > [data-part="filter-toggle"] {
1457
1366
  margin-inline-start: var(--ui-padding-h);
1458
1367
  font-size: 0.75em;
1459
1368
  }
1460
1369
  `);
1461
- function vt(t) {
1370
+ function kt(t) {
1462
1371
  return typeof t[0] == "string" || typeof t[0] == "number";
1463
1372
  }
1464
- class me extends g {
1373
+ class ge extends y {
1465
1374
  render() {
1466
1375
  return /* @__PURE__ */ u("thead", { "data-fray-component": "table-header", children: /* @__PURE__ */ u("tr", { children: this.props.columns.map((r) => /* @__PURE__ */ u(
1467
- W,
1376
+ J,
1468
1377
  {
1469
1378
  field: r.field,
1470
1379
  sortEmitter: this.props.sortEmitter,
@@ -1480,139 +1389,139 @@ class me extends g {
1480
1389
  )) }) });
1481
1390
  }
1482
1391
  }
1483
- s(me, "dependencies", [W]);
1484
- const St = {
1485
- [y.Neutral]: "☐",
1486
- [y.Prefer]: "",
1487
- [y.Require]: "_",
1488
- [y.Deny]: "!"
1392
+ o(ge, "dependencies", [J]);
1393
+ const xt = {
1394
+ [b.Neutral]: "☐",
1395
+ [b.Prefer]: "",
1396
+ [b.Require]: "_",
1397
+ [b.Deny]: "!"
1489
1398
  };
1490
- function kt(t, { sort: r = null, filters: e = {} } = {}) {
1491
- Nt(t), r != null && (Ge(r), t.searchParams.set("sort", `${r.field}:${r.direction}`));
1492
- for (const [a, i] of Object.entries(e))
1493
- for (const [n, o] of i) {
1494
- if (!de(o))
1495
- throw new TypeError(`Unknown filter mode for ${a}: ${String(o)}`);
1399
+ function vt(t, { sort: r = null, filters: e = {} } = {}) {
1400
+ Dt(t), r != null && (Qe(r), t.searchParams.set("sort", `${r.field}:${r.direction}`));
1401
+ for (const [i, s] of Object.entries(e))
1402
+ for (const [n, a] of s) {
1403
+ if (!le(a))
1404
+ throw new TypeError(`Unknown filter mode for ${i}: ${String(a)}`);
1496
1405
  t.searchParams.append(
1497
1406
  "filter",
1498
- `${a}:${St[o]}:${JSON.stringify(n)}`
1407
+ `${i}:${xt[a]}:${JSON.stringify(n)}`
1499
1408
  );
1500
1409
  }
1501
1410
  return t;
1502
1411
  }
1503
- function It(t, r, e) {
1412
+ function Tt(t, r, e) {
1504
1413
  if (!Array.isArray(t)) throw new TypeError("Local table data must be an array");
1505
- const a = t.filter((n) => xt(n, e));
1506
- if (r == null) return a;
1507
- Ge(r);
1508
- const i = r.direction === "asc" ? 1 : -1;
1509
- return [...a].sort((n, o) => Rt(be(n, r.field), be(o, r.field)) * i);
1510
- }
1511
- function xt(t, r) {
1512
- for (const [e, a] of Object.entries(r)) {
1513
- const i = be(t, e);
1514
- if (a.filter(([, d]) => d === y.Deny).some(([d]) => Object.is(d, i))) return !1;
1515
- const o = a.filter(([, d]) => d === y.Require);
1516
- if (o.length > 0 && !o.some(([d]) => Object.is(d, i))) return !1;
1517
- const l = a.filter(([, d]) => d === y.Prefer);
1518
- if (l.length > 0 && !l.some(([d]) => Object.is(d, i))) return !1;
1414
+ const i = t.filter((n) => Rt(n, e));
1415
+ if (r == null) return i;
1416
+ Qe(r);
1417
+ const s = r.direction === "asc" ? 1 : -1;
1418
+ return [...i].sort((n, a) => $t(ye(n, r.field), ye(a, r.field)) * s);
1419
+ }
1420
+ function Rt(t, r) {
1421
+ for (const [e, i] of Object.entries(r)) {
1422
+ const s = ye(t, e);
1423
+ if (i.filter(([, c]) => c === b.Deny).some(([c]) => Object.is(c, s))) return !1;
1424
+ const a = i.filter(([, c]) => c === b.Require);
1425
+ if (a.length > 0 && !a.some(([c]) => Object.is(c, s))) return !1;
1426
+ const l = i.filter(([, c]) => c === b.Prefer);
1427
+ if (l.length > 0 && !l.some(([c]) => Object.is(c, s))) return !1;
1519
1428
  }
1520
1429
  return !0;
1521
1430
  }
1522
- function Ge(t) {
1523
- if (t == null || typeof t != "object" || typeof Reflect.get(t, "field") != "string" || !Tt(Reflect.get(t, "direction")))
1431
+ function Qe(t) {
1432
+ if (t == null || typeof t != "object" || typeof Reflect.get(t, "field") != "string" || !Nt(Reflect.get(t, "direction")))
1524
1433
  throw new TypeError("Table sort must contain a field and asc/desc direction");
1525
1434
  }
1526
- function Tt(t) {
1435
+ function Nt(t) {
1527
1436
  return t === "asc" || t === "desc";
1528
1437
  }
1529
- function Rt(t, r) {
1438
+ function $t(t, r) {
1530
1439
  return Object.is(t, r) ? 0 : t == null ? -1 : r == null ? 1 : typeof t == "number" && typeof r == "number" ? t - r : String(t).localeCompare(String(r));
1531
1440
  }
1532
- function be(t, r) {
1441
+ function ye(t, r) {
1533
1442
  if (!(t == null || typeof t != "object" && typeof t != "function"))
1534
1443
  return Reflect.get(t, r);
1535
1444
  }
1536
- function Nt(t) {
1445
+ function Dt(t) {
1537
1446
  if (t == null || typeof t != "object" && typeof t != "function" || typeof Reflect.get(t, "toString") != "function")
1538
1447
  throw new TypeError("Table serializer requires a URL");
1539
1448
  const r = Reflect.get(t, "searchParams");
1540
1449
  if (r == null || typeof Reflect.get(r, "set") != "function" || typeof Reflect.get(r, "append") != "function")
1541
1450
  throw new TypeError("Table serializer requires URL search parameters");
1542
1451
  }
1543
- function Dt(t) {
1544
- const r = ve(t), e = Qe(t.data) ? null : new I(t.data, {
1452
+ function Ot(t) {
1453
+ const r = ke(t), e = We(t.data) ? null : new x(t.data, {
1545
1454
  owner: t.owner,
1546
1455
  purpose: "local table data"
1547
- }), a = e ?? t.data, i = new le(
1548
- [a, r.sortEmitter, r.filtersEmitter],
1549
- ([n, o, l]) => It(n, o, l),
1456
+ }), i = e ?? t.data, s = new ae(
1457
+ [i, r.sortEmitter, r.filtersEmitter],
1458
+ ([n, a, l]) => Tt(n, a, l),
1550
1459
  { owner: t.owner, purpose: "local table view" }
1551
1460
  );
1552
- return new Ee(i, r, () => {
1553
- i.dispose(), e == null || e.dispose();
1461
+ return new Ie(s, r, () => {
1462
+ s.dispose(), e == null || e.dispose();
1554
1463
  });
1555
1464
  }
1556
- function or(t) {
1557
- Ct(t.query);
1558
- const r = ve(t);
1559
- return new Ee(t.query, r);
1465
+ function cr(t) {
1466
+ jt(t.query);
1467
+ const r = ke(t);
1468
+ return new Ie(t.query, r);
1560
1469
  }
1561
- function Ot(t) {
1470
+ function Ct(t) {
1562
1471
  if (t.handler == null || typeof t.handler.fetch != "function")
1563
1472
  throw new TypeError("Table data-source handler must implement fetch");
1564
- const r = ve(t), e = new ke("sort", r.sortEmitter, {
1473
+ const r = ke(t), e = new ve("sort", r.sortEmitter, {
1565
1474
  owner: t.owner,
1566
1475
  purpose: "table sort argument"
1567
- }), a = new ke("filters", r.filtersEmitter, {
1476
+ }), i = new ve("filters", r.filtersEmitter, {
1568
1477
  owner: t.owner,
1569
1478
  purpose: "table filters argument"
1570
- }), i = new Xe({
1479
+ }), s = new Ze({
1571
1480
  handler: t.handler,
1572
- args: { sort: e, filters: a },
1481
+ args: { sort: e, filters: i },
1573
1482
  owner: t.owner,
1574
1483
  purpose: "table query",
1575
1484
  keepPreviousValue: !0
1576
1485
  });
1577
- return new Ee(i, r, () => {
1578
- i.dispose(), e.dispose(), a.dispose();
1486
+ return new Ie(s, r, () => {
1487
+ s.dispose(), e.dispose(), i.dispose();
1579
1488
  });
1580
1489
  }
1581
- function $t(t) {
1490
+ function Kt(t) {
1582
1491
  if (typeof t.url != "string" || t.url.length === 0)
1583
1492
  throw new TypeError("REST table data source requires a URL");
1584
1493
  const r = {
1585
1494
  url: t.url,
1586
- serialize: t.serializeQuery ?? kt
1495
+ serialize: t.serializeQuery ?? vt
1587
1496
  };
1588
- return t.baseUrl != null && (r.baseUrl = t.baseUrl), t.fetch != null && (r.fetch = t.fetch), Ot({
1589
- handler: new Ze(r),
1497
+ return t.baseUrl != null && (r.baseUrl = t.baseUrl), t.fetch != null && (r.fetch = t.fetch), Ct({
1498
+ handler: new et(r),
1590
1499
  ...t.sortEmitter == null ? {} : { sortEmitter: t.sortEmitter },
1591
1500
  ...t.filtersEmitter == null ? {} : { filtersEmitter: t.filtersEmitter },
1592
1501
  ...t.owner === void 0 ? {} : { owner: t.owner }
1593
1502
  });
1594
1503
  }
1595
- class Ee {
1596
- constructor(r, e, a = null) {
1597
- s(this, "sortEmitter");
1598
- s(this, "filtersEmitter");
1599
- s(this, "retry");
1600
- s(this, "disposed", !1);
1601
- this.query = r, this.state = e, this.disposeQuery = a, this.sortEmitter = e.sortEmitter, this.filtersEmitter = e.filtersEmitter, r.retry != null && (this.retry = (i) => {
1504
+ class Ie {
1505
+ constructor(r, e, i = null) {
1506
+ o(this, "sortEmitter");
1507
+ o(this, "filtersEmitter");
1508
+ o(this, "retry");
1509
+ o(this, "disposed", !1);
1510
+ this.query = r, this.state = e, this.disposeQuery = i, this.sortEmitter = e.sortEmitter, this.filtersEmitter = e.filtersEmitter, r.retry != null && (this.retry = (s) => {
1602
1511
  var n;
1603
- return (n = r.retry) == null ? void 0 : n.call(r, i);
1512
+ return (n = r.retry) == null ? void 0 : n.call(r, s);
1604
1513
  });
1605
1514
  }
1606
1515
  dispose() {
1607
- var r, e, a;
1608
- this.disposed || (this.disposed = !0, (r = this.disposeQuery) == null || r.call(this), (e = this.state.ownedSortEmitter) == null || e.dispose(), (a = this.state.ownedFiltersEmitter) == null || a.dispose());
1516
+ var r, e, i;
1517
+ this.disposed || (this.disposed = !0, (r = this.disposeQuery) == null || r.call(this), (e = this.state.ownedSortEmitter) == null || e.dispose(), (i = this.state.ownedFiltersEmitter) == null || i.dispose());
1609
1518
  }
1610
1519
  }
1611
- function ve(t) {
1612
- const r = t.sortEmitter == null ? new I(null, {
1520
+ function ke(t) {
1521
+ const r = t.sortEmitter == null ? new x(null, {
1613
1522
  owner: t.owner,
1614
1523
  purpose: "table sort"
1615
- }) : null, e = t.filtersEmitter == null ? new I({}, {
1524
+ }) : null, e = t.filtersEmitter == null ? new x({}, {
1616
1525
  owner: t.owner,
1617
1526
  purpose: "table filters"
1618
1527
  }) : null;
@@ -1623,31 +1532,31 @@ function ve(t) {
1623
1532
  ownedFiltersEmitter: e
1624
1533
  };
1625
1534
  }
1626
- function Qe(t) {
1535
+ function We(t) {
1627
1536
  return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function" && typeof Reflect.get(t, "getFetchState") == "function" && typeof Reflect.get(t, "getError") == "function";
1628
1537
  }
1629
- function Ct(t) {
1630
- if (!Qe(t))
1538
+ function jt(t) {
1539
+ if (!We(t))
1631
1540
  throw new TypeError("Table query must be an emitter");
1632
1541
  }
1633
- class X extends g {
1542
+ class X extends y {
1634
1543
  constructor(e) {
1635
- var a, i;
1544
+ var i, s;
1636
1545
  super(e);
1637
- s(this, "columns");
1638
- s(this, "rowKey");
1639
- s(this, "sortEmitter");
1640
- s(this, "filtersEmitter");
1641
- s(this, "selectedItemsEmitter");
1642
- s(this, "selectedItemEmitter");
1643
- s(this, "selectionHandler");
1644
- s(this, "query", null);
1645
- s(this, "dataSource", null);
1646
- s(this, "suppliedDataSource");
1647
- s(this, "ownedSortEmitter");
1648
- s(this, "ownedFiltersEmitter");
1649
- s(this, "ownedDataSource", null);
1650
- At(e), this.columns = Kt(e.columns), this.rowKey = jt(e.rowKey), this.suppliedDataSource = e.dataSource ?? null, this.ownedSortEmitter = this.suppliedDataSource == null ? new I(null, { owner: this, purpose: "table sort" }) : null, this.ownedFiltersEmitter = this.suppliedDataSource == null ? new I({}, { owner: this, purpose: "table filters" }) : null, this.sortEmitter = ((a = this.suppliedDataSource) == null ? void 0 : a.sortEmitter) ?? this.ownedSortEmitter, this.filtersEmitter = ((i = this.suppliedDataSource) == null ? void 0 : i.filtersEmitter) ?? this.ownedFiltersEmitter, this.selectionHandler = e.multiSelect === !0 ? ne({
1546
+ o(this, "columns");
1547
+ o(this, "rowKey");
1548
+ o(this, "sortEmitter");
1549
+ o(this, "filtersEmitter");
1550
+ o(this, "selectedItemsEmitter");
1551
+ o(this, "selectedItemEmitter");
1552
+ o(this, "selectionHandler");
1553
+ o(this, "query", null);
1554
+ o(this, "dataSource", null);
1555
+ o(this, "suppliedDataSource");
1556
+ o(this, "ownedSortEmitter");
1557
+ o(this, "ownedFiltersEmitter");
1558
+ o(this, "ownedDataSource", null);
1559
+ Ft(e), this.columns = At(e.columns), this.rowKey = Ht(e.rowKey), this.suppliedDataSource = e.dataSource ?? null, this.ownedSortEmitter = this.suppliedDataSource == null ? new x(null, { owner: this, purpose: "table sort" }) : null, this.ownedFiltersEmitter = this.suppliedDataSource == null ? new x({}, { owner: this, purpose: "table filters" }) : null, this.sortEmitter = ((i = this.suppliedDataSource) == null ? void 0 : i.sortEmitter) ?? this.ownedSortEmitter, this.filtersEmitter = ((s = this.suppliedDataSource) == null ? void 0 : s.filtersEmitter) ?? this.ownedFiltersEmitter, this.selectionHandler = e.multiSelect === !0 ? se({
1651
1560
  owner: this,
1652
1561
  multiSelect: !0,
1653
1562
  ...e.selectedItemsEmitter == null ? {} : { selectedItemsEmitter: e.selectedItemsEmitter },
@@ -1656,7 +1565,7 @@ class X extends g {
1656
1565
  return ((n = this.query) == null ? void 0 : n.get()) ?? [];
1657
1566
  },
1658
1567
  getKey: this.rowKey
1659
- }) : ne({
1568
+ }) : se({
1660
1569
  owner: this,
1661
1570
  ...e.selectedItemEmitter == null ? {} : { selectedItemEmitter: e.selectedItemEmitter },
1662
1571
  getItems: () => {
@@ -1664,15 +1573,15 @@ class X extends g {
1664
1573
  return ((n = this.query) == null ? void 0 : n.get()) ?? [];
1665
1574
  },
1666
1575
  getKey: this.rowKey
1667
- }), this.selectedItemsEmitter = this.selectionHandler.selectedItemsEmitter, this.selectedItemEmitter = this.selectionHandler instanceof ge ? this.selectionHandler.selectedItemEmitter : null;
1576
+ }), this.selectedItemsEmitter = this.selectionHandler.selectedItemsEmitter, this.selectedItemEmitter = this.selectionHandler instanceof Ee ? this.selectionHandler.selectedItemEmitter : null;
1668
1577
  }
1669
1578
  initialize() {
1670
- this.suppliedDataSource != null ? this.dataSource = this.suppliedDataSource : this.props.rest != null ? (this.ownedDataSource = $t({
1579
+ this.suppliedDataSource != null ? this.dataSource = this.suppliedDataSource : this.props.rest != null ? (this.ownedDataSource = Kt({
1671
1580
  ...this.props.rest,
1672
1581
  sortEmitter: this.sortEmitter,
1673
1582
  filtersEmitter: this.filtersEmitter,
1674
1583
  owner: this
1675
- }), this.dataSource = this.ownedDataSource) : (this.ownedDataSource = Dt({
1584
+ }), this.dataSource = this.ownedDataSource) : (this.ownedDataSource = Ot({
1676
1585
  data: this.props.data ?? [],
1677
1586
  sortEmitter: this.sortEmitter,
1678
1587
  filtersEmitter: this.filtersEmitter,
@@ -1680,38 +1589,38 @@ class X extends g {
1680
1589
  }), this.dataSource = this.ownedDataSource), this.query = this.dataSource.query, this.watch(this.query, this.selectedItemsEmitter);
1681
1590
  }
1682
1591
  render() {
1683
- var d, h, f, p;
1684
- const e = ((d = this.query) == null ? void 0 : d.get()) ?? [];
1592
+ var c, h, p, f;
1593
+ const e = ((c = this.query) == null ? void 0 : c.get()) ?? [];
1685
1594
  if (!Array.isArray(e)) throw new TypeError("DataTable query value must be an array");
1686
- const a = ((h = this.query) == null ? void 0 : h.getFetchState()) ?? k.Initial, i = (f = this.query) == null ? void 0 : f.getError(), n = a === k.Initial || a === k.Loading, o = new Set(
1687
- this.selectedItemsEmitter.get().map((m, b) => this.rowKey(m, b))
1595
+ const i = ((h = this.query) == null ? void 0 : h.getFetchState()) ?? k.Initial, s = (p = this.query) == null ? void 0 : p.getError(), n = i === k.Initial || i === k.Loading, a = new Set(
1596
+ this.selectedItemsEmitter.get().map((g, m) => this.rowKey(g, m))
1688
1597
  ), l = this.Host;
1689
1598
  return /* @__PURE__ */ w(
1690
1599
  l,
1691
1600
  {
1692
- className: E(this.props) || null,
1601
+ className: R("datacomponentlike", E(this.props)),
1693
1602
  "data-loading": n ? "" : null,
1694
- "data-error": a === k.Error ? "" : null,
1603
+ "data-error": i === k.Error ? "" : null,
1695
1604
  children: [
1696
- n ? /* @__PURE__ */ u("p", { role: "status", "data-part": "status", children: "Loading rows…" }) : null,
1697
- a === k.Error ? /* @__PURE__ */ w("div", { "data-part": "error", role: "alert", children: [
1698
- /* @__PURE__ */ u("span", { children: Ht(i, "Unable to load rows") }),
1699
- typeof ((p = this.dataSource) == null ? void 0 : p.retry) == "function" ? /* @__PURE__ */ u(
1605
+ n ? /* @__PURE__ */ u("p", { role: "status", children: "Loading rows…" }) : null,
1606
+ i === k.Error ? /* @__PURE__ */ w("div", { role: "alert", children: [
1607
+ /* @__PURE__ */ u("span", { children: zt(s, "Unable to load rows") }),
1608
+ typeof ((f = this.dataSource) == null ? void 0 : f.retry) == "function" ? /* @__PURE__ */ u(
1700
1609
  "button",
1701
1610
  {
1702
1611
  type: "button",
1703
1612
  onClick: () => {
1704
- var m, b;
1705
- return (b = (m = this.dataSource) == null ? void 0 : m.retry) == null ? void 0 : b.call(m, "table retry");
1613
+ var g, m;
1614
+ return (m = (g = this.dataSource) == null ? void 0 : g.retry) == null ? void 0 : m.call(g, "table retry");
1706
1615
  },
1707
1616
  children: "Retry"
1708
1617
  }
1709
1618
  ) : null
1710
1619
  ] }) : null,
1711
- /* @__PURE__ */ w("table", { "data-part": "table", "aria-busy": n ? "true" : null, children: [
1620
+ /* @__PURE__ */ w("table", { "aria-busy": n ? "true" : null, children: [
1712
1621
  this.props.caption == null ? null : /* @__PURE__ */ u("caption", { children: this.props.caption }),
1713
1622
  /* @__PURE__ */ u(
1714
- me,
1623
+ ge,
1715
1624
  {
1716
1625
  columns: this.columns,
1717
1626
  sortEmitter: this.sortEmitter,
@@ -1722,38 +1631,38 @@ class X extends g {
1722
1631
  },
1723
1632
  "header"
1724
1633
  ),
1725
- /* @__PURE__ */ u("tbody", { children: e.length > 0 ? e.map((m, b) => this.renderRow(m, b, o)) : n ? this.renderPlaceholders() : a === k.Error ? null : /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", { colSpan: this.columns.length, children: this.props.emptyMessage ?? "No rows" }) }, "empty") })
1634
+ /* @__PURE__ */ u("tbody", { children: e.length > 0 ? e.map((g, m) => this.renderRow(g, m, a)) : n ? this.renderPlaceholders() : i === k.Error ? null : /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", { colSpan: this.columns.length, children: this.props.emptyMessage ?? "No rows" }) }, "empty") })
1726
1635
  ] })
1727
1636
  ]
1728
1637
  }
1729
1638
  );
1730
1639
  }
1731
- renderRow(e, a, i) {
1732
- const n = this.rowKey(e, a), o = i.has(n);
1640
+ renderRow(e, i, s) {
1641
+ const n = this.rowKey(e, i), a = s.has(n);
1733
1642
  return /* @__PURE__ */ u(
1734
1643
  "tr",
1735
1644
  {
1736
1645
  "data-fray-selectable-row": "",
1737
- "data-index": a,
1738
- "aria-selected": String(o),
1739
- tabIndex: a === 0 ? 0 : -1,
1740
- children: this.columns.map((l) => /* @__PURE__ */ u("td", { children: l.render ? l.render(e, a) : Ft(e[l.field]) }, String(l.field)))
1646
+ "data-index": i,
1647
+ "aria-selected": String(a),
1648
+ tabIndex: i === 0 ? 0 : -1,
1649
+ children: this.columns.map((l) => /* @__PURE__ */ u("td", { children: l.render ? l.render(e, i) : Mt(e[l.field]) }, String(l.field)))
1741
1650
  },
1742
1651
  String(n)
1743
1652
  );
1744
1653
  }
1745
1654
  renderPlaceholders() {
1746
1655
  const e = this.props.placeholderCount ?? 5;
1747
- return Array.from({ length: e }, (a, i) => /* @__PURE__ */ u("tr", { children: this.columns.map((n, o) => /* @__PURE__ */ u("td", { children: /* @__PURE__ */ u(
1748
- H,
1656
+ return Array.from({ length: e }, (i, s) => /* @__PURE__ */ u("tr", { children: this.columns.map((n, a) => /* @__PURE__ */ u("td", { children: /* @__PURE__ */ u(
1657
+ M,
1749
1658
  {
1750
- width: 45 + (i + o) % 6 * 8
1659
+ width: 45 + (s + a) % 6 * 8
1751
1660
  }
1752
- ) }, String(n.field))) }, `placeholder-${i}`));
1661
+ ) }, String(n.field))) }, `placeholder-${s}`));
1753
1662
  }
1754
1663
  afterUpdate(e) {
1755
- const a = e instanceof Element ? e.querySelectorAll("tbody [data-fray-selectable-row]") : [];
1756
- this.selectionHandler.rowsUpdated(a);
1664
+ const i = e instanceof Element ? e.querySelectorAll("tbody [data-fray-selectable-row]") : [];
1665
+ this.selectionHandler.rowsUpdated(i);
1757
1666
  }
1758
1667
  getSelectedRows() {
1759
1668
  return this.selectionHandler.getSelectedItems();
@@ -1769,14 +1678,13 @@ class X extends g {
1769
1678
  return this.selectedItemEmitter;
1770
1679
  }
1771
1680
  onDestroy() {
1772
- var e, a, i;
1773
- this.selectionHandler.destroy(), (e = this.ownedDataSource) == null || e.dispose(), (a = this.ownedSortEmitter) == null || a.dispose(), (i = this.ownedFiltersEmitter) == null || i.dispose();
1681
+ var e, i, s;
1682
+ this.selectionHandler.destroy(), (e = this.ownedDataSource) == null || e.dispose(), (i = this.ownedSortEmitter) == null || i.dispose(), (s = this.ownedFiltersEmitter) == null || s.dispose();
1774
1683
  }
1775
1684
  }
1776
- s(X, "dependencies", [H, me]), s(X, "hostName", "data-table"), s(X, "standaloneHostName", "data-table"), s(X, "css", v`
1685
+ o(X, "dependencies", [M, ge]), o(X, "hostName", "data-table"), o(X, "standaloneHostName", "data-table"), o(X, "css", S`
1777
1686
  & {
1778
1687
  overflow: auto;
1779
- color: var(--ui-text-color);
1780
1688
  }
1781
1689
 
1782
1690
  & > table {
@@ -1784,7 +1692,7 @@ s(X, "dependencies", [H, me]), s(X, "hostName", "data-table"), s(X, "standaloneH
1784
1692
  border-collapse: collapse;
1785
1693
  }
1786
1694
 
1787
- & thead:has([data-fray-component="filter-panel"]) {
1695
+ & thead:has([aria-expanded="true"]) {
1788
1696
  position: relative;
1789
1697
  z-index: 1100;
1790
1698
  }
@@ -1800,52 +1708,27 @@ s(X, "dependencies", [H, me]), s(X, "hostName", "data-table"), s(X, "standaloneH
1800
1708
  user-select: none;
1801
1709
  }
1802
1710
 
1803
- & tbody tr:nth-child(odd) {
1804
- background: var(--fray-table-row-background, transparent);
1805
- }
1806
-
1807
- & tbody tr:nth-child(even) {
1808
- background: var(--fray-table-row-alt-background, transparent);
1809
- }
1810
-
1811
- & tbody tr[data-fray-selectable-row]:hover {
1812
- background: var(--fray-row-hover-background, var(--button-background-hover));
1813
- }
1814
-
1815
- & tbody tr[data-fray-selectable-row]:focus-visible {
1816
- outline: 2px solid var(--fray-color-focus, var(--ui-accent-color));
1817
- outline-offset: -2px;
1818
- }
1819
-
1820
- & tbody tr[data-fray-selectable-row][aria-selected="true"] {
1821
- color: var(--fray-selection-color, var(--toggle-selected-text));
1822
- background: var(--fray-selection-background, var(--toggle-selected-bg));
1823
- }
1824
-
1825
- & > [data-part="error"] {
1826
- color: var(--error-color);
1827
- }
1828
1711
  `);
1829
- function Kt(t) {
1712
+ function At(t) {
1830
1713
  if (!Array.isArray(t) || t.length === 0)
1831
1714
  throw new TypeError("DataTable columns must be a non-empty array");
1832
1715
  const r = /* @__PURE__ */ new Set();
1833
1716
  return t.map((e) => {
1834
1717
  if (e == null || typeof e != "object")
1835
1718
  throw new TypeError("Every DataTable column requires a field");
1836
- const a = Reflect.get(e, "field");
1837
- if (typeof a != "string" || a.length === 0)
1719
+ const i = Reflect.get(e, "field");
1720
+ if (typeof i != "string" || i.length === 0)
1838
1721
  throw new TypeError("Every DataTable column requires a field");
1839
- if (r.has(a)) throw new Error(`Duplicate DataTable column: ${a}`);
1840
- r.add(a);
1841
- const i = Reflect.get(e, "render");
1842
- if (i != null && typeof i != "function")
1843
- throw new TypeError(`DataTable column ${a} render must be a function`);
1722
+ if (r.has(i)) throw new Error(`Duplicate DataTable column: ${i}`);
1723
+ r.add(i);
1724
+ const s = Reflect.get(e, "render");
1725
+ if (s != null && typeof s != "function")
1726
+ throw new TypeError(`DataTable column ${i} render must be a function`);
1844
1727
  return e;
1845
1728
  });
1846
1729
  }
1847
- function At(t) {
1848
- var o, l;
1730
+ function Ft(t) {
1731
+ var a, l;
1849
1732
  const e = [
1850
1733
  "mode",
1851
1734
  "query",
@@ -1854,126 +1737,126 @@ function At(t) {
1854
1737
  "baseUrl",
1855
1738
  "fetch",
1856
1739
  "serializeQuery"
1857
- ].find((d) => Object.hasOwn(t, d));
1740
+ ].find((c) => Object.hasOwn(t, c));
1858
1741
  if (e != null)
1859
1742
  throw new TypeError(
1860
1743
  `DataTable ${e} moved to dataSource/rest; see the 0.3 migration guide`
1861
1744
  );
1862
- const a = t.data !== void 0, i = t.dataSource !== void 0, n = t.rest !== void 0;
1863
- if (Number(a) + Number(i) + Number(n) > 1)
1745
+ const i = t.data !== void 0, s = t.dataSource !== void 0, n = t.rest !== void 0;
1746
+ if (Number(i) + Number(s) + Number(n) > 1)
1864
1747
  throw new TypeError("DataTable accepts exactly one of data, dataSource, or rest");
1865
- if (i) {
1866
- const d = t.dataSource;
1867
- if (d == null || typeof d != "object" || d.query == null || typeof ((o = d.sortEmitter) == null ? void 0 : o.set) != "function" || typeof ((l = d.filtersEmitter) == null ? void 0 : l.set) != "function" || typeof d.dispose != "function")
1748
+ if (s) {
1749
+ const c = t.dataSource;
1750
+ if (c == null || typeof c != "object" || c.query == null || typeof ((a = c.sortEmitter) == null ? void 0 : a.set) != "function" || typeof ((l = c.filtersEmitter) == null ? void 0 : l.set) != "function" || typeof c.dispose != "function")
1868
1751
  throw new TypeError("DataTable dataSource must implement the table data-source contract");
1869
1752
  }
1870
1753
  }
1871
- function jt(t) {
1872
- if (t == null) return we;
1754
+ function Ht(t) {
1755
+ if (t == null) return Se;
1873
1756
  if (typeof t == "function") return t;
1874
1757
  if (typeof t == "string" && t.length > 0)
1875
1758
  return (r, e) => {
1876
- const a = r[t];
1877
- if (a == null)
1759
+ const i = r[t];
1760
+ if (i == null)
1878
1761
  throw new TypeError(`DataTable row at index ${e} lacks ${t}`);
1879
- return a;
1762
+ return i;
1880
1763
  };
1881
1764
  throw new TypeError("DataTable rowKey must be a function or property name");
1882
1765
  }
1883
- function Ft(t) {
1766
+ function Mt(t) {
1884
1767
  return t == null || typeof t == "string" || typeof t == "number" ? t : String(t);
1885
1768
  }
1886
- function Ht(t, r) {
1769
+ function zt(t, r) {
1887
1770
  return t instanceof Error ? t.message : t == null ? r : String(t);
1888
1771
  }
1889
- class We extends g {
1772
+ class Je extends y {
1890
1773
  render() {
1891
1774
  return this.props.children ?? [];
1892
1775
  }
1893
1776
  }
1894
- function P(t) {
1777
+ function B(t) {
1895
1778
  if (!Array.isArray(t)) throw new TypeError("Tree nodes must be an array");
1896
- const r = /* @__PURE__ */ new Set(), e = (a) => {
1897
- for (const i of a) {
1898
- if (i == null || typeof i != "object" || i.id == null)
1779
+ const r = /* @__PURE__ */ new Set(), e = (i) => {
1780
+ for (const s of i) {
1781
+ if (s == null || typeof s != "object" || s.id == null)
1899
1782
  throw new TypeError("Each tree node requires an id");
1900
- if (r.has(i.id)) throw new Error(`Duplicate tree item id: ${String(i.id)}`);
1901
- if (r.add(i.id), !Array.isArray(i.children ?? []))
1902
- throw new TypeError(`Tree node ${String(i.id)} children must be an array`);
1903
- e(i.children ?? []);
1783
+ if (r.has(s.id)) throw new Error(`Duplicate tree item id: ${String(s.id)}`);
1784
+ if (r.add(s.id), !Array.isArray(s.children ?? []))
1785
+ throw new TypeError(`Tree node ${String(s.id)} children must be an array`);
1786
+ e(s.children ?? []);
1904
1787
  }
1905
1788
  };
1906
1789
  e(t);
1907
1790
  }
1908
- function lr(t, r) {
1909
- return P(t), Se(t, r);
1791
+ function dr(t, r) {
1792
+ return B(t), xe(t, r);
1910
1793
  }
1911
- function dr(t, r, e = null) {
1912
- return new le(
1794
+ function ur(t, r, e = null) {
1795
+ return new ae(
1913
1796
  [t, r],
1914
- ([a, i]) => (P(a), i == null ? null : Se(a, i)),
1797
+ ([i, s]) => (B(i), s == null ? null : xe(i, s)),
1915
1798
  { owner: e, purpose: "tree node projection" }
1916
1799
  );
1917
1800
  }
1918
- function Mt(t, r, e) {
1919
- if (P(t), typeof e != "function") throw new TypeError("Tree node update must be a function");
1920
- const a = (n) => {
1921
- for (let o = 0; o < n.length; o += 1) {
1922
- const l = n[o];
1801
+ function qt(t, r, e) {
1802
+ if (B(t), typeof e != "function") throw new TypeError("Tree node update must be a function");
1803
+ const i = (n) => {
1804
+ for (let a = 0; a < n.length; a += 1) {
1805
+ const l = n[a];
1923
1806
  if (Object.is(l.id, r)) {
1924
- const f = e(l);
1925
- if (f == null || typeof f != "object")
1807
+ const p = e(l);
1808
+ if (p == null || typeof p != "object")
1926
1809
  throw new TypeError("Tree node update must return a tree node");
1927
- if (!Object.is(f.id, l.id))
1810
+ if (!Object.is(p.id, l.id))
1928
1811
  throw new Error("Tree node update cannot change the stable id");
1929
- if (Object.is(f, l)) return n;
1930
- const p = [...n];
1931
- return p[o] = f, p;
1932
- }
1933
- const d = l.children ?? [], h = a(d);
1934
- if (!Object.is(h, d)) {
1812
+ if (Object.is(p, l)) return n;
1935
1813
  const f = [...n];
1936
- return f[o] = { ...l, children: h }, f;
1814
+ return f[a] = p, f;
1815
+ }
1816
+ const c = l.children ?? [], h = i(c);
1817
+ if (!Object.is(h, c)) {
1818
+ const p = [...n];
1819
+ return p[a] = { ...l, children: h }, p;
1937
1820
  }
1938
1821
  }
1939
1822
  return n;
1940
- }, i = a(t);
1941
- return Object.is(i, t) || P(i), i;
1823
+ }, s = i(t);
1824
+ return Object.is(s, t) || B(s), s;
1942
1825
  }
1943
- function cr(t, r, e, a = "tree node updated") {
1944
- const i = t.get(), n = Mt(i, r, e);
1945
- return Object.is(n, i) ? !1 : t.set(n, a);
1826
+ function hr(t, r, e, i = "tree node updated") {
1827
+ const s = t.get(), n = qt(s, r, e);
1828
+ return Object.is(n, s) ? !1 : t.set(n, i);
1946
1829
  }
1947
- function Se(t, r) {
1830
+ function xe(t, r) {
1948
1831
  for (const e of t) {
1949
1832
  if (Object.is(e.id, r)) return e;
1950
- const a = Se(e.children ?? [], r);
1951
- if (a != null) return a;
1833
+ const i = xe(e.children ?? [], r);
1834
+ if (i != null) return i;
1952
1835
  }
1953
1836
  return null;
1954
1837
  }
1955
- class Z extends g {
1838
+ class Z extends y {
1956
1839
  constructor(e) {
1957
1840
  super(e);
1958
- s(this, "nodesEmitter");
1959
- s(this, "selectedKeyEmitter");
1960
- s(this, "expandedKeysEmitter");
1961
- s(this, "ownedNodesEmitter");
1962
- s(this, "ownedSelectedEmitter");
1963
- s(this, "ownedExpandedEmitter");
1964
- s(this, "focusedKey", null);
1965
- s(this, "typeahead", "");
1966
- s(this, "typeaheadTimer", null);
1967
- if (Vt(e.nodes))
1841
+ o(this, "nodesEmitter");
1842
+ o(this, "selectedKeyEmitter");
1843
+ o(this, "expandedKeysEmitter");
1844
+ o(this, "ownedNodesEmitter");
1845
+ o(this, "ownedSelectedEmitter");
1846
+ o(this, "ownedExpandedEmitter");
1847
+ o(this, "focusedKey", null);
1848
+ o(this, "typeahead", "");
1849
+ o(this, "typeaheadTimer", null);
1850
+ if (Pt(e.nodes))
1968
1851
  this.nodesEmitter = e.nodes, this.ownedNodesEmitter = null;
1969
1852
  else {
1970
- const a = e.nodes ?? Je(e.children);
1971
- this.ownedNodesEmitter = new I(a, {
1853
+ const i = e.nodes ?? _e(e.children);
1854
+ this.ownedNodesEmitter = new x(i, {
1972
1855
  owner: this,
1973
1856
  purpose: "tree nodes"
1974
1857
  }), this.nodesEmitter = this.ownedNodesEmitter;
1975
1858
  }
1976
- this.ownedSelectedEmitter = e.selectedKeyEmitter == null ? new I(null, { owner: this, purpose: "selected tree key" }) : null, this.selectedKeyEmitter = e.selectedKeyEmitter ?? this.ownedSelectedEmitter, this.ownedExpandedEmitter = e.expandedKeysEmitter == null ? new I([], { owner: this, purpose: "expanded tree keys" }) : null, this.expandedKeysEmitter = e.expandedKeysEmitter ?? this.ownedExpandedEmitter;
1859
+ this.ownedSelectedEmitter = e.selectedKeyEmitter == null ? new x(null, { owner: this, purpose: "selected tree key" }) : null, this.selectedKeyEmitter = e.selectedKeyEmitter ?? this.ownedSelectedEmitter, this.ownedExpandedEmitter = e.expandedKeysEmitter == null ? new x([], { owner: this, purpose: "expanded tree keys" }) : null, this.expandedKeysEmitter = e.expandedKeysEmitter ?? this.ownedExpandedEmitter;
1977
1860
  }
1978
1861
  initialize() {
1979
1862
  this.reconcile(this.nodesEmitter.get()), this.watch(this.nodesEmitter, this.selectedKeyEmitter, this.expandedKeysEmitter), this.onCleanup(this.nodesEmitter.subscribe(({ value: e }) => this.reconcile(e), {
@@ -1982,124 +1865,123 @@ class Z extends g {
1982
1865
  }
1983
1866
  render() {
1984
1867
  const e = this.nodesEmitter.get();
1985
- P(e);
1986
- const a = new Set(this.expandedKeysEmitter.get()), i = De(e, a), n = this.selectedKeyEmitter.get(), o = i.find(({ node: d }) => Object.is(d.id, this.focusedKey)) ?? i.find(({ node: d }) => Object.is(d.id, n)) ?? i[0] ?? null;
1987
- this.focusedKey = (o == null ? void 0 : o.node.id) ?? null;
1868
+ B(e);
1869
+ const i = new Set(this.expandedKeysEmitter.get()), s = De(e, i), n = this.selectedKeyEmitter.get(), a = s.find(({ node: c }) => Object.is(c.id, this.focusedKey)) ?? s.find(({ node: c }) => Object.is(c.id, n)) ?? s[0] ?? null;
1870
+ this.focusedKey = (a == null ? void 0 : a.node.id) ?? null;
1988
1871
  const l = this.Host;
1989
- return /* @__PURE__ */ u(l, { className: E(this.props) || null, children: i.length === 0 ? /* @__PURE__ */ u("p", { role: "status", "data-part": "empty", children: "No tree items" }) : /* @__PURE__ */ u("div", { role: "tree", "aria-label": this.props.label, "data-part": "tree", children: i.map((d, h) => {
1990
- var K, A, F;
1991
- const { node: f, depth: p, position: m, setSize: b } = d, S = (((K = f.children) == null ? void 0 : K.length) ?? 0) > 0, x = S && a.has(f.id), O = Object.is(f.id, n), $ = ((F = (A = this.props).renderItem) == null ? void 0 : F.call(A, f, p)) ?? f.label;
1872
+ return /* @__PURE__ */ u(l, { className: R("datacomponentlike", E(this.props)), children: s.length === 0 ? /* @__PURE__ */ u("p", { role: "status", children: "No tree items" }) : /* @__PURE__ */ u("div", { role: "tree", "aria-label": this.props.label, children: s.map((c, h) => {
1873
+ var j, A, H;
1874
+ const { node: p, depth: f, position: g, setSize: m } = c, I = (((j = p.children) == null ? void 0 : j.length) ?? 0) > 0, v = I && i.has(p.id), O = Object.is(p.id, n), C = ((H = (A = this.props).renderItem) == null ? void 0 : H.call(A, p, f)) ?? p.label;
1992
1875
  return /* @__PURE__ */ w(
1993
1876
  "div",
1994
1877
  {
1995
1878
  role: "treeitem",
1996
- "data-part": "item",
1997
1879
  "data-index": h,
1998
- "data-depth": p,
1999
- "aria-level": p + 1,
2000
- "aria-posinset": m,
2001
- "aria-setsize": b,
2002
- "aria-expanded": S ? String(x) : null,
1880
+ "data-depth": f,
1881
+ "aria-level": f + 1,
1882
+ "aria-posinset": g,
1883
+ "aria-setsize": m,
1884
+ "aria-expanded": I ? String(v) : null,
2003
1885
  "aria-selected": String(O),
2004
- tabIndex: Object.is(f.id, o == null ? void 0 : o.node.id) ? 0 : -1,
2005
- style: { "--tree-depth": p },
1886
+ tabIndex: Object.is(p.id, a == null ? void 0 : a.node.id) ? 0 : -1,
1887
+ style: { "--tree-depth": f },
2006
1888
  onClick: (T) => {
2007
- if (this.focusedKey = f.id, Ut(T.target) && S) {
2008
- this.toggleExpanded(f.id), this.focusRow(f.id);
1889
+ if (this.focusedKey = p.id, Bt(T.target) && I) {
1890
+ this.toggleExpanded(p.id), this.focusRow(p.id);
2009
1891
  return;
2010
1892
  }
2011
- this.selectNode(f, T);
1893
+ this.selectNode(p, T);
2012
1894
  },
2013
- onFocus: () => this.focusedKey = f.id,
2014
- onKeyDown: (T) => this.handleKeyDown(T, h, i),
1895
+ onFocus: () => this.focusedKey = p.id,
1896
+ onKeyDown: (T) => this.handleKeyDown(T, h, s),
2015
1897
  children: [
2016
1898
  /* @__PURE__ */ u(
2017
1899
  "span",
2018
1900
  {
2019
1901
  "data-part": "expander",
2020
- "data-expandable": S ? "" : null,
1902
+ "data-expandable": I ? "" : null,
2021
1903
  "aria-hidden": "true",
2022
- children: S ? x ? "▾" : "▸" : "•"
1904
+ children: I ? v ? "▾" : "▸" : "•"
2023
1905
  }
2024
1906
  ),
2025
- /* @__PURE__ */ u("span", { "data-part": "label", children: $ })
1907
+ /* @__PURE__ */ u("span", { "data-part": "label", children: C })
2026
1908
  ]
2027
1909
  },
2028
- f.id
1910
+ p.id
2029
1911
  );
2030
1912
  }) }) });
2031
1913
  }
2032
1914
  onDestroy() {
2033
- var e, a, i;
2034
- this.typeaheadTimer != null && clearTimeout(this.typeaheadTimer), (e = this.ownedNodesEmitter) == null || e.dispose(), (a = this.ownedSelectedEmitter) == null || a.dispose(), (i = this.ownedExpandedEmitter) == null || i.dispose();
1915
+ var e, i, s;
1916
+ this.typeaheadTimer != null && clearTimeout(this.typeaheadTimer), (e = this.ownedNodesEmitter) == null || e.dispose(), (i = this.ownedSelectedEmitter) == null || i.dispose(), (s = this.ownedExpandedEmitter) == null || s.dispose();
2035
1917
  }
2036
1918
  reconcile(e) {
2037
- P(e);
2038
- const a = new Set(zt(e).map(({ node: l }) => l.id)), i = this.selectedKeyEmitter.get();
2039
- this.ownedSelectedEmitter != null && i != null && !a.has(i) && this.selectedKeyEmitter.set(null, "selected tree item removed");
2040
- const n = this.expandedKeysEmitter.get(), o = n.filter((l) => a.has(l));
2041
- this.ownedExpandedEmitter != null && !Lt(n, o) && this.expandedKeysEmitter.set(o, "removed tree expansions reconciled"), this.focusedKey != null && !a.has(this.focusedKey) && (this.focusedKey = null);
1919
+ B(e);
1920
+ const i = new Set(Lt(e).map(({ node: l }) => l.id)), s = this.selectedKeyEmitter.get();
1921
+ this.ownedSelectedEmitter != null && s != null && !i.has(s) && this.selectedKeyEmitter.set(null, "selected tree item removed");
1922
+ const n = this.expandedKeysEmitter.get(), a = n.filter((l) => i.has(l));
1923
+ this.ownedExpandedEmitter != null && !Ut(n, a) && this.expandedKeysEmitter.set(a, "removed tree expansions reconciled"), this.focusedKey != null && !i.has(this.focusedKey) && (this.focusedKey = null);
2042
1924
  }
2043
- selectNode(e, a) {
2044
- this.selectedKeyEmitter.set(e.id, "tree item selected"), C(this.props.onSelect, e, a), this.focusRow(e.id);
1925
+ selectNode(e, i) {
1926
+ this.selectedKeyEmitter.set(e.id, "tree item selected"), K(this.props.onSelect, e, i), this.focusRow(e.id);
2045
1927
  }
2046
1928
  toggleExpanded(e) {
2047
- const a = this.expandedKeysEmitter.get(), i = a.some((n) => Object.is(n, e));
1929
+ const i = this.expandedKeysEmitter.get(), s = i.some((n) => Object.is(n, e));
2048
1930
  this.expandedKeysEmitter.set(
2049
- i ? a.filter((n) => !Object.is(n, e)) : [...a, e],
2050
- i ? "tree item collapsed" : "tree item expanded"
1931
+ s ? i.filter((n) => !Object.is(n, e)) : [...i, e],
1932
+ s ? "tree item collapsed" : "tree item expanded"
2051
1933
  );
2052
1934
  }
2053
- handleKeyDown(e, a, i) {
2054
- var o, l, d, h;
2055
- const n = i[a];
1935
+ handleKeyDown(e, i, s) {
1936
+ var a, l, c, h;
1937
+ const n = s[i];
2056
1938
  if (n != null) {
2057
- if (e.key === "ArrowDown") return this.move(e, (o = i[a + 1]) == null ? void 0 : o.node.id);
2058
- if (e.key === "ArrowUp") return this.move(e, (l = i[a - 1]) == null ? void 0 : l.node.id);
2059
- if (e.key === "Home") return this.move(e, (d = i[0]) == null ? void 0 : d.node.id);
2060
- if (e.key === "End") return this.move(e, (h = i.at(-1)) == null ? void 0 : h.node.id);
1939
+ if (e.key === "ArrowDown") return this.move(e, (a = s[i + 1]) == null ? void 0 : a.node.id);
1940
+ if (e.key === "ArrowUp") return this.move(e, (l = s[i - 1]) == null ? void 0 : l.node.id);
1941
+ if (e.key === "Home") return this.move(e, (c = s[0]) == null ? void 0 : c.node.id);
1942
+ if (e.key === "End") return this.move(e, (h = s.at(-1)) == null ? void 0 : h.node.id);
2061
1943
  if (e.key === "ArrowRight") {
2062
1944
  e.preventDefault();
2063
- const f = n.node.children ?? [];
2064
- if (f.length === 0) return;
2065
- this.expandedKeysEmitter.get().some((m) => Object.is(m, n.node.id)) ? this.focusRow(f[0].id) : this.toggleExpanded(n.node.id);
1945
+ const p = n.node.children ?? [];
1946
+ if (p.length === 0) return;
1947
+ this.expandedKeysEmitter.get().some((g) => Object.is(g, n.node.id)) ? this.focusRow(p[0].id) : this.toggleExpanded(n.node.id);
2066
1948
  return;
2067
1949
  }
2068
1950
  if (e.key === "ArrowLeft") {
2069
- e.preventDefault(), this.expandedKeysEmitter.get().some((p) => Object.is(p, n.node.id)) ? this.toggleExpanded(n.node.id) : n.parentId != null && this.focusRow(n.parentId);
1951
+ e.preventDefault(), this.expandedKeysEmitter.get().some((f) => Object.is(f, n.node.id)) ? this.toggleExpanded(n.node.id) : n.parentId != null && this.focusRow(n.parentId);
2070
1952
  return;
2071
1953
  }
2072
1954
  if (e.key === "Enter" || e.key === " ") {
2073
1955
  e.preventDefault(), this.selectNode(n.node, e);
2074
1956
  return;
2075
1957
  }
2076
- e.key.length === 1 && !e.altKey && !e.ctrlKey && !e.metaKey && this.handleTypeahead(e, i, a);
1958
+ e.key.length === 1 && !e.altKey && !e.ctrlKey && !e.metaKey && this.handleTypeahead(e, s, i);
2077
1959
  }
2078
1960
  }
2079
- move(e, a) {
2080
- a !== void 0 && (e.preventDefault(), this.focusRow(a));
1961
+ move(e, i) {
1962
+ i !== void 0 && (e.preventDefault(), this.focusRow(i));
2081
1963
  }
2082
1964
  focusRow(e) {
2083
- var i;
1965
+ var s;
2084
1966
  this.focusedKey = e;
2085
- const a = this.dom instanceof Element ? [...this.dom.querySelectorAll('[role="treeitem"]')] : [];
2086
- for (const n of a) {
2087
- const o = Number(n.dataset.index), l = De(
1967
+ const i = this.dom instanceof Element ? [...this.dom.querySelectorAll('[role="treeitem"]')] : [];
1968
+ for (const n of i) {
1969
+ const a = Number(n.dataset.index), l = De(
2088
1970
  this.nodesEmitter.get(),
2089
1971
  new Set(this.expandedKeysEmitter.get())
2090
- ), d = Object.is((i = l[o]) == null ? void 0 : i.node.id, e);
2091
- n.tabIndex = d ? 0 : -1, d && n.focus();
1972
+ ), c = Object.is((s = l[a]) == null ? void 0 : s.node.id, e);
1973
+ n.tabIndex = c ? 0 : -1, c && n.focus();
2092
1974
  }
2093
1975
  }
2094
- handleTypeahead(e, a, i) {
1976
+ handleTypeahead(e, i, s) {
2095
1977
  e.preventDefault(), this.typeaheadTimer != null && clearTimeout(this.typeaheadTimer), this.typeahead += e.key.toLocaleLowerCase(), this.typeaheadTimer = setTimeout(() => {
2096
1978
  this.typeahead = "", this.typeaheadTimer = null;
2097
1979
  }, 650);
2098
- const o = [...a.slice(i + 1), ...a.slice(0, i + 1)].find(({ node: l }) => qt(l).toLocaleLowerCase().startsWith(this.typeahead));
2099
- o != null && this.focusRow(o.node.id);
1980
+ const a = [...i.slice(s + 1), ...i.slice(0, s + 1)].find(({ node: l }) => Vt(l).toLocaleLowerCase().startsWith(this.typeahead));
1981
+ a != null && this.focusRow(a.node.id);
2100
1982
  }
2101
1983
  }
2102
- s(Z, "dependencies", [We]), s(Z, "hostName", "tree-view"), s(Z, "standaloneHostName", "tree-view"), s(Z, "css", v`
1984
+ o(Z, "dependencies", [Je]), o(Z, "hostName", "tree-view"), o(Z, "standaloneHostName", "tree-view"), o(Z, "css", S`
2103
1985
  & {
2104
1986
  display: flex;
2105
1987
  flex-direction: column;
@@ -2108,12 +1990,12 @@ s(Z, "dependencies", [We]), s(Z, "hostName", "tree-view"), s(Z, "standaloneHostN
2108
1990
  overflow: auto;
2109
1991
  }
2110
1992
 
2111
- & > [data-part="tree"] {
1993
+ & > [role="tree"] {
2112
1994
  display: grid;
2113
1995
  align-content: start;
2114
1996
  }
2115
1997
 
2116
- & [data-part="item"] {
1998
+ & [role="treeitem"] {
2117
1999
  display: flex;
2118
2000
  align-items: flex-start;
2119
2001
  gap: 0.35rem;
@@ -2124,20 +2006,6 @@ s(Z, "dependencies", [We]), s(Z, "hostName", "tree-view"), s(Z, "standaloneHostN
2124
2006
  user-select: none;
2125
2007
  }
2126
2008
 
2127
- & [data-part="item"]:hover {
2128
- background: var(--button-background-hover);
2129
- }
2130
-
2131
- & [data-part="item"]:focus-visible {
2132
- outline: 2px solid var(--ui-accent-color);
2133
- outline-offset: -2px;
2134
- }
2135
-
2136
- & [data-part="item"][aria-selected="true"] {
2137
- color: var(--toggle-selected-text);
2138
- background: var(--toggle-selected-bg);
2139
- }
2140
-
2141
2009
  & [data-part="expander"] {
2142
2010
  flex: 0 0 1rem;
2143
2011
  text-align: center;
@@ -2152,62 +2020,62 @@ s(Z, "dependencies", [We]), s(Z, "hostName", "tree-view"), s(Z, "standaloneHostN
2152
2020
  overflow-wrap: anywhere;
2153
2021
  }
2154
2022
 
2155
- & > [data-part="empty"] {
2023
+ & > [role="status"] {
2156
2024
  margin: 0;
2157
2025
  padding: var(--ui-padding, 0.75rem);
2158
2026
  }
2159
2027
 
2160
2028
  @media (forced-colors: active) {
2161
- & [data-part="item"][aria-selected="true"] {
2029
+ & [role="treeitem"][aria-selected="true"] {
2162
2030
  outline: 2px solid Highlight;
2163
2031
  forced-color-adjust: auto;
2164
2032
  }
2165
2033
  }
2166
2034
  `);
2167
- function Je(t) {
2168
- return (Array.isArray(t) ? t : t == null ? [] : [t]).filter((e) => ie(e) && e.type === We).map((e) => {
2035
+ function _e(t) {
2036
+ return (Array.isArray(t) ? t : t == null ? [] : [t]).filter((e) => ie(e) && e.type === Je).map((e) => {
2169
2037
  if (!ie(e)) throw new TypeError("TreeView children must be TreeItem nodes");
2170
- const a = e.props;
2038
+ const i = e.props;
2171
2039
  return {
2172
- id: a.id,
2173
- label: a.label,
2174
- ...a.textValue == null ? {} : { textValue: a.textValue },
2175
- ...a.value === void 0 ? {} : { value: a.value },
2176
- children: Je(a.children)
2040
+ id: i.id,
2041
+ label: i.label,
2042
+ ...i.textValue == null ? {} : { textValue: i.textValue },
2043
+ ...i.value === void 0 ? {} : { value: i.value },
2044
+ children: _e(i.children)
2177
2045
  };
2178
2046
  });
2179
2047
  }
2180
2048
  function De(t, r) {
2181
- const e = [], a = (i, n, o) => {
2182
- i.forEach((l, d) => {
2049
+ const e = [], i = (s, n, a) => {
2050
+ s.forEach((l, c) => {
2183
2051
  var h;
2184
- e.push({ node: l, depth: n, parentId: o, position: d + 1, setSize: i.length }), (((h = l.children) == null ? void 0 : h.length) ?? 0) > 0 && r.has(l.id) && a(l.children ?? [], n + 1, l.id);
2052
+ e.push({ node: l, depth: n, parentId: a, position: c + 1, setSize: s.length }), (((h = l.children) == null ? void 0 : h.length) ?? 0) > 0 && r.has(l.id) && i(l.children ?? [], n + 1, l.id);
2185
2053
  });
2186
2054
  };
2187
- return a(t, 0, null), e;
2055
+ return i(t, 0, null), e;
2188
2056
  }
2189
- function zt(t) {
2190
- const r = /* @__PURE__ */ new Set(), e = [], a = (i, n, o) => {
2191
- i.forEach((l, d) => {
2057
+ function Lt(t) {
2058
+ const r = /* @__PURE__ */ new Set(), e = [], i = (s, n, a) => {
2059
+ s.forEach((l, c) => {
2192
2060
  if (r.has(l.id)) throw new Error(`Duplicate tree item id: ${String(l.id)}`);
2193
- r.add(l.id), e.push({ node: l, depth: n, parentId: o, position: d + 1, setSize: i.length }), a(l.children ?? [], n + 1, l.id);
2061
+ r.add(l.id), e.push({ node: l, depth: n, parentId: a, position: c + 1, setSize: s.length }), i(l.children ?? [], n + 1, l.id);
2194
2062
  });
2195
2063
  };
2196
- return a(t, 0, null), e;
2064
+ return i(t, 0, null), e;
2197
2065
  }
2198
- function qt(t) {
2066
+ function Vt(t) {
2199
2067
  return t.textValue != null ? t.textValue : typeof t.label == "string" || typeof t.label == "number" ? String(t.label) : String(t.id);
2200
2068
  }
2201
- function Lt(t, r) {
2202
- return t.length === r.length && t.every((e, a) => Object.is(e, r[a]));
2069
+ function Ut(t, r) {
2070
+ return t.length === r.length && t.every((e, i) => Object.is(e, r[i]));
2203
2071
  }
2204
- function Vt(t) {
2072
+ function Pt(t) {
2205
2073
  return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
2206
2074
  }
2207
- function Ut(t) {
2075
+ function Bt(t) {
2208
2076
  return t instanceof Element && t.closest('[data-part="expander"]') != null;
2209
2077
  }
2210
- class se extends g {
2078
+ class ne extends y {
2211
2079
  constructor(r = {}) {
2212
2080
  if (super(r), r.onClick != null && typeof r.onClick != "function")
2213
2081
  throw new TypeError("Button onClick must be a function");
@@ -2216,58 +2084,58 @@ class se extends g {
2216
2084
  const {
2217
2085
  children: r = [],
2218
2086
  label: e,
2219
- type: a = "button",
2220
- disabled: i = !1,
2087
+ type: i = "button",
2088
+ disabled: s = !1,
2221
2089
  pressed: n,
2222
- busy: o = !1,
2090
+ busy: a = !1,
2223
2091
  busyLabel: l,
2224
- id: d,
2092
+ id: c,
2225
2093
  name: h,
2226
- value: f,
2227
- title: p,
2228
- ariaLabel: m,
2229
- onClick: b
2230
- } = this.props, x = (Array.isArray(r) ? r.length > 0 : r != null && typeof r != "boolean") ? r : e ?? "", O = o ? l ?? x : x, $ = i || o;
2094
+ value: p,
2095
+ title: f,
2096
+ ariaLabel: g,
2097
+ onClick: m
2098
+ } = this.props, v = (Array.isArray(r) ? r.length > 0 : r != null && typeof r != "boolean") ? r : e ?? "", O = a ? l ?? v : v, C = s || a;
2231
2099
  return /* @__PURE__ */ u(
2232
2100
  "button",
2233
2101
  {
2234
- id: d,
2102
+ id: c,
2235
2103
  name: h,
2236
- value: f == null ? void 0 : String(f),
2237
- title: p,
2238
- type: a,
2239
- disabled: $,
2104
+ value: p == null ? void 0 : String(p),
2105
+ title: f,
2106
+ type: i,
2107
+ disabled: C,
2240
2108
  className: E(this.props) || void 0,
2241
2109
  "data-fray-component": "button",
2242
- "aria-label": m,
2110
+ "aria-label": g,
2243
2111
  "aria-pressed": n == null ? null : String(!!n),
2244
- "aria-busy": o ? "true" : null,
2245
- onClick: (K) => {
2246
- $ || C(b, K);
2112
+ "aria-busy": a ? "true" : null,
2113
+ onClick: (j) => {
2114
+ C || K(m, j);
2247
2115
  },
2248
2116
  children: O
2249
2117
  }
2250
2118
  );
2251
2119
  }
2252
2120
  }
2253
- s(se, "baseStyles", [
2254
- ['button[data-fray-component="button"]', ["uiline", "button"]]
2255
- ]), s(se, "css", v`
2256
- button[data-fray-component="button"] {
2121
+ o(ne, "baseStyles", [
2122
+ ["button", ["uiline", "button"]]
2123
+ ]), o(ne, "css", S`
2124
+ button {
2257
2125
  font-family: inherit;
2258
2126
  }
2259
2127
  `);
2260
- class Oe extends g {
2128
+ class Oe extends y {
2261
2129
  constructor(e) {
2262
2130
  super(e);
2263
- s(this, "openEmitter");
2264
- s(this, "dialogId");
2265
- s(this, "titleId");
2266
- s(this, "descriptionId");
2267
- s(this, "dialogElement", null);
2268
- s(this, "restoreFocusTo", null);
2269
- s(this, "synchronizedOpen", !1);
2270
- this.openEmitter = M(this, e, !1, "dialog open state"), this.dialogId = j("dialog", e.id), this.titleId = `${this.dialogId}-title`, this.descriptionId = `${this.dialogId}-description`;
2131
+ o(this, "openEmitter");
2132
+ o(this, "dialogId");
2133
+ o(this, "titleId");
2134
+ o(this, "descriptionId");
2135
+ o(this, "dialogElement", null);
2136
+ o(this, "restoreFocusTo", null);
2137
+ o(this, "synchronizedOpen", !1);
2138
+ this.openEmitter = z(this, e, !1, "dialog open state"), this.dialogId = F("dialog", e.id), this.titleId = `${this.dialogId}-title`, this.descriptionId = `${this.dialogId}-description`;
2271
2139
  }
2272
2140
  initialize() {
2273
2141
  this.watch(this.openEmitter);
@@ -2275,10 +2143,10 @@ class Oe extends g {
2275
2143
  render() {
2276
2144
  const {
2277
2145
  title: e,
2278
- description: a,
2279
- actions: i,
2146
+ description: i,
2147
+ actions: s,
2280
2148
  closeLabel: n = "Close",
2281
- showCloseButton: o = !0,
2149
+ showCloseButton: a = !0,
2282
2150
  children: l = []
2283
2151
  } = this.props;
2284
2152
  return /* @__PURE__ */ w(
@@ -2288,17 +2156,17 @@ class Oe extends g {
2288
2156
  className: E(this.props) || void 0,
2289
2157
  "data-fray-component": "dialog",
2290
2158
  "aria-labelledby": this.titleId,
2291
- "aria-describedby": a == null ? null : this.descriptionId,
2159
+ "aria-describedby": i == null ? null : this.descriptionId,
2292
2160
  "aria-modal": "true",
2293
- ref: (d) => this.dialogElement = d,
2161
+ ref: (c) => this.dialogElement = c,
2294
2162
  children: [
2295
- /* @__PURE__ */ u("header", { "data-part": "header", children: /* @__PURE__ */ u("h2", { id: this.titleId, children: e }) }),
2296
- a == null ? null : /* @__PURE__ */ u("p", { id: this.descriptionId, "data-part": "description", children: a }),
2163
+ /* @__PURE__ */ u("header", { children: /* @__PURE__ */ u("h2", { id: this.titleId, children: e }) }),
2164
+ i == null ? null : /* @__PURE__ */ u("p", { id: this.descriptionId, children: i }),
2297
2165
  /* @__PURE__ */ u("div", { "data-part": "content", children: l }),
2298
- i == null && !o ? null : /* @__PURE__ */ w("footer", { "data-part": "actions", children: [
2299
- i,
2300
- o ? /* @__PURE__ */ u(
2301
- se,
2166
+ s == null && !a ? null : /* @__PURE__ */ w("footer", { children: [
2167
+ s,
2168
+ a ? /* @__PURE__ */ u(
2169
+ ne,
2302
2170
  {
2303
2171
  label: n,
2304
2172
  onClick: () => this.requestClose()
@@ -2311,8 +2179,8 @@ class Oe extends g {
2311
2179
  }
2312
2180
  afterMount() {
2313
2181
  const e = this.dialogElement;
2314
- e != null && (this.listen(e, "cancel", (a) => {
2315
- a.preventDefault(), this.requestClose();
2182
+ e != null && (this.listen(e, "cancel", (i) => {
2183
+ i.preventDefault(), this.requestClose();
2316
2184
  }), this.listen(e, "close", () => {
2317
2185
  this.openEmitter.get() && this.openEmitter.set(!1, "native dialog closed"), this.finishClose();
2318
2186
  }), this.syncOpenState());
@@ -2333,91 +2201,57 @@ class Oe extends g {
2333
2201
  syncOpenState() {
2334
2202
  const e = this.dialogElement;
2335
2203
  if (e == null) return;
2336
- const a = this.openEmitter.get();
2337
- if (a && !this.synchronizedOpen) {
2338
- const i = document.activeElement;
2339
- this.restoreFocusTo = i instanceof HTMLElement ? i : null, Pt(e), this.synchronizedOpen = !0, Bt(e, this.props.initialFocusRef);
2204
+ const i = this.openEmitter.get();
2205
+ if (i && !this.synchronizedOpen) {
2206
+ const s = document.activeElement;
2207
+ this.restoreFocusTo = s instanceof HTMLElement ? s : null, Gt(e), this.synchronizedOpen = !0, Qt(e, this.props.initialFocusRef);
2340
2208
  return;
2341
2209
  }
2342
- !a && this.synchronizedOpen && (e.open && typeof e.close == "function" ? e.close() : e.removeAttribute("open"), this.finishClose());
2210
+ !i && this.synchronizedOpen && (e.open && typeof e.close == "function" ? e.close() : e.removeAttribute("open"), this.finishClose());
2343
2211
  }
2344
2212
  finishClose() {
2345
2213
  if (!this.synchronizedOpen && this.restoreFocusTo == null) return;
2346
2214
  this.synchronizedOpen = !1;
2347
2215
  const e = this.restoreFocusTo;
2348
- this.restoreFocusTo = null, (e == null ? void 0 : e.isConnected) === !0 && e.focus(), C(this.props.onClose);
2216
+ this.restoreFocusTo = null, (e == null ? void 0 : e.isConnected) === !0 && e.focus(), K(this.props.onClose);
2349
2217
  }
2350
2218
  }
2351
- s(Oe, "dependencies", [se]), s(Oe, "css", v`
2352
- dialog[data-fray-component="dialog"] {
2219
+ o(Oe, "dependencies", [ne]), o(Oe, "css", S`
2220
+ dialog {
2353
2221
  width: min(38rem, calc(100vw - 2rem));
2354
2222
  max-height: min(42rem, calc(100dvh - 2rem));
2355
2223
  padding: 0;
2356
- color: var(--fray-panel-color, var(--ui-text-color));
2357
- background: var(--fray-panel-background, var(--panel-bg));
2358
- border: var(--fray-panel-border, var(--panel-border));
2359
- border-radius: var(--fray-panel-radius, var(--panel-radius));
2360
- box-shadow: var(--fray-dialog-shadow, var(--fray-panel-shadow));
2361
2224
  }
2362
2225
 
2363
- dialog[data-fray-component="dialog"]::backdrop {
2364
- background: var(--fray-dialog-backdrop-background);
2365
- }
2366
-
2367
- dialog[data-fray-component="dialog"] > [data-part] {
2226
+ dialog > header,
2227
+ dialog > p,
2228
+ dialog > [data-part="content"],
2229
+ dialog > footer {
2368
2230
  padding: var(--panel-padding, 0.75rem);
2369
2231
  }
2370
2232
 
2371
- dialog[data-fray-component="dialog"] > [data-part="header"] {
2372
- color: var(
2373
- --fray-dialog-header-color,
2374
- var(--fray-section-header-color, var(--fray-header-color))
2375
- );
2376
- background: var(
2377
- --fray-dialog-header-background,
2378
- var(--fray-section-header-background, var(--fray-header-background))
2379
- );
2380
- border-block-end: var(
2381
- --fray-section-header-border,
2382
- var(--fray-header-border)
2383
- );
2384
- }
2385
-
2386
- dialog[data-fray-component="dialog"] > [data-part="header"] h2,
2387
- dialog[data-fray-component="dialog"] > [data-part="description"] {
2233
+ dialog > header h2,
2234
+ dialog > p {
2388
2235
  margin: 0;
2389
2236
  }
2390
2237
 
2391
- dialog[data-fray-component="dialog"] > [data-part="content"] {
2238
+ dialog > [data-part="content"] {
2392
2239
  overflow: auto;
2393
2240
  }
2394
2241
 
2395
- dialog[data-fray-component="dialog"] > [data-part="actions"] {
2242
+ dialog > footer {
2396
2243
  display: flex;
2397
2244
  justify-content: flex-end;
2398
2245
  gap: var(--spacing-small, 0.5rem);
2399
- border-block-start: 1px solid var(--ui-border-color);
2400
- }
2401
-
2402
- @media (prefers-reduced-motion: no-preference) {
2403
- dialog[data-fray-component="dialog"][open] {
2404
- animation: fray-dialog-enter 120ms ease-out;
2405
- }
2406
- }
2407
-
2408
- @keyframes fray-dialog-enter {
2409
- from {
2410
- transform: translateY(0.4rem);
2411
- }
2412
2246
  }
2413
2247
 
2414
2248
  @media (forced-colors: active) {
2415
- dialog[data-fray-component="dialog"] {
2249
+ dialog {
2416
2250
  border: 2px solid CanvasText;
2417
2251
  }
2418
2252
  }
2419
2253
  `);
2420
- function Pt(t) {
2254
+ function Gt(t) {
2421
2255
  if (!t.open) {
2422
2256
  if (typeof t.showModal == "function") {
2423
2257
  t.showModal();
@@ -2426,52 +2260,52 @@ function Pt(t) {
2426
2260
  t.setAttribute("open", "");
2427
2261
  }
2428
2262
  }
2429
- function Bt(t, r) {
2430
- const a = (r == null || typeof r == "function" ? null : r.current) ?? t.querySelector(
2263
+ function Qt(t, r) {
2264
+ const i = (r == null || typeof r == "function" ? null : r.current) ?? t.querySelector(
2431
2265
  '[autofocus], button, input, select, textarea, [tabindex]:not([tabindex="-1"])'
2432
2266
  );
2433
- a == null || a.focus();
2267
+ i == null || i.focus();
2434
2268
  }
2435
- const z = class z extends D {
2436
- constructor(r = {}) {
2437
- super({ ...r, symbols: z.symbols });
2438
- }
2439
- };
2440
- s(z, "hostName", "quad-checkbox"), s(z, "standaloneHostName", "quad-checkbox"), s(z, "symbols", [
2441
- ["✖", y.Deny],
2442
- ["☐", y.Neutral],
2443
- ["✓", y.Prefer],
2444
- ["+", y.Require]
2445
- ]), s(z, "defaultSemanticState", y.Neutral);
2446
- let $e = z;
2447
2269
  const q = class q extends D {
2448
2270
  constructor(r = {}) {
2449
2271
  super({ ...r, symbols: q.symbols });
2450
2272
  }
2451
2273
  };
2452
- s(q, "hostName", "tri-checkbox"), s(q, "standaloneHostName", "tri-checkbox"), s(q, "symbols", [
2453
- ["✖", y.Deny],
2454
- ["☐", y.Neutral],
2455
- ["✓", y.Prefer]
2456
- ]), s(q, "defaultSemanticState", y.Neutral);
2274
+ o(q, "hostName", "quad-checkbox"), o(q, "standaloneHostName", "quad-checkbox"), o(q, "symbols", [
2275
+ ["✖", b.Deny],
2276
+ ["☐", b.Neutral],
2277
+ ["✓", b.Prefer],
2278
+ ["+", b.Require]
2279
+ ]), o(q, "defaultSemanticState", b.Neutral);
2457
2280
  let Ce = q;
2458
- class ee extends g {
2281
+ const L = class L extends D {
2282
+ constructor(r = {}) {
2283
+ super({ ...r, symbols: L.symbols });
2284
+ }
2285
+ };
2286
+ o(L, "hostName", "tri-checkbox"), o(L, "standaloneHostName", "tri-checkbox"), o(L, "symbols", [
2287
+ ["✖", b.Deny],
2288
+ ["☐", b.Neutral],
2289
+ ["✓", b.Prefer]
2290
+ ]), o(L, "defaultSemanticState", b.Neutral);
2291
+ let Ke = L;
2292
+ class ee extends y {
2459
2293
  constructor(e = {}) {
2460
2294
  var n;
2461
2295
  super(e);
2462
- s(this, "inputId");
2463
- s(this, "errorId");
2464
- s(this, "optionsEmitter");
2465
- s(this, "valueEmitter");
2466
- s(this, "ownsOptionsEmitter");
2467
- this.inputId = j("dropdown", e.id), this.errorId = `${this.inputId}-error`;
2468
- const a = e.options ?? [];
2469
- Gt(a) ? (this.optionsEmitter = a, this.ownsOptionsEmitter = !1) : (fe(a), this.optionsEmitter = new I(a, {
2296
+ o(this, "inputId");
2297
+ o(this, "errorId");
2298
+ o(this, "optionsEmitter");
2299
+ o(this, "valueEmitter");
2300
+ o(this, "ownsOptionsEmitter");
2301
+ this.inputId = F("dropdown", e.id), this.errorId = `${this.inputId}-error`;
2302
+ const i = e.options ?? [];
2303
+ Wt(i) ? (this.optionsEmitter = i, this.ownsOptionsEmitter = !1) : (fe(i), this.optionsEmitter = new x(i, {
2470
2304
  owner: this,
2471
2305
  purpose: "dropdown options"
2472
2306
  }), this.ownsOptionsEmitter = !0);
2473
- const i = ((n = this.optionsEmitter.get()[0]) == null ? void 0 : n.value) ?? "";
2474
- this.valueEmitter = M(this, e, i, "dropdown value");
2307
+ const s = ((n = this.optionsEmitter.get()[0]) == null ? void 0 : n.value) ?? "";
2308
+ this.valueEmitter = z(this, e, s, "dropdown value");
2475
2309
  }
2476
2310
  initialize() {
2477
2311
  this.watch(this.valueEmitter, this.optionsEmitter);
@@ -2479,66 +2313,65 @@ class ee extends g {
2479
2313
  render() {
2480
2314
  const {
2481
2315
  label: e,
2482
- name: a,
2483
- disabled: i = !1,
2316
+ name: i,
2317
+ disabled: s = !1,
2484
2318
  required: n = !1,
2485
- error: o = null,
2319
+ error: a = null,
2486
2320
  placeholder: l = "Select…",
2487
- ariaLabel: d,
2321
+ ariaLabel: c,
2488
2322
  onChange: h
2489
- } = this.props, f = this.optionsEmitter.get() ?? [];
2490
- fe(f);
2491
- const p = this.valueEmitter.get(), m = this.Host;
2323
+ } = this.props, p = this.optionsEmitter.get() ?? [];
2324
+ fe(p);
2325
+ const f = this.valueEmitter.get(), g = this.Host;
2492
2326
  return /* @__PURE__ */ w(
2493
- m,
2327
+ g,
2494
2328
  {
2495
- className: E(this.props) || null,
2496
- "data-disabled": i ? "" : null,
2329
+ className: R("selectshell", E(this.props)),
2330
+ "data-disabled": s ? "" : null,
2497
2331
  "data-required": n ? "" : null,
2498
- "data-error": o == null ? null : "",
2332
+ "data-error": a == null ? null : "",
2499
2333
  children: [
2500
2334
  e == null ? null : /* @__PURE__ */ u("label", { htmlFor: this.inputId, children: e }),
2501
2335
  /* @__PURE__ */ w(
2502
2336
  "select",
2503
2337
  {
2504
2338
  id: this.inputId,
2505
- name: a,
2506
- value: p == null ? "" : String(p),
2507
- disabled: i,
2339
+ name: i,
2340
+ value: f == null ? "" : String(f),
2341
+ disabled: s,
2508
2342
  required: n,
2509
- "aria-label": e == null ? d : null,
2510
- "aria-invalid": o == null ? null : "true",
2511
- "aria-describedby": o == null ? null : this.errorId,
2512
- onChange: (b) => {
2513
- const S = Qt(b, "dropdown change"), x = f.find(({ value: $ }) => String($) === S), O = (x == null ? void 0 : x.value) ?? S;
2514
- this.valueEmitter.set(O, "dropdown selection"), C(h, O, b);
2343
+ "aria-label": e == null ? c : null,
2344
+ "aria-invalid": a == null ? null : "true",
2345
+ "aria-describedby": a == null ? null : this.errorId,
2346
+ onChange: (m) => {
2347
+ const I = Jt(m, "dropdown change"), v = p.find(({ value: C }) => String(C) === I), O = (v == null ? void 0 : v.value) ?? I;
2348
+ this.valueEmitter.set(O, "dropdown selection"), K(h, O, m);
2515
2349
  },
2516
2350
  children: [
2517
- p == null || p === "" ? /* @__PURE__ */ u("option", { value: "", disabled: n, selected: !0, children: l }) : null,
2518
- f.map((b) => {
2519
- if (b == null || !Object.hasOwn(b, "value"))
2351
+ f == null || f === "" ? /* @__PURE__ */ u("option", { value: "", disabled: n, selected: !0, children: l }) : null,
2352
+ p.map((m) => {
2353
+ if (m == null || !Object.hasOwn(m, "value"))
2520
2354
  throw new TypeError("Dropdown options require value and label fields");
2521
2355
  return /* @__PURE__ */ u(
2522
2356
  "option",
2523
2357
  {
2524
- value: String(b.value),
2525
- disabled: !!b.disabled,
2526
- selected: Object.is(p, b.value),
2527
- children: b.label ?? String(b.value)
2358
+ value: String(m.value),
2359
+ disabled: !!m.disabled,
2360
+ selected: Object.is(f, m.value),
2361
+ children: m.label ?? String(m.value)
2528
2362
  },
2529
- String(b.value)
2363
+ String(m.value)
2530
2364
  );
2531
2365
  })
2532
2366
  ]
2533
2367
  }
2534
2368
  ),
2535
- o == null ? null : /* @__PURE__ */ u(
2369
+ a == null ? null : /* @__PURE__ */ u(
2536
2370
  "p",
2537
2371
  {
2538
2372
  id: this.errorId,
2539
- "data-part": "error",
2540
2373
  role: "alert",
2541
- children: String(o)
2374
+ children: String(a)
2542
2375
  }
2543
2376
  )
2544
2377
  ]
@@ -2546,33 +2379,30 @@ class ee extends g {
2546
2379
  );
2547
2380
  }
2548
2381
  }
2549
- s(ee, "hostName", "dropdown"), s(ee, "standaloneHostName", "drop-down"), s(ee, "baseStyles", [
2382
+ o(ee, "hostName", "dropdown"), o(ee, "standaloneHostName", "drop-down"), o(ee, "baseStyles", [
2550
2383
  ["&", ["labeledinput", "inputline"]],
2551
- ["& > label", ["label"]],
2552
- ["& > select", ["input", "inputline"]],
2553
- ["&[data-disabled]", ["disabled"]],
2554
- ["&[data-error]", ["error"]]
2555
- ]), s(ee, "css", v`
2384
+ ["& > select", ["input", "inputline"]]
2385
+ ]), o(ee, "css", S`
2556
2386
  & {
2557
2387
  position: relative;
2558
2388
  }
2559
2389
  `);
2560
- function Gt(t) {
2390
+ function Wt(t) {
2561
2391
  return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
2562
2392
  }
2563
- function Qt(t, r) {
2393
+ function Jt(t, r) {
2564
2394
  const e = t.currentTarget;
2565
2395
  if (e == null || typeof Reflect.get(e, "value") != "string")
2566
2396
  throw new TypeError(`${r} requires a value-bearing event target`);
2567
2397
  return Reflect.get(e, "value");
2568
2398
  }
2569
- class te extends g {
2399
+ class te extends y {
2570
2400
  constructor(e = {}) {
2571
2401
  super(e);
2572
- s(this, "inputId");
2573
- s(this, "errorId");
2574
- s(this, "valueEmitter");
2575
- this.inputId = j("textbox", e.id), this.errorId = `${this.inputId}-error`, this.valueEmitter = M(this, e, "", "textbox value");
2402
+ o(this, "inputId");
2403
+ o(this, "errorId");
2404
+ o(this, "valueEmitter");
2405
+ this.inputId = F("textbox", e.id), this.errorId = `${this.inputId}-error`, this.valueEmitter = z(this, e, "", "textbox value");
2576
2406
  }
2577
2407
  initialize() {
2578
2408
  this.watch(this.valueEmitter);
@@ -2580,28 +2410,28 @@ class te extends g {
2580
2410
  render() {
2581
2411
  const {
2582
2412
  label: e,
2583
- placeholder: a,
2584
- type: i = "text",
2413
+ placeholder: i,
2414
+ type: s = "text",
2585
2415
  name: n,
2586
- disabled: o = !1,
2416
+ disabled: a = !1,
2587
2417
  required: l = !1,
2588
- readOnly: d = !1,
2418
+ readOnly: c = !1,
2589
2419
  error: h = null,
2590
- autoComplete: f,
2591
- inputMode: p,
2592
- minLength: m,
2593
- maxLength: b,
2594
- pattern: S,
2595
- ariaLabel: x,
2420
+ autoComplete: p,
2421
+ inputMode: f,
2422
+ minLength: g,
2423
+ maxLength: m,
2424
+ pattern: I,
2425
+ ariaLabel: v,
2596
2426
  inputRef: O,
2597
- onInput: $,
2598
- onChange: K
2599
- } = this.props, A = this.valueEmitter.get() ?? "", F = this.Host;
2427
+ onInput: C,
2428
+ onChange: j
2429
+ } = this.props, A = this.valueEmitter.get() ?? "", H = this.Host;
2600
2430
  return /* @__PURE__ */ w(
2601
- F,
2431
+ H,
2602
2432
  {
2603
2433
  className: E(this.props) || null,
2604
- "data-disabled": o ? "" : null,
2434
+ "data-disabled": a ? "" : null,
2605
2435
  "data-required": l ? "" : null,
2606
2436
  "data-error": h == null ? null : "",
2607
2437
  children: [
@@ -2611,28 +2441,28 @@ class te extends g {
2611
2441
  {
2612
2442
  id: this.inputId,
2613
2443
  name: n,
2614
- type: i,
2444
+ type: s,
2615
2445
  value: A,
2616
- placeholder: a,
2617
- disabled: o,
2446
+ placeholder: i,
2447
+ disabled: a,
2618
2448
  required: l,
2619
- readOnly: d,
2620
- autoComplete: f,
2621
- inputMode: p,
2622
- minLength: m,
2623
- maxLength: b,
2624
- pattern: S,
2449
+ readOnly: c,
2450
+ autoComplete: p,
2451
+ inputMode: f,
2452
+ minLength: g,
2453
+ maxLength: m,
2454
+ pattern: I,
2625
2455
  ref: O,
2626
- "aria-label": e == null ? x : null,
2456
+ "aria-label": e == null ? v : null,
2627
2457
  "aria-invalid": h == null ? null : "true",
2628
2458
  "aria-describedby": h == null ? null : this.errorId,
2629
2459
  onInput: (T) => {
2630
- const B = Ke(T, "textbox input");
2631
- this.valueEmitter.set(B, "textbox input"), C($, B, T);
2460
+ const G = je(T, "textbox input");
2461
+ this.valueEmitter.set(G, "textbox input"), K(C, G, T);
2632
2462
  },
2633
- onChange: (T) => C(
2634
- K,
2635
- Ke(T, "textbox change"),
2463
+ onChange: (T) => K(
2464
+ j,
2465
+ je(T, "textbox change"),
2636
2466
  T
2637
2467
  )
2638
2468
  }
@@ -2641,7 +2471,6 @@ class te extends g {
2641
2471
  "p",
2642
2472
  {
2643
2473
  id: this.errorId,
2644
- "data-part": "error",
2645
2474
  role: "alert",
2646
2475
  children: String(h)
2647
2476
  }
@@ -2651,96 +2480,91 @@ class te extends g {
2651
2480
  );
2652
2481
  }
2653
2482
  }
2654
- s(te, "hostName", "textbox"), s(te, "standaloneHostName", "text-box"), s(te, "baseStyles", [
2483
+ o(te, "hostName", "textbox"), o(te, "standaloneHostName", "text-box"), o(te, "baseStyles", [
2655
2484
  ["&", ["labeledinput", "inputline"]],
2656
- ["& > label", ["label"]],
2657
- ["& > input", ["input", "inputline"]],
2658
- ["&[data-disabled]", ["disabled"]],
2659
- ["&[data-error]", ["error"]]
2660
- ]), s(te, "css", v`
2485
+ ["& > input", ["input", "inputline"]]
2486
+ ]), o(te, "css", S`
2661
2487
  & input {
2662
2488
  cursor: text;
2663
2489
  }
2664
2490
 
2665
- & > [data-part="error"] {
2491
+ & > [role="alert"] {
2666
2492
  margin: 0;
2667
- color: var(--fray-color-error, var(--error-color));
2668
2493
  }
2669
2494
  `);
2670
- function Ke(t, r) {
2495
+ function je(t, r) {
2671
2496
  const e = t.currentTarget;
2672
2497
  if (e == null || typeof Reflect.get(e, "value") != "string")
2673
2498
  throw new TypeError(`${r} requires a value-bearing event target`);
2674
2499
  return Reflect.get(e, "value");
2675
2500
  }
2676
- class Ae extends g {
2501
+ class Ae extends y {
2677
2502
  constructor(e = {}) {
2678
2503
  var n;
2679
2504
  super(e);
2680
- s(this, "valueEmitter");
2681
- s(this, "groupId");
2682
- s(this, "legendId");
2683
- const a = e.options ?? [];
2684
- je(a);
2685
- const i = ((n = a[0]) == null ? void 0 : n[0]) ?? null;
2686
- this.valueEmitter = M(
2505
+ o(this, "valueEmitter");
2506
+ o(this, "groupId");
2507
+ o(this, "legendId");
2508
+ const i = e.options ?? [];
2509
+ Fe(i);
2510
+ const s = ((n = i[0]) == null ? void 0 : n[0]) ?? null;
2511
+ this.valueEmitter = z(
2687
2512
  this,
2688
2513
  e,
2689
- i ?? null,
2514
+ s ?? null,
2690
2515
  "toggle value"
2691
- ), this.groupId = j("toggle", e.id), this.legendId = `${this.groupId}-label`;
2516
+ ), this.groupId = F("toggle", e.id), this.legendId = `${this.groupId}-label`;
2692
2517
  }
2693
2518
  initialize() {
2694
2519
  this.watch(this.valueEmitter);
2695
2520
  }
2696
- selectOption(e, a = null) {
2697
- this.props.disabled || (this.valueEmitter.set(e, "toggle option selected"), C(this.props.onChange, e, a));
2521
+ selectOption(e, i = null) {
2522
+ this.props.disabled || (this.valueEmitter.set(e, "toggle option selected"), K(this.props.onChange, e, i));
2698
2523
  }
2699
2524
  render() {
2700
2525
  const {
2701
2526
  options: e = [],
2702
- label: a,
2703
- disabled: i = !1,
2527
+ label: i,
2528
+ disabled: s = !1,
2704
2529
  required: n = !1
2705
2530
  } = this.props;
2706
- je(e);
2707
- const o = this.valueEmitter.get(), l = Math.max(
2531
+ Fe(e);
2532
+ const a = this.valueEmitter.get(), l = Math.max(
2708
2533
  0,
2709
- e.findIndex(([d]) => Object.is(d, o))
2534
+ e.findIndex(([c]) => Object.is(c, a))
2710
2535
  );
2711
2536
  return /* @__PURE__ */ w(
2712
2537
  "fieldset",
2713
2538
  {
2714
2539
  id: this.groupId,
2715
- disabled: i,
2540
+ disabled: s,
2716
2541
  className: E(this.props) || void 0,
2717
2542
  "data-fray-component": "toggle",
2718
- "data-disabled": i ? "" : null,
2543
+ "data-disabled": s ? "" : null,
2719
2544
  "aria-required": n ? "true" : null,
2720
2545
  children: [
2721
- a == null ? null : /* @__PURE__ */ u("legend", { id: this.legendId, children: a }),
2546
+ i == null ? null : /* @__PURE__ */ u("legend", { id: this.legendId, children: i }),
2722
2547
  /* @__PURE__ */ u(
2723
2548
  "div",
2724
2549
  {
2725
2550
  "data-part": "options",
2726
2551
  role: "radiogroup",
2727
- "aria-label": a == null ? this.props.ariaLabel : null,
2728
- "aria-labelledby": a == null ? null : this.legendId,
2729
- children: e.map(([d, h], f) => /* @__PURE__ */ u(
2552
+ "aria-label": i == null ? this.props.ariaLabel : null,
2553
+ "aria-labelledby": i == null ? null : this.legendId,
2554
+ children: e.map(([c, h], p) => /* @__PURE__ */ u(
2730
2555
  "button",
2731
2556
  {
2732
2557
  type: "button",
2733
2558
  role: "radio",
2734
- disabled: i,
2735
- "data-part": "option",
2736
- "aria-checked": Object.is(o, d) ? "true" : "false",
2737
- "data-value": String(d),
2738
- tabIndex: f === l ? 0 : -1,
2739
- onClick: (p) => this.selectOption(d, p),
2740
- onKeyDown: (p) => this.handleKeyDown(p, f, e),
2559
+ disabled: s,
2560
+ "aria-checked": Object.is(a, c) ? "true" : "false",
2561
+ "data-value": String(c),
2562
+ tabIndex: p === l ? 0 : -1,
2563
+ onClick: (f) => this.selectOption(c, f),
2564
+ onKeyDown: (f) => this.handleKeyDown(f, p, e),
2741
2565
  children: h
2742
2566
  },
2743
- String(d)
2567
+ String(c)
2744
2568
  ))
2745
2569
  }
2746
2570
  )
@@ -2748,74 +2572,54 @@ class Ae extends g {
2748
2572
  }
2749
2573
  );
2750
2574
  }
2751
- handleKeyDown(e, a, i) {
2575
+ handleKeyDown(e, i, s) {
2752
2576
  const { key: n } = e;
2753
- let o;
2754
- if (n === "ArrowRight" || n === "ArrowDown") o = (a + 1) % i.length;
2577
+ let a;
2578
+ if (n === "ArrowRight" || n === "ArrowDown") a = (i + 1) % s.length;
2755
2579
  else if (n === "ArrowLeft" || n === "ArrowUp")
2756
- o = (a - 1 + i.length) % i.length;
2757
- else if (n === "Home") o = 0;
2758
- else if (n === "End") o = i.length - 1;
2580
+ a = (i - 1 + s.length) % s.length;
2581
+ else if (n === "Home") a = 0;
2582
+ else if (n === "End") a = s.length - 1;
2759
2583
  else return;
2760
2584
  e.preventDefault();
2761
- const l = i[o];
2585
+ const l = s[a];
2762
2586
  if (l != null && (this.selectOption(l[0], e), this.dom instanceof Element)) {
2763
- const d = this.dom.querySelectorAll('[role="radio"]')[o];
2764
- d == null || d.focus();
2587
+ const c = this.dom.querySelectorAll('[role="radio"]')[a];
2588
+ c == null || c.focus();
2765
2589
  }
2766
2590
  }
2767
2591
  }
2768
- s(Ae, "baseStyles", [
2769
- ['fieldset[data-fray-component="toggle"] > [data-part="options"]', ["uiline"]],
2770
- ['fieldset[data-fray-component="toggle"] [data-part="option"]', ["uiline", "button"]]
2771
- ]), s(Ae, "css", v`
2772
- fieldset[data-fray-component="toggle"] {
2592
+ o(Ae, "baseStyles", [
2593
+ ['fieldset:has(> [data-part="options"]) > [data-part="options"]', ["uiline"]],
2594
+ ['fieldset:has(> [data-part="options"]) [role="radio"]', ["uiline", "button"]]
2595
+ ]), o(Ae, "css", S`
2596
+ fieldset:has(> [data-part="options"]) {
2773
2597
  margin: 0;
2774
2598
  padding: 0;
2775
2599
  border: 0;
2776
2600
  }
2777
2601
 
2778
- fieldset[data-fray-component="toggle"] > [data-part="options"] {
2602
+ fieldset:has(> [data-part="options"]) > [data-part="options"] {
2779
2603
  display: flex;
2780
2604
  padding: 0;
2781
2605
  }
2782
2606
 
2783
- fieldset[data-fray-component="toggle"] [data-part="option"] {
2784
- background: var(--fray-toggle-button-background, var(--fray-button-background));
2785
- border-radius: 0;
2786
- }
2787
-
2788
- fieldset[data-fray-component="toggle"] [data-part="option"]:first-child {
2789
- border-radius: var(--ui-border-radius) 0 0 var(--ui-border-radius);
2790
- }
2791
-
2792
- fieldset[data-fray-component="toggle"] [data-part="option"]:last-child {
2793
- border-radius: 0 var(--ui-border-radius) var(--ui-border-radius) 0;
2794
- }
2795
-
2796
- fieldset[data-fray-component="toggle"] [data-part="option"][aria-checked="true"] {
2797
- background: var(
2798
- --fray-toggle-button-background-checked,
2799
- var(--fray-selection-background, var(--toggle-selected-bg))
2800
- );
2801
- color: var(--fray-selection-color, var(--toggle-selected-text));
2802
- }
2803
2607
  `);
2804
- function je(t) {
2608
+ function Fe(t) {
2805
2609
  fe(t);
2806
2610
  for (const r of t)
2807
2611
  if (!Array.isArray(r) || r.length < 2)
2808
2612
  throw new TypeError("Toggle options must be [value, label] tuples");
2809
2613
  }
2810
- class re extends g {
2614
+ class he extends y {
2811
2615
  render() {
2812
2616
  const {
2813
2617
  children: r = [],
2814
2618
  id: e,
2815
- label: a = "Actions",
2816
- orientation: i = "horizontal"
2619
+ label: i = "Actions",
2620
+ orientation: s = "horizontal"
2817
2621
  } = this.props;
2818
- if (!["horizontal", "vertical"].includes(i))
2622
+ if (!["horizontal", "vertical"].includes(s))
2819
2623
  throw new TypeError("Toolbar orientation must be horizontal or vertical");
2820
2624
  const n = this.Host;
2821
2625
  return /* @__PURE__ */ u(
@@ -2823,18 +2627,16 @@ class re extends g {
2823
2627
  {
2824
2628
  id: e,
2825
2629
  role: "toolbar",
2826
- className: E(this.props) || null,
2827
- "data-orientation": i,
2828
- "aria-label": a,
2829
- "aria-orientation": i,
2630
+ className: R("toolbarlike", E(this.props)),
2631
+ "data-orientation": s,
2632
+ "aria-label": i,
2633
+ "aria-orientation": s,
2830
2634
  children: r
2831
2635
  }
2832
2636
  );
2833
2637
  }
2834
2638
  }
2835
- s(re, "hostName", "toolbar"), s(re, "standaloneHostName", "tool-bar"), s(re, "baseStyles", [
2836
- ["&", ["toolbar"]]
2837
- ]), s(re, "css", v`
2639
+ o(he, "hostName", "toolbar"), o(he, "standaloneHostName", "tool-bar"), o(he, "css", S`
2838
2640
  & {
2839
2641
  display: flex;
2840
2642
  flex-wrap: wrap;
@@ -2848,31 +2650,31 @@ s(re, "hostName", "toolbar"), s(re, "standaloneHostName", "tool-bar"), s(re, "ba
2848
2650
  align-items: stretch;
2849
2651
  }
2850
2652
  `);
2851
- class he extends g {
2653
+ class pe extends y {
2852
2654
  constructor(e) {
2853
2655
  super(e);
2854
- s(this, "progressId");
2855
- if (this.progressId = j("progress", e.id), e.valueEmitter != null && !Wt(e.valueEmitter))
2656
+ o(this, "progressId");
2657
+ if (this.progressId = F("progress", e.id), e.valueEmitter != null && !_t(e.valueEmitter))
2856
2658
  throw new TypeError("ProgressBar valueEmitter must be a readable emitter");
2857
2659
  }
2858
2660
  render() {
2859
2661
  const e = this.props.max ?? 100;
2860
2662
  if (!Number.isFinite(e) || e <= 0)
2861
2663
  throw new RangeError("ProgressBar max must be a positive finite number");
2862
- const a = this.props.valueEmitter == null ? this.props.value ?? null : this.read(this.props.valueEmitter);
2863
- if (a != null && (!Number.isFinite(a) || a < 0))
2664
+ const i = this.props.valueEmitter == null ? this.props.value ?? null : this.read(this.props.valueEmitter);
2665
+ if (i != null && (!Number.isFinite(i) || i < 0))
2864
2666
  throw new RangeError("ProgressBar value must be null or a non-negative finite number");
2865
- const i = a == null ? null : Math.min(a, e), n = this.props.valueText ?? (i == null ? "In progress" : `${Math.round(i / e * 100)}%`), o = this.Host;
2866
- return /* @__PURE__ */ w(o, { className: E(this.props) || null, children: [
2667
+ const s = i == null ? null : Math.min(i, e), n = this.props.valueText ?? (s == null ? "In progress" : `${Math.round(s / e * 100)}%`), a = this.Host;
2668
+ return /* @__PURE__ */ w(a, { className: E(this.props) || null, children: [
2867
2669
  /* @__PURE__ */ w("div", { "data-part": "label-line", children: [
2868
2670
  /* @__PURE__ */ u("label", { htmlFor: this.progressId, children: this.props.label }),
2869
- /* @__PURE__ */ u("span", { "data-part": "value", children: n })
2671
+ /* @__PURE__ */ u("output", { children: n })
2870
2672
  ] }),
2871
2673
  /* @__PURE__ */ u(
2872
2674
  "progress",
2873
2675
  {
2874
2676
  id: this.progressId,
2875
- value: i ?? void 0,
2677
+ value: s ?? void 0,
2876
2678
  max: e,
2877
2679
  "aria-valuetext": n,
2878
2680
  children: n
@@ -2881,7 +2683,7 @@ class he extends g {
2881
2683
  ] });
2882
2684
  }
2883
2685
  }
2884
- s(he, "hostName", "progress-bar"), s(he, "standaloneHostName", "progress-bar"), s(he, "css", v`
2686
+ o(pe, "hostName", "progress-bar"), o(pe, "standaloneHostName", "progress-bar"), o(pe, "css", S`
2885
2687
  & {
2886
2688
  display: grid;
2887
2689
  gap: var(--spacing-small, 0.5rem);
@@ -2893,16 +2695,9 @@ s(he, "hostName", "progress-bar"), s(he, "standaloneHostName", "progress-bar"),
2893
2695
  gap: var(--spacing-medium, 1rem);
2894
2696
  }
2895
2697
 
2896
- & > [data-part="label-line"] > label {
2897
- font-weight: 600;
2898
- }
2899
-
2900
2698
  & > progress {
2901
2699
  width: 100%;
2902
2700
  min-height: 0.8rem;
2903
- color: var(--fray-progress-value-background, var(--ui-accent-color));
2904
- background: var(--fray-progress-track-background, transparent);
2905
- accent-color: var(--fray-color-primary, var(--ui-accent-color));
2906
2701
  }
2907
2702
 
2908
2703
  @media (forced-colors: active) {
@@ -2911,201 +2706,213 @@ s(he, "hostName", "progress-bar"), s(he, "standaloneHostName", "progress-bar"),
2911
2706
  }
2912
2707
  }
2913
2708
  `);
2914
- function Wt(t) {
2709
+ function _t(t) {
2915
2710
  return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
2916
2711
  }
2917
- const ur = Object.freeze([
2918
- c("--fray-color-canvas", "color", "palette", "color", "Application canvas"),
2919
- c("--fray-color-surface", "color", "palette", "color", "Primary surface"),
2920
- c("--fray-color-surface-muted", "color", "palette", "color", "Subdued surface"),
2921
- c("--fray-color-surface-raised", "color", "palette", "color", "Raised surface"),
2922
- c("--fray-color-surface-inset", "color", "palette", "color", "Inset surface"),
2923
- c("--fray-color-text", "color", "palette", "color", "Primary text"),
2924
- c("--fray-color-text-muted", "color", "palette", "color", "Secondary text"),
2925
- c("--fray-color-border", "color", "palette", "color", "Ordinary border"),
2926
- c("--fray-color-border-strong", "color", "palette", "color", "Emphasized border"),
2927
- c("--fray-color-primary", "color", "palette", "color", "Primary accent"),
2928
- c("--fray-color-primary-hover", "color", "palette", "color", "Hovered accent"),
2929
- c("--fray-color-primary-active", "color", "palette", "color", "Active accent"),
2930
- c("--fray-color-primary-soft", "color", "palette", "color", "Subtle accent surface"),
2931
- c("--fray-color-on-primary", "color", "palette", "color", "Content on primary accent"),
2932
- c("--fray-color-focus", "color", "palette", "color", "Keyboard focus indication"),
2933
- c("--fray-color-selection", "color", "palette", "color", "Selected item surface"),
2934
- c("--fray-color-on-selection", "color", "palette", "color", "Content on selection"),
2935
- c("--fray-color-disabled", "color", "palette", "color", "Disabled surface"),
2936
- c("--fray-color-on-disabled", "color", "palette", "color", "Disabled content"),
2937
- c("--fray-color-error", "color", "status", "color", "Error state"),
2938
- c("--fray-color-on-error", "color", "status", "color", "Content on error"),
2939
- c("--fray-color-success", "color", "status", "color", "Success state"),
2940
- c("--fray-color-on-success", "color", "status", "color", "Content on success"),
2941
- c("--fray-color-highlight", "color", "palette", "color", "Light reflection/highlight"),
2942
- c("--fray-color-shadow", "color", "palette", "color", "Shadow tint"),
2943
- c("--fray-font-family", "theme", "typography", "font", "UI font stack"),
2944
- c("--fray-font-size", "theme", "typography", "dimension", "Base UI font size"),
2945
- c("--fray-line-height", "theme", "typography", "dimension", "Base UI line height"),
2946
- c("--fray-control-min-height", "theme", "control", "dimension", "Minimum control height"),
2947
- c("--fray-space-xs", "theme", "spacing", "dimension", "Extra-small spacing"),
2948
- c("--fray-space-sm", "theme", "spacing", "dimension", "Small spacing"),
2949
- c("--fray-space-md", "theme", "spacing", "dimension", "Medium spacing"),
2950
- c("--fray-space-lg", "theme", "spacing", "dimension", "Large spacing"),
2951
- c("--fray-radius-sm", "theme", "shape", "radius", "Small corner radius"),
2952
- c("--fray-radius-md", "theme", "shape", "radius", "Ordinary corner radius"),
2953
- c("--fray-radius-lg", "theme", "shape", "radius", "Large corner radius"),
2954
- c("--fray-motion-fast", "theme", "motion", "duration", "Fast interaction transition"),
2955
- c("--fray-ui-background", "theme", "surface", "background", "Default UI background"),
2956
- c("--fray-ui-color", "theme", "surface", "color", "Default UI text"),
2957
- c("--fray-ui-border", "theme", "surface", "border", "Default UI border"),
2958
- c("--fray-ui-shadow", "theme", "surface", "shadow", "Default raised shadow"),
2959
- c("--fray-focus-ring", "theme", "focus", "shadow", "Keyboard focus ring"),
2960
- c("--fray-panel-background", "theme", "panel", "background", "Panel surface", "--fray-ui-background"),
2961
- c("--fray-panel-color", "theme", "panel", "color", "Panel content", "--fray-ui-color"),
2962
- c("--fray-panel-border", "theme", "panel", "border", "Panel border", "--fray-ui-border"),
2963
- c("--fray-panel-shadow", "theme", "panel", "shadow", "Panel shadow", "--fray-ui-shadow"),
2964
- c("--fray-panel-radius", "theme", "panel", "radius", "Panel radius", "--fray-radius-md"),
2965
- c("--fray-dialog-shadow", "theme", "dialog", "shadow", "Modal dialog shadow", "--fray-panel-shadow"),
2966
- c("--fray-dialog-backdrop-background", "theme", "dialog", "background", "Modal backdrop"),
2967
- c("--fray-header-background", "theme", "header", "background", "Generic header surface"),
2968
- c("--fray-header-color", "theme", "header", "color", "Generic header content"),
2969
- c("--fray-header-border", "theme", "header", "border", "Generic header border"),
2970
- c("--fray-header-shadow", "theme", "header", "shadow", "Generic header shadow"),
2971
- c("--fray-section-header-background", "theme", "header", "background", "Section header surface", "--fray-header-background"),
2972
- c("--fray-section-header-color", "theme", "header", "color", "Section header content", "--fray-header-color"),
2973
- c("--fray-section-header-border", "theme", "header", "border", "Section header border", "--fray-header-border"),
2974
- c("--fray-section-header-shadow", "theme", "header", "shadow", "Section header shadow", "--fray-header-shadow"),
2975
- c("--fray-panel-header-background", "theme", "header", "background", "Panel header surface", "--fray-section-header-background"),
2976
- c("--fray-panel-header-color", "theme", "header", "color", "Panel header content", "--fray-section-header-color"),
2977
- c("--fray-table-header-background", "theme", "header", "background", "Table header surface", "--fray-section-header-background"),
2978
- c("--fray-table-header-color", "theme", "header", "color", "Table header content", "--fray-section-header-color"),
2979
- c("--fray-dialog-header-background", "theme", "header", "background", "Dialog header surface", "--fray-section-header-background"),
2980
- c("--fray-dialog-header-color", "theme", "header", "color", "Dialog header content", "--fray-section-header-color"),
2981
- c("--fray-button-background", "theme", "button", "background", "Generic button surface"),
2982
- c("--fray-button-background-hover", "theme", "button", "background", "Hovered button surface"),
2983
- c("--fray-button-background-active", "theme", "button", "background", "Pressed button surface"),
2984
- c("--fray-button-background-disabled", "theme", "button", "background", "Disabled button surface"),
2985
- c("--fray-button-color", "theme", "button", "color", "Generic button content"),
2986
- c("--fray-button-border", "theme", "button", "border", "Generic button border"),
2987
- c("--fray-button-shadow", "theme", "button", "shadow", "Generic button shadow"),
2988
- c("--fray-button-shadow-active", "theme", "button", "shadow", "Pressed button shadow"),
2989
- c("--fray-toggle-button-background", "theme", "button", "background", "Toggle option surface", "--fray-button-background"),
2990
- c("--fray-toggle-button-background-checked", "theme", "button", "background", "Selected toggle option", "--fray-selection-background"),
2991
- c("--fray-tab-button-background", "theme", "button", "background", "Tab surface", "--fray-button-background"),
2992
- c("--fray-tab-button-background-active", "theme", "button", "background", "Active tab surface", "--fray-tab-active-background"),
2993
- c("--fray-menu-button-background", "theme", "button", "background", "Menu action surface", "--fray-button-background"),
2994
- c("--fray-dropdown-trigger-background", "theme", "button", "background", "Dropdown arrow/trigger surface", "--fray-button-background"),
2995
- c("--fray-table-header-button-background", "theme", "button", "background", "Table-header action surface", "--fray-button-background"),
2996
- c("--fray-input-background", "theme", "input", "background", "Input surface"),
2997
- c("--fray-input-color", "theme", "input", "color", "Input content"),
2998
- c("--fray-input-border", "theme", "input", "border", "Input border"),
2999
- c("--fray-input-shadow", "theme", "input", "shadow", "Input shadow"),
3000
- c("--fray-input-background-disabled", "theme", "input", "background", "Disabled input surface"),
3001
- c("--fray-input-color-disabled", "theme", "input", "color", "Disabled input content"),
3002
- c("--fray-selection-background", "theme", "selection", "background", "Selected item surface"),
3003
- c("--fray-selection-color", "theme", "selection", "color", "Selected item content"),
3004
- c("--fray-row-hover-background", "theme", "row", "background", "Hovered list/table/tree row"),
3005
- c("--fray-table-row-background", "theme", "table", "background", "Odd table row surface"),
3006
- c("--fray-table-row-alt-background", "theme", "table", "background", "Even table row surface"),
3007
- c("--fray-checkbox-box-background", "theme", "checkbox", "background", "Unchecked checkbox box", "--fray-input-background"),
3008
- c("--fray-checkbox-box-background-checked", "theme", "checkbox", "background", "Checked checkbox box", "--fray-selection-background"),
3009
- c("--fray-checkbox-box-border", "theme", "checkbox", "border", "Checkbox box border", "--fray-input-border"),
3010
- c("--fray-checkbox-symbol-color", "theme", "checkbox", "color", "Checkbox symbol", "--fray-selection-color"),
3011
- c("--fray-radio-background", "theme", "radio", "background", "Radio/toggle option surface", "--fray-toggle-button-background"),
3012
- c("--fray-radio-background-checked", "theme", "radio", "background", "Selected radio/toggle option", "--fray-selection-background"),
3013
- c("--fray-toolbar-background", "theme", "toolbar", "background", "Toolbar surface", "--fray-panel-background"),
3014
- c("--fray-toolbar-color", "theme", "toolbar", "color", "Toolbar content", "--fray-panel-color"),
3015
- c("--fray-toolbar-border", "theme", "toolbar", "border", "Toolbar border", "--fray-panel-border"),
3016
- c("--fray-toolbar-shadow", "theme", "toolbar", "shadow", "Toolbar shadow", "--fray-panel-shadow"),
3017
- c("--fray-tabline-background", "theme", "tabs", "background", "Tab strip surface", "--fray-panel-background"),
3018
- c("--fray-tab-active-background", "theme", "tabs", "background", "Active tab surface", "--fray-panel-background"),
3019
- c("--fray-progress-track-background", "theme", "progress", "background", "Progress track"),
3020
- c("--fray-progress-value-background", "theme", "progress", "background", "Progress value"),
3021
- c("--fray-working-background-image", "theme", "status", "background", "Indeterminate/loading texture")
3022
- ]), Jt = Object.freeze([
3023
- R("shiny", "Shiny", N("themes/shiny/theme.css")),
3024
- R("java", "Java", N("themes/java/theme.css")),
3025
- R("minimal", "Minimal", N("themes/minimal/theme.css"))
2712
+ const pr = Object.freeze([
2713
+ ...me("primary"),
2714
+ ...me("secondary"),
2715
+ ...me("neutral"),
2716
+ d("--palette-primary", "palette", "primary", "color", "Primary anchor color", "--palette-primary-500"),
2717
+ d("--palette-primary-light", "palette", "primary", "color", "Light primary color", "--palette-primary-200"),
2718
+ d("--palette-primary-dark", "palette", "primary", "color", "Dark primary color", "--palette-primary-800"),
2719
+ d("--palette-secondary", "palette", "secondary", "color", "Secondary anchor color", "--palette-secondary-500"),
2720
+ d("--palette-secondary-light", "palette", "secondary", "color", "Light secondary color", "--palette-secondary-200"),
2721
+ d("--palette-secondary-dark", "palette", "secondary", "color", "Dark secondary color", "--palette-secondary-800"),
2722
+ d("--palette-neutral", "palette", "neutral", "color", "Neutral anchor color", "--palette-neutral-500"),
2723
+ d("--palette-neutral-light", "palette", "neutral", "color", "Light neutral color", "--palette-neutral-200"),
2724
+ d("--palette-neutral-dark", "palette", "neutral", "color", "Dark neutral color", "--palette-neutral-800"),
2725
+ d("--palette-light", "palette", "contrast", "color", "Light endpoint"),
2726
+ d("--palette-dark", "palette", "contrast", "color", "Dark endpoint"),
2727
+ d("--palette-contrast-light", "palette", "contrast", "color", "Light contrasting foreground", "--palette-light"),
2728
+ d("--palette-contrast-dark", "palette", "contrast", "color", "Dark contrasting foreground", "--palette-dark"),
2729
+ d("--palette-red", "palette", "hue", "color", "Red palette color"),
2730
+ d("--palette-green", "palette", "hue", "color", "Green palette color"),
2731
+ d("--font-family", "theme", "typography", "font", "UI font stack"),
2732
+ d("--font-size", "theme", "typography", "dimension", "Base UI font size"),
2733
+ d("--line-height", "theme", "typography", "dimension", "Base UI line height"),
2734
+ d("--control-min-height", "theme", "control", "dimension", "Minimum control height"),
2735
+ d("--space-xs", "theme", "spacing", "dimension", "Extra-small spacing"),
2736
+ d("--space-sm", "theme", "spacing", "dimension", "Small spacing"),
2737
+ d("--space-md", "theme", "spacing", "dimension", "Medium spacing"),
2738
+ d("--space-lg", "theme", "spacing", "dimension", "Large spacing"),
2739
+ d("--radius-sm", "theme", "shape", "radius", "Small corner radius"),
2740
+ d("--radius-md", "theme", "shape", "radius", "Ordinary corner radius"),
2741
+ d("--radius-lg", "theme", "shape", "radius", "Large corner radius"),
2742
+ d("--motion-fast", "theme", "motion", "duration", "Fast interaction transition"),
2743
+ d("--ui-background", "theme", "surface", "background", "Default UI background"),
2744
+ d("--ui-color", "theme", "surface", "color", "Default UI text"),
2745
+ d("--ui-border", "theme", "surface", "border", "Default UI border"),
2746
+ d("--ui-shadow", "theme", "surface", "shadow", "Default raised shadow"),
2747
+ d("--focus-ring", "theme", "focus", "shadow", "Keyboard focus ring"),
2748
+ d("--focus-color", "theme", "focus", "color", "Keyboard focus color"),
2749
+ d("--error-color", "theme", "status", "color", "Error state color"),
2750
+ d("--error-contrast", "theme", "status", "color", "Content on an error surface"),
2751
+ d("--success-color", "theme", "status", "color", "Success state color"),
2752
+ d("--panel-background", "theme", "panel", "background", "Panel surface", "--ui-background"),
2753
+ d("--panel-color", "theme", "panel", "color", "Panel content", "--ui-color"),
2754
+ d("--panel-border", "theme", "panel", "border", "Panel border", "--ui-border"),
2755
+ d("--panel-shadow", "theme", "panel", "shadow", "Panel shadow", "--ui-shadow"),
2756
+ d("--panel-radius", "theme", "panel", "radius", "Panel radius", "--radius-md"),
2757
+ d("--dialog-shadow", "theme", "dialog", "shadow", "Modal dialog shadow", "--panel-shadow"),
2758
+ d("--dialog-backdrop-background", "theme", "dialog", "background", "Modal backdrop"),
2759
+ d("--header-background", "theme", "header", "background", "Generic header surface"),
2760
+ d("--header-color", "theme", "header", "color", "Generic header content"),
2761
+ d("--header-border", "theme", "header", "border", "Generic header border"),
2762
+ d("--header-shadow", "theme", "header", "shadow", "Generic header shadow"),
2763
+ d("--section-header-background", "theme", "header", "background", "Section header surface", "--header-background"),
2764
+ d("--section-header-color", "theme", "header", "color", "Section header content", "--header-color"),
2765
+ d("--section-header-border", "theme", "header", "border", "Section header border", "--header-border"),
2766
+ d("--section-header-shadow", "theme", "header", "shadow", "Section header shadow", "--header-shadow"),
2767
+ d("--panel-header-background", "theme", "header", "background", "Panel header surface", "--section-header-background"),
2768
+ d("--panel-header-color", "theme", "header", "color", "Panel header content", "--section-header-color"),
2769
+ d("--table-header-background", "theme", "header", "background", "Table header surface", "--section-header-background"),
2770
+ d("--table-header-color", "theme", "header", "color", "Table header content", "--section-header-color"),
2771
+ d("--dialog-header-background", "theme", "header", "background", "Dialog header surface", "--section-header-background"),
2772
+ d("--dialog-header-color", "theme", "header", "color", "Dialog header content", "--section-header-color"),
2773
+ d("--button-background", "theme", "button", "background", "Generic button surface"),
2774
+ d("--button-background-hover", "theme", "button", "background", "Hovered button surface"),
2775
+ d("--button-background-active", "theme", "button", "background", "Pressed button surface"),
2776
+ d("--button-background-disabled", "theme", "button", "background", "Disabled button surface"),
2777
+ d("--button-color", "theme", "button", "color", "Generic button content"),
2778
+ d("--button-border", "theme", "button", "border", "Generic button border"),
2779
+ d("--button-shadow", "theme", "button", "shadow", "Generic button shadow"),
2780
+ d("--button-shadow-active", "theme", "button", "shadow", "Pressed button shadow"),
2781
+ d("--toggle-button-background", "theme", "button", "background", "Toggle option surface", "--button-background"),
2782
+ d("--toggle-button-background-checked", "theme", "button", "background", "Selected toggle option", "--selection-background"),
2783
+ d("--tab-button-background", "theme", "button", "background", "Tab surface", "--button-background"),
2784
+ d("--tab-button-background-active", "theme", "button", "background", "Active tab surface", "--tab-active-background"),
2785
+ d("--menu-button-background", "theme", "button", "background", "Menu action surface", "--button-background"),
2786
+ d("--dropdown-trigger-background", "theme", "button", "background", "Dropdown arrow/trigger surface", "--button-background"),
2787
+ d("--table-header-button-background", "theme", "button", "background", "Table-header action surface", "--button-background"),
2788
+ d("--input-background", "theme", "input", "background", "Input surface"),
2789
+ d("--input-color", "theme", "input", "color", "Input content"),
2790
+ d("--input-border", "theme", "input", "border", "Input border"),
2791
+ d("--input-shadow", "theme", "input", "shadow", "Input shadow"),
2792
+ d("--input-background-disabled", "theme", "input", "background", "Disabled input surface"),
2793
+ d("--input-color-disabled", "theme", "input", "color", "Disabled input content"),
2794
+ d("--selection-background", "theme", "selection", "background", "Selected item surface"),
2795
+ d("--selection-color", "theme", "selection", "color", "Selected item content"),
2796
+ d("--row-hover-background", "theme", "row", "background", "Hovered list/table/tree row"),
2797
+ d("--table-row-background", "theme", "table", "background", "Odd table row surface"),
2798
+ d("--table-row-alt-background", "theme", "table", "background", "Even table row surface"),
2799
+ d("--checkbox-box-background", "theme", "checkbox", "background", "Unchecked checkbox box", "--input-background"),
2800
+ d("--checkbox-box-background-checked", "theme", "checkbox", "background", "Checked checkbox box", "--selection-background"),
2801
+ d("--checkbox-box-border", "theme", "checkbox", "border", "Checkbox box border", "--input-border"),
2802
+ d("--checkbox-symbol-color", "theme", "checkbox", "color", "Checkbox symbol", "--selection-color"),
2803
+ d("--radio-background", "theme", "radio", "background", "Radio/toggle option surface", "--toggle-button-background"),
2804
+ d("--radio-background-checked", "theme", "radio", "background", "Selected radio/toggle option", "--selection-background"),
2805
+ d("--toolbar-background", "theme", "toolbar", "background", "Toolbar surface", "--panel-background"),
2806
+ d("--toolbar-color", "theme", "toolbar", "color", "Toolbar content", "--panel-color"),
2807
+ d("--toolbar-border", "theme", "toolbar", "border", "Toolbar border", "--panel-border"),
2808
+ d("--toolbar-shadow", "theme", "toolbar", "shadow", "Toolbar shadow", "--panel-shadow"),
2809
+ d("--tabline-background", "theme", "tabs", "background", "Tab strip surface", "--panel-background"),
2810
+ d("--tab-active-background", "theme", "tabs", "background", "Active tab surface", "--panel-background"),
2811
+ d("--progress-track-background", "theme", "progress", "background", "Progress track"),
2812
+ d("--progress-value-background", "theme", "progress", "background", "Progress value"),
2813
+ d("--working-background-image", "theme", "status", "background", "Indeterminate/loading texture"),
2814
+ d("--colored-base", "theme", "colored", "color", "Colored-trait base color", "--palette-primary"),
2815
+ d("--colored-light", "theme", "colored", "color", "Colored-trait light color", "--palette-primary-light"),
2816
+ d("--colored-dark", "theme", "colored", "color", "Colored-trait dark color", "--palette-primary-dark"),
2817
+ d("--colored-contrast", "theme", "colored", "color", "Colored-trait foreground", "--palette-contrast-light")
3026
2818
  ]), Yt = Object.freeze([
3027
- R("iceblue", "Ice blue", N("colors/iceblue/colors.css")),
3028
- R("ocean", "Ocean", N("colors/ocean/colors.css")),
3029
- R("green", "Green", N("colors/green/colors.css")),
3030
- R("gray", "Gray", N("colors/gray/colors.css")),
3031
- R("orange", "Orange", N("colors/orange/colors.css")),
3032
- R("purple", "Purple", N("colors/purple/colors.css")),
3033
- R("red", "Red", N("colors/red/colors.css")),
3034
- R("yellow", "Yellow", N("colors/yellow/colors.css"))
2819
+ N("shiny", "Shiny", $("themes/shiny/theme.css")),
2820
+ N("java", "Java", $("themes/java/theme.css")),
2821
+ N("minimal", "Minimal", $("themes/minimal/theme.css"))
2822
+ ]), Xt = Object.freeze([
2823
+ N("iceblue", "Ice blue", $("colors/iceblue/colors.css")),
2824
+ N("ocean", "Ocean", $("colors/ocean/colors.css")),
2825
+ N("green", "Green", $("colors/green/colors.css")),
2826
+ N("gray", "Gray", $("colors/gray/colors.css")),
2827
+ N("orange", "Orange", $("colors/orange/colors.css")),
2828
+ N("purple", "Purple", $("colors/purple/colors.css")),
2829
+ N("red", "Red", $("colors/red/colors.css")),
2830
+ N("yellow", "Yellow", $("colors/yellow/colors.css"))
3035
2831
  ]);
3036
- function _t(t, r, e = globalThis.document) {
3037
- if (Xt(r), (e == null ? void 0 : e.head) == null || e.documentElement == null)
2832
+ function Zt(t, r, e = globalThis.document) {
2833
+ if (er(r), (e == null ? void 0 : e.head) == null || e.documentElement == null)
3038
2834
  throw new TypeError("replaceFrayStylesheet requires a document with a head and root");
3039
- const a = `link[data-fray-stylesheet="${t}"]`;
3040
- let i = e.head.querySelector(a);
3041
- return i == null && (i = e.createElement("link"), i.rel = "stylesheet", i.dataset.frayStylesheet = t, e.head.append(i)), i.dataset.fraySelection = r.value, i.getAttribute("href") !== r.href && i.setAttribute("href", r.href), t === "theme" ? e.documentElement.dataset.frayTheme = r.value : e.documentElement.dataset.frayColor = r.value, i;
2835
+ const i = `link[data-fray-stylesheet="${t}"]`;
2836
+ let s = e.head.querySelector(i);
2837
+ return s == null && (s = e.createElement("link"), s.rel = "stylesheet", s.dataset.frayStylesheet = t, e.head.append(s)), s.dataset.fraySelection = r.value, s.getAttribute("href") !== r.href && s.setAttribute("href", r.href), t === "theme" ? e.documentElement.dataset.theme = r.value : e.documentElement.dataset.color = r.value, s;
3042
2838
  }
3043
- function ae(t, r) {
3044
- const e = t.find((a) => a.value === r);
2839
+ function re(t, r) {
2840
+ const e = t.find((i) => i.value === r);
3045
2841
  if (e == null) throw new RangeError(`Unknown Fray stylesheet selection: ${r}`);
3046
2842
  return e;
3047
2843
  }
3048
- function c(t, r, e, a, i, n) {
3049
- return n == null ? Object.freeze({ name: t, layer: r, family: e, value: a, description: i }) : Object.freeze({ name: t, layer: r, family: e, value: a, description: i, fallback: n });
2844
+ function d(t, r, e, i, s, n) {
2845
+ return n == null ? Object.freeze({ name: t, layer: r, family: e, value: i, description: s }) : Object.freeze({ name: t, layer: r, family: e, value: i, description: s, fallback: n });
2846
+ }
2847
+ function me(t) {
2848
+ return [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].map((r) => {
2849
+ var e;
2850
+ return d(
2851
+ `--palette-${t}-${r}`,
2852
+ "palette",
2853
+ t,
2854
+ "color",
2855
+ `${(e = t[0]) == null ? void 0 : e.toUpperCase()}${t.slice(1)} palette stop ${r}`
2856
+ );
2857
+ });
3050
2858
  }
3051
- function R(t, r, e) {
2859
+ function N(t, r, e) {
3052
2860
  return Object.freeze({ value: t, label: r, href: e });
3053
2861
  }
3054
- function N(t) {
2862
+ function $(t) {
3055
2863
  const r = import.meta.url.includes("/src/styling/") ? `../../${t}` : `../${t}`;
3056
2864
  return new URL(r, import.meta.url).href;
3057
2865
  }
3058
- function Xt(t) {
2866
+ function er(t) {
3059
2867
  if (t == null || typeof t != "object")
3060
2868
  throw new TypeError("Fray stylesheet selection must be an option");
3061
2869
  for (const r of ["value", "label", "href"])
3062
2870
  if (typeof Reflect.get(t, r) != "string" || String(Reflect.get(t, r)).length === 0)
3063
2871
  throw new TypeError(`Fray stylesheet option ${r} must be a non-empty string`);
3064
2872
  }
3065
- class oe extends g {
3066
- constructor(e, a, i) {
2873
+ class oe extends y {
2874
+ constructor(e, i, s) {
3067
2875
  var l;
3068
2876
  super(e);
3069
- s(this, "valueEmitter");
3070
- s(this, "inputId");
3071
- s(this, "kind");
3072
- s(this, "defaults");
3073
- const n = e.options ?? i;
3074
- Me(n);
3075
- const o = (l = n[0]) == null ? void 0 : l.value;
3076
- if (o == null) throw new TypeError(`${a} picker requires at least one option`);
3077
- this.kind = a, this.defaults = i, this.inputId = j(`${a}-picker`, e.id), this.valueEmitter = M(this, e, o, `${a} selection`), ae(n, this.valueEmitter.get());
2877
+ o(this, "valueEmitter");
2878
+ o(this, "inputId");
2879
+ o(this, "kind");
2880
+ o(this, "defaults");
2881
+ const n = e.options ?? s;
2882
+ ze(n);
2883
+ const a = (l = n[0]) == null ? void 0 : l.value;
2884
+ if (a == null) throw new TypeError(`${i} picker requires at least one option`);
2885
+ this.kind = i, this.defaults = s, this.inputId = F(`${i}-picker`, e.id), this.valueEmitter = z(this, e, a, `${i} selection`), re(n, this.valueEmitter.get());
3078
2886
  }
3079
2887
  initialize() {
3080
2888
  this.watch(this.valueEmitter);
3081
2889
  }
3082
2890
  render() {
3083
- const e = this.options, a = ae(e, this.valueEmitter.get()), { label: i, ariaLabel: n, disabled: o = !1, onChange: l } = this.props, d = this.Host;
2891
+ const e = this.options, i = re(e, this.valueEmitter.get()), { label: s, ariaLabel: n, disabled: a = !1, onChange: l } = this.props, c = this.Host;
3084
2892
  return /* @__PURE__ */ w(
3085
- d,
2893
+ c,
3086
2894
  {
3087
- className: E(this.props) || null,
2895
+ className: R("selectshell", E(this.props)),
3088
2896
  "data-kind": this.kind,
3089
- "data-disabled": o ? "" : null,
2897
+ "data-disabled": a ? "" : null,
3090
2898
  children: [
3091
- i == null ? null : /* @__PURE__ */ u("label", { htmlFor: this.inputId, children: i }),
2899
+ s == null ? null : /* @__PURE__ */ u("label", { htmlFor: this.inputId, children: s }),
3092
2900
  /* @__PURE__ */ u(
3093
2901
  "select",
3094
2902
  {
3095
2903
  id: this.inputId,
3096
- "data-part": "control",
3097
- value: a.value,
3098
- disabled: o,
3099
- "aria-label": i == null ? n : null,
2904
+ value: i.value,
2905
+ disabled: a,
2906
+ "aria-label": s == null ? n : null,
3100
2907
  onChange: (h) => {
3101
- const f = Zt(h), p = ae(e, f);
3102
- this.valueEmitter.set(f, `${this.kind} selected`), C(l, f, p, h);
2908
+ const p = tr(h), f = re(e, p);
2909
+ this.valueEmitter.set(p, `${this.kind} selected`), K(l, p, f, h);
3103
2910
  },
3104
2911
  children: e.map((h) => /* @__PURE__ */ u(
3105
2912
  "option",
3106
2913
  {
3107
2914
  value: h.value,
3108
- selected: h.value === a.value,
2915
+ selected: h.value === i.value,
3109
2916
  children: h.label
3110
2917
  },
3111
2918
  h.value
@@ -3124,23 +2931,21 @@ class oe extends g {
3124
2931
  }
3125
2932
  get options() {
3126
2933
  const e = this.props.options ?? this.defaults;
3127
- return Me(e), e;
2934
+ return ze(e), e;
3128
2935
  }
3129
2936
  applySelection() {
3130
2937
  const e = this.props.targetDocument ?? (typeof document > "u" ? null : document);
3131
- e != null && _t(
2938
+ e != null && Zt(
3132
2939
  this.kind,
3133
- ae(this.options, this.valueEmitter.get()),
2940
+ re(this.options, this.valueEmitter.get()),
3134
2941
  e
3135
2942
  );
3136
2943
  }
3137
2944
  }
3138
- s(oe, "baseStyles", [
2945
+ o(oe, "baseStyles", [
3139
2946
  ["&", ["labeledinput", "inputline"]],
3140
- ["& > label", ["label"]],
3141
- ["& > select", ["input", "inputline"]],
3142
- ["&[data-disabled]", ["disabled"]]
3143
- ]), s(oe, "css", v`
2947
+ ["& > select", ["input", "inputline"]]
2948
+ ]), o(oe, "css", S`
3144
2949
  & {
3145
2950
  position: relative;
3146
2951
  }
@@ -3149,118 +2954,118 @@ s(oe, "baseStyles", [
3149
2954
  min-width: 8rem;
3150
2955
  }
3151
2956
  `);
3152
- class Fe extends oe {
2957
+ class He extends oe {
3153
2958
  constructor(r = {}) {
3154
- super(r, "theme", Jt);
2959
+ super(r, "theme", Yt);
3155
2960
  }
3156
2961
  }
3157
- s(Fe, "hostName", "theme-picker"), s(Fe, "standaloneHostName", "theme-picker");
3158
- class He extends oe {
2962
+ o(He, "hostName", "theme-picker"), o(He, "standaloneHostName", "theme-picker");
2963
+ class Me extends oe {
3159
2964
  constructor(r = {}) {
3160
- super(r, "colors", Yt);
2965
+ super(r, "colors", Xt);
3161
2966
  }
3162
2967
  }
3163
- s(He, "hostName", "color-picker"), s(He, "standaloneHostName", "color-picker");
3164
- function Me(t) {
2968
+ o(Me, "hostName", "color-picker"), o(Me, "standaloneHostName", "color-picker");
2969
+ function ze(t) {
3165
2970
  if (!Array.isArray(t) || t.length === 0)
3166
2971
  throw new TypeError("Stylesheet picker options must be a non-empty array");
3167
2972
  const r = /* @__PURE__ */ new Set();
3168
2973
  for (const e of t) {
3169
2974
  if (e == null || typeof e != "object")
3170
2975
  throw new TypeError("Stylesheet picker options must be objects");
3171
- for (const a of ["value", "label", "href"])
3172
- if (typeof e[a] != "string" || e[a].length === 0)
3173
- throw new TypeError(`Stylesheet picker option ${a} must be a string`);
2976
+ for (const i of ["value", "label", "href"])
2977
+ if (typeof e[i] != "string" || e[i].length === 0)
2978
+ throw new TypeError(`Stylesheet picker option ${i} must be a string`);
3174
2979
  if (r.has(e.value))
3175
2980
  throw new Error(`Duplicate stylesheet picker value: ${e.value}`);
3176
2981
  r.add(e.value);
3177
2982
  }
3178
2983
  }
3179
- function Zt(t) {
2984
+ function tr(t) {
3180
2985
  const r = t.currentTarget == null ? null : Reflect.get(t.currentTarget, "value");
3181
2986
  if (typeof r != "string")
3182
2987
  throw new TypeError("Stylesheet picker change requires a select element");
3183
2988
  return r;
3184
2989
  }
3185
2990
  export {
3186
- Be as BaseSelectionHandler,
3187
- se as Button,
2991
+ Ge as BaseSelectionHandler,
2992
+ ne as Button,
3188
2993
  D as Checkbox,
3189
- He as ColorPicker,
3190
- g as Component,
2994
+ Me as ColorPicker,
2995
+ y as Component,
3191
2996
  X as DataTable,
3192
- St as DefaultTableFilterEncoding,
3193
- Ue as DescriptionItem,
3194
- Te as DescriptionList,
2997
+ xt as DefaultTableFilterEncoding,
2998
+ Pe as DescriptionItem,
2999
+ Re as DescriptionList,
3195
3000
  Oe as Dialog,
3196
3001
  ee as Dropdown,
3197
- y as FilterMode,
3198
- V as FilterPanel,
3199
- pr as Fragment,
3200
- mr as FrayRuntime,
3201
- G as ListView,
3202
- st as MultiSelectionHandler,
3203
- _ as Panel,
3204
- H as Placeholder,
3205
- he as ProgressBar,
3206
- $e as QuadCheckbox,
3207
- br as ServiceScope,
3208
- xe as Sidebar,
3209
- ge as SingleSelectionHandler,
3210
- ce as SplitView,
3211
- yr as StyleRegistry,
3212
- ze as Tab,
3213
- L as TabLine,
3214
- J as TabPanel,
3215
- me as TableHeader,
3216
- W as TableHeaderCell,
3002
+ b as FilterMode,
3003
+ U as FilterPanel,
3004
+ br as Fragment,
3005
+ gr as FrayRuntime,
3006
+ Q as ListView,
3007
+ lt as MultiSelectionHandler,
3008
+ ce as Panel,
3009
+ M as Placeholder,
3010
+ pe as ProgressBar,
3011
+ Ce as QuadCheckbox,
3012
+ yr as ServiceScope,
3013
+ st as Sidebar,
3014
+ Ee as SingleSelectionHandler,
3015
+ de as SplitView,
3016
+ wr as StyleRegistry,
3017
+ qe as Tab,
3018
+ V as TabLine,
3019
+ _ as TabPanel,
3020
+ ge as TableHeader,
3021
+ J as TableHeaderCell,
3217
3022
  te as Textbox,
3218
- Fe as ThemePicker,
3023
+ He as ThemePicker,
3219
3024
  Ae as Toggle,
3220
- re as Toolbar,
3221
- We as TreeItem,
3025
+ he as Toolbar,
3026
+ Je as TreeItem,
3222
3027
  Z as TreeView,
3223
- Ce as TriCheckbox,
3224
- It as applyLocalTableState,
3225
- Ge as assertSort,
3226
- P as assertTreeNodes,
3227
- gr as createFrayRuntime,
3228
- Ot as createHandlerTableDataSource,
3229
- Dt as createLocalTableDataSource,
3230
- or as createQueryTableDataSource,
3231
- $t as createRestTableDataSource,
3232
- ne as createSelectionHandler,
3233
- wr as createServiceScope,
3234
- Er as createStyleRegistry,
3235
- v as css,
3236
- vr as defaultFrayRuntime,
3237
- we as defaultItemKey,
3238
- Sr as defineService,
3239
- ar as deriveFilterPredicate,
3240
- ir as deriveFilteredItems,
3241
- dr as deriveTreeNode,
3242
- it as filterByState,
3243
- ae as findFrayStylesheetOption,
3244
- lr as findTreeNode,
3245
- Yt as frayColorOptions,
3246
- Jt as frayThemeOptions,
3247
- ur as frayThemeVariableCatalog,
3248
- kr as h,
3249
- de as isFilterMode,
3028
+ Ke as TriCheckbox,
3029
+ Tt as applyLocalTableState,
3030
+ Qe as assertSort,
3031
+ B as assertTreeNodes,
3032
+ Er as createFrayRuntime,
3033
+ Ct as createHandlerTableDataSource,
3034
+ Ot as createLocalTableDataSource,
3035
+ cr as createQueryTableDataSource,
3036
+ Kt as createRestTableDataSource,
3037
+ se as createSelectionHandler,
3038
+ Sr as createServiceScope,
3039
+ Ir as createStyleRegistry,
3040
+ S as css,
3041
+ kr as defaultFrayRuntime,
3042
+ Se as defaultItemKey,
3043
+ xr as defineService,
3044
+ nr as deriveFilterPredicate,
3045
+ or as deriveFilteredItems,
3046
+ ur as deriveTreeNode,
3047
+ ot as filterByState,
3048
+ re as findFrayStylesheetOption,
3049
+ dr as findTreeNode,
3050
+ Xt as frayColorOptions,
3051
+ Yt as frayThemeOptions,
3052
+ pr as frayThemeVariableCatalog,
3053
+ vr as h,
3054
+ le as isFilterMode,
3250
3055
  u as jsx,
3251
- Ir as jsxDEV,
3056
+ Tr as jsxDEV,
3252
3057
  w as jsxs,
3253
- xr as live,
3254
- Pe as matchesFilterState,
3255
- sr as parseFilterState,
3256
- Tr as provideService,
3257
- _t as replaceFrayStylesheet,
3258
- nr as serializeFilterState,
3259
- kt as serializeTableQuery,
3260
- Rr as styleRegistry,
3261
- qe as tabButtonId,
3262
- Le as tabPanelId,
3263
- Mt as updateTreeNode,
3264
- cr as updateWritableTreeNode
3058
+ Rr as live,
3059
+ Be as matchesFilterState,
3060
+ lr as parseFilterState,
3061
+ Nr as provideService,
3062
+ Zt as replaceFrayStylesheet,
3063
+ ar as serializeFilterState,
3064
+ vt as serializeTableQuery,
3065
+ $r as styleRegistry,
3066
+ Le as tabButtonId,
3067
+ Ve as tabPanelId,
3068
+ qt as updateTreeNode,
3069
+ hr as updateWritableTreeNode
3265
3070
  };
3266
3071
  //# sourceMappingURL=index.js.map