@threadlabs/looma 0.22.13 → 0.22.14
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/shared/icons.js +4 -0
- package/components/ui-card/ui-card.html +21 -2
- package/components/ui-icon/ui-icon.html +4 -0
- package/components/ui-input/ui-input.html +1 -0
- package/components/ui-input-group/ui-input-group.html +11 -0
- package/components/ui-popover/ui-popover.html +15 -0
- package/components/ui-scroll-area/ui-scroll-area.html +12 -0
- package/components/ui-search-result-row/ui-search-result-row.html +11 -0
- package/components/ui-stack/ui-stack.html +6 -3
- package/components/ui-text/ui-text.html +12 -0
- package/dist/index.js +1 -1
- package/editor/chunks/extensions.js +55 -2
- package/editor/extensions/index.d.ts +1 -0
- package/editor/extensions/index.js +2 -2
- package/editor/extensions/preset.d.ts +2 -0
- package/editor/extensions/relative-links.d.ts +8 -0
- package/editor/icons.d.ts +4 -0
- package/editor/index.js +7 -3
- package/package.json +1 -1
- package/styles/ui-card.css +17 -0
- package/styles/ui-input-group.css +9 -0
- package/styles/ui-input.css +1 -0
- package/styles/ui-popover.css +13 -0
- package/styles/ui-scroll-area.css +10 -0
- package/styles/ui-search-result-row.css +9 -0
- package/styles/ui-stack.css +3 -0
- package/styles/ui-text.css +8 -0
- package/vanilla/UiCard.d.ts +2 -1
- package/vanilla/UiCard.js +1 -1
- package/vanilla/UiIcon.js +1 -1
- package/vanilla/UiInputGroup.d.ts +1 -0
- package/vanilla/UiInputGroup.js +1 -1
- package/vanilla/UiPopover.d.ts +1 -0
- package/vanilla/UiPopover.js +1 -1
- package/vanilla/UiScrollArea.d.ts +1 -0
- package/vanilla/UiScrollArea.js +1 -1
- package/vanilla/UiSearchResultRow.d.ts +1 -0
- package/vanilla/UiSearchResultRow.js +1 -1
- package/vanilla/UiStack.d.ts +1 -1
- package/vanilla/UiStack.js +1 -1
- package/vanilla/UiText.d.ts +2 -0
- package/vanilla/UiText.js +1 -1
- package/vue/UiCard.d.ts +12 -3
- package/vue/UiCard.vue +49 -5
- package/vue/UiIcon.vue +23 -0
- package/vue/UiInput.vue +1 -0
- package/vue/UiInputGroup.d.ts +9 -0
- package/vue/UiInputGroup.vue +33 -2
- package/vue/UiPopover.d.ts +9 -0
- package/vue/UiPopover.vue +43 -2
- package/vue/UiScrollArea.d.ts +9 -0
- package/vue/UiScrollArea.vue +35 -2
- package/vue/UiSearchResultRow.d.ts +9 -0
- package/vue/UiSearchResultRow.vue +38 -1
- package/vue/UiStack.d.ts +3 -3
- package/vue/UiStack.vue +10 -4
- package/vue/UiText.d.ts +18 -0
- package/vue/UiText.vue +70 -0
- package/vue/chunks/UiCard.js +39 -3
- package/vue/chunks/UiIcon.js +69 -1
- package/vue/chunks/UiInput.js +1 -1
- package/vue/chunks/UiInputGroup.js +59 -22
- package/vue/chunks/UiPopover.js +37 -5
- package/vue/chunks/UiScrollArea.js +66 -23
- package/vue/chunks/UiSearchResultRow.js +28 -2
- package/vue/chunks/UiStack.js +3 -2
- package/vue/chunks/UiText.js +92 -4
- package/vue/components.css +174 -301
- package/vue/editor/LoomaEditor.d.ts +11 -0
- package/vue/editor/index.js +261 -145
package/vue/UiScrollArea.d.ts
CHANGED
|
@@ -8,12 +8,21 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
8
8
|
type: PropType<"vertical" | "horizontal" | null>;
|
|
9
9
|
default: string;
|
|
10
10
|
};
|
|
11
|
+
size: {
|
|
12
|
+
type: PropType<"content" | "sm" | "md" | "lg" | null>;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
11
15
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
16
|
orientation: {
|
|
13
17
|
type: PropType<"vertical" | "horizontal" | null>;
|
|
14
18
|
default: string;
|
|
15
19
|
};
|
|
20
|
+
size: {
|
|
21
|
+
type: PropType<"content" | "sm" | "md" | "lg" | null>;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
16
24
|
}>> & Readonly<{}>, {
|
|
25
|
+
size: "sm" | "md" | "content" | "lg" | null;
|
|
17
26
|
orientation: "vertical" | "horizontal" | null;
|
|
18
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
19
28
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
package/vue/UiScrollArea.vue
CHANGED
|
@@ -18,6 +18,15 @@ const propValidityContract = {
|
|
|
18
18
|
values: ['vertical', 'horizontal'],
|
|
19
19
|
default: 'vertical',
|
|
20
20
|
},
|
|
21
|
+
size: {
|
|
22
|
+
type: { kind: 'terminal', name: 'keyword' },
|
|
23
|
+
required: false,
|
|
24
|
+
target: { attribute: 'size' },
|
|
25
|
+
description:
|
|
26
|
+
'Optional height preset. content keeps intrinsic sizing; sm fits three compact 3.125rem result rows, md is 20rem, and lg is 30rem.',
|
|
27
|
+
values: ['content', 'sm', 'md', 'lg'],
|
|
28
|
+
default: 'content',
|
|
29
|
+
},
|
|
21
30
|
},
|
|
22
31
|
} as const
|
|
23
32
|
const props = defineProps({
|
|
@@ -25,8 +34,12 @@ const props = defineProps({
|
|
|
25
34
|
type: null as unknown as PropType<'vertical' | 'horizontal' | null>,
|
|
26
35
|
default: 'vertical',
|
|
27
36
|
},
|
|
37
|
+
size: {
|
|
38
|
+
type: null as unknown as PropType<'content' | 'sm' | 'md' | 'lg' | null>,
|
|
39
|
+
default: 'content',
|
|
40
|
+
},
|
|
28
41
|
})
|
|
29
|
-
const acceptedProps: Record<string, unknown> = { orientation: 'vertical' }
|
|
42
|
+
const acceptedProps: Record<string, unknown> = { orientation: 'vertical', size: 'content' }
|
|
30
43
|
const checkedProps = computed(() => ({
|
|
31
44
|
orientation: checkedProp<'vertical' | 'horizontal'>(
|
|
32
45
|
props['orientation'],
|
|
@@ -35,6 +48,13 @@ const checkedProps = computed(() => ({
|
|
|
35
48
|
'orientation',
|
|
36
49
|
acceptedProps,
|
|
37
50
|
) as 'vertical' | 'horizontal',
|
|
51
|
+
size: checkedProp<'content' | 'sm' | 'md' | 'lg'>(
|
|
52
|
+
props['size'],
|
|
53
|
+
{ kind: 'terminal', name: 'keyword' },
|
|
54
|
+
false,
|
|
55
|
+
'size',
|
|
56
|
+
acceptedProps,
|
|
57
|
+
) as 'content' | 'sm' | 'md' | 'lg',
|
|
38
58
|
}))
|
|
39
59
|
void checkedProps.value
|
|
40
60
|
watchSyncEffect(() => {
|
|
@@ -99,6 +119,8 @@ const hostState = computed(() =>
|
|
|
99
119
|
checkedProps.value.orientation && 'orientation',
|
|
100
120
|
checkedProps.value.orientation != null
|
|
101
121
|
&& `orientation=${encodeURIComponent(checkedProps.value.orientation)}`,
|
|
122
|
+
checkedProps.value.size && 'size',
|
|
123
|
+
checkedProps.value.size != null && `size=${encodeURIComponent(checkedProps.value.size)}`,
|
|
102
124
|
].filter(Boolean).join(' ')
|
|
103
125
|
)
|
|
104
126
|
|
|
@@ -119,7 +141,7 @@ useComponentHost(() => import('../components/ui-scroll-area/ui-scroll-area.js'),
|
|
|
119
141
|
? (incoming[name] ?? incoming[kebab] ?? null)
|
|
120
142
|
: null
|
|
121
143
|
},
|
|
122
|
-
propNames: ['orientation'],
|
|
144
|
+
propNames: ['orientation', 'size'],
|
|
123
145
|
propValidity: (name: string) =>
|
|
124
146
|
propValidityState({ contract: propValidityContract, values: { ...props } }, name),
|
|
125
147
|
refs: { content: contentElement },
|
|
@@ -132,6 +154,7 @@ useComponentHost(() => import('../components/ui-scroll-area/ui-scroll-area.js'),
|
|
|
132
154
|
v-bind="nativeAttrs($attrs)"
|
|
133
155
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
134
156
|
:data-orientation="reflectedProp('orientation', 'orientation', checkedProps.orientation, undefined, false)"
|
|
157
|
+
:data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
|
|
135
158
|
:data-ui-scroll-area-state="hostState || undefined"
|
|
136
159
|
ref="root"
|
|
137
160
|
>
|
|
@@ -177,6 +200,16 @@ useComponentHost(() => import('../components/ui-scroll-area/ui-scroll-area.js'),
|
|
|
177
200
|
--_ui-scroll-fade-inline: to left;
|
|
178
201
|
}
|
|
179
202
|
|
|
203
|
+
[data-component~="ui-scroll-area"][data-ui-scroll-area-state~="size=sm"] {
|
|
204
|
+
max-block-size: 9.375rem;
|
|
205
|
+
}
|
|
206
|
+
[data-component~="ui-scroll-area"][data-ui-scroll-area-state~="size=md"] {
|
|
207
|
+
max-block-size: 20rem;
|
|
208
|
+
}
|
|
209
|
+
[data-component~="ui-scroll-area"][data-ui-scroll-area-state~="size=lg"] {
|
|
210
|
+
max-block-size: 30rem;
|
|
211
|
+
}
|
|
212
|
+
|
|
180
213
|
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
181
214
|
[data-component~="ui-scroll-area"][hidden] {
|
|
182
215
|
display: none;
|
|
@@ -12,6 +12,10 @@ type __VLS_Slots = {} & {
|
|
|
12
12
|
trailing?: (props: typeof __VLS_9) => any;
|
|
13
13
|
};
|
|
14
14
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
15
|
+
density: {
|
|
16
|
+
type: PropType<"comfortable" | "compact" | null>;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
15
19
|
disabled: {
|
|
16
20
|
type: PropType<boolean | null>;
|
|
17
21
|
default: boolean;
|
|
@@ -21,6 +25,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
21
25
|
default: boolean;
|
|
22
26
|
};
|
|
23
27
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
density: {
|
|
29
|
+
type: PropType<"comfortable" | "compact" | null>;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
24
32
|
disabled: {
|
|
25
33
|
type: PropType<boolean | null>;
|
|
26
34
|
default: boolean;
|
|
@@ -32,6 +40,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
32
40
|
}>> & Readonly<{}>, {
|
|
33
41
|
selected: boolean | null;
|
|
34
42
|
disabled: boolean | null;
|
|
43
|
+
density: "comfortable" | "compact" | null;
|
|
35
44
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
36
45
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
37
46
|
declare const _default: typeof __VLS_export;
|
|
@@ -8,6 +8,15 @@ defineOptions({ inheritAttrs: false })
|
|
|
8
8
|
|
|
9
9
|
const propValidityContract = {
|
|
10
10
|
props: {
|
|
11
|
+
density: {
|
|
12
|
+
type: { kind: 'terminal', name: 'keyword' },
|
|
13
|
+
required: false,
|
|
14
|
+
target: { attribute: 'density' },
|
|
15
|
+
description:
|
|
16
|
+
'Compact keeps a title and location together in a 3.125rem row for small destination pickers; comfortable preserves the existing rich result spacing.',
|
|
17
|
+
values: ['comfortable', 'compact'],
|
|
18
|
+
default: 'comfortable',
|
|
19
|
+
},
|
|
11
20
|
disabled: {
|
|
12
21
|
type: { kind: 'terminal', name: 'boolean' },
|
|
13
22
|
required: false,
|
|
@@ -27,11 +36,26 @@ const propValidityContract = {
|
|
|
27
36
|
},
|
|
28
37
|
} as const
|
|
29
38
|
const props = defineProps({
|
|
39
|
+
density: {
|
|
40
|
+
type: null as unknown as PropType<'comfortable' | 'compact' | null>,
|
|
41
|
+
default: 'comfortable',
|
|
42
|
+
},
|
|
30
43
|
disabled: { type: null as unknown as PropType<boolean | null>, default: false },
|
|
31
44
|
selected: { type: null as unknown as PropType<boolean | null>, default: false },
|
|
32
45
|
})
|
|
33
|
-
const acceptedProps: Record<string, unknown> = {
|
|
46
|
+
const acceptedProps: Record<string, unknown> = {
|
|
47
|
+
density: 'comfortable',
|
|
48
|
+
disabled: false,
|
|
49
|
+
selected: false,
|
|
50
|
+
}
|
|
34
51
|
const checkedProps = computed(() => ({
|
|
52
|
+
density: checkedProp<'comfortable' | 'compact'>(
|
|
53
|
+
props['density'],
|
|
54
|
+
{ kind: 'terminal', name: 'keyword' },
|
|
55
|
+
false,
|
|
56
|
+
'density',
|
|
57
|
+
acceptedProps,
|
|
58
|
+
) as 'comfortable' | 'compact',
|
|
35
59
|
disabled: checkedProp<boolean>(
|
|
36
60
|
props['disabled'],
|
|
37
61
|
{ kind: 'terminal', name: 'boolean' },
|
|
@@ -105,6 +129,9 @@ if (
|
|
|
105
129
|
/** The values the styles' :host-state() rules test. */
|
|
106
130
|
const hostState = computed(() =>
|
|
107
131
|
[
|
|
132
|
+
checkedProps.value.density && 'density',
|
|
133
|
+
checkedProps.value.density != null
|
|
134
|
+
&& `density=${encodeURIComponent(checkedProps.value.density)}`,
|
|
108
135
|
checkedProps.value.selected && 'selected',
|
|
109
136
|
].filter(Boolean).join(' ')
|
|
110
137
|
)
|
|
@@ -118,6 +145,7 @@ const hostState = computed(() =>
|
|
|
118
145
|
:disabled="checkedProps.disabled ?? undefined"
|
|
119
146
|
:aria-current="checkedProps.selected ?? undefined"
|
|
120
147
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
148
|
+
:data-density="reflectedProp('density', 'density', checkedProps.density, undefined, false)"
|
|
121
149
|
:data-disabled="reflectedProp('disabled', 'disabled', checkedProps.disabled, undefined, false)"
|
|
122
150
|
:data-selected="reflectedProp('selected', 'selected', checkedProps.selected, undefined, false)"
|
|
123
151
|
:data-ui-search-result-row-state="hostState || undefined"
|
|
@@ -184,6 +212,15 @@ const hostState = computed(() =>
|
|
|
184
212
|
transition: background-color var(--ui-motion-fast) var(--ui-motion-ease);
|
|
185
213
|
}
|
|
186
214
|
|
|
215
|
+
[data-component~="ui-search-result-row"][data-ui-search-result-row-state~="density=compact"] {
|
|
216
|
+
min-block-size: var(--ui-search-result-row-min-height, 3.125rem);
|
|
217
|
+
padding-block: var(--ui-search-result-row-padding-block, var(--ui-space-1));
|
|
218
|
+
padding-inline: var(--ui-search-result-row-padding-inline, var(--ui-space-2));
|
|
219
|
+
gap: var(--ui-search-result-row-gap, var(--ui-space-2));
|
|
220
|
+
align-items: center;
|
|
221
|
+
font-family: var(--ui-font-family-sans, sans-serif);
|
|
222
|
+
}
|
|
223
|
+
|
|
187
224
|
[data-component~="ui-search-result-row"]:hover:enabled {
|
|
188
225
|
background: var(
|
|
189
226
|
--ui-search-result-row-hover-surface,
|
package/vue/UiStack.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
9
9
|
default: null;
|
|
10
10
|
};
|
|
11
11
|
gap: {
|
|
12
|
-
type: PropType<"xs" | "s" | "m" | "l" | "xl" | null>;
|
|
12
|
+
type: PropType<"none" | "xs" | "s" | "m" | "l" | "xl" | null>;
|
|
13
13
|
default: null;
|
|
14
14
|
};
|
|
15
15
|
justify: {
|
|
@@ -22,7 +22,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
22
22
|
default: null;
|
|
23
23
|
};
|
|
24
24
|
gap: {
|
|
25
|
-
type: PropType<"xs" | "s" | "m" | "l" | "xl" | null>;
|
|
25
|
+
type: PropType<"none" | "xs" | "s" | "m" | "l" | "xl" | null>;
|
|
26
26
|
default: null;
|
|
27
27
|
};
|
|
28
28
|
justify: {
|
|
@@ -31,7 +31,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
31
31
|
};
|
|
32
32
|
}>> & Readonly<{}>, {
|
|
33
33
|
align: "center" | "start" | "stretch" | "end" | null;
|
|
34
|
-
gap: "s" | "xs" | "m" | "l" | "xl" | null;
|
|
34
|
+
gap: "s" | "none" | "xs" | "m" | "l" | "xl" | null;
|
|
35
35
|
justify: "center" | "start" | "end" | "between" | null;
|
|
36
36
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
37
37
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
package/vue/UiStack.vue
CHANGED
|
@@ -21,8 +21,8 @@ const propValidityContract = {
|
|
|
21
21
|
required: false,
|
|
22
22
|
target: { attribute: 'gap' },
|
|
23
23
|
description:
|
|
24
|
-
'Space between items, on the spacing scale: xs is 0.5rem, s 0.75rem, m 1rem (also the default), l 1.5rem, and xl 2rem. The --ui-stack-gap
|
|
25
|
-
values: ['xs', 's', 'm', 'l', 'xl'],
|
|
24
|
+
'Space between items, on the spacing scale: none is zero, xs is 0.5rem, s 0.75rem, m 1rem (also the default), l 1.5rem, and xl 2rem. The --ui-stack-gap\n custom property, set on the stack itself, overrides it; set on an ancestor, it does nothing.',
|
|
25
|
+
values: ['none', 'xs', 's', 'm', 'l', 'xl'],
|
|
26
26
|
},
|
|
27
27
|
justify: {
|
|
28
28
|
type: { kind: 'terminal', name: 'keyword' },
|
|
@@ -39,7 +39,10 @@ const props = defineProps({
|
|
|
39
39
|
type: null as unknown as PropType<'start' | 'center' | 'end' | 'stretch' | null>,
|
|
40
40
|
default: null,
|
|
41
41
|
},
|
|
42
|
-
gap: {
|
|
42
|
+
gap: {
|
|
43
|
+
type: null as unknown as PropType<'none' | 'xs' | 's' | 'm' | 'l' | 'xl' | null>,
|
|
44
|
+
default: null,
|
|
45
|
+
},
|
|
43
46
|
justify: {
|
|
44
47
|
type: null as unknown as PropType<'start' | 'center' | 'end' | 'between' | null>,
|
|
45
48
|
default: null,
|
|
@@ -54,7 +57,7 @@ const checkedProps = computed(() => ({
|
|
|
54
57
|
'align',
|
|
55
58
|
acceptedProps,
|
|
56
59
|
),
|
|
57
|
-
gap: checkedProp<'xs' | 's' | 'm' | 'l' | 'xl'>(
|
|
60
|
+
gap: checkedProp<'none' | 'xs' | 's' | 'm' | 'l' | 'xl'>(
|
|
58
61
|
props['gap'],
|
|
59
62
|
{ kind: 'terminal', name: 'keyword' },
|
|
60
63
|
false,
|
|
@@ -167,6 +170,9 @@ const hostState = computed(() =>
|
|
|
167
170
|
margin: 0;
|
|
168
171
|
}
|
|
169
172
|
|
|
173
|
+
[data-component~="ui-stack"][data-ui-stack-state~="gap=none"] {
|
|
174
|
+
--_layout-gap: 0px;
|
|
175
|
+
}
|
|
170
176
|
[data-component~="ui-stack"][data-ui-stack-state~="gap=xs"] {
|
|
171
177
|
--_layout-gap: var(--ui-space-2);
|
|
172
178
|
}
|
package/vue/UiText.d.ts
CHANGED
|
@@ -32,6 +32,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
32
32
|
type: PropType<"p" | "span" | "div" | "small" | "strong" | "label" | "h2" | "h3" | "h4" | "h5" | "h6" | null>;
|
|
33
33
|
default: string;
|
|
34
34
|
};
|
|
35
|
+
font: {
|
|
36
|
+
type: PropType<"inherit" | "sans" | null>;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
35
39
|
size: {
|
|
36
40
|
type: PropType<"inherit" | "xs" | "sm" | "md" | "lg" | null>;
|
|
37
41
|
default: string;
|
|
@@ -52,6 +56,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
52
56
|
type: PropType<"inherit" | "normal" | "medium" | "semibold" | null>;
|
|
53
57
|
default: string;
|
|
54
58
|
};
|
|
59
|
+
wrap: {
|
|
60
|
+
type: PropType<"normal" | "anywhere" | null>;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
55
63
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
56
64
|
align: {
|
|
57
65
|
type: PropType<"start" | "center" | null>;
|
|
@@ -61,6 +69,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
61
69
|
type: PropType<"p" | "span" | "div" | "small" | "strong" | "label" | "h2" | "h3" | "h4" | "h5" | "h6" | null>;
|
|
62
70
|
default: string;
|
|
63
71
|
};
|
|
72
|
+
font: {
|
|
73
|
+
type: PropType<"inherit" | "sans" | null>;
|
|
74
|
+
default: string;
|
|
75
|
+
};
|
|
64
76
|
size: {
|
|
65
77
|
type: PropType<"inherit" | "xs" | "sm" | "md" | "lg" | null>;
|
|
66
78
|
default: string;
|
|
@@ -81,12 +93,18 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
81
93
|
type: PropType<"inherit" | "normal" | "medium" | "semibold" | null>;
|
|
82
94
|
default: string;
|
|
83
95
|
};
|
|
96
|
+
wrap: {
|
|
97
|
+
type: PropType<"normal" | "anywhere" | null>;
|
|
98
|
+
default: string;
|
|
99
|
+
};
|
|
84
100
|
}>> & Readonly<{}>, {
|
|
101
|
+
font: "inherit" | "sans" | null;
|
|
85
102
|
size: "inherit" | "xs" | "sm" | "md" | "lg" | null;
|
|
86
103
|
tone: "secondary" | "default" | "info" | "accent" | "success" | "warning" | "danger" | "muted" | null;
|
|
87
104
|
variant: "code" | "body" | "eyebrow" | null;
|
|
88
105
|
align: "center" | "start" | null;
|
|
89
106
|
as: "div" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "p" | "small" | "span" | "strong" | null;
|
|
107
|
+
wrap: "normal" | "anywhere" | null;
|
|
90
108
|
truncate: boolean | null;
|
|
91
109
|
weight: "inherit" | "normal" | "medium" | "semibold" | null;
|
|
92
110
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
package/vue/UiText.vue
CHANGED
|
@@ -26,6 +26,15 @@ const propValidityContract = {
|
|
|
26
26
|
values: ['p', 'span', 'div', 'small', 'strong', 'label', 'h2', 'h3', 'h4', 'h5', 'h6'],
|
|
27
27
|
default: 'p',
|
|
28
28
|
},
|
|
29
|
+
font: {
|
|
30
|
+
type: { kind: 'terminal', name: 'keyword' },
|
|
31
|
+
required: false,
|
|
32
|
+
target: { attribute: 'font' },
|
|
33
|
+
description:
|
|
34
|
+
'Use sans for UI text rendered outside its original font context; inherit preserves the surrounding typeface.',
|
|
35
|
+
values: ['inherit', 'sans'],
|
|
36
|
+
default: 'inherit',
|
|
37
|
+
},
|
|
29
38
|
size: {
|
|
30
39
|
type: { kind: 'terminal', name: 'keyword' },
|
|
31
40
|
required: false,
|
|
@@ -69,6 +78,15 @@ const propValidityContract = {
|
|
|
69
78
|
values: ['inherit', 'normal', 'medium', 'semibold'],
|
|
70
79
|
default: 'inherit',
|
|
71
80
|
},
|
|
81
|
+
wrap: {
|
|
82
|
+
type: { kind: 'terminal', name: 'keyword' },
|
|
83
|
+
required: false,
|
|
84
|
+
target: { attribute: 'wrap' },
|
|
85
|
+
description:
|
|
86
|
+
'Use anywhere for unbroken values such as long destinations; ordinary prose keeps its normal wrapping.',
|
|
87
|
+
values: ['normal', 'anywhere'],
|
|
88
|
+
default: 'normal',
|
|
89
|
+
},
|
|
72
90
|
},
|
|
73
91
|
} as const
|
|
74
92
|
const props = defineProps({
|
|
@@ -79,6 +97,7 @@ const props = defineProps({
|
|
|
79
97
|
>,
|
|
80
98
|
default: 'p',
|
|
81
99
|
},
|
|
100
|
+
font: { type: null as unknown as PropType<'inherit' | 'sans' | null>, default: 'inherit' },
|
|
82
101
|
size: {
|
|
83
102
|
type: null as unknown as PropType<'inherit' | 'xs' | 'sm' | 'md' | 'lg' | null>,
|
|
84
103
|
default: 'inherit',
|
|
@@ -106,15 +125,18 @@ const props = defineProps({
|
|
|
106
125
|
type: null as unknown as PropType<'inherit' | 'normal' | 'medium' | 'semibold' | null>,
|
|
107
126
|
default: 'inherit',
|
|
108
127
|
},
|
|
128
|
+
wrap: { type: null as unknown as PropType<'normal' | 'anywhere' | null>, default: 'normal' },
|
|
109
129
|
})
|
|
110
130
|
const acceptedProps: Record<string, unknown> = {
|
|
111
131
|
align: 'start',
|
|
112
132
|
as: 'p',
|
|
133
|
+
font: 'inherit',
|
|
113
134
|
size: 'inherit',
|
|
114
135
|
tone: 'default',
|
|
115
136
|
truncate: false,
|
|
116
137
|
variant: 'body',
|
|
117
138
|
weight: 'inherit',
|
|
139
|
+
wrap: 'normal',
|
|
118
140
|
}
|
|
119
141
|
const checkedProps = computed(() => ({
|
|
120
142
|
align: checkedProp<'start' | 'center'>(
|
|
@@ -138,6 +160,13 @@ const checkedProps = computed(() => ({
|
|
|
138
160
|
| 'h4'
|
|
139
161
|
| 'h5'
|
|
140
162
|
| 'h6',
|
|
163
|
+
font: checkedProp<'inherit' | 'sans'>(
|
|
164
|
+
props['font'],
|
|
165
|
+
{ kind: 'terminal', name: 'keyword' },
|
|
166
|
+
false,
|
|
167
|
+
'font',
|
|
168
|
+
acceptedProps,
|
|
169
|
+
) as 'inherit' | 'sans',
|
|
141
170
|
size: checkedProp<'inherit' | 'xs' | 'sm' | 'md' | 'lg'>(
|
|
142
171
|
props['size'],
|
|
143
172
|
{ kind: 'terminal', name: 'keyword' },
|
|
@@ -177,6 +206,13 @@ const checkedProps = computed(() => ({
|
|
|
177
206
|
'weight',
|
|
178
207
|
acceptedProps,
|
|
179
208
|
) as 'inherit' | 'normal' | 'medium' | 'semibold',
|
|
209
|
+
wrap: checkedProp<'normal' | 'anywhere'>(
|
|
210
|
+
props['wrap'],
|
|
211
|
+
{ kind: 'terminal', name: 'keyword' },
|
|
212
|
+
false,
|
|
213
|
+
'wrap',
|
|
214
|
+
acceptedProps,
|
|
215
|
+
) as 'normal' | 'anywhere',
|
|
180
216
|
}))
|
|
181
217
|
void checkedProps.value
|
|
182
218
|
watchSyncEffect(() => {
|
|
@@ -267,6 +303,10 @@ const hostState = computed(() =>
|
|
|
267
303
|
checkedProps.value.truncate && 'truncate',
|
|
268
304
|
checkedProps.value.align && 'align',
|
|
269
305
|
checkedProps.value.align != null && `align=${encodeURIComponent(checkedProps.value.align)}`,
|
|
306
|
+
checkedProps.value.font && 'font',
|
|
307
|
+
checkedProps.value.font != null && `font=${encodeURIComponent(checkedProps.value.font)}`,
|
|
308
|
+
checkedProps.value.wrap && 'wrap',
|
|
309
|
+
checkedProps.value.wrap != null && `wrap=${encodeURIComponent(checkedProps.value.wrap)}`,
|
|
270
310
|
].filter(Boolean).join(' ')
|
|
271
311
|
)
|
|
272
312
|
</script>
|
|
@@ -279,11 +319,13 @@ const hostState = computed(() =>
|
|
|
279
319
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
280
320
|
:data-align="reflectedProp('align', 'align', checkedProps.align, undefined, false)"
|
|
281
321
|
:data-as="reflectedProp('as', 'as', checkedProps.as, undefined, false)"
|
|
322
|
+
:data-font="reflectedProp('font', 'font', checkedProps.font, undefined, false)"
|
|
282
323
|
:data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
|
|
283
324
|
:data-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
|
|
284
325
|
:data-truncate="reflectedProp('truncate', 'truncate', checkedProps.truncate, undefined, false)"
|
|
285
326
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
286
327
|
:data-weight="reflectedProp('weight', 'weight', checkedProps.weight, undefined, false)"
|
|
328
|
+
:data-wrap="reflectedProp('wrap', 'wrap', checkedProps.wrap, undefined, false)"
|
|
287
329
|
:data-ui-text-state="hostState || undefined"
|
|
288
330
|
ref="@html-next/root"
|
|
289
331
|
><slot /></span>
|
|
@@ -294,11 +336,13 @@ const hostState = computed(() =>
|
|
|
294
336
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
295
337
|
:data-align="reflectedProp('align', 'align', checkedProps.align, undefined, false)"
|
|
296
338
|
:data-as="reflectedProp('as', 'as', checkedProps.as, undefined, false)"
|
|
339
|
+
:data-font="reflectedProp('font', 'font', checkedProps.font, undefined, false)"
|
|
297
340
|
:data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
|
|
298
341
|
:data-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
|
|
299
342
|
:data-truncate="reflectedProp('truncate', 'truncate', checkedProps.truncate, undefined, false)"
|
|
300
343
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
301
344
|
:data-weight="reflectedProp('weight', 'weight', checkedProps.weight, undefined, false)"
|
|
345
|
+
:data-wrap="reflectedProp('wrap', 'wrap', checkedProps.wrap, undefined, false)"
|
|
302
346
|
:data-ui-text-state="hostState || undefined"
|
|
303
347
|
ref="@html-next/root"
|
|
304
348
|
>
|
|
@@ -311,11 +355,13 @@ const hostState = computed(() =>
|
|
|
311
355
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
312
356
|
:data-align="reflectedProp('align', 'align', checkedProps.align, undefined, false)"
|
|
313
357
|
:data-as="reflectedProp('as', 'as', checkedProps.as, undefined, false)"
|
|
358
|
+
:data-font="reflectedProp('font', 'font', checkedProps.font, undefined, false)"
|
|
314
359
|
:data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
|
|
315
360
|
:data-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
|
|
316
361
|
:data-truncate="reflectedProp('truncate', 'truncate', checkedProps.truncate, undefined, false)"
|
|
317
362
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
318
363
|
:data-weight="reflectedProp('weight', 'weight', checkedProps.weight, undefined, false)"
|
|
364
|
+
:data-wrap="reflectedProp('wrap', 'wrap', checkedProps.wrap, undefined, false)"
|
|
319
365
|
:data-ui-text-state="hostState || undefined"
|
|
320
366
|
ref="@html-next/root"
|
|
321
367
|
><slot /></small>
|
|
@@ -326,11 +372,13 @@ const hostState = computed(() =>
|
|
|
326
372
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
327
373
|
:data-align="reflectedProp('align', 'align', checkedProps.align, undefined, false)"
|
|
328
374
|
:data-as="reflectedProp('as', 'as', checkedProps.as, undefined, false)"
|
|
375
|
+
:data-font="reflectedProp('font', 'font', checkedProps.font, undefined, false)"
|
|
329
376
|
:data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
|
|
330
377
|
:data-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
|
|
331
378
|
:data-truncate="reflectedProp('truncate', 'truncate', checkedProps.truncate, undefined, false)"
|
|
332
379
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
333
380
|
:data-weight="reflectedProp('weight', 'weight', checkedProps.weight, undefined, false)"
|
|
381
|
+
:data-wrap="reflectedProp('wrap', 'wrap', checkedProps.wrap, undefined, false)"
|
|
334
382
|
:data-ui-text-state="hostState || undefined"
|
|
335
383
|
ref="@html-next/root"
|
|
336
384
|
><slot /></strong>
|
|
@@ -341,11 +389,13 @@ const hostState = computed(() =>
|
|
|
341
389
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
342
390
|
:data-align="reflectedProp('align', 'align', checkedProps.align, undefined, false)"
|
|
343
391
|
:data-as="reflectedProp('as', 'as', checkedProps.as, undefined, false)"
|
|
392
|
+
:data-font="reflectedProp('font', 'font', checkedProps.font, undefined, false)"
|
|
344
393
|
:data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
|
|
345
394
|
:data-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
|
|
346
395
|
:data-truncate="reflectedProp('truncate', 'truncate', checkedProps.truncate, undefined, false)"
|
|
347
396
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
348
397
|
:data-weight="reflectedProp('weight', 'weight', checkedProps.weight, undefined, false)"
|
|
398
|
+
:data-wrap="reflectedProp('wrap', 'wrap', checkedProps.wrap, undefined, false)"
|
|
349
399
|
:data-ui-text-state="hostState || undefined"
|
|
350
400
|
ref="@html-next/root"
|
|
351
401
|
><slot /></label>
|
|
@@ -356,11 +406,13 @@ const hostState = computed(() =>
|
|
|
356
406
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
357
407
|
:data-align="reflectedProp('align', 'align', checkedProps.align, undefined, false)"
|
|
358
408
|
:data-as="reflectedProp('as', 'as', checkedProps.as, undefined, false)"
|
|
409
|
+
:data-font="reflectedProp('font', 'font', checkedProps.font, undefined, false)"
|
|
359
410
|
:data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
|
|
360
411
|
:data-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
|
|
361
412
|
:data-truncate="reflectedProp('truncate', 'truncate', checkedProps.truncate, undefined, false)"
|
|
362
413
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
363
414
|
:data-weight="reflectedProp('weight', 'weight', checkedProps.weight, undefined, false)"
|
|
415
|
+
:data-wrap="reflectedProp('wrap', 'wrap', checkedProps.wrap, undefined, false)"
|
|
364
416
|
:data-ui-text-state="hostState || undefined"
|
|
365
417
|
ref="@html-next/root"
|
|
366
418
|
>
|
|
@@ -373,11 +425,13 @@ const hostState = computed(() =>
|
|
|
373
425
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
374
426
|
:data-align="reflectedProp('align', 'align', checkedProps.align, undefined, false)"
|
|
375
427
|
:data-as="reflectedProp('as', 'as', checkedProps.as, undefined, false)"
|
|
428
|
+
:data-font="reflectedProp('font', 'font', checkedProps.font, undefined, false)"
|
|
376
429
|
:data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
|
|
377
430
|
:data-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
|
|
378
431
|
:data-truncate="reflectedProp('truncate', 'truncate', checkedProps.truncate, undefined, false)"
|
|
379
432
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
380
433
|
:data-weight="reflectedProp('weight', 'weight', checkedProps.weight, undefined, false)"
|
|
434
|
+
:data-wrap="reflectedProp('wrap', 'wrap', checkedProps.wrap, undefined, false)"
|
|
381
435
|
:data-ui-text-state="hostState || undefined"
|
|
382
436
|
ref="@html-next/root"
|
|
383
437
|
>
|
|
@@ -390,11 +444,13 @@ const hostState = computed(() =>
|
|
|
390
444
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
391
445
|
:data-align="reflectedProp('align', 'align', checkedProps.align, undefined, false)"
|
|
392
446
|
:data-as="reflectedProp('as', 'as', checkedProps.as, undefined, false)"
|
|
447
|
+
:data-font="reflectedProp('font', 'font', checkedProps.font, undefined, false)"
|
|
393
448
|
:data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
|
|
394
449
|
:data-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
|
|
395
450
|
:data-truncate="reflectedProp('truncate', 'truncate', checkedProps.truncate, undefined, false)"
|
|
396
451
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
397
452
|
:data-weight="reflectedProp('weight', 'weight', checkedProps.weight, undefined, false)"
|
|
453
|
+
:data-wrap="reflectedProp('wrap', 'wrap', checkedProps.wrap, undefined, false)"
|
|
398
454
|
:data-ui-text-state="hostState || undefined"
|
|
399
455
|
ref="@html-next/root"
|
|
400
456
|
>
|
|
@@ -407,11 +463,13 @@ const hostState = computed(() =>
|
|
|
407
463
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
408
464
|
:data-align="reflectedProp('align', 'align', checkedProps.align, undefined, false)"
|
|
409
465
|
:data-as="reflectedProp('as', 'as', checkedProps.as, undefined, false)"
|
|
466
|
+
:data-font="reflectedProp('font', 'font', checkedProps.font, undefined, false)"
|
|
410
467
|
:data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
|
|
411
468
|
:data-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
|
|
412
469
|
:data-truncate="reflectedProp('truncate', 'truncate', checkedProps.truncate, undefined, false)"
|
|
413
470
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
414
471
|
:data-weight="reflectedProp('weight', 'weight', checkedProps.weight, undefined, false)"
|
|
472
|
+
:data-wrap="reflectedProp('wrap', 'wrap', checkedProps.wrap, undefined, false)"
|
|
415
473
|
:data-ui-text-state="hostState || undefined"
|
|
416
474
|
ref="@html-next/root"
|
|
417
475
|
>
|
|
@@ -424,11 +482,13 @@ const hostState = computed(() =>
|
|
|
424
482
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
425
483
|
:data-align="reflectedProp('align', 'align', checkedProps.align, undefined, false)"
|
|
426
484
|
:data-as="reflectedProp('as', 'as', checkedProps.as, undefined, false)"
|
|
485
|
+
:data-font="reflectedProp('font', 'font', checkedProps.font, undefined, false)"
|
|
427
486
|
:data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
|
|
428
487
|
:data-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
|
|
429
488
|
:data-truncate="reflectedProp('truncate', 'truncate', checkedProps.truncate, undefined, false)"
|
|
430
489
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
431
490
|
:data-weight="reflectedProp('weight', 'weight', checkedProps.weight, undefined, false)"
|
|
491
|
+
:data-wrap="reflectedProp('wrap', 'wrap', checkedProps.wrap, undefined, false)"
|
|
432
492
|
:data-ui-text-state="hostState || undefined"
|
|
433
493
|
ref="@html-next/root"
|
|
434
494
|
>
|
|
@@ -441,11 +501,13 @@ const hostState = computed(() =>
|
|
|
441
501
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
442
502
|
:data-align="reflectedProp('align', 'align', checkedProps.align, undefined, false)"
|
|
443
503
|
:data-as="reflectedProp('as', 'as', checkedProps.as, undefined, false)"
|
|
504
|
+
:data-font="reflectedProp('font', 'font', checkedProps.font, undefined, false)"
|
|
444
505
|
:data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
|
|
445
506
|
:data-tone="reflectedProp('tone', 'tone', checkedProps.tone, undefined, false)"
|
|
446
507
|
:data-truncate="reflectedProp('truncate', 'truncate', checkedProps.truncate, undefined, false)"
|
|
447
508
|
:data-variant="reflectedProp('variant', 'variant', checkedProps.variant, undefined, false)"
|
|
448
509
|
:data-weight="reflectedProp('weight', 'weight', checkedProps.weight, undefined, false)"
|
|
510
|
+
:data-wrap="reflectedProp('wrap', 'wrap', checkedProps.wrap, undefined, false)"
|
|
449
511
|
:data-ui-text-state="hostState || undefined"
|
|
450
512
|
ref="@html-next/root"
|
|
451
513
|
>
|
|
@@ -551,6 +613,14 @@ const hostState = computed(() =>
|
|
|
551
613
|
text-align: center;
|
|
552
614
|
}
|
|
553
615
|
|
|
616
|
+
[data-component~="ui-text"][data-ui-text-state~="font=sans"] {
|
|
617
|
+
font-family: var(--ui-font-family-sans, sans-serif);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
[data-component~="ui-text"][data-ui-text-state~="wrap=anywhere"] {
|
|
621
|
+
overflow-wrap: anywhere;
|
|
622
|
+
}
|
|
623
|
+
|
|
554
624
|
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
555
625
|
[data-component~="ui-text"][hidden] {
|
|
556
626
|
display: none;
|