@sula-tech/webcomponents 0.7.6 → 0.8.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.
Files changed (29) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/sula-avatar_18.cjs.entry.js +246 -2
  3. package/dist/cjs/sula-avatar_18.cjs.entry.js.map +1 -1
  4. package/dist/cjs/webcomponents.cjs.js +1 -1
  5. package/dist/collection/components/sula-textfield/sula-textfield.js +31 -2
  6. package/dist/collection/components/sula-textfield/sula-textfield.js.map +1 -1
  7. package/dist/collection/components/sula-textfield/sula-textfield.stories.js +22 -0
  8. package/dist/collection/components/sula-textfield/sula-textfield.stories.js.map +1 -1
  9. package/dist/components/p-B85MJLTf.js +8 -0
  10. package/dist/components/p-B85MJLTf.js.map +1 -0
  11. package/dist/components/{p-DoGc7jLn.js → p-DrUsgtsv.js} +3 -6
  12. package/dist/components/p-DrUsgtsv.js.map +1 -0
  13. package/dist/components/sula-button.js +1 -1
  14. package/dist/components/sula-loader.js +1 -1
  15. package/dist/components/sula-textfield.js +248 -2
  16. package/dist/components/sula-textfield.js.map +1 -1
  17. package/dist/esm/loader.js +1 -1
  18. package/dist/esm/sula-avatar_18.entry.js +246 -2
  19. package/dist/esm/sula-avatar_18.entry.js.map +1 -1
  20. package/dist/esm/webcomponents.js +1 -1
  21. package/dist/types/components/sula-textfield/sula-textfield.d.ts +7 -0
  22. package/dist/types/components/sula-textfield/sula-textfield.stories.d.ts +9 -0
  23. package/dist/types/components.d.ts +8 -0
  24. package/dist/webcomponents/{p-af46ad3b.entry.js → p-bc1f174c.entry.js} +209 -13
  25. package/dist/webcomponents/p-bc1f174c.entry.js.map +1 -0
  26. package/dist/webcomponents/webcomponents.esm.js +2 -1
  27. package/package.json +3 -2
  28. package/dist/components/p-DoGc7jLn.js.map +0 -1
  29. package/dist/webcomponents/p-af46ad3b.entry.js.map +0 -1
