@bento-core/facet-filter 1.0.1-ccdihub.4 → 1.0.1-ccdihub.6

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.
@@ -9,6 +9,8 @@ var _styles = require("@material-ui/core/styles");
9
9
  var _core = require("@material-ui/core");
10
10
  var _clsx = _interopRequireDefault(require("clsx"));
11
11
  var _icons = require("@material-ui/icons");
12
+ var _emptycheckbox = _interopRequireDefault(require("./assets/emptycheckbox.svg"));
13
+ var _checkedbox = _interopRequireDefault(require("./assets/checkedbox.svg"));
12
14
  var _CheckboxStyle = _interopRequireDefault(require("./CheckboxStyle"));
13
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
16
  /* eslint-disable no-unused-vars */
@@ -71,19 +73,19 @@ const CheckBoxView = _ref => {
71
73
  })
72
74
  }, /*#__PURE__*/_react.default.createElement(_core.Checkbox, {
73
75
  id: "checkbox_".concat(facet.label, "_").concat(name),
74
- icon: /*#__PURE__*/_react.default.createElement(_icons.CheckBoxOutlineBlank, {
76
+ icon: /*#__PURE__*/_react.default.createElement(_core.Icon, {
75
77
  style: {
76
78
  fontSize: 18
77
79
  }
78
- }),
80
+ }, _emptycheckbox.default),
79
81
  onClick: handleToggle,
80
82
  checked: isChecked,
81
- checkedIcon: /*#__PURE__*/_react.default.createElement(_icons.CheckBox, {
83
+ checkedIcon: /*#__PURE__*/_react.default.createElement(_core.Icon, {
82
84
  style: {
83
85
  fontSize: 18
84
86
  },
85
87
  className: "".concat(checkedSection, "CheckedIcon")
86
- }),
88
+ }, _checkedbox.default),
87
89
  disableRipple: true,
88
90
  color: "secondary",
89
91
  classes: {
@@ -0,0 +1,4 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="14" height="14" fill="#6D5F5B"/>
3
+ <path d="M3 6.52174L4.95652 10L12 2" stroke="white" stroke-width="2"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="14" height="14" fill="#6D5F5B"/>
3
+ <rect width="14" height="14" fill="#6D5F5B"/>
4
+ <rect x="0.5" y="0.5" width="13" height="13" fill="white" stroke="#6D5F5B"/>
5
+ </svg>
@@ -32,7 +32,6 @@ const SliderView = _ref => {
32
32
  } = facet;
33
33
  const lowerBoundValue = facetValues[0];
34
34
  const upperBoundValue = facetValues[1];
35
- console.log(facet);
36
35
 
37
36
  // Determines whether the lower bound and upper bound values are valid
38
37
  const isValid = () => {
@@ -98,6 +97,7 @@ const SliderView = _ref => {
98
97
  min: minLowerBound,
99
98
  max: maxUpperBound,
100
99
  classes: {
100
+ colorPrimary: classes.colorPrimary,
101
101
  rail: classes.rail,
102
102
  thumb: isValid() ? classes.thumb : classes.invalidThumb,
103
103
  track: isValid() ? classes.track : classes.invalidTrack
@@ -113,13 +113,16 @@ const SliderView = _ref => {
113
113
  }, sliderValue[0], ' - ', sliderValue[1], "\xA0", quantifier));
114
114
  };
115
115
  const styles = () => ({
116
+ colorPrimary: props => props.facet.style && props.facet.style.colorPrimary ? props.facet.style.colorPrimary : {
117
+ color: '#3f51b5'
118
+ },
116
119
  sliderRoot: props => props.facet.style && props.facet.style.sliderRoot ? props.facet.style.sliderRoot : {
117
120
  marginTop: '10px',
118
121
  marginLeft: '20px',
119
122
  marginRight: 'Auto',
120
123
  paddingRight: '20px'
121
124
  },
122
- minValue: props => ({
125
+ minValue: props => props.facet.style && props.facet.style.minValue ? props.facet.style.minValue : {
123
126
  fontFamily: 'Nunito',
124
127
  fontSize: '15px',
125
128
  color: '#000000',
@@ -127,57 +130,57 @@ const styles = () => ({
127
130
  float: 'left',
128
131
  width: '75px',
129
132
  display: 'flex'
130
- }),
131
- maxValue: props => ({
133
+ },
134
+ maxValue: props => props.facet.style && props.facet.style.maxValue ? props.facet.style.maxValue : {
132
135
  fontFamily: 'Nunito',
133
136
  fontSize: '15px',
134
137
  color: '#000000',
135
138
  float: 'right',
136
139
  marginBottom: '0px',
137
140
  display: 'flex'
138
- }),
139
- rail: props => ({
141
+ },
142
+ rail: props => props.facet.style && props.facet.style.rail ? props.facet.style.rail : {
140
143
  borderRadius: 4,
141
144
  height: 6,
142
145
  background: '#142D64'
143
- }),
144
- minInputLabel: props => ({
146
+ },
147
+ minInputLabel: props => props.facet.style && props.facet.style.minInputLabel ? props.facet.style.minInputLabel : {
145
148
  float: 'left',
146
149
  lineHeight: '34px',
147
150
  marginRight: '5px'
148
- }),
149
- maxInputLabel: props => ({
151
+ },
152
+ maxInputLabel: props => props.facet.style && props.facet.style.maxInputLabel ? props.facet.style.maxInputLabel : {
150
153
  float: 'left',
151
154
  lineHeight: '34px',
152
155
  marginRight: '5px'
153
- }),
154
- thumb: props => ({
156
+ },
157
+ thumb: props => props.facet.style && props.facet.style.thumb ? props.facet.style.thumb : {
155
158
  height: 16,
156
159
  width: 16,
157
160
  background: '#10A075'
158
- }),
159
- invalidThumb: props => ({
161
+ },
162
+ invalidThumb: props => props.facet.style && props.facet.style.invalidThumb ? props.facet.style.invalidThumb : {
160
163
  height: 16,
161
164
  width: 16,
162
165
  background: '#F44336'
163
- }),
164
- track: props => ({
166
+ },
167
+ track: props => props.facet.style && props.facet.style.track ? props.facet.style.track : {
165
168
  borderRadius: 4,
166
169
  height: 6,
167
170
  background: '#10A075',
168
171
  '&~&': {
169
172
  background: '#142D64'
170
173
  }
171
- }),
172
- invalidTrack: props => ({
174
+ },
175
+ invalidTrack: props => props.facet.style && props.facet.style.invalidTrack ? props.facet.style.invalidTrack : {
173
176
  borderRadius: 4,
174
177
  height: 6,
175
178
  background: '#F44336',
176
179
  '&~&': {
177
180
  background: '#142D64'
178
181
  }
179
- }),
180
- upperBound: props => ({
182
+ },
183
+ upperBound: props => props.facet.style && props.facet.style.upperBound ? props.facet.style.upperBound : {
181
184
  fontFamily: 'Nunito',
182
185
  fontSize: '10px',
183
186
  color: '#000000',
@@ -185,8 +188,8 @@ const styles = () => ({
185
188
  marginLeft: 'Auto',
186
189
  marginRight: 'Auto',
187
190
  marginBottom: '15px'
188
- }),
189
- lowerBound: props => ({
191
+ },
192
+ lowerBound: props => props.facet.style && props.facet.style.lowerBound ? props.facet.style.lowerBound : {
190
193
  fontFamily: 'Nunito',
191
194
  fontSize: '10px',
192
195
  color: '#000000',
@@ -194,8 +197,8 @@ const styles = () => ({
194
197
  marginLeft: 'Auto',
195
198
  marginRight: 'Auto',
196
199
  marginBottom: '15px'
197
- }),
198
- sliderText: props => ({
200
+ },
201
+ sliderText: props => props.facet.style && props.facet.style.sliderText ? props.facet.style.sliderText : {
199
202
  color: '#10a075',
200
203
  lineHeight: '120%',
201
204
  fontFamily: 'Nunito',
@@ -205,8 +208,8 @@ const styles = () => ({
205
208
  textAlign: 'right',
206
209
  background: '#f5fdee',
207
210
  marginTop: '10px'
208
- }),
209
- invalidSliderText: props => ({
211
+ },
212
+ invalidSliderText: props => props.facet.style && props.facet.style.invalidSliderText ? props.facet.style.invalidSliderText : {
210
213
  color: '#D32F2F',
211
214
  lineHeight: '120%',
212
215
  fontFamily: 'Nunito',
@@ -216,18 +219,18 @@ const styles = () => ({
216
219
  textAlign: 'right',
217
220
  background: '#E57373',
218
221
  marginTop: '10px'
219
- }),
220
- sliderListItem: props => ({
222
+ },
223
+ sliderListItem: props => props.facet.style && props.facet.style.sliderListItem ? props.facet.style.sliderListItem : {
221
224
  height: '15px'
222
- }),
223
- listItemGutters: props => ({
225
+ },
226
+ listItemGutters: props => props.facet.style && props.facet.style.listItemGutters ? props.facet.style.listItemGutters : {
224
227
  display: 'flex',
225
228
  justifyContent: 'space-between',
226
229
  padding: '2px 5px 2px 8px'
227
- }),
228
- lowerUpperBound: props => ({
230
+ },
231
+ lowerUpperBound: props => props.facet.style && props.facet.style.lowerUpperBound ? props.facet.style.lowerUpperBound : {
229
232
  height: '15px'
230
- })
233
+ }
231
234
  });
232
235
  var _default = (0, _core.withStyles)(styles)(SliderView);
233
236
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/facet-filter",
3
- "version": "1.0.1-ccdihub.4",
3
+ "version": "1.0.1-ccdihub.6",
4
4
  "description": "### Bento core sidebar design:",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -15,11 +15,14 @@ import {
15
15
  Tooltip,
16
16
  Box,
17
17
  Typography,
18
+ Icon,
18
19
  } from '@material-ui/core';
19
20
  import clsx from 'clsx';
20
21
  import {
21
22
  CheckBox as CheckBoxIcon, CheckBoxOutlineBlank as CheckBoxBlankIcon,
22
23
  } from '@material-ui/icons';
24
+ import emptyCheckBox from './assets/emptycheckbox.svg';
25
+ import checkedBox from './assets/checkedbox.svg';
23
26
  import styles from './CheckboxStyle';
24
27
 
25
28
  const alignment = 'flex-start';
@@ -78,16 +81,18 @@ const CheckBoxView = ({
78
81
  >
79
82
  <Checkbox
80
83
  id={`checkbox_${facet.label}_${name}`}
81
- icon={<CheckBoxBlankIcon style={{ fontSize: 18 }} />}
84
+ icon={<Icon style={{ fontSize: 18 }}>{emptyCheckBox}</Icon>}
82
85
  onClick={handleToggle}
83
86
  checked={isChecked}
84
87
  checkedIcon={(
85
- <CheckBoxIcon
88
+ <Icon
86
89
  style={{
87
90
  fontSize: 18,
88
91
  }}
89
92
  className={`${checkedSection}CheckedIcon`}
90
- />
93
+ >
94
+ {checkedBox}
95
+ </Icon>
91
96
  )}
92
97
  disableRipple
93
98
  color="secondary"
@@ -0,0 +1,4 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="14" height="14" fill="#6D5F5B"/>
3
+ <path d="M3 6.52174L4.95652 10L12 2" stroke="white" stroke-width="2"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="14" height="14" fill="#6D5F5B"/>
3
+ <rect width="14" height="14" fill="#6D5F5B"/>
4
+ <rect x="0.5" y="0.5" width="13" height="13" fill="white" stroke="#6D5F5B"/>
5
+ </svg>
@@ -18,8 +18,6 @@ const SliderView = ({
18
18
  const lowerBoundValue = facetValues[0];
19
19
  const upperBoundValue = facetValues[1];
20
20
 
21
- console.log(facet);
22
-
23
21
  // Determines whether the lower bound and upper bound values are valid
24
22
  const isValid = () => {
25
23
  const checks = [
@@ -95,6 +93,7 @@ const SliderView = ({
95
93
  min={minLowerBound}
96
94
  max={maxUpperBound}
97
95
  classes={{
96
+ colorPrimary: classes.colorPrimary,
98
97
  rail: classes.rail,
99
98
  thumb: isValid() ? classes.thumb : classes.invalidThumb,
100
99
  track: isValid() ? classes.track : classes.invalidTrack,
@@ -130,6 +129,11 @@ const SliderView = ({
130
129
  };
131
130
 
132
131
  const styles = () => ({
132
+ colorPrimary: (props) => (props.facet.style && props.facet.style.colorPrimary
133
+ ? props.facet.style.colorPrimary
134
+ : {
135
+ color: '#3f51b5',
136
+ }),
133
137
  sliderRoot: (props) => (props.facet.style && props.facet.style.sliderRoot
134
138
  ? props.facet.style.sliderRoot
135
139
  : {
@@ -138,115 +142,147 @@ const styles = () => ({
138
142
  marginRight: 'Auto',
139
143
  paddingRight: '20px',
140
144
  }),
141
- minValue: (props) => ({
142
- fontFamily: 'Nunito',
143
- fontSize: '15px',
144
- color: '#000000',
145
- marginBottom: '0px',
146
- float: 'left',
147
- width: '75px',
148
- display: 'flex',
149
- }),
150
- maxValue: (props) => ({
151
- fontFamily: 'Nunito',
152
- fontSize: '15px',
153
- color: '#000000',
154
- float: 'right',
155
- marginBottom: '0px',
156
- display: 'flex',
157
- }),
158
- rail: (props) => ({
159
- borderRadius: 4,
160
- height: 6,
161
- background: '#142D64',
162
- }),
163
- minInputLabel: (props) => ({
164
- float: 'left',
165
- lineHeight: '34px',
166
- marginRight: '5px',
167
- }),
168
- maxInputLabel: (props) => ({
169
- float: 'left',
170
- lineHeight: '34px',
171
- marginRight: '5px',
172
- }),
173
- thumb: (props) => ({
174
- height: 16,
175
- width: 16,
176
- background: '#10A075',
177
- }),
178
- invalidThumb: (props) => ({
179
- height: 16,
180
- width: 16,
181
- background: '#F44336',
182
- }),
183
- track: (props) => ({
184
- borderRadius: 4,
185
- height: 6,
186
- background: '#10A075',
187
- '&~&': {
188
- background: '#142D64',
189
- },
190
- }),
191
- invalidTrack: (props) => ({
192
- borderRadius: 4,
193
- height: 6,
194
- background: '#F44336',
195
- '&~&': {
145
+ minValue: (props) => (props.facet.style && props.facet.style.minValue
146
+ ? props.facet.style.minValue
147
+ : {
148
+ fontFamily: 'Nunito',
149
+ fontSize: '15px',
150
+ color: '#000000',
151
+ marginBottom: '0px',
152
+ float: 'left',
153
+ width: '75px',
154
+ display: 'flex',
155
+ }),
156
+ maxValue: (props) => (props.facet.style && props.facet.style.maxValue
157
+ ? props.facet.style.maxValue
158
+ : {
159
+ fontFamily: 'Nunito',
160
+ fontSize: '15px',
161
+ color: '#000000',
162
+ float: 'right',
163
+ marginBottom: '0px',
164
+ display: 'flex',
165
+ }),
166
+ rail: (props) => (props.facet.style && props.facet.style.rail
167
+ ? props.facet.style.rail
168
+ : {
169
+ borderRadius: 4,
170
+ height: 6,
196
171
  background: '#142D64',
197
- },
198
- }),
199
- upperBound: (props) => ({
200
- fontFamily: 'Nunito',
201
- fontSize: '10px',
202
- color: '#000000',
203
- float: 'right',
204
- marginLeft: 'Auto',
205
- marginRight: 'Auto',
206
- marginBottom: '15px',
207
- }),
208
- lowerBound: (props) => ({
209
- fontFamily: 'Nunito',
210
- fontSize: '10px',
211
- color: '#000000',
212
- float: 'left',
213
- marginLeft: 'Auto',
214
- marginRight: 'Auto',
215
- marginBottom: '15px',
216
- }),
217
- sliderText: (props) => ({
218
- color: '#10a075',
219
- lineHeight: '120%',
220
- fontFamily: 'Nunito',
221
- fontSize: '14px',
222
- padding: '5px 15px 5px 0px',
223
- width: '100%',
224
- textAlign: 'right',
225
- background: '#f5fdee',
226
- marginTop: '10px',
227
- }),
228
- invalidSliderText: (props) => ({
229
- color: '#D32F2F',
230
- lineHeight: '120%',
231
- fontFamily: 'Nunito',
232
- fontSize: '14px',
233
- padding: '5px 15px 5px 0px',
234
- width: '100%',
235
- textAlign: 'right',
236
- background: '#E57373',
237
- marginTop: '10px',
238
- }),
239
- sliderListItem: (props) => ({
240
- height: '15px',
241
- }),
242
- listItemGutters: (props) => ({
243
- display: 'flex',
244
- justifyContent: 'space-between',
245
- padding: '2px 5px 2px 8px',
246
- }),
247
- lowerUpperBound: (props) => ({
248
- height: '15px',
249
- }),
172
+ }),
173
+ minInputLabel: (props) => (props.facet.style && props.facet.style.minInputLabel
174
+ ? props.facet.style.minInputLabel
175
+ : {
176
+ float: 'left',
177
+ lineHeight: '34px',
178
+ marginRight: '5px',
179
+ }),
180
+ maxInputLabel: (props) => (props.facet.style && props.facet.style.maxInputLabel
181
+ ? props.facet.style.maxInputLabel
182
+ : {
183
+ float: 'left',
184
+ lineHeight: '34px',
185
+ marginRight: '5px',
186
+ }),
187
+ thumb: (props) => (props.facet.style && props.facet.style.thumb
188
+ ? props.facet.style.thumb
189
+ : {
190
+ height: 16,
191
+ width: 16,
192
+ background: '#10A075',
193
+ }),
194
+ invalidThumb: (props) => (props.facet.style && props.facet.style.invalidThumb
195
+ ? props.facet.style.invalidThumb
196
+ : {
197
+ height: 16,
198
+ width: 16,
199
+ background: '#F44336',
200
+ }),
201
+ track: (props) => (props.facet.style && props.facet.style.track
202
+ ? props.facet.style.track
203
+ : {
204
+ borderRadius: 4,
205
+ height: 6,
206
+ background: '#10A075',
207
+ '&~&': {
208
+ background: '#142D64',
209
+ },
210
+ }),
211
+ invalidTrack: (props) => (props.facet.style && props.facet.style.invalidTrack
212
+ ? props.facet.style.invalidTrack
213
+ : {
214
+ borderRadius: 4,
215
+ height: 6,
216
+ background: '#F44336',
217
+ '&~&': {
218
+ background: '#142D64',
219
+ },
220
+ }),
221
+ upperBound: (props) => (props.facet.style && props.facet.style.upperBound
222
+ ? props.facet.style.upperBound
223
+ : {
224
+ fontFamily: 'Nunito',
225
+ fontSize: '10px',
226
+ color: '#000000',
227
+ float: 'right',
228
+ marginLeft: 'Auto',
229
+ marginRight: 'Auto',
230
+ marginBottom: '15px',
231
+ }),
232
+ lowerBound: (props) => (props.facet.style && props.facet.style.lowerBound
233
+ ? props.facet.style.lowerBound
234
+ : {
235
+ fontFamily: 'Nunito',
236
+ fontSize: '10px',
237
+ color: '#000000',
238
+ float: 'left',
239
+ marginLeft: 'Auto',
240
+ marginRight: 'Auto',
241
+ marginBottom: '15px',
242
+ }),
243
+ sliderText: (props) => (props.facet.style && props.facet.style.sliderText
244
+ ? props.facet.style.sliderText
245
+ : {
246
+ color: '#10a075',
247
+ lineHeight: '120%',
248
+ fontFamily: 'Nunito',
249
+ fontSize: '14px',
250
+ padding: '5px 15px 5px 0px',
251
+ width: '100%',
252
+ textAlign: 'right',
253
+ background: '#f5fdee',
254
+ marginTop: '10px',
255
+ }),
256
+ invalidSliderText: (props) => (props.facet.style && props.facet.style.invalidSliderText
257
+ ? props.facet.style.invalidSliderText
258
+ : {
259
+ color: '#D32F2F',
260
+ lineHeight: '120%',
261
+ fontFamily: 'Nunito',
262
+ fontSize: '14px',
263
+ padding: '5px 15px 5px 0px',
264
+ width: '100%',
265
+ textAlign: 'right',
266
+ background: '#E57373',
267
+ marginTop: '10px',
268
+ }),
269
+ sliderListItem: (props) => (props.facet.style && props.facet.style.sliderListItem
270
+ ? props.facet.style.sliderListItem
271
+ : {
272
+ height: '15px',
273
+ }),
274
+ listItemGutters: (props) => (props.facet.style && props.facet.style.listItemGutters
275
+ ? props.facet.style.listItemGutters
276
+ : {
277
+ display: 'flex',
278
+ justifyContent: 'space-between',
279
+ padding: '2px 5px 2px 8px',
280
+ }),
281
+ lowerUpperBound: (props) => (props.facet.style && props.facet.style.lowerUpperBound
282
+ ? props.facet.style.lowerUpperBound
283
+ : {
284
+ height: '15px',
285
+ }),
250
286
  });
251
287
 
252
288
  export default withStyles(styles)(SliderView);