@emuanalytics/flow-rdf-ui 4.1.2 → 4.1.4

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.
@@ -0,0 +1,233 @@
1
+ import { css } from 'lit';
2
+ import componentStyles from '../../styles/component.styles.mjs';
3
+ import formControlStyles from '../../styles/form-control.styles.mjs';
4
+
5
+ const styles = css`
6
+ ${componentStyles}
7
+ ${formControlStyles}
8
+
9
+ :host {
10
+ display: inline-block;
11
+ width: 100%;
12
+
13
+ --control-height: var(--flow-ui-control-height-medium);
14
+ }
15
+
16
+ :host([size='small']) {
17
+ --control-height: var(--flow-ui-control-height-small);
18
+ }
19
+
20
+ :host([size='large']) {
21
+ --control-height: var(--flow-ui-control-height-large);
22
+ }
23
+
24
+ .form-control .form-control__input {
25
+ height: unset;
26
+ min-height: var(--control-height);
27
+ }
28
+
29
+ /** The popup */
30
+ .autocomplete {
31
+ flex: 1 1 auto;
32
+ display: inline-flex;
33
+ width: 100%;
34
+ position: relative;
35
+ vertical-align: middle;
36
+ }
37
+
38
+ .autocomplete::part(popup) {
39
+ z-index: var(--flow-ui-z-index-dropdown);
40
+ }
41
+
42
+ .autocomplete[data-current-placement^='top']::part(popup) {
43
+ transform-origin: bottom;
44
+ }
45
+
46
+ .autocomplete[data-current-placement^='bottom']::part(popup) {
47
+ transform-origin: top;
48
+ }
49
+
50
+ /* Combobox */
51
+ .autocomplete__combobox {
52
+ flex: 1;
53
+ display: flex;
54
+ width: 100%;
55
+ min-width: 0;
56
+ position: relative;
57
+ align-items: center;
58
+ justify-content: start;
59
+ font-family: var(--flow-ui-control-font-family);
60
+ font-weight: var(--flow-ui-control-font-weight);
61
+ letter-spacing: var(--flow-ui-control-letter-spacing);
62
+ vertical-align: middle;
63
+ overflow: hidden;
64
+ transition:
65
+ var(--flow-ui-transition-fast) color,
66
+ var(--flow-ui-transition-fast) border,
67
+ var(--flow-ui-transition-fast) box-shadow,
68
+ var(--flow-ui-transition-fast) background-color;
69
+
70
+ border-radius: var(--control-border-radius);
71
+ font-size: var(--control-font-size);
72
+ min-height: var(--control-height);
73
+ padding-block: 0;
74
+ padding-inline: var(--control-spacing);
75
+ }
76
+
77
+ .form-control--disabled .autocomplete__combobox {
78
+ cursor: not-allowed;
79
+ }
80
+
81
+ .autocomplete__input {
82
+ flex: 1;
83
+ font-family: inherit;
84
+ font-size: inherit;
85
+ font-weight: inherit;
86
+ width: 100%;
87
+ min-width: 0;
88
+ height: var(--control-height);
89
+ color: var(--flow-ui-control-color);
90
+ border: none;
91
+ background: none;
92
+ box-shadow: none;
93
+ padding: 0;
94
+ margin: 0;
95
+ cursor: inherit;
96
+ -webkit-appearance: none;
97
+ outline: none;
98
+ }
99
+
100
+ /* Wrapper to allow display input to be sized based on its content */
101
+ .autocomplete__input-wrapper {
102
+ flex: 1;
103
+ display: grid;
104
+ grid-template-columns: 1fr;
105
+ }
106
+
107
+ .autocomplete--inline .autocomplete__input-wrapper {
108
+ grid-template-columns: min-content;
109
+ }
110
+
111
+ .autocomplete__input-sizer {
112
+ white-space: pre;
113
+ height: 0;
114
+ overflow: hidden;
115
+ }
116
+
117
+ .autocomplete__input::placeholder {
118
+ color: var(--flow-ui-control-placeholder-color);
119
+ }
120
+
121
+ .form-control.form-control--disabled .autocomplete__input::placeholder {
122
+ color: var(--flow-ui-control-placeholder-color-disabled);
123
+ }
124
+
125
+ .form-control.form-control--disabled .select__display-input {
126
+ color: var(--flow-ui-control-color-disabled);
127
+ }
128
+
129
+ .autocomplete__input::not(.autocomplete--disabled):hover .autocomplete__input {
130
+ color: var(--flow-ui-control-color-hover);
131
+ }
132
+
133
+ .autocomplete__input:focus {
134
+ outline: none;
135
+ }
136
+
137
+ /* Pills */
138
+ .autocomplete--pill.autocomplete--small .autocomplete__combobox {
139
+ border-radius: var(--flow-ui-control-height-small);
140
+ }
141
+
142
+ .autocomplete--pill.autocomplete--medium .autocomplete__combobox {
143
+ border-radius: var(--flow-ui-control-height-medium);
144
+ }
145
+
146
+ .autocomplete--pill.autocomplete--large .autocomplete__combobox {
147
+ border-radius: var(--flow-ui-control-height-large);
148
+ }
149
+
150
+ /* Prefix */
151
+ .autocomplete__prefix {
152
+ flex: 0;
153
+ display: inline-flex;
154
+ align-items: center;
155
+ color: var(--flow-ui-control-placeholder-color);
156
+ }
157
+
158
+ .autocomplete__prefix::slotted(*) {
159
+ margin-inline-end: var(--control-spacing);
160
+ }
161
+
162
+ /* Suffix */
163
+ .autocomplete__suffix {
164
+ flex: 0;
165
+ display: inline-flex;
166
+ align-items: center;
167
+ color: var(--flow-ui-control-placeholder-color);
168
+ }
169
+
170
+ /* Clear btn */
171
+ .autocomplete__clear {
172
+ display: inline-flex;
173
+ align-items: center;
174
+ justify-content: center;
175
+ font-size: inherit;
176
+ color: var(--flow-ui-control-icon-color);
177
+ border: none;
178
+ background: none;
179
+ padding: 0;
180
+ margin-inline-start: var(--control-spacing);
181
+ transition: var(--flow-ui-transition-fast) color;
182
+ cursor: pointer;
183
+ }
184
+
185
+ .autocomplete__clear:hover {
186
+ color: var(--flow-ui-control-icon-color-hover);
187
+ }
188
+
189
+ .autocomplete__clear:focus {
190
+ outline: none;
191
+ }
192
+
193
+ /* Listbox */
194
+ .autocomplete__listbox {
195
+ transition-timing-function: ease-in;
196
+
197
+ display: block;
198
+ position: relative;
199
+ font-family: var(--flow-ui-font-sans);
200
+ font-size: var(--flow-ui-font-size-medium);
201
+ font-weight: var(--flow-ui-font-weight-normal);
202
+ box-shadow: var(--flow-ui-shadow-large);
203
+ background: var(--flow-ui-menu-background-color);
204
+ color: var(--flow-ui-menu-color);
205
+ border: solid var(--flow-ui-menu-border-width) var(--flow-ui-menu-border-color);
206
+ border-radius: var(--flow-ui-menu-border-radius);
207
+ padding-block: var(--flow-ui-spacing-x-small);
208
+ padding-inline: 0;
209
+ overflow: auto;
210
+ overscroll-behavior: none;
211
+
212
+ /* Make sure it adheres to the popup's auto size */
213
+ max-width: var(--auto-size-available-width);
214
+ max-height: var(--auto-size-available-height);
215
+ }
216
+
217
+ .autocomplete__listbox ::slotted(flow-ui-divider) {
218
+ --spacing: var(--flow-ui-spacing-x-small);
219
+ --inset: var(--flow-ui-spacing-medium);
220
+ --color: var(--flow-ui-menu-divider-color);
221
+ }
222
+
223
+ .autocomplete__listbox ::slotted(small) {
224
+ display: block;
225
+ font-size: var(--flow-ui-menu-divider-font-size);
226
+ font-weight: var(--flow-ui-font-weight-semibold);
227
+ color: var(--flow-ui-menu-divider-text-color);
228
+ padding-block: var(--flow-ui-spacing-2x-small);
229
+ padding-inline: var(--flow-ui-spacing-medium);
230
+ }
231
+ `;
232
+
233
+ export { styles as default };
@@ -177,7 +177,8 @@ class FlowUiListItem extends FlowRdfElement {
177
177
  "list-item--has-menu": this.hasSlotController.test("menu"),
178
178
  "list-item--editable": this.editable,
179
179
  "list-item--selectable": this.selectable,
180
- "list-item--focused": this.hasFocus
180
+ "list-item--focused": this.hasFocus,
181
+ "list-item--disabled": this.disabled
181
182
  })}
