Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

Commit 409ac96

Browse files
committed
Merge branch 'next' into current
2 parents 1bf09f2 + 6f08f50 commit 409ac96

File tree

210 files changed

+1854
-709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+1854
-709
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: Bug Report
33
about: Create a bug report to help us fix a demonstrable problem with code in the library.
44
title: ''
55
labels: bug
6-
assignees: claviska
7-
6+
assignees:
87
---
98

109
### Describe the bug

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name: Feature Request
33
about: Suggest an idea for this project.
44
title: ''
55
labels: feature
6-
assignees: claviska
7-
86
---
97

108
### What issue are you having?

cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"erroneou",
5252
"errormessage",
5353
"esbuild",
54+
"exportmaps",
5455
"exportparts",
5556
"fieldsets",
5657
"formaction",
@@ -152,6 +153,7 @@
152153
"tinycolor",
153154
"transitionend",
154155
"treeitem",
156+
"treeshaking",
155157
"Triaging",
156158
"turbolinks",
157159
"typeof",

custom-elements-manifest.config.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { generateCustomData } from 'cem-plugin-vs-code-custom-data-generator';
1+
import * as path from 'path';
2+
import { customElementVsCodePlugin } from 'custom-element-vs-code-integration';
23
import { parse } from 'comment-parser';
34
import { pascalCase } from 'pascal-case';
45
import commandLineArgs from 'command-line-args';
56
import fs from 'fs';
6-
import * as path from 'path';
77

88
const packageData = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
99
const { name, description, version, author, homepage, license } = packageData;
@@ -53,8 +53,10 @@ export default {
5353
return;
5454
}
5555

56-
const tagName = 'sl-' + path.basename(importPath, '.component.ts');
56+
const tagNameWithoutPrefix = path.basename(importPath, '.component.ts');
57+
const tagName = 'sl-' + tagNameWithoutPrefix;
5758

59+
classDoc.tagNameWithoutPrefix = tagNameWithoutPrefix;
5860
classDoc.tagName = tagName;
5961

