@fairmint/ui 0.2.24 → 0.2.26

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.
@@ -19315,6 +19315,36 @@ const NumberInput = factory((_props, ref) => {
19315
19315
  );
19316
19316
  setTimeout(() => adjustCursor(inputRef.current?.value.length), 0);
19317
19317
  };
19318
+ const handlePaste = (event) => {
19319
+ const pastedText = event.clipboardData.getData("text");
19320
+ const _decimalSeparator = others.decimalSeparator || ".";
19321
+ const separatorsToReplace = (allowedDecimalSeparators || [".", ","]).filter(
19322
+ (s) => s !== _decimalSeparator
19323
+ );
19324
+ if (separatorsToReplace.some((s) => pastedText.includes(s))) {
19325
+ event.preventDefault();
19326
+ let modifiedText = pastedText;
19327
+ separatorsToReplace.forEach((s) => {
19328
+ modifiedText = modifiedText.split(s).join(_decimalSeparator);
19329
+ });
19330
+ const input = inputRef.current;
19331
+ if (input) {
19332
+ const start = input.selectionStart ?? 0;
19333
+ const end = input.selectionEnd ?? 0;
19334
+ const currentValue = input.value;
19335
+ const newValue = currentValue.substring(0, start) + modifiedText + currentValue.substring(end);
19336
+ const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
19337
+ window.HTMLInputElement.prototype,
19338
+ "value"
19339
+ )?.set;
19340
+ nativeInputValueSetter?.call(input, newValue);
19341
+ input.dispatchEvent(new Event("change", { bubbles: true }));
19342
+ const cursorPos = start + modifiedText.length;
19343
+ setTimeout(() => adjustCursor(cursorPos), 0);
19344
+ }
19345
+ }
19346
+ others.onPaste?.(event);
19347
+ };
19318
19348
  const handleKeyDown = (event) => {
19319
19349
  onKeyDown?.(event);
19320
19350
  if (readOnly || !withKeyboardEvents) {
@@ -19439,6 +19469,7 @@ const NumberInput = factory((_props, ref) => {
19439
19469
  unstyled,
19440
19470
  __staticSelector: "NumberInput",
19441
19471
  decimalScale: allowDecimal ? decimalScale : 0,
19472
+ onPaste: handlePaste,
19442
19473
  onKeyDown: handleKeyDown,
19443
19474
  onKeyDownCapture: handleKeyDownCapture,
19444
19475
  rightSectionPointerEvents: rightSectionPointerEvents ?? (disabled ? "none" : void 0),
@@ -19928,6 +19959,7 @@ const PasswordInput$1 = factory((_props, ref) => {
19928
19959
  classNames: resolvedClassNames,
19929
19960
  styles: resolvedStyles,
19930
19961
  __staticSelector: "PasswordInput",
19962
+ __stylesApiProps: props,
19931
19963
  unstyled,
19932
19964
  withAsterisk,
19933
19965
  inputWrapperOrder,
@@ -19953,6 +19985,7 @@ const PasswordInput$1 = factory((_props, ref) => {
19953
19985
  radius,
19954
19986
  disabled,
19955
19987
  __staticSelector: "PasswordInput",
19988
+ __stylesApiProps: props,
19956
19989
  rightSectionWidth,
19957
19990
  rightSection: rightSection ?? visibilityToggleButton,
19958
19991
  variant,
@@ -20826,7 +20859,9 @@ const Tooltip$1 = factory((_props, ref) => {
20826
20859
  });
20827
20860
  const child = getSingleElementChild(children);
20828
20861
  if (!target && !child) {
20829
- return null;
20862
+ throw new Error(
20863
+ "[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"
20864
+ );
20830
20865
  }
20831
20866
  if (target) {
20832
20867
  const transition2 = getTransitionProps(transitionProps, { duration: 100, transition: "fade" });
@@ -38264,6 +38299,42 @@ function CompanyBanner({
38264
38299
  detailEl
38265
38300
  ] });
38266
38301
  }
38302
+ const DefaultLockIcon = () => /* @__PURE__ */ jsxs(
38303
+ "svg",
38304
+ {
38305
+ width: "12",
38306
+ height: "12",
38307
+ viewBox: "0 0 24 24",
38308
+ fill: "none",
38309
+ stroke: "currentColor",
38310
+ strokeWidth: "2",
38311
+ strokeLinecap: "round",
38312
+ strokeLinejoin: "round",
38313
+ "aria-hidden": "true",
38314
+ children: [
38315
+ /* @__PURE__ */ jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }),
38316
+ /* @__PURE__ */ jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
38317
+ ]
38318
+ }
38319
+ );
38320
+ function ConfidentialityBanner({ children, icon }) {
38321
+ const iconNode = icon === void 0 ? /* @__PURE__ */ jsx(DefaultLockIcon, {}) : icon;
38322
+ return /* @__PURE__ */ jsx(
38323
+ Box,
38324
+ {
38325
+ py: 8,
38326
+ px: "md",
38327
+ style: {
38328
+ background: `linear-gradient(90deg, ${brandColors.indigo}14 0%, ${brandColors.purple}14 100%)`,
38329
+ borderBottom: `1px solid ${neutralColors[200]}`
38330
+ },
38331
+ children: /* @__PURE__ */ jsxs(Group, { justify: "center", gap: 6, wrap: "nowrap", children: [
38332
+ iconNode !== null && /* @__PURE__ */ jsx(Box, { c: neutralColors[600], style: { display: "inline-flex" }, children: iconNode }),
38333
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: neutralColors[700], fw: 500, ta: "center", children })
38334
+ ] })
38335
+ }
38336
+ );
38337
+ }
38267
38338
  function ConfirmDialog({
38268
38339
  title,
38269
38340
  message,
@@ -38429,6 +38500,40 @@ function Currency({ value, precise = false, currency, style, ...rest }) {
38429
38500
  }
38430
38501
  return /* @__PURE__ */ jsx(Text, { component: "span", style: [TABULAR_NUMS, style], ...rest, children: formatted });
38431
38502
  }
38503
+ function DataRow({ label, value, accent = false }) {
38504
+ return /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "nowrap", children: [
38505
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: neutralColors[600], style: { flexShrink: 0 }, children: label }),
38506
+ value === null ? /* @__PURE__ */ jsx(RedactedValue, {}) : typeof value === "string" ? /* @__PURE__ */ jsx(
38507
+ Text,
38508
+ {
38509
+ size: "sm",
38510
+ fw: accent ? 700 : 500,
38511
+ c: accent ? `${colors.success}.8` : neutralColors[900],
38512
+ ta: "right",
38513
+ style: { minWidth: 0 },
38514
+ children: value
38515
+ }
38516
+ ) : value
38517
+ ] });
38518
+ }
38519
+ function StackedValue({ values: values2 }) {
38520
+ return /* @__PURE__ */ jsx(Stack, { gap: 2, align: "flex-end", children: values2.map((v) => /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, c: neutralColors[800], ta: "right", children: v }, v)) });
38521
+ }
38522
+ function RedactedValue({ width = 80 } = {}) {
38523
+ return /* @__PURE__ */ jsx(
38524
+ Box,
38525
+ {
38526
+ role: "img",
38527
+ "aria-label": "Redacted — sign in to view",
38528
+ style: {
38529
+ height: 14,
38530
+ width,
38531
+ borderRadius: 4,
38532
+ background: `repeating-linear-gradient(135deg, ${neutralColors[200]} 0 4px, ${neutralColors[100]} 4px 8px)`
38533
+ }
38534
+ }
38535
+ );
38536
+ }
38432
38537
  function EmptyState({
38433
38538
  icon,
38434
38539
  title,
@@ -38714,7 +38819,10 @@ function ErrorPage({
38714
38819
  }
38715
38820
  );
38716
38821
  }
38717
- const DefaultChevronIcon = () => /* @__PURE__ */ jsx(
38822
+ function Eyebrow({ children, size: size2 = "xs", c = neutralColors[500], ...rest }) {
38823
+ return /* @__PURE__ */ jsx(Text, { size: size2, fw: 700, tt: "uppercase", c, style: { letterSpacing: "0.08em" }, ...rest, children });
38824
+ }
38825
+ const DefaultChevronIcon$1 = () => /* @__PURE__ */ jsx(
38718
38826
  "svg",
38719
38827
  {
38720
38828
  width: "14",
@@ -38779,7 +38887,7 @@ function ListRow({
38779
38887
  }
38780
38888
  )
38781
38889
  ] })),
