@fairmint/ui 0.1.6 → 0.2.0

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/README.md CHANGED
@@ -12,13 +12,14 @@ bun add @fairmint/ui
12
12
 
13
13
  Mantine is included as a dependency — no extra packages to install.
14
14
 
15
- ### 2. Import styles
15
+ ### 2. Import styles (required)
16
16
 
17
17
  ```typescript
18
+ // In your app's entry file (main.tsx, App.tsx, etc.)
18
19
  import '@fairmint/ui/styles.css';
19
20
  ```
20
21
 
21
- This single import includes both Mantine core styles and Fairmint component styles.
22
+ **This is required.** This single import includes Mantine core CSS, notification styles, and Fairmint component animations. Without it, components render unstyled. You do NOT need to install or import `@mantine/core/styles.css` separately — it's all included.
22
23
 
23
24
  ### 3. Wrap with provider
24
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorFallback.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorFallback/ErrorFallback.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gHAAgH;IAChH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAA8B,EAC9B,WAA6D,EAC7D,QAAQ,EACR,WAA2B,EAC3B,KAAK,GACN,EAAE,kBAAkB,2CAgBpB"}
1
+ {"version":3,"file":"ErrorFallback.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorFallback/ErrorFallback.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gHAAgH;IAChH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAA8B,EAC9B,WAA6D,EAC7D,QAAQ,EACR,WAA2B,EAC3B,KAAK,GACN,EAAE,kBAAkB,2CAgBpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/PageHeader/PageHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,eAAe,2CActE"}
1
+ {"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/PageHeader/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,eAAe,2CActE"}
@@ -0,0 +1,19 @@
1
+ export { ActionIcon } from './ActionIcon/ActionIcon';
2
+ export { Alert } from './Alert/Alert';
3
+ export { Avatar } from './Avatar/Avatar';
4
+ export { Badge } from './Badge/Badge';
5
+ export { Button, type ButtonProps } from './Button/Button';
6
+ export { Card } from './Card/Card';
7
+ export { Checkbox } from './Checkbox/Checkbox';
8
+ export { Drawer } from './Drawer/Drawer';
9
+ export { Menu } from './Menu/Menu';
10
+ export { Modal } from './Modal/Modal';
11
+ export { PasswordInput } from './PasswordInput/PasswordInput';
12
+ export { Select } from './Select/Select';
13
+ export { Skeleton } from './Skeleton/Skeleton';
14
+ export { Switch } from './Switch/Switch';
15
+ export { Table } from './Table/Table';
16
+ export { Tabs } from './Tabs/Tabs';
17
+ export { TextInput } from './TextInput/TextInput';
18
+ export { Tooltip } from './Tooltip/Tooltip';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
@@ -17376,6 +17376,105 @@ const Title = factory((_props, ref) => {
17376
17376
  });
17377
17377
  Title.classes = classes$1;
17378
17378
  Title.displayName = "@mantine/core/Title";
