vira 32.0.0-beta.0 → 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/{src/elements/color/vira-color-details.element.ts → dist/elements/color/vira-color-details.element.js} +43 -59
- 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/{src/elements/color/vira-color-pair-contrast-summary.element.ts → dist/elements/color/vira-color-pair-contrast-summary.element.js} +68 -100
- package/dist/elements/color/vira-color-pair.element.d.ts +17 -0
- package/{src/elements/color/vira-color-pair.element.ts → dist/elements/color/vira-color-pair.element.js} +50 -71
- package/dist/elements/color/vira-color-picker.element.d.ts +20 -0
- package/{src/elements/color/vira-color-picker.element.ts → dist/elements/color/vira-color-picker.element.js} +92 -117
- 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/{src/elements/color/vira-color-swatch.element.ts → dist/elements/color/vira-color-swatch.element.js} +6 -16
- package/dist/elements/color/vira-contrast-indicator.element.d.ts +10 -0
- package/{src/elements/color/vira-contrast-indicator.element.ts → dist/elements/color/vira-contrast-indicator.element.js} +13 -28
- package/dist/elements/index.js +39 -0
- package/dist/elements/pop-up/vira-menu-item.element.d.ts +38 -0
- package/{src/elements/pop-up/vira-menu-item.element.ts → dist/elements/pop-up/vira-menu-item.element.js} +80 -117
- package/dist/elements/pop-up/vira-menu-trigger.element.d.ts +45 -0
- package/dist/elements/pop-up/vira-menu-trigger.element.js +100 -0
- package/dist/elements/pop-up/vira-menu.element.d.ts +36 -0
- package/{src/elements/pop-up/vira-menu.element.ts → dist/elements/pop-up/vira-menu.element.js} +28 -31
- package/dist/elements/pop-up/vira-pop-up-trigger.element.d.ts +109 -0
- package/dist/elements/pop-up/vira-pop-up-trigger.element.js +408 -0
- package/dist/elements/vira-absolute-time.element.d.ts +35 -0
- package/dist/elements/vira-absolute-time.element.js +43 -0
- package/dist/elements/vira-bold-text.element.d.ts +9 -0
- package/{src/elements/vira-bold-text.element.ts → dist/elements/vira-bold-text.element.js} +11 -10
- package/dist/elements/vira-button.element.d.ts +44 -0
- package/{src/elements/vira-button.element.ts → dist/elements/vira-button.element.js} +107 -255
- package/dist/elements/vira-card.element.d.ts +18 -0
- package/{src/elements/vira-card.element.ts → dist/elements/vira-card.element.js} +19 -18
- package/dist/elements/vira-checkbox.element.d.ts +44 -0
- package/{src/elements/vira-checkbox.element.ts → dist/elements/vira-checkbox.element.js} +48 -95
- package/dist/elements/vira-collapsible-card.element.d.ts +36 -0
- package/{src/elements/vira-collapsible-card.element.ts → dist/elements/vira-collapsible-card.element.js} +44 -71
- package/dist/elements/vira-collapsible-wrapper.element.d.ts +30 -0
- package/{src/elements/vira-collapsible-wrapper.element.ts → dist/elements/vira-collapsible-wrapper.element.js} +47 -59
- package/dist/elements/vira-date-input.element.d.ts +47 -0
- package/dist/elements/vira-date-input.element.js +142 -0
- package/dist/elements/vira-drawer.element.d.ts +24 -0
- package/{src/elements/vira-drawer.element.ts → dist/elements/vira-drawer.element.js} +98 -125
- package/dist/elements/vira-dropdown.element.d.ts +43 -0
- package/dist/elements/vira-dropdown.element.js +247 -0
- package/dist/elements/vira-error.element.d.ts +7 -0
- package/{src/elements/vira-error.element.ts → dist/elements/vira-error.element.js} +7 -8
- package/dist/elements/vira-form.element.d.ts +56 -0
- package/dist/elements/vira-form.element.js +376 -0
- package/dist/elements/vira-icon.element.d.ts +13 -0
- package/{src/elements/vira-icon.element.ts → dist/elements/vira-icon.element.js} +12 -16
- package/dist/elements/vira-image.element.d.ts +45 -0
- package/{src/elements/vira-image.element.ts → dist/elements/vira-image.element.js} +50 -70
- package/dist/elements/vira-input.element.d.ts +64 -0
- package/{src/elements/vira-input.element.ts → dist/elements/vira-input.element.js} +112 -167
- package/dist/elements/vira-json-form.element.d.ts +35 -0
- package/{src/elements/vira-json-form.element.ts → dist/elements/vira-json-form.element.js} +356 -522
- package/dist/elements/vira-link.element.d.ts +78 -0
- package/{src/elements/vira-link.element.ts → dist/elements/vira-link.element.js} +24 -83
- package/dist/elements/vira-modal.element.d.ts +40 -0
- package/{src/elements/vira-modal.element.ts → dist/elements/vira-modal.element.js} +68 -104
- package/dist/elements/vira-progress.element.d.ts +18 -0
- package/{src/elements/vira-progress.element.ts → dist/elements/vira-progress.element.js} +12 -25
- package/dist/elements/vira-relative-time.element.d.ts +42 -0
- package/dist/elements/vira-relative-time.element.js +96 -0
- package/dist/elements/vira-select.element.d.ts +44 -0
- package/{src/elements/vira-select.element.ts → dist/elements/vira-select.element.js} +89 -138
- package/dist/elements/vira-tabs.element.d.ts +124 -0
- package/{src/elements/vira-tabs.element.ts → dist/elements/vira-tabs.element.js} +242 -446
- package/dist/elements/vira-tag.element.d.ts +40 -0
- package/{src/elements/vira-tag.element.ts → dist/elements/vira-tag.element.js} +152 -266
- package/dist/elements/vira-text-area.element.d.ts +48 -0
- package/{src/elements/vira-text-area.element.ts → dist/elements/vira-text-area.element.js} +52 -70
- package/dist/elements/vira-theme-switcher.element.d.ts +17 -0
- package/{src/elements/vira-theme-switcher.element.ts → dist/elements/vira-theme-switcher.element.js} +34 -49
- package/dist/icons/colored-icon.d.ts +11 -0
- package/{src/icons/colored-icon.ts → dist/icons/colored-icon.js} +17 -24
- package/dist/icons/icon-css-vars.d.ts +14 -0
- package/{src/icons/icon-css-vars.ts → dist/icons/icon-css-vars.js} +1 -2
- package/{src/icons/icon-svg.ts → dist/icons/icon-svg.d.ts} +3 -15
- package/dist/icons/icon-svg.js +12 -0
- package/dist/icons/icon-svgs/16/check-16.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/16/check-16.icon.ts → dist/icons/icon-svgs/16/check-16.icon.js} +4 -5
- package/dist/icons/icon-svgs/16/chevron-down-16.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/16/chevron-down-16.icon.ts → dist/icons/icon-svgs/16/chevron-down-16.icon.js} +4 -5
- package/dist/icons/icon-svgs/16/chevron-up-16.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/16/chevron-up-16.icon.ts → dist/icons/icon-svgs/16/chevron-up-16.icon.js} +4 -5
- package/dist/icons/icon-svgs/16/dash-16.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/16/dash-16.icon.ts → dist/icons/icon-svgs/16/dash-16.icon.js} +4 -5
- package/dist/icons/icon-svgs/16/element-16.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/16/element-16.icon.ts → dist/icons/icon-svgs/16/element-16.icon.js} +4 -5
- package/dist/icons/icon-svgs/16/plus-16.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/16/plus-16.icon.ts → dist/icons/icon-svgs/16/plus-16.icon.js} +4 -5
- package/dist/icons/icon-svgs/16/upload-16.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/16/upload-16.icon.ts → dist/icons/icon-svgs/16/upload-16.icon.js} +4 -5
- package/dist/icons/icon-svgs/16/x-16.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/16/x-16.icon.ts → dist/icons/icon-svgs/16/x-16.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/arrow-down-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/arrow-down-24.icon.ts → dist/icons/icon-svgs/24/arrow-down-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/arrow-left-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/arrow-left-24.icon.ts → dist/icons/icon-svgs/24/arrow-left-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/arrow-right-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/arrow-right-24.icon.ts → dist/icons/icon-svgs/24/arrow-right-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/arrow-up-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/arrow-up-24.icon.ts → dist/icons/icon-svgs/24/arrow-up-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/auto-theme-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/auto-theme-24.icon.ts → dist/icons/icon-svgs/24/auto-theme-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/bell-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/bell-24.icon.ts → dist/icons/icon-svgs/24/bell-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/chat-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/chat-24.icon.ts → dist/icons/icon-svgs/24/chat-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/check-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/check-24.icon.ts → dist/icons/icon-svgs/24/check-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/chevron-down-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/chevron-down-24.icon.ts → dist/icons/icon-svgs/24/chevron-down-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/chevron-up-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/chevron-up-24.icon.ts → dist/icons/icon-svgs/24/chevron-up-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/close-x-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/close-x-24.icon.ts → dist/icons/icon-svgs/24/close-x-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/commit-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/commit-24.icon.ts → dist/icons/icon-svgs/24/commit-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/copy-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/copy-24.icon.ts → dist/icons/icon-svgs/24/copy-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/document-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/document-24.icon.ts → dist/icons/icon-svgs/24/document-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/document-search-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/document-search-24.icon.ts → dist/icons/icon-svgs/24/document-search-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/double-chevron-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/double-chevron-24.icon.ts → dist/icons/icon-svgs/24/double-chevron-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/element-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/element-24.icon.ts → dist/icons/icon-svgs/24/element-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/external-link-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/external-link-24.icon.ts → dist/icons/icon-svgs/24/external-link-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/eye-closed-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/eye-closed-24.icon.ts → dist/icons/icon-svgs/24/eye-closed-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/eye-open-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/eye-open-24.icon.ts → dist/icons/icon-svgs/24/eye-open-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/filter-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/filter-24.icon.ts → dist/icons/icon-svgs/24/filter-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/globe-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/globe-24.icon.ts → dist/icons/icon-svgs/24/globe-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/link-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/link-24.icon.ts → dist/icons/icon-svgs/24/link-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/loader-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/loader-24.icon.ts → dist/icons/icon-svgs/24/loader-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/loader-animated-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/loader-animated-24.icon.ts → dist/icons/icon-svgs/24/loader-animated-24.icon.js} +6 -8
- package/dist/icons/icon-svgs/24/lock-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/lock-24.icon.ts → dist/icons/icon-svgs/24/lock-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/magnifying-glass-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/magnifying-glass-24.icon.ts → dist/icons/icon-svgs/24/magnifying-glass-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/moon-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/moon-24.icon.ts → dist/icons/icon-svgs/24/moon-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/options-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/options-24.icon.ts → dist/icons/icon-svgs/24/options-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/pencil-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/pencil-24.icon.ts → dist/icons/icon-svgs/24/pencil-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/plus-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/plus-24.icon.ts → dist/icons/icon-svgs/24/plus-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/printer-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/printer-24.icon.ts → dist/icons/icon-svgs/24/printer-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/shield-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/shield-24.icon.ts → dist/icons/icon-svgs/24/shield-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/sort-ascending-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/sort-ascending-24.icon.ts → dist/icons/icon-svgs/24/sort-ascending-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/sort-descending-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/sort-descending-24.icon.ts → dist/icons/icon-svgs/24/sort-descending-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/sparkle-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/sparkle-24.icon.ts → dist/icons/icon-svgs/24/sparkle-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/speaker-loud-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/speaker-loud-24.icon.ts → dist/icons/icon-svgs/24/speaker-loud-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/speaker-medium-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/speaker-medium-24.icon.ts → dist/icons/icon-svgs/24/speaker-medium-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/speaker-muted-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/speaker-muted-24.icon.ts → dist/icons/icon-svgs/24/speaker-muted-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/speaker-quiet-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/speaker-quiet-24.icon.ts → dist/icons/icon-svgs/24/speaker-quiet-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/star-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/star-24.icon.ts → dist/icons/icon-svgs/24/star-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/status-failure-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/status-failure-24.icon.ts → dist/icons/icon-svgs/24/status-failure-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/status-in-progress-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/status-in-progress-24.icon.ts → dist/icons/icon-svgs/24/status-in-progress-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/status-success-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/status-success-24.icon.ts → dist/icons/icon-svgs/24/status-success-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/status-unknown-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/status-unknown-24.icon.ts → dist/icons/icon-svgs/24/status-unknown-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/status-warning-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/status-warning-24.icon.ts → dist/icons/icon-svgs/24/status-warning-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/sun-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/sun-24.icon.ts → dist/icons/icon-svgs/24/sun-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/upload-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/upload-24.icon.ts → dist/icons/icon-svgs/24/upload-24.icon.js} +4 -5
- package/dist/icons/icon-svgs/24/x-24.icon.d.ts +8 -0
- package/{src/icons/icon-svgs/24/x-24.icon.ts → dist/icons/icon-svgs/24/x-24.icon.js} +4 -5
- package/dist/icons/index.d.ts +197 -0
- package/{src/icons/index.ts → dist/icons/index.js} +60 -65
- package/dist/icons/lucide-icons.d.ts +15 -0
- package/dist/icons/lucide-icons.js +79 -0
- package/dist/icons/sized-icon.d.ts +8 -0
- package/{src/icons/sized-icon.ts → dist/icons/sized-icon.js} +1 -3
- package/dist/index.js +4 -0
- package/dist/styles/disabled.d.ts +6 -0
- package/{src/styles/disabled.ts → dist/styles/disabled.js} +2 -3
- package/dist/styles/durations.d.ts +22 -0
- package/{src/styles/durations.ts → dist/styles/durations.js} +1 -2
- package/dist/styles/focus.d.ts +26 -0
- package/{src/styles/focus.ts → dist/styles/focus.js} +12 -40
- package/dist/styles/font.d.ts +12 -0
- package/{src/styles/font.ts → dist/styles/font.js} +1 -3
- package/dist/styles/form-styles.d.ts +46 -0
- package/dist/styles/form-styles.js +53 -0
- package/dist/styles/form-variants.d.ts +117 -0
- package/{src/styles/form-variants.ts → dist/styles/form-variants.js} +34 -42
- package/{src/styles/index.ts → dist/styles/index.d.ts} +0 -1
- package/dist/styles/index.js +14 -0
- package/dist/styles/native-styles.d.ts +13 -0
- package/{src/styles/native-styles.ts → dist/styles/native-styles.js} +3 -5
- package/dist/styles/scrollbar.d.ts +6 -0
- package/{src/styles/scrollbar.ts → dist/styles/scrollbar.js} +3 -4
- package/dist/styles/shadows.d.ts +19 -0
- package/{src/styles/shadows.ts → dist/styles/shadows.js} +5 -7
- package/dist/styles/user-select.d.ts +6 -0
- package/{src/styles/user-select.ts → dist/styles/user-select.js} +2 -3
- package/dist/styles/vira-color-palette.d.ts +178 -0
- package/{src/styles/vira-color-palette.ts → dist/styles/vira-color-palette.js} +1 -3
- package/dist/styles/vira-color-theme-object.d.ts +65 -0
- package/dist/styles/vira-color-theme-object.js +65 -0
- package/dist/styles/vira-color-theme.d.ts +2785 -0
- package/{src/styles/vira-color-theme.ts → dist/styles/vira-color-theme.js} +1222 -1227
- 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-table.d.ts +115 -0
- package/dist/util/define-table.js +115 -0
- package/dist/util/define-vira-element.d.ts +18 -0
- package/dist/util/define-vira-element.js +19 -0
- package/dist/util/dynamic-element.d.ts +62 -0
- package/dist/util/dynamic-element.js +61 -0
- package/dist/util/index.js +11 -0
- package/dist/util/overflow-observer.d.ts +25 -0
- package/{src/util/overflow-observer.ts → dist/util/overflow-observer.js} +1 -30
- package/dist/util/pop-up-helpers.d.ts +59 -0
- package/dist/util/pop-up-helpers.js +66 -0
- package/dist/util/pop-up-manager.d.ts +200 -0
- package/dist/util/pop-up-manager.js +258 -0
- package/dist/util/shared-text-input-logic.d.ts +69 -0
- package/dist/util/shared-text-input-logic.js +114 -0
- package/dist/util/vira-form-fields.d.ts +145 -0
- package/dist/util/vira-form-fields.js +66 -0
- package/dist/util/vira-json-schema.d.ts +206 -0
- package/{src/util/vira-json-schema.ts → dist/util/vira-json-schema.js} +155 -298
- package/{src/util/vira-select-option.ts → dist/util/vira-select-option.d.ts} +2 -9
- package/dist/util/vira-select-option.js +8 -0
- package/dist/util/vira-theme-client.d.ts +83 -0
- package/dist/util/vira-theme-client.js +93 -0
- package/package.json +13 -13
- package/src/elements/color/vira-all-color-space-sliders.element.ts +0 -66
- package/src/elements/color/vira-all-spaces-color-picker.element.ts +0 -85
- package/src/elements/color/vira-color-format-sliders.element.ts +0 -78
- package/src/elements/color/vira-color-slider.element.ts +0 -169
- package/src/elements/pop-up/vira-menu-trigger.element.ts +0 -135
- package/src/elements/pop-up/vira-pop-up-trigger.element.ts +0 -539
- package/src/elements/vira-absolute-time.element.ts +0 -81
- package/src/elements/vira-date-input.element.ts +0 -185
- package/src/elements/vira-dropdown.element.ts +0 -310
- package/src/elements/vira-form.element.ts +0 -466
- package/src/elements/vira-relative-time.element.ts +0 -135
- package/src/icons/icon-color.test-helper.ts +0 -9
- package/src/icons/lucide-icons.ts +0 -120
- package/src/styles/form-styles.ts +0 -86
- package/src/styles/vira-color-palette.json +0 -170
- package/src/styles/vira-color-theme-object.ts +0 -170
- package/src/util/color-local-storage.client.ts +0 -7
- package/src/util/define-table.ts +0 -286
- package/src/util/define-vira-element.ts +0 -29
- package/src/util/dynamic-element.ts +0 -128
- package/src/util/pop-up-helpers.ts +0 -133
- package/src/util/pop-up-manager.ts +0 -434
- package/src/util/shared-text-input-logic.ts +0 -192
- package/src/util/vira-form-fields.ts +0 -195
- package/src/util/vira-theme-client.ts +0 -140
- /package/{src/elements/index.ts → dist/elements/index.d.ts} +0 -0
- /package/{src/index.ts → dist/index.d.ts} +0 -0
- /package/{src/util/index.ts → dist/util/index.d.ts} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type PartialWithUndefined } from '@augment-vir/common';
|
|
2
|
+
import { type ViraIconSvg } from '../icons/index.js';
|
|
3
|
+
import { ViraColorVariant, ViraEmphasis, ViraSize } from '../styles/index.js';
|
|
4
|
+
import { ViraThemeColorName } from '../styles/vira-color-theme-object.js';
|
|
5
|
+
/**
|
|
6
|
+
* A custom button with default styling.
|
|
7
|
+
*
|
|
8
|
+
* @category Button
|
|
9
|
+
* @category Elements
|
|
10
|
+
* @see https://electrovir.github.io/vira/book/elements/vira-button
|
|
11
|
+
*/
|
|
12
|
+
export declare const ViraButton: import("element-vir").DeclarativeElementDefinition<"vira-button", PartialWithUndefined<{
|
|
13
|
+
text: string;
|
|
14
|
+
icon: Readonly<ViraIconSvg>;
|
|
15
|
+
/** @default false */
|
|
16
|
+
isDisabled: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Set a predefined emphasis variant. Set to `ViraEmphasis.None` for maximum customization.
|
|
19
|
+
*
|
|
20
|
+
* @default ViraEmphasis.Standard
|
|
21
|
+
*/
|
|
22
|
+
buttonEmphasis: ViraEmphasis;
|
|
23
|
+
/**
|
|
24
|
+
* Set a predefined size variant. Set to `ViraSize.None` for maximum customization. In that
|
|
25
|
+
* case, you will need to set a `height`.
|
|
26
|
+
*
|
|
27
|
+
* @default ViraSize.Medium
|
|
28
|
+
*/
|
|
29
|
+
buttonSize: ViraSize;
|
|
30
|
+
/**
|
|
31
|
+
* Set a predefined color variant or a raw {@link ViraThemeColorName} (e.g.,
|
|
32
|
+
* `ViraThemeColorName.blue`). Set to `ViraColorVariant.Custom` for maximum customization.
|
|
33
|
+
* In that case, you will need to use this element's CSS vars to customize the colors.
|
|
34
|
+
*
|
|
35
|
+
* @default ViraColorVariant.Plain
|
|
36
|
+
*/
|
|
37
|
+
color: ViraColorVariant | ViraThemeColorName;
|
|
38
|
+
/**
|
|
39
|
+
* Set to `true` to render `icon` after `text` instead of before it.
|
|
40
|
+
*
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
showIconOnRight: boolean;
|
|
44
|
+
}>, {}, {}, "vira-button-color-red" | "vira-button-color-yellow" | "vira-button-color-green" | "vira-button-color-blue" | "vira-button-color-brand" | "vira-button-color-purple" | "vira-button-color-plain" | "vira-button-color-neutral" | "vira-button-color-teal" | "vira-button-color-pink" | "vira-button-color-grey" | "vira-button-disabled" | "vira-button-icon-only" | "vira-button-size-large" | "vira-button-size-medium" | "vira-button-size-small" | "vira-button-emphasis-standard" | "vira-button-emphasis-subtle", "vira-button-text-color" | "vira-button-background-color" | "vira-button-border-color" | "vira-button-hover-text-color" | "vira-button-hover-background-color" | "vira-button-hover-border-color" | "vira-button-active-text-color" | "vira-button-active-background-color" | "vira-button-active-border-color" | "vira-button-disabled-text-color" | "vira-button-disabled-background-color" | "vira-button-disabled-border-color" | "vira-button-border-width" | "vira-button-border-radius", readonly [], readonly []>;
|
|
@@ -1,52 +1,22 @@
|
|
|
1
|
-
import {arrayToObject, getObjectTypedKeys
|
|
2
|
-
import {ContrastLevelName} from '@electrovir/color/dist/data/contrast/contrast.js';
|
|
3
|
-
import {css, html, nothing, unsafeCSS
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from '../styles/form-variants.js';
|
|
16
|
-
import {
|
|
17
|
-
noUserSelect,
|
|
18
|
-
ViraColorVariant,
|
|
19
|
-
ViraEmphasis,
|
|
20
|
-
ViraSize,
|
|
21
|
-
viraTheme,
|
|
22
|
-
} from '../styles/index.js';
|
|
23
|
-
import {noNativeFormStyles} from '../styles/native-styles.js';
|
|
24
|
-
import {viraThemeByKeys, ViraThemeColorName} from '../styles/vira-color-theme-object.js';
|
|
25
|
-
import {defineViraElement} from '../util/define-vira-element.js';
|
|
26
|
-
import {ViraIcon} from './vira-icon.element.js';
|
|
27
|
-
|
|
28
|
-
type ButtonColorValue = Pick<SingleCssVarDefinition, 'value'>;
|
|
29
|
-
|
|
30
|
-
const transparentColor: ButtonColorValue = {
|
|
31
|
-
value: css`transparent`,
|
|
1
|
+
import { arrayToObject, getObjectTypedKeys } from '@augment-vir/common';
|
|
2
|
+
import { ContrastLevelName } from '@electrovir/color/dist/data/contrast/contrast.js';
|
|
3
|
+
import { css, html, nothing, unsafeCSS } from 'element-vir';
|
|
4
|
+
import { themeDefaultKey } from 'theme-vir/dist/color-theme/color-theme.js';
|
|
5
|
+
import { createFocusStyles } from '../styles/focus.js';
|
|
6
|
+
import { viraFormCssVars } from '../styles/form-styles.js';
|
|
7
|
+
import { standaloneThemeColorNames, viraColorVariantToHostClassKey, viraEmphasisVariants, viraSizeHeights, viraSizeVariants, } from '../styles/form-variants.js';
|
|
8
|
+
import { noUserSelect, ViraColorVariant, ViraEmphasis, ViraSize, viraTheme, } from '../styles/index.js';
|
|
9
|
+
import { noNativeFormStyles } from '../styles/native-styles.js';
|
|
10
|
+
import { viraThemeByKeys, ViraThemeColorName } from '../styles/vira-color-theme-object.js';
|
|
11
|
+
import { defineViraElement } from '../util/define-vira-element.js';
|
|
12
|
+
import { ViraIcon } from './vira-icon.element.js';
|
|
13
|
+
const transparentColor = {
|
|
14
|
+
value: css `transparent`,
|
|
32
15
|
};
|
|
33
|
-
|
|
34
|
-
type ButtonColorStateColors = Record<
|
|
35
|
-
'idle' | 'hover' | 'active',
|
|
36
|
-
{
|
|
37
|
-
textColor: ButtonColorValue;
|
|
38
|
-
borderColor: ButtonColorValue;
|
|
39
|
-
backgroundColor: ButtonColorValue;
|
|
40
|
-
}
|
|
41
|
-
>;
|
|
42
|
-
|
|
43
|
-
function buildThemedButtonColors(
|
|
44
|
-
colorName: ViraThemeColorName,
|
|
45
|
-
): Record<Exclude<ViraEmphasis, ViraEmphasis.None>, ButtonColorStateColors> {
|
|
16
|
+
function buildThemedButtonColors(colorName) {
|
|
46
17
|
const behindBg = viraThemeByKeys[colorName]['behind-bg'];
|
|
47
18
|
const foreground = viraThemeByKeys[colorName].foreground;
|
|
48
19
|
const onSelf = viraThemeByKeys[colorName]['on-self'];
|
|
49
|
-
|
|
50
20
|
return {
|
|
51
21
|
[ViraEmphasis.Standard]: {
|
|
52
22
|
idle: {
|
|
@@ -84,11 +54,7 @@ function buildThemedButtonColors(
|
|
|
84
54
|
},
|
|
85
55
|
};
|
|
86
56
|
}
|
|
87
|
-
|
|
88
|
-
const plainButtonColors: Record<
|
|
89
|
-
Exclude<ViraEmphasis, ViraEmphasis.None>,
|
|
90
|
-
ButtonColorStateColors
|
|
91
|
-
> = {
|
|
57
|
+
const plainButtonColors = {
|
|
92
58
|
[ViraEmphasis.Standard]: {
|
|
93
59
|
idle: {
|
|
94
60
|
backgroundColor: viraTheme.colors[themeDefaultKey].foreground,
|
|
@@ -124,11 +90,7 @@ const plainButtonColors: Record<
|
|
|
124
90
|
},
|
|
125
91
|
},
|
|
126
92
|
};
|
|
127
|
-
|
|
128
|
-
const neutralButtonColors: Record<
|
|
129
|
-
Exclude<ViraEmphasis, ViraEmphasis.None>,
|
|
130
|
-
ButtonColorStateColors
|
|
131
|
-
> = {
|
|
93
|
+
const neutralButtonColors = {
|
|
132
94
|
[ViraEmphasis.Standard]: {
|
|
133
95
|
idle: {
|
|
134
96
|
backgroundColor: viraTheme.colors[themeDefaultKey].background,
|
|
@@ -148,7 +110,6 @@ const neutralButtonColors: Record<
|
|
|
148
110
|
},
|
|
149
111
|
[ViraEmphasis.Subtle]: buildThemedButtonColors(ViraThemeColorName.grey)[ViraEmphasis.Subtle],
|
|
150
112
|
};
|
|
151
|
-
|
|
152
113
|
/**
|
|
153
114
|
* A custom button with default styling.
|
|
154
115
|
*
|
|
@@ -156,192 +117,112 @@ const neutralButtonColors: Record<
|
|
|
156
117
|
* @category Elements
|
|
157
118
|
* @see https://electrovir.github.io/vira/book/elements/vira-button
|
|
158
119
|
*/
|
|
159
|
-
export const ViraButton = defineViraElement
|
|
160
|
-
PartialWithUndefined<{
|
|
161
|
-
text: string;
|
|
162
|
-
icon: Readonly<ViraIconSvg>;
|
|
163
|
-
/** @default false */
|
|
164
|
-
isDisabled: boolean;
|
|
165
|
-
/**
|
|
166
|
-
* Set a predefined emphasis variant. Set to `ViraEmphasis.None` for maximum customization.
|
|
167
|
-
*
|
|
168
|
-
* @default ViraEmphasis.Standard
|
|
169
|
-
*/
|
|
170
|
-
buttonEmphasis: ViraEmphasis;
|
|
171
|
-
/**
|
|
172
|
-
* Set a predefined size variant. Set to `ViraSize.None` for maximum customization. In that
|
|
173
|
-
* case, you will need to set a `height`.
|
|
174
|
-
*
|
|
175
|
-
* @default ViraSize.Medium
|
|
176
|
-
*/
|
|
177
|
-
buttonSize: ViraSize;
|
|
178
|
-
/**
|
|
179
|
-
* Set a predefined color variant or a raw {@link ViraThemeColorName} (e.g.,
|
|
180
|
-
* `ViraThemeColorName.blue`). Set to `ViraColorVariant.Custom` for maximum customization.
|
|
181
|
-
* In that case, you will need to use this element's CSS vars to customize the colors.
|
|
182
|
-
*
|
|
183
|
-
* @default ViraColorVariant.Plain
|
|
184
|
-
*/
|
|
185
|
-
color: ViraColorVariant | ViraThemeColorName;
|
|
186
|
-
/**
|
|
187
|
-
* Set to `true` to render `icon` after `text` instead of before it.
|
|
188
|
-
*
|
|
189
|
-
* @default false
|
|
190
|
-
*/
|
|
191
|
-
showIconOnRight: boolean;
|
|
192
|
-
/**
|
|
193
|
-
* Set to `true` to append a downwards chevron after the button's text.
|
|
194
|
-
*
|
|
195
|
-
* @deprecated Set `icon` to `ChevronDown16Icon` and `showIconOnRight` to `true` instead.
|
|
196
|
-
* @default false
|
|
197
|
-
*/
|
|
198
|
-
showMenuCaret: boolean;
|
|
199
|
-
}>
|
|
200
|
-
>()({
|
|
120
|
+
export const ViraButton = defineViraElement()({
|
|
201
121
|
tagName: 'vira-button',
|
|
202
122
|
hostClasses: {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
'vira-button-size-
|
|
207
|
-
'vira-button-size-medium': ({inputs}) => {
|
|
123
|
+
'vira-button-size-large'({ inputs }) {
|
|
124
|
+
return inputs.buttonSize === ViraSize.Large;
|
|
125
|
+
},
|
|
126
|
+
'vira-button-size-medium'({ inputs }) {
|
|
208
127
|
return !inputs.buttonSize || inputs.buttonSize === ViraSize.Medium;
|
|
209
128
|
},
|
|
210
|
-
'vira-button-size-small'
|
|
211
|
-
|
|
212
|
-
|
|
129
|
+
'vira-button-size-small'({ inputs }) {
|
|
130
|
+
return inputs.buttonSize === ViraSize.Small;
|
|
131
|
+
},
|
|
132
|
+
'vira-button-emphasis-standard'({ inputs }) {
|
|
213
133
|
return !inputs.buttonEmphasis || inputs.buttonEmphasis === ViraEmphasis.Standard;
|
|
214
134
|
},
|
|
215
|
-
'vira-button-emphasis-subtle'
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
inputs
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
return {
|
|
252
|
-
key: `vira-button-color-${colorName}` as const,
|
|
253
|
-
value: ({
|
|
254
|
-
inputs,
|
|
255
|
-
}: {
|
|
256
|
-
inputs: Readonly<
|
|
257
|
-
PartialWithUndefined<{color: ViraColorVariant | ViraThemeColorName}>
|
|
258
|
-
>;
|
|
259
|
-
}) => {
|
|
260
|
-
return inputs.color === colorName;
|
|
261
|
-
},
|
|
262
|
-
};
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
useRequired: true,
|
|
266
|
-
},
|
|
267
|
-
),
|
|
268
|
-
|
|
269
|
-
'vira-button-disabled': ({inputs}) => !!inputs.isDisabled,
|
|
270
|
-
'vira-button-icon-only': ({inputs}) => !inputs.text && !!inputs.icon,
|
|
135
|
+
'vira-button-emphasis-subtle'({ inputs }) {
|
|
136
|
+
return inputs.buttonEmphasis === ViraEmphasis.Subtle;
|
|
137
|
+
},
|
|
138
|
+
...arrayToObject(getObjectTypedKeys(viraColorVariantToHostClassKey), (colorVariant) => {
|
|
139
|
+
const colorKey = viraColorVariantToHostClassKey[colorVariant];
|
|
140
|
+
return {
|
|
141
|
+
key: `vira-button-color-${colorKey}`,
|
|
142
|
+
value({ inputs, }) {
|
|
143
|
+
return inputs.color === colorVariant || inputs.color === colorKey;
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
}, {
|
|
147
|
+
useRequired: true,
|
|
148
|
+
}),
|
|
149
|
+
'vira-button-color-plain'({ inputs, }) {
|
|
150
|
+
return !inputs.color || inputs.color === ViraColorVariant.Plain;
|
|
151
|
+
},
|
|
152
|
+
'vira-button-color-neutral'({ inputs, }) {
|
|
153
|
+
return inputs.color === ViraColorVariant.Neutral;
|
|
154
|
+
},
|
|
155
|
+
...arrayToObject(standaloneThemeColorNames, (colorName) => {
|
|
156
|
+
return {
|
|
157
|
+
key: `vira-button-color-${colorName}`,
|
|
158
|
+
value({ inputs, }) {
|
|
159
|
+
return inputs.color === colorName;
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
}, {
|
|
163
|
+
useRequired: true,
|
|
164
|
+
}),
|
|
165
|
+
'vira-button-disabled'({ inputs }) {
|
|
166
|
+
return !!inputs.isDisabled;
|
|
167
|
+
},
|
|
168
|
+
'vira-button-icon-only'({ inputs }) {
|
|
169
|
+
return !inputs.text && !!inputs.icon;
|
|
170
|
+
},
|
|
271
171
|
},
|
|
272
172
|
cssVars: {
|
|
273
173
|
'vira-button-text-color': 'transparent',
|
|
274
174
|
'vira-button-background-color': 'transparent',
|
|
275
175
|
'vira-button-border-color': 'transparent',
|
|
276
|
-
|
|
277
176
|
'vira-button-hover-text-color': 'transparent',
|
|
278
177
|
'vira-button-hover-background-color': 'transparent',
|
|
279
178
|
'vira-button-hover-border-color': 'transparent',
|
|
280
|
-
|
|
281
179
|
'vira-button-active-text-color': 'transparent',
|
|
282
180
|
'vira-button-active-background-color': 'transparent',
|
|
283
181
|
'vira-button-active-border-color': 'transparent',
|
|
284
|
-
|
|
285
|
-
'vira-button-disabled-
|
|
286
|
-
|
|
287
|
-
'vira-button-disabled-background-color':
|
|
288
|
-
viraTheme.colors['vira-grey-behind-bg-decoration'].background.value,
|
|
289
|
-
'vira-button-disabled-border-color':
|
|
290
|
-
viraTheme.colors['vira-grey-behind-bg-decoration'].background.value,
|
|
291
|
-
|
|
182
|
+
'vira-button-disabled-text-color': viraTheme.colors['vira-grey-behind-bg-decoration'].foreground.value,
|
|
183
|
+
'vira-button-disabled-background-color': viraTheme.colors['vira-grey-behind-bg-decoration'].background.value,
|
|
184
|
+
'vira-button-disabled-border-color': viraTheme.colors['vira-grey-behind-bg-decoration'].background.value,
|
|
292
185
|
'vira-button-border-width': '1px',
|
|
293
186
|
'vira-button-border-radius': viraFormCssVars['vira-form-radius'].value,
|
|
294
187
|
},
|
|
295
|
-
styles
|
|
296
|
-
function buildVariantCssRule({
|
|
297
|
-
|
|
298
|
-
emphasisSelector,
|
|
299
|
-
colors,
|
|
300
|
-
}: Readonly<{
|
|
301
|
-
variantSelector: CSSResult;
|
|
302
|
-
emphasisSelector: CSSResult;
|
|
303
|
-
colors: ButtonColorStateColors;
|
|
304
|
-
}>): CSSResult {
|
|
305
|
-
return css`
|
|
188
|
+
styles({ hostClasses, cssVars }) {
|
|
189
|
+
function buildVariantCssRule({ variantSelector, emphasisSelector, colors, }) {
|
|
190
|
+
return css `
|
|
306
191
|
${variantSelector}${emphasisSelector} {
|
|
307
192
|
${cssVars['vira-button-background-color'].name}: ${colors.idle.backgroundColor
|
|
308
|
-
|
|
193
|
+
.value};
|
|
309
194
|
${cssVars['vira-button-text-color'].name}: ${colors.idle.textColor.value};
|
|
310
195
|
${cssVars['vira-button-border-color'].name}: ${colors.idle.borderColor.value};
|
|
311
196
|
|
|
312
197
|
${cssVars['vira-button-hover-background-color'].name}: ${colors.hover
|
|
313
|
-
|
|
198
|
+
.backgroundColor.value};
|
|
314
199
|
${cssVars['vira-button-hover-text-color'].name}: ${colors.hover.textColor
|
|
315
|
-
|
|
200
|
+
.value};
|
|
316
201
|
${cssVars['vira-button-hover-border-color'].name}: ${colors.hover.borderColor
|
|
317
|
-
|
|
202
|
+
.value};
|
|
318
203
|
|
|
319
204
|
${cssVars['vira-button-active-background-color'].name}: ${colors.active
|
|
320
|
-
|
|
205
|
+
.backgroundColor.value};
|
|
321
206
|
${cssVars['vira-button-active-text-color'].name}: ${colors.active.textColor
|
|
322
|
-
|
|
207
|
+
.value};
|
|
323
208
|
${cssVars['vira-button-active-border-color'].name}: ${colors.active.borderColor
|
|
324
|
-
|
|
209
|
+
.value};
|
|
325
210
|
}
|
|
326
211
|
`;
|
|
327
212
|
}
|
|
328
|
-
|
|
329
|
-
function generateVariantCss(): CSSResult {
|
|
213
|
+
function generateVariantCss() {
|
|
330
214
|
const allStyles = viraEmphasisVariants.flatMap((emphasis) => {
|
|
331
215
|
const emphasisSelector = hostClasses[`vira-button-emphasis-${emphasis}`].selector;
|
|
332
|
-
const themedStyles = getObjectTypedKeys(viraColorVariantToHostClassKey).map(
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
});
|
|
343
|
-
},
|
|
344
|
-
);
|
|
216
|
+
const themedStyles = getObjectTypedKeys(viraColorVariantToHostClassKey).map((colorVariant) => {
|
|
217
|
+
const colorKey = viraColorVariantToHostClassKey[colorVariant];
|
|
218
|
+
const colors = buildThemedButtonColors(colorKey)[emphasis];
|
|
219
|
+
const variantSelector = hostClasses[`vira-button-color-${colorKey}`].selector;
|
|
220
|
+
return buildVariantCssRule({
|
|
221
|
+
variantSelector,
|
|
222
|
+
emphasisSelector,
|
|
223
|
+
colors,
|
|
224
|
+
});
|
|
225
|
+
});
|
|
345
226
|
const plainStyle = buildVariantCssRule({
|
|
346
227
|
variantSelector: hostClasses['vira-button-color-plain'].selector,
|
|
347
228
|
emphasisSelector,
|
|
@@ -368,13 +249,11 @@ export const ViraButton = defineViraElement<
|
|
|
368
249
|
...standaloneStyles,
|
|
369
250
|
];
|
|
370
251
|
});
|
|
371
|
-
|
|
372
252
|
return unsafeCSS(allStyles.join('\n'));
|
|
373
253
|
}
|
|
374
|
-
|
|
375
|
-
function generateSizeVariantCss(): CSSResult {
|
|
254
|
+
function generateSizeVariantCss() {
|
|
376
255
|
const styles = viraSizeVariants.map((sizeVariant) => {
|
|
377
|
-
return css`
|
|
256
|
+
return css `
|
|
378
257
|
${hostClasses[`vira-button-size-${sizeVariant}`].selector} {
|
|
379
258
|
font-size: ${viraFormCssVars[`vira-form-${sizeVariant}-text-size`].value};
|
|
380
259
|
|
|
@@ -390,11 +269,9 @@ export const ViraButton = defineViraElement<
|
|
|
390
269
|
}
|
|
391
270
|
`;
|
|
392
271
|
});
|
|
393
|
-
|
|
394
272
|
return unsafeCSS(styles.join('\n'));
|
|
395
273
|
}
|
|
396
|
-
|
|
397
|
-
return css`
|
|
274
|
+
return css `
|
|
398
275
|
:host {
|
|
399
276
|
cursor: pointer;
|
|
400
277
|
display: inline-flex;
|
|
@@ -403,9 +280,7 @@ export const ViraButton = defineViraElement<
|
|
|
403
280
|
align-items: center;
|
|
404
281
|
box-sizing: border-box;
|
|
405
282
|
${noUserSelect};
|
|
406
|
-
${viraFormCssVars['vira-form-focus-outline-color'].name}: ${viraFormCssVars[
|
|
407
|
-
'vira-form-accent-primary-hover-color'
|
|
408
|
-
].value}
|
|
283
|
+
${viraFormCssVars['vira-form-focus-outline-color'].name}: ${viraFormCssVars['vira-form-accent-primary-hover-color'].value}
|
|
409
284
|
}
|
|
410
285
|
|
|
411
286
|
${generateSizeVariantCss()}
|
|
@@ -435,8 +310,8 @@ export const ViraButton = defineViraElement<
|
|
|
435
310
|
color: ${cssVars['vira-button-text-color'].value};
|
|
436
311
|
|
|
437
312
|
${createFocusStyles({
|
|
438
|
-
|
|
439
|
-
|
|
313
|
+
elementBorderSize: cssVars['vira-button-border-width'],
|
|
314
|
+
})}
|
|
440
315
|
}
|
|
441
316
|
|
|
442
317
|
:host(:hover) button,
|
|
@@ -468,16 +343,6 @@ export const ViraButton = defineViraElement<
|
|
|
468
343
|
align-items: center;
|
|
469
344
|
}
|
|
470
345
|
|
|
471
|
-
.caret-icon {
|
|
472
|
-
margin-left: 8px;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
${hostClasses['vira-button-with-menu-caret'].selector} {
|
|
476
|
-
button {
|
|
477
|
-
padding-right: 6px;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
|
|
481
346
|
${hostClasses['vira-button-disabled'].selector} {
|
|
482
347
|
cursor: not-allowed;
|
|
483
348
|
|
|
@@ -502,46 +367,33 @@ export const ViraButton = defineViraElement<
|
|
|
502
367
|
}
|
|
503
368
|
`;
|
|
504
369
|
},
|
|
505
|
-
render
|
|
370
|
+
render({ inputs }) {
|
|
506
371
|
const iconTemplate = inputs.icon
|
|
507
|
-
? html`
|
|
372
|
+
? html `
|
|
508
373
|
<${ViraIcon.assign({
|
|
509
|
-
|
|
510
|
-
|
|
374
|
+
icon: inputs.icon,
|
|
375
|
+
})}></${ViraIcon}>
|
|
511
376
|
`
|
|
512
377
|
: nothing;
|
|
513
378
|
const textTemplate = inputs.text
|
|
514
|
-
? html`
|
|
379
|
+
? html `
|
|
515
380
|
<span class="text-template">${inputs.text}</span>
|
|
516
381
|
`
|
|
517
|
-
: html`
|
|
382
|
+
: html `
|
|
518
383
|
<span class="empty-text"> </span>
|
|
519
384
|
`;
|
|
520
|
-
|
|
521
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
522
|
-
const caretIconTemplate = inputs.showMenuCaret
|
|
523
|
-
? html`
|
|
524
|
-
<${ViraIcon.assign({
|
|
525
|
-
icon: ChevronDown16Icon,
|
|
526
|
-
})}
|
|
527
|
-
class="caret-icon"
|
|
528
|
-
></${ViraIcon}>
|
|
529
|
-
`
|
|
530
|
-
: nothing;
|
|
531
|
-
|
|
532
385
|
/* Both templates are interpolated with no whitespace between them so `+` selectors match. */
|
|
533
|
-
const templates
|
|
386
|
+
const templates = inputs.showIconOnRight
|
|
534
387
|
? [
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
388
|
+
textTemplate,
|
|
389
|
+
iconTemplate,
|
|
390
|
+
]
|
|
538
391
|
: [
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
<button ?disabled=${inputs.isDisabled}>${templates}${caretIconTemplate}</button>
|
|
392
|
+
iconTemplate,
|
|
393
|
+
textTemplate,
|
|
394
|
+
];
|
|
395
|
+
return html `
|
|
396
|
+
<button ?disabled=${inputs.isDisabled}>${templates}</button>
|
|
545
397
|
`;
|
|
546
398
|
},
|
|
547
399
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State options for {@link ViraCard}.
|
|
3
|
+
*
|
|
4
|
+
* @category Internal
|
|
5
|
+
*/
|
|
6
|
+
export declare enum ViraCardState {
|
|
7
|
+
Error = "error",
|
|
8
|
+
Success = "success"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A simple wrapper "card" element that is just a `<slot>` with some styles.
|
|
12
|
+
*
|
|
13
|
+
* @category Elements
|
|
14
|
+
* @see https://electrovir.github.io/vira/book/elements/vira-card
|
|
15
|
+
*/
|
|
16
|
+
export declare const ViraCard: import("element-vir").DeclarativeElementDefinition<"vira-card", {
|
|
17
|
+
cardState?: ViraCardState | undefined;
|
|
18
|
+
}, {}, {}, "vira-card-error" | "vira-card-success", "vira-card-border" | "vira-card-padding", readonly [], readonly []>;
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import {css, html} from 'element-vir';
|
|
2
|
-
import {viraFormCssVars} from '../styles/form-styles.js';
|
|
3
|
-
import {defineViraElement} from '../util/define-vira-element.js';
|
|
4
|
-
|
|
1
|
+
import { css, html } from 'element-vir';
|
|
2
|
+
import { viraFormCssVars } from '../styles/form-styles.js';
|
|
3
|
+
import { defineViraElement } from '../util/define-vira-element.js';
|
|
5
4
|
/**
|
|
6
5
|
* State options for {@link ViraCard}.
|
|
7
6
|
*
|
|
8
7
|
* @category Internal
|
|
9
8
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
export var ViraCardState;
|
|
10
|
+
(function (ViraCardState) {
|
|
11
|
+
ViraCardState["Error"] = "error";
|
|
12
|
+
ViraCardState["Success"] = "success";
|
|
13
|
+
})(ViraCardState || (ViraCardState = {}));
|
|
15
14
|
/**
|
|
16
15
|
* A simple wrapper "card" element that is just a `<slot>` with some styles.
|
|
17
16
|
*
|
|
18
17
|
* @category Elements
|
|
19
18
|
* @see https://electrovir.github.io/vira/book/elements/vira-card
|
|
20
19
|
*/
|
|
21
|
-
export const ViraCard = defineViraElement
|
|
22
|
-
cardState?: ViraCardState | undefined;
|
|
23
|
-
}>()({
|
|
20
|
+
export const ViraCard = defineViraElement()({
|
|
24
21
|
tagName: 'vira-card',
|
|
25
22
|
hostClasses: {
|
|
26
|
-
'vira-card-error'
|
|
27
|
-
|
|
23
|
+
'vira-card-error'({ inputs }) {
|
|
24
|
+
return inputs.cardState === ViraCardState.Error;
|
|
25
|
+
},
|
|
26
|
+
'vira-card-success'({ inputs }) {
|
|
27
|
+
return inputs.cardState === ViraCardState.Success;
|
|
28
|
+
},
|
|
28
29
|
},
|
|
29
30
|
cssVars: {
|
|
30
|
-
'vira-card-border': css`1px solid ${viraFormCssVars['vira-form-border-color'].value}`,
|
|
31
|
+
'vira-card-border': css `1px solid ${viraFormCssVars['vira-form-border-color'].value}`,
|
|
31
32
|
'vira-card-padding': '24px',
|
|
32
33
|
},
|
|
33
|
-
styles
|
|
34
|
-
return css`
|
|
34
|
+
styles({ hostClasses, cssVars }) {
|
|
35
|
+
return css `
|
|
35
36
|
:host {
|
|
36
37
|
display: block;
|
|
37
38
|
border: ${cssVars['vira-card-border'].value};
|
|
@@ -48,7 +49,7 @@ export const ViraCard = defineViraElement<{
|
|
|
48
49
|
`;
|
|
49
50
|
},
|
|
50
51
|
render() {
|
|
51
|
-
return html`
|
|
52
|
+
return html `
|
|
52
53
|
<slot></slot>
|
|
53
54
|
`;
|
|
54
55
|
},
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type PartialWithUndefined } from '@augment-vir/common';
|
|
2
|
+
import { type AttributeValues, type CSSResult } from 'element-vir';
|
|
3
|
+
import { ViraIcon } from './vira-icon.element.js';
|
|
4
|
+
/**
|
|
5
|
+
* All inner elements supported by {@link ViraCheckbox}.
|
|
6
|
+
*
|
|
7
|
+
* @category Internals
|
|
8
|
+
*/
|
|
9
|
+
export type ViraCheckboxInnerElements = 'label' | 'custom-checkbox' | 'text' | typeof ViraIcon.tagName;
|
|
10
|
+
/**
|
|
11
|
+
* Inputs for {@link ViraCheckbox}.
|
|
12
|
+
*
|
|
13
|
+
* @category Internal
|
|
14
|
+
*/
|
|
15
|
+
export type ViraCheckboxInputs = {
|
|
16
|
+
value: boolean;
|
|
17
|
+
} & PartialWithUndefined<{
|
|
18
|
+
stylePassthrough: Partial<Record<ViraCheckboxInnerElements, CSSResult>>;
|
|
19
|
+
attributePassthrough: Partial<Record<ViraCheckboxInnerElements, AttributeValues>>;
|
|
20
|
+
isDisabled: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Text label for the checkbox. Used as the fallback when the `vira-checkbox-label` slot is not
|
|
23
|
+
* filled.
|
|
24
|
+
*/
|
|
25
|
+
label: string;
|
|
26
|
+
hasError: boolean;
|
|
27
|
+
useHorizontalLabel: boolean;
|
|
28
|
+
/** The checkbox will be filled with a form selection color when it is checked. */
|
|
29
|
+
fillWhenChecked: boolean;
|
|
30
|
+
/** The checkbox will be filled with a form error color when it is unchecked. */
|
|
31
|
+
fillWhenUnchecked: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* A custom checkbox.
|
|
35
|
+
*
|
|
36
|
+
* @category Input
|
|
37
|
+
* @category Elements
|
|
38
|
+
* @see https://electrovir.github.io/vira/book/elements/vira-checkbox
|
|
39
|
+
*/
|
|
40
|
+
export declare const ViraCheckbox: import("element-vir").DeclarativeElementDefinition<`vira-${string}`, Readonly<ViraCheckboxInputs>, {
|
|
41
|
+
hasSlottedLabel: boolean;
|
|
42
|
+
}, {
|
|
43
|
+
valueChange: import("element-vir").DefineElementEvent<boolean>;
|
|
44
|
+
}, "vira-checkbox-horizontal" | "vira-checkbox-filled-checked" | "vira-checkbox-filled-unchecked", `vira-${string}-`, readonly ["vira-checkbox-label"], readonly []>;
|