@nicolassancho/storybook-core 4.2.2 → 4.3.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 +3 -0
- package/dist/components/Atoms/Button/buttonStyles.js +3 -0
- 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/Icon/Icon.d.ts +1 -1
- package/dist/components/Atoms/Icon/Icon.js +1 -0
- package/dist/components/Atoms/Icon/iconsMap.d.ts +1 -0
- package/dist/components/Atoms/Icon/iconsMap.js +2 -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/index.d.ts +3 -0
- package/dist/index.js +3 -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, ProductCard, ProductDetails, RadioGroup |
|
|
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";
|
|
@@ -21,6 +22,7 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
|
|
|
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";
|
|
@@ -8,6 +8,7 @@ export const buttonStyles = tv({
|
|
|
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
|
+
};
|
|
@@ -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.
|
|
@@ -9,6 +9,7 @@ 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 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
13
|
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
14
|
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
15
|
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,6 +18,7 @@ export const IconsMap = {
|
|
|
17
18
|
ShoppingCart,
|
|
18
19
|
ArrowDown,
|
|
19
20
|
ArrowLeft,
|
|
21
|
+
AlertCircle,
|
|
20
22
|
AlertOctagon,
|
|
21
23
|
AlertTriangle,
|
|
22
24
|
Sun,
|
|
@@ -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
|
+
};
|
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,8 +12,10 @@ 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";
|
|
16
19
|
export * from "./components/Molecules/ProductCard/ProductCard.js";
|
|
17
20
|
export * from "./components/Molecules/ProductDetails/ProductDetails.js";
|
|
18
21
|
export * from "./components/Molecules/RadioGroup/RadioGroup.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,8 +15,10 @@ 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";
|
|
19
22
|
export * from "./components/Molecules/ProductCard/ProductCard.js";
|
|
20
23
|
export * from "./components/Molecules/ProductDetails/ProductDetails.js";
|
|
21
24
|
export * from "./components/Molecules/RadioGroup/RadioGroup.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nicolassancho/storybook-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.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",
|