@rkosafo/cai.components 0.0.78 → 0.0.80
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 +8 -8
- package/dist/baseEditor/index.svelte +32 -32
- package/dist/builders/filters/FilterBuilder.svelte +641 -641
- package/dist/forms/FormCheckbox/FormCheckbox.svelte +53 -53
- package/dist/forms/FormClEditor/ClEdito.svelte +68 -68
- package/dist/forms/FormDatepicker/FormDatepicker.svelte +159 -159
- package/dist/forms/FormFileUpload/FormFileUplad.svelte +134 -134
- package/dist/forms/FormInput/FormInput.svelte +87 -87
- package/dist/forms/FormRadio/FormRadio.svelte +53 -53
- package/dist/forms/FormSelect/FormSelect.svelte +88 -88
- package/dist/forms/FormTextarea/FormTextarea.svelte +78 -78
- package/dist/forms/button-toggle/ButtonToggle.svelte +119 -119
- package/dist/forms/button-toggle/CheckIcon.svelte +28 -28
- package/dist/forms/checkbox/Checkbox.svelte +82 -82
- package/dist/forms/checkbox/CheckboxButton.svelte +92 -92
- package/dist/forms/datepicker/Datepicker.svelte +707 -707
- package/dist/forms/form/Form.svelte +69 -69
- package/dist/forms/input/Input.svelte +363 -363
- package/dist/forms/label/Label.svelte +38 -38
- package/dist/forms/radio/Radio.svelte +48 -48
- package/dist/forms/radio/RadioButton.svelte +22 -22
- package/dist/forms/select/Select.svelte +56 -56
- package/dist/forms/textarea/Textarea.svelte +165 -165
- package/dist/forms/toggle/Toggle.svelte +70 -70
- package/dist/layout/Chat/CategorySelector.svelte +52 -52
- package/dist/layout/Chat/ChatEntry.svelte +246 -246
- package/dist/layout/Chat/ChatEntrySkeleton.svelte +81 -81
- package/dist/layout/Chat/ChatHeader.svelte +172 -172
- package/dist/layout/Chat/ChatInput.svelte +207 -207
- package/dist/layout/Chat/DraggableWindow.svelte +230 -230
- package/dist/layout/Chat/PreviewPage.svelte +182 -182
- package/dist/layout/Chat/RichText.svelte +216 -216
- package/dist/layout/ComponentCanvas/Canvas.svelte +40 -40
- package/dist/layout/ComponentCanvas/ComponentRenderer.svelte +85 -85
- package/dist/layout/TF/Content/Content.svelte +21 -21
- package/dist/layout/TF/Header/Header.svelte +166 -166
- package/dist/layout/TF/Sidebar/Sidebar.svelte +148 -148
- package/dist/layout/TF/Wrapper/Wrapper.svelte +17 -17
- package/dist/layout/mailing/MailPaginator.svelte +36 -36
- package/dist/layout/mailing/MailSidebar.svelte +39 -39
- package/dist/layout/mailing/MailToolBar.svelte +174 -174
- package/dist/layout/mailing/MailingContent.svelte +10 -10
- package/dist/layout/mailing/MailingHeader.svelte +55 -55
- package/dist/layout/mailing/MailingMessageCard.svelte +112 -112
- package/dist/layout/mailing/MailingMessageViewer.svelte +87 -87
- package/dist/layout/mailing/MailingModule.svelte +448 -448
- package/dist/styles/docs.css +615 -615
- package/dist/styles/tf-layout.css +185 -185
- package/dist/themes/ThemeProvider.svelte +20 -20
- package/dist/types/index.d.ts +2 -0
- package/dist/typography/heading/Heading.svelte +35 -35
- package/dist/ui/accordion/Accordion.svelte +49 -49
- package/dist/ui/accordion/AccordionItem.svelte +173 -173
- package/dist/ui/alert/Alert.svelte +83 -83
- package/dist/ui/alertDialog/AlertDialog.svelte +40 -40
- package/dist/ui/avatar/Avatar.svelte +77 -77
- package/dist/ui/box/Box.svelte +28 -28
- package/dist/ui/breadcrumb/Breadcrumb.svelte +39 -39
- package/dist/ui/buttons/ActionButton.svelte +234 -234
- package/dist/ui/buttons/Button.svelte +102 -102
- package/dist/ui/buttons/GradientButton.svelte +59 -59
- package/dist/ui/datatable/Datatable.svelte +525 -525
- package/dist/ui/drawer/Drawer.svelte +300 -300
- package/dist/ui/dropdown/Dropdown.svelte +36 -36
- package/dist/ui/dropdown/DropdownDivider.svelte +11 -11
- package/dist/ui/dropdown/DropdownGroup.svelte +14 -14
- package/dist/ui/dropdown/DropdownHeader.svelte +14 -14
- package/dist/ui/dropdown/DropdownItem.svelte +52 -52
- package/dist/ui/footer/Footer.svelte +15 -15
- package/dist/ui/footer/FooterBrand.svelte +37 -37
- package/dist/ui/footer/FooterCopyright.svelte +45 -45
- package/dist/ui/footer/FooterIcon.svelte +22 -22
- package/dist/ui/footer/FooterLink.svelte +33 -33
- package/dist/ui/footer/FooterLinkGroup.svelte +13 -13
- package/dist/ui/icons/IconifyIcon.svelte +7 -7
- package/dist/ui/indicator/Indicator.svelte +42 -42
- package/dist/ui/modal/Modal.svelte +265 -265
- package/dist/ui/notificationList/NotificationList.svelte +123 -123
- package/dist/ui/pageLoader/PageLoader.svelte +14 -14
- package/dist/ui/pageLoader/PageLoader2.svelte +99 -0
- package/dist/ui/pageLoader/PageLoader2.svelte.d.ts +24 -0
- package/dist/ui/pageLoader/index.d.ts +2 -1
- package/dist/ui/pageLoader/index.js +2 -1
- package/dist/ui/paginate/Paginate.svelte +96 -96
- package/dist/ui/speedDial/SpeedDial.svelte +77 -77
- package/dist/ui/speedDial/SpeedDialButton.svelte +75 -75
- package/dist/ui/speedDial/SpeedDialTrigger.svelte +79 -79
- package/dist/ui/tab/Tab.svelte +93 -67
- package/dist/ui/table/Table.svelte +396 -396
- package/dist/ui/tableLoader/TableLoader.svelte +24 -24
- package/dist/ui/toast/Toast.svelte +337 -337
- package/dist/ui/toast/Toast.svelte.d.ts +10 -10
- package/dist/ui/toolbar/Toolbar.svelte +59 -59
- package/dist/ui/toolbar/ToolbarButton.svelte +56 -56
- package/dist/ui/toolbar/ToolbarGroup.svelte +43 -43
- package/dist/ui/tooltip/Tooltip.svelte +51 -51
- package/dist/utils/Popper.svelte +257 -257
- package/dist/utils/closeButton/CloseButton.svelte +88 -88
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +3 -3
- package/dist/utils/singleSelection.svelte.js +48 -48
- package/dist/youtube/index.svelte +12 -12
- package/package.json +1 -1
|
@@ -1,77 +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
|
-
-->
|
|
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
|
+
-->
|
|
@@ -1,75 +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
|
-
-->
|
|
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
|
+
-->
|
|
@@ -1,79 +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
|
-
-->
|
|
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
|
+
-->
|
package/dist/ui/tab/Tab.svelte
CHANGED
|
@@ -1,67 +1,93 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { CloseButton, type TabProps } from '../../index.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CloseButton, type TabProps } from '../../index.js';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { tabs as tabsTheme } from './theme.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
activeTab = $bindable(0),
|
|
8
|
+
tabs = [],
|
|
9
|
+
tabColor = 'bg-primary-500',
|
|
10
|
+
tabClass,
|
|
11
|
+
tabActiveClass,
|
|
12
|
+
tabInactiveClass,
|
|
13
|
+
tabContentClass,
|
|
14
|
+
tabContentActiveClass,
|
|
15
|
+
tabContentInactiveClass,
|
|
16
|
+
tabStyle = 'none',
|
|
17
|
+
divider = true,
|
|
18
|
+
onTabChange,
|
|
19
|
+
onRemoveTab,
|
|
20
|
+
onTabAdd,
|
|
21
|
+
hideTabs = true
|
|
22
|
+
}: TabProps = $props();
|
|
23
|
+
|
|
24
|
+
const tabStyles = tabsTheme({
|
|
25
|
+
tabStyle,
|
|
26
|
+
hasDivider: divider
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
function changeTab(id: number | string) {
|
|
30
|
+
activeTab = id;
|
|
31
|
+
onTabChange?.(id);
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<div class="relative flex h-full w-full flex-col">
|
|
36
|
+
<div
|
|
37
|
+
class:hidden={!hideTabs}
|
|
38
|
+
class={clsx('mb-4 flex flex-wrap border-b border-gray-300', tabStyles.base(), tabClass)}
|
|
39
|
+
>
|
|
40
|
+
{#each tabs as tab}
|
|
41
|
+
<button
|
|
42
|
+
class={clsx(
|
|
43
|
+
'rounded-t-md border-b-2 px-4 py-2',
|
|
44
|
+
activeTab === tab.id
|
|
45
|
+
? [tabStyles.active(), tabActiveClass, tabColor, 'text-white']
|
|
46
|
+
: [tabStyles.inactive(), tabInactiveClass]
|
|
47
|
+
)}
|
|
48
|
+
onclick={() => changeTab(tab.id)}
|
|
49
|
+
>
|
|
50
|
+
<div class="flex items-center gap-2">
|
|
51
|
+
<span class="text-sm">
|
|
52
|
+
{tab.title}
|
|
53
|
+
</span>
|
|
54
|
+
{#if tab.icon}
|
|
55
|
+
<iconify-icon icon={tab.icon} style="font-size: 15px;"></iconify-icon>
|
|
56
|
+
{/if}
|
|
57
|
+
{#if tab.isClosable}
|
|
58
|
+
<CloseButton
|
|
59
|
+
size="sm"
|
|
60
|
+
class={clsx(
|
|
61
|
+
activeTab === tab.id
|
|
62
|
+
? 'text-white hover:bg-white/20'
|
|
63
|
+
: 'text-gray-600 hover:bg-gray-200'
|
|
64
|
+
)}
|
|
65
|
+
onclick={(e: any) => {
|
|
66
|
+
onRemoveTab?.({ tabId: tab.id });
|
|
67
|
+
e.stopPropagation();
|
|
68
|
+
}}
|
|
69
|
+
/>
|
|
70
|
+
{/if}
|
|
71
|
+
</div>
|
|
72
|
+
</button>
|
|
73
|
+
{/each}
|
|
74
|
+
{#if divider}
|
|
75
|
+
<div class={tabStyles.divider()}></div>
|
|
76
|
+
{/if}
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<div class="h-full w-full">
|
|
80
|
+
{#each tabs as tab (tab.id)}
|
|
81
|
+
<div
|
|
82
|
+
class:hidden={activeTab !== tab.id}
|
|
83
|
+
class={clsx(
|
|
84
|
+
'h-full w-full',
|
|
85
|
+
tabContentClass,
|
|
86
|
+
activeTab === tab.id ? tabContentActiveClass : tabContentInactiveClass
|
|
87
|
+
)}
|
|
88
|
+
>
|
|
89
|
+
<tab.children {...tab} {...tab.props} {onTabAdd} {onRemoveTab} />
|
|
90
|
+
</div>
|
|
91
|
+
{/each}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|