Skip to content

Commit

Permalink
v3 update (#25)
Browse files Browse the repository at this point in the history
* v3 update

* use external mobrix-ui-types lib for types

* playground fix

* migrate to mobrix-ui-tools for component creation

* remove old utils file

* switch to mobrix-ui-tools lib

* style updates & clean-up & form component updated

* deps updated

* doc fix

* test-app for local testing setup & fix

* updates

* types and tools for testing

* pipeline clean up

* import path fix

* fix

* styles fix

* table and calendar fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* test fix

* updates for v3

* better css management

* better styles management

* CI clean up

* atoms theme totally driven from CSS variables

* some molecules driven with css variables

* test fix

* more css variables

* every component theme driven by css vars

* improvements & clean-up

* improvements

* css fix

* css fix 2

* css fix 3

* disabled status integrated

* global css cleanup

* another clean-up

* automatic css doc generator

* improvements & more css docs

* updates

* automatic docs gen improved

* docs-gen updates

* fix

* fix

* fix

* updates

* script fix

* props and css vars docs unified

* clean-up

* clean-up & restyle

* updates

* updates

* more docs

* all atoms base docs completed

* fix

* better automated prop generator

* prop groups updated

* updates

* updates

* updates

* automatic comment generator

* comments generator improved

* updates

* unit tests updated

* new docs and comments

* more docs

* Readme updated

* sync actual docs with online docs

* docs updated

* using mkdocs for docs site

* clean up
  • Loading branch information
CianciarusoCataldo committed Feb 4, 2024
1 parent 4c8bdab commit cf3a8f2
Show file tree
Hide file tree
Showing 659 changed files with 417,367 additions and 40,171 deletions.
26 changes: 0 additions & 26 deletions .circleci/config.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .cirrus.yml

This file was deleted.

32 changes: 6 additions & 26 deletions .github/workflows/mobrix-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,32 @@ on:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [15.x, 16.x]

node-version: [16.x, 17.x, 18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm i
- run: npm run build

unit-tests:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [15.x, 16.x]

node-version: [16.x, 17.x, 18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm i
- run: npm run build
- run: npm test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
- name: Upload coverage to Code Climate
uses: paambaati/codeclimate-action@v3.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- name: Upload coverage to coveralls.io
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ github.token }}
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_API_TOKEN }}
- run: npm run test --verbose
- run: echo "Tests step completed"
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
node_modules
dist
playground/src/mobrix-ui-preview
test-app/src/mobrix-ui-preview
build
coverage
stats.html
stats.html
.vscode
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.14.0
v18.17.0
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Versions

