@emuanalytics/flow-rdf-ui 4.0.18 → 4.1.0-preview.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.
Files changed (54) hide show
  1. package/dist/components/avatar/avatar.styles.mjs +4 -2
  2. package/dist/components/badge/badge.styles.mjs +23 -18
  3. package/dist/components/base-control/base-control.component.mjs +193 -0
  4. package/dist/components/base-control/base-control.mjs +5 -0
  5. package/dist/components/base-control/base-control.styles.mjs +39 -0
  6. package/dist/components/calendar/calendar.component.mjs +4 -0
  7. package/dist/components/calendar/calendar.styles.mjs +3 -9
  8. package/dist/components/checkbox/checkbox.component.mjs +3 -17
  9. package/dist/components/checkbox/checkbox.styles.mjs +2 -58
  10. package/dist/components/checkbox-group/checkbox-group.component.mjs +283 -0
  11. package/dist/components/checkbox-group/checkbox-group.mjs +5 -0
  12. package/dist/components/checkbox-group/checkbox-group.styles.mjs +73 -0
  13. package/dist/components/color-mapper/color-mapper.component.mjs +7 -1
  14. package/dist/components/color-mapper/color-mapper.styles.mjs +4 -6
  15. package/dist/components/date-time-picker/date-time-picker.component.mjs +50 -34
  16. package/dist/components/date-time-picker/date-time-picker.styles.mjs +17 -5
  17. package/dist/components/form-group/form-group.component.mjs +120 -0
  18. package/dist/components/form-group/form-group.mjs +5 -0
  19. package/dist/components/form-group/form-group.styles.mjs +47 -0
  20. package/dist/components/input/input.component.mjs +49 -35
  21. package/dist/components/input/input.styles.mjs +37 -180
  22. package/dist/components/menu/menu.styles.mjs +1 -0
  23. package/dist/components/option/option.styles.mjs +7 -7
  24. package/dist/components/query-builder/default-value-templates.mjs +6 -0
  25. package/dist/components/query-builder/query-builder.component.mjs +4 -1
  26. package/dist/components/radio/radio.styles.mjs +2 -46
  27. package/dist/components/radio-group/radio-group.component.mjs +16 -20
  28. package/dist/components/radio-group/radio-group.styles.mjs +33 -9
  29. package/dist/components/range/range.component.mjs +62 -56
  30. package/dist/components/range/range.styles.mjs +47 -60
  31. package/dist/components/select/select.component.mjs +75 -45
  32. package/dist/components/select/select.styles.mjs +71 -128
  33. package/dist/components/switch/switch.component.mjs +67 -32
  34. package/dist/components/switch/switch.styles.mjs +42 -103
  35. package/dist/components/tag/tag.styles.mjs +48 -61
  36. package/dist/components/textarea/textarea.component.mjs +11 -11
  37. package/dist/components/textarea/textarea.styles.mjs +8 -1
  38. package/dist/custom-elements.json +2103 -887
  39. package/dist/index.d.mts +359 -82
  40. package/dist/index.d.ts +359 -82
  41. package/dist/index.mjs +3 -0
  42. package/dist/internal/computed-style.mjs +13 -0
  43. package/dist/internal/flow-ui-rdf-element.mjs +16 -1
  44. package/dist/package.json.mjs +1 -1
  45. package/dist/styles/form-control.styles.mjs +152 -30
  46. package/dist/utilities/register-components.mjs +6 -0
  47. package/dist/vscode.html-custom-data.json +216 -55
  48. package/package.json +2 -1
  49. package/themes/dark-new.css +716 -0
  50. package/themes/dark-new.styles.js +726 -0
  51. package/themes/dark.css +19 -4
  52. package/themes/dark.styles.js +23 -4
  53. package/themes/light.css +19 -4
  54. package/themes/light.styles.js +23 -4
@@ -8,6 +8,8 @@ const styles = css`
8
8
  display: inline-block;
9
9
 
10
10
  --size: 3rem;
11
+ --background-color: var(--flow-ui-avatar-background-color, var(--flow-ui-color-neutral-600));
12
+ --color: var(--flow-ui-avatar-color, var(--flow-ui-color-neutral-200));
11
13
  }
12
14
 
13
15
  .avatar {
@@ -17,11 +19,11 @@ const styles = css`
17
19
  position: relative;
18
20
  width: var(--size);
19
21
  height: var(--size);
20
- background-color: var(--flow-ui-color-neutral-400);
22
+ background-color: var(--background-color);
21
23
  font-family: var(--flow-ui-font-sans);
22
24
  font-size: calc(var(--size) * 0.5);
23
25
  font-weight: var(--flow-ui-font-weight-normal);
24
- color: var(--flow-ui-color-neutral-0);
26
+ color: var(--color);
25
27
  user-select: none;
26
28
  vertical-align: middle;
27
29
  }
@@ -6,6 +6,8 @@ const styles = css`
6
6
 
7
7
  :host {
8
8
  display: inline-flex;
9
+ --color: var(--flow-ui-color-primary-contrast);
10
+ --background-color: var(--flow-ui-color-primary-500);
9
11
  }
10
12
 
11
13
  .badge {
@@ -22,37 +24,40 @@ const styles = css`
22
24
  padding: 0.35em 0.6em;
23
25
  user-select: none;
24
26
  cursor: inherit;
27
+
28
+ background-color: var(--background-color);
29
+ color: var(--color);
25
30
  }
26
31
 
27
32
  /* Variant modifiers */
