@telesign/boreal-web-components 0.1.0-alpha.0 → 0.1.0-alpha.2

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 (91) hide show
  1. package/README.md +202 -0
  2. package/components-build/bds-banner.js +1 -1
  3. package/components-build/{my-component.d.ts → bds-button.d.ts} +4 -4
  4. package/components-build/bds-button.js +1 -0
  5. package/components-build/bds-typography.js +1 -1
  6. package/components-build/index.js +1 -1
  7. package/components-build/p-Ba6iHqJA.js +1 -0
  8. package/components-build/p-DQR-jjOl.js +1 -0
  9. package/custom-elements.json +352 -94
  10. package/dist/boreal-web-components/boreal-web-components.esm.js +1 -1
  11. package/dist/boreal-web-components/boreal-web-components.js +1 -1
  12. package/dist/boreal-web-components/p-08bd6bed.system.entry.js +1 -0
  13. package/dist/boreal-web-components/p-1575fe61.system.entry.js +1 -0
  14. package/dist/boreal-web-components/p-657c12a3.system.entry.js +1 -0
  15. package/dist/boreal-web-components/p-66bb3c44.entry.js +1 -0
  16. package/dist/boreal-web-components/p-742f39ef.entry.js +1 -0
  17. package/dist/boreal-web-components/p-BG1kmb4c.system.js +1 -0
  18. package/dist/boreal-web-components/p-B_tL_RWF.system.js +2 -0
  19. package/dist/boreal-web-components/p-Ba6iHqJA.js +1 -0
  20. package/dist/boreal-web-components/p-DIvR9Mw7.system.js +1 -0
  21. package/dist/boreal-web-components/p-DKPZ4_C0.system.js +1 -0
  22. package/dist/boreal-web-components/p-DQR-jjOl.js +1 -0
  23. package/dist/boreal-web-components/p-DQvmq159.js +2 -0
  24. package/dist/boreal-web-components/p-e4a075ba.entry.js +1 -0
  25. package/dist/cjs/{attributes-RPVEtBdj.js → attributes-D0WPida0.js} +0 -9
  26. package/dist/cjs/bds-banner.cjs.entry.js +4 -3
  27. package/dist/cjs/bds-button.cjs.entry.js +185 -0
  28. package/dist/cjs/bds-typography.cjs.entry.js +10 -9
  29. package/dist/cjs/boreal-web-components.cjs.js +2 -2
  30. package/dist/cjs/{index-Cdb66Tqj.js → index-C9JKWXwa.js} +41 -4
  31. package/dist/cjs/loader.cjs.js +2 -2
  32. package/dist/cjs/states-C03fKOhs.js +12 -0
  33. package/dist/collection/collection-manifest.json +1 -1
  34. package/dist/collection/components/actions/bds-button/bds-button.css +479 -0
  35. package/dist/collection/components/actions/bds-button/bds-button.js +459 -0
  36. package/dist/collection/components/actions/bds-button/types/IButton.js +1 -0
  37. package/dist/collection/components/actions/bds-button/types/enum.js +15 -0
  38. package/dist/collection/components/actions/bds-button/types/types.js +1 -0
  39. package/dist/collection/components/titles-text/bds-typography/bds-typography.js +5 -5
  40. package/dist/collection/components/titles-text/bds-typography/utils/bds-typography-utils.js +5 -5
  41. package/dist/collection/types/coreColors.js +6 -0
  42. package/dist/collection/types/states.js +1 -1
  43. package/dist/collection/utils/helpers/validateProps.js +16 -0
  44. package/dist/esm/{attributes-B9wshZ_4.js → attributes-Ba6iHqJA.js} +1 -8
  45. package/dist/esm/bds-banner.entry.js +3 -2
  46. package/dist/esm/bds-button.entry.js +183 -0
  47. package/dist/esm/bds-typography.entry.js +10 -9
  48. package/dist/esm/boreal-web-components.js +3 -3
  49. package/dist/esm/{index-DgFiTd6X.js → index-DQvmq159.js} +41 -4
  50. package/dist/esm/loader.js +3 -3
  51. package/dist/esm/states-DQR-jjOl.js +9 -0
  52. package/dist/{boreal-web-components/p-B9wshZ_4.js → esm-es5/attributes-Ba6iHqJA.js} +1 -1
  53. package/dist/esm-es5/bds-banner.entry.js +1 -1
  54. package/dist/esm-es5/bds-button.entry.js +1 -0
  55. package/dist/esm-es5/bds-typography.entry.js +1 -1
  56. package/dist/esm-es5/boreal-web-components.js +1 -1
  57. package/dist/esm-es5/index-DQvmq159.js +2 -0
  58. package/dist/esm-es5/loader.js +1 -1
  59. package/dist/esm-es5/states-DQR-jjOl.js +1 -0
  60. package/dist/types/components/actions/bds-button/bds-button.d.ts +90 -0
  61. package/dist/types/components/actions/bds-button/types/IButton.d.ts +14 -0
  62. package/dist/types/components/actions/bds-button/types/enum.d.ts +16 -0
  63. package/dist/types/components/actions/bds-button/types/types.d.ts +5 -0
  64. package/dist/types/components/titles-text/bds-typography/types/ITypography.d.ts +2 -2
  65. package/dist/types/components/titles-text/bds-typography/utils/bds-typography-utils.d.ts +2 -2
  66. package/dist/types/components.d.ts +269 -50
  67. package/dist/types/types/coreColors.d.ts +8 -0
  68. package/dist/types/types/states.d.ts +2 -2
  69. package/dist/types/utils/helpers/validateProps.d.ts +11 -0
  70. package/package.json +4 -3
  71. package/components-build/my-component.js +0 -1
  72. package/components-build/p-B9wshZ_4.js +0 -1
  73. package/dist/boreal-web-components/p-412d037b.system.entry.js +0 -1
  74. package/dist/boreal-web-components/p-527a761b.entry.js +0 -1
  75. package/dist/boreal-web-components/p-5666a22a.system.entry.js +0 -1
  76. package/dist/boreal-web-components/p-BQdH0ijK.system.js +0 -2
  77. package/dist/boreal-web-components/p-CMd-Mv-5.system.js +0 -1
  78. package/dist/boreal-web-components/p-CaVEtaG3.system.js +0 -1
  79. package/dist/boreal-web-components/p-DgFiTd6X.js +0 -2
  80. package/dist/boreal-web-components/p-b818618b.entry.js +0 -1
  81. package/dist/boreal-web-components/p-d596406b.entry.js +0 -1
  82. package/dist/boreal-web-components/p-e37e7dba.system.entry.js +0 -1
  83. package/dist/cjs/my-component.cjs.entry.js +0 -29
  84. package/dist/collection/components/my-component/my-component.css +0 -3
  85. package/dist/collection/components/my-component/my-component.js +0 -95
  86. package/dist/esm/my-component.entry.js +0 -27
  87. package/dist/esm-es5/attributes-B9wshZ_4.js +0 -1
  88. package/dist/esm-es5/index-DgFiTd6X.js +0 -2
  89. package/dist/esm-es5/my-component.entry.js +0 -1
  90. package/dist/types/components/my-component/my-component.d.ts +0 -16
  91. package/readme.md +0 -111
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Cdb66Tqj.js');
4
- var attributes = require('./attributes-RPVEtBdj.js');
3
+ var index = require('./index-C9JKWXwa.js');
4
+ var states = require('./states-C03fKOhs.js');
5
+ var attributes = require('./attributes-D0WPida0.js');
5
6
 
