@shopify/ui-extensions 2025.10.0-rc.44 → 2025.10.0-rc.46
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/build/ts/docs/shared/components/ColorField.d.ts.map +1 -1
- package/build/ts/surfaces/admin/api/intents/intents.d.ts +132 -0
- package/build/ts/surfaces/admin/api/intents/intents.d.ts.map +1 -0
- package/build/ts/surfaces/admin/api/intents/intents.doc.d.ts +4 -0
- package/build/ts/surfaces/admin/api/intents/intents.doc.d.ts.map +1 -0
- package/build/ts/surfaces/admin/api/standard/standard.d.ts +2 -7
- package/build/ts/surfaces/admin/api/standard/standard.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/ChoiceList/ChoiceList.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/ChoiceList.d.ts +3 -1
- package/build/ts/surfaces/point-of-sale/components/DateField/DateField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/DateField.d.ts +7 -9
- package/build/ts/surfaces/point-of-sale/components/DatePicker/DatePicker.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/DatePicker.d.ts +6 -2
- package/build/ts/surfaces/point-of-sale/components/DateSpinner/DateSpinner.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/DateSpinner.d.ts +10 -2
- package/build/ts/surfaces/point-of-sale/components/Divider/Divider.doc.d.ts +4 -0
- package/build/ts/surfaces/point-of-sale/components/Divider/Divider.doc.d.ts.map +1 -0
- package/build/ts/surfaces/point-of-sale/components/EmailField/EmailField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/EmailField.d.ts +9 -2
- package/build/ts/surfaces/point-of-sale/components/NumberField/NumberField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/NumberField.d.ts +19 -20
- package/build/ts/surfaces/point-of-sale/components/SearchField/SearchField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/SearchField.d.ts +6 -2
- package/build/ts/surfaces/point-of-sale/components/TextArea/TextArea.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/TextArea.d.ts +9 -2
- package/build/ts/surfaces/point-of-sale/components/TextField/TextField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/TextField.d.ts +17 -2
- package/build/ts/surfaces/point-of-sale/components/TimeField/TimeField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/TimeField.d.ts +8 -4
- package/build/ts/surfaces/point-of-sale/components/TimePicker/TimePicker.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/TimePicker.d.ts +6 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -3
- package/src/docs/shared/components/ColorField.ts +2 -1
- package/src/surfaces/admin/api/intents/examples/create-article.js +9 -0
- package/src/surfaces/admin/api/intents/examples/create-catalog.js +9 -0
- package/src/surfaces/admin/api/intents/examples/create-collection.js +9 -0
- package/src/surfaces/admin/api/intents/examples/create-customer.js +9 -0
- package/src/surfaces/admin/api/intents/examples/create-discount.js +11 -0
- package/src/surfaces/admin/api/intents/examples/create-market.js +9 -0
- package/src/surfaces/admin/api/intents/examples/create-menu.js +9 -0
- package/src/surfaces/admin/api/intents/examples/create-metafield-definition.js +11 -0
- package/src/surfaces/admin/api/intents/examples/create-metaobject-definition.js +9 -0
- package/src/surfaces/admin/api/intents/examples/create-metaobject.js +11 -0
- package/src/surfaces/admin/api/intents/examples/create-page.js +9 -0
- package/src/surfaces/admin/api/intents/examples/create-product.js +9 -0
- package/src/surfaces/admin/api/intents/examples/create-variant.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-article.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-catalog.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-collection.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-customer.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-discount.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-market.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-menu.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-metafield-definition.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-metaobject-definition.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-metaobject.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-page.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-product.js +11 -0
- package/src/surfaces/admin/api/intents/examples/edit-variant.js +11 -0
- package/src/surfaces/admin/api/intents/intents.ts +153 -0
- package/src/surfaces/admin/api/standard/standard.ts +2 -6
- package/src/surfaces/point-of-sale/components/Banner/examples/default.html +8 -8
- package/src/surfaces/point-of-sale/components/Box/examples/default.html +2 -2
- package/src/surfaces/point-of-sale/components/Button/examples/default.html +2 -4
- package/src/surfaces/point-of-sale/components/ChoiceList/examples/default.html +5 -4
- package/src/surfaces/point-of-sale/components/ChoiceList/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/ChoiceList/examples/multiple-selection.jsx +9 -0
- package/src/surfaces/point-of-sale/components/ChoiceList.d.ts +3 -1
- package/src/surfaces/point-of-sale/components/Clickable/examples/default.html +5 -2
- package/src/surfaces/point-of-sale/components/DateField/examples/default.html +2 -10
- package/src/surfaces/point-of-sale/components/DateField/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/DateField.d.ts +7 -9
- package/src/surfaces/point-of-sale/components/DatePicker/examples/command-system.jsx +10 -0
- package/src/surfaces/point-of-sale/components/DatePicker/examples/default.html +4 -5
- package/src/surfaces/point-of-sale/components/DatePicker/examples/event-handling.jsx +7 -0
- package/src/surfaces/point-of-sale/components/DatePicker.d.ts +6 -2
- package/src/surfaces/point-of-sale/components/DateSpinner/examples/command-system.jsx +10 -0
- package/src/surfaces/point-of-sale/components/DateSpinner/examples/default.html +1 -2
- package/src/surfaces/point-of-sale/components/DateSpinner/examples/event-handling.jsx +7 -0
- package/src/surfaces/point-of-sale/components/DateSpinner.d.ts +10 -2
- package/src/surfaces/point-of-sale/components/Divider/examples/default.html +1 -0
- package/src/surfaces/point-of-sale/components/EmailField/examples/accessory-slot.jsx +9 -0
- package/src/surfaces/point-of-sale/components/EmailField/examples/default.html +3 -10
- package/src/surfaces/point-of-sale/components/EmailField/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/EmailField.d.ts +9 -2
- package/src/surfaces/point-of-sale/components/Heading/examples/default.html +4 -5
- package/src/surfaces/point-of-sale/components/Icon/examples/default.html +4 -1
- package/src/surfaces/point-of-sale/components/Image/examples/default.html +1 -1
- package/src/surfaces/point-of-sale/components/Modal/examples/default.html +6 -8
- package/src/surfaces/point-of-sale/components/NumberField/examples/controls-constraints.jsx +9 -0
- package/src/surfaces/point-of-sale/components/NumberField/examples/default.html +5 -2
- package/src/surfaces/point-of-sale/components/NumberField/examples/input-mode.jsx +15 -0
- package/src/surfaces/point-of-sale/components/NumberField.d.ts +19 -20
- package/src/surfaces/point-of-sale/components/Page/examples/default.html +3 -4
- package/src/surfaces/point-of-sale/components/PosBlock/examples/default.html +3 -9
- package/src/surfaces/point-of-sale/components/ScrollBox/examples/default.html +5 -4
- package/src/surfaces/point-of-sale/components/SearchField/examples/default.html +1 -1
- package/src/surfaces/point-of-sale/components/SearchField/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/SearchField.d.ts +6 -2
- package/src/surfaces/point-of-sale/components/Section/examples/default.html +6 -8
- package/src/surfaces/point-of-sale/components/Stack/examples/default.html +3 -3
- package/src/surfaces/point-of-sale/components/Text/examples/default.html +3 -6
- package/src/surfaces/point-of-sale/components/TextArea/examples/accessory-slot.jsx +9 -0
- package/src/surfaces/point-of-sale/components/TextArea/examples/default.html +4 -1
- package/src/surfaces/point-of-sale/components/TextArea/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/TextArea/examples/rows-configuration.jsx +7 -0
- package/src/surfaces/point-of-sale/components/TextArea.d.ts +9 -2
- package/src/surfaces/point-of-sale/components/TextField/examples/accessory-slot.jsx +5 -0
- package/src/surfaces/point-of-sale/components/TextField/examples/common-props.jsx +11 -0
- package/src/surfaces/point-of-sale/components/TextField/examples/default.html +5 -3
- package/src/surfaces/point-of-sale/components/TextField/examples/event-handling.jsx +17 -0
- package/src/surfaces/point-of-sale/components/TextField.d.ts +17 -2
- package/src/surfaces/point-of-sale/components/Tile/examples/default.html +2 -5
- package/src/surfaces/point-of-sale/components/TimeField/examples/default.html +1 -9
- package/src/surfaces/point-of-sale/components/TimeField/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/TimeField.d.ts +8 -4
- package/src/surfaces/point-of-sale/components/TimePicker/examples/command-system.jsx +10 -0
- package/src/surfaces/point-of-sale/components/TimePicker/examples/default.html +4 -1
- package/src/surfaces/point-of-sale/components/TimePicker/examples/event-handling.jsx +7 -0
- package/src/surfaces/point-of-sale/components/TimePicker.d.ts +6 -2
- package/src/surfaces/point-of-sale/components.d.ts +169 -72
|
@@ -8,12 +8,7 @@
|
|
|
8
8
|
/* eslint-disable import-x/namespace */
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/triple-slash-reference, spaced-comment
|
|
10
10
|
/// <reference lib="DOM" />
|
|
11
|
-
import type {
|
|
12
|
-
DateFieldProps,
|
|
13
|
-
Key,
|
|
14
|
-
Ref,
|
|
15
|
-
ComponentChild,
|
|
16
|
-
} from './components-shared.d.ts';
|
|
11
|
+
import type {DateFieldProps, Key, Ref} from './components-shared.d.ts';
|
|
17
12
|
|
|
18
13
|
export type ComponentChildren = any;
|
|
19
14
|
/**
|
|
@@ -47,11 +42,14 @@ export interface DateFieldJSXProps
|
|
|
47
42
|
DateFieldProps,
|
|
48
43
|
'label' | 'details' | 'value' | 'disabled' | 'error'
|
|
49
44
|
> {
|
|
45
|
+
/** Function called when the user makes any changes in the field. */
|
|
50
46
|
onInput?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
51
|
-
|
|
52
|
-
onBlur?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
47
|
+
/** Function called after editing completes (typically on blur). */
|
|
53
48
|
onChange?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
54
|
-
|
|
49
|
+
/** Function called when the element loses focus. */
|
|
50
|
+
onBlur?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
51
|
+
/** Function called when the element receives focus. */
|
|
52
|
+
onFocus?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
55
53
|
}
|
|
56
54
|
declare global {
|
|
57
55
|
interface HTMLElementTagNameMap {
|
|
@@ -39,10 +39,14 @@ export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
|
39
39
|
declare const tagName = 's-date-picker';
|
|
40
40
|
export interface DatePickerJSXProps
|
|
41
41
|
extends Pick<DatePickerProps, 'id' | 'value'> {
|
|
42
|
+
/** Function called when the user selects a date from the picker. */
|
|
43
|
+
onInput?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
44
|
+
/** Function called when the user selects a date from the picker that is different to the current value. */
|
|
45
|
+
onChange?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
46
|
+
/** Function called when the date picker is dismissed. */
|
|
42
47
|
onBlur?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
48
|
+
/** Function called when the date picker is revealed. */
|
|
43
49
|
onFocus?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
44
|
-
onChange?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
45
|
-
onInput?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
46
50
|
}
|
|
47
51
|
declare global {
|
|
48
52
|
interface HTMLElementTagNameMap {
|
|
@@ -39,10 +39,18 @@ export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
|
39
39
|
declare const tagName = 's-date-spinner';
|
|
40
40
|
export interface DateSpinnerJSXProps
|
|
41
41
|
extends Pick<DateSpinnerProps, 'id' | 'value'> {
|
|
42
|
+
/**
|
|
43
|
+
* Function called when the user makes a selection.
|
|
44
|
+
*/
|
|
45
|
+
onInput?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
46
|
+
/**
|
|
47
|
+
* Function called when the value changes. Only called when a different value is selected.
|
|
48
|
+
*/
|
|
49
|
+
onChange?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
50
|
+
/** Function called when the date picker is dismissed. */
|
|
42
51
|
onBlur?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
52
|
+
/** Function called when the date picker is revealed. */
|
|
43
53
|
onFocus?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
44
|
-
onChange?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
45
|
-
onInput?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
46
54
|
}
|
|
47
55
|
declare global {
|
|
48
56
|
interface HTMLElementTagNameMap {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<s-divider />
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
<s-email-field
|
|
2
|
-
label="Email"
|
|
3
|
-
|
|
2
|
+
label="Email"
|
|
3
|
+
value="snowdevil@shopify.com"
|
|
4
4
|
required
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<s-email-field
|
|
8
|
-
label="Email"
|
|
9
|
-
placeholder="Enter your email"
|
|
10
|
-
required
|
|
11
|
-
error="Enter a valid email address"
|
|
12
|
-
value="example.com"></s-email-field>
|
|
5
|
+
/>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<s-email-field
|
|
2
|
+
label="Customer email"
|
|
3
|
+
placeholder="customer@example.com"
|
|
4
|
+
onInput={(event) => console.log('Input:', event.target.value)}
|
|
5
|
+
onChange={(event) => console.log('Change:', event.target.value)}
|
|
6
|
+
onFocus={(event) => console.log('Focus')}
|
|
7
|
+
onBlur={(event) => console.log('Blur')}
|
|
8
|
+
/>
|
|
@@ -54,10 +54,17 @@ export interface EmailFieldJSXProps
|
|
|
54
54
|
| 'maxLength'
|
|
55
55
|
| 'details'
|
|
56
56
|
> {
|
|
57
|
+
/** Function called when the user makes any changes in the field. */
|
|
57
58
|
onInput?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
58
|
-
|
|
59
|
-
onBlur?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
59
|
+
/** Function called after editing completes (typically on blur). */
|
|
60
60
|
onChange?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
61
|
+
/** Function called when the element loses focus. */
|
|
62
|
+
onBlur?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
63
|
+
/** Function called when the element receives focus. */
|
|
64
|
+
onFocus?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
65
|
+
/**
|
|
66
|
+
* Additional content to be displayed in the field. Commonly used to display clickable text.
|
|
67
|
+
*/
|
|
61
68
|
accessory?: ComponentChild;
|
|
62
69
|
}
|
|
63
70
|
declare global {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
<s-heading>Heading (
|
|
2
|
-
|
|
1
|
+
<s-heading>Heading (H2)</s-heading>
|
|
3
2
|
<s-section>
|
|
4
|
-
<s-heading>Heading (
|
|
3
|
+
<s-heading>Heading (H3)</s-heading>
|
|
5
4
|
<s-section>
|
|
6
|
-
<s-heading>Heading (
|
|
5
|
+
<s-heading>Heading (H4)</s-heading>
|
|
7
6
|
</s-section>
|
|
8
|
-
</s-section>
|
|
7
|
+
</s-section>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<s-image src="example.png" inlineSize="auto"
|
|
1
|
+
<s-image src="example.png" inlineSize="auto" />
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
<s-button command="--show" commandFor="modal">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<s-button slot="primary-action"
|
|
7
|
-
Label
|
|
8
|
-
</s-button>
|
|
1
|
+
<s-button command="--show" commandFor="modal">
|
|
2
|
+
Open modal
|
|
3
|
+
</s-button>
|
|
4
|
+
<s-modal id="modal" heading="Changes could not be saved">
|
|
5
|
+
Please check your internet connection and try again.
|
|
6
|
+
<s-button slot="primary-action">OK</s-button>
|
|
9
7
|
</s-modal>
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
<s-number-field
|
|
2
|
-
|
|
1
|
+
<s-number-field
|
|
2
|
+
label="Item count"
|
|
3
|
+
value="976"
|
|
4
|
+
required
|
|
5
|
+
/>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<s-stack>
|
|
2
|
+
<s-number-field
|
|
3
|
+
label="Price"
|
|
4
|
+
placeholder="0.00"
|
|
5
|
+
inputMode="decimal"
|
|
6
|
+
onInput={(event) => console.log('Value:', event.target.value)}
|
|
7
|
+
/>
|
|
8
|
+
|
|
9
|
+
<s-number-field
|
|
10
|
+
label="Stock count"
|
|
11
|
+
placeholder="0"
|
|
12
|
+
inputMode="numeric"
|
|
13
|
+
onInput={(event) => console.log('Value:', event.target.value)}
|
|
14
|
+
/>
|
|
15
|
+
</s-stack>;
|
|
@@ -42,7 +42,7 @@ export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
declare const tagName = 's-number-field';
|
|
45
|
-
export interface
|
|
45
|
+
export interface NumberFieldJSXProps
|
|
46
46
|
extends Pick<
|
|
47
47
|
NumberFieldProps,
|
|
48
48
|
| 'label'
|
|
@@ -56,20 +56,12 @@ export interface PickedJSXProps
|
|
|
56
56
|
| 'min'
|
|
57
57
|
| 'controls'
|
|
58
58
|
> {
|
|
59
|
-
inputMode?: Extract<NumberFieldProps['inputMode'], 'decimal' | 'numeric'>;
|
|
60
|
-
onInput?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
61
|
-
onFocus?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
62
|
-
onBlur?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
63
|
-
onChange?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
64
|
-
accessory?: ComponentChild;
|
|
65
|
-
}
|
|
66
|
-
export interface NumberFieldJSXProps extends PickedJSXProps {
|
|
67
59
|
/**
|
|
68
60
|
* Content to use as the field label.
|
|
69
61
|
*
|
|
70
62
|
* Label is not supported when using Stepper controls
|
|
71
63
|
*/
|
|
72
|
-
label?:
|
|
64
|
+
label?: NumberFieldProps['label'];
|
|
73
65
|
/**
|
|
74
66
|
* Additional text to provide context or guidance for the field.
|
|
75
67
|
* This text is displayed along with the field and its label
|
|
@@ -79,7 +71,7 @@ export interface NumberFieldJSXProps extends PickedJSXProps {
|
|
|
79
71
|
*
|
|
80
72
|
* Details are not supported when using Stepper controls
|
|
81
73
|
*/
|
|
82
|
-
details?:
|
|
74
|
+
details?: NumberFieldProps['details'];
|
|
83
75
|
/**
|
|
84
76
|
* Whether the field needs a value. This requirement adds semantic value
|
|
85
77
|
* to the field, but it will not cause an error to appear automatically.
|
|
@@ -90,14 +82,14 @@ export interface NumberFieldJSXProps extends PickedJSXProps {
|
|
|
90
82
|
*
|
|
91
83
|
* Required is not supported when using Stepper controls
|
|
92
84
|
*/
|
|
93
|
-
required?:
|
|
85
|
+
required?: NumberFieldProps['required'];
|
|
94
86
|
/**
|
|
95
87
|
* Indicate an error to the user. The field will be given a specific stylistic treatment
|
|
96
88
|
* to communicate problems that have to be resolved immediately.
|
|
97
89
|
*
|
|
98
90
|
* Error is not supported when using Stepper controls
|
|
99
91
|
*/
|
|
100
|
-
error?:
|
|
92
|
+
error?: NumberFieldProps['error'];
|
|
101
93
|
/**
|
|
102
94
|
* Sets the virtual keyboard.
|
|
103
95
|
*
|
|
@@ -106,20 +98,19 @@ export interface NumberFieldJSXProps extends PickedJSXProps {
|
|
|
106
98
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
|
|
107
99
|
* @default 'decimal'
|
|
108
100
|
*/
|
|
109
|
-
inputMode?:
|
|
101
|
+
inputMode?: NumberFieldProps['inputMode'];
|
|
110
102
|
/**
|
|
111
103
|
* A short hint that describes the expected value of the field.
|
|
112
104
|
*
|
|
113
105
|
* Placeholder text is not supported when using Stepper controls due to constrained space for the number field, especially on phones.
|
|
114
106
|
*/
|
|
115
|
-
placeholder?:
|
|
107
|
+
placeholder?: NumberFieldProps['placeholder'];
|
|
116
108
|
/**
|
|
117
|
-
*
|
|
118
|
-
* Commonly used to display an icon that activates a tooltip providing more information.
|
|
109
|
+
* Additional content to be displayed in the field. Commonly used to display clickable text.
|
|
119
110
|
*
|
|
120
|
-
* Accessory is not supported when using Stepper controls
|
|
111
|
+
* > Note: Accessory is not supported when using Stepper controls
|
|
121
112
|
*/
|
|
122
|
-
accessory?:
|
|
113
|
+
accessory?: ComponentChild;
|
|
123
114
|
/**
|
|
124
115
|
* Sets the type of controls displayed for the field.
|
|
125
116
|
*
|
|
@@ -130,7 +121,15 @@ export interface NumberFieldJSXProps extends PickedJSXProps {
|
|
|
130
121
|
* - `none`: no controls are displayed and users must input the value manually.
|
|
131
122
|
* - `auto`: the presence of the controls depends on the surface and context.
|
|
132
123
|
*/
|
|
133
|
-
controls?:
|
|
124
|
+
controls?: NumberFieldProps['controls'];
|
|
125
|
+
/** Function called when the user makes any changes in the field. */
|
|
126
|
+
onInput?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
127
|
+
/** Function called after editing completes (typically on blur). */
|
|
128
|
+
onChange?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
129
|
+
/** Function called when the element loses focus. */
|
|
130
|
+
onBlur?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
131
|
+
/** Function called when the element receives focus. */
|
|
132
|
+
onFocus?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
134
133
|
}
|
|
135
134
|
declare global {
|
|
136
135
|
interface HTMLElementTagNameMap {
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
<s-pos-block>
|
|
2
|
-
<s-
|
|
3
|
-
|
|
4
|
-
onClick={onActionClick}
|
|
5
|
-
>
|
|
6
|
-
Action
|
|
7
|
-
</s-button>
|
|
8
|
-
<s-box padding="base">
|
|
9
|
-
<s-text>Label</s-text>
|
|
2
|
+
<s-box paddingBlock="base">
|
|
3
|
+
<s-text>Customer Loyalty</s-text>
|
|
10
4
|
</s-box>
|
|
11
|
-
</s-pos-block>
|
|
5
|
+
</s-pos-block>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<s-scroll-box>
|
|
2
|
-
<s-choice-list
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<s-choice-list>
|
|
3
|
+
<s-choice value="true-twin">True Twin board</s-choice>
|
|
4
|
+
<s-choice value="directional">Directional board</s-choice>
|
|
5
|
+
<s-choice value="volume">Volume shifted board</s-choice>
|
|
6
|
+
<s-choice value="asymmetrical">Asymmetrical board</s-choice>
|
|
6
7
|
</s-choice-list>
|
|
7
8
|
</s-scroll-box>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<s-search-field placeholder="Search"
|
|
1
|
+
<s-search-field placeholder="Search" />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<s-search-field
|
|
2
|
+
placeholder="Search products..."
|
|
3
|
+
value=""
|
|
4
|
+
onInput={(event) => console.log('Input:', event.target.value)}
|
|
5
|
+
onChange={(event) => console.log('Change:', event.target.value)}
|
|
6
|
+
onFocus={(event) => console.log('Search focused')}
|
|
7
|
+
onBlur={(event) => console.log('Search blurred')}
|
|
8
|
+
/>
|
|
@@ -39,10 +39,14 @@ export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
|
39
39
|
declare const tagName = 's-search-field';
|
|
40
40
|
export interface SearchFieldJSXProps
|
|
41
41
|
extends Pick<SearchFieldProps, 'disabled' | 'placeholder' | 'value'> {
|
|
42
|
-
|
|
43
|
-
onBlur?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
42
|
+
/** Function called when the user changes the value in the field. */
|
|
44
43
|
onInput?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
44
|
+
/** Function called when the field loses focus after the user changes the value in the field. */
|
|
45
45
|
onChange?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
46
|
+
/** Function called when the field loses focus. */
|
|
47
|
+
onBlur?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
48
|
+
/** Function called when the field is focused. */
|
|
49
|
+
onFocus?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
46
50
|
}
|
|
47
51
|
declare global {
|
|
48
52
|
interface HTMLElementTagNameMap {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
<s-section heading="
|
|
2
|
-
<s-button slot="secondary-actions"
|
|
3
|
-
Action
|
|
4
|
-
</s-button>
|
|
1
|
+
<s-section heading="Select product category">
|
|
2
|
+
<s-button slot="secondary-actions">Edit</s-button>
|
|
5
3
|
<s-choice-list>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
<s-choice value="snowboards">Snowboards</s-choice>
|
|
5
|
+
<s-choice value="jackets">Jackets</s-choice>
|
|
6
|
+
<s-choice value="label">Label</s-choice>
|
|
9
7
|
</s-choice-list>
|
|
10
|
-
</s-section>
|
|
8
|
+
</s-section>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<s-stack>
|
|
2
|
-
<s-
|
|
3
|
-
<s-
|
|
1
|
+
<s-stack gap="small" direction="inline" justifyContent="center">
|
|
2
|
+
<s-badge tone="neutral">Paid</s-badge>
|
|
3
|
+
<s-badge tone="success">Active</s-badge>
|
|
4
4
|
</s-stack>
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
<s-text>
|
|
2
|
-
<s-text
|
|
3
|
-
|
|
4
|
-
<s-text tone="success">Text</s-text>
|
|
5
|
-
<s-text tone="warning">Text</s-text>
|
|
6
|
-
<s-text tone="critical">Text</s-text>
|
|
1
|
+
<s-text>
|
|
2
|
+
<s-text type="strong">Name:</s-text> Jane Doe
|
|
3
|
+
</s-text>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<s-text-area
|
|
2
|
+
label="Customer feedback"
|
|
3
|
+
placeholder="Enter feedback..."
|
|
4
|
+
onInput={(event) => console.log('Input:', event.target.value)}
|
|
5
|
+
onChange={(event) => console.log('Change:', event.target.value)}
|
|
6
|
+
onFocus={(event) => console.log('Focused')}
|
|
7
|
+
onBlur={(event) => console.log('Blurred')}
|
|
8
|
+
/>
|
|
@@ -55,10 +55,17 @@ export interface TextAreaJSXProps
|
|
|
55
55
|
| 'maxLength'
|
|
56
56
|
| 'rows'
|
|
57
57
|
> {
|
|
58
|
+
/** Function called when the user makes any changes in the field. */
|
|
58
59
|
onInput?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
59
|
-
|
|
60
|
-
onBlur?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
60
|
+
/** Function called after editing completes (typically on blur). */
|
|
61
61
|
onChange?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
62
|
+
/** Function called when the element loses focus. */
|
|
63
|
+
onBlur?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
64
|
+
/** Function called when the element receives focus. */
|
|
65
|
+
onFocus?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
66
|
+
/**
|
|
67
|
+
* Additional content to be displayed in the field. Commonly used to display clickable text.
|
|
68
|
+
*/
|
|
62
69
|
accessory?: ComponentChild;
|
|
63
70
|
}
|
|
64
71
|
declare global {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<s-text-field
|
|
2
|
+
label="Product SKU"
|
|
3
|
+
value={sku}
|
|
4
|
+
placeholder="Enter SKU"
|
|
5
|
+
details="Use format: ABC-123"
|
|
6
|
+
error={hasError ? "SKU already exists" : undefined}
|
|
7
|
+
disabled={isProcessing}
|
|
8
|
+
required
|
|
9
|
+
maxLength={20}
|
|
10
|
+
onChange={(event) => setSku(event.target.value)}
|
|
11
|
+
/>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
<s-text-field
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<s-text-field
|
|
2
|
+
label="Store name"
|
|
3
|
+
value="Snowdevil"
|
|
4
|
+
required
|
|
5
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<s-text-field
|
|
2
|
+
label="Product SKU"
|
|
3
|
+
placeholder="Enter SKU"
|
|
4
|
+
onInput={(event) => {
|
|
5
|
+
console.log('Input:', event.target.value);
|
|
6
|
+
console.log('Current error:', event.target.error);
|
|
7
|
+
}}
|
|
8
|
+
onFocus={(event) => {
|
|
9
|
+
console.log('Focused with value:', event.target.value);
|
|
10
|
+
}}
|
|
11
|
+
onBlur={(event) => {
|
|
12
|
+
console.log('Blurred with value:', event.target.value);
|
|
13
|
+
}}
|
|
14
|
+
onChange={(event) => {
|
|
15
|
+
console.log('Changed to:', event.target.value);
|
|
16
|
+
}}
|
|
17
|
+
/>
|
|
@@ -54,10 +54,25 @@ export interface TextFieldJSXProps
|
|
|
54
54
|
| 'required'
|
|
55
55
|
| 'maxLength'
|
|
56
56
|
> {
|
|
57
|
+
/**
|
|
58
|
+
* Function called when the user makes any changes in the field.
|
|
59
|
+
*/
|
|
57
60
|
onInput?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Function called after editing completes (typically on blur).
|
|
63
|
+
*/
|
|
60
64
|
onChange?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
65
|
+
/**
|
|
66
|
+
* Function called when the element loses focus.
|
|
67
|
+
*/
|
|
68
|
+
onBlur?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
69
|
+
/**
|
|
70
|
+
* Function called when the element receives focus.
|
|
71
|
+
*/
|
|
72
|
+
onFocus?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
73
|
+
/**
|
|
74
|
+
* Additional content to be displayed in the field. Commonly used to display clickable text.
|
|
75
|
+
*/
|
|
61
76
|
accessory?: ComponentChild;
|
|
62
77
|
}
|
|
63
78
|
declare global {
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
<s-tile heading="
|
|
2
|
-
|
|
3
|
-
<s-tile heading="Title" subheading="Subtitle" tone="accent"></s-tile>
|
|
4
|
-
|
|
5
|
-
<s-tile heading="Title" subheading="Subtitle" disabled></s-tile>
|
|
1
|
+
<s-tile heading="Extension title" subheading="Subtitle" />
|
|
2
|
+
<s-tile heading="Extension title" subheading="Subtitle" tone="accent" />
|