@ebrains/react 0.9.2-beta → 0.9.3-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.
- package/analytics-44b1416b.esm.js +55 -0
- package/arrow-diagonal-black-8f0494c3.esm.js +3 -0
- package/arrow-right-9322ba8a.esm.js +5 -0
- package/bluesky-cc5edd2d.esm.js +14 -0
- package/bookmark-c200037c.esm.js +16 -0
- package/chevron-down-6144c823.esm.js +12 -0
- package/chevron-left-ca6c66e1.esm.js +11 -0
- package/chevron-right-b88ed2d4.esm.js +5 -0
- package/chevron-up-c66bd477.esm.js +12 -0
- package/close-87fc0d63.esm.js +5 -0
- package/color-2554aad6.esm.js +122 -0
- package/color-primary-palette_6.entry.esm.js +778 -0
- package/components-section.entry.esm.js +165 -0
- package/copy-03b72cb6.esm.js +5 -0
- package/correct-use-of-colors.entry.esm.js +243 -0
- package/docs-palettes.entry.esm.js +29 -0
- package/docs-tokens.entry.esm.js +45 -0
- package/eds-accordion.entry.esm.js +132 -0
- package/eds-alert.entry.esm.js +112 -0
- package/eds-app-root.entry.esm.js +53 -0
- package/eds-avatar_27.entry.esm.js +332 -0
- package/eds-card-desc_2.entry.esm.js +86 -0
- package/eds-card-generic.entry.esm.js +114 -0
- package/eds-card-project.entry.esm.js +93 -0
- package/eds-card-section.entry.esm.js +56 -0
- package/eds-card-tags.entry.esm.js +27 -0
- package/eds-card-tool.entry.esm.js +105 -0
- package/eds-card-wrapper.entry.esm.js +39 -0
- package/eds-code-block.entry.esm.js +2290 -0
- package/eds-cookies-preference.entry.esm.js +47 -0
- package/eds-feedback.entry.esm.js +82 -0
- package/eds-frame.entry.esm.js +112 -0
- package/eds-icon-arrow-diagonal.entry.esm.js +21 -0
- package/eds-icon-arrow-right.entry.esm.js +21 -0
- package/eds-icon-bluesky.entry.esm.js +21 -0
- package/eds-icon-bookmark.entry.esm.js +21 -0
- package/eds-icon-chevron-down.entry.esm.js +21 -0
- package/eds-icon-chevron-left.entry.esm.js +21 -0
- package/eds-icon-chevron-right.entry.esm.js +21 -0
- package/eds-icon-chevron-up.entry.esm.js +21 -0
- package/eds-icon-close.entry.esm.js +21 -0
- package/eds-icon-copy.entry.esm.js +21 -0
- package/eds-icon-eu.entry.esm.js +21 -0
- package/eds-icon-external.entry.esm.js +21 -0
- package/eds-icon-facebook.entry.esm.js +21 -0
- package/eds-icon-gitlab.entry.esm.js +21 -0
- package/eds-icon-linkedin.entry.esm.js +21 -0
- package/eds-icon-loader.entry.esm.js +21 -0
- package/eds-icon-mastodon.entry.esm.js +21 -0
- package/eds-icon-menu.entry.esm.js +21 -0
- package/eds-icon-minus.entry.esm.js +21 -0
- package/eds-icon-more.entry.esm.js +21 -0
- package/eds-icon-paper.entry.esm.js +21 -0
- package/eds-icon-plus.entry.esm.js +21 -0
- package/eds-icon-portal.entry.esm.js +21 -0
- package/eds-icon-private.entry.esm.js +21 -0
- package/eds-icon-public.entry.esm.js +21 -0
- package/eds-icon-search.entry.esm.js +21 -0
- package/eds-icon-star.entry.esm.js +21 -0
- package/eds-icon-success.entry.esm.js +21 -0
- package/eds-icon-thumbs-down.entry.esm.js +21 -0
- package/eds-icon-thumbs-up.entry.esm.js +21 -0
- package/eds-icon-tutorial.entry.esm.js +21 -0
- package/eds-icon-twitter.entry.esm.js +21 -0
- package/eds-icon-unknown.entry.esm.js +21 -0
- package/eds-icon-updown.entry.esm.js +21 -0
- package/eds-icon-user.entry.esm.js +21 -0
- package/eds-icon-youtube.entry.esm.js +21 -0
- package/eds-login_2.entry.esm.js +1828 -0
- package/eds-matomo-notice.entry.esm.js +162 -0
- package/eds-pagination_2.entry.esm.js +493 -0
- package/eds-progress-bar.entry.esm.js +41 -0
- package/eds-rating.entry.esm.js +79 -0
- package/eds-section-core_2.entry.esm.js +69 -0
- package/eds-spinner.entry.esm.js +67 -0
- package/eds-switch.entry.esm.js +58 -0
- package/eds-tabs.entry.esm.js +143 -0
- package/eds-timeline.entry.esm.js +117 -0
- package/eds-toast-manager.entry.esm.js +62 -0
- package/eds-toast.entry.esm.js +92 -0
- package/eds-tooltip.entry.esm.js +125 -0
- package/eds-trl.entry.esm.js +68 -0
- package/eu-9ddde93a.esm.js +30 -0
- package/facebook-9cb5c17f.esm.js +14 -0
- package/incorrect-use-of-colors.entry.esm.js +71 -0
- package/index-39c58238.esm.js +58 -0
- package/index.esm.d.ts +1 -0
- package/index.esm.js +4 -0
- package/index.esm2.js +4833 -0
- package/linkedin-e8650abb.esm.js +28 -0
- package/loader-c9628637.esm.js +30 -0
- package/logo-color-7f1fd803.esm.js +115 -0
- package/logo-color-margins-ff8ce71b.esm.js +118 -0
- package/logo-space.entry.esm.js +48 -0
- package/logo-variations-horizontal_2.entry.esm.js +123 -0
- package/logo-variations-tabs.entry.esm.js +29 -0
- package/logo-white-no-bg-f382f86f.esm.js +1021 -0
- package/logo-wrong-usage.entry.esm.js +101 -0
- package/mastodon-3703ec61.esm.js +14 -0
- package/menu-340ea948.esm.js +11 -0
- package/minus-b30a7c71.esm.js +11 -0
- package/mono-53f70232.esm.js +11 -0
- package/more-4449d549.esm.js +13 -0
- package/package.json +6 -2
- package/paper-8e74ea31.esm.js +15 -0
- package/plus-89c07be2.esm.js +12 -0
- package/portal-d6c8ce56.esm.js +18 -0
- package/private-1c25ff8e.esm.js +25 -0
- package/public-d4d8c585.esm.js +16 -0
- package/search-fbcd79c2.esm.js +12 -0
- package/sharedUtils-a550989c.esm.js +17 -0
- package/src/components.d.ts +40 -0
- package/src/generated/components.d.ts +38 -0
- package/src/generated/react-component-lib/attachProps.d.ts +16 -0
- package/src/generated/react-component-lib/case.d.ts +2 -0
- package/src/generated/react-component-lib/createComponent.d.ts +10 -0
- package/src/generated/react-component-lib/createOverlayComponent.d.ts +21 -0
- package/src/generated/react-component-lib/dev.d.ts +2 -0
- package/src/generated/react-component-lib/interfaces.d.ts +29 -0
- package/src/generated/react-component-lib/utils/attachProps.d.ts +16 -0
- package/src/generated/react-component-lib/utils/case.d.ts +2 -0
- package/src/generated/react-component-lib/utils/dev.d.ts +2 -0
- package/src/generated/react-component-lib/utils/index.d.ts +10 -0
- package/src/react-component-lib/attachProps.d.ts +16 -0
- package/src/react-component-lib/case.d.ts +2 -0
- package/src/react-component-lib/createComponent.d.ts +10 -0
- package/src/react-component-lib/createOverlayComponent.d.ts +21 -0
- package/src/react-component-lib/dev.d.ts +2 -0
- package/src/react-component-lib/interfaces.d.ts +29 -0
- package/src/react-component-lib/utils/attachProps.d.ts +16 -0
- package/src/react-component-lib/utils/case.d.ts +2 -0
- package/src/react-component-lib/utils/index.d.ts +10 -0
- package/star-0da9b5e9.esm.js +5 -0
- package/success-443809da.esm.js +18 -0
- package/svg-repository.entry.esm.js +337 -0
- package/thumbs-down-a18fd049.esm.js +5 -0
- package/thumbs-up-c19a71bc.esm.js +6 -0
- package/toastManager-d9eee791.esm.js +34 -0
- package/token-list_3.entry.esm.js +385 -0
- package/token-ratios.entry.esm.js +49 -0
- package/token-typography.entry.esm.js +267 -0
- package/tutotial-150ee1fd.esm.js +27 -0
- package/twitter-ac21b505.esm.js +14 -0
- package/unknown-ed01a24c.esm.js +22 -0
- package/up-and-down-d747abee.esm.js +12 -0
- package/user-71ebdc15.esm.js +16 -0
- package/youtube-efbfbdc4.esm.js +14 -0
- package/.babelrc +0 -12
- package/project.json +0 -10
- package/rollup.config.js +0 -43
- package/src/components.ts +0 -49
- package/src/generated/components.ts +0 -47
- package/src/generated/react-component-lib/attachProps.ts +0 -125
- package/src/generated/react-component-lib/case.ts +0 -7
- package/src/generated/react-component-lib/createComponent.tsx +0 -106
- package/src/generated/react-component-lib/createOverlayComponent.tsx +0 -142
- package/src/generated/react-component-lib/dev.ts +0 -14
- package/src/generated/react-component-lib/index.tsx +0 -50
- package/src/generated/react-component-lib/interfaces.ts +0 -34
- package/src/generated/react-component-lib/utils/attachProps.ts +0 -125
- package/src/generated/react-component-lib/utils/case.ts +0 -7
- package/src/generated/react-component-lib/utils/dev.ts +0 -14
- package/src/generated/react-component-lib/utils/index.tsx +0 -50
- package/src/react-component-lib/attachProps.ts +0 -125
- package/src/react-component-lib/case.ts +0 -7
- package/src/react-component-lib/createComponent.tsx +0 -106
- package/src/react-component-lib/createOverlayComponent.tsx +0 -142
- package/src/react-component-lib/dev.ts +0 -14
- package/src/react-component-lib/index.tsx +0 -50
- package/src/react-component-lib/interfaces.ts +0 -34
- package/src/react-component-lib/utils/attachProps.ts +0 -125
- package/src/react-component-lib/utils/case.ts +0 -7
- package/src/react-component-lib/utils/index.tsx +0 -50
- package/tsconfig.json +0 -17
- package/tsconfig.lib.json +0 -23
- /package/src/generated/react-component-lib/{index.ts → index.d.ts} +0 -0
- /package/src/{index.ts → index.d.ts} +0 -0
- /package/src/react-component-lib/{index.ts → index.d.ts} +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
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 edsProgressBarCss = ".w-full{width:100%}.h-full{height:100%}.bg-default{background-color:var(--grey-200)}.rounded-lg{border-radius:16px}.h-24{height:1.5rem}.border{border-width:1px}.border-softer{border:2px solid rgba(0, 0, 0, .1 )}.overflow-hidden{overflow:hidden}.bg-accent{background-color:var(--green-500)}.bg-\\[\\#0034CB\\]{--tw-text-opacity:1;background-color:rgb(0 52 203 / var(--tw-text-opacity))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.duration-300{transition-duration:300ms}.flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.text-default{color:var(--black)}.text-inverse{color:var(--white)}.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)}";
|
|
7
|
+
const EdsProgressBarStyle0 = edsProgressBarCss;
|
|
8
|
+
const EdsProgressBar = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.value = 0;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Method to update the progress value externally.
|
|
15
|
+
* @param newValue The new progress value (0-100).
|
|
16
|
+
*/
|
|
17
|
+
async updateValue(newValue) {
|
|
18
|
+
this.value = Math.min(100, Math.max(0, newValue)); // Clamp value between 0 and 100
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
const progressValue = this.value;
|
|
22
|
+
return h("div", {
|
|
23
|
+
key: '0f47fedbf9d44887f65b399e184215f0937b1df1',
|
|
24
|
+
role: "progressbar",
|
|
25
|
+
"aria-valuemin": "0",
|
|
26
|
+
"aria-valuemax": "100",
|
|
27
|
+
"aria-valuenow": progressValue,
|
|
28
|
+
"aria-valuetext": `${progressValue}%`,
|
|
29
|
+
class: "outer w-full bg-default rounded-lg h-24 border border-softer overflow-hidden"
|
|
30
|
+
}, h("div", {
|
|
31
|
+
key: 'a2d095d778842c969832ea6b1ba7f7ef917d1390',
|
|
32
|
+
class: `inner h-full rounded-lg bg-accent transition-all duration-300 flex items-center justify-center text-default f-body-02`,
|
|
33
|
+
style: {
|
|
34
|
+
width: `${progressValue}%`
|
|
35
|
+
}
|
|
36
|
+
}, progressValue, "%"));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
EdsProgressBar.style = EdsProgressBarStyle0;
|
|
40
|
+
|
|
41
|
+
export { EdsProgressBar as eds_progress_bar };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index.esm2.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react-dom';
|
|
5
|
+
|
|
6
|
+
const edsRatingCss = ":host{display:inline-block}.block{display:block}.stars{display:flex;gap:0.25rem;cursor:pointer}.star{color:var(--star-empty-color, #ccc);transition:color 0.2s ease-in-out}.star.filled{color:var(--green-500);}.star:hover,.star.filled:hover{transform:scale(1.2)}.flex{display:flex}.inline-flex{display:inline-flex}.flex-col{flex-direction:column}.mt-4{margin-top:0.25rem}.mt-6{margin-top:0.375rem}.mt-8{margin-top:0.5rem}.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}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.0625rem * var(--tw-space-x-reverse));margin-left:calc(0.0625rem * calc(1 - var(--tw-space-x-reverse)))}";
|
|
7
|
+
const EdsRatingStyle0 = edsRatingCss;
|
|
8
|
+
const EdsRating = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.rating = createEvent(this, "rating", 7);
|
|
12
|
+
this.ratingType = 'star';
|
|
13
|
+
this.ratingCount = 5;
|
|
14
|
+
this.selectedRating = 0;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Lifecycle method that runs when the component has fully loaded.
|
|
18
|
+
* It emits a custom event for each `eds-button` element contained within the breadcrumb.
|
|
19
|
+
*/
|
|
20
|
+
componentDidLoad() {
|
|
21
|
+
const btns = this.el.shadowRoot.querySelectorAll('eds-button');
|
|
22
|
+
btns.forEach(btn => {
|
|
23
|
+
this.emitContext(btn);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Emits a custom event called `parentContext` for a given link element.
|
|
28
|
+
* This event provides context information about the breadcrumb component.
|
|
29
|
+
*
|
|
30
|
+
* @param btnElement - The link element to which the event will be dispatched.
|
|
31
|
+
*/
|
|
32
|
+
emitContext(btnElement) {
|
|
33
|
+
const event = new CustomEvent('parentContext', {
|
|
34
|
+
detail: {
|
|
35
|
+
componentName: this.el.tagName.toLowerCase(),
|
|
36
|
+
identifier: this.selectedRating
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
btnElement.dispatchEvent(event);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Handles the click event on a star.
|
|
43
|
+
* @param rating - The selected rating value.
|
|
44
|
+
*/
|
|
45
|
+
handleClick(rating) {
|
|
46
|
+
this.selectedRating = rating;
|
|
47
|
+
this.rating.emit(rating);
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
return h("div", {
|
|
51
|
+
key: 'd1650c37f02bf467f888d0afd0a025198bc0eedc',
|
|
52
|
+
role: "radiogroup",
|
|
53
|
+
class: "stars flex space-x-1 my-8"
|
|
54
|
+
}, Array.from({
|
|
55
|
+
length: this.ratingCount
|
|
56
|
+
}, (_, index) => {
|
|
57
|
+
const starRating = index + 1;
|
|
58
|
+
const isSelected = starRating <= this.selectedRating;
|
|
59
|
+
// Use the mapping text if available; otherwise, fall back to a generic label.
|
|
60
|
+
return h("eds-button", {
|
|
61
|
+
icon: this.ratingType,
|
|
62
|
+
role: "radio",
|
|
63
|
+
"aria-checked": isSelected ? 'true' : 'false',
|
|
64
|
+
"aria-label": this.ratingType,
|
|
65
|
+
onClick: () => this.handleClick(starRating),
|
|
66
|
+
tabIndex: this.selectedRating === 0 && index === 0 ? 0 : isSelected ? 0 : -1,
|
|
67
|
+
intent: isSelected ? 'primary' : 'ghost',
|
|
68
|
+
size: "large",
|
|
69
|
+
"extra-class": "p-2" // Optional padding or styling for the star button
|
|
70
|
+
});
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
get el() {
|
|
74
|
+
return getElement(this);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
EdsRating.style = EdsRatingStyle0;
|
|
78
|
+
|
|
79
|
+
export { EdsRating as eds_rating };
|
|
@@ -0,0 +1,69 @@
|
|
|
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 edsSectionCoreCss = "";
|
|
7
|
+
const EdsSectionCoreStyle0 = edsSectionCoreCss;
|
|
8
|
+
const EdsSectionCore = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.tag = 'section';
|
|
12
|
+
this.sectionTitle = '';
|
|
13
|
+
this.headingLevel = 'h2';
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
const TagType = this.tag; // Set dynamic tag type (div or section)
|
|
17
|
+
return h(TagType, {
|
|
18
|
+
key: 'f07162204271dca0f1ec8a3d309ab9d38a9fff4f'
|
|
19
|
+
}, h("eds-section-heading", {
|
|
20
|
+
key: 'c4db2a67151fcec22306f624b071725518292e65',
|
|
21
|
+
headingLevel: this.headingLevel,
|
|
22
|
+
sectionTitle: this.sectionTitle
|
|
23
|
+
}), h("slot", {
|
|
24
|
+
key: 'e610f4777f1b334e20482862504085f5317a63df'
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
EdsSectionCore.style = EdsSectionCoreStyle0;
|
|
29
|
+
const EdsSectionHeading = class {
|
|
30
|
+
constructor(hostRef) {
|
|
31
|
+
registerInstance(this, hostRef);
|
|
32
|
+
this.sectionTitle = undefined;
|
|
33
|
+
this.withContainer = true;
|
|
34
|
+
this.headingLevel = 'h2';
|
|
35
|
+
this.tag = 'div';
|
|
36
|
+
this.spacingLarge = false;
|
|
37
|
+
}
|
|
38
|
+
getHeadingClass() {
|
|
39
|
+
// Map heading levels to their respective classes
|
|
40
|
+
const headingClasses = {
|
|
41
|
+
h1: 'f-heading-01',
|
|
42
|
+
h2: 'f-heading-02',
|
|
43
|
+
h3: 'f-heading-03',
|
|
44
|
+
h4: 'f-heading-04',
|
|
45
|
+
h5: 'f-heading-05',
|
|
46
|
+
h6: 'f-heading-06'
|
|
47
|
+
};
|
|
48
|
+
// Return the class based on the heading level
|
|
49
|
+
return headingClasses[this.headingLevel];
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
const TagType = this.tag; // Dynamically set tag type for the container
|
|
53
|
+
const HeadingTag = this.headingLevel; // Dynamically set heading level
|
|
54
|
+
return h(TagType, {
|
|
55
|
+
key: 'efa6dd7e228db2b86961efdff9b5dd9729a1a24b',
|
|
56
|
+
class: {
|
|
57
|
+
'ui-section-header flex flex-wrap items-center justify-between gap-x-12 gap-y-8': true,
|
|
58
|
+
container: this.withContainer,
|
|
59
|
+
'pt-48': this.spacingLarge,
|
|
60
|
+
'pt-28': !this.spacingLarge
|
|
61
|
+
}
|
|
62
|
+
}, h(HeadingTag, {
|
|
63
|
+
key: 'dd50f0fe3baf084c71dc4c8fa745484645a58f76',
|
|
64
|
+
class: this.getHeadingClass()
|
|
65
|
+
}, this.sectionTitle));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export { EdsSectionCore as eds_section_core, EdsSectionHeading as eds_section_heading };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index.esm2.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react-dom';
|
|
5
|
+
|
|
6
|
+
const edsSpinnerCss = ":host{display:block}.spinner{box-sizing:border-box;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}";
|
|
7
|
+
const EdsSpinnerStyle0 = edsSpinnerCss;
|
|
8
|
+
const EdsSpinner = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.size = '1rem';
|
|
12
|
+
this.thickness = '10px';
|
|
13
|
+
this.borderColor = 'var(--grey-400)';
|
|
14
|
+
this.bottomColor = 'var(--grey-900)';
|
|
15
|
+
this.background = 'var(--grey-200)';
|
|
16
|
+
this.fullscreen = false;
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
const spinnerStyle = Object.assign({
|
|
20
|
+
width: this.size,
|
|
21
|
+
height: this.size,
|
|
22
|
+
border: `${this.thickness} solid ${this.borderColor}`,
|
|
23
|
+
borderBottomColor: this.bottomColor
|
|
24
|
+
}, !this.fullscreen && {
|
|
25
|
+
display: 'inline-block'
|
|
26
|
+
});
|
|
27
|
+
// Overlay style: use fixed positioning for fullscreen,
|
|
28
|
+
// and absolute positioning for inline mode.
|
|
29
|
+
const overlayStyle = this.fullscreen ? {
|
|
30
|
+
position: 'fixed',
|
|
31
|
+
top: '0',
|
|
32
|
+
left: '0',
|
|
33
|
+
width: '100vw',
|
|
34
|
+
height: '100vh',
|
|
35
|
+
zIndex: '9999999',
|
|
36
|
+
backgroundColor: this.background,
|
|
37
|
+
display: 'flex',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
justifyContent: 'center'
|
|
40
|
+
} : {
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
top: '0',
|
|
43
|
+
left: '0',
|
|
44
|
+
width: '100%',
|
|
45
|
+
height: '100%',
|
|
46
|
+
zIndex: '1000',
|
|
47
|
+
backgroundColor: this.background,
|
|
48
|
+
display: 'flex',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
justifyContent: 'center'
|
|
51
|
+
};
|
|
52
|
+
return h(Host, {
|
|
53
|
+
key: '77f17386e37b3dae21c2893dab53ef046d74b8fb'
|
|
54
|
+
}, h("div", {
|
|
55
|
+
key: 'c9420f866d61331901df7d6d681d09f75e31846c',
|
|
56
|
+
class: "spinner-overlay",
|
|
57
|
+
style: overlayStyle
|
|
58
|
+
}, h("span", {
|
|
59
|
+
key: '83497de6228b75fad77225a1b6fee9a614d68fe4',
|
|
60
|
+
class: "spinner",
|
|
61
|
+
style: spinnerStyle
|
|
62
|
+
})));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
EdsSpinner.style = EdsSpinnerStyle0;
|
|
66
|
+
|
|
67
|
+
export { EdsSpinner as eds_spinner };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index.esm2.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react-dom';
|
|
5
|
+
|
|
6
|
+
const edsSwitchCss = ":host{display:inline-block}.switch-container{display:inline-flex;align-items:center}.switch-label{font-size:14px;margin:0 8px}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)}";
|
|
7
|
+
const EdsSwitchStyle0 = edsSwitchCss;
|
|
8
|
+
const EdsSwitch = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.toggle = createEvent(this, "toggle", 7);
|
|
12
|
+
this.toggleSwitch = () => {
|
|
13
|
+
if (this.disabled) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
this.checked = !this.checked;
|
|
17
|
+
this.toggle.emit(this.checked);
|
|
18
|
+
};
|
|
19
|
+
this.checked = false;
|
|
20
|
+
this.disabled = false;
|
|
21
|
+
this.labelOn = '';
|
|
22
|
+
this.labelOff = '';
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
// Compute an accessible name based on state.
|
|
26
|
+
const accessibleLabel = this.labelOn || this.labelOff ? this.checked ? this.labelOn : this.labelOff : 'Toggle switch';
|
|
27
|
+
return h("div", {
|
|
28
|
+
key: 'ef70db7a5ed4f8e8db7e1a9e94334a3686ec1d0e',
|
|
29
|
+
class: "switch-container"
|
|
30
|
+
}, this.labelOff && h("span", {
|
|
31
|
+
key: '4a18de129ba0b4e643a0929b6fc797b7bc35cb4c',
|
|
32
|
+
class: "switch-label switch-label--off"
|
|
33
|
+
}, this.labelOff), h("button", {
|
|
34
|
+
key: '2d75656fadf36a38269d361fef176e243e1291c2',
|
|
35
|
+
type: "button",
|
|
36
|
+
role: "switch",
|
|
37
|
+
"aria-checked": this.checked ? 'true' : 'false',
|
|
38
|
+
"aria-disabled": this.disabled ? 'true' : 'false',
|
|
39
|
+
"aria-label": accessibleLabel,
|
|
40
|
+
class: {
|
|
41
|
+
switch: true,
|
|
42
|
+
'switch--checked': this.checked,
|
|
43
|
+
'switch--disabled': this.disabled
|
|
44
|
+
},
|
|
45
|
+
onClick: this.toggleSwitch,
|
|
46
|
+
disabled: this.disabled
|
|
47
|
+
}, h("span", {
|
|
48
|
+
key: '71bd3c8c042ac337c1392977c27e8f4ccde5e79f',
|
|
49
|
+
class: "switch-handle"
|
|
50
|
+
})), this.labelOn && h("span", {
|
|
51
|
+
key: '7cfa0b1f805271c9281853a872cedf93db7e07d8',
|
|
52
|
+
class: "switch-label switch-label--on"
|
|
53
|
+
}, this.labelOn));
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
EdsSwitch.style = EdsSwitchStyle0;
|
|
57
|
+
|
|
58
|
+
export { EdsSwitch as eds_switch };
|