@nicolassancho/storybook-core 4.2.2 → 4.4.0
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 +2 -2
- package/dist/components/Atoms/Button/Button.d.ts +3 -2
- package/dist/components/Atoms/Button/buttonStyles.d.ts +4 -1
- package/dist/components/Atoms/Button/buttonStyles.js +4 -1
- package/dist/components/Atoms/ButtonLink/ButtonLink.d.ts +3 -2
- package/dist/components/Atoms/Card/Card.d.ts +17 -0
- package/dist/components/Atoms/Card/Card.js +24 -0
- package/dist/components/Atoms/Chip/chipStyles.d.ts +1 -1
- package/dist/components/Atoms/Chip/chipStyles.js +1 -1
- package/dist/components/Atoms/Icon/Icon.d.ts +1 -1
- package/dist/components/Atoms/Icon/Icon.js +1 -0
- package/dist/components/Atoms/Icon/iconsMap.d.ts +4 -0
- package/dist/components/Atoms/Icon/iconsMap.js +8 -0
- package/dist/components/Atoms/SearchInput/SearchInput.d.ts +8 -0
- package/dist/components/Atoms/SearchInput/SearchInput.js +4 -0
- package/dist/components/Molecules/Alert/Alert.d.ts +21 -0
- package/dist/components/Molecules/Alert/Alert.js +30 -0
- package/dist/components/Molecules/Input/Input.d.ts +39 -0
- package/dist/components/Molecules/Input/Input.js +45 -0
- package/dist/components/Molecules/Popover/Popover.d.ts +42 -0
- package/dist/components/Molecules/Popover/Popover.js +70 -0
- package/dist/components/Molecules/SidebarNav/SidebarNav.d.ts +42 -0
- package/dist/components/Molecules/SidebarNav/SidebarNav.js +28 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,8 +35,8 @@ documented in Storybook. It is published to npm as `@nicolassancho/storybook-cor
|
|
|
35
35
|
|
|
36
36
|
| Layer | Components |
|
|
37
37
|
| --------- | ----------------------------------------------------------------------------------- |
|
|
38
|
-
| Atoms | Button, ButtonLink, Chip, ChipLink, Icon, Image, Label, RadioButton, SearchInput, Spinner, Text |
|
|
39
|
-
| Molecules | Breadcrumbs, CartIcon, ProductCard, ProductDetails, RadioGroup
|
|
38
|
+
| Atoms | Button, ButtonLink, Card, Chip, ChipLink, Icon, Image, Label, RadioButton, SearchInput (deprecated), Spinner, Text |
|
|
39
|
+
| Molecules | Alert, Breadcrumbs, CartIcon, Input, Popover, ProductCard, ProductDetails, RadioGroup, SidebarNav |
|
|
40
40
|
| Organisms | Footer, Header, ProductGrid |
|
|
41
41
|
| Layouts | Container, Grid |
|
|
42
42
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
2
|
/**
|
|
3
|
-
* The type of the button
|
|
3
|
+
* The type of the button. `outline` is a neutral bordered button for secondary actions: it does
|
|
4
|
+
* not follow the brand colors, so it looks the same under any theme.
|
|
4
5
|
*/
|
|
5
|
-
variant?: "primary" | "secondary" | "text";
|
|
6
|
+
variant?: "primary" | "secondary" | "text" | "outline";
|
|
6
7
|
/**
|
|
7
8
|
* How large should the button be?
|
|
8
9
|
*/
|
|
@@ -3,6 +3,7 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
|
|
|
3
3
|
primary: "rounded-sm bg-primary text-on-primary";
|
|
4
4
|
secondary: "rounded-sm bg-secondary text-on-secondary focus-visible:ring-secondary";
|
|
5
5
|
text: "rounded-sm text-primary";
|
|
6
|
+
outline: "rounded-sm border border-neutral-400 bg-surface text-neutral-900";
|
|
6
7
|
};
|
|
7
8
|
size: {
|
|
8
9
|
small: "text-xs px-2 py-1";
|
|
@@ -16,11 +17,12 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
|
|
|
16
17
|
true: "no-underline";
|
|
17
18
|
false: "";
|
|
18
19
|
};
|
|
19
|
-
}, undefined, "font-bold inline-flex items-center focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface", {
|
|
20
|
+
}, undefined, "font-bold inline-flex items-center enabled:cursor-pointer focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface", {
|
|
20
21
|
variant: {
|
|
21
22
|
primary: "rounded-sm bg-primary text-on-primary";
|
|
22
23
|
secondary: "rounded-sm bg-secondary text-on-secondary focus-visible:ring-secondary";
|
|
23
24
|
text: "rounded-sm text-primary";
|
|
25
|
+
outline: "rounded-sm border border-neutral-400 bg-surface text-neutral-900";
|
|
24
26
|
};
|
|
25
27
|
size: {
|
|
26
28
|
small: "text-xs px-2 py-1";
|
|
@@ -39,6 +41,7 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
|
|
|
39
41
|
primary: "rounded-sm bg-primary text-on-primary";
|
|
40
42
|
secondary: "rounded-sm bg-secondary text-on-secondary focus-visible:ring-secondary";
|
|
41
43
|
text: "rounded-sm text-primary";
|
|
44
|
+
outline: "rounded-sm border border-neutral-400 bg-surface text-neutral-900";
|
|
42
45
|
};
|
|
43
46
|
size: {
|
|
44
47
|
small: "text-xs px-2 py-1";
|
|
@@ -2,12 +2,13 @@ import { tv } from "tailwind-variants";
|
|
|
2
2
|
// Shared by Button and ButtonLink, not exported from `src/index.js`. The hover classes are in
|
|
3
3
|
// `compoundVariants` because `enabled:` never matches an `<a>`.
|
|
4
4
|
export const buttonStyles = tv({
|
|
5
|
-
base: "font-bold inline-flex items-center focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface",
|
|
5
|
+
base: "font-bold inline-flex items-center enabled:cursor-pointer focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface",
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
8
|
primary: "rounded-sm bg-primary text-on-primary",
|
|
9
9
|
secondary: "rounded-sm bg-secondary text-on-secondary focus-visible:ring-secondary",
|
|
10
10
|
text: "rounded-sm text-primary",
|
|
11
|
+
outline: "rounded-sm border border-neutral-400 bg-surface text-neutral-900",
|
|
11
12
|
},
|
|
12
13
|
size: {
|
|
13
14
|
small: "text-xs px-2 py-1",
|
|
@@ -27,6 +28,8 @@ export const buttonStyles = tv({
|
|
|
27
28
|
{ variant: "primary", link: true, class: "hover:bg-primary-darker" },
|
|
28
29
|
{ variant: "secondary", link: false, class: "enabled:hover:bg-secondary-darker" },
|
|
29
30
|
{ variant: "secondary", link: true, class: "hover:bg-secondary-darker" },
|
|
31
|
+
{ variant: "outline", link: false, class: "enabled:hover:bg-neutral-100" },
|
|
32
|
+
{ variant: "outline", link: true, class: "hover:bg-neutral-100" },
|
|
30
33
|
{ variant: "text", link: false, class: "enabled:hover:underline" },
|
|
31
34
|
{ variant: "text", link: true, class: "hover:underline" },
|
|
32
35
|
],
|
|
@@ -5,9 +5,10 @@ export interface ButtonLinkProps {
|
|
|
5
5
|
/** Link contents */
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
/**
|
|
8
|
-
* The type of the button
|
|
8
|
+
* The type of the button. `outline` is a neutral bordered button for secondary actions: it does
|
|
9
|
+
* not follow the brand colors, so it looks the same under any theme.
|
|
9
10
|
*/
|
|
10
|
-
variant?: "primary" | "secondary" | "text";
|
|
11
|
+
variant?: "primary" | "secondary" | "text" | "outline";
|
|
11
12
|
/**
|
|
12
13
|
* How large should the button be?
|
|
13
14
|
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface CardProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
/**
|
|
4
|
+
* The element to render. A `section` is only a landmark when it has an accessible name, so
|
|
5
|
+
* pass `aria-labelledby` (or `aria-label`) with it.
|
|
6
|
+
*/
|
|
7
|
+
as?: "div" | "section" | "article";
|
|
8
|
+
/** Card contents */
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
/** Additional classes for custom styling, for example padding */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A bordered surface that groups related content, such as a sign-in form or a table. It has no
|
|
15
|
+
* padding of its own, so the content decides the spacing.
|
|
16
|
+
*/
|
|
17
|
+
export declare const Card: React.FC<CardProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { tv } from "tailwind-variants";
|
|
14
|
+
const cardStyles = tv({
|
|
15
|
+
base: "rounded-lg border border-neutral-200 bg-surface shadow-xs",
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* A bordered surface that groups related content, such as a sign-in form or a table. It has no
|
|
19
|
+
* padding of its own, so the content decides the spacing.
|
|
20
|
+
*/
|
|
21
|
+
export const Card = (_a) => {
|
|
22
|
+
var { as: Component = "div", children, className } = _a, props = __rest(_a, ["as", "children", "className"]);
|
|
23
|
+
return (_jsx(Component, Object.assign({}, props, { className: cardStyles({ className }), children: children })));
|
|
24
|
+
};
|
|
@@ -6,7 +6,7 @@ export declare const chipStyles: import("tailwind-variants").TVReturnType<{
|
|
|
6
6
|
disabled: {
|
|
7
7
|
true: "pointer-events-none cursor-not-allowed opacity-50";
|
|
8
8
|
};
|
|
9
|
-
}, undefined, "inline-flex items-center rounded-full border px-4 py-2 text-sm font-medium no-underline transition-colors focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface", {
|
|
9
|
+
}, undefined, "inline-flex items-center enabled:cursor-pointer rounded-full border px-4 py-2 text-sm font-medium no-underline transition-colors focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface", {
|
|
10
10
|
selected: {
|
|
11
11
|
true: "border-primary bg-primary text-on-primary hover:bg-primary-darker";
|
|
12
12
|
false: "border-neutral-400 bg-surface text-neutral-900 hover:border-neutral-900";
|
|
@@ -2,7 +2,7 @@ import { tv } from "tailwind-variants";
|
|
|
2
2
|
// Shared by Chip (a button) and ChipLink (a link) so the two look the same. It is not exported
|
|
3
3
|
// from `src/index.js`: it is an implementation detail, not public API.
|
|
4
4
|
export const chipStyles = tv({
|
|
5
|
-
base: "inline-flex items-center rounded-full border px-4 py-2 text-sm font-medium no-underline transition-colors focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface",
|
|
5
|
+
base: "inline-flex items-center enabled:cursor-pointer rounded-full border px-4 py-2 text-sm font-medium no-underline transition-colors focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface",
|
|
6
6
|
variants: {
|
|
7
7
|
selected: {
|
|
8
8
|
true: "border-primary bg-primary text-on-primary hover:bg-primary-darker",
|
|
@@ -3,7 +3,7 @@ import { IconsMap } from "./iconsMap.js";
|
|
|
3
3
|
export interface IconProps {
|
|
4
4
|
name: keyof typeof IconsMap;
|
|
5
5
|
size?: "small" | "medium" | "large";
|
|
6
|
-
color?: "primary" | "secondary" | "black";
|
|
6
|
+
color?: "primary" | "secondary" | "danger" | "black";
|
|
7
7
|
/**
|
|
8
8
|
* Accessible name for icons that convey meaning on their own.
|
|
9
9
|
* Without it the icon is treated as decorative and hidden from screen readers.
|
|
@@ -5,8 +5,12 @@ export declare const IconsMap: {
|
|
|
5
5
|
ShoppingCart: SvgIcon;
|
|
6
6
|
ArrowDown: SvgIcon;
|
|
7
7
|
ArrowLeft: SvgIcon;
|
|
8
|
+
AlertCircle: SvgIcon;
|
|
8
9
|
AlertOctagon: SvgIcon;
|
|
9
10
|
AlertTriangle: SvgIcon;
|
|
11
|
+
Menu: SvgIcon;
|
|
12
|
+
Package: SvgIcon;
|
|
13
|
+
X: SvgIcon;
|
|
10
14
|
Sun: SvgIcon;
|
|
11
15
|
Moon: SvgIcon;
|
|
12
16
|
};
|
|
@@ -9,6 +9,10 @@ const ShoppingCart = createIcon(_jsxs(_Fragment, { children: [_jsx("circle", { c
|
|
|
9
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
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
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 Package = createIcon(_jsxs(_Fragment, { children: [_jsx("line", { x1: "16.5", y1: "9.4", x2: "7.5", y2: "4.21" }), _jsx("path", { d: "M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" }), _jsx("polyline", { points: "3.27 6.96 12 12.01 20.73 6.96" }), _jsx("line", { x1: "12", y1: "22.08", x2: "12", y2: "12" })] }));
|
|
13
|
+
const Menu = createIcon(_jsxs(_Fragment, { children: [_jsx("line", { x1: "3", y1: "12", x2: "21", y2: "12" }), _jsx("line", { x1: "3", y1: "6", x2: "21", y2: "6" }), _jsx("line", { x1: "3", y1: "18", x2: "21", y2: "18" })] }));
|
|
14
|
+
const X = createIcon(_jsxs(_Fragment, { children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }));
|
|
15
|
+
const AlertCircle = createIcon(_jsxs(_Fragment, { children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })] }));
|
|
12
16
|
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
17
|
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
18
|
const Moon = createIcon(_jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }));
|
|
@@ -17,8 +21,12 @@ export const IconsMap = {
|
|
|
17
21
|
ShoppingCart,
|
|
18
22
|
ArrowDown,
|
|
19
23
|
ArrowLeft,
|
|
24
|
+
AlertCircle,
|
|
20
25
|
AlertOctagon,
|
|
21
26
|
AlertTriangle,
|
|
27
|
+
Menu,
|
|
28
|
+
Package,
|
|
29
|
+
X,
|
|
22
30
|
Sun,
|
|
23
31
|
Moon,
|
|
24
32
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `Input` with `type="search"` instead. It adds a real label (which can be visually
|
|
4
|
+
* hidden), help text and an error message. `SearchInput` will be removed in the next major version.
|
|
5
|
+
*/
|
|
2
6
|
export interface SearchInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
7
|
placeholder?: string;
|
|
4
8
|
/**
|
|
@@ -16,4 +20,8 @@ export interface SearchInputProps extends React.InputHTMLAttributes<HTMLInputEle
|
|
|
16
20
|
*/
|
|
17
21
|
variantSize?: "small" | "medium" | "large";
|
|
18
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use `Input` with `type="search"` and `hideLabel` instead. It will be removed in the
|
|
25
|
+
* next major version.
|
|
26
|
+
*/
|
|
19
27
|
export declare const SearchInput: React.FC<SearchInputProps>;
|
|
@@ -29,6 +29,10 @@ const searchInputStyles = tv({
|
|
|
29
29
|
isInvalid: false,
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use `Input` with `type="search"` and `hideLabel` instead. It will be removed in the
|
|
34
|
+
* next major version.
|
|
35
|
+
*/
|
|
32
36
|
export const SearchInput = (_a) => {
|
|
33
37
|
var { placeholder = "Search…", value, isInvalid = false, onChange, className, variantSize = "medium" } = _a, props = __rest(_a, ["placeholder", "value", "isInvalid", "onChange", "className", "variantSize"]);
|
|
34
38
|
// Fall back to a generic accessible name only when the consumer hasn't labelled the input
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface AlertProps {
|
|
3
|
+
/**
|
|
4
|
+
* The kind of message. Only `error` exists for now: it uses the danger colors and the
|
|
5
|
+
* `alert` role, so assistive technology announces it when it appears.
|
|
6
|
+
*/
|
|
7
|
+
variant?: "error";
|
|
8
|
+
/** What happened, in a few words. It is announced first. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** More detail, for example what the user can do next */
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
/** An element shown beside the message, usually a `Button` such as "Retry" */
|
|
13
|
+
action?: React.ReactNode;
|
|
14
|
+
/** Additional classes for custom styling */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A message about the result of an action, such as a failed sign-in or a page that could not load.
|
|
19
|
+
* It is announced to screen readers when it appears in the page.
|
|
20
|
+
*/
|
|
21
|
+
export declare const Alert: React.FC<AlertProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { tv } from "tailwind-variants";
|
|
3
|
+
import { Icon } from "../../Atoms/Icon/Icon.js";
|
|
4
|
+
const alertStyles = tv({
|
|
5
|
+
slots: {
|
|
6
|
+
base: "flex flex-wrap items-start gap-3 rounded-lg border p-4",
|
|
7
|
+
icon: "mt-0.5 shrink-0",
|
|
8
|
+
content: "min-w-0 flex-1",
|
|
9
|
+
title: "text-sm font-semibold",
|
|
10
|
+
body: "mt-1 text-sm text-neutral-900",
|
|
11
|
+
action: "shrink-0",
|
|
12
|
+
},
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
error: {
|
|
16
|
+
base: "border-danger bg-danger-subtle",
|
|
17
|
+
title: "text-danger",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: { variant: "error" },
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* A message about the result of an action, such as a failed sign-in or a page that could not load.
|
|
25
|
+
* It is announced to screen readers when it appears in the page.
|
|
26
|
+
*/
|
|
27
|
+
export const Alert = ({ variant = "error", title, children, action, className, }) => {
|
|
28
|
+
const styles = alertStyles({ variant });
|
|
29
|
+
return (_jsxs("div", { role: "alert", className: styles.base({ className }), children: [_jsx("span", { className: styles.icon(), children: _jsx(Icon, { name: "AlertCircle", size: "small", color: "danger" }) }), _jsxs("div", { className: styles.content(), children: [_jsx("p", { className: styles.title(), children: title }), children && _jsx("div", { className: styles.body(), children: children })] }), action && _jsx("div", { className: styles.action(), children: action })] }));
|
|
30
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
3
|
+
/**
|
|
4
|
+
* The field's name. It is always rendered as a real `<label>`, so every input has an accessible
|
|
5
|
+
* name and clicking the text focuses the field.
|
|
6
|
+
*/
|
|
7
|
+
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* Hides the label visually (`sr-only`) and keeps it for screen readers. Use it when the
|
|
10
|
+
* surrounding UI already names the field, for example a search box next to a heading.
|
|
11
|
+
*/
|
|
12
|
+
hideLabel?: boolean;
|
|
13
|
+
/** Help text under the field. Linked with `aria-describedby`. */
|
|
14
|
+
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Error message under the field. Setting it marks the field `aria-invalid` and links the
|
|
17
|
+
* message with `aria-describedby`. Moving focus to the field is the page's job, for example
|
|
18
|
+
* after a failed submit.
|
|
19
|
+
*/
|
|
20
|
+
error?: string;
|
|
21
|
+
/** The kind of field. `search` makes it a search box. */
|
|
22
|
+
type?: "text" | "email" | "password" | "search" | "url" | "tel";
|
|
23
|
+
/**
|
|
24
|
+
* Current text. Setting it makes the input controlled: pair it with `onChange`. Leave it out
|
|
25
|
+
* for an uncontrolled input (set the initial text with `defaultValue`), which a native `<form>`
|
|
26
|
+
* can submit without any handler, for example a Server Action form rendered on the server.
|
|
27
|
+
*/
|
|
28
|
+
value?: string;
|
|
29
|
+
/** Called on every change. Optional, so the input renders from a Server Component. */
|
|
30
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
31
|
+
/** Additional classes for the `<input>` element */
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A text field with its label, optional help text and optional error message. It needs no
|
|
36
|
+
* JavaScript of its own: the label, description and error are wired with native attributes, and
|
|
37
|
+
* an uncontrolled input is submitted by a native `<form>`.
|
|
38
|
+
*/
|
|
39
|
+
export declare const Input: React.FC<InputProps>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useId } from "react";
|
|
14
|
+
import { tv } from "tailwind-variants";
|
|
15
|
+
import { Label } from "../../Atoms/Label/Label.js";
|
|
16
|
+
const inputStyles = tv({
|
|
17
|
+
slots: {
|
|
18
|
+
root: "flex flex-col gap-1",
|
|
19
|
+
field: "w-full rounded-sm border bg-surface px-3 py-2 text-sm text-neutral-900 placeholder:text-neutral-500 focus:outline-hidden focus:ring-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
20
|
+
description: "text-sm text-neutral-500",
|
|
21
|
+
error: "text-sm text-danger",
|
|
22
|
+
},
|
|
23
|
+
variants: {
|
|
24
|
+
invalid: {
|
|
25
|
+
true: { field: "border-danger focus:border-danger focus:ring-danger" },
|
|
26
|
+
false: { field: "border-neutral-400 focus:border-primary focus:ring-primary" },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: { invalid: false },
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* A text field with its label, optional help text and optional error message. It needs no
|
|
33
|
+
* JavaScript of its own: the label, description and error are wired with native attributes, and
|
|
34
|
+
* an uncontrolled input is submitted by a native `<form>`.
|
|
35
|
+
*/
|
|
36
|
+
export const Input = (_a) => {
|
|
37
|
+
var { label, hideLabel = false, description, error, type = "text", id, className, "aria-describedby": describedBy } = _a, props = __rest(_a, ["label", "hideLabel", "description", "error", "type", "id", "className", "aria-describedby"]);
|
|
38
|
+
const generatedId = useId();
|
|
39
|
+
const inputId = id !== null && id !== void 0 ? id : generatedId;
|
|
40
|
+
const descriptionId = `${inputId}-description`;
|
|
41
|
+
const errorId = `${inputId}-error`;
|
|
42
|
+
const ids = [describedBy, description && descriptionId, error && errorId].filter(Boolean);
|
|
43
|
+
const styles = inputStyles({ invalid: Boolean(error) });
|
|
44
|
+
return (_jsxs("div", { className: styles.root(), children: [_jsx(Label, { htmlFor: inputId, color: "darker", className: hideLabel ? "sr-only" : undefined, children: label }), _jsx("input", Object.assign({}, props, { id: inputId, type: type, "aria-invalid": error ? true : undefined, "aria-describedby": ids.length > 0 ? ids.join(" ") : undefined, className: styles.field({ className }) })), description && (_jsx("p", { id: descriptionId, className: styles.description(), children: description })), error && (_jsx("p", { id: errorId, className: styles.error(), children: error }))] }));
|
|
45
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface PopoverProps {
|
|
3
|
+
/** Content of the button that opens the panel: text, an icon, or both */
|
|
4
|
+
trigger: React.ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Accessible name for the trigger. Needed only when `trigger` has no text, for example an
|
|
7
|
+
* icon-only button. It replaces the visible text for screen readers, so leave it out otherwise.
|
|
8
|
+
*/
|
|
9
|
+
triggerLabel?: string;
|
|
10
|
+
/** Style of the trigger button, one of the `Button` variants */
|
|
11
|
+
variant?: "primary" | "secondary" | "text" | "outline";
|
|
12
|
+
/** Size of the trigger button */
|
|
13
|
+
size?: "small" | "medium" | "large";
|
|
14
|
+
/**
|
|
15
|
+
* Where the panel appears. `bottom-start` and `bottom-end` open a dropdown under the trigger,
|
|
16
|
+
* aligned to its left or right edge. `drawer` slides a full-height panel in from the left edge of
|
|
17
|
+
* the screen, with a dimmed backdrop. The drawer is not modal: keyboard focus can still leave it.
|
|
18
|
+
*/
|
|
19
|
+
placement?: "bottom-start" | "bottom-end" | "drawer";
|
|
20
|
+
/**
|
|
21
|
+
* Accessible name of the close button that the `drawer` placement shows at the top of the panel,
|
|
22
|
+
* for people who cannot press Esc or tap the dimmed area. Translate it for other languages. A
|
|
23
|
+
* dropdown has no close button.
|
|
24
|
+
*/
|
|
25
|
+
closeLabel?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Panel content. It can be Server Components, so a navigation list or a form with a Server
|
|
28
|
+
* Action stays on the server. Only the trigger button and the panel shell are client code.
|
|
29
|
+
*/
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
/** Additional classes for the panel */
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A button that opens a panel using the browser's native `popover`. The browser handles closing on
|
|
36
|
+
* an outside click and on Esc, returning focus to the button, and drawing the panel above the page.
|
|
37
|
+
*
|
|
38
|
+
* This is a client component. It adds what the native popover lacks: `aria-expanded` on the button,
|
|
39
|
+
* closing when a link inside the panel is clicked or a form inside it is submitted, and placing a
|
|
40
|
+
* dropdown under its button. Render it from a Server Component; every prop is serializable.
|
|
41
|
+
*/
|
|
42
|
+
export declare const Popover: React.FC<PopoverProps>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
4
|
+
import { tv } from "tailwind-variants";
|
|
5
|
+
import { buttonStyles } from "../../Atoms/Button/buttonStyles.js";
|
|
6
|
+
import { Icon } from "../../Atoms/Icon/Icon.js";
|
|
7
|
+
const popoverStyles = tv({
|
|
8
|
+
base: "m-0 border-neutral-200 bg-surface text-neutral-900",
|
|
9
|
+
variants: {
|
|
10
|
+
placement: {
|
|
11
|
+
"bottom-start": "inset-auto w-max min-w-48 max-w-[calc(100vw-2rem)] rounded-lg border p-2 shadow-lg backdrop:bg-transparent",
|
|
12
|
+
"bottom-end": "inset-auto w-max min-w-48 max-w-[calc(100vw-2rem)] rounded-lg border p-2 shadow-lg backdrop:bg-transparent",
|
|
13
|
+
drawer: "inset-y-0 left-0 h-dvh w-72 max-w-[85vw] overflow-y-auto border-r p-0 shadow-lg backdrop:bg-black/40",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: { placement: "bottom-start" },
|
|
17
|
+
});
|
|
18
|
+
const GAP = 4;
|
|
19
|
+
/**
|
|
20
|
+
* A button that opens a panel using the browser's native `popover`. The browser handles closing on
|
|
21
|
+
* an outside click and on Esc, returning focus to the button, and drawing the panel above the page.
|
|
22
|
+
*
|
|
23
|
+
* This is a client component. It adds what the native popover lacks: `aria-expanded` on the button,
|
|
24
|
+
* closing when a link inside the panel is clicked or a form inside it is submitted, and placing a
|
|
25
|
+
* dropdown under its button. Render it from a Server Component; every prop is serializable.
|
|
26
|
+
*/
|
|
27
|
+
export const Popover = ({ trigger, triggerLabel, variant = "outline", size = "medium", placement = "bottom-start", closeLabel = "Close menu", children, className, }) => {
|
|
28
|
+
const panelId = useId();
|
|
29
|
+
const triggerRef = useRef(null);
|
|
30
|
+
const panelRef = useRef(null);
|
|
31
|
+
const [open, setOpen] = useState(false);
|
|
32
|
+
// A popover is drawn in the top layer, so it ignores its parent's position: place it from the
|
|
33
|
+
// trigger's rectangle in the viewport.
|
|
34
|
+
const place = useCallback(() => {
|
|
35
|
+
const panel = panelRef.current;
|
|
36
|
+
const button = triggerRef.current;
|
|
37
|
+
if (!panel || !button || placement === "drawer")
|
|
38
|
+
return;
|
|
39
|
+
const rect = button.getBoundingClientRect();
|
|
40
|
+
panel.style.top = `${rect.bottom + GAP}px`;
|
|
41
|
+
if (placement === "bottom-end") {
|
|
42
|
+
panel.style.left = "auto";
|
|
43
|
+
panel.style.right = `${document.documentElement.clientWidth - rect.right}px`;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
panel.style.right = "auto";
|
|
47
|
+
panel.style.left = `${rect.left}px`;
|
|
48
|
+
}
|
|
49
|
+
}, [placement]);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!open)
|
|
52
|
+
return;
|
|
53
|
+
window.addEventListener("resize", place);
|
|
54
|
+
window.addEventListener("scroll", place, true);
|
|
55
|
+
return () => {
|
|
56
|
+
window.removeEventListener("resize", place);
|
|
57
|
+
window.removeEventListener("scroll", place, true);
|
|
58
|
+
};
|
|
59
|
+
}, [open, place]);
|
|
60
|
+
const closeOnNavigation = (event) => {
|
|
61
|
+
var _a;
|
|
62
|
+
if (event.target instanceof Element && event.target.closest("a[href]")) {
|
|
63
|
+
(_a = panelRef.current) === null || _a === void 0 ? void 0 : _a.hidePopover();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { ref: triggerRef, type: "button", popoverTarget: panelId, "aria-expanded": open, "aria-controls": panelId, "aria-label": triggerLabel, className: buttonStyles({ variant, size }), children: trigger }), _jsxs("div", { ref: panelRef, id: panelId, popover: "auto", onBeforeToggle: (event) => {
|
|
67
|
+
if (event.newState === "open")
|
|
68
|
+
place();
|
|
69
|
+
}, onToggle: (event) => setOpen(event.newState === "open"), onClick: closeOnNavigation, onSubmit: () => { var _a; return (_a = panelRef.current) === null || _a === void 0 ? void 0 : _a.hidePopover(); }, className: popoverStyles({ placement, className }), children: [placement === "drawer" && (_jsx("div", { className: "flex justify-end p-2", children: _jsx("button", { type: "button", popoverTarget: panelId, popoverTargetAction: "hide", "aria-label": closeLabel, className: buttonStyles({ variant: "outline", size: "small" }), children: _jsx(Icon, { name: "X", size: "small" }) }) })), children] })] }));
|
|
70
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconProps } from "../../Atoms/Icon/Icon.js";
|
|
3
|
+
export interface SidebarNavItem {
|
|
4
|
+
/** Link text */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Where the link goes. It needs no JavaScript. */
|
|
7
|
+
href: string;
|
|
8
|
+
/** Name of an icon shown before the label. It is decorative: the label names the link. */
|
|
9
|
+
icon?: IconProps["name"];
|
|
10
|
+
/**
|
|
11
|
+
* Whether this is the page the user is on. It sets `aria-current="page"` and highlights the item.
|
|
12
|
+
* The component cannot know the URL, so the app decides, usually with `usePathname`.
|
|
13
|
+
*/
|
|
14
|
+
current?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface SidebarNavProps {
|
|
17
|
+
/** The links, in order */
|
|
18
|
+
items: SidebarNavItem[];
|
|
19
|
+
/** Accessible name of the navigation landmark. Name it when the page has more than one `nav`. */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Content above the links, for example the tenant's logo and name */
|
|
22
|
+
header?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Component used to render each link. Receives `href`, `className`, `children` and
|
|
25
|
+
* `aria-current`, so a framework link (e.g. `next/link`) can be passed directly. Defaults to a
|
|
26
|
+
* plain `<a>`. Define it outside the render function: an inline definition remounts the links.
|
|
27
|
+
*/
|
|
28
|
+
LinkComponent?: React.ElementType<{
|
|
29
|
+
href: string;
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
"aria-current"?: "page";
|
|
33
|
+
}>;
|
|
34
|
+
/** Additional classes for the wrapper */
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The navigation list for an app's side panel: labelled links with an optional icon, and the current
|
|
39
|
+
* page highlighted with the brand color. It has no width, position or collapse behavior of its own:
|
|
40
|
+
* the app's layout decides those. Put it inside a `Popover` with `placement="drawer"` on narrow screens.
|
|
41
|
+
*/
|
|
42
|
+
export declare const SidebarNav: React.FC<SidebarNavProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { tv } from "tailwind-variants";
|
|
3
|
+
import { Icon } from "../../Atoms/Icon/Icon.js";
|
|
4
|
+
const sidebarNavStyles = tv({
|
|
5
|
+
slots: {
|
|
6
|
+
base: "flex flex-col gap-4",
|
|
7
|
+
list: "flex flex-col gap-1",
|
|
8
|
+
link: "flex items-center gap-2 rounded-sm border-l-2 px-3 py-2 text-sm font-medium text-neutral-900 focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface",
|
|
9
|
+
},
|
|
10
|
+
variants: {
|
|
11
|
+
current: {
|
|
12
|
+
true: { link: "border-primary bg-primary/10" },
|
|
13
|
+
false: { link: "border-transparent hover:bg-neutral-100" },
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: { current: false },
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* The navigation list for an app's side panel: labelled links with an optional icon, and the current
|
|
20
|
+
* page highlighted with the brand color. It has no width, position or collapse behavior of its own:
|
|
21
|
+
* the app's layout decides those. Put it inside a `Popover` with `placement="drawer"` on narrow screens.
|
|
22
|
+
*/
|
|
23
|
+
export const SidebarNav = ({ items, label = "Main", header, LinkComponent = "a", className, }) => {
|
|
24
|
+
const styles = sidebarNavStyles();
|
|
25
|
+
// When some items have an icon, the others reserve its space so every label lines up.
|
|
26
|
+
const hasIcons = items.some(({ icon }) => icon);
|
|
27
|
+
return (_jsxs("div", { className: styles.base({ className }), children: [header, _jsx("nav", { "aria-label": label, children: _jsx("ul", { className: styles.list(), children: items.map(({ label: text, href, icon, current }) => (_jsx("li", { children: _jsxs(LinkComponent, { href: href, className: sidebarNavStyles({ current: Boolean(current) }).link(), "aria-current": current ? "page" : undefined, children: [icon ? (_jsx(Icon, { name: icon, size: "small" })) : (hasIcons && _jsx("span", { "aria-hidden": "true", className: "size-4 shrink-0" })), _jsx("span", { children: text })] }) }, href))) }) })] }));
|
|
28
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./components/Atoms/Button/Button.js";
|
|
2
2
|
export * from "./components/Atoms/ButtonLink/ButtonLink.js";
|
|
3
|
+
export * from "./components/Atoms/Card/Card.js";
|
|
3
4
|
export * from "./components/Atoms/Chip/Chip.js";
|
|
4
5
|
export * from "./components/Atoms/ChipLink/ChipLink.js";
|
|
5
6
|
export * from "./components/Atoms/Spinner/Spinner.js";
|
|
@@ -11,11 +12,15 @@ export * from "./components/Atoms/RadioButton/RadioButton.js";
|
|
|
11
12
|
export * from "./components/Atoms/SearchInput/SearchInput.js";
|
|
12
13
|
export * from "./components/Layouts/Container/Container.js";
|
|
13
14
|
export * from "./components/Layouts/Grid/Grid.js";
|
|
15
|
+
export * from "./components/Molecules/Alert/Alert.js";
|
|
14
16
|
export * from "./components/Molecules/Breadcrumbs/Breadcrumbs.js";
|
|
15
17
|
export * from "./components/Molecules/CartIcon/CartIcon.js";
|
|
18
|
+
export * from "./components/Molecules/Input/Input.js";
|
|
19
|
+
export * from "./components/Molecules/Popover/Popover.js";
|
|
16
20
|
export * from "./components/Molecules/ProductCard/ProductCard.js";
|
|
17
21
|
export * from "./components/Molecules/ProductDetails/ProductDetails.js";
|
|
18
22
|
export * from "./components/Molecules/RadioGroup/RadioGroup.js";
|
|
23
|
+
export * from "./components/Molecules/SidebarNav/SidebarNav.js";
|
|
19
24
|
export * from "./components/Organisms/Footer/Footer.js";
|
|
20
25
|
export * from "./components/Organisms/Header/Header.js";
|
|
21
26
|
export * from "./components/Organisms/ProductGrid/ProductGrid.js";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Atoms
|
|
2
2
|
export * from "./components/Atoms/Button/Button.js";
|
|
3
3
|
export * from "./components/Atoms/ButtonLink/ButtonLink.js";
|
|
4
|
+
export * from "./components/Atoms/Card/Card.js";
|
|
4
5
|
export * from "./components/Atoms/Chip/Chip.js";
|
|
5
6
|
export * from "./components/Atoms/ChipLink/ChipLink.js";
|
|
6
7
|
export * from "./components/Atoms/Spinner/Spinner.js";
|
|
@@ -14,11 +15,15 @@ export * from "./components/Atoms/SearchInput/SearchInput.js";
|
|
|
14
15
|
export * from "./components/Layouts/Container/Container.js";
|
|
15
16
|
export * from "./components/Layouts/Grid/Grid.js";
|
|
16
17
|
// Molecules
|
|
18
|
+
export * from "./components/Molecules/Alert/Alert.js";
|
|
17
19
|
export * from "./components/Molecules/Breadcrumbs/Breadcrumbs.js";
|
|
18
20
|
export * from "./components/Molecules/CartIcon/CartIcon.js";
|
|
21
|
+
export * from "./components/Molecules/Input/Input.js";
|
|
22
|
+
export * from "./components/Molecules/Popover/Popover.js";
|
|
19
23
|
export * from "./components/Molecules/ProductCard/ProductCard.js";
|
|
20
24
|
export * from "./components/Molecules/ProductDetails/ProductDetails.js";
|
|
21
25
|
export * from "./components/Molecules/RadioGroup/RadioGroup.js";
|
|
26
|
+
export * from "./components/Molecules/SidebarNav/SidebarNav.js";
|
|
22
27
|
// Organisms
|
|
23
28
|
export * from "./components/Organisms/Footer/Footer.js";
|
|
24
29
|
export * from "./components/Organisms/Header/Header.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nicolassancho/storybook-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
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",
|