-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinput.html
200 lines (154 loc) · 6.58 KB
/
input.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>input</title>
<script type="module" src="https://js.arcgis.com/calcite-components/1.0.0-beta.91/calcite.esm.js"></script>
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/calcite-components/1.0.0-beta.91/calcite.css" />
<style>
h1 {
margin-bottom: 5rem;
}
h2 {
margin: 3rem 0rem;
}
body {
font-family: var(--calcite-sans-family);
font-size: var(--calcite-font-size-0);
color: var(--calcite-ui-text-1);
max-width: 1024px;
min-width: 280px;
width: 70vw;
padding: 0 var(--calcite-spacing-double);
margin: 0 auto;
background-color: var(--calcite-ui-background);
}
/* Theme Switcher */
#theme-label {
position: fixed;
top: 20px;
right: 20px;
z-index: 2;
background-color: var(--calcite-ui-background);
border: 1px solid;
border-color: var(--calcite-ui-border-1);
border-radius: var(--calcite-border-radius);
margin: 0;
padding: 10px;
}
#theme-label label {
margin: 0;
}
</style>
</head>
<body>
<main>
<!-- calcite-switch -->
<div id="theme-label">
<calcite-label layout="inline">
Toggle theme
<calcite-switch id="theme-switch"></calcite-switch>
</calcite-label>
</div>
<h1><code>input</code></h1>
<h2>Test 1. Standard Input</h2>
<h3>Small:</h3>
<calcite-input scale="s" label="Small standard input" placeholder="Search"></calcite-input>
<br>
<h3>Medium:</h3>
<calcite-input scale="m" label="Medium standard input" placeholder="Search"></calcite-input>
<br>
<h3>Large:</h3>
<calcite-input scale="l" label="Large standard input" placeholder="Search"></calcite-input>
<br>
<h3>Icon:</h3>
<calcite-input label="Standard input with icon" icon="search" placeholder="Search"></calcite-input>
<br>
<h3>Prefix and Suffix text:</h3>
<calcite-input label="Standard input with prefix and suffix" prefix-text="Prefix" suffix-text="Suffix" placeholder="Search"></calcite-input>
<h2>Test 2. Number Input</h2>
<h3>Vertical:</h3>
<calcite-input label="Number input" type="number"></calcite-input>
<br>
<h3>Vertical with Prefix and Suffix text:</h3>
<calcite-input label="Number input with prefix and suffix" prefix-text="Prefix" suffix-text="Suffix" type="number"></calcite-input>
<br>
<h3>Horizontal:</h3>
<calcite-input label="Horizontal number input" number-button-type="horizontal" type="number"></calcite-input>
<br>
<h3>Horizontal with Prefix and Suffix text:</h3>
<calcite-input label="Horizontal number input with prefix and suffix" number-button-type="horizontal" prefix-text="Prefix" suffix-text="Suffix" type="number"></calcite-input>
<h2>Test 3. Color Picker Input</h2>
<h3>Small:</h3>
<calcite-input label="Color picker small scale input" scale="s" type="color" value="#FF0000"></calcite-input>
<h3>Medium:</h3>
<calcite-input label="Color picker medium scale input" scale="m" type="color" value="#FF0000"></calcite-input>
<h3>Large:</h3>
<calcite-input label="Color picker large scale input" scale="l" type="color" value="#FF0000"></calcite-input>
<h2>Test 4. File upload Input</h2>
<calcite-input label="File upload input" type="file"></calcite-input>
<h2>Test 5. Text area Input </h2>
<calcite-input label="Text area input" type="textarea"></calcite-input>
<h2>Test 6. Disabled Input</h2>
<calcite-input label="Disabled input" disabled placeholder="Disabled input"></calcite-input>
<h2>Test 7. Input with Messages</h2>
<h3>Info Message:</h3>
<calcite-label status="idle">
<calcite-input type="text" placeholder="Info message"> </calcite-input>
<calcite-input-message active icon> Info message </calcite-input-message>
</calcite-label>
<br>
<h3>Success Message:</h3>
<calcite-label status="valid">
<calcite-input type="text" placeholder="Success message"></calcite-input>
<calcite-input-message active icon> Success message </calcite-input-message>
</calcite-label>
<br>
<h3>Warning Message:</h3>
<calcite-label>
<calcite-input type="text" placeholder="Warning message"></calcite-input>
<calcite-input-message active icon="exclamation-mark-triangle"> Warning message </calcite-input-message>
</calcite-label>
<h2>Test 8. Input with Error States</h2>
<h3>Standard Input:</h3>
<calcite-label status="invalid">Standard input error message
<calcite-input type="text" placeholder="Standard Error Message"></calcite-input>
<calcite-input-message active icon> Error message </calcite-input-message>
</calcite-label>
<br>
<h3>Prefix and Suffix Input:</h3>
<calcite-label status="invalid">Prefix and Suffix input error message
<calcite-input type="text" placeholder="Prefix and Suffix Error Message" prefix-text="Prefix" suffix-text="Suffix"></calcite-input>
<calcite-input-message active icon> Error message </calcite-input-message>
</calcite-label>
<br>
<h3>Color Input:</h3>
<calcite-label status="invalid">Color input error message
<calcite-input type="color" value="#0000ff"></calcite-input>
<calcite-input-message active icon> Error message </calcite-input-message>
</calcite-label>
<br>
<h3>Number Input:</h3>
<calcite-label status="invalid">Number input error message
<calcite-input type="number" placeholder="Number Error Message" value="123" step="1"></calcite-input>
<calcite-input-message active icon> Error message </calcite-input-message>
</calcite-label>
<br>
<h3>File upload:</h3>
<calcite-label status="invalid">File upload error message
<calcite-input type="file" placeholder="No file chosen"></calcite-input>
<calcite-input-message active icon> Error message </calcite-input-message>
</calcite-label>
</main>
</body>
<script>
window.onload = () => {
// Theme Switcher
const themeSwitch = document.getElementById("theme-switch");
themeSwitch.addEventListener("calciteSwitchChange", () => {
document.body.classList.toggle("calcite-theme-dark");
});
};
</script>
</html>