svelte-github-calendar 0.1.0-alpha.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/LICENSE +7 -0
- package/README.md +58 -0
- package/dist/GitHubCalendar.svelte +270 -0
- package/dist/GitHubCalendar.svelte.d.ts +13 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright © 2025 Paillat-dev
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Svelte library
|
|
2
|
+
|
|
3
|
+
Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
|
|
4
|
+
|
|
5
|
+
Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
|
|
6
|
+
|
|
7
|
+
## Creating a project
|
|
8
|
+
|
|
9
|
+
If you're seeing this, you've probably already done this step. Congrats!
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
# create a new project in the current directory
|
|
13
|
+
npx sv create
|
|
14
|
+
|
|
15
|
+
# create a new project in my-app
|
|
16
|
+
npx sv create my-app
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Developing
|
|
20
|
+
|
|
21
|
+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm run dev
|
|
25
|
+
|
|
26
|
+
# or start the server and open the app in a new browser tab
|
|
27
|
+
npm run dev -- --open
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
|
|
31
|
+
|
|
32
|
+
## Building
|
|
33
|
+
|
|
34
|
+
To build your library:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
npm pack
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
To create a production version of your showcase app:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
npm run build
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can preview the production build with `npm run preview`.
|
|
47
|
+
|
|
48
|
+
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
|
49
|
+
|
|
50
|
+
## Publishing
|
|
51
|
+
|
|
52
|
+
Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
|
|
53
|
+
|
|
54
|
+
To publish your library to [npm](https://www.npmjs.com):
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
npm publish
|
|
58
|
+
```
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// @ts-expect-error no types
|
|
3
|
+
import GithubCalendar from 'github-calendar';
|
|
4
|
+
import { onMount } from 'svelte';
|
|
5
|
+
|
|
6
|
+
interface GithubCalendarOptions {
|
|
7
|
+
username: string;
|
|
8
|
+
summary_text?: string;
|
|
9
|
+
proxy?: (username: string) => Promise<string>;
|
|
10
|
+
global_stats?: boolean;
|
|
11
|
+
responsive?: boolean;
|
|
12
|
+
tooltips?: boolean;
|
|
13
|
+
cache?: number;
|
|
14
|
+
class?: string;
|
|
15
|
+
}
|
|
16
|
+
const { username, class: className = '', ...options }: GithubCalendarOptions = $props();
|
|
17
|
+
|
|
18
|
+
onMount(async () => {
|
|
19
|
+
await GithubCalendar('.calendar', username, {
|
|
20
|
+
...options
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<div class={`calendar-holder ${className}`}>
|
|
26
|
+
<div class="calendar"></div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<style global>
|
|
30
|
+
:root {
|
|
31
|
+
--color-calendar-graph-day-bg: #dddbdb !important;
|
|
32
|
+
--color-calendar-graph-day-L1-bg: #39dd34 !important;
|
|
33
|
+
--color-calendar-graph-day-L2-bg: #45a045 !important;
|
|
34
|
+
--color-calendar-graph-day-L3-bg: #047526 !important;
|
|
35
|
+
--color-calendar-graph-day-L4-bg: #0a4208 !important;
|
|
36
|
+
}
|
|
37
|
+
:global {
|
|
38
|
+
.calendar-holder {
|
|
39
|
+
.ContributionCalendar-day[data-level='0'] {
|
|
40
|
+
background-color: var(--color-calendar-graph-day-bg) !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ContributionCalendar-day[data-level='1'] {
|
|
44
|
+
background-color: var(--color-calendar-graph-day-L1-bg) !important;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ContributionCalendar-day[data-level='2'] {
|
|
48
|
+
background-color: var(--color-calendar-graph-day-L2-bg) !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ContributionCalendar-day[data-level='3'] {
|
|
52
|
+
background-color: var(--color-calendar-graph-day-L3-bg) !important;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ContributionCalendar-day[data-level='4'] {
|
|
56
|
+
background-color: var(--color-calendar-graph-day-L4-bg) !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
table.ContributionCalendar-grid {
|
|
60
|
+
margin-bottom: 0pt !important;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
table.ContributionCalendar-grid td {
|
|
64
|
+
padding: 4pt !important;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
table.ContributionCalendar-grid td span.sr-only {
|
|
68
|
+
display: none !important;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
td.ContributionCalendar-label span[aria-hidden='true'] {
|
|
72
|
+
font-size: 8pt !important;
|
|
73
|
+
left: -1pt !important;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
tool-tip {
|
|
77
|
+
display: none !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.calendar .width-full > .float-left {
|
|
81
|
+
display: none !important;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.calendar {
|
|
85
|
+
font-family: Helvetica, arial !important;
|
|
86
|
+
border: 1px solid #dddddd !important;
|
|
87
|
+
border-radius: 3px !important;
|
|
88
|
+
min-height: 243px !important;
|
|
89
|
+
text-align: center !important;
|
|
90
|
+
margin: 0 auto !important;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.calendar-graph text.wday,
|
|
94
|
+
.calendar-graph text.month {
|
|
95
|
+
font-size: 10px !important;
|
|
96
|
+
fill: #aaa !important;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
div.px-md-5 {
|
|
100
|
+
height: 2rem !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
div.float-right {
|
|
104
|
+
text-align: right !important;
|
|
105
|
+
padding: 0 14px 10px 0 !important;
|
|
106
|
+
display: inline-block !important;
|
|
107
|
+
float: right !important;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
div.float-right div {
|
|
111
|
+
display: inline-block !important;
|
|
112
|
+
list-style: none !important;
|
|
113
|
+
margin: 0 5px !important;
|
|
114
|
+
position: relative !important;
|
|
115
|
+
bottom: -1px !important;
|
|
116
|
+
padding: 0 !important;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
div.float-right span.sr-only {
|
|
120
|
+
display: none !important;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.contrib-legend .legend li {
|
|
124
|
+
display: inline-block !important;
|
|
125
|
+
width: 10px !important;
|
|
126
|
+
height: 10px !important;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.text-small {
|
|
130
|
+
font-size: 12px !important;
|
|
131
|
+
color: #767676 !important;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.calendar-graph {
|
|
135
|
+
padding: 5px 0 0 !important;
|
|
136
|
+
text-align: center !important;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.contrib-column {
|
|
140
|
+
padding: 15px 0 !important;
|
|
141
|
+
text-align: center !important;
|
|
142
|
+
border-left: 1px solid #ddd !important;
|
|
143
|
+
border-top: 1px solid #ddd !important;
|
|
144
|
+
font-size: 11px !important;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.contrib-column-first {
|
|
148
|
+
border-left: 0 !important;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.table-column {
|
|
152
|
+
box-sizing: border-box !important;
|
|
153
|
+
display: table-cell !important;
|
|
154
|
+
width: 1% !important;
|
|
155
|
+
padding-right: 10px !important;
|
|
156
|
+
padding-left: 10px !important;
|
|
157
|
+
vertical-align: top !important;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.contrib-number {
|
|
161
|
+
font-weight: 300 !important;
|
|
162
|
+
line-height: 1.3em !important;
|
|
163
|
+
font-size: 24px !important;
|
|
164
|
+
display: block !important;
|
|
165
|
+
color: #333 !important;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.calendar img.spinner {
|
|
169
|
+
width: 70px !important;
|
|
170
|
+
margin-top: 50px !important;
|
|
171
|
+
min-height: 70px !important;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.monospace {
|
|
175
|
+
text-align: center !important;
|
|
176
|
+
color: #000 !important;
|
|
177
|
+
font-family: monospace !important;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.monospace a {
|
|
181
|
+
color: #1d75ab !important;
|
|
182
|
+
text-decoration: none !important;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.contrib-footer {
|
|
186
|
+
font-size: 11px !important;
|
|
187
|
+
padding: 0 10px 12px !important;
|
|
188
|
+
text-align: left !important;
|
|
189
|
+
width: 100% !important;
|
|
190
|
+
box-sizing: border-box !important;
|
|
191
|
+
height: 26px !important;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.left.text-muted {
|
|
195
|
+
float: left !important;
|
|
196
|
+
margin-left: 9px !important;
|
|
197
|
+
color: #767676 !important;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.left.text-muted a {
|
|
201
|
+
color: #4078c0 !important;
|
|
202
|
+
text-decoration: none !important;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.left.text-muted a:hover,
|
|
206
|
+
.monospace a:hover {
|
|
207
|
+
text-decoration: underline !important;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
h2.f4.text-normal.mb-3 {
|
|
211
|
+
display: none !important;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.float-left.text-gray {
|
|
215
|
+
float: left !important;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
#user-activity-overview {
|
|
219
|
+
display: none !important;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.day-tooltip {
|
|
223
|
+
white-space: nowrap !important;
|
|
224
|
+
position: absolute !important;
|
|
225
|
+
z-index: 99999 !important;
|
|
226
|
+
padding: 10px !important;
|
|
227
|
+
font-size: 12px !important;
|
|
228
|
+
color: #959da5 !important;
|
|
229
|
+
text-align: center !important;
|
|
230
|
+
background: rgba(0, 0, 0, 0.85) !important;
|
|
231
|
+
border-radius: 3px !important;
|
|
232
|
+
display: none !important;
|
|
233
|
+
pointer-events: none !important;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.day-tooltip strong {
|
|
237
|
+
color: #dfe2e5 !important;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.day-tooltip.is-visible {
|
|
241
|
+
display: block !important;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.day-tooltip:after {
|
|
245
|
+
position: absolute !important;
|
|
246
|
+
bottom: -10px !important;
|
|
247
|
+
left: 50% !important;
|
|
248
|
+
width: 5px !important;
|
|
249
|
+
height: 5px !important;
|
|
250
|
+
box-sizing: border-box !important;
|
|
251
|
+
margin: 0 0 0 -5px !important;
|
|
252
|
+
content: ' ' !important;
|
|
253
|
+
border: 5px solid transparent !important;
|
|
254
|
+
border-top-color: rgba(0, 0, 0, 0.85);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
text.ContributionCalendar-label {
|
|
258
|
+
fill: #ccc !important;
|
|
259
|
+
font-size: 11px !important;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
@media screen and (max-width: 768px) {
|
|
263
|
+
.table-column {
|
|
264
|
+
display: block !important;
|
|
265
|
+
width: 100% !important;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface GithubCalendarOptions {
|
|
2
|
+
username: string;
|
|
3
|
+
summary_text?: string;
|
|
4
|
+
proxy?: (username: string) => Promise<string>;
|
|
5
|
+
global_stats?: boolean;
|
|
6
|
+
responsive?: boolean;
|
|
7
|
+
tooltips?: boolean;
|
|
8
|
+
cache?: number;
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const GitHubCalendar: import("svelte").Component<GithubCalendarOptions, {}, "">;
|
|
12
|
+
type GitHubCalendar = ReturnType<typeof GitHubCalendar>;
|
|
13
|
+
export default GitHubCalendar;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "svelte-github-calendar",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"url": "https://github.com/Paillat-dev/svelte-github-calendar"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"!dist/**/*.test.*",
|
|
11
|
+
"!dist/**/*.spec.*"
|
|
12
|
+
],
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"**/*.css"
|
|
15
|
+
],
|
|
16
|
+
"svelte": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"svelte": "./dist/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"svelte": "^5.0.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@eslint/compat": "^1.2.5",
|
|
30
|
+
"@eslint/js": "^9.18.0",
|
|
31
|
+
"@sveltejs/adapter-auto": "^6.0.0",
|
|
32
|
+
"@sveltejs/kit": "^2.22.0",
|
|
33
|
+
"@sveltejs/package": "^2.0.0",
|
|
34
|
+
"@sveltejs/vite-plugin-svelte": "^6.0.0",
|
|
35
|
+
"eslint": "^9.18.0",
|
|
36
|
+
"eslint-config-prettier": "^10.0.1",
|
|
37
|
+
"eslint-plugin-svelte": "^3.0.0",
|
|
38
|
+
"globals": "^16.0.0",
|
|
39
|
+
"prettier": "^3.4.2",
|
|
40
|
+
"prettier-plugin-svelte": "^3.3.3",
|
|
41
|
+
"publint": "^0.3.2",
|
|
42
|
+
"svelte": "^5.0.0",
|
|
43
|
+
"svelte-check": "^4.0.0",
|
|
44
|
+
"typescript": "^5.0.0",
|
|
45
|
+
"typescript-eslint": "^8.20.0",
|
|
46
|
+
"vite": "^7.0.4"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"svelte"
|
|
50
|
+
],
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"github-calendar": "^2.3.4"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"dev": "vite dev",
|
|
56
|
+
"build": "vite build && pnpm run prepack",
|
|
57
|
+
"preview": "vite preview",
|
|
58
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
59
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
60
|
+
"format": "prettier --write .",
|
|
61
|
+
"lint": "prettier --check . && eslint ."
|
|
62
|
+
}
|
|
63
|
+
}
|