6
7
  const ALIGNMENT = {
7
8
  START: 'start'};
@@ -30,17 +31,17 @@ const FILENAME = 'download';
30
31
  */
31
32
  const VARIANT_CONFIG = {
32
33
  link: {
33
- states: [attributes.STATES.DISABLED /* STATES.VISITED, STATES.HOVER, STATES.ACTIVE, STATES.FOCUS */],
34
+ states: [states.COMPONENT_STATES.DISABLED /* STATES.VISITED, STATES.HOVER, STATES.ACTIVE, STATES.FOCUS */],
34
35
  size: [SIZES.S, SIZES.M],
35
36
  },
36
37
  label: {
37
- states: [attributes.STATES.DISABLED],
38
+ states: [states.COMPONENT_STATES.DISABLED],
38
39
  isRequired: true,
39
40
  canUseTooltip: true,
40
41
  },
41
42
  heading: { canUseTooltip: true },
42
43
  subheading: { canUseTooltip: true },
43
- helper: { states: [attributes.STATES.ERROR] },
44
+ helper: { states: [states.COMPONENT_STATES.ERROR] },
44
45
  display: { size: [SIZES.XS, SIZES.S, SIZES.M, SIZES.L, SIZES.XL] },
45
46
  };
46
47
  /*
@@ -49,7 +50,7 @@ const VARIANT_CONFIG = {
49
50
  const getAttributesByTag = (comp, tagName) => {
50
51
  const ATTR_MAP = {
51
52
  a: {
52
- href: comp.state !== attributes.STATES.DISABLED ? comp.sanitizedHref : null,
53
+ href: comp.state !== states.COMPONENT_STATES.DISABLED ? comp.sanitizedHref : null,
53
54
  target: comp.target,
54
55
  download: comp.isDownloadable ? comp.filename : null,
55
56
  rel: comp.target === '_blank' ? 'noopener noreferrer' : undefined,
@@ -72,7 +73,7 @@ const BdsTypography = class {
72
73
  /** Typography size token. */
