@nicolassancho/storybook-core 4.1.1 → 4.1.3
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
|
@@ -96,7 +96,9 @@ Tests are `play` functions in the component's story file, not separate test file
|
|
|
96
96
|
|
|
97
97
|
1. Branch from `main` (`feat/<description>` or `fix/<description>`) and open a pull request.
|
|
98
98
|
2. Run `npx tsc --noEmit`, `npm run lint`, `npx prettier --check ./src ./.storybook` and `npm test`
|
|
99
|
-
before pushing. CI runs the same checks plus a Storybook build.
|
|
99
|
+
before pushing. CI runs the same checks plus a Storybook build. Run `npm run test:package` too
|
|
100
|
+
when you change exports, styles or imports: it installs the packed package and renders it in
|
|
101
|
+
plain Node.
|
|
100
102
|
3. Bump the version as the last commit (`npm version <patch|minor> --no-git-tag-version`). CI fails
|
|
101
103
|
a pull request that keeps the version of `main`, and every push to `main` publishes to npm.
|
|
102
104
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type SvgIcon = React.FC<React.SVGProps<SVGSVGElement>>;
|
|
1
3
|
export declare const IconsMap: {
|
|
2
|
-
Home:
|
|
3
|
-
ShoppingCart:
|
|
4
|
-
ArrowDown:
|
|
5
|
-
ArrowLeft:
|
|
6
|
-
AlertOctagon:
|
|
7
|
-
AlertTriangle:
|
|
8
|
-
Sun:
|
|
9
|
-
Moon:
|
|
4
|
+
Home: SvgIcon;
|
|
5
|
+
ShoppingCart: SvgIcon;
|
|
6
|
+
ArrowDown: SvgIcon;
|
|
7
|
+
ArrowLeft: SvgIcon;
|
|
8
|
+
AlertOctagon: SvgIcon;
|
|
9
|
+
AlertTriangle: SvgIcon;
|
|
10
|
+
Sun: SvgIcon;
|
|
11
|
+
Moon: SvgIcon;
|
|
10
12
|
};
|
|
13
|
+
export {};
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//
|
|
3
|
-
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Feather draws every icon on a 24px grid with a 2px round stroke in the current text color.
|
|
3
|
+
// `width` and `height` are the fallback size when a consumer's Tailwind does not apply the
|
|
4
|
+
// size classes from Icon.
|
|
5
|
+
const createIcon = (paths) => (props) => (_jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, props, { children: paths })));
|
|
6
|
+
// To add an icon, paste the shapes from its Feather SVG here and register it in IconsMap.
|
|
7
|
+
const Home = createIcon(_jsxs(_Fragment, { children: [_jsx("path", { d: "M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }), _jsx("polyline", { points: "9 22 9 12 15 12 15 22" })] }));
|
|
8
|
+
const ShoppingCart = createIcon(_jsxs(_Fragment, { children: [_jsx("circle", { cx: "9", cy: "21", r: "1" }), _jsx("circle", { cx: "20", cy: "21", r: "1" }), _jsx("path", { d: "M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6" })] }));
|
|
9
|
+
const ArrowDown = createIcon(_jsxs(_Fragment, { children: [_jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), _jsx("polyline", { points: "19 12 12 19 5 12" })] }));
|
|
10
|
+
const ArrowLeft = createIcon(_jsxs(_Fragment, { children: [_jsx("line", { x1: "19", y1: "12", x2: "5", y2: "12" }), _jsx("polyline", { points: "12 19 5 12 12 5" })] }));
|
|
11
|
+
const AlertOctagon = createIcon(_jsxs(_Fragment, { children: [_jsx("polygon", { points: "7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2" }), _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })] }));
|
|
12
|
+
const AlertTriangle = createIcon(_jsxs(_Fragment, { children: [_jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }), _jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), _jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })] }));
|
|
13
|
+
const Sun = createIcon(_jsxs(_Fragment, { children: [_jsx("circle", { cx: "12", cy: "12", r: "5" }), _jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }), _jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }), _jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }), _jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }), _jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }), _jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }), _jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }), _jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })] }));
|
|
14
|
+
const Moon = createIcon(_jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }));
|
|
4
15
|
export const IconsMap = {
|
|
5
16
|
Home,
|
|
6
17
|
ShoppingCart,
|
|
@@ -10,5 +21,4 @@ export const IconsMap = {
|
|
|
10
21
|
AlertTriangle,
|
|
11
22
|
Sun,
|
|
12
23
|
Moon,
|
|
13
|
-
// Add other icons here
|
|
14
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nicolassancho/storybook-core",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3",
|
|
4
4
|
"description": "Accessible React + Tailwind component library built with tailwind-variants and documented in Storybook.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"build-storybook": "storybook build",
|
|
32
32
|
"test": "vitest run",
|
|
33
33
|
"lint": "eslint ./src",
|
|
34
|
-
"format": "prettier --write ./src ./.storybook"
|
|
34
|
+
"format": "prettier --write ./src ./.storybook",
|
|
35
|
+
"test:package": "npm run build && publint --pack npm && attw --pack . --profile esm-only --exclude-entrypoints ./styles/theme.css && node scripts/test-package.mjs"
|
|
35
36
|
},
|
|
36
37
|
"keywords": [
|
|
37
38
|
"react",
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
"url": "https://github.com/NicolasSancho/Storybook-core/issues"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
56
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
55
57
|
"@eslint/js": "^9.39.5",
|
|
56
58
|
"@storybook/addon-a11y": "^10.6.2",
|
|
57
59
|
"@storybook/addon-docs": "^10.6.2",
|
|
@@ -73,6 +75,7 @@
|
|
|
73
75
|
"playwright": "^1.64.0",
|
|
74
76
|
"postcss": "^8.4.41",
|
|
75
77
|
"prettier": "^3.9.10",
|
|
78
|
+
"publint": "^0.3.25",
|
|
76
79
|
"react": "^19.3.0",
|
|
77
80
|
"react-dom": "^19.3.0",
|
|
78
81
|
"storybook": "^10.6.2",
|
|
@@ -82,9 +85,6 @@
|
|
|
82
85
|
"typescript": "^5.9.3",
|
|
83
86
|
"vitest": "^5.0.3"
|
|
84
87
|
},
|
|
85
|
-
"dependencies": {
|
|
86
|
-
"react-feather": "^2.0.10"
|
|
87
|
-
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"react": "^19.0.0",
|
|
90
90
|
"react-dom": "^19.0.0",
|