38782
- displayChevron && (chevronIcon ?? /* @__PURE__ */ jsx(Box, { c: fairmintVars.colorTextTertiary, style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx(DefaultChevronIcon, {}) }))
38890
+ displayChevron && (chevronIcon ?? /* @__PURE__ */ jsx(Box, { c: fairmintVars.colorTextTertiary, style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx(DefaultChevronIcon$1, {}) }))
38783
38891
  ] })
38784
38892
  ] });
38785
38893
  const animationStyle = animate ? {
@@ -40068,6 +40176,80 @@ function PhotoCropModal({
40068
40176
  ] })
40069
40177
  ] }) });
40070
40178
  }
40179
+ function RadioCard({
40180
+ selected,
40181
+ title,
40182
+ description,
40183
+ badge,
40184
+ leading,
40185
+ onSelect
40186
+ }) {
40187
+ return /* @__PURE__ */ jsx(
40188
+ UnstyledButton,
40189
+ {
40190
+ onClick: onSelect,
40191
+ role: "radio",
40192
+ "aria-checked": selected,
40193
+ style: {
40194
+ display: "block",
40195
+ width: "100%",
40196
+ padding: 16,
40197
+ borderRadius: 12,
40198
+ border: `1.5px solid ${selected ? brandColors.indigo : neutralColors[200]}`,
40199
+ background: selected ? `${brandColors.indigo}08` : "white",
40200
+ transition: "all 120ms ease",
40201
+ textAlign: "left"
40202
+ },
40203
+ children: /* @__PURE__ */ jsxs(Box, { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: [
40204
+ leading && /* @__PURE__ */ jsx(Box, { style: { flexShrink: 0 }, children: leading }),
40205
+ /* @__PURE__ */ jsxs(Stack, { gap: 2, style: { minWidth: 0, flex: 1 }, children: [
40206
+ /* @__PURE__ */ jsxs(
40207
+ Box,
40208
+ {
40209
+ style: {
40210
+ display: "flex",
40211
+ justifyContent: "space-between",
40212
+ alignItems: "baseline",
40213
+ gap: 8
40214
+ },
40215
+ children: [
40216
+ /* @__PURE__ */ jsx(Text, { fw: 600, size: "sm", c: neutralColors[900], children: title }),
40217
+ badge
40218
+ ]
40219
+ }
40220
+ ),
40221
+ description && /* @__PURE__ */ jsx(Text, { size: "xs", c: neutralColors[600], lh: 1.5, children: description })
40222
+ ] }),
40223
+ /* @__PURE__ */ jsx(
40224
+ Box,
40225
+ {
40226
+ style: {
40227
+ width: 18,
40228
+ height: 18,
40229
+ borderRadius: "50%",
40230
+ border: `2px solid ${selected ? brandColors.indigo : neutralColors[300]}`,
40231
+ background: selected ? brandColors.indigo : "transparent",
40232
+ position: "relative",
40233
+ flexShrink: 0,
40234
+ marginTop: 2
40235
+ },
40236
+ children: selected && /* @__PURE__ */ jsx(
40237
+ Box,
40238
+ {
40239
+ style: {
40240
+ position: "absolute",
40241
+ inset: 4,
40242
+ borderRadius: "50%",
40243
+ background: "white"
40244
+ }
40245
+ }
40246
+ )
40247
+ }
40248
+ )
40249
+ ] })
40250
+ }
40251
+ );
40252
+ }
40071
40253
  function SearchInput({
40072
40254
  value,
40073
40255
  onChange,
@@ -40187,6 +40369,68 @@ function StatusBadge({ status, colorMap, label, ...rest }) {
40187
40369
  const displayLabel = label ?? status.charAt(0).toUpperCase() + status.slice(1);
40188
40370
  return /* @__PURE__ */ jsx(Badge, { color, variant: "light", ...rest, children: displayLabel });
40189
40371
  }
40372
+ const DefaultCheckIcon = () => /* @__PURE__ */ jsxs(
40373
+ "svg",
40374
+ {
40375
+ width: "18",
40376
+ height: "18",
40377
+ viewBox: "0 0 24 24",
40378
+ fill: "none",
40379
+ stroke: "currentColor",
40380
+ strokeWidth: "2",
40381
+ strokeLinecap: "round",
40382
+ strokeLinejoin: "round",
40383
+ "aria-hidden": "true",
40384
+ children: [
40385
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
40386
+ /* @__PURE__ */ jsx("path", { d: "m9 12 2 2 4-4" })
40387
+ ]
40388
+ }
40389
+ );
40390
+ function StepCard({
40391
+ index: index2,
40392
+ title,
40393
+ description,
40394
+ done = false,
40395
+ doneIcon,
40396
+ children
40397
+ }) {
40398
+ return /* @__PURE__ */ jsx(
40399
+ Paper,
40400
+ {
40401
+ radius: "lg",
40402
+ p: { base: "md", sm: "xl" },
40403
+ style: {
40404
+ background: "white",
40405
+ border: `1px solid ${neutralColors[200]}`
40406
+ },
40407
+ children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
40408
+ /* @__PURE__ */ jsxs(Group, { gap: "md", align: "flex-start", wrap: "nowrap", children: [
40409
+ /* @__PURE__ */ jsx(
40410
+ ThemeIcon,
40411
+ {
40412
+ size: 32,
40413
+ radius: "xl",
40414
+ variant: done ? "filled" : "light",
40415
+ color: done ? "indigo" : "gray",
40416
+ style: {
40417
+ flexShrink: 0,
40418
+ background: done ? brandColors.indigo : neutralColors[100],
40419
+ color: done ? "white" : neutralColors[600]
40420
+ },
40421
+ children: done ? doneIcon ?? /* @__PURE__ */ jsx(DefaultCheckIcon, {}) : /* @__PURE__ */ jsx(Text, { fw: 700, fz: 14, children: index2 })
40422
+ }
40423
+ ),
40424
+ /* @__PURE__ */ jsxs(Box, { style: { minWidth: 0, flex: 1 }, children: [
40425
+ /* @__PURE__ */ jsx(Text, { fw: 700, fz: { base: 17, sm: 19 }, c: neutralColors[900], lh: 1.3, children: title }),
40426
+ description && /* @__PURE__ */ jsx(Text, { size: "sm", c: neutralColors[600], lh: 1.5, mt: 4, children: description })
40427
+ ] })
40428
+ ] }),
40429
+ /* @__PURE__ */ jsx(Box, { pl: { base: 0, sm: 48 }, children })
40430
+ ] })
40431
+ }
40432
+ );
40433
+ }
40190
40434
  function LoadingSpinner({ size: size2 = 32 }) {
40191
40435
  const iconProps = {
40192
40436
  xmlns: "http://www.w3.org/2000/svg",
@@ -40316,26 +40560,88 @@ function UserMenu({
40316
40560
  ] }, item.id)) })
