@vonage/vivid 3.0.0-next.119 → 3.0.0-next.120
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/README.md +11 -6
- package/accordion/index.js +4 -51
- package/accordion-item/index.js +11 -109
- package/action-group/index.js +4 -36
- package/avatar/index.js +8 -64
- package/badge/index.js +9 -48
- package/banner/index.js +15 -117
- package/breadcrumb/index.js +5 -97
- package/breadcrumb-item/index.js +14 -53
- package/button/index.js +14 -92
- package/calendar/index.js +5 -1520
- package/calendar-event/index.js +7 -107
- package/card/index.js +10 -117
- package/checkbox/index.js +13 -175
- package/custom-elements.json +1827 -8
- package/dialog/index.js +14 -227
- package/divider/index.js +4 -25
- package/elevation/index.js +4 -24
- package/fab/index.js +13 -89
- package/focus/index.js +4 -17
- package/header/index.js +7 -12
- package/icon/index.js +7 -28
- package/index.js +49 -55
- package/layout/index.js +4 -42
- package/lib/accordion/definition.d.ts +3 -0
- package/lib/accordion/index.d.ts +1 -2
- package/lib/accordion-item/definition.d.ts +3 -0
- package/lib/accordion-item/index.d.ts +1 -2
- package/lib/action-group/definition.d.ts +3 -0
- package/lib/action-group/index.d.ts +1 -2
- package/lib/avatar/definition.d.ts +3 -0
- package/lib/avatar/index.d.ts +1 -2
- package/lib/badge/definition.d.ts +3 -0
- package/lib/badge/index.d.ts +1 -2
- package/lib/banner/definition.d.ts +3 -0
- package/lib/banner/index.d.ts +1 -2
- package/lib/breadcrumb/definition.d.ts +3 -0
- package/lib/breadcrumb/index.d.ts +1 -2
- package/lib/breadcrumb-item/definition.d.ts +3 -0
- package/lib/breadcrumb-item/index.d.ts +1 -2
- package/lib/button/definition.d.ts +3 -0
- package/lib/calendar/definition.d.ts +3 -0
- package/lib/calendar/index.d.ts +1 -2
- package/lib/calendar-event/definition.d.ts +3 -0
- package/lib/calendar-event/index.d.ts +1 -2
- package/lib/card/definition.d.ts +3 -0
- package/lib/card/index.d.ts +1 -2
- package/lib/checkbox/definition.d.ts +3 -0
- package/lib/checkbox/index.d.ts +1 -2
- package/lib/components.d.ts +38 -38
- package/lib/dialog/definition.d.ts +3 -0
- package/lib/dialog/index.d.ts +1 -2
- package/lib/divider/definition.d.ts +3 -0
- package/lib/divider/index.d.ts +1 -2
- package/lib/elevation/definition.d.ts +3 -0
- package/lib/elevation/index.d.ts +1 -2
- package/lib/fab/definition.d.ts +3 -0
- package/lib/fab/index.d.ts +1 -2
- package/lib/focus/definition.d.ts +3 -0
- package/lib/focus/index.d.ts +1 -2
- package/lib/header/definition.d.ts +3 -0
- package/lib/header/index.d.ts +1 -2
- package/lib/icon/definition.d.ts +3 -0
- package/lib/icon/index.d.ts +1 -2
- package/lib/layout/definition.d.ts +3 -0
- package/lib/layout/index.d.ts +1 -2
- package/lib/listbox/definition.d.ts +3 -0
- package/lib/menu/definition.d.ts +7 -0
- package/lib/menu/index.d.ts +1 -10
- package/lib/menu-item/definition.d.ts +3 -0
- package/lib/menu-item/index.d.ts +1 -2
- package/lib/nav/definition.d.ts +3 -0
- package/lib/nav/index.d.ts +1 -2
- package/lib/nav-disclosure/definition.d.ts +3 -0
- package/lib/nav-disclosure/index.d.ts +1 -2
- package/lib/nav-item/definition.d.ts +3 -0
- package/lib/nav-item/index.d.ts +1 -2
- package/lib/note/definition.d.ts +3 -0
- package/lib/note/index.d.ts +1 -2
- package/lib/number-field/definition.d.ts +3 -0
- package/lib/number-field/index.d.ts +1 -2
- package/lib/option/definition.d.ts +3 -0
- package/lib/option/index.d.ts +1 -2
- package/lib/popup/definition.d.ts +4 -0
- package/lib/popup/index.d.ts +1 -2
- package/lib/progress/definition.d.ts +3 -0
- package/lib/progress/index.d.ts +1 -2
- package/lib/progress-ring/definition.d.ts +3 -0
- package/lib/progress-ring/index.d.ts +1 -2
- package/lib/radio/definition.d.ts +3 -0
- package/lib/radio/index.d.ts +1 -2
- package/lib/radio-group/definition.d.ts +7 -0
- package/lib/radio-group/index.d.ts +1 -10
- package/lib/side-drawer/definition.d.ts +3 -0
- package/lib/side-drawer/index.d.ts +1 -2
- package/lib/slider/definition.d.ts +3 -0
- package/lib/slider/index.d.ts +1 -2
- package/lib/switch/definition.d.ts +3 -0
- package/lib/switch/index.d.ts +1 -2
- package/lib/text-anchor/definition.d.ts +3 -0
- package/lib/text-anchor/index.d.ts +1 -2
- package/lib/text-area/definition.d.ts +3 -0
- package/lib/text-area/index.d.ts +1 -2
- package/lib/text-field/definition.d.ts +3 -0
- package/lib/text-field/index.d.ts +1 -2
- package/lib/tooltip/definition.d.ts +3 -0
- package/lib/tooltip/index.d.ts +1 -2
- package/listbox/index.js +18 -1080
- package/menu/index.js +27 -354
- package/menu-item/index.js +11 -81
- package/nav/index.js +3 -16
- package/nav-disclosure/index.js +13 -77
- package/nav-item/index.js +13 -35
- package/note/index.js +13 -60
- package/number-field/index.js +14 -16
- package/option/index.js +13 -68
- package/package.json +2 -2
- package/popup/index.js +17 -55
- package/progress/index.js +6 -92
- package/progress-ring/index.js +6 -75
- package/radio/index.js +8 -48
- package/radio-group/index.js +9 -433
- package/shared/anchor.js +1 -1
- package/shared/apply-mixins.js +1 -1
- package/shared/base-progress.js +1 -1
- package/shared/breadcrumb-item.js +1 -1
- package/shared/button.js +195 -18
- package/shared/calendar-event.js +1 -1
- package/shared/definition.js +53 -0
- package/shared/definition10.js +99 -0
- package/shared/definition11.js +48 -0
- package/shared/definition12.js +1523 -0
- package/shared/definition13.js +111 -0
- package/shared/definition14.js +114 -0
- package/shared/definition15.js +32 -0
- package/shared/definition16.js +172 -0
- package/shared/definition17.js +223 -0
- package/shared/{divider.js → definition18.js} +25 -2
- package/shared/definition19.js +87 -0
- package/shared/definition2.js +106 -0
- package/shared/definition20.js +44 -0
- package/shared/definition21.js +1078 -0
- package/shared/{listbox-option.js → definition22.js} +71 -11
- package/shared/definition23.js +348 -0
- package/shared/{popup.js → definition24.js} +46 -3
- package/shared/{menu-item.js → definition25.js} +87 -13
- package/shared/definition26.js +18 -0
- package/shared/definition27.js +75 -0
- package/shared/definition28.js +31 -0
- package/shared/definition29.js +56 -0
- package/shared/definition3.js +29 -0
- package/shared/definition30.js +94 -0
- package/shared/definition31.js +77 -0
- package/shared/definition32.js +45 -0
- package/shared/definition33.js +435 -0
- package/shared/definition34.js +86 -0
- package/shared/definition35.js +592 -0
- package/shared/definition36.js +147 -0
- package/shared/definition37.js +279 -0
- package/shared/definition38.js +119 -0
- package/shared/definition39.js +77 -0
- package/shared/definition4.js +19 -0
- package/shared/definition5.js +38 -0
- package/shared/definition6.js +60 -0
- package/shared/definition7.js +45 -0
- package/shared/definition8.js +113 -0
- package/shared/definition9.js +107 -0
- package/shared/design-system/index.d.ts +1 -2
- package/shared/es.object.assign.js +58 -1
- package/shared/es.regexp.to-string.js +2 -1
- package/shared/focus.js +3 -9
- package/shared/focus2.js +9 -3
- package/shared/form-associated.js +1 -1
- package/shared/form-elements.js +2 -2
- package/shared/icon.js +1096 -9
- package/shared/index.js +385 -2501
- package/shared/patterns/form-elements/form-elements.d.ts +2 -2
- package/shared/radio.js +1 -1
- package/shared/ref.js +1 -1
- package/shared/slotted.js +1 -1
- package/shared/string-trim.js +2 -1
- package/shared/text-anchor.template.js +1 -1
- package/shared/to-string.js +51 -0
- package/side-drawer/index.js +5 -84
- package/slider/index.js +14 -593
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/switch/index.js +13 -149
- package/text-anchor/index.js +8 -7
- package/text-area/index.js +16 -282
- package/text-field/index.js +14 -121
- package/tooltip/index.js +24 -82
- package/vivid.api.json +1640 -850
- package/shared/button2.js +0 -200
- package/shared/elevation.js +0 -10
- package/shared/es.promise.resolve.js +0 -944
- package/shared/index2.js +0 -9
- package/shared/utils/index.d.ts +0 -1
package/note/index.js
CHANGED
|
@@ -1,62 +1,15 @@
|
|
|
1
|
-
import '../shared/
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import '../shared/
|
|
6
|
-
import { I as Icon } from '../shared/icon.js';
|
|
7
|
-
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
8
|
-
import { C as Connotation } from '../shared/enums.js';
|
|
9
|
-
import { w as when } from '../shared/when.js';
|
|
10
|
-
import { c as classNames } from '../shared/class-names.js';
|
|
1
|
+
import { r as registerNote } from '../shared/definition29.js';
|
|
2
|
+
import '../shared/index.js';
|
|
3
|
+
import '../shared/definition3.js';
|
|
4
|
+
import '../shared/icon.js';
|
|
5
|
+
import '../shared/to-string.js';
|
|
11
6
|
import '../shared/string-trim.js';
|
|
12
7
|
import '../shared/_has.js';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let _ = t => t,
|
|
22
|
-
_t,
|
|
23
|
-
_t2,
|
|
24
|
-
_t3;
|
|
25
|
-
const connotationIconMap = new Map([[Connotation.Information, 'info-solid'], [Connotation.Announcement, 'megaphone-solid'], [Connotation.Success, 'check-circle-solid'], [Connotation.Warning, 'warning-solid'], [Connotation.Alert, 'error-solid']]);
|
|
26
|
-
const getClasses = ({
|
|
27
|
-
connotation
|
|
28
|
-
}) => classNames('base', `connotation-${connotation}`);
|
|
29
|
-
function getHeaderTemplate() {
|
|
30
|
-
return html(_t || (_t = _`<div class="headline">${0}</div>`), x => x.headline);
|
|
31
|
-
}
|
|
32
|
-
function getIconType(note) {
|
|
33
|
-
return note.icon ? note.icon : note.connotation ? connotationIconMap.get(note.connotation) : 'megaphone-solid';
|
|
34
|
-
}
|
|
35
|
-
function getIconTemplate(iconTag) {
|
|
36
|
-
return html(_t2 || (_t2 = _`<${0} class="icon" name="${0}"></${0}>`), iconTag, getIconType, iconTag);
|
|
37
|
-
}
|
|
38
|
-
const NoteTemplate = context => {
|
|
39
|
-
const iconTag = context.tagFor(Icon);
|
|
40
|
-
return html(_t3 || (_t3 = _`
|
|
41
|
-
<div class="${0}">
|
|
42
|
-
${0}
|
|
43
|
-
<div class="text">
|
|
44
|
-
${0}
|
|
45
|
-
<slot class="message"></slot>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
`), getClasses, getIconTemplate(iconTag), when(x => x.headline, getHeaderTemplate()));
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const prefix = getPrefix(import.meta.url);
|
|
52
|
-
const vividNote = Note.compose({
|
|
53
|
-
baseName: 'note',
|
|
54
|
-
template: NoteTemplate,
|
|
55
|
-
styles: css_248z
|
|
56
|
-
});
|
|
57
|
-
(async () => {
|
|
58
|
-
await loadComponentsModules(['icon'], prefix);
|
|
59
|
-
designSystem.withPrefix(prefix).register(vividNote());
|
|
60
|
-
})();
|
|
61
|
-
|
|
62
|
-
export { vividNote };
|
|
8
|
+
import '../shared/when.js';
|
|
9
|
+
import '../shared/class-names.js';
|
|
10
|
+
import '../shared/affix.js';
|
|
11
|
+
import '../shared/focus.js';
|
|
12
|
+
import '../shared/apply-mixins.js';
|
|
13
|
+
import '../shared/enums.js';
|
|
14
|
+
|
|
15
|
+
registerNote();
|
package/number-field/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import '../shared/
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { F as FoundationElement, U as DOM, _ as __decorate, a as attr, Z as nullableNumberConverter, N as observable, b as __metadata, h as html, r as registerFactorial } from '../shared/index.js';
|
|
2
|
+
import { B as Button, b as buttonElements } from '../shared/definition9.js';
|
|
3
|
+
import { D as Divider, d as dividerElements } from '../shared/definition18.js';
|
|
4
4
|
import { b as AffixIcon } from '../shared/affix.js';
|
|
5
|
-
import '../shared/
|
|
5
|
+
import '../shared/focus.js';
|
|
6
6
|
import { D as DelegatesARIATextbox, f as formElements, g as getFeedbackTemplate } from '../shared/form-elements.js';
|
|
7
7
|
import { S as StartEnd } from '../shared/start-end.js';
|
|
8
8
|
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
@@ -10,17 +10,18 @@ import { F as FormAssociated } from '../shared/form-associated.js';
|
|
|
10
10
|
import { f as keyArrowDown, e as keyArrowUp } from '../shared/key-codes.js';
|
|
11
11
|
import '../shared/es.regexp.to-string.js';
|
|
12
12
|
import { S as Shape } from '../shared/enums.js';
|
|
13
|
-
import { f as focusTemplateFactory } from '../shared/
|
|
14
|
-
import { B as Button } from '../shared/button.js';
|
|
15
|
-
import { D as Divider } from '../shared/divider.js';
|
|
13
|
+
import { f as focusTemplateFactory } from '../shared/focus2.js';
|
|
16
14
|
import { w as when } from '../shared/when.js';
|
|
17
15
|
import { r as ref } from '../shared/ref.js';
|
|
18
16
|
import { c as classNames } from '../shared/class-names.js';
|
|
17
|
+
import '../shared/definition3.js';
|
|
19
18
|
import '../shared/icon.js';
|
|
19
|
+
import '../shared/to-string.js';
|
|
20
20
|
import '../shared/string-trim.js';
|
|
21
21
|
import '../shared/_has.js';
|
|
22
|
+
import '../shared/definition4.js';
|
|
23
|
+
import '../shared/button.js';
|
|
22
24
|
import '../shared/aria-global.js';
|
|
23
|
-
import '../shared/button2.js';
|
|
24
25
|
import '../shared/aria.js';
|
|
25
26
|
|
|
26
27
|
class _NumberField extends FoundationElement {
|
|
@@ -319,7 +320,7 @@ __decorate([
|
|
|
319
320
|
], NumberField$1.prototype, "defaultSlottedNodes", void 0);
|
|
320
321
|
applyMixins(NumberField$1, StartEnd, DelegatesARIATextbox);
|
|
321
322
|
|
|
322
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 14 Dec 2022
|
|
323
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 14 Dec 2022 16:38:57 GMT\n */\n:host {\n display: inline-block;\n}\n\n.base {\n display: inline-grid;\n width: 100%;\n gap: 4px;\n grid-template-columns: min-content 1fr max-content;\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)).appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(:disabled, .disabled).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-neutral-800);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-500);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-backdrop: var(--vvd-color-success-50);\n --_connotation-color-intermediate: var(--vvd-color-success-500);\n --_connotation-color-firm: var(--vvd-color-success-600);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-backdrop: var(--vvd-color-alert-50);\n --_connotation-color-intermediate: var(--vvd-color-alert-500);\n --_connotation-color-firm: var(--vvd-color-alert-600);\n}\n.base:not(.connotation-success, .connotation-alert) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-backdrop: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-neutral-500);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n --_low-ink-color: var(--vvd-color-neutral-600);\n}\n.base.disabled {\n --_low-ink-color: var(--_appearance-color-text);\n}\n\n.label {\n color: var(--vvd-color-canvas-text);\n contain: inline-size;\n font: var(--vvd-typography-base);\n grid-column: 1/4;\n grid-row: 1;\n}\n.char-count + .label {\n grid-column: 1/3;\n}\n\n.char-count {\n color: var(--_low-ink-color);\n font: var(--vvd-typography-base);\n grid-column: 3/4;\n}\n\n.fieldset {\n position: relative;\n display: flex;\n align-items: center;\n grid-column: 1/4;\n transition: color 0.2s;\n /* Shape */\n}\n.base > .fieldset {\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.base:not(.shape-pill) .fieldset {\n border-radius: 6px;\n}\n.base.shape-pill .fieldset {\n border-radius: 24px;\n}\n\n.control {\n width: 100%;\n border: 0 none;\n background-color: var(--_appearance-color-fill);\n block-size: 100%;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n font: var(--vvd-typography-base);\n padding-inline-end: 16px;\n padding-inline-start: 16px;\n transition: box-shadow 0.2s, background-color 0.2s;\n}\n.control:disabled {\n cursor: not-allowed;\n opacity: 1; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_appearance-color-text); /* 1. sets text fill to current `color` for safari */\n}\n.control::placeholder, .control:disabled::placeholder {\n opacity: 1; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_low-ink-color); /* 1. sets text fill to current `color` for safari */\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n\n.icon {\n position: absolute;\n z-index: 1;\n color: var(--_low-ink-color);\n font-size: 20px;\n inset-inline-start: 16px;\n}\n.icon + .control {\n padding-inline-start: 44px;\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n pointer-events: none;\n}\n.fieldset:not(:focus-visible, :focus-within) > .focus-indicator {\n display: none;\n}\n\n.control {\n padding-inline-end: 70px;\n}\n.control::-webkit-outer-spin-button, .control::-webkit-inner-spin-button {\n appearance: none;\n}\n.control-buttons {\n position: absolute;\n z-index: 1;\n right: 3px;\n display: flex;\n}\n.readonly .control-buttons, .disabled .control-buttons {\n pointer-events: none;\n}\n.control-buttons .divider {\n margin-block: 8px;\n}\n.control-buttons > * {\n flex-shrink: 0;\n}\n\n.disabled .focus-indicator {\n display: none;\n pointer-events: none;\n}";
|
|
323
324
|
|
|
324
325
|
let NumberField = class NumberField extends NumberField$1 {};
|
|
325
326
|
__decorate([attr, __metadata("design:type", String)], NumberField.prototype, "appearance", void 0);
|
|
@@ -443,18 +444,15 @@ const NumberFieldTemplate = context => {
|
|
|
443
444
|
}, getFeedbackTemplate('helper', context)), when(x => !x.successText && x.errorValidationMessage, getFeedbackTemplate('error', context)), when(x => x.successText, getFeedbackTemplate('success', context)));
|
|
444
445
|
};
|
|
445
446
|
|
|
446
|
-
const
|
|
447
|
-
const vividNumberField = NumberField.compose({
|
|
447
|
+
const numberField = NumberField.compose({
|
|
448
448
|
baseName: 'number-field',
|
|
449
449
|
template: NumberFieldTemplate,
|
|
450
450
|
styles: css_248z,
|
|
451
451
|
shadowOptions: {
|
|
452
452
|
delegatesFocus: true
|
|
453
453
|
}
|
|
454
|
-
});
|
|
455
|
-
(async () => {
|
|
456
|
-
await loadComponentsModules(['button', 'divider'], prefix);
|
|
457
|
-
designSystem.withPrefix(prefix).register(vividNumberField());
|
|
458
454
|
})();
|
|
455
|
+
const numberFieldElement = [numberField, ...buttonElements, ...dividerElements];
|
|
456
|
+
const registerNumberField = registerFactorial(numberFieldElement);
|
|
459
457
|
|
|
460
|
-
|
|
458
|
+
registerNumberField();
|
package/option/index.js
CHANGED
|
@@ -1,75 +1,20 @@
|
|
|
1
|
-
import '../shared/
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
|
|
5
|
-
import { L as ListboxOption$1 } from '../shared/listbox-option.js';
|
|
6
|
-
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
7
|
-
import { f as focusTemplateFactory } from '../shared/focus.js';
|
|
1
|
+
import { r as registerOption } from '../shared/definition22.js';
|
|
2
|
+
import '../shared/index.js';
|
|
3
|
+
import '../shared/definition3.js';
|
|
8
4
|
import '../shared/icon.js';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
5
|
+
import '../shared/to-string.js';
|
|
6
|
+
import '../shared/string-trim.js';
|
|
7
|
+
import '../shared/_has.js';
|
|
8
|
+
import '../shared/when.js';
|
|
9
|
+
import '../shared/class-names.js';
|
|
10
|
+
import '../shared/definition4.js';
|
|
11
|
+
import '../shared/focus.js';
|
|
12
|
+
import '../shared/affix.js';
|
|
11
13
|
import '../shared/aria-global.js';
|
|
12
14
|
import '../shared/start-end.js';
|
|
13
15
|
import '../shared/ref.js';
|
|
16
|
+
import '../shared/apply-mixins.js';
|
|
14
17
|
import '../shared/dom.js';
|
|
15
18
|
import '../shared/focus2.js';
|
|
16
|
-
import '../shared/string-trim.js';
|
|
17
|
-
import '../shared/_has.js';
|
|
18
|
-
|
|
19
|
-
class ListboxOption extends ListboxOption$1 {
|
|
20
|
-
set text(value) {
|
|
21
|
-
this._text = value;
|
|
22
|
-
}
|
|
23
|
-
get text() {
|
|
24
|
-
var _a;
|
|
25
|
-
return (_a = this._text) !== null && _a !== void 0 ? _a : '';
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
__decorate([attr({
|
|
29
|
-
attribute: 'text'
|
|
30
|
-
}), __metadata("design:type", String)], ListboxOption.prototype, "_text", void 0);
|
|
31
|
-
applyMixins(ListboxOption, AffixIconWithTrailing);
|
|
32
|
-
|
|
33
|
-
let _ = t => t,
|
|
34
|
-
_t,
|
|
35
|
-
_t2;
|
|
36
|
-
const getClasses = ({
|
|
37
|
-
icon,
|
|
38
|
-
disabled,
|
|
39
|
-
selected,
|
|
40
|
-
checked
|
|
41
|
-
}) => classNames('base', ['disabled', disabled], ['selected', Boolean(selected)], ['active', Boolean(checked)], ['icon', Boolean(icon)]);
|
|
42
|
-
const ListboxOptionTemplate = context => {
|
|
43
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
44
|
-
const focusTemplate = focusTemplateFactory(context);
|
|
45
|
-
return html(_t || (_t = _`
|
|
46
|
-
<template
|
|
47
|
-
aria-checked="${0}"
|
|
48
|
-
aria-disabled="${0}"
|
|
49
|
-
aria-posinset="${0}"
|
|
50
|
-
aria-selected="${0}"
|
|
51
|
-
aria-setsize="${0}"
|
|
52
|
-
role="option">
|
|
53
|
-
<div class="${0}">
|
|
54
|
-
${0}
|
|
55
|
-
${0}
|
|
56
|
-
${0}
|
|
57
|
-
</div>
|
|
58
|
-
</template>
|
|
59
|
-
`), x => x.ariaChecked, x => x.ariaDisabled, x => x.ariaPosInSet, x => x.ariaSelected, x => x.ariaSetSize, getClasses, () => focusTemplate, x => affixIconTemplate(x.icon), when(x => x.text, html(_t2 || (_t2 = _`<div class="text">${0}</div>`), x => x.text)));
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 14 Dec 2022 14:20:57 GMT\n */\n.base {\n position: relative; /* this is needed for the focus */\n display: flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n border-radius: 6px;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n font: var(--vvd-typography-base);\n gap: 12px;\n hyphens: auto;\n inline-size: 100%;\n min-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n padding-block: 10px;\n padding-inline: 16px;\n vertical-align: middle;\n word-break: break-word;\n}\n.base {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-neutral-800);\n --_connotation-color-faint: var(--vvd-color-neutral-50);\n --_connotation-color-soft: var(--vvd-color-neutral-100);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.base:where(.selected, [aria-current]):where(:not(:disabled, .disabled, :hover, .hover)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.base:where(.selected, [aria-current]):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transparent;\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n cursor: pointer;\n}\n.base.disabled {\n cursor: not-allowed;\n}\n.base .text {\n font: var(--vvd-typography-base);\n}\n\n.icon {\n font-size: 20px;\n}\n.base:not(.disabled, .selected) .icon {\n color: var(--vvd-color-neutral-600);\n}\n\n.focus-indicator {\n --focus-stroke-color: var(--vvd-color-neutral-500);\n --focus-stroke-gap-color: transparent;\n}\n:host(:not([aria-checked=true])) .focus-indicator {\n display: none;\n}";
|
|
63
|
-
|
|
64
|
-
const prefix = getPrefix(import.meta.url);
|
|
65
|
-
const vividListboxOption = ListboxOption.compose({
|
|
66
|
-
baseName: 'option',
|
|
67
|
-
template: ListboxOptionTemplate,
|
|
68
|
-
styles: css_248z
|
|
69
|
-
});
|
|
70
|
-
(async () => {
|
|
71
|
-
await loadComponentsModules(['icon', 'focus'], prefix);
|
|
72
|
-
designSystem.withPrefix(prefix).register(vividListboxOption());
|
|
73
|
-
})();
|
|
74
19
|
|
|
75
|
-
|
|
20
|
+
registerOption();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonage/vivid",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.120",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "./index.js",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"exports": {
|
|
19
|
+
".": "./index.js",
|
|
19
20
|
"./accordion": "./accordion",
|
|
20
21
|
"./accordion-item": "./accordion-item",
|
|
21
22
|
"./action-group": "./action-group",
|
|
@@ -59,7 +60,6 @@
|
|
|
59
60
|
"types": "./index.d.ts",
|
|
60
61
|
"dependencies": {
|
|
61
62
|
"rollup-plugin-postcss": "4.0.2",
|
|
62
|
-
"@jest/globals": "28.1.3",
|
|
63
63
|
"@microsoft/fast-element": "1.11.0",
|
|
64
64
|
"@microsoft/fast-foundation": "2.47.0",
|
|
65
65
|
"@microsoft/fast-web-utilities": "5.4.1",
|
package/popup/index.js
CHANGED
|
@@ -1,63 +1,25 @@
|
|
|
1
|
-
import '../shared/
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { E as Elevation } from '../shared/elevation.js';
|
|
6
|
-
import { B as Button } from '../shared/button.js';
|
|
7
|
-
import { w as when } from '../shared/when.js';
|
|
8
|
-
import { r as ref } from '../shared/ref.js';
|
|
9
|
-
import { c as classNames } from '../shared/class-names.js';
|
|
10
|
-
import '../shared/es.object.assign.js';
|
|
11
|
-
import '../shared/key-codes.js';
|
|
12
|
-
import '../shared/affix.js';
|
|
1
|
+
import { r as registerPopup } from '../shared/definition24.js';
|
|
2
|
+
import '../shared/index.js';
|
|
3
|
+
import '../shared/definition9.js';
|
|
4
|
+
import '../shared/definition3.js';
|
|
13
5
|
import '../shared/icon.js';
|
|
6
|
+
import '../shared/to-string.js';
|
|
14
7
|
import '../shared/string-trim.js';
|
|
15
8
|
import '../shared/_has.js';
|
|
16
|
-
import '../shared/
|
|
9
|
+
import '../shared/when.js';
|
|
10
|
+
import '../shared/class-names.js';
|
|
11
|
+
import '../shared/definition4.js';
|
|
12
|
+
import '../shared/focus.js';
|
|
13
|
+
import '../shared/affix.js';
|
|
14
|
+
import '../shared/button.js';
|
|
17
15
|
import '../shared/apply-mixins.js';
|
|
18
16
|
import '../shared/form-associated.js';
|
|
17
|
+
import '../shared/key-codes.js';
|
|
19
18
|
import '../shared/aria-global.js';
|
|
20
19
|
import '../shared/start-end.js';
|
|
20
|
+
import '../shared/ref.js';
|
|
21
|
+
import '../shared/focus2.js';
|
|
22
|
+
import '../shared/definition15.js';
|
|
23
|
+
import '../shared/es.object.assign.js';
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
let _ = t => t,
|
|
25
|
-
_t,
|
|
26
|
-
_t2,
|
|
27
|
-
_t3;
|
|
28
|
-
const getClasses = ({
|
|
29
|
-
open,
|
|
30
|
-
dismissible,
|
|
31
|
-
alternate
|
|
32
|
-
}) => classNames('control', ['open', Boolean(open)], ['dismissible', Boolean(dismissible)], ['alternate', Boolean(alternate)]);
|
|
33
|
-
const popupTemplate = context => {
|
|
34
|
-
const elevationTag = context.tagFor(Elevation);
|
|
35
|
-
const buttonTag = context.tagFor(Button);
|
|
36
|
-
return html(_t || (_t = _`
|
|
37
|
-
<${0}>
|
|
38
|
-
<div class="popup-wrapper ${0}" ${0}>
|
|
39
|
-
<div class="${0}" aria-hidden="${0}"
|
|
40
|
-
part="${0}">
|
|
41
|
-
<div class="popup-content">
|
|
42
|
-
<slot></slot>
|
|
43
|
-
${0}
|
|
44
|
-
</div>
|
|
45
|
-
${0}
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</${0}>`), elevationTag, x => x.strategy, ref('popupEl'), getClasses, x => x.open ? 'false' : 'true', x => x.alternate ? 'vvd-theme-alternate' : '', when(x => x.dismissible, html(_t2 || (_t2 = _`<${0} size="condensed" @click="${0}"
|
|
49
|
-
class="dismissible-button" icon="close-small-solid" shape="pill"></${0}>`), buttonTag, x => x.open = false, buttonTag)), when(x => x.arrow, html(_t3 || (_t3 = _`<div class="arrow" ${0}></div>`), ref('arrowEl'))), elevationTag);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const prefix = getPrefix(import.meta.url);
|
|
53
|
-
const vividPopup = Popup.compose({
|
|
54
|
-
baseName: 'popup',
|
|
55
|
-
template: popupTemplate,
|
|
56
|
-
styles: css_248z
|
|
57
|
-
});
|
|
58
|
-
(async () => {
|
|
59
|
-
await loadComponentsModules(['elevation', 'button'], prefix);
|
|
60
|
-
designSystem.withPrefix(prefix).register(vividPopup());
|
|
61
|
-
})();
|
|
62
|
-
|
|
63
|
-
export { vividPopup };
|
|
25
|
+
registerPopup();
|
package/progress/index.js
CHANGED
|
@@ -1,93 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { r as registerProgress } from '../shared/definition30.js';
|
|
2
|
+
import '../shared/index.js';
|
|
3
|
+
import '../shared/base-progress.js';
|
|
4
|
+
import '../shared/when.js';
|
|
5
|
+
import '../shared/class-names.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var classof = classofRaw;
|
|
9
|
-
|
|
10
|
-
// `IsArray` abstract operation
|
|
11
|
-
// https://tc39.es/ecma262/#sec-isarray
|
|
12
|
-
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
13
|
-
var isArray$1 = Array.isArray || function isArray(argument) {
|
|
14
|
-
return classof(argument) == 'Array';
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
var $ = _export;
|
|
18
|
-
var uncurryThis = functionUncurryThis;
|
|
19
|
-
var isArray = isArray$1;
|
|
20
|
-
|
|
21
|
-
var nativeReverse = uncurryThis([].reverse);
|
|
22
|
-
var test = [1, 2];
|
|
23
|
-
|
|
24
|
-
// `Array.prototype.reverse` method
|
|
25
|
-
// https://tc39.es/ecma262/#sec-array.prototype.reverse
|
|
26
|
-
// fix for Safari 12.0 bug
|
|
27
|
-
// https://bugs.webkit.org/show_bug.cgi?id=188794
|
|
28
|
-
$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
|
|
29
|
-
reverse: function reverse() {
|
|
30
|
-
// eslint-disable-next-line no-self-assign -- dirty hack
|
|
31
|
-
if (isArray(this)) this.length = this.length;
|
|
32
|
-
return nativeReverse(this);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
class Progress extends BaseProgress {
|
|
37
|
-
constructor() {
|
|
38
|
-
super(...arguments);
|
|
39
|
-
this.reverse = false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
__decorate([attr(), __metadata("design:type", String)], Progress.prototype, "shape", void 0);
|
|
43
|
-
__decorate([attr(), __metadata("design:type", String)], Progress.prototype, "connotation", void 0);
|
|
44
|
-
__decorate([attr({
|
|
45
|
-
mode: 'boolean'
|
|
46
|
-
}), __metadata("design:type", Object)], Progress.prototype, "reverse", void 0);
|
|
47
|
-
|
|
48
|
-
let _2 = t => t,
|
|
49
|
-
_t,
|
|
50
|
-
_t2,
|
|
51
|
-
_t3;
|
|
52
|
-
const getClasses = ({
|
|
53
|
-
connotation,
|
|
54
|
-
shape,
|
|
55
|
-
reverse,
|
|
56
|
-
paused
|
|
57
|
-
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`shape-${shape}`, Boolean(shape)], ['reverse', Boolean(reverse)], ['paused', Boolean(paused)]);
|
|
58
|
-
function determinate() {
|
|
59
|
-
return html(_t || (_t = _2`
|
|
60
|
-
<span class="determinate" style="width: ${0}%"></span>`), x => x.percentComplete);
|
|
61
|
-
}
|
|
62
|
-
function indeterminate() {
|
|
63
|
-
return html(_t2 || (_t2 = _2`
|
|
64
|
-
<span class="indeterminate" name="indeterminate">
|
|
65
|
-
<span class="indicator-1"></span>
|
|
66
|
-
<span class="indicator-2"></span>
|
|
67
|
-
</span>`));
|
|
68
|
-
}
|
|
69
|
-
const ProgressTemplate = _ => {
|
|
70
|
-
return html(_t3 || (_t3 = _2`
|
|
71
|
-
<div
|
|
72
|
-
role="progressbar"
|
|
73
|
-
aria-valuenow="${0}"
|
|
74
|
-
aria-valuemin="${0}"
|
|
75
|
-
aria-valuemax="${0}"
|
|
76
|
-
class="${0}"
|
|
77
|
-
>
|
|
78
|
-
<div class="progress">
|
|
79
|
-
${0}
|
|
80
|
-
${0}
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
`), x => x.value, x => x.min, x => x.max, getClasses, when(x => typeof x.value === 'number', determinate()), when(x => typeof x.value !== 'number', indeterminate()));
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const vividProgress = Progress.compose({
|
|
87
|
-
baseName: 'progress',
|
|
88
|
-
template: ProgressTemplate,
|
|
89
|
-
styles: css_248z
|
|
90
|
-
});
|
|
91
|
-
designSystem.withPrefix(getPrefix(import.meta.url)).register(vividProgress());
|
|
92
|
-
|
|
93
|
-
export { vividProgress };
|
|
7
|
+
registerProgress();
|
package/progress-ring/index.js
CHANGED
|
@@ -1,76 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { r as registerProgressRing } from '../shared/definition31.js';
|
|
2
|
+
import '../shared/index.js';
|
|
3
|
+
import '../shared/base-progress.js';
|
|
4
|
+
import '../shared/when.js';
|
|
5
|
+
import '../shared/class-names.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class ProgressRing extends BaseProgress {}
|
|
9
|
-
__decorate([attr, __metadata("design:type", String)], ProgressRing.prototype, "connotation", void 0);
|
|
10
|
-
__decorate([attr, __metadata("design:type", Number)], ProgressRing.prototype, "size", void 0);
|
|
11
|
-
|
|
12
|
-
let _2 = t => t,
|
|
13
|
-
_t,
|
|
14
|
-
_t2,
|
|
15
|
-
_t3;
|
|
16
|
-
const getClasses = ({
|
|
17
|
-
connotation,
|
|
18
|
-
size,
|
|
19
|
-
paused
|
|
20
|
-
}) => classNames('base', ['disabled', !!paused], [`connotation-${connotation}`, !!connotation], [`size-${size}`, !!size]);
|
|
21
|
-
const progressSegments = 44;
|
|
22
|
-
const ProgressRingTemplate = _ => html(_t || (_t = _2`
|
|
23
|
-
<div
|
|
24
|
-
role="progressbar"
|
|
25
|
-
aria-valuenow="${0}"
|
|
26
|
-
aria-valuemin="${0}"
|
|
27
|
-
aria-valuemax="${0}"
|
|
28
|
-
class="${0} ${0}"
|
|
29
|
-
>
|
|
30
|
-
${0}
|
|
31
|
-
${0}
|
|
32
|
-
</div>
|
|
33
|
-
`), x => x.value, x => x.min, x => x.max, x => x.paused ? 'paused' : '', getClasses, when(x => typeof x.value === 'number', html(_t2 || (_t2 = _2`
|
|
34
|
-
<svg
|
|
35
|
-
class="progress"
|
|
36
|
-
viewBox="0 0 16 16"
|
|
37
|
-
>
|
|
38
|
-
<circle
|
|
39
|
-
class="background"
|
|
40
|
-
cx="8px"
|
|
41
|
-
cy="8px"
|
|
42
|
-
r="7px"
|
|
43
|
-
></circle>
|
|
44
|
-
<circle
|
|
45
|
-
class="determinate"
|
|
46
|
-
style="stroke-dasharray: ${0}px ${0}px"
|
|
47
|
-
cx="8px"
|
|
48
|
-
cy="8px"
|
|
49
|
-
r="7px"
|
|
50
|
-
></circle>
|
|
51
|
-
</svg>
|
|
52
|
-
`), x => progressSegments * x.percentComplete / 100, progressSegments)), when(x => typeof x.value !== 'number', html(_t3 || (_t3 = _2`
|
|
53
|
-
<svg class="progress" viewBox="0 0 16 16">
|
|
54
|
-
<circle
|
|
55
|
-
class="background"
|
|
56
|
-
cx="8px"
|
|
57
|
-
cy="8px"
|
|
58
|
-
r="7px"
|
|
59
|
-
></circle>
|
|
60
|
-
<circle
|
|
61
|
-
class="indeterminate-indicator-1"
|
|
62
|
-
cx="8px"
|
|
63
|
-
cy="8px"
|
|
64
|
-
r="7px"
|
|
65
|
-
></circle>
|
|
66
|
-
</svg>
|
|
67
|
-
`))));
|
|
68
|
-
|
|
69
|
-
const vividProgressRing = ProgressRing.compose({
|
|
70
|
-
baseName: 'progress-ring',
|
|
71
|
-
template: ProgressRingTemplate,
|
|
72
|
-
styles: css_248z
|
|
73
|
-
});
|
|
74
|
-
designSystem.withPrefix(getPrefix(import.meta.url)).register(vividProgressRing());
|
|
75
|
-
|
|
76
|
-
export { vividProgressRing };
|
|
7
|
+
registerProgressRing();
|
package/radio/index.js
CHANGED
|
@@ -1,52 +1,12 @@
|
|
|
1
|
-
import '../shared/
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { w as when } from '../shared/when.js';
|
|
7
|
-
import { c as classNames } from '../shared/class-names.js';
|
|
1
|
+
import { r as registerRadio } from '../shared/definition32.js';
|
|
2
|
+
import '../shared/index.js';
|
|
3
|
+
import '../shared/definition4.js';
|
|
4
|
+
import '../shared/focus.js';
|
|
5
|
+
import '../shared/radio.js';
|
|
8
6
|
import '../shared/form-associated.js';
|
|
9
7
|
import '../shared/key-codes.js';
|
|
10
8
|
import '../shared/focus2.js';
|
|
9
|
+
import '../shared/when.js';
|
|
10
|
+
import '../shared/class-names.js';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let _ = t => t,
|
|
15
|
-
_t,
|
|
16
|
-
_t2;
|
|
17
|
-
const getClasses = ({
|
|
18
|
-
checked,
|
|
19
|
-
readOnly,
|
|
20
|
-
disabled
|
|
21
|
-
}) => classNames('base', ['checked', Boolean(checked)], ['readonly', Boolean(readOnly)], ['disabled', Boolean(disabled)]);
|
|
22
|
-
const RadioTemplate = context => {
|
|
23
|
-
const focusTemplate = focusTemplateFactory(context);
|
|
24
|
-
return html(_t || (_t = _`
|
|
25
|
-
<span class="${0}"
|
|
26
|
-
role="radio"
|
|
27
|
-
aria-checked="${0}"
|
|
28
|
-
aria-required="${0}"
|
|
29
|
-
aria-disabled="${0}"
|
|
30
|
-
@keypress="${0}"
|
|
31
|
-
@click="${0}"
|
|
32
|
-
>
|
|
33
|
-
<div class="control">
|
|
34
|
-
${0}
|
|
35
|
-
</div>
|
|
36
|
-
${0}
|
|
37
|
-
</span>
|
|
38
|
-
`), getClasses, x => x.checked, x => x.required, x => x.disabled, (x, c) => x.keypressHandler(c.event), (x, c) => x.clickHandler(c.event), () => focusTemplate, when(x => x.label, html(_t2 || (_t2 = _`<label class="label">${0}</label>`), x => x.label)));
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const prefix = getPrefix(import.meta.url);
|
|
42
|
-
const vividRadio = Radio.compose({
|
|
43
|
-
baseName: 'radio',
|
|
44
|
-
template: RadioTemplate,
|
|
45
|
-
styles: css_248z
|
|
46
|
-
});
|
|
47
|
-
(async () => {
|
|
48
|
-
await loadComponentsModules(['focus'], prefix);
|
|
49
|
-
designSystem.withPrefix(prefix).register(vividRadio());
|
|
50
|
-
})();
|
|
51
|
-
|
|
52
|
-
export { vividRadio };
|
|
12
|
+
registerRadio();
|