@syware/jlib 0.12.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/atoms/jl-avatar.css.js +1 -1
  2. package/dist/atoms/jl-avatar.js +1 -8
  3. package/dist/atoms/jl-button.css.js +1 -1
  4. package/dist/atoms/jl-button.js +4 -6
  5. package/dist/atoms/jl-checkbox.css.js +1 -1
  6. package/dist/atoms/jl-checkbox.js +8 -10
  7. package/dist/atoms/jl-chip.css.js +1 -1
  8. package/dist/atoms/jl-chip.js +3 -11
  9. package/dist/atoms/jl-divider.css.js +1 -1
  10. package/dist/atoms/jl-divider.js +1 -5
  11. package/dist/atoms/jl-icon.css.js +1 -1
  12. package/dist/atoms/jl-icon.d.ts +2 -0
  13. package/dist/atoms/jl-icon.js +5 -1
  14. package/dist/atoms/jl-input.d.ts +7 -2
  15. package/dist/atoms/jl-input.js +36 -31
  16. package/dist/atoms/jl-link.css.js +1 -1
  17. package/dist/atoms/jl-link.js +3 -6
  18. package/dist/atoms/jl-progress-ring.js +3 -2
  19. package/dist/atoms/jl-progress.js +3 -2
  20. package/dist/atoms/jl-rating.css.js +1 -1
  21. package/dist/atoms/jl-rating.d.ts +2 -2
  22. package/dist/atoms/jl-rating.js +17 -35
  23. package/dist/atoms/jl-select.d.ts +8 -3
  24. package/dist/atoms/jl-select.js +26 -13
  25. package/dist/atoms/jl-skeleton.d.ts +1 -0
  26. package/dist/atoms/jl-skeleton.js +4 -1
  27. package/dist/atoms/jl-slider.d.ts +4 -0
  28. package/dist/atoms/jl-slider.js +29 -15
  29. package/dist/atoms/jl-switch.css.js +1 -1
  30. package/dist/atoms/jl-switch.js +2 -8
  31. package/dist/atoms/jl-textarea.css.js +1 -1
  32. package/dist/atoms/jl-textarea.d.ts +4 -5
  33. package/dist/atoms/jl-textarea.js +15 -30
  34. package/dist/index.d.ts +1 -1
  35. package/dist/lib/calendar.js +3 -2
  36. package/dist/lib/floating.d.ts +10 -0
  37. package/dist/lib/floating.js +27 -8
  38. package/dist/lib/flow.d.ts +7 -3
  39. package/dist/lib/flow.js +19 -8
  40. package/dist/lib/hotkey.d.ts +13 -0
  41. package/dist/lib/hotkey.js +2 -1
  42. package/dist/lib/indicator.d.ts +16 -0
  43. package/dist/lib/indicator.js +32 -6
  44. package/dist/lib/intl.d.ts +6 -0
  45. package/dist/lib/intl.js +19 -0
  46. package/dist/lib/key-shortcut.js +11 -29
  47. package/dist/lib/palette.js +1 -6
  48. package/dist/lib/progress.d.ts +0 -5
  49. package/dist/lib/progress.js +1 -9
  50. package/dist/lib/roving.d.ts +6 -0
  51. package/dist/lib/roving.js +14 -1
  52. package/dist/lib/table.d.ts +14 -2
  53. package/dist/lib/table.js +50 -39
  54. package/dist/molecules/jl-accordion-item.css.js +1 -1
  55. package/dist/molecules/jl-accordion-item.js +1 -5
  56. package/dist/molecules/jl-account-button.css.js +1 -1
  57. package/dist/molecules/jl-account-button.js +1 -5
  58. package/dist/molecules/jl-alert.css.js +1 -1
  59. package/dist/molecules/jl-alert.d.ts +5 -5
  60. package/dist/molecules/jl-alert.js +4 -13
  61. package/dist/molecules/jl-avatar-group.d.ts +7 -5
  62. package/dist/molecules/jl-avatar-group.js +15 -5
  63. package/dist/molecules/jl-breadcrumb.d.ts +7 -4
  64. package/dist/molecules/jl-breadcrumb.js +32 -8
  65. package/dist/molecules/jl-calendar.d.ts +12 -3
  66. package/dist/molecules/jl-calendar.js +79 -48
  67. package/dist/molecules/jl-card.css.js +1 -1
  68. package/dist/molecules/jl-card.js +2 -8
  69. package/dist/molecules/jl-chip-group.css.js +1 -1
  70. package/dist/molecules/jl-chip-group.d.ts +6 -2
  71. package/dist/molecules/jl-chip-group.js +14 -19
  72. package/dist/molecules/jl-code-block.css.js +1 -1
  73. package/dist/molecules/jl-code-block.d.ts +7 -5
  74. package/dist/molecules/jl-code-block.js +19 -22
  75. package/dist/molecules/jl-combobox.css.js +1 -1
  76. package/dist/molecules/jl-combobox.d.ts +4 -0
  77. package/dist/molecules/jl-combobox.js +33 -19
  78. package/dist/molecules/jl-date-picker.d.ts +6 -0
  79. package/dist/molecules/jl-date-picker.js +29 -9
  80. package/dist/molecules/jl-empty.css.js +1 -1
  81. package/dist/molecules/jl-empty.js +4 -19
  82. package/dist/molecules/jl-field.css.js +1 -1
  83. package/dist/molecules/jl-field.d.ts +7 -1
  84. package/dist/molecules/jl-field.js +35 -23
  85. package/dist/molecules/jl-file-drop.css.js +1 -1
  86. package/dist/molecules/jl-file-drop.js +1 -3
  87. package/dist/molecules/jl-input-list.css.js +1 -1
  88. package/dist/molecules/jl-input-list.d.ts +12 -1
  89. package/dist/molecules/jl-input-list.js +81 -51
  90. package/dist/molecules/jl-list-item.css.js +1 -1
  91. package/dist/molecules/jl-list-item.d.ts +3 -1
  92. package/dist/molecules/jl-list-item.js +26 -27
  93. package/dist/molecules/jl-load-state.css.js +1 -1
  94. package/dist/molecules/jl-load-state.d.ts +6 -1
  95. package/dist/molecules/jl-load-state.js +15 -18
  96. package/dist/molecules/jl-menu.d.ts +1 -0
  97. package/dist/molecules/jl-menu.js +9 -2
  98. package/dist/molecules/jl-pagination.css.js +1 -1
  99. package/dist/molecules/jl-pagination.d.ts +7 -1
  100. package/dist/molecules/jl-pagination.js +43 -35
  101. package/dist/molecules/jl-radio-group.js +1 -1
  102. package/dist/molecules/jl-search.css.js +1 -1
  103. package/dist/molecules/jl-search.js +4 -12
  104. package/dist/molecules/jl-segmented.css.js +1 -1
  105. package/dist/molecules/jl-segmented.d.ts +4 -2
  106. package/dist/molecules/jl-segmented.js +19 -26
  107. package/dist/molecules/jl-stat.css.js +1 -1
  108. package/dist/molecules/jl-stat.js +2 -8
  109. package/dist/molecules/jl-steps.d.ts +10 -3
  110. package/dist/molecules/jl-steps.js +82 -49
  111. package/dist/molecules/jl-tabs.d.ts +5 -2
  112. package/dist/molecules/jl-tabs.js +31 -25
  113. package/dist/molecules/jl-tag-input.css.js +1 -1
  114. package/dist/molecules/jl-tag-input.d.ts +13 -1
  115. package/dist/molecules/jl-tag-input.js +57 -30
  116. package/dist/molecules/jl-timeline.css.js +1 -1
  117. package/dist/molecules/jl-timeline.d.ts +3 -1
  118. package/dist/molecules/jl-timeline.js +9 -14
  119. package/dist/molecules/jl-toast.css.js +1 -1
  120. package/dist/molecules/jl-toast.js +4 -12
  121. package/dist/molecules/jl-tooltip.d.ts +2 -1
  122. package/dist/molecules/jl-tooltip.js +11 -15
  123. package/dist/organisms/jl-command-palette.css.js +1 -1
  124. package/dist/organisms/jl-command-palette.d.ts +8 -1
  125. package/dist/organisms/jl-command-palette.js +74 -43
  126. package/dist/organisms/jl-confirm.css.js +1 -1
  127. package/dist/organisms/jl-confirm.js +1 -5
  128. package/dist/organisms/jl-dialog.css.js +1 -1
  129. package/dist/organisms/jl-dialog.js +1 -5
  130. package/dist/organisms/jl-drawer.css.js +1 -1
  131. package/dist/organisms/jl-drawer.js +1 -3
  132. package/dist/organisms/jl-flow.d.ts +18 -2
  133. package/dist/organisms/jl-flow.js +128 -44
  134. package/dist/organisms/jl-navbar.css.js +1 -1
  135. package/dist/organisms/jl-navbar.d.ts +1 -1
  136. package/dist/organisms/jl-navbar.js +3 -5
  137. package/dist/organisms/jl-page-header.css.js +1 -1
  138. package/dist/organisms/jl-page-header.js +1 -5
  139. package/dist/organisms/jl-page-outlet.d.ts +4 -3
  140. package/dist/organisms/jl-page-outlet.js +7 -8
  141. package/dist/organisms/jl-side-nav.css.js +1 -1
  142. package/dist/organisms/jl-side-nav.d.ts +9 -2
  143. package/dist/organisms/jl-side-nav.js +44 -16
  144. package/dist/organisms/jl-tab-bar.css.js +1 -1
  145. package/dist/organisms/jl-tab-bar.js +0 -2
  146. package/dist/organisms/jl-table.css.js +1 -1
  147. package/dist/organisms/jl-table.d.ts +19 -7
  148. package/dist/organisms/jl-table.js +97 -59
  149. package/dist/organisms/jl-tree.css.js +1 -1
  150. package/dist/organisms/jl-tree.d.ts +16 -13
  151. package/dist/organisms/jl-tree.js +72 -70
  152. package/package.json +4 -2
  153. package/dist/lib/roving-index.d.ts +0 -10
  154. package/dist/lib/roving-index.js +0 -32
  155. /package/dist/types/{roving-index.types.d.ts → roving.types.d.ts} +0 -0
