@telesign/boreal-web-components 0.1.0-alpha.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 (216) hide show
  1. package/LICENSE +21 -0
  2. package/components-build/bds-banner.d.ts +11 -0
  3. package/components-build/bds-banner.js +1 -0
  4. package/components-build/bds-typography.d.ts +11 -0
  5. package/components-build/bds-typography.js +1 -0
  6. package/components-build/index.d.ts +35 -0
  7. package/components-build/index.js +1 -0
  8. package/components-build/my-component.d.ts +11 -0
  9. package/components-build/my-component.js +1 -0
  10. package/components-build/p-B9wshZ_4.js +1 -0
  11. package/components-build/p-noyWJ11s.js +1 -0
  12. package/custom-elements.json +764 -0
  13. package/dist/boreal-web-components/boreal-web-components.css +1 -0
  14. package/dist/boreal-web-components/boreal-web-components.esm.js +1 -0
  15. package/dist/boreal-web-components/boreal-web-components.js +127 -0
  16. package/dist/boreal-web-components/css/boreal.css +1594 -0
  17. package/dist/boreal-web-components/css/global.css +682 -0
  18. package/dist/boreal-web-components/css/theme-connect.css +227 -0
  19. package/dist/boreal-web-components/css/theme-engage.css +227 -0
  20. package/dist/boreal-web-components/css/theme-protect.css +227 -0
  21. package/dist/boreal-web-components/css/theme-proximus.css +227 -0
  22. package/dist/boreal-web-components/index.esm.js +0 -0
  23. package/dist/boreal-web-components/p-412d037b.system.entry.js +1 -0
  24. package/dist/boreal-web-components/p-527a761b.entry.js +1 -0
  25. package/dist/boreal-web-components/p-5666a22a.system.entry.js +1 -0
  26. package/dist/boreal-web-components/p-B-PpI2Xv.system.js +1 -0
  27. package/dist/boreal-web-components/p-B9wshZ_4.js +1 -0
  28. package/dist/boreal-web-components/p-BQdH0ijK.system.js +2 -0
  29. package/dist/boreal-web-components/p-BbPAtVJG.system.js +1 -0
  30. package/dist/boreal-web-components/p-CMd-Mv-5.system.js +1 -0
  31. package/dist/boreal-web-components/p-CaVEtaG3.system.js +1 -0
  32. package/dist/boreal-web-components/p-DQuL1Twl.js +1 -0
  33. package/dist/boreal-web-components/p-DgFiTd6X.js +2 -0
  34. package/dist/boreal-web-components/p-YWpyar7R.system.js +1 -0
  35. package/dist/boreal-web-components/p-b818618b.entry.js +1 -0
  36. package/dist/boreal-web-components/p-d596406b.entry.js +1 -0
  37. package/dist/boreal-web-components/p-e37e7dba.system.entry.js +1 -0
  38. package/dist/boreal-web-components/p-noyWJ11s.js +1 -0
  39. package/dist/boreal-web-components/scss/global/_fonts.scss +1 -0
  40. package/dist/boreal-web-components/scss/global/_index.scss +3 -0
  41. package/dist/boreal-web-components/scss/global/_reset.scss +50 -0
  42. package/dist/boreal-web-components/scss/global/_typography.scss +156 -0
  43. package/dist/boreal-web-components/scss/maps/_primitives.scss +461 -0
  44. package/dist/boreal-web-components/scss/maps/_theme-connect.scss +227 -0
  45. package/dist/boreal-web-components/scss/maps/_theme-engage.scss +227 -0
  46. package/dist/boreal-web-components/scss/maps/_theme-protect.scss +227 -0
  47. package/dist/boreal-web-components/scss/maps/_theme-proximus.scss +227 -0
  48. package/dist/boreal-web-components/scss/variables/_primitives.scss +459 -0
  49. package/dist/boreal-web-components/scss/variables/_theme-connect.scss +225 -0
  50. package/dist/boreal-web-components/scss/variables/_theme-engage.scss +225 -0
  51. package/dist/boreal-web-components/scss/variables/_theme-protect.scss +225 -0
  52. package/dist/boreal-web-components/scss/variables/_theme-proximus.scss +225 -0
  53. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  54. package/dist/cjs/attributes-RPVEtBdj.js +90 -0
  55. package/dist/cjs/bds-banner.cjs.entry.js +130 -0
  56. package/dist/cjs/bds-typography.cjs.entry.js +167 -0
  57. package/dist/cjs/boreal-web-components.cjs.js +46 -0
  58. package/dist/cjs/index-CD9v53WJ.js +133 -0
  59. package/dist/cjs/index-Cdb66Tqj.js +2342 -0
  60. package/dist/cjs/index.cjs.js +2 -0
  61. package/dist/cjs/loader.cjs.js +13 -0
  62. package/dist/cjs/my-component.cjs.entry.js +29 -0
  63. package/dist/collection/collection-manifest.json +14 -0
  64. package/dist/collection/components/feedback/bds-banner/bds-banner.css +101 -0
  65. package/dist/collection/components/feedback/bds-banner/bds-banner.js +266 -0
  66. package/dist/collection/components/feedback/bds-banner/types/IBanner.js +1 -0
  67. package/dist/collection/components/my-component/my-component.css +3 -0
  68. package/dist/collection/components/my-component/my-component.js +95 -0
  69. package/dist/collection/components/titles-text/bds-typography/bds-typography.css +183 -0
  70. package/dist/collection/components/titles-text/bds-typography/bds-typography.js +577 -0
  71. package/dist/collection/components/titles-text/bds-typography/types/ITypography.js +1 -0
  72. package/dist/collection/components/titles-text/bds-typography/types/enum.js +23 -0
  73. package/dist/collection/components/titles-text/bds-typography/types/types.js +1 -0
  74. package/dist/collection/components/titles-text/bds-typography/utils/bds-typography-utils.js +41 -0
  75. package/dist/collection/css/boreal.css +1594 -0
  76. package/dist/collection/css/global.css +682 -0
  77. package/dist/collection/css/theme-connect.css +227 -0
  78. package/dist/collection/css/theme-engage.css +227 -0
  79. package/dist/collection/css/theme-protect.css +227 -0
  80. package/dist/collection/css/theme-proximus.css +227 -0
  81. package/dist/collection/index.js +1 -0
  82. package/dist/collection/mixins/anchored.mixin.js +272 -0
  83. package/dist/collection/mixins/floating.mixin.js +181 -0
  84. package/dist/collection/mixins/form-associated.mixin.js +95 -0
  85. package/dist/collection/mixins/index.js +3 -0
  86. package/dist/collection/scss/global/_fonts.scss +1 -0
  87. package/dist/collection/scss/global/_index.scss +3 -0
  88. package/dist/collection/scss/global/_reset.scss +50 -0
  89. package/dist/collection/scss/global/_typography.scss +156 -0
  90. package/dist/collection/scss/maps/_primitives.scss +461 -0
  91. package/dist/collection/scss/maps/_theme-connect.scss +227 -0
  92. package/dist/collection/scss/maps/_theme-engage.scss +227 -0
  93. package/dist/collection/scss/maps/_theme-protect.scss +227 -0
  94. package/dist/collection/scss/maps/_theme-proximus.scss +227 -0
  95. package/dist/collection/scss/variables/_primitives.scss +459 -0
  96. package/dist/collection/scss/variables/_theme-connect.scss +225 -0
  97. package/dist/collection/scss/variables/_theme-engage.scss +225 -0
  98. package/dist/collection/scss/variables/_theme-protect.scss +225 -0
  99. package/dist/collection/scss/variables/_theme-proximus.scss +225 -0
  100. package/dist/collection/services/floating/interfaces/Floating.js +1 -0
  101. package/dist/collection/services/floating/interfaces/Positioning.js +1 -0
  102. package/dist/collection/services/floating/interfaces/Props.js +1 -0
  103. package/dist/collection/services/floating/positioning.service.js +71 -0
  104. package/dist/collection/services/floating/types/Arrow.js +1 -0
  105. package/dist/collection/services/logger/Logger.js +47 -0
  106. package/dist/collection/types/alignment.js +6 -0
  107. package/dist/collection/types/form.js +1 -0
  108. package/dist/collection/types/index.js +5 -0
  109. package/dist/collection/types/position.js +11 -0
  110. package/dist/collection/types/size.js +7 -0
  111. package/dist/collection/types/states.js +22 -0
  112. package/dist/collection/types/stylesMap.js +1 -0
  113. package/dist/collection/utils/a11y/attributes.js +80 -0
  114. package/dist/collection/utils/a11y/index.js +1 -0
  115. package/dist/collection/utils/constants/common/Events.js +10 -0
  116. package/dist/collection/utils/constants/common/Keys.js +16 -0
  117. package/dist/collection/utils/dom/elements.js +22 -0
  118. package/dist/collection/utils/dom/index.js +1 -0
  119. package/dist/collection/utils/form/index.js +1 -0
  120. package/dist/collection/utils/form/internals.js +79 -0
  121. package/dist/collection/utils/helpers/common/BaseAttributes.js +17 -0
  122. package/dist/collection/utils/index.js +3 -0
  123. package/dist/css/boreal.css +1594 -0
  124. package/dist/css/global.css +682 -0
  125. package/dist/css/theme-connect.css +227 -0
  126. package/dist/css/theme-engage.css +227 -0
  127. package/dist/css/theme-protect.css +227 -0
  128. package/dist/css/theme-proximus.css +227 -0
  129. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  130. package/dist/esm/attributes-B9wshZ_4.js +86 -0
  131. package/dist/esm/bds-banner.entry.js +128 -0
  132. package/dist/esm/bds-typography.entry.js +165 -0
  133. package/dist/esm/boreal-web-components.js +42 -0
  134. package/dist/esm/index-DgFiTd6X.js +2332 -0
  135. package/dist/esm/index-noyWJ11s.js +131 -0
  136. package/dist/esm/index.js +1 -0
  137. package/dist/esm/loader.js +11 -0
  138. package/dist/esm/my-component.entry.js +27 -0
  139. package/dist/esm/polyfills/core-js.js +11 -0
  140. package/dist/esm/polyfills/dom.js +79 -0
  141. package/dist/esm/polyfills/es5-html-element.js +1 -0
  142. package/dist/esm/polyfills/index.js +34 -0
  143. package/dist/esm/polyfills/system.js +6 -0
  144. package/dist/esm-es5/app-globals-DQuL1Twl.js +1 -0
  145. package/dist/esm-es5/attributes-B9wshZ_4.js +1 -0
  146. package/dist/esm-es5/bds-banner.entry.js +1 -0
  147. package/dist/esm-es5/bds-typography.entry.js +1 -0
  148. package/dist/esm-es5/boreal-web-components.js +1 -0
  149. package/dist/esm-es5/index-DgFiTd6X.js +2 -0
  150. package/dist/esm-es5/index-noyWJ11s.js +1 -0
  151. package/dist/esm-es5/index.js +0 -0
  152. package/dist/esm-es5/loader.js +1 -0
  153. package/dist/esm-es5/my-component.entry.js +1 -0
  154. package/dist/index.cjs.js +1 -0
  155. package/dist/index.js +1 -0
  156. package/dist/scss/global/_fonts.scss +1 -0
  157. package/dist/scss/global/_index.scss +3 -0
  158. package/dist/scss/global/_reset.scss +50 -0
  159. package/dist/scss/global/_typography.scss +156 -0
  160. package/dist/scss/maps/_primitives.scss +461 -0
  161. package/dist/scss/maps/_theme-connect.scss +227 -0
  162. package/dist/scss/maps/_theme-engage.scss +227 -0
  163. package/dist/scss/maps/_theme-protect.scss +227 -0
  164. package/dist/scss/maps/_theme-proximus.scss +227 -0
  165. package/dist/scss/variables/_primitives.scss +459 -0
  166. package/dist/scss/variables/_theme-connect.scss +225 -0
  167. package/dist/scss/variables/_theme-engage.scss +225 -0
  168. package/dist/scss/variables/_theme-protect.scss +225 -0
  169. package/dist/scss/variables/_theme-proximus.scss +225 -0
  170. package/dist/types/components/feedback/bds-banner/bds-banner.d.ts +71 -0
  171. package/dist/types/components/feedback/bds-banner/types/IBanner.d.ts +10 -0
  172. package/dist/types/components/my-component/my-component.d.ts +16 -0
  173. package/dist/types/components/titles-text/bds-typography/bds-typography.d.ts +99 -0
  174. package/dist/types/components/titles-text/bds-typography/types/ITypography.d.ts +22 -0
  175. package/dist/types/components/titles-text/bds-typography/types/enum.d.ts +24 -0
  176. package/dist/types/components/titles-text/bds-typography/types/types.d.ts +4 -0
  177. package/dist/types/components/titles-text/bds-typography/utils/bds-typography-utils.d.ts +15 -0
  178. package/dist/types/components.d.ts +565 -0
  179. package/dist/types/index.d.ts +11 -0
  180. package/dist/types/mixins/anchored.mixin.d.ts +228 -0
  181. package/dist/types/mixins/floating.mixin.d.ts +158 -0
  182. package/dist/types/mixins/form-associated.mixin.d.ts +127 -0
  183. package/dist/types/mixins/index.d.ts +4 -0
  184. package/dist/types/services/floating/interfaces/Floating.d.ts +38 -0
  185. package/dist/types/services/floating/interfaces/Positioning.d.ts +22 -0
  186. package/dist/types/services/floating/interfaces/Props.d.ts +35 -0
  187. package/dist/types/services/floating/positioning.service.d.ts +45 -0
  188. package/dist/types/services/floating/types/Arrow.d.ts +7 -0
  189. package/dist/types/services/logger/Logger.d.ts +50 -0
  190. package/dist/types/stencil-public-runtime.d.ts +1858 -0
  191. package/dist/types/types/alignment.d.ts +8 -0
  192. package/dist/types/types/form.d.ts +7 -0
  193. package/dist/types/types/index.d.ts +6 -0
  194. package/dist/types/types/position.d.ts +13 -0
  195. package/dist/types/types/size.d.ts +9 -0
  196. package/dist/types/types/states.d.ts +26 -0
  197. package/dist/types/types/stylesMap.d.ts +2 -0
  198. package/dist/types/utils/a11y/attributes.d.ts +13 -0
  199. package/dist/types/utils/a11y/index.d.ts +2 -0
  200. package/dist/types/utils/constants/common/Events.d.ts +14 -0
  201. package/dist/types/utils/constants/common/Keys.d.ts +18 -0
  202. package/dist/types/utils/dom/elements.d.ts +12 -0
  203. package/dist/types/utils/dom/index.d.ts +2 -0
  204. package/dist/types/utils/form/index.d.ts +2 -0
  205. package/dist/types/utils/form/internals.d.ts +66 -0
  206. package/dist/types/utils/helpers/common/BaseAttributes.d.ts +16 -0
  207. package/dist/types/utils/index.d.ts +4 -0
  208. package/loader/cdn.js +2 -0
  209. package/loader/index.cjs.js +2 -0
  210. package/loader/index.d.ts +24 -0
  211. package/loader/index.es2017.js +2 -0
  212. package/loader/index.js +3 -0
  213. package/package.json +96 -0
  214. package/readme.md +111 -0
  215. package/scripts/copy-styles.js +18 -0
  216. package/scripts/postbuild.js +21 -0
