@searchspring/snap-preact-components 0.74.0 → 0.75.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/cjs/components/Molecules/FacetListOptions/FacetListOptions.d.ts +1 -0
- package/dist/cjs/components/Molecules/FacetListOptions/FacetListOptions.d.ts.map +1 -1
- package/dist/cjs/components/Molecules/FacetListOptions/FacetListOptions.js +2 -5
- package/dist/cjs/components/Molecules/VariantSelection/VariantSelection.d.ts +1 -0
- package/dist/cjs/components/Molecules/VariantSelection/VariantSelection.d.ts.map +1 -1
- package/dist/cjs/components/Molecules/VariantSelection/VariantSelection.js +2 -5
- package/dist/esm/components/Molecules/FacetListOptions/FacetListOptions.d.ts +1 -0
- package/dist/esm/components/Molecules/FacetListOptions/FacetListOptions.d.ts.map +1 -1
- package/dist/esm/components/Molecules/FacetListOptions/FacetListOptions.js +2 -5
- package/dist/esm/components/Molecules/VariantSelection/VariantSelection.d.ts +1 -0
- package/dist/esm/components/Molecules/VariantSelection/VariantSelection.d.ts.map +1 -1
- package/dist/esm/components/Molecules/VariantSelection/VariantSelection.js +2 -5
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacetListOptions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/FacetListOptions/FacetListOptions.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAI5D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AA6B5E,eAAO,MAAM,gBAAgB,eAAyB,qBAAqB,KAAG,
|
|
1
|
+
{"version":3,"file":"FacetListOptions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/FacetListOptions/FacetListOptions.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAI5D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AA6B5E,eAAO,MAAM,gBAAgB,eAAyB,qBAAqB,KAAG,WA2E5E,CAAC;AAEH,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC5D,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,GAAG,CAAC;CACjB"}
|
|
@@ -58,7 +58,7 @@ exports.FacetListOptions = (0, mobx_react_1.observer)(function (properties) {
|
|
|
58
58
|
var globalTheme = (0, providers_1.useTheme)();
|
|
59
59
|
var theme = __assign(__assign({}, globalTheme), properties.theme);
|
|
60
60
|
var props = __assign(__assign(__assign({}, (_a = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _a === void 0 ? void 0 : _a.facetListOptions), properties), (_c = (_b = properties.theme) === null || _b === void 0 ? void 0 : _b.components) === null || _c === void 0 ? void 0 : _c.facetListOptions);
|
|
61
|
-
var values = props.values, hideCheckbox = props.hideCheckbox, hideCount = props.hideCount, onClick = props.onClick, previewOnFocus = props.previewOnFocus, valueProps = props.valueProps, facet = props.facet, disableStyles = props.disableStyles, className = props.className, style = props.style;
|
|
61
|
+
var values = props.values, hideCheckbox = props.hideCheckbox, hideCount = props.hideCount, hideCountParenthesis = props.hideCountParenthesis, onClick = props.onClick, previewOnFocus = props.previewOnFocus, valueProps = props.valueProps, facet = props.facet, disableStyles = props.disableStyles, className = props.className, style = props.style;
|
|
62
62
|
var subProps = {
|
|
63
63
|
checkbox: __assign(__assign(__assign({
|
|
64
64
|
// default props
|
|
@@ -91,9 +91,6 @@ exports.FacetListOptions = (0, mobx_react_1.observer)(function (properties) {
|
|
|
91
91
|
!hideCheckbox && (0, react_1.jsx)(Checkbox_1.Checkbox, __assign({}, subProps.checkbox, { checked: value.filtered, disableA11y: true })),
|
|
92
92
|
(0, react_1.jsx)("span", { className: "ss__facet-list-options__option__value" },
|
|
93
93
|
value.label,
|
|
94
|
-
!hideCount && (value === null || value === void 0 ? void 0 : value.count) > 0 && (0, react_1.jsx)("span", { className: "ss__facet-list-options__option__value__count" },
|
|
95
|
-
"(",
|
|
96
|
-
value.count,
|
|
97
|
-
")"))));
|
|
94
|
+
!hideCount && (value === null || value === void 0 ? void 0 : value.count) > 0 && ((0, react_1.jsx)("span", { className: "ss__facet-list-options__option__value__count" }, hideCountParenthesis ? "".concat(value.count) : "(".concat(value.count, ")"))))));
|
|
98
95
|
})))) : ((0, react_1.jsx)(preact_1.Fragment, null));
|
|
99
96
|
});
|
|
@@ -6,5 +6,6 @@ export interface VariantSelectionProps extends ComponentProps {
|
|
|
6
6
|
selection: VariantSelectionType;
|
|
7
7
|
type?: 'dropdown' | 'swatches' | 'list';
|
|
8
8
|
onSelect?: (e: React.MouseEvent<HTMLElement, MouseEvent>, option: ListOption) => void;
|
|
9
|
+
hideSelectedOptionParentheses: boolean;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=VariantSelection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariantSelection.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/VariantSelection/VariantSelection.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAc,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAqD9F,eAAO,MAAM,gBAAgB,eAAyB,qBAAqB,KAAG,
|
|
1
|
+
{"version":3,"file":"VariantSelection.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/VariantSelection/VariantSelection.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAc,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAqD9F,eAAO,MAAM,gBAAgB,eAAyB,qBAAqB,KAAG,WA2K5E,CAAC;AASH,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC5D,SAAS,EAAE,oBAAoB,CAAC;IAChC,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IACxC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACtF,6BAA6B,EAAE,OAAO,CAAC;CACvC"}
|
|
@@ -73,7 +73,7 @@ exports.VariantSelection = (0, mobx_react_1.observer)(function (properties) {
|
|
|
73
73
|
var props = __assign(__assign(__assign({
|
|
74
74
|
// default props
|
|
75
75
|
type: 'dropdown' }, (_a = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _a === void 0 ? void 0 : _a.variantSelection), properties), (_c = (_b = properties.theme) === null || _b === void 0 ? void 0 : _b.components) === null || _c === void 0 ? void 0 : _c.variantSelection);
|
|
76
|
-
var type = props.type, selection = props.selection, onSelect = props.onSelect, disableStyles = props.disableStyles, className = props.className, style = props.style;
|
|
76
|
+
var type = props.type, selection = props.selection, onSelect = props.onSelect, hideSelectedOptionParentheses = props.hideSelectedOptionParentheses, disableStyles = props.disableStyles, className = props.className, style = props.style;
|
|
77
77
|
var onSelectHandler = function (e, option) {
|
|
78
78
|
if (onSelect) {
|
|
79
79
|
onSelect(e, option);
|
|
@@ -122,10 +122,7 @@ exports.VariantSelection = (0, mobx_react_1.observer)(function (properties) {
|
|
|
122
122
|
return ((0, react_1.jsx)(preact_1.Fragment, null,
|
|
123
123
|
(0, react_1.jsx)("div", { className: "ss__dropdown__button-wrapper" },
|
|
124
124
|
(0, react_1.jsx)("span", { className: "ss__dropdown__button-wrapper__label" }, selection.label),
|
|
125
|
-
selection.selected ? ((0, react_1.jsx)("span", { className: "ss__dropdown__button-wrapper__selection" },
|
|
126
|
-
"(",
|
|
127
|
-
selection.selected.value,
|
|
128
|
-
")")) : ((0, react_1.jsx)(preact_1.Fragment, null))),
|
|
125
|
+
selection.selected ? ((0, react_1.jsx)("span", { className: "ss__dropdown__button-wrapper__selection" }, hideSelectedOptionParentheses ? "".concat(selection.selected.value) : "(".concat(selection.selected.value, ")"))) : ((0, react_1.jsx)(preact_1.Fragment, null))),
|
|
129
126
|
(0, react_1.jsx)(Icon_1.Icon, __assign({ icon: open ? 'angle-up' : 'angle-down' }, subProps.icon))));
|
|
130
127
|
};
|
|
131
128
|
return ((0, react_1.jsx)(Dropdown_1.Dropdown, __assign({ button: (0, react_1.jsx)(Button, null) }, subProps.dropdown),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacetListOptions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/FacetListOptions/FacetListOptions.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAI5D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AA6B5E,eAAO,MAAM,gBAAgB,eAAyB,qBAAqB,KAAG,
|
|
1
|
+
{"version":3,"file":"FacetListOptions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/FacetListOptions/FacetListOptions.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAI5D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AA6B5E,eAAO,MAAM,gBAAgB,eAAyB,qBAAqB,KAAG,WA2E5E,CAAC;AAEH,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC5D,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,GAAG,CAAC;CACjB"}
|
|
@@ -43,7 +43,7 @@ export const FacetListOptions = observer((properties) => {
|
|
|
43
43
|
...properties,
|
|
44
44
|
...properties.theme?.components?.facetListOptions,
|
|
45
45
|
};
|
|
46
|
-
const { values, hideCheckbox, hideCount, onClick, previewOnFocus, valueProps, facet, disableStyles, className, style } = props;
|
|
46
|
+
const { values, hideCheckbox, hideCount, hideCountParenthesis, onClick, previewOnFocus, valueProps, facet, disableStyles, className, style } = props;
|
|
47
47
|
const subProps = {
|
|
48
48
|
checkbox: {
|
|
49
49
|
// default props
|
|
@@ -78,8 +78,5 @@ export const FacetListOptions = observer((properties) => {
|
|
|
78
78
|
!hideCheckbox && jsx(Checkbox, { ...subProps.checkbox, checked: value.filtered, disableA11y: true }),
|
|
79
79
|
jsx("span", { className: "ss__facet-list-options__option__value" },
|
|
80
80
|
value.label,
|
|
81
|
-
!hideCount && value?.count > 0 && jsx("span", { className: "ss__facet-list-options__option__value__count" },
|
|
82
|
-
"(",
|
|
83
|
-
value.count,
|
|
84
|
-
")")))))))) : (jsx(Fragment, null));
|
|
81
|
+
!hideCount && value?.count > 0 && (jsx("span", { className: "ss__facet-list-options__option__value__count" }, hideCountParenthesis ? `${value.count}` : `(${value.count})`))))))))) : (jsx(Fragment, null));
|
|
85
82
|
});
|
|
@@ -6,5 +6,6 @@ export interface VariantSelectionProps extends ComponentProps {
|
|
|
6
6
|
selection: VariantSelectionType;
|
|
7
7
|
type?: 'dropdown' | 'swatches' | 'list';
|
|
8
8
|
onSelect?: (e: React.MouseEvent<HTMLElement, MouseEvent>, option: ListOption) => void;
|
|
9
|
+
hideSelectedOptionParentheses: boolean;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=VariantSelection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariantSelection.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/VariantSelection/VariantSelection.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAc,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAqD9F,eAAO,MAAM,gBAAgB,eAAyB,qBAAqB,KAAG,
|
|
1
|
+
{"version":3,"file":"VariantSelection.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/VariantSelection/VariantSelection.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAc,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAqD9F,eAAO,MAAM,gBAAgB,eAAyB,qBAAqB,KAAG,WA2K5E,CAAC;AASH,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC5D,SAAS,EAAE,oBAAoB,CAAC;IAChC,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IACxC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACtF,6BAA6B,EAAE,OAAO,CAAC;CACvC"}
|
|
@@ -59,7 +59,7 @@ export const VariantSelection = observer((properties) => {
|
|
|
59
59
|
...properties,
|
|
60
60
|
...properties.theme?.components?.variantSelection,
|
|
61
61
|
};
|
|
62
|
-
const { type, selection, onSelect, disableStyles, className, style } = props;
|
|
62
|
+
const { type, selection, onSelect, hideSelectedOptionParentheses, disableStyles, className, style } = props;
|
|
63
63
|
const onSelectHandler = (e, option) => {
|
|
64
64
|
if (onSelect) {
|
|
65
65
|
onSelect(e, option);
|
|
@@ -144,10 +144,7 @@ export const VariantSelection = observer((properties) => {
|
|
|
144
144
|
return (jsx(Fragment, null,
|
|
145
145
|
jsx("div", { className: "ss__dropdown__button-wrapper" },
|
|
146
146
|
jsx("span", { className: "ss__dropdown__button-wrapper__label" }, selection.label),
|
|
147
|
-
selection.selected ? (jsx("span", { className: "ss__dropdown__button-wrapper__selection" },
|
|
148
|
-
"(",
|
|
149
|
-
selection.selected.value,
|
|
150
|
-
")")) : (jsx(Fragment, null))),
|
|
147
|
+
selection.selected ? (jsx("span", { className: "ss__dropdown__button-wrapper__selection" }, hideSelectedOptionParentheses ? `${selection.selected.value}` : `(${selection.selected.value})`)) : (jsx(Fragment, null))),
|
|
151
148
|
jsx(Icon, { icon: open ? 'angle-up' : 'angle-down', ...subProps.icon })));
|
|
152
149
|
};
|
|
153
150
|
return (jsx(Dropdown, { button: jsx(Button, null), ...subProps.dropdown },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@searchspring/snap-preact-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.75.0",
|
|
4
4
|
"description": "Snap Preact Component Library",
|
|
5
5
|
"author": "Searchspring",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@cypress/react": "^8.0.0",
|
|
31
31
|
"@emotion/react": "11.9.0",
|
|
32
|
-
"@searchspring/snap-toolbox": "0.
|
|
32
|
+
"@searchspring/snap-toolbox": "0.75.0",
|
|
33
33
|
"classnames": "^2.3.2",
|
|
34
34
|
"cypress": "^13.7.1",
|
|
35
35
|
"cypress-wait-until": "^1.7.2",
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"@babel/preset-env": "^7.21.4",
|
|
53
53
|
"@babel/preset-react": "^7.18.6",
|
|
54
54
|
"@babel/runtime": "^7.21.0",
|
|
55
|
-
"@searchspring/snap-client": "0.
|
|
56
|
-
"@searchspring/snap-controller": "0.
|
|
57
|
-
"@searchspring/snap-event-manager": "0.
|
|
58
|
-
"@searchspring/snap-logger": "0.
|
|
59
|
-
"@searchspring/snap-profiler": "0.
|
|
60
|
-
"@searchspring/snap-store-mobx": "0.
|
|
61
|
-
"@searchspring/snap-tracker": "0.
|
|
62
|
-
"@searchspring/snap-url-manager": "0.
|
|
55
|
+
"@searchspring/snap-client": "0.75.0",
|
|
56
|
+
"@searchspring/snap-controller": "0.75.0",
|
|
57
|
+
"@searchspring/snap-event-manager": "0.75.0",
|
|
58
|
+
"@searchspring/snap-logger": "0.75.0",
|
|
59
|
+
"@searchspring/snap-profiler": "0.75.0",
|
|
60
|
+
"@searchspring/snap-store-mobx": "0.75.0",
|
|
61
|
+
"@searchspring/snap-tracker": "0.75.0",
|
|
62
|
+
"@searchspring/snap-url-manager": "0.75.0",
|
|
63
63
|
"@storybook/addon-actions": "6.4.22",
|
|
64
64
|
"@storybook/addon-controls": "6.4.22",
|
|
65
65
|
"@storybook/addon-docs": "6.4.22",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"webpack-merge": "^5.8.0"
|
|
85
85
|
},
|
|
86
86
|
"sideEffects": false,
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "262c02e06e2bc4637e8e4eb9e48990cc3a9d3c18"
|
|
88
88
|
}
|