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

fix build #300

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions .github/DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ To understand the principles that drive the design and development of Moai, see

Moai is a [monorepo](https://classic.yarnpkg.com/en/docs/workspaces/) powered by Yarn. There are several projects:

| Path | Project | Framework |
| ------- | ----------------- | ----------- |
| core | [@moai/core] | [Rollup] |
| gallery | [@moai/gallery] | [Rollup] |
| docs | [moai.thien.do] | [Storybook] |
| test | Test suits | [Jest] |
| Path | Project | Framework |
| ------- | --------------- | ----------- |
| core | [@moai/core] | [Rollup] |
| gallery | [@moai/gallery] | [Rollup] |
| docs | [moai.thien.do] | [Storybook] |
| test | Test suits | [Jest] |

The "test" and "docs" projects depend on "core" and "gallery" via symlinks. This means to run tests or start the docs site locally, you will need to build "core" and "gallery" first. Also, the "gallery" depends on the "core" project:

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Enable Corepack before setting up Node
+ run: corepack enable
- uses: actions/setup-node@v2
with:
node-version: 15.x
cache: "yarn"
node-version: 18.x
- run: yarn install
- run: yarn lint
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/node_modules
.DS_Store
.idea
.vercel
.yarn/unplugged
.pnp.cjs
.pnp.loader.mjs
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"files.insertFinalNewline": true
}
Binary file added .yarn/install-state.gz
Binary file not shown.
894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.3.1.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarnPath: .yarn/releases/yarn-4.3.1.cjs
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
**Heads up!** This project is no longer in active development. It will be [archived](https://docs.github.com/en/repositories/archiving-a-github-repository/archiving-repositories) soon. Some suggestions:

- Build your own UI kit with a good foundation like [Radix](https://www.radix-ui.com/) or [Headless UI](https://headlessui.com/). This is what I'm actually doing these days myself.
- Fork this project. You have my sword, and bow, and axe, and only 22 unresolved bugs.
- Refactor Moai to utilise Radix (which is what I wanted to do, if I don't need to pay the bills)

- Build your own UI kit with a good foundation like [Radix](https://www.radix-ui.com/) or [Headless UI](https://headlessui.com/). This is what I'm actually doing these days myself.
- Fork this project. You have my sword, and bow, and axe, and only 22 unresolved bugs.
- Refactor Moai to utilise Radix (which is what I wanted to do, if I don't need to pay the bills)

<hr />

Expand All @@ -17,7 +16,7 @@ A React Component Library, Where Buttons Look Like Buttons.
- NPM: [@moai/core](http://npmjs.com/package/@moai/core)
- License: [MIT](./LICENSE)

### Contributing
## Contributing

- [Contributing Overview](./.github/CONTRIBUTING.md): Report bugs, request features, write code and improve documentation.
- [Design Principles](https://moai.thien.do/?path=/docs/intro-principles--page): The unique traits that lead Moai's design and development.
Expand Down
39 changes: 19 additions & 20 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,27 @@
"react-dom": ">=16"
},
"dependencies": {
"@popperjs/core": "^2.9.2",
"@tippyjs/react": "^4.2.5",
"react-day-picker": "^7.4.10",
"react-hot-toast": "^1.0.2",
"react-icons": "^4.2.0",
"react-popper": "^2.2.5"
"@popperjs/core": "^2.11.8",
"@tippyjs/react": "^4.2.6",
"react-hot-toast": "^2.4.1",
"react-icons": "^5.2.1",
"react-popper": "^2.3.0"
},
"devDependencies": {
"@types/react": "^17.0.15",
"@types/react-dom": "^17.0.9",
"autoprefixer": "^10.3.1",
"modern-normalize": "^1.1.0",
"postcss": "^8.3.6",
"postcss-import": "^14.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rollup": "^2.55.1",
"rollup-plugin-copy": "^3.4.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"modern-normalize": "^2.0.0",
"postcss": "^8.4.38",
"postcss-import": "^16.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rollup": "^4.18.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-typescript2": "^0.30.0",
"tslib": "^2.3.0",
"typescript": "^4.3.4"
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-typescript2": "^0.36.0",
"tslib": "^2.6.3",
"typescript": "^5.5.2"
}
}
1 change: 0 additions & 1 deletion core/rollup.config.js → core/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const bundleMain = {
external: [
"@tippyjs/react/headless",
"focus-visible",
"react-day-picker/DayPickerInput",
"react-dom",
"react-hot-toast",
"react-icons/go",
Expand Down
2 changes: 1 addition & 1 deletion core/src/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ const validateButton = (props: ButtonProps): void => {
// since it's missing the ref. See Button for the exported component.
const buttonRender = (
props: ButtonProps,
ref: React.ForwardedRef<ButtonElement>
ref: React.ForwardedRef<ButtonElement>,
): JSX.Element => {
validateButton(props);
const common = {
Expand Down
4 changes: 3 additions & 1 deletion core/src/button/color/failure.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
:global(.dark) .outset {
color: var(--white);
background-color: var(--failure-5);
box-shadow: var(--shadow), var(--inset-shadow) var(--failure-4);
box-shadow:
var(--shadow),
var(--inset-shadow) var(--failure-4);
font-weight: 500;
}

Expand Down
4 changes: 3 additions & 1 deletion core/src/button/color/highlight.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
:global(.dark) .outset {
color: var(--white);
background-color: var(--highlight-5);
box-shadow: var(--shadow), var(--inset-shadow) var(--highlight-4);
box-shadow:
var(--shadow),
var(--inset-shadow) var(--highlight-4);
font-weight: 500;
}

Expand Down
8 changes: 6 additions & 2 deletions core/src/button/color/none.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
:global(.light) .outset {
--shadow: var(--shadow-size) rgba(0, 0, 0, 0.1);
background-color: var(--gray-0);
box-shadow: var(--shadow), var(--inset-shadow) var(--white);
box-shadow:
var(--shadow),
var(--inset-shadow) var(--white);
border-color: var(--gray-2);
}
:global(.light) .outset:hover {
Expand All @@ -39,7 +41,9 @@
:global(.dark) .outset {
--shadow: var(--shadow-size) rgba(0, 0, 0, 0.5);
background-color: var(--gray-6);
box-shadow: var(--shadow), var(--inset-shadow) var(--gray-5);
box-shadow:
var(--shadow),
var(--inset-shadow) var(--gray-5);
border-color: var(--black);
}
:global(.dark) .outset:hover {
Expand Down
4 changes: 3 additions & 1 deletion core/src/button/style/flat.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.main {
transition: background-color 0.1s, outline 0.2s ease-out;
transition:
background-color 0.1s,
outline 0.2s ease-out;
border-radius: 0;
/* To have same layout with outset buttons */
border: solid 1px transparent;
Expand Down
5 changes: 4 additions & 1 deletion core/src/button/style/outset.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.main {
transition: background-color 0.1s, box-shadow 0.1s, outline 0.2s ease-out;
transition:
background-color 0.1s,
box-shadow 0.1s,
outline 0.2s ease-out;
border: solid 1px transparent;
--shadow-size: 0px 0.5px 2px;
--inset-shadow: inset 0px 1px 0px;
Expand Down
2 changes: 1 addition & 1 deletion core/src/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const Checkbox = (props: CheckboxProps): JSX.Element => {
/>
<span
className={[shared.icon, style.icon, self.indeterminate].join(
" "
" ",
)}
children={<Icon display="block" component={coreIcons.dash} />}
/>
Expand Down
17 changes: 13 additions & 4 deletions core/src/checkbox/outset.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.input {
transition: background-color 0.1s, box-shadow 0.1s, outline 0.2s ease-out;
transition:
background-color 0.1s,
box-shadow 0.1s,
outline 0.2s ease-out;
border: solid 1px transparent;
--shadow-size: 0px 0.5px 2px;
--inset-shadow: inset 0px 1px 0px;
Expand All @@ -10,7 +13,9 @@
:global(.light) .input {
--shadow: var(--shadow-size) rgba(0, 0, 0, 0.1);
background-color: var(--gray-0);
box-shadow: var(--shadow), var(--inset-shadow) var(--white);
box-shadow:
var(--shadow),
var(--inset-shadow) var(--white);
border-color: var(--gray-2);
}
:global(.light) .input:hover {
Expand All @@ -24,7 +29,9 @@
:global(.dark) .input {
--shadow: var(--shadow-size) rgba(0, 0, 0, 0.3);
background-color: var(--gray-6);
box-shadow: var(--shadow), var(--inset-shadow) var(--gray-5);
box-shadow:
var(--shadow),
var(--inset-shadow) var(--gray-5);
border-color: var(--black);
}
:global(.dark) .input:hover {
Expand All @@ -42,7 +49,9 @@
:global(.dark) .input:checked,
:global(.dark) .input[type="checkbox"]:indeterminate {
background-color: var(--highlight-5);
box-shadow: var(--shadow), var(--inset-shadow) var(--highlight-4);
box-shadow:
var(--shadow),
var(--inset-shadow) var(--highlight-4);
}

:global(.light) .input:checked,
Expand Down
Loading