@threadlabs/looma 0.14.3 → 0.14.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-text/ui-text.html +13 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-text.css +12 -2
- package/vanilla/UiText.d.ts +1 -1
- package/vanilla/UiText.js +1 -1
- package/vue/UiText.d.ts +2 -2
- package/vue/UiText.vue +11 -3
- package/vue/chunks/UiText.js +1 -1
- package/vue/components.css +29 -21
package/package.json
CHANGED
package/styles/ui-text.css
CHANGED
|
@@ -35,11 +35,19 @@
|
|
|
35
35
|
:scope[data-ui-text-state~="tone=accent"] {
|
|
36
36
|
color: var(--ui-accent-active);
|
|
37
37
|
}
|
|
38
|
+
/* Every status tone uses the text-safe token a subtle badge sets its words in, so text and badges
|
|
39
|
+
in one tone match, and each holds 4.5:1 on sunken surfaces where some base colours fall short. */
|
|
38
40
|
:scope[data-ui-text-state~="tone=danger"] {
|
|
39
|
-
color: var(--ui-danger);
|
|
41
|
+
color: var(--ui-danger-subtle-text);
|
|
40
42
|
}
|
|
41
43
|
:scope[data-ui-text-state~="tone=success"] {
|
|
42
|
-
color: var(--ui-success);
|
|
44
|
+
color: var(--ui-success-subtle-text);
|
|
45
|
+
}
|
|
46
|
+
:scope[data-ui-text-state~="tone=info"] {
|
|
47
|
+
color: var(--ui-info-subtle-text);
|
|
48
|
+
}
|
|
49
|
+
:scope[data-ui-text-state~="tone=warning"] {
|
|
50
|
+
color: var(--ui-warning-subtle-text);
|
|
43
51
|
}
|
|
44
52
|
|
|
45
53
|
:scope[data-ui-text-state~="weight=normal"] {
|
|
@@ -83,6 +91,8 @@
|
|
|
83
91
|
@scope ([data-component~="ui-text"]) to ([data-component]) {
|
|
84
92
|
/* Running text, set on the type scale and in a tone that says what it is, so a view never styles
|
|
85
93
|
text of its own. The root is a paragraph unless as= names a span, div, small, strong, or label. */
|
|
94
|
+
/* Every status tone uses the text-safe token a subtle badge sets its words in, so text and badges
|
|
95
|
+
in one tone match, and each holds 4.5:1 on sunken surfaces where some base colours fall short. */
|
|
86
96
|
|
|
87
97
|
/* A link in running text is underlined, so it stands apart from the words around it by more than
|
|
88
98
|
colour. */
|
package/vanilla/UiText.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface UiTextProps {
|
|
|
9
9
|
align?: "start" | "center" | null;
|
|
10
10
|
as?: "p" | "span" | "div" | "small" | "strong" | "label" | null;
|
|
11
11
|
size?: "inherit" | "xs" | "sm" | "md" | "lg" | null;
|
|
12
|
-
tone?: "default" | "secondary" | "muted" | "accent" | "danger" | "success" | null;
|
|
12
|
+
tone?: "default" | "secondary" | "muted" | "accent" | "danger" | "success" | "info" | "warning" | null;
|
|
13
13
|
truncate?: boolean | null;
|
|
14
14
|
variant?: "body" | "eyebrow" | "code" | null;
|
|
15
15
|
weight?: "inherit" | "normal" | "medium" | "semibold" | 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":{"enum":["start","center"]},"required":false,"target":{"attribute":"align"},"default":"start"},"as":{"type":{"enum":["p","span","div","small","strong","label"]},"required":false,"target":{"attribute":"as"},"default":"p"},"size":{"type":{"enum":["inherit","xs","sm","md","lg"]},"required":false,"target":{"attribute":"size"},"default":"inherit"},"tone":{"type":{"enum":["default","secondary","muted","accent","danger","success"]},"required":false,"target":{"attribute":"tone"},"default":"default"},"truncate":{"type":"boolean","required":false,"target":{"attribute":"truncate"},"default":false},"variant":{"type":{"enum":["body","eyebrow","code"]},"required":false,"target":{"attribute":"variant"},"default":"body"},"weight":{"type":{"enum":["inherit","normal","medium","semibold"]},"required":false,"target":{"attribute":"weight"},"default":"inherit"}}},"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":"p","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"else"}}],"flow":{"kind":"match"}},"declarations":[],"root":{"kind":"native","element":"p","choices":["span","div","small","strong","label","p"]}},source:{file:import.meta.url},css:""};
|
|
5
|
+
const definition = {...{"contract":{"tag":"ui-text","props":{"align":{"type":{"enum":["start","center"]},"required":false,"target":{"attribute":"align"},"default":"start"},"as":{"type":{"enum":["p","span","div","small","strong","label"]},"required":false,"target":{"attribute":"as"},"default":"p"},"size":{"type":{"enum":["inherit","xs","sm","md","lg"]},"required":false,"target":{"attribute":"size"},"default":"inherit"},"tone":{"type":{"enum":["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":{"enum":["body","eyebrow","code"]},"required":false,"target":{"attribute":"variant"},"default":"body"},"weight":{"type":{"enum":["inherit","normal","medium","semibold"]},"required":false,"target":{"attribute":"weight"},"default":"inherit"}}},"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":"p","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"else"}}],"flow":{"kind":"match"}},"declarations":[],"root":{"kind":"native","element":"p","choices":["span","div","small","strong","label","p"]}},source:{file:import.meta.url},css:""};
|
|
6
6
|
|
|
7
7
|
export function createUiText(options = {}) {
|
|
8
8
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
package/vue/UiText.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ type __VLS_Props = {
|
|
|
2
2
|
align?: 'start' | 'center';
|
|
3
3
|
as?: 'p' | 'span' | 'div' | 'small' | 'strong' | 'label';
|
|
4
4
|
size?: 'inherit' | 'xs' | 'sm' | 'md' | 'lg';
|
|
5
|
-
tone?: 'default' | 'secondary' | 'muted' | 'accent' | 'danger' | 'success';
|
|
5
|
+
tone?: 'default' | 'secondary' | 'muted' | 'accent' | 'danger' | 'success' | 'info' | 'warning';
|
|
6
6
|
truncate?: boolean;
|
|
7
7
|
variant?: 'body' | 'eyebrow' | 'code';
|
|
8
8
|
weight?: 'inherit' | 'normal' | 'medium' | 'semibold';
|
|
@@ -23,7 +23,7 @@ type __VLS_Slots = {} & {
|
|
|
23
23
|
};
|
|
24
24
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
25
25
|
size: "inherit" | "xs" | "sm" | "md" | "lg";
|
|
26
|
-
tone: "default" | "secondary" | "muted" | "accent" | "danger" | "success";
|
|
26
|
+
tone: "default" | "secondary" | "muted" | "accent" | "danger" | "success" | "info" | "warning";
|
|
27
27
|
variant: "body" | "eyebrow" | "code";
|
|
28
28
|
align: "start" | "center";
|
|
29
29
|
as: "p" | "span" | "div" | "small" | "strong" | "label";
|
package/vue/UiText.vue
CHANGED
|
@@ -9,7 +9,7 @@ const props = withDefaults(
|
|
|
9
9
|
align?: 'start' | 'center'
|
|
10
10
|
as?: 'p' | 'span' | 'div' | 'small' | 'strong' | 'label'
|
|
11
11
|
size?: 'inherit' | 'xs' | 'sm' | 'md' | 'lg'
|
|
12
|
-
tone?: 'default' | 'secondary' | 'muted' | 'accent' | 'danger' | 'success'
|
|
12
|
+
tone?: 'default' | 'secondary' | 'muted' | 'accent' | 'danger' | 'success' | 'info' | 'warning'
|
|
13
13
|
truncate?: boolean
|
|
14
14
|
variant?: 'body' | 'eyebrow' | 'code'
|
|
15
15
|
weight?: 'inherit' | 'normal' | 'medium' | 'semibold'
|
|
@@ -112,11 +112,19 @@ const hostState = computed(() =>
|
|
|
112
112
|
[data-component~="ui-text"][data-ui-text-state~="tone=accent"] {
|
|
113
113
|
color: var(--ui-accent-active);
|
|
114
114
|
}
|
|
115
|
+
/* Every status tone uses the text-safe token a subtle badge sets its words in, so text and badges
|
|
116
|
+
in one tone match, and each holds 4.5:1 on sunken surfaces where some base colours fall short. */
|
|
115
117
|
[data-component~="ui-text"][data-ui-text-state~="tone=danger"] {
|
|
116
|
-
color: var(--ui-danger);
|
|
118
|
+
color: var(--ui-danger-subtle-text);
|
|
117
119
|
}
|
|
118
120
|
[data-component~="ui-text"][data-ui-text-state~="tone=success"] {
|
|
119
|
-
color: var(--ui-success);
|
|
121
|
+
color: var(--ui-success-subtle-text);
|
|
122
|
+
}
|
|
123
|
+
[data-component~="ui-text"][data-ui-text-state~="tone=info"] {
|
|
124
|
+
color: var(--ui-info-subtle-text);
|
|
125
|
+
}
|
|
126
|
+
[data-component~="ui-text"][data-ui-text-state~="tone=warning"] {
|
|
127
|
+
color: var(--ui-warning-subtle-text);
|
|
120
128
|
}
|
|
121
129
|
|
|
122
130
|
[data-component~="ui-text"][data-ui-text-state~="weight=normal"] {
|
package/vue/chunks/UiText.js
CHANGED
|
@@ -57,6 +57,6 @@ var UiText_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
57
57
|
}, _ctx.$attrs, { "data-ui-text-state": hostState.value || void 0 }), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_6));
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
}), [["__scopeId", "data-v-
|
|
60
|
+
}), [["__scopeId", "data-v-f6cb02e5"]]);
|
|
61
61
|
//#endregion
|
|
62
62
|
export { UiText_default as t };
|
package/vue/components.css
CHANGED
|
@@ -6371,81 +6371,89 @@ tbody tr[data-v-9980d203-s]:last-child > * {
|
|
|
6371
6371
|
|
|
6372
6372
|
/* Running text, set on the type scale and in a tone that says what it is, so a view never styles
|
|
6373
6373
|
text of its own. The root is a paragraph unless as= names a span, div, small, strong, or label. */
|
|
6374
|
-
[data-component~="ui-text"][data-v-
|
|
6374
|
+
[data-component~="ui-text"][data-v-f6cb02e5] {
|
|
6375
6375
|
margin: 0;
|
|
6376
6376
|
min-inline-size: 0;
|
|
6377
6377
|
color: var(--ui-text-primary);
|
|
6378
6378
|
text-align: start;
|
|
6379
6379
|
}
|
|
6380
|
-
[data-component~="ui-text"][data-ui-text-state~="size=xs"][data-v-
|
|
6380
|
+
[data-component~="ui-text"][data-ui-text-state~="size=xs"][data-v-f6cb02e5] {
|
|
6381
6381
|
font-size: var(--ui-font-size-xs);
|
|
6382
6382
|
line-height: var(--ui-line-height);
|
|
6383
6383
|
}
|
|
6384
|
-
[data-component~="ui-text"][data-ui-text-state~="size=sm"][data-v-
|
|
6384
|
+
[data-component~="ui-text"][data-ui-text-state~="size=sm"][data-v-f6cb02e5] {
|
|
6385
6385
|
font-size: var(--ui-font-size-sm);
|
|
6386
6386
|
line-height: var(--ui-line-height);
|
|
6387
6387
|
}
|
|
6388
|
-
[data-component~="ui-text"][data-ui-text-state~="size=md"][data-v-
|
|
6388
|
+
[data-component~="ui-text"][data-ui-text-state~="size=md"][data-v-f6cb02e5] {
|
|
6389
6389
|
font-size: var(--ui-font-size-md);
|
|
6390
6390
|
line-height: var(--ui-line-height);
|
|
6391
6391
|
}
|
|
6392
|
-
[data-component~="ui-text"][data-ui-text-state~="size=lg"][data-v-
|
|
6392
|
+
[data-component~="ui-text"][data-ui-text-state~="size=lg"][data-v-f6cb02e5] {
|
|
6393
6393
|
font-size: var(--ui-font-size-lg);
|
|
6394
6394
|
line-height: var(--ui-line-height-relaxed);
|
|
6395
6395
|
}
|
|
6396
|
-
[data-component~="ui-text"][data-ui-text-state~="tone=secondary"][data-v-
|
|
6396
|
+
[data-component~="ui-text"][data-ui-text-state~="tone=secondary"][data-v-f6cb02e5] {
|
|
6397
6397
|
color: var(--ui-text-secondary);
|
|
6398
6398
|
}
|
|
6399
|
-
[data-component~="ui-text"][data-ui-text-state~="tone=muted"][data-v-
|
|
6399
|
+
[data-component~="ui-text"][data-ui-text-state~="tone=muted"][data-v-f6cb02e5] {
|
|
6400
6400
|
color: var(--ui-text-muted);
|
|
6401
6401
|
}
|
|
6402
|
-
[data-component~="ui-text"][data-ui-text-state~="tone=accent"][data-v-
|
|
6402
|
+
[data-component~="ui-text"][data-ui-text-state~="tone=accent"][data-v-f6cb02e5] {
|
|
6403
6403
|
color: var(--ui-accent-active);
|
|
6404
6404
|
}
|
|
6405
|
-
|
|
6406
|
-
|
|
6405
|
+
/* Every status tone uses the text-safe token a subtle badge sets its words in, so text and badges
|
|
6406
|
+
in one tone match, and each holds 4.5:1 on sunken surfaces where some base colours fall short. */
|
|
6407
|
+
[data-component~="ui-text"][data-ui-text-state~="tone=danger"][data-v-f6cb02e5] {
|
|
6408
|
+
color: var(--ui-danger-subtle-text);
|
|
6409
|
+
}
|
|
6410
|
+
[data-component~="ui-text"][data-ui-text-state~="tone=success"][data-v-f6cb02e5] {
|
|
6411
|
+
color: var(--ui-success-subtle-text);
|
|
6412
|
+
}
|
|
6413
|
+
[data-component~="ui-text"][data-ui-text-state~="tone=info"][data-v-f6cb02e5] {
|
|
6414
|
+
color: var(--ui-info-subtle-text);
|
|
6407
6415
|
}
|
|
6408
|
-
[data-component~="ui-text"][data-ui-text-state~="tone=
|
|
6409
|
-
color: var(--ui-
|
|
6416
|
+
[data-component~="ui-text"][data-ui-text-state~="tone=warning"][data-v-f6cb02e5] {
|
|
6417
|
+
color: var(--ui-warning-subtle-text);
|
|
6410
6418
|
}
|
|
6411
|
-
[data-component~="ui-text"][data-ui-text-state~="weight=normal"][data-v-
|
|
6419
|
+
[data-component~="ui-text"][data-ui-text-state~="weight=normal"][data-v-f6cb02e5] {
|
|
6412
6420
|
font-weight: var(--ui-font-normal);
|
|
6413
6421
|
}
|
|
6414
|
-
[data-component~="ui-text"][data-ui-text-state~="weight=medium"][data-v-
|
|
6422
|
+
[data-component~="ui-text"][data-ui-text-state~="weight=medium"][data-v-f6cb02e5] {
|
|
6415
6423
|
font-weight: var(--ui-font-medium);
|
|
6416
6424
|
}
|
|
6417
|
-
[data-component~="ui-text"][data-ui-text-state~="weight=semibold"][data-v-
|
|
6425
|
+
[data-component~="ui-text"][data-ui-text-state~="weight=semibold"][data-v-f6cb02e5] {
|
|
6418
6426
|
font-weight: var(--ui-font-semibold);
|
|
6419
6427
|
}
|
|
6420
|
-
[data-component~="ui-text"][data-ui-text-state~="variant=eyebrow"][data-v-
|
|
6428
|
+
[data-component~="ui-text"][data-ui-text-state~="variant=eyebrow"][data-v-f6cb02e5] {
|
|
6421
6429
|
font-size: var(--ui-font-size-xs);
|
|
6422
6430
|
font-weight: var(--ui-font-semibold);
|
|
6423
6431
|
letter-spacing: 0.06em;
|
|
6424
6432
|
text-transform: uppercase;
|
|
6425
6433
|
}
|
|
6426
|
-
[data-component~="ui-text"][data-ui-text-state~="variant=code"][data-v-
|
|
6434
|
+
[data-component~="ui-text"][data-ui-text-state~="variant=code"][data-v-f6cb02e5] {
|
|
6427
6435
|
font-family: var(--ui-font-family-mono);
|
|
6428
6436
|
}
|
|
6429
6437
|
|
|
6430
6438
|
/* A link in running text is underlined, so it stands apart from the words around it by more than
|
|
6431
6439
|
colour. */
|
|
6432
|
-
[data-component~="ui-text"] a[data-v-
|
|
6440
|
+
[data-component~="ui-text"] a[data-v-f6cb02e5-s] {
|
|
6433
6441
|
color: var(--ui-accent-active);
|
|
6434
6442
|
text-decoration: underline;
|
|
6435
6443
|
text-decoration-thickness: 0.06em;
|
|
6436
6444
|
text-underline-offset: 0.18em;
|
|
6437
6445
|
}
|
|
6438
|
-
[data-component~="ui-text"][data-ui-text-state~="truncate"][data-v-
|
|
6446
|
+
[data-component~="ui-text"][data-ui-text-state~="truncate"][data-v-f6cb02e5] {
|
|
6439
6447
|
overflow: hidden;
|
|
6440
6448
|
text-overflow: ellipsis;
|
|
6441
6449
|
white-space: nowrap;
|
|
6442
6450
|
}
|
|
6443
|
-
[data-component~="ui-text"][data-ui-text-state~="align=center"][data-v-
|
|
6451
|
+
[data-component~="ui-text"][data-ui-text-state~="align=center"][data-v-f6cb02e5] {
|
|
6444
6452
|
text-align: center;
|
|
6445
6453
|
}
|
|
6446
6454
|
|
|
6447
6455
|
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
6448
|
-
[data-component~="ui-text"][hidden][data-v-
|
|
6456
|
+
[data-component~="ui-text"][hidden][data-v-f6cb02e5] {
|
|
6449
6457
|
display: none;
|
|
6450
6458
|
}
|
|
6451
6459
|
|