@semcore/button 5.36.0 → 5.37.0

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 (68) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/component/AbstractButton/AbstractButton.js +182 -0
  3. package/lib/cjs/component/AbstractButton/AbstractButton.js.map +1 -0
  4. package/lib/cjs/component/AbstractButton/AbstractButton.type.js +2 -0
  5. package/lib/cjs/component/AbstractButton/AbstractButton.type.js.map +1 -0
  6. package/lib/cjs/component/AbstractButton/SpinButton.js.map +1 -0
  7. package/lib/cjs/component/Button/Button.js +94 -0
  8. package/lib/cjs/component/Button/Button.js.map +1 -0
  9. package/lib/cjs/component/Button/Button.type.js +2 -0
  10. package/lib/cjs/component/Button/Button.type.js.map +1 -0
  11. package/lib/cjs/{style → component/Button}/button.shadow.css +1 -1
  12. package/lib/cjs/component/ButtonLink/ButtonLink.js +92 -0
  13. package/lib/cjs/component/ButtonLink/ButtonLink.js.map +1 -0
  14. package/lib/cjs/component/ButtonLink/ButtonLink.type.js +2 -0
  15. package/lib/cjs/component/ButtonLink/ButtonLink.type.js.map +1 -0
  16. package/lib/cjs/component/ButtonLink/buttonLink.shadow.css +160 -0
  17. package/lib/cjs/index.js +40 -6
  18. package/lib/cjs/index.js.map +1 -1
  19. package/lib/es6/component/AbstractButton/AbstractButton.js +175 -0
  20. package/lib/es6/component/AbstractButton/AbstractButton.js.map +1 -0
  21. package/lib/es6/component/AbstractButton/AbstractButton.type.js +2 -0
  22. package/lib/es6/component/AbstractButton/AbstractButton.type.js.map +1 -0
  23. package/lib/es6/component/AbstractButton/SpinButton.js.map +1 -0
  24. package/lib/es6/component/Button/Button.js +87 -0
  25. package/lib/es6/component/Button/Button.js.map +1 -0
  26. package/lib/es6/component/Button/Button.type.js +2 -0
  27. package/lib/es6/component/Button/Button.type.js.map +1 -0
  28. package/lib/es6/{style → component/Button}/button.shadow.css +1 -1
  29. package/lib/es6/component/ButtonLink/ButtonLink.js +85 -0
  30. package/lib/es6/component/ButtonLink/ButtonLink.js.map +1 -0
  31. package/lib/es6/component/ButtonLink/ButtonLink.type.js +2 -0
  32. package/lib/es6/component/ButtonLink/ButtonLink.type.js.map +1 -0
  33. package/lib/es6/component/ButtonLink/buttonLink.shadow.css +160 -0
  34. package/lib/es6/index.js +5 -2
  35. package/lib/es6/index.js.map +1 -1
  36. package/lib/types/component/AbstractButton/AbstractButton.d.ts +24 -0
  37. package/lib/types/component/AbstractButton/AbstractButton.type.d.ts +39 -0
  38. package/lib/types/component/AbstractButton/SpinButton.d.ts +3 -0
  39. package/lib/types/component/Button/Button.d.ts +3 -0
  40. package/lib/types/component/Button/Button.type.d.ts +39 -0
  41. package/lib/types/component/ButtonLink/ButtonLink.d.ts +2 -0
  42. package/lib/types/component/ButtonLink/ButtonLink.type.d.ts +25 -0
  43. package/lib/types/index.d.ts +5 -68
  44. package/package.json +12 -7
  45. package/src/{Button.jsx → component/AbstractButton/AbstractButton.tsx} +24 -38
  46. package/src/component/AbstractButton/AbstractButton.type.ts +46 -0
  47. package/src/{SpinButton.jsx → component/AbstractButton/SpinButton.tsx} +2 -2
  48. package/src/component/Button/Button.tsx +45 -0
  49. package/src/component/Button/Button.type.ts +48 -0
  50. package/src/{style → component/Button}/button.shadow.css +1 -1
  51. package/src/component/ButtonLink/ButtonLink.tsx +42 -0
  52. package/src/component/ButtonLink/ButtonLink.type.ts +41 -0
  53. package/src/component/ButtonLink/buttonLink.shadow.css +160 -0
  54. package/src/index.ts +5 -0
  55. package/lib/cjs/Button.js +0 -237
  56. package/lib/cjs/Button.js.map +0 -1
  57. package/lib/cjs/SpinButton.js.map +0 -1
  58. package/lib/cjs/index.d.js +0 -2
  59. package/lib/cjs/index.d.js.map +0 -1
  60. package/lib/es6/Button.js +0 -231
  61. package/lib/es6/Button.js.map +0 -1
  62. package/lib/es6/SpinButton.js.map +0 -1
  63. package/lib/es6/index.d.js +0 -2
  64. package/lib/es6/index.d.js.map +0 -1
  65. package/src/index.d.ts +0 -68
  66. package/src/index.js +0 -2
  67. /package/lib/cjs/{SpinButton.js → component/AbstractButton/SpinButton.js} +0 -0
  68. /package/lib/es6/{SpinButton.js → component/AbstractButton/SpinButton.js} +0 -0
