@maggioli-design-system/mds-input 3.0.2 → 3.0.3
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-ce0af7c1.js → index-b844ce43.js} +18 -6
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/mds-input.cjs.entry.js +4 -4
- package/dist/cjs/mds-input.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/mds-input/mds-input.css +56 -75
- package/dist/collection/components/mds-input/mds-input.js +7 -7
- package/dist/collection/components/mds-input/test/mds-input.stories.js +10 -5
- package/dist/components/mds-input.js +6 -5
- package/dist/esm/{index-a7c1245d.js → index-53c59ebe.js} +18 -6
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mds-input.entry.js +4 -4
- package/dist/esm/mds-input.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm-es5/index-53c59ebe.js +2 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-input.entry.js +1 -1
- package/dist/esm-es5/mds-input.js +1 -1
- package/dist/mds-input/mds-input.esm.js +1 -1
- package/dist/mds-input/mds-input.js +1 -1
- package/dist/mds-input/p-270bb9cd.system.js +1 -0
- package/dist/mds-input/p-8dfb606d.js +2 -0
- package/dist/mds-input/p-a31dfeb3.system.entry.js +1 -0
- package/dist/mds-input/p-c337698a.entry.js +1 -0
- package/dist/mds-input/p-cb726900.system.js +2 -0
- package/dist/stats.json +64 -44
- package/dist/types/components/mds-input/test/mds-input.stories.d.ts +3 -2
- package/dist/types/components.d.ts +9 -9
- package/dist/types/stencil-public-runtime.d.ts +39 -3
- package/dist/types/types/autocomplete.d.ts +2 -2
- package/dist/types/types/button.d.ts +4 -4
- package/dist/types/types/floating-ui.d.ts +2 -2
- package/dist/types/types/form-rel.d.ts +1 -1
- package/dist/types/types/input-text-type.d.ts +1 -1
- package/dist/types/types/input-value-type.d.ts +1 -1
- package/dist/types/types/loading.d.ts +1 -1
- package/dist/types/types/typography.d.ts +8 -8
- package/dist/types/types/variant.d.ts +10 -10
- package/package.json +2 -2
- package/readme.md +9 -5
- package/src/components/mds-input/css/mds-input-variant.css +30 -32
- package/src/components/mds-input/mds-input.css +23 -17
- package/src/components/mds-input/mds-input.tsx +7 -7
- package/src/components/mds-input/readme.md +9 -5
- package/src/components/mds-input/test/mds-input.stories.tsx +11 -5
- package/src/components.d.ts +9 -9
- package/src/fixtures/icons.json +3 -0
- package/www/build/mds-input.esm.js +1 -1
- package/www/build/mds-input.js +1 -1
- package/www/build/p-270bb9cd.system.js +1 -0
- package/www/build/p-8dfb606d.js +2 -0
- package/www/build/p-a31dfeb3.system.entry.js +1 -0
- package/www/build/p-c337698a.entry.js +1 -0
- package/www/build/p-cb726900.system.js +2 -0
- package/dist/esm-es5/index-a7c1245d.js +0 -2
- package/dist/mds-input/p-5028a9b6.entry.js +0 -1
- package/dist/mds-input/p-5a25a6ca.system.entry.js +0 -1
- package/dist/mds-input/p-6356eef6.system.js +0 -2
- package/dist/mds-input/p-ccaf79b2.system.js +0 -1
- package/dist/mds-input/p-f5b76399.js +0 -2
- package/www/build/p-5028a9b6.entry.js +0 -1
- package/www/build/p-5a25a6ca.system.entry.js +0 -1
- package/www/build/p-6356eef6.system.js +0 -2
- package/www/build/p-ccaf79b2.system.js +0 -1
- package/www/build/p-f5b76399.js +0 -2
|
@@ -31,6 +31,7 @@ const NAMESPACE = 'mds-input';
|
|
|
31
31
|
* Modified for Stencil's renderer and slot projection
|
|
32
32
|
*/
|
|
33
33
|
let scopeId;
|
|
34
|
+
let hostTagName;
|
|
34
35
|
let isSvgMode = false;
|
|
35
36
|
let queuePending = false;
|
|
36
37
|
const createTime = (fnName, tagName = '') => {
|
|
@@ -70,7 +71,6 @@ const isComplexType = (o) => {
|
|
|
70
71
|
*
|
|
71
72
|
* Modified for Stencil's compiler and vdom
|
|
72
73
|
*/
|
|
73
|
-
// const stack: any[] = [];
|
|
74
74
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
75
75
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
76
76
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -264,7 +264,7 @@ const attachStyles = (hostRef) => {
|
|
|
264
264
|
const elm = hostRef.$hostElement$;
|
|
265
265
|
const flags = cmpMeta.$flags$;
|
|
266
266
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
267
|
-
const scopeId = addStyle(elm.getRootNode(), cmpMeta);
|
|
267
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
268
268
|
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
269
269
|
// only required when we're NOT using native shadow dom (slot)
|
|
270
270
|
// or this browser doesn't support native shadow dom
|
|
@@ -275,9 +275,6 @@ const attachStyles = (hostRef) => {
|
|
|
275
275
|
// DOM WRITE!!
|
|
276
276
|
elm['s-sc'] = scopeId;
|
|
277
277
|
elm.classList.add(scopeId + '-h');
|
|
278
|
-
if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
279
|
-
elm.classList.add(scopeId + '-s');
|
|
280
|
-
}
|
|
281
278
|
}
|
|
282
279
|
endAttachStyles();
|
|
283
280
|
};
|
|
@@ -456,6 +453,9 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
456
453
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
457
454
|
let containerElm = (parentElm);
|
|
458
455
|
let childNode;
|
|
456
|
+
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
457
|
+
containerElm = containerElm.shadowRoot;
|
|
458
|
+
}
|
|
459
459
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
460
460
|
if (vnodes[startIdx]) {
|
|
461
461
|
childNode = createElm(null, parentVNode, startIdx);
|
|
@@ -730,6 +730,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
730
730
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
731
731
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
732
732
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
733
|
+
hostTagName = hostElm.tagName;
|
|
733
734
|
if (cmpMeta.$attrsToReflect$) {
|
|
734
735
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
735
736
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
@@ -737,7 +738,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
737
738
|
rootVnode.$tag$ = null;
|
|
738
739
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
739
740
|
hostRef.$vnode$ = rootVnode;
|
|
740
|
-
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
|
|
741
|
+
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
741
742
|
{
|
|
742
743
|
scopeId = hostElm['s-sc'];
|
|
743
744
|
}
|
|
@@ -1221,6 +1222,17 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1221
1222
|
super(self);
|
|
1222
1223
|
self = this;
|
|
1223
1224
|
registerHost(self, cmpMeta);
|
|
1225
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
1226
|
+
// this component is using shadow dom
|
|
1227
|
+
// and this browser supports shadow dom
|
|
1228
|
+
// add the read-only property "shadowRoot" to the host element
|
|
1229
|
+
// adding the shadow root build conditionals to minimize runtime
|
|
1230
|
+
{
|
|
1231
|
+
{
|
|
1232
|
+
self.attachShadow({ mode: 'open' });
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1224
1236
|
}
|
|
1225
1237
|
connectedCallback() {
|
|
1226
1238
|
if (appLoadFallback) {
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-b844ce43.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.21.0 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["mds-input.cjs",[[
|
|
17
|
+
return index.bootstrapLazy([["mds-input.cjs",[[1,"mds-input",{"autocomplete":[1],"autofocus":[4],"datalist":[16],"disabled":[4],"icon":[1],"max":[2],"maxlength":[2],"min":[1],"minlength":[2],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[4],"required":[4],"variant":[513],"tip":[1],"step":[1],"type":[1],"value":[8],"hasFocus":[32],"setFocus":[64],"getInputElement":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-b844ce43.js');
|
|
6
6
|
|
|
7
7
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
8
8
|
|
|
9
|
-
const mdsInputCss = "*.sc-mds-input,.sc-mds-input::before,.sc-mds-input::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.sc-mds-input::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.sc-mds-input::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}@tailwind utilities; .sc-mds-input-h{--icon-color:rgb(var(--tone-neutral));--background:rgb(var(--tone-neutral));--variant-color:0, 0, 0;--ring:0 0 0 1px rgba(var(--variant-color), 0.1);--shadow:0 1px 3px 0 rgba(var(--variant-color), 0.1), 0 1px 2px 0 rgba(var(--variant-color), 0.06);font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:relative;display:-ms-flexbox;display:flex}.input.sc-mds-input{font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0px;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:3rem;width:100%;overflow:hidden;text-overflow:ellipsis;border-radius:0.5rem;border-style:none;border-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;--tw-text-opacity:1;color:rgba(var(--tone-neutral-02), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);background-color:var(--background);-webkit-box-shadow:var(--ring), var(--shadow);box-shadow:var(--ring), var(--shadow)}textarea.input.sc-mds-input:active{-webkit-transition-property:none;transition-property:none}textarea.input.sc-mds-input{max-height:16rem;min-height:6rem;border-bottom-right-radius:0px}.input.sc-mds-input:focus{outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);--variant-color:10, 80, 212;--ring:0 0 0 3px rgba(var(--variant-color), 1);--shadow:0 4px 6px -1px rgba(var(--variant-color), 0.1), 0 2px 4px -1px rgba(var(--variant-color), 0.06);-webkit-box-shadow:var(--ring), var(--shadow);box-shadow:var(--ring), var(--shadow)}.input.sc-mds-input:disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-10), var(--tw-bg-opacity))}.input.sc-mds-input:disabled::-moz-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.sc-mds-input:disabled::-webkit-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.sc-mds-input:disabled:-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.sc-mds-input:disabled::-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.sc-mds-input:disabled,.input.sc-mds-input:disabled::placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.has-icon.sc-mds-input{padding-left:2.75rem}.tip.sc-mds-input,.tip-variant.sc-mds-input{pointer-events:none;position:absolute;right:0.25rem;height:0.75rem;-ms-flex-pack:center;justify-content:center;border-radius:9999px;padding-left:0.5rem;padding-right:0.5rem;text-align:center;--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);line-height:0.75rem}.read-only.sc-mds-input{--tw-bg-opacity:1;background-color:rgba(var(--status-info-05), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--status-info-09), var(--tw-text-opacity))}.required.sc-mds-input{width:0.75rem;--tw-bg-opacity:1;background-color:rgba(var(--status-error-05), var(--tw-bg-opacity));padding:0px;color:rgba(var(--tone-neutral), var(--tw-text-opacity));--tw-text-opacity:0}.disabled.sc-mds-input{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-05), var(--tw-bg-opacity))}.input.sc-mds-input:focus+.required.sc-mds-input{width:6rem;--tw-text-opacity:1}.icon.sc-mds-input{position:absolute;left:0.75rem;top:0.75rem;fill:rgb(var(--brand-maggioli-04))}.fixed.sc-mds-input{position:fixed}.absolute.sc-mds-input{position:absolute}.top-1.sc-mds-input{top:0.25rem}.bottom-1.sc-mds-input{bottom:0.25rem}.flex.sc-mds-input{display:-ms-flexbox;display:flex}.w-min.sc-mds-input{width:-moz-min-content;width:-webkit-min-content;width:min-content}.flex-col.sc-mds-input{-ms-flex-direction:column;flex-direction:column}.gap-y-2.sc-mds-input{row-gap:0.5rem}.border.sc-mds-input{border-width:1px}.sc-mds-input-h(.sc-mds-input [variant=info].sc-mds-input).sc-mds-input{--variant-color:30, 174, 221}.sc-mds-input-h(.sc-mds-input [variant=info].sc-mds-input).sc-mds-input .tip-variant.sc-mds-input{--tw-bg-opacity:1;background-color:rgba(var(--status-info-06), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=info].sc-mds-input).sc-mds-input .icon.sc-mds-input{--tw-text-opacity:1;color:rgba(var(--status-info-06), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=success].sc-mds-input).sc-mds-input{--variant-color:32, 184, 111}.sc-mds-input-h(.sc-mds-input [variant=success].sc-mds-input).sc-mds-input .tip-variant.sc-mds-input{--tw-bg-opacity:1;background-color:rgba(var(--status-success-06), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=success].sc-mds-input).sc-mds-input .icon.sc-mds-input{--tw-text-opacity:1;color:rgba(var(--status-success-06), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=warning].sc-mds-input).sc-mds-input{--variant-color:204, 153, 0}.sc-mds-input-h(.sc-mds-input [variant=warning].sc-mds-input).sc-mds-input .tip-variant.sc-mds-input{--tw-bg-opacity:1;background-color:rgba(var(--status-warning-06), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=warning].sc-mds-input).sc-mds-input .icon.sc-mds-input{--tw-text-opacity:1;color:rgba(var(--status-warning-06), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=error].sc-mds-input).sc-mds-input{--variant-color:158, 21, 18}.sc-mds-input-h(.sc-mds-input [variant=error].sc-mds-input).sc-mds-input .tip-variant.sc-mds-input{--tw-bg-opacity:1;background-color:rgba(var(--status-error-06), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=error].sc-mds-input).sc-mds-input .icon.sc-mds-input{--tw-text-opacity:1;color:rgba(var(--status-error-06), var(--tw-text-opacity))}";
|
|
9
|
+
const mdsInputCss = "*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}@tailwind utilities; :host{--mds-input-background:rgb(var(--tone-neutral));--mds-input-icon-color:var(--mds-input-variant-color);--mds-input-tip-background:84, 84, 84;--mds-input-ring:0 0 0 1px rgba(var(--mds-input-variant-color), 0.1);--mds-input-shadow:0 1px 3px 0 rgba(var(--mds-input-variant-color), 0.1), 0 1px 2px 0 rgba(var(--mds-input-variant-color), 0.06);--mds-input-variant-color:0, 0, 0;font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:relative;display:-ms-flexbox;display:flex}.input{font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0px;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:3rem;width:100%;overflow:hidden;text-overflow:ellipsis;border-radius:0.5rem;border-style:none;border-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;--tw-text-opacity:1;color:rgba(var(--tone-neutral-02), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);background-color:var(--mds-input-background);-webkit-box-shadow:var(--mds-input-ring), var(--mds-input-shadow);box-shadow:var(--mds-input-ring), var(--mds-input-shadow)}textarea.input:active{-webkit-transition-property:none;transition-property:none}textarea.input{max-height:16rem;min-height:6rem;border-bottom-right-radius:0px}.input:focus{outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);--mds-input-ring:0 0 0 3px rgba(var(--mds-input-variant-color), 1);--mds-input-shadow:0 4px 6px -1px rgba(var(--mds-input-variant-color), 0.1), 0 2px 4px -1px rgba(var(--mds-input-variant-color), 0.06)}.input:disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-10), var(--tw-bg-opacity))}.input:disabled::-moz-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled::-webkit-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled:-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled::-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled,.input:disabled::placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.has-icon{padding-left:2.75rem}.tip{pointer-events:none;position:absolute;right:0.25rem;height:0.75rem;-ms-flex-pack:center;justify-content:center;border-radius:9999px;padding-left:0.5rem;padding-right:0.5rem;text-align:center;--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);line-height:0.75rem;background-color:rgb(var(--mds-input-tip-background))}.tip-variant{--mds-input-tip-background:var(--mds-input-icon-color)}.read-only{--tw-bg-opacity:1;background-color:rgba(var(--status-info-05), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--status-info-09), var(--tw-text-opacity))}.required{width:0.75rem;--tw-bg-opacity:1;background-color:rgba(var(--status-error-05), var(--tw-bg-opacity));padding:0px;color:rgba(var(--tone-neutral), var(--tw-text-opacity));--tw-text-opacity:0}.disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-05), var(--tw-bg-opacity))}.input:focus+.required{width:6rem;--tw-text-opacity:1}.icon{position:absolute;left:0.75rem;top:0.75rem;fill:rgb(var(--mds-input-icon-color))}.fixed{position:fixed}.absolute{position:absolute}.top-1{top:0.25rem}.bottom-1{bottom:0.25rem}.flex{display:-ms-flexbox;display:flex}.w-min{width:-moz-min-content;width:-webkit-min-content;width:min-content}.flex-col{-ms-flex-direction:column;flex-direction:column}.gap-y-2{row-gap:0.5rem}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-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{--mds-input-icon-color:10, 80, 212;--mds-input-variant-color:0, 0, 0}:host(:focus){--mds-input-variant-color:31, 101, 232;}:host([variant=info]){--mds-input-icon-color:25, 143, 182;--mds-input-variant-color:0, 0, 0}:host([variant=info]:focus){--mds-input-icon-color:21, 119, 151;--mds-input-variant-color:25, 143, 182;}:host([variant=success]){--mds-input-icon-color:26, 151, 91;--mds-input-variant-color:0, 0, 0}:host([variant=success]:focus){--mds-input-icon-color:22, 125, 76;--mds-input-variant-color:26, 151, 91;}:host([variant=warning]){--mds-input-icon-color:168, 126, 0;--mds-input-variant-color:0, 0, 0}:host([variant=warning]:focus){--mds-input-icon-color:139, 104, 0;--mds-input-variant-color:168, 126, 0;}:host([variant=error]){--mds-input-icon-color:234, 77, 73;--mds-input-variant-color:0, 0, 0}:host([variant=error]:focus){--mds-input-icon-color:215, 29, 25;--mds-input-variant-color:234, 77, 73;}";
|
|
10
10
|
|
|
11
11
|
const MdsInput = class {
|
|
12
12
|
constructor(hostRef) {
|
|
@@ -54,7 +54,7 @@ const MdsInput = class {
|
|
|
54
54
|
this.readonly = false;
|
|
55
55
|
this.required = false;
|
|
56
56
|
this.variant = undefined;
|
|
57
|
-
this.
|
|
57
|
+
this.tip = undefined;
|
|
58
58
|
this.step = undefined;
|
|
59
59
|
this.type = 'text';
|
|
60
60
|
this.value = '';
|
|
@@ -99,7 +99,7 @@ const MdsInput = class {
|
|
|
99
99
|
const value = this.getValue();
|
|
100
100
|
return (index.h(index.Host, null, this.type === 'textarea'
|
|
101
101
|
? index.h("textarea", { class: clsx('input', this.icon && 'has-icon'), autoFocus: this.autofocus, disabled: this.disabled, maxLength: this.maxlength, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, placeholder: this.placeholder || '', readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, tabIndex: this.tabindex, value: value })
|
|
102
|
-
: index.h("input", { class: clsx('input', this.icon && 'has-icon'), autoComplete: this.autocomplete, autoFocus: this.autofocus, disabled: this.disabled, max: this.max, maxLength: this.maxlength, min: this.min, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, pattern: this.pattern, list: this.datalist && 'datalist', placeholder: this.placeholder || '', readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, step: this.step, tabIndex: this.tabindex, type: this.type, value: value }), this.
|
|
102
|
+
: index.h("input", { class: clsx('input', this.icon && 'has-icon'), autoComplete: this.autocomplete, autoFocus: this.autofocus, disabled: this.disabled, max: this.max, maxLength: this.maxlength, min: this.min, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, pattern: this.pattern, list: this.datalist && 'datalist', placeholder: this.placeholder || '', readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, step: this.step, tabIndex: this.tabindex, type: this.type, value: value }), this.disabled && index.h("mds-text", { typography: "option", class: "tip top-1 disabled" }, "Disabilitato"), this.readonly && !this.disabled && index.h("mds-text", { typography: "option", class: "tip top-1 read-only" }, "Sola lettura"), this.required && !this.disabled && !this.readonly && index.h("mds-text", { typography: "option", class: "tip top-1 required" }, "Obbligatorio"), this.tip && index.h("mds-text", { typography: "option", class: clsx('tip bottom-1', this.variant && 'tip-variant') }, this.tip), this.datalist &&
|
|
103
103
|
index.h("datalist", { id: "datalist", class: "datalist" }, this.datalist.forEach(element => {
|
|
104
104
|
index.h("option", { value: element });
|
|
105
105
|
})), this.icon && index.h("mds-icon", { class: clsx('icon', this.variant), name: this.icon })));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-b844ce43.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v2.
|
|
6
|
+
Stencil Client Patch Browser v2.21.0 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
const patchBrowser = () => {
|
|
9
9
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-input.cjs.js', document.baseURI).href));
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["mds-input.cjs",[[
|
|
18
|
+
return index.bootstrapLazy([["mds-input.cjs",[[1,"mds-input",{"autocomplete":[1],"autofocus":[4],"datalist":[16],"disabled":[4],"icon":[1],"max":[2],"maxlength":[2],"min":[1],"minlength":[2],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[4],"required":[4],"variant":[513],"tip":[1],"step":[1],"type":[1],"value":[8],"hasFocus":[32],"setFocus":[64],"getInputElement":[64]}]]]], options);
|
|
19
19
|
});
|
|
@@ -182,17 +182,22 @@
|
|
|
182
182
|
@tailwind utilities;
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
|
-
* @prop --background: Sets the background-color of the component
|
|
186
|
-
* @prop --
|
|
185
|
+
* @prop --mds-input-background: Sets the background-color of the component
|
|
186
|
+
* @prop --mds-input-icon-color: Sets the icon color of the component
|
|
187
|
+
* @prop --mds-input-ring: Sets the box-shadow of the component's input
|
|
188
|
+
* @prop --mds-input-shadow: Sets the box-shadow of the component's input
|
|
189
|
+
* @prop --mds-input-tip-background: Sets the background color of the tip message at the bottom right of the component
|
|
190
|
+
* @prop --mds-input-variant-color: Sets the variant colors of the component
|
|
187
191
|
*/
|
|
188
192
|
|
|
189
193
|
:host {
|
|
190
194
|
|
|
191
|
-
--
|
|
192
|
-
--
|
|
193
|
-
--
|
|
194
|
-
--ring: 0 0 0 1px rgba(var(--variant-color), 0.1);
|
|
195
|
-
--shadow: 0 1px 3px 0 rgba(var(--variant-color), 0.1), 0 1px 2px 0 rgba(var(--variant-color), 0.06);
|
|
195
|
+
--mds-input-background: rgb(var(--tone-neutral));
|
|
196
|
+
--mds-input-icon-color: var(--mds-input-variant-color);
|
|
197
|
+
--mds-input-tip-background: 84, 84, 84;
|
|
198
|
+
--mds-input-ring: 0 0 0 1px rgba(var(--mds-input-variant-color), 0.1);
|
|
199
|
+
--mds-input-shadow: 0 1px 3px 0 rgba(var(--mds-input-variant-color), 0.1), 0 1px 2px 0 rgba(var(--mds-input-variant-color), 0.06);
|
|
200
|
+
--mds-input-variant-color: 0, 0, 0;
|
|
196
201
|
font-family: Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;
|
|
197
202
|
font-size: 1rem;
|
|
198
203
|
line-height: 1.5rem;
|
|
@@ -252,8 +257,8 @@
|
|
|
252
257
|
|
|
253
258
|
transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
|
|
254
259
|
|
|
255
|
-
background-color: var(--background);
|
|
256
|
-
box-shadow: var(--ring), var(--shadow);
|
|
260
|
+
background-color: var(--mds-input-background);
|
|
261
|
+
box-shadow: var(--mds-input-ring), var(--mds-input-shadow);
|
|
257
262
|
}
|
|
258
263
|
|
|
259
264
|
textarea.input:active{
|
|
@@ -284,11 +289,8 @@ textarea.input{
|
|
|
284
289
|
|
|
285
290
|
transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
|
|
286
291
|
|
|
287
|
-
--
|
|
288
|
-
--
|
|
289
|
-
--shadow: 0 4px 6px -1px rgba(var(--variant-color), 0.1), 0 2px 4px -1px rgba(var(--variant-color), 0.06);
|
|
290
|
-
|
|
291
|
-
box-shadow: var(--ring), var(--shadow);
|
|
292
|
+
--mds-input-ring: 0 0 0 3px rgba(var(--mds-input-variant-color), 1);
|
|
293
|
+
--mds-input-shadow: 0 4px 6px -1px rgba(var(--mds-input-variant-color), 0.1), 0 2px 4px -1px rgba(var(--mds-input-variant-color), 0.06);
|
|
292
294
|
}
|
|
293
295
|
|
|
294
296
|
.input:disabled{
|
|
@@ -318,8 +320,7 @@ textarea.input{
|
|
|
318
320
|
padding-left: 2.75rem;
|
|
319
321
|
}
|
|
320
322
|
|
|
321
|
-
.tip
|
|
322
|
-
.tip-variant{
|
|
323
|
+
.tip{
|
|
323
324
|
|
|
324
325
|
pointer-events: none;
|
|
325
326
|
|
|
@@ -352,6 +353,11 @@ textarea.input{
|
|
|
352
353
|
transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
|
|
353
354
|
|
|
354
355
|
line-height: 0.75rem;
|
|
356
|
+
background-color: rgb(var(--mds-input-tip-background));
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.tip-variant {
|
|
360
|
+
--mds-input-tip-background: var(--mds-input-icon-color);
|
|
355
361
|
}
|
|
356
362
|
|
|
357
363
|
.read-only{
|
|
@@ -402,7 +408,7 @@ textarea.input{
|
|
|
402
408
|
|
|
403
409
|
top: 0.75rem;
|
|
404
410
|
|
|
405
|
-
fill: rgb(var(--
|
|
411
|
+
fill: rgb(var(--mds-input-icon-color));
|
|
406
412
|
}
|
|
407
413
|
|
|
408
414
|
.fixed{
|
|
@@ -452,95 +458,70 @@ textarea.input{
|
|
|
452
458
|
border-width: 1px;
|
|
453
459
|
}
|
|
454
460
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
--variant-color: 30, 174, 221; /* status-info-06 */
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
:host ( [variant=info] ) .tip-variant{
|
|
461
|
-
|
|
462
|
-
--tw-bg-opacity: 1;
|
|
461
|
+
.shadow{
|
|
463
462
|
|
|
464
|
-
|
|
463
|
+
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
465
464
|
|
|
466
|
-
--tw-
|
|
465
|
+
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
|
467
466
|
|
|
468
|
-
|
|
467
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
469
468
|
}
|
|
470
469
|
|
|
471
|
-
:host
|
|
472
|
-
|
|
473
|
-
--
|
|
474
|
-
|
|
475
|
-
color: rgba(var(--status-info-06), var(--tw-text-opacity));
|
|
470
|
+
:host {
|
|
471
|
+
--mds-input-icon-color: 10, 80, 212; /* brand-maggioli-03 */
|
|
472
|
+
--mds-input-variant-color: 0, 0, 0;
|
|
476
473
|
}
|
|
477
474
|
|
|
478
|
-
:host (
|
|
475
|
+
:host ( :focus ) {
|
|
479
476
|
|
|
480
|
-
--variant-color:
|
|
477
|
+
--mds-input-variant-color: 31, 101, 232; /* brand-maggioli-04 */
|
|
481
478
|
}
|
|
482
479
|
|
|
483
|
-
:host ( [variant=
|
|
484
|
-
|
|
485
|
-
--tw-bg-opacity: 1;
|
|
486
|
-
|
|
487
|
-
background-color: rgba(var(--status-success-06), var(--tw-bg-opacity));
|
|
488
|
-
|
|
489
|
-
--tw-text-opacity: 1;
|
|
480
|
+
:host ( [variant=info] ) {
|
|
490
481
|
|
|
491
|
-
color:
|
|
482
|
+
--mds-input-icon-color: 25, 143, 182; /* status-info-05 */
|
|
483
|
+
--mds-input-variant-color: 0, 0, 0;
|
|
492
484
|
}
|
|
493
485
|
|
|
494
|
-
:host ( [variant=
|
|
486
|
+
:host ( [variant=info]:focus ) {
|
|
495
487
|
|
|
496
|
-
--
|
|
497
|
-
|
|
498
|
-
color: rgba(var(--status-success-06), var(--tw-text-opacity));
|
|
488
|
+
--mds-input-icon-color: 21, 119, 151; /* status-info-04 */
|
|
489
|
+
--mds-input-variant-color: 25, 143, 182; /* status-info-05 */
|
|
499
490
|
}
|
|
500
491
|
|
|
501
|
-
:host ( [variant=
|
|
492
|
+
:host ( [variant=success] ) {
|
|
502
493
|
|
|
503
|
-
--
|
|
494
|
+
--mds-input-icon-color: 26, 151, 91; /* status-success-05 */
|
|
495
|
+
--mds-input-variant-color: 0, 0, 0;
|
|
504
496
|
}
|
|
505
497
|
|
|
506
|
-
:host ( [variant=
|
|
507
|
-
|
|
508
|
-
--tw-bg-opacity: 1;
|
|
509
|
-
|
|
510
|
-
background-color: rgba(var(--status-warning-06), var(--tw-bg-opacity));
|
|
511
|
-
|
|
512
|
-
--tw-text-opacity: 1;
|
|
498
|
+
:host ( [variant=success]:focus ) {
|
|
513
499
|
|
|
514
|
-
color:
|
|
500
|
+
--mds-input-icon-color: 22, 125, 76; /* status-success-04 */
|
|
501
|
+
--mds-input-variant-color: 26, 151, 91; /* status-success-05 */
|
|
515
502
|
}
|
|
516
503
|
|
|
517
|
-
:host ( [variant=warning] )
|
|
518
|
-
|
|
519
|
-
--tw-text-opacity: 1;
|
|
504
|
+
:host ( [variant=warning] ) {
|
|
520
505
|
|
|
521
|
-
color:
|
|
506
|
+
--mds-input-icon-color: 168, 126, 0; /* status-warning-05 */
|
|
507
|
+
--mds-input-variant-color: 0, 0, 0;
|
|
522
508
|
}
|
|
523
509
|
|
|
524
|
-
:host ( [variant=
|
|
510
|
+
:host ( [variant=warning]:focus ) {
|
|
525
511
|
|
|
526
|
-
--
|
|
512
|
+
--mds-input-icon-color: 139, 104, 0; /* status-warning-04 */
|
|
513
|
+
--mds-input-variant-color: 168, 126, 0; /* status-warning-05 */
|
|
527
514
|
}
|
|
528
515
|
|
|
529
|
-
:host ( [variant=error] )
|
|
530
|
-
|
|
531
|
-
--tw-bg-opacity: 1;
|
|
532
|
-
|
|
533
|
-
background-color: rgba(var(--status-error-06), var(--tw-bg-opacity));
|
|
534
|
-
|
|
535
|
-
--tw-text-opacity: 1;
|
|
516
|
+
:host ( [variant=error] ) {
|
|
536
517
|
|
|
537
|
-
color:
|
|
518
|
+
--mds-input-icon-color: 234, 77, 73; /* status-error-05 */
|
|
519
|
+
--mds-input-variant-color: 0, 0, 0;
|
|
538
520
|
}
|
|
539
521
|
|
|
540
|
-
:host ( [variant=error] )
|
|
541
|
-
|
|
542
|
-
--tw-text-opacity: 1;
|
|
522
|
+
:host ( [variant=error]:focus ) {
|
|
543
523
|
|
|
544
|
-
color:
|
|
524
|
+
--mds-input-icon-color: 215, 29, 25; /* status-error-04 */
|
|
525
|
+
--mds-input-variant-color: 234, 77, 73; /* status-error-05 */
|
|
545
526
|
}
|
|
546
527
|
|
|
@@ -41,7 +41,7 @@ export class MdsInput {
|
|
|
41
41
|
this.readonly = false;
|
|
42
42
|
this.required = false;
|
|
43
43
|
this.variant = undefined;
|
|
44
|
-
this.
|
|
44
|
+
this.tip = undefined;
|
|
45
45
|
this.step = undefined;
|
|
46
46
|
this.type = 'text';
|
|
47
47
|
this.value = '';
|
|
@@ -86,13 +86,13 @@ export class MdsInput {
|
|
|
86
86
|
const value = this.getValue();
|
|
87
87
|
return (h(Host, null, this.type === 'textarea'
|
|
88
88
|
? h("textarea", { class: clsx('input', this.icon && 'has-icon'), autoFocus: this.autofocus, disabled: this.disabled, maxLength: this.maxlength, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, placeholder: this.placeholder || '', readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, tabIndex: this.tabindex, value: value })
|
|
89
|
-
: h("input", { class: clsx('input', this.icon && 'has-icon'), autoComplete: this.autocomplete, autoFocus: this.autofocus, disabled: this.disabled, max: this.max, maxLength: this.maxlength, min: this.min, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, pattern: this.pattern, list: this.datalist && 'datalist', placeholder: this.placeholder || '', readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, step: this.step, tabIndex: this.tabindex, type: this.type, value: value }), this.
|
|
89
|
+
: h("input", { class: clsx('input', this.icon && 'has-icon'), autoComplete: this.autocomplete, autoFocus: this.autofocus, disabled: this.disabled, max: this.max, maxLength: this.maxlength, min: this.min, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, pattern: this.pattern, list: this.datalist && 'datalist', placeholder: this.placeholder || '', readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, step: this.step, tabIndex: this.tabindex, type: this.type, value: value }), this.disabled && h("mds-text", { typography: "option", class: "tip top-1 disabled" }, "Disabilitato"), this.readonly && !this.disabled && h("mds-text", { typography: "option", class: "tip top-1 read-only" }, "Sola lettura"), this.required && !this.disabled && !this.readonly && h("mds-text", { typography: "option", class: "tip top-1 required" }, "Obbligatorio"), this.tip && h("mds-text", { typography: "option", class: clsx('tip bottom-1', this.variant && 'tip-variant') }, this.tip), this.datalist &&
|
|
90
90
|
h("datalist", { id: "datalist", class: "datalist" }, this.datalist.forEach(element => {
|
|
91
91
|
h("option", { value: element });
|
|
92
92
|
})), this.icon && h("mds-icon", { class: clsx('icon', this.variant), name: this.icon })));
|
|
93
93
|
}
|
|
94
94
|
static get is() { return "mds-input"; }
|
|
95
|
-
static get encapsulation() { return "
|
|
95
|
+
static get encapsulation() { return "shadow"; }
|
|
96
96
|
static get originalStyleUrls() {
|
|
97
97
|
return {
|
|
98
98
|
"$": ["mds-input.css"]
|
|
@@ -373,7 +373,7 @@ export class MdsInput {
|
|
|
373
373
|
"attribute": "variant",
|
|
374
374
|
"reflect": true
|
|
375
375
|
},
|
|
376
|
-
"
|
|
376
|
+
"tip": {
|
|
377
377
|
"type": "string",
|
|
378
378
|
"mutable": false,
|
|
379
379
|
"complexType": {
|
|
@@ -385,9 +385,9 @@ export class MdsInput {
|
|
|
385
385
|
"optional": true,
|
|
386
386
|
"docs": {
|
|
387
387
|
"tags": [],
|
|
388
|
-
"text": "Sets the word(s) of the
|
|
388
|
+
"text": "Sets the word(s) of the tip of the input field"
|
|
389
389
|
},
|
|
390
|
-
"attribute": "
|
|
390
|
+
"attribute": "tip",
|
|
391
391
|
"reflect": false
|
|
392
392
|
},
|
|
393
393
|
"step": {
|
|
@@ -421,7 +421,7 @@ export class MdsInput {
|
|
|
421
421
|
}
|
|
422
422
|
},
|
|
423
423
|
"required": false,
|
|
424
|
-
"optional":
|
|
424
|
+
"optional": true,
|
|
425
425
|
"docs": {
|
|
426
426
|
"tags": [],
|
|
427
427
|
"text": "Specifies the type of input element"
|
|
@@ -77,7 +77,7 @@ export default {
|
|
|
77
77
|
control: { type: 'select' },
|
|
78
78
|
description: 'Sets the variant of the input field',
|
|
79
79
|
},
|
|
80
|
-
|
|
80
|
+
tip: {
|
|
81
81
|
type: { name: 'string' },
|
|
82
82
|
description: 'Sets the message of the variant of the input field',
|
|
83
83
|
},
|
|
@@ -130,11 +130,16 @@ readOnly.args = {
|
|
|
130
130
|
readOnly: true,
|
|
131
131
|
value: 'This is a read only field',
|
|
132
132
|
};
|
|
133
|
-
export const
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
export const variant = Template.bind({});
|
|
134
|
+
variant.args = {
|
|
135
|
+
variant: 'error',
|
|
136
136
|
placeholder: 'Status input field',
|
|
137
|
-
|
|
137
|
+
tip: 'errore',
|
|
138
|
+
};
|
|
139
|
+
export const tip = Template.bind({});
|
|
140
|
+
tip.args = {
|
|
141
|
+
placeholder: 'Scrivi qualcosa...',
|
|
142
|
+
tip: 'input',
|
|
138
143
|
};
|
|
139
144
|
export const search = Template.bind({});
|
|
140
145
|
search.args = {
|
|
@@ -2,12 +2,13 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
|
|
3
3
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
4
4
|
|
|
5
|
-
const mdsInputCss = "*.sc-mds-input,.sc-mds-input::before,.sc-mds-input::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.sc-mds-input::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.sc-mds-input::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}@tailwind utilities; .sc-mds-input-h{--icon-color:rgb(var(--tone-neutral));--background:rgb(var(--tone-neutral));--variant-color:0, 0, 0;--ring:0 0 0 1px rgba(var(--variant-color), 0.1);--shadow:0 1px 3px 0 rgba(var(--variant-color), 0.1), 0 1px 2px 0 rgba(var(--variant-color), 0.06);font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:relative;display:-ms-flexbox;display:flex}.input.sc-mds-input{font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0px;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:3rem;width:100%;overflow:hidden;text-overflow:ellipsis;border-radius:0.5rem;border-style:none;border-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;--tw-text-opacity:1;color:rgba(var(--tone-neutral-02), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);background-color:var(--background);-webkit-box-shadow:var(--ring), var(--shadow);box-shadow:var(--ring), var(--shadow)}textarea.input.sc-mds-input:active{-webkit-transition-property:none;transition-property:none}textarea.input.sc-mds-input{max-height:16rem;min-height:6rem;border-bottom-right-radius:0px}.input.sc-mds-input:focus{outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);--variant-color:10, 80, 212;--ring:0 0 0 3px rgba(var(--variant-color), 1);--shadow:0 4px 6px -1px rgba(var(--variant-color), 0.1), 0 2px 4px -1px rgba(var(--variant-color), 0.06);-webkit-box-shadow:var(--ring), var(--shadow);box-shadow:var(--ring), var(--shadow)}.input.sc-mds-input:disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-10), var(--tw-bg-opacity))}.input.sc-mds-input:disabled::-moz-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.sc-mds-input:disabled::-webkit-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.sc-mds-input:disabled:-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.sc-mds-input:disabled::-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.sc-mds-input:disabled,.input.sc-mds-input:disabled::placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.has-icon.sc-mds-input{padding-left:2.75rem}.tip.sc-mds-input,.tip-variant.sc-mds-input{pointer-events:none;position:absolute;right:0.25rem;height:0.75rem;-ms-flex-pack:center;justify-content:center;border-radius:9999px;padding-left:0.5rem;padding-right:0.5rem;text-align:center;--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);line-height:0.75rem}.read-only.sc-mds-input{--tw-bg-opacity:1;background-color:rgba(var(--status-info-05), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--status-info-09), var(--tw-text-opacity))}.required.sc-mds-input{width:0.75rem;--tw-bg-opacity:1;background-color:rgba(var(--status-error-05), var(--tw-bg-opacity));padding:0px;color:rgba(var(--tone-neutral), var(--tw-text-opacity));--tw-text-opacity:0}.disabled.sc-mds-input{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-05), var(--tw-bg-opacity))}.input.sc-mds-input:focus+.required.sc-mds-input{width:6rem;--tw-text-opacity:1}.icon.sc-mds-input{position:absolute;left:0.75rem;top:0.75rem;fill:rgb(var(--brand-maggioli-04))}.fixed.sc-mds-input{position:fixed}.absolute.sc-mds-input{position:absolute}.top-1.sc-mds-input{top:0.25rem}.bottom-1.sc-mds-input{bottom:0.25rem}.flex.sc-mds-input{display:-ms-flexbox;display:flex}.w-min.sc-mds-input{width:-moz-min-content;width:-webkit-min-content;width:min-content}.flex-col.sc-mds-input{-ms-flex-direction:column;flex-direction:column}.gap-y-2.sc-mds-input{row-gap:0.5rem}.border.sc-mds-input{border-width:1px}.sc-mds-input-h(.sc-mds-input [variant=info].sc-mds-input).sc-mds-input{--variant-color:30, 174, 221}.sc-mds-input-h(.sc-mds-input [variant=info].sc-mds-input).sc-mds-input .tip-variant.sc-mds-input{--tw-bg-opacity:1;background-color:rgba(var(--status-info-06), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=info].sc-mds-input).sc-mds-input .icon.sc-mds-input{--tw-text-opacity:1;color:rgba(var(--status-info-06), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=success].sc-mds-input).sc-mds-input{--variant-color:32, 184, 111}.sc-mds-input-h(.sc-mds-input [variant=success].sc-mds-input).sc-mds-input .tip-variant.sc-mds-input{--tw-bg-opacity:1;background-color:rgba(var(--status-success-06), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=success].sc-mds-input).sc-mds-input .icon.sc-mds-input{--tw-text-opacity:1;color:rgba(var(--status-success-06), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=warning].sc-mds-input).sc-mds-input{--variant-color:204, 153, 0}.sc-mds-input-h(.sc-mds-input [variant=warning].sc-mds-input).sc-mds-input .tip-variant.sc-mds-input{--tw-bg-opacity:1;background-color:rgba(var(--status-warning-06), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=warning].sc-mds-input).sc-mds-input .icon.sc-mds-input{--tw-text-opacity:1;color:rgba(var(--status-warning-06), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=error].sc-mds-input).sc-mds-input{--variant-color:158, 21, 18}.sc-mds-input-h(.sc-mds-input [variant=error].sc-mds-input).sc-mds-input .tip-variant.sc-mds-input{--tw-bg-opacity:1;background-color:rgba(var(--status-error-06), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity))}.sc-mds-input-h(.sc-mds-input [variant=error].sc-mds-input).sc-mds-input .icon.sc-mds-input{--tw-text-opacity:1;color:rgba(var(--status-error-06), var(--tw-text-opacity))}";
|
|
5
|
+
const mdsInputCss = "*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}@tailwind utilities; :host{--mds-input-background:rgb(var(--tone-neutral));--mds-input-icon-color:var(--mds-input-variant-color);--mds-input-tip-background:84, 84, 84;--mds-input-ring:0 0 0 1px rgba(var(--mds-input-variant-color), 0.1);--mds-input-shadow:0 1px 3px 0 rgba(var(--mds-input-variant-color), 0.1), 0 1px 2px 0 rgba(var(--mds-input-variant-color), 0.06);--mds-input-variant-color:0, 0, 0;font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:relative;display:-ms-flexbox;display:flex}.input{font-family:Karla, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', 'Helvetica Neue', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0px;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:3rem;width:100%;overflow:hidden;text-overflow:ellipsis;border-radius:0.5rem;border-style:none;border-color:transparent;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;--tw-text-opacity:1;color:rgba(var(--tone-neutral-02), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);background-color:var(--mds-input-background);-webkit-box-shadow:var(--mds-input-ring), var(--mds-input-shadow);box-shadow:var(--mds-input-ring), var(--mds-input-shadow)}textarea.input:active{-webkit-transition-property:none;transition-property:none}textarea.input{max-height:16rem;min-height:6rem;border-bottom-right-radius:0px}.input:focus{outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);--mds-input-ring:0 0 0 3px rgba(var(--mds-input-variant-color), 1);--mds-input-shadow:0 4px 6px -1px rgba(var(--mds-input-variant-color), 0.1), 0 2px 4px -1px rgba(var(--mds-input-variant-color), 0.06)}.input:disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-10), var(--tw-bg-opacity))}.input:disabled::-moz-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled::-webkit-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled:-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled::-ms-input-placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input:disabled,.input:disabled::placeholder{--tw-text-opacity:1;color:rgba(var(--tone-neutral-05), var(--tw-text-opacity))}.input.has-icon{padding-left:2.75rem}.tip{pointer-events:none;position:absolute;right:0.25rem;height:0.75rem;-ms-flex-pack:center;justify-content:center;border-radius:9999px;padding-left:0.5rem;padding-right:0.5rem;text-align:center;--tw-text-opacity:1;color:rgba(var(--tone-neutral), var(--tw-text-opacity));-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);line-height:0.75rem;background-color:rgb(var(--mds-input-tip-background))}.tip-variant{--mds-input-tip-background:var(--mds-input-icon-color)}.read-only{--tw-bg-opacity:1;background-color:rgba(var(--status-info-05), var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--status-info-09), var(--tw-text-opacity))}.required{width:0.75rem;--tw-bg-opacity:1;background-color:rgba(var(--status-error-05), var(--tw-bg-opacity));padding:0px;color:rgba(var(--tone-neutral), var(--tw-text-opacity));--tw-text-opacity:0}.disabled{--tw-bg-opacity:1;background-color:rgba(var(--tone-neutral-05), var(--tw-bg-opacity))}.input:focus+.required{width:6rem;--tw-text-opacity:1}.icon{position:absolute;left:0.75rem;top:0.75rem;fill:rgb(var(--mds-input-icon-color))}.fixed{position:fixed}.absolute{position:absolute}.top-1{top:0.25rem}.bottom-1{bottom:0.25rem}.flex{display:-ms-flexbox;display:flex}.w-min{width:-moz-min-content;width:-webkit-min-content;width:min-content}.flex-col{-ms-flex-direction:column;flex-direction:column}.gap-y-2{row-gap:0.5rem}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-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{--mds-input-icon-color:10, 80, 212;--mds-input-variant-color:0, 0, 0}:host(:focus){--mds-input-variant-color:31, 101, 232;}:host([variant=info]){--mds-input-icon-color:25, 143, 182;--mds-input-variant-color:0, 0, 0}:host([variant=info]:focus){--mds-input-icon-color:21, 119, 151;--mds-input-variant-color:25, 143, 182;}:host([variant=success]){--mds-input-icon-color:26, 151, 91;--mds-input-variant-color:0, 0, 0}:host([variant=success]:focus){--mds-input-icon-color:22, 125, 76;--mds-input-variant-color:26, 151, 91;}:host([variant=warning]){--mds-input-icon-color:168, 126, 0;--mds-input-variant-color:0, 0, 0}:host([variant=warning]:focus){--mds-input-icon-color:139, 104, 0;--mds-input-variant-color:168, 126, 0;}:host([variant=error]){--mds-input-icon-color:234, 77, 73;--mds-input-variant-color:0, 0, 0}:host([variant=error]:focus){--mds-input-icon-color:215, 29, 25;--mds-input-variant-color:234, 77, 73;}";
|
|
6
6
|
|
|
7
7
|
const MdsInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
8
|
constructor() {
|
|
9
9
|
super();
|
|
10
10
|
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
11
12
|
this.changeEvent = createEvent(this, "changeEvent", 7);
|
|
12
13
|
this.keyDownEvent = createEvent(this, "keyDownEvent", 7);
|
|
13
14
|
this.blurEvent = createEvent(this, "blurEvent", 7);
|
|
@@ -51,7 +52,7 @@ const MdsInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
51
52
|
this.readonly = false;
|
|
52
53
|
this.required = false;
|
|
53
54
|
this.variant = undefined;
|
|
54
|
-
this.
|
|
55
|
+
this.tip = undefined;
|
|
55
56
|
this.step = undefined;
|
|
56
57
|
this.type = 'text';
|
|
57
58
|
this.value = '';
|
|
@@ -96,7 +97,7 @@ const MdsInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
96
97
|
const value = this.getValue();
|
|
97
98
|
return (h(Host, null, this.type === 'textarea'
|
|
98
99
|
? h("textarea", { class: clsx('input', this.icon && 'has-icon'), autoFocus: this.autofocus, disabled: this.disabled, maxLength: this.maxlength, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, placeholder: this.placeholder || '', readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, tabIndex: this.tabindex, value: value })
|
|
99
|
-
: h("input", { class: clsx('input', this.icon && 'has-icon'), autoComplete: this.autocomplete, autoFocus: this.autofocus, disabled: this.disabled, max: this.max, maxLength: this.maxlength, min: this.min, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, pattern: this.pattern, list: this.datalist && 'datalist', placeholder: this.placeholder || '', readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, step: this.step, tabIndex: this.tabindex, type: this.type, value: value }), this.
|
|
100
|
+
: h("input", { class: clsx('input', this.icon && 'has-icon'), autoComplete: this.autocomplete, autoFocus: this.autofocus, disabled: this.disabled, max: this.max, maxLength: this.maxlength, min: this.min, minLength: this.minlength, name: this.name, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, pattern: this.pattern, list: this.datalist && 'datalist', placeholder: this.placeholder || '', readOnly: this.readonly, ref: input => (this.nativeInput = input), required: this.required, step: this.step, tabIndex: this.tabindex, type: this.type, value: value }), this.disabled && h("mds-text", { typography: "option", class: "tip top-1 disabled" }, "Disabilitato"), this.readonly && !this.disabled && h("mds-text", { typography: "option", class: "tip top-1 read-only" }, "Sola lettura"), this.required && !this.disabled && !this.readonly && h("mds-text", { typography: "option", class: "tip top-1 required" }, "Obbligatorio"), this.tip && h("mds-text", { typography: "option", class: clsx('tip bottom-1', this.variant && 'tip-variant') }, this.tip), this.datalist &&
|
|
100
101
|
h("datalist", { id: "datalist", class: "datalist" }, this.datalist.forEach(element => {
|
|
101
102
|
h("option", { value: element });
|
|
102
103
|
})), this.icon && h("mds-icon", { class: clsx('icon', this.variant), name: this.icon })));
|
|
@@ -106,7 +107,7 @@ const MdsInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
106
107
|
"value": ["valueChanged"]
|
|
107
108
|
}; }
|
|
108
109
|
static get style() { return mdsInputCss; }
|
|
109
|
-
}, [
|
|
110
|
+
}, [1, "mds-input", {
|
|
110
111
|
"autocomplete": [1],
|
|
111
112
|
"autofocus": [4],
|
|
112
113
|
"datalist": [16],
|
|
@@ -122,7 +123,7 @@ const MdsInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
122
123
|
"readonly": [4],
|
|
123
124
|
"required": [4],
|
|
124
125
|
"variant": [513],
|
|
125
|
-
"
|
|
126
|
+
"tip": [1],
|
|
126
127
|
"step": [1],
|
|
127
128
|
"type": [1],
|
|
128
129
|
"value": [8],
|