@nicolassancho/storybook-core 4.8.0 → 4.9.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/dist/components/Atoms/Button/Button.d.ts +3 -2
- package/dist/components/Atoms/Button/buttonStyles.d.ts +13 -13
- package/dist/components/Atoms/Button/buttonStyles.js +6 -5
- package/dist/components/Atoms/ButtonLink/ButtonLink.d.ts +3 -2
- package/dist/components/Atoms/Chip/chipStyles.d.ts +1 -1
- package/dist/components/Atoms/Chip/chipStyles.js +5 -1
- package/dist/components/Atoms/RadioButton/RadioButton.js +2 -1
- package/dist/components/Atoms/SearchInput/SearchInput.js +10 -6
- package/dist/components/Molecules/Breadcrumbs/Breadcrumbs.js +4 -4
- package/dist/components/Molecules/CartIcon/CartIcon.js +2 -1
- package/dist/components/Molecules/EmptyState/EmptyState.js +1 -1
- package/dist/components/Molecules/Input/fieldStyles.d.ts +7 -7
- package/dist/components/Molecules/Input/fieldStyles.js +7 -3
- package/dist/components/Molecules/Pagination/Pagination.js +2 -1
- package/dist/components/Molecules/ProductCard/ProductCard.js +2 -2
- package/dist/components/Molecules/SidebarNav/SidebarNav.js +5 -1
- package/dist/components/Molecules/Table/Table.js +2 -1
- package/dist/components/Organisms/Footer/Footer.js +2 -1
- package/dist/components/Organisms/Header/Header.js +2 -1
- package/dist/components/styles/focusRing.d.ts +6 -0
- package/dist/components/styles/focusRing.js +6 -0
- package/dist/components/styles/linkStyles.d.ts +16 -0
- package/dist/components/styles/linkStyles.js +14 -0
- package/dist/styles/theme.css +11 -8
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
2
|
/**
|
|
3
|
-
* The type of the button. `outline` is
|
|
4
|
-
*
|
|
3
|
+
* The type of the button. `outline` is the default for a second action: it does not follow the
|
|
4
|
+
* brand colors, so it looks the same under any theme. `secondary` is a filled button with as much
|
|
5
|
+
* emphasis as `primary`, neutral unless the app sets its own color.
|
|
5
6
|
*/
|
|
6
7
|
variant?: "primary" | "secondary" | "text" | "outline";
|
|
7
8
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
|
|
2
2
|
variant: {
|
|
3
3
|
primary: "rounded-sm bg-primary text-on-primary";
|
|
4
|
-
secondary: "rounded-sm bg-secondary text-on-secondary
|
|
4
|
+
secondary: "rounded-sm bg-secondary text-on-secondary";
|
|
5
5
|
text: "rounded-sm text-primary";
|
|
6
6
|
outline: "rounded-sm border border-neutral-400 bg-surface text-neutral-900";
|
|
7
7
|
};
|
|
8
8
|
size: {
|
|
9
|
-
small: "gap-1 text-
|
|
10
|
-
medium: "gap-2 text-sm px-4 py-2";
|
|
11
|
-
large: "gap-3 text-lg px-6 py-
|
|
9
|
+
small: "min-h-8 gap-1 text-sm px-2 py-1";
|
|
10
|
+
medium: "min-h-10 gap-2 text-sm px-4 py-2";
|
|
11
|
+
large: "min-h-12 gap-3 text-lg px-6 py-2";
|
|
12
12
|
};
|
|
13
13
|
disabled: {
|
|
14
14
|
true: "opacity-50 cursor-not-allowed";
|
|
@@ -17,17 +17,17 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
|
|
|
17
17
|
true: "no-underline";
|
|
18
18
|
false: "";
|
|
19
19
|
};
|
|
20
|
-
}, undefined,
|
|
20
|
+
}, undefined, string[], {
|
|
21
21
|
variant: {
|
|
22
22
|
primary: "rounded-sm bg-primary text-on-primary";
|
|
23
|
-
secondary: "rounded-sm bg-secondary text-on-secondary
|
|
23
|
+
secondary: "rounded-sm bg-secondary text-on-secondary";
|
|
24
24
|
text: "rounded-sm text-primary";
|
|
25
25
|
outline: "rounded-sm border border-neutral-400 bg-surface text-neutral-900";
|
|
26
26
|
};
|
|
27
27
|
size: {
|
|
28
|
-
small: "gap-1 text-
|
|
29
|
-
medium: "gap-2 text-sm px-4 py-2";
|
|
30
|
-
large: "gap-3 text-lg px-6 py-
|
|
28
|
+
small: "min-h-8 gap-1 text-sm px-2 py-1";
|
|
29
|
+
medium: "min-h-10 gap-2 text-sm px-4 py-2";
|
|
30
|
+
large: "min-h-12 gap-3 text-lg px-6 py-2";
|
|
31
31
|
};
|
|
32
32
|
disabled: {
|
|
33
33
|
true: "opacity-50 cursor-not-allowed";
|
|
@@ -39,14 +39,14 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
|
|
|
39
39
|
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
40
40
|
variant: {
|
|
41
41
|
primary: "rounded-sm bg-primary text-on-primary";
|
|
42
|
-
secondary: "rounded-sm bg-secondary text-on-secondary
|
|
42
|
+
secondary: "rounded-sm bg-secondary text-on-secondary";
|
|
43
43
|
text: "rounded-sm text-primary";
|
|
44
44
|
outline: "rounded-sm border border-neutral-400 bg-surface text-neutral-900";
|
|
45
45
|
};
|
|
46
46
|
size: {
|
|
47
|
-
small: "gap-1 text-
|
|
48
|
-
medium: "gap-2 text-sm px-4 py-2";
|
|
49
|
-
large: "gap-3 text-lg px-6 py-
|
|
47
|
+
small: "min-h-8 gap-1 text-sm px-2 py-1";
|
|
48
|
+
medium: "min-h-10 gap-2 text-sm px-4 py-2";
|
|
49
|
+
large: "min-h-12 gap-3 text-lg px-6 py-2";
|
|
50
50
|
};
|
|
51
51
|
disabled: {
|
|
52
52
|
true: "opacity-50 cursor-not-allowed";
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
|
+
import { focusRing } from "../../styles/focusRing.js";
|
|
2
3
|
// Shared by Button and ButtonLink, not exported from `src/index.js`. The hover classes are in
|
|
3
4
|
// `compoundVariants` because `enabled:` never matches an `<a>`. The gap between children (an icon
|
|
4
5
|
// and a label) is half the horizontal padding, so it scales with the size.
|
|
5
6
|
export const buttonStyles = tv({
|
|
6
|
-
base: "font-
|
|
7
|
+
base: ["font-medium inline-flex items-center enabled:cursor-pointer", focusRing],
|
|
7
8
|
variants: {
|
|
8
9
|
variant: {
|
|
9
10
|
primary: "rounded-sm bg-primary text-on-primary",
|
|
10
|
-
secondary: "rounded-sm bg-secondary text-on-secondary
|
|
11
|
+
secondary: "rounded-sm bg-secondary text-on-secondary",
|
|
11
12
|
text: "rounded-sm text-primary",
|
|
12
13
|
outline: "rounded-sm border border-neutral-400 bg-surface text-neutral-900",
|
|
13
14
|
},
|
|
14
15
|
size: {
|
|
15
|
-
small: "gap-1 text-
|
|
16
|
-
medium: "gap-2 text-sm px-4 py-2",
|
|
17
|
-
large: "gap-3 text-lg px-6 py-
|
|
16
|
+
small: "min-h-8 gap-1 text-sm px-2 py-1",
|
|
17
|
+
medium: "min-h-10 gap-2 text-sm px-4 py-2",
|
|
18
|
+
large: "min-h-12 gap-3 text-lg px-6 py-2",
|
|
18
19
|
},
|
|
19
20
|
disabled: {
|
|
20
21
|
true: "opacity-50 cursor-not-allowed",
|
|
@@ -5,8 +5,9 @@ export interface ButtonLinkProps {
|
|
|
5
5
|
/** Link contents */
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
/**
|
|
8
|
-
* The type of the button. `outline` is
|
|
9
|
-
*
|
|
8
|
+
* The type of the button. `outline` is the default for a second action: it does not follow the
|
|
9
|
+
* brand colors, so it looks the same under any theme. `secondary` is a filled button with as much
|
|
10
|
+
* emphasis as `primary`, neutral unless the app sets its own color.
|
|
10
11
|
*/
|
|
11
12
|
variant?: "primary" | "secondary" | "text" | "outline";
|
|
12
13
|
/**
|
|
@@ -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,
|
|
9
|
+
}, undefined, string[], {
|
|
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";
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
|
+
import { focusRing } from "../../styles/focusRing.js";
|
|
2
3
|
// Shared by Chip (a button) and ChipLink (a link) so the two look the same. It is not exported
|
|
3
4
|
// from `src/index.js`: it is an implementation detail, not public API.
|
|
4
5
|
export const chipStyles = tv({
|
|
5
|
-
base:
|
|
6
|
+
base: [
|
|
7
|
+
"inline-flex min-h-10 items-center enabled:cursor-pointer rounded-full border px-4 py-2 text-sm font-medium no-underline transition-colors",
|
|
8
|
+
focusRing,
|
|
9
|
+
],
|
|
6
10
|
variants: {
|
|
7
11
|
selected: {
|
|
8
12
|
true: "border-primary bg-primary text-on-primary hover:bg-primary-darker",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
+
import { focusRing } from "../../styles/focusRing.js";
|
|
3
4
|
import { Text } from "../../Atoms/Text/Text.js";
|
|
4
5
|
const radioButtonStyles = tv({
|
|
5
6
|
base: "flex items-center gap-2 cursor-pointer",
|
|
6
7
|
slots: {
|
|
7
|
-
input: "
|
|
8
|
+
input: ["rounded-full accent-primary", focusRing],
|
|
8
9
|
},
|
|
9
10
|
});
|
|
10
11
|
export const RadioButton = ({ label, value, checked, defaultChecked, onChange, name, className, }) => {
|
|
@@ -11,17 +11,21 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { tv } from "tailwind-variants";
|
|
14
|
+
import { focusRing } from "../../styles/focusRing.js";
|
|
14
15
|
const searchInputStyles = tv({
|
|
15
|
-
base:
|
|
16
|
+
base: [
|
|
17
|
+
"w-full rounded-sm bg-surface text-neutral-900 placeholder:text-neutral-500 transition-colors",
|
|
18
|
+
focusRing,
|
|
19
|
+
],
|
|
16
20
|
variants: {
|
|
17
21
|
variantSize: {
|
|
18
|
-
small: "
|
|
19
|
-
medium: "text-sm
|
|
20
|
-
large: "text-base
|
|
22
|
+
small: "h-8 text-sm px-2",
|
|
23
|
+
medium: "h-10 text-sm px-3",
|
|
24
|
+
large: "h-12 text-base px-4",
|
|
21
25
|
},
|
|
22
26
|
isInvalid: {
|
|
23
|
-
true: "border border-danger
|
|
24
|
-
false: "border border-neutral-400
|
|
27
|
+
true: "border border-danger",
|
|
28
|
+
false: "border border-neutral-400",
|
|
25
29
|
},
|
|
26
30
|
},
|
|
27
31
|
defaultVariants: {
|
|
@@ -1,14 +1,14 @@
|
|
|
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 { linkStyles } from "../../styles/linkStyles.js";
|
|
3
4
|
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: {
|
|
8
8
|
list: "flex items-center gap-1",
|
|
9
9
|
item: "flex items-center gap-1",
|
|
10
|
-
link:
|
|
11
|
-
current: "text-neutral-
|
|
10
|
+
link: linkStyles({ variant: "nav" }),
|
|
11
|
+
current: "text-neutral-900",
|
|
12
12
|
separator: "text-neutral-400",
|
|
13
13
|
},
|
|
14
14
|
});
|
|
@@ -17,7 +17,7 @@ export const Breadcrumbs = ({ items, LinkComponent = "a", className, }) => {
|
|
|
17
17
|
return (_jsx("nav", { className: styles.base({ className }), "aria-label": "Breadcrumb", children: _jsx("ol", { className: styles.list(), children: items.map(({ label, href }, index) => {
|
|
18
18
|
const isFirst = index === 0;
|
|
19
19
|
const isLast = index === items.length - 1;
|
|
20
|
-
const content = isFirst ? (_jsxs(_Fragment, { children: [_jsx(Icon, { name: "Home", size: "small"
|
|
20
|
+
const content = isFirst ? (_jsxs(_Fragment, { children: [_jsx(Icon, { name: "Home", size: "small" }), _jsx("span", { className: "sr-only", children: label })] })) : (label);
|
|
21
21
|
return (_jsxs("li", { className: styles.item(), children: [!isFirst && (_jsx("span", { className: styles.separator(), "aria-hidden": "true", children: "/" })), isLast ? (_jsx("span", { className: styles.current(), "aria-current": "page", children: content })) : (_jsx(LinkComponent, { href: href || "/", className: styles.link(), children: content }))] }, `${label}-${href !== null && href !== void 0 ? href : ""}`));
|
|
22
22
|
}) }) }));
|
|
23
23
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
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 { focusRing } from "../../styles/focusRing.js";
|
|
3
4
|
import { Icon } from "../../Atoms/Icon/Icon.js";
|
|
4
5
|
import { Text } from "../../Atoms/Text/Text.js";
|
|
5
6
|
const cartIconStyles = tv({
|
|
6
7
|
base: "relative inline-flex items-center",
|
|
7
8
|
variants: {
|
|
8
9
|
interactive: {
|
|
9
|
-
true: "cursor-pointer rounded-sm
|
|
10
|
+
true: ["cursor-pointer rounded-sm", focusRing],
|
|
10
11
|
},
|
|
11
12
|
},
|
|
12
13
|
slots: {
|
|
@@ -3,7 +3,7 @@ import { tv } from "tailwind-variants";
|
|
|
3
3
|
const emptyStateStyles = tv({
|
|
4
4
|
slots: {
|
|
5
5
|
base: "px-4 py-12 text-center",
|
|
6
|
-
title: "font-
|
|
6
|
+
title: "font-semibold text-neutral-900",
|
|
7
7
|
description: "mt-1 text-sm text-neutral-600",
|
|
8
8
|
action: "mt-4",
|
|
9
9
|
},
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/** The look shared by form fields, so `Input` and `Select` stay the same. */
|
|
2
2
|
export declare const fieldStyles: import("tailwind-variants").TVReturnType<{
|
|
3
3
|
invalid: {
|
|
4
|
-
true: "border-danger
|
|
5
|
-
false: "border-neutral-400
|
|
4
|
+
true: "border-danger";
|
|
5
|
+
false: "border-neutral-400";
|
|
6
6
|
};
|
|
7
|
-
}, undefined,
|
|
7
|
+
}, undefined, string[], {
|
|
8
8
|
invalid: {
|
|
9
|
-
true: "border-danger
|
|
10
|
-
false: "border-neutral-400
|
|
9
|
+
true: "border-danger";
|
|
10
|
+
false: "border-neutral-400";
|
|
11
11
|
};
|
|
12
12
|
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
13
13
|
invalid: {
|
|
14
|
-
true: "border-danger
|
|
15
|
-
false: "border-neutral-400
|
|
14
|
+
true: "border-danger";
|
|
15
|
+
false: "border-neutral-400";
|
|
16
16
|
};
|
|
17
17
|
}, undefined>>;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
|
+
import { focusRing } from "../../styles/focusRing.js";
|
|
2
3
|
/** The look shared by form fields, so `Input` and `Select` stay the same. */
|
|
3
4
|
export const fieldStyles = tv({
|
|
4
|
-
base:
|
|
5
|
+
base: [
|
|
6
|
+
"h-10 w-full rounded-sm border bg-surface px-3 text-sm text-neutral-900 placeholder:text-neutral-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
7
|
+
focusRing,
|
|
8
|
+
],
|
|
5
9
|
variants: {
|
|
6
10
|
invalid: {
|
|
7
|
-
true: "border-danger
|
|
8
|
-
false: "border-neutral-400
|
|
11
|
+
true: "border-danger",
|
|
12
|
+
false: "border-neutral-400",
|
|
9
13
|
},
|
|
10
14
|
},
|
|
11
15
|
defaultVariants: { invalid: false },
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
+
import { linkStyles } from "../../styles/linkStyles.js";
|
|
3
4
|
const paginationStyles = tv({
|
|
4
5
|
slots: {
|
|
5
6
|
base: "flex flex-wrap items-center justify-between gap-3 text-sm text-neutral-600",
|
|
6
7
|
nav: "flex items-center gap-3",
|
|
7
|
-
link:
|
|
8
|
+
link: linkStyles({ variant: "inline" }),
|
|
8
9
|
},
|
|
9
10
|
});
|
|
10
11
|
/** Links to the previous and next page, with the range shown. It needs no JavaScript. */
|
|
@@ -10,8 +10,8 @@ const productCardStyles = tv({
|
|
|
10
10
|
tag: "absolute top-2 left-2 bg-neutral-950 text-neutral-25 text-xs px-2 py-1 rounded-sm",
|
|
11
11
|
body: "p-2 flex flex-col",
|
|
12
12
|
productInfo: "flex flex-col",
|
|
13
|
-
title: "text-sm
|
|
14
|
-
titleAction: "text-left after:absolute after:inset-0 after:content-[''] focus-visible:outline-hidden focus-visible:after:ring-2 focus-visible:after:ring-primary focus-visible:after:rounded-lg",
|
|
13
|
+
title: "text-sm",
|
|
14
|
+
titleAction: "text-left after:absolute after:inset-0 after:content-[''] focus-visible:outline-hidden focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-primary focus-visible:after:rounded-lg",
|
|
15
15
|
subTitle: "text-sm text-neutral-600",
|
|
16
16
|
price: "text-sm text-neutral-600",
|
|
17
17
|
action: "relative z-10 mt-2",
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
+
import { focusRing } from "../../styles/focusRing.js";
|
|
3
4
|
import { Icon } from "../../Atoms/Icon/Icon.js";
|
|
4
5
|
const sidebarNavStyles = tv({
|
|
5
6
|
slots: {
|
|
6
7
|
base: "flex flex-col gap-4",
|
|
7
8
|
list: "flex flex-col gap-1",
|
|
8
|
-
link:
|
|
9
|
+
link: [
|
|
10
|
+
"flex items-center gap-2 rounded-sm border-l-2 px-3 py-2 text-sm font-medium text-neutral-900",
|
|
11
|
+
focusRing,
|
|
12
|
+
],
|
|
9
13
|
},
|
|
10
14
|
variants: {
|
|
11
15
|
current: {
|
|
@@ -11,6 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { tv } from "tailwind-variants";
|
|
14
|
+
import { focusRing } from "../../styles/focusRing.js";
|
|
14
15
|
import { Icon } from "../../Atoms/Icon/Icon.js";
|
|
15
16
|
const tableStyles = tv({
|
|
16
17
|
slots: {
|
|
@@ -24,7 +25,7 @@ const headerCellStyles = tv({
|
|
|
24
25
|
slots: {
|
|
25
26
|
cell: "h-10 whitespace-nowrap bg-neutral-50 px-4 font-medium",
|
|
26
27
|
label: "inline-flex items-center gap-1",
|
|
27
|
-
link: "inline-flex items-center gap-1 rounded-sm hover:text-neutral-900
|
|
28
|
+
link: ["inline-flex items-center gap-1 rounded-sm hover:text-neutral-900", focusRing],
|
|
28
29
|
},
|
|
29
30
|
variants: {
|
|
30
31
|
align: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
+
import { linkStyles } from "../../styles/linkStyles.js";
|
|
3
4
|
import { Text } from "../../Atoms/Text/Text.js";
|
|
4
5
|
import { Container } from "../../Layouts/Container/Container.js";
|
|
5
6
|
const footerStyles = tv({
|
|
@@ -10,7 +11,7 @@ const footerStyles = tv({
|
|
|
10
11
|
brand: "md:max-w-xs",
|
|
11
12
|
columns: "flex flex-wrap gap-x-12 gap-y-8",
|
|
12
13
|
list: "mt-3 flex flex-col gap-2",
|
|
13
|
-
link:
|
|
14
|
+
link: linkStyles({ variant: "nav" }),
|
|
14
15
|
legal: "border-t border-neutral-200 pt-6 text-sm text-neutral-600",
|
|
15
16
|
},
|
|
16
17
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
+
import { linkStyles } from "../../styles/linkStyles.js";
|
|
3
4
|
import { Container } from "../../Layouts/Container/Container.js";
|
|
4
5
|
const headerStyles = tv({
|
|
5
6
|
base: "w-full bg-surface shadow-sm",
|
|
@@ -9,7 +10,7 @@ const headerStyles = tv({
|
|
|
9
10
|
actions: "order-2 ml-auto flex items-center gap-2 md:order-3",
|
|
10
11
|
nav: "order-3 w-full md:order-2 md:w-auto md:flex-1",
|
|
11
12
|
list: "flex flex-wrap items-center gap-x-4 gap-y-1",
|
|
12
|
-
link:
|
|
13
|
+
link: linkStyles({ variant: "nav" }),
|
|
13
14
|
},
|
|
14
15
|
});
|
|
15
16
|
/**
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The keyboard focus style of every interactive component, as complete class names so Tailwind
|
|
3
|
+
* finds them. Not exported from `src/index.js`. An element whose ring would be clipped paints an
|
|
4
|
+
* equivalent instead: an inset ring (see ProductCard).
|
|
5
|
+
*/
|
|
6
|
+
export declare const focusRing = "focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The keyboard focus style of every interactive component, as complete class names so Tailwind
|
|
3
|
+
* finds them. Not exported from `src/index.js`. An element whose ring would be clipped paints an
|
|
4
|
+
* equivalent instead: an inset ring (see ProductCard).
|
|
5
|
+
*/
|
|
6
|
+
export const focusRing = "focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const linkStyles: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
variant: {
|
|
3
|
+
inline: "text-neutral-900 underline decoration-neutral-400 underline-offset-2 hover:decoration-neutral-900";
|
|
4
|
+
nav: "text-sm text-neutral-600 underline-offset-4 hover:text-neutral-900 hover:underline";
|
|
5
|
+
};
|
|
6
|
+
}, undefined, string[], {
|
|
7
|
+
variant: {
|
|
8
|
+
inline: "text-neutral-900 underline decoration-neutral-400 underline-offset-2 hover:decoration-neutral-900";
|
|
9
|
+
nav: "text-sm text-neutral-600 underline-offset-4 hover:text-neutral-900 hover:underline";
|
|
10
|
+
};
|
|
11
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
12
|
+
variant: {
|
|
13
|
+
inline: "text-neutral-900 underline decoration-neutral-400 underline-offset-2 hover:decoration-neutral-900";
|
|
14
|
+
nav: "text-sm text-neutral-600 underline-offset-4 hover:text-neutral-900 hover:underline";
|
|
15
|
+
};
|
|
16
|
+
}, undefined>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
import { focusRing } from "./focusRing.js";
|
|
3
|
+
// Not exported from `src/index.js`. `inline` is always underlined, so a link in content reads as a
|
|
4
|
+
// link without hover. `nav` is for lists of links, where the position already says so.
|
|
5
|
+
export const linkStyles = tv({
|
|
6
|
+
base: ["rounded-sm", focusRing],
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
inline: "text-neutral-900 underline decoration-neutral-400 underline-offset-2 hover:decoration-neutral-900",
|
|
10
|
+
nav: "text-sm text-neutral-600 underline-offset-4 hover:text-neutral-900 hover:underline",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: { variant: "inline" },
|
|
14
|
+
});
|
package/dist/styles/theme.css
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
--color-primary-lighter: light-dark(#0077cc, #4d94dc);
|
|
54
54
|
--color-primary-darker: light-dark(#003366, #96c9f6);
|
|
55
55
|
|
|
56
|
+
/* Deprecated: the old orange ramp, no longer used by any component. Removed in 5.0.0. */
|
|
56
57
|
--color-secondary-50: light-dark(#fff7ed, #1e1a14);
|
|
57
58
|
--color-secondary-100: light-dark(#ffedd5, #272117);
|
|
58
59
|
--color-secondary-200: light-dark(#fed7aa, #382b1d);
|
|
@@ -60,16 +61,18 @@
|
|
|
60
61
|
--color-secondary-400: light-dark(#fb923c, #6f4627);
|
|
61
62
|
--color-secondary-500: light-dark(#f97316, #924920);
|
|
62
63
|
--color-secondary-600: light-dark(#ea580c, #bf4401);
|
|
63
|
-
--color-secondary-700: light-dark(
|
|
64
|
-
|
|
65
|
-
#d9653e
|
|
66
|
-
); /* same as DEFAULT; 5.2:1 with white, lightest step usable for text */
|
|
67
|
-
--color-secondary-800: light-dark(#9a3412, #ec886b); /* same as darker */
|
|
64
|
+
--color-secondary-700: light-dark(#c2410c, #d9653e);
|
|
65
|
+
--color-secondary-800: light-dark(#9a3412, #ec886b);
|
|
68
66
|
--color-secondary-900: light-dark(#7c2d12, #f7a58b);
|
|
69
67
|
--color-secondary-950: light-dark(#431407, #fee7e1);
|
|
70
|
-
--color-secondary:
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
--color-secondary-lighter: #f28b2d;
|
|
69
|
+
|
|
70
|
+
/*
|
|
71
|
+
`secondary` is neutral, so it sits beside any brand. An app that wants a second color sets these
|
|
72
|
+
two variables in its own stylesheet, as it does for `primary`.
|
|
73
|
+
*/
|
|
74
|
+
--color-secondary: light-dark(rgb(61 61 61), rgb(212 212 212));
|
|
75
|
+
--color-secondary-darker: light-dark(rgb(48 48 48), rgb(232 232 232));
|
|
73
76
|
|
|
74
77
|
/*
|
|
75
78
|
Semantic colors: the plain name is for text and icons on white or on `subtle` (all 4.5:1 or
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nicolassancho/storybook-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.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",
|