6062
// This used to be set to true by @customElement
@@ -167,7 +169,7 @@ export default {
167169
//
168170
const terms = [
169171
{ from: /^src\//, to: '' }, // Strip the src/ prefix
170-
{ from: /\.(t|j)sx?$/, to: '.js' } // Convert .ts to .js
172+
{ from: /\.component.(t|j)sx?$/, to: '.js' } // Convert .ts to .js
171173
];
172174

173175
mod.path = replace(mod.path, terms);
@@ -189,9 +191,15 @@ export default {
189191
}
190192
},
191193
// Generate custom VS Code data
192-
generateCustomData({
194+
customElementVsCodePlugin({
193195
outdir,
194-
cssFileName: null
196+
cssFileName: null,
197+
referencesTemplate: (_, tag) => [
198+
{
199+
name: 'Documentation',
200+
url: `https://shoelace.style/components/${tag.replace('sl-', '')}`
201+
}
202+
]
195203
})
196204
]
197205
};

docs/_includes/component.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<p>
8585
To import this component as a <a href="/frameworks/react">React component</a>:
8686
</p>
87-
<pre><code class="language-js">import { {{ component.name }} } from '@shoelace-style/shoelace/{{ meta.npmdir }}/react';</code></pre>
87+
<pre><code class="language-js">import {{ component.name }} from '@shoelace-style/shoelace/{{ meta.npmdir }}/react/{{ component.tagNameWithoutPrefix }}';</code></pre>
8888
</sl-tab-panel>
8989
</sl-tab-group>
9090

docs/assets/scripts/code-previews.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
(() => {
22
function convertModuleLinks(html) {
33
html = html
4-
.replace(/@shoelace-style\/shoelace/g, `https://cdn.skypack.dev/@shoelace-style/shoelace@${shoelaceVersion}`)
5-
.replace(/from 'react'/g, `from 'https://cdn.skypack.dev/react@${reactVersion}'`)
6-
.replace(/from "react"/g, `from "https://cdn.skypack.dev/react@${reactVersion}"`);
4+
.replace(/@shoelace-style\/shoelace/g, `https://esm.sh/@shoelace-style/shoelace@${shoelaceVersion}`)
5+
.replace(/from 'react'/g, `from 'https://esm.sh/react@${reactVersion}'`)
6+
.replace(/from "react"/g, `from "https://esm.sh/react@${reactVersion}"`);
77

88
return html;
99
}
@@ -191,12 +191,12 @@
191191
if (isReact) {
192192
htmlTemplate = '<div id="root"></div>';
193193
jsTemplate =
194-
`import React from 'https://cdn.skypack.dev/react@${reactVersion}';\n` +
195-
`import ReactDOM from 'https://cdn.skypack.dev/react-dom@${reactVersion}';\n` +
196-
`import { setBasePath } from 'https://cdn.skypack.dev/@shoelace-style/shoelace@${shoelaceVersion}/${cdndir}/utilities/base-path';\n` +
194+
`import React from 'https://esm.sh/react@${reactVersion}';\n` +
195+
`import ReactDOM from 'https://esm.sh/react-dom@${reactVersion}';\n` +
196+
`import { setBasePath } from 'https://esm.sh/@shoelace-style/shoelace@${shoelaceVersion}/${cdndir}/utilities/base-path';\n` +
197197
`\n` +
198198
`// Set the base path for Shoelace assets\n` +
199-
`setBasePath('https://cdn.skypack.dev/@shoelace-style/shoelace@${shoelaceVersion}/${npmdir}/')\n` +
199+
`setBasePath('https://esm.sh/@shoelace-style/shoelace@${shoelaceVersion}/${npmdir}/')\n` +
200200
`\n${convertModuleLinks(reactExample)}\n` +
201201
`\n` +
202202
`ReactDOM.render(<App />, document.getElementById('root'));`;

docs/assets/styles/docs.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ kbd {
237237
border: solid 1px var(--sl-color-neutral-200);
238238
box-shadow: inset 0 1px 0 0 var(--sl-color-neutral-0), inset 0 -1px 0 0 var(--sl-color-neutral-200);
239239
font-family: var(--sl-font-mono);
240+
font-size: 0.9125em;
240241
border-radius: var(--docs-border-radius);
241242
color: var(--sl-color-neutral-800);
242243
padding: 0.125em 0.4em;
@@ -393,6 +394,10 @@ table td p:last-child {
393394
overflow-x: auto;
394395
}
395396

397+
.table-scroll code {
398+
white-space: nowrap;
399+
}
400+
396401
th.table-name,
397402
th.table-event-detail {
398403
min-width: 15ch;
@@ -1061,23 +1066,29 @@ html.sidebar-open #menu-toggle {
10611066
/* Hide when not defined to prevent extra wide icon toolbar while loading */
10621067
display: none;
10631068
}
1069+
10641070
#theme-selector sl-menu {
1065-
/* Set an initial size to prevent width being initally too small when first opening on small screen width */
1071+
/* Set an initial size to prevent width being too small when first opening on small screen width */
10661072
width: 140px;
10671073
}
1074+
10681075
#theme-selector sl-button {
10691076
transition: 250ms scale ease;
10701077
}
1078+
10711079
#theme-selector sl-button::part(base) {
10721080
color: var(--sl-color-neutral-0);
10731081
}
1082+
10741083
#theme-selector sl-button::part(label) {
10751084
display: flex;
10761085
padding: 0.5rem;
10771086
}
1087+
10781088
#theme-selector sl-icon {
10791089
font-size: 1.25rem;
10801090
}
1091+
10811092
.sl-theme-dark #theme-selector sl-button::part(base) {
10821093
color: var(--sl-color-neutral-1000);
10831094
}

