vira 31.31.0 → 31.31.2
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/pop-up/vira-menu-item.element.js +57 -55
- package/dist/elements/pop-up/vira-menu.element.js +33 -31
- package/dist/elements/pop-up/vira-pop-up-trigger.element.js +57 -55
- package/dist/elements/vira-absolute-time.element.d.ts +3 -3
- package/dist/elements/vira-bold-text.element.js +35 -33
- package/dist/elements/vira-button.element.js +6 -2
- package/dist/elements/vira-card.element.js +16 -14
- package/dist/elements/vira-checkbox.element.js +95 -93
- package/dist/elements/vira-collapsible-card.element.js +63 -61
- package/dist/elements/vira-collapsible-wrapper.element.js +38 -36
- package/dist/elements/vira-date-input.element.d.ts +3 -3
- package/dist/elements/vira-date-input.element.js +37 -35
- package/dist/elements/vira-drawer.element.js +93 -91
- package/dist/elements/vira-error.element.js +8 -6
- package/dist/elements/vira-icon.element.js +23 -21
- package/dist/elements/vira-image.element.js +44 -42
- package/dist/elements/vira-json-form.element.js +7 -3
- package/dist/elements/vira-link.element.js +26 -24
- package/dist/elements/vira-modal.element.js +95 -80
- package/dist/elements/vira-progress.element.js +23 -21
- package/dist/elements/vira-relative-time.element.d.ts +2 -2
- package/dist/elements/vira-select.element.js +127 -122
- package/dist/elements/vira-tabs.element.js +17 -7
- package/dist/elements/vira-tag.element.js +3 -1
- package/dist/elements/vira-text-area.element.js +92 -90
- package/dist/icons/lucide-icons.js +7 -5
- package/dist/util/shared-text-input-logic.js +6 -4
- package/dist/util/vira-form-fields.d.ts +2 -2
- package/dist/util/vira-json-schema.js +24 -16
- package/package.json +11 -11
|
@@ -20,112 +20,114 @@ export const ViraTextArea = defineViraElement()({
|
|
|
20
20
|
'vira-text-area-padding-horizontal': '12px',
|
|
21
21
|
'vira-text-area-padding-vertical': '8px',
|
|
22
22
|
},
|
|
23
|
-
styles: ({ hostClasses, cssVars }) =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
label {
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: column;
|
|
35
|
-
justify-content: flex-start;
|
|
36
|
-
gap: 2px;
|
|
37
|
-
width: 100%;
|
|
38
|
-
max-width: 100%;
|
|
39
|
-
cursor: text;
|
|
40
|
-
|
|
41
|
-
& .text-area-label {
|
|
42
|
-
font-weight: ${viraFormCssVars['vira-form-label-font-weight'].value};
|
|
43
|
-
text-align: left;
|
|
44
|
-
flex-shrink: 0;
|
|
45
|
-
flex-wrap: wrap;
|
|
23
|
+
styles: ({ hostClasses, cssVars }) => {
|
|
24
|
+
return css `
|
|
25
|
+
:host {
|
|
26
|
+
position: relative;
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
width: 320px;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
color: ${viraFormCssVars['vira-form-foreground-color'].value};
|
|
46
31
|
}
|
|
47
|
-
}
|
|
48
32
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
padding: ${cssVars['vira-text-area-padding-vertical'].value}
|
|
65
|
-
${cssVars['vira-text-area-padding-horizontal'].value};
|
|
66
|
-
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
67
|
-
background-color: ${viraFormCssVars['vira-form-background-color'].value};
|
|
68
|
-
border: 1px solid ${viraFormCssVars['vira-form-border-color'].value};
|
|
69
|
-
color: inherit;
|
|
70
|
-
resize: vertical;
|
|
71
|
-
outline: none;
|
|
72
|
-
|
|
73
|
-
&::placeholder {
|
|
74
|
-
color: ${viraFormCssVars['vira-form-placeholder-color'].value};
|
|
33
|
+
label {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
justify-content: flex-start;
|
|
37
|
+
gap: 2px;
|
|
38
|
+
width: 100%;
|
|
39
|
+
max-width: 100%;
|
|
40
|
+
cursor: text;
|
|
41
|
+
|
|
42
|
+
& .text-area-label {
|
|
43
|
+
font-weight: ${viraFormCssVars['vira-form-label-font-weight'].value};
|
|
44
|
+
text-align: left;
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
flex-wrap: wrap;
|
|
47
|
+
}
|
|
75
48
|
}
|
|
76
49
|
|
|
77
|
-
|
|
78
|
-
|
|
50
|
+
.text-area-wrapper {
|
|
51
|
+
position: relative;
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
width: 100%;
|
|
54
|
+
max-width: 100%;
|
|
55
|
+
box-sizing: border-box;
|
|
79
56
|
}
|
|
80
57
|
|
|
81
|
-
|
|
82
|
-
${
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
58
|
+
textarea {
|
|
59
|
+
${noNativeFormStyles};
|
|
60
|
+
overscroll-behavior: contain;
|
|
61
|
+
font: inherit;
|
|
62
|
+
cursor: text;
|
|
63
|
+
width: 100%;
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
padding: ${cssVars['vira-text-area-padding-vertical'].value}
|
|
66
|
+
${cssVars['vira-text-area-padding-horizontal'].value};
|
|
67
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
68
|
+
background-color: ${viraFormCssVars['vira-form-background-color'].value};
|
|
69
|
+
border: 1px solid ${viraFormCssVars['vira-form-border-color'].value};
|
|
70
|
+
color: inherit;
|
|
71
|
+
resize: vertical;
|
|
72
|
+
outline: none;
|
|
73
|
+
|
|
74
|
+
&::placeholder {
|
|
75
|
+
color: ${viraFormCssVars['vira-form-placeholder-color'].value};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&::selection {
|
|
79
|
+
background: ${viraFormCssVars['vira-form-text-selection-color'].value};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:focus:focus-visible:not([disabled]) ~ .focus-border {
|
|
83
|
+
${createFocusStyles({
|
|
84
|
+
elementBorderSize: '1px',
|
|
85
|
+
noNesting: true,
|
|
86
|
+
})}
|
|
87
|
+
}
|
|
86
88
|
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.border-style {
|
|
90
|
-
position: absolute;
|
|
91
|
-
top: 0;
|
|
92
|
-
left: 0;
|
|
93
|
-
width: 100%;
|
|
94
|
-
height: 100%;
|
|
95
|
-
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
96
|
-
z-index: 0;
|
|
97
|
-
pointer-events: none;
|
|
98
|
-
}
|
|
99
89
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
90
|
+
.border-style {
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 0;
|
|
93
|
+
left: 0;
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
97
|
+
z-index: 0;
|
|
98
|
+
pointer-events: none;
|
|
99
|
+
}
|
|
104
100
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
.readonly-value {
|
|
102
|
+
white-space: pre-wrap;
|
|
103
|
+
overflow-wrap: anywhere;
|
|
104
|
+
}
|
|
108
105
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
${hostClasses['vira-text-area-prevent-resize'].selector} textarea {
|
|
107
|
+
resize: none;
|
|
108
|
+
}
|
|
112
109
|
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
${hostClasses['vira-text-area-error'].selector} textarea {
|
|
111
|
+
border-color: ${viraFormCssVars['vira-form-error-color'].value};
|
|
112
|
+
}
|
|
115
113
|
|
|
116
|
-
|
|
114
|
+
${hostClasses['vira-text-area-disabled'].selector} {
|
|
117
115
|
cursor: not-allowed;
|
|
118
|
-
}
|
|
119
116
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
& * {
|
|
118
|
+
cursor: not-allowed;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
& > * {
|
|
122
|
+
${viraDisabledStyles};
|
|
123
|
+
}
|
|
123
124
|
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
& .focus-border {
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
126
128
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
`;
|
|
130
|
+
},
|
|
129
131
|
events: {
|
|
130
132
|
/**
|
|
131
133
|
* Fires whenever a user input created a new value. Does not fire if all input letters are
|
|
@@ -14,11 +14,13 @@ function setSvgAttribute({ svgString, attributeName, value, }) {
|
|
|
14
14
|
: svgString.replace(/<svg\b/, `<svg ${attributeName}="${value}"`);
|
|
15
15
|
}
|
|
16
16
|
function applySvgAttributes(svgString, attributes) {
|
|
17
|
-
return Object.entries(attributes).reduce((result, [key, value,]) =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
return Object.entries(attributes).reduce((result, [key, value,]) => {
|
|
18
|
+
return setSvgAttribute({
|
|
19
|
+
svgString: result,
|
|
20
|
+
attributeName: key,
|
|
21
|
+
value,
|
|
22
|
+
});
|
|
23
|
+
}, svgString);
|
|
22
24
|
}
|
|
23
25
|
function isLucideIconKey(key) {
|
|
24
26
|
return key in lucideStaticImport;
|
|
@@ -5,10 +5,12 @@ function doesMatch({ input, matcher }) {
|
|
|
5
5
|
return true;
|
|
6
6
|
}
|
|
7
7
|
else if (input.length > 1) {
|
|
8
|
-
return input.split('').every((singleInput) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
return input.split('').every((singleInput) => {
|
|
9
|
+
return doesMatch({
|
|
10
|
+
input: singleInput,
|
|
11
|
+
matcher,
|
|
12
|
+
});
|
|
13
|
+
});
|
|
12
14
|
}
|
|
13
15
|
else if (matcher instanceof RegExp) {
|
|
14
16
|
return !!input.match(matcher);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PartialWithUndefined } from '@augment-vir/common';
|
|
2
|
-
import { type FullDate } from 'date-vir';
|
|
2
|
+
import { type FullDate, type Timezone } from 'date-vir';
|
|
3
3
|
import { type HtmlInterpolation } from 'element-vir';
|
|
4
4
|
import { type ViraIconSvg } from '../icons/icon-svg.js';
|
|
5
5
|
import { type ViraSelectOption } from './vira-select-option.js';
|
|
@@ -115,7 +115,7 @@ export type ViraFormField = ({
|
|
|
115
115
|
/** Upper bound for selectable dates. Defaults to 10 years from now when omitted. */
|
|
116
116
|
max: FullDate;
|
|
117
117
|
/** Timezone used to interpret the selected date. Defaults to the user's timezone. */
|
|
118
|
-
timezone:
|
|
118
|
+
timezone: Timezone;
|
|
119
119
|
/** Only show the date part of the selected date when in readonly mode. */
|
|
120
120
|
showDateOnly: boolean;
|
|
121
121
|
/** Only show the time part of the selected date when in readonly mode. */
|
|
@@ -174,10 +174,12 @@ export function expandSchemaBranches(schema, context) {
|
|
|
174
174
|
if (branches.length === 0) {
|
|
175
175
|
return [resolved];
|
|
176
176
|
}
|
|
177
|
-
return branches.flatMap((branch) =>
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
return branches.flatMap((branch) => {
|
|
178
|
+
return expandSchemaBranches(branch, {
|
|
179
|
+
root: context.root,
|
|
180
|
+
seenRefs: context.seenRefs,
|
|
181
|
+
});
|
|
182
|
+
});
|
|
181
183
|
}
|
|
182
184
|
/**
|
|
183
185
|
* Computes the set of JSON types that a given schema allows.
|
|
@@ -538,10 +540,12 @@ function validateBranch({ value, branch, path, context, errors, }) {
|
|
|
538
540
|
return;
|
|
539
541
|
}
|
|
540
542
|
if ('enum' in branch && check.isArray(branch.enum)) {
|
|
541
|
-
const matched = branch.enum.some((entry) =>
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
543
|
+
const matched = branch.enum.some((entry) => {
|
|
544
|
+
return deepEqualsJson({
|
|
545
|
+
a: value,
|
|
546
|
+
b: entry,
|
|
547
|
+
});
|
|
548
|
+
});
|
|
545
549
|
if (!matched) {
|
|
546
550
|
errors.push(`${formatPathLabel(path)} must be one of the enum values.`);
|
|
547
551
|
return;
|
|
@@ -625,10 +629,12 @@ function deepEqualsJson({ a, b }) {
|
|
|
625
629
|
}
|
|
626
630
|
else if (check.isArray(a) && check.isArray(b)) {
|
|
627
631
|
return (a.length === b.length &&
|
|
628
|
-
a.every((entry, i) =>
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
+
a.every((entry, i) => {
|
|
633
|
+
return deepEqualsJson({
|
|
634
|
+
a: entry,
|
|
635
|
+
b: b[i] ?? null,
|
|
636
|
+
});
|
|
637
|
+
}));
|
|
632
638
|
}
|
|
633
639
|
else if (check.isObject(a) && check.isObject(b)) {
|
|
634
640
|
const aKeys = Object.keys(a);
|
|
@@ -636,10 +642,12 @@ function deepEqualsJson({ a, b }) {
|
|
|
636
642
|
if (aKeys.length !== bKeys.length) {
|
|
637
643
|
return false;
|
|
638
644
|
}
|
|
639
|
-
return aKeys.every((key) =>
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
645
|
+
return aKeys.every((key) => {
|
|
646
|
+
return deepEqualsJson({
|
|
647
|
+
a: a[key] ?? null,
|
|
648
|
+
b: b[key] ?? null,
|
|
649
|
+
});
|
|
650
|
+
});
|
|
643
651
|
}
|
|
644
652
|
else {
|
|
645
653
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vira",
|
|
3
|
-
"version": "31.31.
|
|
3
|
+
"version": "31.31.2",
|
|
4
4
|
"description": "A simple and highly versatile design system using element-vir.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design",
|
|
@@ -38,36 +38,36 @@
|
|
|
38
38
|
"test:docs": "virmator docs check"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@augment-vir/assert": "^32.2.
|
|
42
|
-
"@augment-vir/common": "^32.2.
|
|
43
|
-
"@augment-vir/web": "^32.2.
|
|
41
|
+
"@augment-vir/assert": "^32.2.2",
|
|
42
|
+
"@augment-vir/common": "^32.2.2",
|
|
43
|
+
"@augment-vir/web": "^32.2.2",
|
|
44
44
|
"@electrovir/color": "^1.7.11",
|
|
45
45
|
"@electrovir/local-storage-client": "^0.1.1",
|
|
46
|
-
"date-vir": "^
|
|
46
|
+
"date-vir": "^9.1.0",
|
|
47
47
|
"device-navigation": "^4.7.3",
|
|
48
48
|
"json-schema-to-ts": "^3.1.1",
|
|
49
49
|
"lit-css-vars": "^3.6.3",
|
|
50
|
-
"object-shape-tester": "^6.
|
|
50
|
+
"object-shape-tester": "^6.15.0",
|
|
51
51
|
"observavir": "^2.3.3",
|
|
52
52
|
"page-active": "^1.0.4",
|
|
53
53
|
"spa-router-vir": "^6.6.1",
|
|
54
|
-
"typed-event-target": "^4.3.
|
|
54
|
+
"typed-event-target": "^4.3.3"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@augment-vir/test": "^32.2.
|
|
57
|
+
"@augment-vir/test": "^32.2.2",
|
|
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",
|
|
61
61
|
"@web/test-runner-playwright": "^1.0.0",
|
|
62
62
|
"@web/test-runner-visual-regression": "^1.0.1",
|
|
63
|
-
"esbuild": "^0.28.
|
|
63
|
+
"esbuild": "^0.28.2",
|
|
64
64
|
"istanbul-smart-text-reporter": "^1.1.5",
|
|
65
|
-
"lucide-static": "^1.
|
|
65
|
+
"lucide-static": "^1.31.0",
|
|
66
66
|
"markdown-code-example-inserter": "^3.0.6",
|
|
67
67
|
"theme-vir": "^28.25.1",
|
|
68
68
|
"typedoc": "^0.28.20",
|
|
69
69
|
"typescript": "^6.0.3",
|
|
70
|
-
"vite": "^8.1
|
|
70
|
+
"vite": "^8.2.1",
|
|
71
71
|
"vite-tsconfig-paths": "^6.1.1"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|