@ebrains/react 0.2.0-alpha.0 → 0.3.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 (42) hide show
  1. package/color-primary-palette_6.entry.esm.js +106 -106
  2. package/correct-use-of-colors.entry.esm.js +57 -57
  3. package/eds-alert.entry.esm.js +102 -0
  4. package/eds-avatar_17.entry.esm.js +209 -0
  5. package/eds-card-desc_3.entry.esm.js +129 -0
  6. package/eds-card-generic.entry.esm.js +125 -0
  7. package/eds-card-section.entry.esm.js +17 -7
  8. package/eds-components-section.entry.esm.js +57 -24
  9. package/eds-docs-palettes.entry.esm.js +1 -1
  10. package/eds-docs-tokens.entry.esm.js +1 -1
  11. package/eds-form.entry.esm.js +374 -0
  12. package/eds-input_7.entry.esm.js +518 -0
  13. package/eds-login.entry.esm.js +4 -12
  14. package/eds-logo-variations.entry.esm.js +29 -0
  15. package/{eds-pagination.entry.esm.js → eds-pagination_2.entry.esm.js} +199 -1
  16. package/eds-progress-bar.entry.esm.js +36 -0
  17. package/eds-svg-repository.entry.esm.js +12 -3
  18. package/eds-tabs-content.entry.esm.js +4 -4
  19. package/eds-tabs.entry.esm.js +26 -7
  20. package/eds-timeline.entry.esm.js +130 -0
  21. package/eds-trl.entry.esm.js +69 -0
  22. package/incorrect-use-of-colors.entry.esm.js +11 -10
  23. package/index.esm.js +1 -1
  24. package/index.esm2.js +35 -27
  25. package/logo-space.entry.esm.js +4 -4
  26. package/logo-variations-horizontal_2.entry.esm.js +116 -0
  27. package/logo-wrong-usage.entry.esm.js +39 -39
  28. package/package.json +1 -1
  29. package/src/components.d.ts +2 -0
  30. package/token-list_3.entry.esm.js +5 -5
  31. package/token-ratios.entry.esm.js +3 -3
  32. package/token-spacing.entry.esm.js +26 -26
  33. package/token-typography.entry.esm.js +2 -2
  34. package/eds-alert_28.entry.esm.js +0 -227
  35. package/eds-block-break.entry.esm.js +0 -22
  36. package/eds-breadcrumb.entry.esm.js +0 -169
  37. package/eds-footer.entry.esm.js +0 -110
  38. package/eds-fullscreen-menu.entry.esm.js +0 -143
  39. package/eds-social-networks.entry.esm.js +0 -74
  40. package/eds-table.entry.esm.js +0 -196
  41. package/logo-variations-horizontal.entry.esm.js +0 -50
  42. package/logo-variations-vertical.entry.esm.js +0 -53
