@syware/jlib 0.11.0 → 0.12.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 +32 -12
- package/dist/atoms/jl-checkbox.js +1 -0
- package/dist/atoms/jl-input.d.ts +2 -0
- package/dist/atoms/jl-input.js +11 -2
- package/dist/atoms/jl-link.css.js +1 -1
- package/dist/atoms/jl-link.d.ts +15 -1
- package/dist/atoms/jl-link.js +34 -2
- package/dist/atoms/jl-select.d.ts +12 -0
- package/dist/atoms/jl-select.js +50 -5
- package/dist/atoms/jl-slider.js +2 -1
- package/dist/atoms/jl-switch.js +1 -0
- package/dist/atoms/jl-textarea.js +1 -0
- package/dist/base/jl-form-control.d.ts +7 -0
- package/dist/base/jl-form-control.js +10 -0
- package/dist/molecules/jl-breadcrumb.css.js +1 -1
- package/dist/molecules/jl-breadcrumb.d.ts +10 -4
- package/dist/molecules/jl-breadcrumb.js +22 -2
- package/dist/molecules/jl-combobox.js +9 -2
- package/dist/molecules/jl-date-picker.js +6 -0
- package/dist/molecules/jl-facts.css.js +1 -1
- package/dist/molecules/jl-facts.d.ts +5 -1
- package/dist/molecules/jl-facts.js +16 -2
- package/dist/molecules/jl-file-drop.js +1 -0
- package/dist/molecules/jl-number-input.js +5 -1
- package/dist/molecules/jl-search.js +2 -0
- package/dist/molecules/jl-tag-input.js +9 -2
- package/dist/organisms/jl-command-palette.js +1 -0
- package/dist/organisms/jl-dialog.css.js +1 -1
- package/dist/organisms/jl-drawer.css.js +1 -1
- package/dist/organisms/jl-side-nav.css.js +1 -1
- package/dist/organisms/jl-side-nav.js +1 -1
- package/dist/organisms/jl-table.css.js +1 -1
- package/dist/organisms/jl-table.js +1 -0
- package/dist/templates/jl-page.d.ts +7 -2
- package/dist/templates/jl-page.js +5 -3
- package/dist/templates/jl-split-view.css.js +1 -1
- package/dist/types/jl-breadcrumb.types.d.ts +6 -2
- package/dist/types/jl-facts.types.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,18 +83,38 @@ part of the page.
|
|
|
83
83
|
|
|
84
84
|
## Vibe coding
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
86
|
+
Two skills teach coding agents to build on jlib: `jlib-official`, the components (each one's whole API, offline),
|
|
87
|
+
the way an app is written on them, the mistakes agents make and a self-check; and `syware-ux`, how SyWare's apps
|
|
88
|
+
behave, every UX pattern in full and the checklist a page is reviewed against. They build on Jadis's skill,
|
|
89
|
+
`jadis-official`. Install them in one of three ways:
|
|
90
|
+
|
|
91
|
+
- **Claude Code**, as plugins that update with each release; `syware-ux` brings `jlib-official`, which brings
|
|
92
|
+
`jadis-official` (for an app that does not follow SyWare's UX, install `jlib-official@jlib`):
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
/plugin marketplace add bioleyl/jadis
|
|
96
|
+
/plugin marketplace add bioleyl/jlib
|
|
97
|
+
/plugin install syware-ux@jlib
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
- **Any agent**, with [skills.sh](https://skills.sh) (Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot,
|
|
101
|
+
OpenCode…):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx skills add bioleyl/jlib
|
|
105
|
+
npx skills add bioleyl/jadis
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- **Any agent**, with the install script, which asks which skills and where: `~/.agents/skills`, `~/.claude/skills`,
|
|
109
|
+
the project's `.agents/skills` or `.claude/skills`, or another folder (`--help` for the options):
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
curl -fsSL https://raw.githubusercontent.com/bioleyl/jlib/main/install-skill.sh | sh
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The skills are in [plugins/](plugins): [jlib-official](plugins/jlib-official/skills/jlib-official/SKILL.md) and
|
|
116
|
+
[syware-ux](plugins/syware-ux/skills/syware-ux/SKILL.md). How a team shares them and how to ask well: the site's
|
|
117
|
+
[Vibe coding](https://bioleyl.github.io/jlib/vibe-coding) page.
|
|
98
118
|
|
|
99
119
|
## Development
|
|
100
120
|
|
package/dist/atoms/jl-input.d.ts
CHANGED
|
@@ -102,6 +102,8 @@ export declare class JlInput extends JlFormControl {
|
|
|
102
102
|
templateHtml(): Node;
|
|
103
103
|
templateCss(): string;
|
|
104
104
|
onConnect(): void;
|
|
105
|
+
/** Enter: `enter` for the page, then the form submits, as from a native field. */
|
|
106
|
+
private onKey;
|
|
105
107
|
protected resetValue(): void;
|
|
106
108
|
/** The browser calls it for a disabled fieldset and for the element's own disabled attribute, even before render. */
|
|
107
109
|
protected setDisabledByForm(disabled: boolean): void;
|
package/dist/atoms/jl-input.js
CHANGED
|
@@ -104,7 +104,10 @@ var JlInput = class extends JlFormControl {
|
|
|
104
104
|
hidden: true
|
|
105
105
|
}),
|
|
106
106
|
/* @__PURE__ */ jsx("slot", { name: "start" }),
|
|
107
|
-
/* @__PURE__ */ jsx("input", {
|
|
107
|
+
/* @__PURE__ */ jsx("input", {
|
|
108
|
+
class: "native",
|
|
109
|
+
id: "field"
|
|
110
|
+
}),
|
|
108
111
|
/* @__PURE__ */ jsx("button", {
|
|
109
112
|
class: "action clear",
|
|
110
113
|
type: "button",
|
|
@@ -139,10 +142,16 @@ var JlInput = class extends JlFormControl {
|
|
|
139
142
|
this.events.emit("input", native.value);
|
|
140
143
|
});
|
|
141
144
|
this.on(native, "change", () => this.events.emit("change", native.value));
|
|
142
|
-
this.on(native, "keydown", (event) =>
|
|
145
|
+
this.on(native, "keydown", (event) => this.onKey(event));
|
|
143
146
|
this.on(this._refs.clear, "click", () => this.clearValue());
|
|
144
147
|
this.on(this._refs.reveal, "click", () => this.toggleReveal());
|
|
145
148
|
}
|
|
149
|
+
/** Enter: `enter` for the page, then the form submits, as from a native field. */
|
|
150
|
+
onKey(event) {
|
|
151
|
+
if (event.key !== ENTER) return;
|
|
152
|
+
this.events.emit("enter", this._refs.native.value);
|
|
153
|
+
this.submitImplicitly(event);
|
|
154
|
+
}
|
|
146
155
|
resetValue() {
|
|
147
156
|
this.value.set(this.getAttribute("value") ?? "");
|
|
148
157
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/atoms/jl-link.css?inline
|
|
2
|
-
var jl_link_default = ":host{--color:var(--jl-accent);--hover:var(--jl-accent-strong);--underline:color-mix(in srgb, var(--jl-accent) 40%, transparent);display:inline}:host([variant=muted]){--color:var(--jl-muted);--hover:var(--jl-text);--underline:transparent}:host([variant=quiet]){--underline:transparent}a{color:var(--color);text-decoration:underline;-webkit-text-decoration-color:var(--underline);text-decoration-color:var(--underline);text-underline-offset:.2em;cursor:pointer;transition:color var(--jl-fast) var(--jl-ease), text-decoration-color var(--jl-fast) var(--jl-ease);border-radius:3px;font-weight:600;text-decoration-thickness:1px}a:hover{color:var(--hover);text-decoration-color:currentColor}a:not([href]){cursor:default}jl-icon{vertical-align:-.1em;margin-left:.2em}";
|
|
2
|
+
var jl_link_default = ":host{--color:var(--jl-accent);--hover:var(--jl-accent-strong);--underline:color-mix(in srgb, var(--jl-accent) 40%, transparent);display:inline}:host([variant=muted]){--color:var(--jl-muted);--hover:var(--jl-text);--underline:transparent}:host([variant=quiet]){--underline:transparent}a{color:var(--color);text-decoration:underline;-webkit-text-decoration-color:var(--underline);text-decoration-color:var(--underline);text-underline-offset:.2em;cursor:pointer;transition:color var(--jl-fast) var(--jl-ease), text-decoration-color var(--jl-fast) var(--jl-ease);border-radius:3px;font-weight:600;text-decoration-thickness:1px}a:hover{color:var(--hover);text-decoration-color:currentColor}a:not([href]){cursor:default}:host([interactive]) a:not([href]){cursor:pointer}jl-icon{vertical-align:-.1em;margin-left:.2em}";
|
|
3
3
|
export { jl_link_default as default };
|
package/dist/atoms/jl-link.d.ts
CHANGED
|
@@ -3,10 +3,14 @@ import type { LinkVariant } from '../types/jl-link.types';
|
|
|
3
3
|
export declare const LINK_VARIANTS: readonly LinkVariant[];
|
|
4
4
|
/**
|
|
5
5
|
* A link in text or in a list: the browser's own `<a>`, styled. `external` opens it in a new tab, safely, with an
|
|
6
|
-
* icon that says so. Its text is the `label` or the slotted content.
|
|
6
|
+
* icon that says so. Its text is the `label` or the slotted content. `interactive` without an `href`, it fires
|
|
7
|
+
* `press` instead: the app follows it itself (a router's `goto`).
|
|
7
8
|
*/
|
|
8
9
|
export declare class JlLink extends JlElement {
|
|
9
10
|
static readonly selector = "jl-link";
|
|
11
|
+
readonly events: Readonly<import("@jadis/core").UseEventsHandler<{
|
|
12
|
+
press: undefined;
|
|
13
|
+
}>>;
|
|
10
14
|
readonly href: Readonly<Readonly<{
|
|
11
15
|
get(): string;
|
|
12
16
|
set(setter: string | ((prevState: string) => string)): void;
|
|
@@ -29,9 +33,19 @@ export declare class JlLink extends JlElement {
|
|
|
29
33
|
get(): LinkVariant;
|
|
30
34
|
set(setter: ((prevState: LinkVariant) => LinkVariant) | LinkVariant): void;
|
|
31
35
|
}>>;
|
|
36
|
+
/** Without an `href`, it fires `press` when followed, by a click or Enter, for the app to go there itself. */
|
|
37
|
+
readonly interactive: Readonly<Readonly<{
|
|
38
|
+
get(): boolean;
|
|
39
|
+
set(setter: boolean | ((prevState: boolean) => boolean)): void;
|
|
40
|
+
}>>;
|
|
32
41
|
private readonly _refs;
|
|
33
42
|
focus(options?: FocusOptions): void;
|
|
34
43
|
templateHtml(): Node;
|
|
35
44
|
templateCss(): string;
|
|
45
|
+
onConnect(): void;
|
|
46
|
+
/** An interactive link without an address fires `press`; one with an address leaves it to the browser. */
|
|
47
|
+
private pressable;
|
|
48
|
+
/** Followed by the app, the link is still a link to the keyboard and to screen readers. */
|
|
49
|
+
private renderInteraction;
|
|
36
50
|
private renderTarget;
|
|
37
51
|
}
|
package/dist/atoms/jl-link.js
CHANGED
|
@@ -18,13 +18,16 @@ var LINK_VARIANTS = [
|
|
|
18
18
|
var NEW_TAB = "_blank";
|
|
19
19
|
var SAFE_REL = "noopener noreferrer";
|
|
20
20
|
var ICON_SIZE = 13;
|
|
21
|
+
var ENTER = "Enter";
|
|
21
22
|
/**
|
|
22
23
|
* A link in text or in a list: the browser's own `<a>`, styled. `external` opens it in a new tab, safely, with an
|
|
23
|
-
* icon that says so. Its text is the `label` or the slotted content.
|
|
24
|
+
* icon that says so. Its text is the `label` or the slotted content. `interactive` without an `href`, it fires
|
|
25
|
+
* `press` instead: the app follows it itself (a router's `goto`).
|
|
24
26
|
*/
|
|
25
27
|
var JlLink = class extends JlElement {
|
|
26
28
|
static selector = "jl-link";
|
|
27
|
-
|
|
29
|
+
events = this.useEvents();
|
|
30
|
+
href = this.useChange("", () => this.renderInteraction(), { attribute: "href" });
|
|
28
31
|
label = this.useChange("", (value) => {
|
|
29
32
|
this._refs.label.textContent = value;
|
|
30
33
|
this._refs.label.hidden = value === "";
|
|
@@ -37,6 +40,11 @@ var JlLink = class extends JlElement {
|
|
|
37
40
|
attribute: "variant",
|
|
38
41
|
parse: oneOf(LINK_VARIANTS, "default")
|
|
39
42
|
});
|
|
43
|
+
/** Without an `href`, it fires `press` when followed, by a click or Enter, for the app to go there itself. */
|
|
44
|
+
interactive = this.useChange(false, (value) => {
|
|
45
|
+
this.reflect("interactive", value);
|
|
46
|
+
this.renderInteraction();
|
|
47
|
+
}, { attribute: "interactive" });
|
|
40
48
|
_refs = this.useRefs((ref) => ({
|
|
41
49
|
anchor: ref("a"),
|
|
42
50
|
icon: ref(JlIcon),
|
|
@@ -71,6 +79,30 @@ var JlLink = class extends JlElement {
|
|
|
71
79
|
templateCss() {
|
|
72
80
|
return css`${BASE_STYLES}${jl_link_default}`;
|
|
73
81
|
}
|
|
82
|
+
onConnect() {
|
|
83
|
+
const anchor = this._refs.anchor;
|
|
84
|
+
this.on(anchor, "click", () => {
|
|
85
|
+
if (this.pressable()) this.events.emit("press");
|
|
86
|
+
});
|
|
87
|
+
this.on(anchor, "keydown", (event) => {
|
|
88
|
+
if (this.pressable() && event.key === ENTER) {
|
|
89
|
+
event.preventDefault();
|
|
90
|
+
this.events.emit("press");
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/** An interactive link without an address fires `press`; one with an address leaves it to the browser. */
|
|
95
|
+
pressable() {
|
|
96
|
+
return this.interactive.get() && this.href.get() === "";
|
|
97
|
+
}
|
|
98
|
+
/** Followed by the app, the link is still a link to the keyboard and to screen readers. */
|
|
99
|
+
renderInteraction() {
|
|
100
|
+
const anchor = this._refs.anchor;
|
|
101
|
+
setOrRemove(anchor, "href", this.href.get());
|
|
102
|
+
const pressable = this.pressable();
|
|
103
|
+
setOrRemove(anchor, "role", pressable ? "link" : "");
|
|
104
|
+
setOrRemove(anchor, "tabindex", pressable ? "0" : "");
|
|
105
|
+
}
|
|
74
106
|
renderTarget() {
|
|
75
107
|
const anchor = this._refs.anchor;
|
|
76
108
|
const external = this.external.get();
|
|
@@ -50,6 +50,7 @@ export declare class JlSelect<Value extends string = string> extends JlFormContr
|
|
|
50
50
|
set(setter: boolean | ((prevState: boolean) => boolean)): void;
|
|
51
51
|
}>>;
|
|
52
52
|
private readonly _form;
|
|
53
|
+
private _kept;
|
|
53
54
|
private readonly _refs;
|
|
54
55
|
focus(options?: FocusOptions): void;
|
|
55
56
|
templateHtml(): Node;
|
|
@@ -62,7 +63,18 @@ export declare class JlSelect<Value extends string = string> extends JlFormContr
|
|
|
62
63
|
/** The options from `options`, or else copies of the `<option>` and `<optgroup>` the page wrote inside. */
|
|
63
64
|
private optionNodes;
|
|
64
65
|
private placeholderNodes;
|
|
66
|
+
/**
|
|
67
|
+
* Draws every option again: only when the options change. Chrome's customizable select reports, as an option
|
|
68
|
+
* inside an option, an option the page added and removed before its check ran.
|
|
69
|
+
*/
|
|
65
70
|
private renderOptions;
|
|
71
|
+
/** Another value among the options drawn: only the option kept for an unknown value comes or goes. */
|
|
72
|
+
private renderChosen;
|
|
73
|
+
/** Another placeholder: its own option is written, added or removed, the others left as they are. */
|
|
74
|
+
private renderPlaceholder;
|
|
75
|
+
private writePlaceholder;
|
|
76
|
+
/** The option kept for a value no option has goes once another value is chosen. */
|
|
77
|
+
private dropKept;
|
|
66
78
|
/**
|
|
67
79
|
* A value no option has (a choice since removed, options still loading) shows as an option of its own, first, so
|
|
68
80
|
* the field shows what is saved and the form keeps it, rather than another choice.
|
package/dist/atoms/jl-select.js
CHANGED
|
@@ -43,12 +43,12 @@ var JlSelect = class extends JlFormControl {
|
|
|
43
43
|
parse: jsonOf([])
|
|
44
44
|
});
|
|
45
45
|
/** The chosen value. One that no option has is kept, as an option of its own, rather than replaced. */
|
|
46
|
-
value = this.useChange(NO_VALUE, () => this.
|
|
46
|
+
value = this.useChange(NO_VALUE, () => this.renderChosen(), {
|
|
47
47
|
attribute: "value",
|
|
48
48
|
parse: textOf(NO_VALUE)
|
|
49
49
|
});
|
|
50
50
|
/** Shown while nothing is chosen; it cannot be picked back from the list. */
|
|
51
|
-
placeholder = this.useChange("", () => this.
|
|
51
|
+
placeholder = this.useChange("", () => this.renderPlaceholder(), { attribute: "placeholder" });
|
|
52
52
|
size = this.useChange("md", (value) => this.reflect("size", value), {
|
|
53
53
|
attribute: "size",
|
|
54
54
|
parse: oneOf(CONTROL_SIZES, "md")
|
|
@@ -70,6 +70,7 @@ var JlSelect = class extends JlFormControl {
|
|
|
70
70
|
this._refs.native.toggleAttribute("aria-invalid", value);
|
|
71
71
|
}, { attribute: "invalid" });
|
|
72
72
|
_form = { disabled: false };
|
|
73
|
+
_kept;
|
|
73
74
|
_refs = this.useRefs((ref) => ({ native: ref("select") }));
|
|
74
75
|
focus(options) {
|
|
75
76
|
this._refs.native.focus(options);
|
|
@@ -78,7 +79,10 @@ var JlSelect = class extends JlFormControl {
|
|
|
78
79
|
return /* @__PURE__ */ jsxs("div", {
|
|
79
80
|
class: "control",
|
|
80
81
|
attrs: { part: "base" },
|
|
81
|
-
children: [/* @__PURE__ */ jsx("select", {
|
|
82
|
+
children: [/* @__PURE__ */ jsx("select", {
|
|
83
|
+
class: "native",
|
|
84
|
+
id: "field"
|
|
85
|
+
}), /* @__PURE__ */ jsx(JlIcon, {
|
|
82
86
|
class: "chevron",
|
|
83
87
|
name: "chevron-down",
|
|
84
88
|
size: CHEVRON_SIZE
|
|
@@ -95,6 +99,7 @@ var JlSelect = class extends JlFormControl {
|
|
|
95
99
|
this.value.set(value);
|
|
96
100
|
this.events.emit("change", value);
|
|
97
101
|
});
|
|
102
|
+
if (this.options.get().length > 0) return;
|
|
98
103
|
this.renderOptions();
|
|
99
104
|
}
|
|
100
105
|
resetValue() {
|
|
@@ -125,11 +130,49 @@ var JlSelect = class extends JlFormControl {
|
|
|
125
130
|
children: placeholder
|
|
126
131
|
})];
|
|
127
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Draws every option again: only when the options change. Chrome's customizable select reports, as an option
|
|
135
|
+
* inside an option, an option the page added and removed before its check ran.
|
|
136
|
+
*/
|
|
128
137
|
renderOptions() {
|
|
129
138
|
this._refs.native.replaceChildren(...this.placeholderNodes(), ...this.optionNodes());
|
|
139
|
+
this._kept = void 0;
|
|
140
|
+
this.keepUnknownValue();
|
|
141
|
+
this.renderValue();
|
|
142
|
+
}
|
|
143
|
+
/** Another value among the options drawn: only the option kept for an unknown value comes or goes. */
|
|
144
|
+
renderChosen() {
|
|
145
|
+
this.dropKept();
|
|
130
146
|
this.keepUnknownValue();
|
|
131
147
|
this.renderValue();
|
|
132
148
|
}
|
|
149
|
+
/** Another placeholder: its own option is written, added or removed, the others left as they are. */
|
|
150
|
+
renderPlaceholder() {
|
|
151
|
+
this.writePlaceholder();
|
|
152
|
+
this.renderValue();
|
|
153
|
+
}
|
|
154
|
+
writePlaceholder() {
|
|
155
|
+
const native = this._refs.native;
|
|
156
|
+
const shown = native.querySelector(`:scope > option.${PLACEHOLDER_CLASS}`);
|
|
157
|
+
const placeholder = this.placeholder.get();
|
|
158
|
+
if (shown === null) {
|
|
159
|
+
native.prepend(...this.placeholderNodes());
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (placeholder === "") {
|
|
163
|
+
shown.remove();
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (shown.text === placeholder) return;
|
|
167
|
+
shown.text = placeholder;
|
|
168
|
+
}
|
|
169
|
+
/** The option kept for a value no option has goes once another value is chosen. */
|
|
170
|
+
dropKept() {
|
|
171
|
+
const kept = this._kept;
|
|
172
|
+
if (kept === void 0 || kept.value === this.value.get()) return;
|
|
173
|
+
kept.remove();
|
|
174
|
+
this._kept = void 0;
|
|
175
|
+
}
|
|
133
176
|
/**
|
|
134
177
|
* A value no option has (a choice since removed, options still loading) shows as an option of its own, first, so
|
|
135
178
|
* the field shows what is saved and the form keeps it, rather than another choice.
|
|
@@ -140,10 +183,12 @@ var JlSelect = class extends JlFormControl {
|
|
|
140
183
|
const known = [...native.options].some((option) => option.value === value);
|
|
141
184
|
if (value === NO_VALUE || known) return;
|
|
142
185
|
const afterPlaceholder = this.placeholder.get() === "" ? 0 : 1;
|
|
143
|
-
|
|
186
|
+
const kept = /* @__PURE__ */ jsx("option", {
|
|
144
187
|
value,
|
|
145
188
|
children: value
|
|
146
|
-
})
|
|
189
|
+
});
|
|
190
|
+
native.add(kept, afterPlaceholder);
|
|
191
|
+
this._kept = kept;
|
|
147
192
|
}
|
|
148
193
|
/** Shows the chosen option; the form gets what is shown. */
|
|
149
194
|
renderValue() {
|
package/dist/atoms/jl-slider.js
CHANGED
|
@@ -56,7 +56,8 @@ var JlSlider = class extends JlFormControl {
|
|
|
56
56
|
class: "track-area",
|
|
57
57
|
children: [/* @__PURE__ */ jsx("input", {
|
|
58
58
|
type: "range",
|
|
59
|
-
class: "native"
|
|
59
|
+
class: "native",
|
|
60
|
+
id: "field"
|
|
60
61
|
}), /* @__PURE__ */ jsx("div", {
|
|
61
62
|
class: "marks",
|
|
62
63
|
"aria-hidden": "true",
|
package/dist/atoms/jl-switch.js
CHANGED
|
@@ -23,6 +23,13 @@ export declare abstract class JlFormControl extends JlElement {
|
|
|
23
23
|
formDisabledCallback(disabled: boolean): void;
|
|
24
24
|
protected abstract resetValue(): void;
|
|
25
25
|
protected abstract setDisabledByForm(disabled: boolean): void;
|
|
26
|
+
/**
|
|
27
|
+
* Submits the form the field belongs to, as Enter in a native field of one line does. The native field inside the
|
|
28
|
+
* shadow root belongs to no form, so the browser's own implicit submission never reaches the page's: each field of
|
|
29
|
+
* one line calls this for an Enter it did not use itself. Nothing during a composition (an IME choosing a word), or
|
|
30
|
+
* outside a form; `requestSubmit` checks the form's fields first, as a submit button does.
|
|
31
|
+
*/
|
|
32
|
+
protected submitImplicitly(event: KeyboardEvent): void;
|
|
26
33
|
/** Copies the native field's validity, so the form sees the same errors the browser would show. */
|
|
27
34
|
protected mirrorValidity(native: ValidatedElement): void;
|
|
28
35
|
}
|
|
@@ -33,6 +33,16 @@ var JlFormControl = class extends JlElement {
|
|
|
33
33
|
formDisabledCallback(disabled) {
|
|
34
34
|
this.setDisabledByForm(disabled);
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Submits the form the field belongs to, as Enter in a native field of one line does. The native field inside the
|
|
38
|
+
* shadow root belongs to no form, so the browser's own implicit submission never reaches the page's: each field of
|
|
39
|
+
* one line calls this for an Enter it did not use itself. Nothing during a composition (an IME choosing a word), or
|
|
40
|
+
* outside a form; `requestSubmit` checks the form's fields first, as a submit button does.
|
|
41
|
+
*/
|
|
42
|
+
submitImplicitly(event) {
|
|
43
|
+
if (event.isComposing) return;
|
|
44
|
+
this.internals.form?.requestSubmit();
|
|
45
|
+
}
|
|
36
46
|
/** Copies the native field's validity, so the form sees the same errors the browser would show. */
|
|
37
47
|
mirrorValidity(native) {
|
|
38
48
|
if (native.validity.valid) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/molecules/jl-breadcrumb.css?inline
|
|
2
|
-
var jl_breadcrumb_default = ":host{display:block}ol{font-size:var(--jl-font-sm);flex-wrap:wrap;align-items:center;gap:4px 0;padding:0;line-height:20px;list-style:none;display:flex}li{align-items:center;min-width:0;display:inline-flex}.separator{color:var(--jl-faint);margin:0 6px}.crumb{border-radius:var(--jl-radius-xs);min-width:0;color:var(--jl-muted);align-items:center;gap:6px;padding:2px 4px;text-decoration:none;display:inline-flex}a.crumb:hover{color:var(--jl-text);text-underline-offset:3px;text-decoration:underline}.crumb[aria-current=page]{color:var(--jl-text);font-weight:600}.label{text-overflow:ellipsis;white-space:nowrap;max-width:24ch;overflow:hidden}.more{border-radius:var(--jl-radius-xs);width:26px;height:22px;color:var(--jl-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.more:hover{background:var(--jl-surface-3);color:var(--jl-text)}li:first-child .crumb{margin-left:-4px}";
|
|
2
|
+
var jl_breadcrumb_default = ":host{display:block}ol{font-size:var(--jl-font-sm);flex-wrap:wrap;align-items:center;gap:4px 0;padding:0;line-height:20px;list-style:none;display:flex}li{align-items:center;min-width:0;display:inline-flex}.separator{color:var(--jl-faint);margin:0 6px}.crumb{border-radius:var(--jl-radius-xs);min-width:0;color:var(--jl-muted);align-items:center;gap:6px;padding:2px 4px;text-decoration:none;display:inline-flex}button.crumb{font:inherit;cursor:pointer;background:0 0;border:0}a.crumb:hover,button.crumb:hover{color:var(--jl-text);text-underline-offset:3px;text-decoration:underline}.crumb[aria-current=page]{color:var(--jl-text);font-weight:600}.label{text-overflow:ellipsis;white-space:nowrap;max-width:24ch;overflow:hidden}.more{border-radius:var(--jl-radius-xs);width:26px;height:22px;color:var(--jl-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.more:hover{background:var(--jl-surface-3);color:var(--jl-text)}li:first-child .crumb{margin-left:-4px}";
|
|
3
3
|
export { jl_breadcrumb_default as default };
|
|
@@ -2,13 +2,17 @@ import { JlElement } from '../base/jl-element';
|
|
|
2
2
|
import type { BreadcrumbItem } from '../types/jl-breadcrumb.types';
|
|
3
3
|
/**
|
|
4
4
|
* Where the page sits in a hierarchy: a trail of links, the last one being the current page. With `max`, a long
|
|
5
|
-
* trail folds its middle into a button that unfolds it.
|
|
5
|
+
* trail folds its middle into a button that unfolds it. An item with an `id` instead of an `href` is followed by the
|
|
6
|
+
* app: the breadcrumb fires `select` with its id. Typed by its ids, `JlBreadcrumb<'orders' | 'order'>`.
|
|
6
7
|
*/
|
|
7
|
-
export declare class JlBreadcrumb extends JlElement {
|
|
8
|
+
export declare class JlBreadcrumb<Id extends string = string> extends JlElement {
|
|
8
9
|
static readonly selector = "jl-breadcrumb";
|
|
10
|
+
readonly events: Readonly<import("@jadis/core").UseEventsHandler<{
|
|
11
|
+
select: Id;
|
|
12
|
+
}>>;
|
|
9
13
|
readonly items: Readonly<Readonly<{
|
|
10
|
-
get(): BreadcrumbItem[];
|
|
11
|
-
set(setter: BreadcrumbItem[] | ((prevState: BreadcrumbItem[]) => BreadcrumbItem[])): void;
|
|
14
|
+
get(): BreadcrumbItem<Id>[];
|
|
15
|
+
set(setter: BreadcrumbItem<Id>[] | ((prevState: BreadcrumbItem<Id>[]) => BreadcrumbItem<Id>[])): void;
|
|
12
16
|
}>>;
|
|
13
17
|
/** The most items shown before the middle folds; 0 never folds. */
|
|
14
18
|
readonly max: Readonly<Readonly<{
|
|
@@ -30,6 +34,8 @@ export declare class JlBreadcrumb extends JlElement {
|
|
|
30
34
|
/** A new trail starts folded. */
|
|
31
35
|
private renderTrail;
|
|
32
36
|
private render;
|
|
37
|
+
/** An item the app follows, found among the items by the id its button carries. */
|
|
38
|
+
private follow;
|
|
33
39
|
private crumb;
|
|
34
40
|
private moreButton;
|
|
35
41
|
/** Unfolds the middle, and moves the focus to the first item it showed. */
|
|
@@ -32,10 +32,12 @@ function visibleCrumbs(items, max, expanded) {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Where the page sits in a hierarchy: a trail of links, the last one being the current page. With `max`, a long
|
|
35
|
-
* trail folds its middle into a button that unfolds it.
|
|
35
|
+
* trail folds its middle into a button that unfolds it. An item with an `id` instead of an `href` is followed by the
|
|
36
|
+
* app: the breadcrumb fires `select` with its id. Typed by its ids, `JlBreadcrumb<'orders' | 'order'>`.
|
|
36
37
|
*/
|
|
37
38
|
var JlBreadcrumb = class extends JlElement {
|
|
38
39
|
static selector = "jl-breadcrumb";
|
|
40
|
+
events = this.useEvents();
|
|
39
41
|
items = this.useChange([], () => this.renderTrail(), {
|
|
40
42
|
attribute: "items",
|
|
41
43
|
parse: jsonOf([])
|
|
@@ -60,7 +62,12 @@ var JlBreadcrumb = class extends JlElement {
|
|
|
60
62
|
}
|
|
61
63
|
onConnect() {
|
|
62
64
|
this.on(this._refs.list, "click", (event) => {
|
|
63
|
-
|
|
65
|
+
const target = event.target;
|
|
66
|
+
if (target.closest(".more") !== null) {
|
|
67
|
+
this.expand();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.follow(target.closest("button.crumb")?.dataset.id);
|
|
64
71
|
});
|
|
65
72
|
}
|
|
66
73
|
drawTexts() {
|
|
@@ -85,6 +92,11 @@ var JlBreadcrumb = class extends JlElement {
|
|
|
85
92
|
size: SEPARATOR_SIZE
|
|
86
93
|
}) : "", "hidden" in crumb ? this.moreButton(crumb.hidden) : this.crumb(crumb.item, crumb.index === lastIndex)] })));
|
|
87
94
|
}
|
|
95
|
+
/** An item the app follows, found among the items by the id its button carries. */
|
|
96
|
+
follow(id) {
|
|
97
|
+
const item = this.items.get().find((candidate) => candidate.id !== void 0 && candidate.id === id);
|
|
98
|
+
if (item?.id !== void 0) this.events.emit("select", item.id);
|
|
99
|
+
}
|
|
88
100
|
crumb(item, current) {
|
|
89
101
|
const ariaCurrent = current ? "page" : void 0;
|
|
90
102
|
const content = [item.icon === void 0 ? "" : /* @__PURE__ */ jsx(JlIcon, {
|
|
@@ -94,6 +106,14 @@ var JlBreadcrumb = class extends JlElement {
|
|
|
94
106
|
class: "label",
|
|
95
107
|
children: item.label
|
|
96
108
|
})];
|
|
109
|
+
if (item.href === void 0 && item.id !== void 0) return /* @__PURE__ */ jsx("button", {
|
|
110
|
+
type: "button",
|
|
111
|
+
class: "crumb",
|
|
112
|
+
"data-id": item.id,
|
|
113
|
+
title: item.label,
|
|
114
|
+
"aria-current": ariaCurrent,
|
|
115
|
+
children: content
|
|
116
|
+
});
|
|
97
117
|
if (item.href === void 0) return /* @__PURE__ */ jsx("span", {
|
|
98
118
|
class: "crumb",
|
|
99
119
|
title: item.label,
|
|
@@ -99,6 +99,7 @@ var JlCombobox = class extends JlFormControl {
|
|
|
99
99
|
children: [
|
|
100
100
|
/* @__PURE__ */ jsx("input", {
|
|
101
101
|
class: "native",
|
|
102
|
+
id: "field",
|
|
102
103
|
role: "combobox",
|
|
103
104
|
"aria-autocomplete": "list",
|
|
104
105
|
"aria-expanded": "false",
|
|
@@ -194,13 +195,19 @@ var JlCombobox = class extends JlFormControl {
|
|
|
194
195
|
this.openList(true);
|
|
195
196
|
}
|
|
196
197
|
onKey(event) {
|
|
197
|
-
|
|
198
|
+
const handler = (/* @__PURE__ */ new Map([
|
|
198
199
|
["ArrowDown", () => this.onArrow(1, event.altKey)],
|
|
199
200
|
["ArrowUp", () => this.onArrow(-1, event.altKey)],
|
|
200
201
|
["Enter", () => this.onEnter()],
|
|
201
202
|
["Escape", () => this.onEscape()],
|
|
202
203
|
["Tab", () => this.onTab()]
|
|
203
|
-
])).get(event.key)
|
|
204
|
+
])).get(event.key);
|
|
205
|
+
if (handler === void 0) return;
|
|
206
|
+
if (handler()) {
|
|
207
|
+
event.preventDefault();
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (event.key === "Enter") this.submitImplicitly(event);
|
|
204
211
|
}
|
|
205
212
|
/** Down opens the list or moves down it; Alt + Down opens it as it is, Alt + Up closes it. */
|
|
206
213
|
onArrow(direction, alt) {
|
|
@@ -105,6 +105,7 @@ var JlDatePicker = class extends JlFormControl {
|
|
|
105
105
|
children: [
|
|
106
106
|
/* @__PURE__ */ jsx("input", {
|
|
107
107
|
class: "native",
|
|
108
|
+
id: "field",
|
|
108
109
|
role: "combobox",
|
|
109
110
|
autocomplete: "off",
|
|
110
111
|
spellcheck: false,
|
|
@@ -196,6 +197,11 @@ var JlDatePicker = class extends JlFormControl {
|
|
|
196
197
|
if (event.key === "ArrowDown") {
|
|
197
198
|
event.preventDefault();
|
|
198
199
|
this.openPopup();
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (event.key === "Enter") {
|
|
203
|
+
this.commitText();
|
|
204
|
+
this.submitImplicitly(event);
|
|
199
205
|
}
|
|
200
206
|
}
|
|
201
207
|
onOpenPress() {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/molecules/jl-facts.css?inline
|
|
2
|
-
var jl_facts_default = ":host{display:block;container-type:inline-size}:host([empty]){display:none}.facts{font-size:var(--jl-font-md);grid-template-columns:max-content minmax(0,1fr);gap:6px 24px;margin:0;display:grid}.fact{display:contents}dt{color:var(--jl-muted)}dd{min-width:0;color:var(--jl-text);overflow-wrap:anywhere;margin:0}code{font-family:var(--jl-font-mono);font-size:var(--jl-font-sm);word-break:break-all}a{color:var(--jl-accent);text-decoration:none}a:hover{color:var(--jl-accent-strong);text-decoration:underline}:host([orientation=vertical]) .facts{grid-template-columns:repeat(auto-fill,minmax(min(100%,180px),1fr));gap:16px 24px}:host([orientation=vertical]) .fact{align-content:start;gap:2px;display:grid}@container (width<420px){.facts{grid-template-columns:minmax(0,1fr);gap:12px}.fact{gap:2px;display:grid}}";
|
|
2
|
+
var jl_facts_default = ":host{display:block;container-type:inline-size}:host([empty]){display:none}.facts{font-size:var(--jl-font-md);grid-template-columns:max-content minmax(0,1fr);gap:6px 24px;margin:0;display:grid}.fact{display:contents}dt{color:var(--jl-muted)}dd{min-width:0;color:var(--jl-text);overflow-wrap:anywhere;margin:0}code{font-family:var(--jl-font-mono);font-size:var(--jl-font-sm);word-break:break-all}a,button.link{color:var(--jl-accent);text-decoration:none}button.link{font:inherit;text-align:start;cursor:pointer;background:0 0;border:0;padding:0}a:hover,button.link:hover{color:var(--jl-accent-strong);text-decoration:underline}:host([orientation=vertical]) .facts{grid-template-columns:repeat(auto-fill,minmax(min(100%,180px),1fr));gap:16px 24px}:host([orientation=vertical]) .fact{align-content:start;gap:2px;display:grid}@container (width<420px){.facts{grid-template-columns:minmax(0,1fr);gap:12px}.fact{gap:2px;display:grid}}";
|
|
3
3
|
export { jl_facts_default as default };
|
|
@@ -5,10 +5,13 @@ export declare const FACTS_ORIENTATIONS: readonly FactsOrientation[];
|
|
|
5
5
|
* The facts about one thing, label and value: an object's size and digest, an order's customer and date. Facts
|
|
6
6
|
* without a value are left out, and an element with none takes no room. Values can be code (monospace, broken
|
|
7
7
|
* anywhere), links, or drawn by code (`renderers`, by a fact's `key`). Narrower than 420 pixels, labels go over
|
|
8
|
-
* their values.
|
|
8
|
+
* their values. A fact with an `id` instead of an `href` is a link the app follows: the facts fire `select` with it.
|
|
9
9
|
*/
|
|
10
10
|
export declare class JlFacts extends JlElement {
|
|
11
11
|
static readonly selector = "jl-facts";
|
|
12
|
+
readonly events: Readonly<import("@jadis/core").UseEventsHandler<{
|
|
13
|
+
select: string;
|
|
14
|
+
}>>;
|
|
12
15
|
readonly items: Readonly<Readonly<{
|
|
13
16
|
get(): Fact[];
|
|
14
17
|
set(setter: Fact[] | ((prevState: Fact[]) => Fact[])): void;
|
|
@@ -30,6 +33,7 @@ export declare class JlFacts extends JlElement {
|
|
|
30
33
|
private readonly _refs;
|
|
31
34
|
templateHtml(): Node;
|
|
32
35
|
templateCss(): string;
|
|
36
|
+
onConnect(): void;
|
|
33
37
|
private render;
|
|
34
38
|
private valueNode;
|
|
35
39
|
}
|
|
@@ -12,10 +12,11 @@ var hasValue = (fact) => fact.value !== null && fact.value !== void 0 && fact.va
|
|
|
12
12
|
* The facts about one thing, label and value: an object's size and digest, an order's customer and date. Facts
|
|
13
13
|
* without a value are left out, and an element with none takes no room. Values can be code (monospace, broken
|
|
14
14
|
* anywhere), links, or drawn by code (`renderers`, by a fact's `key`). Narrower than 420 pixels, labels go over
|
|
15
|
-
* their values.
|
|
15
|
+
* their values. A fact with an `id` instead of an `href` is a link the app follows: the facts fire `select` with it.
|
|
16
16
|
*/
|
|
17
17
|
var JlFacts = class extends JlElement {
|
|
18
18
|
static selector = "jl-facts";
|
|
19
|
+
events = this.useEvents();
|
|
19
20
|
items = this.useChange([], () => this.render(), {
|
|
20
21
|
attribute: "items",
|
|
21
22
|
parse: jsonOf([])
|
|
@@ -38,6 +39,13 @@ var JlFacts = class extends JlElement {
|
|
|
38
39
|
templateCss() {
|
|
39
40
|
return css`${BASE_STYLES}${jl_facts_default}`;
|
|
40
41
|
}
|
|
42
|
+
onConnect() {
|
|
43
|
+
this.on(this._refs.list, "click", (event) => {
|
|
44
|
+
const id = event.target.closest("button.link")?.dataset.id;
|
|
45
|
+
const fact = this.items.get().find((candidate) => candidate.id !== void 0 && candidate.id === id);
|
|
46
|
+
if (fact?.id !== void 0) this.events.emit("select", fact.id);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
41
49
|
render() {
|
|
42
50
|
const shown = this.items.get().filter(hasValue);
|
|
43
51
|
this._refs.list.replaceChildren(...shown.map((fact) => /* @__PURE__ */ jsxs("div", {
|
|
@@ -54,10 +62,16 @@ var JlFacts = class extends JlElement {
|
|
|
54
62
|
if (renderer !== void 0) return renderer(fact);
|
|
55
63
|
const text = String(fact.value);
|
|
56
64
|
const content = fact.code ? /* @__PURE__ */ jsx("code", { children: text }) : document.createTextNode(text);
|
|
57
|
-
|
|
65
|
+
if (fact.href !== void 0) return /* @__PURE__ */ jsx("a", {
|
|
58
66
|
href: fact.href,
|
|
59
67
|
children: content
|
|
60
68
|
});
|
|
69
|
+
return fact.id === void 0 ? content : /* @__PURE__ */ jsx("button", {
|
|
70
|
+
type: "button",
|
|
71
|
+
class: "link",
|
|
72
|
+
"data-id": fact.id,
|
|
73
|
+
children: content
|
|
74
|
+
});
|
|
61
75
|
}
|
|
62
76
|
};
|
|
63
77
|
JlFacts.register();
|
|
@@ -96,6 +96,7 @@ var JlNumberInput = class extends JlFormControl {
|
|
|
96
96
|
}),
|
|
97
97
|
/* @__PURE__ */ jsx("input", {
|
|
98
98
|
class: "native",
|
|
99
|
+
id: "field",
|
|
99
100
|
type: "text",
|
|
100
101
|
inputMode: "decimal",
|
|
101
102
|
role: "spinbutton",
|
|
@@ -138,7 +139,10 @@ var JlNumberInput = class extends JlFormControl {
|
|
|
138
139
|
["ArrowDown", () => this.stepBy(-1)],
|
|
139
140
|
["ArrowUp", () => this.stepBy(1)],
|
|
140
141
|
["End", () => this.goToBound(this.max.get())],
|
|
141
|
-
["Enter", () =>
|
|
142
|
+
["Enter", () => {
|
|
143
|
+
this.commitText();
|
|
144
|
+
this.submitImplicitly(event);
|
|
145
|
+
}],
|
|
142
146
|
["Home", () => this.goToBound(this.min.get())],
|
|
143
147
|
["PageDown", () => this.stepBy(-10)],
|
|
144
148
|
["PageUp", () => this.stepBy(PAGE_STEPS)]
|
|
@@ -102,6 +102,7 @@ var JlSearch = class extends JlFormControl {
|
|
|
102
102
|
}),
|
|
103
103
|
/* @__PURE__ */ jsx("input", {
|
|
104
104
|
class: "native",
|
|
105
|
+
id: "field",
|
|
105
106
|
type: "search",
|
|
106
107
|
autocomplete: "off"
|
|
107
108
|
}),
|
|
@@ -165,6 +166,7 @@ var JlSearch = class extends JlFormControl {
|
|
|
165
166
|
event.preventDefault();
|
|
166
167
|
this.search(this.value.get());
|
|
167
168
|
this.events.emit("enter", this.value.get());
|
|
169
|
+
this.submitImplicitly(event);
|
|
168
170
|
return;
|
|
169
171
|
}
|
|
170
172
|
if (event.key === "Escape" && this.value.get() !== "") {
|
|
@@ -96,6 +96,7 @@ var JlTagInput = class extends JlFormControl {
|
|
|
96
96
|
role: "list"
|
|
97
97
|
}), /* @__PURE__ */ jsx("input", {
|
|
98
98
|
class: "native",
|
|
99
|
+
id: "field",
|
|
99
100
|
autocomplete: "off"
|
|
100
101
|
})]
|
|
101
102
|
}),
|
|
@@ -163,7 +164,7 @@ var JlTagInput = class extends JlFormControl {
|
|
|
163
164
|
this.renderMatches();
|
|
164
165
|
}
|
|
165
166
|
onFieldKey(event) {
|
|
166
|
-
|
|
167
|
+
const handler = (/* @__PURE__ */ new Map([
|
|
167
168
|
[COMMA, () => {
|
|
168
169
|
this.commitText();
|
|
169
170
|
return true;
|
|
@@ -174,7 +175,13 @@ var JlTagInput = class extends JlFormControl {
|
|
|
174
175
|
["Backspace", () => this.removeLastIfEmpty()],
|
|
175
176
|
["Enter", () => this.onEnter()],
|
|
176
177
|
["Escape", () => this.closeList()]
|
|
177
|
-
])).get(event.key)
|
|
178
|
+
])).get(event.key);
|
|
179
|
+
if (handler === void 0) return;
|
|
180
|
+
if (handler()) {
|
|
181
|
+
event.preventDefault();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (event.key === "Enter") this.submitImplicitly(event);
|
|
178
185
|
}
|
|
179
186
|
/** Enter adds the suggestion the arrows reached, or the typed text; in an empty field it submits the form. */
|
|
180
187
|
onEnter() {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/organisms/jl-dialog.css?inline
|
|
2
|
-
var jl_dialog_default = ":host{--width:520px;display:contents}:host([size=sm]){--width:400px}:host([size=lg]){--width:820px}:host([size=full]){--width:100vw}dialog{width:min(var(--width), calc(100vw - 32px));border:1px solid var(--jl-line);border-radius:var(--jl-radius-lg);background:var(--jl-surface);max-height:min(760px,100dvh - 48px);color:var(--jl-text);font-size:var(--jl-font-md);box-shadow:var(--jl-shadow-lg);flex-direction:column;padding:0;display:flex}dialog:not([open]){display:none}:host([size=full]) dialog{height:calc(100dvh - 32px);max-height:calc(100dvh - 32px)}dialog[open]{animation:rise var(--jl-slow) var(--jl-ease)}dialog::backdrop{background:var(--jl-scrim);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}header{align-items:flex-start;gap:12px;padding:20px 16px 4px 24px;display:flex}.titles{flex:1;gap:4px;padding-top:4px;display:grid}h2{letter-spacing:-.01em;font-size:17px;font-weight:650;line-height:1.3}.description{color:var(--jl-muted);font-size:var(--jl-font-sm);line-height:1.5}.body{flex:1;padding:16px 24px;line-height:1.55;overflow:auto}footer{flex-wrap:wrap;justify-content:flex-end;gap:8px;padding:0 24px 20px;display:flex}@keyframes rise{0%{opacity:0;transform:translateY(8px)scale(.98)}}";
|
|
2
|
+
var jl_dialog_default = ":host{--width:520px;display:contents}:host([size=sm]){--width:400px}:host([size=lg]){--width:820px}:host([size=full]){--width:100vw}dialog{width:min(var(--width), calc(100vw - 32px));border:1px solid var(--jl-line);border-radius:var(--jl-radius-lg);background:var(--jl-surface);max-height:min(760px,100dvh - 48px);color:var(--jl-text);font-size:var(--jl-font-md);box-shadow:var(--jl-shadow-lg);flex-direction:column;padding:0;display:flex}dialog:not([open]){display:none}:host([size=full]) dialog{height:calc(100dvh - 32px);max-height:calc(100dvh - 32px)}dialog[open]{animation:rise var(--jl-slow) var(--jl-ease)}dialog::backdrop{background:var(--jl-scrim);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}header{align-items:flex-start;gap:12px;padding:20px 16px 4px 24px;display:flex}.titles{flex:1;gap:4px;padding-top:4px;display:grid}h2{letter-spacing:-.01em;font-size:17px;font-weight:650;line-height:1.3}.description{color:var(--jl-muted);font-size:var(--jl-font-sm);line-height:1.5}.body{flex:1;padding:16px 24px;line-height:1.55;position:relative;overflow:auto}footer{flex-wrap:wrap;justify-content:flex-end;gap:8px;padding:0 24px 20px;display:flex}@keyframes rise{0%{opacity:0;transform:translateY(8px)scale(.98)}}";
|
|
3
3
|
export { jl_dialog_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/organisms/jl-drawer.css?inline
|
|
2
|
-
var jl_drawer_default = ":host{--size:420px;--from:translateX(100%);display:contents}:host([size=sm]){--size:320px}:host([size=lg]){--size:640px}:host([placement=left]){--from:translateX(-100%)}:host([placement=bottom]){--size:60dvh;--from:translateY(100%)}:host([placement=bottom][size=sm]){--size:40dvh}:host([placement=bottom][size=lg]){--size:88dvh}dialog{width:min(var(--size), calc(100vw - 24px));border:none;border-left:1px solid var(--jl-line);background:var(--jl-surface);max-width:none;height:100dvh;max-height:none;color:var(--jl-text);font-size:var(--jl-font-md);box-shadow:var(--jl-shadow-lg);transform:var(--from);transition:transform var(--jl-slow) var(--jl-ease), display var(--jl-slow) allow-discrete, overlay var(--jl-slow) allow-discrete;flex-direction:column;margin:0;padding:0;display:none;position:fixed;inset:0 0 0 auto}dialog[open]{display:flex;transform:none}@starting-style{dialog[open]{transform:var(--from)}}:host([placement=left]) dialog{border-right:1px solid var(--jl-line);border-left:none;inset:0 auto 0 0}:host([placement=bottom]) dialog{width:100%;height:auto;max-height:var(--size);border:1px solid var(--jl-line);border-radius:var(--jl-radius-xl) var(--jl-radius-xl) 0 0;border-bottom:none;inset:auto 0 0}dialog::backdrop{transition:background var(--jl-slow) var(--jl-ease), display var(--jl-slow) allow-discrete, overlay var(--jl-slow) allow-discrete;background:0 0}dialog[open]::backdrop{background:var(--jl-scrim)}@starting-style{dialog[open]::backdrop{background:0 0}}.handle{display:none}:host([placement=bottom]) .handle{border-radius:var(--jl-radius-pill);background:var(--jl-line-strong);flex:none;width:40px;height:4px;margin:10px auto 0;display:block}header{border-bottom:1px solid var(--jl-line);flex:none;align-items:flex-start;gap:12px;padding:18px 16px 14px 24px;display:flex}:host([placement=bottom]) header{padding-top:10px}.titles{flex:1;gap:4px;min-width:0;padding-top:4px;display:grid}h2{letter-spacing:-.01em;font-size:17px;font-weight:650;line-height:1.3}.description{color:var(--jl-muted);font-size:var(--jl-font-sm);line-height:1.5}.actions{flex:none;align-items:center;gap:4px;display:flex}.body{overscroll-behavior:contain;flex:1;min-height:0;padding:20px 24px;line-height:1.55;overflow:auto}footer{border-top:1px solid var(--jl-line);background:var(--jl-surface);flex-wrap:wrap;flex:none;justify-content:flex-end;gap:8px;padding:14px 24px;display:flex}:host([placement=bottom]) footer{padding-bottom:max(14px, env(safe-area-inset-bottom))}";
|
|
2
|
+
var jl_drawer_default = ":host{--size:420px;--from:translateX(100%);display:contents}:host([size=sm]){--size:320px}:host([size=lg]){--size:640px}:host([placement=left]){--from:translateX(-100%)}:host([placement=bottom]){--size:60dvh;--from:translateY(100%)}:host([placement=bottom][size=sm]){--size:40dvh}:host([placement=bottom][size=lg]){--size:88dvh}dialog{width:min(var(--size), calc(100vw - 24px));border:none;border-left:1px solid var(--jl-line);background:var(--jl-surface);max-width:none;height:100dvh;max-height:none;color:var(--jl-text);font-size:var(--jl-font-md);box-shadow:var(--jl-shadow-lg);transform:var(--from);transition:transform var(--jl-slow) var(--jl-ease), display var(--jl-slow) allow-discrete, overlay var(--jl-slow) allow-discrete;flex-direction:column;margin:0;padding:0;display:none;position:fixed;inset:0 0 0 auto}dialog[open]{display:flex;transform:none}@starting-style{dialog[open]{transform:var(--from)}}:host([placement=left]) dialog{border-right:1px solid var(--jl-line);border-left:none;inset:0 auto 0 0}:host([placement=bottom]) dialog{width:100%;height:auto;max-height:var(--size);border:1px solid var(--jl-line);border-radius:var(--jl-radius-xl) var(--jl-radius-xl) 0 0;border-bottom:none;inset:auto 0 0}dialog::backdrop{transition:background var(--jl-slow) var(--jl-ease), display var(--jl-slow) allow-discrete, overlay var(--jl-slow) allow-discrete;background:0 0}dialog[open]::backdrop{background:var(--jl-scrim)}@starting-style{dialog[open]::backdrop{background:0 0}}.handle{display:none}:host([placement=bottom]) .handle{border-radius:var(--jl-radius-pill);background:var(--jl-line-strong);flex:none;width:40px;height:4px;margin:10px auto 0;display:block}header{border-bottom:1px solid var(--jl-line);flex:none;align-items:flex-start;gap:12px;padding:18px 16px 14px 24px;display:flex}:host([placement=bottom]) header{padding-top:10px}.titles{flex:1;gap:4px;min-width:0;padding-top:4px;display:grid}h2{letter-spacing:-.01em;font-size:17px;font-weight:650;line-height:1.3}.description{color:var(--jl-muted);font-size:var(--jl-font-sm);line-height:1.5}.actions{flex:none;align-items:center;gap:4px;display:flex}.body{overscroll-behavior:contain;flex:1;min-height:0;padding:20px 24px;line-height:1.55;position:relative;overflow:auto}footer{border-top:1px solid var(--jl-line);background:var(--jl-surface);flex-wrap:wrap;flex:none;justify-content:flex-end;gap:8px;padding:14px 24px;display:flex}:host([placement=bottom]) footer{padding-bottom:max(14px, env(safe-area-inset-bottom))}";
|
|
3
3
|
export { jl_drawer_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/organisms/jl-side-nav.css?inline
|
|
2
|
-
var jl_side_nav_default = ":host{width:var(--width,248px);height:100%;min-height:0;transition:width var(--jl-slow) var(--jl-ease);display:block}:host([rail]){width:var(--rail-width,60px)}nav{height:100%;color:var(--jl-text-2);font-size:var(--jl-font-md);flex-direction:column;gap:8px;padding:12px 8px;display:flex;overflow:hidden auto}.bottom{flex-direction:column;gap:8px;margin-top:auto;display:flex}.fold{
|
|
2
|
+
var jl_side_nav_default = ":host{width:var(--width,248px);height:100%;min-height:0;transition:width var(--jl-slow) var(--jl-ease);display:block}:host([rail]){width:var(--rail-width,60px)}nav{height:100%;color:var(--jl-text-2);font-size:var(--jl-font-md);flex-direction:column;gap:8px;padding:12px 8px;display:flex;overflow:hidden auto}.bottom{flex-direction:column;gap:8px;margin-top:auto;display:flex}.fold::part(base){justify-content:flex-start;gap:10px;padding:0 9px}:host([rail]) .fold::part(base){justify-content:center;padding:0}.sections{gap:14px;display:grid}.section{gap:2px;display:grid}.sections,.section,.items,.children{grid-template-columns:minmax(0,1fr)}.section-label{color:var(--jl-muted);letter-spacing:.08em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap;padding:4px 10px 6px;font-size:11px;font-weight:650;overflow:hidden}.items,.children{gap:2px;margin:0;padding:0;list-style:none;display:grid}.children{margin-top:2px}.entry{position:relative}.item{border-radius:var(--jl-radius-sm);width:100%;min-height:34px;color:inherit;font:inherit;text-align:start;white-space:nowrap;cursor:pointer;transition:background var(--jl-fast) var(--jl-ease), color var(--jl-fast) var(--jl-ease);background:0 0;border:none;align-items:center;gap:10px;padding:0 10px;font-weight:550;text-decoration:none;display:flex}.item[data-depth=\"1\"]{padding-left:36px}.item[data-depth=\"2\"]{padding-left:50px}.item[data-depth=\"3\"]{padding-left:64px}.item:hover{background:var(--jl-surface-3);color:var(--jl-text)}.item[aria-current=page]{background:var(--jl-accent-soft);color:var(--jl-accent)}.item.holds-active{color:var(--jl-text)}.item-icon{color:var(--jl-faint)}.item:hover .item-icon,.item.holds-active .item-icon{color:var(--jl-text-2)}.item[aria-current=page] .item-icon{color:var(--jl-accent)}.item-initial{border-radius:var(--jl-radius-xs);background:var(--jl-surface-3);width:20px;height:20px;color:var(--jl-text-2);flex:none;justify-content:center;align-items:center;font-size:11px;font-weight:700;display:none}.item:not([data-depth=\"0\"]) .item-initial{display:none}.item-label{text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.item-badge{border-radius:var(--jl-radius-pill);background:var(--jl-surface-3);min-width:20px;color:var(--jl-text-2);text-align:center;flex:none;padding:2px 6px;font-size:11px;font-weight:650;line-height:14px}.item[aria-current=page] .item-badge{background:var(--jl-accent);color:var(--jl-on-accent)}.expander jl-icon{transition:transform var(--jl-fast) var(--jl-ease)}.chevron{color:var(--jl-faint);transition:transform var(--jl-fast) var(--jl-ease)}.entry.open>.item .chevron,.entry.open>.expander jl-icon{transform:rotate(90deg)}.expander{border-radius:var(--jl-radius-xs);width:24px;height:24px;color:var(--jl-faint);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:inline-flex;position:absolute;top:5px;right:6px}.expander:hover{background:var(--jl-surface-3);color:var(--jl-text)}.entry:has(>.expander)>.item{padding-right:36px}:host([rail]) .section-label{background:var(--jl-line);color:#0000;height:1px;margin:4px 10px;padding:0;overflow:hidden}:host([rail]) .section:first-child .section-label{display:none}:host([rail]) .item{justify-content:center;padding:0}:host([rail]) .item-label{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}:host([rail]) .item-initial{display:inline-flex}:host([rail]) .item-badge{background:var(--jl-accent);color:#0000;width:8px;min-width:0;height:8px;padding:0;position:absolute;top:5px;right:9px;overflow:hidden}:host([rail]) .children{display:none}";
|
|
3
3
|
export { jl_side_nav_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/organisms/jl-table.css?inline
|
|
2
|
-
var jl_table_default = ":host{contain:inline-size;--max-height:none;--cell-y:10px;--cell-x:14px;--select-width:44px;--expand-width:36px;--lead:0px;display:block}:host([expandable]){--lead:var(--expand-width)}:host([expandable][selectable]){--expand-width:28px;--lead:calc(var(--select-width) + var(--expand-width))}:host([dense]){--cell-y:6px;--cell-x:12px}.scroll{max-height:var(--max-height);border:1px solid var(--jl-line);border-radius:var(--jl-radius);background:var(--jl-surface);overscroll-behavior-x:contain;overflow:auto}:host([expandable]) .scroll{container-type:inline-size}table{border-collapse:separate;border-spacing:0;width:100%;color:var(--jl-text);font-size:var(--jl-font-md);line-height:20px}th,td{padding:var(--cell-y) var(--cell-x);white-space:nowrap;vertical-align:middle}th{z-index:1;border-bottom:1px solid var(--jl-line);background:var(--jl-surface-2);color:var(--jl-muted);font-size:var(--jl-font-xs);letter-spacing:.01em;text-align:left;font-weight:600;position:sticky;top:0}td{border-top:1px solid var(--jl-line-soft)}tbody tr:first-child td{border-top:none}tbody tr.empty td{padding:40px var(--cell-x);color:var(--jl-muted);text-align:center}tbody tr.detail td{padding:0 var(--cell-x) calc(var(--cell-y) + 6px) calc(var(--lead) + var(--cell-x));white-space:normal;cursor:auto;border-top:none}.detail-body{left:calc(var(--lead) + var(--cell-x));max-width:calc(100cqi - var(--lead) - 2 * var(--cell-x));position:sticky}.align-left{text-align:left}.align-center{text-align:center}.align-right{text-align:right}.sort{border-radius:var(--jl-radius-xs);color:inherit;font-weight:inherit;letter-spacing:inherit;cursor:pointer;background:0 0;border:none;align-items:center;gap:4px;margin:-2px -4px;padding:2px 4px;display:inline-flex}.sort:hover{color:var(--jl-text)}.sort-icon{color:var(--jl-faint)}th[data-sorted]{color:var(--jl-text)}th[data-sorted] .sort-icon{color:var(--jl-accent)}tbody tr[data-selected] td,tbody tr[data-marked] td{background:var(--jl-accent-soft)}tbody tr[data-marked] td:first-child{box-shadow:inset 3px 0 0 var(--jl-accent)}tbody tr:not(.empty,.skeleton,.detail,[data-selected]):hover td,:host([striped]) tbody tr:nth-child(2n of :where(:not(.detail))):not(.empty,[data-selected],[data-marked]) td{background:var(--jl-surface-2)}:host([striped]) tbody tr:not(.empty,.skeleton,.detail,[data-selected]):hover td{background:var(--jl-surface-3)}:host([striped]) tbody tr:nth-child(2n of :where(:not(.detail))):not([data-selected],[data-marked])+.detail td{background:var(--jl-surface-2)}.format-number{font-variant-numeric:tabular-nums}td.wrap{white-space:normal;overflow-wrap:anywhere;min-width:160px}.format-date{color:var(--jl-text-2);font-variant-numeric:tabular-nums}code{border-radius:var(--jl-radius-xs);background:var(--jl-code-bg);font-size:var(--jl-font-xs);padding:2px 6px}.select-cell{width:var(--select-width);padding-right:0;line-height:0}.expand-cell{width:var(--expand-width);padding-right:0;padding-left:calc(var(--cell-x) - 4px);line-height:0}.select-cell+.expand-cell{padding-left:0}:host([expandable]) tbody tr[data-index]{cursor:pointer}.expand{border-radius:var(--jl-radius-xs);width:24px;height:24px;color:var(--jl-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;margin:-2px 0;padding:0;display:inline-flex}.expand:hover{color:var(--jl-text)}.chevron{transition:rotate var(--jl-fast) var(--jl-ease)}.expand[aria-expanded=true] .chevron{rotate:90deg}.check{display:inline-flex;position:relative}.checkbox{border:1.5px solid var(--jl-line-strong);background:var(--jl-surface);cursor:pointer;appearance:none;width:16px;height:16px;transition:background var(--jl-fast) var(--jl-ease), border-color var(--jl-fast) var(--jl-ease);border-radius:4px;margin:0}.checkbox:hover{border-color:var(--jl-muted)}.checkbox:checked,.checkbox:indeterminate{border-color:var(--jl-accent);background:var(--jl-accent)}.checkbox:disabled{cursor:not-allowed;opacity:.5}.mark{pointer-events:none;position:absolute;inset:0}.checkbox:checked+.mark:after{border:solid var(--jl-on-accent);content:\"\";border-width:0 2px 2px 0;width:5px;height:9px;position:absolute;top:2.5px;left:5.5px;rotate:45deg}.checkbox:indeterminate+.mark:after{background:var(--jl-on-accent);content:\"\";border-radius:1px;height:2px;position:absolute;top:7px;left:4px;right:4px}.empty-content{align-items:center;gap:8px;display:inline-flex}.empty jl-icon{color:var(--jl-faint)}.bone{border-radius:var(--jl-radius-pill);background:linear-gradient(90deg, var(--jl-surface-3) 30%, var(--jl-surface-2) 50%, var(--jl-surface-3) 70%) 0 0 / 300% 100%;vertical-align:middle;width:70%;max-width:160px;height:10px;animation:1.4s linear infinite shimmer;display:inline-block}.bone.box{border-radius:4px;width:16px;height:16px}tbody tr.skeleton:nth-child(3n+2) .bone:not(.box){width:50%}tbody tr.skeleton:nth-child(3n) .bone:not(.box){width:85%}@media (prefers-reduced-motion:reduce){.bone{animation:none}}@keyframes shimmer{0%{background-position:100% 0}to{background-position:0 0}}.cell-description{color:var(--jl-muted);font-size:var(--jl-font-xs);margin-top:2px}";
|
|
2
|
+
var jl_table_default = ":host{contain:inline-size;--max-height:none;--cell-y:10px;--cell-x:14px;--select-width:44px;--expand-width:36px;--lead:0px;display:block}:host([expandable]){--lead:var(--expand-width)}:host([expandable][selectable]){--expand-width:28px;--lead:calc(var(--select-width) + var(--expand-width))}:host([dense]){--cell-y:6px;--cell-x:12px}.scroll{max-height:var(--max-height);border:1px solid var(--jl-line);border-radius:var(--jl-radius);background:var(--jl-surface);overscroll-behavior-x:contain;position:relative;overflow:auto}:host([expandable]) .scroll{container-type:inline-size}table{border-collapse:separate;border-spacing:0;width:100%;color:var(--jl-text);font-size:var(--jl-font-md);line-height:20px}th,td{padding:var(--cell-y) var(--cell-x);white-space:nowrap;vertical-align:middle}th{z-index:1;border-bottom:1px solid var(--jl-line);background:var(--jl-surface-2);color:var(--jl-muted);font-size:var(--jl-font-xs);letter-spacing:.01em;text-align:left;font-weight:600;position:sticky;top:0}td{border-top:1px solid var(--jl-line-soft)}tbody tr:first-child td{border-top:none}tbody tr.empty td{padding:40px var(--cell-x);color:var(--jl-muted);text-align:center}tbody tr.detail td{padding:0 var(--cell-x) calc(var(--cell-y) + 6px) calc(var(--lead) + var(--cell-x));white-space:normal;cursor:auto;border-top:none}.detail-body{left:calc(var(--lead) + var(--cell-x));max-width:calc(100cqi - var(--lead) - 2 * var(--cell-x));position:sticky}.align-left{text-align:left}.align-center{text-align:center}.align-right{text-align:right}.sort{border-radius:var(--jl-radius-xs);color:inherit;font-weight:inherit;letter-spacing:inherit;cursor:pointer;background:0 0;border:none;align-items:center;gap:4px;margin:-2px -4px;padding:2px 4px;display:inline-flex}.sort:hover{color:var(--jl-text)}.sort-icon{color:var(--jl-faint)}th[data-sorted]{color:var(--jl-text)}th[data-sorted] .sort-icon{color:var(--jl-accent)}tbody tr[data-selected] td,tbody tr[data-marked] td{background:var(--jl-accent-soft)}tbody tr[data-marked] td:first-child{box-shadow:inset 3px 0 0 var(--jl-accent)}tbody tr:not(.empty,.skeleton,.detail,[data-selected]):hover td,:host([striped]) tbody tr:nth-child(2n of :where(:not(.detail))):not(.empty,[data-selected],[data-marked]) td{background:var(--jl-surface-2)}:host([striped]) tbody tr:not(.empty,.skeleton,.detail,[data-selected]):hover td{background:var(--jl-surface-3)}:host([striped]) tbody tr:nth-child(2n of :where(:not(.detail))):not([data-selected],[data-marked])+.detail td{background:var(--jl-surface-2)}.format-number{font-variant-numeric:tabular-nums}td.wrap{white-space:normal;overflow-wrap:anywhere;min-width:160px}.format-date{color:var(--jl-text-2);font-variant-numeric:tabular-nums}code{border-radius:var(--jl-radius-xs);background:var(--jl-code-bg);font-size:var(--jl-font-xs);padding:2px 6px}.select-cell{width:var(--select-width);padding-right:0;line-height:0}.expand-cell{width:var(--expand-width);padding-right:0;padding-left:calc(var(--cell-x) - 4px);line-height:0}.select-cell+.expand-cell{padding-left:0}:host([expandable]) tbody tr[data-index]{cursor:pointer}.expand{border-radius:var(--jl-radius-xs);width:24px;height:24px;color:var(--jl-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;margin:-2px 0;padding:0;display:inline-flex}.expand:hover{color:var(--jl-text)}.chevron{transition:rotate var(--jl-fast) var(--jl-ease)}.expand[aria-expanded=true] .chevron{rotate:90deg}.check{display:inline-flex;position:relative}.checkbox{border:1.5px solid var(--jl-line-strong);background:var(--jl-surface);cursor:pointer;appearance:none;width:16px;height:16px;transition:background var(--jl-fast) var(--jl-ease), border-color var(--jl-fast) var(--jl-ease);border-radius:4px;margin:0}.checkbox:hover{border-color:var(--jl-muted)}.checkbox:checked,.checkbox:indeterminate{border-color:var(--jl-accent);background:var(--jl-accent)}.checkbox:disabled{cursor:not-allowed;opacity:.5}.mark{pointer-events:none;position:absolute;inset:0}.checkbox:checked+.mark:after{border:solid var(--jl-on-accent);content:\"\";border-width:0 2px 2px 0;width:5px;height:9px;position:absolute;top:2.5px;left:5.5px;rotate:45deg}.checkbox:indeterminate+.mark:after{background:var(--jl-on-accent);content:\"\";border-radius:1px;height:2px;position:absolute;top:7px;left:4px;right:4px}.empty-content{align-items:center;gap:8px;display:inline-flex}.empty jl-icon{color:var(--jl-faint)}.bone{border-radius:var(--jl-radius-pill);background:linear-gradient(90deg, var(--jl-surface-3) 30%, var(--jl-surface-2) 50%, var(--jl-surface-3) 70%) 0 0 / 300% 100%;vertical-align:middle;width:70%;max-width:160px;height:10px;animation:1.4s linear infinite shimmer;display:inline-block}.bone.box{border-radius:4px;width:16px;height:16px}tbody tr.skeleton:nth-child(3n+2) .bone:not(.box){width:50%}tbody tr.skeleton:nth-child(3n) .bone:not(.box){width:85%}@media (prefers-reduced-motion:reduce){.bone{animation:none}}@keyframes shimmer{0%{background-position:100% 0}to{background-position:0 0}}.cell-description{color:var(--jl-muted);font-size:var(--jl-font-xs);margin-top:2px}";
|
|
3
3
|
export { jl_table_default as default };
|
|
@@ -69,6 +69,7 @@ function checkbox(label, index) {
|
|
|
69
69
|
children: [/* @__PURE__ */ jsx("input", {
|
|
70
70
|
type: "checkbox",
|
|
71
71
|
class: "checkbox",
|
|
72
|
+
id: index === null ? "select-all" : `select-${index}`,
|
|
72
73
|
"aria-label": label,
|
|
73
74
|
"data-index": index ?? void 0
|
|
74
75
|
}), /* @__PURE__ */ jsx("span", {
|
|
@@ -24,11 +24,16 @@ export declare class JlPage extends JlElement {
|
|
|
24
24
|
get(): PageWidth;
|
|
25
25
|
set(setter: ((prevState: PageWidth) => PageWidth) | PageWidth): void;
|
|
26
26
|
}>>;
|
|
27
|
-
/** Where the back link leads; no back link without it
|
|
27
|
+
/** Where the back link leads; no back link without it, unless `backable`. */
|
|
28
28
|
readonly back: Readonly<Readonly<{
|
|
29
29
|
get(): string;
|
|
30
30
|
set(setter: string | ((prevState: string) => string)): void;
|
|
31
31
|
}>>;
|
|
32
|
+
/** Shows the back link without an address: pressed, it fires `back`, which the app follows (a router's `goto`). */
|
|
33
|
+
readonly backable: Readonly<Readonly<{
|
|
34
|
+
get(): boolean;
|
|
35
|
+
set(setter: boolean | ((prevState: boolean) => boolean)): void;
|
|
36
|
+
}>>;
|
|
32
37
|
/** The name of the page the back link leads to: "Orders". */
|
|
33
38
|
readonly backLabel: Readonly<Readonly<{
|
|
34
39
|
get(): string;
|
|
@@ -44,7 +49,7 @@ export declare class JlPage extends JlElement {
|
|
|
44
49
|
templateCss(): string;
|
|
45
50
|
onConnect(): void;
|
|
46
51
|
protected drawTexts(): void;
|
|
47
|
-
/** The back link stays out of the header's breadcrumb slot without an address, so the header takes no room for it. */
|
|
52
|
+
/** The back link stays out of the header's breadcrumb slot without an address (and not backable), so the header takes no room for it. */
|
|
48
53
|
private renderBack;
|
|
49
54
|
private renderTitle;
|
|
50
55
|
}
|
|
@@ -40,8 +40,10 @@ var JlPage = class extends JlElement {
|
|
|
40
40
|
attribute: "width",
|
|
41
41
|
parse: oneOf(PAGE_WIDTHS, "standard")
|
|
42
42
|
});
|
|
43
|
-
/** Where the back link leads; no back link without it
|
|
43
|
+
/** Where the back link leads; no back link without it, unless `backable`. */
|
|
44
44
|
back = this.useChange("", () => this.renderBack(), { attribute: "back" });
|
|
45
|
+
/** Shows the back link without an address: pressed, it fires `back`, which the app follows (a router's `goto`). */
|
|
46
|
+
backable = this.useChange(false, () => this.renderBack(), { attribute: "backable" });
|
|
45
47
|
/** The name of the page the back link leads to: "Orders". */
|
|
46
48
|
backLabel = this.useChange("", () => this.renderBack(), { attribute: "back-label" });
|
|
47
49
|
/** The app's name, after the heading in the browser tab. Without it, the page leaves the tab's title alone. */
|
|
@@ -86,13 +88,13 @@ var JlPage = class extends JlElement {
|
|
|
86
88
|
drawTexts() {
|
|
87
89
|
this.renderBack();
|
|
88
90
|
}
|
|
89
|
-
/** The back link stays out of the header's breadcrumb slot without an address, so the header takes no room for it. */
|
|
91
|
+
/** The back link stays out of the header's breadcrumb slot without an address (and not backable), so the header takes no room for it. */
|
|
90
92
|
renderBack() {
|
|
91
93
|
const back = this._refs.back;
|
|
92
94
|
const href = this.back.get();
|
|
93
95
|
back.href.set(href);
|
|
94
96
|
back.label.set(this.backLabel.get() || jlText("back"));
|
|
95
|
-
setOrRemove(back, "slot", href === "" ? "" : BREADCRUMB_SLOT);
|
|
97
|
+
setOrRemove(back, "slot", href === "" && !this.backable.get() ? "" : BREADCRUMB_SLOT);
|
|
96
98
|
}
|
|
97
99
|
renderTitle() {
|
|
98
100
|
const app = this.appName.get();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/templates/jl-split-view.css?inline
|
|
2
|
-
var jl_split_view_default = ":host{height:100%;min-height:0;display:block}.split{grid-template-columns:minmax(0, var(--position,50%)) 1px minmax(0, 1fr);height:100%;display:grid}:host([orientation=vertical]) .split{grid-template-columns:none;grid-template-rows:minmax(0, var(--position,50%)) 1px minmax(0, 1fr)}.pane{min-width:0;min-height:0;overflow:auto}.divider{z-index:1;background:var(--jl-line);cursor:col-resize;touch-action:none;transition:background var(--jl-fast) var(--jl-ease);position:relative}:host([orientation=vertical]) .divider{cursor:row-resize}.divider:before{content:\"\";position:absolute;inset:0 -5px}:host([orientation=vertical]) .divider:before{inset:-5px 0}.divider:hover,.divider:focus-visible,:host([dragging]) .divider{background:var(--jl-accent)}.divider:focus-visible{box-shadow:var(--jl-focus-ring)}.grip{border:1px solid var(--jl-line-strong);border-radius:var(--jl-radius-pill);background:var(--jl-surface);width:6px;height:28px;transition:border-color var(--jl-fast) var(--jl-ease);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}:host([orientation=vertical]) .grip{width:28px;height:6px}.divider:hover .grip,.divider:focus-visible .grip,:host([dragging]) .grip{border-color:var(--jl-accent)}:host([dragging]){cursor:col-resize;-webkit-user-select:none;user-select:none}:host([dragging][orientation=vertical]){cursor:row-resize}:host([dragging]) .pane{pointer-events:none}:host([stacked]) .split{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr)}:host([stacked]) .divider,:host([stacked]:not([pane=end])) .end,:host([stacked][pane=end]) .start{display:none}";
|
|
2
|
+
var jl_split_view_default = ":host{height:100%;min-height:0;display:block}.split{grid-template-columns:minmax(0, var(--position,50%)) 1px minmax(0, 1fr);height:100%;display:grid}:host([orientation=vertical]) .split{grid-template-columns:none;grid-template-rows:minmax(0, var(--position,50%)) 1px minmax(0, 1fr)}.pane{min-width:0;min-height:0;position:relative;overflow:auto}.divider{z-index:1;background:var(--jl-line);cursor:col-resize;touch-action:none;transition:background var(--jl-fast) var(--jl-ease);position:relative}:host([orientation=vertical]) .divider{cursor:row-resize}.divider:before{content:\"\";position:absolute;inset:0 -5px}:host([orientation=vertical]) .divider:before{inset:-5px 0}.divider:hover,.divider:focus-visible,:host([dragging]) .divider{background:var(--jl-accent)}.divider:focus-visible{box-shadow:var(--jl-focus-ring)}.grip{border:1px solid var(--jl-line-strong);border-radius:var(--jl-radius-pill);background:var(--jl-surface);width:6px;height:28px;transition:border-color var(--jl-fast) var(--jl-ease);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}:host([orientation=vertical]) .grip{width:28px;height:6px}.divider:hover .grip,.divider:focus-visible .grip,:host([dragging]) .grip{border-color:var(--jl-accent)}:host([dragging]){cursor:col-resize;-webkit-user-select:none;user-select:none}:host([dragging][orientation=vertical]){cursor:row-resize}:host([dragging]) .pane{pointer-events:none}:host([stacked]) .split{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr)}:host([stacked]) .divider,:host([stacked]:not([pane=end])) .end,:host([stacked][pane=end]) .start{display:none}";
|
|
3
3
|
export { jl_split_view_default as default };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* One level of a breadcrumb: a link when it has an `href`; with an `id` instead, a link the app follows itself (the
|
|
3
|
+
* breadcrumb fires `select` with it); plain text otherwise.
|
|
4
|
+
*/
|
|
5
|
+
export type BreadcrumbItem<Id extends string = string> = {
|
|
3
6
|
label: string;
|
|
4
7
|
href?: string;
|
|
8
|
+
id?: Id;
|
|
5
9
|
icon?: string;
|
|
6
10
|
};
|
|
@@ -6,6 +6,8 @@ export type Fact = {
|
|
|
6
6
|
code?: boolean;
|
|
7
7
|
/** An address: the value is a link to it. */
|
|
8
8
|
href?: string;
|
|
9
|
+
/** Without an `href`, the value is a link the app follows itself: the facts fire `select` with this id. */
|
|
10
|
+
id?: string;
|
|
9
11
|
/** The value's tooltip. */
|
|
10
12
|
hint?: string;
|
|
11
13
|
/** Names the fact for a renderer of `renderers`, which then draws its value. */
|