@micromag/screen-survey 0.3.115 → 0.3.120

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.
@@ -1 +1 @@
1
- .micromag-screen-survey-container{position:relative;width:100%;height:100%;overflow:hidden}.micromag-screen-survey-disabled.micromag-screen-survey-container{overflow:hidden;pointer-events:none}.micromag-screen-survey-hidden.micromag-screen-survey-container{display:none;visibility:hidden}.micromag-screen-survey-placeholder.micromag-screen-survey-container .micromag-screen-survey-content{position:relative;padding:6px}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer,.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{margin:5px auto;border:2px dashed #343434;color:#343434}.micromag-screen-survey-container .micromag-screen-survey-question{margin-bottom:20px}.micromag-screen-survey-container .micromag-screen-survey-answers,.micromag-screen-survey-container .micromag-screen-survey-items{position:relative}.micromag-screen-survey-container .micromag-screen-survey-item{padding:5px 0}.micromag-screen-survey-container .micromag-screen-survey-item:first-child .micromag-screen-survey-placeholderAnswer{width:80%}.micromag-screen-survey-container .micromag-screen-survey-item:last-child .micromag-screen-survey-placeholderAnswer{width:90%}.micromag-screen-survey-container .micromag-screen-survey-itemContent{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.micromag-screen-survey-container .micromag-screen-survey-resultBar{position:absolute;top:0;left:0;height:100%;background-color:hsla(0,0%,100%,.2)}.micromag-screen-survey-container .micromag-screen-survey-resultLabel{position:absolute;top:50%;right:0;width:4em;padding:0 8px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);color:#fff;text-align:right}.micromag-screen-survey-container .micromag-screen-survey-itemInner{width:100%}.micromag-screen-survey-container .micromag-screen-survey-button{display:-webkit-flex;display:-ms-flexbox;display:flex;position:relative;width:100%;padding:0;-webkit-transition:opacity .5s ease-out;-o-transition:opacity .5s ease-out;transition:opacity .5s ease-out}.micromag-screen-survey-container .micromag-screen-survey-button:disabled{opacity:1;pointer-events:none}.micromag-screen-survey-container .micromag-screen-survey-itemLabel{width:100%;padding:10px}.micromag-screen-survey-container .micromag-screen-survey-itemLabel,.micromag-screen-survey-container .micromag-screen-survey-itemText{display:inline-block;-webkit-transition:margin-left .3s ease-out,-webkit-transform .3s ease-out;transition:margin-left .3s ease-out,-webkit-transform .3s ease-out;-o-transition:margin-left .3s ease-out,transform .3s ease-out;transition:margin-left .3s ease-out,transform .3s ease-out;transition:margin-left .3s ease-out,transform .3s ease-out,-webkit-transform .3s ease-out}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer,.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{width:100%;margin:0 auto}.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{height:75px}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer{height:50px}.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-button,.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-result,.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-resultLabel{opacity:1!important}.micromag-screen-survey-container.micromag-screen-survey-answered{line-height:1}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultContainer{padding-right:50px;padding-left:15px}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultContent{width:100%;opacity:1}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-button{border-color:rgba(0,0,0,0);background-color:rgba(0,0,0,0)}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-button,.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-result,.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultLabel{opacity:.6}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-itemLabel{margin-right:0;margin-left:0;text-align:left}.micromag-screen-survey-container.micromag-screen-survey-answered.micromag-screen-survey-withPercentage .micromag-screen-survey-itemText{-webkit-transform:translate(-2em);-ms-transform:translate(-2em);transform:translate(-2em)}.micromag-screen-survey-container.micromag-screen-survey-withPercentage .micromag-screen-survey-itemLabel{margin-right:2em;margin-left:2em}.micromag-screen-survey-container.micromag-screen-survey-isPlaceholder .micromag-screen-survey-layout{padding:10px}.micromag-screen-survey-container.micromag-screen-survey-isPlaceholder .micromag-screen-survey-item{padding:1px 0}
1
+ .micromag-screen-survey-container{position:relative;width:100%;height:100%;overflow:hidden}.micromag-screen-survey-disabled.micromag-screen-survey-container{overflow:hidden;pointer-events:none}.micromag-screen-survey-hidden.micromag-screen-survey-container{display:none;visibility:hidden}.micromag-screen-survey-placeholder.micromag-screen-survey-container .micromag-screen-survey-content{position:relative;padding:6px}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer,.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{margin:5px auto;border:2px dashed #343434;color:#343434}.micromag-screen-survey-container .micromag-screen-survey-question{margin-bottom:20px}.micromag-screen-survey-container .micromag-screen-survey-answers,.micromag-screen-survey-container .micromag-screen-survey-items{position:relative}.micromag-screen-survey-container .micromag-screen-survey-item{padding:5px 0}.micromag-screen-survey-container .micromag-screen-survey-item:first-child .micromag-screen-survey-placeholderAnswer{width:80%}.micromag-screen-survey-container .micromag-screen-survey-item:last-child .micromag-screen-survey-placeholderAnswer{width:90%}.micromag-screen-survey-container .micromag-screen-survey-itemContent{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.micromag-screen-survey-container .micromag-screen-survey-resultBar{position:absolute;top:0;left:0;height:100%;background-color:hsla(0,0%,100%,.2)}.micromag-screen-survey-container .micromag-screen-survey-resultLabel{position:absolute;z-index:1;top:50%;right:0;width:4em;padding:0 8px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);color:#fff;text-align:right}.micromag-screen-survey-container .micromag-screen-survey-itemInner{width:100%}.micromag-screen-survey-container .micromag-screen-survey-button{display:-webkit-flex;display:-ms-flexbox;display:flex;position:relative;width:100%;padding:0;overflow:hidden;-webkit-transition:opacity .5s ease-out;-o-transition:opacity .5s ease-out;transition:opacity .5s ease-out}.micromag-screen-survey-container .micromag-screen-survey-button:disabled{opacity:1;pointer-events:none}.micromag-screen-survey-container .micromag-screen-survey-itemLabel{width:100%;padding:10px}.micromag-screen-survey-container .micromag-screen-survey-itemLabel,.micromag-screen-survey-container .micromag-screen-survey-itemText{display:inline-block;-webkit-transition:margin-left .3s ease-out,-webkit-transform .3s ease-out;transition:margin-left .3s ease-out,-webkit-transform .3s ease-out;-o-transition:margin-left .3s ease-out,transform .3s ease-out;transition:margin-left .3s ease-out,transform .3s ease-out;transition:margin-left .3s ease-out,transform .3s ease-out,-webkit-transform .3s ease-out}.micromag-screen-survey-container .micromag-screen-survey-itemText{position:relative;z-index:1}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer,.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{width:100%;margin:0 auto}.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{height:75px}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer{height:50px}.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-button,.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-result,.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-resultLabel{opacity:1!important}.micromag-screen-survey-container.micromag-screen-survey-answered{line-height:1}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultContainer{padding-right:50px;padding-left:15px}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultContent{width:100%;opacity:1}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-button{border-color:rgba(0,0,0,0);background-color:rgba(0,0,0,0)}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-button,.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-result,.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultLabel{opacity:.6}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-itemLabel{margin-right:0;margin-left:0;text-align:left}.micromag-screen-survey-container.micromag-screen-survey-answered.micromag-screen-survey-withPercentage .micromag-screen-survey-itemText{-webkit-transform:translate(-2em);-ms-transform:translate(-2em);transform:translate(-2em)}.micromag-screen-survey-container.micromag-screen-survey-withPercentage .micromag-screen-survey-itemLabel{margin-right:2em;margin-left:2em}.micromag-screen-survey-container.micromag-screen-survey-isPlaceholder .micromag-screen-survey-layout{padding:10px}.micromag-screen-survey-container.micromag-screen-survey-isPlaceholder .micromag-screen-survey-item{padding:1px 0}
package/es/index.js CHANGED
@@ -10,7 +10,7 @@ import { PropTypes as PropTypes$1 } from '@micromag/core';
10
10
  import { ScreenElement, Transitions } from '@micromag/core/components';
11
11
  import { useScreenSize, useViewer, useScreenRenderContext } from '@micromag/core/contexts';
12
12
  import { useTrackScreenEvent } from '@micromag/core/hooks';
13
- import { isTextFilled, getLargestRemainderRound, getStyleFromBox, getStyleFromColor } from '@micromag/core/utils';
13
+ import { isTextFilled, getLargestRemainderRound, getStyleFromColor } from '@micromag/core/utils';
14
14
  import { useQuizCreate, useQuiz } from '@micromag/data';
15
15
  import Background from '@micromag/element-background';
16
16
  import Button from '@micromag/element-button';
@@ -28,6 +28,7 @@ var propTypes = {
28
28
  question: PropTypes$1.textElement,
29
29
  answers: PropTypes$1.answers,
30
30
  buttonsStyle: PropTypes$1.boxStyle,
31
+ buttonsTextStyle: PropTypes$1.textStyle,
31
32
  resultsStyle: PropTypes.shape({
32
33
  barColor: PropTypes$1.color,
33
34
  textColor: PropTypes$1.color
@@ -53,6 +54,7 @@ var defaultProps = {
53
54
  question: null,
54
55
  answers: null,
55
56
  buttonsStyle: null,
57
+ buttonsTextStyle: null,
56
58
  resultsStyle: null,
57
59
  spacing: 20,
58
60
  background: null,
@@ -78,6 +80,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
78
80
  question = _ref.question,
79
81
  answers = _ref.answers,
80
82
  buttonsStyle = _ref.buttonsStyle,
83
+ buttonsTextStyle = _ref.buttonsTextStyle,
81
84
  resultsStyle = _ref.resultsStyle,
82
85
  spacing = _ref.spacing,
83
86
  background = _ref.background,
@@ -283,6 +286,8 @@ var SurveyScreen = function SurveyScreen(_ref) {
283
286
  label = _ref10$label === void 0 ? null : _ref10$label,
284
287
  _ref10$buttonStyle = _ref10.buttonStyle,
285
288
  answerButtonStyle = _ref10$buttonStyle === void 0 ? null : _ref10$buttonStyle,
289
+ _ref10$textStyle = _ref10.textStyle,
290
+ answerButtonTextStyle = _ref10$textStyle === void 0 ? null : _ref10$textStyle,
286
291
  _ref10$resultStyle = _ref10.resultStyle,
287
292
  answerResultStyle = _ref10$resultStyle === void 0 ? null : _ref10$resultStyle;
288
293
 
@@ -336,7 +341,6 @@ var SurveyScreen = function SurveyScreen(_ref) {
336
341
  }, /*#__PURE__*/React.createElement("div", {
337
342
  className: styles.itemInner,
338
343
  style: {
339
- // width: buttonMaxWidth,
340
344
  transitionDuration: finalTransitionDuration
341
345
  }
342
346
  }, /*#__PURE__*/React.createElement(Button, {
@@ -346,13 +350,14 @@ var SurveyScreen = function SurveyScreen(_ref) {
346
350
  },
347
351
  disabled: isPreview || userAnswerIndex !== null,
348
352
  focusable: current && isView,
349
- buttonStyle: _objectSpread(_objectSpread(_objectSpread({}, buttonsStyle), getStyleFromBox(answerButtonStyle)), answered ? {
353
+ buttonStyle: _objectSpread(_objectSpread(_objectSpread({}, buttonsStyle), answerButtonStyle), answered ? {
350
354
  textAlign: 'left'
351
- } : null)
355
+ } : null),
356
+ textStyle: _objectSpread(_objectSpread(_objectSpread({}, textStyle), buttonsTextStyle), answerButtonTextStyle)
352
357
  }, /*#__PURE__*/React.createElement("span", {
353
358
  className: styles.itemLabel
354
359
  }, /*#__PURE__*/React.createElement(Text, Object.assign({}, label, {
355
- textStyle: textStyle,
360
+ textStyle: _objectSpread(_objectSpread(_objectSpread({}, textStyle), buttonsTextStyle), answerButtonTextStyle),
356
361
  inline: true,
357
362
  className: styles.itemText
358
363
  })), !withoutPercentage ? /*#__PURE__*/React.createElement("div", {
@@ -363,7 +368,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
363
368
  opacity: 0
364
369
  })
365
370
  }, /*#__PURE__*/React.createElement(Text, Object.assign({}, label, {
366
- textStyle: textStyle,
371
+ textStyle: _objectSpread(_objectSpread(_objectSpread({}, textStyle), resultsTextColor), answerResultTextColor),
367
372
  inline: true,
368
373
  className: styles.resultText,
369
374
  body: "".concat(percent, "%")
@@ -536,6 +541,16 @@ var definition = {
536
541
  "value": "Buttons"
537
542
  }]
538
543
  })
544
+ }, {
545
+ name: 'buttonsTextStyle',
546
+ type: 'text-style-form',
547
+ label: defineMessage({
548
+ id: "gwPu/I",
549
+ defaultMessage: [{
550
+ "type": 0,
551
+ "value": "Buttons text"
552
+ }]
553
+ })
539
554
  }, {
540
555
  name: 'resultsStyle',
541
556
  type: 'field-with-form',
package/lib/index.js CHANGED
@@ -49,6 +49,7 @@ var propTypes = {
49
49
  question: core.PropTypes.textElement,
50
50
  answers: core.PropTypes.answers,
51
51
  buttonsStyle: core.PropTypes.boxStyle,
52
+ buttonsTextStyle: core.PropTypes.textStyle,
52
53
  resultsStyle: PropTypes__default["default"].shape({
53
54
  barColor: core.PropTypes.color,
54
55
  textColor: core.PropTypes.color
@@ -74,6 +75,7 @@ var defaultProps = {
74
75
  question: null,
75
76
  answers: null,
76
77
  buttonsStyle: null,
78
+ buttonsTextStyle: null,
77
79
  resultsStyle: null,
78
80
  spacing: 20,
79
81
  background: null,
@@ -99,6 +101,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
99
101
  question = _ref.question,
100
102
  answers = _ref.answers,
101
103
  buttonsStyle = _ref.buttonsStyle,
104
+ buttonsTextStyle = _ref.buttonsTextStyle,
102
105
  resultsStyle = _ref.resultsStyle,
103
106
  spacing = _ref.spacing,
104
107
  background = _ref.background,
@@ -304,6 +307,8 @@ var SurveyScreen = function SurveyScreen(_ref) {
304
307
  label = _ref10$label === void 0 ? null : _ref10$label,
305
308
  _ref10$buttonStyle = _ref10.buttonStyle,
306
309
  answerButtonStyle = _ref10$buttonStyle === void 0 ? null : _ref10$buttonStyle,
310
+ _ref10$textStyle = _ref10.textStyle,
311
+ answerButtonTextStyle = _ref10$textStyle === void 0 ? null : _ref10$textStyle,
307
312
  _ref10$resultStyle = _ref10.resultStyle,
308
313
  answerResultStyle = _ref10$resultStyle === void 0 ? null : _ref10$resultStyle;
309
314
 
@@ -357,7 +362,6 @@ var SurveyScreen = function SurveyScreen(_ref) {
357
362
  }, /*#__PURE__*/React__default["default"].createElement("div", {
358
363
  className: styles.itemInner,
359
364
  style: {
360
- // width: buttonMaxWidth,
361
365
  transitionDuration: finalTransitionDuration
362
366
  }
363
367
  }, /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
@@ -367,13 +371,14 @@ var SurveyScreen = function SurveyScreen(_ref) {
367
371
  },
368
372
  disabled: isPreview || userAnswerIndex !== null,
369
373
  focusable: current && isView,
370
- buttonStyle: _objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"]({}, buttonsStyle), utils.getStyleFromBox(answerButtonStyle)), answered ? {
374
+ buttonStyle: _objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"]({}, buttonsStyle), answerButtonStyle), answered ? {
371
375
  textAlign: 'left'
372
- } : null)
376
+ } : null),
377
+ textStyle: _objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"]({}, textStyle), buttonsTextStyle), answerButtonTextStyle)
373
378
  }, /*#__PURE__*/React__default["default"].createElement("span", {
374
379
  className: styles.itemLabel
375
380
  }, /*#__PURE__*/React__default["default"].createElement(Text__default["default"], Object.assign({}, label, {
376
- textStyle: textStyle,
381
+ textStyle: _objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"]({}, textStyle), buttonsTextStyle), answerButtonTextStyle),
377
382
  inline: true,
378
383
  className: styles.itemText
379
384
  })), !withoutPercentage ? /*#__PURE__*/React__default["default"].createElement("div", {
@@ -384,7 +389,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
384
389
  opacity: 0
385
390
  })
386
391
  }, /*#__PURE__*/React__default["default"].createElement(Text__default["default"], Object.assign({}, label, {
387
- textStyle: textStyle,
392
+ textStyle: _objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"]({}, textStyle), resultsTextColor), answerResultTextColor),
388
393
  inline: true,
389
394
  className: styles.resultText,
390
395
  body: "".concat(percent, "%")
@@ -557,6 +562,16 @@ var definition = {
557
562
  "value": "Buttons"
558
563
  }]
559
564
  })
565
+ }, {
566
+ name: 'buttonsTextStyle',
567
+ type: 'text-style-form',
568
+ label: reactIntl.defineMessage({
569
+ id: "gwPu/I",
570
+ defaultMessage: [{
571
+ "type": 0,
572
+ "value": "Buttons text"
573
+ }]
574
+ })
560
575
  }, {
561
576
  name: 'resultsStyle',
562
577
  type: 'field-with-form',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-survey",
3
- "version": "0.3.115",
3
+ "version": "0.3.120",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -49,17 +49,17 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@babel/runtime": "^7.13.10",
52
- "@micromag/core": "^0.3.115",
53
- "@micromag/data": "^0.3.115",
54
- "@micromag/element-background": "^0.3.115",
55
- "@micromag/element-button": "^0.3.115",
56
- "@micromag/element-call-to-action": "^0.3.115",
57
- "@micromag/element-container": "^0.3.115",
58
- "@micromag/element-heading": "^0.3.115",
59
- "@micromag/element-layout": "^0.3.115",
60
- "@micromag/element-scroll": "^0.3.115",
61
- "@micromag/element-text": "^0.3.115",
62
- "@micromag/transforms": "^0.3.115",
52
+ "@micromag/core": "^0.3.120",
53
+ "@micromag/data": "^0.3.120",
54
+ "@micromag/element-background": "^0.3.120",
55
+ "@micromag/element-button": "^0.3.120",
56
+ "@micromag/element-call-to-action": "^0.3.120",
57
+ "@micromag/element-container": "^0.3.120",
58
+ "@micromag/element-heading": "^0.3.120",
59
+ "@micromag/element-layout": "^0.3.120",
60
+ "@micromag/element-scroll": "^0.3.120",
61
+ "@micromag/element-text": "^0.3.120",
62
+ "@micromag/transforms": "^0.3.120",
63
63
  "classnames": "^2.2.6",
64
64
  "lodash": "^4.17.21",
65
65
  "prop-types": "^15.7.2",
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "47c269c5f0b4b423cb5bb187f12ec821479b89dc"
72
+ "gitHead": "997e92f10cf01fd5557b5c842c62bacf0babbd5a"
73
73
  }