Skip to content

Commit af3a749

Browse files
authored
Add support for indicator icons (normally used for showing sort) (#896)
* Add support for header indicator icons * Fix test * Cleanup warnings * Add click event * Fix test files * Fix header click
1 parent aee0aa7 commit af3a749

32 files changed

+36507
-39221
lines changed

.storybook/main.js renamed to .storybook/main.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
1-
const { dirname, join } = require("path");
2-
const linaria = require("@linaria/vite");
3-
const vite = require("vite");
1+
import { dirname, join } from "path";
2+
import linaria from "@linaria/vite";
3+
import { mergeConfig } from "vite";
44

5-
const mergeConfig = vite.mergeConfig;
6-
7-
module.exports = {
5+
export default {
86
stories: ["../**/src/**/*.stories.tsx"],
9-
addons: ["@storybook/addon-storysource", getAbsolutePath("@storybook/addon-controls")],
10-
core: {
11-
builder: "@storybook/builder-vite",
12-
},
7+
addons: [getAbsolutePath("@storybook/addon-storysource"), getAbsolutePath("@storybook/addon-controls")],
138

149
typescript: {
1510
reactDocgen: false,
1611
},
1712

1813
async viteFinal(config) {
1914
return mergeConfig(config, {
20-
plugins: [linaria.default()],
15+
plugins: [linaria()],
2116
});
2217
},
2318

File renamed without changes.
File renamed without changes.

package-lock.json

Lines changed: 36084 additions & 39045 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 100 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,102 @@
11
{
2-
"name": "root",
3-
"version": "6.0.3",
4-
"scripts": {
5-
"start": "npm run storybook",
6-
"version": "./update-version.sh",
7-
"build": "npm run build --workspaces && npm run lint --workspaces",
8-
"typedoc": "typedoc --readme none --disableSources --tsconfig packages/core/tsconfig.json",
9-
"serve-docs": "http-server packages/core/gen-docs",
10-
"storybook:run": "storybook dev -p 9009 --no-open",
11-
"watch:core": "npm run watch -w packages/core",
12-
"storybook": "concurrently \"npm run storybook:run\" \"npm run watch:core\"",
13-
"build-storybook": "npm run build --workspaces && storybook build -o storybook-build/",
14-
"prod-storybook": "npm run build-storybook && npx http-server storybook-build -p 9009",
15-
"test": "cd packages/core && npm run test --",
16-
"test-18": "./setup-react-18-test.sh && cd packages/core && npm run test --",
17-
"test-source": "cd packages/source && npm run test",
18-
"test-cells": "cd packages/cells && npm run test",
19-
"test-projects": "cd test-projects/ && ./bootstrap-projects.sh"
20-
},
21-
"author": "Glide",
22-
"license": "MIT",
23-
"workspaces": [
24-
"./packages/core",
25-
"./packages/cells",
26-
"./packages/source"
27-
],
28-
"devDependencies": {
29-
"@babel/cli": "^7.16.0",
30-
"@babel/core": "^7.9.0",
31-
"@babel/plugin-proposal-class-properties": "^7.8.3",
32-
"@babel/preset-env": "^7.16.4",
33-
"@babel/preset-react": "^7.8.3",
34-
"@babel/preset-typescript": "^7.9.0",
35-
"@faker-js/faker": "^7.6.0",
36-
"@linaria/babel-preset": "^4.5.3",
37-
"@linaria/cli": "^4.5.3",
38-
"@linaria/core": "^4.5.3",
39-
"@linaria/esbuild": "^4.5.3",
40-
"@linaria/react": "^4.5.3",
41-
"@linaria/shaker": "^4.5.3",
42-
"@linaria/vite": "^4.5.3",
43-
"@linaria/webpack-loader": "^4.5.3",
44-
"@storybook/addon-actions": "^7.6.7",
45-
"@storybook/addon-controls": "^7.6.7",
46-
"@storybook/addon-links": "^7.6.7",
47-
"@storybook/addon-storysource": "^7.6.7",
48-
"@storybook/addons": "^7.6.7",
49-
"@storybook/builder-vite": "^7.6.7",
50-
"@storybook/react": "^7.6.7",
51-
"@storybook/react-vite": "^7.6.7",
52-
"@storybook/react-webpack5": "^7.6.7",
53-
"@testing-library/react": "^12.1.2",
54-
"@testing-library/react-hooks": "^8.0.1",
55-
"@testing-library/user-event": "^14.5.1",
56-
"@types/cheerio": "^0.22.30",
57-
"@types/lodash": "^4.14.177",
58-
"@types/marked": "^4.0.2",
59-
"@types/node": "^18.7.13",
60-
"@types/prosemirror-commands": "^1.0.4",
61-
"@types/prosemirror-inputrules": "^1.0.4",
62-
"@types/prosemirror-model": "^1.16.1",
63-
"@types/prosemirror-state": "^1.2.8",
64-
"@types/react": "^16.14.21 || 17.x",
65-
"@types/react-dom": "^16.9.5 || 17.x",
66-
"@types/react-syntax-highlighter": "^15.5.5",
67-
"@typescript-eslint/eslint-plugin": "^5.30.5",
68-
"@typescript-eslint/parser": "^6.4.1",
69-
"@typescript-eslint/typescript-estree": "^5.30.5",
70-
"@vitejs/plugin-react": "^4.2.0",
71-
"babel-loader": "^8.1.0",
72-
"chokidar-cli": "^3.0.0",
73-
"clean-css-cli": "^5.6.2",
74-
"concurrently": "^8.2.2",
75-
"esbuild": "^0.19.2",
76-
"eslint": "^8.19.0",
77-
"eslint-plugin-import": "^2.26.0",
78-
"eslint-plugin-react": "^7.30.1",
79-
"eslint-plugin-react-hooks": "^4.6.0",
80-
"eslint-plugin-sonarjs": "^0.13.0",
81-
"eslint-plugin-unicorn": "^43.0.1",
82-
"http-server": "^14.1.1",
83-
"jsdom": "^22.1.0",
84-
"lodash": "^4.17.21",
85-
"marked": "^4.0.10",
86-
"mini-css-extract-plugin": "^2.6.1",
87-
"prettier": "^3.0.2",
88-
"react": "^16.12.0 || 17.x",
89-
"react-dom": "^16.12.0 || 17.x",
90-
"react-laag": "^2.0.3",
91-
"react-responsive-carousel": "^3.2.7",
92-
"react-syntax-highlighter": "^15.4.5",
93-
"resolve-typescript-plugin": "^2.0.1",
94-
"storybook": "^7.6.7",
95-
"tsc-esm-fix": "^2.7.8",
96-
"typedoc": "^0.25.4",
97-
"typescript": "^5.1.6",
98-
"vitest": "^0.34.6",
99-
"vitest-canvas-mock": "^0.3.3",
100-
"webpack": "^5.73.0"
101-
}
2+
"name": "root",
3+
"version": "6.0.3",
4+
"scripts": {
5+
"start": "npm run storybook",
6+
"version": "./update-version.sh",
7+
"build": "npm run build --workspaces && npm run lint --workspaces",
8+
"typedoc": "typedoc --readme none --disableSources --tsconfig packages/core/tsconfig.json",
9+
"serve-docs": "http-server packages/core/gen-docs",
10+
"storybook:run": "storybook dev -p 9009 --no-open",
11+
"watch:core": "npm run watch -w packages/core",
12+
"storybook": "concurrently \"npm run storybook:run\" \"npm run watch:core\"",
13+
"build-storybook": "npm run build --workspaces && storybook build -o storybook-build/",
14+
"prod-storybook": "npm run build-storybook && npx http-server storybook-build -p 9009",
15+
"test": "cd packages/core && npm run test --",
16+
"test-18": "./setup-react-18-test.sh && cd packages/core && npm run test --",
17+
"test-source": "cd packages/source && npm run test",
18+
"test-cells": "cd packages/cells && npm run test",
19+
"test-projects": "cd test-projects/ && ./bootstrap-projects.sh"
20+
},
21+
"type": "commonjs",
22+
"author": "Glide",
23+
"license": "MIT",
24+
"workspaces": [
25+
"./packages/core",
26+
"./packages/cells",
27+
"./packages/source"
28+
],
29+
"devDependencies": {
30+
"@babel/cli": "^7.16.0",
31+
"@babel/core": "^7.9.0",
32+
"@babel/plugin-proposal-class-properties": "^7.8.3",
33+
"@babel/preset-env": "^7.16.4",
34+
"@babel/preset-react": "^7.8.3",
35+
"@babel/preset-typescript": "^7.9.0",
36+
"@faker-js/faker": "^7.6.0",
37+
"@linaria/babel-preset": "^4.5.3",
38+
"@linaria/cli": "^4.5.3",
39+
"@linaria/core": "^4.5.3",
40+
"@linaria/esbuild": "^4.5.3",
41+
"@linaria/react": "^4.5.3",
42+
"@linaria/shaker": "^4.5.3",
43+
"@linaria/vite": "^4.5.3",
44+
"@linaria/webpack-loader": "^4.5.3",
45+
"@storybook/addon-actions": "^7.6.12",
46+
"@storybook/addon-controls": "^7.6.12",
47+
"@storybook/addon-links": "^7.6.12",
48+
"@storybook/addon-storysource": "^7.6.12",
49+
"@storybook/addons": "^7.6.12",
50+
"@storybook/react": "^7.6.12",
51+
"@storybook/react-vite": "^7.6.12",
52+
"@storybook/react-webpack5": "^7.6.12",
53+
"@testing-library/react": "^12.1.2",
54+
"@testing-library/react-hooks": "^8.0.1",
55+
"@testing-library/user-event": "^14.5.1",
56+
"@types/cheerio": "^0.22.30",
57+
"@types/lodash": "^4.14.177",
58+
"@types/marked": "^4.0.2",
59+
"@types/node": "^18.7.13",
60+
"@types/prosemirror-commands": "^1.0.4",
61+
"@types/prosemirror-inputrules": "^1.0.4",
62+
"@types/prosemirror-model": "^1.16.1",
63+
"@types/prosemirror-state": "^1.2.8",
64+
"@types/react": "^16.14.21 || 17.x",
65+
"@types/react-dom": "^16.9.5 || 17.x",
66+
"@types/react-syntax-highlighter": "^15.5.5",
67+
"@typescript-eslint/eslint-plugin": "^5.30.5",
68+
"@typescript-eslint/parser": "^6.4.1",
69+
"@typescript-eslint/typescript-estree": "^5.30.5",
70+
"@vitejs/plugin-react": "^4.2.0",
71+
"babel-loader": "^8.1.0",
72+
"chokidar-cli": "^3.0.0",
73+
"clean-css-cli": "^5.6.2",
74+
"concurrently": "^8.2.2",
75+
"esbuild": "^0.19.2",
76+
"eslint": "^8.19.0",
77+
"eslint-plugin-import": "^2.26.0",
78+
"eslint-plugin-react": "^7.30.1",
79+
"eslint-plugin-react-hooks": "^4.6.0",
80+
"eslint-plugin-sonarjs": "^0.13.0",
81+
"eslint-plugin-unicorn": "^43.0.1",
82+
"http-server": "^14.1.1",
83+
"jsdom": "^22.1.0",
84+
"lodash": "^4.17.21",
85+
"marked": "^4.0.10",
86+
"mini-css-extract-plugin": "^2.6.1",
87+
"prettier": "^3.0.2",
88+
"react": "^16.12.0 || 17.x",
89+
"react-dom": "^16.12.0 || 17.x",
90+
"react-laag": "^2.0.3",
91+
"react-responsive-carousel": "^3.2.7",
92+
"react-syntax-highlighter": "^15.4.5",
93+
"resolve-typescript-plugin": "^2.0.1",
94+
"storybook": "^7.6.12",
95+
"tsc-esm-fix": "^2.7.8",
96+
"typedoc": "^0.25.4",
97+
"typescript": "^5.1.6",
98+
"vitest": "^0.34.6",
99+
"vitest-canvas-mock": "^0.3.3",
100+
"webpack": "^5.73.0"
101+
}
102102
}

packages/cells/.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
build.cjs
22
node_modules/
3-
dist/
3+
dist/
4+
vitest.*.ts

packages/cells/.eslintrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,10 @@
4848
"@typescript-eslint/strict-boolean-expressions": "error"
4949
}
5050
}
51-
]
51+
],
52+
"settings": {
53+
"react": {
54+
"version": "detect"
55+
}
56+
}
5257
}

