@breadcoop/ui 1.0.28 → 2.0.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.
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 +98 -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 -304
  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 +9 -10
  105. package/tailwind-preset.js +1 -0
  106. package/theme.css +1 -0
  107. package/dist/index.d.ts +0 -304
  108. package/dist/index.js +0 -1
@@ -0,0 +1,37 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
33
+ export {
34
+ __spreadValues,
35
+ __spreadProps,
36
+ __objRest
37
+ };
@@ -0,0 +1,29 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import { LiftedButtonPreset, LiftedButtonColors } from './LiftedButtonPresets.mjs';
4
+
5
+ type LiftedButtonProps = {
6
+ children: React__default.ReactNode;
7
+ leftIcon?: React__default.ReactNode;
8
+ rightIcon?: React__default.ReactNode;
9
+ disabled?: boolean;
10
+ preset?: LiftedButtonPreset;
11
+ colorOverrides?: Partial<LiftedButtonColors>;
12
+ offsetPx?: number;
13
+ durationMs?: number;
14
+ className?: string;
15
+ width?: "full" | "auto" | "mobile-full";
16
+ scrollTo?: string;
17
+ } & React__default.ComponentPropsWithoutRef<"button">;
18
+ /**
19
+ * LiftedButton — a square-edged button that floats up-left of a dark base layer.
20
+ * - Preset: Choose "primary" (default), "secondary", "destructive", or "positive"
21
+ * - ColorOverrides: Pass in a dict specifying manual colours
22
+ * - Hover: fades to alternate colors.
23
+ * - Active: depresses button and colors return to normal.
24
+ * - Transition duration defaults to 500ms.
25
+ * - Icons can be rendered on the right or left.
26
+ */
27
+ declare function LiftedButton({ children, leftIcon, rightIcon, disabled, preset, colorOverrides, offsetPx, durationMs, className, type, width, scrollTo, ...rest }: LiftedButtonProps): react_jsx_runtime.JSX.Element;
28
+
29
+ export { type LiftedButtonProps, LiftedButton as default };
@@ -0,0 +1,149 @@
1
+ "use client";
2
+ import {
3
+ __objRest,
4
+ __spreadProps,
5
+ __spreadValues
6
+ } from "../../chunk-FWCSY2DS.mjs";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import React from "react";
9
+ import {
10
+ LIFTED_BUTTON_PRESETS,
11
+ colorsToStyleVars
12
+ } from "./LiftedButtonPresets.mjs";
13
+ import { validateCSSVariables } from "../../utils/cssValidation.mjs";
14
+ const cloneWithClasses = (element, additionalClasses) => {
15
+ if (React.isValidElement(element)) {
16
+ const existingClassName = element.props.className || "";
17
+ const newClassName = `${existingClassName} ${additionalClasses}`.trim();
18
+ return React.cloneElement(element, {
19
+ className: newClassName
20
+ });
21
+ }
22
+ return element;
23
+ };
24
+ function LiftedButton(_a) {
25
+ var _b = _a, {
26
+ children,
27
+ leftIcon,
28
+ rightIcon,
29
+ disabled = false,
30
+ preset = "primary",
31
+ colorOverrides = {},
32
+ offsetPx = 4,
33
+ durationMs = 300,
34
+ className = "",
35
+ type = "button",
36
+ width = "auto",
37
+ scrollTo
38
+ } = _b, rest = __objRest(_b, [
39
+ "children",
40
+ "leftIcon",
41
+ "rightIcon",
42
+ "disabled",
43
+ "preset",
44
+ "colorOverrides",
45
+ "offsetPx",
46
+ "durationMs",
47
+ "className",
48
+ "type",
49
+ "width",
50
+ "scrollTo"
51
+ ]);
52
+ React.useEffect(() => {
53
+ validateCSSVariables();
54
+ }, []);
55
+ const base = LIFTED_BUTTON_PRESETS[preset];
56
+ const mergedColors = __spreadValues(__spreadValues({}, base), colorOverrides);
57
+ const styleVars = __spreadProps(__spreadValues({}, colorsToStyleVars(mergedColors)), {
58
+ ["--btn-offset"]: `${offsetPx}px`,
59
+ ["--btn-duration"]: `${durationMs}ms`
60
+ });
61
+ const baseClassNames = [
62
+ "lifted-button-base",
63
+ width === "full" ? "w-full" : "",
64
+ width === "mobile-full" ? "w-full xl:w-auto" : ""
65
+ ];
66
+ const getPresetClass = () => {
67
+ return "lifted-button";
68
+ };
69
+ const activeClassNames = [
70
+ getPresetClass(),
71
+ // motion
72
+ "lifted-button-motion",
73
+ // lifted offset
74
+ "lifted-button-lifted",
75
+ // depress to base on active
76
+ "lifted-button-active"
77
+ ];
78
+ const disabledClassNames = ["lifted-button-disabled"];
79
+ const classNames = baseClassNames.concat(
80
+ disabled ? disabledClassNames : activeClassNames
81
+ );
82
+ classNames.push(className);
83
+ const handleClick = (e) => {
84
+ var _a2;
85
+ if (scrollTo) {
86
+ e.preventDefault();
87
+ (_a2 = document.getElementById(scrollTo)) == null ? void 0 : _a2.scrollIntoView({
88
+ behavior: "smooth"
89
+ });
90
+ }
91
+ if (rest.onClick) {
92
+ rest.onClick(e);
93
+ }
94
+ };
95
+ return /* @__PURE__ */ jsxs(
96
+ "span",
97
+ {
98
+ className: [
99
+ width === "full" ? "relative block select-none align-middle" : width === "mobile-full" ? "relative block md:inline-block select-none align-middle" : "relative inline-block select-none align-middle",
100
+ "group"
101
+ // allows us to inherit hover activity on this parent in the children
102
+ ].join(" "),
103
+ style: styleVars,
104
+ children: [
105
+ disabled ? null : /* @__PURE__ */ jsx(
106
+ "span",
107
+ {
108
+ "aria-hidden": true,
109
+ className: "lifted-button-shadow",
110
+ style: {
111
+ transform: `translateX(2px) translateY(2px)`
112
+ }
113
+ }
114
+ ),
115
+ /* @__PURE__ */ jsxs(
116
+ "button",
117
+ __spreadProps(__spreadValues({
118
+ type,
119
+ className: classNames.join(" "),
120
+ onClick: handleClick
121
+ }, rest), {
122
+ children: [
123
+ leftIcon ? /* @__PURE__ */ jsx(
124
+ "span",
125
+ {
126
+ className: "shrink-0 py-[5px] flex items-center justify-center",
127
+ "aria-hidden": true,
128
+ children: cloneWithClasses(leftIcon, "w-6 h-6")
129
+ }
130
+ ) : null,
131
+ /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap mt-1 leading-none p-[5px]", children }),
132
+ rightIcon ? /* @__PURE__ */ jsx(
133
+ "span",
134
+ {
135
+ className: "shrink-0 py-[5px] flex items-center justify-center",
136
+ "aria-hidden": true,
137
+ children: cloneWithClasses(rightIcon, "w-6 h-6")
138
+ }
139
+ ) : null
140
+ ]
141
+ })
142
+ )
143
+ ]
144
+ }
145
+ );
146
+ }
147
+ export {
148
+ LiftedButton as default
149
+ };
@@ -0,0 +1,55 @@
1
+ type LiftedButtonColors = {
2
+ bg: string;
3
+ text: string;
4
+ hoverBg: string;
5
+ hoverText: string;
6
+ shadowBg: string;
7
+ };
8
+ type LiftedButtonPreset = keyof typeof LIFTED_BUTTON_PRESETS;
9
+ declare const LIFTED_BUTTON_PRESETS: {
10
+ primary: {
11
+ bg: string;
12
+ text: string;
13
+ hoverBg: string;
14
+ hoverText: string;
15
+ shadowBg: string;
16
+ };
17
+ secondary: {
18
+ bg: string;
19
+ text: string;
20
+ hoverBg: string;
21
+ hoverText: string;
22
+ shadowBg: string;
23
+ };
24
+ destructive: {
25
+ bg: string;
26
+ text: string;
27
+ hoverBg: string;
28
+ hoverText: string;
29
+ shadowBg: string;
30
+ };
31
+ positive: {
32
+ bg: string;
33
+ text: string;
34
+ hoverBg: string;
35
+ hoverText: string;
36
+ shadowBg: string;
37
+ };
38
+ stroke: {
39
+ bg: string;
40
+ text: string;
41
+ hoverBg: string;
42
+ hoverText: string;
43
+ shadowBg: string;
44
+ };
45
+ burn: {
46
+ bg: string;
47
+ text: string;
48
+ hoverBg: string;
49
+ hoverText: string;
50
+ shadowBg: string;
51
+ };
52
+ };
53
+ declare function colorsToStyleVars(c: LiftedButtonColors): React.CSSProperties;
54
+
55
+ export { LIFTED_BUTTON_PRESETS, type LiftedButtonColors, type LiftedButtonPreset, colorsToStyleVars };
@@ -0,0 +1,85 @@
1
+ import "../../chunk-FWCSY2DS.mjs";
2
+ const LIFTED_BUTTON_PRESETS = {
3
+ primary: {
4
+ bg: "--color-primary-orange",
5
+ text: "--color-paper-main",
6
+ hoverBg: "--color-orange-1",
7
+ hoverText: "#ffffff",
8
+ shadowBg: "#595959"
9
+ },
10
+ secondary: {
11
+ bg: "#FBDED1",
12
+ text: "--color-primary-orange",
13
+ hoverBg: "#FFF1EA",
14
+ hoverText: "--color-primary-orange",
15
+ shadowBg: "#595959"
16
+ },
17
+ destructive: {
18
+ bg: "--color-system-red",
19
+ text: "--color-paper-main",
20
+ hoverBg: "#BF0A00",
21
+ hoverText: "#ffffff",
22
+ shadowBg: "#595959"
23
+ },
24
+ positive: {
25
+ bg: "--color-system-green",
26
+ text: "--color-paper-main",
27
+ hoverBg: "#2B8F00",
28
+ hoverText: "#ffffff",
29
+ shadowBg: "#595959"
30
+ },
31
+ stroke: {
32
+ bg: "--color-paper-main",
33
+ text: "--color-surface-ink",
34
+ hoverBg: "--color-paper-2",
35
+ hoverText: "--color-surface-ink",
36
+ shadowBg: "#595959"
37
+ },
38
+ burn: {
39
+ bg: "--color-red-0",
40
+ text: "--color-red-main",
41
+ hoverBg: "--color-red-1",
42
+ hoverText: "--color-red-main",
43
+ shadowBg: "#595959"
44
+ }
45
+ };
46
+ function colorsToStyleVars(c) {
47
+ return {
48
+ ["--btn-bg"]: asCssValueWithFallback(c.bg),
49
+ ["--btn-text"]: asCssValueWithFallback(c.text),
50
+ ["--btn-hover-bg"]: asCssValueWithFallback(c.hoverBg),
51
+ ["--btn-hover-text"]: asCssValueWithFallback(c.hoverText),
52
+ ["--btn-shadow"]: asCssValueWithFallback(c.shadowBg)
53
+ };
54
+ }
55
+ function asCssValue(v) {
56
+ if (!v) return "";
57
+ if (v.includes("var(")) return v;
58
+ if (v.startsWith("--")) return `var(${v})`;
59
+ return v;
60
+ }
61
+ const CSS_VAR_FALLBACKS = {
62
+ "--color-primary-orange": "#ea6023",
63
+ "--color-paper-main": "#f6f3eb",
64
+ "--color-surface-ink": "#1b201a",
65
+ "--color-system-red": "#df0b00",
66
+ "--color-system-green": "#32a800",
67
+ "--color-orange-1": "#d14a0f",
68
+ "--color-paper-2": "#eae2d6",
69
+ "--color-red-0": "#f7cac2",
70
+ "--color-red-1": "#f4b8ad",
71
+ "--color-red-main": "#df0b00"
72
+ };
73
+ function asCssValueWithFallback(v) {
74
+ if (!v) return "";
75
+ if (v.includes("var(")) return v;
76
+ if (v.startsWith("--")) {
77
+ const fallback = CSS_VAR_FALLBACKS[v] || "#000000";
78
+ return `var(${v}, ${fallback})`;
79
+ }
80
+ return v;
81
+ }
82
+ export {
83
+ LIFTED_BUTTON_PRESETS,
84
+ colorsToStyleVars
85
+ };
@@ -0,0 +1,2 @@
1
+
2
+ export { }
File without changes
@@ -0,0 +1,29 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ComponentPropsWithoutRef } from 'react';
3
+
4
+ type LogoColor = "orange" | "blue" | "jade" | "white";
5
+ type LogoVariant = "square" | "line";
6
+ type LogoProps = {
7
+ /** Size of the logo in pixels. Defaults to 32px */
8
+ size?: number;
9
+ /** Additional CSS classes to apply to the logo */
10
+ className?: string;
11
+ /** Color variant of the logo: "orange" (default), "blue", "jade", or "white" */
12
+ color?: LogoColor;
13
+ /** Variant of the logo: "square" or "line" */
14
+ variant?: LogoVariant;
15
+ /** Optional text to display next to the logo */
16
+ text?: string;
17
+ } & ComponentPropsWithoutRef<"svg">;
18
+ /**
19
+ * Logo component that renders the Bread UI Kit logo SVG.
20
+ *
21
+ * @param size - Size of the logo in pixels (default: 32)
22
+ * @param className - Additional CSS classes
23
+ * @param color - Color variant: "orange" (default), "blue", "jade", or "white"
24
+ * @param variant - Variant of the logo: "square" or "line"
25
+ * @param text - Optional text to display next to the logo
26
+ */
27
+ declare function Logo({ size, className, color, variant, text, ...rest }: LogoProps): react_jsx_runtime.JSX.Element | undefined;
28
+
29
+ export { type LogoColor, type LogoProps, type LogoVariant, Logo as default };