Skip to content

Commit 8b728af

Browse files
authored
Merge pull request #112 from openinfradev/feature-scss
Feature. Refactor SCSS to use @use for design tokens and clean imports
2 parents 5264b5c + 8b0e768 commit 8b728af

File tree

54 files changed

+155
-82
lines changed

Some content is hidden

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

54 files changed

+155
-82
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dist-ssr
1717
*.local
1818
storybook-static
1919
coverage
20+
lib
2021

2122

2223
# Editor directories and files

.storybook/main.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ const resolve = (dir) => path.join(__dirname, '.', dir);
55

66
module.exports = {
77
stories: ['../stories/components/**/*.stories.tsx'],
8-
addons: [
9-
'@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions', {
10-
name: '@storybook/preset-scss',
11-
options: {
12-
sassLoaderOptions: {
13-
additionalData: '@import "/src/styles/designToken/Entry.scss";',
14-
},
15-
},
16-
}
17-
],
188
framework: {
199
name: '@storybook/react-vite',
2010
options: {},
@@ -26,17 +16,22 @@ module.exports = {
2616
resolve: {
2717
alias: {
2818
'@': path.resolve('src'),
19+
'src': path.resolve('src'),
2920
'~': path.resolve('src/components'),
3021
'~style': path.resolve('src/styles'),
3122
},
3223
},
3324
css: {
3425
preprocessorOptions: {
3526
scss: {
36-
additionalData: '@import "/src/styles/designToken/Entry.scss";',
37-
},
38-
},
39-
},
27+
api: 'modern',
28+
includePaths: [
29+
path.resolve(__dirname, '../node_modules'),
30+
path.resolve(__dirname, '../')
31+
]
32+
}
33+
}
34+
}
4035
});
4136
},
4237
docs: {

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tksui-components",
3-
"version": "0.8.28",
3+
"version": "0.8.31",
44
"private": false,
55
"type": "module",
66
"module": "lib/esm/index.js",
@@ -10,12 +10,14 @@
1010
],
1111
"scripts": {
1212
"clean": "rimraf lib",
13-
"css-build": "sass --no-source-map src/styles/Entry.scss:lib/styles/index.css src/styles/designToken/ThemeToken.module.scss:lib/styles/ThemeToken.module.css",
13+
"css-build": "sass --no-source-map --load-path=. src/styles/Entry.scss:lib/styles/index.css src/styles/designToken/ThemeToken.module.scss:lib/styles/ThemeToken.module.css",
1414
"css-minify": "esbuild lib/styles/index.css --minify --allow-overwrite --outfile=lib/styles/index.css && esbuild lib/styles/ThemeToken.module.css --minify --allow-overwrite --outfile=lib/styles/ThemeToken.module.css",
1515
"js-build": "tsc --project tsconfig.esm.json && tsc-alias -p tsconfig.esm.json",
1616
"js-content-replace": "node build-content-replacer.js",
1717
"js-minify": "esbuild lib/esm/**/*.js --minify --allow-overwrite --outdir=lib/esm",
1818
"build-all": "npm run clean && npm run css-build && npm run css-minify && npm run js-build && npm run js-content-replace && npm run js-minify",
19+
"yalc-publish": "npm run build-all && npx yalc publish",
20+
"yalc-push": "npm run build-all && npx yalc push",
1921
"patch": "npm run build-all && npm version patch && npm publish && npm run clean",
2022
"minor": "npm run build-all && npm version minor && npm publish && npm run clean",
2123
"major": "npm run build-all && npm version major && npm publish && npm run clean",
@@ -74,7 +76,8 @@
7476
"typescript": "^5.0.2",
7577
"typescript-plugin-css-modules": "^5.0.2",
7678
"vite": "^5.3.3",
77-
"vite-plugin-compression2": "^0.10.4"
79+
"vite-plugin-compression2": "^0.10.4",
80+
"yalc": "^1.0.0-pre.53"
7881
},
7982
"dependencies": {
8083
"@material-symbols/font-300": "^0.14.5",

src/common/hook/UseClickOutside.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import {MutableRefObject, useEffect} from 'react';
24

35

src/common/hook/UseInputState.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import {useState} from 'react';
24

35

src/common/hook/UsePagination.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import {useCallback, useState} from 'react';
24
import {TPageRequestVO, TPageResponseVO} from '~/data-container/data-grid';
35

src/common/hook/UseRefs.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import {MutableRefObject, useRef} from 'react';
24

35

src/common/hook/UseRipple.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import {CSSProperties, KeyboardEvent, MouseEvent, MutableRefObject, useRef} from 'react';
24
import colorUtil from '../util/ColorUtil';
35
import lodashUtil from '@/common/util/lodashUtil';

src/common/hook/UseValidator.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import {useState} from 'react';
24
import {TRadioGroupValue} from '../../components/input/radio-group/TRadioGroup.interface';
35
import {TCheckboxGroupValue} from '../../components/input/checkbox-group/TCheckboxGroup.interface';

src/components/data-container/data-grid/TDataGrid.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ const TDataGrid = forwardRef(({
1616
defaultColDef = {
1717
sortable: false,
1818
resizable: true,
19-
showDisabledCheckboxes: true,
2019
},
2120
animateRows = true,
2221
popupParent = document.body,
23-
suppressRowClickSelection = true,
2422
enableCellTextSelection = true,
2523
headerHeight = DEFAULT_HEADER_HEIGHT,
2624
rowHeight = DEFAULT_ROW_HEIGHT,
@@ -36,7 +34,6 @@ const TDataGrid = forwardRef(({
3634
defaultColDef,
3735
animateRows,
3836
popupParent,
39-
suppressRowClickSelection,
4037
enableCellTextSelection,
4138
headerHeight,
4239
rowHeight,

0 commit comments

Comments
 (0)