vira 31.30.0 → 31.31.1

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 (39) hide show
  1. package/dist/elements/pop-up/vira-menu-item.element.d.ts +1 -1
  2. package/dist/elements/pop-up/vira-menu-item.element.js +60 -56
  3. package/dist/elements/pop-up/vira-menu.element.d.ts +1 -1
  4. package/dist/elements/pop-up/vira-menu.element.js +36 -30
  5. package/dist/elements/pop-up/vira-pop-up-trigger.element.js +57 -55
  6. package/dist/elements/vira-absolute-time.element.d.ts +3 -3
  7. package/dist/elements/vira-bold-text.element.js +35 -33
  8. package/dist/elements/vira-button.element.js +6 -2
  9. package/dist/elements/vira-card.element.js +17 -15
  10. package/dist/elements/vira-checkbox.element.js +95 -93
  11. package/dist/elements/vira-collapsible-card.element.js +63 -61
  12. package/dist/elements/vira-collapsible-wrapper.element.js +38 -36
  13. package/dist/elements/vira-date-input.element.d.ts +3 -3
  14. package/dist/elements/vira-date-input.element.js +37 -35
  15. package/dist/elements/vira-drawer.element.js +93 -91
  16. package/dist/elements/vira-error.element.js +8 -6
  17. package/dist/elements/vira-icon.element.js +23 -21
  18. package/dist/elements/vira-image.element.js +44 -42
  19. package/dist/elements/vira-input.element.js +2 -2
  20. package/dist/elements/vira-json-form.element.js +7 -3
  21. package/dist/elements/vira-link.element.js +26 -24
  22. package/dist/elements/vira-modal.element.d.ts +1 -1
  23. package/dist/elements/vira-modal.element.js +85 -80
  24. package/dist/elements/vira-progress.element.d.ts +1 -1
  25. package/dist/elements/vira-progress.element.js +24 -22
  26. package/dist/elements/vira-relative-time.element.d.ts +2 -2
  27. package/dist/elements/vira-select.element.js +129 -124
  28. package/dist/elements/vira-tabs.element.js +17 -7
  29. package/dist/elements/vira-tag.element.js +3 -1
  30. package/dist/elements/vira-text-area.element.js +94 -92
  31. package/dist/icons/lucide-icons.js +7 -5
  32. package/dist/styles/font.d.ts +1 -1
  33. package/dist/styles/font.js +1 -1
  34. package/dist/styles/form-styles.d.ts +3 -3
  35. package/dist/styles/form-styles.js +3 -3
  36. package/dist/util/shared-text-input-logic.js +6 -4
  37. package/dist/util/vira-form-fields.d.ts +2 -2
  38. package/dist/util/vira-json-schema.js +24 -16
  39. package/package.json +11 -11
@@ -35,4 +35,4 @@ export declare const ViraMenuItem: import("element-vir").DeclarativeElementDefin
35
35
  * gated by `keepOpenAfterInteraction`.
36
36
  */
37
37
  activate: import("element-vir").DefineEvent<undefined>;
