@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.
Files changed (51) hide show
  1. package/README.md +110 -0
  2. package/dist/index.d.ts +10 -0
  3. package/dist/index.js +325 -0
  4. package/docs/avatar.md +481 -0
  5. package/docs/badge.md +266 -0
  6. package/docs/banner.md +350 -0
  7. package/docs/box.md +618 -0
  8. package/docs/button.md +604 -0
  9. package/docs/buttongroup.md +251 -0
  10. package/docs/checkbox.md +346 -0
  11. package/docs/chip.md +261 -0
  12. package/docs/choicelist.md +416 -0
  13. package/docs/clickable.md +703 -0
  14. package/docs/clickablechip.md +377 -0
  15. package/docs/colorfield.md +416 -0
  16. package/docs/colorpicker.md +152 -0
  17. package/docs/datefield.md +706 -0
  18. package/docs/datepicker.md +443 -0
  19. package/docs/divider.md +263 -0
  20. package/docs/dropzone.md +331 -0
  21. package/docs/emailfield.md +377 -0
  22. package/docs/grid.md +1246 -0
  23. package/docs/heading.md +201 -0
  24. package/docs/icon.md +295 -0
  25. package/docs/image.md +517 -0
  26. package/docs/link.md +456 -0
  27. package/docs/menu.md +331 -0
  28. package/docs/modal.md +640 -0
  29. package/docs/moneyfield.md +385 -0
  30. package/docs/numberfield.md +393 -0
  31. package/docs/orderedlist.md +224 -0
  32. package/docs/page.md +319 -0
  33. package/docs/paragraph.md +333 -0
  34. package/docs/passwordfield.md +381 -0
  35. package/docs/popover.md +419 -0
  36. package/docs/querycontainer.md +121 -0
  37. package/docs/searchfield.md +319 -0
  38. package/docs/section.md +267 -0
  39. package/docs/select.md +449 -0
  40. package/docs/spinner.md +121 -0
  41. package/docs/stack.md +748 -0
  42. package/docs/switch.md +365 -0
  43. package/docs/table.md +805 -0
  44. package/docs/text.md +339 -0
  45. package/docs/textarea.md +328 -0
  46. package/docs/textfield.md +425 -0
  47. package/docs/thumbnail.md +245 -0
  48. package/docs/tooltip.md +130 -0
  49. package/docs/unorderedlist.md +135 -0
  50. package/docs/urlfield.md +314 -0
  51. package/package.json +43 -0
