SchwarzIT / onyx

🚀 A design system and Vue.js component library created by Schwarz IT
https://onyx.schwarz
Apache License 2.0
54 stars 6 forks source link

Implement improved code examples #1729

Open BoppLi opened 1 month ago

BoppLi commented 1 month ago

In cases that need functions in storybook examples, we should create a demo component file and reference the code like here: packages/sit-onyx/src/components/examples/FormExample/FormExample.stories.ts

import FormExampleSourceCode from "./FormExample.vue?raw";
// ...
const meta: Meta<typeof FormExample> = {
  // ...
  parameters: {
    docs: {
      source: {
        code: FormExampleSourceCode.replace('from "../../.."', 'from "sit-onyx"'),
      },
    },
  },
};

List of examples we should change:

Acceptance criteria

BoppLi commented 1 month ago

Full example context Image