vira 31.31.7 → 32.0.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/dist/elements/color/vira-all-color-space-sliders.element.d.ts +11 -0
- package/dist/elements/color/vira-all-color-space-sliders.element.js +55 -0
- package/dist/elements/color/vira-all-spaces-color-picker.element.d.ts +15 -0
- package/dist/elements/color/vira-all-spaces-color-picker.element.js +73 -0
- package/dist/elements/color/vira-color-details.element.d.ts +14 -0
- package/dist/elements/color/vira-color-details.element.js +153 -0
- package/dist/elements/color/vira-color-format-sliders.element.d.ts +14 -0
- package/dist/elements/color/vira-color-format-sliders.element.js +60 -0
- package/dist/elements/color/vira-color-pair-contrast-summary.element.d.ts +9 -0
- package/dist/elements/color/vira-color-pair-contrast-summary.element.js +308 -0
- package/dist/elements/color/vira-color-pair.element.d.ts +17 -0
- package/dist/elements/color/vira-color-pair.element.js +201 -0
- package/dist/elements/color/vira-color-picker.element.d.ts +20 -0
- package/dist/elements/color/vira-color-picker.element.js +278 -0
- package/dist/elements/color/vira-color-slider.element.d.ts +14 -0
- package/dist/elements/color/vira-color-slider.element.js +124 -0
- package/dist/elements/color/vira-color-swatch.element.d.ts +20 -0
- package/dist/elements/color/vira-color-swatch.element.js +48 -0
- package/dist/elements/color/vira-contrast-indicator.element.d.ts +10 -0
- package/dist/elements/color/vira-contrast-indicator.element.js +96 -0
- package/dist/elements/index.d.ts +10 -0
- package/dist/elements/index.js +10 -0
- package/dist/elements/pop-up/vira-menu-item.element.d.ts +1 -1
- package/dist/elements/pop-up/vira-menu-item.element.js +20 -8
- package/dist/elements/pop-up/vira-menu-trigger.element.d.ts +1 -1
- package/dist/elements/pop-up/vira-menu-trigger.element.js +3 -1
- package/dist/elements/pop-up/vira-menu.element.js +10 -4
- package/dist/elements/pop-up/vira-pop-up-trigger.element.d.ts +3 -3
- package/dist/elements/pop-up/vira-pop-up-trigger.element.js +24 -10
- package/dist/elements/vira-bold-text.element.js +4 -2
- package/dist/elements/vira-button.element.d.ts +1 -8
- package/dist/elements/vira-button.element.js +28 -37
- package/dist/elements/vira-card.element.js +7 -3
- package/dist/elements/vira-checkbox.element.d.ts +1 -1
- package/dist/elements/vira-checkbox.element.js +13 -5
- package/dist/elements/vira-collapsible-card.element.d.ts +1 -1
- package/dist/elements/vira-collapsible-card.element.js +13 -5
- package/dist/elements/vira-collapsible-wrapper.element.d.ts +1 -1
- package/dist/elements/vira-collapsible-wrapper.element.js +7 -3
- package/dist/elements/vira-date-input.element.d.ts +1 -1
- package/dist/elements/vira-date-input.element.js +10 -4
- package/dist/elements/vira-drawer.element.d.ts +1 -1
- package/dist/elements/vira-drawer.element.js +14 -6
- package/dist/elements/vira-dropdown.element.d.ts +2 -8
- package/dist/elements/vira-dropdown.element.js +6 -10
- package/dist/elements/vira-error.element.js +1 -1
- package/dist/elements/vira-form.element.d.ts +2 -2
- package/dist/elements/vira-form.element.js +36 -22
- package/dist/elements/vira-icon.element.js +4 -2
- package/dist/elements/vira-image.element.d.ts +2 -2
- package/dist/elements/vira-image.element.js +7 -3
- package/dist/elements/vira-input.element.d.ts +2 -2
- package/dist/elements/vira-input.element.js +23 -9
- package/dist/elements/vira-json-form.element.d.ts +1 -1
- package/dist/elements/vira-json-form.element.js +18 -8
- package/dist/elements/vira-link.element.js +5 -3
- package/dist/elements/vira-modal.element.d.ts +1 -1
- package/dist/elements/vira-modal.element.js +14 -6
- package/dist/elements/vira-progress.element.js +1 -1
- package/dist/elements/vira-select.element.d.ts +1 -1
- package/dist/elements/vira-select.element.js +20 -8
- package/dist/elements/vira-tabs.element.d.ts +2 -2
- package/dist/elements/vira-tabs.element.js +35 -21
- package/dist/elements/vira-tag.element.d.ts +3 -3
- package/dist/elements/vira-tag.element.js +46 -18
- package/dist/elements/vira-text-area.element.d.ts +2 -2
- package/dist/elements/vira-text-area.element.js +16 -6
- package/dist/util/color-local-storage.client.d.ts +4 -0
- package/dist/util/color-local-storage.client.js +6 -0
- package/dist/util/define-vira-element.js +1 -1
- package/dist/util/vira-json-schema.js +9 -9
- package/package.json +11 -11
- package/dist/icons/icon-color.test-helper.d.ts +0 -6
- package/dist/icons/icon-color.test-helper.js +0 -9
|
@@ -4,7 +4,7 @@ import { ContrastLevelName } from '@electrovir/color/dist/data/contrast/contrast
|
|
|
4
4
|
import { classMap, css, defineElementEvent, html, listen, nothing, onDomCreated, unsafeCSS, } from 'element-vir';
|
|
5
5
|
import { routeHasPaths, } from 'spa-router-vir';
|
|
6
6
|
import { themeDefaultKey } from 'theme-vir/dist/color-theme/color-theme.js';
|
|
7
|
-
import {
|
|
7
|
+
import { ChevronDown16Icon } from '../icons/icon-svgs/16/chevron-down-16.icon.js';
|
|
8
8
|
import { createFocusStyles } from '../styles/focus.js';
|
|
9
9
|
import { viraFontCssVars } from '../styles/font.js';
|
|
10
10
|
import { viraFormCssVars } from '../styles/form-styles.js';
|
|
@@ -126,42 +126,54 @@ export const ViraTabs = defineViraElement()({
|
|
|
126
126
|
};
|
|
127
127
|
},
|
|
128
128
|
hostClasses: {
|
|
129
|
-
'vira-tabs-bar-top'
|
|
130
|
-
|
|
129
|
+
'vira-tabs-bar-top'({ inputs }) {
|
|
130
|
+
return inputs.barDirection === ViraTabsBarDirection.Top;
|
|
131
|
+
},
|
|
132
|
+
'vira-tabs-bar-bottom'({ inputs }) {
|
|
131
133
|
return !inputs.barDirection || inputs.barDirection === ViraTabsBarDirection.Bottom;
|
|
132
134
|
},
|
|
133
|
-
'vira-tabs-bar-left'
|
|
134
|
-
|
|
135
|
+
'vira-tabs-bar-left'({ inputs }) {
|
|
136
|
+
return inputs.barDirection === ViraTabsBarDirection.Left;
|
|
137
|
+
},
|
|
138
|
+
'vira-tabs-bar-right'({ inputs }) {
|
|
139
|
+
return inputs.barDirection === ViraTabsBarDirection.Right;
|
|
140
|
+
},
|
|
135
141
|
...arrayToObject(getObjectTypedKeys(viraColorVariantToHostClassKey), (colorVariant) => {
|
|
136
142
|
const colorKey = viraColorVariantToHostClassKey[colorVariant];
|
|
137
143
|
return {
|
|
138
144
|
key: `vira-tabs-color-${colorKey}`,
|
|
139
|
-
value
|
|
145
|
+
value({ inputs, }) {
|
|
140
146
|
return inputs.color === colorVariant || inputs.color === colorKey;
|
|
141
147
|
},
|
|
142
148
|
};
|
|
143
149
|
}, {
|
|
144
150
|
useRequired: true,
|
|
145
151
|
}),
|
|
146
|
-
'vira-tabs-color-plain'
|
|
147
|
-
|
|
152
|
+
'vira-tabs-color-plain'({ inputs, }) {
|
|
153
|
+
return !inputs.color || inputs.color === ViraColorVariant.Plain;
|
|
154
|
+
},
|
|
155
|
+
'vira-tabs-color-neutral'({ inputs, }) {
|
|
156
|
+
return inputs.color === ViraColorVariant.Neutral;
|
|
157
|
+
},
|
|
148
158
|
...arrayToObject(standaloneThemeColorNames, (colorName) => {
|
|
149
159
|
return {
|
|
150
160
|
key: `vira-tabs-color-${colorName}`,
|
|
151
|
-
value
|
|
161
|
+
value({ inputs, }) {
|
|
152
162
|
return inputs.color === colorName;
|
|
153
163
|
},
|
|
154
164
|
};
|
|
155
165
|
}, {
|
|
156
166
|
useRequired: true,
|
|
157
167
|
}),
|
|
158
|
-
'vira-tabs-icon-layout-vertical'
|
|
168
|
+
'vira-tabs-icon-layout-vertical'({ inputs }) {
|
|
159
169
|
return !inputs.iconLayout || inputs.iconLayout === ViraTabsIconLayout.Vertical;
|
|
160
170
|
},
|
|
161
|
-
'vira-tabs-icon-layout-horizontal'
|
|
171
|
+
'vira-tabs-icon-layout-horizontal'({ inputs }) {
|
|
162
172
|
return inputs.iconLayout === ViraTabsIconLayout.Horizontal;
|
|
163
173
|
},
|
|
164
|
-
'vira-tabs-fill-width'
|
|
174
|
+
'vira-tabs-fill-width'({ inputs }) {
|
|
175
|
+
return !!inputs.shouldFillWidth;
|
|
176
|
+
},
|
|
165
177
|
},
|
|
166
178
|
cssVars: {
|
|
167
179
|
'vira-tabs-active-color': viraThemeByKeys[viraColorVariantToHostClassKey[ViraColorVariant.Info]]['behind-bg'][ContrastLevelName.NonBodyText].background.value,
|
|
@@ -170,7 +182,7 @@ export const ViraTabs = defineViraElement()({
|
|
|
170
182
|
'vira-tabs-inactive-hover-color': viraTheme.colors[themeDefaultKey].foreground.value,
|
|
171
183
|
'vira-tabs-bar-thickness': '2px',
|
|
172
184
|
},
|
|
173
|
-
styles
|
|
185
|
+
styles({ hostClasses, cssVars }) {
|
|
174
186
|
function buildThemedTabsColors(colorName) {
|
|
175
187
|
return {
|
|
176
188
|
active: viraThemeByKeys[colorName]['behind-bg'][ContrastLevelName.NonBodyText]
|
|
@@ -496,7 +508,9 @@ export const ViraTabs = defineViraElement()({
|
|
|
496
508
|
}
|
|
497
509
|
function handleTabClick(tab) {
|
|
498
510
|
if (!tab.isDisabled) {
|
|
499
|
-
dispatch(new events.tabSelect(
|
|
511
|
+
dispatch(new events.tabSelect({
|
|
512
|
+
detail: tab,
|
|
513
|
+
}));
|
|
500
514
|
}
|
|
501
515
|
}
|
|
502
516
|
function renderTabItem(tab) {
|
|
@@ -743,13 +757,13 @@ export const ViraTabs = defineViraElement()({
|
|
|
743
757
|
/**
|
|
744
758
|
* Hidden copies of the "more" button in each of its possible shapes, rendered inside the
|
|
745
759
|
* measurement mirror so their true widths can be measured before choosing which one fits:
|
|
746
|
-
* the default overflow label, and the collapsed selected tab's own label
|
|
747
|
-
* checkmark).
|
|
760
|
+
* the default overflow label, and the collapsed selected tab's own label, with a caret.
|
|
748
761
|
*/
|
|
749
762
|
const measureMoreButtons = html `
|
|
750
763
|
<${ViraButton.assign({
|
|
751
764
|
text: overflowLabel,
|
|
752
|
-
|
|
765
|
+
icon: ChevronDown16Icon,
|
|
766
|
+
showIconOnRight: true,
|
|
753
767
|
color: ViraColorVariant.Neutral,
|
|
754
768
|
})}
|
|
755
769
|
class="measure-more-default"
|
|
@@ -758,8 +772,8 @@ export const ViraTabs = defineViraElement()({
|
|
|
758
772
|
? html `
|
|
759
773
|
<${ViraButton.assign({
|
|
760
774
|
text: selectedTab.label,
|
|
761
|
-
icon:
|
|
762
|
-
|
|
775
|
+
icon: ChevronDown16Icon,
|
|
776
|
+
showIconOnRight: true,
|
|
763
777
|
color: ViraColorVariant.Neutral,
|
|
764
778
|
})}
|
|
765
779
|
class="measure-more-labeled"
|
|
@@ -778,8 +792,8 @@ export const ViraTabs = defineViraElement()({
|
|
|
778
792
|
})}>
|
|
779
793
|
<${ViraButton.assign({
|
|
780
794
|
text: selectedIsCollapsed ? selectedTab?.label : overflowLabel,
|
|
781
|
-
icon:
|
|
782
|
-
|
|
795
|
+
icon: ChevronDown16Icon,
|
|
796
|
+
showIconOnRight: true,
|
|
783
797
|
color: ViraColorVariant.Neutral,
|
|
784
798
|
})}
|
|
785
799
|
slot=${ViraMenuTrigger.slotNames['vira-menu-trigger-trigger']}
|
|
@@ -35,6 +35,6 @@ export declare const ViraTag: import("element-vir").DeclarativeElementDefinition
|
|
|
35
35
|
color: ViraColorVariant | ViraThemeColorName;
|
|
36
36
|
disabled: boolean;
|
|
37
37
|
}>, {}, {
|
|
38
|
-
toggle: import("element-vir").
|
|
39
|
-
cancel: import("element-vir").
|
|
40
|
-
}, "vira-tag-
|
|
38
|
+
toggle: import("element-vir").DefineElementEvent<boolean>;
|
|
39
|
+
cancel: import("element-vir").DefineElementEvent<void>;
|
|
40
|
+
}, "vira-tag-color-red" | "vira-tag-color-yellow" | "vira-tag-color-green" | "vira-tag-color-blue" | "vira-tag-color-brand" | "vira-tag-color-purple" | "vira-tag-color-plain" | "vira-tag-color-neutral" | "vira-tag-color-teal" | "vira-tag-color-pink" | "vira-tag-color-grey" | "vira-tag-selectable" | "vira-tag-checked" | "vira-tag-not-checked" | "vira-tag-cancellable" | "vira-tag-not-clickable" | "vira-tag-disabled" | "vira-tag-size-large" | "vira-tag-size-medium" | "vira-tag-size-small" | "vira-tag-emphasis-standard" | "vira-tag-emphasis-subtle", "vira-tag-text-color" | "vira-tag-background-color" | "vira-tag-border-color" | "vira-tag-hover-text-color" | "vira-tag-hover-background-color" | "vira-tag-hover-border-color" | "vira-tag-active-text-color" | "vira-tag-active-background-color" | "vira-tag-active-border-color" | "vira-tag-disabled-text-color" | "vira-tag-disabled-background-color" | "vira-tag-disabled-border-color" | "vira-tag-border-radius" | "vira-tag-gap" | "vira-tag-horizontal-padding" | "vira-tag-border-width", readonly [], readonly []>;
|
|
@@ -161,36 +161,60 @@ export const ViraTag = defineViraElement()({
|
|
|
161
161
|
cancel: defineElementEvent(),
|
|
162
162
|
},
|
|
163
163
|
hostClasses: {
|
|
164
|
-
'vira-tag-selectable'
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
'vira-tag-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
'vira-tag-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
'vira-tag-
|
|
164
|
+
'vira-tag-selectable'({ inputs }) {
|
|
165
|
+
return check.isBoolean(inputs.isClickable?.selected);
|
|
166
|
+
},
|
|
167
|
+
'vira-tag-checked'({ inputs }) {
|
|
168
|
+
return !!inputs.isClickable?.selected;
|
|
169
|
+
},
|
|
170
|
+
'vira-tag-not-checked'({ inputs }) {
|
|
171
|
+
return inputs.isClickable?.selected === false;
|
|
172
|
+
},
|
|
173
|
+
'vira-tag-cancellable'({ inputs }) {
|
|
174
|
+
return !!inputs.isClickable?.cancellable;
|
|
175
|
+
},
|
|
176
|
+
'vira-tag-not-clickable'({ inputs }) {
|
|
177
|
+
return !inputs.isClickable;
|
|
178
|
+
},
|
|
179
|
+
'vira-tag-disabled'({ inputs }) {
|
|
180
|
+
return !!inputs.disabled;
|
|
181
|
+
},
|
|
182
|
+
'vira-tag-size-large'({ inputs }) {
|
|
183
|
+
return inputs.size === ViraSize.Large;
|
|
184
|
+
},
|
|
185
|
+
'vira-tag-size-medium'({ inputs }) {
|
|
186
|
+
return !inputs.size || inputs.size === ViraSize.Medium;
|
|
187
|
+
},
|
|
188
|
+
'vira-tag-size-small'({ inputs }) {
|
|
189
|
+
return inputs.size === ViraSize.Small;
|
|
190
|
+
},
|
|
191
|
+
'vira-tag-emphasis-standard'({ inputs }) {
|
|
174
192
|
return !inputs.emphasis || inputs.emphasis === ViraEmphasis.Standard;
|
|
175
193
|
},
|
|
176
|
-
'vira-tag-emphasis-subtle'
|
|
194
|
+
'vira-tag-emphasis-subtle'({ inputs }) {
|
|
195
|
+
return inputs.emphasis === ViraEmphasis.Subtle;
|
|
196
|
+
},
|
|
177
197
|
...arrayToObject(getObjectTypedKeys(viraColorVariantToHostClassKey), (colorVariant) => {
|
|
178
198
|
const colorKey = viraColorVariantToHostClassKey[colorVariant];
|
|
179
199
|
return {
|
|
180
200
|
key: `vira-tag-color-${colorKey}`,
|
|
181
|
-
value
|
|
201
|
+
value({ inputs, }) {
|
|
182
202
|
return inputs.color === colorVariant || inputs.color === colorKey;
|
|
183
203
|
},
|
|
184
204
|
};
|
|
185
205
|
}, {
|
|
186
206
|
useRequired: true,
|
|
187
207
|
}),
|
|
188
|
-
'vira-tag-color-plain'
|
|
189
|
-
|
|
208
|
+
'vira-tag-color-plain'({ inputs, }) {
|
|
209
|
+
return !inputs.color || inputs.color === ViraColorVariant.Plain;
|
|
210
|
+
},
|
|
211
|
+
'vira-tag-color-neutral'({ inputs, }) {
|
|
212
|
+
return inputs.color === ViraColorVariant.Neutral;
|
|
213
|
+
},
|
|
190
214
|
...arrayToObject(standaloneThemeColorNames, (colorName) => {
|
|
191
215
|
return {
|
|
192
216
|
key: `vira-tag-color-${colorName}`,
|
|
193
|
-
value
|
|
217
|
+
value({ inputs, }) {
|
|
194
218
|
return inputs.color === colorName;
|
|
195
219
|
},
|
|
196
220
|
};
|
|
@@ -198,7 +222,7 @@ export const ViraTag = defineViraElement()({
|
|
|
198
222
|
useRequired: true,
|
|
199
223
|
}),
|
|
200
224
|
},
|
|
201
|
-
styles
|
|
225
|
+
styles({ cssVars, hostClasses }) {
|
|
202
226
|
function buildVariantCssRule({ variantSelector, emphasisSelector, colors, }) {
|
|
203
227
|
return css `
|
|
204
228
|
${variantSelector}${emphasisSelector} {
|
|
@@ -432,10 +456,14 @@ export const ViraTag = defineViraElement()({
|
|
|
432
456
|
return;
|
|
433
457
|
}
|
|
434
458
|
else if (inputs.isClickable?.selected != undefined) {
|
|
435
|
-
dispatch(new events.toggle(
|
|
459
|
+
dispatch(new events.toggle({
|
|
460
|
+
detail: !inputs.isClickable.selected,
|
|
461
|
+
}));
|
|
436
462
|
}
|
|
437
463
|
else if (inputs.isClickable?.cancellable) {
|
|
438
|
-
dispatch(new events.cancel(
|
|
464
|
+
dispatch(new events.cancel({
|
|
465
|
+
detail: undefined,
|
|
466
|
+
}));
|
|
439
467
|
}
|
|
440
468
|
})}
|
|
441
469
|
>
|
|
@@ -38,11 +38,11 @@ export declare const ViraTextArea: import("element-vir").DeclarativeElementDefin
|
|
|
38
38
|
* Fires whenever a user input created a new value. Does not fire if all input letters are
|
|
39
39
|
* filtered out due to input restrictions.
|
|
40
40
|
*/
|
|
41
|
-
valueChange: import("element-vir").
|
|
41
|
+
valueChange: import("element-vir").DefineElementEvent<string>;
|
|
42
42
|
/**
|
|
43
43
|
* Fires when inputs are blocked. Useful for showing warnings or error messages to inform
|
|
44
44
|
* the user why their input did not propagate if it was blocked. This does not fire for text
|
|
45
45
|
* that was blocked out of programmatic "value" property assignments.
|
|
46
46
|
*/
|
|
47
|
-
inputBlocked: import("element-vir").
|
|
47
|
+
inputBlocked: import("element-vir").DefineElementEvent<string>;
|
|
48
48
|
}, "vira-text-area-disabled" | "vira-text-area-error" | "vira-text-area-prevent-resize", "vira-text-area-padding-horizontal" | "vira-text-area-padding-vertical", readonly [], readonly []>;
|
|
@@ -20,7 +20,7 @@ export const ViraTextArea = defineViraElement()({
|
|
|
20
20
|
'vira-text-area-padding-horizontal': '12px',
|
|
21
21
|
'vira-text-area-padding-vertical': '8px',
|
|
22
22
|
},
|
|
23
|
-
styles
|
|
23
|
+
styles({ hostClasses, cssVars }) {
|
|
24
24
|
return css `
|
|
25
25
|
:host {
|
|
26
26
|
position: relative;
|
|
@@ -151,9 +151,15 @@ export const ViraTextArea = defineViraElement()({
|
|
|
151
151
|
};
|
|
152
152
|
},
|
|
153
153
|
hostClasses: {
|
|
154
|
-
'vira-text-area-disabled'
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
'vira-text-area-disabled'({ inputs }) {
|
|
155
|
+
return !!inputs.disabled;
|
|
156
|
+
},
|
|
157
|
+
'vira-text-area-error'({ inputs }) {
|
|
158
|
+
return !!inputs.hasError;
|
|
159
|
+
},
|
|
160
|
+
'vira-text-area-prevent-resize'({ inputs }) {
|
|
161
|
+
return !!inputs.preventResize || !!inputs.disabled;
|
|
162
|
+
},
|
|
157
163
|
},
|
|
158
164
|
render({ inputs, dispatch, state, events }) {
|
|
159
165
|
const { filtered: filteredValue } = filterTextInputValue({
|
|
@@ -197,10 +203,14 @@ export const ViraTextArea = defineViraElement()({
|
|
|
197
203
|
event,
|
|
198
204
|
elementConstructor: HTMLTextAreaElement,
|
|
199
205
|
inputBlockedCallback(blockedInput) {
|
|
200
|
-
dispatch(new events.inputBlocked(
|
|
206
|
+
dispatch(new events.inputBlocked({
|
|
207
|
+
detail: blockedInput,
|
|
208
|
+
}));
|
|
201
209
|
},
|
|
202
210
|
newValueCallback(newValue) {
|
|
203
|
-
dispatch(new events.valueChange(
|
|
211
|
+
dispatch(new events.valueChange({
|
|
212
|
+
detail: newValue,
|
|
213
|
+
}));
|
|
204
214
|
},
|
|
205
215
|
});
|
|
206
216
|
})}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { LocalStorageClient } from '@electrovir/local-storage-client';
|
|
2
|
+
export declare const colorLocalStorageClient: LocalStorageClient<{
|
|
3
|
+
lastFormat: import("object-shape-tester").Shape<import("@sinclair/typebox").TUnion<(import("@sinclair/typebox").TLiteral<"rgb"> | import("@sinclair/typebox").TLiteral<"hex"> | import("@sinclair/typebox").TLiteral<"hsl"> | import("@sinclair/typebox").TLiteral<"hwb"> | import("@sinclair/typebox").TLiteral<"lab"> | import("@sinclair/typebox").TLiteral<"lch"> | import("@sinclair/typebox").TLiteral<"oklab"> | import("@sinclair/typebox").TLiteral<"oklch">)[]>>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ColorFormatName } from '@electrovir/color/dist/data/color-class/color-formats.js';
|
|
2
|
+
import { LocalStorageClient } from '@electrovir/local-storage-client';
|
|
3
|
+
import { enumShape } from 'object-shape-tester';
|
|
4
|
+
export const colorLocalStorageClient = new LocalStorageClient({
|
|
5
|
+
lastFormat: enumShape(ColorFormatName),
|
|
6
|
+
});
|
|
@@ -11,7 +11,7 @@ export const ViraTagNamePrefix = 'vira-';
|
|
|
11
11
|
* @category Internal
|
|
12
12
|
*/
|
|
13
13
|
export const defineViraElement = wrapDefineElement({
|
|
14
|
-
assertInputs
|
|
14
|
+
assertInputs(inputs) {
|
|
15
15
|
if (!inputs.tagName.startsWith(ViraTagNamePrefix)) {
|
|
16
16
|
throw new Error(`Tag name should start with '${ViraTagNamePrefix}' but got '${inputs.tagName}'`);
|
|
17
17
|
}
|
|
@@ -72,7 +72,7 @@ export function getJsonType(value) {
|
|
|
72
72
|
* @category Internal
|
|
73
73
|
*/
|
|
74
74
|
export function normalizeSchema(schema) {
|
|
75
|
-
if (schema
|
|
75
|
+
if (schema == undefined || schema === false) {
|
|
76
76
|
return undefined;
|
|
77
77
|
}
|
|
78
78
|
else if (schema === true) {
|
|
@@ -276,7 +276,7 @@ export function getPropertySchema(parentSchema, key, context) {
|
|
|
276
276
|
return undefined;
|
|
277
277
|
}
|
|
278
278
|
const propertySchema = branch.properties?.[key];
|
|
279
|
-
if (propertySchema
|
|
279
|
+
if (propertySchema != undefined) {
|
|
280
280
|
return propertySchema;
|
|
281
281
|
}
|
|
282
282
|
const patternProperties = branch.patternProperties;
|
|
@@ -330,7 +330,7 @@ export function getNewItemSchema(parentSchema, currentLength, context) {
|
|
|
330
330
|
* @category Internal
|
|
331
331
|
*/
|
|
332
332
|
export function getAdditionalPropertiesSchema(parentSchema, context) {
|
|
333
|
-
if (parentSchema
|
|
333
|
+
if (parentSchema == undefined) {
|
|
334
334
|
return {
|
|
335
335
|
allowed: true,
|
|
336
336
|
schema: undefined,
|
|
@@ -344,7 +344,7 @@ export function getAdditionalPropertiesSchema(parentSchema, context) {
|
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
346
|
const additional = branch.additionalProperties;
|
|
347
|
-
if (additional
|
|
347
|
+
if (additional == undefined || additional === false) {
|
|
348
348
|
return {
|
|
349
349
|
allowed: false,
|
|
350
350
|
schema: undefined,
|
|
@@ -477,7 +477,7 @@ function isJsonValueMatchingType(value, type) {
|
|
|
477
477
|
* @category Internal
|
|
478
478
|
*/
|
|
479
479
|
export function validateAgainstSchema(value, schema) {
|
|
480
|
-
if (schema
|
|
480
|
+
if (schema == undefined) {
|
|
481
481
|
return [];
|
|
482
482
|
}
|
|
483
483
|
const context = createResolveContext(schema);
|
|
@@ -566,7 +566,7 @@ function validateBranch({ value, branch, path, context, errors, }) {
|
|
|
566
566
|
propKey,
|
|
567
567
|
];
|
|
568
568
|
const propSchema = branch.properties?.[propKey];
|
|
569
|
-
if (propSchema
|
|
569
|
+
if (propSchema != undefined) {
|
|
570
570
|
validateRecursive({
|
|
571
571
|
value: propValue,
|
|
572
572
|
schema: propSchema,
|
|
@@ -587,7 +587,7 @@ function validateBranch({ value, branch, path, context, errors, }) {
|
|
|
587
587
|
errors,
|
|
588
588
|
});
|
|
589
589
|
}
|
|
590
|
-
else if (additional
|
|
590
|
+
else if (additional == undefined && definedKeys.size > 0) {
|
|
591
591
|
continue;
|
|
592
592
|
}
|
|
593
593
|
}
|
|
@@ -601,7 +601,7 @@ function validateBranch({ value, branch, path, context, errors, }) {
|
|
|
601
601
|
];
|
|
602
602
|
if (check.isArray(items)) {
|
|
603
603
|
const tupleSchema = items[index] ?? branch.additionalItems;
|
|
604
|
-
if (tupleSchema
|
|
604
|
+
if (tupleSchema != undefined) {
|
|
605
605
|
validateRecursive({
|
|
606
606
|
value: item,
|
|
607
607
|
schema: tupleSchema,
|
|
@@ -611,7 +611,7 @@ function validateBranch({ value, branch, path, context, errors, }) {
|
|
|
611
611
|
});
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
|
-
else if (items
|
|
614
|
+
else if (items != undefined) {
|
|
615
615
|
validateRecursive({
|
|
616
616
|
value: item,
|
|
617
617
|
schema: items,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vira",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "32.0.0",
|
|
4
4
|
"description": "A simple and highly versatile design system using element-vir.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"test:docs": "virmator docs check"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@augment-vir/assert": "^32.
|
|
42
|
-
"@augment-vir/common": "^32.
|
|
43
|
-
"@augment-vir/web": "^32.
|
|
44
|
-
"@electrovir/color": "^
|
|
41
|
+
"@augment-vir/assert": "^32.3.0",
|
|
42
|
+
"@augment-vir/common": "^32.3.0",
|
|
43
|
+
"@augment-vir/web": "^32.3.0",
|
|
44
|
+
"@electrovir/color": "^2.0.0",
|
|
45
45
|
"@electrovir/local-storage-client": "^0.1.1",
|
|
46
46
|
"date-vir": "^9.1.1",
|
|
47
|
-
"device-navigation": "^
|
|
47
|
+
"device-navigation": "^5.0.0",
|
|
48
48
|
"json-schema-to-ts": "^3.1.1",
|
|
49
49
|
"lit-css-vars": "^3.6.3",
|
|
50
50
|
"object-shape-tester": "^6.15.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"typed-event-target": "^4.3.3"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@augment-vir/test": "^32.
|
|
57
|
+
"@augment-vir/test": "^32.3.0",
|
|
58
58
|
"@web/dev-server-esbuild": "^2.0.0",
|
|
59
59
|
"@web/test-runner": "^1.0.0",
|
|
60
60
|
"@web/test-runner-commands": "^1.0.1",
|
|
@@ -62,18 +62,18 @@
|
|
|
62
62
|
"@web/test-runner-visual-regression": "^1.0.1",
|
|
63
63
|
"esbuild": "^0.28.2",
|
|
64
64
|
"istanbul-smart-text-reporter": "^1.1.5",
|
|
65
|
-
"lucide-static": "^1.
|
|
65
|
+
"lucide-static": "^1.42.0",
|
|
66
66
|
"markdown-code-example-inserter": "^3.0.6",
|
|
67
|
-
"theme-vir": "^
|
|
67
|
+
"theme-vir": "^29.0.0",
|
|
68
68
|
"typedoc": "^0.28.20",
|
|
69
69
|
"typescript": "^6.0.3",
|
|
70
70
|
"vite": "^8.2.2",
|
|
71
71
|
"vite-tsconfig-paths": "^6.1.1"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"element-vir": "^
|
|
74
|
+
"element-vir": "^27.0.0",
|
|
75
75
|
"lucide-static": ">=0.460",
|
|
76
|
-
"theme-vir": "
|
|
76
|
+
"theme-vir": "^29.0.0"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": ">=22"
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export var ColorType;
|
|
2
|
-
(function (ColorType) {
|
|
3
|
-
ColorType["Color"] = "color";
|
|
4
|
-
ColorType["Fill"] = "fill";
|
|
5
|
-
ColorType["Stroke"] = "stroke";
|
|
6
|
-
})(ColorType || (ColorType = {}));
|
|
7
|
-
export function extractIconColor(element, colorType) {
|
|
8
|
-
return window.getComputedStyle(element).getPropertyValue(colorType);
|
|
9
|
-
}
|