@breadcoop/ui 1.0.25 → 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.
Files changed (108) hide show
  1. package/dist/chunk-FWCSY2DS.mjs +37 -0
  2. package/dist/components/LiftedButton/LiftedButton.d.mts +29 -0
  3. package/dist/components/LiftedButton/LiftedButton.mjs +149 -0
  4. package/dist/components/LiftedButton/LiftedButtonPresets.d.mts +55 -0
  5. package/dist/components/LiftedButton/LiftedButtonPresets.mjs +85 -0
  6. package/dist/components/LiftedButton/index.d.mts +2 -0
  7. package/dist/components/LiftedButton/index.mjs +0 -0
  8. package/dist/components/Logo/Logo.d.mts +29 -0
  9. package/dist/components/Logo/Logo.mjs +273 -0
  10. package/dist/components/Logo/index.d.mts +3 -0
  11. package/dist/components/Logo/index.mjs +5 -0
  12. package/dist/components/auth/button-shell.d.mts +5 -0
  13. package/dist/components/auth/button-shell.mjs +8 -0
  14. package/dist/components/auth/index.d.mts +5 -0
  15. package/dist/components/auth/index.mjs +5 -0
  16. package/dist/components/auth/login-button-general.d.mts +13 -0
  17. package/dist/components/auth/login-button-general.mjs +80 -0
  18. package/dist/components/auth/login-button-privy.d.mts +13 -0
  19. package/dist/components/auth/login-button-privy.mjs +64 -0
  20. package/dist/components/auth/login-button.d.mts +8 -0
  21. package/dist/components/auth/login-button.mjs +32 -0
  22. package/dist/components/buttons/button.d.mts +20 -0
  23. package/dist/components/buttons/button.mjs +93 -0
  24. package/dist/components/buttons/copy-icon.d.mts +10 -0
  25. package/dist/components/buttons/copy-icon.mjs +44 -0
  26. package/dist/components/buttons/index.d.mts +6 -0
  27. package/dist/components/buttons/index.mjs +7 -0
  28. package/dist/components/chip/chip.d.mts +12 -0
  29. package/dist/components/chip/chip.mjs +34 -0
  30. package/dist/components/connected-user/context.d.mts +14 -0
  31. package/dist/components/connected-user/context.mjs +22 -0
  32. package/dist/components/connected-user/index.d.mts +6 -0
  33. package/dist/components/connected-user/index.mjs +7 -0
  34. package/dist/components/connected-user/interface.d.mts +16 -0
  35. package/dist/components/connected-user/interface.mjs +0 -0
  36. package/dist/components/connected-user/privy-provider.d.mts +10 -0
  37. package/dist/components/connected-user/privy-provider.mjs +55 -0
  38. package/dist/components/connected-user/provider-general.d.mts +10 -0
  39. package/dist/components/connected-user/provider-general.mjs +38 -0
  40. package/dist/components/connected-user/provider.d.mts +9 -0
  41. package/dist/components/connected-user/provider.mjs +15 -0
  42. package/dist/components/footer/footer.d.mts +11 -0
  43. package/dist/components/footer/footer.mjs +222 -0
  44. package/dist/components/loading-icon.d.mts +9 -0
  45. package/dist/components/loading-icon.mjs +49 -0
  46. package/dist/components/navbar/account-menu.d.mts +15 -0
  47. package/dist/components/navbar/account-menu.mjs +48 -0
  48. package/dist/components/navbar/account-section.d.mts +14 -0
  49. package/dist/components/navbar/account-section.mjs +68 -0
  50. package/dist/components/navbar/account-widget-item.d.mts +12 -0
  51. package/dist/components/navbar/account-widget-item.mjs +21 -0
  52. package/dist/components/navbar/account-widget.d.mts +22 -0
  53. package/dist/components/navbar/account-widget.mjs +118 -0
  54. package/dist/components/navbar/index.d.mts +11 -0
  55. package/dist/components/navbar/index.mjs +10 -0
  56. package/dist/components/navbar/log-out.d.mts +7 -0
  57. package/dist/components/navbar/log-out.mjs +34 -0
  58. package/dist/components/navbar/navbar-menu.d.mts +12 -0
  59. package/dist/components/navbar/navbar-menu.mjs +57 -0
  60. package/dist/components/navbar/navbar.d.mts +25 -0
  61. package/dist/components/navbar/navbar.mjs +63 -0
  62. package/dist/components/navbar/solidarity-apps.d.mts +17 -0
  63. package/dist/components/navbar/solidarity-apps.mjs +167 -0
  64. package/dist/components/typography/Typography.d.mts +42 -0
  65. package/dist/components/typography/Typography.mjs +52 -0
  66. package/dist/components/typography/formatted-dec-num.d.mts +15 -0
  67. package/dist/components/typography/formatted-dec-num.mjs +40 -0
  68. package/dist/constansts/links.d.mts +26 -0
  69. package/dist/constansts/links.mjs +27 -0
  70. package/dist/constansts/tools.d.mts +23 -0
  71. package/dist/constansts/tools.mjs +52 -0
  72. package/dist/context/index.d.mts +5 -0
  73. package/dist/context/index.mjs +5 -0
  74. package/dist/context/lib.d.mts +31 -0
  75. package/dist/context/lib.mjs +33 -0
  76. package/dist/hooks/index.d.mts +4 -0
  77. package/dist/hooks/index.mjs +7 -0
  78. package/dist/hooks/use-auto-connect.d.mts +8 -0
  79. package/dist/hooks/use-auto-connect.mjs +39 -0
  80. package/dist/hooks/use-bread-balance.d.mts +13 -0
  81. package/dist/hooks/use-bread-balance.mjs +32 -0
  82. package/dist/hooks/use-copy-to-clipboard.d.mts +9 -0
  83. package/dist/hooks/use-copy-to-clipboard.mjs +26 -0
  84. package/dist/index.d.mts +33 -306
  85. package/dist/index.mjs +41 -1
  86. package/dist/interface/app.d.mts +3 -0
  87. package/dist/interface/app.mjs +0 -0
  88. package/dist/tailwind-preset.js +1 -0
  89. package/dist/theme.css +1 -0
  90. package/dist/utils/app.d.mts +19 -0
  91. package/dist/utils/app.mjs +21 -0
  92. package/dist/utils/cn.d.mts +5 -0
  93. package/dist/utils/cn.mjs +9 -0
  94. package/dist/utils/copy-to-clipboard.d.mts +3 -0
  95. package/dist/utils/copy-to-clipboard.mjs +10 -0
  96. package/dist/utils/cssValidation.d.mts +7 -0
  97. package/dist/utils/cssValidation.mjs +44 -0
  98. package/dist/utils/formatter.d.mts +3 -0
  99. package/dist/utils/formatter.mjs +13 -0
  100. package/dist/utils/index.d.mts +3 -0
  101. package/dist/utils/index.mjs +7 -0
  102. package/dist/utils/truncate-address.d.mts +3 -0
  103. package/dist/utils/truncate-address.mjs +5 -0
  104. package/package.json +10 -11
  105. package/tailwind-preset.js +1 -0
  106. package/theme.css +1 -0
  107. package/dist/index.d.ts +0 -306
  108. package/dist/index.js +0 -1
