@rhi-zone/rainbow-ui 0.2.0-alpha.4 → 0.2.0-alpha.6

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.
@@ -40,50 +40,50 @@ const u = (t, ...s) => e("html")(t, ...s), m = (t, ...s) => e("head")(t, ...s),
40
40
  }, v = (t, s) => {
41
41
  const n = document.createElement("title");
42
42
  return c(n, t), n.textContent = s, { _tag: "title", node: n };
43
- }, _ = (t, ...s) => e("div")(t, ...s), y = (t, ...s) => e("section")(t, ...s), x = (t, ...s) => e("article")(t, ...s), E = (t, ...s) => e("aside")(t, ...s), k = (t, ...s) => e("header")(t, ...s), S = (t, ...s) => e("footer")(t, ...s), C = (t, ...s) => e("main")(t, ...s), N = (t, ...s) => e("nav")(t, ...s), j = (t, ...s) => e("h1")(t, ...s), w = (t, ...s) => e("h2")(t, ...s), G = (t, ...s) => e("h3")(t, ...s), O = (t, ...s) => e("h4")(t, ...s), q = (t, ...s) => e("h5")(t, ...s), T = (t, ...s) => e("h6")(t, ...s), P = (t, ...s) => e("p")(t, ...s), A = (t, ...s) => e("a")(t, ...s), V = (t, ...s) => e("span")(t, ...s), z = (t, ...s) => e("em")(t, ...s), I = (t, ...s) => e("strong")(t, ...s), M = (t, ...s) => e("code")(t, ...s), B = (t, ...s) => e("pre")(t, ...s), D = (t, ...s) => e("blockquote")(t, ...s), F = (t, ...s) => e("i")(t, ...s), H = (t, ...s) => e("b")(t, ...s), J = (t, ...s) => e("small")(t, ...s), K = (t, ...s) => e("abbr")(t, ...s), L = () => ({ _tag: "br", node: document.createElement("br") }), Q = (t = {}) => l("hr")(t), R = (t) => l("img")(t), U = (t, ...s) => e("ul")(t, ...s), W = (t, ...s) => e("ol")(t, ...s), X = (t, ...s) => e("li")(t, ...s), Y = (t, ...s) => e("dl")(t, ...s), Z = (t, ...s) => e("dt")(t, ...s), $ = (t, ...s) => e("dd")(t, ...s), tt = (t, ...s) => e("table")(t, ...s), st = (t, ...s) => e("thead")(t, ...s), et = (t, ...s) => e("tbody")(t, ...s), nt = (t, ...s) => e("tfoot")(t, ...s), at = (t, ...s) => e("tr")(t, ...s), ot = (t, ...s) => e("th")(t, ...s), ct = (t, ...s) => e("td")(t, ...s), rt = (t, ...s) => e("form")(t, ...s), lt = (t) => l("input")(t), it = (t, ...s) => e("label")(t, ...s), dt = (t, ...s) => e("fieldset")(t, ...s), ut = (t, ...s) => e("select")(t, ...s), mt = (t, s) => {
43
+ }, _ = (t, ...s) => e("div")(t, ...s), y = (t, ...s) => e("section")(t, ...s), x = (t, ...s) => e("article")(t, ...s), E = (t, ...s) => e("aside")(t, ...s), k = (t, ...s) => e("header")(t, ...s), S = (t, ...s) => e("footer")(t, ...s), C = (t, ...s) => e("main")(t, ...s), N = (t, ...s) => e("nav")(t, ...s), j = (t, ...s) => e("h1")(t, ...s), w = (t, ...s) => e("h2")(t, ...s), G = (t, ...s) => e("h3")(t, ...s), O = (t, ...s) => e("h4")(t, ...s), q = (t, ...s) => e("h5")(t, ...s), T = (t, ...s) => e("h6")(t, ...s), P = (t, ...s) => e("p")(t, ...s), A = (t, ...s) => e("a")(t, ...s), V = (t, ...s) => e("span")(t, ...s), z = (t, ...s) => e("em")(t, ...s), I = (t, ...s) => e("strong")(t, ...s), M = (t, ...s) => e("code")(t, ...s), B = (t, ...s) => e("pre")(t, ...s), D = (t, ...s) => e("blockquote")(t, ...s), F = (t, ...s) => e("i")(t, ...s), H = (t, ...s) => e("b")(t, ...s), J = (t, ...s) => e("small")(t, ...s), K = (t, ...s) => e("abbr")(t, ...s), L = () => ({ _tag: "br", node: document.createElement("br") }), Q = (t = {}) => l("hr")(t), R = (t) => l("img")(t), U = (t, ...s) => e("ul")(t, ...s), W = (t, ...s) => e("ol")(t, ...s), X = (t, ...s) => e("li")(t, ...s), Y = (t, ...s) => e("dl")(t, ...s), Z = (t, ...s) => e("dt")(t, ...s), $ = (t, ...s) => e("dd")(t, ...s), tt = (t, ...s) => e("table")(t, ...s), st = (t, ...s) => e("thead")(t, ...s), et = (t, ...s) => e("tbody")(t, ...s), nt = (t, ...s) => e("tfoot")(t, ...s), at = (t, ...s) => e("tr")(t, ...s), ot = (t, ...s) => e("th")(t, ...s), ct = (t, ...s) => e("td")(t, ...s), rt = (t, ...s) => e("form")(t, ...s), lt = (t) => l("input")(t), it = (t, ...s) => e("label")(t, ...s), dt = (t, ...s) => e("fieldset")(t, ...s), ut = (t, ...s) => e("legend")(t, ...s), mt = (t, ...s) => e("select")(t, ...s), pt = (t, s) => {
44
44
  const n = document.createElement("option");
45
45
  return c(n, t), s !== void 0 && (n.textContent = s), { _tag: "option", node: n };
46
- }, pt = (t, s) => {
46
+ }, gt = (t, s) => {
47
47
  const n = document.createElement("textarea");
48
48
  return c(n, t), s !== void 0 && (n.textContent = s), { _tag: "textarea", node: n };
49
- }, gt = (t, ...s) => e("button")(t, ...s), ft = (t) => l("iframe")(t), ht = (t, ...s) => e("video")(t, ...s), bt = (t, ...s) => e("audio")(t, ...s), vt = (t) => l("source")(t), _t = (t) => l("canvas")(t), yt = (t, ...s) => {
49
+ }, ft = (t, ...s) => e("button")(t, ...s), ht = (t) => l("iframe")(t), bt = (t, ...s) => e("video")(t, ...s), vt = (t, ...s) => e("audio")(t, ...s), _t = (t) => l("source")(t), yt = (t) => l("canvas")(t), xt = (t, ...s) => {
50
50
  const n = document.createElementNS(i, "svg");
51
51
  return c(n, t), d(n, s), { _tag: "svg", node: n };
52
- }, xt = (t) => r("circle")(t), Et = (t) => r("ellipse")(t), kt = (t) => r("rect")(t), St = (t) => r("line")(t), Ct = (t) => r("polyline")(t), Nt = (t) => r("polygon")(t), jt = (t) => r("path")(t), wt = (t, ...s) => o("text")(t, ...s), Gt = (t, ...s) => o("tspan")(t, ...s), Ot = (t, ...s) => o("g")(t, ...s), qt = (t, ...s) => o("defs")(t, ...s), Tt = (t, ...s) => o("symbol")(t, ...s), Pt = (t) => r("use")(t), At = (t, ...s) => o("clipPath")(t, ...s), Vt = (t, ...s) => o("mask")(t, ...s), zt = (t, ...s) => o("linearGradient")(t, ...s), It = (t, ...s) => o("radialGradient")(t, ...s), Mt = (t) => r("stop")(t), Bt = (t, ...s) => o("pattern")(t, ...s), Dt = (t) => r("image")(t), Ft = (t, ...s) => o("foreignObject")(t, ...s);
53
- function Ht(t) {
52
+ }, Et = (t) => r("circle")(t), kt = (t) => r("ellipse")(t), St = (t) => r("rect")(t), Ct = (t) => r("line")(t), Nt = (t) => r("polyline")(t), jt = (t) => r("polygon")(t), wt = (t) => r("path")(t), Gt = (t, ...s) => o("text")(t, ...s), Ot = (t, ...s) => o("tspan")(t, ...s), qt = (t, ...s) => o("g")(t, ...s), Tt = (t, ...s) => o("defs")(t, ...s), Pt = (t, ...s) => o("symbol")(t, ...s), At = (t) => r("use")(t), Vt = (t, ...s) => o("clipPath")(t, ...s), zt = (t, ...s) => o("mask")(t, ...s), It = (t, ...s) => o("linearGradient")(t, ...s), Mt = (t, ...s) => o("radialGradient")(t, ...s), Bt = (t) => r("stop")(t), Dt = (t, ...s) => o("pattern")(t, ...s), Ft = (t) => r("image")(t), Ht = (t, ...s) => o("foreignObject")(t, ...s);
53
+ function Jt(t) {
54
54
  return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
55
55
  }
