@vonage/vivid 3.0.0-next.42 → 3.0.0-next.45
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 +92 -34
- package/dialog/index.js +24 -22
- package/index.js +3 -2
- package/lib/components.d.ts +3 -2
- package/lib/nav/index.d.ts +2 -0
- package/lib/{sidenav/sidenav.d.ts → nav/nav.d.ts} +1 -1
- package/lib/nav/nav.template.d.ts +4 -0
- package/lib/nav-disclosure/index.d.ts +4 -0
- package/lib/{sidenav-disclosure/sidenav-disclosure.d.ts → nav-disclosure/nav-disclosure.d.ts} +2 -2
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
- package/lib/{sidenav → nav-item}/index.d.ts +3 -1
- package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
- package/lib/{sidenav/sidenav.template.d.ts → nav-item/nav-item.template.d.ts} +2 -2
- package/nav/index.js +17 -0
- package/{sidenav-disclosure → nav-disclosure}/index.js +15 -15
- package/{sidenav-item → nav-item}/index.js +8 -8
- package/package.json +14 -4
- package/popup/index.js +13 -11
- package/progress-ring/index.js +2 -2
- package/lib/sidenav-disclosure/index.d.ts +0 -4
- package/lib/sidenav-disclosure/sidenav-disclosure.template.d.ts +0 -4
- package/lib/sidenav-item/index.d.ts +0 -4
- package/lib/sidenav-item/sidenav-item.template.d.ts +0 -4
- package/sidenav/index.js +0 -17
package/README.md
CHANGED
|
@@ -1,52 +1,110 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
[![Apache 2.0 License][license-shield]][license-url]
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<h6>
|
|
16
|
-
Vonage's design system platform targeted to provide </br>incorporated, battery-charged web components.
|
|
17
|
-
</h6>
|
|
18
|
-
<a class="home-page-hero-docs-btn" href="https://vivid.deno.dev"><strong>Explore the docs</strong></a>
|
|
19
|
-
<div class="home-page-hero-docs-links">
|
|
20
|
-
<a href="https://github.com/Vonage/vivid-3/issues/new?assignees=&labels=&template=bug_report.md&title=">Report Bug</a>
|
|
21
|
-
<span>|</span>
|
|
22
|
-
<a href="https://github.com/Vonage/vivid-3/issues/new?assignees=&labels=&template=feature_request.md&title=">Request Feature</a>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
### Installation
|
|
27
|
-
|
|
28
|
-
run:
|
|
1
|
+
|
|
2
|
+
# Vivid UI
|
|
3
|
+
|
|
4
|
+
Essential UI **web components** for building modern web applications, bound to provide a **safe**, **simple** and **intuitive** interface.
|
|
5
|
+
|
|
6
|
+
<!-- ! TODO add visual - GIF or image reflecting an easy integration of vivid in code and page result -->
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
To integrate Vivid components into your project, run:
|
|
29
12
|
|
|
30
13
|
```bash
|
|
31
|
-
npm install @vonage/vivid
|
|
14
|
+
npm install @vonage/vivid # or yarn add @vonage/vivid
|
|
32
15
|
```
|
|
33
16
|
|
|
34
|
-
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Import components in your project via [side effect imports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#import_a_module_for_its_side_effects_only):
|
|
35
20
|
|
|
36
21
|
```js
|
|
37
22
|
import '@vonage/vivid/button';
|
|
38
23
|
```
|
|
39
24
|
|
|
25
|
+
And include in HTML:
|
|
26
|
+
|
|
40
27
|
```html
|
|
41
28
|
<vwc-button label="Click me"></vwc-button>
|
|
42
29
|
```
|
|
43
30
|
|
|
31
|
+
For a full list of components and API, explore the [components docs](https://vivid.deno.dev/components/accordion/) 📚.
|
|
32
|
+
|
|
33
|
+
### Prerequisites
|
|
34
|
+
|
|
35
|
+
The Vivid components library rely on a set of **core styles** to:
|
|
36
|
+
|
|
37
|
+
- Be present in the DOM
|
|
38
|
+
|
|
39
|
+
- Be shared across all components
|
|
40
|
+
|
|
41
|
+
- Apply common design identities (such as colors, typography, spacing etc')
|
|
42
|
+
|
|
43
|
+
- Ensure the components look as intended.
|
|
44
|
+
|
|
45
|
+
As the task of loading css is not trivial, and may vary from project to project, this library does not provide any way to load the css. It is up to the author to load the css in the most appropriate manner for their project.
|
|
46
|
+
|
|
47
|
+
To **include the styles**, css files must be loaded into the project from the `node_modules/@vonage/vivid/styles` folder.
|
|
48
|
+
|
|
49
|
+
The folder contains the following files:
|
|
50
|
+
|
|
51
|
+
- Fonts
|
|
52
|
+
|
|
53
|
+
- `fonts/spezia.css` - Loads the *Spezia* variable font and specifies its font face definition. *Spezia* is Vonage's branded font and is required by most Vivid components
|
|
54
|
+
|
|
55
|
+
- Themes - only one theme can apply at a time. thus, only one is required to be loaded
|
|
56
|
+
|
|
57
|
+
- `themes/light.css` - Light theme
|
|
58
|
+
|
|
59
|
+
- `themes/dark.css` - Dark theme
|
|
60
|
+
|
|
61
|
+
Note: scss users can simply [forward](https://sass-lang.com/documentation/at-rules/forward) the styles to their scss project:
|
|
62
|
+
|
|
63
|
+
```css
|
|
64
|
+
@forward 'node_modules/@vonage/vivid/styles/fonts/spezia';
|
|
65
|
+
@forward 'node_modules/@vonage/vivid/styles/themes/light';
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Support
|
|
69
|
+
|
|
70
|
+
This library is open source, developed and maintained by the [Vonage Vivid team](Vonage/vivid).
|
|
71
|
+
|
|
72
|
+
For any questions, please open a [bug report](https://github.com/Vonage/vivid-3/issues/new?assignees=&labels=&template=bug_report.md&title=) or [feature request](https://github.com/Vonage/vivid-3/issues/new?assignees=&labels=&template=feature_request.md&title=).
|
|
73
|
+
|
|
44
74
|
## Roadmap
|
|
45
75
|
|
|
46
|
-
[
|
|
76
|
+
- View [components status](https://github.com/orgs/Vonage/projects/6)
|
|
77
|
+
|
|
78
|
+
- [What's on our plate](https://github.com/orgs/Vonage/projects/3/views/7)
|
|
79
|
+
|
|
80
|
+
- See the [open issues](https://github.com/vonage/vivid-3/issues) for a full list of proposed features (and known issues).
|
|
81
|
+
|
|
82
|
+
We publish a *next* release on every successful merge to main, so you never need to wait for a new stable version to make use of any updates.
|
|
83
|
+
|
|
84
|
+
## Contributing
|
|
85
|
+
|
|
86
|
+
Please read [CONTRIBUTING.md](.github/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
|
|
87
|
+
|
|
88
|
+
## Versioning
|
|
89
|
+
|
|
90
|
+
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [npm page](https://www.npmjs.com/package/@vonage/vivid).
|
|
91
|
+
|
|
92
|
+
## Authors
|
|
93
|
+
|
|
94
|
+
See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project.
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
This project is licensed under the Apache 2.0 License - see the [LICENSE.md](LICENSE.md) file for details
|
|
99
|
+
|
|
100
|
+
<!-- ## Acknowledgments
|
|
47
101
|
|
|
48
|
-
|
|
102
|
+
- Hat tip to anyone whose code was used
|
|
103
|
+
- Inspiration
|
|
104
|
+
- etc -->
|
|
49
105
|
|
|
50
|
-
|
|
106
|
+
## Built With
|
|
51
107
|
|
|
52
|
-
|
|
108
|
+
- [Fast](https://www.fast.design) - to extend element classes and compile code to native web components
|
|
109
|
+
- [Typescript](https://www.typescriptlang.org) - for ergonomic and type-safe code
|
|
110
|
+
- [Sass](https://sass-lang.com) - for styles authoring extensibility and consistency
|
package/dialog/index.js
CHANGED
|
@@ -243,31 +243,33 @@ function content() {
|
|
|
243
243
|
|
|
244
244
|
const DialogTemplate = () => html(_t5 || (_t5 = _2`
|
|
245
245
|
<vwc-elevation dp="12">
|
|
246
|
-
<
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
<
|
|
255
|
-
<div class="
|
|
256
|
-
<div class="
|
|
257
|
-
<
|
|
246
|
+
<div>
|
|
247
|
+
<dialog class="${0}"
|
|
248
|
+
@keydown="${0}"
|
|
249
|
+
returnValue="${0}"
|
|
250
|
+
aria-labelledby="${0}"
|
|
251
|
+
aria-label="${0}"
|
|
252
|
+
aria-describedby="${0}"
|
|
253
|
+
>
|
|
254
|
+
<slot name="main">
|
|
255
|
+
<div class="main-wrapper">
|
|
256
|
+
<div class="header">
|
|
257
|
+
<div class="headline-wrapper">
|
|
258
|
+
<slot name="graphic">
|
|
259
|
+
${0}
|
|
260
|
+
</slot>
|
|
258
261
|
${0}
|
|
259
|
-
</
|
|
260
|
-
|
|
262
|
+
</div>
|
|
263
|
+
${0}
|
|
261
264
|
</div>
|
|
262
|
-
|
|
265
|
+
<slot name="content">
|
|
266
|
+
${0}
|
|
267
|
+
</slot>
|
|
268
|
+
<slot name="footer"></slot>
|
|
263
269
|
</div>
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
<slot name="footer"></slot>
|
|
268
|
-
</div>
|
|
269
|
-
</slot>
|
|
270
|
-
</dialog>
|
|
270
|
+
</slot>
|
|
271
|
+
</dialog>
|
|
272
|
+
</div>
|
|
271
273
|
</vwc-elevation>`), getClasses, (x, c) => handleEscapeKey(x, c.event), x => x.returnValue, x => x.ariaLabelledBy, x => x.ariaLabel, x => x.ariaDescribedBy, when(x => x.icon, icon()), when(x => x.headline, headline()), renderDismissButton(), when(x => x.text, content()));
|
|
272
274
|
|
|
273
275
|
const vividDialog = Dialog.compose({
|
package/index.js
CHANGED
|
@@ -18,8 +18,9 @@ export { vividPopup } from './popup/index.js';
|
|
|
18
18
|
export { vividProgress } from './progress/index.js';
|
|
19
19
|
export { vividProgressRing } from './progress-ring/index.js';
|
|
20
20
|
export { vividSideDrawer } from './side-drawer/index.js';
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
21
|
+
export { vividNav } from './nav/index.js';
|
|
22
|
+
export { vividNavItem } from './nav-item/index.js';
|
|
23
|
+
export { vividNavDisclosure } from './nav-disclosure/index.js';
|
|
23
24
|
export { vividText } from './text/index.js';
|
|
24
25
|
export { vividTextfield } from './text-field/index.js';
|
|
25
26
|
export { vividTooltip } from './tooltip/index.js';
|
package/lib/components.d.ts
CHANGED
|
@@ -18,8 +18,9 @@ export * from './popup';
|
|
|
18
18
|
export * from './progress';
|
|
19
19
|
export * from './progress-ring';
|
|
20
20
|
export * from './side-drawer';
|
|
21
|
-
export * from './
|
|
22
|
-
export * from './
|
|
21
|
+
export * from './nav';
|
|
22
|
+
export * from './nav-item';
|
|
23
|
+
export * from './nav-disclosure';
|
|
23
24
|
export * from './text';
|
|
24
25
|
export * from './text-field';
|
|
25
26
|
export * from './tooltip';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
2
|
+
export declare const vividNav: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<FoundationElementDefinition, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
2
|
+
import type { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
3
|
+
import type { Nav } from './nav';
|
|
4
|
+
export declare const NavTemplate: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ViewTemplate<Nav>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import '../icon';
|
|
2
|
+
import '../focus';
|
|
3
|
+
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
4
|
+
export declare const vividNavDisclosure: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<FoundationElementDefinition, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
package/lib/{sidenav-disclosure/sidenav-disclosure.d.ts → nav-disclosure/nav-disclosure.d.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
2
|
import { AffixIcon } from '../../shared/patterns/affix';
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class NavDisclosure extends FoundationElement {
|
|
4
4
|
#private;
|
|
5
5
|
details: HTMLDetailsElement;
|
|
6
6
|
label?: string;
|
|
7
7
|
open: boolean;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface NavDisclosure extends AffixIcon {
|
|
10
10
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
2
|
+
import type { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
3
|
+
import type { NavDisclosure } from './nav-disclosure';
|
|
4
|
+
export declare const NavDisclosureTemplate: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ViewTemplate<NavDisclosure>;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import '../icon';
|
|
2
|
+
import '../focus';
|
|
1
3
|
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
2
|
-
export declare const
|
|
4
|
+
export declare const vividNavItem: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<FoundationElementDefinition, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AffixIcon } from '../../shared/patterns/affix';
|
|
2
2
|
import { TextAnchor } from '../text-anchor/text-anchor';
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class NavItem extends TextAnchor {
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
5
|
+
export interface NavItem extends AffixIcon {
|
|
6
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
2
2
|
import type { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
3
|
-
import type {
|
|
4
|
-
export declare const
|
|
3
|
+
import type { NavItem } from './nav-item';
|
|
4
|
+
export declare const NavItemTemplate: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ViewTemplate<NavItem>;
|
package/nav/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { F as FoundationElement, h as html, d as designSystem } from '../shared/index.js';
|
|
2
|
+
|
|
3
|
+
class Nav extends FoundationElement {}
|
|
4
|
+
|
|
5
|
+
let _ = t => t,
|
|
6
|
+
_t;
|
|
7
|
+
const NavTemplate = () => html(_t || (_t = _`
|
|
8
|
+
<nav><slot></slot></nav>
|
|
9
|
+
`));
|
|
10
|
+
|
|
11
|
+
const vividNav = Nav.compose({
|
|
12
|
+
baseName: 'nav',
|
|
13
|
+
template: NavTemplate
|
|
14
|
+
});
|
|
15
|
+
designSystem.register(vividNav());
|
|
16
|
+
|
|
17
|
+
export { vividNav };
|
|
@@ -20,13 +20,13 @@ import '../shared/object-keys.js';
|
|
|
20
20
|
var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 GMT\n*/\n.control {\n font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n position: relative;\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 cursor: pointer;\n gap: 8px;\n -webkit-hyphens: auto;\n hyphens: auto;\n inline-size: 100%;\n min-block-size: 40px;\n padding-inline: 8px;\n text-decoration: none;\n vertical-align: middle;\n word-break: break-word;\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transaprent;\n}\n.control: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: transaprent;\n}\n.control:where(.selected, [aria-current]):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transaprent;\n}\n.control {\n --_connotation-color-primary: var(--vvd-color-on-canvas);\n --_connotation-color-faint: var(--vvd-color-neutral-10);\n --_connotation-color-soft: var(--vvd-color-neutral-20);\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n@supports ((-webkit-user-select: none) or (user-select: none)) {\n .control {\n -webkit-user-select: none;\n user-select: none;\n }\n}\n.control .toggleIcon {\n margin-inline-start: auto;\n}\n\n.control:not(:focus-visible) .focus-indicator {\n display: none;\n}\n\n.icon {\n font-size: 20px;\n}\n\n.content {\n border-inline-start: 1px solid var(--vvd-color-neutral-30);\n margin-inline-start: 20px;\n padding-inline-start: 12px;\n}\n\ndetails > summary {\n list-style: none;\n}\n\ndetails > summary::-webkit-details-marker {\n display: none;\n}";
|
|
21
21
|
styleInject(css_248z);
|
|
22
22
|
|
|
23
|
-
var
|
|
24
|
-
class
|
|
23
|
+
var _NavDisclosure_onToggle;
|
|
24
|
+
class NavDisclosure extends FoundationElement {
|
|
25
25
|
constructor() {
|
|
26
26
|
super(...arguments);
|
|
27
27
|
this.open = false;
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
_NavDisclosure_onToggle.set(this, () => {
|
|
30
30
|
this.open = this.details.open;
|
|
31
31
|
this.$emit('toggle');
|
|
32
32
|
});
|
|
@@ -34,31 +34,31 @@ class SidenavDisclosure extends FoundationElement {
|
|
|
34
34
|
|
|
35
35
|
connectedCallback() {
|
|
36
36
|
super.connectedCallback();
|
|
37
|
-
this.details.addEventListener('toggle', __classPrivateFieldGet(this,
|
|
37
|
+
this.details.addEventListener('toggle', __classPrivateFieldGet(this, _NavDisclosure_onToggle, "f"));
|
|
38
38
|
this.details.open = this.open;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
disconnectedCallback() {
|
|
42
42
|
super.disconnectedCallback();
|
|
43
|
-
this.details.removeEventListener('toggle', __classPrivateFieldGet(this,
|
|
43
|
+
this.details.removeEventListener('toggle', __classPrivateFieldGet(this, _NavDisclosure_onToggle, "f"));
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
_NavDisclosure_onToggle = new WeakMap();
|
|
48
48
|
|
|
49
|
-
__decorate([attr, __metadata("design:type", String)],
|
|
49
|
+
__decorate([attr, __metadata("design:type", String)], NavDisclosure.prototype, "label", void 0);
|
|
50
50
|
|
|
51
51
|
__decorate([attr({
|
|
52
52
|
mode: 'boolean'
|
|
53
|
-
}), __metadata("design:type", Object)],
|
|
53
|
+
}), __metadata("design:type", Object)], NavDisclosure.prototype, "open", void 0);
|
|
54
54
|
|
|
55
|
-
applyMixins(
|
|
55
|
+
applyMixins(NavDisclosure, AffixIcon);
|
|
56
56
|
|
|
57
57
|
let _ = t => t,
|
|
58
58
|
_t,
|
|
59
59
|
_t2,
|
|
60
60
|
_t3;
|
|
61
|
-
const
|
|
61
|
+
const NavDisclosureTemplate = context => {
|
|
62
62
|
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
63
63
|
const focusTemplate = focusTemplateFactory(context);
|
|
64
64
|
return html(_t || (_t = _`<details class="base" ${0} ?open=${0}>
|
|
@@ -80,11 +80,11 @@ const SidenavDisclosureTemplate = context => {
|
|
|
80
80
|
`), ref('details'), x => x.open, x => x.open, x => affixIconTemplate(x.icon), x => x.label, when(x => x.open, html(_t2 || (_t2 = _`<vwc-icon class="toggleIcon" type='chevron-up-solid'></vwc-icon>`))), when(x => !x.open, html(_t3 || (_t3 = _`<vwc-icon class="toggleIcon" type='chevron-down-solid'></vwc-icon>`))), () => focusTemplate);
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
const
|
|
84
|
-
baseName: '
|
|
85
|
-
template:
|
|
83
|
+
const vividNavDisclosure = NavDisclosure.compose({
|
|
84
|
+
baseName: 'nav-disclosure',
|
|
85
|
+
template: NavDisclosureTemplate,
|
|
86
86
|
styles: css_248z
|
|
87
87
|
});
|
|
88
|
-
designSystem.register(
|
|
88
|
+
designSystem.register(vividNavDisclosure());
|
|
89
89
|
|
|
90
|
-
export {
|
|
90
|
+
export { vividNavDisclosure };
|
|
@@ -24,20 +24,20 @@ import '../shared/focus2.js';
|
|
|
24
24
|
var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 GMT\n*/\n.control {\n font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n position: relative;\n display: inline-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 gap: 8px;\n -webkit-hyphens: auto;\n hyphens: auto;\n inline-size: 100%;\n min-block-size: 40px;\n padding-block: 10px;\n padding-inline: 8px;\n text-decoration: none;\n vertical-align: middle;\n word-break: break-word;\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transaprent;\n}\n.control: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: transaprent;\n}\n.control:where(.selected, [aria-current]):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transaprent;\n}\n.control {\n --_connotation-color-primary: var(--vvd-color-on-canvas);\n --_connotation-color-faint: var(--vvd-color-neutral-10);\n --_connotation-color-soft: var(--vvd-color-neutral-20);\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n.control.icon-only {\n display: flex;\n block-size: 40px;\n inline-size: 40px;\n place-content: center;\n}\n\n.control:not(:focus-visible) .focus-indicator {\n display: none;\n}\n\n.icon {\n font-size: 20px;\n}";
|
|
25
25
|
styleInject(css_248z);
|
|
26
26
|
|
|
27
|
-
class
|
|
28
|
-
applyMixins(
|
|
27
|
+
class NavItem extends TextAnchor {}
|
|
28
|
+
applyMixins(NavItem, AffixIcon);
|
|
29
29
|
|
|
30
30
|
let _ = t => t,
|
|
31
31
|
_t;
|
|
32
|
-
const
|
|
32
|
+
const NavItemTemplate = (context, definition) => html(_t || (_t = _`
|
|
33
33
|
${0}
|
|
34
34
|
`), textAnchorTemplate(context));
|
|
35
35
|
|
|
36
|
-
const
|
|
37
|
-
baseName: '
|
|
38
|
-
template:
|
|
36
|
+
const vividNavItem = NavItem.compose({
|
|
37
|
+
baseName: 'nav-item',
|
|
38
|
+
template: NavItemTemplate,
|
|
39
39
|
styles: css_248z
|
|
40
40
|
});
|
|
41
|
-
designSystem.register(
|
|
41
|
+
designSystem.register(vividNavItem());
|
|
42
42
|
|
|
43
|
-
export {
|
|
43
|
+
export { vividNavItem };
|
package/package.json
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonage/vivid",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.45",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "./index.esm.js",
|
|
6
6
|
"main": "./index.js",
|
|
7
|
+
"homepage": "https://vivid.deno.dev",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/vonage/vivid-3",
|
|
11
|
+
"directory": "libs/components"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Vonage/vivid-3/issues"
|
|
15
|
+
},
|
|
16
|
+
"license": "Apache-2.0",
|
|
7
17
|
"exports": {
|
|
8
18
|
"./accordion": "./accordion",
|
|
9
19
|
"./accordion-item": "./accordion-item",
|
|
@@ -25,9 +35,9 @@
|
|
|
25
35
|
"./progress": "./progress",
|
|
26
36
|
"./progress-ring": "./progress-ring",
|
|
27
37
|
"./side-drawer": "./side-drawer",
|
|
28
|
-
"./
|
|
29
|
-
"./
|
|
30
|
-
"./
|
|
38
|
+
"./nav": "./nav",
|
|
39
|
+
"./nav-item": "./nav-item",
|
|
40
|
+
"./nav-disclosure": "./nav-disclosure",
|
|
31
41
|
"./text": "./text",
|
|
32
42
|
"./text-field": "./text-field",
|
|
33
43
|
"./tooltip": "./tooltip",
|
package/popup/index.js
CHANGED
|
@@ -1944,27 +1944,35 @@ class Popup extends FoundationElement {
|
|
|
1944
1944
|
this.arrow = false;
|
|
1945
1945
|
this.alternate = false;
|
|
1946
1946
|
this.placement = 'left';
|
|
1947
|
+
|
|
1948
|
+
_Popup_handleKeydown.set(this, event => {
|
|
1949
|
+
if (event.key === keyEscape) {
|
|
1950
|
+
this.open = false;
|
|
1951
|
+
}
|
|
1952
|
+
});
|
|
1947
1953
|
}
|
|
1948
1954
|
|
|
1949
1955
|
disconnectedCallback() {
|
|
1950
1956
|
var _a, _b;
|
|
1951
1957
|
|
|
1952
1958
|
super.disconnectedCallback();
|
|
1953
|
-
(_a = __classPrivateFieldGet(this, _Popup_anchorEl, "f")) === null || _a === void 0 ? void 0 : _a.removeEventListener('keydown',
|
|
1959
|
+
(_a = __classPrivateFieldGet(this, _Popup_anchorEl, "f")) === null || _a === void 0 ? void 0 : _a.removeEventListener('keydown', __classPrivateFieldGet(this, _Popup_handleKeydown, "f"));
|
|
1954
1960
|
(_b = __classPrivateFieldGet(this, _Popup_cleanup, "f")) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
1955
1961
|
}
|
|
1956
1962
|
|
|
1957
1963
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
1958
|
-
var _a, _b;
|
|
1964
|
+
var _a, _b, _c;
|
|
1959
1965
|
|
|
1960
1966
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
1961
1967
|
|
|
1962
1968
|
switch (name) {
|
|
1963
1969
|
case 'anchor':
|
|
1964
1970
|
{
|
|
1971
|
+
(_a = __classPrivateFieldGet(this, _Popup_anchorEl, "f")) === null || _a === void 0 ? void 0 : _a.removeEventListener('keydown', __classPrivateFieldGet(this, _Popup_handleKeydown, "f"));
|
|
1972
|
+
|
|
1965
1973
|
__classPrivateFieldSet(this, _Popup_anchorEl, __classPrivateFieldGet(this, _Popup_instances, "m", _Popup_getAnchorById).call(this), "f");
|
|
1966
1974
|
|
|
1967
|
-
(
|
|
1975
|
+
(_b = __classPrivateFieldGet(this, _Popup_anchorEl, "f")) === null || _b === void 0 ? void 0 : _b.addEventListener('keydown', __classPrivateFieldGet(this, _Popup_handleKeydown, "f"));
|
|
1968
1976
|
break;
|
|
1969
1977
|
}
|
|
1970
1978
|
}
|
|
@@ -1972,7 +1980,7 @@ class Popup extends FoundationElement {
|
|
|
1972
1980
|
if (__classPrivateFieldGet(this, _Popup_anchorEl, "f") && this.popupEl) {
|
|
1973
1981
|
__classPrivateFieldSet(this, _Popup_cleanup, autoUpdate(__classPrivateFieldGet(this, _Popup_anchorEl, "f"), this.popupEl, () => this.updatePosition()), "f");
|
|
1974
1982
|
} else {
|
|
1975
|
-
(
|
|
1983
|
+
(_c = __classPrivateFieldGet(this, _Popup_cleanup, "f")) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
1976
1984
|
}
|
|
1977
1985
|
}
|
|
1978
1986
|
|
|
@@ -1995,7 +2003,7 @@ class Popup extends FoundationElement {
|
|
|
1995
2003
|
}
|
|
1996
2004
|
|
|
1997
2005
|
}
|
|
1998
|
-
_Popup_cleanup = new WeakMap(), _Popup_anchorEl = new WeakMap(), _Popup_instances = new WeakSet(), _Popup_arrowPosition_get = function _Popup_arrowPosition_get() {
|
|
2006
|
+
_Popup_cleanup = new WeakMap(), _Popup_anchorEl = new WeakMap(), _Popup_handleKeydown = new WeakMap(), _Popup_instances = new WeakSet(), _Popup_arrowPosition_get = function _Popup_arrowPosition_get() {
|
|
1999
2007
|
return {
|
|
2000
2008
|
top: 'bottom',
|
|
2001
2009
|
right: 'left',
|
|
@@ -2049,12 +2057,6 @@ _Popup_cleanup = new WeakMap(), _Popup_anchorEl = new WeakMap(), _Popup_instance
|
|
|
2049
2057
|
});
|
|
2050
2058
|
}, _Popup_getAnchorById = function _Popup_getAnchorById() {
|
|
2051
2059
|
return document.getElementById(this.anchor);
|
|
2052
|
-
}, _Popup_handleKeydown = function _Popup_handleKeydown({
|
|
2053
|
-
key
|
|
2054
|
-
}) {
|
|
2055
|
-
if (key === keyEscape) {
|
|
2056
|
-
this.open = false;
|
|
2057
|
-
}
|
|
2058
2060
|
};
|
|
2059
2061
|
|
|
2060
2062
|
__decorate([attr({
|
package/progress-ring/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { B as BaseProgress } from '../shared/base-progress.js';
|
|
|
4
4
|
import { w as when } from '../shared/when.js';
|
|
5
5
|
import { c as classNames } from '../shared/class-names.js';
|
|
6
6
|
|
|
7
|
-
var css_248z = ".base {\n align-items: center;\n block-size: var(--_density);\n color: var(--_appearance-color-text);\n inline-size: var(--_density);\n outline: none;\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert);\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success);\n}\n.base:not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary: var(--vvd-color-on-canvas);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-50);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base.density-
|
|
7
|
+
var css_248z = ".base {\n align-items: center;\n block-size: var(--_density);\n color: var(--_appearance-color-text);\n inline-size: var(--_density);\n outline: none;\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert);\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success);\n}\n.base:not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary: var(--vvd-color-on-canvas);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-50);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base.density-5 {\n --_density: calc(5 * 4px);\n}\n.base.density-6 {\n --_density: calc(6 * 4px);\n}\n.base.density-7 {\n --_density: calc(7 * 4px);\n}\n.base.density-8 {\n --_density: calc(8 * 4px);\n}\n.base.density-9 {\n --_density: calc(9 * 4px);\n}\n.base.density-11 {\n --_density: calc(11 * 4px);\n}\n.base.density-12 {\n --_density: calc(12 * 4px);\n}\n.base.density-13 {\n --_density: calc(13 * 4px);\n}\n.base:not(.density-5, .density-6, .density-7, .density-8, .density-9, .density-11, .density-12, .density-13) {\n --_density: calc(10 * 4px);\n}\n\n.progress {\n width: 100%;\n height: 100%;\n}\n\n.background {\n fill: none;\n stroke: transparent;\n stroke-width: 2px;\n}\n\n.determinate {\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 2px;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n transition: all 0.2s ease-in-out;\n}\n\n.indeterminate-indicator-1 {\n animation: spin-infinite 2s linear infinite;\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 2px;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n transition: all 0.2s ease-in-out;\n}\n\n.base.paused .indeterminate-indicator-1 {\n animation-play-state: paused;\n}\n\n@keyframes spin-infinite {\n 0% {\n stroke-dasharray: 0.01px 43.97px;\n transform: rotate(0deg);\n }\n 50% {\n stroke-dasharray: 21.99px 21.99px;\n transform: rotate(450deg);\n }\n 100% {\n stroke-dasharray: 0.01px 43.97px;\n transform: rotate(1080deg);\n }\n}";
|
|
8
8
|
styleInject(css_248z);
|
|
9
9
|
|
|
10
10
|
class ProgressRing extends BaseProgress {}
|
|
@@ -22,7 +22,7 @@ const getClasses = ({
|
|
|
22
22
|
connotation,
|
|
23
23
|
density,
|
|
24
24
|
paused
|
|
25
|
-
}) => classNames('base', ['disabled', !!paused], [`connotation-${connotation}`, !!connotation], [`density-${(density ? Number(density) : 0) +
|
|
25
|
+
}) => classNames('base', ['disabled', !!paused], [`connotation-${connotation}`, !!connotation], [`density-${(density ? Number(density) : 0) + 10}`, !!density]);
|
|
26
26
|
|
|
27
27
|
const progressSegments = 44;
|
|
28
28
|
const ProgressRingTemplate = _ => html(_t || (_t = _2`
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import '../icon';
|
|
2
|
-
import '../focus';
|
|
3
|
-
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
4
|
-
export declare const vividSidenavDisclosure: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<FoundationElementDefinition, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
2
|
-
import type { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
3
|
-
import type { SidenavDisclosure } from './sidenav-disclosure';
|
|
4
|
-
export declare const SidenavDisclosureTemplate: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ViewTemplate<SidenavDisclosure>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import '../icon';
|
|
2
|
-
import '../focus';
|
|
3
|
-
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
4
|
-
export declare const vividSidenavItem: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<FoundationElementDefinition, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
2
|
-
import type { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
3
|
-
import type { SidenavItem } from './sidenav-item';
|
|
4
|
-
export declare const SidenavItemTemplate: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ViewTemplate<SidenavItem>;
|
package/sidenav/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { F as FoundationElement, h as html, d as designSystem } from '../shared/index.js';
|
|
2
|
-
|
|
3
|
-
class Sidenav extends FoundationElement {}
|
|
4
|
-
|
|
5
|
-
let _ = t => t,
|
|
6
|
-
_t;
|
|
7
|
-
const SidenavTemplate = () => html(_t || (_t = _`
|
|
8
|
-
<nav><slot></slot></nav>
|
|
9
|
-
`));
|
|
10
|
-
|
|
11
|
-
const vividSidenav = Sidenav.compose({
|
|
12
|
-
baseName: 'sidenav',
|
|
13
|
-
template: SidenavTemplate
|
|
14
|
-
});
|
|
15
|
-
designSystem.register(vividSidenav());
|
|
16
|
-
|
|
17
|
-
export { vividSidenav };
|