17379
+ const colors = {
17380
+ /** Primary UI color — buttons, links, active states. */
17381
+ primary: "indigo",
17382
+ /** Fairmint brand blue — gradients, brand elements. */
17383
+ brandBlue: "fairmintBlue",
17384
+ /** Fairmint brand purple — gradients, brand elements. */
17385
+ brandPurple: "fairmintPurple",
17386
+ /** Positive outcome — completed, approved, active. */
17387
+ success: "success",
17388
+ /** Caution — pending, processing, review. */
17389
+ warning: "warning",
17390
+ /** Negative outcome — failed, rejected, cancelled. */
17391
+ error: "error",
17392
+ /** Informational — neutral status messages. */
17393
+ info: "info",
17394
+ /** Neutral gray scale — borders, backgrounds, disabled. */
17395
+ neutral: "gray",
17396
+ /** Accent color 1 for avatar palette. */
17397
+ accent1: "teal",
17398
+ /** Accent color 2 for avatar palette. */
17399
+ accent2: "cyan",
17400
+ /** Accent color 3 for avatar palette. */
17401
+ accent3: "green"
17402
+ };
17403
+ const AVATAR_PALETTE = [
17404
+ colors.primary,
17405
+ colors.brandBlue,
17406
+ colors.brandPurple,
17407
+ colors.success,
17408
+ colors.info,
17409
+ colors.accent1,
17410
+ colors.accent2,
17411
+ colors.accent3
17412
+ ];
17413
+ const ActionIcon = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(ActionIcon$1, { color: colors.primary, variant: "subtle", ...props, ref }));
17414
+ ActionIcon.displayName = "ActionIcon";
17415
+ function Alert(props) {
17416
+ return /* @__PURE__ */ jsxRuntime.jsx(Alert$1, { ...props });
17417
+ }
17418
+ const Avatar = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Avatar$1, { radius: "md", color: colors.primary, ...props, ref }));
17419
+ Avatar.displayName = "Avatar";
17420
+ const Badge = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "light", ...props, ref }));
17421
+ Badge.displayName = "Badge";
17422
+ const Button = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Button$1, { color: colors.primary, ...props, ref }));
17423
+ Button.displayName = "Button";
17424
+ const Card = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Card$1, { padding: "lg", radius: "xl", withBorder: true, ...props, ref }));
17425
+ Card.displayName = "Card";
17426
+ const Checkbox = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Checkbox$1, { color: colors.primary, ...props, ref }));
17427
+ Checkbox.displayName = "Checkbox";
17428
+ function Drawer(props) {
17429
+ return /* @__PURE__ */ jsxRuntime.jsx(Drawer$1, { position: "right", size: "lg", p: "lg", ...props });
17430
+ }
17431
+ function MenuBase(props) {
17432
+ return /* @__PURE__ */ jsxRuntime.jsx(Menu$1, { shadow: "md", ...props });
17433
+ }
17434
+ const Menu = Object.assign(MenuBase, {
17435
+ Target: Menu$1.Target,
17436
+ Dropdown: Menu$1.Dropdown,
17437
+ Item: Menu$1.Item,
17438
+ Label: Menu$1.Label,
17439
+ Divider: Menu$1.Divider
17440
+ });
17441
+ function Modal(props) {
17442
+ return /* @__PURE__ */ jsxRuntime.jsx(Modal$1, { centered: true, radius: "lg", ...props });
17443
+ }
17444
+ const PasswordInput = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(PasswordInput$1, { size: "md", ...props, ref }));
17445
+ PasswordInput.displayName = "PasswordInput";
17446
+ const Select = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Select$1, { size: "md", ...props, ref }));
17447
+ Select.displayName = "Select";
17448
+ function Skeleton(props) {
17449
+ return /* @__PURE__ */ jsxRuntime.jsx(Skeleton$1, { ...props });
17450
+ }
17451
+ const Switch = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Switch$1, { color: colors.primary, ...props, ref }));
17452
+ Switch.displayName = "Switch";
17453
+ function TableBase(props) {
17454
+ return /* @__PURE__ */ jsxRuntime.jsx(Table$1, { ...props });
17455
+ }
17456
+ const Table = Object.assign(TableBase, {
17457
+ Thead: Table$1.Thead,
17458
+ Tbody: Table$1.Tbody,
17459
+ Tr: Table$1.Tr,
17460
+ Th: Table$1.Th,
17461
+ Td: Table$1.Td,
17462
+ Tfoot: Table$1.Tfoot,
17463
+ Caption: Table$1.Caption
17464
+ });
17465
+ function TabsBase(props) {
17466
+ return /* @__PURE__ */ jsxRuntime.jsx(Tabs$1, { color: colors.primary, ...props });
17467
+ }
17468
+ const Tabs = Object.assign(TabsBase, {
17469
+ List: Tabs$1.List,
17470
+ Tab: Tabs$1.Tab,
17471
+ Panel: Tabs$1.Panel
17472
+ });
17473
+ const TextInput = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(TextInput$1, { size: "md", ...props, ref }));
17474
+ TextInput.displayName = "TextInput";
17475
+ function Tooltip(props) {
17476
+ return /* @__PURE__ */ jsxRuntime.jsx(Tooltip$1, { ...props });
17477
+ }
17379
17478
  function ErrorFallback({
17380
17479
  title = "Something went wrong",
17381
17480
  description = "We've been notified and are working on a fix.",
@@ -17390,7 +17489,7 @@ function ErrorFallback({
17390
17489
  return /* @__PURE__ */ jsxRuntime.jsx(Container, { size: "sm", py: "xl", children: /* @__PURE__ */ jsxRuntime.jsxs(Stack, { align: "center", gap: "md", children: [
17391
17490
  /* @__PURE__ */ jsxRuntime.jsx(Title, { order: 2, children: title }),
17392
17491
  /* @__PURE__ */ jsxRuntime.jsx(Text, { c: "dimmed", children: description }),
17393
- /* @__PURE__ */ jsxRuntime.jsx(Button$1, { onClick: handleAction, children: actionLabel })
17492
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleAction, children: actionLabel })
17394
17493
  ] }) });
17395
17494
  }
17396
17495
  function FairmintLogo({
@@ -19400,40 +19499,6 @@ Notifications.update = notifications.update;
19400
19499
  Notifications.clean = notifications.clean;
19401
19500
  Notifications.cleanQueue = notifications.cleanQueue;
19402
19501
  Notifications.updateState = notifications.updateState;
19403
- const colors = {
19404
- /** Primary UI color — buttons, links, active states. */
19405
- primary: "indigo",
19406
- /** Fairmint brand blue — gradients, brand elements. */
19407
- brandBlue: "fairmintBlue",
19408
- /** Fairmint brand purple — gradients, brand elements. */
19409
- brandPurple: "fairmintPurple",
19410
- /** Positive outcome — completed, approved, active. */
19411
- success: "success",
19412
- /** Caution — pending, processing, review. */
19413
- warning: "warning",
19414
- /** Negative outcome — failed, rejected, cancelled. */
19415
- error: "error",
19416
- /** Informational — neutral status messages. */
19417
- info: "info",
19418
- /** Neutral gray scale — borders, backgrounds, disabled. */
19419
- neutral: "gray",
19420
- /** Accent color 1 for avatar palette. */
19421
- accent1: "teal",
19422
- /** Accent color 2 for avatar palette. */
19423
- accent2: "cyan",
19424
- /** Accent color 3 for avatar palette. */
19425
- accent3: "green"
19426
- };
19427
- const AVATAR_PALETTE = [
19428
- colors.primary,
19429
- colors.brandBlue,
19430
- colors.brandPurple,
19431
- colors.success,
19432
- colors.info,
19433
- colors.accent1,
19434
- colors.accent2,
19435
- colors.accent3
19436
- ];
19437
19502
  const indigo = [
19438
19503
  "#EEF2FF",
19439
19504
  "#E0E7FF",
@@ -23211,8 +23276,6 @@ ZodEnum.create;
23211
23276
  ZodPromise.create;
23212
23277
  ZodOptional.create;
23213
23278
  ZodNullable.create;
23214
- const TextInput = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(TextInput$1, { size: "md", ...props, ref }));
23215
- TextInput.displayName = "TextInput";
23216
23279
  const emailSchema = stringType().email("Please enter a valid email address");
23217
23280
  function EmailField({ error: error2, ...rest }) {
23218
23281
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -24289,8 +24352,6 @@ function FormField({
24289
24352
  children && description && !inputProps.error && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c: "dimmed", children: description })
24290
24353
  ] });
24291
24354
  }