@@ -1,3 +1,3 @@
1
1
  // src/molecules/jl-code-block.css?inline
2
- var jl_code_block_default = ":host{--max-height:none;min-width:0;display:block}figure{border:1px solid var(--jl-line);border-radius:var(--jl-radius);background:var(--jl-surface-2);position:relative;overflow:hidden}header{border-bottom:1px solid var(--jl-line);height:38px;color:var(--jl-muted);font-size:var(--jl-font-xs);justify-content:space-between;align-items:center;gap:12px;padding:0 52px 0 14px;display:flex}.heading{color:var(--jl-text-2);font-family:var(--jl-font-mono);text-overflow:ellipsis;white-space:nowrap;font-weight:500;overflow:hidden}.language{letter-spacing:.06em;text-transform:uppercase;font-weight:600}.body{min-width:0;max-height:var(--max-height);display:flex;overflow-y:auto}.gutter,pre{font-family:var(--jl-font-mono);font-variant-ligatures:no-contextual;padding:14px 16px;font-size:12.5px;line-height:1.7}.gutter{color:var(--jl-faint);text-align:right;white-space:pre;-webkit-user-select:none;user-select:none;flex:none;padding-right:4px}pre{min-width:0;color:var(--jl-text);tab-size:2;flex:1;margin:0;padding-right:48px;overflow-x:auto}:host([wrap]) pre{white-space:pre-wrap;overflow-wrap:anywhere}.copy{background:var(--jl-surface-2);border-radius:var(--jl-radius-sm);position:absolute;top:6px;right:6px}:host(:not([has-header])) .copy{opacity:.6;transition:opacity var(--jl-fast) var(--jl-ease)}:host(:not([has-header])) figure:hover .copy,.copy:focus-within{opacity:1}.tok-comment{color:var(--jl-code-comment);font-style:italic}.tok-string{color:var(--jl-code-string)}.tok-number{color:var(--jl-code-number)}.tok-keyword{color:var(--jl-code-keyword)}.tok-tag{color:var(--jl-code-tag)}.tok-attribute{color:var(--jl-code-attribute)}.tok-property{color:var(--jl-code-property)}.tok-function{color:var(--jl-code-function)}.tok-punctuation{color:var(--jl-muted)}";
2
+ var jl_code_block_default = ":host{--max-height:none;min-width:0;display:block}figure{border:1px solid var(--jl-line);border-radius:var(--jl-radius);background:var(--jl-surface-2);position:relative;overflow:hidden}header{border-bottom:1px solid var(--jl-line);height:38px;color:var(--jl-muted);font-size:var(--jl-font-xs);justify-content:space-between;align-items:center;gap:12px;padding:0 52px 0 14px;display:flex}.heading{color:var(--jl-text-2);font-family:var(--jl-font-mono);text-overflow:ellipsis;white-space:nowrap;font-weight:500;overflow:hidden}.language{letter-spacing:.06em;text-transform:uppercase;font-weight:600}.body{min-width:0;max-height:var(--max-height);display:flex;overflow-y:auto}.gutter,pre{font-family:var(--jl-font-mono);font-variant-ligatures:no-contextual;padding:14px 16px;font-size:12.5px;line-height:1.7}.gutter{color:var(--jl-faint);text-align:right;white-space:pre;-webkit-user-select:none;user-select:none;flex:none;padding-right:4px;display:none}pre{min-width:0;color:var(--jl-text);tab-size:2;flex:1;margin:0;padding-right:48px;overflow-x:auto}:host([line-numbers]) .gutter{display:block}:host(:not([has-header])) header{display:none}:host([wrap]) pre{white-space:pre-wrap;overflow-wrap:anywhere}.copy{background:var(--jl-surface-2);border-radius:var(--jl-radius-sm);position:absolute;top:6px;right:6px}:host(:not([has-header])) .copy{opacity:.6;transition:opacity var(--jl-fast) var(--jl-ease)}:host(:not([has-header])) figure:hover .copy,.copy:focus-within{opacity:1}.tok-comment{color:var(--jl-code-comment);font-style:italic}.tok-string{color:var(--jl-code-string)}.tok-number{color:var(--jl-code-number)}.tok-keyword{color:var(--jl-code-keyword)}.tok-tag{color:var(--jl-code-tag)}.tok-attribute{color:var(--jl-code-attribute)}.tok-property{color:var(--jl-code-property)}.tok-function{color:var(--jl-code-function)}.tok-punctuation{color:var(--jl-muted)}";
3
3
  export { jl_code_block_default as default };
