@fairmint/ui 0.2.16 → 0.2.18

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.
@@ -26975,7 +26975,8 @@ const theme = createTheme({
26975
26975
  const fairmintCssVariables = () => ({
26976
26976
  variables: {
26977
26977
  "--fairmint-font-headings": typography.headingFontFamily,
26978
- "--fairmint-font-body": typography.fontFamily
26978
+ "--fairmint-font-body": typography.fontFamily,
26979
+ "--fairmint-interactive-focus-ring": indigo[5]
26979
26980
  },
26980
26981
  light: {
26981
26982
  /** Large decorative background text on error/empty pages. */
@@ -26985,13 +26986,17 @@ const fairmintCssVariables = () => ({
26985
26986
  /** Faint metadata text (timestamps, tertiary labels). Replaces neutral.4 */
26986
26987
  "--fairmint-color-text-tertiary": neutral[4],
26987
26988
  /** Background tint for selected / active rows. Replaces primary.0 */
26988
- "--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]
26989
26992
  },
26990
26993
  dark: {
26991
26994
  "--fairmint-watermark-color": neutral[7],
26992
26995
  "--fairmint-color-text-secondary": neutral[4],
26993
26996
  "--fairmint-color-text-tertiary": neutral[5],
26994
- "--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]
26995
27000
  }
26996
27001
  });
26997
27002
  const fairmintVars = {
@@ -28475,6 +28480,64 @@ function AnimateIn({
28475
28480
  };
28476
28481
  return /* @__PURE__ */ jsx("div", { style, className, children });
28477
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
+ }
28478
28541
  function ConfirmDialog({
28479
28542
  title,
28480
28543
  message,
@@ -28544,7 +28607,8 @@ function formatDate(dateString) {
28544
28607
  function formatPercent(n, decimals = 2) {
28545
28608
  return `${n.toFixed(decimals)}%`;
28546
28609
  }
28547
- function Currency({ value, precise = false, currency, ...rest }) {
28610
+ const TABULAR_NUMS = { fontVariantNumeric: "tabular-nums" };
28611
+ function Currency({ value, precise = false, currency, style, ...rest }) {
28548
28612
  let formatted;
28549
28613
  if (currency) {
28550
28614
  formatted = formatPreciseWithCurrency(value, currency);
@@ -28553,7 +28617,7 @@ function Currency({ value, precise = false, currency, ...rest }) {
28553
28617
  } else {
28554
28618
  formatted = formatCurrency(value);
28555
28619
  }
28556
- return /* @__PURE__ */ jsx(Text, { component: "span", ...rest, children: formatted });
28620
+ return /* @__PURE__ */ jsx(Text, { component: "span", style: [TABULAR_NUMS, style], ...rest, children: formatted });
28557
28621
  }
28558
28622
  function EmptyState({
28559
28623
  icon,
@@ -28642,17 +28706,7 @@ function DataTable({
28642
28706
  Table.Tr,
28643
28707
  {
28644
28708
  onClick: onRowClick ? () => onRowClick(row) : void 0,
28645
- style: onRowClick ? {
28646
- cursor: "pointer",
28647
- transition: "background-color 0.15s ease"
28648
- } : void 0,
28649
- styles: onRowClick ? {
28650
- tr: {
28651
- "&:hover": {
28652
- backgroundColor: neutralColors[50]
28653
- }
28654
- }
28655
- } : void 0,
28709
+ className: onRowClick ? "fairmint-table-row-clickable" : void 0,
28656
28710
  children: columns.map((col) => /* @__PURE__ */ jsx(Table.Td, { children: col.render ? col.render(row) : String(row[col.key] ?? "") }, col.key))
28657
28711
  },
28658
28712
  key
@@ -28928,21 +28982,10 @@ function ListRow({
28928
28982
  {
28929
28983
  bg: isSelected ? fairmintVars.colorSurfaceSelected : void 0,
28930
28984
  onClick,
28985
+ className: "fairmint-list-row",
28931
28986
  w: "100%",
28932
28987
  py: "sm",
28933
28988
  px: "md",
28934
- styles: {
28935
- root: {
28936
- transition: "background-color 0.15s ease",
28937
- "&:hover": {
28938
- backgroundColor: neutralColors[50]
28939
- },
28940
- "&:focus-visible": {
28941
- outline: `2px solid ${brandColors.indigo}`,
28942
- outlineOffset: "-2px"
28943
- }
28944
- }
28945
- },
28946
28989
  style: animationStyle,
28947
28990
  "aria-label": ariaLabel ?? title,
28948
28991
  children: content
@@ -31124,6 +31167,12 @@ function useIsMobile() {
31124
31167
  getInitialValueInEffect: false
31125
31168
  }) ?? false;
31126
31169
  }
31170
+ const TABLET_BREAKPOINT = "(max-width: 68em)";
31171
+ function useIsTablet() {
31172
+ return useMediaQuery(TABLET_BREAKPOINT, false, {
31173
+ getInitialValueInEffect: false
31174
+ }) ?? false;
31175
+ }
31127
31176
  const notify = {
31128
31177
  success: ({ title, message, autoClose = 4e3 }) => notifications.show({ title, message, color: colors.success, autoClose }),
31129
31178
  error: ({ title, message, autoClose = 6e3 }) => notifications.show({ title, message, color: colors.error, autoClose }),
@@ -31146,7 +31195,9 @@ export {
31146
31195
  Card,
31147
31196
  Center,
31148
31197
  Checkbox,
31198
+ ClickableCard,
31149
31199
  Collapse,
31200
+ ColorDot,
31150
31201
  ConfirmDialog,
31151
31202
  Container,
31152
31203
  Currency,
@@ -31205,6 +31256,7 @@ export {
31205
31256
  StatCard,
31206
31257
  StatusBadge,
31207
31258
  Switch,
31259
+ TABLET_BREAKPOINT,
31208
31260
  Table,
31209
31261
  Tabs,
31210
31262
  Text,
@@ -31263,6 +31315,7 @@ export {
31263
31315
  useId$1 as useId,
31264
31316
  useIntersection,
31265
31317
  useIsMobile,
31318
+ useIsTablet,
31266
31319
  useMediaQuery,
31267
31320
  useScrollIntoView,
31268
31321
  useViewportSize,