@vueless/storybook 0.0.47 → 0.0.49

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.
@@ -25,7 +25,7 @@ export const vue3SourceDecorator = makeDecorator({
25
25
 
26
26
  async function setSourceCode() {
27
27
  try {
28
- const src = context.originalStoryFn(context.args).template;
28
+ const src = context.originalStoryFn(context.args, context.argTypes).template;
29
29
  const code = templateSourceCode(src, context.args, context.argTypes);
30
30
  const channel = addons.getChannel();
31
31
 
@@ -113,12 +113,16 @@ function propToSource(key, val) {
113
113
  case "string":
114
114
  return `${key}="${val}"`;
115
115
  case "object":
116
- return `:${key}="${JSON.stringify(val)}"`;
116
+ return `:${key}="${getObjectValue(val)}"`;
117
117
  default:
118
118
  return `:${key}="${val}"`;
119
119
  }
120
120
  }
121
121
 
122
+ function getObjectValue(value) {
123
+ return JSON.stringify(value).replaceAll('"', "'");
124
+ }
125
+
122
126
  function kebabCase(str) {
123
127
  return str
124
128
  .split("")
@@ -159,6 +159,10 @@ body {
159
159
 
160
160
  /* -------------------- Main story -------------------- */
161
161
 
162
+ .sb-anchor {
163
+ @apply mt-2;
164
+ }
165
+
162
166
  .sb-bar,
163
167
  .docs-story {
164
168
  @apply bg-white;
@@ -1,11 +1,12 @@
1
1
  import { setup } from "@storybook/vue3";
2
+ import { getRandomId } from "vueless/utils/utilUI.js";
3
+ import { DARK_MODE_SELECTOR, LIGHT_MODE_SELECTOR } from "vueless/constants.js";
2
4
 
3
5
  import themeLight from "./themes/themeLight.js";
4
6
  import themeDark from "./themes/themeDark.js";
5
7
  import themeLightDocs from "./themes/themeLightDocs.js";
6
8
  import { storyDarkModeDecorator } from "./decorators/storyDarkModeDecorator.js";
7
9
  import { vue3SourceDecorator } from "./decorators/vue3SourceDecorator.js";
8
- import { DARK_MODE_SELECTOR, LIGHT_MODE_SELECTOR } from "vueless/constants.js";
9
10
 
10
11
  /* Tailwind styles */
11
12
  import "./index.css";
@@ -19,6 +20,8 @@ setup((app) => {
19
20
  const vueless = createVueless();
20
21
  const router = createRouter({ history: createWebHistory(), routes: [] });
21
22
 
23
+ app.config.idPrefix = getRandomId();
24
+
22
25
  if (!app._context.config.globalProperties.$route) {
23
26
  app.use(router);
24
27
  app.use(vueless);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueless/storybook",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
4
4
  "description": "Simplifies Storybook configuration for Vueless UI library.",
5
5
  "homepage": "https://vueless.com",
6
6
  "author": "Johnny Grid",