Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@storybook/addon-styling

Package Overview
Dependencies
Maintainers
30
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/addon-styling - npm Package Compare versions

Comparing version 0.3.1 to 1.0.0-canary.8.d1e461a.0

4

dist/cjs/decorators/class-name.strategy.js

@@ -8,3 +8,3 @@ "use strict";

var _addons = require("@storybook/addons");
var _previewApi = require("@storybook/preview-api");

@@ -38,3 +38,3 @@ var _helpers = require("./helpers");

var selected = (0, _helpers.pluckThemeFromContext)(context);
(0, _addons.useEffect)(function () {
(0, _previewApi.useEffect)(function () {
var selectedThemeName = themeOverride || selected || defaultTheme;

@@ -41,0 +41,0 @@ var parentElement = document.querySelector(parentSelector);

@@ -8,3 +8,3 @@ "use strict";

var _addons = require("@storybook/addons");
var _previewApi = require("@storybook/preview-api");

@@ -29,3 +29,3 @@ var _helpers = require("./helpers");

var selected = (0, _helpers.pluckThemeFromContext)(context);
(0, _addons.useEffect)(function () {
(0, _previewApi.useEffect)(function () {
var parentElement = document.querySelector(parentSelector);

@@ -32,0 +32,0 @@ var themeKey = themeOverride || selected || defaultTheme;

@@ -10,3 +10,3 @@ "use strict";

var _addons = require("@storybook/addons");
var _previewApi = require("@storybook/preview-api");

@@ -26,7 +26,7 @@ var _constants = require("../constants");

function useThemeParameters() {
return (0, _addons.useParameter)(_constants.PARAM_KEY, _constants.DEFAULT_THEME_PARAMETERS);
return (0, _previewApi.useParameter)(_constants.PARAM_KEY, _constants.DEFAULT_THEME_PARAMETERS);
}
function initializeThemeState(themeNames, defaultTheme) {
_addons.addons.getChannel().emit(_constants.THEMING_EVENTS.REGISTER_THEMES, {
_previewApi.addons.getChannel().emit(_constants.THEMING_EVENTS.REGISTER_THEMES, {
defaultTheme: defaultTheme,

@@ -33,0 +33,0 @@ themes: themeNames

@@ -10,3 +10,3 @@ "use strict";

var _addons = require("@storybook/addons");
var _previewApi = require("@storybook/preview-api");

@@ -50,3 +50,3 @@ var _helpers = require("./helpers");

var selected = (0, _helpers.pluckThemeFromContext)(context);
var theme = (0, _addons.useMemo)(function () {
var theme = (0, _previewApi.useMemo)(function () {
var selectedThemeName = themeOverride || selected || defaultTheme;

@@ -53,0 +53,0 @@ var pairs = Object.entries(themes);

@@ -23,3 +23,5 @@ "use strict";

// @ts-expect-error
if (module && module.hot && module.hot.decline) {
// @ts-expect-error
module.hot.decline();

@@ -26,0 +28,0 @@ } // make it work with --isolatedModules

@@ -13,3 +13,3 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

import { useEffect } from "@storybook/addons";
import { useEffect } from "@storybook/preview-api";
import { initializeThemeState, pluckThemeFromContext, useThemeParameters } from "./helpers";

@@ -16,0 +16,0 @@ var DEFAULT_ELEMENT_SELECTOR = "html";

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

import { useEffect } from "@storybook/addons";
import { useEffect } from "@storybook/preview-api";
import { initializeThemeState, pluckThemeFromContext, useThemeParameters } from "./helpers";

@@ -3,0 +3,0 @@ var DEFAULT_ELEMENT_SELECTOR = "html";

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

import { addons, useParameter } from "@storybook/addons";
import { addons, useParameter } from "@storybook/preview-api";
import { GLOBAL_KEY, PARAM_KEY, THEMING_EVENTS, DEFAULT_THEME_PARAMETERS } from "../constants";

@@ -3,0 +3,0 @@ /**

@@ -14,3 +14,3 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

import React from "react";
import { useMemo } from "@storybook/addons";
import { useMemo } from "@storybook/preview-api";
import { initializeThemeState, pluckThemeFromContext, useThemeParameters } from "./helpers";

@@ -17,0 +17,0 @@

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

// @ts-expect-error
if (module && module.hot && module.hot.decline) {
// @ts-expect-error
module.hot.decline();

@@ -3,0 +5,0 @@ } // make it work with --isolatedModules

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

import { DecoratorFunction } from "@storybook/addons";
import type { DecoratorFunction } from "@storybook/types";
export interface ClassNameStrategyConfiguration {

@@ -3,0 +3,0 @@ themes: Record<string, string>;

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

import { DecoratorFunction } from "@storybook/addons";
import type { DecoratorFunction } from "@storybook/types";
export interface DataAttributeStrategyConfiguration {

@@ -3,0 +3,0 @@ themes: Record<string, string>;

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

import { StoryContext } from "@storybook/addons";
import type { StoryContext } from "@storybook/types";
import { ThemeParameters } from "../constants";

@@ -3,0 +3,0 @@ /**

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

import { DecoratorFunction } from "@storybook/addons";
import type { DecoratorFunction } from "@storybook/types";
declare type Theme = Record<string, any>;

@@ -3,0 +3,0 @@ declare type ThemeMap = Record<string, Theme>;

{
"name": "@storybook/addon-styling",
"version": "0.3.1",
"version": "1.0.0-canary.8.d1e461a.0",
"description": "A base addon for configuring popular styling tools",

@@ -40,8 +40,18 @@ "keywords": [

"test": "echo \"Error: no test specified\" && exit 1",
"storybook": "start-storybook -p 6006",
"start": "concurrently \"yarn build:watch\" \"yarn storybook -- --no-manager-cache --quiet\"",
"build-storybook": "build-storybook",
"storybook": "storybook dev -p 6006",
"start": "concurrently \"yarn build:watch\" \"yarn storybook -- --quiet\"",
"build-storybook": "storybook build",
"prerelease": "zx scripts/prepublish-checks.mjs",
"release": "yarn build && auto shipit"
},
"dependencies": {
"@storybook/addons": "^7.0.0-rc.3",
"@storybook/api": "^7.0.0-rc.3",
"@storybook/components": "^7.0.0-rc.3",
"@storybook/core-events": "^7.0.0-rc.3",
"@storybook/manager-api": "^7.0.0-rc.3",
"@storybook/preview-api": "^7.0.0-rc.3",
"@storybook/theming": "^7.0.0-rc.3",
"@storybook/types": "^7.0.0-rc.3"
},
"devDependencies": {

@@ -53,4 +63,5 @@ "@babel/cli": "^7.12.1",

"@babel/preset-typescript": "^7.13.0",
"@storybook/addon-essentials": "^6.5.8",
"@storybook/react": "^6.5.8",
"@storybook/addon-essentials": "^7.0.0-rc.3",
"@storybook/react": "^7.0.0-rc.3",
"@storybook/react-webpack5": "^7.0.0-rc.3",
"auto": "^10.3.0",

@@ -66,2 +77,3 @@ "babel-loader": "^8.1.0",

"rimraf": "^3.0.2",
"storybook": "^7.0.0-rc.3",
"typescript": "^4.2.4",

@@ -71,8 +83,2 @@ "zx": "^1.14.1"

"peerDependencies": {
"@storybook/addons": "^6.5.8",
"@storybook/api": "^6.5.8",
"@storybook/components": "^6.5.8",
"@storybook/core-events": "^6.5.8",
"@storybook/manager-api": "^7.0.0-beta.56",
"@storybook/theming": "^6.5.8",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",

@@ -79,0 +85,0 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",

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