intergalactic 15.86.0 → 15.87.0-prerelease.3

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.
Files changed (381) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/accordion/lib/cjs/Accordion.js +7 -7
  3. package/accordion/lib/es6/Accordion.js +7 -7
  4. package/animation/lib/cjs/Animation.js +11 -11
  5. package/animation/lib/cjs/Collapse.js +28 -28
  6. package/animation/lib/cjs/FadeInOut.js +28 -28
  7. package/animation/lib/cjs/Scale.js +28 -28
  8. package/animation/lib/cjs/Slide.js +28 -28
  9. package/animation/lib/cjs/Transform.js +28 -28
  10. package/animation/lib/es6/Animation.js +11 -11
  11. package/animation/lib/es6/Collapse.js +28 -28
  12. package/animation/lib/es6/FadeInOut.js +28 -28
  13. package/animation/lib/es6/Scale.js +28 -28
  14. package/animation/lib/es6/Slide.js +28 -28
  15. package/animation/lib/es6/Transform.js +28 -28
  16. package/badge/lib/cjs/Badge.js +6 -6
  17. package/badge/lib/es6/Badge.js +6 -6
  18. package/base-trigger/lib/cjs/BaseTrigger.js +18 -18
  19. package/base-trigger/lib/cjs/ButtonTrigger.js +3 -3
  20. package/base-trigger/lib/cjs/FilterTrigger.js +7 -7
  21. package/base-trigger/lib/cjs/LinkTrigger.js +12 -12
  22. package/base-trigger/lib/es6/BaseTrigger.js +18 -18
  23. package/base-trigger/lib/es6/ButtonTrigger.js +3 -3
  24. package/base-trigger/lib/es6/FilterTrigger.js +7 -7
  25. package/base-trigger/lib/es6/LinkTrigger.js +12 -12
  26. package/breadcrumbs/lib/cjs/Breadcrumbs.js +6 -6
  27. package/breadcrumbs/lib/es6/Breadcrumbs.js +6 -6
  28. package/button/lib/cjs/Button.js +26 -26
  29. package/button/lib/cjs/style/button.shadow.css +2 -2
  30. package/button/lib/es6/Button.js +26 -26
  31. package/button/lib/es6/style/button.shadow.css +2 -2
  32. package/card/lib/cjs/Card.js +8 -8
  33. package/card/lib/es6/Card.js +8 -8
  34. package/carousel/lib/cjs/Carousel.js +19 -19
  35. package/carousel/lib/es6/Carousel.js +19 -19
  36. package/checkbox/lib/cjs/Checkbox.js +18 -18
  37. package/checkbox/lib/es6/Checkbox.js +18 -18
  38. package/color-picker/lib/cjs/ColorPicker.js +23 -23
  39. package/color-picker/lib/cjs/PaletteManager.js +23 -23
  40. package/color-picker/lib/cjs/components/InputColor.js +23 -23
  41. package/color-picker/lib/es6/ColorPicker.js +23 -23
  42. package/color-picker/lib/es6/PaletteManager.js +23 -23
  43. package/color-picker/lib/es6/components/InputColor.js +23 -23
  44. package/components.json +73 -73
  45. package/counter/lib/cjs/Counter.js +10 -10
  46. package/counter/lib/es6/Counter.js +10 -10
  47. package/d3-chart/lib/cjs/Area.js +11 -11
  48. package/d3-chart/lib/cjs/Axis.js +14 -14
  49. package/d3-chart/lib/cjs/Bar.js +10 -10
  50. package/d3-chart/lib/cjs/Bubble.js +12 -12
  51. package/d3-chart/lib/cjs/Donut.js +9 -9
  52. package/d3-chart/lib/cjs/Dots.js +8 -8
  53. package/d3-chart/lib/cjs/HorizontalBar.js +10 -10
  54. package/d3-chart/lib/cjs/Hover.js +3 -3
  55. package/d3-chart/lib/cjs/Line.js +9 -9
  56. package/d3-chart/lib/cjs/Plot.js +3 -3
  57. package/d3-chart/lib/cjs/Radar.js +19 -19
  58. package/d3-chart/lib/cjs/RadialTree.js +11 -11
  59. package/d3-chart/lib/cjs/ReferenceLine.js +9 -9
  60. package/d3-chart/lib/cjs/ScatterPlot.js +9 -9
  61. package/d3-chart/lib/cjs/Tooltip.js +9 -9
  62. package/d3-chart/lib/cjs/Venn.js +9 -9
  63. package/d3-chart/lib/cjs/a11y/PlotA11yModule.js +2 -2
  64. package/d3-chart/lib/cjs/a11y/PlotA11yView.js +2 -2
  65. package/d3-chart/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  66. package/d3-chart/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
  67. package/d3-chart/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
  68. package/d3-chart/lib/es6/Area.js +11 -11
  69. package/d3-chart/lib/es6/Axis.js +14 -14
  70. package/d3-chart/lib/es6/Bar.js +10 -10
  71. package/d3-chart/lib/es6/Bubble.js +12 -12
  72. package/d3-chart/lib/es6/Donut.js +9 -9
  73. package/d3-chart/lib/es6/Dots.js +8 -8
  74. package/d3-chart/lib/es6/HorizontalBar.js +10 -10
  75. package/d3-chart/lib/es6/Hover.js +3 -3
  76. package/d3-chart/lib/es6/Line.js +9 -9
  77. package/d3-chart/lib/es6/Plot.js +3 -3
  78. package/d3-chart/lib/es6/Radar.js +19 -19
  79. package/d3-chart/lib/es6/RadialTree.js +11 -11
  80. package/d3-chart/lib/es6/ReferenceLine.js +9 -9
  81. package/d3-chart/lib/es6/ScatterPlot.js +9 -9
  82. package/d3-chart/lib/es6/Tooltip.js +9 -9
  83. package/d3-chart/lib/es6/Venn.js +9 -9
  84. package/d3-chart/lib/es6/a11y/PlotA11yModule.js +2 -2
  85. package/d3-chart/lib/es6/a11y/PlotA11yView.js +2 -2
  86. package/d3-chart/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  87. package/d3-chart/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
  88. package/d3-chart/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
  89. package/data-table/lib/cjs/DataTable.js +37 -37
  90. package/data-table/lib/es6/DataTable.js +37 -37
  91. package/date-picker/lib/cjs/components/Calendar.js +21 -21
  92. package/date-picker/lib/cjs/components/DateRangeComparatorAbstract.js +29 -29
  93. package/date-picker/lib/cjs/components/InputTrigger.js +29 -29
  94. package/date-picker/lib/cjs/components/PickerAbstract.js +29 -29
  95. package/date-picker/lib/cjs/components/RangePickerAbstract.js +29 -29
  96. package/date-picker/lib/es6/components/Calendar.js +21 -21
  97. package/date-picker/lib/es6/components/DateRangeComparatorAbstract.js +29 -29
  98. package/date-picker/lib/es6/components/InputTrigger.js +29 -29
  99. package/date-picker/lib/es6/components/PickerAbstract.js +29 -29
  100. package/date-picker/lib/es6/components/RangePickerAbstract.js +29 -29
  101. package/divider/lib/cjs/Divider.js +9 -9
  102. package/divider/lib/es6/Divider.js +9 -9
  103. package/dot/lib/cjs/Dot.js +10 -10
  104. package/dot/lib/es6/Dot.js +10 -10
  105. package/drag-and-drop/lib/cjs/DragAndDrop.js +16 -16
  106. package/drag-and-drop/lib/es6/DragAndDrop.js +16 -16
  107. package/dropdown/lib/cjs/Dropdown.js +2 -2
  108. package/dropdown/lib/es6/Dropdown.js +2 -2
  109. package/dropdown-menu/lib/cjs/DropdownMenu.js +16 -16
  110. package/dropdown-menu/lib/cjs/styleScrollArea.js +6 -6
  111. package/dropdown-menu/lib/es6/DropdownMenu.js +16 -16
  112. package/dropdown-menu/lib/es6/styleScrollArea.js +6 -6
  113. package/ellipsis/lib/cjs/Ellipsis.js +10 -10
  114. package/ellipsis/lib/es6/Ellipsis.js +10 -10
  115. package/errors/lib/cjs/Error.js +9 -9
  116. package/errors/lib/es6/Error.js +9 -9
  117. package/feature-popover/lib/cjs/FeaturePopover.js +10 -10
  118. package/feature-popover/lib/es6/FeaturePopover.js +10 -10
  119. package/feedback-form/component/checkbox-button/CheckboxButton.d.ts +4 -0
  120. package/feedback-form/component/feedback-item/FeedbackItem.d.ts +7 -0
  121. package/feedback-form/component/feedback-rating/FeedbackRating.d.ts +156 -0
  122. package/feedback-form/component/feedback-rating/FeedbackRating.type.d.ts +55 -0
  123. package/feedback-form/component/slider-rating/SliderRating.d.ts +14 -0
  124. package/feedback-form/component/submit-button/SubmitButton.d.ts +3 -0
  125. package/feedback-form/index.d.ts +4 -0
  126. package/feedback-form/lib/cjs/FeedbackForm.js +28 -86
  127. package/feedback-form/lib/cjs/FeedbackForm.js.map +1 -1
  128. package/feedback-form/lib/cjs/component/checkbox-button/CheckboxButton.js +58 -0
  129. package/feedback-form/lib/cjs/component/checkbox-button/CheckboxButton.js.map +1 -0
  130. package/feedback-form/lib/cjs/component/feedback-item/FeedbackItem.js +63 -0
  131. package/feedback-form/lib/cjs/component/feedback-item/FeedbackItem.js.map +1 -0
  132. package/feedback-form/lib/cjs/component/feedback-rating/FeedbackRating.js +360 -0
  133. package/feedback-form/lib/cjs/component/feedback-rating/FeedbackRating.js.map +1 -0
  134. package/feedback-form/lib/cjs/component/feedback-rating/FeedbackRating.type.js +2 -0
  135. package/feedback-form/lib/cjs/component/feedback-rating/FeedbackRating.type.js.map +1 -0
  136. package/feedback-form/lib/cjs/component/slider-rating/SliderRating.js +172 -0
  137. package/feedback-form/lib/cjs/component/slider-rating/SliderRating.js.map +1 -0
  138. package/feedback-form/lib/cjs/component/submit-button/SubmitButton.js +23 -0
  139. package/feedback-form/lib/cjs/component/submit-button/SubmitButton.js.map +1 -0
  140. package/feedback-form/lib/cjs/index.d.js +12 -0
  141. package/feedback-form/lib/cjs/index.d.js.map +1 -1
  142. package/feedback-form/lib/cjs/index.js +7 -0
  143. package/feedback-form/lib/cjs/index.js.map +1 -1
  144. package/feedback-form/lib/cjs/style/checkbox-button.shadow.css +21 -0
  145. package/feedback-form/lib/cjs/style/feedback-rating.shadow.css +9 -0
  146. package/feedback-form/lib/cjs/style/slider-rating.shadow.css +34 -0
  147. package/feedback-form/lib/cjs/translations/__intergalactic-dynamic-locales.js +39 -0
  148. package/feedback-form/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -0
  149. package/feedback-form/lib/cjs/translations/de.json +7 -0
  150. package/feedback-form/lib/cjs/translations/en.json +8 -0
  151. package/feedback-form/lib/cjs/translations/es.json +7 -0
  152. package/feedback-form/lib/cjs/translations/fr.json +7 -0
  153. package/feedback-form/lib/cjs/translations/it.json +7 -0
  154. package/feedback-form/lib/cjs/translations/ja.json +7 -0
  155. package/feedback-form/lib/cjs/translations/ko.json +7 -0
  156. package/feedback-form/lib/cjs/translations/nl.json +7 -0
  157. package/feedback-form/lib/cjs/translations/pl.json +7 -0
  158. package/feedback-form/lib/cjs/translations/pt.json +7 -0
  159. package/feedback-form/lib/cjs/translations/sv.json +7 -0
  160. package/feedback-form/lib/cjs/translations/tr.json +7 -0
  161. package/feedback-form/lib/cjs/translations/vi.json +7 -0
  162. package/feedback-form/lib/cjs/translations/zh.json +7 -0
  163. package/feedback-form/lib/es6/FeedbackForm.js +28 -88
  164. package/feedback-form/lib/es6/FeedbackForm.js.map +1 -1
  165. package/feedback-form/lib/es6/component/checkbox-button/CheckboxButton.js +50 -0
  166. package/feedback-form/lib/es6/component/checkbox-button/CheckboxButton.js.map +1 -0
  167. package/feedback-form/lib/es6/component/feedback-item/FeedbackItem.js +56 -0
  168. package/feedback-form/lib/es6/component/feedback-item/FeedbackItem.js.map +1 -0
  169. package/feedback-form/lib/es6/component/feedback-rating/FeedbackRating.js +354 -0
  170. package/feedback-form/lib/es6/component/feedback-rating/FeedbackRating.js.map +1 -0
  171. package/feedback-form/lib/es6/component/feedback-rating/FeedbackRating.type.js +2 -0
  172. package/feedback-form/lib/es6/component/feedback-rating/FeedbackRating.type.js.map +1 -0
  173. package/feedback-form/lib/es6/component/slider-rating/SliderRating.js +165 -0
  174. package/feedback-form/lib/es6/component/slider-rating/SliderRating.js.map +1 -0
  175. package/feedback-form/lib/es6/component/submit-button/SubmitButton.js +17 -0
  176. package/feedback-form/lib/es6/component/submit-button/SubmitButton.js.map +1 -0
  177. package/feedback-form/lib/es6/index.d.js +5 -1
  178. package/feedback-form/lib/es6/index.d.js.map +1 -1
  179. package/feedback-form/lib/es6/index.js +2 -0
  180. package/feedback-form/lib/es6/index.js.map +1 -1
  181. package/feedback-form/lib/es6/style/checkbox-button.shadow.css +21 -0
  182. package/feedback-form/lib/es6/style/feedback-rating.shadow.css +9 -0
  183. package/feedback-form/lib/es6/style/slider-rating.shadow.css +34 -0
  184. package/feedback-form/lib/es6/translations/__intergalactic-dynamic-locales.js +31 -0
  185. package/feedback-form/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -0
  186. package/feedback-form/lib/es6/translations/de.json +7 -0
  187. package/feedback-form/lib/es6/translations/en.json +8 -0
  188. package/feedback-form/lib/es6/translations/es.json +7 -0
  189. package/feedback-form/lib/es6/translations/fr.json +7 -0
  190. package/feedback-form/lib/es6/translations/it.json +7 -0
  191. package/feedback-form/lib/es6/translations/ja.json +7 -0
  192. package/feedback-form/lib/es6/translations/ko.json +7 -0
  193. package/feedback-form/lib/es6/translations/nl.json +7 -0
  194. package/feedback-form/lib/es6/translations/pl.json +7 -0
  195. package/feedback-form/lib/es6/translations/pt.json +7 -0
  196. package/feedback-form/lib/es6/translations/sv.json +7 -0
  197. package/feedback-form/lib/es6/translations/tr.json +7 -0
  198. package/feedback-form/lib/es6/translations/vi.json +7 -0
  199. package/feedback-form/lib/es6/translations/zh.json +7 -0
  200. package/feedback-form/lib/types/component/checkbox-button/CheckboxButton.d.ts +4 -0
  201. package/feedback-form/lib/types/component/feedback-item/FeedbackItem.d.ts +7 -0
  202. package/feedback-form/lib/types/component/feedback-rating/FeedbackRating.d.ts +156 -0
  203. package/feedback-form/lib/types/component/feedback-rating/FeedbackRating.type.d.ts +55 -0
  204. package/feedback-form/lib/types/component/slider-rating/SliderRating.d.ts +14 -0
  205. package/feedback-form/lib/types/component/submit-button/SubmitButton.d.ts +3 -0
  206. package/feedback-form/lib/types/index.d.ts +4 -0
  207. package/feedback-form/lib/types/translations/__intergalactic-dynamic-locales.d.ts +101 -0
  208. package/feedback-form/translations/__intergalactic-dynamic-locales.d.ts +101 -0
  209. package/flags/index.d.ts +1013 -1014
  210. package/flags/lib/cjs/Flags.js +4 -5
  211. package/flags/lib/cjs/Flags.js.map +1 -1
  212. package/flags/lib/cjs/index.d.js.map +1 -1
  213. package/flags/lib/es6/Flags.js +4 -5
  214. package/flags/lib/es6/Flags.js.map +1 -1
  215. package/flags/lib/es6/index.d.js.map +1 -1
  216. package/flags/lib/sprites/sprite@1x.css +256 -256
  217. package/flags/lib/sprites/sprite@2x.css +257 -257
  218. package/flags/lib/types/index.d.ts +1013 -1014
  219. package/flex-box/lib/cjs/Box/useBox.js +3 -3
  220. package/flex-box/lib/cjs/Flex/useFlex.js +3 -3
  221. package/flex-box/lib/cjs/invalid-state-box/InvalidStateBox.js +2 -2
  222. package/flex-box/lib/es6/Box/useBox.js +3 -3
  223. package/flex-box/lib/es6/Flex/useFlex.js +3 -3
  224. package/flex-box/lib/es6/invalid-state-box/InvalidStateBox.js +2 -2
  225. package/format-text/lib/cjs/FormatText.js +5 -5
  226. package/format-text/lib/es6/FormatText.js +5 -5
  227. package/fullscreen-modal/lib/cjs/FullscreenModal.js +13 -13
  228. package/fullscreen-modal/lib/es6/FullscreenModal.js +13 -13
  229. package/grid/lib/cjs/Grid.js +114 -114
  230. package/grid/lib/es6/Grid.js +114 -114
  231. package/icon/color/Confluence/l/index.js +4 -4
  232. package/icon/color/Confluence/l/index.mjs +4 -4
  233. package/icon/color/Confluence/m/index.js +4 -4
  234. package/icon/color/Confluence/m/index.mjs +4 -4
  235. package/icon/color/MicrosoftOffice/l/index.js +10 -10
  236. package/icon/color/MicrosoftOffice/l/index.mjs +10 -10
  237. package/icon/color/MicrosoftOffice/m/index.js +10 -10
  238. package/icon/color/MicrosoftOffice/m/index.mjs +10 -10
  239. package/icon/lib/cjs/Icon.js +5 -5
  240. package/icon/lib/es6/Icon.js +5 -5
  241. package/icon/pay/Discover/l/index.js +1 -1
  242. package/icon/pay/Discover/l/index.mjs +1 -1
  243. package/icon/pay/Discover/m/index.js +1 -1
  244. package/icon/pay/Discover/m/index.mjs +1 -1
  245. package/icon/pay/JCB/l/index.js +10 -10
  246. package/icon/pay/JCB/l/index.mjs +10 -10
  247. package/icon/pay/JCB/m/index.js +10 -10
  248. package/icon/pay/JCB/m/index.mjs +10 -10
  249. package/icon/pay/Visa/l/index.js +2 -2
  250. package/icon/pay/Visa/l/index.mjs +2 -2
  251. package/icon/pay/Visa/m/index.js +2 -2
  252. package/icon/pay/Visa/m/index.mjs +2 -2
  253. package/illustration/lib/cjs/index.js +1 -1
  254. package/illustration/lib/es6/index.js +1 -1
  255. package/inline-edit/lib/cjs/InlineEdit.js +4 -4
  256. package/inline-edit/lib/es6/InlineEdit.js +4 -4
  257. package/inline-input/lib/cjs/InlineInput.js +18 -18
  258. package/inline-input/lib/es6/InlineInput.js +18 -18
  259. package/input/lib/cjs/Input.js +17 -17
  260. package/input/lib/es6/Input.js +17 -17
  261. package/input-mask/lib/cjs/InputMask.js +6 -6
  262. package/input-mask/lib/es6/InputMask.js +6 -6
  263. package/input-number/lib/cjs/InputNumber.js +10 -10
  264. package/input-number/lib/cjs/InputNumber.js.map +1 -1
  265. package/input-number/lib/es6/InputNumber.js +10 -10
  266. package/input-number/lib/es6/InputNumber.js.map +1 -1
  267. package/input-tags/lib/cjs/InputTags.js +12 -12
  268. package/input-tags/lib/es6/InputTags.js +12 -12
  269. package/link/lib/cjs/Link.js +12 -12
  270. package/link/lib/es6/Link.js +12 -12
  271. package/mini-chart/lib/cjs/component/score/Donut.js +9 -9
  272. package/mini-chart/lib/cjs/component/score/Line.js +17 -17
  273. package/mini-chart/lib/cjs/component/trend/Bar.js +7 -7
  274. package/mini-chart/lib/cjs/component/trend/Line.js +7 -7
  275. package/mini-chart/lib/es6/component/score/Donut.js +9 -9
  276. package/mini-chart/lib/es6/component/score/Line.js +17 -17
  277. package/mini-chart/lib/es6/component/trend/Bar.js +7 -7
  278. package/mini-chart/lib/es6/component/trend/Line.js +7 -7
  279. package/modal/lib/cjs/Modal.js +9 -9
  280. package/modal/lib/es6/Modal.js +9 -9
  281. package/notice/lib/cjs/Notice.js +13 -13
  282. package/notice/lib/es6/Notice.js +13 -13
  283. package/notice-bubble/lib/cjs/NoticeBubble.js +12 -12
  284. package/notice-bubble/lib/es6/NoticeBubble.js +12 -12
  285. package/notice-global/lib/cjs/NoticeGlobal.js +11 -11
  286. package/notice-global/lib/es6/NoticeGlobal.js +11 -11
  287. package/package.json +2 -2
  288. package/pagination/lib/cjs/Pagination.js +10 -10
  289. package/pagination/lib/es6/Pagination.js +10 -10
  290. package/pills/lib/cjs/Pills.js +13 -13
  291. package/pills/lib/es6/Pills.js +13 -13
  292. package/popper/lib/cjs/Popper.js +6 -6
  293. package/popper/lib/es6/Popper.js +6 -6
  294. package/product-head/lib/cjs/Info.js +4 -4
  295. package/product-head/lib/cjs/ProductHead.js +5 -5
  296. package/product-head/lib/cjs/Title.js +4 -4
  297. package/product-head/lib/es6/Info.js +4 -4
  298. package/product-head/lib/es6/ProductHead.js +5 -5
  299. package/product-head/lib/es6/Title.js +4 -4
  300. package/progress-bar/lib/cjs/ProgressBar.js +15 -15
  301. package/progress-bar/lib/es6/ProgressBar.js +15 -15
  302. package/radio/lib/cjs/Radio.js +16 -16
  303. package/radio/lib/es6/Radio.js +16 -16
  304. package/scroll-area/lib/cjs/ScrollArea.js +21 -21
  305. package/scroll-area/lib/cjs/ScrollBar.js +6 -6
  306. package/scroll-area/lib/es6/ScrollArea.js +21 -21
  307. package/scroll-area/lib/es6/ScrollBar.js +6 -6
  308. package/select/lib/cjs/InputSearch.js +6 -6
  309. package/select/lib/cjs/Select.js +8 -8
  310. package/select/lib/es6/InputSearch.js +6 -6
  311. package/select/lib/es6/Select.js +8 -8
  312. package/side-panel/lib/cjs/SidePanel.js +15 -15
  313. package/side-panel/lib/es6/SidePanel.js +15 -15
  314. package/skeleton/lib/cjs/Charts/Area.js +9 -9
  315. package/skeleton/lib/cjs/Charts/Bar.js +9 -9
  316. package/skeleton/lib/cjs/Charts/Bubble.js +9 -9
  317. package/skeleton/lib/cjs/Charts/Donut.js +9 -9
  318. package/skeleton/lib/cjs/Charts/Histogram.js +9 -9
  319. package/skeleton/lib/cjs/Charts/Line.js +9 -9
  320. package/skeleton/lib/cjs/Charts/RadialTree.js +9 -9
  321. package/skeleton/lib/cjs/Charts/ScatterPlot.js +9 -9
  322. package/skeleton/lib/cjs/Charts/Venn.js +9 -9
  323. package/skeleton/lib/cjs/Skeleton.js +8 -8
  324. package/skeleton/lib/es6/Charts/Area.js +9 -9
  325. package/skeleton/lib/es6/Charts/Bar.js +9 -9
  326. package/skeleton/lib/es6/Charts/Bubble.js +9 -9
  327. package/skeleton/lib/es6/Charts/Donut.js +9 -9
  328. package/skeleton/lib/es6/Charts/Histogram.js +9 -9
  329. package/skeleton/lib/es6/Charts/Line.js +9 -9
  330. package/skeleton/lib/es6/Charts/RadialTree.js +9 -9
  331. package/skeleton/lib/es6/Charts/ScatterPlot.js +9 -9
  332. package/skeleton/lib/es6/Charts/Venn.js +9 -9
  333. package/skeleton/lib/es6/Skeleton.js +8 -8
  334. package/slider/lib/cjs/Slider.js +8 -8
  335. package/slider/lib/es6/Slider.js +8 -8
  336. package/spin/lib/cjs/Spin.js +13 -13
  337. package/spin/lib/es6/Spin.js +13 -13
  338. package/spin-container/lib/cjs/SpinContainer.js +8 -8
  339. package/spin-container/lib/es6/SpinContainer.js +8 -8
  340. package/sticky/lib/cjs/Sticky.js +2 -2
  341. package/sticky/lib/es6/Sticky.js +2 -2
  342. package/switch/lib/cjs/Switch.js +21 -21
  343. package/switch/lib/es6/Switch.js +21 -21
  344. package/tab-line/lib/cjs/TabLine.js +13 -13
  345. package/tab-line/lib/es6/TabLine.js +13 -13
  346. package/tab-panel/lib/cjs/TabPanel.js +8 -8
  347. package/tab-panel/lib/es6/TabPanel.js +8 -8
  348. package/tag/lib/cjs/Tag.js +20 -20
  349. package/tag/lib/es6/Tag.js +20 -20
  350. package/textarea/lib/cjs/Textarea.js +8 -8
  351. package/textarea/lib/es6/Textarea.js +8 -8
  352. package/time-picker/lib/cjs/TimePicker.js +12 -12
  353. package/time-picker/lib/es6/TimePicker.js +12 -12
  354. package/tooltip/lib/cjs/Tooltip.js +9 -9
  355. package/tooltip/lib/es6/Tooltip.js +9 -9
  356. package/typography/lib/cjs/Blockquote.js +4 -4
  357. package/typography/lib/cjs/Hint.js +7 -7
  358. package/typography/lib/cjs/List.js +5 -5
  359. package/typography/lib/cjs/Text.js +34 -34
  360. package/typography/lib/es6/Blockquote.js +4 -4
  361. package/typography/lib/es6/Hint.js +7 -7
  362. package/typography/lib/es6/List.js +5 -5
  363. package/typography/lib/es6/Text.js +34 -34
  364. package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.js +2 -2
  365. package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.mjs +2 -2
  366. package/utils/lib/enhances/keyboardFocusEnhance.d.ts +1 -0
  367. package/utils/lib/enhances/keyboardFocusEnhance.js +2 -2
  368. package/utils/lib/enhances/keyboardFocusEnhance.js.map +1 -1
  369. package/utils/lib/enhances/keyboardFocusEnhance.mjs +2 -2
  370. package/utils/lib/enhances/keyboardFocusEnhance.mjs.map +1 -1
  371. package/utils/lib/injectStyle.js +1 -1
  372. package/utils/lib/injectStyle.mjs +1 -1
  373. package/utils/lib/themes/auto.css +4 -0
  374. package/utils/lib/themes/default.css +4 -0
  375. package/utils/lib/themes/default.json +2 -0
  376. package/utils/lib/themes/light.css +4 -0
  377. package/utils/lib/themes/light.json +2 -0
  378. package/widget-empty/lib/cjs/WidgetEmpty.js +5 -5
  379. package/widget-empty/lib/es6/WidgetEmpty.js +5 -5
  380. package/wizard/lib/cjs/Wizard.js +11 -11
  381. package/wizard/lib/es6/Wizard.js +11 -11