28
- .badge--primary {
29
- background-color: var(--flow-ui-color-primary-500);
30
- color: var(--flow-ui-color-neutral-0);
33
+ :host([variant='primary']) {
34
+ --color: var(--flow-ui-color-neutral-0);
35
+ --background-color: var(--flow-ui-color-primary-500);
31
36
  }
32
37
 
33
- .badge--secondary {
34
- background-color: var(--flow-ui-color-secondary-500);
35
- color: var(--flow-ui-color-neutral-0);
38
+ :host([variant='secondary']) {
39
+ --color: var(--flow-ui-color-neutral-0);
40
+ --background-color: var(--flow-ui-color-secondary-500);
36
41
  }
37
42
 
38
- .badge--success {
39
- background-color: var(--flow-ui-color-success-600);
40
- color: var(--flow-ui-color-neutral-0);
43
+ :host([variant='success']) {
44
+ --background-color: var(--flow-ui-color-success-600);
45
+ --color: var(--flow-ui-color-neutral-0);
41
46
  }
42
47
 
43
- .badge--neutral {
44
- background-color: var(--flow-ui-color-neutral-600);
45
- color: var(--flow-ui-color-neutral-0);
48
+ :host([variant='neutral']) {
49
+ --background-color: var(--flow-ui-color-neutral-600);
50
+ --color: var(--flow-ui-color-neutral-0);
46
51
  }
47
52
 
48
- .badge--warning {
49
- background-color: var(--flow-ui-color-warning-600);
50
- color: var(--flow-ui-color-neutral-0);
53
+ :host([variant='warning']) {
54
+ --background-color: var(--flow-ui-color-warning-600);
55
+ --color: var(--flow-ui-color-neutral-0);
51
56
  }
52
57
 
53
- .badge--danger {
54
- background-color: var(--flow-ui-color-danger-600);
55
- color: var(--flow-ui-color-neutral-0);
58
+ :host([variant='danger']) {
59
+ --background-color: var(--flow-ui-color-danger-600);
60
+ --color: var(--flow-ui-color-neutral-0);
56
61
  }
57
62
 
58
63
  /* Pill modifier */
@@ -0,0 +1,193 @@
1
+ import { html, nothing } from 'lit';
2
+ import { query, state, property } from 'lit/decorators.js';
3
+ import { classMap } from 'lit/directives/class-map.js';
4
+ import { boolean } from '../../internal/boolean.mjs';
5
+ import { FlowRdfFormControl } from '../../internal/flow-ui-rdf-element.mjs';
6
+ import { FormControlController } from '../../internal/form.mjs';
7
+ import { HasSlotController } from '../../internal/slot.mjs';
8
+ import { watch } from '../../internal/watch.mjs';
9
+ import formControlStyles from '../../styles/form-control.styles.mjs';
10
+ import styles from './base-control.styles.mjs';
11
+
12
+ var __defProp = Object.defineProperty;
13
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
14
+ var __decorateClass = (decorators, target, key, kind) => {
15
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
16
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
17
+ if (decorator = decorators[i])
18
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
19
+ if (kind && result)
20
+ __defProp(target, key, result);
21
+ return result;
22
+ };
23
+ class FlowUiBaseControl extends FlowRdfFormControl {
24
+ constructor() {
25
+ super(...arguments);
26
+ this.formControlController = new FormControlController(this, {
27
+ assumeInteractionOn: ["flow-ui-blur", "flow-ui-input"]
28
+ });
29
+ this.hasSlotController = new HasSlotController(this, "help-text", "label");
30
+ this.hasFocus = false;
31
+ this.title = "";
32
+ this.size = "medium";
33
+ this.filled = false;
34
+ this.pill = false;
35
+ this.label = "";
36
+ this.helpText = "";
37
+ this.disabled = false;
38
+ this.form = "";
39
+ this.required = false;
40
+ this.inline = false;
41
+ this.divider = false;
42
+ }
43
+ connectedCallback() {
44
+ super.connectedCallback();
45
+ this.disabled = boolean(this.disabled, true);
46
+ this.required = boolean(this.required, true);
47
+ }
48
+ /** Gets the validity state object */
49
+ get validity() {
50
+ return this.input.validity;
51
+ }
52
+ /** Gets the validation message */
53
+ get validationMessage() {
54
+ return this.input.validationMessage;
55
+ }
56
+ firstUpdated() {
57
+ this.formControlController.updateValidity();
58
+ }
59
+ handleBlur() {
60
+ this.hasFocus = false;
61
+ this.emit("flow-ui-blur");
62
+ }
63
+ handleFocus() {
64
+ this.hasFocus = true;
65
+ this.emit("flow-ui-focus");
66
+ }
67
+ handleDisabledChange() {
68
+ this.formControlController.setValidity(this.disabled);
69
+ }
70
+ /** Sets focus on the input. */
71
+ focus(options) {
72
+ this.input.focus(options);
73
+ }
74
+ /** Removes focus from the input. */
75
+ blur() {
76
+ this.input.blur();
77
+ }
78
+ /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
79
+ checkValidity() {
80
+ return this.input.checkValidity();
81
+ }
82
+ /** Gets the associated form, if one exists. */
83
+ getForm() {
84
+ return this.formControlController.getForm();
85
+ }
86
+ /** Checks for validity and shows the browser's validation message if the control is invalid. */
87
+ reportValidity() {
88
+ return this.input.reportValidity();
89
+ }
90
+ /** Sets a custom validation message. Pass an empty string to restore validity. */
91
+ setCustomValidity(message) {
92
+ this.input.setCustomValidity(message);
93
+ this.formControlController.updateValidity();
94
+ }
95
+ render() {
96
+ const hasLabelSlot = this.hasSlotController.test("label");
97
+ const hasHelpTextSlot = this.hasSlotController.test("help-text");
98
+ const hasLabel = this.label ? true : !!hasLabelSlot;
99
+ const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;
100
+ return html`
101
+ <div
102
+ part="form-control"
103
+ class=${classMap({
104
+ "form-control": true,
105
+ "form-control--small": this.size === "small",
106
+ "form-control--medium": this.size === "medium",
107
+ "form-control--large": this.size === "large",
108
+ "form-control--inline": this.inline,
109
+ "form-control--disabled": this.disabled,
110
+ "form-control--focused": this.hasFocus,
111
+ "form-control--has-label": hasLabel,
112
+ "form-control--has-help-text": hasHelpText,
113
+ "form-control--has-divider": this.divider,
114
+ "form-control--filled": this.filled,
115
+ "form-control--pill": this.pill
116
+ })}
117
+ >
118
+ <label
119
+ part="form-control-label"
120
+ class="form-control__label"
121
+ for="input"
122
+ aria-hidden=${hasLabel ? "false" : "true"}
123
+ >
124
+ <slot name="label">${this.label}</slot>
125
+ </label>
126
+
127
+ <slot
128
+ name="help-text"
129
+ part="form-control-help-text"
130
+ id="help-text"
131
+ class="form-control__help-text"
132
+ aria-hidden=${hasHelpText ? "false" : "true"}
133
+ >
134
+ ${this.helpText}
135
+ </slot>
136
+
137
+ <div part="form-control-input" class=${classMap({
138
+ "form-control__input": true
139
+ })}>
140
+ <input class="input__control" placeholder="Enter text" ?disabled=${this.disabled} ?required=${this.required} @focus=${this.handleFocus} @blur=${this.handleBlur}></input>
141
+ </div>
142
+ ${this.divider ? this.renderDivider() : nothing}
143
+ </div>
144
+
145
+ </div>
146
+ `;
147
+ }
148
+ }
149
+ FlowUiBaseControl.styles = [formControlStyles, styles];
150
+ __decorateClass([
151
+ query(".input__control")
152
+ ], FlowUiBaseControl.prototype, "input", 2);
153
+ __decorateClass([
154
+ state()
155
+ ], FlowUiBaseControl.prototype, "hasFocus", 2);
156
+ __decorateClass([
157
+ property()
158
+ ], FlowUiBaseControl.prototype, "title", 2);
159
+ __decorateClass([
160
+ property({ reflect: true })
161
+ ], FlowUiBaseControl.prototype, "size", 2);
162
+ __decorateClass([
163
+ property({ type: Boolean, reflect: true })
164
+ ], FlowUiBaseControl.prototype, "filled", 2);
165
+ __decorateClass([
166
+ property({ type: Boolean, reflect: true })
167
+ ], FlowUiBaseControl.prototype, "pill", 2);
168
+ __decorateClass([
169
+ property()
170
+ ], FlowUiBaseControl.prototype, "label", 2);
171
+ __decorateClass([
172
+ property({ attribute: "help-text" })
173
+ ], FlowUiBaseControl.prototype, "helpText", 2);
174
+ __decorateClass([
175
+ property({ type: Boolean, reflect: true })
176
+ ], FlowUiBaseControl.prototype, "disabled", 2);
177
+ __decorateClass([
178
+ property({ reflect: true })
179
+ ], FlowUiBaseControl.prototype, "form", 2);
180
+ __decorateClass([
181
+ property({ type: Boolean, reflect: true })
182
+ ], FlowUiBaseControl.prototype, "required", 2);
183
+ __decorateClass([
184
+ property({ type: Boolean, reflect: true })
185
+ ], FlowUiBaseControl.prototype, "inline", 2);
186
+ __decorateClass([
187
+ property({ type: Boolean, reflect: true })
188
+ ], FlowUiBaseControl.prototype, "divider", 2);
189
+ __decorateClass([
190
+ watch("disabled", { waitUntilFirstUpdate: true })
191
+ ], FlowUiBaseControl.prototype, "handleDisabledChange", 1);
192
+
193
+ export { FlowUiBaseControl as default };
@@ -0,0 +1,5 @@
1
+ import FlowUiBaseControl from './base-control.component.mjs';
2
+
3
+
4
+
5
+ export { FlowUiBaseControl as default };
@@ -0,0 +1,39 @@
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
+ }
12
+
13
+ .form-control__input {
14
+ padding-inline: var(--input-spacing);
15
+ }
16
+
17
+ .form-control__input input {
18
+ flex: 1;
19
+ font-family: inherit;
20
+ font-size: inherit;
21
+ font-weight: inherit;
22
+ height: 100%;
23
+ color: var(--input-color);
24
+ border: none;
25
+ background: none;
26
+ box-shadow: none;
27
+ padding: 0;
28
+ margin: 0;
29
+ cursor: inherit;
30
+ outline: none;
31
+ -webkit-appearance: none;
32
+ }
33
+
34
+ .form-control.form-control--inline input {
35
+ min-width: 15ch;
36
+ }
37
+ `;
38
+
39
+ export { styles as default };
@@ -124,6 +124,8 @@ class FlowUiCalendar extends FlowRdfElement {
124
124
  @click=${() => this.stepDisplayDate({ month: -1 })}
125
125
  ></flow-ui-icon-button>
126
126
  <flow-ui-select
127
+ inline
128
+ sync="width"
127
129
  class="calendar__month-select calendar__header-select"
128
130
  value=${this._displayDate.month}
129
131
  @flow-ui-change=${this.handleHeaderSelectChange}
@@ -135,6 +137,8 @@ class FlowUiCalendar extends FlowRdfElement {
135
137
  )}
136
138
  </flow-ui-select>
137
139
  <flow-ui-select
140
+ inline
141
+ sync="width"
138
142
  class="calendar__year-select calendar__header-select"
139
143
  value=${this._displayDate.year}
140
144
  @flow-ui-change=${this.handleHeaderSelectChange}
@@ -92,15 +92,9 @@ const styles = css`
92
92
  background-color: var(--flow-ui-color-primary-500);
93
93
  }
94
94
 
95
- .calendar__header-select::part(combobox) {
96
- background-color: inherit;
97
- border: none;
98
- min-height: auto;
99
- gap: var(--flow-ui-spacing-x-small);
100
- }
101
-
102
- .calendar__header-select::part(expand-icon) {
103
- margin: 0;
95
+ .calendar__header {
96
+ justify-content: space-between;
97
+ padding-inline: var(--flow-ui-spacing-small);
104
98
  }
105
99
 
106
100
  .calendar__header-select::part(listbox) {
@@ -10,6 +10,7 @@ import { FormControlController } from '../../internal/form.mjs';
10
10
  import { HasSlotController } from '../../internal/slot.mjs';
11
11
  import { watch } from '../../internal/watch.mjs';
12
12
  import styles from './checkbox.styles.mjs';
13
+ import formControlStyles from '../../styles/form-control.styles.mjs';
13
14
 
14
15
  var __defProp = Object.defineProperty;
15
16
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -41,7 +42,6 @@ class FlowUiCheckbox extends FlowRdfFormControl {
41
42
  this.defaultChecked = false;
42
43
  this.form = "";
43
44
  this.required = false;
44
- this.fullWidth = false;
45
45
  }
46
46
  connectedCallback() {
47
47
  super.connectedCallback();
@@ -49,7 +49,6 @@ class FlowUiCheckbox extends FlowRdfFormControl {
49
49
  this.indeterminate = boolean(this.indeterminate, true);
50
50
  this.disabled = boolean(this.disabled, true);
51
51
  this.required = boolean(this.required, true);
52
- this.fullWidth = boolean(this.fullWidth, true);
53
52
  }
54
53
  /** Gets the validity state object */
55
54
  get validity() {
@@ -134,14 +133,7 @@ class FlowUiCheckbox extends FlowRdfFormControl {
134
133
  "checkbox--indeterminate": this.indeterminate,
135
134
  "checkbox--small": this.size === "small",
136
135
  "checkbox--medium": this.size === "medium",
137
- "checkbox--large": this.size === "large",
138
- "checkbox--primary": this.variant === "primary",
139
- "checkbox--secondary": this.variant === "secondary",
140
- "checkbox--success": this.variant === "success",
141
- "checkbox--warning": this.variant === "warning",
142
- "checkbox--danger": this.variant === "danger",
143
- "checkbox--neutral": this.variant === "neutral",
144
- "checkbox--full-width": this.fullWidth
136
+ "checkbox--large": this.size === "large"
145
137
  })}
146
138
  >
147
139
  <input
@@ -193,7 +185,7 @@ class FlowUiCheckbox extends FlowRdfFormControl {
193
185
  `;
194
186
  }
195
187
  }
196
- FlowUiCheckbox.styles = styles;
188
+ FlowUiCheckbox.styles = [formControlStyles, styles];
197
189
  __decorateClass([
198
190
  query('input[type="checkbox"]')
199
191
  ], FlowUiCheckbox.prototype, "input", 2);
@@ -230,12 +222,6 @@ __decorateClass([
230
222
  __decorateClass([
231
223
  property({ type: Boolean, reflect: true })
232
224
  ], FlowUiCheckbox.prototype, "required", 2);
233
- __decorateClass([
234
- property()
235
- ], FlowUiCheckbox.prototype, "variant", 2);
236
- __decorateClass([
237
- property({ type: Boolean, reflect: true, attribute: "full-width" })
238
- ], FlowUiCheckbox.prototype, "fullWidth", 2);
239
225
  __decorateClass([
240
226
  watch("disabled", { waitUntilFirstUpdate: true })
241
227
  ], FlowUiCheckbox.prototype, "handleDisabledChange", 1);
@@ -7,9 +7,8 @@ const styles = css`
7
7
  :host {
8
8
  display: inline-block;
9
9
 
10
- --checkbox-color: var(--flow-ui-color-secondary-500);
11
- --checkbox-check-color: var(--flow-ui-color-secondary-contrast);
12
- --checkbox-hover-color: var(--flow-ui-color-secondary-400);
10
+ --checkbox-color: var(--flow-ui-checkbox-color, var(--flow-ui-color-primary-500));
11
+ --checkbox-check-color: var(--flow-ui-checkbox-check-color, var(--flow-ui-color-primary-contrast));
13
12
  }
14
13
 
15
14
  .checkbox {
@@ -39,54 +38,6 @@ const styles = css`
39
38
  font-size: var(--flow-ui-input-font-size-large);
40
39
  }
41
40
 
42
- /* Color variants */
43
- .checkbox--primary {
44
- --checkbox-color: var(--flow-ui-color-primary-500);
45
- --checkbox-hover-color: var(--flow-ui-color-primary-400);
46
- }
47
-
48
- .checkbox--secondary {
49
- --checkbox-color: var(--flow-ui-color-secondary-500);
50
- --checkbox-hover-color: var(--flow-ui-color-secondary-400);
51
- }
52
-
53
- .checkbox--success {
54
- --checkbox-color: var(--flow-ui-color-success-500);
55
- --checkbox-hover-color: var(--flow-ui-color-success-400);
56
- }
57
-
58
- .checkbox--warning {
59
- --checkbox-color: var(--flow-ui-color-warning-500);
60
- --checkbox-hover-color: var(--flow-ui-color-warning-400);
61
- }
62
-
63
- .checkbox--danger {
64
- --checkbox-color: var(--flow-ui-color-danger-500);
65
- --checkbox-hover-color: var(--flow-ui-color-danger-400);
66
- }
67
-
68
- .checkbox--neutral {
69
- --checkbox-color: var(--flow-ui-color-neutral-500);
70
- --checkbox-hover-color: var(--flow-ui-color-neutral-400);
71
- }
72
-
73
- /* Alternative 'full-width' style */
74
- :host([full-width]) {
75
- display: block;
76
- margin-top: var(--flow-ui-spacing-small);
77
- }
78
-
79
- .checkbox--full-width {
80
- display: flex;
81
- flex-direction: row-reverse;
82
- align-items: center;
83
- }
84
-
85
- .checkbox--full-width .checkbox__label {
86
- flex: 1;
87
- margin: 0;
88
- }
89
-
90
41
  .checkbox__control {
91
42
  flex: 0 0 auto;
92
43
  position: relative;
@@ -140,13 +91,6 @@ const styles = css`
140
91
  background-color: var(--checkbox-color);
141
92
  }
142
93
 
143
- /* Checked/indeterminate + hover */
144
- .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,
145
- .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover {
146
- border-color: var(--checkbox-hover-color);
147
- background-color: var(--checkbox-hover-color);
148
- }
149
-
150
94
  /* Checked/indeterminate + focus */
151
95
  .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control,
152
96
  .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {