@nicolassancho/storybook-core 4.7.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.
Files changed (38) hide show
  1. package/README.md +2 -2
  2. package/dist/components/Atoms/Badge/Badge.d.ts +11 -0
  3. package/dist/components/Atoms/Badge/Badge.js +14 -0
  4. package/dist/components/Atoms/Button/Button.d.ts +3 -2
  5. package/dist/components/Atoms/Button/buttonStyles.d.ts +13 -13
  6. package/dist/components/Atoms/Button/buttonStyles.js +6 -5
  7. package/dist/components/Atoms/ButtonLink/ButtonLink.d.ts +3 -2
  8. package/dist/components/Atoms/Chip/chipStyles.d.ts +1 -1
  9. package/dist/components/Atoms/Chip/chipStyles.js +5 -1
  10. package/dist/components/Atoms/RadioButton/RadioButton.js +2 -1
  11. package/dist/components/Atoms/SearchInput/SearchInput.js +10 -6
  12. package/dist/components/Atoms/TableSkeleton/TableSkeleton.d.ts +13 -0
  13. package/dist/components/Atoms/TableSkeleton/TableSkeleton.js +16 -0
  14. package/dist/components/Molecules/Breadcrumbs/Breadcrumbs.js +4 -4
  15. package/dist/components/Molecules/CartIcon/CartIcon.js +2 -1
  16. package/dist/components/Molecules/EmptyState/EmptyState.d.ts +13 -0
  17. package/dist/components/Molecules/EmptyState/EmptyState.js +15 -0
  18. package/dist/components/Molecules/Input/Input.js +3 -10
  19. package/dist/components/Molecules/Input/fieldStyles.d.ts +17 -0
  20. package/dist/components/Molecules/Input/fieldStyles.js +16 -0
  21. package/dist/components/Molecules/Pagination/Pagination.d.ts +33 -0
  22. package/dist/components/Molecules/Pagination/Pagination.js +18 -0
  23. package/dist/components/Molecules/ProductCard/ProductCard.js +2 -2
  24. package/dist/components/Molecules/Select/Select.d.ts +29 -0
  25. package/dist/components/Molecules/Select/Select.js +24 -0
  26. package/dist/components/Molecules/SidebarNav/SidebarNav.js +5 -1
  27. package/dist/components/Molecules/Table/Table.d.ts +64 -0
  28. package/dist/components/Molecules/Table/Table.js +82 -0
  29. package/dist/components/Organisms/Footer/Footer.js +2 -1
  30. package/dist/components/Organisms/Header/Header.js +2 -1
  31. package/dist/components/styles/focusRing.d.ts +6 -0
  32. package/dist/components/styles/focusRing.js +6 -0
  33. package/dist/components/styles/linkStyles.d.ts +16 -0
  34. package/dist/components/styles/linkStyles.js +14 -0
  35. package/dist/index.d.ts +6 -0
  36. package/dist/index.js +6 -0
  37. package/dist/styles/theme.css +11 -8
  38. 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, Card, Chip, ChipLink, Icon, Image, Label, RadioButton, SearchInput (deprecated), Spinner, Text |
39
- | Molecules | Alert, Breadcrumbs, CartIcon, Input, Popover, ProductCard, ProductDetails, RadioGroup, SidebarNav |
38
+ | Atoms | Badge, Button, ButtonLink, Card, Chip, ChipLink, Icon, Image, Label, RadioButton, SearchInput (deprecated), Spinner, TableSkeleton, Text |
39
+ | Molecules | Alert, Breadcrumbs, CartIcon, EmptyState, Input, Pagination, Popover, ProductCard, ProductDetails, RadioGroup, Select, SidebarNav, Table |
40
40
  | Organisms | Footer, Header, ProductGrid |
41
41
  | Layouts | Container, Grid |
