@allxsmith/bestax-bulma 5.53.0 → 5.54.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/esm/components/Avatars.js +7 -2
- package/dist/esm/components/Avatars.js.map +1 -1
- package/dist/esm/components/Badge.js +7 -2
- package/dist/esm/components/Badge.js.map +1 -1
- package/dist/esm/components/Command.js +19 -9
- package/dist/esm/components/Command.js.map +1 -1
- package/dist/esm/components/Pagination.js +9 -1
- package/dist/esm/components/Pagination.js.map +1 -1
- package/dist/esm/components/Steps.js +5 -1
- package/dist/esm/components/Steps.js.map +1 -1
- package/dist/esm/elements/RingProgress.js +6 -1
- package/dist/esm/elements/RingProgress.js.map +1 -1
- package/dist/esm/form/Autocomplete.js +4 -0
- package/dist/esm/form/Autocomplete.js.map +1 -1
- package/dist/esm/form/Combobox.js +7 -2
- package/dist/esm/form/Combobox.js.map +1 -1
- package/dist/esm/form/File.js +4 -1
- package/dist/esm/form/File.js.map +1 -1
- package/dist/esm/form/Rate.js +9 -1
- package/dist/esm/form/Rate.js.map +1 -1
- package/dist/esm/form/Slider.js +7 -4
- package/dist/esm/form/Slider.js.map +1 -1
- package/dist/esm/form/Taginput.js +9 -3
- package/dist/esm/form/Taginput.js.map +1 -1
- package/dist/esm/helpers/LocaleProvider.js +9 -6
- package/dist/esm/helpers/LocaleProvider.js.map +1 -1
- package/dist/esm/helpers/localeFormat.js +108 -0
- package/dist/esm/helpers/localeFormat.js.map +1 -0
- package/dist/index.cjs +435 -276
- package/dist/index.cjs.map +1 -1
- package/dist/types/components/Avatars.d.ts +1 -1
- package/dist/types/components/Badge.d.ts +1 -1
- package/dist/types/components/Command.d.ts +4 -2
- package/dist/types/components/Pagination.d.ts +3 -0
- package/dist/types/components/Steps.d.ts +4 -1
- package/dist/types/elements/RingProgress.d.ts +3 -2
- package/dist/types/form/Autocomplete.d.ts +6 -1
- package/dist/types/form/Combobox.d.ts +3 -2
- package/dist/types/form/File.d.ts +2 -1
- package/dist/types/form/Rate.d.ts +4 -1
- package/dist/types/form/Slider.d.ts +9 -2
- package/dist/types/form/Taginput.d.ts +8 -2
- package/dist/types/helpers/LocaleProvider.d.ts +9 -6
- package/dist/types/helpers/localeFormat.d.ts +26 -0
- package/dist/types-cjs/components/Avatars.d.ts +1 -1
- package/dist/types-cjs/components/Badge.d.ts +1 -1
- package/dist/types-cjs/components/Command.d.ts +4 -2
- package/dist/types-cjs/components/Pagination.d.ts +3 -0
- package/dist/types-cjs/components/Steps.d.ts +4 -1
- package/dist/types-cjs/elements/RingProgress.d.ts +3 -2
- package/dist/types-cjs/form/Autocomplete.d.ts +6 -1
- package/dist/types-cjs/form/Combobox.d.ts +3 -2
- package/dist/types-cjs/form/File.d.ts +2 -1
- package/dist/types-cjs/form/Rate.d.ts +4 -1
- package/dist/types-cjs/form/Slider.d.ts +9 -2
- package/dist/types-cjs/form/Taginput.d.ts +8 -2
- package/dist/types-cjs/helpers/LocaleProvider.d.ts +9 -6
- package/dist/types-cjs/helpers/localeFormat.d.ts +26 -0
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ export interface AvatarsProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
19
19
|
spacing?: AvatarsSpacing | number;
|
|
20
20
|
/** Lay the avatars out side by side (non-overlapping), using `spacing` as the gap. */
|
|
21
21
|
spaced?: boolean;
|
|
22
|
-
/** Builds the surplus avatar's accessible name from the hidden count, for localization. Default: `` `${count} more` ``. */
|
|
22
|
+
/** Builds the surplus avatar's accessible name from the hidden count, for localization. Default: `` `${count} more` ``. Inside a `LocaleProvider` with a `locale`, the visible `+count` and the count in the default name are written the way that locale writes numbers. */
|
|
23
23
|
surplusLabel?: (count: number) => string;
|
|
24
24
|
/** `Avatar` elements to render inside the group. */
|
|
25
25
|
children?: React.ReactNode;
|
|
@@ -15,7 +15,7 @@ export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>,
|
|
|
15
15
|
className?: string;
|
|
16
16
|
/** Additional CSS classes applied to the badge pill itself (unprefixed, like `Tooltip`'s `tooltipClassName`). */
|
|
17
17
|
badgeClassName?: string;
|
|
18
|
-
/** Count, short text, or a custom node to display; omit with `dot` for a plain dot. `max`/`showZero` apply only to numeric content. */
|
|
18
|
+
/** Count, short text, or a custom node to display; omit with `dot` for a plain dot. `max`/`showZero` apply only to numeric content. A numeric count is written the way the `locale` of a `LocaleProvider` around it writes numbers. */
|
|
19
19
|
content?: React.ReactNode;
|
|
20
20
|
/** Numeric `content` above this renders as `"{max}+"`. A negative or non-integer value falls back to the default. */
|
|
21
21
|
max?: number;
|
|
@@ -74,8 +74,10 @@ export interface CommandActionsProps extends CommandBaseProps {
|
|
|
74
74
|
/**
|
|
75
75
|
* The actions, for a Command that renders the field, the list, the groups
|
|
76
76
|
* and the empty message itself. Typing filters them by label, keywords and
|
|
77
|
-
* description, ignoring case, with label matches first.
|
|
78
|
-
*
|
|
77
|
+
* description, ignoring case, with label matches first. Inside a
|
|
78
|
+
* `LocaleProvider` with a `locale`, it ignores accents too where that
|
|
79
|
+
* language does, so "cafe" finds "Café". Leave it out to build the
|
|
80
|
+
* Command from parts.
|
|
79
81
|
*/
|
|
80
82
|
actions: CommandAction[];
|
|
81
83
|
/**
|
|
@@ -61,6 +61,9 @@ export interface PaginationProps extends React.HTMLAttributes<HTMLElement>, Omit
|
|
|
61
61
|
/**
|
|
62
62
|
* The accessible name of a page's link, when rendering from `total`, since
|
|
63
63
|
* its content is only the number (`page => 'Page ' + page` by default).
|
|
64
|
+
* Inside a `LocaleProvider` with a `locale`, the number on the link, and
|
|
65
|
+
* in the default name, is written the way that locale writes numbers, so
|
|
66
|
+
* the name still holds the text on screen.
|
|
64
67
|
*/
|
|
65
68
|
getPageLabel?: (page: number) => string;
|
|
66
69
|
/** Additional CSS classes. */
|
|
@@ -105,7 +105,10 @@ export interface StepProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, '
|
|
|
105
105
|
clickable?: boolean;
|
|
106
106
|
/** Click handler */
|
|
107
107
|
onClick?: () => void;
|
|
108
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Step number to display in marker (1-indexed), written the way the
|
|
110
|
+
* `locale` of a `LocaleProvider` around it writes numbers.
|
|
111
|
+
*/
|
|
109
112
|
stepNumber?: number;
|
|
110
113
|
/**
|
|
111
114
|
* Icon shown when the step is completed.
|
|
@@ -35,8 +35,9 @@ export interface RingProgressProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
35
35
|
* Several values around one ring, in order clockwise from the top, each
|
|
36
36
|
* with its own color and label. The ring is then an image whose name
|
|
37
37
|
* writes them out, such as "Storage: Documents 40%, Photos 15%", since a
|
|
38
|
-
* screen reader can't take several values from one element.
|
|
39
|
-
* `
|
|
38
|
+
* screen reader can't take several values from one element. Inside a
|
|
39
|
+
* `LocaleProvider` with a `locale`, the shares are written as that locale
|
|
40
|
+
* writes a percentage. A total over `max` fills the ring and stops.
|
|
40
41
|
*/
|
|
41
42
|
sections?: RingProgressSection[];
|
|
42
43
|
/**
|
|
@@ -27,7 +27,12 @@ export interface AutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
27
27
|
};
|
|
28
28
|
/** Applied to the inner text input (the labellable control), not the wrapper div. */
|
|
29
29
|
id?: string;
|
|
30
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* The options data to display (required). The list shows the options that
|
|
32
|
+
* contain what's typed, ignoring case, and inside a `LocaleProvider` with a
|
|
33
|
+
* `locale`, ignoring accents too where that language does, so "cafe" finds
|
|
34
|
+
* "Café".
|
|
35
|
+
*/
|
|
31
36
|
data: AutocompleteItem[] | string[];
|
|
32
37
|
/** The current input value (controlled). */
|
|
33
38
|
value?: string;
|
|
@@ -174,8 +174,9 @@ export interface ComboboxSingleDataProps extends ComboboxDataBaseProps {
|
|
|
174
174
|
* The items, for a Combobox that renders the field, the menu, the list,
|
|
175
175
|
* the groups and the empty message itself. A string is an item whose label
|
|
176
176
|
* is its value, and an object is `{ value, label?, disabled?, group? }`.
|
|
177
|
-
* Typing filters the items by label, ignoring case, and
|
|
178
|
-
*
|
|
177
|
+
* Typing filters the items by label, ignoring case, and inside a
|
|
178
|
+
* `LocaleProvider` with a `locale`, ignoring accents too where that
|
|
179
|
+
* language does, so "cafe" finds "Café". The Combobox keeps the value. Leave it out to build the Combobox from parts.
|
|
179
180
|
*/
|
|
180
181
|
data: (string | ComboboxItemData)[];
|
|
181
182
|
/**
|
|
@@ -66,7 +66,8 @@ export interface FileProps extends Omit<React.InputHTMLAttributes<HTMLInputEleme
|
|
|
66
66
|
fileName?: string;
|
|
67
67
|
/**
|
|
68
68
|
* Builds the text `hasName` shows when several files are picked, from their count, for
|
|
69
|
-
* localization. Default: `` `${count} files`
|
|
69
|
+
* localization. Default: `` `${count} files` ``, with the count written the way the `locale`
|
|
70
|
+
* of a `LocaleProvider` around it writes numbers. A single pick shows its file's name.
|
|
70
71
|
*/
|
|
71
72
|
pickedFilesLabel?: (count: number) => string;
|
|
72
73
|
}
|
|
@@ -53,7 +53,10 @@ export interface RateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'o
|
|
|
53
53
|
size?: RateSize;
|
|
54
54
|
/** Whether the rating is disabled. */
|
|
55
55
|
disabled?: boolean;
|
|
56
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Show the numeric score next to stars, written the way the `locale` of a
|
|
58
|
+
* `LocaleProvider` around it writes numbers.
|
|
59
|
+
*/
|
|
57
60
|
showScore?: boolean;
|
|
58
61
|
/** Show custom text based on value. */
|
|
59
62
|
showText?: boolean;
|
|
@@ -52,11 +52,18 @@ interface SliderBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElemen
|
|
|
52
52
|
marks?: SliderMark[];
|
|
53
53
|
/** Orientation of the slider. */
|
|
54
54
|
orientation?: SliderOrientation;
|
|
55
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Function to scale the displayed value. With it, and no `getAriaValueText`,
|
|
57
|
+
* the scaled value is also the thumb's `aria-valuetext`.
|
|
58
|
+
*/
|
|
56
59
|
scale?: (value: number) => number;
|
|
57
60
|
/** Function to generate the `aria-valuetext` attribute. */
|
|
58
61
|
getAriaValueText?: (value: number) => string;
|
|
59
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Format function for output display. Without it, the output shows the
|
|
64
|
+
* value as it is, or inside a `LocaleProvider` with a `locale`, written
|
|
65
|
+
* the way that locale writes numbers, to at most three decimals.
|
|
66
|
+
*/
|
|
60
67
|
formatOutput?: (value: number) => string;
|
|
61
68
|
}
|
|
62
69
|
/**
|
|
@@ -42,7 +42,10 @@ export interface TaginputProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
42
42
|
* Autocomplete suggestions. With `data` set, even to an empty array, the
|
|
43
43
|
* text input is a `role="combobox"` that controls the suggestion list and
|
|
44
44
|
* points `aria-activedescendant` at the highlighted suggestion. Without it
|
|
45
|
-
* there's no list, so the input stays a plain text field.
|
|
45
|
+
* there's no list, so the input stays a plain text field. The list shows
|
|
46
|
+
* the suggestions that contain what's typed, ignoring case, and inside a
|
|
47
|
+
* `LocaleProvider` with a `locale`, ignoring accents too where that
|
|
48
|
+
* language does, so "cafe" finds "Café".
|
|
46
49
|
*/
|
|
47
50
|
data?: string[];
|
|
48
51
|
/** Placeholder text when no tags. */
|
|
@@ -81,7 +84,10 @@ export interface TaginputProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
81
84
|
rounded?: boolean;
|
|
82
85
|
/** Truncates long tag text with ellipsis. */
|
|
83
86
|
ellipsis?: boolean;
|
|
84
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Shows a counter of the number of tags, written the way the `locale` of
|
|
89
|
+
* a `LocaleProvider` around it writes numbers.
|
|
90
|
+
*/
|
|
85
91
|
hasCounter?: boolean;
|
|
86
92
|
/**
|
|
87
93
|
* Characters that split pasted text into tags. Each part goes through the
|
|
@@ -47,12 +47,15 @@ export interface LocaleProviderProps extends Omit<React.HTMLAttributes<HTMLDivEl
|
|
|
47
47
|
* Inside it, the date and time pickers take its `locale` unless given their
|
|
48
48
|
* own, and their week starts on the first day of the locale they use unless
|
|
49
49
|
* `firstDayOfWeek` is set, and a picker with a `locale` of its own is read
|
|
50
|
-
* like a nested provider.
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
50
|
+
* like a nested provider. With a `locale`, the numbers the library writes,
|
|
51
|
+
* such as page numbers and badge counts, follow it, and so does the
|
|
52
|
+
* filtering in `Combobox`, `Autocomplete`, `Taginput` and `Command`, which then ignores
|
|
53
|
+
* accents where the language treats letters as the same. The library's
|
|
54
|
+
* portaled content, such as a `Popover` panel, a `Modal` with `portal`, a
|
|
55
|
+
* `Toast` or a `Portal`'s children, keeps the same `dir` and `lang` though
|
|
56
|
+
* it renders outside the wrapper: in a container outside the wrapper, it
|
|
57
|
+
* sits in a `display: contents` element that carries them. Without a
|
|
58
|
+
* provider none of this changes.
|
|
56
59
|
*
|
|
57
60
|
* @function
|
|
58
61
|
* @param {LocaleProviderProps} props - Props for the LocaleProvider.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Formats a number for display, with `Intl.NumberFormat` options. */
|
|
2
|
+
export type NumberFormatter = (value: number, options?: Intl.NumberFormatOptions) => string;
|
|
3
|
+
/** Whether `text` contains `query`, as the locale compares letters. */
|
|
4
|
+
export type TextMatcher = (text: string, query: string) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* A formatter for numbers shown on screen, in the locale of the
|
|
7
|
+
* `LocaleProvider` around the component, or `null` outside one that gives a
|
|
8
|
+
* locale. Formatters are kept per set of options, since building one is the
|
|
9
|
+
* expensive part.
|
|
10
|
+
*
|
|
11
|
+
* @param own - The component's own locale, such as a picker's `locale`,
|
|
12
|
+
* which wins inside a provider.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useNumberFormat(own?: string): NumberFormatter | null;
|
|
15
|
+
/**
|
|
16
|
+
* A matcher for filtering a list by what was typed, in the locale of the
|
|
17
|
+
* `LocaleProvider` around the component, or `null` outside one that gives a
|
|
18
|
+
* locale. It compares with `Intl.Collator` at `usage: 'search'` and
|
|
19
|
+
* `sensitivity: 'base'`, so it ignores case and accents where the language
|
|
20
|
+
* treats the letters as the same: "cafe" finds "Café", while in Swedish "a"
|
|
21
|
+
* doesn't find "å", a letter of its own there. Marks the language ignores
|
|
22
|
+
* count for nothing on either side, so in Arabic محمد finds مُحَمَّد and the
|
|
23
|
+
* other way round. An empty query, or one of nothing but such marks,
|
|
24
|
+
* matches everything.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useLocaleMatcher(): TextMatcher | null;
|
|
@@ -19,7 +19,7 @@ export interface AvatarsProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
19
19
|
spacing?: AvatarsSpacing | number;
|
|
20
20
|
/** Lay the avatars out side by side (non-overlapping), using `spacing` as the gap. */
|
|
21
21
|
spaced?: boolean;
|
|
22
|
-
/** Builds the surplus avatar's accessible name from the hidden count, for localization. Default: `` `${count} more` ``. */
|
|
22
|
+
/** Builds the surplus avatar's accessible name from the hidden count, for localization. Default: `` `${count} more` ``. Inside a `LocaleProvider` with a `locale`, the visible `+count` and the count in the default name are written the way that locale writes numbers. */
|
|
23
23
|
surplusLabel?: (count: number) => string;
|
|
24
24
|
/** `Avatar` elements to render inside the group. */
|
|
25
25
|
children?: React.ReactNode;
|
|
@@ -15,7 +15,7 @@ export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>,
|
|
|
15
15
|
className?: string;
|
|
16
16
|
/** Additional CSS classes applied to the badge pill itself (unprefixed, like `Tooltip`'s `tooltipClassName`). */
|
|
17
17
|
badgeClassName?: string;
|
|
18
|
-
/** Count, short text, or a custom node to display; omit with `dot` for a plain dot. `max`/`showZero` apply only to numeric content. */
|
|
18
|
+
/** Count, short text, or a custom node to display; omit with `dot` for a plain dot. `max`/`showZero` apply only to numeric content. A numeric count is written the way the `locale` of a `LocaleProvider` around it writes numbers. */
|
|
19
19
|
content?: React.ReactNode;
|
|
20
20
|
/** Numeric `content` above this renders as `"{max}+"`. A negative or non-integer value falls back to the default. */
|
|
21
21
|
max?: number;
|
|
@@ -74,8 +74,10 @@ export interface CommandActionsProps extends CommandBaseProps {
|
|
|
74
74
|
/**
|
|
75
75
|
* The actions, for a Command that renders the field, the list, the groups
|
|
76
76
|
* and the empty message itself. Typing filters them by label, keywords and
|
|
77
|
-
* description, ignoring case, with label matches first.
|
|
78
|
-
*
|
|
77
|
+
* description, ignoring case, with label matches first. Inside a
|
|
78
|
+
* `LocaleProvider` with a `locale`, it ignores accents too where that
|
|
79
|
+
* language does, so "cafe" finds "Café". Leave it out to build the
|
|
80
|
+
* Command from parts.
|
|
79
81
|
*/
|
|
80
82
|
actions: CommandAction[];
|
|
81
83
|
/**
|
|
@@ -61,6 +61,9 @@ export interface PaginationProps extends React.HTMLAttributes<HTMLElement>, Omit
|
|
|
61
61
|
/**
|
|
62
62
|
* The accessible name of a page's link, when rendering from `total`, since
|
|
63
63
|
* its content is only the number (`page => 'Page ' + page` by default).
|
|
64
|
+
* Inside a `LocaleProvider` with a `locale`, the number on the link, and
|
|
65
|
+
* in the default name, is written the way that locale writes numbers, so
|
|
66
|
+
* the name still holds the text on screen.
|
|
64
67
|
*/
|
|
65
68
|
getPageLabel?: (page: number) => string;
|
|
66
69
|
/** Additional CSS classes. */
|
|
@@ -105,7 +105,10 @@ export interface StepProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, '
|
|
|
105
105
|
clickable?: boolean;
|
|
106
106
|
/** Click handler */
|
|
107
107
|
onClick?: () => void;
|
|
108
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Step number to display in marker (1-indexed), written the way the
|
|
110
|
+
* `locale` of a `LocaleProvider` around it writes numbers.
|
|
111
|
+
*/
|
|
109
112
|
stepNumber?: number;
|
|
110
113
|
/**
|
|
111
114
|
* Icon shown when the step is completed.
|
|
@@ -35,8 +35,9 @@ export interface RingProgressProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
35
35
|
* Several values around one ring, in order clockwise from the top, each
|
|
36
36
|
* with its own color and label. The ring is then an image whose name
|
|
37
37
|
* writes them out, such as "Storage: Documents 40%, Photos 15%", since a
|
|
38
|
-
* screen reader can't take several values from one element.
|
|
39
|
-
* `
|
|
38
|
+
* screen reader can't take several values from one element. Inside a
|
|
39
|
+
* `LocaleProvider` with a `locale`, the shares are written as that locale
|
|
40
|
+
* writes a percentage. A total over `max` fills the ring and stops.
|
|
40
41
|
*/
|
|
41
42
|
sections?: RingProgressSection[];
|
|
42
43
|
/**
|
|
@@ -27,7 +27,12 @@ export interface AutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
27
27
|
};
|
|
28
28
|
/** Applied to the inner text input (the labellable control), not the wrapper div. */
|
|
29
29
|
id?: string;
|
|
30
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* The options data to display (required). The list shows the options that
|
|
32
|
+
* contain what's typed, ignoring case, and inside a `LocaleProvider` with a
|
|
33
|
+
* `locale`, ignoring accents too where that language does, so "cafe" finds
|
|
34
|
+
* "Café".
|
|
35
|
+
*/
|
|
31
36
|
data: AutocompleteItem[] | string[];
|
|
32
37
|
/** The current input value (controlled). */
|
|
33
38
|
value?: string;
|
|
@@ -174,8 +174,9 @@ export interface ComboboxSingleDataProps extends ComboboxDataBaseProps {
|
|
|
174
174
|
* The items, for a Combobox that renders the field, the menu, the list,
|
|
175
175
|
* the groups and the empty message itself. A string is an item whose label
|
|
176
176
|
* is its value, and an object is `{ value, label?, disabled?, group? }`.
|
|
177
|
-
* Typing filters the items by label, ignoring case, and
|
|
178
|
-
*
|
|
177
|
+
* Typing filters the items by label, ignoring case, and inside a
|
|
178
|
+
* `LocaleProvider` with a `locale`, ignoring accents too where that
|
|
179
|
+
* language does, so "cafe" finds "Café". The Combobox keeps the value. Leave it out to build the Combobox from parts.
|
|
179
180
|
*/
|
|
180
181
|
data: (string | ComboboxItemData)[];
|
|
181
182
|
/**
|
|
@@ -66,7 +66,8 @@ export interface FileProps extends Omit<React.InputHTMLAttributes<HTMLInputEleme
|
|
|
66
66
|
fileName?: string;
|
|
67
67
|
/**
|
|
68
68
|
* Builds the text `hasName` shows when several files are picked, from their count, for
|
|
69
|
-
* localization. Default: `` `${count} files`
|
|
69
|
+
* localization. Default: `` `${count} files` ``, with the count written the way the `locale`
|
|
70
|
+
* of a `LocaleProvider` around it writes numbers. A single pick shows its file's name.
|
|
70
71
|
*/
|
|
71
72
|
pickedFilesLabel?: (count: number) => string;
|
|
72
73
|
}
|
|
@@ -53,7 +53,10 @@ export interface RateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'o
|
|
|
53
53
|
size?: RateSize;
|
|
54
54
|
/** Whether the rating is disabled. */
|
|
55
55
|
disabled?: boolean;
|
|
56
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Show the numeric score next to stars, written the way the `locale` of a
|
|
58
|
+
* `LocaleProvider` around it writes numbers.
|
|
59
|
+
*/
|
|
57
60
|
showScore?: boolean;
|
|
58
61
|
/** Show custom text based on value. */
|
|
59
62
|
showText?: boolean;
|
|
@@ -52,11 +52,18 @@ interface SliderBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElemen
|
|
|
52
52
|
marks?: SliderMark[];
|
|
53
53
|
/** Orientation of the slider. */
|
|
54
54
|
orientation?: SliderOrientation;
|
|
55
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Function to scale the displayed value. With it, and no `getAriaValueText`,
|
|
57
|
+
* the scaled value is also the thumb's `aria-valuetext`.
|
|
58
|
+
*/
|
|
56
59
|
scale?: (value: number) => number;
|
|
57
60
|
/** Function to generate the `aria-valuetext` attribute. */
|
|
58
61
|
getAriaValueText?: (value: number) => string;
|
|
59
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Format function for output display. Without it, the output shows the
|
|
64
|
+
* value as it is, or inside a `LocaleProvider` with a `locale`, written
|
|
65
|
+
* the way that locale writes numbers, to at most three decimals.
|
|
66
|
+
*/
|
|
60
67
|
formatOutput?: (value: number) => string;
|
|
61
68
|
}
|
|
62
69
|
/**
|
|
@@ -42,7 +42,10 @@ export interface TaginputProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
42
42
|
* Autocomplete suggestions. With `data` set, even to an empty array, the
|
|
43
43
|
* text input is a `role="combobox"` that controls the suggestion list and
|
|
44
44
|
* points `aria-activedescendant` at the highlighted suggestion. Without it
|
|
45
|
-
* there's no list, so the input stays a plain text field.
|
|
45
|
+
* there's no list, so the input stays a plain text field. The list shows
|
|
46
|
+
* the suggestions that contain what's typed, ignoring case, and inside a
|
|
47
|
+
* `LocaleProvider` with a `locale`, ignoring accents too where that
|
|
48
|
+
* language does, so "cafe" finds "Café".
|
|
46
49
|
*/
|
|
47
50
|
data?: string[];
|
|
48
51
|
/** Placeholder text when no tags. */
|
|
@@ -81,7 +84,10 @@ export interface TaginputProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
81
84
|
rounded?: boolean;
|
|
82
85
|
/** Truncates long tag text with ellipsis. */
|
|
83
86
|
ellipsis?: boolean;
|
|
84
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Shows a counter of the number of tags, written the way the `locale` of
|
|
89
|
+
* a `LocaleProvider` around it writes numbers.
|
|
90
|
+
*/
|
|
85
91
|
hasCounter?: boolean;
|
|
86
92
|
/**
|
|
87
93
|
* Characters that split pasted text into tags. Each part goes through the
|
|
@@ -47,12 +47,15 @@ export interface LocaleProviderProps extends Omit<React.HTMLAttributes<HTMLDivEl
|
|
|
47
47
|
* Inside it, the date and time pickers take its `locale` unless given their
|
|
48
48
|
* own, and their week starts on the first day of the locale they use unless
|
|
49
49
|
* `firstDayOfWeek` is set, and a picker with a `locale` of its own is read
|
|
50
|
-
* like a nested provider.
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
50
|
+
* like a nested provider. With a `locale`, the numbers the library writes,
|
|
51
|
+
* such as page numbers and badge counts, follow it, and so does the
|
|
52
|
+
* filtering in `Combobox`, `Autocomplete`, `Taginput` and `Command`, which then ignores
|
|
53
|
+
* accents where the language treats letters as the same. The library's
|
|
54
|
+
* portaled content, such as a `Popover` panel, a `Modal` with `portal`, a
|
|
55
|
+
* `Toast` or a `Portal`'s children, keeps the same `dir` and `lang` though
|
|
56
|
+
* it renders outside the wrapper: in a container outside the wrapper, it
|
|
57
|
+
* sits in a `display: contents` element that carries them. Without a
|
|
58
|
+
* provider none of this changes.
|
|
56
59
|
*
|
|
57
60
|
* @function
|
|
58
61
|
* @param {LocaleProviderProps} props - Props for the LocaleProvider.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Formats a number for display, with `Intl.NumberFormat` options. */
|
|
2
|
+
export type NumberFormatter = (value: number, options?: Intl.NumberFormatOptions) => string;
|
|
3
|
+
/** Whether `text` contains `query`, as the locale compares letters. */
|
|
4
|
+
export type TextMatcher = (text: string, query: string) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* A formatter for numbers shown on screen, in the locale of the
|
|
7
|
+
* `LocaleProvider` around the component, or `null` outside one that gives a
|
|
8
|
+
* locale. Formatters are kept per set of options, since building one is the
|
|
9
|
+
* expensive part.
|
|
10
|
+
*
|
|
11
|
+
* @param own - The component's own locale, such as a picker's `locale`,
|
|
12
|
+
* which wins inside a provider.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useNumberFormat(own?: string): NumberFormatter | null;
|
|
15
|
+
/**
|
|
16
|
+
* A matcher for filtering a list by what was typed, in the locale of the
|
|
17
|
+
* `LocaleProvider` around the component, or `null` outside one that gives a
|
|
18
|
+
* locale. It compares with `Intl.Collator` at `usage: 'search'` and
|
|
19
|
+
* `sensitivity: 'base'`, so it ignores case and accents where the language
|
|
20
|
+
* treats the letters as the same: "cafe" finds "Café", while in Swedish "a"
|
|
21
|
+
* doesn't find "å", a letter of its own there. Marks the language ignores
|
|
22
|
+
* count for nothing on either side, so in Arabic محمد finds مُحَمَّد and the
|
|
23
|
+
* other way round. An empty query, or one of nothing but such marks,
|
|
24
|
+
* matches everything.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useLocaleMatcher(): TextMatcher | null;
|