@noxlovette/material 0.3.3 → 0.4.1
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 +1 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +1 -0
- package/dist/actions/rovingFocusGroup.d.ts +20 -0
- package/dist/actions/rovingFocusGroup.js +82 -0
- package/dist/components/badge/theme.d.ts +8 -8
- package/dist/components/buttons/button-group/ButtonGroup.stories.svelte +83 -0
- package/dist/components/buttons/button-group/ButtonGroup.stories.svelte.d.ts +19 -0
- package/dist/components/buttons/button-group/ButtonGroup.svelte +10 -29
- package/dist/components/buttons/button-group/ButtonGroup.svelte.d.ts +7 -3
- package/dist/components/buttons/button-group/index.d.ts +0 -1
- package/dist/components/buttons/button-group/index.js +3 -1
- package/dist/components/buttons/button-group/theme.d.ts +17 -103
- package/dist/components/buttons/button-group/theme.js +7 -35
- package/dist/components/buttons/button-group/types.d.ts +9 -20
- package/dist/components/buttons/connected/ConnectedButtonGroup.stories.svelte +118 -0
- package/dist/components/buttons/connected/ConnectedButtonGroup.stories.svelte.d.ts +19 -0
- package/dist/components/buttons/connected/ConnectedButtonGroup.svelte +52 -0
- package/dist/components/buttons/connected/ConnectedButtonGroup.svelte.d.ts +12 -0
- package/dist/components/buttons/connected/ConnectedButtonGroupItem.svelte +37 -0
- package/dist/components/buttons/connected/ConnectedButtonGroupItem.svelte.d.ts +9 -0
- package/dist/components/buttons/connected/index.d.ts +3 -1
- package/dist/components/buttons/connected/index.js +3 -1
- package/dist/components/buttons/connected/theme.d.ts +125 -0
- package/dist/components/buttons/connected/theme.js +38 -0
- package/dist/components/buttons/connected/types.d.ts +32 -13
- package/dist/components/buttons/index.d.ts +1 -0
- package/dist/components/buttons/index.js +1 -0
- package/dist/components/buttons/split-button/SplitButton.stories.svelte +103 -0
- package/dist/components/buttons/split-button/SplitButton.stories.svelte.d.ts +19 -0
- package/dist/components/buttons/split-button/SplitButton.svelte +104 -0
- package/dist/components/buttons/split-button/SplitButton.svelte.d.ts +19 -0
- package/dist/components/buttons/split-button/index.d.ts +3 -0
- package/dist/components/{containers/panes → buttons/split-button}/index.js +1 -3
- package/dist/components/buttons/split-button/theme.d.ts +35 -0
- package/dist/components/buttons/split-button/theme.js +26 -0
- package/dist/components/buttons/split-button/types.d.ts +33 -0
- package/dist/components/buttons/theme.d.ts +142 -142
- package/dist/components/buttons/theme.js +2 -2
- package/dist/components/cards/Card.stories.svelte +58 -0
- package/dist/components/cards/Card.stories.svelte.d.ts +2 -17
- package/dist/components/cards/Card.svelte +76 -8
- package/dist/components/cards/theme.d.ts +26 -14
- package/dist/components/cards/theme.js +5 -1
- package/dist/components/cards/types.d.ts +39 -1
- package/dist/components/chips/Chip.stories.svelte +64 -0
- package/dist/components/chips/Chip.stories.svelte.d.ts +19 -0
- package/dist/components/chips/Chip.svelte +115 -0
- package/dist/components/chips/Chip.svelte.d.ts +14 -0
- package/dist/components/chips/index.d.ts +3 -0
- package/dist/components/{containers/merger → chips}/index.js +2 -1
- package/dist/components/chips/theme.d.ts +78 -0
- package/dist/components/chips/theme.js +72 -0
- package/dist/components/chips/types.d.ts +43 -0
- package/dist/components/containers/action-rail/ActionRail.stories.svelte +36 -0
- package/dist/components/containers/{panes/SinglePane.stories.svelte.d.ts → action-rail/ActionRail.stories.svelte.d.ts} +4 -4
- package/dist/components/containers/action-rail/ActionRail.svelte +35 -0
- package/dist/components/containers/action-rail/ActionRail.svelte.d.ts +17 -0
- package/dist/components/containers/action-rail/index.d.ts +3 -0
- package/dist/components/containers/action-rail/index.js +6 -0
- package/dist/components/containers/action-rail/theme.d.ts +45 -0
- package/dist/components/containers/action-rail/theme.js +26 -0
- package/dist/components/containers/action-rail/types.d.ts +20 -0
- package/dist/components/containers/action-rail/types.js +1 -0
- package/dist/components/containers/app/App.svelte +6 -6
- package/dist/components/containers/app/App.svelte.d.ts +4 -2
- package/dist/components/containers/app/theme.d.ts +1 -1
- package/dist/components/containers/app/types.d.ts +9 -4
- package/dist/components/containers/bottom-sheet/BottomSheet.stories.svelte +1 -1
- package/dist/components/containers/bottom-sheet/BottomSheet.svelte +1 -1
- package/dist/components/containers/context-menu/ContextMenu.stories.svelte +44 -0
- package/dist/components/containers/context-menu/ContextMenu.svelte +21 -5
- package/dist/components/containers/context-menu/ContextMenu.svelte.d.ts +11 -0
- package/dist/components/containers/context-menu/theme.d.ts +20 -2
- package/dist/components/containers/context-menu/theme.js +31 -8
- package/dist/components/containers/context-menu/types.d.ts +14 -2
- package/dist/components/containers/dialogue/theme.d.ts +20 -20
- package/dist/components/containers/divider/theme.d.ts +17 -17
- package/dist/components/containers/index.d.ts +2 -3
- package/dist/components/containers/index.js +2 -3
- package/dist/components/containers/link-preview/theme.d.ts +11 -11
- package/dist/components/containers/list/theme.d.ts +14 -14
- package/dist/components/containers/list/theme.js +1 -1
- package/dist/components/containers/menu/Menu.stories.svelte +105 -3
- package/dist/components/containers/menu/Menu.stories.svelte.d.ts +2 -17
- package/dist/components/containers/menu/Menu.svelte +9 -7
- package/dist/components/containers/menu/MenuCheckboxItem.svelte +55 -0
- package/dist/components/containers/menu/MenuCheckboxItem.svelte.d.ts +25 -0
- package/dist/components/containers/menu/MenuGroup.svelte +43 -0
- package/dist/components/containers/menu/MenuGroup.svelte.d.ts +28 -0
- package/dist/components/containers/menu/MenuRadioGroup.svelte +39 -0
- package/dist/components/containers/menu/MenuRadioGroup.svelte.d.ts +27 -0
- package/dist/components/containers/menu/MenuRadioItem.svelte +49 -0
- package/dist/components/containers/menu/MenuRadioItem.svelte.d.ts +17 -0
- package/dist/components/containers/menu/MenuSub.svelte +91 -0
- package/dist/components/containers/menu/MenuSub.svelte.d.ts +29 -0
- package/dist/components/containers/menu/index.d.ts +7 -0
- package/dist/components/containers/menu/index.js +8 -0
- package/dist/components/containers/menu/menu-item/MenuItem.svelte +71 -0
- package/dist/components/containers/{menu-item → menu/menu-item}/MenuItem.svelte.d.ts +2 -1
- package/dist/components/containers/{menu-item → menu/menu-item}/types.d.ts +5 -1
- package/dist/components/containers/menu/menu-item/types.js +1 -0
- package/dist/components/containers/menu/theme.d.ts +68 -0
- package/dist/components/containers/menu/theme.js +36 -0
- package/dist/components/containers/menu/types.d.ts +113 -2
- package/dist/components/containers/pane/DraggablePane.stories.svelte +199 -0
- package/dist/components/containers/pane/DraggablePane.stories.svelte.d.ts +4 -0
- package/dist/components/containers/pane/DraggablePane.svelte +533 -0
- package/dist/components/containers/pane/DraggablePane.svelte.d.ts +29 -0
- package/dist/components/containers/pane/Pane.stories.svelte +104 -0
- package/dist/components/containers/pane/Pane.stories.svelte.d.ts +19 -0
- package/dist/components/containers/pane/Pane.svelte +78 -0
- package/dist/components/containers/pane/Pane.svelte.d.ts +18 -0
- package/dist/components/containers/pane/PaneGrid.stories.svelte +134 -0
- package/dist/components/containers/pane/PaneGrid.stories.svelte.d.ts +19 -0
- package/dist/components/containers/pane/PaneGrid.svelte +43 -0
- package/dist/components/containers/pane/PaneGrid.svelte.d.ts +13 -0
- package/dist/components/containers/pane/PaneHandle.svelte +90 -0
- package/dist/components/containers/pane/PaneHandle.svelte.d.ts +12 -0
- package/dist/components/containers/pane/dragStore.svelte.d.ts +16 -0
- package/dist/components/containers/pane/dragStore.svelte.js +38 -0
- package/dist/components/containers/pane/index.d.ts +8 -0
- package/dist/components/containers/pane/index.js +11 -0
- package/dist/components/containers/pane/resizeStore.svelte.d.ts +10 -0
- package/dist/components/containers/pane/resizeStore.svelte.js +30 -0
- package/dist/components/containers/pane/theme.d.ts +571 -0
- package/dist/components/containers/pane/theme.js +211 -0
- package/dist/components/containers/pane/types.d.ts +249 -0
- package/dist/components/containers/pane/types.js +1 -0
- package/dist/components/containers/popover/Popover.stories.svelte +4 -4
- package/dist/components/containers/popover/Popover.svelte +3 -1
- package/dist/components/containers/popover/theme.d.ts +20 -20
- package/dist/components/containers/popover/types.d.ts +6 -2
- package/dist/components/containers/scroll-area/theme.d.ts +2 -2
- package/dist/components/containers/side-sheet/SideSheet.stories.svelte +16 -24
- package/dist/components/containers/side-sheet/SideSheet.svelte +73 -7
- package/dist/components/containers/side-sheet/SideSheet.svelte.d.ts +5 -0
- package/dist/components/containers/stack/theme.d.ts +44 -44
- package/dist/components/date/DateField.stories.svelte +57 -0
- package/dist/components/{containers/panes/SplitPane.stories.svelte.d.ts → date/DateField.stories.svelte.d.ts} +4 -4
- package/dist/components/date/DateField.svelte +11 -2
- package/dist/components/date/DateRangeField.stories.svelte +53 -0
- package/dist/components/{containers/panes/SupportingPane.stories.svelte.d.ts → date/DateRangeField.stories.svelte.d.ts} +4 -4
- package/dist/components/date/DateRangeField.svelte +2 -1
- package/dist/components/date/theme.d.ts +73 -4
- package/dist/components/date/theme.js +95 -26
- package/dist/components/date/types.d.ts +5 -0
- package/dist/components/forms/checkbox/Checkbox.svelte +7 -9
- package/dist/components/forms/checkbox/theme.d.ts +8 -8
- package/dist/components/forms/checkbox/theme.js +31 -9
- package/dist/components/forms/command/theme.d.ts +35 -35
- package/dist/components/forms/pin/theme.d.ts +2 -2
- package/dist/components/forms/radio-group/theme.d.ts +2 -2
- package/dist/components/forms/search/theme.d.ts +8 -8
- package/dist/components/forms/select/Select.svelte +3 -2
- package/dist/components/forms/select/theme.d.ts +26 -2
- package/dist/components/forms/select/theme.js +56 -22
- package/dist/components/forms/slider/theme.d.ts +20 -20
- package/dist/components/forms/switch/theme.d.ts +2 -2
- package/dist/components/forms/textfield/Textfield.stories.svelte +22 -0
- package/dist/components/forms/textfield/Textfield.svelte +10 -1
- package/dist/components/forms/textfield/theme.d.ts +44 -2
- package/dist/components/forms/textfield/theme.js +56 -16
- package/dist/components/forms/toggle-group/ToggleGroup.svelte +2 -2
- package/dist/components/forms/toggle-group/ToggleGroup.svelte.d.ts +2 -2
- package/dist/components/forms/toggle-group/ToggleGroupItem.svelte +1 -1
- package/dist/components/forms/toggle-group/ToggleGroupItem.svelte.d.ts +1 -1
- package/dist/components/forms/toggle-group/theme.d.ts +16 -16
- package/dist/components/forms/toggle-group/types.d.ts +2 -2
- package/dist/components/forms/tooltip/Tooltip.svelte +1 -1
- package/dist/components/forms/tooltip/theme.d.ts +2 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/misc/Avatar.stories.svelte +8 -0
- package/dist/components/misc/Avatar.svelte +35 -10
- package/dist/components/misc/DicebearAvatarBuilder.d.ts +59 -0
- package/dist/components/misc/DicebearAvatarBuilder.js +115 -0
- package/dist/components/misc/ThemeSettings.svelte +1 -1
- package/dist/components/misc/ThemeSwitcher.svelte +2 -2
- package/dist/components/misc/dicebearStyles.d.ts +21 -0
- package/dist/components/misc/dicebearStyles.js +169 -0
- package/dist/components/misc/index.d.ts +3 -0
- package/dist/components/misc/index.js +3 -0
- package/dist/components/misc/materialAvatarPalette.d.ts +6 -0
- package/dist/components/misc/materialAvatarPalette.js +44 -0
- package/dist/components/misc/theme.d.ts +20 -2
- package/dist/components/misc/theme.js +7 -1
- package/dist/components/misc/types.d.ts +20 -2
- package/dist/components/nav/appbar/AppBar.stories.svelte +1 -1
- package/dist/components/nav/appbar/AppBar.svelte +46 -15
- package/dist/components/nav/appbar/AppBar.svelte.d.ts +5 -0
- package/dist/components/nav/appbar/theme.d.ts +20 -14
- package/dist/components/nav/appbar/theme.js +11 -7
- package/dist/components/nav/appbar/types.d.ts +3 -1
- package/dist/components/nav/breadcrumb/Breadcrumb.stories.svelte +50 -0
- package/dist/components/nav/breadcrumb/Breadcrumb.stories.svelte.d.ts +19 -0
- package/dist/components/nav/breadcrumb/Breadcrumb.svelte +46 -0
- package/dist/components/nav/breadcrumb/Breadcrumb.svelte.d.ts +13 -0
- package/dist/components/nav/breadcrumb/index.d.ts +3 -0
- package/dist/components/nav/breadcrumb/index.js +6 -0
- package/dist/components/nav/breadcrumb/theme.d.ts +84 -0
- package/dist/components/nav/breadcrumb/theme.js +35 -0
- package/dist/components/nav/breadcrumb/types.d.ts +14 -0
- package/dist/components/nav/breadcrumb/types.js +1 -0
- package/dist/components/nav/index.d.ts +1 -0
- package/dist/components/nav/index.js +1 -0
- package/dist/components/nav/navbar/theme.d.ts +19 -19
- package/dist/components/nav/rail/Rail.stories.svelte +1 -5
- package/dist/components/nav/rail/Rail.svelte +3 -25
- package/dist/components/nav/rail/theme.d.ts +4 -4
- package/dist/components/nav/rail/types.d.ts +0 -5
- package/dist/components/nav/tabs/TabHolder.svelte +2 -1
- package/dist/components/nav/tabs/theme.d.ts +21 -21
- package/dist/components/nav/tabs/theme.js +6 -0
- package/dist/components/nav/tabs/types.d.ts +2 -2
- package/dist/components/pill/theme.d.ts +35 -35
- package/dist/components/snackbar/theme.d.ts +8 -8
- package/dist/components/table/Table.stories.svelte +267 -0
- package/dist/components/table/Table.stories.svelte.d.ts +19 -0
- package/dist/components/table/Table.svelte +1 -1
- package/dist/components/table/TableBody.svelte +16 -3
- package/dist/components/table/TableBody.svelte.d.ts +5 -1
- package/dist/components/table/TableRow.svelte +1 -1
- package/dist/components/table/theme.d.ts +2 -2
- package/dist/components/table/theme.js +2 -2
- package/dist/components/table/types.d.ts +7 -0
- package/dist/components/time/theme.d.ts +29 -29
- package/dist/components/toolbar/Toolbar.stories.svelte +71 -0
- package/dist/components/toolbar/Toolbar.stories.svelte.d.ts +19 -0
- package/dist/components/toolbar/Toolbar.svelte +19 -3
- package/dist/components/toolbar/Toolbar.svelte.d.ts +8 -2
- package/dist/components/toolbar/ToolbarButton.svelte +28 -4
- package/dist/components/toolbar/ToolbarDivider.svelte +4 -3
- package/dist/components/toolbar/ToolbarGroup.svelte +7 -2
- package/dist/components/toolbar/ToolbarGroupItem.svelte +29 -4
- package/dist/components/toolbar/ToolbarSection.svelte +35 -0
- package/dist/components/toolbar/ToolbarSection.svelte.d.ts +9 -0
- package/dist/components/toolbar/ToolbarSpacer.svelte +18 -0
- package/dist/components/toolbar/ToolbarSpacer.svelte.d.ts +9 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/index.js +2 -0
- package/dist/components/toolbar/theme.d.ts +36 -21
- package/dist/components/toolbar/theme.js +27 -11
- package/dist/components/toolbar/types.d.ts +37 -4
- package/dist/components/typography/body/theme.d.ts +14 -14
- package/dist/components/typography/display/theme.d.ts +14 -14
- package/dist/components/typography/headline/theme.d.ts +14 -14
- package/dist/components/typography/kbd/Kbd.stories.svelte +1 -1
- package/dist/components/typography/kbd/theme.d.ts +8 -8
- package/dist/components/typography/label/theme.d.ts +14 -14
- package/dist/components/typography/title/theme.d.ts +14 -14
- package/dist/styles/component.css +126 -4
- package/dist/styles/motion.css +6 -3
- package/dist/utils/Layer.svelte +7 -3
- package/dist/utils/Theme.svelte +20 -20
- package/dist/utils/ThemeScript.svelte +1 -1
- package/dist/utils/icon/theme.d.ts +14 -14
- package/dist/utils/theme.svelte.js +1 -1
- package/package.json +39 -38
- package/bin/install-skill.js +0 -29
- package/dist/components/buttons/button-group/ButtonGroupItem.svelte +0 -41
- package/dist/components/buttons/button-group/ButtonGroupItem.svelte.d.ts +0 -8
- package/dist/components/buttons/connected/ConnectedButtons.svelte +0 -14
- package/dist/components/buttons/connected/ConnectedButtons.svelte.d.ts +0 -8
- package/dist/components/containers/menu-item/MenuItem.svelte +0 -74
- package/dist/components/containers/merger/InputMerger.svelte +0 -24
- package/dist/components/containers/merger/InputMerger.svelte.d.ts +0 -14
- package/dist/components/containers/merger/index.d.ts +0 -2
- package/dist/components/containers/merger/theme.d.ts +0 -1
- package/dist/components/containers/merger/theme.js +0 -4
- package/dist/components/containers/panes/SinglePane.stories.svelte +0 -67
- package/dist/components/containers/panes/SinglePane.svelte +0 -32
- package/dist/components/containers/panes/SinglePane.svelte.d.ts +0 -5
- package/dist/components/containers/panes/SplitPane.stories.svelte +0 -124
- package/dist/components/containers/panes/SplitPane.svelte +0 -144
- package/dist/components/containers/panes/SplitPane.svelte.d.ts +0 -8
- package/dist/components/containers/panes/SupportingPane.stories.svelte +0 -113
- package/dist/components/containers/panes/SupportingPane.svelte +0 -175
- package/dist/components/containers/panes/SupportingPane.svelte.d.ts +0 -9
- package/dist/components/containers/panes/index.d.ts +0 -5
- package/dist/components/containers/panes/theme.d.ts +0 -490
- package/dist/components/containers/panes/theme.js +0 -185
- package/dist/components/containers/panes/types.d.ts +0 -108
- package/dist/components/nav/rail/RailNavContext.svelte +0 -14
- package/dist/components/nav/rail/RailNavContext.svelte.d.ts +0 -8
- /package/dist/components/{containers/menu-item → buttons/split-button}/types.js +0 -0
- /package/dist/components/{containers/panes → chips}/types.js +0 -0
- /package/dist/components/containers/{menu-item → menu/menu-item}/index.d.ts +0 -0
- /package/dist/components/containers/{menu-item → menu/menu-item}/index.js +0 -0
|
@@ -14,7 +14,7 @@ Compose with TableHead, TableBody, TableFoot, TableRow, TableCell, and TableHead
|
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
{#if rounded}
|
|
17
|
-
<div class="ring-md-sys-color-outline-variant overflow-
|
|
17
|
+
<div class="ring-md-sys-color-outline-variant overflow-x-auto rounded-sm ring-1">
|
|
18
18
|
<table class={root({ class: clsx(className) })} {...restProps}>
|
|
19
19
|
{@render children()}
|
|
20
20
|
</table>
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
Wraps the data rows of a Table.
|
|
3
|
+
Wraps the data rows of a Table. Rows are keyboard-navigable by default: Tab/Shift+Tab
|
|
4
|
+
stop on the table once (roving tabindex), and ArrowUp/ArrowDown or k/j move focus
|
|
5
|
+
between rows. Set `navigable={false}` to opt a purely presentational table out.
|
|
4
6
|
-->
|
|
5
7
|
<script lang="ts">
|
|
6
8
|
import type { TableBodyProps } from './types.js';
|
|
7
9
|
import { table } from './theme.js';
|
|
10
|
+
import { rovingFocusGroup } from '../../actions/index.js';
|
|
8
11
|
import clsx from 'clsx';
|
|
9
12
|
|
|
10
|
-
let {
|
|
13
|
+
let {
|
|
14
|
+
children,
|
|
15
|
+
navigable = true,
|
|
16
|
+
loop = false,
|
|
17
|
+
class: className,
|
|
18
|
+
...restProps
|
|
19
|
+
}: TableBodyProps = $props();
|
|
11
20
|
|
|
12
21
|
const { body } = table();
|
|
13
22
|
</script>
|
|
14
23
|
|
|
15
|
-
<tbody
|
|
24
|
+
<tbody
|
|
25
|
+
class={body({ class: clsx(className) })}
|
|
26
|
+
use:rovingFocusGroup={{ candidateSelector: '[data-table-row]', loop, enabled: navigable }}
|
|
27
|
+
{...restProps}
|
|
28
|
+
>
|
|
16
29
|
{@render children()}
|
|
17
30
|
</tbody>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { TableBodyProps } from './types.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Wraps the data rows of a Table. Rows are keyboard-navigable by default: Tab/Shift+Tab
|
|
4
|
+
* stop on the table once (roving tabindex), and ArrowUp/ArrowDown or k/j move focus
|
|
5
|
+
* between rows. Set `navigable={false}` to opt a purely presentational table out.
|
|
6
|
+
*/
|
|
3
7
|
declare const TableBody: import("svelte").Component<TableBodyProps, {}, "">;
|
|
4
8
|
type TableBody = ReturnType<typeof TableBody>;
|
|
5
9
|
export default TableBody;
|
|
@@ -19,6 +19,6 @@ and `hoverable` to show a hover background (e.g. for clickable rows).
|
|
|
19
19
|
const { row } = $derived(table({ selected, hoverable }));
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
|
-
<tr class={row({ class: clsx(className) })} {...restProps}>
|
|
22
|
+
<tr data-table-row class={row({ class: clsx(className) })} {...restProps}>
|
|
23
23
|
{@render children()}
|
|
24
24
|
</tr>
|
|
@@ -107,7 +107,7 @@ export declare const table: import("tailwind-variants").TVReturnType<{
|
|
|
107
107
|
row: string;
|
|
108
108
|
cell: string;
|
|
109
109
|
header: string;
|
|
110
|
-
}, import("tailwind-variants").
|
|
110
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
111
111
|
hoverable: {
|
|
112
112
|
true: {
|
|
113
113
|
row: string;
|
|
@@ -161,5 +161,5 @@ export declare const table: import("tailwind-variants").TVReturnType<{
|
|
|
161
161
|
row: string;
|
|
162
162
|
cell: string;
|
|
163
163
|
header: string;
|
|
164
|
-
}
|
|
164
|
+
}>>;
|
|
165
165
|
export type TableVariants = VariantProps<typeof table>;
|
|
@@ -5,8 +5,8 @@ export const table = tv({
|
|
|
5
5
|
head: '',
|
|
6
6
|
body: '[&_tr:last-child]:border-b-0',
|
|
7
7
|
foot: 'border-t border-md-sys-color-outline-variant',
|
|
8
|
-
row: 'border-b border-md-sys-color-outline-variant transition-colors',
|
|
9
|
-
cell: 'px-4 py-3 align-middle',
|
|
8
|
+
row: 'border-b border-md-sys-color-outline-variant transition-colors focus-visible:outline focus-visible:-outline-offset-2 focus-visible:outline-md-sys-color-primary',
|
|
9
|
+
cell: 'px-4 py-3 align-middle wrap-anywhere',
|
|
10
10
|
header: 'px-4 py-4 align-middle md-sys-typescale-label-large text-md-sys-color-on-surface font-medium whitespace-nowrap'
|
|
11
11
|
},
|
|
12
12
|
variants: {
|
|
@@ -13,6 +13,13 @@ export type TableHeadProps = HTMLAttributes<HTMLTableSectionElement> & {
|
|
|
13
13
|
};
|
|
14
14
|
export type TableBodyProps = HTMLAttributes<HTMLTableSectionElement> & {
|
|
15
15
|
children: Snippet;
|
|
16
|
+
/**
|
|
17
|
+
* Make rows keyboard-navigable: roving tabindex so Tab/Shift+Tab stop on the table
|
|
18
|
+
* once, and ArrowUp/ArrowDown (or k/j) move focus between rows. Default `true`.
|
|
19
|
+
*/
|
|
20
|
+
navigable?: boolean;
|
|
21
|
+
/** Loop focus from the last row back to the first (and vice versa). Default `false`. */
|
|
22
|
+
loop?: boolean;
|
|
16
23
|
};
|
|
17
24
|
export type TableFootProps = HTMLAttributes<HTMLTableSectionElement> & {
|
|
18
25
|
children: Snippet;
|
|
@@ -2,28 +2,28 @@ import { type VariantProps } from 'tailwind-variants';
|
|
|
2
2
|
export type TimepickerVariants = VariantProps<typeof timepicker>;
|
|
3
3
|
export declare const timepicker: import("tailwind-variants").TVReturnType<{
|
|
4
4
|
[key: string]: {
|
|
5
|
-
[key: string]: import("tailwind-
|
|
6
|
-
base?: import("tailwind-
|
|
7
|
-
headline?: import("tailwind-
|
|
8
|
-
inputWrapper?: import("tailwind-
|
|
9
|
-
clockDiv?: import("tailwind-
|
|
10
|
-
buttonDiv?: import("tailwind-
|
|
11
|
-
fieldSeparator?: import("tailwind-
|
|
12
|
-
timeInput?: import("tailwind-
|
|
13
|
-
timeInputSupportingText?: import("tailwind-
|
|
5
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
6
|
+
base?: import("tailwind-variants").ClassValue;
|
|
7
|
+
headline?: import("tailwind-variants").ClassValue;
|
|
8
|
+
inputWrapper?: import("tailwind-variants").ClassValue;
|
|
9
|
+
clockDiv?: import("tailwind-variants").ClassValue;
|
|
10
|
+
buttonDiv?: import("tailwind-variants").ClassValue;
|
|
11
|
+
fieldSeparator?: import("tailwind-variants").ClassValue;
|
|
12
|
+
timeInput?: import("tailwind-variants").ClassValue;
|
|
13
|
+
timeInputSupportingText?: import("tailwind-variants").ClassValue;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
} | {
|
|
17
17
|
[x: string]: {
|
|
18
|
-
[x: string]: import("tailwind-
|
|
19
|
-
base?: import("tailwind-
|
|
20
|
-
headline?: import("tailwind-
|
|
21
|
-
inputWrapper?: import("tailwind-
|
|
22
|
-
clockDiv?: import("tailwind-
|
|
23
|
-
buttonDiv?: import("tailwind-
|
|
24
|
-
fieldSeparator?: import("tailwind-
|
|
25
|
-
timeInput?: import("tailwind-
|
|
26
|
-
timeInputSupportingText?: import("tailwind-
|
|
18
|
+
[x: string]: import("tailwind-variants").ClassValue | {
|
|
19
|
+
base?: import("tailwind-variants").ClassValue;
|
|
20
|
+
headline?: import("tailwind-variants").ClassValue;
|
|
21
|
+
inputWrapper?: import("tailwind-variants").ClassValue;
|
|
22
|
+
clockDiv?: import("tailwind-variants").ClassValue;
|
|
23
|
+
buttonDiv?: import("tailwind-variants").ClassValue;
|
|
24
|
+
fieldSeparator?: import("tailwind-variants").ClassValue;
|
|
25
|
+
timeInput?: import("tailwind-variants").ClassValue;
|
|
26
|
+
timeInputSupportingText?: import("tailwind-variants").ClassValue;
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
} | {}, {
|
|
@@ -37,15 +37,15 @@ export declare const timepicker: import("tailwind-variants").TVReturnType<{
|
|
|
37
37
|
timeInputSupportingText: string;
|
|
38
38
|
}, undefined, {
|
|
39
39
|
[key: string]: {
|
|
40
|
-
[key: string]: import("tailwind-
|
|
41
|
-
base?: import("tailwind-
|
|
42
|
-
headline?: import("tailwind-
|
|
43
|
-
inputWrapper?: import("tailwind-
|
|
44
|
-
clockDiv?: import("tailwind-
|
|
45
|
-
buttonDiv?: import("tailwind-
|
|
46
|
-
fieldSeparator?: import("tailwind-
|
|
47
|
-
timeInput?: import("tailwind-
|
|
48
|
-
timeInputSupportingText?: import("tailwind-
|
|
40
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
41
|
+
base?: import("tailwind-variants").ClassValue;
|
|
42
|
+
headline?: import("tailwind-variants").ClassValue;
|
|
43
|
+
inputWrapper?: import("tailwind-variants").ClassValue;
|
|
44
|
+
clockDiv?: import("tailwind-variants").ClassValue;
|
|
45
|
+
buttonDiv?: import("tailwind-variants").ClassValue;
|
|
46
|
+
fieldSeparator?: import("tailwind-variants").ClassValue;
|
|
47
|
+
timeInput?: import("tailwind-variants").ClassValue;
|
|
48
|
+
timeInputSupportingText?: import("tailwind-variants").ClassValue;
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
} | {}, {
|
|
@@ -57,7 +57,7 @@ export declare const timepicker: import("tailwind-variants").TVReturnType<{
|
|
|
57
57
|
fieldSeparator: string;
|
|
58
58
|
timeInput: string;
|
|
59
59
|
timeInputSupportingText: string;
|
|
60
|
-
}, import("tailwind-variants").
|
|
60
|
+
}, import("tailwind-variants").TVReturnTypeLike<unknown, {
|
|
61
61
|
base: string;
|
|
62
62
|
clockDiv: string;
|
|
63
63
|
buttonDiv: string;
|
|
@@ -66,4 +66,4 @@ export declare const timepicker: import("tailwind-variants").TVReturnType<{
|
|
|
66
66
|
fieldSeparator: string;
|
|
67
67
|
timeInput: string;
|
|
68
68
|
timeInputSupportingText: string;
|
|
69
|
-
}
|
|
69
|
+
}>>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Toolbar from './Toolbar.svelte';
|
|
4
|
+
import ToolbarButton from './ToolbarButton.svelte';
|
|
5
|
+
import ToolbarDivider from './ToolbarDivider.svelte';
|
|
6
|
+
import ToolbarGroup from './ToolbarGroup.svelte';
|
|
7
|
+
import ToolbarGroupItem from './ToolbarGroupItem.svelte';
|
|
8
|
+
import ToolbarSection from './ToolbarSection.svelte';
|
|
9
|
+
import ToolbarSpacer from './ToolbarSpacer.svelte';
|
|
10
|
+
|
|
11
|
+
const { Story } = defineMeta({
|
|
12
|
+
title: 'Toolbar/Toolbar',
|
|
13
|
+
component: Toolbar
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<Story name="Playground" asChild>
|
|
18
|
+
<Toolbar>
|
|
19
|
+
<ToolbarButton iconProps={{ name: 'format_bold' }} />
|
|
20
|
+
<ToolbarButton iconProps={{ name: 'format_italic' }} />
|
|
21
|
+
<ToolbarDivider />
|
|
22
|
+
<ToolbarButton iconProps={{ name: 'format_underlined' }} />
|
|
23
|
+
</Toolbar>
|
|
24
|
+
</Story>
|
|
25
|
+
|
|
26
|
+
<Story name="Sections">
|
|
27
|
+
{#snippet template()}
|
|
28
|
+
<div class="w-120">
|
|
29
|
+
<Toolbar sections class="w-full">
|
|
30
|
+
<ToolbarSection>
|
|
31
|
+
<ToolbarButton iconProps={{ name: 'format_bold' }} />
|
|
32
|
+
<ToolbarButton iconProps={{ name: 'format_italic' }} />
|
|
33
|
+
</ToolbarSection>
|
|
34
|
+
<ToolbarSpacer />
|
|
35
|
+
<ToolbarSection>
|
|
36
|
+
<ToolbarButton iconProps={{ name: 'share' }} />
|
|
37
|
+
<ToolbarButton iconProps={{ name: 'settings' }} />
|
|
38
|
+
</ToolbarSection>
|
|
39
|
+
</Toolbar>
|
|
40
|
+
</div>
|
|
41
|
+
{/snippet}
|
|
42
|
+
</Story>
|
|
43
|
+
|
|
44
|
+
<Story name="Vertical" asChild>
|
|
45
|
+
<Toolbar orientation="vertical">
|
|
46
|
+
<ToolbarGroup type="single">
|
|
47
|
+
<ToolbarGroupItem value="bold" iconProps={{ name: 'format_bold' }} />
|
|
48
|
+
<ToolbarGroupItem value="italic" iconProps={{ name: 'format_italic' }} />
|
|
49
|
+
</ToolbarGroup>
|
|
50
|
+
<ToolbarDivider />
|
|
51
|
+
<ToolbarButton iconProps={{ name: 'format_underlined' }} />
|
|
52
|
+
</Toolbar>
|
|
53
|
+
</Story>
|
|
54
|
+
|
|
55
|
+
<Story name="VerticalSections">
|
|
56
|
+
{#snippet template()}
|
|
57
|
+
<div class="h-120">
|
|
58
|
+
<Toolbar orientation="vertical" sections class="h-full">
|
|
59
|
+
<ToolbarSection>
|
|
60
|
+
<ToolbarButton iconProps={{ name: 'format_bold' }} />
|
|
61
|
+
<ToolbarButton iconProps={{ name: 'format_italic' }} />
|
|
62
|
+
</ToolbarSection>
|
|
63
|
+
<ToolbarSpacer />
|
|
64
|
+
<ToolbarSection>
|
|
65
|
+
<ToolbarButton iconProps={{ name: 'share' }} />
|
|
66
|
+
<ToolbarButton iconProps={{ name: 'settings' }} />
|
|
67
|
+
</ToolbarSection>
|
|
68
|
+
</Toolbar>
|
|
69
|
+
</div>
|
|
70
|
+
{/snippet}
|
|
71
|
+
</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Toolbar from './Toolbar.svelte';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Toolbar: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Toolbar = InstanceType<typeof Toolbar>;
|
|
19
|
+
export default Toolbar;
|
|
@@ -4,11 +4,17 @@ Toolbar provides a horizontal (or vertical) container for grouped actions.
|
|
|
4
4
|
|
|
5
5
|
- variant="floating" — elevated, rounded, inline (default)
|
|
6
6
|
- variant="docked" — full-width, flat, anchored to top/bottom
|
|
7
|
-
-
|
|
8
|
-
- ghost — renders a h-16 spacer after the toolbar to prevent content scroll-under (pair with variant="mobile")
|
|
7
|
+
- ghost — renders a h-16 spacer after the toolbar to prevent content scroll-under
|
|
9
8
|
- color="standard" — surface-container background
|
|
10
9
|
- color="vibrant" — secondary-container background with inverted toggle selection
|
|
11
10
|
- fab snippet — renders a FAB at the trailing edge (canonical for docked bottom bars)
|
|
11
|
+
- sections — splits the pill/bar into independently painted surfaces: root becomes a
|
|
12
|
+
plain flex layout and `children` render raw, so compose it from
|
|
13
|
+
`ToolbarSection` clusters (each gets its own bg/shape/elevation),
|
|
14
|
+
separated by `ToolbarSpacer` — a plain marker gap, the same size as
|
|
15
|
+
the toolbar's normal item spacing, not a flex-growing push to opposite
|
|
16
|
+
edges. Default (false) renders one implicit ToolbarSection around all
|
|
17
|
+
of `children`, unchanged from before.
|
|
12
18
|
|
|
13
19
|
@see https://m3.material.io/components/toolbars
|
|
14
20
|
-->
|
|
@@ -27,6 +33,7 @@ Toolbar provides a horizontal (or vertical) container for grouped actions.
|
|
|
27
33
|
loop = true,
|
|
28
34
|
variant = 'floating',
|
|
29
35
|
color = 'standard',
|
|
36
|
+
sections = false,
|
|
30
37
|
class: className,
|
|
31
38
|
...restProps
|
|
32
39
|
}: ToolbarProps = $props();
|
|
@@ -37,6 +44,9 @@ Toolbar provides a horizontal (or vertical) container for grouped actions.
|
|
|
37
44
|
},
|
|
38
45
|
get orientation() {
|
|
39
46
|
return orientation;
|
|
47
|
+
},
|
|
48
|
+
get variant() {
|
|
49
|
+
return variant;
|
|
40
50
|
}
|
|
41
51
|
};
|
|
42
52
|
setContext('toolbar', toolbarCtx);
|
|
@@ -45,7 +55,13 @@ Toolbar provides a horizontal (or vertical) container for grouped actions.
|
|
|
45
55
|
</script>
|
|
46
56
|
|
|
47
57
|
<Toolbar.Root {orientation} {loop} class={cls.root({ class: clsx(className) })} {...restProps}>
|
|
48
|
-
{
|
|
58
|
+
{#if sections}
|
|
59
|
+
{@render children?.()}
|
|
60
|
+
{:else}
|
|
61
|
+
<div class={cls.segment()}>
|
|
62
|
+
{@render children?.()}
|
|
63
|
+
</div>
|
|
64
|
+
{/if}
|
|
49
65
|
{#if fab}
|
|
50
66
|
<div class={cls.fabSlot()}>
|
|
51
67
|
{@render fab()}
|
|
@@ -5,11 +5,17 @@ import type { ToolbarProps } from './types.js';
|
|
|
5
5
|
*
|
|
6
6
|
* - variant="floating" — elevated, rounded, inline (default)
|
|
7
7
|
* - variant="docked" — full-width, flat, anchored to top/bottom
|
|
8
|
-
* -
|
|
9
|
-
* - ghost — renders a h-16 spacer after the toolbar to prevent content scroll-under (pair with variant="mobile")
|
|
8
|
+
* - ghost — renders a h-16 spacer after the toolbar to prevent content scroll-under
|
|
10
9
|
* - color="standard" — surface-container background
|
|
11
10
|
* - color="vibrant" — secondary-container background with inverted toggle selection
|
|
12
11
|
* - fab snippet — renders a FAB at the trailing edge (canonical for docked bottom bars)
|
|
12
|
+
* - sections — splits the pill/bar into independently painted surfaces: root becomes a
|
|
13
|
+
* plain flex layout and `children` render raw, so compose it from
|
|
14
|
+
* `ToolbarSection` clusters (each gets its own bg/shape/elevation),
|
|
15
|
+
* separated by `ToolbarSpacer` — a plain marker gap, the same size as
|
|
16
|
+
* the toolbar's normal item spacing, not a flex-growing push to opposite
|
|
17
|
+
* edges. Default (false) renders one implicit ToolbarSection around all
|
|
18
|
+
* of `children`, unchanged from before.
|
|
13
19
|
*
|
|
14
20
|
* @see https://m3.material.io/components/toolbars
|
|
15
21
|
*/
|
|
@@ -11,10 +11,14 @@ Color is inherited from the parent Toolbar via context.
|
|
|
11
11
|
import { toolbarButton } from './theme.js';
|
|
12
12
|
import type { ToolbarButtonProps } from './types.js';
|
|
13
13
|
import type { ToolbarColor } from './types.js';
|
|
14
|
+
import Tooltip from '../forms/tooltip/Tooltip.svelte';
|
|
14
15
|
|
|
15
16
|
let {
|
|
16
17
|
iconProps,
|
|
18
|
+
avatar,
|
|
17
19
|
disabled = false,
|
|
20
|
+
tooltipContent,
|
|
21
|
+
triggerClass = '',
|
|
18
22
|
class: className,
|
|
19
23
|
...restProps
|
|
20
24
|
}: ToolbarButtonProps = $props();
|
|
@@ -24,9 +28,29 @@ Color is inherited from the parent Toolbar via context.
|
|
|
24
28
|
);
|
|
25
29
|
const color = $derived(toolbarCtx?.color ?? 'standard');
|
|
26
30
|
const { base, icon } = $derived(toolbarButton({ color }));
|
|
31
|
+
|
|
32
|
+
const btnCls = $derived(base({ class: clsx(className) }));
|
|
27
33
|
</script>
|
|
28
34
|
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
<Tooltip {triggerClass} variant="snack" supportingText={tooltipContent}>
|
|
36
|
+
{#snippet trigger({
|
|
37
|
+
class: triggerClass_,
|
|
38
|
+
type: _tooltipType,
|
|
39
|
+
onclick: _tooltipOnclick,
|
|
40
|
+
...triggerAttrs
|
|
41
|
+
})}
|
|
42
|
+
<Toolbar.Button
|
|
43
|
+
{disabled}
|
|
44
|
+
class={clsx(btnCls, triggerClass_ as string)}
|
|
45
|
+
{...restProps}
|
|
46
|
+
{...triggerAttrs}
|
|
47
|
+
>
|
|
48
|
+
{#if avatar}
|
|
49
|
+
{@render avatar()}
|
|
50
|
+
{:else if iconProps}
|
|
51
|
+
<Icon {...iconProps} class={icon()} />
|
|
52
|
+
{/if}
|
|
53
|
+
<Layer />
|
|
54
|
+
</Toolbar.Button>
|
|
55
|
+
{/snippet}
|
|
56
|
+
</Tooltip>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext } from 'svelte';
|
|
3
|
-
import { toolbar } from './theme.js';
|
|
3
|
+
import { toolbar, type ToolbarVariants } from './theme.js';
|
|
4
4
|
|
|
5
5
|
const toolbarCtx = getContext<
|
|
6
|
-
{ color: string; orientation: 'horizontal' | 'vertical'
|
|
6
|
+
| { color: string; orientation: 'horizontal' | 'vertical'; variant: ToolbarVariants['variant'] }
|
|
7
|
+
| undefined
|
|
7
8
|
>('toolbar');
|
|
8
9
|
const orientation = $derived(toolbarCtx?.orientation ?? 'horizontal');
|
|
9
|
-
const cls = $derived(toolbar({ orientation }));
|
|
10
|
+
const cls = $derived(toolbar({ orientation, variant: toolbarCtx?.variant }));
|
|
10
11
|
|
|
11
12
|
// separator runs perpendicular to the toolbar flow
|
|
12
13
|
const ariaOrientation = $derived(orientation === 'horizontal' ? 'vertical' : 'horizontal');
|
|
@@ -5,12 +5,17 @@ A toggle group within a Toolbar. Manages single or multiple selection.
|
|
|
5
5
|
<script lang="ts">
|
|
6
6
|
import { Toolbar } from 'bits-ui';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
|
-
import {
|
|
8
|
+
import { getContext } from 'svelte';
|
|
9
|
+
import { toolbar, type ToolbarVariants } from './theme.js';
|
|
9
10
|
import type { ToolbarGroupProps } from './types.js';
|
|
10
11
|
|
|
11
12
|
let { children, disabled = false, class: className, ...restProps }: ToolbarGroupProps = $props();
|
|
12
13
|
|
|
13
|
-
const
|
|
14
|
+
const toolbarCtx = getContext<{ orientation: ToolbarVariants['orientation'] } | undefined>(
|
|
15
|
+
'toolbar'
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const cls = $derived(toolbar({ orientation: toolbarCtx?.orientation }));
|
|
14
19
|
</script>
|
|
15
20
|
|
|
16
21
|
<Toolbar.Group {disabled} class={cls.group({ class: clsx(className) })} {...restProps}>
|
|
@@ -12,11 +12,15 @@ Color is inherited from the parent Toolbar via context.
|
|
|
12
12
|
import { toolbarGroupItem } from './theme.js';
|
|
13
13
|
import type { ToolbarGroupItemProps } from './types.js';
|
|
14
14
|
import type { ToolbarColor } from './types.js';
|
|
15
|
+
import Tooltip from '../forms/tooltip/Tooltip.svelte';
|
|
15
16
|
|
|
16
17
|
let {
|
|
17
18
|
iconProps,
|
|
19
|
+
avatar,
|
|
18
20
|
value,
|
|
19
21
|
disabled = false,
|
|
22
|
+
tooltipContent,
|
|
23
|
+
triggerClass = '',
|
|
20
24
|
class: className,
|
|
21
25
|
...restProps
|
|
22
26
|
}: ToolbarGroupItemProps = $props();
|
|
@@ -26,9 +30,30 @@ Color is inherited from the parent Toolbar via context.
|
|
|
26
30
|
);
|
|
27
31
|
const color = $derived(toolbarCtx?.color ?? 'standard');
|
|
28
32
|
const { base, icon } = $derived(toolbarGroupItem({ color }));
|
|
33
|
+
|
|
34
|
+
const btnCls = $derived(base({ class: clsx(className) }));
|
|
29
35
|
</script>
|
|
30
36
|
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
<Tooltip {triggerClass} variant="snack" supportingText={tooltipContent}>
|
|
38
|
+
{#snippet trigger({
|
|
39
|
+
class: triggerClass_,
|
|
40
|
+
type: _tooltipType,
|
|
41
|
+
onclick: _tooltipOnclick,
|
|
42
|
+
...triggerAttrs
|
|
43
|
+
})}
|
|
44
|
+
<Toolbar.GroupItem
|
|
45
|
+
{value}
|
|
46
|
+
{disabled}
|
|
47
|
+
class={clsx(btnCls, triggerClass_ as string)}
|
|
48
|
+
{...restProps}
|
|
49
|
+
{...triggerAttrs}
|
|
50
|
+
>
|
|
51
|
+
{#if avatar}
|
|
52
|
+
{@render avatar()}
|
|
53
|
+
{:else if iconProps}
|
|
54
|
+
<Icon {...iconProps} class={icon()} />
|
|
55
|
+
{/if}
|
|
56
|
+
<Layer />
|
|
57
|
+
</Toolbar.GroupItem>
|
|
58
|
+
{/snippet}
|
|
59
|
+
</Tooltip>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
One independently painted cluster within a `<Toolbar sections>` — gets its own bg/shape/
|
|
4
|
+
elevation matching the parent Toolbar's variant/color. Combine with ToolbarSpacer to split
|
|
5
|
+
one toolbar into two or more visually separate surfaces.
|
|
6
|
+
-->
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
import { getContext } from 'svelte';
|
|
10
|
+
import { toolbar, type ToolbarVariants } from './theme.js';
|
|
11
|
+
import type { ToolbarSectionProps } from './types.js';
|
|
12
|
+
|
|
13
|
+
let { children, class: className, ...restProps }: ToolbarSectionProps = $props();
|
|
14
|
+
|
|
15
|
+
const toolbarCtx = getContext<
|
|
16
|
+
| {
|
|
17
|
+
color: ToolbarVariants['color'];
|
|
18
|
+
orientation: ToolbarVariants['orientation'];
|
|
19
|
+
variant: ToolbarVariants['variant'];
|
|
20
|
+
}
|
|
21
|
+
| undefined
|
|
22
|
+
>('toolbar');
|
|
23
|
+
|
|
24
|
+
const cls = $derived(
|
|
25
|
+
toolbar({
|
|
26
|
+
orientation: toolbarCtx?.orientation,
|
|
27
|
+
variant: toolbarCtx?.variant,
|
|
28
|
+
color: toolbarCtx?.color
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<div class={cls.segment({ class: clsx(className) })} {...restProps}>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolbarSectionProps } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* One independently painted cluster within a `<Toolbar sections>` — gets its own bg/shape/
|
|
4
|
+
* elevation matching the parent Toolbar's variant/color. Combine with ToolbarSpacer to split
|
|
5
|
+
* one toolbar into two or more visually separate surfaces.
|
|
6
|
+
*/
|
|
7
|
+
declare const ToolbarSection: import("svelte").Component<ToolbarSectionProps, {}, "">;
|
|
8
|
+
type ToolbarSection = ReturnType<typeof ToolbarSection>;
|
|
9
|
+
export default ToolbarSection;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
A plain marker gap between `ToolbarSection`s under `<Toolbar sections>` — visually the same
|
|
4
|
+
as the toolbar's normal item spacing, it does not grow, so sections stay adjacent rather than
|
|
5
|
+
being pushed apart to opposite edges. (For pushing trailing children to the far edge of a
|
|
6
|
+
single segment, use `fabSlot`/the `fab` prop instead — that's a flex-`ml-auto` push, not this.)
|
|
7
|
+
-->
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import { toolbar } from './theme.js';
|
|
11
|
+
import type { ToolbarSpacerProps } from './types.js';
|
|
12
|
+
|
|
13
|
+
let { class: className, ...restProps }: ToolbarSpacerProps = $props();
|
|
14
|
+
|
|
15
|
+
const cls = toolbar();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<div class={cls.spacer({ class: clsx(className) })} {...restProps}></div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plain marker gap between `ToolbarSection`s under `<Toolbar sections>` — visually the same
|
|
3
|
+
* as the toolbar's normal item spacing, it does not grow, so sections stay adjacent rather than
|
|
4
|
+
* being pushed apart to opposite edges. (For pushing trailing children to the far edge of a
|
|
5
|
+
* single segment, use `fabSlot`/the `fab` prop instead — that's a flex-`ml-auto` push, not this.)
|
|
6
|
+
*/
|
|
7
|
+
declare const ToolbarSpacer: import("svelte").Component<import("../../index.js").DivAttrs, {}, "">;
|
|
8
|
+
type ToolbarSpacer = ReturnType<typeof ToolbarSpacer>;
|
|
9
|
+
export default ToolbarSpacer;
|
|
@@ -5,3 +5,5 @@ export { default as ToolbarButton } from './ToolbarButton.svelte';
|
|
|
5
5
|
export { default as ToolbarDivider } from './ToolbarDivider.svelte';
|
|
6
6
|
export { default as ToolbarGroup } from './ToolbarGroup.svelte';
|
|
7
7
|
export { default as ToolbarGroupItem } from './ToolbarGroupItem.svelte';
|
|
8
|
+
export { default as ToolbarSection } from './ToolbarSection.svelte';
|
|
9
|
+
export { default as ToolbarSpacer } from './ToolbarSpacer.svelte';
|
|
@@ -8,3 +8,5 @@ export { default as ToolbarButton } from './ToolbarButton.svelte';
|
|
|
8
8
|
export { default as ToolbarDivider } from './ToolbarDivider.svelte';
|
|
9
9
|
export { default as ToolbarGroup } from './ToolbarGroup.svelte';
|
|
10
10
|
export { default as ToolbarGroupItem } from './ToolbarGroupItem.svelte';
|
|
11
|
+
export { default as ToolbarSection } from './ToolbarSection.svelte';
|
|
12
|
+
export { default as ToolbarSpacer } from './ToolbarSpacer.svelte';
|