docs/pages/components/alert.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ layout: component
1313
```
1414

1515
```jsx:react
16-
import { SlAlert, SlIcon } from '@shoelace-style/shoelace/dist/react';
16+
import SlAlert from '@shoelace-style/shoelace/dist/react/alert';
17+
import SlIcon from '@shoelace-style/shoelace/dist/react/icon';
1718
1819
const App = () => (
1920
<SlAlert open>
@@ -74,7 +75,8 @@ Set the `variant` attribute to change the alert's variant.
7475
```
7576

7677
```jsx:react
77-
import { SlAlert, SlIcon } from '@shoelace-style/shoelace/dist/react';
78+
import SlAlert from '@shoelace-style/shoelace/dist/react/alert';
79+
import SlIcon from '@shoelace-style/shoelace/dist/react/icon';
7880
7981
const App = () => (
8082
<>
@@ -144,7 +146,8 @@ Add the `closable` attribute to show a close button that will hide the alert.
144146

145147
```jsx:react
146148
import { useState } from 'react';
147-
import { SlAlert, SlIcon } from '@shoelace-style/shoelace/dist/react';
149+
import SlAlert from '@shoelace-style/shoelace/dist/react/alert';
150+
import SlIcon from '@shoelace-style/shoelace/dist/react/icon';
148151
149152
const App = () => {
150153
const [open, setOpen] = useState(true);
@@ -172,7 +175,7 @@ Icons are optional. Simply omit the `icon` slot if you don't want them.
172175
```
173176

174177
```jsx:react
175-
import { SlAlert } from '@shoelace-style/shoelace/dist/react';
178+
import SlAlert from '@shoelace-style/shoelace/dist/react/alert';
176179
177180
const App = () => (
178181
<SlAlert variant="primary" open>
@@ -212,7 +215,9 @@ Set the `duration` attribute to automatically hide an alert after a period of ti
212215

213216
```jsx:react
214217
import { useState } from 'react';
215-
import { SlAlert, SlButton, SlIcon } from '@shoelace-style/shoelace/dist/react';
218+
import SlAlert from '@shoelace-style/shoelace/dist/react/alert';
219+
import SlButton from '@shoelace-style/shoelace/dist/react/button';
220+
import SlIcon from '@shoelace-style/shoelace/dist/react/icon';
216221
217222
const css = `
218223
.alert-duration sl-alert {
@@ -301,7 +306,9 @@ You should always use the `closable` attribute so users can dismiss the notifica
301306

302307
```jsx:react
303308
import { useRef } from 'react';
304-
import { SlAlert, SlButton, SlIcon } from '@shoelace-style/shoelace/dist/react';
309+
import SlAlert from '@shoelace-style/shoelace/dist/react/alert';
310+
import SlButton from '@shoelace-style/shoelace/dist/react/button';
311+
import SlIcon from '@shoelace-style/shoelace/dist/react/icon';
305312
306313
function showToast(alert) {
307314
alert.toast();

docs/pages/components/animated-image.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ layout: component
1313
```
1414

1515
```jsx:react
16-
import { SlAnimatedImage } from '@shoelace-style/shoelace/dist/react';
16+
import SlAnimatedImage from '@shoelace-style/shoelace/dist/react/animated-image';
1717
1818
const App = () => (
1919
<SlAnimatedImage
@@ -41,7 +41,7 @@ Both GIF and WEBP images are supported.
4141
```
4242

4343
```jsx:react
44-
import { SlAnimatedImage } from '@shoelace-style/shoelace/dist/react';
44+
import SlAnimatedImage from '@shoelace-style/shoelace/dist/react/animated-image';
4545
4646
const App = () => (
4747
<SlAnimatedImage src="https://shoelace.style/assets/images/tie.webp" alt="Animation of a shoe being tied" />
@@ -64,7 +64,7 @@ To set a custom size, apply a width and/or height to the host element.
6464
{% raw %}
6565

6666
```jsx:react
67-
import { SlAnimatedImage } from '@shoelace-style/shoelace/dist/react';
67+
import SlAnimatedImage from '@shoelace-style/shoelace/dist/react/animated-image';
6868
6969
const App = () => (
7070
<SlAnimatedImage
@@ -102,7 +102,7 @@ You can change the appearance and location of the control box by targeting the `
102102
```
103103

104104
```jsx:react
105-
import { SlAnimatedImage } from '@shoelace-style/shoelace/dist/react';
105+
import SlAnimatedImage from '@shoelace-style/shoelace/dist/react/animated-image';
106106
107107
const css = `
108108
.animated-image-custom-control-box::part(control-box) {

docs/pages/components/animation.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To animate an element, wrap it in `<sl-animation>` and set an animation `name`.
2727
```
2828

2929
```jsx:react
30-
import { SlAnimation } from '@shoelace-style/shoelace/dist/react';
30+
import SlAnimation from '@shoelace-style/shoelace/dist/react/animation';
3131
3232
const css = `
3333
.animation-overview .box {
@@ -173,7 +173,7 @@ Use an [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/
173173

174174
```jsx:react
175175
import { useEffect, useRef, useState } from 'react';
176-
import { SlAnimation } from '@shoelace-style/shoelace/dist/react';
176+
import SlAnimation from '@shoelace-style/shoelace/dist/react/animation';
177177
178178
const css = `
179179
.animation-scroll {
@@ -262,7 +262,7 @@ Supply your own [keyframe formats](https://developer.mozilla.org/en-US/docs/Web/
262262
```
263263

264264
```jsx:react
265-
import { SlAnimation } from '@shoelace-style/shoelace/dist/react';
265+
import SlAnimation from '@shoelace-style/shoelace/dist/react/animation';
266266
267267
const css = `
268268
.animation-keyframes .box {
@@ -329,7 +329,8 @@ Animations won't play until you apply the `play` attribute. You can omit it init
329329

330330
```jsx:react
331331
import { useState } from 'react';
332-
import { SlAnimation, SlButton } from '@shoelace-style/shoelace/dist/react';
332+
import SlAnimation from '@shoelace-style/shoelace/dist/react/animation';
333+
import SlButton from '@shoelace-style/shoelace/dist/react/button';
333334
334335
const App = () => {
335336
const [play, setPlay] = useState(false);

0 commit comments

Comments
 (0)