40317
40561
  ] });
40318
40562
  }
40563
+ const DefaultDocumentIcon = () => /* @__PURE__ */ jsxs(
40564
+ "svg",
40565
+ {
40566
+ width: "18",
40567
+ height: "18",
40568
+ viewBox: "0 0 24 24",
40569
+ fill: "none",
40570
+ stroke: "currentColor",
40571
+ strokeWidth: "2",
40572
+ strokeLinecap: "round",
40573
+ strokeLinejoin: "round",
40574
+ "aria-hidden": "true",
40575
+ children: [
40576
+ /* @__PURE__ */ jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
40577
+ /* @__PURE__ */ jsx("polyline", { points: "14 2 14 8 20 8" }),
40578
+ /* @__PURE__ */ jsx("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
40579
+ /* @__PURE__ */ jsx("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
40580
+ /* @__PURE__ */ jsx("polyline", { points: "10 9 9 9 8 9" })
40581
+ ]
40582
+ }
40583
+ );
40584
+ const DefaultChevronIcon = () => /* @__PURE__ */ jsx(
40585
+ "svg",
40586
+ {
40587
+ width: "14",
40588
+ height: "14",
40589
+ viewBox: "0 0 24 24",
40590
+ fill: "none",
40591
+ stroke: "currentColor",
40592
+ strokeWidth: "2",
40593
+ strokeLinecap: "round",
40594
+ strokeLinejoin: "round",
40595
+ "aria-hidden": "true",
40596
+ children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
40597
+ }
40598
+ );
40319
40599
  function DocumentRow({
40320
40600
  name,
40601
+ caption,
40321
40602
  type,
40322
40603
  date: date2,
40604
+ icon,
40323
40605
  rightSection,
40324
40606
  onClick,
40325
- animationDelay
40607
+ showChevron = false,
40608
+ animationDelay,
40609
+ ariaLabel
40326
40610
  }) {
40327
- const subtitle = [type, date2 ? formatDate(date2) : void 0].filter(Boolean).join(" · ");
40611
+ const isClickable = Boolean(onClick);
40612
+ const animate = animationDelay !== void 0;
40613
+ const resolvedCaption = caption ?? (type || date2 ? [type, date2 ? formatDate(date2) : void 0].filter(Boolean).join(" · ") : void 0);
40614
+ const leadingNode = icon ?? /* @__PURE__ */ jsx(ThemeIcon, { size: 36, radius: "md", variant: "light", color: colors.primary, children: /* @__PURE__ */ jsx(DefaultDocumentIcon, {}) });
40615
+ const content = /* @__PURE__ */ jsxs(Group, { gap: "md", wrap: "nowrap", align: "center", children: [
40616
+ /* @__PURE__ */ jsx(Box, { style: { flexShrink: 0 }, children: leadingNode }),
40617
+ /* @__PURE__ */ jsxs(Stack, { gap: 2, style: { minWidth: 0, flex: 1 }, children: [
40618
+ /* @__PURE__ */ jsx(Text, { fw: 500, size: "sm", lineClamp: 1, children: name }),
40619
+ resolvedCaption !== void 0 && resolvedCaption !== null && resolvedCaption !== "" ? typeof resolvedCaption === "string" ? /* @__PURE__ */ jsx(Text, { size: "xs", c: fairmintVars.colorTextSecondary, lineClamp: 1, children: resolvedCaption }) : resolvedCaption : null
40620
+ ] }),
40621
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { flexShrink: 0 }, children: [
40622
+ rightSection,
40623
+ showChevron && /* @__PURE__ */ jsx(Box, { c: fairmintVars.colorTextTertiary, style: { display: "inline-flex" }, children: /* @__PURE__ */ jsx(DefaultChevronIcon, {}) })
40624
+ ] })
40625
+ ] });
40626
+ const animationStyle = animate ? {
40627
+ opacity: 0,
40628
+ animation: "rowSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards",
40629
+ animationDelay: `${animationDelay}s`
40630
+ } : void 0;
40631
+ if (!isClickable) {
40632
+ return /* @__PURE__ */ jsx(Box, { py: "sm", px: "md", style: animationStyle, children: content });
40633
+ }
40328
40634
  return /* @__PURE__ */ jsx(
40329
- ListRow,
40635
+ UnstyledButton,
40330
40636
  {
40331
- title: name,
40332
- subtitle: subtitle || void 0,
40333
- avatarName: name,
40334
- avatarColor: colors.neutral,
40335
- rightSection,
40336
40637
  onClick,
40337
- animationDelay,
40338
- showChevron: Boolean(onClick)
40638
+ className: "fairmint-list-row",
40639
+ w: "100%",
40640
+ py: "sm",
40641
+ px: "md",
40642
+ style: animationStyle,
40643
+ "aria-label": ariaLabel ?? name,
40644
+ children: content
40339
40645
  }
40340
40646
  );
40341
40647
  }