@@ -7,14 +7,14 @@ export declare const CODE_LANGUAGES: readonly CodeLanguage[];
7
7
  */
8
8
  export declare class JlCodeBlock extends JlElement {
9
9
  static readonly selector = "jl-code-block";
10
- readonly code: Readonly<Readonly<{
11
- get(): string;
12
- set(setter: string | ((prevState: string) => string)): void;
13
- }>>;
14
10
  readonly language: Readonly<Readonly<{
15
11
  get(): CodeLanguage;
16
12
  set(setter: ((prevState: CodeLanguage) => CodeLanguage) | CodeLanguage): void;
17
13
  }>>;
14
+ readonly code: Readonly<Readonly<{
15
+ get(): string;
16
+ set(setter: string | ((prevState: string) => string)): void;
17
+ }>>;
18
18
  /** A file name or a title over the code. */
19
19
  readonly heading: Readonly<Readonly<{
20
20
  get(): string;
@@ -38,12 +38,14 @@ export declare class JlCodeBlock extends JlElement {
38
38
  get(): string;
39
39
  set(setter: string | ((prevState: string) => string)): void;
40
40
  }>>;
41
+ /** What the code was coloured from: the inputs call back with what they hold as the block connects. */
42
+ private readonly _drawn;
41
43
  private readonly _refs;
42
44
  templateHtml(): Node;
43
45
  templateCss(): string;
44
46
  /** The code shown: the `code` input, or else the text the page wrote inside the element. */
45
47
  private source;
46
48
  private render;
49
+ /** The line numbers, which the CSS shows with `line-numbers`. */
47
50
  private renderGutter;
48
- private renderHeader;
49
51
  }
@@ -29,14 +29,17 @@ var LANGUAGE_LABELS = {
29
29
  */
30
30
  var JlCodeBlock = class extends JlElement {
31
31
  static selector = "jl-code-block";
32
- code = this.useChange("", () => this.render(), { attribute: "code" });
33
32
  language = this.useChange("text", () => this.render(), {
34
33
  attribute: "language",
35
34
  parse: oneOf(CODE_LANGUAGES, "text")
36
35
  });
36
+ code = this.useChange("", () => this.render(), { attribute: "code" });
37
37
  /** A file name or a title over the code. */
38
- heading = this.useChange("", () => this.renderHeader(), { attribute: "heading" });
39
- lineNumbers = this.useChange(false, () => this.render(), { attribute: "line-numbers" });
38
+ heading = this.useChange("", (value) => {
39
+ this._refs.heading.textContent = value;
40
+ this.reflect("has-header", value !== "");
41
+ }, { attribute: "heading" });
42
+ lineNumbers = this.useChange(false, (value) => this.reflect("line-numbers", value), { attribute: "line-numbers" });
40
43
  hideCopy = this.useChange(false, (value) => {
41
44
  this._refs.copy.hidden = value;
42
45
  }, { attribute: "hide-copy" });
@@ -44,27 +47,27 @@ var JlCodeBlock = class extends JlElement {
44
47
  wrap = this.useChange(false, (value) => this.reflect("wrap", value), { attribute: "wrap" });
45
48
  /** A CSS height past which the code scrolls under its header: `320px`, `50vh`; a number is pixels. */
46
49
  maxHeight = this.useChange("", (value) => this.style.setProperty("--max-height", value.trim() === "" ? "none" : cssLength(value)), { attribute: "max-height" });
50
+ /** What the code was coloured from: the inputs call back with what they hold as the block connects. */
51
+ _drawn = {
52
+ language: "",
53
+ source: ""
54
+ };
47
55
  _refs = this.useRefs((ref) => ({
48
56
  code: ref("code"),
49
57
  copy: ref(JlCopyButton),
50
58
  gutter: ref(".gutter"),
51
- header: ref("header"),
52
59
  heading: ref(".heading"),
53
60
  language: ref(".language")
54
61
  }));
55
62
  templateHtml() {
56
63
  return /* @__PURE__ */ jsxs("figure", {
57
64
  attrs: { part: "base" },
58
- children: [/* @__PURE__ */ jsxs("header", {
59
- hidden: true,
60
- children: [/* @__PURE__ */ jsx("span", { class: "heading" }), /* @__PURE__ */ jsx("span", { class: "language" })]
61
- }), /* @__PURE__ */ jsxs("div", {
65
+ children: [/* @__PURE__ */ jsxs("header", { children: [/* @__PURE__ */ jsx("span", { class: "heading" }), /* @__PURE__ */ jsx("span", { class: "language" })] }), /* @__PURE__ */ jsxs("div", {
62
66
  class: "body",
63
67
  children: [
64
68
  /* @__PURE__ */ jsx("div", {
65
69
  class: "gutter",
66
- "aria-hidden": "true",
67
- hidden: true
70
+ "aria-hidden": "true"
68
71
  }),
69
72
  /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", {}) }),
70
73
  /* @__PURE__ */ jsx(JlCopyButton, { class: "copy" })
@@ -85,24 +88,18 @@ var JlCodeBlock = class extends JlElement {
85
88
  render() {
86
89
  const source = this.source();
87
90
  const language = this.language.get();
91
+ if (source === this._drawn.source && language === this._drawn.language) return;
92
+ this._drawn.source = source;
93
+ this._drawn.language = language;
88
94
  this._refs.code.replaceChildren(...highlightedNodes(source, language));
89
95
  this._refs.copy.value.set(source);
96
+ this._refs.language.textContent = LANGUAGE_LABELS[language];
90
97
  this.renderGutter(source);
91
- this.renderHeader();
92
98
  }
99
+ /** The line numbers, which the CSS shows with `line-numbers`. */
93
100
  renderGutter(source) {
94
- const gutter = this._refs.gutter;
95
- gutter.hidden = !this.lineNumbers.get();
96
101
  const count = source.split("\n").length;
97
- gutter.textContent = Array.from({ length: count }, (_, index) => String(index + 1)).join("\n");
98
- }
99
- renderHeader() {
100
- const heading = this.heading.get();
101
- const label = LANGUAGE_LABELS[this.language.get()];
102
- this._refs.heading.textContent = heading;
103
- this._refs.language.textContent = label;
104
- this._refs.header.hidden = heading === "";
105
- this.reflect("has-header", heading !== "");
102
+ this._refs.gutter.textContent = Array.from({ length: count }, (_, index) => String(index + 1)).join("\n");
106
103
  }
107
104
  };
108
105
  JlCodeBlock.register();
@@ -1,3 +1,3 @@
1
1
  // src/molecules/jl-combobox.css?inline
2
- var jl_combobox_default = ":host{min-width:0;display:block}.toggle jl-icon{transition:transform var(--jl-fast) var(--jl-ease)}:host([open]) .toggle jl-icon{transform:rotate(180deg)}.toggle:disabled{cursor:not-allowed}.popup{padding:4px}.listbox{max-height:264px;margin:0;padding:0;list-style:none;position:relative;overflow-y:auto}.option{border-radius:var(--jl-radius-xs);min-height:34px;color:var(--jl-text);font-size:var(--jl-font-md);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:10px;padding:6px 10px;line-height:1.35;display:flex}.option.active{background:var(--jl-surface-3)}.option-label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.option.chosen .option-label{font-weight:600}.option[aria-disabled=true]{color:var(--jl-faint);cursor:not-allowed}.text{flex:1;gap:1px;min-width:0;display:grid}.description{color:var(--jl-muted);font-size:var(--jl-font-xs)}.check{color:var(--jl-accent);visibility:hidden}.option.chosen .check{visibility:visible}mark{color:var(--jl-accent);background:0 0;font-weight:700}.empty{color:var(--jl-muted);font-size:var(--jl-font-sm);padding:8px 10px}";
2
+ var jl_combobox_default = ":host{min-width:0;display:block}.toggle jl-icon{transition:transform var(--jl-fast) var(--jl-ease)}:host([open]) .toggle jl-icon{transform:rotate(180deg)}.toggle:disabled{cursor:not-allowed}.popup{padding:4px}.listbox{max-height:264px;margin:0;padding:0;list-style:none;position:relative;overflow-y:auto}.option{border-radius:var(--jl-radius-xs);min-height:34px;color:var(--jl-text);font-size:var(--jl-font-md);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:10px;padding:6px 10px;line-height:1.35;display:flex}.option[aria-selected=true]{background:var(--jl-surface-3)}.option-label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.option.chosen .option-label{font-weight:600}.option[aria-disabled=true]{color:var(--jl-faint);cursor:not-allowed}.text{flex:1;gap:1px;min-width:0;display:grid}.description{color:var(--jl-muted);font-size:var(--jl-font-xs)}.check{color:var(--jl-accent);visibility:hidden}.option.chosen .check{visibility:visible}mark{color:var(--jl-accent);background:0 0;font-weight:700}.empty{color:var(--jl-muted);font-size:var(--jl-font-sm);padding:8px 10px}";
3
3
  export { jl_combobox_default as default };
@@ -64,6 +64,7 @@ export declare class JlCombobox extends JlFormControl {
64
64
  }>>;
65
65
  private readonly _listId;
66
66
  private readonly _state;
67
+ private readonly _items;
67
68
  private readonly _refs;
68
69
  focus(options?: FocusOptions): void;
69
70
  templateHtml(): Node;
@@ -108,7 +109,10 @@ export declare class JlCombobox extends JlFormControl {
108
109
  private clearValue;
109
110
  /** New options: the field may now show the value's label, and an open list (or one being typed in) refreshes. */
110
111
  private renderOptionsChange;
112
+ /** The options that match what was typed, in their order: elements already made are moved, not made again. */
111
113
  private renderOptions;
114
+ /** The option's element, made once, with where it now sits, whether it is chosen, and the typed text marked. */
115
+ private drawOption;
112
116
  private optionNode;
113
117
  /** The active option is the one the arrows reached: aria-selected and aria-activedescendant follow it. */
114
118
  private renderActive;
@@ -75,11 +75,14 @@ var JlCombobox = class extends JlFormControl {
75
75
  _listId = uniqueId("jl-combobox-list");
76
76
  _state = {
77
77
  active: NONE,
78
+ /** The option element the arrows reached: it alone is marked, wherever the filter put it. */
79
+ activeItem: null,
78
80
  matches: [],
79
81
  opening: new AbortController(),
80
82
  /** What people typed since the last choice; empty shows every option. */
81
83
  query: ""
82
84
  };
85
+ _items = /* @__PURE__ */ new WeakMap();
83
86
  _refs = this.useRefs((ref) => ({
84
87
  clear: ref(".clear"),
85
88
  control: ref(".control"),
@@ -379,28 +382,40 @@ var JlCombobox = class extends JlFormControl {
379
382
  const typing = this._state.query !== "";
380
383
  if (this.isOpen() || typing && this.matches(":focus-within")) this.openList(typing);
381
384
  }
385
+ /** The options that match what was typed, in their order: elements already made are moved, not made again. */
382
386
  renderOptions() {
383
387
  const matches = filterOptions(this.options.get(), this._state.query);
384
388
  const value = this.value.get();
389
+ const listbox = this._refs.listbox;
385
390
  this._state.matches = matches;
386
- this._refs.listbox.replaceChildren(...matches.map((option, index) => this.optionNode(option, index, value)));
387
- this._refs.listbox.hidden = matches.length === 0;
391
+ matches.forEach((option, index) => {
392
+ const item = this.drawOption(option, index, value);
393
+ const current = listbox.children.item(index);
394
+ if (current !== item) listbox.insertBefore(item, current);
395
+ });
396
+ while (listbox.children.length > matches.length) listbox.lastElementChild?.remove();
397
+ listbox.hidden = matches.length === 0;
388
398
  this._refs.empty.hidden = matches.length > 0;
389
399
  }
390
- optionNode(option, index, value) {
400
+ /** The option's element, made once, with where it now sits, whether it is chosen, and the typed text marked. */
401
+ drawOption(option, index, value) {
402
+ const item = this._items.get(option) ?? this.optionNode(option);
403
+ this._items.set(option, item);
404
+ item.id = `${this._listId}-${index}`;
405
+ item.dataset.index = String(index);
406
+ item.classList.toggle("chosen", option.value === value);
407
+ item.querySelector(".option-label")?.replaceChildren(...highlighted(option.label, this._state.query));
408
+ return item;
409
+ }
410
+ optionNode(option) {
391
411
  return /* @__PURE__ */ jsxs("div", {
392
- class: option.value === value ? "option chosen" : "option",
412
+ class: "option",
393
413
  role: "option",
394
- id: `${this._listId}-${index}`,
395
- "data-index": String(index),
396
414
  "aria-selected": "false",
397
415
  "aria-disabled": option.disabled === true ? "true" : void 0,
398
416
  children: [/* @__PURE__ */ jsxs("span", {
399
417
  class: "text",
400
- children: [/* @__PURE__ */ jsx("span", {
401
- class: "option-label",
402
- children: highlighted(option.label, this._state.query)
403
- }), option.description === void 0 ? null : /* @__PURE__ */ jsx("span", {
418
+ children: [/* @__PURE__ */ jsx("span", { class: "option-label" }), option.description === void 0 ? null : /* @__PURE__ */ jsx("span", {
404
419
  class: "description",
405
420
  children: option.description
406
421
  })]
@@ -413,17 +428,16 @@ var JlCombobox = class extends JlFormControl {
413
428
  }
414
429
  /** The active option is the one the arrows reached: aria-selected and aria-activedescendant follow it. */
415
430
  renderActive() {
416
- const active = this._state.active;
417
- for (const item of this._refs.listbox.querySelectorAll("[data-index]")) {
418
- const isActive = Number(item.dataset.index) === active;
419
- item.classList.toggle("active", isActive);
420
- item.setAttribute("aria-selected", String(isActive));
421
- }
422
- setOrRemove(this._refs.native, "aria-activedescendant", active === NONE ? "" : `${this._listId}-${active}`);
431
+ const option = this._state.matches[this._state.active];
432
+ const item = option === void 0 ? null : this._items.get(option) ?? null;
433
+ this._state.activeItem?.setAttribute("aria-selected", "false");
434
+ item?.setAttribute("aria-selected", "true");
435
+ this._state.activeItem = item;
436
+ setOrRemove(this._refs.native, "aria-activedescendant", item?.id ?? "");
423
437
  }
424
438
  revealActive() {
425
- const item = this._refs.listbox.children[this._state.active];
426
- if (item instanceof HTMLElement) keepInView(this._refs.listbox, item);
439
+ const item = this._state.activeItem;
440
+ if (item !== null) keepInView(this._refs.listbox, item);
427
441
  }
428
442
  /** The label of the value's option (or the value itself, as free text), unless people are typing. */
429
443
  renderValue() {
@@ -92,6 +92,12 @@ export declare class JlDatePicker extends JlFormControl {
92
92
  /** Escape closes the calendar and brings the focus back to the field, where it came from. */
93
93
  private onPopupKey;
94
94
  private onPick;
95
+ /**
96
+ * The calendar, made the first time the popup opens with the field's language, week, bounds and value: a closed
97
+ * picker draws no month, and a form may hold many pickers.
98
+ */
99
+ private calendar;
100
+ private shownCalendar;
95
101
  private openPopup;
96
102
  private closePopup;
97
103
  /**
@@ -47,12 +47,12 @@ var JlDatePicker = class extends JlFormControl {
47
47
  max = this.useChange("", (value) => this.renderBound("max", value), { attribute: "max" });
48
48
  /** The language the date and the calendar are written in: `fr-CH`. The page's by default. */
49
49
  locale = this.useChange("", (value) => {
50
- this._refs.calendar.locale.set(value);
50
+ this.shownCalendar()?.locale.set(value);
51
51
  this.renderPlaceholder();
52
52
  this.renderValue();
53
53
  }, { attribute: "locale" });
54
54
  /** The day the calendar's weeks start on: 0 for Sunday, 1 for Monday. */
55
- firstDay = this.useChange(MONDAY, (value) => this._refs.calendar.firstDay.set(value), {
55
+ firstDay = this.useChange(MONDAY, (value) => this.shownCalendar()?.firstDay.set(value), {
56
56
  attribute: "first-day",
57
57
  parse: parseWeekday
58
58
  });
@@ -80,7 +80,6 @@ var JlDatePicker = class extends JlFormControl {
80
80
  openOnPress: null
81
81
  };
82
82
  _refs = this.useRefs((ref) => ({
83
- calendar: ref(JlCalendar),
84
83
  clear: ref(".clear"),
85
84
  control: ref(".control"),
86
85
  native: ref("input"),
@@ -141,8 +140,7 @@ var JlDatePicker = class extends JlFormControl {
141
140
  id: this._popupId,
142
141
  popover: "auto",
143
142
  role: "dialog",
144
- attrs: { part: "popup" },
145
- children: /* @__PURE__ */ jsx(JlCalendar, { class: "calendar" })
143
+ attrs: { part: "popup" }
146
144
  })] });
147
145
  }
148
146
  templateCss() {
@@ -174,7 +172,7 @@ var JlDatePicker = class extends JlFormControl {
174
172
  this.on(this._refs.clear, "click", () => this.clearValue());
175
173
  this.on(this._refs.popup, "toggle", (event) => this.onToggle(event));
176
174
  this.on(this._refs.popup, "keydown", (event) => this.onPopupKey(event));
177
- this._refs.calendar.events.register("pick", (iso) => this.onPick(iso));
175
+ this.shownCalendar()?.events.register("pick", (iso) => this.onPick(iso));
178
176
  }
179
177
  onDisconnect() {
180
178
  this._state.opening.abort();
@@ -232,10 +230,32 @@ var JlDatePicker = class extends JlFormControl {
232
230
  this.commit(iso);
233
231
  this.focus();
234
232
  }
233
+ /**
234
+ * The calendar, made the first time the popup opens with the field's language, week, bounds and value: a closed
235
+ * picker draws no month, and a form may hold many pickers.
236
+ */
237
+ calendar() {
238
+ const shown = this.shownCalendar();
239
+ if (shown !== null) return shown;
240
+ const calendar = /* @__PURE__ */ jsx(JlCalendar, {
241
+ class: "calendar",
242
+ locale: this.locale.get(),
243
+ firstDay: this.firstDay.get(),
244
+ min: this.min.get(),
245
+ max: this.max.get(),
246
+ value: this.validIso()
247
+ });
248
+ calendar.events.register("pick", (iso) => this.onPick(iso));
249
+ this._refs.popup.append(calendar);
250
+ return calendar;
251
+ }
252
+ shownCalendar() {
253
+ return this._refs.popup.querySelector(JlCalendar.selector);
254
+ }
235
255
  openPopup() {
236
256
  if (this.isOpen() || this.disabled.get() || this._refs.native.disabled) return;
237
257
  this.commitText();
238
- const calendar = this._refs.calendar;
258
+ const calendar = this.calendar();
239
259
  calendar.value.set(this.validIso());
240
260
  const popup = this._refs.popup;
241
261
  popup.showPopover();
@@ -290,13 +310,13 @@ var JlDatePicker = class extends JlFormControl {
290
310
  renderValue() {
291
311
  const value = this.validIso();
292
312
  this._refs.native.value = this.display(value);
293
- this._refs.calendar.value.set(value);
313
+ this.shownCalendar()?.value.set(value);
294
314
  this.internals.setFormValue(value);
295
315
  this.renderValidity();
296
316
  this.renderClear();
297
317
  }
298
318
  renderBound(bound, value) {
299
- this._refs.calendar[bound].set(value);
319
+ this.shownCalendar()?.[bound].set(value);
300
320
  this.renderValidity();
301
321
  }
302
322
  /** Required, and within min and max, as a native date field checks it. */
@@ -1,3 +1,3 @@
1
1
  // src/molecules/jl-empty.css?inline
2
- var jl_empty_default = ":host{--pad:40px 24px;--medallion:48px;--heading:var(--jl-font-lg);display:block}:host([size=sm]){--pad:24px 16px;--medallion:40px;--heading:var(--jl-font-md)}.empty{padding:var(--pad);text-align:center;flex-direction:column;align-items:center;display:flex}.medallion{width:var(--medallion);height:var(--medallion);border:1px solid var(--jl-line);background:var(--jl-surface-2);color:var(--jl-muted);border-radius:50%;justify-content:center;align-items:center;margin-bottom:14px;display:inline-flex}:host([size=sm]) .medallion{margin-bottom:10px}.heading{color:var(--jl-text);font-size:var(--heading);letter-spacing:-.01em;font-weight:650;line-height:1.35}.description{max-width:44ch;color:var(--jl-muted);font-size:var(--jl-font-sm);margin-top:4px;line-height:1.55}.actions{flex-wrap:wrap;justify-content:center;gap:8px;margin-top:18px;display:flex}:host([size=sm]) .actions{margin-top:14px}";
2
+ var jl_empty_default = ":host{--pad:40px 24px;--medallion:48px;--heading:var(--jl-font-lg);display:block}:host([size=sm]){--pad:24px 16px;--medallion:40px;--heading:var(--jl-font-md)}.empty{padding:var(--pad);text-align:center;flex-direction:column;align-items:center;display:flex}.medallion{width:var(--medallion);height:var(--medallion);border:1px solid var(--jl-line);background:var(--jl-surface-2);color:var(--jl-muted);border-radius:50%;justify-content:center;align-items:center;margin-bottom:14px;display:inline-flex}:host([size=sm]) .medallion{margin-bottom:10px}.heading{color:var(--jl-text);font-size:var(--heading);letter-spacing:-.01em;font-weight:650;line-height:1.35}.heading:empty,.description:empty{display:none}.description{max-width:44ch;color:var(--jl-muted);font-size:var(--jl-font-sm);margin-top:4px;line-height:1.55}.actions{flex-wrap:wrap;justify-content:center;gap:8px;margin-top:18px;display:flex}:host([size=sm]) .actions{margin-top:14px}jl-icon{--icon-size:22px}:host([size=sm]) jl-icon{--icon-size:18px}";
3
3
  export { jl_empty_default as default };
@@ -13,28 +13,21 @@ registerIcons({ inbox: Inbox });
13
13
  var EMPTY_SIZES = ["md", "sm"];
14
14
  var DEFAULT_ICON = "inbox";
15
15
  var NO_ICON = "none";
16
- var ICON_SIZES = {
17
- md: 22,
18
- sm: 18
19
- };
20
16
  /**
21
17
  * What a list, a table or a page shows when it has nothing yet: an icon, a heading, a sentence that says what to
22
18
  * do, and the buttons to do it in the default slot.
23
19
  */
24
20
  var JlEmpty = class extends JlElement {
25
21
  static selector = "jl-empty";
26
- icon = this.useChange(DEFAULT_ICON, () => this.renderIcon(), { attribute: "icon" });
22
+ icon = this.useChange(DEFAULT_ICON, (value) => this.renderIcon(value), { attribute: "icon" });
27
23
  heading = this.useChange("", (value) => {
28
24
  this._refs.heading.textContent = value;
29
- this._refs.heading.hidden = value === "";
30
25
  }, { attribute: "heading" });
31
26
  description = this.useChange("", (value) => {
32
27
  this._refs.description.textContent = value;
33
- this._refs.description.hidden = value === "";
34
28
  }, { attribute: "description" });
35
29
  size = this.useChange("md", (value) => {
36
30
  this.reflect("size", value);
37
- this.renderIcon();
38
31
  }, {
39
32
  attribute: "size",
40
33
  parse: oneOf(EMPTY_SIZES, "md")
@@ -56,14 +49,8 @@ var JlEmpty = class extends JlElement {
56
49
  class: "medallion",
57
50
  children: /* @__PURE__ */ jsx(JlIcon, {})
58
51
  }),
59
- /* @__PURE__ */ jsx("p", {
60
- class: "heading",
61
- hidden: true
62
- }),
63
- /* @__PURE__ */ jsx("p", {
64
- class: "description",
65
- hidden: true
66
- }),
52
+ /* @__PURE__ */ jsx("p", { class: "heading" }),
53
+ /* @__PURE__ */ jsx("p", { class: "description" }),
67
54
  /* @__PURE__ */ jsx("div", {
68
55
  class: "actions",
69
56
  hidden: true,
@@ -82,11 +69,9 @@ var JlEmpty = class extends JlElement {
82
69
  renderActions() {
83
70
  this._refs.actions.hidden = !hasSlotted(this._refs.slot);
84
71
  }
85
- renderIcon() {
86
- const name = this.icon.get();
72
+ renderIcon(name) {
87
73
  const hidden = name === "" || name === NO_ICON;
88
74
  this._refs.icon.name.set(hidden ? "" : name);
89
- this._refs.icon.size.set(ICON_SIZES[this.size.get()]);
90
75
  this._refs.medallion.hidden = hidden;
91
76
  }
92
77
  };
@@ -1,3 +1,3 @@
1
1
  // src/molecules/jl-field.css?inline
2
- var jl_field_default = ":host{--label-width:160px;display:block;container-type:inline-size}.field{gap:6px;display:grid}.label-row{color:var(--jl-text);font-size:var(--jl-font-sm);gap:3px;font-weight:600;line-height:20px;display:flex}.asterisk{color:var(--jl-danger)}.body{grid-template-columns:minmax(0,1fr);gap:6px;min-width:0;display:grid}.hint{color:var(--jl-muted);font-size:var(--jl-font-sm);line-height:18px}.error-region:empty{display:contents}.error{color:var(--jl-danger);font-size:var(--jl-font-sm);align-items:flex-start;gap:6px;line-height:18px;display:flex}.error jl-icon{flex:none;margin-top:2px}:host([orientation=horizontal]) .field{grid-template-columns:var(--label-width) minmax(0, 1fr);align-items:baseline;gap:6px 16px}@container (width<=420px){:host([orientation=horizontal]) .field{grid-template-columns:minmax(0,1fr)}}";
2
+ var jl_field_default = ":host{--label-width:160px;display:block;container-type:inline-size}.field{gap:6px;display:grid}.label-row{color:var(--jl-text);font-size:var(--jl-font-sm);gap:3px;font-weight:600;line-height:20px;display:flex}.asterisk{color:var(--jl-danger)}.body{grid-template-columns:minmax(0,1fr);gap:6px;min-width:0;display:grid}.hint{color:var(--jl-muted);font-size:var(--jl-font-sm);line-height:18px}.error{color:var(--jl-danger);font-size:var(--jl-font-sm);align-items:flex-start;gap:6px;line-height:18px;display:flex}.error jl-icon{flex:none;margin-top:2px}.label-row:has(>.label:empty),.hint:empty,:host([has-error]) .hint{display:none}:host(:not([has-error])) .error-region{display:contents}:host(:not([has-error])) .error{display:none}:host([orientation=horizontal]) .field{grid-template-columns:var(--label-width) minmax(0, 1fr);align-items:baseline;gap:6px 16px}@container (width<=420px){:host([orientation=horizontal]) .field{grid-template-columns:minmax(0,1fr)}}";
3
3
  export { jl_field_default as default };
@@ -38,8 +38,14 @@ export declare class JlField extends JlElement {
38
38
  /** The control in the slot: the first element the page put there. */
39
39
  private control;
40
40
  private focusControl;
41
- private renderMessages;
41
+ /**
42
+ * Shows the error, which the CSS hides with the field's `has-error`: its paragraph is made at the first error, then
43
+ * only its text changes. A field that never has one makes no icon.
44
+ */
45
+ private renderError;
42
46
  private syncControl;
47
+ /** Runs `sync` on the control in the slot, when there is one. */
48
+ private withControl;
43
49
  /** Names the control for screen readers with the field's label, unless it has a label of its own. */
44
50
  private syncLabel;
45
51
  /** Marks the control invalid, remembering it unless the page had marked it already. */
@@ -24,15 +24,16 @@ var JlField = class extends JlElement {
24
24
  static selector = "jl-field";
25
25
  label = this.useChange("", (value) => {
26
26
  this._refs.label.textContent = value;
27
- this._refs.labelRow.hidden = value === "";
28
- this.syncControl();
27
+ this.withControl((control) => this.syncLabel(control));
29
28
  }, { attribute: "label" });
30
29
  /** Help under the control, hidden while there is an error. */
31
- hint = this.useChange("", () => this.renderMessages(), { attribute: "hint" });
30
+ hint = this.useChange("", (value) => {
31
+ this._refs.hint.textContent = value;
32
+ }, { attribute: "hint" });
32
33
  /** What is wrong with the value, in the danger colour; the control is drawn as invalid meanwhile. */
33
- error = this.useChange("", () => {
34
- this.renderMessages();
35
- this.syncControl();
34
+ error = this.useChange("", (value) => {
35
+ this.renderError(value);
36
+ this.withControl((control) => this.syncInvalid(control));
36
37
  }, { attribute: "error" });
37
38
  /** Adds an asterisk to the label. Set `required` on the control too, for the form to check it. */
38
39
  required = this.useChange(false, (value) => {
@@ -57,7 +58,6 @@ var JlField = class extends JlElement {
57
58
  attrs: { part: "base" },
58
59
  children: [/* @__PURE__ */ jsxs("div", {
59
60
  class: "label-row",
60
- hidden: true,
61
61
  children: [/* @__PURE__ */ jsx("span", { class: "label" }), /* @__PURE__ */ jsx("span", {
62
62
  class: "asterisk",
63
63
  "aria-hidden": "true",
@@ -68,10 +68,7 @@ var JlField = class extends JlElement {
68
68
  class: "body",
69
69
  children: [
70
70
  /* @__PURE__ */ jsx("slot", {}),
71
- /* @__PURE__ */ jsx("p", {
72
- class: "hint",
73
- hidden: true
74
- }),
71
+ /* @__PURE__ */ jsx("p", { class: "hint" }),
75
72
  /* @__PURE__ */ jsx("div", {
76
73
  class: "error-region",
77
74
  "aria-live": "polite"
@@ -96,31 +93,46 @@ var JlField = class extends JlElement {
96
93
  focusControl() {
97
94
  this.control()?.focus();
98
95
  }
99
- renderMessages() {
100
- const error = this.error.get();
101
- const hint = this.hint.get();
102
- this._refs.hint.textContent = hint;
103
- this._refs.hint.hidden = hint === "" || error !== "";
96
+ /**
97
+ * Shows the error, which the CSS hides with the field's `has-error`: its paragraph is made at the first error, then
98
+ * only its text changes. A field that never has one makes no icon.
99
+ */
100
+ renderError(error) {
104
101
  this.reflect("has-error", error !== "");
105
- this._refs.errorRegion.replaceChildren(...error === "" ? [] : [/* @__PURE__ */ jsxs("p", {
102
+ const region = this._refs.errorRegion;
103
+ const text = region.querySelector(".error-text");
104
+ if (text !== null) {
105
+ text.textContent = error;
106
+ return;
107
+ }
108
+ if (error === "") return;
109
+ region.append(/* @__PURE__ */ jsxs("p", {
106
110
  class: "error",
107
111
  children: [/* @__PURE__ */ jsx(JlIcon, {
108
112
  name: "circle-alert",
109
113
  size: ERROR_ICON_SIZE
110
- }), /* @__PURE__ */ jsx("span", { children: error })]
111
- })]);
114
+ }), /* @__PURE__ */ jsx("span", {
115
+ class: "error-text",
116
+ children: error
117
+ })]
118
+ }));
112
119
  }
113
120
  syncControl() {
121
+ this.withControl((control) => {
122
+ this.syncLabel(control);
123
+ this.syncInvalid(control);
124
+ });
125
+ }
126
+ /** Runs `sync` on the control in the slot, when there is one. */
127
+ withControl(sync) {
114
128
  const control = this.control();
115
- if (control === null) return;
116
- this.syncLabel(control);
117
- this.syncInvalid(control);
129
+ if (control !== null) sync(control);
118
130
  }
119
131
  /** Names the control for screen readers with the field's label, unless it has a label of its own. */
120
132
  syncLabel(control) {
121
133
  const input = inputOf(control, "label");
122
134
  const ownLabel = control.hasAttribute("label") || VISIBLE_LABEL_TAGS.includes(control.localName);
123
- if (input === null || ownLabel) return;
135
+ if (input === null || ownLabel || input.get() === this.label.get()) return;
124
136
  input.set(this.label.get());
125
137
  }
126
138
  /** Marks the control invalid, remembering it unless the page had marked it already. */
@@ -1,3 +1,3 @@
1
1
  // src/molecules/jl-file-drop.css?inline
2
- var jl_file_drop_default = ":host{--pad:24px;--badge:44px;min-width:0;display:block}:host([size=sm]){--pad:14px;--badge:34px}:host([size=lg]){--pad:36px;--badge:52px}.zone{padding:var(--pad);border:1.5px dashed var(--jl-line-strong);border-radius:var(--jl-radius);background:var(--jl-surface);color:var(--jl-text);text-align:center;cursor:pointer;transition:border-color var(--jl-fast) var(--jl-ease), background var(--jl-fast) var(--jl-ease);flex-direction:column;align-items:center;gap:4px;display:flex}.zone:hover{border-color:color-mix(in srgb, var(--jl-line-strong) 60%, var(--jl-text) 18%);background:var(--jl-surface-2)}:host([dragging]) .zone{border-color:var(--jl-accent);background:var(--jl-accent-soft)}:host([invalid]) .zone{border-color:var(--jl-danger)}:host([disabled]) .zone{border-color:var(--jl-line-strong);background:var(--jl-surface-2);color:var(--jl-muted);cursor:not-allowed}.zone-icon{width:var(--badge);height:var(--badge);border-radius:var(--jl-radius-pill);background:var(--jl-surface-3);color:var(--jl-muted);transition:background var(--jl-fast) var(--jl-ease), color var(--jl-fast) var(--jl-ease);justify-content:center;align-items:center;margin-bottom:6px}:host([dragging]) .zone-icon{background:var(--jl-surface);color:var(--jl-accent)}.text{font-size:var(--jl-font-md);font-weight:600;line-height:1.4}:host([size=sm]) .text{font-size:var(--jl-font-sm)}.hint{color:var(--jl-muted);font-size:var(--jl-font-xs);line-height:1.4}.browse{height:var(--jl-control-sm);border:1px solid var(--jl-line-strong);border-radius:var(--jl-radius-sm);background:var(--jl-surface);font-size:var(--jl-font-xs);cursor:pointer;transition:background var(--jl-fast) var(--jl-ease);align-items:center;margin-top:8px;padding:0 12px;font-weight:600;display:inline-flex}.browse:hover{background:var(--jl-surface-3)}.browse:disabled{cursor:not-allowed;opacity:.5}.refused,.files{margin:8px 0 0;padding:0;list-style:none}.refused{color:var(--jl-danger);font-size:var(--jl-font-sm);gap:4px;line-height:1.45;display:grid}.refusal{align-items:flex-start;gap:6px;display:flex}.refusal jl-icon{margin-top:3px}.refused-name{overflow-wrap:anywhere;font-weight:600}.files{border:1px solid var(--jl-line);border-radius:var(--jl-radius)}.file{align-items:center;gap:10px;min-height:40px;padding:6px 8px 6px 12px;display:flex}.file+.file{border-top:1px solid var(--jl-line)}.file-icon{color:var(--jl-faint)}.file-name{min-width:0;font-size:var(--jl-font-sm);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.file-size{color:var(--jl-muted);font-family:var(--jl-font-mono);font-size:var(--jl-font-xs);white-space:nowrap}.file-remove{border-radius:var(--jl-radius-xs);width:26px;height:26px;color:var(--jl-faint);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.file-remove:hover{background:var(--jl-surface-3);color:var(--jl-text)}.hint:first-letter{text-transform:uppercase}";
2
+ var jl_file_drop_default = ":host{--pad:24px;--badge:44px;min-width:0;display:block}:host([size=sm]){--pad:14px;--badge:34px}:host([size=lg]){--pad:36px;--badge:52px}.zone{padding:var(--pad);border:1.5px dashed var(--jl-line-strong);border-radius:var(--jl-radius);background:var(--jl-surface);color:var(--jl-text);text-align:center;cursor:pointer;transition:border-color var(--jl-fast) var(--jl-ease), background var(--jl-fast) var(--jl-ease);flex-direction:column;align-items:center;gap:4px;display:flex}.zone:hover{border-color:color-mix(in srgb, var(--jl-line-strong) 60%, var(--jl-text) 18%);background:var(--jl-surface-2)}:host([dragging]) .zone{border-color:var(--jl-accent);background:var(--jl-accent-soft)}:host([invalid]) .zone{border-color:var(--jl-danger)}:host([disabled]) .zone{border-color:var(--jl-line-strong);background:var(--jl-surface-2);color:var(--jl-muted);cursor:not-allowed}.zone-icon{width:var(--badge);height:var(--badge);border-radius:var(--jl-radius-pill);background:var(--jl-surface-3);color:var(--jl-muted);transition:background var(--jl-fast) var(--jl-ease), color var(--jl-fast) var(--jl-ease);justify-content:center;align-items:center;margin-bottom:6px}:host([dragging]) .zone-icon{background:var(--jl-surface);color:var(--jl-accent)}.text{font-size:var(--jl-font-md);font-weight:600;line-height:1.4}:host([size=sm]) .text{font-size:var(--jl-font-sm)}.hint{color:var(--jl-muted);font-size:var(--jl-font-xs);line-height:1.4}.hint:empty{display:none}.browse{height:var(--jl-control-sm);border:1px solid var(--jl-line-strong);border-radius:var(--jl-radius-sm);background:var(--jl-surface);font-size:var(--jl-font-xs);cursor:pointer;transition:background var(--jl-fast) var(--jl-ease);align-items:center;margin-top:8px;padding:0 12px;font-weight:600;display:inline-flex}.browse:hover{background:var(--jl-surface-3)}.browse:disabled{cursor:not-allowed;opacity:.5}.refused,.files{margin:8px 0 0;padding:0;list-style:none}.refused{color:var(--jl-danger);font-size:var(--jl-font-sm);gap:4px;line-height:1.45;display:grid}.refusal{align-items:flex-start;gap:6px;display:flex}.refusal jl-icon{margin-top:3px}.refused-name{overflow-wrap:anywhere;font-weight:600}.files{border:1px solid var(--jl-line);border-radius:var(--jl-radius)}.file{align-items:center;gap:10px;min-height:40px;padding:6px 8px 6px 12px;display:flex}.file+.file{border-top:1px solid var(--jl-line)}.file-icon{color:var(--jl-faint)}.file-name{min-width:0;font-size:var(--jl-font-sm);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.file-size{color:var(--jl-muted);font-family:var(--jl-font-mono);font-size:var(--jl-font-xs);white-space:nowrap}.file-remove{border-radius:var(--jl-radius-xs);width:26px;height:26px;color:var(--jl-faint);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.file-remove:hover{background:var(--jl-surface-3);color:var(--jl-text)}.hint:first-letter{text-transform:uppercase}";
3
3
  export { jl_file_drop_default as default };
@@ -145,8 +145,7 @@ var JlFileDrop = class extends JlFormControl {
145
145
  }),
146
146
  /* @__PURE__ */ jsx("p", {
147
147
  class: "hint",
148
- id: this._ids.hint,
149
- hidden: true
148
+ id: this._ids.hint
150
149
  }),
151
150
  /* @__PURE__ */ jsx("button", {
152
151
  class: "browse",
@@ -349,7 +348,6 @@ var JlFileDrop = class extends JlFormControl {
349
348
  const maxSize = this.maxSize.get();
350
349
  const hint = [types, maxSize === NO_LIMIT ? "" : jlText("fileUpTo", { size: formatFileSize(maxSize, pageLocale()) })].filter((part) => part !== "").join(" · ");
351
350
  this._refs.hint.textContent = hint;
352
- this._refs.hint.hidden = hint === "";
353
351
  }
354
352
  /** Each file is its own entry under the field's name, as from a native file input. */
355
353
  renderFormValue() {
@@ -1,3 +1,3 @@
1
1
  // src/molecules/jl-input-list.css?inline
2
- var jl_input_list_default = ":host{display:block}.list,.rows{gap:var(--jl-space-2);display:grid}.row{align-items:start;gap:var(--jl-space-1);display:flex}.row>:first-child{flex:1;min-width:0}[hidden]{display:none}";
2
+ var jl_input_list_default = ":host{display:block}.list,.rows{gap:var(--jl-space-2);display:grid}.row{align-items:start;gap:var(--jl-space-1);display:flex}.row>:first-child{flex:1;min-width:0}.row:only-child>.remove,:host([disabled]) .remove,:host([disabled]) .add,[hidden]{display:none}";
3
3
  export { jl_input_list_default as default };
@@ -60,6 +60,7 @@ export declare class JlInputList extends JlElement {
60
60
  set(setter: string | ((prevState: string) => string)): void;
61
61
  }>>;
62
62
  private readonly _state;
63
+ private readonly _drawn;
63
64
  private readonly _refs;
64
65
  templateHtml(): Node;
65
66
  templateCss(): string;
@@ -67,11 +68,21 @@ export declare class JlInputList extends JlElement {
67
68
  /** Values set from outside start the rows again; those the rows themselves gave change nothing. */
68
69
  private follow;
69
70
  protected drawTexts(): void;
71
+ /**
72
+ * Draws the rows as the inputs say: in place, or built again for another kind of control. Every input's callback
73
+ * runs as the list appears: a build in each made about ten per list.
74
+ */
75
+ private drawRows;
76
+ /** Builds every row again, from the values in `_state`. */
70
77
  private renderRows;
78
+ /** The add button: its text, and hidden at `max`; the CSS hides it in a disabled list. */
71
79
  private renderAdd;
72
80
  private renderDisabled;
73
81
  private row;
74
- /** The control of a row: a select among the options, a text area, or an input of the type; `onInput` hears it. */
82
+ /** Gives a row the list's label, placeholder, type, options and state; the CSS shows or hides its remove button. */
83
+ private drawRow;
84
+ private rowKind;
85
+ /** A row's control, of the list's kind, holding `value`; `onInput` hears it. drawRow gives it the rest. */
75
86
  private control;
76
87
  private change;
77
88
  private addRow;