Skip to content

Commit 65c7ab4

Browse files
committed
fix(dropzone): adopt actions slot
1 parent 726f09a commit 65c7ab4

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

2nd-gen/packages/swc/components/dropzone/stories/dropzone.stories.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,12 @@ const DROPZONE_SVG = `
7676
</svg>
7777
`;
7878

79-
// TODO: move swc-button inside swc-illustrated-message once it has a button-group slot.
80-
const makeDropzoneSlot = (
81-
headingText: string,
82-
size: DropzoneSize = 'm'
83-
) => html`
79+
const makeDropzoneSlot = (headingText: string) => html`
8480
<swc-illustrated-message>
8581
${unsafeHTML(DROPZONE_SVG)}
8682
<h2 slot="heading">${headingText}</h2>
87-
<span slot="description">${descriptionText}</span>
83+
<swc-button slot="actions" variant="accent">Browse files</swc-button>
8884
</swc-illustrated-message>
89-
<swc-button variant="accent" size=${size}>Browse files</swc-button>
9085
`;
9186

9287
// HTML string version used by the Playground so template(args) can spread all args.
@@ -97,8 +92,8 @@ const DROPZONE_SLOT_HTML = `
9792
<path d="M31.4,44.5c0,0.8,0.7,1.5,1.5,1.5h50c0.8,0,1.5-0.7,1.5-1.5s-0.7-1.5-1.5-1.5h-50C32.1,43,31.4,43.7,31.4,44.5z"/>
9893
</svg>
9994
<h2 slot="heading">Drag and drop your file</h2>
95+
<swc-button slot="actions" variant="accent">Browse files</swc-button>
10096
</swc-illustrated-message>
101-
<swc-button variant="accent">Browse files</swc-button>
10297
`;
10398

10499
// ────────────────────────
@@ -155,7 +150,7 @@ export const Sizes: Story = {
155150
aria-label="${sizeLabels[size]} drop zone"
156151
style="min-inline-size: 260px;"
157152
>
158-
${makeDropzoneSlot(sizeLabels[size], size)}
153+
${makeDropzoneSlot(sizeLabels[size])}
159154
</swc-dropzone>
160155
`
161156
)}

2nd-gen/packages/swc/components/illustrated-message/illustrated-message.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
display: flex;
4545
flex-direction: column;
4646
gap: token("spacing-75");
47+
align-items: center;
4748
text-align: center;
4849
}
4950

0 commit comments

Comments
 (0)