@layerfi/components 0.1.31 → 0.1.33
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 +122 -21
- package/dist/esm/index.js +7911 -7418
- package/dist/esm/index.js.map +4 -4
- package/dist/index.d.ts +308 -60
- package/dist/index.js +10856 -10371
- package/dist/index.js.map +4 -4
- package/dist/styles/index.css +527 -183
- package/dist/styles/index.css.map +3 -3
- package/package.json +1 -1
- package/.idea/codeStyles/Project.xml +0 -61
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/layer-react.iml +0 -9
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
package/README.md
CHANGED
|
@@ -69,22 +69,33 @@ import { LayerProvider } from "@layerfi/components";
|
|
|
69
69
|
|
|
70
70
|
## Components
|
|
71
71
|
|
|
72
|
-
###
|
|
72
|
+
### Onboarding
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
The onboarding component can be included on an accounting landing page to prompt users to connect accounts.
|
|
75
|
+

|
|
76
|
+
|
|
77
|
+
After connecting accounts, the component will change into a prompt to categorize transactions.
|
|
78
|
+

|
|
79
|
+
|
|
80
|
+
For a business that has already onboarded, this component will render nothing, so it's safe to leave on the default page for all businesses.
|
|
75
81
|
|
|
76
82
|
```tsx
|
|
77
|
-
|
|
78
|
-
…
|
|
79
|
-
<ProfitAndLoss>
|
|
80
|
-
<ProfitAndLoss.Chart />
|
|
81
|
-
<ProfitAndLoss.Summaries />
|
|
82
|
-
<ProfitAndLoss.DatePicker />
|
|
83
|
-
<ProfitAndLoss.Table />
|
|
84
|
-
</ProfitAndLoss>
|
|
83
|
+
<Onboarding onTransactionsToReviewClick={onTransactionsToReviewClick} />
|
|
85
84
|
```
|
|
86
85
|
|
|
87
|
-
|
|
86
|
+
This component has one primary prop: `onTransactionsToReviewClick` should be a function which navigates to the bank transactions to review page. For example, if the bank transaction categorizaiton page lives on `/account/bank-transactions` within your app:
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
<Onboarding
|
|
90
|
+
onTransactionsToReviewClick={() => navigate('/accounting/bank-transactions')}
|
|
91
|
+
/>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
This prop is a function, so you can use your app's standard strategy for navigation.
|
|
95
|
+
|
|
96
|
+
### Bank Accounts & Transactions
|
|
97
|
+
|
|
98
|
+
#### Linked Accounts
|
|
88
99
|
|
|
89
100
|
Displays all accounts connected to Layer including embedded banking, Plaid, and custom accounts.
|
|
90
101
|
|
|
@@ -97,7 +108,13 @@ Displays all accounts connected to Layer including embedded banking, Plaid, and
|
|
|
97
108
|
/>
|
|
98
109
|
```
|
|
99
110
|
|
|
100
|
-
|
|
111
|
+
Props:
|
|
112
|
+
|
|
113
|
+
- `asWidget`: Minimized version of the component
|
|
114
|
+
- `elevated`: Stylistic option to highlight component
|
|
115
|
+
- `showLedgerBalance`: Flag to enable or hide the current ledger balance corresponding to this external account. Useful for reconciliation.
|
|
116
|
+
|
|
117
|
+
#### Transaction categorization
|
|
101
118
|
|
|
102
119
|
The transaction categorization component handles displaying both categorized transactions and the workflow for categorizing new transactions as they are imported into Layer.
|
|
103
120
|
|
|
@@ -125,32 +142,116 @@ setFilters({ amount: { min: 0, max: 10000 } })
|
|
|
125
142
|
<BankTransactions />
|
|
126
143
|
```
|
|
127
144
|
|
|
128
|
-
###
|
|
145
|
+
### Reporting
|
|
146
|
+
|
|
147
|
+
#### Profit And Loss Chart
|
|
148
|
+
|
|
149
|
+

|
|
129
150
|
|
|
130
|
-
|
|
151
|
+
```tsx
|
|
152
|
+
import { ProfitAndLoss } from "@layerfi/components";
|
|
153
|
+
…
|
|
154
|
+
<ProfitAndLoss>
|
|
155
|
+
<ProfitAndLoss.Chart />
|
|
156
|
+
<ProfitAndLoss.Summaries />
|
|
157
|
+
<ProfitAndLoss.DatePicker />
|
|
158
|
+
<ProfitAndLoss.Table />
|
|
159
|
+
</ProfitAndLoss>
|
|
160
|
+
```
|
|
131
161
|
|
|
132
|
-
|
|
162
|
+
#### Profit and Loss Summary Cards
|
|
133
163
|
|
|
134
|
-
|
|
164
|
+