42
42
 
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ export interface BadgeProps {
3
+ /** The text. It is always visible, so meaning never depends on color alone. */
4
+ children: React.ReactNode;
5
+ /** `success` for a good state, such as Active. `neutral` for everything else. */
6
+ variant?: "neutral" | "success";
7
+ /** Additional classes for custom styling */
8
+ className?: string;
9
+ }
10
+ /** A small label for a status. */
11
+ export declare const Badge: React.FC<BadgeProps>;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { tv } from "tailwind-variants";
3
+ const badgeStyles = tv({
4
+ base: "inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium",
5
+ variants: {
6
+ variant: {
7
+ neutral: "border border-neutral-200 bg-neutral-50 text-neutral-700",
8
+ success: "bg-success-subtle text-success",
9
+ },
10
+ },
11
+ defaultVariants: { variant: "neutral" },
12
+ });
13
+ /** A small label for a status. */
14
+ export const Badge = ({ children, variant, className }) => (_jsx("span", { className: badgeStyles({ variant, className }), children: children }));
@@ -1,7 +1,8 @@
1
1
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
2
2
  /**
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.
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 focus-visible:ring-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-xs px-2 py-1";
10
- medium: "gap-2 text-sm px-4 py-2";
11
- large: "gap-3 text-lg px-6 py-3";
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, "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
+ }, undefined, string[], {
21
21
  variant: {
22
22
  primary: "rounded-sm bg-primary text-on-primary";
23
- secondary: "rounded-sm bg-secondary text-on-secondary focus-visible:ring-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-xs px-2 py-1";
29
- medium: "gap-2 text-sm px-4 py-2";
30
- large: "gap-3 text-lg px-6 py-3";
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 focus-visible:ring-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-xs px-2 py-1";
48
- medium: "gap-2 text-sm px-4 py-2";
49
- large: "gap-3 text-lg px-6 py-3";
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-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",
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 focus-visible:ring-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-xs px-2 py-1",
16
- medium: "gap-2 text-sm px-4 py-2",
17
- large: "gap-3 text-lg px-6 py-3",
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 a neutral bordered button for secondary actions: it does
9
- * not follow the brand colors, so it looks the same under any theme.
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, "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", {
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: "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
+ 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: "text-primary",
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: "w-full rounded-sm bg-surface px-3 py-2 text-sm text-neutral-900 placeholder:text-neutral-500 focus:outline-hidden focus:ring-2 transition-colors",
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: "text-xs py-1 px-2",
19
- medium: "text-sm py-2 px-3",
20
- large: "text-base py-3 px-4",
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 focus:border-danger focus:ring-danger",
24
- false: "border border-neutral-400 focus:border-primary focus:ring-primary",
27
+ true: "border border-danger",
28
+ false: "border border-neutral-400",
25
29
  },
26
30
  },
27
31
  defaultVariants: {
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ export interface TableSkeletonProps {
3
+ /** Text for screen readers while the content loads, for example "Loading products". */
4
+ label: string;
5
+ /** Rows under the header row. */
6
+ rows?: number;
7
+ /** Bars in each row. */
8
+ columns?: number;
9
+ /** Additional classes for custom styling */
10
+ className?: string;
11
+ }
12
+ /** A placeholder for tabular content on first load. The bars are hidden from screen readers. */
13
+ export declare const TableSkeleton: React.FC<TableSkeletonProps>;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { tv } from "tailwind-variants";
3
+ const tableSkeletonStyles = tv({
4
+ slots: {
5
+ bars: "animate-pulse motion-reduce:animate-none",
6
+ row: "flex h-10 items-center gap-6 border-b border-neutral-200 px-4 last:border-b-0",
7
+ header: "bg-neutral-50",
8
+ bar: "h-3 flex-1 rounded-sm bg-neutral-200",
9
+ },
10
+ });
11
+ /** A placeholder for tabular content on first load. The bars are hidden from screen readers. */
12
+ export const TableSkeleton = ({ label, rows = 6, columns = 3, className, }) => {
13
+ const styles = tableSkeletonStyles();
14
+ const bars = Array.from({ length: columns }, (_, column) => (_jsx("span", { className: styles.bar() }, column)));
15
+ return (_jsxs("div", { className: className, children: [_jsx("p", { role: "status", className: "sr-only", children: label }), _jsxs("div", { "aria-hidden": "true", className: styles.bars(), children: [_jsx("div", { className: styles.row({ className: styles.header() }), children: bars }), Array.from({ length: rows }, (_, row) => (_jsx("div", { className: styles.row(), children: bars }, row)))] })] }));
16
+ };
@@ -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: "no-underline text-inherit hover:underline text-primary",
11
- current: "text-neutral-600",
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", color: "primary" }), _jsx("span", { className: "sr-only", children: label })] })) : isLast ? (label) : (_jsx(Text, { as: "span", size: "small", color: "primary", children: label }));
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 focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface",
10
+ true: ["cursor-pointer rounded-sm", focusRing],
10
11
  },
