@sylwellsoftware/fray 0.1.0-alpha.1 → 0.2.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 (44) hide show
  1. package/README.md +246 -11
  2. package/colors/README.md +15 -0
  3. package/colors/gray/colors.css +29 -0
  4. package/colors/green/colors.css +29 -0
  5. package/colors/iceblue/colors.css +29 -0
  6. package/colors/ocean/colors.css +29 -0
  7. package/colors/orange/colors.css +29 -0
  8. package/colors/purple/colors.css +29 -0
  9. package/colors/red/colors.css +29 -0
  10. package/colors/yellow/colors.css +29 -0
  11. package/dist/Components/data/table/DataTable.d.ts.map +1 -1
  12. package/dist/Components/data/table/TableHeaderCell.d.ts.map +1 -1
  13. package/dist/Components/dialog/dialog.d.ts.map +1 -1
  14. package/dist/Components/layout/panel.d.ts.map +1 -1
  15. package/dist/Components/layout/tabpanel/tabline.d.ts.map +1 -1
  16. package/dist/Components/lineinputs/checkbox/Checkbox.d.ts.map +1 -1
  17. package/dist/Components/lineinputs/toggle.d.ts.map +1 -1
  18. package/dist/Components/status/progressBar.d.ts.map +1 -1
  19. package/dist/Components/theme/stylesheetPicker.d.ts +40 -0
  20. package/dist/Components/theme/stylesheetPicker.d.ts.map +1 -0
  21. package/dist/{button-BRDkmR1C.js → button-CqDGmkBt.js} +87 -78
  22. package/dist/{button-BRDkmR1C.js.map → button-CqDGmkBt.js.map} +1 -1
  23. package/dist/experimental.js +104 -66
  24. package/dist/experimental.js.map +1 -1
  25. package/dist/index.d.ts +2 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +801 -503
  28. package/dist/index.js.map +1 -1
  29. package/dist/{jsx-dev-runtime-CarwHDyL.js → jsx-dev-runtime-DukiDpV9.js} +202 -214
  30. package/dist/jsx-dev-runtime-DukiDpV9.js.map +1 -0
  31. package/dist/jsx-dev-runtime.js +1 -1
  32. package/dist/jsx-runtime.js +1 -1
  33. package/dist/styling/baseStyleDefinitions.d.ts +3 -0
  34. package/dist/styling/baseStyleDefinitions.d.ts.map +1 -1
  35. package/dist/styling/styleRegistry.d.ts.map +1 -1
  36. package/dist/styling/theme.d.ts +27 -0
  37. package/dist/styling/theme.d.ts.map +1 -0
  38. package/package.json +13 -5
  39. package/styles/structural.css +916 -0
  40. package/themes/README.md +84 -30
  41. package/themes/java/theme.css +140 -0
  42. package/themes/minimal/theme.css +128 -0
  43. package/themes/shiny/theme.css +314 -0
  44. package/dist/jsx-dev-runtime-CarwHDyL.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,163 +1,167 @@
