@nicolassancho/storybook-core 4.9.0 → 4.10.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 CHANGED
@@ -33,12 +33,12 @@ documented in Storybook. It is published to npm as `@nicolassancho/storybook-cor
33
33
 
34
34
  ## Components
35
35
 
36
- | Layer | Components |
37
- | --------- | ----------------------------------------------------------------------------------- |
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
- | Organisms | Footer, Header, ProductGrid |
41
- | Layouts | Container, Grid |
36
+ | Layer | Components |
37
+ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
38
+ | Atoms | Badge, Button, ButtonLink, Card, Chip, ChipLink, Icon, Image, Label, RadioButton, SearchInput (deprecated), Spinner, TableSkeleton, Text, TextLink |
39
+ | Molecules | Alert, Breadcrumbs, CartIcon, EmptyState, Input, Pagination, Popover, ProductCard, ProductDetails, RadioGroup, Select, SidebarNav, Table |
40
+ | Organisms | Footer, Header, ProductGrid |
41
+ | Layouts | Container, Grid |
42
42
 
43
43
  The palette and the contrast of each text color are documented under **Foundations / Colors** in
44
44
  Storybook.
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ export interface TextLinkProps {
3
+ /** Where the link goes, for example `/products/42`. It needs no JavaScript. */
4
+ href: string;
5
+ /** Link contents */
6
+ children: React.ReactNode;
7
+ /**
8
+ * Component used to render the link. Receives `href`, `className` and `children`, so a
9
+ * framework link (e.g. `next/link`) can be passed directly. Defaults to a plain `<a>`. Define it
10
+ * outside the render function: an inline definition remounts the link.
11
+ */
12
+ LinkComponent?: React.ElementType<{
13
+ href: string;
14
+ children: React.ReactNode;
15
+ className?: string;
16
+ }>;
17
+ /**
18
+ * Additional classes for custom styling
19
+ */
20
+ className?: string;
21
+ }
22
+ /**
23
+ * A link in content, such as a sentence or a table cell. It is always underlined, so it reads as a
24
+ * link without hover. For a call to action, use `ButtonLink`.
25
+ */
26
+ export declare const TextLink: React.FC<TextLinkProps>;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { linkStyles } from "../../styles/linkStyles.js";
3
+ /**
4
+ * A link in content, such as a sentence or a table cell. It is always underlined, so it reads as a
5
+ * link without hover. For a call to action, use `ButtonLink`.
6
+ */
7
+ export const TextLink = ({ href, children, LinkComponent = "a", className, }) => (_jsx(LinkComponent, { href: href, className: linkStyles({ variant: "inline", className }), children: children }));
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from "./components/Atoms/ChipLink/ChipLink.js";
7
7
  export * from "./components/Atoms/Spinner/Spinner.js";
8
8
  export * from "./components/Atoms/TableSkeleton/TableSkeleton.js";
9
9
  export * from "./components/Atoms/Text/Text.js";
10
+ export * from "./components/Atoms/TextLink/TextLink.js";
10
11
  export * from "./components/Atoms/Icon/Icon.js";
11
12
  export * from "./components/Atoms/Image/Image.js";
12
13
  export * from "./components/Atoms/Label/Label.js";
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ export * from "./components/Atoms/ChipLink/ChipLink.js";
8
8
  export * from "./components/Atoms/Spinner/Spinner.js";
9
9
  export * from "./components/Atoms/TableSkeleton/TableSkeleton.js";
10
10
  export * from "./components/Atoms/Text/Text.js";
11
+ export * from "./components/Atoms/TextLink/TextLink.js";
11
12
  export * from "./components/Atoms/Icon/Icon.js";
12
13
  export * from "./components/Atoms/Image/Image.js";
13
14
  export * from "./components/Atoms/Label/Label.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nicolassancho/storybook-core",
3
- "version": "4.9.0",
3
+ "version": "4.10.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",