@spectrum-web-components/textfield 0.11.2 → 0.11.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/textfield",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"lit-html"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@spectrum-web-components/base": "^0.5.
|
|
48
|
-
"@spectrum-web-components/help-text": "^0.1.
|
|
49
|
-
"@spectrum-web-components/icon": "^0.11.
|
|
50
|
-
"@spectrum-web-components/icons-ui": "^0.8.
|
|
51
|
-
"@spectrum-web-components/icons-workflow": "^0.8.
|
|
52
|
-
"@spectrum-web-components/shared": "^0.13.
|
|
47
|
+
"@spectrum-web-components/base": "^0.5.4",
|
|
48
|
+
"@spectrum-web-components/help-text": "^0.1.4",
|
|
49
|
+
"@spectrum-web-components/icon": "^0.11.5",
|
|
50
|
+
"@spectrum-web-components/icons-ui": "^0.8.5",
|
|
51
|
+
"@spectrum-web-components/icons-workflow": "^0.8.5",
|
|
52
|
+
"@spectrum-web-components/shared": "^0.13.6",
|
|
53
53
|
"tslib": "^2.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"sideEffects": [
|
|
61
61
|
"./sp-*.js"
|
|
62
62
|
],
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "caf12727e7f91dcf961e1fadacc727eea9ece27b"
|
|
64
64
|
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2018 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { html } from '@spectrum-web-components/base';
|
|
13
|
+
import '../sp-textfield.js';
|
|
14
|
+
import '@spectrum-web-components/field-label/sp-field-label.js';
|
|
15
|
+
import '@spectrum-web-components/help-text/sp-help-text.js';
|
|
16
|
+
export default {
|
|
17
|
+
component: 'sp-textfield',
|
|
18
|
+
title: 'Textarea',
|
|
19
|
+
};
|
|
20
|
+
export const Default = () => {
|
|
21
|
+
return html `
|
|
22
|
+
<sp-textfield
|
|
23
|
+
multiline
|
|
24
|
+
label="Enter your life story"
|
|
25
|
+
placeholder="Enter your life story"
|
|
26
|
+
></sp-textfield>
|
|
27
|
+
<sp-textfield
|
|
28
|
+
multiline
|
|
29
|
+
label="Enter your life story"
|
|
30
|
+
disabled
|
|
31
|
+
placeholder="Enter your life story"
|
|
32
|
+
></sp-textfield>
|
|
33
|
+
<sp-textfield
|
|
34
|
+
multiline
|
|
35
|
+
label="Enter your life story"
|
|
36
|
+
pattern="[\\w\\s]+"
|
|
37
|
+
required
|
|
38
|
+
valid
|
|
39
|
+
value="A valid input"
|
|
40
|
+
placeholder="Enter your life story"
|
|
41
|
+
></sp-textfield>
|
|
42
|
+
<sp-textfield
|
|
43
|
+
multiline
|
|
44
|
+
label="Enter your life story"
|
|
45
|
+
required
|
|
46
|
+
valid
|
|
47
|
+
value="A valid input"
|
|
48
|
+
disabled
|
|
49
|
+
placeholder="Enter your life story"
|
|
50
|
+
></sp-textfield>
|
|
51
|
+
<sp-textfield
|
|
52
|
+
multiline
|
|
53
|
+
label="Enter your life story"
|
|
54
|
+
pattern="[\\d]+"
|
|
55
|
+
required
|
|
56
|
+
value="Not a valid input"
|
|
57
|
+
placeholder="Enter your life story"
|
|
58
|
+
></sp-textfield>
|
|
59
|
+
<sp-textfield
|
|
60
|
+
multiline
|
|
61
|
+
label="Enter your life story"
|
|
62
|
+
pattern="[\\d]+"
|
|
63
|
+
invalid
|
|
64
|
+
required
|
|
65
|
+
value="Not a valid input"
|
|
66
|
+
disabled
|
|
67
|
+
placeholder="Enter your life story"
|
|
68
|
+
></sp-textfield>
|
|
69
|
+
`;
|
|
70
|
+
};
|
|
71
|
+
export const quiet = () => html `
|
|
72
|
+
<sp-field-label for="story">Enter your life story...</sp-field-label>
|
|
73
|
+
<sp-textfield
|
|
74
|
+
autofocus
|
|
75
|
+
multiline
|
|
76
|
+
id="story"
|
|
77
|
+
quiet
|
|
78
|
+
placeholder="Enter your life story"
|
|
79
|
+
></sp-textfield>
|
|
80
|
+
`;
|
|
81
|
+
export const grows = () => html `
|
|
82
|
+
<sp-field-label for="story">Enter your life story...</sp-field-label>
|
|
83
|
+
<sp-textfield
|
|
84
|
+
multiline
|
|
85
|
+
id="story"
|
|
86
|
+
value="Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt."
|
|
87
|
+
grows
|
|
88
|
+
placeholder="Enter your life story"
|
|
89
|
+
></sp-textfield>
|
|
90
|
+
`;
|
|
91
|
+
export const growsEmpty = () => html `
|
|
92
|
+
<sp-field-label for="empty">
|
|
93
|
+
This textfield hasn't been used yet
|
|
94
|
+
</sp-field-label>
|
|
95
|
+
<sp-textfield
|
|
96
|
+
multiline
|
|
97
|
+
id="empty"
|
|
98
|
+
grows
|
|
99
|
+
placeholder="You can type here"
|
|
100
|
+
autofocus
|
|
101
|
+
>
|
|
102
|
+
<sp-help-text slot="help-text">
|
|
103
|
+
Even empty Textfield display correctly while waiting for content.
|
|
104
|
+
</sp-help-text>
|
|
105
|
+
</sp-textfield>
|
|
106
|
+
`;
|
|
107
|
+
export const growsWithLargeWords = () => html `
|
|
108
|
+
<sp-field-label for="story">
|
|
109
|
+
Enter your life story with very long words...
|
|
110
|
+
</sp-field-label>
|
|
111
|
+
<sp-textfield
|
|
112
|
+
multiline
|
|
113
|
+
id="story"
|
|
114
|
+
value="Sed utperspiciatisundeomnisistenatuserrorsitvoluptatemaccusantiumdoloremquelaudantium,totamemaperiam, eaque ipsa quae ab illo inventore veritatis etquasiarchitectobeataevitaedictasuntexplicabo. Nemo enimipsamvoluptatemquiavoluptassitaspernaturautoditautfugitsedquiaconsequunturmagnidoloreseosquirationevoluptatemsequinesciunt."
|
|
115
|
+
grows
|
|
116
|
+
placeholder="Enter your life story"
|
|
117
|
+
></sp-textfield>
|
|
118
|
+
`;
|
|
119
|
+
export const readonly = () => html `
|
|
120
|
+
<sp-textfield
|
|
121
|
+
multiline
|
|
122
|
+
label="Enter your life story"
|
|
123
|
+
value="A readonly textarea"
|
|
124
|
+
readonly
|
|
125
|
+
placeholder="Enter your life story"
|
|
126
|
+
></sp-textfield>
|
|
127
|
+
`;
|
|
128
|
+
export const resizeControls = () => html `
|
|
129
|
+
<sp-textfield
|
|
130
|
+
multiline
|
|
131
|
+
style="resize: none;"
|
|
132
|
+
label="No resize control"
|
|
133
|
+
placeholder="No resize control"
|
|
134
|
+
></sp-textfield>
|
|
135
|
+
|
|
136
|
+
<sp-textfield
|
|
137
|
+
multiline
|
|
138
|
+
style="resize: vertical;"
|
|
139
|
+
label="Vertical resize control"
|
|
140
|
+
placeholder="Vertical resize control"
|
|
141
|
+
></sp-textfield>
|
|
142
|
+
|
|
143
|
+
<sp-textfield
|
|
144
|
+
multiline
|
|
145
|
+
style="resize: horizontal;"
|
|
146
|
+
label="Horizontal resize control"
|
|
147
|
+
placeholder="Horizontal resize control"
|
|
148
|
+
></sp-textfield>
|
|
149
|
+
`;
|
|
150
|
+
export const sized = () => html `
|
|
151
|
+
<sp-field-label for="sized">
|
|
152
|
+
This textfield hasn't been used yet
|
|
153
|
+
</sp-field-label>
|
|
154
|
+
<sp-textfield
|
|
155
|
+
multiline
|
|
156
|
+
id="sized"
|
|
157
|
+
placeholder="You can type here"
|
|
158
|
+
autofocus
|
|
159
|
+
style="width: 400px"
|
|
160
|
+
>
|
|
161
|
+
<sp-help-text slot="help-text">
|
|
162
|
+
Even empty Textfield display correctly while waiting for content.
|
|
163
|
+
</sp-help-text>
|
|
164
|
+
</sp-textfield>
|
|
165
|
+
`;
|
|
166
|
+
//# sourceMappingURL=textarea.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.stories.js","sourceRoot":"","sources":["textarea.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AAErE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,wDAAwD,CAAC;AAChE,OAAO,oDAAoD,CAAC;AAE5D,eAAe;IACX,SAAS,EAAE,cAAc;IACzB,KAAK,EAAE,UAAU;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,GAAmB,EAAE;IACxC,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgDV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;;;;;;;;CAS9C,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;;;;;;;;CAS9C,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;CAenD,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;CAW5D,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;;;;;;;CAQjD,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;CAqBvD,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;CAe9C,CAAC","sourcesContent":["/*\nCopyright 2018 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '../sp-textfield.js';\nimport '@spectrum-web-components/field-label/sp-field-label.js';\nimport '@spectrum-web-components/help-text/sp-help-text.js';\n\nexport default {\n component: 'sp-textfield',\n title: 'Textarea',\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n disabled\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n pattern=\"[\\\\w\\\\s]+\"\n required\n valid\n value=\"A valid input\"\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n required\n valid\n value=\"A valid input\"\n disabled\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n pattern=\"[\\\\d]+\"\n required\n value=\"Not a valid input\"\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n pattern=\"[\\\\d]+\"\n invalid\n required\n value=\"Not a valid input\"\n disabled\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n `;\n};\n\nexport const quiet = (): TemplateResult => html`\n <sp-field-label for=\"story\">Enter your life story...</sp-field-label>\n <sp-textfield\n autofocus\n multiline\n id=\"story\"\n quiet\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n`;\n\nexport const grows = (): TemplateResult => html`\n <sp-field-label for=\"story\">Enter your life story...</sp-field-label>\n <sp-textfield\n multiline\n id=\"story\"\n value=\"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.\"\n grows\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n`;\n\nexport const growsEmpty = (): TemplateResult => html`\n <sp-field-label for=\"empty\">\n This textfield hasn't been used yet\n </sp-field-label>\n <sp-textfield\n multiline\n id=\"empty\"\n grows\n placeholder=\"You can type here\"\n autofocus\n >\n <sp-help-text slot=\"help-text\">\n Even empty Textfield display correctly while waiting for content.\n </sp-help-text>\n </sp-textfield>\n`;\n\nexport const growsWithLargeWords = (): TemplateResult => html`\n <sp-field-label for=\"story\">\n Enter your life story with very long words...\n </sp-field-label>\n <sp-textfield\n multiline\n id=\"story\"\n value=\"Sed utperspiciatisundeomnisistenatuserrorsitvoluptatemaccusantiumdoloremquelaudantium,totamemaperiam, eaque ipsa quae ab illo inventore veritatis etquasiarchitectobeataevitaedictasuntexplicabo. Nemo enimipsamvoluptatemquiavoluptassitaspernaturautoditautfugitsedquiaconsequunturmagnidoloreseosquirationevoluptatemsequinesciunt.\"\n grows\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n`;\n\nexport const readonly = (): TemplateResult => html`\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n value=\"A readonly textarea\"\n readonly\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n`;\n\nexport const resizeControls = (): TemplateResult => html`\n <sp-textfield\n multiline\n style=\"resize: none;\"\n label=\"No resize control\"\n placeholder=\"No resize control\"\n ></sp-textfield>\n\n <sp-textfield\n multiline\n style=\"resize: vertical;\"\n label=\"Vertical resize control\"\n placeholder=\"Vertical resize control\"\n ></sp-textfield>\n\n <sp-textfield\n multiline\n style=\"resize: horizontal;\"\n label=\"Horizontal resize control\"\n placeholder=\"Horizontal resize control\"\n ></sp-textfield>\n`;\n\nexport const sized = (): TemplateResult => html`\n <sp-field-label for=\"sized\">\n This textfield hasn't been used yet\n </sp-field-label>\n <sp-textfield\n multiline\n id=\"sized\"\n placeholder=\"You can type here\"\n autofocus\n style=\"width: 400px\"\n >\n <sp-help-text slot=\"help-text\">\n Even empty Textfield display correctly while waiting for content.\n </sp-help-text>\n </sp-textfield>\n`;\n"]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2018 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { html } from '@spectrum-web-components/base';
|
|
13
|
+
import '../sp-textfield.js';
|
|
14
|
+
import '@spectrum-web-components/field-label/sp-field-label.js';
|
|
15
|
+
import '@spectrum-web-components/help-text/sp-help-text.js';
|
|
16
|
+
export default {
|
|
17
|
+
component: 'sp-textfield',
|
|
18
|
+
title: 'Textfield',
|
|
19
|
+
};
|
|
20
|
+
export const Default = () => {
|
|
21
|
+
return html `
|
|
22
|
+
<sp-textfield placeholder="Enter your name"></sp-textfield>
|
|
23
|
+
<sp-textfield placeholder="Enter your name" disabled></sp-textfield>
|
|
24
|
+
<sp-textfield
|
|
25
|
+
placeholder="Enter your name"
|
|
26
|
+
pattern="[\\w\\s]*"
|
|
27
|
+
required
|
|
28
|
+
value="A valid input"
|
|
29
|
+
></sp-textfield>
|
|
30
|
+
<sp-textfield
|
|
31
|
+
placeholder="Enter your name"
|
|
32
|
+
pattern="[\\w\\s]*"
|
|
33
|
+
required
|
|
34
|
+
value="A valid input"
|
|
35
|
+
disabled
|
|
36
|
+
></sp-textfield>
|
|
37
|
+
<sp-textfield
|
|
38
|
+
placeholder="Enter your name"
|
|
39
|
+
pattern="[\\d]*"
|
|
40
|
+
value="Not a valid input"
|
|
41
|
+
></sp-textfield>
|
|
42
|
+
<sp-textfield
|
|
43
|
+
placeholder="Enter your name"
|
|
44
|
+
pattern="^[\\d]$"
|
|
45
|
+
required
|
|
46
|
+
value="Not a valid input"
|
|
47
|
+
disabled
|
|
48
|
+
></sp-textfield>
|
|
49
|
+
`;
|
|
50
|
+
};
|
|
51
|
+
export const quiet = () => {
|
|
52
|
+
return html `
|
|
53
|
+
<sp-field-label for="name">Enter your name</sp-field-label>
|
|
54
|
+
<sp-textfield
|
|
55
|
+
autofocus
|
|
56
|
+
id="name"
|
|
57
|
+
placeholder="This Text Field doesn't make much noise"
|
|
58
|
+
quiet
|
|
59
|
+
></sp-textfield>
|
|
60
|
+
`;
|
|
61
|
+
};
|
|
62
|
+
export const notRequiredWithPattern = () => {
|
|
63
|
+
return html `
|
|
64
|
+
<sp-textfield
|
|
65
|
+
placeholder="Enter z, x, c, or v"
|
|
66
|
+
pattern="[zxcv]+"
|
|
67
|
+
></sp-textfield>
|
|
68
|
+
`;
|
|
69
|
+
};
|
|
70
|
+
export const allowedKeys = () => {
|
|
71
|
+
return html `
|
|
72
|
+
<sp-textfield
|
|
73
|
+
placeholder="Enter your name"
|
|
74
|
+
allowed-keys="a-z"
|
|
75
|
+
></sp-textfield>
|
|
76
|
+
`;
|
|
77
|
+
};
|
|
78
|
+
export const readonly = () => html `
|
|
79
|
+
<sp-textfield
|
|
80
|
+
label="Enter your life story"
|
|
81
|
+
value="A readonly textfield"
|
|
82
|
+
readonly
|
|
83
|
+
placeholder="Enter your life story"
|
|
84
|
+
></sp-textfield>
|
|
85
|
+
`;
|
|
86
|
+
export const types = () => html `
|
|
87
|
+
<sp-textfield label="Default" placeholder="default (text)"></sp-textfield>
|
|
88
|
+
<sp-textfield label="Text" type="text" placeholder="text"></sp-textfield>
|
|
89
|
+
<sp-textfield label="URL" type="url" placeholder="url"></sp-textfield>
|
|
90
|
+
<sp-textfield label="Tel" type="tel" placeholder="tel"></sp-textfield>
|
|
91
|
+
<sp-textfield
|
|
92
|
+
label="E-Mail"
|
|
93
|
+
type="email"
|
|
94
|
+
placeholder="email"
|
|
95
|
+
></sp-textfield>
|
|
96
|
+
<sp-textfield
|
|
97
|
+
label="Password"
|
|
98
|
+
type="password"
|
|
99
|
+
placeholder="password"
|
|
100
|
+
></sp-textfield>
|
|
101
|
+
`;
|
|
102
|
+
export const empty = () => html `
|
|
103
|
+
<sp-field-label for="empty">
|
|
104
|
+
This textfield hasn't been used yet
|
|
105
|
+
</sp-field-label>
|
|
106
|
+
<sp-textfield id="empty" placeholder="You can type here" autofocus>
|
|
107
|
+
<sp-help-text slot="help-text">
|
|
108
|
+
Even empty Textfield display correctly while waiting for content.
|
|
109
|
+
</sp-help-text>
|
|
110
|
+
</sp-textfield>
|
|
111
|
+
`;
|
|
112
|
+
export const sized = () => html `
|
|
113
|
+
<sp-field-label for="sized">
|
|
114
|
+
This textfield hasn't been used yet
|
|
115
|
+
</sp-field-label>
|
|
116
|
+
<sp-textfield
|
|
117
|
+
id="sized"
|
|
118
|
+
placeholder="You can type here"
|
|
119
|
+
autofocus
|
|
120
|
+
style="width: 400px"
|
|
121
|
+
>
|
|
122
|
+
<sp-help-text slot="help-text">
|
|
123
|
+
Even empty Textfield display correctly while waiting for content.
|
|
124
|
+
</sp-help-text>
|
|
125
|
+
</sp-textfield>
|
|
126
|
+
`;
|
|
127
|
+
//# sourceMappingURL=textfield.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textfield.stories.js","sourceRoot":"","sources":["textfield.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AAErE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,wDAAwD,CAAC;AAChE,OAAO,oDAAoD,CAAC;AAE5D,eAAe;IACX,SAAS,EAAE,cAAc;IACzB,KAAK,EAAE,WAAW;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,GAAmB,EAAE;IACxC,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,GAAmB,EAAE;IACtC,OAAO,IAAI,CAAA;;;;;;;;KAQV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAmB,EAAE;IACvD,OAAO,IAAI,CAAA;;;;;KAKV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAmB,EAAE;IAC5C,OAAO,IAAI,CAAA;;;;;KAKV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;;;;;;CAOjD,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;CAe9C,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;;;;;;;;CAS9C,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,GAAmB,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;CAc9C,CAAC","sourcesContent":["/*\nCopyright 2018 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '../sp-textfield.js';\nimport '@spectrum-web-components/field-label/sp-field-label.js';\nimport '@spectrum-web-components/help-text/sp-help-text.js';\n\nexport default {\n component: 'sp-textfield',\n title: 'Textfield',\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <sp-textfield placeholder=\"Enter your name\"></sp-textfield>\n <sp-textfield placeholder=\"Enter your name\" disabled></sp-textfield>\n <sp-textfield\n placeholder=\"Enter your name\"\n pattern=\"[\\\\w\\\\s]*\"\n required\n value=\"A valid input\"\n ></sp-textfield>\n <sp-textfield\n placeholder=\"Enter your name\"\n pattern=\"[\\\\w\\\\s]*\"\n required\n value=\"A valid input\"\n disabled\n ></sp-textfield>\n <sp-textfield\n placeholder=\"Enter your name\"\n pattern=\"[\\\\d]*\"\n value=\"Not a valid input\"\n ></sp-textfield>\n <sp-textfield\n placeholder=\"Enter your name\"\n pattern=\"^[\\\\d]$\"\n required\n value=\"Not a valid input\"\n disabled\n ></sp-textfield>\n `;\n};\n\nexport const quiet = (): TemplateResult => {\n return html`\n <sp-field-label for=\"name\">Enter your name</sp-field-label>\n <sp-textfield\n autofocus\n id=\"name\"\n placeholder=\"This Text Field doesn't make much noise\"\n quiet\n ></sp-textfield>\n `;\n};\n\nexport const notRequiredWithPattern = (): TemplateResult => {\n return html`\n <sp-textfield\n placeholder=\"Enter z, x, c, or v\"\n pattern=\"[zxcv]+\"\n ></sp-textfield>\n `;\n};\n\nexport const allowedKeys = (): TemplateResult => {\n return html`\n <sp-textfield\n placeholder=\"Enter your name\"\n allowed-keys=\"a-z\"\n ></sp-textfield>\n `;\n};\n\nexport const readonly = (): TemplateResult => html`\n <sp-textfield\n label=\"Enter your life story\"\n value=\"A readonly textfield\"\n readonly\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n`;\n\nexport const types = (): TemplateResult => html`\n <sp-textfield label=\"Default\" placeholder=\"default (text)\"></sp-textfield>\n <sp-textfield label=\"Text\" type=\"text\" placeholder=\"text\"></sp-textfield>\n <sp-textfield label=\"URL\" type=\"url\" placeholder=\"url\"></sp-textfield>\n <sp-textfield label=\"Tel\" type=\"tel\" placeholder=\"tel\"></sp-textfield>\n <sp-textfield\n label=\"E-Mail\"\n type=\"email\"\n placeholder=\"email\"\n ></sp-textfield>\n <sp-textfield\n label=\"Password\"\n type=\"password\"\n placeholder=\"password\"\n ></sp-textfield>\n`;\n\nexport const empty = (): TemplateResult => html`\n <sp-field-label for=\"empty\">\n This textfield hasn't been used yet\n </sp-field-label>\n <sp-textfield id=\"empty\" placeholder=\"You can type here\" autofocus>\n <sp-help-text slot=\"help-text\">\n Even empty Textfield display correctly while waiting for content.\n </sp-help-text>\n </sp-textfield>\n`;\n\nexport const sized = (): TemplateResult => html`\n <sp-field-label for=\"sized\">\n This textfield hasn't been used yet\n </sp-field-label>\n <sp-textfield\n id=\"sized\"\n placeholder=\"You can type here\"\n autofocus\n style=\"width: 400px\"\n >\n <sp-help-text slot=\"help-text\">\n Even empty Textfield display correctly while waiting for content.\n </sp-help-text>\n </sp-textfield>\n`;\n"]}
|