@layerfi/components 0.1.114-alpha.4 → 0.1.114-alpha.5

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.
@@ -202,7 +202,7 @@ class ErrorHandlerClass {
202
202
  }
203
203
  const errorHandler = new ErrorHandlerClass();
204
204
  const reportError = (payload) => errorHandler.onError(payload);
205
- const version = "0.1.114-alpha.4";
205
+ const version = "0.1.114-alpha.5";
206
206
  const pkg = {
207
207
  version
208
208
  };
@@ -17951,6 +17951,7 @@ const BankTransactionRow = ({
17951
17951
  processing: bankTransaction.processing,
17952
17952
  active: open,
17953
17953
  action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
17954
+ disabled: selectedCategory === null,
17954
17955
  children: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Confirm"
17955
17956
  }
17956
17957
  ),
@@ -18024,6 +18025,7 @@ const BankTransactionRow = ({
18024
18025
  className: "Layer__bank-transaction__submit-btn",
18025
18026
  processing: bankTransaction.processing,
18026
18027
  active: open,
18028
+ disabled: selectedCategory === null,
18027
18029
  action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
18028
18030
  children: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Confirm"
18029
18031
  }
@@ -19280,6 +19282,37 @@ const BankTransactionsMobileForms = ({
19280
19282
  };
19281
19283
  return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsProvider, { bankTransaction, isActive: isOpen, children: getContent() });
19282
19284
  };
