@layerfi/components 0.1.84 → 0.1.85-alpha

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.
@@ -115,7 +115,7 @@ var import_react17 = __toESM(require("react"));
115
115
  var import_react16 = __toESM(require("react"));
116
116
 
117
117
  // package.json
118
- var version = "0.1.84";
118
+ var version = "0.1.85-alpha";
119
119
 
120
120
  // src/models/APIError.ts
121
121
  var APIError = class _APIError extends Error {
@@ -5216,10 +5216,20 @@ var import_react65 = __toESM(require("react"));
5216
5216
  var import_lucide_react2 = require("lucide-react");
5217
5217
  var import_react64 = __toESM(require("react"));
5218
5218
  var import_react_aria_components4 = require("react-aria-components");
5219
+
5220
+ // src/components/utility/withRenderProp.tsx
5221
+ function withRenderProp(renderProp, callback) {
5222
+ if (typeof renderProp === "function") {
5223
+ return renderProp;
5224
+ }
5225
+ return callback(renderProp);
5226
+ }
5227
+
5228
+ // src/components/ui/Checkbox/Checkbox.tsx
5219
5229
  var CLASS_NAME2 = "Layer__Checkbox";
5220
5230
  function Checkbox(_a) {
5221
5231
  var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
5222
- return /* @__PURE__ */ import_react64.default.createElement(import_react_aria_components4.Checkbox, __spreadProps(__spreadValues({}, props), { className: CLASS_NAME2 }), () => /* @__PURE__ */ import_react64.default.createElement(import_react64.default.Fragment, null, /* @__PURE__ */ import_react64.default.createElement("div", { slot: "checkbox" }, /* @__PURE__ */ import_react64.default.createElement(import_lucide_react2.Check, null)), children));
5232
+ return /* @__PURE__ */ import_react64.default.createElement(import_react_aria_components4.Checkbox, __spreadProps(__spreadValues({}, props), { className: CLASS_NAME2 }), withRenderProp(children, (node) => /* @__PURE__ */ import_react64.default.createElement(import_react64.default.Fragment, null, /* @__PURE__ */ import_react64.default.createElement("div", { slot: "checkbox" }, /* @__PURE__ */ import_react64.default.createElement(import_lucide_react2.Check, null)), node)));
5223
5233
  }
5224
5234
 
5225
5235
  // src/components/LinkedAccounts/ConfirmationModal/LinkedAccountToConfirm.tsx
@@ -8205,7 +8215,7 @@ var BankTransactionRow = ({
8205
8215
  showComponent ? "show" : ""
8206
8216
  );
8207
8217
  const showReceiptDataProperties = (0, import_react96.useMemo)(
8208
- () => toDataProperties({ showReceiptUploadColumn }),
8218
+ () => toDataProperties({ "show-receipt-upload-column": showReceiptUploadColumn }),
8209
8219
  [showReceiptUploadColumn]
8210
8220
  );
8211
8221
  return /* @__PURE__ */ import_react96.default.createElement(import_react96.default.Fragment, null, /* @__PURE__ */ import_react96.default.createElement("tr", { className: rowClassName }, /* @__PURE__ */ import_react96.default.createElement(
@@ -9873,7 +9883,7 @@ var BankTransactionsTable = ({
9873
9883
  }
9874
9884
  ))) != null ? _a : false;
9875
9885
  const showReceiptDataProperties = (0, import_react115.useMemo)(
9876
- () => toDataProperties({ showReceiptUploadColumn: showReceiptColumn }),
9886
+ () => toDataProperties({ "show-receipt-upload-column": showReceiptColumn }),
9877
9887
  [showReceiptColumn]
9878
9888
  );
9879
9889
  return /* @__PURE__ */ import_react115.default.createElement(
@@ -19881,6 +19891,7 @@ var GeneralLedgerView = ({
19881
19891
  {
19882
19892
  asWidget: true,
19883
19893
  withExpandAllButton: true,
19894
+ showAddAccountButton: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.showAddAccountButton,
19884
19895
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.chartOfAccounts,
19885
19896
  templateAccountsEditable: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.templateAccountsEditable,
19886
19897
  showReversalEntries: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.showReversalEntries
@@ -57,7 +57,7 @@ import React9, { useState as useState7 } from "react";
57
57
  import React8, { useReducer, useEffect as useEffect4 } from "react";
58
58
 
59
59
  // package.json
60
- var version = "0.1.84";
60
+ var version = "0.1.85-alpha";
61
61
 
62
62
  // src/models/APIError.ts
63
63
  var APIError = class _APIError extends Error {
@@ -5180,10 +5180,20 @@ import React72 from "react";
5180
5180
  import { Check } from "lucide-react";
5181
5181
  import React71 from "react";
5182
5182
  import { Checkbox as ReactAriaCheckbox } from "react-aria-components";
5183
+
5184
+ // src/components/utility/withRenderProp.tsx
5185
+ function withRenderProp(renderProp, callback) {
5186
+ if (typeof renderProp === "function") {
5187
+ return renderProp;
5188
+ }
5189
+ return callback(renderProp);
5190
+ }
5191
+
5192
+ // src/components/ui/Checkbox/Checkbox.tsx
5183
5193
  var CLASS_NAME2 = "Layer__Checkbox";
5184
5194
  function Checkbox(_a) {
5185
5195
  var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
5186
- return /* @__PURE__ */ React71.createElement(ReactAriaCheckbox, __spreadProps(__spreadValues({}, props), { className: CLASS_NAME2 }), () => /* @__PURE__ */ React71.createElement(React71.Fragment, null, /* @__PURE__ */ React71.createElement("div", { slot: "checkbox" }, /* @__PURE__ */ React71.createElement(Check, null)), children));
5196
+ return /* @__PURE__ */ React71.createElement(ReactAriaCheckbox, __spreadProps(__spreadValues({}, props), { className: CLASS_NAME2 }), withRenderProp(children, (node) => /* @__PURE__ */ React71.createElement(React71.Fragment, null, /* @__PURE__ */ React71.createElement("div", { slot: "checkbox" }, /* @__PURE__ */ React71.createElement(Check, null)), node)));
5187
5197
  }
5188
5198
 
5189
5199
  // src/components/LinkedAccounts/ConfirmationModal/LinkedAccountToConfirm.tsx
@@ -8185,7 +8195,7 @@ var BankTransactionRow = ({
8185
8195
  showComponent ? "show" : ""
8186
8196
  );
8187
8197
  const showReceiptDataProperties = useMemo10(
8188
- () => toDataProperties({ showReceiptUploadColumn }),
8198
+ () => toDataProperties({ "show-receipt-upload-column": showReceiptUploadColumn }),
8189
8199
  [showReceiptUploadColumn]
8190
8200
  );
8191
8201
  return /* @__PURE__ */ React110.createElement(React110.Fragment, null, /* @__PURE__ */ React110.createElement("tr", { className: rowClassName }, /* @__PURE__ */ React110.createElement(
@@ -9858,7 +9868,7 @@ var BankTransactionsTable = ({
9858
9868
  }
9859
9869
  ))) != null ? _a : false;
9860
9870
  const showReceiptDataProperties = useMemo12(
9861
- () => toDataProperties({ showReceiptUploadColumn: showReceiptColumn }),
9871
+ () => toDataProperties({ "show-receipt-upload-column": showReceiptColumn }),
9862
9872
  [showReceiptColumn]
9863
9873
  );
9864
9874
  return /* @__PURE__ */ React128.createElement(
@@ -19917,6 +19927,7 @@ var GeneralLedgerView = ({
19917
19927
  {
19918
19928
  asWidget: true,
19919
19929
  withExpandAllButton: true,
19930
+ showAddAccountButton: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.showAddAccountButton,
19920
19931
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.chartOfAccounts,
19921
19932
  templateAccountsEditable: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.templateAccountsEditable,
19922
19933
  showReversalEntries: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.showReversalEntries
package/dist/index.css CHANGED
@@ -5611,14 +5611,14 @@ tbody .Layer__table__empty-row:first-child {
5611
5611
  box-shadow: -8px 0px 20px -2px rgba(255, 255, 255, 0.64);
5612
5612
  right: 430px;
5613
5613
  }
5614
- .Layer__table.Layer__bank-transactions__table .Layer__table-cell__amount-col[data-showreceiptuploadcolumn] {
5614
+ .Layer__table.Layer__bank-transactions__table .Layer__table-cell__amount-col[data-show-receipt-upload-column] {
5615
5615
  right: 494px;
5616
5616
  }
5617
5617
  .Layer__table-header.Layer__bank-transactions__documents-col {
5618
5618
  padding-left: 0px;
5619
5619
  padding-right: 0px;
5620
5620
  }
5621
- .Layer__table-header.Layer__bank-transactions__documents-col[data-showreceiptuploadcolumn] {
5621
+ .Layer__table-header.Layer__bank-transactions__documents-col[data-show-receipt-upload-column] {
5622
5622
  padding-left: 16px;
5623
5623
  padding-right: 16px;
5624
5624
  }
@@ -5634,7 +5634,7 @@ tbody .Layer__table__empty-row:first-child {
5634
5634
  min-width: 0px;
5635
5635
  max-width: 0px;
5636
5636
  }
5637
- .Layer__table.Layer__bank-transactions__table .Layer__bank-transactions__documents-col[data-showreceiptuploadcolumn] {
5637
+ .Layer__table.Layer__bank-transactions__table .Layer__bank-transactions__documents-col[data-show-receipt-upload-column] {
5638
5638
  width: 64px;
5639
5639
  min-width: 64px;
5640
5640
  max-width: 64px;
package/dist/index.d.ts CHANGED
@@ -4126,8 +4126,10 @@ declare module '@layerfi/components/components/ui/Button/Button' {
4126
4126
  }
4127
4127
  declare module '@layerfi/components/components/ui/Checkbox/Checkbox' {
4128
4128
  import React from 'react';
4129
- import { type CheckboxProps } from 'react-aria-components';
4130
- export function Checkbox({ children, ...props }: Omit<CheckboxProps, 'className'>): React.JSX.Element;
4129
+ import { type CheckboxProps as AriaCheckboxProps } from 'react-aria-components';
4130
+ type CheckboxProps = Omit<AriaCheckboxProps, 'className'>;
4131
+ export function Checkbox({ children, ...props }: CheckboxProps): React.JSX.Element;
4132
+ export {};
4131
4133
 
4132
4134
  }
4133
4135
  declare module '@layerfi/components/components/ui/Loading/LoadingSpinner' {
@@ -4243,6 +4245,14 @@ declare module '@layerfi/components/components/utility/InvisibleDownload' {
4243
4245
  const InvisibleDownload: React.ForwardRefExoticComponent<React.RefAttributes<InvisibleDownloadHandle>>;
4244
4246
  export default InvisibleDownload;
4245
4247
 
4248
+ }
4249
+ declare module '@layerfi/components/components/utility/withRenderProp' {
4250
+ import type { ReactNode } from 'react';
4251
+ type GenericFn<TOut> = (...args: Array<never>) => TOut;
4252
+ type RenderProp<T extends GenericFn<ReactNode>> = ReactNode | T;
4253
+ export function withRenderProp<T extends GenericFn<ReactNode>>(renderProp: RenderProp<T>, callback: (node: ReactNode) => ReactNode): string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | T | null | undefined;
4254
+ export {};
4255
+
4246
4256
  }
4247
4257
  declare module '@layerfi/components/config/charts' {
4248
4258
  export const INACTIVE_OPACITY_LEVELS: number[];
@@ -6840,11 +6850,11 @@ declare module '@layerfi/components/utils/styleUtils/sizeVariants' {
6840
6850
  }
6841
6851
  declare module '@layerfi/components/utils/styleUtils/toDataProperties' {
6842
6852
  type AllowedDataValue = string | number | true;
6843
- type DataPrefix<T extends string> = `data-${T}`;
6853
+ type DataPrefix<T extends Lowercase<string>> = `data-${T}`;
6844
6854
  type DataProperties<T> = {
6845
- [K in keyof T as DataPrefix<Extract<K, string>>]: T[K] extends AllowedDataValue ? T[K] : never;
6855
+ [K in keyof T as DataPrefix<Extract<K, Lowercase<string>>>]: T[K] extends AllowedDataValue ? T[K] : never;
6846
6856
  };
6847
- export function toDataProperties<T extends Record<string, unknown>>(input: T): DataProperties<T>;
6857
+ export function toDataProperties<TKeys extends Lowercase<string>, TValues>(input: Record<TKeys, TValues>): DataProperties<Record<TKeys, Extract<TValues, AllowedDataValue>>>;
6848
6858
  export {};
6849
6859
 
6850
6860
  }
@@ -7000,6 +7010,7 @@ declare module '@layerfi/components/views/GeneralLedger/GeneralLedger' {
7000
7010
  export interface ChartOfAccountsOptions {
7001
7011
  templateAccountsEditable?: boolean;
7002
7012
  showReversalEntries?: boolean;
7013
+ showAddAccountButton?: boolean;
7003
7014
  }
7004
7015
  export interface GeneralLedgerProps {
7005
7016
  title?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerfi/components",
3
- "version": "0.1.84",
3
+ "version": "0.1.85-alpha",
4
4
  "description": "Layer React Components",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "module": "dist/esm/index.mjs",
@@ -25,8 +25,9 @@
25
25
  "build:clean": "rm -rf ./dist && npm run build",
26
26
  "dev": "node bin/build.js -- --watch",
27
27
  "prepack": "npm run typecheck && npm run build:clean",
28
- "lint": "eslint .",
29
- "lint:fix": "eslint . --fix"
28
+ "lint": "eslint . && stylelint '**/*.{css,scss}'",
29
+ "lint:eslint": "eslint .",
30
+ "lint:stylelint": "stylelint '**/*.{css,scss}'"
30
31
  },
31
32
  "repository": {
32
33
  "type": "git",
@@ -49,6 +50,7 @@
49
50
  },
50
51
  "devDependencies": {
51
52
  "@stylistic/eslint-plugin": "^2.10.0",
53
+ "@stylistic/stylelint-plugin": "^3.1.1",
52
54
  "@testing-library/jest-dom": "^6.1.4",
53
55
  "@testing-library/react": "^14.0.0",
54
56
  "@testing-library/user-event": "^14.5.1",
@@ -57,7 +59,7 @@
57
59
  "@types/react-datepicker": "^6.2.0",
58
60
  "@types/react-dom": "^18.2.0",
59
61
  "esbuild": "^0.19.5",
60
- "esbuild-jest": "^0.5.0",
62
+ "esbuild-jest": "^0.4.0",
61
63
  "esbuild-sass-plugin": "^2.16.0",
62
64
  "eslint": "^9.15.0",
63
65
  "eslint-plugin-react": "^7.37.2",
@@ -69,6 +71,9 @@
69
71
  "npm-dts": "^1.3.12",
70
72
  "react": "^18.2.0",
71
73
  "react-dom": "^18.2.0",
74
+ "stylelint": "^16.12.0",
75
+ "stylelint-config-standard": "^36.0.1",
76
+ "stylelint-config-standard-scss": "^14.0.0",
72
77
  "typescript": "^5.6.3",
73
78
  "typescript-eslint": "^8.15.0"
74
79
  },