11
12
  },
12
13
  slots: {
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ export interface EmptyStateProps {
3
+ /** What is empty, for example "No products yet." */
4
+ title: string;
5
+ /** What to do next. */
6
+ description?: string;
7
+ /** Slot under the text, usually a `ButtonLink`. */
8
+ action?: React.ReactNode;
9
+ /** Additional classes for custom styling */
10
+ className?: string;
11
+ }
12
+ /** The message shown in place of a list that has nothing to show. */
13
+ export declare const EmptyState: React.FC<EmptyStateProps>;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { tv } from "tailwind-variants";
3
+ const emptyStateStyles = tv({
4
+ slots: {
5
+ base: "px-4 py-12 text-center",
6
+ title: "font-semibold text-neutral-900",
7
+ description: "mt-1 text-sm text-neutral-600",
8
+ action: "mt-4",
9
+ },
10
+ });
11
+ /** The message shown in place of a list that has nothing to show. */
12
+ export const EmptyState = ({ title, description, action, className, }) => {
13
+ const styles = emptyStateStyles();
14
+ return (_jsxs("div", { className: styles.base({ className }), children: [_jsx("p", { className: styles.title(), children: title }), description && _jsx("p", { className: styles.description(), children: description }), action && _jsx("div", { className: styles.action(), children: action })] }));
15
+ };
@@ -13,20 +13,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { useId } from "react";
14
14
  import { tv } from "tailwind-variants";
15
15
  import { Label } from "../../Atoms/Label/Label.js";
16
+ import { fieldStyles } from "./fieldStyles.js";
16
17
  const inputStyles = tv({
17
18
  slots: {
18
19
  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
20
  description: "text-sm text-neutral-500",
21
21
  error: "text-sm text-danger",
22
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
23
  });
31
24
  /**
32
25
  * A text field with its label, optional help text and optional error message. It needs no
@@ -40,6 +33,6 @@ export const Input = (_a) => {
40
33
  const descriptionId = `${inputId}-description`;
41
34
  const errorId = `${inputId}-error`;
42
35
  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 }))] }));
36
+ const styles = inputStyles();
37
+ 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: fieldStyles({ invalid: Boolean(error), className }) })), description && (_jsx("p", { id: descriptionId, className: styles.description(), children: description })), error && (_jsx("p", { id: errorId, className: styles.error(), children: error }))] }));
45
38
  };
@@ -0,0 +1,17 @@
1
+ /** The look shared by form fields, so `Input` and `Select` stay the same. */
2
+ export declare const fieldStyles: import("tailwind-variants").TVReturnType<{
3
+ invalid: {
4
+ true: "border-danger";
5
+ false: "border-neutral-400";
6
+ };
7
+ }, undefined, string[], {
8
+ invalid: {
9
+ true: "border-danger";
10
+ false: "border-neutral-400";
11
+ };
12
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
13
+ invalid: {
14
+ true: "border-danger";
15
+ false: "border-neutral-400";
16
+ };
17
+ }, undefined>>;
@@ -0,0 +1,16 @@
1
+ import { tv } from "tailwind-variants";
2
+ import { focusRing } from "../../styles/focusRing.js";
3
+ /** The look shared by form fields, so `Input` and `Select` stay the same. */
4
+ export const fieldStyles = tv({
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
+ ],
9
+ variants: {
10
+ invalid: {
11
+ true: "border-danger",
12
+ false: "border-neutral-400",
13
+ },
14
+ },
15
+ defaultVariants: { invalid: false },
16
+ });
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+ export interface PaginationProps {
3
+ /**
4
+ * Current page, from 1 to the last page. The app handles a page outside that range and shows an
5
+ * empty state instead of this component when there are no items.
6
+ */
7
+ page: number;
8
+ /** Number of items across all pages. */
9
+ totalItems: number;
10
+ /** Items per page. */
11
+ pageSize: number;
12
+ /**
13
+ * URL of the previous page. Without it the link is left out, as on the first page. Plain strings
14
+ * rather than a function, so a Server Component can pass them through a client component.
15
+ */
16
+ previousHref?: string;
17
+ /** URL of the next page. Without it the link is left out, as on the last page. */
18
+ nextHref?: string;
19
+ /**
20
+ * Component used to render the links. Receives `href`, `className` and `children`, so a
21
+ * framework link (e.g. `next/link`) can be passed directly. Defaults to a plain `<a>`. Define it
22
+ * outside the render function: an inline definition remounts the link.
23
+ */
24
+ LinkComponent?: React.ElementType<{
25
+ href: string;
26
+ children: React.ReactNode;
27
+ className?: string;
28
+ }>;
29
+ /** Additional classes for custom styling */
30
+ className?: string;
31
+ }
32
+ /** Links to the previous and next page, with the range shown. It needs no JavaScript. */
33
+ export declare const Pagination: React.FC<PaginationProps>;
@@ -0,0 +1,18 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { tv } from "tailwind-variants";
3
+ import { linkStyles } from "../../styles/linkStyles.js";
4
+ const paginationStyles = tv({
5
+ slots: {
6
+ base: "flex flex-wrap items-center justify-between gap-3 text-sm text-neutral-600",
7
+ nav: "flex items-center gap-3",
8
+ link: linkStyles({ variant: "inline" }),
9
+ },
10
+ });
11
+ /** Links to the previous and next page, with the range shown. It needs no JavaScript. */
12
+ export const Pagination = ({ page, totalItems, pageSize, previousHref, nextHref, LinkComponent = "a", className, }) => {
13
+ const styles = paginationStyles();
14
+ const first = (page - 1) * pageSize + 1;
15
+ const last = Math.min(page * pageSize, totalItems);
16
+ const totalPages = Math.ceil(totalItems / pageSize);
17
+ return (_jsxs("div", { className: styles.base({ className }), children: [_jsxs("p", { children: [first, "\u2013", last, " of ", totalItems] }), (previousHref || nextHref) && (_jsxs("nav", { "aria-label": "Pagination", className: styles.nav(), children: [previousHref && (_jsxs(LinkComponent, { href: previousHref, className: styles.link(), children: ["Previous", _jsx("span", { className: "sr-only", children: " page" })] })), _jsxs("span", { children: ["Page ", page, " of ", totalPages] }), nextHref && (_jsxs(LinkComponent, { href: nextHref, className: styles.link(), children: ["Next", _jsx("span", { className: "sr-only", children: " page" })] }))] }))] }));
18
+ };
@@ -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 font-medium",
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",
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ export interface SelectOption {
3
+ value: string;
4
+ label: string;
5
+ }
6
+ export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "children" | "multiple" | "size"> {
7
+ /** The field's name, always rendered as a real `<label>`. */
8
+ label: string;
9
+ /** Hides the label visually (`sr-only`) and keeps it for screen readers. */
10
+ hideLabel?: boolean;
11
+ /** The choices, in display order. */
12
+ options: SelectOption[];
13
+ /** Name submitted with a native `<form>`. */
14
+ name?: string;
15
+ /**
16
+ * Current value. Setting it makes the select controlled: pair it with `onChange`. Leave it out
17
+ * for an uncontrolled select (set the initial choice with `defaultValue`), which a native
18
+ * `<form>` can submit without any handler.
19
+ */
20
+ value?: string;
21
+ /** Initial choice of an uncontrolled select. */
22
+ defaultValue?: string;
23
+ /** Called when the choice changes. Optional, so the select renders from a Server Component. */
24
+ onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void;
25
+ /** Additional classes for the `<select>` element */
26
+ className?: string;
27
+ }
28
+ /** A native `<select>` with its label, styled like `Input`. It needs no JavaScript of its own. */
29
+ export declare const Select: React.FC<SelectProps>;
@@ -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, 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
+ import { fieldStyles } from "../Input/fieldStyles.js";
17
+ const selectStyles = tv({ base: "flex flex-col gap-1" });
18
+ /** A native `<select>` with its label, styled like `Input`. It needs no JavaScript of its own. */
19
+ export const Select = (_a) => {
20
+ var { label, hideLabel = false, options, id, className } = _a, props = __rest(_a, ["label", "hideLabel", "options", "id", "className"]);
21
+ const generatedId = useId();
22
+ const selectId = id !== null && id !== void 0 ? id : generatedId;
23
+ return (_jsxs("div", { className: selectStyles(), children: [_jsx(Label, { htmlFor: selectId, color: "darker", className: hideLabel ? "sr-only" : undefined, children: label }), _jsx("select", Object.assign({}, props, { id: selectId, className: fieldStyles({ className }), children: options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value))) }))] }));
24
+ };
@@ -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: "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
+ 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: {
@@ -0,0 +1,64 @@
1
+ import React from "react";
2
+ export interface TableProps {
3
+ /** Accessible name of the scroll region, for example "Products table". */
4
+ label: string;
5
+ /**
6
+ * The table's name, hidden visually. Say how the rows are ordered and which columns sort, because
7
+ * a screen reader announces `aria-sort` only on the sorted column.
8
+ */
9
+ caption: string;
10
+ /** `TableHead` and `TableBody`. */
11
+ children: React.ReactNode;
12
+ /** Additional classes for the `<table>` element */
13
+ className?: string;
14
+ }
15
+ export interface TableSectionProps {
16
+ /** `TableRow` elements. */
17
+ children: React.ReactNode;
18
+ }
19
+ export type TableRowProps = React.HTMLAttributes<HTMLTableRowElement>;
20
+ export interface TableHeaderCellProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
21
+ /** Column name. */
22
+ children: React.ReactNode;
23
+ /** Where the header link goes. Setting it makes the column sortable. */
24
+ href?: string;
25
+ /** Set on the sorted column only. It sets `aria-sort` and shows the direction. */
26
+ sort?: "ascending" | "descending";
27
+ /** Text alignment. Use `right` for numbers. */
28
+ align?: "left" | "right";
29
+ /**
30
+ * Component used to render the header link. Receives `href`, `className` and `children`, so a
31
+ * framework link (e.g. `next/link`) can be passed directly. Defaults to a plain `<a>`. Define it
32
+ * outside the render function: an inline definition remounts the link.
33
+ */
34
+ LinkComponent?: React.ElementType<{
35
+ href: string;
36
+ children: React.ReactNode;
37
+ className?: string;
38
+ }>;
39
+ /** Additional classes for custom styling */
40
+ className?: string;
41
+ }
42
+ export interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
43
+ /** Text alignment. `right` also lines digits up, for numbers. */
44
+ align?: "left" | "right";
45
+ }
46
+ /**
47
+ * A data table in a labelled scroll region that the keyboard can reach. Build it from `TableHead`,
48
+ * `TableBody`, `TableRow`, `TableHeaderCell` and `TableCell`. Set a minimum width with `className`
49
+ * when the columns need one: below it the table scrolls.
50
+ */
51
+ export declare const Table: React.FC<TableProps>;
52
+ /** The header section of a `Table`. */
53
+ export declare const TableHead: React.FC<TableSectionProps>;
54
+ /** The body section of a `Table`. */
55
+ export declare const TableBody: React.FC<TableSectionProps>;
56
+ /** A row of a `Table`. */
57
+ export declare const TableRow: React.FC<TableRowProps>;
58
+ /**
59
+ * A column header. With `href` it is a sort link, which needs no JavaScript: the app works out the
60
+ * URL and passes `sort` on the sorted column.
61
+ */
62
+ export declare const TableHeaderCell: React.FC<TableHeaderCellProps>;
63
+ /** A data cell of a `Table`. */
64
+ export declare const TableCell: React.FC<TableCellProps>;
@@ -0,0 +1,82 @@
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 { tv } from "tailwind-variants";
14
+ import { focusRing } from "../../styles/focusRing.js";
15
+ import { Icon } from "../../Atoms/Icon/Icon.js";
16
+ const tableStyles = tv({
17
+ slots: {
18
+ region: "overflow-x-auto focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary",
19
+ table: "w-full text-sm",
20
+ },
21
+ });
22
+ const headStyles = tv({ base: "border-b border-neutral-200 text-left text-neutral-700" });
23
+ const rowStyles = tv({ base: "h-10 border-b border-neutral-200 last:border-b-0" });
24
+ const headerCellStyles = tv({
25
+ slots: {
26
+ cell: "h-10 whitespace-nowrap bg-neutral-50 px-4 font-medium",
27
+ label: "inline-flex items-center gap-1",
28
+ link: ["inline-flex items-center gap-1 rounded-sm hover:text-neutral-900", focusRing],
29
+ },
30
+ variants: {
31
+ align: {
32
+ left: { cell: "text-left" },
33
+ right: { cell: "text-right" },
34
+ },
35
+ },
36
+ defaultVariants: { align: "left" },
37
+ });
38
+ const cellStyles = tv({
39
+ base: "whitespace-nowrap px-4 text-neutral-900",
40
+ variants: {
41
+ align: {
42
+ left: "text-left",
43
+ right: "text-right tabular-nums",
44
+ },
45
+ },
46
+ defaultVariants: { align: "left" },
47
+ });
48
+ /** Up and down chevrons: the column can sort but is not sorted now. */
49
+ const SortableIcon = () => (_jsxs("svg", { "aria-hidden": "true", focusable: "false", className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M8 9l4-4 4 4" }), _jsx("path", { d: "M16 15l-4 4-4-4" })] }));
50
+ /**
51
+ * A data table in a labelled scroll region that the keyboard can reach. Build it from `TableHead`,
52
+ * `TableBody`, `TableRow`, `TableHeaderCell` and `TableCell`. Set a minimum width with `className`
53
+ * when the columns need one: below it the table scrolls.
54
+ */
55
+ export const Table = ({ label, caption, children, className }) => {
56
+ const styles = tableStyles();
57
+ return (_jsx("div", { role: "region", "aria-label": label, tabIndex: 0, className: styles.region(), children: _jsxs("table", { className: styles.table({ className }), children: [_jsx("caption", { className: "sr-only", children: caption }), children] }) }));
58
+ };
59
+ /** The header section of a `Table`. */
60
+ export const TableHead = ({ children }) => (_jsx("thead", { className: headStyles(), children: children }));
61
+ /** The body section of a `Table`. */
62
+ export const TableBody = ({ children }) => _jsx("tbody", { children: children });
63
+ /** A row of a `Table`. */
64
+ export const TableRow = (_a) => {
65
+ var { className } = _a, props = __rest(_a, ["className"]);
66
+ return (_jsx("tr", Object.assign({}, props, { className: rowStyles({ className }) })));
67
+ };
68
+ /**
69
+ * A column header. With `href` it is a sort link, which needs no JavaScript: the app works out the
70
+ * URL and passes `sort` on the sorted column.
71
+ */
72
+ export const TableHeaderCell = (_a) => {
73
+ var { children, href, sort, align, LinkComponent = "a", className, scope = "col" } = _a, props = __rest(_a, ["children", "href", "sort", "align", "LinkComponent", "className", "scope"]);
74
+ const styles = headerCellStyles({ align });
75
+ const sortIcon = sort && (_jsx("span", { className: sort === "ascending" ? "rotate-180" : undefined, children: _jsx(Icon, { name: "ArrowDown", size: "small" }) }));
76
+ return (_jsx("th", Object.assign({}, props, { scope: scope, "aria-sort": sort, className: styles.cell({ className }), children: href ? (_jsxs(LinkComponent, { href: href, className: styles.link(), children: [children, sortIcon !== null && sortIcon !== void 0 ? sortIcon : _jsx(SortableIcon, {})] })) : (_jsxs("span", { className: styles.label(), children: [children, sortIcon] })) })));
77
+ };
78
+ /** A data cell of a `Table`. */
79
+ export const TableCell = (_a) => {
80
+ var { align, className } = _a, props = __rest(_a, ["align", "className"]);
81
+ return (_jsx("td", Object.assign({}, props, { className: cellStyles({ align, className }) })));
82
+ };
@@ -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: "rounded-sm text-sm text-neutral-600 underline-offset-4 hover:text-neutral-900 hover:underline focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface",
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: "rounded-sm text-sm text-neutral-600 underline-offset-4 hover:text-neutral-900 hover:underline focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-surface",
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/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
+ export * from "./components/Atoms/Badge/Badge.js";
1
2
  export * from "./components/Atoms/Button/Button.js";
2
3
  export * from "./components/Atoms/ButtonLink/ButtonLink.js";
3
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";
8
+ export * from "./components/Atoms/TableSkeleton/TableSkeleton.js";
7
9
  export * from "./components/Atoms/Text/Text.js";
8
10
  export * from "./components/Atoms/Icon/Icon.js";
9
11
  export * from "./components/Atoms/Image/Image.js";
@@ -15,12 +17,16 @@ export * from "./components/Layouts/Grid/Grid.js";
15
17
  export * from "./components/Molecules/Alert/Alert.js";
16
18
  export * from "./components/Molecules/Breadcrumbs/Breadcrumbs.js";
17
19
  export * from "./components/Molecules/CartIcon/CartIcon.js";
20
+ export * from "./components/Molecules/EmptyState/EmptyState.js";
18
21
  export * from "./components/Molecules/Input/Input.js";
22
+ export * from "./components/Molecules/Pagination/Pagination.js";
19
23
  export * from "./components/Molecules/Popover/Popover.js";
20
24
  export * from "./components/Molecules/ProductCard/ProductCard.js";
21
25
  export * from "./components/Molecules/ProductDetails/ProductDetails.js";
22
26
  export * from "./components/Molecules/RadioGroup/RadioGroup.js";
27
+ export * from "./components/Molecules/Select/Select.js";
23
28
  export * from "./components/Molecules/SidebarNav/SidebarNav.js";
29
+ export * from "./components/Molecules/Table/Table.js";
24
30
  export * from "./components/Organisms/Footer/Footer.js";
25
31
  export * from "./components/Organisms/Header/Header.js";
26
32
  export * from "./components/Organisms/ProductGrid/ProductGrid.js";
package/dist/index.js CHANGED
@@ -1,10 +1,12 @@
1
1
  // Atoms
2
+ export * from "./components/Atoms/Badge/Badge.js";
2
3
  export * from "./components/Atoms/Button/Button.js";
3
4
  export * from "./components/Atoms/ButtonLink/ButtonLink.js";
4
5
  export * from "./components/Atoms/Card/Card.js";
5
6
  export * from "./components/Atoms/Chip/Chip.js";
6
7
  export * from "./components/Atoms/ChipLink/ChipLink.js";
7
8
  export * from "./components/Atoms/Spinner/Spinner.js";
9
+ export * from "./components/Atoms/TableSkeleton/TableSkeleton.js";
8
10
  export * from "./components/Atoms/Text/Text.js";
9
11
  export * from "./components/Atoms/Icon/Icon.js";
10
12
  export * from "./components/Atoms/Image/Image.js";
@@ -18,12 +20,16 @@ export * from "./components/Layouts/Grid/Grid.js";
18
20
  export * from "./components/Molecules/Alert/Alert.js";
19
21
  export * from "./components/Molecules/Breadcrumbs/Breadcrumbs.js";
20
22
  export * from "./components/Molecules/CartIcon/CartIcon.js";
23
+ export * from "./components/Molecules/EmptyState/EmptyState.js";
21
24
  export * from "./components/Molecules/Input/Input.js";
25
+ export * from "./components/Molecules/Pagination/Pagination.js";
22
26
  export * from "./components/Molecules/Popover/Popover.js";
23
27
  export * from "./components/Molecules/ProductCard/ProductCard.js";
24
28
  export * from "./components/Molecules/ProductDetails/ProductDetails.js";
25
29
  export * from "./components/Molecules/RadioGroup/RadioGroup.js";
30
+ export * from "./components/Molecules/Select/Select.js";
26
31
  export * from "./components/Molecules/SidebarNav/SidebarNav.js";
32
+ export * from "./components/Molecules/Table/Table.js";
27
33
  // Organisms
28
34
  export * from "./components/Organisms/Footer/Footer.js";
29
35
  export * from "./components/Organisms/Header/Header.js";
@@ -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
- #c2410c,
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: light-dark(#c2410c, #d9653e); /* 5.2:1 with white (WCAG AA) */
71
- --color-secondary-lighter: #f28b2d; /* original brand orange: decorative use only, fails AA with white */
72
- --color-secondary-darker: light-dark(#9a3412, #ec886b); /* 7.3:1 with white */
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.7.0",
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",