storybook-addon-pseudo-states 1.10.0 → 1.13.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.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- # v1.0.0 (Mon May 23 2022)
1
+ # v1.0.0 (Tue May 24 2022)
2
2
 
3
3
  #### 🚀 Enhancement
4
4
 
@@ -7,6 +7,8 @@
7
7
 
8
8
  #### 🐛 Bug Fix
9
9
 
10
+ - fix: only generate pseudo selector when the selector has a match [#30](https://github.com/chromaui/storybook-addon-pseudo-states/pull/30) ([@tobi-or-not-tobi](https://github.com/tobi-or-not-tobi) [@ghengeveld](https://github.com/ghengeveld))
11
+ - Use personal access token to be able to push to main ([@ghengeveld](https://github.com/ghengeveld))
10
12
  - fix: Resolve crash for stories that use internal State [#28](https://github.com/chromaui/storybook-addon-pseudo-states/pull/28) (david.maulick@coinbase.com)
11
13
  - Fix CSS selector splitting [#24](https://github.com/chromaui/storybook-addon-pseudo-states/pull/24) ([@ilanus](https://github.com/ilanus) [@ghengeveld](https://github.com/ghengeveld))
12
14
  - Add support for slotted lit elements [#23](https://github.com/chromaui/storybook-addon-pseudo-states/pull/23) ([@ilanus](https://github.com/ilanus))
@@ -14,6 +16,7 @@
14
16
 
15
17
  #### ⚠️ Pushed to `main`
16
18
 
19
+ - Use chromatic@next ([@ghengeveld](https://github.com/ghengeveld))
17
20
  - [skip release] Revert back to disabling CustomElement stories ([@ghengeveld](https://github.com/ghengeveld))
18
21
  - Another attempt at dealing with IE ([@ghengeveld](https://github.com/ghengeveld))
19
22
  - Don't disable stories, just ignore IE ([@ghengeveld](https://github.com/ghengeveld))
@@ -25,12 +28,13 @@
25
28
  - Upgrade Storybook ([@ghengeveld](https://github.com/ghengeveld))
26
29
  - Ignore .env file ([@ghengeveld](https://github.com/ghengeveld))
27
30
 
28
- #### Authors: 4
31
+ #### Authors: 5
29
32
 
30
33
  - David Maulick ([@dmaulick](https://github.com/dmaulick))
31
34
  - Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))
32
35
  - Ilan ([@ilanus](https://github.com/ilanus))
33
36
  - Jeroen Zwartepoorte ([@jpzwarte](https://github.com/jpzwarte))
37
+ - tobi-or-not-tobi ([@tobi-or-not-tobi](https://github.com/tobi-or-not-tobi))
34
38
 
35
39
  ---
36
40
 
@@ -183,6 +183,10 @@ function rewriteStyleSheets(shadowRoot) {
183
183
  });
184
184
  var stateSelector;
185
185
 
186
+ if (!matchOne.test(selector)) {
187
+ return [selector];
188
+ }
189
+
186
190
  if (selector.startsWith(":host(") || selector.startsWith("::slotted(")) {
187
191
  stateSelector = states.reduce(function (acc, state) {
188
192
  return acc.replaceAll(":".concat(state), ".pseudo-".concat(state));
@@ -168,6 +168,10 @@ function rewriteStyleSheets(shadowRoot) {
168
168
  });
169
169
  var stateSelector;
170
170
 
171
+ if (!matchOne.test(selector)) {
172
+ return [selector];
173
+ }
174
+
171
175
  if (selector.startsWith(":host(") || selector.startsWith("::slotted(")) {
172
176
  stateSelector = states.reduce(function (acc, state) {
173
177
  return acc.replaceAll(":".concat(state), ".pseudo-".concat(state));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-addon-pseudo-states",
3
- "version": "1.10.0",
3
+ "version": "1.13.0",
4
4
  "description": "CSS pseudo states for Storybook",
5
5
  "keywords": [
6
6
  "storybook-addons",