182
183
  >
183
184
  ${this.reorder ? html`
@@ -13,9 +13,11 @@ const styles = css`
13
13
  --background-color: var(--flow-ui-list-item-background-color);
14
14
 
15
15
  --selection-width: 6px;
16
- --selection-color: var(--flow-ui-list-item-selected-color, var(--flow-ui-color-primary-500));
17
-
16
+ --selection-color: var(--flow-ui-list-item-selection-color, var(--flow-ui-color-primary-500));
18
17
  --background-color-selected: var(--flow-ui-list-item-background-color-selected, var(--flow-ui-color-neutral-500));
18
+
19
+ --disabled-color: var(--flow-ui-list-item-color-disabled, var(--flow-ui-color-neutral-600));
20
+ --background-color-disabled: var(--flow-ui-list-item-background-color-disabled, var(--flow-ui-color-neutral-300));
19
21
  }
20
22
 
21
23
  :host(:focus-visible) {
@@ -41,12 +43,22 @@ const styles = css`
41
43
  user-select: none;
42
44
  }
43
45
 
46
+ .list-item--disabled {
47
+ color: var(--disabled-color);
48
+ background-color: var(--background-color-disabled);
49
+ cursor: not-allowed;
50
+ }
51
+
52
+ .list-item--disabled flow-ui-input::part(input) {
53
+ color: var(--disabled-color);
54
+ }
55
+
44
56
  .list-item--checked {
45
57
  border-right-color: var(--selection-color);
46
58
  background-color: var(--background-color-selected);
47
59
  }
48
60
 
49
- .list-item--selectable {
61
+ .list-item--selectable:not(.list-item--disabled) {
50
62
  cursor: pointer;
51
63
  }
52
64