@constructor-io/constructorio-ui-quizzes 1.3.1 → 1.3.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.
@@ -5,7 +5,7 @@ const react_1 = tslib_1.__importDefault(require("react"));
5
5
  function BackButton(props) {
6
6
  // eslint-disable-next-line
7
7
  const { disabled } = props;
8
- return (react_1.default.createElement("button", Object.assign({ type: 'button', className: `cio-question-back-button ${disabled ? 'disabled' : ''}` }, props),
8
+ return (react_1.default.createElement("button", Object.assign({ title: 'Quiz Back Button', type: 'button', className: `cio-question-back-button ${disabled ? 'disabled' : ''}` }, props),
9
9
  react_1.default.createElement("svg", { width: '8', height: '12', viewBox: '0 0 8 12', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
10
10
  react_1.default.createElement("path", { d: 'M6.06313 1.06268L0.964522 5.43176C0.882383 5.50218 0.816449 5.58954 0.771245 5.68785C0.726041 5.78615 0.702637 5.89306 0.702637 6.00126C0.702637 6.10946 0.726041 6.21637 0.771245 6.31467C0.816449 6.41297 0.882383 6.50033 0.964522 6.57076L6.06313 10.9398C6.5498 11.3568 7.30153 11.0111 7.30153 10.3703V1.63093C7.30153 0.990168 6.5498 0.644468 6.06313 1.06268Z', fill: 'currentColor' }))));
11
11
  }
@@ -35,13 +35,15 @@ function ResultCard(props) {
35
35
  salePrice),
36
36
  regularPrice && (react_1.default.createElement("span", { className: `cio-result-card-regular-price${salePrice ? '--strike-through' : ''}` },
37
37
  "$",
38
- regularPrice)))),
39
- react_1.default.createElement(ResultCtaButton_1.default, { item: result, price: salePrice || regularPrice })));
38
+ regularPrice))))));
40
39
  };
40
+ const resultCardContentWithoutLink = () => (react_1.default.createElement("div", { className: 'cio-result-card-container', onClick: () => clickHandler(), onKeyDown: (e) => keyDownHandler(e), role: 'button', tabIndex: 0 }, resultCardContent()));
41
41
  const resultCardContentWithLink = () => {
42
42
  var _a;
43
- return (react_1.default.createElement("a", { className: 'cio-result-card-anchor', href: (_a = result.data) === null || _a === void 0 ? void 0 : _a.url }, resultCardContent()));
43
+ return (react_1.default.createElement("a", { className: 'cio-result-card-anchor', href: (_a = result.data) === null || _a === void 0 ? void 0 : _a.url, onClick: () => clickHandler(), onKeyDown: (e) => keyDownHandler(e) }, resultCardContent()));
44
44
  };
45
- return (react_1.default.createElement("div", { onClick: () => clickHandler(), onKeyDown: (e) => keyDownHandler(e), className: 'cio-result-card', role: 'button', tabIndex: 0 }, !customClickItemCallback ? resultCardContentWithLink() : resultCardContent()));
45
+ return (react_1.default.createElement("div", { className: 'cio-result-card' },
46
+ !customClickItemCallback ? resultCardContentWithLink() : resultCardContentWithoutLink(),
47
+ react_1.default.createElement(ResultCtaButton_1.default, { item: result, price: salePrice || regularPrice })));
46
48
  }
47
49
  exports.default = ResultCard;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  function BackButton(props) {
3
3
  // eslint-disable-next-line
4
4
  const { disabled } = props;
5
- return (React.createElement("button", { type: 'button', className: `cio-question-back-button ${disabled ? 'disabled' : ''}`, ...props },
5
+ return (React.createElement("button", { title: 'Quiz Back Button', type: 'button', className: `cio-question-back-button ${disabled ? 'disabled' : ''}`, ...props },
6
6
  React.createElement("svg", { width: '8', height: '12', viewBox: '0 0 8 12', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
7
7
  React.createElement("path", { d: 'M6.06313 1.06268L0.964522 5.43176C0.882383 5.50218 0.816449 5.58954 0.771245 5.68785C0.726041 5.78615 0.702637 5.89306 0.702637 6.00126C0.702637 6.10946 0.726041 6.21637 0.771245 6.31467C0.816449 6.41297 0.882383 6.50033 0.964522 6.57076L6.06313 10.9398C6.5498 11.3568 7.30153 11.0111 7.30153 10.3703V1.63093C7.30153 0.990168 6.5498 0.644468 6.06313 1.06268Z', fill: 'currentColor' }))));
8
8
  }
@@ -29,8 +29,10 @@ export default function ResultCard(props) {
29
29
  salePrice),
30
30
  regularPrice && (React.createElement("span", { className: `cio-result-card-regular-price${salePrice ? '--strike-through' : ''}` },
31
31
  "$",
32
- regularPrice)))),
32
+ regularPrice))))));
33
+ const resultCardContentWithoutLink = () => (React.createElement("div", { className: 'cio-result-card-container', onClick: () => clickHandler(), onKeyDown: (e) => keyDownHandler(e), role: 'button', tabIndex: 0 }, resultCardContent()));
34
+ const resultCardContentWithLink = () => (React.createElement("a", { className: 'cio-result-card-anchor', href: result.data?.url, onClick: () => clickHandler(), onKeyDown: (e) => keyDownHandler(e) }, resultCardContent()));
35
+ return (React.createElement("div", { className: 'cio-result-card' },
36
+ !customClickItemCallback ? resultCardContentWithLink() : resultCardContentWithoutLink(),
33
37
  React.createElement(ResultCtaButton, { item: result, price: salePrice || regularPrice })));