73
74
  this.size = SIZES.M;
74
75
  /** Visual state (if supported by variant). */
75
- this.state = attributes.STATES.DEFAULT;
76
+ this.state = states.COMPONENT_STATES.DEFAULT;
76
77
  /** Additional custom CSS class. */
77
78
  this.customClass = '';
78
79
  /** HTML tag used for rendering. */
@@ -128,7 +129,7 @@ const BdsTypography = class {
128
129
  const isInteractiveTag = ['a', 'label'].includes(this.getTagName);
129
130
  return {
130
131
  'aria-required': this.isRequired && isRequired,
131
- 'aria-disabled': this.state === attributes.STATES.DISABLED && isInteractiveTag,
132
+ 'aria-disabled': this.state === states.COMPONENT_STATES.DISABLED && isInteractiveTag,
132
133
  };
133
134
  }
134
135
  getVariantStateStyles() {
@@ -153,7 +154,7 @@ const BdsTypography = class {
153
154
  };
154
155
  const classes = this.getVariantStateStyles();
155
156
  const { canUseTooltip = null, isRequired = null } = this.getVariantConfig();
156
- return (index.h(index.Host, { key: '6091692b1cb6bf1d3295f0834c8d25425633d65a', class: "bds-typography" }, index.h(TagName, { key: '0cc91c35fa1cc36c99101a79fae0c8b5cf44de43', class: classes, style: { webkitLineClamp: this.maxLines }, ...attributes }, index.h("slot", { key: '973848fba8211cb5ef869e0e48fb1806bd5efdec' }), this.isRequired && isRequired && (index.h("em", { key: 'dd89574e9dedd55905ae4c7bcd57604f26fbd03b', class: "bds-typography__required-indicator", "aria-hidden": "true" }, "*")), this.tooltipText && canUseTooltip && index.h("em", { key: '473b0de17bd095b97d54d24d2f3aa75f8a8e4922', class: "bds-typography__info-icon bds-icon-info-circle" }))));
157
+ return (index.h(index.Host, { key: '80c41f5a33f3089005b9cdf2c7db51e07272b5df', class: "bds-typography" }, index.h(TagName, { key: '623e0a57bf2341ecaeba7e670d01a06f891f4423', class: classes, style: { webkitLineClamp: this.maxLines }, ...attributes }, index.h("slot", { key: 'fa7fa6e7f6cbe6133a1c52bf2f219b2927847a88' }), this.isRequired && isRequired && (index.h("em", { key: 'aa339d8fbf758491db17ac9c471327a0466bf3dc', class: "bds-typography__required-indicator", "aria-hidden": "true" }, "*")), this.tooltipText && canUseTooltip && index.h("em", { key: '98a6c58192b585fbbe01a93c031e9ae3c20cf3ca', class: "bds-typography__info-icon bds-icon-info-circle" }))));
157
158
  }
158
159
  get el() { return index.getElement(this); }
