vira 28.7.1 → 28.8.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.
@@ -30,6 +30,7 @@ export type ViraFormField = {
30
30
  icon?: ViraIconSvg | undefined;
31
31
  hasError?: boolean | undefined;
32
32
  isUsername?: boolean | undefined;
33
+ testId?: string | undefined;
33
34
  } | {
34
35
  type: ViraFormFieldType.Select;
35
36
  label: string;
@@ -39,12 +40,14 @@ export type ViraFormField = {
39
40
  disabled?: boolean | undefined;
40
41
  icon?: ViraIconSvg | undefined;
41
42
  hasError?: boolean | undefined;
43
+ testId?: string | undefined;
42
44
  } | {
43
45
  type: ViraFormFieldType.Checkbox;
44
46
  label: string;
45
47
  value: boolean;
46
48
  disabled?: boolean | undefined;
47
49
  hasError?: boolean | undefined;
50
+ testId?: string | undefined;
48
51
  };
49
52
  /**
50
53
  * A collection of form fields for {@link ViraForm}.
@@ -1,5 +1,5 @@
1
1
  import { getObjectTypedEntries } from '@augment-vir/common';
2
- import { css, defineElementEvent, html, listen } from 'element-vir';
2
+ import { css, defineElementEvent, html, listen, nothing, testId } from 'element-vir';
3
3
  import { defineViraElement } from './define-vira-element.js';
4
4
  import { ViraCheckbox } from './vira-checkbox.element.js';
5
5
  import { ViraInput, ViraInputType } from './vira-input.element.js';
@@ -48,6 +48,7 @@ export const ViraForm = defineViraElement()({
48
48
  hasError: field.hasError,
49
49
  label: field.label,
50
50
  })}
51
+ ${field.testId ? testId(field.testId) : nothing}
51
52
  ${listen(ViraCheckbox.events.valueChange, (event) => {
52
53
  dispatch(new events.valueChange({
53
54
  key,
@@ -69,6 +70,7 @@ export const ViraForm = defineViraElement()({
69
70
  hasError: field.hasError,
70
71
  icon: field.icon,
71
72
  })}
73
+ ${field.testId ? testId(field.testId) : nothing}
72
74
  ${listen(ViraSelect.events.valueChange, (event) => {
73
75
  dispatch(new events.valueChange({
74
76
  key,
@@ -115,6 +117,7 @@ export const ViraForm = defineViraElement()({
115
117
  ? ViraInputType.Email
116
118
  : ViraInputType.Default,
117
119
  })}
120
+ ${field.testId ? testId(field.testId) : nothing}
118
121
  ${listen(ViraInput.events.valueChange, (event) => {
119
122
  dispatch(new events.valueChange({
120
123
  key,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vira",
3
- "version": "28.7.1",
3
+ "version": "28.8.0",
4
4
  "description": "A simple and highly versatile design system using element-vir.",
5
5
  "keywords": [
6
6
  "design",