@storybook/web-components 10.2.0-beta.0 → 10.2.0-beta.2

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/dist/index.d.ts CHANGED
@@ -445,6 +445,11 @@ type InferArgs<TArgs, T, Decorators> = Simplify<TArgs & Simplify<RemoveIndexSign
445
445
  type InferWebComponentsTypes<T, TArgs, Decorators> = WebComponentsTypes & T & {
446
446
  args: Simplify<InferArgs<TArgs, T, Decorators>>;
447
447
  };
448
+ /**
449
+ * Infers args from a web component's HTMLElement type, allowing both camelCase properties and
450
+ * kebab-case HTML attribute names (e.g., 'aria-label', 'data-testid', 'static-color').
451
+ */
452
+ type InferArgsFromComponent<C extends keyof HTMLElementTagNameMap> = Partial<HTMLElementTagNameMap[C]> & Record<`${string}-${string}`, unknown>;
448
453
  /**
449
454
  * Web Components-specific Preview interface that provides type-safe CSF factory methods.
450
455
  *
@@ -473,11 +478,11 @@ interface WebComponentsPreview<T extends AddonTypes> extends Preview$1<WebCompon
473
478
  * ```
474
479
  */
475
480
  type<S>(): WebComponentsPreview<T & S>;
476
- meta<C extends keyof HTMLElementTagNameMap, Decorators extends DecoratorFunction<WebComponentsTypes & T, any>, TMetaArgs extends Partial<HTMLElementTagNameMap[C] & T['args']>>(meta: {
481
+ meta<C extends keyof HTMLElementTagNameMap, Decorators extends DecoratorFunction<WebComponentsTypes & T, any>, TMetaArgs extends InferArgsFromComponent<C> & Partial<T['args']>>(meta: {
477
482
  component?: C;
478
483
  args?: TMetaArgs;
479
484
  decorators?: Decorators | Decorators[];
480
- } & Omit<ComponentAnnotations<WebComponentsTypes & T, Partial<HTMLElementTagNameMap[C]> & T['args']>, 'decorators' | 'component' | 'args'>): WebComponentsMeta<InferWebComponentsTypes<T, Partial<HTMLElementTagNameMap[C]>, Decorators>, Omit<ComponentAnnotations<InferWebComponentsTypes<T, Partial<HTMLElementTagNameMap[C]>, Decorators>>, 'args'> & {
485
+ } & Omit<ComponentAnnotations<WebComponentsTypes & T, InferArgsFromComponent<C> & T['args']>, 'decorators' | 'component' | 'args'>): WebComponentsMeta<InferWebComponentsTypes<T, InferArgsFromComponent<C>, Decorators>, Omit<ComponentAnnotations<InferWebComponentsTypes<T, InferArgsFromComponent<C>, Decorators>>, 'args'> & {
481
486
  args: {} extends TMetaArgs ? {} : TMetaArgs;
482
487
  }>;
483
488
  meta<TArgs, Decorators extends DecoratorFunction<WebComponentsTypes & T, any>, TMetaArgs extends Partial<TArgs>>(meta: {
@@ -572,4 +577,4 @@ interface WebComponentsMeta<T extends WebComponentsTypes, MetaInput extends Comp
572
577
  interface WebComponentsStory<T extends WebComponentsTypes, TInput extends StoryAnnotations<T, T['args']>> extends Story<T, TInput> {
573
578
  }
574
579
 
575
- export { type Decorator, type Loader, type Meta, type Preview, type StoryContext, type StoryFn, type StoryObj, type WebComponentsMeta, type WebComponentsPreview, type WebComponentsRenderer, type WebComponentsStory, __definePreview, getCustomElements, isValidComponent, isValidMetaData, setCustomElements, setCustomElementsManifest, setProjectAnnotations };
580
+ export { type Decorator, type Loader, type Meta, type Preview, type StoryContext, type StoryFn, type StoryObj, type WebComponentsMeta, type WebComponentsPreview, type WebComponentsRenderer, type WebComponentsStory, type WebComponentsTypes, __definePreview, getCustomElements, isValidComponent, isValidMetaData, setCustomElements, setCustomElementsManifest, setProjectAnnotations };
package/dist/preset.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_kr5odxr6n0g from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_kr5odxr6n0g from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_kr5odxr6n0g from "node:module";
1
+ import CJS_COMPAT_NODE_URL_fh92twtmpl9 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_fh92twtmpl9 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_fh92twtmpl9 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_kr5odxr6n0g.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_kr5odxr6n0g.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_kr5odxr6n0g.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_fh92twtmpl9.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_fh92twtmpl9.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_fh92twtmpl9.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/web-components",
3
- "version": "10.2.0-beta.0",
3
+ "version": "10.2.0-beta.2",
4
4
  "description": "Storybook Web Components renderer: Develop, document, and test UI components in isolation",
5
5
  "keywords": [
6
6
  "storybook",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "peerDependencies": {
64
64
  "lit": "^2.0.0 || ^3.0.0",
65
- "storybook": "^10.2.0-beta.0"
65
+ "storybook": "^10.2.0-beta.2"
66
66
  },
67
67
  "publishConfig": {
68
68
  "access": "public"