@ebrains/react 0.7.0-alpha.0 → 0.9.0-beta

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 (93) hide show
  1. package/README.md +3 -3
  2. package/bookmark-c200037c.esm.js +16 -0
  3. package/color-primary-palette_6.entry.esm.js +163 -141
  4. package/components-section.entry.esm.js +165 -0
  5. package/correct-use-of-colors.entry.esm.js +49 -49
  6. package/{eds-docs-palettes.entry.esm.js → docs-palettes.entry.esm.js} +3 -3
  7. package/{eds-docs-tokens.entry.esm.js → docs-tokens.entry.esm.js} +3 -3
  8. package/eds-accordion.entry.esm.js +132 -0
  9. package/eds-alert.entry.esm.js +14 -6
  10. package/eds-app-root.entry.esm.js +4 -4
  11. package/eds-avatar_24.entry.esm.js +275 -0
  12. package/eds-breadcrumb.entry.esm.js +6 -3
  13. package/{eds-avatar_4.entry.esm.js → eds-card-desc_3.entry.esm.js} +6 -66
  14. package/eds-card-generic.entry.esm.js +1 -1
  15. package/eds-card-project.entry.esm.js +10 -10
  16. package/eds-card-tags.entry.esm.js +1 -1
  17. package/eds-card-tool.entry.esm.js +4 -4
  18. package/eds-card-wrapper.entry.esm.js +4 -4
  19. package/eds-code-block.entry.esm.js +7 -7
  20. package/eds-cookies-preference.entry.esm.js +2 -2
  21. package/eds-feedback.entry.esm.js +9 -9
  22. package/eds-frame.entry.esm.js +11 -17
  23. package/eds-icon-arrow-diagonal.entry.esm.js +3 -3
  24. package/eds-icon-arrow-right.entry.esm.js +1 -1
  25. package/eds-icon-bookmark.entry.esm.js +21 -0
  26. package/eds-icon-chevron-down.entry.esm.js +1 -1
  27. package/eds-icon-chevron-left.entry.esm.js +1 -1
  28. package/eds-icon-chevron-right.entry.esm.js +1 -1
  29. package/eds-icon-chevron-up.entry.esm.js +1 -1
  30. package/eds-icon-close.entry.esm.js +1 -1
  31. package/eds-icon-copy.entry.esm.js +1 -1
  32. package/eds-icon-eu.entry.esm.js +1 -1
  33. package/eds-icon-external.entry.esm.js +21 -0
  34. package/eds-icon-gitlab.entry.esm.js +1 -1
  35. package/eds-icon-loader.entry.esm.js +1 -1
  36. package/eds-icon-menu.entry.esm.js +1 -1
  37. package/eds-icon-minus.entry.esm.js +21 -0
  38. package/eds-icon-more.entry.esm.js +1 -1
  39. package/eds-icon-paper.entry.esm.js +21 -0
  40. package/eds-icon-plus.entry.esm.js +21 -0
  41. package/eds-icon-portal.entry.esm.js +21 -0
  42. package/eds-icon-private.entry.esm.js +21 -0
  43. package/eds-icon-public.entry.esm.js +21 -0
  44. package/eds-icon-search.entry.esm.js +1 -1
  45. package/eds-icon-star.entry.esm.js +1 -1
  46. package/eds-icon-success.entry.esm.js +1 -1
  47. package/eds-icon-thumbs-down.entry.esm.js +1 -1
  48. package/eds-icon-thumbs-up.entry.esm.js +1 -1
  49. package/eds-icon-tutorial.entry.esm.js +21 -0
  50. package/eds-icon-unknown.entry.esm.js +21 -0
  51. package/eds-icon-updown.entry.esm.js +21 -0
  52. package/eds-login_2.entry.esm.js +27 -15
  53. package/eds-matomo-notice.entry.esm.js +162 -0
  54. package/eds-modal.entry.esm.js +13 -13
  55. package/eds-pagination_2.entry.esm.js +493 -0
  56. package/eds-section-core_2.entry.esm.js +3 -3
  57. package/eds-switch.entry.esm.js +5 -5
  58. package/eds-tabs.entry.esm.js +4 -4
  59. package/eds-timeline.entry.esm.js +7 -4
  60. package/eds-toast-manager.entry.esm.js +1 -1
  61. package/eds-tooltip.entry.esm.js +3 -3
  62. package/eds-trl.entry.esm.js +3 -3
  63. package/incorrect-use-of-colors.entry.esm.js +9 -9
  64. package/index.esm.js +1 -1
  65. package/index.esm2.js +66 -46
  66. package/logo-space.entry.esm.js +28 -12
  67. package/logo-variations-horizontal_2.entry.esm.js +73 -66
  68. package/{eds-logo-variations.entry.esm.js → logo-variations-tabs.entry.esm.js} +3 -3
  69. package/logo-wrong-usage.entry.esm.js +71 -107
  70. package/minus-b30a7c71.esm.js +11 -0
  71. package/package.json +1 -1
  72. package/paper-8e74ea31.esm.js +15 -0
  73. package/plus-89c07be2.esm.js +12 -0
  74. package/portal-d6c8ce56.esm.js +18 -0
  75. package/private-1c25ff8e.esm.js +25 -0
  76. package/public-d4d8c585.esm.js +16 -0
  77. package/src/components.d.ts +1 -5
  78. package/{eds-svg-repository.entry.esm.js → svg-repository.entry.esm.js} +35 -29
  79. package/token-list_3.entry.esm.js +9 -9
  80. package/token-ratios.entry.esm.js +3 -3
  81. package/token-typography.entry.esm.js +10 -7
  82. package/tutotial-150ee1fd.esm.js +27 -0
  83. package/unknown-ed01a24c.esm.js +22 -0
  84. package/up-and-down-d747abee.esm.js +12 -0
  85. package/eds-accordion_22.entry.esm.js +0 -269
  86. package/eds-components-section.entry.esm.js +0 -158
  87. package/eds-dropdown.entry.esm.js +0 -156
  88. package/eds-form.entry.esm.js +0 -410
  89. package/eds-steps.entry.esm.js +0 -89
  90. package/eds-user.entry.esm.js +0 -95
  91. package/eds-vertical-stepper.entry.esm.js +0 -81
  92. package/formUtils-ac68474d.esm.js +0 -247
  93. package/token-spacing.entry.esm.js +0 -93
