@dropi/ui 0.1.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/LICENSE +21 -0
- package/dist/cjs/dropi-badge.cjs.entry.js +37 -0
- package/dist/cjs/dropi-button.cjs.entry.js +81 -0
- package/dist/cjs/dropi-checkbox.cjs.entry.js +36 -0
- package/dist/cjs/dropi-icon.cjs.entry.js +50 -0
- package/dist/cjs/dropi-input.cjs.entry.js +210 -0
- package/dist/cjs/dropi-radio-button.cjs.entry.js +47 -0
- package/dist/cjs/dropi-select.cjs.entry.js +335 -0
- package/dist/cjs/dropi-switch.cjs.entry.js +30 -0
- package/dist/cjs/dropi-tag.cjs.entry.js +68 -0
- package/dist/cjs/dropi-text-area.cjs.entry.js +103 -0
- package/dist/cjs/dropi-ui.cjs.js +24 -0
- package/dist/cjs/index-CuGLZVqo.js +1743 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/collection/assets/icons/symbol/svg/sprite.css.svg +1 -0
- package/dist/collection/collection-manifest.json +22 -0
- package/dist/collection/components/dropi-badge/dropi-badge.css +41 -0
- package/dist/collection/components/dropi-badge/dropi-badge.js +72 -0
- package/dist/collection/components/dropi-button/dropi-button.css +169 -0
- package/dist/collection/components/dropi-button/dropi-button.js +277 -0
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.css +47 -0
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.js +103 -0
- package/dist/collection/components/dropi-icon/dropi-icon.css +19 -0
- package/dist/collection/components/dropi-icon/dropi-icon.js +142 -0
- package/dist/collection/components/dropi-input/dropi-input.css +168 -0
- package/dist/collection/components/dropi-input/dropi-input.js +735 -0
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.css +59 -0
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.js +181 -0
- package/dist/collection/components/dropi-select/dropi-select.css +364 -0
- package/dist/collection/components/dropi-select/dropi-select.js +932 -0
- package/dist/collection/components/dropi-select/select.types.js +1 -0
- package/dist/collection/components/dropi-switch/dropi-switch.css +57 -0
- package/dist/collection/components/dropi-switch/dropi-switch.js +96 -0
- package/dist/collection/components/dropi-tag/dropi-tag.css +40 -0
- package/dist/collection/components/dropi-tag/dropi-tag.js +190 -0
- package/dist/collection/components/dropi-text-area/dropi-text-area.css +97 -0
- package/dist/collection/components/dropi-text-area/dropi-text-area.js +457 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/collection/utils/utils.unit.test.js +16 -0
- package/dist/components/dropi-badge.d.ts +11 -0
- package/dist/components/dropi-badge.js +1 -0
- package/dist/components/dropi-button.d.ts +11 -0
- package/dist/components/dropi-button.js +1 -0
- package/dist/components/dropi-checkbox.d.ts +11 -0
- package/dist/components/dropi-checkbox.js +1 -0
- package/dist/components/dropi-icon.d.ts +11 -0
- package/dist/components/dropi-icon.js +1 -0
- package/dist/components/dropi-input.d.ts +11 -0
- package/dist/components/dropi-input.js +1 -0
- package/dist/components/dropi-radio-button.d.ts +11 -0
- package/dist/components/dropi-radio-button.js +1 -0
- package/dist/components/dropi-select.d.ts +11 -0
- package/dist/components/dropi-select.js +1 -0
- package/dist/components/dropi-switch.d.ts +11 -0
- package/dist/components/dropi-switch.js +1 -0
- package/dist/components/dropi-tag.d.ts +11 -0
- package/dist/components/dropi-tag.js +1 -0
- package/dist/components/dropi-text-area.d.ts +11 -0
- package/dist/components/dropi-text-area.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-MNma8N1x.js +1 -0
- package/dist/dropi-ui/dropi-ui.css +1 -0
- package/dist/dropi-ui/dropi-ui.esm.js +1 -0
- package/dist/dropi-ui/index.esm.js +0 -0
- package/dist/dropi-ui/p-1a28b8f5.entry.js +1 -0
- package/dist/dropi-ui/p-21abf91a.entry.js +1 -0
- package/dist/dropi-ui/p-52291024.entry.js +1 -0
- package/dist/dropi-ui/p-54502c46.entry.js +1 -0
- package/dist/dropi-ui/p-6f0aa619.entry.js +1 -0
- package/dist/dropi-ui/p-9c7076d3.entry.js +1 -0
- package/dist/dropi-ui/p-DFz-gwFP.js +2 -0
- package/dist/dropi-ui/p-a1944f3d.entry.js +1 -0
- package/dist/dropi-ui/p-c7b9cbda.entry.js +1 -0
- package/dist/dropi-ui/p-dd089a60.entry.js +1 -0
- package/dist/dropi-ui/p-f785011f.entry.js +1 -0
- package/dist/esm/dropi-badge.entry.js +35 -0
- package/dist/esm/dropi-button.entry.js +79 -0
- package/dist/esm/dropi-checkbox.entry.js +34 -0
- package/dist/esm/dropi-icon.entry.js +48 -0
- package/dist/esm/dropi-input.entry.js +208 -0
- package/dist/esm/dropi-radio-button.entry.js +45 -0
- package/dist/esm/dropi-select.entry.js +333 -0
- package/dist/esm/dropi-switch.entry.js +28 -0
- package/dist/esm/dropi-tag.entry.js +66 -0
- package/dist/esm/dropi-text-area.entry.js +101 -0
- package/dist/esm/dropi-ui.js +20 -0
- package/dist/esm/index-DFz-gwFP.js +1734 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +10 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/dropi-badge/dropi-badge.d.ts +12 -0
- package/dist/types/components/dropi-button/dropi-button.d.ts +35 -0
- package/dist/types/components/dropi-checkbox/dropi-checkbox.d.ts +16 -0
- package/dist/types/components/dropi-icon/dropi-icon.d.ts +25 -0
- package/dist/types/components/dropi-input/dropi-input.d.ts +92 -0
- package/dist/types/components/dropi-radio-button/dropi-radio-button.d.ts +25 -0
- package/dist/types/components/dropi-select/dropi-select.d.ts +103 -0
- package/dist/types/components/dropi-select/select.types.d.ts +23 -0
- package/dist/types/components/dropi-switch/dropi-switch.d.ts +15 -0
- package/dist/types/components/dropi-tag/dropi-tag.d.ts +25 -0
- package/dist/types/components/dropi-text-area/dropi-text-area.d.ts +53 -0
- package/dist/types/components.d.ts +1549 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/types/utils/utils.unit.test.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +50 -0
- package/readme.md +89 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
fill: var(--icon-fill, currentColor);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
svg {
|
|
9
|
+
fill: inherit;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.spin {
|
|
13
|
+
animation: spin 1s linear infinite;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@keyframes spin {
|
|
17
|
+
from { transform: rotate(0deg); }
|
|
18
|
+
to { transform: rotate(360deg); }
|
|
19
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @component dropi-icon
|
|
4
|
+
* Renders an SVG icon from the Dropi sprite sheet.
|
|
5
|
+
* The sprite must be available at `assets/icons/sprite.svg`.
|
|
6
|
+
*/
|
|
7
|
+
export class DropiIcon {
|
|
8
|
+
el;
|
|
9
|
+
/** Icon name matching the id in the SVG sprite */
|
|
10
|
+
name = '';
|
|
11
|
+
/** Width of the icon (CSS value) */
|
|
12
|
+
width = '24px';
|
|
13
|
+
/** Height of the icon (CSS value) */
|
|
14
|
+
height = '24px';
|
|
15
|
+
/**
|
|
16
|
+
* Color of the icon. Accepts:
|
|
17
|
+
* - Hex color: `#ff0000`
|
|
18
|
+
* - CSS variable name without `--`: `Primary-Primary-500`
|
|
19
|
+
* - `currentColor` to inherit
|
|
20
|
+
*/
|
|
21
|
+
color = 'currentColor';
|
|
22
|
+
colorChanged() {
|
|
23
|
+
this.applyColor();
|
|
24
|
+
}
|
|
25
|
+
componentDidLoad() {
|
|
26
|
+
this.applyColor();
|
|
27
|
+
}
|
|
28
|
+
applyColor() {
|
|
29
|
+
const fill = this.color.startsWith('#')
|
|
30
|
+
? this.color
|
|
31
|
+
: this.color === 'currentColor'
|
|
32
|
+
? 'currentColor'
|
|
33
|
+
: `var(--${this.color})`;
|
|
34
|
+
this.el.style.setProperty('--icon-fill', fill);
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return (h("svg", { key: 'e71bfb0be9f68882bbd7314d0f6f3fd877fccf07', width: this.width, height: this.height, class: { spin: this.name === 'Spinner' }, "aria-hidden": "true" }, h("use", { key: 'e6905c3ba9c68f463db62cde2cd64ce51093c2c0', href: `/assets/icons/symbol/svg/sprite.css.svg#${this.name}` })));
|
|
38
|
+
}
|
|
39
|
+
static get is() { return "dropi-icon"; }
|
|
40
|
+
static get encapsulation() { return "shadow"; }
|
|
41
|
+
static get originalStyleUrls() {
|
|
42
|
+
return {
|
|
43
|
+
"$": ["dropi-icon.css"]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
static get styleUrls() {
|
|
47
|
+
return {
|
|
48
|
+
"$": ["dropi-icon.css"]
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
static get properties() {
|
|
52
|
+
return {
|
|
53
|
+
"name": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"mutable": false,
|
|
56
|
+
"complexType": {
|
|
57
|
+
"original": "string",
|
|
58
|
+
"resolved": "string",
|
|
59
|
+
"references": {}
|
|
60
|
+
},
|
|
61
|
+
"required": false,
|
|
62
|
+
"optional": false,
|
|
63
|
+
"docs": {
|
|
64
|
+
"tags": [],
|
|
65
|
+
"text": "Icon name matching the id in the SVG sprite"
|
|
66
|
+
},
|
|
67
|
+
"getter": false,
|
|
68
|
+
"setter": false,
|
|
69
|
+
"reflect": false,
|
|
70
|
+
"attribute": "name",
|
|
71
|
+
"defaultValue": "''"
|
|
72
|
+
},
|
|
73
|
+
"width": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"mutable": false,
|
|
76
|
+
"complexType": {
|
|
77
|
+
"original": "string",
|
|
78
|
+
"resolved": "string",
|
|
79
|
+
"references": {}
|
|
80
|
+
},
|
|
81
|
+
"required": false,
|
|
82
|
+
"optional": false,
|
|
83
|
+
"docs": {
|
|
84
|
+
"tags": [],
|
|
85
|
+
"text": "Width of the icon (CSS value)"
|
|
86
|
+
},
|
|
87
|
+
"getter": false,
|
|
88
|
+
"setter": false,
|
|
89
|
+
"reflect": false,
|
|
90
|
+
"attribute": "width",
|
|
91
|
+
"defaultValue": "'24px'"
|
|
92
|
+
},
|
|
93
|
+
"height": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"mutable": false,
|
|
96
|
+
"complexType": {
|
|
97
|
+
"original": "string",
|
|
98
|
+
"resolved": "string",
|
|
99
|
+
"references": {}
|
|
100
|
+
},
|
|
101
|
+
"required": false,
|
|
102
|
+
"optional": false,
|
|
103
|
+
"docs": {
|
|
104
|
+
"tags": [],
|
|
105
|
+
"text": "Height of the icon (CSS value)"
|
|
106
|
+
},
|
|
107
|
+
"getter": false,
|
|
108
|
+
"setter": false,
|
|
109
|
+
"reflect": false,
|
|
110
|
+
"attribute": "height",
|
|
111
|
+
"defaultValue": "'24px'"
|
|
112
|
+
},
|
|
113
|
+
"color": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"mutable": false,
|
|
116
|
+
"complexType": {
|
|
117
|
+
"original": "string",
|
|
118
|
+
"resolved": "string",
|
|
119
|
+
"references": {}
|
|
120
|
+
},
|
|
121
|
+
"required": false,
|
|
122
|
+
"optional": false,
|
|
123
|
+
"docs": {
|
|
124
|
+
"tags": [],
|
|
125
|
+
"text": "Color of the icon. Accepts:\n- Hex color: `#ff0000`\n- CSS variable name without `--`: `Primary-Primary-500`\n- `currentColor` to inherit"
|
|
126
|
+
},
|
|
127
|
+
"getter": false,
|
|
128
|
+
"setter": false,
|
|
129
|
+
"reflect": false,
|
|
130
|
+
"attribute": "color",
|
|
131
|
+
"defaultValue": "'currentColor'"
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
static get elementRef() { return "el"; }
|
|
136
|
+
static get watchers() {
|
|
137
|
+
return [{
|
|
138
|
+
"propName": "color",
|
|
139
|
+
"methodName": "colorChanged"
|
|
140
|
+
}];
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
text-align: left;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
8
|
+
|
|
9
|
+
/* ── Fixed label layout ────────────────────────────────────── */
|
|
10
|
+
.fixed-label-container {
|
|
11
|
+
display: flex;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
align-items: flex-start;
|
|
15
|
+
gap: 8px;
|
|
16
|
+
text-align: left;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.input-label {
|
|
20
|
+
color: var(--Gray-Gray-600, #475066);
|
|
21
|
+
font-size: var(--font-size-xs, 10px);
|
|
22
|
+
font-weight: var(--font-weight-regular, 400);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.asterisk {
|
|
26
|
+
color: var(--Error-Error-500, #f46a6b);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* ── Form group / container ────────────────────────────────── */
|
|
30
|
+
.form-group {
|
|
31
|
+
position: relative;
|
|
32
|
+
width: 100%;
|
|
33
|
+
text-align: left;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.input-container {
|
|
37
|
+
position: relative;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ── Icons ─────────────────────────────────────────────────── */
|
|
41
|
+
.icon-input {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 10px;
|
|
44
|
+
left: 5px;
|
|
45
|
+
z-index: 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.icon-input-password {
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: 10px;
|
|
51
|
+
right: 13px;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
z-index: 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* ── Base input ─────────────────────────────────────────────── */
|
|
57
|
+
.form-control {
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
width: 100%;
|
|
60
|
+
padding: var(--Size-2, 8px);
|
|
61
|
+
border: 1px solid var(--Gray-Gray-200, #c3c9d9);
|
|
62
|
+
border-radius: var(--Border-2, 8px);
|
|
63
|
+
background: var(--Neutral-White, #fff);
|
|
64
|
+
font-size: var(--font-size-s, 12px);
|
|
65
|
+
font-family: inherit;
|
|
66
|
+
color: var(--Gray-Gray-700, #32394d);
|
|
67
|
+
transition: border-color 0.3s ease-in-out;
|
|
68
|
+
height: 40px;
|
|
69
|
+
outline: none;
|
|
70
|
+
appearance: none;
|
|
71
|
+
text-align: left;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.form-control::placeholder {
|
|
75
|
+
color: transparent;
|
|
76
|
+
transition: color 0.2s ease-in-out;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Show placeholder only on focus or in fixedLabel mode */
|
|
80
|
+
.form-control:focus::placeholder,
|
|
81
|
+
.fixed-label-input::placeholder {
|
|
82
|
+
color: var(--Gray-Gray-400, #858ea6);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.form-control:focus {
|
|
86
|
+
border-color: var(--Info-Info-500, #50a5f1);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.form-control-valid {
|
|
90
|
+
border-color: var(--Gray-Gray-400, #858ea6) !important;
|
|
91
|
+
color: var(--Gray-Gray-600, #475066);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.form-control-invalid {
|
|
95
|
+
border-color: var(--Error-Error-500, #f46a6b) !important;
|
|
96
|
+
color: var(--Gray-Gray-600, #475066);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.form-control:disabled {
|
|
100
|
+
border-color: var(--Gray-Gray-200, #c3c9d9) !important;
|
|
101
|
+
color: var(--Gray-Gray-400, #858ea6);
|
|
102
|
+
background-color: var(--Gray-Gray-50, #f7f8fa);
|
|
103
|
+
cursor: not-allowed;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.padding-icon {
|
|
107
|
+
padding-left: 28px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Password: hide characters via CSS (no type=password needed for font trick) */
|
|
111
|
+
.text-password {
|
|
112
|
+
-webkit-text-security: disc;
|
|
113
|
+
text-security: disc;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* ── Floating label ─────────────────────────────────────────── */
|
|
117
|
+
label.label-bottom {
|
|
118
|
+
position: absolute;
|
|
119
|
+
font-weight: var(--font-weight-regular, 400);
|
|
120
|
+
top: 10px;
|
|
121
|
+
font-size: var(--font-size-s, 12px);
|
|
122
|
+
color: var(--Gray-Gray-500, #69738c);
|
|
123
|
+
left: 10px;
|
|
124
|
+
transition: all 0.2s ease-in-out;
|
|
125
|
+
pointer-events: none;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
width: 90%;
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* Float up when focused or has value */
|
|
132
|
+
.form-control:focus + label.label-bottom,
|
|
133
|
+
.form-control:not(:placeholder-shown) + label.label-bottom {
|
|
134
|
+
top: -22px;
|
|
135
|
+
left: 0;
|
|
136
|
+
font-size: var(--font-size-xs, 10px);
|
|
137
|
+
color: var(--Gray-Gray-600, #475066);
|
|
138
|
+
width: unset;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.form-control:disabled + label.label-bottom {
|
|
142
|
+
color: var(--Gray-Gray-400, #858ea6);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* ── Helper text ────────────────────────────────────────────── */
|
|
146
|
+
.form-control-helper {
|
|
147
|
+
display: flex;
|
|
148
|
+
position: absolute;
|
|
149
|
+
top: 100%;
|
|
150
|
+
left: 0;
|
|
151
|
+
gap: 4px;
|
|
152
|
+
align-items: center;
|
|
153
|
+
margin-top: 4px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.form-control-helper span {
|
|
157
|
+
display: block;
|
|
158
|
+
color: var(--Gray-Gray-600, #475066);
|
|
159
|
+
font-size: var(--font-size-xs, 10px);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.invalid-color {
|
|
163
|
+
color: var(--Error-Error-500, #f46a6b) !important;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.disabled-helper {
|
|
167
|
+
color: var(--Gray-Gray-400, #858ea6) !important;
|
|
168
|
+
}
|