Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table Component: Part 1 #1100

Merged
merged 40 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7810ce0
Add Table component; WIP
johnnadeluy May 14, 2024
c94b6a5
Styling adjustments
johnnadeluy May 14, 2024
fb23cc8
.
johnnadeluy May 14, 2024
af99c0d
Fix storybook example width and documentation
johnnadeluy May 15, 2024
1654fec
Update examples and styling; indentation, text-alignment etc
johnnadeluy May 15, 2024
e537037
Add support for react typescript
johnnadeluy May 21, 2024
a4ad1fb
Add basic table components and update examples accordingly
johnnadeluy May 27, 2024
259907f
Add statistics table styling for text-alignment
johnnadeluy May 27, 2024
1a28ccd
Update Table component examples
johnnadeluy May 27, 2024
aab08e8
Add prop types for Table components and minor adjustments
johnnadeluy May 28, 2024
dbd46e2
Move all the Table related components to Table component instead
johnnadeluy May 28, 2024
fa4b8cb
Add dataNoteRefs props and make adjustments to Table
johnnadeluy May 28, 2024
ae48a29
Remove unused prop for story example for Table
johnnadeluy May 28, 2024
5ed0aa8
Fix typography (font-family, line-height, sup)
johnnadeluy Jun 4, 2024
d73fbad
Update Table component documentation
johnnadeluy Jun 5, 2024
0c76f4c
Remove and comment out scroll functionality and add forwardRef
johnnadeluy Jun 5, 2024
f5b6473
Merge branch 'master' of https://github.com/statisticsnorway/ssb-comp…
johnnadeluy Jun 6, 2024
8151bb9
Include .tsx files in rollup.config.js
johnnadeluy Jun 6, 2024
260effb
Include .ts files in the rollup.config,js fuke
johnnadeluy Jun 6, 2024
7fcdb1c
Install @rollup/plugin-typescript for rollup
johnnadeluy Jun 6, 2024
7561080
Remove duplicate code in Table story example
johnnadeluy Jun 6, 2024
8be5b66
Add a snapshot match test for Table
johnnadeluy Jun 6, 2024
2502002
Include ts and tsx in moduleFileExtensions for jest
johnnadeluy Jun 6, 2024
241c531
Refactoring: use variables in scss, rem, indentationLevel, typing
johnnadeluy Jun 6, 2024
903e52d
Include @rollup/plugin-typescript for typescript support
johnnadeluy Jun 6, 2024
a094479
Fix eslint linting for typescript and include .ts and .tsx files in b…
johnnadeluy Jun 6, 2024
8990039
Add bare bones tsconfig file
johnnadeluy Jun 6, 2024
6c3e70c
Fix table component css linting
johnnadeluy Jun 6, 2024
7378acb
Override micromatch version to 4.0.6 to resolve high vulnerability se…
johnnadeluy Jun 6, 2024
f1c3c38
Update tsconfig.json
johnnadeluy Jun 6, 2024
6ee90d5
Setup husky
johnnadeluy Jun 6, 2024
c5b0b39
Minor code refactoring
johnnadeluy Jun 7, 2024
5743f04
Add typescript and tsx to prismjs languages in babelrc
johnnadeluy Jun 7, 2024
036d478
Minor code refactoring; remove commented code from tsconfig
johnnadeluy Jun 7, 2024
ae2aa26
Required prop children; do not render table components if children is…
johnnadeluy Jun 10, 2024
dac7f10
Update documentation for Table and fix indentation styling
johnnadeluy Jun 11, 2024
4da10f5
Minor code refactoring
johnnadeluy Jun 11, 2024
52b5112
Export interfaces and fix max-width for tfoot (a bit hacky)
johnnadeluy Jun 11, 2024
fb50073
Only allow indentation for left aligned table cell content
johnnadeluy Jun 12, 2024
439e330
Merge branch 'master' of https://github.com/statisticsnorway/ssb-comp…
johnnadeluy Jun 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
["@babel/preset-env", {
"modules": false
}],
"@babel/preset-react"
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": [
["module-resolver",
{
"extensions": [
".js",
".jsx"
".jsx",
".ts",
".tsx"
],
"root": [
"./src"
]
}
],
["prismjs", {
"languages": ["javascript", "html", "css", "jsx"],
"languages": ["javascript", "html", "css", "jsx", "typescript", "tsx"],
"plugins": ["line-numbers"],
"theme": "coy",
"css": true
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/coverage
/build
**/*.test.jsx
**/*.test.tsx
33 changes: 29 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
{
"extends": "airbnb",
"extends": [
"airbnb",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors"
],
"plugins": [
annesiri marked this conversation as resolved.
Show resolved Hide resolved
"@typescript-eslint",
"import"
],
"env": {
"browser": true,
"es6": true,
"jest": true
},
"parser": "@babel/eslint-parser",
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
"rules": {
"arrow-parens": ["error", "as-needed"],
"func-names": ["error", "never"],
Expand All @@ -28,6 +43,7 @@
"react/jsx-indent": [1, "tab"],
"react/jsx-indent-props": [1, "tab"],
"react/jsx-one-expression-per-line": 0,
"react/jsx-filename-extension": [1, { "extensions": [".jsx", ".tsx"] }],
"react/require-default-props": 0,
"react/sort-comp": [1, {
"order": [
Expand All @@ -37,15 +53,24 @@
"everything-else"
]}
],

"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/no-static-element-interactions": 1,
"jsx-a11y/label-has-associated-control": ["error", {
"required": {
"some": ["nesting", "id"]
}
}],
"no-use-before-define": ["error", { "functions": false, "classes": true }]
"no-use-before-define": ["error", { "functions": false, "classes": true }],
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
]
},
"globals": {
"document": false,
Expand Down
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npm run lint
npm run test
4 changes: 2 additions & 2 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');

module.exports = {
stories: ['../**/*.story.jsx'],
stories: ['../**/*.story.@(jsx|tsx)'],

addons: [
'@storybook/addon-links',
Expand Down Expand Up @@ -35,7 +35,7 @@ module.exports = {
},

resolve: {
extensions: ['.jsx', '.js'],
extensions: ['.jsx', '.js', '.tsx', '.ts'],
},

features: {
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
'src/components',
'src/style',
],
moduleFileExtensions: ['js', 'jsx'],
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/fileMock.js',
'\\.(css|scss)$': '<rootDir>/src/main.scss',
Expand Down
Loading