fluent-svelte-extra 1.0.5 → 1.0.6
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/{src/lib/AutoSuggestBox → AutoSuggestBox}/AutoSuggestBox.scss +0 -0
- package/AutoSuggestBox/AutoSuggestBox.svelte +157 -0
- package/AutoSuggestBox/AutoSuggestBox.svelte.d.ts +62 -0
- package/{src/lib/Button → Button}/Button.scss +0 -0
- package/Button/Button.svelte +39 -0
- package/Button/Button.svelte.d.ts +30 -0
- package/{src/lib/CalendarDatePicker → CalendarDatePicker}/CalendarDatePicker.scss +0 -0
- package/{src/lib/CalendarDatePicker → CalendarDatePicker}/CalendarDatePicker.svelte +29 -42
- package/CalendarDatePicker/CalendarDatePicker.svelte.d.ts +26 -0
- package/{src/lib/CalendarView → CalendarView}/CalendarView.scss +0 -0
- package/CalendarView/CalendarView.svelte +632 -0
- package/CalendarView/CalendarView.svelte.d.ts +37 -0
- package/{src/lib/CalendarView → CalendarView}/CalendarViewItem.scss +0 -0
- package/CalendarView/CalendarViewItem.svelte +30 -0
- package/CalendarView/CalendarViewItem.svelte.d.ts +28 -0
- package/{src/lib/Checkbox → Checkbox}/Checkbox.scss +0 -0
- package/Checkbox/Checkbox.svelte +70 -0
- package/Checkbox/Checkbox.svelte.d.ts +32 -0
- package/{src/lib/ComboBox → ComboBox}/ComboBox.scss +0 -0
- package/ComboBox/ComboBox.svelte +325 -0
- package/ComboBox/ComboBox.svelte.d.ts +58 -0
- package/{src/lib/ComboBox → ComboBox}/ComboBoxItem.scss +0 -0
- package/ComboBox/ComboBoxItem.svelte +24 -0
- package/ComboBox/ComboBoxItem.svelte.d.ts +22 -0
- package/{src/lib/ContentDialog → ContentDialog}/ContentDialog.scss +0 -0
- package/ContentDialog/ContentDialog.svelte +105 -0
- package/ContentDialog/ContentDialog.svelte.d.ts +37 -0
- package/{src/lib/ContextMenu → ContextMenu}/ContextMenu.scss +0 -0
- package/ContextMenu/ContextMenu.svelte +89 -0
- package/ContextMenu/ContextMenu.svelte.d.ts +27 -0
- package/{src/lib/Expander → Expander}/Expander.scss +0 -0
- package/Expander/Expander.svelte +110 -0
- package/Expander/Expander.svelte.d.ts +42 -0
- package/{src/lib/Flipper → Flipper}/Flipper.svelte +1 -29
- package/Flipper/Flipper.svelte.d.ts +23 -0
- package/{src/lib/Flyout → Flyout}/FlyoutSurface.scss +0 -0
- package/Flyout/FlyoutSurface.svelte +15 -0
- package/Flyout/FlyoutSurface.svelte.d.ts +20 -0
- package/{src/lib/Flyout → Flyout}/FlyoutWrapper.scss +0 -0
- package/Flyout/FlyoutWrapper.svelte +109 -0
- package/Flyout/FlyoutWrapper.svelte.d.ts +46 -0
- package/{src/lib/IconButton → IconButton}/IconButton.scss +0 -0
- package/IconButton/IconButton.svelte +41 -0
- package/IconButton/IconButton.svelte.d.ts +33 -0
- package/{src/lib/InfoBadge → InfoBadge}/InfoBadge.scss +0 -0
- package/{src/lib/InfoBadge → InfoBadge}/InfoBadge.svelte +15 -23
- package/InfoBadge/InfoBadge.svelte.d.ts +30 -0
- package/{src/lib/InfoBar → InfoBar}/InfoBar.scss +0 -0
- package/InfoBar/InfoBar.svelte +115 -0
- package/InfoBar/InfoBar.svelte.d.ts +43 -0
- package/{src/lib/ListItem → ListItem}/ListItem.scss +0 -0
- package/ListItem/ListItem.svelte +77 -0
- package/ListItem/ListItem.svelte.d.ts +34 -0
- package/{src/lib/MenuBar → MenuBar}/MenuBar.scss +0 -0
- package/MenuBar/MenuBar.svelte +43 -0
- package/MenuBar/MenuBar.svelte.d.ts +20 -0
- package/{src/lib/MenuBar → MenuBar}/MenuBarItem.scss +0 -0
- package/MenuBar/MenuBarItem.svelte +119 -0
- package/MenuBar/MenuBarItem.svelte.d.ts +29 -0
- package/MenuBar/flyoutState.d.ts +2 -0
- package/MenuBar/flyoutState.js +2 -0
- package/{src/lib/MenuFlyout → MenuFlyout}/MenuFlyoutDivider.scss +0 -0
- package/MenuFlyout/MenuFlyoutDivider.svelte +10 -0
- package/MenuFlyout/MenuFlyoutDivider.svelte.d.ts +18 -0
- package/{src/lib/MenuFlyout → MenuFlyout}/MenuFlyoutItem.scss +0 -0
- package/MenuFlyout/MenuFlyoutItem.svelte +213 -0
- package/MenuFlyout/MenuFlyoutItem.svelte.d.ts +43 -0
- package/{src/lib/MenuFlyout → MenuFlyout}/MenuFlyoutSurface.scss +0 -0
- package/MenuFlyout/MenuFlyoutSurface.svelte +23 -0
- package/MenuFlyout/MenuFlyoutSurface.svelte.d.ts +20 -0
- package/{src/lib/MenuFlyout → MenuFlyout}/MenuFlyoutWrapper.scss +0 -0
- package/MenuFlyout/MenuFlyoutWrapper.svelte +91 -0
- package/MenuFlyout/MenuFlyoutWrapper.svelte.d.ts +32 -0
- package/{src/lib/NavigationView → NavigationView}/NavigationView.scss +0 -0
- package/NavigationView/NavigationView.svelte +35 -0
- package/NavigationView/NavigationView.svelte.d.ts +26 -0
- package/{src/lib/NumberBox → NumberBox}/NumberBox.scss +0 -0
- package/{src/lib/NumberBox → NumberBox}/NumberBox.svelte +76 -102
- package/NumberBox/NumberBox.svelte.d.ts +56 -0
- package/{src/lib/PersonPicture → PersonPicture}/PersonPicture.scss +0 -0
- package/PersonPicture/PersonPicture.svelte +53 -0
- package/PersonPicture/PersonPicture.svelte.d.ts +25 -0
- package/{src/lib/ProgressBar → ProgressBar}/ProgressBar.scss +0 -0
- package/ProgressBar/ProgressBar.svelte +51 -0
- package/ProgressBar/ProgressBar.svelte.d.ts +22 -0
- package/{src/lib/ProgressRing → ProgressRing}/ProgressRing.scss +0 -0
- package/ProgressRing/ProgressRing.svelte +64 -0
- package/ProgressRing/ProgressRing.svelte.d.ts +31 -0
- package/{src/lib/RadioButton → RadioButton}/RadioButton.scss +0 -0
- package/RadioButton/RadioButton.svelte +56 -0
- package/RadioButton/RadioButton.svelte.d.ts +40 -0
- package/RangeSlider/RangeSlider.svelte +44 -0
- package/RangeSlider/RangeSlider.svelte.d.ts +33 -0
- package/ScrollView/ScrollView.svelte +3 -0
- package/ScrollView/ScrollView.svelte.d.ts +19 -0
- package/{src/lib/Slider → Slider}/Slider.scss +0 -0
- package/Slider/Slider.svelte +240 -0
- package/Slider/Slider.svelte.d.ts +57 -0
- package/{src/lib/TextBlock → TextBlock}/TextBlock.scss +0 -0
- package/TextBlock/TextBlock.svelte +55 -0
- package/TextBlock/TextBlock.svelte.d.ts +22 -0
- package/{src/lib/TextBox → TextBox}/TextBox.scss +0 -0
- package/{src/lib/TextBox → TextBox}/TextBox.svelte +74 -111
- package/TextBox/TextBox.svelte.d.ts +48 -0
- package/{src/lib/TextBox → TextBox}/TextBoxButton.scss +0 -0
- package/TextBox/TextBoxButton.svelte +20 -0
- package/TextBox/TextBoxButton.svelte.d.ts +21 -0
- package/{src/lib/ToggleSwitch → ToggleSwitch}/ToggleSwitch.scss +0 -0
- package/ToggleSwitch/ToggleSwitch.svelte +45 -0
- package/ToggleSwitch/ToggleSwitch.svelte.d.ts +31 -0
- package/{src/lib/Tooltip → Tooltip}/TooltipSurface.scss +0 -0
- package/Tooltip/TooltipSurface.svelte +21 -0
- package/Tooltip/TooltipSurface.svelte.d.ts +20 -0
- package/{src/lib/Tooltip → Tooltip}/TooltipWrapper.scss +0 -0
- package/Tooltip/TooltipWrapper.svelte +95 -0
- package/Tooltip/TooltipWrapper.svelte.d.ts +30 -0
- package/{src/lib/_mixins.scss → _mixins.scss} +0 -0
- package/{src/lib/index.ts → index.d.ts} +0 -0
- package/index.js +33 -0
- package/internal.d.ts +29 -0
- package/internal.js +167 -0
- package/package.json +156 -84
- package/{src/lib/svelte-jsx.d.ts → svelte-jsx.d.ts} +0 -0
- package/{src/lib/theme.css → theme.css} +0 -0
- package/.prettierignore +0 -1
- package/.prettierrc +0 -7
- package/src/app.html +0 -12
- package/src/global.d.ts +0 -1
- package/src/lib/AutoSuggestBox/AutoSuggestBox.svelte +0 -173
- package/src/lib/Button/Button.svelte +0 -48
- package/src/lib/CalendarView/CalendarView.svelte +0 -753
- package/src/lib/CalendarView/CalendarViewItem.svelte +0 -33
- package/src/lib/Checkbox/Checkbox.svelte +0 -81
- package/src/lib/ComboBox/ComboBox.svelte +0 -360
- package/src/lib/ComboBox/ComboBoxItem.svelte +0 -30
- package/src/lib/ContentDialog/ContentDialog.svelte +0 -123
- package/src/lib/ContextMenu/ContextMenu.svelte +0 -104
- package/src/lib/Expander/Expander.svelte +0 -123
- package/src/lib/Flyout/FlyoutSurface.svelte +0 -21
- package/src/lib/Flyout/FlyoutWrapper.svelte +0 -126
- package/src/lib/IconButton/IconButton.svelte +0 -49
- package/src/lib/InfoBar/InfoBar.svelte +0 -133
- package/src/lib/ListItem/ListItem.svelte +0 -88
- package/src/lib/MenuBar/MenuBar.svelte +0 -49
- package/src/lib/MenuBar/MenuBarItem.svelte +0 -135
- package/src/lib/MenuBar/flyoutState.ts +0 -5
- package/src/lib/MenuFlyout/MenuFlyoutDivider.svelte +0 -14
- package/src/lib/MenuFlyout/MenuFlyoutItem.svelte +0 -239
- package/src/lib/MenuFlyout/MenuFlyoutSurface.svelte +0 -28
- package/src/lib/MenuFlyout/MenuFlyoutWrapper.svelte +0 -114
- package/src/lib/NavigationView/NavigationView.svelte +0 -82
- package/src/lib/PersonPicture/PersonPicture.svelte +0 -62
- package/src/lib/ProgressBar/ProgressBar.svelte +0 -60
- package/src/lib/ProgressRing/ProgressRing.svelte +0 -73
- package/src/lib/RadioButton/RadioButton.svelte +0 -67
- package/src/lib/RangeSlider/RangeSlider.svelte +0 -91
- package/src/lib/ScrollView/ScrollView.svelte +0 -9
- package/src/lib/Slider/Slider.svelte +0 -268
- package/src/lib/TextBlock/TextBlock.svelte +0 -70
- package/src/lib/TextBox/TextBoxButton.svelte +0 -27
- package/src/lib/ToggleSwitch/ToggleSwitch.svelte +0 -55
- package/src/lib/Tooltip/TooltipSurface.svelte +0 -27
- package/src/lib/Tooltip/TooltipWrapper.svelte +0 -117
- package/src/lib/internal.ts +0 -213
- package/src/routes/__layout.svelte +0 -48
- package/src/routes/docs/__layout.svelte +0 -122
- package/src/routes/docs/components/button.md +0 -43
- package/src/routes/docs/components/calendarview.md +0 -188
- package/src/routes/docs/components/checkbox.md +0 -87
- package/src/routes/docs/components/contentdialog.md +0 -155
- package/src/routes/docs/components/expander.md +0 -115
- package/src/routes/docs/components/flyout.md +0 -107
- package/src/routes/docs/components/iconbutton.md +0 -39
- package/src/routes/docs/components/infobadge.md +0 -54
- package/src/routes/docs/components/infobar.md +0 -102
- package/src/routes/docs/components/listitem.md +0 -87
- package/src/routes/docs/components/personpicture.md +0 -125
- package/src/routes/docs/components/progressring.md +0 -83
- package/src/routes/docs/components/radiobutton.md +0 -88
- package/src/routes/docs/components/slider.md +0 -165
- package/src/routes/docs/components/textblock.md +0 -46
- package/src/routes/docs/components/textbox.md +0 -124
- package/src/routes/docs/components/toggleswitch.md +0 -73
- package/src/routes/docs/getting-started.md +0 -116
- package/src/routes/docs/index.md +0 -37
- package/src/routes/docs/internals/index.md +0 -0
- package/src/routes/index.svelte +0 -121
- package/src/routes/test/__layout-test.svelte +0 -1
- package/src/routes/test/index.svelte +0 -770
- package/src/routes/test/nav.svelte +0 -7
- package/src/site/data/docs.ts +0 -176
- package/src/site/data/home.ts +0 -12
- package/src/site/lib/APIDocs/APIDocs.svelte +0 -178
- package/src/site/lib/APIDocs/ParsedComponent.d.ts +0 -85
- package/src/site/lib/CopyBox/CopyBox.svelte +0 -23
- package/src/site/lib/Example/Example.scss +0 -33
- package/src/site/lib/Example/Example.svelte +0 -18
- package/src/site/lib/HeroCard/HeroCard.scss +0 -24
- package/src/site/lib/HeroCard/HeroCard.svelte +0 -36
- package/src/site/lib/Metadata/Metadata.svelte +0 -14
- package/src/site/lib/Navbar/Navbar.scss +0 -92
- package/src/site/lib/Navbar/Navbar.svelte +0 -47
- package/src/site/lib/PageSection/PageSection.scss +0 -57
- package/src/site/lib/PageSection/PageSection.svelte +0 -10
- package/src/site/lib/Showcase/Showcase.scss +0 -53
- package/src/site/lib/Showcase/Showcase.svelte +0 -67
- package/src/site/lib/Toc/Toc.scss +0 -18
- package/src/site/lib/Toc/Toc.svelte +0 -59
- package/src/site/lib/TreeView/TreeView.svelte +0 -89
- package/src/site/lib/index.ts +0 -9
- package/src/site/styles/_markdown.scss +0 -260
- package/src/site/styles/_mixins.scss +0 -319
- package/src/site/styles/global.scss +0 -40
- package/src/site/styles/pages/docs.scss +0 -74
- package/src/site/styles/pages/home.scss +0 -134
- package/static/bloom-mica-dark.png +0 -0
- package/static/bloom-mica-light.png +0 -0
- package/static/logo.svg +0 -11
- package/svelte.config.js +0 -57
- package/tsconfig.json +0 -38
|
File without changes
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<script >import { createEventDispatcher } from "svelte";
|
|
2
|
+
import { uid } from "../internal";
|
|
3
|
+
import TextBox from "../TextBox/TextBox.svelte";
|
|
4
|
+
import ListItem from "../ListItem/ListItem.svelte";
|
|
5
|
+
/** @extends {"../TextBox/TextBox.svelte"} */
|
|
6
|
+
/** The input's current value. */
|
|
7
|
+
export let value = "";
|
|
8
|
+
/** Array of strings that will be suggested to the user as options. */
|
|
9
|
+
export let items = [];
|
|
10
|
+
/** The current visibility state of the suggestion flyout. */
|
|
11
|
+
export let open = false;
|
|
12
|
+
/** Bindable index of the currently selected item. */
|
|
13
|
+
export let selection = 0;
|
|
14
|
+
/** Bindable array of currently suggested items. */
|
|
15
|
+
export let matches = [];
|
|
16
|
+
/** Specifies a custom class name for the component. */
|
|
17
|
+
let className = "";
|
|
18
|
+
export { className as class };
|
|
19
|
+
/** Obtains a bound DOM reference to the input element. */
|
|
20
|
+
export let inputElement = null;
|
|
21
|
+
/** Obtains a bound DOM reference to the AutoSuggestBox's container element. */
|
|
22
|
+
export let containerElement = null;
|
|
23
|
+
/** Obtains a bound DOM reference to the AutoSuggestBox's buttons container element. */
|
|
24
|
+
export let buttonsContainerElement = null;
|
|
25
|
+
/** Obtains a bound DOM reference to the AutoSuggestBox's clear button element. Only available if `clearButton` is set to true, `readonly` is set to false, and a `value` is present. */
|
|
26
|
+
export let clearButtonElement = null;
|
|
27
|
+
/** Obtains a bound DOM reference to the AutoSuggestBox's search button element. Only available if `type` is set to `search`. */
|
|
28
|
+
export let searchButtonElement = null;
|
|
29
|
+
export let flyoutElement = null;
|
|
30
|
+
let focused = false;
|
|
31
|
+
let typedValue = "";
|
|
32
|
+
const dispatch = createEventDispatcher();
|
|
33
|
+
const flyoutId = uid("fds-auto-suggest-flyout-");
|
|
34
|
+
$: matches = items.filter(item => item.toLowerCase().includes(typedValue.toLowerCase()));
|
|
35
|
+
$: selection, dispatchSelect();
|
|
36
|
+
function dispatchSelect() {
|
|
37
|
+
dispatch("select", {
|
|
38
|
+
item: items[selection],
|
|
39
|
+
index: selection
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function handleInput() {
|
|
43
|
+
typedValue = inputElement.value;
|
|
44
|
+
if (focused && value && items.length > 0)
|
|
45
|
+
open = true;
|
|
46
|
+
}
|
|
47
|
+
function handleKeyDown(event) {
|
|
48
|
+
const { key } = event;
|
|
49
|
+
if (open && matches.length > 0) {
|
|
50
|
+
if (key === "ArrowDown") {
|
|
51
|
+
selection++;
|
|
52
|
+
if (selection > matches.length - 1)
|
|
53
|
+
selection = 0;
|
|
54
|
+
}
|
|
55
|
+
else if (key === "ArrowUp") {
|
|
56
|
+
selection--;
|
|
57
|
+
if (selection < 0)
|
|
58
|
+
selection = matches.length - 1;
|
|
59
|
+
}
|
|
60
|
+
else if (key === "Enter" || key === "Escape") {
|
|
61
|
+
open = false;
|
|
62
|
+
}
|
|
63
|
+
if (key === "Enter" || key === "ArrowDown" || key === "ArrowUp") {
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
value = matches[selection];
|
|
66
|
+
flyoutElement === null || flyoutElement === void 0 ? void 0 : flyoutElement.children[selection].scrollIntoView({ block: "nearest" });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else if (!open && matches.length > 0 && (key === "ArrowDown" || key === "ArrowUp")) {
|
|
70
|
+
open = true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<TextBox
|
|
76
|
+
type="search"
|
|
77
|
+
class="auto-suggest-box {open && matches.length > 0 ? 'open' : ''} {className}"
|
|
78
|
+
aria-autocomplete="list"
|
|
79
|
+
aria-activedescendant={open && matches.length > 0
|
|
80
|
+
? `${flyoutId}-item-${items.indexOf(matches[selection])}`
|
|
81
|
+
: ""}
|
|
82
|
+
aria-expanded={open && matches.length > 0}
|
|
83
|
+
aria-controls={flyoutId}
|
|
84
|
+
on:search={() => {
|
|
85
|
+
if (open && matches.length > 0) value = matches[selection];
|
|
86
|
+
}}
|
|
87
|
+
on:search
|
|
88
|
+
on:input
|
|
89
|
+
on:input={handleInput}
|
|
90
|
+
on:outermousedown={() => (open = false)}
|
|
91
|
+
on:focus={() => (focused = true)}
|
|
92
|
+
on:focus
|
|
93
|
+
on:blur={() => (focused = false)}
|
|
94
|
+
on:blur
|
|
95
|
+
on:keydown={handleKeyDown}
|
|
96
|
+
on:keydown
|
|
97
|
+
on:change
|
|
98
|
+
on:beforeinput
|
|
99
|
+
on:click
|
|
100
|
+
on:dblclick
|
|
101
|
+
on:contextmenu
|
|
102
|
+
on:mousedown
|
|
103
|
+
on:mouseup
|
|
104
|
+
on:mouseover
|
|
105
|
+
on:mouseout
|
|
106
|
+
on:mouseenter
|
|
107
|
+
on:mouseleave
|
|
108
|
+
on:keypress
|
|
109
|
+
on:keyup
|
|
110
|
+
on:clear={() => {
|
|
111
|
+
typedValue = "";
|
|
112
|
+
if (items.length > 0) open = true;
|
|
113
|
+
}}
|
|
114
|
+
on:clear
|
|
115
|
+
bind:inputElement
|
|
116
|
+
bind:containerElement
|
|
117
|
+
bind:clearButtonElement
|
|
118
|
+
bind:searchButtonElement
|
|
119
|
+
bind:buttonsContainerElement
|
|
120
|
+
bind:value
|
|
121
|
+
{...$$restProps}
|
|
122
|
+
>
|
|
123
|
+
{#if open && matches.length > 0}
|
|
124
|
+
<ul id={flyoutId} role="listbox" class="auto-suggest-box-flyout" bind:this={flyoutElement}>
|
|
125
|
+
{#each matches as item, index (item)}
|
|
126
|
+
<div class="auto-suggest-item-wrapper">
|
|
127
|
+
<slot
|
|
128
|
+
name="item-template"
|
|
129
|
+
id="{flyoutId}-item-{index}"
|
|
130
|
+
{value}
|
|
131
|
+
{matches}
|
|
132
|
+
{selection}
|
|
133
|
+
{item}
|
|
134
|
+
{index}
|
|
135
|
+
>
|
|
136
|
+
<ListItem
|
|
137
|
+
tabindex={-1}
|
|
138
|
+
id="{flyoutId}-item-{index}"
|
|
139
|
+
role="option"
|
|
140
|
+
on:click={() => {
|
|
141
|
+
value = matches[selection];
|
|
142
|
+
selection = index;
|
|
143
|
+
open = false;
|
|
144
|
+
}}
|
|
145
|
+
selected={selection === index}>{item}</ListItem
|
|
146
|
+
>
|
|
147
|
+
</slot>
|
|
148
|
+
</div>
|
|
149
|
+
{/each}
|
|
150
|
+
</ul>
|
|
151
|
+
{/if}
|
|
152
|
+
|
|
153
|
+
<slot />
|
|
154
|
+
<slot name="buttons" slot="buttons" />
|
|
155
|
+
</TextBox>
|
|
156
|
+
|
|
157
|
+
<style >.auto-suggest-box-flyout{background-clip:padding-box;background-color:var(--fds-solid-background-quarternary);border:1px solid var(--fds-surface-stroke-flyout);border-end-end-radius:0;border-end-start-radius:0;border-radius:var(--fds-overlay-corner-radius);box-shadow:var(--fds-flyout-shadow);box-sizing:border-box;color:var(--fds-text-primary);inline-size:calc(100% + 2px);inset-block-start:calc(100% + 1px);inset-inline-start:-1px;margin:0;max-block-size:472px;overflow:auto;padding:0;padding-block:2px;position:absolute;z-index:100}.auto-suggest-item-wrapper{display:block}:global(.auto-suggest-box.open){background-color:var(--fds-control-fill-input-active)!important}:global(.auto-suggest-box.open) :global(.text-box-underline:after){border-bottom:2px solid var(--fds-accent-default);content:""}:global(.auto-suggest-box.open) :global(input::-moz-placeholder){color:var(--fds-text-tertiary)}:global(.auto-suggest-box.open) :global(input:-ms-input-placeholder){color:var(--fds-text-tertiary)}:global(.auto-suggest-box.open) :global(input::placeholder){color:var(--fds-text-tertiary)}:global(.auto-suggest-box.open) :global(.text-box-underline){border-bottom-left-radius:0;border-bottom-right-radius:0}</style>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
value?: any;
|
|
6
|
+
items?: string[];
|
|
7
|
+
open?: boolean;
|
|
8
|
+
selection?: number;
|
|
9
|
+
matches?: string[];
|
|
10
|
+
class?: string;
|
|
11
|
+
inputElement?: HTMLInputElement;
|
|
12
|
+
containerElement?: HTMLDivElement;
|
|
13
|
+
buttonsContainerElement?: HTMLDivElement;
|
|
14
|
+
clearButtonElement?: HTMLButtonElement;
|
|
15
|
+
searchButtonElement?: HTMLButtonElement;
|
|
16
|
+
flyoutElement?: HTMLUListElement;
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
search: CustomEvent<any>;
|
|
20
|
+
input: CustomEvent<any>;
|
|
21
|
+
focus: CustomEvent<any>;
|
|
22
|
+
blur: CustomEvent<any>;
|
|
23
|
+
keydown: CustomEvent<any>;
|
|
24
|
+
change: CustomEvent<any>;
|
|
25
|
+
beforeinput: CustomEvent<any>;
|
|
26
|
+
click: CustomEvent<any>;
|
|
27
|
+
dblclick: CustomEvent<any>;
|
|
28
|
+
contextmenu: CustomEvent<any>;
|
|
29
|
+
mousedown: CustomEvent<any>;
|
|
30
|
+
mouseup: CustomEvent<any>;
|
|
31
|
+
mouseover: CustomEvent<any>;
|
|
32
|
+
mouseout: CustomEvent<any>;
|
|
33
|
+
mouseenter: CustomEvent<any>;
|
|
34
|
+
mouseleave: CustomEvent<any>;
|
|
35
|
+
keypress: CustomEvent<any>;
|
|
36
|
+
keyup: CustomEvent<any>;
|
|
37
|
+
clear: CustomEvent<any>;
|
|
38
|
+
select: CustomEvent<any>;
|
|
39
|
+
} & {
|
|
40
|
+
[evt: string]: CustomEvent<any>;
|
|
41
|
+
};
|
|
42
|
+
slots: {
|
|
43
|
+
'item-template': {
|
|
44
|
+
id: string;
|
|
45
|
+
value: any;
|
|
46
|
+
matches: string[];
|
|
47
|
+
selection: number;
|
|
48
|
+
item: string;
|
|
49
|
+
index: any;
|
|
50
|
+
};
|
|
51
|
+
default: {};
|
|
52
|
+
buttons: {
|
|
53
|
+
slot: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export declare type AutoSuggestBoxProps = typeof __propDef.props;
|
|
58
|
+
export declare type AutoSuggestBoxEvents = typeof __propDef.events;
|
|
59
|
+
export declare type AutoSuggestBoxSlots = typeof __propDef.slots;
|
|
60
|
+
export default class AutoSuggestBox extends SvelteComponentTyped<AutoSuggestBoxProps, AutoSuggestBoxEvents, AutoSuggestBoxSlots> {
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script >import { get_current_component } from "svelte/internal";
|
|
2
|
+
import { createEventForwarder } from "../internal";
|
|
3
|
+
/** @restProps {button | a} */
|
|
4
|
+
/** Specifies the visual styling of the button. */
|
|
5
|
+
export let variant = "standard";
|
|
6
|
+
/** Sets an href value and converts the button element into an anchor/ */
|
|
7
|
+
export let href = "";
|
|
8
|
+
/** Controls whether the button is intended for user interaction, and styles it accordingly. */
|
|
9
|
+
export let disabled = false;
|
|
10
|
+
/** Specifies a custom class name for the button. */
|
|
11
|
+
let className = "";
|
|
12
|
+
export { className as class };
|
|
13
|
+
/** Obtains a bound DOM reference to the button or anchor element. */
|
|
14
|
+
export let element = null;
|
|
15
|
+
const forwardEvents = createEventForwarder(get_current_component());
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<!--
|
|
19
|
+
@component
|
|
20
|
+
A button gives the user a way to trigger an immediate action. Some buttons are specialized for particular tasks, such as navigation, repeated actions, or presenting menus. [Docs](https://fluent-svelte.vercel.app/docs/components/button)
|
|
21
|
+
- Usage:
|
|
22
|
+
```tsx
|
|
23
|
+
<Button>Click me!</Button>
|
|
24
|
+
```
|
|
25
|
+
-->
|
|
26
|
+
<svelte:element
|
|
27
|
+
this={href && !disabled ? "a" : "button"}
|
|
28
|
+
use:forwardEvents
|
|
29
|
+
bind:this={element}
|
|
30
|
+
role={href && !disabled ? "button" : undefined}
|
|
31
|
+
href={href && !disabled ? href : undefined}
|
|
32
|
+
class="button style-{variant} {className}"
|
|
33
|
+
class:disabled
|
|
34
|
+
{...$$restProps}
|
|
35
|
+
>
|
|
36
|
+
<slot />
|
|
37
|
+
</svelte:element>
|
|
38
|
+
|
|
39
|
+
<style >.button{align-items:center;border:none;border-radius:var(--fds-control-corner-radius);box-sizing:border-box;cursor:default;display:inline-flex;font-family:var(--fds-font-family-text);font-size:var(--fds-body-font-size);font-weight:400;justify-content:center;line-height:20px;outline:none;padding-block:4px 6px;padding-inline:11px;position:relative;text-decoration:none;transition:var(--fds-control-faster-duration) ease background;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.button:focus-visible{box-shadow:var(--fds-focus-stroke)}.button.style-standard{background-clip:padding-box;background-color:var(--fds-control-fill-default);border:1px solid;border-color:var(--fds-control-border-default);color:var(--fds-text-primary)}.button.style-standard:hover{background-color:var(--fds-control-fill-secondary)}.button.style-standard:active{background-color:var(--fds-control-fill-tertiary);border-color:var(--fds-control-stroke-default);color:var(--fds-text-secondary)}.button.style-standard.disabled{background-color:var(--fds-control-fill-disabled);border-color:var(--fds-control-stroke-default);color:var(--fds-text-disabled)}.button.style-accent{background-color:var(--fds-accent-default);border:1px solid var(--fds-control-stroke-on-accent-default);border-bottom-color:var(--fds-control-stroke-on-accent-secondary);color:var(--fds-text-on-accent-primary);transition:var(--fds-control-faster-duration) ease border-color}.button.style-accent:hover{background-color:var(--fds-accent-secondary)}.button.style-accent:active{background-color:var(--fds-accent-tertiary);border-color:transparent;color:var(--fds-text-on-accent-secondary)}.button.style-accent.disabled{background-color:var(--fds-accent-disabled);border-color:transparent;color:var(--fds-text-on-accent-disabled)}.button.style-hyperlink{background-color:var(--fds-subtle-fill-transparent);color:var(--fds-accent-text-primary);cursor:pointer}.button.style-hyperlink:hover{background-color:var(--fds-subtle-fill-secondary)}.button.style-hyperlink:active{background-color:var(--fds-subtle-fill-tertiary);color:var(--fds-accent-text-tertiary)}.button.style-hyperlink.disabled{color:var(--fds-accent-text-disabled)}.button.disabled{pointer-events:none}</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
variant?: "standard" | "accent" | "hyperlink";
|
|
6
|
+
href?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
class?: string;
|
|
9
|
+
element?: HTMLElement;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {
|
|
15
|
+
default: {};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare type ButtonProps = typeof __propDef.props;
|
|
19
|
+
export declare type ButtonEvents = typeof __propDef.events;
|
|
20
|
+
export declare type ButtonSlots = typeof __propDef.slots;
|
|
21
|
+
/**
|
|
22
|
+
* A button gives the user a way to trigger an immediate action. Some buttons are specialized for particular tasks, such as navigation, repeated actions, or presenting menus. [Docs](https://fluent-svelte.vercel.app/docs/components/button)
|
|
23
|
+
* - Usage:
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <Button>Click me!</Button>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export default class Button extends SvelteComponentTyped<ButtonProps, ButtonEvents, ButtonSlots> {
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
File without changes
|
|
@@ -1,42 +1,31 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
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
|
-
/** Distance of the flyout from the control button in pixels. */
|
|
31
|
-
export let offset = 4;
|
|
32
|
-
|
|
33
|
-
/** Determines if keyboard focus should be locked to the flyout's contents. */
|
|
34
|
-
export let trapFocus = true;
|
|
35
|
-
|
|
36
|
-
function handleKeyDown(event) {
|
|
37
|
-
event.stopPropagation();
|
|
38
|
-
if (event.key === "Escape") open = false;
|
|
39
|
-
}
|
|
1
|
+
<script >import CalendarView from "../CalendarView/CalendarView.svelte";
|
|
2
|
+
import Flyout from "../Flyout/FlyoutWrapper.svelte";
|
|
3
|
+
import Button from "../Button/Button.svelte";
|
|
4
|
+
/** The currently selected calendar date. */
|
|
5
|
+
export let value;
|
|
6
|
+
/** Determines the calendar's flyout's visibility. */
|
|
7
|
+
export let open = false;
|
|
8
|
+
/** Locale code used for specifying the language of the calendar. If unset, the locale will be automatically inferred from `navigator.language`. */
|
|
9
|
+
export let locale = undefined;
|
|
10
|
+
/** Placeholder text that will be displayed on the calendar's input field if no value is specified. This string is not localized and will be displayed in english if no property is set. */
|
|
11
|
+
export let placeholder = "Pick a date";
|
|
12
|
+
/** Controls whether the picker is intended for user interaction, and styles it accordingly. */
|
|
13
|
+
export let disabled = false;
|
|
14
|
+
/** Determines if the flyout can be closed using conventional user interaction. */
|
|
15
|
+
export let closable = true;
|
|
16
|
+
/** Direction that the flyout will be opened from. */
|
|
17
|
+
export let placement = "bottom";
|
|
18
|
+
/** Alignment of the menu along the clickable target's given axis. */
|
|
19
|
+
export let alignment = "center";
|
|
20
|
+
/** Distance of the flyout from the control button in pixels. */
|
|
21
|
+
export let offset = 4;
|
|
22
|
+
/** Determines if keyboard focus should be locked to the flyout's contents. */
|
|
23
|
+
export let trapFocus = true;
|
|
24
|
+
function handleKeyDown(event) {
|
|
25
|
+
event.stopPropagation();
|
|
26
|
+
if (event.key === "Escape")
|
|
27
|
+
open = false;
|
|
28
|
+
}
|
|
40
29
|
</script>
|
|
41
30
|
|
|
42
31
|
<Flyout
|
|
@@ -81,6 +70,4 @@
|
|
|
81
70
|
/>
|
|
82
71
|
</Flyout>
|
|
83
72
|
|
|
84
|
-
<style
|
|
85
|
-
@use "./CalendarDatePicker";
|
|
86
|
-
</style>
|
|
73
|
+
<style >.calendar-date-picker-label{-webkit-padding-end:2px;padding-inline-end:2px}.calendar-date-picker-label.placeholder:not(.disabled){color:var(--fds-text-secondary)}.calendar-date-picker-icon{fill:currentColor;-webkit-margin-start:8px;block-size:auto;color:currentColor;inline-size:12px;margin-inline-start:8px}</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
value: Date | null;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
locale?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
closable?: boolean;
|
|
11
|
+
placement?: "top" | "bottom" | "left" | "right";
|
|
12
|
+
alignment?: "start" | "center" | "end";
|
|
13
|
+
offset?: number;
|
|
14
|
+
trapFocus?: boolean;
|
|
15
|
+
};
|
|
16
|
+
events: {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
};
|
|
19
|
+
slots: {};
|
|
20
|
+
};
|
|
21
|
+
export declare type CalendarDatePickerProps = typeof __propDef.props;
|
|
22
|
+
export declare type CalendarDatePickerEvents = typeof __propDef.events;
|
|
23
|
+
export declare type CalendarDatePickerSlots = typeof __propDef.slots;
|
|
24
|
+
export default class CalendarDatePicker extends SvelteComponentTyped<CalendarDatePickerProps, CalendarDatePickerEvents, CalendarDatePickerSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
File without changes
|