@elenajs/elements 0.0.2
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/LICENSE +21 -0
- package/dist/button.css +77 -0
- package/dist/button.js +11 -0
- package/dist/button.js.map +1 -0
- package/dist/custom-elements.d.ts +156 -0
- package/dist/custom-elements.json +485 -0
- package/dist/elena-f59Xc5oc.js +2 -0
- package/dist/elena-f59Xc5oc.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/input.css +101 -0
- package/dist/input.js +19 -0
- package/dist/input.js.map +1 -0
- package/dist/stack.css +14 -0
- package/dist/stack.js +2 -0
- package/dist/stack.js.map +1 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ariel Salminen https://arielsalminen.com
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/button.css
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/* ---------------------------------------------
|
|
2
|
+
/ ELENA BUTTON
|
|
3
|
+
/ --------------------------------------------- */
|
|
4
|
+
|
|
5
|
+
elena-button {
|
|
6
|
+
/* Public CSS Custom Properties */
|
|
7
|
+
--elena-button-bg: transparent;
|
|
8
|
+
--elena-button-text: #333;
|
|
9
|
+
--elena-button-border: #f19c77;
|
|
10
|
+
--elena-button-radius: 10rem;
|
|
11
|
+
--elena-button-font: sans-serif;
|
|
12
|
+
|
|
13
|
+
all: unset;
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* For overall visual styles, we want to target both
|
|
19
|
+
* non-hydrated element and the internal button element
|
|
20
|
+
* with the same styles. This way the element will look
|
|
21
|
+
* the same before & after client side hydration.
|
|
22
|
+
*/
|
|
23
|
+
:is(elena-button:not(.elena-hydrated), .elena-button) {
|
|
24
|
+
all: unset;
|
|
25
|
+
-webkit-appearance: none;
|
|
26
|
+
appearance: none;
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
-webkit-user-select: none;
|
|
29
|
+
user-select: none;
|
|
30
|
+
background: var(--elena-button-bg);
|
|
31
|
+
color: var(--elena-button-text);
|
|
32
|
+
border-radius: var(--elena-button-radius);
|
|
33
|
+
border: 2px solid var(--elena-button-border);
|
|
34
|
+
font-family: var(--elena-button-font);
|
|
35
|
+
font-weight: 700;
|
|
36
|
+
padding: 0.75rem 1.25rem;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ---------------------------------------------
|
|
41
|
+
/ EXAMPLE STATES
|
|
42
|
+
/ --------------------------------------------- */
|
|
43
|
+
|
|
44
|
+
elena-button:hover {
|
|
45
|
+
opacity: 0.8;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
elena-button:active {
|
|
49
|
+
opacity: 0.6;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
elena-button:focus-within {
|
|
53
|
+
box-shadow: 0 0 0 3px red;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
elena-button[disabled] {
|
|
57
|
+
--elena-button-bg: #2b1c15;
|
|
58
|
+
--elena-button-text: #fff;
|
|
59
|
+
--elena-button-border: #2b1c15;
|
|
60
|
+
|
|
61
|
+
opacity: 0.3;
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ---------------------------------------------
|
|
66
|
+
/ EXAMPLE VARIANTS
|
|
67
|
+
/ --------------------------------------------- */
|
|
68
|
+
|
|
69
|
+
elena-button[variant="primary"] {
|
|
70
|
+
--elena-button-bg: #f19c77;
|
|
71
|
+
--elena-button-text: #2b1c15;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
elena-button[variant="danger"] {
|
|
75
|
+
--elena-button-text: red;
|
|
76
|
+
--elena-button-border: red;
|
|
77
|
+
}
|
package/dist/button.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{l as t,n as e}from"./elena-f59Xc5oc.js";const s={props:["variant","size","disabled","name","value","type"],events:["click","focus","blur"],element:".elena-button"};class a extends(t(HTMLElement,s)){constructor(){super(),this.variant="default",this.size="md",this.disabled=!1,this.name="",this.value="",this.type="button"}render(){const t=this.textContent.trim();this.template`
|
|
2
|
+
<button
|
|
3
|
+
class="elena-button"
|
|
4
|
+
type="${this.type||"button"}"
|
|
5
|
+
${this.name?`name="${this.name}"`:""}
|
|
6
|
+
${this.value?`value="${this.value}"`:""}
|
|
7
|
+
${this.disabled?"disabled":""}>
|
|
8
|
+
${t}
|
|
9
|
+
</button>
|
|
10
|
+
`}}e("elena-button",a);export{a as default};
|
|
11
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../src/button/button.js"],"sourcesContent":["import { Elena, defineElement } from \"@elenajs/core\";\n\nconst options = {\n props: [\"variant\", \"size\", \"disabled\", \"name\", \"value\", \"type\"],\n events: [\"click\", \"focus\", \"blur\"],\n element: \".elena-button\",\n};\n\n/**\n * The description of the component goes here.\n *\n * @displayName Button\n * @status alpha\n *\n * @event click - Programmatically fire click on the component.\n * @event focus - Programmatically move focus to the component.\n * @event blur - Programmatically remove focus from the component.\n *\n * @cssprop [--elena-button-color-text] - Controls the color of the text.\n * @cssprop [--elena-button-color-bg] - Controls the color of the background.\n * @cssprop [--elena-button-color-border] - Controls the color of the border.\n * @cssprop [--elena-button-radius] - Controls the radius of the component.\n */\nexport default class Button extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The style variant of the button.\n *\n * @attribute\n * @type {(\"default\" | \"primary\" | \"danger\")}\n */\n this.variant = \"default\";\n\n /**\n * The size of the button.\n *\n * @attribute\n * @type {(\"sm\" | \"md\" | \"lg\")}\n */\n this.size = \"md\";\n\n /**\n * Makes the component disabled.\n *\n * @attribute\n * @type {Boolean}\n */\n this.disabled = false;\n\n /**\n * The name used to identify the button in forms.\n *\n * @attribute\n * @type {string}\n */\n this.name = \"\";\n\n /**\n * The value used to identify the button in forms.\n *\n * @attribute\n * @type {string}\n */\n this.value = \"\";\n\n /**\n * The type of the button.\n *\n * @attribute\n * @type {(\"submit\" | \"reset\" | \"button\")}\n */\n this.type = \"button\";\n }\n\n /**\n * Renders the custom element template.\n *\n * @internal\n */\n render() {\n const slottedContent = this.textContent.trim();\n\n this.template`\n <button\n class=\"elena-button\"\n type=\"${this.type || \"button\"}\"\n ${this.name ? `name=\"${this.name}\"` : \"\"}\n ${this.value ? `value=\"${this.value}\"` : \"\"}\n ${this.disabled ? \"disabled\" : \"\"}>\n ${slottedContent}\n </button>\n `;\n }\n}\n\n/**\n * Register the custom element\n */\ndefineElement(\"elena-button\", Button);\n"],"names":["options","props","events","element","Button","Elena","HTMLElement","constructor","super","this","variant","size","disabled","name","value","type","render","slottedContent","textContent","trim","template","defineElement"],"mappings":"+CAEA,MAAMA,EAAU,CACdC,MAAO,CAAC,UAAW,OAAQ,WAAY,OAAQ,QAAS,QACxDC,OAAQ,CAAC,QAAS,QAAS,QAC3BC,QAAS,iBAkBI,MAAMC,UAAeC,EAAMC,YAAaN,IACrD,WAAAO,GACEC,QAQAC,KAAKC,QAAU,UAQfD,KAAKE,KAAO,KAQZF,KAAKG,UAAW,EAQhBH,KAAKI,KAAO,GAQZJ,KAAKK,MAAQ,GAQbL,KAAKM,KAAO,QACd,CAOA,MAAAC,GACE,MAAMC,EAAiBR,KAAKS,YAAYC,OAExCV,KAAKW,QAAQ;;;gBAGDX,KAAKM,MAAQ;UACnBN,KAAKI,KAAO,SAASJ,KAAKI,QAAU;UACpCJ,KAAKK,MAAQ,UAAUL,KAAKK,SAAW;UACvCL,KAAKG,SAAW,WAAa;YAC3BK;;KAGV,EAMFI,EAAc,eAAgBjB"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This type can be used to create scoped tags for your components.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { ScopedElements } from "path/to/library/jsx-integration";
|
|
8
|
+
*
|
|
9
|
+
* declare module "my-library" {
|
|
10
|
+
* namespace JSX {
|
|
11
|
+
* interface IntrinsicElements
|
|
12
|
+
* extends ScopedElements<'test-', ''> {}
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export type ScopedElements<Prefix extends string = "", Suffix extends string = ""> = {
|
|
19
|
+
[Key in keyof CustomElements as `${Prefix}${Key}${Suffix}`]: CustomElements[Key];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type BaseProps = {
|
|
23
|
+
/** Content added between the opening and closing tags of the element */
|
|
24
|
+
children?: any;
|
|
25
|
+
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
|
|
26
|
+
class?: string;
|
|
27
|
+
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Takes an object where the key is the class name(s) and the value is a boolean expression. When true, the class is applied, and when false, it is removed. */
|
|
30
|
+
classList?: Record<string, boolean | undefined>;
|
|
31
|
+
/** Specifies the text direction of the element. */
|
|
32
|
+
dir?: "ltr" | "rtl";
|
|
33
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
34
|
+
exportparts?: string;
|
|
35
|
+
/** For <label> and <output>, lets you associate the label with some control. */
|
|
36
|
+
htmlFor?: string;
|
|
37
|
+
/** Specifies whether the element should be hidden. */
|
|
38
|
+
hidden?: boolean | string;
|
|
39
|
+
/** A unique identifier for the element. */
|
|
40
|
+
id?: string;
|
|
41
|
+
/** Keys tell React which array item each component corresponds to */
|
|
42
|
+
key?: string | number;
|
|
43
|
+
/** Specifies the language of the element. */
|
|
44
|
+
lang?: string;
|
|
45
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
46
|
+
part?: string;
|
|
47
|
+
/** Use the ref attribute with a variable to assign a DOM element to the variable once the element is rendered. */
|
|
48
|
+
ref?: unknown | ((e: unknown) => void);
|
|
49
|
+
/** Adds a reference for a custom element slot */
|
|
50
|
+
slot?: string;
|
|
51
|
+
/** Prop for setting inline styles */
|
|
52
|
+
style?: Record<string, string | number>;
|
|
53
|
+
/** Overrides the default Tab button behavior. Avoid using values other than -1 and 0. */
|
|
54
|
+
tabIndex?: number;
|
|
55
|
+
/** Specifies the tooltip text for the element. */
|
|
56
|
+
title?: string;
|
|
57
|
+
/** Passing 'no' excludes the element content from being translated. */
|
|
58
|
+
translate?: "yes" | "no";
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
type BaseEvents = {};
|
|
62
|
+
|
|
63
|
+
export type ButtonProps = {
|
|
64
|
+
/** The style variant of the button. */
|
|
65
|
+
variant?: "default" | "primary" | "danger";
|
|
66
|
+
/** The size of the button. */
|
|
67
|
+
size?: "sm" | "md" | "lg";
|
|
68
|
+
/** Makes the component disabled. */
|
|
69
|
+
disabled?: Boolean;
|
|
70
|
+
/** The name used to identify the button in forms. */
|
|
71
|
+
name?: string;
|
|
72
|
+
/** The value used to identify the button in forms. */
|
|
73
|
+
value?: string;
|
|
74
|
+
/** The type of the button. */
|
|
75
|
+
type?: "submit" | "reset" | "button";
|
|
76
|
+
|
|
77
|
+
/** Programmatically fire click on the component. */
|
|
78
|
+
onclick?: (e: CustomEvent<never>) => void;
|
|
79
|
+
/** Programmatically move focus to the component. */
|
|
80
|
+
onfocus?: (e: CustomEvent<never>) => void;
|
|
81
|
+
/** Programmatically remove focus from the component. */
|
|
82
|
+
onblur?: (e: CustomEvent<never>) => void;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type InputProps = {
|
|
86
|
+
/** The size of the input. */
|
|
87
|
+
size?: "sm" | "md" | "lg";
|
|
88
|
+
/** Makes the component disabled. */
|
|
89
|
+
disabled?: Boolean;
|
|
90
|
+
/** The name used to identify the input in forms. */
|
|
91
|
+
name?: string;
|
|
92
|
+
/** The label for the input */
|
|
93
|
+
label?: string;
|
|
94
|
+
/** The value used to identify the input in forms. */
|
|
95
|
+
value?: string;
|
|
96
|
+
/** The placeholder text for the input. */
|
|
97
|
+
placeholder?: string;
|
|
98
|
+
/** The type of the input */
|
|
99
|
+
type?: "text" | "email" | "password" | "tel" | "url" | "search" | "number" | "unit" | "button";
|
|
100
|
+
/** The error to display */
|
|
101
|
+
error?: string;
|
|
102
|
+
|
|
103
|
+
/** Programmatically fire click on the component. */
|
|
104
|
+
onclick?: (e: CustomEvent<never>) => void;
|
|
105
|
+
/** Programmatically move focus to the component. */
|
|
106
|
+
onfocus?: (e: CustomEvent<never>) => void;
|
|
107
|
+
/** Programmatically remove focus from the component. */
|
|
108
|
+
onblur?: (e: CustomEvent<never>) => void;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export type StackProps = {};
|
|
112
|
+
|
|
113
|
+
export type CustomElements = {
|
|
114
|
+
/**
|
|
115
|
+
* The description of the component goes here.
|
|
116
|
+
* ---
|
|
117
|
+
*
|
|
118
|
+
*
|
|
119
|
+
* ### **Events:**
|
|
120
|
+
* - **click** - Programmatically fire click on the component.
|
|
121
|
+
* - **focus** - Programmatically move focus to the component.
|
|
122
|
+
* - **blur** - Programmatically remove focus from the component.
|
|
123
|
+
*
|
|
124
|
+
* ### **CSS Properties:**
|
|
125
|
+
* - **--elena-button-color-text** - Controls the color of the text. _(default: undefined)_
|
|
126
|
+
* - **--elena-button-color-bg** - Controls the color of the background. _(default: undefined)_
|
|
127
|
+
* - **--elena-button-color-border** - Controls the color of the border. _(default: undefined)_
|
|
128
|
+
* - **--elena-button-radius** - Controls the radius of the component. _(default: undefined)_
|
|
129
|
+
*/
|
|
130
|
+
"elena-button": Partial<ButtonProps & BaseProps & BaseEvents>;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The description of the component goes here.
|
|
134
|
+
* ---
|
|
135
|
+
*
|
|
136
|
+
*
|
|
137
|
+
* ### **Events:**
|
|
138
|
+
* - **click** - Programmatically fire click on the component.
|
|
139
|
+
* - **focus** - Programmatically move focus to the component.
|
|
140
|
+
* - **blur** - Programmatically remove focus from the component.
|
|
141
|
+
*
|
|
142
|
+
* ### **CSS Properties:**
|
|
143
|
+
* - **--elena-input-color-text** - Controls the color of the text. _(default: undefined)_
|
|
144
|
+
* - **--elena-input-color-bg** - Controls the color of the background. _(default: undefined)_
|
|
145
|
+
* - **--elena-input-color-border** - Controls the color of the border. _(default: undefined)_
|
|
146
|
+
* - **--elena-input-radius** - Controls the radius of the component. _(default: undefined)_
|
|
147
|
+
*/
|
|
148
|
+
"elena-input": Partial<InputProps & BaseProps & BaseEvents>;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The description of the component goes here.
|
|
152
|
+
* ---
|
|
153
|
+
*
|
|
154
|
+
*/
|
|
155
|
+
"elena-stack": Partial<StackProps & BaseProps & BaseEvents>;
|
|
156
|
+
};
|
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/index.js",
|
|
8
|
+
"declarations": [],
|
|
9
|
+
"exports": [
|
|
10
|
+
{
|
|
11
|
+
"kind": "js",
|
|
12
|
+
"name": "Button",
|
|
13
|
+
"declaration": {
|
|
14
|
+
"name": "default",
|
|
15
|
+
"module": "./button/button.js"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"kind": "javascript-module",
|
|
22
|
+
"path": "src/button/button.js",
|
|
23
|
+
"declarations": [
|
|
24
|
+
{
|
|
25
|
+
"kind": "class",
|
|
26
|
+
"description": "The description of the component goes here.",
|
|
27
|
+
"name": "Button",
|
|
28
|
+
"cssProperties": [
|
|
29
|
+
{
|
|
30
|
+
"description": "Controls the color of the text.",
|
|
31
|
+
"name": "--elena-button-color-text"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"description": "Controls the color of the background.",
|
|
35
|
+
"name": "--elena-button-color-bg"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"description": "Controls the color of the border.",
|
|
39
|
+
"name": "--elena-button-color-border"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"description": "Controls the radius of the component.",
|
|
43
|
+
"name": "--elena-button-radius"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"members": [
|
|
47
|
+
{
|
|
48
|
+
"kind": "field",
|
|
49
|
+
"name": "variant",
|
|
50
|
+
"type": {
|
|
51
|
+
"text": "(\"default\" | \"primary\" | \"danger\")"
|
|
52
|
+
},
|
|
53
|
+
"description": "The style variant of the button.",
|
|
54
|
+
"default": "\"default\"",
|
|
55
|
+
"attribute": "variant"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"kind": "field",
|
|
59
|
+
"name": "size",
|
|
60
|
+
"type": {
|
|
61
|
+
"text": "(\"sm\" | \"md\" | \"lg\")"
|
|
62
|
+
},
|
|
63
|
+
"description": "The size of the button.",
|
|
64
|
+
"default": "\"md\"",
|
|
65
|
+
"attribute": "size"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"kind": "field",
|
|
69
|
+
"name": "disabled",
|
|
70
|
+
"type": {
|
|
71
|
+
"text": "Boolean"
|
|
72
|
+
},
|
|
73
|
+
"description": "Makes the component disabled.",
|
|
74
|
+
"default": "false",
|
|
75
|
+
"attribute": "disabled"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"kind": "field",
|
|
79
|
+
"name": "name",
|
|
80
|
+
"type": {
|
|
81
|
+
"text": "string"
|
|
82
|
+
},
|
|
83
|
+
"description": "The name used to identify the button in forms.",
|
|
84
|
+
"default": "\"\"",
|
|
85
|
+
"attribute": "name"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"kind": "field",
|
|
89
|
+
"name": "value",
|
|
90
|
+
"type": {
|
|
91
|
+
"text": "string"
|
|
92
|
+
},
|
|
93
|
+
"description": "The value used to identify the button in forms.",
|
|
94
|
+
"default": "\"\"",
|
|
95
|
+
"attribute": "value"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"kind": "field",
|
|
99
|
+
"name": "type",
|
|
100
|
+
"type": {
|
|
101
|
+
"text": "(\"submit\" | \"reset\" | \"button\")"
|
|
102
|
+
},
|
|
103
|
+
"description": "The type of the button.",
|
|
104
|
+
"default": "\"button\"",
|
|
105
|
+
"attribute": "type"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"events": [
|
|
109
|
+
{
|
|
110
|
+
"description": "Programmatically fire click on the component.",
|
|
111
|
+
"name": "click"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"description": "Programmatically move focus to the component.",
|
|
115
|
+
"name": "focus"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"description": "Programmatically remove focus from the component.",
|
|
119
|
+
"name": "blur"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"attributes": [
|
|
123
|
+
{
|
|
124
|
+
"name": "variant",
|
|
125
|
+
"type": {
|
|
126
|
+
"text": "(\"default\" | \"primary\" | \"danger\")"
|
|
127
|
+
},
|
|
128
|
+
"description": "The style variant of the button.",
|
|
129
|
+
"default": "\"default\"",
|
|
130
|
+
"fieldName": "variant"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "size",
|
|
134
|
+
"type": {
|
|
135
|
+
"text": "(\"sm\" | \"md\" | \"lg\")"
|
|
136
|
+
},
|
|
137
|
+
"description": "The size of the button.",
|
|
138
|
+
"default": "\"md\"",
|
|
139
|
+
"fieldName": "size"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "disabled",
|
|
143
|
+
"type": {
|
|
144
|
+
"text": "Boolean"
|
|
145
|
+
},
|
|
146
|
+
"description": "Makes the component disabled.",
|
|
147
|
+
"default": "false",
|
|
148
|
+
"fieldName": "disabled"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "name",
|
|
152
|
+
"type": {
|
|
153
|
+
"text": "string"
|
|
154
|
+
},
|
|
155
|
+
"description": "The name used to identify the button in forms.",
|
|
156
|
+
"default": "\"\"",
|
|
157
|
+
"fieldName": "name"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"name": "value",
|
|
161
|
+
"type": {
|
|
162
|
+
"text": "string"
|
|
163
|
+
},
|
|
164
|
+
"description": "The value used to identify the button in forms.",
|
|
165
|
+
"default": "\"\"",
|
|
166
|
+
"fieldName": "value"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "type",
|
|
170
|
+
"type": {
|
|
171
|
+
"text": "(\"submit\" | \"reset\" | \"button\")"
|
|
172
|
+
},
|
|
173
|
+
"description": "The type of the button.",
|
|
174
|
+
"default": "\"button\"",
|
|
175
|
+
"fieldName": "type"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"mixins": [
|
|
179
|
+
{
|
|
180
|
+
"name": "Elena",
|
|
181
|
+
"package": "@elenajs/core"
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"superclass": {
|
|
185
|
+
"name": "HTMLElement"
|
|
186
|
+
},
|
|
187
|
+
"status": "alpha",
|
|
188
|
+
"displayName": "Button",
|
|
189
|
+
"tagName": "elena-button",
|
|
190
|
+
"customElement": true
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"exports": [
|
|
194
|
+
{
|
|
195
|
+
"kind": "js",
|
|
196
|
+
"name": "default",
|
|
197
|
+
"declaration": {
|
|
198
|
+
"name": "Button",
|
|
199
|
+
"module": "src/button/button.js"
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"kind": "custom-element-definition",
|
|
204
|
+
"name": "elena-button",
|
|
205
|
+
"declaration": {
|
|
206
|
+
"name": "Button",
|
|
207
|
+
"module": "src/button/button.js"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"kind": "javascript-module",
|
|
214
|
+
"path": "src/input/input.js",
|
|
215
|
+
"declarations": [
|
|
216
|
+
{
|
|
217
|
+
"kind": "class",
|
|
218
|
+
"description": "The description of the component goes here.",
|
|
219
|
+
"name": "Input",
|
|
220
|
+
"cssProperties": [
|
|
221
|
+
{
|
|
222
|
+
"description": "Controls the color of the text.",
|
|
223
|
+
"name": "--elena-input-color-text"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"description": "Controls the color of the background.",
|
|
227
|
+
"name": "--elena-input-color-bg"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"description": "Controls the color of the border.",
|
|
231
|
+
"name": "--elena-input-color-border"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"description": "Controls the radius of the component.",
|
|
235
|
+
"name": "--elena-input-radius"
|
|
236
|
+
}
|
|
237
|
+
],
|
|
238
|
+
"members": [
|
|
239
|
+
{
|
|
240
|
+
"kind": "field",
|
|
241
|
+
"name": "size",
|
|
242
|
+
"type": {
|
|
243
|
+
"text": "(\"sm\" | \"md\" | \"lg\")"
|
|
244
|
+
},
|
|
245
|
+
"description": "The size of the input.",
|
|
246
|
+
"default": "\"md\"",
|
|
247
|
+
"attribute": "size"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"kind": "field",
|
|
251
|
+
"name": "disabled",
|
|
252
|
+
"type": {
|
|
253
|
+
"text": "Boolean"
|
|
254
|
+
},
|
|
255
|
+
"description": "Makes the component disabled.",
|
|
256
|
+
"default": "false",
|
|
257
|
+
"attribute": "disabled"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"kind": "field",
|
|
261
|
+
"name": "name",
|
|
262
|
+
"type": {
|
|
263
|
+
"text": "string"
|
|
264
|
+
},
|
|
265
|
+
"description": "The name used to identify the input in forms.",
|
|
266
|
+
"default": "\"\"",
|
|
267
|
+
"attribute": "name"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"kind": "field",
|
|
271
|
+
"name": "label",
|
|
272
|
+
"type": {
|
|
273
|
+
"text": "string"
|
|
274
|
+
},
|
|
275
|
+
"description": "The label for the input",
|
|
276
|
+
"default": "\"\"",
|
|
277
|
+
"attribute": "label"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"kind": "field",
|
|
281
|
+
"name": "value",
|
|
282
|
+
"type": {
|
|
283
|
+
"text": "string"
|
|
284
|
+
},
|
|
285
|
+
"description": "The value used to identify the input in forms.",
|
|
286
|
+
"default": "\"\"",
|
|
287
|
+
"attribute": "value"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"kind": "field",
|
|
291
|
+
"name": "placeholder",
|
|
292
|
+
"type": {
|
|
293
|
+
"text": "string"
|
|
294
|
+
},
|
|
295
|
+
"description": "The placeholder text for the input.",
|
|
296
|
+
"default": "\"\"",
|
|
297
|
+
"attribute": "placeholder"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"kind": "field",
|
|
301
|
+
"name": "type",
|
|
302
|
+
"type": {
|
|
303
|
+
"text": "(\"text\" | \"email\" | \"password\" | \"tel\" | \"url\" | \"search\" | \"number\" | \"unit\" | \"button\")"
|
|
304
|
+
},
|
|
305
|
+
"description": "The type of the input",
|
|
306
|
+
"default": "\"text\"",
|
|
307
|
+
"attribute": "type"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"kind": "field",
|
|
311
|
+
"name": "error",
|
|
312
|
+
"type": {
|
|
313
|
+
"text": "string"
|
|
314
|
+
},
|
|
315
|
+
"description": "The error to display",
|
|
316
|
+
"default": "\"\"",
|
|
317
|
+
"attribute": "error"
|
|
318
|
+
}
|
|
319
|
+
],
|
|
320
|
+
"events": [
|
|
321
|
+
{
|
|
322
|
+
"description": "Programmatically fire click on the component.",
|
|
323
|
+
"name": "click"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"description": "Programmatically move focus to the component.",
|
|
327
|
+
"name": "focus"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"description": "Programmatically remove focus from the component.",
|
|
331
|
+
"name": "blur"
|
|
332
|
+
}
|
|
333
|
+
],
|
|
334
|
+
"attributes": [
|
|
335
|
+
{
|
|
336
|
+
"name": "size",
|
|
337
|
+
"type": {
|
|
338
|
+
"text": "(\"sm\" | \"md\" | \"lg\")"
|
|
339
|
+
},
|
|
340
|
+
"description": "The size of the input.",
|
|
341
|
+
"default": "\"md\"",
|
|
342
|
+
"fieldName": "size"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"name": "disabled",
|
|
346
|
+
"type": {
|
|
347
|
+
"text": "Boolean"
|
|
348
|
+
},
|
|
349
|
+
"description": "Makes the component disabled.",
|
|
350
|
+
"default": "false",
|
|
351
|
+
"fieldName": "disabled"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"name": "name",
|
|
355
|
+
"type": {
|
|
356
|
+
"text": "string"
|
|
357
|
+
},
|
|
358
|
+
"description": "The name used to identify the input in forms.",
|
|
359
|
+
"default": "\"\"",
|
|
360
|
+
"fieldName": "name"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"name": "label",
|
|
364
|
+
"type": {
|
|
365
|
+
"text": "string"
|
|
366
|
+
},
|
|
367
|
+
"description": "The label for the input",
|
|
368
|
+
"default": "\"\"",
|
|
369
|
+
"fieldName": "label"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"name": "value",
|
|
373
|
+
"type": {
|
|
374
|
+
"text": "string"
|
|
375
|
+
},
|
|
376
|
+
"description": "The value used to identify the input in forms.",
|
|
377
|
+
"default": "\"\"",
|
|
378
|
+
"fieldName": "value"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"name": "placeholder",
|
|
382
|
+
"type": {
|
|
383
|
+
"text": "string"
|
|
384
|
+
},
|
|
385
|
+
"description": "The placeholder text for the input.",
|
|
386
|
+
"default": "\"\"",
|
|
387
|
+
"fieldName": "placeholder"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"name": "type",
|
|
391
|
+
"type": {
|
|
392
|
+
"text": "(\"text\" | \"email\" | \"password\" | \"tel\" | \"url\" | \"search\" | \"number\" | \"unit\" | \"button\")"
|
|
393
|
+
},
|
|
394
|
+
"description": "The type of the input",
|
|
395
|
+
"default": "\"text\"",
|
|
396
|
+
"fieldName": "type"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"name": "error",
|
|
400
|
+
"type": {
|
|
401
|
+
"text": "string"
|
|
402
|
+
},
|
|
403
|
+
"description": "The error to display",
|
|
404
|
+
"default": "\"\"",
|
|
405
|
+
"fieldName": "error"
|
|
406
|
+
}
|
|
407
|
+
],
|
|
408
|
+
"mixins": [
|
|
409
|
+
{
|
|
410
|
+
"name": "Elena",
|
|
411
|
+
"package": "@elenajs/core"
|
|
412
|
+
}
|
|
413
|
+
],
|
|
414
|
+
"superclass": {
|
|
415
|
+
"name": "HTMLElement"
|
|
416
|
+
},
|
|
417
|
+
"status": "alpha",
|
|
418
|
+
"displayName": "Input",
|
|
419
|
+
"tagName": "elena-input",
|
|
420
|
+
"customElement": true
|
|
421
|
+
}
|
|
422
|
+
],
|
|
423
|
+
"exports": [
|
|
424
|
+
{
|
|
425
|
+
"kind": "js",
|
|
426
|
+
"name": "default",
|
|
427
|
+
"declaration": {
|
|
428
|
+
"name": "Input",
|
|
429
|
+
"module": "src/input/input.js"
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"kind": "custom-element-definition",
|
|
434
|
+
"name": "elena-input",
|
|
435
|
+
"declaration": {
|
|
436
|
+
"name": "Input",
|
|
437
|
+
"module": "src/input/input.js"
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
]
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"kind": "javascript-module",
|
|
444
|
+
"path": "src/stack/stack.js",
|
|
445
|
+
"declarations": [
|
|
446
|
+
{
|
|
447
|
+
"kind": "class",
|
|
448
|
+
"description": "The description of the component goes here.",
|
|
449
|
+
"name": "Stack",
|
|
450
|
+
"mixins": [
|
|
451
|
+
{
|
|
452
|
+
"name": "Elena",
|
|
453
|
+
"package": "@elenajs/core"
|
|
454
|
+
}
|
|
455
|
+
],
|
|
456
|
+
"superclass": {
|
|
457
|
+
"name": "HTMLElement"
|
|
458
|
+
},
|
|
459
|
+
"status": "alpha",
|
|
460
|
+
"displayName": "Stack",
|
|
461
|
+
"tagName": "elena-stack",
|
|
462
|
+
"customElement": true
|
|
463
|
+
}
|
|
464
|
+
],
|
|
465
|
+
"exports": [
|
|
466
|
+
{
|
|
467
|
+
"kind": "js",
|
|
468
|
+
"name": "default",
|
|
469
|
+
"declaration": {
|
|
470
|
+
"name": "Stack",
|
|
471
|
+
"module": "src/stack/stack.js"
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"kind": "custom-element-definition",
|
|
476
|
+
"name": "elena-stack",
|
|
477
|
+
"declaration": {
|
|
478
|
+
"name": "Stack",
|
|
479
|
+
"module": "src/stack/stack.js"
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
]
|
|
483
|
+
}
|
|
484
|
+
]
|
|
485
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e,t,n){if(t="boolean"===e&&"boolean"!=typeof t?null!==t:t,!n)return t;if("toAttribute"===n)switch(e){case"object":case"array":return null===t?null:JSON.stringify(t);case"boolean":return t?"":null;case"number":return null===t?null:t;default:return t}else switch(e){case"object":case"array":return t&&JSON.parse(t);case"boolean":default:return t;case"number":return null!==t?+t:t}}function t(e,t,n){e?null===n?e.removeAttribute(t):e.setAttribute(t,n):console.warn("░█ [ELENA]: Cannot sync attributes to a null element.")}let n,s=class extends Event{constructor(e,t){super(e,{bubbles:!0,composed:!0,...t})}};function r(e,t){"undefined"!=typeof window&&"customElements"in window&&(window.customElements.get(e)||window.customElements.define(e,t))}function i(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return String(e).replace(/[&<>"']/g,e=>t[e])}function o(e,...t){const n=e.reduce((e,n,s)=>e+n+i(String(t[s]??"")),"");return{__raw:!0,toString:()=>n}}function l(e,t,n){(function(e,t,n){if(e._tplStrings!==t||!e._tplParts)return!1;let s=!1;for(let t=0;t<n.length;t++){const r=n[t],o=r&&r.__raw,l=o?String(r):i(String(r??""));if(l!==e._tplValues[t])if(e._tplValues[t]=l,o)s=!0;else{const n=e._tplParts[t];n?n.textContent=String(r??""):s=!0}}return!s})(e,t,n)||function(e,t,n){const s=n.map(e=>e&&e.__raw?String(e):i(String(e??""))),r=t.reduce((e,t,n)=>e+t.replace(/\n\s*/g," ")+(s[n]??""),"").replace(/>\s+</g,"><").replace(/>\s+/g,">").replace(/\s+</g,"<").trim();a(e,r),e._tplStrings=t,e._tplValues=s,e._tplParts=function(e,t){const n=new Array(t.length),s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r,i=0;for(;(r=s.nextNode())&&i<t.length;)r.textContent===t[i]&&(n[i]=r,i++);return n}(e,s)}(e,t,n)}function a(e,t){e?e.replaceChildren((n??=document.createRange()).createContextualFragment(t)):console.warn("░█ [ELENA]: Cannot render to a null element.")}function c(n,r){const i=r&&r.element?/^[a-z][a-z0-9-]*$/i.test(r.element)?e=>e.getElementsByClassName(r.element)[0]:e=>e.querySelector(r.element):e=>e.firstElementChild;class o extends n{element=null;attributeChangedCallback(t,n,s){(function(t,n,s,r){if(s!==r){const s=e(typeof t[n],r,"toProp");t[n]=s}})(this,t,n,s),this.element&&n!==s&&this.render()}static get observedAttributes(){return r&&r.props?r.props:[]}render(){}template(e,...t){l(this,e,t)}connectedCallback(){if(this.render(),this.element||(this.element=i(this),this.element||(console.warn("░█ [ELENA]: No element found, using firstElementChild as fallback."),this.element=this.firstElementChild)),this._props)for(const[n,s]of this._props){const r=e(typeof s,s,"toAttribute");"string"==typeof s&&""===s?(this.removeAttribute(n),this.element.removeAttribute(n)):(t(this,n,r),t(this.element,n,r))}!this._events&&r&&r.events&&(this._events=!0,r.events?.forEach(e=>{this.element.addEventListener(e,this),this[e]=(...t)=>this.element[e](...t)})),this.updated()}updated(){this._hydrated||(this._hydrated=!0,this.classList.add("elena-hydrated"))}disconnectedCallback(){this._events&&(this._events=!1,r.events?.forEach(e=>{this.element?.removeEventListener(e,this)}))}handleEvent(e){r.events?.includes(e.type)&&(e.stopPropagation(),this.dispatchEvent(new s(e.type,{cancelable:!0})))}}return r&&r.props?.length&&function(n,s){for(const r of s)Object.defineProperty(n,r,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(r):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(r))return;if(this._props.set(r,n),!this.isConnected)return;const s=e(typeof n,n,"toAttribute");t(this,r,s),this.element&&t(this.element,r,s)}})}(o.prototype,r.props),o}export{o as e,c as l,r as n};
|
|
2
|
+
//# sourceMappingURL=elena-f59Xc5oc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elena-f59Xc5oc.js","sources":["../../core/dist/props.js","../../core/dist/events.js","../../core/dist/render.js","../../core/dist/utils.js","../../core/dist/elena.js"],"sourcesContent":["function t(t,e,n){if(e=\"boolean\"===t&&\"boolean\"!=typeof e?null!==e:e,!n)return e;if(\"toAttribute\"===n)switch(t){case\"object\":case\"array\":return null===e?null:JSON.stringify(e);case\"boolean\":return e?\"\":null;case\"number\":return null===e?null:e;default:return e}else switch(t){case\"object\":case\"array\":return e&&JSON.parse(e);case\"boolean\":default:return e;case\"number\":return null!==e?+e:e}}function e(t,e,n){t?null===n?t.removeAttribute(e):t.setAttribute(e,n):console.warn(\"░█ [ELENA]: Cannot sync attributes to a null element.\")}function n(n,r){for(const o of r)Object.defineProperty(n,o,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(o):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(o))return;if(this._props.set(o,n),!this.isConnected)return;const r=t(typeof n,n,\"toAttribute\");e(this,o,r),this.element&&e(this.element,o,r)}})}function r(e,n,r,o){if(r!==o){const r=t(typeof e[n],o,\"toProp\");e[n]=r}}export{t as getPropValue,r as getProps,n as setProps,e as syncAttribute};\n//# sourceMappingURL=props.js.map\n","class e extends Event{constructor(e,s){super(e,{bubbles:!0,composed:!0,...s})}}export{e as ElenaEvent};\n//# sourceMappingURL=events.js.map\n","import{escapeHtml as t}from\"./utils.js\";function e(e,n,l){(function(e,n,r){if(e._tplStrings!==n||!e._tplParts)return!1;let l=!1;for(let n=0;n<r.length;n++){const a=r[n],o=a&&a.__raw,c=o?String(a):t(String(a??\"\"));if(c!==e._tplValues[n])if(e._tplValues[n]=c,o)l=!0;else{const t=e._tplParts[n];t?t.textContent=String(a??\"\"):l=!0}}return!l})(e,n,l)||function(e,n,l){const a=l.map(e=>e&&e.__raw?String(e):t(String(e??\"\"))),o=n.reduce((t,e,n)=>t+e.replace(/\\n\\s*/g,\" \")+(a[n]??\"\"),\"\").replace(/>\\s+</g,\"><\").replace(/>\\s+/g,\">\").replace(/\\s+</g,\"<\").trim();r(e,o),e._tplStrings=n,e._tplValues=a,e._tplParts=function(t,e){const n=new Array(e.length),r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let l,a=0;for(;(l=r.nextNode())&&a<e.length;)l.textContent===e[a]&&(n[a]=l,a++);return n}(e,a)}(e,n,l)}let n;function r(t,e){t?t.replaceChildren((n??=document.createRange()).createContextualFragment(e)):console.warn(\"░█ [ELENA]: Cannot render to a null element.\")}export{r as renderHtml,e as renderTemplate};\n//# sourceMappingURL=render.js.map\n","function n(n,t){\"undefined\"!=typeof window&&\"customElements\"in window&&(window.customElements.get(n)||window.customElements.define(n,t))}function t(n){const t={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"};return String(n).replace(/[&<>\"']/g,n=>t[n])}function e(n,...e){const o=n.reduce((n,o,i)=>n+o+t(String(e[i]??\"\")),\"\");return{__raw:!0,toString:()=>o}}export{n as defineElement,t as escapeHtml,e as html};\n//# sourceMappingURL=utils.js.map\n","import{setProps as e,getProps as t,getPropValue as s,syncAttribute as n}from\"./props.js\";import{ElenaEvent as i}from\"./events.js\";export{defineElement,html}from\"./utils.js\";import{renderTemplate as r}from\"./render.js\";function l(l,h){const o=h&&h.element?/^[a-z][a-z0-9-]*$/i.test(h.element)?e=>e.getElementsByClassName(h.element)[0]:e=>e.querySelector(h.element):e=>e.firstElementChild;class a extends l{element=null;attributeChangedCallback(e,s,n){t(this,e,s,n),this.element&&s!==n&&this.render()}static get observedAttributes(){return h&&h.props?h.props:[]}render(){}template(e,...t){r(this,e,t)}connectedCallback(){if(this.render(),this.element||(this.element=o(this),this.element||(console.warn(\"░█ [ELENA]: No element found, using firstElementChild as fallback.\"),this.element=this.firstElementChild)),this._props)for(const[e,t]of this._props){const i=s(typeof t,t,\"toAttribute\");\"string\"==typeof t&&\"\"===t?(this.removeAttribute(e),this.element.removeAttribute(e)):(n(this,e,i),n(this.element,e,i))}!this._events&&h&&h.events&&(this._events=!0,h.events?.forEach(e=>{this.element.addEventListener(e,this),this[e]=(...t)=>this.element[e](...t)})),this.updated()}updated(){this._hydrated||(this._hydrated=!0,this.classList.add(\"elena-hydrated\"))}disconnectedCallback(){this._events&&(this._events=!1,h.events?.forEach(e=>{this.element?.removeEventListener(e,this)}))}handleEvent(e){h.events?.includes(e.type)&&(e.stopPropagation(),this.dispatchEvent(new i(e.type,{cancelable:!0})))}}return h&&h.props?.length&&e(a.prototype,h.props),a}export{l as Elena};\n//# sourceMappingURL=elena.js.map\n"],"names":["t","e","n","JSON","stringify","parse","removeAttribute","setAttribute","console","warn","e$2","Event","constructor","s","super","bubbles","composed","window","customElements","get","define","String","replace","o","reduce","i","__raw","toString","l","r","_tplStrings","_tplParts","length","a","c","_tplValues","textContent","map","trim","Array","document","createTreeWalker","NodeFilter","SHOW_TEXT","nextNode","replaceChildren","createRange","createContextualFragment","h","element","test","getElementsByClassName","querySelector","firstElementChild","attributeChangedCallback","this","render","observedAttributes","props","template","connectedCallback","_props","_events","events","forEach","addEventListener","updated","_hydrated","classList","add","disconnectedCallback","removeEventListener","handleEvent","includes","type","stopPropagation","dispatchEvent","cancelable","Object","defineProperty","configurable","enumerable","set","Map","isConnected","prototype"],"mappings":"AAAA,SAASA,EAAEA,EAAEC,EAAEC,GAAG,GAAGD,EAAE,YAAYD,GAAG,kBAAkBC,EAAE,OAAOA,EAAEA,GAAGC,EAAE,OAAO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DED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/input.css
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* ---------------------------------------------
|
|
2
|
+
/ ELENA input
|
|
3
|
+
/ --------------------------------------------- */
|
|
4
|
+
|
|
5
|
+
elena-input {
|
|
6
|
+
/* Public CSS Custom Properties */
|
|
7
|
+
--elena-input-bg: transparent;
|
|
8
|
+
--elena-input-text: #333;
|
|
9
|
+
--elena-input-border: #333;
|
|
10
|
+
--elena-input-radius: 4px;
|
|
11
|
+
--elena-input-font: sans-serif;
|
|
12
|
+
|
|
13
|
+
all: unset;
|
|
14
|
+
min-inline-size: 300px;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: 5px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* For overall visual styles, we want to target both
|
|
23
|
+
* non-hydrated element and the internal input element
|
|
24
|
+
* with the same styles. This way the element will look
|
|
25
|
+
* the same before & after client side hydration.
|
|
26
|
+
*/
|
|
27
|
+
:is(elena-input:not(.elena-hydrated), .elena-input) {
|
|
28
|
+
-webkit-appearance: none;
|
|
29
|
+
appearance: none;
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
-webkit-user-select: none;
|
|
32
|
+
user-select: none;
|
|
33
|
+
line-height: 1;
|
|
34
|
+
block-size: 3rem;
|
|
35
|
+
background: var(--elena-input-bg);
|
|
36
|
+
color: var(--elena-input-text);
|
|
37
|
+
border-radius: var(--elena-input-radius);
|
|
38
|
+
border: 1px solid var(--elena-input-border);
|
|
39
|
+
font-family: var(--elena-input-font);
|
|
40
|
+
font-weight: 700;
|
|
41
|
+
padding: 0.75rem 1.25rem;
|
|
42
|
+
cursor: text;
|
|
43
|
+
position: relative;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
elena-input:not(.elena-hydrated) {
|
|
47
|
+
margin-block-start: 1.82rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
elena-input:not(.elena-hydrated)::before {
|
|
51
|
+
content: attr(label);
|
|
52
|
+
position: absolute;
|
|
53
|
+
font-weight: 700;
|
|
54
|
+
top: -1.78rem;
|
|
55
|
+
left: -1px;
|
|
56
|
+
display: block;
|
|
57
|
+
inline-size: 100%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
elena-input:not(.elena-hydrated)::after {
|
|
61
|
+
content: attr(placeholder);
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
block-size: 100%;
|
|
65
|
+
color: #aaa;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
elena-input .elena-input {
|
|
69
|
+
font-size: 100%;
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
inline-size: 100%;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
elena-input label {
|
|
75
|
+
font-weight: 700;
|
|
76
|
+
display: block;
|
|
77
|
+
block-size: 1.5rem;
|
|
78
|
+
margin: 0;
|
|
79
|
+
inline-size: 100%;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.elena-input-container {
|
|
83
|
+
inline-size: 100%;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
elena-input input:focus {
|
|
87
|
+
box-shadow: 0 0 0 1px red;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
elena-input input::placeholder {
|
|
91
|
+
opacity: 1;
|
|
92
|
+
color: #aaa;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
elena-input[error] {
|
|
96
|
+
--elena-input-border: red;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
elena-input .elena-error {
|
|
100
|
+
color: red;
|
|
101
|
+
}
|
package/dist/input.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{l as e,e as s,n as l}from"./elena-f59Xc5oc.js";const t={props:["size","disabled","name","value","type","label","error","placeholder"],events:["click","focus","blur"],element:".elena-input"};class a extends(e(HTMLElement,t)){constructor(){super(),this.size="md",this.disabled=!1,this.name="",this.label="",this.value="",this.placeholder="",this.type="text",this.error=""}render(){this.template`
|
|
2
|
+
<label for="input">${this.label}</label>
|
|
3
|
+
<div class="elena-input-container">
|
|
4
|
+
<span class="elena-input-start"></span>
|
|
5
|
+
<input
|
|
6
|
+
id="input"
|
|
7
|
+
class="elena-input"
|
|
8
|
+
type="${this.type}"
|
|
9
|
+
value="${this.value}"
|
|
10
|
+
placeholder="${this.placeholder}"
|
|
11
|
+
${this.name?`name="${this.name}"`:""}
|
|
12
|
+
${this.value?`value="${this.value}"`:""}
|
|
13
|
+
${this.disabled?"disabled":""}
|
|
14
|
+
/>
|
|
15
|
+
<span class="elena-input-end"></span>
|
|
16
|
+
</div>
|
|
17
|
+
${this.error?s`<div class="elena-error" role="alert">${this.error}</div>`:""}
|
|
18
|
+
`}}l("elena-input",a);export{a as default};
|
|
19
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sources":["../src/input/input.js"],"sourcesContent":["import { Elena, defineElement, html } from \"@elenajs/core\";\n\nconst options = {\n props: [\"size\", \"disabled\", \"name\", \"value\", \"type\", \"label\", \"error\", \"placeholder\"],\n events: [\"click\", \"focus\", \"blur\"],\n element: \".elena-input\",\n};\n\n/**\n * The description of the component goes here.\n *\n * @displayName Input\n * @status alpha\n *\n * @event click - Programmatically fire click on the component.\n * @event focus - Programmatically move focus to the component.\n * @event blur - Programmatically remove focus from the component.\n *\n * @cssprop [--elena-input-color-text] - Controls the color of the text.\n * @cssprop [--elena-input-color-bg] - Controls the color of the background.\n * @cssprop [--elena-input-color-border] - Controls the color of the border.\n * @cssprop [--elena-input-radius] - Controls the radius of the component.\n */\nexport default class Input extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The size of the input.\n *\n * @attribute\n * @type {(\"sm\" | \"md\" | \"lg\")}\n */\n this.size = \"md\";\n\n /**\n * Makes the component disabled.\n *\n * @attribute\n * @type {Boolean}\n */\n this.disabled = false;\n\n /**\n * The name used to identify the input in forms.\n *\n * @attribute\n * @type {string}\n */\n this.name = \"\";\n\n /**\n * The label for the input\n *\n * @attribute\n * @type {string}\n */\n this.label = \"\";\n\n /**\n * The value used to identify the input in forms.\n *\n * @attribute\n * @type {string}\n */\n this.value = \"\";\n\n /**\n * The placeholder text for the input.\n *\n * @attribute\n * @type {string}\n */\n this.placeholder = \"\";\n\n /**\n * The type of the input\n *\n * @attribute\n * @type {(\"text\" | \"email\" | \"password\" | \"tel\" | \"url\" | \"search\" | \"number\" | \"unit\" | \"button\")}\n */\n this.type = \"text\";\n\n /**\n * The error to display\n *\n * @attribute\n * @type {string}\n */\n this.error = \"\";\n }\n\n /**\n * Renders the custom element template.\n *\n * @internal\n */\n render() {\n this.template`\n <label for=\"input\">${this.label}</label>\n <div class=\"elena-input-container\">\n <span class=\"elena-input-start\"></span>\n <input\n id=\"input\"\n class=\"elena-input\"\n type=\"${this.type}\"\n value=\"${this.value}\"\n placeholder=\"${this.placeholder}\"\n ${this.name ? `name=\"${this.name}\"` : \"\"}\n ${this.value ? `value=\"${this.value}\"` : \"\"}\n ${this.disabled ? \"disabled\" : \"\"}\n />\n <span class=\"elena-input-end\"></span>\n </div>\n ${this.error ? html`<div class=\"elena-error\" role=\"alert\">${this.error}</div>` : \"\"}\n `;\n }\n}\n\n/**\n * Register the custom element\n */\ndefineElement(\"elena-input\", Input);\n"],"names":["options","props","events","element","Input","Elena","HTMLElement","constructor","super","this","size","disabled","name","label","value","placeholder","type","error","render","template","html","defineElement"],"mappings":"sDAEA,MAAMA,EAAU,CACdC,MAAO,CAAC,OAAQ,WAAY,OAAQ,QAAS,OAAQ,QAAS,QAAS,eACvEC,OAAQ,CAAC,QAAS,QAAS,QAC3BC,QAAS,gBAkBI,MAAMC,UAAcC,EAAMC,YAAaN,IACpD,WAAAO,GACEC,QAQAC,KAAKC,KAAO,KAQZD,KAAKE,UAAW,EAQhBF,KAAKG,KAAO,GAQZH,KAAKI,MAAQ,GAQbJ,KAAKK,MAAQ,GAQbL,KAAKM,YAAc,GAQnBN,KAAKO,KAAO,OAQZP,KAAKQ,MAAQ,EACf,CAOA,MAAAC,GACET,KAAKU,QAAQ;6BACYV,KAAKI;;;;;;wBAMVJ,KAAKO;yBACJP,KAAKK;+BACCL,KAAKM;kBAClBN,KAAKG,KAAO,SAASH,KAAKG,QAAU;kBACpCH,KAAKK,MAAQ,UAAUL,KAAKK,SAAW;kBACvCL,KAAKE,SAAW,WAAa;;;;UAIrCF,KAAKQ,MAAQG,CAAI,yCAAyCX,KAAKQ,cAAgB;KAEvF,EAMFI,EAAc,cAAejB"}
|
package/dist/stack.css
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* ---------------------------------------------
|
|
2
|
+
/ ELENA STACK
|
|
3
|
+
/ --------------------------------------------- */
|
|
4
|
+
|
|
5
|
+
elena-stack {
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: flex-start;
|
|
8
|
+
flex-flow: column wrap;
|
|
9
|
+
gap: 1rem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
elena-stack[dir="row"] {
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
}
|
package/dist/stack.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.js","sources":["../src/stack/stack.js"],"sourcesContent":["import { Elena, defineElement } from \"@elenajs/core\";\n\n/**\n * The description of the component goes here.\n *\n * @displayName Stack\n * @status alpha\n */\nexport default class Stack extends Elena(HTMLElement) {\n constructor() {\n super();\n }\n}\n\n/**\n * Register the custom element\n */\ndefineElement(\"elena-stack\", Stack);\n"],"names":["Stack","Elena","HTMLElement","constructor","super","defineElement"],"mappings":"+CAQe,MAAMA,UAAcC,EAAMC,cACvC,WAAAC,GACEC,OACF,EAMFC,EAAc,cAAeL"}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elenajs/elements",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "An example Elena custom element library",
|
|
5
|
+
"author": "Ariel Salminen <info@arielsalminen.com>",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/custom-elements.d.ts",
|
|
8
|
+
"customElements": "dist/custom-elements.json",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"prebuild": "npm run -s clean",
|
|
18
|
+
"start": "web-dev-server --node-resolve --app-index src/index.html --open --watch",
|
|
19
|
+
"build": "NODE_OPTIONS='--no-warnings' rollup -c",
|
|
20
|
+
"postbuild": "npm run -s analyze",
|
|
21
|
+
"clean": "rm -rf dist/",
|
|
22
|
+
"analyze": "custom-elements-manifest analyze --config './custom-elements.config.js'"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@elenajs/core": "0.0.2"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@custom-elements-manifest/analyzer": "0.11.0",
|
|
29
|
+
"@rollup/plugin-node-resolve": "16.0.3",
|
|
30
|
+
"@rollup/plugin-terser": "0.4.4",
|
|
31
|
+
"@web/dev-server": "0.4.6",
|
|
32
|
+
"custom-element-jsx-integration": "1.6.0",
|
|
33
|
+
"rollup": "4.57.1",
|
|
34
|
+
"rollup-plugin-copy": "3.5.0",
|
|
35
|
+
"rollup-plugin-summary": "3.0.1"
|
|
36
|
+
},
|
|
37
|
+
"gitHead": "ff57490821d81e73f378b36ef28d25bfeebd9657"
|
|
38
|
+
}
|