@grantbii/design-system 1.29.0 → 2.0.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,9 +0,0 @@
1
- import type { MouseEventHandler, ReactNode } from "react";
2
- type TallyModalProps = {
3
- header?: ReactNode;
4
- tallyId: string;
5
- prefilledFieldsQueryParams?: string;
6
- onClickClose: MouseEventHandler<HTMLButtonElement>;
7
- };
8
- declare const TallyModal: ({ header, tallyId, prefilledFieldsQueryParams, onClickClose, }: TallyModalProps) => import("react").JSX.Element;
9
- export default TallyModal;
@@ -1,46 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import styled from "styled-components";
3
- import { Color, Spacing, Typography } from "../atoms";
4
- import { applyTypography } from "../integrations";
5
- import { Button } from "../molecules";
6
- import { Modal } from "../organisms";
7
- const TallyModal = ({ header, tallyId, prefilledFieldsQueryParams, onClickClose, }) => (_jsxs(Modal, { width: "640px", height: "600px", children: [header ? _jsx(ModalHeader, { children: header }) : _jsx(_Fragment, {}), _jsx(ModalBody, { children: _jsx(ModalIframe, { src: constructIframeSrc(tallyId, prefilledFieldsQueryParams), loading: "lazy", title: "Tally Modal" }) }), _jsx(ModalFooter, { children: _jsx(Button, { label: "Close", onClick: onClickClose, variant: "tertiary", size: "small" }) })] }));
8
- export default TallyModal;
9
- const ModalHeader = styled.div `
10
- margin-bottom: ${Spacing.px12};
11
- padding: ${Spacing.px12} ${Spacing.px20};
12
-
13
- border-bottom: 1px solid ${Color.neutral.grey3};
14
-
15
- ${applyTypography(Typography.subheading2Medium)}
16
- `;
17
- const ModalBody = styled.div `
18
- display: flex;
19
- flex-direction: column;
20
-
21
- height: 100%;
22
- overflow-y: auto;
23
- `;
24
- const ModalIframe = styled.iframe `
25
- width: 100%;
26
- height: 100%;
27
- min-height: ${Spacing.px100};
28
-
29
- padding: ${Spacing.px4} ${Spacing.px20};
30
- border: none;
31
- `;
32
- const ModalFooter = styled.div `
33
- display: flex;
34
- justify-content: space-between;
35
- gap: ${Spacing.px12};
36
-
37
- padding: ${Spacing.px16} ${Spacing.px20};
38
- `;
39
- const constructIframeSrc = (tallyId, prefilledFieldsQueryParams) => {
40
- const queryParams = prefilledFieldsQueryParams
41
- ? `&${prefilledFieldsQueryParams}`
42
- : "";
43
- return `https://tally.so/embed/${tallyId}?${tallyQueryParams}${queryParams}`;
44
- };
45
- const tallyQueryParams = "alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=0";
46
- //# sourceMappingURL=TallyModal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TallyModal.js","sourceRoot":"","sources":["../../../core/archive/TallyModal.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AASrC,MAAM,UAAU,GAAG,CAAC,EAClB,MAAM,EACN,OAAO,EACP,0BAA0B,EAC1B,YAAY,GACI,EAAE,EAAE,CAAC,CACrB,MAAC,KAAK,IAAC,KAAK,EAAC,OAAO,EAAC,MAAM,EAAC,OAAO,aAChC,MAAM,CAAC,CAAC,CAAC,KAAC,WAAW,cAAE,MAAM,GAAe,CAAC,CAAC,CAAC,mBAAK,EAErD,KAAC,SAAS,cACR,KAAC,WAAW,IACV,GAAG,EAAE,kBAAkB,CAAC,OAAO,EAAE,0BAA0B,CAAC,EAC5D,OAAO,EAAC,MAAM,EACd,KAAK,EAAC,aAAa,GACnB,GACQ,EAEZ,KAAC,WAAW,cACV,KAAC,MAAM,IACL,KAAK,EAAC,OAAO,EACb,OAAO,EAAE,YAAY,EACrB,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,OAAO,GACZ,GACU,IACR,CACT,CAAC;AAEF,eAAe,UAAU,CAAC;AAE1B,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;mBACX,OAAO,CAAC,IAAI;aAClB,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI;;6BAEZ,KAAK,CAAC,OAAO,CAAC,KAAK;;IAE5C,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC;CAChD,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAM3B,CAAC;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAA;;;gBAGjB,OAAO,CAAC,KAAK;;aAEhB,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI;;CAEvC,CAAC;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;SAGrB,OAAO,CAAC,IAAI;;aAER,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI;CACxC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,OAAe,EACf,0BAAmC,EACnC,EAAE;IACF,MAAM,WAAW,GAAG,0BAA0B;QAC5C,CAAC,CAAC,IAAI,0BAA0B,EAAE;QAClC,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,0BAA0B,OAAO,IAAI,gBAAgB,GAAG,WAAW,EAAE,CAAC;AAC/E,CAAC,CAAC;AAEF,MAAM,gBAAgB,GACpB,iEAAiE,CAAC","sourcesContent":["import type { MouseEventHandler, ReactNode } from \"react\";\nimport styled from \"styled-components\";\nimport { Color, Spacing, Typography } from \"../atoms\";\nimport { applyTypography } from \"../integrations\";\nimport { Button } from \"../molecules\";\nimport { Modal } from \"../organisms\";\n\ntype TallyModalProps = {\n header?: ReactNode;\n tallyId: string;\n prefilledFieldsQueryParams?: string;\n onClickClose: MouseEventHandler<HTMLButtonElement>;\n};\n\nconst TallyModal = ({\n header,\n tallyId,\n prefilledFieldsQueryParams,\n onClickClose,\n}: TallyModalProps) => (\n <Modal width=\"640px\" height=\"600px\">\n {header ? <ModalHeader>{header}</ModalHeader> : <></>}\n\n <ModalBody>\n <ModalIframe\n src={constructIframeSrc(tallyId, prefilledFieldsQueryParams)}\n loading=\"lazy\"\n title=\"Tally Modal\"\n />\n </ModalBody>\n\n <ModalFooter>\n <Button\n label=\"Close\"\n onClick={onClickClose}\n variant=\"tertiary\"\n size=\"small\"\n />\n </ModalFooter>\n </Modal>\n);\n\nexport default TallyModal;\n\nconst ModalHeader = styled.div`\n margin-bottom: ${Spacing.px12};\n padding: ${Spacing.px12} ${Spacing.px20};\n\n border-bottom: 1px solid ${Color.neutral.grey3};\n\n ${applyTypography(Typography.subheading2Medium)}\n`;\n\nconst ModalBody = styled.div`\n display: flex;\n flex-direction: column;\n\n height: 100%;\n overflow-y: auto;\n`;\n\nconst ModalIframe = styled.iframe`\n width: 100%;\n height: 100%;\n min-height: ${Spacing.px100};\n\n padding: ${Spacing.px4} ${Spacing.px20};\n border: none;\n`;\n\nconst ModalFooter = styled.div`\n display: flex;\n justify-content: space-between;\n gap: ${Spacing.px12};\n\n padding: ${Spacing.px16} ${Spacing.px20};\n`;\n\nconst constructIframeSrc = (\n tallyId: string,\n prefilledFieldsQueryParams?: string,\n) => {\n const queryParams = prefilledFieldsQueryParams\n ? `&${prefilledFieldsQueryParams}`\n : \"\";\n\n return `https://tally.so/embed/${tallyId}?${tallyQueryParams}${queryParams}`;\n};\n\nconst tallyQueryParams =\n \"alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=0\";\n"]}
@@ -1,12 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/nextjs-vite";
2
- import { type ReactNode } from "react";
3
- type TallyModalExampleProps = {
4
- header?: ReactNode;
5
- tallyId: string;
6
- prefilledFieldsQueryParams?: string;
7
- };
8
- declare const TallyModalExample: (props: TallyModalExampleProps) => import("react").JSX.Element;
9
- declare const meta: Meta<typeof TallyModalExample>;
10
- export default meta;
11
- type Story = StoryObj<typeof meta>;
12
- export declare const Example: Story;
@@ -1,20 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, TallyModal, useModal } from "@/.";
3
- import {} from "react";
4
- const TallyModalExample = (props) => {
5
- const { isModalOpen, openModal, closeModal } = useModal();
6
- return (_jsxs(_Fragment, { children: [_jsx(Button, { label: "Click to open modal", onClick: () => openModal() }), isModalOpen ? (_jsx(TallyModal, { ...props, onClickClose: () => closeModal() })) : (_jsx(_Fragment, {}))] }));
7
- };
8
- const meta = {
9
- title: "Archive/Tally Modal",
10
- component: TallyModalExample,
11
- tags: ["autodocs"],
12
- };
13
- export default meta;
14
- export const Example = {
15
- args: {
16
- header: "Apply with us",
17
- tallyId: "3jAj5Q",
18
- },
19
- };
20
- //# sourceMappingURL=TallyModal.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TallyModal.stories.js","sourceRoot":"","sources":["../../../stories/archive/TallyModal.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAEnD,OAAO,EAAkB,MAAM,OAAO,CAAC;AAQvC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAE,EAAE;IAC1D,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,CAAC;IAE1D,OAAO,CACL,8BACE,KAAC,MAAM,IAAC,KAAK,EAAC,qBAAqB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,GAAI,EACjE,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,UAAU,OAAK,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,GAAI,CAC5D,CAAC,CAAC,CAAC,CACF,mBAAK,CACN,IACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,IAAI,GAAmC;IAC3C,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,iBAAiB;IAC5B,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,eAAe;QACvB,OAAO,EAAE,QAAQ;KAClB;CACF,CAAC","sourcesContent":["import { Button, TallyModal, useModal } from \"@/.\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\nimport { type ReactNode } from \"react\";\n\ntype TallyModalExampleProps = {\n header?: ReactNode;\n tallyId: string;\n prefilledFieldsQueryParams?: string;\n};\n\nconst TallyModalExample = (props: TallyModalExampleProps) => {\n const { isModalOpen, openModal, closeModal } = useModal();\n\n return (\n <>\n <Button label=\"Click to open modal\" onClick={() => openModal()} />\n {isModalOpen ? (\n <TallyModal {...props} onClickClose={() => closeModal()} />\n ) : (\n <></>\n )}\n </>\n );\n};\n\nconst meta: Meta<typeof TallyModalExample> = {\n title: \"Archive/Tally Modal\",\n component: TallyModalExample,\n tags: [\"autodocs\"],\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Example: Story = {\n args: {\n header: \"Apply with us\",\n tallyId: \"3jAj5Q\",\n },\n};\n"]}