@ebrains/components 1.3.0 → 1.4.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 (38) hide show
  1. package/dist/cjs/components.cjs.js +1 -1
  2. package/dist/cjs/{eds-avatar_28.cjs.entry.js → eds-avatar_29.cjs.entry.js} +172 -53
  3. package/dist/cjs/index-88c8039f.js +2 -6
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/collection/components/eds-input-elements/eds-input/eds-input.js +62 -2
  6. package/dist/collection/components/eds-input-field/eds-input-field.js +100 -26
  7. package/dist/collection/components/eds-input-field/eds-input-field.stories.js +19 -1
  8. package/dist/collection/components/eds-table/eds-table.js +7 -12
  9. package/dist/collection/components/eds-toast/eds-toast.js +20 -1
  10. package/dist/collection/shared-ui/eds-form/eds-form.js +20 -14
  11. package/dist/collection/utils/eds-form/formValidators.js +1 -1
  12. package/dist/collection/utils/eds-form/individualValidator.js +15 -1
  13. package/dist/collection/utils/eds-form/validateInput.js +1 -1
  14. package/dist/components/components.esm.js +1 -1
  15. package/dist/components/eds-form.js +37 -17
  16. package/dist/components/eds-input-field2.js +48 -22
  17. package/dist/components/eds-input2.js +14 -2
  18. package/dist/components/eds-table2.js +7 -12
  19. package/dist/components/eds-toast2.js +4 -2
  20. package/dist/components/p-b998223d.entry.js +1 -0
  21. package/dist/esm/components.js +1 -1
  22. package/dist/esm/{eds-avatar_28.entry.js → eds-avatar_29.entry.js} +172 -54
  23. package/dist/esm/index-fdb33359.js +2 -6
  24. package/dist/esm/loader.js +1 -1
  25. package/dist/hydrate/index.js +109 -54
  26. package/dist/hydrate/index.mjs +109 -54
  27. package/dist/stencil.config.js +7 -1
  28. package/dist/types/components/eds-input-elements/eds-input/eds-input.d.ts +3 -0
  29. package/dist/types/components/eds-input-field/eds-input-field.d.ts +8 -2
  30. package/dist/types/components/eds-input-field/eds-input-field.stories.d.ts +12 -0
  31. package/dist/types/components/eds-toast/eds-toast.d.ts +5 -0
  32. package/dist/types/components.d.ts +50 -4
  33. package/dist/types/utils/eds-form/individualValidator.d.ts +1 -1
  34. package/package.json +1 -1
  35. package/dist/cjs/eds-toast.cjs.entry.js +0 -77
  36. package/dist/components/p-326d9e55.entry.js +0 -1
  37. package/dist/components/p-4ffdf8ac.entry.js +0 -1
  38. package/dist/esm/eds-toast.entry.js +0 -73