@@ -0,0 +1,354 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ import _extends from "@babel/runtime/helpers/extends";
4
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
+ import _createClass from "@babel/runtime/helpers/createClass";
6
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
7
+ import _inherits from "@babel/runtime/helpers/inherits";
8
+ import _createSuper from "@babel/runtime/helpers/createSuper";
9
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
+ import { sstyled as _sstyled } from 'intergalactic/utils/lib/core/index';
11
+ import { assignProps as _assignProps3 } from 'intergalactic/core';
12
+ import { assignProps as _assignProps2 } from 'intergalactic/core';
13
+ import { assignProps as _assignProps } from 'intergalactic/core';
14
+ var _excluded = ["header", "submitText", "formConfig", "notificationText", "learnMoreLink", "Children", "styles", "forwardRef", "status", "theme", "background", "rating", "visible", "onVisibleChange", "notificationVisible", "onNotificationClose", "getI18nText", "errorFeedbackEmail"];
15
+ import React from 'react';
16
+ import createComponent, { Component, sstyled, Root } from 'intergalactic/core';
17
+ import { Form } from 'react-final-form';
18
+ import createFocusDecorator from 'final-form-focus';
19
+ import SpinContainer from 'intergalactic/spin-container';
20
+ import i18nEnhance from 'intergalactic/utils/lib/enhances/i18nEnhance';
21
+ import uniqueIDEnhancement from 'intergalactic/utils/lib/uniqueID';
22
+ import Notice from 'intergalactic/notice';
23
+ import CloseAltM from 'intergalactic/icon/Close/m';
24
+ import CheckM from 'intergalactic/icon/Check/m';
25
+ import WarnM from 'intergalactic/icon/Warning/m';
26
+ import { Text } from 'intergalactic/typography';
27
+ import FeedbackIllustration from 'intergalactic/illustration/Feedback';
28
+ import Link from 'intergalactic/link';
29
+ import SliderRating from '../slider-rating/SliderRating';
30
+ import Modal from 'intergalactic/modal';
31
+ import Textarea from 'intergalactic/textarea';
32
+ import { Box, Flex } from 'intergalactic/flex-box';
33
+ import { FeedbackItem } from '../feedback-item/FeedbackItem';
34
+ import { SubmitButton } from '../submit-button/SubmitButton';
35
+ import CheckboxButton from '../checkbox-button/CheckboxButton';
36
+ import Input from 'intergalactic/input';
37
+ import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
38
+ import { NoticeBubbleContainer, NoticeBubbleManager } from 'intergalactic/notice-bubble';
39
+ /*__reshadow-styles__:"../../style/feedback-rating.shadow.css"*/
40
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SFeedbackRating_1pju1_gg_ ul{margin:0;padding:0;list-style:none}.___SFeedbackRating_1pju1_gg_ li{list-style:none}" /*__inner_css_end__*/, "1pju1_gg_") /*__reshadow_css_end__*/, {
41
+ "__SFeedbackRating": "___SFeedbackRating_1pju1_gg_"
42
+ });
43
+ var FeedbackRatingRoot = /*#__PURE__*/function (_Component) {
44
+ _inherits(FeedbackRatingRoot, _Component);
45
+ var _super = _createSuper(FeedbackRatingRoot);
46
+ function FeedbackRatingRoot() {
47
+ var _this;
48
+ _classCallCheck(this, FeedbackRatingRoot);
49
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
50
+ args[_key] = arguments[_key];
51
+ }
52
+ _this = _super.call.apply(_super, [this].concat(args));
53
+ _defineProperty(_assertThisInitialized(_this), "state", {
54
+ error: false
55
+ });
56
+ _defineProperty(_assertThisInitialized(_this), "manager", new NoticeBubbleManager());
57
+ _defineProperty(_assertThisInitialized(_this), "focusDecorator", createFocusDecorator());
58
+ _defineProperty(_assertThisInitialized(_this), "handleChangeRating", function (rating) {
59
+ _this.asProps.onVisibleChange(true, rating);
60
+ });
61
+ _defineProperty(_assertThisInitialized(_this), "handelCloseModal", function () {
62
+ _this.asProps.onVisibleChange(false, _this.asProps.rating);
63
+ });
64
+ _defineProperty(_assertThisInitialized(_this), "handleChange", function (fn) {
65
+ return function (value, e) {
66
+ fn(e);
67
+ };
68
+ });
69
+ _defineProperty(_assertThisInitialized(_this), "renderCheckbox", function (config) {
70
+ var initialValue = _this.props.initialValues[config.key];
71
+ return /*#__PURE__*/React.createElement(FeedbackRating.Item, {
72
+ name: config.key,
73
+ initialValue: initialValue,
74
+ type: 'checkbox',
75
+ key: config.key,
76
+ tag: 'li'
77
+ }, function (_ref7) {
78
+ var input = _ref7.input;
79
+ return /*#__PURE__*/React.createElement(FeedbackRating.Checkbox, _extends({}, input, {
80
+ id: config.key,
81
+ name: config.key,
82
+ label: config.label,
83
+ onChange: _this.handleChange(input.onChange)
84
+ }));
85
+ });
86
+ });
87
+ _defineProperty(_assertThisInitialized(_this), "renderTextField", function (config) {
88
+ var initialValue = _this.props.initialValues[config.key];
89
+ var label = typeof config.label === 'string' ? /*#__PURE__*/React.createElement(Text, {
90
+ mb: 2,
91
+ size: 200
92
+ }, config.label) : config.label;
93
+ return /*#__PURE__*/React.createElement(Flex, {
94
+ tag: "label",
95
+ mt: 4,
96
+ direction: "column",
97
+ htmlFor: config.key,
98
+ key: config.key
99
+ }, label, /*#__PURE__*/React.createElement(FeedbackRating.Item, {
100
+ name: config.key,
101
+ validate: config.validate,
102
+ initialValue: initialValue,
103
+ placement: "left-start",
104
+ flip: {
105
+ fallbackPlacements: ['right-start', 'bottom']
106
+ }
107
+ }, function (_ref8) {
108
+ var input = _ref8.input;
109
+ if (config.type === 'textarea') {
110
+ return /*#__PURE__*/React.createElement(Textarea, _extends({}, input, {
111
+ autoFocus: true,
112
+ h: 80,
113
+ onChange: _this.handleChange(input.onChange),
114
+ id: config.key
115
+ }));
116
+ }
117
+ if (config.type === 'input') {
118
+ return /*#__PURE__*/React.createElement(Input, {
119
+ state: input.state
120
+ }, /*#__PURE__*/React.createElement(Input.Value, _extends({}, input, {
121
+ onChange: _this.handleChange(input.onChange),
122
+ id: config.key
123
+ })));
124
+ }
125
+ return null;
126
+ }), config.description && /*#__PURE__*/React.createElement(Box, {
127
+ mt: 2
128
+ }, typeof config.description === 'string' ? /*#__PURE__*/React.createElement(Text, {
129
+ lineHeight: "18px",
130
+ size: 200,
131
+ color: "#6c6e79"
132
+ }, config.description) : config.description));
133
+ });
134
+ return _this;
135
+ }
136
+ _createClass(FeedbackRatingRoot, [{
137
+ key: "headerId",
138
+ get: function get() {
139
+ var uid = this.asProps.uid;
140
+ return "".concat(uid, "-feedback-rating-header");
141
+ }
142
+ }, {
143
+ key: "getHeaderProps",
144
+ value: function getHeaderProps() {
145
+ return {
146
+ id: this.headerId
147
+ };
148
+ }
149
+ }, {
150
+ key: "getItemProps",
151
+ value: function getItemProps() {
152
+ var validateOnBlur = this.asProps.validateOnBlur;
153
+ return {
154
+ validateOnBlur: validateOnBlur
155
+ };
156
+ }
157
+ }, {
158
+ key: "componentDidUpdate",
159
+ value: function componentDidUpdate(prevProps) {
160
+ var _this$asProps = this.asProps,
161
+ status = _this$asProps.status,
162
+ getI18nText = _this$asProps.getI18nText;
163
+ if (prevProps.status !== status) {
164
+ this.setState({
165
+ error: false
166
+ });
167
+ if (status === 'success') {
168
+ this.manager.add({
169
+ icon: /*#__PURE__*/React.createElement(CheckM, {
170
+ color: "green-400"
171
+ }),
172
+ children: getI18nText('successMessage'),
173
+ initialAnimation: true,
174
+ duration: 5000
175
+ });
176
+ } else if (status === 'error') {
177
+ this.setState({
178
+ error: true
179
+ });
180
+ }
181
+ }
182
+ }
183
+ }, {
184
+ key: "render",
185
+ value: function render() {
186
+ var _ref = this.asProps,
187
+ _ref2 = this.asProps,
188
+ _ref4,
189
+ _this2 = this;
190
+ var _this$asProps2 = this.asProps,
191
+ header = _this$asProps2.header,
192
+ submitText = _this$asProps2.submitText,
193
+ formConfig = _this$asProps2.formConfig,
194
+ notificationText = _this$asProps2.notificationText,
195
+ learnMoreLink = _this$asProps2.learnMoreLink,
196
+ Children = _this$asProps2.Children,
197
+ styles = _this$asProps2.styles,
198
+ forwardRef = _this$asProps2.forwardRef,
199
+ status = _this$asProps2.status,
200
+ theme = _this$asProps2.theme,
201
+ background = _this$asProps2.background,
202
+ rating = _this$asProps2.rating,
203
+ visible = _this$asProps2.visible,
204
+ onVisibleChange = _this$asProps2.onVisibleChange,
205
+ notificationVisible = _this$asProps2.notificationVisible,
206
+ onNotificationClose = _this$asProps2.onNotificationClose,
207
+ getI18nText = _this$asProps2.getI18nText,
208
+ errorFeedbackEmail = _this$asProps2.errorFeedbackEmail,
209
+ other = _objectWithoutProperties(_this$asProps2, _excluded);
210
+ var SFeedbackRating = Modal;
211
+ var checkboxFields = formConfig.filter(function (item) {
212
+ return item.type === 'checkbox';
213
+ });
214
+ var textFields = formConfig.filter(function (item) {
215
+ return item.type === 'textarea' || item.type === 'input';
216
+ });
217
+ return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(Box, _assignProps2({}, _ref2), /*#__PURE__*/React.createElement(Notice, _ref4.cn("Notice", {
218
+ "visible": notificationVisible,
219
+ "aria-label": 'Leave feedback'
220
+ }), /*#__PURE__*/React.createElement(Notice.Label, {
221
+ mt: 1,
222
+ mr: 2,
223
+ "aria-hidden": true
224
+ }, /*#__PURE__*/React.createElement(FeedbackIllustration, _ref4.cn("FeedbackIllustration", {}))), /*#__PURE__*/React.createElement(Notice.Content, {
225
+ style: {
226
+ display: 'flex',
227
+ alignItems: 'center'
228
+ }
229
+ }, /*#__PURE__*/React.createElement(Text, _ref4.cn("Text", {
230
+ "mr": 3
231
+ }), notificationText), /*#__PURE__*/React.createElement(Notice.Actions, {
232
+ mt: 0
233
+ }, /*#__PURE__*/React.createElement(SliderRating, _ref4.cn("SliderRating", {
234
+ "value": rating,
235
+ "onChange": this.handleChangeRating,
236
+ "aria-label": notificationText
237
+ }))), learnMoreLink && /*#__PURE__*/React.createElement(Link, _ref4.cn("Link", {
238
+ "ml": 3,
239
+ "href": learnMoreLink
240
+ }), getI18nText('learnMore'))), /*#__PURE__*/React.createElement(Notice.CloseIcon, {
241
+ interactive: true,
242
+ onClick: onNotificationClose
243
+ }, /*#__PURE__*/React.createElement(CloseAltM, _ref4.cn("CloseAltM", {})))), /*#__PURE__*/React.createElement(SFeedbackRating, _ref4.cn("SFeedbackRating", _objectSpread({}, _assignProps({
244
+ "visible": visible,
245
+ "onClose": this.handelCloseModal,
246
+ "p": 0
247
+ }, _ref))), /*#__PURE__*/React.createElement(Form, _ref4.cn("Form", _objectSpread({
248
+ "decorators": [this.focusDecorator]
249
+ }, other)), function (api) {
250
+ var _ref5;
251
+ return _ref5 = sstyled(styles), /*#__PURE__*/React.createElement(SpinContainer, _ref5.cn("SpinContainer", {
252
+ "background": background,
253
+ "theme": theme,
254
+ "size": 'xl',
255
+ "loading": status !== 'loading' ? api.submitting : status === 'loading',
256
+ "p": 10
257
+ }), /*#__PURE__*/React.createElement(Flex, _ref5.cn("Flex", {
258
+ "justifyContent": 'center'
259
+ }), /*#__PURE__*/React.createElement(SliderRating, _ref5.cn("SliderRating", {
260
+ "value": rating,
261
+ "readonly": true
262
+ }))), header, /*#__PURE__*/React.createElement(Box, _ref5.cn("Box", _objectSpread(_objectSpread({
263
+ "tag": 'form',
264
+ "noValidate": true,
265
+ "method": 'POST',
266
+ "ref": forwardRef
267
+ }, other), {}, {
268
+ "onSubmit": api.handleSubmit,
269
+ "title": getI18nText('formTitle'),
270
+ "wMax": 320
271
+ })), /*#__PURE__*/React.createElement(FeedbackRating.Item, {
272
+ name: 'rating',
273
+ initialValue: rating
274
+ }, function (_ref9) {
275
+ var input = _ref9.input;
276
+ return /*#__PURE__*/React.createElement("input", _extends({}, input, {
277
+ type: "hidden"
278
+ }));
279
+ }), /*#__PURE__*/React.createElement("div", _ref5.cn("div", {
280
+ "role": 'group',
281
+ "aria-labelledby": _this2.headerId
282
+ }), /*#__PURE__*/React.createElement("ul", _ref5.cn("ul", {}), checkboxFields.map(function (formConfigItem) {
283
+ return _this2.renderCheckbox(formConfigItem);
284
+ }))), textFields.map(function (formConfigItem) {
285
+ return _this2.renderTextField(formConfigItem);
286
+ }), _this2.state.error && /*#__PURE__*/React.createElement(Notice, _ref5.cn("Notice", {
287
+ "theme": 'warning',
288
+ "mt": 4,
289
+ "mb": 4
290
+ }), /*#__PURE__*/React.createElement(Notice.Label, null, /*#__PURE__*/React.createElement(WarnM, _ref5.cn("WarnM", {}))), /*#__PURE__*/React.createElement(Notice.Content, null, getI18nText('errorMessage', {
291
+ email: errorFeedbackEmail
292
+ }))), /*#__PURE__*/React.createElement(Flex, _ref5.cn("Flex", {
293
+ "mt": 4,
294
+ "justifyContent": 'center'
295
+ }), /*#__PURE__*/React.createElement(FeedbackRating.Submit, {
296
+ loading: status !== 'loading' ? api.submitting : status === 'loading',
297
+ size: 'l'
298
+ }, submitText !== null && submitText !== void 0 ? submitText : getI18nText('submitButton')))));
299
+ })), /*#__PURE__*/React.createElement(NoticeBubbleContainer, _ref4.cn("NoticeBubbleContainer", {
300
+ "manager": this.manager
301
+ })));
302
+ }
303
+ }]);
304
+ return FeedbackRatingRoot;
305
+ }(Component);
306
+ _defineProperty(FeedbackRatingRoot, "displayName", 'FiveStarForm');
307
+ _defineProperty(FeedbackRatingRoot, "style", style);
308
+ _defineProperty(FeedbackRatingRoot, "enhance", [i18nEnhance(localizedMessages), uniqueIDEnhancement()]);
309
+ _defineProperty(FeedbackRatingRoot, "defaultProps", {
310
+ onSubmit: function onSubmit() {},
311
+ i18n: localizedMessages,
312
+ locale: 'en'
313
+ });
314
+ _defineProperty(FeedbackRatingRoot, "validate", {
315
+ description: function description(error) {
316
+ return function () {
317
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
318
+ var words = value.split(/\s+/);
319
+ var symbols = words.join(' ');
320
+ if (Boolean(value) && (symbols.length < 10 || words.length < 3)) {
321
+ return error;
322
+ }
323
+ };
324
+ },
325
+ email: function email(error) {
326
+ return function () {
327
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
328
+ if (Boolean(value) && !/.+@.+\..+/i.test(String(value).toLowerCase())) {
329
+ return error;
330
+ }
331
+ };
332
+ }
333
+ });
334
+ function Header(props) {
335
+ var _ref3 = arguments[0],
336
+ _ref6;
337
+ var styles = props.styles;
338
+ var SHeader = Text;
339
+ return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SHeader, _ref6.cn("SHeader", _objectSpread({}, _assignProps3({
340
+ "size": 300,
341
+ "tag": 'h2',
342
+ "mb": 4,
343
+ "mt": 4,
344
+ "textAlign": 'center'
345
+ }, _ref3))));
346
+ }
347
+ var FeedbackRating = createComponent(FeedbackRatingRoot, {
348
+ Header: Header,
349
+ Item: FeedbackItem,
350
+ Checkbox: CheckboxButton,
351
+ Submit: SubmitButton
352
+ });
353
+ export default FeedbackRating;
354
+ //# sourceMappingURL=FeedbackRating.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedbackRating.js","names":["React","createComponent","Component","sstyled","Root","Form","createFocusDecorator","SpinContainer","i18nEnhance","uniqueIDEnhancement","Notice","CloseAltM","CheckM","WarnM","Text","FeedbackIllustration","Link","SliderRating","Modal","Textarea","Box","Flex","FeedbackItem","SubmitButton","CheckboxButton","Input","localizedMessages","NoticeBubbleContainer","NoticeBubbleManager","style","_sstyled","insert","FeedbackRatingRoot","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","error","rating","asProps","onVisibleChange","fn","value","e","config","initialValue","props","initialValues","key","createElement","FeedbackRating","Item","name","type","tag","_ref7","input","Checkbox","_extends","id","label","onChange","handleChange","mb","size","mt","direction","htmlFor","validate","placement","flip","fallbackPlacements","_ref8","autoFocus","h","state","Value","description","lineHeight","color","_createClass","get","uid","getHeaderProps","headerId","getItemProps","validateOnBlur","componentDidUpdate","prevProps","_this$asProps","status","getI18nText","setState","manager","add","icon","children","initialAnimation","duration","render","_ref","_ref2","_ref4","_this2","_this$asProps2","header","submitText","formConfig","notificationText","learnMoreLink","Children","styles","forwardRef","theme","background","visible","notificationVisible","onNotificationClose","errorFeedbackEmail","other","_objectWithoutProperties","_excluded","SFeedbackRating","checkboxFields","filter","item","textFields","_assignProps2","cn","Label","mr","Content","display","alignItems","Actions","handleChangeRating","CloseIcon","interactive","onClick","_objectSpread","_assignProps","handelCloseModal","focusDecorator","api","_ref5","submitting","handleSubmit","_ref9","map","formConfigItem","renderCheckbox","renderTextField","email","Submit","loading","onSubmit","i18n","locale","undefined","words","split","symbols","join","Boolean","test","String","toLowerCase","Header","_ref3","arguments[0]","_ref6","SHeader","_assignProps3"],"sources":["../../../../src/component/feedback-rating/FeedbackRating.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Form } from 'react-final-form';\nimport createFocusDecorator from 'final-form-focus';\nimport SpinContainer from '@semcore/spin-container';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport { useI18n } from '@semcore/utils/lib/enhances/WithI18n';\nimport uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';\nimport Notice from '@semcore/notice';\nimport CloseAltM from '@semcore/icon/Close/m';\nimport CheckM from '@semcore/icon/Check/m';\nimport WarnM from '@semcore/icon/Warning/m';\nimport { Text } from '@semcore/typography';\nimport FeedbackIllustration from '@semcore/illustration/Feedback';\nimport Link from '@semcore/link';\nimport SliderRating from '../slider-rating/SliderRating';\nimport Modal from '@semcore/modal';\nimport Textarea from '@semcore/textarea';\nimport { Box, Flex } from '@semcore/flex-box';\nimport { FeedbackItem } from '../feedback-item/FeedbackItem';\nimport { SubmitButton } from '../submit-button/SubmitButton';\nimport { FeedbackRatingProps, FeedbackRatingType, FormConfigItem } from './FeedbackRating.type';\nimport CheckboxButton from '../checkbox-button/CheckboxButton';\nimport Input from '@semcore/input';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport { NoticeBubbleContainer, NoticeBubbleManager } from '@semcore/notice-bubble';\nimport style from '../../style/feedback-rating.shadow.css';\n\ntype Enhances = {\n getI18nText: ReturnType<typeof useI18n>;\n uid: ReturnType<typeof uniqueIDEnhancement>;\n};\n\ntype State = {\n error: boolean;\n};\n\nclass FeedbackRatingRoot extends Component<FeedbackRatingProps, {}, State, Enhances> {\n static displayName = 'FiveStarForm';\n static style = style;\n\n static enhance = [i18nEnhance(localizedMessages), uniqueIDEnhancement()];\n\n static defaultProps = {\n onSubmit: () => {},\n i18n: localizedMessages,\n locale: 'en',\n };\n\n static validate = {\n description: (error: Error | string) => (value = '') => {\n const words = value.split(/\\s+/);\n const symbols = words.join(' ');\n if (Boolean(value) && (symbols.length < 10 || words.length < 3)) {\n return error;\n }\n },\n email: (error: Error | string) => (value = '') => {\n if (Boolean(value) && !/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n state: State = {\n error: false,\n };\n\n manager = new NoticeBubbleManager();\n\n private focusDecorator = createFocusDecorator<Record<string, any>>();\n\n get headerId() {\n const { uid } = this.asProps;\n\n return `${uid}-feedback-rating-header`;\n }\n\n getHeaderProps() {\n return {\n id: this.headerId,\n };\n }\n\n getItemProps() {\n const { validateOnBlur } = this.asProps;\n\n return {\n validateOnBlur,\n };\n }\n\n handleChangeRating = (rating: number) => {\n this.asProps.onVisibleChange(true, rating);\n };\n\n handelCloseModal = () => {\n this.asProps.onVisibleChange(false, this.asProps.rating);\n };\n\n handleChange =\n (fn: (e: React.SyntheticEvent) => void) => (value: any, e: React.SyntheticEvent) => {\n fn(e);\n };\n\n componentDidUpdate(prevProps: Readonly<FeedbackRatingProps>) {\n const { status, getI18nText } = this.asProps;\n\n if (prevProps.status !== status) {\n this.setState({ error: false });\n\n if (status === 'success') {\n this.manager.add({\n icon: <CheckM color='green-400' />,\n children: getI18nText('successMessage'),\n initialAnimation: true,\n duration: 5000,\n });\n } else if (status === 'error') {\n this.setState({ error: true });\n }\n }\n }\n\n renderCheckbox = (config: FormConfigItem) => {\n const initialValue = this.props.initialValues[config.key];\n\n return (\n <FeedbackRating.Item\n name={config.key}\n initialValue={initialValue}\n type={'checkbox'}\n key={config.key}\n tag={'li'}\n >\n {({ input }) => (\n <FeedbackRating.Checkbox\n {...input}\n id={config.key}\n name={config.key}\n label={config.label}\n onChange={this.handleChange(input.onChange)}\n />\n )}\n </FeedbackRating.Item>\n );\n };\n\n renderTextField = (config: FormConfigItem) => {\n const initialValue = this.props.initialValues[config.key];\n\n const label =\n typeof config.label === 'string' ? (\n <Text mb={2} size={200}>\n {config.label}\n </Text>\n ) : (\n (config.label as unknown as JSX.Element)\n );\n\n return (\n <Flex tag='label' mt={4} direction='column' htmlFor={config.key} key={config.key}>\n {label}\n\n <FeedbackRating.Item\n name={config.key}\n validate={config.validate}\n initialValue={initialValue}\n placement='left-start'\n flip={{\n fallbackPlacements: ['right-start', 'bottom'],\n }}\n >\n {({ input }) => {\n if (config.type === 'textarea') {\n return (\n <Textarea\n {...input}\n autoFocus\n h={80}\n onChange={this.handleChange(input.onChange)}\n id={config.key}\n />\n );\n }\n if (config.type === 'input') {\n return (\n <Input state={input.state}>\n <Input.Value\n {...input}\n onChange={this.handleChange(input.onChange)}\n id={config.key}\n />\n </Input>\n );\n }\n return null;\n }}\n </FeedbackRating.Item>\n {config.description && (\n <Box mt={2}>\n {typeof config.description === 'string' ? (\n <Text lineHeight='18px' size={200} color='#6c6e79'>\n {config.description}\n </Text>\n ) : (\n config.description\n )}\n </Box>\n )}\n </Flex>\n );\n };\n\n render() {\n const {\n header,\n submitText,\n formConfig,\n notificationText,\n learnMoreLink,\n Children,\n styles,\n forwardRef,\n status,\n theme,\n background,\n rating,\n visible,\n onVisibleChange,\n notificationVisible,\n onNotificationClose,\n getI18nText,\n errorFeedbackEmail,\n ...other\n } = this.asProps;\n\n const SFeedbackRating = Root;\n const checkboxFields = formConfig.filter((item) => item.type === 'checkbox');\n const textFields = formConfig.filter(\n (item) => item.type === 'textarea' || item.type === 'input',\n );\n\n return sstyled(styles)(\n <Root render={Box}>\n <Notice visible={notificationVisible} aria-label={'Leave feedback'}>\n <Notice.Label mt={1} mr={2} aria-hidden={true}>\n <FeedbackIllustration />\n </Notice.Label>\n <Notice.Content style={{ display: 'flex', alignItems: 'center' }}>\n <Text mr={3}>{notificationText}</Text>\n <Notice.Actions mt={0}>\n <SliderRating\n value={rating}\n onChange={this.handleChangeRating}\n aria-label={notificationText}\n />\n </Notice.Actions>\n {learnMoreLink && (\n <Link ml={3} href={learnMoreLink}>\n {getI18nText('learnMore')}\n </Link>\n )}\n </Notice.Content>\n <Notice.CloseIcon interactive onClick={onNotificationClose}>\n <CloseAltM />\n </Notice.CloseIcon>\n </Notice>\n\n <SFeedbackRating render={Modal} visible={visible} onClose={this.handelCloseModal} p={0}>\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer\n background={background}\n theme={theme}\n size='xl'\n loading={status !== 'loading' ? api.submitting : status === 'loading'}\n p={10}\n >\n <Flex justifyContent='center'>\n <SliderRating value={rating} readonly={true} />\n </Flex>\n\n {header as any}\n\n <Box\n tag='form'\n noValidate\n method='POST'\n ref={forwardRef}\n {...other}\n onSubmit={api.handleSubmit}\n title={getI18nText('formTitle')}\n wMax={320}\n >\n <FeedbackRating.Item name={'rating'} initialValue={rating}>\n {({ input }) => {\n return <input {...input} type='hidden' />;\n }}\n </FeedbackRating.Item>\n\n <div role={'group'} aria-labelledby={this.headerId}>\n <ul>\n {checkboxFields.map((formConfigItem) =>\n this.renderCheckbox(formConfigItem),\n )}\n </ul>\n </div>\n\n {textFields.map((formConfigItem) => this.renderTextField(formConfigItem))}\n\n {this.state.error && (\n <Notice theme={'warning'} mt={4} mb={4}>\n <Notice.Label>\n <WarnM />\n </Notice.Label>\n <Notice.Content>\n {getI18nText('errorMessage', { email: errorFeedbackEmail })}\n </Notice.Content>\n </Notice>\n )}\n\n <Flex mt={4} justifyContent={'center'}>\n <FeedbackRating.Submit\n loading={status !== 'loading' ? api.submitting : status === 'loading'}\n size={'l'}\n >\n {submitText ?? getI18nText('submitButton')}\n </FeedbackRating.Submit>\n </Flex>\n </Box>\n </SpinContainer>,\n )\n }\n </Form>\n </SFeedbackRating>\n\n <NoticeBubbleContainer manager={this.manager} />\n </Root>,\n );\n }\n}\n\nfunction Header(props: any) {\n const { styles } = props;\n const SHeader = Root;\n return sstyled(styles)(\n <SHeader render={Text} size={300} tag='h2' mb={4} mt={4} textAlign={'center'} />,\n );\n}\n\nconst FeedbackRating: typeof FeedbackRatingType & { validate: typeof FeedbackRatingRoot.validate } =\n createComponent(FeedbackRatingRoot, {\n Header,\n Item: FeedbackItem,\n Checkbox: CheckboxButton,\n Submit: SubmitButton,\n });\n\nexport default FeedbackRating;\n"],"mappings":";;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,IAAI,QAAQ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MAAA,IAAfK,KAAK,GAAAf,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAmI,SAAA,GAAAnI,SAAA,MAAG,EAAE;MAC3C,IAAIwI,OAAO,CAACzH,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC0H,IAAI,CAACC,MAAM,CAAC3H,KAAK,CAAC,CAAC4H,WAAW,EAAE,CAAC,EAAE;QACrE,OAAOjI,KAAK;MACd;IACF,CAAC;EAAA;AACH,CAAC;AA0RH,SAASkI,MAAMA,CAACzH,KAAU,EAAE;EAAA,IAAA0H,KAAA,GAAAC,YAAA;IAAAC,KAAA;EAC1B,IAAQ3D,MAAM,GAAKjE,KAAK,CAAhBiE,MAAM;EACd,IAAM4D,OAAO,GAEM1K,IAAI;EADvB,OAAAyK,KAAA,GAAOpL,OAAO,CAACyH,MAAM,CAAC,eACpB5H,KAAA,CAAA8D,aAAA,CAAC0H,OAAO,EAAAD,KAAA,CAAA1C,EAAA,YAAAW,aAAA,KAAAiC,aAAA;IAAA,QAAqB,GAAG;IAAA,OAAM,IAAI;IAAA,MAAK,CAAC;IAAA,MAAM,CAAC;IAAA,aAAa;EAAQ,GAAAJ,KAAA,IAAI;AAEpF;AAEA,IAAMtH,cAA4F,GAChG9D,eAAe,CAAC+B,kBAAkB,EAAE;EAClCoJ,MAAM,EAANA,MAAM;EACNpH,IAAI,EAAE1C,YAAY;EAClBgD,QAAQ,EAAE9C,cAAc;EACxB8I,MAAM,EAAE/I;AACV,CAAC,CAAC;AAEJ,eAAewC,cAAc"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=FeedbackRating.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedbackRating.type.js","names":[],"sources":["../../../../src/component/feedback-rating/FeedbackRating.type.ts"],"sourcesContent":["import React from 'react';\nimport { FeedbackFormProps } from '../../index';\nimport { FieldProps } from 'react-final-form';\n\nimport { Intergalactic } from '@semcore/core';\nimport Button from '@semcore/button';\nimport { Text } from '@semcore/typography';\nimport Checkbox from '@semcore/checkbox';\n\nexport type FormConfigItem = {\n key: string;\n label: React.ReactNode;\n type: 'input' | 'checkbox' | 'textarea';\n description?: React.ReactNode;\n validate?: (value: any) => Error | string | undefined;\n};\n\nexport type FeedbackRatingProps = Intergalactic.InternalTypings.EfficientOmit<\n FeedbackFormProps,\n 'initialValues' | 'loading'\n> & {\n /** status of form */\n status: 'default' | 'success' | 'error' | 'loading';\n\n /** flag for show/hide notification */\n notificationVisible: boolean;\n /** */\n onNotificationClose: () => void;\n /** text in notification panel */\n notificationText: string;\n /** optional link in notification panel */\n learnMoreLink?: string;\n /** rating value */\n rating: number;\n /** visible modal form flag */\n visible: boolean;\n\n onVisibleChange: (visible: boolean, rating: number) => void;\n\n /** header of modal with form */\n header: React.ReactNode;\n /** text for submit button of form */\n submitText?: string;\n /** config for form fields */\n formConfig: FormConfigItem[];\n\n initialValues: Record<string, any> & { rating: number };\n\n errorFeedbackEmail: string;\n\n locale?: string;\n};\n\nexport type FeedbackRatingItemProps = FieldProps<any, any> & {\n /**\n * Allows to override which passed props will be passed to the Tooltip component.\n */\n tooltipProps?: string[];\n};\n\ndeclare const FeedbackRatingType: Intergalactic.Component<'form', FeedbackRatingProps> & {\n Item: Intergalactic.Component<'div', FeedbackRatingItemProps>;\n Submit: typeof Button;\n Checkbox: typeof Checkbox;\n Header: typeof Text;\n};\n\nexport { FeedbackRatingType };\n"],"mappings":""}
@@ -0,0 +1,165 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ import _createSuper from "@babel/runtime/helpers/createSuper";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ import { sstyled as _sstyled } from 'intergalactic/utils/lib/core/index';
9
+ import { assignProps as _assignProps2 } from 'intergalactic/core';
10
+ import { assignProps as _assignProps } from 'intergalactic/core';
11
+ import React from 'react';
12
+ import createComponent, { Component, Root, sstyled } from 'intergalactic/core';
13
+ import { Flex, Box } from 'intergalactic/flex-box';
14
+ /*__reshadow-styles__:"../../style/slider-rating.shadow.css"*/
15
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SSliderRating_mkvmh_gg_ .___SStar_mkvmh_gg_{transition:all calc(var(--intergalactic-duration-control, 200)*1ms) ease-out}@media (hover:hover){.___SSliderRating_mkvmh_gg_ .___SStar_mkvmh_gg_:hover{cursor:pointer;transform:scale(1.3)}}.___SSliderRating_mkvmh_gg_.__keyboardFocused_mkvmh_gg_{outline:0;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}@media (hover:hover){.___SSliderRating_mkvmh_gg_.__readonly_mkvmh_gg_ .___SStar_mkvmh_gg_:hover{cursor:default;transform:none;transition:none}}.___SStar_mkvmh_gg_.__filled_mkvmh_gg_:active{animation:wobble .8s ease-in-out}.___SStar_mkvmh_gg_ path{fill:transparent;stroke:var(--intergalactic-slider-rating-normal, #a9abb6);stroke-width:2}.___SStar_mkvmh_gg_.__filled_mkvmh_gg_ path{stroke-width:0;fill:var(--intergalactic-slider-rating-hover-active, #fdc23c)}" /*__inner_css_end__*/, "mkvmh_gg_") /*__reshadow_css_end__*/, {
16
+ "__SSliderRating": "___SSliderRating_mkvmh_gg_",
17
+ "__SStar": "___SStar_mkvmh_gg_",
18
+ "_keyboardFocused": "__keyboardFocused_mkvmh_gg_",
19
+ "_readonly": "__readonly_mkvmh_gg_",
20
+ "_filled": "__filled_mkvmh_gg_"
21
+ });
22
+ import keyboardFocusEnhance from 'intergalactic/utils/lib/enhances/keyboardFocusEnhance';
23
+ var MIN = 1;
24
+ var MAX = 5;
25
+ var SliderRatingRoot = /*#__PURE__*/function (_Component) {
26
+ _inherits(SliderRatingRoot, _Component);
27
+ var _super = _createSuper(SliderRatingRoot);
28
+ function SliderRatingRoot() {
29
+ var _this;
30
+ _classCallCheck(this, SliderRatingRoot);
31
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
32
+ args[_key] = arguments[_key];
33
+ }
34
+ _this = _super.call.apply(_super, [this].concat(args));
35
+ _defineProperty(_assertThisInitialized(_this), "state", {
36
+ hoveredIndex: -1,
37
+ clickedIndex: -1
38
+ });
39
+ _defineProperty(_assertThisInitialized(_this), "handleClick", function (newValue) {
40
+ return function (e) {
41
+ var readonly = _this.asProps.readonly;
42
+ if (!readonly) {
43
+ _this.setValue(newValue);
44
+ }
45
+ };
46
+ });
47
+ _defineProperty(_assertThisInitialized(_this), "handleMouseEnder", function (index) {
48
+ return function () {
49
+ _this.setState({
50
+ hoveredIndex: index
51
+ });
52
+ };
53
+ });
54
+ _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function () {
55
+ _this.setState({
56
+ hoveredIndex: -1
57
+ });
58
+ });
59
+ _defineProperty(_assertThisInitialized(_this), "setValue", function (newValue) {
60
+ var _this$asProps = _this.asProps,
61
+ onChange = _this$asProps.onChange,
62
+ value = _this$asProps.value;
63
+ if (onChange) {
64
+ onChange(newValue);
65
+ }
66
+ if (newValue <= value) {
67
+ _this.setState({
68
+ clickedIndex: newValue
69
+ });
70
+ } else {
71
+ _this.setState({
72
+ clickedIndex: -1
73
+ });
74
+ }
75
+ });
76
+ _defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
77
+ if (!['ArrowLeft', 'ArrowRight', 'Enter'].includes(event.key)) return;
78
+ event.preventDefault();
79
+ if (event.key === 'Enter') {
80
+ var hoveredIndex = _this.state.hoveredIndex;
81
+ _this.setValue(hoveredIndex + 1);
82
+ } else {
83
+ var _value = _this.asProps.value;
84
+ var _hoveredIndex = _this.state.hoveredIndex;
85
+ var direction = event.key === 'ArrowLeft' ? -1 : 1;
86
+ var newValue = _hoveredIndex === -1 ? _value + direction : _hoveredIndex + 1 + direction;
87
+ if (newValue > MAX) newValue = MAX;
88
+ if (newValue < MIN) newValue = MIN;
89
+ _this.setState({
90
+ hoveredIndex: newValue - 1
91
+ });
92
+ }
93
+ });
94
+ return _this;
95
+ }
96
+ _createClass(SliderRatingRoot, [{
97
+ key: "getStarProps",
98
+ value: function getStarProps(_, index) {
99
+ var _this$asProps2 = this.asProps,
100
+ value = _this$asProps2.value,
101
+ readonly = _this$asProps2.readonly;
102
+ var hoveredIndex = this.state.hoveredIndex;
103
+ return {
104
+ filled: value ? index + 1 <= value || index <= hoveredIndex : index <= hoveredIndex,
105
+ onClick: this.handleClick(index + 1),
106
+ onMouseEnter: readonly ? undefined : this.handleMouseEnder(index)
107
+ };
108
+ }
109
+ }, {
110
+ key: "render",
111
+ value: function render() {
112
+ var _ref = this.asProps,
113
+ _ref3;
114
+ var _this$asProps3 = this.asProps,
115
+ styles = _this$asProps3.styles,
116
+ value = _this$asProps3.value;
117
+ var hoveredIndex = this.state.hoveredIndex;
118
+ var SSliderRating = Flex;
119
+ var label = value ? value : hoveredIndex === -1 ? 'Not set' : hoveredIndex + 1;
120
+ return _ref3 = sstyled(styles), /*#__PURE__*/React.createElement(SSliderRating, _ref3.cn("SSliderRating", _objectSpread({}, _assignProps({
121
+ "gap": 1,
122
+ "onMouseLeave": this.handleMouseLeave,
123
+ "onKeyDown": this.handleKeyDown,
124
+ "role": 'slider',
125
+ "aria-orientation": 'horizontal',
126
+ "aria-valuemin": MIN,
127
+ "aria-valuemax": MAX,
128
+ "aria-valuetext": label,
129
+ "aria-valuenow": hoveredIndex + 1
130
+ }, _ref))), new Array(MAX).fill(null).map(function (_, index) {
131
+ return /*#__PURE__*/React.createElement(Box, {
132
+ key: index,
133
+ position: 'relative'
134
+ }, /*#__PURE__*/React.createElement(SliderRating.Star, null));
135
+ }));
136
+ }
137
+ }]);
138
+ return SliderRatingRoot;
139
+ }(Component);
140
+ _defineProperty(SliderRatingRoot, "displayName", 'SliderRating');
141
+ _defineProperty(SliderRatingRoot, "style", style);
142
+ _defineProperty(SliderRatingRoot, "enhance", [keyboardFocusEnhance()]);
143
+ function Star(props) {
144
+ var _ref2 = arguments[0],
145
+ _ref4;
146
+ var SStar = Box;
147
+ return _ref4 = sstyled(props.styles), /*#__PURE__*/React.createElement(SStar, _ref4.cn("SStar", _objectSpread({}, _assignProps2({
148
+ "tag": 'svg',
149
+ "width": '22',
150
+ "height": '21',
151
+ "viewBox": '0 0 22 21',
152
+ "fill": 'none',
153
+ "xmlns": 'http://www.w3.org/2000/svg'
154
+ }, _ref2))), props.filled ? /*#__PURE__*/React.createElement("path", _ref4.cn("path", {
155
+ "d": 'M10.6463 0.213566C10.7963 -0.0711885 11.2037 -0.071189 11.3537 0.213566L14.6682 6.50744L21.668 7.72084C21.9847 7.77572 22.1105 8.16305 21.8867 8.39378L16.9353 13.4978L17.9465 20.5422C17.9922 20.8607 17.6626 21.1002 17.3741 20.9581L11 17.8181L4.62585 20.9581C4.33738 21.1002 4.00781 20.8607 4.05353 20.5422L5.0647 13.4978L0.113338 8.39378C-0.110493 8.16305 0.0153421 7.77572 0.331965 7.72084L7.33178 6.50744L10.6463 0.213566Z'
156
+ })) : /*#__PURE__*/React.createElement("path", _ref4.cn("path", {
157
+ "d": 'M13.7834 6.9734L14.0127 7.40871L14.4974 7.49274L20.3785 8.51222L16.2175 12.8015L15.8757 13.1539L15.9454 13.6399L16.7949 19.558L11.4419 16.921L11 16.7033L10.5581 16.921L5.20505 19.558L6.05456 13.6399L6.12432 13.1539L5.78246 12.8015L1.62146 8.51222L7.50258 7.49274L7.98734 7.40871L8.21659 6.9734L11 1.68803L13.7834 6.9734ZM21.4972 8.70614C21.4969 8.70608 21.4965 8.70602 21.4961 8.70595L21.4972 8.70614ZM0.502765 8.70614L0.503758 8.70597C0.503427 8.70603 0.503095 8.70609 0.502764 8.70614L0.400352 8.11535L0.502765 8.70614Z'
158
+ })));
159
+ }
160
+ Star.displayName = 'Star';
161
+ var SliderRating = createComponent(SliderRatingRoot, {
162
+ Star: Star
163
+ });
164
+ export default SliderRating;
165
+ //# sourceMappingURL=SliderRating.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SliderRating.js","names":["React","createComponent","Component","Root","sstyled","Flex","Box","style","_sstyled","insert","keyboardFocusEnhance","MIN","MAX","SliderRatingRoot","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","hoveredIndex","clickedIndex","newValue","e","readonly","asProps","setValue","index","setState","_this$asProps","onChange","value","event","includes","key","preventDefault","state","direction","_createClass","getStarProps","_","_this$asProps2","filled","onClick","handleClick","onMouseEnter","undefined","handleMouseEnder","render","_ref","_ref3","_this$asProps3","styles","SSliderRating","label","createElement","cn","_objectSpread","_assignProps","handleMouseLeave","handleKeyDown","fill","map","position","SliderRating","Star","props","_ref2","arguments[0]","_ref4","SStar","_assignProps2","displayName"],"sources":["../../../../src/component/slider-rating/SliderRating.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, Root, sstyled, Intergalactic } from '@semcore/core';\nimport { Flex, Box, BoxProps } from '@semcore/flex-box';\nimport style from '../../style/slider-rating.shadow.css';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\ntype SliderRatingProps = {\n value: number;\n onChange?: (value: number) => void;\n readonly?: boolean;\n};\n\ntype State = {\n hoveredIndex: number;\n clickedIndex: number;\n};\n\ntype StarProps = BoxProps & {\n filled?: boolean;\n};\n\nconst MIN = 1;\nconst MAX = 5;\n\nclass SliderRatingRoot extends Component<SliderRatingProps, State> {\n static displayName = 'SliderRating';\n static style = style;\n\n static enhance = [keyboardFocusEnhance()];\n\n state: State = {\n hoveredIndex: -1,\n clickedIndex: -1,\n };\n\n handleClick = (newValue: number) => (e: React.SyntheticEvent<SVGElement>) => {\n const { readonly } = this.asProps;\n\n if (!readonly) {\n this.setValue(newValue);\n }\n };\n\n handleMouseEnder = (index: number) => () => {\n this.setState({ hoveredIndex: index });\n };\n\n handleMouseLeave = () => {\n this.setState({ hoveredIndex: -1 });\n };\n\n getStarProps(_: any, index: number) {\n const { value, readonly } = this.asProps;\n const { hoveredIndex } = this.state;\n\n return {\n filled: value ? index + 1 <= value || index <= hoveredIndex : index <= hoveredIndex,\n onClick: this.handleClick(index + 1),\n onMouseEnter: readonly ? undefined : this.handleMouseEnder(index),\n };\n }\n\n setValue = (newValue: number) => {\n const { onChange, value } = this.asProps;\n\n if (onChange) {\n onChange(newValue);\n }\n\n if (newValue <= value) {\n this.setState({ clickedIndex: newValue });\n } else {\n this.setState({ clickedIndex: -1 });\n }\n };\n\n handleKeyDown = (event: React.KeyboardEvent) => {\n if (!['ArrowLeft', 'ArrowRight', 'Enter'].includes(event.key)) return;\n event.preventDefault();\n\n if (event.key === 'Enter') {\n const { hoveredIndex } = this.state;\n\n this.setValue(hoveredIndex + 1);\n } else {\n const { value } = this.asProps;\n const { hoveredIndex } = this.state;\n\n const direction = event.key === 'ArrowLeft' ? -1 : 1;\n let newValue = hoveredIndex === -1 ? value + direction : hoveredIndex + 1 + direction;\n\n if (newValue > MAX) newValue = MAX;\n if (newValue < MIN) newValue = MIN;\n\n this.setState({ hoveredIndex: newValue - 1 });\n }\n };\n\n render() {\n const { styles, value } = this.asProps;\n const { hoveredIndex } = this.state;\n const SSliderRating = Root;\n\n const label = value ? value : hoveredIndex === -1 ? 'Not set' : hoveredIndex + 1;\n\n return sstyled(styles)(\n <SSliderRating\n render={Flex}\n gap={1}\n onMouseLeave={this.handleMouseLeave}\n onKeyDown={this.handleKeyDown}\n role='slider'\n aria-orientation='horizontal'\n aria-valuemin={MIN}\n aria-valuemax={MAX}\n aria-valuetext={label}\n aria-valuenow={hoveredIndex + 1}\n >\n {new Array(MAX).fill(null).map((_, index) => {\n return (\n <Box key={index} position={'relative'}>\n <SliderRating.Star />\n </Box>\n );\n })}\n </SSliderRating>,\n );\n }\n}\n\nfunction Star(props: StarProps) {\n const SStar = Root;\n return sstyled(props.styles)(\n <SStar\n render={Box}\n tag={'svg'}\n width='22'\n height='21'\n viewBox='0 0 22 21'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n {props.filled ? (\n <path\n d='M10.6463 0.213566C10.7963 -0.0711885 11.2037 -0.071189 11.3537 0.213566L14.6682 6.50744L21.668 7.72084C21.9847 7.77572 22.1105 8.16305 21.8867 8.39378L16.9353 13.4978L17.9465 20.5422C17.9922 20.8607 17.6626 21.1002 17.3741 20.9581L11 17.8181L4.62585 20.9581C4.33738 21.1002 4.00781 20.8607 4.05353 20.5422L5.0647 13.4978L0.113338 8.39378C-0.110493 8.16305 0.0153421 7.77572 0.331965 7.72084L7.33178 6.50744L10.6463 0.213566Z'\n // fill='#FDC23C'\n />\n ) : (\n <path\n d='M13.7834 6.9734L14.0127 7.40871L14.4974 7.49274L20.3785 8.51222L16.2175 12.8015L15.8757 13.1539L15.9454 13.6399L16.7949 19.558L11.4419 16.921L11 16.7033L10.5581 16.921L5.20505 19.558L6.05456 13.6399L6.12432 13.1539L5.78246 12.8015L1.62146 8.51222L7.50258 7.49274L7.98734 7.40871L8.21659 6.9734L11 1.68803L13.7834 6.9734ZM21.4972 8.70614C21.4969 8.70608 21.4965 8.70602 21.4961 8.70595L21.4972 8.70614ZM0.502765 8.70614L0.503758 8.70597C0.503427 8.70603 0.503095 8.70609 0.502764 8.70614L0.400352 8.11535L0.502765 8.70614Z'\n // stroke='#A9ABB6'\n // strokeWidth='2'\n />\n )}\n </SStar>,\n );\n}\nStar.displayName = 'Star';\n\nconst SliderRating = createComponent(SliderRatingRoot, {\n Star,\n}) as Intergalactic.Component<typeof Flex, SliderRatingProps> & {\n Star: Intergalactic.Component<typeof Box, StarProps>;\n};\n\nexport default SliderRating;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAAuB,eAAe;AACxF,SAASC,IAA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AC9B,IAAMC,KAAK,GAGC3E,GAAG;EAFf,OAAA0E,KAAA,GAAO5E,OAAO,CAACyE,KAAK,CAACd,MAAM,CAAC,eAC1B/D,KAAA,CAAAkE,aAAA,CAACe,KAAK,EAAAD,KAAA,CAAAb,EAAA,UAAAC,aAAA,KAAAc,aAAA;IAAA,OAEC,KAAK;IAAA,SACJ,IAAI;IAAA,UACH,IAAI;IAAA,WACH,WAAW;IAAA,QACd,MAAM;IAAA,SACL;EAA4B,GAAAJ,KAAA,KAEjCD,KAAK,CAACxB,MAAM,gBACXrD,KAAA,CAAAkE,aAAA,SAAAc,KAAA,CAAAb,EAAA;IAAA,KACI;EAA0a,GAE5a,gBAEFnE,KAAA,CAAAkE,aAAA,SAAAc,KAAA,CAAAb,EAAA;IAAA,KACI;EAA2gB,GAIhhB,CACK;AAEZ;AACAS,IAAI,CAACO,WAAW,GAAG,MAAM;AAEzB,IAAMR,YAAY,GAAG1E,eAAe,CAACY,gBAAgB,EAAE;EACrD+D,IAAI,EAAJA;AACF,CAAC,CAEA;AAED,eAAeD,YAAY"}
@@ -0,0 +1,17 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import { assignProps as _assignProps } from 'intergalactic/core';
3
+ import Button from 'intergalactic/button';
4
+ import React from 'react';
5
+ import { Root, sstyled } from 'intergalactic/core';
6
+ export function SubmitButton(props) {
7
+ var _ref = arguments[0],
8
+ _ref2;
9
+ var styles = props.styles;
10
+ var SSubmit = Button;
11
+ return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SSubmit, _ref2.cn("SSubmit", _objectSpread({}, _assignProps({
12
+ "type": 'submit',
13
+ "use": 'primary',
14
+ "theme": 'success'
15
+ }, _ref))));
16
+ }
17
+ //# sourceMappingURL=SubmitButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubmitButton.js","names":["Button","React","Root","sstyled","SubmitButton","props","_ref","arguments[0]","_ref2","styles","SSubmit","createElement","cn","_objectSpread","_assignProps"],"sources":["../../../../src/component/submit-button/SubmitButton.tsx"],"sourcesContent":["import Button from '@semcore/button';\nimport React from 'react';\nimport { Root, sstyled, IRootComponentProps } from '@semcore/core';\n\nexport function SubmitButton(props: IRootComponentProps) {\n const { styles } = props;\n const SSubmit = Root;\n return sstyled(styles)(<SSubmit render={Button} type='submit' use='primary' theme='success' />);\n}\n"],"mappings":";;AAAA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,OAAO,QAA6B,eAAe;AAElE,OAAO,SAASC,YAAYA,CAACC,KAA0B,EAAE;EAAA,IAAAC,IAAA,GAAAC,YAAA;IAAAC,KAAA;EACvD,IAAQC,MAAM,GAAKJ,KAAK,CAAhBI,MAAM;EACd,IAAMC,OAAO,GAC2BV,MAAM;EAA9C,OAAAQ,KAAA,GAAOL,OAAO,CAACM,MAAM,CAAC,eAACR,KAAA,CAAAU,aAAA,CAACD,OAAO,EAAAF,KAAA,CAAAI,EAAA,YAAAC,aAAA,KAAAC,YAAA;IAAA,QAAsB,QAAQ;IAAA,OAAK,SAAS;IAAA,SAAO;EAAS,GAAAR,IAAA,IAAG;AAChG"}