fluentui-svelte 0.5.0 → 0.6.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/dialog/dialog-actions.svelte +17 -2
- package/dist/components/dialog/dialog-content.svelte +2 -2
- package/dist/components/dialog/dialog-content.svelte.d.ts +1 -1
- package/dist/components/dialog/dialog-surface.svelte +32 -3
- package/dist/components/dialog/dialog-title.svelte +23 -6
- package/dist/components/dialog/dialog-trigger.svelte +8 -2
- package/dist/components/dialog/dialog-trigger.svelte.d.ts +1 -1
- package/dist/components/dialog/docs/llms.md +2 -2
- package/dist/components/dialog/types.d.ts +6 -2
- package/dist/components/dialog/utils.d.ts +2 -0
- package/dist/components/dialog/utils.js +1 -0
- package/dist/components/rating/docs/llms.md +110 -0
- package/dist/components/rating/rating.svelte +210 -0
- package/dist/components/rating/rating.svelte.d.ts +19 -0
- package/dist/components/rating/types.d.ts +44 -0
- package/dist/components/rating/types.js +1 -0
- package/dist/components/tag/docs/llms.md +383 -0
- package/dist/components/tag/tag-group.d.ts +2 -0
- package/dist/components/tag/tag-group.js +2 -0
- package/dist/components/tag/tag-group.svelte +117 -0
- package/dist/components/tag/tag-group.svelte.d.ts +20 -0
- package/dist/components/tag/tag.svelte +458 -0
- package/dist/components/tag/tag.svelte.d.ts +19 -0
- package/dist/components/tag/types.d.ts +135 -0
- package/dist/components/tag/types.js +1 -0
- package/dist/components/tag-picker/docs/llms.md +292 -0
- package/dist/components/tag-picker/option-group.svelte +38 -0
- package/dist/components/tag-picker/option-group.svelte.d.ts +4 -0
- package/dist/components/tag-picker/option.svelte +71 -0
- package/dist/components/tag-picker/option.svelte.d.ts +4 -0
- package/dist/components/tag-picker/tag-picker.d.ts +2 -0
- package/dist/components/tag-picker/tag-picker.js +2 -0
- package/dist/components/tag-picker/tag-picker.svelte +644 -0
- package/dist/components/tag-picker/tag-picker.svelte.d.ts +21 -0
- package/dist/components/tag-picker/types.d.ts +122 -0
- package/dist/components/tag-picker/types.js +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +12 -0
- package/dist/internal/constants.d.ts +0 -4
- package/dist/internal/constants.js +0 -4002
- package/package.json +2 -2
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { Component, Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes, HTMLInputAttributes, SVGAttributes } from 'svelte/elements';
|
|
3
|
+
import type { FSContext } from '../../internal/index.js';
|
|
4
|
+
import type { ListViewItemProps } from '../list-view/types.ts';
|
|
5
|
+
import type { TagGroupProps } from '../tag/types.ts';
|
|
6
|
+
export type TagPickerSizes = 'medium' | 'large' | 'extra-large';
|
|
7
|
+
/** @propsmith TagPickerProps */
|
|
8
|
+
export type TagPickerProps = {
|
|
9
|
+
/** The DOM reference of the wrapper element.
|
|
10
|
+
* @bindable
|
|
11
|
+
*/
|
|
12
|
+
ref?: HTMLDivElement;
|
|
13
|
+
/** The DOM reference of the input element.
|
|
14
|
+
* @bindable
|
|
15
|
+
*/
|
|
16
|
+
inputRef?: HTMLInputElement;
|
|
17
|
+
/** The values of the chosen options, shown as tags in the control. A value no option has is shown as it is.
|
|
18
|
+
* @default []
|
|
19
|
+
* @bindable
|
|
20
|
+
*/
|
|
21
|
+
selectedOptions?: string[];
|
|
22
|
+
/** The text typed in the input. It filters the options, and is cleared when one is chosen.
|
|
23
|
+
* @default ''
|
|
24
|
+
* @bindable
|
|
25
|
+
*/
|
|
26
|
+
value?: string;
|
|
27
|
+
/** Controls the open state of the option list.
|
|
28
|
+
* @default false
|
|
29
|
+
* @bindable
|
|
30
|
+
*/
|
|
31
|
+
open?: boolean;
|
|
32
|
+
/** Limits the picker to one tag: choosing an option replaces the current one and closes the list. */
|
|
33
|
+
single?: boolean;
|
|
34
|
+
/** Disables the user interaction: the input, the tags and the list. */
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/** The size of the control. It also picks the size of the tags.
|
|
37
|
+
* @default 'medium'
|
|
38
|
+
*/
|
|
39
|
+
size?: TagPickerSizes;
|
|
40
|
+
/** The placeholder text of the input. */
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
/** The message shown in place of the list when there is no option left to choose.
|
|
43
|
+
* @default 'No options available'
|
|
44
|
+
*/
|
|
45
|
+
notFoundText?: string;
|
|
46
|
+
/** The dropdown arrow. Pass `null` to remove it.
|
|
47
|
+
* @default ChevronDownRegular
|
|
48
|
+
* @type Snippet | Component | null
|
|
49
|
+
*/
|
|
50
|
+
expandIcon?: Snippet<[SVGAttributes<SVGElement>]> | Component<SVGAttributes<SVGElement>> | null;
|
|
51
|
+
/** A button-like element rendered at the end of the control, before the dropdown arrow. */
|
|
52
|
+
secondaryAction?: Snippet;
|
|
53
|
+
/** Renders the tag of a chosen option, to give it media or custom text. Falls back to a plain tag.
|
|
54
|
+
* Render a `Tag` with the given `value`, and `role="listitem"`.
|
|
55
|
+
* @type Snippet<[{ value: string; text: string }]>
|
|
56
|
+
*/
|
|
57
|
+
tag?: Snippet<[{
|
|
58
|
+
value: string;
|
|
59
|
+
text: string;
|
|
60
|
+
}]>;
|
|
61
|
+
/** The props to spread on the group holding the tags. This is where its `aria-label` goes.
|
|
62
|
+
* @type TagGroupProps
|
|
63
|
+
*/
|
|
64
|
+
tagGroupProps?: Omit<TagGroupProps, 'children' | 'size' | 'appearance' | 'disabled' | 'dismissible' | 'selectedValues' | 'onTagSelect' | 'onDismiss'>;
|
|
65
|
+
/** The props to spread on the input. This is where its accessible name (`aria-label`) and
|
|
66
|
+
* `readonly` (to turn the input into a plain trigger) go.
|
|
67
|
+
* @type HTMLInputAttributes
|
|
68
|
+
*/
|
|
69
|
+
inputProps?: Omit<HTMLInputAttributes, 'value' | 'type' | 'role' | 'disabled' | 'oninput' | 'onkeydown'>;
|
|
70
|
+
/** Called when an option is chosen, or a tag is removed. */
|
|
71
|
+
onSelectionChange?: (e: Event, selectedOptions: string[]) => void;
|
|
72
|
+
/** Called when Enter is pressed with text in the input and no option under the cursor. This is
|
|
73
|
+
* where a free-form tag is added.
|
|
74
|
+
*/
|
|
75
|
+
querySubmitted?: (e: KeyboardEvent, query: string) => void;
|
|
76
|
+
/** The options. Leave it out to get a picker without a list. */
|
|
77
|
+
children?: Snippet;
|
|
78
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
79
|
+
export type OptionType = {
|
|
80
|
+
id: string;
|
|
81
|
+
value: string;
|
|
82
|
+
disabled?: boolean;
|
|
83
|
+
};
|
|
84
|
+
export type TagPickerContext = FSContext<null, {
|
|
85
|
+
readonly query: string;
|
|
86
|
+
readonly selectedOptions: string[];
|
|
87
|
+
readonly open: boolean;
|
|
88
|
+
}, null, {
|
|
89
|
+
/** Remembers what the tag of `value` says. Every option calls it, on screen or not. */
|
|
90
|
+
setLabel: (value: string, text: string) => void;
|
|
91
|
+
setOption: (option: OptionType) => void;
|
|
92
|
+
deleteOption: (id: string) => void;
|
|
93
|
+
chooseOption: (e: Event, id: string) => void;
|
|
94
|
+
}>;
|
|
95
|
+
/** @propsmith TagPickerOptionProps */
|
|
96
|
+
export type TagPickerOptionProps = {
|
|
97
|
+
/** The value added to `selectedOptions` when the option is chosen. */
|
|
98
|
+
value: string;
|
|
99
|
+
/** The text the option is filtered by, and the text of its tag. Falls back to `value`. */
|
|
100
|
+
text?: string;
|
|
101
|
+
/** The id of the option element, referenced by the input through `aria-activedescendant`.
|
|
102
|
+
* Falls back to a generated id.
|
|
103
|
+
*/
|
|
104
|
+
id?: string;
|
|
105
|
+
/** The DOM reference of the option element.
|
|
106
|
+
* @bindable
|
|
107
|
+
*/
|
|
108
|
+
ref?: HTMLLIElement;
|
|
109
|
+
/** Takes the option out of reach: it is shown, but the cursor steps over it. */
|
|
110
|
+
disabled?: boolean;
|
|
111
|
+
} & Omit<ListViewItemProps<'li'>, 'as' | 'value' | 'onAction' | 'checkmark'>;
|
|
112
|
+
/** @propsmith TagPickerOptionGroupProps */
|
|
113
|
+
export type TagPickerOptionGroupProps = {
|
|
114
|
+
/** The label of the group. */
|
|
115
|
+
label: string;
|
|
116
|
+
/** The DOM reference of the group element.
|
|
117
|
+
* @bindable
|
|
118
|
+
*/
|
|
119
|
+
ref?: HTMLUListElement;
|
|
120
|
+
/** The options of the group. */
|
|
121
|
+
children?: Snippet;
|
|
122
|
+
} & Omit<HTMLAttributes<HTMLUListElement>, 'children'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,8 @@ export { default as Persona } from './components/persona/persona.svelte';
|
|
|
57
57
|
export { default as ProgressBar } from './components/progress-bar/progress-bar.svelte';
|
|
58
58
|
export { default as ProgressRing } from './components/progress-ring/progress-ring.svelte';
|
|
59
59
|
export { default as RadioButton } from './components/radio-button/radio-button.svelte';
|
|
60
|
+
export { default as Rating } from './components/rating/rating.svelte';
|
|
61
|
+
export type { RatingProps } from './components/rating/types.js';
|
|
60
62
|
export { default as Skeleton } from './components/skeleton/skeleton.svelte';
|
|
61
63
|
export { default as Slider } from './components/slider/slider.svelte';
|
|
62
64
|
export { default as Table } from './components/table/table.svelte';
|
|
@@ -70,6 +72,11 @@ export { default as TableCellLayout } from './components/table/table-cell-layout
|
|
|
70
72
|
export { default as TableCellActions } from './components/table/table-cell-actions.svelte';
|
|
71
73
|
export { default as TabView } from './components/tab-view/tab-view.svelte';
|
|
72
74
|
export { default as TabViewTab } from './components/tab-view/tab-view-tab.svelte';
|
|
75
|
+
export { default as Tag } from './components/tag/tag.svelte';
|
|
76
|
+
export { default as TagGroup } from './components/tag/tag-group.svelte';
|
|
77
|
+
export { default as TagPicker } from './components/tag-picker/tag-picker.svelte';
|
|
78
|
+
export { default as TagPickerOption } from './components/tag-picker/option.svelte';
|
|
79
|
+
export { default as TagPickerOptionGroup } from './components/tag-picker/option-group.svelte';
|
|
73
80
|
export { default as TextArea } from './components/textarea/textarea.svelte';
|
|
74
81
|
export { default as TextBox } from './components/text-box/text-box.svelte';
|
|
75
82
|
export { default as TextBoxButton } from './components/text-box/text-box-button.svelte';
|
package/dist/index.js
CHANGED
|
@@ -109,6 +109,9 @@ export { default as ProgressRing } from './components/progress-ring/progress-rin
|
|
|
109
109
|
// Start RadioButton Component
|
|
110
110
|
export { default as RadioButton } from './components/radio-button/radio-button.svelte';
|
|
111
111
|
// End RadioButton Component
|
|
112
|
+
// Start Rating Component
|
|
113
|
+
export { default as Rating } from './components/rating/rating.svelte';
|
|
114
|
+
// End Rating Component
|
|
112
115
|
// Start Skeleton Component
|
|
113
116
|
export { default as Skeleton } from './components/skeleton/skeleton.svelte';
|
|
114
117
|
// End Skeleton Component
|
|
@@ -130,6 +133,15 @@ export { default as TableCellActions } from './components/table/table-cell-actio
|
|
|
130
133
|
export { default as TabView } from './components/tab-view/tab-view.svelte';
|
|
131
134
|
export { default as TabViewTab } from './components/tab-view/tab-view-tab.svelte';
|
|
132
135
|
// End TabView Component
|
|
136
|
+
// Start Tag Component
|
|
137
|
+
export { default as Tag } from './components/tag/tag.svelte';
|
|
138
|
+
export { default as TagGroup } from './components/tag/tag-group.svelte';
|
|
139
|
+
// End Tag Component
|
|
140
|
+
// Start TagPicker Component
|
|
141
|
+
export { default as TagPicker } from './components/tag-picker/tag-picker.svelte';
|
|
142
|
+
export { default as TagPickerOption } from './components/tag-picker/option.svelte';
|
|
143
|
+
export { default as TagPickerOptionGroup } from './components/tag-picker/option-group.svelte';
|
|
144
|
+
// End TagPicker Component
|
|
133
145
|
// Start TextArea Component
|
|
134
146
|
export { default as TextArea } from './components/textarea/textarea.svelte';
|
|
135
147
|
// End TextArea Component
|