@cssints/stories 0.30.1 → 0.32.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/README.md CHANGED
@@ -41,7 +41,9 @@ parseHash("#button--publish"); // { name: "button", story: "button--publish" }
41
41
  does not care how.
42
42
  - **The controls.** `argTypes` is the model (`boolean`, `select` with `options`, `text`, `number`, `range` with
43
43
  `min`/`max`/`step`). Storybook infers a control from a component's props; a Solid component carries none at run time, so
44
- a story declares what it wants by hand. The panel is the app's: a row per declared arg.
44
+ a story declares what it wants by hand. The meta's controls are the file's, and a story's own `argTypes` are merged over
45
+ them per arg (CSF 3's story-level `argTypes`), so a file whose stories have different args gives each its own. The panel
46
+ is the app's: a row per declared arg.
45
47
  - **Nothing else.** No DOM, no styles, no routing: the chrome (a rail, a tablist, a native window) is the app's, and so is
46
48
  the renderer — `entries<Node>()` returns views of whatever the app renders, so the same loader serves the web site, the
47
49
  lab and cssints-native.
package/dist/index.d.mts CHANGED
@@ -38,6 +38,8 @@ export interface Story<Props extends object = Record<string, unknown>, Node = un
38
38
  readonly name?: string;
39
39
  /** Arguments this story adds to the meta's. */
40
40
  readonly args?: Partial<Props>;
41
+ /** Controls this story adds to the meta's, per arg: a file whose stories have different args declares them here. */
42
+ readonly argTypes?: ArgTypes;
41
43
  /** Markup instead of the meta's component: a story that composes several widgets. */
42
44
  readonly render?: (args: Props) => Node;
43
45
  }
package/dist/index.mjs CHANGED
@@ -40,7 +40,10 @@ const entries = (modules, itemOf = (path) => path.split("/").at(-2) ?? "") => {
40
40
  ...meta.args,
41
41
  ...story.args
42
42
  },
43
- argTypes: meta.argTypes ?? {},
43
+ argTypes: {
44
+ ...meta.argTypes,
45
+ ...story.argTypes
46
+ },
44
47
  view: viewOf(meta, story)
45
48
  });
46
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cssints/stories",
3
- "version": "0.30.1",
3
+ "version": "0.32.0",
4
4
  "description": "The CSF 3 loader of a cssints storybook: the modules an app globs in, the entries with Storybook's ids out, and the controls a story declares",
5
5
  "license": "MIT",
6
6
  "repository": {