@@ -1,77 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-88c8039f.js');
6
- const index$1 = require('./index-ab9fbefe.js');
7
-
8
- const edsToastCss = ".relative{position:relative}.right-4{right:0.25rem}.bottom-4{bottom:0.25rem}.w-auto{width:auto}.flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:0.25rem}.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)}.ml-8{margin-left:0.5rem}.p-12{padding:0.75rem}.rounded-lg{border-radius:16px}.shadow-md{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),\n 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.bg-dark{background-color:var(--grey-300)}.bg-success{background-color:var(--green-200)}.bg-error{background-color:var(--red-200)}.bg-warning{background-color:var(--yellow-200)}.text-light{color:var(--grey-700)}.text-current{color:currentColor}.text-default{color:var(--black)}";
9
- const EdsToastStyle0 = edsToastCss;
10
-
11
- const toastStyles = index$1.cva(['relative right-4 bottom-4 w-auto p-12 rounded-lg shadow-md'], {
12
- variants: {
13
- intent: {
14
- default: 'bg-dark text-light',
15
- success: 'bg-success text-dark',
16
- error: 'bg-error text-light',
17
- warning: 'bg-warning text-dark'
18
- }
19
- },
20
- defaultVariants: {
21
- intent: 'default'
22
- }
23
- });
24
- const EdsToast = class {
25
- constructor(hostRef) {
26
- index.registerInstance(this, hostRef);
27
- /**
28
- * Dismisses the toast.
29
- */
30
- this.dismissToast = () => {
31
- this.visible = false;
32
- };
33
- this.message = undefined;
34
- this.intent = 'default';
35
- this.duration = undefined;
36
- this.visible = true;
37
- }
38
- componentDidLoad() {
39
- const btn = this.el.shadowRoot.querySelector('eds-button');
40
- this.emitContext(btn);
41
- }
42
- /**
43
- * Emits a custom event called `parentContext` for a given button element.
44
- * This event provides context information about the toast component.
45
- *
46
- * @param btnElement - The link element to which the event will be dispatched.
47
- */
48
- emitContext(btnElement) {
49
- const event = new CustomEvent('parentContext', {
50
- detail: {
51
- componentName: this.el.tagName.toLowerCase(),
52
- identifier: null
53
- }
54
- });
55
- btnElement.dispatchEvent(event);
56
- }
57
- connectedCallback() {
58
- if (this.duration && this.duration > 0) {
59
- this.dismissTimeout = setTimeout(this.dismissToast, this.duration);
60
- }
61
- }
62
- disconnectedCallback() {
63
- // Clear the timeout when the component is removed
64
- clearTimeout(this.dismissTimeout);
65
- }
66
- render() {
67
- if (!this.visible) {
68
- return null;
69
- }
70
- const classes = toastStyles({ intent: this.intent });
71
- return (index.h("div", { class: classes, role: "alert", "aria-live": "assertive" }, index.h("div", { class: "flex items-center justify-between gap-4" }, index.h("span", { class: "f-ui-01" }, this.message), index.h("eds-button", { intent: "tertiary", icon: "close", "aria-label": "Close Toast", onClick: () => this.dismissToast(), "extra-class": "ml-8" }))));
72
- }
73
- get el() { return index.getElement(this); }
74
- };
75
- EdsToast.style = EdsToastStyle0;
76
-
77
- exports.eds_toast = EdsToast;
@@ -1 +0,0 @@
1
- import{r as t,h as e,g as r}from"./p-28ae3f3a.js";import{c as i}from"./p-112122d6.js";const a=i(["relative right-4 bottom-4 w-auto p-12 rounded-lg shadow-md"],{variants:{intent:{default:"bg-dark text-light",success:"bg-success text-dark",error:"bg-error text-light",warning:"bg-warning text-dark"}},defaultVariants:{intent:"default"}}),o=class{constructor(e){t(this,e),this.dismissToast=()=>{this.visible=!1},this.message=void 0,this.intent="default",this.duration=void 0,this.visible=!0}componentDidLoad(){const t=this.el.shadowRoot.querySelector("eds-button");this.emitContext(t)}emitContext(t){const e=new CustomEvent("parentContext",{detail:{componentName:this.el.tagName.toLowerCase(),identifier:null}});t.dispatchEvent(e)}connectedCallback(){this.duration&&this.duration>0&&(this.dismissTimeout=setTimeout(this.dismissToast,this.duration))}disconnectedCallback(){clearTimeout(this.dismissTimeout)}render(){if(!this.visible)return null;const t=a({intent:this.intent});return e("div",{class:t,role:"alert","aria-live":"assertive"},e("div",{class:"flex items-center justify-between gap-4"},e("span",{class:"f-ui-01"},this.message),e("eds-button",{intent:"tertiary",icon:"close","aria-label":"Close Toast",onClick:()=>this.dismissToast(),"extra-class":"ml-8"})))}get el(){return r(this)}};o.style=".relative{position:relative}.right-4{right:0.25rem}.bottom-4{bottom:0.25rem}.w-auto{width:auto}.flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:0.25rem}.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)}.ml-8{margin-left:0.5rem}.p-12{padding:0.75rem}.rounded-lg{border-radius:16px}.shadow-md{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),\n 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.bg-dark{background-color:var(--grey-300)}.bg-success{background-color:var(--green-200)}.bg-error{background-color:var(--red-200)}.bg-warning{background-color:var(--yellow-200)}.text-light{color:var(--grey-700)}.text-current{color:currentColor}.text-default{color:var(--black)}";export{o as eds_toast}