Skip to content

Commit e33da67

Browse files
⚡ migration to tsdx + goober
1 parent ceef923 commit e33da67

29 files changed

+4651
-7644
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
on: [push]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
7+
steps:
8+
- name: Begin CI...
9+
uses: actions/checkout@v2
10+
11+
- name: Use Node 12
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: 12.x
15+
16+
- name: Use cached node_modules
17+
uses: actions/cache@v1
18+
with:
19+
path: node_modules
20+
key: nodeModules-${{ hashFiles('**/yarn.lock') }}
21+
restore-keys: |
22+
nodeModules-
23+
24+
- name: Install dependencies
25+
run: yarn install --frozen-lockfile
26+
env:
27+
CI: true
28+
29+
- name: Build
30+
run: yarn build
31+
env:
32+
CI: true
33+
34+
- name: Publish
35+
if: startsWith(github.ref, 'refs/tags/')
36+
run: echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > ~/.npmrc && npm publish --access public
37+
env:
38+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.github/workflows/nodejs.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
1-
2-
# See https://help.github.com/ignore-files/ for more about ignoring files.
3-
4-
# dependencies
1+
*.log
2+
.DS_Store
53
node_modules
6-
7-
# builds
8-
build
9-
storybook-static
4+
.cache
105
dist
11-
.rpt2_cache
12-
13-
# misc
14-
.DS_Store
15-
.env
16-
.env.local
17-
.env.development.local
18-
.env.test.local
19-
.env.production.local
20-
21-
npm-debug.log*
22-
yarn-debug.log*
23-
yarn-error.log*
6+
storybook-static

.storybook/addons.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

.storybook/config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

.storybook/config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import "!style-loader!css-loader!./style.css";
2+
import { configure } from "@storybook/react";
3+
4+
// automatically import all files ending in *.stories.js
5+
configure(require.context("../stories", true, /\.stories\.(js|ts)x?$/), module);

.storybook/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
addons: [
3+
"@storybook/addon-actions/register",
4+
"@storybook/addon-links/register",
5+
"@storybook/addon-knobs/register",
6+
"@storybook/addon-storysource"
7+
]
8+
};

src/stories/style.css renamed to .storybook/style.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
* {
2+
box-sizing: border-box;
3+
}
4+
15
html,
2-
body {
6+
body,
7+
#root {
8+
height: 100%;
39
font-family: sans-serif;
410
}
511

.storybook/webpack.config.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1+
const path = require("path");
2+
13
module.exports = ({ config }) => {
24
config.module.rules.push({
3-
test: /\.(ts|tsx)$/,
5+
test: /\.tsx?$/,
46
use: [
57
{
6-
loader: require.resolve("awesome-typescript-loader")
7-
}
8-
]
8+
loader: require.resolve("ts-loader"),
9+
options: {
10+
reportFiles: ["stories/**/*.{ts|tsx}"],
11+
},
12+
},
13+
],
914
});
1015
config.resolve.extensions.push(".ts", ".tsx");
16+
config.resolve.alias = Object.assign(config.resolve.alias, {
17+
"@": path.resolve(__dirname, ".."),
18+
});
1119
return config;
1220
};

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# react-multi-select-component
22

3-
Simple multiple selection dropdown component with `checkboxes`, `search` and `select-all`
3+
Simple and lightweight multiple selection dropdown component with `checkboxes`, `search` and `select-all`
44

55
[![Storybook](https://cdn.jsdelivr.net/gh/storybookjs/brand@master/badge/badge-storybook.svg)](https://react-multi-select-component.netlify.com)
66
[![GitHub Actions Status](https://github.com/harshzalavadiya/react-multi-select-component/workflows/NodeJS/badge.svg)](https://github.com/harshzalavadiya/react-multi-select-component/actions)
@@ -9,7 +9,7 @@ Simple multiple selection dropdown component with `checkboxes`, `search` and `se
99

1010
## ✨ Features
1111

12-
- 🍃 Lightweight (~14KB)
12+
- 🍃 Lightweight (~4.5KB)
1313
- 💅 Themeable
1414
- ✌ Written w/ TypeScript
1515

@@ -32,7 +32,7 @@ const Example: React.FC = () => {
3232
const options = [
3333
{ label: "Grapes 🍇", value: "grapes" },
3434
{ label: "Mango 🥭", value: "mango" },
35-
{ label: "Strawberry 🍓", value: "strawberry" }
35+
{ label: "Strawberry 🍓", value: "strawberry" },
3636
];
3737

3838
const [selected, setSelected] = useState([]);
@@ -71,7 +71,6 @@ export default App;
7171
| `selectAllLabel` | _select all_ label | `string` | |
7272
| `disableSearch` | hide search textbox | `boolean` | `false` |
7373
| `filterOptions` | custom filter options | `function` | |
74-
| `theme` | theme variables | `object` | |
7574

7675
## 🌐 Internationalization
7776

@@ -88,26 +87,26 @@ You can override the strings to be whatever you want, including translations for
8887

8988
## 💅 Themeing
9089

91-
You can override theme variables to change colors
92-
93-
```json
94-
{
95-
"primary": "#4285F4",
96-
"hover": "#f1f3f5",
97-
"border": "#ccc",
98-
"gray": "#aaa",
99-
"background": "#fff",
100-
"borderRadius": "4px",
101-
"height": "38px"
90+
You can override css variables to customize appearance
91+
92+
```css
93+
.multi-select {
94+
--rmsc-primary: #4285f4;
95+
--rmsc-hover: #f1f3f5;
96+
--rmsc-border: #ccc;
97+
--rmsc-gray: #aaa;
98+
--rmsc-background: #fff;
99+
--rmsc-border-radius: 4px;
100+
--rmsc-height: 38px;
102101
}
103102
```
104103

105104
## 🤠 Credits
106105

107106
- This project gets inspiration and several pieces of logical code from [react-multiple-select](https://github.com/Khan/react-multi-select/)
108107
- [TypeScript](https://github.com/microsoft/typescript)
109-
- [Rollup](https://github.com/rollup/rollup)
110-
- [Emotion](https://github.com/emotion-js/emotion)
108+
- [TSDX](https://github.com/jaredpalmer/tsdx)
109+
- [Goober](https://github.com/cristianbote/goober)
111110

112111
## 📜 License
113112

0 commit comments

Comments
 (0)