@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,419 @@
1
+ ---
2
+ title: Popover
3
+ description: >-
4
+ Popovers are used to display content in an overlay that can be triggered by a
5
+ button.
6
+ api_name: app-home
7
+ source_url:
8
+ html: >-
9
+ https://shopify.dev/docs/api/app-home/polaris-web-components/overlays/popover
10
+ md: >-
11
+ https://shopify.dev/docs/api/app-home/polaris-web-components/overlays/popover.md
12
+ ---
13
+
14
+ # Popover
15
+
16
+ Popovers are used to display content in an overlay that can be triggered by a button.
17
+
18
+ ## Properties
19
+
20
+ * blockSize
21
+
22
+ SizeUnitsOrAuto
23
+
24
+ Default: 'auto'
25
+
26
+ Adjust the block size.
27
+
28
+ * inlineSize
29
+
30
+ SizeUnitsOrAuto
31
+
32
+ Default: 'auto'
33
+
34
+ Adjust the inline size.
35
+
36
+ * maxBlockSize
37
+
38
+ SizeUnitsOrNone
39
+
40
+ Default: 'none'
41
+
42
+ Adjust the maximum block size.
43
+
44
+ * maxInlineSize
45
+
46
+ SizeUnitsOrNone
47
+
48
+ Default: 'none'
49
+
50
+ Adjust the maximum inline size.
51
+
52
+ * minBlockSize
53
+
54
+ SizeUnits
55
+
56
+ Default: '0'
57
+
58
+ Adjust the minimum block size.
59
+
60
+ * minInlineSize
61
+
62
+ SizeUnits
63
+
64
+ Default: '0'
65
+
66
+ Adjust the minimum inline size.
67
+
68
+ ### SizeUnitsOrAuto
69
+
70
+ ```ts
71
+ SizeUnits | 'auto'
72
+ ```
73
+
74
+ ### SizeUnits
75
+
76
+ ```ts
77
+ `${number}px` | `${number}%` | `0`
78
+ ```
79
+
80
+ ### SizeUnitsOrNone
81
+
82
+ ```ts
83
+ SizeUnits | 'none'
84
+ ```
85
+
86
+ ## Events
87
+
88
+ Learn more about [registering events](https://shopify.dev/docs/api/app-home/using-polaris-components#event-handling).
89
+
90
+ * afterhide
91
+
92
+ CallbackEventListener\<TTagName> | null
93
+
94
+ * aftershow
95
+
96
+ CallbackEventListener\<TTagName> | null
97
+
98
+ * aftertoggle
99
+
100
+ CallbackEventListener\<TTagName> | null
101
+
102
+ * hide
103
+
104
+ CallbackEventListener\<TTagName> | null
105
+
106
+ * show
107
+
108
+ CallbackEventListener\<TTagName> | null
109
+
110
+ * toggle
111
+
112
+ CallbackEventListener\<TTagName> | null
113
+
114
+ ### CallbackEventListener
115
+
116
+ ```ts
117
+ (EventListener & {
118
+ (event: CallbackEvent<T>): void;
119
+ }) | null
120
+ ```
121
+
122
+ ### CallbackEvent
123
+
124
+ ```ts
125
+ Event & {
126
+ currentTarget: HTMLElementTagNameMap[T];
127
+ }
128
+ ```
129
+
130
+ ## Slots
131
+
132
+ * children
133
+
134
+ HTMLElement
135
+
136
+ The content of the Popover.
137
+
138
+ Examples
139
+
140
+ ### Examples
141
+
142
+ * #### Code
143
+
144
+ ##### jsx
145
+
146
+ ```jsx
147
+ <>
148
+ <s-button commandFor="product-options-popover">Product options</s-button>
149
+
150
+ <s-popover id="product-options-popover">
151
+ <s-stack direction="block">
152
+ <s-button variant="tertiary">Import</s-button>
153
+ <s-button variant="tertiary">Export</s-button>
154
+ </s-stack>
155
+ </s-popover>
156
+ </>
157
+ ```
158
+
159
+ ##### html
160
+
161
+ ```html
162
+ <s-button commandFor="product-options-popover">Product options</s-button>
163
+
164
+ <s-popover id="product-options-popover">
165
+ <s-stack direction="block">
166
+ <s-button variant="tertiary">Import</s-button>
167
+ <s-button variant="tertiary">Export</s-button>
168
+ </s-stack>
169
+ </s-popover>
170
+ ```
171
+
172
+ * #### Popover with notifications
173
+
174
+ ##### Description
175
+
176
+ Popover displaying admin notifications such as new orders, inventory alerts, and payment confirmations, demonstrating how popovers can show informational content without cluttering the main interface.
177
+
178
+ ##### jsx
179
+
180
+ ```jsx
181
+ <>
182
+ <s-button commandFor="notifications-popover" icon="notification">
183
+ Notifications
184
+ </s-button>
185
+
186
+ <s-popover id="notifications-popover">
187
+ <s-box padding="base">
188
+ <s-stack gap="small-200">
189
+ <s-stack gap="small">
190
+ <s-heading>New order received</s-heading>
191
+ <s-paragraph color="subdued">Order #1234 was placed 5 minutes ago</s-paragraph>
192
+ </s-stack>
193
+
194
+ <s-divider />
195
+
196
+ <s-stack gap="small">
197
+ <s-heading>Low inventory alert</s-heading>
198
+ <s-paragraph color="subdued">3 products are running low on stock</s-paragraph>
199
+ </s-stack>
200
+
201
+ <s-divider />
202
+
203
+ <s-stack gap="small">
204
+ <s-heading>Payment processed</s-heading>
205
+ <s-paragraph color="subdued">$250.00 payment confirmed for order #1230</s-paragraph>
206
+ </s-stack>
207
+ </s-stack>
208
+ </s-box>
209
+ </s-popover>
210
+ </>
211
+ ```
212
+
213
+ ##### html
214
+
215
+ ```html
216
+ <s-button commandFor="notifications-popover" icon="notification">
217
+ Notifications
218
+ </s-button>
219
+
220
+ <s-popover id="notifications-popover">
221
+ <s-box padding="base">
222
+ <s-stack gap="small-200">
223
+ <s-stack gap="small">
224
+ <s-heading>New order received</s-heading>
225
+ <s-paragraph color="subdued">
226
+ Order #1234 was placed 5 minutes ago
227
+ </s-paragraph>
228
+ </s-stack>
229
+
230
+ <s-divider />
231
+
232
+ <s-stack gap="small">
233
+ <s-heading>Low inventory alert</s-heading>
234
+ <s-paragraph color="subdued">
235
+ 3 products are running low on stock
236
+ </s-paragraph>
237
+ </s-stack>
238
+
239
+ <s-divider />
240
+
241
+ <s-stack gap="small">
242
+ <s-heading>Payment processed</s-heading>
243
+ <s-paragraph color="subdued">
244
+ $250.00 payment confirmed for order #1230
245
+ </s-paragraph>
246
+ </s-stack>
247
+ </s-stack>
248
+ </s-box>
249
+ </s-popover>
250
+ ```
251
+
252
+ * #### Popover with choice list
253
+
254
+ ##### Description
255
+
256
+ Popover containing a choice list and action button demonstrating how popovers can be used for settings and configuration interfaces.
257
+
258
+ ##### jsx
259
+
260
+ ```jsx
261
+ <>
262
+ <s-button commandFor="table-settings-popover" icon="settings">
263
+ Columns
264
+ </s-button>
265
+
266
+ <s-popover id="table-settings-popover">
267
+ <s-box padding="base">
268
+ <s-stack gap="small-200">
269
+ <s-stack gap="small">
270
+ <s-heading>Choose columns to display</s-heading>
271
+ <s-choice-list label="Select columns to display">
272
+ <s-choice value="sku" selected>
273
+ Sku
274
+ </s-choice>
275
+ <s-choice value="inventory" selected>
276
+ Inventory
277
+ </s-choice>
278
+ <s-choice value="price" selected>
279
+ Price
280
+ </s-choice>
281
+ <s-choice value="vendor">Vendor</s-choice>
282
+ <s-choice value="type">Product type</s-choice>
283
+ </s-choice-list>
284
+ </s-stack>
285
+ <s-button variant="primary">Apply changes</s-button>
286
+ </s-stack>
287
+ </s-box>
288
+ </s-popover>
289
+ </>
290
+ ```
291
+
292
+ ##### html
293
+
294
+ ```html
295
+ <s-button commandFor="table-settings-popover" disclosure="true" icon="settings">
296
+ Columns
297
+ </s-button>
298
+
299
+ <s-popover id="table-settings-popover">
300
+ <s-box padding="base">
301
+ <s-stack gap="small-200">
302
+ <s-stack gap="small">
303
+ <s-heading>Choose columns to display</s-heading>
304
+ <s-choice-list label="Select columns to display">
305
+ <s-choice value="sku" selected>Sku</s-choice>
306
+ <s-choice value="inventory" selected>Inventory</s-choice>
307
+ <s-choice value="price" selected>Price</s-choice>
308
+ <s-choice value="vendor">Vendor</s-choice>
309
+ <s-choice value="type">Product type</s-choice>
310
+ </s-choice-list>
311
+ </s-stack>
312
+ <s-button variant="primary">Apply changes</s-button>
313
+ </s-stack>
314
+ </s-box>
315
+ </s-popover>
316
+ ```
317
+
318
+ * #### Popover with inventory details
319
+
320
+ ##### Description
321
+
322
+ Popover displaying detailed inventory information using Box padding instead of Section, demonstrating an alternative layout approach for data-focused content.
323
+
324
+ ##### jsx
325
+
326
+ ```jsx
327
+ <>
328
+ <s-button commandFor="stock-popover" icon="info">
329
+ Stock details
330
+ </s-button>
331
+
332
+ <s-popover id="stock-popover">
333
+ <s-box padding="base">
334
+ <s-stack gap="small">
335
+ <s-stack gap="small-200">
336
+ <s-stack direction="inline" justifyContent="space-between">
337
+ <s-text color="subdued">Available</s-text>
338
+ <s-text>127 units</s-text>
339
+ </s-stack>
340
+
341
+ <s-stack direction="inline" justifyContent="space-between">
342
+ <s-text color="subdued">Reserved</s-text>
343
+ <s-text>15 units</s-text>
344
+ </s-stack>
345
+
346
+ <s-stack direction="inline" justifyContent="space-between">
347
+ <s-text color="subdued">In transit</s-text>
348
+ <s-text>50 units</s-text>
349
+ </s-stack>
350
+ </s-stack>
351
+
352
+ <s-divider />
353
+
354
+ <s-stack direction="inline" justifyContent="space-between">
355
+ <s-text>Total stock</s-text>
356
+ <s-text>192 units</s-text>
357
+ </s-stack>
358
+
359
+ <s-button variant="secondary">View full inventory report</s-button>
360
+ </s-stack>
361
+ </s-box>
362
+ </s-popover>
363
+ </>
364
+ ```
365
+
366
+ ##### html
367
+
368
+ ```html
369
+ <s-button commandFor="stock-popover" icon="info">
370
+ Stock details
371
+ </s-button>
372
+
373
+ <s-popover id="stock-popover">
374
+ <s-box padding="base">
375
+ <s-stack gap="small">
376
+ <s-stack gap="small-200">
377
+ <s-stack direction="inline" justifyContent="space-between">
378
+ <s-text color="subdued">Available</s-text>
379
+ <s-text>127 units</s-text>
380
+ </s-stack>
381
+
382
+ <s-stack direction="inline" justifyContent="space-between">
383
+ <s-text color="subdued">Reserved</s-text>
384
+ <s-text>15 units</s-text>
385
+ </s-stack>
386
+
387
+ <s-stack direction="inline" justifyContent="space-between">
388
+ <s-text color="subdued">In transit</s-text>
389
+ <s-text>50 units</s-text>
390
+ </s-stack>
391
+ </s-stack>
392
+
393
+ <s-divider />
394
+
395
+ <s-stack direction="inline" justifyContent="space-between">
396
+ <s-text>Total stock</s-text>
397
+ <s-text>192 units</s-text>
398
+ </s-stack>
399
+
400
+ <s-button variant="secondary">View full inventory report</s-button>
401
+ </s-stack>
402
+ </s-box>
403
+ </s-popover>
404
+ ```
405
+
406
+ ## Usage
407
+
408
+ Popovers are closed by default and should be triggered by a button using the `commandFor` attribute. The button's `commandFor` value should match the popover's `id`. The popover's position is determined by the button that triggers it.
409
+
410
+ ## Best practices
411
+
412
+ * Use for secondary or less important information and actions since they're hidden until triggered
413
+ * Contain actions that share a relationship to each other
414
+ * Be triggered by a clearly labeled default or tertiary button
415
+
416
+ ## Content guidelines
417
+
418
+ * Use clear action verbs in the {verb}+{noun} format (e.g., "Create order", "Edit HTML")
419
+ * Avoid unnecessary words like "the", "an", or "a"
@@ -0,0 +1,121 @@
1
+ ---
2
+ title: QueryContainer
3
+ description: >-
4
+ Establishes a query container for responsive design. Use `s-query-container`
5
+ to define an element as a containment context, enabling child components or
6
+ styles to adapt based on the container’s size.
7
+ api_name: app-home
8
+ source_url:
9
+ html: >-
10
+ https://shopify.dev/docs/api/app-home/polaris-web-components/structure/querycontainer
11
+ md: >-
12
+ https://shopify.dev/docs/api/app-home/polaris-web-components/structure/querycontainer.md
13
+ ---
14
+
15
+ # Query​Container
16
+
17
+ Establishes a query container for responsive design. Use `s-query-container` to define an element as a containment context, enabling child components or styles to adapt based on the container’s size.
18
+
19
+ ## Properties
20
+
21
+ Use to define an element as a containment context, enabling child components or styles to adapt based on the container’s size.
22
+
23
+ * containerName
24
+
25
+ string
26
+
27
+ Default: ''
28
+
29
+ The name of the container, which can be used in your container queries to target this container specifically.
30
+
31
+ We place the container name of `s-default` on every container. Because of this, it is not required to add a `containerName` identifier in your queries. For example, a `@container (inline-size <= 300px) none, auto` query is equivalent to `@container s-default (inline-size <= 300px) none, auto`.
32
+
33
+ Any value set in `containerName` will be set alongside alongside `s-default`. For example, `containerName="my-container-name"` will result in a value of `s-default my-container-name` set on the `container-name` CSS property of the rendered HTML.
34
+
35
+ ## Slots
36
+
37
+ * children
38
+
39
+ HTMLElement
40
+
41
+ The content of the container.
42
+
43
+ Examples
44
+
45
+ ### Examples
46
+
47
+ * ####
48
+
49
+ ##### jsx
50
+
51
+ ```jsx
52
+ <s-query-container>
53
+ <s-box
54
+ padding="@container (inline-size > 500px) large-500, none"
55
+ background="strong"
56
+ >
57
+ Padding is applied when the inline-size > 500px
58
+ </s-box>
59
+ </s-query-container>
60
+ ```
61
+
62
+ ##### html
63
+
64
+ ```html
65
+ <s-query-container>
66
+ <s-box
67
+ padding="@container (inline-size > 500px) large-500, none"
68
+ background="strong"
69
+ >
70
+ Padding is applied when the inline-size '>' 500px
71
+ </s-box>
72
+ </s-query-container>
73
+ ```
74
+
75
+ * #### Basic Usage
76
+
77
+ ##### Description
78
+
79
+ Demonstrates the simplest way to use QueryContainer, wrapping content with a named container context.
80
+
81
+ ##### jsx
82
+
83
+ ```jsx
84
+ <>
85
+ <s-box inlineSize="375px">
86
+ <s-query-container id="product-section" containerName="product">
87
+ <s-box padding="@container product (inline-size > 400px) large-500, none" borderWidth="base" borderColor="base" borderRadius="base">
88
+ <s-text>Padding is different depending on the container size</s-text>
89
+ </s-box>
90
+ </s-query-container>
91
+ </s-box>
92
+
93
+ <s-box inlineSize="450px">
94
+ <s-query-container id="product-section" containerName="product">
95
+ <s-box padding="@container product (inline-size > 400px) large-500, none" borderWidth="base" borderColor="base" borderRadius="base">
96
+ <s-text>Padding is different depending on the container size</s-text>
97
+ </s-box>
98
+ </s-query-container>
99
+ </s-box>
100
+ </>
101
+ ```
102
+
103
+ ##### html
104
+
105
+ ```html
106
+ <s-box inlineSize="375px">
107
+ <s-query-container id="product-section" containerName="product">
108
+ <s-box padding="@container product (inline-size > 400px) large-500, none">
109
+ <s-text>Padding is different depending on the container size</s-text>
110
+ </s-box>
111
+ </s-query-container>
112
+ </s-box>
113
+
114
+ <s-box inlineSize="450px">
115
+ <s-query-container id="product-section" containerName="product">
116
+ <s-box padding="@container product (inline-size > 400px) large-500, none">
117
+ <s-text>Padding is different depending on the container size</s-text>
118
+ </s-box>
119
+ </s-query-container>
120
+ </s-box>
121
+ ```