@scalar/components 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/LICENSE +21 -0
- package/README.md +123 -0
- package/dist/components/ScalarButton/ScalarButton.spec.d.ts +2 -0
- package/dist/components/ScalarButton/ScalarButton.spec.d.ts.map +1 -0
- package/dist/components/ScalarButton/ScalarButton.stories.d.ts +889 -0
- package/dist/components/ScalarButton/ScalarButton.stories.d.ts.map +1 -0
- package/dist/components/ScalarButton/ScalarButton.vue.d.ts +55 -0
- package/dist/components/ScalarButton/ScalarButton.vue.d.ts.map +1 -0
- package/dist/components/ScalarButton/index.d.ts +2 -0
- package/dist/components/ScalarButton/index.d.ts.map +1 -0
- package/dist/components/ScalarIcon/ScalarIcon.spec.d.ts +2 -0
- package/dist/components/ScalarIcon/ScalarIcon.spec.d.ts.map +1 -0
- package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts +71 -0
- package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts.map +1 -0
- package/dist/components/ScalarIcon/ScalarIcon.vue.d.ts +17 -0
- package/dist/components/ScalarIcon/ScalarIcon.vue.d.ts.map +1 -0
- package/dist/components/ScalarIcon/SvgRenderer.d.ts +7 -0
- package/dist/components/ScalarIcon/SvgRenderer.d.ts.map +1 -0
- package/dist/components/ScalarIcon/icons/iconNames.d.ts +2 -0
- package/dist/components/ScalarIcon/icons/iconNames.d.ts.map +1 -0
- package/dist/components/ScalarIcon/icons/index.d.ts +4 -0
- package/dist/components/ScalarIcon/icons/index.d.ts.map +1 -0
- package/dist/components/ScalarIcon/index.d.ts +3 -0
- package/dist/components/ScalarIcon/index.d.ts.map +1 -0
- package/dist/components/ScalarIconButton/ScalarIconButton.spec.d.ts +2 -0
- package/dist/components/ScalarIconButton/ScalarIconButton.spec.d.ts.map +1 -0
- package/dist/components/ScalarIconButton/ScalarIconButton.stories.d.ts +57 -0
- package/dist/components/ScalarIconButton/ScalarIconButton.stories.d.ts.map +1 -0
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.d.ts +35 -0
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.d.ts.map +1 -0
- package/dist/components/ScalarIconButton/index.d.ts +2 -0
- package/dist/components/ScalarIconButton/index.d.ts.map +1 -0
- package/dist/components/ScalarLoading/ScalarLoading.spec.d.ts +2 -0
- package/dist/components/ScalarLoading/ScalarLoading.spec.d.ts.map +1 -0
- package/dist/components/ScalarLoading/ScalarLoading.stories.d.ts +326 -0
- package/dist/components/ScalarLoading/ScalarLoading.stories.d.ts.map +1 -0
- package/dist/components/ScalarLoading/ScalarLoading.vue.d.ts +48 -0
- package/dist/components/ScalarLoading/ScalarLoading.vue.d.ts.map +1 -0
- package/dist/components/ScalarLoading/index.d.ts +2 -0
- package/dist/components/ScalarLoading/index.d.ts.map +1 -0
- package/dist/components/ScalarModal/ScalarModal.spec.d.ts +2 -0
- package/dist/components/ScalarModal/ScalarModal.spec.d.ts.map +1 -0
- package/dist/components/ScalarModal/ScalarModal.stories.d.ts +202 -0
- package/dist/components/ScalarModal/ScalarModal.stories.d.ts.map +1 -0
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts +52 -0
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts.map +1 -0
- package/dist/components/ScalarModal/index.d.ts +2 -0
- package/dist/components/ScalarModal/index.d.ts.map +1 -0
- package/dist/components/ScalarTextField/ScalarTextField.spec.d.ts +2 -0
- package/dist/components/ScalarTextField/ScalarTextField.spec.d.ts.map +1 -0
- package/dist/components/ScalarTextField/ScalarTextField.stories.d.ts +992 -0
- package/dist/components/ScalarTextField/ScalarTextField.stories.d.ts.map +1 -0
- package/dist/components/ScalarTextField/ScalarTextField.vue.d.ts +73 -0
- package/dist/components/ScalarTextField/ScalarTextField.vue.d.ts.map +1 -0
- package/dist/components/ScalarTextField/index.d.ts +2 -0
- package/dist/components/ScalarTextField/index.d.ts.map +1 -0
- package/dist/index-6bb15e9f.js +1802 -0
- package/dist/index-c8ae42b3.cjs +4 -0
- package/dist/index.cjs +54 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3757 -0
- package/dist/index.umd.cjs +57 -0
- package/dist/style.css +1 -0
- package/package.json +92 -0
- package/src/tailwind/index.ts +1 -0
- package/src/tailwind/tailwind.css +18 -0
- package/src/tailwind/tailwind.theme.ts +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Scalar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Scalar's Component Library
|
|
2
|
+
|
|
3
|
+
Scalars internal component library now open sourced and [almost] ready to use! it's besed used with our themeing library OR if you want you can simply set the css vars yourself. Refer to the variable legend below. This project is still very early!
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm i @scalar/theme @scalar/components
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
If you are using tailwind, make sure to import these after your tailwind reset or the styles will get overwritten.
|
|
14
|
+
|
|
15
|
+
In your main setup file (main.ts etc)
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import '@scalar/components/style.css'
|
|
19
|
+
import '@scalar/themes/base.css'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Then to use the components
|
|
23
|
+
|
|
24
|
+
```vue
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import { ScalarButton, ScalarTextField } from '@scalar/components'
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<main class="col-1 items-center justify-center">
|
|
31
|
+
<div
|
|
32
|
+
class="col w-full max-w-md items-center gap-4 rounded-lg bg-back-3 p-8 shadow">
|
|
33
|
+
<h1 className="text-lg font-bold">Sign in to your account</h1>
|
|
34
|
+
|
|
35
|
+
<ScalarTextField
|
|
36
|
+
class="w-full"
|
|
37
|
+
label="Email Address" />
|
|
38
|
+
<ScalarButton isFullWidth>Login</ScalarButton>
|
|
39
|
+
</div>
|
|
40
|
+
</main>
|
|
41
|
+
</template>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Theme variables
|
|
45
|
+
|
|
46
|
+
To override the theme, feel free to set the `--theme-x` versions of these variables.
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
export const theme = {
|
|
50
|
+
boxShadow: {
|
|
51
|
+
label:
|
|
52
|
+
'0 0 2px 2px var(--theme-background-1, var(--default-theme-background-1))',
|
|
53
|
+
DEFAULT: 'var(--theme-shadow-1, var(--default-theme-shadow-1))',
|
|
54
|
+
md: 'var(--theme-shadow-2, var(--default-theme-shadow-2))',
|
|
55
|
+
sm: 'rgba(0, 0, 0, 0.09) 0px 1px 4px',
|
|
56
|
+
none: '0 0 #0000',
|
|
57
|
+
},
|
|
58
|
+
colors: {
|
|
59
|
+
'fore-1': 'var(--theme-color-1, var(--default-theme-color-1))',
|
|
60
|
+
'fore-2': 'var(--theme-color-2, var(--default-theme-color-2))',
|
|
61
|
+
'fore-3': 'var(--theme-color-3, var(--default-theme-color-3))',
|
|
62
|
+
'accent': 'var(--theme-color-accent, var(--default-theme-color-accent))',
|
|
63
|
+
'back-1': 'var(--theme-background-1, var(--default-theme-background-1))',
|
|
64
|
+
'back-2': 'var(--theme-background-2, var(--default-theme-background-2))',
|
|
65
|
+
'back-3': 'var(--theme-background-3, var(--default-theme-background-3))',
|
|
66
|
+
'back-accent':
|
|
67
|
+
'var(--theme-background-accent, var(--default-theme-background-accent))',
|
|
68
|
+
|
|
69
|
+
'backdrop': 'rgba(0, 0, 0, 0.44)',
|
|
70
|
+
'border': 'var(--theme-border-color, var(--default-theme-border-color))',
|
|
71
|
+
|
|
72
|
+
'back-btn-1': 'var(--theme-button-1, var(--default-theme-button-1))',
|
|
73
|
+
'fore-btn-1':
|
|
74
|
+
'var(--theme-button-1-color, var(--default-theme-button-1-color))',
|
|
75
|
+
'hover-btn-1':
|
|
76
|
+
'var(--theme-button-1-hover, var(--default-theme-button-1-hover))',
|
|
77
|
+
|
|
78
|
+
'white': '#FFF',
|
|
79
|
+
'green': 'var(--theme-color-green, var(--default-theme-color-green))',
|
|
80
|
+
'red': 'var(--theme-color-red, var(--default-theme-color-red))',
|
|
81
|
+
'yellow': 'var(--theme-color-yellow, var(--default-theme-color-yellow))',
|
|
82
|
+
'blue': 'var(--theme-color-blue, var(--default-theme-color-blue))',
|
|
83
|
+
'orange': 'var(--theme-color-orange, var(--default-theme-color-orange))',
|
|
84
|
+
'purple': 'var(--theme-color-purple, var(--default-theme-color-purple))',
|
|
85
|
+
'error': 'var(--theme-error-color, var(--default-theme-color-red))',
|
|
86
|
+
'ghost': 'var(--theme-color-ghost, var(--default-theme-color-ghost))',
|
|
87
|
+
'transparent': 'transparent',
|
|
88
|
+
},
|
|
89
|
+
fontSize: {
|
|
90
|
+
xxs: 'var(--theme-micro, var(--default-theme-micro, var(--theme-font-size-5, var(--default-theme-font-size-5))))',
|
|
91
|
+
xs: 'var(--theme-mini, var(--default-theme-mini, var(--theme-font-size-4, var(--default-theme-font-size-4))))',
|
|
92
|
+
sm: 'var(--theme-small, var(--default-theme-small, var(--theme-font-size-3, var(--default-theme-font-size-3))))',
|
|
93
|
+
base: 'var(--theme-paragraph, var(--default-theme-paragraph, var(--theme-font-size-2, var(--default-theme-font-size-2))))',
|
|
94
|
+
lg: 'var(--theme-font-size-1, var(--default-theme-font-size-1))',
|
|
95
|
+
},
|
|
96
|
+
} as const
|
|
97
|
+
|
|
98
|
+
export const extend = {
|
|
99
|
+
borderRadius: {
|
|
100
|
+
DEFAULT: 'var(--theme-radius, var(--default-theme-radius))',
|
|
101
|
+
md: 'var(--theme-radius, var(--default-theme-radius))',
|
|
102
|
+
lg: 'var(--theme-radius-lg, var(--default-theme-radius-lg))',
|
|
103
|
+
xl: 'var(--theme-radius-xl, var(--default-theme-radius-xl))',
|
|
104
|
+
},
|
|
105
|
+
fontWeight: {
|
|
106
|
+
medium: 'var(--theme-font-medium, var(--default-theme-font-medium))',
|
|
107
|
+
bold: 'var(-theme-font-bold, var(--default-theme-font-bold))',
|
|
108
|
+
},
|
|
109
|
+
maxWidth: {
|
|
110
|
+
'screen-xs': '480px',
|
|
111
|
+
'screen-sm': '540px',
|
|
112
|
+
'screen-md': '640px',
|
|
113
|
+
'screen-lg': '800px',
|
|
114
|
+
},
|
|
115
|
+
} as const
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Todo
|
|
119
|
+
|
|
120
|
+
- documentation
|
|
121
|
+
- github actions for lint, types, tests, build, npm deployment
|
|
122
|
+
- implementation (can remove more base style here)
|
|
123
|
+
- host storybook
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarButton.spec.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarButton/ScalarButton.spec.ts"],"names":[],"mappings":""}
|