ui-svelte 0.2.12 → 0.2.13
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 +2 -2
- package/dist/charts/ArcChart.svelte +0 -1
- package/dist/control/Fab.svelte +103 -0
- package/dist/control/Fab.svelte.d.ts +25 -0
- package/dist/control/Record.svelte +0 -3
- package/dist/control/ToggleTheme.svelte +1 -1
- package/dist/control/Video.svelte +2 -0
- package/dist/control/css/btn.css +17 -17
- package/dist/control/css/fab.css +84 -0
- package/dist/control/css/media.css +7 -7
- package/dist/control/css/toggle-group.css +1 -17
- package/dist/css/decorations.css +348 -189
- package/dist/css/utilities.css +0 -4
- package/dist/display/Accordion.svelte +3 -3
- package/dist/display/Accordion.svelte.d.ts +1 -1
- package/dist/display/Card.svelte +3 -3
- package/dist/display/Card.svelte.d.ts +1 -1
- package/dist/display/Code.svelte +1 -1
- package/dist/display/Collapsible.svelte +3 -3
- package/dist/display/Collapsible.svelte.d.ts +1 -1
- package/dist/display/Countdown.svelte +169 -0
- package/dist/display/Countdown.svelte.d.ts +21 -0
- package/dist/display/Item.svelte +12 -0
- package/dist/display/Item.svelte.d.ts +2 -0
- package/dist/display/Marquee.svelte +0 -2
- package/dist/display/Section.svelte +3 -3
- package/dist/display/Section.svelte.d.ts +1 -1
- package/dist/display/css/accordion.css +14 -14
- package/dist/display/css/alert.css +42 -15
- package/dist/display/css/avatar.css +36 -36
- package/dist/display/css/card.css +108 -36
- package/dist/display/css/chip.css +16 -16
- package/dist/display/css/collapsible.css +32 -32
- package/dist/display/css/countdown.css +206 -0
- package/dist/display/css/item.css +24 -0
- package/dist/display/css/marquee.css +0 -3
- package/dist/display/css/section.css +88 -109
- package/dist/display/css/table.css +1 -16
- package/dist/form/ColorField.svelte +60 -2
- package/dist/form/DragDrop.svelte +317 -87
- package/dist/form/DragDrop.svelte.d.ts +1 -0
- package/dist/form/Dropzone.svelte +3 -3
- package/dist/form/Dropzone.svelte.d.ts +1 -1
- package/dist/form/ImageCropper.svelte +135 -4
- package/dist/form/RadioGroup.svelte +6 -2
- package/dist/form/RadioGroup.svelte.d.ts +1 -1
- package/dist/form/Slider.svelte +6 -2
- package/dist/form/Slider.svelte.d.ts +1 -1
- package/dist/form/TextField.svelte +13 -4
- package/dist/form/TextField.svelte.d.ts +3 -2
- package/dist/form/Toggle.svelte +6 -2
- package/dist/form/Toggle.svelte.d.ts +1 -1
- package/dist/form/css/control.css +14 -14
- package/dist/form/css/csv-field.css +8 -13
- package/dist/form/css/drag-drop.css +90 -127
- package/dist/form/css/dropzone.css +8 -8
- package/dist/form/css/editor.css +14 -14
- package/dist/form/css/image-cropper.css +28 -7
- package/dist/form/css/radio-group.css +25 -0
- package/dist/form/css/slider.css +36 -0
- package/dist/form/css/textarea.css +14 -14
- package/dist/form/css/toggle.css +12 -0
- package/dist/hooks/use-chat.svelte.js +1 -1
- package/dist/hooks/use-form.svelte.js +3 -3
- package/dist/hooks/use-search.svelte.js +0 -3
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +4 -0
- package/dist/index.css +28 -48
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/dist/layout/Provider.svelte +5 -5
- package/dist/layout/Sidebar.svelte +17 -8
- package/dist/layout/Sidebar.svelte.d.ts +2 -1
- package/dist/layout/css/app-bar.css +7 -7
- package/dist/layout/css/footer.css +7 -7
- package/dist/layout/css/sidebar.css +120 -59
- package/dist/navigation/BottomNav.svelte +23 -14
- package/dist/navigation/css/bottom-nav.css +74 -34
- package/dist/navigation/css/nav-menu.css +14 -15
- package/dist/navigation/css/side-nav.css +14 -15
- package/dist/overlay/AlertDialog.svelte +58 -0
- package/dist/overlay/AlertDialog.svelte.d.ts +14 -25
- package/dist/overlay/Command.svelte +177 -170
- package/dist/overlay/Command.svelte.d.ts +12 -3
- package/dist/overlay/Drawer.svelte +4 -4
- package/dist/overlay/Drawer.svelte.d.ts +1 -1
- package/dist/overlay/Modal.svelte +4 -4
- package/dist/overlay/Modal.svelte.d.ts +1 -1
- package/dist/overlay/Tooltip.svelte +0 -5
- package/dist/overlay/css/command.css +30 -42
- package/dist/overlay/css/drawer.css +10 -10
- package/dist/overlay/css/modal.css +70 -18
- package/dist/overlay/css/toast.css +42 -14
- package/dist/overlay/css/tooltip.css +49 -23
- package/dist/stores/theme.svelte.js +19 -12
- package/package.json +1 -1
- package/dist/utils/charts.d.ts +0 -27
- package/dist/utils/charts.js +0 -140
|
@@ -45,7 +45,6 @@ export const useSearch = (config) => {
|
|
|
45
45
|
(option.description && option.description.toLowerCase().includes(lowerSearch)));
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
// Client-side pagination
|
|
49
48
|
if (enablePagination) {
|
|
50
49
|
const start = 0;
|
|
51
50
|
const end = (currentPage + 1) * pageSize;
|
|
@@ -96,7 +95,6 @@ export const useSearch = (config) => {
|
|
|
96
95
|
else {
|
|
97
96
|
options = searchResponse.options;
|
|
98
97
|
}
|
|
99
|
-
// Determinar si hay más resultados
|
|
100
98
|
if (searchResponse.hasMore !== undefined) {
|
|
101
99
|
hasMore = searchResponse.hasMore;
|
|
102
100
|
}
|
|
@@ -105,7 +103,6 @@ export const useSearch = (config) => {
|
|
|
105
103
|
hasMore = options.length < searchResponse.total;
|
|
106
104
|
}
|
|
107
105
|
else {
|
|
108
|
-
// Si no hay info de total, asumimos que hay más si recibimos pageSize resultados
|
|
109
106
|
hasMore = searchResponse.options.length >= pageSize;
|
|
110
107
|
}
|
|
111
108
|
config.onSuccess?.(searchResponse);
|
package/dist/icons/index.d.ts
CHANGED
package/dist/icons/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export const Add24RegularIcon = {
|
|
2
|
+
body: '<path fill="currentColor" d="M11.75 3a.75.75 0 0 1 .75.75v7.5h7.5a.75.75 0 0 1 0 1.5h-7.5v7.5a.75.75 0 0 1-1.5 0v-7.5h-7.5a.75.75 0 0 1 0-1.5h7.5v-7.5a.75.75 0 0 1 .75-.75"/>',
|
|
3
|
+
viewbox: '0 0 24 24'
|
|
4
|
+
};
|
|
1
5
|
export const ArrowDown24RegularIcon = {
|
|
2
6
|
body: '<path fill="currentColor" d="M19.79 13.267a.75.75 0 0 0-1.086-1.034l-5.954 6.251V3.75a.75.75 0 1 0-1.5 0v14.734l-5.955-6.251a.75.75 0 1 0-1.086 1.034l7.067 7.42c.16.168.366.268.58.3a.8.8 0 0 0 .29-.001a1 1 0 0 0 .578-.3z"/>',
|
|
3
7
|
viewbox: '0 0 24 24'
|
package/dist/index.css
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
@import './control/css/media.css';
|
|
15
15
|
@import './control/css/video.css';
|
|
16
16
|
@import './control/css/toggle-group.css';
|
|
17
|
+
@import './control/css/fab.css';
|
|
17
18
|
|
|
18
19
|
@import './charts/css/arc-chart.css';
|
|
19
20
|
@import './charts/css/area-chart.css';
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
@import './display/css/chip.css';
|
|
34
35
|
@import './display/css/code.css';
|
|
35
36
|
@import './display/css/collapsible.css';
|
|
37
|
+
@import './display/css/countdown.css';
|
|
36
38
|
@import './display/css/divider.css';
|
|
37
39
|
@import './display/css/empty.css';
|
|
38
40
|
@import './display/css/item.css';
|
|
@@ -84,67 +86,45 @@
|
|
|
84
86
|
@import './overlay/css/tooltip.css';
|
|
85
87
|
|
|
86
88
|
@theme {
|
|
87
|
-
--color-
|
|
88
|
-
|
|
89
|
-
--color-on-primary: var(--on-primary, oklch(93.2% 0.032 255.585));
|
|
90
|
-
/* blue-100 */
|
|
89
|
+
--color-on-dark: var(--on-dark, oklch(97% 0.01 90));
|
|
90
|
+
--color-on-light: var(--on-light, oklch(25% 0.01 30));
|
|
91
91
|
|
|
92
|
-
--color-
|
|
93
|
-
|
|
94
|
-
--color-on-
|
|
95
|
-
/* pink-100 */
|
|
92
|
+
--color-primary: var(--primary, oklch(75% 0.15 145));
|
|
93
|
+
--color-soft-primary: var(--soft-primary, oklch(95% 0.05 145));
|
|
94
|
+
--color-on-primary: var(--on-primary, var(--on-light));
|
|
96
95
|
|
|
97
|
-
--color-
|
|
98
|
-
|
|
99
|
-
--color-on-
|
|
100
|
-
/* gray-700 */
|
|
101
|
-
|
|
102
|
-
/* dark */
|
|
103
|
-
/*--color-muted: var(--muted, oklch(37.3% 0.034 259.733)); /* gray-700 */
|
|
104
|
-
/*--color-on-muted: var(--on-muted, oklch(87.2% 0.01 258.338)); /* gray-300 */
|
|
105
|
-
|
|
106
|
-
--color-background: var(--background, oklch(98.5% 0.002 247.839));
|
|
107
|
-
/* gray-50 */
|
|
108
|
-
--color-on-background: var(--on-background, oklch(21% 0.034 264.665));
|
|
109
|
-
/* gray-900 */
|
|
110
|
-
|
|
111
|
-
/* dark */
|
|
112
|
-
/*--color-background: var(--background, oklch(13% 0.028 261.692)); /* gray-950 */
|
|
113
|
-
/*--color-on-background: var(--on-background, oklch(96.7% 0.003 264.542)); /* gray-100 */
|
|
96
|
+
--color-secondary: var(--secondary, oklch(28.42% 0.0467 259.99));
|
|
97
|
+
--color-soft-secondary: var(--soft-secondary, oklch(92% 0.005 30));
|
|
98
|
+
--color-on-secondary: var(--on-secondary, var(--on-dark));
|
|
114
99
|
|
|
115
|
-
--color-
|
|
116
|
-
|
|
117
|
-
--color-on-
|
|
118
|
-
/* gray-800 */
|
|
100
|
+
--color-muted: var(--muted, oklch(87.2% 0.01 258.338));
|
|
101
|
+
--color-soft-muted: var(--soft-muted, oklch(92% 0.005 30));
|
|
102
|
+
--color-on-muted: var(--on-muted, var(--on-light));
|
|
119
103
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
/*--color-on-surface: var(--on-surface, oklch(92.8% 0.006 264.531)); /* gray-200 */
|
|
104
|
+
--color-background: var(--background, oklch(96% 0.005 85));
|
|
105
|
+
--color-on-background: var(--on-background, var(--on-light));
|
|
123
106
|
|
|
124
|
-
--color-
|
|
125
|
-
|
|
126
|
-
--color-on-overlay: var(--on-overlay, oklch(1 0 0));
|
|
127
|
-
/* white */
|
|
107
|
+
--color-surface: var(--surface, oklch(98% 0.003 85));
|
|
108
|
+
--color-on-surface: var(--on-surface, var(--on-light));
|
|
128
109
|
|
|
129
110
|
--color-success: var(--success, oklch(62.7% 0.194 149.214));
|
|
130
|
-
|
|
131
|
-
--color-on-success: var(--on-success,
|
|
132
|
-
/* green-100 */
|
|
111
|
+
--color-soft-success: var(--soft-success, oklch(95% 0.06 149.214));
|
|
112
|
+
--color-on-success: var(--on-success, var(--on-dark));
|
|
133
113
|
|
|
134
114
|
--color-info: var(--info, oklch(58.8% 0.158 241.966));
|
|
135
|
-
|
|
136
|
-
--color-on-info: var(--on-info,
|
|
137
|
-
/* sky-100 */
|
|
115
|
+
--color-soft-info: var(--soft-info, oklch(95% 0.05 241.966));
|
|
116
|
+
--color-on-info: var(--on-info, var(--on-dark));
|
|
138
117
|
|
|
139
118
|
--color-warning: var(--warning, oklch(68.1% 0.162 75.834));
|
|
140
|
-
|
|
141
|
-
--color-on-warning: var(--on-warning,
|
|
142
|
-
/* yellow-100 */
|
|
119
|
+
--color-soft-warning: var(--soft-warning, oklch(96% 0.05 75.834));
|
|
120
|
+
--color-on-warning: var(--on-warning, var(--on-dark));
|
|
143
121
|
|
|
144
122
|
--color-danger: var(--danger, oklch(57.7% 0.245 27.325));
|
|
145
|
-
|
|
146
|
-
--color-on-danger: var(--on-danger,
|
|
147
|
-
|
|
123
|
+
--color-soft-danger: var(--soft-danger, oklch(95% 0.07 27.325));
|
|
124
|
+
--color-on-danger: var(--on-danger, var(--on-dark));
|
|
125
|
+
|
|
126
|
+
--color-overlay: var(--overlay, oklch(0 0 0 / 60%));
|
|
127
|
+
--color-on-overlay: var(--on-overlay, var(--on-dark));
|
|
148
128
|
|
|
149
129
|
--radius-avatar: calc(infinity * 1px);
|
|
150
130
|
--radius-box: 0.75rem;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import PieChart from './charts/PieChart.svelte';
|
|
|
7
7
|
import Audio from './control/Audio.svelte';
|
|
8
8
|
import Button from './control/Button.svelte';
|
|
9
9
|
import Image from './control/Image.svelte';
|
|
10
|
+
import Fab, { type FabAction } from './control/Fab.svelte';
|
|
10
11
|
import IconButton from './control/IconButton.svelte';
|
|
11
12
|
import Record from './control/Record.svelte';
|
|
12
13
|
import ToggleTheme from './control/ToggleTheme.svelte';
|
|
@@ -23,6 +24,7 @@ import ChatBox, { type PromptMessage, type PromptState } from './display/ChatBox
|
|
|
23
24
|
import Chip from './display/Chip.svelte';
|
|
24
25
|
import Code from './display/Code.svelte';
|
|
25
26
|
import Collapsible from './display/Collapsible.svelte';
|
|
27
|
+
import Countdown from './display/Countdown.svelte';
|
|
26
28
|
import Divider from './display/Divider.svelte';
|
|
27
29
|
import Empty from './display/Empty.svelte';
|
|
28
30
|
import Icon, { type IconData } from './display/Icon.svelte';
|
|
@@ -84,5 +86,5 @@ import { useAuth } from './hooks/use-auth.svelte.js';
|
|
|
84
86
|
import { theme } from './stores/theme.svelte.js';
|
|
85
87
|
import { useSearch } from './hooks/use-search.svelte.js';
|
|
86
88
|
import { useChat } from './hooks/use-chat.svelte.js';
|
|
87
|
-
export { AreaChart, ArcChart, BarChart, Candlestick, LineChart, PieChart, Alert, AlertDialog, AppBar, Accordion, Avatar, AvatarGroup, Audio, Badge, Button, BottomNav, Carousel, Card, ChatBox, Checkbox, Chip, Code, ColorField, Collapsible, Command, ComboBox, CsvField, DateField, DateRange, Drawer, Dropzone, Divider, DragDrop, Dropdown, Editor, Empty, Footer, FooterNav, FooterGroup, formatCurrency, formatDate, formatNumber, getWeekdays, i18n, Icon, IconButton, Image, ImageCropper, Item, initLanguage, Modal, Map, Marquee, NavMenu, Pagination, PasswordField, PhoneField, PinField, plural, PopoverStack, Provider, RadioGroup, Record, Scaffold, Section, Skeleton, Select, setLanguage, Sidebar, SideNav, Slider, t, Table, Tabs, TextField, Textarea, theme, Toast, toast, Toggle, ToggleGroup, ToggleTheme, Tooltip, useAuth, useChat, useClipboard, useFetch, useForm, useLocalStorage, useScroll, useSearch, useTable, useWebSocket, Video };
|
|
88
|
-
export type { IconData, SideNavItem, SideNavSubItem, DragDropItem, DragDropGroup, PromptMessage, PromptState, LatLng, MapMarker, RouteInfo };
|
|
89
|
+
export { AreaChart, ArcChart, BarChart, Candlestick, LineChart, PieChart, Alert, AlertDialog, AppBar, Accordion, Avatar, AvatarGroup, Audio, Badge, Button, BottomNav, Carousel, Card, ChatBox, Checkbox, Chip, Code, Countdown, ColorField, Collapsible, Command, ComboBox, CsvField, DateField, DateRange, Drawer, Dropzone, Divider, DragDrop, Dropdown, Editor, Empty, Fab, Footer, FooterNav, FooterGroup, formatCurrency, formatDate, formatNumber, getWeekdays, i18n, Icon, IconButton, Image, ImageCropper, Item, initLanguage, Modal, Map, Marquee, NavMenu, Pagination, PasswordField, PhoneField, PinField, plural, PopoverStack, Provider, RadioGroup, Record, Scaffold, Section, Skeleton, Select, setLanguage, Sidebar, SideNav, Slider, t, Table, Tabs, TextField, Textarea, theme, Toast, toast, Toggle, ToggleGroup, ToggleTheme, Tooltip, useAuth, useChat, useClipboard, useFetch, useForm, useLocalStorage, useScroll, useSearch, useTable, useWebSocket, Video };
|
|
90
|
+
export type { IconData, SideNavItem, SideNavSubItem, DragDropItem, DragDropGroup, PromptMessage, PromptState, LatLng, MapMarker, RouteInfo, FabAction };
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import PieChart from './charts/PieChart.svelte';
|
|
|
7
7
|
import Audio from './control/Audio.svelte';
|
|
8
8
|
import Button from './control/Button.svelte';
|
|
9
9
|
import Image from './control/Image.svelte';
|
|
10
|
+
import Fab, {} from './control/Fab.svelte';
|
|
10
11
|
import IconButton from './control/IconButton.svelte';
|
|
11
12
|
import Record from './control/Record.svelte';
|
|
12
13
|
import ToggleTheme from './control/ToggleTheme.svelte';
|
|
@@ -23,6 +24,7 @@ import ChatBox, {} from './display/ChatBox.svelte';
|
|
|
23
24
|
import Chip from './display/Chip.svelte';
|
|
24
25
|
import Code from './display/Code.svelte';
|
|
25
26
|
import Collapsible from './display/Collapsible.svelte';
|
|
27
|
+
import Countdown from './display/Countdown.svelte';
|
|
26
28
|
import Divider from './display/Divider.svelte';
|
|
27
29
|
import Empty from './display/Empty.svelte';
|
|
28
30
|
import Icon, {} from './display/Icon.svelte';
|
|
@@ -84,4 +86,4 @@ import { useAuth } from './hooks/use-auth.svelte.js';
|
|
|
84
86
|
import { theme } from './stores/theme.svelte.js';
|
|
85
87
|
import { useSearch } from './hooks/use-search.svelte.js';
|
|
86
88
|
import { useChat } from './hooks/use-chat.svelte.js';
|
|
87
|
-
export { AreaChart, ArcChart, BarChart, Candlestick, LineChart, PieChart, Alert, AlertDialog, AppBar, Accordion, Avatar, AvatarGroup, Audio, Badge, Button, BottomNav, Carousel, Card, ChatBox, Checkbox, Chip, Code, ColorField, Collapsible, Command, ComboBox, CsvField, DateField, DateRange, Drawer, Dropzone, Divider, DragDrop, Dropdown, Editor, Empty, Footer, FooterNav, FooterGroup, formatCurrency, formatDate, formatNumber, getWeekdays, i18n, Icon, IconButton, Image, ImageCropper, Item, initLanguage, Modal, Map, Marquee, NavMenu, Pagination, PasswordField, PhoneField, PinField, plural, PopoverStack, Provider, RadioGroup, Record, Scaffold, Section, Skeleton, Select, setLanguage, Sidebar, SideNav, Slider, t, Table, Tabs, TextField, Textarea, theme, Toast, toast, Toggle, ToggleGroup, ToggleTheme, Tooltip, useAuth, useChat, useClipboard, useFetch, useForm, useLocalStorage, useScroll, useSearch, useTable, useWebSocket, Video };
|
|
89
|
+
export { AreaChart, ArcChart, BarChart, Candlestick, LineChart, PieChart, Alert, AlertDialog, AppBar, Accordion, Avatar, AvatarGroup, Audio, Badge, Button, BottomNav, Carousel, Card, ChatBox, Checkbox, Chip, Code, Countdown, ColorField, Collapsible, Command, ComboBox, CsvField, DateField, DateRange, Drawer, Dropzone, Divider, DragDrop, Dropdown, Editor, Empty, Fab, Footer, FooterNav, FooterGroup, formatCurrency, formatDate, formatNumber, getWeekdays, i18n, Icon, IconButton, Image, ImageCropper, Item, initLanguage, Modal, Map, Marquee, NavMenu, Pagination, PasswordField, PhoneField, PinField, plural, PopoverStack, Provider, RadioGroup, Record, Scaffold, Section, Skeleton, Select, setLanguage, Sidebar, SideNav, Slider, t, Table, Tabs, TextField, Textarea, theme, Toast, toast, Toggle, ToggleGroup, ToggleTheme, Tooltip, useAuth, useChat, useClipboard, useFetch, useForm, useLocalStorage, useScroll, useSearch, useTable, useWebSocket, Video };
|
|
@@ -54,19 +54,19 @@
|
|
|
54
54
|
<script>
|
|
55
55
|
let themeState = 'light';
|
|
56
56
|
|
|
57
|
-
if (typeof window !== 'undefined' && localStorage) {
|
|
57
|
+
if (typeof window !== 'undefined' && typeof localStorage !== 'undefined') {
|
|
58
58
|
const storedTheme = localStorage.getItem('theme-preference');
|
|
59
59
|
if (storedTheme) {
|
|
60
60
|
themeState = storedTheme;
|
|
61
61
|
} else {
|
|
62
62
|
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
63
|
-
themeState = prefersDark ? '' : 'light';
|
|
63
|
+
themeState = prefersDark ? 'dark' : 'light';
|
|
64
64
|
localStorage.setItem('theme-preference', themeState);
|
|
65
65
|
}
|
|
66
|
-
}
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
if (themeState === 'dark' && typeof document !== 'undefined') {
|
|
68
|
+
document.documentElement.classList.add('dark');
|
|
69
|
+
}
|
|
70
70
|
}
|
|
71
71
|
</script>
|
|
72
72
|
</svelte:head>
|
|
@@ -6,11 +6,7 @@
|
|
|
6
6
|
children: Snippet;
|
|
7
7
|
header?: Snippet;
|
|
8
8
|
footer?: Snippet;
|
|
9
|
-
|
|
10
|
-
contentClass?: string;
|
|
11
|
-
headerClass?: string;
|
|
12
|
-
footerClass?: string;
|
|
13
|
-
variant?:
|
|
9
|
+
color?:
|
|
14
10
|
| 'primary'
|
|
15
11
|
| 'secondary'
|
|
16
12
|
| 'muted'
|
|
@@ -19,7 +15,12 @@
|
|
|
19
15
|
| 'warning'
|
|
20
16
|
| 'danger'
|
|
21
17
|
| 'surface'
|
|
22
|
-
| '
|
|
18
|
+
| 'background';
|
|
19
|
+
variant?: 'solid' | 'soft' | 'outlined' | 'ghost';
|
|
20
|
+
rootClass?: string;
|
|
21
|
+
contentClass?: string;
|
|
22
|
+
headerClass?: string;
|
|
23
|
+
footerClass?: string;
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
const {
|
|
@@ -30,10 +31,11 @@
|
|
|
30
31
|
contentClass,
|
|
31
32
|
headerClass,
|
|
32
33
|
footerClass,
|
|
34
|
+
color = 'surface',
|
|
33
35
|
variant = 'ghost'
|
|
34
36
|
}: Props = $props();
|
|
35
37
|
|
|
36
|
-
const
|
|
38
|
+
const colors = {
|
|
37
39
|
primary: 'is-primary',
|
|
38
40
|
secondary: 'is-secondary',
|
|
39
41
|
muted: 'is-muted',
|
|
@@ -42,11 +44,18 @@
|
|
|
42
44
|
warning: 'is-warning',
|
|
43
45
|
danger: 'is-danger',
|
|
44
46
|
surface: 'is-surface',
|
|
47
|
+
background: 'is-background'
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const variants = {
|
|
51
|
+
solid: 'is-solid',
|
|
52
|
+
soft: 'is-soft',
|
|
53
|
+
outlined: 'is-outlined',
|
|
45
54
|
ghost: 'is-ghost'
|
|
46
55
|
};
|
|
47
56
|
</script>
|
|
48
57
|
|
|
49
|
-
<aside class={cn('sidebar',
|
|
58
|
+
<aside class={cn('sidebar', colors[color], variants[variant], rootClass)}>
|
|
50
59
|
{#if header}
|
|
51
60
|
<div class={cn('sidebar-header', headerClass)}>
|
|
52
61
|
{@render header()}
|
|
@@ -3,11 +3,12 @@ type Props = {
|
|
|
3
3
|
children: Snippet;
|
|
4
4
|
header?: Snippet;
|
|
5
5
|
footer?: Snippet;
|
|
6
|
+
color?: 'primary' | 'secondary' | 'muted' | 'success' | 'info' | 'warning' | 'danger' | 'surface' | 'background';
|
|
7
|
+
variant?: 'solid' | 'soft' | 'outlined' | 'ghost';
|
|
6
8
|
rootClass?: string;
|
|
7
9
|
contentClass?: string;
|
|
8
10
|
headerClass?: string;
|
|
9
11
|
footerClass?: string;
|
|
10
|
-
variant?: 'primary' | 'secondary' | 'muted' | 'success' | 'info' | 'warning' | 'danger' | 'surface' | 'ghost';
|
|
11
12
|
};
|
|
12
13
|
declare const Sidebar: import("svelte").Component<Props, {}, "">;
|
|
13
14
|
type Sidebar = ReturnType<typeof Sidebar>;
|
|
@@ -37,25 +37,25 @@
|
|
|
37
37
|
|
|
38
38
|
&.is-soft {
|
|
39
39
|
&.is-primary {
|
|
40
|
-
@apply bg-
|
|
40
|
+
@apply bg-soft-primary text-primary;
|
|
41
41
|
}
|
|
42
42
|
&.is-secondary {
|
|
43
|
-
@apply bg-
|
|
43
|
+
@apply bg-soft-secondary text-secondary;
|
|
44
44
|
}
|
|
45
45
|
&.is-muted {
|
|
46
|
-
@apply bg-muted text-on-muted;
|
|
46
|
+
@apply bg-soft-muted text-on-muted;
|
|
47
47
|
}
|
|
48
48
|
&.is-success {
|
|
49
|
-
@apply bg-
|
|
49
|
+
@apply bg-soft-success text-success;
|
|
50
50
|
}
|
|
51
51
|
&.is-info {
|
|
52
|
-
@apply bg-
|
|
52
|
+
@apply bg-soft-info text-info;
|
|
53
53
|
}
|
|
54
54
|
&.is-warning {
|
|
55
|
-
@apply bg-
|
|
55
|
+
@apply bg-soft-warning text-warning;
|
|
56
56
|
}
|
|
57
57
|
&.is-danger {
|
|
58
|
-
@apply bg-
|
|
58
|
+
@apply bg-soft-danger text-danger;
|
|
59
59
|
}
|
|
60
60
|
&.is-default {
|
|
61
61
|
@apply bg-background text-on-background;
|
|
@@ -17,25 +17,25 @@
|
|
|
17
17
|
|
|
18
18
|
&.is-soft {
|
|
19
19
|
&.is-primary {
|
|
20
|
-
@apply bg-
|
|
20
|
+
@apply bg-soft-primary text-primary;
|
|
21
21
|
}
|
|
22
22
|
&.is-secondary {
|
|
23
|
-
@apply bg-
|
|
23
|
+
@apply bg-soft-secondary text-secondary;
|
|
24
24
|
}
|
|
25
25
|
&.is-muted {
|
|
26
|
-
@apply bg-muted text-on-muted;
|
|
26
|
+
@apply bg-soft-muted text-on-muted;
|
|
27
27
|
}
|
|
28
28
|
&.is-success {
|
|
29
|
-
@apply bg-
|
|
29
|
+
@apply bg-soft-success text-success;
|
|
30
30
|
}
|
|
31
31
|
&.is-info {
|
|
32
|
-
@apply bg-
|
|
32
|
+
@apply bg-soft-info text-info;
|
|
33
33
|
}
|
|
34
34
|
&.is-warning {
|
|
35
|
-
@apply bg-
|
|
35
|
+
@apply bg-soft-warning text-warning;
|
|
36
36
|
}
|
|
37
37
|
&.is-danger {
|
|
38
|
-
@apply bg-
|
|
38
|
+
@apply bg-soft-danger text-danger;
|
|
39
39
|
}
|
|
40
40
|
&.is-default {
|
|
41
41
|
@apply bg-background text-on-background;
|
|
@@ -13,68 +13,129 @@
|
|
|
13
13
|
.sidebar-body {
|
|
14
14
|
@apply relative flex min-h-0 w-full flex-col gap-3 p-3 overflow-hidden hover:overflow-y-auto;
|
|
15
15
|
}
|
|
16
|
-
}
|
|
17
|
-
.sidebar.is-primary {
|
|
18
|
-
@apply bg-on-primary text-primary;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.sidebar.is-primary.is-solid {
|
|
22
|
-
@apply bg-primary text-on-primary;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.sidebar.is-secondary {
|
|
26
|
-
@apply bg-on-secondary text-secondary;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.sidebar.is-secondary.is-solid {
|
|
30
|
-
@apply bg-secondary text-on-secondary;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.sidebar.is-success {
|
|
34
|
-
@apply bg-on-success text-success;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.sidebar.is-success.is-solid {
|
|
38
|
-
@apply bg-success text-on-success;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.sidebar.is-info {
|
|
42
|
-
@apply bg-on-info text-info;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.sidebar.is-info.is-solid {
|
|
46
|
-
@apply bg-info text-on-info;
|
|
47
|
-
}
|
|
48
16
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
17
|
+
&.is-soft {
|
|
18
|
+
&.is-primary {
|
|
19
|
+
@apply bg-soft-primary text-primary;
|
|
20
|
+
}
|
|
21
|
+
&.is-secondary {
|
|
22
|
+
@apply bg-soft-secondary text-secondary;
|
|
23
|
+
}
|
|
24
|
+
&.is-muted {
|
|
25
|
+
@apply bg-soft-muted text-on-muted;
|
|
26
|
+
}
|
|
27
|
+
&.is-background {
|
|
28
|
+
@apply bg-background text-on-background;
|
|
29
|
+
}
|
|
30
|
+
&.is-surface {
|
|
31
|
+
@apply bg-surface text-on-surface;
|
|
32
|
+
}
|
|
33
|
+
&.is-success {
|
|
34
|
+
@apply bg-soft-success text-success;
|
|
35
|
+
}
|
|
36
|
+
&.is-info {
|
|
37
|
+
@apply bg-soft-info text-info;
|
|
38
|
+
}
|
|
39
|
+
&.is-warning {
|
|
40
|
+
@apply bg-soft-warning text-warning;
|
|
41
|
+
}
|
|
42
|
+
&.is-danger {
|
|
43
|
+
@apply bg-soft-danger text-danger;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
68
46
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
47
|
+
&.is-solid {
|
|
48
|
+
&.is-primary {
|
|
49
|
+
@apply bg-primary text-on-primary;
|
|
50
|
+
}
|
|
51
|
+
&.is-secondary {
|
|
52
|
+
@apply bg-secondary text-on-secondary;
|
|
53
|
+
}
|
|
54
|
+
&.is-muted {
|
|
55
|
+
@apply bg-muted text-on-muted;
|
|
56
|
+
}
|
|
57
|
+
&.is-background {
|
|
58
|
+
@apply bg-background text-on-background;
|
|
59
|
+
}
|
|
60
|
+
&.is-surface {
|
|
61
|
+
@apply bg-surface text-on-surface;
|
|
62
|
+
}
|
|
63
|
+
&.is-success {
|
|
64
|
+
@apply bg-success text-on-success;
|
|
65
|
+
}
|
|
66
|
+
&.is-info {
|
|
67
|
+
@apply bg-info text-on-info;
|
|
68
|
+
}
|
|
69
|
+
&.is-warning {
|
|
70
|
+
@apply bg-warning text-on-warning;
|
|
71
|
+
}
|
|
72
|
+
&.is-danger {
|
|
73
|
+
@apply bg-danger text-on-danger;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
72
76
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
&.is-outlined {
|
|
78
|
+
@apply border;
|
|
79
|
+
|
|
80
|
+
&.is-primary {
|
|
81
|
+
@apply border-primary text-primary;
|
|
82
|
+
}
|
|
83
|
+
&.is-secondary {
|
|
84
|
+
@apply border-secondary text-secondary;
|
|
85
|
+
}
|
|
86
|
+
&.is-muted {
|
|
87
|
+
@apply border-muted text-on-muted;
|
|
88
|
+
}
|
|
89
|
+
&.is-background {
|
|
90
|
+
@apply border-on-background text-on-background;
|
|
91
|
+
}
|
|
92
|
+
&.is-surface {
|
|
93
|
+
@apply border-on-surface text-on-surface;
|
|
94
|
+
}
|
|
95
|
+
&.is-success {
|
|
96
|
+
@apply border-success text-success;
|
|
97
|
+
}
|
|
98
|
+
&.is-info {
|
|
99
|
+
@apply border-info text-info;
|
|
100
|
+
}
|
|
101
|
+
&.is-warning {
|
|
102
|
+
@apply border-warning text-warning;
|
|
103
|
+
}
|
|
104
|
+
&.is-danger {
|
|
105
|
+
@apply border-danger text-danger;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
76
108
|
|
|
77
|
-
|
|
78
|
-
|
|
109
|
+
&.is-ghost {
|
|
110
|
+
@apply bg-transparent;
|
|
111
|
+
|
|
112
|
+
&.is-primary {
|
|
113
|
+
@apply text-primary;
|
|
114
|
+
}
|
|
115
|
+
&.is-secondary {
|
|
116
|
+
@apply text-secondary;
|
|
117
|
+
}
|
|
118
|
+
&.is-muted {
|
|
119
|
+
@apply text-on-muted;
|
|
120
|
+
}
|
|
121
|
+
&.is-background {
|
|
122
|
+
@apply text-on-background;
|
|
123
|
+
}
|
|
124
|
+
&.is-surface {
|
|
125
|
+
@apply text-on-surface;
|
|
126
|
+
}
|
|
127
|
+
&.is-success {
|
|
128
|
+
@apply text-success;
|
|
129
|
+
}
|
|
130
|
+
&.is-info {
|
|
131
|
+
@apply text-info;
|
|
132
|
+
}
|
|
133
|
+
&.is-warning {
|
|
134
|
+
@apply text-warning;
|
|
135
|
+
}
|
|
136
|
+
&.is-danger {
|
|
137
|
+
@apply text-danger;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
79
140
|
}
|
|
80
141
|
}
|
|
@@ -14,18 +14,21 @@
|
|
|
14
14
|
isActive?: boolean;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
type Color =
|
|
18
|
+
| 'primary'
|
|
19
|
+
| 'secondary'
|
|
20
|
+
| 'muted'
|
|
21
|
+
| 'success'
|
|
22
|
+
| 'info'
|
|
23
|
+
| 'warning'
|
|
24
|
+
| 'danger'
|
|
25
|
+
| 'surface'
|
|
26
|
+
| 'background';
|
|
27
|
+
|
|
17
28
|
type Props = {
|
|
18
29
|
items: BottomNavItem[];
|
|
19
|
-
color?:
|
|
20
|
-
|
|
21
|
-
| 'secondary'
|
|
22
|
-
| 'muted'
|
|
23
|
-
| 'success'
|
|
24
|
-
| 'info'
|
|
25
|
-
| 'warning'
|
|
26
|
-
| 'danger'
|
|
27
|
-
| 'surface'
|
|
28
|
-
| 'default';
|
|
30
|
+
color?: Color;
|
|
31
|
+
fabColor?: Color;
|
|
29
32
|
variant?: 'solid' | 'soft' | 'blur';
|
|
30
33
|
activeStyle?: 'line' | 'pill';
|
|
31
34
|
size?: 'sm' | 'md' | 'lg';
|
|
@@ -37,8 +40,9 @@
|
|
|
37
40
|
const {
|
|
38
41
|
items = [],
|
|
39
42
|
class: className,
|
|
40
|
-
color = '
|
|
41
|
-
|
|
43
|
+
color = 'surface',
|
|
44
|
+
fabColor = 'primary',
|
|
45
|
+
variant = 'solid',
|
|
42
46
|
activeStyle = 'line',
|
|
43
47
|
size = 'md',
|
|
44
48
|
isBlock = false,
|
|
@@ -54,7 +58,7 @@
|
|
|
54
58
|
warning: 'is-warning',
|
|
55
59
|
danger: 'is-danger',
|
|
56
60
|
surface: 'is-surface',
|
|
57
|
-
|
|
61
|
+
background: 'is-background'
|
|
58
62
|
};
|
|
59
63
|
|
|
60
64
|
const variants = {
|
|
@@ -104,7 +108,12 @@
|
|
|
104
108
|
>
|
|
105
109
|
{#each items as item}
|
|
106
110
|
{@const active = isItemActive(item)}
|
|
107
|
-
{@const itemClass = cn(
|
|
111
|
+
{@const itemClass = cn(
|
|
112
|
+
'bottomnav-item',
|
|
113
|
+
active && 'is-active',
|
|
114
|
+
item.isFab && 'is-fab',
|
|
115
|
+
item.isFab && colors[fabColor]
|
|
116
|
+
)}
|
|
108
117
|
|
|
109
118
|
{#if item.href}
|
|
110
119
|
<a href={item.href} class={itemClass}>
|