@mezo-org/passport 0.16.0-dev.1 → 0.16.0-dev.2

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 (130) hide show
  1. package/dist/src/hooks/useAuthenticateWithWallet.d.ts +11 -11
  2. package/dist/src/hooks/useSignInWithWallet.d.ts +11 -11
  3. package/dist/src/hooks/useSignUpWithWallet.d.ts +11 -11
  4. package/dist/src/index.d.ts +0 -1
  5. package/dist/src/index.d.ts.map +1 -1
  6. package/dist/src/index.js +0 -1
  7. package/dist/src/index.js.map +1 -1
  8. package/package.json +1 -2
  9. package/src/index.ts +0 -1
  10. package/dist/src/assets/DefaultAvatar.d.ts +0 -5
  11. package/dist/src/assets/DefaultAvatar.d.ts.map +0 -1
  12. package/dist/src/assets/DefaultAvatar.js +0 -21
  13. package/dist/src/assets/DefaultAvatar.js.map +0 -1
  14. package/dist/src/assets/EditIcon.d.ts +0 -5
  15. package/dist/src/assets/EditIcon.d.ts.map +0 -1
  16. package/dist/src/assets/EditIcon.js +0 -10
  17. package/dist/src/assets/EditIcon.js.map +0 -1
  18. package/dist/src/components/Dropdown/ConnectedTrigger.d.ts +0 -8
  19. package/dist/src/components/Dropdown/ConnectedTrigger.d.ts.map +0 -1
  20. package/dist/src/components/Dropdown/ConnectedTrigger.js +0 -39
  21. package/dist/src/components/Dropdown/ConnectedTrigger.js.map +0 -1
  22. package/dist/src/components/Dropdown/Content.d.ts +0 -8
  23. package/dist/src/components/Dropdown/Content.d.ts.map +0 -1
  24. package/dist/src/components/Dropdown/Content.js +0 -29
  25. package/dist/src/components/Dropdown/Content.js.map +0 -1
  26. package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts +0 -7
  27. package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts.map +0 -1
  28. package/dist/src/components/Dropdown/DisconnectedTrigger.js +0 -13
  29. package/dist/src/components/Dropdown/DisconnectedTrigger.js.map +0 -1
  30. package/dist/src/components/Dropdown/Dropdown.d.ts +0 -23
  31. package/dist/src/components/Dropdown/Dropdown.d.ts.map +0 -1
  32. package/dist/src/components/Dropdown/Dropdown.js +0 -45
  33. package/dist/src/components/Dropdown/Dropdown.js.map +0 -1
  34. package/dist/src/components/Dropdown/ListingItem.d.ts +0 -14
  35. package/dist/src/components/Dropdown/ListingItem.d.ts.map +0 -1
  36. package/dist/src/components/Dropdown/ListingItem.js +0 -42
  37. package/dist/src/components/Dropdown/ListingItem.js.map +0 -1
  38. package/dist/src/components/Dropdown/NestedViewLayout.d.ts +0 -8
  39. package/dist/src/components/Dropdown/NestedViewLayout.d.ts.map +0 -1
  40. package/dist/src/components/Dropdown/NestedViewLayout.js +0 -33
  41. package/dist/src/components/Dropdown/NestedViewLayout.js.map +0 -1
  42. package/dist/src/components/Dropdown/Receive/Receive.d.ts +0 -4
  43. package/dist/src/components/Dropdown/Receive/Receive.d.ts.map +0 -1
  44. package/dist/src/components/Dropdown/Receive/Receive.js +0 -64
  45. package/dist/src/components/Dropdown/Receive/Receive.js.map +0 -1
  46. package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts +0 -4
  47. package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts.map +0 -1
  48. package/dist/src/components/Dropdown/Root/AccountAddressActions.js +0 -49
  49. package/dist/src/components/Dropdown/Root/AccountAddressActions.js.map +0 -1
  50. package/dist/src/components/Dropdown/Root/AccountBalance.d.ts +0 -6
  51. package/dist/src/components/Dropdown/Root/AccountBalance.d.ts.map +0 -1
  52. package/dist/src/components/Dropdown/Root/AccountBalance.js +0 -32
  53. package/dist/src/components/Dropdown/Root/AccountBalance.js.map +0 -1
  54. package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts +0 -6
  55. package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts.map +0 -1
  56. package/dist/src/components/Dropdown/Root/AccountBtcListing.js +0 -28
  57. package/dist/src/components/Dropdown/Root/AccountBtcListing.js.map +0 -1
  58. package/dist/src/components/Dropdown/Root/AccountError.d.ts +0 -8
  59. package/dist/src/components/Dropdown/Root/AccountError.d.ts.map +0 -1
  60. package/dist/src/components/Dropdown/Root/AccountError.js +0 -17
  61. package/dist/src/components/Dropdown/Root/AccountError.js.map +0 -1
  62. package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts +0 -4
  63. package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts.map +0 -1
  64. package/dist/src/components/Dropdown/Root/AccountMusdListing.js +0 -21
  65. package/dist/src/components/Dropdown/Root/AccountMusdListing.js.map +0 -1
  66. package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts +0 -8
  67. package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts.map +0 -1
  68. package/dist/src/components/Dropdown/Root/AccountOtherAssets.js +0 -43
  69. package/dist/src/components/Dropdown/Root/AccountOtherAssets.js.map +0 -1
  70. package/dist/src/components/Dropdown/Root/Root.d.ts +0 -8
  71. package/dist/src/components/Dropdown/Root/Root.d.ts.map +0 -1
  72. package/dist/src/components/Dropdown/Root/Root.js +0 -49
  73. package/dist/src/components/Dropdown/Root/Root.js.map +0 -1
  74. package/dist/src/components/Dropdown/Root/WalletAddress.d.ts +0 -4
  75. package/dist/src/components/Dropdown/Root/WalletAddress.d.ts.map +0 -1
  76. package/dist/src/components/Dropdown/Root/WalletAddress.js +0 -66
  77. package/dist/src/components/Dropdown/Root/WalletAddress.js.map +0 -1
  78. package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts +0 -6
  79. package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts.map +0 -1
  80. package/dist/src/components/Dropdown/Root/WelcomeBlock.js +0 -88
  81. package/dist/src/components/Dropdown/Root/WelcomeBlock.js.map +0 -1
  82. package/dist/src/components/Dropdown/Settings/InlineEditField.d.ts +0 -12
  83. package/dist/src/components/Dropdown/Settings/InlineEditField.d.ts.map +0 -1
  84. package/dist/src/components/Dropdown/Settings/InlineEditField.js +0 -95
  85. package/dist/src/components/Dropdown/Settings/InlineEditField.js.map +0 -1
  86. package/dist/src/components/Dropdown/Settings/Settings.d.ts +0 -4
  87. package/dist/src/components/Dropdown/Settings/Settings.d.ts.map +0 -1
  88. package/dist/src/components/Dropdown/Settings/Settings.js +0 -36
  89. package/dist/src/components/Dropdown/Settings/Settings.js.map +0 -1
  90. package/dist/src/components/Dropdown/SlotNumber.d.ts +0 -19
  91. package/dist/src/components/Dropdown/SlotNumber.d.ts.map +0 -1
  92. package/dist/src/components/Dropdown/SlotNumber.js +0 -67
  93. package/dist/src/components/Dropdown/SlotNumber.js.map +0 -1
  94. package/dist/src/components/Dropdown/TestnetTopBanner.d.ts +0 -3
  95. package/dist/src/components/Dropdown/TestnetTopBanner.d.ts.map +0 -1
  96. package/dist/src/components/Dropdown/TestnetTopBanner.js +0 -14
  97. package/dist/src/components/Dropdown/TestnetTopBanner.js.map +0 -1
  98. package/dist/src/components/Dropdown/index.d.ts +0 -3
  99. package/dist/src/components/Dropdown/index.d.ts.map +0 -1
  100. package/dist/src/components/Dropdown/index.js +0 -2
  101. package/dist/src/components/Dropdown/index.js.map +0 -1
  102. package/dist/src/components/index.d.ts +0 -2
  103. package/dist/src/components/index.d.ts.map +0 -1
  104. package/dist/src/components/index.js +0 -2
  105. package/dist/src/components/index.js.map +0 -1
  106. package/src/assets/DefaultAvatar.tsx +0 -74
  107. package/src/assets/EditIcon.tsx +0 -33
  108. package/src/components/Dropdown/ConnectedTrigger.tsx +0 -76
  109. package/src/components/Dropdown/Content.tsx +0 -56
  110. package/src/components/Dropdown/DisconnectedTrigger.tsx +0 -36
  111. package/src/components/Dropdown/Dropdown.tsx +0 -100
  112. package/src/components/Dropdown/ListingItem.tsx +0 -176
  113. package/src/components/Dropdown/NestedViewLayout.tsx +0 -88
  114. package/src/components/Dropdown/README.md +0 -41
  115. package/src/components/Dropdown/Receive/Receive.tsx +0 -144
  116. package/src/components/Dropdown/Root/AccountAddressActions.tsx +0 -99
  117. package/src/components/Dropdown/Root/AccountBalance.tsx +0 -69
  118. package/src/components/Dropdown/Root/AccountBtcListing.tsx +0 -53
  119. package/src/components/Dropdown/Root/AccountError.tsx +0 -34
  120. package/src/components/Dropdown/Root/AccountMusdListing.tsx +0 -45
  121. package/src/components/Dropdown/Root/AccountOtherAssets.tsx +0 -85
  122. package/src/components/Dropdown/Root/Root.tsx +0 -104
  123. package/src/components/Dropdown/Root/WalletAddress.tsx +0 -123
  124. package/src/components/Dropdown/Root/WelcomeBlock.tsx +0 -173
  125. package/src/components/Dropdown/Settings/InlineEditField.tsx +0 -212
  126. package/src/components/Dropdown/Settings/Settings.tsx +0 -87
  127. package/src/components/Dropdown/SlotNumber.tsx +0 -131
  128. package/src/components/Dropdown/TestnetTopBanner.tsx +0 -32
  129. package/src/components/Dropdown/index.ts +0 -2
  130. package/src/components/index.ts +0 -1
