@layerfi/components 0.1.102-alpha.6 → 0.1.102
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/dist/cjs/index.cjs +59 -38
- package/dist/esm/index.mjs +59 -38
- package/dist/index.css +15 -2
- package/dist/index.d.ts +1 -2
- package/package.json +3 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -5602,7 +5602,7 @@ var import_react12 = require("react");
|
|
|
5602
5602
|
var import_react10 = require("react");
|
|
5603
5603
|
|
|
5604
5604
|
// package.json
|
|
5605
|
-
var version = "0.1.102
|
|
5605
|
+
var version = "0.1.102";
|
|
5606
5606
|
|
|
5607
5607
|
// src/models/APIError.ts
|
|
5608
5608
|
var APIError = class _APIError extends Error {
|
|
@@ -11479,23 +11479,20 @@ var Button2 = (0, import_react39.forwardRef)((_a, ref) => {
|
|
|
11479
11479
|
icon,
|
|
11480
11480
|
inset,
|
|
11481
11481
|
size = "md",
|
|
11482
|
-
variant = "solid"
|
|
11483
|
-
persistentBorder
|
|
11482
|
+
variant = "solid"
|
|
11484
11483
|
} = _b, restProps = __objRest(_b, [
|
|
11485
11484
|
"children",
|
|
11486
11485
|
"icon",
|
|
11487
11486
|
"inset",
|
|
11488
11487
|
"size",
|
|
11489
|
-
"variant"
|
|
11490
|
-
"persistentBorder"
|
|
11488
|
+
"variant"
|
|
11491
11489
|
]);
|
|
11492
11490
|
const { isPending = false } = restProps;
|
|
11493
11491
|
const dataProperties = toDataProperties({
|
|
11494
11492
|
icon,
|
|
11495
11493
|
inset,
|
|
11496
11494
|
size,
|
|
11497
|
-
variant
|
|
11498
|
-
"persistent-border": persistentBorder
|
|
11495
|
+
variant
|
|
11499
11496
|
});
|
|
11500
11497
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11501
11498
|
import_react_aria_components6.Button,
|
|
@@ -28519,6 +28516,7 @@ var Edit2 = (_a) => {
|
|
|
28519
28516
|
var Edit2_default = Edit2;
|
|
28520
28517
|
|
|
28521
28518
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTable.tsx
|
|
28519
|
+
var import_lucide_react16 = require("lucide-react");
|
|
28522
28520
|
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
28523
28521
|
var ChartOfAccountsTable = ({
|
|
28524
28522
|
view,
|
|
@@ -28577,55 +28575,78 @@ var ChartOfAccountsTableContent = ({
|
|
|
28577
28575
|
}, []);
|
|
28578
28576
|
const renderChartOfAccountsDesktopRow = (account, index, rowKey, depth) => {
|
|
28579
28577
|
var _a, _b;
|
|
28580
|
-
const
|
|
28581
|
-
const
|
|
28578
|
+
const hasSubAccounts = !!account.sub_accounts && account.sub_accounts.length > 0;
|
|
28579
|
+
const isExpanded = hasSubAccounts ? isOpen(rowKey) : true;
|
|
28580
|
+
const isNonEditable = !templateAccountsEditable && !!account.stable_name;
|
|
28581
|
+
const onClickRow = (e) => {
|
|
28582
|
+
e.stopPropagation();
|
|
28583
|
+
if (hasSubAccounts) setIsOpen(rowKey);
|
|
28584
|
+
};
|
|
28585
|
+
const onClickAccountName = (e) => {
|
|
28586
|
+
e.stopPropagation();
|
|
28587
|
+
setAccountId(account.id);
|
|
28588
|
+
};
|
|
28589
|
+
const onClickEdit = (e) => {
|
|
28590
|
+
e.preventDefault();
|
|
28591
|
+
e.stopPropagation();
|
|
28592
|
+
editAccount(account.id);
|
|
28593
|
+
};
|
|
28594
|
+
const onClickView = (e) => {
|
|
28595
|
+
e.preventDefault();
|
|
28596
|
+
e.stopPropagation();
|
|
28597
|
+
setAccountId(account.id);
|
|
28598
|
+
};
|
|
28582
28599
|
return /* @__PURE__ */ (0, import_jsx_runtime248.jsxs)(import_react166.Fragment, { children: [
|
|
28583
28600
|
/* @__PURE__ */ (0, import_jsx_runtime248.jsxs)(
|
|
28584
28601
|
TableRow,
|
|
28585
28602
|
{
|
|
28586
28603
|
rowKey: rowKey + "-" + index,
|
|
28587
|
-
expandable,
|
|
28588
|
-
isExpanded
|
|
28589
|
-
onClick:
|
|
28590
|
-
e.stopPropagation();
|
|
28591
|
-
setAccountId(account.id);
|
|
28592
|
-
},
|
|
28604
|
+
expandable: hasSubAccounts,
|
|
28605
|
+
isExpanded,
|
|
28606
|
+
onClick: onClickRow,
|
|
28593
28607
|
depth,
|
|
28594
28608
|
children: [
|
|
28595
28609
|
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(
|
|
28596
28610
|
TableCell,
|
|
28597
28611
|
{
|
|
28598
|
-
withExpandIcon:
|
|
28599
|
-
|
|
28600
|
-
|
|
28601
|
-
|
|
28602
|
-
}
|
|
28603
|
-
children: account.name
|
|
28612
|
+
withExpandIcon: hasSubAccounts,
|
|
28613
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime248.jsxs)(HStack, { gap: "lg", children: [
|
|
28614
|
+
!hasSubAccounts && /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(Spacer, {}),
|
|
28615
|
+
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(Button2, { variant: "text", onClick: onClickAccountName, children: account.name })
|
|
28616
|
+
] })
|
|
28604
28617
|
}
|
|
28605
28618
|
),
|
|
28606
28619
|
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(TableCell, { children: (_a = account.account_type) == null ? void 0 : _a.display_name }),
|
|
28607
28620
|
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(TableCell, { children: (_b = account.account_subtype) == null ? void 0 : _b.display_name }),
|
|
28608
28621
|
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(TableCell, { isCurrency: true, children: account.balance }),
|
|
28609
|
-
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime248.
|
|
28610
|
-
|
|
28611
|
-
|
|
28612
|
-
|
|
28613
|
-
|
|
28614
|
-
|
|
28615
|
-
|
|
28616
|
-
|
|
28617
|
-
|
|
28618
|
-
|
|
28619
|
-
|
|
28620
|
-
}
|
|
28621
|
-
|
|
28622
|
-
|
|
28623
|
-
|
|
28624
|
-
|
|
28622
|
+
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(TableCell, { align: "right" /* RIGHT */, children: /* @__PURE__ */ (0, import_jsx_runtime248.jsxs)(HStack, { className: "Layer__coa__actions", gap: "xs", children: [
|
|
28623
|
+
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(
|
|
28624
|
+
Button,
|
|
28625
|
+
{
|
|
28626
|
+
variant: "secondary" /* secondary */,
|
|
28627
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(Edit2_default, { size: 14 }),
|
|
28628
|
+
iconOnly: true,
|
|
28629
|
+
disabled: isNonEditable,
|
|
28630
|
+
onClick: onClickEdit,
|
|
28631
|
+
tooltip: isNonEditable ? "This account cannot be modified" : void 0,
|
|
28632
|
+
children: "Edit"
|
|
28633
|
+
}
|
|
28634
|
+
),
|
|
28635
|
+
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(
|
|
28636
|
+
Button,
|
|
28637
|
+
{
|
|
28638
|
+
variant: "secondary" /* secondary */,
|
|
28639
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_lucide_react16.List, { size: 14 }),
|
|
28640
|
+
iconOnly: true,
|
|
28641
|
+
onClick: onClickView,
|
|
28642
|
+
children: "View"
|
|
28643
|
+
}
|
|
28644
|
+
)
|
|
28645
|
+
] }) })
|
|
28625
28646
|
]
|
|
28626
28647
|
}
|
|
28627
28648
|
),
|
|
28628
|
-
|
|
28649
|
+
hasSubAccounts && isExpanded && account.sub_accounts.map((subItem, subIdx) => {
|
|
28629
28650
|
const subRowKey = `${rowKey}-${subItem.id}`;
|
|
28630
28651
|
return renderChartOfAccountsDesktopRow(
|
|
28631
28652
|
subItem,
|
package/dist/esm/index.mjs
CHANGED
|
@@ -5570,7 +5570,7 @@ import { useState as useState5 } from "react";
|
|
|
5570
5570
|
import { useReducer, useEffect as useEffect2 } from "react";
|
|
5571
5571
|
|
|
5572
5572
|
// package.json
|
|
5573
|
-
var version = "0.1.102
|
|
5573
|
+
var version = "0.1.102";
|
|
5574
5574
|
|
|
5575
5575
|
// src/models/APIError.ts
|
|
5576
5576
|
var APIError = class _APIError extends Error {
|
|
@@ -11490,23 +11490,20 @@ var Button2 = forwardRef8((_a, ref) => {
|
|
|
11490
11490
|
icon,
|
|
11491
11491
|
inset,
|
|
11492
11492
|
size = "md",
|
|
11493
|
-
variant = "solid"
|
|
11494
|
-
persistentBorder
|
|
11493
|
+
variant = "solid"
|
|
11495
11494
|
} = _b, restProps = __objRest(_b, [
|
|
11496
11495
|
"children",
|
|
11497
11496
|
"icon",
|
|
11498
11497
|
"inset",
|
|
11499
11498
|
"size",
|
|
11500
|
-
"variant"
|
|
11501
|
-
"persistentBorder"
|
|
11499
|
+
"variant"
|
|
11502
11500
|
]);
|
|
11503
11501
|
const { isPending = false } = restProps;
|
|
11504
11502
|
const dataProperties = toDataProperties({
|
|
11505
11503
|
icon,
|
|
11506
11504
|
inset,
|
|
11507
11505
|
size,
|
|
11508
|
-
variant
|
|
11509
|
-
"persistent-border": persistentBorder
|
|
11506
|
+
variant
|
|
11510
11507
|
});
|
|
11511
11508
|
return /* @__PURE__ */ jsx66(
|
|
11512
11509
|
ReactAriaButton2,
|
|
@@ -28627,6 +28624,7 @@ var Edit2 = (_a) => {
|
|
|
28627
28624
|
var Edit2_default = Edit2;
|
|
28628
28625
|
|
|
28629
28626
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTable.tsx
|
|
28627
|
+
import { List } from "lucide-react";
|
|
28630
28628
|
import { jsx as jsx247, jsxs as jsxs152 } from "react/jsx-runtime";
|
|
28631
28629
|
var ChartOfAccountsTable = ({
|
|
28632
28630
|
view,
|
|
@@ -28685,55 +28683,78 @@ var ChartOfAccountsTableContent = ({
|
|
|
28685
28683
|
}, []);
|
|
28686
28684
|
const renderChartOfAccountsDesktopRow = (account, index, rowKey, depth) => {
|
|
28687
28685
|
var _a, _b;
|
|
28688
|
-
const
|
|
28689
|
-
const
|
|
28686
|
+
const hasSubAccounts = !!account.sub_accounts && account.sub_accounts.length > 0;
|
|
28687
|
+
const isExpanded = hasSubAccounts ? isOpen(rowKey) : true;
|
|
28688
|
+
const isNonEditable = !templateAccountsEditable && !!account.stable_name;
|
|
28689
|
+
const onClickRow = (e) => {
|
|
28690
|
+
e.stopPropagation();
|
|
28691
|
+
if (hasSubAccounts) setIsOpen(rowKey);
|
|
28692
|
+
};
|
|
28693
|
+
const onClickAccountName = (e) => {
|
|
28694
|
+
e.stopPropagation();
|
|
28695
|
+
setAccountId(account.id);
|
|
28696
|
+
};
|
|
28697
|
+
const onClickEdit = (e) => {
|
|
28698
|
+
e.preventDefault();
|
|
28699
|
+
e.stopPropagation();
|
|
28700
|
+
editAccount(account.id);
|
|
28701
|
+
};
|
|
28702
|
+
const onClickView = (e) => {
|
|
28703
|
+
e.preventDefault();
|
|
28704
|
+
e.stopPropagation();
|
|
28705
|
+
setAccountId(account.id);
|
|
28706
|
+
};
|
|
28690
28707
|
return /* @__PURE__ */ jsxs152(Fragment34, { children: [
|
|
28691
28708
|
/* @__PURE__ */ jsxs152(
|
|
28692
28709
|
TableRow,
|
|
28693
28710
|
{
|
|
28694
28711
|
rowKey: rowKey + "-" + index,
|
|
28695
|
-
expandable,
|
|
28696
|
-
isExpanded
|
|
28697
|
-
onClick:
|
|
28698
|
-
e.stopPropagation();
|
|
28699
|
-
setAccountId(account.id);
|
|
28700
|
-
},
|
|
28712
|
+
expandable: hasSubAccounts,
|
|
28713
|
+
isExpanded,
|
|
28714
|
+
onClick: onClickRow,
|
|
28701
28715
|
depth,
|
|
28702
28716
|
children: [
|
|
28703
28717
|
/* @__PURE__ */ jsx247(
|
|
28704
28718
|
TableCell,
|
|
28705
28719
|
{
|
|
28706
|
-
withExpandIcon:
|
|
28707
|
-
|
|
28708
|
-
|
|
28709
|
-
|
|
28710
|
-
}
|
|
28711
|
-
children: account.name
|
|
28720
|
+
withExpandIcon: hasSubAccounts,
|
|
28721
|
+
children: /* @__PURE__ */ jsxs152(HStack, { gap: "lg", children: [
|
|
28722
|
+
!hasSubAccounts && /* @__PURE__ */ jsx247(Spacer, {}),
|
|
28723
|
+
/* @__PURE__ */ jsx247(Button2, { variant: "text", onClick: onClickAccountName, children: account.name })
|
|
28724
|
+
] })
|
|
28712
28725
|
}
|
|
28713
28726
|
),
|
|
28714
28727
|
/* @__PURE__ */ jsx247(TableCell, { children: (_a = account.account_type) == null ? void 0 : _a.display_name }),
|
|
28715
28728
|
/* @__PURE__ */ jsx247(TableCell, { children: (_b = account.account_subtype) == null ? void 0 : _b.display_name }),
|
|
28716
28729
|
/* @__PURE__ */ jsx247(TableCell, { isCurrency: true, children: account.balance }),
|
|
28717
|
-
/* @__PURE__ */ jsx247(TableCell, { children: /* @__PURE__ */
|
|
28718
|
-
|
|
28719
|
-
|
|
28720
|
-
|
|
28721
|
-
|
|
28722
|
-
|
|
28723
|
-
|
|
28724
|
-
|
|
28725
|
-
|
|
28726
|
-
|
|
28727
|
-
|
|
28728
|
-
}
|
|
28729
|
-
|
|
28730
|
-
|
|
28731
|
-
|
|
28732
|
-
|
|
28730
|
+
/* @__PURE__ */ jsx247(TableCell, { align: "right" /* RIGHT */, children: /* @__PURE__ */ jsxs152(HStack, { className: "Layer__coa__actions", gap: "xs", children: [
|
|
28731
|
+
/* @__PURE__ */ jsx247(
|
|
28732
|
+
Button,
|
|
28733
|
+
{
|
|
28734
|
+
variant: "secondary" /* secondary */,
|
|
28735
|
+
rightIcon: /* @__PURE__ */ jsx247(Edit2_default, { size: 14 }),
|
|
28736
|
+
iconOnly: true,
|
|
28737
|
+
disabled: isNonEditable,
|
|
28738
|
+
onClick: onClickEdit,
|
|
28739
|
+
tooltip: isNonEditable ? "This account cannot be modified" : void 0,
|
|
28740
|
+
children: "Edit"
|
|
28741
|
+
}
|
|
28742
|
+
),
|
|
28743
|
+
/* @__PURE__ */ jsx247(
|
|
28744
|
+
Button,
|
|
28745
|
+
{
|
|
28746
|
+
variant: "secondary" /* secondary */,
|
|
28747
|
+
rightIcon: /* @__PURE__ */ jsx247(List, { size: 14 }),
|
|
28748
|
+
iconOnly: true,
|
|
28749
|
+
onClick: onClickView,
|
|
28750
|
+
children: "View"
|
|
28751
|
+
}
|
|
28752
|
+
)
|
|
28753
|
+
] }) })
|
|
28733
28754
|
]
|
|
28734
28755
|
}
|
|
28735
28756
|
),
|
|
28736
|
-
|
|
28757
|
+
hasSubAccounts && isExpanded && account.sub_accounts.map((subItem, subIdx) => {
|
|
28737
28758
|
const subRowKey = `${rowKey}-${subItem.id}`;
|
|
28738
28759
|
return renderChartOfAccountsDesktopRow(
|
|
28739
28760
|
subItem,
|
package/dist/index.css
CHANGED
|
@@ -186,10 +186,10 @@
|
|
|
186
186
|
--outline-default: var(--color-base-300);
|
|
187
187
|
--outline-active: var(--color-base-500);
|
|
188
188
|
--button-bg-default: var(--color-base-1000);
|
|
189
|
-
--button-
|
|
189
|
+
--button-bg-disabled: var(--color-base-200);
|
|
190
190
|
--button-bg-active: var(--color-base-800);
|
|
191
|
+
--button-fg-default: var(--color-base-0);
|
|
191
192
|
--button-fg-disabled: var(--color-base-500);
|
|
192
|
-
--button-bg-disabled: var(--color-base-200);
|
|
193
193
|
--button-fg-ghost: var(--color-base-800);
|
|
194
194
|
--button-border-color-ghost: var(--color-base-300);
|
|
195
195
|
--button-border-color-ghost-active: var(--color-base-800);
|
|
@@ -4518,6 +4518,19 @@ tbody .Layer__table__empty-row:first-child {
|
|
|
4518
4518
|
outline: 2px solid var(--outline-default);
|
|
4519
4519
|
background-color: var(--button-bg-active);
|
|
4520
4520
|
}
|
|
4521
|
+
.Layer__UI__Button[data-variant=text] {
|
|
4522
|
+
--size: 1.75rem;
|
|
4523
|
+
padding-inline: var(--spacing-xs);
|
|
4524
|
+
border: none;
|
|
4525
|
+
background-color: transparent;
|
|
4526
|
+
}
|
|
4527
|
+
.Layer__UI__Button[data-variant=text][data-hovered]:not([data-disabled], [data-pressed]) {
|
|
4528
|
+
outline: none;
|
|
4529
|
+
text-decoration: underline;
|
|
4530
|
+
}
|
|
4531
|
+
.Layer__UI__Button[data-variant=text][data-pressed]:not([data-focus-visible]) {
|
|
4532
|
+
text-decoration: none;
|
|
4533
|
+
}
|
|
4521
4534
|
.Layer__ButtonTransparentContent {
|
|
4522
4535
|
opacity: 0;
|
|
4523
4536
|
grid-row: 1/-1;
|
package/dist/index.d.ts
CHANGED
|
@@ -5006,14 +5006,13 @@ declare module '@layerfi/components/components/domain/transactions/searchField/T
|
|
|
5006
5006
|
}
|
|
5007
5007
|
declare module '@layerfi/components/components/ui/Button/Button' {
|
|
5008
5008
|
import { type ButtonProps } from 'react-aria-components';
|
|
5009
|
-
type ButtonVariant = 'solid' | 'ghost' | 'outlined';
|
|
5009
|
+
type ButtonVariant = 'solid' | 'ghost' | 'outlined' | 'text';
|
|
5010
5010
|
type ButtonSize = 'md';
|
|
5011
5011
|
const Button: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "className"> & {
|
|
5012
5012
|
icon?: true;
|
|
5013
5013
|
inset?: true;
|
|
5014
5014
|
size?: ButtonSize;
|
|
5015
5015
|
variant?: ButtonVariant;
|
|
5016
|
-
persistentBorder?: boolean;
|
|
5017
5016
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5018
5017
|
export { Button };
|
|
5019
5018
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerfi/components",
|
|
3
|
-
"version": "0.1.102
|
|
3
|
+
"version": "0.1.102",
|
|
4
4
|
"description": "Layer React Components",
|
|
5
5
|
"main": "dist/cjs/index.cjs",
|
|
6
6
|
"module": "dist/esm/index.mjs",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"npm-dts": "^1.3.13",
|
|
67
67
|
"react": "^18.2.0",
|
|
68
68
|
"react-dom": "^18.2.0",
|
|
69
|
-
"stylelint": "^16.
|
|
69
|
+
"stylelint": "^16.21.0",
|
|
70
70
|
"stylelint-config-standard": "^38.0.0",
|
|
71
|
-
"stylelint-config-standard-scss": "^15.0.
|
|
71
|
+
"stylelint-config-standard-scss": "^15.0.1",
|
|
72
72
|
"stylelint-order": "^7.0.0",
|
|
73
73
|
"typescript": "^5.8.3",
|
|
74
74
|
"typescript-eslint": "^8.32.0"
|