@threadlabs/looma 0.25.4 → 0.25.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.
- package/components/ui-card/ui-card.html +27 -2
- package/components/ui-checkbox/ui-checkbox.html +2 -0
- package/components/ui-cluster/ui-cluster.html +35 -2
- package/components/ui-editor-surface/ui-editor-surface.html +23 -0
- package/components/ui-list-item/ui-list-item.html +12 -3
- 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-card.css +24 -0
- package/styles/ui-cluster.css +28 -0
- package/styles/ui-editor-surface.css +19 -0
- package/styles/ui-list-item.css +11 -3
- 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/UiCard.d.ts +1 -1
- package/vanilla/UiCard.js +1 -1
- package/vanilla/UiCheckbox.d.ts +1 -0
- package/vanilla/UiCheckbox.js +18 -15
- package/vanilla/UiCluster.d.ts +4 -1
- package/vanilla/UiCluster.js +10 -4
- package/vanilla/UiEditorSurface.d.ts +14 -0
- package/vanilla/UiEditorSurface.js +27 -0
- package/vanilla/UiListItem.d.ts +1 -0
- package/vanilla/UiListItem.js +4 -2
- 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/UiCard.d.ts +3 -3
- package/vue/UiCard.vue +34 -5
- package/vue/UiCheckbox.d.ts +9 -0
- package/vue/UiCheckbox.vue +20 -0
- package/vue/UiCluster.d.ts +30 -3
- package/vue/UiCluster.vue +102 -5
- package/vue/UiEditorSurface.d.ts +26 -0
- package/vue/UiEditorSurface.js +2 -0
- package/vue/UiEditorSurface.vue +129 -0
- package/vue/UiListItem.d.ts +9 -0
- package/vue/UiListItem.vue +35 -4
- 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/UiCard.js +10 -3
- package/vue/chunks/UiCheckbox.js +25 -1
- package/vue/chunks/UiCluster.js +85 -3
- package/vue/chunks/UiEditorSurface.js +71 -0
- package/vue/chunks/UiListItem.js +23 -1
- 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 +255 -162
- 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-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
|
}
|
|
@@ -38,6 +63,9 @@
|
|
|
38
63
|
:scope[data-ui-cluster-state~="align=end"] {
|
|
39
64
|
align-items: flex-end;
|
|
40
65
|
}
|
|
66
|
+
:scope[data-ui-cluster-state~="align=baseline"] {
|
|
67
|
+
align-items: baseline;
|
|
68
|
+
}
|
|
41
69
|
:scope[data-ui-cluster-state~="align=stretch"] {
|
|
42
70
|
align-items: stretch;
|
|
43
71
|
}
|
|
@@ -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
|
+
}
|
package/styles/ui-list-item.css
CHANGED
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
background: var(--ui-surface-raised);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
:scope:has(.title a[href]:hover
|
|
57
|
-
background: var(--ui-surface
|
|
56
|
+
:scope:where(:has(.title a[href])):hover {
|
|
57
|
+
background: var(--ui-selection-surface);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
:scope[data-ui-list-item-state~="variant=card"]:has(.title a[href]:hover
|
|
60
|
+
:scope[data-ui-list-item-state~="variant=card"]:where(:has(.title a[href])):hover {
|
|
61
61
|
border-color: var(--ui-border-strong);
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -91,6 +91,12 @@
|
|
|
91
91
|
color: var(--ui-selection-text);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/* An explicitly independent leading control sits above the stretched row link. */
|
|
95
|
+
:scope[data-ui-list-item-state~="leadingInteractive"] .leading {
|
|
96
|
+
position: relative;
|
|
97
|
+
z-index: 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
94
100
|
/* Trailing controls take their own clicks, above the title link's stretched hit area. */
|
|
95
101
|
.trailing {
|
|
96
102
|
position: relative;
|
|
@@ -170,6 +176,8 @@
|
|
|
170
176
|
a router, a modified click, and "open in new tab" all work. Trailing controls sit above it and
|
|
171
177
|
stay their own. */
|
|
172
178
|
|
|
179
|
+
/* An explicitly independent leading control sits above the stretched row link. */
|
|
180
|
+
|
|
173
181
|
/* Trailing controls take their own clicks, above the title link's stretched hit area. */
|
|
174
182
|
|
|
175
183
|
.title > :where([data-slotted], [data-slotted] *):is(a) {
|
|
@@ -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/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/UiCheckbox.d.ts
CHANGED
package/vanilla/UiCheckbox.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-checkbox/ui-checkbox.js";
|
|
4
4
|
import "../styles/ui-checkbox.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-checkbox","props":{"checked":{"type":"boolean","required":false,"target":{"attribute":"checked"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"indeterminate":{"type":"boolean","required":false,"target":{"property":"indeterminate"},"default":false},"invalid":{"type":"boolean","required":false,"target":{"attribute":"aria-invalid"},"default":false},"name":{"type":"string","required":false,"target":{"attribute":"name"},"default":""},"required":{"type":"boolean","required":false,"target":{"attribute":"required"},"default":false},"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"},"default":"on"}}},"template":{"kind":"element","name":"label","attributes":[],"children":[{"kind":"element","name":"input","attributes":[{"kind":"literal","name":"type","value":"checkbox"},{"kind":"property","key":"checked","name":"checked","expression":"internalChecked","expressionPlan":{"source":"internalChecked","ast":{"kind":"id","name":"internalChecked"},"dependencies":["internalChecked"]}},{"kind":"property","key":"indeterminate","name":"indeterminate","expression":"indeterminate","expressionPlan":{"source":"indeterminate","ast":{"kind":"id","name":"indeterminate"},"dependencies":["indeterminate"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"aria-invalid","expression":"invalid","expressionPlan":{"source":"invalid","ast":{"kind":"id","name":"invalid"},"dependencies":["invalid"]}},{"kind":"attribute","name":"required","expression":"required","expressionPlan":{"source":"required","ast":{"kind":"id","name":"required"},"dependencies":["required"]}},{"kind":"attribute","name":"name","expression":"name","expressionPlan":{"source":"name","ast":{"kind":"id","name":"name"},"dependencies":["name"]}},{"kind":"attribute","name":"value","expression":"value","expressionPlan":{"source":"value","ast":{"kind":"id","name":"value"},"dependencies":["value"]}}],"children":[],"ref":"input"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"text"}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label"}],"children":[{"kind":"slot"}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"description"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[{"kind":"slot","fallback":[],"name":"description"}],"ref":"description"}]}]},"declarations":[{"kind":"state","name":"internalChecked","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"change","type":"object","shape":{"kind":"object","fields":[{"name":"checked","type":{"kind":"terminal","name":"boolean"},"optional":false},{"name":"value","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"label","choices":["label"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-checkbox","props":{"checked":{"type":"boolean","required":false,"target":{"attribute":"checked"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"indeterminate":{"type":"boolean","required":false,"target":{"property":"indeterminate"},"default":false},"invalid":{"type":"boolean","required":false,"target":{"attribute":"aria-invalid"},"default":false},"label":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":""},"name":{"type":"string","required":false,"target":{"attribute":"name"},"default":""},"required":{"type":"boolean","required":false,"target":{"attribute":"required"},"default":false},"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"},"default":"on"}}},"template":{"kind":"element","name":"label","attributes":[],"children":[{"kind":"element","name":"input","attributes":[{"kind":"literal","name":"type","value":"checkbox"},{"kind":"attribute","name":"aria-label","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}},{"kind":"property","key":"checked","name":"checked","expression":"internalChecked","expressionPlan":{"source":"internalChecked","ast":{"kind":"id","name":"internalChecked"},"dependencies":["internalChecked"]}},{"kind":"property","key":"indeterminate","name":"indeterminate","expression":"indeterminate","expressionPlan":{"source":"indeterminate","ast":{"kind":"id","name":"indeterminate"},"dependencies":["indeterminate"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"aria-invalid","expression":"invalid","expressionPlan":{"source":"invalid","ast":{"kind":"id","name":"invalid"},"dependencies":["invalid"]}},{"kind":"attribute","name":"required","expression":"required","expressionPlan":{"source":"required","ast":{"kind":"id","name":"required"},"dependencies":["required"]}},{"kind":"attribute","name":"name","expression":"name","expressionPlan":{"source":"name","ast":{"kind":"id","name":"name"},"dependencies":["name"]}},{"kind":"attribute","name":"value","expression":"value","expressionPlan":{"source":"value","ast":{"kind":"id","name":"value"},"dependencies":["value"]}}],"children":[],"ref":"input"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"text"}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label"}],"children":[{"kind":"slot"}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"description"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[{"kind":"slot","fallback":[],"name":"description"}],"ref":"description"}]}]},"declarations":[{"kind":"state","name":"internalChecked","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"change","type":"object","shape":{"kind":"object","fields":[{"name":"checked","type":{"kind":"terminal","name":"boolean"},"optional":false},{"name":"value","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"label","choices":["label"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiCheckbox(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -16,23 +16,26 @@ export function createUiCheckbox(options = {}) {
|
|
|
16
16
|
element.setAttribute("data-component", "ui-checkbox");
|
|
17
17
|
const element0 = document.createElement("input");
|
|
18
18
|
element0.setAttribute("type", "checkbox");
|
|
19
|
-
const value0 = componentProps["
|
|
20
|
-
if (value0
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
const value0 = componentProps["label"] === undefined ? "" : componentProps["label"];
|
|
20
|
+
if (value0 === null || value0 === undefined) element0.removeAttribute("aria-label");
|
|
21
|
+
else element0.setAttribute("aria-label", String(value0));
|
|
22
|
+
const value1 = componentProps["indeterminate"] === undefined ? false : componentProps["indeterminate"];
|
|
23
|
+
if (value1 !== undefined) element0["indeterminate"] = value1;
|
|
24
|
+
const value2 = componentProps["disabled"] === undefined ? false : componentProps["disabled"];
|
|
25
|
+
if (value2 === true) element0.setAttribute("disabled", "");
|
|
23
26
|
else element0.removeAttribute("disabled");
|
|
24
|
-
const
|
|
25
|
-
if (typeof
|
|
27
|
+
const value3 = componentProps["invalid"] === undefined ? false : componentProps["invalid"];
|
|
28
|
+
if (typeof value3 === "boolean") element0.setAttribute("aria-invalid", String(value3));
|
|
26
29
|
else element0.removeAttribute("aria-invalid");
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
30
|
+
const value4 = componentProps["required"] === undefined ? false : componentProps["required"];
|
|
31
|
+
if (value4 === true) element0.setAttribute("required", "");
|
|
29
32
|
else element0.removeAttribute("required");
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
else element0.setAttribute("name", String(
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
else element0.setAttribute("value", String(
|
|
33
|
+
const value5 = componentProps["name"] === undefined ? "" : componentProps["name"];
|
|
34
|
+
if (value5 === null || value5 === undefined) element0.removeAttribute("name");
|
|
35
|
+
else element0.setAttribute("name", String(value5));
|
|
36
|
+
const value6 = componentProps["value"] === undefined ? "on" : componentProps["value"];
|
|
37
|
+
if (value6 === null || value6 === undefined) element0.removeAttribute("value");
|
|
38
|
+
else element0.setAttribute("value", String(value6));
|
|
36
39
|
element.append(element0);
|
|
37
40
|
const element1 = document.createElement("span");
|
|
38
41
|
element1.setAttribute("class", "text");
|
package/vanilla/UiCluster.d.ts
CHANGED
|
@@ -6,9 +6,12 @@ export interface UiClusterElement extends HTMLDivElement {
|
|
|
6
6
|
removeEventListener<K extends keyof UiClusterEventMap>(type: K, listener: (this: UiClusterElement, event: UiClusterEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
7
|
}
|
|
8
8
|
export interface UiClusterProps {
|
|
9
|
-
align?: "start" | "center" | "end" | "stretch" | null;
|
|
9
|
+
align?: "start" | "center" | "end" | "stretch" | "baseline" | 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;
|
|
@@ -25,9 +28,12 @@ export function createUiCluster(options = {}) {
|
|
|
25
28
|
} else {
|
|
26
29
|
}
|
|
27
30
|
manageGeneratedProps(element, [
|
|
28
|
-
{ name: "align", attribute: "data-align", value: componentProps["align"], type: ["start","center","end","stretch"], required: false },
|
|
31
|
+
{ name: "align", attribute: "data-align", value: componentProps["align"], type: ["start","center","end","stretch","baseline"], 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
|
+
|
package/vanilla/UiListItem.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface UiListItemElement extends HTMLLIElement {
|
|
|
8
8
|
export interface UiListItemProps {
|
|
9
9
|
current?: boolean | null;
|
|
10
10
|
highlighted?: boolean | null;
|
|
11
|
+
leadingInteractive?: boolean | null;
|
|
11
12
|
variant?: "row" | "card" | null;
|
|
12
13
|
wrap?: boolean | null;
|
|
13
14
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
package/vanilla/UiListItem.js
CHANGED
|
@@ -7,8 +7,9 @@ export function createUiListItem(options = {}) {
|
|
|
7
7
|
const projected = [];
|
|
8
8
|
const prop0 = componentProps["current"] === undefined ? false : componentProps["current"];
|
|
9
9
|
const prop1 = componentProps["highlighted"] === undefined ? false : componentProps["highlighted"];
|
|
10
|
-
const prop2 = componentProps["
|
|
11
|
-
const prop3 = componentProps["
|
|
10
|
+
const prop2 = componentProps["leadingInteractive"] === undefined ? false : componentProps["leadingInteractive"];
|
|
11
|
+
const prop3 = componentProps["variant"] === undefined ? "row" : componentProps["variant"];
|
|
12
|
+
const prop4 = componentProps["wrap"] === undefined ? false : componentProps["wrap"];
|
|
12
13
|
const element = document.createElement("li");
|
|
13
14
|
for (const [name, value] of Object.entries(attributes)) {
|
|
14
15
|
if (value === null || value === undefined || value === false) continue;
|
|
@@ -72,6 +73,7 @@ export function createUiListItem(options = {}) {
|
|
|
72
73
|
manageGeneratedProps(element, [
|
|
73
74
|
{ name: "current", attribute: "data-current", value: componentProps["current"], default: false, type: "boolean", required: false },
|
|
74
75
|
{ name: "highlighted", attribute: "data-highlighted", value: componentProps["highlighted"], default: false, type: "boolean", required: false },
|
|
76
|
+
{ name: "leadingInteractive", attribute: "data-leading-interactive", value: componentProps["leadingInteractive"], default: false, type: "boolean", required: false },
|
|
75
77
|
{ name: "variant", attribute: "data-variant", value: componentProps["variant"], default: "row", type: ["row","card"], required: false },
|
|
76
78
|
{ name: "wrap", attribute: "data-wrap", value: componentProps["wrap"], default: false, type: "boolean", required: false },
|
|
77
79
|
], (name, value) => {
|
|
@@ -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