@capillarytech/blaze-ui 6.1.1 → 6.1.2
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/.npmrc +3 -0
- package/CapCustomCheckboxList/styles.css +3 -3
- package/CapCustomCheckboxList/styles.scss +7 -8
- package/CapMobileDatePicker/index.d.ts +14 -3
- package/CapMobileDatePicker/index.d.ts.map +1 -1
- package/CapMobileDatePicker/index.js +20 -28
- package/CapMobileDatePicker/styles.css +11 -28
- package/CapMobileDatePicker/styles.scss +16 -37
- package/CapPopoverTree/index.d.ts +40 -3
- package/CapPopoverTree/index.d.ts.map +1 -1
- package/CapPopoverTree/index.js +82 -72
- package/CapPopoverTree/style.d.ts +1 -5
- package/CapPopoverTree/style.d.ts.map +1 -1
- package/CapPopoverTree/styles.css +18 -119
- package/CapPopoverTree/styles.scss +31 -179
- package/CapProductSelection/index.d.ts +7 -29
- package/CapProductSelection/index.d.ts.map +1 -1
- package/CapProductSelection/index.js +52 -89
- package/CapProductSelection/messages.d.ts +76 -0
- package/CapProductSelection/messages.d.ts.map +1 -0
- package/CapProductSelection/messages.js +79 -0
- package/CapProductSelection/styles.css +81 -0
- package/CapProductSelection/styles.module.scss.js +8 -0
- package/CapProductSelection/styles.scss +82 -40
- package/CapProductSelection/tests/CapProductSelection.mockData.d.ts +36 -0
- package/CapProductSelection/tests/CapProductSelection.mockData.d.ts.map +1 -0
- package/CapProductSelection/types.d.ts +34 -0
- package/CapProductSelection/types.d.ts.map +1 -0
- package/CapRadioCard/index.d.ts.map +1 -1
- package/CapRadioCard/index.js +52 -20
- package/CapRadioCard/styles.css +25 -25
- package/CapRadioCard/styles.module.scss.js +14 -40
- package/CapRadioCard/styles.scss +20 -20
- package/CapRadioCard/types.d.ts +20 -0
- package/CapRadioCard/types.d.ts.map +1 -1
- package/CapSelectFilter/index.d.ts.map +1 -1
- package/CapSelectFilter/index.js +10 -11
- package/CapSelectFilter/styles.css +11 -10
- package/CapSelectFilter/styles.module.scss.js +8 -10
- package/CapSelectFilter/styles.scss +11 -8
- package/CapSelectFilter/types.d.ts +1 -1
- package/CapSelectFilter/types.d.ts.map +1 -1
- package/CapStaticTemplates/index.d.ts +3 -1
- package/CapStaticTemplates/index.d.ts.map +1 -1
- package/CapStaticTemplates/index.js +185 -144
- package/CapStaticTemplates/messages.d.ts +32 -0
- package/CapStaticTemplates/messages.d.ts.map +1 -0
- package/CapStaticTemplates/messages.js +35 -0
- package/CapStaticTemplates/styles.css +220 -0
- package/CapStaticTemplates/styles.module.scss.js +55 -0
- package/CapStaticTemplates/styles.scss +291 -0
- package/CapStaticTemplates/tests/CapStaticTemplates.mockData.d.ts +54 -0
- package/CapStaticTemplates/tests/CapStaticTemplates.mockData.d.ts.map +1 -0
- package/CapStaticTemplates/types.d.ts +97 -0
- package/CapStaticTemplates/types.d.ts.map +1 -0
- package/index.d.ts +4 -4
- package/index.d.ts.map +1 -1
- package/index.js +56 -56
- package/package.json +1 -1
- package/styles/_variables.scss +2 -0
- package/utils/dayjs.d.ts +0 -1
- package/utils/dayjs.d.ts.map +1 -1
- package/utils/dayjs.js +0 -1
- package/CapMobileDatePicker/styles.module.scss.js +0 -10
- package/CapMobileDatePicker/tests/CapMobileDatePicker.mockData.d.ts +0 -41
- package/CapMobileDatePicker/tests/CapMobileDatePicker.mockData.d.ts.map +0 -1
- package/CapMobileDatePicker/types.d.ts +0 -17
- package/CapMobileDatePicker/types.d.ts.map +0 -1
- package/CapPopoverTree/styles.module.scss.js +0 -26
- package/CapPopoverTree/tests/CapPopoverTree.mockData.d.ts +0 -22
- package/CapPopoverTree/tests/CapPopoverTree.mockData.d.ts.map +0 -1
- package/CapPopoverTree/types.d.ts +0 -62
- package/CapPopoverTree/types.d.ts.map +0 -1
- package/CapProductSelection/style.d.ts +0 -3
- package/CapProductSelection/style.d.ts.map +0 -1
- package/CapProductSelection/style.js +0 -38
- package/CapStaticTemplates/style.d.ts +0 -13
- package/CapStaticTemplates/style.d.ts.map +0 -1
- package/CapStaticTemplates/style.js +0 -216
- /package/{CapMobileDatePicker → CapProductSelection}/types.js +0 -0
- /package/{CapPopoverTree → CapStaticTemplates}/types.js +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
lineItem: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
};
|
|
6
|
+
selectAttribute: {
|
|
7
|
+
id: string;
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
};
|
|
10
|
+
brand: {
|
|
11
|
+
id: string;
|
|
12
|
+
defaultMessage: string;
|
|
13
|
+
};
|
|
14
|
+
brandInfo: {
|
|
15
|
+
id: string;
|
|
16
|
+
defaultMessage: string;
|
|
17
|
+
};
|
|
18
|
+
category: {
|
|
19
|
+
id: string;
|
|
20
|
+
defaultMessage: string;
|
|
21
|
+
};
|
|
22
|
+
categoryInfo: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
};
|
|
26
|
+
product: {
|
|
27
|
+
id: string;
|
|
28
|
+
defaultMessage: string;
|
|
29
|
+
};
|
|
30
|
+
productInfo: {
|
|
31
|
+
id: string;
|
|
32
|
+
defaultMessage: string;
|
|
33
|
+
};
|
|
34
|
+
SKU: {
|
|
35
|
+
id: string;
|
|
36
|
+
defaultMessage: string;
|
|
37
|
+
};
|
|
38
|
+
uploadSKU: {
|
|
39
|
+
id: string;
|
|
40
|
+
defaultMessage: string;
|
|
41
|
+
};
|
|
42
|
+
uploadSKUInfo: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
};
|
|
46
|
+
changeSelection: {
|
|
47
|
+
id: string;
|
|
48
|
+
defaultMessage: string;
|
|
49
|
+
};
|
|
50
|
+
description: {
|
|
51
|
+
id: string;
|
|
52
|
+
defaultMessage: string;
|
|
53
|
+
};
|
|
54
|
+
okText: {
|
|
55
|
+
id: string;
|
|
56
|
+
defaultMessage: string;
|
|
57
|
+
};
|
|
58
|
+
cancelText: {
|
|
59
|
+
id: string;
|
|
60
|
+
defaultMessage: string;
|
|
61
|
+
};
|
|
62
|
+
comingSoon: {
|
|
63
|
+
id: string;
|
|
64
|
+
defaultMessage: string;
|
|
65
|
+
};
|
|
66
|
+
selectValues: {
|
|
67
|
+
id: string;
|
|
68
|
+
defaultMessage: string;
|
|
69
|
+
};
|
|
70
|
+
atleast1Attribute: {
|
|
71
|
+
id: string;
|
|
72
|
+
defaultMessage: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export default _default;
|
|
76
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../components/CapProductSelection/messages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBA0EG"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { defineMessages } from "react-intl";
|
|
2
|
+
const scope = "blaze.components.CapProductSelection";
|
|
3
|
+
const messages = defineMessages({
|
|
4
|
+
lineItem: {
|
|
5
|
+
id: `${scope}.lineItem`,
|
|
6
|
+
defaultMessage: "Line items"
|
|
7
|
+
},
|
|
8
|
+
selectAttribute: {
|
|
9
|
+
id: `${scope}.selectAttribute`,
|
|
10
|
+
defaultMessage: "Select Attribute"
|
|
11
|
+
},
|
|
12
|
+
brand: {
|
|
13
|
+
id: `${scope}.brand`,
|
|
14
|
+
defaultMessage: "Brand"
|
|
15
|
+
},
|
|
16
|
+
brandInfo: {
|
|
17
|
+
id: `${scope}.brandInfo`,
|
|
18
|
+
defaultMessage: "Brand"
|
|
19
|
+
},
|
|
20
|
+
category: {
|
|
21
|
+
id: `${scope}.category`,
|
|
22
|
+
defaultMessage: "Category"
|
|
23
|
+
},
|
|
24
|
+
categoryInfo: {
|
|
25
|
+
id: `${scope}.categoryInfo`,
|
|
26
|
+
defaultMessage: "Category"
|
|
27
|
+
},
|
|
28
|
+
product: {
|
|
29
|
+
id: `${scope}.product`,
|
|
30
|
+
defaultMessage: "Product"
|
|
31
|
+
},
|
|
32
|
+
productInfo: {
|
|
33
|
+
id: `${scope}.productInfo`,
|
|
34
|
+
defaultMessage: "Product"
|
|
35
|
+
},
|
|
36
|
+
SKU: {
|
|
37
|
+
id: `${scope}.SKU`,
|
|
38
|
+
defaultMessage: "SKU"
|
|
39
|
+
},
|
|
40
|
+
uploadSKU: {
|
|
41
|
+
id: `${scope}.uploadSKU`,
|
|
42
|
+
defaultMessage: "Upload SKU"
|
|
43
|
+
},
|
|
44
|
+
uploadSKUInfo: {
|
|
45
|
+
id: `${scope}.uploadSKUInfo`,
|
|
46
|
+
defaultMessage: "Upload SKU"
|
|
47
|
+
},
|
|
48
|
+
changeSelection: {
|
|
49
|
+
id: `${scope}.changeSelection`,
|
|
50
|
+
defaultMessage: "Change the selection"
|
|
51
|
+
},
|
|
52
|
+
description: {
|
|
53
|
+
id: `${scope}.description`,
|
|
54
|
+
defaultMessage: "Changing the attribute of additional condition will result in lose of previously defined additional condition"
|
|
55
|
+
},
|
|
56
|
+
okText: {
|
|
57
|
+
id: `${scope}.okText`,
|
|
58
|
+
defaultMessage: "Yes, change"
|
|
59
|
+
},
|
|
60
|
+
cancelText: {
|
|
61
|
+
id: `${scope}.cancelText`,
|
|
62
|
+
defaultMessage: "Cancel"
|
|
63
|
+
},
|
|
64
|
+
comingSoon: {
|
|
65
|
+
id: `${scope}.comingSoon`,
|
|
66
|
+
defaultMessage: "Coming soon"
|
|
67
|
+
},
|
|
68
|
+
selectValues: {
|
|
69
|
+
id: `${scope}.selectValues`,
|
|
70
|
+
defaultMessage: "Select value(s)"
|
|
71
|
+
},
|
|
72
|
+
atleast1Attribute: {
|
|
73
|
+
id: `${scope}.atleast1Attribute`,
|
|
74
|
+
defaultMessage: "At least 1 attribute is required"
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
export {
|
|
78
|
+
messages as default
|
|
79
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* Color Palette */
|
|
2
|
+
/* Fonts */
|
|
3
|
+
/* Backward Compatibility Aliases */
|
|
4
|
+
/* Component Heights */
|
|
5
|
+
/* Border Radius */
|
|
6
|
+
/* Border Width */
|
|
7
|
+
/* Transition */
|
|
8
|
+
/* Timezones Footer */
|
|
9
|
+
.changeSelectionCard {
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: 2.857rem;
|
|
12
|
+
left: 0.857rem;
|
|
13
|
+
width: 21.428rem;
|
|
14
|
+
}
|
|
15
|
+
.changeSelectionCard .card-title {
|
|
16
|
+
font-size: 1rem;
|
|
17
|
+
line-height: 1.714rem;
|
|
18
|
+
padding-bottom: 0.857rem;
|
|
19
|
+
padding-top: 0.571rem;
|
|
20
|
+
}
|
|
21
|
+
.changeSelectionCard .card-description {
|
|
22
|
+
font-size: 0.857rem;
|
|
23
|
+
}
|
|
24
|
+
.changeSelectionCard .card-buttons {
|
|
25
|
+
padding-top: 1.142rem;
|
|
26
|
+
}
|
|
27
|
+
.changeSelectionCard .card-buttons-primary {
|
|
28
|
+
margin-right: 0.857rem;
|
|
29
|
+
}
|
|
30
|
+
.ant-popover.cap-product-selection-v2.greyed .ant-popover-arrow {
|
|
31
|
+
border-top-color: #f4f5f7;
|
|
32
|
+
border-left-color: #f4f5f7;
|
|
33
|
+
}
|
|
34
|
+
.ant-popover.cap-product-selection-v2.greyed .ant-popover-container {
|
|
35
|
+
background-color: #f4f5f7;
|
|
36
|
+
}
|
|
37
|
+
.ant-popover.cap-product-selection-v2 .ant-popover-container {
|
|
38
|
+
padding: 0;
|
|
39
|
+
}
|
|
40
|
+
.ant-popover.cap-product-selection-v2 .ant-tree {
|
|
41
|
+
background-color: inherit;
|
|
42
|
+
}
|
|
43
|
+
.ant-popover.cap-product-selection-v2 .ant-tree .ant-tree-list {
|
|
44
|
+
padding: 0.5rem 0;
|
|
45
|
+
}
|
|
46
|
+
.ant-popover.cap-product-selection-v2 .ant-tree li ul {
|
|
47
|
+
padding-left: 2.143rem;
|
|
48
|
+
}
|
|
49
|
+
.ant-popover.cap-product-selection-v2 .ant-popover-content {
|
|
50
|
+
width: 23.143rem;
|
|
51
|
+
padding: 0;
|
|
52
|
+
min-height: 12.571rem;
|
|
53
|
+
font-size: 1rem;
|
|
54
|
+
line-height: 1.428rem;
|
|
55
|
+
color: #091e42;
|
|
56
|
+
}
|
|
57
|
+
.ant-popover.cap-product-selection-v2 .divider {
|
|
58
|
+
border-top: 0.071rem solid #dfe2e7;
|
|
59
|
+
}
|
|
60
|
+
.ant-popover.cap-product-selection-v2 .empty-data-text {
|
|
61
|
+
text-align: center;
|
|
62
|
+
margin-top: 0.857rem;
|
|
63
|
+
padding: 0.714rem 0;
|
|
64
|
+
}
|
|
65
|
+
.ant-popover.cap-product-selection-v2 .ant-popover-content {
|
|
66
|
+
padding: 0 0.285rem 0.857rem 0.285rem;
|
|
67
|
+
}
|
|
68
|
+
.ant-popover.cap-product-selection-v2 .ant-tree-child-tree > li:first-child {
|
|
69
|
+
margin-top: 0.285rem;
|
|
70
|
+
}
|
|
71
|
+
.ant-popover.cap-product-selection-v2 .ant-tree-treenode-switcher-open, .ant-popover.cap-product-selection-v2 .ant-tree-treenode-switcher-close {
|
|
72
|
+
position: relative;
|
|
73
|
+
}
|
|
74
|
+
.ant-popover.cap-product-selection-v2 .ant-tree-treenode-switcher-open .info-tooltip, .ant-popover.cap-product-selection-v2 .ant-tree-treenode-switcher-close .info-tooltip {
|
|
75
|
+
position: absolute;
|
|
76
|
+
right: 0.714rem;
|
|
77
|
+
top: 0.428rem;
|
|
78
|
+
}
|
|
79
|
+
.ant-popover.cap-product-selection-v2 .tree-node-title .cap-radio-v2 .ant-radio-wrapper .title {
|
|
80
|
+
font-weight: normal !important;
|
|
81
|
+
}
|
|
@@ -2,55 +2,97 @@
|
|
|
2
2
|
|
|
3
3
|
$popoverTree: cap-product-selection-v2;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
// Change-selection modal card (replaces StyledCapCard from style.ts)
|
|
6
|
+
.changeSelectionCard {
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: $CAP_SPACE_40;
|
|
9
|
+
left: $CAP_SPACE_12;
|
|
10
|
+
width: 21.428rem; // 300px
|
|
11
|
+
.card-title {
|
|
12
|
+
font-size: $FONT_SIZE_M;
|
|
13
|
+
line-height: $CAP_SPACE_24;
|
|
14
|
+
padding-bottom: $CAP_SPACE_12;
|
|
15
|
+
padding-top: $CAP_SPACE_08;
|
|
16
|
+
}
|
|
17
|
+
.card-description {
|
|
18
|
+
font-size: $FONT_SIZE_S;
|
|
14
19
|
}
|
|
15
|
-
.
|
|
16
|
-
padding-
|
|
20
|
+
.card-buttons {
|
|
21
|
+
padding-top: $CAP_SPACE_16;
|
|
17
22
|
}
|
|
18
|
-
.
|
|
19
|
-
|
|
23
|
+
.card-buttons-primary {
|
|
24
|
+
margin-right: $CAP_SPACE_12;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// OVERRIDE: CapProductSelection uses a single global class for the popover overlay (cap-product-selection-v2).
|
|
29
|
+
// Antd Popover does not expose tokens for content width, inner padding, or greyed state; layout is component-specific.
|
|
30
|
+
:global {
|
|
31
|
+
.ant-popover.#{$popoverTree} {
|
|
32
|
+
&.greyed {
|
|
33
|
+
.ant-popover-arrow {
|
|
34
|
+
border-top-color: $CAP_G09;
|
|
35
|
+
border-left-color: $CAP_G09;
|
|
36
|
+
}
|
|
37
|
+
.ant-popover-container {
|
|
38
|
+
background-color: $CAP_G09;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.ant-popover-container {
|
|
20
42
|
padding: 0;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
43
|
+
}
|
|
44
|
+
// OVERRIDE: Tree indentation not exposed as design token
|
|
45
|
+
.ant-tree {
|
|
46
|
+
background-color: inherit;
|
|
47
|
+
.ant-tree-list {
|
|
48
|
+
padding: 0.5rem 0; // 7px
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
.ant-tree li ul {
|
|
52
|
+
padding-left: 2.143rem; // 30px
|
|
53
|
+
}
|
|
54
|
+
// OVERRIDE: Content dimensions and typography are component-specific; no token for popover content width
|
|
55
|
+
.ant-popover-content {
|
|
56
|
+
width: 23.143rem; // 324px
|
|
57
|
+
padding: 0;
|
|
58
|
+
min-height: 12.571rem; // 176px
|
|
59
|
+
font-size: $FONT_SIZE_M;
|
|
60
|
+
line-height: $CAP_SPACE_20;
|
|
24
61
|
color: $CAP_G01;
|
|
25
|
-
|
|
62
|
+
}
|
|
26
63
|
|
|
27
|
-
|
|
28
|
-
border-top:
|
|
29
|
-
|
|
30
|
-
|
|
64
|
+
.divider {
|
|
65
|
+
border-top: $border-width-1 solid $CAP_G07;
|
|
66
|
+
}
|
|
67
|
+
.empty-data-text {
|
|
31
68
|
text-align: center;
|
|
32
|
-
margin-top:
|
|
33
|
-
padding:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
69
|
+
margin-top: $CAP_SPACE_12;
|
|
70
|
+
padding: 0.714rem 0; // 10px
|
|
71
|
+
}
|
|
72
|
+
// OVERRIDE: Inner content padding is layout-specific
|
|
73
|
+
.ant-popover-content {
|
|
74
|
+
padding: 0 $CAP_SPACE_04 $CAP_SPACE_12 $CAP_SPACE_04;
|
|
75
|
+
}
|
|
38
76
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
77
|
+
// OVERRIDE: Tree node spacing not tokenized
|
|
78
|
+
.ant-tree-child-tree > li:first-child {
|
|
79
|
+
margin-top: $CAP_SPACE_04;
|
|
80
|
+
}
|
|
42
81
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
82
|
+
// OVERRIDE: Info tooltip position in tree node is custom layout
|
|
83
|
+
.ant-tree-treenode-switcher-open, .ant-tree-treenode-switcher-close {
|
|
84
|
+
position: relative;
|
|
85
|
+
.info-tooltip {
|
|
86
|
+
position: absolute;
|
|
87
|
+
right: 0.714rem; // 10px
|
|
88
|
+
top: $CAP_SPACE_06;
|
|
89
|
+
}
|
|
49
90
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
91
|
+
// OVERRIDE: Radio title font-weight in tree context; no token for nested radio in tree
|
|
92
|
+
.tree-node-title {
|
|
93
|
+
.cap-radio-v2 .ant-radio-wrapper .title {
|
|
53
94
|
font-weight: normal !important;
|
|
95
|
+
}
|
|
54
96
|
}
|
|
55
97
|
}
|
|
56
|
-
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { CapProductSelectionProps } from '../types';
|
|
2
|
+
export declare const mockHandleSelect: jest.Mock<any, any, any>;
|
|
3
|
+
export declare const defaultLocale: {
|
|
4
|
+
lineItem: string;
|
|
5
|
+
selectAttribute: string;
|
|
6
|
+
brand: string;
|
|
7
|
+
brandInfo: string;
|
|
8
|
+
category: string;
|
|
9
|
+
categoryInfo: string;
|
|
10
|
+
product: string;
|
|
11
|
+
productInfo: string;
|
|
12
|
+
SKU: string;
|
|
13
|
+
uploadSKU: string;
|
|
14
|
+
uploadSKUInfo: string;
|
|
15
|
+
changeSelection: string;
|
|
16
|
+
description: string;
|
|
17
|
+
okText: string;
|
|
18
|
+
cancelText: string;
|
|
19
|
+
comingSoon: string;
|
|
20
|
+
selectValues: string;
|
|
21
|
+
atleast1Attribute: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const defaultProps: CapProductSelectionProps;
|
|
24
|
+
export declare const propsWithSelectedBrand: CapProductSelectionProps;
|
|
25
|
+
export declare const propsWithSelectedSKU: CapProductSelectionProps;
|
|
26
|
+
export declare const propsWithProductMandatory: CapProductSelectionProps;
|
|
27
|
+
export declare const customTreeData: {
|
|
28
|
+
key: string;
|
|
29
|
+
title: string;
|
|
30
|
+
children: {
|
|
31
|
+
key: string;
|
|
32
|
+
title: string;
|
|
33
|
+
}[];
|
|
34
|
+
}[];
|
|
35
|
+
export declare const TRIGGER_TEXT = "Open product selection";
|
|
36
|
+
//# sourceMappingURL=CapProductSelection.mockData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CapProductSelection.mockData.d.ts","sourceRoot":"","sources":["../../../components/CapProductSelection/tests/CapProductSelection.mockData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEzD,eAAO,MAAM,gBAAgB,0BAAY,CAAC;AAE1C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;CAoBzB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,wBAI1B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,wBAGpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,wBAGlC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,wBAIvC,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;GAM1B,CAAC;AAEF,eAAO,MAAM,YAAY,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Tree node item for custom treeData.
|
|
4
|
+
* Used when building tree structure for CapProductSelection.
|
|
5
|
+
*/
|
|
6
|
+
export interface TreeNodeItem {
|
|
7
|
+
title?: React.ReactNode;
|
|
8
|
+
key: string;
|
|
9
|
+
children?: TreeNodeItem[];
|
|
10
|
+
checkable?: boolean;
|
|
11
|
+
info?: string;
|
|
12
|
+
isHover?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface CapProductSelectionProps {
|
|
15
|
+
/** Trigger element (e.g. button or link) that opens the popover */
|
|
16
|
+
target?: React.ReactNode;
|
|
17
|
+
/** Custom tree data; when not provided, default Line Item / Attribute / SKU tree is used */
|
|
18
|
+
treeData?: TreeNodeItem[];
|
|
19
|
+
/** Popover trigger behavior */
|
|
20
|
+
trigger?: 'click' | 'hover';
|
|
21
|
+
/** Popover placement relative to target */
|
|
22
|
+
placement?: string;
|
|
23
|
+
/** Additional class name for the popover overlay */
|
|
24
|
+
overlayClassName?: string;
|
|
25
|
+
/** Called when popover closes with the current selection (array of attribute keys) */
|
|
26
|
+
handleSelect?: (selectedKeys: string[]) => void;
|
|
27
|
+
/** Controlled selected attribute keys (e.g. BRAND, CATEGORY, PRODUCT_ATTRIBUTE, SKU) */
|
|
28
|
+
selectedAttributes?: string[];
|
|
29
|
+
/** When true, at least one of Brand/Category/Product must be selected; disables unchecking the last one */
|
|
30
|
+
isProductMandatory?: boolean;
|
|
31
|
+
/** Additional props passed to CapPopover (e.g. getPopupContainer) */
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapProductSelection/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,mEAAmE;IACnE,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,+BAA+B;IAC/B,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC5B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sFAAsF;IACtF,YAAY,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAChD,wFAAwF;IACxF,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,2GAA2G;IAC3G,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,qEAAqE;IACrE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapRadioCard/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAQxC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAKvF,cAAM,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC;IAC3D,YAAY,GAAI,GAAG,uBAAuB,UAExC;IAEF,cAAc,GAAI,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapRadioCard/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAQxC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAKvF,cAAM,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC;IAC3D,YAAY,GAAI,GAAG,uBAAuB,UAExC;IAEF,cAAc,GAAI,MAAM,gBAAgB,6CAuGtC;IAEF,MAAM;CAmCP;AAED,eAAe,YAAY,CAAC"}
|
package/CapRadioCard/index.js
CHANGED
|
@@ -18,7 +18,22 @@ class CapRadioCard extends React.Component {
|
|
|
18
18
|
(_b = (_a = this.props).onChange) == null ? void 0 : _b.call(_a, e);
|
|
19
19
|
};
|
|
20
20
|
this.getRadioButton = (pane) => {
|
|
21
|
-
const {
|
|
21
|
+
const {
|
|
22
|
+
cardHeight,
|
|
23
|
+
cardWidth,
|
|
24
|
+
selected,
|
|
25
|
+
defaultValue,
|
|
26
|
+
size,
|
|
27
|
+
radioButtonWrapperClassName,
|
|
28
|
+
checkedIconClassName,
|
|
29
|
+
iconWrapperClassName,
|
|
30
|
+
iconContainerClassName,
|
|
31
|
+
divIconClassName,
|
|
32
|
+
contentContainerClassName,
|
|
33
|
+
headerClassName,
|
|
34
|
+
contentClassName,
|
|
35
|
+
infoIconWrapperClassName
|
|
36
|
+
} = this.props;
|
|
22
37
|
const {
|
|
23
38
|
content,
|
|
24
39
|
title,
|
|
@@ -46,34 +61,51 @@ class CapRadioCard extends React.Component {
|
|
|
46
61
|
disabled,
|
|
47
62
|
style: radioButtonStyle,
|
|
48
63
|
className: classNames(
|
|
49
|
-
styles["
|
|
64
|
+
styles["radio-button-wrapper"],
|
|
50
65
|
{
|
|
51
|
-
[styles["
|
|
52
|
-
[styles["
|
|
66
|
+
[styles["custom-disable-radio-button"]]: customDisableClass,
|
|
67
|
+
[styles["disabled-wrapper"]]: disabled
|
|
53
68
|
},
|
|
54
|
-
radioCardClassName
|
|
69
|
+
radioCardClassName,
|
|
70
|
+
radioButtonWrapperClassName
|
|
55
71
|
),
|
|
56
72
|
...restParams,
|
|
57
73
|
children: [
|
|
58
|
-
!customDisableClass && /* @__PURE__ */ jsx(
|
|
74
|
+
!customDisableClass && /* @__PURE__ */ jsx(
|
|
75
|
+
CapIcon,
|
|
76
|
+
{
|
|
77
|
+
type: "check-filled",
|
|
78
|
+
className: classNames(styles["radio-card-checked"], checkedIconClassName)
|
|
79
|
+
}
|
|
80
|
+
),
|
|
59
81
|
/* @__PURE__ */ jsxs(Card, { variant: "borderless", children: [
|
|
60
|
-
icon && /* @__PURE__ */ jsx("div", { className: styles["
|
|
82
|
+
icon && /* @__PURE__ */ jsx("div", { className: classNames(styles["radio-card-icon"], iconWrapperClassName), children: /* @__PURE__ */ jsx(
|
|
61
83
|
"div",
|
|
62
84
|
{
|
|
63
|
-
className: classNames(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
85
|
+
className: classNames(
|
|
86
|
+
styles["icon-container"],
|
|
87
|
+
{
|
|
88
|
+
[styles["green-color"]]: isChecked && !isSmall && !disabled
|
|
89
|
+
},
|
|
90
|
+
iconContainerClassName
|
|
91
|
+
),
|
|
92
|
+
children: /* @__PURE__ */ jsx("div", { className: classNames(styles["div-icon"], divIconClassName), children: icon })
|
|
67
93
|
}
|
|
68
94
|
) }),
|
|
69
|
-
/* @__PURE__ */ jsxs(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
95
|
+
/* @__PURE__ */ jsxs(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
className: classNames(
|
|
99
|
+
styles["radio-card-content-container"],
|
|
100
|
+
contentContainerClassName
|
|
101
|
+
),
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ jsx("div", { className: classNames(styles["radio-card-header"], headerClassName), children: /* @__PURE__ */ jsx(CapHeadingWithStatic, { type: "h4", className: classNames(titleClassName), children: title }) }),
|
|
104
|
+
/* @__PURE__ */ jsx("div", { className: classNames(styles["radio-card-content"], contentClassName), children: content })
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
infoIconDescription && /* @__PURE__ */ jsx("div", { className: classNames(styles["info-icon-wrapper"], infoIconWrapperClassName), children: /* @__PURE__ */ jsx(CapTooltipWithInfo, { title: infoIconDescription }) }),
|
|
77
109
|
customComponent
|
|
78
110
|
] })
|
|
79
111
|
]
|
|
@@ -98,7 +130,7 @@ class CapRadioCard extends React.Component {
|
|
|
98
130
|
...rest,
|
|
99
131
|
onChange: this.handleChange,
|
|
100
132
|
className: classNames(
|
|
101
|
-
styles["
|
|
133
|
+
styles["cap-radioCard-v2"],
|
|
102
134
|
{
|
|
103
135
|
[styles["smallRadioCard"]]: size === "small"
|
|
104
136
|
},
|