@telegraph/link 0.1.1
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/CHANGELOG.md +7 -0
- package/README.md +96 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/css/default.css +1 -0
- package/dist/esm/index.mjs +111 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/types/Link/Link.constants.d.ts +19 -0
- package/dist/types/Link/Link.constants.d.ts.map +1 -0
- package/dist/types/Link/Link.d.ts +33 -0
- package/dist/types/Link/Link.d.ts.map +1 -0
- package/dist/types/Link/index.d.ts +3 -0
- package/dist/types/Link/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +58 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @telegraph/link
|
|
2
|
+
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#698](https://github.com/knocklabs/telegraph/pull/698) [`c2e8391`](https://github.com/knocklabs/telegraph/commit/c2e8391342a372b2bc6aa5e29a6c86f816491401) Thanks [@kylemcd](https://github.com/kylemcd)! - feat: first version of the link component
|
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# 🔗 Link
|
|
2
|
+
|
|
3
|
+
> Polymorphic link component with Telegraph typography, color, and icon options.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@telegraph/link)
|
|
8
|
+
[](https://bundlephobia.com/result?p=@telegraph/link)
|
|
9
|
+
[](https://github.com/knocklabs/telegraph/blob/main/LICENSE)
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @telegraph/link
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Add stylesheet
|
|
18
|
+
|
|
19
|
+
Pick one:
|
|
20
|
+
|
|
21
|
+
Via CSS (preferred):
|
|
22
|
+
|
|
23
|
+
```css
|
|
24
|
+
@import "@telegraph/link";
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Via Javascript:
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import "@telegraph/link/default.css";
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> Then, include `className="tgph"` on the farthest parent element wrapping Telegraph components.
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { Link } from "@telegraph/link";
|
|
39
|
+
|
|
40
|
+
export const Example = () => (
|
|
41
|
+
<Link href="/docs" size="2" color="blue" weight="regular">
|
|
42
|
+
Docs
|
|
43
|
+
</Link>
|
|
44
|
+
);
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Props
|
|
48
|
+
|
|
49
|
+
### `<Link>` (Default Component)
|
|
50
|
+
|
|
51
|
+
| Prop | Type | Default | Description |
|
|
52
|
+
| ----------- | -------------------------- | ----------- | --------------------------- |
|
|
53
|
+
| `size` | `"0" \| "1" \| "2" \| "3"` | `"2"` | Size of link text + icon |
|
|
54
|
+
| `color` | `TextColor` | `"blue"` | Link color (same as `Text`) |
|
|
55
|
+
| `weight` | `"regular" \| "medium"` | `"regular"` | Link text weight |
|
|
56
|
+
| `icon` | `IconProps` | `undefined` | Trailing icon props |
|
|
57
|
+
| `textProps` | `LinkTextProps` | `undefined` | Props passed to `Link.Text` |
|
|
58
|
+
| `as` | `TgphElement` | `"a"` | Render polymorphically |
|
|
59
|
+
|
|
60
|
+
`TextColor` supports all `@telegraph/typography` text colors: `default`, `gray`, `red`, `beige`, `blue`, `green`, `yellow`, `purple`, `accent`, `white`, `black`, and `disabled`.
|
|
61
|
+
|
|
62
|
+
## Composition
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { Link } from "@telegraph/link";
|
|
66
|
+
import { ArrowUpRight } from "lucide-react";
|
|
67
|
+
|
|
68
|
+
export const ComposedLink = () => (
|
|
69
|
+
<Link.Root href="/docs" color="accent" size="3">
|
|
70
|
+
<Link.Text>Read more</Link.Text>
|
|
71
|
+
<Link.Icon icon={ArrowUpRight} aria-hidden />
|
|
72
|
+
</Link.Root>
|
|
73
|
+
);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Interaction behavior
|
|
77
|
+
|
|
78
|
+
`Link` underlines on hover/focus states by default, rather than exposing an `underlined` prop.
|
|
79
|
+
|
|
80
|
+
## Using with Next.js
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { Link } from "@telegraph/link";
|
|
84
|
+
import { ArrowUpRight } from "lucide-react";
|
|
85
|
+
import NextLink from "next/link";
|
|
86
|
+
|
|
87
|
+
export const NextExample = () => (
|
|
88
|
+
<Link
|
|
89
|
+
as={NextLink}
|
|
90
|
+
href="/dashboard"
|
|
91
|
+
icon={{ icon: ArrowUpRight, "aria-hidden": true }}
|
|
92
|
+
>
|
|
93
|
+
Dashboard
|
|
94
|
+
</Link>
|
|
95
|
+
);
|
|
96
|
+
```
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),p=require("@telegraph/icon"),h=require("@telegraph/layout"),_=require("@telegraph/typography"),c=require("react"),I={0:"0",1:"1",2:"2",3:"3"},j={regular:"regular",medium:"medium"},L={0:"0",1:"1",2:"2",3:"3"},u={default:"gray-12",black:"black",white:"white",disabled:"gray-9"},b=t=>t in u?u[t]:`${t}-11`,l=c.createContext({size:"2",color:"blue",weight:"regular"}),g=({as:t,size:n="2",color:e="blue",weight:r="regular",...i})=>{const s=b(e);return o.jsx(l.Provider,{value:{size:n,color:e,weight:r},children:o.jsx(h.Stack,{as:t||"a",display:"inline-flex",align:"center",gap:"1",borderColor:s,"data-tgph-link":!0,"data-tgph-link-size":n,"data-tgph-link-color":e,"data-tgph-link-weight":r,...i})})},d=({as:t,size:n,color:e,weight:r,style:i,...s})=>{const a=c.useContext(l);return o.jsx(_.Text,{as:t||"span",size:n??I[a.size],color:e??a.color,weight:r??j[a.weight],internal_optionalAs:!0,"data-link-text":!0,style:{whiteSpace:"nowrap",...i},...s})},x=({icon:t,size:n,color:e,...r})=>{const i=c.useContext(l);return o.jsx(p.Icon,{icon:t,size:n??L[i.size],color:e??i.color,"data-link-icon":!0,...r})},k=({icon:t,textProps:n,children:e,...r})=>o.jsxs(g,{...r,children:[e&&o.jsx(d,{...n,children:e}),t&&o.jsx(x,{...t})]});Object.assign(k,{Root:g,Text:d,Icon:x});const y=k;exports.Link=y;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Link/Link.constants.ts","../../src/Link/Link.tsx"],"sourcesContent":["import type { TextProps as TypographyTextProps } from \"@telegraph/typography\";\n\nexport const LINK_SIZE_MAP = {\n \"0\": \"0\",\n \"1\": \"1\",\n \"2\": \"2\",\n \"3\": \"3\",\n} as const;\n\nexport const LINK_WEIGHT_MAP = {\n regular: \"regular\",\n medium: \"medium\",\n} as const;\n\nexport const LINK_ICON_SIZE_MAP = {\n \"0\": \"0\",\n \"1\": \"1\",\n \"2\": \"2\",\n \"3\": \"3\",\n} as const;\n\nconst LINK_SPECIAL_BORDER_COLOR_MAP = {\n default: \"gray-12\",\n black: \"black\",\n white: \"white\",\n disabled: \"gray-9\",\n} as const;\n\nexport const getLinkBorderColor = (\n color: NonNullable<TypographyTextProps[\"color\"]>,\n) => {\n if (color in LINK_SPECIAL_BORDER_COLOR_MAP) {\n return LINK_SPECIAL_BORDER_COLOR_MAP[\n color as keyof typeof LINK_SPECIAL_BORDER_COLOR_MAP\n ];\n }\n\n return `${color}-11`;\n};\n","import type {\n PolymorphicProps,\n PolymorphicPropsWithTgphRef,\n RemappedOmit,\n Required,\n TgphComponentProps,\n TgphElement,\n} from \"@telegraph/helpers\";\nimport { Icon as TelegraphIcon } from \"@telegraph/icon\";\nimport { Stack } from \"@telegraph/layout\";\nimport { Text as TelegraphText } from \"@telegraph/typography\";\nimport type { TextProps as TypographyTextProps } from \"@telegraph/typography\";\nimport React from \"react\";\n\nimport {\n LINK_ICON_SIZE_MAP,\n LINK_SIZE_MAP,\n LINK_WEIGHT_MAP,\n getLinkBorderColor,\n} from \"./Link.constants\";\n\ntype RootBaseProps = {\n size?: keyof typeof LINK_SIZE_MAP;\n color?: TypographyTextProps[\"color\"];\n weight?: keyof typeof LINK_WEIGHT_MAP;\n};\n\ntype InternalProps = {\n size: Required<RootBaseProps>[\"size\"];\n color: Required<RootBaseProps>[\"color\"];\n weight: Required<RootBaseProps>[\"weight\"];\n};\n\nexport type RootProps<T extends TgphElement = \"a\"> = Omit<\n TgphComponentProps<typeof Stack>,\n \"as\" | \"tgphRef\" | \"color\"\n> &\n PolymorphicPropsWithTgphRef<T, HTMLAnchorElement> &\n RootBaseProps;\n\nconst LinkContext = React.createContext<InternalProps>({\n size: \"2\",\n color: \"blue\",\n weight: \"regular\",\n});\n\nconst Root = <T extends TgphElement = \"a\">({\n as,\n size = \"2\",\n color = \"blue\",\n weight = \"regular\",\n ...props\n}: RootProps<T>) => {\n const borderColor = getLinkBorderColor(color);\n\n return (\n <LinkContext.Provider value={{ size, color, weight }}>\n <Stack\n as={(as || \"a\") as T}\n display=\"inline-flex\"\n align=\"center\"\n gap=\"1\"\n borderColor={borderColor}\n data-tgph-link\n data-tgph-link-size={size}\n data-tgph-link-color={color}\n data-tgph-link-weight={weight}\n {...props}\n />\n </LinkContext.Provider>\n );\n};\n\nexport type TextProps<T extends TgphElement = \"span\"> = RemappedOmit<\n TgphComponentProps<typeof TelegraphText<T>>,\n \"as\"\n> & {\n as?: T;\n};\n\nconst Text = <T extends TgphElement = \"span\">({\n as,\n size,\n color,\n weight,\n style,\n ...props\n}: TextProps<T>) => {\n const context = React.useContext(LinkContext);\n return (\n <TelegraphText\n as={(as || \"span\") as T}\n size={size ?? LINK_SIZE_MAP[context.size]}\n color={color ?? context.color}\n weight={weight ?? LINK_WEIGHT_MAP[context.weight]}\n internal_optionalAs={true}\n data-link-text\n style={{\n whiteSpace: \"nowrap\",\n ...style,\n }}\n {...props}\n />\n );\n};\n\nexport type IconProps<T extends TgphElement = \"span\"> = TgphComponentProps<\n typeof TelegraphIcon<T>\n>;\n\nconst Icon = <T extends TgphElement = \"span\">({\n icon,\n size,\n color,\n ...props\n}: IconProps<T>) => {\n const context = React.useContext(LinkContext);\n return (\n <TelegraphIcon\n icon={icon}\n size={size ?? LINK_ICON_SIZE_MAP[context.size]}\n color={color ?? context.color}\n data-link-icon\n {...props}\n />\n );\n};\n\ntype DefaultIconProps = React.ComponentProps<typeof Icon>;\ntype DefaultTextProps = React.ComponentProps<typeof Text>;\nexport type DefaultProps<T extends TgphElement = \"a\"> = PolymorphicProps<T> &\n TgphComponentProps<typeof Root<T>> & {\n icon?: DefaultIconProps;\n textProps?: DefaultTextProps;\n };\n\nconst Default = <T extends TgphElement = \"a\">({\n icon,\n textProps,\n children,\n ...props\n}: DefaultProps<T>) => {\n return (\n <Root {...props}>\n {children && <Text {...textProps}>{children}</Text>}\n {icon && <Icon {...icon} />}\n </Root>\n );\n};\n\nObject.assign(Default, {\n Root,\n Text,\n Icon,\n});\n\nconst Link = Default as typeof Default & {\n Root: typeof Root;\n Text: typeof Text;\n Icon: typeof Icon;\n};\n\nexport { Link };\n"],"names":["LINK_SIZE_MAP","LINK_WEIGHT_MAP","LINK_ICON_SIZE_MAP","LINK_SPECIAL_BORDER_COLOR_MAP","getLinkBorderColor","color","LinkContext","React","Root","as","size","weight","props","borderColor","jsx","Stack","Text","style","context","TelegraphText","Icon","icon","TelegraphIcon","Default","textProps","children","jsxs","Link"],"mappings":"uOAEaA,EAAgB,CAC3B,EAAK,IACL,EAAK,IACL,EAAK,IACL,EAAK,GACP,EAEaC,EAAkB,CAC7B,QAAS,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X,EAAM,WAAWD,CAAW,EAC5C,OACEQ,EAAAA,IAACQ,EAAAA,KAAA,CAAA,KACCD,EACA,KAAMX,GAAQR,EAAmBgB,EAAQ,IAAI,EAC7C,MAAOb,GAASa,EAAQ,MACxB,iBAAc,GACb,GAAGN,CAAA,CAAA,CAGV,EAUMW,EAAU,CAA8B,CAC5C,KAAAF,EACA,UAAAG,EACA,SAAAC,EACA,GAAGb,CACL,IAEIc,EAAAA,KAAClB,EAAA,CAAM,GAAGI,EACP,SAAA,CAAAa,GAAYX,EAAAA,IAACE,EAAA,CAAM,GAAGQ,EAAY,SAAAC,CAAA,CAAS,EAC3CJ,GAAQP,EAAAA,IAACM,EAAA,CAAM,GAAGC,CAAA,CAAM,CAAA,EAC3B,EAIJ,OAAO,OAAOE,EAAS,CACrB,KAAAf,EACA,KAAAQ,EACA,KAAAI,CACF,CAAC,EAED,MAAMO,EAAOJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-tgph-link]{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;box-sizing:border-box;text-decoration:none;border-bottom:1px solid transparent;transition:color .2s ease-in-out,border-color .2s ease-in-out,filter .2s ease-in-out}[data-tgph-link] [data-link-text]{text-decoration-line:none;text-underline-offset:2px;text-decoration-thickness:1px}[data-tgph-link]:hover,[data-tgph-link]:focus-visible{border-bottom-color:var(--border-color)}[data-tgph-link]:focus{filter:brightness(.8)}[data-tgph-link]:focus-visible{outline:2px solid var(--tgph-blue-8);outline-offset:2px;border-radius:var(--tgph-rounded-1);filter:brightness(.8)}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsxs as x, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as k } from "@telegraph/icon";
|
|
3
|
+
import { Stack as I } from "@telegraph/layout";
|
|
4
|
+
import { Text as _ } from "@telegraph/typography";
|
|
5
|
+
import c from "react";
|
|
6
|
+
const h = {
|
|
7
|
+
0: "0",
|
|
8
|
+
1: "1",
|
|
9
|
+
2: "2",
|
|
10
|
+
3: "3"
|
|
11
|
+
}, f = {
|
|
12
|
+
regular: "regular",
|
|
13
|
+
medium: "medium"
|
|
14
|
+
}, C = {
|
|
15
|
+
0: "0",
|
|
16
|
+
1: "1",
|
|
17
|
+
2: "2",
|
|
18
|
+
3: "3"
|
|
19
|
+
}, u = {
|
|
20
|
+
default: "gray-12",
|
|
21
|
+
black: "black",
|
|
22
|
+
white: "white",
|
|
23
|
+
disabled: "gray-9"
|
|
24
|
+
}, L = (t) => t in u ? u[t] : `${t}-11`, l = c.createContext({
|
|
25
|
+
size: "2",
|
|
26
|
+
color: "blue",
|
|
27
|
+
weight: "regular"
|
|
28
|
+
}), g = ({
|
|
29
|
+
as: t,
|
|
30
|
+
size: r = "2",
|
|
31
|
+
color: e = "blue",
|
|
32
|
+
weight: n = "regular",
|
|
33
|
+
...o
|
|
34
|
+
}) => {
|
|
35
|
+
const i = L(e);
|
|
36
|
+
return /* @__PURE__ */ a(l.Provider, { value: { size: r, color: e, weight: n }, children: /* @__PURE__ */ a(
|
|
37
|
+
I,
|
|
38
|
+
{
|
|
39
|
+
as: t || "a",
|
|
40
|
+
display: "inline-flex",
|
|
41
|
+
align: "center",
|
|
42
|
+
gap: "1",
|
|
43
|
+
borderColor: i,
|
|
44
|
+
"data-tgph-link": !0,
|
|
45
|
+
"data-tgph-link-size": r,
|
|
46
|
+
"data-tgph-link-color": e,
|
|
47
|
+
"data-tgph-link-weight": n,
|
|
48
|
+
...o
|
|
49
|
+
}
|
|
50
|
+
) });
|
|
51
|
+
}, d = ({
|
|
52
|
+
as: t,
|
|
53
|
+
size: r,
|
|
54
|
+
color: e,
|
|
55
|
+
weight: n,
|
|
56
|
+
style: o,
|
|
57
|
+
...i
|
|
58
|
+
}) => {
|
|
59
|
+
const s = c.useContext(l);
|
|
60
|
+
return /* @__PURE__ */ a(
|
|
61
|
+
_,
|
|
62
|
+
{
|
|
63
|
+
as: t || "span",
|
|
64
|
+
size: r ?? h[s.size],
|
|
65
|
+
color: e ?? s.color,
|
|
66
|
+
weight: n ?? f[s.weight],
|
|
67
|
+
internal_optionalAs: !0,
|
|
68
|
+
"data-link-text": !0,
|
|
69
|
+
style: {
|
|
70
|
+
whiteSpace: "nowrap",
|
|
71
|
+
...o
|
|
72
|
+
},
|
|
73
|
+
...i
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}, p = ({
|
|
77
|
+
icon: t,
|
|
78
|
+
size: r,
|
|
79
|
+
color: e,
|
|
80
|
+
...n
|
|
81
|
+
}) => {
|
|
82
|
+
const o = c.useContext(l);
|
|
83
|
+
return /* @__PURE__ */ a(
|
|
84
|
+
k,
|
|
85
|
+
{
|
|
86
|
+
icon: t,
|
|
87
|
+
size: r ?? C[o.size],
|
|
88
|
+
color: e ?? o.color,
|
|
89
|
+
"data-link-icon": !0,
|
|
90
|
+
...n
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}, m = ({
|
|
94
|
+
icon: t,
|
|
95
|
+
textProps: r,
|
|
96
|
+
children: e,
|
|
97
|
+
...n
|
|
98
|
+
}) => /* @__PURE__ */ x(g, { ...n, children: [
|
|
99
|
+
e && /* @__PURE__ */ a(d, { ...r, children: e }),
|
|
100
|
+
t && /* @__PURE__ */ a(p, { ...t })
|
|
101
|
+
] });
|
|
102
|
+
Object.assign(m, {
|
|
103
|
+
Root: g,
|
|
104
|
+
Text: d,
|
|
105
|
+
Icon: p
|
|
106
|
+
});
|
|
107
|
+
const E = m;
|
|
108
|
+
export {
|
|
109
|
+
E as Link
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/Link/Link.constants.ts","../../src/Link/Link.tsx"],"sourcesContent":["import type { TextProps as TypographyTextProps } from \"@telegraph/typography\";\n\nexport const LINK_SIZE_MAP = {\n \"0\": \"0\",\n \"1\": \"1\",\n \"2\": \"2\",\n \"3\": \"3\",\n} as const;\n\nexport const LINK_WEIGHT_MAP = {\n regular: \"regular\",\n medium: \"medium\",\n} as const;\n\nexport const LINK_ICON_SIZE_MAP = {\n \"0\": \"0\",\n \"1\": \"1\",\n \"2\": \"2\",\n \"3\": \"3\",\n} as const;\n\nconst LINK_SPECIAL_BORDER_COLOR_MAP = {\n default: \"gray-12\",\n black: \"black\",\n white: \"white\",\n disabled: \"gray-9\",\n} as const;\n\nexport const getLinkBorderColor = (\n color: NonNullable<TypographyTextProps[\"color\"]>,\n) => {\n if (color in LINK_SPECIAL_BORDER_COLOR_MAP) {\n return LINK_SPECIAL_BORDER_COLOR_MAP[\n color as keyof typeof LINK_SPECIAL_BORDER_COLOR_MAP\n ];\n }\n\n return `${color}-11`;\n};\n","import type {\n PolymorphicProps,\n PolymorphicPropsWithTgphRef,\n RemappedOmit,\n Required,\n TgphComponentProps,\n TgphElement,\n} from \"@telegraph/helpers\";\nimport { Icon as TelegraphIcon } from \"@telegraph/icon\";\nimport { Stack } from \"@telegraph/layout\";\nimport { Text as TelegraphText } from \"@telegraph/typography\";\nimport type { TextProps as TypographyTextProps } from \"@telegraph/typography\";\nimport React from \"react\";\n\nimport {\n LINK_ICON_SIZE_MAP,\n LINK_SIZE_MAP,\n LINK_WEIGHT_MAP,\n getLinkBorderColor,\n} from \"./Link.constants\";\n\ntype RootBaseProps = {\n size?: keyof typeof LINK_SIZE_MAP;\n color?: TypographyTextProps[\"color\"];\n weight?: keyof typeof LINK_WEIGHT_MAP;\n};\n\ntype InternalProps = {\n size: Required<RootBaseProps>[\"size\"];\n color: Required<RootBaseProps>[\"color\"];\n weight: Required<RootBaseProps>[\"weight\"];\n};\n\nexport type RootProps<T extends TgphElement = \"a\"> = Omit<\n TgphComponentProps<typeof Stack>,\n \"as\" | \"tgphRef\" | \"color\"\n> &\n PolymorphicPropsWithTgphRef<T, HTMLAnchorElement> &\n RootBaseProps;\n\nconst LinkContext = React.createContext<InternalProps>({\n size: \"2\",\n color: \"blue\",\n weight: \"regular\",\n});\n\nconst Root = <T extends TgphElement = \"a\">({\n as,\n size = \"2\",\n color = \"blue\",\n weight = \"regular\",\n ...props\n}: RootProps<T>) => {\n const borderColor = getLinkBorderColor(color);\n\n return (\n <LinkContext.Provider value={{ size, color, weight }}>\n <Stack\n as={(as || \"a\") as T}\n display=\"inline-flex\"\n align=\"center\"\n gap=\"1\"\n borderColor={borderColor}\n data-tgph-link\n data-tgph-link-size={size}\n data-tgph-link-color={color}\n data-tgph-link-weight={weight}\n {...props}\n />\n </LinkContext.Provider>\n );\n};\n\nexport type TextProps<T extends TgphElement = \"span\"> = RemappedOmit<\n TgphComponentProps<typeof TelegraphText<T>>,\n \"as\"\n> & {\n as?: T;\n};\n\nconst Text = <T extends TgphElement = \"span\">({\n as,\n size,\n color,\n weight,\n style,\n ...props\n}: TextProps<T>) => {\n const context = React.useContext(LinkContext);\n return (\n <TelegraphText\n as={(as || \"span\") as T}\n size={size ?? LINK_SIZE_MAP[context.size]}\n color={color ?? context.color}\n weight={weight ?? LINK_WEIGHT_MAP[context.weight]}\n internal_optionalAs={true}\n data-link-text\n style={{\n whiteSpace: \"nowrap\",\n ...style,\n }}\n {...props}\n />\n );\n};\n\nexport type IconProps<T extends TgphElement = \"span\"> = TgphComponentProps<\n typeof TelegraphIcon<T>\n>;\n\nconst Icon = <T extends TgphElement = \"span\">({\n icon,\n size,\n color,\n ...props\n}: IconProps<T>) => {\n const context = React.useContext(LinkContext);\n return (\n <TelegraphIcon\n icon={icon}\n size={size ?? LINK_ICON_SIZE_MAP[context.size]}\n color={color ?? context.color}\n data-link-icon\n {...props}\n />\n );\n};\n\ntype DefaultIconProps = React.ComponentProps<typeof Icon>;\ntype DefaultTextProps = React.ComponentProps<typeof Text>;\nexport type DefaultProps<T extends TgphElement = \"a\"> = PolymorphicProps<T> &\n TgphComponentProps<typeof Root<T>> & {\n icon?: DefaultIconProps;\n textProps?: DefaultTextProps;\n };\n\nconst Default = <T extends TgphElement = \"a\">({\n icon,\n textProps,\n children,\n ...props\n}: DefaultProps<T>) => {\n return (\n <Root {...props}>\n {children && <Text {...textProps}>{children}</Text>}\n {icon && <Icon {...icon} />}\n </Root>\n );\n};\n\nObject.assign(Default, {\n Root,\n Text,\n Icon,\n});\n\nconst Link = Default as typeof Default & {\n Root: typeof Root;\n Text: typeof Text;\n Icon: typeof Icon;\n};\n\nexport { Link };\n"],"names":["LINK_SIZE_MAP","LINK_WEIGHT_MAP","LINK_ICON_SIZE_MAP","LINK_SPECIAL_BORDER_COLOR_MAP","getLinkBorderColor","color","LinkContext","React","Root","as","size","weight","props","borderColor","jsx","Stack","Text","style","context","TelegraphText","Icon","icon","TelegraphIcon","Default","textProps","children","jsxs","Link"],"mappings":";;;;;AAEO,MAAMA,IAAgB;AAAA,EAC3B,GAAK;AAAA,EACL,GAAK;AAAA,EACL,GAAK;AAAA,EACL,GAAK;AACP,GAEaC,IAAkB;AAAA,EAC7B,SAAS;AAAA,EACT,QAAQ;AACV,GAEaC,IAAqB;AAAA,EAChC,GAAK;AAAA,EACL,GAAK;AAAA,EACL,GAAK;AAAA,EACL,GAAK;AACP,GAEMC,IAAgC;AAAA,EACpC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AACZ,GAEaC,IAAqB,CAChCC,MAEIA,KAASF,IACJA,EACLE,CACF,IAGK,GAAGA,CAAK,OCGXC,IAAcC,EAAM,cAA6B;AAAA,EACrD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV,CAAC,GAEKC,IAAO,CAA8B;AAAA,EACzC,IAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAL,IAAQ;AAAA,EACR,QAAAM,IAAS;AAAA,EACT,GAAGC;AACL,MAAoB;AAClB,QAAMC,IAAcT,EAAmBC,CAAK;AAE5C,SACE,gBAAAS,EAACR,EAAY,UAAZ,EAAqB,OAAO,EAAE,MAAAI,GAAM,OAAAL,GAAO,QAAAM,KAC1C,UAAA,gB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AAAC;AAAA,EACA,GAAGb;AACL,MAEI,gBAAAc,EAAClB,GAAA,EAAM,GAAGI,GACP,UAAA;AAAA,EAAAa,KAAY,gBAAAX,EAACE,GAAA,EAAM,GAAGQ,GAAY,UAAAC,EAAA,CAAS;AAAA,EAC3CJ,KAAQ,gBAAAP,EAACM,GAAA,EAAM,GAAGC,EAAA,CAAM;AAAA,GAC3B;AAIJ,OAAO,OAAOE,GAAS;AAAA,EACrB,MAAAf;AAAA,EACA,MAAAQ;AAAA,EACA,MAAAI;AACF,CAAC;AAED,MAAMO,IAAOJ;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TextProps as TypographyTextProps } from '@telegraph/typography';
|
|
2
|
+
export declare const LINK_SIZE_MAP: {
|
|
3
|
+
readonly "0": "0";
|
|
4
|
+
readonly "1": "1";
|
|
5
|
+
readonly "2": "2";
|
|
6
|
+
readonly "3": "3";
|
|
7
|
+
};
|
|
8
|
+
export declare const LINK_WEIGHT_MAP: {
|
|
9
|
+
readonly regular: "regular";
|
|
10
|
+
readonly medium: "medium";
|
|
11
|
+
};
|
|
12
|
+
export declare const LINK_ICON_SIZE_MAP: {
|
|
13
|
+
readonly "0": "0";
|
|
14
|
+
readonly "1": "1";
|
|
15
|
+
readonly "2": "2";
|
|
16
|
+
readonly "3": "3";
|
|
17
|
+
};
|
|
18
|
+
export declare const getLinkBorderColor: (color: NonNullable<TypographyTextProps["color"]>) => string;
|
|
19
|
+
//# sourceMappingURL=Link.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.constants.d.ts","sourceRoot":"","sources":["../../../src/Link/Link.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAEX,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;CAKrB,CAAC;AASX,eAAO,MAAM,kBAAkB,GAC7B,OAAO,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,WASjD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PolymorphicProps, PolymorphicPropsWithTgphRef, RemappedOmit, TgphComponentProps, TgphElement } from '@telegraph/helpers';
|
|
2
|
+
import { Icon as TelegraphIcon } from '@telegraph/icon';
|
|
3
|
+
import { Stack } from '@telegraph/layout';
|
|
4
|
+
import { Text as TelegraphText, TextProps as TypographyTextProps } from '@telegraph/typography';
|
|
5
|
+
import { default as React } from 'react';
|
|
6
|
+
import { LINK_SIZE_MAP, LINK_WEIGHT_MAP } from './Link.constants';
|
|
7
|
+
type RootBaseProps = {
|
|
8
|
+
size?: keyof typeof LINK_SIZE_MAP;
|
|
9
|
+
color?: TypographyTextProps["color"];
|
|
10
|
+
weight?: keyof typeof LINK_WEIGHT_MAP;
|
|
11
|
+
};
|
|
12
|
+
export type RootProps<T extends TgphElement = "a"> = Omit<TgphComponentProps<typeof Stack>, "as" | "tgphRef" | "color"> & PolymorphicPropsWithTgphRef<T, HTMLAnchorElement> & RootBaseProps;
|
|
13
|
+
declare const Root: <T extends TgphElement = "a">({ as, size, color, weight, ...props }: RootProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export type TextProps<T extends TgphElement = "span"> = RemappedOmit<TgphComponentProps<typeof TelegraphText<T>>, "as"> & {
|
|
15
|
+
as?: T;
|
|
16
|
+
};
|
|
17
|
+
declare const Text: <T extends TgphElement = "span">({ as, size, color, weight, style, ...props }: TextProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export type IconProps<T extends TgphElement = "span"> = TgphComponentProps<typeof TelegraphIcon<T>>;
|
|
19
|
+
declare const Icon: <T extends TgphElement = "span">({ icon, size, color, ...props }: IconProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
type DefaultIconProps = React.ComponentProps<typeof Icon>;
|
|
21
|
+
type DefaultTextProps = React.ComponentProps<typeof Text>;
|
|
22
|
+
export type DefaultProps<T extends TgphElement = "a"> = PolymorphicProps<T> & TgphComponentProps<typeof Root<T>> & {
|
|
23
|
+
icon?: DefaultIconProps;
|
|
24
|
+
textProps?: DefaultTextProps;
|
|
25
|
+
};
|
|
26
|
+
declare const Default: <T extends TgphElement = "a">({ icon, textProps, children, ...props }: DefaultProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare const Link: typeof Default & {
|
|
28
|
+
Root: typeof Root;
|
|
29
|
+
Text: typeof Text;
|
|
30
|
+
Icon: typeof Icon;
|
|
31
|
+
};
|
|
32
|
+
export { Link };
|
|
33
|
+
//# sourceMappingURL=Link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,2BAA2B,EAC3B,YAAY,EAEZ,kBAAkB,EAClB,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,aAAa,EACb,eAAe,EAEhB,MAAM,kBAAkB,CAAC;AAE1B,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,MAAM,OAAO,aAAa,CAAC;IAClC,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,OAAO,eAAe,CAAC;CACvC,CAAC;AAQF,MAAM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AAE,gBAAgB,CAAC;CAC9B,CAAC;AAEJ,QAAA,MAAM,OAAO,GAAI,CAAC,SAAS,WAAW,GAAG,GAAG,EAAE,yCAK3C,YAAY,CAAC,CAAC,CAAC,4CAOjB,CAAC;AAQF,QAAA,MAAM,IAAI,EAAc,OAAO,OAAO,GAAG;IACvC,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,IAAI,EAAE,OAAO,IAAI,CAAC;CACnB,CAAC;AAEF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Link/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EACV,SAAS,IAAI,aAAa,EAC1B,SAAS,IAAI,aAAa,EAC1B,SAAS,IAAI,aAAa,EAC1B,YAAY,IAAI,SAAS,GAC1B,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACb,SAAS,GACV,MAAM,QAAQ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@telegraph/link",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Link component in Telegraph",
|
|
5
|
+
"repository": "https://github.com/knocklabs/telegraph/tree/main/packages/link",
|
|
6
|
+
"author": "@knocklabs",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "./dist/cjs/index.js",
|
|
9
|
+
"module": "./dist/esm/index.mjs",
|
|
10
|
+
"types": "./dist/types/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/types/index.d.ts",
|
|
14
|
+
"import": "./dist/esm/index.mjs",
|
|
15
|
+
"require": "./dist/cjs/index.js",
|
|
16
|
+
"default": "./dist/css/default.css"
|
|
17
|
+
},
|
|
18
|
+
"./default.css": "./dist/css/default.css"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"prettier": "@telegraph/prettier-config",
|
|
25
|
+
"scripts": {
|
|
26
|
+
"clean": "rm -rf dist",
|
|
27
|
+
"dev": "vite build --watch --emptyOutDir false",
|
|
28
|
+
"build": "yarn clean && vite build",
|
|
29
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
30
|
+
"format": "prettier \"src/**/*.{js,ts,tsx}\" --write",
|
|
31
|
+
"format:check": "prettier \"src/**/*.{js,ts,tsx}\" --check",
|
|
32
|
+
"preview": "vite preview"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@telegraph/helpers": "^0.0.15",
|
|
36
|
+
"@telegraph/icon": "^0.4.0",
|
|
37
|
+
"@telegraph/layout": "^0.4.0",
|
|
38
|
+
"@telegraph/typography": "^0.2.0",
|
|
39
|
+
"lucide-react": "^0.544.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@knocklabs/eslint-config": "^0.0.5",
|
|
43
|
+
"@knocklabs/typescript-config": "^0.0.2",
|
|
44
|
+
"@telegraph/postcss-config": "^0.0.31",
|
|
45
|
+
"@telegraph/prettier-config": "^0.0.7",
|
|
46
|
+
"@telegraph/vite-config": "^0.0.15",
|
|
47
|
+
"@types/react": "^19.2.9",
|
|
48
|
+
"eslint": "^8.56.0",
|
|
49
|
+
"react": "^19.2.4",
|
|
50
|
+
"react-dom": "^19.2.4",
|
|
51
|
+
"typescript": "^5.9.3",
|
|
52
|
+
"vite": "^6.4.1"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
56
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
57
|
+
}
|
|
58
|
+
}
|