@@ -41132,9 +41438,11 @@ export {
41132
41438
  Collapse,
41133
41439
  ColorDot,
41134
41440
  CompanyBanner,
41441
+ ConfidentialityBanner,
41135
41442
  ConfirmDialog,
41136
41443
  Container,
41137
41444
  Currency,
41445
+ DataRow,
41138
41446
  DataTable,
41139
41447
  DateDisplay,
41140
41448
  DetailDrawer,
@@ -41149,6 +41457,7 @@ export {
41149
41457
  ErrorFallback,
41150
41458
  ErrorPage,
41151
41459
  EthereumAddressField,
41460
+ Eyebrow,
41152
41461
  FairmintLogo,
41153
41462
  FairmintProvider,
41154
41463
  Flex,
@@ -41178,6 +41487,8 @@ export {
41178
41487
  PhotoCropModal,
41179
41488
  PinInput,
41180
41489
  Progress,
41490
+ RadioCard,
41491
+ RedactedValue,
41181
41492
  ScrollArea,
41182
41493
  SearchInput,
41183
41494
  SegmentedControl,
@@ -41187,8 +41498,10 @@ export {
41187
41498
  Skeleton,
41188
41499
  Space,
41189
41500
  Stack,
41501
+ StackedValue,
41190
41502
  StatCard,
41191
41503
  StatusBadge,
41504
+ StepCard,
41192
41505
  Switch,
41193
41506
  TABLET_BREAKPOINT,
41194
41507
  Table,