Skip to content

Commit 2dcef6b

Browse files
authored
Merge branch '2025-10-rc' into 2025-10-rc-switch-to-currentTarget
2 parents 665bdda + e03def7 commit 2dcef6b

19 files changed

+329
-6
lines changed

packages/ui-extensions/docs/surfaces/checkout/staticPages/examples/variant-tone-and-color.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
<s-badge tone="success" color="strong">
55
Success Strong Badge
66
</s-badge>
7-
1.13 MB
Loading
290 KB
Loading
289 KB
Loading
935 KB
Loading
935 KB
Loading
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<s-box>
2+
{/* Modal that will be controlled by the buttons */}
3+
<s-modal id="example-modal" heading="Product Details">
4+
<s-text>
5+
This modal is controlled using the commands API. No JavaScript event
6+
handlers are needed—the browser handles all interactions automatically.
7+
</s-text>
8+
9+
<s-stack slot="primaryAction">
10+
{/* Button inside modal that can hide it */}
11+
<s-button commandFor="example-modal" command="--hide">
12+
Close
13+
</s-button>
14+
</s-stack>
15+
</s-modal>
16+
17+
{/* Button controls using different command actions */}
18+
<s-stack gap="small">
19+
<s-heading>Modal Controls</s-heading>
20+
21+
{/* Toggle button - most common use case */}
22+
<s-button
23+
commandFor="example-modal"
24+
command="--toggle"
25+
variant="primary">
26+
Toggle Modal
27+
</s-button>
28+
29+
{/* Explicit show button */}
30+
<s-button
31+
commandFor="example-modal"
32+
command="--show"
33+
tone="success">
34+
Show Modal
35+
</s-button>
36+
37+
{/* Explicit hide button */}
38+
<s-button
39+
commandFor="example-modal"
40+
command="--hide"
41+
tone="critical">
42+
Hide Modal
43+
</s-button>
44+
45+
{/* Auto command (default) - performs the most appropriate action */}
46+
<s-button
47+
commandFor="example-modal"
48+
command="--auto">
49+
Auto Command (Toggle)
50+
</s-button>
51+
</s-stack>
52+
</s-box>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export default function HandlingEvents() {
2+
const handleClick = () => {
3+
console.log('s-button clicked');
4+
};
5+
6+
return <s-button onClick={handleClick}>Click me</s-button>;
7+
}
8+
9+
// or
10+
11+
export default function HandlingEvents() {
12+
const handleClick = () => {
13+
console.log('s-button clicked');
14+
};
15+
16+
const button = document.createElement('s-button');
17+
button.addEventListener('click', handleClick);
18+
document.body.appendChild(button);
19+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{/* This works as expected - the "gap" property accepts string values */}
2+
<s-stack gap="base">...</s-stack>;
3+
4+
{/* This also works - the "checked" property accepts boolean values */}
5+
<s-checkbox checked={true}>...</s-checkbox>;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
if (propName in element) {
2+
// Set as a property
3+
element[propName] = propValue;
4+
} else {
5+
// Set as an attribute
6+
element.setAttribute(propName, propValue);
7+
}

0 commit comments

Comments
 (0)