@threadlabs/looma 0.27.2 → 0.27.3
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-button/ui-button.html +31 -3
- package/components/ui-combobox/ui-combobox.html +15 -8
- package/components/ui-input/ui-input.html +8 -1
- package/components/ui-input-group/ui-input-group.html +4 -0
- package/components/ui-select/ui-select.html +8 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-button.css +29 -0
- package/styles/ui-combobox.css +13 -6
- package/styles/ui-input-group.css +4 -0
- package/styles/ui-input.css +8 -1
- package/styles/ui-select.css +8 -4
- package/vanilla/UiButton.d.ts +1 -1
- package/vanilla/UiButton.js +1 -1
- package/vue/UiButton.d.ts +3 -3
- package/vue/UiButton.vue +39 -6
- package/vue/UiCombobox.vue +14 -7
- package/vue/UiInput.vue +11 -1
- package/vue/UiInputGroup.vue +4 -0
- package/vue/UiSelect.vue +8 -4
- package/vue/chunks/UiButton.js +5 -4
- package/vue/chunks/UiCombobox.js +2 -2
- package/vue/chunks/UiInput.js +1 -1
- package/vue/chunks/UiInputGroup.js +1 -1
- package/vue/chunks/UiSelect.js +1 -1
- package/vue/components.css +231 -179
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
<link rel="component" href="../ui-icon/ui-icon.html">
|
|
3
3
|
<template component="ui-button" controller="./ui-button.js">
|
|
4
4
|
<defs>
|
|
5
|
-
<prop name="variant" type="keyword" values="outline, solid, danger, ghost, link, card" default="outline"
|
|
5
|
+
<prop name="variant" type="keyword" values="outline, solid, danger, ghost, link, card, field" default="outline"
|
|
6
6
|
>Emphasis: how loudly the button asks. solid fills with its tone, outline draws its tone at the edge over a wash of it, ghost carries only text until it is
|
|
7
7
|
hovered, and link is an inline text action that reads as a link. danger is solid in the danger tone, kept for the call sites that name it. card uses the
|
|
8
|
-
same tone on a full-width action with an icon slot, wrapping content, and a centered action slot
|
|
8
|
+
same tone on a full-width action with an icon slot, wrapping content, and a centered action slot. field opens a custom value picker: it shares Select's
|
|
9
|
+
quiet outline, neutral text and slightly raised surface, independently of action tone.</prop>
|
|
9
10
|
<prop name="size" type="keyword" values="xs, sm, md, lg" default="md"
|
|
10
11
|
>Height, padding, and type size. xs is 1.5rem with the smallest text, for a control inside a line of small text; sm is the small control height (2rem by
|
|
11
12
|
default) with tighter padding and smaller text, md is the standard control height (2.5rem), and lg is taller (3rem) with roomier padding. Under touch, sm
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
>rounded uses the theme's action radius; pill rounds the ends fully, for a compact choice such as a status or a person.</prop>
|
|
15
16
|
<prop name="tone" type="keyword" values="accent, neutral, danger, success, warning, info" default="accent"
|
|
16
17
|
>Which colour the button speaks in. It applies to every variant, so an outline, a ghost, and a solid in the same tone are the same action at three volumes:
|
|
17
|
-
tone="danger" variant="outline" is a destructive secondary action. neutral is the quiet one, for a button that should not claim a colour.</prop>
|
|
18
|
+
tone="danger" variant="outline" is a destructive secondary action. neutral is the quiet one, for a button that should not claim a colour. The field variant always uses neutral field colors.</prop>
|
|
18
19
|
<prop name="disabled" type="boolean" default="false"
|
|
19
20
|
>Makes the button unavailable: it cannot be pressed, uses a flat neutral palette, and loses its raised look. A disabled link (as="a" with href) drops its
|
|
20
21
|
href and states aria-disabled="true" instead, because a link has no native disabled state.</prop>
|
|
@@ -416,6 +417,33 @@
|
|
|
416
417
|
--_on-hue: var(--ui-surface);
|
|
417
418
|
}
|
|
418
419
|
|
|
420
|
+
/* A value picker is a field, with Select's quiet edge and resting lift. */
|
|
421
|
+
:host([variant="field"]) {
|
|
422
|
+
--_ui-field-shadow: var(--ui-shadow-sm);
|
|
423
|
+
border-color: var(--ui-button-border, var(--ui-control-border, var(--ui-border-strong)));
|
|
424
|
+
border-radius: var(--ui-button-radius, var(--ui-field-radius, var(--ui-radius-md)));
|
|
425
|
+
background-color: var(--ui-button-surface, var(--ui-control-surface, var(--ui-surface-elevated)));
|
|
426
|
+
color: var(--ui-button-text, var(--ui-text-primary));
|
|
427
|
+
font-weight: var(--ui-font-normal);
|
|
428
|
+
box-shadow: var(--ui-button-shadow, var(--_ui-field-shadow));
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
:host([variant="field"]):hover:not(:disabled, [aria-disabled="true"]) {
|
|
432
|
+
border-color: var(--ui-button-hover-border, var(--ui-control-border-hover, var(--ui-text-secondary)));
|
|
433
|
+
background-color: var(--ui-button-hover-surface, var(--ui-control-surface, var(--ui-surface-elevated)));
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
:host([variant="field"]):is(:active, [aria-expanded="true"]):not(:disabled, [aria-disabled="true"]) {
|
|
437
|
+
--_ui-field-shadow: var(--ui-pressed);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
:host([variant="field"]):focus-visible {
|
|
441
|
+
border-color: var(--ui-control-focus, var(--ui-accent-solid));
|
|
442
|
+
box-shadow:
|
|
443
|
+
var(--ui-button-shadow, var(--_ui-field-shadow)),
|
|
444
|
+
var(--ui-control-focus-halo-shadow);
|
|
445
|
+
}
|
|
446
|
+
|
|
419
447
|
:host([variant="ghost"]) {
|
|
420
448
|
border-color: transparent;
|
|
421
449
|
background: transparent;
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
<prop name="allowFreeText" type="boolean" default="false">Allows values that do not match an authored option.</prop>
|
|
64
64
|
<prop name="clearQueryOnBlur" type="boolean" default="false"
|
|
65
65
|
>In multiple mode, clears unfinished search text when focus leaves the whole combobox, preserving selected items. A controlled query reports query-change
|
|
66
|
-
with an empty query; the consumer must reflect it back. Does not choose or create an option. The default preserves unfinished text. Single mode keeps
|
|
67
|
-
|
|
66
|
+
with an empty query; the consumer must reflect it back. Does not choose or create an option. The default preserves unfinished text. Single mode keeps its
|
|
67
|
+
existing selection and free-text resolution.</prop>
|
|
68
68
|
<prop name="allowCreate" type="boolean" default="false"
|
|
69
69
|
>Offers the current query as a new option, reported as create-item. When nothing else matches, the offer is highlighted, so Enter creates it; with nothing
|
|
70
70
|
highlighted, Enter in multiple mode commits the typed text as a token separator does.</prop>
|
|
@@ -609,6 +609,7 @@
|
|
|
609
609
|
--_ui-combobox-popup-radius: var(--ui-combobox-popup-radius);
|
|
610
610
|
--_ui-combobox-popup-shadow: var(--ui-combobox-popup-shadow);
|
|
611
611
|
|
|
612
|
+
--_row: var(--ui-control-size-md);
|
|
612
613
|
display: grid;
|
|
613
614
|
gap: var(--ui-space-1);
|
|
614
615
|
min-inline-size: 0;
|
|
@@ -630,6 +631,8 @@
|
|
|
630
631
|
}
|
|
631
632
|
|
|
632
633
|
.field {
|
|
634
|
+
box-sizing: border-box;
|
|
635
|
+
min-block-size: var(--_row);
|
|
633
636
|
flex: 1 1 auto;
|
|
634
637
|
display: flex;
|
|
635
638
|
min-inline-size: 0;
|
|
@@ -696,14 +699,14 @@
|
|
|
696
699
|
appearance: none;
|
|
697
700
|
width: 100%;
|
|
698
701
|
min-inline-size: 0;
|
|
699
|
-
min-block-size: calc(var(--
|
|
702
|
+
min-block-size: calc(var(--_row) - 2 * var(--ui-border-width));
|
|
700
703
|
box-sizing: border-box;
|
|
701
704
|
border: 0;
|
|
702
705
|
border-radius: inherit;
|
|
703
706
|
background: transparent;
|
|
704
707
|
color: inherit;
|
|
705
708
|
font: inherit;
|
|
706
|
-
line-height: var(--ui-line-height-
|
|
709
|
+
line-height: var(--ui-line-height-tight);
|
|
707
710
|
padding: var(--ui-space-2) var(--ui-space-3);
|
|
708
711
|
margin: 0;
|
|
709
712
|
outline: none;
|
|
@@ -712,12 +715,13 @@
|
|
|
712
715
|
--_row: var(--ui-control-size-sm);
|
|
713
716
|
}
|
|
714
717
|
:host([size="sm"]) input {
|
|
715
|
-
min-block-size: calc(var(--_row) - 2px);
|
|
716
718
|
padding: var(--ui-space-1) var(--ui-space-2);
|
|
717
719
|
font-size: var(--ui-font-size-sm);
|
|
718
720
|
}
|
|
721
|
+
:host([size="lg"]) {
|
|
722
|
+
--_row: var(--ui-control-size-lg);
|
|
723
|
+
}
|
|
719
724
|
:host([size="lg"]) input {
|
|
720
|
-
min-block-size: calc(var(--ui-control-size-lg) - 2px);
|
|
721
725
|
padding: var(--ui-space-3) var(--ui-space-4);
|
|
722
726
|
font-size: var(--ui-font-size-md);
|
|
723
727
|
}
|
|
@@ -823,9 +827,12 @@
|
|
|
823
827
|
white-space: nowrap;
|
|
824
828
|
}
|
|
825
829
|
@media (pointer: coarse) {
|
|
830
|
+
:host {
|
|
831
|
+
--_row: max(var(--ui-control-size-md), var(--ui-control-min-block-size));
|
|
832
|
+
}
|
|
826
833
|
button {
|
|
827
834
|
min-inline-size: 2.75rem;
|
|
828
|
-
min-block-size: 2
|
|
835
|
+
min-block-size: calc(var(--_row) - 2 * var(--ui-border-width));
|
|
829
836
|
}
|
|
830
837
|
/* Under touch a small field is still a touch-sized target, as a small button is, and keeps
|
|
831
838
|
body-size text: below 16px, iOS zooms the page into the focused field. */
|
|
@@ -849,7 +856,7 @@
|
|
|
849
856
|
while the clear and disclosure controls remain fixed at the end of the field. */
|
|
850
857
|
:host([multiple]) .field {
|
|
851
858
|
align-items: center;
|
|
852
|
-
min-block-size: var(--_ui-combobox-item-min-block-size,
|
|
859
|
+
min-block-size: var(--_ui-combobox-item-min-block-size, var(--_row));
|
|
853
860
|
padding: var(--ui-space-1);
|
|
854
861
|
}
|
|
855
862
|
:host([multiple]) .entry {
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
background: var(--ui-input-surface, var(--_ui-default-input-surface, var(--ui-control-surface, var(--ui-surface-elevated))));
|
|
112
112
|
color: var(--ui-text-primary);
|
|
113
113
|
font: inherit;
|
|
114
|
-
line-height: var(--ui-line-height-
|
|
114
|
+
line-height: var(--ui-line-height-tight);
|
|
115
115
|
box-shadow: var(--ui-input-shadow, var(--_ui-default-input-shadow, var(--ui-control-inset)));
|
|
116
116
|
transition:
|
|
117
117
|
border-color var(--ui-motion-fast) var(--ui-motion-ease),
|
|
@@ -135,6 +135,13 @@
|
|
|
135
135
|
/* Under touch a small field is still a touch-sized target, as a small button is, and keeps
|
|
136
136
|
body-size text: below 16px, iOS zooms the page into the focused field. */
|
|
137
137
|
@media (pointer: coarse) {
|
|
138
|
+
:host {
|
|
139
|
+
min-block-size: var(
|
|
140
|
+
--ui-input-min-block-size,
|
|
141
|
+
var(--_ui-default-input-min-block-size, max(var(--ui-control-size-md), var(--ui-control-min-block-size)))
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
138
145
|
:host,
|
|
139
146
|
:host([size="sm"]),
|
|
140
147
|
:host([size="lg"]) {
|
|
@@ -98,6 +98,10 @@
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
@media (pointer: coarse) {
|
|
101
|
+
:host {
|
|
102
|
+
min-block-size: max(var(--ui-control-size-md), var(--ui-control-min-block-size));
|
|
103
|
+
}
|
|
104
|
+
|
|
101
105
|
:host:has(.field [data-ui-input-state~="size=sm"]) {
|
|
102
106
|
min-block-size: var(--ui-control-min-block-size);
|
|
103
107
|
}
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
color: var(--ui-text-primary);
|
|
71
71
|
color-scheme: light dark;
|
|
72
72
|
font: inherit;
|
|
73
|
-
line-height: var(--ui-line-height-
|
|
74
|
-
box-shadow: var(--ui-select-shadow, var(--ui-
|
|
73
|
+
line-height: var(--ui-line-height-tight);
|
|
74
|
+
box-shadow: var(--ui-select-shadow, var(--ui-shadow-sm));
|
|
75
75
|
transition:
|
|
76
76
|
border-color var(--ui-motion-fast) var(--ui-motion-ease),
|
|
77
77
|
box-shadow var(--ui-motion-fast) var(--ui-motion-ease),
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
:host:focus-visible {
|
|
100
100
|
border-color: var(--ui-select-focus-border, var(--ui-control-focus, var(--ui-accent-solid)));
|
|
101
101
|
outline: none;
|
|
102
|
-
box-shadow: var(--ui-select-focus-shadow, var(--ui-
|
|
102
|
+
box-shadow: var(--ui-select-focus-shadow, var(--ui-shadow-sm), var(--ui-control-focus-halo-shadow));
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
/* The app's invalid flag, or the browser's own verdict once the user has left an invalid field. */
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
:host:is([aria-invalid="true"], :user-invalid):focus-visible {
|
|
112
112
|
box-shadow: var(
|
|
113
113
|
--ui-select-invalid-focus-shadow,
|
|
114
|
-
var(--ui-
|
|
114
|
+
var(--ui-shadow-sm),
|
|
115
115
|
0 0 0 calc(var(--ui-focus-width) * 1.5) color-mix(
|
|
116
116
|
in srgb,
|
|
117
117
|
var(--ui-select-invalid-border, var(--ui-field-danger, var(--ui-danger-solid))) 22%,
|
|
@@ -147,6 +147,10 @@
|
|
|
147
147
|
/* Under touch a small field is still a touch-sized target, as a small button is, and keeps
|
|
148
148
|
body-size text: below 16px, iOS zooms the page into the focused field. */
|
|
149
149
|
@media (pointer: coarse) {
|
|
150
|
+
:host {
|
|
151
|
+
min-block-size: max(var(--ui-control-size-md), var(--ui-control-min-block-size));
|
|
152
|
+
}
|
|
153
|
+
|
|
150
154
|
:host([size="sm"]) {
|
|
151
155
|
min-block-size: var(--ui-control-min-block-size);
|
|
152
156
|
font-size: inherit;
|