@luster-ui/ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PUBLISHING.md +469 -0
- package/README.md +423 -0
- package/dist/cjs/index-Couc0LVo.js +1571 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/cjs/luster-accordion_19.cjs.entry.js +555 -0
- package/dist/cjs/luster-card.cjs.entry.js +25 -0
- package/dist/cjs/luster.cjs.js +24 -0
- package/dist/collection/collection-manifest.json +32 -0
- package/dist/collection/components/luster-accordion/luster-accordion.css +76 -0
- package/dist/collection/components/luster-accordion/luster-accordion.js +160 -0
- package/dist/collection/components/luster-accordion/luster-accordion.stories.js +88 -0
- package/dist/collection/components/luster-activity-item/luster-activity-item.css +102 -0
- package/dist/collection/components/luster-activity-item/luster-activity-item.js +188 -0
- package/dist/collection/components/luster-activity-item/luster-activity-item.stories.js +94 -0
- package/dist/collection/components/luster-alert/luster-alert.css +71 -0
- package/dist/collection/components/luster-alert/luster-alert.js +171 -0
- package/dist/collection/components/luster-alert/luster-alert.stories.js +82 -0
- package/dist/collection/components/luster-article-card/luster-article-card.css +120 -0
- package/dist/collection/components/luster-article-card/luster-article-card.js +192 -0
- package/dist/collection/components/luster-article-card/luster-article-card.stories.js +82 -0
- package/dist/collection/components/luster-badge/luster-badge.css +38 -0
- package/dist/collection/components/luster-badge/luster-badge.js +87 -0
- package/dist/collection/components/luster-badge/luster-badge.stories.js +86 -0
- package/dist/collection/components/luster-button/luster-button.css +121 -0
- package/dist/collection/components/luster-button/luster-button.js +179 -0
- package/dist/collection/components/luster-button/luster-button.stories.js +103 -0
- package/dist/collection/components/luster-card/luster-card.css +29 -0
- package/dist/collection/components/luster-card/luster-card.js +92 -0
- package/dist/collection/components/luster-card/luster-card.stories.js +67 -0
- package/dist/collection/components/luster-checkbox/luster-checkbox.css +42 -0
- package/dist/collection/components/luster-checkbox/luster-checkbox.js +162 -0
- package/dist/collection/components/luster-checkbox/luster-checkbox.stories.js +78 -0
- package/dist/collection/components/luster-color-swatch/luster-color-swatch.css +33 -0
- package/dist/collection/components/luster-color-swatch/luster-color-swatch.js +108 -0
- package/dist/collection/components/luster-color-swatch/luster-color-swatch.stories.js +58 -0
- package/dist/collection/components/luster-feature-quote/luster-feature-quote.css +84 -0
- package/dist/collection/components/luster-feature-quote/luster-feature-quote.js +108 -0
- package/dist/collection/components/luster-feature-quote/luster-feature-quote.stories.js +52 -0
- package/dist/collection/components/luster-hero/luster-hero.css +119 -0
- package/dist/collection/components/luster-hero/luster-hero.js +129 -0
- package/dist/collection/components/luster-hero/luster-hero.stories.js +72 -0
- package/dist/collection/components/luster-input/luster-input.css +72 -0
- package/dist/collection/components/luster-input/luster-input.js +332 -0
- package/dist/collection/components/luster-input/luster-input.stories.js +106 -0
- package/dist/collection/components/luster-modal/luster-modal.css +103 -0
- package/dist/collection/components/luster-modal/luster-modal.js +215 -0
- package/dist/collection/components/luster-modal/luster-modal.stories.js +78 -0
- package/dist/collection/components/luster-navbar/luster-navbar.css +151 -0
- package/dist/collection/components/luster-navbar/luster-navbar.js +87 -0
- package/dist/collection/components/luster-navbar/luster-navbar.stories.js +41 -0
- package/dist/collection/components/luster-profile-card/luster-profile-card.css +89 -0
- package/dist/collection/components/luster-profile-card/luster-profile-card.js +194 -0
- package/dist/collection/components/luster-profile-card/luster-profile-card.stories.js +56 -0
- package/dist/collection/components/luster-resource-table/luster-resource-table.css +141 -0
- package/dist/collection/components/luster-resource-table/luster-resource-table.js +78 -0
- package/dist/collection/components/luster-resource-table/luster-resource-table.stories.js +44 -0
- package/dist/collection/components/luster-sidebar/luster-sidebar.css +152 -0
- package/dist/collection/components/luster-sidebar/luster-sidebar.js +78 -0
- package/dist/collection/components/luster-sidebar/luster-sidebar.stories.js +34 -0
- package/dist/collection/components/luster-stat-card/luster-stat-card.css +82 -0
- package/dist/collection/components/luster-stat-card/luster-stat-card.js +194 -0
- package/dist/collection/components/luster-stat-card/luster-stat-card.stories.js +75 -0
- package/dist/collection/components/luster-tabs/luster-tabs.css +35 -0
- package/dist/collection/components/luster-tabs/luster-tabs.js +116 -0
- package/dist/collection/components/luster-tabs/luster-tabs.stories.js +56 -0
- package/dist/collection/components/luster-toggle/luster-toggle.css +48 -0
- package/dist/collection/components/luster-toggle/luster-toggle.js +120 -0
- package/dist/collection/components/luster-toggle/luster-toggle.stories.js +66 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +1 -0
- package/dist/components/luster-accordion.d.ts +11 -0
- package/dist/components/luster-accordion.js +1 -0
- package/dist/components/luster-activity-item.d.ts +11 -0
- package/dist/components/luster-activity-item.js +1 -0
- package/dist/components/luster-alert.d.ts +11 -0
- package/dist/components/luster-alert.js +1 -0
- package/dist/components/luster-article-card.d.ts +11 -0
- package/dist/components/luster-article-card.js +1 -0
- package/dist/components/luster-badge.d.ts +11 -0
- package/dist/components/luster-badge.js +1 -0
- package/dist/components/luster-badge2.js +1 -0
- package/dist/components/luster-button.d.ts +11 -0
- package/dist/components/luster-button.js +1 -0
- package/dist/components/luster-button2.js +1 -0
- package/dist/components/luster-card.d.ts +11 -0
- package/dist/components/luster-card.js +1 -0
- package/dist/components/luster-checkbox.d.ts +11 -0
- package/dist/components/luster-checkbox.js +1 -0
- package/dist/components/luster-color-swatch.d.ts +11 -0
- package/dist/components/luster-color-swatch.js +1 -0
- package/dist/components/luster-feature-quote.d.ts +11 -0
- package/dist/components/luster-feature-quote.js +1 -0
- package/dist/components/luster-hero.d.ts +11 -0
- package/dist/components/luster-hero.js +1 -0
- package/dist/components/luster-input.d.ts +11 -0
- package/dist/components/luster-input.js +1 -0
- package/dist/components/luster-modal.d.ts +11 -0
- package/dist/components/luster-modal.js +1 -0
- package/dist/components/luster-navbar.d.ts +11 -0
- package/dist/components/luster-navbar.js +1 -0
- package/dist/components/luster-profile-card.d.ts +11 -0
- package/dist/components/luster-profile-card.js +1 -0
- package/dist/components/luster-resource-table.d.ts +11 -0
- package/dist/components/luster-resource-table.js +1 -0
- package/dist/components/luster-sidebar.d.ts +11 -0
- package/dist/components/luster-sidebar.js +1 -0
- package/dist/components/luster-stat-card.d.ts +11 -0
- package/dist/components/luster-stat-card.js +1 -0
- package/dist/components/luster-tabs.d.ts +11 -0
- package/dist/components/luster-tabs.js +1 -0
- package/dist/components/luster-toggle.d.ts +11 -0
- package/dist/components/luster-toggle.js +1 -0
- package/dist/components/luster-toggle2.js +1 -0
- package/dist/esm/index-CeYIN8dN.js +1563 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +10 -0
- package/dist/esm/luster-accordion_19.entry.js +535 -0
- package/dist/esm/luster-card.entry.js +23 -0
- package/dist/esm/luster.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/luster/index.esm.js +0 -0
- package/dist/luster/luster.css +313 -0
- package/dist/luster/luster.esm.js +1 -0
- package/dist/luster/p-3c4ce897.entry.js +1 -0
- package/dist/luster/p-CeYIN8dN.js +2 -0
- package/dist/luster/p-e368ec08.entry.js +1 -0
- package/dist/types/.stencil/luster-accordion/luster-accordion.d.ts +13 -0
- package/dist/types/.stencil/luster-accordion/luster-accordion.stories.d.ts +10 -0
- package/dist/types/.stencil/luster-activity-item/luster-activity-item.d.ts +11 -0
- package/dist/types/.stencil/luster-activity-item/luster-activity-item.stories.d.ts +9 -0
- package/dist/types/.stencil/luster-alert/luster-alert.d.ts +13 -0
- package/dist/types/.stencil/luster-alert/luster-alert.stories.d.ts +10 -0
- package/dist/types/.stencil/luster-article-card/luster-article-card.d.ts +11 -0
- package/dist/types/.stencil/luster-article-card/luster-article-card.stories.d.ts +8 -0
- package/dist/types/.stencil/luster-badge/luster-badge.d.ts +6 -0
- package/dist/types/.stencil/luster-badge/luster-badge.stories.d.ts +12 -0
- package/dist/types/.stencil/luster-button/luster-button.d.ts +12 -0
- package/dist/types/.stencil/luster-button/luster-button.stories.d.ts +13 -0
- package/dist/types/.stencil/luster-card/luster-card.d.ts +6 -0
- package/dist/types/.stencil/luster-card/luster-card.stories.d.ts +10 -0
- package/dist/types/.stencil/luster-checkbox/luster-checkbox.d.ts +13 -0
- package/dist/types/.stencil/luster-checkbox/luster-checkbox.stories.d.ts +10 -0
- package/dist/types/.stencil/luster-color-swatch/luster-color-swatch.d.ts +7 -0
- package/dist/types/.stencil/luster-color-swatch/luster-color-swatch.stories.d.ts +8 -0
- package/dist/types/.stencil/luster-feature-quote/luster-feature-quote.d.ts +7 -0
- package/dist/types/.stencil/luster-feature-quote/luster-feature-quote.stories.d.ts +8 -0
- package/dist/types/.stencil/luster-hero/luster-hero.d.ts +8 -0
- package/dist/types/.stencil/luster-hero/luster-hero.stories.d.ts +8 -0
- package/dist/types/.stencil/luster-input/luster-input.d.ts +25 -0
- package/dist/types/.stencil/luster-input/luster-input.stories.d.ts +9 -0
- package/dist/types/.stencil/luster-modal/luster-modal.d.ts +17 -0
- package/dist/types/.stencil/luster-modal/luster-modal.stories.d.ts +8 -0
- package/dist/types/.stencil/luster-navbar/luster-navbar.d.ts +6 -0
- package/dist/types/.stencil/luster-navbar/luster-navbar.stories.d.ts +6 -0
- package/dist/types/.stencil/luster-profile-card/luster-profile-card.d.ts +11 -0
- package/dist/types/.stencil/luster-profile-card/luster-profile-card.stories.d.ts +7 -0
- package/dist/types/.stencil/luster-resource-table/luster-resource-table.d.ts +14 -0
- package/dist/types/.stencil/luster-resource-table/luster-resource-table.stories.d.ts +6 -0
- package/dist/types/.stencil/luster-sidebar/luster-sidebar.d.ts +9 -0
- package/dist/types/.stencil/luster-sidebar/luster-sidebar.stories.d.ts +8 -0
- package/dist/types/.stencil/luster-stat-card/luster-stat-card.d.ts +11 -0
- package/dist/types/.stencil/luster-stat-card/luster-stat-card.stories.d.ts +8 -0
- package/dist/types/.stencil/luster-tabs/luster-tabs.d.ts +15 -0
- package/dist/types/.stencil/luster-tabs/luster-tabs.stories.d.ts +7 -0
- package/dist/types/.stencil/luster-toggle/luster-toggle.d.ts +11 -0
- package/dist/types/.stencil/luster-toggle/luster-toggle.stories.d.ts +9 -0
- package/dist/types/components.d.ts +1355 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -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 +73 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class DcInput {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.label = '';
|
|
5
|
+
this.placeholder = '';
|
|
6
|
+
this.value = '';
|
|
7
|
+
this.type = 'text';
|
|
8
|
+
this.error = false;
|
|
9
|
+
this.errorMessage = '';
|
|
10
|
+
this.helperText = '';
|
|
11
|
+
this.disabled = false;
|
|
12
|
+
this.readonly = false;
|
|
13
|
+
this.name = '';
|
|
14
|
+
this.focused = false;
|
|
15
|
+
this.innerValue = '';
|
|
16
|
+
this.handleInput = (e) => {
|
|
17
|
+
const target = e.target;
|
|
18
|
+
this.innerValue = target.value;
|
|
19
|
+
this.dcInput.emit(target.value);
|
|
20
|
+
};
|
|
21
|
+
this.handleChange = (e) => {
|
|
22
|
+
const target = e.target;
|
|
23
|
+
this.dcChange.emit(target.value);
|
|
24
|
+
};
|
|
25
|
+
this.handleFocus = () => {
|
|
26
|
+
this.focused = true;
|
|
27
|
+
this.dcFocus.emit();
|
|
28
|
+
};
|
|
29
|
+
this.handleBlur = () => {
|
|
30
|
+
this.focused = false;
|
|
31
|
+
this.dcBlur.emit();
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
componentWillLoad() {
|
|
35
|
+
this.innerValue = this.value;
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
const hasError = this.error;
|
|
39
|
+
const wrapperClass = [
|
|
40
|
+
'input-wrapper',
|
|
41
|
+
hasError ? 'input-wrapper--error' : '',
|
|
42
|
+
this.focused ? 'input-wrapper--focused' : '',
|
|
43
|
+
this.disabled ? 'input-wrapper--disabled' : '',
|
|
44
|
+
].filter(Boolean).join(' ');
|
|
45
|
+
return (h("div", { key: '9973fc5e101503b63bc060f0e0c5f3eba3367543', class: wrapperClass }, this.label && (h("label", { key: '0fcf79b73c6a04ecd40b2d0f1cc85f87cc5fd6ac', class: "input__label" }, this.label)), h("div", { key: '135a4b38ddcaf1a09e968cc629ee3cf59a2261af', class: "input__field-box" }, h("input", { key: '9aa11ddc2c5808ee174f5279b8d5544a3392f389', class: "input__field", type: this.type, placeholder: this.placeholder, value: this.innerValue, disabled: this.disabled, readonly: this.readonly, name: this.name, onInput: this.handleInput, onChange: this.handleChange, onFocus: this.handleFocus, onBlur: this.handleBlur })), hasError && this.errorMessage && (h("span", { key: 'eafa6c55b09c8b8fbcd5cd1f2350993cf7c9199f', class: "input__message input__message--error" }, h("svg", { key: '619cef649ef4e5b82df131844e336a06f3881ad1', width: "12", height: "12", viewBox: "0 0 24 24", fill: "none" }, h("circle", { key: '23c0e89e4c895e2884ff99031c0f282fa8435e96', cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "2" }), h("line", { key: '377ffaea6f80ee4806ad824fd0de312d94fd0f52', x1: "12", y1: "8", x2: "12", y2: "12", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), h("line", { key: 'd1d67467a4f4f4a97b4da3822d536031ad63112a', x1: "12", y1: "16", x2: "12.01", y2: "16", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" })), this.errorMessage)), !hasError && this.helperText && (h("span", { key: 'ac62c67973896a90db17efd5c0029695a1a7fe79', class: "input__message" }, this.helperText))));
|
|
46
|
+
}
|
|
47
|
+
static get is() { return "luster-input"; }
|
|
48
|
+
static get encapsulation() { return "shadow"; }
|
|
49
|
+
static get originalStyleUrls() {
|
|
50
|
+
return {
|
|
51
|
+
"$": ["luster-input.css"]
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
static get styleUrls() {
|
|
55
|
+
return {
|
|
56
|
+
"$": ["luster-input.css"]
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
static get properties() {
|
|
60
|
+
return {
|
|
61
|
+
"label": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"mutable": false,
|
|
64
|
+
"complexType": {
|
|
65
|
+
"original": "string",
|
|
66
|
+
"resolved": "string",
|
|
67
|
+
"references": {}
|
|
68
|
+
},
|
|
69
|
+
"required": false,
|
|
70
|
+
"optional": false,
|
|
71
|
+
"docs": {
|
|
72
|
+
"tags": [],
|
|
73
|
+
"text": ""
|
|
74
|
+
},
|
|
75
|
+
"getter": false,
|
|
76
|
+
"setter": false,
|
|
77
|
+
"reflect": false,
|
|
78
|
+
"attribute": "label",
|
|
79
|
+
"defaultValue": "''"
|
|
80
|
+
},
|
|
81
|
+
"placeholder": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"mutable": false,
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "string",
|
|
86
|
+
"resolved": "string",
|
|
87
|
+
"references": {}
|
|
88
|
+
},
|
|
89
|
+
"required": false,
|
|
90
|
+
"optional": false,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": ""
|
|
94
|
+
},
|
|
95
|
+
"getter": false,
|
|
96
|
+
"setter": false,
|
|
97
|
+
"reflect": false,
|
|
98
|
+
"attribute": "placeholder",
|
|
99
|
+
"defaultValue": "''"
|
|
100
|
+
},
|
|
101
|
+
"value": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"mutable": false,
|
|
104
|
+
"complexType": {
|
|
105
|
+
"original": "string",
|
|
106
|
+
"resolved": "string",
|
|
107
|
+
"references": {}
|
|
108
|
+
},
|
|
109
|
+
"required": false,
|
|
110
|
+
"optional": false,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": ""
|
|
114
|
+
},
|
|
115
|
+
"getter": false,
|
|
116
|
+
"setter": false,
|
|
117
|
+
"reflect": false,
|
|
118
|
+
"attribute": "value",
|
|
119
|
+
"defaultValue": "''"
|
|
120
|
+
},
|
|
121
|
+
"type": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"mutable": false,
|
|
124
|
+
"complexType": {
|
|
125
|
+
"original": "string",
|
|
126
|
+
"resolved": "string",
|
|
127
|
+
"references": {}
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"optional": false,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": ""
|
|
134
|
+
},
|
|
135
|
+
"getter": false,
|
|
136
|
+
"setter": false,
|
|
137
|
+
"reflect": false,
|
|
138
|
+
"attribute": "type",
|
|
139
|
+
"defaultValue": "'text'"
|
|
140
|
+
},
|
|
141
|
+
"error": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"mutable": false,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "boolean",
|
|
146
|
+
"resolved": "boolean",
|
|
147
|
+
"references": {}
|
|
148
|
+
},
|
|
149
|
+
"required": false,
|
|
150
|
+
"optional": false,
|
|
151
|
+
"docs": {
|
|
152
|
+
"tags": [],
|
|
153
|
+
"text": ""
|
|
154
|
+
},
|
|
155
|
+
"getter": false,
|
|
156
|
+
"setter": false,
|
|
157
|
+
"reflect": false,
|
|
158
|
+
"attribute": "error",
|
|
159
|
+
"defaultValue": "false"
|
|
160
|
+
},
|
|
161
|
+
"errorMessage": {
|
|
162
|
+
"type": "string",
|
|
163
|
+
"mutable": false,
|
|
164
|
+
"complexType": {
|
|
165
|
+
"original": "string",
|
|
166
|
+
"resolved": "string",
|
|
167
|
+
"references": {}
|
|
168
|
+
},
|
|
169
|
+
"required": false,
|
|
170
|
+
"optional": false,
|
|
171
|
+
"docs": {
|
|
172
|
+
"tags": [],
|
|
173
|
+
"text": ""
|
|
174
|
+
},
|
|
175
|
+
"getter": false,
|
|
176
|
+
"setter": false,
|
|
177
|
+
"reflect": false,
|
|
178
|
+
"attribute": "error-message",
|
|
179
|
+
"defaultValue": "''"
|
|
180
|
+
},
|
|
181
|
+
"helperText": {
|
|
182
|
+
"type": "string",
|
|
183
|
+
"mutable": false,
|
|
184
|
+
"complexType": {
|
|
185
|
+
"original": "string",
|
|
186
|
+
"resolved": "string",
|
|
187
|
+
"references": {}
|
|
188
|
+
},
|
|
189
|
+
"required": false,
|
|
190
|
+
"optional": false,
|
|
191
|
+
"docs": {
|
|
192
|
+
"tags": [],
|
|
193
|
+
"text": ""
|
|
194
|
+
},
|
|
195
|
+
"getter": false,
|
|
196
|
+
"setter": false,
|
|
197
|
+
"reflect": false,
|
|
198
|
+
"attribute": "helper-text",
|
|
199
|
+
"defaultValue": "''"
|
|
200
|
+
},
|
|
201
|
+
"disabled": {
|
|
202
|
+
"type": "boolean",
|
|
203
|
+
"mutable": false,
|
|
204
|
+
"complexType": {
|
|
205
|
+
"original": "boolean",
|
|
206
|
+
"resolved": "boolean",
|
|
207
|
+
"references": {}
|
|
208
|
+
},
|
|
209
|
+
"required": false,
|
|
210
|
+
"optional": false,
|
|
211
|
+
"docs": {
|
|
212
|
+
"tags": [],
|
|
213
|
+
"text": ""
|
|
214
|
+
},
|
|
215
|
+
"getter": false,
|
|
216
|
+
"setter": false,
|
|
217
|
+
"reflect": false,
|
|
218
|
+
"attribute": "disabled",
|
|
219
|
+
"defaultValue": "false"
|
|
220
|
+
},
|
|
221
|
+
"readonly": {
|
|
222
|
+
"type": "boolean",
|
|
223
|
+
"mutable": false,
|
|
224
|
+
"complexType": {
|
|
225
|
+
"original": "boolean",
|
|
226
|
+
"resolved": "boolean",
|
|
227
|
+
"references": {}
|
|
228
|
+
},
|
|
229
|
+
"required": false,
|
|
230
|
+
"optional": false,
|
|
231
|
+
"docs": {
|
|
232
|
+
"tags": [],
|
|
233
|
+
"text": ""
|
|
234
|
+
},
|
|
235
|
+
"getter": false,
|
|
236
|
+
"setter": false,
|
|
237
|
+
"reflect": false,
|
|
238
|
+
"attribute": "readonly",
|
|
239
|
+
"defaultValue": "false"
|
|
240
|
+
},
|
|
241
|
+
"name": {
|
|
242
|
+
"type": "string",
|
|
243
|
+
"mutable": false,
|
|
244
|
+
"complexType": {
|
|
245
|
+
"original": "string",
|
|
246
|
+
"resolved": "string",
|
|
247
|
+
"references": {}
|
|
248
|
+
},
|
|
249
|
+
"required": false,
|
|
250
|
+
"optional": false,
|
|
251
|
+
"docs": {
|
|
252
|
+
"tags": [],
|
|
253
|
+
"text": ""
|
|
254
|
+
},
|
|
255
|
+
"getter": false,
|
|
256
|
+
"setter": false,
|
|
257
|
+
"reflect": false,
|
|
258
|
+
"attribute": "name",
|
|
259
|
+
"defaultValue": "''"
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
static get states() {
|
|
264
|
+
return {
|
|
265
|
+
"focused": {},
|
|
266
|
+
"innerValue": {}
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
static get events() {
|
|
270
|
+
return [{
|
|
271
|
+
"method": "dcChange",
|
|
272
|
+
"name": "dcChange",
|
|
273
|
+
"bubbles": true,
|
|
274
|
+
"cancelable": true,
|
|
275
|
+
"composed": true,
|
|
276
|
+
"docs": {
|
|
277
|
+
"tags": [],
|
|
278
|
+
"text": ""
|
|
279
|
+
},
|
|
280
|
+
"complexType": {
|
|
281
|
+
"original": "string",
|
|
282
|
+
"resolved": "string",
|
|
283
|
+
"references": {}
|
|
284
|
+
}
|
|
285
|
+
}, {
|
|
286
|
+
"method": "dcInput",
|
|
287
|
+
"name": "dcInput",
|
|
288
|
+
"bubbles": true,
|
|
289
|
+
"cancelable": true,
|
|
290
|
+
"composed": true,
|
|
291
|
+
"docs": {
|
|
292
|
+
"tags": [],
|
|
293
|
+
"text": ""
|
|
294
|
+
},
|
|
295
|
+
"complexType": {
|
|
296
|
+
"original": "string",
|
|
297
|
+
"resolved": "string",
|
|
298
|
+
"references": {}
|
|
299
|
+
}
|
|
300
|
+
}, {
|
|
301
|
+
"method": "dcFocus",
|
|
302
|
+
"name": "dcFocus",
|
|
303
|
+
"bubbles": true,
|
|
304
|
+
"cancelable": true,
|
|
305
|
+
"composed": true,
|
|
306
|
+
"docs": {
|
|
307
|
+
"tags": [],
|
|
308
|
+
"text": ""
|
|
309
|
+
},
|
|
310
|
+
"complexType": {
|
|
311
|
+
"original": "void",
|
|
312
|
+
"resolved": "void",
|
|
313
|
+
"references": {}
|
|
314
|
+
}
|
|
315
|
+
}, {
|
|
316
|
+
"method": "dcBlur",
|
|
317
|
+
"name": "dcBlur",
|
|
318
|
+
"bubbles": true,
|
|
319
|
+
"cancelable": true,
|
|
320
|
+
"composed": true,
|
|
321
|
+
"docs": {
|
|
322
|
+
"tags": [],
|
|
323
|
+
"text": ""
|
|
324
|
+
},
|
|
325
|
+
"complexType": {
|
|
326
|
+
"original": "void",
|
|
327
|
+
"resolved": "void",
|
|
328
|
+
"references": {}
|
|
329
|
+
}
|
|
330
|
+
}];
|
|
331
|
+
}
|
|
332
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Foundations/Input',
|
|
4
|
+
tags: ['autodocs'],
|
|
5
|
+
parameters: {
|
|
6
|
+
docs: {
|
|
7
|
+
description: {
|
|
8
|
+
component: 'Campo de texto com suporte a label, placeholder, mensagem de erro e helper text. Props: `label`, `placeholder`, `value`, `type`, `error`, `error-message`, `helper-text`, `disabled`, `readonly`.',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
label: { control: 'text', description: 'Label do campo' },
|
|
14
|
+
placeholder: { control: 'text', description: 'Placeholder' },
|
|
15
|
+
value: { control: 'text', description: 'Valor inicial' },
|
|
16
|
+
type: {
|
|
17
|
+
control: 'select',
|
|
18
|
+
options: ['text', 'email', 'password', 'number', 'search'],
|
|
19
|
+
description: 'Tipo do input',
|
|
20
|
+
table: { defaultValue: { summary: 'text' } },
|
|
21
|
+
},
|
|
22
|
+
error: {
|
|
23
|
+
control: 'boolean',
|
|
24
|
+
description: 'Estado de erro',
|
|
25
|
+
table: { defaultValue: { summary: 'false' } },
|
|
26
|
+
},
|
|
27
|
+
errorMessage: { control: 'text', description: 'Mensagem de erro' },
|
|
28
|
+
helperText: { control: 'text', description: 'Texto de ajuda' },
|
|
29
|
+
disabled: {
|
|
30
|
+
control: 'boolean',
|
|
31
|
+
description: 'Desabilita o campo',
|
|
32
|
+
table: { defaultValue: { summary: 'false' } },
|
|
33
|
+
},
|
|
34
|
+
readonly: {
|
|
35
|
+
control: 'boolean',
|
|
36
|
+
description: 'Somente leitura',
|
|
37
|
+
table: { defaultValue: { summary: 'false' } },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
args: {
|
|
41
|
+
label: 'Email',
|
|
42
|
+
placeholder: 'you@example.com',
|
|
43
|
+
value: '',
|
|
44
|
+
type: 'text',
|
|
45
|
+
error: false,
|
|
46
|
+
errorMessage: '',
|
|
47
|
+
helperText: '',
|
|
48
|
+
disabled: false,
|
|
49
|
+
readonly: false,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
export default meta;
|
|
53
|
+
const render = (args) => html `
|
|
54
|
+
<luster-input
|
|
55
|
+
label="${args.label}"
|
|
56
|
+
placeholder="${args.placeholder}"
|
|
57
|
+
value="${args.value}"
|
|
58
|
+
type="${args.type}"
|
|
59
|
+
?error="${args.error}"
|
|
60
|
+
error-message="${args.errorMessage}"
|
|
61
|
+
helper-text="${args.helperText}"
|
|
62
|
+
?disabled="${args.disabled}"
|
|
63
|
+
?readonly="${args.readonly}"
|
|
64
|
+
></luster-input>
|
|
65
|
+
`;
|
|
66
|
+
export const Default = {
|
|
67
|
+
args: { label: 'Username', placeholder: 'Enter your username' },
|
|
68
|
+
render,
|
|
69
|
+
};
|
|
70
|
+
export const WithHelperText = {
|
|
71
|
+
args: {
|
|
72
|
+
label: 'Email',
|
|
73
|
+
placeholder: 'you@example.com',
|
|
74
|
+
helperText: 'We will never share your email.',
|
|
75
|
+
},
|
|
76
|
+
render,
|
|
77
|
+
};
|
|
78
|
+
export const WithError = {
|
|
79
|
+
args: {
|
|
80
|
+
label: 'Password',
|
|
81
|
+
placeholder: '••••••••',
|
|
82
|
+
type: 'password',
|
|
83
|
+
error: true,
|
|
84
|
+
errorMessage: 'Password must be at least 8 characters.',
|
|
85
|
+
},
|
|
86
|
+
render,
|
|
87
|
+
};
|
|
88
|
+
export const Disabled = {
|
|
89
|
+
args: {
|
|
90
|
+
label: 'Read-only field',
|
|
91
|
+
value: 'Cannot edit this',
|
|
92
|
+
disabled: true,
|
|
93
|
+
},
|
|
94
|
+
render,
|
|
95
|
+
};
|
|
96
|
+
export const AllStates = {
|
|
97
|
+
name: 'All States',
|
|
98
|
+
render: () => html `
|
|
99
|
+
<div style="display:flex;flex-direction:column;gap:1.5rem;width:320px;">
|
|
100
|
+
<luster-input label="Default" placeholder="Enter text..."></luster-input>
|
|
101
|
+
<luster-input label="With helper" placeholder="Enter email" helper-text="We will never share your email."></luster-input>
|
|
102
|
+
<luster-input label="Error state" placeholder="Enter value" ?error="${true}" error-message="This field is required."></luster-input>
|
|
103
|
+
<luster-input label="Disabled" value="Disabled value" ?disabled="${true}"></luster-input>
|
|
104
|
+
</div>
|
|
105
|
+
`,
|
|
106
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
:host { display: block; }
|
|
2
|
+
|
|
3
|
+
.modal-overlay {
|
|
4
|
+
position: fixed;
|
|
5
|
+
inset: 0;
|
|
6
|
+
background: var(--dc-overlay-modal);
|
|
7
|
+
backdrop-filter: blur(12px);
|
|
8
|
+
-webkit-backdrop-filter: blur(12px);
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
z-index: 1000;
|
|
13
|
+
padding: var(--dc-space-6);
|
|
14
|
+
animation: fadeIn 0.2s ease-out;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.modal {
|
|
18
|
+
background: var(--dc-surface-container-highest);
|
|
19
|
+
border-radius: var(--dc-round-5);
|
|
20
|
+
box-shadow: var(--dc-shadow-xl);
|
|
21
|
+
border: 1px solid var(--dc-border-default);
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
animation: scaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
max-height: 90vh;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.modal--sm { width: 380px; }
|
|
30
|
+
.modal--md { width: 520px; }
|
|
31
|
+
.modal--lg { width: 680px; }
|
|
32
|
+
|
|
33
|
+
.modal__header {
|
|
34
|
+
padding: var(--dc-space-6);
|
|
35
|
+
padding-bottom: var(--dc-space-4);
|
|
36
|
+
position: relative;
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
gap: var(--dc-space-2);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.modal__title {
|
|
43
|
+
font-family: var(--dc-font-display);
|
|
44
|
+
font-size: var(--dc-headline-sm);
|
|
45
|
+
font-weight: 700;
|
|
46
|
+
color: var(--dc-on-surface);
|
|
47
|
+
letter-spacing: var(--dc-tracking-tight);
|
|
48
|
+
margin: 0;
|
|
49
|
+
padding-right: var(--dc-space-8);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.modal__subtitle {
|
|
53
|
+
font-size: var(--dc-body-sm);
|
|
54
|
+
color: var(--dc-on-surface-variant);
|
|
55
|
+
margin: 0;
|
|
56
|
+
line-height: 1.5;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.modal__close {
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: var(--dc-space-5);
|
|
62
|
+
right: var(--dc-space-5);
|
|
63
|
+
width: 32px;
|
|
64
|
+
height: 32px;
|
|
65
|
+
background: var(--dc-close-bg);
|
|
66
|
+
border: none;
|
|
67
|
+
border-radius: var(--dc-round-full);
|
|
68
|
+
color: var(--dc-on-surface-variant);
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
transition: all var(--dc-transition-fast);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.modal__close:hover {
|
|
77
|
+
background: var(--dc-close-hover);
|
|
78
|
+
color: var(--dc-on-surface);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.modal__body {
|
|
82
|
+
padding: var(--dc-space-4) var(--dc-space-6);
|
|
83
|
+
flex: 1;
|
|
84
|
+
overflow-y: auto;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.modal__footer {
|
|
88
|
+
padding: var(--dc-space-4) var(--dc-space-6) var(--dc-space-6);
|
|
89
|
+
display: flex;
|
|
90
|
+
justify-content: flex-end;
|
|
91
|
+
gap: var(--dc-space-3);
|
|
92
|
+
border-top: 1px solid var(--dc-border-faint);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@keyframes fadeIn {
|
|
96
|
+
from { opacity: 0; }
|
|
97
|
+
to { opacity: 1; }
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@keyframes scaleIn {
|
|
101
|
+
from { opacity: 0; transform: scale(0.94) translateY(8px); }
|
|
102
|
+
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
103
|
+
}
|