34
- const resultCardContentWithLink = () => (React.createElement("a", { className: 'cio-result-card-anchor', href: result.data?.url }, resultCardContent()));
35
- return (React.createElement("div", { onClick: () => clickHandler(), onKeyDown: (e) => keyDownHandler(e), className: 'cio-result-card', role: 'button', tabIndex: 0 }, !customClickItemCallback ? resultCardContentWithLink() : resultCardContent()));
36
38
  }
package/lib/styles.css CHANGED
@@ -113,17 +113,18 @@
113
113
  width: 100%;
114
114
  padding: 0.5rem;
115
115
  border: 0;
116
- border-bottom: 1px solid var(--blue-denim-100);
116
+ border-bottom: 1px solid var(--gray-dust-100);
117
117
  color: var(--blue-denim-500);
118
118
  padding: 0.8rem;
119
119
  outline: none;
120
120
  font-size: 1rem;
121
121
  }
122
- .cio-question-input-text:focus {
122
+ .cio-question-input-text:focus,
123
+ .cio-question-input-text:active {
123
124
  border-bottom: 1px solid var(--blue-denim-500);
124
125
  }
125
126
  .cio-question-input-text::placeholder {
126
- color: var(--blue-denim-100);
127
+ color: var(--gray-dust-100);
127
128
  }
128
129
 
129
130
  /* CTA Button Component */
@@ -164,10 +165,15 @@
164
165
  background: var(--blue-denim-700);
165
166
  border: 2px solid var(--blue-denim-800);
166
167
  }
168
+ .cio-question-cta-button:focus {
169
+ outline: 3px solid var(--blue-denim-100);
170
+ }
167
171
  .cio-question-cta-button:disabled,
168
172
  .cio-question-cta-button.disabled {
169
- background: var(--blue-denim-200);
170
- border: 2px solid var(--blue-denim-100);
173
+ background: var(--gray-dust-200);
174
+ border: 2px solid var(--gray-dust-200);
175
+ cursor: auto;
176
+ outline: none;
171
177
  }
172
178
 
173
179
  /* Back Button Component */
@@ -187,6 +193,9 @@
187
193
  .cio-question-back-button:active {
188
194
  border: 2px solid var(--blue-denim-700);
189
195
  }
196
+ .cio-question-back-button:focus {
197
+ outline: 3px solid var(--blue-denim-100);
198
+ }
190
199
  .cio-question-back-button svg {
191
200
  display: inline;
192
201
  }
@@ -379,7 +388,8 @@
379
388
  display: flex;
380
389
  flex-direction: column;
381
390
  }
382
- .cio-result-card-anchor {
391
+ .cio-result-card-anchor,
392
+ .cio-result-card-container {
383
393
  text-decoration: none;
384
394
  background-color: transparent;
385
395
  color: inherit;
@@ -404,6 +414,7 @@
404
414
  display: flex;
405
415
  flex-direction: column;
406
416
  justify-content: space-between;
417
+ text-decoration: none;
407
418
  }
408
419
  .cio-result-card-title {
409
420
  color: var(--gray-dust-500);
@@ -445,6 +456,9 @@
445
456
  background: var(--blue-denim-700);
446
457
  border: 2px solid var(--blue-denim-800);
447
458
  }
459
+ .cio-result-card-cta-button:focus {
460
+ outline: 3px solid var(--blue-denim-100);
461
+ }
448
462
  .cio-result-card-cta-button:disabled,
449
463
  .cio-result-card-cta-button.disabled {
450
464
  background: var(--blue-denim-200);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-ui-quizzes",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Constructor.io Quizzes UI library for web applications",
5
5
  "author": "constructor.io",
6
6
  "license": "MIT",