Skip to content
This repository was archived by the owner on Dec 15, 2024. It is now read-only.

Commit 63f3bc0

Browse files
Updating style and bump dependencies
1 parent 3c98405 commit 63f3bc0

8 files changed

Lines changed: 1327 additions & 1051 deletions

File tree

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ vite.config.js
1111
.prettierignore
1212
.prettierrc
1313
.eslintignore
14+
postcss.config.js
15+
tailwind.config.js

index.html

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<meta charset="UTF-8" />
55
<meta name="description" content="A Stimulus controller to deal with chart.js." />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<link href="https://unpkg.com/tailwindcss@^2.0/dist/tailwind.min.css" rel="stylesheet" />
87

98
<title>Stimulus Chartjs</title>
109

1110
<script type="module" defer>
11+
import './src/app.css'
1212
import { Application } from '@hotwired/stimulus'
1313
import Chart from './src/index'
1414

@@ -71,7 +71,7 @@
7171
<div class="text-center">
7272
<h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl">
7373
<span class="block xl:inline">Stimulus</span>
74-
<span class="block text-yellow-600 xl:inline">Chartjs</span>
74+
<span class="block bg-gradient-to-r from-yellow-500 to-orange-500 xl:inline bg-clip-text text-transparent">Chartjs</span>
7575
</h1>
7676

7777
<p class="mt-3 max-w-md mx-auto text-base text-gray-500 sm:text-lg md:mt-5 md:text-xl md:max-w-3xl">
@@ -91,28 +91,30 @@ <h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:t
9191
class="inline-block"
9292
src="https://img.shields.io/github/license/stimulus-components/stimulus-chartjs.svg"
9393
/>
94-
95-
<img
96-
class="inline-block"
97-
src="https://api.netlify.com/api/v1/badges/f75f37fa-c1c7-42c3-8266-27d11c67c2b1/deploy-status"
98-
/>
9994
</p>
10095

10196
<div class="mt-5 max-w-md mx-auto sm:flex sm:justify-center md:mt-8">
10297
<div class="rounded-md shadow">
10398
<a
104-
href="https://github.com/stimulus-components/stimulus-chartjs"
105-
class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-yellow-600 hover:bg-yellow-700 md:py-4 md:text-lg md:px-10"
99+
href="https://www.stimulus-components.com/docs/stimulus-chartjs"
100+
class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-gradient-to-r from-yellow-500 to-orange-500 md:py-4 md:text-lg md:px-10"
106101
>
107-
GitHub
102+
Documentation &rarr;
108103
</a>
109104
</div>
110105
<div class="mt-3 rounded-md shadow sm:mt-0 sm:ml-3">
111106
<a
112-
href="https://stimulus-components.netlify.app/docs/components/stimulus-chartjs/"
113-
class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-yellow-600 bg-white hover:bg-gray-50 md:py-4 md:text-lg md:px-10"
107+
href="https://github.com/stimulus-components/stimulus-chartjs"
108+
class="w-full flex items-center justify-center gap-1 px-8 py-3 border border-transparent text-base font-medium rounded-md bg-white hover:bg-gray-50 md:py-4 md:text-lg md:px-10"
114109
>
115-
Documentation
110+
<svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true" class="h-6 w-6">
111+
<path
112+
fill-rule="evenodd"
113+
d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"
114+
clip-rule="evenodd"
115+
></path>
116+
</svg>
117+
GitHub
116118
</a>
117119
</div>
118120
</div>

package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"homepage": "https://github.com/stimulus-components/stimulus-chartjs",
1919
"private": false,
2020
"main": "dist/stimulus-chartjs.umd.js",
21-
"module": "dist/stimulus-chartjs.es.js",
21+
"module": "dist/stimulus-chartjs.mjs",
2222
"scripts": {
2323
"format": "prettier-standard '**/*.{ts,css,html}' --format",
2424
"lint": "prettier-standard '**/*.{ts,css,html}' --lint",
@@ -29,19 +29,22 @@
2929
"np": "np --no-2fa --no-test"
3030
},
3131
"devDependencies": {
32-
"@babel/core": "7.16.7",
32+
"@babel/core": "7.20.7",
3333
"@babel/plugin-syntax-class-properties": "7.12.13",
34-
"@babel/preset-env": "^7.16.7",
35-
"@babel/preset-typescript": "^7.16.7",
36-
"@hotwired/stimulus": "^3.0.1",
37-
"@types/chart.js": "^2.9.35",
38-
"np": "^7.6.0",
34+
"@babel/preset-env": "^7.20.2",
35+
"@babel/preset-typescript": "^7.18.6",
36+
"@hotwired/stimulus": "^3.2.1",
37+
"@types/chart.js": "^2.9.37",
38+
"autoprefixer": "^10.4.13",
39+
"np": "^7.6.2",
40+
"postcss": "^8.4.20",
3941
"prettier-standard": "16.4.1",
40-
"typescript": "^4.5.4",
41-
"vite": "^2.7.10"
42+
"tailwindcss": "^3.2.4",
43+
"typescript": "^4.9.4",
44+
"vite": "^4.0.3"
4245
},
4346
"peerDependencies": {
44-
"@hotwired/stimulus": "^3.0.1"
47+
"@hotwired/stimulus": "^3.2.1"
4548
},
4649
"dependencies": {
4750
"chart.js": "^3.7.0"

postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

src/app.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

tailwind.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
content: [
3+
"./index.html",
4+
"./src/**/*.{js,ts,jsx,tsx}",
5+
],
6+
}

vite.config.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
import path from 'path'
1+
import { resolve } from 'path'
2+
import { defineConfig } from 'vite'
23

3-
export default ({ mode }) => {
4-
if (mode === 'netlify') return {}
4+
export default defineConfig(({ mode }) => {
5+
if (mode === 'netlify') {
6+
return {}
7+
}
58

69
return {
710
build: {
811
lib: {
9-
entry: path.resolve(__dirname, 'src/index.ts'),
10-
name: 'stimulus-chartjs'
12+
entry: resolve(__dirname, 'src/index.ts'),
13+
name: 'StimulusChartjs',
14+
fileName: 'stimulus-chartjs'
1115
},
1216
rollupOptions: {
1317
external: ['chart.js/auto', '@hotwired/stimulus'],
@@ -20,4 +24,4 @@ export default ({ mode }) => {
2024
}
2125
}
2226
}
23-
}
27+
})

0 commit comments

Comments
 (0)