@nicolassancho/storybook-core 4.1.0 → 4.1.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/README.md +3 -1
- package/dist/components/Atoms/Chip/Chip.js +1 -1
- package/dist/components/Atoms/ChipLink/ChipLink.js +1 -1
- package/dist/components/Atoms/Icon/Icon.d.ts +1 -1
- package/dist/components/Atoms/Icon/Icon.js +1 -1
- package/dist/components/Atoms/Label/Label.d.ts +1 -1
- package/dist/components/Atoms/Label/Label.js +1 -1
- package/dist/components/Atoms/RadioButton/RadioButton.js +1 -1
- package/dist/components/Molecules/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/components/Molecules/CartIcon/CartIcon.js +2 -2
- package/dist/components/Molecules/ProductCard/ProductCard.d.ts +1 -1
- package/dist/components/Molecules/ProductCard/ProductCard.js +2 -2
- package/dist/components/Molecules/ProductDetails/ProductDetails.js +1 -1
- package/dist/components/Molecules/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/Organisms/Footer/Footer.js +2 -2
- package/dist/components/Organisms/Header/Header.js +1 -1
- package/dist/components/Organisms/ProductGrid/ProductGrid.d.ts +1 -1
- package/dist/components/Organisms/ProductGrid/ProductGrid.js +2 -2
- package/dist/index.d.ts +20 -20
- package/dist/index.js +20 -20
- package/package.json +5 -2
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
|
|
|
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { chipStyles } from "./chipStyles";
|
|
13
|
+
import { chipStyles } from "./chipStyles.js";
|
|
14
14
|
/**
|
|
15
15
|
* A pill button for choosing a filter or an option. It works without JavaScript inside a native
|
|
16
16
|
* form: a `type="submit"` chip with a `name` and `value` submits that value. For a filter that
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { chipStyles } from "../Chip/chipStyles";
|
|
2
|
+
import { chipStyles } from "../Chip/chipStyles.js";
|
|
3
3
|
/**
|
|
4
4
|
* A pill link for filters that live in the URL, such as a category. Put the chips in a `<nav>` or
|
|
5
5
|
* a list and mark the current one with `selected`. For a toggle or a form control, use `Chip`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import { Text } from "../../Atoms/Text/Text";
|
|
3
|
+
import { Text } from "../../Atoms/Text/Text.js";
|
|
4
4
|
const radioButtonStyles = tv({
|
|
5
5
|
base: "flex items-center gap-2 cursor-pointer",
|
|
6
6
|
slots: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import { Icon } from "../../Atoms/Icon/Icon";
|
|
4
|
-
import { Text } from "../../Atoms/Text/Text";
|
|
3
|
+
import { Icon } from "../../Atoms/Icon/Icon.js";
|
|
4
|
+
import { Text } from "../../Atoms/Text/Text.js";
|
|
5
5
|
const breadcrumbsStyles = tv({
|
|
6
6
|
base: "text-sm text-neutral-600",
|
|
7
7
|
slots: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import { Icon } from "../../Atoms/Icon/Icon";
|
|
4
|
-
import { Text } from "../../Atoms/Text/Text";
|
|
3
|
+
import { Icon } from "../../Atoms/Icon/Icon.js";
|
|
4
|
+
import { Text } from "../../Atoms/Text/Text.js";
|
|
5
5
|
const cartIconStyles = tv({
|
|
6
6
|
base: "relative inline-flex items-center",
|
|
7
7
|
variants: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ImageProps } from "../../Atoms/Image/Image";
|
|
2
|
+
import { ImageProps } from "../../Atoms/Image/Image.js";
|
|
3
3
|
export interface ProductCardProps {
|
|
4
4
|
/** Optional unique id, used as the React key when rendered in a list (falls back to `title`). */
|
|
5
5
|
id?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import { Image } from "../../Atoms/Image/Image";
|
|
4
|
-
import { Text } from "../../Atoms/Text/Text";
|
|
3
|
+
import { Image } from "../../Atoms/Image/Image.js";
|
|
4
|
+
import { Text } from "../../Atoms/Text/Text.js";
|
|
5
5
|
const productCardStyles = tv({
|
|
6
6
|
base: "relative rounded-lg border border-neutral-200 shadow-xs flex flex-col overflow-hidden",
|
|
7
7
|
slots: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import { Text } from "../../Atoms/Text/Text";
|
|
3
|
+
import { Text } from "../../Atoms/Text/Text.js";
|
|
4
4
|
const detailsStyles = tv({
|
|
5
5
|
base: "flex flex-col gap-1",
|
|
6
6
|
slots: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
|
-
import { RadioButton } from "../../Atoms/RadioButton/RadioButton";
|
|
4
|
-
import { Text } from "../../Atoms/Text/Text";
|
|
5
|
-
import { Grid } from "../../Layouts/Grid/Grid";
|
|
3
|
+
import { RadioButton } from "../../Atoms/RadioButton/RadioButton.js";
|
|
4
|
+
import { Text } from "../../Atoms/Text/Text.js";
|
|
5
|
+
import { Grid } from "../../Layouts/Grid/Grid.js";
|
|
6
6
|
export const RadioGroup = ({ label, name, options, value, defaultValue, onChange, columns = 1, gap = "small", className, }) => {
|
|
7
7
|
const generatedName = useId();
|
|
8
8
|
const groupName = name !== null && name !== void 0 ? name : generatedName;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import { Text } from "../../Atoms/Text/Text";
|
|
4
|
-
import { Container } from "../../Layouts/Container/Container";
|
|
3
|
+
import { Text } from "../../Atoms/Text/Text.js";
|
|
4
|
+
import { Container } from "../../Layouts/Container/Container.js";
|
|
5
5
|
const footerStyles = tv({
|
|
6
6
|
base: "w-full border-t border-neutral-200 bg-surface",
|
|
7
7
|
slots: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import { Container } from "../../Layouts/Container/Container";
|
|
3
|
+
import { Container } from "../../Layouts/Container/Container.js";
|
|
4
4
|
const headerStyles = tv({
|
|
5
5
|
base: "w-full bg-surface shadow-sm",
|
|
6
6
|
slots: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ProductCardProps } from "../../Molecules/ProductCard/ProductCard";
|
|
2
|
+
import { ProductCardProps } from "../../Molecules/ProductCard/ProductCard.js";
|
|
3
3
|
export interface ProductGridProps {
|
|
4
4
|
products: ProductCardProps[];
|
|
5
5
|
columns?: 2 | 3 | 4 | 6;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import { Grid } from "../../Layouts/Grid/Grid";
|
|
4
|
-
import { ProductCard } from "../../Molecules/ProductCard/ProductCard";
|
|
3
|
+
import { Grid } from "../../Layouts/Grid/Grid.js";
|
|
4
|
+
import { ProductCard } from "../../Molecules/ProductCard/ProductCard.js";
|
|
5
5
|
const productGridStyles = tv({
|
|
6
6
|
base: "xs:grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4",
|
|
7
7
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export * from "./components/Atoms/Button/Button";
|
|
2
|
-
export * from "./components/Atoms/Chip/Chip";
|
|
3
|
-
export * from "./components/Atoms/ChipLink/ChipLink";
|
|
4
|
-
export * from "./components/Atoms/Spinner/Spinner";
|
|
5
|
-
export * from "./components/Atoms/Text/Text";
|
|
6
|
-
export * from "./components/Atoms/Icon/Icon";
|
|
7
|
-
export * from "./components/Atoms/Image/Image";
|
|
8
|
-
export * from "./components/Atoms/Label/Label";
|
|
9
|
-
export * from "./components/Atoms/RadioButton/RadioButton";
|
|
10
|
-
export * from "./components/Atoms/SearchInput/SearchInput";
|
|
11
|
-
export * from "./components/Layouts/Container/Container";
|
|
12
|
-
export * from "./components/Layouts/Grid/Grid";
|
|
13
|
-
export * from "./components/Molecules/Breadcrumbs/Breadcrumbs";
|
|
14
|
-
export * from "./components/Molecules/CartIcon/CartIcon";
|
|
15
|
-
export * from "./components/Molecules/ProductCard/ProductCard";
|
|
16
|
-
export * from "./components/Molecules/ProductDetails/ProductDetails";
|
|
17
|
-
export * from "./components/Molecules/RadioGroup/RadioGroup";
|
|
18
|
-
export * from "./components/Organisms/Footer/Footer";
|
|
19
|
-
export * from "./components/Organisms/Header/Header";
|
|
20
|
-
export * from "./components/Organisms/ProductGrid/ProductGrid";
|
|
1
|
+
export * from "./components/Atoms/Button/Button.js";
|
|
2
|
+
export * from "./components/Atoms/Chip/Chip.js";
|
|
3
|
+
export * from "./components/Atoms/ChipLink/ChipLink.js";
|
|
4
|
+
export * from "./components/Atoms/Spinner/Spinner.js";
|
|
5
|
+
export * from "./components/Atoms/Text/Text.js";
|
|
6
|
+
export * from "./components/Atoms/Icon/Icon.js";
|
|
7
|
+
export * from "./components/Atoms/Image/Image.js";
|
|
8
|
+
export * from "./components/Atoms/Label/Label.js";
|
|
9
|
+
export * from "./components/Atoms/RadioButton/RadioButton.js";
|
|
10
|
+
export * from "./components/Atoms/SearchInput/SearchInput.js";
|
|
11
|
+
export * from "./components/Layouts/Container/Container.js";
|
|
12
|
+
export * from "./components/Layouts/Grid/Grid.js";
|
|
13
|
+
export * from "./components/Molecules/Breadcrumbs/Breadcrumbs.js";
|
|
14
|
+
export * from "./components/Molecules/CartIcon/CartIcon.js";
|
|
15
|
+
export * from "./components/Molecules/ProductCard/ProductCard.js";
|
|
16
|
+
export * from "./components/Molecules/ProductDetails/ProductDetails.js";
|
|
17
|
+
export * from "./components/Molecules/RadioGroup/RadioGroup.js";
|
|
18
|
+
export * from "./components/Organisms/Footer/Footer.js";
|
|
19
|
+
export * from "./components/Organisms/Header/Header.js";
|
|
20
|
+
export * from "./components/Organisms/ProductGrid/ProductGrid.js";
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
// Atoms
|
|
2
|
-
export * from "./components/Atoms/Button/Button";
|
|
3
|
-
export * from "./components/Atoms/Chip/Chip";
|
|
4
|
-
export * from "./components/Atoms/ChipLink/ChipLink";
|
|
5
|
-
export * from "./components/Atoms/Spinner/Spinner";
|
|
6
|
-
export * from "./components/Atoms/Text/Text";
|
|
7
|
-
export * from "./components/Atoms/Icon/Icon";
|
|
8
|
-
export * from "./components/Atoms/Image/Image";
|
|
9
|
-
export * from "./components/Atoms/Label/Label";
|
|
10
|
-
export * from "./components/Atoms/RadioButton/RadioButton";
|
|
11
|
-
export * from "./components/Atoms/SearchInput/SearchInput";
|
|
2
|
+
export * from "./components/Atoms/Button/Button.js";
|
|
3
|
+
export * from "./components/Atoms/Chip/Chip.js";
|
|
4
|
+
export * from "./components/Atoms/ChipLink/ChipLink.js";
|
|
5
|
+
export * from "./components/Atoms/Spinner/Spinner.js";
|
|
6
|
+
export * from "./components/Atoms/Text/Text.js";
|
|
7
|
+
export * from "./components/Atoms/Icon/Icon.js";
|
|
8
|
+
export * from "./components/Atoms/Image/Image.js";
|
|
9
|
+
export * from "./components/Atoms/Label/Label.js";
|
|
10
|
+
export * from "./components/Atoms/RadioButton/RadioButton.js";
|
|
11
|
+
export * from "./components/Atoms/SearchInput/SearchInput.js";
|
|
12
12
|
// Layouts
|
|
13
|
-
export * from "./components/Layouts/Container/Container";
|
|
14
|
-
export * from "./components/Layouts/Grid/Grid";
|
|
13
|
+
export * from "./components/Layouts/Container/Container.js";
|
|
14
|
+
export * from "./components/Layouts/Grid/Grid.js";
|
|
15
15
|
// Molecules
|
|
16
|
-
export * from "./components/Molecules/Breadcrumbs/Breadcrumbs";
|
|
17
|
-
export * from "./components/Molecules/CartIcon/CartIcon";
|
|
18
|
-
export * from "./components/Molecules/ProductCard/ProductCard";
|
|
19
|
-
export * from "./components/Molecules/ProductDetails/ProductDetails";
|
|
20
|
-
export * from "./components/Molecules/RadioGroup/RadioGroup";
|
|
16
|
+
export * from "./components/Molecules/Breadcrumbs/Breadcrumbs.js";
|
|
17
|
+
export * from "./components/Molecules/CartIcon/CartIcon.js";
|
|
18
|
+
export * from "./components/Molecules/ProductCard/ProductCard.js";
|
|
19
|
+
export * from "./components/Molecules/ProductDetails/ProductDetails.js";
|
|
20
|
+
export * from "./components/Molecules/RadioGroup/RadioGroup.js";
|
|
21
21
|
// Organisms
|
|
22
|
-
export * from "./components/Organisms/Footer/Footer";
|
|
23
|
-
export * from "./components/Organisms/Header/Header";
|
|
24
|
-
export * from "./components/Organisms/ProductGrid/ProductGrid";
|
|
22
|
+
export * from "./components/Organisms/Footer/Footer.js";
|
|
23
|
+
export * from "./components/Organisms/Header/Header.js";
|
|
24
|
+
export * from "./components/Organisms/ProductGrid/ProductGrid.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nicolassancho/storybook-core",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
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",
|