Skip to content

Commit f7de8d4

Browse files
fix(staking): [LW-9583] storybook LocalThemeProvider, vanilla-extract usage and new linter rules (#1030)
1 parent 718ed3b commit f7de8d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1328
-275
lines changed

.github/shared/build/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ runs:
4545
- name: Build dist version
4646
shell: bash
4747
env:
48+
NODE_OPTIONS: '--max_old_space_size=8192'
4849
BUILD_DEV_PREVIEW: ${{ inputs.BUILD_DEV_PREVIEW }}
4950
LACE_EXTENSION_KEY: ${{ inputs.LACE_EXTENSION_KEY }}
5051
POSTHOG_PRODUCTION_TOKEN_MAINNET: ${{ inputs.POSTHOG_PRODUCTION_TOKEN_MAINNET }}

.github/workflows/packages-staking.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ jobs:
4545
- name: Run tests
4646
run: yarn workspace @lace/staking test:unit
4747
- name: Build Staking dist
48+
env:
49+
NODE_OPTIONS: '--max_old_space_size=8192'
4850
run: yarn workspace @lace/staking build

packages/staking/.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/staking/.eslintrc.cjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ module.exports = {
3737
groups: ['builtin', 'external', 'type', 'internal', 'parent', 'sibling', 'index'],
3838
},
3939
],
40+
'no-restricted-imports': [
41+
'error',
42+
{
43+
paths: [
44+
{
45+
importNames: ['sx', 'style', 'recipe', 'vars', 'LocalThemeProvider'],
46+
message: "Please import from 'features/theme' or directly e.g. '@vanilla-extract/css'.",
47+
name: '@lace/ui',
48+
},
49+
],
50+
},
51+
],
4052
'promise/avoid-new': 'off',
4153
'react/jsx-curly-brace-presence': 2,
4254
'react/jsx-handler-names': 'off',

packages/staking/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dist
22
build
33
node_modules
4+
storybook-static

packages/staking/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
"@lace/ui": "^0.1.0",
5757
"@radix-ui/react-slider": "^1.1.2",
5858
"@vanilla-extract/css": "^1.11.1",
59+
"@vanilla-extract/recipes": "^0.5.1",
60+
"@vanilla-extract/sprinkles": "^1.5.1",
5961
"classnames": "^2.3.2",
6062
"i18next": "^22.5.1",
6163
"immer": "^10.0.2",
@@ -93,8 +95,7 @@
9395
"@testing-library/react-hooks": "^8.0.1",
9496
"@tsconfig/create-react-app": "^1.0.3",
9597
"@vanilla-extract/esbuild-plugin": "^2.2.2",
96-
"@vanilla-extract/recipes": "^0.5.1",
97-
"@vanilla-extract/vite-plugin": "^3.9.3",
98+
"@vanilla-extract/vite-plugin": "^3.9.5",
9899
"@vitest/coverage-c8": "^0.31.0",
99100
"antd": "^4.24.10",
100101
"babel-loader": "^8.3.0",

packages/staking/src/features/BrowsePools/BrowsePools.css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { sx } from '@lace/ui';
1+
import { sx } from 'features/theme';
22

33
export const browsePools = sx({
44
alignItems: 'stretch',
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { style } from '@lace/ui';
2-
import { theme } from 'features/theme';
1+
import { sx } from 'features/theme';
32

4-
export const title = style({
5-
color: theme.colors.$titleColor,
3+
export const title = sx({
4+
color: '$titleColor',
65
});

packages/staking/src/features/BrowsePools/BrowsePoolsPreferencesCard/BrowsePoolsPreferencesCard.css.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
import { style, sx } from '@lace/ui';
2-
import { theme } from 'features/theme';
1+
import { style } from '@vanilla-extract/css';
2+
import { sx } from 'features/theme';
33

4-
export const textBoxLeft = style({
5-
borderBottomRightRadius: 0,
6-
borderRightColor: theme.colors.$browsePoolsFilterInputRightBorderColor,
7-
borderRightStyle: 'solid',
8-
borderRightWidth: 2,
9-
borderTopRightRadius: 0,
10-
});
4+
export const textBoxLeft = style([
5+
sx({
6+
borderRightColor: '$browsePoolsFilterInputRightBorderColor',
7+
}),
8+
{
9+
borderBottomRightRadius: 0,
10+
borderRightStyle: 'solid',
11+
borderRightWidth: 2,
12+
borderTopRightRadius: 0,
13+
},
14+
]);
1115

1216
export const textBoxRight = style({
1317
borderBottomLeftRadius: 0,

packages/staking/src/features/BrowsePools/BrowsePoolsPreferencesCard/BrowsePoolsPreferencesCard.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { Box, Cell, Flex, Grid, LocalThemeProvider, Section, ThemeColorScheme, Variants } from '@lace/ui';
1+
import { Box, Cell, Flex, Grid, Section, ThemeColorScheme, Variants } from '@lace/ui';
22
import { action } from '@storybook/addon-actions';
33
import { useArgs } from '@storybook/preview-api';
44
import { expect, userEvent, waitFor, within } from '@storybook/test';
5+
import { LocalThemeProvider } from 'features/theme';
56
import { useCallback, useState } from 'react';
67
import type { StakePoolSortOptions } from '../types';
78
import type { Meta, StoryObj } from '@storybook/react';

0 commit comments

Comments
 (0)