24292
- const PasswordInput = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(PasswordInput$1, { size: "md", ...props, ref }));
24293
- PasswordInput.displayName = "PasswordInput";
24294
24355
  const passwordSchema = stringType().min(8, "Password must be at least 8 characters");
24295
24356
  function PasswordField({ error: error2, ...rest }) {
24296
24357
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -24340,11 +24401,6 @@ function AnimateIn({
24340
24401
  };
24341
24402
  return /* @__PURE__ */ jsxRuntime.jsx("div", { style, className, children });
24342
24403
  }
24343
- const Button = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Button$1, { color: colors.primary, ...props, ref }));
24344
- Button.displayName = "Button";
24345
- function Modal(props) {
24346
- return /* @__PURE__ */ jsxRuntime.jsx(Modal$1, { centered: true, radius: "lg", ...props });
24347
- }
24348
24404
  function ConfirmDialog({
24349
24405
  title,
24350
24406
  message,
@@ -24425,21 +24481,6 @@ function Currency({ value, precise = false, currency, ...rest }) {
24425
24481
  }
24426
24482
  return /* @__PURE__ */ jsxRuntime.jsx(Text, { component: "span", ...rest, children: formatted });
24427
24483
  }
24428
- function Skeleton(props) {
24429
- return /* @__PURE__ */ jsxRuntime.jsx(Skeleton$1, { ...props });
24430
- }
24431
- function TableBase(props) {
24432
- return /* @__PURE__ */ jsxRuntime.jsx(Table$1, { ...props });
24433
- }
24434
- const Table = Object.assign(TableBase, {
24435
- Thead: Table$1.Thead,
24436
- Tbody: Table$1.Tbody,
24437
- Tr: Table$1.Tr,
24438
- Th: Table$1.Th,
24439
- Td: Table$1.Td,
24440
- Tfoot: Table$1.Tfoot,
24441
- Caption: Table$1.Caption
24442
- });
24443
24484
  function EmptyState({
24444
24485
  icon,
24445
24486
  title,
@@ -24548,9 +24589,6 @@ function DataTable({
24548
24589
  function DateDisplay({ value, ...rest }) {
24549
24590
  return /* @__PURE__ */ jsxRuntime.jsx(Text, { component: "span", ...rest, children: formatDate(value) });
24550
24591
  }
24551
- function Drawer(props) {
24552
- return /* @__PURE__ */ jsxRuntime.jsx(Drawer$1, { position: "right", size: "lg", p: "lg", ...props });
24553
- }
24554
24592
  function DetailDrawer({
24555
24593
  title,
24556
24594
  opened,
@@ -24573,8 +24611,6 @@ function DetailDrawer({
24573
24611
  }
24574
24612
  );
24575
24613
  }
24576
- const Avatar = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Avatar$1, { radius: "md", color: colors.primary, ...props, ref }));
24577
- Avatar.displayName = "Avatar";
24578
24614
  const DefaultChevronIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
24579
24615
  "svg",
24580
24616
  {
@@ -24669,8 +24705,6 @@ function ListRow({
24669
24705
  function Percent({ value, decimals = 2, ...rest }) {
24670
24706
  return /* @__PURE__ */ jsxRuntime.jsx(Text, { component: "span", ...rest, children: formatPercent(value, decimals) });
24671
24707
  }
24672
- const ActionIcon = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(ActionIcon$1, { color: colors.primary, variant: "subtle", ...props, ref }));
24673
- ActionIcon.displayName = "ActionIcon";
24674
24708
  function SearchInput({
24675
24709
  value,
24676
24710
  onChange,
@@ -24743,8 +24777,6 @@ function SearchInput({
24743
24777
  }
24744
24778
  );
24745
24779
  }
24746
- const Card = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Card$1, { padding: "lg", radius: "xl", withBorder: true, ...props, ref }));
24747
- Card.displayName = "Card";
24748
24780
  function StatCard({
24749
24781
  label,
24750
24782
  value,
@@ -24780,8 +24812,6 @@ function StatCard({
24780
24812
  }
24781
24813
  );
24782
24814
  }
24783
- const Badge = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "light", ...props, ref }));
24784
- Badge.displayName = "Badge";
24785
24815
  const DEFAULT_COLOR_MAP = {
24786
24816
  active: colors.success,
24787
24817
  approved: colors.success,
@@ -24930,36 +24960,6 @@ function UserMenu({
24930
24960
  ] }, item.id)) })