@@ -0,0 +1,443 @@
1
+ ---
2
+ title: DatePicker
3
+ description: Allow users to select a specific date or date range.
4
+ api_name: app-home
5
+ source_url:
6
+ html: >-
7
+ https://shopify.dev/docs/api/app-home/polaris-web-components/forms/datepicker
8
+ md: >-
9
+ https://shopify.dev/docs/api/app-home/polaris-web-components/forms/datepicker.md
10
+ ---
11
+
12
+ # Date​Picker
13
+
14
+ Allow users to select a specific date or date range.
15
+
16
+ ## DatePicker
17
+
18
+ * allow
19
+
20
+ string
21
+
22
+ Default: ""
23
+
24
+ Dates that can be selected.
25
+
26
+ A comma-separated list of dates, date ranges. Whitespace is allowed after commas.
27
+
28
+ The default `''` allows all dates.
29
+
30
+ * Dates in `YYYY-MM-DD` format allow a single date.
31
+
32
+ * Dates in `YYYY-MM` format allow a whole month.
33
+
34
+ * Dates in `YYYY` format allow a whole year.
35
+
36
+ * Ranges are expressed as `start--end`. - Ranges are inclusive.
37
+
38
+ * If either `start` or `end` is omitted, the range is unbounded in that direction.
39
+ * If parts of the date are omitted for `start`, they are assumed to be the minimum possible value. So `2024--` is equivalent to `2024-01-01--`.
40
+ * If parts of the date are omitted for `end`, they are assumed to be the maximum possible value. So `--2024` is equivalent to `--2024-12-31`.
41
+ * Whitespace is allowed either side of `--`.
42
+
43
+ * allowDays
44
+
45
+ string
46
+
47
+ Default: ""
48
+
49
+ Days of the week that can be selected. These intersect with the result of `allow` and `disallow`.
50
+
51
+ A comma-separated list of days. Whitespace is allowed after commas.
52
+
53
+ The default `''` has no effect on the result of `allow` and `disallow`.
54
+
55
+ Days are `sunday`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`.
56
+
57
+ * defaultValue
58
+
59
+ string
60
+
61
+ Default: ""
62
+
63
+ Default selected value.
64
+
65
+ The default means no date is selected.
66
+
67
+ If the provided value is invalid, no date is selected.
68
+
69
+ * If `type="single"`, this is a date in `YYYY-MM-DD` format.
70
+ * If `type="multiple"`, this is a comma-separated list of dates in `YYYY-MM-DD` format.
71
+ * If `type="range"`, this is a range in `YYYY-MM-DD--YYYY-MM-DD` format. The range is inclusive.
72
+
73
+ * defaultView
74
+
75
+ string
76
+
77
+ Default month to display in `YYYY-MM` format.
78
+
79
+ This value is used until `view` is set, either directly or as a result of user interaction.
80
+
81
+ Defaults to the current month in the user's locale.
82
+
83
+ * disallow
84
+
85
+ string
86
+
87
+ Default: ""
88
+
89
+ Dates that cannot be selected. These subtract from `allow`.
90
+
91
+ A comma-separated list of dates, date ranges. Whitespace is allowed after commas.
92
+
93
+ The default `''` has no effect on `allow`.
94
+
95
+ * Dates in `YYYY-MM-DD` format disallow a single date.
96
+
97
+ * Dates in `YYYY-MM` format disallow a whole month.
98
+
99
+ * Dates in `YYYY` format disallow a whole year.
100
+
101
+ * Ranges are expressed as `start--end`. - Ranges are inclusive.
102
+
103
+ * If either `start` or `end` is omitted, the range is unbounded in that direction.
104
+ * If parts of the date are omitted for `start`, they are assumed to be the minimum possible value. So `2024--` is equivalent to `2024-01-01--`.
105
+ * If parts of the date are omitted for `end`, they are assumed to be the maximum possible value. So `--2024` is equivalent to `--2024-12-31`.
106
+ * Whitespace is allowed either side of `--`.
107
+
108
+ * disallowDays
109
+
110
+ string
111
+
112
+ Default: ""
113
+
114
+ Days of the week that cannot be selected. This subtracts from `allowDays`, and intersects with the result of `allow` and `disallow`.
115
+
116
+ A comma-separated list of days. Whitespace is allowed after commas.
117
+
118
+ The default `''` has no effect on `allowDays`.
119
+
120
+ Days are `sunday`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`.
121
+
122
+ * name
123
+
124
+ string
125
+
126
+ An identifier for the field that is unique within the nearest containing form.
127
+
128
+ * type
129
+
130
+ "single" | "range"
131
+
132
+ Default: "single"
133
+
134
+ * value
135
+
136
+ string
137
+
138
+ Default: ""
139
+
140
+ Current selected value.
141
+
142
+ The default means no date is selected.
143
+
144
+ If the provided value is invalid, no date is selected.
145
+
146
+ Otherwise:
147
+
148
+ * If `type="single"`, this is a date in `YYYY-MM-DD` format.
149
+ * If `type="multiple"`, this is a comma-separated list of dates in `YYYY-MM-DD` format.
150
+ * If `type="range"`, this is a range in `YYYY-MM-DD--YYYY-MM-DD` format. The range is inclusive.
151
+
152
+ * view
153
+
154
+ string
155
+
156
+ Displayed month in `YYYY-MM` format.
157
+
158
+ `onViewChange` is called when this value changes.
159
+
160
+ Defaults to `defaultView`.
161
+
162
+ ## Events
163
+
164
+ Learn more about [registering events](https://shopify.dev/docs/api/app-home/using-polaris-components#event-handling).
165
+
166
+ * blur
167
+
168
+ CallbackEventListener\<typeof tagName> | null
169
+
170
+ * change
171
+
172
+ CallbackEventListener\<typeof tagName> | null
173
+
174
+ * focus
175
+
176
+ CallbackEventListener\<typeof tagName> | null
177
+
178
+ * input
179
+
180
+ CallbackEventListener\<typeof tagName> | null
181
+
182
+ * viewchange
183
+
184
+ CallbackEventListener\<typeof tagName> | null
185
+
186
+ ### CallbackEventListener
187
+
188
+ ```ts
189
+ (EventListener & {
190
+ (event: CallbackEvent<T>): void;
191
+ }) | null
192
+ ```
193
+
194
+ ### CallbackEvent
195
+
196
+ ```ts
197
+ Event & {
198
+ currentTarget: HTMLElementTagNameMap[T];
199
+ }
200
+ ```
201
+
202
+ Examples
203
+
204
+ ### Examples
205
+
206
+ * #### Code
207
+
208
+ ##### jsx
209
+
210
+ ```jsx
211
+ <s-date-picker
212
+ view="2025-05"
213
+ type="range"
214
+ value="2025-05-28--2025-05-31"
215
+ />
216
+ ```
217
+
218
+ ##### html
219
+
220
+ ```html
221
+ <s-date-picker
222
+ view="2025-05"
223
+ type="range"
224
+ value="2025-05-28--2025-05-31"
225
+ ></s-date-picker>
226
+ ```
227
+
228
+ * #### Single date selection
229
+
230
+ ##### Description
231
+
232
+ Demonstrates a date picker configured for selecting a single date with a default value and specific month view.
233
+
234
+ ##### jsx
235
+
236
+ ```jsx
237
+ <s-date-picker
238
+ type="single"
239
+ name="delivery-date"
240
+ value="2024-01-15"
241
+ view="2024-01"
242
+ />
243
+ ```
244
+
245
+ ##### html
246
+
247
+ ```html
248
+ <s-date-picker
249
+ type="single"
250
+ name="delivery-date"
251
+ value="2024-01-15"
252
+ view="2024-01"
253
+ ></s-date-picker>
254
+ ```
255
+
256
+ * #### With date restrictions
257
+
258
+ ##### Description
259
+
260
+ Illustrates how to restrict date selection to a specific date range, preventing selection of past or future dates outside the allowed period.
261
+
262
+ ##### jsx
263
+
264
+ ```jsx
265
+ <s-date-picker
266
+ type="single"
267
+ name="appointment-date"
268
+ disallow="past"
269
+ allow="2024-06-01--2024-06-31"
270
+ view="2024-06"
271
+ />
272
+ ```
273
+
274
+ ##### html
275
+
276
+ ```html
277
+ <!-- Disable past dates and far future dates -->
278
+ <s-date-picker
279
+ type="single"
280
+ name="appointment-date"
281
+ disallow="past"
282
+ allow="2024-06-01--2024-06-31"
283
+ view="2024-06"
284
+ ></s-date-picker>
285
+ ```
286
+
287
+ * #### Handling onChange callbacks
288
+
289
+ ##### Description
290
+
291
+ Demonstrates how to handle onChange callbacks for both single and range date pickers, showing how to extract and process the selected values.
292
+
293
+ ##### jsx
294
+
295
+ ```jsx
296
+ const [dateRange, setDateRange] = useState('2024-01-01--2024-01-31');
297
+ const [orderNumber, setOrderNumber] = useState('');
298
+
299
+ const handleApplyFilters = () => {
300
+ console.log('Applying filters:', {
301
+ orderNumber,
302
+ dateRange
303
+ });
304
+ }
305
+
306
+ return (
307
+ <s-stack gap="base">
308
+ <s-text-field
309
+ label="Order number"
310
+ placeholder="Search orders..."
311
+ value={orderNumber}
312
+ onChange={(event) => setOrderNumber(event.currentTarget.value)}
313
+ />
314
+ <s-date-picker
315
+ type="range"
316
+ name="order-date-range"
317
+ value={dateRange}
318
+ onChange={(event) => setDateRange(event.currentTarget.value)}
319
+ view="2024-01"
320
+ />
321
+ <s-button onClick={handleApplyFilters}>Apply filters</s-button>
322
+ </s-stack>
323
+ )
324
+ ```
325
+
326
+ ##### html
327
+
328
+ ```html
329
+ <form>
330
+ <s-text-field
331
+ label="Order number"
332
+ placeholder="Search orders..."
333
+ ></s-text-field>
334
+ <s-date-picker
335
+ type="range"
336
+ name="order-date-range"
337
+ value="2024-01-01--2024-01-31"
338
+ view="2024-01"
339
+ ></s-date-picker>
340
+ <s-button type="submit">Apply filters</s-button>
341
+ </form>
342
+ ```
343
+
344
+ * #### With quick date selection
345
+
346
+ ##### Description
347
+
348
+ Illustrates a date picker with quick preset buttons and onChange callback to capture user selections and update the displayed value.
349
+
350
+ ##### jsx
351
+
352
+ ```jsx
353
+ const [value, setValue] = useState('2025-01-01--2025-01-31');
354
+
355
+ const last7Days = () => {
356
+ setValue('2025-01-07--2025-01-13');
357
+ }
358
+
359
+ const last30Days = () => {
360
+ setValue('2024-12-14--2025-01-13');
361
+ }
362
+
363
+ const thisMonth = () => {
364
+ setValue('2025-01-01--2025-01-31');
365
+ }
366
+
367
+ return (
368
+ <s-stack gap="base">
369
+ <s-button-group>
370
+ <s-button slot="secondary-actions" onClick={last7Days}>Last 7 days</s-button>
371
+ <s-button slot="secondary-actions" onClick={last30Days}>Last 30 days</s-button>
372
+ <s-button slot="secondary-actions" onClick={thisMonth}>This month</s-button>
373
+ </s-button-group>
374
+ <s-date-picker
375
+ type="range"
376
+ name="analytics-period"
377
+ id="analytics-picker"
378
+ view="2025-01"
379
+ value={value}
380
+ onChange={(event) => {
381
+ console.log('Date range changed:', event.currentTarget.value);
382
+ setValue(event.currentTarget.value);
383
+ }}
384
+ />
385
+ <s-text>Selected range: {value}</s-text>
386
+ </s-stack>
387
+ )
388
+ ```
389
+
390
+ ##### html
391
+
392
+ ```html
393
+ <!-- Quick date selection with onChange callback -->
394
+ <s-stack gap="base">
395
+ <s-button-group>
396
+ <s-button slot="secondary-actions" id="last-7-days">Last 7 days</s-button>
397
+ <s-button slot="secondary-actions" id="last-30-days">Last 30 days</s-button>
398
+ <s-button slot="secondary-actions" id="this-month">This month</s-button>
399
+ </s-button-group>
400
+ <s-date-picker
401
+ type="range"
402
+ name="analytics-period"
403
+ id="analytics-picker"
404
+ value="2025-01-01--2025-01-31"
405
+ view="2025-01"
406
+ onchange="console.log('Date range changed:', event.currentTarget.value)"
407
+ ></s-date-picker>
408
+ <s-text id="selected-range">
409
+ Selected range: 2025-01-01--2025-01-31
410
+ </s-text>
411
+ </s-stack>
412
+
413
+ <script>
414
+ const picker = document.getElementById('analytics-picker');
415
+ const display = document.getElementById('selected-range');
416
+
417
+ // Handle picker changes
418
+ picker.addEventListener('change', (event) => {
419
+ display.textContent = `Selected range: ${event.currentTarget.value}`;
420
+ });
421
+
422
+ // Quick selection buttons
423
+ document.getElementById('last-7-days').addEventListener('click', () => {
424
+ picker.value = '2025-01-07--2025-01-13';
425
+ display.textContent = 'Selected range: 2025-01-07--2025-01-13';
426
+ });
427
+
428
+ document.getElementById('last-30-days').addEventListener('click', () => {
429
+ picker.value = '2024-12-14--2025-01-13';
430
+ display.textContent = 'Selected range: 2024-12-14--2025-01-13';
431
+ });
432
+
433
+ document.getElementById('this-month').addEventListener('click', () => {
434
+ picker.value = '2025-01-01--2025-01-31';
435
+ display.textContent = 'Selected range: 2025-01-01--2025-01-31';
436
+ });
437
+ </script>
438
+ ```
439
+
440
+ ## Best practices
441
+
442
+ * Use smart defaults and highlight common selections
443
+ * Don't use to enter a date that is many years in the future or the past
@@ -0,0 +1,263 @@
1
+ ---
2
+ title: Divider
3
+ description: Create clear visual separation between elements in your user interface.
4
+ api_name: app-home
5
+ source_url:
6
+ html: >-
7
+ https://shopify.dev/docs/api/app-home/polaris-web-components/structure/divider
8
+ md: >-
9
+ https://shopify.dev/docs/api/app-home/polaris-web-components/structure/divider.md
10
+ ---
11
+
12
+ # Divider
13
+
14
+ Create clear visual separation between elements in your user interface.
15
+
16
+ ## Properties
17
+
18
+ * color
19
+
20
+ "base" | "strong"
21
+
22
+ Default: 'base'
23
+
24
+ Modify the color to be more or less intense.
25
+
26
+ * direction
27
+
28
+ "inline" | "block"
29
+
30
+ Default: 'inline'
31
+
32
+ Specify the direction of the divider. This uses [logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values).
33
+
34
+ Examples
35
+
36
+ ### Examples
37
+
38
+ * #### Code
39
+
40
+ ##### jsx
41
+
42
+ ```jsx
43
+ <s-divider />
44
+ ```
45
+
46
+ ##### html
47
+
48
+ ```html
49
+ <s-divider></s-divider>
50
+ ```
51
+
52
+ * #### Basic usage
53
+
54
+ ##### Description
55
+
56
+ Demonstrates the default divider with standard base color and inline direction.
57
+
58
+ ##### jsx
59
+
60
+ ```jsx
61
+ <s-divider />
62
+ ```
63
+
64
+ ##### html
65
+
66
+ ```html
67
+ <s-divider></s-divider>
68
+ ```
69
+
70
+ * #### Custom color
71
+
72
+ ##### Description
73
+
74
+ Shows a divider with a strong color variant for increased visual emphasis.
75
+
76
+ ##### jsx
77
+
78
+ ```jsx
79
+ <s-divider color="strong" />
80
+ ```
81
+
82
+ ##### html
83
+
84
+ ```html
85
+ <s-divider color="strong"></s-divider>
86
+ ```
87
+
88
+ * #### Custom direction
89
+
90
+ ##### Description
91
+
92
+ Illustrates using a block-direction divider within an inline stack to create vertical separation between items.
93
+
94
+ ##### jsx
95
+
96
+ ```jsx
97
+ <s-stack direction="inline" gap="base">
98
+ <s-text>Item 1</s-text>
99
+ <s-divider direction="block" />
100
+ <s-text>Item 2</s-text>
101
+ </s-stack>
102
+ ```
103
+
104
+ ##### html
105
+
106
+ ```html
107
+ <s-stack direction="inline" gap="base">
108
+ <s-text>Item 1</s-text>
109
+ <s-divider direction="block"></s-divider>
110
+ <s-text>Item 2</s-text>
111
+ </s-stack>
112
+ ```
113
+
114
+ * #### Separating form sections
115
+
116
+ ##### Description
117
+
118
+ Uses a divider to visually group and separate different sections of a form, improving readability and user comprehension.
119
+
120
+ ##### jsx
121
+
122
+ ```jsx
123
+ <s-stack gap="base">
124
+ <s-text-field label="Store name" />
125
+ <s-text-field label="Description" />
126
+ <s-divider />
127
+ <s-text-field label="Email address" />
128
+ <s-text-field label="Phone number" />
129
+ </s-stack>
130
+ ```
131
+
132
+ ##### html
133
+
134
+ ```html
135
+ <s-stack gap="base">
136
+ <s-text-field label="Store name"></s-text-field>
137
+ <s-text-field label="Description"></s-text-field>
138
+ <s-divider></s-divider>
139
+ <s-text-field label="Email address"></s-text-field>
140
+ <s-text-field label="Phone number"></s-text-field>
141
+ </s-stack>
142
+ ```
143
+
144
+ * #### Organizing settings panels
145
+
146
+ ##### Description
147
+
148
+ Demonstrates using a divider to logically separate basic and advanced settings in a configuration panel.
149
+
150
+ ##### jsx
151
+
152
+ ```jsx
153
+ <s-box padding="base">
154
+ <s-stack gap="base">
155
+ <s-switch label="Email notifications" />
156
+ <s-switch label="Auto-save" />
157
+ <s-divider />
158
+ <s-switch label="Advanced settings" />
159
+ <s-switch label="Developer tools" />
160
+ </s-stack>
161
+ </s-box>
162
+ ```
163
+
164
+ ##### html
165
+
166
+ ```html
167
+ <s-box padding="base">
168
+ <s-stack gap="base">
169
+ <s-switch label="Email notifications"></s-switch>
170
+ <s-switch label="Auto-save"></s-switch>
171
+ <s-divider></s-divider>
172
+ <s-switch label="Advanced settings"></s-switch>
173
+ <s-switch label="Developer tools"></s-switch>
174
+ </s-stack>
175
+ </s-box>
176
+ ```
177
+
178
+ * #### Visual breaks in section layouts
179
+
180
+ ##### Description
181
+
182
+ Shows how dividers can be used to create clean, segmented sections within a section, improving information hierarchy.
183
+
184
+ ##### jsx
185
+
186
+ ```jsx
187
+ <s-box padding="large-400" background="base">
188
+ <s-stack gap="base">
189
+ <s-heading>Order summary</s-heading>
190
+ <s-text>3 items</s-text>
191
+ <s-divider />
192
+ <s-heading>Shipping address</s-heading>
193
+ <s-text>123 Main Street, Toronto ON</s-text>
194
+ <s-divider />
195
+ <s-heading>Payment method</s-heading>
196
+ <s-text>•••• 4242</s-text>
197
+ </s-stack>
198
+ </s-box>
199
+ ```
200
+
201
+ ##### html
202
+
203
+ ```html
204
+ <s-box padding="large-400" background="base">
205
+ <s-stack gap="base">
206
+ <s-heading>Order summary</s-heading>
207
+ <s-text>3 items</s-text>
208
+ <s-divider></s-divider>
209
+ <s-heading>Shipping address</s-heading>
210
+ <s-text>123 Main Street, Toronto ON</s-text>
211
+ <s-divider></s-divider>
212
+ <s-heading>Payment method</s-heading>
213
+ <s-text>•••• 4242</s-text>
214
+ </s-stack>
215
+ </s-box>
216
+ ```
217
+
218
+ * #### Separating content sections
219
+
220
+ ##### Description
221
+
222
+ Illustrates using dividers to create clear, visually distinct sections for different metrics or content blocks.
223
+
224
+ ##### jsx
225
+
226
+ ```jsx
227
+ <s-stack gap="base">
228
+ <s-box padding="base">
229
+ <s-text>150 orders</s-text>
230
+ </s-box>
231
+ <s-divider />
232
+ <s-box padding="base">
233
+ <s-text>$2,400 revenue</s-text>
234
+ </s-box>
235
+ <s-divider />
236
+ <s-box padding="base">
237
+ <s-text>89 customers</s-text>
238
+ </s-box>
239
+ </s-stack>
240
+ ```
241
+
242
+ ##### html
243
+
244
+ ```html
245
+ <s-stack gap="base">
246
+ <s-box padding="base">
247
+ <s-text>150 orders</s-text>
248
+ </s-box>
249
+ <s-divider></s-divider>
250
+ <s-box padding="base">
251
+ <s-text>$2,400 revenue</s-text>
252
+ </s-box>
253
+ <s-divider></s-divider>
254
+ <s-box padding="base">
255
+ <s-text>89 customers</s-text>
256
+ </s-box>
257
+ </s-stack>
258
+ ```
259
+
260
+ ## Useful for
261
+
262
+ * Separating elements inside sections.
263
+ * Visually grouping related content in forms and lists.