@abraracs/better-shopify-wc-mcp 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/README.md +110 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +325 -0
- package/docs/avatar.md +481 -0
- package/docs/badge.md +266 -0
- package/docs/banner.md +350 -0
- package/docs/box.md +618 -0
- package/docs/button.md +604 -0
- package/docs/buttongroup.md +251 -0
- package/docs/checkbox.md +346 -0
- package/docs/chip.md +261 -0
- package/docs/choicelist.md +416 -0
- package/docs/clickable.md +703 -0
- package/docs/clickablechip.md +377 -0
- package/docs/colorfield.md +416 -0
- package/docs/colorpicker.md +152 -0
- package/docs/datefield.md +706 -0
- package/docs/datepicker.md +443 -0
- package/docs/divider.md +263 -0
- package/docs/dropzone.md +331 -0
- package/docs/emailfield.md +377 -0
- package/docs/grid.md +1246 -0
- package/docs/heading.md +201 -0
- package/docs/icon.md +295 -0
- package/docs/image.md +517 -0
- package/docs/link.md +456 -0
- package/docs/menu.md +331 -0
- package/docs/modal.md +640 -0
- package/docs/moneyfield.md +385 -0
- package/docs/numberfield.md +393 -0
- package/docs/orderedlist.md +224 -0
- package/docs/page.md +319 -0
- package/docs/paragraph.md +333 -0
- package/docs/passwordfield.md +381 -0
- package/docs/popover.md +419 -0
- package/docs/querycontainer.md +121 -0
- package/docs/searchfield.md +319 -0
- package/docs/section.md +267 -0
- package/docs/select.md +449 -0
- package/docs/spinner.md +121 -0
- package/docs/stack.md +748 -0
- package/docs/switch.md +365 -0
- package/docs/table.md +805 -0
- package/docs/text.md +339 -0
- package/docs/textarea.md +328 -0
- package/docs/textfield.md +425 -0
- package/docs/thumbnail.md +245 -0
- package/docs/tooltip.md +130 -0
- package/docs/unorderedlist.md +135 -0
- package/docs/urlfield.md +314 -0
- package/package.json +43 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: PasswordField
|
|
3
|
+
description: Securely collect sensitive information from users.
|
|
4
|
+
api_name: app-home
|
|
5
|
+
source_url:
|
|
6
|
+
html: >-
|
|
7
|
+
https://shopify.dev/docs/api/app-home/polaris-web-components/forms/passwordfield
|
|
8
|
+
md: >-
|
|
9
|
+
https://shopify.dev/docs/api/app-home/polaris-web-components/forms/passwordfield.md
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# PasswordField
|
|
13
|
+
|
|
14
|
+
Securely collect sensitive information from users.
|
|
15
|
+
|
|
16
|
+
## Properties
|
|
17
|
+
|
|
18
|
+
* autocomplete
|
|
19
|
+
|
|
20
|
+
"on" | "off" | PasswordAutocompleteField | \`section-${string} current-password\` | \`section-${string} new-password\` | "shipping current-password" | "shipping new-password" | "billing current-password" | "billing new-password" | \`section-${string} shipping current-password\` | \`section-${string} shipping new-password\` | \`section-${string} billing current-password\` | \`section-${string} billing new-password\`
|
|
21
|
+
|
|
22
|
+
Default: 'on' for everything else
|
|
23
|
+
|
|
24
|
+
A hint as to the intended content of the field.
|
|
25
|
+
|
|
26
|
+
When set to `on` (the default), this property indicates that the field should support autofill, but you do not have any more semantic information on the intended contents.
|
|
27
|
+
|
|
28
|
+
When set to `off`, you are indicating that this field contains sensitive information, or contents that are never saved, like one-time codes.
|
|
29
|
+
|
|
30
|
+
Alternatively, you can provide value which describes the specific data you would like to be entered into this field during autofill.
|
|
31
|
+
|
|
32
|
+
* defaultValue
|
|
33
|
+
|
|
34
|
+
string
|
|
35
|
+
|
|
36
|
+
The default value for the field.
|
|
37
|
+
|
|
38
|
+
* details
|
|
39
|
+
|
|
40
|
+
string
|
|
41
|
+
|
|
42
|
+
Additional text to provide context or guidance for the field. This text is displayed along with the field and its label to offer more information or instructions to the user.
|
|
43
|
+
|
|
44
|
+
This will also be exposed to screen reader users.
|
|
45
|
+
|
|
46
|
+
* disabled
|
|
47
|
+
|
|
48
|
+
boolean
|
|
49
|
+
|
|
50
|
+
Default: false
|
|
51
|
+
|
|
52
|
+
Disables the field, disallowing any interaction.
|
|
53
|
+
|
|
54
|
+
* error
|
|
55
|
+
|
|
56
|
+
string
|
|
57
|
+
|
|
58
|
+
Indicate an error to the user. The field will be given a specific stylistic treatment to communicate problems that have to be resolved immediately.
|
|
59
|
+
|
|
60
|
+
* id
|
|
61
|
+
|
|
62
|
+
string
|
|
63
|
+
|
|
64
|
+
A unique identifier for the element.
|
|
65
|
+
|
|
66
|
+
* label
|
|
67
|
+
|
|
68
|
+
string
|
|
69
|
+
|
|
70
|
+
Content to use as the field label.
|
|
71
|
+
|
|
72
|
+
* labelAccessibilityVisibility
|
|
73
|
+
|
|
74
|
+
"visible" | "exclusive"
|
|
75
|
+
|
|
76
|
+
Default: 'visible'
|
|
77
|
+
|
|
78
|
+
Changes the visibility of the component's label.
|
|
79
|
+
|
|
80
|
+
* `visible`: the label is visible to all users.
|
|
81
|
+
* `exclusive`: the label is visually hidden but remains in the accessibility tree.
|
|
82
|
+
|
|
83
|
+
* maxLength
|
|
84
|
+
|
|
85
|
+
number
|
|
86
|
+
|
|
87
|
+
Default: Infinity
|
|
88
|
+
|
|
89
|
+
Specifies the maximum number of characters allowed.
|
|
90
|
+
|
|
91
|
+
* minLength
|
|
92
|
+
|
|
93
|
+
number
|
|
94
|
+
|
|
95
|
+
Default: 0
|
|
96
|
+
|
|
97
|
+
Specifies the min number of characters allowed.
|
|
98
|
+
|
|
99
|
+
* name
|
|
100
|
+
|
|
101
|
+
string
|
|
102
|
+
|
|
103
|
+
An identifier for the field that is unique within the nearest containing form.
|
|
104
|
+
|
|
105
|
+
* placeholder
|
|
106
|
+
|
|
107
|
+
string
|
|
108
|
+
|
|
109
|
+
A short hint that describes the expected value of the field.
|
|
110
|
+
|
|
111
|
+
* readOnly
|
|
112
|
+
|
|
113
|
+
boolean
|
|
114
|
+
|
|
115
|
+
Default: false
|
|
116
|
+
|
|
117
|
+
The field cannot be edited by the user. It is focusable will be announced by screen readers.
|
|
118
|
+
|
|
119
|
+
* required
|
|
120
|
+
|
|
121
|
+
boolean
|
|
122
|
+
|
|
123
|
+
Default: false
|
|
124
|
+
|
|
125
|
+
Whether the field needs a value. This requirement adds semantic value to the field, but it will not cause an error to appear automatically. If you want to present an error when this field is empty, you can do so with the `error` property.
|
|
126
|
+
|
|
127
|
+
* value
|
|
128
|
+
|
|
129
|
+
string
|
|
130
|
+
|
|
131
|
+
The current value for the field. If omitted, the field will be empty.
|
|
132
|
+
|
|
133
|
+
### PasswordAutocompleteField
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
'current-password' | 'new-password'
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Events
|
|
140
|
+
|
|
141
|
+
Learn more about [registering events](https://shopify.dev/docs/api/app-home/using-polaris-components#event-handling).
|
|
142
|
+
|
|
143
|
+
* blur
|
|
144
|
+
|
|
145
|
+
CallbackEventListener<'input'>
|
|
146
|
+
|
|
147
|
+
* change
|
|
148
|
+
|
|
149
|
+
CallbackEventListener<'input'>
|
|
150
|
+
|
|
151
|
+
* focus
|
|
152
|
+
|
|
153
|
+
CallbackEventListener<'input'>
|
|
154
|
+
|
|
155
|
+
* input
|
|
156
|
+
|
|
157
|
+
CallbackEventListener<'input'>
|
|
158
|
+
|
|
159
|
+
### CallbackEventListener
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
(EventListener & {
|
|
163
|
+
(event: CallbackEvent<T>): void;
|
|
164
|
+
}) | null
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### CallbackEvent
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
Event & {
|
|
171
|
+
currentTarget: HTMLElementTagNameMap[T];
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Examples
|
|
176
|
+
|
|
177
|
+
### Examples
|
|
178
|
+
|
|
179
|
+
* #### Code
|
|
180
|
+
|
|
181
|
+
##### jsx
|
|
182
|
+
|
|
183
|
+
```jsx
|
|
184
|
+
<s-password-field
|
|
185
|
+
label="Password"
|
|
186
|
+
placeholder="Enter your password"
|
|
187
|
+
details="Must be at least 8 characters long"
|
|
188
|
+
minLength={8}
|
|
189
|
+
/>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
##### html
|
|
193
|
+
|
|
194
|
+
```html
|
|
195
|
+
<s-password-field
|
|
196
|
+
label="Password"
|
|
197
|
+
placeholder="Enter your password"
|
|
198
|
+
details="Must be at least 8 characters long"
|
|
199
|
+
minLength="8"
|
|
200
|
+
></s-password-field>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
* #### Basic usage
|
|
204
|
+
|
|
205
|
+
##### Description
|
|
206
|
+
|
|
207
|
+
Demonstrates a basic password field with a label, name, and required validation. Sets a minimum length of 8 characters and configures autocomplete for a new password.
|
|
208
|
+
|
|
209
|
+
##### jsx
|
|
210
|
+
|
|
211
|
+
```jsx
|
|
212
|
+
<s-password-field
|
|
213
|
+
label="Password"
|
|
214
|
+
name="password"
|
|
215
|
+
required
|
|
216
|
+
minLength={8}
|
|
217
|
+
autocomplete="new-password"
|
|
218
|
+
/>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
##### html
|
|
222
|
+
|
|
223
|
+
```html
|
|
224
|
+
<s-password-field
|
|
225
|
+
label="Password"
|
|
226
|
+
name="password"
|
|
227
|
+
required
|
|
228
|
+
minLength="8"
|
|
229
|
+
autocomplete="new-password"
|
|
230
|
+
></s-password-field>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
* #### With error state
|
|
234
|
+
|
|
235
|
+
##### Description
|
|
236
|
+
|
|
237
|
+
Shows a password field in an error state, displaying a custom error message when the password does not meet the minimum length requirement.
|
|
238
|
+
|
|
239
|
+
##### jsx
|
|
240
|
+
|
|
241
|
+
```jsx
|
|
242
|
+
<s-password-field
|
|
243
|
+
label="Password"
|
|
244
|
+
name="password"
|
|
245
|
+
error="Password must be at least 8 characters"
|
|
246
|
+
minLength={8}
|
|
247
|
+
autocomplete="new-password"
|
|
248
|
+
/>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
##### html
|
|
252
|
+
|
|
253
|
+
```html
|
|
254
|
+
<s-password-field
|
|
255
|
+
label="Password"
|
|
256
|
+
name="password"
|
|
257
|
+
error="Password must be at least 8 characters"
|
|
258
|
+
minLength="8"
|
|
259
|
+
autocomplete="new-password"
|
|
260
|
+
></s-password-field>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
* #### With helper text
|
|
264
|
+
|
|
265
|
+
##### Description
|
|
266
|
+
|
|
267
|
+
Illustrates a password field with additional details providing guidance about password creation requirements.
|
|
268
|
+
|
|
269
|
+
##### jsx
|
|
270
|
+
|
|
271
|
+
```jsx
|
|
272
|
+
<s-password-field
|
|
273
|
+
label="Create password"
|
|
274
|
+
name="new-password"
|
|
275
|
+
details="Password must be at least 8 characters and include uppercase, lowercase, and numbers"
|
|
276
|
+
minLength={8}
|
|
277
|
+
autocomplete="new-password"
|
|
278
|
+
/>
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
##### html
|
|
282
|
+
|
|
283
|
+
```html
|
|
284
|
+
<s-password-field
|
|
285
|
+
label="Create password"
|
|
286
|
+
name="new-password"
|
|
287
|
+
details="Password must be at least 8 characters and include uppercase, lowercase, and numbers"
|
|
288
|
+
minLength="8"
|
|
289
|
+
autocomplete="new-password"
|
|
290
|
+
></s-password-field>
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
* #### In form layout
|
|
294
|
+
|
|
295
|
+
##### Description
|
|
296
|
+
|
|
297
|
+
Shows how the password field can be integrated into a form alongside other input fields, such as an email field, to create a complete login or registration form.
|
|
298
|
+
|
|
299
|
+
##### jsx
|
|
300
|
+
|
|
301
|
+
```jsx
|
|
302
|
+
<s-stack gap="base">
|
|
303
|
+
<s-email-field
|
|
304
|
+
label="Email"
|
|
305
|
+
name="email"
|
|
306
|
+
autocomplete="email"
|
|
307
|
+
required
|
|
308
|
+
/>
|
|
309
|
+
<s-password-field
|
|
310
|
+
label="Password"
|
|
311
|
+
name="password"
|
|
312
|
+
autocomplete="current-password"
|
|
313
|
+
required
|
|
314
|
+
/>
|
|
315
|
+
</s-stack>
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
##### html
|
|
319
|
+
|
|
320
|
+
```html
|
|
321
|
+
<s-stack gap="base">
|
|
322
|
+
<s-email-field
|
|
323
|
+
label="Email"
|
|
324
|
+
name="email"
|
|
325
|
+
autocomplete="username"
|
|
326
|
+
required
|
|
327
|
+
></s-email-field>
|
|
328
|
+
<s-password-field
|
|
329
|
+
label="Password"
|
|
330
|
+
name="password"
|
|
331
|
+
autocomplete="current-password"
|
|
332
|
+
required
|
|
333
|
+
></s-password-field>
|
|
334
|
+
</s-stack>
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
* #### With password strength requirements
|
|
338
|
+
|
|
339
|
+
##### Description
|
|
340
|
+
|
|
341
|
+
Demonstrates a password field with dynamic password strength validation, showing real-time feedback on password complexity requirements.
|
|
342
|
+
|
|
343
|
+
##### jsx
|
|
344
|
+
|
|
345
|
+
```jsx
|
|
346
|
+
<s-stack gap="large-100">
|
|
347
|
+
<s-password-field
|
|
348
|
+
label="Create password"
|
|
349
|
+
name="password"
|
|
350
|
+
value="example-password"
|
|
351
|
+
autocomplete="new-password"
|
|
352
|
+
required
|
|
353
|
+
/>
|
|
354
|
+
<s-stack gap="small-200">
|
|
355
|
+
<s-text tone="success">✓ At least 8 characters</s-text>
|
|
356
|
+
<s-text color="subdued">○ Contains uppercase letter</s-text>
|
|
357
|
+
<s-text color="subdued">○ Contains lowercase letter</s-text>
|
|
358
|
+
<s-text color="subdued">○ Contains number</s-text>
|
|
359
|
+
</s-stack>
|
|
360
|
+
</s-stack>
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
##### html
|
|
364
|
+
|
|
365
|
+
```html
|
|
366
|
+
<s-stack gap="large-100">
|
|
367
|
+
<s-password-field
|
|
368
|
+
label="Create password"
|
|
369
|
+
name="password"
|
|
370
|
+
value="example-password"
|
|
371
|
+
autocomplete="new-password"
|
|
372
|
+
required
|
|
373
|
+
></s-password-field>
|
|
374
|
+
<s-stack gap="small-200">
|
|
375
|
+
<s-text tone="success">✓ At least 8 characters</s-text>
|
|
376
|
+
<s-text color="subdued">○ Contains uppercase letter</s-text>
|
|
377
|
+
<s-text color="subdued">○ Contains lowercase letter</s-text>
|
|
378
|
+
<s-text color="subdued">○ Contains number</s-text>
|
|
379
|
+
</s-stack>
|
|
380
|
+
</s-stack>
|
|
381
|
+
```
|