flowbite-svelte 0.15.5 → 0.15.8
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/CHANGELOG.md +40 -0
- package/README.md +22 -11
- package/auth/Confirm.svelte +1 -1
- package/buttons/Button.svelte +70 -47
- package/buttons/Button.svelte.d.ts +1 -1
- package/buttons/ColorShadowButton.svelte +1 -3
- package/buttons/ColorShadowButton.svelte.d.ts +0 -1
- package/buttons/GradientDuotoneButton.svelte +1 -3
- package/buttons/GradientDuotoneButton.svelte.d.ts +0 -1
- package/buttons/GradientMonochromeButton.svelte +1 -3
- package/buttons/GradientMonochromeButton.svelte.d.ts +0 -1
- package/cards/CtaCard.svelte +1 -1
- package/forms/Iconinput.svelte +2 -2
- package/index.js +0 -8
- package/package.json +1 -2
- package/sidebars/Sidebar.svelte +1 -1
- package/sidebars/SidebarDropdown.svelte +1 -1
- package/spinners/Spinner.svelte +27 -31
- package/spinners/Spinner.svelte.d.ts +4 -3
- package/types.d.ts +1 -0
- package/spinners/SpinnerButton.svelte +0 -37
- package/spinners/SpinnerButton.svelte.d.ts +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.15.8](https://github.com/themesberg/flowbite-svelte/compare/v0.15.7...v0.15.8) (2022-04-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* update for lighthouse ([e81850d](https://github.com/themesberg/flowbite-svelte/commit/e81850db1d00851f2f8b3a1320ef7658f0654674))
|
|
11
|
+
* update links, flowbite svelte link, sitemap links, white for dark mode ([024b079](https://github.com/themesberg/flowbite-svelte/commit/024b079c161678f2a683736a97d4431f8d8a5279))
|
|
12
|
+
|
|
13
|
+
### [0.15.7](https://github.com/themesberg/flowbite-svelte/compare/v0.15.6...v0.15.7) (2022-04-28)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* add 32997restProps to Iconinput ([34c8ad5](https://github.com/themesberg/flowbite-svelte/commit/34c8ad5dc0ca6c1ce39c6281c185274fd0f49ca7))
|
|
19
|
+
|
|
20
|
+
### [0.15.7](https://github.com/themesberg/flowbite-svelte/compare/v0.15.6...v0.15.7) (2022-04-28)
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* The build process now auto generates component props on build
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
* The 'name' attribute on all buttons is now replaced with the more flexible <slot> pattern. As a consequence the SpinnerButton component has been removed.
|
|
29
|
+
* Added more button use cases in the documentation and merged button/setup and button/default into one
|
|
30
|
+
* Implemented button disable states with different styles and pointer exclusion
|
|
31
|
+
* All buttons now implement 'items-center inline-flex' by default
|
|
32
|
+
* Button can now be futher styled using the incremental 'class' attribute
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* button light theme had a color mismatch
|
|
37
|
+
|
|
38
|
+
### [0.15.6](https://github.com/themesberg/flowbite-svelte/compare/v0.15.5...v0.15.6) (2022-04-27)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* add iconColor to sidebar and sidebardropdown components ([9b239ba](https://github.com/themesberg/flowbite-svelte/commit/9b239bacd455436c9ab056a730574d3d3404e517))
|
|
44
|
+
|
|
5
45
|
### [0.15.5](https://github.com/themesberg/flowbite-svelte/compare/v0.15.4...v0.15.5) (2022-04-27)
|
|
6
46
|
|
|
7
47
|
|
package/README.md
CHANGED
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
[](https://github.com/themesberg/flowbite-svelte/releases)
|
|
6
6
|
[](https://github.com/themesberg/flowbite-svelte/blob/main/LICENSE)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
8
|
[Flowbite-Svelte](https://flowbite-svelte.com/) is an official Flowbite component library for Svelte. All interactivities are handled by Svelte.
|
|
11
9
|
|
|
12
10
|
## Installation
|
|
13
11
|
|
|
14
|
-
- [Getting started](https://flowbite-svelte.com/getting-started)
|
|
15
|
-
- [About](https://flowbite-svelte.com/about)
|
|
16
|
-
- [
|
|
17
|
-
- [
|
|
12
|
+
- [Getting started](https://flowbite-svelte.com/pages/getting-started)
|
|
13
|
+
- [About](https://flowbite-svelte.com/pages/about)
|
|
14
|
+
- [Types](https://flowbite-svelte.com/pages/types)
|
|
15
|
+
- [How to contribute](https://flowbite-svelte.com/pages/how-to-contribute)
|
|
16
|
+
- [CLI](https://flowbite-svelte.com/pages/cli)
|
|
17
|
+
- [License](https://flowbite-svelte.com/pages/license)
|
|
18
18
|
|
|
19
19
|
## Accordion components
|
|
20
20
|
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
|
|
50
50
|
## Button components
|
|
51
51
|
|
|
52
|
-
- [Setup](https://flowbite-svelte.com/buttons/setup)
|
|
53
52
|
- [Default Button](https://flowbite-svelte.com/buttons/default)
|
|
54
53
|
- [Colored Shadow Button](https://flowbite-svelte.com/buttons/colored-shadow)
|
|
55
54
|
- [Gradient Duotone Button](https://flowbite-svelte.com/buttons/gradient-duotone)
|
|
@@ -57,6 +56,7 @@
|
|
|
57
56
|
- [Gradietn Outline Button](https://flowbite-svelte.com/buttons/gradient-outline)
|
|
58
57
|
- [Outlined Button](https://flowbite-svelte.com/buttons/outlined)
|
|
59
58
|
- [Rounded Button](https://flowbite-svelte.com/buttons/rounded)
|
|
59
|
+
- [Loader Button](https://flowbite-svelte.com/spinners/button-loader)
|
|
60
60
|
|
|
61
61
|
## Card components
|
|
62
62
|
|
|
@@ -84,7 +84,14 @@
|
|
|
84
84
|
|
|
85
85
|
## Form components
|
|
86
86
|
|
|
87
|
-
- [
|
|
87
|
+
- [Checkbox](https://flowbite-svelte.com/forms/checkbox)
|
|
88
|
+
- [File input](https://flowbite-svelte.com/forms/file-input)
|
|
89
|
+
- [Floating label](https://flowbite-svelte.com/forms/floating-label)
|
|
90
|
+
- [Input](https://flowbite-svelte.com/forms/input)
|
|
91
|
+
- [Radio](https://flowbite-svelte.com/forms/radio)
|
|
92
|
+
- [Range](https://flowbite-svelte.com/forms/range)
|
|
93
|
+
- [Textarea](https://flowbite-svelte.com/forms/textarea)
|
|
94
|
+
- [Toggle](https://flowbite-svelte.com/forms/toggle)
|
|
88
95
|
|
|
89
96
|
## Footer components
|
|
90
97
|
|
|
@@ -125,6 +132,12 @@
|
|
|
125
132
|
|
|
126
133
|
- [Probress bar](https://flowbite-svelte.com/progressbars)
|
|
127
134
|
|
|
135
|
+
## Rating
|
|
136
|
+
|
|
137
|
+
- [Rating](https://flowbite-svelte.com/ratings/rating)
|
|
138
|
+
- [Advanced rating](https://flowbite-svelte.com/ratings/advanced-rating)
|
|
139
|
+
- [Score rating](https://flowbite-svelte.com/ratings/score-rating)
|
|
140
|
+
|
|
128
141
|
## Sidebar components
|
|
129
142
|
|
|
130
143
|
- [Sidebar](https://flowbite-svelte.com/sidebars)
|
|
@@ -132,7 +145,6 @@
|
|
|
132
145
|
## Spinner components
|
|
133
146
|
|
|
134
147
|
- [Default Spinner](https://flowbite-svelte.com/spinners/default)
|
|
135
|
-
- [Button Spinner](https://flowbite-svelte.com/spinners/button-spinner)
|
|
136
148
|
|
|
137
149
|
## Tab components
|
|
138
150
|
|
|
@@ -177,8 +189,7 @@ npm run test
|
|
|
177
189
|
## Create props
|
|
178
190
|
|
|
179
191
|
```sh
|
|
180
|
-
|
|
181
|
-
node createProps.js
|
|
192
|
+
npm run gen:props
|
|
182
193
|
```
|
|
183
194
|
|
|
184
195
|
This will pull all props from components and replace files in `/src/routes/props` directory.
|
package/auth/Confirm.svelte
CHANGED
package/buttons/Button.svelte
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script>export let rounded = false;
|
|
2
2
|
export let textSize = 'text-sm';
|
|
3
|
-
export let name = 'Read more';
|
|
4
3
|
export let btnColor = 'blue';
|
|
5
4
|
export let type = 'button';
|
|
5
|
+
export let disabled = false;
|
|
6
6
|
let paddings;
|
|
7
7
|
if (textSize === 'text-xs') {
|
|
8
8
|
paddings = 'py-2 px-3';
|
|
@@ -18,52 +18,75 @@ else {
|
|
|
18
18
|
}
|
|
19
19
|
let buttonClass;
|
|
20
20
|
let round = rounded ? 'rounded-full' : 'rounded-lg';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
else
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
else
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
21
|
+
switch (btnColor) {
|
|
22
|
+
default:
|
|
23
|
+
case 'blue':
|
|
24
|
+
buttonClass = `text-white text-center font-medium ${round} ${textSize} ${paddings} mr-2 mb-2`;
|
|
25
|
+
if (disabled)
|
|
26
|
+
buttonClass += ' bg-blue-400 dark:bg-blue-500 cursor-not-allowed';
|
|
27
|
+
else
|
|
28
|
+
buttonClass += ' bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
29
|
+
break;
|
|
30
|
+
case 'blue-outline':
|
|
31
|
+
buttonClass = `text-blue-700 hover:text-white border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-blue-500 dark:text-blue-500 dark:hover:text-white dark:hover:bg-blue-600 dark:focus:ring-blue-800`;
|
|
32
|
+
break;
|
|
33
|
+
case 'dark':
|
|
34
|
+
buttonClass = `text-white text-center font-medium ${round} ${textSize} ${paddings} mr-2 mb-2`;
|
|
35
|
+
if (disabled)
|
|
36
|
+
buttonClass += ' bg-gray-400 dark:bg-gray-500 cursor-not-allowed';
|
|
37
|
+
else
|
|
38
|
+
buttonClass += ' bg-gray-800 hover:bg-gray-900 focus:ring-4 focus:ring-gray-300 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-800 dark:border-gray-700';
|
|
39
|
+
break;
|
|
40
|
+
case 'dark-outline':
|
|
41
|
+
buttonClass = `text-gray-900 hover:text-white border border-gray-800 hover:bg-gray-900 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-gray-600 dark:text-gray-400 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-800`;
|
|
42
|
+
break;
|
|
43
|
+
case 'light':
|
|
44
|
+
buttonClass = `text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700`;
|
|
45
|
+
break;
|
|
46
|
+
case 'green':
|
|
47
|
+
buttonClass = `text-white text-center font-medium ${round} ${textSize} ${paddings} mr-2 mb-2`;
|
|
48
|
+
if (disabled)
|
|
49
|
+
buttonClass += ' bg-green-400 dark:bg-green-500 cursor-not-allowed';
|
|
50
|
+
else
|
|
51
|
+
buttonClass += ' bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800';
|
|
52
|
+
break;
|
|
53
|
+
case 'green-outline':
|
|
54
|
+
buttonClass = `text-green-700 hover:text-white border border-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-green-500 dark:text-green-500 dark:hover:text-white dark:hover:bg-green-600 dark:focus:ring-green-800`;
|
|
55
|
+
break;
|
|
56
|
+
case 'red':
|
|
57
|
+
buttonClass = `text-white text-center font-medium ${round} ${textSize} ${paddings} mr-2 mb-2`;
|
|
58
|
+
if (disabled)
|
|
59
|
+
buttonClass += ' bg-red-400 dark:bg-red-500 cursor-not-allowed';
|
|
60
|
+
else
|
|
61
|
+
buttonClass += ' bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900';
|
|
62
|
+
break;
|
|
63
|
+
case 'red-outline':
|
|
64
|
+
buttonClass = `text-red-700 hover:text-white border border-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-red-500 dark:text-red-500 dark:hover:text-white dark:hover:bg-red-600 dark:focus:ring-red-900`;
|
|
65
|
+
break;
|
|
66
|
+
case 'yellow':
|
|
67
|
+
buttonClass = `text-white text-center font-medium ${round} ${textSize} ${paddings} mr-2 mb-2`;
|
|
68
|
+
if (disabled)
|
|
69
|
+
buttonClass += ' bg-yellow-400 dark:bg-yellow-500 cursor-not-allowed';
|
|
70
|
+
else
|
|
71
|
+
buttonClass += ' bg-yellow-400 hover:bg-yellow-500 focus:ring-4 focus:ring-yellow-300 dark:focus:ring-yellow-900';
|
|
72
|
+
break;
|
|
73
|
+
case 'yellow-outline':
|
|
74
|
+
buttonClass = `text-yellow-400 hover:text-white border border-yellow-400 hover:bg-yellow-500 focus:ring-4 focus:ring-yellow-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-yellow-300 dark:text-yellow-300 dark:hover:text-white dark:hover:bg-yellow-400 dark:focus:ring-yellow-900`;
|
|
75
|
+
break;
|
|
76
|
+
case 'purple':
|
|
77
|
+
buttonClass = `text-white text-center font-medium ${round} ${textSize} ${paddings} mr-2 mb-2`;
|
|
78
|
+
if (disabled)
|
|
79
|
+
buttonClass += ' bg-purple-400 dark:bg-purple-500 cursor-not-allowed';
|
|
80
|
+
else
|
|
81
|
+
buttonClass += ' bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-900';
|
|
82
|
+
break;
|
|
83
|
+
case 'purple-outline':
|
|
84
|
+
buttonClass = `text-purple-700 hover:text-white border border-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-purple-400 dark:text-purple-400 dark:hover:text-white dark:hover:bg-purple-500 dark:focus:ring-purple-900`;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
buttonClass += ' items-center inline-flex';
|
|
64
88
|
</script>
|
|
65
89
|
|
|
66
|
-
<button {type} class={buttonClass} {
|
|
67
|
-
|
|
68
|
-
<slot />
|
|
90
|
+
<button {type} class="{buttonClass} {$$props.class}" on:click>
|
|
91
|
+
<slot>Read more</slot>
|
|
69
92
|
</button>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script>export let textSize = 'text-sm';
|
|
2
2
|
export let color = 'blue';
|
|
3
|
-
export let name = 'Read more';
|
|
4
3
|
let btnClass;
|
|
5
4
|
export let type = 'button';
|
|
6
5
|
if (color === 'blue') {
|
|
@@ -33,6 +32,5 @@ else {
|
|
|
33
32
|
</script>
|
|
34
33
|
|
|
35
34
|
<button {type} class={btnClass} {...$$restProps} on:click>
|
|
36
|
-
|
|
37
|
-
<slot />
|
|
35
|
+
<slot>Read more</slot>
|
|
38
36
|
</button>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script>export let textSize = 'text-sm';
|
|
2
2
|
export let color = 'purple2blue';
|
|
3
|
-
export let name = 'Read more';
|
|
4
3
|
let btnClass;
|
|
5
4
|
export let type = 'button';
|
|
6
5
|
if (color === 'purple2blue') {
|
|
@@ -30,6 +29,5 @@ else {
|
|
|
30
29
|
</script>
|
|
31
30
|
|
|
32
31
|
<button {type} class={btnClass} {...$$restProps} on:click>
|
|
33
|
-
|
|
34
|
-
<slot />
|
|
32
|
+
<slot>Read more</slot>
|
|
35
33
|
</button>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script>export let textSize = 'text-sm';
|
|
2
2
|
export let color = 'blue';
|
|
3
|
-
export let name = 'Read more';
|
|
4
3
|
let btnClass;
|
|
5
4
|
export let type = 'button';
|
|
6
5
|
if (color === 'blue') {
|
|
@@ -33,6 +32,5 @@ else {
|
|
|
33
32
|
</script>
|
|
34
33
|
|
|
35
34
|
<button {type} class={btnClass} {...$$restProps} on:click>
|
|
36
|
-
|
|
37
|
-
<slot />
|
|
35
|
+
<slot>Read more</slot>
|
|
38
36
|
</button>
|
package/cards/CtaCard.svelte
CHANGED
package/forms/Iconinput.svelte
CHANGED
|
@@ -27,14 +27,14 @@ function setType(node) {
|
|
|
27
27
|
<div class={noBorderDivClass}>
|
|
28
28
|
<svelte:component this={icon} size={iconSize} class={iconClass} />
|
|
29
29
|
</div>
|
|
30
|
-
<input bind:value use:setType {id} class={noBorderInputClass} {placeholder} />
|
|
30
|
+
<input bind:value use:setType {id} class={noBorderInputClass} {placeholder} {...$$restProps} />
|
|
31
31
|
</div>
|
|
32
32
|
{:else}
|
|
33
33
|
<div class="flex">
|
|
34
34
|
<span class={spanClass}>
|
|
35
35
|
<svelte:component this={icon} size={iconSize} class={iconClass} />
|
|
36
36
|
</span>
|
|
37
|
-
<input {type} {id} class={inputClass} {placeholder} />
|
|
37
|
+
<input {type} {id} class={inputClass} {placeholder} {...$$restProps} />
|
|
38
38
|
</div>
|
|
39
39
|
{/if}
|
|
40
40
|
{#if helper}
|
package/index.js
CHANGED
|
@@ -7,13 +7,6 @@ export { default as Alert } from'./alerts/Alert.svelte'
|
|
|
7
7
|
export { default as BorderAlert } from'./alerts/BorderAlert.svelte'
|
|
8
8
|
export { default as InfoAlert } from'./alerts/InfoAlert.svelte'
|
|
9
9
|
|
|
10
|
-
// Auth
|
|
11
|
-
export { default as Confirm } from'./auth/Confirm.svelte'
|
|
12
|
-
export { default as ForgotPassword } from'./auth/ForgotPassword.svelte'
|
|
13
|
-
export { default as Login } from'./auth/Login.svelte'
|
|
14
|
-
export { default as Register } from'./auth/Register.svelte'
|
|
15
|
-
export { default as Reset } from './auth/Reset.svelte'
|
|
16
|
-
|
|
17
10
|
// Avatar
|
|
18
11
|
export { default as Avatar } from './avatar/Avatar.svelte'
|
|
19
12
|
|
|
@@ -111,7 +104,6 @@ export { default as Sidebar } from './sidebars/Sidebar.svelte'
|
|
|
111
104
|
|
|
112
105
|
// Spin
|
|
113
106
|
export { default as Spinner } from'./spinners/Spinner.svelte'
|
|
114
|
-
export { default as SpinnerButton } from'./spinners/SpinnerButton.svelte'
|
|
115
107
|
|
|
116
108
|
// Tables
|
|
117
109
|
export { default as Table } from './tables/Table.svelte'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.8",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "./package/index.js",
|
|
6
6
|
"author": {
|
|
@@ -164,7 +164,6 @@
|
|
|
164
164
|
"./sidebars/Sidebar.svelte": "./sidebars/Sidebar.svelte",
|
|
165
165
|
"./sidebars/SidebarDropdown.svelte": "./sidebars/SidebarDropdown.svelte",
|
|
166
166
|
"./spinners/Spinner.svelte": "./spinners/Spinner.svelte",
|
|
167
|
-
"./spinners/SpinnerButton.svelte": "./spinners/SpinnerButton.svelte",
|
|
168
167
|
"./tables/Table.svelte": "./tables/Table.svelte",
|
|
169
168
|
"./tables/TableCheckbox.svelte": "./tables/TableCheckbox.svelte",
|
|
170
169
|
"./tables/TableCheckboxRow.svelte": "./tables/TableCheckboxRow.svelte",
|
package/sidebars/Sidebar.svelte
CHANGED
|
@@ -20,7 +20,7 @@ export let cta;
|
|
|
20
20
|
<li>
|
|
21
21
|
<a href={link.href} rel={link.rel} class="flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700">
|
|
22
22
|
{#if link.icon}
|
|
23
|
-
<svelte:component this={link.icon} size={link.iconSize} class="mr-2 {link.iconClass}" />
|
|
23
|
+
<svelte:component this={link.icon} size={link.iconSize} color={link.iconColor} class="mr-2 {link.iconClass}" />
|
|
24
24
|
{/if}
|
|
25
25
|
<span class="ml-3">{link.name}</span>
|
|
26
26
|
{#if link.subtext}
|
|
@@ -11,7 +11,7 @@ const handleDropdown = (id) => {
|
|
|
11
11
|
<li>
|
|
12
12
|
<button type="button" on:click={() => handleDropdown(link.id)} class="flex items-center p-2 w-full text-base font-normal text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700" aria-controls="dropdown" data-collapse-toggle="dropdown">
|
|
13
13
|
{#if link.icon}
|
|
14
|
-
<svelte:component this={link.icon} class="mr-4 {link.iconClass}" size={link.iconSize} />
|
|
14
|
+
<svelte:component this={link.icon} class="mr-4 {link.iconClass}" size={link.iconSize} color={link.iconColor} />
|
|
15
15
|
{/if}
|
|
16
16
|
<span class="flex-1 ml-3 text-left whitespace-nowrap" sidebar-toggle-item="">{link.name}</span>
|
|
17
17
|
<svg sidebar-toggle-item="" class="w-6 h-6" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>
|
package/spinners/Spinner.svelte
CHANGED
|
@@ -1,50 +1,46 @@
|
|
|
1
1
|
<script>export let color = 'blue';
|
|
2
2
|
export let bg = 'text-gray-200';
|
|
3
|
-
export let size = '
|
|
4
|
-
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export let size = '8';
|
|
4
|
+
// these two props add fine control over the spinner colors
|
|
5
|
+
export let currentFill = 'currentFill';
|
|
6
|
+
export let currentColor = 'currentColor';
|
|
7
|
+
if (currentFill !== 'currentFill') {
|
|
8
|
+
color = undefined;
|
|
9
|
+
}
|
|
10
|
+
let fillColorClass;
|
|
11
|
+
if (color === undefined) {
|
|
12
|
+
fillColorClass = '';
|
|
13
|
+
}
|
|
14
|
+
else if (color === 'blue') {
|
|
15
|
+
fillColorClass = 'fill-blue-600';
|
|
8
16
|
}
|
|
9
17
|
else if (color === 'gray') {
|
|
10
|
-
|
|
18
|
+
fillColorClass = 'fill-gray-600';
|
|
11
19
|
}
|
|
12
20
|
else if (color === 'green') {
|
|
13
|
-
|
|
21
|
+
fillColorClass = 'fill-green-500';
|
|
14
22
|
}
|
|
15
23
|
else if (color === 'red') {
|
|
16
|
-
|
|
24
|
+
fillColorClass = 'fill-red-600';
|
|
17
25
|
}
|
|
18
26
|
else if (color === 'yellow') {
|
|
19
|
-
|
|
27
|
+
fillColorClass = 'fill-yellow-400';
|
|
20
28
|
}
|
|
21
29
|
else if (color === 'pink') {
|
|
22
|
-
|
|
30
|
+
fillColorClass = 'fill-pink-600';
|
|
23
31
|
}
|
|
24
32
|
else if (color === 'purple') {
|
|
25
|
-
|
|
33
|
+
fillColorClass = 'fill-purple-600';
|
|
26
34
|
}
|
|
27
35
|
else {
|
|
28
|
-
|
|
36
|
+
fillColorClass = 'fill-blue-600';
|
|
29
37
|
}
|
|
30
38
|
</script>
|
|
31
39
|
|
|
32
|
-
{
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/>
|
|
40
|
-
</svg>
|
|
41
|
-
</div>
|
|
42
|
-
{:else}
|
|
43
|
-
<svg role="status" class="inline mr-2 {size} {bg} animate-spin dark:text-gray-600 {colorClass}" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
44
|
-
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor" />
|
|
45
|
-
<path
|
|
46
|
-
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
|
47
|
-
fill="currentFill"
|
|
48
|
-
/>
|
|
49
|
-
</svg>
|
|
50
|
-
{/if}
|
|
40
|
+
<svg role="status" class="inline w-{size} h-{size} mr-2 {bg} animate-spin dark:text-gray-600 {fillColorClass}" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
41
|
+
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill={currentFill} />
|
|
42
|
+
<path
|
|
43
|
+
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
|
44
|
+
fill={currentColor}
|
|
45
|
+
/>
|
|
46
|
+
</svg>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { Colors
|
|
2
|
+
import type { Colors } from '../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
color?: Colors;
|
|
5
|
+
color?: Colors | undefined;
|
|
6
6
|
bg?: string;
|
|
7
7
|
size?: string;
|
|
8
|
-
|
|
8
|
+
currentFill?: string;
|
|
9
|
+
currentColor?: string;
|
|
9
10
|
};
|
|
10
11
|
events: {
|
|
11
12
|
[evt: string]: CustomEvent<any>;
|
package/types.d.ts
CHANGED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<script>export let color;
|
|
2
|
-
let colorClass;
|
|
3
|
-
let fillColor1;
|
|
4
|
-
let fillColor2;
|
|
5
|
-
if (color === 'blue') {
|
|
6
|
-
colorClass =
|
|
7
|
-
'text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex items-center';
|
|
8
|
-
fillColor1 = '#E5E7EB';
|
|
9
|
-
fillColor2 = 'currentColor';
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
colorClass =
|
|
13
|
-
'py-2.5 px-5 mr-2 text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 inline-flex items-center';
|
|
14
|
-
fillColor1 = 'currentColor';
|
|
15
|
-
fillColor2 = '#1C64F2';
|
|
16
|
-
}
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<button disabled type="button" class={colorClass}>
|
|
20
|
-
<svg
|
|
21
|
-
role="status"
|
|
22
|
-
class="inline mr-3 w-4 h-4 text-white animate-spin"
|
|
23
|
-
viewBox="0 0 100 101"
|
|
24
|
-
fill="none"
|
|
25
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
26
|
-
>
|
|
27
|
-
<path
|
|
28
|
-
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
|
29
|
-
fill={fillColor1}
|
|
30
|
-
/>
|
|
31
|
-
<path
|
|
32
|
-
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
|
33
|
-
fill={fillColor2}
|
|
34
|
-
/>
|
|
35
|
-
</svg>
|
|
36
|
-
<slot>Loading ...</slot>
|
|
37
|
-
</button>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
color: 'blue' | undefined;
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {
|
|
10
|
-
default: {};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export declare type SpinnerButtonProps = typeof __propDef.props;
|
|
14
|
-
export declare type SpinnerButtonEvents = typeof __propDef.events;
|
|
15
|
-
export declare type SpinnerButtonSlots = typeof __propDef.slots;
|
|
16
|
-
export default class SpinnerButton extends SvelteComponentTyped<SpinnerButtonProps, SpinnerButtonEvents, SpinnerButtonSlots> {
|
|
17
|
-
}
|
|
18
|
-
export {};
|