@mittwald/flow-react-components 0.2.0-alpha.422 → 0.2.0-alpha.423
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/CHANGELOG.md +4 -0
- package/dist/assets/doc-properties.json +394 -394
- package/dist/css/all.css +1 -1
- package/dist/js/_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs +4 -0
- package/dist/js/_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs.map +1 -1
- package/dist/js/components/src/components/Action/lib/ariaLive.mjs +4 -10
- package/dist/js/components/src/components/Action/lib/ariaLive.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Header/components/SearchField/SearchField.mjs +3 -1
- package/dist/js/components/src/components/List/components/Header/components/SearchField/SearchField.mjs.map +1 -1
- package/dist/js/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs +129 -0
- package/dist/js/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs.map +1 -0
- package/dist/types/components/Action/lib/ariaLive.d.ts.map +1 -1
- package/dist/types/components/List/components/Header/components/SearchField/SearchField.d.ts.map +1 -1
- package/dist/types/components/List/hooks/useAriaAnnounceSearchState.d.ts +2 -0
- package/dist/types/components/List/hooks/useAriaAnnounceSearchState.d.ts.map +1 -0
- package/package.json +5 -5
|
@@ -8,6 +8,8 @@ const locales = {"de-DE": { "list.filters": `Filter`,
|
|
|
8
8
|
"list.noResult.text": `Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.`,
|
|
9
9
|
"list.options": `Optionen`,
|
|
10
10
|
"list.paginationInfo": (args) => `${args.visibleItemsCount} von insgesamt ${args.totalItemsCount} angezeigt`,
|
|
11
|
+
"list.search.announce.noResult": (args) => `Keine Treffer für "${args.searchTerm}"`,
|
|
12
|
+
"list.search.announce.result": (args) => `${args.resultCount} Treffer für "${args.searchTerm}"`,
|
|
11
13
|
"list.settings": `Einstellungen`,
|
|
12
14
|
"list.settings.viewMode": `Ansicht`,
|
|
13
15
|
"list.settings.viewMode.list": `Liste`,
|
|
@@ -25,6 +27,8 @@ const locales = {"de-DE": { "list.filters": `Filter`,
|
|
|
25
27
|
"list.noResult.text": `Your search did not return any results. Please adjust the search query or your filters.`,
|
|
26
28
|
"list.options": `Options`,
|
|
27
29
|
"list.paginationInfo": (args) => `Showing ${args.visibleItemsCount} of ${args.totalItemsCount}`,
|
|
30
|
+
"list.search.announce.noResult": (args) => `${args.resultCount} matches for "${args.searchTerm}"`,
|
|
31
|
+
"list.search.announce.result": (args) => `No matches for "${args.searchTerm}"`,
|
|
28
32
|
"list.settings": `Settings`,
|
|
29
33
|
"list.settings.viewMode": `View`,
|
|
30
34
|
"list.settings.viewMode.list": `List`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useLocalizedStringFormatter } from 'react-aria';
|
|
4
4
|
import locales from '../../../../../_virtual/_.locale.json@8b26c19d587a90f821a2307c8122f6d1.mjs';
|
|
5
5
|
import { useEffect } from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import { announce } from '@react-aria/live-announcer';
|
|
7
7
|
|
|
8
8
|
const useAriaAnnounceActionState = (actionState, options = {}) => {
|
|
9
9
|
const formater = useLocalizedStringFormatter(locales);
|
|
@@ -12,19 +12,13 @@ const useAriaAnnounceActionState = (actionState, options = {}) => {
|
|
|
12
12
|
isSucceededText = formater.format("action.isSucceeded"),
|
|
13
13
|
isFailedText = formater.format("action.isFailed")
|
|
14
14
|
} = options;
|
|
15
|
-
const liveRegion = useLiveRegion({
|
|
16
|
-
"aria-live": "polite",
|
|
17
|
-
"aria-atomic": false,
|
|
18
|
-
"aria-relevant": "text additions",
|
|
19
|
-
role: "status"
|
|
20
|
-
});
|
|
21
15
|
useEffect(() => {
|
|
22
16
|
if (actionState === "isPending") {
|
|
23
|
-
|
|
17
|
+
announce(isPendingText, "polite");
|
|
24
18
|
} else if (actionState === "isSucceeded") {
|
|
25
|
-
|
|
19
|
+
announce(isSucceededText, "polite");
|
|
26
20
|
} else if (actionState === "isFailed") {
|
|
27
|
-
|
|
21
|
+
announce(isFailedText, "polite");
|
|
28
22
|
}
|
|
29
23
|
}, [actionState]);
|
|
30
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ariaLive.mjs","sources":["../../../../../../../src/components/Action/lib/ariaLive.ts"],"sourcesContent":["import { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../locales/*.locale.json\";\nimport { useEffect } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"ariaLive.mjs","sources":["../../../../../../../src/components/Action/lib/ariaLive.ts"],"sourcesContent":["import { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../locales/*.locale.json\";\nimport { useEffect } from \"react\";\nimport type { ActionStateValue } from \"@/components/Action/models/ActionState\";\nimport { announce } from \"@react-aria/live-announcer\";\n\ninterface Options {\n isPendingText?: string;\n isSucceededText?: string;\n isFailedText?: string;\n}\n\nexport const useAriaAnnounceActionState = (\n actionState: ActionStateValue,\n options: Options = {},\n): void => {\n const formater = useLocalizedStringFormatter(locales);\n\n const {\n isPendingText = formater.format(\"action.isPending\"),\n isSucceededText = formater.format(\"action.isSucceeded\"),\n isFailedText = formater.format(\"action.isFailed\"),\n } = options;\n\n useEffect(() => {\n if (actionState === \"isPending\") {\n announce(isPendingText, \"polite\");\n } else if (actionState === \"isSucceeded\") {\n announce(isSucceededText, \"polite\");\n } else if (actionState === \"isFailed\") {\n announce(isFailedText, \"polite\");\n }\n }, [actionState]);\n};\n"],"names":[],"mappings":";;;;;AAYO,MAAM,0BAA6B,GAAA,CACxC,WACA,EAAA,OAAA,GAAmB,EACV,KAAA;AACT,EAAM,MAAA,QAAA,GAAW,4BAA4B,OAAO,CAAA;AAEpD,EAAM,MAAA;AAAA,IACJ,aAAA,GAAgB,QAAS,CAAA,MAAA,CAAO,kBAAkB,CAAA;AAAA,IAClD,eAAA,GAAkB,QAAS,CAAA,MAAA,CAAO,oBAAoB,CAAA;AAAA,IACtD,YAAA,GAAe,QAAS,CAAA,MAAA,CAAO,iBAAiB;AAAA,GAC9C,GAAA,OAAA;AAEJ,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,gBAAgB,WAAa,EAAA;AAC/B,MAAA,QAAA,CAAS,eAAe,QAAQ,CAAA;AAAA,KAClC,MAAA,IAAW,gBAAgB,aAAe,EAAA;AACxC,MAAA,QAAA,CAAS,iBAAiB,QAAQ,CAAA;AAAA,KACpC,MAAA,IAAW,gBAAgB,UAAY,EAAA;AACrC,MAAA,QAAA,CAAS,cAAc,QAAQ,CAAA;AAAA;AACjC,GACF,EAAG,CAAC,WAAW,CAAC,CAAA;AAClB;;;;"}
|
|
@@ -14,10 +14,11 @@ import '../../../../../../lib/viewComponentContext/viewComponentContext.mjs';
|
|
|
14
14
|
import 'dot-prop';
|
|
15
15
|
import SearchFieldView from '../../../../../../views/SearchFieldView.mjs';
|
|
16
16
|
import styles from './SearchField.module.scss.mjs';
|
|
17
|
+
import { useAriaAnnounceSearchState } from '../../../../hooks/useAriaAnnounceSearchState.mjs';
|
|
17
18
|
|
|
18
19
|
const autoSubmitTimeout = 800;
|
|
19
20
|
const DefaultSearchFieldRender = (props) => {
|
|
20
|
-
const { onChange, value, autoSubmit, ...searchFieldProps } = props;
|
|
21
|
+
const { onChange, value, autoSubmit = true, ...searchFieldProps } = props;
|
|
21
22
|
const [searchString, setSearchString] = useState(value ?? "");
|
|
22
23
|
const submitSearch = () => {
|
|
23
24
|
if (searchString.trim() === "") {
|
|
@@ -32,6 +33,7 @@ const DefaultSearchFieldRender = (props) => {
|
|
|
32
33
|
return () => clearTimeout(timeout);
|
|
33
34
|
}
|
|
34
35
|
}, [searchString, autoSubmit]);
|
|
36
|
+
useAriaAnnounceSearchState();
|
|
35
37
|
useOnChange(value, () => {
|
|
36
38
|
setSearchString(value ?? "");
|
|
37
39
|
}, [searchString]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/SearchField/SearchField.tsx"],"sourcesContent":["import type { FC, KeyboardEvent } from \"react\";\nimport { createElement, useEffect, useState } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport type { Search } from \"@/components/List/model/search/Search\";\nimport type { SearchFieldRenderComponent } from \"@/components/List/model/search/types\";\nimport { useOnChange } from \"@/lib/hooks\";\nimport SearchFieldView from \"@/views/SearchFieldView\";\nimport styles from \"./SearchField.module.scss\";\n\ninterface Props extends PropsWithClassName {\n search: Search<never>;\n}\n\nconst autoSubmitTimeout = 800;\n\nconst DefaultSearchFieldRender: SearchFieldRenderComponent = (props) => {\n const { onChange, value, autoSubmit, ...searchFieldProps } = props;\n\n const [searchString, setSearchString] = useState(value ?? \"\");\n\n const submitSearch = () => {\n if (searchString.trim() === \"\") {\n onChange(undefined);\n } else {\n onChange(searchString);\n }\n };\n\n useEffect(() => {\n if (autoSubmit) {\n const timeout = setTimeout(() => submitSearch(), autoSubmitTimeout);\n return () => clearTimeout(timeout);\n }\n }, [searchString, autoSubmit]);\n\n useOnChange(value, () => {\n setSearchString(value ?? \"\");\n }, [searchString]);\n\n const clearSearch = () => {\n onChange(undefined);\n setSearchString(\"\");\n };\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (e.key === \"Enter\") {\n submitSearch();\n } else if (e.key === \"Escape\") {\n clearSearch();\n }\n };\n\n return (\n <SearchFieldView\n className={styles.searchField}\n value={searchString}\n onKeyUp={handleKeyPress}\n onChange={(value) => setSearchString(value)}\n onClear={clearSearch}\n {...searchFieldProps}\n />\n );\n};\n\nexport const SearchField: FC<Props> = (props) => {\n const { search } = props;\n const render = search.render ?? DefaultSearchFieldRender;\n\n return createElement(render, {\n value: search.value,\n onChange: search.setValue.bind(search),\n ...search.textFieldProps,\n });\n};\n\nexport default SearchField;\n"],"names":["value"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchField.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/SearchField/SearchField.tsx"],"sourcesContent":["import type { FC, KeyboardEvent } from \"react\";\nimport { createElement, useEffect, useState } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport type { Search } from \"@/components/List/model/search/Search\";\nimport type { SearchFieldRenderComponent } from \"@/components/List/model/search/types\";\nimport { useOnChange } from \"@/lib/hooks\";\nimport SearchFieldView from \"@/views/SearchFieldView\";\nimport styles from \"./SearchField.module.scss\";\nimport { useAriaAnnounceSearchState } from \"@/components/List/hooks/useAriaAnnounceSearchState\";\n\ninterface Props extends PropsWithClassName {\n search: Search<never>;\n}\n\nconst autoSubmitTimeout = 800;\n\nconst DefaultSearchFieldRender: SearchFieldRenderComponent = (props) => {\n const { onChange, value, autoSubmit = true, ...searchFieldProps } = props;\n\n const [searchString, setSearchString] = useState(value ?? \"\");\n\n const submitSearch = () => {\n if (searchString.trim() === \"\") {\n onChange(undefined);\n } else {\n onChange(searchString);\n }\n };\n\n useEffect(() => {\n if (autoSubmit) {\n const timeout = setTimeout(() => submitSearch(), autoSubmitTimeout);\n return () => clearTimeout(timeout);\n }\n }, [searchString, autoSubmit]);\n\n useAriaAnnounceSearchState();\n\n useOnChange(value, () => {\n setSearchString(value ?? \"\");\n }, [searchString]);\n\n const clearSearch = () => {\n onChange(undefined);\n setSearchString(\"\");\n };\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (e.key === \"Enter\") {\n submitSearch();\n } else if (e.key === \"Escape\") {\n clearSearch();\n }\n };\n\n return (\n <SearchFieldView\n className={styles.searchField}\n value={searchString}\n onKeyUp={handleKeyPress}\n onChange={(value) => setSearchString(value)}\n onClear={clearSearch}\n {...searchFieldProps}\n />\n );\n};\n\nexport const SearchField: FC<Props> = (props) => {\n const { search } = props;\n const render = search.render ?? DefaultSearchFieldRender;\n\n return createElement(render, {\n value: search.value,\n onChange: search.setValue.bind(search),\n ...search.textFieldProps,\n });\n};\n\nexport default SearchField;\n"],"names":["value"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAM,iBAAoB,GAAA,GAAA;AAE1B,MAAM,wBAAA,GAAuD,CAAC,KAAU,KAAA;AACtE,EAAA,MAAM,EAAE,QAAU,EAAA,KAAA,EAAO,aAAa,IAAM,EAAA,GAAG,kBAAqB,GAAA,KAAA;AAEpE,EAAA,MAAM,CAAC,YAAc,EAAA,eAAe,CAAI,GAAA,QAAA,CAAS,SAAS,EAAE,CAAA;AAE5D,EAAA,MAAM,eAAe,MAAM;AACzB,IAAI,IAAA,YAAA,CAAa,IAAK,EAAA,KAAM,EAAI,EAAA;AAC9B,MAAA,QAAA,CAAS,MAAS,CAAA;AAAA,KACb,MAAA;AACL,MAAA,QAAA,CAAS,YAAY,CAAA;AAAA;AACvB,GACF;AAEA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,UAAY,EAAA;AACd,MAAA,MAAM,OAAU,GAAA,UAAA,CAAW,MAAM,YAAA,IAAgB,iBAAiB,CAAA;AAClE,MAAO,OAAA,MAAM,aAAa,OAAO,CAAA;AAAA;AACnC,GACC,EAAA,CAAC,YAAc,EAAA,UAAU,CAAC,CAAA;AAE7B,EAA2B,0BAAA,EAAA;AAE3B,EAAA,WAAA,CAAY,OAAO,MAAM;AACvB,IAAA,eAAA,CAAgB,SAAS,EAAE,CAAA;AAAA,GAC7B,EAAG,CAAC,YAAY,CAAC,CAAA;AAEjB,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,QAAA,CAAS,MAAS,CAAA;AAClB,IAAA,eAAA,CAAgB,EAAE,CAAA;AAAA,GACpB;AAEA,EAAM,MAAA,cAAA,GAAiB,CAAC,CAAqB,KAAA;AAC3C,IAAI,IAAA,CAAA,CAAE,QAAQ,OAAS,EAAA;AACrB,MAAa,YAAA,EAAA;AAAA,KACf,MAAA,IAAW,CAAE,CAAA,GAAA,KAAQ,QAAU,EAAA;AAC7B,MAAY,WAAA,EAAA;AAAA;AACd,GACF;AAEA,EACE,uBAAA,GAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACC,WAAW,MAAO,CAAA,WAAA;AAAA,MAClB,KAAO,EAAA,YAAA;AAAA,MACP,OAAS,EAAA,cAAA;AAAA,MACT,QAAU,EAAA,CAACA,MAAU,KAAA,eAAA,CAAgBA,MAAK,CAAA;AAAA,MAC1C,OAAS,EAAA,WAAA;AAAA,MACR,GAAG;AAAA;AAAA,GACN;AAEJ,CAAA;AAEa,MAAA,WAAA,GAAyB,CAAC,KAAU,KAAA;AAC/C,EAAM,MAAA,EAAE,QAAW,GAAA,KAAA;AACnB,EAAM,MAAA,MAAA,GAAS,OAAO,MAAU,IAAA,wBAAA;AAEhC,EAAA,OAAO,cAAc,MAAQ,EAAA;AAAA,IAC3B,OAAO,MAAO,CAAA,KAAA;AAAA,IACd,QAAU,EAAA,MAAA,CAAO,QAAS,CAAA,IAAA,CAAK,MAAM,CAAA;AAAA,IACrC,GAAG,MAAO,CAAA;AAAA,GACX,CAAA;AACH;;;;"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { useLocalizedStringFormatter } from 'react-aria';
|
|
4
|
+
import locales from '../../../../../_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs';
|
|
5
|
+
import { announce } from '@react-aria/live-announcer';
|
|
6
|
+
import '../../AccentBox/AccentBox.mjs';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
8
|
+
import { useEffect } from 'react';
|
|
9
|
+
import 'clsx';
|
|
10
|
+
import '../../../lib/propsContext/propsContext.mjs';
|
|
11
|
+
import '../../../lib/viewComponentContext/viewComponentContext.mjs';
|
|
12
|
+
import '@mittwald/react-tunnel';
|
|
13
|
+
import '../../../lib/slotContext/slotContext.mjs';
|
|
14
|
+
import '@react-aria/utils';
|
|
15
|
+
import 'remeda';
|
|
16
|
+
import 'dot-prop';
|
|
17
|
+
import '../../Button/Button.mjs';
|
|
18
|
+
import '@tabler/icons-react';
|
|
19
|
+
import '../../Icon/Icon.mjs';
|
|
20
|
+
import '../../SuspenseTrigger/SuspenseTrigger.mjs';
|
|
21
|
+
import '../../Action/Action.mjs';
|
|
22
|
+
import '../../ActionGroup/ActionGroup.mjs';
|
|
23
|
+
import '../../Alert/Alert.mjs';
|
|
24
|
+
import '../../AlertBadge/AlertBadge.mjs';
|
|
25
|
+
import '../../Align/Align.mjs';
|
|
26
|
+
import 'recharts';
|
|
27
|
+
import '../../Heading/Heading.mjs';
|
|
28
|
+
import '../../Text/Text.mjs';
|
|
29
|
+
import '../../Autocomplete/Autocomplete.mjs';
|
|
30
|
+
import '../../Avatar/Avatar.mjs';
|
|
31
|
+
import '../../Badge/Badge.mjs';
|
|
32
|
+
import 'react-aria-components';
|
|
33
|
+
import 'mobx';
|
|
34
|
+
import '../../../lib/controller/overlay/context.mjs';
|
|
35
|
+
import '../../Checkbox/Checkbox.mjs';
|
|
36
|
+
import '../../CheckboxButton/CheckboxButton.mjs';
|
|
37
|
+
import '../../CheckboxGroup/CheckboxGroup.mjs';
|
|
38
|
+
import 'react-syntax-highlighter';
|
|
39
|
+
import '../../CopyButton/CopyButton.mjs';
|
|
40
|
+
import '../../ColumnLayout/ColumnLayout.mjs';
|
|
41
|
+
import '../../ComboBox/ComboBox.mjs';
|
|
42
|
+
import '../../Content/Content.mjs';
|
|
43
|
+
import '../../ContextMenu/ContextMenu.mjs';
|
|
44
|
+
import '../../MenuItem/MenuItem.mjs';
|
|
45
|
+
import '../../ContextMenu/components/ContextMenuTrigger/ContextMenuTrigger.mjs';
|
|
46
|
+
import '../../ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs';
|
|
47
|
+
import '../../ContextualHelp/ContextualHelp.mjs';
|
|
48
|
+
import '../../ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.mjs';
|
|
49
|
+
import '../../CounterBadge/CounterBadge.mjs';
|
|
50
|
+
import '../../CountryOptions/CountryOptions.mjs';
|
|
51
|
+
import '../../DatePicker/DatePicker.mjs';
|
|
52
|
+
import '../../DateRangePicker/DateRangePicker.mjs';
|
|
53
|
+
import '../../FieldDescription/FieldDescription.mjs';
|
|
54
|
+
import '../../FieldError/FieldError.mjs';
|
|
55
|
+
import '../../FileCard/FileCard.mjs';
|
|
56
|
+
import '../../FileCardList/FileCardList.mjs';
|
|
57
|
+
import '../../FileDropZone/FileDropZone.mjs';
|
|
58
|
+
import '../../FileField/FileField.mjs';
|
|
59
|
+
import '../../Header/Header.mjs';
|
|
60
|
+
import '../../Image/Image.mjs';
|
|
61
|
+
import '../../Initials/Initials.mjs';
|
|
62
|
+
import '../../Label/Label.mjs';
|
|
63
|
+
import '../../LayoutCard/LayoutCard.mjs';
|
|
64
|
+
import '../../OverlayTrigger/components/MenuTrigger/MenuTrigger.mjs';
|
|
65
|
+
import '../../LightBox/LightBox.mjs';
|
|
66
|
+
import '../../Link/Link.mjs';
|
|
67
|
+
import 'invariant';
|
|
68
|
+
import '../components/ListSummary/ListSummary.mjs';
|
|
69
|
+
import { useList } from './useList.mjs';
|
|
70
|
+
import '../List.mjs';
|
|
71
|
+
import 'react-markdown';
|
|
72
|
+
import '../../Message/Message.mjs';
|
|
73
|
+
import '../../MessageThread/MessageThread.mjs';
|
|
74
|
+
import '../../Modal/Modal.mjs';
|
|
75
|
+
import '../../Navigation/Navigation.mjs';
|
|
76
|
+
import '../../Navigation/components/NavigationGroup/NavigationGroup.mjs';
|
|
77
|
+
import '../../NotificationProvider/NotificationProvider.mjs';
|
|
78
|
+
import 'luxon';
|
|
79
|
+
import '../../NumberField/NumberField.mjs';
|
|
80
|
+
import '../../Option/Option.mjs';
|
|
81
|
+
import '../../PasswordCreationField/PasswordCreationField.mjs';
|
|
82
|
+
import '../../Popover/components/PopoverTrigger/PopoverTrigger.mjs';
|
|
83
|
+
import '../../Popover/Popover.mjs';
|
|
84
|
+
import '../../ProgressBar/ProgressBar.mjs';
|
|
85
|
+
import '../../RadioGroup/RadioGroup.mjs';
|
|
86
|
+
import '../../RadioGroup/components/Radio/Radio.mjs';
|
|
87
|
+
import '../../RadioGroup/components/RadioButton/RadioButton.mjs';
|
|
88
|
+
import '../../SearchField/SearchField.mjs';
|
|
89
|
+
import '../../Section/Section.mjs';
|
|
90
|
+
import '../../SegmentedControl/SegmentedControl.mjs';
|
|
91
|
+
import '../../SegmentedControl/components/Segment/Segment.mjs';
|
|
92
|
+
import '../../Select/Select.mjs';
|
|
93
|
+
import '../../SettingsProvider/SettingsProvider.mjs';
|
|
94
|
+
import '../../Slider/Slider.mjs';
|
|
95
|
+
import '../../Switch/Switch.mjs';
|
|
96
|
+
import '../../Tabs/Tabs.mjs';
|
|
97
|
+
import '../../Tabs/components/Tab/context.mjs';
|
|
98
|
+
import '../../TextArea/TextArea.mjs';
|
|
99
|
+
import '../../TextField/TextField.mjs';
|
|
100
|
+
import '../../TimeField/TimeField.mjs';
|
|
101
|
+
import '../../TranslationProvider/TranslationProvider.mjs';
|
|
102
|
+
import { useDebounceCallback } from 'usehooks-ts';
|
|
103
|
+
|
|
104
|
+
const announceDebounceMs = 600;
|
|
105
|
+
const useAriaAnnounceSearchState = () => {
|
|
106
|
+
const formatter = useLocalizedStringFormatter(locales);
|
|
107
|
+
const list = useList();
|
|
108
|
+
const debouncedAnnounce = useDebounceCallback(announce, announceDebounceMs);
|
|
109
|
+
const searchTerm = list.search?.value;
|
|
110
|
+
const resultCount = list.batches.getTotalItemsCount();
|
|
111
|
+
const isLoading = list.loader.loaderState.useIsLoading();
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (isLoading || !searchTerm) {
|
|
114
|
+
debouncedAnnounce.cancel();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const text = formatter.format(
|
|
118
|
+
resultCount > 0 ? "list.search.announce.result" : "list.search.announce.noResult",
|
|
119
|
+
{
|
|
120
|
+
resultCount,
|
|
121
|
+
searchTerm
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
debouncedAnnounce(text, "polite");
|
|
125
|
+
}, [searchTerm, resultCount, isLoading]);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export { useAriaAnnounceSearchState };
|
|
129
|
+
//# sourceMappingURL=useAriaAnnounceSearchState.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAriaAnnounceSearchState.mjs","sources":["../../../../../../../src/components/List/hooks/useAriaAnnounceSearchState.ts"],"sourcesContent":["import { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../locales/*.locale.json\";\nimport { announce } from \"@react-aria/live-announcer\";\nimport { useList } from \"@/index/default\";\nimport { useDebounceCallback } from \"usehooks-ts\";\nimport { useEffect } from \"react\";\n\nconst announceDebounceMs = 600;\n\nexport const useAriaAnnounceSearchState = (): void => {\n const formatter = useLocalizedStringFormatter(locales);\n const list = useList();\n const debouncedAnnounce = useDebounceCallback(announce, announceDebounceMs);\n\n const searchTerm = list.search?.value;\n const resultCount = list.batches.getTotalItemsCount();\n const isLoading = list.loader.loaderState.useIsLoading();\n\n useEffect(() => {\n if (isLoading || !searchTerm) {\n debouncedAnnounce.cancel();\n return;\n }\n\n const text = formatter.format(\n resultCount > 0\n ? \"list.search.announce.result\"\n : \"list.search.announce.noResult\",\n {\n resultCount,\n searchTerm,\n },\n );\n\n debouncedAnnounce(text, \"polite\");\n }, [searchTerm, resultCount, isLoading]);\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,kBAAqB,GAAA,GAAA;AAEpB,MAAM,6BAA6B,MAAY;AACpD,EAAM,MAAA,SAAA,GAAY,4BAA4B,OAAO,CAAA;AACrD,EAAA,MAAM,OAAO,OAAQ,EAAA;AACrB,EAAM,MAAA,iBAAA,GAAoB,mBAAoB,CAAA,QAAA,EAAU,kBAAkB,CAAA;AAE1E,EAAM,MAAA,UAAA,GAAa,KAAK,MAAQ,EAAA,KAAA;AAChC,EAAM,MAAA,WAAA,GAAc,IAAK,CAAA,OAAA,CAAQ,kBAAmB,EAAA;AACpD,EAAA,MAAM,SAAY,GAAA,IAAA,CAAK,MAAO,CAAA,WAAA,CAAY,YAAa,EAAA;AAEvD,EAAA,SAAA,CAAU,MAAM;AACd,IAAI,IAAA,SAAA,IAAa,CAAC,UAAY,EAAA;AAC5B,MAAA,iBAAA,CAAkB,MAAO,EAAA;AACzB,MAAA;AAAA;AAGF,IAAA,MAAM,OAAO,SAAU,CAAA,MAAA;AAAA,MACrB,WAAA,GAAc,IACV,6BACA,GAAA,+BAAA;AAAA,MACJ;AAAA,QACE,WAAA;AAAA,QACA;AAAA;AACF,KACF;AAEA,IAAA,iBAAA,CAAkB,MAAM,QAAQ,CAAA;AAAA,GAC/B,EAAA,CAAC,UAAY,EAAA,WAAA,EAAa,SAAS,CAAC,CAAA;AACzC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ariaLive.d.ts","sourceRoot":"","sources":["../../../../../src/components/Action/lib/ariaLive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ariaLive.d.ts","sourceRoot":"","sources":["../../../../../src/components/Action/lib/ariaLive.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAG/E,UAAU,OAAO;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,0BAA0B,GACrC,aAAa,gBAAgB,EAC7B,UAAS,OAAY,KACpB,IAkBF,CAAC"}
|
package/dist/types/components/List/components/Header/components/SearchField/SearchField.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/List/components/Header/components/SearchField/SearchField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAiB,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchField.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/List/components/Header/components/SearchField/SearchField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAiB,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAOpE,UAAU,KAAM,SAAQ,kBAAkB;IACxC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;CACvB;AAuDD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,KAAK,CASjC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAriaAnnounceSearchState.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/hooks/useAriaAnnounceSearchState.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,0BAA0B,QAAO,IA2B7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.423",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"test:unit": "vitest run"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@chakra-ui/live-region": "^2.1.0",
|
|
59
58
|
"@internationalized/string-compiler": "^3.2.6",
|
|
60
59
|
"@mittwald/password-tools-js": "3.0.0-alpha.18",
|
|
61
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
60
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.423",
|
|
62
61
|
"@mittwald/react-use-promise": "^3.0.4",
|
|
63
62
|
"@react-aria/form": "^3.1.0",
|
|
63
|
+
"@react-aria/live-announcer": "^3.4.4",
|
|
64
64
|
"@react-aria/utils": "^3.30.0",
|
|
65
65
|
"@react-stately/form": "^3.2.0",
|
|
66
66
|
"@react-types/shared": "^3.31.0",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@faker-js/faker": "^9.9.0",
|
|
100
100
|
"@internationalized/date": "^3.8.2",
|
|
101
101
|
"@mittwald/flow-core": "",
|
|
102
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
102
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.423",
|
|
103
103
|
"@mittwald/react-use-promise": "^3.0.4",
|
|
104
104
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.3",
|
|
105
105
|
"@mittwald/typescript-config": "",
|
|
@@ -172,5 +172,5 @@
|
|
|
172
172
|
"optional": true
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
|
-
"gitHead": "
|
|
175
|
+
"gitHead": "3e61ca666bbefb2bb8ef0ffdb6dd71ba5e9a0ffe"
|
|
176
176
|
}
|