@flipdish/ui-library 0.34.2 → 0.35.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/__internal__/popover/ScrollClosingPopover.cjs +26 -0
- package/dist/components/__internal__/popover/ScrollClosingPopover.cjs.map +1 -0
- package/dist/components/__internal__/popover/ScrollClosingPopover.d.ts +7 -0
- package/dist/components/__internal__/popover/ScrollClosingPopover.d.ts.map +1 -0
- package/dist/components/__internal__/popover/ScrollClosingPopover.js +24 -0
- package/dist/components/__internal__/popover/ScrollClosingPopover.js.map +1 -0
- package/dist/components/__internal__/popover/hooks/useCloseOnTriggerScroll.cjs +33 -0
- package/dist/components/__internal__/popover/hooks/useCloseOnTriggerScroll.cjs.map +1 -0
- package/dist/components/__internal__/popover/hooks/useCloseOnTriggerScroll.d.ts +22 -0
- package/dist/components/__internal__/popover/hooks/useCloseOnTriggerScroll.d.ts.map +1 -0
- package/dist/components/__internal__/popover/hooks/useCloseOnTriggerScroll.js +31 -0
- package/dist/components/__internal__/popover/hooks/useCloseOnTriggerScroll.js.map +1 -0
- package/dist/components/molecules/Dropdown/index.cjs +2 -1
- package/dist/components/molecules/Dropdown/index.cjs.map +1 -1
- package/dist/components/molecules/Dropdown/index.js +3 -2
- package/dist/components/molecules/Dropdown/index.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.cjs +6 -10
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.d.ts +13 -5
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.js +6 -10
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.js.map +1 -1
- package/dist/components/molecules/RadioGroup/hooks/useCommitOnPress.cjs +128 -0
- package/dist/components/molecules/RadioGroup/hooks/useCommitOnPress.cjs.map +1 -0
- package/dist/components/molecules/RadioGroup/hooks/useCommitOnPress.d.ts +70 -0
- package/dist/components/molecules/RadioGroup/hooks/useCommitOnPress.d.ts.map +1 -0
- package/dist/components/molecules/RadioGroup/hooks/useCommitOnPress.js +123 -0
- package/dist/components/molecules/RadioGroup/hooks/useCommitOnPress.js.map +1 -0
- package/dist/components/molecules/RadioGroup/index.d.ts +1 -1
- package/dist/components/molecules/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/radioGroup.types.d.ts +9 -0
- package/dist/components/molecules/RadioGroup/radioGroup.types.d.ts.map +1 -1
- package/dist/components/molecules/Select/components/MultiSelect.cjs +2 -1
- package/dist/components/molecules/Select/components/MultiSelect.cjs.map +1 -1
- package/dist/components/molecules/Select/components/MultiSelect.js +3 -2
- package/dist/components/molecules/Select/components/MultiSelect.js.map +1 -1
- package/dist/components/molecules/Select/components/Popover.cjs +2 -2
- package/dist/components/molecules/Select/components/Popover.cjs.map +1 -1
- package/dist/components/molecules/Select/components/Popover.js +2 -2
- package/dist/components/molecules/Select/components/Popover.js.map +1 -1
- package/dist/components/organisms/DatePicker/components/DateRangePicker.cjs +2 -1
- package/dist/components/organisms/DatePicker/components/DateRangePicker.cjs.map +1 -1
- package/dist/components/organisms/DatePicker/components/DateRangePicker.d.ts.map +1 -1
- package/dist/components/organisms/DatePicker/components/DateRangePicker.js +3 -2
- package/dist/components/organisms/DatePicker/components/DateRangePicker.js.map +1 -1
- package/dist/components/organisms/DatePicker/index.cjs +2 -1
- package/dist/components/organisms/DatePicker/index.cjs.map +1 -1
- package/dist/components/organisms/DatePicker/index.d.ts.map +1 -1
- package/dist/components/organisms/DatePicker/index.js +3 -2
- package/dist/components/organisms/DatePicker/index.js.map +1 -1
- package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.cjs +2 -1
- package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.cjs.map +1 -1
- package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.d.ts.map +1 -1
- package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.js +3 -2
- package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.js.map +1 -1
- package/dist/utilities/__internal__/scrollUtils/scroll.utils.cjs +23 -0
- package/dist/utilities/__internal__/scrollUtils/scroll.utils.cjs.map +1 -0
- package/dist/utilities/__internal__/scrollUtils/scroll.utils.d.ts +11 -0
- package/dist/utilities/__internal__/scrollUtils/scroll.utils.d.ts.map +1 -0
- package/dist/utilities/__internal__/scrollUtils/scroll.utils.js +21 -0
- package/dist/utilities/__internal__/scrollUtils/scroll.utils.js.map +1 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/DatePicker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAOxF,OAAO,KAAK,EAAE,eAAe,IAAI,mBAAmB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/DatePicker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAOxF,OAAO,KAAK,EAAE,eAAe,IAAI,mBAAmB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAK/F,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAIpF,MAAM,WAAW,eAAgB,SAAQ,mBAAmB,CAAC,SAAS,CAAC;IACrE,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,sHAAsH;IACtH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,0HAUxB,eAAe,gCAgGjB,CAAC"}
|
|
@@ -7,7 +7,8 @@ import { today, getLocalTimeZone } from '@internationalized/date';
|
|
|
7
7
|
import { useDateFormatter } from '@react-aria/i18n';
|
|
8
8
|
import { useControlledState } from '@react-stately/utils';
|
|
9
9
|
import { useState } from 'react';
|
|
10
|
-
import { DatePicker as DatePicker$1, Group,
|
|
10
|
+
import { DatePicker as DatePicker$1, Group, Dialog } from 'react-aria-components';
|
|
11
|
+
import { ScrollClosingPopover } from '../../__internal__/popover/ScrollClosingPopover.js';
|
|
11
12
|
import { Calendar as Calendar$1 } from './components/Calendar.js';
|
|
12
13
|
export { DateRangePicker } from './components/DateRangePicker.js';
|
|
13
14
|
export { RangeCalendar } from './components/RangeCalendar.js';
|
|
@@ -41,7 +42,7 @@ const DatePicker = ({ value: valueProp, defaultValue, onChange, onApply, onCance
|
|
|
41
42
|
setDraftValue(value);
|
|
42
43
|
}
|
|
43
44
|
onOpenChange?.(isOpen);
|
|
44
|
-
}, "data-testid": rootTestId, children: [jsx(Group, { children: jsx(Button, { size: size, color: "secondary", iconLeading: Calendar, "data-testid": joinTestId(rootTestId, 'trigger'), children: formattedDate }) }), jsx(
|
|
45
|
+
}, "data-testid": rootTestId, children: [jsx(Group, { children: jsx(Button, { size: size, color: "secondary", iconLeading: Calendar, "data-testid": joinTestId(rootTestId, 'trigger'), children: formattedDate }) }), jsx(ScrollClosingPopover, { offset: 8, placement: "bottom right", className: ({ isEntering, isExiting }) => cx('origin-(--trigger-anchor-point) will-change-transform', isEntering &&
|
|
45
46
|
'duration-150 ease-out animate-in fade-in placement-right:slide-in-from-left-0.5 placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5', isExiting &&
|
|
46
47
|
'duration-100 ease-in animate-out fade-out placement-right:slide-out-to-left-0.5 placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5'), children: jsx(Dialog, { "aria-label": "Date picker", "data-testid": joinTestId(rootTestId, 'popover'), className: "rounded-2xl bg-primary shadow-xl ring ring-secondary_alt", children: ({ close }) => (jsxs(Fragment, { children: [jsx("div", { className: "flex px-6 py-5", children: jsx(Calendar$1, { highlightedDates: highlightedDates }) }), jsxs("div", { className: "grid grid-cols-2 gap-3 border-t border-secondary p-4", children: [jsx(Button, { size: "md", color: "secondary", "data-testid": joinTestId(rootTestId, 'cancel'), onClick: () => {
|
|
47
48
|
onCancel?.();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/organisms/DatePicker/index.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","AriaDatePicker","AriaGroup","CalendarIcon","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/organisms/DatePicker/index.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","AriaDatePicker","AriaGroup","CalendarIcon","AriaDialog","_Fragment","Calendar"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAapD;;;;;AAKG;AACI,MAAM,UAAU,GAAG,CAAC,EACzB,KAAK,EAAE,SAAS,EAChB,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,IAAI,GAAG,IAAI,EACX,aAAa,EAAE,UAAU,EACzB,GAAG,KAAK,EACQ,KAAI;IACpB,MAAM,SAAS,GAAG,gBAAgB,CAAC;AACjC,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,GAAG,EAAE,SAAS;AACd,QAAA,IAAI,EAAE,SAAS;AAChB,KAAA,CAAC;;;;;AAKF,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,kBAAkB,CAAC,SAAS,EAAE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S;AACP,wBAAA,6JAA6J,CAChK,EAAA,QAAA,EAGHA,GAAA,CAACK,MAAU,EAAA,EAAA,YAAA,EACE,aAAa,EAAA,aAAA,EACX,UAAU,CAAC,UAAU,EAAE,SAAS,CAAC,EAC9C,SAAS,EAAC,0DAA0D,EAAA,QAAA,EAEnE,CAAC,EAAE,KAAK,EAAE,MACTJ,IAAA,CAAAK,QAAA,EAAA,EAAA,QAAA,EAAA,CACEN,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,gBAAgB,EAAA,QAAA,EAC7BA,GAAA,CAACO,UAAQ,EAAA,EAAC,gBAAgB,EAAE,gBAAgB,EAAA,CAAI,GAC5C,EACNN,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,sDAAsD,EAAA,QAAA,EAAA,CACnED,GAAA,CAAC,MAAM,IACL,IAAI,EAAC,IAAI,EACT,KAAK,EAAC,WAAW,EAAA,aAAA,EACJ,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,EAC7C,OAAO,EAAE,MAAK;gDACZ,QAAQ,IAAI;AACZ,gDAAA,KAAK,EAAE;4CACT,CAAC,EAAA,QAAA,EAAA,QAAA,EAAA,CAGM,EACTA,GAAA,CAAC,MAAM,IACL,IAAI,EAAC,IAAI,EACT,KAAK,EAAC,SAAS,EAAA,aAAA,EACF,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,EAC5C,OAAO,EAAE,MAAK;gDACZ,QAAQ,CAAC,UAAU,CAAC;gDACpB,OAAO,IAAI;AACX,gDAAA,KAAK,EAAE;4CACT,CAAC,EAAA,QAAA,EAAA,OAAA,EAAA,CAGM,IACL,CAAA,EAAA,CACL,CACJ,GACU,EAAA,CACQ,CAAA,EAAA,CACR,EAAA,CACF;AAErB;;"}
|
|
@@ -6,6 +6,7 @@ var Button = require('@flipdish/ui-library/components/atoms/Button');
|
|
|
6
6
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
7
7
|
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
8
8
|
var reactAriaComponents = require('react-aria-components');
|
|
9
|
+
var ScrollClosingPopover = require('../../../__internal__/popover/ScrollClosingPopover.cjs');
|
|
9
10
|
|
|
10
11
|
const FilterDialog = ({ children, onApply, onClearAll, className }) => {
|
|
11
12
|
const prefix = testIdUtils.useTestIdPrefix();
|
|
@@ -22,7 +23,7 @@ const FilterDropdown = ({ appliedCount, onApply, onClearAll, isDisabled, classNa
|
|
|
22
23
|
const hasApplied = appliedCount != null && appliedCount > 0;
|
|
23
24
|
const prefix = testIdUtils.useTestIdPrefix();
|
|
24
25
|
const triggerTestId = prefix ? testIdUtils.joinTestId(prefix, 'trigger') : undefined;
|
|
25
|
-
return (jsxRuntime.jsxs(reactAriaComponents.DialogTrigger, { children: [trigger ?? (jsxRuntime.jsx(Button.Button, { color: "secondary", size: "sm", iconLeading: uiIcons.FilterLines, iconTrailing: uiIcons.ChevronDown, isDisabled: isDisabled, "data-testid": triggerTestId, className: cx.cx('max-h-9', hasApplied && 'bg-primary_hover', className), children: jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: ["Filters", hasApplied && jsxRuntime.jsx(CountBadge, { count: appliedCount })] }) })), jsxRuntime.jsx(
|
|
26
|
+
return (jsxRuntime.jsxs(reactAriaComponents.DialogTrigger, { children: [trigger ?? (jsxRuntime.jsx(Button.Button, { color: "secondary", size: "sm", iconLeading: uiIcons.FilterLines, iconTrailing: uiIcons.ChevronDown, isDisabled: isDisabled, "data-testid": triggerTestId, className: cx.cx('max-h-9', hasApplied && 'bg-primary_hover', className), children: jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: ["Filters", hasApplied && jsxRuntime.jsx(CountBadge, { count: appliedCount })] }) })), jsxRuntime.jsx(ScrollClosingPopover.ScrollClosingPopover, { placement: placement, offset: 4, containerPadding: 0, className: (state) => cx.cx('origin-(--trigger-anchor-point) will-change-transform md:w-170', state.isEntering &&
|
|
26
27
|
'duration-150 ease-out animate-in fade-in placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5', state.isExiting &&
|
|
27
28
|
'duration-100 ease-in animate-out fade-out placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5'), children: jsxRuntime.jsx(FilterDialog, { onApply: onApply, onClearAll: onClearAll, children: children }) })] }));
|
|
28
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterDropdownMenu.cjs","sources":["../../../../../src/components/organisms/FilterBar/components/FilterDropdownMenu.tsx"],"sourcesContent":[null],"names":["useTestIdPrefix","joinTestId","_jsx","AriaDialog","cx","_jsxs","_Fragment","Button","AriaDialogTrigger","FilterLines","ChevronDown","
|
|
1
|
+
{"version":3,"file":"FilterDropdownMenu.cjs","sources":["../../../../../src/components/organisms/FilterBar/components/FilterDropdownMenu.tsx"],"sourcesContent":[null],"names":["useTestIdPrefix","joinTestId","_jsx","AriaDialog","cx","_jsxs","_Fragment","Button","AriaDialogTrigger","FilterLines","ChevronDown","ScrollClosingPopover"],"mappings":";;;;;;;;;;AAqBO,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAqB,KAAI;AAC9F,IAAA,MAAM,MAAM,GAAGA,2BAAe,EAAE;AAChC,IAAA,MAAM,YAAY,GAAG,MAAM,GAAGC,sBAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAAS;AACtE,IAAA,MAAM,WAAW,GAAG,MAAM,GAAGA,sBAAU,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;AACpE,IAAA,MAAM,WAAW,GAAG,MAAM,GAAGA,sBAAU,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;AAEpE,IAAA,QACEC,cAAA,CAACC,0BAAU,EAAA,EAAA,aAAA,EACI,YAAY,EACzB,SAAS,EAAEC,KAAE,CAAC,0FAA0F,EAAE,SAAS,CAAC,YAEnH,CAAC,EAAE,KAAK,EAAE,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AAW,EACjB,IAAI,EAAC,IAAI,EACT,WAAW,EAAEE,mBAAW,EACxB,YAAY,EAAEC,mBAAW,EACzB,UAAU,EAAE,UAAU,EAAA,aAAA,EACT,aAAa,EAC1B,SAAS,EAAEN,KAAE,CAAC,SAAS,EAAE,UAAU,IAAI,kBAAkB,EAAE,SAAS,CAAC,EAAA,QAAA,EAErEC,0BAAM,SAAS,EAAC,2BAA2B,EAAA,QAAA,EAAA,CAAA,SAAA,EAExC,UAAU,IAAIH,cAAA,CAAC,UAAU,IAAC,KAAK,EAAE,YAAY,EAAA,CAAI,CAAA,EAAA,CAC7C,GACA,CACV,EACDA,eAACS,yCAAoB,EAAA,EACnB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,CAAC,EACT,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,CAAC,KAAK,KACfP,KAAE,CACA,gEAAgE,EAChE,KAAK,CAAC,UAAU;oBACd,wHAAwH,EAC1H,KAAK,CAAC,SAAS;AACb,oBAAA,uHAAuH,CAC1H,EAAA,QAAA,EAGHF,cAAA,CAAC,YAAY,EAAA,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAA,QAAA,EACnD,QAAQ,GACI,EAAA,CACM,CAAA,EAAA,CACL;AAExB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterDropdownMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/FilterBar/components/FilterDropdownMenu.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterDropdownMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/FilterBar/components/FilterDropdownMenu.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,iBAAiB;IAChC,6GAA6G;IAC7G,QAAQ,EAAE,SAAS,CAAC;IACpB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,oGAAoG;IACpG,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,GAAI,8CAA8C,iBAAiB,gCAmC3F,CAAC;AAEF,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,oGAAoG;IACpG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,QAAQ,GAAG,cAAc,GAAG,YAAY,CAAC;IACrD,oFAAoF;IACpF,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,GAAI,sBAAsB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,gCASrF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,6FAS5B,mBAAmB,gCA4CrB,CAAC"}
|
|
@@ -3,7 +3,8 @@ import { ChevronDown, FilterLines } from '@flipdish/ui-icons';
|
|
|
3
3
|
import { Button } from '@flipdish/ui-library/components/atoms/Button';
|
|
4
4
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
5
|
import { useTestIdPrefix, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
6
|
-
import { DialogTrigger,
|
|
6
|
+
import { DialogTrigger, Dialog } from 'react-aria-components';
|
|
7
|
+
import { ScrollClosingPopover } from '../../../__internal__/popover/ScrollClosingPopover.js';
|
|
7
8
|
|
|
8
9
|
const FilterDialog = ({ children, onApply, onClearAll, className }) => {
|
|
9
10
|
const prefix = useTestIdPrefix();
|
|
@@ -20,7 +21,7 @@ const FilterDropdown = ({ appliedCount, onApply, onClearAll, isDisabled, classNa
|
|
|
20
21
|
const hasApplied = appliedCount != null && appliedCount > 0;
|
|
21
22
|
const prefix = useTestIdPrefix();
|
|
22
23
|
const triggerTestId = prefix ? joinTestId(prefix, 'trigger') : undefined;
|
|
23
|
-
return (jsxs(DialogTrigger, { children: [trigger ?? (jsx(Button, { color: "secondary", size: "sm", iconLeading: FilterLines, iconTrailing: ChevronDown, isDisabled: isDisabled, "data-testid": triggerTestId, className: cx('max-h-9', hasApplied && 'bg-primary_hover', className), children: jsxs("span", { className: "flex items-center gap-1.5", children: ["Filters", hasApplied && jsx(CountBadge, { count: appliedCount })] }) })), jsx(
|
|
24
|
+
return (jsxs(DialogTrigger, { children: [trigger ?? (jsx(Button, { color: "secondary", size: "sm", iconLeading: FilterLines, iconTrailing: ChevronDown, isDisabled: isDisabled, "data-testid": triggerTestId, className: cx('max-h-9', hasApplied && 'bg-primary_hover', className), children: jsxs("span", { className: "flex items-center gap-1.5", children: ["Filters", hasApplied && jsx(CountBadge, { count: appliedCount })] }) })), jsx(ScrollClosingPopover, { placement: placement, offset: 4, containerPadding: 0, className: (state) => cx('origin-(--trigger-anchor-point) will-change-transform md:w-170', state.isEntering &&
|
|
24
25
|
'duration-150 ease-out animate-in fade-in placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5', state.isExiting &&
|
|
25
26
|
'duration-100 ease-in animate-out fade-out placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5'), children: jsx(FilterDialog, { onApply: onApply, onClearAll: onClearAll, children: children }) })] }));
|
|
26
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterDropdownMenu.js","sources":["../../../../../src/components/organisms/FilterBar/components/FilterDropdownMenu.tsx"],"sourcesContent":[null],"names":["_jsx","AriaDialog","_jsxs","_Fragment","AriaDialogTrigger"
|
|
1
|
+
{"version":3,"file":"FilterDropdownMenu.js","sources":["../../../../../src/components/organisms/FilterBar/components/FilterDropdownMenu.tsx"],"sourcesContent":[null],"names":["_jsx","AriaDialog","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AAA,EAGHA,GAAA,CAAC,YAAY,EAAA,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAA,QAAA,EACnD,QAAQ,GACI,EAAA,CACM,CAAA,EAAA,CACL;AAExB;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Subscribes to scroll events from any container that holds `target`, the document included, and
|
|
5
|
+
* ignores scrolls elsewhere such as a list inside a popover. Listens in the capture phase because
|
|
6
|
+
* scroll events do not bubble.
|
|
7
|
+
*
|
|
8
|
+
* @param target The element whose scroll ancestors are watched.
|
|
9
|
+
* @param onScroll Called once per qualifying scroll event.
|
|
10
|
+
* @returns Removes the subscription.
|
|
11
|
+
*/
|
|
12
|
+
const subscribeToAncestorScroll = (target, onScroll) => {
|
|
13
|
+
const handleScroll = (event) => {
|
|
14
|
+
if (!(event.target instanceof Node) || !event.target.contains(target))
|
|
15
|
+
return;
|
|
16
|
+
onScroll();
|
|
17
|
+
};
|
|
18
|
+
window.addEventListener('scroll', handleScroll, true);
|
|
19
|
+
return () => window.removeEventListener('scroll', handleScroll, true);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.subscribeToAncestorScroll = subscribeToAncestorScroll;
|
|
23
|
+
//# sourceMappingURL=scroll.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.utils.cjs","sources":["../../../../src/utilities/__internal__/scrollUtils/scroll.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;;;;;;AAQG;MACU,yBAAyB,GAAG,CAAC,MAAe,EAAE,QAAoB,KAAkB;AAC/F,IAAA,MAAM,YAAY,GAAG,CAAC,KAAY,KAAI;AACpC,QAAA,IAAI,EAAE,KAAK,CAAC,MAAM,YAAY,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE;AACvE,QAAA,QAAQ,EAAE;AACZ,IAAA,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,CAAC;AACrD,IAAA,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,CAAC;AACvE;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subscribes to scroll events from any container that holds `target`, the document included, and
|
|
3
|
+
* ignores scrolls elsewhere such as a list inside a popover. Listens in the capture phase because
|
|
4
|
+
* scroll events do not bubble.
|
|
5
|
+
*
|
|
6
|
+
* @param target The element whose scroll ancestors are watched.
|
|
7
|
+
* @param onScroll Called once per qualifying scroll event.
|
|
8
|
+
* @returns Removes the subscription.
|
|
9
|
+
*/
|
|
10
|
+
export declare const subscribeToAncestorScroll: (target: Element, onScroll: () => void) => (() => void);
|
|
11
|
+
//# sourceMappingURL=scroll.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.utils.d.ts","sourceRoot":"","sources":["../../../../src/utilities/__internal__/scrollUtils/scroll.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,GAAI,QAAQ,OAAO,EAAE,UAAU,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAQ5F,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subscribes to scroll events from any container that holds `target`, the document included, and
|
|
3
|
+
* ignores scrolls elsewhere such as a list inside a popover. Listens in the capture phase because
|
|
4
|
+
* scroll events do not bubble.
|
|
5
|
+
*
|
|
6
|
+
* @param target The element whose scroll ancestors are watched.
|
|
7
|
+
* @param onScroll Called once per qualifying scroll event.
|
|
8
|
+
* @returns Removes the subscription.
|
|
9
|
+
*/
|
|
10
|
+
const subscribeToAncestorScroll = (target, onScroll) => {
|
|
11
|
+
const handleScroll = (event) => {
|
|
12
|
+
if (!(event.target instanceof Node) || !event.target.contains(target))
|
|
13
|
+
return;
|
|
14
|
+
onScroll();
|
|
15
|
+
};
|
|
16
|
+
window.addEventListener('scroll', handleScroll, true);
|
|
17
|
+
return () => window.removeEventListener('scroll', handleScroll, true);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { subscribeToAncestorScroll };
|
|
21
|
+
//# sourceMappingURL=scroll.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.utils.js","sources":["../../../../src/utilities/__internal__/scrollUtils/scroll.utils.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;AAQG;MACU,yBAAyB,GAAG,CAAC,MAAe,EAAE,QAAoB,KAAkB;AAC/F,IAAA,MAAM,YAAY,GAAG,CAAC,KAAY,KAAI;AACpC,QAAA,IAAI,EAAE,KAAK,CAAC,MAAM,YAAY,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE;AACvE,QAAA,QAAQ,EAAE;AACZ,IAAA,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,CAAC;AACrD,IAAA,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,CAAC;AACvE;;"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flipdish/ui-library",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Flipdish Design System — atomic-design component library (Tailwind v4 + UntitledUI + React Aria).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"imports": {
|
|
7
|
-
"#internal/components/*": "./src/components/__internal__
|
|
8
|
-
"#internal/hooks/*": "./src/hooks/__internal__
|
|
9
|
-
"#internal/utilities/*": "./src/utilities/__internal__
|
|
7
|
+
"#internal/components/*": "./src/components/__internal__/*",
|
|
8
|
+
"#internal/hooks/*": "./src/hooks/__internal__/*",
|
|
9
|
+
"#internal/utilities/*": "./src/utilities/__internal__/*"
|
|
10
10
|
},
|
|
11
11
|
"sideEffects": [
|
|
12
12
|
"*.css"
|