@maggioli-design-system/mds-accordion-timer-item 1.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/cjs/index-2ee34dd7.js +1180 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/mds-accordion-timer-item.cjs.entry.js +100 -0
- package/dist/cjs/mds-accordion-timer-item.cjs.js +19 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/mds-accordion-timer-item/mds-accordion-timer-item.css +109 -0
- package/dist/collection/components/mds-accordion-timer-item/mds-accordion-timer-item.js +206 -0
- package/dist/collection/components/mds-accordion-timer-item/test/mds-accordion-timer-item.stories.js +49 -0
- package/dist/collection/dictionary/autocomplete.js +59 -0
- package/dist/collection/dictionary/button.js +26 -0
- package/dist/collection/dictionary/color.js +19 -0
- package/dist/collection/dictionary/icon.js +3 -0
- package/dist/collection/dictionary/input-text-type.js +13 -0
- package/dist/collection/dictionary/loading.js +5 -0
- package/dist/collection/dictionary/typography.js +37 -0
- package/dist/collection/dictionary/variant.js +64 -0
- package/dist/collection/fixtures/cities.js +110 -0
- package/dist/collection/interface/input-value.js +1 -0
- package/dist/collection/types/autocomplete.js +1 -0
- package/dist/collection/types/button.js +1 -0
- package/dist/collection/types/form-rel.js +1 -0
- package/dist/collection/types/input-text-type.js +1 -0
- package/dist/collection/types/input-value-type.js +1 -0
- package/dist/collection/types/loading.js +1 -0
- package/dist/collection/types/typography.js +1 -0
- package/dist/collection/types/variant.js +1 -0
- package/dist/custom-elements/index.d.ts +45 -0
- package/dist/custom-elements/index.js +112 -0
- package/dist/esm/index-4339770f.js +1153 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/mds-accordion-timer-item.entry.js +96 -0
- package/dist/esm/mds-accordion-timer-item.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm-es5/index-4339770f.js +1 -0
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/loader.js +1 -0
- package/dist/esm-es5/mds-accordion-timer-item.entry.js +1 -0
- package/dist/esm-es5/mds-accordion-timer-item.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/mds-accordion-timer-item/index.esm.js +0 -0
- package/dist/mds-accordion-timer-item/mds-accordion-timer-item.esm.js +1 -0
- package/dist/mds-accordion-timer-item/mds-accordion-timer-item.js +130 -0
- package/dist/mds-accordion-timer-item/p-08901cb1.entry.js +1 -0
- package/dist/mds-accordion-timer-item/p-50ea2036.system.js +1 -0
- package/dist/mds-accordion-timer-item/p-7e30d5f8.js +1 -0
- package/dist/mds-accordion-timer-item/p-9b9f6cb9.system.js +1 -0
- package/dist/mds-accordion-timer-item/p-c7b8cf9d.system.js +1 -0
- package/dist/mds-accordion-timer-item/p-d8623772.system.entry.js +1 -0
- package/dist/stats.json +705 -0
- package/dist/types/components/mds-accordion-timer-item/mds-accordion-timer-item.d.ts +43 -0
- package/dist/types/components.d.ts +90 -0
- package/dist/types/dictionary/autocomplete.d.ts +2 -0
- package/dist/types/dictionary/button.d.ts +5 -0
- package/dist/types/dictionary/color.d.ts +3 -0
- package/dist/types/dictionary/icon.d.ts +2 -0
- package/dist/types/dictionary/input-text-type.d.ts +2 -0
- package/dist/types/dictionary/loading.d.ts +2 -0
- package/dist/types/dictionary/typography.d.ts +5 -0
- package/dist/types/dictionary/variant.d.ts +9 -0
- package/dist/types/fixtures/cities.d.ts +2 -0
- package/dist/types/interface/input-value.d.ts +4 -0
- package/dist/types/stencil-public-runtime.d.ts +1563 -0
- package/dist/types/types/autocomplete.d.ts +2 -0
- package/dist/types/types/button.d.ts +4 -0
- package/dist/types/types/form-rel.d.ts +1 -0
- package/dist/types/types/input-text-type.d.ts +1 -0
- package/dist/types/types/input-value-type.d.ts +1 -0
- package/dist/types/types/loading.d.ts +1 -0
- package/dist/types/types/typography.d.ts +4 -0
- package/dist/types/types/variant.d.ts +10 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +47 -0
- package/readme.md +54 -0
- package/src/components/mds-accordion-timer-item/mds-accordion-timer-item.css +69 -0
- package/src/components/mds-accordion-timer-item/mds-accordion-timer-item.tsx +99 -0
- package/src/components/mds-accordion-timer-item/readme.md +39 -0
- package/src/components/mds-accordion-timer-item/test/mds-accordion-timer-item.e2e.ts +11 -0
- package/src/components/mds-accordion-timer-item/test/mds-accordion-timer-item.spec.tsx +18 -0
- package/src/components/mds-accordion-timer-item/test/mds-accordion-timer-item.stories.js +49 -0
- package/src/components.d.ts +90 -0
- package/src/dictionary/autocomplete.ts +62 -0
- package/src/dictionary/button.ts +35 -0
- package/src/dictionary/color.ts +24 -0
- package/src/dictionary/icon.ts +5 -0
- package/src/dictionary/input-text-type.ts +17 -0
- package/src/dictionary/loading.ts +9 -0
- package/src/dictionary/typography.ts +46 -0
- package/src/dictionary/variant.ts +81 -0
- package/src/fixtures/cities.ts +116 -0
- package/src/interface/input-value.ts +5 -0
- package/src/types/autocomplete.ts +69 -0
- package/src/types/button.ts +24 -0
- package/src/types/form-rel.ts +11 -0
- package/src/types/input-text-type.ts +11 -0
- package/src/types/input-value-type.ts +5 -0
- package/src/types/loading.ts +3 -0
- package/src/types/typography.ts +35 -0
- package/src/types/variant.ts +72 -0
- package/www/build/index.esm.js +0 -0
- package/www/build/mds-accordion-timer-item.esm.js +1 -0
- package/www/build/mds-accordion-timer-item.js +130 -0
- package/www/build/p-08901cb1.entry.js +1 -0
- package/www/build/p-50ea2036.system.js +1 -0
- package/www/build/p-7e30d5f8.js +1 -0
- package/www/build/p-9b9f6cb9.system.js +1 -0
- package/www/build/p-c7b8cf9d.system.js +1 -0
- package/www/build/p-d8623772.system.entry.js +1 -0
- package/www/host.config.json +15 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-2ee34dd7.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Esm v2.10.0 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchEsm = () => {
|
|
11
|
+
return index.promiseResolve();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const defineCustomElements = (win, options) => {
|
|
15
|
+
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
+
return patchEsm().then(() => {
|
|
17
|
+
return index.bootstrapLazy([["mds-accordion-timer-item.cjs",[[1,"mds-accordion-timer-item",{"typography":[1],"active":[516],"description":[1],"progress":[2],"uuid":[2],"isActive":[32]}]]]], options);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-2ee34dd7.js');
|
|
6
|
+
|
|
7
|
+
function toVal(mix) {
|
|
8
|
+
var k, y, str='';
|
|
9
|
+
|
|
10
|
+
if (typeof mix === 'string' || typeof mix === 'number') {
|
|
11
|
+
str += mix;
|
|
12
|
+
} else if (typeof mix === 'object') {
|
|
13
|
+
if (Array.isArray(mix)) {
|
|
14
|
+
for (k=0; k < mix.length; k++) {
|
|
15
|
+
if (mix[k]) {
|
|
16
|
+
if (y = toVal(mix[k])) {
|
|
17
|
+
str && (str += ' ');
|
|
18
|
+
str += y;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
} else {
|
|
23
|
+
for (k in mix) {
|
|
24
|
+
if (mix[k]) {
|
|
25
|
+
str && (str += ' ');
|
|
26
|
+
str += k;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return str;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function clsx () {
|
|
36
|
+
var i=0, tmp, x, str='';
|
|
37
|
+
while (i < arguments.length) {
|
|
38
|
+
if (tmp = arguments[i++]) {
|
|
39
|
+
if (x = toVal(tmp)) {
|
|
40
|
+
str && (str += ' ');
|
|
41
|
+
str += x;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return str;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const mdsAccordionTimerItemCss = ".contents{display:contents}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{position:relative;display:grid;padding-top:1rem;padding-bottom:1rem;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);color:var(--color, rgb(var(--adjust-tone-02)))}:host(:hover:not(.active)) .progress-bar{--background-active:rgb(var(--adjust-tone-07))}.row{display:-ms-flexbox;display:flex;gap:1rem}.accordion{display:grid}.progress-bar{-ms-flex-negative:0;flex-shrink:0;--thickness:0.25rem}.header{cursor:pointer}:host(.active) .header{cursor:auto}.contents{display:grid;height:0px;gap:1rem;overflow:hidden;padding-top:0px;opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.25, 0.46, 0.45, 0.94);transition-timing-function:cubic-bezier(0.25, 0.46, 0.45, 0.94)}.contents--opened{height:auto;padding-top:1rem;opacity:1}";
|
|
49
|
+
|
|
50
|
+
let MdsAccordionTimerItem = class {
|
|
51
|
+
constructor(hostRef) {
|
|
52
|
+
index.registerInstance(this, hostRef);
|
|
53
|
+
this.clickActive = index.createEvent(this, "clickActive", 7);
|
|
54
|
+
this.mouseEnterActive = index.createEvent(this, "mouseEnterActive", 7);
|
|
55
|
+
this.mouseLeaveActive = index.createEvent(this, "mouseLeaveActive", 7);
|
|
56
|
+
/**
|
|
57
|
+
* Specifies the typography of the element
|
|
58
|
+
*/
|
|
59
|
+
this.typography = 'h5';
|
|
60
|
+
/**
|
|
61
|
+
* A value between 0 and 100 that rapresents the status progress
|
|
62
|
+
*/
|
|
63
|
+
this.progress = 0;
|
|
64
|
+
/**
|
|
65
|
+
* Used automatically by MdsAccordionTimer wrapper to handle it's siblings
|
|
66
|
+
*/
|
|
67
|
+
this.uuid = 0;
|
|
68
|
+
this.toggle = () => {
|
|
69
|
+
if (!this.isActive) {
|
|
70
|
+
this.isActive = true;
|
|
71
|
+
this.clickActive.emit(this.description);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
this.mouseEnter = () => {
|
|
75
|
+
if (this.isActive) {
|
|
76
|
+
this.mouseEnterActive.emit(this.description);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
this.mouseLeave = () => {
|
|
80
|
+
if (this.isActive) {
|
|
81
|
+
this.mouseLeaveActive.emit(this.description);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
componentWillLoad() {
|
|
86
|
+
this.isActive = this.active;
|
|
87
|
+
}
|
|
88
|
+
validateOpened(newValue) {
|
|
89
|
+
this.isActive = newValue;
|
|
90
|
+
}
|
|
91
|
+
render() {
|
|
92
|
+
return (index.h(index.Host, { class: clsx(this.isActive && 'active'), onMouseEnter: this.mouseEnter, onMouseLeave: this.mouseLeave }, index.h("div", { class: "row" }, index.h("mds-progress", { class: "progress-bar", progress: this.progress, direction: "vertical" }), index.h("div", { class: "accordion" }, index.h("div", { class: "header", onClick: this.toggle }, index.h("mds-text", { typography: this.typography }, this.description)), index.h("div", { class: clsx('contents', this.isActive && 'contents--opened') }, index.h("slot", null))))));
|
|
93
|
+
}
|
|
94
|
+
static get watchers() { return {
|
|
95
|
+
"active": ["validateOpened"]
|
|
96
|
+
}; }
|
|
97
|
+
};
|
|
98
|
+
MdsAccordionTimerItem.style = mdsAccordionTimerItemCss;
|
|
99
|
+
|
|
100
|
+
exports.mds_accordion_timer_item = MdsAccordionTimerItem;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-2ee34dd7.js');
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v2.10.0 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
const patchBrowser = () => {
|
|
9
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-accordion-timer-item.cjs.js', document.baseURI).href));
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== '') {
|
|
12
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return index.promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(options => {
|
|
18
|
+
return index.bootstrapLazy([["mds-accordion-timer-item.cjs",[[1,"mds-accordion-timer-item",{"typography":[1],"active":[516],"description":[1],"progress":[2],"uuid":[2],"isActive":[32]}]]]], options);
|
|
19
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
.contents {
|
|
2
|
+
|
|
3
|
+
display: contents;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.border {
|
|
7
|
+
|
|
8
|
+
border-width: 1px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.shadow {
|
|
12
|
+
|
|
13
|
+
--tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
|
14
|
+
|
|
15
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @prop --background-active: Sets the background-color of the progress bar when the item is selected
|
|
20
|
+
* @prop --color: Sets the text color of the component
|
|
21
|
+
* @prop --thickness: Sets thickness of the progress bar
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
:host {
|
|
25
|
+
|
|
26
|
+
position: relative;
|
|
27
|
+
|
|
28
|
+
display: grid;
|
|
29
|
+
|
|
30
|
+
padding-top: 1rem;
|
|
31
|
+
|
|
32
|
+
padding-bottom: 1rem;
|
|
33
|
+
|
|
34
|
+
transition-property: background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;
|
|
35
|
+
|
|
36
|
+
transition-duration: 150ms;
|
|
37
|
+
|
|
38
|
+
transition-duration: 500ms;
|
|
39
|
+
|
|
40
|
+
transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
|
|
41
|
+
|
|
42
|
+
color: var(--color, rgb(var(--adjust-tone-02)));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host ( :hover:not(.active) ) .progress-bar {
|
|
46
|
+
|
|
47
|
+
--background-active: rgb(var(--adjust-tone-07));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.row {
|
|
51
|
+
|
|
52
|
+
display: flex;
|
|
53
|
+
|
|
54
|
+
gap: 1rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.accordion {
|
|
58
|
+
|
|
59
|
+
display: grid;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.progress-bar {
|
|
63
|
+
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
|
|
66
|
+
--thickness: 0.25rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.header {
|
|
70
|
+
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:host ( .active ) .header {
|
|
75
|
+
|
|
76
|
+
cursor: auto;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.contents {
|
|
80
|
+
|
|
81
|
+
display: grid;
|
|
82
|
+
|
|
83
|
+
height: 0px;
|
|
84
|
+
|
|
85
|
+
gap: 1rem;
|
|
86
|
+
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
|
|
89
|
+
padding-top: 0px;
|
|
90
|
+
|
|
91
|
+
opacity: 0;
|
|
92
|
+
|
|
93
|
+
transition-property: background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;
|
|
94
|
+
|
|
95
|
+
transition-duration: 150ms;
|
|
96
|
+
|
|
97
|
+
transition-duration: 300ms;
|
|
98
|
+
|
|
99
|
+
transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.contents--opened {
|
|
103
|
+
|
|
104
|
+
height: auto;
|
|
105
|
+
|
|
106
|
+
padding-top: 1rem;
|
|
107
|
+
|
|
108
|
+
opacity: 1;
|
|
109
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { Component, Host, h, Prop, State, Event, Watch } from '@stencil/core';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
export class MdsAccordionTimerItem {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* Specifies the typography of the element
|
|
7
|
+
*/
|
|
8
|
+
this.typography = 'h5';
|
|
9
|
+
/**
|
|
10
|
+
* A value between 0 and 100 that rapresents the status progress
|
|
11
|
+
*/
|
|
12
|
+
this.progress = 0;
|
|
13
|
+
/**
|
|
14
|
+
* Used automatically by MdsAccordionTimer wrapper to handle it's siblings
|
|
15
|
+
*/
|
|
16
|
+
this.uuid = 0;
|
|
17
|
+
this.toggle = () => {
|
|
18
|
+
if (!this.isActive) {
|
|
19
|
+
this.isActive = true;
|
|
20
|
+
this.clickActive.emit(this.description);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
this.mouseEnter = () => {
|
|
24
|
+
if (this.isActive) {
|
|
25
|
+
this.mouseEnterActive.emit(this.description);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
this.mouseLeave = () => {
|
|
29
|
+
if (this.isActive) {
|
|
30
|
+
this.mouseLeaveActive.emit(this.description);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
componentWillLoad() {
|
|
35
|
+
this.isActive = this.active;
|
|
36
|
+
}
|
|
37
|
+
validateOpened(newValue) {
|
|
38
|
+
this.isActive = newValue;
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
return (h(Host, { class: clsx(this.isActive && 'active'), onMouseEnter: this.mouseEnter, onMouseLeave: this.mouseLeave },
|
|
42
|
+
h("div", { class: "row" },
|
|
43
|
+
h("mds-progress", { class: "progress-bar", progress: this.progress, direction: "vertical" }),
|
|
44
|
+
h("div", { class: "accordion" },
|
|
45
|
+
h("div", { class: "header", onClick: this.toggle },
|
|
46
|
+
h("mds-text", { typography: this.typography }, this.description)),
|
|
47
|
+
h("div", { class: clsx('contents', this.isActive && 'contents--opened') },
|
|
48
|
+
h("slot", null))))));
|
|
49
|
+
}
|
|
50
|
+
static get is() { return "mds-accordion-timer-item"; }
|
|
51
|
+
static get encapsulation() { return "shadow"; }
|
|
52
|
+
static get originalStyleUrls() { return {
|
|
53
|
+
"$": ["mds-accordion-timer-item.css"]
|
|
54
|
+
}; }
|
|
55
|
+
static get styleUrls() { return {
|
|
56
|
+
"$": ["mds-accordion-timer-item.css"]
|
|
57
|
+
}; }
|
|
58
|
+
static get properties() { return {
|
|
59
|
+
"typography": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "TypographyPrimaryType",
|
|
64
|
+
"resolved": "\"action\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\"",
|
|
65
|
+
"references": {
|
|
66
|
+
"TypographyPrimaryType": {
|
|
67
|
+
"location": "import",
|
|
68
|
+
"path": "../../types/typography"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"required": false,
|
|
73
|
+
"optional": true,
|
|
74
|
+
"docs": {
|
|
75
|
+
"tags": [],
|
|
76
|
+
"text": "Specifies the typography of the element"
|
|
77
|
+
},
|
|
78
|
+
"attribute": "typography",
|
|
79
|
+
"reflect": false,
|
|
80
|
+
"defaultValue": "'h5'"
|
|
81
|
+
},
|
|
82
|
+
"active": {
|
|
83
|
+
"type": "boolean",
|
|
84
|
+
"mutable": false,
|
|
85
|
+
"complexType": {
|
|
86
|
+
"original": "boolean",
|
|
87
|
+
"resolved": "boolean",
|
|
88
|
+
"references": {}
|
|
89
|
+
},
|
|
90
|
+
"required": false,
|
|
91
|
+
"optional": true,
|
|
92
|
+
"docs": {
|
|
93
|
+
"tags": [],
|
|
94
|
+
"text": "Specifies if the accordion item is opened or not"
|
|
95
|
+
},
|
|
96
|
+
"attribute": "active",
|
|
97
|
+
"reflect": true
|
|
98
|
+
},
|
|
99
|
+
"description": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "string",
|
|
104
|
+
"resolved": "string",
|
|
105
|
+
"references": {}
|
|
106
|
+
},
|
|
107
|
+
"required": true,
|
|
108
|
+
"optional": false,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "Specifies the title shown when the accordion is closed or opened"
|
|
112
|
+
},
|
|
113
|
+
"attribute": "description",
|
|
114
|
+
"reflect": false
|
|
115
|
+
},
|
|
116
|
+
"progress": {
|
|
117
|
+
"type": "number",
|
|
118
|
+
"mutable": false,
|
|
119
|
+
"complexType": {
|
|
120
|
+
"original": "number",
|
|
121
|
+
"resolved": "number",
|
|
122
|
+
"references": {}
|
|
123
|
+
},
|
|
124
|
+
"required": false,
|
|
125
|
+
"optional": true,
|
|
126
|
+
"docs": {
|
|
127
|
+
"tags": [],
|
|
128
|
+
"text": "A value between 0 and 100 that rapresents the status progress"
|
|
129
|
+
},
|
|
130
|
+
"attribute": "progress",
|
|
131
|
+
"reflect": false,
|
|
132
|
+
"defaultValue": "0"
|
|
133
|
+
},
|
|
134
|
+
"uuid": {
|
|
135
|
+
"type": "number",
|
|
136
|
+
"mutable": false,
|
|
137
|
+
"complexType": {
|
|
138
|
+
"original": "number",
|
|
139
|
+
"resolved": "number",
|
|
140
|
+
"references": {}
|
|
141
|
+
},
|
|
142
|
+
"required": false,
|
|
143
|
+
"optional": true,
|
|
144
|
+
"docs": {
|
|
145
|
+
"tags": [],
|
|
146
|
+
"text": "Used automatically by MdsAccordionTimer wrapper to handle it's siblings"
|
|
147
|
+
},
|
|
148
|
+
"attribute": "uuid",
|
|
149
|
+
"reflect": false,
|
|
150
|
+
"defaultValue": "0"
|
|
151
|
+
}
|
|
152
|
+
}; }
|
|
153
|
+
static get states() { return {
|
|
154
|
+
"isActive": {}
|
|
155
|
+
}; }
|
|
156
|
+
static get events() { return [{
|
|
157
|
+
"method": "clickActive",
|
|
158
|
+
"name": "clickActive",
|
|
159
|
+
"bubbles": true,
|
|
160
|
+
"cancelable": true,
|
|
161
|
+
"composed": true,
|
|
162
|
+
"docs": {
|
|
163
|
+
"tags": [],
|
|
164
|
+
"text": "Emits when the accordion is clicked by the mouse"
|
|
165
|
+
},
|
|
166
|
+
"complexType": {
|
|
167
|
+
"original": "string",
|
|
168
|
+
"resolved": "string",
|
|
169
|
+
"references": {}
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
"method": "mouseEnterActive",
|
|
173
|
+
"name": "mouseEnterActive",
|
|
174
|
+
"bubbles": true,
|
|
175
|
+
"cancelable": true,
|
|
176
|
+
"composed": true,
|
|
177
|
+
"docs": {
|
|
178
|
+
"tags": [],
|
|
179
|
+
"text": "Emits when the accordion is hovered by the mouse"
|
|
180
|
+
},
|
|
181
|
+
"complexType": {
|
|
182
|
+
"original": "string",
|
|
183
|
+
"resolved": "string",
|
|
184
|
+
"references": {}
|
|
185
|
+
}
|
|
186
|
+
}, {
|
|
187
|
+
"method": "mouseLeaveActive",
|
|
188
|
+
"name": "mouseLeaveActive",
|
|
189
|
+
"bubbles": true,
|
|
190
|
+
"cancelable": true,
|
|
191
|
+
"composed": true,
|
|
192
|
+
"docs": {
|
|
193
|
+
"tags": [],
|
|
194
|
+
"text": "Emits when the accordion is hovered by the mouse"
|
|
195
|
+
},
|
|
196
|
+
"complexType": {
|
|
197
|
+
"original": "string",
|
|
198
|
+
"resolved": "string",
|
|
199
|
+
"references": {}
|
|
200
|
+
}
|
|
201
|
+
}]; }
|
|
202
|
+
static get watchers() { return [{
|
|
203
|
+
"propName": "active",
|
|
204
|
+
"methodName": "validateOpened"
|
|
205
|
+
}]; }
|
|
206
|
+
}
|
package/dist/collection/components/mds-accordion-timer-item/test/mds-accordion-timer-item.stories.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import MdsAccordionTimerItem from '@component/mds-accordion-timer-item/mds-accordion-timer-item'
|
|
3
|
+
import { typographyPrimaryDictionary } from '@dictionary/typography'
|
|
4
|
+
import faker from 'faker'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'UI / Accordion Timer / Accordion Timer Item',
|
|
8
|
+
component: MdsAccordionTimerItem,
|
|
9
|
+
argTypes: {
|
|
10
|
+
description: {
|
|
11
|
+
type: { name: 'string', required: true },
|
|
12
|
+
description: 'Specifies the title shown when the accordion is closed or opened',
|
|
13
|
+
},
|
|
14
|
+
active: {
|
|
15
|
+
type: { name: 'boolean', required: false },
|
|
16
|
+
description: 'Specifies if the accordion item is opened or not',
|
|
17
|
+
},
|
|
18
|
+
progress: {
|
|
19
|
+
control: { type: 'range', step: 0.01, min: 0, max: 1 },
|
|
20
|
+
type: { name: 'number', required: false },
|
|
21
|
+
description: 'A value between 0 and 100 that rapresents the status progress',
|
|
22
|
+
},
|
|
23
|
+
typography: {
|
|
24
|
+
type: { name: 'string', required: false },
|
|
25
|
+
description: 'Specifies the typography of the element',
|
|
26
|
+
options: typographyPrimaryDictionary,
|
|
27
|
+
control: { type: 'select' },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const Template = args =>
|
|
33
|
+
<div>
|
|
34
|
+
<mds-accordion-timer-item {...args}>
|
|
35
|
+
<mds-text typography="paragraph" class="text-adjust-tone-08">{ faker.lorem.paragraphs(2) }</mds-text>
|
|
36
|
+
</mds-accordion-timer-item>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
export const Default = Template.bind({})
|
|
40
|
+
Default.args = {
|
|
41
|
+
progress: 0.15,
|
|
42
|
+
description: 'Come funziona il monitoraggio del sonno?',
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const active = Template.bind({})
|
|
46
|
+
active.args = {
|
|
47
|
+
active: true,
|
|
48
|
+
description: 'Come funziona il monitoraggio del sonno?',
|
|
49
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const autoCompleteDictionary = [
|
|
2
|
+
'additional-name',
|
|
3
|
+
'address',
|
|
4
|
+
'address-level1',
|
|
5
|
+
'address-level2',
|
|
6
|
+
'address-level3',
|
|
7
|
+
'address-level4',
|
|
8
|
+
'address-line1',
|
|
9
|
+
'address-line2',
|
|
10
|
+
'address-line3',
|
|
11
|
+
'bday',
|
|
12
|
+
'bday-day',
|
|
13
|
+
'bday-month',
|
|
14
|
+
'bday-year',
|
|
15
|
+
'cc-additional-name',
|
|
16
|
+
'cc-csc',
|
|
17
|
+
'cc-exp',
|
|
18
|
+
'cc-exp-month',
|
|
19
|
+
'cc-exp-year',
|
|
20
|
+
'cc-family-name',
|
|
21
|
+
'cc-family-name',
|
|
22
|
+
'cc-given-name',
|
|
23
|
+
'cc-name',
|
|
24
|
+
'cc-number',
|
|
25
|
+
'cc-type',
|
|
26
|
+
'country',
|
|
27
|
+
'country-name',
|
|
28
|
+
'current-password',
|
|
29
|
+
'email',
|
|
30
|
+
'family-name',
|
|
31
|
+
'given-name',
|
|
32
|
+
'honorific-prefix',
|
|
33
|
+
'honorific-suffix',
|
|
34
|
+
'impp',
|
|
35
|
+
'language',
|
|
36
|
+
'name',
|
|
37
|
+
'new-password',
|
|
38
|
+
'nickname',
|
|
39
|
+
'off',
|
|
40
|
+
'on',
|
|
41
|
+
'one-time-code',
|
|
42
|
+
'organization',
|
|
43
|
+
'organization-title',
|
|
44
|
+
'photo',
|
|
45
|
+
'postal-code',
|
|
46
|
+
'sex',
|
|
47
|
+
'street-address',
|
|
48
|
+
'tel',
|
|
49
|
+
'tel-area-code',
|
|
50
|
+
'tel-country-code',
|
|
51
|
+
'tel-extension',
|
|
52
|
+
'tel-local',
|
|
53
|
+
'tel-national',
|
|
54
|
+
'transaction-amount',
|
|
55
|
+
'transaction-currency',
|
|
56
|
+
'url',
|
|
57
|
+
'username',
|
|
58
|
+
];
|
|
59
|
+
export { autoCompleteDictionary, };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const buttonVariantDictionary = [
|
|
2
|
+
'dark',
|
|
3
|
+
'error',
|
|
4
|
+
'info',
|
|
5
|
+
'light',
|
|
6
|
+
'primary',
|
|
7
|
+
'success',
|
|
8
|
+
'warning',
|
|
9
|
+
];
|
|
10
|
+
const buttonToneVariantDictionary = [
|
|
11
|
+
'strong',
|
|
12
|
+
'weak',
|
|
13
|
+
'ghost',
|
|
14
|
+
'quiet',
|
|
15
|
+
];
|
|
16
|
+
const buttonSizeDictionary = [
|
|
17
|
+
'sm',
|
|
18
|
+
'md',
|
|
19
|
+
'lg',
|
|
20
|
+
'xl',
|
|
21
|
+
];
|
|
22
|
+
const buttonIconPositionDictionary = [
|
|
23
|
+
'left',
|
|
24
|
+
'right',
|
|
25
|
+
];
|
|
26
|
+
export { buttonSizeDictionary, buttonToneVariantDictionary, buttonVariantDictionary, buttonIconPositionDictionary, };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const colorLabelDictionary = [
|
|
2
|
+
'amaranth',
|
|
3
|
+
'aqua',
|
|
4
|
+
'blue',
|
|
5
|
+
'green',
|
|
6
|
+
'lime',
|
|
7
|
+
'orange',
|
|
8
|
+
'orchid',
|
|
9
|
+
'sky',
|
|
10
|
+
'violet',
|
|
11
|
+
'yellow',
|
|
12
|
+
];
|
|
13
|
+
const colorStatusDictionary = [
|
|
14
|
+
'error',
|
|
15
|
+
'info',
|
|
16
|
+
'success',
|
|
17
|
+
'warning',
|
|
18
|
+
];
|
|
19
|
+
export { colorLabelDictionary, colorStatusDictionary, };
|