Socket
Socket
Sign inDemoInstall

@storybook/html

Package Overview
Dependencies
Maintainers
11
Versions
1785
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/html - npm Package Compare versions

Comparing version 0.0.0-pr-28882-sha-e607100a to 0.0.0-pr-28916-sha-7e83d7e4

dist/chunk-CEH6MNVV.mjs

25

dist/index.d.ts

@@ -1,2 +0,2 @@

import { Args, ComponentAnnotations, AnnotatedStoryFn, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1, ProjectAnnotations } from 'storybook/internal/types';
import { Args, ComponentAnnotations, AnnotatedStoryFn, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1, ProjectAnnotations, NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations } from 'storybook/internal/types';
export { ArgTypes, Args, Parameters, StrictArgs } from 'storybook/internal/types';

@@ -29,2 +29,23 @@ import { H as HtmlRenderer } from './types-19e12ec7.js';

export { Decorator, HtmlRenderer, Loader, Meta, Preview, StoryContext, StoryFn, StoryObj };
/**
* Function that sets the globalConfig of your storybook. The global config is the preview module of
* your .storybook folder.
*
* It should be run a single time, so that your global config (e.g. decorators) is applied to your
* stories when using `composeStories` or `composeStory`.
*
* Example:
*
* ```jsx
* // setup-file.js
* import { setProjectAnnotations } from '@storybook/preact';
* import projectAnnotations from './.storybook/preview';
*
* setProjectAnnotations(projectAnnotations);
* ```
*
* @param projectAnnotations - E.g. (import projectAnnotations from '../.storybook/preview')
*/
declare function setProjectAnnotations(projectAnnotations: NamedOrDefaultProjectAnnotations<any> | NamedOrDefaultProjectAnnotations<any>[]): NormalizedProjectAnnotations<HtmlRenderer>;
export { Decorator, HtmlRenderer, Loader, Meta, Preview, StoryContext, StoryFn, StoryObj, setProjectAnnotations };

@@ -1,1 +0,7 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};module.exports=__toCommonJS(src_exports);var import_global=require("@storybook/global"),{window:globalWindow}=import_global.global;globalWindow.STORYBOOK_ENV="HTML";typeof module<"u"&&module?.hot?.decline();
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{setProjectAnnotations:()=>setProjectAnnotations});module.exports=__toCommonJS(src_exports);var import_global=require("@storybook/global"),{window:globalWindow}=import_global.global;globalWindow.STORYBOOK_ENV="HTML";var import_preview_api2=require("storybook/internal/preview-api");var entry_preview_exports={};__export(entry_preview_exports,{parameters:()=>parameters,render:()=>render,renderToCanvas:()=>renderToCanvas});var import_preview_api=require("storybook/internal/preview-api"),import_global2=require("@storybook/global"),import_ts_dedent=require("ts-dedent"),{Node}=import_global2.global,render=(args,context)=>{let{id,component:Component}=context;if(typeof Component=="string"){let output=Component;return Object.keys(args).forEach(key=>{output=output.replace(`{{${key}}}`,args[key])}),output}if(Component instanceof HTMLElement){let output=Component.cloneNode(!0);return Object.keys(args).forEach(key=>{output.setAttribute(key,typeof args[key]=="string"?args[key]:JSON.stringify(args[key]))}),output}if(typeof Component=="function")return Component(args,context);throw console.warn(import_ts_dedent.dedent`
Storybook's HTML renderer only supports rendering DOM elements and strings.
Received: ${Component}
`),new Error(`Unable to render story ${id}`)};function renderToCanvas({storyFn,kind,name,showMain,showError,forceRemount},canvasElement){let element=storyFn();if(showMain(),typeof element=="string")canvasElement.innerHTML=element,(0,import_preview_api.simulatePageLoad)(canvasElement);else if(element instanceof Node){if(canvasElement.firstChild===element&&forceRemount===!1)return;canvasElement.innerHTML="",canvasElement.appendChild(element),(0,import_preview_api.simulateDOMContentLoaded)()}else showError({title:`Expecting an HTML snippet or DOM node from the story: "${name}" of "${kind}".`,description:import_ts_dedent.dedent`
Did you forget to return the HTML snippet from the story?
Use "() => <your snippet or node>" or when defining the story.
`})}var parameters={renderer:"html"};function setProjectAnnotations(projectAnnotations){return(0,import_preview_api2.setDefaultProjectAnnotations)(entry_preview_exports),(0,import_preview_api2.setProjectAnnotations)(projectAnnotations)}typeof module<"u"&&module?.hot?.decline();0&&(module.exports={setProjectAnnotations});

12

package.json
{
"name": "@storybook/html",
"version": "0.0.0-pr-28882-sha-e607100a",
"version": "0.0.0-pr-28916-sha-7e83d7e4",
"description": "Storybook HTML renderer",

@@ -50,7 +50,7 @@ "keywords": [

"dependencies": {
"@storybook/components": "^0.0.0-pr-28882-sha-e607100a",
"@storybook/components": "^0.0.0-pr-28916-sha-7e83d7e4",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "^0.0.0-pr-28882-sha-e607100a",
"@storybook/preview-api": "^0.0.0-pr-28882-sha-e607100a",
"@storybook/theming": "^0.0.0-pr-28882-sha-e607100a",
"@storybook/manager-api": "^0.0.0-pr-28916-sha-7e83d7e4",
"@storybook/preview-api": "^0.0.0-pr-28916-sha-7e83d7e4",
"@storybook/theming": "^0.0.0-pr-28916-sha-7e83d7e4",
"ts-dedent": "^2.0.0"

@@ -62,3 +62,3 @@ },

"peerDependencies": {
"storybook": "^0.0.0-pr-28882-sha-e607100a"
"storybook": "^0.0.0-pr-28916-sha-7e83d7e4"
},

@@ -65,0 +65,0 @@ "engines": {

import './button.css';
export interface ButtonProps {
/**
* Is this the principal call to action on the page?
*/
/** Is this the principal call to action on the page? */
primary?: boolean;
/**
* What background color to use
*/
/** What background color to use */
backgroundColor?: string;
/**
* How large should the button be?
*/
/** How large should the button be? */
size?: 'small' | 'medium' | 'large';
/**
* Button contents
*/
/** Button contents */
label: string;
/**
* Optional click handler
*/
/** Optional click handler */
onClick?: () => void;
}
/**
* Primary UI component for user interaction
*/
/** Primary UI component for user interaction */
export const createButton = ({

@@ -30,0 +18,0 @@ primary = false,

import './button.css';
export interface ButtonProps {
/**
* Is this the principal call to action on the page?
*/
/** Is this the principal call to action on the page? */
primary?: boolean;
/**
* What background color to use
*/
/** What background color to use */
backgroundColor?: string;
/**
* How large should the button be?
*/
/** How large should the button be? */
size?: 'small' | 'medium' | 'large';
/**
* Button contents
*/
/** Button contents */
label: string;
/**
* Optional click handler
*/
/** Optional click handler */
onClick?: () => void;
}
/**
* Primary UI component for user interaction
*/
/** Primary UI component for user interaction */
export const createButton = ({

@@ -30,0 +18,0 @@ primary = false,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc