@fairmint/ui 0.2.15 → 0.2.17
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/generic/ClickableCard/ClickableCard.d.ts +21 -0
- package/dist/components/generic/ClickableCard/ClickableCard.d.ts.map +1 -0
- package/dist/components/generic/ColorDot/ColorDot.d.ts +9 -0
- package/dist/components/generic/ColorDot/ColorDot.d.ts.map +1 -0
- package/dist/components/generic/Currency/Currency.d.ts +1 -1
- package/dist/components/generic/Currency/Currency.d.ts.map +1 -1
- package/dist/components/generic/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/generic/ListRow/ListRow.d.ts.map +1 -1
- package/dist/fairmint-ui.cjs +107 -45
- package/dist/fairmint-ui.cjs.map +1 -1
- package/dist/fairmint-ui.js +107 -45
- package/dist/fairmint-ui.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useIsTablet.d.ts +7 -0
- package/dist/hooks/useIsTablet.d.ts.map +1 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/styles.css +43 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/spacing.d.ts +14 -0
- package/dist/theme/spacing.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/fairmint-ui.js
CHANGED
|
@@ -15839,14 +15839,14 @@ function useAvatarGroupContext() {
|
|
|
15839
15839
|
const ctx = useContext(AvatarGroupContext);
|
|
15840
15840
|
return { withinGroup: !!ctx };
|
|
15841
15841
|
}
|
|
15842
|
-
const varsResolver$v = createVarsResolver((_, { spacing }) => ({
|
|
15842
|
+
const varsResolver$v = createVarsResolver((_, { spacing: spacing2 }) => ({
|
|
15843
15843
|
group: {
|
|
15844
|
-
"--ag-spacing": getSpacing(
|
|
15844
|
+
"--ag-spacing": getSpacing(spacing2)
|
|
15845
15845
|
}
|
|
15846
15846
|
}));
|
|
15847
15847
|
const AvatarGroup = factory((_props, ref) => {
|
|
15848
15848
|
const props = useProps("AvatarGroup", null, _props);
|
|
15849
|
-
const { classNames: classNames2, className, style, styles, unstyled, vars, spacing, attributes, ...others } = props;
|
|
15849
|
+
const { classNames: classNames2, className, style, styles, unstyled, vars, spacing: spacing2, attributes, ...others } = props;
|
|
15850
15850
|
const getStyles2 = useStyles({
|
|
15851
15851
|
name: "AvatarGroup",
|
|
15852
15852
|
classes: classes$t,
|
|
@@ -21383,15 +21383,15 @@ Select$1.classes = { ...InputBase.classes, ...Combobox.classes };
|
|
|
21383
21383
|
Select$1.displayName = "@mantine/core/Select";
|
|
21384
21384
|
var classes$8 = { "container": "m_925c2d2c", "root": "m_2415a157" };
|
|
21385
21385
|
function SimpleGridMediaVariables({
|
|
21386
|
-
spacing,
|
|
21386
|
+
spacing: spacing2,
|
|
21387
21387
|
verticalSpacing,
|
|
21388
21388
|
cols,
|
|
21389
21389
|
selector
|
|
21390
21390
|
}) {
|
|
21391
21391
|
const theme2 = useMantineTheme();
|
|
21392
|
-
const _verticalSpacing = verticalSpacing === void 0 ?
|
|
21392
|
+
const _verticalSpacing = verticalSpacing === void 0 ? spacing2 : verticalSpacing;
|
|
21393
21393
|
const baseStyles = filterProps({
|
|
21394
|
-
"--sg-spacing-x": getSpacing(getBaseValue$1(
|
|
21394
|
+
"--sg-spacing-x": getSpacing(getBaseValue$1(spacing2)),
|
|
21395
21395
|
"--sg-spacing-y": getSpacing(getBaseValue$1(_verticalSpacing)),
|
|
21396
21396
|
"--sg-cols": getBaseValue$1(cols)?.toString()
|
|
21397
21397
|
});
|
|
@@ -21400,8 +21400,8 @@ function SimpleGridMediaVariables({
|
|
|
21400
21400
|
if (!acc[breakpoint]) {
|
|
21401
21401
|
acc[breakpoint] = {};
|
|
21402
21402
|
}
|
|
21403
|
-
if (typeof
|
|
21404
|
-
acc[breakpoint]["--sg-spacing-x"] = getSpacing(
|
|
21403
|
+
if (typeof spacing2 === "object" && spacing2[breakpoint] !== void 0) {
|
|
21404
|
+
acc[breakpoint]["--sg-spacing-x"] = getSpacing(spacing2[breakpoint]);
|
|
21405
21405
|
}
|
|
21406
21406
|
if (typeof _verticalSpacing === "object" && _verticalSpacing[breakpoint] !== void 0) {
|
|
21407
21407
|
acc[breakpoint]["--sg-spacing-y"] = getSpacing(_verticalSpacing[breakpoint]);
|
|
@@ -21432,13 +21432,13 @@ function sortBreakpoints(breakpoints) {
|
|
|
21432
21432
|
return breakpoints.sort((a, b) => px(a) - px(b));
|
|
21433
21433
|
}
|
|
21434
21434
|
function getUniqueBreakpoints({
|
|
21435
|
-
spacing,
|
|
21435
|
+
spacing: spacing2,
|
|
21436
21436
|
verticalSpacing,
|
|
21437
21437
|
cols
|
|
21438
21438
|
}) {
|
|
21439
21439
|
const breakpoints = Array.from(
|
|
21440
21440
|
/* @__PURE__ */ new Set([
|
|
21441
|
-
...getBreakpoints(
|
|
21441
|
+
...getBreakpoints(spacing2),
|
|
21442
21442
|
...getBreakpoints(verticalSpacing),
|
|
21443
21443
|
...getBreakpoints(cols)
|
|
21444
21444
|
])
|
|
@@ -21446,25 +21446,25 @@ function getUniqueBreakpoints({
|
|
|
21446
21446
|
return sortBreakpoints(breakpoints);
|
|
21447
21447
|
}
|
|
21448
21448
|
function SimpleGridContainerVariables({
|
|
21449
|
-
spacing,
|
|
21449
|
+
spacing: spacing2,
|
|
21450
21450
|
verticalSpacing,
|
|
21451
21451
|
cols,
|
|
21452
21452
|
selector
|
|
21453
21453
|
}) {
|
|
21454
|
-
const _verticalSpacing = verticalSpacing === void 0 ?
|
|
21454
|
+
const _verticalSpacing = verticalSpacing === void 0 ? spacing2 : verticalSpacing;
|
|
21455
21455
|
const baseStyles = filterProps({
|
|
21456
|
-
"--sg-spacing-x": getSpacing(getBaseValue$1(
|
|
21456
|
+
"--sg-spacing-x": getSpacing(getBaseValue$1(spacing2)),
|
|
21457
21457
|
"--sg-spacing-y": getSpacing(getBaseValue$1(_verticalSpacing)),
|
|
21458
21458
|
"--sg-cols": getBaseValue$1(cols)?.toString()
|
|
21459
21459
|
});
|
|
21460
|
-
const uniqueBreakpoints = getUniqueBreakpoints({ spacing, verticalSpacing, cols });
|
|
21460
|
+
const uniqueBreakpoints = getUniqueBreakpoints({ spacing: spacing2, verticalSpacing, cols });
|
|
21461
21461
|
const queries = uniqueBreakpoints.reduce(
|
|
21462
21462
|
(acc, breakpoint) => {
|
|
21463
21463
|
if (!acc[breakpoint]) {
|
|
21464
21464
|
acc[breakpoint] = {};
|
|
21465
21465
|
}
|
|
21466
|
-
if (typeof
|
|
21467
|
-
acc[breakpoint]["--sg-spacing-x"] = getSpacing(
|
|
21466
|
+
if (typeof spacing2 === "object" && spacing2[breakpoint] !== void 0) {
|
|
21467
|
+
acc[breakpoint]["--sg-spacing-x"] = getSpacing(spacing2[breakpoint]);
|
|
21468
21468
|
}
|
|
21469
21469
|
if (typeof _verticalSpacing === "object" && _verticalSpacing[breakpoint] !== void 0) {
|
|
21470
21470
|
acc[breakpoint]["--sg-spacing-y"] = getSpacing(_verticalSpacing[breakpoint]);
|
|
@@ -21498,7 +21498,7 @@ const SimpleGrid = factory((_props, ref) => {
|
|
|
21498
21498
|
vars,
|
|
21499
21499
|
cols,
|
|
21500
21500
|
verticalSpacing,
|
|
21501
|
-
spacing,
|
|
21501
|
+
spacing: spacing2,
|
|
21502
21502
|
type,
|
|
21503
21503
|
attributes,
|
|
21504
21504
|
...others
|
|
@@ -26768,6 +26768,13 @@ const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
26768
26768
|
},
|
|
26769
26769
|
void: voidType
|
|
26770
26770
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
26771
|
+
const spacing = {
|
|
26772
|
+
xs: "0.625rem",
|
|
26773
|
+
sm: "0.75rem",
|
|
26774
|
+
md: "1rem",
|
|
26775
|
+
lg: "1.25rem",
|
|
26776
|
+
xl: "2rem"
|
|
26777
|
+
};
|
|
26771
26778
|
const colors = {
|
|
26772
26779
|
/** Primary UI color — buttons, links, active states. */
|
|
26773
26780
|
primary: "indigo",
|
|
@@ -26919,6 +26926,7 @@ const theme = createTheme({
|
|
|
26919
26926
|
},
|
|
26920
26927
|
radius: radii,
|
|
26921
26928
|
defaultRadius: "md",
|
|
26929
|
+
spacing,
|
|
26922
26930
|
breakpoints: {
|
|
26923
26931
|
xs: "30em",
|
|
26924
26932
|
sm: "48em",
|
|
@@ -26967,7 +26975,8 @@ const theme = createTheme({
|
|
|
26967
26975
|
const fairmintCssVariables = () => ({
|
|
26968
26976
|
variables: {
|
|
26969
26977
|
"--fairmint-font-headings": typography.headingFontFamily,
|
|
26970
|
-
"--fairmint-font-body": typography.fontFamily
|
|
26978
|
+
"--fairmint-font-body": typography.fontFamily,
|
|
26979
|
+
"--fairmint-interactive-focus-ring": indigo[5]
|
|
26971
26980
|
},
|
|
26972
26981
|
light: {
|
|
26973
26982
|
/** Large decorative background text on error/empty pages. */
|
|
@@ -26977,13 +26986,17 @@ const fairmintCssVariables = () => ({
|
|
|
26977
26986
|
/** Faint metadata text (timestamps, tertiary labels). Replaces neutral.4 */
|
|
26978
26987
|
"--fairmint-color-text-tertiary": neutral[4],
|
|
26979
26988
|
/** Background tint for selected / active rows. Replaces primary.0 */
|
|
26980
|
-
"--fairmint-color-surface-selected": indigo[0]
|
|
26989
|
+
"--fairmint-color-surface-selected": indigo[0],
|
|
26990
|
+
"--fairmint-interactive-hover-shadow": `0 2px 6px ${neutral[9]}0F`,
|
|
26991
|
+
"--fairmint-interactive-hover-bg": neutral[0]
|
|
26981
26992
|
},
|
|
26982
26993
|
dark: {
|
|
26983
26994
|
"--fairmint-watermark-color": neutral[7],
|
|
26984
26995
|
"--fairmint-color-text-secondary": neutral[4],
|
|
26985
26996
|
"--fairmint-color-text-tertiary": neutral[5],
|
|
26986
|
-
"--fairmint-color-surface-selected": indigo[9]
|
|
26997
|
+
"--fairmint-color-surface-selected": indigo[9],
|
|
26998
|
+
"--fairmint-interactive-hover-shadow": `0 2px 6px ${neutral[0]}1A`,
|
|
26999
|
+
"--fairmint-interactive-hover-bg": neutral[8]
|
|
26987
27000
|
}
|
|
26988
27001
|
});
|
|
26989
27002
|
const fairmintVars = {
|
|
@@ -28467,6 +28480,64 @@ function AnimateIn({
|
|
|
28467
28480
|
};
|
|
28468
28481
|
return /* @__PURE__ */ jsx("div", { style, className, children });
|
|
28469
28482
|
}
|
|
28483
|
+
function ClickableCard({
|
|
28484
|
+
onClick,
|
|
28485
|
+
ariaLabel,
|
|
28486
|
+
animationDelay,
|
|
28487
|
+
bg,
|
|
28488
|
+
padding = "md",
|
|
28489
|
+
radius = "md",
|
|
28490
|
+
withBorder = true,
|
|
28491
|
+
children
|
|
28492
|
+
}) {
|
|
28493
|
+
const handleKeyDown = (e) => {
|
|
28494
|
+
if (e.key === " ") {
|
|
28495
|
+
e.preventDefault();
|
|
28496
|
+
}
|
|
28497
|
+
};
|
|
28498
|
+
const animate = animationDelay !== void 0;
|
|
28499
|
+
const animationStyle = animate ? {
|
|
28500
|
+
opacity: 0,
|
|
28501
|
+
animation: `rowSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) ${animationDelay}s forwards`
|
|
28502
|
+
} : void 0;
|
|
28503
|
+
const card = /* @__PURE__ */ jsx(
|
|
28504
|
+
Card,
|
|
28505
|
+
{
|
|
28506
|
+
bg,
|
|
28507
|
+
padding,
|
|
28508
|
+
radius,
|
|
28509
|
+
withBorder,
|
|
28510
|
+
style: { overflow: "hidden" },
|
|
28511
|
+
children
|
|
28512
|
+
}
|
|
28513
|
+
);
|
|
28514
|
+
if (!onClick) {
|
|
28515
|
+
return animate ? /* @__PURE__ */ jsx("div", { style: animationStyle, children: card }) : card;
|
|
28516
|
+
}
|
|
28517
|
+
const button = /* @__PURE__ */ jsx(
|
|
28518
|
+
UnstyledButton,
|
|
28519
|
+
{
|
|
28520
|
+
onClick,
|
|
28521
|
+
onKeyDown: handleKeyDown,
|
|
28522
|
+
"aria-label": ariaLabel,
|
|
28523
|
+
className: "fairmint-clickable-card",
|
|
28524
|
+
w: "100%",
|
|
28525
|
+
style: { borderRadius: radii[radius] ?? radius },
|
|
28526
|
+
children: card
|
|
28527
|
+
}
|
|
28528
|
+
);
|
|
28529
|
+
return animate ? /* @__PURE__ */ jsx("div", { style: animationStyle, children: button }) : button;
|
|
28530
|
+
}
|
|
28531
|
+
function ColorDot({ color, size: size2 = 8, style, ...rest }) {
|
|
28532
|
+
const baseStyle = {
|
|
28533
|
+
width: size2,
|
|
28534
|
+
height: size2,
|
|
28535
|
+
borderRadius: "50%",
|
|
28536
|
+
backgroundColor: color,
|
|
28537
|
+
flexShrink: 0
|
|
28538
|
+
};
|
|
28539
|
+
return /* @__PURE__ */ jsx(Box, { "data-testid": "color-dot", style: [baseStyle, style], ...rest });
|
|
28540
|
+
}
|
|
28470
28541
|
function ConfirmDialog({
|
|
28471
28542
|
title,
|
|
28472
28543
|
message,
|
|
@@ -28536,7 +28607,8 @@ function formatDate(dateString) {
|
|
|
28536
28607
|
function formatPercent(n, decimals = 2) {
|
|
28537
28608
|
return `${n.toFixed(decimals)}%`;
|
|
28538
28609
|
}
|
|
28539
|
-
|
|
28610
|
+
const TABULAR_NUMS = { fontVariantNumeric: "tabular-nums" };
|
|
28611
|
+
function Currency({ value, precise = false, currency, style, ...rest }) {
|
|
28540
28612
|
let formatted;
|
|
28541
28613
|
if (currency) {
|
|
28542
28614
|
formatted = formatPreciseWithCurrency(value, currency);
|
|
@@ -28545,7 +28617,7 @@ function Currency({ value, precise = false, currency, ...rest }) {
|
|
|
28545
28617
|
} else {
|
|
28546
28618
|
formatted = formatCurrency(value);
|
|
28547
28619
|
}
|
|
28548
|
-
return /* @__PURE__ */ jsx(Text, { component: "span", ...rest, children: formatted });
|
|
28620
|
+
return /* @__PURE__ */ jsx(Text, { component: "span", style: [TABULAR_NUMS, style], ...rest, children: formatted });
|
|
28549
28621
|
}
|
|
28550
28622
|
function EmptyState({
|
|
28551
28623
|
icon,
|
|
@@ -28634,17 +28706,7 @@ function DataTable({
|
|
|
28634
28706
|
Table.Tr,
|
|
28635
28707
|
{
|
|
28636
28708
|
onClick: onRowClick ? () => onRowClick(row) : void 0,
|
|
28637
|
-
|
|
28638
|
-
cursor: "pointer",
|
|
28639
|
-
transition: "background-color 0.15s ease"
|
|
28640
|
-
} : void 0,
|
|
28641
|
-
styles: onRowClick ? {
|
|
28642
|
-
tr: {
|
|
28643
|
-
"&:hover": {
|
|
28644
|
-
backgroundColor: neutralColors[50]
|
|
28645
|
-
}
|
|
28646
|
-
}
|
|
28647
|
-
} : void 0,
|
|
28709
|
+
className: onRowClick ? "fairmint-table-row-clickable" : void 0,
|
|
28648
28710
|
children: columns.map((col) => /* @__PURE__ */ jsx(Table.Td, { children: col.render ? col.render(row) : String(row[col.key] ?? "") }, col.key))
|
|
28649
28711
|
},
|
|
28650
28712
|
key
|
|
@@ -28920,21 +28982,10 @@ function ListRow({
|
|
|
28920
28982
|
{
|
|
28921
28983
|
bg: isSelected ? fairmintVars.colorSurfaceSelected : void 0,
|
|
28922
28984
|
onClick,
|
|
28985
|
+
className: "fairmint-list-row",
|
|
28923
28986
|
w: "100%",
|
|
28924
28987
|
py: "sm",
|
|
28925
28988
|
px: "md",
|
|
28926
|
-
styles: {
|
|
28927
|
-
root: {
|
|
28928
|
-
transition: "background-color 0.15s ease",
|
|
28929
|
-
"&:hover": {
|
|
28930
|
-
backgroundColor: neutralColors[50]
|
|
28931
|
-
},
|
|
28932
|
-
"&:focus-visible": {
|
|
28933
|
-
outline: `2px solid ${brandColors.indigo}`,
|
|
28934
|
-
outlineOffset: "-2px"
|
|
28935
|
-
}
|
|
28936
|
-
}
|
|
28937
|
-
},
|
|
28938
28989
|
style: animationStyle,
|
|
28939
28990
|
"aria-label": ariaLabel ?? title,
|
|
28940
28991
|
children: content
|
|
@@ -31116,6 +31167,12 @@ function useIsMobile() {
|
|
|
31116
31167
|
getInitialValueInEffect: false
|
|
31117
31168
|
}) ?? false;
|
|
31118
31169
|
}
|
|
31170
|
+
const TABLET_BREAKPOINT = "(max-width: 68em)";
|
|
31171
|
+
function useIsTablet() {
|
|
31172
|
+
return useMediaQuery(TABLET_BREAKPOINT, false, {
|
|
31173
|
+
getInitialValueInEffect: false
|
|
31174
|
+
}) ?? false;
|
|
31175
|
+
}
|
|
31119
31176
|
const notify = {
|
|
31120
31177
|
success: ({ title, message, autoClose = 4e3 }) => notifications.show({ title, message, color: colors.success, autoClose }),
|
|
31121
31178
|
error: ({ title, message, autoClose = 6e3 }) => notifications.show({ title, message, color: colors.error, autoClose }),
|
|
@@ -31138,7 +31195,9 @@ export {
|
|
|
31138
31195
|
Card,
|
|
31139
31196
|
Center,
|
|
31140
31197
|
Checkbox,
|
|
31198
|
+
ClickableCard,
|
|
31141
31199
|
Collapse,
|
|
31200
|
+
ColorDot,
|
|
31142
31201
|
ConfirmDialog,
|
|
31143
31202
|
Container,
|
|
31144
31203
|
Currency,
|
|
@@ -31197,6 +31256,7 @@ export {
|
|
|
31197
31256
|
StatCard,
|
|
31198
31257
|
StatusBadge,
|
|
31199
31258
|
Switch,
|
|
31259
|
+
TABLET_BREAKPOINT,
|
|
31200
31260
|
Table,
|
|
31201
31261
|
Tabs,
|
|
31202
31262
|
Text,
|
|
@@ -31241,6 +31301,7 @@ export {
|
|
|
31241
31301
|
phoneSchema,
|
|
31242
31302
|
radii,
|
|
31243
31303
|
semanticColors,
|
|
31304
|
+
spacing,
|
|
31244
31305
|
theme,
|
|
31245
31306
|
truncateAddress,
|
|
31246
31307
|
typography,
|
|
@@ -31254,6 +31315,7 @@ export {
|
|
|
31254
31315
|
useId$1 as useId,
|
|
31255
31316
|
useIntersection,
|
|
31256
31317
|
useIsMobile,
|
|
31318
|
+
useIsTablet,
|
|
31257
31319
|
useMediaQuery,
|
|
31258
31320
|
useScrollIntoView,
|
|
31259
31321
|
useViewportSize,
|