packages/cells/build.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@ shopt -s globstar
99
## Delete the dist folder
1010
rm -rf dist
1111

12+
echo -e "\033[0;36m🏗️ Building Glide Data Grid Cells 🏗️\033[0m"
13+
1214
compile_esm() {
1315
tsc -p tsconfig.esm.json
14-
linaria -r dist/esm/ -m esnext -o dist/esm/ dist/esm/**/*.js -t -i dist/esm -c ../../config/linaria.json
16+
linaria -r dist/esm/ -m esnext -o dist/esm/ dist/esm/**/*.js -t -i dist/esm -c ../../config/linaria.json > /dev/null
1517
remove_all_css_imports dist/esm
1618
}
1719

1820
compile_cjs() {
1921
tsc -p tsconfig.cjs.json
20-
linaria -r dist/cjs/ -m commonjs -o dist/cjs/ dist/cjs/**/*.js -t -i dist/cjs -c ../../config/linaria.json
22+
linaria -r dist/cjs/ -m commonjs -o dist/cjs/ dist/cjs/**/*.js -t -i dist/cjs -c ../../config/linaria.json > /dev/null
2123
remove_all_css_imports dist/cjs
2224
}
2325

2426
run_in_parallel compile_esm compile_cjs
2527

26-
generate_index_css
28+
generate_index_css
29+
30+
echo -e "\033[0;36m🎉 Cells Build Complete 🎉\033[0m"

packages/cells/vitest.config.js renamed to packages/cells/vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default defineConfig({
66
test: {
77
include: ["test/**/*.test.tsx", "test/**/*.test.ts"],
88
environment: "jsdom",
9-
setupFiles: "vitest.setup.js",
9+
setupFiles: "vitest.setup.ts",
1010
threads: false,
1111
singleThread: true,
1212
watch: false,

0 commit comments

Comments
 (0)