@ebrains/react 0.6.0-alpha.0 → 0.8.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 (96) hide show
  1. package/color-primary-palette_6.entry.esm.js +106 -106
  2. package/correct-use-of-colors.entry.esm.js +33 -33
  3. package/eds-accordion_17.entry.esm.js +196 -0
  4. package/eds-alert.entry.esm.js +14 -6
  5. package/eds-app-root.entry.esm.js +53 -0
  6. package/eds-breadcrumb.entry.esm.js +8 -16
  7. package/eds-card-desc_3.entry.esm.js +125 -0
  8. package/eds-card-generic.entry.esm.js +114 -0
  9. package/eds-card-project.entry.esm.js +10 -10
  10. package/eds-card-section.entry.esm.js +56 -0
  11. package/eds-card-tags.entry.esm.js +1 -1
  12. package/eds-card-tool.entry.esm.js +4 -4
  13. package/eds-card-wrapper.entry.esm.js +4 -4
  14. package/eds-code-block.entry.esm.js +7 -7
  15. package/eds-components-section.entry.esm.js +27 -24
  16. package/eds-cookies-preference.entry.esm.js +2 -2
  17. package/eds-docs-palettes.entry.esm.js +1 -1
  18. package/eds-docs-tokens.entry.esm.js +1 -1
  19. package/eds-feedback.entry.esm.js +82 -0
  20. package/eds-form.entry.esm.js +339 -276
  21. package/eds-frame.entry.esm.js +34 -33
  22. package/eds-icon-arrow-diagonal.entry.esm.js +3 -3
  23. package/eds-icon-arrow-right.entry.esm.js +1 -1
  24. package/eds-icon-bluesky.entry.esm.js +1 -1
  25. package/eds-icon-chevron-down.entry.esm.js +1 -1
  26. package/eds-icon-chevron-left.entry.esm.js +1 -1
  27. package/eds-icon-chevron-right.entry.esm.js +1 -1
  28. package/eds-icon-chevron-up.entry.esm.js +1 -1
  29. package/eds-icon-close.entry.esm.js +1 -1
  30. package/eds-icon-copy.entry.esm.js +1 -1
  31. package/eds-icon-eu.entry.esm.js +1 -1
  32. package/eds-icon-facebook.entry.esm.js +1 -1
  33. package/eds-icon-gitlab.entry.esm.js +1 -1
  34. package/eds-icon-linkedin.entry.esm.js +1 -1
  35. package/eds-icon-loader.entry.esm.js +1 -1
  36. package/eds-icon-mastodon.entry.esm.js +1 -1
  37. package/eds-icon-menu.entry.esm.js +1 -1
  38. package/eds-icon-more.entry.esm.js +1 -1
  39. package/eds-icon-search.entry.esm.js +1 -1
  40. package/eds-icon-star.entry.esm.js +21 -0
  41. package/eds-icon-success.entry.esm.js +1 -1
  42. package/eds-icon-thumbs-down.entry.esm.js +21 -0
  43. package/eds-icon-thumbs-up.entry.esm.js +21 -0
  44. package/eds-icon-twitter.entry.esm.js +1 -1
  45. package/eds-icon-user.entry.esm.js +1 -1
  46. package/eds-icon-youtube.entry.esm.js +1 -1
  47. package/eds-input_7.entry.esm.js +77 -37
  48. package/{keycloak-d502ec16.esm.js → eds-login_2.entry.esm.js} +172 -1
  49. package/eds-logo-variations.entry.esm.js +1 -1
  50. package/eds-modal.entry.esm.js +22 -9
  51. package/eds-pagination_2.entry.esm.js +49 -28
  52. package/eds-progress-bar.entry.esm.js +2 -2
  53. package/eds-rating.entry.esm.js +37 -37
  54. package/eds-section-core_2.entry.esm.js +6 -6
  55. package/eds-spinner.entry.esm.js +67 -0
  56. package/eds-svg-repository.entry.esm.js +18 -7
  57. package/eds-switch.entry.esm.js +5 -5
  58. package/eds-tabs.entry.esm.js +14 -26
  59. package/eds-timeline.entry.esm.js +9 -23
  60. package/eds-toast-manager.entry.esm.js +62 -0
  61. package/eds-toast.entry.esm.js +92 -0
  62. package/eds-tooltip.entry.esm.js +3 -3
  63. package/eds-trl.entry.esm.js +3 -3
  64. package/incorrect-use-of-colors.entry.esm.js +7 -7
  65. package/index.esm.js +1 -1
  66. package/index.esm2.js +47 -55
  67. package/logo-space.entry.esm.js +4 -4
  68. package/logo-variations-horizontal_2.entry.esm.js +26 -26
  69. package/logo-wrong-usage.entry.esm.js +37 -37
  70. package/package.json +1 -1
  71. package/sharedUtils-a550989c.esm.js +17 -0
  72. package/src/components.d.ts +4 -3
  73. package/star-0da9b5e9.esm.js +5 -0
  74. package/thumbs-down-a18fd049.esm.js +5 -0
  75. package/thumbs-up-c19a71bc.esm.js +6 -0
  76. package/token-list_3.entry.esm.js +5 -5
  77. package/token-ratios.entry.esm.js +3 -3
  78. package/token-spacing.entry.esm.js +26 -26
  79. package/token-typography.entry.esm.js +2 -2
  80. package/README.md +0 -7
  81. package/eds-accordion_13.entry.esm.js +0 -1064
  82. package/eds-block-break.entry.esm.js +0 -22
  83. package/eds-dropdown_2.entry.esm.js +0 -235
  84. package/eds-footer.entry.esm.js +0 -102
  85. package/eds-fullscreen-menu.entry.esm.js +0 -143
  86. package/eds-header.entry.esm.js +0 -130
  87. package/eds-link.entry.esm.js +0 -204
  88. package/eds-login.entry.esm.js +0 -97
  89. package/eds-logo.entry.esm.js +0 -87
  90. package/eds-navigator.entry.esm.js +0 -72
  91. package/eds-social-networks.entry.esm.js +0 -74
  92. package/eds-steps.entry.esm.js +0 -98
  93. package/eds-tab.entry.esm.js +0 -41
  94. package/eds-tabs-content.entry.esm.js +0 -145
  95. package/eds-user.entry.esm.js +0 -118
  96. package/eds-vertical-stepper.entry.esm.js +0 -81
