@chayns-components/core 5.0.0-beta.16 → 5.0.0-beta.160

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 (179) hide show
  1. package/README.md +3 -9
  2. package/lib/components/accordion/Accordion.d.ts +41 -2
  3. package/lib/components/accordion/Accordion.js +73 -75
  4. package/lib/components/accordion/Accordion.js.map +1 -1
  5. package/lib/components/accordion/Accordion.styles.d.ts +3 -2
  6. package/lib/components/accordion/Accordion.styles.js +67 -26
  7. package/lib/components/accordion/Accordion.styles.js.map +1 -1
  8. package/lib/components/accordion/accordion-body/AccordionBody.d.ts +13 -2
  9. package/lib/components/accordion/accordion-body/AccordionBody.js +19 -11
  10. package/lib/components/accordion/accordion-body/AccordionBody.js.map +1 -1
  11. package/lib/components/accordion/accordion-body/AccordionBody.styles.d.ts +4 -1
  12. package/lib/components/accordion/accordion-body/AccordionBody.styles.js +15 -10
  13. package/lib/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  14. package/lib/components/accordion/accordion-content/AccordionContent.d.ts +16 -2
  15. package/lib/components/accordion/accordion-content/AccordionContent.js +13 -11
  16. package/lib/components/accordion/accordion-content/AccordionContent.js.map +1 -1
  17. package/lib/components/accordion/accordion-content/AccordionContent.styles.d.ts +2 -1
  18. package/lib/components/accordion/accordion-content/AccordionContent.styles.js +24 -14
  19. package/lib/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
  20. package/lib/components/accordion/accordion-group/AccordionGroup.d.ts +10 -2
  21. package/lib/components/accordion/accordion-group/AccordionGroup.js +31 -44
  22. package/lib/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
  23. package/lib/components/accordion/accordion-head/AccordionHead.d.ts +5 -2
  24. package/lib/components/accordion/accordion-head/AccordionHead.js +74 -58
  25. package/lib/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  26. package/lib/components/accordion/accordion-head/AccordionHead.styles.d.ts +9 -1
  27. package/lib/components/accordion/accordion-head/AccordionHead.styles.js +138 -45
  28. package/lib/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
  29. package/lib/components/accordion/accordion-intro/AccordionIntro.d.ts +9 -0
  30. package/lib/components/accordion/accordion-intro/AccordionIntro.js +21 -0
  31. package/lib/components/accordion/accordion-intro/AccordionIntro.js.map +1 -0
  32. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.d.ts +1 -0
  33. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js +13 -0
  34. package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js.map +1 -0
  35. package/lib/components/accordion/utils.js +10 -12
  36. package/lib/components/accordion/utils.js.map +1 -1
  37. package/lib/components/amount-control/AmountControl.d.ts +21 -0
  38. package/lib/components/amount-control/AmountControl.js +102 -0
  39. package/lib/components/amount-control/AmountControl.js.map +1 -0
  40. package/lib/components/amount-control/AmountControl.styles.d.ts +11 -0
  41. package/lib/components/amount-control/AmountControl.styles.js +50 -0
  42. package/lib/components/amount-control/AmountControl.styles.js.map +1 -0
  43. package/lib/components/amount-control/utils/amountControl.d.ts +7 -0
  44. package/lib/components/amount-control/utils/amountControl.js +22 -0
  45. package/lib/components/amount-control/utils/amountControl.js.map +1 -0
  46. package/lib/components/badge/Badge.d.ts +9 -1
  47. package/lib/components/badge/Badge.js +12 -12
  48. package/lib/components/badge/Badge.js.map +1 -1
  49. package/lib/components/badge/Badge.styles.d.ts +4 -1
  50. package/lib/components/badge/Badge.styles.js +22 -15
  51. package/lib/components/badge/Badge.styles.js.map +1 -1
  52. package/lib/components/button/Button.d.ts +2 -2
  53. package/lib/components/button/Button.js +12 -20
  54. package/lib/components/button/Button.js.map +1 -1
  55. package/lib/components/button/Button.styles.js +46 -23
  56. package/lib/components/button/Button.styles.js.map +1 -1
  57. package/lib/components/checkbox/Checkbox.d.ts +25 -0
  58. package/lib/components/checkbox/Checkbox.js +44 -0
  59. package/lib/components/checkbox/Checkbox.js.map +1 -0
  60. package/lib/components/checkbox/Checkbox.styles.d.ts +6 -0
  61. package/lib/components/checkbox/Checkbox.styles.js +131 -0
  62. package/lib/components/checkbox/Checkbox.styles.js.map +1 -0
  63. package/lib/components/color-scheme-provider/ColorSchemeProvider.d.ts +2 -2
  64. package/lib/components/color-scheme-provider/ColorSchemeProvider.js +44 -81
  65. package/lib/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  66. package/lib/components/color-scheme-provider/font.d.ts +6 -0
  67. package/lib/components/color-scheme-provider/font.js +59 -0
  68. package/lib/components/color-scheme-provider/font.js.map +1 -0
  69. package/lib/components/context-menu/ContextMenu.d.ts +51 -0
  70. package/lib/components/context-menu/ContextMenu.js +157 -0
  71. package/lib/components/context-menu/ContextMenu.js.map +1 -0
  72. package/lib/components/context-menu/ContextMenu.styles.d.ts +1 -0
  73. package/lib/components/context-menu/ContextMenu.styles.js +13 -0
  74. package/lib/components/context-menu/ContextMenu.styles.js.map +1 -0
  75. package/lib/components/context-menu/constants/alignment.d.ts +8 -0
  76. package/lib/components/context-menu/constants/alignment.js +17 -0
  77. package/lib/components/context-menu/constants/alignment.js.map +1 -0
  78. package/lib/components/context-menu/context-menu-content/ContextMenuContent.d.ts +10 -0
  79. package/lib/components/context-menu/context-menu-content/ContextMenuContent.js +78 -0
  80. package/lib/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -0
  81. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +11 -0
  82. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js +117 -0
  83. package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -0
  84. package/lib/components/grid-image/GridImage.d.ts +2 -2
  85. package/lib/components/grid-image/GridImage.js +15 -52
  86. package/lib/components/grid-image/GridImage.js.map +1 -1
  87. package/lib/components/grid-image/GridImage.styles.d.ts +3 -3
  88. package/lib/components/grid-image/GridImage.styles.js +82 -38
  89. package/lib/components/grid-image/GridImage.styles.js.map +1 -1
  90. package/lib/components/icon/Icon.d.ts +3 -3
  91. package/lib/components/icon/Icon.js +22 -34
  92. package/lib/components/icon/Icon.js.map +1 -1
  93. package/lib/components/icon/Icon.styles.d.ts +1 -1
  94. package/lib/components/icon/Icon.styles.js +61 -39
  95. package/lib/components/icon/Icon.styles.js.map +1 -1
  96. package/lib/components/icon/utils.js +2 -5
  97. package/lib/components/icon/utils.js.map +1 -1
  98. package/lib/components/input/Input.d.ts +37 -0
  99. package/lib/components/input/Input.js +75 -0
  100. package/lib/components/input/Input.js.map +1 -0
  101. package/lib/components/input/Input.styles.d.ts +7 -0
  102. package/lib/components/input/Input.styles.js +71 -0
  103. package/lib/components/input/Input.styles.js.map +1 -0
  104. package/lib/components/list/List.d.ts +1 -1
  105. package/lib/components/list/List.js +26 -63
  106. package/lib/components/list/List.js.map +1 -1
  107. package/lib/components/list/list-item/ListItem.d.ts +11 -2
  108. package/lib/components/list/list-item/ListItem.js +36 -52
  109. package/lib/components/list/list-item/ListItem.js.map +1 -1
  110. package/lib/components/list/list-item/ListItem.styles.js +44 -26
  111. package/lib/components/list/list-item/ListItem.styles.js.map +1 -1
  112. package/lib/components/list/list-item/list-item-body/ListItemBody.js +8 -8
  113. package/lib/components/list/list-item/list-item-body/ListItemBody.js.map +1 -1
  114. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js +3 -9
  115. package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js.map +1 -1
  116. package/lib/components/list/list-item/list-item-content/ListItemContent.js +4 -7
  117. package/lib/components/list/list-item/list-item-content/ListItemContent.js.map +1 -1
  118. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js +8 -11
  119. package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js.map +1 -1
  120. package/lib/components/list/list-item/list-item-head/ListItemHead.d.ts +3 -2
  121. package/lib/components/list/list-item/list-item-head/ListItemHead.js +45 -91
  122. package/lib/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
  123. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +2 -11
  124. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js +89 -79
  125. package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  126. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.d.ts +6 -0
  127. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js +23 -0
  128. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js.map +1 -0
  129. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.d.ts +1 -0
  130. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js +32 -0
  131. package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js.map +1 -0
  132. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.d.ts +7 -0
  133. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js +44 -0
  134. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js.map +1 -0
  135. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.d.ts +10 -0
  136. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js +52 -0
  137. package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js.map +1 -0
  138. package/lib/components/mention-finder/MentionFinder.d.ts +31 -0
  139. package/lib/components/mention-finder/MentionFinder.js +141 -0
  140. package/lib/components/mention-finder/MentionFinder.js.map +1 -0
  141. package/lib/components/mention-finder/MentionFinder.styles.d.ts +5 -0
  142. package/lib/components/mention-finder/MentionFinder.styles.js +94 -0
  143. package/lib/components/mention-finder/MentionFinder.styles.js.map +1 -0
  144. package/lib/components/mention-finder/constants/alignment.d.ts +4 -0
  145. package/lib/components/mention-finder/constants/alignment.js +13 -0
  146. package/lib/components/mention-finder/constants/alignment.js.map +1 -0
  147. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.d.ts +10 -0
  148. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js +32 -0
  149. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js.map +1 -0
  150. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.d.ts +8 -0
  151. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js +100 -0
  152. package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -0
  153. package/lib/components/sharing-bar/SharingBar.d.ts +9 -0
  154. package/lib/components/sharing-bar/SharingBar.js +111 -0
  155. package/lib/components/sharing-bar/SharingBar.js.map +1 -0
  156. package/lib/components/sharing-bar/SharingBar.styles.d.ts +3 -0
  157. package/lib/components/sharing-bar/SharingBar.styles.js +20 -0
  158. package/lib/components/sharing-bar/SharingBar.styles.js.map +1 -0
  159. package/lib/components/slider/Slider.d.ts +21 -0
  160. package/lib/components/slider/Slider.js +59 -0
  161. package/lib/components/slider/Slider.js.map +1 -0
  162. package/lib/components/slider/Slider.styles.d.ts +8 -0
  163. package/lib/components/slider/Slider.styles.js +76 -0
  164. package/lib/components/slider/Slider.styles.js.map +1 -0
  165. package/lib/components/small-wait-cursor/SmallWaitCursor.d.ts +22 -0
  166. package/lib/components/small-wait-cursor/SmallWaitCursor.js +34 -0
  167. package/lib/components/small-wait-cursor/SmallWaitCursor.js.map +1 -0
  168. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.d.ts +13 -0
  169. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js +72 -0
  170. package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js.map +1 -0
  171. package/lib/hooks/uuid.js +2 -21
  172. package/lib/hooks/uuid.js.map +1 -1
  173. package/lib/index.d.ts +12 -0
  174. package/lib/index.js +89 -23
  175. package/lib/index.js.map +1 -1
  176. package/lib/types/chayns.d.ts +59 -0
  177. package/lib/types/chayns.js +14 -0
  178. package/lib/types/chayns.js.map +1 -0
  179. package/package.json +22 -18