1
- var nt = Object.defineProperty;
2
- var st = (n, s, t) => s in n ? nt(n, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[s] = t;
3
- var a = (n, s, t) => st(n, typeof s != "symbol" ? s + "" : s, t);
4
- import { C as p, j as c, c as m, a as g, i as K } from "./jsx-dev-runtime-CarwHDyL.js";
5
- import { F as vt, b as yt, S as wt, d as Et, e as xt, f as It, h as Nt, g as St, l as Ht, s as Tt } from "./jsx-dev-runtime-CarwHDyL.js";
6
- import { a as T, i as H, c as b, b as x, C as Z, F as v, d as B } from "./button-BRDkmR1C.js";
7
- import { B as Rt } from "./button-BRDkmR1C.js";
8
- import { Emitter as ot } from "@sylwellsoftware/glue";
9
- class Q extends p {
1
+ var pe = Object.defineProperty;
2
+ var fe = (o, l, e) => l in o ? pe(o, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[l] = e;
3
+ var n = (o, l, e) => fe(o, typeof l != "symbol" ? l + "" : l, e);
4
+ import { C as b, j as u, c as m, a as v, i as J } from "./jsx-dev-runtime-DukiDpV9.js";
5
+ import { F as Re, b as $e, S as je, d as qe, e as Ce, f as Fe, h as Pe, g as Ve, l as De, s as Ue } from "./jsx-dev-runtime-DukiDpV9.js";
6
+ import { a as O, i as N, c as y, b as E, C as ne, F as x, d as G } from "./button-CqDGmkBt.js";
7
+ import { B as Le } from "./button-CqDGmkBt.js";
8
+ import { Emitter as me } from "@sylwellsoftware/glue";
9
+ class ie extends b {
10
10
  render() {
11
11
  return this.props.children ?? [];
12
12
  }
13
13
  }
14
- class I extends p {
15
- constructor(t = {}) {
16
- var e;
17
- super(t);
18
- a(this, "valueEmitter");
19
- a(this, "activeTabEmitter");
20
- const r = t.tabs ?? [];
21
- M(r);
22
- const i = { ...t };
23
- i.valueEmitter == null && t.activeTabEmitter != null && (i.valueEmitter = t.activeTabEmitter), i.defaultValue == null && t.initialActiveTabId != null && (i.defaultValue = t.initialActiveTabId), this.valueEmitter = T(
14
+ class T extends b {
15
+ constructor(e = {}) {
16
+ var i;
17
+ super(e);
18
+ n(this, "valueEmitter");
19
+ n(this, "activeTabEmitter");
20
+ const a = e.tabs ?? [];
21
+ Y(a);
22
+ const r = { ...e };
23
+ r.valueEmitter == null && e.activeTabEmitter != null && (r.valueEmitter = e.activeTabEmitter), r.defaultValue == null && e.initialActiveTabId != null && (r.defaultValue = e.initialActiveTabId), this.valueEmitter = O(
24
24
  this,
25
- i,
26
- ((e = r.find((l) => !l.disabled)) == null ? void 0 : e.id) ?? null,
25
+ r,
26
+ ((i = a.find((s) => !s.disabled)) == null ? void 0 : i.id) ?? null,
27
27
  "active tab"
28
28
  ), this.activeTabEmitter = this.valueEmitter;
29
29
  }
30
30
  initialize() {
31
31
  this.watch(this.valueEmitter);
32
32
  }
33
- selectTab(t, r = null) {
34
- t == null || t.disabled || (this.valueEmitter.set(t.id, "tab selected"), H(this.props.onChange, t.id, r));
33
+ selectTab(e, a = null) {
34
+ e == null || e.disabled || (this.valueEmitter.set(e.id, "tab selected"), N(this.props.onChange, e.id, a));
35
35
  }
36
36
  render() {
37
- const { tabs: t = [], label: r = "Sections", baseId: i = "fray-tabs" } = this.props;
38
- M(t);
39
- const e = this.valueEmitter.get(), l = this.Host;
40
- return /* @__PURE__ */ c(
41
- l,
37
+ const { tabs: e = [], label: a = "Sections", baseId: r = "fray-tabs" } = this.props;
38
+ Y(e);
39
+ const i = this.valueEmitter.get(), s = this.Host;
40
+ return /* @__PURE__ */ u(
41
+ s,
42
42
  {
43
43
  role: "tablist",
44
- className: b(this.props) || null,
45
- "aria-label": r,
46
- children: t.map((o, d) => /* @__PURE__ */ c(
44
+ className: y(this.props) || null,
45
+ "aria-label": a,
46
+ children: e.map((d, c) => /* @__PURE__ */ u(
47
47
  "button",
48
48
  {
49
- id: _(i, o.id),
49
+ id: le(r, d.id),
50
50
  type: "button",
51
51
  role: "tab",
52
- disabled: !!o.disabled,
52
+ disabled: !!d.disabled,
53
53
  "data-part": "tab",
54
- "aria-selected": Object.is(e, o.id) ? "true" : "false",
55
- "aria-controls": tt(i, o.id),
56
- tabIndex: Object.is(e, o.id) ? 0 : -1,
57
- onClick: (u) => this.selectTab(o, u),
58
- onKeyDown: (u) => this.handleKeyDown(u, d, t),
59
- children: o.label ?? String(o.id)
54
+ "aria-selected": Object.is(i, d.id) ? "true" : "false",
55
+ "aria-controls": se(r, d.id),
56
+ tabIndex: Object.is(i, d.id) ? 0 : -1,
57
+ onClick: (h) => this.selectTab(d, h),
58
+ onKeyDown: (h) => this.handleKeyDown(h, c, e),
59
+ children: d.label ?? String(d.id)
60
60
  },
61
- String(o.id)
61
+ String(d.id)
62
62
  ))
63
63
  }
64
64
  );
65
65
  }
66
- handleKeyDown(t, r, i) {
67
- const e = i.map((d, u) => ({ tab: d, tabIndex: u })).filter(({ tab: d }) => !d.disabled);
68
- if (e.length === 0) return;
69
- const l = Math.max(
66
+ handleKeyDown(e, a, r) {
67
+ const i = r.map((c, h) => ({ tab: c, tabIndex: h })).filter(({ tab: c }) => !c.disabled);
68
+ if (i.length === 0) return;
69
+ const s = Math.max(
70
70
  0,
71
- e.findIndex(({ tabIndex: d }) => d === r)
71
+ i.findIndex(({ tabIndex: c }) => c === a)
72
72
  );
73
- let o;
74
- if (t.key === "ArrowRight" || t.key === "ArrowDown")
75
- o = e[(l + 1) % e.length];
76
- else if (t.key === "ArrowLeft" || t.key === "ArrowUp")
77
- o = e[(l - 1 + e.length) % e.length];
78
- else if (t.key === "Home") o = e[0];
79
- else if (t.key === "End") o = e.at(-1);
73
+ let d;
74
+ if (e.key === "ArrowRight" || e.key === "ArrowDown")
75
+ d = i[(s + 1) % i.length];
76
+ else if (e.key === "ArrowLeft" || e.key === "ArrowUp")
77
+ d = i[(s - 1 + i.length) % i.length];
78
+ else if (e.key === "Home") d = i[0];
79
+ else if (e.key === "End") d = i.at(-1);
80
80
  else return;
81
- if (o != null && (t.preventDefault(), this.selectTab(o.tab, t), this.dom instanceof Element)) {
82
- const d = this.dom.querySelectorAll('[role="tab"]')[o.tabIndex];
83
- d == null || d.focus();
81
+ if (d != null && (e.preventDefault(), this.selectTab(d.tab, e), this.dom instanceof Element)) {
82
+ const c = this.dom.querySelectorAll('[role="tab"]')[d.tabIndex];
83
+ c == null || c.focus();
84
84
  }
85
85
  }
86
86
  }
87
- a(I, "hostName", "tab-line"), a(I, "standaloneHostName", "tab-line"), a(I, "baseStyles", [
87
+ n(T, "hostName", "tab-line"), n(T, "standaloneHostName", "tab-line"), n(T, "baseStyles", [
88
88
  ['& > [data-part="tab"]', ["uiline", "button"]]
89
- ]), a(I, "css", m`
89
+ ]), n(T, "css", m`
90
90
  & {
91
91
  display: flex;
92
92
  flex-flow: row wrap;
93
93
  padding-top: 3px;
94
- background: var(--tabline-bg, #f5f5f5);
94
+ background: var(--fray-tabline-background, var(--tabline-bg));
95
95
  }
96
96
 
97
97
  & > [data-part="tab"] {
98
- border-radius: var(--ui-border-radius) var(--ui-border-radius) 0 0;
98
+ background: var(--fray-tab-button-background, var(--fray-button-background));
99
+ border-radius: var(--fray-radius-md, var(--ui-border-radius)) var(--fray-radius-md, var(--ui-border-radius)) 0 0;
99
100
  }
100
101
 
101
102
  & > [data-part="tab"][aria-selected="true"] {
102
- background: var(--tab-bg-active, var(--panel-bg, #fff));
103
+ background: var(
104
+ --fray-tab-button-background-active,
105
+ var(--fray-tab-active-background, var(--tab-bg-active))
106
+ );
103
107
  }
104
108
  `);
105
- function _(n, s) {
106
- return `${n}-tab-${et(s)}`;
107
- }
108
- function tt(n, s) {
109
- return `${n}-panel-${et(s)}`;
110
- }
111
- function et(n) {
112
- return encodeURIComponent(String(n)).replaceAll("%", "-");
113
- }
114
- function M(n) {
115
- if (!Array.isArray(n)) throw new TypeError("TabLine tabs must be an array");
116
- const s = /* @__PURE__ */ new Set();
117
- for (const t of n) {
118
- if (t == null || t.id == null) throw new TypeError("Each tab requires an id");
119
- if (s.has(t.id)) throw new Error(`Duplicate tab id: ${String(t.id)}`);
120
- s.add(t.id);
121
- }
122
- }
123
- class z extends p {
124
- constructor(t = {}) {
125
- var e;
126
- super(t);
127
- a(this, "valueEmitter");
128
- a(this, "activeTabEmitter");
129
- a(this, "baseId");
130
- const r = O(t), i = { ...t };
131
- i.valueEmitter == null && t.activeTabEmitter != null && (i.valueEmitter = t.activeTabEmitter), i.defaultValue == null && t.initialActiveTabId != null && (i.defaultValue = t.initialActiveTabId), this.valueEmitter = T(
109
+ function le(o, l) {
110
+ return `${o}-tab-${de(l)}`;
111
+ }
112
+ function se(o, l) {
113
+ return `${o}-panel-${de(l)}`;
114
+ }
115
+ function de(o) {
116
+ return encodeURIComponent(String(o)).replaceAll("%", "-");
117
+ }
118
+ function Y(o) {
119
+ if (!Array.isArray(o)) throw new TypeError("TabLine tabs must be an array");
120
+ const l = /* @__PURE__ */ new Set();
121
+ for (const e of o) {
122
+ if (e == null || e.id == null) throw new TypeError("Each tab requires an id");
123
+ if (l.has(e.id)) throw new Error(`Duplicate tab id: ${String(e.id)}`);
124
+ l.add(e.id);
125
+ }
126
+ }
127
+ class $ extends b {
128
+ constructor(e = {}) {
129
+ var i;
130
+ super(e);
131
+ n(this, "valueEmitter");
132
+ n(this, "activeTabEmitter");
133
+ n(this, "baseId");
134
+ const a = j(e), r = { ...e };
135
+ r.valueEmitter == null && e.activeTabEmitter != null && (r.valueEmitter = e.activeTabEmitter), r.defaultValue == null && e.initialActiveTabId != null && (r.defaultValue = e.initialActiveTabId), this.valueEmitter = O(
132
136
  this,
133
- i,
134
- ((e = r.find((l) => !l.disabled)) == null ? void 0 : e.id) ?? null,
137
+ r,
138
+ ((i = a.find((s) => !s.disabled)) == null ? void 0 : i.id) ?? null,
135
139
  "active tab"
136
- ), this.activeTabEmitter = this.valueEmitter, this.baseId = x("tabs", t.id);
140
+ ), this.activeTabEmitter = this.valueEmitter, this.baseId = E("tabs", e.id);
137
141
  }
138
142
  initialize() {
139
- var r;
140
- const t = O(this.props);
141
- t.some(({ id: i }) => Object.is(i, this.valueEmitter.get())) || this.valueEmitter.set(((r = t.find((i) => !i.disabled)) == null ? void 0 : r.id) ?? null), this.watch(this.valueEmitter);
143
+ var a;
144
+ const e = j(this.props);
145
+ e.some(({ id: r }) => Object.is(r, this.valueEmitter.get())) || this.valueEmitter.set(((a = e.find((r) => !r.disabled)) == null ? void 0 : a.id) ?? null), this.watch(this.valueEmitter);
142
146
  }
143
- setProps(t) {
144
- var i;
145
- super.setProps(t);
146
- const r = O(t);
147
- return r.some(({ id: e }) => Object.is(e, this.valueEmitter.get())) || this.valueEmitter.set(((i = r.find((e) => !e.disabled)) == null ? void 0 : i.id) ?? null), this;
147
+ setProps(e) {
148
+ var r;
149
+ super.setProps(e);
150
+ const a = j(e);
151
+ return a.some(({ id: i }) => Object.is(i, this.valueEmitter.get())) || this.valueEmitter.set(((r = a.find((i) => !i.disabled)) == null ? void 0 : r.id) ?? null), this;
148
152
  }
149
153
  render() {
150
- const t = O(this.props), r = t.find(({ id: e }) => Object.is(e, this.valueEmitter.get())) ?? t.find((e) => !e.disabled) ?? null, i = this.Host;
151
- return /* @__PURE__ */ g(
152
- i,
154
+ const e = j(this.props), a = e.find(({ id: i }) => Object.is(i, this.valueEmitter.get())) ?? e.find((i) => !i.disabled) ?? null, r = this.Host;
155
+ return /* @__PURE__ */ v(
156
+ r,
153
157
  {
154
158
  id: this.baseId,
155
- className: b(this.props) || null,
159
+ className: y(this.props) || null,
156
160
  children: [
157
- /* @__PURE__ */ c(
158
- I,
161
+ /* @__PURE__ */ u(
162
+ T,
159
163
  {
160
- tabs: t.map(({ id: e, label: l, disabled: o }) => ({ id: e, label: l, disabled: o })),
164
+ tabs: e.map(({ id: i, label: s, disabled: d }) => ({ id: i, label: s, disabled: d })),
161
165
  valueEmitter: this.valueEmitter,
162
166
  baseId: this.baseId,
163
167
  ...this.props.label == null ? {} : { label: this.props.label },
@@ -165,33 +169,33 @@ class z extends p {
165
169
  },
166
170
  "tab-list"
167
171
  ),
168
- r == null ? null : /* @__PURE__ */ c(
172
+ a == null ? null : /* @__PURE__ */ u(
169
173
  "div",
170
174
  {
171
- id: tt(this.baseId, r.id),
175
+ id: se(this.baseId, a.id),
172
176
  role: "tabpanel",
173
177
  "data-part": "content",
174
- "aria-labelledby": _(this.baseId, r.id),
178
+ "aria-labelledby": le(this.baseId, a.id),
175
179
  tabIndex: 0,
176
- children: r.content
180
+ children: a.content
177
181
  },
178
- String(r.id)
182
+ String(a.id)
179
183
  )
180
184
  ]
181
185
  }
182
186
  );
183
187
  }
184
188
  }
185
- a(z, "dependencies", [I, Q]), a(z, "hostName", "tab-panel"), a(z, "standaloneHostName", "tab-panel"), a(z, "css", m`
189
+ n($, "dependencies", [T, ie]), n($, "hostName", "tab-panel"), n($, "standaloneHostName", "tab-panel"), n($, "css", m`
186
190
  & {
187
191
  display: flex;
188
192
  flex-direction: column;
189
193
  width: 100%;
190
194
  min-height: 0;
191
195
  overflow: hidden;
192
- background: var(--panel-bg, white);
193
- border-radius: var(--panel-radius, var(--ui-border-radius));
194
- box-shadow: var(--panel-shadow, none);
196
+ background: var(--fray-panel-background, var(--panel-bg, transparent));
197
+ border-radius: var(--fray-panel-radius, var(--panel-radius));
198
+ box-shadow: var(--fray-panel-shadow, var(--panel-shadow, none));
195
199
  }
196
200
 
197
201
  & > [data-part="content"] {
@@ -199,75 +203,75 @@ a(z, "dependencies", [I, Q]), a(z, "hostName", "tab-panel"), a(z, "standaloneHos
199
203
  flex-direction: column;
200
204
  flex: 1;
201
205
  overflow: auto;
202
- background: var(--panel-bg, white);
206
+ background: var(--fray-panel-background, var(--panel-bg, transparent));
203
207
  }
204
208
  `);
205
- function O(n) {
206
- const s = n.tabs ?? [];
207
- if (!Array.isArray(s)) throw new TypeError("TabPanel tabs must be an array");
208
- const r = (Array.isArray(n.children) ? n.children : n.children == null ? [] : [n.children]).filter((l) => K(l) && l.type === Q).map((l, o) => {
209
- if (!K(l)) throw new TypeError("TabPanel children must be Tab nodes");
210
- const d = l.props;
209
+ function j(o) {
210
+ const l = o.tabs ?? [];
211
+ if (!Array.isArray(l)) throw new TypeError("TabPanel tabs must be an array");
212
+ const a = (Array.isArray(o.children) ? o.children : o.children == null ? [] : [o.children]).filter((s) => J(s) && s.type === ie).map((s, d) => {
213
+ if (!J(s)) throw new TypeError("TabPanel children must be Tab nodes");
214
+ const c = s.props;
211
215
  return {
212
- id: d.id ?? `tab-${o + 1}`,
213
- label: d.label ?? `Tab ${o + 1}`,
214
- disabled: !!d.disabled,
215
- content: d.children ?? []
216
+ id: c.id ?? `tab-${d + 1}`,
217
+ label: c.label ?? `Tab ${d + 1}`,
218
+ disabled: !!c.disabled,
219
+ content: c.children ?? []
216
220
  };
217
- }), i = s.length > 0 ? s.map((l) => ({
218
- ...l,
219
- label: l.label ?? String(l.id),
220
- disabled: !!l.disabled,
221
- content: l.content ?? l.component ?? []
222
- })) : r, e = /* @__PURE__ */ new Set();
223
- for (const l of i) {
224
- if ((l == null ? void 0 : l.id) == null) throw new TypeError("Each tab requires an id");
225
- if (e.has(l.id)) throw new Error(`Duplicate tab id: ${String(l.id)}`);
226
- e.add(l.id);
227
- }
228
- return i;
229
- }
230
- class $ extends p {
231
- constructor(t = {}) {
232
- super(t);
233
- a(this, "panelId");
234
- a(this, "headerId");
235
- this.panelId = x("panel", t.id), this.headerId = `${this.panelId}-title`;
221
+ }), r = l.length > 0 ? l.map((s) => ({
222
+ ...s,
223
+ label: s.label ?? String(s.id),
224
+ disabled: !!s.disabled,
225
+ content: s.content ?? s.component ?? []
226
+ })) : a, i = /* @__PURE__ */ new Set();
227
+ for (const s of r) {
228
+ if ((s == null ? void 0 : s.id) == null) throw new TypeError("Each tab requires an id");
229
+ if (i.has(s.id)) throw new Error(`Duplicate tab id: ${String(s.id)}`);
230
+ i.add(s.id);
231
+ }
232
+ return r;
233
+ }
234
+ class q extends b {
235
+ constructor(e = {}) {
236
+ super(e);
237
+ n(this, "panelId");
238
+ n(this, "headerId");
239
+ this.panelId = E("panel", e.id), this.headerId = `${this.panelId}-title`;
236
240
  }
237
241
  render() {
238
242
  const {
239
- header: t = null,
240
- toolbar: r = null,
241
- children: i = [],
242
- orientation: e = "vertical",
243
- disabled: l = !1
243
+ header: e = null,
244
+ toolbar: a = null,
245
+ children: r = [],
246
+ orientation: i = "vertical",
247
+ disabled: s = !1
244
248
  } = this.props;
245
- if (!["horizontal", "vertical"].includes(e))
249
+ if (!["horizontal", "vertical"].includes(i))
246
250
  throw new TypeError("Panel orientation must be horizontal or vertical");
247
- const o = this.Host, d = t == null ? null : /* @__PURE__ */ c("header", { "data-part": "header", children: typeof t == "string" || typeof t == "number" ? /* @__PURE__ */ c("h2", { id: this.headerId, children: t }) : /* @__PURE__ */ c("div", { id: this.headerId, children: t }) });
248
- return /* @__PURE__ */ g(
249
- o,
251
+ const d = this.Host, c = 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 }) });
252
+ return /* @__PURE__ */ v(
253
+ d,
250
254
  {
251
255
  id: this.panelId,
252
- role: t == null ? null : "region",
253
- className: b(this.props) || null,
254
- "data-orientation": e,
255
- "data-disabled": l ? "" : null,
256
- "aria-disabled": l ? "true" : null,
257
- "aria-labelledby": t == null ? null : this.headerId,
256
+ role: e == null ? null : "region",
257
+ className: y(this.props) || null,
258
+ "data-orientation": i,
259
+ "data-disabled": s ? "" : null,
260
+ "aria-disabled": s ? "true" : null,
261
+ "aria-labelledby": e == null ? null : this.headerId,
258
262
  children: [
259
- d,
260
- r,
261
- /* @__PURE__ */ c("div", { "data-part": "content", "data-orientation": e, children: i })
263
+ c,
264
+ a,
265
+ /* @__PURE__ */ u("div", { "data-part": "content", "data-orientation": i, children: r })
262
266
  ]
263
267
  }
264
268
  );
265
269
  }
266
270
  }
267
- a($, "hostName", "panel"), a($, "standaloneHostName", "layout-panel"), a($, "baseStyles", [
271
+ n(q, "hostName", "panel"), n(q, "standaloneHostName", "layout-panel"), n(q, "baseStyles", [
268
272
  ["&", ["panel"]],
269
273
  ['& > [data-part="header"]', ["sectionheader"]]
270
- ]), a($, "css", m`
274
+ ]), n(q, "css", m`
271
275
  & {
272
276
  display: flex;
273
277
  flex-direction: column;
@@ -280,6 +284,19 @@ a($, "hostName", "panel"), a($, "standaloneHostName", "layout-panel"), a($, "bas
280
284
  font: inherit;
281
285
  }
282
286
 
287
+ & > [data-part="header"] {
288
+ background: var(
289
+ --fray-panel-header-background,
290
+ var(--fray-section-header-background, var(--fray-header-background))
291
+ );
292
+ color: var(
293
+ --fray-panel-header-color,
294
+ var(--fray-section-header-color, var(--fray-header-color))
295
+ );
296
+ border: var(--fray-section-header-border, var(--fray-header-border));
297
+ box-shadow: var(--fray-section-header-shadow, var(--fray-header-shadow));
298
+ }
299
+
283
300
  & > [data-part="content"] {
284
301
  display: flex;
285
302
  flex: 1;
@@ -296,41 +313,41 @@ a($, "hostName", "panel"), a($, "standaloneHostName", "layout-panel"), a($, "bas
296
313
  flex-direction: column;
297
314
  }
298
315
  `);
299
- class P extends p {
300
- constructor(t = {}) {
301
- super(t);
302
- a(this, "sidebarId");
303
- a(this, "headerId");
304
- this.sidebarId = x("sidebar", t.id), this.headerId = `${this.sidebarId}-title`;
316
+ class W extends b {
317
+ constructor(e = {}) {
318
+ super(e);
319
+ n(this, "sidebarId");
320
+ n(this, "headerId");
321
+ this.sidebarId = E("sidebar", e.id), this.headerId = `${this.sidebarId}-title`;
305
322
  }
306
323
  render() {
307
324
  const {
308
- header: t = null,
309
- toolbar: r = null,
310
- ariaLabel: i,
311
- children: e = []
312
- } = this.props, l = t == null ? null : /* @__PURE__ */ c("header", { "data-part": "header", children: typeof t == "string" || typeof t == "number" ? /* @__PURE__ */ c("h2", { id: this.headerId, children: t }) : /* @__PURE__ */ c("div", { id: this.headerId, children: t }) });
313
- return /* @__PURE__ */ g(
325
+ header: e = null,
326
+ toolbar: a = null,
327
+ ariaLabel: r,
328
+ children: i = []
329
+ } = this.props, s = 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 }) });
330
+ return /* @__PURE__ */ v(
314
331
  "aside",
315
332
  {
316
333
  id: this.sidebarId,
317
- className: b(this.props) || void 0,
334
+ className: y(this.props) || void 0,
318
335
  "data-fray-component": "sidebar",
319
- "aria-label": t == null ? i : null,
320
- "aria-labelledby": t == null ? null : this.headerId,
336
+ "aria-label": e == null ? r : null,
337
+ "aria-labelledby": e == null ? null : this.headerId,
321
338
  children: [
322
- l,
323
- r == null ? null : /* @__PURE__ */ c("div", { "data-part": "toolbar", children: r }),
324
- /* @__PURE__ */ c("div", { "data-part": "content", tabIndex: 0, children: e })
339
+ s,
340
+ a == null ? null : /* @__PURE__ */ u("div", { "data-part": "toolbar", children: a }),
341
+ /* @__PURE__ */ u("div", { "data-part": "content", tabIndex: 0, children: i })
325
342
  ]
326
343
  }
327
344
  );
328
345
  }
329
346
  }
330
- a(P, "baseStyles", [
347
+ n(W, "baseStyles", [
331
348
  ['aside[data-fray-component="sidebar"]', ["panel"]],
332
349
  ['aside[data-fray-component="sidebar"] > [data-part="header"]', ["sectionheader"]]
333
- ]), a(P, "css", m`
350
+ ]), n(W, "css", m`
334
351
  aside[data-fray-component="sidebar"] {
335
352
  display: flex;
336
353
  flex-direction: column;
@@ -357,44 +374,44 @@ a(P, "baseStyles", [
357
374
  overflow-y: auto;
358
375
  }
359
376
  `);
360
- class F extends p {
377
+ class L extends b {
361
378
  render() {
362
379
  const {
363
- primary: s = null,
364
- secondary: t = null,
365
- direction: r = "horizontal",
366
- primarySize: i,
367
- primaryLabel: e,
368
- secondaryLabel: l
380
+ primary: l = null,
381
+ secondary: e = null,
382
+ direction: a = "horizontal",
383
+ primarySize: r,
384
+ primaryLabel: i,
385
+ secondaryLabel: s
369
386
  } = this.props;
370
- if (r !== "horizontal" && r !== "vertical")
387
+ if (a !== "horizontal" && a !== "vertical")
371
388
  throw new TypeError("SplitView direction must be horizontal or vertical");
372
- if (i != null && (typeof i != "string" || i.length === 0))
389
+ if (r != null && (typeof r != "string" || r.length === 0))
373
390
  throw new TypeError("SplitView primarySize must be a non-empty CSS size");
374
- const o = this.Host;
375
- return /* @__PURE__ */ g(
376
- o,
391
+ const d = this.Host;
392
+ return /* @__PURE__ */ v(
393
+ d,
377
394
  {
378
- className: b(this.props) || null,
379
- "data-direction": r,
380
- style: i == null ? void 0 : { "--split-primary-size": i },
395
+ className: y(this.props) || null,
396
+ "data-direction": a,
397
+ style: r == null ? void 0 : { "--split-primary-size": r },
381
398
  children: [
382
- /* @__PURE__ */ c(
399
+ /* @__PURE__ */ u(
383
400
  "div",
384
401
  {
385
402
  "data-part": "primary",
386
- role: e == null ? null : "region",
387
- "aria-label": e,
388
- children: s
403
+ role: i == null ? null : "region",
404
+ "aria-label": i,
405
+ children: l
389
406
  }
390
407
  ),
391
- /* @__PURE__ */ c(
408
+ /* @__PURE__ */ u(
392
409
  "div",
393
410
  {
394
411
  "data-part": "secondary",
395
- role: l == null ? null : "region",
396
- "aria-label": l,
397
- children: t ?? this.props.children ?? []
412
+ role: s == null ? null : "region",
413
+ "aria-label": s,
414
+ children: e ?? this.props.children ?? []
398
415
  }
399
416
  )
400
417
  ]
@@ -402,7 +419,7 @@ class F extends p {
402
419
  );
403
420
  }
404
421
  }
405
- a(F, "hostName", "split-view"), a(F, "standaloneHostName", "split-view"), a(F, "css", m`
422
+ n(L, "hostName", "split-view"), n(L, "standaloneHostName", "split-view"), n(L, "css", m`
406
423
  & {
407
424
  display: grid;
408
425
  flex: 1 1 auto;
@@ -437,23 +454,23 @@ a(F, "hostName", "split-view"), a(F, "standaloneHostName", "split-view"), a(F, "
437
454
  border-block-end: 1px solid var(--ui-border-color);
438
455
  }
439
456
  `);
440
- class at extends p {
457
+ class ce extends b {
441
458
  render() {
442
- const { term: s, value: t, children: r = [] } = this.props;
443
- return /* @__PURE__ */ g(
459
+ const { term: l, value: e, children: a = [] } = this.props;
460
+ return /* @__PURE__ */ v(
444
461
  "div",
445
462
  {
446
- className: b(this.props) || void 0,
463
+ className: y(this.props) || void 0,
447
464
  "data-fray-component": "description-item",
448
465
  children: [
449
- /* @__PURE__ */ c("dt", { children: s }),
450
- /* @__PURE__ */ c("dd", { children: t ?? r })
466
+ /* @__PURE__ */ u("dt", { children: l }),
467
+ /* @__PURE__ */ u("dd", { children: e ?? a })
451
468
  ]
452
469
  }
453
470
  );
454
471
  }
455
472
  }
456
- a(at, "css", m`
473
+ n(ce, "css", m`
457
474
  div[data-fray-component="description-item"] {
458
475
  display: grid;
459
476
  grid-template-columns: minmax(7rem, 0.7fr) minmax(0, 1.3fr);
@@ -480,12 +497,12 @@ a(at, "css", m`
480
497
  }
481
498
  }
482
499
  `);
483
- class U extends p {
500
+ class X extends b {
484
501
  render() {
485
- return /* @__PURE__ */ c(
502
+ return /* @__PURE__ */ u(
486
503
  "dl",
487
504
  {
488
- className: b(this.props) || void 0,
505
+ className: y(this.props) || void 0,
489
506
  "data-fray-component": "description-list",
490
507
  "aria-label": this.props.label,
491
508
  children: this.props.children ?? []
@@ -493,119 +510,119 @@ class U extends p {
493
510
  );
494
511
  }
495
512
  }
496
- a(U, "dependencies", [at]), a(U, "css", m`
513
+ n(X, "dependencies", [ce]), n(X, "css", m`
497
514
  dl[data-fray-component="description-list"] {
498
515
  display: grid;
499
516
  margin: 0;
500
517
  }
501
518
  `);
502
- const w = class w extends Z {
503
- constructor(s = {}) {
504
- super({ ...s, symbols: w.symbols });
519
+ const I = class I extends ne {
520
+ constructor(l = {}) {
521
+ super({ ...l, symbols: I.symbols });
505
522
  }
506
523
  };
507
- a(w, "hostName", "quad-checkbox"), a(w, "standaloneHostName", "quad-checkbox"), a(w, "symbols", [
508
- ["✖", v.Deny],
509
- ["☐", v.Neutral],
510
- ["✓", v.Prefer],
511
- ["+", v.Require]
512
- ]), a(w, "defaultSemanticState", v.Neutral);
513
- let G = w;
514
- const E = class E extends Z {
515
- constructor(s = {}) {
516
- super({ ...s, symbols: E.symbols });
524
+ n(I, "hostName", "quad-checkbox"), n(I, "standaloneHostName", "quad-checkbox"), n(I, "symbols", [
525
+ ["✖", x.Deny],
526
+ ["☐", x.Neutral],
527
+ ["✓", x.Prefer],
528
+ ["+", x.Require]
529
+ ]), n(I, "defaultSemanticState", x.Neutral);
530
+ let Z = I;
531
+ const S = class S extends ne {
532
+ constructor(l = {}) {
533
+ super({ ...l, symbols: S.symbols });
517
534
  }
518
535
  };
519
- a(E, "hostName", "tri-checkbox"), a(E, "standaloneHostName", "tri-checkbox"), a(E, "symbols", [
520
- ["✖", v.Deny],
521
- ["☐", v.Neutral],
522
- ["✓", v.Prefer]
523
- ]), a(E, "defaultSemanticState", v.Neutral);
524
- let J = E;
525
- class j extends p {
526
- constructor(t = {}) {
527
- var e;
528
- super(t);
529
- a(this, "inputId");
530
- a(this, "errorId");
531
- a(this, "optionsEmitter");
532
- a(this, "valueEmitter");
533
- a(this, "ownsOptionsEmitter");
534
- this.inputId = x("dropdown", t.id), this.errorId = `${this.inputId}-error`;
535
- const r = t.options ?? [];
536
- dt(r) ? (this.optionsEmitter = r, this.ownsOptionsEmitter = !1) : (B(r), this.optionsEmitter = new ot(r, {
536
+ n(S, "hostName", "tri-checkbox"), n(S, "standaloneHostName", "tri-checkbox"), n(S, "symbols", [
537
+ ["✖", x.Deny],
538
+ ["☐", x.Neutral],
539
+ ["✓", x.Prefer]
540
+ ]), n(S, "defaultSemanticState", x.Neutral);
541
+ let Q = S;
542
+ class C extends b {
543
+ constructor(e = {}) {
544
+ var i;
545
+ super(e);
546
+ n(this, "inputId");
547
+ n(this, "errorId");
548
+ n(this, "optionsEmitter");
549
+ n(this, "valueEmitter");
550
+ n(this, "ownsOptionsEmitter");
551
+ this.inputId = E("dropdown", e.id), this.errorId = `${this.inputId}-error`;
552
+ const a = e.options ?? [];
553
+ ye(a) ? (this.optionsEmitter = a, this.ownsOptionsEmitter = !1) : (G(a), this.optionsEmitter = new me(a, {
537
554
  owner: this,
538
555
  purpose: "dropdown options"
539
556
  }), this.ownsOptionsEmitter = !0);
540
- const i = ((e = this.optionsEmitter.get()[0]) == null ? void 0 : e.value) ?? "";
541
- this.valueEmitter = T(this, t, i, "dropdown value");
557
+ const r = ((i = this.optionsEmitter.get()[0]) == null ? void 0 : i.value) ?? "";
558
+ this.valueEmitter = O(this, e, r, "dropdown value");
542
559
  }
543
560
  initialize() {
544
561
  this.watch(this.valueEmitter, this.optionsEmitter);
545
562
  }
546
563
  render() {
547
564
  const {
548
- label: t,
549
- name: r,
550
- disabled: i = !1,
551
- required: e = !1,
552
- error: l = null,
553
- placeholder: o = "Select…",
554
- ariaLabel: d,
555
- onChange: u
556
- } = this.props, y = this.optionsEmitter.get() ?? [];
557
- B(y);
558
- const f = this.valueEmitter.get(), k = this.Host;
559
- return /* @__PURE__ */ g(
560
- k,
565
+ label: e,
566
+ name: a,
567
+ disabled: r = !1,
568
+ required: i = !1,
569
+ error: s = null,
570
+ placeholder: d = "Select…",
571
+ ariaLabel: c,
572
+ onChange: h
573
+ } = this.props, g = this.optionsEmitter.get() ?? [];
574
+ G(g);
575
+ const p = this.valueEmitter.get(), U = this.Host;
576
+ return /* @__PURE__ */ v(
577
+ U,
561
578
  {
562
- className: b(this.props) || null,
563
- "data-disabled": i ? "" : null,
564
- "data-required": e ? "" : null,
565
- "data-error": l == null ? null : "",
579
+ className: y(this.props) || null,
580
+ "data-disabled": r ? "" : null,
581
+ "data-required": i ? "" : null,
582
+ "data-error": s == null ? null : "",
566
583
  children: [
567
- t == null ? null : /* @__PURE__ */ c("label", { htmlFor: this.inputId, children: t }),
568
- /* @__PURE__ */ g(
584
+ e == null ? null : /* @__PURE__ */ u("label", { htmlFor: this.inputId, children: e }),
585
+ /* @__PURE__ */ v(
569
586
  "select",
570
587
  {
571
588
  id: this.inputId,
572
- name: r,
573
- value: f == null ? "" : String(f),
574
- disabled: i,
575
- required: e,
576
- "aria-label": t == null ? d : null,
577
- "aria-invalid": l == null ? null : "true",
578
- "aria-describedby": l == null ? null : this.errorId,
579
- onChange: (h) => {
580
- const A = ct(h, "dropdown change"), N = y.find(({ value: D }) => String(D) === A), R = (N == null ? void 0 : N.value) ?? A;
581
- this.valueEmitter.set(R, "dropdown selection"), H(u, R, h);
589
+ name: a,
590
+ value: p == null ? "" : String(p),
591
+ disabled: r,
592
+ required: i,
593
+ "aria-label": e == null ? c : null,
594
+ "aria-invalid": s == null ? null : "true",
595
+ "aria-describedby": s == null ? null : this.errorId,
596
+ onChange: (f) => {
597
+ const z = ge(f, "dropdown change"), H = g.find(({ value: M }) => String(M) === z), R = (H == null ? void 0 : H.value) ?? z;
598
+ this.valueEmitter.set(R, "dropdown selection"), N(h, R, f);
582
599
  },
583
600
  children: [
584
- f == null || f === "" ? /* @__PURE__ */ c("option", { value: "", disabled: e, selected: !0, children: o }) : null,
585
- y.map((h) => {
586
- if (h == null || !Object.hasOwn(h, "value"))
601
+ p == null || p === "" ? /* @__PURE__ */ u("option", { value: "", disabled: i, selected: !0, children: d }) : null,
602
+ g.map((f) => {
603
+ if (f == null || !Object.hasOwn(f, "value"))
587
604
  throw new TypeError("Dropdown options require value and label fields");
588
- return /* @__PURE__ */ c(
605
+ return /* @__PURE__ */ u(
589
606
  "option",
590
607
  {
591
- value: String(h.value),
592
- disabled: !!h.disabled,
593
- selected: Object.is(f, h.value),
594
- children: h.label ?? String(h.value)
608
+ value: String(f.value),
609
+ disabled: !!f.disabled,
610
+ selected: Object.is(p, f.value),
611
+ children: f.label ?? String(f.value)
595
612
  },
596
- String(h.value)
613
+ String(f.value)
597
614
  );
598
615
  })
599
616
  ]
600
617
  }
601
618
  ),
602
- l == null ? null : /* @__PURE__ */ c(
619
+ s == null ? null : /* @__PURE__ */ u(
603
620
  "p",
604
621
  {
605
622
  id: this.errorId,
606
623
  "data-part": "error",
607
624
  role: "alert",
608
- children: String(l)
625
+ children: String(s)
609
626
  }
610
627
  )
611
628
  ]
@@ -613,104 +630,104 @@ class j extends p {
613
630
  );
614
631
  }
615
632
  }
616
- a(j, "hostName", "dropdown"), a(j, "standaloneHostName", "drop-down"), a(j, "baseStyles", [
633
+ n(C, "hostName", "dropdown"), n(C, "standaloneHostName", "drop-down"), n(C, "baseStyles", [
617
634
  ["&", ["labeledinput", "inputline"]],
618
635
  ["& > label", ["label"]],
619
636
  ["& > select", ["input", "inputline"]],
620
637
  ["&[data-disabled]", ["disabled"]],
621
638
  ["&[data-error]", ["error"]]
622
- ]), a(j, "css", m`
639
+ ]), n(C, "css", m`
623
640
  & {
624
641
  position: relative;
625
642
  }
626
643
  `);
627
- function dt(n) {
628
- return n != null && (typeof n == "object" || typeof n == "function") && typeof Reflect.get(n, "get") == "function" && typeof Reflect.get(n, "subscribe") == "function";
629
- }
630
- function ct(n, s) {
631
- const t = n.currentTarget;
632
- if (t == null || typeof Reflect.get(t, "value") != "string")
633
- throw new TypeError(`${s} requires a value-bearing event target`);
634
- return Reflect.get(t, "value");
635
- }
636
- class q extends p {
637
- constructor(t = {}) {
638
- super(t);
639
- a(this, "inputId");
640
- a(this, "errorId");
641
- a(this, "valueEmitter");
642
- this.inputId = x("textbox", t.id), this.errorId = `${this.inputId}-error`, this.valueEmitter = T(this, t, "", "textbox value");
644
+ function ye(o) {
645
+ return o != null && (typeof o == "object" || typeof o == "function") && typeof Reflect.get(o, "get") == "function" && typeof Reflect.get(o, "subscribe") == "function";
646
+ }
647
+ function ge(o, l) {
648
+ const e = o.currentTarget;
649
+ if (e == null || typeof Reflect.get(e, "value") != "string")
650
+ throw new TypeError(`${l} requires a value-bearing event target`);
651
+ return Reflect.get(e, "value");
652
+ }
653
+ class F extends b {
654
+ constructor(e = {}) {
655
+ super(e);
656
+ n(this, "inputId");
657
+ n(this, "errorId");
658
+ n(this, "valueEmitter");
659
+ this.inputId = E("textbox", e.id), this.errorId = `${this.inputId}-error`, this.valueEmitter = O(this, e, "", "textbox value");
643
660
  }
644
661
  initialize() {
645
662
  this.watch(this.valueEmitter);
646
663
  }
647
664
  render() {
648
665
  const {
649
- label: t,
650
- placeholder: r,
651
- type: i = "text",
652
- name: e,
653
- disabled: l = !1,
654
- required: o = !1,
655
- readOnly: d = !1,
656
- error: u = null,
657
- autoComplete: y,
658
- inputMode: f,
659
- minLength: k,
660
- maxLength: h,
661
- pattern: A,
662
- ariaLabel: N,
666
+ label: e,
667
+ placeholder: a,
668
+ type: r = "text",
669
+ name: i,
670
+ disabled: s = !1,
671
+ required: d = !1,
672
+ readOnly: c = !1,
673
+ error: h = null,
674
+ autoComplete: g,
675
+ inputMode: p,
676
+ minLength: U,
677
+ maxLength: f,
678
+ pattern: z,
679
+ ariaLabel: H,
663
680
  inputRef: R,
664
- onInput: D,
665
- onChange: it
666
- } = this.props, rt = this.valueEmitter.get() ?? "", lt = this.Host;
667
- return /* @__PURE__ */ g(
668
- lt,
681
+ onInput: M,
682
+ onChange: ue
683
+ } = this.props, he = this.valueEmitter.get() ?? "", be = this.Host;
684
+ return /* @__PURE__ */ v(
685
+ be,
669
686
  {
670
- className: b(this.props) || null,
671
- "data-disabled": l ? "" : null,
672
- "data-required": o ? "" : null,
673
- "data-error": u == null ? null : "",
687
+ className: y(this.props) || null,
688
+ "data-disabled": s ? "" : null,
689
+ "data-required": d ? "" : null,
690
+ "data-error": h == null ? null : "",
674
691
  children: [
675
- t == null ? null : /* @__PURE__ */ c("label", { htmlFor: this.inputId, children: t }),
676
- /* @__PURE__ */ c(
692
+ e == null ? null : /* @__PURE__ */ u("label", { htmlFor: this.inputId, children: e }),
693
+ /* @__PURE__ */ u(
677
694
  "input",
678
695
  {
679
696
  id: this.inputId,
680
- name: e,
681
- type: i,
682
- value: rt,
683
- placeholder: r,
684
- disabled: l,
685
- required: o,
686
- readOnly: d,
687
- autoComplete: y,
688
- inputMode: f,
689
- minLength: k,
690
- maxLength: h,
691
- pattern: A,
697
+ name: i,
698
+ type: r,
699
+ value: he,
700
+ placeholder: a,
701
+ disabled: s,
702
+ required: d,
703
+ readOnly: c,
704
+ autoComplete: g,
705
+ inputMode: p,
706
+ minLength: U,
707
+ maxLength: f,
708
+ pattern: z,
692
709
  ref: R,
693
- "aria-label": t == null ? N : null,
694
- "aria-invalid": u == null ? null : "true",
695
- "aria-describedby": u == null ? null : this.errorId,
696
- onInput: (S) => {
697
- const L = W(S, "textbox input");
698
- this.valueEmitter.set(L, "textbox input"), H(D, L, S);
710
+ "aria-label": e == null ? H : null,
711
+ "aria-invalid": h == null ? null : "true",
712
+ "aria-describedby": h == null ? null : this.errorId,
713
+ onInput: (A) => {
714
+ const K = _(A, "textbox input");
715
+ this.valueEmitter.set(K, "textbox input"), N(M, K, A);
699
716
  },
700
- onChange: (S) => H(
701
- it,
702
- W(S, "textbox change"),
703
- S
717
+ onChange: (A) => N(
718
+ ue,
719
+ _(A, "textbox change"),
720
+ A
704
721
  )
705
722
  }
706
723
  ),
707
- u == null ? null : /* @__PURE__ */ c(
724
+ h == null ? null : /* @__PURE__ */ u(
708
725
  "p",
709
726
  {
710
727
  id: this.errorId,
711
728
  "data-part": "error",
712
729
  role: "alert",
713
- children: String(u)
730
+ children: String(h)
714
731
  }
715
732
  )
716
733
  ]
@@ -718,96 +735,96 @@ class q extends p {
718
735
  );
719
736
  }
720
737
  }
721
- a(q, "hostName", "textbox"), a(q, "standaloneHostName", "text-box"), a(q, "baseStyles", [
738
+ n(F, "hostName", "textbox"), n(F, "standaloneHostName", "text-box"), n(F, "baseStyles", [
722
739
  ["&", ["labeledinput", "inputline"]],
723
740
  ["& > label", ["label"]],
724
741
  ["& > input", ["input", "inputline"]],
725
742
  ["&[data-disabled]", ["disabled"]],
726
743
  ["&[data-error]", ["error"]]
727
- ]), a(q, "css", m`
744
+ ]), n(F, "css", m`
728
745
  & input {
729
746
  cursor: text;
730
747
  }
731
748
 
732
749
  & > [data-part="error"] {
733
750
  margin: 0;
734
- color: var(--error-color, #b00020);
751
+ color: var(--fray-color-error, var(--error-color));
735
752
  }
736
753
  `);
737
- function W(n, s) {
738
- const t = n.currentTarget;
739
- if (t == null || typeof Reflect.get(t, "value") != "string")
740
- throw new TypeError(`${s} requires a value-bearing event target`);
741
- return Reflect.get(t, "value");
742
- }
743
- class X extends p {
744
- constructor(t = {}) {
745
- var e;
746
- super(t);
747
- a(this, "valueEmitter");
748
- a(this, "groupId");
749
- a(this, "legendId");
750
- const r = t.options ?? [];
751
- Y(r);
752
- const i = ((e = r[0]) == null ? void 0 : e[0]) ?? null;
753
- this.valueEmitter = T(
754
+ function _(o, l) {
755
+ const e = o.currentTarget;
756
+ if (e == null || typeof Reflect.get(e, "value") != "string")
757
+ throw new TypeError(`${l} requires a value-bearing event target`);
758
+ return Reflect.get(e, "value");
759
+ }
760
+ class ee extends b {
761
+ constructor(e = {}) {
762
+ var i;
763
+ super(e);
764
+ n(this, "valueEmitter");
765
+ n(this, "groupId");
766
+ n(this, "legendId");
767
+ const a = e.options ?? [];
768
+ te(a);
769
+ const r = ((i = a[0]) == null ? void 0 : i[0]) ?? null;
770
+ this.valueEmitter = O(
754
771
  this,
755
- t,
756
- i ?? null,
772
+ e,
773
+ r ?? null,
757
774
  "toggle value"
758
- ), this.groupId = x("toggle", t.id), this.legendId = `${this.groupId}-label`;
775
+ ), this.groupId = E("toggle", e.id), this.legendId = `${this.groupId}-label`;
759
776
  }
760
777
  initialize() {
761
778
  this.watch(this.valueEmitter);
762
779
  }
763
- selectOption(t, r = null) {
764
- this.props.disabled || (this.valueEmitter.set(t, "toggle option selected"), H(this.props.onChange, t, r));
780
+ selectOption(e, a = null) {
781
+ this.props.disabled || (this.valueEmitter.set(e, "toggle option selected"), N(this.props.onChange, e, a));
765
782
  }
766
783
  render() {
767
784
  const {
768
- options: t = [],
769
- label: r,
770
- disabled: i = !1,
771
- required: e = !1
785
+ options: e = [],
786
+ label: a,
787
+ disabled: r = !1,
788
+ required: i = !1
772
789
  } = this.props;
773
- Y(t);
774
- const l = this.valueEmitter.get(), o = Math.max(
790
+ te(e);
791
+ const s = this.valueEmitter.get(), d = Math.max(
775
792
  0,
776
- t.findIndex(([d]) => Object.is(d, l))
793
+ e.findIndex(([c]) => Object.is(c, s))
777
794
  );
778
- return /* @__PURE__ */ g(
795
+ return /* @__PURE__ */ v(
779
796
  "fieldset",
780
797
  {
781
798
  id: this.groupId,
782
- disabled: i,
783
- className: b(this.props) || void 0,
799
+ disabled: r,
800
+ className: y(this.props) || void 0,
784
801
  "data-fray-component": "toggle",
785
- "data-disabled": i ? "" : null,
786
- "aria-required": e ? "true" : null,
802
+ "data-disabled": r ? "" : null,
803
+ "aria-required": i ? "true" : null,
787
804
  children: [
788
- r == null ? null : /* @__PURE__ */ c("legend", { id: this.legendId, children: r }),
789
- /* @__PURE__ */ c(
805
+ a == null ? null : /* @__PURE__ */ u("legend", { id: this.legendId, children: a }),
806
+ /* @__PURE__ */ u(
790
807
  "div",
791
808
  {
792
809
  "data-part": "options",
793
810
  role: "radiogroup",
794
- "aria-label": r == null ? this.props.ariaLabel : null,
795
- "aria-labelledby": r == null ? null : this.legendId,
796
- children: t.map(([d, u], y) => /* @__PURE__ */ c(
811
+ "aria-label": a == null ? this.props.ariaLabel : null,
812
+ "aria-labelledby": a == null ? null : this.legendId,
813
+ children: e.map(([c, h], g) => /* @__PURE__ */ u(
797
814
  "button",
798
815
  {
799
816
  type: "button",
800
817
  role: "radio",
801
- disabled: i,
818
+ disabled: r,
802
819
  "data-part": "option",
803
- "aria-checked": Object.is(l, d) ? "true" : "false",
804
- "data-value": String(d),
805
- tabIndex: y === o ? 0 : -1,
806
- onClick: (f) => this.selectOption(d, f),
807
- onKeyDown: (f) => this.handleKeyDown(f, y, t),
808
- children: u
820
+ "aria-checked": Object.is(s, c) ? "true" : "false",
821
+ "data-value": String(c),
822
+ tabIndex: g === d ? 0 : -1,
823
+ onClick: (p) => this.selectOption(c, p),
824
+ onKeyDown: (p) => this.handleKeyDown(p, g, e),
825
+ children: h
809
826
  },
810
- String(d)
827
+ String(c)
811
828
  ))
812
829
  }
813
830
  )
@@ -815,27 +832,27 @@ class X extends p {
815
832
  }
816
833
  );
817
834
  }
818
- handleKeyDown(t, r, i) {
819
- const { key: e } = t;
820
- let l;
821
- if (e === "ArrowRight" || e === "ArrowDown") l = (r + 1) % i.length;
822
- else if (e === "ArrowLeft" || e === "ArrowUp")
823
- l = (r - 1 + i.length) % i.length;
824
- else if (e === "Home") l = 0;
825
- else if (e === "End") l = i.length - 1;
835
+ handleKeyDown(e, a, r) {
836
+ const { key: i } = e;
837
+ let s;
838
+ if (i === "ArrowRight" || i === "ArrowDown") s = (a + 1) % r.length;
839
+ else if (i === "ArrowLeft" || i === "ArrowUp")
840
+ s = (a - 1 + r.length) % r.length;
841
+ else if (i === "Home") s = 0;
842
+ else if (i === "End") s = r.length - 1;
826
843
  else return;
827
- t.preventDefault();
828
- const o = i[l];
829
- if (o != null && (this.selectOption(o[0], t), this.dom instanceof Element)) {
830
- const d = this.dom.querySelectorAll('[role="radio"]')[l];
831
- d == null || d.focus();
844
+ e.preventDefault();
845
+ const d = r[s];
846
+ if (d != null && (this.selectOption(d[0], e), this.dom instanceof Element)) {
847
+ const c = this.dom.querySelectorAll('[role="radio"]')[s];
848
+ c == null || c.focus();
832
849
  }
833
850
  }
834
851
  }
835
- a(X, "baseStyles", [
852
+ n(ee, "baseStyles", [
836
853
  ['fieldset[data-fray-component="toggle"] > [data-part="options"]', ["uiline"]],
837
854
  ['fieldset[data-fray-component="toggle"] [data-part="option"]', ["uiline", "button"]]
838
- ]), a(X, "css", m`
855
+ ]), n(ee, "css", m`
839
856
  fieldset[data-fray-component="toggle"] {
840
857
  margin: 0;
841
858
  padding: 0;
@@ -848,6 +865,7 @@ a(X, "baseStyles", [
848
865
  }
849
866
 
850
867
  fieldset[data-fray-component="toggle"] [data-part="option"] {
868
+ background: var(--fray-toggle-button-background, var(--fray-button-background));
851
869
  border-radius: 0;
852
870
  }
853
871
 
@@ -860,44 +878,47 @@ a(X, "baseStyles", [
860
878
  }
861
879
 
862
880
  fieldset[data-fray-component="toggle"] [data-part="option"][aria-checked="true"] {
863
- background: var(--toggle-selected-bg, var(--ui-accent-color));
864
- color: var(--toggle-selected-text, white);
881
+ background: var(
882
+ --fray-toggle-button-background-checked,
883
+ var(--fray-selection-background, var(--toggle-selected-bg))
884
+ );
885
+ color: var(--fray-selection-color, var(--toggle-selected-text));
865
886
  }
866
887
  `);
867
- function Y(n) {
868
- B(n);
869
- for (const s of n)
870
- if (!Array.isArray(s) || s.length < 2)
888
+ function te(o) {
889
+ G(o);
890
+ for (const l of o)
891
+ if (!Array.isArray(l) || l.length < 2)
871
892
  throw new TypeError("Toggle options must be [value, label] tuples");
872
893
  }
873
- class V extends p {
894
+ class P extends b {
874
895
  render() {
875
896
  const {
876
- children: s = [],
877
- id: t,
878
- label: r = "Actions",
879
- orientation: i = "horizontal"
897
+ children: l = [],
898
+ id: e,
899
+ label: a = "Actions",
900
+ orientation: r = "horizontal"
880
901
  } = this.props;
881
- if (!["horizontal", "vertical"].includes(i))
902
+ if (!["horizontal", "vertical"].includes(r))
882
903
  throw new TypeError("Toolbar orientation must be horizontal or vertical");
883
- const e = this.Host;
884
- return /* @__PURE__ */ c(
885
- e,
904
+ const i = this.Host;
905
+ return /* @__PURE__ */ u(
906
+ i,
886
907
  {
887
- id: t,
908
+ id: e,
888
909
  role: "toolbar",
889
- className: b(this.props) || null,
890
- "data-orientation": i,
891
- "aria-label": r,
892
- "aria-orientation": i,
893
- children: s
910
+ className: y(this.props) || null,
911
+ "data-orientation": r,
912
+ "aria-label": a,
913
+ "aria-orientation": r,
914
+ children: l
894
915
  }
895
916
  );
896
917
  }
897
918
  }
898
- a(V, "hostName", "toolbar"), a(V, "standaloneHostName", "tool-bar"), a(V, "baseStyles", [
919
+ n(P, "hostName", "toolbar"), n(P, "standaloneHostName", "tool-bar"), n(P, "baseStyles", [
899
920
  ["&", ["toolbar"]]
900
- ]), a(V, "css", m`
921
+ ]), n(P, "css", m`
901
922
  & {
902
923
  display: flex;
903
924
  flex-wrap: wrap;
@@ -911,40 +932,40 @@ a(V, "hostName", "toolbar"), a(V, "standaloneHostName", "tool-bar"), a(V, "baseS
911
932
  align-items: stretch;
912
933
  }
913
934
  `);
914
- class C extends p {
915
- constructor(t) {
916
- super(t);
917
- a(this, "progressId");
918
- if (this.progressId = x("progress", t.id), t.valueEmitter != null && !ut(t.valueEmitter))
935
+ class B extends b {
936
+ constructor(e) {
937
+ super(e);
938
+ n(this, "progressId");
939
+ if (this.progressId = E("progress", e.id), e.valueEmitter != null && !ve(e.valueEmitter))
919
940
  throw new TypeError("ProgressBar valueEmitter must be a readable emitter");
920
941
  }
921
942
  render() {
922
- const t = this.props.max ?? 100;
923
- if (!Number.isFinite(t) || t <= 0)
943
+ const e = this.props.max ?? 100;
944
+ if (!Number.isFinite(e) || e <= 0)
924
945
  throw new RangeError("ProgressBar max must be a positive finite number");
925
- const r = this.props.valueEmitter == null ? this.props.value ?? null : this.read(this.props.valueEmitter);
926
- if (r != null && (!Number.isFinite(r) || r < 0))
946
+ const a = this.props.valueEmitter == null ? this.props.value ?? null : this.read(this.props.valueEmitter);
947
+ if (a != null && (!Number.isFinite(a) || a < 0))
927
948
  throw new RangeError("ProgressBar value must be null or a non-negative finite number");
928
- const i = r == null ? null : Math.min(r, t), e = this.props.valueText ?? (i == null ? "In progress" : `${Math.round(i / t * 100)}%`), l = this.Host;
929
- return /* @__PURE__ */ g(l, { className: b(this.props) || null, children: [
930
- /* @__PURE__ */ g("div", { "data-part": "label-line", children: [
931
- /* @__PURE__ */ c("label", { htmlFor: this.progressId, children: this.props.label }),
932
- /* @__PURE__ */ c("span", { "data-part": "value", children: e })
949
+ const r = a == null ? null : Math.min(a, e), i = this.props.valueText ?? (r == null ? "In progress" : `${Math.round(r / e * 100)}%`), s = this.Host;
950
+ return /* @__PURE__ */ v(s, { className: y(this.props) || null, children: [
951
+ /* @__PURE__ */ v("div", { "data-part": "label-line", children: [
952
+ /* @__PURE__ */ u("label", { htmlFor: this.progressId, children: this.props.label }),
953
+ /* @__PURE__ */ u("span", { "data-part": "value", children: i })
933
954
  ] }),
934
- /* @__PURE__ */ c(
955
+ /* @__PURE__ */ u(
935
956
  "progress",
936
957
  {
937
958
  id: this.progressId,
938
- value: i ?? void 0,
939
- max: t,
940
- "aria-valuetext": e,
941
- children: e
959
+ value: r ?? void 0,
960
+ max: e,
961
+ "aria-valuetext": i,
962
+ children: i
942
963
  }
943
964
  )
944
965
  ] });
945
966
  }
946
967
  }
947
- a(C, "hostName", "progress-bar"), a(C, "standaloneHostName", "progress-bar"), a(C, "css", m`
968
+ n(B, "hostName", "progress-bar"), n(B, "standaloneHostName", "progress-bar"), n(B, "css", m`
948
969
  & {
949
970
  display: grid;
950
971
  gap: var(--spacing-small, 0.5rem);
@@ -963,7 +984,9 @@ a(C, "hostName", "progress-bar"), a(C, "standaloneHostName", "progress-bar"), a(
963
984
  & > progress {
964
985
  width: 100%;
965
986
  min-height: 0.8rem;
966
- accent-color: var(--ui-accent-color);
987
+ color: var(--fray-progress-value-background, var(--ui-accent-color));
988
+ background: var(--fray-progress-track-background, transparent);
989
+ accent-color: var(--fray-color-primary, var(--ui-accent-color));
967
990
  }
968
991
 
969
992
  @media (forced-colors: active) {
@@ -972,43 +995,318 @@ a(C, "hostName", "progress-bar"), a(C, "standaloneHostName", "progress-bar"), a(
972
995
  }
973
996
  }
974
997
  `);
975
- function ut(n) {
976
- return n != null && (typeof n == "object" || typeof n == "function") && typeof Reflect.get(n, "get") == "function" && typeof Reflect.get(n, "subscribe") == "function";
998
+ function ve(o) {
999
+ return o != null && (typeof o == "object" || typeof o == "function") && typeof Reflect.get(o, "get") == "function" && typeof Reflect.get(o, "subscribe") == "function";
1000
+ }
1001
+ const He = Object.freeze([
1002
+ t("--fray-color-canvas", "color", "palette", "color", "Application canvas"),
1003
+ t("--fray-color-surface", "color", "palette", "color", "Primary surface"),
1004
+ t("--fray-color-surface-muted", "color", "palette", "color", "Subdued surface"),
1005
+ t("--fray-color-surface-raised", "color", "palette", "color", "Raised surface"),
1006
+ t("--fray-color-surface-inset", "color", "palette", "color", "Inset surface"),
1007
+ t("--fray-color-text", "color", "palette", "color", "Primary text"),
1008
+ t("--fray-color-text-muted", "color", "palette", "color", "Secondary text"),
1009
+ t("--fray-color-border", "color", "palette", "color", "Ordinary border"),
1010
+ t("--fray-color-border-strong", "color", "palette", "color", "Emphasized border"),
1011
+ t("--fray-color-primary", "color", "palette", "color", "Primary accent"),
1012
+ t("--fray-color-primary-hover", "color", "palette", "color", "Hovered accent"),
1013
+ t("--fray-color-primary-active", "color", "palette", "color", "Active accent"),
1014
+ t("--fray-color-primary-soft", "color", "palette", "color", "Subtle accent surface"),
1015
+ t("--fray-color-on-primary", "color", "palette", "color", "Content on primary accent"),
1016
+ t("--fray-color-focus", "color", "palette", "color", "Keyboard focus indication"),
1017
+ t("--fray-color-selection", "color", "palette", "color", "Selected item surface"),
1018
+ t("--fray-color-on-selection", "color", "palette", "color", "Content on selection"),
1019
+ t("--fray-color-disabled", "color", "palette", "color", "Disabled surface"),
1020
+ t("--fray-color-on-disabled", "color", "palette", "color", "Disabled content"),
1021
+ t("--fray-color-error", "color", "status", "color", "Error state"),
1022
+ t("--fray-color-on-error", "color", "status", "color", "Content on error"),
1023
+ t("--fray-color-success", "color", "status", "color", "Success state"),
1024
+ t("--fray-color-on-success", "color", "status", "color", "Content on success"),
1025
+ t("--fray-color-highlight", "color", "palette", "color", "Light reflection/highlight"),
1026
+ t("--fray-color-shadow", "color", "palette", "color", "Shadow tint"),
1027
+ t("--fray-font-family", "theme", "typography", "font", "UI font stack"),
1028
+ t("--fray-font-size", "theme", "typography", "dimension", "Base UI font size"),
1029
+ t("--fray-line-height", "theme", "typography", "dimension", "Base UI line height"),
1030
+ t("--fray-control-min-height", "theme", "control", "dimension", "Minimum control height"),
1031
+ t("--fray-space-xs", "theme", "spacing", "dimension", "Extra-small spacing"),
1032
+ t("--fray-space-sm", "theme", "spacing", "dimension", "Small spacing"),
1033
+ t("--fray-space-md", "theme", "spacing", "dimension", "Medium spacing"),
1034
+ t("--fray-space-lg", "theme", "spacing", "dimension", "Large spacing"),
1035
+ t("--fray-radius-sm", "theme", "shape", "radius", "Small corner radius"),
1036
+ t("--fray-radius-md", "theme", "shape", "radius", "Ordinary corner radius"),
1037
+ t("--fray-radius-lg", "theme", "shape", "radius", "Large corner radius"),
1038
+ t("--fray-motion-fast", "theme", "motion", "duration", "Fast interaction transition"),
1039
+ t("--fray-ui-background", "theme", "surface", "background", "Default UI background"),
1040
+ t("--fray-ui-color", "theme", "surface", "color", "Default UI text"),
1041
+ t("--fray-ui-border", "theme", "surface", "border", "Default UI border"),
1042
+ t("--fray-ui-shadow", "theme", "surface", "shadow", "Default raised shadow"),
1043
+ t("--fray-focus-ring", "theme", "focus", "shadow", "Keyboard focus ring"),
1044
+ t("--fray-panel-background", "theme", "panel", "background", "Panel surface", "--fray-ui-background"),
1045
+ t("--fray-panel-color", "theme", "panel", "color", "Panel content", "--fray-ui-color"),
1046
+ t("--fray-panel-border", "theme", "panel", "border", "Panel border", "--fray-ui-border"),
1047
+ t("--fray-panel-shadow", "theme", "panel", "shadow", "Panel shadow", "--fray-ui-shadow"),
1048
+ t("--fray-panel-radius", "theme", "panel", "radius", "Panel radius", "--fray-radius-md"),
1049
+ t("--fray-dialog-shadow", "theme", "dialog", "shadow", "Modal dialog shadow", "--fray-panel-shadow"),
1050
+ t("--fray-dialog-backdrop-background", "theme", "dialog", "background", "Modal backdrop"),
1051
+ t("--fray-header-background", "theme", "header", "background", "Generic header surface"),
1052
+ t("--fray-header-color", "theme", "header", "color", "Generic header content"),
1053
+ t("--fray-header-border", "theme", "header", "border", "Generic header border"),
1054
+ t("--fray-header-shadow", "theme", "header", "shadow", "Generic header shadow"),
1055
+ t("--fray-section-header-background", "theme", "header", "background", "Section header surface", "--fray-header-background"),
1056
+ t("--fray-section-header-color", "theme", "header", "color", "Section header content", "--fray-header-color"),
1057
+ t("--fray-section-header-border", "theme", "header", "border", "Section header border", "--fray-header-border"),
1058
+ t("--fray-section-header-shadow", "theme", "header", "shadow", "Section header shadow", "--fray-header-shadow"),
1059
+ t("--fray-panel-header-background", "theme", "header", "background", "Panel header surface", "--fray-section-header-background"),
1060
+ t("--fray-panel-header-color", "theme", "header", "color", "Panel header content", "--fray-section-header-color"),
1061
+ t("--fray-table-header-background", "theme", "header", "background", "Table header surface", "--fray-section-header-background"),
1062
+ t("--fray-table-header-color", "theme", "header", "color", "Table header content", "--fray-section-header-color"),
1063
+ t("--fray-dialog-header-background", "theme", "header", "background", "Dialog header surface", "--fray-section-header-background"),
1064
+ t("--fray-dialog-header-color", "theme", "header", "color", "Dialog header content", "--fray-section-header-color"),
1065
+ t("--fray-button-background", "theme", "button", "background", "Generic button surface"),
1066
+ t("--fray-button-background-hover", "theme", "button", "background", "Hovered button surface"),
1067
+ t("--fray-button-background-active", "theme", "button", "background", "Pressed button surface"),
1068
+ t("--fray-button-background-disabled", "theme", "button", "background", "Disabled button surface"),
1069
+ t("--fray-button-color", "theme", "button", "color", "Generic button content"),
1070
+ t("--fray-button-border", "theme", "button", "border", "Generic button border"),
1071
+ t("--fray-button-shadow", "theme", "button", "shadow", "Generic button shadow"),
1072
+ t("--fray-button-shadow-active", "theme", "button", "shadow", "Pressed button shadow"),
1073
+ t("--fray-toggle-button-background", "theme", "button", "background", "Toggle option surface", "--fray-button-background"),
1074
+ t("--fray-toggle-button-background-checked", "theme", "button", "background", "Selected toggle option", "--fray-selection-background"),
1075
+ t("--fray-tab-button-background", "theme", "button", "background", "Tab surface", "--fray-button-background"),
1076
+ t("--fray-tab-button-background-active", "theme", "button", "background", "Active tab surface", "--fray-tab-active-background"),
1077
+ t("--fray-menu-button-background", "theme", "button", "background", "Menu action surface", "--fray-button-background"),
1078
+ t("--fray-dropdown-trigger-background", "theme", "button", "background", "Dropdown arrow/trigger surface", "--fray-button-background"),
1079
+ t("--fray-table-header-button-background", "theme", "button", "background", "Table-header action surface", "--fray-button-background"),
1080
+ t("--fray-input-background", "theme", "input", "background", "Input surface"),
1081
+ t("--fray-input-color", "theme", "input", "color", "Input content"),
1082
+ t("--fray-input-border", "theme", "input", "border", "Input border"),
1083
+ t("--fray-input-shadow", "theme", "input", "shadow", "Input shadow"),
1084
+ t("--fray-input-background-disabled", "theme", "input", "background", "Disabled input surface"),
1085
+ t("--fray-input-color-disabled", "theme", "input", "color", "Disabled input content"),
1086
+ t("--fray-selection-background", "theme", "selection", "background", "Selected item surface"),
1087
+ t("--fray-selection-color", "theme", "selection", "color", "Selected item content"),
1088
+ t("--fray-row-hover-background", "theme", "row", "background", "Hovered list/table/tree row"),
1089
+ t("--fray-table-row-background", "theme", "table", "background", "Odd table row surface"),
1090
+ t("--fray-table-row-alt-background", "theme", "table", "background", "Even table row surface"),
1091
+ t("--fray-checkbox-box-background", "theme", "checkbox", "background", "Unchecked checkbox box", "--fray-input-background"),
1092
+ t("--fray-checkbox-box-background-checked", "theme", "checkbox", "background", "Checked checkbox box", "--fray-selection-background"),
1093
+ t("--fray-checkbox-box-border", "theme", "checkbox", "border", "Checkbox box border", "--fray-input-border"),
1094
+ t("--fray-checkbox-symbol-color", "theme", "checkbox", "color", "Checkbox symbol", "--fray-selection-color"),
1095
+ t("--fray-radio-background", "theme", "radio", "background", "Radio/toggle option surface", "--fray-toggle-button-background"),
1096
+ t("--fray-radio-background-checked", "theme", "radio", "background", "Selected radio/toggle option", "--fray-selection-background"),
1097
+ t("--fray-toolbar-background", "theme", "toolbar", "background", "Toolbar surface", "--fray-panel-background"),
1098
+ t("--fray-toolbar-color", "theme", "toolbar", "color", "Toolbar content", "--fray-panel-color"),
1099
+ t("--fray-toolbar-border", "theme", "toolbar", "border", "Toolbar border", "--fray-panel-border"),
1100
+ t("--fray-toolbar-shadow", "theme", "toolbar", "shadow", "Toolbar shadow", "--fray-panel-shadow"),
1101
+ t("--fray-tabline-background", "theme", "tabs", "background", "Tab strip surface", "--fray-panel-background"),
1102
+ t("--fray-tab-active-background", "theme", "tabs", "background", "Active tab surface", "--fray-panel-background"),
1103
+ t("--fray-progress-track-background", "theme", "progress", "background", "Progress track"),
1104
+ t("--fray-progress-value-background", "theme", "progress", "background", "Progress value"),
1105
+ t("--fray-working-background-image", "theme", "status", "background", "Indeterminate/loading texture")
1106
+ ]), we = Object.freeze([
1107
+ w("shiny", "Shiny", k("themes/shiny/theme.css")),
1108
+ w("java", "Java", k("themes/java/theme.css")),
1109
+ w("minimal", "Minimal", k("themes/minimal/theme.css"))
1110
+ ]), ke = Object.freeze([
1111
+ w("iceblue", "Ice blue", k("colors/iceblue/colors.css")),
1112
+ w("ocean", "Ocean", k("colors/ocean/colors.css")),
1113
+ w("green", "Green", k("colors/green/colors.css")),
1114
+ w("gray", "Gray", k("colors/gray/colors.css")),
1115
+ w("orange", "Orange", k("colors/orange/colors.css")),
1116
+ w("purple", "Purple", k("colors/purple/colors.css")),
1117
+ w("red", "Red", k("colors/red/colors.css")),
1118
+ w("yellow", "Yellow", k("colors/yellow/colors.css"))
1119
+ ]);
1120
+ function xe(o, l, e = globalThis.document) {
1121
+ if (Ee(l), (e == null ? void 0 : e.head) == null || e.documentElement == null)
1122
+ throw new TypeError("replaceFrayStylesheet requires a document with a head and root");
1123
+ const a = `link[data-fray-stylesheet="${o}"]`;
1124
+ let r = e.head.querySelector(a);
1125
+ return r == null && (r = e.createElement("link"), r.rel = "stylesheet", r.dataset.frayStylesheet = o, e.head.append(r)), r.dataset.fraySelection = l.value, r.getAttribute("href") !== l.href && r.setAttribute("href", l.href), o === "theme" ? e.documentElement.dataset.frayTheme = l.value : e.documentElement.dataset.frayColor = l.value, r;
1126
+ }
1127
+ function V(o, l) {
1128
+ const e = o.find((a) => a.value === l);
1129
+ if (e == null) throw new RangeError(`Unknown Fray stylesheet selection: ${l}`);
1130
+ return e;
1131
+ }
1132
+ function t(o, l, e, a, r, i) {
1133
+ return i == null ? Object.freeze({ name: o, layer: l, family: e, value: a, description: r }) : Object.freeze({ name: o, layer: l, family: e, value: a, description: r, fallback: i });
1134
+ }
1135
+ function w(o, l, e) {
1136
+ return Object.freeze({ value: o, label: l, href: e });
1137
+ }
1138
+ function k(o) {
1139
+ const l = import.meta.url.includes("/src/styling/") ? `../../${o}` : `../${o}`;
1140
+ return new URL(l, import.meta.url).href;
1141
+ }
1142
+ function Ee(o) {
1143
+ if (o == null || typeof o != "object")
1144
+ throw new TypeError("Fray stylesheet selection must be an option");
1145
+ for (const l of ["value", "label", "href"])
1146
+ if (typeof Reflect.get(o, l) != "string" || String(Reflect.get(o, l)).length === 0)
1147
+ throw new TypeError(`Fray stylesheet option ${l} must be a non-empty string`);
1148
+ }
1149
+ class D extends b {
1150
+ constructor(e, a, r) {
1151
+ var d;
1152
+ super(e);
1153
+ n(this, "valueEmitter");
1154
+ n(this, "inputId");
1155
+ n(this, "kind");
1156
+ n(this, "defaults");
1157
+ const i = e.options ?? r;
1158
+ oe(i);
1159
+ const s = (d = i[0]) == null ? void 0 : d.value;
1160
+ if (s == null) throw new TypeError(`${a} picker requires at least one option`);
1161
+ this.kind = a, this.defaults = r, this.inputId = E(`${a}-picker`, e.id), this.valueEmitter = O(this, e, s, `${a} selection`), V(i, this.valueEmitter.get());
1162
+ }
1163
+ initialize() {
1164
+ this.watch(this.valueEmitter);
1165
+ }
1166
+ render() {
1167
+ const e = this.options, a = V(e, this.valueEmitter.get()), { label: r, ariaLabel: i, disabled: s = !1, onChange: d } = this.props, c = this.Host;
1168
+ return /* @__PURE__ */ v(
1169
+ c,
1170
+ {
1171
+ className: y(this.props) || null,
1172
+ "data-kind": this.kind,
1173
+ "data-disabled": s ? "" : null,
1174
+ children: [
1175
+ r == null ? null : /* @__PURE__ */ u("label", { htmlFor: this.inputId, children: r }),
1176
+ /* @__PURE__ */ u(
1177
+ "select",
1178
+ {
1179
+ id: this.inputId,
1180
+ "data-part": "control",
1181
+ value: a.value,
1182
+ disabled: s,
1183
+ "aria-label": r == null ? i : null,
1184
+ onChange: (h) => {
1185
+ const g = Ie(h), p = V(e, g);
1186
+ this.valueEmitter.set(g, `${this.kind} selected`), N(d, g, p, h);
1187
+ },
1188
+ children: e.map((h) => /* @__PURE__ */ u(
1189
+ "option",
1190
+ {
1191
+ value: h.value,
1192
+ selected: h.value === a.value,
1193
+ children: h.label
1194
+ },
1195
+ h.value
1196
+ ))
1197
+ }
1198
+ )
1199
+ ]
1200
+ }
1201
+ );
1202
+ }
1203
+ afterMount() {
1204
+ this.applySelection();
1205
+ }
1206
+ afterUpdate() {
1207
+ this.applySelection();
1208
+ }
1209
+ get options() {
1210
+ const e = this.props.options ?? this.defaults;
1211
+ return oe(e), e;
1212
+ }
1213
+ applySelection() {
1214
+ const e = this.props.targetDocument ?? (typeof document > "u" ? null : document);
1215
+ e != null && xe(
1216
+ this.kind,
1217
+ V(this.options, this.valueEmitter.get()),
1218
+ e
1219
+ );
1220
+ }
1221
+ }
1222
+ n(D, "baseStyles", [
1223
+ ["&", ["labeledinput", "inputline"]],
1224
+ ["& > label", ["label"]],
1225
+ ["& > select", ["input", "inputline"]],
1226
+ ["&[data-disabled]", ["disabled"]]
1227
+ ]), n(D, "css", m`
1228
+ & {
1229
+ position: relative;
1230
+ }
1231
+
1232
+ & > select {
1233
+ min-width: 8rem;
1234
+ }
1235
+ `);
1236
+ class re extends D {
1237
+ constructor(l = {}) {
1238
+ super(l, "theme", we);
1239
+ }
1240
+ }
1241
+ n(re, "hostName", "theme-picker"), n(re, "standaloneHostName", "theme-picker");
1242
+ class ae extends D {
1243
+ constructor(l = {}) {
1244
+ super(l, "colors", ke);
1245
+ }
1246
+ }
1247
+ n(ae, "hostName", "color-picker"), n(ae, "standaloneHostName", "color-picker");
1248
+ function oe(o) {
1249
+ if (!Array.isArray(o) || o.length === 0)
1250
+ throw new TypeError("Stylesheet picker options must be a non-empty array");
1251
+ const l = /* @__PURE__ */ new Set();
1252
+ for (const e of o) {
1253
+ if (e == null || typeof e != "object")
1254
+ throw new TypeError("Stylesheet picker options must be objects");
1255
+ for (const a of ["value", "label", "href"])
1256
+ if (typeof e[a] != "string" || e[a].length === 0)
1257
+ throw new TypeError(`Stylesheet picker option ${a} must be a string`);
1258
+ if (l.has(e.value))
1259
+ throw new Error(`Duplicate stylesheet picker value: ${e.value}`);
1260
+ l.add(e.value);
1261
+ }
1262
+ }
1263
+ function Ie(o) {
1264
+ const l = o.currentTarget == null ? null : Reflect.get(o.currentTarget, "value");
1265
+ if (typeof l != "string")
1266
+ throw new TypeError("Stylesheet picker change requires a select element");
1267
+ return l;
977
1268
  }
978
1269
  export {
979
- Rt as Button,
980
- Z as Checkbox,
981
- p as Component,
982
- at as DescriptionItem,
983
- U as DescriptionList,
984
- j as Dropdown,
985
- v as FilterMode,
986
- vt as Fragment,
987
- yt as FrayRuntime,
988
- $ as Panel,
989
- C as ProgressBar,
990
- G as QuadCheckbox,
991
- P as Sidebar,
992
- F as SplitView,
993
- wt as StyleRegistry,
994
- Q as Tab,
995
- I as TabLine,
996
- z as TabPanel,
997
- q as Textbox,
998
- X as Toggle,
999
- V as Toolbar,
1000
- J as TriCheckbox,
1001
- Et as createFrayRuntime,
1002
- xt as createStyleRegistry,
1270
+ Le as Button,
1271
+ ne as Checkbox,
1272
+ ae as ColorPicker,
1273
+ b as Component,
1274
+ ce as DescriptionItem,
1275
+ X as DescriptionList,
1276
+ C as Dropdown,
1277
+ x as FilterMode,
1278
+ Re as Fragment,
1279
+ $e as FrayRuntime,
1280
+ q as Panel,
1281
+ B as ProgressBar,
1282
+ Z as QuadCheckbox,
1283
+ W as Sidebar,
1284
+ L as SplitView,
1285
+ je as StyleRegistry,
1286
+ ie as Tab,
1287
+ T as TabLine,
1288
+ $ as TabPanel,
1289
+ F as Textbox,
1290
+ re as ThemePicker,
1291
+ ee as Toggle,
1292
+ P as Toolbar,
1293
+ Q as TriCheckbox,
1294
+ qe as createFrayRuntime,
1295
+ Ce as createStyleRegistry,
1003
1296
  m as css,
1004
- It as defaultFrayRuntime,
1005
- Nt as h,
1006
- c as jsx,
1007
- St as jsxDEV,
1008
- g as jsxs,
1009
- Ht as live,
1010
- Tt as styleRegistry,
1011
- _ as tabButtonId,
1012
- tt as tabPanelId
1297
+ Fe as defaultFrayRuntime,
1298
+ V as findFrayStylesheetOption,
1299
+ ke as frayColorOptions,
1300
+ we as frayThemeOptions,
1301
+ He as frayThemeVariableCatalog,
1302
+ Pe as h,
1303
+ u as jsx,
1304
+ Ve as jsxDEV,
1305
+ v as jsxs,
1306
+ De as live,
1307
+ xe as replaceFrayStylesheet,
1308
+ Ue as styleRegistry,
1309
+ le as tabButtonId,
1310
+ se as tabPanelId
1013
1311
  };
1014
1312
  //# sourceMappingURL=index.js.map