clio.css-preact 0.0.0-stage → 2.0.1
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/LICENSE +21 -0
- package/README.md +58 -2
- package/dist/index.js +522 -0
- package/dist/types/components/src/Button.d.ts +6 -0
- package/dist/types/components/src/Checkbox.d.ts +5 -0
- package/dist/types/components/src/Chrome.d.ts +68 -0
- package/dist/types/components/src/Dialog.d.ts +11 -0
- package/dist/types/components/src/FieldRow.d.ts +5 -0
- package/dist/types/components/src/Fields.d.ts +31 -0
- package/dist/types/components/src/Lists.d.ts +22 -0
- package/dist/types/components/src/Menu.d.ts +18 -0
- package/dist/types/components/src/Misc.d.ts +44 -0
- package/dist/types/components/src/Window.d.ts +15 -0
- package/dist/types/components/src/cx.d.ts +2 -0
- package/dist/types/components/src/index.d.ts +10 -0
- package/dist/types/preact/src/jsx.d.ts +5 -0
- package/package.json +46 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 clio.css contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,59 @@
|
|
|
1
|
-
#
|
|
1
|
+
# clio.css-preact
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
clio.css's 32 components (windows, menus, controls, dialogs, the NeXTSTEP dock…) as Preact
|
|
4
|
+
components. Each renders exactly the markup documented at https://surfine.github.io/clio.css/,
|
|
5
|
+
so the look comes from [clio.css](https://www.npmjs.com/package/clio.css) itself and the
|
|
6
|
+
behaviour (menu tracking, scroll bars, dragged outlines) from its optional clio.js. The
|
|
7
|
+
components are controlled: props in, events out, no state or behaviour of their own.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install clio.css clio.css-preact preact
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import "clio.css"; // with a bundler; or link dist/clio.css
|
|
15
|
+
import { install } from "clio.css/js.esm"; // optional: clio.js's behaviour
|
|
16
|
+
import { Window, Button, FieldRow } from "clio.css-preact";
|
|
17
|
+
|
|
18
|
+
install();
|
|
19
|
+
|
|
20
|
+
export const App = () => (
|
|
21
|
+
<div data-era="platinum">
|
|
22
|
+
<Window title="Macintosh HD" style={{ width: "300px" }}>
|
|
23
|
+
<FieldRow>
|
|
24
|
+
<Button>Cancel</Button>
|
|
25
|
+
<Button default>OK</Button>
|
|
26
|
+
</FieldRow>
|
|
27
|
+
</Window>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Set the era with `data-era` on any ancestor: `system6` (default), `system7`, `drawingboard`,
|
|
33
|
+
`platinum`. NeXTSTEP needs `clio.css/nextstep` instead of the default stylesheet; `Browser`,
|
|
34
|
+
`PullDown`, `Dock` and `DockItem` are drawn only there.
|
|
35
|
+
|
|
36
|
+
## Components
|
|
37
|
+
|
|
38
|
+
`AlertBox`, `Balloon`, `BevelButton`, `Browser`, `Button`, `ChasingArrows`, `Checkbox`, `ClioScope`, `ControlStrip`, `ControlStripModule`, `Desktop`, `DesktopIcon`, `Disclosure`, `Dock`, `DockItem`, `FieldRow`, `Fieldset`, `HelpButton`, `ImageWell`, `ListView`, `ListViewCell`, `ListViewHeader`, `Listbox`, `ListboxOption`, `LittleArrows`, `MenuBar`, `MenuBarItem`, `MenuItem`, `MenuSeparator`, `Placard`, `Progress`, `PullDown`, `Radio`, `RoundedWindow`, `ScrollArea`, `Select`, `Slider`, `SortDirectionHeader`, `SplitBar`, `SplitLine`, `SplitView`, `StandardDialog`, `Tab`, `TabList`, `TabPanel`, `Text`, `TextArea`, `TextField`, `UtilityWindow`, `Window`.
|
|
39
|
+
|
|
40
|
+
Props are typed (`dist/types`); each component's markup, tokens and evidence are on the docs
|
|
41
|
+
site under the same name, and `clio.css/components.json` lists them for tools.
|
|
42
|
+
|
|
43
|
+
## Versions
|
|
44
|
+
|
|
45
|
+
- Same version number as clio.css; the peer range is `clio.css >= 2.0.0` and preact >= 11.
|
|
46
|
+
- The DOM each component renders is part of clio.css's markup: it changes only with
|
|
47
|
+
clio.css's, and both are checked to match `components.json` in `npm test` and, from the
|
|
48
|
+
packed tarballs, in `npm run verify`.
|
|
49
|
+
- Component names and props follow semver only and are not part of clio.css's long-term
|
|
50
|
+
promise: they may change in a minor version, with a CHANGELOG note. The rendered DOM is.
|
|
51
|
+
|
|
52
|
+
## Source
|
|
53
|
+
|
|
54
|
+
Written once in JSX in [`packages/components`](https://github.com/surfine/clio.css/tree/main/packages/components),
|
|
55
|
+
which builds this package and its React twin (`clio.css-react`). Built with heavy AI
|
|
56
|
+
assistance; the markup check and clio.css's [EVIDENCE.md](https://github.com/surfine/clio.css/blob/main/EVIDENCE.md)
|
|
57
|
+
are how to verify it.
|
|
58
|
+
|
|
59
|
+
MIT, see [LICENSE](LICENSE). Not affiliated with or endorsed by Apple Inc. or NeXT.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
2
|
+
// packages/components/src/cx.ts
|
|
3
|
+
/** Class names from strings and flags: cx("window", inactive && "inactive"). */
|
|
4
|
+
var cx = (...names) => names.filter(Boolean).join(" ");
|
|
5
|
+
// packages/components/src/Button.tsx
|
|
6
|
+
function Button({ default: isDefault, pressed, className, ...rest }) {
|
|
7
|
+
return /* @__PURE__ */ jsx("button", {
|
|
8
|
+
...rest,
|
|
9
|
+
className: cx(isDefault && "default", pressed && "active", className) || void 0
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
// packages/components/src/Checkbox.tsx
|
|
13
|
+
function Checkbox({ label, ...input }) {
|
|
14
|
+
return /* @__PURE__ */ jsxs("label", { children: [
|
|
15
|
+
/* @__PURE__ */ jsx("input", {
|
|
16
|
+
...input,
|
|
17
|
+
type: "checkbox"
|
|
18
|
+
}),
|
|
19
|
+
" ",
|
|
20
|
+
label
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
// packages/components/src/FieldRow.tsx
|
|
24
|
+
function FieldRow({ stacked, className, ...rest }) {
|
|
25
|
+
return /* @__PURE__ */ jsx("div", {
|
|
26
|
+
...rest,
|
|
27
|
+
className: cx(stacked ? "field-row-stacked" : "field-row", className)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
// packages/components/src/Window.tsx
|
|
31
|
+
function Window({ title, titleAs: Title = "h3", inactive, shade, details, paneProps, onClose, onZoom, onShade, className, children, ...rest }) {
|
|
32
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
...rest,
|
|
34
|
+
className: cx("window", inactive && "inactive", className),
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsxs("div", {
|
|
37
|
+
className: "title-bar",
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsx("button", {
|
|
40
|
+
className: "close",
|
|
41
|
+
"aria-label": "Close",
|
|
42
|
+
onClick: onClose
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsx(Title, {
|
|
45
|
+
className: "title",
|
|
46
|
+
children: title
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ jsx("button", {
|
|
49
|
+
className: "resize",
|
|
50
|
+
"aria-label": "Zoom",
|
|
51
|
+
onClick: onZoom
|
|
52
|
+
}),
|
|
53
|
+
shade && /* @__PURE__ */ jsx("button", {
|
|
54
|
+
className: "shade",
|
|
55
|
+
"aria-label": "Collapse",
|
|
56
|
+
onClick: onShade
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
}),
|
|
60
|
+
details && /* @__PURE__ */ jsx("div", {
|
|
61
|
+
className: "details-bar",
|
|
62
|
+
children: details.map((d, i) => /* @__PURE__ */ jsx("span", { children: d }, i))
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ jsx("div", {
|
|
65
|
+
...paneProps,
|
|
66
|
+
className: cx("window-pane", paneProps?.className),
|
|
67
|
+
children
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
// packages/components/src/Dialog.tsx
|
|
73
|
+
function AlertBox({ icon, message, messageId, children, className, ...rest }) {
|
|
74
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
75
|
+
"aria-labelledby": messageId,
|
|
76
|
+
...rest,
|
|
77
|
+
className: cx("alert-box", className),
|
|
78
|
+
role: "alertdialog",
|
|
79
|
+
children: [
|
|
80
|
+
icon && /* @__PURE__ */ jsx("span", {
|
|
81
|
+
className: cx("alert-icon", icon),
|
|
82
|
+
"aria-hidden": "true"
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ jsx("p", {
|
|
85
|
+
id: messageId,
|
|
86
|
+
children: message
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ jsx("div", {
|
|
89
|
+
className: "dialog-buttons",
|
|
90
|
+
children
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function StandardDialog({ className, ...rest }) {
|
|
96
|
+
return /* @__PURE__ */ jsx("div", {
|
|
97
|
+
...rest,
|
|
98
|
+
className: cx("standard-dialog", className)
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
// packages/components/src/Chrome.tsx
|
|
102
|
+
/** Control Strip; children are ControlStripModules. */
|
|
103
|
+
function ControlStrip({ collapsed, scrollBackDisabled, scrollForwardDisabled, onScrollBack, onScrollForward, onToggle, label = "Control Strip", className, children, ...rest }) {
|
|
104
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
105
|
+
...rest,
|
|
106
|
+
className: cx("control-strip", collapsed && "is-collapsed", className),
|
|
107
|
+
children: [
|
|
108
|
+
!collapsed && /* @__PURE__ */ jsx("button", {
|
|
109
|
+
className: "control-strip-scroll control-strip-scroll-back",
|
|
110
|
+
disabled: !!scrollBackDisabled,
|
|
111
|
+
"aria-label": "Scroll back",
|
|
112
|
+
onClick: onScrollBack
|
|
113
|
+
}),
|
|
114
|
+
!collapsed && /* @__PURE__ */ jsx("div", {
|
|
115
|
+
className: "control-strip-modules",
|
|
116
|
+
role: "toolbar",
|
|
117
|
+
"aria-label": label,
|
|
118
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
119
|
+
className: "control-strip-module-track",
|
|
120
|
+
children
|
|
121
|
+
})
|
|
122
|
+
}),
|
|
123
|
+
!collapsed && /* @__PURE__ */ jsx("button", {
|
|
124
|
+
className: "control-strip-scroll control-strip-scroll-forward",
|
|
125
|
+
disabled: !!scrollForwardDisabled,
|
|
126
|
+
"aria-label": "Scroll forward",
|
|
127
|
+
onClick: onScrollForward
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ jsx("button", {
|
|
130
|
+
className: "control-strip-handle",
|
|
131
|
+
"aria-label": collapsed ? "Expand Control Strip" : "Collapse Control Strip",
|
|
132
|
+
onClick: onToggle
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/** One module button; children are its icon (an <svg>). Name it with aria-label. */
|
|
138
|
+
function ControlStripModule({ open, className, ...rest }) {
|
|
139
|
+
return /* @__PURE__ */ jsx("button", {
|
|
140
|
+
"aria-haspopup": "menu",
|
|
141
|
+
"aria-expanded": !!open,
|
|
142
|
+
...rest,
|
|
143
|
+
className: cx("control-strip-module", className)
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function Desktop({ className, ...rest }) {
|
|
147
|
+
return /* @__PURE__ */ jsx("div", {
|
|
148
|
+
...rest,
|
|
149
|
+
className: cx("desktop", className)
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function DesktopIcon({ label, selected, children, className, ...rest }) {
|
|
153
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
154
|
+
...rest,
|
|
155
|
+
"aria-pressed": !!selected,
|
|
156
|
+
className: cx("icon", selected && "selected", className),
|
|
157
|
+
children: [children, /* @__PURE__ */ jsx("span", { children: label })]
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/** NeXTSTEP workspace dock. */
|
|
161
|
+
function Dock({ className, ...rest }) {
|
|
162
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
163
|
+
...rest,
|
|
164
|
+
className: cx("dock", className)
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function DockItem({ name, running = true, buttonProps, children, className, ...rest }) {
|
|
168
|
+
return /* @__PURE__ */ jsx("li", {
|
|
169
|
+
...rest,
|
|
170
|
+
className: cx(!running && "not-running", className) || void 0,
|
|
171
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
172
|
+
"aria-label": `${name} (${running ? "running" : "not running"})`,
|
|
173
|
+
...buttonProps,
|
|
174
|
+
className: cx("icon", buttonProps?.className),
|
|
175
|
+
children
|
|
176
|
+
})
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function RoundedWindow({ title, onClose, className, children, ...rest }) {
|
|
180
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
181
|
+
...rest,
|
|
182
|
+
className: cx("rounded-window", className),
|
|
183
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
184
|
+
className: "rounded-title",
|
|
185
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
186
|
+
className: "close",
|
|
187
|
+
"aria-label": "Close",
|
|
188
|
+
onClick: onClose
|
|
189
|
+
}), /* @__PURE__ */ jsx("h3", { children: title })]
|
|
190
|
+
}), children]
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
/** Utility (palette) window: close and collapse boxes, optional side title. */
|
|
194
|
+
function UtilityWindow({ title, side, onClose, onCollapse, paneProps, className, children, ...rest }) {
|
|
195
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
196
|
+
...rest,
|
|
197
|
+
className: cx("window", "utility", side && "side", className),
|
|
198
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
199
|
+
className: "title-bar",
|
|
200
|
+
children: [
|
|
201
|
+
/* @__PURE__ */ jsx("button", {
|
|
202
|
+
className: "close",
|
|
203
|
+
"aria-label": "Close",
|
|
204
|
+
onClick: onClose
|
|
205
|
+
}),
|
|
206
|
+
/* @__PURE__ */ jsx("h3", {
|
|
207
|
+
className: "title",
|
|
208
|
+
children: title
|
|
209
|
+
}),
|
|
210
|
+
/* @__PURE__ */ jsx("button", {
|
|
211
|
+
className: "collapse",
|
|
212
|
+
"aria-label": "Collapse",
|
|
213
|
+
onClick: onCollapse
|
|
214
|
+
})
|
|
215
|
+
]
|
|
216
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
217
|
+
...paneProps,
|
|
218
|
+
className: cx("window-pane", paneProps?.className),
|
|
219
|
+
children
|
|
220
|
+
})]
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
function SplitView({ className, ...rest }) {
|
|
224
|
+
return /* @__PURE__ */ jsx("div", {
|
|
225
|
+
...rest,
|
|
226
|
+
className: cx("split-view", className)
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
/** The draggable split box at the scroll bar's end. */
|
|
230
|
+
function SplitBar({ className, ...rest }) {
|
|
231
|
+
return /* @__PURE__ */ jsx("div", {
|
|
232
|
+
"aria-label": "Split",
|
|
233
|
+
...rest,
|
|
234
|
+
role: "separator",
|
|
235
|
+
className: cx("split-bar", className)
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/** The line between the panes. */
|
|
239
|
+
function SplitLine({ className, ...rest }) {
|
|
240
|
+
return /* @__PURE__ */ jsx("div", {
|
|
241
|
+
...rest,
|
|
242
|
+
role: "separator",
|
|
243
|
+
className: cx("split-line", className)
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
/** Tab row: children are Tabs. Name it with aria-label. */
|
|
247
|
+
function TabList({ className, ...rest }) {
|
|
248
|
+
return /* @__PURE__ */ jsx("div", {
|
|
249
|
+
...rest,
|
|
250
|
+
role: "tablist",
|
|
251
|
+
className
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
function Tab({ selected, ...rest }) {
|
|
255
|
+
return /* @__PURE__ */ jsx("button", {
|
|
256
|
+
...rest,
|
|
257
|
+
role: "tab",
|
|
258
|
+
"aria-selected": !!selected
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
function TabPanel(props) {
|
|
262
|
+
return /* @__PURE__ */ jsx("div", {
|
|
263
|
+
...props,
|
|
264
|
+
role: "tabpanel"
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
// packages/components/src/Fields.tsx
|
|
268
|
+
function Radio({ label, ...input }) {
|
|
269
|
+
return /* @__PURE__ */ jsxs("label", { children: [
|
|
270
|
+
/* @__PURE__ */ jsx("input", {
|
|
271
|
+
...input,
|
|
272
|
+
type: "radio"
|
|
273
|
+
}),
|
|
274
|
+
" ",
|
|
275
|
+
label
|
|
276
|
+
] });
|
|
277
|
+
}
|
|
278
|
+
function Fieldset({ legend, children, ...rest }) {
|
|
279
|
+
return /* @__PURE__ */ jsxs("fieldset", {
|
|
280
|
+
...rest,
|
|
281
|
+
children: [/* @__PURE__ */ jsx("legend", { children: legend }), children]
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
function TextField({ label, type = "text", id, ...input }) {
|
|
285
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [label != null && /* @__PURE__ */ jsx("label", {
|
|
286
|
+
htmlFor: id,
|
|
287
|
+
children: label
|
|
288
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
289
|
+
...input,
|
|
290
|
+
id,
|
|
291
|
+
type
|
|
292
|
+
})] });
|
|
293
|
+
}
|
|
294
|
+
function TextArea({ label, id, ...area }) {
|
|
295
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [label != null && /* @__PURE__ */ jsx("label", {
|
|
296
|
+
htmlFor: id,
|
|
297
|
+
children: label
|
|
298
|
+
}), /* @__PURE__ */ jsx("textarea", {
|
|
299
|
+
...area,
|
|
300
|
+
id
|
|
301
|
+
})] });
|
|
302
|
+
}
|
|
303
|
+
/** The pop-up menu: a native <select>; pass <option>s as children. */
|
|
304
|
+
function Select({ label, id, ...select }) {
|
|
305
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [label != null && /* @__PURE__ */ jsx("label", {
|
|
306
|
+
htmlFor: id,
|
|
307
|
+
children: label
|
|
308
|
+
}), /* @__PURE__ */ jsx("select", {
|
|
309
|
+
...select,
|
|
310
|
+
id
|
|
311
|
+
})] });
|
|
312
|
+
}
|
|
313
|
+
function Slider({ ticks, className, style, ...input }) {
|
|
314
|
+
const s = ticks === void 0 ? style : {
|
|
315
|
+
...style ?? {},
|
|
316
|
+
"--clio-slider-tick-count": String(ticks)
|
|
317
|
+
};
|
|
318
|
+
return /* @__PURE__ */ jsx("input", {
|
|
319
|
+
...input,
|
|
320
|
+
type: "range",
|
|
321
|
+
className: cx(ticks !== void 0 && "ticks", className) || void 0,
|
|
322
|
+
style: s
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
/** Progress bar; children are the fallback text ("62%"). Omit `value` for indeterminate. */
|
|
326
|
+
function Progress(props) {
|
|
327
|
+
return /* @__PURE__ */ jsx("progress", { ...props });
|
|
328
|
+
}
|
|
329
|
+
// packages/components/src/Lists.tsx
|
|
330
|
+
function Listbox({ className, ...rest }) {
|
|
331
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
332
|
+
...rest,
|
|
333
|
+
role: "listbox",
|
|
334
|
+
className: cx("listbox", className)
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
function ListboxOption({ selected, branch, className, ...rest }) {
|
|
338
|
+
return /* @__PURE__ */ jsx("li", {
|
|
339
|
+
...rest,
|
|
340
|
+
role: "option",
|
|
341
|
+
"aria-selected": selected || void 0,
|
|
342
|
+
className: cx(branch && "branch", className) || void 0
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
/** NeXTSTEP browser: columns of list boxes side by side. */
|
|
346
|
+
function Browser({ className, ...rest }) {
|
|
347
|
+
return /* @__PURE__ */ jsx("div", {
|
|
348
|
+
...rest,
|
|
349
|
+
className: cx("browser", className)
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
function ListView({ className, ...rest }) {
|
|
353
|
+
return /* @__PURE__ */ jsx("table", {
|
|
354
|
+
...rest,
|
|
355
|
+
className: cx("list-view", className)
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
/** A column header; `sort` marks the sorted column. */
|
|
359
|
+
function ListViewHeader({ sort, ...rest }) {
|
|
360
|
+
return /* @__PURE__ */ jsx("th", {
|
|
361
|
+
...rest,
|
|
362
|
+
"aria-sort": sort
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
/** The header cell that carries the sort-direction arrow. */
|
|
366
|
+
function SortDirectionHeader({ className, ...rest }) {
|
|
367
|
+
return /* @__PURE__ */ jsx("th", {
|
|
368
|
+
"aria-label": "Sort direction",
|
|
369
|
+
...rest,
|
|
370
|
+
className: cx("sort-direction", className)
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
function ListViewCell({ sorted, className, ...rest }) {
|
|
374
|
+
return /* @__PURE__ */ jsx("td", {
|
|
375
|
+
...rest,
|
|
376
|
+
className: cx(sorted && "sorted", className) || void 0
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
// packages/components/src/Menu.tsx
|
|
380
|
+
function MenuBar({ className, ...rest }) {
|
|
381
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
382
|
+
role: "menubar",
|
|
383
|
+
...rest,
|
|
384
|
+
className: cx("menu-bar", className)
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
function MenuBarItem({ label, open, buttonProps, children, className, ...rest }) {
|
|
388
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
389
|
+
role: "none",
|
|
390
|
+
...rest,
|
|
391
|
+
className: cx(open && "open", className) || void 0,
|
|
392
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
393
|
+
role: "menuitem",
|
|
394
|
+
"aria-haspopup": "true",
|
|
395
|
+
"aria-expanded": !!open,
|
|
396
|
+
...buttonProps,
|
|
397
|
+
children: label
|
|
398
|
+
}), children != null && children !== false && /* @__PURE__ */ jsx("ul", {
|
|
399
|
+
className: "menu",
|
|
400
|
+
role: "menu",
|
|
401
|
+
children
|
|
402
|
+
})]
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
function MenuItem({ shortcut, checked, disabled, children, ...rest }) {
|
|
406
|
+
const check = checked !== void 0;
|
|
407
|
+
return /* @__PURE__ */ jsx("li", {
|
|
408
|
+
role: "none",
|
|
409
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
410
|
+
...rest,
|
|
411
|
+
role: check ? "menuitemcheckbox" : "menuitem",
|
|
412
|
+
"aria-checked": check ? checked : void 0,
|
|
413
|
+
"aria-disabled": disabled ? true : void 0,
|
|
414
|
+
children: [children, shortcut != null && /* @__PURE__ */ jsxs(Fragment, { children: [" ", /* @__PURE__ */ jsx("kbd", { children: shortcut })] })]
|
|
415
|
+
})
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
function MenuSeparator() {
|
|
419
|
+
return /* @__PURE__ */ jsx("li", { role: "separator" });
|
|
420
|
+
}
|
|
421
|
+
// packages/components/src/Misc.tsx
|
|
422
|
+
function BevelButton({ menu, pressed, className, ...rest }) {
|
|
423
|
+
return /* @__PURE__ */ jsx("button", {
|
|
424
|
+
"aria-haspopup": menu ? "menu" : void 0,
|
|
425
|
+
...rest,
|
|
426
|
+
"aria-pressed": pressed,
|
|
427
|
+
className: cx("bevel", menu && "menu", className)
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
function HelpButton({ className, ...rest }) {
|
|
431
|
+
return /* @__PURE__ */ jsx("button", {
|
|
432
|
+
"aria-label": "Help",
|
|
433
|
+
...rest,
|
|
434
|
+
className: cx("help-button", className)
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
/** The paired up/down arrows beside a number field. */
|
|
438
|
+
function LittleArrows({ onIncrease, onDecrease, increaseLabel = "Increase", decreaseLabel = "Decrease", className, ...rest }) {
|
|
439
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
440
|
+
...rest,
|
|
441
|
+
role: "group",
|
|
442
|
+
className: cx("little-arrows", className),
|
|
443
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
444
|
+
className: "up",
|
|
445
|
+
"aria-label": increaseLabel,
|
|
446
|
+
onClick: onIncrease
|
|
447
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
448
|
+
className: "down",
|
|
449
|
+
"aria-label": decreaseLabel,
|
|
450
|
+
onClick: onDecrease
|
|
451
|
+
})]
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
/** The busy indicator; label it with aria-label. */
|
|
455
|
+
function ChasingArrows({ className, ...rest }) {
|
|
456
|
+
return /* @__PURE__ */ jsx("span", {
|
|
457
|
+
...rest,
|
|
458
|
+
role: "status",
|
|
459
|
+
className: cx("chasing-arrows", className)
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
function ImageWell({ className, ...rest }) {
|
|
463
|
+
return /* @__PURE__ */ jsx("div", {
|
|
464
|
+
...rest,
|
|
465
|
+
className: cx("image-well", className)
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
/** Help balloon (Balloon Help). */
|
|
469
|
+
function Balloon({ className, ...rest }) {
|
|
470
|
+
return /* @__PURE__ */ jsx("div", {
|
|
471
|
+
...rest,
|
|
472
|
+
role: "tooltip",
|
|
473
|
+
className: cx("balloon", className)
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
/** A status placard at a window's edge ("Page 1"). */
|
|
477
|
+
function Placard({ className, ...rest }) {
|
|
478
|
+
return /* @__PURE__ */ jsx("span", {
|
|
479
|
+
...rest,
|
|
480
|
+
role: "status",
|
|
481
|
+
className: cx("placard", className)
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
/** NeXTSTEP pull-down list button. */
|
|
485
|
+
function PullDown({ open, className, ...rest }) {
|
|
486
|
+
return /* @__PURE__ */ jsx("button", {
|
|
487
|
+
"aria-haspopup": "menu",
|
|
488
|
+
"aria-expanded": !!open,
|
|
489
|
+
...rest,
|
|
490
|
+
className: cx("pull-down", className)
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
/** The disclosure triangle button (for the native <details>, clio.css styles <summary> itself). */
|
|
494
|
+
function Disclosure({ expanded, className, ...rest }) {
|
|
495
|
+
return /* @__PURE__ */ jsx("button", {
|
|
496
|
+
...rest,
|
|
497
|
+
"aria-expanded": !!expanded,
|
|
498
|
+
className: cx("disclosure", className)
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
/** Scope element: the era's tokens and font apply inside it. */
|
|
502
|
+
function ClioScope({ className, ...rest }) {
|
|
503
|
+
return /* @__PURE__ */ jsx("div", {
|
|
504
|
+
...rest,
|
|
505
|
+
className: cx("clio", className)
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
/** A scrolling region drawn with the era's scroll bars. */
|
|
509
|
+
function ScrollArea({ className, ...rest }) {
|
|
510
|
+
return /* @__PURE__ */ jsx("div", {
|
|
511
|
+
...rest,
|
|
512
|
+
className: cx("clio", "clio-scroll", className)
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
/** Type scale: heading (system font), text (application font) or display (any other size). */
|
|
516
|
+
function Text({ variant, as = "p", className, ...rest }) {
|
|
517
|
+
return /* @__PURE__ */ jsx(as, {
|
|
518
|
+
...rest,
|
|
519
|
+
className: cx(variant, className)
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
export { AlertBox, Balloon, BevelButton, Browser, Button, ChasingArrows, Checkbox, ClioScope, ControlStrip, ControlStripModule, Desktop, DesktopIcon, Disclosure, Dock, DockItem, FieldRow, Fieldset, HelpButton, ImageWell, ListView, ListViewCell, ListViewHeader, Listbox, ListboxOption, LittleArrows, MenuBar, MenuBarItem, MenuItem, MenuSeparator, Placard, Progress, PullDown, Radio, RoundedWindow, ScrollArea, Select, Slider, SortDirectionHeader, SplitBar, SplitLine, SplitView, StandardDialog, Tab, TabList, TabPanel, Text, TextArea, TextField, UtilityWindow, Window };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Attrs } from "../../preact/src/jsx.js";
|
|
2
|
+
export type ButtonProps = Attrs<"button"> & {
|
|
3
|
+
default?: boolean;
|
|
4
|
+
pressed?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function Button({ default: isDefault, pressed, className, ...rest }: ButtonProps): import("preact").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Attrs, Node } from "../../preact/src/jsx.js";
|
|
2
|
+
export type ControlStripProps = Attrs<"div"> & {
|
|
3
|
+
/** Folded to its handle. */
|
|
4
|
+
collapsed?: boolean;
|
|
5
|
+
scrollBackDisabled?: boolean;
|
|
6
|
+
scrollForwardDisabled?: boolean;
|
|
7
|
+
onScrollBack?: () => void;
|
|
8
|
+
onScrollForward?: () => void;
|
|
9
|
+
/** The handle's click (fold or unfold). */
|
|
10
|
+
onToggle?: () => void;
|
|
11
|
+
/** Accessible name of the module toolbar. */
|
|
12
|
+
label?: string;
|
|
13
|
+
};
|
|
14
|
+
/** Control Strip; children are ControlStripModules. */
|
|
15
|
+
export declare function ControlStrip({ collapsed, scrollBackDisabled, scrollForwardDisabled, onScrollBack, onScrollForward, onToggle, label, className, children, ...rest }: ControlStripProps): import("preact").JSX.Element;
|
|
16
|
+
export type ControlStripModuleProps = Attrs<"button"> & {
|
|
17
|
+
open?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/** One module button; children are its icon (an <svg>). Name it with aria-label. */
|
|
20
|
+
export declare function ControlStripModule({ open, className, ...rest }: ControlStripModuleProps): import("preact").JSX.Element;
|
|
21
|
+
export declare function Desktop({ className, ...rest }: Attrs<"div">): import("preact").JSX.Element;
|
|
22
|
+
export type DesktopIconProps = Omit<Attrs<"button">, "children"> & {
|
|
23
|
+
label: Node;
|
|
24
|
+
selected?: boolean;
|
|
25
|
+
/** The icon artwork (an <svg>). */
|
|
26
|
+
children?: Node;
|
|
27
|
+
};
|
|
28
|
+
export declare function DesktopIcon({ label, selected, children, className, ...rest }: DesktopIconProps): import("preact").JSX.Element;
|
|
29
|
+
/** NeXTSTEP workspace dock. */
|
|
30
|
+
export declare function Dock({ className, ...rest }: Attrs<"ul">): import("preact").JSX.Element;
|
|
31
|
+
export type DockItemProps = Omit<Attrs<"li">, "children"> & {
|
|
32
|
+
/** The app's name; the button reads "<name> (running)" or "(not running)". */
|
|
33
|
+
name: string;
|
|
34
|
+
/** Default true. */
|
|
35
|
+
running?: boolean;
|
|
36
|
+
buttonProps?: Attrs<"button">;
|
|
37
|
+
/** The icon artwork (an <svg>). */
|
|
38
|
+
children?: Node;
|
|
39
|
+
};
|
|
40
|
+
export declare function DockItem({ name, running, buttonProps, children, className, ...rest }: DockItemProps): import("preact").JSX.Element;
|
|
41
|
+
export type RoundedWindowProps = Omit<Attrs<"div">, "title"> & {
|
|
42
|
+
title: Node;
|
|
43
|
+
onClose?: () => void;
|
|
44
|
+
};
|
|
45
|
+
export declare function RoundedWindow({ title, onClose, className, children, ...rest }: RoundedWindowProps): import("preact").JSX.Element;
|
|
46
|
+
export type UtilityWindowProps = Omit<Attrs<"div">, "title"> & {
|
|
47
|
+
title: Node;
|
|
48
|
+
/** Title runs down the side. */
|
|
49
|
+
side?: boolean;
|
|
50
|
+
onClose?: () => void;
|
|
51
|
+
onCollapse?: () => void;
|
|
52
|
+
paneProps?: Attrs<"div">;
|
|
53
|
+
};
|
|
54
|
+
/** Utility (palette) window: close and collapse boxes, optional side title. */
|
|
55
|
+
export declare function UtilityWindow({ title, side, onClose, onCollapse, paneProps, className, children, ...rest }: UtilityWindowProps): import("preact").JSX.Element;
|
|
56
|
+
export declare function SplitView({ className, ...rest }: Attrs<"div">): import("preact").JSX.Element;
|
|
57
|
+
/** The draggable split box at the scroll bar's end. */
|
|
58
|
+
export declare function SplitBar({ className, ...rest }: Omit<Attrs<"div">, "role">): import("preact").JSX.Element;
|
|
59
|
+
/** The line between the panes. */
|
|
60
|
+
export declare function SplitLine({ className, ...rest }: Omit<Attrs<"div">, "role">): import("preact").JSX.Element;
|
|
61
|
+
export type TabsProps = Attrs<"div">;
|
|
62
|
+
/** Tab row: children are Tabs. Name it with aria-label. */
|
|
63
|
+
export declare function TabList({ className, ...rest }: Omit<TabsProps, "role">): import("preact").JSX.Element;
|
|
64
|
+
export type TabProps = Omit<Attrs<"button">, "role"> & {
|
|
65
|
+
selected?: boolean;
|
|
66
|
+
};
|
|
67
|
+
export declare function Tab({ selected, ...rest }: TabProps): import("preact").JSX.Element;
|
|
68
|
+
export declare function TabPanel(props: Omit<TabsProps, "role">): import("preact").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Attrs, Node } from "../../preact/src/jsx.js";
|
|
2
|
+
export type AlertBoxProps = Omit<Attrs<"div">, "role"> & {
|
|
3
|
+
icon?: "caution" | "note" | "stop";
|
|
4
|
+
/** The message; labels the dialog (aria-labelledby points at it). */
|
|
5
|
+
message: Node;
|
|
6
|
+
messageId: string;
|
|
7
|
+
/** The buttons, drawn in the dialog-buttons row (mark the default one with <Button default>). */
|
|
8
|
+
children?: Node;
|
|
9
|
+
};
|
|
10
|
+
export declare function AlertBox({ icon, message, messageId, children, className, ...rest }: AlertBoxProps): import("preact").JSX.Element;
|
|
11
|
+
export declare function StandardDialog({ className, ...rest }: Attrs<"div">): import("preact").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Attrs, Node } from "../../preact/src/jsx.js";
|
|
2
|
+
export type RadioProps = Omit<Attrs<"input">, "type" | "role"> & {
|
|
3
|
+
label: Node;
|
|
4
|
+
};
|
|
5
|
+
export declare function Radio({ label, ...input }: RadioProps): import("preact").JSX.Element;
|
|
6
|
+
export type FieldsetProps = Omit<Attrs<"fieldset">, "title"> & {
|
|
7
|
+
legend: Node;
|
|
8
|
+
};
|
|
9
|
+
export declare function Fieldset({ legend, children, ...rest }: FieldsetProps): import("preact").JSX.Element;
|
|
10
|
+
export type TextFieldProps = Omit<Attrs<"input">, "type" | "role"> & {
|
|
11
|
+
label?: Node;
|
|
12
|
+
type?: "text" | "search" | "password" | "email" | "url" | "tel" | "number";
|
|
13
|
+
};
|
|
14
|
+
export declare function TextField({ label, type, id, ...input }: TextFieldProps): import("preact").JSX.Element;
|
|
15
|
+
export type TextAreaProps = Attrs<"textarea"> & {
|
|
16
|
+
label?: Node;
|
|
17
|
+
};
|
|
18
|
+
export declare function TextArea({ label, id, ...area }: TextAreaProps): import("preact").JSX.Element;
|
|
19
|
+
export type SelectProps = Attrs<"select"> & {
|
|
20
|
+
label?: Node;
|
|
21
|
+
};
|
|
22
|
+
/** The pop-up menu: a native <select>; pass <option>s as children. */
|
|
23
|
+
export declare function Select({ label, id, ...select }: SelectProps): import("preact").JSX.Element;
|
|
24
|
+
export type SliderProps = Omit<Attrs<"input">, "type" | "role"> & {
|
|
25
|
+
/** Draw this many tick marks (sets --clio-slider-tick-count). */
|
|
26
|
+
ticks?: number;
|
|
27
|
+
};
|
|
28
|
+
export declare function Slider({ ticks, className, style, ...input }: SliderProps): import("preact").JSX.Element;
|
|
29
|
+
export type ProgressProps = Attrs<"progress">;
|
|
30
|
+
/** Progress bar; children are the fallback text ("62%"). Omit `value` for indeterminate. */
|
|
31
|
+
export declare function Progress(props: ProgressProps): import("preact").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Attrs } from "../../preact/src/jsx.js";
|
|
2
|
+
export type ListboxProps = Omit<Attrs<"ul">, "role">;
|
|
3
|
+
export declare function Listbox({ className, ...rest }: ListboxProps): import("preact").JSX.Element;
|
|
4
|
+
export type ListboxOptionProps = Omit<Attrs<"li">, "role"> & {
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
/** NeXTSTEP browser: the row opens a column to its right. */
|
|
7
|
+
branch?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function ListboxOption({ selected, branch, className, ...rest }: ListboxOptionProps): import("preact").JSX.Element;
|
|
10
|
+
/** NeXTSTEP browser: columns of list boxes side by side. */
|
|
11
|
+
export declare function Browser({ className, ...rest }: Attrs<"div">): import("preact").JSX.Element;
|
|
12
|
+
export declare function ListView({ className, ...rest }: Attrs<"table">): import("preact").JSX.Element;
|
|
13
|
+
export type ListViewHeaderProps = Attrs<"th"> & {
|
|
14
|
+
sort?: "ascending" | "descending";
|
|
15
|
+
};
|
|
16
|
+
/** A column header; `sort` marks the sorted column. */
|
|
17
|
+
export declare function ListViewHeader({ sort, ...rest }: ListViewHeaderProps): import("preact").JSX.Element;
|
|
18
|
+
/** The header cell that carries the sort-direction arrow. */
|
|
19
|
+
export declare function SortDirectionHeader({ className, ...rest }: Attrs<"th">): import("preact").JSX.Element;
|
|
20
|
+
export declare function ListViewCell({ sorted, className, ...rest }: Attrs<"td"> & {
|
|
21
|
+
sorted?: boolean;
|
|
22
|
+
}): import("preact").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Attrs, Node } from "../../preact/src/jsx.js";
|
|
2
|
+
export type MenuBarProps = Attrs<"ul">;
|
|
3
|
+
export declare function MenuBar({ className, ...rest }: MenuBarProps): import("preact").JSX.Element;
|
|
4
|
+
export type MenuBarItemProps = Omit<Attrs<"li">, "title"> & {
|
|
5
|
+
label: Node;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
buttonProps?: Attrs<"button">;
|
|
8
|
+
};
|
|
9
|
+
export declare function MenuBarItem({ label, open, buttonProps, children, className, ...rest }: MenuBarItemProps): import("preact").JSX.Element;
|
|
10
|
+
export type MenuItemProps = Omit<Attrs<"button">, "role" | "type"> & {
|
|
11
|
+
/** A trailing shortcut, drawn as <kbd>. */
|
|
12
|
+
shortcut?: Node;
|
|
13
|
+
/** Present: a check-mark item (menuitemcheckbox) with this state. */
|
|
14
|
+
checked?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare function MenuItem({ shortcut, checked, disabled, children, ...rest }: MenuItemProps): import("preact").JSX.Element;
|
|
18
|
+
export declare function MenuSeparator(): import("preact").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Attrs } from "../../preact/src/jsx.js";
|
|
2
|
+
export type BevelButtonProps = Attrs<"button"> & {
|
|
3
|
+
/** A pop-up bevel button (draws the menu arrow). */
|
|
4
|
+
menu?: boolean;
|
|
5
|
+
/** A toggle: present sets aria-pressed. */
|
|
6
|
+
pressed?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function BevelButton({ menu, pressed, className, ...rest }: BevelButtonProps): import("preact").JSX.Element;
|
|
9
|
+
export declare function HelpButton({ className, ...rest }: Attrs<"button">): import("preact").JSX.Element;
|
|
10
|
+
export type LittleArrowsProps = Omit<Attrs<"span">, "role"> & {
|
|
11
|
+
onIncrease?: () => void;
|
|
12
|
+
onDecrease?: () => void;
|
|
13
|
+
increaseLabel?: string;
|
|
14
|
+
decreaseLabel?: string;
|
|
15
|
+
};
|
|
16
|
+
/** The paired up/down arrows beside a number field. */
|
|
17
|
+
export declare function LittleArrows({ onIncrease, onDecrease, increaseLabel, decreaseLabel, className, ...rest }: LittleArrowsProps): import("preact").JSX.Element;
|
|
18
|
+
/** The busy indicator; label it with aria-label. */
|
|
19
|
+
export declare function ChasingArrows({ className, ...rest }: Omit<Attrs<"span">, "role">): import("preact").JSX.Element;
|
|
20
|
+
export declare function ImageWell({ className, ...rest }: Attrs<"div">): import("preact").JSX.Element;
|
|
21
|
+
/** Help balloon (Balloon Help). */
|
|
22
|
+
export declare function Balloon({ className, ...rest }: Omit<Attrs<"div">, "role">): import("preact").JSX.Element;
|
|
23
|
+
/** A status placard at a window's edge ("Page 1"). */
|
|
24
|
+
export declare function Placard({ className, ...rest }: Omit<Attrs<"span">, "role">): import("preact").JSX.Element;
|
|
25
|
+
export type PullDownProps = Attrs<"button"> & {
|
|
26
|
+
open?: boolean;
|
|
27
|
+
};
|
|
28
|
+
/** NeXTSTEP pull-down list button. */
|
|
29
|
+
export declare function PullDown({ open, className, ...rest }: PullDownProps): import("preact").JSX.Element;
|
|
30
|
+
export type DisclosureProps = Attrs<"button"> & {
|
|
31
|
+
expanded?: boolean;
|
|
32
|
+
};
|
|
33
|
+
/** The disclosure triangle button (for the native <details>, clio.css styles <summary> itself). */
|
|
34
|
+
export declare function Disclosure({ expanded, className, ...rest }: DisclosureProps): import("preact").JSX.Element;
|
|
35
|
+
/** Scope element: the era's tokens and font apply inside it. */
|
|
36
|
+
export declare function ClioScope({ className, ...rest }: Attrs<"div">): import("preact").JSX.Element;
|
|
37
|
+
/** A scrolling region drawn with the era's scroll bars. */
|
|
38
|
+
export declare function ScrollArea({ className, ...rest }: Attrs<"div">): import("preact").JSX.Element;
|
|
39
|
+
export type TextProps = Attrs<"p"> & {
|
|
40
|
+
variant: "heading" | "text" | "display";
|
|
41
|
+
as?: "p" | "h1" | "h2" | "h3" | "h4" | "span" | "div";
|
|
42
|
+
};
|
|
43
|
+
/** Type scale: heading (system font), text (application font) or display (any other size). */
|
|
44
|
+
export declare function Text({ variant, as, className, ...rest }: TextProps): import("preact").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Attrs, Node } from "../../preact/src/jsx.js";
|
|
2
|
+
export type WindowProps = Omit<Attrs<"div">, "title"> & {
|
|
3
|
+
title: Node;
|
|
4
|
+
titleAs?: "h1" | "h2" | "h3" | "h4";
|
|
5
|
+
inactive?: boolean;
|
|
6
|
+
/** Draw the WindowShade (collapse) box. */
|
|
7
|
+
shade?: boolean;
|
|
8
|
+
/** The details bar's cells (item count, disk use). */
|
|
9
|
+
details?: Node[];
|
|
10
|
+
paneProps?: Attrs<"div">;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
onZoom?: () => void;
|
|
13
|
+
onShade?: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function Window({ title, titleAs: Title, inactive, shade, details, paneProps, onClose, onZoom, onShade, className, children, ...rest }: WindowProps): import("preact").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { Button, type ButtonProps } from "./Button.js";
|
|
2
|
+
export { Checkbox, type CheckboxProps } from "./Checkbox.js";
|
|
3
|
+
export { FieldRow, type FieldRowProps } from "./FieldRow.js";
|
|
4
|
+
export { Window, type WindowProps } from "./Window.js";
|
|
5
|
+
export { AlertBox, type AlertBoxProps, StandardDialog } from "./Dialog.js";
|
|
6
|
+
export { ControlStrip, type ControlStripProps, ControlStripModule, type ControlStripModuleProps, Desktop, DesktopIcon, type DesktopIconProps, Dock, DockItem, type DockItemProps, RoundedWindow, type RoundedWindowProps, UtilityWindow, type UtilityWindowProps, SplitView, SplitBar, SplitLine, TabList, Tab, type TabProps, TabPanel, } from "./Chrome.js";
|
|
7
|
+
export { Fieldset, type FieldsetProps, Progress, type ProgressProps, Radio, type RadioProps, Select, type SelectProps, Slider, type SliderProps, TextArea, type TextAreaProps, TextField, type TextFieldProps, } from "./Fields.js";
|
|
8
|
+
export { Browser, Listbox, type ListboxProps, ListboxOption, type ListboxOptionProps, ListView, ListViewCell, ListViewHeader, type ListViewHeaderProps, SortDirectionHeader, } from "./Lists.js";
|
|
9
|
+
export { MenuBar, type MenuBarProps, MenuBarItem, type MenuBarItemProps, MenuItem, type MenuItemProps, MenuSeparator } from "./Menu.js";
|
|
10
|
+
export { Balloon, BevelButton, type BevelButtonProps, ChasingArrows, ClioScope, Disclosure, type DisclosureProps, HelpButton, ImageWell, LittleArrows, type LittleArrowsProps, Placard, PullDown, type PullDownProps, ScrollArea, Text, type TextProps, } from "./Misc.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentChildren, JSX } from "preact";
|
|
2
|
+
export { useEffect, useLayoutEffect, useRef } from "preact/hooks";
|
|
3
|
+
export type Node = ComponentChildren;
|
|
4
|
+
/** A native element's attributes, as this framework types them. */
|
|
5
|
+
export type Attrs<T extends keyof JSX.IntrinsicElements> = JSX.IntrinsicElements[T];
|
package/package.json
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clio.css-preact",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "clio.css components for Preact: one JSX source, rendering clio.css markup (load clio.css and, for behaviour, clio.js).",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/types/components/src/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"types": "./dist/types/components/src/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"LICENSE",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"preact": ">=11.0.0",
|
|
21
|
+
"clio.css": ">=2.0.0"
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"homepage": "https://surfine.github.io/clio.css/",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/surfine/clio.css/issues"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/surfine/clio.css.git",
|
|
31
|
+
"directory": "packages/preact"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"clio.css",
|
|
35
|
+
"preact",
|
|
36
|
+
"classic mac os",
|
|
37
|
+
"system 6",
|
|
38
|
+
"system 7",
|
|
39
|
+
"mac os 9",
|
|
40
|
+
"platinum",
|
|
41
|
+
"nextstep",
|
|
42
|
+
"components"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"prepack": "cd ../.. && node tooling/build.ts && node tooling/build-components.ts",
|
|
46
|
+
"prepublishOnly": "node ../../tooling/release-guard.ts --stamp"
|
|
47
|
+
}
|
|
48
|
+
}
|