@@ -1,196 +0,0 @@
1
- import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
- import 'react';
3
- import 'react/jsx-runtime';
4
- import 'react-dom';
5
-
6
- const edsTableCss = "table{text-indent:0;border-color:inherit;border-collapse:collapse;}.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}.pt-32{padding-top:2rem}.pt-40{padding-top:2.5rem}.pt-48{padding-top:3rem}.pb-28{padding-bottom:1.75rem}.pb-60{padding-bottom:3.75rem}.mt-20{margin-top:1.25rem}.mt-28{margin-top:1.75rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.overflow-x-auto{overflow-x:auto}.mt-6{margin-top:0.375rem}.p-0{padding:0rem}.m-0{margin:0rem}.border{border-width:1px}.border-softer{border:1px solid rgba(0, 0, 0, .1)}.even\\:bg-inverse-softer:nth-child(even){background-color:rgba(255, 255, 255, .15)}.px-20{padding-left:1.25rem;padding-right:1.25rem}.py-8{padding-top:0.5rem;padding-bottom:0.5rem}.f-ui-01{font-family:var(--f-ui-01-fontFamily);font-weight:var(--f-ui-01-fontWeight);font-size:var(--f-ui-01-fontSize);line-height:var(--f-ui-01-lineHeight);letter-spacing:var(--f-ui-01-letterSpacing)}.f-ui-02{font-family:var(--f-ui-02-fontFamily);font-weight:var(--f-ui-02-fontWeight);font-size:var(--f-ui-02-fontSize);line-height:var(--f-ui-02-lineHeight);letter-spacing:var(--f-ui-02-letterSpacing)}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.text-center{text-align:center}";
7
- const EdsTableStyle0 = edsTableCss;
8
- const EdsTable = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.minWidth = 400; // Minimum width for components in px
12
- this.data = null;
13
- this.endpoint = null;
14
- this.config = {};
15
- this.rowsPerPage = 10;
16
- this.paginationEnabled = true;
17
- this.searchEnabled = false;
18
- this.tableData = [];
19
- this.columns = [];
20
- this.currentPage = 1;
21
- this.parsedConfig = {};
22
- this.totalRows = 0;
23
- this.searchQuery = '';
24
- }
25
- handleDataChange() {
26
- this.parseData();
27
- }
28
- handleConfigChange() {
29
- this.parseConfig();
30
- }
31
- componentWillLoad() {
32
- this.parseConfig();
33
- this.data ? this.parseData() : this.endpoint && this.fetchData();
34
- }
35
- componentDidLoad() {
36
- this.setupPaginationListener();
37
- }
38
- componentDidUpdate() {
39
- this.setupPaginationListener();
40
- }
41
- parseData() {
42
- try {
43
- this.tableData = typeof this.data === 'string' ? JSON.parse(this.data) : this.data || [];
44
- this.totalRows = this.tableData.length;
45
- this.updateColumns();
46
- this.currentPage = 1;
47
- } catch (error) {
48
- // eslint-disable-next-line
49
- console.error('Failed to parse data:', error);
50
- this.tableData = [];
51
- }
52
- }
53
- parseConfig() {
54
- try {
55
- this.parsedConfig = typeof this.config === 'string' ? JSON.parse(this.config) : this.config;
56
- } catch (error) {
57
- // eslint-disable-next-line
58
- console.error('Failed to parse config:', error);
59
- this.parsedConfig = {};
60
- }
61
- }
62
- async fetchData() {
63
- try {
64
- const response = await fetch(this.endpoint);
65
- const data = await response.json();
66
- this.data = data;
67
- } catch (error) {
68
- // eslint-disable-next-line
69
- console.error('Failed to fetch data:', error);
70
- }
71
- }
72
- setupPaginationListener() {
73
- if (!this.shouldEnablePagination()) {
74
- return;
75
- }
76
- const paginationEl = this.hostEl.shadowRoot.querySelector('eds-pagination');
77
- if (paginationEl && !paginationEl.hasAttribute('listener-attached')) {
78
- paginationEl.addEventListener('pageChange', event => this.handlePageChange(event.detail));
79
- paginationEl.setAttribute('listener-attached', 'true');
80
- }
81
- }
82
- getFilteredRows() {
83
- return this.tableData.filter(row => Object.values(row).some(value => value.toString().toLowerCase().includes(this.searchQuery.toLowerCase())));
84
- }
85
- getPaginatedRows() {
86
- const filteredRows = this.getFilteredRows();
87
- this.totalRows = filteredRows.length;
88
- const start = (this.currentPage - 1) * this.rowsPerPage;
89
- return filteredRows.slice(start, start + this.rowsPerPage);
90
- }
91
- handlePageChange(newPage) {
92
- this.currentPage = newPage;
93
- }
94
- handleSearch(event) {
95
- this.searchQuery = event.target.value;
96
- this.currentPage = 1;
97
- }
98
- renderCell(value, column) {
99
- var _a;
100
- const format = (_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.format;
101
- return format === 'uppercase' ? value === null || value === void 0 ? void 0 : value.toString().toUpperCase() : format === 'svg' ? h("div", {
102
- innerHTML: value
103
- }) : format === 'bold' ? h("strong", null, value) : format === 'code' ? h("code", null, value) : value;
104
- }
105
- shouldEnablePagination() {
106
- return this.paginationEnabled && this.totalRows > this.rowsPerPage;
107
- }
108
- updateColumns() {
109
- this.columns = this.tableData.length > 0 ? Object.keys(this.tableData[0]) : [];
110
- }
111
- getVisibleColumnsCount() {
112
- return this.columns.filter(column => {
113
- var _a;
114
- return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden);
115
- }).length;
116
- }
117
- render() {
118
- const paginatedRows = this.getPaginatedRows();
119
- const lastPage = Math.ceil(this.totalRows / this.rowsPerPage);
120
- // Calculate column width based on minWidth and number of columns
121
- //const columnWidth = Math.max(this.minWidth / this.columns.length, 100);
122
- // Use the visible column count to calculate the column width
123
- const visibleColumnsCount = this.getVisibleColumnsCount();
124
- const columnWidth = visibleColumnsCount > 0 ? Math.max(this.minWidth / visibleColumnsCount, 100) : 100;
125
- return h("div", {
126
- key: 'c5e50673eb1ed5cf00e0294885bf9cd6d13f9366',
127
- class: "container",
128
- style: {
129
- minWidth: `${this.minWidth}px`
130
- }
131
- }, h("div", {
132
- key: '0e0814a8cb5ae1e11538a26cba630e59d39dde74'
133
- }, this.searchEnabled && h("eds-input-field", {
134
- key: 1,
135
- name: "search",
136
- "aria-label": "Search",
137
- type: "text",
138
- placeholder: "Search...",
139
- // @ts-ignore
140
- onInput: event => this.handleSearch(event)
141
- })), h("div", {
142
- key: '65e0c9057c313f220655ecd7692a83c932f441b3',
143
- class: "mt-20"
144
- }, h("table", {
145
- key: '9e77153c2e0983f7598a21ef55ebcf3107655e09',
146
- class: "block overflow-x-auto mt-6 p-0"
147
- }, h("thead", {
148
- key: '38e5ac67ffae80d896c29357615d19b5dfcc52d3'
149
- }, h("tr", {
150
- key: '526c5b30da0a2aa97bb90f5b473b3e9ea41dde6b',
151
- class: "m-0 p-0 border border-softer even:bg-inverse-softer"
152
- }, this.columns.map(column => {
153
- var _a;
154
- return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden) && h("th", {
155
- class: "m-0 px-20 py-8 border border-softer f-ui-02",
156
- style: {
157
- minWidth: `${columnWidth}px`
158
- }
159
- }, column);
160
- }))), h("tbody", {
161
- key: '5a10525ed86eac82291746be4c6cce5f65942d2d'
162
- }, paginatedRows.map(row => h("tr", {
163
- class: "m-0 p-0 border border-softer even:bg-inverse-softer"
164
- }, this.columns.map(column => {
165
- var _a;
166
- return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden) && h("td", {
167
- class: "text-center border border-softer m-0 px-20 py-8 f-ui-2",
168
- style: {
169
- minWidth: `${columnWidth}px`
170
- }
171
- }, this.renderCell(row[column], column));
172
- })))))), h("div", {
173
- key: 'af1183fd3e635c7d7ac982231adfdd9d892f6979',
174
- class: "mt-20"
175
- }, this.shouldEnablePagination() && h("eds-pagination", {
176
- key: 'a5de7f25054c2d67f0788bfd2bc37d07f46de02c',
177
- currentPage: this.currentPage,
178
- lastPage: lastPage,
179
- perPage: this.rowsPerPage,
180
- total: this.totalRows,
181
- mode: "default"
182
- })));
183
- }
184
- get hostEl() {
185
- return getElement(this);
186
- }
187
- static get watchers() {
188
- return {
189
- "data": ["handleDataChange"],
190
- "config": ["handleConfigChange"]
191
- };
192
- }
193
- };
194
- EdsTable.style = EdsTableStyle0;
195
-
196
- export { EdsTable as eds_table };
@@ -1,50 +0,0 @@
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 logoVariationsHorizontalCss = ".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}.bg-accent{background-color:var(--green-500)}.bg-dark{background-color:var(--grey-300)}.bg-strongest{background-color:var(--black)}.text-default{color:var(--black)}.text-inverse{color:var(--white)}.p-8{padding:0.5rem}.p-16{padding:1rem}.my-16{margin-top:1rem;margin-bottom:1rem}.my-20{margin-top:1.25rem;margin-bottom:1.25rem}.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)}.w-\\[150px\\]{width:150px}.w-\\[300px\\]{width:500px}.coloured{background:linear-gradient(to left, \n #9CE142 0%, \n #00C959 50%, \n #00A595 100%)}";
7
- const LogoVariationsHorizontalStyle0 = logoVariationsHorizontalCss;
8
- const LogoVariations = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.orientation = 'horizontal';
12
- this.type = undefined;
13
- }
14
- render() {
15
- if (this.type === 'coloured') {
16
- return h("div", {
17
- class: "container my-16"
18
- }, h("div", {
19
- class: "coloured w-[300px]"
20
- }, h("eds-logo", {
21
- type: "no-bg",
22
- href: "#"
23
- })));
24
- }
25
- if (this.type === 'black') {
26
- return h("div", {
27
- class: "container my-16"
28
- }, h("div", {
29
- class: "bg-default w-[300px]"
30
- }, h("eds-logo", {
31
- type: "black",
32
- href: "#"
33
- })));
34
- }
35
- if (this.type === 'color-white') {
36
- return h("div", {
37
- class: "container my-16"
38
- }, h("div", {
39
- class: "w-[300px]"
40
- }, h("eds-logo", {
41
- type: "color-white",
42
- href: "#"
43
- })));
44
- }
45
- return null;
46
- }
47
- };
48
- LogoVariations.style = LogoVariationsHorizontalStyle0;
49
-
50
- export { LogoVariations as logo_variations_horizontal };
@@ -1,53 +0,0 @@
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 logoVariationsVerticalCss = ".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}.bg-accent{background-color:var(--green-500)}.bg-dark{background-color:var(--grey-300)}.bg-strongest{background-color:var(--black)}.text-default{color:var(--black)}.text-inverse{color:var(--white)}.p-8{padding:0.5rem}.p-16{padding:1rem}.my-16{margin-top:1rem;margin-bottom:1rem}.my-20{margin-top:1.25rem;margin-bottom:1.25rem}.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)}.w-\\[150px\\]{width:150px}.w-\\[200px\\]{width:200px}.w-\\[300px\\]{width:500px}.coloured{background:linear-gradient(to left, \n #9CE142 0%, \n #00C959 50%, \n #00A595 100%)}";
7
- const LogoVariationsVerticalStyle0 = logoVariationsVerticalCss;
8
- const LogoVariations = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.orientation = 'horizontal';
12
- this.type = undefined;
13
- }
14
- render() {
15
- if (this.type === 'coloured') {
16
- return h("div", {
17
- class: "container my-16"
18
- }, h("div", {
19
- class: "coloured w-[200px]"
20
- }, h("eds-logo", {
21
- orientation: "vertical",
22
- type: "no-bg",
23
- href: "#"
24
- })));
25
- }
26
- if (this.type === 'black') {
27
- return h("div", {
28
- class: "container my-16"
29
- }, h("div", {
30
- class: "bg-default w-[200px]"
31
- }, h("eds-logo", {
32
- orientation: "vertical",
33
- type: "black",
34
- href: "#"
35
- })));
36
- }
37
- if (this.type === 'color-white') {
38
- return h("div", {
39
- class: "container my-16"
40
- }, h("div", {
41
- class: "w-[200px]"
42
- }, h("eds-logo", {
43
- orientation: "vertical",
44
- type: "color-white",
45
- href: "#"
46
- })));
47
- }
48
- return null;
49
- }
50
- };
51
- LogoVariations.style = LogoVariationsVerticalStyle0;
52
-
53
- export { LogoVariations as logo_variations_vertical };