@fairmint/ui 0.4.10 → 0.4.11
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/dist/components/BrandedLoadingScreen/BrandedLoadingScreen.cjs +1 -1
- package/dist/components/BrandedLoadingScreen/BrandedLoadingScreen.js +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.cjs +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.js +1 -1
- package/dist/components/form/FormField.cjs +1 -1
- package/dist/components/form/FormField.js +1 -1
- package/dist/components/generic/AgentSuggestion/AgentSuggestion.cjs +1 -1
- package/dist/components/generic/AgentSuggestion/AgentSuggestion.js +1 -1
- package/dist/components/generic/Banner/Banner.cjs +1 -1
- package/dist/components/generic/Banner/Banner.js +1 -1
- package/dist/components/generic/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/generic/BottomSheet/BottomSheet.js +1 -1
- package/dist/components/generic/CompanyBanner/CompanyBanner.cjs +1 -1
- package/dist/components/generic/CompanyBanner/CompanyBanner.js +1 -1
- package/dist/components/generic/ConfidentialityBanner/ConfidentialityBanner.cjs +1 -1
- package/dist/components/generic/ConfidentialityBanner/ConfidentialityBanner.js +1 -1
- package/dist/components/generic/Currency/Currency.cjs +1 -1
- package/dist/components/generic/Currency/Currency.js +1 -1
- package/dist/components/generic/DataRow/DataRow.cjs +24 -3
- package/dist/components/generic/DataRow/DataRow.cjs.map +1 -1
- package/dist/components/generic/DataRow/DataRow.d.ts.map +1 -1
- package/dist/components/generic/DataRow/DataRow.js +24 -3
- package/dist/components/generic/DataRow/DataRow.js.map +1 -1
- package/dist/components/generic/DataTable/DataTable.cjs +2 -2
- package/dist/components/generic/DataTable/DataTable.cjs.map +1 -1
- package/dist/components/generic/DataTable/DataTable.js +2 -2
- package/dist/components/generic/DataTable/DataTable.js.map +1 -1
- package/dist/components/generic/DateDisplay/DateDisplay.cjs +1 -1
- package/dist/components/generic/DateDisplay/DateDisplay.js +1 -1
- package/dist/components/generic/DocumentRow/DocumentRow.cjs +1 -1
- package/dist/components/generic/DocumentRow/DocumentRow.js +1 -1
- package/dist/components/generic/EditableSection/EditableSection.cjs +1 -1
- package/dist/components/generic/EditableSection/EditableSection.js +1 -1
- package/dist/components/generic/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/generic/EmptyState/EmptyState.js +1 -1
- package/dist/components/generic/ErrorPage/ErrorPage.cjs +1 -1
- package/dist/components/generic/ErrorPage/ErrorPage.js +1 -1
- package/dist/components/generic/Eyebrow/Eyebrow.cjs +1 -1
- package/dist/components/generic/Eyebrow/Eyebrow.js +1 -1
- package/dist/components/generic/FileDropzone/FileDropzone.cjs +1 -1
- package/dist/components/generic/FileDropzone/FileDropzone.js +1 -1
- package/dist/components/generic/ListRow/ListRow.cjs +5 -4
- package/dist/components/generic/ListRow/ListRow.cjs.map +1 -1
- package/dist/components/generic/ListRow/ListRow.d.ts.map +1 -1
- package/dist/components/generic/ListRow/ListRow.js +5 -4
- package/dist/components/generic/ListRow/ListRow.js.map +1 -1
- package/dist/components/generic/MultiSelectSearch/MultiSelectSearch.cjs +1 -1
- package/dist/components/generic/MultiSelectSearch/MultiSelectSearch.js +1 -1
- package/dist/components/generic/NotificationRow/NotificationRow.cjs +1 -1
- package/dist/components/generic/NotificationRow/NotificationRow.js +1 -1
- package/dist/components/generic/Percent/Percent.cjs +1 -1
- package/dist/components/generic/Percent/Percent.js +1 -1
- package/dist/components/generic/PhotoCropModal/PhotoCropModal.cjs +1 -1
- package/dist/components/generic/PhotoCropModal/PhotoCropModal.js +1 -1
- package/dist/components/generic/ProcessingState/ProcessingState.cjs +1 -1
- package/dist/components/generic/ProcessingState/ProcessingState.js +1 -1
- package/dist/components/generic/RadioCard/RadioCard.cjs +1 -1
- package/dist/components/generic/RadioCard/RadioCard.js +1 -1
- package/dist/components/generic/StatCard/StatCard.cjs +1 -1
- package/dist/components/generic/StatCard/StatCard.js +1 -1
- package/dist/components/generic/StepCard/StepCard.cjs +3 -2
- package/dist/components/generic/StepCard/StepCard.cjs.map +1 -1
- package/dist/components/generic/StepCard/StepCard.d.ts.map +1 -1
- package/dist/components/generic/StepCard/StepCard.js +3 -2
- package/dist/components/generic/StepCard/StepCard.js.map +1 -1
- package/dist/components/generic/TablePagination/TablePagination.cjs +1 -1
- package/dist/components/generic/TablePagination/TablePagination.js +1 -1
- package/dist/components/generic/TaskInboxPopover/TaskInboxPopover.cjs +1 -1
- package/dist/components/generic/TaskInboxPopover/TaskInboxPopover.js +1 -1
- package/dist/components/generic/TaskRow/TaskRow.cjs +1 -1
- package/dist/components/generic/TaskRow/TaskRow.js +1 -1
- package/dist/components/layout/AccountSheet/AccountSheet.cjs +1 -1
- package/dist/components/layout/AccountSheet/AccountSheet.js +1 -1
- package/dist/components/layout/MobileNav/MobileNav.cjs +1 -1
- package/dist/components/layout/MobileNav/MobileNav.js +1 -1
- package/dist/components/layout/PageHeader/PageHeader.cjs +1 -1
- package/dist/components/layout/PageHeader/PageHeader.js +1 -1
- package/dist/components/primitives/Glossary/GlossaryContext.cjs +39 -0
- package/dist/components/primitives/Glossary/GlossaryContext.cjs.map +1 -0
- package/dist/components/primitives/Glossary/GlossaryContext.d.ts +49 -0
- package/dist/components/primitives/Glossary/GlossaryContext.d.ts.map +1 -0
- package/dist/components/primitives/Glossary/GlossaryContext.js +39 -0
- package/dist/components/primitives/Glossary/GlossaryContext.js.map +1 -0
- package/dist/components/primitives/Glossary/GlossaryTerm.cjs +147 -0
- package/dist/components/primitives/Glossary/GlossaryTerm.cjs.map +1 -0
- package/dist/components/primitives/Glossary/GlossaryTerm.d.ts +10 -0
- package/dist/components/primitives/Glossary/GlossaryTerm.d.ts.map +1 -0
- package/dist/components/primitives/Glossary/GlossaryTerm.js +147 -0
- package/dist/components/primitives/Glossary/GlossaryTerm.js.map +1 -0
- package/dist/components/primitives/Glossary/index.d.ts +3 -0
- package/dist/components/primitives/Glossary/index.d.ts.map +1 -0
- package/dist/components/primitives/Text/Text.cjs +112 -0
- package/dist/components/primitives/Text/Text.cjs.map +1 -0
- package/dist/components/primitives/Text/Text.d.ts +22 -0
- package/dist/components/primitives/Text/Text.d.ts.map +1 -0
- package/dist/components/primitives/Text/Text.js +112 -0
- package/dist/components/primitives/Text/Text.js.map +1 -0
- package/dist/components/primitives/Text/index.d.ts +2 -0
- package/dist/components/primitives/Text/index.d.ts.map +1 -0
- package/dist/components/primitives/index.d.ts +2 -0
- package/dist/components/primitives/index.d.ts.map +1 -1
- package/dist/components/primitives/layout.cjs.map +1 -1
- package/dist/components/primitives/layout.d.ts +2 -1
- package/dist/components/primitives/layout.d.ts.map +1 -1
- package/dist/components/primitives/layout.js.map +1 -1
- package/dist/components/primitives/muiCompat.cjs +8 -8
- package/dist/components/primitives/muiCompat.cjs.map +1 -1
- package/dist/components/primitives/muiCompat.d.ts.map +1 -1
- package/dist/components/primitives/muiCompat.js +8 -8
- package/dist/components/primitives/muiCompat.js.map +1 -1
- package/dist/components/specific/DocumentRow/DocumentRow.cjs +1 -1
- package/dist/components/specific/DocumentRow/DocumentRow.js +1 -1
- package/dist/components/specific/InvestorProfileCard/InvestorProfileCard.cjs +1 -1
- package/dist/components/specific/InvestorProfileCard/InvestorProfileCard.js +1 -1
- package/dist/components/specific/WalletList/WalletList.cjs +1 -1
- package/dist/components/specific/WalletList/WalletList.js +1 -1
- package/dist/components/specific/WalletListItem/WalletListItem.cjs +3 -2
- package/dist/components/specific/WalletListItem/WalletListItem.cjs.map +1 -1
- package/dist/components/specific/WalletListItem/WalletListItem.d.ts.map +1 -1
- package/dist/components/specific/WalletListItem/WalletListItem.js +3 -2
- package/dist/components/specific/WalletListItem/WalletListItem.js.map +1 -1
- package/dist/constants/glossary.cjs +210 -0
- package/dist/constants/glossary.cjs.map +1 -0
- package/dist/constants/glossary.d.ts +26 -0
- package/dist/constants/glossary.d.ts.map +1 -0
- package/dist/constants/glossary.js +210 -0
- package/dist/constants/glossary.js.map +1 -0
- package/dist/fairmint-ui.cjs +13 -1
- package/dist/fairmint-ui.cjs.map +1 -1
- package/dist/fairmint-ui.js +13 -1
- package/dist/fairmint-ui.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/utils/glossaryMatcher.cjs +89 -0
- package/dist/utils/glossaryMatcher.cjs.map +1 -0
- package/dist/utils/glossaryMatcher.d.ts +23 -0
- package/dist/utils/glossaryMatcher.d.ts.map +1 -0
- package/dist/utils/glossaryMatcher.js +89 -0
- package/dist/utils/glossaryMatcher.js.map +1 -0
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ const format = require("../../../utils/format.cjs");
|
|
|
7
7
|
const layout = require("../../primitives/layout.cjs");
|
|
8
8
|
const ThemeIcon = require("../../../node_modules/@mantine/core/esm/components/ThemeIcon/ThemeIcon.cjs");
|
|
9
9
|
const Group = require("../../../node_modules/@mantine/core/esm/components/Group/Group.cjs");
|
|
10
|
-
const Text = require("
|
|
10
|
+
const Text = require("../../primitives/Text/Text.cjs");
|
|
11
11
|
const UnstyledButton = require("../../../node_modules/@mantine/core/esm/components/UnstyledButton/UnstyledButton.cjs");
|
|
12
12
|
const DefaultDocumentIcon = () => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13
13
|
"svg",
|
|
@@ -5,7 +5,7 @@ import { formatDate } from "../../../utils/format.js";
|
|
|
5
5
|
import { Box, Stack } from "../../primitives/layout.js";
|
|
6
6
|
import { ThemeIcon } from "../../../node_modules/@mantine/core/esm/components/ThemeIcon/ThemeIcon.js";
|
|
7
7
|
import { Group } from "../../../node_modules/@mantine/core/esm/components/Group/Group.js";
|
|
8
|
-
import { Text } from "
|
|
8
|
+
import { Text } from "../../primitives/Text/Text.js";
|
|
9
9
|
import { UnstyledButton } from "../../../node_modules/@mantine/core/esm/components/UnstyledButton/UnstyledButton.js";
|
|
10
10
|
const DefaultDocumentIcon = () => /* @__PURE__ */ jsxs(
|
|
11
11
|
"svg",
|
|
@@ -10,7 +10,7 @@ const Loader = require("../../primitives/Loader/Loader.cjs");
|
|
|
10
10
|
const layout = require("../../primitives/layout.cjs");
|
|
11
11
|
const Tooltip = require("../../primitives/Tooltip/Tooltip.cjs");
|
|
12
12
|
const Group = require("../../../node_modules/@mantine/core/esm/components/Group/Group.cjs");
|
|
13
|
-
const Text = require("
|
|
13
|
+
const Text = require("../../primitives/Text/Text.cjs");
|
|
14
14
|
function DefaultPencilIcon() {
|
|
15
15
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16
16
|
"svg",
|
|
@@ -8,7 +8,7 @@ import { Loader } from "../../primitives/Loader/Loader.js";
|
|
|
8
8
|
import { Stack, Box } from "../../primitives/layout.js";
|
|
9
9
|
import { Tooltip } from "../../primitives/Tooltip/Tooltip.js";
|
|
10
10
|
import { Group } from "../../../node_modules/@mantine/core/esm/components/Group/Group.js";
|
|
11
|
-
import { Text } from "
|
|
11
|
+
import { Text } from "../../primitives/Text/Text.js";
|
|
12
12
|
function DefaultPencilIcon() {
|
|
13
13
|
return /* @__PURE__ */ jsx(
|
|
14
14
|
"svg",
|
|
@@ -13,7 +13,7 @@ const layout = require("../../primitives/layout.cjs");
|
|
|
13
13
|
const Menu = require("../../primitives/Menu/Menu.cjs");
|
|
14
14
|
const TextInput = require("../../primitives/TextInput/TextInput.cjs");
|
|
15
15
|
const WalletListItem = require("../WalletListItem/WalletListItem.cjs");
|
|
16
|
-
const Text = require("
|
|
16
|
+
const Text = require("../../primitives/Text/Text.cjs");
|
|
17
17
|
const colors = require("../../../theme/colors.cjs");
|
|
18
18
|
const Group = require("../../../node_modules/@mantine/core/esm/components/Group/Group.cjs");
|
|
19
19
|
const ThemeIcon = require("../../../node_modules/@mantine/core/esm/components/ThemeIcon/ThemeIcon.cjs");
|
|
@@ -11,7 +11,7 @@ import { Stack } from "../../primitives/layout.js";
|
|
|
11
11
|
import { Menu } from "../../primitives/Menu/Menu.js";
|
|
12
12
|
import { TextInput } from "../../primitives/TextInput/TextInput.js";
|
|
13
13
|
import { WalletListItem } from "../WalletListItem/WalletListItem.js";
|
|
14
|
-
import { Text } from "
|
|
14
|
+
import { Text } from "../../primitives/Text/Text.js";
|
|
15
15
|
import { colors } from "../../../theme/colors.js";
|
|
16
16
|
import { Group } from "../../../node_modules/@mantine/core/esm/components/Group/Group.js";
|
|
17
17
|
import { ThemeIcon } from "../../../node_modules/@mantine/core/esm/components/ThemeIcon/ThemeIcon.js";
|
|
@@ -9,7 +9,7 @@ const Badge = require("../../primitives/Badge/Badge.cjs");
|
|
|
9
9
|
const layout = require("../../primitives/layout.cjs");
|
|
10
10
|
const Group = require("../../../node_modules/@mantine/core/esm/components/Group/Group.cjs");
|
|
11
11
|
const ThemeIcon = require("../../../node_modules/@mantine/core/esm/components/ThemeIcon/ThemeIcon.cjs");
|
|
12
|
-
const Text = require("
|
|
12
|
+
const Text = require("../../primitives/Text/Text.cjs");
|
|
13
13
|
const colors = require("../../../theme/colors.cjs");
|
|
14
14
|
const UnstyledButton = require("../../../node_modules/@mantine/core/esm/components/UnstyledButton/UnstyledButton.cjs");
|
|
15
15
|
function moveRadioSelection(current, delta) {
|
|
@@ -99,7 +99,7 @@ function WalletListItem({
|
|
|
99
99
|
),
|
|
100
100
|
/* @__PURE__ */ jsxRuntime.jsxs(layout.Stack, { gap: isCompact ? 2 : 4, style: { flex: 1, minWidth: 0 }, children: [
|
|
101
101
|
/* @__PURE__ */ jsxRuntime.jsxs(Group.Group, { gap: "xs", align: "center", wrap: "wrap", children: [
|
|
102
|
-
/* @__PURE__ */ jsxRuntime.jsx(Text.Text, { size: "sm", fw: 600, style: { wordBreak: "break-word" }, children: displayName }),
|
|
102
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text.Text, { size: "sm", fw: 600, style: { wordBreak: "break-word" }, glossary: false, children: displayName }),
|
|
103
103
|
wallet.defaultRecipient && /* @__PURE__ */ jsxRuntime.jsx(Badge.Badge, { size: "xs", color: colors.colors.warning, variant: "light", tt: "uppercase", children: "Default" }),
|
|
104
104
|
/* @__PURE__ */ jsxRuntime.jsx(Badge.Badge, { size: "xs", variant: "light", color: colors.colors.neutral, children: kindPill })
|
|
105
105
|
] }),
|
|
@@ -112,6 +112,7 @@ function WalletListItem({
|
|
|
112
112
|
title: wallet.address,
|
|
113
113
|
...isClickable ? { "aria-hidden": true } : { "aria-label": `Wallet address ${wallet.address}` },
|
|
114
114
|
style: { overflowWrap: "anywhere" },
|
|
115
|
+
glossary: false,
|
|
115
116
|
children: displayAddress
|
|
116
117
|
}
|
|
117
118
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletListItem.cjs","sources":["../../../../src/components/specific/WalletListItem/WalletListItem.tsx"],"sourcesContent":["import { type KeyboardEvent, type ReactNode, useLayoutEffect, useRef, useState } from \"react\";\nimport { brandColors, colors, fairmintVars, neutralColors, radii } from \"../../../theme\";\nimport { truncateAddress } from \"../../../utils/address\";\nimport {\n getWalletDisplayName,\n getWalletIconColor,\n getWalletKindPill,\n type Wallet,\n} from \"../../../utils/wallets\";\nimport { Badge } from \"../../primitives/Badge/Badge\";\nimport { Box, Group, Stack, Text, ThemeIcon, UnstyledButton } from \"../../primitives/layout\";\n\nexport interface WalletListItemProps {\n /** Wallet data used to derive the name, kind badge, and address. */\n wallet: Wallet;\n /** Number of address characters shown on each side of the ellipsis in compact density. */\n addressChars?: number;\n /** Row density. Compact is intended for picker/dropdown options. */\n density?: \"comfortable\" | \"compact\";\n /** Applies the indigo outline selected treatment. */\n selected?: boolean;\n /** Content rendered at the trailing edge of the row. */\n rightSection?: ReactNode;\n /** Leading wallet visual. Apps provide the icon so the library stays icon-package agnostic. */\n walletIcon?: ReactNode;\n /** Optional override for wallet type labels. */\n typeLabels?: Record<string, string>;\n /** Makes the primary row content a selectable radio option when supplied. */\n onClick?: () => void;\n /**\n * Accessible name for a clickable row.\n * Defaults to `{displayName}, {address}` so unlabeled wallets stay distinguishable.\n */\n ariaLabel?: string;\n}\n\nfunction moveRadioSelection(current: HTMLElement, delta: number): void {\n const group = current.closest('[role=\"radiogroup\"]');\n if (!group) return;\n const radios = Array.from(group.querySelectorAll<HTMLElement>('[role=\"radio\"]'));\n const index = radios.indexOf(current);\n if (index < 0 || radios.length === 0) return;\n const next = radios[(index + delta + radios.length) % radios.length];\n next.focus();\n next.click();\n}\n\nfunction handleRadioKeyDown(event: KeyboardEvent<HTMLButtonElement>): void {\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n event.preventDefault();\n moveRadioSelection(event.currentTarget, 1);\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n event.preventDefault();\n moveRadioSelection(event.currentTarget, -1);\n break;\n default:\n break;\n }\n}\n\nfunction radioTabIndex(radio: HTMLElement | null, selected: boolean): number {\n if (!radio) return 0;\n const group = radio.closest('[role=\"radiogroup\"]');\n if (!group) return 0;\n if (selected) return 0;\n const radios = Array.from(group.querySelectorAll<HTMLElement>('[role=\"radio\"]'));\n const anySelected = radios.some((item) => item.getAttribute(\"aria-checked\") === \"true\");\n if (!anySelected && radios[0] === radio) return 0;\n return -1;\n}\n\n/**\n * Reusable wallet display shell for lists, pickers, and read-only review rows.\n * Management actions such as rename, remove, and connect remain owned by the\n * composing flow.\n */\nexport function WalletListItem({\n wallet,\n addressChars = 6,\n density = \"comfortable\",\n selected = false,\n rightSection,\n walletIcon,\n typeLabels,\n onClick,\n ariaLabel,\n}: WalletListItemProps) {\n const isCompact = density === \"compact\";\n const displayName = getWalletDisplayName(wallet, typeLabels);\n const kindPill = getWalletKindPill(wallet.type, typeLabels);\n const displayAddress = isCompact ? truncateAddress(wallet.address, addressChars) : wallet.address;\n const padding = isCompact ? \"xs\" : \"md\";\n const alignment = isCompact ? \"center\" : \"flex-start\";\n const isClickable = Boolean(onClick);\n const radioRef = useRef<HTMLButtonElement>(null);\n const [tabIndex, setTabIndex] = useState(0);\n\n useLayoutEffect(() => {\n if (!isClickable) return;\n const radio = radioRef.current;\n if (!radio) return;\n\n const updateTabIndex = () => {\n setTabIndex(radioTabIndex(radio, selected));\n };\n updateTabIndex();\n\n const group = radio.closest('[role=\"radiogroup\"]');\n if (!group) return;\n\n const observer = new MutationObserver(updateTabIndex);\n observer.observe(group, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"aria-checked\", \"role\"],\n });\n return () => observer.disconnect();\n }, [isClickable, selected]);\n\n const mainContent = (\n <Group gap=\"sm\" align={alignment} wrap=\"nowrap\" style={{ flex: 1, minWidth: 0 }}>\n {walletIcon && (\n <ThemeIcon\n size={isCompact ? 32 : 40}\n radius=\"xl\"\n variant=\"light\"\n color={getWalletIconColor(wallet.type)}\n style={{ flexShrink: 0 }}\n >\n {walletIcon}\n </ThemeIcon>\n )}\n <Stack gap={isCompact ? 2 : 4} style={{ flex: 1, minWidth: 0 }}>\n <Group gap=\"xs\" align=\"center\" wrap=\"wrap\">\n <Text size=\"sm\" fw={600} style={{ wordBreak: \"break-word\" }}>\n {displayName}\n </Text>\n {wallet.defaultRecipient && (\n <Badge size=\"xs\" color={colors.warning} variant=\"light\" tt=\"uppercase\">\n Default\n </Badge>\n )}\n <Badge size=\"xs\" variant=\"light\" color={colors.neutral}>\n {kindPill}\n </Badge>\n </Group>\n <Text\n size=\"xs\"\n ff=\"monospace\"\n c={fairmintVars.colorTextSecondary}\n title={wallet.address}\n {...(isClickable\n ? { \"aria-hidden\": true }\n : { \"aria-label\": `Wallet address ${wallet.address}` })}\n style={{ overflowWrap: \"anywhere\" }}\n >\n {displayAddress}\n </Text>\n </Stack>\n </Group>\n );\n\n const trailing = rightSection ? <Box style={{ flexShrink: 0 }}>{rightSection}</Box> : null;\n\n const style = {\n borderRadius: radii.lg,\n border: selected\n ? `1px solid ${brandColors.indigo}`\n : isCompact\n ? \"1px solid transparent\"\n : `1px solid ${neutralColors[200]}`,\n } as const;\n\n const radioLabel = ariaLabel ?? `${displayName}, ${wallet.address}`;\n\n if (isClickable) {\n return (\n <Box\n data-selected={selected || undefined}\n className=\"fairmint-list-row\"\n w=\"100%\"\n p={padding}\n style={style}\n >\n <Group justify=\"space-between\" align={alignment} wrap=\"nowrap\" gap=\"xs\" w=\"100%\">\n <UnstyledButton\n ref={radioRef}\n onClick={onClick}\n onKeyDown={handleRadioKeyDown}\n role=\"radio\"\n aria-checked={selected}\n aria-label={radioLabel}\n tabIndex={tabIndex}\n style={{ flex: 1, minWidth: 0, textAlign: \"left\" }}\n >\n {mainContent}\n </UnstyledButton>\n {trailing}\n </Group>\n </Box>\n );\n }\n\n return (\n <Box data-selected={selected || undefined} w=\"100%\" p={padding} style={style}>\n <Group justify=\"space-between\" align={alignment} wrap=\"nowrap\" gap=\"xs\" w=\"100%\">\n {mainContent}\n {trailing}\n </Group>\n </Box>\n );\n}\n"],"names":["index","getWalletDisplayName","getWalletKindPill","truncateAddress","useRef","useState","useLayoutEffect","jsxs","Group","jsx","ThemeIcon","getWalletIconColor","Stack","Text","Badge","colors","fairmintVars","Box","radii","brandColors","neutralColors","UnstyledButton"],"mappings":";;;;;;;;;;;;;;AAoCA,SAAS,mBAAmB,SAAsB,OAAqB;AACrE,QAAM,QAAQ,QAAQ,QAAQ,qBAAqB;AACnD,MAAI,CAAC,MAAO;AACZ,QAAM,SAAS,MAAM,KAAK,MAAM,iBAA8B,gBAAgB,CAAC;AAC/E,QAAMA,SAAQ,OAAO,QAAQ,OAAO;AACpC,MAAIA,SAAQ,KAAK,OAAO,WAAW,EAAG;AACtC,QAAM,OAAO,QAAQA,SAAQ,QAAQ,OAAO,UAAU,OAAO,MAAM;AACnE,OAAK,MAAA;AACL,OAAK,MAAA;AACP;AAEA,SAAS,mBAAmB,OAA+C;AACzE,UAAQ,MAAM,KAAA;AAAA,IACZ,KAAK;AAAA,IACL,KAAK;AACH,YAAM,eAAA;AACN,yBAAmB,MAAM,eAAe,CAAC;AACzC;AAAA,IACF,KAAK;AAAA,IACL,KAAK;AACH,YAAM,eAAA;AACN,yBAAmB,MAAM,eAAe,EAAE;AAC1C;AAAA,EAEA;AAEN;AAEA,SAAS,cAAc,OAA2B,UAA2B;A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AAS,OAC9D,0CAACT,MAAAA,OAAA,EAAM,SAAQ,iBAAgB,OAAO,WAAW,MAAK,UAAS,KAAI,MAAK,GAAE,QACvE,UAAA;AAAA,IAAA;AAAA,IACA;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;;"}
|
|
1
|
+
{"version":3,"file":"WalletListItem.cjs","sources":["../../../../src/components/specific/WalletListItem/WalletListItem.tsx"],"sourcesContent":["import { type KeyboardEvent, type ReactNode, useLayoutEffect, useRef, useState } from \"react\";\nimport { brandColors, colors, fairmintVars, neutralColors, radii } from \"../../../theme\";\nimport { truncateAddress } from \"../../../utils/address\";\nimport {\n getWalletDisplayName,\n getWalletIconColor,\n getWalletKindPill,\n type Wallet,\n} from \"../../../utils/wallets\";\nimport { Badge } from \"../../primitives/Badge/Badge\";\nimport { Box, Group, Stack, Text, ThemeIcon, UnstyledButton } from \"../../primitives/layout\";\n\nexport interface WalletListItemProps {\n /** Wallet data used to derive the name, kind badge, and address. */\n wallet: Wallet;\n /** Number of address characters shown on each side of the ellipsis in compact density. */\n addressChars?: number;\n /** Row density. Compact is intended for picker/dropdown options. */\n density?: \"comfortable\" | \"compact\";\n /** Applies the indigo outline selected treatment. */\n selected?: boolean;\n /** Content rendered at the trailing edge of the row. */\n rightSection?: ReactNode;\n /** Leading wallet visual. Apps provide the icon so the library stays icon-package agnostic. */\n walletIcon?: ReactNode;\n /** Optional override for wallet type labels. */\n typeLabels?: Record<string, string>;\n /** Makes the primary row content a selectable radio option when supplied. */\n onClick?: () => void;\n /**\n * Accessible name for a clickable row.\n * Defaults to `{displayName}, {address}` so unlabeled wallets stay distinguishable.\n */\n ariaLabel?: string;\n}\n\nfunction moveRadioSelection(current: HTMLElement, delta: number): void {\n const group = current.closest('[role=\"radiogroup\"]');\n if (!group) return;\n const radios = Array.from(group.querySelectorAll<HTMLElement>('[role=\"radio\"]'));\n const index = radios.indexOf(current);\n if (index < 0 || radios.length === 0) return;\n const next = radios[(index + delta + radios.length) % radios.length];\n next.focus();\n next.click();\n}\n\nfunction handleRadioKeyDown(event: KeyboardEvent<HTMLButtonElement>): void {\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n event.preventDefault();\n moveRadioSelection(event.currentTarget, 1);\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n event.preventDefault();\n moveRadioSelection(event.currentTarget, -1);\n break;\n default:\n break;\n }\n}\n\nfunction radioTabIndex(radio: HTMLElement | null, selected: boolean): number {\n if (!radio) return 0;\n const group = radio.closest('[role=\"radiogroup\"]');\n if (!group) return 0;\n if (selected) return 0;\n const radios = Array.from(group.querySelectorAll<HTMLElement>('[role=\"radio\"]'));\n const anySelected = radios.some((item) => item.getAttribute(\"aria-checked\") === \"true\");\n if (!anySelected && radios[0] === radio) return 0;\n return -1;\n}\n\n/**\n * Reusable wallet display shell for lists, pickers, and read-only review rows.\n * Management actions such as rename, remove, and connect remain owned by the\n * composing flow.\n */\nexport function WalletListItem({\n wallet,\n addressChars = 6,\n density = \"comfortable\",\n selected = false,\n rightSection,\n walletIcon,\n typeLabels,\n onClick,\n ariaLabel,\n}: WalletListItemProps) {\n const isCompact = density === \"compact\";\n const displayName = getWalletDisplayName(wallet, typeLabels);\n const kindPill = getWalletKindPill(wallet.type, typeLabels);\n const displayAddress = isCompact ? truncateAddress(wallet.address, addressChars) : wallet.address;\n const padding = isCompact ? \"xs\" : \"md\";\n const alignment = isCompact ? \"center\" : \"flex-start\";\n const isClickable = Boolean(onClick);\n const radioRef = useRef<HTMLButtonElement>(null);\n const [tabIndex, setTabIndex] = useState(0);\n\n useLayoutEffect(() => {\n if (!isClickable) return;\n const radio = radioRef.current;\n if (!radio) return;\n\n const updateTabIndex = () => {\n setTabIndex(radioTabIndex(radio, selected));\n };\n updateTabIndex();\n\n const group = radio.closest('[role=\"radiogroup\"]');\n if (!group) return;\n\n const observer = new MutationObserver(updateTabIndex);\n observer.observe(group, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"aria-checked\", \"role\"],\n });\n return () => observer.disconnect();\n }, [isClickable, selected]);\n\n const mainContent = (\n <Group gap=\"sm\" align={alignment} wrap=\"nowrap\" style={{ flex: 1, minWidth: 0 }}>\n {walletIcon && (\n <ThemeIcon\n size={isCompact ? 32 : 40}\n radius=\"xl\"\n variant=\"light\"\n color={getWalletIconColor(wallet.type)}\n style={{ flexShrink: 0 }}\n >\n {walletIcon}\n </ThemeIcon>\n )}\n <Stack gap={isCompact ? 2 : 4} style={{ flex: 1, minWidth: 0 }}>\n <Group gap=\"xs\" align=\"center\" wrap=\"wrap\">\n <Text size=\"sm\" fw={600} style={{ wordBreak: \"break-word\" }} glossary={false}>\n {displayName}\n </Text>\n {wallet.defaultRecipient && (\n <Badge size=\"xs\" color={colors.warning} variant=\"light\" tt=\"uppercase\">\n Default\n </Badge>\n )}\n <Badge size=\"xs\" variant=\"light\" color={colors.neutral}>\n {kindPill}\n </Badge>\n </Group>\n <Text\n size=\"xs\"\n ff=\"monospace\"\n c={fairmintVars.colorTextSecondary}\n title={wallet.address}\n {...(isClickable\n ? { \"aria-hidden\": true }\n : { \"aria-label\": `Wallet address ${wallet.address}` })}\n style={{ overflowWrap: \"anywhere\" }}\n glossary={false}\n >\n {displayAddress}\n </Text>\n </Stack>\n </Group>\n );\n\n const trailing = rightSection ? <Box style={{ flexShrink: 0 }}>{rightSection}</Box> : null;\n\n const style = {\n borderRadius: radii.lg,\n border: selected\n ? `1px solid ${brandColors.indigo}`\n : isCompact\n ? \"1px solid transparent\"\n : `1px solid ${neutralColors[200]}`,\n } as const;\n\n const radioLabel = ariaLabel ?? `${displayName}, ${wallet.address}`;\n\n if (isClickable) {\n return (\n <Box\n data-selected={selected || undefined}\n className=\"fairmint-list-row\"\n w=\"100%\"\n p={padding}\n style={style}\n >\n <Group justify=\"space-between\" align={alignment} wrap=\"nowrap\" gap=\"xs\" w=\"100%\">\n <UnstyledButton\n ref={radioRef}\n onClick={onClick}\n onKeyDown={handleRadioKeyDown}\n role=\"radio\"\n aria-checked={selected}\n aria-label={radioLabel}\n tabIndex={tabIndex}\n style={{ flex: 1, minWidth: 0, textAlign: \"left\" }}\n >\n {mainContent}\n </UnstyledButton>\n {trailing}\n </Group>\n </Box>\n );\n }\n\n return (\n <Box data-selected={selected || undefined} w=\"100%\" p={padding} style={style}>\n <Group justify=\"space-between\" align={alignment} wrap=\"nowrap\" gap=\"xs\" w=\"100%\">\n {mainContent}\n {trailing}\n </Group>\n </Box>\n );\n}\n"],"names":["index","getWalletDisplayName","getWalletKindPill","truncateAddress","useRef","useState","useLayoutEffect","jsxs","Group","jsx","ThemeIcon","getWalletIconColor","Stack","Text","Badge","colors","fairmintVars","Box","radii","brandColors","neutralColors","UnstyledButton"],"mappings":";;;;;;;;;;;;;;AAoCA,SAAS,mBAAmB,SAAsB,OAAqB;AACrE,QAAM,QAAQ,QAAQ,QAAQ,qBAAqB;AACnD,MAAI,CAAC,MAAO;AACZ,QAAM,SAAS,MAAM,KAAK,MAAM,iBAA8B,gBAAgB,CAAC;AAC/E,QAAMA,SAAQ,OAAO,QAAQ,OAAO;AACpC,MAAIA,SAAQ,KAAK,OAAO,WAAW,EAAG;AACtC,QAAM,OAAO,QAAQA,SAAQ,QAAQ,OAAO,UAAU,OAAO,MAAM;AACnE,OAAK,MAAA;AACL,OAAK,MAAA;AACP;AAEA,SAAS,mBAAmB,OAA+C;AACzE,UAAQ,MAAM,KAAA;AAAA,IACZ,KAAK;AAAA,IACL,KAAK;AACH,YAAM,eAAA;AACN,yBAAmB,MAAM,eAAe,CAAC;AACzC;AAAA,IACF,KAAK;AAAA,IACL,KAAK;AACH,YAAM,eAAA;AACN,yBAAmB,MAAM,eAAe,EAAE;AAC1C;AAAA,EAEA;AAEN;AAEA,SAAS,cAAc,OAA2B,UAA2B;AAC3E,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,QAAQ,MAAM,QAAQ,qBAAqB;AACjD,MAAI,CAAC,MAAO,QAAO;AACnB,MAAI,SAAU,QAAO;AAC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A;AAAA,IAAA;AAAA,IACA;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletListItem.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/WalletListItem/WalletListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAqC,MAAM,OAAO,CAAC;AAG9F,OAAO,EAIL,KAAK,MAAM,EACZ,MAAM,wBAAwB,CAAC;AAIhC,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACpC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wDAAwD;IACxD,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,+FAA+F;IAC/F,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyCD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,YAAgB,EAChB,OAAuB,EACvB,QAAgB,EAChB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,OAAO,EACP,SAAS,GACV,EAAE,mBAAmB,+
|
|
1
|
+
{"version":3,"file":"WalletListItem.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/WalletListItem/WalletListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAqC,MAAM,OAAO,CAAC;AAG9F,OAAO,EAIL,KAAK,MAAM,EACZ,MAAM,wBAAwB,CAAC;AAIhC,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACpC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wDAAwD;IACxD,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,+FAA+F;IAC/F,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyCD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,YAAgB,EAChB,OAAuB,EACvB,QAAgB,EAChB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,OAAO,EACP,SAAS,GACV,EAAE,mBAAmB,+BA+HrB"}
|
|
@@ -7,7 +7,7 @@ import { Badge } from "../../primitives/Badge/Badge.js";
|
|
|
7
7
|
import { Stack, Box } from "../../primitives/layout.js";
|
|
8
8
|
import { Group } from "../../../node_modules/@mantine/core/esm/components/Group/Group.js";
|
|
9
9
|
import { ThemeIcon } from "../../../node_modules/@mantine/core/esm/components/ThemeIcon/ThemeIcon.js";
|
|
10
|
-
import { Text } from "
|
|
10
|
+
import { Text } from "../../primitives/Text/Text.js";
|
|
11
11
|
import { colors } from "../../../theme/colors.js";
|
|
12
12
|
import { UnstyledButton } from "../../../node_modules/@mantine/core/esm/components/UnstyledButton/UnstyledButton.js";
|
|
13
13
|
function moveRadioSelection(current, delta) {
|
|
@@ -97,7 +97,7 @@ function WalletListItem({
|
|
|
97
97
|
),
|
|
98
98
|
/* @__PURE__ */ jsxs(Stack, { gap: isCompact ? 2 : 4, style: { flex: 1, minWidth: 0 }, children: [
|
|
99
99
|
/* @__PURE__ */ jsxs(Group, { gap: "xs", align: "center", wrap: "wrap", children: [
|
|
100
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, style: { wordBreak: "break-word" }, children: displayName }),
|
|
100
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, style: { wordBreak: "break-word" }, glossary: false, children: displayName }),
|
|
101
101
|
wallet.defaultRecipient && /* @__PURE__ */ jsx(Badge, { size: "xs", color: colors.warning, variant: "light", tt: "uppercase", children: "Default" }),
|
|
102
102
|
/* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: colors.neutral, children: kindPill })
|
|
103
103
|
] }),
|
|
@@ -110,6 +110,7 @@ function WalletListItem({
|
|
|
110
110
|
title: wallet.address,
|
|
111
111
|
...isClickable ? { "aria-hidden": true } : { "aria-label": `Wallet address ${wallet.address}` },
|
|
112
112
|
style: { overflowWrap: "anywhere" },
|
|
113
|
+
glossary: false,
|
|
113
114
|
children: displayAddress
|
|
114
115
|
}
|
|
115
116
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletListItem.js","sources":["../../../../src/components/specific/WalletListItem/WalletListItem.tsx"],"sourcesContent":["import { type KeyboardEvent, type ReactNode, useLayoutEffect, useRef, useState } from \"react\";\nimport { brandColors, colors, fairmintVars, neutralColors, radii } from \"../../../theme\";\nimport { truncateAddress } from \"../../../utils/address\";\nimport {\n getWalletDisplayName,\n getWalletIconColor,\n getWalletKindPill,\n type Wallet,\n} from \"../../../utils/wallets\";\nimport { Badge } from \"../../primitives/Badge/Badge\";\nimport { Box, Group, Stack, Text, ThemeIcon, UnstyledButton } from \"../../primitives/layout\";\n\nexport interface WalletListItemProps {\n /** Wallet data used to derive the name, kind badge, and address. */\n wallet: Wallet;\n /** Number of address characters shown on each side of the ellipsis in compact density. */\n addressChars?: number;\n /** Row density. Compact is intended for picker/dropdown options. */\n density?: \"comfortable\" | \"compact\";\n /** Applies the indigo outline selected treatment. */\n selected?: boolean;\n /** Content rendered at the trailing edge of the row. */\n rightSection?: ReactNode;\n /** Leading wallet visual. Apps provide the icon so the library stays icon-package agnostic. */\n walletIcon?: ReactNode;\n /** Optional override for wallet type labels. */\n typeLabels?: Record<string, string>;\n /** Makes the primary row content a selectable radio option when supplied. */\n onClick?: () => void;\n /**\n * Accessible name for a clickable row.\n * Defaults to `{displayName}, {address}` so unlabeled wallets stay distinguishable.\n */\n ariaLabel?: string;\n}\n\nfunction moveRadioSelection(current: HTMLElement, delta: number): void {\n const group = current.closest('[role=\"radiogroup\"]');\n if (!group) return;\n const radios = Array.from(group.querySelectorAll<HTMLElement>('[role=\"radio\"]'));\n const index = radios.indexOf(current);\n if (index < 0 || radios.length === 0) return;\n const next = radios[(index + delta + radios.length) % radios.length];\n next.focus();\n next.click();\n}\n\nfunction handleRadioKeyDown(event: KeyboardEvent<HTMLButtonElement>): void {\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n event.preventDefault();\n moveRadioSelection(event.currentTarget, 1);\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n event.preventDefault();\n moveRadioSelection(event.currentTarget, -1);\n break;\n default:\n break;\n }\n}\n\nfunction radioTabIndex(radio: HTMLElement | null, selected: boolean): number {\n if (!radio) return 0;\n const group = radio.closest('[role=\"radiogroup\"]');\n if (!group) return 0;\n if (selected) return 0;\n const radios = Array.from(group.querySelectorAll<HTMLElement>('[role=\"radio\"]'));\n const anySelected = radios.some((item) => item.getAttribute(\"aria-checked\") === \"true\");\n if (!anySelected && radios[0] === radio) return 0;\n return -1;\n}\n\n/**\n * Reusable wallet display shell for lists, pickers, and read-only review rows.\n * Management actions such as rename, remove, and connect remain owned by the\n * composing flow.\n */\nexport function WalletListItem({\n wallet,\n addressChars = 6,\n density = \"comfortable\",\n selected = false,\n rightSection,\n walletIcon,\n typeLabels,\n onClick,\n ariaLabel,\n}: WalletListItemProps) {\n const isCompact = density === \"compact\";\n const displayName = getWalletDisplayName(wallet, typeLabels);\n const kindPill = getWalletKindPill(wallet.type, typeLabels);\n const displayAddress = isCompact ? truncateAddress(wallet.address, addressChars) : wallet.address;\n const padding = isCompact ? \"xs\" : \"md\";\n const alignment = isCompact ? \"center\" : \"flex-start\";\n const isClickable = Boolean(onClick);\n const radioRef = useRef<HTMLButtonElement>(null);\n const [tabIndex, setTabIndex] = useState(0);\n\n useLayoutEffect(() => {\n if (!isClickable) return;\n const radio = radioRef.current;\n if (!radio) return;\n\n const updateTabIndex = () => {\n setTabIndex(radioTabIndex(radio, selected));\n };\n updateTabIndex();\n\n const group = radio.closest('[role=\"radiogroup\"]');\n if (!group) return;\n\n const observer = new MutationObserver(updateTabIndex);\n observer.observe(group, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"aria-checked\", \"role\"],\n });\n return () => observer.disconnect();\n }, [isClickable, selected]);\n\n const mainContent = (\n <Group gap=\"sm\" align={alignment} wrap=\"nowrap\" style={{ flex: 1, minWidth: 0 }}>\n {walletIcon && (\n <ThemeIcon\n size={isCompact ? 32 : 40}\n radius=\"xl\"\n variant=\"light\"\n color={getWalletIconColor(wallet.type)}\n style={{ flexShrink: 0 }}\n >\n {walletIcon}\n </ThemeIcon>\n )}\n <Stack gap={isCompact ? 2 : 4} style={{ flex: 1, minWidth: 0 }}>\n <Group gap=\"xs\" align=\"center\" wrap=\"wrap\">\n <Text size=\"sm\" fw={600} style={{ wordBreak: \"break-word\" }}>\n {displayName}\n </Text>\n {wallet.defaultRecipient && (\n <Badge size=\"xs\" color={colors.warning} variant=\"light\" tt=\"uppercase\">\n Default\n </Badge>\n )}\n <Badge size=\"xs\" variant=\"light\" color={colors.neutral}>\n {kindPill}\n </Badge>\n </Group>\n <Text\n size=\"xs\"\n ff=\"monospace\"\n c={fairmintVars.colorTextSecondary}\n title={wallet.address}\n {...(isClickable\n ? { \"aria-hidden\": true }\n : { \"aria-label\": `Wallet address ${wallet.address}` })}\n style={{ overflowWrap: \"anywhere\" }}\n >\n {displayAddress}\n </Text>\n </Stack>\n </Group>\n );\n\n const trailing = rightSection ? <Box style={{ flexShrink: 0 }}>{rightSection}</Box> : null;\n\n const style = {\n borderRadius: radii.lg,\n border: selected\n ? `1px solid ${brandColors.indigo}`\n : isCompact\n ? \"1px solid transparent\"\n : `1px solid ${neutralColors[200]}`,\n } as const;\n\n const radioLabel = ariaLabel ?? `${displayName}, ${wallet.address}`;\n\n if (isClickable) {\n return (\n <Box\n data-selected={selected || undefined}\n className=\"fairmint-list-row\"\n w=\"100%\"\n p={padding}\n style={style}\n >\n <Group justify=\"space-between\" align={alignment} wrap=\"nowrap\" gap=\"xs\" w=\"100%\">\n <UnstyledButton\n ref={radioRef}\n onClick={onClick}\n onKeyDown={handleRadioKeyDown}\n role=\"radio\"\n aria-checked={selected}\n aria-label={radioLabel}\n tabIndex={tabIndex}\n style={{ flex: 1, minWidth: 0, textAlign: \"left\" }}\n >\n {mainContent}\n </UnstyledButton>\n {trailing}\n </Group>\n </Box>\n );\n }\n\n return (\n <Box data-selected={selected || undefined} w=\"100%\" p={padding} style={style}>\n <Group justify=\"space-between\" align={alignment} wrap=\"nowrap\" gap=\"xs\" w=\"100%\">\n {mainContent}\n {trailing}\n </Group>\n </Box>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAoCA,SAAS,mBAAmB,SAAsB,OAAqB;AACrE,QAAM,QAAQ,QAAQ,QAAQ,qBAAqB;AACnD,MAAI,CAAC,MAAO;AACZ,QAAM,SAAS,MAAM,KAAK,MAAM,iBAA8B,gBAAgB,CAAC;AAC/E,QAAM,QAAQ,OAAO,QAAQ,OAAO;AACpC,MAAI,QAAQ,KAAK,OAAO,WAAW,EAAG;AACtC,QAAM,OAAO,QAAQ,QAAQ,QAAQ,OAAO,UAAU,OAAO,MAAM;AACnE,OAAK,MAAA;AACL,OAAK,MAAA;AACP;AAEA,SAAS,mBAAmB,OAA+C;AACzE,UAAQ,MAA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AAS,KAAI,MAAK,GAAE,QACvE,UAAA;AAAA,IAAA;AAAA,IACA;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"WalletListItem.js","sources":["../../../../src/components/specific/WalletListItem/WalletListItem.tsx"],"sourcesContent":["import { type KeyboardEvent, type ReactNode, useLayoutEffect, useRef, useState } from \"react\";\nimport { brandColors, colors, fairmintVars, neutralColors, radii } from \"../../../theme\";\nimport { truncateAddress } from \"../../../utils/address\";\nimport {\n getWalletDisplayName,\n getWalletIconColor,\n getWalletKindPill,\n type Wallet,\n} from \"../../../utils/wallets\";\nimport { Badge } from \"../../primitives/Badge/Badge\";\nimport { Box, Group, Stack, Text, ThemeIcon, UnstyledButton } from \"../../primitives/layout\";\n\nexport interface WalletListItemProps {\n /** Wallet data used to derive the name, kind badge, and address. */\n wallet: Wallet;\n /** Number of address characters shown on each side of the ellipsis in compact density. */\n addressChars?: number;\n /** Row density. Compact is intended for picker/dropdown options. */\n density?: \"comfortable\" | \"compact\";\n /** Applies the indigo outline selected treatment. */\n selected?: boolean;\n /** Content rendered at the trailing edge of the row. */\n rightSection?: ReactNode;\n /** Leading wallet visual. Apps provide the icon so the library stays icon-package agnostic. */\n walletIcon?: ReactNode;\n /** Optional override for wallet type labels. */\n typeLabels?: Record<string, string>;\n /** Makes the primary row content a selectable radio option when supplied. */\n onClick?: () => void;\n /**\n * Accessible name for a clickable row.\n * Defaults to `{displayName}, {address}` so unlabeled wallets stay distinguishable.\n */\n ariaLabel?: string;\n}\n\nfunction moveRadioSelection(current: HTMLElement, delta: number): void {\n const group = current.closest('[role=\"radiogroup\"]');\n if (!group) return;\n const radios = Array.from(group.querySelectorAll<HTMLElement>('[role=\"radio\"]'));\n const index = radios.indexOf(current);\n if (index < 0 || radios.length === 0) return;\n const next = radios[(index + delta + radios.length) % radios.length];\n next.focus();\n next.click();\n}\n\nfunction handleRadioKeyDown(event: KeyboardEvent<HTMLButtonElement>): void {\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n event.preventDefault();\n moveRadioSelection(event.currentTarget, 1);\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n event.preventDefault();\n moveRadioSelection(event.currentTarget, -1);\n break;\n default:\n break;\n }\n}\n\nfunction radioTabIndex(radio: HTMLElement | null, selected: boolean): number {\n if (!radio) return 0;\n const group = radio.closest('[role=\"radiogroup\"]');\n if (!group) return 0;\n if (selected) return 0;\n const radios = Array.from(group.querySelectorAll<HTMLElement>('[role=\"radio\"]'));\n const anySelected = radios.some((item) => item.getAttribute(\"aria-checked\") === \"true\");\n if (!anySelected && radios[0] === radio) return 0;\n return -1;\n}\n\n/**\n * Reusable wallet display shell for lists, pickers, and read-only review rows.\n * Management actions such as rename, remove, and connect remain owned by the\n * composing flow.\n */\nexport function WalletListItem({\n wallet,\n addressChars = 6,\n density = \"comfortable\",\n selected = false,\n rightSection,\n walletIcon,\n typeLabels,\n onClick,\n ariaLabel,\n}: WalletListItemProps) {\n const isCompact = density === \"compact\";\n const displayName = getWalletDisplayName(wallet, typeLabels);\n const kindPill = getWalletKindPill(wallet.type, typeLabels);\n const displayAddress = isCompact ? truncateAddress(wallet.address, addressChars) : wallet.address;\n const padding = isCompact ? \"xs\" : \"md\";\n const alignment = isCompact ? \"center\" : \"flex-start\";\n const isClickable = Boolean(onClick);\n const radioRef = useRef<HTMLButtonElement>(null);\n const [tabIndex, setTabIndex] = useState(0);\n\n useLayoutEffect(() => {\n if (!isClickable) return;\n const radio = radioRef.current;\n if (!radio) return;\n\n const updateTabIndex = () => {\n setTabIndex(radioTabIndex(radio, selected));\n };\n updateTabIndex();\n\n const group = radio.closest('[role=\"radiogroup\"]');\n if (!group) return;\n\n const observer = new MutationObserver(updateTabIndex);\n observer.observe(group, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"aria-checked\", \"role\"],\n });\n return () => observer.disconnect();\n }, [isClickable, selected]);\n\n const mainContent = (\n <Group gap=\"sm\" align={alignment} wrap=\"nowrap\" style={{ flex: 1, minWidth: 0 }}>\n {walletIcon && (\n <ThemeIcon\n size={isCompact ? 32 : 40}\n radius=\"xl\"\n variant=\"light\"\n color={getWalletIconColor(wallet.type)}\n style={{ flexShrink: 0 }}\n >\n {walletIcon}\n </ThemeIcon>\n )}\n <Stack gap={isCompact ? 2 : 4} style={{ flex: 1, minWidth: 0 }}>\n <Group gap=\"xs\" align=\"center\" wrap=\"wrap\">\n <Text size=\"sm\" fw={600} style={{ wordBreak: \"break-word\" }} glossary={false}>\n {displayName}\n </Text>\n {wallet.defaultRecipient && (\n <Badge size=\"xs\" color={colors.warning} variant=\"light\" tt=\"uppercase\">\n Default\n </Badge>\n )}\n <Badge size=\"xs\" variant=\"light\" color={colors.neutral}>\n {kindPill}\n </Badge>\n </Group>\n <Text\n size=\"xs\"\n ff=\"monospace\"\n c={fairmintVars.colorTextSecondary}\n title={wallet.address}\n {...(isClickable\n ? { \"aria-hidden\": true }\n : { \"aria-label\": `Wallet address ${wallet.address}` })}\n style={{ overflowWrap: \"anywhere\" }}\n glossary={false}\n >\n {displayAddress}\n </Text>\n </Stack>\n </Group>\n );\n\n const trailing = rightSection ? <Box style={{ flexShrink: 0 }}>{rightSection}</Box> : null;\n\n const style = {\n borderRadius: radii.lg,\n border: selected\n ? `1px solid ${brandColors.indigo}`\n : isCompact\n ? \"1px solid transparent\"\n : `1px solid ${neutralColors[200]}`,\n } as const;\n\n const radioLabel = ariaLabel ?? `${displayName}, ${wallet.address}`;\n\n if (isClickable) {\n return (\n <Box\n data-selected={selected || undefined}\n className=\"fairmint-list-row\"\n w=\"100%\"\n p={padding}\n style={style}\n >\n <Group justify=\"space-between\" align={alignment} wrap=\"nowrap\" gap=\"xs\" w=\"100%\">\n <UnstyledButton\n ref={radioRef}\n onClick={onClick}\n onKeyDown={handleRadioKeyDown}\n role=\"radio\"\n aria-checked={selected}\n aria-label={radioLabel}\n tabIndex={tabIndex}\n style={{ flex: 1, minWidth: 0, textAlign: \"left\" }}\n >\n {mainContent}\n </UnstyledButton>\n {trailing}\n </Group>\n </Box>\n );\n }\n\n return (\n <Box data-selected={selected || undefined} w=\"100%\" p={padding} style={style}>\n <Group justify=\"space-between\" align={alignment} wrap=\"nowrap\" gap=\"xs\" w=\"100%\">\n {mainContent}\n {trailing}\n </Group>\n </Box>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAoCA,SAAS,mBAAmB,SAAsB,OAAqB;AACrE,QAAM,QAAQ,QAAQ,QAAQ,qBAAqB;AACnD,MAAI,CAAC,MAAO;AACZ,QAAM,SAAS,MAAM,KAAK,MAAM,iBAA8B,gBAAgB,CAAC;AAC/E,QAAM,QAAQ,OAAO,QAAQ,OAAO;AACpC,MAAI,QAAQ,KAAK,OAAO,WAAW,EAAG;AACtC,QAAM,OAAO,QAAQ,QAAQ,QAAQ,OAAO,UAAU,OAAO,MAAM;AACnE,OAAK,MAAA;AACL,OAAK,MAAA;AACP;AAEA,SAAS,mBAAmB,OAA+C;AACzE,UAAQ,MAAM,KAAA;AAAA,IACZ,KAAK;AAAA,IACL,KAAK;AACH,YAAM,eAAA;AACN,yBAAmB,MAAM,eAAe,CAAC;AACzC;AAAA,IACF,KAAK;AAAA,IACL,KAAK;AACH,YAAM,eAAA;AACN,yBAAmB,MAAM,eAAe,EAAE;AAC1C;AAAA,EAEA;AAEN;AAEA,SAAS,cAAc,OAA2B,UAA2B;AAC3E,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,QAAQ,MAAM,QAAQ,qBAAqB;AACjD,MAAI,CAAC,MAAO,QAAO;AACnB,MAAI,SAAU,QAAO;AACrB,QAAM,SAAS,MAAM,KAAK,MAAM,iBAA8B,gBAAgB,CAAC;AAC/E,QAAM,cAAc,OAAO,KAAK,CAAC,SAAS,KAAK,aAAa,cAAc,MAAM,MAAM;AACtF,MAAI,CAAC,eAAe,OAAO,CAAC,MAAM,MAAO,QAAO;AAChD,SAAO;AACT;AAOO,SAAS,eAAe;AAAA,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AA,MAAC;AAAA,MAAA;AAAA,QACC,iBAAe,YAAY;AAAA,QAC3B,WAAU;AAAA,QACV,GAAE;AAAA,QACF,GAAG;AAAA,QACH;AAAA,QAEA,UAAA,qBAAC,OAAA,EAAM,SAAQ,iBAAgB,OAAO,WAAW,MAAK,UAAS,KAAI,MAAK,GAAE,QACxE,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAK;AAAA,cACL;AAAA,cACA,WAAW;AAAA,cACX,MAAK;AAAA,cACL,gBAAc;AAAA,cACd,cAAY;AAAA,cACZ;AAAA,cACA,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,OAAA;AAAA,cAEzC,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAEF;AAAA,QAAA,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AAEA,SACE,oBAAC,OAAI,iBAAe,YAAY,QAAW,GAAE,QAAO,GAAG,SAAS,OAC9D,+BAAC,OAAA,EAAM,SAAQ,iBAAgB,OAAO,WAAW,MAAK,UAAS,KAAI,MAAK,GAAE,QACvE,UAAA;AAAA,IAAA;AAAA,IACA;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const FINANCIAL_GLOSSARY = [
|
|
4
|
+
{
|
|
5
|
+
id: "SPV",
|
|
6
|
+
label: "SPV",
|
|
7
|
+
aliases: ["SPV", "SPVs"],
|
|
8
|
+
question: "What is an SPV?",
|
|
9
|
+
explanation: "A special-purpose vehicle that pools multiple investors into one line on the cap table.",
|
|
10
|
+
matchSensitive: true
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: "Reg D 506(b)",
|
|
14
|
+
label: "Reg D 506(b)",
|
|
15
|
+
aliases: ["Reg D 506(b)", "Rule 506(b)"],
|
|
16
|
+
question: "What is a Reg D 506(b) offering?",
|
|
17
|
+
explanation: "A private offering allowing accredited investors and up to 35 non-accredited investors, with no general solicitation or advertising.",
|
|
18
|
+
matchSensitive: false
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "Rule 506(c)",
|
|
22
|
+
label: "Rule 506(c)",
|
|
23
|
+
aliases: ["Rule 506(c)", "Reg D 506(c)"],
|
|
24
|
+
question: "What is a Rule 506(c) offering?",
|
|
25
|
+
explanation: "A private offering that permits general advertising, but requires all investors to be verified as accredited.",
|
|
26
|
+
matchSensitive: false
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "Post-money SAFE",
|
|
30
|
+
label: "Post-money SAFE",
|
|
31
|
+
aliases: ["post-money SAFE"],
|
|
32
|
+
question: "What is a post-money SAFE?",
|
|
33
|
+
explanation: "A Simple Agreement for Future Equity whose valuation cap is calculated after the round's investment is added.",
|
|
34
|
+
matchSensitive: false
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "Pre-money SAFE",
|
|
38
|
+
label: "Pre-money SAFE",
|
|
39
|
+
aliases: ["pre-money SAFE"],
|
|
40
|
+
question: "What is a pre-money SAFE?",
|
|
41
|
+
explanation: "A Simple Agreement for Future Equity whose valuation cap is calculated before the round's investment is added.",
|
|
42
|
+
matchSensitive: false
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "Valuation cap",
|
|
46
|
+
label: "Valuation cap",
|
|
47
|
+
aliases: ["valuation cap"],
|
|
48
|
+
question: "What is a valuation cap?",
|
|
49
|
+
explanation: "The maximum company valuation at which an investment instrument will convert into equity.",
|
|
50
|
+
matchSensitive: false
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: "Pro-rata rights",
|
|
54
|
+
label: "Pro-rata rights",
|
|
55
|
+
aliases: ["pro-rata rights", "pro rata rights", "pro-rata", "pro rata"],
|
|
56
|
+
question: "What are pro-rata rights?",
|
|
57
|
+
explanation: "The contractual right of an investor to participate in future financing rounds to maintain their ownership percentage.",
|
|
58
|
+
matchSensitive: false
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "MFN",
|
|
62
|
+
label: "MFN",
|
|
63
|
+
aliases: ["most favored nation", "MFN"],
|
|
64
|
+
question: "What is an MFN clause?",
|
|
65
|
+
explanation: "Most Favored Nation: a clause entitling an investor to receive any more favorable terms offered to subsequent investors.",
|
|
66
|
+
matchSensitive: false
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: "Token warrant",
|
|
70
|
+
label: "Token warrant",
|
|
71
|
+
aliases: ["token warrant", "token warrants"],
|
|
72
|
+
question: "What is a token warrant?",
|
|
73
|
+
explanation: "A contractual right granting the holder the option to purchase future digital tokens at a predetermined price.",
|
|
74
|
+
matchSensitive: false
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "Convertible note",
|
|
78
|
+
label: "Convertible note",
|
|
79
|
+
aliases: ["convertible note", "convertible notes"],
|
|
80
|
+
question: "What is a convertible note?",
|
|
81
|
+
explanation: "A debt instrument that converts into equity at a future financing event rather than being repaid in cash.",
|
|
82
|
+
matchSensitive: false
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: "Master fund",
|
|
86
|
+
label: "Master fund",
|
|
87
|
+
aliases: ["master fund"],
|
|
88
|
+
question: "What is a master fund?",
|
|
89
|
+
explanation: "A parent fund structure that holds and manages multiple underlying series or sub-funds under unified governance.",
|
|
90
|
+
matchSensitive: false
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: "LPA",
|
|
94
|
+
label: "LPA",
|
|
95
|
+
aliases: ["limited partnership agreement", "LPA"],
|
|
96
|
+
question: "What is an LPA?",
|
|
97
|
+
explanation: "Limited Partnership Agreement: the core legal agreement governing the rights, obligations, and terms of a fund partnership.",
|
|
98
|
+
matchSensitive: false
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "Accredited investor",
|
|
102
|
+
label: "Accredited investor",
|
|
103
|
+
aliases: ["accredited investor", "accredited investors"],
|
|
104
|
+
question: "Who is an accredited investor?",
|
|
105
|
+
explanation: "An individual or entity meeting specific SEC income or net worth thresholds, permitted to invest in unregistered securities.",
|
|
106
|
+
matchSensitive: false
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: "409A",
|
|
110
|
+
label: "409A",
|
|
111
|
+
aliases: ["409A", "409a"],
|
|
112
|
+
question: "What is a 409A valuation?",
|
|
113
|
+
explanation: "An independent appraisal of a private company's common stock fair market value, required to set compliant option exercise prices.",
|
|
114
|
+
matchSensitive: false
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: "ISO",
|
|
118
|
+
label: "ISO",
|
|
119
|
+
aliases: ["ISO", "ISOs"],
|
|
120
|
+
question: "What is an ISO?",
|
|
121
|
+
explanation: "Incentive Stock Option: a statutory stock option available to employees with potential tax advantages upon exercise.",
|
|
122
|
+
matchSensitive: true
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: "NSO",
|
|
126
|
+
label: "NSO",
|
|
127
|
+
aliases: ["NSO", "NSOs"],
|
|
128
|
+
question: "What is an NSO?",
|
|
129
|
+
explanation: "Non-Qualified Stock Option: a stock option that does not qualify for special IRS tax treatment and is taxed at ordinary income rates on exercise.",
|
|
130
|
+
matchSensitive: true
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: "RSU",
|
|
134
|
+
label: "RSU",
|
|
135
|
+
aliases: ["RSU", "RSUs"],
|
|
136
|
+
question: "What is an RSU?",
|
|
137
|
+
explanation: "Restricted Stock Unit: a grant of company shares that are delivered upon meeting vesting conditions, with no purchase price required.",
|
|
138
|
+
matchSensitive: true
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "Vesting",
|
|
142
|
+
label: "Vesting",
|
|
143
|
+
aliases: ["vesting", "vesting schedule", "cliff"],
|
|
144
|
+
question: "What is vesting?",
|
|
145
|
+
explanation: "The process or schedule by which an individual earns full ownership of equity over time. A cliff is the initial waiting period before any equity vests.",
|
|
146
|
+
matchSensitive: false
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: "Exercise price",
|
|
150
|
+
label: "Exercise price",
|
|
151
|
+
aliases: ["exercise price", "strike price"],
|
|
152
|
+
question: "What is an exercise price?",
|
|
153
|
+
explanation: "The fixed price per share at which an option holder can purchase underlying company stock.",
|
|
154
|
+
matchSensitive: false
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: "Option pool",
|
|
158
|
+
label: "Option pool",
|
|
159
|
+
aliases: ["option pool", "option pools"],
|
|
160
|
+
question: "What is an option pool?",
|
|
161
|
+
explanation: "A block of company shares set aside to grant to future employees, contractors, and advisors as equity compensation.",
|
|
162
|
+
matchSensitive: false
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: "Fully diluted",
|
|
166
|
+
label: "Fully diluted",
|
|
167
|
+
aliases: ["fully diluted"],
|
|
168
|
+
question: "What does fully diluted mean?",
|
|
169
|
+
explanation: "A calculation of total ownership that assumes all convertibles, options, warrants, and unissued pool shares are converted into common shares.",
|
|
170
|
+
matchSensitive: false
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: "Form D",
|
|
174
|
+
label: "Form D",
|
|
175
|
+
aliases: ["Form D"],
|
|
176
|
+
question: "What is Form D?",
|
|
177
|
+
explanation: "A brief notice filed with the SEC within 15 days of the first sale of securities in an exempt Regulation D offering.",
|
|
178
|
+
matchSensitive: true
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: "KYC",
|
|
182
|
+
label: "KYC",
|
|
183
|
+
aliases: ["know your customer", "KYC"],
|
|
184
|
+
question: "What is KYC?",
|
|
185
|
+
explanation: "Know Your Customer: regulatory requirements to verify the identity of investors before accepting capital.",
|
|
186
|
+
matchSensitive: false
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: "AML",
|
|
190
|
+
label: "AML",
|
|
191
|
+
aliases: ["anti-money laundering", "AML"],
|
|
192
|
+
question: "What is AML?",
|
|
193
|
+
explanation: "Anti-Money Laundering: screening procedures and legal requirements to detect and prevent financial crimes.",
|
|
194
|
+
matchSensitive: false
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: "Transfer agent",
|
|
198
|
+
label: "Transfer agent",
|
|
199
|
+
aliases: ["transfer agent", "transfer agents"],
|
|
200
|
+
question: "What is a transfer agent?",
|
|
201
|
+
explanation: "An SEC-registered entity responsible for maintaining the official ledger of security holders and processing equity transactions.",
|
|
202
|
+
matchSensitive: false
|
|
203
|
+
}
|
|
204
|
+
];
|
|
205
|
+
function getGlossaryTerm(id) {
|
|
206
|
+
return FINANCIAL_GLOSSARY.find((term) => term.id === id);
|
|
207
|
+
}
|
|
208
|
+
exports.FINANCIAL_GLOSSARY = FINANCIAL_GLOSSARY;
|
|
209
|
+
exports.getGlossaryTerm = getGlossaryTerm;
|
|
210
|
+
//# sourceMappingURL=glossary.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glossary.cjs","sources":["../../src/constants/glossary.ts"],"sourcesContent":["/**\n * Static financial glossary for Fairmint applications (ENG-2069).\n *\n * Hardcoded by design: definitions are curated and stable. Used by `@fairmint/ui`'s\n * `<GlossaryProvider>` and `<Text>` to automatically linkify financial and equity jargon\n * across founder and investor surfaces.\n */\n\nexport interface GlossaryTermDefinition {\n /** Unique identifier for the term (e.g. \"SPV\", \"409A\"). */\n id: string;\n /** Display label for the canonical term name. */\n label: string;\n /** Text variations to match against in copy. Longest alias matches first. */\n aliases: readonly string[];\n /** Short, plain-language definition shown in tooltips. */\n explanation: string;\n /** Suggested question to send when opened in an AI chat assistant. */\n question?: string;\n /** When true, aliases require exact case matching (used for acronyms like ISO vs isosceles). */\n matchSensitive: boolean;\n}\n\nexport type GlossaryTerm = GlossaryTermDefinition;\nexport type GlossaryTermData = GlossaryTermDefinition;\n\nexport const FINANCIAL_GLOSSARY: readonly GlossaryTerm[] = [\n {\n id: \"SPV\",\n label: \"SPV\",\n aliases: [\"SPV\", \"SPVs\"],\n question: \"What is an SPV?\",\n explanation:\n \"A special-purpose vehicle that pools multiple investors into one line on the cap table.\",\n matchSensitive: true,\n },\n {\n id: \"Reg D 506(b)\",\n label: \"Reg D 506(b)\",\n aliases: [\"Reg D 506(b)\", \"Rule 506(b)\"],\n question: \"What is a Reg D 506(b) offering?\",\n explanation:\n \"A private offering allowing accredited investors and up to 35 non-accredited investors, with no general solicitation or advertising.\",\n matchSensitive: false,\n },\n {\n id: \"Rule 506(c)\",\n label: \"Rule 506(c)\",\n aliases: [\"Rule 506(c)\", \"Reg D 506(c)\"],\n question: \"What is a Rule 506(c) offering?\",\n explanation:\n \"A private offering that permits general advertising, but requires all investors to be verified as accredited.\",\n matchSensitive: false,\n },\n {\n id: \"Post-money SAFE\",\n label: \"Post-money SAFE\",\n aliases: [\"post-money SAFE\"],\n question: \"What is a post-money SAFE?\",\n explanation:\n \"A Simple Agreement for Future Equity whose valuation cap is calculated after the round's investment is added.\",\n matchSensitive: false,\n },\n {\n id: \"Pre-money SAFE\",\n label: \"Pre-money SAFE\",\n aliases: [\"pre-money SAFE\"],\n question: \"What is a pre-money SAFE?\",\n explanation:\n \"A Simple Agreement for Future Equity whose valuation cap is calculated before the round's investment is added.\",\n matchSensitive: false,\n },\n {\n id: \"Valuation cap\",\n label: \"Valuation cap\",\n aliases: [\"valuation cap\"],\n question: \"What is a valuation cap?\",\n explanation:\n \"The maximum company valuation at which an investment instrument will convert into equity.\",\n matchSensitive: false,\n },\n {\n id: \"Pro-rata rights\",\n label: \"Pro-rata rights\",\n aliases: [\"pro-rata rights\", \"pro rata rights\", \"pro-rata\", \"pro rata\"],\n question: \"What are pro-rata rights?\",\n explanation:\n \"The contractual right of an investor to participate in future financing rounds to maintain their ownership percentage.\",\n matchSensitive: false,\n },\n {\n id: \"MFN\",\n label: \"MFN\",\n aliases: [\"most favored nation\", \"MFN\"],\n question: \"What is an MFN clause?\",\n explanation:\n \"Most Favored Nation: a clause entitling an investor to receive any more favorable terms offered to subsequent investors.\",\n matchSensitive: false,\n },\n {\n id: \"Token warrant\",\n label: \"Token warrant\",\n aliases: [\"token warrant\", \"token warrants\"],\n question: \"What is a token warrant?\",\n explanation:\n \"A contractual right granting the holder the option to purchase future digital tokens at a predetermined price.\",\n matchSensitive: false,\n },\n {\n id: \"Convertible note\",\n label: \"Convertible note\",\n aliases: [\"convertible note\", \"convertible notes\"],\n question: \"What is a convertible note?\",\n explanation:\n \"A debt instrument that converts into equity at a future financing event rather than being repaid in cash.\",\n matchSensitive: false,\n },\n {\n id: \"Master fund\",\n label: \"Master fund\",\n aliases: [\"master fund\"],\n question: \"What is a master fund?\",\n explanation:\n \"A parent fund structure that holds and manages multiple underlying series or sub-funds under unified governance.\",\n matchSensitive: false,\n },\n {\n id: \"LPA\",\n label: \"LPA\",\n aliases: [\"limited partnership agreement\", \"LPA\"],\n question: \"What is an LPA?\",\n explanation:\n \"Limited Partnership Agreement: the core legal agreement governing the rights, obligations, and terms of a fund partnership.\",\n matchSensitive: false,\n },\n {\n id: \"Accredited investor\",\n label: \"Accredited investor\",\n aliases: [\"accredited investor\", \"accredited investors\"],\n question: \"Who is an accredited investor?\",\n explanation:\n \"An individual or entity meeting specific SEC income or net worth thresholds, permitted to invest in unregistered securities.\",\n matchSensitive: false,\n },\n {\n id: \"409A\",\n label: \"409A\",\n aliases: [\"409A\", \"409a\"],\n question: \"What is a 409A valuation?\",\n explanation:\n \"An independent appraisal of a private company's common stock fair market value, required to set compliant option exercise prices.\",\n matchSensitive: false,\n },\n {\n id: \"ISO\",\n label: \"ISO\",\n aliases: [\"ISO\", \"ISOs\"],\n question: \"What is an ISO?\",\n explanation:\n \"Incentive Stock Option: a statutory stock option available to employees with potential tax advantages upon exercise.\",\n matchSensitive: true,\n },\n {\n id: \"NSO\",\n label: \"NSO\",\n aliases: [\"NSO\", \"NSOs\"],\n question: \"What is an NSO?\",\n explanation:\n \"Non-Qualified Stock Option: a stock option that does not qualify for special IRS tax treatment and is taxed at ordinary income rates on exercise.\",\n matchSensitive: true,\n },\n {\n id: \"RSU\",\n label: \"RSU\",\n aliases: [\"RSU\", \"RSUs\"],\n question: \"What is an RSU?\",\n explanation:\n \"Restricted Stock Unit: a grant of company shares that are delivered upon meeting vesting conditions, with no purchase price required.\",\n matchSensitive: true,\n },\n {\n id: \"Vesting\",\n label: \"Vesting\",\n aliases: [\"vesting\", \"vesting schedule\", \"cliff\"],\n question: \"What is vesting?\",\n explanation:\n \"The process or schedule by which an individual earns full ownership of equity over time. A cliff is the initial waiting period before any equity vests.\",\n matchSensitive: false,\n },\n {\n id: \"Exercise price\",\n label: \"Exercise price\",\n aliases: [\"exercise price\", \"strike price\"],\n question: \"What is an exercise price?\",\n explanation:\n \"The fixed price per share at which an option holder can purchase underlying company stock.\",\n matchSensitive: false,\n },\n {\n id: \"Option pool\",\n label: \"Option pool\",\n aliases: [\"option pool\", \"option pools\"],\n question: \"What is an option pool?\",\n explanation:\n \"A block of company shares set aside to grant to future employees, contractors, and advisors as equity compensation.\",\n matchSensitive: false,\n },\n {\n id: \"Fully diluted\",\n label: \"Fully diluted\",\n aliases: [\"fully diluted\"],\n question: \"What does fully diluted mean?\",\n explanation:\n \"A calculation of total ownership that assumes all convertibles, options, warrants, and unissued pool shares are converted into common shares.\",\n matchSensitive: false,\n },\n {\n id: \"Form D\",\n label: \"Form D\",\n aliases: [\"Form D\"],\n question: \"What is Form D?\",\n explanation:\n \"A brief notice filed with the SEC within 15 days of the first sale of securities in an exempt Regulation D offering.\",\n matchSensitive: true,\n },\n {\n id: \"KYC\",\n label: \"KYC\",\n aliases: [\"know your customer\", \"KYC\"],\n question: \"What is KYC?\",\n explanation:\n \"Know Your Customer: regulatory requirements to verify the identity of investors before accepting capital.\",\n matchSensitive: false,\n },\n {\n id: \"AML\",\n label: \"AML\",\n aliases: [\"anti-money laundering\", \"AML\"],\n question: \"What is AML?\",\n explanation:\n \"Anti-Money Laundering: screening procedures and legal requirements to detect and prevent financial crimes.\",\n matchSensitive: false,\n },\n {\n id: \"Transfer agent\",\n label: \"Transfer agent\",\n aliases: [\"transfer agent\", \"transfer agents\"],\n question: \"What is a transfer agent?\",\n explanation:\n \"An SEC-registered entity responsible for maintaining the official ledger of security holders and processing equity transactions.\",\n matchSensitive: false,\n },\n];\n\nexport function getGlossaryTerm(id: string): GlossaryTerm | undefined {\n return FINANCIAL_GLOSSARY.find((term) => term.id === id);\n}\n"],"names":[],"mappings":";;AA0BO,MAAM,qBAA8C;AAAA,EACzD;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,SAAS,CAAC,OAAO,MAAM;AAAA,IACvB,UAAU;AAAA,IACV,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,SAAS,CAAC,gBAAgB,aAAa;AAAA,IACvC,UAAU;AAAA,IACV,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,SAAS,CAAC,eAAe,cAAc;AAAA,IACvC,UAAU;AAAA,IACV,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,SAAS,CAAC,iBAAiB;AAAA,IAC3B,UAAU;AAAA,IACV,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,SAAS,CAAC,gBAAgB;AAAA,IAC1B,UAAU;AAAA,IACV,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,SAAS,CAAC,eAAe;AAAA,IACzB,UAAU;AAAA,IACV,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB;AAAA,IACE,IA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,IACV,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,SAAS,CAAC,yBAAyB,KAAK;AAAA,IACxC,UAAU;AAAA,IACV,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,SAAS,CAAC,kBAAkB,iBAAiB;AAAA,IAC7C,UAAU;AAAA,IACV,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAEpB;AAEO,SAAS,gBAAgB,IAAsC;AACpE,SAAO,mBAAmB,KAAK,CAAC,SAAS,KAAK,OAAO,EAAE;AACzD;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static financial glossary for Fairmint applications (ENG-2069).
|
|
3
|
+
*
|
|
4
|
+
* Hardcoded by design: definitions are curated and stable. Used by `@fairmint/ui`'s
|
|
5
|
+
* `<GlossaryProvider>` and `<Text>` to automatically linkify financial and equity jargon
|
|
6
|
+
* across founder and investor surfaces.
|
|
7
|
+
*/
|
|
8
|
+
export interface GlossaryTermDefinition {
|
|
9
|
+
/** Unique identifier for the term (e.g. "SPV", "409A"). */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Display label for the canonical term name. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Text variations to match against in copy. Longest alias matches first. */
|
|
14
|
+
aliases: readonly string[];
|
|
15
|
+
/** Short, plain-language definition shown in tooltips. */
|
|
16
|
+
explanation: string;
|
|
17
|
+
/** Suggested question to send when opened in an AI chat assistant. */
|
|
18
|
+
question?: string;
|
|
19
|
+
/** When true, aliases require exact case matching (used for acronyms like ISO vs isosceles). */
|
|
20
|
+
matchSensitive: boolean;
|
|
21
|
+
}
|
|
22
|
+
export type GlossaryTerm = GlossaryTermDefinition;
|
|
23
|
+
export type GlossaryTermData = GlossaryTermDefinition;
|
|
24
|
+
export declare const FINANCIAL_GLOSSARY: readonly GlossaryTerm[];
|
|
25
|
+
export declare function getGlossaryTerm(id: string): GlossaryTerm | undefined;
|
|
26
|
+
//# sourceMappingURL=glossary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glossary.d.ts","sourceRoot":"","sources":["../../src/constants/glossary.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,sBAAsB;IACrC,2DAA2D;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gGAAgG;IAChG,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,MAAM,YAAY,GAAG,sBAAsB,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEtD,eAAO,MAAM,kBAAkB,EAAE,SAAS,YAAY,EAkOrD,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEpE"}
|