@@ -5,7 +5,7 @@ var index = require('./index-Bbryl0vg.js');
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await index.globalScripts();
8
- return index.bootstrapLazy([["sula-avatar_18.cjs",[[1,"sula-button",{"text":[1025],"icon":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"appearance":[1025],"type":[1025],"size":[1025],"status":[1025],"loading":[1028],"buttonDisabled":[1028,"button-disabled"],"fullWidth":[1028,"full-width"]}],[1,"sula-chip",{"text":[1025],"appearance":[1025],"disabled":[1028],"items":[1040],"isFocused":[32],"showItems":[32]},[[4,"click","handleDocumentClick"]]],[1,"sula-dropdown",{"label":[1025],"disabled":[1028],"items":[1040],"value":[1040],"selectedItem":[32],"showItems":[32],"isFocused":[32]},[[4,"click","handleDocumentClick"]],{"value":["handleValueChange"]}],[1,"sula-avatar",{"size":[1],"imageUrl":[1,"image-url"],"text":[1],"icon":[1]}],[1,"sula-badge",{"status":[1025],"size":[1025],"type":[1025],"text":[1025],"icon":[1025],"hasSlotContent":[32]}],[1,"sula-checkbox",{"type":[1025],"label":[1025],"subTitle":[1025,"sub-title"],"disabled":[1028],"checked":[1028],"isFocus":[32]}],[1,"sula-progress-bar",{"appearance":[1025],"state":[1025],"topLabel":[1025,"top-label"],"bottomLabel":[1025,"bottom-label"],"progress":[1026],"showProgress":[1028,"show-progress"]},null,{"progress":["validateProgress"]}],[1,"sula-search-bar",{"value":[1025],"searchBarStyle":[1025,"search-bar-style"],"placeholder":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"isFocused":[32],"textValue":[32]}],[1,"sula-tag",{"label":[1025],"icon":[1025],"iconStatus":[1025,"icon-status"],"size":[1025],"appearance":[1025],"fontWeight":[1025,"font-weight"]}],[1,"sula-textfield",{"value":[1025],"type":[1],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"icon":[1],"inputIsOpen":[32],"textValue":[32],"showPassword":[32],"inputIsFocused":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-tiles",{"type":[1],"size":[1],"ellipsis":[4],"icon":[1],"text":[1],"subText":[1,"sub-text"],"disabled":[4]}],[1,"sula-timeline-list",{"sulaTimelineList":[1040,"sula-timeline-list"]}],[1,"sula-radio-button",{"checked":[1028],"label":[1025],"disabled":[1028],"radioIsFocus":[32]}],[1,"sula-switch",{"type":[1025],"active":[1028],"disabled":[1028],"label":[1025],"subTitle":[1025,"sub-title"],"isFocus":[32]}],[1,"sula-textarea",{"value":[1025],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"rows":[2],"isActive":[32],"textValue":[32],"textareaIsFocused":[32],"labelPadding":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-loader",{"size":[1],"animationInstance":[32]}],[1,"sula-menu-select-list",{"items":[1040],"fullWidth":[4,"full-width"]}],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
8
+ return index.bootstrapLazy([["sula-avatar_18.cjs",[[1,"sula-button",{"text":[1025],"icon":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"appearance":[1025],"type":[1025],"size":[1025],"status":[1025],"loading":[1028],"buttonDisabled":[1028,"button-disabled"],"fullWidth":[1028,"full-width"]}],[1,"sula-chip",{"text":[1025],"appearance":[1025],"disabled":[1028],"items":[1040],"isFocused":[32],"showItems":[32]},[[4,"click","handleDocumentClick"]]],[1,"sula-dropdown",{"label":[1025],"disabled":[1028],"items":[1040],"value":[1040],"selectedItem":[32],"showItems":[32],"isFocused":[32]},[[4,"click","handleDocumentClick"]],{"value":["handleValueChange"]}],[1,"sula-avatar",{"size":[1],"imageUrl":[1,"image-url"],"text":[1],"icon":[1]}],[1,"sula-badge",{"status":[1025],"size":[1025],"type":[1025],"text":[1025],"icon":[1025],"hasSlotContent":[32]}],[1,"sula-checkbox",{"type":[1025],"label":[1025],"subTitle":[1025,"sub-title"],"disabled":[1028],"checked":[1028],"isFocus":[32]}],[1,"sula-progress-bar",{"appearance":[1025],"state":[1025],"topLabel":[1025,"top-label"],"bottomLabel":[1025,"bottom-label"],"progress":[1026],"showProgress":[1028,"show-progress"]},null,{"progress":["validateProgress"]}],[1,"sula-search-bar",{"value":[1025],"searchBarStyle":[1025,"search-bar-style"],"placeholder":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"isFocused":[32],"textValue":[32]}],[1,"sula-tag",{"label":[1025],"icon":[1025],"iconStatus":[1025,"icon-status"],"size":[1025],"appearance":[1025],"fontWeight":[1025,"font-weight"]}],[1,"sula-textfield",{"value":[1025],"type":[1],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"icon":[1],"maskPattern":[1,"mask-pattern"],"inputIsOpen":[32],"textValue":[32],"showPassword":[32],"inputIsFocused":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-tiles",{"type":[1],"size":[1],"ellipsis":[4],"icon":[1],"text":[1],"subText":[1,"sub-text"],"disabled":[4]}],[1,"sula-timeline-list",{"sulaTimelineList":[1040,"sula-timeline-list"]}],[1,"sula-radio-button",{"checked":[1028],"label":[1025],"disabled":[1028],"radioIsFocus":[32]}],[1,"sula-switch",{"type":[1025],"active":[1028],"disabled":[1028],"label":[1025],"subTitle":[1025,"sub-title"],"isFocus":[32]}],[1,"sula-textarea",{"value":[1025],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"rows":[2],"isActive":[32],"textValue":[32],"textareaIsFocused":[32],"labelPadding":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-loader",{"size":[1],"animationInstance":[32]}],[1,"sula-menu-select-list",{"items":[1040],"fullWidth":[4,"full-width"]}],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
9
9
  };
10
10
 
11
11
  exports.setNonce = index.setNonce;
@@ -28310,6 +28310,241 @@ var SulaTextfieldStatus;
28310
28310
  SulaTextfieldStatus["Error"] = "error";
28311
28311
  })(SulaTextfieldStatus || (SulaTextfieldStatus = {}));
28312
28312
 
28313
+ var vanillaMasker$1 = {exports: {}};
28314
+
28315
+ var vanillaMasker = vanillaMasker$1.exports;
28316
+
28317
+ var hasRequiredVanillaMasker;
28318
+
28319
+ function requireVanillaMasker () {
28320
+ if (hasRequiredVanillaMasker) return vanillaMasker$1.exports;
28321
+ hasRequiredVanillaMasker = 1;
28322
+ (function (module, exports) {
28323
+ (function(root, factory) {
28324
+ {
28325
+ module.exports = factory();
28326
+ }
28327
+ }(vanillaMasker, function() {
28328
+ var DIGIT = "9",
28329
+ ALPHA = "A",
28330
+ ALPHANUM = "S",
28331
+ BY_PASS_KEYS = [9, 16, 17, 18, 36, 37, 38, 39, 40, 91, 92, 93],
28332
+ isAllowedKeyCode = function(keyCode) {
28333
+ for (var i = 0, len = BY_PASS_KEYS.length; i < len; i++) {
28334
+ if (keyCode == BY_PASS_KEYS[i]) {
28335
+ return false;
28336
+ }
28337
+ }
28338
+ return true;
28339
+ },
28340
+ mergeMoneyOptions = function(opts) {
28341
+ opts = opts || {};
28342
+ opts = {
28343
+ delimiter: opts.delimiter || ".",
28344
+ lastOutput: opts.lastOutput,
28345
+ precision: opts.hasOwnProperty("precision") ? opts.precision : 2,
28346
+ separator: opts.separator || ",",
28347
+ showSignal: opts.showSignal,
28348
+ suffixUnit: opts.suffixUnit && (" " + opts.suffixUnit.replace(/[\s]/g,'')) || "",
28349
+ unit: opts.unit && (opts.unit.replace(/[\s]/g,'') + " ") || "",
28350
+ zeroCents: opts.zeroCents
28351
+ };
28352
+ opts.moneyPrecision = opts.zeroCents ? 0 : opts.precision;
28353
+ return opts;
28354
+ },
28355
+ // Fill wildcards past index in output with placeholder
28356
+ addPlaceholdersToOutput = function(output, index, placeholder) {
28357
+ for (; index < output.length; index++) {
28358
+ if(output[index] === DIGIT || output[index] === ALPHA || output[index] === ALPHANUM) {
28359
+ output[index] = placeholder;
28360
+ }
28361
+ }
28362
+ return output;
28363
+ }
28364
+ ;
28365
+
28366
+ var VanillaMasker = function(elements) {
28367
+ this.elements = elements;
28368
+ };
28369
+
28370
+ VanillaMasker.prototype.unbindElementToMask = function() {
28371
+ for (var i = 0, len = this.elements.length; i < len; i++) {
28372
+ this.elements[i].lastOutput = "";
28373
+ this.elements[i].onkeyup = false;
28374
+ this.elements[i].onkeydown = false;
28375
+
28376
+ if (this.elements[i].value.length) {
28377
+ this.elements[i].value = this.elements[i].value.replace(/\D/g, '');
28378
+ }
28379
+ }
28380
+ };
28381
+
28382
+ VanillaMasker.prototype.bindElementToMask = function(maskFunction) {
28383
+ var that = this,
28384
+ onType = function(e) {
28385
+ e = e || window.event;
28386
+ var source = e.target || e.srcElement;
28387
+
28388
+ if (isAllowedKeyCode(e.keyCode)) {
28389
+ setTimeout(function() {
28390
+ that.opts.lastOutput = source.lastOutput;
28391
+ source.value = VMasker[maskFunction](source.value, that.opts);
28392
+ source.lastOutput = source.value;
28393
+ if (source.setSelectionRange && that.opts.suffixUnit) {
28394
+ source.setSelectionRange(source.value.length, (source.value.length - that.opts.suffixUnit.length));
28395
+ }
28396
+ }, 0);
28397
+ }
28398
+ }
28399
+ ;
28400
+ for (var i = 0, len = this.elements.length; i < len; i++) {
28401
+ this.elements[i].lastOutput = "";
28402
+ this.elements[i].onkeyup = onType;
28403
+ if (this.elements[i].value.length) {
28404
+ this.elements[i].value = VMasker[maskFunction](this.elements[i].value, this.opts);
28405
+ }
28406
+ }
28407
+ };
28408
+
28409
+ VanillaMasker.prototype.maskMoney = function(opts) {
28410
+ this.opts = mergeMoneyOptions(opts);
28411
+ this.bindElementToMask("toMoney");
28412
+ };
28413
+
28414
+ VanillaMasker.prototype.maskNumber = function() {
28415
+ this.opts = {};
28416
+ this.bindElementToMask("toNumber");
28417
+ };
28418
+
28419
+ VanillaMasker.prototype.maskAlphaNum = function() {
28420
+ this.opts = {};
28421
+ this.bindElementToMask("toAlphaNumeric");
28422
+ };
28423
+
28424
+ VanillaMasker.prototype.maskPattern = function(pattern) {
28425
+ this.opts = {pattern: pattern};
28426
+ this.bindElementToMask("toPattern");
28427
+ };
28428
+
28429
+ VanillaMasker.prototype.unMask = function() {
28430
+ this.unbindElementToMask();
28431
+ };
28432
+
28433
+ var VMasker = function(el) {
28434
+ if (!el) {
28435
+ throw new Error("VanillaMasker: There is no element to bind.");
28436
+ }
28437
+ var elements = ("length" in el) ? (el.length ? el : []) : [el];
28438
+ return new VanillaMasker(elements);
28439
+ };
28440
+
28441
+ VMasker.toMoney = function(value, opts) {
28442
+ opts = mergeMoneyOptions(opts);
28443
+ if (opts.zeroCents) {
28444
+ opts.lastOutput = opts.lastOutput || "";
28445
+ var zeroMatcher = ("("+ opts.separator +"[0]{0,"+ opts.precision +"})"),
28446
+ zeroRegExp = new RegExp(zeroMatcher, "g"),
28447
+ digitsLength = value.toString().replace(/[\D]/g, "").length || 0,
28448
+ lastDigitLength = opts.lastOutput.toString().replace(/[\D]/g, "").length || 0
28449
+ ;
28450
+ value = value.toString().replace(zeroRegExp, "");
28451
+ if (digitsLength < lastDigitLength) {
28452
+ value = value.slice(0, value.length - 1);
28453
+ }
28454
+ }
28455
+ var number = value.toString().replace(/[\D]/g, ""),
28456
+ clearDelimiter = new RegExp("^(0|\\"+ opts.delimiter +")"),
28457
+ clearSeparator = new RegExp("(\\"+ opts.separator +")$"),
28458
+ money = number.substr(0, number.length - opts.moneyPrecision),
28459
+ masked = money.substr(0, money.length % 3),
28460
+ cents = new Array(opts.precision + 1).join("0")
28461
+ ;
28462
+ money = money.substr(money.length % 3, money.length);
28463
+ for (var i = 0, len = money.length; i < len; i++) {
28464
+ if (i % 3 === 0) {
28465
+ masked += opts.delimiter;
28466
+ }
28467
+ masked += money[i];
28468
+ }
28469
+ masked = masked.replace(clearDelimiter, "");
28470
+ masked = masked.length ? masked : "0";
28471
+ var signal = "";
28472
+ if(opts.showSignal === true) {
28473
+ signal = value < 0 || (value.startsWith && value.startsWith('-')) ? "-" : "";
28474
+ }
28475
+ if (!opts.zeroCents) {
28476
+ var beginCents = number.length - opts.precision,
28477
+ centsValue = number.substr(beginCents, opts.precision),
28478
+ centsLength = centsValue.length,
28479
+ centsSliced = (opts.precision > centsLength) ? opts.precision : centsLength
28480
+ ;
28481
+ cents = (cents + centsValue).slice(-centsSliced);
28482
+ }
28483
+ var output = opts.unit + signal + masked + opts.separator + cents;
28484
+ return output.replace(clearSeparator, "") + opts.suffixUnit;
28485
+ };
28486
+
28487
+ VMasker.toPattern = function(value, opts) {
28488
+ var pattern = (typeof opts === 'object' ? opts.pattern : opts),
28489
+ patternChars = pattern.replace(/\W/g, ''),
28490
+ output = pattern.split(""),
28491
+ values = value.toString().replace(/\W/g, ""),
28492
+ charsValues = values.replace(/\W/g, ''),
28493
+ index = 0,
28494
+ i,
28495
+ outputLength = output.length,
28496
+ placeholder = (typeof opts === 'object' ? opts.placeholder : undefined)
28497
+ ;
28498
+
28499
+ for (i = 0; i < outputLength; i++) {
28500
+ // Reached the end of input
28501
+ if (index >= values.length) {
28502
+ if (patternChars.length == charsValues.length) {
28503
+ return output.join("");
28504
+ }
28505
+ else if ((placeholder !== undefined) && (patternChars.length > charsValues.length)) {
28506
+ return addPlaceholdersToOutput(output, i, placeholder).join("");
28507
+ }
28508
+ else {
28509
+ break;
28510
+ }
28511
+ }
28512
+ // Remaining chars in input
28513
+ else {
28514
+ if ((output[i] === DIGIT && values[index].match(/[0-9]/)) ||
28515
+ (output[i] === ALPHA && values[index].match(/[a-zA-Z]/)) ||
28516
+ (output[i] === ALPHANUM && values[index].match(/[0-9a-zA-Z]/))) {
28517
+ output[i] = values[index++];
28518
+ } else if (output[i] === DIGIT || output[i] === ALPHA || output[i] === ALPHANUM) {
28519
+ if(placeholder !== undefined){
28520
+ return addPlaceholdersToOutput(output, i, placeholder).join("");
28521
+ }
28522
+ else {
28523
+ return output.slice(0, i).join("");
28524
+ }
28525
+ }
28526
+ }
28527
+ }
28528
+ return output.join("").substr(0, i);
28529
+ };
28530
+
28531
+ VMasker.toNumber = function(value) {
28532
+ return value.toString().replace(/(?!^-)[^0-9]/g, "");
28533
+ };
28534
+
28535
+ VMasker.toAlphaNumeric = function(value) {
28536
+ return value.toString().replace(/[^a-z0-9 ]+/i, "");
28537
+ };
28538
+
28539
+ return VMasker;
28540
+ }));
28541
+ } (vanillaMasker$1));
28542
+ return vanillaMasker$1.exports;
28543
+ }
28544
+
28545
+ var vanillaMaskerExports = requireVanillaMasker();
28546
+ var VMasker = /*@__PURE__*/getDefaultExportFromCjs(vanillaMaskerExports);
28547
+
28313
28548
  const sulaTextfieldCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--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:rgba(147,197,253,.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;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--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:rgba(147,197,253,.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;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.outline{outline-style:solid}:host{display:block}.button-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}.button-error{outline:2px solid var(--color-feedback-error)!important;outline-offset:2px!important}.from-down{animation:from-down .2s ease-in-out}.from-up{animation:from-up .2s ease-in-out}@keyframes from-down{0%{opacity:0;transform:translateY(75%)}to{opacity:1;transform:translateY(0)}}@keyframes from-up{0%{opacity:0;transform:translateY(-75%)}to{opacity:1;transform:translateY(0)}}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#02361a;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#500202;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#683f08;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#691e07;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#6a3b01;--color-gray-50:#fff;--color-gray-100:#f4f4f4;--color-gray-200:#e6e6e6;--color-gray-300:#c3c3c3;--color-gray-400:#b9b9b9;--color-gray-500:#949494;--color-gray-600:#737373;--color-gray-700:#5c5c5c;--color-gray-800:#323232;--color-gray-900:#292929;--color-gray-950:#141414;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#0a2e61;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:#14141405;--color-black-opacity-100:#1414141a;--color-black-opacity-200:#14141426;--color-black-opacity-300:#14141445;--color-black-opacity-400:#1414145c;--color-black-opacity-500:#14141480;--color-black-opacity-600:#1414148c;--color-black-opacity-700:#141414a3;--color-black-opacity-800:#141414ba;--color-black-opacity-900:#141414cc;--color-black-opacity-950:#141414e8;--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f4f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#323232;--color-text-secondary:#5c5c5c;--color-text-disabled:#949494;--color-text-link:#1355b4;--color-states-empty-bg-hover:#1414141a;--color-states-empty-bg-pressed:#14141426;--color-states-bg-disabled:#14141405;--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e6e6e6;--color-states-negative-pressed:#c3c3c3;--color-icon-primary:#5c5c5c;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#b9b9b9;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f4f4f4;--color-neutral-neutral-3:#b9b9b9;--color-neutral-neutral-4:#949494;--color-neutral-neutral-5:#737373;--color-neutral-neutral-6:#5c5c5c;--color-neutral-neutral-7:#323232;--color-neutral-neutral-8:#292929;--color-negative-negative-1:#fff;--color-negative-negative-2:#323232;--color-opacity-body:#fffc;--color-opacity-on-body:#14141405;--color-opacity-overlay:#1414148c;--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949494;--color-line-general-strong:#c3c3c3;--color-line-general:#e6e6e6}.static{position:static}.mt-4{margin-top:.25rem}.flex{display:flex}.hidden{display:none}.h-\\[72px\\]{height:72px}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.rounded-sm{border-radius:.75rem}.border{border-width:1px}.border-line-general{border-color:var(--color-line-general)}.border-line-input{border-color:var(--color-line-input)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-body{background-color:var(--color-surface-body)}.bg-transparent{background-color:transparent}.px-16{padding-left:1rem;padding-right:1rem}.pr-12{padding-right:.75rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.text-feedback-error{color:var(--color-feedback-error)}.text-icon-disabled{color:var(--color-icon-disabled)}.text-icon-primary{color:var(--color-icon-primary)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.caret-brand-primary{caret-color:var(--color-brand-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}";
28314
28549
 
28315
28550
  const SulaTextfield = class {
@@ -28334,6 +28569,9 @@ const SulaTextfield = class {
28334
28569
  this.toggleOptions(true);
28335
28570
  };
28336
28571
  this.handleInputChanges = (event) => {
28572
+ if (this.maskPattern && this.inputElement) {
28573
+ this.handleInputMask();
28574
+ }
28337
28575
  const newValue = event.target.value;
28338
28576
  this.textValue = newValue;
28339
28577
  this.value = newValue;
@@ -28400,6 +28638,9 @@ const SulaTextfield = class {
28400
28638
  if (this.textValue && this.textValue.trim().length > 0) {
28401
28639
  this.changeElementsStyle();
28402
28640
  }
28641
+ if (this.maskPattern && this.inputElement) {
28642
+ this.handleInputMask();
28643
+ }
28403
28644
  }
28404
28645
  toggleOptions(inputIsOpen) {
28405
28646
  if ((this.inputIsOpen && this.textValue && this.textValue.length > 0) || this.disabled)
@@ -28417,6 +28658,9 @@ const SulaTextfield = class {
28417
28658
  this.labelElement.classList.add('from-up');
28418
28659
  }
28419
28660
  }
28661
+ handleInputMask() {
28662
+ VMasker(this.inputElement).maskPattern(this.maskPattern);
28663
+ }
28420
28664
  handlePasswordIconClicked() {
28421
28665
  const cursorPosition = this.inputElement.selectionStart;
28422
28666
  const inputValue = this.inputElement.value;
@@ -28435,14 +28679,14 @@ const SulaTextfield = class {
28435
28679
  return this.icon;
28436
28680
  }
28437
28681
  render() {
28438
- return (index.h(index.Host, { key: 'db19982329c8a6aa8989b3a68ef61a7453ee4a99', ref: node => (this.node = node) }, index.h("div", { key: 'daf060b490b07b535cb414b11c3c75f307f127aa' }, index.h("div", { key: '1d84aec41f352537a124311c076eceec3271832a', id: "button-container", class: {
28682
+ return (index.h(index.Host, { key: '2287b38b1441da7fcab2caa4dd495bc593a4e268', ref: node => (this.node = node) }, index.h("div", { key: '1e9538652f7a57c1f8a99760028a45726d4cf1b8' }, index.h("div", { key: '48b038746bbe3ba11ea374c7cc5e28cae65d5d30', id: "button-container", class: {
28439
28683
  'flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary': true,
28440
28684
  'flex-row justify-between': !!this.icon || this.type === SulaTextfieldType.Password,
28441
28685
  'button-focus': this.inputIsFocused && !this.disabled && this.status === SulaTextfieldStatus.Default,
28442
28686
  'button-error': this.status === SulaTextfieldStatus.Error && !this.disabled,
28443
28687
  'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,
28444
28688
  'bg-surface-body border-line-input cursor-pointer': !this.disabled,
28445
- }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (index.h("div", { key: '6ec4a250e1bcd8f053b2dba7e6e6fe6842c1b9bf', class: { 'hidden flex-col w-full': true, 'pr-12': !!this.icon }, ref: node => (this.inputContainer = node) }, index.h("label", { key: '001ef2edc750497dc82a65341f98289fd8d28c6d', class: "font-bold text-sm text-text-primary from-down" }, this.label), index.h("input", { key: '96c0725c63ed92ddbc164f8efcdc003707eb0115', type: this.type, ref: node => (this.inputElement = node), placeholder: this.placeholder, class: "outline-none text-base text-text-primary bg-transparent", onInput: this.handleInputChanges, onFocus: this.handleInputFocus, value: this.textValue }))), index.h("div", { key: 'f65cd97f9ddcadcc07789d8d3dc9421e82e31d78', id: "textfield-label", class: { 'text-base flex items-center': true, 'text-text-primary': !this.disabled, 'text-text-disabled': this.disabled }, ref: node => (this.labelElement = node) }, this.label), (!!this.icon || this.type === SulaTextfieldType.Password) && (index.h("div", { key: '27596e159d5bcdd52f587350fa7ed619d5a6346e', class: "flex items-center justify-center", onClick: this.handleIconClick }, index.h("sula-icon", { key: '2fb87a5df61f3ed9f50f404ca8ff2988c71d10a7', icon: this.getInputIcon(), customClass: `text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}` })))), (this.helpText || this.maxLength) && !this.disabled && (index.h("div", { key: 'd54b53d64879e9a454a72c7e6726c8b0f5905baa', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (index.h("div", { key: '7ded73f462e82f41b8766e4654cd47fabf3b3a40', id: "textfield-help-text", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.helpText)), this.maxLength && (index.h("div", { key: 'c62b62d8b8c99a775a31092479f1e4d8f581908c', id: "max-length-container", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.textValue ? this.textValue.length : 0, "/", this.maxLength)))))));
28689
+ }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (index.h("div", { key: '9c4a9e1e7017593db75a77585c1392125b1a98b9', class: { 'hidden flex-col w-full': true, 'pr-12': !!this.icon }, ref: node => (this.inputContainer = node) }, index.h("label", { key: 'd07846ebd85fff94f477f59b512304e00102bb58', class: "font-bold text-sm text-text-primary from-down" }, this.label), index.h("input", { key: '92955b96950cae398681755cec9fcbf0a8327695', type: this.type, ref: node => (this.inputElement = node), placeholder: this.placeholder, class: "outline-none text-base text-text-primary bg-transparent", onInput: this.handleInputChanges, onFocus: this.handleInputFocus, value: this.textValue }))), index.h("div", { key: 'cadc6f4d64f3e85dee539b9bf270a839709c1bfa', id: "textfield-label", class: { 'text-base flex items-center': true, 'text-text-primary': !this.disabled, 'text-text-disabled': this.disabled }, ref: node => (this.labelElement = node) }, this.label), (!!this.icon || this.type === SulaTextfieldType.Password) && (index.h("div", { key: '5f0fee95a1d89743084c86f9b9bdec69b3976da5', class: "flex items-center justify-center", onClick: this.handleIconClick }, index.h("sula-icon", { key: 'a41969ee7b207c6fdcaf43c0345e927a19b58d1c', icon: this.getInputIcon(), customClass: `text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}` })))), (this.helpText || this.maxLength) && !this.disabled && (index.h("div", { key: '14e36d4ee992aeb3ab3341f030fc05231c803e3d', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (index.h("div", { key: 'e4286e8635c5b6f8fc3032359567cbdba2479748', id: "textfield-help-text", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.helpText)), this.maxLength && (index.h("div", { key: 'd2813e234f057e952f85ded243510a4a12a43654', id: "max-length-container", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.textValue ? this.textValue.length : 0, "/", this.maxLength)))))));
28446
28690
  }
28447
28691
  static get watchers() { return {
28448
28692
  "value": ["watchValueHandler"]