fluentui-svelte 0.6.0 → 0.7.0
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/components/app-surface/app-surface.svelte +96 -0
- package/dist/components/app-surface/app-surface.svelte.d.ts +22 -0
- package/dist/components/app-surface/docs/llms.md +73 -0
- package/dist/components/app-surface/types.d.ts +19 -0
- package/dist/components/app-surface/types.js +1 -0
- package/dist/components/app-window/app-window.d.ts +3 -0
- package/dist/components/app-window/app-window.js +3 -0
- package/dist/components/app-window/app-window.svelte +193 -0
- package/dist/components/app-window/app-window.svelte.d.ts +25 -0
- package/dist/components/app-window/docs/llms.md +119 -0
- package/dist/components/app-window/types.d.ts +66 -0
- package/dist/components/app-window/types.js +1 -0
- package/dist/components/auto-suggest-box/auto-suggest-box.svelte +47 -31
- package/dist/components/auto-suggest-box/auto-suggest-box.svelte.d.ts +2 -2
- package/dist/components/auto-suggest-box/docs/llms.md +34 -33
- package/dist/components/auto-suggest-box/option.svelte +6 -4
- package/dist/components/auto-suggest-box/types.d.ts +13 -16
- package/dist/components/avatar/avatar.svelte +4 -3
- package/dist/components/avatar/docs/llms.md +1 -1
- package/dist/components/avatar/type.d.ts +1 -1
- package/dist/components/badge/badge-icon.svelte +2 -2
- package/dist/components/badge/badge.svelte +2 -2
- package/dist/components/badge/docs/llms.md +2 -2
- package/dist/components/badge/types.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb-button.svelte +2 -2
- package/dist/components/breadcrumb/breadcrumb-divider.svelte +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.svelte +2 -2
- package/dist/components/breadcrumb/breadcrumb.svelte +10 -5
- package/dist/components/breadcrumb/docs/llms.md +11 -11
- package/dist/components/breadcrumb/types.d.ts +7 -7
- package/dist/components/button/button.svelte +2 -2
- package/dist/components/button/docs/llms.md +17 -17
- package/dist/components/button/split-button.svelte +7 -7
- package/dist/components/button/types.d.ts +5 -5
- package/dist/components/calendar-date-picker/calendar-date-picker.svelte +98 -10
- package/dist/components/calendar-date-picker/calendar-date-picker.svelte.d.ts +1 -1
- package/dist/components/calendar-date-picker/docs/llms.md +19 -14
- package/dist/components/calendar-date-picker/types.d.ts +22 -8
- package/dist/components/calendar-view/calendar-view-days.svelte +3 -2
- package/dist/components/calendar-view/calendar-view-grid.js +8 -3
- package/dist/components/calendar-view/calendar-view-item.svelte +10 -4
- package/dist/components/calendar-view/calendar-view-months.svelte +3 -2
- package/dist/components/calendar-view/calendar-view-years.svelte +3 -2
- package/dist/components/calendar-view/calendar-view.svelte +11 -4
- package/dist/components/calendar-view/calendar-view.svelte.js +5 -0
- package/dist/components/calendar-view/docs/llms.md +20 -19
- package/dist/components/calendar-view/types.d.ts +6 -1
- package/dist/components/card/card-footer.svelte +2 -2
- package/dist/components/card/card-header.svelte +5 -4
- package/dist/components/card/card-preview.svelte +13 -2
- package/dist/components/card/card.svelte +5 -5
- package/dist/components/card/docs/llms.md +22 -21
- package/dist/components/card/types.d.ts +8 -4
- package/dist/components/checkbox/checkbox.svelte +47 -26
- package/dist/components/checkbox/checkbox.svelte.d.ts +3 -24
- package/dist/components/checkbox/docs/llms.md +24 -23
- package/dist/components/checkbox/types.d.ts +10 -23
- package/dist/components/date-picker/date-picker.svelte +98 -27
- package/dist/components/date-picker/date-picker.svelte.d.ts +1 -1
- package/dist/components/date-picker/docs/llms.md +23 -20
- package/dist/components/date-picker/types.d.ts +24 -15
- package/dist/components/dialog/dialog-actions.svelte +2 -2
- package/dist/components/dialog/dialog-content.svelte +2 -2
- package/dist/components/dialog/dialog-surface.svelte +102 -9
- package/dist/components/dialog/dialog-title.svelte +2 -2
- package/dist/components/dialog/dialog-trigger.svelte +2 -2
- package/dist/components/dialog/dialog.svelte +22 -11
- package/dist/components/dialog/docs/llms.md +56 -19
- package/dist/components/dialog/types.d.ts +25 -7
- package/dist/components/divider/divider.svelte +6 -4
- package/dist/components/divider/types.d.ts +1 -1
- package/dist/components/dropdown/docs/llms.md +30 -28
- package/dist/components/dropdown/dropdown-option.svelte +17 -5
- package/dist/components/dropdown/dropdown.svelte +182 -84
- package/dist/components/dropdown/dropdown.svelte.d.ts +1 -1
- package/dist/components/dropdown/types.d.ts +26 -20
- package/dist/components/dropdown-select/docs/llms.md +24 -22
- package/dist/components/dropdown-select/dropdown-select-option.svelte +2 -2
- package/dist/components/dropdown-select/dropdown-select.svelte +42 -7
- package/dist/components/dropdown-select/types.d.ts +4 -4
- package/dist/components/expander/docs/llms.md +3 -3
- package/dist/components/expander/expander.svelte +13 -8
- package/dist/components/expander/types.d.ts +5 -5
- package/dist/components/flyout/docs/llms.md +1 -1
- package/dist/components/flyout/flyout.svelte +17 -6
- package/dist/components/flyout/types.d.ts +1 -1
- package/dist/components/hyperlink/docs/llms.md +6 -6
- package/dist/components/hyperlink/hyperlink.svelte +13 -4
- package/dist/components/hyperlink/types.d.ts +1 -1
- package/dist/components/info-bar/docs/llms.md +11 -10
- package/dist/components/info-bar/info-bar.svelte +3 -2
- package/dist/components/info-bar/types.d.ts +4 -0
- package/dist/components/label/docs/llms.md +75 -22
- package/dist/components/label/label-context.d.ts +14 -0
- package/dist/components/label/label-context.js +10 -0
- package/dist/components/label/label.svelte +153 -30
- package/dist/components/label/label.svelte.d.ts +1 -1
- package/dist/components/label/types.d.ts +48 -4
- package/dist/components/list-view/docs/llms.md +103 -33
- package/dist/components/list-view/list-view-item-branch.svelte +257 -0
- package/dist/components/list-view/list-view-item-branch.svelte.d.ts +4 -0
- package/dist/components/list-view/list-view-item.svelte +164 -46
- package/dist/components/list-view/list-view-item.svelte.d.ts +5 -5
- package/dist/components/list-view/list-view.svelte +73 -25
- package/dist/components/list-view/types.d.ts +71 -8
- package/dist/components/list-view/utils.d.ts +10 -0
- package/dist/components/list-view/utils.js +17 -1
- package/dist/components/menu/docs/llms.md +98 -15
- package/dist/components/menu/menu-command-bar-item.svelte +61 -0
- package/dist/components/menu/menu-command-bar-item.svelte.d.ts +14 -0
- package/dist/components/menu/menu-command-bar.svelte +218 -0
- package/dist/components/menu/menu-command-bar.svelte.d.ts +21 -0
- package/dist/components/menu/menu-group.svelte +6 -3
- package/dist/components/menu/menu-item-checkbox.svelte +5 -4
- package/dist/components/menu/menu-item-radio.svelte +5 -4
- package/dist/components/menu/menu-item-switch.svelte +5 -4
- package/dist/components/menu/menu-item.svelte +5 -5
- package/dist/components/menu/menu-item.svelte.d.ts +2 -3
- package/dist/components/menu/menu-list.svelte +10 -1
- package/dist/components/menu/menu-popover.svelte +9 -5
- package/dist/components/menu/menu-trigger.svelte +2 -1
- package/dist/components/menu/menu.svelte.js +1 -0
- package/dist/components/menu/types.d.ts +62 -7
- package/dist/components/number-box/docs/llms.md +6 -4
- package/dist/components/number-box/number-box.svelte +35 -29
- package/dist/components/number-box/number-box.svelte.d.ts +1 -1
- package/dist/components/number-box/types.d.ts +1 -1
- package/dist/components/persona/docs/llms.md +29 -25
- package/dist/components/persona/persona.svelte +8 -6
- package/dist/components/persona/types.d.ts +4 -3
- package/dist/components/progress-bar/docs/llms.md +13 -13
- package/dist/components/progress-bar/progress-bar.svelte +6 -6
- package/dist/components/progress-bar/types.d.ts +4 -4
- package/dist/components/progress-ring/docs/llms.md +14 -14
- package/dist/components/progress-ring/progress-ring.svelte +5 -5
- package/dist/components/progress-ring/types.d.ts +3 -3
- package/dist/components/radio-button/docs/llms.md +11 -8
- package/dist/components/radio-button/radio-button.svelte +38 -12
- package/dist/components/radio-button/radio-button.svelte.d.ts +1 -1
- package/dist/components/radio-button/types.d.ts +11 -8
- package/dist/components/rating/docs/llms.md +15 -14
- package/dist/components/rating/rating.svelte +66 -29
- package/dist/components/rating/rating.svelte.d.ts +1 -1
- package/dist/components/rating/types.d.ts +8 -8
- package/dist/components/side-nav/docs/llms.md +110 -0
- package/dist/components/side-nav/side-nav-branch.svelte +43 -0
- package/dist/components/side-nav/side-nav-branch.svelte.d.ts +4 -0
- package/dist/components/side-nav/side-nav-item.svelte +75 -0
- package/dist/components/side-nav/side-nav-item.svelte.d.ts +25 -0
- package/dist/components/side-nav/side-nav-list.svelte +32 -0
- package/dist/components/side-nav/side-nav-list.svelte.d.ts +7 -0
- package/dist/components/side-nav/side-nav.d.ts +2 -0
- package/dist/components/side-nav/side-nav.js +2 -0
- package/dist/components/side-nav/side-nav.svelte +355 -0
- package/dist/components/side-nav/side-nav.svelte.d.ts +24 -0
- package/dist/components/side-nav/types.d.ts +149 -0
- package/dist/components/side-nav/types.js +1 -0
- package/dist/components/skeleton/docs/llms.md +1 -1
- package/dist/components/skeleton/skeleton.svelte +2 -2
- package/dist/components/skeleton/types.d.ts +1 -1
- package/dist/components/slider/docs/llms.md +31 -28
- package/dist/components/slider/slider.svelte +126 -61
- package/dist/components/slider/slider.svelte.d.ts +1 -3
- package/dist/components/slider/types.d.ts +21 -14
- package/dist/components/tab-view/docs/llms.md +7 -7
- package/dist/components/tab-view/tab-view-tab.svelte +16 -14
- package/dist/components/tab-view/tab-view.svelte +16 -9
- package/dist/components/tab-view/types.d.ts +6 -6
- package/dist/components/table/docs/llms.md +38 -33
- package/dist/components/table/table-body.svelte +2 -2
- package/dist/components/table/table-cell-actions.svelte +8 -2
- package/dist/components/table/table-cell-layout.svelte +2 -2
- package/dist/components/table/table-cell.svelte +2 -2
- package/dist/components/table/table-header-cell.svelte +2 -2
- package/dist/components/table/table-header.svelte +2 -2
- package/dist/components/table/table-row.svelte +2 -2
- package/dist/components/table/table-selection-cell.svelte +6 -6
- package/dist/components/table/table.svelte +2 -2
- package/dist/components/table/types.d.ts +11 -11
- package/dist/components/tag/docs/llms.md +26 -26
- package/dist/components/tag/tag-group.svelte +2 -2
- package/dist/components/tag/tag.svelte +13 -12
- package/dist/components/tag/types.d.ts +6 -4
- package/dist/components/tag-picker/docs/llms.md +61 -55
- package/dist/components/tag-picker/option-group.svelte +17 -4
- package/dist/components/tag-picker/option-group.svelte.d.ts +1 -1
- package/dist/components/tag-picker/option.svelte +15 -4
- package/dist/components/tag-picker/tag-picker.svelte +137 -65
- package/dist/components/tag-picker/tag-picker.svelte.d.ts +2 -2
- package/dist/components/tag-picker/types.d.ts +36 -16
- package/dist/components/text-box/docs/llms.md +31 -4
- package/dist/components/text-box/text-box-button.svelte +3 -3
- package/dist/components/text-box/text-box-button.svelte.d.ts +1 -1
- package/dist/components/text-box/text-box.svelte +41 -14
- package/dist/components/text-box/types.d.ts +5 -5
- package/dist/components/textarea/docs/llms.md +4 -3
- package/dist/components/textarea/textarea.svelte +14 -6
- package/dist/components/textarea/types.d.ts +2 -4
- package/dist/components/time-picker/docs/llms.md +18 -15
- package/dist/components/time-picker/time-picker.svelte +133 -33
- package/dist/components/time-picker/time-picker.svelte.d.ts +1 -1
- package/dist/components/time-picker/types.d.ts +23 -13
- package/dist/components/title-bar/docs/llms.md +382 -0
- package/dist/components/title-bar/title-bar-left-controls.svelte +215 -0
- package/dist/components/title-bar/title-bar-left-controls.svelte.d.ts +22 -0
- package/dist/components/title-bar/title-bar-right-controls.svelte +190 -0
- package/dist/components/title-bar/title-bar-right-controls.svelte.d.ts +27 -0
- package/dist/components/title-bar/title-bar.d.ts +3 -0
- package/dist/components/title-bar/title-bar.js +4 -0
- package/dist/components/title-bar/title-bar.svelte +224 -0
- package/dist/components/title-bar/title-bar.svelte.d.ts +26 -0
- package/dist/components/title-bar/types.d.ts +165 -0
- package/dist/components/title-bar/types.js +1 -0
- package/dist/components/toggle-switch/docs/llms.md +11 -9
- package/dist/components/toggle-switch/toggle-switch.svelte +23 -14
- package/dist/components/toggle-switch/toggle-switch.svelte.d.ts +1 -1
- package/dist/components/toggle-switch/types.d.ts +12 -10
- package/dist/components/tooltip/docs/llms.md +1 -1
- package/dist/components/tooltip/tooltip.svelte +5 -4
- package/dist/components/tooltip/types.d.ts +1 -1
- package/dist/components/top-nav/docs/llms.md +1 -1
- package/dist/components/top-nav/top-nav-item.svelte +2 -2
- package/dist/components/top-nav/top-nav.svelte +2 -2
- package/dist/components/top-nav/types.d.ts +2 -2
- package/dist/components/tree-view/docs/llms.md +11 -11
- package/dist/components/tree-view/tree-view-item-content.svelte +3 -3
- package/dist/components/tree-view/tree-view-item.svelte +13 -5
- package/dist/components/tree-view/tree-view.svelte +20 -5
- package/dist/components/tree-view/tree-view.svelte.d.ts +1 -1
- package/dist/components/tree-view/tree-view.svelte.js +31 -3
- package/dist/components/tree-view/types.d.ts +7 -3
- package/dist/index.d.ts +18 -0
- package/dist/index.js +20 -0
- package/dist/internal/components/dynamic-carousel/dynamic-carousel.svelte +26 -5
- package/dist/internal/components/dynamic-carousel/dynamic-carousel.svelte.d.ts +2 -0
- package/dist/internal/index.d.ts +1 -0
- package/dist/internal/index.js +1 -0
- package/dist/internal/native-field.svelte.d.ts +44 -0
- package/dist/internal/native-field.svelte.js +85 -0
- package/dist/internal/utils.d.ts +16 -2
- package/dist/internal/utils.js +25 -3
- package/dist/types/index.d.ts +3 -3
- package/package.json +50 -36
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TitleBarLeftControlsProps } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The controls at the start of a `TitleBar`: a back button, a global navigation button, and the identity of the app,
|
|
4
|
+
* which is its icon, its name and its release tag. Inside a `TitleBar` it follows its `tabbable` setting and its drag region; it also works on its own.
|
|
5
|
+
*
|
|
6
|
+
* - Usage:
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <script>
|
|
9
|
+
* import { TitleBar, TitleBarLeftControls } from 'fluentui-svelte';
|
|
10
|
+
* import { AppsRegular } from 'fluentui-icons-svelte';
|
|
11
|
+
* </script>
|
|
12
|
+
*
|
|
13
|
+
* <TitleBar>
|
|
14
|
+
* {#snippet leftControls()}
|
|
15
|
+
* <TitleBarLeftControls back globalNav appIcon={AppsRegular} appName="FluentUI App" releaseTag="PREVIEW" />
|
|
16
|
+
* {/snippet}
|
|
17
|
+
* </TitleBar>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare const TitleBarLeftControls: import("svelte").Component<TitleBarLeftControlsProps, {}, "ref">;
|
|
21
|
+
type TitleBarLeftControls = ReturnType<typeof TitleBarLeftControls>;
|
|
22
|
+
export default TitleBarLeftControls;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { untrack } from 'svelte';
|
|
3
|
+
import { Avatar, Button } from '../../index.js';
|
|
4
|
+
import DismissRegular from 'fluentui-icons-svelte/DismissRegular.svelte';
|
|
5
|
+
import SquareMultipleRegular from 'fluentui-icons-svelte/SquareMultipleRegular.svelte';
|
|
6
|
+
import SquareRegular from 'fluentui-icons-svelte/SquareRegular.svelte';
|
|
7
|
+
import SubtractRegular from 'fluentui-icons-svelte/SubtractRegular.svelte';
|
|
8
|
+
import { getTitleBarContext } from './title-bar.js';
|
|
9
|
+
import { getAppWindowContext } from '../app-window/app-window.js';
|
|
10
|
+
import type { TitleBarRightControlsProps } from './types.js';
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
ref = $bindable(null),
|
|
14
|
+
hideMinimize = false,
|
|
15
|
+
hideWindowToggle = false,
|
|
16
|
+
hideClose = false,
|
|
17
|
+
maximized,
|
|
18
|
+
onMinimize,
|
|
19
|
+
onWindowToggle,
|
|
20
|
+
onClose,
|
|
21
|
+
minimizeLabel = 'Minimize',
|
|
22
|
+
maximizeLabel = 'Maximize',
|
|
23
|
+
restoreLabel = 'Restore',
|
|
24
|
+
closeLabel = 'Close',
|
|
25
|
+
personPic,
|
|
26
|
+
onPersonPicClick,
|
|
27
|
+
customMenu,
|
|
28
|
+
class: classes,
|
|
29
|
+
...attributes
|
|
30
|
+
}: TitleBarRightControlsProps = $props();
|
|
31
|
+
|
|
32
|
+
const context = getTitleBarContext();
|
|
33
|
+
const appWindow = getAppWindowContext();
|
|
34
|
+
const effectiveMaximized = $derived(maximized ?? appWindow?.state.maximized ?? false);
|
|
35
|
+
|
|
36
|
+
// Outside a TitleBar the controls are always reachable.
|
|
37
|
+
const tabindex = $derived(context && !context.config.tabbable ? -1 : undefined);
|
|
38
|
+
|
|
39
|
+
const windowToggleLabel = $derived(effectiveMaximized ? restoreLabel : maximizeLabel);
|
|
40
|
+
const hasActions = $derived(!!(customMenu || personPic));
|
|
41
|
+
const hasWindowControls = $derived(!(hideMinimize && hideWindowToggle && hideClose));
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<!--
|
|
45
|
+
@component
|
|
46
|
+
The controls at the end of a `TitleBar`: custom menus, the picture of the person, and the minimize, maximize and close
|
|
47
|
+
buttons of the window. The window buttons only report the press, since moving the window is up to the host of your app.
|
|
48
|
+
Inside a `TitleBar` it follows its `tabbable` setting; it also works on its own.
|
|
49
|
+
|
|
50
|
+
- Usage:
|
|
51
|
+
```tsx
|
|
52
|
+
<script>
|
|
53
|
+
import { TitleBar, TitleBarRightControls } from 'fluentui-svelte';
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<TitleBar>
|
|
57
|
+
{#snippet rightControls()}
|
|
58
|
+
<TitleBarRightControls
|
|
59
|
+
personPic={{ name: 'Ada Lovelace' }}
|
|
60
|
+
onMinimize={() => appWindow.minimize()}
|
|
61
|
+
onWindowToggle={() => appWindow.toggleMaximize()}
|
|
62
|
+
onClose={() => appWindow.close()}
|
|
63
|
+
/>
|
|
64
|
+
{/snippet}
|
|
65
|
+
</TitleBar>
|
|
66
|
+
```
|
|
67
|
+
-->
|
|
68
|
+
<div
|
|
69
|
+
{@attach (element) => {
|
|
70
|
+
if (untrack(() => ref) !== element) ref = element;
|
|
71
|
+
return () => {
|
|
72
|
+
if (ref === element) ref = null;
|
|
73
|
+
};
|
|
74
|
+
}}
|
|
75
|
+
class={['fs-title-bar-right-controls', classes]}
|
|
76
|
+
{...context?.config.dragRegionProps}
|
|
77
|
+
{...attributes}
|
|
78
|
+
>
|
|
79
|
+
{#if hasActions}
|
|
80
|
+
<div class="fs-title-bar-actions" {...context?.config.dragRegionProps}>
|
|
81
|
+
{@render customMenu?.()}
|
|
82
|
+
{#if personPic}
|
|
83
|
+
{#if onPersonPicClick}
|
|
84
|
+
<Button
|
|
85
|
+
class="fs-title-bar-person-pic"
|
|
86
|
+
appearance="subtle"
|
|
87
|
+
shape="circular"
|
|
88
|
+
{tabindex}
|
|
89
|
+
onclick={onPersonPicClick}
|
|
90
|
+
>
|
|
91
|
+
<Avatar size={24} {...personPic} />
|
|
92
|
+
</Button>
|
|
93
|
+
{:else}
|
|
94
|
+
<Avatar size={24} {...personPic} />
|
|
95
|
+
{/if}
|
|
96
|
+
{/if}
|
|
97
|
+
</div>
|
|
98
|
+
{/if}
|
|
99
|
+
{#if hasWindowControls}
|
|
100
|
+
<div class="fs-title-bar-caption-buttons">
|
|
101
|
+
{#if !hideMinimize}
|
|
102
|
+
<Button
|
|
103
|
+
class="fs-title-bar-caption fs-title-bar-caption-minimize"
|
|
104
|
+
appearance="subtle"
|
|
105
|
+
shape="square"
|
|
106
|
+
aria-label={minimizeLabel}
|
|
107
|
+
title={minimizeLabel}
|
|
108
|
+
{tabindex}
|
|
109
|
+
onclick={onMinimize}
|
|
110
|
+
>
|
|
111
|
+
<SubtractRegular aria-hidden="true" />
|
|
112
|
+
</Button>
|
|
113
|
+
{/if}
|
|
114
|
+
{#if !hideWindowToggle}
|
|
115
|
+
<Button
|
|
116
|
+
class="fs-title-bar-caption fs-title-bar-caption-toggle"
|
|
117
|
+
appearance="subtle"
|
|
118
|
+
shape="square"
|
|
119
|
+
aria-label={windowToggleLabel}
|
|
120
|
+
title={windowToggleLabel}
|
|
121
|
+
{tabindex}
|
|
122
|
+
onclick={onWindowToggle}
|
|
123
|
+
>
|
|
124
|
+
{#if effectiveMaximized}
|
|
125
|
+
<SquareMultipleRegular aria-hidden="true" />
|
|
126
|
+
{:else}
|
|
127
|
+
<SquareRegular aria-hidden="true" />
|
|
128
|
+
{/if}
|
|
129
|
+
</Button>
|
|
130
|
+
{/if}
|
|
131
|
+
{#if !hideClose}
|
|
132
|
+
<Button
|
|
133
|
+
class="fs-title-bar-caption fs-title-bar-caption-close"
|
|
134
|
+
appearance="subtle"
|
|
135
|
+
shape="square"
|
|
136
|
+
aria-label={closeLabel}
|
|
137
|
+
title={closeLabel}
|
|
138
|
+
{tabindex}
|
|
139
|
+
onclick={onClose}
|
|
140
|
+
>
|
|
141
|
+
<DismissRegular aria-hidden="true" />
|
|
142
|
+
</Button>
|
|
143
|
+
{/if}
|
|
144
|
+
</div>
|
|
145
|
+
{/if}
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<style>
|
|
149
|
+
.fs-title-bar-right-controls {
|
|
150
|
+
display: flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
block-size: 100%;
|
|
153
|
+
}
|
|
154
|
+
.fs-title-bar-actions {
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
gap: 0.25rem;
|
|
158
|
+
padding-inline: 0.5rem;
|
|
159
|
+
& :global(.fs-title-bar-person-pic) {
|
|
160
|
+
padding: 0.25rem;
|
|
161
|
+
background: var(--fs-subtle-fill-transparent);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
/* The window buttons run the full height of the bar, flush with its edge. */
|
|
165
|
+
.fs-title-bar-caption-buttons {
|
|
166
|
+
display: flex;
|
|
167
|
+
align-self: stretch;
|
|
168
|
+
& :global(.fs-title-bar-caption) {
|
|
169
|
+
flex: none;
|
|
170
|
+
inline-size: 2.875rem;
|
|
171
|
+
padding: 0;
|
|
172
|
+
background: var(--fs-subtle-fill-transparent);
|
|
173
|
+
&:focus-visible {
|
|
174
|
+
outline-offset: -0.125rem;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
& :global(.fs-title-bar-caption svg) {
|
|
178
|
+
inline-size: 0.875rem;
|
|
179
|
+
block-size: 0.875rem;
|
|
180
|
+
}
|
|
181
|
+
& :global(.fs-title-bar-caption.fs-title-bar-caption-close:hover),
|
|
182
|
+
& :global(.fs-title-bar-caption.fs-title-bar-caption-close:active) {
|
|
183
|
+
color: var(--fs-text-on-accent-primary);
|
|
184
|
+
background: var(--fs-system-critical);
|
|
185
|
+
}
|
|
186
|
+
& :global(.fs-title-bar-caption.fs-title-bar-caption-close:active) {
|
|
187
|
+
background: color-mix(in srgb, var(--fs-system-critical) 80%, transparent);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { TitleBarRightControlsProps } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The controls at the end of a `TitleBar`: custom menus, the picture of the person, and the minimize, maximize and close
|
|
4
|
+
* buttons of the window. The window buttons only report the press, since moving the window is up to the host of your app.
|
|
5
|
+
* Inside a `TitleBar` it follows its `tabbable` setting; it also works on its own.
|
|
6
|
+
*
|
|
7
|
+
* - Usage:
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <script>
|
|
10
|
+
* import { TitleBar, TitleBarRightControls } from 'fluentui-svelte';
|
|
11
|
+
* </script>
|
|
12
|
+
*
|
|
13
|
+
* <TitleBar>
|
|
14
|
+
* {#snippet rightControls()}
|
|
15
|
+
* <TitleBarRightControls
|
|
16
|
+
* personPic={{ name: 'Ada Lovelace' }}
|
|
17
|
+
* onMinimize={() => appWindow.minimize()}
|
|
18
|
+
* onWindowToggle={() => appWindow.toggleMaximize()}
|
|
19
|
+
* onClose={() => appWindow.close()}
|
|
20
|
+
* />
|
|
21
|
+
* {/snippet}
|
|
22
|
+
* </TitleBar>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare const TitleBarRightControls: import("svelte").Component<TitleBarRightControlsProps, {}, "ref">;
|
|
26
|
+
type TitleBarRightControls = ReturnType<typeof TitleBarRightControls>;
|
|
27
|
+
export default TitleBarRightControls;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onDestroy, tick } from 'svelte';
|
|
3
|
+
import { getAppWindowContext } from '../app-window/app-window.js';
|
|
4
|
+
import { Button } from '../../index.js';
|
|
5
|
+
import { toLength } from '../../internal/index.js';
|
|
6
|
+
import SearchRegular from 'fluentui-icons-svelte/SearchRegular.svelte';
|
|
7
|
+
import { setTitleBarContext } from './title-bar.js';
|
|
8
|
+
import type { TitleBarContext, TitleBarProps } from './types.js';
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
ref = $bindable(null),
|
|
12
|
+
leftControls,
|
|
13
|
+
search,
|
|
14
|
+
rightControls,
|
|
15
|
+
tall,
|
|
16
|
+
searchMinWidth = 200,
|
|
17
|
+
searchMaxWidth = 480,
|
|
18
|
+
searchCollapsed = $bindable(false),
|
|
19
|
+
searchLabel = 'Search',
|
|
20
|
+
tabbable = true,
|
|
21
|
+
dragRegionProps,
|
|
22
|
+
class: classes,
|
|
23
|
+
...attributes
|
|
24
|
+
}: TitleBarProps = $props();
|
|
25
|
+
|
|
26
|
+
const FOCUSABLE = 'input, textarea, select, button, a[href], [tabindex]:not([tabindex="-1"])';
|
|
27
|
+
|
|
28
|
+
let searchRef = $state<HTMLDivElement>();
|
|
29
|
+
let searchButtonRef = $state<HTMLButtonElement | null>(null);
|
|
30
|
+
|
|
31
|
+
const hasSearch = $derived(!!search);
|
|
32
|
+
const collapsed = $derived(hasSearch && searchCollapsed);
|
|
33
|
+
const _tall = $derived(tall ?? hasSearch);
|
|
34
|
+
|
|
35
|
+
const context: TitleBarContext = {
|
|
36
|
+
config: {
|
|
37
|
+
get tabbable() {
|
|
38
|
+
return tabbable;
|
|
39
|
+
},
|
|
40
|
+
get dragRegionProps() {
|
|
41
|
+
return dragRegionProps;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
state: null,
|
|
45
|
+
events: null,
|
|
46
|
+
methods: null
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
setTitleBarContext(context);
|
|
50
|
+
const appWindow = getAppWindowContext();
|
|
51
|
+
const unregister = appWindow?.methods.registerTitleBar({
|
|
52
|
+
get ref() {
|
|
53
|
+
return ref ?? null;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
onDestroy(() => unregister?.());
|
|
57
|
+
|
|
58
|
+
function restoreSearchFocus() {
|
|
59
|
+
if (collapsed && searchRef?.contains(searchRef.ownerDocument.activeElement)) {
|
|
60
|
+
void tick().then(() => searchButtonRef?.focus());
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
$effect.pre(restoreSearchFocus);
|
|
64
|
+
|
|
65
|
+
const expandSearch = async () => {
|
|
66
|
+
searchCollapsed = false;
|
|
67
|
+
await tick();
|
|
68
|
+
for (const element of searchRef?.querySelectorAll<HTMLElement>(FOCUSABLE) ?? []) {
|
|
69
|
+
// Hidden, disabled and inert elements ignore focus; try the next candidate.
|
|
70
|
+
element.focus();
|
|
71
|
+
if (element.ownerDocument.activeElement === element) break;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<!--
|
|
77
|
+
@component
|
|
78
|
+
A title bar is the top bar of an app shell, laid out like the one of a Windows 11 app: the identity of the app
|
|
79
|
+
and its navigation at the start, a search that grows and shrinks at the center, and the window controls at the end.
|
|
80
|
+
It paints no background of its own, since it sits on the component that renders the window. The controls it holds,
|
|
81
|
+
`TitleBarLeftControls` and `TitleBarRightControls`, follow its settings when they are rendered inside it, and work on their own.
|
|
82
|
+
|
|
83
|
+
- Usage:
|
|
84
|
+
```tsx
|
|
85
|
+
<script>
|
|
86
|
+
import { TitleBar, TitleBarLeftControls, TitleBarRightControls } from 'fluentui-svelte';
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<TitleBar>
|
|
90
|
+
{#snippet leftControls()}
|
|
91
|
+
<TitleBarLeftControls appName="FluentUI App" releaseTag="PREVIEW" />
|
|
92
|
+
{/snippet}
|
|
93
|
+
{#snippet rightControls()}
|
|
94
|
+
<TitleBarRightControls onClose={() => window.close()} />
|
|
95
|
+
{/snippet}
|
|
96
|
+
</TitleBar>
|
|
97
|
+
```
|
|
98
|
+
-->
|
|
99
|
+
<header
|
|
100
|
+
{@attach (element) => {
|
|
101
|
+
ref = element;
|
|
102
|
+
return () => {
|
|
103
|
+
ref = null;
|
|
104
|
+
};
|
|
105
|
+
}}
|
|
106
|
+
class={['fs-title-bar', _tall && 'tall', hasSearch && 'has-search', collapsed && 'collapsed', classes]}
|
|
107
|
+
style:--fs-title-bar-search-min={toLength(searchMinWidth)}
|
|
108
|
+
style:--fs-title-bar-search-max={toLength(searchMaxWidth)}
|
|
109
|
+
{...dragRegionProps}
|
|
110
|
+
{...attributes}
|
|
111
|
+
>
|
|
112
|
+
<div class="fs-title-bar-left" {...dragRegionProps}>
|
|
113
|
+
{@render leftControls?.()}
|
|
114
|
+
</div>
|
|
115
|
+
{#if search}
|
|
116
|
+
{#if collapsed}
|
|
117
|
+
<div class="fs-title-bar-search">
|
|
118
|
+
<Button
|
|
119
|
+
bind:ref={searchButtonRef}
|
|
120
|
+
class="fs-title-bar-search-button"
|
|
121
|
+
appearance="subtle"
|
|
122
|
+
aria-label={searchLabel}
|
|
123
|
+
title={searchLabel}
|
|
124
|
+
tabindex={tabbable ? undefined : -1}
|
|
125
|
+
aria-expanded="false"
|
|
126
|
+
onclick={expandSearch}
|
|
127
|
+
>
|
|
128
|
+
<SearchRegular aria-hidden="true" />
|
|
129
|
+
</Button>
|
|
130
|
+
</div>
|
|
131
|
+
{:else}
|
|
132
|
+
<div
|
|
133
|
+
class="fs-title-bar-search"
|
|
134
|
+
{@attach (element) => {
|
|
135
|
+
searchRef = element;
|
|
136
|
+
return () => {
|
|
137
|
+
searchRef = undefined;
|
|
138
|
+
};
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
{@render search()}
|
|
142
|
+
</div>
|
|
143
|
+
{/if}
|
|
144
|
+
{/if}
|
|
145
|
+
<div class="fs-title-bar-right" {...dragRegionProps}>
|
|
146
|
+
{@render rightControls?.()}
|
|
147
|
+
</div>
|
|
148
|
+
</header>
|
|
149
|
+
|
|
150
|
+
<style>
|
|
151
|
+
.fs-title-bar {
|
|
152
|
+
--fs-title-bar-height: 2rem;
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
gap: 0.5rem;
|
|
156
|
+
box-sizing: border-box;
|
|
157
|
+
inline-size: 100%;
|
|
158
|
+
block-size: var(--fs-title-bar-height);
|
|
159
|
+
flex-shrink: 0;
|
|
160
|
+
padding-inline-start: 0.25rem;
|
|
161
|
+
color: var(--fs-text-primary);
|
|
162
|
+
font-family: var(--fs-font-family-base);
|
|
163
|
+
font-size: var(--fs-caption-font-size);
|
|
164
|
+
line-height: var(--fs-caption-line-height);
|
|
165
|
+
user-select: none;
|
|
166
|
+
&.tall {
|
|
167
|
+
--fs-title-bar-height: 3rem;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
.fs-title-bar-left,
|
|
171
|
+
.fs-title-bar-right {
|
|
172
|
+
display: flex;
|
|
173
|
+
flex: none;
|
|
174
|
+
align-items: center;
|
|
175
|
+
align-self: stretch;
|
|
176
|
+
}
|
|
177
|
+
/* Without a search, the right controls take the free space ahead of them to sit at the end. */
|
|
178
|
+
.fs-title-bar-right {
|
|
179
|
+
justify-content: flex-end;
|
|
180
|
+
margin-inline-start: auto;
|
|
181
|
+
}
|
|
182
|
+
.fs-title-bar-left {
|
|
183
|
+
flex: 0 1 auto;
|
|
184
|
+
min-inline-size: 0;
|
|
185
|
+
}
|
|
186
|
+
/*
|
|
187
|
+
* The search shrinks toward its minimum and stops growing at its maximum. App names can
|
|
188
|
+
* also shrink to preserve room for the controls. Auto margins center the search between them.
|
|
189
|
+
*/
|
|
190
|
+
.fs-title-bar-search {
|
|
191
|
+
display: flex;
|
|
192
|
+
flex: 1 1 var(--fs-title-bar-search-max);
|
|
193
|
+
align-items: center;
|
|
194
|
+
min-inline-size: var(--fs-title-bar-search-min);
|
|
195
|
+
max-inline-size: var(--fs-title-bar-search-max);
|
|
196
|
+
margin-inline: auto;
|
|
197
|
+
/* The search is stretched to the width the title bar gives it. */
|
|
198
|
+
& > :global(*) {
|
|
199
|
+
flex: 1 1 auto;
|
|
200
|
+
min-inline-size: 0;
|
|
201
|
+
}
|
|
202
|
+
& > :global(.fs-title-bar-search-button) {
|
|
203
|
+
flex: none;
|
|
204
|
+
inline-size: 2.5rem;
|
|
205
|
+
block-size: 2rem;
|
|
206
|
+
padding: 0;
|
|
207
|
+
background: var(--fs-subtle-fill-transparent);
|
|
208
|
+
}
|
|
209
|
+
& :global(.fs-title-bar-search-button svg) {
|
|
210
|
+
inline-size: 1rem;
|
|
211
|
+
block-size: 1rem;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
.fs-title-bar.has-search .fs-title-bar-right {
|
|
215
|
+
margin-inline-start: 0;
|
|
216
|
+
}
|
|
217
|
+
/* A collapsed search is only a button, which sits beside the right controls. */
|
|
218
|
+
.fs-title-bar.collapsed .fs-title-bar-search {
|
|
219
|
+
flex: none;
|
|
220
|
+
min-inline-size: 0;
|
|
221
|
+
max-inline-size: none;
|
|
222
|
+
margin-inline: auto 0;
|
|
223
|
+
}
|
|
224
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TitleBarProps } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* A title bar is the top bar of an app shell, laid out like the one of a Windows 11 app: the identity of the app
|
|
4
|
+
* and its navigation at the start, a search that grows and shrinks at the center, and the window controls at the end.
|
|
5
|
+
* It paints no background of its own, since it sits on the component that renders the window. The controls it holds,
|
|
6
|
+
* `TitleBarLeftControls` and `TitleBarRightControls`, follow its settings when they are rendered inside it, and work on their own.
|
|
7
|
+
*
|
|
8
|
+
* - Usage:
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <script>
|
|
11
|
+
* import { TitleBar, TitleBarLeftControls, TitleBarRightControls } from 'fluentui-svelte';
|
|
12
|
+
* </script>
|
|
13
|
+
*
|
|
14
|
+
* <TitleBar>
|
|
15
|
+
* {#snippet leftControls()}
|
|
16
|
+
* <TitleBarLeftControls appName="FluentUI App" releaseTag="PREVIEW" />
|
|
17
|
+
* {/snippet}
|
|
18
|
+
* {#snippet rightControls()}
|
|
19
|
+
* <TitleBarRightControls onClose={() => window.close()} />
|
|
20
|
+
* {/snippet}
|
|
21
|
+
* </TitleBar>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare const TitleBar: import("svelte").Component<TitleBarProps, {}, "ref" | "searchCollapsed">;
|
|
25
|
+
type TitleBar = ReturnType<typeof TitleBar>;
|
|
26
|
+
export default TitleBar;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { Component, Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes, MouseEventHandler, SVGAttributes } from 'svelte/elements';
|
|
3
|
+
import type { FSContext } from '../../internal/index.js';
|
|
4
|
+
import type { AvatarProps } from '../avatar/type.ts';
|
|
5
|
+
export type TitleBarContext = FSContext<{
|
|
6
|
+
readonly tabbable: boolean;
|
|
7
|
+
readonly dragRegionProps?: HTMLAttributes<HTMLElement>;
|
|
8
|
+
}, null, null, null>;
|
|
9
|
+
/** @propsmith TitleBarProps */
|
|
10
|
+
export type TitleBarProps = {
|
|
11
|
+
/** The DOM reference of the title bar element.
|
|
12
|
+
* @bindable
|
|
13
|
+
*/
|
|
14
|
+
ref?: HTMLElement | null;
|
|
15
|
+
/** The controls at the start of the bar: back, navigation, and the identity of the app. Render a `TitleBarLeftControls` here.
|
|
16
|
+
* @type Snippet
|
|
17
|
+
*/
|
|
18
|
+
leftControls?: Snippet;
|
|
19
|
+
/** The search at the center of the bar, which grows and shrinks with the window between `searchMinWidth` and `searchMaxWidth`.
|
|
20
|
+
* @type Snippet
|
|
21
|
+
*/
|
|
22
|
+
search?: Snippet;
|
|
23
|
+
/** The controls at the end of the bar: custom menus, the person picture, and the window buttons. Render a `TitleBarRightControls` here.
|
|
24
|
+
* @type Snippet
|
|
25
|
+
*/
|
|
26
|
+
rightControls?: Snippet;
|
|
27
|
+
/** Uses the tall bar, which leaves a search room to breathe. It is on by default when `search` is provided.
|
|
28
|
+
*/
|
|
29
|
+
tall?: boolean;
|
|
30
|
+
/** The narrowest the search gets while the window shrinks. A number is in pixels, converted to rem using the current root font size, with a 16px fallback during SSR. A string is any CSS length.
|
|
31
|
+
* @default 200
|
|
32
|
+
*/
|
|
33
|
+
searchMinWidth?: number | string;
|
|
34
|
+
/** The widest the search gets while the window grows. A number is in pixels, converted to rem using the current root font size, with a 16px fallback during SSR. A string is any CSS length.
|
|
35
|
+
* @default 480
|
|
36
|
+
*/
|
|
37
|
+
searchMaxWidth?: number | string;
|
|
38
|
+
/** Manually collapses the search into a button; it does not collapse automatically on resize. Pressing the button expands the search again and moves the focus into the first available control. The host must leave enough room for the expanded search and the side controls.
|
|
39
|
+
* @default false
|
|
40
|
+
* @bindable
|
|
41
|
+
*/
|
|
42
|
+
searchCollapsed?: boolean;
|
|
43
|
+
/** The accessible name of the button that stands in for a collapsed search.
|
|
44
|
+
* @default 'Search'
|
|
45
|
+
*/
|
|
46
|
+
searchLabel?: string;
|
|
47
|
+
/** Lets the Tab key reach the buttons of the bar. Set to false only when the desktop host provides an alternative keyboard route to these actions. The content you render in the snippets is not affected.
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
tabbable?: boolean;
|
|
51
|
+
/** The attributes that make the bar draggable for the host that moves the window, such as `data-tauri-drag-region` for Tauri.
|
|
52
|
+
* They are spread on the bar, its start and end areas, and the app identity.
|
|
53
|
+
* @type HTMLAttributes
|
|
54
|
+
*/
|
|
55
|
+
dragRegionProps?: HTMLAttributes<HTMLElement>;
|
|
56
|
+
} & Omit<HTMLAttributes<HTMLElement>, 'children'>;
|
|
57
|
+
/** @propsmith TitleBarLeftControlsProps */
|
|
58
|
+
export type TitleBarLeftControlsProps = {
|
|
59
|
+
/** The DOM reference of the controls element.
|
|
60
|
+
* @bindable
|
|
61
|
+
*/
|
|
62
|
+
ref?: HTMLDivElement | null;
|
|
63
|
+
/** Shows the back button.
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
back?: boolean;
|
|
67
|
+
/** Disables the back button, for when there is nowhere to go back to.
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
backDisabled?: boolean;
|
|
71
|
+
/** Called when the back button is pressed. */
|
|
72
|
+
onBack?: MouseEventHandler<HTMLButtonElement>;
|
|
73
|
+
/** The accessible name of the back button.
|
|
74
|
+
* @default 'Back'
|
|
75
|
+
*/
|
|
76
|
+
backLabel?: string;
|
|
77
|
+
/** Shows the global navigation button, or replaces it with the snippet you provide.
|
|
78
|
+
* @type boolean | Snippet
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
globalNav?: boolean | Snippet;
|
|
82
|
+
/** Whether the navigation the global navigation button controls is expanded. Inside an AppWindow with a SideNav, it follows the SideNav and the button expands and collapses it.
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
globalNavExpanded?: boolean;
|
|
86
|
+
/** Called when the global navigation button is pressed. Call `preventDefault()` to keep it from toggling the SideNav of the window. */
|
|
87
|
+
onGlobalNav?: MouseEventHandler<HTMLButtonElement>;
|
|
88
|
+
/** The accessible name of the global navigation button.
|
|
89
|
+
* @default 'Navigation menu'
|
|
90
|
+
*/
|
|
91
|
+
globalNavLabel?: string;
|
|
92
|
+
/** The icon of the app: the URL of an image, an icon component, or a snippet that draws a custom SVG.
|
|
93
|
+
* @type string | Snippet | Component
|
|
94
|
+
*/
|
|
95
|
+
appIcon?: string | Snippet<[SVGAttributes<SVGElement>]> | Component<SVGAttributes<SVGElement>>;
|
|
96
|
+
/** The accessible name of the app icon when appName is absent. Set it to the app's name for an icon-only identity.
|
|
97
|
+
* @default 'Application'
|
|
98
|
+
*/
|
|
99
|
+
appIconLabel?: string;
|
|
100
|
+
/** The name of the app. */
|
|
101
|
+
appName?: string;
|
|
102
|
+
/** The release status of the app, such as `PREVIEW` or `BETA`.
|
|
103
|
+
* @type string | Snippet
|
|
104
|
+
*/
|
|
105
|
+
releaseTag?: string | Snippet;
|
|
106
|
+
/** More content after the release tag, such as a subtitle.
|
|
107
|
+
* @type Snippet
|
|
108
|
+
*/
|
|
109
|
+
children?: Snippet;
|
|
110
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
111
|
+
/** @propsmith TitleBarRightControlsProps */
|
|
112
|
+
export type TitleBarRightControlsProps = {
|
|
113
|
+
/** The DOM reference of the controls element.
|
|
114
|
+
* @bindable
|
|
115
|
+
*/
|
|
116
|
+
ref?: HTMLDivElement | null;
|
|
117
|
+
/** Hides the minimize button.
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
hideMinimize?: boolean;
|
|
121
|
+
/** Hides the maximize and restore button.
|
|
122
|
+
* @default false
|
|
123
|
+
*/
|
|
124
|
+
hideWindowToggle?: boolean;
|
|
125
|
+
/** Hides the close button.
|
|
126
|
+
* @default false
|
|
127
|
+
*/
|
|
128
|
+
hideClose?: boolean;
|
|
129
|
+
/** Whether the window is maximized, which turns the maximize button into a restore button. Inherits AppWindow's maximized state when omitted, or false when standalone.
|
|
130
|
+
* @default false
|
|
131
|
+
*/
|
|
132
|
+
maximized?: boolean;
|
|
133
|
+
/** Called when the minimize button is pressed. */
|
|
134
|
+
onMinimize?: MouseEventHandler<HTMLButtonElement>;
|
|
135
|
+
/** Called when the maximize or restore button is pressed. */
|
|
136
|
+
onWindowToggle?: MouseEventHandler<HTMLButtonElement>;
|
|
137
|
+
/** Called when the close button is pressed. */
|
|
138
|
+
onClose?: MouseEventHandler<HTMLButtonElement>;
|
|
139
|
+
/** The accessible name of the minimize button.
|
|
140
|
+
* @default 'Minimize'
|
|
141
|
+
*/
|
|
142
|
+
minimizeLabel?: string;
|
|
143
|
+
/** The accessible name of the maximize button.
|
|
144
|
+
* @default 'Maximize'
|
|
145
|
+
*/
|
|
146
|
+
maximizeLabel?: string;
|
|
147
|
+
/** The accessible name of the restore button.
|
|
148
|
+
* @default 'Restore'
|
|
149
|
+
*/
|
|
150
|
+
restoreLabel?: string;
|
|
151
|
+
/** The accessible name of the close button.
|
|
152
|
+
* @default 'Close'
|
|
153
|
+
*/
|
|
154
|
+
closeLabel?: string;
|
|
155
|
+
/** The props of the `Avatar` that shows the person. Its size is 24 unless you set one.
|
|
156
|
+
* @type AvatarProps
|
|
157
|
+
*/
|
|
158
|
+
personPic?: AvatarProps;
|
|
159
|
+
/** Called when the person picture is pressed, which turns it into a button. */
|
|
160
|
+
onPersonPicClick?: MouseEventHandler<HTMLButtonElement>;
|
|
161
|
+
/** The custom menus or actions placed before the person picture.
|
|
162
|
+
* @type Snippet
|
|
163
|
+
*/
|
|
164
|
+
customMenu?: Snippet;
|
|
165
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|