19285
+ const NewToggleOption = ({
19286
+ label,
19287
+ value
19288
+ }) => {
19289
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.ToggleButton, { id: value, className: "Layer__NewToggleOption", children: [
19290
+ /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.SelectionIndicator, { className: "Layer__NewToggleOption-SelectionIndicator" }),
19291
+ /* @__PURE__ */ jsxRuntime.jsx(Span, { className: "Layer__NewToggle-Option-Content", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { noWrap: true, children: label }) })
19292
+ ] });
19293
+ };
19294
+ const NewToggle = ({
19295
+ options: options2,
19296
+ selectedKey,
19297
+ onSelectionChange
19298
+ }) => {
19299
+ const selectedKeys = selectedKey !== void 0 ? /* @__PURE__ */ new Set([selectedKey]) : /* @__PURE__ */ new Set();
19300
+ return /* @__PURE__ */ jsxRuntime.jsx(
19301
+ reactAriaComponents.ToggleButtonGroup,
19302
+ {
19303
+ className: "Layer__NewToggle",
19304
+ selectionMode: "single",
19305
+ selectedKeys,
19306
+ onSelectionChange: (keys2) => {
19307
+ const selectedKeysArray = Array.from(keys2);
19308
+ if (selectedKeysArray.length > 0 && onSelectionChange) {
19309
+ onSelectionChange(selectedKeysArray[0]);
19310
+ }
19311
+ },
19312
+ children: options2.map((option) => /* @__PURE__ */ jsxRuntime.jsx(NewToggleOption, __spreadValues({}, option), option.value))
19313
+ }
19314
+ );
19315
+ };
19283
19316
  const PURPOSE_TOGGLE_OPTIONS = [
19284
19317
  {
19285
19318
  value: "business",
@@ -19306,16 +19339,14 @@ const BankTransactionsMobileListItemExpandedRow = ({
19306
19339
  showTooltips
19307
19340
  }) => {
19308
19341
  const [purpose, setPurpose] = react.useState(getInitialPurpose(bankTransaction));
19309
- const onChangePurpose = (event) => setPurpose(event.target.value);
19342
+ const onChangePurpose = (key) => setPurpose(key);
19310
19343
  return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { pi: "md", gap: "md", pbe: "md", children: [
19311
19344
  showCategorization && /* @__PURE__ */ jsxRuntime.jsx(
19312
- Toggle,
19345
+ NewToggle,
19313
19346
  {
19314
- name: `purpose-${bankTransaction.id}`,
19315
- size: ToggleSize.medium,
19316
19347
  options: PURPOSE_TOGGLE_OPTIONS,
19317
- selected: purpose,
19318
- onChange: onChangePurpose
19348
+ selectedKey: purpose,
19349
+ onSelectionChange: onChangePurpose
19319
19350
  }
19320
19351
  ),
19321
19352
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -19758,6 +19789,7 @@ const BankTransactionsTable = ({
19758
19789
  SyncingComponent,
19759
19790
  {
19760
19791
  title: "Syncing historical account data",
19792
+ timeSync: 5,
19761
19793
  onRefresh: () => onRefresh && onRefresh()
19762
19794
  }
19763
19795
  ) }) }) : null
@@ -65,7 +65,7 @@ import useSWRInfinite from "swr/infinite";
65
65
  import useSWRMutation from "swr/mutation";
66
66
  import { useStoreWithEqualityFn } from "zustand/traditional";
67
67
  import { useFloating, offset, flip, shift, autoUpdate, useHover, useFocus, useDismiss, useRole, useInteractions, useTransitionStyles, useMergeRefs, FloatingPortal } from "@floating-ui/react";
68
- import { Button as Button$2, Header as Header$3, Label as Label$1, Text as Text$1, ModalOverlay as ModalOverlay$1, Modal as Modal$1, Dialog as Dialog$1, Heading as Heading$2, Group, SearchField as SearchField$1, Input as Input$2, Form as Form$1, TextField as TextField$1, FieldError as FieldError$1, Checkbox as Checkbox$1, DateField as DateField$1, DateInput as DateInput$1, DateSegment as DateSegment$1, DatePicker as DatePicker$2, NumberField as NumberField$1, TextArea as TextArea$1, MenuTrigger, Popover as Popover$1, Menu as Menu$1, MenuItem as MenuItem$2, GridList, GridListItem, DialogTrigger, Table as Table$2, Column as Column$1, Cell as Cell$1, TableHeader as TableHeader$1, TableBody as TableBody$2, Row as Row$1, Switch as Switch$1, Calendar as Calendar$1, CalendarGrid as CalendarGrid$1, CalendarGridBody as CalendarGridBody$1, CalendarCell as CalendarCell$1, CalendarGridHeader as CalendarGridHeader$1, CalendarHeaderCell as CalendarHeaderCell$1, Meter as Meter$1, Link as Link$3 } from "react-aria-components";
68
+ import { Button as Button$2, Header as Header$3, Label as Label$1, Text as Text$1, ModalOverlay as ModalOverlay$1, Modal as Modal$1, Dialog as Dialog$1, Heading as Heading$2, Group, SearchField as SearchField$1, Input as Input$2, Form as Form$1, TextField as TextField$1, FieldError as FieldError$1, Checkbox as Checkbox$1, DateField as DateField$1, DateInput as DateInput$1, DateSegment as DateSegment$1, DatePicker as DatePicker$2, NumberField as NumberField$1, TextArea as TextArea$1, MenuTrigger, Popover as Popover$1, Menu as Menu$1, MenuItem as MenuItem$2, GridList, GridListItem, DialogTrigger, Table as Table$2, Column as Column$1, Cell as Cell$1, TableHeader as TableHeader$1, TableBody as TableBody$2, Row as Row$1, Switch as Switch$1, ToggleButton, SelectionIndicator, ToggleButtonGroup, Calendar as Calendar$1, CalendarGrid as CalendarGrid$1, CalendarGridBody as CalendarGridBody$1, CalendarCell as CalendarCell$1, CalendarGridHeader as CalendarGridHeader$1, CalendarHeaderCell as CalendarHeaderCell$1, Meter as Meter$1, Link as Link$3 } from "react-aria-components";
69
69
  import { LoaderCircle, X as X$1, ChevronDown as ChevronDown$1, Layers2Icon, UploadCloud as UploadCloud$1, Search, ChevronLeft as ChevronLeft$1, CopyIcon, FileSpreadsheet, FileDownIcon, Minus, Check as Check$1, RefreshCcw as RefreshCcw$1, MenuIcon, ChevronRight as ChevronRight$1, PencilRuler, SearchX, Trash2, CheckIcon, AlertCircle as AlertCircle$1, TriangleAlert, List, AlertTriangle, Save as Save$1, Plus as Plus$1, HandCoins, Menu as Menu$2, Trash as Trash$1, Send, Calendar as Calendar$2, Download, Users, Milestone, Video, Clock as Clock$1, Link as Link$4, Car } from "lucide-react";
70
70
  import pluralize from "pluralize";
71
71
  import { mergeRefs } from "react-merge-refs";
@@ -202,7 +202,7 @@ class ErrorHandlerClass {
202
202
  }
203
203
  const errorHandler = new ErrorHandlerClass();
204
204
  const reportError = (payload) => errorHandler.onError(payload);
205
- const version = "0.1.114-alpha.4";
205
+ const version = "0.1.114-alpha.5";
206
206
  const pkg = {
207
207
  version
208
208
  };
@@ -16475,6 +16475,7 @@ const BankTransactionRow = ({
16475
16475
  processing: bankTransaction.processing,
16476
16476
  active: open,
16477
16477
  action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
16478
+ disabled: selectedCategory === null,
16478
16479
  children: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Confirm"
16479
16480
  }
16480
16481
  ),
@@ -16548,6 +16549,7 @@ const BankTransactionRow = ({
16548
16549
  className: "Layer__bank-transaction__submit-btn",
16549
16550
  processing: bankTransaction.processing,
16550
16551
  active: open,
16552
+ disabled: selectedCategory === null,
16551
16553
  action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
16552
16554
  children: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Confirm"
16553
16555
  }
@@ -17804,6 +17806,37 @@ const BankTransactionsMobileForms = ({
17804
17806
  };
17805
17807
  return /* @__PURE__ */ jsx(ReceiptsProvider, { bankTransaction, isActive: isOpen, children: getContent() });
17806
17808
  };
17809
+ const NewToggleOption = ({
17810
+ label,
17811
+ value
17812
+ }) => {
17813
+ return /* @__PURE__ */ jsxs(ToggleButton, { id: value, className: "Layer__NewToggleOption", children: [
17814
+ /* @__PURE__ */ jsx(SelectionIndicator, { className: "Layer__NewToggleOption-SelectionIndicator" }),
17815
+ /* @__PURE__ */ jsx(Span, { className: "Layer__NewToggle-Option-Content", children: /* @__PURE__ */ jsx(Span, { noWrap: true, children: label }) })
17816
+ ] });
17817
+ };
17818
+ const NewToggle = ({
17819
+ options: options2,
17820
+ selectedKey,
17821
+ onSelectionChange
17822
+ }) => {
17823
+ const selectedKeys = selectedKey !== void 0 ? /* @__PURE__ */ new Set([selectedKey]) : /* @__PURE__ */ new Set();
17824
+ return /* @__PURE__ */ jsx(
17825
+ ToggleButtonGroup,
17826
+ {
17827
+ className: "Layer__NewToggle",
17828
+ selectionMode: "single",
17829
+ selectedKeys,
17830
+ onSelectionChange: (keys) => {
17831
+ const selectedKeysArray = Array.from(keys);
17832
+ if (selectedKeysArray.length > 0 && onSelectionChange) {
17833
+ onSelectionChange(selectedKeysArray[0]);
17834
+ }
17835
+ },
17836
+ children: options2.map((option) => /* @__PURE__ */ jsx(NewToggleOption, __spreadValues({}, option), option.value))
17837
+ }
17838
+ );
17839
+ };
17807
17840
  const PURPOSE_TOGGLE_OPTIONS = [
17808
17841
  {
17809
17842
  value: "business",
@@ -17830,16 +17863,14 @@ const BankTransactionsMobileListItemExpandedRow = ({
17830
17863
  showTooltips
17831
17864
  }) => {
17832
17865
  const [purpose, setPurpose] = useState(getInitialPurpose(bankTransaction));
17833
- const onChangePurpose = (event) => setPurpose(event.target.value);
17866
+ const onChangePurpose = (key) => setPurpose(key);
17834
17867
  return /* @__PURE__ */ jsxs(VStack, { pi: "md", gap: "md", pbe: "md", children: [
17835
17868
  showCategorization && /* @__PURE__ */ jsx(
17836
- Toggle,
17869
+ NewToggle,
17837
17870
  {
17838
- name: `purpose-${bankTransaction.id}`,
17839
- size: ToggleSize.medium,
17840
17871
  options: PURPOSE_TOGGLE_OPTIONS,
17841
- selected: purpose,
17842
- onChange: onChangePurpose
17872
+ selectedKey: purpose,
17873
+ onSelectionChange: onChangePurpose
17843
17874
  }
17844
17875
  ),
17845
17876
  /* @__PURE__ */ jsx(
@@ -18282,6 +18313,7 @@ const BankTransactionsTable = ({
18282
18313
  SyncingComponent,
18283
18314
  {
18284
18315
  title: "Syncing historical account data",
18316
+ timeSync: 5,
18285
18317
  onRefresh: () => onRefresh && onRefresh()
18286
18318
  }
18287
18319
  ) }) }) : null
package/dist/index.css CHANGED
@@ -8745,6 +8745,63 @@ header.Layer__profit-and-loss-detailed-charts__header--tablet {
8745
8745
  padding-inline-end: var(--spacing-md);
8746
8746
  }.Layer__BankTransactionsMobileSplitForm__AmountInput {
8747
8747
  inline-size: 6rem;
8748
+ }.Layer__NewToggle {
8749
+ box-sizing: border-box;
8750
+ position: relative;
8751
+ display: flex;
8752
+ align-items: center;
8753
+ height: 36px;
8754
+ width: max-content;
8755
+ padding: 2px;
8756
+ border-radius: 6px;
8757
+ box-shadow: 0 0 0 1px var(--color-base-300);
8758
+ background: var(--color-base-100);
8759
+ cursor: pointer;
8760
+ user-select: none;
8761
+ isolation: isolate;
8762
+ -webkit-tap-highlight-color: transparent;
8763
+ -webkit-touch-callout: none;
8764
+ }.Layer__NewToggleOption {
8765
+ box-sizing: border-box;
8766
+ position: relative;
8767
+ display: flex;
8768
+ align-items: center;
8769
+ justify-content: center;
8770
+ height: 32px;
8771
+ padding: 8px 16px;
8772
+ border-radius: 6px;
8773
+ border: none;
8774
+ background: transparent;
8775
+ color: var(--text-color-secondary);
8776
+ }
8777
+ .Layer__NewToggleOption::before {
8778
+ position: absolute;
8779
+ z-index: -2;
8780
+ inset: 0;
8781
+ border-radius: 6px;
8782
+ background: transparent;
8783
+ content: "";
8784
+ transition: background-color 150ms;
8785
+ }
8786
+ .Layer__NewToggleOption[data-hovered]:not([data-disabled], [data-selected]) {
8787
+ color: var(--text-color-primary);
8788
+ }
8789
+ .Layer__NewToggleOption[data-hovered]:not([data-disabled], [data-selected])::before {
8790
+ background-color: var(--color-base-200);
8791
+ }
8792
+
8793
+ .Layer__NewToggleOption-SelectionIndicator {
8794
+ position: absolute;
8795
+ z-index: -1;
8796
+ top: 0;
8797
+ left: 0;
8798
+ height: 100%;
8799
+ width: 100%;
8800
+ border-radius: 6px;
8801
+ box-shadow: 0 0 0 1px var(--color-base-300), 0 1px 1px 0 rgba(0, 0, 0, 0.04), 0 2px 3px 0 rgba(0, 0, 0, 0.04), 0 3px 4px 0 rgba(0, 0, 0, 0.02), 0 4px 5px 0 rgba(0, 0, 0, 0.01);
8802
+ background: var(--color-white);
8803
+ transition-property: translate, width;
8804
+ transition-duration: 200ms;
8748
8805
  }.Layer__BankTransactionsMobileListItem__CategorizedValue {
8749
8806
  color: var(--color-base-500);
8750
8807
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerfi/components",
3
- "version": "0.1.114-alpha.4",
3
+ "version": "0.1.114-alpha.5",
4
4
  "description": "Layer React Components",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "module": "dist/esm/index.mjs",
@@ -103,7 +103,7 @@
103
103
  "lucide-react": "^0.507.0",
104
104
  "motion": "^12.23.11",
105
105
  "pluralize": "^8.0.0",
106
- "react-aria-components": "^1.8.0",
106
+ "react-aria-components": "^1.13.0",
107
107
  "react-calendly": "^4.4.0",
108
108
  "react-currency-input-field": "^3.10.0",
109
109
  "react-dropzone": "^14.3.8",