@@ -1,98 +1,58 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.default = void 0;
9
-
10
7
  var _colors = require("@chayns/colors");
11
-
12
8
  var _react = _interopRequireWildcard(require("react"));
13
-
14
9
  var _styledComponents = require("styled-components");
15
-
16
- var _templateObject;
17
-
18
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
-
20
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
-
22
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
23
-
24
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
25
-
26
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
27
-
28
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
29
-
30
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
31
-
32
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
33
-
34
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
35
-
36
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
37
-
38
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
39
-
40
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
41
-
42
- var ColorMode;
43
-
44
- (function (ColorMode) {
10
+ var _font = require("./font");
11
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
+ var ColorMode = /*#__PURE__*/function (ColorMode) {
45
14
  ColorMode[ColorMode["Classic"] = 0] = "Classic";
46
15
  ColorMode[ColorMode["Dark"] = 1] = "Dark";
47
16
  ColorMode[ColorMode["Light"] = 2] = "Light";
48
- })(ColorMode || (ColorMode = {}));
49
-
50
- var GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n"])));
51
-
52
- var ColorSchemeProvider = function ColorSchemeProvider(_ref) {
53
- var children = _ref.children,
54
- _ref$color = _ref.color,
55
- color = _ref$color === void 0 ? '#005EB8' : _ref$color,
56
- _ref$colorMode = _ref.colorMode,
57
- colorMode = _ref$colorMode === void 0 ? ColorMode.Classic : _ref$colorMode,
58
- _ref$cssVariables = _ref.cssVariables,
59
- cssVariables = _ref$cssVariables === void 0 ? {} : _ref$cssVariables,
60
- secondaryColor = _ref.secondaryColor,
61
- _ref$style = _ref.style,
62
- style = _ref$style === void 0 ? {} : _ref$style;
63
-
64
- var _useState = (0, _react.useState)({}),
65
- _useState2 = _slicedToArray(_useState, 2),
66
- colors = _useState2[0],
67
- setColors = _useState2[1];
68
-
69
- var _useState3 = (0, _react.useState)({}),
70
- _useState4 = _slicedToArray(_useState3, 2),
71
- themeColors = _useState4[0],
72
- setThemeColors = _useState4[1];
73
-
74
- (0, _react.useEffect)(function () {
75
- var availableColors = (0, _colors.getAvailableColorList)();
76
- var newColors = {};
77
- var newThemeColors = {};
78
- availableColors.forEach(function (colorName) {
79
- var hexColor = (0, _colors.getColorFromPalette)(colorName, {
80
- color: color,
81
- colorMode: colorMode,
82
- secondaryColor: secondaryColor
17
+ return ColorMode;
18
+ }(ColorMode || {});
19
+ const GlobalStyle = (0, _styledComponents.createGlobalStyle)`
20
+ ${_font.generateFontFaces}
21
+
22
+ .ellipsis {
23
+ overflow: hidden;
24
+ text-overflow: ellipsis;
25
+ white-space: nowrap;
26
+ }
27
+ `;
28
+ const ColorSchemeProvider = _ref => {
29
+ let {
30
+ children,
31
+ color = '#005EB8',
32
+ colorMode = ColorMode.Classic,
33
+ cssVariables = {},
34
+ secondaryColor,
35
+ style = {}
36
+ } = _ref;
37
+ const [colors, setColors] = (0, _react.useState)({});
38
+ const [themeColors, setThemeColors] = (0, _react.useState)({});
39
+ (0, _react.useEffect)(() => {
40
+ const availableColors = (0, _colors.getAvailableColorList)();
41
+ const newColors = {};
42
+ const newThemeColors = {};
43
+ availableColors.forEach(colorName => {
44
+ const hexColor = (0, _colors.getColorFromPalette)(colorName, {
45
+ color,
46
+ colorMode,
47
+ secondaryColor
83
48
  });
84
-
85
- if (colorName === 'text') {// console.debug('textColor', hexColor);
86
- }
87
-
88
49
  if (hexColor) {
89
- var rgbColor = (0, _colors.hexToRgb255)(hexColor);
90
- newColors["--chayns-color--".concat(colorName)] = hexColor;
50
+ const rgbColor = (0, _colors.hexToRgb255)(hexColor);
51
+ newColors[`--chayns-color--${colorName}`] = hexColor;
91
52
  newThemeColors[colorName] = hexColor;
92
-
93
53
  if (rgbColor) {
94
- newColors["--chayns-color-rgb--".concat(colorName)] = "".concat(rgbColor.r, ", ").concat(rgbColor.g, ", ").concat(rgbColor.b);
95
- newThemeColors["".concat(colorName, "-rgb")] = "".concat(rgbColor.r, ", ").concat(rgbColor.g, ", ").concat(rgbColor.b);
54
+ newColors[`--chayns-color-rgb--${colorName}`] = `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;
55
+ newThemeColors[`${colorName}-rgb`] = `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;
96
56
  }
97
57
  }
98
58
  });
@@ -102,10 +62,13 @@ var ColorSchemeProvider = function ColorSchemeProvider(_ref) {
102
62
  return /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
103
63
  theme: themeColors
104
64
  }, /*#__PURE__*/_react.default.createElement("div", {
105
- style: _objectSpread(_objectSpread(_objectSpread({}, colors), cssVariables), style)
65
+ style: {
66
+ ...colors,
67
+ ...cssVariables,
68
+ ...style
69
+ }
106
70
  }, children), /*#__PURE__*/_react.default.createElement(GlobalStyle, null));
107
71
  };
108
-
109
72
  ColorSchemeProvider.displayName = 'ColorSchemeProvider';
110
73
  var _default = ColorSchemeProvider;
111
74
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/color-scheme-provider/ColorSchemeProvider.tsx"],"names":["ColorMode","GlobalStyle","createGlobalStyle","ColorSchemeProvider","children","color","colorMode","Classic","cssVariables","secondaryColor","style","colors","setColors","themeColors","setThemeColors","availableColors","newColors","newThemeColors","forEach","colorName","hexColor","rgbColor","r","g","b","displayName"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;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AD,CAAd,GAA4BC,QAA5B;;AAEA,YAAIC,QAAJ,EAAc;AACVL,UAAAA,SAAS,+BACkBG,SADlB,EAAT,aAEOE,QAAQ,CAACC,CAFhB,eAEsBD,QAAQ,CAACE,CAF/B,eAEqCF,QAAQ,CAACG,CAF9C;AAGAP,UAAAA,cAAc,WACPE,SADO,UAAd,aAEOE,QAAQ,CAACC,CAFhB,eAEsBD,QAAQ,CAACE,CAF/B,eAEqCF,QAAQ,CAACG,CAF9C;AAGH;AACJ;AACJ,KA1BD;AA4BAZ,IAAAA,SAAS,CAACI,SAAD,CAAT;AACAF,IAAAA,cAAc,CAACG,cAAD,CAAd;AACH,GApCD,EAoCG,CAACZ,KAAD,EAAQC,SAAR,EAAmBG,cAAnB,CApCH;AAsCA,sBACI,6BAAC,+BAAD;AAAe,IAAA,KAAK,EAAEI;AAAtB,kBACI;AAAK,IAAA,KAAK,gDAAOF,MAAP,GAAkBH,YAAlB,GAAmCE,KAAnC;AAAV,KAAuDN,QAAvD,CADJ,eAEI,6BAAC,WAAD,OAFJ,CADJ;AAMH,CAvDD;;AAyDAD,mBAAmB,CAACsB,WAApB,GAAkC,qBAAlC;eAEetB,mB","sourcesContent":["import { getAvailableColorList, getColorFromPalette, hexToRgb255 } from '@chayns/colors';\nimport React, { FC, ReactNode, useEffect, useState } from 'react';\nimport { createGlobalStyle, ThemeProvider } from 'styled-components';\n\nenum ColorMode {\n Classic,\n Dark,\n Light,\n}\n\ntype ColorSchemeProviderProps = {\n /**\n * The content of the application or the components for which the styles should be set\n */\n children: ReactNode;\n /**\n * The hex color to be used for the children\n */\n color?: string;\n /**\n * The color mode to be used for the children\n */\n colorMode?: ColorMode;\n /**\n * Css variables to be added in addition to the chayns variables\n */\n cssVariables?: { [key: string]: string | number };\n /**\n * The secondary hex color to be used for the children\n */\n secondaryColor?: string;\n /**\n * Additional styles set on the root element\n */\n style?: { [key: string]: string | number };\n};\n\nexport interface Theme {\n [key: string]: string;\n}\n\nexport type WithTheme<T> = T & {\n theme: Theme;\n};\n\nconst GlobalStyle = createGlobalStyle`\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n`;\n\nconst ColorSchemeProvider: FC<ColorSchemeProviderProps> = ({\n children,\n color = '#005EB8',\n colorMode = ColorMode.Classic,\n cssVariables = {},\n secondaryColor,\n style = {},\n}) => {\n const [colors, setColors] = useState<Theme>({});\n const [themeColors, setThemeColors] = useState<Theme>({});\n\n useEffect(() => {\n const availableColors = getAvailableColorList();\n\n const newColors: Theme = {};\n const newThemeColors: Theme = {};\n\n availableColors.forEach((colorName: string) => {\n const hexColor = getColorFromPalette(colorName, {\n color,\n colorMode,\n secondaryColor,\n });\n\n if (colorName === 'text') {\n // console.debug('textColor', hexColor);\n }\n\n if (hexColor) {\n const rgbColor = hexToRgb255(hexColor);\n\n newColors[`--chayns-color--${colorName}`] = hexColor;\n newThemeColors[colorName] = hexColor;\n\n if (rgbColor) {\n newColors[\n `--chayns-color-rgb--${colorName}`\n ] = `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;\n newThemeColors[\n `${colorName}-rgb`\n ] = `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;\n }\n }\n });\n\n setColors(newColors);\n setThemeColors(newThemeColors);\n }, [color, colorMode, secondaryColor]);\n\n return (\n <ThemeProvider theme={themeColors}>\n <div style={{ ...colors, ...cssVariables, ...style }}>{children}</div>\n <GlobalStyle />\n </ThemeProvider>\n );\n};\n\nColorSchemeProvider.displayName = 'ColorSchemeProvider';\n\nexport default ColorSchemeProvider;\n"],"file":"ColorSchemeProvider.js"}
1
+ {"version":3,"file":"ColorSchemeProvider.js","names":["_colors","require","_react","_interopRequireWildcard","_styledComponents","_font","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ColorMode","GlobalStyle","createGlobalStyle","generateFontFaces","ColorSchemeProvider","_ref","children","color","colorMode","Classic","cssVariables","secondaryColor","style","colors","setColors","useState","themeColors","setThemeColors","useEffect","availableColors","getAvailableColorList","newColors","newThemeColors","forEach","colorName","hexColor","getColorFromPalette","rgbColor","hexToRgb255","r","g","b","createElement","ThemeProvider","theme","displayName","_default","exports"],"sources":["../../../src/components/color-scheme-provider/ColorSchemeProvider.tsx"],"sourcesContent":["import { getAvailableColorList, getColorFromPalette, hexToRgb255 } from '@chayns/colors';\nimport React, { FC, ReactNode, useEffect, useState } from 'react';\nimport { createGlobalStyle, ThemeProvider } from 'styled-components';\nimport { generateFontFaces } from './font';\n\nenum ColorMode {\n Classic,\n Dark,\n Light,\n}\n\ntype ColorSchemeProviderProps = {\n /**\n * The content of the application or the components for which the styles should be set\n */\n children: ReactNode;\n /**\n * The hex color to be used for the children\n */\n color?: string;\n /**\n * The color mode to be used for the children\n */\n colorMode?: ColorMode;\n /**\n * Css variables to be added in addition to the chayns variables\n */\n cssVariables?: { [key: string]: string | number };\n /**\n * The secondary hex color to be used for the children\n */\n secondaryColor?: string;\n /**\n * Additional styles set on the root element\n */\n style?: { [key: string]: string | number };\n};\n\nexport interface Theme {\n [key: string]: string;\n}\n\nexport type WithTheme<T> = T & {\n theme: Theme;\n};\n\nconst GlobalStyle = createGlobalStyle`\n ${generateFontFaces}\n\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n`;\n\nconst ColorSchemeProvider: FC<ColorSchemeProviderProps> = ({\n children,\n color = '#005EB8',\n colorMode = ColorMode.Classic,\n cssVariables = {},\n secondaryColor,\n style = {},\n}) => {\n const [colors, setColors] = useState<Theme>({});\n const [themeColors, setThemeColors] = useState<Theme>({});\n\n useEffect(() => {\n const availableColors = getAvailableColorList();\n\n const newColors: Theme = {};\n const newThemeColors: Theme = {};\n\n availableColors.forEach((colorName: string) => {\n const hexColor = getColorFromPalette(colorName, {\n color,\n colorMode,\n secondaryColor,\n });\n\n if (hexColor) {\n const rgbColor = hexToRgb255(hexColor);\n\n newColors[`--chayns-color--${colorName}`] = hexColor;\n newThemeColors[colorName] = hexColor;\n\n if (rgbColor) {\n newColors[\n `--chayns-color-rgb--${colorName}`\n ] = `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;\n newThemeColors[\n `${colorName}-rgb`\n ] = `${rgbColor.r}, ${rgbColor.g}, ${rgbColor.b}`;\n }\n }\n });\n\n setColors(newColors);\n setThemeColors(newThemeColors);\n }, [color, colorMode, secondaryColor]);\n\n return (\n <ThemeProvider theme={themeColors}>\n <div style={{ ...colors, ...cssVariables, ...style }}>{children}</div>\n <GlobalStyle />\n </ThemeProvider>\n );\n};\n\nColorSchemeProvider.displayName = 'ColorSchemeProvider';\n\nexport default ColorSchemeProvider;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAA2C,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAA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,CAAC/B,WAAW,MAAE,CACH,CAAC;AAExB,CAAC;AAEDG,mBAAmB,CAAC+B,WAAW,GAAG,qBAAqB;AAAC,IAAAC,QAAA,GAEzChC,mBAAmB;AAAAiC,OAAA,CAAApD,OAAA,GAAAmD,QAAA"}
@@ -0,0 +1,6 @@
1
+ export interface Font {
2
+ family: string;
3
+ src: string;
4
+ unicodeRange?: string;
5
+ }
6
+ export declare const generateFontFaces: () => string;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.generateFontFaces = void 0;
7
+ const fonts = [{
8
+ family: 'Noto Color Emoji',
9
+ src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.0.woff2',
10
+ unicodeRange: 'U+1f1e6-1f1ff'
11
+ }, {
12
+ family: 'Noto Color Emoji',
13
+ src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.1.woff2',
14
+ unicodeRange: 'U+200d, U+2620, U+26a7, U+fe0f, U+1f308, U+1f38c, U+1f3c1, U+1f3f3-1f3f4, U+1f6a9, U+e0062-e0063, U+e0065, U+e0067, U+e006c, U+e006e, U+e0073-e0074, U+e0077, U+e007f'
15
+ }, {
16
+ family: 'Noto Color Emoji',
17
+ src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.2.woff2',
18
+ unicodeRange: 'U+23, U+2a, U+30-39, U+a9, U+ae, U+200d, U+203c, U+2049, U+20e3, U+2122, U+2139, U+2194-2199, U+21a9-21aa, U+23cf, U+23e9-23ef, U+23f8-23fa, U+24c2, U+25aa-25ab, U+25b6, U+25c0, U+25fb-25fe, U+2611, U+2622-2623, U+2626, U+262a, U+262e-262f, U+2638, U+2640, U+2642, U+2648-2653, U+2660, U+2663, U+2665-2666, U+2668, U+267b, U+267e-267f, U+2695, U+269b-269c, U+26a0, U+26a7, U+26aa-26ab, U+26ce, U+26d4, U+2705, U+2714, U+2716, U+271d, U+2721, U+2733-2734, U+2747, U+274c, U+274e, U+2753-2755, U+2757, U+2764, U+2795-2797, U+27a1, U+27b0, U+27bf, U+2934-2935, U+2b05-2b07, U+2b1b-2b1c, U+2b55, U+3030, U+303d, U+3297, U+3299, U+fe0f, U+1f170-1f171, U+1f17e-1f17f, U+1f18e, U+1f191-1f19a, U+1f201-1f202, U+1f21a, U+1f22f, U+1f232-1f23a, U+1f250-1f251, U+1f310, U+1f3a6, U+1f3b5-1f3b6, U+1f3bc, U+1f3e7, U+1f441, U+1f499-1f49c, U+1f49f-1f4a0, U+1f4a2, U+1f4ac-1f4ad, U+1f4b1-1f4b2, U+1f4b9, U+1f4db, U+1f4f2-1f4f6, U+1f500-1f50a, U+1f515, U+1f518-1f524, U+1f52f-1f53d, U+1f549, U+1f54e, U+1f5a4, U+1f5e8, U+1f5ef, U+1f6ab, U+1f6ad-1f6b1, U+1f6b3, U+1f6b7-1f6bc, U+1f6be, U+1f6c2-1f6c5, U+1f6d0-1f6d1, U+1f6d7, U+1f6dc, U+1f7e0-1f7eb, U+1f7f0, U+1f90d-1f90e, U+1f9e1, U+1fa75-1fa77, U+1faaf'
19
+ }, {
20
+ family: 'Noto Color Emoji',
21
+ src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.3.woff2',
22
+ unicodeRange: 'U+231a-231b, U+2328, U+23f0-23f3, U+2602, U+260e, U+2692, U+2694, U+2696-2697, U+2699, U+26b0-26b1, U+26cf, U+26d1, U+26d3, U+2702, U+2709, U+270f, U+2712, U+fe0f, U+1f302, U+1f321, U+1f392-1f393, U+1f3a9, U+1f3bd, U+1f3ee, U+1f3f7, U+1f3fa, U+1f451-1f462, U+1f484, U+1f489-1f48a, U+1f48c-1f48e, U+1f4a1, U+1f4a3, U+1f4b0, U+1f4b3-1f4b8, U+1f4bb-1f4da, U+1f4dc-1f4f1, U+1f4ff, U+1f50b-1f514, U+1f516-1f517, U+1f526-1f529, U+1f52c-1f52e, U+1f550-1f567, U+1f56f-1f570, U+1f576, U+1f587, U+1f58a-1f58d, U+1f5a5, U+1f5a8, U+1f5b1-1f5b2, U+1f5c2-1f5c4, U+1f5d1-1f5d3, U+1f5dc-1f5de, U+1f5e1, U+1f5f3, U+1f6aa, U+1f6ac, U+1f6bd, U+1f6bf, U+1f6c1, U+1f6cb, U+1f6cd-1f6cf, U+1f6d2, U+1f6e0-1f6e1, U+1f6f0, U+1f97b-1f97f, U+1f9af, U+1f9ba, U+1f9e2-1f9e6, U+1f9ea-1f9ec, U+1f9ee-1f9f4, U+1f9f7-1f9ff, U+1fa71-1fa74, U+1fa79-1fa7b, U+1fa86, U+1fa91-1fa93, U+1fa96, U+1fa99-1faa0, U+1faa2-1faa7, U+1faaa-1faae'
23
+ }, {
24
+ family: 'Noto Color Emoji',
25
+ src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.4.woff2',
26
+ unicodeRange: 'U+265f, U+26bd-26be, U+26f3, U+26f8, U+fe0f, U+1f004, U+1f0cf, U+1f380-1f384, U+1f386-1f38b, U+1f38d-1f391, U+1f396-1f397, U+1f399-1f39b, U+1f39e-1f39f, U+1f3a3-1f3a5, U+1f3a7-1f3a9, U+1f3ab-1f3b4, U+1f3b7-1f3bb, U+1f3bd-1f3c0, U+1f3c5-1f3c6, U+1f3c8-1f3c9, U+1f3cf-1f3d3, U+1f3f8-1f3f9, U+1f47e, U+1f4e2, U+1f4f7-1f4fd, U+1f52b, U+1f579, U+1f58c-1f58d, U+1f5bc, U+1f6f7, U+1f6f9, U+1f6fc, U+1f93f, U+1f941, U+1f945, U+1f947-1f94f, U+1f9e7-1f9e9, U+1f9f5-1f9f6, U+1fa70-1fa71, U+1fa80-1fa81, U+1fa83-1fa85, U+1fa87-1fa88, U+1fa94-1fa95, U+1fa97-1fa98, U+1faa1, U+1faa9'
27
+ }, {
28
+ family: 'Noto Color Emoji',
29
+ src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.5.woff2',
30
+ unicodeRange: 'U+2693, U+26e9-26ea, U+26f1-26f2, U+26f4-26f5, U+26fa, U+26fd, U+2708, U+fe0f, U+1f301, U+1f303, U+1f306-1f307, U+1f309, U+1f310, U+1f3a0-1f3a2, U+1f3aa, U+1f3cd-1f3ce, U+1f3d5, U+1f3d7-1f3db, U+1f3df-1f3e6, U+1f3e8-1f3ed, U+1f3ef-1f3f0, U+1f488, U+1f492, U+1f4ba, U+1f54b-1f54d, U+1f5fa-1f5ff, U+1f680-1f6a2, U+1f6a4-1f6a8, U+1f6b2, U+1f6d1, U+1f6d5-1f6d6, U+1f6dd-1f6df, U+1f6e2-1f6e5, U+1f6e9, U+1f6eb-1f6ec, U+1f6f3-1f6f6, U+1f6f8, U+1f6fa-1f6fb, U+1f9bc-1f9bd, U+1f9ed, U+1f9f3, U+1fa7c'
31
+ }, {
32
+ family: 'Noto Color Emoji',
33
+ src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.6.woff2',
34
+ unicodeRange: 'U+2615, U+fe0f, U+1f32d-1f330, U+1f336, U+1f33d, U+1f345-1f37f, U+1f382, U+1f52a, U+1f942-1f944, U+1f950-1f96f, U+1f99e, U+1f9aa, U+1f9c0-1f9cb, U+1fad0-1fadb'
35
+ }, {
36
+ family: 'Noto Color Emoji',
37
+ src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.7.woff2',
38
+ unicodeRange: 'U+200d, U+2600-2601, U+2603-2604, U+2614, U+2618, U+26a1, U+26c4-26c5, U+26c8, U+26f0, U+2728, U+2744, U+2b1b, U+2b50, U+fe0f, U+1f300, U+1f304-1f305, U+1f308, U+1f30a-1f30f, U+1f311-1f321, U+1f324-1f32c, U+1f331-1f335, U+1f337-1f33c, U+1f33e-1f344, U+1f3d4, U+1f3d6, U+1f3dc-1f3de, U+1f3f5, U+1f400-1f43f, U+1f490, U+1f4a7, U+1f4ab, U+1f4ae, U+1f525, U+1f54a, U+1f573, U+1f577-1f578, U+1f648-1f64a, U+1f940, U+1f980-1f9ae, U+1f9ba, U+1fa90, U+1faa8, U+1fab0-1fabd, U+1fabf, U+1face-1facf, U+1fae7'
39
+ }, {
40
+ family: 'Noto Color Emoji',
41
+ src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.8.woff2',
42
+ unicodeRange: 'U+200d, U+2640, U+2642, U+2695-2696, U+26f7, U+26f9, U+2708, U+2764, U+fe0f, U+1f33e, U+1f373, U+1f37c, U+1f384-1f385, U+1f393, U+1f3a4, U+1f3a8, U+1f3c2-1f3c4, U+1f3c7, U+1f3ca-1f3cc, U+1f3eb, U+1f3ed, U+1f3fb-1f3ff, U+1f466-1f478, U+1f47c, U+1f481-1f483, U+1f486-1f487, U+1f48b, U+1f48f, U+1f491, U+1f4bb-1f4bc, U+1f527, U+1f52c, U+1f574-1f575, U+1f57a, U+1f645-1f647, U+1f64b, U+1f64d-1f64e, U+1f680, U+1f692, U+1f6a3, U+1f6b4-1f6b6, U+1f6c0, U+1f6cc, U+1f91d, U+1f926, U+1f930-1f931, U+1f934-1f93a, U+1f93c-1f93e, U+1f977, U+1f9af-1f9b3, U+1f9b8-1f9b9, U+1f9bc-1f9bd, U+1f9cc-1f9cf, U+1f9d1-1f9df, U+1fa82, U+1fac3-1fac5'
43
+ }, {
44
+ family: 'Noto Color Emoji',
45
+ src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.9.woff2',
46
+ unicodeRange: 'U+200d, U+261d, U+2620, U+2639-263a, U+2665, U+270a-270d, U+2728, U+2763-2764, U+2b50, U+fe0f, U+1f31a-1f31f, U+1f32b, U+1f383, U+1f389, U+1f3fb-1f3ff, U+1f440-1f450, U+1f463-1f465, U+1f479-1f47b, U+1f47d-1f480, U+1f485, U+1f48b-1f48c, U+1f493-1f49f, U+1f4a4-1f4a6, U+1f4a8-1f4ab, U+1f4af, U+1f525, U+1f573, U+1f590, U+1f595-1f596, U+1f5a4, U+1f5e3, U+1f600-1f644, U+1f648-1f64a, U+1f64c, U+1f64f, U+1f90c-1f925, U+1f927-1f92f, U+1f932-1f933, U+1f970-1f976, U+1f978-1f97a, U+1f9a0, U+1f9b4-1f9b7, U+1f9bb, U+1f9be-1f9bf, U+1f9d0, U+1f9e0-1f9e1, U+1fa75-1fa79, U+1fac0-1fac2, U+1fae0-1fae6, U+1fae8, U+1faf0-1faf8'
47
+ }];
48
+ const generateFontFaces = () => fonts.map(font => `
49
+ @font-face {
50
+ font-display: swap;
51
+ font-family: "${font.family}";
52
+ font-style: normal;
53
+ font-weight: 400;
54
+ src: url("${font.src}") format("woff2");
55
+ ${font.unicodeRange ? `unicode-range: ${font.unicodeRange};` : ''}
56
+ }
57
+ `).join('');
58
+ exports.generateFontFaces = generateFontFaces;
59
+ //# sourceMappingURL=font.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font.js","names":["fonts","family","src","unicodeRange","generateFontFaces","map","font","join","exports"],"sources":["../../../src/components/color-scheme-provider/font.ts"],"sourcesContent":["export interface Font {\n family: string;\n src: string;\n unicodeRange?: string;\n}\n\nconst fonts: Font[] = [\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.0.woff2',\n unicodeRange: 'U+1f1e6-1f1ff',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.1.woff2',\n unicodeRange:\n 'U+200d, U+2620, U+26a7, U+fe0f, U+1f308, U+1f38c, U+1f3c1, U+1f3f3-1f3f4, U+1f6a9, U+e0062-e0063, U+e0065, U+e0067, U+e006c, U+e006e, U+e0073-e0074, U+e0077, U+e007f',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.2.woff2',\n unicodeRange:\n 'U+23, U+2a, U+30-39, U+a9, U+ae, U+200d, U+203c, U+2049, U+20e3, U+2122, U+2139, U+2194-2199, U+21a9-21aa, U+23cf, U+23e9-23ef, U+23f8-23fa, U+24c2, U+25aa-25ab, U+25b6, U+25c0, U+25fb-25fe, U+2611, U+2622-2623, U+2626, U+262a, U+262e-262f, U+2638, U+2640, U+2642, U+2648-2653, U+2660, U+2663, U+2665-2666, U+2668, U+267b, U+267e-267f, U+2695, U+269b-269c, U+26a0, U+26a7, U+26aa-26ab, U+26ce, U+26d4, U+2705, U+2714, U+2716, U+271d, U+2721, U+2733-2734, U+2747, U+274c, U+274e, U+2753-2755, U+2757, U+2764, U+2795-2797, U+27a1, U+27b0, U+27bf, U+2934-2935, U+2b05-2b07, U+2b1b-2b1c, U+2b55, U+3030, U+303d, U+3297, U+3299, U+fe0f, U+1f170-1f171, U+1f17e-1f17f, U+1f18e, U+1f191-1f19a, U+1f201-1f202, U+1f21a, U+1f22f, U+1f232-1f23a, U+1f250-1f251, U+1f310, U+1f3a6, U+1f3b5-1f3b6, U+1f3bc, U+1f3e7, U+1f441, U+1f499-1f49c, U+1f49f-1f4a0, U+1f4a2, U+1f4ac-1f4ad, U+1f4b1-1f4b2, U+1f4b9, U+1f4db, U+1f4f2-1f4f6, U+1f500-1f50a, U+1f515, U+1f518-1f524, U+1f52f-1f53d, U+1f549, U+1f54e, U+1f5a4, U+1f5e8, U+1f5ef, U+1f6ab, U+1f6ad-1f6b1, U+1f6b3, U+1f6b7-1f6bc, U+1f6be, U+1f6c2-1f6c5, U+1f6d0-1f6d1, U+1f6d7, U+1f6dc, U+1f7e0-1f7eb, U+1f7f0, U+1f90d-1f90e, U+1f9e1, U+1fa75-1fa77, U+1faaf',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.3.woff2',\n unicodeRange:\n 'U+231a-231b, U+2328, U+23f0-23f3, U+2602, U+260e, U+2692, U+2694, U+2696-2697, U+2699, U+26b0-26b1, U+26cf, U+26d1, U+26d3, U+2702, U+2709, U+270f, U+2712, U+fe0f, U+1f302, U+1f321, U+1f392-1f393, U+1f3a9, U+1f3bd, U+1f3ee, U+1f3f7, U+1f3fa, U+1f451-1f462, U+1f484, U+1f489-1f48a, U+1f48c-1f48e, U+1f4a1, U+1f4a3, U+1f4b0, U+1f4b3-1f4b8, U+1f4bb-1f4da, U+1f4dc-1f4f1, U+1f4ff, U+1f50b-1f514, U+1f516-1f517, U+1f526-1f529, U+1f52c-1f52e, U+1f550-1f567, U+1f56f-1f570, U+1f576, U+1f587, U+1f58a-1f58d, U+1f5a5, U+1f5a8, U+1f5b1-1f5b2, U+1f5c2-1f5c4, U+1f5d1-1f5d3, U+1f5dc-1f5de, U+1f5e1, U+1f5f3, U+1f6aa, U+1f6ac, U+1f6bd, U+1f6bf, U+1f6c1, U+1f6cb, U+1f6cd-1f6cf, U+1f6d2, U+1f6e0-1f6e1, U+1f6f0, U+1f97b-1f97f, U+1f9af, U+1f9ba, U+1f9e2-1f9e6, U+1f9ea-1f9ec, U+1f9ee-1f9f4, U+1f9f7-1f9ff, U+1fa71-1fa74, U+1fa79-1fa7b, U+1fa86, U+1fa91-1fa93, U+1fa96, U+1fa99-1faa0, U+1faa2-1faa7, U+1faaa-1faae',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.4.woff2',\n unicodeRange:\n 'U+265f, U+26bd-26be, U+26f3, U+26f8, U+fe0f, U+1f004, U+1f0cf, U+1f380-1f384, U+1f386-1f38b, U+1f38d-1f391, U+1f396-1f397, U+1f399-1f39b, U+1f39e-1f39f, U+1f3a3-1f3a5, U+1f3a7-1f3a9, U+1f3ab-1f3b4, U+1f3b7-1f3bb, U+1f3bd-1f3c0, U+1f3c5-1f3c6, U+1f3c8-1f3c9, U+1f3cf-1f3d3, U+1f3f8-1f3f9, U+1f47e, U+1f4e2, U+1f4f7-1f4fd, U+1f52b, U+1f579, U+1f58c-1f58d, U+1f5bc, U+1f6f7, U+1f6f9, U+1f6fc, U+1f93f, U+1f941, U+1f945, U+1f947-1f94f, U+1f9e7-1f9e9, U+1f9f5-1f9f6, U+1fa70-1fa71, U+1fa80-1fa81, U+1fa83-1fa85, U+1fa87-1fa88, U+1fa94-1fa95, U+1fa97-1fa98, U+1faa1, U+1faa9',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.5.woff2',\n unicodeRange:\n 'U+2693, U+26e9-26ea, U+26f1-26f2, U+26f4-26f5, U+26fa, U+26fd, U+2708, U+fe0f, U+1f301, U+1f303, U+1f306-1f307, U+1f309, U+1f310, U+1f3a0-1f3a2, U+1f3aa, U+1f3cd-1f3ce, U+1f3d5, U+1f3d7-1f3db, U+1f3df-1f3e6, U+1f3e8-1f3ed, U+1f3ef-1f3f0, U+1f488, U+1f492, U+1f4ba, U+1f54b-1f54d, U+1f5fa-1f5ff, U+1f680-1f6a2, U+1f6a4-1f6a8, U+1f6b2, U+1f6d1, U+1f6d5-1f6d6, U+1f6dd-1f6df, U+1f6e2-1f6e5, U+1f6e9, U+1f6eb-1f6ec, U+1f6f3-1f6f6, U+1f6f8, U+1f6fa-1f6fb, U+1f9bc-1f9bd, U+1f9ed, U+1f9f3, U+1fa7c',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.6.woff2',\n unicodeRange:\n 'U+2615, U+fe0f, U+1f32d-1f330, U+1f336, U+1f33d, U+1f345-1f37f, U+1f382, U+1f52a, U+1f942-1f944, U+1f950-1f96f, U+1f99e, U+1f9aa, U+1f9c0-1f9cb, U+1fad0-1fadb',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.7.woff2',\n unicodeRange:\n 'U+200d, U+2600-2601, U+2603-2604, U+2614, U+2618, U+26a1, U+26c4-26c5, U+26c8, U+26f0, U+2728, U+2744, U+2b1b, U+2b50, U+fe0f, U+1f300, U+1f304-1f305, U+1f308, U+1f30a-1f30f, U+1f311-1f321, U+1f324-1f32c, U+1f331-1f335, U+1f337-1f33c, U+1f33e-1f344, U+1f3d4, U+1f3d6, U+1f3dc-1f3de, U+1f3f5, U+1f400-1f43f, U+1f490, U+1f4a7, U+1f4ab, U+1f4ae, U+1f525, U+1f54a, U+1f573, U+1f577-1f578, U+1f648-1f64a, U+1f940, U+1f980-1f9ae, U+1f9ba, U+1fa90, U+1faa8, U+1fab0-1fabd, U+1fabf, U+1face-1facf, U+1fae7',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.8.woff2',\n unicodeRange:\n 'U+200d, U+2640, U+2642, U+2695-2696, U+26f7, U+26f9, U+2708, U+2764, U+fe0f, U+1f33e, U+1f373, U+1f37c, U+1f384-1f385, U+1f393, U+1f3a4, U+1f3a8, U+1f3c2-1f3c4, U+1f3c7, U+1f3ca-1f3cc, U+1f3eb, U+1f3ed, U+1f3fb-1f3ff, U+1f466-1f478, U+1f47c, U+1f481-1f483, U+1f486-1f487, U+1f48b, U+1f48f, U+1f491, U+1f4bb-1f4bc, U+1f527, U+1f52c, U+1f574-1f575, U+1f57a, U+1f645-1f647, U+1f64b, U+1f64d-1f64e, U+1f680, U+1f692, U+1f6a3, U+1f6b4-1f6b6, U+1f6c0, U+1f6cc, U+1f91d, U+1f926, U+1f930-1f931, U+1f934-1f93a, U+1f93c-1f93e, U+1f977, U+1f9af-1f9b3, U+1f9b8-1f9b9, U+1f9bc-1f9bd, U+1f9cc-1f9cf, U+1f9d1-1f9df, U+1fa82, U+1fac3-1fac5',\n },\n {\n family: 'Noto Color Emoji',\n src: 'https://api.chayns-static.space/font/NotoColorEmoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.9.woff2',\n unicodeRange:\n 'U+200d, U+261d, U+2620, U+2639-263a, U+2665, U+270a-270d, U+2728, U+2763-2764, U+2b50, U+fe0f, U+1f31a-1f31f, U+1f32b, U+1f383, U+1f389, U+1f3fb-1f3ff, U+1f440-1f450, U+1f463-1f465, U+1f479-1f47b, U+1f47d-1f480, U+1f485, U+1f48b-1f48c, U+1f493-1f49f, U+1f4a4-1f4a6, U+1f4a8-1f4ab, U+1f4af, U+1f525, U+1f573, U+1f590, U+1f595-1f596, U+1f5a4, U+1f5e3, U+1f600-1f644, U+1f648-1f64a, U+1f64c, U+1f64f, U+1f90c-1f925, U+1f927-1f92f, U+1f932-1f933, U+1f970-1f976, U+1f978-1f97a, U+1f9a0, U+1f9b4-1f9b7, U+1f9bb, U+1f9be-1f9bf, U+1f9d0, U+1f9e0-1f9e1, U+1fa75-1fa79, U+1fac0-1fac2, U+1fae0-1fae6, U+1fae8, U+1faf0-1faf8',\n },\n];\n\nexport const generateFontFaces = () =>\n fonts\n .map(\n (font) => `\n @font-face {\n font-display: swap;\n font-family: \"${font.family}\";\n font-style: normal;\n font-weight: 400;\n src: url(\"${font.src}\") format(\"woff2\");\n ${font.unicodeRange ? `unicode-range: ${font.unicodeRange};` : ''}\n }\n`\n )\n .join('');\n"],"mappings":";;;;;;AAMA,MAAMA,KAAa,GAAG,CAClB;EACIC,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EAAE;AAClB,CAAC,EACD;EACIF,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EACR;AACR,CAAC,EACD;EACIF,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EACR;AACR,CAAC,EACD;EACIF,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EACR;AACR,CAAC,EACD;EACIF,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EACR;AACR,CAAC,EACD;EACIF,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EACR;AACR,CAAC,EACD;EACIF,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EACR;AACR,CAAC,EACD;EACIF,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EACR;AACR,CAAC,EACD;EACIF,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EACR;AACR,CAAC,EACD;EACIF,MAAM,EAAE,kBAAkB;EAC1BC,GAAG,EAAE,kHAAkH;EACvHC,YAAY,EACR;AACR,CAAC,CACJ;AAEM,MAAMC,iBAAiB,GAAGA,CAAA,KAC7BJ,KAAK,CACAK,GAAG,CACCC,IAAI,IAAM;AACvB;AACA;AACA,oBAAoBA,IAAI,CAACL,MAAO;AAChC;AACA;AACA,gBAAgBK,IAAI,CAACJ,GAAI;AACzB,MAAMI,IAAI,CAACH,YAAY,GAAI,kBAAiBG,IAAI,CAACH,YAAa,GAAE,GAAG,EAAG;AACtE;AACA,CACQ,CAAC,CACAI,IAAI,CAAC,EAAE,CAAC;AAACC,OAAA,CAAAJ,iBAAA,GAAAA,iBAAA"}
@@ -0,0 +1,51 @@
1
+ import React, { MouseEvent, ReactNode } from 'react';
2
+ import { ContextMenuAlignment } from './constants/alignment';
3
+ export type ContextMenuCoordinates = {
4
+ x: number;
5
+ y: number;
6
+ };
7
+ export type ContextMenuItem = {
8
+ icons: string[];
9
+ key: string;
10
+ onClick: (event?: MouseEvent<HTMLDivElement>) => void;
11
+ text: string;
12
+ };
13
+ type ContextMenuRef = {
14
+ hide: VoidFunction;
15
+ show: VoidFunction;
16
+ };
17
+ type ContextMenuProps = {
18
+ /**
19
+ * Optional custom alignment used instead of calculating it using the
20
+ * alignment within the page. The available alignment can be taken from the
21
+ * ContextMenuAlignment enum.
22
+ */
23
+ alignment?: ContextMenuAlignment;
24
+ /**
25
+ * The element over which the content of the `ContextMenu` should be displayed.
26
+ */
27
+ children?: ReactNode;
28
+ /**
29
+ * The element where the content of the `ContextMenu` should be rendered via React Portal.
30
+ */
31
+ container?: Element;
32
+ /**
33
+ * Optional own coordinates to be used instead of calculating the alignment
34
+ * based on the alignment of the children.
35
+ */
36
+ coordinates?: ContextMenuCoordinates;
37
+ /**
38
+ * The items that will be displayed in the content of the `ContextMenu`.
39
+ */
40
+ items: ContextMenuItem[];
41
+ /**
42
+ * Function to be executed when the content of the Context menu has been hidden.
43
+ */
44
+ onHide?: VoidFunction;
45
+ /**
46
+ * Function to be executed when the content of the Context menu has been shown.
47
+ */
48
+ onShow?: VoidFunction;
49
+ };
50
+ declare const ContextMenu: React.ForwardRefExoticComponent<ContextMenuProps & React.RefAttributes<ContextMenuRef>>;
51
+ export default ContextMenu;
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _framerMotion = require("framer-motion");
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _reactDom = require("react-dom");
10
+ var _uuid = require("../../hooks/uuid");
11
+ var _Icon = _interopRequireDefault(require("../icon/Icon"));
12
+ var _alignment = require("./constants/alignment");
13
+ var _ContextMenuContent = _interopRequireDefault(require("./context-menu-content/ContextMenuContent"));
14
+ var _ContextMenu = require("./ContextMenu.styles");
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+ const ContextMenu = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
19
+ let {
20
+ alignment,
21
+ children = /*#__PURE__*/_react.default.createElement(_Icon.default, {
22
+ icons: ['ts-ellipsis_v']
23
+ }),
24
+ container = document.body,
25
+ coordinates,
26
+ items,
27
+ onHide,
28
+ onShow
29
+ } = _ref;
30
+ const [internalCoordinates, setInternalCoordinates] = (0, _react.useState)({
31
+ x: 0,
32
+ y: 0
33
+ });
34
+ const [internalAlignment, setInternalAlignment] = (0, _react.useState)(_alignment.ContextMenuAlignment.TopLeft);
35
+ const [isContentShown, setIsContentShown] = (0, _react.useState)(false);
36
+ const [portal, setPortal] = (0, _react.useState)();
37
+ const uuid = (0, _uuid.useUuid)();
38
+
39
+ // ToDo: Replace with hook if new chayns api is ready
40
+ const contextMenuContentRef = (0, _react.useRef)(null);
41
+ const contextMenuRef = (0, _react.useRef)(null);
42
+ const handleHide = (0, _react.useCallback)(() => {
43
+ setIsContentShown(false);
44
+ }, []);
45
+ const handleShow = (0, _react.useCallback)(async () => {
46
+ const {
47
+ isMobile,
48
+ isTablet
49
+ } = chayns.env;
50
+ if (isMobile || isTablet) {
51
+ var _selection$;
52
+ // ToDo: Replace with new api function if new api is ready
53
+ const {
54
+ buttonType,
55
+ selection
56
+ } = await chayns.dialog.select({
57
+ buttons: [],
58
+ list: items.map((_ref2, index) => {
59
+ let {
60
+ icons,
61
+ text
62
+ } = _ref2;
63
+ return {
64
+ name: text,
65
+ value: index,
66
+ icon: icons[0]
67
+ };
68
+ }),
69
+ type: 2
70
+ });
71
+ if (buttonType === 1 && typeof ((_selection$ = selection[0]) === null || _selection$ === void 0 ? void 0 : _selection$.value) === 'number') {
72
+ var _items$selection$0$va;
73
+ (_items$selection$0$va = items[selection[0].value]) === null || _items$selection$0$va === void 0 ? void 0 : _items$selection$0$va.onClick();
74
+ }
75
+ } else if (contextMenuRef.current) {
76
+ const rootElement = document.querySelector('.tapp') || document.body;
77
+ const {
78
+ x,
79
+ y,
80
+ height: childrenHeight,
81
+ width: childrenWidth
82
+ } = contextMenuRef.current.getBoundingClientRect();
83
+ setInternalCoordinates({
84
+ x: x + childrenWidth / 2,
85
+ y: y + childrenHeight / 2
86
+ });
87
+ const {
88
+ height,
89
+ width
90
+ } = rootElement.getBoundingClientRect();
91
+ if (x < width / 2) {
92
+ if (y < height / 2) {
93
+ setInternalAlignment(_alignment.ContextMenuAlignment.BottomRight);
94
+ } else {
95
+ setInternalAlignment(_alignment.ContextMenuAlignment.TopRight);
96
+ }
97
+ } else if (y < height / 2) {
98
+ setInternalAlignment(_alignment.ContextMenuAlignment.BottomLeft);
99
+ } else {
100
+ setInternalAlignment(_alignment.ContextMenuAlignment.TopLeft);
101
+ }
102
+ setIsContentShown(true);
103
+ }
104
+ }, [items]);
105
+ const handleClick = (0, _react.useCallback)(event => {
106
+ event.preventDefault();
107
+ event.stopPropagation();
108
+ void handleShow();
109
+ }, [handleShow]);
110
+ const handleDocumentClick = (0, _react.useCallback)(event => {
111
+ var _contextMenuContentRe;
112
+ if (!((_contextMenuContentRe = contextMenuContentRef.current) !== null && _contextMenuContentRe !== void 0 && _contextMenuContentRe.contains(event.target))) {
113
+ event.preventDefault();
114
+ event.stopPropagation();
115
+ }
116
+ handleHide();
117
+ }, [handleHide]);
118
+ (0, _react.useImperativeHandle)(ref, () => ({
119
+ hide: handleHide,
120
+ show: handleShow
121
+ }), [handleHide, handleShow]);
122
+ (0, _react.useEffect)(() => {
123
+ if (isContentShown) {
124
+ document.addEventListener('click', handleDocumentClick, true);
125
+ window.addEventListener('blur', handleHide);
126
+ if (typeof onShow === 'function') {
127
+ onShow();
128
+ }
129
+ } else if (typeof onHide === 'function') {
130
+ onHide();
131
+ }
132
+ return () => {
133
+ document.removeEventListener('click', handleDocumentClick, true);
134
+ window.removeEventListener('blur', handleHide);
135
+ };
136
+ }, [handleDocumentClick, handleHide, isContentShown, onHide, onShow]);
137
+ (0, _react.useEffect)(() => {
138
+ setPortal(() => /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
139
+ initial: false
140
+ }, isContentShown && /*#__PURE__*/_react.default.createElement(_ContextMenuContent.default, {
141
+ coordinates: coordinates !== null && coordinates !== void 0 ? coordinates : internalCoordinates,
142
+ items: items,
143
+ key: `contextMenu_${uuid}`,
144
+ alignment: alignment !== null && alignment !== void 0 ? alignment : internalAlignment,
145
+ ref: contextMenuContentRef
146
+ })), container));
147
+ }, [alignment, container, coordinates, internalAlignment, internalCoordinates, isContentShown, items, uuid]);
148
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ContextMenu.StyledContextMenu, {
149
+ className: "beta-chayns-context-menu",
150
+ onClick: handleClick,
151
+ ref: contextMenuRef
152
+ }, children), portal);
153
+ });
154
+ ContextMenu.displayName = 'ContextMenu';
155
+ var _default = ContextMenu;
156
+ exports.default = _default;
157
+ //# sourceMappingURL=ContextMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextMenu.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_reactDom","_uuid","_Icon","_interopRequireDefault","_alignment","_ContextMenuContent","_ContextMenu","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ContextMenu","forwardRef","_ref","ref","alignment","children","createElement","icons","container","document","body","coordinates","items","onHide","onShow","internalCoordinates","setInternalCoordinates","useState","x","y","internalAlignment","setInternalAlignment","ContextMenuAlignment","TopLeft","isContentShown","setIsContentShown","portal","setPortal","uuid","useUuid","contextMenuContentRef","useRef","contextMenuRef","handleHide","useCallback","handleShow","isMobile","isTablet","chayns","env","_selection$","buttonType","selection","dialog","select","buttons","list","map","_ref2","index","text","name","value","icon","type","_items$selection$0$va","onClick","current","rootElement","querySelector","height","childrenHeight","width","childrenWidth","getBoundingClientRect","BottomRight","TopRight","BottomLeft","handleClick","event","preventDefault","stopPropagation","handleDocumentClick","_contextMenuContentRe","contains","target","useImperativeHandle","hide","show","useEffect","addEventListener","window","removeEventListener","createPortal","AnimatePresence","initial","Fragment","StyledContextMenu","className","displayName","_default","exports"],"sources":["../../../src/components/context-menu/ContextMenu.tsx"],"sourcesContent":["import { AnimatePresence } from 'framer-motion';\nimport React, {\n forwardRef,\n MouseEvent,\n MouseEventHandler,\n ReactNode,\n ReactPortal,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { useUuid } from '../../hooks/uuid';\nimport Icon from '../icon/Icon';\nimport { ContextMenuAlignment } from './constants/alignment';\nimport ContextMenuContent from './context-menu-content/ContextMenuContent';\nimport { StyledContextMenu } from './ContextMenu.styles';\n\nexport type ContextMenuCoordinates = {\n x: number;\n y: number;\n};\n\nexport type ContextMenuItem = {\n icons: string[];\n key: string;\n onClick: (event?: MouseEvent<HTMLDivElement>) => void;\n text: string;\n};\n\ntype ContextMenuRef = {\n hide: VoidFunction;\n show: VoidFunction;\n};\n\ntype ContextMenuProps = {\n /**\n * Optional custom alignment used instead of calculating it using the\n * alignment within the page. The available alignment can be taken from the\n * ContextMenuAlignment enum.\n */\n alignment?: ContextMenuAlignment;\n /**\n * The element over which the content of the `ContextMenu` should be displayed.\n */\n children?: ReactNode;\n /**\n * The element where the content of the `ContextMenu` should be rendered via React Portal.\n */\n container?: Element;\n /**\n * Optional own coordinates to be used instead of calculating the alignment\n * based on the alignment of the children.\n */\n coordinates?: ContextMenuCoordinates;\n /**\n * The items that will be displayed in the content of the `ContextMenu`.\n */\n items: ContextMenuItem[];\n /**\n * Function to be executed when the content of the Context menu has been hidden.\n */\n onHide?: VoidFunction;\n /**\n * Function to be executed when the content of the Context menu has been shown.\n */\n onShow?: VoidFunction;\n};\n\nconst ContextMenu = forwardRef<ContextMenuRef, ContextMenuProps>(\n (\n {\n alignment,\n children = <Icon icons={['ts-ellipsis_v']} />,\n container = document.body,\n coordinates,\n items,\n onHide,\n onShow,\n },\n ref\n ) => {\n const [internalCoordinates, setInternalCoordinates] = useState<ContextMenuCoordinates>({\n x: 0,\n y: 0,\n });\n const [internalAlignment, setInternalAlignment] = useState<ContextMenuAlignment>(\n ContextMenuAlignment.TopLeft\n );\n const [isContentShown, setIsContentShown] = useState(false);\n const [portal, setPortal] = useState<ReactPortal>();\n\n const uuid = useUuid();\n\n // ToDo: Replace with hook if new chayns api is ready\n const contextMenuContentRef = useRef<HTMLDivElement>(null);\n const contextMenuRef = useRef<HTMLSpanElement>(null);\n\n const handleHide = useCallback(() => {\n setIsContentShown(false);\n }, []);\n\n const handleShow = useCallback(async () => {\n const { isMobile, isTablet } = chayns.env;\n\n if (isMobile || isTablet) {\n // ToDo: Replace with new api function if new api is ready\n const { buttonType, selection } = await chayns.dialog.select({\n buttons: [],\n list: items.map(({ icons, text }, index) => ({\n name: text,\n value: index,\n icon: icons[0],\n })),\n type: 2,\n });\n\n if (buttonType === 1 && typeof selection[0]?.value === 'number') {\n items[selection[0].value]?.onClick();\n }\n } else if (contextMenuRef.current) {\n const rootElement = document.querySelector('.tapp') || document.body;\n\n const {\n x,\n y,\n height: childrenHeight,\n width: childrenWidth,\n } = contextMenuRef.current.getBoundingClientRect();\n\n setInternalCoordinates({ x: x + childrenWidth / 2, y: y + childrenHeight / 2 });\n\n const { height, width } = rootElement.getBoundingClientRect();\n\n if (x < width / 2) {\n if (y < height / 2) {\n setInternalAlignment(ContextMenuAlignment.BottomRight);\n } else {\n setInternalAlignment(ContextMenuAlignment.TopRight);\n }\n } else if (y < height / 2) {\n setInternalAlignment(ContextMenuAlignment.BottomLeft);\n } else {\n setInternalAlignment(ContextMenuAlignment.TopLeft);\n }\n\n setIsContentShown(true);\n }\n }, [items]);\n\n const handleClick = useCallback<MouseEventHandler<HTMLDivElement>>(\n (event) => {\n event.preventDefault();\n event.stopPropagation();\n\n void handleShow();\n },\n [handleShow]\n );\n\n const handleDocumentClick = useCallback<EventListener>(\n (event) => {\n if (!contextMenuContentRef.current?.contains(event.target as Node)) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n handleHide();\n },\n [handleHide]\n );\n\n useImperativeHandle(\n ref,\n () => ({\n hide: handleHide,\n show: handleShow,\n }),\n [handleHide, handleShow]\n );\n\n useEffect(() => {\n if (isContentShown) {\n document.addEventListener('click', handleDocumentClick, true);\n window.addEventListener('blur', handleHide);\n\n if (typeof onShow === 'function') {\n onShow();\n }\n } else if (typeof onHide === 'function') {\n onHide();\n }\n\n return () => {\n document.removeEventListener('click', handleDocumentClick, true);\n window.removeEventListener('blur', handleHide);\n };\n }, [handleDocumentClick, handleHide, isContentShown, onHide, onShow]);\n\n useEffect(() => {\n setPortal(() =>\n createPortal(\n <AnimatePresence initial={false}>\n {isContentShown && (\n <ContextMenuContent\n coordinates={coordinates ?? internalCoordinates}\n items={items}\n key={`contextMenu_${uuid}`}\n alignment={alignment ?? internalAlignment}\n ref={contextMenuContentRef}\n />\n )}\n </AnimatePresence>,\n container\n )\n );\n }, [\n alignment,\n container,\n coordinates,\n internalAlignment,\n internalCoordinates,\n isContentShown,\n items,\n uuid,\n ]);\n\n return (\n <>\n <StyledContextMenu\n className=\"beta-chayns-context-menu\"\n onClick={handleClick}\n ref={contextMenuRef}\n >\n {children}\n </StyledContextMenu>\n {portal}\n </>\n );\n }\n);\n\nContextMenu.displayName = 'ContextMenu';\n\nexport default ContextMenu;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAYA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,mBAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AAAyD,SAAAM,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,G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;EAEF,oBACI3D,MAAA,CAAAW,OAAA,CAAA0B,aAAA,CAAArC,MAAA,CAAAW,OAAA,CAAA0G,QAAA,qBACIrH,MAAA,CAAAW,OAAA,CAAA0B,aAAA,CAAC7B,YAAA,CAAA8G,iBAAiB;IACdC,SAAS,EAAC,0BAA0B;IACpChC,OAAO,EAAEY,WAAY;IACrBjE,GAAG,EAAE6B;EAAe,GAEnB3B,QACc,CAAC,EACnBqB,MACH,CAAC;AAEX,CACJ,CAAC;AAED1B,WAAW,CAACyF,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAEzB1F,WAAW;AAAA2F,OAAA,CAAA/G,OAAA,GAAA8G,QAAA"}
@@ -0,0 +1 @@
1
+ export declare const StyledContextMenu: import("styled-components").StyledComponent<"span", any, {}, never>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledContextMenu = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const StyledContextMenu = _styledComponents.default.span`
10
+ cursor: pointer;
11
+ `;
12
+ exports.StyledContextMenu = StyledContextMenu;
13
+ //# sourceMappingURL=ContextMenu.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextMenu.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledContextMenu","styled","span","exports"],"sources":["../../../src/components/context-menu/ContextMenu.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledContextMenu = styled.span`\n cursor: pointer;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhC,MAAMG,iBAAiB,GAAGC,yBAAM,CAACC,IAAK;AAC7C;AACA,CAAC;AAACC,OAAA,CAAAH,iBAAA,GAAAA,iBAAA"}
@@ -0,0 +1,8 @@
1
+ export declare enum ContextMenuAlignment {
2
+ TopLeft = 0,
3
+ BottomLeft = 1,
4
+ TopRight = 2,
5
+ BottomRight = 3,
6
+ TopCenter = 4,
7
+ BottomCenter = 5
8
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ContextMenuAlignment = void 0;
7
+ let ContextMenuAlignment = /*#__PURE__*/function (ContextMenuAlignment) {
8
+ ContextMenuAlignment[ContextMenuAlignment["TopLeft"] = 0] = "TopLeft";
9
+ ContextMenuAlignment[ContextMenuAlignment["BottomLeft"] = 1] = "BottomLeft";
10
+ ContextMenuAlignment[ContextMenuAlignment["TopRight"] = 2] = "TopRight";
11
+ ContextMenuAlignment[ContextMenuAlignment["BottomRight"] = 3] = "BottomRight";
12
+ ContextMenuAlignment[ContextMenuAlignment["TopCenter"] = 4] = "TopCenter";
13
+ ContextMenuAlignment[ContextMenuAlignment["BottomCenter"] = 5] = "BottomCenter";
14
+ return ContextMenuAlignment;
15
+ }({});
16
+ exports.ContextMenuAlignment = ContextMenuAlignment;
17
+ //# sourceMappingURL=alignment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alignment.js","names":["ContextMenuAlignment","exports"],"sources":["../../../../src/components/context-menu/constants/alignment.ts"],"sourcesContent":["export enum ContextMenuAlignment {\n TopLeft,\n BottomLeft,\n TopRight,\n BottomRight,\n TopCenter,\n BottomCenter,\n}\n"],"mappings":";;;;;;IAAYA,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAAAC,OAAA,CAAAD,oBAAA,GAAAA,oBAAA"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { ContextMenuAlignment } from '../constants/alignment';
3
+ import type { ContextMenuCoordinates, ContextMenuItem } from '../ContextMenu';
4
+ type ContextMenuContentProps = {
5
+ alignment: ContextMenuAlignment;
6
+ coordinates: ContextMenuCoordinates;
7
+ items: ContextMenuItem[];
8
+ };
9
+ declare const ContextMenuContent: React.ForwardRefExoticComponent<ContextMenuContentProps & React.RefAttributes<HTMLDivElement>>;
10
+ export default ContextMenuContent;