@@ -1,88 +0,0 @@
1
- import { Block, HeadingMedium, LabelLarge, Mats, mergeOverrides, Skeleton, useStyletron, } from "@mezo-org/mezo-clay";
2
- import React from "react";
3
- import DefaultAvatar from "../../../assets/DefaultAvatar";
4
- import { useGetCurrentAccount } from "../../../hooks";
5
- import { formatNumberToCompactString } from "../../../utils/numbers";
6
- import AccountError from "./AccountError";
7
- import { usePassportContext } from "../../../hooks/usePassportContext";
8
- import SlotNumber from "../SlotNumber";
9
- const DOT_DELIMITER_REGEX = /(?=\.)/;
10
- function WelcomeBlockSkeleton() {
11
- const [, theme] = useStyletron();
12
- return (React.createElement(Block, { display: "flex", alignItems: "center", padding: theme.sizing.scale600, paddingTop: theme.sizing.scale900, paddingBottom: theme.sizing.scale800, overrides: {
13
- Block: {
14
- style: {
15
- gap: theme.sizing.scale600,
16
- },
17
- },
18
- } },
19
- React.createElement(Skeleton, { animation: true, width: theme.sizing.scale1200, height: theme.sizing.scale1200, overrides: {
20
- Root: {
21
- style: {
22
- borderRadius: "100%",
23
- },
24
- },
25
- } }),
26
- React.createElement(Block, { display: "flex", flexDirection: "column", flex: 1, overrides: {
27
- Block: {
28
- style: {
29
- gap: theme.sizing.scale100,
30
- },
31
- },
32
- } },
33
- React.createElement(Skeleton, { animation: true, width: "60%", height: theme.sizing.scale900 }),
34
- React.createElement(Skeleton, { animation: true, width: "40%", height: theme.sizing.scale800 }))));
35
- }
36
- export default function WelcomeBlock(props) {
37
- const { overrides, ...restProps } = props;
38
- const { accountDataRefetchInterval } = usePassportContext();
39
- const { data, isError, isPending } = useGetCurrentAccount({
40
- staleTime: accountDataRefetchInterval,
41
- refetchInterval: accountDataRefetchInterval,
42
- });
43
- const [, theme] = useStyletron();
44
- if (isError) {
45
- return (React.createElement(AccountError, { padding: theme.sizing.scale600, paddingTop: theme.sizing.scale900, paddingBottom: theme.sizing.scale800, marginBottom: theme.sizing.scale300, topic: "account information" }));
46
- }
47
- if (isPending) {
48
- return React.createElement(WelcomeBlockSkeleton, null);
49
- }
50
- const [mezoId, mezoIdSuffix] = (data.mezoId ?? "").split(DOT_DELIMITER_REGEX);
51
- return (React.createElement(Block, { display: "flex", alignItems: "center", paddingLeft: theme.sizing.scale600, paddingRight: theme.sizing.scale600, paddingTop: theme.sizing.scale900, paddingBottom: theme.sizing.scale800, overrides: mergeOverrides(overrides, {
52
- Block: {
53
- style: {
54
- gap: theme.sizing.scale600,
55
- },
56
- },
57
- }), ...restProps },
58
- React.createElement(Block, { as: DefaultAvatar, width: theme.sizing.scale1200, height: theme.sizing.scale1200, overrides: {
59
- Block: {
60
- style: {
61
- borderRadius: "100%",
62
- },
63
- },
64
- } }),
65
- React.createElement(Block, { display: "flex", flexDirection: "column" },
66
- mezoId && mezoIdSuffix && (React.createElement(HeadingMedium, { as: "span" },
67
- React.createElement(Block, { as: "span" }, mezoId),
68
- React.createElement(Block, { as: "span", color: theme.colors.contentSecondary }, mezoIdSuffix))),
69
- React.createElement(Block, { display: "flex", alignItems: "center", overrides: {
70
- Block: {
71
- style: {
72
- gap: theme.sizing.scale100,
73
- },
74
- },
75
- } },
76
- React.createElement(Mats, { size: theme.sizing.scale600, overrides: {
77
- Svg: {
78
- style: {
79
- margin: theme.sizing.scale100, // To reduce gap
80
- },
81
- },
82
- } }),
83
- React.createElement(LabelLarge, { color: theme.colors.contentPrimary },
84
- React.createElement(SlotNumber, { formatFunction: formatNumberToCompactString }, data.totalMats),
85
- " ",
86
- "mats")))));
87
- }
88
- //# sourceMappingURL=WelcomeBlock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WelcomeBlock.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/WelcomeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAEL,aAAa,EACb,UAAU,EACV,IAAI,EACJ,cAAc,EACd,QAAQ,EACR,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,aAAa,MAAM,+BAA+B,CAAA;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,UAAU,MAAM,eAAe,CAAA;AAEtC,MAAM,mBAAmB,GAAG,QAAQ,CAAA;AAEpC,SAAS,oBAAoB;IAC3B,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,OAAO,CACL,oBAAC,KAAK,IACJ,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC9B,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EACjC,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EACpC,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;iBAC3B;aACF;SACF;QAED,oBAAC,QAAQ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CAAS;gBACjC,oBAAC,KAAK,IAAC,EAAE,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB,IAClD,YAAY,CACP,CACM,CACjB;YAED,oBAAC,KAAK,IACJ,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,SAAS,EAAE;oBACT,KAAK,EAAE;wBACL,KAAK,EAAE;4BACL,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;yBAC3B;qBACF;iBACF;gBAED,oBAAC,IAAI,IACH,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC3B,SAAS,EAAE;wBACT,GAAG,EAAE;4BACH,KAAK,EAAE;gCACL,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,gBAAgB;6BAChD;yBACF;qBACF,GACD;gBAEF,oBAAC,UAAU,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;oBAC5C,oBAAC,UAAU,IAAC,cAAc,EAAE,2BAA2B,IACpD,IAAI,CAAC,SAAS,CACJ;oBAAC,GAAG;2BAEN,CACP,CACF,CACF,CACT,CAAA;AACH,CAAC"}
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- type InlineEditFieldProps = {
3
- label: string;
4
- value: string;
5
- placeholder?: string;
6
- onSave: (value: string) => Promise<void>;
7
- validate?: (value: string) => string | null;
8
- isLoading?: boolean;
9
- };
10
- export default function InlineEditField(props: InlineEditFieldProps): React.JSX.Element;
11
- export {};
12
- //# sourceMappingURL=InlineEditField.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InlineEditField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Settings/InlineEditField.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAG/D,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACxC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAA;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AA4BD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,oBAAoB,qBAkKlE"}
@@ -1,95 +0,0 @@
1
- import { Block, ButtonIcon, Check, Close, Input, LabelSmall, ParagraphSmall, Spinner, useStyletron, } from "@mezo-org/mezo-clay";
2
- import React, { useCallback, useEffect, useState } from "react";
3
- import EditIcon from "../../../assets/EditIcon";
4
- function InlineFieldWrapper({ label, children }) {
5
- const [, theme] = useStyletron();
6
- return (React.createElement(Block, { display: "flex", flexDirection: "column", overrides: {
7
- Block: {
8
- style: {
9
- gap: theme.sizing.scale200,
10
- },
11
- },
12
- } },
13
- React.createElement(LabelSmall, { color: theme.colors.contentSecondary }, label),
14
- children));
15
- }
16
- export default function InlineEditField(props) {
17
- const { label, value, placeholder, onSave, validate, isLoading } = props;
18
- const [, theme] = useStyletron();
19
- const [isEditing, setIsEditing] = useState(false);
20
- const [editValue, setEditValue] = useState(value);
21
- const [error, setError] = useState(null);
22
- const [isSaving, setIsSaving] = useState(false);
23
- useEffect(() => {
24
- setEditValue(value);
25
- }, [value]);
26
- const handleEdit = useCallback(() => {
27
- setIsEditing(true);
28
- setEditValue(value);
29
- setError(null);
30
- }, [value]);
31
- const handleCancel = useCallback(() => {
32
- setIsEditing(false);
33
- setEditValue(value);
34
- setError(null);
35
- }, [value]);
36
- const handleSave = useCallback(async () => {
37
- if (validate) {
38
- const validationError = validate(editValue);
39
- if (validationError) {
40
- setError(validationError);
41
- return;
42
- }
43
- }
44
- setIsSaving(true);
45
- try {
46
- await onSave(editValue);
47
- setIsEditing(false);
48
- setError(null);
49
- }
50
- catch (err) {
51
- setError(err instanceof Error ? err.message : "Failed to save");
52
- }
53
- finally {
54
- setIsSaving(false);
55
- }
56
- }, [editValue, onSave, validate]);
57
- const handleKeyDown = useCallback((e) => {
58
- if (e.key === "Enter") {
59
- handleSave();
60
- }
61
- else if (e.key === "Escape") {
62
- handleCancel();
63
- }
64
- }, [handleSave, handleCancel]);
65
- if (isLoading) {
66
- return (React.createElement(InlineFieldWrapper, { label: label },
67
- React.createElement(Block, { display: "flex", alignItems: "center", height: theme.sizing.scale950 },
68
- React.createElement(Spinner, { "$size": theme.sizing.scale600 }))));
69
- }
70
- if (isEditing) {
71
- return (React.createElement(InlineFieldWrapper, { label: label },
72
- React.createElement(Block, { display: "flex", alignItems: "center", width: "100%", gridGap: "scale300" },
73
- React.createElement(Block, { flex: 1 },
74
- React.createElement(Input, { value: editValue, onChange: (e) => {
75
- setEditValue(e.currentTarget.value);
76
- setError(null);
77
- }, onKeyDown: handleKeyDown, placeholder: placeholder, size: "small", error: !!error, disabled: isSaving, autoFocus: true })),
78
- React.createElement(ButtonIcon, { onClick: handleSave, size: "small", shape: "circle", kind: "secondary", disabled: isSaving, "aria-label": "Save" }, isSaving ? (React.createElement(Spinner, { "$size": theme.sizing.scale500 })) : (React.createElement(Check, { size: 14, color: "currentColor" }))),
79
- React.createElement(ButtonIcon, { onClick: handleCancel, size: "small", shape: "circle", kind: "tertiary", disabled: isSaving, "aria-label": "Cancel" },
80
- React.createElement(Close, { size: 14, color: "currentColor" }))),
81
- error && (React.createElement(ParagraphSmall, { color: theme.colors.contentNegative, marginTop: 0, marginBottom: 0 }, error))));
82
- }
83
- return (React.createElement(InlineFieldWrapper, { label: label },
84
- React.createElement(Block, { display: "flex", alignItems: "center", justifyContent: "space-between", onClick: handleEdit, overrides: {
85
- Block: {
86
- style: {
87
- cursor: "pointer",
88
- minHeight: theme.sizing.scale950,
89
- },
90
- },
91
- } },
92
- React.createElement(ParagraphSmall, { marginTop: 0, marginBottom: 0, color: value ? theme.colors.contentPrimary : theme.colors.contentTertiary }, value || placeholder),
93
- React.createElement(EditIcon, { size: 16, color: theme.colors.contentTertiary }))));
94
- }
95
- //# sourceMappingURL=InlineEditField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InlineEditField.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Settings/InlineEditField.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,KAAK,EACL,UAAU,EACV,cAAc,EACd,OAAO,EACP,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,QAAQ,MAAM,0BAA0B,CAAA;AAgB/C,SAAS,kBAAkB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAA2B;IACtE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,OAAO,CACL,oBAAC,KAAK,IACJ,OAAO,EAAC,MAAM,EACd,aAAa,EAAC,QAAQ,EACtB,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;iBAC3B;aACF;SACF;QAED,oBAAC,UAAU,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB,IAAG,KAAK,CAAc;QACrE,QAAQ,CACH,CACT,CAAA;AACH,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAA2B;IACjE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAExE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACjD,MAAM,C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S;wBACjB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;qBACjC;iBACF;aACF;YAED,oBAAC,cAAc,IACb,SAAS,EAAE,CAAC,EACZ,YAAY,EAAE,CAAC,EACf,KAAK,EACH,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,IAGnE,KAAK,IAAI,WAAW,CACN;YACjB,oBAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,GAAI,CACrD,CACW,CACtB,CAAA;AACH,CAAC"}
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- declare function Settings(): React.JSX.Element;
3
- export default Settings;
4
- //# sourceMappingURL=Settings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Settings/Settings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAM1C,iBAAS,QAAQ,sBA6EhB;AAED,eAAe,QAAQ,CAAA"}
@@ -1,36 +0,0 @@
1
- import { Block, ParagraphSmall, Link, useStyletron } from "@mezo-org/mezo-clay";
2
- import React, { useCallback } from "react";
3
- import NestedViewLayout from "../NestedViewLayout";
4
- import InlineEditField from "./InlineEditField";
5
- import { useGetCurrentAccount, useUpdateUserProfile } from "../../../hooks";
6
- import { validateEmail, validateTelegram } from "../../../utils/validation";
7
- function Settings() {
8
- const [, theme] = useStyletron();
9
- const { data: account, isPending: isCurrentAccountPending } = useGetCurrentAccount();
10
- const { updateProfileAsync } = useUpdateUserProfile();
11
- const handleSaveEmail = useCallback(async (value) => {
12
- await updateProfileAsync({ email: value || "" });
13
- }, [updateProfileAsync]);
14
- const handleSaveTelegram = useCallback(async (value) => {
15
- const handle = value.startsWith("@") ? value.slice(1) : value;
16
- await updateProfileAsync({ telegram: handle || "" });
17
- }, [updateProfileAsync]);
18
- return (React.createElement(NestedViewLayout, null,
19
- React.createElement(ParagraphSmall, { marginTop: 0, marginBottom: theme.sizing.scale800, color: theme.colors.contentSecondary }, "Update your contact information to stay connected."),
20
- React.createElement(Block, { display: "flex", flexDirection: "column", overrides: {
21
- Block: {
22
- style: {
23
- gap: theme.sizing.scale600,
24
- },
25
- },
26
- } },
27
- React.createElement(InlineEditField, { label: "Email", value: account?.email || "", placeholder: "Enter your email", onSave: handleSaveEmail, validate: validateEmail, isLoading: isCurrentAccountPending }),
28
- React.createElement(InlineEditField, { label: "Telegram", value: account?.telegram || "", placeholder: "Enter your Telegram handle", onSave: handleSaveTelegram, validate: validateTelegram, isLoading: isCurrentAccountPending })),
29
- React.createElement(ParagraphSmall, { marginTop: theme.sizing.scale800, marginBottom: 0, color: theme.colors.contentTertiary },
30
- "By providing your contact information, you agree to receive service notifications and occasional promotional messages. Promotional messages will always include an opt out link. The Privacy Policy is available",
31
- " ",
32
- React.createElement(Link, { href: "https://mezo.org/privacy", target: "_blank" }, "here"),
33
- ".")));
34
- }
35
- export default Settings;
36
- //# sourceMappingURL=Settings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Settings/Settings.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAC/E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,gBAAgB,MAAM,qBAAqB,CAAA;AAClD,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAC3E,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE3E,SAAS,QAAQ;IACf,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,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QAAQ,EAAE,aAAa,EACvB,SAAS,EAAE,uBAAuB,GAClC;YAEF,oBAAC,eAAe,IACd,KAAK,EAAC,UAAU,EAChB,KAAK,EAAE,OAAO,EAAE,QAAQ,IAAI,EAAE,EAC9B,WAAW,EAAC,4BAA4B,EACxC,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,EAAE,uBAAuB,GAClC,CACI;QAER,oBAAC,cAAc,IACb,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAChC,YAAY,EAAE,CAAC,EACf,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe;;YAIkC,GAAG;YACxE,oBAAC,IAAI,IAAC,IAAI,EAAC,0BAA0B,EAAC,MAAM,EAAC,QAAQ,WAE9C;gBAEQ,CACA,CACpB,CAAA;AACH,CAAC;AAED,eAAe,QAAQ,CAAA"}
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- type SlotNumberProps = {
3
- className?: string;
4
- children: number;
5
- formatFunction?: (value: number) => string;
6
- };
7
- /**
8
- * SlotNumber component displays a number with animated digits.
9
- *
10
- * @typedef {object} SlotNumberProps
11
- * @property {number} children - The number to display.
12
- * @property {function} [formatFunction] - Optional function to format the number.
13
- * @property {BlockProps} [restProps] - Additional properties for the Block component.
14
- * @see https://pyszkowski.dev/writings/slot-number
15
- * @returns {JSX.Element} The rendered SlotNumber component.
16
- */
17
- declare function SlotNumber(props: SlotNumberProps): React.JSX.Element;
18
- export default SlotNumber;
19
- //# sourceMappingURL=SlotNumber.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SlotNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/SlotNumber.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAItC,KAAK,eAAe,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;CAC3C,CAAA;AAoED;;;;;;;;;GASG;AACH,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,qBAyCzC;AAED,eAAe,UAAU,CAAA"}
@@ -1,67 +0,0 @@
1
- /* eslint-disable react/no-array-index-key */
2
- import React, { useMemo } from "react";
3
- import { AnimatePresence, motion } from "motion/react";
4
- import { Block, useStyletron } from "@mezo-org/mezo-clay";
5
- function SlotNumberDigit(props) {
6
- const { children: value, ...restProps } = props;
7
- const [css] = useStyletron();
8
- const digits = [...Array(10).keys()];
9
- return (React.createElement(AnimatePresence, { initial: false },
10
- React.createElement(motion.div, { initial: {
11
- y: "100%",
12
- }, animate: {
13
- y: "0%",
14
- }, layout: "position", className: css({
15
- position: "relative",
16
- }), ...restProps },
17
- React.createElement(Block, { overrides: {
18
- Block: {
19
- style: {
20
- visibility: "hidden",
21
- },
22
- },
23
- } }, value),
24
- React.createElement(motion.div, { className: css({
25
- display: "flex",
26
- flexDirection: "column",
27
- position: "absolute",
28
- inset: 0,
29
- height: "fit-content",
30
- }), initial: false, animate: { y: `${(value / 10) * -100}%` }, transition: {
31
- type: "spring",
32
- damping: 16,
33
- stiffness: 220,
34
- } }, digits.map((digit) => (React.createElement(Block, { as: "span", key: digit }, digit)))))));
35
- }
36
- /**
37
- * SlotNumber component displays a number with animated digits.
38
- *
39
- * @typedef {object} SlotNumberProps
40
- * @property {number} children - The number to display.
41
- * @property {function} [formatFunction] - Optional function to format the number.
42
- * @property {BlockProps} [restProps] - Additional properties for the Block component.
43
- * @see https://pyszkowski.dev/writings/slot-number
44
- * @returns {JSX.Element} The rendered SlotNumber component.
45
- */
46
- function SlotNumber(props) {
47
- const { children: value, formatFunction, ...restProps } = props;
48
- const [css] = useStyletron();
49
- const characters = useMemo(() => {
50
- const formattedValue = formatFunction
51
- ? formatFunction(value)
52
- : value.toString();
53
- return formattedValue
54
- .split("")
55
- .map((character) => (/^[0-9]$/.test(character) ? +character : character))
56
- .reverse();
57
- }, [formatFunction, value]);
58
- return (React.createElement(motion.div, { layout: true, className: css({
59
- display: "inline-flex",
60
- flexDirection: "row-reverse",
61
- justifyContent: "flex-end",
62
- overflow: "hidden",
63
- userSelect: "none",
64
- }), ...restProps }, characters.map((character, index) => typeof character === "number" ? (React.createElement(SlotNumberDigit, { key: `slot-number-character-${index}` }, character)) : (React.createElement(motion.span, { layout: true, key: `slot-number-character-${index}` }, character)))));
65
- }
66
- export default SlotNumber;
67
- //# sourceMappingURL=SlotNumber.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SlotNumber.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/SlotNumber.tsx"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAazD,SAAS,eAAe,CAAC,KAA2B;IAClD,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IAE/C,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,EAAE,CAAA;IAE5B,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;IAEpC,OAAO,CACL,oBAAC,eAAe,IAAC,OAAO,EAAE,KAAK;QAC7B,oBAAC,MAAM,CAAC,GAAG,IACT,OAAO,EAAE;gBACP,CAAC,EAAE,MAAM;aACV,EACD,OAAO,EAAE;gBACP,CAAC,EAAE,IAAI;aACR,EACD,MAAM,EAAC,UAAU,EACjB,SAAS,EAAE,GAAG,CAAC;gBACb,QAAQ,EAAE,UAAU;aACrB,CAAC,KACE,SAAS;YAEb,oBAAC,KAAK,IACJ,SAAS,EAAE;oBACT,KAAK,EAAE;w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CAAC,CAAC,SAAS,CAAC,CAAC;aACxE,OAAO,EAAE,CAAA;IACd,CAAC,EAAE,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,CAAA;IAE3B,OAAO,CACL,oBAAC,MAAM,CAAC,GAAG,IACT,MAAM,QACN,SAAS,EAAE,GAAG,CAAC;YACb,OAAO,EAAE,aAAa;YACtB,aAAa,EAAE,aAAa;YAC5B,cAAc,EAAE,UAAU;YAC1B,QAAQ,EAAE,QAAQ;YAClB,UAAU,EAAE,MAAM;SACnB,CAAC,KACE,SAAS,IAEZ,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,CACnC,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC9B,oBAAC,eAAe,IAAC,GAAG,EAAE,yBAAyB,KAAK,EAAE,IACnD,SAAS,CACM,CACnB,CAAC,CAAC,CAAC,CACF,oBAAC,MAAM,CAAC,IAAI,IAAC,MAAM,QAAC,GAAG,EAAE,yBAAyB,KAAK,EAAE,IACtD,SAAS,CACE,CACf,CACF,CACU,CACd,CAAA;AACH,CAAC;AAED,eAAe,UAAU,CAAA"}
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- export default function TestnetTopBanner(): React.JSX.Element | null;
3
- //# sourceMappingURL=TestnetTopBanner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TestnetTopBanner.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/TestnetTopBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,MAAM,CAAC,OAAO,UAAU,gBAAgB,6BAsBvC"}
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- import { Block, InfoCircle, LabelSmall, useStyletron, } from "@mezo-org/mezo-clay";
3
- import { usePassportContext } from "../../hooks/usePassportContext";
4
- export default function TestnetTopBanner() {
5
- const [, theme] = useStyletron();
6
- const { environment } = usePassportContext();
7
- if (environment !== "testnet") {
8
- return null;
9
- }
10
- return (React.createElement(Block, { display: "flex", alignItems: "center", padding: `${theme.sizing.scale700} ${theme.sizing.scale600}`, backgroundColor: theme.colors.warning },
11
- React.createElement(InfoCircle, { size: theme.sizing.scale550 }),
12
- React.createElement(LabelSmall, { marginLeft: theme.sizing.scale500 }, "You are using testnet funds.")));
13
- }
14
- //# sourceMappingURL=TestnetTopBanner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TestnetTopBanner.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/TestnetTopBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,KAAK,EACL,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAEnE,MAAM,CAAC,OAAO,UAAU,gBAAgB;IACtC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,EAAE,WAAW,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAE5C,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,oBAAC,KAAK,IACJ,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAC5D,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;QAErC,oBAAC,UAAU,IAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAI;QAC3C,oBAAC,UAAU,IAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,mCAEhC,CACP,CACT,CAAA;AACH,CAAC"}
@@ -1,3 +0,0 @@
1
- export { Dropdown } from "./Dropdown";
2
- export type { DropdownProps } from "./Dropdown";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
@@ -1,2 +0,0 @@
1
- export { Dropdown } from "./Dropdown";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
@@ -1,2 +0,0 @@
1
- export { Dropdown, DropdownProps } from "./Dropdown";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
@@ -1,2 +0,0 @@
1
- export { Dropdown } from "./Dropdown";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAA"}
@@ -1,74 +0,0 @@
1
- import { Block, BlockProps } from "@mezo-org/mezo-clay"
2
- import React, { SVGProps } from "react"
3
-
4
- function DefaultAvatar(props: SVGProps<SVGSVGElement>) {
5
- return (
6
- <svg viewBox="0 0 214 214" fill="none" {...props}>
7
- <rect y="-0.478027" width="166.379" height="81.7091" fill="#FF004D" />
8
- <rect x="166" y="-0.478027" width="48" height="82" fill="black" />
9
- <rect
10
- x="166.379"
11
- y="81.231"
12
- width="24.1044"
13
- height="132.291"
14
- fill="#DFFF80"
15
- />
16
- <rect
17
- x="118.758"
18
- y="81.231"
19
- width="24.1044"
20
- height="132.291"
21
- fill="#FF5500"
22
- />
23
- <rect
24
- x="71.1372"
25
- y="81.231"
26
- width="24.1044"
27
- height="132.291"
28
- fill="#5A59A7"
29
- />
30
- <rect
31
- x="23.5166"
32
- y="81.231"
33
- width="24.1044"
34
- height="132.291"
35
- fill="#47B5FF"
36
- />
37
- <rect y="81.231" width="23.5165" height="132.291" fill="#A3C238" />
38
- <rect
39
- x="190.483"
40
- y="81.231"
41
- width="23.5165"
42
- height="132.291"
43
- fill="#6E6E70"
44
- />
45
- <rect
46
- x="142.863"
47
- y="81.231"
48
- width="23.5165"
49
- height="132.291"
50
- fill="#0A3C01"
51
- />
52
- <rect
53
- x="95.2417"
54
- y="81.231"
55
- width="23.5165"
56
- height="132.291"
57
- fill="#F2A91F"
58
- />
59
- <rect
60
- x="47.6211"
61
- y="81.231"
62
- width="23.5165"
63
- height="132.291"
64
- fill="#6B3D01"
65
- />
66
- </svg>
67
- )
68
- }
69
-
70
- function DefaultAvatarComponent(props: BlockProps) {
71
- return <Block as={DefaultAvatar} {...props} />
72
- }
73
-
74
- export default DefaultAvatarComponent
@@ -1,33 +0,0 @@
1
- import { Icon, IconProps } from "@mezo-org/mezo-clay"
2
- import React, { forwardRef, Ref } from "react"
3
-
4
- function EditIcon(props: IconProps, ref: Ref<SVGSVGElement>) {
5
- const { title, size = 16, color = "black", ...restProps } = props
6
-
7
- return (
8
- <Icon
9
- ref={ref}
10
- viewBox="0 0 24 24"
11
- title={title ?? "Edit"}
12
- size={size}
13
- color={color}
14
- role="graphics-symbol"
15
- {...restProps}
16
- >
17
- <path
18
- d="M18 10L21 7L17 3L14 6M18 10L8 20H4V16L14 6M18 10L14 6"
19
- stroke={color}
20
- strokeWidth="2"
21
- strokeLinecap="round"
22
- strokeLinejoin="round"
23
- fill="none"
24
- />
25
- </Icon>
26
- )
27
- }
28
-
29
- const ForwardedEditIcon: React.ForwardRefExoticComponent<
30
- IconProps & React.RefAttributes<SVGSVGElement>
31
- > = forwardRef<SVGSVGElement, IconProps>(EditIcon)
32
-
33
- export default ForwardedEditIcon
@@ -1,76 +0,0 @@
1
- import { Block, Button, ButtonProps, useStyletron } from "@mezo-org/mezo-clay"
2
- import React, { forwardRef, ReactNode, useMemo } from "react"
3
-
4
- type ConnectedTriggerProps = Omit<ButtonProps, "children" | "size"> & {
5
- avatar: ReactNode
6
- size?: "medium" | "large"
7
- }
8
-
9
- const ConnectedTrigger = forwardRef<HTMLButtonElement, ConnectedTriggerProps>(
10
- (props, ref) => {
11
- const { onClick, avatar, size = "medium", ...restProps } = props
12
-
13
- const [, theme] = useStyletron()
14
-
15
- const avatarSize = useMemo(() => {
16
- const sizeMap = {
17
- medium: theme.sizing.scale950,
18
- large: theme.sizing.scale1400,
19
- }
20
-
21
- return sizeMap[size]
22
- }, [theme, size])
23
-
24
- const buttonPadding = useMemo(() => {
25
- const paddingMap = {
26
- medium: theme.sizing.scale0,
27
- large: theme.sizing.scale100,
28
- }
29
-
30
- return paddingMap[size]
31
- }, [theme, size])
32
-
33
- return (
34
- <Button
35
- overrides={{
36
- BaseButton: {
37
- props: { ref, ...restProps },
38
- style: {
39
- borderRadius: "100%",
40
- overflow: "hidden",
41
- padding: buttonPadding,
42
- },
43
- },
44
- }}
45
- onClick={onClick}
46
- >
47
- {typeof avatar === "string" ? (
48
- <Block
49
- width={avatarSize}
50
- height={avatarSize}
51
- as="img"
52
- src={avatar}
53
- alt=""
54
- />
55
- ) : (
56
- <Block
57
- width={avatarSize}
58
- height={avatarSize}
59
- overrides={{
60
- Block: {
61
- style: {
62
- borderRadius: "100%",
63
- overflow: "hidden",
64
- },
65
- },
66
- }}
67
- >
68
- {avatar}
69
- </Block>
70
- )}
71
- </Button>
72
- )
73
- },
74
- )
75
-
76
- export default ConnectedTrigger