package/lib/cjs/Button.js DELETED
@@ -1,237 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = exports.MAP_USE_DEFAULT_THEME = void 0;
9
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
13
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
15
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
- var _index = require("@semcore/utils/lib/core/index");
17
- var _core = _interopRequireWildcard(require("@semcore/core"));
18
- var _react = _interopRequireDefault(require("react"));
19
- var _flexBox = require("@semcore/flex-box");
20
- var _tooltip = require("@semcore/tooltip");
21
- var _neighborLocation = _interopRequireDefault(require("@semcore/neighbor-location"));
22
- var _keyboardFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/keyboardFocusEnhance"));
23
- var _addonTextChildren = _interopRequireDefault(require("@semcore/utils/lib/addonTextChildren"));
24
- var _logger = _interopRequireDefault(require("@semcore/utils/lib/logger"));
25
- var _SpinButton = _interopRequireDefault(require("./SpinButton"));
26
- var _hasLabels = _interopRequireDefault(require("@semcore/utils/lib/hasLabels"));
27
- /*__reshadow-styles__:"./style/button.shadow.css"*/
28
- var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SButton_i9ui3_gg_{position:relative;display:inline-block;align-items:center;justify-content:center;padding:0;margin:0;white-space:nowrap;font-family:inherit;line-height:normal;-webkit-text-decoration:none;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;outline:0;box-shadow:none;cursor:pointer;box-sizing:border-box;overflow:visible;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;font-weight:var(--intergalactic-medium, 500);color:var(--intergalactic-text-secondary, #6c6e79);min-width:-moz-fit-content;min-width:fit-content}.___SButton_i9ui3_gg_::-moz-focus-inner{padding:0;border:0}.___SButton_i9ui3_gg_:active,.___SButton_i9ui3_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SButton_i9ui3_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SButton_i9ui3_gg_.__keyboardFocused_i9ui3_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));z-index:1}.___SButton_i9ui3_gg_.__disabled_i9ui3_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;box-shadow:none;z-index:0}.___SButton_i9ui3_gg_._size_s_i9ui3_gg_{width:var(--intergalactic-form-control-s, 20px);height:var(--intergalactic-form-control-s, 20px);border-radius:var(--intergalactic-addon-rounded, 4px)}.___SButton_i9ui3_gg_._size_m_i9ui3_gg_{height:var(--intergalactic-form-control-m, 28px);border-radius:var(--intergalactic-control-rounded, 6px);font-size:var(--intergalactic-fs-200, 14px)}.___SButton_i9ui3_gg_._size_l_i9ui3_gg_{height:var(--intergalactic-form-control-l, 40px);border-radius:var(--intergalactic-control-rounded, 6px);font-size:var(--intergalactic-fs-300, 16px)}.___SButton_i9ui3_gg_._theme_primary-info_i9ui3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-primary-info, #008ff8)}@media (hover:hover){.___SButton_i9ui3_gg_._theme_primary-info_i9ui3_gg_:hover{background-color:var(--intergalactic-control-primary-info-hover, #006dca)}}.___SButton_i9ui3_gg_._theme_primary-info_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_primary-info_i9ui3_gg_:active{background-color:var(--intergalactic-control-primary-info-active, #044792)}.___SButton_i9ui3_gg_._theme_primary-success_i9ui3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-primary-success, #009f81)}@media (hover:hover){.___SButton_i9ui3_gg_._theme_primary-success_i9ui3_gg_:hover{background-color:var(--intergalactic-control-primary-success-hover, #007c65)}}.___SButton_i9ui3_gg_._theme_primary-success_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_primary-success_i9ui3_gg_:active{background-color:var(--intergalactic-control-primary-success-active, #055345)}.___SButton_i9ui3_gg_._theme_primary-warning_i9ui3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-primary-brand, #ff642d)}@media (hover:hover){.___SButton_i9ui3_gg_._theme_primary-warning_i9ui3_gg_:hover{background-color:var(--intergalactic-control-primary-brand-hover, #c33909)}}.___SButton_i9ui3_gg_._theme_primary-warning_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_primary-warning_i9ui3_gg_:active{background-color:var(--intergalactic-control-primary-brand-active, #c33909)}.___SButton_i9ui3_gg_._theme_primary-danger_i9ui3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-primary-critical, #ff4953)}@media (hover:hover){.___SButton_i9ui3_gg_._theme_primary-danger_i9ui3_gg_:hover{background-color:var(--intergalactic-control-primary-critical-hover, #d1002f)}}.___SButton_i9ui3_gg_._theme_primary-danger_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_primary-danger_i9ui3_gg_:active{background-color:var(--intergalactic-control-primary-critical-active, #8e0016)}.___SButton_i9ui3_gg_._theme_primary-invert_i9ui3_gg_{color:var(--intergalactic-text-primary, #191b23);background-color:var(--intergalactic-control-primary-invert, #ffffff)}@media (hover:hover){.___SButton_i9ui3_gg_._theme_primary-invert_i9ui3_gg_:hover{background-color:var(--intergalactic-control-primary-invert-hover, #f4f5f9)}}.___SButton_i9ui3_gg_._theme_primary-invert_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_primary-invert_i9ui3_gg_:active{background-color:var(--intergalactic-control-primary-invert-active, #e0e1e9)}.___SButton_i9ui3_gg_._theme_secondary-muted_i9ui3_gg_{color:var(--intergalactic-text-secondary, #6c6e79);border-color:var(--intergalactic-border-primary, #c4c7cf);background-color:var(--intergalactic-control-secondary-neutral, rgba(138, 142, 155, 0.1))}@media (hover:hover){.___SButton_i9ui3_gg_._theme_secondary-muted_i9ui3_gg_:hover{background-color:var(--intergalactic-control-secondary-neutral-hover,\n rgba(138, 142, 155, 0.2));color:var(--intergalactic-text-primary, #191b23)}}.___SButton_i9ui3_gg_._theme_secondary-muted_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_secondary-muted_i9ui3_gg_:active{background-color:var(--intergalactic-control-secondary-neutral-active,\n rgba(138, 142, 155, 0.3));color:var(--intergalactic-text-primary, #191b23)}.___SButton_i9ui3_gg_._theme_secondary-info_i9ui3_gg_{background-color:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));color:var(--intergalactic-text-link, #006dca);border-color:var(--intergalactic-control-primary-info, #008ff8)}@media (hover:hover){.___SButton_i9ui3_gg_._theme_secondary-info_i9ui3_gg_:hover{background-color:var(--intergalactic-control-secondary-info-hover, rgba(0, 143, 248, 0.2))}}.___SButton_i9ui3_gg_._theme_secondary-info_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_secondary-info_i9ui3_gg_:active{background-color:var(--intergalactic-control-secondary-info-active, rgba(0, 143, 248, 0.3))}.___SButton_i9ui3_gg_._theme_secondary-invert_i9ui3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);border-color:var(--intergalactic-border-primary-invert, #ffffff);background-color:var(--intergalactic-control-secondary-invert, rgba(255, 255, 255, 0.05))}@media (hover:hover){.___SButton_i9ui3_gg_._theme_secondary-invert_i9ui3_gg_:hover{background-color:var(--intergalactic-control-secondary-invert-hover, rgba(255, 255, 255, 0.1))}}.___SButton_i9ui3_gg_._theme_secondary-invert_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_secondary-invert_i9ui3_gg_:active{background-color:var(--intergalactic-control-secondary-invert-active,\n rgba(255, 255, 255, 0.3))}.___SButton_i9ui3_gg_._theme_tertiary-info_i9ui3_gg_{color:var(--intergalactic-text-link, #006dca);background-color:var(--intergalactic-control-tertiary-info, rgba(0, 143, 248, 0))}@media (hover:hover){.___SButton_i9ui3_gg_._theme_tertiary-info_i9ui3_gg_:hover{background-color:var(--intergalactic-control-tertiary-info-hover, rgba(0, 143, 248, 0.2))}}.___SButton_i9ui3_gg_._theme_tertiary-info_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_tertiary-info_i9ui3_gg_:active{background-color:var(--intergalactic-control-tertiary-info-active, rgba(0, 143, 248, 0.3))}.___SButton_i9ui3_gg_._theme_tertiary-muted_i9ui3_gg_{color:var(--intergalactic-text-secondary, #6c6e79);background-color:var(--intergalactic-control-tertiary-neutral, rgba(138, 142, 155, 0))}@media (hover:hover){.___SButton_i9ui3_gg_._theme_tertiary-muted_i9ui3_gg_:hover{background-color:var(--intergalactic-control-tertiary-neutral-hover, rgba(138, 142, 155, 0.2));color:var(--intergalactic-text-primary, #191b23)}}.___SButton_i9ui3_gg_._theme_tertiary-muted_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_tertiary-muted_i9ui3_gg_:active{background-color:var(--intergalactic-control-tertiary-neutral-active,\n rgba(138, 142, 155, 0.3));color:var(--intergalactic-text-primary, #191b23)}.___SButton_i9ui3_gg_._theme_tertiary-invert_i9ui3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-tertiary-invert, rgba(255, 255, 255, 0))}@media (hover:hover){.___SButton_i9ui3_gg_._theme_tertiary-invert_i9ui3_gg_:hover{background-color:var(--intergalactic-control-tertiary-invert-hover, rgba(255, 255, 255, 0.1))}}.___SButton_i9ui3_gg_._theme_tertiary-invert_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_tertiary-invert_i9ui3_gg_:active{background-color:var(--intergalactic-control-tertiary-invert-active, rgba(255, 255, 255, 0.3))}.___SButton_i9ui3_gg_._neighborLocation_right_i9ui3_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_i9ui3_gg_._neighborLocation_both_i9ui3_gg_{border-radius:0;margin-left:-1px}.___SButton_i9ui3_gg_._neighborLocation_left_i9ui3_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_i9ui3_gg_._neighborLocation_both_i9ui3_gg_,.___SButton_i9ui3_gg_._neighborLocation_left_i9ui3_gg_{position:relative}.___SButton_i9ui3_gg_._neighborLocation_both_i9ui3_gg_:after,.___SButton_i9ui3_gg_._neighborLocation_left_i9ui3_gg_:after{background-color:var(--intergalactic-text-primary-invert, #ffffff)}.___SButton_i9ui3_gg_._neighborLocation_both_i9ui3_gg_._theme_secondary-muted_i9ui3_gg_:after,.___SButton_i9ui3_gg_._neighborLocation_left_i9ui3_gg_._theme_secondary-muted_i9ui3_gg_:after{background-color:var(--intergalactic-border-primary, #c4c7cf)}.___SButton_i9ui3_gg_+.___SButton_i9ui3_gg_._neighborLocation_both_i9ui3_gg_:after,.___SButton_i9ui3_gg_+.___SButton_i9ui3_gg_._neighborLocation_left_i9ui3_gg_:after{content:\"\";position:absolute;top:-1px;left:-1px;width:1px;height:calc(100% + 2px)}.___SSpin_i9ui3_gg_{position:absolute;top:0;left:0;width:100%;height:100%;display:flex}.___SInner_i9ui3_gg_{display:inline-flex;align-items:center;justify-content:center;height:100%;width:100%}.___SInner_i9ui3_gg_.__loading_i9ui3_gg_{visibility:hidden}.___SText_i9ui3_gg_{display:inline-flex}.___SText_i9ui3_gg_._size_l_i9ui3_gg_,.___SText_i9ui3_gg_._size_m_i9ui3_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SText_i9ui3_gg_._size_m_i9ui3_gg_{line-height:var(--intergalactic-lh-200, 142%)}.___SText_i9ui3_gg_._size_l_i9ui3_gg_{line-height:var(--intergalactic-lh-300, 150%)}.___SText_i9ui3_gg_._size_l_i9ui3_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SText_i9ui3_gg_._size_l_i9ui3_gg_:first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SText_i9ui3_gg_._size_l_i9ui3_gg_:last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SAddon_i9ui3_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_i9ui3_gg_._size_m_i9ui3_gg_:not(:only-child):first-child{margin-left:calc(var(--intergalactic-spacing-2x, 8px) - 1px)}.___SAddon_i9ui3_gg_._size_m_i9ui3_gg_:not(:only-child):last-child{margin-right:calc(var(--intergalactic-spacing-2x, 8px) - 1px)}.___SAddon_i9ui3_gg_._size_m_i9ui3_gg_:only-child{margin-left:calc(1.5*var(--intergalactic-spacing-1x, 4px) - 1px);margin-right:calc(1.5*var(--intergalactic-spacing-1x, 4px) - 1px)}.___SAddon_i9ui3_gg_._size_l_i9ui3_gg_:not(:only-child):first-child{margin-left:calc(var(--intergalactic-spacing-3x, 12px) - 1px)}.___SAddon_i9ui3_gg_._size_l_i9ui3_gg_:not(:only-child):last-child{margin-right:calc(var(--intergalactic-spacing-3x, 12px) - 1px)}.___SAddon_i9ui3_gg_._size_l_i9ui3_gg_:only-child{margin-left:calc(3*var(--intergalactic-spacing-1x, 4px) - 1px);margin-right:calc(3*var(--intergalactic-spacing-1x, 4px) - 1px)}" /*__inner_css_end__*/, "i9ui3_gg_") /*__reshadow_css_end__*/, {
29
- "__SButton": "___SButton_i9ui3_gg_",
30
- "_keyboardFocused": "__keyboardFocused_i9ui3_gg_",
31
- "_disabled": "__disabled_i9ui3_gg_",
32
- "_size_s": "_size_s_i9ui3_gg_",
33
- "_size_m": "_size_m_i9ui3_gg_",
34
- "_size_l": "_size_l_i9ui3_gg_",
35
- "_neighborLocation_right": "_neighborLocation_right_i9ui3_gg_",
36
- "_neighborLocation_both": "_neighborLocation_both_i9ui3_gg_",
37
- "_neighborLocation_left": "_neighborLocation_left_i9ui3_gg_",
38
- "__SSpin": "___SSpin_i9ui3_gg_",
39
- "__SInner": "___SInner_i9ui3_gg_",
40
- "_loading": "__loading_i9ui3_gg_",
41
- "__SText": "___SText_i9ui3_gg_",
42
- "__SAddon": "___SAddon_i9ui3_gg_",
43
- "_theme_primary-info": "_theme_primary-info_i9ui3_gg_",
44
- "_active": "__active_i9ui3_gg_",
45
- "_theme_primary-success": "_theme_primary-success_i9ui3_gg_",
46
- "_theme_primary-warning": "_theme_primary-warning_i9ui3_gg_",
47
- "_theme_primary-danger": "_theme_primary-danger_i9ui3_gg_",
48
- "_theme_primary-invert": "_theme_primary-invert_i9ui3_gg_",
49
- "_theme_secondary-muted": "_theme_secondary-muted_i9ui3_gg_",
50
- "_theme_secondary-info": "_theme_secondary-info_i9ui3_gg_",
51
- "_theme_secondary-invert": "_theme_secondary-invert_i9ui3_gg_",
52
- "_theme_tertiary-info": "_theme_tertiary-info_i9ui3_gg_",
53
- "_theme_tertiary-muted": "_theme_tertiary-muted_i9ui3_gg_",
54
- "_theme_tertiary-invert": "_theme_tertiary-invert_i9ui3_gg_"
55
- });
56
- var MAP_USE_DEFAULT_THEME = {
57
- primary: 'info',
58
- secondary: 'muted',
59
- tertiary: 'info'
60
- };
61
- exports.MAP_USE_DEFAULT_THEME = MAP_USE_DEFAULT_THEME;
62
- var RootButton = /*#__PURE__*/function (_Component) {
63
- (0, _inherits2["default"])(RootButton, _Component);
64
- var _super = (0, _createSuper2["default"])(RootButton);
65
- function RootButton() {
66
- var _this;
67
- (0, _classCallCheck2["default"])(this, RootButton);
68
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
69
- args[_key] = arguments[_key];
70
- }
71
- _this = _super.call.apply(_super, [this].concat(args));
72
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "containerRef", /*#__PURE__*/_react["default"].createRef());
73
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
74
- ariaLabelledByContent: null
75
- });
76
- return _this;
77
- }
78
- (0, _createClass2["default"])(RootButton, [{
79
- key: "getTextProps",
80
- value: function getTextProps() {
81
- var size = this.asProps.size;
82
- return {
83
- size: size
84
- };
85
- }
86
- }, {
87
- key: "getAddonProps",
88
- value: function getAddonProps() {
89
- var size = this.asProps.size;
90
- return {
91
- size: size
92
- };
93
- }
94
- }, {
95
- key: "componentDidMount",
96
- value: function componentDidMount() {
97
- var _this2 = this;
98
- if (process.env.NODE_ENV !== 'production') {
99
- _logger["default"].warn(this.containerRef.current && !(0, _hasLabels["default"])(this.containerRef.current) && !this.asProps.title, "'title' or 'aria-label' or 'aria-labelledby' are required props for buttons without text content", this.asProps['data-ui-name'] || RootButton.displayName);
100
- }
101
- if (this.asProps['aria-labelledby']) {
102
- setTimeout(function () {
103
- var _document$getElementB, _document$getElementB2;
104
- _this2.setState({
105
- ariaLabelledByContent: (_document$getElementB = (_document$getElementB2 = document.getElementById(_this2.asProps['aria-labelledby'])) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.textContent) !== null && _document$getElementB !== void 0 ? _document$getElementB : ''
106
- });
107
- }, 0);
108
- }
109
- }
110
- }, {
111
- key: "renderButton",
112
- value: function renderButton(_ref10) {
113
- var _ref = this.asProps,
114
- _ref5;
115
- var buttonProps = _ref10.buttonProps,
116
- children = _ref10.children;
117
- var styles = this.asProps.styles;
118
- var SButton = _flexBox.Box;
119
- return _ref5 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SButton, _ref5.cn("SButton", (0, _objectSpread2["default"])({}, (0, _core.assignProps)((0, _objectSpread2["default"])({}, buttonProps), _ref))), children);
120
- }
121
- }, {
122
- key: "renderButtonWithHint",
123
- value: function renderButtonWithHint(_ref11) {
124
- var _ref2 = this.asProps,
125
- _ref6;
126
- var buttonProps = _ref11.buttonProps,
127
- children = _ref11.children,
128
- hintProps = _ref11.hintProps;
129
- var styles = this.asProps.styles;
130
- var SButton = _tooltip.Hint;
131
- return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SButton, _ref6.cn("SButton", (0, _objectSpread2["default"])({}, (0, _core.assignProps)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, buttonProps), hintProps), _ref2))), children);
132
- }
133
- }, {
134
- key: "render",
135
- value: function render() {
136
- var _ref12,
137
- _ref13,
138
- _this3 = this;
139
- var _this$asProps = this.asProps,
140
- styles = _this$asProps.styles,
141
- use = _this$asProps.use,
142
- _this$asProps$theme = _this$asProps.theme,
143
- theme = _this$asProps$theme === void 0 ? typeof use === 'string' && MAP_USE_DEFAULT_THEME[use] : _this$asProps$theme,
144
- loading = _this$asProps.loading,
145
- _this$asProps$disable = _this$asProps.disabled,
146
- disabled = _this$asProps$disable === void 0 ? loading : _this$asProps$disable,
147
- size = _this$asProps.size,
148
- neighborLocation = _this$asProps.neighborLocation,
149
- hasChildren = _this$asProps.children,
150
- title = _this$asProps.title,
151
- ariaLabel = _this$asProps['aria-label'],
152
- Children = _this$asProps.Children,
153
- AddonLeft = _this$asProps.addonLeft,
154
- AddonRight = _this$asProps.addonRight,
155
- hintPlacement = _this$asProps.hintPlacement;
156
- var useTheme = use && theme ? "".concat(use, "-").concat(theme) : false;
157
- var SInner = _flexBox.Box;
158
- var SSpin = _flexBox.Box;
159
- var buttonAriaLabel = (_ref12 = (_ref13 = title !== null && title !== void 0 ? title : ariaLabel) !== null && _ref13 !== void 0 ? _ref13 : this.state.ariaLabelledByContent) !== null && _ref12 !== void 0 ? _ref12 : '';
160
- var buttonProps = {
161
- type: 'button',
162
- tag: 'button',
163
- disabled: disabled,
164
- 'use:theme': useTheme,
165
- ref: this.containerRef,
166
- 'aria-busy': loading,
167
- 'aria-disabled': disabled,
168
- __excludeProps: ['title']
169
- };
170
- var hintProps = {
171
- title: buttonAriaLabel,
172
- timeout: [250, 50],
173
- placement: hintPlacement,
174
- theme: theme === 'invert' ? 'invert' : undefined,
175
- __excludeProps: []
176
- };
177
- return /*#__PURE__*/_react["default"].createElement(_neighborLocation["default"].Detect, {
178
- neighborLocation: neighborLocation
179
- }, function (neighborLocation) {
180
- var _ref7;
181
- var children = (_ref7 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(SInner, _ref7.cn("SInner", {
182
- "tag": 'span',
183
- "loading": loading
184
- }), AddonLeft ? /*#__PURE__*/_react["default"].createElement(Button.Addon, null, /*#__PURE__*/_react["default"].createElement(AddonLeft, _ref7.cn("AddonLeft", {}))) : null, (0, _addonTextChildren["default"])(Children, Button.Text, Button.Addon), AddonRight ? /*#__PURE__*/_react["default"].createElement(Button.Addon, null, /*#__PURE__*/_react["default"].createElement(AddonRight, _ref7.cn("AddonRight", {}))) : null), loading && /*#__PURE__*/_react["default"].createElement(SSpin, _ref7.cn("SSpin", {
185
- "tag": 'span'
186
- }), /*#__PURE__*/_react["default"].createElement(_SpinButton["default"], _ref7.cn("SpinButton", {
187
- "centered": true,
188
- "size": size,
189
- "theme": useTheme
190
- })))));
191
- buttonProps.neighborLocation = neighborLocation;
192
- if (!hasChildren || title) {
193
- return _this3.renderButtonWithHint({
194
- buttonProps: buttonProps,
195
- hintProps: hintProps,
196
- children: children
197
- });
198
- }
199
- return _this3.renderButton({
200
- buttonProps: buttonProps,
201
- children: children
202
- });
203
- });
204
- }
205
- }]);
206
- return RootButton;
207
- }(_core.Component);
208
- (0, _defineProperty2["default"])(RootButton, "displayName", 'Button');
209
- (0, _defineProperty2["default"])(RootButton, "enhance", [(0, _keyboardFocusEnhance["default"])()]);
210
- (0, _defineProperty2["default"])(RootButton, "style", style);
211
- (0, _defineProperty2["default"])(RootButton, "defaultProps", {
212
- use: 'secondary',
213
- size: 'm'
214
- });
215
- function Text(props) {
216
- var _ref3 = arguments[0],
217
- _ref8;
218
- var SText = _flexBox.Box;
219
- return _ref8 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SText, _ref8.cn("SText", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
220
- "tag": 'span'
221
- }, _ref3))));
222
- }
223
- function Addon(props) {
224
- var _ref4 = arguments[0],
225
- _ref9;
226
- var SAddon = _flexBox.Box;
227
- return _ref9 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SAddon, _ref9.cn("SAddon", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
228
- "tag": 'span'
229
- }, _ref4))));
230
- }
231
- var Button = (0, _core["default"])(RootButton, {
232
- Text: Text,
233
- Addon: Addon
234
- });
235
- var _default = Button;
236
- exports["default"] = _default;
237
- //# sourceMappingURL=Button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_tooltip","_neighborLocation","_keyboardFocusEnhance","_addonTextChildren","_logger","_SpinButton","_hasLabels","style","_index","sstyled","insert","MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","exports","RootButton","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","React","createRef","ariaLabelledByContent","_createClass2","key","value","getTextProps","size","asProps","getAddonProps","componentDidMount","_this2","process","env","NODE_ENV","logger","warn","containerRef","current","hasLabels","title","displayName","setTimeout","_document$getElementB","_document$getElementB2","setState","document","getElementById","textContent","renderButton","_ref10","_ref","_ref5","buttonProps","children","styles","SButton","Box","createElement","cn","_objectSpread2","assignProps","renderButtonWithHint","_ref11","_ref2","_ref6","hintProps","Hint","render","_ref12","_ref13","_this3","_this$asProps","use","_this$asProps$theme","theme","loading","_this$asProps$disable","disabled","neighborLocation","hasChildren","ariaLabel","Children","AddonLeft","addonLeft","AddonRight","addonRight","hintPlacement","useTheme","SInner","SSpin","buttonAriaLabel","state","type","tag","ref","__excludeProps","timeout","placement","undefined","Detect","_ref7","Fragment","Button","Addon","addonTextChildren","Text","Component","keyboardFocusEnhance","props","_ref3","arguments[0]","_ref8","SText","_ref4","_ref9","SAddon","createComponent","_default"],"sources":["../../src/Button.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { Hint } from '@semcore/tooltip';\nimport NeighborLocation from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport logger from '@semcore/utils/lib/logger';\nimport SpinButton from './SpinButton';\n\nimport style from './style/button.shadow.css';\nimport hasLabels from '@semcore/utils/lib/hasLabels';\n\nexport const MAP_USE_DEFAULT_THEME = {\n primary: 'info',\n secondary: 'muted',\n tertiary: 'info',\n};\n\nclass RootButton extends Component {\n static displayName = 'Button';\n static enhance = [keyboardFocusEnhance()];\n static style = style;\n static defaultProps = {\n use: 'secondary',\n size: 'm',\n };\n containerRef = React.createRef();\n\n state = {\n ariaLabelledByContent: null,\n };\n\n getTextProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n getAddonProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n componentDidMount() {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(\n this.containerRef.current && !hasLabels(this.containerRef.current) && !this.asProps.title,\n `'title' or 'aria-label' or 'aria-labelledby' are required props for buttons without text content`,\n this.asProps['data-ui-name'] || RootButton.displayName,\n );\n }\n\n if (this.asProps['aria-labelledby']) {\n setTimeout(() => {\n this.setState({\n ariaLabelledByContent:\n document.getElementById(this.asProps['aria-labelledby'])?.textContent ?? '',\n });\n }, 0);\n }\n }\n\n renderButton({ buttonProps, children }) {\n const { styles } = this.asProps;\n const SButton = Root;\n\n return sstyled(styles)(\n <SButton render={Box} {...buttonProps}>\n {children}\n </SButton>,\n );\n }\n\n renderButtonWithHint({ buttonProps, children, hintProps }) {\n const { styles } = this.asProps;\n const SButton = Root;\n\n return sstyled(styles)(\n <SButton render={Hint} {...buttonProps} {...hintProps}>\n {children}\n </SButton>,\n );\n }\n\n render() {\n const {\n styles,\n use,\n theme = typeof use === 'string' && MAP_USE_DEFAULT_THEME[use],\n loading,\n disabled = loading,\n size,\n neighborLocation,\n children: hasChildren,\n title,\n ['aria-label']: ariaLabel,\n Children,\n addonLeft: AddonLeft,\n addonRight: AddonRight,\n hintPlacement,\n } = this.asProps;\n const useTheme = use && theme ? `${use}-${theme}` : false;\n const SInner = Box;\n const SSpin = Box;\n const buttonAriaLabel = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? '';\n\n const buttonProps = {\n type: 'button',\n tag: 'button',\n disabled,\n 'use:theme': useTheme,\n ref: this.containerRef,\n 'aria-busy': loading,\n 'aria-disabled': disabled,\n __excludeProps: ['title'],\n };\n\n const hintProps = {\n title: buttonAriaLabel,\n timeout: [250, 50],\n placement: hintPlacement,\n theme: theme === 'invert' ? 'invert' : undefined,\n __excludeProps: [],\n };\n\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) => {\n const children = sstyled(styles)(\n <>\n <SInner tag='span' loading={loading}>\n {AddonLeft ? (\n <Button.Addon>\n <AddonLeft />\n </Button.Addon>\n ) : null}\n {addonTextChildren(Children, Button.Text, Button.Addon)}\n {AddonRight ? (\n <Button.Addon>\n <AddonRight />\n </Button.Addon>\n ) : null}\n </SInner>\n {loading && (\n <SSpin tag='span'>\n <SpinButton centered size={size} theme={useTheme} />\n </SSpin>\n )}\n </>,\n );\n buttonProps.neighborLocation = neighborLocation;\n\n if (!hasChildren || title) {\n return this.renderButtonWithHint({ buttonProps, hintProps, children });\n }\n\n return this.renderButton({ buttonProps, children });\n }}\n </NeighborLocation.Detect>\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n return sstyled(props.styles)(<SText render={Box} tag='span' />);\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} tag='span' />);\n}\n\nconst Button = createComponent(RootButton, {\n Text,\n Addon,\n});\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,qBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,kBAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,OAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,WAAA,GAAAP,sBAAA,CAAAF,OAAA;AAGA,IAAAU,UAAA,GAAAR,sBAAA,CAAAF,OAAA;AAAqD;AAAA,IAAAW,KAAA,+BAAAC,MAAA,CAAAC,OAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAE9C,IAAMC,qBAAqB,GAAG;EACnCC,OAAO,EAAE,MAAM;EACfC,SAAS,EAAE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ACJF,KAAK,EAALA;AACF,CAAC,CAAC;AAAC,IAAAc,QAAA,GAEYf,MAAM;AAAAtG,OAAA,cAAAqH,QAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpinButton.js","names":["_react","_interopRequireDefault","require","_spin","_excluded","SPIN_SIZE_MAP","xl","l","m","s","exports","SpinButton","_ref","theme","size","others","_objectWithoutProperties2","createElement","_extends2"],"sources":["../../src/SpinButton.jsx"],"sourcesContent":["import React from 'react';\nimport Spin from '@semcore/spin';\n\nexport const SPIN_SIZE_MAP = {\n xl: 'm',\n l: 's',\n m: 'xs',\n s: 'xxs',\n};\n\nexport default function SpinButton({ theme, size, ...others }) {\n return (\n <Spin\n size={typeof size === 'string' ? SPIN_SIZE_MAP[size] : size}\n theme='currentColor'\n {...others}\n />\n );\n}\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAiC,IAAAE,SAAA;AAE1B,IAAMC,aAAa,GAAG;EAC3BC,EAAE,EAAE,GAAG;EACPC,CAAC,EAAE,GAAG;EACNC,CAAC,EAAE,IAAI;EACPC,CAAC,EAAE;AACL,CAAC;AAACC,OAAA,CAAAL,aAAA,GAAAA,aAAA;AAEa,SAASM,UAAUA,CAAAC,IAAA,EAA6B;EAAA,IAA1BC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAKC,MAAM,OAAAC,yBAAA,aAAAJ,IAAA,EAAAR,SAAA;EACzD,oBACEJ,MAAA,YAAAiB,aAAA,CAACd,KAAA,WAAI,MAAAe,SAAA;IACHJ,IAAI,EAAE,OAAOA,IAAI,KAAK,QAAQ,GAAGT,aAAa,CAACS,IAAI,CAAC,GAAGA,IAAK;IAC5DD,KAAK,EAAC;EAAc,GAChBE,MAAM,EACV;AAEN"}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=index.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { BoxProps } from '@semcore/flex-box';\nimport { NeighborItemProps } from '@semcore/neighbor-location';\nimport { TooltipHintProps } from '@semcore/tooltip';\n\nexport type ButtonSize = 'l' | 'm';\n\n/** @deprecated */\nexport interface IButtonProps extends ButtonProps, UnknownProperties {}\nexport type ButtonProps = BoxProps &\n NeighborItemProps &\n KeyboardFocusProps & {\n /**\n * Button type\n * @default secondary\n */\n use?: 'primary' | 'secondary' | 'tertiary';\n /** Button theme */\n theme?: 'info' | 'success' | 'warning' | 'danger' | 'muted' | 'invert';\n /** Button activity state */\n active?: boolean;\n /**\n * Button size\n * @default m\n */\n size?: ButtonSize;\n /** Disabled button state */\n disabled?: boolean;\n /** Loading button state */\n loading?: boolean;\n /** Tag for the left Addon */\n addonLeft?: React.ElementType;\n /** Tag for the right Addon */\n addonRight?: React.ElementType;\n /**\n * Placement for hint\n * @default top\n */\n hintPlacement?: TooltipHintProps['placement'];\n };\n\n/** @deprecated */\nexport interface IButtonTextProps extends ButtonTextProps, UnknownProperties {}\nexport type ButtonTextProps = BoxProps & {\n size?: ButtonSize;\n};\n\n/** @deprecated */\nexport interface IButtonAddonProps extends ButtonAddonProps, UnknownProperties {}\nexport type ButtonAddonProps = BoxProps & {\n size?: ButtonSize;\n};\n\n/** @deprecated */\nexport interface IButtonContext extends ButtonContext, UnknownProperties {}\nexport type ButtonContext = {\n getTextProps: PropGetterFn;\n getAddonProps: PropGetterFn;\n};\n\ndeclare const Button: Intergalactic.Component<'button', ButtonProps, ButtonContext> & {\n Text: Intergalactic.Component<'span', ButtonTextProps>;\n Addon: Intergalactic.Component<'span', ButtonAddonProps>;\n};\n\nexport default Button;\n"],"mappings":""}
package/lib/es6/Button.js DELETED
@@ -1,231 +0,0 @@
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 "@semcore/utils/lib/core/index";
9
- import { assignProps as _assignProps4 } from "@semcore/core";
10
- import { assignProps as _assignProps3 } from "@semcore/core";
11
- import { assignProps as _assignProps2 } from "@semcore/core";
12
- import { assignProps as _assignProps } from "@semcore/core";
13
- import React from 'react';
14
- import createComponent, { Component, sstyled, Root } from '@semcore/core';
15
- import { Box } from '@semcore/flex-box';
16
- import { Hint } from '@semcore/tooltip';
17
- import NeighborLocation from '@semcore/neighbor-location';
18
- import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
19
- import addonTextChildren from '@semcore/utils/lib/addonTextChildren';
20
- import logger from '@semcore/utils/lib/logger';
21
- import SpinButton from './SpinButton';
22
- /*__reshadow-styles__:"./style/button.shadow.css"*/
23
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SButton_i9ui3_gg_{position:relative;display:inline-block;align-items:center;justify-content:center;padding:0;margin:0;white-space:nowrap;font-family:inherit;line-height:normal;-webkit-text-decoration:none;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;outline:0;box-shadow:none;cursor:pointer;box-sizing:border-box;overflow:visible;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;font-weight:var(--intergalactic-medium, 500);color:var(--intergalactic-text-secondary, #6c6e79);min-width:-moz-fit-content;min-width:fit-content}.___SButton_i9ui3_gg_::-moz-focus-inner{padding:0;border:0}.___SButton_i9ui3_gg_:active,.___SButton_i9ui3_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SButton_i9ui3_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SButton_i9ui3_gg_.__keyboardFocused_i9ui3_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));z-index:1}.___SButton_i9ui3_gg_.__disabled_i9ui3_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;box-shadow:none;z-index:0}.___SButton_i9ui3_gg_._size_s_i9ui3_gg_{width:var(--intergalactic-form-control-s, 20px);height:var(--intergalactic-form-control-s, 20px);border-radius:var(--intergalactic-addon-rounded, 4px)}.___SButton_i9ui3_gg_._size_m_i9ui3_gg_{height:var(--intergalactic-form-control-m, 28px);border-radius:var(--intergalactic-control-rounded, 6px);font-size:var(--intergalactic-fs-200, 14px)}.___SButton_i9ui3_gg_._size_l_i9ui3_gg_{height:var(--intergalactic-form-control-l, 40px);border-radius:var(--intergalactic-control-rounded, 6px);font-size:var(--intergalactic-fs-300, 16px)}.___SButton_i9ui3_gg_._theme_primary-info_i9ui3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-primary-info, #008ff8)}@media (hover:hover){.___SButton_i9ui3_gg_._theme_primary-info_i9ui3_gg_:hover{background-color:var(--intergalactic-control-primary-info-hover, #006dca)}}.___SButton_i9ui3_gg_._theme_primary-info_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_primary-info_i9ui3_gg_:active{background-color:var(--intergalactic-control-primary-info-active, #044792)}.___SButton_i9ui3_gg_._theme_primary-success_i9ui3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-primary-success, #009f81)}@media (hover:hover){.___SButton_i9ui3_gg_._theme_primary-success_i9ui3_gg_:hover{background-color:var(--intergalactic-control-primary-success-hover, #007c65)}}.___SButton_i9ui3_gg_._theme_primary-success_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_primary-success_i9ui3_gg_:active{background-color:var(--intergalactic-control-primary-success-active, #055345)}.___SButton_i9ui3_gg_._theme_primary-warning_i9ui3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-primary-brand, #ff642d)}@media (hover:hover){.___SButton_i9ui3_gg_._theme_primary-warning_i9ui3_gg_:hover{background-color:var(--intergalactic-control-primary-brand-hover, #c33909)}}.___SButton_i9ui3_gg_._theme_primary-warning_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_primary-warning_i9ui3_gg_:active{background-color:var(--intergalactic-control-primary-brand-active, #c33909)}.___SButton_i9ui3_gg_._theme_primary-danger_i9ui3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-primary-critical, #ff4953)}@media (hover:hover){.___SButton_i9ui3_gg_._theme_primary-danger_i9ui3_gg_:hover{background-color:var(--intergalactic-control-primary-critical-hover, #d1002f)}}.___SButton_i9ui3_gg_._theme_primary-danger_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_primary-danger_i9ui3_gg_:active{background-color:var(--intergalactic-control-primary-critical-active, #8e0016)}.___SButton_i9ui3_gg_._theme_primary-invert_i9ui3_gg_{color:var(--intergalactic-text-primary, #191b23);background-color:var(--intergalactic-control-primary-invert, #ffffff)}@media (hover:hover){.___SButton_i9ui3_gg_._theme_primary-invert_i9ui3_gg_:hover{background-color:var(--intergalactic-control-primary-invert-hover, #f4f5f9)}}.___SButton_i9ui3_gg_._theme_primary-invert_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_primary-invert_i9ui3_gg_:active{background-color:var(--intergalactic-control-primary-invert-active, #e0e1e9)}.___SButton_i9ui3_gg_._theme_secondary-muted_i9ui3_gg_{color:var(--intergalactic-text-secondary, #6c6e79);border-color:var(--intergalactic-border-primary, #c4c7cf);background-color:var(--intergalactic-control-secondary-neutral, rgba(138, 142, 155, 0.1))}@media (hover:hover){.___SButton_i9ui3_gg_._theme_secondary-muted_i9ui3_gg_:hover{background-color:var(--intergalactic-control-secondary-neutral-hover,\n rgba(138, 142, 155, 0.2));color:var(--intergalactic-text-primary, #191b23)}}.___SButton_i9ui3_gg_._theme_secondary-muted_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_secondary-muted_i9ui3_gg_:active{background-color:var(--intergalactic-control-secondary-neutral-active,\n rgba(138, 142, 155, 0.3));color:var(--intergalactic-text-primary, #191b23)}.___SButton_i9ui3_gg_._theme_secondary-info_i9ui3_gg_{background-color:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));color:var(--intergalactic-text-link, #006dca);border-color:var(--intergalactic-control-primary-info, #008ff8)}@media (hover:hover){.___SButton_i9ui3_gg_._theme_secondary-info_i9ui3_gg_:hover{background-color:var(--intergalactic-control-secondary-info-hover, rgba(0, 143, 248, 0.2))}}.___SButton_i9ui3_gg_._theme_secondary-info_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_secondary-info_i9ui3_gg_:active{background-color:var(--intergalactic-control-secondary-info-active, rgba(0, 143, 248, 0.3))}.___SButton_i9ui3_gg_._theme_secondary-invert_i9ui3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);border-color:var(--intergalactic-border-primary-invert, #ffffff);background-color:var(--intergalactic-control-secondary-invert, rgba(255, 255, 255, 0.05))}@media (hover:hover){.___SButton_i9ui3_gg_._theme_secondary-invert_i9ui3_gg_:hover{background-color:var(--intergalactic-control-secondary-invert-hover, rgba(255, 255, 255, 0.1))}}.___SButton_i9ui3_gg_._theme_secondary-invert_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_secondary-invert_i9ui3_gg_:active{background-color:var(--intergalactic-control-secondary-invert-active,\n rgba(255, 255, 255, 0.3))}.___SButton_i9ui3_gg_._theme_tertiary-info_i9ui3_gg_{color:var(--intergalactic-text-link, #006dca);background-color:var(--intergalactic-control-tertiary-info, rgba(0, 143, 248, 0))}@media (hover:hover){.___SButton_i9ui3_gg_._theme_tertiary-info_i9ui3_gg_:hover{background-color:var(--intergalactic-control-tertiary-info-hover, rgba(0, 143, 248, 0.2))}}.___SButton_i9ui3_gg_._theme_tertiary-info_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_tertiary-info_i9ui3_gg_:active{background-color:var(--intergalactic-control-tertiary-info-active, rgba(0, 143, 248, 0.3))}.___SButton_i9ui3_gg_._theme_tertiary-muted_i9ui3_gg_{color:var(--intergalactic-text-secondary, #6c6e79);background-color:var(--intergalactic-control-tertiary-neutral, rgba(138, 142, 155, 0))}@media (hover:hover){.___SButton_i9ui3_gg_._theme_tertiary-muted_i9ui3_gg_:hover{background-color:var(--intergalactic-control-tertiary-neutral-hover, rgba(138, 142, 155, 0.2));color:var(--intergalactic-text-primary, #191b23)}}.___SButton_i9ui3_gg_._theme_tertiary-muted_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_tertiary-muted_i9ui3_gg_:active{background-color:var(--intergalactic-control-tertiary-neutral-active,\n rgba(138, 142, 155, 0.3));color:var(--intergalactic-text-primary, #191b23)}.___SButton_i9ui3_gg_._theme_tertiary-invert_i9ui3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-tertiary-invert, rgba(255, 255, 255, 0))}@media (hover:hover){.___SButton_i9ui3_gg_._theme_tertiary-invert_i9ui3_gg_:hover{background-color:var(--intergalactic-control-tertiary-invert-hover, rgba(255, 255, 255, 0.1))}}.___SButton_i9ui3_gg_._theme_tertiary-invert_i9ui3_gg_.__active_i9ui3_gg_,.___SButton_i9ui3_gg_._theme_tertiary-invert_i9ui3_gg_:active{background-color:var(--intergalactic-control-tertiary-invert-active, rgba(255, 255, 255, 0.3))}.___SButton_i9ui3_gg_._neighborLocation_right_i9ui3_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_i9ui3_gg_._neighborLocation_both_i9ui3_gg_{border-radius:0;margin-left:-1px}.___SButton_i9ui3_gg_._neighborLocation_left_i9ui3_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_i9ui3_gg_._neighborLocation_both_i9ui3_gg_,.___SButton_i9ui3_gg_._neighborLocation_left_i9ui3_gg_{position:relative}.___SButton_i9ui3_gg_._neighborLocation_both_i9ui3_gg_:after,.___SButton_i9ui3_gg_._neighborLocation_left_i9ui3_gg_:after{background-color:var(--intergalactic-text-primary-invert, #ffffff)}.___SButton_i9ui3_gg_._neighborLocation_both_i9ui3_gg_._theme_secondary-muted_i9ui3_gg_:after,.___SButton_i9ui3_gg_._neighborLocation_left_i9ui3_gg_._theme_secondary-muted_i9ui3_gg_:after{background-color:var(--intergalactic-border-primary, #c4c7cf)}.___SButton_i9ui3_gg_+.___SButton_i9ui3_gg_._neighborLocation_both_i9ui3_gg_:after,.___SButton_i9ui3_gg_+.___SButton_i9ui3_gg_._neighborLocation_left_i9ui3_gg_:after{content:\"\";position:absolute;top:-1px;left:-1px;width:1px;height:calc(100% + 2px)}.___SSpin_i9ui3_gg_{position:absolute;top:0;left:0;width:100%;height:100%;display:flex}.___SInner_i9ui3_gg_{display:inline-flex;align-items:center;justify-content:center;height:100%;width:100%}.___SInner_i9ui3_gg_.__loading_i9ui3_gg_{visibility:hidden}.___SText_i9ui3_gg_{display:inline-flex}.___SText_i9ui3_gg_._size_l_i9ui3_gg_,.___SText_i9ui3_gg_._size_m_i9ui3_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SText_i9ui3_gg_._size_m_i9ui3_gg_{line-height:var(--intergalactic-lh-200, 142%)}.___SText_i9ui3_gg_._size_l_i9ui3_gg_{line-height:var(--intergalactic-lh-300, 150%)}.___SText_i9ui3_gg_._size_l_i9ui3_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SText_i9ui3_gg_._size_l_i9ui3_gg_:first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SText_i9ui3_gg_._size_l_i9ui3_gg_:last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SAddon_i9ui3_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_i9ui3_gg_._size_m_i9ui3_gg_:not(:only-child):first-child{margin-left:calc(var(--intergalactic-spacing-2x, 8px) - 1px)}.___SAddon_i9ui3_gg_._size_m_i9ui3_gg_:not(:only-child):last-child{margin-right:calc(var(--intergalactic-spacing-2x, 8px) - 1px)}.___SAddon_i9ui3_gg_._size_m_i9ui3_gg_:only-child{margin-left:calc(1.5*var(--intergalactic-spacing-1x, 4px) - 1px);margin-right:calc(1.5*var(--intergalactic-spacing-1x, 4px) - 1px)}.___SAddon_i9ui3_gg_._size_l_i9ui3_gg_:not(:only-child):first-child{margin-left:calc(var(--intergalactic-spacing-3x, 12px) - 1px)}.___SAddon_i9ui3_gg_._size_l_i9ui3_gg_:not(:only-child):last-child{margin-right:calc(var(--intergalactic-spacing-3x, 12px) - 1px)}.___SAddon_i9ui3_gg_._size_l_i9ui3_gg_:only-child{margin-left:calc(3*var(--intergalactic-spacing-1x, 4px) - 1px);margin-right:calc(3*var(--intergalactic-spacing-1x, 4px) - 1px)}" /*__inner_css_end__*/, "i9ui3_gg_") /*__reshadow_css_end__*/, {
24
- "__SButton": "___SButton_i9ui3_gg_",
25
- "_keyboardFocused": "__keyboardFocused_i9ui3_gg_",
26
- "_disabled": "__disabled_i9ui3_gg_",
27
- "_size_s": "_size_s_i9ui3_gg_",
28
- "_size_m": "_size_m_i9ui3_gg_",
29
- "_size_l": "_size_l_i9ui3_gg_",
30
- "_neighborLocation_right": "_neighborLocation_right_i9ui3_gg_",
31
- "_neighborLocation_both": "_neighborLocation_both_i9ui3_gg_",
32
- "_neighborLocation_left": "_neighborLocation_left_i9ui3_gg_",
33
- "__SSpin": "___SSpin_i9ui3_gg_",
34
- "__SInner": "___SInner_i9ui3_gg_",
35
- "_loading": "__loading_i9ui3_gg_",
36
- "__SText": "___SText_i9ui3_gg_",
37
- "__SAddon": "___SAddon_i9ui3_gg_",
38
- "_theme_primary-info": "_theme_primary-info_i9ui3_gg_",
39
- "_active": "__active_i9ui3_gg_",
40
- "_theme_primary-success": "_theme_primary-success_i9ui3_gg_",
41
- "_theme_primary-warning": "_theme_primary-warning_i9ui3_gg_",
42
- "_theme_primary-danger": "_theme_primary-danger_i9ui3_gg_",
43
- "_theme_primary-invert": "_theme_primary-invert_i9ui3_gg_",
44
- "_theme_secondary-muted": "_theme_secondary-muted_i9ui3_gg_",
45
- "_theme_secondary-info": "_theme_secondary-info_i9ui3_gg_",
46
- "_theme_secondary-invert": "_theme_secondary-invert_i9ui3_gg_",
47
- "_theme_tertiary-info": "_theme_tertiary-info_i9ui3_gg_",
48
- "_theme_tertiary-muted": "_theme_tertiary-muted_i9ui3_gg_",
49
- "_theme_tertiary-invert": "_theme_tertiary-invert_i9ui3_gg_"
50
- });
51
- import hasLabels from '@semcore/utils/lib/hasLabels';
52
- export var MAP_USE_DEFAULT_THEME = {
53
- primary: 'info',
54
- secondary: 'muted',
55
- tertiary: 'info'
56
- };
57
- var RootButton = /*#__PURE__*/function (_Component) {
58
- _inherits(RootButton, _Component);
59
- var _super = _createSuper(RootButton);
60
- function RootButton() {
61
- var _this;
62
- _classCallCheck(this, RootButton);
63
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
64
- args[_key] = arguments[_key];
65
- }
66
- _this = _super.call.apply(_super, [this].concat(args));
67
- _defineProperty(_assertThisInitialized(_this), "containerRef", /*#__PURE__*/React.createRef());
68
- _defineProperty(_assertThisInitialized(_this), "state", {
69
- ariaLabelledByContent: null
70
- });
71
- return _this;
72
- }
73
- _createClass(RootButton, [{
74
- key: "getTextProps",
75
- value: function getTextProps() {
76
- var size = this.asProps.size;
77
- return {
78
- size: size
79
- };
80
- }
81
- }, {
82
- key: "getAddonProps",
83
- value: function getAddonProps() {
84
- var size = this.asProps.size;
85
- return {
86
- size: size
87
- };
88
- }
89
- }, {
90
- key: "componentDidMount",
91
- value: function componentDidMount() {
92
- var _this2 = this;
93
- if (process.env.NODE_ENV !== 'production') {
94
- logger.warn(this.containerRef.current && !hasLabels(this.containerRef.current) && !this.asProps.title, "'title' or 'aria-label' or 'aria-labelledby' are required props for buttons without text content", this.asProps['data-ui-name'] || RootButton.displayName);
95
- }
96
- if (this.asProps['aria-labelledby']) {
97
- setTimeout(function () {
98
- var _document$getElementB, _document$getElementB2;
99
- _this2.setState({
100
- ariaLabelledByContent: (_document$getElementB = (_document$getElementB2 = document.getElementById(_this2.asProps['aria-labelledby'])) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.textContent) !== null && _document$getElementB !== void 0 ? _document$getElementB : ''
101
- });
102
- }, 0);
103
- }
104
- }
105
- }, {
106
- key: "renderButton",
107
- value: function renderButton(_ref10) {
108
- var _ref = this.asProps,
109
- _ref5;
110
- var buttonProps = _ref10.buttonProps,
111
- children = _ref10.children;
112
- var styles = this.asProps.styles;
113
- var SButton = Box;
114
- return _ref5 = sstyled(styles), /*#__PURE__*/React.createElement(SButton, _ref5.cn("SButton", _objectSpread({}, _assignProps(_objectSpread({}, buttonProps), _ref))), children);
115
- }
116
- }, {
117
- key: "renderButtonWithHint",
118
- value: function renderButtonWithHint(_ref11) {
119
- var _ref2 = this.asProps,
120
- _ref6;
121
- var buttonProps = _ref11.buttonProps,
122
- children = _ref11.children,
123
- hintProps = _ref11.hintProps;
124
- var styles = this.asProps.styles;
125
- var SButton = Hint;
126
- return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SButton, _ref6.cn("SButton", _objectSpread({}, _assignProps2(_objectSpread(_objectSpread({}, buttonProps), hintProps), _ref2))), children);
127
- }
128
- }, {
129
- key: "render",
130
- value: function render() {
131
- var _ref12,
132
- _ref13,
133
- _this3 = this;
134
- var _this$asProps = this.asProps,
135
- styles = _this$asProps.styles,
136
- use = _this$asProps.use,
137
- _this$asProps$theme = _this$asProps.theme,
138
- theme = _this$asProps$theme === void 0 ? typeof use === 'string' && MAP_USE_DEFAULT_THEME[use] : _this$asProps$theme,
139
- loading = _this$asProps.loading,
140
- _this$asProps$disable = _this$asProps.disabled,
141
- disabled = _this$asProps$disable === void 0 ? loading : _this$asProps$disable,
142
- size = _this$asProps.size,
143
- neighborLocation = _this$asProps.neighborLocation,
144
- hasChildren = _this$asProps.children,
145
- title = _this$asProps.title,
146
- ariaLabel = _this$asProps['aria-label'],
147
- Children = _this$asProps.Children,
148
- AddonLeft = _this$asProps.addonLeft,
149
- AddonRight = _this$asProps.addonRight,
150
- hintPlacement = _this$asProps.hintPlacement;
151
- var useTheme = use && theme ? "".concat(use, "-").concat(theme) : false;
152
- var SInner = Box;
153
- var SSpin = Box;
154
- var buttonAriaLabel = (_ref12 = (_ref13 = title !== null && title !== void 0 ? title : ariaLabel) !== null && _ref13 !== void 0 ? _ref13 : this.state.ariaLabelledByContent) !== null && _ref12 !== void 0 ? _ref12 : '';
155
- var buttonProps = {
156
- type: 'button',
157
- tag: 'button',
158
- disabled: disabled,
159
- 'use:theme': useTheme,
160
- ref: this.containerRef,
161
- 'aria-busy': loading,
162
- 'aria-disabled': disabled,
163
- __excludeProps: ['title']
164
- };
165
- var hintProps = {
166
- title: buttonAriaLabel,
167
- timeout: [250, 50],
168
- placement: hintPlacement,
169
- theme: theme === 'invert' ? 'invert' : undefined,
170
- __excludeProps: []
171
- };
172
- return /*#__PURE__*/React.createElement(NeighborLocation.Detect, {
173
- neighborLocation: neighborLocation
174
- }, function (neighborLocation) {
175
- var _ref7;
176
- var children = (_ref7 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SInner, _ref7.cn("SInner", {
177
- "tag": 'span',
178
- "loading": loading
179
- }), AddonLeft ? /*#__PURE__*/React.createElement(Button.Addon, null, /*#__PURE__*/React.createElement(AddonLeft, _ref7.cn("AddonLeft", {}))) : null, addonTextChildren(Children, Button.Text, Button.Addon), AddonRight ? /*#__PURE__*/React.createElement(Button.Addon, null, /*#__PURE__*/React.createElement(AddonRight, _ref7.cn("AddonRight", {}))) : null), loading && /*#__PURE__*/React.createElement(SSpin, _ref7.cn("SSpin", {
180
- "tag": 'span'
181
- }), /*#__PURE__*/React.createElement(SpinButton, _ref7.cn("SpinButton", {
182
- "centered": true,
183
- "size": size,
184
- "theme": useTheme
185
- })))));
186
- buttonProps.neighborLocation = neighborLocation;
187
- if (!hasChildren || title) {
188
- return _this3.renderButtonWithHint({
189
- buttonProps: buttonProps,
190
- hintProps: hintProps,
191
- children: children
192
- });
193
- }
194
- return _this3.renderButton({
195
- buttonProps: buttonProps,
196
- children: children
197
- });
198
- });
199
- }
200
- }]);
201
- return RootButton;
202
- }(Component);
203
- _defineProperty(RootButton, "displayName", 'Button');
204
- _defineProperty(RootButton, "enhance", [keyboardFocusEnhance()]);
205
- _defineProperty(RootButton, "style", style);
206
- _defineProperty(RootButton, "defaultProps", {
207
- use: 'secondary',
208
- size: 'm'
209
- });
210
- function Text(props) {
211
- var _ref3 = arguments[0],
212
- _ref8;
213
- var SText = Box;
214
- return _ref8 = sstyled(props.styles), /*#__PURE__*/React.createElement(SText, _ref8.cn("SText", _objectSpread({}, _assignProps3({
215
- "tag": 'span'
216
- }, _ref3))));
217
- }
218
- function Addon(props) {
219
- var _ref4 = arguments[0],
220
- _ref9;
221
- var SAddon = Box;
222
- return _ref9 = sstyled(props.styles), /*#__PURE__*/React.createElement(SAddon, _ref9.cn("SAddon", _objectSpread({}, _assignProps4({
223
- "tag": 'span'
224
- }, _ref4))));
225
- }
226
- var Button = createComponent(RootButton, {
227
- Text: Text,
228
- Addon: Addon
229
- });
230
- export default Button;
231
- //# sourceMappingURL=Button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.js","names":["React","createComponent","Component","sstyled","Root","Box","Hint","NeighborLocation","keyboardFocusEnhance","addonTextChildren","logger","SpinButton","style","_sstyled","insert","hasLabels","MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","RootButton","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","createRef","ariaLabelledByContent","_createClass","key","value","getTextProps","size","asProps","getAddonProps","componentDidMount","_this2","process","env","NODE_ENV","warn","containerRef","current","title","displayName","setTimeout","_document$getElementB","_document$getElementB2","setState","document","getElementById","textContent","renderButton","_ref10","_ref","_ref5","buttonProps","children","styles","SButton","createElement","cn","_objectSpread","_assignProps","renderButtonWithHint","_ref11","_ref2","_ref6","hintProps","_assignProps2","render","_ref12","_ref13","_this3","_this$asProps","use","_this$asProps$theme","theme","loading","_this$asProps$disable","disabled","neighborLocation","hasChildren","ariaLabel","Children","AddonLeft","addonLeft","AddonRight","addonRight","hintPlacement","useTheme","SInner","SSpin","buttonAriaLabel","state","type","tag","ref","__excludeProps","timeout","placement","undefined","Detect","_ref7","Fragment","Button","Addon","Text","props","_ref3","arguments[0]","_ref8","SText","_assignProps3","_ref4","_ref9","SAddon","_assignProps4"],"sources":["../../src/Button.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { Hint } from '@semcore/tooltip';\nimport NeighborLocation from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport logger from '@semcore/utils/lib/logger';\nimport SpinButton from './SpinButton';\n\nimport style from './style/button.shadow.css';\nimport hasLabels from '@semcore/utils/lib/hasLabels';\n\nexport const MAP_USE_DEFAULT_THEME = {\n primary: 'info',\n secondary: 'muted',\n tertiary: 'info',\n};\n\nclass RootButton extends Component {\n static displayName = 'Button';\n static enhance = [keyboardFocusEnhance()];\n static style = style;\n static defaultProps = {\n use: 'secondary',\n size: 'm',\n };\n containerRef = React.createRef();\n\n state = {\n ariaLabelledByContent: null,\n };\n\n getTextProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n getAddonProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n componentDidMount() {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(\n this.containerRef.current && !hasLabels(this.containerRef.current) && !this.asProps.title,\n `'title' or 'aria-label' or 'aria-labelledby' are required props for buttons without text content`,\n this.asProps['data-ui-name'] || RootButton.displayName,\n );\n }\n\n if (this.asProps['aria-labelledby']) {\n setTimeout(() => {\n this.setState({\n ariaLabelledByContent:\n document.getElementById(this.asProps['aria-labelledby'])?.textContent ?? '',\n });\n }, 0);\n }\n }\n\n renderButton({ buttonProps, children }) {\n const { styles } = this.asProps;\n const SButton = Root;\n\n return sstyled(styles)(\n <SButton render={Box} {...buttonProps}>\n {children}\n </SButton>,\n );\n }\n\n renderButtonWithHint({ buttonProps, children, hintProps }) {\n const { styles } = this.asProps;\n const SButton = Root;\n\n return sstyled(styles)(\n <SButton render={Hint} {...buttonProps} {...hintProps}>\n {children}\n </SButton>,\n );\n }\n\n render() {\n const {\n styles,\n use,\n theme = typeof use === 'string' && MAP_USE_DEFAULT_THEME[use],\n loading,\n disabled = loading,\n size,\n neighborLocation,\n children: hasChildren,\n title,\n ['aria-label']: ariaLabel,\n Children,\n addonLeft: AddonLeft,\n addonRight: AddonRight,\n hintPlacement,\n } = this.asProps;\n const useTheme = use && theme ? `${use}-${theme}` : false;\n const SInner = Box;\n const SSpin = Box;\n const buttonAriaLabel = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? '';\n\n const buttonProps = {\n type: 'button',\n tag: 'button',\n disabled,\n 'use:theme': useTheme,\n ref: this.containerRef,\n 'aria-busy': loading,\n 'aria-disabled': disabled,\n __excludeProps: ['title'],\n };\n\n const hintProps = {\n title: buttonAriaLabel,\n timeout: [250, 50],\n placement: hintPlacement,\n theme: theme === 'invert' ? 'invert' : undefined,\n __excludeProps: [],\n };\n\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) => {\n const children = sstyled(styles)(\n <>\n <SInner tag='span' loading={loading}>\n {AddonLeft ? (\n <Button.Addon>\n <AddonLeft />\n </Button.Addon>\n ) : null}\n {addonTextChildren(Children, Button.Text, Button.Addon)}\n {AddonRight ? (\n <Button.Addon>\n <AddonRight />\n </Button.Addon>\n ) : null}\n </SInner>\n {loading && (\n <SSpin tag='span'>\n <SpinButton centered size={size} theme={useTheme} />\n </SSpin>\n )}\n </>,\n );\n buttonProps.neighborLocation = neighborLocation;\n\n if (!hasChildren || title) {\n return this.renderButtonWithHint({ buttonProps, hintProps, children });\n }\n\n return this.renderButton({ buttonProps, children });\n }}\n </NeighborLocation.Detect>\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n return sstyled(props.styles)(<SText render={Box} tag='span' />);\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} tag='span' />);\n}\n\nconst Button = createComponent(RootButton, {\n Text,\n Addon,\n});\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,GAAG,QAAQ,mBAAmB;AACvC,SAASC,IAAI,QAAQ,kBAAkB;AACvC,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,oBAAoB,MAAM,kDAAkD;AACnF,OAAOC,iBAAiB,MAAM,sCAAsC;AACpE,OAAOC,MAAM,MAAM,2BAA2B;AAC9C,OAAOC,UAAU,MAAM,cAAc;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;E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3,"file":"SpinButton.js","names":["React","Spin","SPIN_SIZE_MAP","xl","l","m","s","SpinButton","_ref","theme","size","others","_objectWithoutProperties","_excluded","createElement","_extends"],"sources":["../../src/SpinButton.jsx"],"sourcesContent":["import React from 'react';\nimport Spin from '@semcore/spin';\n\nexport const SPIN_SIZE_MAP = {\n xl: 'm',\n l: 's',\n m: 'xs',\n s: 'xxs',\n};\n\nexport default function SpinButton({ theme, size, ...others }) {\n return (\n <Spin\n size={typeof size === 'string' ? SPIN_SIZE_MAP[size] : size}\n theme='currentColor'\n {...others}\n />\n );\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,IAAI,MAAM,eAAe;AAEhC,OAAO,IAAMC,aAAa,GAAG;EAC3BC,EAAE,EAAE,GAAG;EACPC,CAAC,EAAE,GAAG;EACNC,CAAC,EAAE,IAAI;EACPC,CAAC,EAAE;AACL,CAAC;AAED,eAAe,SAASC,UAAUA,CAAAC,IAAA,EAA6B;EAAA,IAA1BC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAKC,MAAM,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EACzD,oBACEb,KAAA,CAAAc,aAAA,CAACb,IAAI,EAAAc,QAAA;IACHL,IAAI,EAAE,OAAOA,IAAI,KAAK,QAAQ,GAAGR,aAAa,CAACQ,IAAI,CAAC,GAAGA,IAAK;IAC5DD,KAAK,EAAC;EAAc,GAChBE,MAAM,EACV;AAEN"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { BoxProps } from '@semcore/flex-box';\nimport { NeighborItemProps } from '@semcore/neighbor-location';\nimport { TooltipHintProps } from '@semcore/tooltip';\n\nexport type ButtonSize = 'l' | 'm';\n\n/** @deprecated */\nexport interface IButtonProps extends ButtonProps, UnknownProperties {}\nexport type ButtonProps = BoxProps &\n NeighborItemProps &\n KeyboardFocusProps & {\n /**\n * Button type\n * @default secondary\n */\n use?: 'primary' | 'secondary' | 'tertiary';\n /** Button theme */\n theme?: 'info' | 'success' | 'warning' | 'danger' | 'muted' | 'invert';\n /** Button activity state */\n active?: boolean;\n /**\n * Button size\n * @default m\n */\n size?: ButtonSize;\n /** Disabled button state */\n disabled?: boolean;\n /** Loading button state */\n loading?: boolean;\n /** Tag for the left Addon */\n addonLeft?: React.ElementType;\n /** Tag for the right Addon */\n addonRight?: React.ElementType;\n /**\n * Placement for hint\n * @default top\n */\n hintPlacement?: TooltipHintProps['placement'];\n };\n\n/** @deprecated */\nexport interface IButtonTextProps extends ButtonTextProps, UnknownProperties {}\nexport type ButtonTextProps = BoxProps & {\n size?: ButtonSize;\n};\n\n/** @deprecated */\nexport interface IButtonAddonProps extends ButtonAddonProps, UnknownProperties {}\nexport type ButtonAddonProps = BoxProps & {\n size?: ButtonSize;\n};\n\n/** @deprecated */\nexport interface IButtonContext extends ButtonContext, UnknownProperties {}\nexport type ButtonContext = {\n getTextProps: PropGetterFn;\n getAddonProps: PropGetterFn;\n};\n\ndeclare const Button: Intergalactic.Component<'button', ButtonProps, ButtonContext> & {\n Text: Intergalactic.Component<'span', ButtonTextProps>;\n Addon: Intergalactic.Component<'span', ButtonAddonProps>;\n};\n\nexport default Button;\n"],"mappings":""}