159
160
  static get watchers() { return {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Cdb66Tqj.js');
3
+ var index = require('./index-C9JKWXwa.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
@@ -40,7 +40,7 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
40
40
 
41
41
  patchBrowser().then(async (options) => {
42
42
  await appGlobals.globalScripts();
43
- return index.bootstrapLazy([["bds-banner.cjs",[[260,"bds-banner",{"idComponent":[1,"id-component"],"variant":[1],"enableClose":[4,"enable-close"],"isClosing":[32],"isOpen":[32],"closeBanner":[64]}]]],["bds-typography.cjs",[[260,"bds-typography",{"variant":[513],"size":[513],"state":[513],"customClass":[1,"custom-class"],"element":[1],"align":[1],"ellipsis":[4],"maxLines":[2,"max-lines"],"tooltipText":[1,"tooltip-text"],"isRequired":[516,"is-required"],"htmlFor":[1,"html-for"],"href":[1],"target":[1],"isDownloadable":[4,"is-downloadable"],"filename":[1],"sanitizedHref":[32]},null,{"href":[{"updateSanitizedHref":0}]}]]],["my-component.cjs",[[0,"my-component",{"first":[1],"middle":[1],"last":[1]}]]]], options);
43
+ return index.bootstrapLazy([["bds-banner.cjs",[[260,"bds-banner",{"idComponent":[1,"id-component"],"variant":[1],"enableClose":[4,"enable-close"],"isClosing":[32],"isOpen":[32],"closeBanner":[64]}]]],["bds-button.cjs",[[324,"bds-button",{"label":[1],"disabled":[4],"name":[1],"type":[1],"color":[1],"variant":[1],"size":[1],"loading":[4],"disclosure":[4],"currentState":[32]},null,{"type":[{"checkPropValues":0}],"color":[{"checkPropValues":0}],"variant":[{"checkPropValues":0}],"size":[{"checkPropValues":0}]}]]],["bds-typography.cjs",[[260,"bds-typography",{"variant":[513],"size":[513],"state":[513],"customClass":[1,"custom-class"],"element":[1],"align":[1],"ellipsis":[4],"maxLines":[2,"max-lines"],"tooltipText":[1,"tooltip-text"],"isRequired":[516,"is-required"],"htmlFor":[1,"html-for"],"href":[1],"target":[1],"isDownloadable":[4,"is-downloadable"],"filename":[1],"sanitizedHref":[32]},null,{"href":[{"updateSanitizedHref":0}]}]]]], options);
44
44
  });
45
45
 
46
46
  exports.setNonce = index.setNonce;
@@ -118,6 +118,12 @@ var styles = /* @__PURE__ */ new Map();
118
118
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
119
119
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
120
120
  var XLINK_NS = "http://www.w3.org/1999/xlink";
121
+ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
122
+ "formAssociatedCallback",
123
+ "formResetCallback",
124
+ "formDisabledCallback",
125
+ "formStateRestoreCallback"
126
+ ];
121
127
  var win = typeof window !== "undefined" ? window : {};
122
128
  var H = win.HTMLElement || class {
123
129
  };
@@ -882,7 +888,9 @@ var convertToPrivate = (node) => {
882
888
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
883
889
  if (propValue != null && !isComplexType(propValue)) {
884
890
  if (propType & 4 /* Boolean */) {
885
- {
891
+ if (isFormAssociated && typeof propValue === "string") {
892
+ return propValue === "" || !!propValue;
893
+ } else {
886
894
  return propValue === "false" ? false : propValue === "" || !!propValue;
887
895
  }
888
896
  }
@@ -1814,7 +1822,9 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1814
1822
  const instance = hostRef.$lazyInstance$ ;
1815
1823
  newVal = parsePropertyValue(
1816
1824
  newVal,
1817
- cmpMeta.$members$[propName][0]);
1825
+ cmpMeta.$members$[propName][0],
1826
+ !!(cmpMeta.$flags$ & 64 /* formAssociated */)
1827
+ );
1818
1828
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1819
1829
  const didValueChange = newVal !== oldVal && !areBothNaN;
1820
1830
  if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
@@ -1858,6 +1868,26 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1858
1868
  var proxyComponent = (Cstr, cmpMeta, flags) => {
1859
1869
  var _a, _b;
1860
1870
  const prototype = Cstr.prototype;
1871
+ if (cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
1872
+ FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
1873
+ Object.defineProperty(prototype, cbName, {
1874
+ value(...args) {
1875
+ var _a2;
1876
+ const hostRef = getHostRef(this);
1877
+ const instance = hostRef == null ? void 0 : hostRef.$lazyInstance$ ;
1878
+ if (!instance) {
1879
+ (_a2 = hostRef == null ? void 0 : hostRef.$onReadyPromise$) == null ? void 0 : _a2.then((asyncInstance) => {
1880
+ const cb = asyncInstance[cbName];
1881
+ typeof cb === "function" && cb.call(asyncInstance, ...args);
1882
+ });
1883
+ } else {
1884
+ const cb = instance[cbName] ;
1885
+ typeof cb === "function" && cb.call(instance, ...args);
1886
+ }
1887
+ }
1888
+ });
1889
+ });
1890
+ }
1861
1891
  if (cmpMeta.$members$ || BUILD.propChangeCallback) {
1862
1892
  {
1863
1893
  if (Cstr.watchers && !cmpMeta.$watchers$) {
@@ -1907,7 +1937,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1907
1937
  origSetter.apply(this, [
1908
1938
  parsePropertyValue(
1909
1939
  newValue,
1910
- memberFlags)
1940
+ memberFlags,
1941
+ !!(cmpMeta.$flags$ & 64 /* formAssociated */)
1942
+ )
1911
1943
  ]);
1912
1944
  newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1913
1945
  setValue(this, memberName, newValue, cmpMeta);
@@ -1932,7 +1964,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1932
1964
  }
1933
1965
  ref.$lazyInstance$[memberName] = parsePropertyValue(
1934
1966
  newValue,
1935
- memberFlags);
1967
+ memberFlags,
1968
+ !!(cmpMeta.$flags$ & 64 /* formAssociated */)
1969
+ );
1936
1970
  setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1937
1971
  };
1938
1972
  if (ref.$lazyInstance$) {
@@ -2288,6 +2322,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2288
2322
  } else {
2289
2323
  patchCloneNode(HostElement.prototype);
2290
2324
  }
2325
+ if (cmpMeta.$flags$ & 64 /* formAssociated */) {
2326
+ HostElement.formAssociated = true;
2327
+ }
2291
2328
  cmpMeta.$lazyBundleId$ = lazyBundle[0];
2292
2329
  if (!exclude.includes(tagName) && !customElements2.get(tagName)) {
2293
2330
  cmpTags.push(tagName);
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Cdb66Tqj.js');
3
+ var index = require('./index-C9JKWXwa.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  const defineCustomElements = async (win, options) => {
7
7
  if (typeof window === 'undefined') return undefined;
8
8
  await appGlobals.globalScripts();
9
- return index.bootstrapLazy([["bds-banner.cjs",[[260,"bds-banner",{"idComponent":[1,"id-component"],"variant":[1],"enableClose":[4,"enable-close"],"isClosing":[32],"isOpen":[32],"closeBanner":[64]}]]],["bds-typography.cjs",[[260,"bds-typography",{"variant":[513],"size":[513],"state":[513],"customClass":[1,"custom-class"],"element":[1],"align":[1],"ellipsis":[4],"maxLines":[2,"max-lines"],"tooltipText":[1,"tooltip-text"],"isRequired":[516,"is-required"],"htmlFor":[1,"html-for"],"href":[1],"target":[1],"isDownloadable":[4,"is-downloadable"],"filename":[1],"sanitizedHref":[32]},null,{"href":[{"updateSanitizedHref":0}]}]]],["my-component.cjs",[[0,"my-component",{"first":[1],"middle":[1],"last":[1]}]]]], options);
9
+ return index.bootstrapLazy([["bds-banner.cjs",[[260,"bds-banner",{"idComponent":[1,"id-component"],"variant":[1],"enableClose":[4,"enable-close"],"isClosing":[32],"isOpen":[32],"closeBanner":[64]}]]],["bds-button.cjs",[[324,"bds-button",{"label":[1],"disabled":[4],"name":[1],"type":[1],"color":[1],"variant":[1],"size":[1],"loading":[4],"disclosure":[4],"currentState":[32]},null,{"type":[{"checkPropValues":0}],"color":[{"checkPropValues":0}],"variant":[{"checkPropValues":0}],"size":[{"checkPropValues":0}]}]]],["bds-typography.cjs",[[260,"bds-typography",{"variant":[513],"size":[513],"state":[513],"customClass":[1,"custom-class"],"element":[1],"align":[1],"ellipsis":[4],"maxLines":[2,"max-lines"],"tooltipText":[1,"tooltip-text"],"isRequired":[516,"is-required"],"htmlFor":[1,"html-for"],"href":[1],"target":[1],"isDownloadable":[4,"is-downloadable"],"filename":[1],"sanitizedHref":[32]},null,{"href":[{"updateSanitizedHref":0}]}]]]], options);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const COMPONENT_STATES = {
4
+ DEFAULT: 'default',
5
+ ERROR: 'error',
6
+ DISABLED: 'disabled',
7
+ ACTIVE: 'active'};
8
+ const STATUS_VARIANT = {
9
+ INFO: 'info'};
10
+
11
+ exports.COMPONENT_STATES = COMPONENT_STATES;
12
+ exports.STATUS_VARIANT = STATUS_VARIANT;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "entries": [
3
+ "components/actions/bds-button/bds-button.js",
3
4
  "components/feedback/bds-banner/bds-banner.js",
4
- "components/my-component/my-component.js",
5
5
  "components/titles-text/bds-typography/bds-typography.js"
6
6
  ],
7
7
  "compiler": {