webcoreui 0.0.12 → 0.2.0
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/README.md +39 -6
- package/astro.d.ts +4 -0
- package/astro.js +4 -0
- package/components/Accordion/accordion.module.scss +20 -27
- package/components/Alert/alert.module.scss +19 -22
- package/components/Avatar/avatar.module.scss +9 -6
- package/components/Badge/badge.module.scss +31 -34
- package/components/Button/Button.astro +0 -2
- package/components/Button/Button.svelte +0 -2
- package/components/Button/Button.tsx +0 -2
- package/components/Button/button.module.scss +32 -39
- package/components/Button/button.ts +1 -2
- package/components/Card/card.module.scss +19 -15
- package/components/Checkbox/checkbox.module.scss +27 -41
- package/components/Icon/Icon.astro +2 -2
- package/components/Icon/map.ts +2 -0
- package/components/Input/input.module.scss +28 -36
- package/components/Menu/Menu.astro +7 -3
- package/components/Menu/Menu.svelte +11 -3
- package/components/Menu/Menu.tsx +7 -1
- package/components/Menu/menu.module.scss +144 -144
- package/components/Menu/menu.ts +1 -0
- package/components/Modal/Modal.astro +70 -0
- package/components/Modal/Modal.svelte +71 -0
- package/components/Modal/Modal.tsx +76 -0
- package/components/Modal/modal.module.scss +103 -0
- package/components/Modal/modal.ts +18 -0
- package/components/Progress/progress.module.scss +26 -22
- package/components/Radio/radio.module.scss +32 -41
- package/components/Rating/Rating.astro +2 -2
- package/components/Rating/Rating.svelte +2 -2
- package/components/Rating/Rating.tsx +2 -2
- package/components/Rating/rating.module.scss +15 -8
- package/components/Slider/Slider.astro +44 -0
- package/components/Slider/Slider.svelte +42 -0
- package/components/Slider/Slider.tsx +48 -0
- package/components/Slider/slider.module.scss +68 -0
- package/components/Slider/slider.ts +20 -0
- package/components/Spinner/spinner.module.scss +11 -2
- package/components/Switch/switch.module.scss +28 -30
- package/components/Table/Table.astro +6 -1
- package/components/Table/Table.svelte +3 -1
- package/components/Table/Table.tsx +7 -1
- package/components/Table/table.module.scss +23 -17
- package/components/Table/table.ts +1 -0
- package/components/Tabs/Tabs.astro +0 -1
- package/components/Tabs/tabs.module.scss +45 -48
- package/components/ThemeSwitcher/ThemeSwitcher.astro +1 -0
- package/components/ThemeSwitcher/ThemeSwitcher.svelte +2 -1
- package/components/ThemeSwitcher/ThemeSwitcher.tsx +2 -1
- package/components/ThemeSwitcher/themeswitcher.module.scss +28 -26
- package/components/Timeline/timeline.module.scss +28 -23
- package/components/TimelineItem/TimelineItem.tsx +1 -6
- package/components/TimelineItem/timelineitem.module.scss +14 -17
- package/components/TimelineItem/timelineitem.ts +5 -0
- package/components/Toast/toast.module.scss +10 -14
- package/components/Toast/toast.ts +6 -1
- package/icons/close.svg +3 -0
- package/icons.d.ts +12 -0
- package/icons.js +10 -0
- package/index.js +2 -0
- package/package.json +3 -1
- package/react.d.ts +6 -2
- package/react.js +4 -0
- package/scss/config/color-palette.scss +24 -0
- package/scss/config/css-values.scss +44 -0
- package/scss/config/layout.scss +41 -0
- package/scss/config/mixins.scss +392 -9
- package/scss/config/typography.scss +65 -0
- package/scss/config.scss +6 -1
- package/scss/global/elements.scss +21 -1
- package/scss/global/scrollbar.scss +12 -9
- package/scss/global/theme.scss +73 -40
- package/scss/global/tooltip.scss +42 -35
- package/scss/global/utility.scss +79 -61
- package/scss/global.scss +0 -1
- package/scss/resets.scss +67 -9
- package/scss/setup.scss +14 -41
- package/svelte.d.ts +4 -0
- package/svelte.js +4 -0
- package/utils/interpolate.ts +23 -0
- package/utils/modal.ts +59 -0
- package/utils/toast.ts +3 -2
package/README.md
CHANGED
|
@@ -79,11 +79,11 @@ yarn add webcoreui
|
|
|
79
79
|
|
|
80
80
|
### Setup
|
|
81
81
|
|
|
82
|
-
Setup default styles and fonts by calling the following in your global SCSS file:
|
|
82
|
+
Create an empty `webcore.config.scss` file at the root of your project to setup CSS configurations. Setup default styles and fonts by calling the following in your global SCSS file:
|
|
83
83
|
|
|
84
84
|
```scss
|
|
85
85
|
@import 'webcoreui/styles';
|
|
86
|
-
@include
|
|
86
|
+
@include setup((
|
|
87
87
|
// Define paths for your fonts
|
|
88
88
|
fontRegular: '/fonts/Inter-Regular.woff2',
|
|
89
89
|
fontBold: '/fonts/Inter-Bold.woff2'
|
|
@@ -99,41 +99,72 @@ The `Setup` mixin can also accept the following options:
|
|
|
99
99
|
| Property | Default value | Purpose |
|
|
100
100
|
|-----------|---------------|---------|
|
|
101
101
|
| `includeResets` | `true` | Include reset styles. Set to `false` if you want to use your own CSS resets. |
|
|
102
|
-
| `
|
|
103
|
-
| `includeElementStyles` | `true` | Adds styles for native HTML elements, such as `code`, `pre`, or `ul`.
|
|
102
|
+
| `includeUtilities` | `true` | Adds utility classes for CSS. Read more about the available utility classes [here](https://webcoreui.dev/docs/layout). |
|
|
104
103
|
| `includeTooltip` | `true` | Adds styles for using tooltips.
|
|
105
104
|
| `includeScrollbarStyles` | `true` | Adds styles for scrollbars.
|
|
106
105
|
|
|
107
106
|
Default component styles can be changed by overriding the following CSS variables:
|
|
108
107
|
|
|
109
|
-
```
|
|
110
|
-
body {
|
|
108
|
+
```scss
|
|
109
|
+
html body {
|
|
110
|
+
// Avatar component
|
|
111
111
|
--w-avatar-border: var(--w-color-primary-70);
|
|
112
|
+
|
|
113
|
+
// Checkbox component
|
|
112
114
|
--w-checkbox-color: var(--w-color-primary);
|
|
115
|
+
|
|
116
|
+
// Progress component
|
|
113
117
|
--w-progress-color: var(--w-color-primary);
|
|
114
118
|
--w-progress-background: var(--w-color-primary-50);
|
|
115
119
|
--w-progress-stripe-light: var(--w-color-primary);
|
|
116
120
|
--w-progress-stripe-dark: var(--w-color-primary-10);
|
|
121
|
+
|
|
122
|
+
// Radio component
|
|
117
123
|
--w-radio-color: var(--w-color-primary);
|
|
124
|
+
|
|
125
|
+
// Rating component
|
|
118
126
|
--w-rating-color: var(--w-color-primary);
|
|
119
127
|
--w-rating-empty-color: var(--w-color-primary);
|
|
120
128
|
--w-rating-empty-background: var(--w-color-primary-70);
|
|
121
129
|
--w-rating-size: 18px;
|
|
130
|
+
|
|
131
|
+
// Scrollbars
|
|
122
132
|
--w-scrollbar-bg: var(--w-color-primary-60);
|
|
123
133
|
--w-scrollbar-fg: var(--w-color-primary-50);
|
|
134
|
+
|
|
135
|
+
// Slider component
|
|
136
|
+
--w-slider-background: var(--w-color-primary-50);
|
|
137
|
+
--w-slider-color: var(--w-color-primary);
|
|
138
|
+
--w-slider-thumb: var(--w-color-primary-50);
|
|
139
|
+
|
|
140
|
+
// Spinner component
|
|
124
141
|
--w-spinner-color: var(--w-color-primary);
|
|
125
142
|
--w-spinner-width: 2px;
|
|
126
143
|
--w-spinner-speed: 2s;
|
|
127
144
|
--w-spinner-size: 30px;
|
|
128
145
|
--w-spinner-dash: 8;
|
|
146
|
+
|
|
147
|
+
// Switch component
|
|
129
148
|
--w-switch-off-color: var(--w-color-primary-50);
|
|
130
149
|
--w-switch-on-color: var(--w-color-primary);
|
|
150
|
+
|
|
151
|
+
// ThemeSwitcher component
|
|
131
152
|
--w-theme-switcher-size: 20px;
|
|
153
|
+
|
|
154
|
+
// Timeline component
|
|
132
155
|
--w-timeline-color: var(--w-color-primary-50);
|
|
133
156
|
--w-timeline-text-color: var(--w-color-primary);
|
|
134
157
|
--w-timeline-counter: decimal;
|
|
158
|
+
|
|
159
|
+
// Tooltips
|
|
135
160
|
--w-tooltip-background: var(--w-color-primary);
|
|
136
161
|
--w-tooltip-color: var(--w-color-primary-70);
|
|
162
|
+
|
|
163
|
+
// Override border-radius
|
|
164
|
+
--w-sm-radius: 2px;
|
|
165
|
+
--w-md-radius: 5px;
|
|
166
|
+
--w-lg-radius: 10px;
|
|
167
|
+
--w-xl-radius: 15px;
|
|
137
168
|
}
|
|
138
169
|
```
|
|
139
170
|
|
|
@@ -170,9 +201,11 @@ import { Accordion } from 'webcoreui/react'
|
|
|
170
201
|
- [Icon](https://github.com/Frontendland/webcoreui/tree/main/src/components/Icon)
|
|
171
202
|
- [Input](https://github.com/Frontendland/webcoreui/tree/main/src/components/Input)
|
|
172
203
|
- [Menu](https://github.com/Frontendland/webcoreui/tree/main/src/components/Menu)
|
|
204
|
+
- [Modal](https://github.com/Frontendland/webcoreui/tree/main/src/components/Modal)
|
|
173
205
|
- [Progress](https://github.com/Frontendland/webcoreui/tree/main/src/components/Progress)
|
|
174
206
|
- [Radio](https://github.com/Frontendland/webcoreui/tree/main/src/components/Radio)
|
|
175
207
|
- [Rating](https://github.com/Frontendland/webcoreui/tree/main/src/components/Rating)
|
|
208
|
+
- [Slider](https://github.com/Frontendland/webcoreui/tree/main/src/components/Slider)
|
|
176
209
|
- [Spinner](https://github.com/Frontendland/webcoreui/tree/main/src/components/Spinner)
|
|
177
210
|
- [Switch](https://github.com/Frontendland/webcoreui/tree/main/src/components/Switch)
|
|
178
211
|
- [Table](https://github.com/Frontendland/webcoreui/tree/main/src/components/Table)
|
package/astro.d.ts
CHANGED
|
@@ -9,9 +9,11 @@ import type { ConditionalWrapperProps } from './components/ConditionalWrapper/co
|
|
|
9
9
|
import type { IconProps } from './components/Icon/icon'
|
|
10
10
|
import type { InputProps } from './components/Input/input'
|
|
11
11
|
import type { MenuProps } from './components/Menu/menu'
|
|
12
|
+
import type { ModalProps } from './components/Modal/modal'
|
|
12
13
|
import type { ProgressProps } from './components/Progress/progress'
|
|
13
14
|
import type { RadioProps } from './components/Radio/radio'
|
|
14
15
|
import type { RatingProps } from './components/Rating/rating'
|
|
16
|
+
import type { SliderProps } from './components/Slider/slider'
|
|
15
17
|
import type { SpinnerProps } from './components/Spinner/spinner'
|
|
16
18
|
import type { SwitchProps } from './components/Switch/switch'
|
|
17
19
|
import type { TableProps } from './components/Table/table'
|
|
@@ -33,9 +35,11 @@ declare module 'webcoreui/astro' {
|
|
|
33
35
|
export function Icon(_props: IconProps): any
|
|
34
36
|
export function Input(_props: InputProps): any
|
|
35
37
|
export function Menu(_props: MenuProps): any
|
|
38
|
+
export function Modal(_props: ModalProps): any
|
|
36
39
|
export function Progress(_props: ProgressProps): any
|
|
37
40
|
export function Radio(_props: RadioProps): any
|
|
38
41
|
export function Rating(_props: RatingProps): any
|
|
42
|
+
export function Slider(_props: SliderProps): any
|
|
39
43
|
export function Spinner(_props: SpinnerProps): any
|
|
40
44
|
export function Switch(_props: SwitchProps): any
|
|
41
45
|
export function Table(_props: TableProps): any
|
package/astro.js
CHANGED
|
@@ -9,9 +9,11 @@ import ConditionalWrapperComponent from './components/ConditionalWrapper/Conditi
|
|
|
9
9
|
import IconComponent from './components/Icon/Icon.astro'
|
|
10
10
|
import InputComponent from './components/Input/Input.astro'
|
|
11
11
|
import MenuComponent from './components/Menu/Menu.astro'
|
|
12
|
+
import ModalComponent from './components/Modal/Modal.astro'
|
|
12
13
|
import ProgressComponent from './components/Progress/Progress.astro'
|
|
13
14
|
import RadioComponent from './components/Radio/Radio.astro'
|
|
14
15
|
import RatingComponent from './components/Rating/Rating.astro'
|
|
16
|
+
import SliderComponent from './components/Slider/Slider.astro'
|
|
15
17
|
import SpinnerComponent from './components/Spinner/Spinner.astro'
|
|
16
18
|
import SwitchComponent from './components/Switch/Switch.astro'
|
|
17
19
|
import TableComponent from './components/Table/Table.astro'
|
|
@@ -32,9 +34,11 @@ export const ConditionalWrapper = ConditionalWrapperComponent
|
|
|
32
34
|
export const Icon = IconComponent
|
|
33
35
|
export const Input = InputComponent
|
|
34
36
|
export const Menu = MenuComponent
|
|
37
|
+
export const Modal = ModalComponent
|
|
35
38
|
export const Progress = ProgressComponent
|
|
36
39
|
export const Radio = RadioComponent
|
|
37
40
|
export const Rating = RatingComponent
|
|
41
|
+
export const Slider = SliderComponent
|
|
38
42
|
export const Spinner = SpinnerComponent
|
|
39
43
|
export const Switch = SwitchComponent
|
|
40
44
|
export const Table = TableComponent
|
|
@@ -1,43 +1,36 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
3
|
.accordion {
|
|
4
|
-
|
|
5
|
-
padding: 0;
|
|
4
|
+
@include spacing(0);
|
|
6
5
|
list-style-type: none;
|
|
7
6
|
|
|
8
7
|
li {
|
|
9
|
-
border
|
|
10
|
-
|
|
11
|
-
font-size: 16px;
|
|
8
|
+
@include border(primary-50, bottom);
|
|
9
|
+
@include spacing(py-sm, px-none, m0);
|
|
12
10
|
|
|
13
11
|
&:first-child {
|
|
14
12
|
padding-top: 0;
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
&:last-child {
|
|
18
|
-
border
|
|
16
|
+
@include border(bottom, 0);
|
|
19
17
|
padding-bottom: 0;
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
.title {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
@include layout(flex, h-between, v-center, sm);
|
|
22
|
+
@include typography(default, primary, left);
|
|
23
|
+
@include size('w100%');
|
|
24
|
+
@include spacing(p0);
|
|
25
|
+
@include border(0);
|
|
26
|
+
|
|
28
27
|
background: transparent;
|
|
29
|
-
border: 0;
|
|
30
|
-
color: var(--w-color-primary);
|
|
31
|
-
font-size: 16px;
|
|
32
|
-
padding: 0;
|
|
33
28
|
cursor: pointer;
|
|
34
|
-
text-align: left;
|
|
35
29
|
|
|
36
30
|
svg {
|
|
37
|
-
@include
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
height: 15px;
|
|
31
|
+
@include transition(transform);
|
|
32
|
+
@include size(15px);
|
|
33
|
+
@include typography(primary-20);
|
|
41
34
|
pointer-events: none;
|
|
42
35
|
}
|
|
43
36
|
|
|
@@ -50,22 +43,22 @@
|
|
|
50
43
|
grid-template-rows: 1fr;
|
|
51
44
|
|
|
52
45
|
.content {
|
|
53
|
-
|
|
46
|
+
@include spacing(py-sm, px-none);
|
|
54
47
|
}
|
|
55
48
|
}
|
|
56
49
|
}
|
|
57
50
|
}
|
|
58
51
|
|
|
59
52
|
.wrapper {
|
|
60
|
-
@include
|
|
61
|
-
|
|
53
|
+
@include transition(grid-template-rows);
|
|
54
|
+
@include layout(grid);
|
|
62
55
|
grid-template-rows: 0fr;
|
|
63
56
|
}
|
|
64
57
|
|
|
65
58
|
.content {
|
|
66
|
-
@include
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
@include transition();
|
|
60
|
+
@include visibility(hidden);
|
|
61
|
+
@include typography(primary-20);
|
|
69
62
|
}
|
|
70
63
|
}
|
|
71
64
|
}
|
|
@@ -1,54 +1,51 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
3
|
.w-alert {
|
|
4
|
-
border
|
|
5
|
-
border-radius
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
@include border(primary-50);
|
|
5
|
+
@include border-radius(md);
|
|
6
|
+
@include spacing(p-md);
|
|
7
|
+
@include layout(flex);
|
|
8
8
|
|
|
9
9
|
&.col {
|
|
10
|
-
|
|
10
|
+
@include layout(column);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
&:not(.col) {
|
|
14
|
-
|
|
14
|
+
@include layout(sm);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
&.info {
|
|
18
|
-
border
|
|
19
|
-
|
|
18
|
+
@include border(info);
|
|
19
|
+
@include typography(info);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
&.success {
|
|
23
|
-
border
|
|
24
|
-
|
|
23
|
+
@include border(success);
|
|
24
|
+
@include typography(success);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&.warning {
|
|
28
|
-
border
|
|
29
|
-
|
|
28
|
+
@include border(warning);
|
|
29
|
+
@include typography(warning);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
&.alert {
|
|
33
|
-
border
|
|
34
|
-
|
|
33
|
+
@include border(alert);
|
|
34
|
+
@include typography(alert);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
svg {
|
|
38
|
-
|
|
39
|
-
height: 20px;
|
|
38
|
+
@include size(20px);
|
|
40
39
|
min-width: 20px;
|
|
41
|
-
margin-top:
|
|
40
|
+
margin-top: 2.5px;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
.title {
|
|
44
|
+
@include typography(lg, hmd);
|
|
45
45
|
display: block;
|
|
46
|
-
margin-bottom: 5px;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
.body {
|
|
50
|
-
|
|
51
|
-
color: var(--w-color-primary-20);
|
|
52
|
-
line-height: 1.5;
|
|
49
|
+
@include typography(primary-20, hmd);
|
|
53
50
|
}
|
|
54
51
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../../scss/config.scss' as *;
|
|
2
|
+
|
|
3
|
+
body {
|
|
4
|
+
--w-avatar-border: var(--w-color-primary-70);
|
|
5
|
+
}
|
|
2
6
|
|
|
3
7
|
.avatar {
|
|
4
|
-
border-radius
|
|
8
|
+
@include border-radius(max);
|
|
5
9
|
|
|
6
10
|
&:not(.borderless) {
|
|
7
11
|
border: 3px solid var(--w-avatar-border);
|
|
@@ -9,14 +13,13 @@
|
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
.group {
|
|
12
|
-
|
|
13
|
-
align-items: center;
|
|
16
|
+
@include layout(inline-flex, v-center);
|
|
14
17
|
|
|
15
18
|
&.reverse {
|
|
16
|
-
|
|
19
|
+
@include layout(row-reverse);
|
|
17
20
|
|
|
18
21
|
img {
|
|
19
|
-
|
|
22
|
+
@include layer(fg);
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
img:not(:first-child) {
|
|
@@ -1,89 +1,86 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
3
|
.badge {
|
|
4
|
-
@include
|
|
5
|
-
|
|
6
|
-
border-radius
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
background: var(--w-color-primary);
|
|
12
|
-
color: var(--w-color-primary-50);
|
|
13
|
-
border: 0;
|
|
4
|
+
@include transition();
|
|
5
|
+
@include spacing(py-xs, px-sm);
|
|
6
|
+
@include border-radius(xs);
|
|
7
|
+
@include layout(inline-flex, v-center, xs);
|
|
8
|
+
@include typography(sm, primary-50);
|
|
9
|
+
@include border(0);
|
|
10
|
+
@include background(primary);
|
|
14
11
|
|
|
15
12
|
&.hover {
|
|
16
13
|
cursor: pointer;
|
|
17
14
|
|
|
18
15
|
&:hover {
|
|
19
|
-
background
|
|
16
|
+
@include background(primary-20);
|
|
20
17
|
}
|
|
21
18
|
|
|
22
19
|
&.secondary:hover {
|
|
23
|
-
background
|
|
20
|
+
@include background(primary-40);
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
&.outline:hover {
|
|
27
|
-
|
|
28
|
-
background
|
|
24
|
+
@include typography(primary);
|
|
25
|
+
@include background(transparent);
|
|
29
26
|
box-shadow: inset 0px 0px 0px 1px var(--w-color-primary);
|
|
30
27
|
}
|
|
31
28
|
|
|
32
29
|
&.flat:hover {
|
|
33
|
-
background
|
|
30
|
+
@include background(primary-40);
|
|
34
31
|
}
|
|
35
32
|
|
|
36
33
|
&.info:hover {
|
|
37
|
-
background
|
|
34
|
+
@include background(info-accent);
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
&.success:hover {
|
|
41
|
-
background
|
|
38
|
+
@include background(success-accent);
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
&.warning:hover {
|
|
45
|
-
background
|
|
42
|
+
@include background(warning-accent);
|
|
46
43
|
}
|
|
47
44
|
|
|
48
45
|
&.alert:hover {
|
|
49
|
-
background
|
|
46
|
+
@include background(alert-accent);
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
49
|
|
|
53
50
|
|
|
54
51
|
&.secondary {
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
@include typography(primary);
|
|
53
|
+
@include background(primary-50);
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
&.outline {
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
@include typography(primary-20);
|
|
58
|
+
@include background(primary-70);
|
|
62
59
|
box-shadow: inset 0px 0px 0px 1px var(--w-color-primary-20);
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
&.flat {
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
@include typography(primary);
|
|
64
|
+
@include background(primary-70);
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
&.info {
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
@include typography(info-fg);
|
|
69
|
+
@include background(info);
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
&.success {
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
@include typography(success-fg);
|
|
74
|
+
@include background(success);
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
&.warning {
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
@include typography(warning-fg);
|
|
79
|
+
@include background(warning);
|
|
83
80
|
}
|
|
84
81
|
|
|
85
82
|
&.alert {
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
@include typography(alert-fg);
|
|
84
|
+
@include background(alert);
|
|
88
85
|
}
|
|
89
86
|
}
|
|
@@ -8,7 +8,6 @@ interface Props extends ButtonProps {}
|
|
|
8
8
|
|
|
9
9
|
const {
|
|
10
10
|
theme,
|
|
11
|
-
bold,
|
|
12
11
|
href,
|
|
13
12
|
className,
|
|
14
13
|
...rest
|
|
@@ -16,7 +15,6 @@ const {
|
|
|
16
15
|
|
|
17
16
|
const classes = classNames([
|
|
18
17
|
styles.button,
|
|
19
|
-
bold && styles.bold,
|
|
20
18
|
theme && styles[theme],
|
|
21
19
|
className
|
|
22
20
|
])
|
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
import { classNames } from '../../utils/classNames'
|
|
6
6
|
|
|
7
7
|
export let theme: SvelteButtonProps['theme'] = null
|
|
8
|
-
export let bold: SvelteButtonProps['bold'] = false
|
|
9
8
|
export let href: SvelteButtonProps['href'] = ''
|
|
10
9
|
export let className: SvelteButtonProps['className'] = ''
|
|
11
10
|
export let onClick: SvelteButtonProps['onClick'] = () => {}
|
|
12
11
|
|
|
13
12
|
const classes = classNames([
|
|
14
13
|
styles.button,
|
|
15
|
-
bold && styles.bold,
|
|
16
14
|
theme && styles[theme],
|
|
17
15
|
className
|
|
18
16
|
])
|
|
@@ -6,7 +6,6 @@ import { classNames } from '../../utils/classNames'
|
|
|
6
6
|
|
|
7
7
|
const Button = ({
|
|
8
8
|
theme,
|
|
9
|
-
bold,
|
|
10
9
|
href,
|
|
11
10
|
className,
|
|
12
11
|
onClick,
|
|
@@ -15,7 +14,6 @@ const Button = ({
|
|
|
15
14
|
}: ReactButtonProps) => {
|
|
16
15
|
const classes = classNames([
|
|
17
16
|
styles.button,
|
|
18
|
-
bold && styles.bold,
|
|
19
17
|
theme && styles[theme],
|
|
20
18
|
className
|
|
21
19
|
])
|
|
@@ -1,94 +1,87 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
3
|
.button {
|
|
4
|
-
@include
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
@include layout(inline-flex, center, xs);
|
|
5
|
+
@include typography(default, primary-50, none);
|
|
6
|
+
@include spacing(py-sm, px-md);
|
|
7
|
+
@include border-radius(xs);
|
|
8
|
+
@include border(0);
|
|
9
|
+
@include transition();
|
|
10
|
+
@include background(primary);
|
|
11
|
+
|
|
12
12
|
cursor: pointer;
|
|
13
|
-
border: 0;
|
|
14
|
-
background: var(--w-color-primary);
|
|
15
|
-
color: var(--w-color-primary-50);
|
|
16
13
|
|
|
17
14
|
&[disabled] {
|
|
18
15
|
cursor: no-drop;
|
|
19
|
-
background
|
|
16
|
+
@include background(primary-20);
|
|
20
17
|
}
|
|
21
18
|
|
|
22
19
|
&:hover {
|
|
23
|
-
background
|
|
20
|
+
@include background(primary-20);
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
&.secondary {
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
@include typography(primary);
|
|
25
|
+
@include background(primary-50);
|
|
29
26
|
|
|
30
27
|
&:hover {
|
|
31
|
-
background
|
|
28
|
+
@include background(primary-40);
|
|
32
29
|
}
|
|
33
30
|
}
|
|
34
31
|
|
|
35
32
|
&.outline {
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
@include typography(primary-20);
|
|
34
|
+
@include background(transparent);
|
|
38
35
|
box-shadow: inset 0px 0px 0px 1px var(--w-color-primary-20);
|
|
39
36
|
|
|
40
37
|
&:hover {
|
|
41
|
-
|
|
38
|
+
@include typography(primary);
|
|
42
39
|
box-shadow: inset 0px 0px 0px 1px var(--w-color-primary);
|
|
43
40
|
}
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
&.flat {
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
@include typography(primary);
|
|
45
|
+
@include background(transparent);
|
|
49
46
|
|
|
50
47
|
&:hover {
|
|
51
|
-
background
|
|
48
|
+
@include background(primary-40);
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
&.info {
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
@include typography(info-fg);
|
|
54
|
+
@include background(info);
|
|
58
55
|
|
|
59
56
|
&:hover {
|
|
60
|
-
background
|
|
57
|
+
@include background(info-accent);
|
|
61
58
|
}
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
&.success {
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
@include typography(success-fg);
|
|
63
|
+
@include background(success);
|
|
67
64
|
|
|
68
65
|
&:hover {
|
|
69
|
-
background
|
|
66
|
+
@include background(success-accent);
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
69
|
|
|
73
70
|
&.warning {
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
@include typography(warning-fg);
|
|
72
|
+
@include background(warning);
|
|
76
73
|
|
|
77
74
|
&:hover {
|
|
78
|
-
background
|
|
75
|
+
@include background(warning-accent);
|
|
79
76
|
}
|
|
80
77
|
}
|
|
81
78
|
|
|
82
79
|
&.alert {
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
@include typography(alert-fg);
|
|
81
|
+
@include background(alert);
|
|
85
82
|
|
|
86
83
|
&:hover {
|
|
87
|
-
background
|
|
84
|
+
@include background(alert-accent);
|
|
88
85
|
}
|
|
89
86
|
}
|
|
90
|
-
|
|
91
|
-
&.bold {
|
|
92
|
-
font-family: Bold;
|
|
93
|
-
}
|
|
94
87
|
}
|
|
@@ -7,7 +7,6 @@ export type ButtonProps = {
|
|
|
7
7
|
| 'warning'
|
|
8
8
|
| 'alert'
|
|
9
9
|
| null
|
|
10
|
-
bold?: boolean
|
|
11
10
|
href?: string
|
|
12
11
|
className?: string
|
|
13
12
|
[key: string]: any
|
|
@@ -19,5 +18,5 @@ export type SvelteButtonProps = {
|
|
|
19
18
|
|
|
20
19
|
export type ReactButtonProps = {
|
|
21
20
|
onClick?: () => any
|
|
22
|
-
children
|
|
21
|
+
children?: React.ReactNode
|
|
23
22
|
} & ButtonProps
|