@infineon/infineon-design-system-stencil 35.3.1--canary.1904.15d3bb384740774c3e17830e4851f77cc08dc724.0 → 35.4.0--canary.1921.d75798a15f919aad6069a7755d57b34671da25b8.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 (54) hide show
  1. package/dist/cjs/ifx-accordion_2.cjs.entry.js +25 -25
  2. package/dist/cjs/ifx-accordion_2.cjs.entry.js.map +1 -1
  3. package/dist/cjs/ifx-alert_2.cjs.entry.js +133 -106
  4. package/dist/cjs/ifx-alert_2.cjs.entry.js.map +1 -1
  5. package/dist/cjs/ifx-icon.cjs.entry.js +97 -0
  6. package/dist/cjs/ifx-icon.cjs.entry.js.map +1 -0
  7. package/dist/cjs/index-7f4df11a.js +8 -8
  8. package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/components/accordion/accordionItem.css +0 -4
  11. package/dist/collection/components/accordion/accordionItem.js +24 -24
  12. package/dist/collection/components/accordion/accordionItem.js.map +1 -1
  13. package/dist/collection/components/alert/alert.js +0 -32
  14. package/dist/collection/components/alert/alert.js.map +1 -1
  15. package/dist/components/ifx-accordion-item.js +1 -1
  16. package/dist/components/ifx-alert.js +1 -1
  17. package/dist/components/ifx-faq.js +1 -1
  18. package/dist/components/ifx-templates-ui.js +1 -1
  19. package/dist/components/p-5c96860f.js +119 -0
  20. package/dist/components/p-5c96860f.js.map +1 -0
  21. package/dist/components/{p-a1ce7b6d.js → p-6c0ec65a.js} +1 -33
  22. package/dist/components/p-6c0ec65a.js.map +1 -0
  23. package/dist/esm/ifx-accordion_2.entry.js +25 -25
  24. package/dist/esm/ifx-accordion_2.entry.js.map +1 -1
  25. package/dist/esm/ifx-alert_2.entry.js +134 -107
  26. package/dist/esm/ifx-alert_2.entry.js.map +1 -1
  27. package/dist/esm/ifx-icon.entry.js +93 -0
  28. package/dist/esm/ifx-icon.entry.js.map +1 -0
  29. package/dist/esm/index-6c9eba32.js +8 -8
  30. package/dist/esm/infineon-design-system-stencil.js +1 -1
  31. package/dist/esm/loader.js +1 -1
  32. package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
  33. package/dist/infineon-design-system-stencil/p-0d3e5a0d.entry.js +2 -0
  34. package/dist/infineon-design-system-stencil/p-0d3e5a0d.entry.js.map +1 -0
  35. package/dist/infineon-design-system-stencil/p-74bee1c8.entry.js +2 -0
  36. package/dist/infineon-design-system-stencil/p-74bee1c8.entry.js.map +1 -0
  37. package/dist/infineon-design-system-stencil/p-959285a7.entry.js +2 -0
  38. package/dist/infineon-design-system-stencil/p-959285a7.entry.js.map +1 -0
  39. package/dist/types/components/accordion/accordionItem.d.ts +2 -1
  40. package/dist/types/components/alert/alert.d.ts +0 -8
  41. package/package.json +1 -1
  42. package/dist/cjs/ifx-template.cjs.entry.js +0 -156
  43. package/dist/cjs/ifx-template.cjs.entry.js.map +0 -1
  44. package/dist/components/p-4cf462ca.js +0 -119
  45. package/dist/components/p-4cf462ca.js.map +0 -1
  46. package/dist/components/p-a1ce7b6d.js.map +0 -1
  47. package/dist/esm/ifx-template.entry.js +0 -152
  48. package/dist/esm/ifx-template.entry.js.map +0 -1
  49. package/dist/infineon-design-system-stencil/p-01b40a11.entry.js +0 -2
  50. package/dist/infineon-design-system-stencil/p-01b40a11.entry.js.map +0 -1
  51. package/dist/infineon-design-system-stencil/p-a356a82d.entry.js +0 -2
  52. package/dist/infineon-design-system-stencil/p-a356a82d.entry.js.map +0 -1
  53. package/dist/infineon-design-system-stencil/p-baea374a.entry.js +0 -2
  54. package/dist/infineon-design-system-stencil/p-baea374a.entry.js.map +0 -1
@@ -1,5 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, a as Host } from './index-6c9eba32.js';
2
- import { g as getIcon } from './icons-75858876.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-6c9eba32.js';
3
2
 
4
3
  const alertCss = ":root{--ifx-font-family:\"Source Sans 3\", \"Arial, sans-serif\"}:host{display:block}.alert__info-wrapper{display:flex;padding:16px 24px;font-family:var(--ifx-font-family);box-shadow:0px 6px 9px 0px rgba(29, 29, 29, 0.1019607843)}.alert__info-wrapper .info__text-wrapper{display:flex;flex-direction:column;gap:8px;width:100%}.alert__info-wrapper .info__text-wrapper .info__headline-wrapper{display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.alert__info-wrapper .info__text-wrapper .info__headline-wrapper,.alert__info-wrapper .info__text-wrapper .info__description-wrapper{color:#1D1D1D;font-size:16px;font-style:normal;font-weight:600;line-height:24px}.alert__info-wrapper .info__text-wrapper .info__headline-wrapper ::slotted(p),.alert__info-wrapper .info__text-wrapper .info__description-wrapper ::slotted(p){padding:0;margin:0}.alert__info-wrapper .info__text-wrapper .info__description-wrapper{font-weight:400}.alert__info-wrapper .close-icon-wrapper{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start}.alert__info-wrapper .close-icon-wrapper button{all:unset;display:flex;align-items:center;justify-content:center;line-height:0;color:#1D1D1D;height:24px;width:24px}.alert__info-wrapper .close-icon-wrapper button:focus{outline:2px solid #0A8276;outline-offset:2px}.alert{display:flex;border:1px solid #0A8276;border-radius:1px;color:#1D1D1D;background-color:#FFFFFF;font-family:var(--ifx-font-family);box-shadow:0px 6px 9px 0px rgba(29, 29, 29, 0.1019607843)}.alert .close-icon-wrapper{display:flex;align-items:center;justify-content:center;min-width:40px}.alert .close-icon-wrapper button{all:unset;display:flex;align-items:center;justify-content:center;line-height:0;color:#1D1D1D;height:24px;width:24px}.alert .close-icon-wrapper button:focus{outline:2px solid #0A8276;outline-offset:2px}.alert .icon-wrapper{position:relative;min-width:48px;display:flex;justify-content:center;align-items:center;background-color:#0A8276}.alert .alert-text{font-size:16px;width:100%;padding:12px 0px 12px 12px;color:#1D1D1D;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere;}.alert.primary{border:1px solid #0A8276}.alert.primary .icon-wrapper{background-color:#0A8276;color:#FFFFFF}.alert.success{border:1px solid #4CA460}.alert.success .icon-wrapper{background-color:#4CA460;color:#FFFFFF}.alert.danger{border:1px solid #CD002F}.alert.danger .icon-wrapper{background-color:#CD002F;color:#FFFFFF}.alert.warning{border:1px solid #E16B25}.alert.warning .icon-wrapper{background-color:#E16B25;color:#FFFFFF}.close-icon-wrapper ifx-icon:hover{cursor:pointer}";
