@veeqo/ui 12.1.1 → 12.3.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/Flex/FlexCol/FlexCol.cjs +5 -3
- package/dist/components/Flex/FlexCol/FlexCol.cjs.map +1 -1
- package/dist/components/Flex/FlexCol/FlexCol.d.ts +8 -2
- package/dist/components/Flex/FlexCol/FlexCol.js +5 -3
- package/dist/components/Flex/FlexCol/FlexCol.js.map +1 -1
- package/dist/components/Flex/FlexRow/FlexRow.cjs +3 -2
- package/dist/components/Flex/FlexRow/FlexRow.cjs.map +1 -1
- package/dist/components/Flex/FlexRow/FlexRow.d.ts +1 -0
- package/dist/components/Flex/FlexRow/FlexRow.js +3 -2
- package/dist/components/Flex/FlexRow/FlexRow.js.map +1 -1
- package/dist/components/Flex/types.d.ts +2 -1
- package/dist/components/Pagination/styled.d.ts +1 -0
- package/dist/components/SelectDropdown/SelectDropdown.cjs +2 -2
- package/dist/components/SelectDropdown/SelectDropdown.cjs.map +1 -1
- package/dist/components/SelectDropdown/SelectDropdown.js +2 -2
- package/dist/components/SelectDropdown/SelectDropdown.js.map +1 -1
- package/dist/components/SelectDropdown/components/GridItem/GridItem.d.ts +3 -0
- package/dist/components/SelectDropdown/components/GridItem/index.d.ts +1 -0
- package/dist/components/SelectDropdown/components/GridItem/types.d.ts +7 -0
- package/dist/components/SelectDropdown/{ListItem/components/ListItemContent.cjs → components/ItemContent/ItemContent.cjs} +15 -15
- package/dist/components/SelectDropdown/components/ItemContent/ItemContent.cjs.map +1 -0
- package/dist/components/SelectDropdown/components/ItemContent/ItemContent.d.ts +3 -0
- package/dist/components/SelectDropdown/{ListItem/components/ListItemContent.js → components/ItemContent/ItemContent.js} +13 -13
- package/dist/components/SelectDropdown/components/ItemContent/ItemContent.js.map +1 -0
- package/dist/components/SelectDropdown/components/ItemContent/ItemContent.module.scss.cjs +9 -0
- package/dist/components/SelectDropdown/components/ItemContent/ItemContent.module.scss.cjs.map +1 -0
- package/dist/components/SelectDropdown/components/ItemContent/ItemContent.module.scss.js +7 -0
- package/dist/components/SelectDropdown/components/ItemContent/ItemContent.module.scss.js.map +1 -0
- package/dist/components/SelectDropdown/components/ItemContent/SelectionType.cjs.map +1 -0
- package/dist/components/SelectDropdown/components/ItemContent/SelectionType.js.map +1 -0
- package/dist/components/SelectDropdown/components/ItemContent/index.d.ts +1 -0
- package/dist/components/SelectDropdown/{ListItem/components → components/ItemContent}/types.d.ts +4 -2
- package/dist/components/SelectDropdown/components/ListItem/ListItem.cjs +23 -0
- package/dist/components/SelectDropdown/components/ListItem/ListItem.cjs.map +1 -0
- package/dist/components/SelectDropdown/components/ListItem/ListItem.js +17 -0
- package/dist/components/SelectDropdown/components/ListItem/ListItem.js.map +1 -0
- package/dist/components/SelectDropdown/components/ListItem/types.d.ts +3 -0
- package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/ListItemSection.cjs +5 -5
- package/dist/components/SelectDropdown/components/ListItemSection/ListItemSection.cjs.map +1 -0
- package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/ListItemSection.js +5 -5
- package/dist/components/SelectDropdown/components/ListItemSection/ListItemSection.js.map +1 -0
- package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/ListItemSection.module.scss.cjs +1 -1
- package/dist/components/SelectDropdown/components/ListItemSection/ListItemSection.module.scss.cjs.map +1 -0
- package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/ListItemSection.module.scss.js +1 -1
- package/dist/components/SelectDropdown/components/ListItemSection/ListItemSection.module.scss.js.map +1 -0
- package/dist/components/SelectDropdown/components/item.module.scss.cjs +9 -0
- package/dist/components/SelectDropdown/components/item.module.scss.cjs.map +1 -0
- package/dist/components/SelectDropdown/components/item.module.scss.js +7 -0
- package/dist/components/SelectDropdown/components/item.module.scss.js.map +1 -0
- package/dist/components/SelectDropdown/{ListItem → components}/types.d.ts +5 -7
- package/dist/components/SelectDropdown/types.d.ts +2 -2
- package/dist/components/SelectDropdown/utils.cjs.map +1 -1
- package/dist/components/SelectDropdown/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/SelectDropdown/ListItem/ListItem.cjs +0 -23
- package/dist/components/SelectDropdown/ListItem/ListItem.cjs.map +0 -1
- package/dist/components/SelectDropdown/ListItem/ListItem.js +0 -17
- package/dist/components/SelectDropdown/ListItem/ListItem.js.map +0 -1
- package/dist/components/SelectDropdown/ListItem/ListItem.module.scss.cjs +0 -9
- package/dist/components/SelectDropdown/ListItem/ListItem.module.scss.cjs.map +0 -1
- package/dist/components/SelectDropdown/ListItem/ListItem.module.scss.js +0 -7
- package/dist/components/SelectDropdown/ListItem/ListItem.module.scss.js.map +0 -1
- package/dist/components/SelectDropdown/ListItem/components/ListItemContent.cjs.map +0 -1
- package/dist/components/SelectDropdown/ListItem/components/ListItemContent.d.ts +0 -3
- package/dist/components/SelectDropdown/ListItem/components/ListItemContent.js.map +0 -1
- package/dist/components/SelectDropdown/ListItem/components/SelectionType.cjs.map +0 -1
- package/dist/components/SelectDropdown/ListItem/components/SelectionType.js.map +0 -1
- package/dist/components/SelectDropdown/ListItemSection/ListItemSection.cjs.map +0 -1
- package/dist/components/SelectDropdown/ListItemSection/ListItemSection.js.map +0 -1
- package/dist/components/SelectDropdown/ListItemSection/ListItemSection.module.scss.cjs.map +0 -1
- package/dist/components/SelectDropdown/ListItemSection/ListItemSection.module.scss.js.map +0 -1
- /package/dist/components/SelectDropdown/{ListItem/components → components/ItemContent}/SelectionType.cjs +0 -0
- /package/dist/components/SelectDropdown/{ListItem/components → components/ItemContent}/SelectionType.d.ts +0 -0
- /package/dist/components/SelectDropdown/{ListItem/components → components/ItemContent}/SelectionType.js +0 -0
- /package/dist/components/SelectDropdown/{ListItem → components/ListItem}/ListItem.d.ts +0 -0
- /package/dist/components/SelectDropdown/{ListItem → components/ListItem}/index.d.ts +0 -0
- /package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/ListItemSection.d.ts +0 -0
- /package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/index.d.ts +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var buildClassnames = require('../../../utils/buildClassnames.cjs');
|
|
5
|
+
require('uid/secure');
|
|
5
6
|
var FlexCol_module = require('./FlexCol.module.scss.cjs');
|
|
6
7
|
var Flex_module = require('../Flex.module.scss.cjs');
|
|
7
8
|
|
|
@@ -14,8 +15,9 @@ const FLEX_COL_DEFAULT_PROPS = {
|
|
|
14
15
|
justifyContent: 'flex-start',
|
|
15
16
|
gap: 'sm',
|
|
16
17
|
flexWrap: 'wrap',
|
|
18
|
+
flexGrow: 0,
|
|
17
19
|
};
|
|
18
|
-
const FlexCol = ({ alignItems = FLEX_COL_DEFAULT_PROPS.alignItems, justifyContent = FLEX_COL_DEFAULT_PROPS.justifyContent, gap = FLEX_COL_DEFAULT_PROPS.gap, flexWrap = FLEX_COL_DEFAULT_PROPS.flexWrap, className, style, children, ...rest }) => {
|
|
20
|
+
const FlexCol = React__default.default.forwardRef(({ alignItems = FLEX_COL_DEFAULT_PROPS.alignItems, justifyContent = FLEX_COL_DEFAULT_PROPS.justifyContent, gap = FLEX_COL_DEFAULT_PROPS.gap, flexWrap = FLEX_COL_DEFAULT_PROPS.flexWrap, flexGrow = FLEX_COL_DEFAULT_PROPS.flexGrow, className, style, children, ...rest }, ref) => {
|
|
19
21
|
const cssClasses = [
|
|
20
22
|
FlexCol_module.flexCol,
|
|
21
23
|
Flex_module[`alignItems-${alignItems}`],
|
|
@@ -24,8 +26,8 @@ const FlexCol = ({ alignItems = FLEX_COL_DEFAULT_PROPS.alignItems, justifyConten
|
|
|
24
26
|
Flex_module[`flexWrap-${flexWrap}`],
|
|
25
27
|
className,
|
|
26
28
|
];
|
|
27
|
-
return (React__default.default.createElement("div", { className: buildClassnames.buildClassnames(cssClasses), style: style, ...rest }, children));
|
|
28
|
-
};
|
|
29
|
+
return (React__default.default.createElement("div", { className: buildClassnames.buildClassnames(cssClasses), style: { flexGrow, ...style }, ref: ref, ...rest }, children));
|
|
30
|
+
});
|
|
29
31
|
|
|
30
32
|
exports.FLEX_COL_DEFAULT_PROPS = FLEX_COL_DEFAULT_PROPS;
|
|
31
33
|
exports.FlexCol = FlexCol;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlexCol.cjs","sources":["../../../../src/components/Flex/FlexCol/FlexCol.tsx"],"sourcesContent":["import React from 'react';\nimport { buildClassnames } from '../../../utils
|
|
1
|
+
{"version":3,"file":"FlexCol.cjs","sources":["../../../../src/components/Flex/FlexCol/FlexCol.tsx"],"sourcesContent":["import React from 'react';\nimport { buildClassnames } from '../../../utils';\nimport { FlexDefaultProps, FlexProps } from '../types';\nimport flexColStyles from './FlexCol.module.scss';\nimport flexStyles from '../Flex.module.scss';\n\nexport const FLEX_COL_DEFAULT_PROPS: FlexDefaultProps = {\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n gap: 'sm',\n flexWrap: 'wrap',\n flexGrow: 0,\n};\n\nexport const FlexCol = React.forwardRef<HTMLDivElement, FlexProps>(\n (\n {\n alignItems = FLEX_COL_DEFAULT_PROPS.alignItems,\n justifyContent = FLEX_COL_DEFAULT_PROPS.justifyContent,\n gap = FLEX_COL_DEFAULT_PROPS.gap,\n flexWrap = FLEX_COL_DEFAULT_PROPS.flexWrap,\n flexGrow = FLEX_COL_DEFAULT_PROPS.flexGrow,\n className,\n style,\n children,\n ...rest\n },\n ref,\n ) => {\n const cssClasses = [\n flexColStyles.flexCol,\n flexStyles[`alignItems-${alignItems}`],\n flexStyles[`justifyContent-${justifyContent}`],\n flexStyles[`gap-${gap}`],\n flexStyles[`flexWrap-${flexWrap}`],\n className,\n ];\n\n return (\n <div\n className={buildClassnames(cssClasses)}\n style={{ flexGrow, ...style }}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n"],"names":["React","flexColStyles","flexStyles","buildClassnames"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
|
export declare const FLEX_COL_DEFAULT_PROPS: FlexDefaultProps;
|
|
4
|
-
export declare const FlexCol: React.
|
|
4
|
+
export declare const FlexCol: React.ForwardRefExoticComponent<{
|
|
5
|
+
alignItems?: import("csstype").Property.AlignItems | undefined;
|
|
6
|
+
justifyContent?: import("csstype").Property.JustifyContent | undefined;
|
|
7
|
+
gap?: keyof import("../../../theme/modules/sizes").SizeScale | undefined;
|
|
8
|
+
flexWrap?: import("csstype").Property.FlexWrap | undefined;
|
|
9
|
+
flexGrow?: import("csstype").Property.FlexGrow | undefined;
|
|
10
|
+
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { buildClassnames } from '../../../utils/buildClassnames.js';
|
|
3
|
+
import 'uid/secure';
|
|
3
4
|
import flexColStyles from './FlexCol.module.scss.js';
|
|
4
5
|
import flexStyles from '../Flex.module.scss.js';
|
|
5
6
|
|
|
@@ -8,8 +9,9 @@ const FLEX_COL_DEFAULT_PROPS = {
|
|
|
8
9
|
justifyContent: 'flex-start',
|
|
9
10
|
gap: 'sm',
|
|
10
11
|
flexWrap: 'wrap',
|
|
12
|
+
flexGrow: 0,
|
|
11
13
|
};
|
|
12
|
-
const FlexCol = ({ alignItems = FLEX_COL_DEFAULT_PROPS.alignItems, justifyContent = FLEX_COL_DEFAULT_PROPS.justifyContent, gap = FLEX_COL_DEFAULT_PROPS.gap, flexWrap = FLEX_COL_DEFAULT_PROPS.flexWrap, className, style, children, ...rest }) => {
|
|
14
|
+
const FlexCol = React__default.forwardRef(({ alignItems = FLEX_COL_DEFAULT_PROPS.alignItems, justifyContent = FLEX_COL_DEFAULT_PROPS.justifyContent, gap = FLEX_COL_DEFAULT_PROPS.gap, flexWrap = FLEX_COL_DEFAULT_PROPS.flexWrap, flexGrow = FLEX_COL_DEFAULT_PROPS.flexGrow, className, style, children, ...rest }, ref) => {
|
|
13
15
|
const cssClasses = [
|
|
14
16
|
flexColStyles.flexCol,
|
|
15
17
|
flexStyles[`alignItems-${alignItems}`],
|
|
@@ -18,8 +20,8 @@ const FlexCol = ({ alignItems = FLEX_COL_DEFAULT_PROPS.alignItems, justifyConten
|
|
|
18
20
|
flexStyles[`flexWrap-${flexWrap}`],
|
|
19
21
|
className,
|
|
20
22
|
];
|
|
21
|
-
return (React__default.createElement("div", { className: buildClassnames(cssClasses), style: style, ...rest }, children));
|
|
22
|
-
};
|
|
23
|
+
return (React__default.createElement("div", { className: buildClassnames(cssClasses), style: { flexGrow, ...style }, ref: ref, ...rest }, children));
|
|
24
|
+
});
|
|
23
25
|
|
|
24
26
|
export { FLEX_COL_DEFAULT_PROPS, FlexCol };
|
|
25
27
|
//# sourceMappingURL=FlexCol.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlexCol.js","sources":["../../../../src/components/Flex/FlexCol/FlexCol.tsx"],"sourcesContent":["import React from 'react';\nimport { buildClassnames } from '../../../utils
|
|
1
|
+
{"version":3,"file":"FlexCol.js","sources":["../../../../src/components/Flex/FlexCol/FlexCol.tsx"],"sourcesContent":["import React from 'react';\nimport { buildClassnames } from '../../../utils';\nimport { FlexDefaultProps, FlexProps } from '../types';\nimport flexColStyles from './FlexCol.module.scss';\nimport flexStyles from '../Flex.module.scss';\n\nexport const FLEX_COL_DEFAULT_PROPS: FlexDefaultProps = {\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n gap: 'sm',\n flexWrap: 'wrap',\n flexGrow: 0,\n};\n\nexport const FlexCol = React.forwardRef<HTMLDivElement, FlexProps>(\n (\n {\n alignItems = FLEX_COL_DEFAULT_PROPS.alignItems,\n justifyContent = FLEX_COL_DEFAULT_PROPS.justifyContent,\n gap = FLEX_COL_DEFAULT_PROPS.gap,\n flexWrap = FLEX_COL_DEFAULT_PROPS.flexWrap,\n flexGrow = FLEX_COL_DEFAULT_PROPS.flexGrow,\n className,\n style,\n children,\n ...rest\n },\n ref,\n ) => {\n const cssClasses = [\n flexColStyles.flexCol,\n flexStyles[`alignItems-${alignItems}`],\n flexStyles[`justifyContent-${justifyContent}`],\n flexStyles[`gap-${gap}`],\n flexStyles[`flexWrap-${flexWrap}`],\n className,\n ];\n\n return (\n <div\n className={buildClassnames(cssClasses)}\n style={{ flexGrow, ...style }}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n"],"names":["React"],"mappings":";;;;;;AAMa,MAAA,sBAAsB,GAAqB;AACtD,IAAA,UAAU,EAAE,SAAS;AACrB,IAAA,cAAc,EAAE,YAAY;AAC5B,IAAA,GAAG,EAAE,IAAI;AACT,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,QAAQ,EAAE,CAAC;;AAGA,MAAA,OAAO,GAAGA,cAAK,CAAC,UAAU,CACrC,CACE,EACE,UAAU,GAAG,sBAAsB,CAAC,UAAU,EAC9C,cAAc,GAAG,sBAAsB,CAAC,cAAc,EACtD,GAAG,GAAG,sBAAsB,CAAC,GAAG,EAChC,QAAQ,GAAG,sBAAsB,CAAC,QAAQ,EAC1C,QAAQ,GAAG,sBAAsB,CAAC,QAAQ,EAC1C,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EACD,GAAG,KACD;AACF,IAAA,MAAM,UAAU,GAAG;AACjB,QAAA,aAAa,CAAC,OAAO;AACrB,QAAA,UAAU,CAAC,CAAA,WAAA,EAAc,UAAU,CAAA,CAAE,CAAC;AACtC,QAAA,UAAU,CAAC,CAAA,eAAA,EAAkB,cAAc,CAAA,CAAE,CAAC;AAC9C,QAAA,UAAU,CAAC,CAAA,IAAA,EAAO,GAAG,CAAA,CAAE,CAAC;AACxB,QAAA,UAAU,CAAC,CAAA,SAAA,EAAY,QAAQ,CAAA,CAAE,CAAC;QAClC,SAAS;KACV;IAED,QACEA,cACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,eAAe,CAAC,UAAU,CAAC,EACtC,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAC7B,GAAG,EAAE,GAAG,EACJ,GAAA,IAAI,EAEP,EAAA,QAAQ,CACL;AAEV,CAAC;;;;"}
|
|
@@ -15,8 +15,9 @@ const FLEX_ROW_DEFAULT_PROPS = {
|
|
|
15
15
|
justifyContent: 'flex-start',
|
|
16
16
|
gap: 'sm',
|
|
17
17
|
flexWrap: 'wrap',
|
|
18
|
+
flexGrow: 0,
|
|
18
19
|
};
|
|
19
|
-
const FlexRow = React__default.default.forwardRef(({ alignItems = FLEX_ROW_DEFAULT_PROPS.alignItems, justifyContent = FLEX_ROW_DEFAULT_PROPS.justifyContent, gap = FLEX_ROW_DEFAULT_PROPS.gap, flexWrap = FLEX_ROW_DEFAULT_PROPS.flexWrap, className, style, children, ...rest }, ref) => {
|
|
20
|
+
const FlexRow = React__default.default.forwardRef(({ alignItems = FLEX_ROW_DEFAULT_PROPS.alignItems, justifyContent = FLEX_ROW_DEFAULT_PROPS.justifyContent, gap = FLEX_ROW_DEFAULT_PROPS.gap, flexWrap = FLEX_ROW_DEFAULT_PROPS.flexWrap, flexGrow = FLEX_ROW_DEFAULT_PROPS.flexGrow, className, style, children, ...rest }, ref) => {
|
|
20
21
|
const cssClasses = [
|
|
21
22
|
FlexRow_module.flexRow,
|
|
22
23
|
Flex_module[`alignItems-${alignItems}`],
|
|
@@ -25,7 +26,7 @@ const FlexRow = React__default.default.forwardRef(({ alignItems = FLEX_ROW_DEFAU
|
|
|
25
26
|
Flex_module[`flexWrap-${flexWrap}`],
|
|
26
27
|
className,
|
|
27
28
|
];
|
|
28
|
-
return (React__default.default.createElement("div", { className: buildClassnames.buildClassnames(cssClasses), style: style, ref: ref, ...rest }, children));
|
|
29
|
+
return (React__default.default.createElement("div", { className: buildClassnames.buildClassnames(cssClasses), style: { flexGrow, ...style }, ref: ref, ...rest }, children));
|
|
29
30
|
});
|
|
30
31
|
|
|
31
32
|
exports.FLEX_ROW_DEFAULT_PROPS = FLEX_ROW_DEFAULT_PROPS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlexRow.cjs","sources":["../../../../src/components/Flex/FlexRow/FlexRow.tsx"],"sourcesContent":["import React from 'react';\nimport { buildClassnames } from '../../../utils';\nimport { FlexDefaultProps, FlexProps } from '../types';\nimport flexRowStyles from './FlexRow.module.scss';\nimport flexStyles from '../Flex.module.scss';\n\nexport const FLEX_ROW_DEFAULT_PROPS: FlexDefaultProps = {\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: 'sm',\n flexWrap: 'wrap',\n};\n\nexport const FlexRow = React.forwardRef<HTMLDivElement, FlexProps>(\n (\n {\n alignItems = FLEX_ROW_DEFAULT_PROPS.alignItems,\n justifyContent = FLEX_ROW_DEFAULT_PROPS.justifyContent,\n gap = FLEX_ROW_DEFAULT_PROPS.gap,\n flexWrap = FLEX_ROW_DEFAULT_PROPS.flexWrap,\n className,\n style,\n children,\n ...rest\n },\n ref,\n ) => {\n const cssClasses = [\n flexRowStyles.flexRow,\n flexStyles[`alignItems-${alignItems}`],\n flexStyles[`justifyContent-${justifyContent}`],\n flexStyles[`gap-${gap}`],\n flexStyles[`flexWrap-${flexWrap}`],\n className,\n ];\n\n return (\n <div
|
|
1
|
+
{"version":3,"file":"FlexRow.cjs","sources":["../../../../src/components/Flex/FlexRow/FlexRow.tsx"],"sourcesContent":["import React from 'react';\nimport { buildClassnames } from '../../../utils';\nimport { FlexDefaultProps, FlexProps } from '../types';\nimport flexRowStyles from './FlexRow.module.scss';\nimport flexStyles from '../Flex.module.scss';\n\nexport const FLEX_ROW_DEFAULT_PROPS: FlexDefaultProps = {\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: 'sm',\n flexWrap: 'wrap',\n flexGrow: 0,\n};\n\nexport const FlexRow = React.forwardRef<HTMLDivElement, FlexProps>(\n (\n {\n alignItems = FLEX_ROW_DEFAULT_PROPS.alignItems,\n justifyContent = FLEX_ROW_DEFAULT_PROPS.justifyContent,\n gap = FLEX_ROW_DEFAULT_PROPS.gap,\n flexWrap = FLEX_ROW_DEFAULT_PROPS.flexWrap,\n flexGrow = FLEX_ROW_DEFAULT_PROPS.flexGrow,\n className,\n style,\n children,\n ...rest\n },\n ref,\n ) => {\n const cssClasses = [\n flexRowStyles.flexRow,\n flexStyles[`alignItems-${alignItems}`],\n flexStyles[`justifyContent-${justifyContent}`],\n flexStyles[`gap-${gap}`],\n flexStyles[`flexWrap-${flexWrap}`],\n className,\n ];\n\n return (\n <div\n className={buildClassnames(cssClasses)}\n style={{ flexGrow, ...style }}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n"],"names":["React","flexRowStyles","flexStyles","buildClassnames"],"mappings":";;;;;;;;;;;;AAMa,MAAA,sBAAsB,GAAqB;AACtD,IAAA,UAAU,EAAE,QAAQ;AACpB,IAAA,cAAc,EAAE,YAAY;AAC5B,IAAA,GAAG,EAAE,IAAI;AACT,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,QAAQ,EAAE,CAAC;;AAGA,MAAA,OAAO,GAAGA,sBAAK,CAAC,UAAU,CACrC,CACE,EACE,UAAU,GAAG,sBAAsB,CAAC,UAAU,EAC9C,cAAc,GAAG,sBAAsB,CAAC,cAAc,EACtD,GAAG,GAAG,sBAAsB,CAAC,GAAG,EAChC,QAAQ,GAAG,sBAAsB,CAAC,QAAQ,EAC1C,QAAQ,GAAG,sBAAsB,CAAC,QAAQ,EAC1C,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EACD,GAAG,KACD;AACF,IAAA,MAAM,UAAU,GAAG;AACjB,QAAAC,cAAa,CAAC,OAAO;AACrB,QAAAC,WAAU,CAAC,CAAA,WAAA,EAAc,UAAU,CAAA,CAAE,CAAC;AACtC,QAAAA,WAAU,CAAC,CAAA,eAAA,EAAkB,cAAc,CAAA,CAAE,CAAC;AAC9C,QAAAA,WAAU,CAAC,CAAA,IAAA,EAAO,GAAG,CAAA,CAAE,CAAC;AACxB,QAAAA,WAAU,CAAC,CAAA,SAAA,EAAY,QAAQ,CAAA,CAAE,CAAC;QAClC,SAAS;KACV;IAED,QACEF,sBACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEG,+BAAe,CAAC,UAAU,CAAC,EACtC,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAC7B,GAAG,EAAE,GAAG,EACJ,GAAA,IAAI,EAEP,EAAA,QAAQ,CACL;AAEV,CAAC;;;;;"}
|
|
@@ -6,4 +6,5 @@ export declare const FlexRow: React.ForwardRefExoticComponent<{
|
|
|
6
6
|
justifyContent?: import("csstype").Property.JustifyContent | undefined;
|
|
7
7
|
gap?: keyof import("../../../theme/modules/sizes").SizeScale | undefined;
|
|
8
8
|
flexWrap?: import("csstype").Property.FlexWrap | undefined;
|
|
9
|
+
flexGrow?: import("csstype").Property.FlexGrow | undefined;
|
|
9
10
|
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -9,8 +9,9 @@ const FLEX_ROW_DEFAULT_PROPS = {
|
|
|
9
9
|
justifyContent: 'flex-start',
|
|
10
10
|
gap: 'sm',
|
|
11
11
|
flexWrap: 'wrap',
|
|
12
|
+
flexGrow: 0,
|
|
12
13
|
};
|
|
13
|
-
const FlexRow = React__default.forwardRef(({ alignItems = FLEX_ROW_DEFAULT_PROPS.alignItems, justifyContent = FLEX_ROW_DEFAULT_PROPS.justifyContent, gap = FLEX_ROW_DEFAULT_PROPS.gap, flexWrap = FLEX_ROW_DEFAULT_PROPS.flexWrap, className, style, children, ...rest }, ref) => {
|
|
14
|
+
const FlexRow = React__default.forwardRef(({ alignItems = FLEX_ROW_DEFAULT_PROPS.alignItems, justifyContent = FLEX_ROW_DEFAULT_PROPS.justifyContent, gap = FLEX_ROW_DEFAULT_PROPS.gap, flexWrap = FLEX_ROW_DEFAULT_PROPS.flexWrap, flexGrow = FLEX_ROW_DEFAULT_PROPS.flexGrow, className, style, children, ...rest }, ref) => {
|
|
14
15
|
const cssClasses = [
|
|
15
16
|
flexRowStyles.flexRow,
|
|
16
17
|
flexStyles[`alignItems-${alignItems}`],
|
|
@@ -19,7 +20,7 @@ const FlexRow = React__default.forwardRef(({ alignItems = FLEX_ROW_DEFAULT_PROPS
|
|
|
19
20
|
flexStyles[`flexWrap-${flexWrap}`],
|
|
20
21
|
className,
|
|
21
22
|
];
|
|
22
|
-
return (React__default.createElement("div", { className: buildClassnames(cssClasses), style: style, ref: ref, ...rest }, children));
|
|
23
|
+
return (React__default.createElement("div", { className: buildClassnames(cssClasses), style: { flexGrow, ...style }, ref: ref, ...rest }, children));
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
export { FLEX_ROW_DEFAULT_PROPS, FlexRow };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlexRow.js","sources":["../../../../src/components/Flex/FlexRow/FlexRow.tsx"],"sourcesContent":["import React from 'react';\nimport { buildClassnames } from '../../../utils';\nimport { FlexDefaultProps, FlexProps } from '../types';\nimport flexRowStyles from './FlexRow.module.scss';\nimport flexStyles from '../Flex.module.scss';\n\nexport const FLEX_ROW_DEFAULT_PROPS: FlexDefaultProps = {\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: 'sm',\n flexWrap: 'wrap',\n};\n\nexport const FlexRow = React.forwardRef<HTMLDivElement, FlexProps>(\n (\n {\n alignItems = FLEX_ROW_DEFAULT_PROPS.alignItems,\n justifyContent = FLEX_ROW_DEFAULT_PROPS.justifyContent,\n gap = FLEX_ROW_DEFAULT_PROPS.gap,\n flexWrap = FLEX_ROW_DEFAULT_PROPS.flexWrap,\n className,\n style,\n children,\n ...rest\n },\n ref,\n ) => {\n const cssClasses = [\n flexRowStyles.flexRow,\n flexStyles[`alignItems-${alignItems}`],\n flexStyles[`justifyContent-${justifyContent}`],\n flexStyles[`gap-${gap}`],\n flexStyles[`flexWrap-${flexWrap}`],\n className,\n ];\n\n return (\n <div
|
|
1
|
+
{"version":3,"file":"FlexRow.js","sources":["../../../../src/components/Flex/FlexRow/FlexRow.tsx"],"sourcesContent":["import React from 'react';\nimport { buildClassnames } from '../../../utils';\nimport { FlexDefaultProps, FlexProps } from '../types';\nimport flexRowStyles from './FlexRow.module.scss';\nimport flexStyles from '../Flex.module.scss';\n\nexport const FLEX_ROW_DEFAULT_PROPS: FlexDefaultProps = {\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: 'sm',\n flexWrap: 'wrap',\n flexGrow: 0,\n};\n\nexport const FlexRow = React.forwardRef<HTMLDivElement, FlexProps>(\n (\n {\n alignItems = FLEX_ROW_DEFAULT_PROPS.alignItems,\n justifyContent = FLEX_ROW_DEFAULT_PROPS.justifyContent,\n gap = FLEX_ROW_DEFAULT_PROPS.gap,\n flexWrap = FLEX_ROW_DEFAULT_PROPS.flexWrap,\n flexGrow = FLEX_ROW_DEFAULT_PROPS.flexGrow,\n className,\n style,\n children,\n ...rest\n },\n ref,\n ) => {\n const cssClasses = [\n flexRowStyles.flexRow,\n flexStyles[`alignItems-${alignItems}`],\n flexStyles[`justifyContent-${justifyContent}`],\n flexStyles[`gap-${gap}`],\n flexStyles[`flexWrap-${flexWrap}`],\n className,\n ];\n\n return (\n <div\n className={buildClassnames(cssClasses)}\n style={{ flexGrow, ...style }}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n"],"names":["React"],"mappings":";;;;;;AAMa,MAAA,sBAAsB,GAAqB;AACtD,IAAA,UAAU,EAAE,QAAQ;AACpB,IAAA,cAAc,EAAE,YAAY;AAC5B,IAAA,GAAG,EAAE,IAAI;AACT,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,QAAQ,EAAE,CAAC;;AAGA,MAAA,OAAO,GAAGA,cAAK,CAAC,UAAU,CACrC,CACE,EACE,UAAU,GAAG,sBAAsB,CAAC,UAAU,EAC9C,cAAc,GAAG,sBAAsB,CAAC,cAAc,EACtD,GAAG,GAAG,sBAAsB,CAAC,GAAG,EAChC,QAAQ,GAAG,sBAAsB,CAAC,QAAQ,EAC1C,QAAQ,GAAG,sBAAsB,CAAC,QAAQ,EAC1C,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EACD,GAAG,KACD;AACF,IAAA,MAAM,UAAU,GAAG;AACjB,QAAA,aAAa,CAAC,OAAO;AACrB,QAAA,UAAU,CAAC,CAAA,WAAA,EAAc,UAAU,CAAA,CAAE,CAAC;AACtC,QAAA,UAAU,CAAC,CAAA,eAAA,EAAkB,cAAc,CAAA,CAAE,CAAC;AAC9C,QAAA,UAAU,CAAC,CAAA,IAAA,EAAO,GAAG,CAAA,CAAE,CAAC;AACxB,QAAA,UAAU,CAAC,CAAA,SAAA,EAAY,QAAQ,CAAA,CAAE,CAAC;QAClC,SAAS;KACV;IAED,QACEA,cACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,eAAe,CAAC,UAAU,CAAC,EACtC,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAC7B,GAAG,EAAE,GAAG,EACJ,GAAA,IAAI,EAEP,EAAA,QAAQ,CACL;AAEV,CAAC;;;;"}
|
|
@@ -5,6 +5,7 @@ export type FlexProps = {
|
|
|
5
5
|
justifyContent?: CSSProperties['justifyContent'];
|
|
6
6
|
gap?: keyof typeof sizes;
|
|
7
7
|
flexWrap?: CSSProperties['flexWrap'];
|
|
8
|
+
flexGrow?: CSSProperties['flexGrow'];
|
|
8
9
|
} & HTMLAttributes<HTMLDivElement>;
|
|
9
|
-
export type FlexDefaultProps = Pick<CSSProperties, 'alignItems' | 'justifyContent' | 'gap' | 'flexWrap'>;
|
|
10
|
+
export type FlexDefaultProps = Pick<CSSProperties, 'alignItems' | 'justifyContent' | 'gap' | 'flexWrap' | 'flexGrow'>;
|
|
10
11
|
export {};
|
|
@@ -4,6 +4,7 @@ export declare const PageLimitContainer: import("styled-components").StyledCompo
|
|
|
4
4
|
justifyContent?: import("csstype").Property.JustifyContent | undefined;
|
|
5
5
|
gap?: keyof import("../../theme/modules/sizes").SizeScale | undefined;
|
|
6
6
|
flexWrap?: import("csstype").Property.FlexWrap | undefined;
|
|
7
|
+
flexGrow?: import("csstype").Property.FlexGrow | undefined;
|
|
7
8
|
} & import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
8
9
|
export declare const PaginationButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
9
10
|
children?: import("react").ReactNode;
|
|
@@ -6,8 +6,8 @@ var buildClassnames = require('../../utils/buildClassnames.cjs');
|
|
|
6
6
|
require('uid/secure');
|
|
7
7
|
var SelectedOption = require('./components/SelectedOption.cjs');
|
|
8
8
|
var utils = require('./utils.cjs');
|
|
9
|
-
var ListItemSection = require('./ListItemSection/ListItemSection.cjs');
|
|
10
|
-
var ListItem = require('./ListItem/ListItem.cjs');
|
|
9
|
+
var ListItemSection = require('./components/ListItemSection/ListItemSection.cjs');
|
|
10
|
+
var ListItem = require('./components/ListItem/ListItem.cjs');
|
|
11
11
|
var SelectDropdownState = require('./components/SelectDropdownState.cjs');
|
|
12
12
|
var Dropdown = require('../Dropdown/Dropdown.cjs');
|
|
13
13
|
var Search = require('../Search/Search.cjs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDropdown.cjs","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { Fragment, useCallback, useState } from 'react';\nimport { Key, ListBox, Selection } from 'react-aria-components';\n\nimport { buildClassnames } from '../../utils';\nimport { SelectedOption } from './components/SelectedOption';\nimport { generateClassNames, getSelectedValues } from './utils';\nimport { SelectDropdownItem, SelectDropdownProps } from './types';\nimport {
|
|
1
|
+
{"version":3,"file":"SelectDropdown.cjs","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { Fragment, useCallback, useState } from 'react';\nimport { Key, ListBox, Selection } from 'react-aria-components';\n\nimport { buildClassnames } from '../../utils';\nimport { SelectedOption } from './components/SelectedOption';\nimport { generateClassNames, getSelectedValues } from './utils';\nimport { SelectDropdownItem, SelectDropdownProps } from './types';\nimport {\n ListItemSection,\n ListItemSectionProps,\n} from './components/ListItemSection/ListItemSection';\nimport { ListItem } from './components/ListItem';\nimport { ListItemProps } from './components/ListItem/types';\nimport { SelectDropdownState } from './components/SelectDropdownState';\nimport { Dropdown } from '../Dropdown';\nimport { Search } from '../Search';\nimport { Button } from '../Button';\nimport styles from './SelectDropdown.module.scss';\nimport formStyles from '../../utils/forms/form.module.scss';\n\nexport const SelectDropdown = ({\n id,\n className,\n placeholder = 'Select item',\n multiple = false,\n compact = false,\n hasError = false,\n disabled,\n options,\n value,\n actions,\n isLoading = false,\n searchValue,\n emptyStateSlot,\n onSearchChange,\n onChange,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...otherProps\n}: SelectDropdownProps) => {\n const hasSection = options.flatMap((option) => option).some((item) => 'items' in item);\n const classNames = generateClassNames(className);\n\n const [isSelectOpen, setIsSelectOpen] = useState(false);\n\n const selectedValues = getSelectedValues(options, hasSection, value);\n const selectionMode = multiple ? 'multiple' : 'single';\n\n const onSelectionChange = useCallback(\n (keys: Selection) => {\n const selectedKeys = Array.from(keys);\n const newSelectedValues = getSelectedValues(options, hasSection, selectedKeys);\n\n if (multiple) {\n (onChange as (items: SelectDropdownItem[]) => void)(newSelectedValues);\n } else {\n (onChange as (item: SelectDropdownItem) => void)(newSelectedValues[0]);\n setIsSelectOpen(false);\n }\n },\n [options, hasSection, multiple, onChange],\n );\n\n return (\n <Dropdown\n id={`select-dropdown-${id}`}\n className={buildClassnames([classNames?.popover, styles.dropdown, className])}\n shouldShow={isSelectOpen}\n setShouldShow={setIsSelectOpen}\n useAnchorWidth\n disabled={disabled}\n renderCta={(buttonProps, anchorRef) => (\n <button\n {...buttonProps}\n type=\"button\"\n ref={anchorRef}\n className={buildClassnames([\n className,\n styles.dropdownTrigger,\n formStyles.fullStyles,\n formStyles.base,\n hasError && formStyles.error,\n compact && formStyles.compact,\n ])}\n >\n <SelectedOption\n placeholder={placeholder}\n options={selectedValues}\n selectionMode={selectionMode}\n />\n </button>\n )}\n >\n {onSearchChange && (\n <>\n <Search className={styles.search} value={searchValue} onChange={onSearchChange} />\n <hr className={styles.separator} />\n </>\n )}\n <ListBox\n className={buildClassnames([classNames?.optionsContainer, styles.listBox, className])}\n aria-labelledby={ariaLabelledBy ?? `${id}-label`}\n aria-describedby={ariaDescribedBy ?? `${id}-hint`}\n selectionMode={selectionMode}\n items={options}\n onSelectionChange={onSelectionChange}\n selectedKeys={selectedValues.map((selectedValue) => selectedValue.id) as Key[]}\n renderEmptyState={() => (\n <SelectDropdownState isLoading={isLoading} emptyStateSlot={emptyStateSlot} />\n )}\n {...otherProps}\n >\n {(item) =>\n hasSection ? (\n <ListItemSection {...(item as ListItemSectionProps)} />\n ) : (\n <ListItem {...(item as ListItemProps)} />\n )\n }\n </ListBox>\n {actions?.map(({ label, ...actionProps }) => (\n <Fragment key={label}>\n <hr className={styles.separator} key={`seperator-${label}`} />\n <Button className={styles.ctaButton} variant=\"flat\" key={label} {...actionProps} />\n </Fragment>\n ))}\n </Dropdown>\n );\n};\n"],"names":["generateClassNames","useState","getSelectedValues","useCallback","React","Dropdown","buildClassnames","styles","formStyles","SelectedOption","Search","ListBox","SelectDropdownState","ListItemSection","ListItem","Fragment","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAqBa,MAAA,cAAc,GAAG,CAAC,EAC7B,EAAE,EACF,SAAS,EACT,WAAW,GAAG,aAAa,EAC3B,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,OAAO,EACP,KAAK,EACL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AAC,MAAM,EAAC,GAAG,EAAE,KAAK,EAAA,GAAM,WAAW,EAAA,CAAI,CAC1E,CACZ,CAAC,CACO;AAEf;;;;"}
|
|
@@ -4,8 +4,8 @@ import { buildClassnames } from '../../utils/buildClassnames.js';
|
|
|
4
4
|
import 'uid/secure';
|
|
5
5
|
import { SelectedOption } from './components/SelectedOption.js';
|
|
6
6
|
import { getSelectedValues, generateClassNames } from './utils.js';
|
|
7
|
-
import { ListItemSection } from './ListItemSection/ListItemSection.js';
|
|
8
|
-
import { ListItem } from './ListItem/ListItem.js';
|
|
7
|
+
import { ListItemSection } from './components/ListItemSection/ListItemSection.js';
|
|
8
|
+
import { ListItem } from './components/ListItem/ListItem.js';
|
|
9
9
|
import { SelectDropdownState } from './components/SelectDropdownState.js';
|
|
10
10
|
import { Dropdown } from '../Dropdown/Dropdown.js';
|
|
11
11
|
import { Search } from '../Search/Search.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDropdown.js","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { Fragment, useCallback, useState } from 'react';\nimport { Key, ListBox, Selection } from 'react-aria-components';\n\nimport { buildClassnames } from '../../utils';\nimport { SelectedOption } from './components/SelectedOption';\nimport { generateClassNames, getSelectedValues } from './utils';\nimport { SelectDropdownItem, SelectDropdownProps } from './types';\nimport {
|
|
1
|
+
{"version":3,"file":"SelectDropdown.js","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { Fragment, useCallback, useState } from 'react';\nimport { Key, ListBox, Selection } from 'react-aria-components';\n\nimport { buildClassnames } from '../../utils';\nimport { SelectedOption } from './components/SelectedOption';\nimport { generateClassNames, getSelectedValues } from './utils';\nimport { SelectDropdownItem, SelectDropdownProps } from './types';\nimport {\n ListItemSection,\n ListItemSectionProps,\n} from './components/ListItemSection/ListItemSection';\nimport { ListItem } from './components/ListItem';\nimport { ListItemProps } from './components/ListItem/types';\nimport { SelectDropdownState } from './components/SelectDropdownState';\nimport { Dropdown } from '../Dropdown';\nimport { Search } from '../Search';\nimport { Button } from '../Button';\nimport styles from './SelectDropdown.module.scss';\nimport formStyles from '../../utils/forms/form.module.scss';\n\nexport const SelectDropdown = ({\n id,\n className,\n placeholder = 'Select item',\n multiple = false,\n compact = false,\n hasError = false,\n disabled,\n options,\n value,\n actions,\n isLoading = false,\n searchValue,\n emptyStateSlot,\n onSearchChange,\n onChange,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...otherProps\n}: SelectDropdownProps) => {\n const hasSection = options.flatMap((option) => option).some((item) => 'items' in item);\n const classNames = generateClassNames(className);\n\n const [isSelectOpen, setIsSelectOpen] = useState(false);\n\n const selectedValues = getSelectedValues(options, hasSection, value);\n const selectionMode = multiple ? 'multiple' : 'single';\n\n const onSelectionChange = useCallback(\n (keys: Selection) => {\n const selectedKeys = Array.from(keys);\n const newSelectedValues = getSelectedValues(options, hasSection, selectedKeys);\n\n if (multiple) {\n (onChange as (items: SelectDropdownItem[]) => void)(newSelectedValues);\n } else {\n (onChange as (item: SelectDropdownItem) => void)(newSelectedValues[0]);\n setIsSelectOpen(false);\n }\n },\n [options, hasSection, multiple, onChange],\n );\n\n return (\n <Dropdown\n id={`select-dropdown-${id}`}\n className={buildClassnames([classNames?.popover, styles.dropdown, className])}\n shouldShow={isSelectOpen}\n setShouldShow={setIsSelectOpen}\n useAnchorWidth\n disabled={disabled}\n renderCta={(buttonProps, anchorRef) => (\n <button\n {...buttonProps}\n type=\"button\"\n ref={anchorRef}\n className={buildClassnames([\n className,\n styles.dropdownTrigger,\n formStyles.fullStyles,\n formStyles.base,\n hasError && formStyles.error,\n compact && formStyles.compact,\n ])}\n >\n <SelectedOption\n placeholder={placeholder}\n options={selectedValues}\n selectionMode={selectionMode}\n />\n </button>\n )}\n >\n {onSearchChange && (\n <>\n <Search className={styles.search} value={searchValue} onChange={onSearchChange} />\n <hr className={styles.separator} />\n </>\n )}\n <ListBox\n className={buildClassnames([classNames?.optionsContainer, styles.listBox, className])}\n aria-labelledby={ariaLabelledBy ?? `${id}-label`}\n aria-describedby={ariaDescribedBy ?? `${id}-hint`}\n selectionMode={selectionMode}\n items={options}\n onSelectionChange={onSelectionChange}\n selectedKeys={selectedValues.map((selectedValue) => selectedValue.id) as Key[]}\n renderEmptyState={() => (\n <SelectDropdownState isLoading={isLoading} emptyStateSlot={emptyStateSlot} />\n )}\n {...otherProps}\n >\n {(item) =>\n hasSection ? (\n <ListItemSection {...(item as ListItemSectionProps)} />\n ) : (\n <ListItem {...(item as ListItemProps)} />\n )\n }\n </ListBox>\n {actions?.map(({ label, ...actionProps }) => (\n <Fragment key={label}>\n <hr className={styles.separator} key={`seperator-${label}`} />\n <Button className={styles.ctaButton} variant=\"flat\" key={label} {...actionProps} />\n </Fragment>\n ))}\n </Dropdown>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;AAAA;AAqBa,MAAA,cAAc,GAAG,CAAC,EAC7B,EAAE,EACF,SAAS,EACT,WAAW,GAAG,aAAa,EAC3B,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,eAAe,EACnC,GAAG,UAAU,EACO,KAAI;IACxB,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC;AACtF,IAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC,SAAS,CAAC;IAEhD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAA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,cAAA,CAAA,aAAA,CAAC,mBAAmB,EAAA,EAAC,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAA,CAAI,CAC9E,EAAA,GACG,UAAU,EAAA,EAEb,CAAC,IAAI,KACJ,UAAU,IACRA,cAAC,CAAA,aAAA,CAAA,eAAe,EAAM,EAAA,GAAA,IAA6B,EAAI,CAAA,KAEvDA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAM,EAAA,GAAA,IAAsB,EAAI,CAAA,CAC1C,CAEK,EACT,OAAO,KAAA,IAAA,IAAP,OAAO,KAAA,SAAA,GAAA,SAAA;AAAP,QAAA,OAAO,CAAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,MACtCA,cAAA,CAAA,aAAA,CAAC,QAAQ,EAAC,EAAA,GAAG,EAAE,KAAK,EAAA;YAClBA,cAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE,CAAA,UAAA,EAAa,KAAK,CAAA,CAAE,EAAI,CAAA;YAC9DA,cAAC,CAAA,aAAA,CAAA,MAAM,IAAC,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAC,MAAM,EAAC,GAAG,EAAE,KAAK,EAAA,GAAM,WAAW,EAAA,CAAI,CAC1E,CACZ,CAAC,CACO;AAEf;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GridItem } from './GridItem';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GridListItemProps } from 'react-aria-components';
|
|
2
|
+
import { BaseItemProps } from '../types';
|
|
3
|
+
export type GridItemProps = BaseItemProps & GridListItemProps & {
|
|
4
|
+
onClickRowAction?: () => void;
|
|
5
|
+
rowActionAriaLabel?: string;
|
|
6
|
+
isRowActionDisabled?: boolean;
|
|
7
|
+
};
|
|
@@ -10,43 +10,43 @@ var DragIndicatorIcon = require('../../../../icons/design-system/components/Drag
|
|
|
10
10
|
var Text = require('../../../Text/Text.cjs');
|
|
11
11
|
var MiniAlert = require('../../../Alerts/MiniAlert/MiniAlert.cjs');
|
|
12
12
|
var SelectionType = require('./SelectionType.cjs');
|
|
13
|
-
var
|
|
13
|
+
var ItemContent_module = require('./ItemContent.module.scss.cjs');
|
|
14
14
|
var FlexRow = require('../../../Flex/FlexRow/FlexRow.cjs');
|
|
15
15
|
|
|
16
16
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
17
17
|
|
|
18
18
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const base =
|
|
20
|
+
const ItemContent = ({ label, hint, itemInfoSlot, endInfoSlot, alert, mediaSlot, allowsDragging = false, selectionMode = 'single', isLink, isSelected = false, itemType, }) => {
|
|
21
|
+
const infoContainerClassNames = React.useMemo(() => {
|
|
22
|
+
const base = ItemContent_module.infoContainer;
|
|
23
23
|
if (itemInfoSlot && endInfoSlot) {
|
|
24
|
-
return buildClassnames.buildClassnames([base,
|
|
24
|
+
return buildClassnames.buildClassnames([base, ItemContent_module.hasItemInfoAndEndInfo]);
|
|
25
25
|
}
|
|
26
26
|
if (itemInfoSlot) {
|
|
27
|
-
return buildClassnames.buildClassnames([base,
|
|
27
|
+
return buildClassnames.buildClassnames([base, ItemContent_module.hasItemInfoOnly]);
|
|
28
28
|
}
|
|
29
29
|
if (endInfoSlot) {
|
|
30
|
-
return buildClassnames.buildClassnames([base,
|
|
30
|
+
return buildClassnames.buildClassnames([base, ItemContent_module.hasEndInfoOnly]);
|
|
31
31
|
}
|
|
32
32
|
return buildClassnames.buildClassnames([base]);
|
|
33
33
|
}, [endInfoSlot, itemInfoSlot]);
|
|
34
|
-
return (React__default.default.createElement(FlexRow.FlexRow, { flexWrap: "nowrap", justifyContent: "space-between", alignItems: "center", gap: "base" },
|
|
34
|
+
return (React__default.default.createElement(FlexRow.FlexRow, { flexWrap: "nowrap", justifyContent: "space-between", alignItems: "center", gap: "base", style: { flexGrow: 1 } },
|
|
35
35
|
React__default.default.createElement(FlexRow.FlexRow, { flexWrap: "nowrap", gap: "base", style: { flexGrow: 1 } },
|
|
36
36
|
allowsDragging && React__default.default.createElement(DragIndicatorIcon.ReactComponent, { "data-testid": "drag-icon" }),
|
|
37
37
|
React__default.default.createElement(SelectionType.SelectionType, { selectionMode: selectionMode, isSelected: isSelected, isLink: isLink }),
|
|
38
38
|
mediaSlot,
|
|
39
39
|
React__default.default.createElement(FlexCol.FlexCol, { gap: "xs", style: { flexGrow: 1 } },
|
|
40
|
-
React__default.default.createElement("div", { className:
|
|
41
|
-
React__default.default.createElement(reactAriaComponents.Text, { slot: "label" },
|
|
42
|
-
React__default.default.createElement(Text.Text, { variant: "body" }, label)),
|
|
40
|
+
React__default.default.createElement("div", { className: infoContainerClassNames, "data-testid": "info-container" },
|
|
41
|
+
itemType === 'grid' ? (React__default.default.createElement(Text.Text, { variant: "body" }, label)) : (React__default.default.createElement(reactAriaComponents.Text, { slot: "label" },
|
|
42
|
+
React__default.default.createElement(Text.Text, { variant: "body" }, label))),
|
|
43
43
|
itemInfoSlot,
|
|
44
|
-
endInfoSlot && (React__default.default.createElement("div", { className: endInfoSlot ?
|
|
44
|
+
endInfoSlot && (React__default.default.createElement("div", { className: endInfoSlot ? ItemContent_module.justifyEnd : ItemContent_module.justifyStart }, endInfoSlot))),
|
|
45
45
|
hint && (React__default.default.createElement(reactAriaComponents.Text, { slot: "description" },
|
|
46
46
|
React__default.default.createElement(Text.Text, { variant: "hintText" }, hint))),
|
|
47
47
|
alert && React__default.default.createElement(MiniAlert.MiniAlert, { title: alert.title, variant: alert.variant }))),
|
|
48
|
-
isLink && React__default.default.createElement(ArrowRightIcon.ReactComponent, { className:
|
|
48
|
+
isLink && React__default.default.createElement(ArrowRightIcon.ReactComponent, { className: ItemContent_module.linkIcon, "data-testid": "link-icon" })));
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
exports.
|
|
52
|
-
//# sourceMappingURL=
|
|
51
|
+
exports.ItemContent = ItemContent;
|
|
52
|
+
//# sourceMappingURL=ItemContent.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemContent.cjs","sources":["../../../../../src/components/SelectDropdown/components/ItemContent/ItemContent.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Text } from 'react-aria-components';\nimport { buildClassnames } from '../../../../utils';\nimport { FlexCol } from '../../../Flex/FlexCol';\nimport { ArrowRightIcon, DragIndicatorIcon } from '../../../../icons';\nimport { ItemContentProps } from './types';\nimport { Text as VeeqoText } from '../../../Text';\nimport { MiniAlert } from '../../../Alerts/MiniAlert';\nimport { SelectionType } from './SelectionType';\nimport styles from './ItemContent.module.scss';\nimport { FlexRow } from '../../../Flex/FlexRow';\n\nexport const ItemContent = ({\n label,\n hint,\n itemInfoSlot,\n endInfoSlot,\n alert,\n mediaSlot,\n allowsDragging = false,\n selectionMode = 'single',\n isLink,\n isSelected = false,\n itemType,\n}: ItemContentProps) => {\n const infoContainerClassNames = useMemo(() => {\n const base = styles.infoContainer;\n\n if (itemInfoSlot && endInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoAndEndInfo]);\n }\n\n if (itemInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoOnly]);\n }\n\n if (endInfoSlot) {\n return buildClassnames([base, styles.hasEndInfoOnly]);\n }\n\n return buildClassnames([base]);\n }, [endInfoSlot, itemInfoSlot]);\n\n return (\n <FlexRow\n flexWrap=\"nowrap\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n gap=\"base\"\n style={{ flexGrow: 1 }}\n >\n <FlexRow flexWrap=\"nowrap\" gap=\"base\" style={{ flexGrow: 1 }}>\n {allowsDragging && <DragIndicatorIcon data-testid=\"drag-icon\" />}\n <SelectionType selectionMode={selectionMode} isSelected={isSelected} isLink={isLink} />\n {mediaSlot}\n <FlexCol gap=\"xs\" style={{ flexGrow: 1 }}>\n <div className={infoContainerClassNames} data-testid=\"info-container\">\n {itemType === 'grid' ? (\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n ) : (\n <Text slot=\"label\">\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n </Text>\n )}\n {itemInfoSlot}\n {endInfoSlot && (\n <div className={endInfoSlot ? styles.justifyEnd : styles.justifyStart}>\n {endInfoSlot}\n </div>\n )}\n </div>\n\n {hint && (\n <Text slot=\"description\">\n <VeeqoText variant=\"hintText\">{hint}</VeeqoText>\n </Text>\n )}\n {alert && <MiniAlert title={alert.title} variant={alert.variant} />}\n </FlexCol>\n </FlexRow>\n {isLink && <ArrowRightIcon className={styles.linkIcon} data-testid=\"link-icon\" />}\n </FlexRow>\n );\n};\n"],"names":["useMemo","styles","buildClassnames","React","FlexRow","DragIndicatorIcon","SelectionType","FlexCol","VeeqoText","Text","MiniAlert","ArrowRightIcon"],"mappings":";;;;;;;;;;;;;;;;;;;AAYO,MAAM,WAAW,GAAG,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,cAAc,GAAG,KAAK,EACtB,aAAa,GAAG,QAAQ,EACxB,MAAM,EACN,UAAU,GAAG,KAAK,EAClB,QAAQ,GACS,KAAI;AACrB,IAAA,MAAM,uBAAuB,GAAGA,aAAO,CAAC,MAAK;AAC3C,QAAA,MAAM,IAAI,GAAGC,kBAAM,CAAC,aAAa;QAEjC,IAAI,YAAY,IAAI,WAAW,EAAE;YAC/B,OAAOC,+BAAe,CAAC,CAAC,IAAI,EAAED,kBAAM,CAAC,qBAAqB,CAAC,CAAC;AAC7D;AAED,QAAA,IAAI,YAAY,EAAE;YAChB,OAAOC,+BAAe,CAAC,CAAC,IAAI,EAAED,kBAAM,CAAC,eAAe,CAAC,CAAC;AACvD;AAED,QAAA,IAAI,WAAW,EAAE;YACf,OAAOC,+BAAe,CAAC,CAAC,IAAI,EAAED,kBAAM,CA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,EAAC,MAAM,EAAE,EAAA,KAAK,CAAa,CACxC,CACR;oBACA,YAAY;oBACZ,WAAW,KACVL,sBAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,WAAW,GAAGF,kBAAM,CAAC,UAAU,GAAGA,kBAAM,CAAC,YAAY,EAClE,EAAA,WAAW,CACR,CACP,CACG;AAEL,gBAAA,IAAI,KACHE,sBAAA,CAAA,aAAA,CAACM,wBAAI,EAAC,EAAA,IAAI,EAAC,aAAa,EAAA;oBACtBN,sBAAC,CAAA,aAAA,CAAAK,SAAS,IAAC,OAAO,EAAC,UAAU,EAAE,EAAA,IAAI,CAAa,CAC3C,CACR;AACA,gBAAA,KAAK,IAAIL,sBAAC,CAAA,aAAA,CAAAO,mBAAS,EAAC,EAAA,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAA,CAAI,CAC3D,CACF;AACT,QAAA,MAAM,IAAIP,sBAAA,CAAA,aAAA,CAACQ,6BAAc,EAAA,EAAC,SAAS,EAAEV,kBAAM,CAAC,QAAQ,EAAc,aAAA,EAAA,WAAW,EAAG,CAAA,CACzE;AAEd;;;;"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React__default, { useMemo } from 'react';
|
|
2
|
-
import { Text } from 'react-aria-components';
|
|
2
|
+
import { Text as Text$1 } from 'react-aria-components';
|
|
3
3
|
import { buildClassnames } from '../../../../utils/buildClassnames.js';
|
|
4
4
|
import 'uid/secure';
|
|
5
5
|
import { FlexCol } from '../../../Flex/FlexCol/FlexCol.js';
|
|
6
6
|
import { ReactComponent as ArrowRightIcon } from '../../../../icons/design-system/components/ArrowRightIcon.js';
|
|
7
7
|
import { ReactComponent as DragIndicatorIcon } from '../../../../icons/design-system/components/DragIndicatorIcon.js';
|
|
8
|
-
import { Text
|
|
8
|
+
import { Text } from '../../../Text/Text.js';
|
|
9
9
|
import { MiniAlert } from '../../../Alerts/MiniAlert/MiniAlert.js';
|
|
10
10
|
import { SelectionType } from './SelectionType.js';
|
|
11
|
-
import styles from '
|
|
11
|
+
import styles from './ItemContent.module.scss.js';
|
|
12
12
|
import { FlexRow } from '../../../Flex/FlexRow/FlexRow.js';
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const ItemContent = ({ label, hint, itemInfoSlot, endInfoSlot, alert, mediaSlot, allowsDragging = false, selectionMode = 'single', isLink, isSelected = false, itemType, }) => {
|
|
15
|
+
const infoContainerClassNames = useMemo(() => {
|
|
16
16
|
const base = styles.infoContainer;
|
|
17
17
|
if (itemInfoSlot && endInfoSlot) {
|
|
18
18
|
return buildClassnames([base, styles.hasItemInfoAndEndInfo]);
|
|
@@ -25,22 +25,22 @@ const ListItemContent = ({ label, hint, itemInfoSlot, endInfoSlot, alert, mediaS
|
|
|
25
25
|
}
|
|
26
26
|
return buildClassnames([base]);
|
|
27
27
|
}, [endInfoSlot, itemInfoSlot]);
|
|
28
|
-
return (React__default.createElement(FlexRow, { flexWrap: "nowrap", justifyContent: "space-between", alignItems: "center", gap: "base" },
|
|
28
|
+
return (React__default.createElement(FlexRow, { flexWrap: "nowrap", justifyContent: "space-between", alignItems: "center", gap: "base", style: { flexGrow: 1 } },
|
|
29
29
|
React__default.createElement(FlexRow, { flexWrap: "nowrap", gap: "base", style: { flexGrow: 1 } },
|
|
30
30
|
allowsDragging && React__default.createElement(DragIndicatorIcon, { "data-testid": "drag-icon" }),
|
|
31
31
|
React__default.createElement(SelectionType, { selectionMode: selectionMode, isSelected: isSelected, isLink: isLink }),
|
|
32
32
|
mediaSlot,
|
|
33
33
|
React__default.createElement(FlexCol, { gap: "xs", style: { flexGrow: 1 } },
|
|
34
|
-
React__default.createElement("div", { className:
|
|
35
|
-
React__default.createElement(Text, { slot: "label" },
|
|
36
|
-
React__default.createElement(Text
|
|
34
|
+
React__default.createElement("div", { className: infoContainerClassNames, "data-testid": "info-container" },
|
|
35
|
+
itemType === 'grid' ? (React__default.createElement(Text, { variant: "body" }, label)) : (React__default.createElement(Text$1, { slot: "label" },
|
|
36
|
+
React__default.createElement(Text, { variant: "body" }, label))),
|
|
37
37
|
itemInfoSlot,
|
|
38
38
|
endInfoSlot && (React__default.createElement("div", { className: endInfoSlot ? styles.justifyEnd : styles.justifyStart }, endInfoSlot))),
|
|
39
|
-
hint && (React__default.createElement(Text, { slot: "description" },
|
|
40
|
-
React__default.createElement(Text
|
|
39
|
+
hint && (React__default.createElement(Text$1, { slot: "description" },
|
|
40
|
+
React__default.createElement(Text, { variant: "hintText" }, hint))),
|
|
41
41
|
alert && React__default.createElement(MiniAlert, { title: alert.title, variant: alert.variant }))),
|
|
42
42
|
isLink && React__default.createElement(ArrowRightIcon, { className: styles.linkIcon, "data-testid": "link-icon" })));
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
export {
|
|
46
|
-
//# sourceMappingURL=
|
|
45
|
+
export { ItemContent };
|
|
46
|
+
//# sourceMappingURL=ItemContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemContent.js","sources":["../../../../../src/components/SelectDropdown/components/ItemContent/ItemContent.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Text } from 'react-aria-components';\nimport { buildClassnames } from '../../../../utils';\nimport { FlexCol } from '../../../Flex/FlexCol';\nimport { ArrowRightIcon, DragIndicatorIcon } from '../../../../icons';\nimport { ItemContentProps } from './types';\nimport { Text as VeeqoText } from '../../../Text';\nimport { MiniAlert } from '../../../Alerts/MiniAlert';\nimport { SelectionType } from './SelectionType';\nimport styles from './ItemContent.module.scss';\nimport { FlexRow } from '../../../Flex/FlexRow';\n\nexport const ItemContent = ({\n label,\n hint,\n itemInfoSlot,\n endInfoSlot,\n alert,\n mediaSlot,\n allowsDragging = false,\n selectionMode = 'single',\n isLink,\n isSelected = false,\n itemType,\n}: ItemContentProps) => {\n const infoContainerClassNames = useMemo(() => {\n const base = styles.infoContainer;\n\n if (itemInfoSlot && endInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoAndEndInfo]);\n }\n\n if (itemInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoOnly]);\n }\n\n if (endInfoSlot) {\n return buildClassnames([base, styles.hasEndInfoOnly]);\n }\n\n return buildClassnames([base]);\n }, [endInfoSlot, itemInfoSlot]);\n\n return (\n <FlexRow\n flexWrap=\"nowrap\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n gap=\"base\"\n style={{ flexGrow: 1 }}\n >\n <FlexRow flexWrap=\"nowrap\" gap=\"base\" style={{ flexGrow: 1 }}>\n {allowsDragging && <DragIndicatorIcon data-testid=\"drag-icon\" />}\n <SelectionType selectionMode={selectionMode} isSelected={isSelected} isLink={isLink} />\n {mediaSlot}\n <FlexCol gap=\"xs\" style={{ flexGrow: 1 }}>\n <div className={infoContainerClassNames} data-testid=\"info-container\">\n {itemType === 'grid' ? (\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n ) : (\n <Text slot=\"label\">\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n </Text>\n )}\n {itemInfoSlot}\n {endInfoSlot && (\n <div className={endInfoSlot ? styles.justifyEnd : styles.justifyStart}>\n {endInfoSlot}\n </div>\n )}\n </div>\n\n {hint && (\n <Text slot=\"description\">\n <VeeqoText variant=\"hintText\">{hint}</VeeqoText>\n </Text>\n )}\n {alert && <MiniAlert title={alert.title} variant={alert.variant} />}\n </FlexCol>\n </FlexRow>\n {isLink && <ArrowRightIcon className={styles.linkIcon} data-testid=\"link-icon\" />}\n </FlexRow>\n );\n};\n"],"names":["React","VeeqoText","Text"],"mappings":";;;;;;;;;;;;;AAYO,MAAM,WAAW,GAAG,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,cAAc,GAAG,KAAK,EACtB,aAAa,GAAG,QAAQ,EACxB,MAAM,EACN,UAAU,GAAG,KAAK,EAClB,QAAQ,GACS,KAAI;AACrB,IAAA,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$insertStyle("._infoContainer_khhvq_1 {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n}\n._infoContainer_khhvq_1._hasItemInfoAndEndInfo_khhvq_9 {\n grid-template-columns: auto 1fr 1fr;\n}\n._infoContainer_khhvq_1._hasItemInfoOnly_khhvq_12, ._infoContainer_khhvq_1._hasEndInfoOnly_khhvq_12 {\n grid-template-columns: auto 1fr;\n}\n._infoContainer_khhvq_1 > *:last-child._justifyEnd_khhvq_15 {\n justify-self: end;\n}\n._infoContainer_khhvq_1 > *:last-child._justifyStart_khhvq_18 {\n justify-self: start;\n}\n\n._linkIcon_khhvq_22 {\n color: var(--colors-neutral-ink-base);\n}");
|
|
6
|
+
var styles = {"infoContainer":"_infoContainer_khhvq_1","hasItemInfoAndEndInfo":"_hasItemInfoAndEndInfo_khhvq_9","hasItemInfoOnly":"_hasItemInfoOnly_khhvq_12","hasEndInfoOnly":"_hasEndInfoOnly_khhvq_12","justifyEnd":"_justifyEnd_khhvq_15","justifyStart":"_justifyStart_khhvq_18","linkIcon":"_linkIcon_khhvq_22"};
|
|
7
|
+
|
|
8
|
+
module.exports = styles;
|
|
9
|
+
//# sourceMappingURL=ItemContent.module.scss.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemContent.module.scss.cjs","sources":["../../../../../src/components/SelectDropdown/components/ItemContent/ItemContent.module.scss"],"sourcesContent":[".infoContainer {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n\n &.hasItemInfoAndEndInfo {\n grid-template-columns: auto 1fr 1fr;\n }\n\n &.hasItemInfoOnly,\n &.hasEndInfoOnly {\n grid-template-columns: auto 1fr;\n }\n\n > *:last-child {\n &.justifyEnd {\n justify-self: end;\n }\n\n &.justifyStart {\n justify-self: start;\n }\n }\n}\n\n.linkIcon {\n color: var(--colors-neutral-ink-base);\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,2nBAAA;AACA,aAAA,CAAA,eAAA,CAAA,wBAAA,CAAA,uBAAA,CAAA,gCAAA,CAAA,iBAAA,CAAA,2BAAA,CAAA,gBAAA,CAAA,0BAAA,CAAA,YAAA,CAAA,sBAAA,CAAA,cAAA,CAAA,wBAAA,CAAA,UAAA,CAAA,oBAAA;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import insertStyle from '../../../../_virtual/____insertStyle.js';
|
|
2
|
+
|
|
3
|
+
insertStyle("._infoContainer_khhvq_1 {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n}\n._infoContainer_khhvq_1._hasItemInfoAndEndInfo_khhvq_9 {\n grid-template-columns: auto 1fr 1fr;\n}\n._infoContainer_khhvq_1._hasItemInfoOnly_khhvq_12, ._infoContainer_khhvq_1._hasEndInfoOnly_khhvq_12 {\n grid-template-columns: auto 1fr;\n}\n._infoContainer_khhvq_1 > *:last-child._justifyEnd_khhvq_15 {\n justify-self: end;\n}\n._infoContainer_khhvq_1 > *:last-child._justifyStart_khhvq_18 {\n justify-self: start;\n}\n\n._linkIcon_khhvq_22 {\n color: var(--colors-neutral-ink-base);\n}");
|
|
4
|
+
var styles = {"infoContainer":"_infoContainer_khhvq_1","hasItemInfoAndEndInfo":"_hasItemInfoAndEndInfo_khhvq_9","hasItemInfoOnly":"_hasItemInfoOnly_khhvq_12","hasEndInfoOnly":"_hasEndInfoOnly_khhvq_12","justifyEnd":"_justifyEnd_khhvq_15","justifyStart":"_justifyStart_khhvq_18","linkIcon":"_linkIcon_khhvq_22"};
|
|
5
|
+
|
|
6
|
+
export { styles as default };
|
|
7
|
+
//# sourceMappingURL=ItemContent.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemContent.module.scss.js","sources":["../../../../../src/components/SelectDropdown/components/ItemContent/ItemContent.module.scss"],"sourcesContent":[".infoContainer {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n\n &.hasItemInfoAndEndInfo {\n grid-template-columns: auto 1fr 1fr;\n }\n\n &.hasItemInfoOnly,\n &.hasEndInfoOnly {\n grid-template-columns: auto 1fr;\n }\n\n > *:last-child {\n &.justifyEnd {\n justify-self: end;\n }\n\n &.justifyStart {\n justify-self: start;\n }\n }\n}\n\n.linkIcon {\n color: var(--colors-neutral-ink-base);\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,2nBAAA;AACA,aAAA,CAAA,eAAA,CAAA,wBAAA,CAAA,uBAAA,CAAA,gCAAA,CAAA,iBAAA,CAAA,2BAAA,CAAA,gBAAA,CAAA,0BAAA,CAAA,YAAA,CAAA,sBAAA,CAAA,cAAA,CAAA,wBAAA,CAAA,UAAA,CAAA,oBAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionType.cjs","sources":["../../../../../src/components/SelectDropdown/components/ItemContent/SelectionType.tsx"],"sourcesContent":["import React from 'react';\nimport { Radio } from '../../../Radio';\nimport { Checkbox } from '../../../Checkbox';\n\ntype SelectionTypeProps = {\n selectionMode: 'single' | 'multiple' | 'none';\n isSelected: boolean;\n isLink?: boolean;\n};\n\nexport const SelectionType = ({ selectionMode, isSelected, isLink }: SelectionTypeProps) => {\n if (isLink || selectionMode === 'none') return null;\n\n if (selectionMode === 'single') return <Radio checked={isSelected} onChange={() => {}} />;\n\n return <Checkbox checked={isSelected} onChange={() => {}} />;\n};\n"],"names":["React","Radio","Checkbox"],"mappings":";;;;;;;;;;AAUO,MAAM,aAAa,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAsB,KAAI;AACzF,IAAA,IAAI,MAAM,IAAI,aAAa,KAAK,MAAM;AAAE,QAAA,OAAO,IAAI;IAEnD,IAAI,aAAa,KAAK,QAAQ;AAAE,QAAA,OAAOA,sBAAC,CAAA,aAAA,CAAAC,WAAK,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAEzF,IAAA,OAAOD,sBAAC,CAAA,aAAA,CAAAE,iBAAQ,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAC9D;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionType.js","sources":["../../../../../src/components/SelectDropdown/components/ItemContent/SelectionType.tsx"],"sourcesContent":["import React from 'react';\nimport { Radio } from '../../../Radio';\nimport { Checkbox } from '../../../Checkbox';\n\ntype SelectionTypeProps = {\n selectionMode: 'single' | 'multiple' | 'none';\n isSelected: boolean;\n isLink?: boolean;\n};\n\nexport const SelectionType = ({ selectionMode, isSelected, isLink }: SelectionTypeProps) => {\n if (isLink || selectionMode === 'none') return null;\n\n if (selectionMode === 'single') return <Radio checked={isSelected} onChange={() => {}} />;\n\n return <Checkbox checked={isSelected} onChange={() => {}} />;\n};\n"],"names":["React"],"mappings":";;;;AAUO,MAAM,aAAa,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAsB,KAAI;AACzF,IAAA,IAAI,MAAM,IAAI,aAAa,KAAK,MAAM;AAAE,QAAA,OAAO,IAAI;IAEnD,IAAI,aAAa,KAAK,QAAQ;AAAE,QAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAEzF,IAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAC9D;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ItemContent } from './ItemContent';
|
package/dist/components/SelectDropdown/{ListItem/components → components/ItemContent}/types.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type
|
|
1
|
+
import { BaseItemProps } from '../types';
|
|
2
|
+
export type ItemContentProps = BaseItemProps & {
|
|
3
3
|
/** renders a drag icon */
|
|
4
4
|
allowsDragging?: boolean;
|
|
5
5
|
/** renders a checkbox or radio depending on state, default is radio */
|
|
@@ -8,4 +8,6 @@ export type ListItemContentProps = BasicListItemProps & {
|
|
|
8
8
|
isSelected?: boolean;
|
|
9
9
|
/** Renders icon to indicate item is a link */
|
|
10
10
|
isLink?: boolean;
|
|
11
|
+
/** type of item */
|
|
12
|
+
itemType: 'list' | 'grid';
|
|
11
13
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var reactAriaComponents = require('react-aria-components');
|
|
5
|
+
require('../../../../hooks/useFocusVisible.cjs');
|
|
6
|
+
var useId = require('../../../../hooks/useId.cjs');
|
|
7
|
+
require('lodash.throttle');
|
|
8
|
+
var ItemContent = require('../ItemContent/ItemContent.cjs');
|
|
9
|
+
var buildClassnames = require('../../../../utils/buildClassnames.cjs');
|
|
10
|
+
require('uid/secure');
|
|
11
|
+
var item_module = require('../item.module.scss.cjs');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
16
|
+
|
|
17
|
+
const ListItem = ({ id, label, href, appearance = 'primary', className, ...props }) => {
|
|
18
|
+
const idComputed = useId.useId({ id, prefix: 'list-item' });
|
|
19
|
+
return (React__default.default.createElement(reactAriaComponents.ListBoxItem, { id: idComputed, textValue: label, href: href, className: buildClassnames.buildClassnames([item_module.item, item_module[`appearance-${appearance}`], className]), ...props }, ({ selectionMode, allowsDragging, isSelected }) => (React__default.default.createElement(ItemContent.ItemContent, { selectionMode: selectionMode, allowsDragging: allowsDragging, isSelected: isSelected, label: label, isLink: Boolean(href), appearance: appearance, itemType: "list", ...props }))));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.ListItem = ListItem;
|
|
23
|
+
//# sourceMappingURL=ListItem.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.cjs","sources":["../../../../../src/components/SelectDropdown/components/ListItem/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBoxItem, ListBoxItemRenderProps } from 'react-aria-components';\nimport { useId } from '../../../../hooks';\nimport { ListItemProps } from './types';\nimport { ItemContent } from '../ItemContent';\nimport { buildClassnames } from '../../../../utils';\n\nimport styles from '../item.module.scss';\n\nexport const ListItem = ({\n id,\n label,\n href,\n appearance = 'primary',\n className,\n ...props\n}: ListItemProps) => {\n const idComputed = useId({ id, prefix: 'list-item' });\n\n return (\n <ListBoxItem\n id={idComputed}\n textValue={label}\n href={href}\n className={buildClassnames([styles.item, styles[`appearance-${appearance}`], className])}\n {...props}\n >\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: ListBoxItemRenderProps) => (\n <ItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n appearance={appearance}\n itemType=\"list\"\n {...props}\n />\n )}\n </ListBoxItem>\n );\n};\n"],"names":["useId","React","ListBoxItem","buildClassnames","styles","ItemContent"],"mappings":";;;;;;;;;;;;;;;;MASa,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,UAAU,GAAG,SAAS,EACtB,SAAS,EACT,GAAG,KAAK,EACM,KAAI;AAClB,IAAA,MAAM,UAAU,GAAGA,WAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAErD,IAAA,QACEC,sBAAC,CAAA,aAAA,CAAAC,+BAAW,IACV,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,KAAK,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAEC,+BAAe,CAAC,CAACC,WAAM,CAAC,IAAI,EAAEA,WAAM,CAAC,CAAc,WAAA,EAAA,UAAU,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,KACpF,KAAK,EAAA,EAGR,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA0B,MACrEH,sBAAC,CAAA,aAAA,CAAAI,uBAAW,IACV,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EACrB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAC,MAAM,EACX,GAAA,KAAK,GACT,CACH,CACW;AAElB;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { ListBoxItem } from 'react-aria-components';
|
|
3
|
+
import '../../../../hooks/useFocusVisible.js';
|
|
4
|
+
import { useId } from '../../../../hooks/useId.js';
|
|
5
|
+
import 'lodash.throttle';
|
|
6
|
+
import { ItemContent } from '../ItemContent/ItemContent.js';
|
|
7
|
+
import { buildClassnames } from '../../../../utils/buildClassnames.js';
|
|
8
|
+
import 'uid/secure';
|
|
9
|
+
import styles from '../item.module.scss.js';
|
|
10
|
+
|
|
11
|
+
const ListItem = ({ id, label, href, appearance = 'primary', className, ...props }) => {
|
|
12
|
+
const idComputed = useId({ id, prefix: 'list-item' });
|
|
13
|
+
return (React__default.createElement(ListBoxItem, { id: idComputed, textValue: label, href: href, className: buildClassnames([styles.item, styles[`appearance-${appearance}`], className]), ...props }, ({ selectionMode, allowsDragging, isSelected }) => (React__default.createElement(ItemContent, { selectionMode: selectionMode, allowsDragging: allowsDragging, isSelected: isSelected, label: label, isLink: Boolean(href), appearance: appearance, itemType: "list", ...props }))));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { ListItem };
|
|
17
|
+
//# sourceMappingURL=ListItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.js","sources":["../../../../../src/components/SelectDropdown/components/ListItem/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBoxItem, ListBoxItemRenderProps } from 'react-aria-components';\nimport { useId } from '../../../../hooks';\nimport { ListItemProps } from './types';\nimport { ItemContent } from '../ItemContent';\nimport { buildClassnames } from '../../../../utils';\n\nimport styles from '../item.module.scss';\n\nexport const ListItem = ({\n id,\n label,\n href,\n appearance = 'primary',\n className,\n ...props\n}: ListItemProps) => {\n const idComputed = useId({ id, prefix: 'list-item' });\n\n return (\n <ListBoxItem\n id={idComputed}\n textValue={label}\n href={href}\n className={buildClassnames([styles.item, styles[`appearance-${appearance}`], className])}\n {...props}\n >\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: ListBoxItemRenderProps) => (\n <ItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n appearance={appearance}\n itemType=\"list\"\n {...props}\n />\n )}\n </ListBoxItem>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;MASa,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,UAAU,GAAG,SAAS,EACtB,SAAS,EACT,GAAG,KAAK,EACM,KAAI;AAClB,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAErD,IAAA,QACEA,cAAC,CAAA,aAAA,CAAA,WAAW,IACV,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,KAAK,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAc,WAAA,EAAA,UAAU,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,KACpF,KAAK,EAAA,EAGR,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA0B,MACrEA,cAAC,CAAA,aAAA,CAAA,WAAW,IACV,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EACrB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAC,MAAM,EACX,GAAA,KAAK,GACT,CACH,CACW;AAElB;;;;"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var reactAriaComponents = require('react-aria-components');
|
|
5
|
-
var FlexRow = require('
|
|
6
|
-
var FlexCol = require('
|
|
7
|
-
var Text = require('
|
|
5
|
+
var FlexRow = require('../../../Flex/FlexRow/FlexRow.cjs');
|
|
6
|
+
var FlexCol = require('../../../Flex/FlexCol/FlexCol.cjs');
|
|
7
|
+
var Text = require('../../../Text/Text.cjs');
|
|
8
8
|
var ListItem = require('../ListItem/ListItem.cjs');
|
|
9
|
-
var
|
|
10
|
-
var buildClassnames = require('../../../utils/buildClassnames.cjs');
|
|
9
|
+
var buildClassnames = require('../../../../utils/buildClassnames.cjs');
|
|
11
10
|
require('uid/secure');
|
|
11
|
+
var ListItemSection_module = require('./ListItemSection.module.scss.cjs');
|
|
12
12
|
|
|
13
13
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
14
14
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemSection.cjs","sources":["../../../../../src/components/SelectDropdown/components/ListItemSection/ListItemSection.tsx"],"sourcesContent":["import React, { ReactElement } from 'react';\nimport { Collection, Header, Section, SectionProps } from 'react-aria-components';\nimport { FlexRow } from '../../../Flex/FlexRow';\nimport { FlexCol } from '../../../Flex/FlexCol';\nimport { Text as VeeqoText } from '../../../Text';\nimport { ListItemProps } from '../ListItem/types';\nimport { ListItem } from '../ListItem/ListItem';\nimport { buildClassnames } from '../../../../utils';\nimport styles from './ListItemSection.module.scss';\n\nexport type ListItemSectionProps = Omit<SectionProps<ListItemProps>, 'items'> & {\n label: string;\n hint?: string;\n itemInfoSlot?: ReactElement;\n items?: ListItemProps[];\n};\n\nexport const ListItemSection = ({\n label,\n hint,\n itemInfoSlot,\n items,\n children,\n className,\n ...props\n}: ListItemSectionProps) => (\n <Section className={buildClassnames([styles.section, className])} {...props}>\n <Header>\n <FlexCol gap=\"xs\">\n <FlexRow>\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n {itemInfoSlot}\n </FlexRow>\n {hint && <VeeqoText variant=\"hintText\">{hint}</VeeqoText>}\n </FlexCol>\n </Header>\n {children}\n {items && (\n <Collection items={items}>{(item: ListItemProps) => <ListItem {...item} />}</Collection>\n )}\n </Section>\n);\n"],"names":["React","Section","buildClassnames","styles","Header","FlexCol","FlexRow","VeeqoText","Collection","ListItem"],"mappings":";;;;;;;;;;;;;;;;AAiBa,MAAA,eAAe,GAAG,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACa,MACrBA,qCAACC,2BAAO,EAAA,EAAC,SAAS,EAAEC,+BAAe,CAAC,CAACC,sBAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,KAAM,KAAK,EAAA;AACzE,IAAAH,sBAAA,CAAA,aAAA,CAACI,0BAAM,EAAA,IAAA;AACL,QAAAJ,sBAAA,CAAA,aAAA,CAACK,eAAO,EAAA,EAAC,GAAG,EAAC,IAAI,EAAA;AACf,YAAAL,sBAAA,CAAA,aAAA,CAACM,eAAO,EAAA,IAAA;AACN,gBAAAN,sBAAA,CAAA,aAAA,CAACO,SAAS,EAAC,EAAA,OAAO,EAAC,MAAM,EAAA,EAAE,KAAK,CAAa;AAC5C,gBAAA,YAAY,CACL;YACT,IAAI,IAAIP,sBAAC,CAAA,aAAA,CAAAO,SAAS,EAAC,EAAA,OAAO,EAAC,UAAU,EAAE,EAAA,IAAI,CAAa,CACjD,CACH;IACR,QAAQ;IACR,KAAK,KACJP,sBAAC,CAAA,aAAA,CAAAQ,8BAAU,IAAC,KAAK,EAAE,KAAK,EAAA,EAAG,CAAC,IAAmB,KAAKR,sBAAC,CAAA,aAAA,CAAAS,iBAAQ,EAAK,EAAA,GAAA,IAAI,GAAI,CAAc,CACzF,CACO;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { Section, Header, Collection } from 'react-aria-components';
|
|
3
|
-
import { FlexRow } from '
|
|
4
|
-
import { FlexCol } from '
|
|
5
|
-
import { Text } from '
|
|
3
|
+
import { FlexRow } from '../../../Flex/FlexRow/FlexRow.js';
|
|
4
|
+
import { FlexCol } from '../../../Flex/FlexCol/FlexCol.js';
|
|
5
|
+
import { Text } from '../../../Text/Text.js';
|
|
6
6
|
import { ListItem } from '../ListItem/ListItem.js';
|
|
7
|
-
import
|
|
8
|
-
import { buildClassnames } from '../../../utils/buildClassnames.js';
|
|
7
|
+
import { buildClassnames } from '../../../../utils/buildClassnames.js';
|
|
9
8
|
import 'uid/secure';
|
|
9
|
+
import styles from './ListItemSection.module.scss.js';
|
|
10
10
|
|
|
11
11
|
const ListItemSection = ({ label, hint, itemInfoSlot, items, children, className, ...props }) => (React__default.createElement(Section, { className: buildClassnames([styles.section, className]), ...props },
|
|
12
12
|
React__default.createElement(Header, null,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemSection.js","sources":["../../../../../src/components/SelectDropdown/components/ListItemSection/ListItemSection.tsx"],"sourcesContent":["import React, { ReactElement } from 'react';\nimport { Collection, Header, Section, SectionProps } from 'react-aria-components';\nimport { FlexRow } from '../../../Flex/FlexRow';\nimport { FlexCol } from '../../../Flex/FlexCol';\nimport { Text as VeeqoText } from '../../../Text';\nimport { ListItemProps } from '../ListItem/types';\nimport { ListItem } from '../ListItem/ListItem';\nimport { buildClassnames } from '../../../../utils';\nimport styles from './ListItemSection.module.scss';\n\nexport type ListItemSectionProps = Omit<SectionProps<ListItemProps>, 'items'> & {\n label: string;\n hint?: string;\n itemInfoSlot?: ReactElement;\n items?: ListItemProps[];\n};\n\nexport const ListItemSection = ({\n label,\n hint,\n itemInfoSlot,\n items,\n children,\n className,\n ...props\n}: ListItemSectionProps) => (\n <Section className={buildClassnames([styles.section, className])} {...props}>\n <Header>\n <FlexCol gap=\"xs\">\n <FlexRow>\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n {itemInfoSlot}\n </FlexRow>\n {hint && <VeeqoText variant=\"hintText\">{hint}</VeeqoText>}\n </FlexCol>\n </Header>\n {children}\n {items && (\n <Collection items={items}>{(item: ListItemProps) => <ListItem {...item} />}</Collection>\n )}\n </Section>\n);\n"],"names":["React","VeeqoText"],"mappings":";;;;;;;;;;AAiBa,MAAA,eAAe,GAAG,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACa,MACrBA,6BAAC,OAAO,EAAA,EAAC,SAAS,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,KAAM,KAAK,EAAA;AACzE,IAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA;AACL,QAAAA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,EAAC,GAAG,EAAC,IAAI,EAAA;AACf,YAAAA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,IAAA;AACN,gBAAAA,cAAA,CAAA,aAAA,CAACC,IAAS,EAAC,EAAA,OAAO,EAAC,MAAM,EAAA,EAAE,KAAK,CAAa;AAC5C,gBAAA,YAAY,CACL;YACT,IAAI,IAAID,cAAC,CAAA,aAAA,CAAAC,IAAS,EAAC,EAAA,OAAO,EAAC,UAAU,EAAE,EAAA,IAAI,CAAa,CACjD,CACH;IACR,QAAQ;IACR,KAAK,KACJD,cAAC,CAAA,aAAA,CAAA,UAAU,IAAC,KAAK,EAAE,KAAK,EAAA,EAAG,CAAC,IAAmB,KAAKA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAK,EAAA,GAAA,IAAI,GAAI,CAAc,CACzF,CACO;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var ___$insertStyle = require('
|
|
3
|
+
var ___$insertStyle = require('../../../../_virtual/____insertStyle.cjs');
|
|
4
4
|
|
|
5
5
|
___$insertStyle("._section_wlx0b_1 {\n border-radius: var(--sizes-base);\n}");
|
|
6
6
|
var styles = {"section":"_section_wlx0b_1"};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemSection.module.scss.cjs","sources":["../../../../../src/components/SelectDropdown/components/ListItemSection/ListItemSection.module.scss"],"sourcesContent":[".section {\n border-radius: var(--sizes-base);\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,6DAAA;;;;;"}
|
package/dist/components/SelectDropdown/components/ListItemSection/ListItemSection.module.scss.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemSection.module.scss.js","sources":["../../../../../src/components/SelectDropdown/components/ListItemSection/ListItemSection.module.scss"],"sourcesContent":[".section {\n border-radius: var(--sizes-base);\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,6DAAA;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ___$insertStyle = require('../../../_virtual/____insertStyle.cjs');
|
|
4
|
+
|
|
5
|
+
___$insertStyle("._item_19dv4_1 {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n}\n._item_19dv4_1._appearance-secondary_19dv4_7 {\n background-color: var(--colors-neutral-grey-lightest);\n}\n._item_19dv4_1[data-hovered] > div, ._item_19dv4_1[data-hovered] > div:first-of-type[role=gridcell] > :first-child {\n background-color: #f0f7fc;\n}\n._item_19dv4_1[data-pressed] > div, ._item_19dv4_1[data-pressed] > div:first-of-type[role=gridcell] > :first-child {\n background-color: #e3f0fa;\n}\n._item_19dv4_1[data-focused] {\n outline: 0;\n}\n._item_19dv4_1[data-focus-visible] > div, ._item_19dv4_1[data-focus-visible] > div:first-of-type[role=gridcell] > :first-child {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n}\n._item_19dv4_1[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n}\n._item_19dv4_1[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n}\n._item_19dv4_1[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n}\n._item_19dv4_1 > div,\n._item_19dv4_1 > div:first-of-type[role=gridcell] > :first-child {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n}");
|
|
6
|
+
var styles = {"item":"_item_19dv4_1","appearance-secondary":"_appearance-secondary_19dv4_7"};
|
|
7
|
+
|
|
8
|
+
module.exports = styles;
|
|
9
|
+
//# sourceMappingURL=item.module.scss.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.module.scss.cjs","sources":["../../../../src/components/SelectDropdown/components/item.module.scss"],"sourcesContent":[".item {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n\n &.appearance-secondary {\n background-color: var(--colors-neutral-grey-lightest);\n }\n\n &[data-hovered] > div,\n &[data-hovered] > div:first-of-type[role='gridcell'] > :first-child {\n background-color: #f0f7fc;\n }\n\n &[data-pressed] > div,\n &[data-pressed] > div:first-of-type[role='gridcell'] > :first-child {\n background-color: #e3f0fa;\n }\n\n &[data-focused] {\n outline: 0;\n }\n\n &[data-focus-visible] > div,\n &[data-focus-visible] > div:first-of-type[role='gridcell'] > :first-child {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n }\n\n &[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n }\n\n &[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n }\n\n > div,\n > div:first-of-type[role='gridcell'] > :first-child {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,64CAAA;AACA,aAAA,CAAA,MAAA,CAAA,eAAA,CAAA,sBAAA,CAAA,+BAAA;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import insertStyle from '../../../_virtual/____insertStyle.js';
|
|
2
|
+
|
|
3
|
+
insertStyle("._item_19dv4_1 {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n}\n._item_19dv4_1._appearance-secondary_19dv4_7 {\n background-color: var(--colors-neutral-grey-lightest);\n}\n._item_19dv4_1[data-hovered] > div, ._item_19dv4_1[data-hovered] > div:first-of-type[role=gridcell] > :first-child {\n background-color: #f0f7fc;\n}\n._item_19dv4_1[data-pressed] > div, ._item_19dv4_1[data-pressed] > div:first-of-type[role=gridcell] > :first-child {\n background-color: #e3f0fa;\n}\n._item_19dv4_1[data-focused] {\n outline: 0;\n}\n._item_19dv4_1[data-focus-visible] > div, ._item_19dv4_1[data-focus-visible] > div:first-of-type[role=gridcell] > :first-child {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n}\n._item_19dv4_1[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n}\n._item_19dv4_1[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n}\n._item_19dv4_1[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n}\n._item_19dv4_1 > div,\n._item_19dv4_1 > div:first-of-type[role=gridcell] > :first-child {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n}");
|
|
4
|
+
var styles = {"item":"_item_19dv4_1","appearance-secondary":"_appearance-secondary_19dv4_7"};
|
|
5
|
+
|
|
6
|
+
export { styles as default };
|
|
7
|
+
//# sourceMappingURL=item.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.module.scss.js","sources":["../../../../src/components/SelectDropdown/components/item.module.scss"],"sourcesContent":[".item {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n\n &.appearance-secondary {\n background-color: var(--colors-neutral-grey-lightest);\n }\n\n &[data-hovered] > div,\n &[data-hovered] > div:first-of-type[role='gridcell'] > :first-child {\n background-color: #f0f7fc;\n }\n\n &[data-pressed] > div,\n &[data-pressed] > div:first-of-type[role='gridcell'] > :first-child {\n background-color: #e3f0fa;\n }\n\n &[data-focused] {\n outline: 0;\n }\n\n &[data-focus-visible] > div,\n &[data-focus-visible] > div:first-of-type[role='gridcell'] > :first-child {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n }\n\n &[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n }\n\n &[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n }\n\n > div,\n > div:first-of-type[role='gridcell'] > :first-child {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,64CAAA;AACA,aAAA,CAAA,MAAA,CAAA,eAAA,CAAA,sBAAA,CAAA,+BAAA;;;;"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export type BasicListItemProps = {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type BaseItemProps = {
|
|
4
3
|
id?: string;
|
|
5
4
|
/** Label for the item */
|
|
6
5
|
label: string;
|
|
7
6
|
/** Renders the media provided, e.g Image or Icon */
|
|
8
|
-
mediaSlot?:
|
|
7
|
+
mediaSlot?: ReactNode;
|
|
9
8
|
/** Hint text for the item */
|
|
10
9
|
hint?: string;
|
|
11
10
|
/** Slot for extra info for the item, e.g (Tooltip, mini-tag) */
|
|
12
|
-
itemInfoSlot?:
|
|
13
|
-
endInfoSlot?:
|
|
11
|
+
itemInfoSlot?: ReactNode;
|
|
12
|
+
endInfoSlot?: ReactNode;
|
|
14
13
|
/** Renders mini alert, e.g (Low stock) */
|
|
15
14
|
alert?: {
|
|
16
15
|
title: string;
|
|
@@ -19,4 +18,3 @@ export type BasicListItemProps = {
|
|
|
19
18
|
/** Used to differentiate between items */
|
|
20
19
|
appearance?: 'primary' | 'secondary';
|
|
21
20
|
};
|
|
22
|
-
export type ListItemProps = ListBoxItemProps & BasicListItemProps;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Key, ListBoxProps } from 'react-aria-components';
|
|
2
2
|
import { ReactElement } from 'react';
|
|
3
3
|
import { ButtonProps } from '../Button/types';
|
|
4
|
-
import { ListItemProps } from './ListItem/types';
|
|
5
|
-
import { ListItemSectionProps } from './ListItemSection/ListItemSection';
|
|
4
|
+
import { ListItemProps } from './components/ListItem/types';
|
|
5
|
+
import { ListItemSectionProps } from './components/ListItemSection/ListItemSection';
|
|
6
6
|
type CTAButtonProps = Omit<ButtonProps, 'variant'> & {
|
|
7
7
|
label: string;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sources":["../../../src/components/SelectDropdown/utils.ts"],"sourcesContent":["import { Key } from 'react-aria-components';\nimport { ClassNamesReturnPayload, SelectDropdownItem } from './types';\nimport { ListItemSectionProps } from './ListItemSection/ListItemSection';\nimport { ListItemProps } from './ListItem/types';\n\nexport const getValueFromKey = (items: SelectDropdownItem[], hasSection: boolean, key?: Key) => {\n if (!key) return undefined;\n if (!hasSection) {\n return items.find((item) => item.id === key) || undefined;\n }\n\n const selectedSection = items.find((section) => section.id === key);\n if (selectedSection) return selectedSection;\n\n return items\n .flatMap((section) => ('items' in section && Array.isArray(section.items) ? section.items : []))\n .find((item: ListItemProps) => item.id === key);\n};\n\nexport const getValuesFromKeys = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n keys?: Key[],\n): SelectDropdownItem[] => {\n if (!keys) return [];\n if (!hasSection) {\n return items.filter((item) => keys.includes(item.id as Key));\n }\n\n return (items as ListItemSectionProps[]).flatMap((section) => [\n ...(keys.includes(section.id as Key) ? [section] : []),\n ...(section.items?.filter((item: ListItemProps) => keys.includes(item.id as Key)) || []),\n ]);\n};\n\nexport const getSelectedValues = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n value?: Key | Key[],\n): SelectDropdownItem[] => {\n if (!value) return [];\n if (Array.isArray(value)) {\n return getValuesFromKeys(items, hasSection, value);\n }\n const keyValue = getValueFromKey(items, hasSection, value);\n return keyValue === undefined ? [] : [keyValue];\n};\n\nexport const generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n button: prefix ? `${prefix}-select-dropdown-button` : undefined,\n optionsContainer: prefix ? `${prefix}-select-dropdown-container` : undefined,\n popover: prefix ? `${prefix}-select-dropdown` : undefined,\n});\n"],"names":[],"mappings":";;AAKa,MAAA,eAAe,GAAG,CAAC,KAA2B,EAAE,UAAmB,EAAE,GAAS,KAAI;AAC7F,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,SAAS;IAC1B,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,KAAK,CAAC,IA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BAAiB,GAAG,CAC/B,KAA2B,EAC3B,UAAmB,EACnB,KAAmB,KACK;AACxB,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,EAAE;AACrB,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC;AACnD;IACD,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC;AAC1D,IAAA,OAAO,QAAQ,KAAK,SAAS,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AACjD;MAEa,kBAAkB,GAAG,CAAC,MAAe,MAA+B;IAC/E,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAyB,uBAAA,CAAA,GAAG,SAAS;IAC/D,gBAAgB,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAA4B,0BAAA,CAAA,GAAG,SAAS;IAC5E,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAkB,gBAAA,CAAA,GAAG,SAAS;AAC1D,CAAA;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../../../src/components/SelectDropdown/utils.ts"],"sourcesContent":["import { Key } from 'react-aria-components';\nimport { ClassNamesReturnPayload, SelectDropdownItem } from './types';\nimport { ListItemSectionProps } from './components/ListItemSection/ListItemSection';\nimport { ListItemProps } from './components/ListItem/types';\n\nexport const getValueFromKey = (items: SelectDropdownItem[], hasSection: boolean, key?: Key) => {\n if (!key) return undefined;\n if (!hasSection) {\n return items.find((item) => item.id === key) || undefined;\n }\n\n const selectedSection = items.find((section) => section.id === key);\n if (selectedSection) return selectedSection;\n\n return items\n .flatMap((section) => ('items' in section && Array.isArray(section.items) ? section.items : []))\n .find((item: ListItemProps) => item.id === key);\n};\n\nexport const getValuesFromKeys = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n keys?: Key[],\n): SelectDropdownItem[] => {\n if (!keys) return [];\n if (!hasSection) {\n return items.filter((item) => keys.includes(item.id as Key));\n }\n\n return (items as ListItemSectionProps[]).flatMap((section) => [\n ...(keys.includes(section.id as Key) ? [section] : []),\n ...(section.items?.filter((item: ListItemProps) => keys.includes(item.id as Key)) || []),\n ]);\n};\n\nexport const getSelectedValues = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n value?: Key | Key[],\n): SelectDropdownItem[] => {\n if (!value) return [];\n if (Array.isArray(value)) {\n return getValuesFromKeys(items, hasSection, value);\n }\n const keyValue = getValueFromKey(items, hasSection, value);\n return keyValue === undefined ? [] : [keyValue];\n};\n\nexport const generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n button: prefix ? `${prefix}-select-dropdown-button` : undefined,\n optionsContainer: prefix ? `${prefix}-select-dropdown-container` : undefined,\n popover: prefix ? `${prefix}-select-dropdown` : undefined,\n});\n"],"names":[],"mappings":";;AAKa,MAAA,eAAe,GAAG,CAAC,KAA2B,EAAE,UAAmB,EAAE,GAAS,KAAI;AAC7F,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,SAAS;IAC1B,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,SAAS;AAC1D;AAED,IAAA,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,EAAE,KAAK,GAAG,CAAC;AACnE,IAAA,IAAI,eAAe;AAAE,QAAA,OAAO,eAAe;AAE3C,IAAA,OAAO;AACJ,SAAA,OAAO,CAAC,CAAC,OAAO,MAAM,OAAO,IAAI,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;AAC9F,SAAA,IAAI,CAAC,CAAC,IAAmB,KAAK,IAAI,CAAC,EAAE,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AA,MAAM,CAAyB,uBAAA,CAAA,GAAG,SAAS;IAC/D,gBAAgB,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAA4B,0BAAA,CAAA,GAAG,SAAS;IAC5E,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAkB,gBAAA,CAAA,GAAG,SAAS;AAC1D,CAAA;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/components/SelectDropdown/utils.ts"],"sourcesContent":["import { Key } from 'react-aria-components';\nimport { ClassNamesReturnPayload, SelectDropdownItem } from './types';\nimport { ListItemSectionProps } from './ListItemSection/ListItemSection';\nimport { ListItemProps } from './ListItem/types';\n\nexport const getValueFromKey = (items: SelectDropdownItem[], hasSection: boolean, key?: Key) => {\n if (!key) return undefined;\n if (!hasSection) {\n return items.find((item) => item.id === key) || undefined;\n }\n\n const selectedSection = items.find((section) => section.id === key);\n if (selectedSection) return selectedSection;\n\n return items\n .flatMap((section) => ('items' in section && Array.isArray(section.items) ? section.items : []))\n .find((item: ListItemProps) => item.id === key);\n};\n\nexport const getValuesFromKeys = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n keys?: Key[],\n): SelectDropdownItem[] => {\n if (!keys) return [];\n if (!hasSection) {\n return items.filter((item) => keys.includes(item.id as Key));\n }\n\n return (items as ListItemSectionProps[]).flatMap((section) => [\n ...(keys.includes(section.id as Key) ? [section] : []),\n ...(section.items?.filter((item: ListItemProps) => keys.includes(item.id as Key)) || []),\n ]);\n};\n\nexport const getSelectedValues = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n value?: Key | Key[],\n): SelectDropdownItem[] => {\n if (!value) return [];\n if (Array.isArray(value)) {\n return getValuesFromKeys(items, hasSection, value);\n }\n const keyValue = getValueFromKey(items, hasSection, value);\n return keyValue === undefined ? [] : [keyValue];\n};\n\nexport const generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n button: prefix ? `${prefix}-select-dropdown-button` : undefined,\n optionsContainer: prefix ? `${prefix}-select-dropdown-container` : undefined,\n popover: prefix ? `${prefix}-select-dropdown` : undefined,\n});\n"],"names":[],"mappings":"AAKa,MAAA,eAAe,GAAG,CAAC,KAA2B,EAAE,UAAmB,EAAE,GAAS,KAAI;AAC7F,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,SAAS;IAC1B,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,SAAS;AAC1D;AAED,IAAA,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,EAAE,KAAK,GAAG,CAAC;AACnE,IAAA,IAAI,eAAe;AAAE,QAAA,OAAO,eAAe;AAE3C,IAAA,OAAO;AACJ,SAAA,OAAO,CAAC,CAAC,OAAO,MAAM,OAAO,IAAI,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;AAC9F,SAAA,IAAI,CAAC,CAAC,IAAmB,KAAK,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC;AACnD;AAEa,MAAA,iBAAiB,GAAG,CAC/B,KAA2B,EAC3B,UAAmB,EACnB,IAAY,KACY;AACxB,IAAA,IAAI,CAAC,IAAI;AAAE,QAAA,OAAO,EAAE;IACpB,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAS,CAAC,CAAC;AAC7D;AAED,IAAA,OAAQ,KAAgC,CAAC,OAAO,CAAC,CAAC,OAAO,KAAI;;QAAC,OAAA;AAC5D,YAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAS,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;YACtD,IAAI,CAAA,CAAA,EAAA,GAAA,OAAO,CAAC,KAAK,MAAE,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAA,MAAM,CAAC,CAAC,IAAmB,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAS,CAAC,CAAC,KAAI,EAAE,CAAC;SACzF;AAAA,KAAA,CAAC;AACJ;AAEa,MAAA,iBAAiB,GAAG,CAC/B,KAA2B,EAC3B,UAAmB,EACnB,KAAmB,KACK;AACxB,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,EAAE;AACrB,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC;AACnD;IACD,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC;AAC1D,IAAA,OAAO,QAAQ,KAAK,SAAS,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AACjD;MAEa,kBAAkB,GAAG,CAAC,MAAe,MAA+B;IAC/E,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAyB,uBAAA,CAAA,GAAG,SAAS;IAC/D,gBAAgB,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAA4B,0BAAA,CAAA,GAAG,SAAS;IAC5E,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAkB,gBAAA,CAAA,GAAG,SAAS;AAC1D,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/components/SelectDropdown/utils.ts"],"sourcesContent":["import { Key } from 'react-aria-components';\nimport { ClassNamesReturnPayload, SelectDropdownItem } from './types';\nimport { ListItemSectionProps } from './components/ListItemSection/ListItemSection';\nimport { ListItemProps } from './components/ListItem/types';\n\nexport const getValueFromKey = (items: SelectDropdownItem[], hasSection: boolean, key?: Key) => {\n if (!key) return undefined;\n if (!hasSection) {\n return items.find((item) => item.id === key) || undefined;\n }\n\n const selectedSection = items.find((section) => section.id === key);\n if (selectedSection) return selectedSection;\n\n return items\n .flatMap((section) => ('items' in section && Array.isArray(section.items) ? section.items : []))\n .find((item: ListItemProps) => item.id === key);\n};\n\nexport const getValuesFromKeys = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n keys?: Key[],\n): SelectDropdownItem[] => {\n if (!keys) return [];\n if (!hasSection) {\n return items.filter((item) => keys.includes(item.id as Key));\n }\n\n return (items as ListItemSectionProps[]).flatMap((section) => [\n ...(keys.includes(section.id as Key) ? [section] : []),\n ...(section.items?.filter((item: ListItemProps) => keys.includes(item.id as Key)) || []),\n ]);\n};\n\nexport const getSelectedValues = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n value?: Key | Key[],\n): SelectDropdownItem[] => {\n if (!value) return [];\n if (Array.isArray(value)) {\n return getValuesFromKeys(items, hasSection, value);\n }\n const keyValue = getValueFromKey(items, hasSection, value);\n return keyValue === undefined ? [] : [keyValue];\n};\n\nexport const generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n button: prefix ? `${prefix}-select-dropdown-button` : undefined,\n optionsContainer: prefix ? `${prefix}-select-dropdown-container` : undefined,\n popover: prefix ? `${prefix}-select-dropdown` : undefined,\n});\n"],"names":[],"mappings":"AAKa,MAAA,eAAe,GAAG,CAAC,KAA2B,EAAE,UAAmB,EAAE,GAAS,KAAI;AAC7F,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,SAAS;IAC1B,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,SAAS;AAC1D;AAED,IAAA,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,EAAE,KAAK,GAAG,CAAC;A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iB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC;AACnD;IACD,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC;AAC1D,IAAA,OAAO,QAAQ,KAAK,SAAS,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AACjD;MAEa,kBAAkB,GAAG,CAAC,MAAe,MAA+B;IAC/E,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAyB,uBAAA,CAAA,GAAG,SAAS;IAC/D,gBAAgB,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAA4B,0BAAA,CAAA,GAAG,SAAS;IAC5E,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAkB,gBAAA,CAAA,GAAG,SAAS;AAC1D,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var reactAriaComponents = require('react-aria-components');
|
|
5
|
-
require('../../../hooks/useFocusVisible.cjs');
|
|
6
|
-
var useId = require('../../../hooks/useId.cjs');
|
|
7
|
-
require('lodash.throttle');
|
|
8
|
-
var ListItemContent = require('./components/ListItemContent.cjs');
|
|
9
|
-
var ListItem_module = require('./ListItem.module.scss.cjs');
|
|
10
|
-
var buildClassnames = require('../../../utils/buildClassnames.cjs');
|
|
11
|
-
require('uid/secure');
|
|
12
|
-
|
|
13
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
14
|
-
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
16
|
-
|
|
17
|
-
const ListItem = ({ id, label, href, appearance = 'primary', className, ...props }) => {
|
|
18
|
-
const idComputed = useId.useId({ id, prefix: 'list-item' });
|
|
19
|
-
return (React__default.default.createElement(reactAriaComponents.ListBoxItem, { id: idComputed, textValue: label, href: href, className: buildClassnames.buildClassnames([ListItem_module.listItem, ListItem_module[`appearance-${appearance}`], className]), ...props }, ({ selectionMode, allowsDragging, isSelected }) => (React__default.default.createElement(ListItemContent.ListItemContent, { selectionMode: selectionMode, allowsDragging: allowsDragging, isSelected: isSelected, label: label, isLink: Boolean(href), appearance: appearance, ...props }))));
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
exports.ListItem = ListItem;
|
|
23
|
-
//# sourceMappingURL=ListItem.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.cjs","sources":["../../../../src/components/SelectDropdown/ListItem/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBoxItem, ListBoxItemRenderProps } from 'react-aria-components';\nimport { useId } from '../../../hooks';\nimport { ListItemProps } from './types';\nimport { ListItemContent } from './components/ListItemContent';\nimport styles from './ListItem.module.scss';\nimport { buildClassnames } from '../../../utils';\n\nexport const ListItem = ({\n id,\n label,\n href,\n appearance = 'primary',\n className,\n ...props\n}: ListItemProps) => {\n const idComputed = useId({ id, prefix: 'list-item' });\n\n return (\n <ListBoxItem\n id={idComputed}\n textValue={label}\n href={href}\n className={buildClassnames([styles.listItem, styles[`appearance-${appearance}`], className])}\n {...props}\n >\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: ListBoxItemRenderProps) => (\n <ListItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n appearance={appearance}\n {...props}\n />\n )}\n </ListBoxItem>\n );\n};\n"],"names":["useId","React","ListBoxItem","buildClassnames","styles","ListItemContent"],"mappings":";;;;;;;;;;;;;;;;MAQa,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,UAAU,GAAG,SAAS,EACtB,SAAS,EACT,GAAG,KAAK,EACM,KAAI;AAClB,IAAA,MAAM,UAAU,GAAGA,WAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAErD,IAAA,QACEC,sBAAC,CAAA,aAAA,CAAAC,+BAAW,IACV,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,KAAK,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAEC,+BAAe,CAAC,CAACC,eAAM,CAAC,QAAQ,EAAEA,eAAM,CAAC,CAAA,WAAA,EAAc,UAAU,CAAE,CAAA,CAAC,EAAE,SAAS,CAAC,CAAC,EAAA,GACxF,KAAK,EAGR,EAAA,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA0B,MACrEH,qCAACI,+BAAe,EAAA,EACd,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EACrB,UAAU,EAAE,UAAU,EAClB,GAAA,KAAK,GACT,CACH,CACW;AAElB;;;;"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { ListBoxItem } from 'react-aria-components';
|
|
3
|
-
import '../../../hooks/useFocusVisible.js';
|
|
4
|
-
import { useId } from '../../../hooks/useId.js';
|
|
5
|
-
import 'lodash.throttle';
|
|
6
|
-
import { ListItemContent } from './components/ListItemContent.js';
|
|
7
|
-
import styles from './ListItem.module.scss.js';
|
|
8
|
-
import { buildClassnames } from '../../../utils/buildClassnames.js';
|
|
9
|
-
import 'uid/secure';
|
|
10
|
-
|
|
11
|
-
const ListItem = ({ id, label, href, appearance = 'primary', className, ...props }) => {
|
|
12
|
-
const idComputed = useId({ id, prefix: 'list-item' });
|
|
13
|
-
return (React__default.createElement(ListBoxItem, { id: idComputed, textValue: label, href: href, className: buildClassnames([styles.listItem, styles[`appearance-${appearance}`], className]), ...props }, ({ selectionMode, allowsDragging, isSelected }) => (React__default.createElement(ListItemContent, { selectionMode: selectionMode, allowsDragging: allowsDragging, isSelected: isSelected, label: label, isLink: Boolean(href), appearance: appearance, ...props }))));
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export { ListItem };
|
|
17
|
-
//# sourceMappingURL=ListItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.js","sources":["../../../../src/components/SelectDropdown/ListItem/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBoxItem, ListBoxItemRenderProps } from 'react-aria-components';\nimport { useId } from '../../../hooks';\nimport { ListItemProps } from './types';\nimport { ListItemContent } from './components/ListItemContent';\nimport styles from './ListItem.module.scss';\nimport { buildClassnames } from '../../../utils';\n\nexport const ListItem = ({\n id,\n label,\n href,\n appearance = 'primary',\n className,\n ...props\n}: ListItemProps) => {\n const idComputed = useId({ id, prefix: 'list-item' });\n\n return (\n <ListBoxItem\n id={idComputed}\n textValue={label}\n href={href}\n className={buildClassnames([styles.listItem, styles[`appearance-${appearance}`], className])}\n {...props}\n >\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: ListBoxItemRenderProps) => (\n <ListItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n appearance={appearance}\n {...props}\n />\n )}\n </ListBoxItem>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;MAQa,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,UAAU,GAAG,SAAS,EACtB,SAAS,EACT,GAAG,KAAK,EACM,KAAI;AAClB,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAErD,IAAA,QACEA,cAAC,CAAA,aAAA,CAAA,WAAW,IACV,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,KAAK,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA,WAAA,EAAc,UAAU,CAAE,CAAA,CAAC,EAAE,SAAS,CAAC,CAAC,EAAA,GACxF,KAAK,EAGR,EAAA,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA0B,MACrEA,6BAAC,eAAe,EAAA,EACd,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EACrB,UAAU,EAAE,UAAU,EAClB,GAAA,KAAK,GACT,CACH,CACW;AAElB;;;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var ___$insertStyle = require('../../../_virtual/____insertStyle.cjs');
|
|
4
|
-
|
|
5
|
-
___$insertStyle("._listItem_y5fce_1 {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n}\n._listItem_y5fce_1._appearance-secondary_y5fce_7 {\n background-color: var(--colors-neutral-grey-lightest);\n}\n._listItem_y5fce_1[data-hovered] > div {\n background-color: #f0f7fc;\n}\n._listItem_y5fce_1[data-pressed] > div {\n background-color: #e3f0fa;\n}\n._listItem_y5fce_1[data-focused] {\n outline: 0;\n}\n._listItem_y5fce_1[data-focus-visible] > div {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n}\n._listItem_y5fce_1[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n}\n._listItem_y5fce_1[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n}\n._listItem_y5fce_1[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n}\n._listItem_y5fce_1 > div {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n}\n\n._linkIcon_y5fce_42 {\n color: var(--colors-neutral-ink-base);\n}\n\n._infoContainer_y5fce_46 {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n}\n._infoContainer_y5fce_46._hasItemInfoAndEndInfo_y5fce_54 {\n grid-template-columns: auto 1fr 1fr;\n}\n._infoContainer_y5fce_46._hasItemInfoOnly_y5fce_57, ._infoContainer_y5fce_46._hasEndInfoOnly_y5fce_57 {\n grid-template-columns: auto 1fr;\n}\n._infoContainer_y5fce_46 > *:last-child._justifyEnd_y5fce_60 {\n justify-self: end;\n}\n._infoContainer_y5fce_46 > *:last-child._justifyStart_y5fce_63 {\n justify-self: start;\n}");
|
|
6
|
-
var styles = {"listItem":"_listItem_y5fce_1","appearance-secondary":"_appearance-secondary_y5fce_7","linkIcon":"_linkIcon_y5fce_42","infoContainer":"_infoContainer_y5fce_46","hasItemInfoAndEndInfo":"_hasItemInfoAndEndInfo_y5fce_54","hasItemInfoOnly":"_hasItemInfoOnly_y5fce_57","hasEndInfoOnly":"_hasEndInfoOnly_y5fce_57","justifyEnd":"_justifyEnd_y5fce_60","justifyStart":"_justifyStart_y5fce_63"};
|
|
7
|
-
|
|
8
|
-
module.exports = styles;
|
|
9
|
-
//# sourceMappingURL=ListItem.module.scss.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.module.scss.cjs","sources":["../../../../src/components/SelectDropdown/ListItem/ListItem.module.scss"],"sourcesContent":[".listItem {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n\n &.appearance-secondary {\n background-color: var(--colors-neutral-grey-lightest);\n }\n\n &[data-hovered] > div {\n background-color: #f0f7fc;\n }\n\n &[data-pressed] > div {\n background-color: #e3f0fa;\n }\n\n &[data-focused] {\n outline: 0;\n }\n\n &[data-focus-visible] > div {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n }\n\n &[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n }\n\n &[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n }\n\n > div {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n }\n}\n\n.linkIcon {\n color: var(--colors-neutral-ink-base);\n}\n\n.infoContainer {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n\n &.hasItemInfoAndEndInfo {\n grid-template-columns: auto 1fr 1fr;\n }\n\n &.hasItemInfoOnly,\n &.hasEndInfoOnly {\n grid-template-columns: auto 1fr;\n }\n\n > *:last-child {\n &.justifyEnd {\n justify-self: end;\n }\n\n &.justifyStart {\n justify-self: start;\n }\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,gwDAAA;AACA,aAAA,CAAA,UAAA,CAAA,mBAAA,CAAA,sBAAA,CAAA,+BAAA,CAAA,UAAA,CAAA,oBAAA,CAAA,eAAA,CAAA,yBAAA,CAAA,uBAAA,CAAA,iCAAA,CAAA,iBAAA,CAAA,2BAAA,CAAA,gBAAA,CAAA,0BAAA,CAAA,YAAA,CAAA,sBAAA,CAAA,cAAA,CAAA,wBAAA;;;;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import insertStyle from '../../../_virtual/____insertStyle.js';
|
|
2
|
-
|
|
3
|
-
insertStyle("._listItem_y5fce_1 {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n}\n._listItem_y5fce_1._appearance-secondary_y5fce_7 {\n background-color: var(--colors-neutral-grey-lightest);\n}\n._listItem_y5fce_1[data-hovered] > div {\n background-color: #f0f7fc;\n}\n._listItem_y5fce_1[data-pressed] > div {\n background-color: #e3f0fa;\n}\n._listItem_y5fce_1[data-focused] {\n outline: 0;\n}\n._listItem_y5fce_1[data-focus-visible] > div {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n}\n._listItem_y5fce_1[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n}\n._listItem_y5fce_1[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n}\n._listItem_y5fce_1[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n}\n._listItem_y5fce_1 > div {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n}\n\n._linkIcon_y5fce_42 {\n color: var(--colors-neutral-ink-base);\n}\n\n._infoContainer_y5fce_46 {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n}\n._infoContainer_y5fce_46._hasItemInfoAndEndInfo_y5fce_54 {\n grid-template-columns: auto 1fr 1fr;\n}\n._infoContainer_y5fce_46._hasItemInfoOnly_y5fce_57, ._infoContainer_y5fce_46._hasEndInfoOnly_y5fce_57 {\n grid-template-columns: auto 1fr;\n}\n._infoContainer_y5fce_46 > *:last-child._justifyEnd_y5fce_60 {\n justify-self: end;\n}\n._infoContainer_y5fce_46 > *:last-child._justifyStart_y5fce_63 {\n justify-self: start;\n}");
|
|
4
|
-
var styles = {"listItem":"_listItem_y5fce_1","appearance-secondary":"_appearance-secondary_y5fce_7","linkIcon":"_linkIcon_y5fce_42","infoContainer":"_infoContainer_y5fce_46","hasItemInfoAndEndInfo":"_hasItemInfoAndEndInfo_y5fce_54","hasItemInfoOnly":"_hasItemInfoOnly_y5fce_57","hasEndInfoOnly":"_hasEndInfoOnly_y5fce_57","justifyEnd":"_justifyEnd_y5fce_60","justifyStart":"_justifyStart_y5fce_63"};
|
|
5
|
-
|
|
6
|
-
export { styles as default };
|
|
7
|
-
//# sourceMappingURL=ListItem.module.scss.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.module.scss.js","sources":["../../../../src/components/SelectDropdown/ListItem/ListItem.module.scss"],"sourcesContent":[".listItem {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n\n &.appearance-secondary {\n background-color: var(--colors-neutral-grey-lightest);\n }\n\n &[data-hovered] > div {\n background-color: #f0f7fc;\n }\n\n &[data-pressed] > div {\n background-color: #e3f0fa;\n }\n\n &[data-focused] {\n outline: 0;\n }\n\n &[data-focus-visible] > div {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n }\n\n &[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n }\n\n &[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n }\n\n > div {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n }\n}\n\n.linkIcon {\n color: var(--colors-neutral-ink-base);\n}\n\n.infoContainer {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n\n &.hasItemInfoAndEndInfo {\n grid-template-columns: auto 1fr 1fr;\n }\n\n &.hasItemInfoOnly,\n &.hasEndInfoOnly {\n grid-template-columns: auto 1fr;\n }\n\n > *:last-child {\n &.justifyEnd {\n justify-self: end;\n }\n\n &.justifyStart {\n justify-self: start;\n }\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,gwDAAA;AACA,aAAA,CAAA,UAAA,CAAA,mBAAA,CAAA,sBAAA,CAAA,+BAAA,CAAA,UAAA,CAAA,oBAAA,CAAA,eAAA,CAAA,yBAAA,CAAA,uBAAA,CAAA,iCAAA,CAAA,iBAAA,CAAA,2BAAA,CAAA,gBAAA,CAAA,0BAAA,CAAA,YAAA,CAAA,sBAAA,CAAA,cAAA,CAAA,wBAAA;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemContent.cjs","sources":["../../../../../src/components/SelectDropdown/ListItem/components/ListItemContent.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Text } from 'react-aria-components';\nimport { buildClassnames } from '../../../../utils';\nimport { FlexCol } from '../../../Flex/FlexCol';\nimport { ArrowRightIcon, DragIndicatorIcon } from '../../../../icons';\nimport { ListItemContentProps } from './types';\nimport { Text as VeeqoText } from '../../../Text';\nimport { MiniAlert } from '../../../Alerts/MiniAlert';\nimport { SelectionType } from './SelectionType';\nimport styles from '../ListItem.module.scss';\nimport { FlexRow } from '../../../Flex/FlexRow';\n\nexport const ListItemContent = ({\n label,\n hint,\n itemInfoSlot,\n endInfoSlot,\n alert,\n mediaSlot,\n allowsDragging = false,\n selectionMode = 'single',\n isLink,\n isSelected = false,\n}: ListItemContentProps) => {\n const getInfoContainerClassNames = useMemo(() => {\n const base = styles.infoContainer;\n\n if (itemInfoSlot && endInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoAndEndInfo]);\n }\n\n if (itemInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoOnly]);\n }\n\n if (endInfoSlot) {\n return buildClassnames([base, styles.hasEndInfoOnly]);\n }\n\n return buildClassnames([base]);\n }, [endInfoSlot, itemInfoSlot]);\n\n return (\n <FlexRow flexWrap=\"nowrap\" justifyContent=\"space-between\" alignItems=\"center\" gap=\"base\">\n <FlexRow flexWrap=\"nowrap\" gap=\"base\" style={{ flexGrow: 1 }}>\n {allowsDragging && <DragIndicatorIcon data-testid=\"drag-icon\" />}\n <SelectionType selectionMode={selectionMode} isSelected={isSelected} isLink={isLink} />\n {mediaSlot}\n <FlexCol gap=\"xs\" style={{ flexGrow: 1 }}>\n <div className={getInfoContainerClassNames} data-testid=\"info-container\">\n <Text slot=\"label\">\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n </Text>\n {itemInfoSlot}\n {endInfoSlot && (\n <div className={endInfoSlot ? styles.justifyEnd : styles.justifyStart}>\n {endInfoSlot}\n </div>\n )}\n </div>\n\n {hint && (\n <Text slot=\"description\">\n <VeeqoText variant=\"hintText\">{hint}</VeeqoText>\n </Text>\n )}\n {alert && <MiniAlert title={alert.title} variant={alert.variant} />}\n </FlexCol>\n </FlexRow>\n {isLink && <ArrowRightIcon className={styles.linkIcon} data-testid=\"link-icon\" />}\n </FlexRow>\n );\n};\n"],"names":["useMemo","styles","buildClassnames","React","FlexRow","DragIndicatorIcon","SelectionType","FlexCol","Text","VeeqoText","MiniAlert","ArrowRightIcon"],"mappings":";;;;;;;;;;;;;;;;;;;AAYO,MAAM,eAAe,GAAG,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,cAAc,GAAG,KAAK,EACtB,aAAa,GAAG,QAAQ,EACxB,MAAM,EACN,UAAU,GAAG,KAAK,GACG,KAAI;AACzB,IAAA,MAAM,0BAA0B,GAAGA,aAAO,CAAC,MAAK;AAC9C,QAAA,MAAM,IAAI,GAAGC,eAAM,CAAC,aAAa;QAEjC,IAAI,YAAY,IAAI,WAAW,EAAE;YAC/B,OAAOC,+BAAe,CAAC,CAAC,IAAI,EAAED,eAAM,CAAC,qBAAqB,CAAC,CAAC;AAC7D;AAED,QAAA,IAAI,YAAY,EAAE;YAChB,OAAOC,+BAAe,CAAC,CAAC,IAAI,EAAED,eAAM,CAAC,eAAe,CAAC,CAAC;AACvD;AAED,QAAA,IAAI,WAAW,EAAE;YACf,OAAOC,+BAAe,CAAC,CAAC,IAAI,EAAED,eAAM,CAAC,cAAc,CAAC,CAAC;AACtD;AAED,QAAA,OAAOC,+BAAe,CAAC,CAAC,IAAI,CAAC,CAAC;AAChC,KAAC,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAE/B,IAAA,QACEC,sBAAC,CAAA,aAAA,CAAAC,eAAO,IAAC,QAAQ,EAAC,QAAQ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,UAAU,EAAE,EAAA,IAAI,CAAa,CAC3C,CACR;AACA,gBAAA,KAAK,IAAIN,sBAAC,CAAA,aAAA,CAAAO,mBAAS,EAAC,EAAA,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAA,CAAI,CAC3D,CACF;AACT,QAAA,MAAM,IAAIP,sBAAA,CAAA,aAAA,CAACQ,6BAAc,EAAA,EAAC,SAAS,EAAEV,eAAM,CAAC,QAAQ,EAAc,aAAA,EAAA,WAAW,EAAG,CAAA,CACzE;AAEd;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemContent.js","sources":["../../../../../src/components/SelectDropdown/ListItem/components/ListItemContent.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Text } from 'react-aria-components';\nimport { buildClassnames } from '../../../../utils';\nimport { FlexCol } from '../../../Flex/FlexCol';\nimport { ArrowRightIcon, DragIndicatorIcon } from '../../../../icons';\nimport { ListItemContentProps } from './types';\nimport { Text as VeeqoText } from '../../../Text';\nimport { MiniAlert } from '../../../Alerts/MiniAlert';\nimport { SelectionType } from './SelectionType';\nimport styles from '../ListItem.module.scss';\nimport { FlexRow } from '../../../Flex/FlexRow';\n\nexport const ListItemContent = ({\n label,\n hint,\n itemInfoSlot,\n endInfoSlot,\n alert,\n mediaSlot,\n allowsDragging = false,\n selectionMode = 'single',\n isLink,\n isSelected = false,\n}: ListItemContentProps) => {\n const getInfoContainerClassNames = useMemo(() => {\n const base = styles.infoContainer;\n\n if (itemInfoSlot && endInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoAndEndInfo]);\n }\n\n if (itemInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoOnly]);\n }\n\n if (endInfoSlot) {\n return buildClassnames([base, styles.hasEndInfoOnly]);\n }\n\n return buildClassnames([base]);\n }, [endInfoSlot, itemInfoSlot]);\n\n return (\n <FlexRow flexWrap=\"nowrap\" justifyContent=\"space-between\" alignItems=\"center\" gap=\"base\">\n <FlexRow flexWrap=\"nowrap\" gap=\"base\" style={{ flexGrow: 1 }}>\n {allowsDragging && <DragIndicatorIcon data-testid=\"drag-icon\" />}\n <SelectionType selectionMode={selectionMode} isSelected={isSelected} isLink={isLink} />\n {mediaSlot}\n <FlexCol gap=\"xs\" style={{ flexGrow: 1 }}>\n <div className={getInfoContainerClassNames} data-testid=\"info-container\">\n <Text slot=\"label\">\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n </Text>\n {itemInfoSlot}\n {endInfoSlot && (\n <div className={endInfoSlot ? styles.justifyEnd : styles.justifyStart}>\n {endInfoSlot}\n </div>\n )}\n </div>\n\n {hint && (\n <Text slot=\"description\">\n <VeeqoText variant=\"hintText\">{hint}</VeeqoText>\n </Text>\n )}\n {alert && <MiniAlert title={alert.title} variant={alert.variant} />}\n </FlexCol>\n </FlexRow>\n {isLink && <ArrowRightIcon className={styles.linkIcon} data-testid=\"link-icon\" />}\n </FlexRow>\n );\n};\n"],"names":["React","VeeqoText"],"mappings":";;;;;;;;;;;;;AAYO,MAAM,eAAe,GAAG,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,cAAc,GAAG,KAAK,EACtB,aAAa,GAAG,QAAQ,EACxB,MAAM,EACN,UAAU,GAAG,KAAK,GACG,KAAI;AACzB,IAAA,MAAM,0BAA0B,GAAG,OAAO,CAAC,MAAK;AAC9C,QAAA,MAAM,IAAI,GAAG,MAAM,CAAC,aAAa;QAEjC,IAAI,YAAY,IAAI,WAAW,EAAE;YAC/B,OAAO,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAC7D;AAED,QAAA,IAAI,YAAY,EAAE;YAChB,OAAO,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;AACvD;AAED,QAAA,IAAI,WAAW,EAAE;YACf,OAAO,eAAe,CA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AM,CAAC,UAAU,GAAG,MAAM,CAAC,YAAY,EAClE,EAAA,WAAW,CACR,CACP,CACG;AAEL,gBAAA,IAAI,KACHA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,IAAI,EAAC,aAAa,EAAA;oBACtBA,cAAC,CAAA,aAAA,CAAAC,MAAS,IAAC,OAAO,EAAC,UAAU,EAAE,EAAA,IAAI,CAAa,CAC3C,CACR;AACA,gBAAA,KAAK,IAAID,cAAC,CAAA,aAAA,CAAA,SAAS,EAAC,EAAA,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAA,CAAI,CAC3D,CACF;AACT,QAAA,MAAM,IAAIA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAc,aAAA,EAAA,WAAW,EAAG,CAAA,CACzE;AAEd;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionType.cjs","sources":["../../../../../src/components/SelectDropdown/ListItem/components/SelectionType.tsx"],"sourcesContent":["import React from 'react';\nimport { Radio } from '../../../Radio';\nimport { Checkbox } from '../../../Checkbox';\n\ntype SelectionTypeProps = {\n selectionMode: 'single' | 'multiple' | 'none';\n isSelected: boolean;\n isLink?: boolean;\n};\n\nexport const SelectionType = ({ selectionMode, isSelected, isLink }: SelectionTypeProps) => {\n if (isLink || selectionMode === 'none') return null;\n\n if (selectionMode === 'single') return <Radio checked={isSelected} onChange={() => {}} />;\n\n return <Checkbox checked={isSelected} onChange={() => {}} />;\n};\n"],"names":["React","Radio","Checkbox"],"mappings":";;;;;;;;;;AAUO,MAAM,aAAa,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAsB,KAAI;AACzF,IAAA,IAAI,MAAM,IAAI,aAAa,KAAK,MAAM;AAAE,QAAA,OAAO,IAAI;IAEnD,IAAI,aAAa,KAAK,QAAQ;AAAE,QAAA,OAAOA,sBAAC,CAAA,aAAA,CAAAC,WAAK,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAEzF,IAAA,OAAOD,sBAAC,CAAA,aAAA,CAAAE,iBAAQ,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAC9D;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionType.js","sources":["../../../../../src/components/SelectDropdown/ListItem/components/SelectionType.tsx"],"sourcesContent":["import React from 'react';\nimport { Radio } from '../../../Radio';\nimport { Checkbox } from '../../../Checkbox';\n\ntype SelectionTypeProps = {\n selectionMode: 'single' | 'multiple' | 'none';\n isSelected: boolean;\n isLink?: boolean;\n};\n\nexport const SelectionType = ({ selectionMode, isSelected, isLink }: SelectionTypeProps) => {\n if (isLink || selectionMode === 'none') return null;\n\n if (selectionMode === 'single') return <Radio checked={isSelected} onChange={() => {}} />;\n\n return <Checkbox checked={isSelected} onChange={() => {}} />;\n};\n"],"names":["React"],"mappings":";;;;AAUO,MAAM,aAAa,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAsB,KAAI;AACzF,IAAA,IAAI,MAAM,IAAI,aAAa,KAAK,MAAM;AAAE,QAAA,OAAO,IAAI;IAEnD,IAAI,aAAa,KAAK,QAAQ;AAAE,QAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAEzF,IAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAC9D;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemSection.cjs","sources":["../../../../src/components/SelectDropdown/ListItemSection/ListItemSection.tsx"],"sourcesContent":["import React, { ReactElement } from 'react';\nimport { Collection, Header, Section, SectionProps } from 'react-aria-components';\nimport { FlexRow } from '../../Flex/FlexRow';\nimport { FlexCol } from '../../Flex/FlexCol';\nimport { Text as VeeqoText } from '../../Text';\nimport { ListItemProps } from '../ListItem/types';\nimport { ListItem } from '../ListItem/ListItem';\nimport styles from './ListItemSection.module.scss';\nimport { buildClassnames } from '../../../utils';\n\nexport type ListItemSectionProps = Omit<SectionProps<ListItemProps>, 'items'> & {\n label: string;\n hint?: string;\n itemInfoSlot?: ReactElement;\n items?: ListItemProps[];\n};\n\nexport const ListItemSection = ({\n label,\n hint,\n itemInfoSlot,\n items,\n children,\n className,\n ...props\n}: ListItemSectionProps) => (\n <Section className={buildClassnames([styles.section, className])} {...props}>\n <Header>\n <FlexCol gap=\"xs\">\n <FlexRow>\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n {itemInfoSlot}\n </FlexRow>\n {hint && <VeeqoText variant=\"hintText\">{hint}</VeeqoText>}\n </FlexCol>\n </Header>\n {children}\n {items && (\n <Collection items={items}>{(item: ListItemProps) => <ListItem {...item} />}</Collection>\n )}\n </Section>\n);\n"],"names":["React","Section","buildClassnames","styles","Header","FlexCol","FlexRow","VeeqoText","Collection","ListItem"],"mappings":";;;;;;;;;;;;;;;;AAiBa,MAAA,eAAe,GAAG,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACa,MACrBA,qCAACC,2BAAO,EAAA,EAAC,SAAS,EAAEC,+BAAe,CAAC,CAACC,sBAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,KAAM,KAAK,EAAA;AACzE,IAAAH,sBAAA,CAAA,aAAA,CAACI,0BAAM,EAAA,IAAA;AACL,QAAAJ,sBAAA,CAAA,aAAA,CAACK,eAAO,EAAA,EAAC,GAAG,EAAC,IAAI,EAAA;AACf,YAAAL,sBAAA,CAAA,aAAA,CAACM,eAAO,EAAA,IAAA;AACN,gBAAAN,sBAAA,CAAA,aAAA,CAACO,SAAS,EAAC,EAAA,OAAO,EAAC,MAAM,EAAA,EAAE,KAAK,CAAa;AAC5C,gBAAA,YAAY,CACL;YACT,IAAI,IAAIP,sBAAC,CAAA,aAAA,CAAAO,SAAS,EAAC,EAAA,OAAO,EAAC,UAAU,EAAE,EAAA,IAAI,CAAa,CACjD,CACH;IACR,QAAQ;IACR,KAAK,KACJP,sBAAC,CAAA,aAAA,CAAAQ,8BAAU,IAAC,KAAK,EAAE,KAAK,EAAA,EAAG,CAAC,IAAmB,KAAKR,sBAAC,CAAA,aAAA,CAAAS,iBAAQ,EAAK,EAAA,GAAA,IAAI,GAAI,CAAc,CACzF,CACO;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemSection.js","sources":["../../../../src/components/SelectDropdown/ListItemSection/ListItemSection.tsx"],"sourcesContent":["import React, { ReactElement } from 'react';\nimport { Collection, Header, Section, SectionProps } from 'react-aria-components';\nimport { FlexRow } from '../../Flex/FlexRow';\nimport { FlexCol } from '../../Flex/FlexCol';\nimport { Text as VeeqoText } from '../../Text';\nimport { ListItemProps } from '../ListItem/types';\nimport { ListItem } from '../ListItem/ListItem';\nimport styles from './ListItemSection.module.scss';\nimport { buildClassnames } from '../../../utils';\n\nexport type ListItemSectionProps = Omit<SectionProps<ListItemProps>, 'items'> & {\n label: string;\n hint?: string;\n itemInfoSlot?: ReactElement;\n items?: ListItemProps[];\n};\n\nexport const ListItemSection = ({\n label,\n hint,\n itemInfoSlot,\n items,\n children,\n className,\n ...props\n}: ListItemSectionProps) => (\n <Section className={buildClassnames([styles.section, className])} {...props}>\n <Header>\n <FlexCol gap=\"xs\">\n <FlexRow>\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n {itemInfoSlot}\n </FlexRow>\n {hint && <VeeqoText variant=\"hintText\">{hint}</VeeqoText>}\n </FlexCol>\n </Header>\n {children}\n {items && (\n <Collection items={items}>{(item: ListItemProps) => <ListItem {...item} />}</Collection>\n )}\n </Section>\n);\n"],"names":["React","VeeqoText"],"mappings":";;;;;;;;;;AAiBa,MAAA,eAAe,GAAG,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACa,MACrBA,6BAAC,OAAO,EAAA,EAAC,SAAS,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,KAAM,KAAK,EAAA;AACzE,IAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA;AACL,QAAAA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,EAAC,GAAG,EAAC,IAAI,EAAA;AACf,YAAAA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,IAAA;AACN,gBAAAA,cAAA,CAAA,aAAA,CAACC,IAAS,EAAC,EAAA,OAAO,EAAC,MAAM,EAAA,EAAE,KAAK,CAAa;AAC5C,gBAAA,YAAY,CACL;YACT,IAAI,IAAID,cAAC,CAAA,aAAA,CAAAC,IAAS,EAAC,EAAA,OAAO,EAAC,UAAU,EAAE,EAAA,IAAI,CAAa,CACjD,CACH;IACR,QAAQ;IACR,KAAK,KACJD,cAAC,CAAA,aAAA,CAAA,UAAU,IAAC,KAAK,EAAE,KAAK,EAAA,EAAG,CAAC,IAAmB,KAAKA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAK,EAAA,GAAA,IAAI,GAAI,CAAc,CACzF,CACO;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemSection.module.scss.cjs","sources":["../../../../src/components/SelectDropdown/ListItemSection/ListItemSection.module.scss"],"sourcesContent":[".section {\n border-radius: var(--sizes-base);\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,6DAAA;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemSection.module.scss.js","sources":["../../../../src/components/SelectDropdown/ListItemSection/ListItemSection.module.scss"],"sourcesContent":[".section {\n border-radius: var(--sizes-base);\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,6DAAA;;;;;"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/index.d.ts
RENAMED
|
File without changes
|