@likable-hair/svelte 2.0.8 → 3.0.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/dist/components/composed/search/GlobalSearchTextField.css +11 -0
- package/dist/components/composed/search/GlobalSearchTextField.svelte +52 -30
- package/dist/components/composed/search/GlobalSearchTextField.svelte.d.ts +6 -9
- package/dist/components/composed/search/SearchBar.css +10 -0
- package/dist/components/composed/search/SearchBar.svelte +43 -20
- package/dist/components/composed/search/SearchBar.svelte.d.ts +6 -9
- package/dist/components/composed/search/SearchResults.css +5 -0
- package/dist/components/composed/search/SearchResults.svelte +45 -23
- package/dist/components/composed/search/SearchResults.svelte.d.ts +7 -8
- package/dist/components/layouts/CollapsibleSideBarLayout.css +5 -0
- package/dist/components/layouts/CollapsibleSideBarLayout.svelte +6 -7
- package/dist/components/layouts/NewCollapsibleSideBarLayout.svelte +155 -0
- package/dist/components/layouts/NewCollapsibleSideBarLayout.svelte.d.ts +38 -0
- package/dist/components/layouts/StableDividedSideBarLayout.css +16 -0
- package/dist/components/layouts/StableDividedSideBarLayout.svelte +81 -31
- package/dist/components/layouts/StableDividedSideBarLayout.svelte.d.ts +7 -10
- package/dist/components/simple/buttons/Button.css +18 -0
- package/dist/components/simple/buttons/Button.svelte +150 -50
- package/dist/components/simple/buttons/Button.svelte.d.ts +5 -25
- package/dist/components/simple/buttons/LinkButton.css +13 -0
- package/dist/components/simple/buttons/LinkButton.svelte +48 -25
- package/dist/components/simple/buttons/LinkButton.svelte.d.ts +2 -11
- package/dist/components/simple/common/CollapsibleDivider.css +14 -0
- package/dist/components/simple/common/CollapsibleDivider.svelte +81 -25
- package/dist/components/simple/common/CollapsibleDivider.svelte.d.ts +1 -11
- package/dist/components/simple/common/Menu.svelte +32 -2
- package/dist/components/simple/common/Menu.svelte.d.ts +1 -0
- package/dist/components/simple/dates/Calendar.css +10 -0
- package/dist/components/simple/dates/Calendar.svelte +52 -17
- package/dist/components/simple/dates/Calendar.svelte.d.ts +7 -10
- package/dist/components/simple/dates/DatePicker.css +9 -0
- package/dist/components/simple/dates/DatePicker.svelte +74 -55
- package/dist/components/simple/dates/DatePicker.svelte.d.ts +15 -11
- package/dist/components/simple/dates/DatePickerTextField.svelte +148 -0
- package/dist/components/simple/dates/DatePickerTextField.svelte.d.ts +28 -0
- package/dist/components/simple/dates/MonthSelector.css +4 -0
- package/dist/components/simple/dates/MonthSelector.svelte +20 -9
- package/dist/components/simple/dates/MonthSelector.svelte.d.ts +5 -4
- package/dist/components/simple/dates/YearSelector.css +4 -0
- package/dist/components/simple/dates/YearSelector.svelte +23 -10
- package/dist/components/simple/dates/YearSelector.svelte.d.ts +3 -2
- package/dist/components/simple/forms/Autocomplete.css +12 -0
- package/dist/components/simple/forms/Autocomplete.svelte +101 -50
- package/dist/components/simple/forms/Autocomplete.svelte.d.ts +7 -29
- package/dist/components/simple/forms/SimpleTextField.css +17 -0
- package/dist/components/simple/forms/SimpleTextField.svelte +110 -44
- package/dist/components/simple/forms/SimpleTextField.svelte.d.ts +13 -22
- package/dist/components/simple/lists/SelectableMenuList.css +7 -0
- package/dist/components/simple/lists/SelectableMenuList.svelte +107 -0
- package/dist/components/simple/lists/SelectableMenuList.svelte.d.ts +38 -0
- package/dist/components/simple/lists/SelectableVerticalList.svelte +1 -1
- package/dist/components/simple/lists/SidebarMenuList.css +7 -0
- package/dist/components/simple/lists/SidebarMenuList.svelte +43 -15
- package/dist/components/simple/lists/SidebarMenuList.svelte.d.ts +1 -0
- package/dist/components/simple/loaders/CircularLoader.css +5 -0
- package/dist/components/simple/loaders/CircularLoader.svelte +20 -4
- package/dist/components/simple/loaders/CircularLoader.svelte.d.ts +2 -3
- package/dist/components/simple/media/Icon.svelte +18 -7
- package/dist/components/simple/media/Icon.svelte.d.ts +0 -2
- package/dist/components/simple/navigation/Chip.css +14 -0
- package/dist/components/simple/navigation/Chip.svelte +74 -15
- package/dist/components/simple/navigation/Chip.svelte.d.ts +2 -3
- package/dist/components/simple/navigation/Drawer.css +9 -0
- package/dist/components/simple/navigation/Drawer.svelte +81 -74
- package/dist/components/simple/navigation/Drawer.svelte.d.ts +1 -8
- package/dist/components/simple/navigation/HeaderMenu.css +3 -0
- package/dist/components/simple/navigation/HeaderMenu.svelte +39 -63
- package/dist/components/simple/navigation/HeaderMenu.svelte.d.ts +5 -9
- package/dist/components/simple/notifiers/AlertBanner.css +9 -0
- package/dist/components/simple/notifiers/AlertBanner.svelte +21 -22
- package/dist/components/simple/notifiers/AlertBanner.svelte.d.ts +6 -9
- package/dist/components/simple/timeline/SimpleTimeLine.svelte.d.ts +1 -1
- package/dist/components/simple/typography/Code.svelte.d.ts +1 -1
- package/dist/css/main.css +261 -0
- package/dist/stores/theme.d.ts +30 -0
- package/dist/stores/theme.js +85 -0
- package/package.json +6 -3
- package/dist/components/simple/buttons/DefaultButton.svelte +0 -93
- package/dist/components/simple/buttons/DefaultButton.svelte.d.ts +0 -50
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import './CollapsibleSideBarLayout.css';
|
|
3
|
+
import type { MenuItem } from "../simple/lists/SelectableMenuList.svelte";
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
drawerOpened?: boolean | undefined;
|
|
7
|
+
drawerCollapsed?: boolean | undefined;
|
|
8
|
+
menuItems?: MenuItem[] | undefined;
|
|
9
|
+
selectedMenuElementName?: string | undefined;
|
|
10
|
+
fullLogo?: string | undefined;
|
|
11
|
+
partialLogo?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
events: {
|
|
14
|
+
'drawer-change': CustomEvent<{
|
|
15
|
+
opened: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
collapse: CustomEvent<{
|
|
18
|
+
collapsed: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
'menu-select': CustomEvent<{
|
|
21
|
+
menu: MenuItem;
|
|
22
|
+
}>;
|
|
23
|
+
} & {
|
|
24
|
+
[evt: string]: CustomEvent<any>;
|
|
25
|
+
};
|
|
26
|
+
slots: {
|
|
27
|
+
logo: {
|
|
28
|
+
collapsed: boolean;
|
|
29
|
+
};
|
|
30
|
+
default: {};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export type NewCollapsibleSideBarLayoutProps = typeof __propDef.props;
|
|
34
|
+
export type NewCollapsibleSideBarLayoutEvents = typeof __propDef.events;
|
|
35
|
+
export type NewCollapsibleSideBarLayoutSlots = typeof __propDef.slots;
|
|
36
|
+
export default class NewCollapsibleSideBarLayout extends SvelteComponentTyped<NewCollapsibleSideBarLayoutProps, NewCollapsibleSideBarLayoutEvents, NewCollapsibleSideBarLayoutSlots> {
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--stable-divided-side-bar-layout-default-content-padding: 1rem 2rem 1rem 2rem;
|
|
3
|
+
--stable-divided-side-bar-layout-default-side-bar-width: 18rem;
|
|
4
|
+
--stable-divided-side-bar-layout-default-side-bar-border-color:
|
|
5
|
+
rgb(var(--global-color-grey-500));
|
|
6
|
+
--stable-divided-side-bar-layout-default-side-bar-padding: 1rem 1.5rem 2rem 1.5rem;
|
|
7
|
+
--stable-divided-side-bar-layout-default-header-menu-height: 3.5rem;
|
|
8
|
+
--stable-divided-side-bar-layout-default-header-menu-border-color:
|
|
9
|
+
rgb(var(--global-color-grey-500));
|
|
10
|
+
--stable-divided-side-bar-layout-default-header-menu-padding: 0rem 2rem 0rem 2rem;
|
|
11
|
+
--stable-divided-side-bar-layout-default-inner-header-menu-background-color:
|
|
12
|
+
rgb(var(--global-color-background-100), .5);
|
|
13
|
+
--stable-divided-side-bar-layout-default-drawer-background-color:
|
|
14
|
+
rgb(var(--global-color-background-50));
|
|
15
|
+
--stable-divided-side-bar-layout-default-drawer-width: 24rem;
|
|
16
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import "./StableDividedSideBarLayout.css";
|
|
2
|
+
import MediaQuery from "../simple/common/MediaQuery.svelte";
|
|
2
3
|
import Icon from "../simple/media/Icon.svelte";
|
|
3
4
|
import { createEventDispatcher } from "svelte";
|
|
4
|
-
|
|
5
|
+
let clazz = {};
|
|
6
|
+
export { clazz as class };
|
|
7
|
+
export let drawerOpened = false;
|
|
5
8
|
let dispatch = createEventDispatcher();
|
|
6
9
|
function toggleMenu() {
|
|
7
10
|
drawerOpened = !drawerOpened;
|
|
@@ -15,18 +18,10 @@ function handleOverlayClick() {
|
|
|
15
18
|
|
|
16
19
|
<MediaQuery let:mAndDown>
|
|
17
20
|
<div
|
|
18
|
-
|
|
19
|
-
style:--stable-divider-side-bar-layout-side-bar-border-color={sideBarBorderColor}
|
|
20
|
-
style:--stable-divider-side-bar-layout-side-bar-padding={sideBarPadding}
|
|
21
|
-
style:--stable-divider-side-bar-layout-header-menu-height={headerMenuHeight}
|
|
22
|
-
style:--stable-divider-side-bar-layout-header-menu-border-color={headerMenuBorderColor}
|
|
23
|
-
style:--stable-divider-side-bar-layout-header-menu-padding={headerMenuPadding}
|
|
24
|
-
style:--stable-divider-side-bar-layout-inner-header-menu-background-color={innerHeaderMenuBackgroundColor}
|
|
25
|
-
style:--stable-divider-side-bar-layout-drawer-background-color={drawerBackgroundColor}
|
|
26
|
-
style:--stable-divider-side-bar-layout-drawer-width={drawerWidth}
|
|
21
|
+
class={clazz.container || ''}
|
|
27
22
|
>
|
|
28
23
|
<header
|
|
29
|
-
class="side-bar"
|
|
24
|
+
class="side-bar {clazz.header}"
|
|
30
25
|
class:opened={drawerOpened}
|
|
31
26
|
>
|
|
32
27
|
<div
|
|
@@ -56,15 +51,15 @@ function handleOverlayClick() {
|
|
|
56
51
|
</slot>
|
|
57
52
|
</div>
|
|
58
53
|
</header>
|
|
59
|
-
<div class="main-section">
|
|
54
|
+
<div class="main-section {clazz.mainSection || ''}">
|
|
60
55
|
<div
|
|
61
|
-
class="overlay"
|
|
56
|
+
class="overlay {clazz.overlay || ''}"
|
|
62
57
|
on:click={handleOverlayClick}
|
|
63
58
|
on:keypress={handleOverlayClick}
|
|
64
59
|
class:visible={drawerOpened}
|
|
65
60
|
></div>
|
|
66
61
|
<div
|
|
67
|
-
|
|
62
|
+
class="content"
|
|
68
63
|
class:blurred={drawerOpened}
|
|
69
64
|
>
|
|
70
65
|
<slot>Content</slot>
|
|
@@ -77,13 +72,22 @@ function handleOverlayClick() {
|
|
|
77
72
|
<style>
|
|
78
73
|
.side-bar {
|
|
79
74
|
position: fixed;
|
|
80
|
-
width: var(
|
|
81
|
-
|
|
75
|
+
width: var(
|
|
76
|
+
--stable-divided-side-bar-layout-side-bar-width,
|
|
77
|
+
var(--stable-divided-side-bar-layout-default-side-bar-width)
|
|
78
|
+
);
|
|
79
|
+
border-right: 1px solid var(
|
|
80
|
+
--stable-divided-side-bar-layout-side-bar-border-color,
|
|
81
|
+
var(--stable-divided-side-bar-layout-default-side-bar-border-color)
|
|
82
|
+
);
|
|
82
83
|
top: 0;
|
|
83
84
|
bottom: 0;
|
|
84
85
|
left: 0;
|
|
85
86
|
right: 0;
|
|
86
|
-
padding: var(
|
|
87
|
+
padding: var(
|
|
88
|
+
--stable-divided-side-bar-layout-side-bar-padding,
|
|
89
|
+
var(--stable-divided-side-bar-layout-default-side-bar-padding)
|
|
90
|
+
);
|
|
87
91
|
z-index: 10;
|
|
88
92
|
}
|
|
89
93
|
|
|
@@ -91,18 +95,37 @@ function handleOverlayClick() {
|
|
|
91
95
|
display: none;
|
|
92
96
|
}
|
|
93
97
|
|
|
98
|
+
.content {
|
|
99
|
+
padding: var(
|
|
100
|
+
--stable-divided-side-bar-layout-content-padding,
|
|
101
|
+
var(--stable-divided-side-bar-layout-default-content-padding)
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
94
105
|
@media (max-width: 1024px) {
|
|
95
106
|
.side-bar {
|
|
96
|
-
left: calc(0rem - var(
|
|
107
|
+
left: calc(0rem - var(
|
|
108
|
+
--stable-divided-side-bar-layout-drawer-width,
|
|
109
|
+
var(--stable-divided-side-bar-layout-default-drawer-width)
|
|
110
|
+
)
|
|
111
|
+
);
|
|
97
112
|
right: auto;
|
|
98
113
|
transition-property: left;
|
|
99
114
|
transition-timing-function: cubic-bezier(.4,0,.2,1);
|
|
100
115
|
transition-duration: .5s;
|
|
101
|
-
top: var(--stable-
|
|
102
|
-
|
|
116
|
+
top: var(--stable-divided-side-bar-layout-header-menu-height,
|
|
117
|
+
var(--stable-divided-side-bar-layout-default-header-menu-height)
|
|
118
|
+
);
|
|
119
|
+
background-color: var(
|
|
120
|
+
--stable-divided-side-bar-layout-drawer-background-color,
|
|
121
|
+
var(--stable-divided-side-bar-layout-default-drawer-background-color)
|
|
122
|
+
);
|
|
103
123
|
bottom: 0;
|
|
104
124
|
z-index: 30;
|
|
105
|
-
width: var(
|
|
125
|
+
width: var(
|
|
126
|
+
--stable-divided-side-bar-layout-drawer-width,
|
|
127
|
+
var(--stable-divided-side-bar-layout-default-drawer-width)
|
|
128
|
+
);
|
|
106
129
|
max-width: 100vw;
|
|
107
130
|
}
|
|
108
131
|
|
|
@@ -112,7 +135,10 @@ function handleOverlayClick() {
|
|
|
112
135
|
|
|
113
136
|
.overlay {
|
|
114
137
|
position: fixed;
|
|
115
|
-
top: var(
|
|
138
|
+
top: var(
|
|
139
|
+
--stable-divided-side-bar-layout-header-menu-height,
|
|
140
|
+
var(--stable-divided-side-bar-layout-default-header-menu-height)
|
|
141
|
+
);
|
|
116
142
|
left: 0;
|
|
117
143
|
bottom: 0;
|
|
118
144
|
right: 0;
|
|
@@ -132,11 +158,23 @@ function handleOverlayClick() {
|
|
|
132
158
|
|
|
133
159
|
.header-toolbar {
|
|
134
160
|
position: fixed;
|
|
135
|
-
height: var(
|
|
136
|
-
|
|
137
|
-
|
|
161
|
+
height: var(
|
|
162
|
+
--stable-divided-side-bar-layout-header-menu-height,
|
|
163
|
+
var(--stable-divided-side-bar-layout-default-header-menu-height)
|
|
164
|
+
);
|
|
165
|
+
left: var(
|
|
166
|
+
--stable-divided-side-bar-layout-side-bar-width,
|
|
167
|
+
var(--stable-divided-side-bar-layout-default-side-bar-width)
|
|
168
|
+
);
|
|
169
|
+
border-bottom: 1px solid var(
|
|
170
|
+
--stable-divided-side-bar-layout-header-menu-border-color,
|
|
171
|
+
var(--stable-divided-side-bar-layout-default-header-menu-border-color)
|
|
172
|
+
);
|
|
138
173
|
backdrop-filter: blur(4px);
|
|
139
|
-
background-color: var(
|
|
174
|
+
background-color: var(
|
|
175
|
+
--stable-divided-side-bar-layout-inner-header-menu-background-color,
|
|
176
|
+
var(--stable-divided-side-bar-layout-default-inner-header-menu-background-color)
|
|
177
|
+
);
|
|
140
178
|
transition-property: background-color;
|
|
141
179
|
transition-timing-function: cubic-bezier(.4,0,.2,1);
|
|
142
180
|
transition-duration: .5s;
|
|
@@ -159,8 +197,14 @@ function handleOverlayClick() {
|
|
|
159
197
|
}
|
|
160
198
|
|
|
161
199
|
.main-section {
|
|
162
|
-
padding-left: var(
|
|
163
|
-
|
|
200
|
+
padding-left: var(
|
|
201
|
+
--stable-divided-side-bar-layout-side-bar-width,
|
|
202
|
+
var(--stable-divided-side-bar-layout-default-side-bar-width)
|
|
203
|
+
);
|
|
204
|
+
padding-top: var(
|
|
205
|
+
--stable-divided-side-bar-layout-header-menu-height,
|
|
206
|
+
var(--stable-divided-side-bar-layout-default-header-menu-height,)
|
|
207
|
+
);
|
|
164
208
|
}
|
|
165
209
|
|
|
166
210
|
@media (max-width: 1024px) {
|
|
@@ -174,8 +218,14 @@ function handleOverlayClick() {
|
|
|
174
218
|
}
|
|
175
219
|
|
|
176
220
|
.inner-menu {
|
|
177
|
-
padding: var(
|
|
178
|
-
|
|
221
|
+
padding: var(
|
|
222
|
+
--stable-divided-side-bar-layout-header-menu-padding,
|
|
223
|
+
var(--stable-divided-side-bar-layout-default-header-menu-padding)
|
|
224
|
+
);
|
|
225
|
+
background-color: var(
|
|
226
|
+
--stable-divided-side-bar-layout-inner-header-menu-background-color,
|
|
227
|
+
var(--stable-divided-side-bar-layout-default-inner-header-menu-background-color)
|
|
228
|
+
);
|
|
179
229
|
height: 100%;
|
|
180
230
|
display: flex;
|
|
181
231
|
align-items: center;
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import './StableDividedSideBarLayout.css';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
padding?: string | undefined;
|
|
11
|
-
innerHeaderMenuBackgroundColor?: string | undefined;
|
|
12
|
-
drawerBackgroundColor?: string | undefined;
|
|
13
|
-
drawerWidth?: string | undefined;
|
|
5
|
+
class?: {
|
|
6
|
+
container?: string | undefined;
|
|
7
|
+
header?: string | undefined;
|
|
8
|
+
mainSection?: string | undefined;
|
|
9
|
+
overlay?: string | undefined;
|
|
10
|
+
} | undefined;
|
|
14
11
|
drawerOpened?: boolean | undefined;
|
|
15
12
|
};
|
|
16
13
|
events: {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--button-default-text-align: center;
|
|
3
|
+
--button-default-cursor: pointer;
|
|
4
|
+
--button-default-padding: 8px;
|
|
5
|
+
--button-default-border-radius: .5rem;
|
|
6
|
+
--button-default-icon-border-radius: 9999px;
|
|
7
|
+
--button-default-color: rgb(var(--global-color-grey-50));
|
|
8
|
+
--button-default-text-color: rgb(var(--global-color-contrast-900));
|
|
9
|
+
--button-default-icon-color: rgb(var(--global-color-contrast-900));
|
|
10
|
+
--button-default-background-color: rgb(var(--global-color-primary-500));
|
|
11
|
+
--button-default-hover-background-color: rgb(var(--global-color-primary-600));
|
|
12
|
+
--button-default-text-background-color: transparent;
|
|
13
|
+
--button-default-text-hover-background-color: rgb(var(--global-color-primary-500), 0.2);
|
|
14
|
+
--button-default-active-background-color: rgb(var(--global-color-primary-500));
|
|
15
|
+
--button-default-text-active-background-color: rgb(var(--global-color-primary-500), 0.4);
|
|
16
|
+
--button-default-box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.3);
|
|
17
|
+
--button-default-text-font-weight: 600;
|
|
18
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script>import "./Button.css";
|
|
2
|
+
let clazz = "";
|
|
3
|
+
export { clazz as class };
|
|
4
|
+
export let buttonType = "default", type = "button", loading = false, icon = void 0, tabindex = null, disabled = false;
|
|
2
5
|
import { createEventDispatcher } from "svelte";
|
|
3
6
|
const dispatch = createEventDispatcher();
|
|
4
7
|
function handleClick(event) {
|
|
@@ -15,59 +18,36 @@ function handleKeyPress(event) {
|
|
|
15
18
|
nativeEvent: event
|
|
16
19
|
});
|
|
17
20
|
}
|
|
18
|
-
$:
|
|
19
|
-
defaultBorderRadius = type == "icon" ? "50%" : "5px";
|
|
20
21
|
$:
|
|
21
22
|
position = $$slots.append ? "relative" : void 0;
|
|
22
23
|
import Icon from "../media/Icon.svelte";
|
|
23
24
|
import CircularLoader from "../loaders/CircularLoader.svelte";
|
|
24
25
|
</script>
|
|
25
26
|
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
style:max-width={maxWidth}
|
|
29
|
-
style:min-width={minWidth}
|
|
30
|
-
style:height
|
|
31
|
-
style:max-height={maxHeight}
|
|
32
|
-
style:min-height={minHeight}
|
|
33
|
-
style:text-align={textAlign}
|
|
27
|
+
<button
|
|
28
|
+
type={type}
|
|
34
29
|
style:position
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
style:display
|
|
40
|
-
style:justify-content={justifyContent}
|
|
41
|
-
style:align-items={alignItems}
|
|
42
|
-
style:--button-border={border}
|
|
43
|
-
style:--button-border-radius={borderRadius
|
|
44
|
-
? borderRadius
|
|
45
|
-
: defaultBorderRadius}
|
|
46
|
-
style:--button-background-color={active
|
|
47
|
-
? activeBackgroundColor
|
|
48
|
-
: backgroundColor}
|
|
49
|
-
style:--button-hover-background-color={hoverBackgroundColor}
|
|
50
|
-
style:--button-box-shadow={boxShadow}
|
|
51
|
-
style:--button-icon-height={iconSize + 5 + "pt"}
|
|
52
|
-
style:--button-icon-width={iconSize + 5 + "pt"}
|
|
53
|
-
class="button no-select"
|
|
54
|
-
class:button-default={type === "default"}
|
|
55
|
-
class:button-text={type === "text"}
|
|
56
|
-
class:button-icon={type === "icon"}
|
|
30
|
+
class="button no-select {clazz || ''}"
|
|
31
|
+
class:button-default={buttonType === "default"}
|
|
32
|
+
class:button-text={buttonType === "text"}
|
|
33
|
+
class:button-icon={buttonType === "icon"}
|
|
57
34
|
on:click={handleClick}
|
|
58
35
|
on:keypress={handleKeyPress}
|
|
36
|
+
tabindex={tabindex}
|
|
59
37
|
>
|
|
60
38
|
{#if loading}
|
|
61
39
|
<div
|
|
62
|
-
style:height={'calc(' + loaderHeight + ' + .6rem)'}
|
|
63
40
|
style:display="flex"
|
|
41
|
+
style:justify-content="center"
|
|
64
42
|
style:align-items="center"
|
|
65
43
|
>
|
|
66
|
-
<CircularLoader
|
|
44
|
+
<CircularLoader
|
|
45
|
+
--circular-loader-color="var(--button-color)"
|
|
46
|
+
/>
|
|
67
47
|
</div>
|
|
68
48
|
{:else}
|
|
69
49
|
{#if !!icon}
|
|
70
|
-
<Icon name={icon}
|
|
50
|
+
<Icon name={icon} />
|
|
71
51
|
{:else}
|
|
72
52
|
<slot />
|
|
73
53
|
{/if}
|
|
@@ -77,7 +57,7 @@ import CircularLoader from "../loaders/CircularLoader.svelte";
|
|
|
77
57
|
</span>
|
|
78
58
|
{/if}
|
|
79
59
|
{/if}
|
|
80
|
-
</
|
|
60
|
+
</button>
|
|
81
61
|
|
|
82
62
|
<style>
|
|
83
63
|
.append-item {
|
|
@@ -87,48 +67,168 @@ import CircularLoader from "../loaders/CircularLoader.svelte";
|
|
|
87
67
|
|
|
88
68
|
.button {
|
|
89
69
|
overflow: hidden;
|
|
70
|
+
box-sizing: content-box;
|
|
90
71
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
72
|
+
width: var(
|
|
73
|
+
--button-width,
|
|
74
|
+
var(--button-default-width)
|
|
75
|
+
);
|
|
76
|
+
max-width: var(
|
|
77
|
+
--button-max-width,
|
|
78
|
+
var(--button-default-max-width)
|
|
79
|
+
);
|
|
80
|
+
min-width: var(
|
|
81
|
+
--button-min-width,
|
|
82
|
+
var(--button-default-min-width)
|
|
83
|
+
);
|
|
84
|
+
height: var(
|
|
85
|
+
--button-height,
|
|
86
|
+
var(--button-default-height)
|
|
87
|
+
);
|
|
88
|
+
max-height: var(
|
|
89
|
+
--button-max-height,
|
|
90
|
+
var(--button-default-max-height)
|
|
91
|
+
);
|
|
92
|
+
min-height: var(
|
|
93
|
+
--button-min-height,
|
|
94
|
+
var(--button-default-min-height)
|
|
95
|
+
);
|
|
96
|
+
text-align: var(
|
|
97
|
+
--button-text-align,
|
|
98
|
+
var(--button-default-text-align)
|
|
99
|
+
);
|
|
100
|
+
cursor: var(
|
|
101
|
+
--button-cursor,
|
|
102
|
+
var(--button-default-cursor)
|
|
103
|
+
);
|
|
104
|
+
padding: var(
|
|
105
|
+
--button-padding,
|
|
106
|
+
var(--button-default-padding)
|
|
107
|
+
);
|
|
108
|
+
font-size: var(
|
|
109
|
+
--button-font-size,
|
|
110
|
+
var(--button-default-font-size)
|
|
111
|
+
);
|
|
112
|
+
display: var(
|
|
113
|
+
--button-display,
|
|
114
|
+
var(--button-default-display)
|
|
115
|
+
);
|
|
116
|
+
justify-content: var(
|
|
117
|
+
--button-justify-content,
|
|
118
|
+
var(--button-default-justify-content)
|
|
119
|
+
);
|
|
120
|
+
align-items: var(
|
|
121
|
+
--button-align-items,
|
|
122
|
+
var(--button-default-align-items)
|
|
123
|
+
);
|
|
124
|
+
border: var(
|
|
125
|
+
--button-border,
|
|
126
|
+
var(--button-default-border)
|
|
127
|
+
);
|
|
91
128
|
}
|
|
92
129
|
|
|
93
130
|
.button-default {
|
|
94
131
|
transition: background-color 200ms;
|
|
95
|
-
background-color: var(--button-background-color);
|
|
96
132
|
outline: 0;
|
|
97
|
-
border: var(
|
|
98
|
-
|
|
99
|
-
|
|
133
|
+
border-radius: var(
|
|
134
|
+
--button-border-radius,
|
|
135
|
+
var(--button-default-border-radius)
|
|
136
|
+
);
|
|
137
|
+
box-shadow: var(
|
|
138
|
+
--button-box-shadow,
|
|
139
|
+
var(--button-default-box-shadow)
|
|
140
|
+
);
|
|
141
|
+
background-color: var(
|
|
142
|
+
--button-background-color,
|
|
143
|
+
var(--button-default-background-color)
|
|
144
|
+
);
|
|
145
|
+
color: var(
|
|
146
|
+
--button-color,
|
|
147
|
+
var(--button-default-color)
|
|
148
|
+
);
|
|
149
|
+
font-weight: var(
|
|
150
|
+
--button-font-weight,
|
|
151
|
+
var(--button-default-font-weight)
|
|
152
|
+
);
|
|
100
153
|
}
|
|
101
154
|
|
|
102
155
|
.button-default:hover {
|
|
103
156
|
background-color: var(
|
|
104
157
|
--button-hover-background-color,
|
|
105
|
-
var(--button-background-color)
|
|
158
|
+
var(--button-default-hover-background-color)
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.button-default:active {
|
|
163
|
+
background-color: var(
|
|
164
|
+
--button-active-background-color,
|
|
165
|
+
var(--button-default-active-background-color)
|
|
106
166
|
);
|
|
107
167
|
}
|
|
108
168
|
|
|
109
169
|
.button-text {
|
|
110
170
|
transition: background-color 200ms;
|
|
111
171
|
text-transform: uppercase;
|
|
112
|
-
|
|
172
|
+
letter-spacing: .05rem;
|
|
113
173
|
outline: 0;
|
|
114
|
-
border: var(
|
|
115
|
-
|
|
174
|
+
border-radius: var(
|
|
175
|
+
--button-border-radius,
|
|
176
|
+
var(--button-default-border-radius)
|
|
177
|
+
);
|
|
178
|
+
color: var(
|
|
179
|
+
--button-color,
|
|
180
|
+
var(--button-default-text-color)
|
|
181
|
+
);
|
|
182
|
+
background-color: var(
|
|
183
|
+
--button-background-color,
|
|
184
|
+
var(--button-default-text-background-color)
|
|
185
|
+
);
|
|
186
|
+
font-weight: var(
|
|
187
|
+
--button-font-weight,
|
|
188
|
+
var(--button-default-text-font-weight)
|
|
189
|
+
);
|
|
116
190
|
}
|
|
117
191
|
|
|
118
192
|
.button-text:hover {
|
|
119
|
-
background-color: var(
|
|
193
|
+
background-color: var(
|
|
194
|
+
--button-hover-background-color,
|
|
195
|
+
var(--button-default-text-hover-background-color)
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.button-text:active {
|
|
200
|
+
background-color: var(
|
|
201
|
+
--button-active-background-color,
|
|
202
|
+
var(--button-default-text-active-background-color)
|
|
203
|
+
);
|
|
120
204
|
}
|
|
121
205
|
|
|
122
206
|
.button-icon {
|
|
123
207
|
transition: background-color 200ms;
|
|
124
208
|
outline: 0;
|
|
125
|
-
border: var(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
209
|
+
border-radius: var(
|
|
210
|
+
--button-border-radius,
|
|
211
|
+
var(--button-default--icon-border-radius)
|
|
212
|
+
);
|
|
129
213
|
display: flex;
|
|
130
214
|
align-items: center;
|
|
131
215
|
justify-content: center;
|
|
216
|
+
background-color: var(
|
|
217
|
+
--button-background-color,
|
|
218
|
+
var(--button-default-background-color)
|
|
219
|
+
);
|
|
220
|
+
color: var(
|
|
221
|
+
--button-color,
|
|
222
|
+
var(--button-default-icon-color)
|
|
223
|
+
);
|
|
224
|
+
font-weight: var(
|
|
225
|
+
--button-font-weight,
|
|
226
|
+
var(--button-default-font-weight)
|
|
227
|
+
);
|
|
228
|
+
border-radius: var(
|
|
229
|
+
--button-border-radius,
|
|
230
|
+
var(--button-default-icon-border-radius)
|
|
231
|
+
);
|
|
132
232
|
}
|
|
133
233
|
|
|
134
234
|
.button-icon:hover {
|
|
@@ -1,33 +1,13 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import './Button.css';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
class?: string | undefined;
|
|
6
|
+
buttonType?: "default" | "text" | "icon" | undefined;
|
|
7
|
+
type?: "submit" | "button" | undefined;
|
|
6
8
|
loading?: boolean | undefined;
|
|
7
9
|
icon?: string | undefined;
|
|
8
|
-
|
|
9
|
-
maxWidth?: string | undefined;
|
|
10
|
-
maxHeight?: string | undefined;
|
|
11
|
-
minWidth?: string | undefined;
|
|
12
|
-
minHeight?: string | undefined;
|
|
13
|
-
width?: string | undefined;
|
|
14
|
-
height?: string | undefined;
|
|
15
|
-
textAlign?: string | undefined;
|
|
16
|
-
cursor?: string | undefined;
|
|
17
|
-
padding?: string | undefined;
|
|
18
|
-
fontSize?: string | undefined;
|
|
19
|
-
color?: string | null | undefined;
|
|
20
|
-
display?: string | undefined;
|
|
21
|
-
justifyContent?: string | undefined;
|
|
22
|
-
alignItems?: string | undefined;
|
|
23
|
-
backgroundColor?: string | undefined;
|
|
24
|
-
hoverBackgroundColor?: string | undefined;
|
|
25
|
-
activeBackgroundColor?: string | undefined;
|
|
26
|
-
borderRadius?: string | undefined;
|
|
27
|
-
border?: string | undefined;
|
|
28
|
-
boxShadow?: string | undefined;
|
|
29
|
-
loaderHeight?: string | undefined;
|
|
30
|
-
loaderWidth?: string | undefined;
|
|
10
|
+
tabindex?: number | null | undefined;
|
|
31
11
|
disabled?: boolean | undefined;
|
|
32
12
|
};
|
|
33
13
|
events: {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--link-button-default-color: rgb(var(--global-color-contrast-900));
|
|
3
|
+
--link-button-default-width: fit-content;
|
|
4
|
+
--link-button-default-height: auto;
|
|
5
|
+
--link-button-default-font-size: .875rem;
|
|
6
|
+
--link-button-default-font-weight: 500;
|
|
7
|
+
--link-button-default-line-height: 1.5rem;
|
|
8
|
+
--link-button-default-padding: 0.25rem 0.75rem 0.25rem 0.75rem;
|
|
9
|
+
--link-button-default-background-color: rgb(var(--global-color-background-300));
|
|
10
|
+
--link-button-default-border-radius: 9999px;
|
|
11
|
+
--link-button-default-gap: .5rem;
|
|
12
|
+
--link-button-default-hover-background-color: rgb(var(--global-color-background-400));
|
|
13
|
+
}
|