@threadlabs/looma 0.11.5 → 0.12.0
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/describe.js +9 -0
- package/components/ui-button/ui-button.html +12 -24
- package/components/ui-checkbox/ui-checkbox.html +22 -1
- package/components/ui-checkbox/ui-checkbox.js +2 -0
- package/components/ui-icon-button/ui-icon-button.html +4 -14
- package/components/ui-radio/ui-radio.html +22 -1
- package/components/ui-radio/ui-radio.js +2 -0
- package/components/ui-sidebar/ui-sidebar.js +3 -1
- package/components/ui-switch/ui-switch.html +22 -1
- package/components/ui-switch/ui-switch.js +2 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-button.css +21 -33
- package/styles/ui-checkbox.css +21 -1
- package/styles/ui-icon-button.css +4 -13
- package/styles/ui-radio.css +21 -1
- package/styles/ui-switch.css +21 -1
- package/theme-dark.css +2 -0
- package/theme-high-contrast.css +3 -0
- package/tokens.css +3 -0
- package/vanilla/UiCheckbox.js +18 -3
- package/vanilla/UiRadio.js +18 -3
- package/vanilla/UiSwitch.js +18 -3
- package/vue/UiButton.vue +14 -24
- package/vue/UiCheckbox.d.ts +3 -1
- package/vue/UiCheckbox.vue +24 -2
- package/vue/UiIconButton.vue +3 -13
- package/vue/UiRadio.d.ts +3 -1
- package/vue/UiRadio.vue +24 -2
- package/vue/UiSwitch.d.ts +3 -1
- package/vue/UiSwitch.vue +24 -2
- package/vue/chunks/UiButton.js +1 -1
- package/vue/chunks/UiCheckbox.js +14 -4
- package/vue/chunks/UiIconButton.js +1 -1
- package/vue/chunks/UiRadio.js +14 -4
- package/vue/chunks/UiSwitch.js +14 -4
- package/vue/components.css +156 -126
package/vue/UiIconButton.vue
CHANGED
|
@@ -221,22 +221,12 @@ html[data-ui-input-modality="touch"] [data-component~="ui-icon-button"]::after {
|
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
/* Disabled colours fall back to each variant's own; ghost takes only the icon colour. */
|
|
224
|
+
/* Disabled washes the button out the way Button does: the same shape, one filter. */
|
|
224
225
|
[data-component~="ui-icon-button"]:disabled {
|
|
226
|
+
filter: var(--ui-icon-button-disabled-filter, var(--ui-disabled-filter));
|
|
225
227
|
opacity: var(--ui-icon-button-disabled-opacity, 1);
|
|
226
|
-
color: var(--ui-icon-button-disabled-text, var(--ui-disabled-text));
|
|
227
228
|
cursor: not-allowed;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
[data-component~="ui-icon-button"][data-ui-icon-button-state~="variant=outline"]:disabled {
|
|
231
|
-
border-color: var(--ui-icon-button-disabled-border, var(--ui-border));
|
|
232
|
-
background-color: var(--ui-icon-button-disabled-surface, var(--ui-disabled-surface));
|
|
233
|
-
color: var(--ui-icon-button-disabled-text, var(--ui-disabled-text));
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
[data-component~="ui-icon-button"][data-ui-icon-button-state~="variant=solid"]:disabled {
|
|
237
|
-
border-color: var(--ui-icon-button-disabled-border, var(--ui-border));
|
|
238
|
-
background-color: var(--ui-icon-button-disabled-surface, var(--ui-disabled-surface));
|
|
239
|
-
color: var(--ui-icon-button-disabled-text, var(--ui-disabled-text));
|
|
229
|
+
box-shadow: none;
|
|
240
230
|
}
|
|
241
231
|
|
|
242
232
|
[data-component~="ui-icon-button"] {
|
package/vue/UiRadio.d.ts
CHANGED
|
@@ -5,9 +5,11 @@ type __VLS_Props = {
|
|
|
5
5
|
required?: boolean;
|
|
6
6
|
value?: string;
|
|
7
7
|
};
|
|
8
|
-
declare var __VLS_1: {};
|
|
8
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
10
|
default?: (props: typeof __VLS_1) => any;
|
|
11
|
+
} & {
|
|
12
|
+
description?: (props: typeof __VLS_3) => any;
|
|
11
13
|
};
|
|
12
14
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
15
|
change: (detail: {
|
package/vue/UiRadio.vue
CHANGED
|
@@ -36,6 +36,7 @@ const emit = defineEmits<{
|
|
|
36
36
|
|
|
37
37
|
const root = ref<HTMLElement | null>(null)
|
|
38
38
|
const inputElement = useTemplateRef<HTMLElement>('input')
|
|
39
|
+
const descriptionElement = useTemplateRef<HTMLElement>('description')
|
|
39
40
|
const internalChecked = ref(false)
|
|
40
41
|
|
|
41
42
|
/** The values the styles' :host-state() rules test. */
|
|
@@ -64,7 +65,7 @@ useComponentHost(controllerModule.default, {
|
|
|
64
65
|
root,
|
|
65
66
|
dispatch,
|
|
66
67
|
props,
|
|
67
|
-
refs: { input: inputElement },
|
|
68
|
+
refs: { input: inputElement, description: descriptionElement },
|
|
68
69
|
state: { internalChecked },
|
|
69
70
|
})
|
|
70
71
|
</script>
|
|
@@ -84,7 +85,10 @@ useComponentHost(controllerModule.default, {
|
|
|
84
85
|
:name="name"
|
|
85
86
|
ref="input"
|
|
86
87
|
>
|
|
87
|
-
<span class="label"><slot /></span
|
|
88
|
+
<span class="text"><span class="label"><slot /></span>
|
|
89
|
+
<span class="description" aria-hidden="true" ref="description"><slot
|
|
90
|
+
name="description"
|
|
91
|
+
/></span></span></label>
|
|
88
92
|
</template>
|
|
89
93
|
|
|
90
94
|
<style scoped>
|
|
@@ -97,11 +101,29 @@ useComponentHost(controllerModule.default, {
|
|
|
97
101
|
cursor: pointer;
|
|
98
102
|
}
|
|
99
103
|
|
|
104
|
+
/* The label, and under it an optional line saying what the choice means. */
|
|
105
|
+
.text {
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
gap: var(--ui-space-1);
|
|
109
|
+
min-inline-size: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
100
112
|
.label {
|
|
101
113
|
min-inline-size: 0;
|
|
102
114
|
line-height: var(--ui-line-height-md);
|
|
103
115
|
}
|
|
104
116
|
|
|
117
|
+
.description {
|
|
118
|
+
color: var(--ui-text-secondary);
|
|
119
|
+
font-size: var(--ui-font-size-sm);
|
|
120
|
+
line-height: var(--ui-line-height);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.description:empty {
|
|
124
|
+
display: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
105
127
|
input {
|
|
106
128
|
flex: 0 0 auto;
|
|
107
129
|
inline-size: var(--ui-radio-size, 1.125rem);
|
package/vue/UiSwitch.d.ts
CHANGED
|
@@ -5,9 +5,11 @@ type __VLS_Props = {
|
|
|
5
5
|
required?: boolean;
|
|
6
6
|
value?: string;
|
|
7
7
|
};
|
|
8
|
-
declare var __VLS_1: {};
|
|
8
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
10
|
default?: (props: typeof __VLS_1) => any;
|
|
11
|
+
} & {
|
|
12
|
+
description?: (props: typeof __VLS_3) => any;
|
|
11
13
|
};
|
|
12
14
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
15
|
change: (detail: {
|
package/vue/UiSwitch.vue
CHANGED
|
@@ -36,6 +36,7 @@ const emit = defineEmits<{
|
|
|
36
36
|
|
|
37
37
|
const root = ref<HTMLElement | null>(null)
|
|
38
38
|
const inputElement = useTemplateRef<HTMLElement>('input')
|
|
39
|
+
const descriptionElement = useTemplateRef<HTMLElement>('description')
|
|
39
40
|
const internalChecked = ref(false)
|
|
40
41
|
|
|
41
42
|
/** The values the styles' :host-state() rules test. */
|
|
@@ -64,7 +65,7 @@ useComponentHost(controllerModule.default, {
|
|
|
64
65
|
root,
|
|
65
66
|
dispatch,
|
|
66
67
|
props,
|
|
67
|
-
refs: { input: inputElement },
|
|
68
|
+
refs: { input: inputElement, description: descriptionElement },
|
|
68
69
|
state: { internalChecked },
|
|
69
70
|
})
|
|
70
71
|
</script>
|
|
@@ -85,7 +86,10 @@ useComponentHost(controllerModule.default, {
|
|
|
85
86
|
:value="value"
|
|
86
87
|
ref="input"
|
|
87
88
|
>
|
|
88
|
-
<span class="label"><slot /></span
|
|
89
|
+
<span class="text"><span class="label"><slot /></span>
|
|
90
|
+
<span class="description" aria-hidden="true" ref="description"><slot
|
|
91
|
+
name="description"
|
|
92
|
+
/></span></span></label>
|
|
89
93
|
</template>
|
|
90
94
|
|
|
91
95
|
<style scoped>
|
|
@@ -98,11 +102,29 @@ useComponentHost(controllerModule.default, {
|
|
|
98
102
|
cursor: pointer;
|
|
99
103
|
}
|
|
100
104
|
|
|
105
|
+
/* The label, and under it an optional line saying what the choice means. */
|
|
106
|
+
.text {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
gap: var(--ui-space-1);
|
|
110
|
+
min-inline-size: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
101
113
|
.label {
|
|
102
114
|
min-inline-size: 0;
|
|
103
115
|
line-height: var(--ui-line-height-md);
|
|
104
116
|
}
|
|
105
117
|
|
|
118
|
+
.description {
|
|
119
|
+
color: var(--ui-text-secondary);
|
|
120
|
+
font-size: var(--ui-font-size-sm);
|
|
121
|
+
line-height: var(--ui-line-height);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.description:empty {
|
|
125
|
+
display: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
106
128
|
input {
|
|
107
129
|
appearance: none;
|
|
108
130
|
-webkit-appearance: none;
|
package/vue/chunks/UiButton.js
CHANGED
package/vue/chunks/UiCheckbox.js
CHANGED
|
@@ -12,7 +12,13 @@ var _hoisted_2 = [
|
|
|
12
12
|
"name",
|
|
13
13
|
"value"
|
|
14
14
|
];
|
|
15
|
-
var _hoisted_3 = { class: "
|
|
15
|
+
var _hoisted_3 = { class: "text" };
|
|
16
|
+
var _hoisted_4 = { class: "label" };
|
|
17
|
+
var _hoisted_5 = {
|
|
18
|
+
class: "description",
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
ref: "description"
|
|
21
|
+
};
|
|
16
22
|
//#endregion
|
|
17
23
|
//#region .build/vue/UiCheckbox.vue
|
|
18
24
|
var UiCheckbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -48,6 +54,7 @@ var UiCheckbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
48
54
|
const emit = __emit;
|
|
49
55
|
const root = ref(null);
|
|
50
56
|
const inputElement = useTemplateRef("input");
|
|
57
|
+
const descriptionElement = useTemplateRef("description");
|
|
51
58
|
const internalChecked = ref(false);
|
|
52
59
|
/** The values the styles' :host-state() rules test. */
|
|
53
60
|
const hostState = computed(() => [props.disabled && "disabled"].filter(Boolean).join(" "));
|
|
@@ -64,7 +71,10 @@ var UiCheckbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
64
71
|
root,
|
|
65
72
|
dispatch,
|
|
66
73
|
props,
|
|
67
|
-
refs: {
|
|
74
|
+
refs: {
|
|
75
|
+
input: inputElement,
|
|
76
|
+
description: descriptionElement
|
|
77
|
+
},
|
|
68
78
|
state: { internalChecked }
|
|
69
79
|
});
|
|
70
80
|
return (_ctx, _cache) => {
|
|
@@ -81,9 +91,9 @@ var UiCheckbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
81
91
|
name: __props.name,
|
|
82
92
|
value: __props.value,
|
|
83
93
|
ref: "input"
|
|
84
|
-
}, null, 40, _hoisted_2), createElementVNode("span", _hoisted_3, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])], 16, _hoisted_1);
|
|
94
|
+
}, null, 40, _hoisted_2), createElementVNode("span", _hoisted_3, [createElementVNode("span", _hoisted_4, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]), createElementVNode("span", _hoisted_5, [renderSlot(_ctx.$slots, "description", {}, void 0, true)], 512)])], 16, _hoisted_1);
|
|
85
95
|
};
|
|
86
96
|
}
|
|
87
|
-
}), [["__scopeId", "data-v-
|
|
97
|
+
}), [["__scopeId", "data-v-4d65c3b0"]]);
|
|
88
98
|
//#endregion
|
|
89
99
|
export { UiCheckbox_default as t };
|
|
@@ -59,6 +59,6 @@ var UiIconButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
59
59
|
}), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_1);
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
}), [["__scopeId", "data-v-
|
|
62
|
+
}), [["__scopeId", "data-v-c322b7ed"]]);
|
|
63
63
|
//#endregion
|
|
64
64
|
export { UiIconButton_default as t };
|
package/vue/chunks/UiRadio.js
CHANGED
|
@@ -11,7 +11,13 @@ var _hoisted_2 = [
|
|
|
11
11
|
"value",
|
|
12
12
|
"name"
|
|
13
13
|
];
|
|
14
|
-
var _hoisted_3 = { class: "
|
|
14
|
+
var _hoisted_3 = { class: "text" };
|
|
15
|
+
var _hoisted_4 = { class: "label" };
|
|
16
|
+
var _hoisted_5 = {
|
|
17
|
+
class: "description",
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
ref: "description"
|
|
20
|
+
};
|
|
15
21
|
//#endregion
|
|
16
22
|
//#region .build/vue/UiRadio.vue
|
|
17
23
|
var UiRadio_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -43,6 +49,7 @@ var UiRadio_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
43
49
|
const emit = __emit;
|
|
44
50
|
const root = ref(null);
|
|
45
51
|
const inputElement = useTemplateRef("input");
|
|
52
|
+
const descriptionElement = useTemplateRef("description");
|
|
46
53
|
const internalChecked = ref(false);
|
|
47
54
|
/** The values the styles' :host-state() rules test. */
|
|
48
55
|
const hostState = computed(() => [props.disabled && "disabled"].filter(Boolean).join(" "));
|
|
@@ -59,7 +66,10 @@ var UiRadio_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
59
66
|
root,
|
|
60
67
|
dispatch,
|
|
61
68
|
props,
|
|
62
|
-
refs: {
|
|
69
|
+
refs: {
|
|
70
|
+
input: inputElement,
|
|
71
|
+
description: descriptionElement
|
|
72
|
+
},
|
|
63
73
|
state: { internalChecked }
|
|
64
74
|
});
|
|
65
75
|
return (_ctx, _cache) => {
|
|
@@ -75,9 +85,9 @@ var UiRadio_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
75
85
|
value: __props.value,
|
|
76
86
|
name: __props.name,
|
|
77
87
|
ref: "input"
|
|
78
|
-
}, null, 40, _hoisted_2), createElementVNode("span", _hoisted_3, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])], 16, _hoisted_1);
|
|
88
|
+
}, null, 40, _hoisted_2), createElementVNode("span", _hoisted_3, [createElementVNode("span", _hoisted_4, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]), createElementVNode("span", _hoisted_5, [renderSlot(_ctx.$slots, "description", {}, void 0, true)], 512)])], 16, _hoisted_1);
|
|
79
89
|
};
|
|
80
90
|
}
|
|
81
|
-
}), [["__scopeId", "data-v-
|
|
91
|
+
}), [["__scopeId", "data-v-f9c61d50"]]);
|
|
82
92
|
//#endregion
|
|
83
93
|
export { UiRadio_default as t };
|
package/vue/chunks/UiSwitch.js
CHANGED
|
@@ -11,7 +11,13 @@ var _hoisted_2 = [
|
|
|
11
11
|
"name",
|
|
12
12
|
"value"
|
|
13
13
|
];
|
|
14
|
-
var _hoisted_3 = { class: "
|
|
14
|
+
var _hoisted_3 = { class: "text" };
|
|
15
|
+
var _hoisted_4 = { class: "label" };
|
|
16
|
+
var _hoisted_5 = {
|
|
17
|
+
class: "description",
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
ref: "description"
|
|
20
|
+
};
|
|
15
21
|
//#endregion
|
|
16
22
|
//#region .build/vue/UiSwitch.vue
|
|
17
23
|
var UiSwitch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -43,6 +49,7 @@ var UiSwitch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
43
49
|
const emit = __emit;
|
|
44
50
|
const root = ref(null);
|
|
45
51
|
const inputElement = useTemplateRef("input");
|
|
52
|
+
const descriptionElement = useTemplateRef("description");
|
|
46
53
|
const internalChecked = ref(false);
|
|
47
54
|
/** The values the styles' :host-state() rules test. */
|
|
48
55
|
const hostState = computed(() => [props.disabled && "disabled"].filter(Boolean).join(" "));
|
|
@@ -59,7 +66,10 @@ var UiSwitch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
59
66
|
root,
|
|
60
67
|
dispatch,
|
|
61
68
|
props,
|
|
62
|
-
refs: {
|
|
69
|
+
refs: {
|
|
70
|
+
input: inputElement,
|
|
71
|
+
description: descriptionElement
|
|
72
|
+
},
|
|
63
73
|
state: { internalChecked }
|
|
64
74
|
});
|
|
65
75
|
return (_ctx, _cache) => {
|
|
@@ -76,9 +86,9 @@ var UiSwitch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
76
86
|
name: __props.name,
|
|
77
87
|
value: __props.value,
|
|
78
88
|
ref: "input"
|
|
79
|
-
}, null, 40, _hoisted_2), createElementVNode("span", _hoisted_3, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])], 16, _hoisted_1);
|
|
89
|
+
}, null, 40, _hoisted_2), createElementVNode("span", _hoisted_3, [createElementVNode("span", _hoisted_4, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]), createElementVNode("span", _hoisted_5, [renderSlot(_ctx.$slots, "description", {}, void 0, true)], 512)])], 16, _hoisted_1);
|
|
80
90
|
};
|
|
81
91
|
}
|
|
82
|
-
}), [["__scopeId", "data-v-
|
|
92
|
+
}), [["__scopeId", "data-v-85cb3260"]]);
|
|
83
93
|
//#endregion
|
|
84
94
|
export { UiSwitch_default as t };
|