@flipdish/ui-library 0.41.2 → 0.43.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/atoms/Dot/Dot.styles.cjs +1 -0
- package/dist/components/atoms/Dot/Dot.styles.cjs.map +1 -1
- package/dist/components/atoms/Dot/Dot.styles.d.ts +4 -0
- package/dist/components/atoms/Dot/Dot.styles.d.ts.map +1 -1
- package/dist/components/atoms/Dot/Dot.styles.js +1 -0
- package/dist/components/atoms/Dot/Dot.styles.js.map +1 -1
- package/dist/components/atoms/LoadingIndicator/index.cjs +5 -0
- package/dist/components/atoms/LoadingIndicator/index.cjs.map +1 -1
- package/dist/components/atoms/LoadingIndicator/index.d.ts +1 -1
- package/dist/components/atoms/LoadingIndicator/index.d.ts.map +1 -1
- package/dist/components/atoms/LoadingIndicator/index.js +5 -0
- package/dist/components/atoms/LoadingIndicator/index.js.map +1 -1
- package/dist/components/atoms/SearchInput/index.cjs +28 -2
- package/dist/components/atoms/SearchInput/index.cjs.map +1 -1
- package/dist/components/atoms/SearchInput/index.d.ts +8 -1
- package/dist/components/atoms/SearchInput/index.d.ts.map +1 -1
- package/dist/components/atoms/SearchInput/index.js +28 -2
- package/dist/components/atoms/SearchInput/index.js.map +1 -1
- package/dist/components/atoms/SocialButton/index.cjs +11 -7
- package/dist/components/atoms/SocialButton/index.cjs.map +1 -1
- package/dist/components/atoms/SocialButton/index.d.ts.map +1 -1
- package/dist/components/atoms/SocialButton/index.js +11 -7
- package/dist/components/atoms/SocialButton/index.js.map +1 -1
- package/dist/components/atoms/Tooltip/index.cjs +8 -1
- package/dist/components/atoms/Tooltip/index.cjs.map +1 -1
- package/dist/components/atoms/Tooltip/index.d.ts.map +1 -1
- package/dist/components/atoms/Tooltip/index.js +8 -1
- package/dist/components/atoms/Tooltip/index.js.map +1 -1
- package/dist/components/atoms/UtilityButton/index.cjs.map +1 -1
- package/dist/components/atoms/UtilityButton/index.d.ts +2 -0
- package/dist/components/atoms/UtilityButton/index.d.ts.map +1 -1
- package/dist/components/atoms/UtilityButton/index.js.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.cjs +16 -4
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.cjs.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.js +17 -5
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbItem.js.map +1 -1
- package/dist/components/molecules/ButtonGroup/index.cjs +8 -1
- package/dist/components/molecules/ButtonGroup/index.cjs.map +1 -1
- package/dist/components/molecules/ButtonGroup/index.d.ts.map +1 -1
- package/dist/components/molecules/ButtonGroup/index.js +9 -2
- package/dist/components/molecules/ButtonGroup/index.js.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.cjs +8 -1
- package/dist/components/molecules/CodeSnippet/index.cjs.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.d.ts.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.js +8 -1
- package/dist/components/molecules/CodeSnippet/index.js.map +1 -1
- package/dist/components/molecules/Dropdown/index.cjs +10 -7
- package/dist/components/molecules/Dropdown/index.cjs.map +1 -1
- package/dist/components/molecules/Dropdown/index.d.ts.map +1 -1
- package/dist/components/molecules/Dropdown/index.js +11 -8
- package/dist/components/molecules/Dropdown/index.js.map +1 -1
- package/dist/components/molecules/EmptyState/index.cjs +3 -2
- package/dist/components/molecules/EmptyState/index.cjs.map +1 -1
- package/dist/components/molecules/EmptyState/index.d.ts.map +1 -1
- package/dist/components/molecules/EmptyState/index.js +3 -2
- package/dist/components/molecules/EmptyState/index.js.map +1 -1
- package/dist/components/molecules/Select/components/Combobox.cjs +8 -1
- package/dist/components/molecules/Select/components/Combobox.cjs.map +1 -1
- package/dist/components/molecules/Select/components/Combobox.js +8 -1
- package/dist/components/molecules/Select/components/Combobox.js.map +1 -1
- package/dist/components/molecules/Select/components/SelectItem.cjs +10 -1
- package/dist/components/molecules/Select/components/SelectItem.cjs.map +1 -1
- package/dist/components/molecules/Select/components/SelectItem.d.ts.map +1 -1
- package/dist/components/molecules/Select/components/SelectItem.js +10 -1
- package/dist/components/molecules/Select/components/SelectItem.js.map +1 -1
- package/dist/components/molecules/Select/index.cjs +11 -1
- package/dist/components/molecules/Select/index.cjs.map +1 -1
- package/dist/components/molecules/Select/index.d.ts.map +1 -1
- package/dist/components/molecules/Select/index.js +11 -1
- package/dist/components/molecules/Select/index.js.map +1 -1
- package/dist/components/molecules/Select/multiSelect.utils.cjs +5 -1
- package/dist/components/molecules/Select/multiSelect.utils.cjs.map +1 -1
- package/dist/components/molecules/Select/multiSelect.utils.d.ts.map +1 -1
- package/dist/components/molecules/Select/multiSelect.utils.js +5 -1
- package/dist/components/molecules/Select/multiSelect.utils.js.map +1 -1
- package/dist/components/molecules/Tabs/index.cjs +14 -9
- package/dist/components/molecules/Tabs/index.cjs.map +1 -1
- package/dist/components/molecules/Tabs/index.d.ts +5 -3
- package/dist/components/molecules/Tabs/index.d.ts.map +1 -1
- package/dist/components/molecules/Tabs/index.js +15 -10
- package/dist/components/molecules/Tabs/index.js.map +1 -1
- package/dist/components/molecules/Tags/Tags.styles.cjs +66 -0
- package/dist/components/molecules/Tags/Tags.styles.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tags.styles.d.ts +141 -0
- package/dist/components/molecules/Tags/Tags.styles.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tags.styles.js +64 -0
- package/dist/components/molecules/Tags/Tags.styles.js.map +1 -0
- package/dist/components/molecules/Tags/components/TagCheckbox.cjs +2 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.cjs.map +1 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.d.ts +2 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.d.ts.map +1 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.js +2 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.js.map +1 -1
- package/dist/components/molecules/Tags/components/TagCloseX.cjs +2 -6
- package/dist/components/molecules/Tags/components/TagCloseX.cjs.map +1 -1
- package/dist/components/molecules/Tags/components/TagCloseX.d.ts +2 -1
- package/dist/components/molecules/Tags/components/TagCloseX.d.ts.map +1 -1
- package/dist/components/molecules/Tags/components/TagCloseX.js +2 -6
- package/dist/components/molecules/Tags/components/TagCloseX.js.map +1 -1
- package/dist/components/molecules/Tags/index.cjs +18 -48
- package/dist/components/molecules/Tags/index.cjs.map +1 -1
- package/dist/components/molecules/Tags/index.d.ts +12 -3
- package/dist/components/molecules/Tags/index.d.ts.map +1 -1
- package/dist/components/molecules/Tags/index.js +18 -48
- package/dist/components/molecules/Tags/index.js.map +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.cjs +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.cjs.map +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.js +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.js.map +1 -1
- package/dist/components/organisms/ApplicationHeader/index.cjs +4 -1
- package/dist/components/organisms/ApplicationHeader/index.cjs.map +1 -1
- package/dist/components/organisms/ApplicationHeader/index.d.ts.map +1 -1
- package/dist/components/organisms/ApplicationHeader/index.js +4 -1
- package/dist/components/organisms/ApplicationHeader/index.js.map +1 -1
- package/dist/components/organisms/Calendar/calendar.utils.cjs +14 -0
- package/dist/components/organisms/Calendar/calendar.utils.cjs.map +1 -1
- package/dist/components/organisms/Calendar/calendar.utils.d.ts +7 -0
- package/dist/components/organisms/Calendar/calendar.utils.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/calendar.utils.js +14 -1
- package/dist/components/organisms/Calendar/calendar.utils.js.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarDayView.cjs +1 -1
- package/dist/components/organisms/Calendar/components/CalendarDayView.cjs.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarDayView.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarDayView.js +2 -2
- package/dist/components/organisms/Calendar/components/CalendarDayView.js.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarMonthView.cjs +12 -5
- package/dist/components/organisms/Calendar/components/CalendarMonthView.cjs.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarMonthView.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarMonthView.js +13 -6
- package/dist/components/organisms/Calendar/components/CalendarMonthView.js.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarWeekView.cjs +1 -1
- package/dist/components/organisms/Calendar/components/CalendarWeekView.cjs.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarWeekView.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarWeekView.js +2 -2
- package/dist/components/organisms/Calendar/components/CalendarWeekView.js.map +1 -1
- package/dist/components/organisms/Charts/components/ChartsBase.cjs +28 -13
- package/dist/components/organisms/Charts/components/ChartsBase.cjs.map +1 -1
- package/dist/components/organisms/Charts/components/ChartsBase.d.ts.map +1 -1
- package/dist/components/organisms/Charts/components/ChartsBase.js +28 -13
- package/dist/components/organisms/Charts/components/ChartsBase.js.map +1 -1
- package/dist/components/organisms/Charts/components/Metrics.cjs +1 -1
- package/dist/components/organisms/Charts/components/Metrics.cjs.map +1 -1
- package/dist/components/organisms/Charts/components/Metrics.d.ts.map +1 -1
- package/dist/components/organisms/Charts/components/Metrics.js +1 -1
- package/dist/components/organisms/Charts/components/Metrics.js.map +1 -1
- package/dist/components/organisms/ColorPicker/index.cjs +8 -5
- package/dist/components/organisms/ColorPicker/index.cjs.map +1 -1
- package/dist/components/organisms/ColorPicker/index.d.ts.map +1 -1
- package/dist/components/organisms/ColorPicker/index.js +8 -5
- package/dist/components/organisms/ColorPicker/index.js.map +1 -1
- package/dist/components/organisms/Messaging/index.cjs +23 -5
- package/dist/components/organisms/Messaging/index.cjs.map +1 -1
- package/dist/components/organisms/Messaging/index.d.ts.map +1 -1
- package/dist/components/organisms/Messaging/index.js +24 -6
- package/dist/components/organisms/Messaging/index.js.map +1 -1
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.cjs +7 -2
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.cjs.map +1 -1
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.d.ts +3 -1
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.d.ts.map +1 -1
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.js +8 -3
- package/dist/components/organisms/SidePanel/hooks/usePanelFocus.js.map +1 -1
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.cjs +121 -0
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.cjs.map +1 -0
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.d.ts +30 -0
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.d.ts.map +1 -0
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.js +119 -0
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.js.map +1 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.cjs +39 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.cjs.map +1 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.d.ts +23 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.d.ts.map +1 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.js +37 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.js.map +1 -0
- package/dist/components/organisms/SlideoutMenu/index.cjs +34 -37
- package/dist/components/organisms/SlideoutMenu/index.cjs.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.d.ts +52 -41
- package/dist/components/organisms/SlideoutMenu/index.d.ts.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.js +35 -38
- package/dist/components/organisms/SlideoutMenu/index.js.map +1 -1
- package/dist/components/organisms/SlideoutMenu/providers/OverlayBounds.context.cjs +13 -0
- package/dist/components/organisms/SlideoutMenu/providers/OverlayBounds.context.cjs.map +1 -0
- package/dist/components/organisms/SlideoutMenu/providers/OverlayBounds.context.d.ts +14 -0
- package/dist/components/organisms/SlideoutMenu/providers/OverlayBounds.context.d.ts.map +1 -0
- package/dist/components/organisms/SlideoutMenu/providers/OverlayBounds.context.js +11 -0
- package/dist/components/organisms/SlideoutMenu/providers/OverlayBounds.context.js.map +1 -0
- package/dist/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.cjs +9 -0
- package/dist/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.cjs.map +1 -0
- package/dist/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.d.ts +13 -0
- package/dist/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.d.ts.map +1 -0
- package/dist/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.js +7 -0
- package/dist/components/organisms/SlideoutMenu/providers/SlideoutMenu.context.js.map +1 -0
- package/dist/components/organisms/SlideoutMenu/utilities/slideoutMenu.utils.cjs +52 -0
- package/dist/components/organisms/SlideoutMenu/utilities/slideoutMenu.utils.cjs.map +1 -0
- package/dist/components/organisms/SlideoutMenu/utilities/slideoutMenu.utils.d.ts +26 -0
- package/dist/components/organisms/SlideoutMenu/utilities/slideoutMenu.utils.d.ts.map +1 -0
- package/dist/components/organisms/SlideoutMenu/utilities/slideoutMenu.utils.js +47 -0
- package/dist/components/organisms/SlideoutMenu/utilities/slideoutMenu.utils.js.map +1 -0
- package/dist/components/organisms/Table/index.cjs +35 -5
- package/dist/components/organisms/Table/index.cjs.map +1 -1
- package/dist/components/organisms/Table/index.d.ts +8 -2
- package/dist/components/organisms/Table/index.d.ts.map +1 -1
- package/dist/components/organisms/Table/index.js +36 -6
- package/dist/components/organisms/Table/index.js.map +1 -1
- package/dist/components/organisms/Table/table.utils.cjs +37 -0
- package/dist/components/organisms/Table/table.utils.cjs.map +1 -0
- package/dist/components/organisms/Table/table.utils.d.ts +22 -0
- package/dist/components/organisms/Table/table.utils.d.ts.map +1 -0
- package/dist/components/organisms/Table/table.utils.js +33 -0
- package/dist/components/organisms/Table/table.utils.js.map +1 -0
- package/dist/components/organisms/TreeView/index.cjs +14 -7
- package/dist/components/organisms/TreeView/index.cjs.map +1 -1
- package/dist/components/organisms/TreeView/index.d.ts.map +1 -1
- package/dist/components/organisms/TreeView/index.js +14 -7
- package/dist/components/organisms/TreeView/index.js.map +1 -1
- package/dist/components/organisms/TreeView/treeView.utils.cjs +4 -1
- package/dist/components/organisms/TreeView/treeView.utils.cjs.map +1 -1
- package/dist/components/organisms/TreeView/treeView.utils.d.ts.map +1 -1
- package/dist/components/organisms/TreeView/treeView.utils.js +4 -1
- package/dist/components/organisms/TreeView/treeView.utils.js.map +1 -1
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.cjs +43 -0
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.cjs.map +1 -0
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.d.ts +12 -0
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.d.ts.map +1 -0
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.js +41 -0
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.js.map +1 -0
- package/dist/components/templates/AppShell/index.cjs +10 -6
- package/dist/components/templates/AppShell/index.cjs.map +1 -1
- package/dist/components/templates/AppShell/index.d.ts +1 -1
- package/dist/components/templates/AppShell/index.d.ts.map +1 -1
- package/dist/components/templates/AppShell/index.js +11 -7
- package/dist/components/templates/AppShell/index.js.map +1 -1
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.cjs +56 -0
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.cjs.map +1 -0
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.d.ts +26 -0
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.d.ts.map +1 -0
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.js +54 -0
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.js.map +1 -0
- package/dist/hooks/useDebouncedCallback/index.cjs +45 -0
- package/dist/hooks/useDebouncedCallback/index.cjs.map +1 -0
- package/dist/hooks/useDebouncedCallback/index.d.ts +18 -0
- package/dist/hooks/useDebouncedCallback/index.d.ts.map +1 -0
- package/dist/hooks/useDebouncedCallback/index.js +43 -0
- package/dist/hooks/useDebouncedCallback/index.js.map +1 -0
- package/dist/native/components/atoms/Checkbox/index.d.ts.map +1 -1
- package/dist/native/components/atoms/Checkbox/index.js +1 -1
- package/dist/native/components/atoms/Checkbox/index.js.map +1 -1
- package/dist/native/components/atoms/Dot/Dot.styles.d.ts +4 -0
- package/dist/native/components/atoms/Dot/Dot.styles.d.ts.map +1 -1
- package/dist/native/components/atoms/Dot/Dot.styles.js +1 -0
- package/dist/native/components/atoms/Dot/Dot.styles.js.map +1 -1
- package/dist/native/components/molecules/Tags/Tags.styles.d.ts +141 -0
- package/dist/native/components/molecules/Tags/Tags.styles.d.ts.map +1 -0
- package/dist/native/components/molecules/Tags/Tags.styles.js +92 -0
- package/dist/native/components/molecules/Tags/Tags.styles.js.map +1 -0
- package/dist/native/components/molecules/Tags/index.d.ts +95 -8
- package/dist/native/components/molecules/Tags/index.d.ts.map +1 -0
- package/dist/native/components/molecules/Tags/index.js +105 -0
- package/dist/native/components/molecules/Tags/index.js.map +1 -0
- package/dist/native/hooks/useDebouncedCallback/index.d.ts +18 -0
- package/dist/native/hooks/useDebouncedCallback/index.d.ts.map +1 -0
- package/dist/native/hooks/useDebouncedCallback/index.js +43 -0
- package/dist/native/hooks/useDebouncedCallback/index.js.map +1 -0
- package/dist/native/utilities/searchParamsUtils/index.d.ts +12 -0
- package/dist/utilities/searchParamsUtils/index.cjs +71 -0
- package/dist/utilities/searchParamsUtils/index.cjs.map +1 -0
- package/dist/utilities/searchParamsUtils/index.d.ts +61 -0
- package/dist/utilities/searchParamsUtils/index.d.ts.map +1 -0
- package/dist/utilities/searchParamsUtils/index.js +64 -0
- package/dist/utilities/searchParamsUtils/index.js.map +1 -0
- package/package.json +4 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useDebouncedCallback } from '@flipdish/ui-library/hooks/useDebouncedCallback';
|
|
2
|
+
import { useState, useRef, useLayoutEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Keeps a search box's own draft so typing stays instant, and commits it to the owner once typing pauses, on submit, or on
|
|
6
|
+
* clear. A `value` changed elsewhere, by Back or a reset, replaces the draft; the box's own commits coming back from the owner
|
|
7
|
+
* leave it alone, so typing carries on while a router applies a navigation as a transition.
|
|
8
|
+
*
|
|
9
|
+
* @param options The committed value, what the draft starts as, where to send commits, and the pause to wait for.
|
|
10
|
+
* @returns The draft to show, with `change` for every keystroke, `submit` to commit at once and `clear` to commit an empty search.
|
|
11
|
+
*/
|
|
12
|
+
const useDebouncedSearch = ({ value, initialValue, onChange, delay }) => {
|
|
13
|
+
const [draft, setDraft] = useState(initialValue ?? value);
|
|
14
|
+
// The last `value` reconciled, so only a change to it is acted on and the initial draft is never overwritten.
|
|
15
|
+
const committed = useRef(value);
|
|
16
|
+
// What has been sent and not yet seen come back; an array, since two commits can be in flight at once.
|
|
17
|
+
const sent = useRef([]);
|
|
18
|
+
const send = (next) => {
|
|
19
|
+
sent.current.push(next);
|
|
20
|
+
onChange(next);
|
|
21
|
+
};
|
|
22
|
+
const commit = useDebouncedCallback(send, delay);
|
|
23
|
+
// An effect, not the render body: a render React discards would still have moved the refs and dropped a pending commit.
|
|
24
|
+
// Layout timing so a reset lands before the old draft is painted.
|
|
25
|
+
useLayoutEffect(() => {
|
|
26
|
+
if (value === committed.current)
|
|
27
|
+
return;
|
|
28
|
+
committed.current = value;
|
|
29
|
+
const acknowledged = sent.current.indexOf(value);
|
|
30
|
+
if (acknowledged >= 0) {
|
|
31
|
+
// The box's own commit: the draft already shows it, or something newer typed since.
|
|
32
|
+
sent.current.splice(0, acknowledged + 1);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
// Changed elsewhere: a commit still pending from typing would overwrite it.
|
|
36
|
+
commit.cancel();
|
|
37
|
+
sent.current = [];
|
|
38
|
+
setDraft(value);
|
|
39
|
+
}, [value, commit]);
|
|
40
|
+
const change = (next) => {
|
|
41
|
+
setDraft(next);
|
|
42
|
+
commit(next);
|
|
43
|
+
};
|
|
44
|
+
const submit = () => commit.flush();
|
|
45
|
+
const clear = () => {
|
|
46
|
+
commit.cancel();
|
|
47
|
+
setDraft('');
|
|
48
|
+
send('');
|
|
49
|
+
};
|
|
50
|
+
return { draft, change, submit, clear };
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { useDebouncedSearch };
|
|
54
|
+
//# sourceMappingURL=useDebouncedSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedSearch.js","sources":["../../../../src/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAcA;;;;;;;AAOG;AACI,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAA6B,KAAI;AACxG,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAS,YAAY,IAAI,KAAK,CAAC;;AAEjE,IAAA,MAAM,SAAS,GAAG,MAAM,CAAS,KAAK,CAAC;;AAEvC,IAAA,MAAM,IAAI,GAAG,MAAM,CAAW,EAAE,CAAC;AACjC,IAAA,MAAM,IAAI,GAAG,CAAC,IAAY,KAAI;AAC5B,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QACvB,QAAQ,CAAC,IAAI,CAAC;AAChB,IAAA,CAAC;IACD,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC;;;IAIhD,eAAe,CAAC,MAAK;AACnB,QAAA,IAAI,KAAK,KAAK,SAAS,CAAC,OAAO;YAAE;AACjC,QAAA,SAAS,CAAC,OAAO,GAAG,KAAK;QACzB,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;AAChD,QAAA,IAAI,YAAY,IAAI,CAAC,EAAE;;YAErB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,YAAY,GAAG,CAAC,CAAC;YACxC;QACF;;QAEA,MAAM,CAAC,MAAM,EAAE;AACf,QAAA,IAAI,CAAC,OAAO,GAAG,EAAE;QACjB,QAAQ,CAAC,KAAK,CAAC;AACjB,IAAA,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAEnB,IAAA,MAAM,MAAM,GAAG,CAAC,IAAY,KAAI;QAC9B,QAAQ,CAAC,IAAI,CAAC;QACd,MAAM,CAAC,IAAI,CAAC;AACd,IAAA,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,EAAE;IACnC,MAAM,KAAK,GAAG,MAAK;QACjB,MAAM,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,EAAE,CAAC;QACZ,IAAI,CAAC,EAAE,CAAC;AACV,IAAA,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE;AACzC;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Delays a callback until calls stop for `delay` milliseconds, so only the last of a burst runs, such as a search request
|
|
7
|
+
* after typing pauses. The returned function keeps its identity across renders and always calls the latest `callback`.
|
|
8
|
+
*
|
|
9
|
+
* @param callback - What to run with the last call's arguments once the calls stop.
|
|
10
|
+
* @param delay - How long the calls must stop for, in milliseconds.
|
|
11
|
+
* @returns The debounced function, with `flush` to run the pending call at once and `cancel` to drop it. A pending call is
|
|
12
|
+
* dropped on unmount.
|
|
13
|
+
*/
|
|
14
|
+
const useDebouncedCallback = (callback, delay = 300) => {
|
|
15
|
+
const callbackRef = React.useRef(callback);
|
|
16
|
+
callbackRef.current = callback;
|
|
17
|
+
const delayRef = React.useRef(delay);
|
|
18
|
+
delayRef.current = delay;
|
|
19
|
+
const timer = React.useRef(undefined);
|
|
20
|
+
const pending = React.useRef(undefined);
|
|
21
|
+
const debounced = React.useMemo(() => {
|
|
22
|
+
const cancel = () => {
|
|
23
|
+
clearTimeout(timer.current);
|
|
24
|
+
timer.current = undefined;
|
|
25
|
+
pending.current = undefined;
|
|
26
|
+
};
|
|
27
|
+
const flush = () => {
|
|
28
|
+
const args = pending.current;
|
|
29
|
+
cancel();
|
|
30
|
+
if (args)
|
|
31
|
+
callbackRef.current(...args);
|
|
32
|
+
};
|
|
33
|
+
const call = (...args) => {
|
|
34
|
+
pending.current = args;
|
|
35
|
+
clearTimeout(timer.current);
|
|
36
|
+
timer.current = setTimeout(flush, delayRef.current);
|
|
37
|
+
};
|
|
38
|
+
return Object.assign(call, { flush, cancel });
|
|
39
|
+
}, []);
|
|
40
|
+
React.useEffect(() => debounced.cancel, [debounced]);
|
|
41
|
+
return debounced;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.useDebouncedCallback = useDebouncedCallback;
|
|
45
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/hooks/useDebouncedCallback/index.ts"],"sourcesContent":[null],"names":["useRef","useMemo","useEffect"],"mappings":";;;;AAUA;;;;;;;;AAQG;AACI,MAAM,oBAAoB,GAAG,CAAyB,QAAiC,EAAE,KAAK,GAAG,GAAG,KAA6B;AACtI,IAAA,MAAM,WAAW,GAAGA,YAAM,CAAC,QAAQ,CAAC;AACpC,IAAA,WAAW,CAAC,OAAO,GAAG,QAAQ;AAC9B,IAAA,MAAM,QAAQ,GAAGA,YAAM,CAAC,KAAK,CAAC;AAC9B,IAAA,QAAQ,CAAC,OAAO,GAAG,KAAK;AACxB,IAAA,MAAM,KAAK,GAAGA,YAAM,CAA4C,SAAS,CAAC;AAC1E,IAAA,MAAM,OAAO,GAAGA,YAAM,CAAmB,SAAS,CAAC;AAEnD,IAAA,MAAM,SAAS,GAAGC,aAAO,CAAC,MAAK;QAC7B,MAAM,MAAM,GAAG,MAAK;AAClB,YAAA,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC;AAC3B,YAAA,KAAK,CAAC,OAAO,GAAG,SAAS;AACzB,YAAA,OAAO,CAAC,OAAO,GAAG,SAAS;AAC7B,QAAA,CAAC;QACD,MAAM,KAAK,GAAG,MAAK;AACjB,YAAA,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO;AAC5B,YAAA,MAAM,EAAE;AACR,YAAA,IAAI,IAAI;AAAE,gBAAA,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AACxC,QAAA,CAAC;AACD,QAAA,MAAM,IAAI,GAAG,CAAC,GAAG,IAAU,KAAI;AAC7B,YAAA,OAAO,CAAC,OAAO,GAAG,IAAI;AACtB,YAAA,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC;YAC3B,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;AACrD,QAAA,CAAC;AACD,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAC/C,CAAC,EAAE,EAAE,CAAC;AAEN,IAAAC,eAAS,CAAC,MAAM,SAAS,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC;AAE9C,IAAA,OAAO,SAAS;AAClB;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The debounced function, plus controls for the call it is holding back. */
|
|
2
|
+
export type DebouncedCallback<Args extends unknown[]> = ((...args: Args) => void) & {
|
|
3
|
+
/** Runs the pending call now, if there is one. */
|
|
4
|
+
flush: () => void;
|
|
5
|
+
/** Drops the pending call. */
|
|
6
|
+
cancel: () => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Delays a callback until calls stop for `delay` milliseconds, so only the last of a burst runs, such as a search request
|
|
10
|
+
* after typing pauses. The returned function keeps its identity across renders and always calls the latest `callback`.
|
|
11
|
+
*
|
|
12
|
+
* @param callback - What to run with the last call's arguments once the calls stop.
|
|
13
|
+
* @param delay - How long the calls must stop for, in milliseconds.
|
|
14
|
+
* @returns The debounced function, with `flush` to run the pending call at once and `cancel` to drop it. A pending call is
|
|
15
|
+
* dropped on unmount.
|
|
16
|
+
*/
|
|
17
|
+
export declare const useDebouncedCallback: <Args extends unknown[]>(callback: (...args: Args) => void, delay?: number) => DebouncedCallback<Args>;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDebouncedCallback/index.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,MAAM,MAAM,iBAAiB,CAAC,IAAI,SAAS,OAAO,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG;IAClF,kDAAkD;IAClD,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAAI,IAAI,SAAS,OAAO,EAAE,EAAE,UAAU,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,EAAE,cAAW,KAAG,iBAAiB,CAAC,IAAI,CA8BnI,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useRef, useMemo, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Delays a callback until calls stop for `delay` milliseconds, so only the last of a burst runs, such as a search request
|
|
5
|
+
* after typing pauses. The returned function keeps its identity across renders and always calls the latest `callback`.
|
|
6
|
+
*
|
|
7
|
+
* @param callback - What to run with the last call's arguments once the calls stop.
|
|
8
|
+
* @param delay - How long the calls must stop for, in milliseconds.
|
|
9
|
+
* @returns The debounced function, with `flush` to run the pending call at once and `cancel` to drop it. A pending call is
|
|
10
|
+
* dropped on unmount.
|
|
11
|
+
*/
|
|
12
|
+
const useDebouncedCallback = (callback, delay = 300) => {
|
|
13
|
+
const callbackRef = useRef(callback);
|
|
14
|
+
callbackRef.current = callback;
|
|
15
|
+
const delayRef = useRef(delay);
|
|
16
|
+
delayRef.current = delay;
|
|
17
|
+
const timer = useRef(undefined);
|
|
18
|
+
const pending = useRef(undefined);
|
|
19
|
+
const debounced = useMemo(() => {
|
|
20
|
+
const cancel = () => {
|
|
21
|
+
clearTimeout(timer.current);
|
|
22
|
+
timer.current = undefined;
|
|
23
|
+
pending.current = undefined;
|
|
24
|
+
};
|
|
25
|
+
const flush = () => {
|
|
26
|
+
const args = pending.current;
|
|
27
|
+
cancel();
|
|
28
|
+
if (args)
|
|
29
|
+
callbackRef.current(...args);
|
|
30
|
+
};
|
|
31
|
+
const call = (...args) => {
|
|
32
|
+
pending.current = args;
|
|
33
|
+
clearTimeout(timer.current);
|
|
34
|
+
timer.current = setTimeout(flush, delayRef.current);
|
|
35
|
+
};
|
|
36
|
+
return Object.assign(call, { flush, cancel });
|
|
37
|
+
}, []);
|
|
38
|
+
useEffect(() => debounced.cancel, [debounced]);
|
|
39
|
+
return debounced;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { useDebouncedCallback };
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/useDebouncedCallback/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAUA;;;;;;;;AAQG;AACI,MAAM,oBAAoB,GAAG,CAAyB,QAAiC,EAAE,KAAK,GAAG,GAAG,KAA6B;AACtI,IAAA,MAAM,WAAW,GAAG,MA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":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Checkbox/index.native.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAMjD,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,mEAAmE;IACnE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,oEAAoE;IACpE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uFAAuF;IACvF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2GAA2G;IAC3G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AASD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,2KAYtB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Checkbox/index.native.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAMjD,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,mEAAmE;IACnE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,oEAAoE;IACpE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uFAAuF;IACvF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2GAA2G;IAC3G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AASD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,2KAYtB,aAAa,gCAyCf,CAAC"}
|
|
@@ -32,7 +32,7 @@ const Checkbox = ({ label, hint, size = 'sm', className, isSelected: isSelectedP
|
|
|
32
32
|
setUncontrolledSelected(next);
|
|
33
33
|
onChange?.(next);
|
|
34
34
|
};
|
|
35
|
-
return (jsxs(Pressable, { testID: checkboxTestId, disabled: isDisabled, onPress: handlePress, accessibilityRole: "checkbox", hitSlop: SELECTION_CONTROL_HIT_SLOP, accessibilityLabel: getAccessibleName(ariaLabel, label), accessibilityHint: getAccessibleHint(hint), accessibilityState: { checked: isIndeterminate ? 'mixed' : isSelected, disabled: Boolean(isDisabled) }, className: cx('relative flex flex-row items-start self-start', selectionControlSizes[size].root, className), children: [
|
|
35
|
+
return (jsxs(Pressable, { testID: checkboxTestId, disabled: isDisabled, onPress: handlePress, accessibilityRole: "checkbox", hitSlop: SELECTION_CONTROL_HIT_SLOP, accessibilityLabel: getAccessibleName(ariaLabel, label), accessibilityHint: getAccessibleHint(hint), accessibilityState: { checked: isIndeterminate ? 'mixed' : isSelected, disabled: Boolean(isDisabled) }, className: cx('relative flex flex-row items-start self-start', selectionControlSizes[size].root, className), children: [jsxs(View, { className: cx('size-4 shrink-0 items-center justify-center rounded border border-primary bg-primary', size === 'md' && 'size-5 rounded-md', isFilled && 'border-brand-solid bg-brand-solid', isDisabled && 'opacity-50', isDisabled && !isFilled && 'bg-tertiary', (label || hint) && 'mt-0.5'), children: [isIndeterminate && jsx(Minus, { size: DASH_SIZE[size], color: GLYPH_COLOR, strokeWidth: GLYPH_STROKE }), !isIndeterminate && isSelected && jsx(Check, { size: CHECK_SIZE[size], color: GLYPH_COLOR, strokeWidth: GLYPH_STROKE })] }), jsx(SelectionControlText, { size: size, label: label, hint: hint })] }));
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
export { Checkbox };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/components/atoms/Checkbox/index.native.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;AAkCA;AACA,MAAM,YAAY,GAAG,EAAE,GAAG,CAAC;AAC3B,MAAM,UAAU,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAW;AAC9C,MAAM,SAAS,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAW;AAC7C;AACA,MAAM,WAAW,GAAG,SAAS;AAE7B;;;;;;AAMG;AACI,MAAM,QAAQ,GAAG,CAAC,EACvB,KAAK,EACL,IAAI,EACJ,IAAI,GAAG,IAAI,EACX,SAAS,EACT,UAAU,EAAE,cAAc,EAC1B,eAAe,GAAG,KAAK,EACvB,eAAe,EACf,UAAU,EACV,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,UAAU,GACX,KAAI;AAClB,IAAA,MAAM,cAAc,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAC3G,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC;AACjF,IAAA,MAAM,UAAU,GAAG,cAAc,IAAI,oBAAoB;AACzD,IAAA,MAAM,QAAQ,GAAG,UAAU,IAAI,eAAe;IAE9C,MAAM,WAAW,GAAG,MAAK;AACvB,QAAA,MAAM,IAAI,GAAG,CAAC,UAAU;QACxB,IAAI,cAAc,KAAK,SAAS;YAAE,uBAAuB,CAAC,IAAI,CAAC;AAC/D,QAAA,QAAQ,GAAG,IAAI,CAAC;AAClB,IAAA,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/components/atoms/Checkbox/index.native.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;AAkCA;AACA,MAAM,YAAY,GAAG,EAAE,GAAG,CAAC;AAC3B,MAAM,UAAU,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAW;AAC9C,MAAM,SAAS,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAW;AAC7C;AACA,MAAM,WAAW,GAAG,SAAS;AAE7B;;;;;;AAMG;AACI,MAAM,QAAQ,GAAG,CAAC,EACvB,KAAK,EACL,IAAI,EACJ,IAAI,GAAG,IAAI,EACX,SAAS,EACT,UAAU,EAAE,cAAc,EAC1B,eAAe,GAAG,KAAK,EACvB,eAAe,EACf,UAAU,EACV,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,UAAU,GACX,KAAI;AAClB,IAAA,MAAM,cAAc,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAC3G,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC;AACjF,IAAA,MAAM,UAAU,GAAG,cAAc,IAAI,oBAAoB;AACzD,IAAA,MAAM,QAAQ,GAAG,UAAU,IAAI,eAAe;IAE9C,MAAM,WAAW,GAAG,MAAK;AACvB,QAAA,MAAM,IAAI,GAAG,CAAC,UAAU;QACxB,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AI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAA,CAAI,CAAA,EAAA,CACpD;AAEhB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dot.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Dot/Dot.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"Dot.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Dot/Dot.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBlB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,MAAM,CAAC,KAAK,CAAC;AAChD,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,MAAM,CAAC,MAAM,CAAC;AAElD,eAAO,MAAM,aAAa,EAAiC,QAAQ,EAAE,CAAC"}
|
|
@@ -29,6 +29,7 @@ const styles = {
|
|
|
29
29
|
'fg-primary': { web: 'text-fg-primary', native: 'bg-fg-primary' },
|
|
30
30
|
'fg-quaternary': { web: 'text-fg-quaternary', native: 'bg-fg-quaternary' },
|
|
31
31
|
'fg-success-secondary': { web: 'text-fg-success-secondary', native: 'bg-fg-success-secondary' },
|
|
32
|
+
'fg-warning-secondary': { web: 'text-fg-warning-secondary', native: 'bg-fg-warning-secondary' },
|
|
32
33
|
'border-primary': { web: 'text-border-primary', native: 'bg-border-primary' },
|
|
33
34
|
'utility-neutral-500': { web: 'text-utility-neutral-500', native: 'bg-utility-neutral-500' },
|
|
34
35
|
'utility-brand-500': { web: 'text-utility-brand-500', native: 'bg-utility-brand-500' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-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
+
* Shared `Tags` style config, read by both `index.tsx` and `index.native.tsx`.
|
|
3
|
+
*
|
|
4
|
+
* Complete literal class names only — Tailwind scans source for whole candidates.
|
|
5
|
+
* `native` holds pixel sizes and light-mode hex colours that React Native needs as
|
|
6
|
+
* plain `style` / icon props (no `currentColor`, and `Text` ignores `className` under
|
|
7
|
+
* the current `react-native-css` preview).
|
|
8
|
+
*/
|
|
9
|
+
export declare const styles: {
|
|
10
|
+
sizes: {
|
|
11
|
+
sm: {
|
|
12
|
+
root: {
|
|
13
|
+
base: string;
|
|
14
|
+
withCheckbox: string;
|
|
15
|
+
withAvatar: string;
|
|
16
|
+
withDot: string;
|
|
17
|
+
withCount: string;
|
|
18
|
+
withClose: string;
|
|
19
|
+
};
|
|
20
|
+
content: string;
|
|
21
|
+
count: string;
|
|
22
|
+
};
|
|
23
|
+
md: {
|
|
24
|
+
root: {
|
|
25
|
+
base: string;
|
|
26
|
+
withCheckbox: string;
|
|
27
|
+
withAvatar: string;
|
|
28
|
+
withDot: string;
|
|
29
|
+
withCount: string;
|
|
30
|
+
withClose: string;
|
|
31
|
+
};
|
|
32
|
+
content: string;
|
|
33
|
+
count: string;
|
|
34
|
+
};
|
|
35
|
+
lg: {
|
|
36
|
+
root: {
|
|
37
|
+
base: string;
|
|
38
|
+
withCheckbox: string;
|
|
39
|
+
withAvatar: string;
|
|
40
|
+
withDot: string;
|
|
41
|
+
withCount: string;
|
|
42
|
+
withClose: string;
|
|
43
|
+
};
|
|
44
|
+
content: string;
|
|
45
|
+
count: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** Shared chrome for every tag root (size-specific padding lives under `sizes`). */
|
|
49
|
+
root: string;
|
|
50
|
+
/** Native root drops web-only focus/transition utilities and uses a border instead of an inset ring. */
|
|
51
|
+
rootNative: string;
|
|
52
|
+
close: {
|
|
53
|
+
sm: {
|
|
54
|
+
root: string;
|
|
55
|
+
icon: string;
|
|
56
|
+
};
|
|
57
|
+
md: {
|
|
58
|
+
root: string;
|
|
59
|
+
icon: string;
|
|
60
|
+
};
|
|
61
|
+
lg: {
|
|
62
|
+
root: string;
|
|
63
|
+
icon: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
checkbox: {
|
|
67
|
+
sm: {
|
|
68
|
+
root: string;
|
|
69
|
+
icon: string;
|
|
70
|
+
};
|
|
71
|
+
md: {
|
|
72
|
+
root: string;
|
|
73
|
+
icon: string;
|
|
74
|
+
};
|
|
75
|
+
lg: {
|
|
76
|
+
root: string;
|
|
77
|
+
icon: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
avatar: string;
|
|
81
|
+
count: string;
|
|
82
|
+
native: {
|
|
83
|
+
/** `text-secondary` → neutral-700 (light). */
|
|
84
|
+
labelColor: string;
|
|
85
|
+
/** `text-fg-quaternary` → neutral-400 (light) — close icon idle. */
|
|
86
|
+
closeIconColor: string;
|
|
87
|
+
/** `text-fg-quaternary_hover` → neutral-500 (light). */
|
|
88
|
+
closeIconColorPressed: string;
|
|
89
|
+
/** `text-fg-white` — checkbox glyph. */
|
|
90
|
+
checkColor: string;
|
|
91
|
+
labelText: {
|
|
92
|
+
sm: {
|
|
93
|
+
fontSize: number;
|
|
94
|
+
lineHeight: number;
|
|
95
|
+
};
|
|
96
|
+
md: {
|
|
97
|
+
fontSize: number;
|
|
98
|
+
lineHeight: number;
|
|
99
|
+
};
|
|
100
|
+
lg: {
|
|
101
|
+
fontSize: number;
|
|
102
|
+
lineHeight: number;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
countText: {
|
|
106
|
+
sm: {
|
|
107
|
+
fontSize: number;
|
|
108
|
+
lineHeight: number;
|
|
109
|
+
};
|
|
110
|
+
md: {
|
|
111
|
+
fontSize: number;
|
|
112
|
+
lineHeight: number;
|
|
113
|
+
};
|
|
114
|
+
lg: {
|
|
115
|
+
fontSize: number;
|
|
116
|
+
lineHeight: number;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
/** Tailwind `size-N` → `N * 4` px for RN icon components. */
|
|
120
|
+
closeIconSize: {
|
|
121
|
+
readonly sm: 10;
|
|
122
|
+
readonly md: 12;
|
|
123
|
+
readonly lg: 14;
|
|
124
|
+
};
|
|
125
|
+
closeIconStroke: {
|
|
126
|
+
readonly sm: 3.6;
|
|
127
|
+
readonly md: 2.86;
|
|
128
|
+
readonly lg: 3;
|
|
129
|
+
};
|
|
130
|
+
checkIconSize: {
|
|
131
|
+
readonly sm: 10;
|
|
132
|
+
readonly md: 12;
|
|
133
|
+
readonly lg: 14;
|
|
134
|
+
};
|
|
135
|
+
/** Avatar is always `size-4` / icon `size-3` on web. */
|
|
136
|
+
avatarSize: number;
|
|
137
|
+
avatarIconSize: number;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
export type TagSize = keyof typeof styles.sizes;
|
|
141
|
+
//# sourceMappingURL=Tags.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tags.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Tags/Tags.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuCjB,oFAAoF;;IAEpF,wGAAwG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAetG,8CAA8C;;QAE9C,oEAAoE;;QAEpE,wDAAwD;;QAExD,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAYxC,6DAA6D;;;;;;;;;;;;;;;;QAI7D,wDAAwD;;;;CAI3D,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,MAAM,CAAC,KAAK,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared `Tags` style config, read by both `index.tsx` and `index.native.tsx`.
|
|
3
|
+
*
|
|
4
|
+
* Complete literal class names only — Tailwind scans source for whole candidates.
|
|
5
|
+
* `native` holds pixel sizes and light-mode hex colours that React Native needs as
|
|
6
|
+
* plain `style` / icon props (no `currentColor`, and `Text` ignores `className` under
|
|
7
|
+
* the current `react-native-css` preview).
|
|
8
|
+
*/
|
|
9
|
+
const styles = {
|
|
10
|
+
sizes: {
|
|
11
|
+
sm: {
|
|
12
|
+
root: {
|
|
13
|
+
base: 'px-2 py-0.75 text-xs font-medium',
|
|
14
|
+
withCheckbox: 'pl-1.25',
|
|
15
|
+
withAvatar: 'pl-1',
|
|
16
|
+
withDot: 'pl-1.5',
|
|
17
|
+
withCount: 'pr-1',
|
|
18
|
+
withClose: 'pr-1',
|
|
19
|
+
},
|
|
20
|
+
content: 'gap-1',
|
|
21
|
+
count: 'px-1 text-xs font-medium',
|
|
22
|
+
},
|
|
23
|
+
md: {
|
|
24
|
+
root: {
|
|
25
|
+
base: 'px-2.25 py-0.5 text-sm font-medium',
|
|
26
|
+
withCheckbox: 'pl-1',
|
|
27
|
+
withAvatar: 'pl-1.25',
|
|
28
|
+
withDot: 'pl-1.75',
|
|
29
|
+
withCount: 'pr-0.75',
|
|
30
|
+
withClose: 'pr-1',
|
|
31
|
+
},
|
|
32
|
+
content: 'gap-1.25',
|
|
33
|
+
count: 'px-1.25 text-xs font-medium',
|
|
34
|
+
},
|
|
35
|
+
lg: {
|
|
36
|
+
root: {
|
|
37
|
+
base: 'px-2.5 py-1 text-sm font-medium',
|
|
38
|
+
withCheckbox: 'pl-1.25',
|
|
39
|
+
withAvatar: 'pl-1.75',
|
|
40
|
+
withDot: 'pl-2.25',
|
|
41
|
+
withCount: 'pr-1',
|
|
42
|
+
withClose: 'pr-1',
|
|
43
|
+
},
|
|
44
|
+
content: 'gap-1.5',
|
|
45
|
+
count: 'px-1.5 text-sm font-medium',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
/** Native root drops web-only focus/transition utilities and uses a border instead of an inset ring. */
|
|
49
|
+
rootNative: 'flex flex-row items-center gap-0.75 rounded-md border border-primary bg-primary',
|
|
50
|
+
close: {
|
|
51
|
+
sm: { root: 'p-0.5', icon: 'size-2.5 stroke-[3.6px]' },
|
|
52
|
+
md: { root: 'p-0.5', icon: 'size-3 stroke-[2.86px]' },
|
|
53
|
+
lg: { root: 'p-0.75', icon: 'size-3.5 stroke-3' },
|
|
54
|
+
},
|
|
55
|
+
checkbox: {
|
|
56
|
+
sm: { root: 'size-3.5', icon: 'size-2.5' },
|
|
57
|
+
md: { root: 'size-4', icon: 'size-3' },
|
|
58
|
+
lg: { root: 'size-4.5', icon: 'size-3.5' },
|
|
59
|
+
},
|
|
60
|
+
avatar: 'relative inline-flex size-4 shrink-0 items-center justify-center overflow-hidden rounded-full bg-tertiary',
|
|
61
|
+
count: 'flex items-center justify-center rounded-[3px] bg-tertiary text-center',
|
|
62
|
+
native: {
|
|
63
|
+
/** `text-secondary` → neutral-700 (light). */
|
|
64
|
+
labelColor: '#404040',
|
|
65
|
+
/** `text-fg-quaternary` → neutral-400 (light) — close icon idle. */
|
|
66
|
+
closeIconColor: '#a3a3a3',
|
|
67
|
+
/** `text-fg-quaternary_hover` → neutral-500 (light). */
|
|
68
|
+
closeIconColorPressed: '#737373',
|
|
69
|
+
/** `text-fg-white` — checkbox glyph. */
|
|
70
|
+
checkColor: '#ffffff',
|
|
71
|
+
labelText: {
|
|
72
|
+
sm: { fontSize: 12, lineHeight: 16 },
|
|
73
|
+
md: { fontSize: 14, lineHeight: 20 },
|
|
74
|
+
lg: { fontSize: 14, lineHeight: 20 },
|
|
75
|
+
},
|
|
76
|
+
countText: {
|
|
77
|
+
sm: { fontSize: 12, lineHeight: 16 },
|
|
78
|
+
md: { fontSize: 12, lineHeight: 16 },
|
|
79
|
+
lg: { fontSize: 14, lineHeight: 20 },
|
|
80
|
+
},
|
|
81
|
+
/** Tailwind `size-N` → `N * 4` px for RN icon components. */
|
|
82
|
+
closeIconSize: { sm: 10, md: 12, lg: 14 },
|
|
83
|
+
closeIconStroke: { sm: 3.6, md: 2.86, lg: 3 },
|
|
84
|
+
checkIconSize: { sm: 10, md: 12, lg: 14 },
|
|
85
|
+
/** Avatar is always `size-4` / icon `size-3` on web. */
|
|
86
|
+
avatarSize: 16,
|
|
87
|
+
avatarIconSize: 12,
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export { styles };
|
|
92
|
+
//# sourceMappingURL=Tags.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tags.styles.js","sources":["../../../../../../src/components/molecules/Tags/Tags.styles.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;AAOG;AACI,MAAM,MAAM,GAAG;AACpB,IAAA,KAAK,EAAE;AACL,QAAA,EAAE,EAAE;AACF,YAAA,IAAI,EAAE;AACJ,gBAAA,IAAI,EAAE,kCAAkC;AACxC,gBAAA,YAAY,EAAE,SAAS;AACvB,gBAAA,UAAU,EAAE,MAAM;AAClB,gBAAA,OAAO,EAAE,QAAQ;AACjB,gBAAA,SAAS,EAAE,MAAM;AACjB,gBAAA,SAAS,EAAE,MAAM;AAClB,aAAA;AACD,YAAA,OAAO,EAAE,OAAO;AAChB,YAAA,KAAK,EAAE,0BAA0B;AAClC,SAAA;AACD,QAAA,EAAE,EAAE;AACF,YAAA,IAAI,EAAE;AACJ,gBAAA,IAAI,EAAE,oCAAoC;AAC1C,gBAAA,YAAY,EAAE,MAAM;AACpB,gBAAA,UAAU,EAAE,SAAS;AACrB,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,SAAS,EAAE,MAAM;AAClB,aAAA;AACD,YAAA,OAAO,EAAE,UAAU;AACnB,YAAA,KAAK,EAAE,6BAA6B;AACrC,SAAA;AACD,QAAA,EAAE,EAAE;AACF,YAAA,IAAI,EAAE;AACJ,gBAAA,IAAI,EAAE,iCAAiC;AACvC,gBAAA,YAAY,EAAE,SAAS;AACvB,gBAAA,UAAU,EAAE,SAAS;AACrB,g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E;YACT,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;YACpC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;YACpC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;AACrC,SAAA;;AAED,QAAA,aAAa,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAW;AAClD,QAAA,eAAe,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAW;AACtD,QAAA,aAAa,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAW;;AAElD,QAAA,UAAU,EAAE,EAAE;AACd,QAAA,cAAc,EAAE,EAAE;AACnB,KAAA;;;"}
|
|
@@ -1,12 +1,99 @@
|
|
|
1
|
+
import { type DotColor } from '@flipdish/ui-library/components/atoms/Dot';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import { type TagSize } from './Tags.styles';
|
|
4
|
+
export type { DotColor } from '@flipdish/ui-library/components/atoms/Dot';
|
|
5
|
+
export type { TagSize } from './Tags.styles';
|
|
6
|
+
type SelectionMode = 'none' | 'single' | 'multiple';
|
|
7
|
+
type TagKey = string | number;
|
|
8
|
+
export interface TagItem {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
count?: number;
|
|
12
|
+
avatarSrc?: string;
|
|
13
|
+
avatarContrastBorder?: boolean;
|
|
14
|
+
dot?: boolean;
|
|
15
|
+
/** Semantic fill for the status dot; same tokens as `Dot`'s `color`. Defaults to `fg-success-secondary`. */
|
|
16
|
+
dotColor?: DotColor;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
onClose?: (id: string) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface TagAvatarProps {
|
|
21
|
+
/** Image URL; when missing or load fails, a user silhouette icon is shown. */
|
|
22
|
+
src?: string;
|
|
23
|
+
/** Accessible name for the image. */
|
|
24
|
+
alt?: string;
|
|
25
|
+
/** Thin dark outline so the avatar stays visible on light surfaces. */
|
|
26
|
+
contrastBorder?: boolean;
|
|
27
|
+
/** Layout classes merged onto the root `View`. */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
1
30
|
/**
|
|
2
|
-
* `
|
|
31
|
+
* Small round avatar at the start of a native `Tag`. Same fallback behaviour as web;
|
|
32
|
+
* contrast border uses a `border` rather than CSS `outline`.
|
|
3
33
|
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
34
|
+
* @summary small round avatar for a tag (React Native)
|
|
35
|
+
*/
|
|
36
|
+
export declare const TagAvatar: ({ src, alt, contrastBorder, className }: TagAvatarProps) => import("react").JSX.Element;
|
|
37
|
+
export interface TagGroupProps {
|
|
38
|
+
/** Accessible name of the group. */
|
|
39
|
+
label: string;
|
|
40
|
+
/** Size of every `Tag` in the group, shared through context. */
|
|
41
|
+
size?: TagSize;
|
|
42
|
+
/** `'none'` display-only; `'single'` one at a time; `'multiple'` any combination. */
|
|
43
|
+
selectionMode?: SelectionMode;
|
|
44
|
+
/** Controlled selected keys. */
|
|
45
|
+
selectedKeys?: Iterable<TagKey>;
|
|
46
|
+
/** Initial selection for uncontrolled usage. */
|
|
47
|
+
defaultSelectedKeys?: Iterable<TagKey>;
|
|
48
|
+
/** Called whenever the selection set changes. */
|
|
49
|
+
onSelectionChange?: (keys: Set<TagKey>) => void;
|
|
50
|
+
/** The `TagList` (and its `Tag` children). */
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
/** Layout classes merged onto the root `View`. */
|
|
53
|
+
className?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Overrides the derived root `testID` (defaults to `fd-tag-group`).
|
|
56
|
+
* Tags derive their ids from this prefix, so overriding it re-roots every
|
|
57
|
+
* non-overridden `Tag` beneath it.
|
|
58
|
+
*/
|
|
59
|
+
'data-testid'?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* React Native `TagGroup` — display-only, single-select, multi-select and removable
|
|
63
|
+
* tags built from `View` / `Pressable` instead of react-aria. Keyboard Backspace/Delete
|
|
64
|
+
* removal (`onRemove`) and `dotClassName` are web-only; use `onClose` per tag and
|
|
65
|
+
* `dotColor` for status-dot colour.
|
|
66
|
+
*
|
|
67
|
+
* @summary group of tags for filtering, selection or categorisation (React Native)
|
|
68
|
+
*/
|
|
69
|
+
export declare const TagGroup: ({ label, selectionMode, size, selectedKeys: selectedKeysProp, defaultSelectedKeys, onSelectionChange, children, className, "data-testid": dataTestId, }: TagGroupProps) => import("react").JSX.Element;
|
|
70
|
+
export interface TagListProps {
|
|
71
|
+
/** The `Tag` items. */
|
|
72
|
+
children?: ReactNode;
|
|
73
|
+
/** Layout classes — typically `flex flex-row flex-wrap gap-2`. */
|
|
74
|
+
className?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Horizontal wrapping row of tags inside a `TagGroup`. */
|
|
77
|
+
export declare const TagList: ({ children, className }: TagListProps) => import("react").JSX.Element;
|
|
78
|
+
export interface TagProps extends Omit<TagItem, 'label' | 'id'> {
|
|
79
|
+
/** Stable id used for selection, removal and the derived `testID`. */
|
|
80
|
+
id: TagKey;
|
|
81
|
+
/** Tag label — strings are wrapped in `Text`; other nodes render as-is. */
|
|
82
|
+
children?: ReactNode;
|
|
83
|
+
/** Layout classes merged onto the root. */
|
|
84
|
+
className?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Overrides the derived `testID` for this tag (defaults to
|
|
87
|
+
* `<root>--tag-<slug>`, slugified from `id`).
|
|
88
|
+
*/
|
|
89
|
+
'data-testid'?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* React Native `Tag` — optional avatar or status dot, count, selection checkbox and
|
|
93
|
+
* remove button. Selection and close use `Pressable`; label colour is a light-mode hex
|
|
94
|
+
* because `Text` ignores `className` under the current `react-native-css` preview.
|
|
8
95
|
*
|
|
9
|
-
*
|
|
10
|
-
* its `index.tsx` — the build picks it up automatically and this stub disappears.
|
|
96
|
+
* @summary single tag with optional adornments and selection (React Native)
|
|
11
97
|
*/
|
|
12
|
-
export declare const
|
|
98
|
+
export declare const Tag: ({ id, avatarSrc, avatarContrastBorder, dot, dotColor, isDisabled, count, className, children, onClose, "data-testid": dataTestId, }: TagProps) => import("react").JSX.Element;
|
|
99
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Tags/index.native.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAG/E,OAAO,EAAiB,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAKrD,YAAY,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAC1E,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,KAAK,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AACpD,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9B,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,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