@@ -0,0 +1,128 @@
1
+ import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-DgFiTd6X.js';
2
+ import { S as STATUS_VARIANT, i as inheritAriaAttributes } from './attributes-B9wshZ_4.js';
3
+
4
+ /**
5
+ * Ensure the given component instance has an auto-generated id if one wasn't provided.
6
+ * Designed to be called from `componentWillLoad` on a Stencil component.
7
+ */
8
+ function createId(component) {
9
+ if (!component.idComponent)
10
+ component.idComponent = `bds-${Math.random().toString(36).substr(2, 9)}`;
11
+ }
12
+ /**
13
+ * Components can spread the result into their host.
14
+ */
15
+ function getBaseAttributes(component) {
16
+ createId(component);
17
+ return {
18
+ id: component.idComponent,
19
+ };
20
+ }
21
+
22
+ const bdsBannerCss = () => `.bds-banner{position:relative;display:-ms-flexbox;display:flex;border:var(--boreal-spacing-4xs) solid var(--boreal-stroke-info-base);border-radius:var(--boreal-radius-xs);border-left:0;font-family:var(--boreal-typography-font-family-primary);height:100%;-webkit-transition:all 0.3s ease-out;transition:all 0.3s ease-out}.bds-banner__vertical-line{width:var(--boreal-spacing-2xs);border-top-left-radius:var(--boreal-radius-xs);border-bottom-left-radius:var(--boreal-radius-xs);background-color:var(--boreal-stroke-info-base)}.bds-banner__container{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;width:100%;gap:var(--boreal-spacing-xs);padding:var(--boreal-spacing-s)}.bds-banner__content{width:100%}.bds-banner__title{font-weight:var(--boreal-typography-font-weight-semibold);font-size:var(--boreal-typography-font-size-md);line-height:var(--boreal-typography-line-height-md)}.bds-banner__body{padding-top:var(--boreal-spacing-2xs);font-size:var(--boreal-typography-font-size-sm);line-height:var(--boreal-typography-line-height-sm)}.bds-banner__actions{padding-top:var(--boreal-spacing-s);min-height:0px}.bds-banner__actions:empty{display:none}.bds-banner__status-icon{font-size:var(--boreal-typography-font-size-md);line-height:var(--boreal-typography-line-height-md);margin-top:var(--boreal-spacing-3xs)}.bds-banner__close-icon{background:none;border:none;-ms-flex-item-align:start;align-self:start;font-size:var(--boreal-typography-font-size-md);line-height:var(--boreal-typography-line-height-md);color:var(--boreal-neutral-base);cursor:pointer}.bds-banner--info{border-color:var(--boreal-stroke-info-base);background-color:var(--boreal-ui-info-lighter)}.bds-banner--info .bds-banner__vertical-line{background-color:var(--boreal-stroke-info-base)}.bds-banner--info .bds-banner__status-icon{color:var(--boreal-stroke-info-base)}.bds-banner--success{border-color:var(--boreal-stroke-success-base);background-color:var(--boreal-ui-success-lighter)}.bds-banner--success .bds-banner__vertical-line{background-color:var(--boreal-stroke-success-base)}.bds-banner--success .bds-banner__status-icon{color:var(--boreal-stroke-success-base)}.bds-banner--warning{border-color:var(--boreal-stroke-warning);background-color:var(--boreal-ui-warning-lighter)}.bds-banner--warning .bds-banner__vertical-line{background-color:var(--boreal-stroke-warning)}.bds-banner--warning .bds-banner__status-icon{color:var(--boreal-stroke-warning)}.bds-banner--danger{border-color:var(--boreal-stroke-danger-base);background-color:var(--boreal-ui-danger-lighter)}.bds-banner--danger .bds-banner__vertical-line{background-color:var(--boreal-stroke-danger-base)}.bds-banner--danger .bds-banner__status-icon{color:var(--boreal-stroke-danger-base)}.bds-banner--closing{opacity:0;height:0}`;
23
+
24
+ const BdsBanner = class {
25
+ constructor(hostRef) {
26
+ registerInstance(this, hostRef);
27
+ this.close = createEvent(this, "close");
28
+ this.inheritedAttributes = {};
29
+ /**
30
+ * Internal state tracking the banner's closing animation.
31
+ */
32
+ this.isClosing = false;
33
+ /**
34
+ * Controls the visibility of the banner. Set to false to hide the banner.
35
+ */
36
+ this.isOpen = true;
37
+ /**
38
+ * Unique identifier for the banner element.
39
+ */
40
+ this.idComponent = '';
41
+ /**
42
+ * Visual style variant: 'info', 'success', 'warning', or 'danger'.
43
+ * @default "info"
44
+ */
45
+ this.variant = STATUS_VARIANT.INFO;
46
+ /**
47
+ * Shows a close button that allows users to dismiss the banner.
48
+ * @default false
49
+ */
50
+ this.enableClose = false;
51
+ this.handleAnimationEnd = () => {
52
+ if (this.isClosing)
53
+ requestAnimationFrame(() => {
54
+ this.isClosing = false;
55
+ this.isOpen = false;
56
+ });
57
+ };
58
+ }
59
+ componentWillLoad() {
60
+ this.inheritedAttributes = {
61
+ ...inheritAriaAttributes(this.el),
62
+ ...getBaseAttributes(this),
63
+ };
64
+ }
65
+ /**
66
+ * Programmatic method to close the banner and emit the `close` event
67
+ */
68
+ async closeBanner() {
69
+ this.handleCloseBanner();
70
+ }
71
+ handleCloseBanner(e) {
72
+ if (e !== undefined)
73
+ e.preventDefault();
74
+ this.isClosing = true;
75
+ this.close.emit();
76
+ }
77
+ handleEscapeKeyClose(e) {
78
+ if (!this.enableClose)
79
+ return;
80
+ if (e.key === 'Escape')
81
+ this.handleCloseBanner();
82
+ }
83
+ getIconName() {
84
+ const iconMap = {
85
+ info: 'bds-icon-info-circle-fill',
86
+ success: 'bds-icon-check-circle-fill',
87
+ warning: 'bds-icon-info-major-triangle-up-fill',
88
+ danger: 'bds-icon-alert-circle-fill',
89
+ };
90
+ if (iconMap[this.variant] === undefined)
91
+ return iconMap['info'];
92
+ return iconMap[this.variant];
93
+ }
94
+ getAttributes() {
95
+ return {
96
+ ...this.inheritedAttributes,
97
+ role: 'alert',
98
+ 'aria-describedby': this.isOpen ? 'bds-banner__content' : null,
99
+ 'aria-live': 'polite',
100
+ 'aria-hidden': `${!this.isOpen}`,
101
+ tabIndex: this.isOpen ? 0 : -1,
102
+ };
103
+ }
104
+ getStyles() {
105
+ return {
106
+ 'bds-banner': true,
107
+ [`bds-banner--${this.variant}`]: true,
108
+ 'bds-banner--closing': this.isClosing,
109
+ };
110
+ }
111
+ renderCloseIcon() {
112
+ return (
113
+ // TODO how to pass this inner aria attr from outside?
114
+ h("button", { role: "close-button", class: "bds-banner__close-icon", "aria-label": "Alert close button", onClick: e => this.handleCloseBanner(e) }, h("em", { class: "bds-icon-close" })));
115
+ }
116
+ render() {
117
+ if (!this.isOpen)
118
+ return;
119
+ const closeIcon = this.renderCloseIcon();
120
+ const classes = this.getStyles();
121
+ const iconName = this.getIconName();
122
+ return (h(Host, { class: classes, ...this.getAttributes(), onTransitionEnd: this.handleAnimationEnd, onKeyDown: (e) => this.handleEscapeKeyClose(e) }, h("div", { class: "bds-banner__vertical-line" }), h("div", { class: "bds-banner__container" }, h("div", { class: "bds-banner__status-icon", role: "status", "aria-live": "polite", "aria-label": `status ${this.variant}` }, h("em", { "aria-hidden": "true", class: iconName })), h("div", { class: "bds-banner__content" }, h("div", { class: "bds-banner__title" }, h("slot", { name: "title" })), h("div", { class: "bds-banner__body" }, h("slot", null)), h("div", { class: "bds-banner__actions" }, h("slot", { name: "actions" }))), this.enableClose && closeIcon)));
123
+ }
124
+ get el() { return getElement(this); }
125
+ };
126
+ BdsBanner.style = bdsBannerCss();
127
+
128
+ export { BdsBanner as bds_banner };
@@ -0,0 +1,165 @@
1
+ import { r as registerInstance, h, a as Host, g as getElement } from './index-DgFiTd6X.js';
2
+ import { a as STATES, i as inheritAriaAttributes } from './attributes-B9wshZ_4.js';
3
+
4
+ const ALIGNMENT = {
5
+ START: 'start'};
6
+
7
+ const SIZES = {
8
+ XS: 'xs',
9
+ S: 'sm',
10
+ M: 'md',
11
+ L: 'lg',
12
+ XL: 'xl',
13
+ };
14
+
15
+ const VARIANT_TYPOGRAPHY = {
16
+ DISPLAY: 'display',
17
+ LINK: 'link'};
18
+ const TAG_ELEMENT = {
19
+ P: 'p',
20
+ A: 'a'};
21
+
22
+ /*
23
+ * LINK consts
24
+ */
25
+ const FILENAME = 'download';
26
+ /*
27
+ * Variant map to apply size, state, etc, styles based on variant type
28
+ */
29
+ const VARIANT_CONFIG = {
30
+ link: {
31
+ states: [STATES.DISABLED /* STATES.VISITED, STATES.HOVER, STATES.ACTIVE, STATES.FOCUS */],
32
+ size: [SIZES.S, SIZES.M],
33
+ },
34
+ label: {
35
+ states: [STATES.DISABLED],
36
+ isRequired: true,
37
+ canUseTooltip: true,
38
+ },
39
+ heading: { canUseTooltip: true },
40
+ subheading: { canUseTooltip: true },
41
+ helper: { states: [STATES.ERROR] },
42
+ display: { size: [SIZES.XS, SIZES.S, SIZES.M, SIZES.L, SIZES.XL] },
43
+ };
44
+ /*
45
+ * ATTRIBUTE MAP
46
+ */
47
+ const getAttributesByTag = (comp, tagName) => {
48
+ const ATTR_MAP = {
49
+ a: {
50
+ href: comp.state !== STATES.DISABLED ? comp.sanitizedHref : null,
51
+ target: comp.target,
52
+ download: comp.isDownloadable ? comp.filename : null,
53
+ rel: comp.target === '_blank' ? 'noopener noreferrer' : undefined,
54
+ },
55
+ label: {
56
+ htmlFor: comp.htmlFor,
57
+ },
58
+ };
59
+ return ATTR_MAP[tagName] || {};
60
+ };
61
+
62
+ const bdsTypographyCss = () => `.bds-typography{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:var(--boreal-typography-font-family-primary);font-weight:var(--boreal-typography-font-weight-regular)}.bds-typography__required-indicator{color:var(--boreal-icon-danger-base);font-weight:var(--boreal-typography-font-weight-regular)}.bds-typography__info-icon{color:var(--boreal-icon-default-light)}.bds-typography--heading,.bds-typography--subheading{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--boreal-spacing-3xs)}.bds-typography--label{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:var(--boreal-spacing-3xs)}.bds-typography--display{display:block}.bds-typography--caption,.bds-typography--helper,.bds-typography--link{display:inline-block}.bds-typography--caption{font-size:var(--boreal-typography-font-size-xs);font-weight:var(--boreal-typography-font-weight-regular);line-height:var(--boreal-typography-line-height-md);color:var(--boreal-text-default-light)}.bds-typography--helper{font-size:var(--boreal-typography-font-size-xs);font-weight:var(--boreal-typography-font-weight-regular);line-height:var(--boreal-typography-line-height-sm);color:var(--boreal-text-default-light)}.bds-typography--link{font-size:var(--boreal-typography-font-size-sm);font-weight:var(--boreal-typography-font-weight-regular);line-height:var(--boreal-typography-line-height-md);color:var(--boreal-text-primary-base);text-decoration:none}.bds-typography--link:hover{text-decoration:underline}.bds-typography--link:visited{color:var(--boreal-text-primary-base)}.bds-typography--link:active{color:var(--boreal-text-primary-dark)}.bds-typography--link.bds-typography--size-sm{font-size:var(--boreal-typography-font-size-xs)}.bds-typography--link.bds-typography--size-md{font-size:var(--boreal-typography-font-size-sm)}.bds-typography--code{font-family:var(--boreal-typography-font-family-secondary);font-size:var(--boreal-typography-font-size-xs);font-weight:var(--boreal-typography-font-weight-regular);color:var(--boreal-text-default);line-height:var(--boreal-typography-line-height-md);overflow-wrap:break-word;background-color:var(--boreal-bg-neutral);padding:var(--boreal-spacing-3xs) var(--boreal-spacing-xs);border-radius:var(--boreal-radius-xs);display:inline;box-decoration-break:clone;-webkit-box-decoration-break:clone}.bds-typography--label{font-size:var(--boreal-typography-font-size-xs);font-weight:var(--boreal-typography-font-weight-semibold);line-height:var(--boreal-typography-line-height-md);color:var(--boreal-text-default-darker)}.bds-typography--display{font-weight:var(--boreal-typography-font-weight-regular);color:var(--boreal-text-default)}.bds-typography--display.bds-typography--size-sm{font-size:var(--boreal-typography-font-size-xl);line-height:var(--boreal-typography-line-height-xl)}.bds-typography--display.bds-typography--size-md{font-size:var(--boreal-typography-font-size-2xl);line-height:var(--boreal-typography-line-height-2xl)}.bds-typography--display.bds-typography--size-lg{font-size:var(--boreal-typography-font-size-3xl);line-height:var(--boreal-typography-line-height-3xl);font-weight:var(--boreal-typography-font-weight-light)}.bds-typography--display.bds-typography--size-xl{font-size:var(--boreal-typography-font-size-4xl);line-height:var(--boreal-typography-line-height-4xl);font-weight:var(--boreal-typography-font-weight-light)}.bds-typography--heading{font-size:var(--boreal-typography-font-size-lg);line-height:var(--boreal-typography-line-height-lg);font-weight:var(--boreal-typography-font-weight-regular);color:var(--boreal-text-default)}.bds-typography h1.bds-typography--heading{font-weight:var(--boreal-typography-font-weight-regular);font-size:var(--boreal-typography-font-size-4xl);line-height:var(--boreal-typography-line-height-4xl)}.bds-typography h2.bds-typography--heading{font-weight:var(--boreal-typography-font-weight-regular);font-size:var(--boreal-typography-font-size-3xl);line-height:var(--boreal-typography-line-height-3xl)}.bds-typography h3.bds-typography--heading{font-weight:var(--boreal-typography-font-weight-regular);font-size:var(--boreal-typography-font-size-2xl);line-height:var(--boreal-typography-line-height-2xl)}.bds-typography h4.bds-typography--heading{font-weight:var(--boreal-typography-font-weight-regular);font-size:var(--boreal-typography-font-size-xl);line-height:var(--boreal-typography-line-height-xl)}.bds-typography h5.bds-typography--heading{font-weight:var(--boreal-typography-font-weight-regular);font-size:var(--boreal-typography-font-size-lg);line-height:var(--boreal-typography-line-height-lg)}.bds-typography h6.bds-typography--heading{font-size:var(--boreal-typography-font-size-md);font-weight:var(--boreal-typography-font-weight-semibold);line-height:var(--boreal-typography-line-height-md)}.bds-typography--subheading{font-size:var(--boreal-typography-font-size-md);line-height:var(--boreal-typography-line-height-md);font-weight:var(--boreal-typography-font-weight-semibold)}.bds-typography--align-start{text-align:start}.bds-typography--align-center{text-align:center}.bds-typography--align-end{text-align:end}.bds-typography--align-inherit{text-align:inherit}.bds-typography--error{color:var(--boreal-text-danger-base)}.bds-typography--disabled{color:var(--boreal-text-disabled);pointer-events:none;cursor:not-allowed}.bds-typography--disabled .bds-typography__required-indicator{color:var(--boreal-text-danger-light)}.bds-typography--ellipsis{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.bds-typography--ellipsis-multiline{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;width:100%}`;
63
+
64
+ const BdsTypography = class {
65
+ constructor(hostRef) {
66
+ registerInstance(this, hostRef);
67
+ this.inheritedAttributes = {};
68
+ /** Typography visual variant. */
69
+ this.variant = VARIANT_TYPOGRAPHY.DISPLAY;
70
+ /** Typography size token. */
71
+ this.size = SIZES.M;
72
+ /** Visual state (if supported by variant). */
73
+ this.state = STATES.DEFAULT;
74
+ /** Additional custom CSS class. */
75
+ this.customClass = '';
76
+ /** HTML tag used for rendering. */
77
+ this.element = TAG_ELEMENT.P;
78
+ /** Text alignment. */
79
+ this.align = ALIGNMENT.START;
80
+ /** Enables text ellipsis. */
81
+ this.ellipsis = false;
82
+ /** Max lines when ellipsis is enabled. */
83
+ this.maxLines = 1;
84
+ /** Tooltip text (variant must support it). */
85
+ this.tooltipText = '';
86
+ /** Marks the field as required. */
87
+ this.isRequired = false;
88
+ /** For attribute when rendered as a label. */
89
+ this.htmlFor = undefined;
90
+ /** Link href when rendered as anchor. */
91
+ this.href = null;
92
+ /** Anchor target. */
93
+ this.target = null;
94
+ /** Enables download behavior for anchor. */
95
+ this.isDownloadable = false;
96
+ /** Suggested download filename. */
97
+ this.filename = FILENAME;
98
+ /** Sanitized href for security. */
99
+ this.sanitizedHref = '';
100
+ }
101
+ async updateSanitizedHref() {
102
+ if (this.getTagName === 'a' && this.href !== null) {
103
+ const { sanitizeUrl } = await import('./index-noyWJ11s.js').then(function (n) { return n.i; });
104
+ this.sanitizedHref = sanitizeUrl(this.href);
105
+ }
106
+ else
107
+ this.sanitizedHref = '';
108
+ }
109
+ async componentWillLoad() {
110
+ if (this.getTagName === TAG_ELEMENT.A && this.href !== null)
111
+ await this.updateSanitizedHref();
112
+ this.inheritedAttributes = {
113
+ ...inheritAriaAttributes(this.el),
114
+ };
115
+ }
116
+ get getTagName() {
117
+ if (this.variant === VARIANT_TYPOGRAPHY.LINK)
118
+ return TAG_ELEMENT.A;
119
+ return this.element.toLowerCase();
120
+ }
121
+ getVariantConfig() {
122
+ return VARIANT_CONFIG[this.variant] ?? {};
123
+ }
124
+ getAccessibilityTags() {
125
+ const { isRequired = null } = this.getVariantConfig();
126
+ const isInteractiveTag = ['a', 'label'].includes(this.getTagName);
127
+ return {
128
+ 'aria-required': this.isRequired && isRequired,
129
+ 'aria-disabled': this.state === STATES.DISABLED && isInteractiveTag,
130
+ };
131
+ }
132
+ getVariantStateStyles() {
133
+ const config = this.getVariantConfig();
134
+ return {
135
+ [`bds-typography--${this.variant}`]: true,
136
+ [`bds-typography--align-${this.align}`]: true,
137
+ [`bds-typography--${this.state}`]: !!(config?.states && config?.states.includes(this.state)),
138
+ [`bds-typography--size-${this.size}`]: !!(config?.size && config?.size.includes(this.size)),
139
+ 'bds-typography--required': !!(config?.isRequired && this.isRequired),
140
+ 'bds-typography--ellipsis': this.ellipsis && this.maxLines <= 1,
141
+ 'bds-typography--ellipsis-multiline': this.ellipsis && this.maxLines > 1,
142
+ [this.customClass]: this.customClass !== '',
143
+ };
144
+ }
145
+ render() {
146
+ const TagName = this.getTagName;
147
+ const attributes = {
148
+ ...getAttributesByTag(this, TagName),
149
+ ...this.inheritedAttributes,
150
+ ...this.getAccessibilityTags(),
151
+ };
152
+ const classes = this.getVariantStateStyles();
153
+ const { canUseTooltip = null, isRequired = null } = this.getVariantConfig();
154
+ return (h(Host, { key: '6091692b1cb6bf1d3295f0834c8d25425633d65a', class: "bds-typography" }, h(TagName, { key: '0cc91c35fa1cc36c99101a79fae0c8b5cf44de43', class: classes, style: { webkitLineClamp: this.maxLines }, ...attributes }, h("slot", { key: '973848fba8211cb5ef869e0e48fb1806bd5efdec' }), this.isRequired && isRequired && (h("em", { key: 'dd89574e9dedd55905ae4c7bcd57604f26fbd03b', class: "bds-typography__required-indicator", "aria-hidden": "true" }, "*")), this.tooltipText && canUseTooltip && h("em", { key: '473b0de17bd095b97d54d24d2f3aa75f8a8e4922', class: "bds-typography__info-icon bds-icon-info-circle" }))));
155
+ }
156
+ get el() { return getElement(this); }
157
+ static get watchers() { return {
158
+ "href": [{
159
+ "updateSanitizedHref": 0
160
+ }]
161
+ }; }
162
+ };
163
+ BdsTypography.style = bdsTypographyCss();
164
+
165
+ export { BdsTypography as bds_typography };
@@ -0,0 +1,42 @@
1
+ import { p as promiseResolve, H, b as bootstrapLazy } from './index-DgFiTd6X.js';
2
+ export { s as setNonce } from './index-DgFiTd6X.js';
3
+ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.42.1 | MIT Licensed | https://stenciljs.com
7
+ */
8
+
9
+ var patchBrowser = () => {
10
+ {
11
+ patchCloneNodeFix(H.prototype);
12
+ }
13
+ const importMeta = import.meta.url;
14
+ const opts = {};
15
+ if (importMeta !== "") {
16
+ opts.resourcesUrl = new URL(".", importMeta).href;
17
+ }
18
+ return promiseResolve(opts);
19
+ };
20
+ var patchCloneNodeFix = (HTMLElementPrototype) => {
21
+ const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;
22
+ HTMLElementPrototype.cloneNode = function(deep) {
23
+ if (this.nodeName === "TEMPLATE") {
24
+ return nativeCloneNodeFn.call(this, deep);
25
+ }
26
+ const clonedNode = nativeCloneNodeFn.call(this, false);
27
+ const srcChildNodes = this.childNodes;
28
+ if (deep) {
29
+ for (let i = 0; i < srcChildNodes.length; i++) {
30
+ if (srcChildNodes[i].nodeType !== 2) {
31
+ clonedNode.appendChild(srcChildNodes[i].cloneNode(true));
32
+ }
33
+ }
34
+ }
35
+ return clonedNode;
36
+ };
37
+ };
38
+
39
+ patchBrowser().then(async (options) => {
40
+ await globalScripts();
41
+ return bootstrapLazy([["bds-banner",[[260,"bds-banner",{"idComponent":[1,"id-component"],"variant":[1],"enableClose":[4,"enable-close"],"isClosing":[32],"isOpen":[32],"closeBanner":[64]}]]],["bds-typography",[[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",[[0,"my-component",{"first":[1],"middle":[1],"last":[1]}]]]], options);
42
+ });