5
4
  const IfxAlertStyle0 = alertCss;
@@ -32,38 +31,6 @@ const Alert = class {
32
31
  if (!this.uniqueId) {
33
32
  this.uniqueId = this.generateUniqueId('alert');
34
33
  }
35
- this.initalizeTracking();
36
- }
37
- initalizeTracking() {
38
- (function (t, r, kk, n, pp) {
39
- if (typeof window.btntConfig !== "object") {
40
- window.btntConfig = {
41
- domain: "https://ssgtm.infineon.com",
42
- withCookies: true,
43
- maxBatchSize: 10
44
- };
45
- }
46
- if (window["btnt"])
47
- return;
48
- window["btnt"] = function (z) {
49
- if (typeof z !== "object") {
50
- z = {};
51
- }
52
- if (typeof window.btntQueue !== "object") {
53
- window.btntQueue = [];
54
- }
55
- window.btntQueue.push(z);
56
- };
57
- n = t.createElement(r);
58
- pp = t.getElementsByTagName(r)[0];
59
- n.async = 1;
60
- n.src = window.btntConfig.domain + "/btnt.js";
61
- pp.parentNode.insertBefore(n, pp);
62
- })(document, "script");
63
- window.btnt({
64
- event_name: "component_initialized",
65
- component_name: 'ifx-alert',
66
- });
67
34
  }
