@ebrains/react 0.9.3-beta → 1.0.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.
- package/README.md +3 -3
- package/{analytics-44b1416b.esm.js → analytics-d99780e3.esm.js} +2 -2
- package/color-primary-palette_6.entry.esm.js +106 -106
- package/components-section.entry.esm.js +22 -16
- package/correct-use-of-colors.entry.esm.js +33 -33
- package/docs-palettes.entry.esm.js +1 -1
- package/docs-tokens.entry.esm.js +1 -1
- package/eds-accordion.entry.esm.js +2 -2
- package/eds-alert.entry.esm.js +1 -1
- package/eds-app-root.entry.esm.js +4 -4
- package/eds-avatar_34.entry.esm.js +3594 -0
- package/eds-card-project.entry.esm.js +130 -13
- package/eds-card-tool.entry.esm.js +5 -5
- package/eds-cookies-preference.entry.esm.js +2 -2
- package/eds-feedback.entry.esm.js +12 -7
- package/eds-frame.entry.esm.js +6 -6
- package/eds-matomo-notice.entry.esm.js +5 -8
- package/eds-pagination_2.entry.esm.js +10 -10
- package/eds-progress-bar.entry.esm.js +19 -8
- package/eds-rating.entry.esm.js +1 -1
- package/eds-section-core_2.entry.esm.js +5 -5
- package/eds-spinner.entry.esm.js +3 -3
- package/eds-splash-screen.entry.esm.js +87 -0
- package/eds-switch.entry.esm.js +21 -11
- package/eds-timeline.entry.esm.js +5 -5
- package/eds-toast-manager.entry.esm.js +33 -2
- package/eds-toast.entry.esm.js +4 -3
- package/eds-trl.entry.esm.js +2 -2
- package/incorrect-use-of-colors.entry.esm.js +11 -8
- package/index.esm.js +1 -1
- package/index.esm2.js +39 -314
- package/logo-space.entry.esm.js +9 -9
- package/logo-variations-horizontal_2.entry.esm.js +28 -28
- package/logo-variations-tabs.entry.esm.js +1 -1
- package/logo-wrong-usage.entry.esm.js +25 -25
- package/package.json +1 -1
- package/src/components.d.ts +2 -2
- package/src/generated/components.d.ts +1 -1
- package/svg-repository.entry.esm.js +2 -2
- package/token-list_3.entry.esm.js +5 -5
- package/token-ratios.entry.esm.js +3 -3
- package/token-typography.entry.esm.js +2 -2
- package/color-2554aad6.esm.js +0 -122
- package/eds-avatar_27.entry.esm.js +0 -332
- package/eds-card-desc_2.entry.esm.js +0 -86
- package/eds-card-generic.entry.esm.js +0 -114
- package/eds-card-wrapper.entry.esm.js +0 -39
- package/eds-login_2.entry.esm.js +0 -1828
- package/eds-tabs.entry.esm.js +0 -143
- package/eds-tooltip.entry.esm.js +0 -125
- package/toastManager-d9eee791.esm.js +0 -34
package/eds-switch.entry.esm.js
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index.esm2.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index.esm2.js';
|
|
2
|
+
import { s as sendAnalytics } from './analytics-d99780e3.esm.js';
|
|
2
3
|
import 'react';
|
|
3
4
|
import 'react/jsx-runtime';
|
|
4
5
|
import 'react-dom';
|
|
5
6
|
|
|
6
|
-
const edsSwitchCss = ":host{display:inline-block}.switch-container{display:inline-flex;align-items:center}.switch-label{font-size:
|
|
7
|
+
const edsSwitchCss = ":host{display:inline-block}.switch-container{display:inline-flex;align-items:center}.switch-label{font-family:var(--f-ui-02-light-fontFamily);font-weight:var(--f-ui-02-light-fontWeight);font-size:var(--f-ui-02-light-fontSize);line-height:var(--f-ui-02-light-lineHeight);letter-spacing:var(--f-ui-02-light-letterSpacing)}button.switch{position:relative;display:inline-flex;align-items:center;width:50px;height:26px;border:none;border-radius:13px;background-color:#ccc;padding:0;cursor:pointer;transition:background-color 0.2s}button.switch:focus{outline:none;box-shadow:0 0 0 2px #007aff}button.switch.switch--checked{background-color:var(--green-500)}button.switch.switch--disabled{opacity:0.6;cursor:not-allowed}.switch-handle{position:absolute;width:22px;height:22px;border-radius:50%;background-color:#fff;top:2px;left:2px;transition:transform 0.2s}button.switch.switch--checked .switch-handle{transform:translateX(24px)}.ml-8{margin-left:0.5rem}.mr-8{margin-right:0.5rem}";
|
|
7
8
|
const EdsSwitchStyle0 = edsSwitchCss;
|
|
8
9
|
const EdsSwitch = class {
|
|
9
10
|
constructor(hostRef) {
|
|
10
11
|
registerInstance(this, hostRef);
|
|
11
|
-
this.
|
|
12
|
+
this.uiswitch = createEvent(this, "uiswitch", 7);
|
|
12
13
|
this.toggleSwitch = () => {
|
|
13
14
|
if (this.disabled) {
|
|
14
15
|
return;
|
|
15
16
|
}
|
|
16
17
|
this.checked = !this.checked;
|
|
17
|
-
this.
|
|
18
|
+
this.uiswitch.emit(this.checked);
|
|
19
|
+
sendAnalytics({
|
|
20
|
+
category: 'ui-component',
|
|
21
|
+
tag: this.el.tagName.toLowerCase(),
|
|
22
|
+
name: this.checked ? this.labelOn : this.labelOff || '',
|
|
23
|
+
action: 'checked'
|
|
24
|
+
});
|
|
18
25
|
};
|
|
19
26
|
this.checked = false;
|
|
20
27
|
this.disabled = false;
|
|
@@ -25,13 +32,13 @@ const EdsSwitch = class {
|
|
|
25
32
|
// Compute an accessible name based on state.
|
|
26
33
|
const accessibleLabel = this.labelOn || this.labelOff ? this.checked ? this.labelOn : this.labelOff : 'Toggle switch';
|
|
27
34
|
return h("div", {
|
|
28
|
-
key: '
|
|
35
|
+
key: '442876be1bad7ea8c9e383bc68b192a2744c38f9',
|
|
29
36
|
class: "switch-container"
|
|
30
37
|
}, this.labelOff && h("span", {
|
|
31
|
-
key: '
|
|
32
|
-
class: "switch-label switch-label--off"
|
|
38
|
+
key: 'e4a7b01c0188d26e5b6524741b1c8ef66e357e35',
|
|
39
|
+
class: "switch-label switch-label--off mr-8"
|
|
33
40
|
}, this.labelOff), h("button", {
|
|
34
|
-
key: '
|
|
41
|
+
key: 'f56b3762622671acf793568a96567193c38999c7',
|
|
35
42
|
type: "button",
|
|
36
43
|
role: "switch",
|
|
37
44
|
"aria-checked": this.checked ? 'true' : 'false',
|
|
@@ -45,13 +52,16 @@ const EdsSwitch = class {
|
|
|
45
52
|
onClick: this.toggleSwitch,
|
|
46
53
|
disabled: this.disabled
|
|
47
54
|
}, h("span", {
|
|
48
|
-
key: '
|
|
55
|
+
key: 'b76e89a1e37130542dd86ce3aed8c5690aeeda63',
|
|
49
56
|
class: "switch-handle"
|
|
50
57
|
})), this.labelOn && h("span", {
|
|
51
|
-
key: '
|
|
52
|
-
class: "switch-label switch-label--on"
|
|
58
|
+
key: '4e5d4f8a2f19bb612a17fa73e441e7e718b71508',
|
|
59
|
+
class: "switch-label switch-label--on ml-8"
|
|
53
60
|
}, this.labelOn));
|
|
54
61
|
}
|
|
62
|
+
get el() {
|
|
63
|
+
return getElement(this);
|
|
64
|
+
}
|
|
55
65
|
};
|
|
56
66
|
EdsSwitch.style = EdsSwitchStyle0;
|
|
57
67
|
|