@@ -19,15 +19,15 @@ const EdsCardWrapper = class {
19
19
  render() {
20
20
  const articleClasses = [this.tiny ? 'min-h-120' : 'min-h-156', this.withBg ? 'bg-inverse' : 'bg-default', this.withHover ? 'effect-shadow hover:shadow-hover cursor-pointer' : '', 'border-softer effect-focus-within relative flex grow flex-col rounded-lg border-2 p-16'].join(' ');
21
21
  return h("article", {
22
- key: 'f21cc9703011026652765b399e2b87b1ef80d220',
22
+ key: 'b860e65a1a943216793a5ce2f5a08d01249fc671',
23
23
  class: articleClasses
24
24
  }, h("slot", {
25
- key: '9a37adad73d2d49edcc9ca9222d5b188202c5612'
25
+ key: '3ea351da205f375ed746695762efc1f28d1fc3f0'
26
26
  }), this.hasSlot('footer') && h("div", {
27
- key: '87addfc052ed4ae33736724fbd8fbc8aca873b4d',
27
+ key: '84d24bd248033d4855dd63dfa5042585ae61d64d',
28
28
  class: "mt-auto"
29
29
  }, h("slot", {
30
- key: '2e48677f42ac2aa951bc1a82afa9291fea3ddd72',
30
+ key: 'c7a2530d70a93705097b9ac3b8be1a21551dd1fb',
31
31
  name: "footer"
32
32
  })));
33
33
  }
@@ -2247,10 +2247,10 @@ const EdsCodeBlock = class {
2247
2247
  }
2248
2248
  render() {
2249
2249
  return h("div", {
2250
- key: 'cb379e82bcf71345945b0b88397650ecd4992770',
2250
+ key: '98f5fe5e215e87c1eb024969b5e4f3ae1bd0cb0d',
2251
2251
  class: "relative bg-stronger rounded-sm"
2252
2252
  }, h("div", {
2253
- key: '945046d4fd747cd64a83155b421a897e380cc612',
2253
+ key: '173be873a0f41398bd080758d5a0bbdcc977dcf5',
2254
2254
  class: "text-inverse flex justify-between items-center p-8"
2255
2255
  }, this.language ? h("span", {
2256
2256
  class: "f-ui-03"
@@ -2261,23 +2261,23 @@ const EdsCodeBlock = class {
2261
2261
  }, h("code", {
2262
2262
  innerHTML: this.getHighlightedCode()
2263
2263
  })), h("span", {
2264
- key: '3f6c7e996101f0bb83fb8c9e6991a205a0b268c8',
2264
+ key: 'f8cb36cf89d19bf306c57168e61ccfde9a4d18ff',
2265
2265
  "aria-hidden": "true",
2266
2266
  class: "w-20 h-20 mt-8"
2267
2267
  }, h("eds-icon-wrapper", {
2268
- key: '8ad9beb61058f29e688f6777233c61f7fb3ccfe8',
2268
+ key: '74f214c47dc647c2c254f3f9f96fba71e35133df',
2269
2269
  icon: this.copied ? 'success' : 'copy',
2270
2270
  onClick: () => this.copyToClipboard()
2271
2271
  })), h("span", {
2272
- key: 'a4f9a07906e1c2d9febb7ae789a3eed76dc422e9',
2272
+ key: '74e628574b481d68c2d2132a12fd07bb62c86fde',
2273
2273
  class: "sr-only"
2274
2274
  }, "Copy Code")), this.language && h("pre", {
2275
- key: 'e31339126dd3cc885511aaa2bdf6f06f3a113c74',
2275
+ key: '19d2b813b6e86451a8a9047b954d99340fc3cd85',
2276
2276
  class: `language-${this.language} bg-stronger pl-8 pb-8`,
2277
2277
  role: "region",
2278
2278
  "aria-label": `Code block in ${this.language}`
2279
2279
  }, h("code", {
2280
- key: '7efacd276f26a00f0f61793f6b8748259e1614b5',
2280
+ key: '974eb2e2ef0d7dc90e012e421d64bf5b735761d1',
2281
2281
  innerHTML: this.getHighlightedCode()
2282
2282
  })));
2283
2283
  }
@@ -5,27 +5,36 @@ import 'react-dom';
5
5
 
6
6
  const EdsComponentsOverview = () => h("div", {
7
7
  class: "static-content container"
8
- }, h("h2", null, "Load the module"), h("p", null, "Integrating EDSs components to a project without a JavaScript framework is straight forward. If you\u2019re working on a simple HTML page, you can start using the components immediately by adding the tags below to the", ' ', h("code", null, "head"), "."), h("eds-code-block", {
8
+ }, h("h2", null, "Load the module"), h("p", null, "Integrating the EBRAINS UI Components to a project without a JavaScript framework is straight forward. If you\u2019re working on a simple HTML page, you can start using the components immediately by adding the tags below to the", ' ', h("code", null, "head"), "."), h("eds-code-block", {
9
9
  code: "<script type='module'>\n import { defineCustomElements } from 'https://unpkg.com/@ebrains/components@latest/loader/index.js'; \n // Define custom elements\n defineCustomElements(window);\n</script>",
10
10
  language: "javascript",
11
11
  "copy-label": "Copy Code"
12
+ }), h("p", null, "This snippet is part of the Stencil component loader system. Under the hood, it does the following:"), h("eds-steps", {
13
+ steps: [{
14
+ title: 'Import the Loader Module',
15
+ content: 'The script imports the defineCustomElements function from the Stencil-generated loader module hosted at a CDN. This module contains the registration logic for all your custom components.'
16
+ }, {
17
+ title: 'Register Custom Elements',
18
+ content: 'Calling defineCustomElements(window) loops through the available components and registers each one with the browser using customElements.define(). This makes your custom elements available in the DOM.'
19
+ }, {
20
+ title: 'Lazy Loading in Action',
21
+ content: "Although all components are registered on startup, their implementation code is lazy-loaded. This means a component's code is only fetched when it is first used, optimizing the initial load time."
22
+ }, {
23
+ title: 'Optimized Performance',
24
+ content: 'By registering components early and lazy-loading their implementations, the script helps maintain a fast startup while ensuring that all custom elements are ready for use when needed.'
25
+ }]
26
+ }), h("p", null, "Once included, components can be used in your markup like any other regular HTML elements:"), h("eds-code-block", {
27
+ code: '<eds-button \n label="my bytton" \n intent="primary">\n</eds-button>',
28
+ language: "html",
29
+ "copy-label": "Copy Code"
12
30
  }), h("h2", null, "Load the styles"), h("p", null, "To directly use the produced css framework with a few predefined custom utility classes, add the tag below to the", ' ', h("code", null, "head")), h("eds-code-block", {
13
31
  code: '<link rel="stylesheet" href="https://unpkg.com/@ebrains/assets@latest/styles/output.css"/>',
14
32
  language: "css",
15
33
  "copy-label": "Copy Code"
16
- }), h("div", {
17
- class: "my-4"
18
- }, h("eds-alert", {
19
- message: "Note that, loading the predefined CSS framework above, automatically loads the fonts so you can skip loading them separately.",
20
- intent: "warning"
21
- })), h("h2", null, "Load the fonts"), h("p", null, "To load the webfonts, add the tag below to the ", h("code", null, "head")), h("eds-code-block", {
34
+ }), h("p", null, "Note that, loading the predefined CSS framework above,", ' ', h("b", null, "automatically loads the fonts so you can skip loading them separately"), ". If you wish, however, to load the fonts, add the tag below to the ", h("code", null, "head")), h("eds-code-block", {
22
35
  code: '<link rel="stylesheet" href="https://unpkg.com/@ebrains/assets@0.0.1/styles/base/fonts.css"/>',
23
36
  language: "css",
24
37
  "copy-label": "Copy Code"
25
- }), h("h2", null, "Component Usage"), h("p", null, "Once included, components can be used in your markup like any other regular HTML elements:"), h("eds-code-block", {
26
- code: '<eds-button \n label="my bytton" \n intent="primary">\n</eds-button>',
27
- language: "html",
28
- "copy-label": "Copy Code"
29
38
  }));
30
39
  const EdsDocsInstallation = () => h("div", null, h("p", null, "Before proceeding, ensure that Node.js is installed on your machine\u2014you can download the latest version from the official website. If your project doesn\u2019t already use npm and you plan to integrate EBRAINS Components, you'll need to create a package.json file by running npm init and following the on-screen instructions."), h("div", {
31
40
  class: "my-8"
@@ -58,13 +67,11 @@ const EdsDocsInstallation = () => h("div", null, h("p", null, "Before proceeding
58
67
  language: "html",
59
68
  "copy-label": "Copy Code"
60
69
  })));
61
- const EdsDocsReact = () => h("div", null, h("h2", null, "React Wrappers"), h("p", null, "Learn how to use our components in a React Application.Simple install the package below and check out the examples"), h("div", {
62
- class: "my-8"
63
- }, h("eds-code-block", {
70
+ const EdsDocsReact = () => h("div", null, h("h2", null, "React Wrappers"), h("p", null, "To use the EBRAINS web components in a React Application, simple install the package below and check out the examples"), h("eds-code-block", {
64
71
  code: "npm install @ebrains/react",
65
72
  language: "javascript",
66
73
  "copy-label": "Copy Code"
67
- })), h("eds-section-core", {
74
+ }), h("eds-section-core", {
68
75
  "section-title": "Example React App",
69
76
  "heading-level": "h3"
70
77
  }, h("eds-code-block", {
@@ -72,16 +79,12 @@ const EdsDocsReact = () => h("div", null, h("h2", null, "React Wrappers"), h("p"
72
79
  language: "javascript",
73
80
  "copy-label": "Copy Code"
74
81
  })));
75
- const EdsDocsVue = () => h("div", null, h("h2", null, "Vue Wrappers"), h("p", null, "Learn how to use our components in a Vue Application."), h("p", null, "Simply install the latest version of our NPM package."), h("eds-code-block", {
82
+ const EdsDocsVue = () => h("div", null, h("h2", null, "Vue Wrappers"), h("p", null, "To use the EBRAINS web components in a Vue Application, simple install the package below and check out the examples."), h("eds-code-block", {
76
83
  code: "npm install @ebrains/vue",
77
84
  language: "javascript",
78
85
  "copy-label": "Copy Code"
79
- }), h("p", null, "Our NPM package already includes the custom elements definitions. However, you can use the components as they are by simply importing and executing the initialization command in your \"main.ts\" file."), h("eds-code-block", {
80
- code: "import { defineCustomElements } from '@ebrains/components/loader';\ndefineCustomElements();",
81
- language: "javascript",
82
- "copy-label": "Copy Code"
83
86
  }), h("h2", null, "Passing Properties to Custom Elements Using the ", h("b", null, ".prop"), " Modifier in Vue Wrappers"), h("p", null, "When using Vue wrappers for Stencil components (or any custom elements), you might encounter issues with property names being altered due to HTML\u2019s attribute handling. By default, Vue binds values as HTML attributes, and HTML attributes are case-insensitive. This means that camelCase property names can be transformed into lowercase strings, which can prevent your component from receiving the correct data."), h("h3", null, "How to Use the ", h("b", null, ".prop"), " Modifier"), h("p", null, "When using Vue wrappers, you can pass properties with the .prop modifier by adding it to your binding expression. Here\u2019s an example of how to do it:"), h("div", {
84
- class: "mt-8"
87
+ class: "my-8"
85
88
  }, h("eds-alert", {
86
89
  message: "This may lead to issues because Vue binds these as attributes .",
87
90
  intent: "error"
@@ -90,7 +93,7 @@ const EdsDocsVue = () => h("div", null, h("h2", null, "Vue Wrappers"), h("p", nu
90
93
  language: "javascript",
91
94
  "copy-label": "Copy Code"
92
95
  }), h("div", {
93
- class: "mt-8"
96
+ class: "my-8"
94
97
  }, h("eds-alert", {
95
98
  message: "Use the .prop modifier to ensure properties are passed correctly.",
96
99
  intent: "success"
@@ -106,7 +109,7 @@ const EdsDocsVue = () => h("div", null, h("h2", null, "Vue Wrappers"), h("p", nu
106
109
  language: "javascript",
107
110
  "copy-label": "Copy Code"
108
111
  })));
109
- const EdsDocsAngular = () => h("div", null, h("h2", null, "Angular Wrappers"), h("p", null, "Learn how to use our components in a Angular Application."), h("eds-code-block", {
112
+ const EdsDocsAngular = () => h("div", null, h("h2", null, "Angular Wrappers"), h("p", null, "To use the EBRAINS web components in an Angular Application, simple install the package below and check out the examples."), h("eds-code-block", {
110
113
  code: "npm install @ebrains/angular",
111
114
  language: "javascript",
112
115
  "copy-label": "Copy Code"
@@ -149,7 +152,7 @@ const EdsComponentsSection = class {
149
152
  }
150
153
  render() {
151
154
  return h("div", {
152
- key: '7e582a0eeafc2687229454532b5a7f66f91c1856',
155
+ key: '85fff494e98ff10bbcc630487a75d345e7cce78c',
153
156
  class: "container"
154
157
  }, this.renderContent());
155
158
  }
@@ -29,9 +29,9 @@ const EdsCookiesPreference = class {
29
29
  }
30
30
  render() {
31
31
  return h("div", {
32
- key: 'ca5d44522f94e9ea009c657c5eae6e357cd0d13a'
32
+ key: '13e1244d4e151f091eaca1d22dbed009bcb97786'
33
33
  }, h("eds-link", {
34
- key: '563a369e2ed44d08a6dd47922c1c1c888e81543a',
34
+ key: '4cfc54b447c93824f98da1f990a28fdb61018afe',
35
35
  size: "small",
36
36
  intent: this.intent,
37
37
  label: this.buttonText,
@@ -20,7 +20,7 @@ const EdsDocsPalettes = class {
20
20
  }
21
21
  render() {
22
22
  return h("div", {
23
- key: 'e8cd71caa7b23cc4dc28c694ecb9f13e3fd4170a',
23
+ key: '480cc269ee31de61190b4ae7502c3c17e673c3f9',
24
24
  class: "container"
25
25
  }, this.renderContent());
26
26
  }
@@ -36,7 +36,7 @@ const EdsDocsContent = class {
36
36
  }
37
37
  render() {
38
38
  return h("div", {
39
- key: 'b140f7650e5e01711dc0778b04af83f9d004efc7',
39
+ key: '64ee8c20ec7dca1ea1a742ef53f0315c81107ead',
40
40
  class: "container"
41
41
  }, this.renderContent());
42
42
  }
@@ -0,0 +1,82 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index.esm2.js';
2
+ import { p as parseData } from './sharedUtils-a550989c.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const edsFeedbackCss = "h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}.text-light{color:var(--grey-700)}.text-lighter{color:var(--grey-600)}.text-lightest{color:var(--grey-500)}.f-body-01{font-family:var(--f-body-01-fontFamily);font-weight:var(--f-body-01-fontWeight);font-size:var(--f-body-01-fontSize);line-height:var(--f-body-01-lineHeight);letter-spacing:var(--f-body-01-letterSpacing)}.f-heading-02{font-family:var(--f-heading-02-fontFamily);font-weight:var(--f-heading-02-fontWeight);font-size:var(--f-heading-02-fontSize);line-height:var(--f-heading-02-lineHeight);letter-spacing:var(--f-heading-02-letterSpacing)}.f-heading-03{font-family:var(--f-heading-03-fontFamily);font-weight:var(--f-heading-03-fontWeight);font-size:var(--f-heading-03-fontSize);line-height:var(--f-heading-03-lineHeight);letter-spacing:var(--f-heading-03-letterSpacing)}.f-heading-04{font-family:var(--f-heading-04-fontFamily);font-weight:var(--f-heading-04-fontWeight);font-size:var(--f-heading-04-fontSize);line-height:var(--f-heading-04-lineHeight);letter-spacing:var(--f-heading-04-letterSpacing)}.f-heading-05{font-family:var(--f-heading-05-fontFamily);font-weight:var(--f-heading-05-fontWeight);font-size:var(--f-heading-05-fontSize);line-height:var(--f-heading-05-lineHeight);letter-spacing:var(--f-heading-05-letterSpacing)}.f-heading-06{font-family:var(--f-heading-06-fontFamily);font-weight:var(--f-heading-06-fontWeight);font-size:var(--f-heading-06-fontSize);line-height:var(--f-heading-06-lineHeight);letter-spacing:var(--f-heading-06-letterSpacing)}.f-body-01{font-family:var(--f-body-01-fontFamily);font-weight:var(--f-body-01-fontWeight);font-size:var(--f-body-01-fontSize);line-height:var(--f-body-01-lineHeight);letter-spacing:var(--f-body-01-letterSpacing)}.f-body-02{font-family:var(--f-body-02-fontFamily);font-weight:var(--f-body-02-fontWeight);font-size:var(--f-body-02-fontSize);line-height:var(--f-body-02-lineHeight);letter-spacing:var(--f-body-02-letterSpacing)}.f-ui-04{font-family:var(--f-ui-04-fontFamily);font-weight:var(--f-ui-04-fontWeight);font-size:var(--f-ui-04-fontSize);line-height:var(--f-ui-04-lineHeight);letter-spacing:var(--f-ui-04-letterSpacing)}.inline{display:inline}.grid{display:grid}.flex{display:flex}.inline-flex{display:inline-flex}.flex-col{flex-direction:column}.my-4{margin-top:0.25rem;margin-bottom:0.25rem}.my-8{margin-top:0.5rem;margin-bottom:0.5rem}.my-16{margin-top:1rem;margin-bottom:1rem}.my-20{margin-top:1.25rem;margin-bottom:1.25rem}";
8
+ const EdsFeedbackStyle0 = edsFeedbackCss;
9
+ const EdsFeedback = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ this.rating = createEvent(this, "rating", 7);
13
+ this.type = 'star';
14
+ this.count = 5;
15
+ this.label = 'Rate your Experience!';
16
+ this.description = 'This is a description!';
17
+ this.textMapping = ['Very Poor', 'Poor', 'Average', 'Good', 'Excellent'];
18
+ this.selectedRating = 0;
19
+ }
20
+ /**
21
+ * Lifecycle method that runs when the component has fully loaded.
22
+ * It emits a custom event for each `eds-button` element contained within the breadcrumb.
23
+ */
24
+ componentDidLoad() {
25
+ const btns = this.el.shadowRoot.querySelectorAll('eds-button');
26
+ btns.forEach(btn => {
27
+ this.emitContext(btn);
28
+ });
29
+ }
30
+ /**
31
+ * Emits a custom event called `parentContext` for a given link element.
32
+ * This event provides context information about the breadcrumb component.
33
+ *
34
+ * @param btnElement - The link element to which the event will be dispatched.
35
+ */
36
+ emitContext(btnElement) {
37
+ const event = new CustomEvent('parentContext', {
38
+ detail: {
39
+ componentName: this.el.tagName.toLowerCase(),
40
+ identifier: this.selectedRating
41
+ }
42
+ });
43
+ btnElement.dispatchEvent(event);
44
+ }
45
+ /**
46
+ * Parses the `textMapping` prop into an array of strings.
47
+ */
48
+ get parsedMappings() {
49
+ return parseData(this.textMapping);
50
+ }
51
+ /**
52
+ * Listens for global custom events to open the modal.
53
+ */
54
+ ratingUpdated(e) {
55
+ this.selectedRating = e.detail;
56
+ }
57
+ render() {
58
+ return h("div", {
59
+ key: '3cdbbc2eb256ca4f2008f03e90ae9aacb6afbaac',
60
+ class: "grid inline"
61
+ }, h("p", {
62
+ key: 'afb5aa7ab4a8c3117a4db0a5cbeca0195ccec3e8',
63
+ class: "f-heading-03 my-4"
64
+ }, this.label), h("p", {
65
+ key: '9b1b83b31d05d10943bcf9e9a413686caa9e49a7',
66
+ class: "f-body-02 text-light"
67
+ }, this.description), h("eds-rating", {
68
+ key: '4535006f72ee21d168d9b42da6a5c3528417d2f4',
69
+ "rating-type": this.type,
70
+ "rating-count": this.count
71
+ }), this.selectedRating > 0 && this.parsedMappings[this.selectedRating - 1] && h("span", {
72
+ key: 'b90b59aaae1e2bc6071e1488f332d0c154bdb25a',
73
+ class: "f-ui-04 text-lighter"
74
+ }, this.parsedMappings[this.selectedRating - 1]));
75
+ }
76
+ get el() {
77
+ return getElement(this);
78
+ }
79
+ };
80
+ EdsFeedback.style = EdsFeedbackStyle0;
81
+
82
+ export { EdsFeedback as eds_feedback };