@searchspring/snap-preact-components 0.55.0 → 0.56.1
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/Grid/Grid.d.ts +20 -0
- package/dist/cjs/components/Molecules/Grid/Grid.d.ts.map +1 -0
- package/dist/cjs/components/Molecules/Grid/Grid.js +210 -0
- package/dist/cjs/components/Molecules/Grid/index.d.ts +2 -0
- package/dist/cjs/components/Molecules/Grid/index.d.ts.map +1 -0
- package/dist/cjs/components/Molecules/Grid/index.js +17 -0
- package/dist/cjs/components/Molecules/List/List.d.ts +18 -0
- package/dist/cjs/components/Molecules/List/List.d.ts.map +1 -0
- package/dist/cjs/components/Molecules/List/List.js +158 -0
- package/dist/cjs/components/Molecules/List/index.d.ts +2 -0
- package/dist/cjs/components/Molecules/List/index.d.ts.map +1 -0
- package/dist/cjs/components/Molecules/List/index.js +17 -0
- package/dist/cjs/components/Molecules/Swatches/Swatches.d.ts +19 -0
- package/dist/cjs/components/Molecules/Swatches/Swatches.d.ts.map +1 -0
- package/dist/cjs/components/Molecules/Swatches/Swatches.js +168 -0
- package/dist/cjs/components/Molecules/Swatches/index.d.ts +2 -0
- package/dist/cjs/components/Molecules/Swatches/index.d.ts.map +1 -0
- package/dist/cjs/components/Molecules/Swatches/index.js +17 -0
- package/dist/cjs/components/Molecules/VariantSelection/VariantSelection.d.ts +9 -0
- package/dist/cjs/components/Molecules/VariantSelection/VariantSelection.d.ts.map +1 -0
- package/dist/cjs/components/Molecules/VariantSelection/VariantSelection.js +146 -0
- package/dist/cjs/components/Molecules/VariantSelection/index.d.ts +2 -0
- package/dist/cjs/components/Molecules/VariantSelection/index.d.ts.map +1 -0
- package/dist/cjs/components/Molecules/VariantSelection/index.js +17 -0
- package/dist/cjs/index.d.ts +5 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/types.d.ts +15 -0
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/cjs/utilities/snapify.d.ts.map +1 -1
- package/dist/cjs/utilities/snapify.js +3 -0
- package/dist/esm/components/Molecules/Grid/Grid.d.ts +20 -0
- package/dist/esm/components/Molecules/Grid/Grid.d.ts.map +1 -0
- package/dist/esm/components/Molecules/Grid/Grid.js +189 -0
- package/dist/esm/components/Molecules/Grid/index.d.ts +2 -0
- package/dist/esm/components/Molecules/Grid/index.d.ts.map +1 -0
- package/dist/esm/components/Molecules/Grid/index.js +1 -0
- package/dist/esm/components/Molecules/List/List.d.ts +18 -0
- package/dist/esm/components/Molecules/List/List.d.ts.map +1 -0
- package/dist/esm/components/Molecules/List/List.js +140 -0
- package/dist/esm/components/Molecules/List/index.d.ts +2 -0
- package/dist/esm/components/Molecules/List/index.d.ts.map +1 -0
- package/dist/esm/components/Molecules/List/index.js +1 -0
- package/dist/esm/components/Molecules/Swatches/Swatches.d.ts +19 -0
- package/dist/esm/components/Molecules/Swatches/Swatches.d.ts.map +1 -0
- package/dist/esm/components/Molecules/Swatches/Swatches.js +179 -0
- package/dist/esm/components/Molecules/Swatches/index.d.ts +2 -0
- package/dist/esm/components/Molecules/Swatches/index.d.ts.map +1 -0
- package/dist/esm/components/Molecules/Swatches/index.js +1 -0
- package/dist/esm/components/Molecules/VariantSelection/VariantSelection.d.ts +9 -0
- package/dist/esm/components/Molecules/VariantSelection/VariantSelection.d.ts.map +1 -0
- package/dist/esm/components/Molecules/VariantSelection/VariantSelection.js +167 -0
- package/dist/esm/components/Molecules/VariantSelection/index.d.ts +2 -0
- package/dist/esm/components/Molecules/VariantSelection/index.d.ts.map +1 -0
- package/dist/esm/components/Molecules/VariantSelection/index.js +1 -0
- package/dist/esm/index.d.ts +5 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/types.d.ts +15 -0
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/utilities/snapify.d.ts.map +1 -1
- package/dist/esm/utilities/snapify.js +3 -0
- package/package.json +12 -11
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Swatches = void 0;
|
|
18
|
+
/** @jsx jsx */
|
|
19
|
+
var preact_1 = require("preact");
|
|
20
|
+
var react_1 = require("@emotion/react");
|
|
21
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
22
|
+
var providers_1 = require("../../../providers");
|
|
23
|
+
var react_2 = require("react");
|
|
24
|
+
var hooks_1 = require("../../../hooks");
|
|
25
|
+
var Carousel_1 = require("../Carousel");
|
|
26
|
+
var utilities_1 = require("../../../utilities");
|
|
27
|
+
var Grid_1 = require("../Grid");
|
|
28
|
+
var Image_1 = require("../../Atoms/Image");
|
|
29
|
+
var deepmerge_1 = __importDefault(require("deepmerge"));
|
|
30
|
+
var snap_toolbox_1 = require("@searchspring/snap-toolbox");
|
|
31
|
+
var CSS = {
|
|
32
|
+
Swatches: function (_a) {
|
|
33
|
+
var _b, _c;
|
|
34
|
+
var theme = _a.theme;
|
|
35
|
+
return (0, react_1.css)({
|
|
36
|
+
marginTop: '10px',
|
|
37
|
+
'.ss__swatches__carousel__swatch': {
|
|
38
|
+
boxSizing: 'content-box',
|
|
39
|
+
cursor: 'pointer',
|
|
40
|
+
backgroundRepeat: 'no-repeat',
|
|
41
|
+
display: 'flex',
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
border: "1px solid ".concat(((_b = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _b === void 0 ? void 0 : _b.primary) || '#333'),
|
|
45
|
+
aspectRatio: '1/1',
|
|
46
|
+
margin: 'auto',
|
|
47
|
+
flexDirection: 'column',
|
|
48
|
+
'&.ss__swatches__carousel__swatch--selected': {
|
|
49
|
+
border: "2px solid ".concat(((_c = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _c === void 0 ? void 0 : _c.primary) || '#333'),
|
|
50
|
+
},
|
|
51
|
+
'&.ss__swatches__carousel__swatch--disabled:before, &.ss__swatches__carousel__swatch--unavailable:before': {
|
|
52
|
+
content: '""',
|
|
53
|
+
display: 'block',
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
top: '50%',
|
|
56
|
+
width: '90%',
|
|
57
|
+
height: '1px',
|
|
58
|
+
borderTop: '3px solid #eee',
|
|
59
|
+
outline: '1px solid #ffff',
|
|
60
|
+
transform: 'rotate(-45deg)',
|
|
61
|
+
},
|
|
62
|
+
'&.ss__swatches__carousel__swatch--disabled': {
|
|
63
|
+
position: 'relative',
|
|
64
|
+
cursor: 'none',
|
|
65
|
+
pointerEvents: 'none',
|
|
66
|
+
opacity: 0.5,
|
|
67
|
+
},
|
|
68
|
+
'&.ss__swatches__carousel__swatch--unavailable': {
|
|
69
|
+
cursor: 'pointer',
|
|
70
|
+
opacity: 0.5,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
function Swatches(properties) {
|
|
77
|
+
var _a, _b, _c, _d, _e, _f;
|
|
78
|
+
var globalTheme = (0, providers_1.useTheme)();
|
|
79
|
+
var theme = __assign(__assign({}, globalTheme), properties.theme);
|
|
80
|
+
var defaultCarouselBreakpoints = {
|
|
81
|
+
0: {
|
|
82
|
+
carousel: {
|
|
83
|
+
slidesPerView: 3,
|
|
84
|
+
slidesPerGroup: 3,
|
|
85
|
+
spaceBetween: 10,
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
768: {
|
|
89
|
+
carousel: {
|
|
90
|
+
slidesPerView: 4,
|
|
91
|
+
slidesPerGroup: 4,
|
|
92
|
+
spaceBetween: 10,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
1200: {
|
|
96
|
+
carousel: {
|
|
97
|
+
slidesPerView: 5,
|
|
98
|
+
slidesPerGroup: 5,
|
|
99
|
+
spaceBetween: 10,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
var props = __assign(__assign(__assign({
|
|
104
|
+
// default props
|
|
105
|
+
type: 'carousel', hideLabels: true }, (_a = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _a === void 0 ? void 0 : _a.swatches), properties), (_c = (_b = properties.theme) === null || _b === void 0 ? void 0 : _b.components) === null || _c === void 0 ? void 0 : _c.swatches);
|
|
106
|
+
var breakpoints = props.breakpoints || (props.type == 'carousel' ? defaultCarouselBreakpoints : {});
|
|
107
|
+
var displaySettings = (0, hooks_1.useDisplaySettings)(breakpoints);
|
|
108
|
+
if (displaySettings && Object.keys(displaySettings).length) {
|
|
109
|
+
var theme_1 = (0, deepmerge_1.default)((props === null || props === void 0 ? void 0 : props.theme) || {}, (displaySettings === null || displaySettings === void 0 ? void 0 : displaySettings.theme) || {}, { arrayMerge: function (destinationArray, sourceArray) { return sourceArray; } });
|
|
110
|
+
props = __assign(__assign(__assign({}, props), displaySettings), { theme: theme_1 });
|
|
111
|
+
}
|
|
112
|
+
var onSelect = props.onSelect, disabled = props.disabled, options = props.options, hideLabels = props.hideLabels, disableStyles = props.disableStyles, className = props.className, style = props.style, type = props.type, carousel = props.carousel, grid = props.grid;
|
|
113
|
+
var subProps = {
|
|
114
|
+
carousel: __assign(__assign(__assign(__assign({
|
|
115
|
+
// default props
|
|
116
|
+
className: 'ss__swatches__carousel', loop: false }, carousel), (_d = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _d === void 0 ? void 0 : _d.carousel), (0, utilities_1.defined)({
|
|
117
|
+
breakpoints: breakpoints,
|
|
118
|
+
disableStyles: disableStyles,
|
|
119
|
+
})), {
|
|
120
|
+
// component theme overrides
|
|
121
|
+
theme: props === null || props === void 0 ? void 0 : props.theme }),
|
|
122
|
+
grid: __assign(__assign(__assign(__assign({
|
|
123
|
+
// default props
|
|
124
|
+
className: 'ss__swatches__grid', hideLabels: hideLabels, overflowButtonInGrid: true, disableOverflowAction: true, rows: 1, columns: 6 }, grid), (_e = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _e === void 0 ? void 0 : _e.grid), (0, utilities_1.defined)({
|
|
125
|
+
disableStyles: disableStyles,
|
|
126
|
+
})), {
|
|
127
|
+
// component theme overrides
|
|
128
|
+
theme: props === null || props === void 0 ? void 0 : props.theme }),
|
|
129
|
+
image: __assign(__assign(__assign({
|
|
130
|
+
// default props
|
|
131
|
+
className: 'ss__swatches__image' }, (_f = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _f === void 0 ? void 0 : _f.image), (0, utilities_1.defined)({
|
|
132
|
+
disableStyles: disableStyles,
|
|
133
|
+
})), {
|
|
134
|
+
// component theme overrides
|
|
135
|
+
theme: props === null || props === void 0 ? void 0 : props.theme }),
|
|
136
|
+
};
|
|
137
|
+
var selected = props.selected;
|
|
138
|
+
var styling = {};
|
|
139
|
+
if (!disableStyles) {
|
|
140
|
+
styling.css = [CSS.Swatches({ theme: theme }), style];
|
|
141
|
+
}
|
|
142
|
+
else if (style) {
|
|
143
|
+
styling.css = [style];
|
|
144
|
+
}
|
|
145
|
+
// selection state
|
|
146
|
+
var _g = (0, react_2.useState)(selected || undefined), selection = _g[0], setSelection = _g[1];
|
|
147
|
+
var makeSelection = function (e, option) {
|
|
148
|
+
if (onSelect) {
|
|
149
|
+
onSelect(e, option);
|
|
150
|
+
}
|
|
151
|
+
setSelection(option);
|
|
152
|
+
};
|
|
153
|
+
return typeof options == 'object' && (options === null || options === void 0 ? void 0 : options.length) ? ((0, react_1.jsx)(providers_1.CacheProvider, null,
|
|
154
|
+
(0, react_1.jsx)("div", __assign({}, styling, { className: (0, classnames_1.default)('ss__swatches', className) }), type == 'carousel' ? ((0, react_1.jsx)(Carousel_1.Carousel, __assign({}, subProps.carousel), options.map(function (option) {
|
|
155
|
+
var label = option.label;
|
|
156
|
+
var selected = (selection === null || selection === void 0 ? void 0 : selection.value) == option.value;
|
|
157
|
+
return ((0, react_1.jsx)("div", { className: (0, classnames_1.default)("ss__swatches__carousel__swatch ss__swatches__carousel__swatch--".concat(snap_toolbox_1.filters.handleize(option.value.toString())), {
|
|
158
|
+
'ss__swatches__carousel__swatch--selected': selected,
|
|
159
|
+
'ss__swatches__carousel__swatch--disabled': option === null || option === void 0 ? void 0 : option.disabled,
|
|
160
|
+
'ss__swatches__carousel__swatch--unavailable': (option === null || option === void 0 ? void 0 : option.available) === false,
|
|
161
|
+
}), title: label, style: { background: option.background ? option.background : option.backgroundImageUrl ? "" : option.value }, onClick: function (e) { return !disabled && !(option === null || option === void 0 ? void 0 : option.disabled) && makeSelection(e, option); }, ref: function (e) { return (0, hooks_1.useA11y)(e); }, role: "option", "aria-selected": selected },
|
|
162
|
+
!option.background && option.backgroundImageUrl ? ((0, react_1.jsx)(Image_1.Image, __assign({}, subProps.image, { src: option.backgroundImageUrl, alt: option.label || option.value.toString() }))) : ((0, react_1.jsx)(preact_1.Fragment, null)),
|
|
163
|
+
!hideLabels && (0, react_1.jsx)("span", { className: "ss__swatches__carousel__swatch__value" }, label || option.value)));
|
|
164
|
+
}))) : ((0, react_1.jsx)(Grid_1.Grid, __assign({}, subProps.grid, { options: options, onSelect: function (e, option) {
|
|
165
|
+
!disabled && makeSelection(e, option);
|
|
166
|
+
}, selected: selected })))))) : ((0, react_1.jsx)(preact_1.Fragment, null));
|
|
167
|
+
}
|
|
168
|
+
exports.Swatches = Swatches;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Swatches/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Swatches"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentProps } from '../../../types';
|
|
3
|
+
import type { VariantSelection as VariantSelectionType } from '@searchspring/snap-store-mobx';
|
|
4
|
+
export declare const VariantSelection: (properties: VariantSelectionProps) => JSX.Element;
|
|
5
|
+
export interface VariantSelectionProps extends ComponentProps {
|
|
6
|
+
selection: VariantSelectionType;
|
|
7
|
+
type?: 'dropdown' | 'swatches' | 'list';
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=VariantSelection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VariantSelection.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/VariantSelection/VariantSelection.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAqD9F,eAAO,MAAM,gBAAgB,eAAyB,qBAAqB,KAAG,WAkK5E,CAAC;AASH,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC5D,SAAS,EAAE,oBAAoB,CAAC;IAChC,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;CACxC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.VariantSelection = void 0;
|
|
18
|
+
/** @jsx jsx */
|
|
19
|
+
var preact_1 = require("preact");
|
|
20
|
+
var mobx_react_1 = require("mobx-react");
|
|
21
|
+
var react_1 = require("@emotion/react");
|
|
22
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
23
|
+
var providers_1 = require("../../../providers");
|
|
24
|
+
var utilities_1 = require("../../../utilities");
|
|
25
|
+
var List_1 = require("../List");
|
|
26
|
+
var Swatches_1 = require("../Swatches");
|
|
27
|
+
var Dropdown_1 = require("../../Atoms/Dropdown");
|
|
28
|
+
var Icon_1 = require("../../Atoms/Icon");
|
|
29
|
+
var CSS = {
|
|
30
|
+
variantSelection: function () {
|
|
31
|
+
return (0, react_1.css)({
|
|
32
|
+
'.ss__variant-selection__dropdown': {
|
|
33
|
+
'.ss__dropdown__button': {
|
|
34
|
+
width: '100%',
|
|
35
|
+
display: 'flex',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'space-between',
|
|
38
|
+
'.ss__dropdown__button-wrapper': {
|
|
39
|
+
display: 'flex',
|
|
40
|
+
gap: '5px',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
'.ss__dropdown__content': {
|
|
44
|
+
minWidth: 'auto',
|
|
45
|
+
left: '0',
|
|
46
|
+
right: '0',
|
|
47
|
+
'.ss__variant-selection__option': {
|
|
48
|
+
cursor: 'pointer',
|
|
49
|
+
position: 'relative',
|
|
50
|
+
},
|
|
51
|
+
'.ss__variant-selection__option:hover': {
|
|
52
|
+
fontWeight: 'bold',
|
|
53
|
+
},
|
|
54
|
+
'.ss__variant-selection__option--selected': {
|
|
55
|
+
fontWeight: 'bold',
|
|
56
|
+
},
|
|
57
|
+
'.ss__variant-selection__option--disabled': {
|
|
58
|
+
pointerEvents: 'none',
|
|
59
|
+
cursor: 'initial',
|
|
60
|
+
},
|
|
61
|
+
'.ss__variant-selection__option--disabled, .ss__variant-selection__option--unavailable': {
|
|
62
|
+
textDecoration: 'line-through',
|
|
63
|
+
opacity: 0.5,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
exports.VariantSelection = (0, mobx_react_1.observer)(function (properties) {
|
|
71
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
72
|
+
var globalTheme = (0, providers_1.useTheme)();
|
|
73
|
+
var props = __assign(__assign(__assign({
|
|
74
|
+
// default props
|
|
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, disableStyles = props.disableStyles, className = props.className, style = props.style;
|
|
77
|
+
var subProps = {
|
|
78
|
+
dropdown: __assign(__assign(__assign({ name: "ss__variant-selection__dropdown--".concat(selection.field), className: 'ss__variant-selection__dropdown', label: selection.label || selection.field }, (_d = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _d === void 0 ? void 0 : _d.dropdown), (0, utilities_1.defined)({
|
|
79
|
+
disableStyles: disableStyles,
|
|
80
|
+
})), {
|
|
81
|
+
// component theme overrides
|
|
82
|
+
theme: props === null || props === void 0 ? void 0 : props.theme }),
|
|
83
|
+
icon: __assign(__assign(__assign({
|
|
84
|
+
// default props
|
|
85
|
+
name: "ss__variant-selection__icon--".concat(selection.field), className: 'ss__variant-selection__icon', size: '12px' }, (_e = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _e === void 0 ? void 0 : _e.icon), (0, utilities_1.defined)({
|
|
86
|
+
disableStyles: disableStyles,
|
|
87
|
+
})), {
|
|
88
|
+
// component theme overrides
|
|
89
|
+
theme: props === null || props === void 0 ? void 0 : props.theme }),
|
|
90
|
+
list: __assign(__assign(__assign({ name: "ss__variant-selection__list--".concat(selection.field), titleText: selection.field, className: 'ss__variant-selection__list', multiSelect: false, hideOptionCheckboxes: true, onSelect: function (e, option) { return selection.select(option.value); }, selected: selection.selected }, (_f = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _f === void 0 ? void 0 : _f.list), (0, utilities_1.defined)({
|
|
91
|
+
disableStyles: disableStyles,
|
|
92
|
+
})), {
|
|
93
|
+
// component theme overrides
|
|
94
|
+
theme: props === null || props === void 0 ? void 0 : props.theme }),
|
|
95
|
+
swatches: __assign(__assign(__assign({ name: "ss__variant-selection__swatches--".concat(selection.field), className: 'ss__variant-selection__swatches', onSelect: function (e, option) { return selection.select(option.value); }, selected: selection.selected }, (_g = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _g === void 0 ? void 0 : _g.swatches), (0, utilities_1.defined)({
|
|
96
|
+
disableStyles: disableStyles,
|
|
97
|
+
})), {
|
|
98
|
+
// component theme overrides
|
|
99
|
+
theme: props === null || props === void 0 ? void 0 : props.theme }),
|
|
100
|
+
};
|
|
101
|
+
var styling = {};
|
|
102
|
+
if (!disableStyles) {
|
|
103
|
+
styling.css = [CSS.variantSelection(), style];
|
|
104
|
+
}
|
|
105
|
+
else if (style) {
|
|
106
|
+
styling.css = [style];
|
|
107
|
+
}
|
|
108
|
+
return selection.values.length ? ((0, react_1.jsx)(providers_1.CacheProvider, null,
|
|
109
|
+
(0, react_1.jsx)("div", __assign({}, styling, { className: (0, classnames_1.default)('ss__variant-selection', "ss__variant-selection--".concat(type), "ss__variant-selection--".concat(selection.field), className) }), (function () {
|
|
110
|
+
switch (type) {
|
|
111
|
+
case 'dropdown':
|
|
112
|
+
return ((0, react_1.jsx)(preact_1.Fragment, null, (function () {
|
|
113
|
+
//todo prettify the button
|
|
114
|
+
var Button = function (props) {
|
|
115
|
+
var open = props.open;
|
|
116
|
+
return ((0, react_1.jsx)(preact_1.Fragment, null,
|
|
117
|
+
(0, react_1.jsx)("div", { className: "ss__dropdown__button-wrapper" },
|
|
118
|
+
(0, react_1.jsx)("span", { className: "ss__dropdown__button-wrapper__label" }, selection.label),
|
|
119
|
+
selection.selected ? ((0, react_1.jsx)("span", { className: "ss__dropdown__button-wrapper__selection" },
|
|
120
|
+
"(",
|
|
121
|
+
selection.selected.value,
|
|
122
|
+
")")) : ((0, react_1.jsx)(preact_1.Fragment, null))),
|
|
123
|
+
(0, react_1.jsx)(Icon_1.Icon, __assign({ icon: open ? 'angle-up' : 'angle-down' }, subProps.icon))));
|
|
124
|
+
};
|
|
125
|
+
return ((0, react_1.jsx)(Dropdown_1.Dropdown, __assign({ button: (0, react_1.jsx)(Button, null) }, subProps.dropdown),
|
|
126
|
+
(0, react_1.jsx)("div", { className: "ss__variant-selection__options" }, selection.values.map(function (val) {
|
|
127
|
+
var _a;
|
|
128
|
+
var selected = ((_a = selection.selected) === null || _a === void 0 ? void 0 : _a.value) == val.value;
|
|
129
|
+
return ((0, react_1.jsx)("div", { className: (0, classnames_1.default)("ss__variant-selection__option", {
|
|
130
|
+
'ss__variant-selection__option--selected': selected,
|
|
131
|
+
'ss__variant-selection__option--disabled': val.disabled,
|
|
132
|
+
'ss__variant-selection__option--unavailable': val.available === false,
|
|
133
|
+
}), onClick: function () { return !val.disabled && selection.select(val.value); } }, val.label));
|
|
134
|
+
}))));
|
|
135
|
+
})()));
|
|
136
|
+
case 'list':
|
|
137
|
+
return ((0, react_1.jsx)(preact_1.Fragment, null, (function () {
|
|
138
|
+
return (0, react_1.jsx)(List_1.List, __assign({}, subProps.list, { options: selection.values }));
|
|
139
|
+
})()));
|
|
140
|
+
case 'swatches':
|
|
141
|
+
return ((0, react_1.jsx)(preact_1.Fragment, null, (function () {
|
|
142
|
+
return (0, react_1.jsx)(Swatches_1.Swatches, __assign({}, subProps.swatches, { options: selection.values }));
|
|
143
|
+
})()));
|
|
144
|
+
}
|
|
145
|
+
})()))) : ((0, react_1.jsx)(preact_1.Fragment, null));
|
|
146
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/VariantSelection/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./VariantSelection"), exports);
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -23,13 +23,17 @@ export * from './components/Molecules/FacetGridOptions';
|
|
|
23
23
|
export * from './components/Molecules/FacetHierarchyOptions';
|
|
24
24
|
export * from './components/Molecules/FacetListOptions';
|
|
25
25
|
export * from './components/Molecules/FacetPaletteOptions';
|
|
26
|
+
export * from './components/Molecules/FacetSlider';
|
|
26
27
|
export * from './components/Molecules/Filter';
|
|
28
|
+
export * from './components/Molecules/Grid';
|
|
29
|
+
export * from './components/Molecules/List';
|
|
27
30
|
export * from './components/Molecules/OverlayBadge';
|
|
28
31
|
export * from './components/Molecules/Pagination';
|
|
29
32
|
export * from './components/Molecules/Result';
|
|
30
33
|
export * from './components/Molecules/Select';
|
|
31
34
|
export * from './components/Molecules/Slideout';
|
|
32
|
-
export * from './components/Molecules/
|
|
35
|
+
export * from './components/Molecules/Swatches';
|
|
36
|
+
export * from './components/Molecules/VariantSelection';
|
|
33
37
|
export * from './components/Organisms/Autocomplete';
|
|
34
38
|
export * from './components/Organisms/BranchOverride';
|
|
35
39
|
export * from './components/Organisms/Facet';
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AAGpE,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AAGpE,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AAGxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gCAAgC,CAAC;AAG/C,cAAc,SAAS,CAAC;AAGxB,cAAc,aAAa,CAAC;AAG5B,cAAc,WAAW,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -41,13 +41,17 @@ __exportStar(require("./components/Molecules/FacetGridOptions"), exports);
|
|
|
41
41
|
__exportStar(require("./components/Molecules/FacetHierarchyOptions"), exports);
|
|
42
42
|
__exportStar(require("./components/Molecules/FacetListOptions"), exports);
|
|
43
43
|
__exportStar(require("./components/Molecules/FacetPaletteOptions"), exports);
|
|
44
|
+
__exportStar(require("./components/Molecules/FacetSlider"), exports);
|
|
44
45
|
__exportStar(require("./components/Molecules/Filter"), exports);
|
|
46
|
+
__exportStar(require("./components/Molecules/Grid"), exports);
|
|
47
|
+
__exportStar(require("./components/Molecules/List"), exports);
|
|
45
48
|
__exportStar(require("./components/Molecules/OverlayBadge"), exports);
|
|
46
49
|
__exportStar(require("./components/Molecules/Pagination"), exports);
|
|
47
50
|
__exportStar(require("./components/Molecules/Result"), exports);
|
|
48
51
|
__exportStar(require("./components/Molecules/Select"), exports);
|
|
49
52
|
__exportStar(require("./components/Molecules/Slideout"), exports);
|
|
50
|
-
__exportStar(require("./components/Molecules/
|
|
53
|
+
__exportStar(require("./components/Molecules/Swatches"), exports);
|
|
54
|
+
__exportStar(require("./components/Molecules/VariantSelection"), exports);
|
|
51
55
|
// ORGANISMS
|
|
52
56
|
__exportStar(require("./components/Organisms/Autocomplete"), exports);
|
|
53
57
|
__exportStar(require("./components/Organisms/BranchOverride"), exports);
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -2,12 +2,27 @@
|
|
|
2
2
|
import { FunctionalComponent, RenderableProps } from 'preact';
|
|
3
3
|
import { SerializedStyles } from '@emotion/react';
|
|
4
4
|
import { Theme } from './providers/theme';
|
|
5
|
+
import { IconProps } from './components/Atoms/Icon';
|
|
6
|
+
import type { UrlManager } from '@searchspring/snap-url-manager';
|
|
5
7
|
export interface ComponentProps extends RenderableProps<any> {
|
|
6
8
|
className?: string;
|
|
7
9
|
disableStyles?: boolean;
|
|
8
10
|
style?: string | Record<string, any>;
|
|
9
11
|
theme?: Theme;
|
|
10
12
|
}
|
|
13
|
+
export type ListOption = {
|
|
14
|
+
value: string | number;
|
|
15
|
+
label?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
available?: boolean;
|
|
18
|
+
default?: boolean;
|
|
19
|
+
icon?: string | Partial<IconProps>;
|
|
20
|
+
url?: UrlManager;
|
|
21
|
+
};
|
|
22
|
+
export type SwatchOption = ListOption & {
|
|
23
|
+
backgroundImageUrl?: string;
|
|
24
|
+
background?: string;
|
|
25
|
+
};
|
|
11
26
|
export type ComponentMap = {
|
|
12
27
|
[key: string]: (args?: any) => FunctionalComponent<RenderableProps<any>> | Promise<(args?: any) => React.ReactElement>;
|
|
13
28
|
};
|
package/dist/cjs/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,MAAM,WAAW,cAAe,SAAQ,eAAe,CAAC,GAAG,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,KAAK,CAAC;CACd;AAED,MAAM,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACnC,GAAG,CAAC,EAAE,UAAU,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,mBAAmB,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,KAAK,CAAC,YAAY,CAAC,CAAC;CACvH,CAAC;AAEF,oBAAY,MAAM;IACjB,IAAI,SAAS;IACb,IAAI,SAAS;CACb;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;AAGnD,oBAAY,SAAS;IACpB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,aAAa,kBAAkB;CAC/B;AAGD,oBAAY,YAAY;IACvB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,SAAS,cAAc;CACvB;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapify.d.ts","sourceRoot":"","sources":["../../../src/utilities/snapify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"snapify.d.ts","sourceRoot":"","sources":["../../../src/utilities/snapify.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAUnH,OAAO,KAAK,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAqB1I,qBAAa,OAAO;IACnB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,8BAA8B,GAAG,wBAAwB;IAkBvF,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,4BAA4B,GAAG,sBAAsB;IAmBjF,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,GAAG,gBAAgB;CAkB/D"}
|
|
@@ -37,6 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Snapify = void 0;
|
|
40
|
+
var mobx_1 = require("mobx");
|
|
40
41
|
var snap_controller_1 = require("@searchspring/snap-controller");
|
|
41
42
|
var snap_client_1 = require("@searchspring/snap-client");
|
|
42
43
|
var snap_store_mobx_1 = require("@searchspring/snap-store-mobx");
|
|
@@ -45,6 +46,8 @@ var snap_event_manager_1 = require("@searchspring/snap-event-manager");
|
|
|
45
46
|
var snap_profiler_1 = require("@searchspring/snap-profiler");
|
|
46
47
|
var snap_logger_1 = require("@searchspring/snap-logger");
|
|
47
48
|
var snap_tracker_1 = require("@searchspring/snap-tracker");
|
|
49
|
+
// configure MobX
|
|
50
|
+
(0, mobx_1.configure)({ useProxies: 'never', isolateGlobalState: true, enforceActions: 'never' });
|
|
48
51
|
var controllers = {};
|
|
49
52
|
var client = {
|
|
50
53
|
globals: { siteId: '8uyt2m' },
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentProps, ListOption, SwatchOption } from '../../../types';
|
|
3
|
+
export declare function Grid(properties: GridProps): JSX.Element;
|
|
4
|
+
export interface GridProps extends ComponentProps {
|
|
5
|
+
options: SwatchOption[];
|
|
6
|
+
hideLabels?: boolean;
|
|
7
|
+
multiSelect?: boolean;
|
|
8
|
+
onSelect?: (e: React.MouseEvent<HTMLElement>, option: ListOption, selected: ListOption[]) => void;
|
|
9
|
+
titleText?: string;
|
|
10
|
+
hideShowLess?: boolean;
|
|
11
|
+
selected?: ListOption | ListOption[];
|
|
12
|
+
columns?: number;
|
|
13
|
+
rows?: number;
|
|
14
|
+
gapSize?: string;
|
|
15
|
+
disableOverflowAction?: boolean;
|
|
16
|
+
overflowButton?: JSX.Element;
|
|
17
|
+
overflowButtonInGrid?: boolean;
|
|
18
|
+
onOverflowButtonClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>, status: boolean, remainder: number) => void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=Grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Grid/Grid.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAc,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAyGtF,wBAAgB,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAuKvD;AAED,MAAM,WAAW,SAAU,SAAQ,cAAc;IAChD,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAClG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACnH"}
|