@grantbii/design-system 1.19.4 → 1.19.6
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/core/atoms/Typography.d.ts +0 -1
- package/core/atoms/Typography.js +19 -20
- package/core/atoms/Typography.js.map +1 -1
- package/core/integrations/typography.js +0 -2
- package/core/integrations/typography.js.map +1 -1
- package/core/molecules/Button.d.ts +2 -3
- package/core/molecules/Button.js +1 -6
- package/core/molecules/Button.js.map +1 -1
- package/core/organisms/Modal.js +1 -1
- package/core/organisms/Modal.js.map +1 -1
- package/core/organisms/index.d.ts +0 -1
- package/core/organisms/index.js +0 -1
- package/core/organisms/index.js.map +1 -1
- package/core/{organisms → templates}/GrantMatch/ActiveQueryFiles.js.map +1 -1
- package/core/{organisms → templates}/GrantMatch/GrantMatchModal.js +1 -1
- package/core/templates/GrantMatch/GrantMatchModal.js.map +1 -0
- package/core/{organisms → templates}/GrantMatch/SearchBar.js +31 -34
- package/core/templates/GrantMatch/SearchBar.js.map +1 -0
- package/core/{organisms → templates}/GrantMatch/context.js.map +1 -1
- package/core/{organisms → templates}/GrantMatch/index.js +10 -4
- package/core/templates/GrantMatch/index.js.map +1 -0
- package/core/templates/index.d.ts +1 -0
- package/core/templates/index.js +1 -0
- package/core/templates/index.js.map +1 -1
- package/package.json +2 -2
- package/stories/molecules/Button.stories.js +7 -7
- package/stories/molecules/Button.stories.js.map +1 -1
- package/stories/{organisms → templates}/GrantMatch.stories.js +2 -2
- package/stories/{organisms → templates}/GrantMatch.stories.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/core/organisms/GrantMatch/GrantMatchModal.js.map +0 -1
- package/core/organisms/GrantMatch/SearchBar.js.map +0 -1
- package/core/organisms/GrantMatch/index.js.map +0 -1
- /package/core/{organisms → templates}/GrantMatch/ActiveQueryFiles.d.ts +0 -0
- /package/core/{organisms → templates}/GrantMatch/ActiveQueryFiles.js +0 -0
- /package/core/{organisms → templates}/GrantMatch/GrantMatchModal.d.ts +0 -0
- /package/core/{organisms → templates}/GrantMatch/SearchBar.d.ts +0 -0
- /package/core/{organisms → templates}/GrantMatch/context.d.ts +0 -0
- /package/core/{organisms → templates}/GrantMatch/context.js +0 -0
- /package/core/{organisms → templates}/GrantMatch/index.d.ts +0 -0
- /package/stories/{organisms → templates}/GrantMatch.stories.d.ts +0 -0
|
@@ -18,7 +18,7 @@ export const Primary = {
|
|
|
18
18
|
export const DisabledPrimary = {
|
|
19
19
|
args: {
|
|
20
20
|
onClick,
|
|
21
|
-
label: "Primary
|
|
21
|
+
label: "Primary",
|
|
22
22
|
variant: "primary",
|
|
23
23
|
Icon: SystemIcon.PlusIcon,
|
|
24
24
|
disabled: true,
|
|
@@ -35,7 +35,7 @@ export const Secondary = {
|
|
|
35
35
|
export const DisabledSecondary = {
|
|
36
36
|
args: {
|
|
37
37
|
onClick,
|
|
38
|
-
label: "Secondary
|
|
38
|
+
label: "Secondary",
|
|
39
39
|
variant: "secondary",
|
|
40
40
|
Icon: SystemIcon.PlusIcon,
|
|
41
41
|
disabled: true,
|
|
@@ -52,7 +52,7 @@ export const Tertiary = {
|
|
|
52
52
|
export const DisabledTertiary = {
|
|
53
53
|
args: {
|
|
54
54
|
onClick,
|
|
55
|
-
label: "Tertiary
|
|
55
|
+
label: "Tertiary",
|
|
56
56
|
variant: "tertiary",
|
|
57
57
|
Icon: SystemIcon.PlusIcon,
|
|
58
58
|
disabled: true,
|
|
@@ -69,7 +69,7 @@ export const Outline = {
|
|
|
69
69
|
export const DisabledOutline = {
|
|
70
70
|
args: {
|
|
71
71
|
onClick,
|
|
72
|
-
label: "Outline
|
|
72
|
+
label: "Outline",
|
|
73
73
|
variant: "outline",
|
|
74
74
|
Icon: SystemIcon.PlusIcon,
|
|
75
75
|
disabled: true,
|
|
@@ -86,7 +86,7 @@ export const Ghost = {
|
|
|
86
86
|
export const DisabledGhost = {
|
|
87
87
|
args: {
|
|
88
88
|
onClick,
|
|
89
|
-
label: "Ghost
|
|
89
|
+
label: "Ghost",
|
|
90
90
|
variant: "ghost",
|
|
91
91
|
Icon: SystemIcon.PlusIcon,
|
|
92
92
|
disabled: true,
|
|
@@ -98,7 +98,7 @@ export const Text = {
|
|
|
98
98
|
export const DisabledText = {
|
|
99
99
|
args: {
|
|
100
100
|
onClick,
|
|
101
|
-
label: "Text
|
|
101
|
+
label: "Text",
|
|
102
102
|
variant: "text",
|
|
103
103
|
Icon: SystemIcon.PlusIcon,
|
|
104
104
|
disabled: true,
|
|
@@ -115,7 +115,7 @@ export const Danger = {
|
|
|
115
115
|
export const DisabledDanger = {
|
|
116
116
|
args: {
|
|
117
117
|
onClick,
|
|
118
|
-
label: "Danger
|
|
118
|
+
label: "Danger",
|
|
119
119
|
variant: "danger",
|
|
120
120
|
Icon: SystemIcon.PlusIcon,
|
|
121
121
|
disabled: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../stories/molecules/Button.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAGhD,MAAM,IAAI,GAAwB;IAChC,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO;QACP,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,UAAU,CAAC,QAAQ;KAC1B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAU;IACpC,IAAI,EAAE;QACJ,OAAO;QACP,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Button.stories.js","sourceRo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AAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,OAAO;QACP,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,UAAU,CAAC,QAAQ;QACzB,SAAS,EAAE,IAAI;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE;CAC7C,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,KAAK,EAAE,oBAAoB;QAC3B,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE,QAAQ;KACjB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE;QACJ,KAAK,EAAE,oBAAoB;QAC3B,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,IAAI;KACf;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,IAAI,EAAE;QACJ,OAAO;QACP,KAAK,EAAE,CACL,2BACE,KAAC,KAAK,CAAC,EAAE,IAAC,KAAK,EAAE,EAAE,GAAI,kBAClB,CACR;QACD,OAAO,EAAE,SAAS;KACnB;CACF,CAAC","sourcesContent":["import { Button, SystemIcon, Flags } from \"@/.\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof Button> = {\n title: \"Molecules/Button\",\n component: Button,\n tags: [\"autodocs\"],\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nconst onClick = () => alert(\"Button Clicked\");\n\nexport const Primary: Story = {\n args: {\n onClick,\n label: \"Primary\",\n variant: \"primary\",\n Icon: SystemIcon.PlusIcon,\n },\n};\n\nexport const DisabledPrimary: Story = {\n args: {\n onClick,\n label: \"Primary\",\n variant: \"primary\",\n Icon: SystemIcon.PlusIcon,\n disabled: true,\n },\n};\n\nexport const Secondary: Story = {\n args: {\n onClick,\n label: \"Secondary\",\n variant: \"secondary\",\n Icon: SystemIcon.PlusIcon,\n },\n};\n\nexport const DisabledSecondary: Story = {\n args: {\n onClick,\n label: \"Secondary\",\n variant: \"secondary\",\n Icon: SystemIcon.PlusIcon,\n disabled: true,\n },\n};\n\nexport const Tertiary: Story = {\n args: {\n onClick,\n label: \"Tertiary\",\n variant: \"tertiary\",\n Icon: SystemIcon.PlusIcon,\n },\n};\n\nexport const DisabledTertiary: Story = {\n args: {\n onClick,\n label: \"Tertiary\",\n variant: \"tertiary\",\n Icon: SystemIcon.PlusIcon,\n disabled: true,\n },\n};\n\nexport const Outline: Story = {\n args: {\n onClick,\n label: \"Outline\",\n variant: \"outline\",\n Icon: SystemIcon.PlusIcon,\n },\n};\n\nexport const DisabledOutline: Story = {\n args: {\n onClick,\n label: \"Outline\",\n variant: \"outline\",\n Icon: SystemIcon.PlusIcon,\n disabled: true,\n },\n};\n\nexport const Ghost: Story = {\n args: {\n onClick,\n label: \"Ghost\",\n variant: \"ghost\",\n Icon: SystemIcon.PlusIcon,\n },\n};\n\nexport const DisabledGhost: Story = {\n args: {\n onClick,\n label: \"Ghost\",\n variant: \"ghost\",\n Icon: SystemIcon.PlusIcon,\n disabled: true,\n },\n};\n\nexport const Text: Story = {\n args: { onClick, label: \"Text\", variant: \"text\", Icon: SystemIcon.PlusIcon },\n};\n\nexport const DisabledText: Story = {\n args: {\n onClick,\n label: \"Text\",\n variant: \"text\",\n Icon: SystemIcon.PlusIcon,\n disabled: true,\n },\n};\n\nexport const Danger: Story = {\n args: {\n onClick,\n label: \"Danger\",\n variant: \"danger\",\n Icon: SystemIcon.PlusIcon,\n },\n};\n\nexport const DisabledDanger: Story = {\n args: {\n onClick,\n label: \"Danger\",\n variant: \"danger\",\n Icon: SystemIcon.PlusIcon,\n disabled: true,\n },\n};\n\nexport const Small: Story = {\n args: { onClick, label: \"Small\", size: \"small\", Icon: SystemIcon.PlusIcon },\n};\n\nexport const Medium: Story = {\n args: { onClick, label: \"Medium\", size: \"medium\", Icon: SystemIcon.PlusIcon },\n};\n\nexport const Large: Story = {\n args: { onClick, label: \"Large\", size: \"large\", Icon: SystemIcon.PlusIcon },\n};\n\nexport const TextOnly: Story = {\n args: { onClick, label: \"Text Only\" },\n};\n\nexport const LeftIcon: Story = {\n args: {\n onClick,\n label: \"Left Icon\",\n Icon: SystemIcon.PlusIcon,\n iconRight: false,\n },\n};\n\nexport const RightIcon: Story = {\n args: {\n onClick,\n label: \"Right Icon\",\n Icon: SystemIcon.PlusIcon,\n iconRight: true,\n },\n};\n\nexport const ActionIcon: Story = {\n args: { onClick, Icon: SystemIcon.PlusIcon },\n};\n\nexport const WithHref: Story = {\n args: {\n label: \"Opens grantbii.com\",\n href: \"https://grantbii.com\",\n target: \"_blank\",\n },\n};\n\nexport const HrefDisabled: Story = {\n args: {\n label: \"Opens grantbii.com\",\n href: \"https://grantbii.com\",\n target: \"_blank\",\n disabled: true,\n },\n};\n\nexport const CustomLabel: Story = {\n args: {\n onClick,\n label: (\n <span>\n <Flags.SG width={20} /> Singapore\n </span>\n ),\n variant: \"outline\",\n },\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { GrantMatch } from "@/.";
|
|
3
|
-
import { useGrantMatchActiveQuery } from "@/core/
|
|
3
|
+
import { useGrantMatchActiveQuery } from "@/core/templates/GrantMatch";
|
|
4
4
|
import {} from "@grantbii/ui-core/match/entities";
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import styled from "styled-components";
|
|
@@ -24,7 +24,7 @@ const Container = styled.div `
|
|
|
24
24
|
padding: 16px;
|
|
25
25
|
`;
|
|
26
26
|
const meta = {
|
|
27
|
-
title: "
|
|
27
|
+
title: "Templates/Grant Match",
|
|
28
28
|
component: GrantMatchExample,
|
|
29
29
|
tags: ["autodocs"],
|
|
30
30
|
parameters: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GrantMatch.stories.js","sourceRoot":"","sources":["../../../stories/
|
|
1
|
+
{"version":3,"file":"GrantMatch.stories.js","sourceRoot":"","sources":["../../../stories/templates/GrantMatch.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAwB,MAAM,kCAAkC,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AASvC,MAAM,iBAAiB,GAAG,CAAC,SAAoB,EAAE,EAAE;IACjD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IAEtD,MAAM,iBAAiB,GAAG,CAAC,QAAyB,EAAE,EAAE;QACtD,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrE,MAAM,cAAc,GAAG,UAAU,SAAS,eAAe,QAAQ,CAAC,IAAI,GAAG,CAAC;QAE1E,SAAS,CAAC,+BAA+B,cAAc,EAAE,CAAC,CAAC;QAC3D,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,qBAAqB,cAAc,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAEzD,MAAM,oBAAoB,GAAG,wBAAwB,CACnD,iBAAiB,EACjB,eAAe,CAChB,CAAC;IAEF,OAAO,CACL,MAAC,SAAS,eACR,KAAC,UAAU,OAAK,oBAAoB,KAAM,SAAS,GAAI,EACvD,oCAAY,MAAM,IAAK,IACb,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAM3B,CAAC;AAEF,MAAM,IAAI,GAAmC;IAC3C,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,iBAAiB;IAC5B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,cAAc,GAAU;IACnC,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAU;IAClC,IAAI,EAAE;QACJ,kBAAkB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC;QACpD,kBAAkB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC;QACtD,kBAAkB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC;QAChD,iBAAiB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC;KAChD;CACF,CAAC","sourcesContent":["import { GrantMatch } from \"@/.\";\nimport { useGrantMatchActiveQuery } from \"@/core/templates/GrantMatch\";\nimport { type GrantMatchQuery } from \"@grantbii/ui-core/match/entities\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\nimport { useState } from \"react\";\nimport styled from \"styled-components\";\n\ntype Callbacks = {\n textSearchCallback?: () => void;\n findGrantsCallback?: () => void;\n closeModalCallback?: () => void;\n openModalCallback?: () => void;\n};\n\nconst GrantMatchExample = (callbacks: Callbacks) => {\n const [status, setStatus] = useState(\"pending query\");\n\n const performGrantMatch = (newQuery: GrantMatchQuery) => {\n const fileNames = newQuery.files.map((file) => file.name).join(\", \");\n const printableQuery = `files [${fileNames}] and text [${newQuery.text}]`;\n\n setStatus(`trying to find grants using ${printableQuery}`);\n setTimeout(() => setStatus(`found grants with ${printableQuery}`), 1000);\n };\n\n const resetGrantMatch = () => setStatus(\"pending query\");\n\n const grantMatchQueryProps = useGrantMatchActiveQuery(\n performGrantMatch,\n resetGrantMatch,\n );\n\n return (\n <Container>\n <GrantMatch {...grantMatchQueryProps} {...callbacks} />\n <p>Status: {status}</p>\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n padding: 16px;\n`;\n\nconst meta: Meta<typeof GrantMatchExample> = {\n title: \"Templates/Grant Match\",\n component: GrantMatchExample,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"fullscreen\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const DefaultExample: Story = {\n args: {},\n};\n\nexport const WithCallbacks: Story = {\n args: {\n textSearchCallback: () => alert(\"doing text search\"),\n findGrantsCallback: () => alert(\"finding your grants\"),\n closeModalCallback: () => alert(\"closing modal\"),\n openModalCallback: () => alert(\"opening modal\"),\n },\n};\n"]}
|