🥄 Develop, test and document your React story components faster.
MIT License
Published by tajo over 1 year ago
Published by tajo over 1 year ago
Published by tajo over 1 year ago
Published by tajo over 1 year ago
Published by tajo over 1 year ago
Published by tajo over 1 year ago
#412 6567b78
Thanks @tajo! - ## Global args
and argTypes
You can now define global args and argTypes in .ladle/components.tsx
:
export const args = {
test: true,
};
export const argTypes = {
cities: {
control: { type: "select" },
options: ["NYC", "London", "Tokyo"],
},
};
These will be applied to all stories in your project and can be overriden on the story level.
Introducing a new special control type background
. You can use it to change the background color of your stories. You might want to place it into .ladle/components.tsx
so it's available to all stories. There can be only one active background control.
export const argTypes = {
background: {
control: { type: "background" },
options: ["purple", "blue", "white", "pink"],
defaultValue: "purple",
},
};
You can now customize the name and labels of your controls and their options:
Story.argTypes = {
airports: {
name: "International Airports",
control: {
type: "select",
labels: {
sfo: "San Francisco",
lax: "Los Angeles",
prg: "Prague",
},
},
options: ["sfo", "lax", "prg"],
},
};
meta.json
Stories are now sorted in the meta.json
file in a deterministic way. Useful when creating a hash of the Ladle's output for caching purposes.
Published by tajo over 1 year ago
#402 4737a54
Thanks @wojtekmaj! - Add type="button" to all buttons to reduce noise in Microsoft Edge DevTools Issues panel
#403 c4e60d6
Thanks @wojtekmaj! - Rename manifest.json to manifest.webmanifest to reduce noise in Microsoft Edge DevTools Issues panel
Published by tajo over 1 year ago
9433781
Thanks @wojtekmaj! - Fixed TypeScript error when using StoryDecorator typePublished by tajo over 1 year ago
Published by tajo over 1 year ago
Published by tajo over 1 year ago
Published by tajo over 1 year ago
Published by tajo over 1 year ago
Published by tajo over 1 year ago
Published by tajo over 1 year ago
3277dce
Thanks @tajo! - Change the way how values from config.mjs are passed to the client. We were doing direct import into the app but that breaks cases when config.mjs uses Node APIs. Also, it risks leaking potentially sensitive stuff from the CLI side. And it's cubersome when used through programatic API / wrapper libraries. The new solution picks just a subset of config.mjs values that are really needed in the client, serializes them and embeds them into our virtual module.Published by tajo over 1 year ago