@@ -0,0 +1,165 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import 'react';
3
+ import 'react/jsx-runtime';
4
+ import 'react-dom';
5
+
6
+ const DocsOverview = () => h("div", {
7
+ class: "static-content container"
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
+ 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
+ language: "javascript",
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"
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", {
31
+ code: '<link rel="stylesheet" href="https://unpkg.com/@ebrains/assets@latest/styles/output.css"/>',
32
+ language: "css",
33
+ "copy-label": "Copy Code"
34
+ }), h("p", null, "To directly use only the produced variables add the tag below to the ", h("code", null, "head")), h("eds-code-block", {
35
+ code: '<link rel="stylesheet" href="https://unpkg.com/@ebrains/assets@latest/styles/vars.css"/>',
36
+ language: "css",
37
+ "copy-label": "Copy Code"
38
+ }), 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", {
39
+ code: '<link rel="stylesheet" href="https://unpkg.com/@ebrains/assets@latest/styles/base/fonts.css"/>',
40
+ language: "css",
41
+ "copy-label": "Copy Code"
42
+ }));
43
+ const DocsInstallation = () => 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", {
44
+ class: "my-8"
45
+ }, h("eds-code-block", {
46
+ code: "npm install @ebrains/components",
47
+ language: "html",
48
+ "copy-label": "Copy Code"
49
+ })), h("div", {
50
+ class: "my-8"
51
+ }, h("eds-code-block", {
52
+ code: "npm install @ebrains/assets",
53
+ language: "html",
54
+ "copy-label": "Copy Code"
55
+ })), h("div", {
56
+ class: "my-8"
57
+ }, h("eds-code-block", {
58
+ code: "npm install @ebrains/react",
59
+ language: "html",
60
+ "copy-label": "Copy Code"
61
+ })), h("div", {
62
+ class: "my-8"
63
+ }, h("eds-code-block", {
64
+ code: "npm install @ebrains/vue",
65
+ language: "html",
66
+ "copy-label": "Copy Code"
67
+ })), h("div", {
68
+ class: "my-8"
69
+ }, h("eds-code-block", {
70
+ code: "npm install @ebrains/angular",
71
+ language: "html",
72
+ "copy-label": "Copy Code"
73
+ })));
74
+ const DocsReact = () => 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", {
75
+ code: "npm install @ebrains/react",
76
+ language: "javascript",
77
+ "copy-label": "Copy Code"
78
+ }), h("eds-section-core", {
79
+ "section-title": "Example React App",
80
+ "heading-level": "h3"
81
+ }, h("p", null, "This code displays a Stencil-based splash screen that stays visible until an initialization promise resolves (or errors), then hides itself and reveals the main React app content."), h("eds-code-block", {
82
+ code: "\nimport React, { useMemo, useState } from 'react';\nimport {\n EdsHeader\n EdsSplashScreen,\n EdsMatomoNotice,\n EdsSteps\n} from '@ebrains/react';\nimport './app.css';\n\n// simulate 2s\nfunction fakeInit(): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, 2000));\n}\n\nexport function App() {\n // 1) create init promise\n const initPromise = useMemo(() => fakeInit(), []);\n\n // 2) is splash still visible\n const [splashVisible, setSplashVisible] = useState(true);\n const [initError, setInitError] = useState<string | null>(null);\n\n // 3) show the UI after the splash has hidden\n const showApp = !splashVisible && !initError;\n\n return (\n <div>\n {splashVisible && (\n <EdsSplashScreen\n inverse={false}\n initPromise={initPromise}\n onSplash={(e: CustomEvent) => {\n if (e.detail.type === 'hidden') {\n setSplashVisible(false);\n } else if (e.detail.type === 'error') {\n setInitError(e.detail.message);\n setSplashVisible(false);\n }\n }}\n />\n )}\n\n {initError && (\n <div className='error'>\n Failed to initialize: {initError}\n </div>\n )}\n\n {/* Show App only when ready */}\n {showApp && (\n <>\n <EdsHeader></EdsHeader>\n <EdsSteps\n steps={[\n {\n title: 'Introduction',\n content: 'Begin by familiarizing yourself with the overall process.'\n },\n {\n title: 'Process Overview',\n content: 'Review the detailed steps and understand the workflow.'\n }\n ]}\n type='linear'\n />\n\n <EdsMatomoNotice />\n\n <div id='root'></div>\n </>\n )}\n </div>\n );\n}\nexport default App;\n",
83
+ language: "javascript",
84
+ "copy-label": "Copy Code"
85
+ })));
86
+ const DocsVue = () => 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", {
87
+ code: "npm install @ebrains/vue",
88
+ language: "javascript",
89
+ "copy-label": "Copy Code"
90
+ }), 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", {
91
+ class: "my-8"
92
+ }, h("eds-alert", {
93
+ message: "This may lead to issues because Vue binds these as attributes .",
94
+ intent: "error"
95
+ })), h("eds-code-block", {
96
+ code: '<EdsAlert\n message="This is a default informational alert."\n intent="default"\n :pressableLabel="Press Me"\n :pressableUrl="https://ebrains.eu"\n></EdsAlert>',
97
+ language: "javascript",
98
+ "copy-label": "Copy Code"
99
+ }), h("div", {
100
+ class: "my-8"
101
+ }, h("eds-alert", {
102
+ message: "Use the .prop modifier to ensure properties are passed correctly.",
103
+ intent: "default"
104
+ })), h("eds-code-block", {
105
+ code: '<EdsAlert\n message="This is a default informational alert."\n intent="default"\n :pressableLabel.prop="Press Me"\n :pressableUrl.prop="https://ebrains.eu"\n></EdsAlert>',
106
+ language: "javascript",
107
+ "copy-label": "Copy Code"
108
+ }), h("p", null, "Using the ", h("b", null, ".prop"), " modifier in Vue ensures that the data you pass to your custom elements is received as intended. It prevents Vue (and the browser) from transforming camelCase property names into lowercase attributes, thereby maintaining the correct data mapping in your Stencil components."), h("eds-section-core", {
109
+ "section-title": "Example Vue App",
110
+ "heading-level": "h3"
111
+ }, h("eds-code-block", {
112
+ code: '\n<template>\n <div>\n <EdsHeader></EdsHeader>\n <!-- render the splash until we manually hide it -->\n <EdsSplashScreen inverse="false" />\n\n <!-- then show main UI -->\n <div v-if="!splashVisible" class="container my-16">\n <EdsSteps \n :steps="JSON.stringify(stepsdata)"\n type="linear"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport { EdsSplashScreen, EdsSteps, EdsHeader } from "@ebrains/vue";\n\nexport default {\n name: "App",\n components: { EdsHeader, EdsSplashScreen, EdsSteps },\n data() {\n return {\n stepsdata: [\n { title: "Introduction", content: "Begin by familiarizing yourself with the overall process." },\n { title: "Process Overview", content: "Review the detailed steps and understand the workflow." }\n ],\n splashVisible: true\n };\n },\n methods: {\n delay(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n },\n async initialize() {\n try {\n // simulate your init work\n await this.delay(2000);\n\n // fire the built-in event that EdsSplashScreen listens for\n window.dispatchEvent(new Event("hideSplash"));\n } catch (e) {\n console.error("Init error", e);\n window.dispatchEvent(new Event("hideSplash"));\n } finally {\n // show the rest of the app\n this.splashVisible = false;\n }\n }\n },\n mounted() {\n this.initialize();\n }\n};\n</script>\n',
113
+ language: "javascript",
114
+ "copy-label": "Copy Code"
115
+ })));
116
+ const DocsAngular = () => 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", {
117
+ code: "npm install @ebrains/angular",
118
+ language: "javascript",
119
+ "copy-label": "Copy Code"
120
+ }), h("p", null, "Define the custom elements"), h("eds-code-block", {
121
+ code: "import { defineCustomElements } from '@ebrains/components/loader';\ndefineCustomElements();",
122
+ language: "javascript",
123
+ "copy-label": "Copy Code"
124
+ }), h("p", null, "Angular Custom Elements Schema"), h("eds-code-block", {
125
+ code: 'import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";',
126
+ language: "javascript",
127
+ "copy-label": "Copy Code"
128
+ }), h("eds-section-core", {
129
+ "section-title": "Example Angular App",
130
+ "heading-level": "h3"
131
+ }, h("eds-code-block", {
132
+ code: '\n<div class="container">\n <eds-breadcrumb\n intent="tertiary"\n items="[\n { "label": "Home", "url": "#" },\n { "label": "Products", "url": "#" },\n ]">\n </eds-breadcrumb>\n <eds-footer></eds-footer>\n</div>',
133
+ language: "javascript",
134
+ "copy-label": "Copy Code"
135
+ })));
136
+ const ComponentsSection = class {
137
+ constructor(hostRef) {
138
+ registerInstance(this, hostRef);
139
+ this.tabIndex = undefined;
140
+ }
141
+ renderContent() {
142
+ switch (this.tabIndex) {
143
+ case 0:
144
+ return h(DocsOverview, null);
145
+ case 1:
146
+ return h(DocsInstallation, null);
147
+ case 2:
148
+ return h(DocsReact, null);
149
+ case 3:
150
+ return h(DocsVue, null);
151
+ case 4:
152
+ return h(DocsAngular, null);
153
+ default:
154
+ return h("p", null, "Content not available.");
155
+ }
156
+ }
157
+ render() {
158
+ return h("div", {
159
+ key: 'ee8facfaad3786770fd3ea39f1db7922a67ffd3e',
160
+ class: "container"
161
+ }, this.renderContent());
162
+ }
163
+ };
164
+
165
+ export { ComponentsSection as components_section };
@@ -42,36 +42,36 @@ const CorrectUseOfColors = class {
42
42
  }
43
43
  render() {
44
44
  return h("div", {
45
- key: 'ade28f6aa4a670443a4d077ff534117acb265bfe',
45
+ key: '966cb542b868e89c3f2538548e8a1ca8e20ea8d8',
46
46
  class: "container"
47
47
  }, h("p", {
48
- key: '23adcbeb3a15cd2b1248f63c808ddbe7cacef531',
48
+ key: '3c595ffa9a2de45b681924354486309004d4ceaf',
49
49
  class: "f-body-01"
50
50
  }, "This guide demonstrates the correct usage of the", h("eds-link", {
51
- key: '9b8b9909d409565e2c37cd4048a84b7c3751147f',
51
+ key: '1d1fded0f8cf78cec9e364e5b6844598b55f3f86',
52
52
  label: "primary",
53
53
  size: "small",
54
- intent: "blueish",
54
+ intent: "underline",
55
55
  icon: "chevron-right",
56
56
  url: "../color-palette/#primary-palette",
57
57
  "extra-class": "inline-block ml-4"
58
58
  }), "and", h("eds-link", {
59
- key: 'fb3fe62e34d86fe345cbe177eef5b9ac57b749d5',
59
+ key: 'abae691bb80eca1019f97375997b1aa6a577ba8b',
60
60
  label: "support",
61
61
  size: "small",
62
- intent: "blueish",
62
+ intent: "underline",
63
63
  icon: "chevron-right",
64
64
  url: "../color-palette/#support-palette",
65
65
  "extra-class": "inline-block ml-4"
66
66
  }), "color palettes."), h("div", {
67
- key: 'e24ff6eed3125519961d1cdd7789ada200d8cc3b',
67
+ key: '251e6d8ad16d70974b67fa044d53abd1be79ccac',
68
68
  class: "flex"
69
69
  }, h("div", {
70
- key: '670ef68f1f25d9267e9a8eb90a94e6300b9d78d3',
70
+ key: 'de5b9b6720aababb693421663c52db85cee1b5fc',
71
71
  class: "w-full"
72
72
  }, h("ul", {
73
- key: '2ed821a59b849dd540233371f831a16974a2dc99',
74
- class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
73
+ key: 'a61f669f45c2f9d3b53d87bacc222a4274f93d34',
74
+ class: "not-prose gap-y-8 md:gap-y-12 lg:gap-y-16"
75
75
  }, primary.map(color => h("li", {
76
76
  class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
77
77
  }, h("div", {
@@ -80,11 +80,11 @@ const CorrectUseOfColors = class {
80
80
  backgroundColor: color.background
81
81
  }
82
82
  }))))), h("div", {
83
- key: 'b72cc79258522b595d4bd024de51b2dec6458f57',
83
+ key: 'e7787d0ae843d7767ecac3267f11325dcfecf948',
84
84
  class: "w-full"
85
85
  }, h("ul", {
86
- key: '9650c15d16fc184f0f5c518da5944567afe30fd6',
87
- class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
86
+ key: '0d740ad8178c88175939d32a4f84d518f587e43a',
87
+ class: "not-prose gap-y-8 md:gap-y-12 lg:gap-y-16"
88
88
  }, support.map(color => h("li", {
89
89
  class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
90
90
  }, h("div", {
@@ -93,33 +93,33 @@ const CorrectUseOfColors = class {
93
93
  backgroundColor: color.background
94
94
  }
95
95
  })))))), h("p", {
96
- key: 'ff9c1ae248f5cdc91bf9fe902e2a5aa00394a27c',
96
+ key: '6c59b2c574f5039baafd91a2939fbbb307732500',
97
97
  class: "f-body-01"
98
98
  }, "This guide demonstrates the correct usage of the", h("eds-link", {
99
- key: '1fcdd015426a1512ea9a70a732e4615447238e7f',
99
+ key: '03e9ca7b0831c2b1d1908001324a38147ecea835',
100
100
  label: "purple",
101
101
  size: "small",
102
- intent: "blueish",
102
+ intent: "underline",
103
103
  icon: "chevron-right",
104
104
  url: "../color-palette/#primary-palette",
105
105
  "extra-class": "inline-block ml-4"
106
106
  }), "and", h("eds-link", {
107
- key: 'ec0b3529cfcb402556274e83a2a62d899eb8c7e9',
107
+ key: '021affd3b5db00ccb5ef0d51de4552c5d3a11f44',
108
108
  label: "support",
109
109
  size: "small",
110
- intent: "blueish",
110
+ intent: "underline",
111
111
  icon: "chevron-right",
112
112
  url: "../color-palette/#support-palette",
113
113
  "extra-class": "inline-block ml-4"
114
114
  }), "color palettes."), h("div", {
115
- key: 'edcd735b912341fdaaac6087c0d838a3341af687',
115
+ key: 'b7a5c4c10adab099c57ed70c0d2186d791aa70ec',
116
116
  class: "flex"
117
117
  }, h("div", {
118
- key: '8a96a72c29fb46b8189080ca257832cad444fd40',
118
+ key: '3732c49a47158c206e1b40fc5425e555487ec757',
119
119
  class: "w-full"
120
120
  }, h("ul", {
121
- key: 'a169a2f187db3fabc955ea28aed6019b5904b9f4',
122
- class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
121
+ key: '54a5d35510bd77397d1418aa2638cf310534e986',
122
+ class: "not-prose gap-y-8 md:gap-y-12 lg:gap-y-16"
123
123
  }, purple.map(color => h("li", {
124
124
  class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
125
125
  }, h("div", {
@@ -128,11 +128,11 @@ const CorrectUseOfColors = class {
128
128
  backgroundColor: color.background
129
129
  }
130
130
  }))))), h("div", {
131
- key: 'ba11e5e1ce445aec36d4eb3baf5ae39c956704fe',
131
+ key: '048de44bd69a7b6ecefe3188d76821e4d5145620',
132
132
  class: "w-full"
133
133
  }, h("ul", {
134
- key: '01c6ee6e5a77cafbb38928afdd6716a5aec6c93c',
135
- class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
134
+ key: 'e3f8cadce4b9a575e1d844958cfccf20a19db681',
135
+ class: "not-prose gap-y-8 md:gap-y-12 lg:gap-y-16"
136
136
  }, support.map(color => h("li", {
137
137
  class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
138
138
  }, h("div", {
@@ -141,33 +141,33 @@ const CorrectUseOfColors = class {
141
141
  backgroundColor: color.background
142
142
  }
143
143
  })))))), h("p", {
144
- key: '91ff22c373f1ae354ab9f76008f16d5e5be21331',
144
+ key: '14d7f9c88ae769d6feb2a8344f8b45b40d4ae095',
145
145
  class: "f-body-01"
146
146
  }, "This guide demonstrates the correct usage of the", h("eds-link", {
147
- key: 'a58977e316d22cb662173cc9d2d76448808fb2f8',
147
+ key: '810bdfa6fd175f9d483129b70bbae469051e0e0d',
148
148
  label: "blue",
149
149
  size: "small",
150
- intent: "blueish",
150
+ intent: "underline",
151
151
  icon: "chevron-right",
152
152
  url: "../color-palette/#primary-palette",
153
153
  "extra-class": "inline-block ml-4"
154
154
  }), "and", h("eds-link", {
155
- key: '0fd12af19848395b2a631a5ccb33b0530005bebc',
155
+ key: 'fb8a9712f8e1ae1cffbb85c79f7e9c2657f867db',
156
156
  label: "support",
157
157
  size: "small",
158
- intent: "blueish",
158
+ intent: "underline",
159
159
  icon: "chevron-right",
160
160
  url: "../color-palette/#support-palette",
161
161
  "extra-class": "inline-block ml-4"
162
162
  }), "color palettes."), h("div", {
163
- key: '38c4eea411b4021dbf15cc7d73ff26371d8175a4',
163
+ key: '1df0919bb4c75ee251d7f5c8cf95bb2e2e990242',
164
164
  class: "flex"
165
165
  }, h("div", {
166
- key: 'bdd75c354631d54fa03ea35e798ab5dcbde4f248',
166
+ key: '5a898462aa680267f4ac35aefb98e60b7f486c63',
167
167
  class: "w-full"
168
168
  }, h("ul", {
169
- key: '8777390f722798653df7ec72e6596a36246a5f2b',
170
- class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
169
+ key: 'ad6f3e6ccde7d225be344efbc176064fc89aa796',
170
+ class: "not-prose gap-y-8 md:gap-y-12 lg:gap-y-16"
171
171
  }, blue.map(color => h("li", {
172
172
  class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
173
173
  }, h("div", {
@@ -176,11 +176,11 @@ const CorrectUseOfColors = class {
176
176
  backgroundColor: color.background
177
177
  }
178
178
  }))))), h("div", {
179
- key: 'c61047b695bdc8d29f5c665753b4ebfa2cbb272a',
179
+ key: '8dd6e01b989c8589be6b553c85f0512c268ac369',
180
180
  class: "w-full"
181
181
  }, h("ul", {
182
- key: '7de74c3a918a30cacaf4ffb78d24145d78e4511a',
183
- class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
182
+ key: 'c36937d99efd585c4e8a37b80de5bce82374186c',
183
+ class: "not-prose gap-y-8 md:gap-y-12 lg:gap-y-16"
184
184
  }, support.map(color => h("li", {
185
185
  class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
186
186
  }, h("div", {
@@ -189,33 +189,33 @@ const CorrectUseOfColors = class {
189
189
  backgroundColor: color.background
190
190
  }
191
191
  })))))), h("p", {
192
- key: 'd0c3a7170ba185caccf3cecf7e4d39cce5292c49',
192
+ key: '452c68d1c797de34e531d7c734d350fcc36ae2f2',
193
193
  class: "f-body-01"
194
194
  }, "This guide demonstrates the correct usage of the", h("eds-link", {
195
- key: '16ae6a94124ea87782095058857d47a4a91789a9',
195
+ key: '17453c9d78c20583c989281672c0f41bbe8d036f',
196
196
  label: "redish",
197
197
  size: "small",
198
- intent: "blueish",
198
+ intent: "underline",
199
199
  icon: "chevron-right",
200
200
  url: "../color-palette/#primary-palette",
201
201
  "extra-class": "inline-block ml-4"
202
202
  }), "and", h("eds-link", {
203
- key: 'c5c4d82a809a586637f00013782e69fa6bab2879',
203
+ key: '3e78eb924b6a857674d50d4a209e4843f76e5fc3',
204
204
  label: "support",
205
205
  size: "small",
206
- intent: "blueish",
206
+ intent: "underline",
207
207
  icon: "chevron-right",
208
208
  url: "../color-palette/#support-palette",
209
209
  "extra-class": "inline-block ml-4"
210
210
  }), "color palettes."), h("div", {
211
- key: '83d408a58b5bf5dddbcceb2336ffa7c58bdcea44',
211
+ key: 'ae3e2a703633013f632df3a75f45ec932ce5e13b',
212
212
  class: "flex"
213
213
  }, h("div", {
214
- key: 'dca88ee121c036f50f23105cd8a430ed883f19db',
214
+ key: '4a0f256fa355dcbd6d6fc0e95e81a6c2821c917d',
215
215
  class: "w-full"
216
216
  }, h("ul", {
217
- key: '9b12b41325dfb100e87e1ced15f4b1b9c3457822',
218
- class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
217
+ key: '8aaf611ed9b87b86d0c1b47b1e37cb01989838b2',
218
+ class: "not-prose gap-y-8 md:gap-y-12 lg:gap-y-16"
219
219
  }, red.map(color => h("li", {
220
220
  class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
221
221
  }, h("div", {
@@ -224,11 +224,11 @@ const CorrectUseOfColors = class {
224
224
  backgroundColor: color.background
225
225
  }
226
226
  }))))), h("div", {
227
- key: '013e039ef9ebecdde9b59c82d819047976e77523',
227
+ key: '112e50da1627a671fbca843111becf51cd02ebc5',
228
228
  class: "w-full"
229
229
  }, h("ul", {
230
- key: '7c6125cc0f7e9998c1f74be9456a8a171545edf1',
231
- class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
230
+ key: '14033bd08a9d16bd0b6cfe8b87acc2a841c48a29',
231
+ class: "not-prose gap-y-8 md:gap-y-12 lg:gap-y-16"
232
232
  }, support.map(color => h("li", {
233
233
  class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
234
234
  }, h("div", {
@@ -3,7 +3,7 @@ import 'react';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react-dom';
5
5
 
6
- const EdsDocsPalettes = class {
6
+ const DocsPalettes = class {
7
7
  constructor(hostRef) {
8
8
  registerInstance(this, hostRef);
9
9
  this.tabIndex = undefined;
@@ -20,10 +20,10 @@ const EdsDocsPalettes = class {
20
20
  }
21
21
  render() {
22
22
  return h("div", {
23
- key: '80f0922a40e212252a858b019d88f104defc2632',
23
+ key: 'f985628b9ea3f02a511e2facbda99b54f0723acf',
24
24
  class: "container"
25
25
  }, this.renderContent());
26
26
  }
27
27
  };
28
28
 
29
- export { EdsDocsPalettes as eds_docs_palettes };
29
+ export { DocsPalettes as docs_palettes };
@@ -3,7 +3,7 @@ import 'react';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react-dom';
5
5
 
6
- const EdsDocsContent = class {
6
+ const DocsContent = class {
7
7
  constructor(hostRef) {
8
8
  registerInstance(this, hostRef);
9
9
  this.tabIndex = undefined;
@@ -36,10 +36,10 @@ const EdsDocsContent = class {
36
36
  }
37
37
  render() {
38
38
  return h("div", {
39
- key: 'cf676cf54781de4a4f8b75d174201d24d30d3538',
39
+ key: '29810a0ace60d2e5a0fc84d6715fc2fc89d6187f',
40
40
  class: "container"
41
41
  }, this.renderContent());
42
42
  }
43
43
  };
44
44
 
45
- export { EdsDocsContent as eds_docs_tokens };
45
+ export { DocsContent as docs_tokens };
@@ -0,0 +1,132 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index.esm2.js';
2
+ import { s as sendAnalytics } from './analytics-44b1416b.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const edsAccordionCss = "blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}.min-h-56{min-height:3.5rem}.container{width:calc(var(--container-width, 100%) - (2 * var(--breakout-container-outer-gutter, var(--container-outer-gutter, var(--outer-gutter, 0)))));margin-right:auto;margin-left:auto}.container>*{--container-outer-gutter:0;--breakout-container-outer-gutter:0}.break-words{overflow-wrap:break-word}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.effect-color{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.border-softer{border:2px solid rgba(0, 0, 0, .1)}.bg-default{background-color:var(--grey-200)}.bg-inverse{background-color:var(--white)}.relative{position:relative}.absolute{position:absolute}.inset-x-16{left:1rem;right:1rem}.top-16{top:1rem}.pr-32{padding-right:2rem}.pr-36{padding-right:2.25rem}.pr-40{padding-right:2.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}.w-full{width:100%}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.rounded-md{border-radius:12px}.outline-none{outline:2px solid transparent;outline-offset:2px}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.text-light{color:var(--grey-700)}.z-1{z-index:1}.z-10{z-index:10}.effect-height{transition-duration:300ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1);transition-property:height}.h-0{height:0rem}.h-auto{height:auto}.pt-4{padding-top:0.25rem}.overflow-hidden{overflow:hidden}.grid{display:grid}.overflow-hidden{overflow:hidden}.rounded-lg{border-radius:16px}.border-2{border-width:2px}.p-16{padding:1rem}.ml-auto{margin-left:auto}.mr-auto{margin-right:auto}.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)}.text-left{text-align:left}.text-center{text-align:center}";
8
+ const EdsAccordionStyle0 = edsAccordionCss;
9
+ const EdsAccordion = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ this.accordion = createEvent(this, "accordion", 7);
13
+ /**
14
+ * Handles the click event on the accordion header to toggle expansion.
15
+ * Toggles the `isExpanded` state and emits the `accordion` event.
16
+ */
17
+ this.handleClick = () => {
18
+ var _a;
19
+ this.isExpanded = !this.isExpanded;
20
+ this.accordion.emit(this.isExpanded);
21
+ this.setPanelHeight();
22
+ sendAnalytics({
23
+ category: 'ui-component',
24
+ parentContext: null,
25
+ tag: this.el.tagName.toLowerCase(),
26
+ name: ((_a = this.title) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
27
+ action: this.isExpanded ? 'expanded' : 'collapsed'
28
+ });
29
+ };
30
+ /**
31
+ * Calculates and sets the panel height based on the content height
32
+ * and adjusts based on the `shortContent` and `isExpanded` states.
33
+ */
34
+ this.setPanelHeight = () => {
35
+ if (this.childContentRef) {
36
+ this.shortContent = this.wrapperRef.scrollWidth > 830 && !this.description ? this.childContentRef.scrollHeight <= 80 : this.childContentRef.scrollHeight <= 20;
37
+ this.panelHeight = this.isExpanded && !this.shortContent ? this.childContentRef.scrollHeight : 0;
38
+ }
39
+ if (this.headerRef) {
40
+ this.headerHeight = this.headerRef.scrollHeight - 30;
41
+ }
42
+ };
43
+ this.title = undefined;
44
+ this.description = undefined;
45
+ this.switchBg = true;
46
+ this.expanded = false;
47
+ this.clampText = true;
48
+ this.isExpanded = this.expanded;
49
+ this.panelHeight = 0;
50
+ this.shortContent = false;
51
+ this.headerHeight = 0;
52
+ }
53
+ /**
54
+ * Lifecycle method that sets up the initial panel height and adds a resize event listener
55
+ * to recalculate height on window resize.
56
+ */
57
+ componentDidLoad() {
58
+ this.setPanelHeight();
59
+ window.addEventListener('resize', this.setPanelHeight);
60
+ }
61
+ /**
62
+ * Lifecycle method that cleans up the resize event listener when the component is removed.
63
+ */
64
+ disconnectedCallback() {
65
+ window.removeEventListener('resize', this.setPanelHeight);
66
+ }
67
+ /**
68
+ * Renders the accordion structure, including header, content, description, and any slotted content.
69
+ * Adjusts styles based on `switchBg`, `tiny`, `clampText`, and other props.
70
+ */
71
+ render() {
72
+ return h("div", {
73
+ key: 'db04fa9db1f53e95a7ac758656b32e75281f5749',
74
+ ref: el => this.wrapperRef = el,
75
+ class: `flex effect-color border-softer relative grid overflow-hidden rounded-lg border-2 p-16
76
+ ${this.switchBg && this.isExpanded ? 'bg-inverse' : 'bg-default'}
77
+ ${this.switchBg ? 'hover:bg-inverse' : ''}
78
+ ${this.description ? 'min-h-56' : ''}`
79
+ }, h("h3", {
80
+ key: 'a6fc54388e0eab3ddfb81dfb5907c55a1d6d40e1',
81
+ ref: el => this.headerRef = el,
82
+ class: "mr-auto f-heading-06 text-left absolute inset-x-16 break-words top-16 pr-40"
83
+ }, this.title), h("div", {
84
+ key: '96a1e4ae2849300e6cd3c737357a7e6e9a0439d5',
85
+ class: "ml-auto"
86
+ }, h("eds-button", {
87
+ key: 'ca53eed446f9bc7a96182da9e9e3a45b1c63dba2',
88
+ id: "toggleAccordion",
89
+ intent: "tertiary",
90
+ "aria-expanded": this.isExpanded || this.shortContent,
91
+ "aria-label": "Toggle accordion",
92
+ "aria-controls": "accordionSection",
93
+ class: `effect-color flex w-full items-center justify-between rounded-md outline-none focus:outline-none`,
94
+ onClick: this.handleClick,
95
+ icon: "chevron-down"
96
+ })), h("div", {
97
+ key: '2e1c52759fa07ecf63fed47f79c0384a79cd81c6',
98
+ class: `w-full`,
99
+ style: Number.isFinite(this.headerHeight) ? {
100
+ marginTop: `${this.headerHeight}px`
101
+ } : {}
102
+ }, this.description ? h("span", {
103
+ class: `text-light ${!this.isExpanded && this.clampText ? 'line-clamp-1' : ''}`
104
+ }, this.description) : null, h("section", {
105
+ key: '6ca819b2d9cb989f0942b98f32cd7243771b6ae9',
106
+ id: "accordionSection",
107
+ role: "region",
108
+ "aria-labelledby": "accordionHeader",
109
+ "aria-hidden": !this.isExpanded,
110
+ class: `z-1 effect-height relative h-0 w-full ${!this.isExpanded && this.clampText ? 'overflow-hidden' : ''}`,
111
+ style: {
112
+ height: this.isExpanded ? 'auto' : '0'
113
+ }
114
+ }, h("div", {
115
+ key: 'aa33297747aca21c3b3ed33eb3eabc2998192aeb',
116
+ ref: el => this.childContentRef = el,
117
+ class: `accordion-content effect-color pt-4`,
118
+ "aria-hidden": !this.isExpanded
119
+ }, h("span", {
120
+ key: 'af5b6e2218419a3c95e21e7e432696b073b7752b',
121
+ class: `${!this.isExpanded && this.clampText ? 'line-clamp-2' : ''}`
122
+ }, h("slot", {
123
+ key: '2a9d1ef2d2537c831b28fbecb02a6125a1412019'
124
+ }))))));
125
+ }
126
+ get el() {
127
+ return getElement(this);
128
+ }
129
+ };
130
+ EdsAccordion.style = EdsAccordionStyle0;
131
+
132
+ export { EdsAccordion as eds_accordion };