@@ -0,0 +1,167 @@
1
+ "use client";
2
+ import "../../chunk-FWCSY2DS.mjs";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import * as NavigationMenu from "@radix-ui/react-navigation-menu";
5
+ import { LINKS } from "../../constansts/links.mjs";
6
+ import { appsConfig } from "../../utils/app.mjs";
7
+ import { Body, Caption } from "../typography/Typography.mjs";
8
+ const _apps = [
9
+ {
10
+ id: "fund",
11
+ label: "Solidarity Fund",
12
+ desc: "Give without giving",
13
+ color: "text-[#EA5817]",
14
+ comingSoon: false,
15
+ webLink: LINKS.solidarityFund
16
+ },
17
+ {
18
+ id: "stacks",
19
+ label: "Stacks",
20
+ desc: "Stack money together.",
21
+ color: "text-[#1C5BB9]",
22
+ comingSoon: false,
23
+ webLink: LINKS.stacks
24
+ },
25
+ {
26
+ id: "net",
27
+ label: "Safety Net",
28
+ desc: "Cover each other.",
29
+ color: "text-[#286B63]",
30
+ comingSoon: true
31
+ }
32
+ ];
33
+ const AppPageContent = ({
34
+ app,
35
+ selected,
36
+ appConfig
37
+ }) => {
38
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
39
+ /* @__PURE__ */ jsx("span", { className: `mr-2 ${app.color}`, children: /* @__PURE__ */ jsx(AppSvg, {}) }),
40
+ /* @__PURE__ */ jsxs("div", { className: "mr-auto", children: [
41
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-start font-bold", children: [
42
+ /* @__PURE__ */ jsx(Body, { children: app.label }),
43
+ app.comingSoon && /* @__PURE__ */ jsx(Caption, { className: `text-xs ml-2 ${appConfig.text}`, children: "Coming soon" })
44
+ ] }),
45
+ /* @__PURE__ */ jsx(Body, { className: "font-light text-surface-grey-2", children: app.desc })
46
+ ] }),
47
+ selected && /* @__PURE__ */ jsx(Caption, { className: "font-bold text-system-green", children: "Selected" })
48
+ ] });
49
+ };
50
+ const NavSolidarityApps = ({
51
+ current = "stacks",
52
+ className = "",
53
+ showTitle,
54
+ showSelected,
55
+ rearranged
56
+ }) => {
57
+ const apps = rearranged ? [..._apps].sort((a, b) => {
58
+ if (a.id === current) return -1;
59
+ if (b.id === current) return 1;
60
+ return 0;
61
+ }) : [..._apps];
62
+ const appConfig = appsConfig[current];
63
+ return /* @__PURE__ */ jsxs("section", { className, children: [
64
+ showTitle && /* @__PURE__ */ jsx(Body, { className: "text-surface-grey mb-4", children: "Solidarity apps" }),
65
+ /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-2", children: [...apps].map((app) => {
66
+ const isLink = !app.comingSoon && app.webLink && current !== app.id;
67
+ return /* @__PURE__ */ jsx(
68
+ "li",
69
+ {
70
+ className: `${isLink ? "" : `flex items-center justify-start p-2.5 border ${current === app.id ? appConfig.border : "border-transparent"}`}`,
71
+ children: isLink ? /* @__PURE__ */ jsx(
72
+ "a",
73
+ {
74
+ href: app.webLink,
75
+ className: "flex items-center justify-start p-2.5 border border-transparent",
76
+ children: /* @__PURE__ */ jsx(
77
+ AppPageContent,
78
+ {
79
+ app,
80
+ selected: showSelected && current === app.id,
81
+ appConfig
82
+ }
83
+ )
84
+ }
85
+ ) : /* @__PURE__ */ jsx(
86
+ AppPageContent,
87
+ {
88
+ app,
89
+ selected: showSelected && current === app.id,
90
+ appConfig
91
+ }
92
+ )
93
+ },
94
+ app.id
95
+ );
96
+ }) })
97
+ ] });
98
+ };
99
+ const NavSolidarityAppsDesktop = ({
100
+ label,
101
+ app
102
+ }) => {
103
+ const appConfig = appsConfig[app];
104
+ return /* @__PURE__ */ jsxs(NavigationMenu.Root, { className: "hidden md:block md:mr-auto md:ml-2 relative", children: [
105
+ /* @__PURE__ */ jsx(NavigationMenu.List, { children: /* @__PURE__ */ jsxs(NavigationMenu.Item, { children: [
106
+ /* @__PURE__ */ jsx(NavigationMenu.Trigger, { className: "group", children: /* @__PURE__ */ jsxs(Body, { className: "md:text-surface-grey-2 md:inline-flex md:items-center md:justify-center md:gap-2 lg:text-2xl lg:mt-1", children: [
107
+ /* @__PURE__ */ jsx("span", { className: "capitalize", children: label }),
108
+ /* @__PURE__ */ jsx(
109
+ "span",
110
+ {
111
+ className: `transition-transform duration-300 group-data-[state=open]:rotate-180 md:mt-[-0.0625rem] lg:-mt-1 ${appConfig.text}`,
112
+ children: /* @__PURE__ */ jsx(Caret, {})
113
+ }
114
+ )
115
+ ] }) }),
116
+ /* @__PURE__ */ jsx(NavigationMenu.Content, { className: "w-80", children: /* @__PURE__ */ jsx("div", { className: "bg-paper-main border border-paper-2 overflow-hidden", children: /* @__PURE__ */ jsx(
117
+ NavSolidarityApps,
118
+ {
119
+ current: app,
120
+ className: "py-6 px-8"
121
+ }
122
+ ) }) })
123
+ ] }) }),
124
+ /* @__PURE__ */ jsx(NavigationMenu.Viewport, { className: "absolute left-0 top-full mt-2 z-50" })
125
+ ] });
126
+ };
127
+ const AppSvg = () => /* @__PURE__ */ jsx(
128
+ "svg",
129
+ {
130
+ width: "32",
131
+ height: "32",
132
+ viewBox: "0 0 32 32",
133
+ fill: "none",
134
+ xmlns: "http://www.w3.org/2000/svg",
135
+ children: /* @__PURE__ */ jsx(
136
+ "path",
137
+ {
138
+ d: "M16 0C24.8366 0 32 7.16335 32 16C32 24.8367 24.8366 32 16 32C7.16344 32 0 24.8367 0 16C4.9478e-05 7.16338 7.16347 4.22665e-05 16 0ZM19.7451 5.26758C16.7609 2.21844 11.5944 3.69932 11.2129 8.1084C10.7367 13.1418 7.08515 10.4095 4.37207 13.209C3.57018 14.1331 3.09185 15.4252 3.25195 16.6406C3.48647 18.3313 4.79986 19.7729 6.47461 20.1816C8.37936 20.6899 10.3536 20.4661 10.998 22.8066C11.3659 24.3564 11.24 25.7879 12.5215 26.9971C14.7593 29.1037 18.8138 28.8489 20.2656 26.001C20.7711 25.1101 20.8462 24.0581 21.0332 23.0723C21.2229 22.0263 21.8496 21.1879 22.834 20.8311C24.1704 20.3049 25.8365 20.3974 27.0664 19.5332C28.357 18.6609 29.0521 16.9949 28.8203 15.4639L28.8174 15.4482H28.8184C28.5649 13.7937 27.198 12.4124 25.6309 11.9238C24.7017 11.6137 23.6703 11.6362 22.7627 11.2588C21.9437 10.9468 21.3875 10.2654 21.1387 9.43262C20.7234 7.9545 20.9069 6.48575 19.7451 5.26758ZM15.3008 12.3789C18.4435 12.0374 20.5761 13.6659 20.0713 16.9531L20.0674 16.9697V16.9688C19.8051 18.4864 18.7559 19.4563 17.2539 19.6562C16.3436 19.7996 15.3079 19.7758 14.4111 19.5625C13.9216 19.4424 13.4732 19.2458 13.1143 18.959C11.872 17.921 11.6687 15.865 12.2539 14.3994C12.7551 13.1741 14.0057 12.5072 15.3008 12.3789Z",
139
+ fill: "currentcolor"
140
+ }
141
+ )
142
+ }
143
+ );
144
+ const Caret = () => /* @__PURE__ */ jsx(
145
+ "svg",
146
+ {
147
+ width: "24",
148
+ height: "24",
149
+ viewBox: "0 0 24 24",
150
+ fill: "none",
151
+ xmlns: "http://www.w3.org/2000/svg",
152
+ children: /* @__PURE__ */ jsx(
153
+ "path",
154
+ {
155
+ d: "M19.5 9L12 16.5L4.5 9",
156
+ stroke: "currentcolor",
157
+ strokeWidth: "1.5",
158
+ strokeLinecap: "round",
159
+ strokeLinejoin: "round"
160
+ }
161
+ )
162
+ }
163
+ );
164
+ export {
165
+ NavSolidarityApps,
166
+ NavSolidarityAppsDesktop
167
+ };
@@ -0,0 +1,42 @@
1
+ import React__default from 'react';
2
+
3
+ declare const fontVariables: {
4
+ readonly breadDisplay: "--font-breadDisplay";
5
+ readonly breadBody: "--font-breadBody";
6
+ };
7
+ declare const Typography: React__default.FC<{
8
+ variant: "h1" | "h2" | "h3" | "h4" | "h5" | "body" | "caption";
9
+ children: React__default.ReactNode;
10
+ className?: string;
11
+ }>;
12
+ declare const Heading1: React__default.FC<{
13
+ children: React__default.ReactNode;
14
+ className?: string;
15
+ }>;
16
+ declare const Heading2: React__default.FC<{
17
+ children: React__default.ReactNode;
18
+ className?: string;
19
+ }>;
20
+ declare const Heading3: React__default.FC<{
21
+ children: React__default.ReactNode;
22
+ className?: string;
23
+ }>;
24
+ declare const Heading4: React__default.FC<{
25
+ children: React__default.ReactNode;
26
+ className?: string;
27
+ }>;
28
+ declare const Heading5: React__default.FC<{
29
+ children: React__default.ReactNode;
30
+ className?: string;
31
+ }>;
32
+ declare const Body: React__default.FC<{
33
+ children: React__default.ReactNode;
34
+ className?: string;
35
+ bold?: boolean;
36
+ }>;
37
+ declare const Caption: React__default.FC<{
38
+ children: React__default.ReactNode;
39
+ className?: string;
40
+ }>;
41
+
42
+ export { Body, Caption, Heading1, Heading2, Heading3, Heading4, Heading5, Typography, fontVariables };
@@ -0,0 +1,52 @@
1
+ import "../../chunk-FWCSY2DS.mjs";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import React from "react";
4
+ const fontVariables = {
5
+ breadDisplay: "--font-breadDisplay",
6
+ breadBody: "--font-breadBody"
7
+ };
8
+ const Typography = ({ variant, children, className = "" }) => {
9
+ const baseClasses = ["h1", "h2", "h3"].includes(variant) ? "font-breadDisplay" : "font-breadBody";
10
+ const variantClasses = {
11
+ h1: "text-h1",
12
+ h2: "text-h2",
13
+ h3: "text-h3",
14
+ h4: "text-h4",
15
+ h5: "text-h5",
16
+ body: "text-body",
17
+ caption: "text-caption"
18
+ };
19
+ const Component = variant.startsWith("h") ? variant : "p";
20
+ return React.createElement(
21
+ Component,
22
+ {
23
+ className: `${baseClasses} ${variantClasses[variant]} ${className}`.trim()
24
+ },
25
+ children
26
+ );
27
+ };
28
+ const Heading1 = ({ children, className = "" }) => /* @__PURE__ */ jsx(Typography, { variant: "h1", className, children });
29
+ const Heading2 = ({ children, className = "" }) => /* @__PURE__ */ jsx(Typography, { variant: "h2", className, children });
30
+ const Heading3 = ({ children, className = "" }) => /* @__PURE__ */ jsx(Typography, { variant: "h3", className, children });
31
+ const Heading4 = ({ children, className = "" }) => /* @__PURE__ */ jsx(Typography, { variant: "h4", className, children });
32
+ const Heading5 = ({ children, className = "" }) => /* @__PURE__ */ jsx(Typography, { variant: "h5", className, children });
33
+ const Body = ({ children, className = "", bold = false }) => /* @__PURE__ */ jsx(
34
+ Typography,
35
+ {
36
+ variant: "body",
37
+ className: `${bold ? "text-body-bold" : ""} ${className}`.trim(),
38
+ children
39
+ }
40
+ );
41
+ const Caption = ({ children, className = "" }) => /* @__PURE__ */ jsx(Typography, { variant: "caption", className, children });
42
+ export {
43
+ Body,
44
+ Caption,
45
+ Heading1,
46
+ Heading2,
47
+ Heading3,
48
+ Heading4,
49
+ Heading5,
50
+ Typography,
51
+ fontVariables
52
+ };
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface FormattedDecimalNumberProps {
4
+ value: number | string;
5
+ className?: string;
6
+ integralPartClassName?: string;
7
+ decimalPartClassName?: string;
8
+ withBreadIcon?: boolean;
9
+ breadIconClassName?: string;
10
+ breadSize?: number;
11
+ unit?: string;
12
+ }
13
+ declare function FormattedDecimalNumber({ value, className, integralPartClassName, decimalPartClassName, withBreadIcon, breadIconClassName, breadSize, unit, }: FormattedDecimalNumberProps): react_jsx_runtime.JSX.Element;
14
+
15
+ export { FormattedDecimalNumber };
@@ -0,0 +1,40 @@
1
+ import "../../chunk-FWCSY2DS.mjs";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { cn } from "../../utils/index.mjs";
4
+ import { formatBalance } from "../../utils/formatter.mjs";
5
+ import { Logo } from "../Logo/index.mjs";
6
+ import { Body } from "./Typography.mjs";
7
+ function FormattedDecimalNumber({
8
+ value,
9
+ className,
10
+ integralPartClassName,
11
+ decimalPartClassName,
12
+ withBreadIcon,
13
+ breadIconClassName,
14
+ breadSize = 24,
15
+ unit = ""
16
+ }) {
17
+ const parsedValue = typeof value === "number" ? value : parseFloat(value);
18
+ const formattedValue = formatBalance(parsedValue, 2);
19
+ const [integerPart, decimalPart] = formattedValue.split(".");
20
+ return /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center justify-start gap-2", children: [
21
+ withBreadIcon && /* @__PURE__ */ jsx(Logo, { className: breadIconClassName, size: breadSize }),
22
+ /* @__PURE__ */ jsxs(
23
+ Body,
24
+ {
25
+ bold: true,
26
+ className: cn(withBreadIcon && "mt-[0.2rem]", className),
27
+ children: [
28
+ /* @__PURE__ */ jsx("span", { className: cn("text-base", integralPartClassName), children: `${unit}${integerPart}`.trim() }),
29
+ /* @__PURE__ */ jsxs("span", { className: cn("text-xs", decimalPartClassName), children: [
30
+ ".",
31
+ decimalPart
32
+ ] })
33
+ ]
34
+ }
35
+ )
36
+ ] });
37
+ }
38
+ export {
39
+ FormattedDecimalNumber
40
+ };
@@ -0,0 +1,26 @@
1
+ declare const LINKS: {
2
+ readonly contributorForm: "https://docs.google.com/forms/d/e/1FAIpQLSfOWubPChHH14LpV4GwgXrrot0Smqd1rmypN4MEULdw7n1o4g/viewform";
3
+ readonly dashboard: "https://dune.com/bread_cooperative/solidarity";
4
+ readonly discord: "https://discord.com/invite/zmNqsHRHDa";
5
+ readonly docs: "https://docs.bread.coop";
6
+ readonly docsBreadToken: "https://docs.bread.coop/bread-token/";
7
+ readonly docsManifesto: "https://docs.bread.coop/manifesto";
8
+ readonly docsHowToBecomeAMemberProject: "https://docs.bread.coop/how-to-become-a-member-project";
9
+ readonly docsVotingPower: "https://docs.bread.coop/voting-power";
10
+ readonly farcaster: "https://farcaster.xyz/~/channel/cryptoleft";
11
+ readonly giveth: "https://giveth.io/project/breadchain-cooperative";
12
+ readonly github: "http://github.com/BreadchainCoop";
13
+ readonly linkedin: "https://www.linkedin.com/company/bread-cooperative//";
14
+ readonly newsletter: "http://paragraph.com/@breadcoop";
15
+ readonly openCollective: "https://opencollective.com/bread-cooperative";
16
+ readonly postCapitalistIdea: "https://form.typeform.com/to/opwqWG8j";
17
+ readonly projectApplicationForm: "https://forms.gle/DeTETFxCxZbKRCzS7";
18
+ readonly solidarityFund: "https://fund.bread.coop";
19
+ readonly sourdoughSystems: "https://www.sourdough.systems/";
20
+ readonly stacks: "https://stacks.bread.coop";
21
+ readonly twitter: "https://x.com/breadcoop";
22
+ readonly youtube: "https://www.youtube.com/@BreadCooperative/";
23
+ };
24
+ type LinkKey = keyof typeof LINKS;
25
+
26
+ export { LINKS, type LinkKey };
@@ -0,0 +1,27 @@
1
+ import "../chunk-FWCSY2DS.mjs";
2
+ const LINKS = {
3
+ contributorForm: "https://docs.google.com/forms/d/e/1FAIpQLSfOWubPChHH14LpV4GwgXrrot0Smqd1rmypN4MEULdw7n1o4g/viewform",
4
+ dashboard: "https://dune.com/bread_cooperative/solidarity",
5
+ discord: "https://discord.com/invite/zmNqsHRHDa",
6
+ docs: "https://docs.bread.coop",
7
+ docsBreadToken: "https://docs.bread.coop/bread-token/",
8
+ docsManifesto: "https://docs.bread.coop/manifesto",
9
+ docsHowToBecomeAMemberProject: "https://docs.bread.coop/how-to-become-a-member-project",
10
+ docsVotingPower: "https://docs.bread.coop/voting-power",
11
+ farcaster: "https://farcaster.xyz/~/channel/cryptoleft",
12
+ giveth: "https://giveth.io/project/breadchain-cooperative",
13
+ github: "http://github.com/BreadchainCoop",
14
+ linkedin: "https://www.linkedin.com/company/bread-cooperative//",
15
+ newsletter: "http://paragraph.com/@breadcoop",
16
+ openCollective: "https://opencollective.com/bread-cooperative",
17
+ postCapitalistIdea: "https://form.typeform.com/to/opwqWG8j",
18
+ projectApplicationForm: "https://forms.gle/DeTETFxCxZbKRCzS7",
19
+ solidarityFund: "https://fund.bread.coop",
20
+ sourdoughSystems: "https://www.sourdough.systems/",
21
+ stacks: "https://stacks.bread.coop",
22
+ twitter: "https://x.com/breadcoop",
23
+ youtube: "https://www.youtube.com/@BreadCooperative/"
24
+ };
25
+ export {
26
+ LINKS
27
+ };
@@ -0,0 +1,23 @@
1
+ import { LogoColor } from '../components/Logo/Logo.mjs';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
4
+
5
+ interface SolidarityTool {
6
+ id: string;
7
+ title: string;
8
+ shortDescription: string;
9
+ description: string;
10
+ color: LogoColor;
11
+ buttonClass: string;
12
+ colorOverrides?: {
13
+ bg: string;
14
+ hoverBg: string;
15
+ };
16
+ webLink?: string;
17
+ comingSoon: boolean;
18
+ }
19
+ declare const SOLIDARITY_TOOLS: SolidarityTool[];
20
+ declare function getSolidarityToolsByIds(ids: string[]): SolidarityTool[];
21
+ declare function getVisibleSolidarityTools(hiddenIds?: string[]): SolidarityTool[];
22
+
23
+ export { SOLIDARITY_TOOLS, type SolidarityTool, getSolidarityToolsByIds, getVisibleSolidarityTools };
@@ -0,0 +1,52 @@
1
+ import "../chunk-FWCSY2DS.mjs";
2
+ import { LINKS } from "./links.mjs";
3
+ const SOLIDARITY_TOOLS = [
4
+ {
5
+ id: "solidarity-fund",
6
+ title: "Solidarity Fund",
7
+ shortDescription: "Give without giving",
8
+ description: "Community coming together to fund what matters to us. Bake $BREAD and support projects you believe in.",
9
+ color: "orange",
10
+ buttonClass: "bg-primary-orange text-white",
11
+ webLink: LINKS.solidarityFund,
12
+ comingSoon: false
13
+ },
14
+ {
15
+ id: "stacks",
16
+ title: "Stacks",
17
+ shortDescription: "Save money together.",
18
+ description: "Financial goals. Achieved together.",
19
+ color: "blue",
20
+ buttonClass: "",
21
+ colorOverrides: {
22
+ bg: "--color-primary-blue",
23
+ hoverBg: "--color-blue-2"
24
+ },
25
+ webLink: LINKS.stacks,
26
+ comingSoon: false
27
+ },
28
+ {
29
+ id: "safety-net",
30
+ title: "Safety Net",
31
+ shortDescription: "Cover each other.",
32
+ description: "Collective support guides us through crisis. Build emergency funds with people you trust.",
33
+ color: "jade",
34
+ buttonClass: "",
35
+ colorOverrides: {
36
+ bg: "--color-primary-jade",
37
+ hoverBg: "--color-jade-2"
38
+ },
39
+ comingSoon: true
40
+ }
41
+ ];
42
+ function getSolidarityToolsByIds(ids) {
43
+ return SOLIDARITY_TOOLS.filter((tool) => ids.includes(tool.id));
44
+ }
45
+ function getVisibleSolidarityTools(hiddenIds = []) {
46
+ return SOLIDARITY_TOOLS.filter((tool) => !hiddenIds.includes(tool.id));
47
+ }
48
+ export {
49
+ SOLIDARITY_TOOLS,
50
+ getSolidarityToolsByIds,
51
+ getVisibleSolidarityTools
52
+ };
@@ -0,0 +1,5 @@
1
+ export { BreadUIKitProvider } from './lib.mjs';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
4
+ import 'viem';
5
+ import '../interface/app.mjs';
@@ -0,0 +1,5 @@
1
+ import "../chunk-FWCSY2DS.mjs";
2
+ import { BreadUIKitProvider } from "./lib.mjs";
3
+ export {
4
+ BreadUIKitProvider
5
+ };
@@ -0,0 +1,31 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { ReactNode } from 'react';
4
+ import { Address, Abi } from 'viem';
5
+ import { App } from '../interface/app.mjs';
6
+
7
+ type AuthProvider = "privy" | "general";
8
+ type TokenConfig = {
9
+ BREAD: {
10
+ address: Address;
11
+ abi: Abi;
12
+ };
13
+ };
14
+ type BreadUIKitContextType = {
15
+ chainId: number;
16
+ tokenConfig: TokenConfig;
17
+ app: App;
18
+ authProvider: AuthProvider;
19
+ };
20
+ declare const BreadUIKitContext: React.Context<BreadUIKitContextType | undefined>;
21
+ declare const BreadUIKitProvider: ({ chainId, tokenConfig, children, app, authProvider, }: {
22
+ chainId: number;
23
+ tokenConfig: TokenConfig;
24
+ app: App;
25
+ authProvider: AuthProvider;
26
+ children: ReactNode;
27
+ }) => react_jsx_runtime.JSX.Element;
28
+ declare const useBreadUIKitContext: () => BreadUIKitContextType;
29
+ declare const useAuthProvider: () => AuthProvider;
30
+
31
+ export { BreadUIKitContext, BreadUIKitProvider, useAuthProvider, useBreadUIKitContext };
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ import "../chunk-FWCSY2DS.mjs";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { createContext, useContext } from "react";
5
+ const BreadUIKitContext = createContext(void 0);
6
+ const BreadUIKitProvider = ({
7
+ chainId,
8
+ tokenConfig,
9
+ children,
10
+ app,
11
+ authProvider
12
+ }) => {
13
+ return /* @__PURE__ */ jsx(BreadUIKitContext.Provider, { value: { chainId, tokenConfig, app, authProvider }, children });
14
+ };
15
+ const useBreadUIKitContext = () => {
16
+ const context = useContext(BreadUIKitContext);
17
+ if (!context) {
18
+ throw new Error(
19
+ "useBreadUIKitContext must be used within a BreadUIKitProvider"
20
+ );
21
+ }
22
+ return context;
23
+ };
24
+ const useAuthProvider = () => {
25
+ const context = useBreadUIKitContext();
26
+ return context.authProvider;
27
+ };
28
+ export {
29
+ BreadUIKitContext,
30
+ BreadUIKitProvider,
31
+ useAuthProvider,
32
+ useBreadUIKitContext
33
+ };
@@ -0,0 +1,4 @@
1
+ export { useBreadBalance } from './use-bread-balance.mjs';
2
+ export { useCopyToClipboard } from './use-copy-to-clipboard.mjs';
3
+ import 'viem';
4
+ import '@tanstack/query-core';
@@ -0,0 +1,7 @@
1
+ import "../chunk-FWCSY2DS.mjs";
2
+ import { useBreadBalance } from "./use-bread-balance.mjs";
3
+ import { useCopyToClipboard } from "./use-copy-to-clipboard.mjs";
4
+ export {
5
+ useBreadBalance,
6
+ useCopyToClipboard
7
+ };
@@ -0,0 +1,8 @@
1
+ import { Connector } from 'wagmi';
2
+
3
+ declare function useAutoConnect(activeConnector: Connector | undefined): {
4
+ isSafe: boolean;
5
+ isConnected: boolean;
6
+ };
7
+
8
+ export { useAutoConnect };
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import "../chunk-FWCSY2DS.mjs";
3
+ import { useConnect, useDisconnect } from "wagmi";
4
+ import { useEffect, useState } from "react";
5
+ const AUTOCONNECTED_CONNECTOR_IDS = ["safe"];
6
+ function useAutoConnect(activeConnector) {
7
+ const { connect, connectors } = useConnect();
8
+ const { disconnect } = useDisconnect();
9
+ const [safeConnectorPresent, setSafeConnectorPresent] = useState(false);
10
+ const [safeConnectorConnected, setSafeConnectorConnected] = useState(false);
11
+ useEffect(() => {
12
+ AUTOCONNECTED_CONNECTOR_IDS.forEach((connector) => {
13
+ const connectorInstance = connectors.find(
14
+ (c) => c.id === connector && c.ready
15
+ );
16
+ if (connectorInstance) setSafeConnectorPresent(true);
17
+ if (connectorInstance && !activeConnector) {
18
+ connect({ connector: connectorInstance });
19
+ setSafeConnectorConnected(true);
20
+ }
21
+ });
22
+ }, [connect, connectors, disconnect, activeConnector]);
23
+ useEffect(() => {
24
+ if (safeConnectorPresent && !safeConnectorConnected && activeConnector)
25
+ disconnect();
26
+ }, [
27
+ safeConnectorPresent,
28
+ safeConnectorConnected,
29
+ activeConnector,
30
+ disconnect
31
+ ]);
32
+ return {
33
+ isSafe: safeConnectorPresent,
34
+ isConnected: safeConnectorConnected
35
+ };
36
+ }
37
+ export {
38
+ useAutoConnect
39
+ };
@@ -0,0 +1,13 @@
1
+ import * as viem from 'viem';
2
+ import { Address } from 'viem';
3
+ import * as _tanstack_query_core from '@tanstack/query-core';
4
+
5
+ declare const useBreadBalance: ({ address }: {
6
+ address: Address;
7
+ }) => {
8
+ BREAD: string;
9
+ refetchBalance: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, viem.ReadContractErrorType>>;
10
+ isLoading: boolean;
11
+ };
12
+
13
+ export { useBreadBalance };
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import "../chunk-FWCSY2DS.mjs";
3
+ import { formatUnits } from "viem";
4
+ import { useBlock, useReadContract } from "wagmi";
5
+ import { useBreadUIKitContext } from "../context/lib.mjs";
6
+ import { useEffect, useMemo } from "react";
7
+ const useBreadBalance = ({ address }) => {
8
+ const { tokenConfig, chainId } = useBreadUIKitContext();
9
+ const { data: blockNumber } = useBlock({ watch: true, chainId });
10
+ const {
11
+ data: balance,
12
+ refetch: refetchBalance,
13
+ isLoading
14
+ } = useReadContract({
15
+ address: tokenConfig.BREAD.address,
16
+ abi: tokenConfig.BREAD.abi,
17
+ functionName: "balanceOf",
18
+ args: [address],
19
+ chainId
20
+ });
21
+ useEffect(() => {
22
+ refetchBalance();
23
+ }, [blockNumber]);
24
+ const BREAD = useMemo(() => {
25
+ if (!balance) return "0.00";
26
+ return formatUnits(balance, 18);
27
+ }, [balance]);
28
+ return { BREAD, refetchBalance, isLoading };
29
+ };
30
+ export {
31
+ useBreadBalance
32
+ };
@@ -0,0 +1,9 @@
1
+ interface UseCopyToClipboardPayload {
2
+ textToCopy: string;
3
+ }
4
+ declare const useCopyToClipboard: ({ textToCopy, }: UseCopyToClipboardPayload) => {
5
+ copied: boolean;
6
+ copy: () => Promise<void>;
7
+ };
8
+
9
+ export { type UseCopyToClipboardPayload, useCopyToClipboard };