68
35
  render() {
69
36
  return this.variant === 'info' ? (h("div", { class: "alert__info-wrapper", role: "alert", "aria-live": this.AriaLive, "aria-describedby": this.alertTypeDescription[this.variant], "aria-labelledby": "alert-text alert-description" }, h("div", { class: "info__text-wrapper" }, h("div", { class: "info__headline-wrapper" }, h("slot", { name: "headline" })), h("div", { id: `alert-description-${this.uniqueId}`, class: "info__description-wrapper" }, h("slot", { name: "desc" }))), this.closable ? this.renderCloseButton() : null)) : (h("div", { class: `alert ${this.variant}`, role: "alert" }, this.icon && (h("div", { class: "icon-wrapper" }, h("ifx-icon", { icon: this.icon }))), h("div", { class: "alert-text", id: `alert-text-${this.uniqueId}` }, h("slot", null)), this.closable ? this.renderCloseButton() : null));
@@ -71,93 +38,153 @@ const Alert = class {
71
38
  };
72
39
  Alert.style = IfxAlertStyle0;
73
40
 
74
- const infineonIconStencilCss = "ifx-icon{display:inline-flex;justify-content:center}ifx-icon:empty{display:none}";
75
- const IfxIconStyle0 = infineonIconStencilCss;
41
+ const templateCss = ".react__template-wrapper{display:flex;width:300px;height:200px;border-radius:3px;border:1px solid #ccc}.react__template-wrapper.hide{display:none}.react__template-wrapper:hover{cursor:pointer}.template__page-wrapper{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.template__page-wrapper .repository__url{text-decoration:none}.input__fields-wrapper{display:flex;flex-direction:column;gap:10px}.details__wrapper{display:flex;flex-direction:column;gap:10px}.selection__buttons-wrapper{display:flex;gap:10px;padding-top:10px;align-items:center}.selection__buttons-wrapper .vue__label{color:#ccc}.selection__buttons-wrapper label:not(.vue__label):hover{cursor:pointer}.selection__buttons-wrapper .selection__input{display:flex;align-items:center;gap:5px}.selection__buttons-wrapper .selection__input input{margin:0;height:20px;width:20px}.selection__buttons-wrapper .selection__input input:hover:not(.vue__input){cursor:pointer}.image__wrapper img{position:relative;width:300px;height:100%;border-radius:3px;object-fit:contain;transition:transform 0.2s}.image__wrapper img:hover{transform:scale(2);top:50px;z-index:100}";
42
+ const IfxTemplateStyle0 = templateCss;
76
43
 
77
- const InfineonIconStencil = class {
44
+ const Template = class {
78
45
  constructor(hostRef) {
79
46
  registerInstance(this, hostRef);
80
- this.consoleError = createEvent(this, "consoleError", 7);
81
- this.icon = "";
82
- }
83
- updateIcon(newIcon) {
84
- this.internalIcon = newIcon;
85
- this.setIcon();
86
- }
87
- convertStringToHtml(htmlString) {
88
- const div = document.createElement('div');
89
- div.innerHTML = htmlString;
90
- return div.firstChild;
91
- }
92
- convertHtmlToObject(htmlElement) {
93
- let pathToObject = Array
94
- .from(htmlElement.attributes, ({ name, value }) => ({ name, value }))
95
- .reduce((acc, current) => {
96
- acc[current.name] = current.value;
97
- return acc;
98
- }, {});
99
- return pathToObject;
100
- }
101
- convertPathsToVnode(htmlPath) {
102
- let svgPaths = [];
103
- const parentPath = this.convertHtmlToObject(htmlPath);
104
- const parentPathToVnode = h("path", parentPath);
105
- svgPaths.push(parentPathToVnode);
106
- if (htmlPath.firstChild) {
107
- const paths = htmlPath.querySelectorAll('path');
108
- const pathLength = htmlPath.querySelectorAll('path').length;
109
- for (let i = 0; i < pathLength; i++) {
110
- let pathToObject = this.convertHtmlToObject(paths[i]);
111
- let objToVnode = h("path", pathToObject);
112
- svgPaths.push(objToVnode);
47
+ this.toggleTemplates = createEvent(this, "toggleTemplates", 7);
48
+ this.fieldError = createEvent(this, "fieldError", 7);
49
+ this.repoDetails = { name: "", desc: "", framework: "" };
50
+ this.showDetails = false;
51
+ this.isTemplatePage = false;
52
+ this.isLoading = true;
53
+ this.clientId = 'Ov23lixmXiNTTNb6V5W6';
54
+ this.redirectUri = 'https://infineon.github.io/infineon-design-system-stencil/?path=/docs/dds-templates--development';
55
+ this.scope = 'repo workflow';
56
+ this.state = 'template123';
57
+ }
58
+ authUser() {
59
+ const authorizationUrl = `https://github.com/login/oauth/authorize?` +
60
+ `client_id=${this.clientId}&` +
61
+ `redirect_uri=${this.redirectUri}&` +
62
+ `scope=${this.scope}&` +
63
+ `state=${this.state}`;
64
+ window.open(authorizationUrl, '_blank');
65
+ }
66
+ componentDidLoad() {
67
+ const url = new URL(window.location.href);
68
+ const code = url.searchParams.get('code');
69
+ const { templateName } = this.getLocalStorageValues();
70
+ if (code && this.name === templateName) {
71
+ this.isTemplatePage = true;
72
+ this.toggleTemplates.emit('details');
73
+ this.getUserToken(code);
74
+ }
75
+ }
76
+ getLocalStorageValues() {
77
+ const repoName = localStorage.getItem('repo_name');
78
+ const repoDesc = localStorage.getItem('repo_desc');
79
+ const repoFramework = localStorage.getItem('repo_framework');
80
+ const templateName = localStorage.getItem('selectedTemplate');
81
+ return { repoName, repoDesc, repoFramework, templateName };
82
+ }
83
+ async getUserToken(authCode) {
84
+ const { repoName, repoDesc, repoFramework, templateName } = this.getLocalStorageValues();
85
+ fetch(`https://ddstemplate-srv.cfapps.eu10-004.hana.ondemand.com/token/${authCode}/${repoName}/${repoDesc}/${repoFramework}/${templateName}`)
86
+ .then(response => {
87
+ if (response.ok) {
88
+ return response.text();
89
+ }
90
+ else {
91
+ return response.text().then(errorMessage => {
92
+ throw new Error(errorMessage);
93
+ });
113
94
  }
95
+ })
96
+ .then(data => {
97
+ if (data) {
98
+ this.isLoading = false;
99
+ this.repoUrl = data;
100
+ localStorage.clear();
101
+ }
102
+ })
103
+ .catch(error => {
104
+ this.repoError = error.message;
105
+ console.error('Error:', error.message);
106
+ });
107
+ }
108
+ handleUserInput(e, type) {
109
+ if (type === 'name') {
110
+ this.repoDetails = Object.assign(Object.assign({}, this.repoDetails), { name: e.target.value });
114
111
  }
115
- return svgPaths;
116
- }
117
- getSVG(svgPath) {
118
- const htmlPath = this.convertStringToHtml(this.ifxIcon);
119
- const width = htmlPath.getAttribute('width');
120
- const height = htmlPath.getAttribute('height');
121
- const fill = htmlPath.getAttribute('fill');
122
- const viewBox = htmlPath.getAttribute('viewBox');
123
- return h("svg", { class: "inline-svg", width: width, height: height, xmlns: "http://www.w3.org/2000/svg", fill: fill, viewBox: viewBox }, ...svgPath);
124
- }
125
- constructIcon() {
126
- if (this.ifxIcon) {
127
- const htmlPath = this.convertStringToHtml(this.ifxIcon);
128
- const svgPath = this.convertPathsToVnode(htmlPath);
129
- const SVG = this.getSVG(svgPath);
130
- return SVG;
112
+ else if (type === 'desc') {
113
+ this.repoDetails = Object.assign(Object.assign({}, this.repoDetails), { desc: e.target.value });
131
114
  }
132
- else if (this.icon !== "") {
133
- console.error('Icon not found!');
134
- this.consoleError.emit(true);
135
- return;
115
+ else if (type === 'framework') {
116
+ this.repoDetails = Object.assign(Object.assign({}, this.repoDetails), { framework: e.target.value });
117
+ }
118
+ }
119
+ submitUserData() {
120
+ if (this.repoDetails.name && this.repoDetails.desc && this.repoDetails.framework) {
121
+ localStorage.setItem('repo_name', this.repoDetails.name);
122
+ localStorage.setItem('repo_desc', this.repoDetails.desc);
123
+ localStorage.setItem('repo_framework', this.repoDetails.framework);
124
+ localStorage.setItem('selectedTemplate', this.name);
125
+ this.fieldError.emit(false);
126
+ this.authUser();
136
127
  }
137
128
  else {
138
- return;
129
+ this.fieldError.emit('All fields are mandatory');
130
+ }
131
+ }
132
+ togglePadding(action) {
133
+ let parent = this.el.parentElement;
134
+ if (parent) {
135
+ const rootNode = parent.getRootNode();
136
+ if (rootNode instanceof ShadowRoot) {
137
+ parent = rootNode.host.parentElement;
138
+ }
139
+ else {
140
+ parent = parent.parentElement;
141
+ }
142
+ if (action === 'remove') {
143
+ parent.parentElement.style.padding = '0px';
144
+ }
145
+ else if (action === 'add') {
146
+ parent.parentElement.style.padding = '4rem 20px';
147
+ }
139
148
  }
140
149
  }
141
- setIcon() {
142
- const toCamelCase = str => str
143
- .replace(/[-_]+(.)/g, (_, chr) => chr.toUpperCase()) // handle - and _ to uppercase
144
- .replace(/^(.)/, (m) => m.toLowerCase()); // ensure first letter is lowercase
145
- const iconName = toCamelCase(this.internalIcon);
146
- this.ifxIcon = getIcon(iconName);
150
+ handleCurrentTemplate(e) {
151
+ if (e && !this.showDetails) {
152
+ this.togglePadding('remove');
153
+ const targetTemplate = e.currentTarget;
154
+ this.toggleTemplates.emit(targetTemplate);
155
+ this.showDetails = true;
156
+ }
147
157
  }
148
- componentWillLoad() {
149
- this.internalIcon = this.icon;
150
- this.setIcon();
158
+ async toggleTemplate(currTemp) {
159
+ const templateWrapper = this.el.shadowRoot.querySelector('.react__template-wrapper');
160
+ if (templateWrapper) {
161
+ if (!templateWrapper.classList.contains('hide') && currTemp) {
162
+ if (templateWrapper !== currTemp) {
163
+ templateWrapper.classList.add('hide');
164
+ }
165
+ }
166
+ else {
167
+ if (this.showDetails) {
168
+ this.showDetails = false;
169
+ }
170
+ this.togglePadding('add');
171
+ templateWrapper.classList.remove('hide');
172
+ }
173
+ }
151
174
  }
152
175
  render() {
153
- return (h(Host, { key: '28a16b1fa9ecc7e956d9012e18e0d7ca71d839b2' }, this.constructIcon()));
154
- }
155
- static get watchers() { return {
156
- "icon": ["updateIcon"]
157
- }; }
176
+ return (h("div", { key: '993f20bb1a7970d938d09ea001ee77b777d2a817' }, this.isTemplatePage
177
+ ?
178
+ h("div", { class: "template__page-wrapper" }, !this.repoUrl && !this.repoError &&
179
+ h("div", null, h("h3", null, "Your repository is getting ready.."), h("p", null, "This will only take a minute.")), this.isLoading && !this.repoError && h("div", null, h("ifx-spinner", { variant: 'default', size: 's' })), this.repoUrl && h("ifx-link", { href: this.repoUrl, target: "_parent", size: "m", variant: "underlined" }, "Your repository"), this.repoError && h("div", null, this.repoError))
180
+ :
181
+ h("div", { class: "react__template-container" }, h("div", { class: "react__template-wrapper", onClick: (e) => this.handleCurrentTemplate(e) }, h("div", { class: "image__wrapper" }, h("img", { src: this.thumbnail }))), this.showDetails &&
182
+ h("div", { class: "details__wrapper" }, h("div", { class: "selection__buttons-wrapper" }, h("div", { class: "selection__input" }, h("input", { type: "radio", id: "react", name: "chosen_framework", value: "react", onInput: (e) => this.handleUserInput(e, 'framework') }), h("label", { htmlFor: "react" }, "React")), h("div", { class: "selection__input vue" }, h("input", { class: "vue__input", disabled: true, type: "radio", id: "vue", name: "chosen_framework", value: "vue", onInput: (e) => this.handleUserInput(e, 'framework') }), h("label", { class: "vue__label", htmlFor: "vue" }, "Vue"), " (Soon)")), h("div", { class: "input__fields-wrapper" }, h("ifx-text-field", { required: true, onInput: (e) => this.handleUserInput(e, 'name'), size: "m", icon: "c-info-16", placeholder: "Your repository name" }, "Repository Name"), h("ifx-text-field", { required: true, size: "m", icon: "c-info-16", onInput: (e) => this.handleUserInput(e, 'desc'), placeholder: "Your repository description" }, "Repository Description"), h("ifx-button", { fullWidth: true, onClick: () => this.submitUserData(), variant: 'primary' }, "Generate template"))))));
183
+ }
184
+ get el() { return getElement(this); }
158
185
  };
159
- InfineonIconStencil.style = IfxIconStyle0;
186
+ Template.style = IfxTemplateStyle0;
160
187
 
161
- export { Alert as ifx_alert, InfineonIconStencil as ifx_icon };
188
+ export { Alert as ifx_alert, Template as ifx_template };
162
189
 
163
190
  //# sourceMappingURL=ifx-alert_2.entry.js.map
@@ -1 +1 @@
1
- {"file":"ifx-alert.ifx-icon.entry.js","mappings":";;;AAAA,MAAM,QAAQ,GAAG,8mFAA8mF,CAAC;AAChoF,uBAAe,QAAQ;;MCcV,KAAK;IALlB;;;QAMU,YAAO,GAA0D,SAAS,CAAC;QAG3E,aAAQ,GAAY,IAAI,CAAC;QACzB,aAAQ,GAAG,WAAW,CAAC;QAG/B,yBAAoB,GAAG;YACrB,SAAS,EAAE,eAAe;YAC1B,SAAS,EAAE,eAAe;YAC1B,QAAQ,EAAE,aAAa;YACvB,SAAS,EAAE,eAAe;YAC1B,MAAM,EAAE,eAAe;SACxB,CAAC;KA6FH;IA3FC,WAAW;QACT,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACtB;IAED,iBAAiB;QACf,QACE,WAAK,KAAK,EAAC,oBAAoB,IAC7B,cAAQ,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAa,eAAe,IACtE,gBAAU,IAAI,EAAC,UAAU,GAAG,CACrB,CACL,EACN;KACH;IAED,gBAAgB,CAAC,MAAM,GAAG,IAAI;QAC5B,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;KAClE;IAED,iBAAiB;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,Q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CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;KAClC;IAEC,iBAAiB;QACf,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAA;KACf;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACJ,IAAI,CAAC,aAAa,EAAE,CACd,EACP;KACH;;;;;;;;;","names":[],"sources":["src/components/alert/alert.scss?tag=ifx-alert&encapsulation=shadow","src/components/alert/alert.tsx","src/components/icon/infineonIconStencil.scss?tag=ifx-icon","src/components/icon/infineonIconStencil.tsx"],"sourcesContent":["@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n:host {\n display: block;\n}\n\n.alert__info-wrapper {\n display: flex;\n padding: 16px 24px;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n box-shadow: 0px 6px 9px 0px #1D1D1D1A;\n\n & .info__text-wrapper {\n display: flex;\n flex-direction: column;\n gap: tokens.$ifxSpace100;\n width: 100%;\n\n & .info__headline-wrapper {\n display: -webkit-box;\n -webkit-line-clamp: 1;\n line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n & .info__headline-wrapper,\n .info__description-wrapper {\n color: #1D1D1D;\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px;\n\n ::slotted(p) {\n padding: 0;\n margin: 0;\n }\n }\n\n & .info__description-wrapper {\n font-weight: 400;\n }\n }\n\n & .close-icon-wrapper {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n //min-width: tokens.$ifxSize500;\n\n & button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n color: tokens.$ifxColorBaseBlack;\n height: tokens.$ifxSize300;\n width: tokens.$ifxSize300;\n\n\n &:focus {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n }\n }\n }\n}\n\n.alert {\n display: flex;\n border: 1px solid tokens.$ifxColorOcean500;\n border-radius: tokens.$ifxBorderRadius12;\n color: tokens.$ifxColorBaseBlack;\n background-color: tokens.$ifxColorBaseWhite;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n box-shadow: 0px 6px 9px 0px #1D1D1D1A;\n\n\n & .close-icon-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: tokens.$ifxSize500;\n\n & button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n color: tokens.$ifxColorBaseBlack;\n height: tokens.$ifxSize300;\n width: tokens.$ifxSize300;\n\n &:focus {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n }\n }\n }\n\n & .icon-wrapper {\n position: relative;\n min-width: tokens.$ifxSize600;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: tokens.$ifxColorOcean500;\n }\n\n & .alert-text {\n font-size: 16px;\n width: 100%;\n padding: 12px 0px 12px 12px;\n color: tokens.$ifxColorBaseBlack;\n\n white-space: pre-wrap;\n /* wraps text at spaces and within words */\n word-wrap: break-word;\n /* breaks text within a word if necessary */\n overflow-wrap: anywhere;\n /* breaks text at arbitrary points when needed */\n }\n\n &.primary {\n border: 1px solid tokens.$ifxColorOcean500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorOcean500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.success {\n border: 1px solid tokens.$ifxColorGreen500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorGreen500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.danger {\n border: 1px solid tokens.$ifxColorRed500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorRed500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.warning {\n border: 1px solid tokens.$ifxColorOrange500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorOrange500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n}\n\n.close-icon-wrapper {\n & ifx-icon {\n &:hover {\n cursor: pointer;\n }\n }\n}","import { Component, Prop, h, Event, EventEmitter, State } from '@stencil/core';\n\ndeclare global {\n interface Window {\n btntConfig?: any;\n btntQueue?: any;\n btnt?: any;\n }\n}\n\n@Component({\n tag: 'ifx-alert',\n styleUrl: 'alert.scss',\n shadow: true,\n})\nexport class Alert {\n @Prop() variant: 'primary' | 'success' | 'danger' | 'warning' | 'info' = 'primary';\n @Prop() icon: string;\n @Event() ifxClose: EventEmitter;\n @Prop() closable: boolean = true;\n @Prop() AriaLive = 'assertive';\n @State() uniqueId: string;\n\n alertTypeDescription = {\n \"primary\": 'Neutral alert',\n \"success\": 'Success Alert',\n \"danger\": 'Error Alert',\n \"warning\": 'Warning Alert',\n \"info\": 'Neutral alert',\n };\n\n handleClose() {\n this.ifxClose.emit();\n }\n\n renderCloseButton() {\n return (\n <div class=\"close-icon-wrapper\">\n <button onClick={this.handleClose.bind(this)} aria-label=\"Dismiss alert\">\n <ifx-icon icon=\"cross-16\" />\n </button>\n </div>\n );\n }\n\n generateUniqueId(prefix = 'id') {\n return `${prefix}-${Math.random().toString(36).substring(2, 9)}`;\n }\n\n componentWillLoad() { \n if (!this.uniqueId) {\n this.uniqueId = this.generateUniqueId('alert');\n }\n\n this.initalizeTracking()\n \n\n }\n\n initalizeTracking() { \n (function (t, r, kk, n, pp) {\n if (typeof window.btntConfig !== \"object\") {\n window.btntConfig = {\n domain: \"https://ssgtm.infineon.com\",\n withCookies: true,\n maxBatchSize: 10\n };\n }\n\n if (window[\"btnt\"]) return;\n\n window[\"btnt\"] = function (z) {\n if (typeof z !== \"object\") {\n z = {};\n }\n if (typeof window.btntQueue !== \"object\") {\n window.btntQueue = [];\n }\n window.btntQueue.push(z);\n };\n\n n = t.createElement(r);\n pp = t.getElementsByTagName(r)[0];\n n.async = 1;\n n.src = window.btntConfig.domain + \"/btnt.js\";\n pp.parentNode.insertBefore(n, pp);\n \n })(document, \"script\", );\n\n window.btnt({\n event_name: \"component_initialized\",\n component_name: 'ifx-alert',\n })\n }\n\n render() {\n return this.variant === 'info' ? (\n <div class=\"alert__info-wrapper\" role=\"alert\" aria-live={this.AriaLive} aria-describedby={this.alertTypeDescription[this.variant]} aria-labelledby=\"alert-text alert-description\">\n <div class=\"info__text-wrapper\">\n <div class=\"info__headline-wrapper\">\n <slot name=\"headline\" />\n </div>\n <div id={`alert-description-${this.uniqueId}`} class=\"info__description-wrapper\">\n <slot name=\"desc\" />\n </div>\n </div>\n {this.closable ? this.renderCloseButton() : null}\n </div>\n ) : (\n <div class={`alert ${this.variant}`} role=\"alert\">\n {this.icon && (\n <div class=\"icon-wrapper\">\n <ifx-icon icon={this.icon} />\n </div>\n )}\n <div class=\"alert-text\" id={`alert-text-${this.uniqueId}`}>\n <slot />\n </div>\n {this.closable ? this.renderCloseButton() : null}\n </div>\n );\n }\n}\n","ifx-icon {\n display: inline-flex;\n justify-content: center;\n\n &:empty {\n display: none;\n }\n}","import { Component, Prop, h, Host, Event, EventEmitter, Watch, State } from '@stencil/core';\nimport { getIcon } from '@infineon/infineon-icons'\n \n\n\n@Component({\n tag: 'ifx-icon',\n styleUrl: './infineonIconStencil.scss'\n})\n\nexport class InfineonIconStencil {\n @Prop({ mutable: true }) icon: string = \"\"\n @Prop({ mutable: true }) ifxIcon: any;\n @State() internalIcon: string;\n @Event() consoleError: EventEmitter<boolean>;\n\n @Watch('icon')\n updateIcon(newIcon: string) { \n this.internalIcon = newIcon;\n this.setIcon()\n }\n\n convertStringToHtml(htmlString) { \n const div = document.createElement('div')\n div.innerHTML = htmlString\n return div.firstChild\n }\n\n convertHtmlToObject(htmlElement) { \n let pathToObject = Array\n .from(htmlElement.attributes, ({ name, value }) => ({ name, value }))\n .reduce((acc, current) => {\n acc[current.name] = current.value\n return acc\n }, {})\n\n return pathToObject\n }\n\n convertPathsToVnode(htmlPath) { \n let svgPaths = []\n const parentPath = this.convertHtmlToObject(htmlPath);\n const parentPathToVnode = h(\"path\", parentPath);\n svgPaths.push(parentPathToVnode)\n if(htmlPath.firstChild) { \n const paths = htmlPath.querySelectorAll('path');\n const pathLength = htmlPath.querySelectorAll('path').length;\n for(let i = 0; i < pathLength; i++) { \n let pathToObject = this.convertHtmlToObject(paths[i])\n let objToVnode = h(\"path\", pathToObject)\n svgPaths.push(objToVnode)\n } \n }\n return svgPaths\n }\n\n getSVG(svgPath) {\n const htmlPath = this.convertStringToHtml(this.ifxIcon) as SVGElement;\n const width = htmlPath.getAttribute('width');\n const height = htmlPath.getAttribute('height');\n const fill = htmlPath.getAttribute('fill');\n const viewBox = htmlPath.getAttribute('viewBox');\n \n return <svg class=\"inline-svg\" width={width} height={height} xmlns=\"http://www.w3.org/2000/svg\" fill={fill} viewBox={viewBox}>{...svgPath}</svg>\n }\n\n constructIcon() {\n if(this.ifxIcon) {\n const htmlPath = this.convertStringToHtml(this.ifxIcon)\n const svgPath = this.convertPathsToVnode(htmlPath)\n const SVG = this.getSVG(svgPath)\n return SVG;\n } else if(this.icon !== \"\") {\n console.error('Icon not found!')\n this.consoleError.emit(true)\n return;\n } else { \n return;\n }\n }\n\nsetIcon() { \n const toCamelCase = str =>\n str\n .replace(/[-_]+(.)/g, (_, chr) => chr.toUpperCase()) // handle - and _ to uppercase\n .replace(/^(.)/, (m) => m.toLowerCase()); // ensure first letter is lowercase\n\n const iconName = toCamelCase(this.internalIcon);\n this.ifxIcon = getIcon(iconName);\n}\n\n componentWillLoad() {\n this.internalIcon = this.icon;\n this.setIcon()\n }\n\n render() {\n return (\n <Host>\n {this.constructIcon()}\n </Host>\n );\n }\n}"],"version":3}
1
+ {"file":"ifx-alert.ifx-template.entry.js","mappings":";;AAAA,MAAM,QAAQ,GAAG,8mFAA8mF,CAAC;AACh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E,WAAW,EAAC,6BAA6B,6BAAwC,EAE5L,kBAAY,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,EAAE,OAAO,EAAC,SAAS,wBAA+B,CAC/G,CAEF,CACF,CACF,EACN;KACL;;;;;;;","names":[],"sources":["src/components/alert/alert.scss?tag=ifx-alert&encapsulation=shadow","src/components/alert/alert.tsx","src/components/templates/template/template.scss?tag=ifx-template&encapsulation=shadow","src/components/templates/template/template.tsx"],"sourcesContent":["@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n:host {\n display: block;\n}\n\n.alert__info-wrapper {\n display: flex;\n padding: 16px 24px;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n box-shadow: 0px 6px 9px 0px #1D1D1D1A;\n\n & .info__text-wrapper {\n display: flex;\n flex-direction: column;\n gap: tokens.$ifxSpace100;\n width: 100%;\n\n & .info__headline-wrapper {\n display: -webkit-box;\n -webkit-line-clamp: 1;\n line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n & .info__headline-wrapper,\n .info__description-wrapper {\n color: #1D1D1D;\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px;\n\n ::slotted(p) {\n padding: 0;\n margin: 0;\n }\n }\n\n & .info__description-wrapper {\n font-weight: 400;\n }\n }\n\n & .close-icon-wrapper {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n //min-width: tokens.$ifxSize500;\n\n & button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n color: tokens.$ifxColorBaseBlack;\n height: tokens.$ifxSize300;\n width: tokens.$ifxSize300;\n\n\n &:focus {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n }\n }\n }\n}\n\n.alert {\n display: flex;\n border: 1px solid tokens.$ifxColorOcean500;\n border-radius: tokens.$ifxBorderRadius12;\n color: tokens.$ifxColorBaseBlack;\n background-color: tokens.$ifxColorBaseWhite;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n box-shadow: 0px 6px 9px 0px #1D1D1D1A;\n\n\n & .close-icon-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: tokens.$ifxSize500;\n\n & button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n color: tokens.$ifxColorBaseBlack;\n height: tokens.$ifxSize300;\n width: tokens.$ifxSize300;\n\n &:focus {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n }\n }\n }\n\n & .icon-wrapper {\n position: relative;\n min-width: tokens.$ifxSize600;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: tokens.$ifxColorOcean500;\n }\n\n & .alert-text {\n font-size: 16px;\n width: 100%;\n padding: 12px 0px 12px 12px;\n color: tokens.$ifxColorBaseBlack;\n\n white-space: pre-wrap;\n /* wraps text at spaces and within words */\n word-wrap: break-word;\n /* breaks text within a word if necessary */\n overflow-wrap: anywhere;\n /* breaks text at arbitrary points when needed */\n }\n\n &.primary {\n border: 1px solid tokens.$ifxColorOcean500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorOcean500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.success {\n border: 1px solid tokens.$ifxColorGreen500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorGreen500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.danger {\n border: 1px solid tokens.$ifxColorRed500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorRed500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.warning {\n border: 1px solid tokens.$ifxColorOrange500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorOrange500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n}\n\n.close-icon-wrapper {\n & ifx-icon {\n &:hover {\n cursor: pointer;\n }\n }\n}","import { Component, Prop, h, Event, EventEmitter, State } from '@stencil/core';\n\n@Component({\n tag: 'ifx-alert',\n styleUrl: 'alert.scss',\n shadow: true,\n})\nexport class Alert {\n @Prop() variant: 'primary' | 'success' | 'danger' | 'warning' | 'info' = 'primary';\n @Prop() icon: string;\n @Event() ifxClose: EventEmitter;\n @Prop() closable: boolean = true;\n @Prop() AriaLive = 'assertive';\n @State() uniqueId: string;\n\n alertTypeDescription = {\n \"primary\": 'Neutral alert',\n \"success\": 'Success Alert',\n \"danger\": 'Error Alert',\n \"warning\": 'Warning Alert',\n \"info\": 'Neutral alert',\n };\n\n handleClose() {\n this.ifxClose.emit();\n }\n\n renderCloseButton() {\n return (\n <div class=\"close-icon-wrapper\">\n <button onClick={this.handleClose.bind(this)} aria-label=\"Dismiss alert\">\n <ifx-icon icon=\"cross-16\" />\n </button>\n </div>\n );\n }\n\n generateUniqueId(prefix = 'id') {\n return `${prefix}-${Math.random().toString(36).substring(2, 9)}`;\n }\n\n componentWillLoad() { \n if (!this.uniqueId) {\n this.uniqueId = this.generateUniqueId('alert');\n }\n }\n\n render() {\n return this.variant === 'info' ? (\n <div class=\"alert__info-wrapper\" role=\"alert\" aria-live={this.AriaLive} aria-describedby={this.alertTypeDescription[this.variant]} aria-labelledby=\"alert-text alert-description\">\n <div class=\"info__text-wrapper\">\n <div class=\"info__headline-wrapper\">\n <slot name=\"headline\" />\n </div>\n <div id={`alert-description-${this.uniqueId}`} class=\"info__description-wrapper\">\n <slot name=\"desc\" />\n </div>\n </div>\n {this.closable ? this.renderCloseButton() : null}\n </div>\n ) : (\n <div class={`alert ${this.variant}`} role=\"alert\">\n {this.icon && (\n <div class=\"icon-wrapper\">\n <ifx-icon icon={this.icon} />\n </div>\n )}\n <div class=\"alert-text\" id={`alert-text-${this.uniqueId}`}>\n <slot />\n </div>\n {this.closable ? this.renderCloseButton() : null}\n </div>\n );\n }\n}\n","\n.react__template-wrapper { \n display: flex;\n width: 300px;\n height: 200px;\n border-radius: 3px;\n border: 1px solid #ccc;\n\n &.hide { \n display: none;\n }\n \n &:hover { \n cursor: pointer;\n }\n}\n\n.template__page-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n\n & .repository__url { \n text-decoration: none;\n }\n}\n\n.input__fields-wrapper { \n display: flex;\n flex-direction: column;\n gap: 10px;\n\n}\n\n.details__wrapper { \n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.selection__buttons-wrapper { \n display: flex;\n gap: 10px;\n padding-top: 10px;\n align-items: center;\n & .vue__label { \n color: #ccc;\n }\n\n & label:not(.vue__label) { \n &:hover { \n cursor: pointer;\n }\n }\n\n & .selection__input { \n display: flex;\n align-items: center;\n gap: 5px;\n & input { \n margin: 0;\n height: 20px;\n width: 20px;\n &:hover:not(.vue__input) { \n cursor: pointer;\n }\n }\n }\n}\n\n.image__wrapper { \n img { \n position: relative;\n width: 300px;\n height: 100%;\n border-radius: 3px;\n object-fit: contain;\n transition: transform .2s;\n &:hover { \n transform: scale(2);\n top: 50px;\n z-index: 100;\n }\n }\n}","import { Component, h, Element, State, Prop, Event, EventEmitter, Method } from '@stencil/core';\n\n@Component({\n tag: 'ifx-template',\n styleUrl: 'template.scss',\n shadow: true,\n})\nexport class Template {\n @Element() el: HTMLElement;\n @State() repoDetails: { name: string, desc: string, framework: string } = { name: \"\", desc: \"\", framework: \"\" };\n @State() repoUrl: string;\n @State() showDetails: boolean = false;\n @State() isTemplatePage: boolean = false;\n @State() isLoading: boolean = true;\n @State() repoError: string;\n @Prop() name: string;\n @Event() toggleTemplates: EventEmitter;\n @Event() fieldError: EventEmitter;\n @Prop() thumbnail: string;\n \n private clientId = 'Ov23lixmXiNTTNb6V5W6'\n private redirectUri = 'https://infineon.github.io/infineon-design-system-stencil/?path=/docs/dds-templates--development';\n private scope = 'repo workflow'\n private state = 'template123'\n\n authUser() { \n const authorizationUrl = `https://github.com/login/oauth/authorize?` +\n `client_id=${this.clientId}&` +\n `redirect_uri=${this.redirectUri}&` +\n `scope=${this.scope}&` +\n `state=${this.state}`;\n \n window.open(authorizationUrl, '_blank'); \n }\n\n componentDidLoad() { \n const url = new URL(window.location.href);\n const code = url.searchParams.get('code');\n const { templateName } = this.getLocalStorageValues()\n if(code && this.name === templateName) { \n this.isTemplatePage = true;\n this.toggleTemplates.emit('details')\n this.getUserToken(code)\n } \n }\n\n getLocalStorageValues() { \n const repoName = localStorage.getItem('repo_name');\n const repoDesc = localStorage.getItem('repo_desc');\n const repoFramework = localStorage.getItem('repo_framework');\n const templateName = localStorage.getItem('selectedTemplate');\n return { repoName, repoDesc, repoFramework, templateName }\n }\n\n async getUserToken(authCode) {\n const { repoName, repoDesc, repoFramework, templateName } = this.getLocalStorageValues();\n\n fetch(`https://ddstemplate-srv.cfapps.eu10-004.hana.ondemand.com/token/${authCode}/${repoName}/${repoDesc}/${repoFramework}/${templateName}`)\n .then(response => {\n if (response.ok) {\n return response.text();\n } else {\n return response.text().then(errorMessage => {\n throw new Error(errorMessage);\n });\n }\n })\n .then(data => { \n if(data) { \n this.isLoading = false;\n this.repoUrl = data;\n localStorage.clear();\n } \n })\n .catch(error => {\n this.repoError = error.message;\n console.error('Error:', error.message)\n });\n }\n\n handleUserInput(e, type) { \n if (type === 'name') {\n this.repoDetails = { ...this.repoDetails, name: e.target.value };\n } else if (type === 'desc') {\n this.repoDetails = { ...this.repoDetails, desc: e.target.value };\n } else if(type === 'framework') { \n this.repoDetails = { ...this.repoDetails, framework: e.target.value };\n }\n }\n\n submitUserData() { \n if(this.repoDetails.name && this.repoDetails.desc && this.repoDetails.framework) { \n localStorage.setItem('repo_name', this.repoDetails.name);\n localStorage.setItem('repo_desc', this.repoDetails.desc);\n localStorage.setItem('repo_framework', this.repoDetails.framework);\n localStorage.setItem('selectedTemplate', this.name);\n this.fieldError.emit(false)\n this.authUser()\n } else { \n this.fieldError.emit('All fields are mandatory')\n }\n }\n\n togglePadding(action) { \n let parent = this.el.parentElement;\n if (parent) {\n const rootNode = parent.getRootNode();\n if (rootNode instanceof ShadowRoot) {\n parent = rootNode.host.parentElement;\n } else {\n parent = parent.parentElement;\n }\n if(action === 'remove') { \n parent.parentElement.style.padding = '0px';\n } else if(action === 'add') { \n parent.parentElement.style.padding = '4rem 20px';\n }\n }\n }\n\n handleCurrentTemplate(e) { \n if(e && !this.showDetails) { \n this.togglePadding('remove')\n const targetTemplate = e.currentTarget;\n this.toggleTemplates.emit(targetTemplate)\n this.showDetails = true;\n } \n }\n\n @Method()\n async toggleTemplate(currTemp) { \n const templateWrapper = this.el.shadowRoot.querySelector('.react__template-wrapper');\n if(templateWrapper) { \n if(!templateWrapper.classList.contains('hide') && currTemp ) { \n if(templateWrapper !== currTemp) {\n templateWrapper.classList.add('hide')\n }\n } else { \n if(this.showDetails) { \n this.showDetails = false;\n }\n this.togglePadding('add')\n templateWrapper.classList.remove('hide')\n }\n }\n }\n\n \n render() {\n return (\n <div>\n {this.isTemplatePage \n ? \n <div class=\"template__page-wrapper\">\n {!this.repoUrl && !this.repoError && \n <div>\n <h3>Your repository is getting ready..</h3>\n <p>This will only take a minute.</p>\n </div>}\n {this.isLoading && !this.repoError && <div><ifx-spinner variant='default' size='s' /></div>}\n {this.repoUrl && <ifx-link href={this.repoUrl} target=\"_parent\" size=\"m\" variant=\"underlined\">Your repository</ifx-link>}\n {this.repoError && <div>{this.repoError}</div>}\n </div> \n : \n <div class=\"react__template-container\">\n <div class=\"react__template-wrapper\" onClick={(e) => this.handleCurrentTemplate(e)}>\n <div class=\"image__wrapper\">\n <img src={this.thumbnail} />\n </div>\n </div>\n {this.showDetails && \n <div class=\"details__wrapper\">\n <div class=\"selection__buttons-wrapper\">\n <div class=\"selection__input\">\n <input type=\"radio\" id=\"react\" name=\"chosen_framework\" value=\"react\" onInput={(e) => this.handleUserInput(e, 'framework')} />\n <label htmlFor=\"react\">React</label>\n </div>\n <div class=\"selection__input vue\">\n <input class=\"vue__input\" disabled type=\"radio\" id=\"vue\" name=\"chosen_framework\" value=\"vue\" onInput={(e) => this.handleUserInput(e, 'framework')}/>\n <label class=\"vue__label\" htmlFor=\"vue\">Vue</label> (Soon)\n </div>\n </div>\n \n\n <div class=\"input__fields-wrapper\">\n <ifx-text-field required={true} onInput={(e) => this.handleUserInput(e, 'name')} size=\"m\" icon=\"c-info-16\" placeholder=\"Your repository name\">Repository Name</ifx-text-field>\n\n <ifx-text-field required={true} size=\"m\" icon=\"c-info-16\" onInput={(e) => this.handleUserInput(e, 'desc')} placeholder=\"Your repository description\">Repository Description</ifx-text-field>\n\n <ifx-button fullWidth={true} onClick={() => this.submitUserData()} variant='primary'>Generate template</ifx-button>\n </div>\n \n </div>}\n </div>}\n </div>\n );\n }\n}"],"version":3}
@@ -0,0 +1,93 @@
1
+ import { r as registerInstance, c as createEvent, h, a as Host } from './index-6c9eba32.js';
2
+ import { g as getIcon } from './icons-75858876.js';
3
+
4
+ const infineonIconStencilCss = "ifx-icon{display:inline-flex;justify-content:center}ifx-icon:empty{display:none}";
5
+ const IfxIconStyle0 = infineonIconStencilCss;
6
+
7
+ const InfineonIconStencil = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.consoleError = createEvent(this, "consoleError", 7);
11
+ this.icon = "";
12
+ }
13
+ updateIcon(newIcon) {
14
+ this.internalIcon = newIcon;
15
+ this.setIcon();
16
+ }
17
+ convertStringToHtml(htmlString) {
18
+ const div = document.createElement('div');
19
+ div.innerHTML = htmlString;
20
+ return div.firstChild;
21
+ }
22
+ convertHtmlToObject(htmlElement) {
23
+ let pathToObject = Array
24
+ .from(htmlElement.attributes, ({ name, value }) => ({ name, value }))
25
+ .reduce((acc, current) => {
26
+ acc[current.name] = current.value;
27
+ return acc;
28
+ }, {});
29
+ return pathToObject;
30
+ }
31
+ convertPathsToVnode(htmlPath) {
32
+ let svgPaths = [];
33
+ const parentPath = this.convertHtmlToObject(htmlPath);
34
+ const parentPathToVnode = h("path", parentPath);
35
+ svgPaths.push(parentPathToVnode);
36
+ if (htmlPath.firstChild) {
37
+ const paths = htmlPath.querySelectorAll('path');
38
+ const pathLength = htmlPath.querySelectorAll('path').length;
39
+ for (let i = 0; i < pathLength; i++) {
40
+ let pathToObject = this.convertHtmlToObject(paths[i]);
41
+ let objToVnode = h("path", pathToObject);
42
+ svgPaths.push(objToVnode);
43
+ }
44
+ }
45
+ return svgPaths;
46
+ }
47
+ getSVG(svgPath) {
48
+ const htmlPath = this.convertStringToHtml(this.ifxIcon);
49
+ const width = htmlPath.getAttribute('width');
50
+ const height = htmlPath.getAttribute('height');
51
+ const fill = htmlPath.getAttribute('fill');
52
+ const viewBox = htmlPath.getAttribute('viewBox');
53
+ return h("svg", { class: "inline-svg", width: width, height: height, xmlns: "http://www.w3.org/2000/svg", fill: fill, viewBox: viewBox }, ...svgPath);
54
+ }
55
+ constructIcon() {
56
+ if (this.ifxIcon) {
57
+ const htmlPath = this.convertStringToHtml(this.ifxIcon);
58
+ const svgPath = this.convertPathsToVnode(htmlPath);
59
+ const SVG = this.getSVG(svgPath);
60
+ return SVG;
61
+ }
62
+ else if (this.icon !== "") {
63
+ console.error('Icon not found!');
64
+ this.consoleError.emit(true);
65
+ return;
66
+ }
67
+ else {
68
+ return;
69
+ }
70
+ }
71
+ setIcon() {
72
+ const toCamelCase = str => str
73
+ .replace(/[-_]+(.)/g, (_, chr) => chr.toUpperCase()) // handle - and _ to uppercase
74
+ .replace(/^(.)/, (m) => m.toLowerCase()); // ensure first letter is lowercase
75
+ const iconName = toCamelCase(this.internalIcon);
76
+ this.ifxIcon = getIcon(iconName);
77
+ }
78
+ componentWillLoad() {
79
+ this.internalIcon = this.icon;
80
+ this.setIcon();
81
+ }
82
+ render() {
83
+ return (h(Host, { key: '28a16b1fa9ecc7e956d9012e18e0d7ca71d839b2' }, this.constructIcon()));
84
+ }
85
+ static get watchers() { return {
86
+ "icon": ["updateIcon"]
87
+ }; }
88
+ };
89
+ InfineonIconStencil.style = IfxIconStyle0;
90
+
91
+ export { InfineonIconStencil as ifx_icon };
92
+
93
+ //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AC,OAAO,CAAC,CAAA;YAChC,OAAO,GAAG,CAAC;SACZ;aAAM,IAAG,IAAI,CAAC,IAAI,KAAK,EAAE,EAAE;YAC1B,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;YAChC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC5B,OAAO;SACR;aAAO;YACN,OAAO;SACR;KACF;IAEH,OAAO;QACL,MAAM,WAAW,GAAG,GAAG,IACrB,GAAG;aACA,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC,WAAW,EAAE,CAAC;aACnD,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;KAClC;IAEC,iBAAiB;QACf,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAA;KACf;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACJ,IAAI,CAAC,aAAa,EAAE,CACd,EACP;KACH;;;;;;;;;","names":[],"sources":["src/components/icon/infineonIconStencil.scss?tag=ifx-icon","src/components/icon/infineonIconStencil.tsx"],"sourcesContent":["ifx-icon {\n display: inline-flex;\n justify-content: center;\n\n &:empty {\n display: none;\n }\n}","import { Component, Prop, h, Host, Event, EventEmitter, Watch, State } from '@stencil/core';\nimport { getIcon } from '@infineon/infineon-icons'\n \n\n\n@Component({\n tag: 'ifx-icon',\n styleUrl: './infineonIconStencil.scss'\n})\n\nexport class InfineonIconStencil {\n @Prop({ mutable: true }) icon: string = \"\"\n @Prop({ mutable: true }) ifxIcon: any;\n @State() internalIcon: string;\n @Event() consoleError: EventEmitter<boolean>;\n\n @Watch('icon')\n updateIcon(newIcon: string) { \n this.internalIcon = newIcon;\n this.setIcon()\n }\n\n convertStringToHtml(htmlString) { \n const div = document.createElement('div')\n div.innerHTML = htmlString\n return div.firstChild\n }\n\n convertHtmlToObject(htmlElement) { \n let pathToObject = Array\n .from(htmlElement.attributes, ({ name, value }) => ({ name, value }))\n .reduce((acc, current) => {\n acc[current.name] = current.value\n return acc\n }, {})\n\n return pathToObject\n }\n\n convertPathsToVnode(htmlPath) { \n let svgPaths = []\n const parentPath = this.convertHtmlToObject(htmlPath);\n const parentPathToVnode = h(\"path\", parentPath);\n svgPaths.push(parentPathToVnode)\n if(htmlPath.firstChild) { \n const paths = htmlPath.querySelectorAll('path');\n const pathLength = htmlPath.querySelectorAll('path').length;\n for(let i = 0; i < pathLength; i++) { \n let pathToObject = this.convertHtmlToObject(paths[i])\n let objToVnode = h(\"path\", pathToObject)\n svgPaths.push(objToVnode)\n } \n }\n return svgPaths\n }\n\n getSVG(svgPath) {\n const htmlPath = this.convertStringToHtml(this.ifxIcon) as SVGElement;\n const width = htmlPath.getAttribute('width');\n const height = htmlPath.getAttribute('height');\n const fill = htmlPath.getAttribute('fill');\n const viewBox = htmlPath.getAttribute('viewBox');\n \n return <svg class=\"inline-svg\" width={width} height={height} xmlns=\"http://www.w3.org/2000/svg\" fill={fill} viewBox={viewBox}>{...svgPath}</svg>\n }\n\n constructIcon() {\n if(this.ifxIcon) {\n const htmlPath = this.convertStringToHtml(this.ifxIcon)\n const svgPath = this.convertPathsToVnode(htmlPath)\n const SVG = this.getSVG(svgPath)\n return SVG;\n } else if(this.icon !== \"\") {\n console.error('Icon not found!')\n this.consoleError.emit(true)\n return;\n } else { \n return;\n }\n }\n\nsetIcon() { \n const toCamelCase = str =>\n str\n .replace(/[-_]+(.)/g, (_, chr) => chr.toUpperCase()) // handle - and _ to uppercase\n .replace(/^(.)/, (m) => m.toLowerCase()); // ensure first letter is lowercase\n\n const iconName = toCamelCase(this.internalIcon);\n this.ifxIcon = getIcon(iconName);\n}\n\n componentWillLoad() {\n this.internalIcon = this.icon;\n this.setIcon()\n }\n\n render() {\n return (\n <Host>\n {this.constructIcon()}\n </Host>\n );\n }\n}"],"version":3}
@@ -67,10 +67,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
67
67
  }
68
68
  switch(bundleId) {
69
69
 
70
- case 'ifx-alert_2':
71
- return import(
72
- /* webpackMode: "lazy" */
73
- './ifx-alert_2.entry.js').then(processMod, consoleError);
74
70
  case 'ifx-badge':
75
71
  return import(
76
72
  /* webpackMode: "lazy" */
@@ -315,6 +311,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
315
311
  return import(
316
312
  /* webpackMode: "lazy" */
317
313
  './ifx-accordion_2.entry.js').then(processMod, consoleError);
314
+ case 'ifx-alert_2':
315
+ return import(
316
+ /* webpackMode: "lazy" */
317
+ './ifx-alert_2.entry.js').then(processMod, consoleError);
318
318
  case 'ifx-chip_3':
319
319
  return import(
320
320
  /* webpackMode: "lazy" */
@@ -335,10 +335,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
335
335
  return import(
336
336
  /* webpackMode: "lazy" */
337
337
  './ifx-radio-button.entry.js').then(processMod, consoleError);
338
- case 'ifx-template':
339
- return import(
340
- /* webpackMode: "lazy" */
341
- './ifx-template.entry.js').then(processMod, consoleError);
342
338
  case 'ifx-dropdown-separator':
343
339
  return import(
344
340
  /* webpackMode: "lazy" */
@@ -375,6 +371,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
375
371
  return import(
376
372
  /* webpackMode: "lazy" */
377
373
  './ifx-link.entry.js').then(processMod, consoleError);
374
+ case 'ifx-icon':
375
+ return import(
376
+ /* webpackMode: "lazy" */
377
+ './ifx-icon.entry.js').then(processMod, consoleError);
378
378
  }
379
379
  }
380
380
  return import(