@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.
- package/README.md +246 -11
- package/colors/README.md +15 -0
- package/colors/gray/colors.css +29 -0
- package/colors/green/colors.css +29 -0
- package/colors/iceblue/colors.css +29 -0
- package/colors/ocean/colors.css +29 -0
- package/colors/orange/colors.css +29 -0
- package/colors/purple/colors.css +29 -0
- package/colors/red/colors.css +29 -0
- package/colors/yellow/colors.css +29 -0
- package/dist/Components/data/table/DataTable.d.ts.map +1 -1
- package/dist/Components/data/table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Components/dialog/dialog.d.ts.map +1 -1
- package/dist/Components/layout/panel.d.ts.map +1 -1
- package/dist/Components/layout/tabpanel/tabline.d.ts.map +1 -1
- package/dist/Components/lineinputs/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Components/lineinputs/toggle.d.ts.map +1 -1
- package/dist/Components/status/progressBar.d.ts.map +1 -1
- package/dist/Components/theme/stylesheetPicker.d.ts +40 -0
- package/dist/Components/theme/stylesheetPicker.d.ts.map +1 -0
- package/dist/{button-BRDkmR1C.js → button-CqDGmkBt.js} +87 -78
- package/dist/{button-BRDkmR1C.js.map → button-CqDGmkBt.js.map} +1 -1
- package/dist/experimental.js +104 -66
- package/dist/experimental.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +801 -503
- package/dist/index.js.map +1 -1
- package/dist/{jsx-dev-runtime-CarwHDyL.js → jsx-dev-runtime-DukiDpV9.js} +202 -214
- package/dist/jsx-dev-runtime-DukiDpV9.js.map +1 -0
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/styling/baseStyleDefinitions.d.ts +3 -0
- package/dist/styling/baseStyleDefinitions.d.ts.map +1 -1
- package/dist/styling/styleRegistry.d.ts.map +1 -1
- package/dist/styling/theme.d.ts +27 -0
- package/dist/styling/theme.d.ts.map +1 -0
- package/package.json +13 -5
- package/styles/structural.css +916 -0
- package/themes/README.md +84 -30
- package/themes/java/theme.css +140 -0
- package/themes/minimal/theme.css +128 -0
- package/themes/shiny/theme.css +314 -0
- package/dist/jsx-dev-runtime-CarwHDyL.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,163 +1,167 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { C as
|
|
5
|
-
import { F as
|
|
6
|
-
import { a as
|
|
7
|
-
import { B as
|
|
8
|
-
import { Emitter as
|
|
9
|
-
class
|
|
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
|
|
15
|
-
constructor(
|
|
16
|
-
var
|
|
17
|
-
super(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
((
|
|
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(
|
|
34
|
-
|
|
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:
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
|
|
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:
|
|
45
|
-
"aria-label":
|
|
46
|
-
children:
|
|
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:
|
|
49
|
+
id: le(r, d.id),
|
|
50
50
|
type: "button",
|
|
51
51
|
role: "tab",
|
|
52
|
-
disabled: !!
|
|
52
|
+
disabled: !!d.disabled,
|
|
53
53
|
"data-part": "tab",
|
|
54
|
-
"aria-selected": Object.is(
|
|
55
|
-
"aria-controls":
|
|
56
|
-
tabIndex: Object.is(
|
|
57
|
-
onClick: (
|
|
58
|
-
onKeyDown: (
|
|
59
|
-
children:
|
|
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(
|
|
61
|
+
String(d.id)
|
|
62
62
|
))
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
|
-
handleKeyDown(
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
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
|
-
|
|
71
|
+
i.findIndex(({ tabIndex: c }) => c === a)
|
|
72
72
|
);
|
|
73
|
-
let
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
else if (
|
|
77
|
-
|
|
78
|
-
else if (
|
|
79
|
-
else if (
|
|
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 (
|
|
82
|
-
const
|
|
83
|
-
|
|
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
|
-
|
|
87
|
+
n(T, "hostName", "tab-line"), n(T, "standaloneHostName", "tab-line"), n(T, "baseStyles", [
|
|
88
88
|
['& > [data-part="tab"]', ["uiline", "button"]]
|
|
89
|
-
]),
|
|
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-
|
|
94
|
+
background: var(--fray-tabline-background, var(--tabline-bg));
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
& > [data-part="tab"] {
|
|
98
|
-
|
|
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(
|
|
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
|
|
106
|
-
return `${
|
|
107
|
-
}
|
|
108
|
-
function
|
|
109
|
-
return `${
|
|
110
|
-
}
|
|
111
|
-
function
|
|
112
|
-
return encodeURIComponent(String(
|
|
113
|
-
}
|
|
114
|
-
function
|
|
115
|
-
if (!Array.isArray(
|
|
116
|
-
const
|
|
117
|
-
for (const
|
|
118
|
-
if (
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
class
|
|
124
|
-
constructor(
|
|
125
|
-
var
|
|
126
|
-
super(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
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
|
-
|
|
134
|
-
((
|
|
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 =
|
|
140
|
+
), this.activeTabEmitter = this.valueEmitter, this.baseId = E("tabs", e.id);
|
|
137
141
|
}
|
|
138
142
|
initialize() {
|
|
139
|
-
var
|
|
140
|
-
const
|
|
141
|
-
|
|
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(
|
|
144
|
-
var
|
|
145
|
-
super.setProps(
|
|
146
|
-
const
|
|
147
|
-
return
|
|
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
|
|
151
|
-
return /* @__PURE__ */
|
|
152
|
-
|
|
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:
|
|
159
|
+
className: y(this.props) || null,
|
|
156
160
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
|
|
161
|
+
/* @__PURE__ */ u(
|
|
162
|
+
T,
|
|
159
163
|
{
|
|
160
|
-
tabs:
|
|
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
|
-
|
|
172
|
+
a == null ? null : /* @__PURE__ */ u(
|
|
169
173
|
"div",
|
|
170
174
|
{
|
|
171
|
-
id:
|
|
175
|
+
id: se(this.baseId, a.id),
|
|
172
176
|
role: "tabpanel",
|
|
173
177
|
"data-part": "content",
|
|
174
|
-
"aria-labelledby":
|
|
178
|
+
"aria-labelledby": le(this.baseId, a.id),
|
|
175
179
|
tabIndex: 0,
|
|
176
|
-
children:
|
|
180
|
+
children: a.content
|
|
177
181
|
},
|
|
178
|
-
String(
|
|
182
|
+
String(a.id)
|
|
179
183
|
)
|
|
180
184
|
]
|
|
181
185
|
}
|
|
182
186
|
);
|
|
183
187
|
}
|
|
184
188
|
}
|
|
185
|
-
|
|
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,
|
|
193
|
-
border-radius: var(--panel-radius, var(--
|
|
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,
|
|
206
|
+
background: var(--fray-panel-background, var(--panel-bg, transparent));
|
|
203
207
|
}
|
|
204
208
|
`);
|
|
205
|
-
function
|
|
206
|
-
const
|
|
207
|
-
if (!Array.isArray(
|
|
208
|
-
const
|
|
209
|
-
if (!
|
|
210
|
-
const
|
|
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:
|
|
213
|
-
label:
|
|
214
|
-
disabled: !!
|
|
215
|
-
content:
|
|
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
|
-
}),
|
|
218
|
-
...
|
|
219
|
-
label:
|
|
220
|
-
disabled: !!
|
|
221
|
-
content:
|
|
222
|
-
})) :
|
|
223
|
-
for (const
|
|
224
|
-
if ((
|
|
225
|
-
if (
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
return
|
|
229
|
-
}
|
|
230
|
-
class
|
|
231
|
-
constructor(
|
|
232
|
-
super(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
this.panelId =
|
|
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:
|
|
240
|
-
toolbar:
|
|
241
|
-
children:
|
|
242
|
-
orientation:
|
|
243
|
-
disabled:
|
|
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(
|
|
249
|
+
if (!["horizontal", "vertical"].includes(i))
|
|
246
250
|
throw new TypeError("Panel orientation must be horizontal or vertical");
|
|
247
|
-
const
|
|
248
|
-
return /* @__PURE__ */
|
|
249
|
-
|
|
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:
|
|
253
|
-
className:
|
|
254
|
-
"data-orientation":
|
|
255
|
-
"data-disabled":
|
|
256
|
-
"aria-disabled":
|
|
257
|
-
"aria-labelledby":
|
|
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
|
-
|
|
260
|
-
|
|
261
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
271
|
+
n(q, "hostName", "panel"), n(q, "standaloneHostName", "layout-panel"), n(q, "baseStyles", [
|
|
268
272
|
["&", ["panel"]],
|
|
269
273
|
['& > [data-part="header"]', ["sectionheader"]]
|
|
270
|
-
]),
|
|
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
|
|
300
|
-
constructor(
|
|
301
|
-
super(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
this.sidebarId =
|
|
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:
|
|
309
|
-
toolbar:
|
|
310
|
-
ariaLabel:
|
|
311
|
-
children:
|
|
312
|
-
} = this.props,
|
|
313
|
-
return /* @__PURE__ */
|
|
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:
|
|
334
|
+
className: y(this.props) || void 0,
|
|
318
335
|
"data-fray-component": "sidebar",
|
|
319
|
-
"aria-label":
|
|
320
|
-
"aria-labelledby":
|
|
336
|
+
"aria-label": e == null ? r : null,
|
|
337
|
+
"aria-labelledby": e == null ? null : this.headerId,
|
|
321
338
|
children: [
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
347
|
+
n(W, "baseStyles", [
|
|
331
348
|
['aside[data-fray-component="sidebar"]', ["panel"]],
|
|
332
349
|
['aside[data-fray-component="sidebar"] > [data-part="header"]', ["sectionheader"]]
|
|
333
|
-
]),
|
|
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
|
|
377
|
+
class L extends b {
|
|
361
378
|
render() {
|
|
362
379
|
const {
|
|
363
|
-
primary:
|
|
364
|
-
secondary:
|
|
365
|
-
direction:
|
|
366
|
-
primarySize:
|
|
367
|
-
primaryLabel:
|
|
368
|
-
secondaryLabel:
|
|
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 (
|
|
387
|
+
if (a !== "horizontal" && a !== "vertical")
|
|
371
388
|
throw new TypeError("SplitView direction must be horizontal or vertical");
|
|
372
|
-
if (
|
|
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
|
|
375
|
-
return /* @__PURE__ */
|
|
376
|
-
|
|
391
|
+
const d = this.Host;
|
|
392
|
+
return /* @__PURE__ */ v(
|
|
393
|
+
d,
|
|
377
394
|
{
|
|
378
|
-
className:
|
|
379
|
-
"data-direction":
|
|
380
|
-
style:
|
|
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__ */
|
|
399
|
+
/* @__PURE__ */ u(
|
|
383
400
|
"div",
|
|
384
401
|
{
|
|
385
402
|
"data-part": "primary",
|
|
386
|
-
role:
|
|
387
|
-
"aria-label":
|
|
388
|
-
children:
|
|
403
|
+
role: i == null ? null : "region",
|
|
404
|
+
"aria-label": i,
|
|
405
|
+
children: l
|
|
389
406
|
}
|
|
390
407
|
),
|
|
391
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ u(
|
|
392
409
|
"div",
|
|
393
410
|
{
|
|
394
411
|
"data-part": "secondary",
|
|
395
|
-
role:
|
|
396
|
-
"aria-label":
|
|
397
|
-
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
|
-
|
|
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
|
|
457
|
+
class ce extends b {
|
|
441
458
|
render() {
|
|
442
|
-
const { term:
|
|
443
|
-
return /* @__PURE__ */
|
|
459
|
+
const { term: l, value: e, children: a = [] } = this.props;
|
|
460
|
+
return /* @__PURE__ */ v(
|
|
444
461
|
"div",
|
|
445
462
|
{
|
|
446
|
-
className:
|
|
463
|
+
className: y(this.props) || void 0,
|
|
447
464
|
"data-fray-component": "description-item",
|
|
448
465
|
children: [
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ u("dt", { children: l }),
|
|
467
|
+
/* @__PURE__ */ u("dd", { children: e ?? a })
|
|
451
468
|
]
|
|
452
469
|
}
|
|
453
470
|
);
|
|
454
471
|
}
|
|
455
472
|
}
|
|
456
|
-
|
|
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
|
|
500
|
+
class X extends b {
|
|
484
501
|
render() {
|
|
485
|
-
return /* @__PURE__ */
|
|
502
|
+
return /* @__PURE__ */ u(
|
|
486
503
|
"dl",
|
|
487
504
|
{
|
|
488
|
-
className:
|
|
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
|
-
|
|
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
|
|
503
|
-
constructor(
|
|
504
|
-
super({ ...
|
|
519
|
+
const I = class I extends ne {
|
|
520
|
+
constructor(l = {}) {
|
|
521
|
+
super({ ...l, symbols: I.symbols });
|
|
505
522
|
}
|
|
506
523
|
};
|
|
507
|
-
|
|
508
|
-
["✖",
|
|
509
|
-
["☐",
|
|
510
|
-
["✓",
|
|
511
|
-
["+",
|
|
512
|
-
]),
|
|
513
|
-
let
|
|
514
|
-
const
|
|
515
|
-
constructor(
|
|
516
|
-
super({ ...
|
|
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
|
-
|
|
520
|
-
["✖",
|
|
521
|
-
["☐",
|
|
522
|
-
["✓",
|
|
523
|
-
]),
|
|
524
|
-
let
|
|
525
|
-
class
|
|
526
|
-
constructor(
|
|
527
|
-
var
|
|
528
|
-
super(
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
this.inputId =
|
|
535
|
-
const
|
|
536
|
-
|
|
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
|
|
541
|
-
this.valueEmitter =
|
|
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:
|
|
549
|
-
name:
|
|
550
|
-
disabled:
|
|
551
|
-
required:
|
|
552
|
-
error:
|
|
553
|
-
placeholder:
|
|
554
|
-
ariaLabel:
|
|
555
|
-
onChange:
|
|
556
|
-
} = this.props,
|
|
557
|
-
|
|
558
|
-
const
|
|
559
|
-
return /* @__PURE__ */
|
|
560
|
-
|
|
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:
|
|
563
|
-
"data-disabled":
|
|
564
|
-
"data-required":
|
|
565
|
-
"data-error":
|
|
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
|
-
|
|
568
|
-
/* @__PURE__ */
|
|
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:
|
|
573
|
-
value:
|
|
574
|
-
disabled:
|
|
575
|
-
required:
|
|
576
|
-
"aria-label":
|
|
577
|
-
"aria-invalid":
|
|
578
|
-
"aria-describedby":
|
|
579
|
-
onChange: (
|
|
580
|
-
const
|
|
581
|
-
this.valueEmitter.set(R, "dropdown selection"),
|
|
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
|
-
|
|
585
|
-
|
|
586
|
-
if (
|
|
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__ */
|
|
605
|
+
return /* @__PURE__ */ u(
|
|
589
606
|
"option",
|
|
590
607
|
{
|
|
591
|
-
value: String(
|
|
592
|
-
disabled: !!
|
|
593
|
-
selected: Object.is(
|
|
594
|
-
children:
|
|
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(
|
|
613
|
+
String(f.value)
|
|
597
614
|
);
|
|
598
615
|
})
|
|
599
616
|
]
|
|
600
617
|
}
|
|
601
618
|
),
|
|
602
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
]),
|
|
639
|
+
]), n(C, "css", m`
|
|
623
640
|
& {
|
|
624
641
|
position: relative;
|
|
625
642
|
}
|
|
626
643
|
`);
|
|
627
|
-
function
|
|
628
|
-
return
|
|
629
|
-
}
|
|
630
|
-
function
|
|
631
|
-
const
|
|
632
|
-
if (
|
|
633
|
-
throw new TypeError(`${
|
|
634
|
-
return Reflect.get(
|
|
635
|
-
}
|
|
636
|
-
class
|
|
637
|
-
constructor(
|
|
638
|
-
super(
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
this.inputId =
|
|
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:
|
|
650
|
-
placeholder:
|
|
651
|
-
type:
|
|
652
|
-
name:
|
|
653
|
-
disabled:
|
|
654
|
-
required:
|
|
655
|
-
readOnly:
|
|
656
|
-
error:
|
|
657
|
-
autoComplete:
|
|
658
|
-
inputMode:
|
|
659
|
-
minLength:
|
|
660
|
-
maxLength:
|
|
661
|
-
pattern:
|
|
662
|
-
ariaLabel:
|
|
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:
|
|
665
|
-
onChange:
|
|
666
|
-
} = this.props,
|
|
667
|
-
return /* @__PURE__ */
|
|
668
|
-
|
|
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:
|
|
671
|
-
"data-disabled":
|
|
672
|
-
"data-required":
|
|
673
|
-
"data-error":
|
|
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
|
-
|
|
676
|
-
/* @__PURE__ */
|
|
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:
|
|
681
|
-
type:
|
|
682
|
-
value:
|
|
683
|
-
placeholder:
|
|
684
|
-
disabled:
|
|
685
|
-
required:
|
|
686
|
-
readOnly:
|
|
687
|
-
autoComplete:
|
|
688
|
-
inputMode:
|
|
689
|
-
minLength:
|
|
690
|
-
maxLength:
|
|
691
|
-
pattern:
|
|
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":
|
|
694
|
-
"aria-invalid":
|
|
695
|
-
"aria-describedby":
|
|
696
|
-
onInput: (
|
|
697
|
-
const
|
|
698
|
-
this.valueEmitter.set(
|
|
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: (
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
717
|
+
onChange: (A) => N(
|
|
718
|
+
ue,
|
|
719
|
+
_(A, "textbox change"),
|
|
720
|
+
A
|
|
704
721
|
)
|
|
705
722
|
}
|
|
706
723
|
),
|
|
707
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
]),
|
|
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(--
|
|
751
|
+
color: var(--fray-color-error, var(--error-color));
|
|
735
752
|
}
|
|
736
753
|
`);
|
|
737
|
-
function
|
|
738
|
-
const
|
|
739
|
-
if (
|
|
740
|
-
throw new TypeError(`${
|
|
741
|
-
return Reflect.get(
|
|
742
|
-
}
|
|
743
|
-
class
|
|
744
|
-
constructor(
|
|
745
|
-
var
|
|
746
|
-
super(
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
const
|
|
751
|
-
|
|
752
|
-
const
|
|
753
|
-
this.valueEmitter =
|
|
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
|
-
|
|
756
|
-
|
|
772
|
+
e,
|
|
773
|
+
r ?? null,
|
|
757
774
|
"toggle value"
|
|
758
|
-
), this.groupId =
|
|
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(
|
|
764
|
-
this.props.disabled || (this.valueEmitter.set(
|
|
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:
|
|
769
|
-
label:
|
|
770
|
-
disabled:
|
|
771
|
-
required:
|
|
785
|
+
options: e = [],
|
|
786
|
+
label: a,
|
|
787
|
+
disabled: r = !1,
|
|
788
|
+
required: i = !1
|
|
772
789
|
} = this.props;
|
|
773
|
-
|
|
774
|
-
const
|
|
790
|
+
te(e);
|
|
791
|
+
const s = this.valueEmitter.get(), d = Math.max(
|
|
775
792
|
0,
|
|
776
|
-
|
|
793
|
+
e.findIndex(([c]) => Object.is(c, s))
|
|
777
794
|
);
|
|
778
|
-
return /* @__PURE__ */
|
|
795
|
+
return /* @__PURE__ */ v(
|
|
779
796
|
"fieldset",
|
|
780
797
|
{
|
|
781
798
|
id: this.groupId,
|
|
782
|
-
disabled:
|
|
783
|
-
className:
|
|
799
|
+
disabled: r,
|
|
800
|
+
className: y(this.props) || void 0,
|
|
784
801
|
"data-fray-component": "toggle",
|
|
785
|
-
"data-disabled":
|
|
786
|
-
"aria-required":
|
|
802
|
+
"data-disabled": r ? "" : null,
|
|
803
|
+
"aria-required": i ? "true" : null,
|
|
787
804
|
children: [
|
|
788
|
-
|
|
789
|
-
/* @__PURE__ */
|
|
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":
|
|
795
|
-
"aria-labelledby":
|
|
796
|
-
children:
|
|
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:
|
|
818
|
+
disabled: r,
|
|
802
819
|
"data-part": "option",
|
|
803
|
-
"aria-checked": Object.is(
|
|
804
|
-
"data-value": String(
|
|
805
|
-
tabIndex:
|
|
806
|
-
onClick: (
|
|
807
|
-
onKeyDown: (
|
|
808
|
-
children:
|
|
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(
|
|
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(
|
|
819
|
-
const { key:
|
|
820
|
-
let
|
|
821
|
-
if (
|
|
822
|
-
else if (
|
|
823
|
-
|
|
824
|
-
else if (
|
|
825
|
-
else if (
|
|
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
|
-
|
|
828
|
-
const
|
|
829
|
-
if (
|
|
830
|
-
const
|
|
831
|
-
|
|
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
|
-
|
|
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
|
-
]),
|
|
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(
|
|
864
|
-
|
|
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
|
|
868
|
-
|
|
869
|
-
for (const
|
|
870
|
-
if (!Array.isArray(
|
|
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
|
|
894
|
+
class P extends b {
|
|
874
895
|
render() {
|
|
875
896
|
const {
|
|
876
|
-
children:
|
|
877
|
-
id:
|
|
878
|
-
label:
|
|
879
|
-
orientation:
|
|
897
|
+
children: l = [],
|
|
898
|
+
id: e,
|
|
899
|
+
label: a = "Actions",
|
|
900
|
+
orientation: r = "horizontal"
|
|
880
901
|
} = this.props;
|
|
881
|
-
if (!["horizontal", "vertical"].includes(
|
|
902
|
+
if (!["horizontal", "vertical"].includes(r))
|
|
882
903
|
throw new TypeError("Toolbar orientation must be horizontal or vertical");
|
|
883
|
-
const
|
|
884
|
-
return /* @__PURE__ */
|
|
885
|
-
|
|
904
|
+
const i = this.Host;
|
|
905
|
+
return /* @__PURE__ */ u(
|
|
906
|
+
i,
|
|
886
907
|
{
|
|
887
|
-
id:
|
|
908
|
+
id: e,
|
|
888
909
|
role: "toolbar",
|
|
889
|
-
className:
|
|
890
|
-
"data-orientation":
|
|
891
|
-
"aria-label":
|
|
892
|
-
"aria-orientation":
|
|
893
|
-
children:
|
|
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
|
-
|
|
919
|
+
n(P, "hostName", "toolbar"), n(P, "standaloneHostName", "tool-bar"), n(P, "baseStyles", [
|
|
899
920
|
["&", ["toolbar"]]
|
|
900
|
-
]),
|
|
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
|
|
915
|
-
constructor(
|
|
916
|
-
super(
|
|
917
|
-
|
|
918
|
-
if (this.progressId =
|
|
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
|
|
923
|
-
if (!Number.isFinite(
|
|
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
|
|
926
|
-
if (
|
|
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
|
|
929
|
-
return /* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
/* @__PURE__ */
|
|
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__ */
|
|
955
|
+
/* @__PURE__ */ u(
|
|
935
956
|
"progress",
|
|
936
957
|
{
|
|
937
958
|
id: this.progressId,
|
|
938
|
-
value:
|
|
939
|
-
max:
|
|
940
|
-
"aria-valuetext":
|
|
941
|
-
children:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
976
|
-
return
|
|
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
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
$ as
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
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
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
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
|