@layerfi/components 0.1.75 → 0.1.77

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/.eslintrc.js CHANGED
@@ -1,3 +1,4 @@
1
+ /** @type {import("eslint").Linter.Config} */
1
2
  module.exports = {
2
3
  env: {
3
4
  browser: true,
@@ -6,8 +7,9 @@ module.exports = {
6
7
  },
7
8
  extends: [
8
9
  'eslint:recommended',
9
- 'plugin:react/recommended',
10
10
  'plugin:@typescript-eslint/recommended',
11
+ 'plugin:react/recommended',
12
+ 'plugin:react-hooks/recommended',
11
13
  ],
12
14
  ignorePatterns: ['build/*', 'dist/*', 'bin/*'],
13
15
  parser: '@typescript-eslint/parser',
@@ -18,24 +20,26 @@ module.exports = {
18
20
  ecmaVersion: 'latest',
19
21
  sourceType: 'module',
20
22
  },
21
- plugins: ['react', '@typescript-eslint', 'prettier', 'import'],
23
+ plugins: ['@typescript-eslint', '@stylistic', 'unused-imports'],
22
24
  rules: {
23
- 'prettier/prettier': 'error',
24
- indent: ['off', 2, { SwitchCase: 1 }],
25
- 'linebreak-style': ['error', 'unix'],
26
- 'no-console': ['error', { allow: ['warn', 'error'] }],
27
- quotes: ['error', 'single'],
28
- 'react/react-in-jsx-scope': 'off',
29
- semi: ['error', 'never'],
30
- 'object-curly-spacing': ['error', 'always', { objectsInObjects: true }],
31
- '@typescript-eslint/no-unused-vars': [
32
- 'warn',
25
+ 'no-console': ['error', { allow: ['warn', 'error', 'debug'] }],
26
+
27
+ '@stylistic/quotes': ['error', 'single', { avoidEscape: false }],
28
+ '@stylistic/jsx-quotes': ['error', 'prefer-single'],
29
+ '@stylistic/semi': ['error', 'never'],
30
+
31
+ '@typescript-eslint/no-unused-vars': 'off',
32
+ 'unused-imports/no-unused-imports': 'error',
33
+ 'unused-imports/no-unused-vars': [
34
+ 'error',
33
35
  {
34
36
  argsIgnorePattern: '^_',
35
37
  varsIgnorePattern: '^_',
36
38
  caughtErrorsIgnorePattern: '^_',
37
39
  },
38
40
  ],
41
+
42
+ 'react/prop-types': 'off',
39
43
  },
40
44
  overrides: [
41
45
  {
@@ -50,4 +54,9 @@ module.exports = {
50
54
  },
51
55
  },
52
56
  ],
57
+ settings: {
58
+ react: {
59
+ version: 'detect',
60
+ },
61
+ },
53
62
  }
package/README.md CHANGED
@@ -160,7 +160,7 @@ import { ProfitAndLoss } from "@layerfi/components";
160
160
  </ProfitAndLoss>
161
161
  ```
162
162
 
163
- #### Profit and Loss Summary Cards
163
+ #### Profit and Loss Summaries
164
164
 
165
165
  ![](https://github.com/Layer-Fi/layer-react/assets/1592431/06459f20-519e-4413-80ba-fb9965c32f9f)
166
166
 
@@ -168,26 +168,14 @@ import { ProfitAndLoss } from "@layerfi/components";
168
168
  import { ProfitAndLoss } from "@layerfi/components";
169
169
 
170
170
  <ProfitAndLoss>
171
- <div className='Layer__accounting-overview__summaries-row'>
172
- <ProfitAndLoss.Summaries actionable={false} />
173
- <TransactionToReviewCard onClick={onTransactionsToReviewClick} />
174
- </div>
171
+ <ProfitAndLoss.Summaries />
175
172
  </ProfitAndLoss>
176
173
  ```
177
174
 
178
- Props:
179
-
180
- - `actionable`: enables or disables whether clicking the revenue & expense charts open the P&L sidebar view.
181
- - `vertical`: changes the card layout to be vertically stacked instead of horizontal
182
- - `revenueLabel`: specifiable label for revenue for uses where you prefer 'income' or other another term.
175
+ The P&L Summaries section supports several optional props:
183
176
 
184
- 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 categorization page lives on `/account/bank-transactions` within your app:
185
-
186
- ```tsx
187
- <Onboarding
188
- onTransactionsToReviewClick={() => navigate('/accounting/bank-transactions')}
189
- />
190
- ```
177
+ - `actionable`: When enabled, clicking the revenue & expense charts will open the P&L sidebar view.
178
+ - `variants`: Override the size of the component; supports a small and large version.
191
179
 
192
180
  #### Profit and Loss Table
193
181