@threadlabs/looma 0.25.3 → 0.25.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ui-badge/ui-badge.html +59 -3
- package/components/ui-button/ui-button.html +1 -1
- package/components/ui-card/ui-card.html +27 -2
- package/components/ui-cluster/ui-cluster.html +30 -0
- package/components/ui-editor-surface/ui-editor-surface.html +23 -0
- package/components/ui-scroll-area/ui-scroll-area.html +5 -0
- package/components/ui-stack/ui-stack.html +17 -1
- package/components/ui-text/ui-text.html +5 -0
- package/components/ui-textarea/ui-textarea.html +7 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-badge.css +61 -4
- package/styles/ui-button.css +1 -1
- package/styles/ui-card.css +24 -0
- package/styles/ui-cluster.css +25 -0
- package/styles/ui-editor-surface.css +19 -0
- package/styles/ui-scroll-area.css +4 -0
- package/styles/ui-stack.css +13 -0
- package/styles/ui-text.css +4 -0
- package/styles/ui-textarea.css +4 -0
- package/vanilla/UiBadge.js +16 -3
- package/vanilla/UiCard.d.ts +1 -1
- package/vanilla/UiCard.js +1 -1
- package/vanilla/UiCluster.d.ts +3 -0
- package/vanilla/UiCluster.js +9 -3
- package/vanilla/UiEditorSurface.d.ts +14 -0
- package/vanilla/UiEditorSurface.js +27 -0
- package/vanilla/UiScrollArea.d.ts +1 -0
- package/vanilla/UiScrollArea.js +1 -1
- package/vanilla/UiStack.d.ts +2 -0
- package/vanilla/UiStack.js +8 -9
- package/vanilla/UiText.d.ts +1 -0
- package/vanilla/UiText.js +1 -1
- package/vanilla/UiTextarea.d.ts +1 -0
- package/vanilla/UiTextarea.js +4 -1
- package/vanilla/index.js +1 -0
- package/vue/UiBadge.d.ts +4 -2
- package/vue/UiBadge.vue +57 -3
- package/vue/UiButton.vue +1 -1
- package/vue/UiCard.d.ts +3 -3
- package/vue/UiCard.vue +34 -5
- package/vue/UiCluster.d.ts +27 -0
- package/vue/UiCluster.vue +95 -1
- package/vue/UiEditorSlashMenuItem.d.ts +1 -1
- package/vue/UiEditorSurface.d.ts +26 -0
- package/vue/UiEditorSurface.js +2 -0
- package/vue/UiEditorSurface.vue +129 -0
- package/vue/UiScrollArea.d.ts +9 -0
- package/vue/UiScrollArea.vue +28 -2
- package/vue/UiStack.d.ts +18 -0
- package/vue/UiStack.vue +58 -1
- package/vue/UiText.d.ts +9 -0
- package/vue/UiText.vue +33 -0
- package/vue/UiTextarea.d.ts +9 -0
- package/vue/UiTextarea.vue +37 -2
- package/vue/chunks/UiBadge.js +7 -3
- package/vue/chunks/UiButton.js +1 -1
- package/vue/chunks/UiCard.js +10 -3
- package/vue/chunks/UiCluster.js +82 -1
- package/vue/chunks/UiEditorSurface.js +71 -0
- package/vue/chunks/UiScrollArea.js +28 -2
- package/vue/chunks/UiStack.js +46 -1
- package/vue/chunks/UiText.js +43 -1
- package/vue/chunks/UiTextarea.js +28 -2
- package/vue/components.css +321 -190
- package/vue/editor/LoomaEditor.d.ts +12 -0
- package/vue/editor/index.js +7 -2
- package/vue/index.d.ts +1 -0
- package/vue/index.js +2 -1
package/package.json
CHANGED
package/styles/ui-badge.css
CHANGED
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
display: inline-flex;
|
|
74
74
|
align-items: center;
|
|
75
75
|
justify-content: center;
|
|
76
|
+
gap: var(--ui-space-1);
|
|
76
77
|
box-sizing: border-box;
|
|
77
78
|
min-inline-size: 0;
|
|
78
79
|
max-inline-size: 100%;
|
|
@@ -97,8 +98,30 @@
|
|
|
97
98
|
text-overflow: ellipsis;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
.label:empty {
|
|
102
|
+
display: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Icon content has its own flex item so label ellipsis never clips its strokes. */
|
|
106
|
+
.icon {
|
|
107
|
+
display: inline-flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
flex: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.icon:empty {
|
|
114
|
+
display: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Ordinary icon-plus-text children keep inline ellipsis, with explicit glyph spacing. */
|
|
118
|
+
|
|
119
|
+
.label:has(svg) {
|
|
120
|
+
text-box-trim: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Text-only badges retain their trimmed inline baseline. Icon content needs a flex row;
|
|
124
|
+
trimming its label separately keeps the glyph centered without changing adjacent lines. */
|
|
102
125
|
@supports (text-box-trim: trim-both) {
|
|
103
126
|
:scope {
|
|
104
127
|
display: inline-block;
|
|
@@ -108,6 +131,15 @@
|
|
|
108
131
|
text-box-trim: trim-both;
|
|
109
132
|
text-box-edge: text;
|
|
110
133
|
}
|
|
134
|
+
:scope:has(.icon:not(:empty)),
|
|
135
|
+
:scope:has(.label svg) {
|
|
136
|
+
display: inline-flex;
|
|
137
|
+
text-box-trim: none;
|
|
138
|
+
}
|
|
139
|
+
:scope:has(.icon:not(:empty)) .label {
|
|
140
|
+
text-box-trim: trim-both;
|
|
141
|
+
text-box-edge: text;
|
|
142
|
+
}
|
|
111
143
|
}
|
|
112
144
|
|
|
113
145
|
:scope[data-ui-badge-state~="size=xs"] {
|
|
@@ -246,6 +278,10 @@
|
|
|
246
278
|
justify-content: center;
|
|
247
279
|
}
|
|
248
280
|
|
|
281
|
+
:scope[data-ui-badge-state~="shape=square"] .label:empty {
|
|
282
|
+
display: none;
|
|
283
|
+
}
|
|
284
|
+
|
|
249
285
|
/* A dot uses the badge's tone recipe; only its silhouette and visible label change. */
|
|
250
286
|
:scope[data-ui-badge-state~="shape=dot"] {
|
|
251
287
|
position: relative;
|
|
@@ -332,8 +368,25 @@
|
|
|
332
368
|
/* A constrained badge keeps its surface intact and ellipsizes only its label. The full
|
|
333
369
|
text stays in the DOM for accessible names and consumers' selected values. */
|
|
334
370
|
|
|
335
|
-
/*
|
|
336
|
-
|
|
371
|
+
/* Icon content has its own flex item so label ellipsis never clips its strokes. */
|
|
372
|
+
|
|
373
|
+
.icon :where([data-slotted], [data-slotted] *):is(svg) {
|
|
374
|
+
display: block;
|
|
375
|
+
inline-size: 1em;
|
|
376
|
+
block-size: 1em;
|
|
377
|
+
flex: none;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/* Ordinary icon-plus-text children keep inline ellipsis, with explicit glyph spacing. */
|
|
381
|
+
.label :where([data-slotted], [data-slotted] *):is(svg) {
|
|
382
|
+
inline-size: 1em;
|
|
383
|
+
block-size: 1em;
|
|
384
|
+
vertical-align: middle;
|
|
385
|
+
margin-inline-end: var(--ui-space-1);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/* Text-only badges retain their trimmed inline baseline. Icon content needs a flex row;
|
|
389
|
+
trimming its label separately keeps the glyph centered without changing adjacent lines. */
|
|
337
390
|
@supports (text-box-trim: trim-both) {
|
|
338
391
|
}
|
|
339
392
|
|
|
@@ -342,6 +395,10 @@
|
|
|
342
395
|
|
|
343
396
|
/* An icon mark keeps the existing tone recipe and follows the global spacing and radius. */
|
|
344
397
|
|
|
398
|
+
:scope[data-ui-badge-state~="shape=square"] .label :where([data-slotted], [data-slotted] *):is(svg) {
|
|
399
|
+
margin-inline-end: 0;
|
|
400
|
+
}
|
|
401
|
+
|
|
345
402
|
/* A dot uses the badge's tone recipe; only its silhouette and visible label change. */
|
|
346
403
|
|
|
347
404
|
/* The clipped point needs an inset surface over an outer border-colour shape: a native border
|
package/styles/ui-button.css
CHANGED
|
@@ -90,6 +90,7 @@
|
|
|
90
90
|
display: inline-flex;
|
|
91
91
|
align-items: center;
|
|
92
92
|
justify-content: center;
|
|
93
|
+
column-gap: var(--ui-space-2);
|
|
93
94
|
vertical-align: middle;
|
|
94
95
|
color: var(--_tone-text);
|
|
95
96
|
}
|
|
@@ -139,7 +140,6 @@
|
|
|
139
140
|
.spinner-wrap {
|
|
140
141
|
display: inline-flex;
|
|
141
142
|
flex: none;
|
|
142
|
-
margin-inline-end: var(--ui-space-2);
|
|
143
143
|
vertical-align: middle;
|
|
144
144
|
}
|
|
145
145
|
|
package/styles/ui-card.css
CHANGED
|
@@ -38,6 +38,30 @@
|
|
|
38
38
|
box-shadow: var(--ui-shadow-lg);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
:scope[data-ui-card-state~="tone=accent"] {
|
|
42
|
+
border-color: color-mix(in srgb, var(--ui-accent) 25%, var(--ui-border-default));
|
|
43
|
+
background: color-mix(in srgb, var(--ui-accent) 6%, var(--ui-surface-default));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:scope[data-ui-card-state~="tone=info"] {
|
|
47
|
+
border-color: color-mix(in srgb, var(--ui-info) 25%, var(--ui-border-default));
|
|
48
|
+
background: color-mix(in srgb, var(--ui-info) 6%, var(--ui-surface-default));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:scope[data-ui-card-state~="tone=success"] {
|
|
52
|
+
border-color: color-mix(in srgb, var(--ui-success) 25%, var(--ui-border-default));
|
|
53
|
+
background: color-mix(in srgb, var(--ui-success) 6%, var(--ui-surface-default));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:scope[data-ui-card-state~="tone=warning"] {
|
|
57
|
+
border-color: color-mix(in srgb, var(--ui-warning) 25%, var(--ui-border-default));
|
|
58
|
+
background: color-mix(in srgb, var(--ui-warning) 6%, var(--ui-surface-default));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:scope[data-ui-card-state~="variant=subtle"]:is([data-ui-card-state~="tone=accent"], [data-ui-card-state~="tone=info"], [data-ui-card-state~="tone=success"], [data-ui-card-state~="tone=warning"]) {
|
|
62
|
+
border-color: transparent;
|
|
63
|
+
}
|
|
64
|
+
|
|
41
65
|
:scope[data-ui-card-state~="tone=danger"] {
|
|
42
66
|
border-color: color-mix(in srgb, var(--ui-danger) 45%, var(--ui-border-default));
|
|
43
67
|
border-inline-start: var(--ui-accent-line-width) solid var(--ui-danger);
|
package/styles/ui-cluster.css
CHANGED
|
@@ -17,6 +17,31 @@
|
|
|
17
17
|
margin: 0;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
:scope[data-ui-cluster-state~="fixed"] {
|
|
21
|
+
flex: none;
|
|
22
|
+
}
|
|
23
|
+
:scope[data-ui-cluster-state~="padding=s"] {
|
|
24
|
+
padding: var(--ui-space-2);
|
|
25
|
+
}
|
|
26
|
+
:scope[data-ui-cluster-state~="padding=m"] {
|
|
27
|
+
padding: var(--ui-space-3);
|
|
28
|
+
}
|
|
29
|
+
:scope[data-ui-cluster-state~="padding=l"] {
|
|
30
|
+
padding: var(--ui-space-4);
|
|
31
|
+
}
|
|
32
|
+
:scope[data-ui-cluster-state~="paddingEnd=s"] {
|
|
33
|
+
padding-inline-end: var(--ui-space-2);
|
|
34
|
+
}
|
|
35
|
+
:scope[data-ui-cluster-state~="paddingEnd=m"] {
|
|
36
|
+
padding-inline-end: var(--ui-space-3);
|
|
37
|
+
}
|
|
38
|
+
:scope[data-ui-cluster-state~="paddingEnd=l"] {
|
|
39
|
+
padding-inline-end: var(--ui-space-4);
|
|
40
|
+
}
|
|
41
|
+
:scope[data-ui-cluster-state~="paddingEnd=xl"] {
|
|
42
|
+
padding-inline-end: calc(var(--ui-space-4) * 4);
|
|
43
|
+
}
|
|
44
|
+
|
|
20
45
|
:scope[data-ui-cluster-state~="gap=xs"] {
|
|
21
46
|
--_layout-gap: var(--ui-space-2);
|
|
22
47
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* Generated by HTML Next 1.0.0-alpha.29. Do not edit. */
|
|
2
|
+
@scope ([data-component~="ui-editor-surface"]) to ([data-component], [data-slotted]) {
|
|
3
|
+
:scope {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
min-inline-size: 0;
|
|
7
|
+
max-inline-size: 100%;
|
|
8
|
+
}
|
|
9
|
+
/* The document renderer consumes these inherited surface settings. They do not style controls. */
|
|
10
|
+
:scope[data-ui-editor-surface-state~="density=compact"] {
|
|
11
|
+
--_ui-editor-content-min-height: 0px;
|
|
12
|
+
--_ui-editor-content-padding-block: 0px;
|
|
13
|
+
--_ui-editor-content-padding-inline: 0px;
|
|
14
|
+
--_ui-editor-mobile-bottom-space: 0px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
@scope ([data-component~="ui-editor-surface"]) to ([data-component]) {
|
|
18
|
+
/* The document renderer consumes these inherited surface settings. They do not style controls. */
|
|
19
|
+
}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
/* The controller sets each fade length from overflow and scroll position. The mask blends
|
|
4
4
|
into whatever is behind the area without needing to know its colour. Before upgrade, its
|
|
5
5
|
zero-length defaults leave the authored scroll area fully visible. */
|
|
6
|
+
:scope[data-ui-scroll-area-state~="fill"] {
|
|
7
|
+
flex: 1;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
:scope {
|
|
7
11
|
display: block;
|
|
8
12
|
box-sizing: border-box;
|
package/styles/ui-stack.css
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/* Generated by HTML Next 1.0.0-alpha.29. Do not edit. */
|
|
2
|
+
@property --ui-stack-height {
|
|
3
|
+
syntax: "*";
|
|
4
|
+
inherits: false;
|
|
5
|
+
}
|
|
2
6
|
@property --ui-stack-gap {
|
|
3
7
|
syntax: "*";
|
|
4
8
|
inherits: false;
|
|
@@ -17,6 +21,15 @@
|
|
|
17
21
|
margin: 0;
|
|
18
22
|
}
|
|
19
23
|
|
|
24
|
+
:scope[data-ui-stack-state~="fill"] {
|
|
25
|
+
flex: 1;
|
|
26
|
+
min-block-size: 0;
|
|
27
|
+
}
|
|
28
|
+
:scope[data-ui-stack-state~="height"] {
|
|
29
|
+
block-size: calc(var(--ui-stack-height, 0) * 1px);
|
|
30
|
+
min-block-size: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
:scope[data-ui-stack-state~="gap=none"] {
|
|
21
34
|
--_layout-gap: 0px;
|
|
22
35
|
}
|
package/styles/ui-text.css
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
/* Running text, set on the type scale and in a tone that says what it is, so a view never styles
|
|
4
4
|
text of its own. The root is a paragraph unless as= names a span, div, small, strong, label, or
|
|
5
5
|
heading. */
|
|
6
|
+
:scope[data-ui-text-state~="grow"] {
|
|
7
|
+
flex: 1;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
:scope {
|
|
7
11
|
margin: 0;
|
|
8
12
|
min-inline-size: 0;
|
package/styles/ui-textarea.css
CHANGED
|
@@ -139,6 +139,10 @@
|
|
|
139
139
|
font-size: var(--ui-font-size-md);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
:scope[data-ui-textarea-state~="maxRows"] {
|
|
143
|
+
max-block-size: calc(max(var(--_rows), var(--_max-rows)) * 1lh + var(--_padding-block) + var(--_padding-block) + 2px);
|
|
144
|
+
}
|
|
145
|
+
|
|
142
146
|
@supports (field-sizing: content) {
|
|
143
147
|
:scope[data-ui-textarea-state~="autosize"] {
|
|
144
148
|
field-sizing: content;
|
package/vanilla/UiBadge.js
CHANGED
|
@@ -16,17 +16,30 @@ export function createUiBadge(options = {}) {
|
|
|
16
16
|
}
|
|
17
17
|
element.setAttribute("data-component", "ui-badge");
|
|
18
18
|
const element0 = document.createElement("span");
|
|
19
|
-
element0.setAttribute("class", "
|
|
19
|
+
element0.setAttribute("class", "icon");
|
|
20
|
+
element0.setAttribute("aria-hidden", "true");
|
|
21
|
+
if (slots["icon"] ?? [].length > 0) {
|
|
22
|
+
for (const child of slots["icon"] ?? []) {
|
|
23
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
24
|
+
if (node.nodeType === 1) node.setAttribute("data-slotted", "");
|
|
25
|
+
projected.push([node, "icon"]);
|
|
26
|
+
element0.append(node);
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
}
|
|
30
|
+
element.append(element0);
|
|
31
|
+
const element1 = document.createElement("span");
|
|
32
|
+
element1.setAttribute("class", "label");
|
|
20
33
|
if (children.length > 0) {
|
|
21
34
|
for (const child of children) {
|
|
22
35
|
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
23
36
|
if (node.nodeType === 1) node.setAttribute("data-slotted", "");
|
|
24
37
|
projected.push([node, ""]);
|
|
25
|
-
|
|
38
|
+
element1.append(node);
|
|
26
39
|
}
|
|
27
40
|
} else {
|
|
28
41
|
}
|
|
29
|
-
element.append(
|
|
42
|
+
element.append(element1);
|
|
30
43
|
manageGeneratedProps(element, [
|
|
31
44
|
{ name: "shape", attribute: "data-shape", value: componentProps["shape"], default: "pill", type: ["pill","tag","dot","square"], required: false },
|
|
32
45
|
{ name: "size", attribute: "data-size", value: componentProps["size"], default: "md", type: ["xs","md"], required: false },
|
package/vanilla/UiCard.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface UiCardProps {
|
|
|
9
9
|
as?: "div" | "section" | "article" | "aside" | null;
|
|
10
10
|
padding?: "xs" | "sm" | "md" | "lg" | null;
|
|
11
11
|
size?: "content" | "sm" | "md" | "lg" | null;
|
|
12
|
-
tone?: "neutral" | "danger" | null;
|
|
12
|
+
tone?: "neutral" | "accent" | "info" | "success" | "warning" | "danger" | null;
|
|
13
13
|
variant?: "outlined" | "subtle" | "elevated" | null;
|
|
14
14
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
15
15
|
children?: readonly (string | Node)[];
|
package/vanilla/UiCard.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { componentRootIndex, manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
3
3
|
import "../styles/ui-card.css";
|
|
4
4
|
|
|
5
|
-
const definition = {...{"contract":{"tag":"ui-card","props":{"as":{"type":{"kind":"terminal","name":"keyword"},"values":["div","section","article","aside"],"required":false,"target":{"attribute":"as"},"default":"div"},"padding":{"type":{"kind":"terminal","name":"keyword"},"values":["xs","sm","md","lg"],"required":false,"target":{"attribute":"padding"},"default":"md"},"size":{"type":{"kind":"terminal","name":"keyword"},"values":["content","sm","md","lg"],"required":false,"target":{"attribute":"size"},"default":"content"},"tone":{"type":{"kind":"terminal","name":"keyword"},"values":["neutral","danger"],"required":false,"target":{"attribute":"tone"},"default":"neutral"},"variant":{"type":{"kind":"terminal","name":"keyword"},"values":["outlined","subtle","elevated"],"required":false,"target":{"attribute":"variant"},"default":"outlined"}}},"template":{"kind":"element","name":"template","attributes":[],"children":[{"kind":"element","name":"section","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'section'","testPlan":{"source":"as = 'section'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"section"}},"dependencies":["as"]}}},{"kind":"element","name":"article","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'article'","testPlan":{"source":"as = 'article'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"article"}},"dependencies":["as"]}}},{"kind":"element","name":"aside","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'aside'","testPlan":{"source":"as = 'aside'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"aside"}},"dependencies":["as"]}}},{"kind":"element","name":"div","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"else"}}],"flow":{"kind":"match"}},"declarations":[],"root":{"kind":"native","element":"div","choices":["section","article","aside","div"]}},source:{file:import.meta.url},css:""};
|
|
5
|
+
const definition = {...{"contract":{"tag":"ui-card","props":{"as":{"type":{"kind":"terminal","name":"keyword"},"values":["div","section","article","aside"],"required":false,"target":{"attribute":"as"},"default":"div"},"padding":{"type":{"kind":"terminal","name":"keyword"},"values":["xs","sm","md","lg"],"required":false,"target":{"attribute":"padding"},"default":"md"},"size":{"type":{"kind":"terminal","name":"keyword"},"values":["content","sm","md","lg"],"required":false,"target":{"attribute":"size"},"default":"content"},"tone":{"type":{"kind":"terminal","name":"keyword"},"values":["neutral","accent","info","success","warning","danger"],"required":false,"target":{"attribute":"tone"},"default":"neutral"},"variant":{"type":{"kind":"terminal","name":"keyword"},"values":["outlined","subtle","elevated"],"required":false,"target":{"attribute":"variant"},"default":"outlined"}}},"template":{"kind":"element","name":"template","attributes":[],"children":[{"kind":"element","name":"section","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'section'","testPlan":{"source":"as = 'section'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"section"}},"dependencies":["as"]}}},{"kind":"element","name":"article","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'article'","testPlan":{"source":"as = 'article'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"article"}},"dependencies":["as"]}}},{"kind":"element","name":"aside","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'aside'","testPlan":{"source":"as = 'aside'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"aside"}},"dependencies":["as"]}}},{"kind":"element","name":"div","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"else"}}],"flow":{"kind":"match"}},"declarations":[],"root":{"kind":"native","element":"div","choices":["section","article","aside","div"]}},source:{file:import.meta.url},css:""};
|
|
6
6
|
|
|
7
7
|
export function createUiCard(options = {}) {
|
|
8
8
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
package/vanilla/UiCluster.d.ts
CHANGED
|
@@ -7,8 +7,11 @@ export interface UiClusterElement extends HTMLDivElement {
|
|
|
7
7
|
}
|
|
8
8
|
export interface UiClusterProps {
|
|
9
9
|
align?: "start" | "center" | "end" | "stretch" | null;
|
|
10
|
+
fixed?: boolean | null;
|
|
10
11
|
gap?: "xs" | "s" | "m" | "l" | "xl" | null;
|
|
11
12
|
justify?: "start" | "center" | "end" | "between" | null;
|
|
13
|
+
padding?: "none" | "s" | "m" | "l" | null;
|
|
14
|
+
paddingEnd?: "none" | "s" | "m" | "l" | "xl" | null;
|
|
12
15
|
wrap?: "wrap" | "nowrap" | null;
|
|
13
16
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
14
17
|
children?: readonly (string | Node)[];
|
package/vanilla/UiCluster.js
CHANGED
|
@@ -6,9 +6,12 @@ export function createUiCluster(options = {}) {
|
|
|
6
6
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
7
7
|
const projected = [];
|
|
8
8
|
const prop0 = componentProps["align"] === undefined ? undefined : componentProps["align"];
|
|
9
|
-
const prop1 = componentProps["
|
|
10
|
-
const prop2 = componentProps["
|
|
11
|
-
const prop3 = componentProps["
|
|
9
|
+
const prop1 = componentProps["fixed"] === undefined ? false : componentProps["fixed"];
|
|
10
|
+
const prop2 = componentProps["gap"] === undefined ? undefined : componentProps["gap"];
|
|
11
|
+
const prop3 = componentProps["justify"] === undefined ? undefined : componentProps["justify"];
|
|
12
|
+
const prop4 = componentProps["padding"] === undefined ? "none" : componentProps["padding"];
|
|
13
|
+
const prop5 = componentProps["paddingEnd"] === undefined ? "none" : componentProps["paddingEnd"];
|
|
14
|
+
const prop6 = componentProps["wrap"] === undefined ? undefined : componentProps["wrap"];
|
|
12
15
|
const element = document.createElement("div");
|
|
13
16
|
for (const [name, value] of Object.entries(attributes)) {
|
|
14
17
|
if (value === null || value === undefined || value === false) continue;
|
|
@@ -26,8 +29,11 @@ export function createUiCluster(options = {}) {
|
|
|
26
29
|
}
|
|
27
30
|
manageGeneratedProps(element, [
|
|
28
31
|
{ name: "align", attribute: "data-align", value: componentProps["align"], type: ["start","center","end","stretch"], required: false },
|
|
32
|
+
{ name: "fixed", attribute: "data-fixed", value: componentProps["fixed"], default: false, type: "boolean", required: false },
|
|
29
33
|
{ name: "gap", attribute: "data-gap", value: componentProps["gap"], type: ["xs","s","m","l","xl"], required: false },
|
|
30
34
|
{ name: "justify", attribute: "data-justify", value: componentProps["justify"], type: ["start","center","end","between"], required: false },
|
|
35
|
+
{ name: "padding", attribute: "data-padding", value: componentProps["padding"], default: "none", type: ["none","s","m","l"], required: false },
|
|
36
|
+
{ name: "paddingEnd", attribute: "data-padding-end", value: componentProps["paddingEnd"], default: "none", type: ["none","s","m","l","xl"], required: false },
|
|
31
37
|
{ name: "wrap", attribute: "data-wrap", value: componentProps["wrap"], type: ["wrap","nowrap"], required: false },
|
|
32
38
|
]);
|
|
33
39
|
return element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.29 for Vanilla DOM. Do not edit.
|
|
2
|
+
export interface UiEditorSurfaceEventMap {
|
|
3
|
+
}
|
|
4
|
+
export interface UiEditorSurfaceElement extends HTMLDivElement {
|
|
5
|
+
addEventListener<K extends keyof UiEditorSurfaceEventMap>(type: K, listener: (this: UiEditorSurfaceElement, event: UiEditorSurfaceEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
6
|
+
removeEventListener<K extends keyof UiEditorSurfaceEventMap>(type: K, listener: (this: UiEditorSurfaceElement, event: UiEditorSurfaceEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
|
+
}
|
|
8
|
+
export interface UiEditorSurfaceProps {
|
|
9
|
+
density?: "comfortable" | "compact" | null;
|
|
10
|
+
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
11
|
+
children?: readonly (string | Node)[];
|
|
12
|
+
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createUiEditorSurface(props?: UiEditorSurfaceProps): UiEditorSurfaceElement;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.29 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { manageGeneratedProp } from "@nextwebwg/html-next/generated-runtime";
|
|
3
|
+
import "../styles/ui-editor-surface.css";
|
|
4
|
+
|
|
5
|
+
export function createUiEditorSurface(options = {}) {
|
|
6
|
+
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
7
|
+
const projected = [];
|
|
8
|
+
const prop0 = componentProps["density"] === undefined ? "comfortable" : componentProps["density"];
|
|
9
|
+
const element = document.createElement("div");
|
|
10
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
11
|
+
if (value === null || value === undefined || value === false) continue;
|
|
12
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
13
|
+
}
|
|
14
|
+
element.setAttribute("data-component", "ui-editor-surface");
|
|
15
|
+
if (children.length > 0) {
|
|
16
|
+
for (const child of children) {
|
|
17
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
18
|
+
if (node.nodeType === 1) node.setAttribute("data-slotted", "");
|
|
19
|
+
projected.push([node, ""]);
|
|
20
|
+
element.append(node);
|
|
21
|
+
}
|
|
22
|
+
} else {
|
|
23
|
+
}
|
|
24
|
+
manageGeneratedProp(element, { name: "density", attribute: "data-density", value: componentProps["density"], default: "comfortable", type: ["comfortable","compact"], required: false });
|
|
25
|
+
return element;
|
|
26
|
+
}
|
|
27
|
+
|
|
@@ -6,6 +6,7 @@ export interface UiScrollAreaElement extends HTMLDivElement {
|
|
|
6
6
|
removeEventListener<K extends keyof UiScrollAreaEventMap>(type: K, listener: (this: UiScrollAreaElement, event: UiScrollAreaEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
7
|
}
|
|
8
8
|
export interface UiScrollAreaProps {
|
|
9
|
+
fill?: boolean | null;
|
|
9
10
|
orientation?: "vertical" | "horizontal" | null;
|
|
10
11
|
size?: "content" | "sm" | "md" | "lg" | null;
|
|
11
12
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
package/vanilla/UiScrollArea.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-scroll-area/ui-scroll-area.js";
|
|
4
4
|
import "../styles/ui-scroll-area.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-scroll-area","props":{"orientation":{"type":{"kind":"terminal","name":"keyword"},"values":["vertical","horizontal"],"required":false,"target":{"attribute":"orientation"},"default":"vertical"},"size":{"type":{"kind":"terminal","name":"keyword"},"values":["content","sm","md","lg"],"required":false,"target":{"attribute":"size"},"default":"content"}}},"template":{"kind":"element","name":"div","attributes":[],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"content"}],"children":[{"kind":"slot"}],"ref":"content"}]},"declarations":[],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-scroll-area","props":{"fill":{"type":"boolean","required":false,"target":{"attribute":"fill"},"default":false},"orientation":{"type":{"kind":"terminal","name":"keyword"},"values":["vertical","horizontal"],"required":false,"target":{"attribute":"orientation"},"default":"vertical"},"size":{"type":{"kind":"terminal","name":"keyword"},"values":["content","sm","md","lg"],"required":false,"target":{"attribute":"size"},"default":"content"}}},"template":{"kind":"element","name":"div","attributes":[],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"content"}],"children":[{"kind":"slot"}],"ref":"content"}]},"declarations":[],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiScrollArea(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
package/vanilla/UiStack.d.ts
CHANGED
|
@@ -7,7 +7,9 @@ export interface UiStackElement extends HTMLDivElement {
|
|
|
7
7
|
}
|
|
8
8
|
export interface UiStackProps {
|
|
9
9
|
align?: "start" | "center" | "end" | "stretch" | null;
|
|
10
|
+
fill?: boolean | null;
|
|
10
11
|
gap?: "none" | "xs" | "s" | "m" | "l" | "xl" | null;
|
|
12
|
+
height?: number | null;
|
|
11
13
|
justify?: "start" | "center" | "end" | "between" | null;
|
|
12
14
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
13
15
|
children?: readonly (string | Node)[];
|
package/vanilla/UiStack.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
// Generated by HTML Next 1.0.0-alpha.29 for Vanilla DOM. Do not edit.
|
|
2
|
-
import {
|
|
2
|
+
import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
3
3
|
import "../styles/ui-stack.css";
|
|
4
4
|
|
|
5
|
+
const definition = {...{"contract":{"tag":"ui-stack","props":{"align":{"type":{"kind":"terminal","name":"keyword"},"values":["start","center","end","stretch"],"required":false,"target":{"attribute":"align"}},"fill":{"type":"boolean","required":false,"target":{"attribute":"fill"},"default":false},"gap":{"type":{"kind":"terminal","name":"keyword"},"values":["none","xs","s","m","l","xl"],"required":false,"target":{"attribute":"gap"}},"height":{"type":"number","required":false,"target":{"attribute":"height"}},"justify":{"type":{"kind":"terminal","name":"keyword"},"values":["start","center","end","between"],"required":false,"target":{"attribute":"justify"}}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"attribute","name":"--ui-stack-height","expression":"height","expressionPlan":{"source":"height","ast":{"kind":"id","name":"height"},"dependencies":["height"]},"target":"style"}],"children":[{"kind":"slot"}]},"declarations":[],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
|
|
5
7
|
export function createUiStack(options = {}) {
|
|
6
8
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
7
9
|
const projected = [];
|
|
8
|
-
const prop0 = componentProps["align"] === undefined ? undefined : componentProps["align"];
|
|
9
|
-
const prop1 = componentProps["gap"] === undefined ? undefined : componentProps["gap"];
|
|
10
|
-
const prop2 = componentProps["justify"] === undefined ? undefined : componentProps["justify"];
|
|
11
10
|
const element = document.createElement("div");
|
|
12
11
|
for (const [name, value] of Object.entries(attributes)) {
|
|
13
12
|
if (value === null || value === undefined || value === false) continue;
|
|
14
13
|
element.setAttribute(name, value === true ? "" : String(value));
|
|
15
14
|
}
|
|
15
|
+
const value0 = componentProps["height"] === undefined ? null : componentProps["height"];
|
|
16
|
+
if (value0 === null || value0 === undefined) element.removeAttribute("--ui-stack-height");
|
|
17
|
+
else element.setAttribute("--ui-stack-height", String(value0));
|
|
16
18
|
element.setAttribute("data-component", "ui-stack");
|
|
17
19
|
if (children.length > 0) {
|
|
18
20
|
for (const child of children) {
|
|
@@ -23,11 +25,8 @@ export function createUiStack(options = {}) {
|
|
|
23
25
|
}
|
|
24
26
|
} else {
|
|
25
27
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{ name: "gap", attribute: "data-gap", value: componentProps["gap"], type: ["none","xs","s","m","l","xl"], required: false },
|
|
29
|
-
{ name: "justify", attribute: "data-justify", value: componentProps["justify"], type: ["start","center","end","between"], required: false },
|
|
30
|
-
]);
|
|
28
|
+
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
29
|
+
});
|
|
31
30
|
return element;
|
|
32
31
|
}
|
|
33
32
|
|
package/vanilla/UiText.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface UiTextProps {
|
|
|
9
9
|
align?: "start" | "center" | null;
|
|
10
10
|
as?: "p" | "span" | "div" | "small" | "strong" | "label" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
|
|
11
11
|
font?: "inherit" | "sans" | null;
|
|
12
|
+
grow?: boolean | null;
|
|
12
13
|
size?: "inherit" | "xs" | "sm" | "md" | "lg" | null;
|
|
13
14
|
tone?: "default" | "secondary" | "muted" | "accent" | "danger" | "success" | "info" | "warning" | null;
|
|
14
15
|
truncate?: boolean | null;
|
package/vanilla/UiText.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { componentRootIndex, manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
3
3
|
import "../styles/ui-text.css";
|
|
4
4
|
|
|
5
|
-
const definition = {...{"contract":{"tag":"ui-text","props":{"align":{"type":{"kind":"terminal","name":"keyword"},"values":["start","center"],"required":false,"target":{"attribute":"align"},"default":"start"},"as":{"type":{"kind":"terminal","name":"keyword"},"values":["p","span","div","small","strong","label","h2","h3","h4","h5","h6"],"required":false,"target":{"attribute":"as"},"default":"p"},"font":{"type":{"kind":"terminal","name":"keyword"},"values":["inherit","sans"],"required":false,"target":{"attribute":"font"},"default":"inherit"},"size":{"type":{"kind":"terminal","name":"keyword"},"values":["inherit","xs","sm","md","lg"],"required":false,"target":{"attribute":"size"},"default":"inherit"},"tone":{"type":{"kind":"terminal","name":"keyword"},"values":["default","secondary","muted","accent","danger","success","info","warning"],"required":false,"target":{"attribute":"tone"},"default":"default"},"truncate":{"type":"boolean","required":false,"target":{"attribute":"truncate"},"default":false},"variant":{"type":{"kind":"terminal","name":"keyword"},"values":["body","eyebrow","code"],"required":false,"target":{"attribute":"variant"},"default":"body"},"weight":{"type":{"kind":"terminal","name":"keyword"},"values":["inherit","normal","medium","semibold"],"required":false,"target":{"attribute":"weight"},"default":"inherit"},"wrap":{"type":{"kind":"terminal","name":"keyword"},"values":["normal","anywhere"],"required":false,"target":{"attribute":"wrap"},"default":"normal"}}},"template":{"kind":"element","name":"template","attributes":[],"children":[{"kind":"element","name":"span","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'span'","testPlan":{"source":"as = 'span'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"span"}},"dependencies":["as"]}}},{"kind":"element","name":"div","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'div'","testPlan":{"source":"as = 'div'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"div"}},"dependencies":["as"]}}},{"kind":"element","name":"small","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'small'","testPlan":{"source":"as = 'small'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"small"}},"dependencies":["as"]}}},{"kind":"element","name":"strong","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'strong'","testPlan":{"source":"as = 'strong'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"strong"}},"dependencies":["as"]}}},{"kind":"element","name":"label","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'label'","testPlan":{"source":"as = 'label'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"label"}},"dependencies":["as"]}}},{"kind":"element","name":"h2","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'h2'","testPlan":{"source":"as = 'h2'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"h2"}},"dependencies":["as"]}}},{"kind":"element","name":"h3","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'h3'","testPlan":{"source":"as = 'h3'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"h3"}},"dependencies":["as"]}}},{"kind":"element","name":"h4","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'h4'","testPlan":{"source":"as = 'h4'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"h4"}},"dependencies":["as"]}}},{"kind":"element","name":"h5","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'h5'","testPlan":{"source":"as = 'h5'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"h5"}},"dependencies":["as"]}}},{"kind":"element","name":"h6","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'h6'","testPlan":{"source":"as = 'h6'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"h6"}},"dependencies":["as"]}}},{"kind":"element","name":"p","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"else"}}],"flow":{"kind":"match"}},"declarations":[],"root":{"kind":"native","element":"p","choices":["span","div","small","strong","label","h2","h3","h4","h5","h6","p"]}},source:{file:import.meta.url},css:""};
|
|
5
|
+
const definition = {...{"contract":{"tag":"ui-text","props":{"align":{"type":{"kind":"terminal","name":"keyword"},"values":["start","center"],"required":false,"target":{"attribute":"align"},"default":"start"},"as":{"type":{"kind":"terminal","name":"keyword"},"values":["p","span","div","small","strong","label","h2","h3","h4","h5","h6"],"required":false,"target":{"attribute":"as"},"default":"p"},"font":{"type":{"kind":"terminal","name":"keyword"},"values":["inherit","sans"],"required":false,"target":{"attribute":"font"},"default":"inherit"},"grow":{"type":"boolean","required":false,"target":{"attribute":"grow"},"default":false},"size":{"type":{"kind":"terminal","name":"keyword"},"values":["inherit","xs","sm","md","lg"],"required":false,"target":{"attribute":"size"},"default":"inherit"},"tone":{"type":{"kind":"terminal","name":"keyword"},"values":["default","secondary","muted","accent","danger","success","info","warning"],"required":false,"target":{"attribute":"tone"},"default":"default"},"truncate":{"type":"boolean","required":false,"target":{"attribute":"truncate"},"default":false},"variant":{"type":{"kind":"terminal","name":"keyword"},"values":["body","eyebrow","code"],"required":false,"target":{"attribute":"variant"},"default":"body"},"weight":{"type":{"kind":"terminal","name":"keyword"},"values":["inherit","normal","medium","semibold"],"required":false,"target":{"attribute":"weight"},"default":"inherit"},"wrap":{"type":{"kind":"terminal","name":"keyword"},"values":["normal","anywhere"],"required":false,"target":{"attribute":"wrap"},"default":"normal"}}},"template":{"kind":"element","name":"template","attributes":[],"children":[{"kind":"element","name":"span","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'span'","testPlan":{"source":"as = 'span'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"span"}},"dependencies":["as"]}}},{"kind":"element","name":"div","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'div'","testPlan":{"source":"as = 'div'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"div"}},"dependencies":["as"]}}},{"kind":"element","name":"small","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'small'","testPlan":{"source":"as = 'small'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"small"}},"dependencies":["as"]}}},{"kind":"element","name":"strong","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'strong'","testPlan":{"source":"as = 'strong'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"strong"}},"dependencies":["as"]}}},{"kind":"element","name":"label","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'label'","testPlan":{"source":"as = 'label'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"label"}},"dependencies":["as"]}}},{"kind":"element","name":"h2","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'h2'","testPlan":{"source":"as = 'h2'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"h2"}},"dependencies":["as"]}}},{"kind":"element","name":"h3","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'h3'","testPlan":{"source":"as = 'h3'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"h3"}},"dependencies":["as"]}}},{"kind":"element","name":"h4","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'h4'","testPlan":{"source":"as = 'h4'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"h4"}},"dependencies":["as"]}}},{"kind":"element","name":"h5","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'h5'","testPlan":{"source":"as = 'h5'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"h5"}},"dependencies":["as"]}}},{"kind":"element","name":"h6","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'h6'","testPlan":{"source":"as = 'h6'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"h6"}},"dependencies":["as"]}}},{"kind":"element","name":"p","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"else"}}],"flow":{"kind":"match"}},"declarations":[],"root":{"kind":"native","element":"p","choices":["span","div","small","strong","label","h2","h3","h4","h5","h6","p"]}},source:{file:import.meta.url},css:""};
|
|
6
6
|
|
|
7
7
|
export function createUiText(options = {}) {
|
|
8
8
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
package/vanilla/UiTextarea.d.ts
CHANGED
package/vanilla/UiTextarea.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-textarea/ui-textarea.js";
|
|
4
4
|
import "../styles/ui-textarea.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-textarea","props":{"autosize":{"type":"boolean","required":false,"target":{"attribute":"autosize"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"invalid":{"type":"boolean","required":false,"target":{"attribute":"aria-invalid"},"default":false},"readonly":{"type":"boolean","required":false,"target":{"attribute":"readonly"},"default":false},"required":{"type":"boolean","required":false,"target":{"attribute":"required"},"default":false},"rows":{"type":{"kind":"terminal","name":"integer"},"required":false,"target":{"attribute":"rows"},"default":4},"size":{"type":{"kind":"terminal","name":"keyword"},"values":["sm","md","lg"],"required":false,"target":{"attribute":"size"},"default":"md"},"value":{"type":"string","required":false,"target":{"attribute":"value"}}}},"template":{"kind":"element","name":"textarea","attributes":[{"kind":"attribute","name":"value","expression":"value","expressionPlan":{"source":"value","ast":{"kind":"id","name":"value"},"dependencies":["value"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"readonly","expression":"readonly","expressionPlan":{"source":"readonly","ast":{"kind":"id","name":"readonly"},"dependencies":["readonly"]}},{"kind":"attribute","name":"required","expression":"required","expressionPlan":{"source":"required","ast":{"kind":"id","name":"required"},"dependencies":["required"]}},{"kind":"attribute","name":"aria-invalid","expression":"invalid","expressionPlan":{"source":"invalid","ast":{"kind":"id","name":"invalid"},"dependencies":["invalid"]}},{"kind":"attribute","name":"rows","expression":"rows","expressionPlan":{"source":"rows","ast":{"kind":"id","name":"rows"},"dependencies":["rows"]}},{"kind":"attribute","name":"--_rows","expression":"rows","expressionPlan":{"source":"rows","ast":{"kind":"id","name":"rows"},"dependencies":["rows"]},"target":"style"}],"children":[]},"declarations":[],"root":{"kind":"native","element":"textarea","choices":["textarea"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-textarea","props":{"autosize":{"type":"boolean","required":false,"target":{"attribute":"autosize"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"invalid":{"type":"boolean","required":false,"target":{"attribute":"aria-invalid"},"default":false},"maxRows":{"type":{"kind":"terminal","name":"integer"},"required":false,"target":{"attribute":"maxrows"}},"readonly":{"type":"boolean","required":false,"target":{"attribute":"readonly"},"default":false},"required":{"type":"boolean","required":false,"target":{"attribute":"required"},"default":false},"rows":{"type":{"kind":"terminal","name":"integer"},"required":false,"target":{"attribute":"rows"},"default":4},"size":{"type":{"kind":"terminal","name":"keyword"},"values":["sm","md","lg"],"required":false,"target":{"attribute":"size"},"default":"md"},"value":{"type":"string","required":false,"target":{"attribute":"value"}}}},"template":{"kind":"element","name":"textarea","attributes":[{"kind":"attribute","name":"value","expression":"value","expressionPlan":{"source":"value","ast":{"kind":"id","name":"value"},"dependencies":["value"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"readonly","expression":"readonly","expressionPlan":{"source":"readonly","ast":{"kind":"id","name":"readonly"},"dependencies":["readonly"]}},{"kind":"attribute","name":"required","expression":"required","expressionPlan":{"source":"required","ast":{"kind":"id","name":"required"},"dependencies":["required"]}},{"kind":"attribute","name":"aria-invalid","expression":"invalid","expressionPlan":{"source":"invalid","ast":{"kind":"id","name":"invalid"},"dependencies":["invalid"]}},{"kind":"attribute","name":"rows","expression":"rows","expressionPlan":{"source":"rows","ast":{"kind":"id","name":"rows"},"dependencies":["rows"]}},{"kind":"attribute","name":"--_rows","expression":"rows","expressionPlan":{"source":"rows","ast":{"kind":"id","name":"rows"},"dependencies":["rows"]},"target":"style"},{"kind":"attribute","name":"--_max-rows","expression":"maxRows","expressionPlan":{"source":"maxRows","ast":{"kind":"id","name":"maxRows"},"dependencies":["maxRows"]},"target":"style"}],"children":[]},"declarations":[],"root":{"kind":"native","element":"textarea","choices":["textarea"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiTextarea(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -34,6 +34,9 @@ export function createUiTextarea(options = {}) {
|
|
|
34
34
|
const value6 = componentProps["rows"] === undefined ? 4 : componentProps["rows"];
|
|
35
35
|
if (value6 === null || value6 === undefined) element.removeAttribute("--_rows");
|
|
36
36
|
else element.setAttribute("--_rows", String(value6));
|
|
37
|
+
const value7 = componentProps["maxRows"] === undefined ? null : componentProps["maxRows"];
|
|
38
|
+
if (value7 === null || value7 === undefined) element.removeAttribute("--_max-rows");
|
|
39
|
+
else element.setAttribute("--_max-rows", String(value7));
|
|
37
40
|
element.setAttribute("data-component", "ui-textarea");
|
|
38
41
|
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
39
42
|
controller,
|