|
|
135
165
|
|
|
136
166
|
```tsx
|
|
137
|
-
|
|
167
|
+
import { ProfitAndLoss } from "@layerfi/components";
|
|
168
|
+
…
|
|
169
|
+
<ProfitAndLoss>
|
|
170
|
+
<div className='Layer__accounting-overview__summaries-row'>
|
|
171
|
+
<ProfitAndLoss.Summaries actionable={false} />
|
|
172
|
+
<TransactionToReviewCard onClick={onTransactionsToReviewClick} />
|
|
173
|
+
</div>
|
|
174
|
+
</ProfitAndLoss>
|
|
138
175
|
```
|
|
139
176
|
|
|
140
|
-
|
|
177
|
+
Props:
|
|
178
|
+
|
|
179
|
+
- `actionable`: enables or disables whether clicking the revenue & expense charts open the P&L sidebar view.
|
|
180
|
+
- `vertical`: changes the card layout to be vertically stacked instead of horizontal
|
|
181
|
+
- `revenueLabel`: specifiable label for revenue for uses where you prefer 'income' or other another term.
|
|
182
|
+
|
|
183
|
+
Note that the `<TransactionToReviewCard>` is a separate component, but is meant to be optionally bundled with the summary cards. As with the onboarding component, this component has one primary prop: `onTransactionsToReviewClick` should be a function which navigates to the bank transactions to review page. For example, if the bank transaction categorizaiton page lives on `/account/bank-transactions` within your app:
|
|
141
184
|
|
|
142
185
|
```tsx
|
|
143
|
-
<
|
|
186
|
+
<Onboarding
|
|
187
|
+
onTransactionsToReviewClick={() => navigate('/accounting/bank-transactions')}
|
|
188
|
+
/>
|
|
144
189
|
```
|
|
145
190
|
|
|
146
|
-
|
|
191
|
+
#### Profit and Loss Table
|
|
147
192
|
|
|
148
|
-
|
|
193
|
+

|
|
194
|
+
|
|
195
|
+
```tsx
|
|
196
|
+
import { ProfitAndLoss } from "@layerfi/components";
|
|
197
|
+
…
|
|
198
|
+
<ProfitAndLoss>
|
|
199
|
+
<ProfitAndLoss.Table>
|
|
200
|
+
</ProfitAndLoss>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
The P&L table supports one optional prop:
|
|
204
|
+
|
|
205
|
+
- `lockExpanded` forces the table to be fully expanded showing all rows
|
|
206
|
+
|
|
207
|
+
#### Balance Sheet
|
|
208
|
+
|
|
209
|
+

|
|
210
|
+
|
|
211
|
+
The Balance Sheet component displays an interactive table. A default date can be passed in via the `effectiveDate` prop.
|
|
212
|
+
|
|
213
|
+
#### Statement of Cash Flows
|
|
214
|
+
|
|
215
|
+

|
|
216
|
+
|
|
217
|
+
The statement of cashflows component is an interactive table displaying cash changes broken out into investing, financing, and operational activities. It is shown calculated via the standard indirect method.
|
|
218
|
+
|
|
219
|
+
### Ledger
|
|
220
|
+
|
|
221
|
+
#### Chart of Accounts
|
|
222
|
+
|
|
223
|
+

|
|
224
|
+
|
|
225
|
+
The chart of accounts gives direct read and write access into the double entry general ledger underlying Layer's data. It exposes the list of accounts and enables users to create new accounts.
|
|
149
226
|
|
|
150
227
|
```tsx
|
|
151
228
|
<ChartOfAccounts asWidget withDateControl withExpandAllButton />
|
|
152
229
|
```
|
|
153
230
|
|
|
231
|
+
The following props are supported
|
|
232
|
+
|
|
233
|
+
- `asWidget`: Displays a more compact version.
|
|
234
|
+
- `withDateControl`: Includes a date picker which determines the effective date of account balances displayed.
|
|
235
|
+
- `withExpandAllButton`: Optionally displays a button to expand and collapse all sub account lists.
|
|
236
|
+
|
|
237
|
+
#### Journal
|
|
238
|
+
|
|
239
|
+

|
|
240
|
+
|
|
241
|
+
The Journal component displays the full history of journal entries and allows users to create journal entries by hand as well.
|
|
242
|
+
|
|
243
|
+
A sidebar expands to display details about the invoice.
|
|
244
|
+
|
|
245
|
+

|
|
246
|
+
|
|
247
|
+
```tsx
|
|
248
|
+
<Journal />
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
The follow props are supported:
|
|
252
|
+
|
|
253
|
+
- `asWidget`: Compact version
|
|
254
|
+
|
|
154
255
|
## Styling
|
|
155
256
|
|
|
156
257
|
You have a range of options for custom styling. In order of most simple to most control:
|