@activecollab/components 2.0.194 → 2.0.196
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/cjs/components/Display/DisplayCurrency.js +1 -1
- package/dist/cjs/components/Display/DisplayCurrency.js.map +1 -1
- package/dist/cjs/components/Display/DisplayNumber.js +1 -1
- package/dist/cjs/components/Display/DisplayNumber.js.map +1 -1
- package/dist/cjs/components/Sort/Sort.js +92 -0
- package/dist/cjs/components/Sort/Sort.js.map +1 -0
- package/dist/cjs/components/Sort/Styles.js +95 -0
- package/dist/cjs/components/Sort/Styles.js.map +1 -0
- package/dist/cjs/components/Sort/index.js +17 -0
- package/dist/cjs/components/Sort/index.js.map +1 -0
- package/dist/cjs/components/index.js +11 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/esm/components/Display/DisplayCurrency.d.ts.map +1 -1
- package/dist/esm/components/Display/DisplayCurrency.js +1 -1
- package/dist/esm/components/Display/DisplayCurrency.js.map +1 -1
- package/dist/esm/components/Display/DisplayNumber.d.ts.map +1 -1
- package/dist/esm/components/Display/DisplayNumber.js +1 -1
- package/dist/esm/components/Display/DisplayNumber.js.map +1 -1
- package/dist/esm/components/Sort/Sort.d.ts +23 -0
- package/dist/esm/components/Sort/Sort.d.ts.map +1 -0
- package/dist/esm/components/Sort/Sort.js +71 -0
- package/dist/esm/components/Sort/Sort.js.map +1 -0
- package/dist/esm/components/Sort/Styles.d.ts +30 -0
- package/dist/esm/components/Sort/Styles.d.ts.map +1 -0
- package/dist/esm/components/Sort/Styles.js +85 -0
- package/dist/esm/components/Sort/Styles.js.map +1 -0
- package/dist/esm/components/Sort/index.d.ts +2 -0
- package/dist/esm/components/Sort/index.d.ts.map +1 -0
- package/dist/esm/components/Sort/index.js +2 -0
- package/dist/esm/components/Sort/index.js.map +1 -0
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/index.js +171 -13
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ElementWithRef } from "../Select";
|
|
3
|
+
export type SortDirections = "asc" | "desc";
|
|
4
|
+
export type SortOption = {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
defaultDirection: SortDirections;
|
|
8
|
+
};
|
|
9
|
+
export type SortObj = {
|
|
10
|
+
sortBy: string;
|
|
11
|
+
sortDirection: SortDirections;
|
|
12
|
+
};
|
|
13
|
+
export interface SortProps {
|
|
14
|
+
label: string;
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
options: SortOption[];
|
|
17
|
+
selected: SortObj;
|
|
18
|
+
onChange: (sort: SortObj) => void;
|
|
19
|
+
target?: ElementWithRef<Element>;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const Sort: React.FC<SortProps>;
|
|
23
|
+
//# sourceMappingURL=Sort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sort.d.ts","sourceRoot":"","sources":["../../../../src/components/Sort/Sort.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAc9D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,cAAc,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,cAAc,CAAA;CAAE,CAAC;AAExE,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAwFpC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { useCallback, useMemo, useState } from "react";
|
|
2
|
+
import { StyledIconButton, StyledList, StyledListItem, StyledListItemName, StyledSortIcon, StyledSortIconDown, StyledSortIconUp, StyledSortWrapper, StyledValueButton } from "./Styles";
|
|
3
|
+
import { Menu } from "../Menu";
|
|
4
|
+
export const Sort = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
label,
|
|
7
|
+
icon,
|
|
8
|
+
options,
|
|
9
|
+
selected,
|
|
10
|
+
onChange,
|
|
11
|
+
target,
|
|
12
|
+
className
|
|
13
|
+
} = _ref;
|
|
14
|
+
const [open, setOpen] = useState(false);
|
|
15
|
+
const handleClose = useCallback(() => setOpen(false), []);
|
|
16
|
+
const handleOpen = useCallback(() => setOpen(true), []);
|
|
17
|
+
const handleOnChange = useCallback(event => {
|
|
18
|
+
const nextSortBy = event.currentTarget.dataset.id;
|
|
19
|
+
let nextOrder = selected.sortDirection === "desc" ? "asc" : "desc";
|
|
20
|
+
if (nextSortBy !== selected.sortBy) {
|
|
21
|
+
var _options$find;
|
|
22
|
+
nextOrder = ((_options$find = options.find(opt => opt.id === nextSortBy)) == null ? void 0 : _options$find.defaultDirection) || "asc";
|
|
23
|
+
}
|
|
24
|
+
onChange({
|
|
25
|
+
sortBy: nextSortBy,
|
|
26
|
+
sortDirection: nextOrder
|
|
27
|
+
});
|
|
28
|
+
}, [onChange, selected, options]);
|
|
29
|
+
const labelText = useMemo(() => {
|
|
30
|
+
var _options$find$name, _options$find2;
|
|
31
|
+
return (_options$find$name = (_options$find2 = options.find(opt => opt.id === selected.sortBy)) == null ? void 0 : _options$find2.name) != null ? _options$find$name : "";
|
|
32
|
+
}, [selected.sortBy, options]);
|
|
33
|
+
if (!labelText) {
|
|
34
|
+
console.warn("Cannot find selected id in options.");
|
|
35
|
+
}
|
|
36
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
37
|
+
onOpen: handleOpen,
|
|
38
|
+
onClose: handleClose,
|
|
39
|
+
position: "bottom-end",
|
|
40
|
+
target: target || /*#__PURE__*/React.createElement(StyledSortWrapper, {
|
|
41
|
+
className: className
|
|
42
|
+
}, /*#__PURE__*/React.createElement(StyledValueButton, {
|
|
43
|
+
active: open,
|
|
44
|
+
value: labelText,
|
|
45
|
+
label: label,
|
|
46
|
+
"data-testid": "sort-button"
|
|
47
|
+
}), /*#__PURE__*/React.createElement(StyledIconButton, {
|
|
48
|
+
active: open,
|
|
49
|
+
variant: "text gray",
|
|
50
|
+
"data-testid": "sort-icon-button"
|
|
51
|
+
}, icon || /*#__PURE__*/React.createElement(StyledSortIcon, null)))
|
|
52
|
+
}, /*#__PURE__*/React.createElement(StyledList, null, options.map(_ref2 => {
|
|
53
|
+
let {
|
|
54
|
+
id,
|
|
55
|
+
name,
|
|
56
|
+
defaultDirection
|
|
57
|
+
} = _ref2;
|
|
58
|
+
let showDownArrow = selected.sortDirection === "asc";
|
|
59
|
+
if (selected.sortBy !== id) {
|
|
60
|
+
showDownArrow = defaultDirection === "asc";
|
|
61
|
+
}
|
|
62
|
+
return /*#__PURE__*/React.createElement(StyledListItem, {
|
|
63
|
+
key: id,
|
|
64
|
+
onClick: handleOnChange,
|
|
65
|
+
"data-id": id,
|
|
66
|
+
"data-testid": id,
|
|
67
|
+
$active: id === selected.sortBy
|
|
68
|
+
}, /*#__PURE__*/React.createElement(StyledListItemName, null, name), showDownArrow ? /*#__PURE__*/React.createElement(StyledSortIconDown, null) : /*#__PURE__*/React.createElement(StyledSortIconUp, null));
|
|
69
|
+
})));
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=Sort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sort.js","names":["React","useCallback","useMemo","useState","StyledIconButton","StyledList","StyledListItem","StyledListItemName","StyledSortIcon","StyledSortIconDown","StyledSortIconUp","StyledSortWrapper","StyledValueButton","Menu","Sort","_ref","label","icon","options","selected","onChange","target","className","open","setOpen","handleClose","handleOpen","handleOnChange","event","nextSortBy","currentTarget","dataset","id","nextOrder","sortDirection","sortBy","_options$find","find","opt","defaultDirection","labelText","_options$find$name","_options$find2","name","console","warn","createElement","onOpen","onClose","position","active","value","variant","map","_ref2","showDownArrow","key","onClick","$active"],"sources":["../../../../src/components/Sort/Sort.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from \"react\";\n\nimport {\n StyledIconButton,\n StyledList,\n StyledListItem,\n StyledListItemName,\n StyledSortIcon,\n StyledSortIconDown,\n StyledSortIconUp,\n StyledSortWrapper,\n StyledValueButton,\n} from \"./Styles\";\nimport { Menu } from \"../Menu\";\nimport { ElementWithRef } from \"../Select\";\n\nexport type SortDirections = \"asc\" | \"desc\";\n\nexport type SortOption = {\n id: string;\n name: string;\n defaultDirection: SortDirections;\n};\n\nexport type SortObj = { sortBy: string; sortDirection: SortDirections };\n\nexport interface SortProps {\n label: string;\n icon?: React.ReactNode;\n options: SortOption[];\n selected: SortObj;\n onChange: (sort: SortObj) => void;\n target?: ElementWithRef<Element>;\n className?: string;\n}\n\nexport const Sort: React.FC<SortProps> = ({\n label,\n icon,\n options,\n selected,\n onChange,\n target,\n className,\n}) => {\n const [open, setOpen] = useState(false);\n\n const handleClose = useCallback(() => setOpen(false), []);\n const handleOpen = useCallback(() => setOpen(true), []);\n\n const handleOnChange = useCallback(\n (event: React.MouseEvent<HTMLLIElement>) => {\n const nextSortBy = event.currentTarget.dataset.id as string;\n let nextOrder: SortDirections =\n selected.sortDirection === \"desc\" ? \"asc\" : \"desc\";\n\n if (nextSortBy !== selected.sortBy) {\n nextOrder =\n options.find((opt) => opt.id === nextSortBy)?.defaultDirection ||\n \"asc\";\n }\n\n onChange({ sortBy: nextSortBy, sortDirection: nextOrder });\n },\n [onChange, selected, options]\n );\n\n const labelText = useMemo(() => {\n return options.find((opt) => opt.id === selected.sortBy)?.name ?? \"\";\n }, [selected.sortBy, options]);\n\n if (!labelText) {\n console.warn(\"Cannot find selected id in options.\");\n }\n\n return (\n <Menu\n onOpen={handleOpen}\n onClose={handleClose}\n position=\"bottom-end\"\n target={\n target || (\n <StyledSortWrapper className={className}>\n <StyledValueButton\n active={open}\n value={labelText}\n label={label}\n data-testid=\"sort-button\"\n />\n <StyledIconButton\n active={open}\n variant=\"text gray\"\n data-testid=\"sort-icon-button\"\n >\n {icon || <StyledSortIcon />}\n </StyledIconButton>\n </StyledSortWrapper>\n )\n }\n >\n <StyledList>\n {options.map(({ id, name, defaultDirection }) => {\n let showDownArrow = selected.sortDirection === \"asc\";\n\n if (selected.sortBy !== id) {\n showDownArrow = defaultDirection === \"asc\";\n }\n\n return (\n <StyledListItem\n key={id}\n onClick={handleOnChange}\n data-id={id}\n data-testid={id}\n $active={id === selected.sortBy}\n >\n <StyledListItemName>{name}</StyledListItemName>\n {showDownArrow ? <StyledSortIconDown /> : <StyledSortIconUp />}\n </StyledListItem>\n );\n })}\n </StyledList>\n </Menu>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAE7D,SACEC,gBAAgB,EAChBC,UAAU,EACVC,cAAc,EACdC,kBAAkB,EAClBC,cAAc,EACdC,kBAAkB,EAClBC,gBAAgB,EAChBC,iBAAiB,EACjBC,iBAAiB,QACZ,UAAU;AACjB,SAASC,IAAI,QAAQ,SAAS;AAuB9B,OAAO,MAAMC,IAAy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EAAG;MACZ,eAAaA,EAAG;MAChB0B,OAAO,EAAE1B,EAAE,KAAKb,QAAQ,CAACgB;IAAO,gBAEhCnC,KAAA,CAAA8C,aAAA,CAACvC,kBAAkB,QAAEoC,IAAyB,CAAC,EAC9CY,aAAa,gBAAGvD,KAAA,CAAA8C,aAAA,CAACrC,kBAAkB,MAAE,CAAC,gBAAGT,KAAA,CAAA8C,aAAA,CAACpC,gBAAgB,MAAE,CAC/C,CAAC;EAErB,CAAC,CACS,CACR,CAAC;AAEX,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ListItemProps } from "../List";
|
|
3
|
+
export declare const StyledSortWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const StyledValueButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../ValueButton").IValueButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
|
|
5
|
+
export declare const StyledIconButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../IconButton").IconButtonProps & {
|
|
6
|
+
children?: import("react").ReactNode;
|
|
7
|
+
} & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
|
|
8
|
+
export declare const StyledSortIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>, any, {}, never>;
|
|
9
|
+
export declare const StyledSortIconDown: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>, any, {}, never>;
|
|
10
|
+
export declare const StyledSortIconUp: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>, any, {}, never>;
|
|
11
|
+
export declare const StyledList: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../List").ListProps & {
|
|
12
|
+
children?: import("react").ReactNode;
|
|
13
|
+
} & import("react").HTMLAttributes<HTMLUListElement> & import("react").RefAttributes<HTMLUListElement>> & {
|
|
14
|
+
Item: import("react").ForwardRefExoticComponent<ListItemProps & {
|
|
15
|
+
children?: import("react").ReactNode;
|
|
16
|
+
} & import("react").HTMLAttributes<HTMLLIElement> & import("react").RefAttributes<HTMLLIElement>>;
|
|
17
|
+
Separator: {
|
|
18
|
+
({ className, ...props }: import("react").HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
}, any, {}, never>;
|
|
22
|
+
interface StyledListItemProps extends ListItemProps {
|
|
23
|
+
$active?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const StyledListItem: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<ListItemProps & {
|
|
26
|
+
children?: import("react").ReactNode;
|
|
27
|
+
} & import("react").HTMLAttributes<HTMLLIElement> & import("react").RefAttributes<HTMLLIElement>>, any, StyledListItemProps, never>;
|
|
28
|
+
export declare const StyledListItemName: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=Styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Sort/Styles.ts"],"names":[],"mappings":";AAKA,OAAO,EAAkB,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxD,eAAO,MAAM,iBAAiB,oEAE7B,CAAC;AAIF,eAAO,MAAM,iBAAiB,uMAE7B,CAAC;AAIF,eAAO,MAAM,gBAAgB;;sEAE5B,CAAC;AAIF,eAAO,MAAM,cAAc,6MAE1B,CAAC;AAIF,eAAO,MAAM,kBAAkB,6MAE9B,CAAC;AAIF,eAAO,MAAM,gBAAgB,6MAE5B,CAAC;AAIF,eAAO,MAAM,UAAU;;;;;;;;;;kBAEtB,CAAC;AAIF,UAAU,mBAAoB,SAAQ,aAAa;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,cAAc;;mIAwB1B,CAAC;AAIF,eAAO,MAAM,kBAAkB,qEAE9B,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import { IconButton } from "../IconButton";
|
|
3
|
+
import { ArrowDownLongIcon, ArrowUpLongIcon, SortGeneralIcon } from "../Icons";
|
|
4
|
+
import { List, ListItem } from "../List";
|
|
5
|
+
import { ValueButton } from "../ValueButton";
|
|
6
|
+
export const StyledSortWrapper = styled.div.withConfig({
|
|
7
|
+
displayName: "Styles__StyledSortWrapper",
|
|
8
|
+
componentId: "sc-11r5ac9-0"
|
|
9
|
+
})(["", ";"], {
|
|
10
|
+
"width": "fit-content"
|
|
11
|
+
});
|
|
12
|
+
StyledSortWrapper.displayName = "StyledSortWrapper";
|
|
13
|
+
export const StyledValueButton = styled(ValueButton).withConfig({
|
|
14
|
+
displayName: "Styles__StyledValueButton",
|
|
15
|
+
componentId: "sc-11r5ac9-1"
|
|
16
|
+
})(["", ";"], {
|
|
17
|
+
"display": "none",
|
|
18
|
+
"alignItems": "center",
|
|
19
|
+
"@media (min-width: 768px)": {
|
|
20
|
+
"display": "flex"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
StyledValueButton.displayName = "StyledValueButton";
|
|
24
|
+
export const StyledIconButton = styled(IconButton).withConfig({
|
|
25
|
+
displayName: "Styles__StyledIconButton",
|
|
26
|
+
componentId: "sc-11r5ac9-2"
|
|
27
|
+
})(["", ";"], {
|
|
28
|
+
"display": "flex",
|
|
29
|
+
"alignItems": "center",
|
|
30
|
+
":hover": {
|
|
31
|
+
"color": "var(--color-primary)"
|
|
32
|
+
},
|
|
33
|
+
"@media (min-width: 768px)": {
|
|
34
|
+
"display": "none"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
StyledIconButton.displayName = "StyledIconButton";
|
|
38
|
+
export const StyledSortIcon = styled(SortGeneralIcon).withConfig({
|
|
39
|
+
displayName: "Styles__StyledSortIcon",
|
|
40
|
+
componentId: "sc-11r5ac9-3"
|
|
41
|
+
})(["", ";"], {
|
|
42
|
+
"marginTop": "0px"
|
|
43
|
+
});
|
|
44
|
+
StyledSortIcon.displayName = "StyledSortIcon";
|
|
45
|
+
export const StyledSortIconDown = styled(ArrowDownLongIcon).withConfig({
|
|
46
|
+
displayName: "Styles__StyledSortIconDown",
|
|
47
|
+
componentId: "sc-11r5ac9-4"
|
|
48
|
+
})(["", ";"], {
|
|
49
|
+
"flexShrink": "0"
|
|
50
|
+
});
|
|
51
|
+
StyledSortIconDown.displayName = "StyledSortIconDown";
|
|
52
|
+
export const StyledSortIconUp = styled(ArrowUpLongIcon).withConfig({
|
|
53
|
+
displayName: "Styles__StyledSortIconUp",
|
|
54
|
+
componentId: "sc-11r5ac9-5"
|
|
55
|
+
})(["", ";"], {
|
|
56
|
+
"flexShrink": "0"
|
|
57
|
+
});
|
|
58
|
+
StyledSortIconUp.displayName = "StyledSortIconUp";
|
|
59
|
+
export const StyledList = styled(List).withConfig({
|
|
60
|
+
displayName: "Styles__StyledList",
|
|
61
|
+
componentId: "sc-11r5ac9-6"
|
|
62
|
+
})(["", ";"], {
|
|
63
|
+
"paddingTop": "0.5rem",
|
|
64
|
+
"paddingBottom": "0.5rem"
|
|
65
|
+
});
|
|
66
|
+
StyledList.displayName = "StyledList";
|
|
67
|
+
export const StyledListItem = styled(ListItem).withConfig({
|
|
68
|
+
displayName: "Styles__StyledListItem",
|
|
69
|
+
componentId: "sc-11r5ac9-7"
|
|
70
|
+
})(["", ";svg{visibility:hidden;}&:hover svg{fill:var(--color-theme-500);visibility:visible;}", ""], {
|
|
71
|
+
"justifyContent": "space-between"
|
|
72
|
+
}, props => props.$active && css(["", ";svg{fill:var(--color-primary);visibility:visible;}&:hover svg{fill:var(--color-primary);visibility:visible;}"], {
|
|
73
|
+
"color": "var(--color-primary)"
|
|
74
|
+
}));
|
|
75
|
+
StyledListItem.displayName = "StyledListItem";
|
|
76
|
+
export const StyledListItemName = styled.span.withConfig({
|
|
77
|
+
displayName: "Styles__StyledListItemName",
|
|
78
|
+
componentId: "sc-11r5ac9-8"
|
|
79
|
+
})(["", ";"], {
|
|
80
|
+
"overflow": "hidden",
|
|
81
|
+
"textOverflow": "ellipsis",
|
|
82
|
+
"whiteSpace": "nowrap"
|
|
83
|
+
});
|
|
84
|
+
StyledListItemName.displayName = "StyledListItemName";
|
|
85
|
+
//# sourceMappingURL=Styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","IconButton","ArrowDownLongIcon","ArrowUpLongIcon","SortGeneralIcon","List","ListItem","ValueButton","StyledSortWrapper","div","withConfig","displayName","componentId","StyledValueButton","StyledIconButton","StyledSortIcon","StyledSortIconDown","StyledSortIconUp","StyledList","StyledListItem","props","$active","StyledListItemName","span"],"sources":["../../../../src/components/Sort/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { IconButton } from \"../IconButton\";\nimport { ArrowDownLongIcon, ArrowUpLongIcon, SortGeneralIcon } from \"../Icons\";\nimport { List, ListItem, ListItemProps } from \"../List\";\nimport { ValueButton } from \"../ValueButton\";\n\nexport const StyledSortWrapper = styled.div`\n ${tw`tw-w-fit`};\n`;\n\nStyledSortWrapper.displayName = \"StyledSortWrapper\";\n\nexport const StyledValueButton = styled(ValueButton)`\n ${tw`tw-hidden md:tw-flex tw-items-center`};\n`;\n\nStyledValueButton.displayName = \"StyledValueButton\";\n\nexport const StyledIconButton = styled(IconButton)`\n ${tw`tw-flex tw-items-center md:tw-hidden hover:tw-text-primary`};\n`;\n\nStyledIconButton.displayName = \"StyledIconButton\";\n\nexport const StyledSortIcon = styled(SortGeneralIcon)`\n ${tw`tw-mt-0`};\n`;\n\nStyledSortIcon.displayName = \"StyledSortIcon\";\n\nexport const StyledSortIconDown = styled(ArrowDownLongIcon)`\n ${tw`tw-shrink-0`};\n`;\n\nStyledSortIconDown.displayName = \"StyledSortIconDown\";\n\nexport const StyledSortIconUp = styled(ArrowUpLongIcon)`\n ${tw`tw-shrink-0`};\n`;\n\nStyledSortIconUp.displayName = \"StyledSortIconUp\";\n\nexport const StyledList = styled(List)`\n ${tw`tw-py-2`};\n`;\n\nStyledList.displayName = \"StyledList\";\n\ninterface StyledListItemProps extends ListItemProps {\n $active?: boolean;\n}\n\nexport const StyledListItem = styled(ListItem)<StyledListItemProps>`\n ${tw`tw-justify-between`};\n svg {\n visibility: hidden;\n }\n &:hover svg {\n fill: var(--color-theme-500);\n visibility: visible;\n }\n\n ${(props) =>\n props.$active &&\n css`\n ${tw`tw-text-primary`};\n\n svg {\n fill: var(--color-primary);\n visibility: visible;\n }\n &:hover svg {\n fill: var(--color-primary);\n visibility: visible;\n }\n `}\n`;\n\nStyledListItem.displayName = \"StyledListItem\";\n\nexport const StyledListItemName = styled.span`\n ${tw`tw-truncate`};\n`;\n\nStyledListItemName.displayName = \"StyledListItemName\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,iBAAiB,EAAEC,eAAe,EAAEC,eAAe,QAAQ,UAAU;AAC9E,SAASC,IAAI,EAAEC,QAAQ,QAAuB,SAAS;AACvD,SAASC,WAAW,QAAQ,gBAAgB;AAE5C,OAAO,MAAMC,iBAAiB,GAAGT,MAAM,CAACU,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,cACrC;EAAA;AAAS,CAAC,CACf;AAEDJ,iBAAiB,CAACG,WAAW,GAAG,mBAAmB;AAEnD,OAAO,MAAME,iBAAiB,GAAGd,MAAM,CAACQ,WAAW,CAAC,CAAAG,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,cAC9C;EAAA;EAA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CAUtB,CACJ;AAEDmB,cAAc,CAACR,WAAW,GAAG,gBAAgB;AAE7C,OAAO,MAAMW,kBAAkB,GAAGvB,MAAM,CAACwB,IAAI,CAAAb,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,cACvC;EAAA;EAAA;EAAA;AAAY,CAAC,CAClB;AAEDU,kBAAkB,CAACX,WAAW,GAAG,oBAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Sort/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Sort/index.ts"],"sourcesContent":["export * from \"./Sort\";\n"],"mappings":"AAAA,cAAc,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,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/components/index.ts"],"sourcesContent":["export * from \"./Button\";\nexport * from \"./ButtonGroup\";\nexport * from \"./Breadcrumbs\";\nexport * from \"./CounterButton\";\nexport * from \"./Steppers\";\nexport * from \"./Tables\";\nexport * from \"./CompleteCheckbox\";\nexport * from \"./Paper\";\nexport * from \"./ScaleBar\";\nexport * from \"./Card\";\nexport * from \"./EntityCard\";\nexport * from \"./EntitiesHeader\";\nexport * from \"./Signifier\";\nexport * from \"./Avatar\";\nexport * from \"./Tag\";\nexport * from \"./Loaders\";\nexport * from \"./Nav\";\nexport * from \"./Bubble\";\nexport * from \"./Input\";\nexport * from \"./Display\";\nexport * from \"./Menu\";\nexport * from \"./Expanders\";\nexport * from \"./Pickers\";\nexport * from \"./DatePicker\";\nexport * from \"./List\";\nexport * from \"./MenuSelector\";\nexport * from \"./MultiAvatar\";\nexport * from \"./RadioButton\";\nexport * from \"./ScrollShadow\";\nexport * from \"./Icons\";\nexport * from \"./Textarea\";\nexport * from \"./Modal\";\nexport * from \"./Sheet\";\nexport * from \"./Header\";\nexport * from \"./AutoResizeTextarea\";\nexport * from \"./Overlay\";\nexport * from \"./Accordion\";\nexport * from \"./Choose\";\nexport * from \"./Links\";\nexport * from \"./SelectDate\";\nexport * from \"./Popper\";\nexport * from \"./ToastMessage\";\nexport * from \"./Tooltip\";\nexport * from \"./Transitions\";\nexport * from \"./Window\";\nexport * from \"./ValueButton\";\nexport * from \"./Select\";\nexport * from \"./SelectTrigger\";\nexport * from \"./SelectTime\";\nexport * from \"./Dialog\";\nexport * from \"./ConfirmDialog\";\nexport * from \"./Checkbox\";\nexport * from \"./Toggle\";\nexport * from \"./Typography\";\nexport * from \"./Autocomplete\";\nexport * from \"./ComboBox\";\nexport * from \"./Button/AddToListButton\";\nexport * from \"./ProgressBar\";\nexport * from \"./ProgressPie\";\nexport * from \"./Reactions\";\nexport * from \"./Label\";\nexport * from \"./GlobalStyle\";\nexport * from \"./ProgressRing\";\nexport * from \"./EditableContent\";\nexport * from \"./EditableText\";\nexport * from \"./EditableHours\";\nexport * from \"./EditableCurrency\";\nexport * from \"./Folder\";\nexport * from \"./Chip\";\nexport * from \"./Trigger\";\nexport * from \"./Dot\";\nexport * from \"./Entity\";\nexport * from \"./Filter\";\nexport * from \"./Wizard\";\nexport * from \"./IconButton\";\nexport * from \"./Typography\";\nexport * from \"./Badge\";\nexport * from \"./AvatarGroup\";\nexport * from \"./CommandPalette\";\nexport * from \"./EmptySlate\";\nexport * from \"./Toolbar\";\nexport * from \"./InfoBox\";\n"],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,oBAAoB;AAClC,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,cAAc;AAC5B,cAAc,kBAAkB;AAChC,cAAc,aAAa;AAC3B,cAAc,UAAU;AACxB,cAAc,OAAO;AACrB,cAAc,WAAW;AACzB,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,aAAa;AAC3B,cAAc,WAAW;AACzB,cAAc,cAAc;AAC5B,cAAc,QAAQ;AACtB,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,UAAU;AACxB,cAAc,sBAAsB;AACpC,cAAc,WAAW;AACzB,cAAc,aAAa;AAC3B,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,gBAAgB;AAC9B,cAAc,WAAW;AACzB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,iBAAiB;AAC/B,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,cAAc;AAC5B,cAAc,gBAAgB;AAC9B,cAAc,YAAY;AAC1B,cAAc,0BAA0B;AACxC,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,aAAa;AAC3B,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,mBAAmB;AACjC,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,oBAAoB;AAClC,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,WAAW;AACzB,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,cAAc;AAC5B,cAAc,cAAc;AAC5B,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,kBAAkB;AAChC,cAAc,cAAc;AAC5B,cAAc,WAAW;AACzB,cAAc,WAAW"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from \"./Button\";\nexport * from \"./ButtonGroup\";\nexport * from \"./Breadcrumbs\";\nexport * from \"./CounterButton\";\nexport * from \"./Steppers\";\nexport * from \"./Tables\";\nexport * from \"./CompleteCheckbox\";\nexport * from \"./Paper\";\nexport * from \"./ScaleBar\";\nexport * from \"./Card\";\nexport * from \"./EntityCard\";\nexport * from \"./EntitiesHeader\";\nexport * from \"./Signifier\";\nexport * from \"./Avatar\";\nexport * from \"./Tag\";\nexport * from \"./Loaders\";\nexport * from \"./Nav\";\nexport * from \"./Bubble\";\nexport * from \"./Input\";\nexport * from \"./Display\";\nexport * from \"./Menu\";\nexport * from \"./Expanders\";\nexport * from \"./Pickers\";\nexport * from \"./DatePicker\";\nexport * from \"./List\";\nexport * from \"./MenuSelector\";\nexport * from \"./MultiAvatar\";\nexport * from \"./RadioButton\";\nexport * from \"./ScrollShadow\";\nexport * from \"./Icons\";\nexport * from \"./Textarea\";\nexport * from \"./Modal\";\nexport * from \"./Sheet\";\nexport * from \"./Header\";\nexport * from \"./AutoResizeTextarea\";\nexport * from \"./Overlay\";\nexport * from \"./Accordion\";\nexport * from \"./Choose\";\nexport * from \"./Links\";\nexport * from \"./SelectDate\";\nexport * from \"./Popper\";\nexport * from \"./ToastMessage\";\nexport * from \"./Tooltip\";\nexport * from \"./Transitions\";\nexport * from \"./Window\";\nexport * from \"./ValueButton\";\nexport * from \"./Select\";\nexport * from \"./SelectTrigger\";\nexport * from \"./SelectTime\";\nexport * from \"./Dialog\";\nexport * from \"./ConfirmDialog\";\nexport * from \"./Checkbox\";\nexport * from \"./Toggle\";\nexport * from \"./Typography\";\nexport * from \"./Autocomplete\";\nexport * from \"./ComboBox\";\nexport * from \"./Button/AddToListButton\";\nexport * from \"./ProgressBar\";\nexport * from \"./ProgressPie\";\nexport * from \"./Reactions\";\nexport * from \"./Label\";\nexport * from \"./GlobalStyle\";\nexport * from \"./ProgressRing\";\nexport * from \"./EditableContent\";\nexport * from \"./EditableText\";\nexport * from \"./EditableHours\";\nexport * from \"./EditableCurrency\";\nexport * from \"./Folder\";\nexport * from \"./Chip\";\nexport * from \"./Trigger\";\nexport * from \"./Dot\";\nexport * from \"./Entity\";\nexport * from \"./Filter\";\nexport * from \"./Wizard\";\nexport * from \"./IconButton\";\nexport * from \"./Typography\";\nexport * from \"./Badge\";\nexport * from \"./AvatarGroup\";\nexport * from \"./CommandPalette\";\nexport * from \"./EmptySlate\";\nexport * from \"./Toolbar\";\nexport * from \"./InfoBox\";\nexport * from \"./Sort\";\n"],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,oBAAoB;AAClC,cAAc,SAAS;AACvB,cAAc,YAAY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xB,cAAc,UAAU;AACxB,cAAc,cAAc;AAC5B,cAAc,cAAc;AAC5B,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,kBAAkB;AAChC,cAAc,cAAc;AAC5B,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,QAAQ"}
|
package/dist/index.js
CHANGED
|
@@ -362,16 +362,16 @@
|
|
|
362
362
|
});
|
|
363
363
|
ButtonGroup.displayName = "ButtonGroup";
|
|
364
364
|
|
|
365
|
-
var StyledList = styled__default["default"].ul.withConfig({
|
|
365
|
+
var StyledList$1 = styled__default["default"].ul.withConfig({
|
|
366
366
|
displayName: "Styles__StyledList",
|
|
367
367
|
componentId: "sc-dv1w0m-0"
|
|
368
368
|
})(["list-style-type:none;margin:0;padding:0;"]);
|
|
369
|
-
StyledList.displayName = "StyledList";
|
|
370
|
-
var StyledListItem = styled__default["default"].li.withConfig({
|
|
369
|
+
StyledList$1.displayName = "StyledList";
|
|
370
|
+
var StyledListItem$1 = styled__default["default"].li.withConfig({
|
|
371
371
|
displayName: "Styles__StyledListItem",
|
|
372
372
|
componentId: "sc-dv1w0m-1"
|
|
373
373
|
})(["", " ", " display:flex;flex-direction:row;align-items:center;cursor:pointer;padding:0 1rem;margin:0.25rem 0;font-size:0.875rem;user-select:none;color:var(--color-theme-900);line-height:28px;> svg:first-child{margin-right:8px;}&:hover,&:focus-visible{background-color:var(--color-theme-200);outline:none;}"], BoxSizingStyle, FontStyle);
|
|
374
|
-
StyledListItem.displayName = "StyledListItem";
|
|
374
|
+
StyledListItem$1.displayName = "StyledListItem";
|
|
375
375
|
var StyledListSeparator$1 = styled__default["default"].div.withConfig({
|
|
376
376
|
displayName: "Styles__StyledListSeparator",
|
|
377
377
|
componentId: "sc-dv1w0m-2"
|
|
@@ -383,7 +383,7 @@
|
|
|
383
383
|
var children = _ref.children,
|
|
384
384
|
className = _ref.className,
|
|
385
385
|
props = _objectWithoutProperties(_ref, _excluded$1z);
|
|
386
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledListItem, _extends({
|
|
386
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledListItem$1, _extends({
|
|
387
387
|
className: classNames__default["default"]("c-list-item", className),
|
|
388
388
|
ref: ref,
|
|
389
389
|
tabIndex: 0
|
|
@@ -406,7 +406,7 @@
|
|
|
406
406
|
var children = _ref.children,
|
|
407
407
|
className = _ref.className,
|
|
408
408
|
props = _objectWithoutProperties(_ref, _excluded$1x);
|
|
409
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledList, _extends({
|
|
409
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledList$1, _extends({
|
|
410
410
|
className: className,
|
|
411
411
|
ref: ref,
|
|
412
412
|
tabIndex: -1
|
|
@@ -877,7 +877,7 @@
|
|
|
877
877
|
return time === undefined || /^([01]\d|2[0-3]):([0-5]\d)$/.test(time);
|
|
878
878
|
};
|
|
879
879
|
|
|
880
|
-
var StyledIconButton = styled__default["default"](Button).withConfig({
|
|
880
|
+
var StyledIconButton$1 = styled__default["default"](Button).withConfig({
|
|
881
881
|
displayName: "Styles__StyledIconButton",
|
|
882
882
|
componentId: "sc-1teza2f-0"
|
|
883
883
|
})(["display:inline-flex;justify-content:center;align-items:center;padding:0;width:32px;", " ", ""], function (_ref) {
|
|
@@ -919,7 +919,7 @@
|
|
|
919
919
|
size = _ref.size,
|
|
920
920
|
active = _ref.active,
|
|
921
921
|
args = _objectWithoutProperties(_ref, _excluded$1w);
|
|
922
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledIconButton, _extends({
|
|
922
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledIconButton$1, _extends({
|
|
923
923
|
className: className,
|
|
924
924
|
variant: variant,
|
|
925
925
|
size: size,
|
|
@@ -17587,7 +17587,7 @@
|
|
|
17587
17587
|
var formattedLongValue = formatNumber(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, "long");
|
|
17588
17588
|
if (format === "short") {
|
|
17589
17589
|
return /*#__PURE__*/React__default["default"].createElement(Tooltip, {
|
|
17590
|
-
title:
|
|
17590
|
+
title: formatNumber(value, thousandSeparator, decimalSeparator, false, decimalSpaces, "long"),
|
|
17591
17591
|
disable: disableTooltip || !formattedLongValue.includes(thousandSeparator) && !formattedLongValue.includes(decimalSeparator)
|
|
17592
17592
|
}, /*#__PURE__*/React__default["default"].createElement(Typography, _extends({
|
|
17593
17593
|
as: as,
|
|
@@ -17634,7 +17634,7 @@
|
|
|
17634
17634
|
var formattedLongValue = formatCurrency(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, "long", currencyCode, currencyPosition);
|
|
17635
17635
|
if (format === "short") {
|
|
17636
17636
|
return /*#__PURE__*/React__default["default"].createElement(Tooltip, {
|
|
17637
|
-
title:
|
|
17637
|
+
title: formatCurrency(value, thousandSeparator, decimalSeparator, false, decimalSpaces, "long", currencyCode, currencyPosition),
|
|
17638
17638
|
disable: disableTooltip || !formattedLongValue.includes(thousandSeparator) && !formattedLongValue.includes(decimalSeparator)
|
|
17639
17639
|
}, /*#__PURE__*/React__default["default"].createElement(Typography, _extends({
|
|
17640
17640
|
as: as,
|
|
@@ -19485,7 +19485,7 @@
|
|
|
19485
19485
|
componentId: "sc-7n59oz-1"
|
|
19486
19486
|
})([""]);
|
|
19487
19487
|
StyledValueButtonValue.displayName = "StyledValueButtonValue";
|
|
19488
|
-
var StyledValueButton = styled__default["default"](Button).withConfig({
|
|
19488
|
+
var StyledValueButton$1 = styled__default["default"](Button).withConfig({
|
|
19489
19489
|
displayName: "Styles__StyledValueButton",
|
|
19490
19490
|
componentId: "sc-7n59oz-2"
|
|
19491
19491
|
})(["", " ", ""], function (props) {
|
|
@@ -19497,7 +19497,7 @@
|
|
|
19497
19497
|
"pointerEvents": "none"
|
|
19498
19498
|
});
|
|
19499
19499
|
});
|
|
19500
|
-
StyledValueButton.displayName = "StyledValueButton";
|
|
19500
|
+
StyledValueButton$1.displayName = "StyledValueButton";
|
|
19501
19501
|
|
|
19502
19502
|
var _excluded$o = ["active", "alwaysShowIcon", "icon", "label", "value"];
|
|
19503
19503
|
var ValueButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
@@ -19509,7 +19509,7 @@
|
|
|
19509
19509
|
label = _ref.label,
|
|
19510
19510
|
value = _ref.value,
|
|
19511
19511
|
args = _objectWithoutProperties(_ref, _excluded$o);
|
|
19512
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledValueButton, _extends({
|
|
19512
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledValueButton$1, _extends({
|
|
19513
19513
|
className: "c-value-button"
|
|
19514
19514
|
}, args, {
|
|
19515
19515
|
ref: ref,
|
|
@@ -22167,6 +22167,163 @@
|
|
|
22167
22167
|
}, title) : title, action), children)));
|
|
22168
22168
|
};
|
|
22169
22169
|
|
|
22170
|
+
var StyledSortWrapper = styled__default["default"].div.withConfig({
|
|
22171
|
+
displayName: "Styles__StyledSortWrapper",
|
|
22172
|
+
componentId: "sc-11r5ac9-0"
|
|
22173
|
+
})(["", ";"], {
|
|
22174
|
+
"width": "fit-content"
|
|
22175
|
+
});
|
|
22176
|
+
StyledSortWrapper.displayName = "StyledSortWrapper";
|
|
22177
|
+
var StyledValueButton = styled__default["default"](ValueButton).withConfig({
|
|
22178
|
+
displayName: "Styles__StyledValueButton",
|
|
22179
|
+
componentId: "sc-11r5ac9-1"
|
|
22180
|
+
})(["", ";"], {
|
|
22181
|
+
"display": "none",
|
|
22182
|
+
"alignItems": "center",
|
|
22183
|
+
"@media (min-width: 768px)": {
|
|
22184
|
+
"display": "flex"
|
|
22185
|
+
}
|
|
22186
|
+
});
|
|
22187
|
+
StyledValueButton.displayName = "StyledValueButton";
|
|
22188
|
+
var StyledIconButton = styled__default["default"](IconButton).withConfig({
|
|
22189
|
+
displayName: "Styles__StyledIconButton",
|
|
22190
|
+
componentId: "sc-11r5ac9-2"
|
|
22191
|
+
})(["", ";"], {
|
|
22192
|
+
"display": "flex",
|
|
22193
|
+
"alignItems": "center",
|
|
22194
|
+
":hover": {
|
|
22195
|
+
"color": "var(--color-primary)"
|
|
22196
|
+
},
|
|
22197
|
+
"@media (min-width: 768px)": {
|
|
22198
|
+
"display": "none"
|
|
22199
|
+
}
|
|
22200
|
+
});
|
|
22201
|
+
StyledIconButton.displayName = "StyledIconButton";
|
|
22202
|
+
var StyledSortIcon = styled__default["default"](SortGeneralIcon$1).withConfig({
|
|
22203
|
+
displayName: "Styles__StyledSortIcon",
|
|
22204
|
+
componentId: "sc-11r5ac9-3"
|
|
22205
|
+
})(["", ";"], {
|
|
22206
|
+
"marginTop": "0px"
|
|
22207
|
+
});
|
|
22208
|
+
StyledSortIcon.displayName = "StyledSortIcon";
|
|
22209
|
+
var StyledSortIconDown = styled__default["default"](ArrowDownLongIcon$1).withConfig({
|
|
22210
|
+
displayName: "Styles__StyledSortIconDown",
|
|
22211
|
+
componentId: "sc-11r5ac9-4"
|
|
22212
|
+
})(["", ";"], {
|
|
22213
|
+
"flexShrink": "0"
|
|
22214
|
+
});
|
|
22215
|
+
StyledSortIconDown.displayName = "StyledSortIconDown";
|
|
22216
|
+
var StyledSortIconUp = styled__default["default"](ArrowUpLongIcon$1).withConfig({
|
|
22217
|
+
displayName: "Styles__StyledSortIconUp",
|
|
22218
|
+
componentId: "sc-11r5ac9-5"
|
|
22219
|
+
})(["", ";"], {
|
|
22220
|
+
"flexShrink": "0"
|
|
22221
|
+
});
|
|
22222
|
+
StyledSortIconUp.displayName = "StyledSortIconUp";
|
|
22223
|
+
var StyledList = styled__default["default"](List).withConfig({
|
|
22224
|
+
displayName: "Styles__StyledList",
|
|
22225
|
+
componentId: "sc-11r5ac9-6"
|
|
22226
|
+
})(["", ";"], {
|
|
22227
|
+
"paddingTop": "0.5rem",
|
|
22228
|
+
"paddingBottom": "0.5rem"
|
|
22229
|
+
});
|
|
22230
|
+
StyledList.displayName = "StyledList";
|
|
22231
|
+
var StyledListItem = styled__default["default"](ListItem).withConfig({
|
|
22232
|
+
displayName: "Styles__StyledListItem",
|
|
22233
|
+
componentId: "sc-11r5ac9-7"
|
|
22234
|
+
})(["", ";svg{visibility:hidden;}&:hover svg{fill:var(--color-theme-500);visibility:visible;}", ""], {
|
|
22235
|
+
"justifyContent": "space-between"
|
|
22236
|
+
}, function (props) {
|
|
22237
|
+
return props.$active && styled.css(["", ";svg{fill:var(--color-primary);visibility:visible;}&:hover svg{fill:var(--color-primary);visibility:visible;}"], {
|
|
22238
|
+
"color": "var(--color-primary)"
|
|
22239
|
+
});
|
|
22240
|
+
});
|
|
22241
|
+
StyledListItem.displayName = "StyledListItem";
|
|
22242
|
+
var StyledListItemName = styled__default["default"].span.withConfig({
|
|
22243
|
+
displayName: "Styles__StyledListItemName",
|
|
22244
|
+
componentId: "sc-11r5ac9-8"
|
|
22245
|
+
})(["", ";"], {
|
|
22246
|
+
"overflow": "hidden",
|
|
22247
|
+
"textOverflow": "ellipsis",
|
|
22248
|
+
"whiteSpace": "nowrap"
|
|
22249
|
+
});
|
|
22250
|
+
StyledListItemName.displayName = "StyledListItemName";
|
|
22251
|
+
|
|
22252
|
+
var Sort = function Sort(_ref) {
|
|
22253
|
+
var label = _ref.label,
|
|
22254
|
+
icon = _ref.icon,
|
|
22255
|
+
options = _ref.options,
|
|
22256
|
+
selected = _ref.selected,
|
|
22257
|
+
onChange = _ref.onChange,
|
|
22258
|
+
target = _ref.target,
|
|
22259
|
+
className = _ref.className;
|
|
22260
|
+
var _useState = React.useState(false),
|
|
22261
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22262
|
+
open = _useState2[0],
|
|
22263
|
+
setOpen = _useState2[1];
|
|
22264
|
+
var handleClose = React.useCallback(function () {
|
|
22265
|
+
return setOpen(false);
|
|
22266
|
+
}, []);
|
|
22267
|
+
var handleOpen = React.useCallback(function () {
|
|
22268
|
+
return setOpen(true);
|
|
22269
|
+
}, []);
|
|
22270
|
+
var handleOnChange = React.useCallback(function (event) {
|
|
22271
|
+
var nextSortBy = event.currentTarget.dataset.id;
|
|
22272
|
+
var nextOrder = selected.sortDirection === "desc" ? "asc" : "desc";
|
|
22273
|
+
if (nextSortBy !== selected.sortBy) {
|
|
22274
|
+
var _options$find;
|
|
22275
|
+
nextOrder = ((_options$find = options.find(function (opt) {
|
|
22276
|
+
return opt.id === nextSortBy;
|
|
22277
|
+
})) === null || _options$find === void 0 ? void 0 : _options$find.defaultDirection) || "asc";
|
|
22278
|
+
}
|
|
22279
|
+
onChange({
|
|
22280
|
+
sortBy: nextSortBy,
|
|
22281
|
+
sortDirection: nextOrder
|
|
22282
|
+
});
|
|
22283
|
+
}, [onChange, selected, options]);
|
|
22284
|
+
var labelText = React.useMemo(function () {
|
|
22285
|
+
var _options$find$name, _options$find2;
|
|
22286
|
+
return (_options$find$name = (_options$find2 = options.find(function (opt) {
|
|
22287
|
+
return opt.id === selected.sortBy;
|
|
22288
|
+
})) === null || _options$find2 === void 0 ? void 0 : _options$find2.name) !== null && _options$find$name !== void 0 ? _options$find$name : "";
|
|
22289
|
+
}, [selected.sortBy, options]);
|
|
22290
|
+
if (!labelText) {
|
|
22291
|
+
console.warn("Cannot find selected id in options.");
|
|
22292
|
+
}
|
|
22293
|
+
return /*#__PURE__*/React__default["default"].createElement(Menu, {
|
|
22294
|
+
onOpen: handleOpen,
|
|
22295
|
+
onClose: handleClose,
|
|
22296
|
+
position: "bottom-end",
|
|
22297
|
+
target: target || /*#__PURE__*/React__default["default"].createElement(StyledSortWrapper, {
|
|
22298
|
+
className: className
|
|
22299
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledValueButton, {
|
|
22300
|
+
active: open,
|
|
22301
|
+
value: labelText,
|
|
22302
|
+
label: label,
|
|
22303
|
+
"data-testid": "sort-button"
|
|
22304
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledIconButton, {
|
|
22305
|
+
active: open,
|
|
22306
|
+
variant: "text gray",
|
|
22307
|
+
"data-testid": "sort-icon-button"
|
|
22308
|
+
}, icon || /*#__PURE__*/React__default["default"].createElement(StyledSortIcon, null)))
|
|
22309
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledList, null, options.map(function (_ref2) {
|
|
22310
|
+
var id = _ref2.id,
|
|
22311
|
+
name = _ref2.name,
|
|
22312
|
+
defaultDirection = _ref2.defaultDirection;
|
|
22313
|
+
var showDownArrow = selected.sortDirection === "asc";
|
|
22314
|
+
if (selected.sortBy !== id) {
|
|
22315
|
+
showDownArrow = defaultDirection === "asc";
|
|
22316
|
+
}
|
|
22317
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledListItem, {
|
|
22318
|
+
key: id,
|
|
22319
|
+
onClick: handleOnChange,
|
|
22320
|
+
"data-id": id,
|
|
22321
|
+
"data-testid": id,
|
|
22322
|
+
$active: id === selected.sortBy
|
|
22323
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledListItemName, null, name), showDownArrow ? /*#__PURE__*/React__default["default"].createElement(StyledSortIconDown, null) : /*#__PURE__*/React__default["default"].createElement(StyledSortIconUp, null));
|
|
22324
|
+
})));
|
|
22325
|
+
};
|
|
22326
|
+
|
|
22170
22327
|
exports.AccessLogIcon = AccessLogIcon$1;
|
|
22171
22328
|
exports.Accordion = Accordion;
|
|
22172
22329
|
exports.AccordionContext = AccordionContext;
|
|
@@ -22462,6 +22619,7 @@
|
|
|
22462
22619
|
exports.SlideFromTop = SlideFromTop;
|
|
22463
22620
|
exports.SlideLeftRightTransition = SlideLeftRightTransition;
|
|
22464
22621
|
exports.SmileIcon = SmileIcon$1;
|
|
22622
|
+
exports.Sort = Sort;
|
|
22465
22623
|
exports.SortDirection = SortDirection;
|
|
22466
22624
|
exports.SortGeneralIcon = SortGeneralIcon$1;
|
|
22467
22625
|
exports.SortIcon = SortIcon$1;
|