38
- }, "vira-menu-item-selected" | "vira-menu-item-disabled" | "vira-menu-item-enabled" | "vira-menu-item-default-icon" | "vira-menu-item-default-styles", "vira-menu-item-icon-gap", readonly [], readonly []>;
38
+ }, "vira-menu-item-selected" | "vira-menu-item-disabled" | "vira-menu-item-enabled" | "vira-menu-item-default-icon" | "vira-menu-item-default-styles", "vira-menu-item-icon-gap" | "vira-menu-item-padding" | "vira-menu-item-border-radius", readonly [], readonly []>;
@@ -37,76 +37,80 @@ export const ViraMenuItem = defineViraElement()({
37
37
  },
38
38
  cssVars: {
39
39
  /** Horizontal gap between a menu item's icon and its label. */
40
- 'vira-menu-item-icon-gap': '3px',
40
+ 'vira-menu-item-icon-gap': '8px',
41
+ 'vira-menu-item-padding': '6px 8px',
42
+ 'vira-menu-item-border-radius': '4px',
41
43
  },
42
- styles: ({ hostClasses, cssVars }) => css `
43
- :host {
44
- display: flex;
45
- flex-shrink: 0;
46
- ${noUserSelect};
47
- box-sizing: border-box;
48
- max-width: 100%;
49
- gap: ${cssVars['vira-menu-item-icon-gap'].value};
50
- overflow: hidden;
51
- padding: 8px 3px;
52
- padding-right: 16px;
53
- align-items: center;
54
- text-align: left;
55
- }
44
+ styles: ({ hostClasses, cssVars }) => {
45
+ return css `
46
+ :host {
47
+ display: flex;
48
+ flex-shrink: 0;
49
+ ${noUserSelect};
50
+ box-sizing: border-box;
51
+ max-width: 100%;
52
+ gap: ${cssVars['vira-menu-item-icon-gap'].value};
53
+ overflow: hidden;
54
+ padding: ${cssVars['vira-menu-item-padding'].value};
55
+ border-radius: ${cssVars['vira-menu-item-border-radius'].value};
56
+ align-items: center;
57
+ text-align: left;
58
+ }
56
59
 
57
- ${hostClasses['vira-menu-item-disabled'].selector}${hostClasses['vira-menu-item-default-styles'].selector} {
58
- cursor: not-allowed;
60
+ ${hostClasses['vira-menu-item-disabled'].selector}${hostClasses['vira-menu-item-default-styles'].selector} {
61
+ cursor: not-allowed;
59
62
 
60
- & .slot-wrapper,
61
- & ${ViraIcon} {
62
- opacity: 0.3;
63
- pointer-events: none;
63
+ & .slot-wrapper,
64
+ & ${ViraIcon} {
65
+ opacity: 0.3;
66
+ pointer-events: none;
67
+ }
64
68
  }
65
- }
66
69
 
67
- :host(:focus),
68
- :host(:active) {
69
- outline: none;
70
- }
70
+ :host(:focus),
71
+ :host(:active) {
72
+ outline: none;
73
+ }
71
74
 
72
- ${hostClasses['vira-menu-item-enabled'].selector}${hostClasses['vira-menu-item-default-styles'].selector} {
73
- cursor: pointer;
75
+ ${hostClasses['vira-menu-item-enabled'].selector}${hostClasses['vira-menu-item-default-styles'].selector} {
76
+ cursor: pointer;
74
77
 
75
- &:host(:focus) {
76
- background-color: ${viraFormCssVars['vira-form-selection-hover-color'].value};
77
- }
78
+ &:host(:focus) {
79
+ background-color: ${viraFormCssVars['vira-form-selection-hover-color'].value};
80
+ }
78
81
 
79
- &:host(:active) {
80
- background-color: ${viraFormCssVars['vira-form-selection-active-color'].value};
82
+ &:host(:active) {
83
+ background-color: ${viraFormCssVars['vira-form-selection-active-color'].value};
84
+ }
81
85
  }
82
- }
83
-
84
- ${ViraIcon} {
85
- width: 24px;
86
- aspect-ratio: 1;
87
- align-items: center;
88
- justify-content: center;
89
- }
90
86
 
91
- ${hostClasses['vira-menu-item-default-icon'].selector} {
92
87
  ${ViraIcon} {
93
- visibility: hidden;
88
+ width: 24px;
89
+ aspect-ratio: 1;
90
+ align-items: center;
91
+ justify-content: center;
94
92
  }
95
- }
96
93
 
97
- ${hostClasses['vira-menu-item-selected'].selector} ${ViraIcon} {
98
- visibility: visible;
99
- }
94
+ ${hostClasses['vira-menu-item-default-icon'].selector} {
95
+ ${ViraIcon} {
96
+ visibility: hidden;
97
+ }
98
+ }
100
99
 
101
- .slot-wrapper {
102
- display: flex;
103
- flex-grow: 1;
104
- overflow: hidden;
105
- text-overflow: ellipsis;
106
- white-space: nowrap;
107
- min-width: 0;
108
- }
109
- `,
100
+ ${hostClasses['vira-menu-item-selected'].selector} ${ViraIcon} {
101
+ visibility: visible;
102
+ }
103
+
104
+ .slot-wrapper {
105
+ display: flex;
106
+ flex-grow: 1;
107
+ overflow: hidden;
108
+ text-overflow: ellipsis;
109
+ white-space: nowrap;
110
+ min-width: 0;
111
+ }
112
+ `;
113
+ },
110
114
  init({ state, updateState, host, inputs, dispatch, events }) {
111
115
  host.setAttribute('role', 'menuitem');
112
116
  host.setAttribute('tabindex', inputs.disabled ? '-1' : '0');
@@ -33,4 +33,4 @@ export declare const ViraMenu: import("element-vir").DeclarativeElementDefinitio
33
33
  direction: ViraMenuPopUpDirection;
34
34
  /** @default PopUpMenuCornerStyle.Directional */
35
35
  cornerStyle: ViraMenuCornerStyle;
36
- }>, {}, {}, "vira-menu-open-upwards" | "vira-menu-rounded" | "vira-menu-square", "vira-menu-", readonly [], readonly []>;
36
+ }>, {}, {}, "vira-menu-open-upwards" | "vira-menu-rounded" | "vira-menu-square", "vira-menu-padding", readonly [], readonly []>;
@@ -40,39 +40,45 @@ export const ViraMenu = defineViraElement()({
40
40
  'vira-menu-rounded': ({ inputs }) => inputs.cornerStyle === ViraMenuCornerStyle.AllRounded,
41
41
  'vira-menu-square': ({ inputs }) => inputs.cornerStyle === ViraMenuCornerStyle.AllSquare,
42
42
  },
43
- styles: ({ hostClasses }) => css `
44
- :host {
45
- display: flex;
46
- flex-direction: column;
47
- max-width: 100%;
48
- max-height: 100%;
49
- overflow-y: auto;
50
- z-index: 99;
51
- box-sizing: border-box;
52
- overscroll-behavior: contain;
53
- border-radius: ${viraFormCssVars['vira-form-radius'].value};
54
- border-top-left-radius: 0;
55
- border-top-right-radius: 0;
56
- background-color: ${viraFormCssVars['vira-form-background-color'].value};
57
- border: 1px solid ${viraFormCssVars['vira-form-border-color'].value};
58
- color: ${viraFormCssVars['vira-form-foreground-color'].value};
59
- ${viraShadows.menuShadow}
60
- }
43
+ cssVars: {
44
+ 'vira-menu-padding': '4px',
45
+ },
46
+ styles: ({ hostClasses, cssVars }) => {
47
+ return css `
48
+ :host {
49
+ display: flex;
50
+ flex-direction: column;
51
+ padding: ${cssVars['vira-menu-padding'].value};
52
+ max-width: 100%;
53
+ max-height: 100%;
54
+ overflow-y: auto;
55
+ z-index: 99;
56
+ box-sizing: border-box;
57
+ overscroll-behavior: contain;
58
+ border-radius: ${viraFormCssVars['vira-form-radius'].value};
59
+ border-top-left-radius: 0;
60
+ border-top-right-radius: 0;
61
+ background-color: ${viraFormCssVars['vira-form-background-color'].value};
62
+ border: 1px solid ${viraFormCssVars['vira-form-border-color'].value};
63
+ color: ${viraFormCssVars['vira-form-foreground-color'].value};
64
+ ${viraShadows.menuShadow}
65
+ }
61
66
 
62
- ${hostClasses['vira-menu-open-upwards'].selector} {
63
- border-radius: ${viraFormCssVars['vira-form-radius'].value};
64
- border-bottom-left-radius: 0;
65
- border-bottom-right-radius: 0;
66
- }
67
+ ${hostClasses['vira-menu-open-upwards'].selector} {
68
+ border-radius: ${viraFormCssVars['vira-form-radius'].value};
69
+ border-bottom-left-radius: 0;
70
+ border-bottom-right-radius: 0;
71
+ }
67
72
 
68
- ${hostClasses['vira-menu-square'].selector} {
69
- border-radius: 0;
70
- }
73
+ ${hostClasses['vira-menu-square'].selector} {
74
+ border-radius: 0;
75
+ }
71
76
 
72
- ${hostClasses['vira-menu-rounded'].selector} {
73
- border-radius: ${viraFormCssVars['vira-form-radius'].value};
74
- }
75
- `,
77
+ ${hostClasses['vira-menu-rounded'].selector} {
78
+ border-radius: ${viraFormCssVars['vira-form-radius'].value};
79
+ }
80
+ `;
81
+ },
76
82
  render() {
77
83
  return html `
78
84
  <slot>&nbsp;</slot>
@@ -62,72 +62,74 @@ export const ViraPopUpTrigger = defineViraElement()({
62
62
  'vira-pop-up-trigger-inside-focus': ({ inputs }) => !!inputs.useInsideFocus,
63
63
  'vira-pop-up-trigger-outside-focus': ({ inputs }) => !inputs.useInsideFocus,
64
64
  },
65
- styles: ({ hostClasses }) => css `
66
- :host {
67
- display: inline-flex;
68
- box-sizing: border-box;
69
- vertical-align: middle;
70
- position: relative;
71
- max-width: 100%;
72
- }
65
+ styles: ({ hostClasses }) => {
66
+ return css `
67
+ :host {
68
+ display: inline-flex;
69
+ box-sizing: border-box;
70
+ vertical-align: middle;
71
+ position: relative;
72
+ max-width: 100%;
73
+ }
73
74
 
74
- .dropdown-wrapper {
75
- ${noNativeFormStyles};
76
- cursor: pointer;
77
- max-width: 100%;
78
- position: relative;
79
- flex-grow: 1;
80
- box-sizing: border-box;
81
- }
75
+ .dropdown-wrapper {
76
+ ${noNativeFormStyles};
77
+ cursor: pointer;
78
+ max-width: 100%;
79
+ position: relative;
80
+ flex-grow: 1;
81
+ box-sizing: border-box;
82
+ }
82
83
 
83
- ${hostClasses['vira-pop-up-trigger-inside-focus'].selector} .dropdown-wrapper {
84
- ${createFocusStyles({
85
- renderInside: true,
86
- })}
87
- }
88
- ${hostClasses['vira-pop-up-trigger-outside-focus'].selector} .dropdown-wrapper {
89
- ${createFocusStyles()}
90
- }
84
+ ${hostClasses['vira-pop-up-trigger-inside-focus'].selector} .dropdown-wrapper {
85
+ ${createFocusStyles({
86
+ renderInside: true,
87
+ })}
88
+ }
89
+ ${hostClasses['vira-pop-up-trigger-outside-focus'].selector} .dropdown-wrapper {
90
+ ${createFocusStyles()}
91
+ }
91
92
 
92
- .dropdown-trigger {
93
- box-sizing: border-box;
94
- ${noUserSelect};
95
- }
93
+ .dropdown-trigger {
94
+ box-sizing: border-box;
95
+ ${noUserSelect};
96
+ }
96
97
 
97
- ${hostClasses['vira-pop-up-trigger-disabled'].selector} {
98
- ${viraDisabledStyles}
99
- pointer-events: auto;
100
- }
98
+ ${hostClasses['vira-pop-up-trigger-disabled'].selector} {
99
+ ${viraDisabledStyles}
100
+ pointer-events: auto;
101
+ }
101
102
 
102
- ${hostClasses['vira-pop-up-trigger-disabled'].selector} .dropdown-wrapper {
103
- pointer-events: none;
104
- }
103
+ ${hostClasses['vira-pop-up-trigger-disabled'].selector} .dropdown-wrapper {
104
+ pointer-events: none;
105
+ }
105
106
 
106
- .pop-up-positioner {
107
- position: absolute;
108
- pointer-events: none;
109
- display: flex;
110
- box-sizing: border-box;
111
- flex-direction: column;
112
- align-items: flex-start;
107
+ .pop-up-positioner {
108
+ position: absolute;
109
+ pointer-events: none;
110
+ display: flex;
111
+ box-sizing: border-box;
112
+ flex-direction: column;
113
+ align-items: flex-start;
113
114
 
114
- /* highest possible z-index */
115
- z-index: 2147483647;
115
+ /* highest possible z-index */
116
+ z-index: 2147483647;
116
117
 
117
- & > * {
118
- pointer-events: auto;
119
- max-width: 100%;
120
- }
118
+ & > * {
119
+ pointer-events: auto;
120
+ max-width: 100%;
121
+ }
121
122
 
122
- &.right-aligned {
123
- align-items: flex-end;
123
+ &.right-aligned {
124
+ align-items: flex-end;
125
+ }
124
126
  }
125
- }
126
127
 
127
- .open-upwards .pop-up-positioner {
128
- flex-direction: column-reverse;
129
- }
130
- `,
128
+ .open-upwards .pop-up-positioner {
129
+ flex-direction: column-reverse;
130
+ }
131
+ `;
132
+ },
131
133
  events: {
132
134
  navSelect: defineElementEvent(),
133
135
  /**
@@ -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
  /**
4
4
  * Displays a `FullDate` as an absolute, human readable timestamp in the user's timezone (for
5
5
  * example `Jun 3, 2026 14:30 PDT`).
@@ -21,7 +21,7 @@ export declare const ViraAbsoluteTime: import("element-vir").DeclarativeElementD
21
21
  * midnight UTC), where converting to the user's timezone would shift the displayed
22
22
  * date/time.
23
23
  */
24
- timezone: string;
24
+ timezone: Timezone;
25
25
  }>, {}, {}, "vira-absolute-time-", "vira-absolute-time-", readonly [], readonly []>;
26
26
  /**
27
27
  * Formats a `FullDate` into the same absolute string rendered by {@link ViraAbsoluteTime}.
@@ -31,5 +31,5 @@ export declare const ViraAbsoluteTime: import("element-vir").DeclarativeElementD
31
31
  export declare function formatAbsoluteTime(time: Readonly<FullDate>, options?: Readonly<PartialWithUndefined<{
32
32
  showDateOnly: boolean;
33
33
  showTimeOnly: boolean;
34
- timezone: string;
34
+ timezone: Timezone;
35
35
  }>>): string;
@@ -14,44 +14,46 @@ export const ViraBoldText = defineViraElement()({
14
14
  hostClasses: {
15
15
  'vira-bold-bold': ({ inputs }) => inputs.bold,
16
16
  },
17
- styles: ({ hostClasses, cssVars }) => css `
18
- span {
19
- text-decoration: inherit;
20
- white-space: inherit;
21
- }
17
+ styles: ({ hostClasses, cssVars }) => {
18
+ return css `
19
+ span {
20
+ text-decoration: inherit;
21
+ white-space: inherit;
22
+ }
22
23
 
23
- .bold-wrapper {
24
- position: relative;
25
- }
24
+ .bold-wrapper {
25
+ position: relative;
26
+ }
26
27
 
27
- .everything-wrapper {
28
- width: 100%;
29
- }
28
+ .everything-wrapper {
29
+ width: 100%;
30
+ }
30
31
 
31
- .bold {
32
- font-weight: ${cssVars['vira-bold-bold-weight'].value};
33
- visibility: hidden;
34
- pointer-events: none;
35
- z-index: -1;
36
- }
32
+ .bold {
33
+ font-weight: ${cssVars['vira-bold-bold-weight'].value};
34
+ visibility: hidden;
35
+ pointer-events: none;
36
+ z-index: -1;
37
+ }
37
38
 
38
- .normal {
39
- position: absolute;
40
- top: 0;
41
- left: 0;
42
- }
39
+ .normal {
40
+ position: absolute;
41
+ top: 0;
42
+ left: 0;
43
+ }
43
44
 
44
- ${hostClasses['vira-bold-bold'].selector} .normal {
45
- visibility: hidden;
46
- pointer-events: none;
47
- z-index: -1;
48
- }
49
- ${hostClasses['vira-bold-bold'].selector} .bold {
50
- visibility: visible;
51
- pointer-events: unset;
52
- z-index: unset;
53
- }
54
- `,
45
+ ${hostClasses['vira-bold-bold'].selector} .normal {
46
+ visibility: hidden;
47
+ pointer-events: none;
48
+ z-index: -1;
49
+ }
50
+ ${hostClasses['vira-bold-bold'].selector} .bold {
51
+ visibility: visible;
52
+ pointer-events: unset;
53
+ z-index: unset;
54
+ }
55
+ `;
56
+ },
55
57
  render({ inputs }) {
56
58
  return html `
57
59
  <span class="everything-wrapper">
@@ -124,9 +124,13 @@ export const ViraButton = defineViraElement()({
124
124
  // eslint-disable-next-line @typescript-eslint/no-deprecated
125
125
  'vira-button-with-menu-caret': ({ inputs }) => !!inputs.showMenuCaret,
126
126
  'vira-button-size-large': ({ inputs }) => inputs.buttonSize === ViraSize.Large,
127
- 'vira-button-size-medium': ({ inputs }) => !inputs.buttonSize || inputs.buttonSize === ViraSize.Medium,
127
+ 'vira-button-size-medium': ({ inputs }) => {
128
+ return !inputs.buttonSize || inputs.buttonSize === ViraSize.Medium;
129
+ },
128
130
  'vira-button-size-small': ({ inputs }) => inputs.buttonSize === ViraSize.Small,
129
- 'vira-button-emphasis-standard': ({ inputs }) => !inputs.buttonEmphasis || inputs.buttonEmphasis === ViraEmphasis.Standard,
131
+ 'vira-button-emphasis-standard': ({ inputs }) => {
132
+ return !inputs.buttonEmphasis || inputs.buttonEmphasis === ViraEmphasis.Standard;
133
+ },
130
134
  'vira-button-emphasis-subtle': ({ inputs }) => inputs.buttonEmphasis === ViraEmphasis.Subtle,
131
135
  ...arrayToObject(getObjectTypedKeys(viraColorVariantToHostClassKey), (colorVariant) => {
132
136
  const colorKey = viraColorVariantToHostClassKey[colorVariant];
@@ -25,23 +25,25 @@ export const ViraCard = defineViraElement()({
25
25
  },
26
26
  cssVars: {
27
27
  'vira-card-border': css `1px solid ${viraFormCssVars['vira-form-border-color'].value}`,
28
- 'vira-card-padding': viraFormCssVars['vira-form-wrapper-radius'].value,
28
+ 'vira-card-padding': '24px',
29
29
  },
30
- styles: ({ hostClasses, cssVars }) => css `
31
- :host {
32
- display: block;
33
- border: ${cssVars['vira-card-border'].value};
34
- border-radius: ${viraFormCssVars['vira-form-wrapper-radius'].value};
35
- padding: ${cssVars['vira-card-padding'].value};
36
- }
30
+ styles: ({ hostClasses, cssVars }) => {
31
+ return css `
32
+ :host {
33
+ display: block;
34
+ border: ${cssVars['vira-card-border'].value};
35
+ border-radius: ${viraFormCssVars['vira-form-wrapper-radius'].value};
36
+ padding: ${cssVars['vira-card-padding'].value};
37
+ }
37
38
 
38
- ${hostClasses['vira-card-error'].selector} {
39
- border-color: ${viraFormCssVars['vira-form-error-color'].value};
40
- }
41
- ${hostClasses['vira-card-success'].selector} {
42
- border-color: ${viraFormCssVars['vira-form-success-color'].value};
43
- }
44
- `,
39
+ ${hostClasses['vira-card-error'].selector} {
40
+ border-color: ${viraFormCssVars['vira-form-error-color'].value};
41
+ }
42
+ ${hostClasses['vira-card-success'].selector} {
43
+ border-color: ${viraFormCssVars['vira-form-success-color'].value};
44
+ }
45
+ `;
46
+ },
45
47
  render() {
46
48
  return html `
47
49
  <slot></slot>