@grantbii/design-system 1.18.2 → 1.19.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.
@@ -1,20 +0,0 @@
1
- import type { AnchorHTMLAttributes, ComponentType, DetailedHTMLProps, HTMLAttributeAnchorTarget, ReactNode } from "react";
2
- import { SystemIcon } from "../atoms";
3
- type LinkButtonProps = {
4
- label: ReactNode;
5
- href: string;
6
- disabled?: boolean;
7
- target?: HTMLAttributeAnchorTarget;
8
- LeftIcon?: ComponentType<SystemIcon.IconProps>;
9
- RightIcon?: ComponentType<SystemIcon.IconProps>;
10
- underline?: boolean;
11
- backgroundColor?: string;
12
- borderColor?: string;
13
- color?: string;
14
- width?: string;
15
- } & DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
16
- /**
17
- * A link that looks like a button
18
- */
19
- declare const LinkButton: ({ label, LeftIcon, RightIcon, underline, backgroundColor, borderColor, color, width, disabled, target, ...linkProps }: LinkButtonProps) => import("react/jsx-runtime").JSX.Element;
20
- export default LinkButton;
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import Link from "next/link";
3
- import { SystemIcon } from "../atoms";
4
- import { BaseButton } from "../shared";
5
- /**
6
- * A link that looks like a button
7
- */
8
- const LinkButton = ({ label, LeftIcon, RightIcon, underline, backgroundColor, borderColor, color, width, disabled, target = "_blank", ...linkProps }) => {
9
- const contentProps = {
10
- label,
11
- LeftIcon,
12
- RightIcon,
13
- underline,
14
- backgroundColor,
15
- borderColor,
16
- color,
17
- width,
18
- };
19
- return disabled ? (_jsx(Content, { ...contentProps })) : (_jsx(Link, { ...linkProps, target: target, children: _jsx(Content, { ...contentProps }) }));
20
- };
21
- export default LinkButton;
22
- const Content = ({ label, LeftIcon, RightIcon, underline, backgroundColor, borderColor, color, width, }) => (_jsxs(BaseButton, { "$underline": underline, "$backgroundColor": backgroundColor, "$borderColor": borderColor, "$color": color, "$width": width, children: [LeftIcon ? _jsx(LeftIcon, { color: color, size: 20 }) : _jsx(_Fragment, {}), label, RightIcon ? _jsx(RightIcon, { color: color, size: 20 }) : _jsx(_Fragment, {})] }));
23
- //# sourceMappingURL=LinkButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkButton.js","sourceRoot":"","sources":["../../../core/archive/LinkButton.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAQ7B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAmBvC;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,EAClB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,SAAS,EACT,eAAe,EACf,WAAW,EACX,KAAK,EACL,KAAK,EACL,QAAQ,EACR,MAAM,GAAG,QAAQ,EACjB,GAAG,SAAS,EACI,EAAE,EAAE;IACpB,MAAM,YAAY,GAAG;QACnB,KAAK;QACL,QAAQ;QACR,SAAS;QACT,SAAS;QACT,eAAe;QACf,WAAW;QACX,KAAK;QACL,KAAK;KACN,CAAC;IAEF,OAAO,QAAQ,CAAC,CAAC,CAAC,CAChB,KAAC,OAAO,OAAK,YAAY,GAAI,CAC9B,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,OAAK,SAAS,EAAE,MAAM,EAAE,MAAM,YACjC,KAAC,OAAO,OAAK,YAAY,GAAI,GACxB,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC;AAa1B,MAAM,OAAO,GAAG,CAAC,EACf,KAAK,EACL,QAAQ,EACR,SAAS,EACT,SAAS,EACT,eAAe,EACf,WAAW,EACX,KAAK,EACL,KAAK,GACQ,EAAE,EAAE,CAAC,CAClB,MAAC,UAAU,kBACG,SAAS,sBACH,eAAe,kBACnB,WAAW,YACjB,KAAK,YACL,KAAK,aAEZ,QAAQ,CAAC,CAAC,CAAC,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,GAAI,CAAC,CAAC,CAAC,mBAAK,EACvD,KAAK,EACL,SAAS,CAAC,CAAC,CAAC,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,GAAI,CAAC,CAAC,CAAC,mBAAK,IAC/C,CACd,CAAC","sourcesContent":["import Link from \"next/link\";\nimport type {\n AnchorHTMLAttributes,\n ComponentType,\n DetailedHTMLProps,\n HTMLAttributeAnchorTarget,\n ReactNode,\n} from \"react\";\nimport { SystemIcon } from \"../atoms\";\nimport { BaseButton } from \"../shared\";\n\ntype LinkButtonProps = {\n label: ReactNode;\n href: string;\n disabled?: boolean;\n target?: HTMLAttributeAnchorTarget;\n LeftIcon?: ComponentType<SystemIcon.IconProps>;\n RightIcon?: ComponentType<SystemIcon.IconProps>;\n underline?: boolean;\n backgroundColor?: string;\n borderColor?: string;\n color?: string;\n width?: string;\n} & DetailedHTMLProps<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n HTMLAnchorElement\n>;\n\n/**\n * A link that looks like a button\n */\nconst LinkButton = ({\n label,\n LeftIcon,\n RightIcon,\n underline,\n backgroundColor,\n borderColor,\n color,\n width,\n disabled,\n target = \"_blank\",\n ...linkProps\n}: LinkButtonProps) => {\n const contentProps = {\n label,\n LeftIcon,\n RightIcon,\n underline,\n backgroundColor,\n borderColor,\n color,\n width,\n };\n\n return disabled ? (\n <Content {...contentProps} />\n ) : (\n <Link {...linkProps} target={target}>\n <Content {...contentProps} />\n </Link>\n );\n};\n\nexport default LinkButton;\n\ntype ContentProps = {\n label: ReactNode;\n LeftIcon?: ComponentType<SystemIcon.IconProps>;\n RightIcon?: ComponentType<SystemIcon.IconProps>;\n underline?: boolean;\n backgroundColor?: string;\n borderColor?: string;\n color?: string;\n width?: string;\n};\n\nconst Content = ({\n label,\n LeftIcon,\n RightIcon,\n underline,\n backgroundColor,\n borderColor,\n color,\n width,\n}: ContentProps) => (\n <BaseButton\n $underline={underline}\n $backgroundColor={backgroundColor}\n $borderColor={borderColor}\n $color={color}\n $width={width}\n >\n {LeftIcon ? <LeftIcon color={color} size={20} /> : <></>}\n {label}\n {RightIcon ? <RightIcon color={color} size={20} /> : <></>}\n </BaseButton>\n);\n"]}
@@ -1,10 +0,0 @@
1
- import { LinkButton } from "@/.";
2
- import type { Meta, StoryObj } from "@storybook/nextjs-vite";
3
- declare const meta: Meta<typeof LinkButton>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const TextOnly: Story;
7
- export declare const LeftIcon: Story;
8
- export declare const RightIcon: Story;
9
- export declare const BothSystemIcon: Story;
10
- export declare const Underline: Story;
@@ -1,41 +0,0 @@
1
- import { Color, SystemIcon, LinkButton } from "@/.";
2
- const meta = {
3
- title: "Archive/Link Button",
4
- component: LinkButton,
5
- tags: ["autodocs"],
6
- };
7
- export default meta;
8
- const baseArgs = { label: "Link", href: "https://grantbii.com" };
9
- export const TextOnly = {
10
- args: {
11
- ...baseArgs,
12
- onClick: () => alert("clicked on link"),
13
- },
14
- };
15
- export const LeftIcon = {
16
- args: {
17
- ...baseArgs,
18
- LeftIcon: SystemIcon.PlusIcon,
19
- },
20
- };
21
- export const RightIcon = {
22
- args: {
23
- ...baseArgs,
24
- RightIcon: SystemIcon.MinusIcon,
25
- },
26
- };
27
- export const BothSystemIcon = {
28
- args: {
29
- ...baseArgs,
30
- LeftIcon: SystemIcon.SmileyXEyesIcon,
31
- RightIcon: SystemIcon.SmileyMeltingIcon,
32
- },
33
- };
34
- export const Underline = {
35
- args: {
36
- ...baseArgs,
37
- underline: true,
38
- color: Color.typography.blackMedium,
39
- },
40
- };
41
- //# sourceMappingURL=LinkButton.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkButton.stories.js","sourceRoot":"","sources":["../../../stories/archive/LinkButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGpD,MAAM,IAAI,GAA4B;IACpC,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,QAAQ,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC;AAEjE,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC;KACxC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,QAAQ,EAAE,UAAU,CAAC,QAAQ;KAC9B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,SAAS,EAAE,UAAU,CAAC,SAAS;KAChC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAU;IACnC,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,QAAQ,EAAE,UAAU,CAAC,eAAe;QACpC,SAAS,EAAE,UAAU,CAAC,iBAAiB;KACxC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW;KACpC;CACF,CAAC","sourcesContent":["import { Color, SystemIcon, LinkButton } from \"@/.\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof LinkButton> = {\n title: \"Archive/Link Button\",\n component: LinkButton,\n tags: [\"autodocs\"],\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nconst baseArgs = { label: \"Link\", href: \"https://grantbii.com\" };\n\nexport const TextOnly: Story = {\n args: {\n ...baseArgs,\n onClick: () => alert(\"clicked on link\"),\n },\n};\n\nexport const LeftIcon: Story = {\n args: {\n ...baseArgs,\n LeftIcon: SystemIcon.PlusIcon,\n },\n};\n\nexport const RightIcon: Story = {\n args: {\n ...baseArgs,\n RightIcon: SystemIcon.MinusIcon,\n },\n};\n\nexport const BothSystemIcon: Story = {\n args: {\n ...baseArgs,\n LeftIcon: SystemIcon.SmileyXEyesIcon,\n RightIcon: SystemIcon.SmileyMeltingIcon,\n },\n};\n\nexport const Underline: Story = {\n args: {\n ...baseArgs,\n underline: true,\n color: Color.typography.blackMedium,\n },\n};\n"]}