24931
24961
  ] });
24932
24962
  }
24933
- function Alert(props) {
24934
- return /* @__PURE__ */ jsxRuntime.jsx(Alert$1, { ...props });
24935
- }
24936
- const Checkbox = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Checkbox$1, { color: colors.primary, ...props, ref }));
24937
- Checkbox.displayName = "Checkbox";
24938
- function MenuBase(props) {
24939
- return /* @__PURE__ */ jsxRuntime.jsx(Menu$1, { shadow: "md", ...props });
24940
- }
24941
- const Menu = Object.assign(MenuBase, {
24942
- Target: Menu$1.Target,
24943
- Dropdown: Menu$1.Dropdown,
24944
- Item: Menu$1.Item,
24945
- Label: Menu$1.Label,
24946
- Divider: Menu$1.Divider
24947
- });
24948
- const Select = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Select$1, { size: "md", ...props, ref }));
24949
- Select.displayName = "Select";
24950
- const Switch = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Switch$1, { color: colors.primary, ...props, ref }));
24951
- Switch.displayName = "Switch";
24952
- function TabsBase(props) {
24953
- return /* @__PURE__ */ jsxRuntime.jsx(Tabs$1, { color: colors.primary, ...props });
24954
- }
24955
- const Tabs = Object.assign(TabsBase, {
24956
- List: Tabs$1.List,
24957
- Tab: Tabs$1.Tab,
24958
- Panel: Tabs$1.Panel
24959
- });
24960
- function Tooltip(props) {
24961
- return /* @__PURE__ */ jsxRuntime.jsx(Tooltip$1, { ...props });
24962
- }
24963
24963
  function DocumentRow({
24964
24964
  name,
24965
24965
  type,