@rkosafo/cai.components 0.0.75 → 0.0.79
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/forms/button-toggle/ButtonToggle.svelte +119 -0
- package/dist/forms/button-toggle/ButtonToggle.svelte.d.ts +139 -0
- package/dist/forms/button-toggle/ButtonToggleGroup.svelte +0 -0
- package/dist/forms/button-toggle/ButtonToggleGroup.svelte.d.ts +26 -0
- package/dist/forms/button-toggle/CheckIcon.svelte +28 -0
- package/dist/forms/button-toggle/CheckIcon.svelte.d.ts +4 -0
- package/dist/forms/button-toggle/index.d.ts +4 -0
- package/dist/forms/button-toggle/index.js +4 -0
- package/dist/forms/button-toggle/theme.d.ts +347 -0
- package/dist/forms/button-toggle/theme.js +129 -0
- package/dist/forms/toggle/Toggle.svelte +70 -0
- package/dist/forms/toggle/Toggle.svelte.d.ts +3 -0
- package/dist/forms/toggle/index.d.ts +2 -0
- package/dist/forms/toggle/index.js +2 -0
- package/dist/forms/toggle/theme.d.ts +280 -0
- package/dist/forms/toggle/theme.js +97 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/themes/themes.d.ts +3 -0
- package/dist/themes/themes.js +3 -0
- package/dist/types/index.d.ts +59 -1
- package/dist/ui/modal/theme.d.ts +26 -26
- package/dist/ui/modal/theme.js +25 -25
- package/dist/ui/speedDial/SpeedDial.svelte +77 -0
- package/dist/ui/speedDial/SpeedDial.svelte.d.ts +21 -0
- package/dist/ui/speedDial/SpeedDialButton.svelte +75 -0
- package/dist/ui/speedDial/SpeedDialButton.svelte.d.ts +20 -0
- package/dist/ui/speedDial/SpeedDialTrigger.svelte +79 -0
- package/dist/ui/speedDial/SpeedDialTrigger.svelte.d.ts +18 -0
- package/dist/ui/speedDial/index.d.ts +4 -0
- package/dist/ui/speedDial/index.js +4 -0
- package/dist/ui/speedDial/theme.d.ts +75 -0
- package/dist/ui/speedDial/theme.js +35 -0
- package/dist/ui/tab/Tab.svelte +45 -19
- package/dist/ui/toast/index.d.ts +1 -2
- package/dist/ui/toast/index.js +3 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +10 -0
- package/package.json +2 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HTMLAnchorAttributes, HTMLAttributes, HTMLButtonAttributes, HTMLDialogAttributes, HTMLInputAttributes, HTMLLabelAttributes, HTMLTextareaAttributes } from 'svelte/elements';
|
|
1
|
+
import type { HTMLAnchorAttributes, HTMLAttributes, HTMLButtonAttributes, HTMLDialogAttributes, HTMLInputAttributes, HTMLLabelAttributes, HTMLTextareaAttributes, SVGAttributes } from 'svelte/elements';
|
|
2
2
|
import type { Middleware, Placement, Strategy } from '@floating-ui/dom';
|
|
3
3
|
import type { Component, Snippet } from 'svelte';
|
|
4
4
|
import type { BlurParams, FadeParams, FlyParams, ScaleParams, SlideParams, TransitionConfig } from 'svelte/transition';
|
|
@@ -24,6 +24,8 @@ import type { AccordionItemVariants, AccordionVariants } from '../ui/accordion/t
|
|
|
24
24
|
import type { TabsVaraints } from '../ui/tab/theme.js';
|
|
25
25
|
import type { ACTION_BUTTON_KINDS } from '../ui/buttons/ActionButton.svelte';
|
|
26
26
|
import type { TooltipVariants } from '../ui/tooltip/theme.js';
|
|
27
|
+
import type { ButtonToggleVariants } from '../forms/button-toggle/theme.js';
|
|
28
|
+
import type { SpeedDialButtonVariants, SpeedDialVariants } from '../ui/speedDial/theme.js';
|
|
27
29
|
export interface TFSidebarProps {
|
|
28
30
|
homeUrl: string;
|
|
29
31
|
logoUrl: string;
|
|
@@ -786,11 +788,13 @@ export interface TabProps {
|
|
|
786
788
|
tabContentClass?: ClassValue;
|
|
787
789
|
tabContentActiveClass?: ClassValue;
|
|
788
790
|
tabContentInactiveClass?: ClassValue;
|
|
791
|
+
tabColor?: ClassValue;
|
|
789
792
|
onTabChange?: (tabId: number | string) => void;
|
|
790
793
|
onTabAdd?: (val: any) => void;
|
|
791
794
|
onRemoveTab?: (val: RemoveTabEvent) => void;
|
|
792
795
|
tabStyle?: TabsVaraints['tabStyle'];
|
|
793
796
|
divider?: boolean;
|
|
797
|
+
hideTabs?: boolean;
|
|
794
798
|
}
|
|
795
799
|
export interface BoxProps extends svelteHTML.HTMLAttributes<HTMLDivElement> {
|
|
796
800
|
children: any;
|
|
@@ -881,5 +885,59 @@ export interface FormFileUploadProps {
|
|
|
881
885
|
contextKey?: any;
|
|
882
886
|
onChange?: (val: any) => void;
|
|
883
887
|
}
|
|
888
|
+
export type CheckIconProps = SVGAttributes<SVGSVGElement>;
|
|
889
|
+
export type ButtonToggleProps = ButtonToggleVariants & HTMLButtonAttributes & {
|
|
890
|
+
value: string;
|
|
891
|
+
selected?: boolean;
|
|
892
|
+
children: Snippet;
|
|
893
|
+
iconSlot?: Snippet;
|
|
894
|
+
color?: ButtonToggleVariants['color'];
|
|
895
|
+
iconClass?: ClassValue;
|
|
896
|
+
contentClass?: ClassValue;
|
|
897
|
+
txtClass?: ClassValue;
|
|
898
|
+
};
|
|
884
899
|
export interface TooltipProps extends TooltipVariants, PopperProps {
|
|
885
900
|
}
|
|
901
|
+
export interface SpeedCtxType {
|
|
902
|
+
pill: boolean;
|
|
903
|
+
tooltip: Placement | 'none';
|
|
904
|
+
textOutside: boolean;
|
|
905
|
+
}
|
|
906
|
+
type BaseSpeedDialTriggerProps = {
|
|
907
|
+
children?: any;
|
|
908
|
+
name?: string;
|
|
909
|
+
pill?: boolean;
|
|
910
|
+
icon?: Snippet;
|
|
911
|
+
class?: string;
|
|
912
|
+
[key: string]: any;
|
|
913
|
+
};
|
|
914
|
+
export type RegularSpeedDialTriggerProps = BaseSpeedDialTriggerProps & {
|
|
915
|
+
gradient?: false;
|
|
916
|
+
color?: ButtonVariants['color'];
|
|
917
|
+
};
|
|
918
|
+
export type GradientSpeedDialTriggerProps = BaseSpeedDialTriggerProps & {
|
|
919
|
+
gradient: true;
|
|
920
|
+
color?: GradientButtonColor;
|
|
921
|
+
};
|
|
922
|
+
export type SpeedDialTriggerProps = RegularSpeedDialTriggerProps | GradientSpeedDialTriggerProps;
|
|
923
|
+
export type SpeedDialProps = PopperProps & SpeedDialVariants & {
|
|
924
|
+
children: Snippet;
|
|
925
|
+
button?: Snippet;
|
|
926
|
+
popperClass?: ClassValue;
|
|
927
|
+
placement?: Placement;
|
|
928
|
+
tooltip?: Placement | 'none';
|
|
929
|
+
trigger?: PopperProps['trigger'];
|
|
930
|
+
textOutside?: boolean;
|
|
931
|
+
pill?: boolean;
|
|
932
|
+
ontoggle?: PopperProps['ontoggle'];
|
|
933
|
+
onbeforetoggle?: PopperProps['onbeforetoggle'];
|
|
934
|
+
isOpen?: boolean;
|
|
935
|
+
};
|
|
936
|
+
export type SpeedDialButtonProps = ButtonProps & SpeedDialButtonVariants & {
|
|
937
|
+
name?: string;
|
|
938
|
+
tooltip?: Placement | 'none';
|
|
939
|
+
pill?: boolean;
|
|
940
|
+
textOutside?: boolean;
|
|
941
|
+
textClass?: ClassValue;
|
|
942
|
+
};
|
|
943
|
+
export {};
|
package/dist/ui/modal/theme.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Classes } from
|
|
2
|
-
import { type VariantProps } from
|
|
1
|
+
import type { Classes } from '../../themes/themeUtils.js';
|
|
2
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
3
3
|
export type ModalVariants = VariantProps<typeof modal> & Classes<typeof modal>;
|
|
4
4
|
export declare const modal: import("tailwind-variants").TVReturnType<{
|
|
5
5
|
fullscreen: {
|
|
@@ -8,31 +8,31 @@ export declare const modal: import("tailwind-variants").TVReturnType<{
|
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
placement: {
|
|
11
|
-
|
|
11
|
+
'top-left': {
|
|
12
12
|
base: string;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
'top-center': {
|
|
15
15
|
base: string;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
'top-right': {
|
|
18
18
|
base: string;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
'center-left': {
|
|
21
21
|
base: string;
|
|
22
22
|
};
|
|
23
23
|
center: {
|
|
24
24
|
base: string;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
'center-right': {
|
|
27
27
|
base: string;
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
'bottom-left': {
|
|
30
30
|
base: string;
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
'bottom-center': {
|
|
33
33
|
base: string;
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
'bottom-right': {
|
|
36
36
|
base: string;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
@@ -70,31 +70,31 @@ export declare const modal: import("tailwind-variants").TVReturnType<{
|
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
placement: {
|
|
73
|
-
|
|
73
|
+
'top-left': {
|
|
74
74
|
base: string;
|
|
75
75
|
};
|
|
76
|
-
|
|
76
|
+
'top-center': {
|
|
77
77
|
base: string;
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
'top-right': {
|
|
80
80
|
base: string;
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
'center-left': {
|
|
83
83
|
base: string;
|
|
84
84
|
};
|
|
85
85
|
center: {
|
|
86
86
|
base: string;
|
|
87
87
|
};
|
|
88
|
-
|
|
88
|
+
'center-right': {
|
|
89
89
|
base: string;
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
'bottom-left': {
|
|
92
92
|
base: string;
|
|
93
93
|
};
|
|
94
|
-
|
|
94
|
+
'bottom-center': {
|
|
95
95
|
base: string;
|
|
96
96
|
};
|
|
97
|
-
|
|
97
|
+
'bottom-right': {
|
|
98
98
|
base: string;
|
|
99
99
|
};
|
|
100
100
|
};
|
|
@@ -132,31 +132,31 @@ export declare const modal: import("tailwind-variants").TVReturnType<{
|
|
|
132
132
|
};
|
|
133
133
|
};
|
|
134
134
|
placement: {
|
|
135
|
-
|
|
135
|
+
'top-left': {
|
|
136
136
|
base: string;
|
|
137
137
|
};
|
|
138
|
-
|
|
138
|
+
'top-center': {
|
|
139
139
|
base: string;
|
|
140
140
|
};
|
|
141
|
-
|
|
141
|
+
'top-right': {
|
|
142
142
|
base: string;
|
|
143
143
|
};
|
|
144
|
-
|
|
144
|
+
'center-left': {
|
|
145
145
|
base: string;
|
|
146
146
|
};
|
|
147
147
|
center: {
|
|
148
148
|
base: string;
|
|
149
149
|
};
|
|
150
|
-
|
|
150
|
+
'center-right': {
|
|
151
151
|
base: string;
|
|
152
152
|
};
|
|
153
|
-
|
|
153
|
+
'bottom-left': {
|
|
154
154
|
base: string;
|
|
155
155
|
};
|
|
156
|
-
|
|
156
|
+
'bottom-center': {
|
|
157
157
|
base: string;
|
|
158
158
|
};
|
|
159
|
-
|
|
159
|
+
'bottom-right': {
|
|
160
160
|
base: string;
|
|
161
161
|
};
|
|
162
162
|
};
|
package/dist/ui/modal/theme.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { tv } from
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const modal = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base:
|
|
5
|
-
form:
|
|
6
|
-
header:
|
|
7
|
-
footer:
|
|
8
|
-
body:
|
|
9
|
-
close:
|
|
4
|
+
base: 'backdrop:bg-black/80 open:flex flex-col w-full max-h-[90hv] rounded-lg divide-y text-gray-500 dark:text-gray-400 border-gray-300 dark:border-gray-800 divide-gray-300 dark:divide-gray-700 bg-white dark:bg-gray-800 pointer-events-auto',
|
|
5
|
+
form: 'flex flex-col rounded-lg divide-y',
|
|
6
|
+
header: 'flex items-center p-4 md:p-5 justify-between rounded-t-lg shrink-0 text-xl font-semibold text-gray-900 dark:text-white',
|
|
7
|
+
footer: 'flex items-center p-4 md:p-5 space-x-3 rtl:space-x-reverse rounded-b-lg shrink-0',
|
|
8
|
+
body: 'p-4 md:p-5 space-y-4 overflow-y-auto overscroll-contain',
|
|
9
|
+
close: 'absolute top-3 end-2.5'
|
|
10
10
|
},
|
|
11
11
|
variants: {
|
|
12
12
|
fullscreen: {
|
|
13
13
|
true: {
|
|
14
|
-
base:
|
|
14
|
+
base: 'fixed inset-0 w-screen h-screen max-w-none max-h-none m-0 p-0 border-none rounded-none bg-white dark:bg-gray-900'
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
placement: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
center: { base:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
'top-left': { base: 'top-0 left-0' },
|
|
19
|
+
'top-center': { base: 'top-0 left-1/2 -translate-x-1/2' },
|
|
20
|
+
'top-right': { base: 'top-0 left-full -translate-x-full' },
|
|
21
|
+
'center-left': { base: 'top-1/2 left-0 -translate-y-1/2' },
|
|
22
|
+
center: { base: 'top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2' },
|
|
23
|
+
'center-right': { base: 'top-1/2 left-full -translate-x-full -translate-y-1/2' },
|
|
24
|
+
'bottom-left': { base: 'top-full -translate-y-full left-0' },
|
|
25
|
+
'bottom-center': { base: 'top-full -translate-y-full left-1/2 -translate-x-1/2' },
|
|
26
|
+
'bottom-right': { base: 'top-full -translate-y-full left-full -translate-x-full' }
|
|
27
27
|
},
|
|
28
28
|
size: {
|
|
29
|
-
none: { base:
|
|
30
|
-
xs: { base:
|
|
31
|
-
sm: { base:
|
|
32
|
-
md: { base:
|
|
33
|
-
lg: { base:
|
|
34
|
-
xl: { base:
|
|
29
|
+
none: { base: '' },
|
|
30
|
+
xs: { base: 'max-w-md' },
|
|
31
|
+
sm: { base: 'max-w-lg' },
|
|
32
|
+
md: { base: 'max-w-2xl' },
|
|
33
|
+
lg: { base: 'max-w-4xl' },
|
|
34
|
+
xl: { base: 'max-w-7xl' }
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
defaultVariants: {
|
|
38
|
-
placement:
|
|
39
|
-
size:
|
|
38
|
+
placement: 'center',
|
|
39
|
+
size: 'md'
|
|
40
40
|
}
|
|
41
41
|
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import Popper from '../../utils/Popper.svelte';
|
|
4
|
+
import { getSideAxis } from '@floating-ui/utils';
|
|
5
|
+
import { setContext, untrack } from 'svelte';
|
|
6
|
+
import { speedDial } from './theme.js';
|
|
7
|
+
import type { SpeedDialProps, SpeedCtxType } from '../../index.js';
|
|
8
|
+
import { getTheme, warnThemeDeprecation } from '../../themes/themeUtils.js';
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
children,
|
|
12
|
+
popperClass,
|
|
13
|
+
placement = 'top',
|
|
14
|
+
pill = true,
|
|
15
|
+
tooltip = 'left',
|
|
16
|
+
trigger = 'hover',
|
|
17
|
+
textOutside = false,
|
|
18
|
+
class: className,
|
|
19
|
+
classes,
|
|
20
|
+
isOpen = $bindable(false),
|
|
21
|
+
...restProps
|
|
22
|
+
}: SpeedDialProps = $props();
|
|
23
|
+
|
|
24
|
+
warnThemeDeprecation(
|
|
25
|
+
'SpeedDial',
|
|
26
|
+
untrack(() => ({ popperClass })),
|
|
27
|
+
{ popperClass: 'popper' }
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const styling = $derived(
|
|
31
|
+
classes ?? {
|
|
32
|
+
popper: popperClass
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const theme = $derived(getTheme('speedDial'));
|
|
37
|
+
|
|
38
|
+
$effect(() => {
|
|
39
|
+
setContext<SpeedCtxType>('speed-dial', { pill, tooltip, textOutside });
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
let vertical: boolean = $derived(getSideAxis(placement) === 'y');
|
|
43
|
+
|
|
44
|
+
let { base, popper } = $derived(speedDial({ vertical }));
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<Popper
|
|
48
|
+
{...restProps}
|
|
49
|
+
bind:isOpen
|
|
50
|
+
{trigger}
|
|
51
|
+
arrow={false}
|
|
52
|
+
{placement}
|
|
53
|
+
class={base({ class: clsx(theme?.base, className) })}
|
|
54
|
+
>
|
|
55
|
+
<div class={popper({ class: clsx(theme?.popper, styling.popper) })}>
|
|
56
|
+
{@render children()}
|
|
57
|
+
</div>
|
|
58
|
+
</Popper>
|
|
59
|
+
|
|
60
|
+
<!--
|
|
61
|
+
@component
|
|
62
|
+
[Go to docs](https://flowbite-svelte.com/)
|
|
63
|
+
## Type
|
|
64
|
+
[SpeedDialProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1598)
|
|
65
|
+
## Props
|
|
66
|
+
@prop children
|
|
67
|
+
@prop popperClass
|
|
68
|
+
@prop placement = "top"
|
|
69
|
+
@prop pill = true
|
|
70
|
+
@prop tooltip = "left"
|
|
71
|
+
@prop trigger = "hover"
|
|
72
|
+
@prop textOutside = false
|
|
73
|
+
@prop class: className
|
|
74
|
+
@prop classes
|
|
75
|
+
@prop isOpen = $bindable(false)
|
|
76
|
+
@prop ...restProps
|
|
77
|
+
-->
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SpeedDialProps } from '../../index.js';
|
|
2
|
+
/**
|
|
3
|
+
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
|
+
* ## Type
|
|
5
|
+
* [SpeedDialProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1598)
|
|
6
|
+
* ## Props
|
|
7
|
+
* @prop children
|
|
8
|
+
* @prop popperClass
|
|
9
|
+
* @prop placement = "top"
|
|
10
|
+
* @prop pill = true
|
|
11
|
+
* @prop tooltip = "left"
|
|
12
|
+
* @prop trigger = "hover"
|
|
13
|
+
* @prop textOutside = false
|
|
14
|
+
* @prop class: className
|
|
15
|
+
* @prop classes
|
|
16
|
+
* @prop isOpen = $bindable(false)
|
|
17
|
+
* @prop ...restProps
|
|
18
|
+
*/
|
|
19
|
+
declare const SpeedDial: import("svelte").Component<SpeedDialProps, {}, "isOpen">;
|
|
20
|
+
type SpeedDial = ReturnType<typeof SpeedDial>;
|
|
21
|
+
export default SpeedDial;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Placement } from '@floating-ui/dom';
|
|
3
|
+
import { getContext, untrack } from 'svelte';
|
|
4
|
+
import { speedDialButton } from './theme.js';
|
|
5
|
+
import type { SpeedCtxType, SpeedDialButtonProps } from '../../index.js';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { getTheme, warnThemeDeprecation } from '../../themes/themeUtils.js';
|
|
8
|
+
import Button from '../buttons/Button.svelte';
|
|
9
|
+
import Tooltip from '../tooltip/Tooltip.svelte';
|
|
10
|
+
|
|
11
|
+
const context = getContext<SpeedCtxType>('speed-dial');
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
children,
|
|
15
|
+
name = '',
|
|
16
|
+
color = 'light',
|
|
17
|
+
tooltip: _tooltip,
|
|
18
|
+
pill = context.pill,
|
|
19
|
+
textOutside = context.textOutside,
|
|
20
|
+
textClass,
|
|
21
|
+
class: className,
|
|
22
|
+
classes,
|
|
23
|
+
...restProps
|
|
24
|
+
}: SpeedDialButtonProps = $props();
|
|
25
|
+
|
|
26
|
+
warnThemeDeprecation(
|
|
27
|
+
'SpeedDialButton',
|
|
28
|
+
untrack(() => ({ textClass })),
|
|
29
|
+
{ textClass: 'span' }
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const styling = $derived(
|
|
33
|
+
classes ?? {
|
|
34
|
+
span: textClass
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
let tooltip = $derived<Placement | 'none'>(_tooltip ?? context.tooltip);
|
|
39
|
+
|
|
40
|
+
const theme = $derived(getTheme('speedDialButton'));
|
|
41
|
+
|
|
42
|
+
let { base, span } = $derived(speedDialButton({ textOutside, noTooltip: tooltip === 'none' }));
|
|
43
|
+
let spanCls = $derived(
|
|
44
|
+
tooltip === 'none' || textOutside ? span({ class: clsx(theme?.span, styling.span) }) : 'sr-only'
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
let buttonCls = $derived(base({ class: clsx(theme?.base, className) }));
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<Button {pill} {color} {...restProps} class={buttonCls}>
|
|
51
|
+
{@render children?.()}
|
|
52
|
+
<span class={spanCls}>{name}</span>
|
|
53
|
+
</Button>
|
|
54
|
+
|
|
55
|
+
{#if tooltip !== 'none'}
|
|
56
|
+
<Tooltip placement={tooltip} type="dark">{name}</Tooltip>
|
|
57
|
+
{/if}
|
|
58
|
+
|
|
59
|
+
<!--
|
|
60
|
+
@component
|
|
61
|
+
[Go to docs](https://flowbite-svelte.com/)
|
|
62
|
+
## Type
|
|
63
|
+
[SpeedDialButtonProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1613)
|
|
64
|
+
## Props
|
|
65
|
+
@prop children
|
|
66
|
+
@prop name = ""
|
|
67
|
+
@prop color = "light"
|
|
68
|
+
@prop tooltip: _tooltip
|
|
69
|
+
@prop pill = context.pill
|
|
70
|
+
@prop textOutside = context.textOutside
|
|
71
|
+
@prop textClass
|
|
72
|
+
@prop class: className
|
|
73
|
+
@prop classes
|
|
74
|
+
@prop ...restProps
|
|
75
|
+
-->
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SpeedDialButtonProps } from '../../index.js';
|
|
2
|
+
/**
|
|
3
|
+
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
|
+
* ## Type
|
|
5
|
+
* [SpeedDialButtonProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1613)
|
|
6
|
+
* ## Props
|
|
7
|
+
* @prop children
|
|
8
|
+
* @prop name = ""
|
|
9
|
+
* @prop color = "light"
|
|
10
|
+
* @prop tooltip: _tooltip
|
|
11
|
+
* @prop pill = context.pill
|
|
12
|
+
* @prop textOutside = context.textOutside
|
|
13
|
+
* @prop textClass
|
|
14
|
+
* @prop class: className
|
|
15
|
+
* @prop classes
|
|
16
|
+
* @prop ...restProps
|
|
17
|
+
*/
|
|
18
|
+
declare const SpeedDialButton: import("svelte").Component<SpeedDialButtonProps, {}, "">;
|
|
19
|
+
type SpeedDialButton = ReturnType<typeof SpeedDialButton>;
|
|
20
|
+
export default SpeedDialButton;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
|
|
4
|
+
import type { SpeedDialTriggerProps, ButtonProps, GradientButtonProps } from '../../index.js';
|
|
5
|
+
import GradientButton from '../buttons/GradientButton.svelte';
|
|
6
|
+
import Button from '../buttons/Button.svelte';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
children,
|
|
10
|
+
name = 'Open actions menu',
|
|
11
|
+
gradient = false,
|
|
12
|
+
icon,
|
|
13
|
+
pill = true,
|
|
14
|
+
color,
|
|
15
|
+
class: className,
|
|
16
|
+
...restProps
|
|
17
|
+
}: SpeedDialTriggerProps = $props();
|
|
18
|
+
|
|
19
|
+
const buttonProps = $derived({
|
|
20
|
+
pill,
|
|
21
|
+
color,
|
|
22
|
+
...restProps,
|
|
23
|
+
class: ['group p-3!', clsx(className)]
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
{#snippet moving_cross()}
|
|
28
|
+
<svg
|
|
29
|
+
aria-hidden="true"
|
|
30
|
+
class="h-8 w-8 transition-transform group-hover:rotate-45"
|
|
31
|
+
fill="none"
|
|
32
|
+
stroke="currentColor"
|
|
33
|
+
viewBox="0 0 24 24"
|
|
34
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
35
|
+
>
|
|
36
|
+
<path
|
|
37
|
+
stroke-linecap="round"
|
|
38
|
+
stroke-linejoin="round"
|
|
39
|
+
stroke-width="2"
|
|
40
|
+
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
|
|
41
|
+
/>
|
|
42
|
+
</svg>
|
|
43
|
+
{/snippet}
|
|
44
|
+
|
|
45
|
+
{#if gradient}
|
|
46
|
+
<GradientButton {...buttonProps as GradientButtonProps}>
|
|
47
|
+
{#if icon}
|
|
48
|
+
{@render icon()}
|
|
49
|
+
{:else}
|
|
50
|
+
{@render moving_cross()}
|
|
51
|
+
{/if}
|
|
52
|
+
<span class="sr-only">{name}</span>
|
|
53
|
+
</GradientButton>
|
|
54
|
+
{:else}
|
|
55
|
+
<Button {...buttonProps as ButtonProps}>
|
|
56
|
+
{#if icon}
|
|
57
|
+
{@render icon()}
|
|
58
|
+
{:else}
|
|
59
|
+
{@render moving_cross()}
|
|
60
|
+
{/if}
|
|
61
|
+
<span class="sr-only">{name}</span>
|
|
62
|
+
</Button>
|
|
63
|
+
{/if}
|
|
64
|
+
|
|
65
|
+
<!--
|
|
66
|
+
@component
|
|
67
|
+
[Go to docs](https://flowbite-svelte.com/)
|
|
68
|
+
## Type
|
|
69
|
+
[SpeedDialTriggerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1596)
|
|
70
|
+
## Props
|
|
71
|
+
@prop children
|
|
72
|
+
@prop name = "Open actions menu"
|
|
73
|
+
@prop gradient = false
|
|
74
|
+
@prop icon
|
|
75
|
+
@prop pill = true
|
|
76
|
+
@prop color
|
|
77
|
+
@prop class: className
|
|
78
|
+
@prop ...restProps
|
|
79
|
+
-->
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SpeedDialTriggerProps } from '../../index.js';
|
|
2
|
+
/**
|
|
3
|
+
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
|
+
* ## Type
|
|
5
|
+
* [SpeedDialTriggerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1596)
|
|
6
|
+
* ## Props
|
|
7
|
+
* @prop children
|
|
8
|
+
* @prop name = "Open actions menu"
|
|
9
|
+
* @prop gradient = false
|
|
10
|
+
* @prop icon
|
|
11
|
+
* @prop pill = true
|
|
12
|
+
* @prop color
|
|
13
|
+
* @prop class: className
|
|
14
|
+
* @prop ...restProps
|
|
15
|
+
*/
|
|
16
|
+
declare const SpeedDialTrigger: import("svelte").Component<SpeedDialTriggerProps, {}, "">;
|
|
17
|
+
type SpeedDialTrigger = ReturnType<typeof SpeedDialTrigger>;
|
|
18
|
+
export default SpeedDialTrigger;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { Classes } from '../../themes/themeUtils.js';
|
|
2
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
3
|
+
export type SpeedDialVariants = VariantProps<typeof speedDial> & Classes<typeof speedDial>;
|
|
4
|
+
export type SpeedDialButtonVariants = VariantProps<typeof speedDialButton> & Classes<typeof speedDialButton>;
|
|
5
|
+
export declare const speedDial: import("tailwind-variants").TVReturnType<{
|
|
6
|
+
vertical: {
|
|
7
|
+
true: {
|
|
8
|
+
popper: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}, {
|
|
12
|
+
base: string;
|
|
13
|
+
popper: string;
|
|
14
|
+
}, undefined, {
|
|
15
|
+
vertical: {
|
|
16
|
+
true: {
|
|
17
|
+
popper: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}, {
|
|
21
|
+
base: string;
|
|
22
|
+
popper: string;
|
|
23
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
24
|
+
vertical: {
|
|
25
|
+
true: {
|
|
26
|
+
popper: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}, {
|
|
30
|
+
base: string;
|
|
31
|
+
popper: string;
|
|
32
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
33
|
+
export declare const speedDialButton: import("tailwind-variants").TVReturnType<{
|
|
34
|
+
noTooltip: {
|
|
35
|
+
false: {};
|
|
36
|
+
true: {};
|
|
37
|
+
};
|
|
38
|
+
textOutside: {
|
|
39
|
+
true: {
|
|
40
|
+
base: string;
|
|
41
|
+
span: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}, {
|
|
45
|
+
base: string;
|
|
46
|
+
span: string;
|
|
47
|
+
}, undefined, {
|
|
48
|
+
noTooltip: {
|
|
49
|
+
false: {};
|
|
50
|
+
true: {};
|
|
51
|
+
};
|
|
52
|
+
textOutside: {
|
|
53
|
+
true: {
|
|
54
|
+
base: string;
|
|
55
|
+
span: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}, {
|
|
59
|
+
base: string;
|
|
60
|
+
span: string;
|
|
61
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
62
|
+
noTooltip: {
|
|
63
|
+
false: {};
|
|
64
|
+
true: {};
|
|
65
|
+
};
|
|
66
|
+
textOutside: {
|
|
67
|
+
true: {
|
|
68
|
+
base: string;
|
|
69
|
+
span: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}, {
|
|
73
|
+
base: string;
|
|
74
|
+
span: string;
|
|
75
|
+
}, undefined, unknown, unknown, undefined>>;
|