56
- function Jt(t) {
56
+ function Kt(t) {
57
57
  return document.createTextNode(t);
58
58
  }
59
- const Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
59
+ const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
60
60
  __proto__: null,
61
61
  a: A,
62
62
  abbr: K,
63
63
  article: x,
64
64
  aside: E,
65
- audio: bt,
65
+ audio: vt,
66
66
  b: H,
67
67
  blockquote: D,
68
68
  body: p,
69
69
  br: L,
70
- button: gt,
71
- canvas: _t,
72
- circle: xt,
73
- clipPath: At,
70
+ button: ft,
71
+ canvas: yt,
72
+ circle: Et,
73
+ clipPath: Vt,
74
74
  code: M,
75
75
  dd: $,
76
- defs: qt,
76
+ defs: Tt,
77
77
  div: _,
78
78
  dl: Y,
79
79
  dt: Z,
80
- ellipse: Et,
80
+ ellipse: kt,
81
81
  em: z,
82
82
  fieldset: dt,
83
83
  footer: S,
84
- foreignObject: Ft,
84
+ foreignObject: Ht,
85
85
  form: rt,
86
- g: Ot,
86
+ g: qt,
87
87
  h1: j,
88
88
  h2: w,
89
89
  h3: G,
@@ -95,64 +95,65 @@ const Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
95
95
  hr: Q,
96
96
  htmlEl: u,
97
97
  i: F,
98
- iframe: ft,
98
+ iframe: ht,
99
99
  img: R,
100
100
  input: lt,
101
101
  label: it,
102
+ legend: ut,
102
103
  li: X,
103
- line: St,
104
- linearGradient: zt,
104
+ line: Ct,
105
+ linearGradient: It,
105
106
  link: f,
106
107
  main: C,
107
- mask: Vt,
108
+ mask: zt,
108
109
  meta: g,
109
110
  nav: N,
110
111
  ol: W,
111
- option: mt,
112
+ option: pt,
112
113
  p: P,
113
- path: jt,
114
- pattern: Bt,
115
- polygon: Nt,
116
- polyline: Ct,
114
+ path: wt,
115
+ pattern: Dt,
116
+ polygon: jt,
117
+ polyline: Nt,
117
118
  pre: B,
118
- radialGradient: It,
119
- rect: kt,
119
+ radialGradient: Mt,
120
+ rect: St,
120
121
  script: h,
121
122
  section: y,
122
- select: ut,
123
+ select: mt,
123
124
  small: J,
124
- source: vt,
125
+ source: _t,
125
126
  span: V,
126
- stop: Mt,
127
+ stop: Bt,
127
128
  strong: I,
128
129
  style: b,
129
- svg: yt,
130
- svgImage: Dt,
131
- svgText: wt,
132
- symbol: Tt,
130
+ svg: xt,
131
+ svgImage: Ft,
132
+ svgText: Gt,
133
+ symbol: Pt,
133
134
  table: tt,
134
135
  tbody: et,
135
136
  td: ct,
136
- text: Ht,
137
- textNode: Jt,
138
- textarea: pt,
137
+ text: Jt,
138
+ textNode: Kt,
139
+ textarea: gt,
139
140
  tfoot: nt,
140
141
  th: ot,
141
142
  thead: st,
142
143
  title_: v,
143
144
  tr: at,
144
- tspan: Gt,
145
+ tspan: Ot,
145
146
  ul: U,
146
- use: Pt,
147
- video: ht
147
+ use: At,
148
+ video: bt
148
149
  }, Symbol.toStringTag, { value: "Module" }));
