@nearform/quantum 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.commitlintrc +5 -0
- package/.editorconfig +6 -0
- package/.eslintrc +11 -0
- package/.github/ISSUE_TEMPLATE/component-issue-template.md +13 -0
- package/.github/ISSUE_TEMPLATE/tailwind-config-customisation-issue.md +11 -0
- package/.github/dependabot.yml +10 -0
- package/.github/workflows/check-linked-issues.yml +20 -0
- package/.github/workflows/ci.yml +31 -0
- package/.github/workflows/deploy-github-pages.yml +44 -0
- package/.github/workflows/notify-release.yml +19 -0
- package/.github/workflows/release.yml +29 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.nvmrc +1 -0
- package/.prettierrc +6 -0
- package/.storybook/main.ts +34 -0
- package/.storybook/manager.ts +6 -0
- package/.storybook/preview.ts +21 -0
- package/.storybook/theme.ts +6 -0
- package/.svg-to-tsrc +18 -0
- package/README.md +32 -0
- package/dist/global.css +678 -0
- package/dist/global.css.map +1 -0
- package/dist/index.d.ts +137 -0
- package/dist/index.js +3537 -0
- package/dist/index.js.map +1 -0
- package/index.js +0 -0
- package/package.json +68 -0
- package/postcss.config.js +3 -0
- package/src/assets/build/check.icon.tsx +16 -0
- package/src/assets/build/minus.icon.tsx +14 -0
- package/src/assets/build/radioselected.icon.tsx +7 -0
- package/src/assets/index.ts +3 -0
- package/src/assets/svg-icons/check.svg +5 -0
- package/src/assets/svg-icons/minus.svg +5 -0
- package/src/assets/svg-icons/radio-selected.svg +5 -0
- package/src/colors.ts +164 -0
- package/src/components/Button/index.tsx +72 -0
- package/src/components/Checkbox/index.tsx +32 -0
- package/src/components/Label/index.tsx +26 -0
- package/src/components/Radio/RadioGroup.tsx +20 -0
- package/src/components/Radio/RadioGroupItem.tsx +26 -0
- package/src/components/Radio/index.tsx +2 -0
- package/src/global.css +4 -0
- package/src/index.ts +2 -0
- package/src/lib/utils.ts +6 -0
- package/stories/Button/Button.stories.tsx +74 -0
- package/stories/Checkbox/CheckBox.example.tsx +16 -0
- package/stories/Checkbox/Checkbox.stories.ts +42 -0
- package/stories/Colors.mdx +49 -0
- package/stories/Label/Label.example.tsx +20 -0
- package/stories/Label/Label.stories.ts +27 -0
- package/stories/Radio/Radio.example.tsx +39 -0
- package/stories/Radio/Radio.stories.ts +32 -0
- package/stories/global.css +6 -0
- package/stories/tailwind.config.js +5 -0
- package/tailwind.config.js +47 -0
- package/tsconfig.json +14 -0
- package/tsup.config.ts +8 -0
package/.commitlintrc
ADDED
package/.editorconfig
ADDED
package/.eslintrc
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Component Issue Template
|
|
3
|
+
about: Issue template for creating a new component for the library
|
|
4
|
+
title: "[Component] - Name"
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
- [ ] Create component
|
|
11
|
+
- [ ] Create Storybook demo
|
|
12
|
+
- [ ] Write Storybook docs
|
|
13
|
+
- [ ] Implement dark mode
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Check linked issues
|
|
2
|
+
'on':
|
|
3
|
+
pull_request_target:
|
|
4
|
+
types:
|
|
5
|
+
- opened
|
|
6
|
+
- edited
|
|
7
|
+
- reopened
|
|
8
|
+
- synchronize
|
|
9
|
+
jobs:
|
|
10
|
+
check_pull_requests:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
name: Check linked issues
|
|
13
|
+
permissions:
|
|
14
|
+
issues: read
|
|
15
|
+
pull-requests: write
|
|
16
|
+
steps:
|
|
17
|
+
- uses: nearform-actions/github-action-check-linked-issues@v1
|
|
18
|
+
id: check-linked-issues
|
|
19
|
+
with:
|
|
20
|
+
exclude-branches: release/**, dependabot/**
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Continuous Integration
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Lint and test
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version-file: '.nvmrc'
|
|
18
|
+
- run: |
|
|
19
|
+
npm ci
|
|
20
|
+
npm run lint
|
|
21
|
+
npm test
|
|
22
|
+
|
|
23
|
+
automerge:
|
|
24
|
+
name: Merge dependabot's PRs
|
|
25
|
+
needs: test
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
permissions:
|
|
28
|
+
pull-requests: write
|
|
29
|
+
contents: write
|
|
30
|
+
steps:
|
|
31
|
+
- uses: fastify/github-action-merge-dependabot@v3
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Simple workflow for deploying static content to GitHub Pages
|
|
2
|
+
name: Deploy to GitHub Pages
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
# Runs on pushes targeting the default branch
|
|
6
|
+
push:
|
|
7
|
+
branches: ["main"]
|
|
8
|
+
|
|
9
|
+
# Allows you to run this workflow manually from the Actions tab
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
pages: write
|
|
16
|
+
id-token: write
|
|
17
|
+
|
|
18
|
+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
|
19
|
+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
|
20
|
+
concurrency:
|
|
21
|
+
group: "pages"
|
|
22
|
+
cancel-in-progress: false
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
# Single deploy job since we're just deploying
|
|
26
|
+
deploy:
|
|
27
|
+
environment:
|
|
28
|
+
name: github-pages
|
|
29
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
steps:
|
|
32
|
+
- name: Checkout
|
|
33
|
+
uses: actions/checkout@v4
|
|
34
|
+
- run: npm ci
|
|
35
|
+
- run: npm run build-storybook
|
|
36
|
+
- name: Setup Pages
|
|
37
|
+
uses: actions/configure-pages@v3
|
|
38
|
+
- name: Upload artifact
|
|
39
|
+
uses: actions/upload-pages-artifact@v2
|
|
40
|
+
with:
|
|
41
|
+
path: "./storybook-static"
|
|
42
|
+
- name: Deploy to GitHub Pages
|
|
43
|
+
id: deployment
|
|
44
|
+
uses: actions/deploy-pages@v2
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Notify release
|
|
2
|
+
'on':
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: 30 8 * * *
|
|
6
|
+
release:
|
|
7
|
+
types:
|
|
8
|
+
- published
|
|
9
|
+
issues:
|
|
10
|
+
types:
|
|
11
|
+
- closed
|
|
12
|
+
jobs:
|
|
13
|
+
setup:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
issues: write
|
|
17
|
+
contents: read
|
|
18
|
+
steps:
|
|
19
|
+
- uses: nearform-actions/github-action-notify-release@v1
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
inputs:
|
|
5
|
+
semver:
|
|
6
|
+
description: The semver to use
|
|
7
|
+
required: true
|
|
8
|
+
default: patch
|
|
9
|
+
type: choice
|
|
10
|
+
options:
|
|
11
|
+
- patch
|
|
12
|
+
- minor
|
|
13
|
+
- major
|
|
14
|
+
pull_request:
|
|
15
|
+
types: [closed]
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
release:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
permissions:
|
|
21
|
+
contents: write
|
|
22
|
+
issues: write
|
|
23
|
+
pull-requests: write
|
|
24
|
+
steps:
|
|
25
|
+
- uses: nearform-actions/optic-release-automation-action@v4
|
|
26
|
+
with:
|
|
27
|
+
semver: ${{ github.event.inputs.semver }}
|
|
28
|
+
commit-message: 'chore: release {version}'
|
|
29
|
+
build-command: npm ci
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lts/*
|
package/.prettierrc
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import path from 'path'
|
|
2
|
+
import type { StorybookConfig } from '@storybook/react-vite'
|
|
3
|
+
const config: StorybookConfig = {
|
|
4
|
+
stories: [
|
|
5
|
+
'../stories/**/*.mdx',
|
|
6
|
+
'../src/**/*.jsx',
|
|
7
|
+
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'
|
|
8
|
+
],
|
|
9
|
+
|
|
10
|
+
addons: [
|
|
11
|
+
'@storybook/addon-links',
|
|
12
|
+
'@storybook/addon-essentials',
|
|
13
|
+
'@storybook/addon-interactions',
|
|
14
|
+
'storybook-tailwind-dark-mode'
|
|
15
|
+
],
|
|
16
|
+
framework: {
|
|
17
|
+
name: '@storybook/react-vite',
|
|
18
|
+
options: {}
|
|
19
|
+
},
|
|
20
|
+
docs: {
|
|
21
|
+
autodocs: 'tag'
|
|
22
|
+
},
|
|
23
|
+
async viteFinal(config) {
|
|
24
|
+
if (config && config.resolve) {
|
|
25
|
+
config.resolve.alias = {
|
|
26
|
+
...config.resolve.alias,
|
|
27
|
+
'@': path.join(__dirname, '../src')
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return config
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export default config
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Preview } from '@storybook/react'
|
|
2
|
+
import '../stories/global.css'
|
|
3
|
+
|
|
4
|
+
const preview: Preview = {
|
|
5
|
+
globalTypes: {
|
|
6
|
+
darkMode: {
|
|
7
|
+
defaultValue: false
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
parameters: {
|
|
11
|
+
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
12
|
+
controls: {
|
|
13
|
+
matchers: {
|
|
14
|
+
color: /(background|color)$/i,
|
|
15
|
+
date: /Date$/i
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default preview
|
package/.svg-to-tsrc
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"srcFiles": [
|
|
3
|
+
"./src/assets/svg-icons/*.svg"
|
|
4
|
+
],
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"objectName": "Icons",
|
|
7
|
+
"outputDirectory": "./src/assets/",
|
|
8
|
+
"interfaceName": "Icons",
|
|
9
|
+
"typeName": "Icons",
|
|
10
|
+
"prefix": "",
|
|
11
|
+
"fileName": "index",
|
|
12
|
+
"svgoConfig": {
|
|
13
|
+
"plugins": [
|
|
14
|
+
"cleanupAttrs"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"compileSources": true
|
|
18
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Quantum Component Library
|
|
2
|
+
|
|
3
|
+
 [](https://www.figma.com/file/XFbhstkgQFz8ZefAU3w2p4/1.-Quantum-Design-System?type=design&node-id=1-5&mode=design&t=Zjds6CFL8asuPc4a-0)
|
|
4
|
+
|
|
5
|
+
> A React component library based on the Quantum Design System
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install --save @nearform/quantum
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Configuration
|
|
14
|
+
|
|
15
|
+
#### With Tailwind
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
// tailwind.config.js
|
|
19
|
+
|
|
20
|
+
module.exports = {
|
|
21
|
+
content: [
|
|
22
|
+
"./node_modules/@nearform/quantum/**/*.js"
|
|
23
|
+
]
|
|
24
|
+
};
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### Without Tailwind
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import '@nearform/quantum/dist/library.css';
|
|
31
|
+
import { Navbar } from '@nearform/quantum';
|
|
32
|
+
```
|