- [3.0.0](#300)
- [2.1.0](#210)
- [2.0.0](#200)
- [1.2.0](#120)
Expand All @@ -16,6 +17,15 @@

<br>

### 3.0.0

- No more external dependencies
- Totally re-designed css variables system, to fully customize every component at once
- Docs and comments generator
- Global refactoring and hige clean-up

<br>

### 2.1.0

- `TabViewer` component
Expand Down
138 changes: 73 additions & 65 deletions README.md

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions config/rollup.analyze.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import typescript from "rollup-plugin-typescript2";
import postcss from "rollup-plugin-postcss";
import { visualizer } from 'rollup-plugin-visualizer';
import analyze from "rollup-plugin-analyzer";
const typescript = require("rollup-plugin-typescript2");
const postcss = require("rollup-plugin-postcss");
const { visualizer } = require("rollup-plugin-visualizer");
const analyze = require("rollup-plugin-analyzer");

import pkg from "../package.json";
const postcssImport = require("postcss-import");

export default [
const pkg = require("../package.json");

module.exports = [
{
input: "src/index.ts",
output: [],
plugins: [
postcss({
plugins: [],
plugins: [postcssImport],
minimize: true,
}),
typescript(),
analyze(),
visualizer(),
],
external: Object.keys(pkg.peerDependencies || {}),
external: Object.keys(pkg.peerDependencies || []),
},
];
28 changes: 20 additions & 8 deletions config/rollup.build.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import typescript from "rollup-plugin-typescript2";
import del from "rollup-plugin-delete";
import postcss from "rollup-plugin-postcss";
import { terser } from "rollup-plugin-terser";
const typescript = require("rollup-plugin-typescript2");
const del = require("rollup-plugin-delete");
const postcss = require("rollup-plugin-postcss");
const terser = require("@rollup/plugin-terser");
const postcssImport = require("postcss-import");

import pkg from "../package.json";
const pkg = require("../package.json");

export default [
module.exports = [
{
input: "src/index.ts",
output: [
Expand All @@ -20,6 +21,17 @@ export default [
format: "esm",
banner: "/* eslint-disable */ import './styles.css';",
},
{
file: "test-app/src/mobrix-ui-preview/index.cjs",
format: "cjs",
banner: "require('./styles.css')",
plugins: [terser()],
},
{
file: "test-app/src/mobrix-ui-preview/index.mjs",
format: "esm",
banner: "/* eslint-disable */ import './styles.css';",
},
{
file: pkg.main,
format: "cjs",
Expand All @@ -35,7 +47,7 @@ export default [
plugins: [
del({ targets: ["dist/*", "playground/src/mobrix-ui-preview"] }),
postcss({
plugins: [],
plugins: [postcssImport],
minimize: true,
extract: "styles.css",
}),
Expand All @@ -44,6 +56,6 @@ export default [
clean: true,
}),
],
external: Object.keys(pkg.peerDependencies || {}),
external: Object.keys(pkg.peerDependencies || []),
},
];
28 changes: 20 additions & 8 deletions config/rollup.dev.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import typescript from "rollup-plugin-typescript2";
import postcss from "rollup-plugin-postcss";
import { terser } from "rollup-plugin-terser";
const typescript = require("rollup-plugin-typescript2");
const postcss = require("rollup-plugin-postcss");
const terser = require("@rollup/plugin-terser");
const postcssImport = require("postcss-import");

import pkg from "../package.json";
const pkg = require("../package.json");

export default [
module.exports = [
{
input: "src/index.ts",
output: [
Expand All @@ -19,6 +20,17 @@ export default [
format: "esm",
banner: "/* eslint-disable */ import './styles.css';",
},
{
file: "test-app/src/mobrix-ui-preview/index.cjs",
format: "cjs",
banner: "require('./styles.css')",
plugins: [terser()],
},
{
file: "test-app/src/mobrix-ui-preview/index.mjs",
format: "esm",
banner: "/* eslint-disable */ import './styles.css';",
},
{
file: pkg.main,
format: "cjs",
Expand All @@ -33,15 +45,15 @@ export default [
],
plugins: [
postcss({
plugins: [],
minimize: true,
plugins: [postcssImport],
minimize: false,
extract: "styles.css",
}),
typescript({
rollupCommonJSResolveHack: false,
clean: true,
}),
],
external: Object.keys(pkg.peerDependencies || {}),
external: Object.keys(pkg.peerDependencies || []),
},
];
54 changes: 54 additions & 0 deletions docs-gen/components/atoms/Button/css-vars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"--mbx-button-background": {
"description": "Fallback value for `mbx-button-background-light` and `mbx-button-background-dark`"
},
"--mbx-button-background-light": {
"description": "Button background when dark mode is off",
"defaultGlobal": "--mbx-background-light",
"fallback": "--mbx-button-background"
},
"--mbx-button-background-dark": {
"description": "Button background when dark mode is on",
"defaultGlobal": "--mbx-background-dark",
"fallback": "--mbx-button-background"
},
"--mbx-button-text-color": {
"description": "Fallback value for `mbx-button-text-color-light` and `mbx-button-text-color-dark`"
},
"--mbx-button-text-color-light": {
"description": "Button text color when dark mode is off",
"defaultGlobal": "--mbx-text-color-light",
"fallback": "--mbx-button-text-color"
},
"--mbx-button-text-color-dark": {
"description": "Button text color when dark mode is on",
"defaultGlobal": "--mbx-text-color-dark",
"fallback": "--mbx-button-text-color"
},
"--mbx-button-background-hover": {
"description": "Fallback value for `mbx-button-background-hover-light` and `mbx-button-background-hover-dark`"
},
"--mbx-button-background-hover-light": {
"description": "Button background when dark mode is off, on hover",
"defaultGlobal": "--mbx-background-hover-light",
"fallback": "--mbx-button-background-hover"
},
"--mbx-button-background-hover-dark": {
"description": "Button background when dark mode is on, on hover",
"defaultGlobal": "--mbx-background-hover-dark",
"fallback": "--mbx-button-background-hover"
},
"--mbx-button-text-color-hover": {
"description": "Fallback value for `mbx-button-text-color-hover-light` and `mbx-button-text-color-hover-dark`"
},
"--mbx-button-text-color-hover-light": {
"description": "Button text color when dark mode is off, on hover",
"defaultGlobal": "--mbx-text-color-hover-light",
"fallback": "--mbx-button-text-color-hover"
},
"--mbx-button-text-color-hover-dark": {
"description": "Button text color when dark mode is on, on hover",
"defaultGlobal": "--mbx-text-color-hover-dark",
"fallback": "--mbx-button-text-color-hover"
}
}
16 changes: 16 additions & 0 deletions docs-gen/components/atoms/Button/mbx-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"since": "1.0.0",
"description": "A button component, designed for a lot of scenarios.",
"see": [
"https://cianciarusocataldo.github.io/mobrix-ui/components/atoms/Button"
],
"examples": [],
"extend": {
"group": {
"ComponentWithChildren": {
"type": "JSX.Element | string"
},
"ClickableComponent": {}
}
}
}
20 changes: 20 additions & 0 deletions docs-gen/components/atoms/Button/props.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"onMouseEnter": {
"type": "() => void",
"description": "This callback is triggered everytime the cursor enter the button area"
},
"onMouseLeave": {
"type": "() => void",
"description": "This callback is triggered everytime the cursor exit the button area"
},
"onClick": {
"type": "() => void",
"default": "() => {}",
"description": "Callback triggered when Button component is clicked"
},
"children": {
"type": "JSX.Element | string",
"default": "",
"description": "Button content"
}
}
Loading

0 comments on commit cf3a8f2

Please sign in to comment.