149
150
  export {
150
- W as $,
151
+ N as $,
151
152
  dt as A,
152
153
  S as B,
153
- Ft as C,
154
+ Ht as C,
154
155
  rt as D,
155
- Ot as E,
156
+ qt as E,
156
157
  j as F,
157
158
  w as G,
158
159
  G as H,
@@ -164,75 +165,76 @@ export {
164
165
  Q as N,
165
166
  u as O,
166
167
  F as P,
167
- ft as Q,
168
+ ht as Q,
168
169
  R,
169
170
  it as S,
170
- X as T,
171
- St as U,
172
- zt as V,
173
- f as W,
174
- C as X,
175
- Vt as Y,
176
- g as Z,
177
- N as _,
171
+ ut as T,
172
+ X as U,
173
+ Ct as V,
174
+ It as W,
175
+ f as X,
176
+ C as Y,
177
+ zt as Z,
178
+ g as _,
178
179
  A as a,
179
- P as a0,
180
- jt as a1,
181
- Bt as a2,
182
- Nt as a3,
183
- Ct as a4,
184
- B as a5,
185
- It as a6,
186
- kt as a7,
187
- h as a8,
188
- y as a9,
189
- J as aa,
190
- vt as ab,
191
- V as ac,
192
- Mt as ad,
193
- I as ae,
194
- b as af,
195
- yt as ag,
196
- Dt as ah,
197
- wt as ai,
198
- Tt as aj,
199
- tt as ak,
200
- et as al,
201
- ct as am,
202
- Ht as an,
180
+ W as a0,
181
+ P as a1,
182
+ wt as a2,
183
+ Dt as a3,
184
+ jt as a4,
185
+ Nt as a5,
186
+ B as a6,
187
+ Mt as a7,
188
+ St as a8,
189
+ h as a9,
190
+ y as aa,
191
+ J as ab,
192
+ _t as ac,
193
+ V as ad,
194
+ Bt as ae,
195
+ I as af,
196
+ b as ag,
197
+ xt as ah,
198
+ Ft as ai,
199
+ Gt as aj,
200
+ Pt as ak,
201
+ tt as al,
202
+ et as am,
203
+ ct as an,
203
204
  Jt as ao,
204
- nt as ap,
205
- ot as aq,
206
- st as ar,
207
- v as as,
208
- at,
209
- Gt as au,
210
- U as av,
211
- Pt as aw,
212
- ht as ax,
205
+ Kt as ap,
206
+ nt as aq,
207
+ ot as ar,
208
+ st as as,
209
+ v as at,
210
+ at as au,
211
+ Ot as av,
212
+ U as aw,
213
+ At as ax,
214
+ bt as ay,
213
215
  K as b,
214
216
  x as c,
215
217
  E as d,
216
- bt as e,
218
+ vt as e,
217
219
  H as f,
218
220
  D as g,
219
- Kt as h,
221
+ Lt as h,
220
222
  lt as i,
221
223
  p as j,
222
224
  L as k,
223
- gt as l,
224
- _t as m,
225
- xt as n,
226
- mt as o,
227
- At as p,
225
+ ft as l,
226
+ yt as m,
227
+ Et as n,
228
+ pt as o,
229
+ Vt as p,
228
230
  M as q,
229
231
  $ as r,
230
- ut as s,
231
- pt as t,
232
- qt as u,
232
+ mt as s,
233
+ gt as t,
234
+ Tt as u,
233
235
  _ as v,
234
236
  Y as w,
235
237
  Z as x,
236
- Et as y,
238
+ kt as y,
237
239
  z
238
240
  };
package/dist/html.d.ts CHANGED
@@ -66,6 +66,7 @@ export type FormEl = El<"form", HTMLFormElement>;
66
66
  export type InputEl = El<"input", HTMLInputElement>;
67
67
  export type LabelEl = El<"label", HTMLLabelElement>;
68
68
  export type FieldsetEl = El<"fieldset", HTMLFieldSetElement>;
69
+ export type LegendEl = El<"legend", HTMLLegendElement>;
69
70
  export type SelectEl = El<"select", HTMLSelectElement>;
70
71
  export type OptionEl = El<"option", HTMLOptionElement>;
71
72
  export type TextareaEl = El<"textarea", HTMLTextAreaElement>;
@@ -113,10 +114,53 @@ export type RowContent = TrEl;
113
114
  export type CellContent = TdEl | ThEl;
114
115
  export type ListItemContent = LiEl;
115
116
  export type SelectContent = OptionEl;
117
+ export type LegendContent = LegendEl;
116
118
  export type DefinitionListContent = DtEl | DdEl;
117
119
  export type SvgContent = CircleEl | EllipseEl | RectEl | LineEl | PolylineEl | PolygonEl | PathEl | TextEl | TspanEl | GEl | DefsEl | SymbolEl | UseEl | ClipPathEl | MaskEl | LinearGradientEl | RadialGradientEl | StopEl | PatternEl | SvgImageEl | ForeignObjectEl;
118
- export type AnyEl = FlowContent | HeadContent | RowContent | CellContent | ListItemContent | SelectContent | SourceEl | TableSectionContent | DefinitionListContent | HtmlEl | HeadEl | BodyEl | SvgContent;
119
- export type GlobalAttrs = {
120
+ export type AnyEl = FlowContent | HeadContent | RowContent | CellContent | ListItemContent | SelectContent | LegendContent | SourceEl | TableSectionContent | DefinitionListContent | HtmlEl | HeadEl | BodyEl | SvgContent;
121
+ export type AriaAttrs = {
122
+ role?: 'button' | 'dialog' | 'navigation' | 'main' | 'list' | 'listitem' | 'alert' | 'status' | 'region' | 'banner' | 'contentinfo' | 'search' | 'form' | 'img' | 'presentation' | 'none' | 'grid' | 'row' | 'cell' | 'columnheader' | 'rowheader' | 'table' | 'tab' | 'tablist' | 'tabpanel' | 'checkbox' | 'radio' | 'combobox' | 'listbox' | 'option' | 'menuitem' | 'menu' | 'menubar' | 'separator' | 'slider' | 'spinbutton' | 'textbox' | 'progressbar' | 'tooltip' | 'tree' | 'treeitem' | 'treegrid' | string;
123
+ 'aria-label'?: string;
124
+ 'aria-labelledby'?: string;
125
+ 'aria-describedby'?: string;
126
+ 'aria-hidden'?: 'true' | 'false';
127
+ 'aria-live'?: 'off' | 'polite' | 'assertive';
128
+ 'aria-busy'?: 'true' | 'false';
129
+ 'aria-expanded'?: 'true' | 'false';
130
+ 'aria-selected'?: 'true' | 'false';
131
+ 'aria-checked'?: 'true' | 'false' | 'mixed';
132
+ 'aria-pressed'?: 'true' | 'false' | 'mixed';
133
+ 'aria-disabled'?: 'true' | 'false';
134
+ 'aria-required'?: 'true' | 'false';
135
+ 'aria-invalid'?: 'true' | 'false' | 'grammar' | 'spelling';
136
+ 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
137
+ 'aria-haspopup'?: 'true' | 'false' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
138
+ 'aria-controls'?: string;
139
+ 'aria-owns'?: string;
140
+ 'aria-activedescendant'?: string;
141
+ 'aria-level'?: number;
142
+ 'aria-posinset'?: number;
143
+ 'aria-setsize'?: number;
144
+ 'aria-colcount'?: number;
145
+ 'aria-colindex'?: number;
146
+ 'aria-rowcount'?: number;
147
+ 'aria-rowindex'?: number;
148
+ 'aria-valuemax'?: number;
149
+ 'aria-valuemin'?: number;
150
+ 'aria-valuenow'?: number;
151
+ 'aria-valuetext'?: string;
152
+ 'aria-sort'?: 'ascending' | 'descending' | 'none' | 'other';
153
+ 'aria-orientation'?: 'horizontal' | 'vertical';
154
+ 'aria-autocomplete'?: 'inline' | 'list' | 'both' | 'none';
155
+ 'aria-multiselectable'?: 'true' | 'false';
156
+ 'aria-readonly'?: 'true' | 'false';
157
+ 'aria-modal'?: 'true' | 'false';
158
+ 'aria-placeholder'?: string;
159
+ 'aria-errormessage'?: string;
160
+ 'aria-roledescription'?: string;
161
+ 'aria-keyshortcuts'?: string;
162
+ };
163
+ export type GlobalAttrs = AriaAttrs & {
120
164
  id?: string;
121
165
  class?: string;
122
166
  style?: string;
@@ -458,6 +502,7 @@ export declare const form: (attrs: FormAttrs, ...children: (FlowContent | string
458
502
  export declare const input: (attrs: InputAttrs) => InputEl;
459
503
  export declare const label: (attrs: LabelAttrs, ...children: (PhrasingContent | string)[]) => LabelEl;
460
504
  export declare const fieldset: (attrs: GlobalAttrs, ...children: (FlowContent | string)[]) => FieldsetEl;
505
+ export declare const legend: (attrs: GlobalAttrs, ...children: (PhrasingContent | string)[]) => LegendEl;
461
506
  export declare const select: (attrs: SelectAttrs, ...children: SelectContent[]) => SelectEl;
462
507
  export declare const option: (attrs: OptionAttrs, content?: string) => OptionEl;
463
508
  export declare const textarea: (attrs: TextareaAttrs, content?: string) => TextareaEl;
package/dist/html.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, b as t, c as l, d as o, e as i, f as r, g as d, j as n, k as p, l as c, m as h, n as b, p as m, q as g, r as f, u, v, w as x, x as y, y as k, z as j, A as q, B as G, C as w, D as E, E as I, F as N, G as O, H as P, I as T, J as _, K as z, L as A, M as B, N as C, O as D, P as F, Q as H, R as J, i as K, S as L, T as M, U as Q, V as R, W as S, X as U, Y as V, Z as W, _ as X, $ as Y, o as Z, a0 as $, a1 as aa, a2 as sa, a3 as ea, a4 as ta, a5 as la, a6 as oa, a7 as ia, a8 as ra, a9 as da, s as na, aa as pa, ab as ca, ac as ha, ad as ba, ae as ma, af as ga, ag as fa, ah as ua, ai as va, aj as xa, ak as ya, al as ka, am as ja, an as qa, ao as Ga, t as wa, ap as Ea, aq as Ia, ar as Na, as as Oa, at as Pa, au as Ta, av as _a, aw as za, ax as Aa } from "./html-C8SnQjvU.js";
1
+ import { a as e, b as t, c as l, d as o, e as i, f as r, g as d, j as n, k as p, l as c, m as h, n as b, p as m, q as g, r as f, u, v, w as y, x, y as k, z as j, A as q, B as G, C as w, D as E, E as I, F as N, G as O, H as P, I as T, J as _, K as z, L as A, M as B, N as C, O as D, P as F, Q as H, R as J, i as K, S as L, T as M, U as Q, V as R, W as S, X as U, Y as V, Z as W, _ as X, $ as Y, a0 as Z, o as $, a1 as aa, a2 as sa, a3 as ea, a4 as ta, a5 as la, a6 as oa, a7 as ia, a8 as ra, a9 as da, aa as na, s as pa, ab as ca, ac as ha, ad as ba, ae as ma, af as ga, ag as fa, ah as ua, ai as va, aj as ya, ak as xa, al as ka, am as ja, an as qa, ao as Ga, ap as wa, t as Ea, aq as Ia, ar as Na, as as Oa, at as Pa, au as Ta, av as _a, aw as za, ax as Aa, ay as Ba } from "./html-Bl4HvyCp.js";
2
2
  export {
3
3
  e as a,
4
4
  t as abbr,
@@ -17,8 +17,8 @@ export {
17
17
  f as dd,
18
18
  u as defs,
19
19
  v as div,
20
- x as dl,
21
- y as dt,
20
+ y as dl,
21
+ x as dt,
22
22
  k as ellipse,
23
23
  j as em,
24
24
  q as fieldset,
@@ -41,50 +41,51 @@ export {
41
41
  J as img,
42
42
  K as input,
43
43
  L as label,
44
- M as li,
45
- Q as line,
46
- R as linearGradient,
47
- S as link,
48
- U as main,
49
- V as mask,
50
- W as meta,
51
- X as nav,
52
- Y as ol,
53
- Z as option,
54
- $ as p,
55
- aa as path,
56
- sa as pattern,
57
- ea as polygon,
58
- ta as polyline,
59
- la as pre,
60
- oa as radialGradient,
61
- ia as rect,
62
- ra as script,
63
- da as section,
64
- na as select,
65
- pa as small,
66
- ca as source,
67
- ha as span,
68
- ba as stop,
69
- ma as strong,
70
- ga as style,
71
- fa as svg,
72
- ua as svgImage,
73
- va as svgText,
44
+ M as legend,
45
+ Q as li,
46
+ R as line,
47
+ S as linearGradient,
48
+ U as link,
49
+ V as main,
50
+ W as mask,
51
+ X as meta,
52
+ Y as nav,
53
+ Z as ol,
54
+ $ as option,
55
+ aa as p,
56
+ sa as path,
57
+ ea as pattern,
58
+ ta as polygon,
59
+ la as polyline,
60
+ oa as pre,
61
+ ia as radialGradient,
62
+ ra as rect,
63
+ da as script,
64
+ na as section,
65
+ pa as select,
66
+ ca as small,
67
+ ha as source,
68
+ ba as span,
69
+ ma as stop,
70
+ ga as strong,
71
+ fa as style,
72
+ ua as svg,
73
+ va as svgImage,
74
+ ya as svgText,
74
75
  xa as symbol,
75
- ya as table,
76
- ka as tbody,
77
- ja as td,
78
- qa as text,
79
- Ga as textNode,
80
- wa as textarea,
81
- Ea as tfoot,
82
- Ia as th,
83
- Na as thead,
84
- Oa as title_,
85
- Pa as tr,
86
- Ta as tspan,
87
- _a as ul,
88
- za as use,
89
- Aa as video
76
+ ka as table,
77
+ ja as tbody,
78
+ qa as td,
79
+ Ga as text,
80
+ wa as textNode,
81
+ Ea as textarea,
82
+ Ia as tfoot,
83
+ Na as th,
84
+ Oa as thead,
85
+ Pa as title_,
86
+ Ta as tr,
87
+ _a as tspan,
88
+ za as ul,
89
+ Aa as use,
90
+ Ba as video
90
91
  };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { h as u } from "./html-C8SnQjvU.js";
2
- import { above as l, beside as p, bindAttr as f, bindCheckbox as x, bindClass as S, bindInput as w, bindSelect as W, bindShow as v, bindText as y, checkboxWidget as k, concat as C, dynamic as E, each as F, eachKeyed as A, focus as I, foldWidget as K, h as L, inputWidget as N, map as B, match as D, mount as J, narrow as T, numberInputWidget as V, on as j, prop as q, register as z, selectWidget as G, show as H, slot as M, stack as O, subscribe as P, subscribeNow as Q, template as R, textareaWidget as U, watchAll as X, withScope as Y } from "./widget.js";
3
- import { createForm as _, createFormState as $, isDirty as ee, isFormValid as te, shouldShowError as ne } from "./form-state.js";
1
+ import { h as l } from "./html-Bl4HvyCp.js";
2
+ import { above as g, beside as p, bindAttr as f, bindCheckbox as x, bindClass as S, bindInput as w, bindSelect as W, bindShow as v, bindText as y, checkboxWidget as k, concat as C, dynamic as E, each as F, eachKeyed as A, focus as I, foldWidget as K, h as L, inputWidget as N, lift as B, map as D, match as J, mount as T, narrow as V, numberInputWidget as j, on as q, prop as z, register as G, selectWidget as H, show as M, slot as O, stack as P, subscribe as Q, subscribeNow as R, template as U, textareaWidget as X, watchAll as Y, withScope as Z } from "./widget.js";
3
+ import { createForm as $, createFormState as ee, isDirty as te, isFormValid as ne, shouldShowError as oe } from "./form-state.js";
4
4
  import { signal as a } from "@rhi-zone/rainbow";
5
- import { attrBoolean as ie, attrJson as re, attrNumber as se, attrString as ae, attrsFrom as ce, defineElement as de } from "./elements.js";
5
+ import { attrBoolean as re, attrJson as se, attrNumber as ae, attrString as ce, attrsFrom as de, defineElement as be } from "./elements.js";
6
6
  function d(e, n, t, r, o) {
7
7
  const i = e(
8
8
  n,
@@ -23,12 +23,12 @@ function b(e) {
23
23
  return e.addEventListener("change", t), [n, () => e.removeEventListener("change", t)];
24
24
  }
25
25
  export {
26
- l as above,
27
- ie as attrBoolean,
28
- re as attrJson,
29
- se as attrNumber,
30
- ae as attrString,
31
- ce as attrsFrom,
26
+ g as above,
27
+ re as attrBoolean,
28
+ se as attrJson,
29
+ ae as attrNumber,
30
+ ce as attrString,
31
+ de as attrsFrom,
32
32
  p as beside,
33
33
  f as bindAttr,
34
34
  x as bindCheckbox,
@@ -40,37 +40,38 @@ export {
40
40
  b as bindingsStoreSignal,
41
41
  k as checkboxWidget,
42
42
  C as concat,
43
- _ as createForm,
44
- $ as createFormState,
45
- de as defineElement,
43
+ $ as createForm,
44
+ ee as createFormState,
45
+ be as defineElement,
46
46
  E as dynamic,
47
47
  F as each,
48
48
  A as eachKeyed,
49
49
  I as focus,
50
50
  K as foldWidget,
51
51
  L as h,
52
- u as html,
52
+ l as html,
53
53
  N as inputWidget,
54
- ee as isDirty,
55
- te as isFormValid,
54
+ te as isDirty,
55
+ ne as isFormValid,
56
56
  d as keybindsContext,
57
- B as map,
58
- D as match,
59
- J as mount,
60
- T as narrow,
61
- V as numberInputWidget,
62
- j as on,
63
- q as prop,
64
- z as register,
65
- G as selectWidget,
66
- ne as shouldShowError,
67
- H as show,
68
- M as slot,
69
- O as stack,
70
- P as subscribe,
71
- Q as subscribeNow,
72
- R as template,
73
- U as textareaWidget,
74
- X as watchAll,
75
- Y as withScope
57
+ B as lift,
58
+ D as map,
59
+ J as match,
60
+ T as mount,
61
+ V as narrow,
62
+ j as numberInputWidget,
63
+ q as on,
64
+ z as prop,
65
+ G as register,
66
+ H as selectWidget,
67
+ oe as shouldShowError,
68
+ M as show,
69
+ O as slot,
70
+ P as stack,
71
+ Q as subscribe,
72
+ R as subscribeNow,
73
+ U as template,
74
+ X as textareaWidget,
75
+ Y as watchAll,
76
+ Z as withScope
76
77
  };
package/dist/widget.d.ts CHANGED
@@ -458,19 +458,35 @@ export declare function selectWidget(options: {
458
458
  label: string;
459
459
  }[], attrs?: SelectAttrs): Widget<string, SelectEl>;
460
460
  /**
461
- * A reactive child: either a static element, a string, or a widget that
462
- * accepts the same signal type `T` and returns any element.
461
+ * A reactive child: either a plain string or a widget that accepts the same
462
+ * signal type `T` and returns any element.
463
+ *
464
+ * `AnyEl` is intentionally excluded. Passing a pre-built element directly would
465
+ * require `cloneNode(true)` on each widget invocation, silently dropping event
466
+ * listeners. Use `lift(el)` to wrap a freshly-built element instead.
467
+ */
468
+ export type RChild<T> = string | Widget<T, AnyEl>;
469
+ /**
470
+ * Lift a static element into the widget context. Use this to pass a
471
+ * pre-built `AnyEl` as a child to an `h.*` reactive factory:
472
+ *
473
+ * h.div({}, lift(iconEl), reactiveChild)
474
+ *
475
+ * The element is inserted as-is — no cloning — so event listeners are
476
+ * preserved. Only use `lift` when the element is freshly built at widget
477
+ * call time (i.e. inside the widget function body). Do NOT lift a module-
478
+ * level static element — it can only have one parent at a time.
463
479
  */
464
- export type RChild<T> = AnyEl | string | Widget<T, AnyEl>;
480
+ export declare function lift<T, E extends AnyEl>(el: E): Widget<T, E>;
465
481
  /**
466
482
  * Reactive hyperscript factories — the same element tags as `html.ts` but
467
483
  * returning `Widget<T, El>` instead of `El`. Import as:
468
484
  *
469
485
  * import { h } from '@rhi-zone/rainbow-ui/widget'
470
486
  *
471
- * Widget children receive the same signal as their parent. Static children
472
- * (`AnyEl`) are deep-cloned on each widget invocation so that the same static
473
- * node can be safely reused across multiple widget instances.
487
+ * Widget children receive the same signal as their parent. String children
488
+ * create fresh text nodes. To pass a pre-built element, wrap it with `lift(el)`
489
+ * so it is inserted directly without cloning preserving event listeners.
474
490
  */
475
491
  export declare const h: {
476
492
  readonly div: <T>(attrs: GlobalAttrs, ...children: RChild<T>[]) => (s: Signal<T>) => El<"div", HTMLDivElement>;
package/dist/widget.js CHANGED
@@ -1,350 +1,353 @@
1
1
  import { index as E, stateful as L, field as W, lens as B, tagged as $, signal as j } from "@rhi-zone/rainbow";
2
- import { i as _, s as F, o as I, t as O } from "./html-C8SnQjvU.js";
3
- let y = null;
2
+ import { i as _, s as F, o as I, t as O } from "./html-Bl4HvyCp.js";
3
+ let k = null;
4
4
  function l(e) {
5
- y == null || y.push(e);
5
+ k == null || k.push(e);
6
6
  }
7
- function g(e) {
8
- const n = y, o = [];
9
- y = o;
10
- const t = e();
11
- return y = n, [t, () => {
7
+ function m(e) {
8
+ const t = k, o = [];
9
+ k = o;
10
+ const n = e();
11
+ return k = t, [n, () => {
12
12
  for (const c of o) c();
13
13
  }];
14
14
  }
15
15
  function V(e) {
16
- return g(e);
16
+ return m(e);
17
17
  }
18
- function w(e, n) {
19
- l(e.subscribe(n));
18
+ function w(e, t) {
19
+ l(e.subscribe(t));
20
20
  }
21
21
  function H(e) {
22
22
  l(e);
23
23
  }
24
- function R(e, n, o) {
25
- const [t, c] = g(() => e(n));
26
- return o.appendChild(t.node), () => {
27
- t.node.remove(), c();
24
+ function R(e, t, o) {
25
+ const [n, c] = m(() => e(t));
26
+ return o.appendChild(n.node), () => {
27
+ n.node.remove(), c();
28
28
  };
29
29
  }
30
- function P(e, n) {
31
- return (o) => e(o.focus(n));
30
+ function P(e, t) {
31
+ return (o) => e(o.focus(t));
32
32
  }
33
- function U(e, n) {
34
- return P(e, W(n));
33
+ function U(e, t) {
34
+ return P(e, W(t));
35
35
  }
36
- function z(e, n) {
36
+ function z(e, t) {
37
37
  return (o) => {
38
- const t = document.createElement("div");
39
- t.dataset.narrow = "";
38
+ const n = document.createElement("div");
39
+ n.dataset.narrow = "";
40
40
  let c = null, r = null;
41
- const d = o, u = () => {
42
- r = d.narrow(n);
43
- const [a, f] = g(() => e(r));
44
- c = f, t.appendChild(a.node);
41
+ const u = o, d = () => {
42
+ r = u.narrow(t);
43
+ const [a, f] = m(() => e(r));
44
+ c = f, n.appendChild(a.node);
45
45
  };
46
46
  return w(o, (a) => {
47
- const f = n.view(a);
48
- f !== void 0 && c === null ? u() : f === void 0 && c !== null && (c(), c = null, r = null, t.replaceChildren());
49
- }), n.view(o.get()) !== void 0 && u(), l(() => c == null ? void 0 : c()), { _tag: "div", node: t };
47
+ const f = t.view(a);
48
+ f !== void 0 && c === null ? d() : f === void 0 && c !== null && (c(), c = null, r = null, n.replaceChildren());
49
+ }), t.view(o.get()) !== void 0 && d(), l(() => c == null ? void 0 : c()), { _tag: "div", node: n };
50
50
  };
51
51
  }
52
52
  function D(e) {
53
- return (n) => {
54
- const o = n, t = document.createElement("div");
55
- t.dataset.each = "";
53
+ return (t) => {
54
+ const o = t, n = document.createElement("div");
55
+ n.dataset.each = "";
56
56
  let c = [];
57
- const r = (u) => {
57
+ const r = (d) => {
58
58
  for (const s of c) s();
59
- c = [], t.replaceChildren();
60
- for (let s = 0; s < u.length; s++) {
59
+ c = [], n.replaceChildren();
60
+ for (let s = 0; s < d.length; s++) {
61
61
  const a = s, f = B(
62
62
  (p) => p[a],
63
63
  (p, h) => {
64
- const b = [...h];
65
- return b[a] = p, b;
64
+ const g = [...h];
65
+ return g[a] = p, g;
66
66
  }
67
- ), m = o.focus(f), [v, C] = g(() => e(m));
68
- c.push(C), t.appendChild(v.node);
67
+ ), b = o.focus(f), [v, C] = m(() => e(b));
68
+ c.push(C), n.appendChild(v.node);
69
69
  }
70
70
  };
71
- r(n.get());
72
- const d = n.map((u) => u.length);
73
- return w(d, () => r(n.get())), l(() => {
74
- for (const u of c) u();
75
- }), { _tag: "div", node: t };
71
+ r(t.get());
72
+ const u = t.map((d) => d.length);
73
+ return w(u, () => r(t.get())), l(() => {
74
+ for (const d of c) d();
75
+ }), { _tag: "div", node: n };
76
76
  };
77
77
  }
78
- function G(e, n) {
78
+ function G(e, t) {
79
79
  return (o) => {
80
- const t = o, c = document.createElement("div");
80
+ const n = o, c = document.createElement("div");
81
81
  c.dataset.beside = "";
82
- const r = t.focus(E(0)), d = t.focus(E(1)), [u, s] = g(() => e(r)), [a, f] = g(() => n(d));
83
- return c.appendChild(u.node), c.appendChild(a.node), l(s), l(f), { _tag: "div", node: c };
82
+ const r = n.focus(E(0)), u = n.focus(E(1)), [d, s] = m(() => e(r)), [a, f] = m(() => t(u));
83
+ return c.appendChild(d.node), c.appendChild(a.node), l(s), l(f), { _tag: "div", node: c };
84
84
  };
85
85
  }
86
- function J(e, n) {
86
+ function J(e, t) {
87
87
  return (o) => {
88
- const t = o, c = document.createElement("div");
88
+ const n = o, c = document.createElement("div");
89
89
  c.dataset.above = "";
90
- const r = t.focus(E(0)), d = t.focus(E(1)), [u, s] = g(() => e(r)), [a, f] = g(() => n(d));
91
- return c.appendChild(u.node), c.appendChild(a.node), l(s), l(f), { _tag: "div", node: c };
90
+ const r = n.focus(E(0)), u = n.focus(E(1)), [d, s] = m(() => e(r)), [a, f] = m(() => t(u));
91
+ return c.appendChild(d.node), c.appendChild(a.node), l(s), l(f), { _tag: "div", node: c };
92
92
  };
93
93
  }
94
- function Q(e, n) {
94
+ function Q(e, t) {
95
95
  return (o) => {
96
- const t = L(e, o);
97
- return n(t);
96
+ const n = L(e, o);
97
+ return t(n);
98
98
  };
99
99
  }
100
- function X(e, n) {
100
+ function X(e, t) {
101
101
  return (o) => {
102
- const t = o.narrow(n);
103
- return e(t);
102
+ const n = o.narrow(t);
103
+ return e(n);
104
104
  };
105
105
  }
106
- function Y(e, n) {
106
+ function Y(e, t) {
107
107
  return (o) => {
108
- const t = document.createElement("div");
109
- t.dataset.show = "";
110
- const [c, r] = g(() => e(o));
111
- t.appendChild(c.node), l(r);
112
- const d = (u) => {
113
- t.style.display = n(u) ? "" : "none";
108
+ const n = document.createElement("div");
109
+ n.dataset.show = "";
110
+ const [c, r] = m(() => e(o));
111
+ n.appendChild(c.node), l(r);
112
+ const u = (d) => {
113
+ n.style.display = t(d) ? "" : "none";
114
114
  };
115
- return d(o.get()), w(o, d), { _tag: "div", node: t };
115
+ return u(o.get()), w(o, u), { _tag: "div", node: n };
116
116
  };
117
117
  }
118
- function Z(e, n) {
118
+ function Z(e, t) {
119
119
  return (o) => {
120
- const t = document.createElement("div");
121
- t.dataset.concat = "";
122
- const [c, r] = g(() => e(o)), [d, u] = g(() => n(o));
123
- return t.appendChild(c.node), t.appendChild(d.node), l(r), l(u), { _tag: "div", node: t };
120
+ const n = document.createElement("div");
121
+ n.dataset.concat = "";
122
+ const [c, r] = m(() => e(o)), [u, d] = m(() => t(o));
123
+ return n.appendChild(c.node), n.appendChild(u.node), l(r), l(d), { _tag: "div", node: n };
124
124
  };
125
125
  }
126
126
  function ee(...e) {
127
- return (n) => {
127
+ return (t) => {
128
128
  const o = document.createElement("div");
129
129
  o.dataset.stack = "";
130
- for (const t of e) {
131
- const [c, r] = g(() => t(n));
130
+ for (const n of e) {
131
+ const [c, r] = m(() => n(t));
132
132
  o.appendChild(c.node), l(r);
133
133
  }
134
134
  return { _tag: "div", node: o };
135
135
  };
136
136
  }
137
- function te(e, n, o) {
138
- const t = document.createElement("template");
139
- return t.innerHTML = e, (c) => {
137
+ function te(e, t, o) {
138
+ const n = document.createElement("template");
139
+ return n.innerHTML = e, (c) => {
140
140
  const r = document.createElement("div");
141
- r.dataset.templ = "", r.appendChild(t.content.cloneNode(!0));
142
- const d = {};
143
- for (const u of Object.keys(n)) {
144
- const s = n[u], a = r.querySelector(`${s}[data-ref="${u}"]`);
141
+ r.dataset.templ = "", r.appendChild(n.content.cloneNode(!0));
142
+ const u = {};
143
+ for (const d of Object.keys(t)) {
144
+ const s = t[d], a = r.querySelector(`${s}[data-ref="${d}"]`);
145
145
  if (a === null)
146
146
  throw new Error(
147
- `templ: ref "${u}" not found — expected <${s} data-ref="${u}"> in template`
147
+ `templ: ref "${d}" not found — expected <${s} data-ref="${d}"> in template`
148
148
  );
149
- d[u] = { _tag: s, node: a };
149
+ u[d] = { _tag: s, node: a };
150
150
  }
151
- return o(c, d), { _tag: "div", node: r };
151
+ return o(c, u), { _tag: "div", node: r };
152
152
  };
153
153
  }
154
- function ne(e, n, o, t) {
155
- const c = (t == null ? void 0 : t.container) ?? "div", r = document.createElement(c);
154
+ function ne(e, t, o, n) {
155
+ const c = (n == null ? void 0 : n.container) ?? "div", r = document.createElement(c);
156
156
  r.dataset.eachKeyed = "";
157
- const d = /* @__PURE__ */ new Map(), u = (a, f) => {
158
- const m = j(f);
157
+ const u = /* @__PURE__ */ new Map(), d = (a, f) => {
158
+ const b = j(f);
159
159
  let v = !1, C = () => {
160
160
  };
161
- "set" in e && (C = m.subscribe((b) => {
161
+ "set" in e && (C = b.subscribe((g) => {
162
162
  if (v) return;
163
- const x = e.get(), N = x.findIndex((k) => n(k) === a);
164
- if (N !== -1 && !Object.is(x[N], b)) {
165
- const k = [...x];
166
- k[N] = b, e.set(k);
163
+ const x = e.get(), N = x.findIndex((y) => t(y) === a);
164
+ if (N !== -1 && !Object.is(x[N], g)) {
165
+ const y = [...x];
166
+ y[N] = g, e.set(y);
167
167
  }
168
168
  }));
169
- const [p, h] = g(() => o(m));
169
+ const [p, h] = m(() => o(b));
170
170
  return {
171
- itemSignal: m,
171
+ itemSignal: b,
172
172
  childNode: p.node,
173
173
  cleanup: () => {
174
174
  h(), C();
175
175
  },
176
- setFromParent: (b) => {
177
- v = !0, m.set(b), v = !1;
176
+ setFromParent: (g) => {
177
+ v = !0, b.set(g), v = !1;
178
178
  }
179
179
  };
180
180
  }, s = (a) => {
181
181
  var C;
182
- const f = a.map(n), m = new Set(f);
183
- for (const [p, h] of d)
184
- m.has(p) || (h.cleanup(), (C = h.childNode.parentNode) == null || C.removeChild(h.childNode), d.delete(p));
182
+ const f = a.map(t), b = new Set(f);
183
+ for (const [p, h] of u)
184
+ b.has(p) || (h.cleanup(), (C = h.childNode.parentNode) == null || C.removeChild(h.childNode), u.delete(p));
185
185
  for (let p = 0; p < a.length; p++) {
186
- const h = f[p], b = a[p];
187
- d.has(h) ? d.get(h).setFromParent(b) : d.set(h, u(h, b));
186
+ const h = f[p], g = a[p];
187
+ u.has(h) ? u.get(h).setFromParent(g) : u.set(h, d(h, g));
188
188
  }
189
189
  let v = null;
190
190
  for (let p = a.length - 1; p >= 0; p--) {
191
- const h = d.get(f[p]);
191
+ const h = u.get(f[p]);
192
192
  (h.childNode.parentNode !== r || h.childNode.nextSibling !== v) && r.insertBefore(h.childNode, v), v = h.childNode;
193
193
  }
194
194
  };
195
195
  return s(e.get()), w(e, s), l(() => {
196
- for (const a of d.values()) a.cleanup();
196
+ for (const a of u.values()) a.cleanup();
197
197
  }), { _tag: c, node: r };
198
198
  }
199
- function A(e, n, o) {
200
- const t = o;
201
- e.addEventListener(n, t), l(() => e.removeEventListener(n, t));
199
+ function A(e, t, o) {
200
+ const n = o;
201
+ e.addEventListener(t, n), l(() => e.removeEventListener(t, n));
202
202
  }
203
- function S(e, n) {
204
- e.value = n.get();
205
- const o = () => n.set(e.value);
203
+ function S(e, t) {
204
+ e.value = t.get();
205
+ const o = () => t.set(e.value);
206
206
  e.addEventListener("input", o);
207
- const t = n.subscribe((r) => {
207
+ const n = t.subscribe((r) => {
208
208
  e.value !== r && (e.value = r);
209
209
  }), c = () => {
210
- e.removeEventListener("input", o), t();
210
+ e.removeEventListener("input", o), n();
211
211
  };
212
212
  return l(c), c;
213
213
  }
214
- function T(e, n) {
215
- A(e, "change", () => n.set(e.value)), w(n, (o) => {
214
+ function T(e, t) {
215
+ A(e, "change", () => t.set(e.value)), w(t, (o) => {
216
216
  e.value !== o && (e.value = o);
217
217
  });
218
218
  }
219
- function q(e, n) {
220
- A(e, "change", () => n.set(e.checked)), w(n, (o) => {
219
+ function q(e, t) {
220
+ A(e, "change", () => t.set(e.checked)), w(t, (o) => {
221
221
  e.checked !== o && (e.checked = o);
222
222
  });
223
223
  }
224
- function oe(e, n) {
225
- n(e.get()), l(e.subscribe(n));
224
+ function oe(e, t) {
225
+ t(e.get()), l(e.subscribe(t));
226
226
  }
227
- function ce(e, n) {
228
- e.textContent = n.get(), l(n.subscribe((o) => {
227
+ function ce(e, t) {
228
+ e.textContent = t.get(), l(t.subscribe((o) => {
229
229
  e.textContent = o;
230
230
  }));
231
231
  }
232
- function re(e, n, o) {
233
- e.setAttribute(n, o.get()), l(o.subscribe((t) => {
234
- e.setAttribute(n, t);
232
+ function re(e, t, o) {
233
+ e.setAttribute(t, o.get()), l(o.subscribe((n) => {
234
+ e.setAttribute(t, n);
235
235
  }));
236
236
  }
237
- function de(e, n, o) {
238
- e.classList.toggle(n, o.get()), l(o.subscribe((t) => {
239
- e.classList.toggle(n, t);
237
+ function ue(e, t, o) {
238
+ e.classList.toggle(t, o.get()), l(o.subscribe((n) => {
239
+ e.classList.toggle(t, n);
240
240
  }));
241
241
  }
242
- function ue(e, n) {
243
- n();
244
- const o = e.map((t) => t.subscribe(n));
242
+ function de(e, t) {
243
+ t();
244
+ const o = e.map((n) => n.subscribe(t));
245
245
  return () => {
246
- for (const t of o) t();
246
+ for (const n of o) n();
247
247
  };
248
248
  }
249
- function ie(e, n) {
250
- return e.style.display = n.get() ? "" : "none", n.subscribe((o) => {
249
+ function ie(e, t) {
250
+ return e.style.display = t.get() ? "" : "none", t.subscribe((o) => {
251
251
  e.style.display = o ? "" : "none";
252
252
  });
253
253
  }
254
- function ae(e, n) {
254
+ function ae(e, t) {
255
255
  return (o) => {
256
- const t = document.createElement("div");
257
- t.dataset.match = "";
256
+ const n = document.createElement("div");
257
+ n.dataset.match = "";
258
258
  let c = null, r = null;
259
- const d = (u) => {
260
- const s = u[e];
259
+ const u = (d) => {
260
+ const s = d[e];
261
261
  if (s === r) return;
262
- c == null || c(), c = null, t.replaceChildren(), r = s;
263
- const a = n[s];
262
+ c == null || c(), c = null, n.replaceChildren(), r = s;
263
+ const a = t[s];
264
264
  if (a == null) return;
265
265
  const f = o.narrow($(e, s));
266
- let m;
267
- [m, c] = g(
266
+ let b;
267
+ [b, c] = m(
268
268
  () => a(f)
269
- ), t.appendChild(m.node);
269
+ ), n.appendChild(b.node);
270
270
  };
271
- return w(o, d), d(o.get()), l(() => c == null ? void 0 : c()), { _tag: "div", node: t };
271
+ return w(o, u), u(o.get()), l(() => c == null ? void 0 : c()), { _tag: "div", node: n };
272
272
  };
273
273
  }
274
- function se(e, n) {
274
+ function se(e, t) {
275
275
  const o = document.createElement("div");
276
276
  o.dataset.foldWidget = "";
277
- let t = null;
277
+ let n = null;
278
278
  const c = (r) => {
279
- t !== null && (t(), t = null), o.replaceChildren();
280
- let d = null;
279
+ n !== null && (n(), n = null), o.replaceChildren();
280
+ let u = null;
281
281
  switch (r.status) {
282
282
  case "notAsked":
283
- d = n.notAsked ?? null;
283
+ u = t.notAsked ?? null;
284
284
  break;
285
285
  case "loading":
286
- d = n.loading ?? null;
286
+ u = t.loading ?? null;
287
287
  break;
288
288
  case "failure":
289
- d = n.failure ? () => n.failure(r.error) : null;
289
+ u = t.failure ? () => t.failure(r.error) : null;
290
290
  break;
291
291
  case "success":
292
- d = n.success ? () => n.success(r.value) : null;
292
+ u = t.success ? () => t.success(r.value) : null;
293
293
  break;
294
294
  }
295
- if (d !== null) {
296
- let u;
297
- [u, t] = g(d), o.appendChild(u.node);
295
+ if (u !== null) {
296
+ let d;
297
+ [d, n] = m(u), o.appendChild(d.node);
298
298
  }
299
299
  };
300
- return c(e.get()), l(e.subscribe(c)), l(() => t == null ? void 0 : t()), { _tag: "div", node: o };
300
+ return c(e.get()), l(e.subscribe(c)), l(() => n == null ? void 0 : n()), { _tag: "div", node: o };
301
301
  }
302
302
  function le(e) {
303
- return (n) => {
304
- const o = n, t = _(e ?? {});
305
- return t.node.value = o.get(), S(t.node, o), t;
303
+ return (t) => {
304
+ const o = t, n = _(e ?? {});
305
+ return n.node.value = o.get(), S(n.node, o), n;
306
306
  };
307
307
  }
308
308
  function fe(e) {
309
- return (n) => {
310
- const o = n, t = O(e ?? {});
311
- return t.node.value = o.get(), S(t.node, o), t;
309
+ return (t) => {
310
+ const o = t, n = O(e ?? {});
311
+ return n.node.value = o.get(), S(n.node, o), n;
312
312
  };
313
313
  }
314
314
  function pe(e) {
315
- return (n) => {
316
- const o = n, t = _({ ...e, type: "checkbox" });
317
- return t.node.checked = o.get(), q(t.node, o), t;
315
+ return (t) => {
316
+ const o = t, n = _({ ...e, type: "checkbox" });
317
+ return n.node.checked = o.get(), q(n.node, o), n;
318
318
  };
319
319
  }
320
320
  function he(e) {
321
- return (n) => {
322
- const o = n, t = _({ ...e, type: "number" });
323
- return t.node.value = String(o.get()), A(t.node, "input", () => {
324
- const c = t.node.valueAsNumber;
321
+ return (t) => {
322
+ const o = t, n = _({ ...e, type: "number" });
323
+ return n.node.value = String(o.get()), A(n.node, "input", () => {
324
+ const c = n.node.valueAsNumber;
325
325
  isNaN(c) || o.set(c);
326
- }), w(n, (c) => {
327
- t.node.valueAsNumber !== c && (t.node.value = String(c));
328
- }), t;
326
+ }), w(t, (c) => {
327
+ n.node.valueAsNumber !== c && (n.node.value = String(c));
328
+ }), n;
329
329
  };
330
330
  }
331
- function ge(e, n) {
331
+ function me(e, t) {
332
332
  return (o) => {
333
- const t = o, c = F(n ?? {}, ...e.map((r) => I({ value: r.value }, r.label)));
334
- return c.node.value = t.get(), T(c.node, t), c;
333
+ const n = o, c = F(t ?? {}, ...e.map((r) => I({ value: r.value }, r.label)));
334
+ return c.node.value = n.get(), T(c.node, n), c;
335
335
  };
336
336
  }
337
+ function be(e) {
338
+ return (t) => e;
339
+ }
337
340
  function i(e) {
338
- return (n, ...o) => (t) => {
341
+ return (t, ...o) => (n) => {
339
342
  const c = document.createElement(e);
340
- for (const [r, d] of Object.entries(n))
341
- d == null || d === !1 || c.setAttribute(r, d === !0 ? "" : String(d));
343
+ for (const [r, u] of Object.entries(t))
344
+ u == null || u === !1 || c.setAttribute(r, u === !0 ? "" : String(u));
342
345
  for (const r of o)
343
- typeof r == "function" ? c.appendChild(r(t).node) : typeof r == "string" ? c.appendChild(document.createTextNode(r)) : c.appendChild(r.node.cloneNode(!0));
346
+ typeof r == "function" ? c.appendChild(r(n).node) : c.appendChild(document.createTextNode(r));
344
347
  return { _tag: e, node: c };
345
348
  };
346
349
  }
347
- const me = {
350
+ const ge = {
348
351
  // Sectioning / flow
349
352
  div: i("div"),
350
353
  section: i("section"),
@@ -378,13 +381,13 @@ const me = {
378
381
  form: i("form"),
379
382
  fieldset: i("fieldset")
380
383
  };
381
- function be(e, n, o, t) {
382
- const c = o(n.get());
384
+ function ve(e, t, o, n) {
385
+ const c = o(t.get());
383
386
  if (c === void 0) {
384
387
  e.remove();
385
388
  return;
386
389
  }
387
- const r = c(t ?? n);
390
+ const r = c(n ?? t);
388
391
  e.replaceWith(r.node);
389
392
  }
390
393
  export {
@@ -392,7 +395,7 @@ export {
392
395
  G as beside,
393
396
  re as bindAttr,
394
397
  q as bindCheckbox,
395
- de as bindClass,
398
+ ue as bindClass,
396
399
  S as bindInput,
397
400
  T as bindSelect,
398
401
  ie as bindShow,
@@ -404,8 +407,9 @@ export {
404
407
  ne as eachKeyed,
405
408
  P as focus,
406
409
  se as foldWidget,
407
- me as h,
410
+ ge as h,
408
411
  le as inputWidget,
412
+ be as lift,
409
413
  X as map,
410
414
  ae as match,
411
415
  R as mount,
@@ -414,14 +418,14 @@ export {
414
418
  A as on,
415
419
  U as prop,
416
420
  H as register,
417
- ge as selectWidget,
421
+ me as selectWidget,
418
422
  Y as show,
419
- be as slot,
423
+ ve as slot,
420
424
  ee as stack,
421
425
  w as subscribe,
422
426
  oe as subscribeNow,
423
427
  te as template,
424
428
  fe as textareaWidget,
425
- ue as watchAll,
429
+ de as watchAll,
426
430
  V as withScope
427
431
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhi-zone/rainbow-ui",
3
- "version": "0.2.0-alpha.4",
3
+ "version": "0.2.0-alpha.6",
4
4
  "description": "Type-safe DOM factories and algebraic widget combinators for rainbow",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",