@semcore/button 5.36.0-prerelease.0 → 5.37.0-prerelease.1

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 +13 -8
  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
@@ -0,0 +1,160 @@
1
+ SButton {
2
+ display: inline-block;
3
+ font-family: inherit;
4
+ font-size: var(--intergalactic-fs-200, 14px);
5
+ color: var(--intergalactic-text-link, #006dca);
6
+ line-height: normal;
7
+ position: relative;
8
+ cursor: pointer;
9
+ text-decoration: none;
10
+ border: none;
11
+ padding: 0;
12
+ margin: 0;
13
+ box-shadow: none;
14
+ -webkit-tap-highlight-color: transparent;
15
+ outline: 0;
16
+ background: none;
17
+ transition: color 0.15s ease-in-out;
18
+
19
+ &:active,
20
+ &:hover,
21
+ &:focus {
22
+ outline: 0;
23
+ text-decoration: none;
24
+ }
25
+
26
+ &::-moz-focus-inner {
27
+ border: none;
28
+ padding: 0;
29
+ }
30
+
31
+ &[active],
32
+ &:hover,
33
+ &:active {
34
+ color: var(--intergalactic-text-link-hover-active, #044792);
35
+
36
+ & SText {
37
+ border-color: currentColor;
38
+ }
39
+ }
40
+
41
+ &[enableVisited]:visited,
42
+ &[enableVisited]:visited:hover {
43
+ color: var(--intergalactic-text-link-visited, #8649e1);
44
+ }
45
+
46
+ SText {
47
+ border-bottom-width: 1px;
48
+ border-bottom-style: solid;
49
+ border-color: transparent;
50
+ transition: border-bottom-color 0.15s ease-in-out;
51
+ }
52
+ }
53
+
54
+ SButton[keyboardFocused] {
55
+ outline-color: var(--intergalactic-keyboard-focus-outline, rgba(0, 143, 248, 0.5));
56
+ outline-style: solid;
57
+ outline-width: 3px;
58
+ }
59
+
60
+ SButton[visually-disabled] {
61
+ opacity: var(--intergalactic-disabled-opacity, 0.3);
62
+ cursor: default;
63
+ /* Disable link interactions */
64
+ pointer-events: none;
65
+ }
66
+
67
+ SButton[use='secondary'] {
68
+ color: var(--intergalactic-text-hint, #6c6e79);
69
+
70
+ &[active],
71
+ &:active,
72
+ &:hover {
73
+ color: var(--intergalactic-text-hint-hover-active, #484a54);
74
+ }
75
+
76
+ SText {
77
+ border-bottom-width: 1px;
78
+ border-bottom-style: dashed;
79
+ border-color: currentColor;
80
+ }
81
+ }
82
+
83
+ SAddon {
84
+ display: inline-flex;
85
+ justify-content: center;
86
+ align-items: center;
87
+ margin-bottom: var(--intergalactic-spacing-05x, 2px);
88
+ vertical-align: middle;
89
+ }
90
+
91
+ SButton SAddon {
92
+ &:not(:only-child):first-child {
93
+ margin-right: var(--intergalactic-spacing-1x, 4px);
94
+ }
95
+
96
+ &:not(:only-child):last-child {
97
+ margin-left: var(--intergalactic-spacing-1x, 4px);
98
+ }
99
+ }
100
+
101
+ SButton[text-color] {
102
+ color: var(--text-color);
103
+
104
+ &[active],
105
+ &:hover,
106
+ &:active {
107
+ color: var(--text-color);
108
+ filter: brightness(0.8);
109
+ }
110
+ }
111
+
112
+ SButton[size='100'] {
113
+ font-size: var(--intergalactic-fs-100, 12px);
114
+ line-height: var(--intergalactic-lh-100, 133%);
115
+ }
116
+
117
+ SButton[size='200'] {
118
+ font-size: var(--intergalactic-fs-200, 14px);
119
+ line-height: var(--intergalactic-lh-200, 142%);
120
+ }
121
+
122
+ SButton[size='300'] {
123
+ font-size: var(--intergalactic-fs-300, 16px);
124
+ line-height: var(--intergalactic-lh-300, 150%);
125
+ }
126
+
127
+ SButton[size='400'] {
128
+ font-size: var(--intergalactic-fs-400, 20px);
129
+ line-height: var(--intergalactic-lh-400, 120%);
130
+ }
131
+
132
+ SButton[size='500'] {
133
+ font-size: var(--intergalactic-fs-500, 24px);
134
+ line-height: var(--intergalactic-lh-500, 117%);
135
+ }
136
+
137
+ SButton[size='600'] {
138
+ font-size: var(--intergalactic-fs-600, 32px);
139
+ line-height: var(--intergalactic-lh-600, 125%);
140
+ }
141
+
142
+ SButton[size='700'] {
143
+ font-size: var(--intergalactic-fs-700, 36px);
144
+ line-height: var(--intergalactic-lh-700, 110%);
145
+ }
146
+
147
+ SButton[size='800'] {
148
+ font-size: var(--intergalactic-fs-800, 48px);
149
+ line-height: var(--intergalactic-lh-800, 117%);
150
+ }
151
+
152
+ @media (prefers-reduced-motion) {
153
+ SButton {
154
+ transition: none;
155
+ }
156
+
157
+ SText {
158
+ transition: none;
159
+ }
160
+ }
package/lib/cjs/index.js CHANGED
@@ -1,26 +1,60 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- var _exportNames = {};
7
+ var _exportNames = {
8
+ MAP_USE_DEFAULT_THEME: true
9
+ };
10
+ Object.defineProperty(exports, "MAP_USE_DEFAULT_THEME", {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _AbstractButton.MAP_USE_DEFAULT_THEME;
14
+ }
15
+ });
8
16
  Object.defineProperty(exports, "default", {
9
17
  enumerable: true,
10
18
  get: function get() {
11
19
  return _Button["default"];
12
20
  }
13
21
  });
14
- var _Button = _interopRequireWildcard(require("./Button"));
15
- Object.keys(_Button).forEach(function (key) {
22
+ var _Button = _interopRequireDefault(require("./component/Button/Button"));
23
+ var _Button2 = require("./component/Button/Button.type");
24
+ Object.keys(_Button2).forEach(function (key) {
25
+ if (key === "default" || key === "__esModule") return;
26
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
27
+ if (key in exports && exports[key] === _Button2[key]) return;
28
+ Object.defineProperty(exports, key, {
29
+ enumerable: true,
30
+ get: function get() {
31
+ return _Button2[key];
32
+ }
33
+ });
34
+ });
35
+ var _ButtonLink = require("./component/ButtonLink/ButtonLink");
36
+ Object.keys(_ButtonLink).forEach(function (key) {
37
+ if (key === "default" || key === "__esModule") return;
38
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
39
+ if (key in exports && exports[key] === _ButtonLink[key]) return;
40
+ Object.defineProperty(exports, key, {
41
+ enumerable: true,
42
+ get: function get() {
43
+ return _ButtonLink[key];
44
+ }
45
+ });
46
+ });
47
+ var _ButtonLink2 = require("./component/ButtonLink/ButtonLink.type");
48
+ Object.keys(_ButtonLink2).forEach(function (key) {
16
49
  if (key === "default" || key === "__esModule") return;
17
50
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
18
- if (key in exports && exports[key] === _Button[key]) return;
51
+ if (key in exports && exports[key] === _ButtonLink2[key]) return;
19
52
  Object.defineProperty(exports, key, {
20
53
  enumerable: true,
21
54
  get: function get() {
22
- return _Button[key];
55
+ return _ButtonLink2[key];
23
56
  }
24
57
  });
25
58
  });
59
+ var _AbstractButton = require("./component/AbstractButton/AbstractButton");
26
60
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_Button","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './Button';\nexport * from './Button';\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AACAC,MAAA,CAAAC,IAAA,CAAAJ,OAAA,EAAAK,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAN,OAAA,CAAAM,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAd,OAAA,CAAAM,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_Button","_interopRequireDefault","require","_Button2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_ButtonLink","_ButtonLink2","_AbstractButton"],"sources":["../../src/index.ts"],"sourcesContent":["export { default } from './component/Button/Button';\nexport * from './component/Button/Button.type';\nexport * from './component/ButtonLink/ButtonLink';\nexport * from './component/ButtonLink/ButtonLink.type';\nexport { MAP_USE_DEFAULT_THEME } from './component/AbstractButton/AbstractButton';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,QAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,QAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAZ,QAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,WAAA,GAAAd,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAW,WAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,WAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,WAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,YAAA,GAAAf,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAY,YAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,YAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAE,YAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,eAAA,GAAAhB,OAAA"}
@@ -0,0 +1,175 @@
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 { assignProps as _assignProps2 } from "@semcore/core";
9
+ import { assignProps as _assignProps } from "@semcore/core";
10
+ import React from 'react';
11
+ import { Box } from '@semcore/flex-box';
12
+ import { Hint } from '@semcore/tooltip';
13
+ import NeighborLocation from '@semcore/neighbor-location';
14
+ import addonTextChildren from '@semcore/utils/lib/addonTextChildren';
15
+ import logger from '@semcore/utils/lib/logger';
16
+ import SpinButton from './SpinButton';
17
+ import hasLabels from '@semcore/utils/lib/hasLabels';
18
+ import { Component, CORE_INSTANCE, Root, sstyled } from '@semcore/core';
19
+ export var MAP_USE_DEFAULT_THEME = {
20
+ primary: 'info',
21
+ secondary: 'muted',
22
+ tertiary: 'info'
23
+ };
24
+ export var AbstractButton = /*#__PURE__*/function (_Component) {
25
+ _inherits(AbstractButton, _Component);
26
+ var _super = _createSuper(AbstractButton);
27
+ function AbstractButton() {
28
+ var _this;
29
+ _classCallCheck(this, AbstractButton);
30
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
31
+ args[_key] = arguments[_key];
32
+ }
33
+ _this = _super.call.apply(_super, [this].concat(args));
34
+ _defineProperty(_assertThisInitialized(_this), "containerRef", /*#__PURE__*/React.createRef());
35
+ _defineProperty(_assertThisInitialized(_this), "state", {
36
+ ariaLabelledByContent: null
37
+ });
38
+ return _this;
39
+ }
40
+ _createClass(AbstractButton, [{
41
+ key: "getTextProps",
42
+ value: function getTextProps() {
43
+ var size = this.asProps.size;
44
+ return {
45
+ size: size
46
+ };
47
+ }
48
+ }, {
49
+ key: "getAddonProps",
50
+ value: function getAddonProps() {
51
+ var size = this.asProps.size;
52
+ return {
53
+ size: size
54
+ };
55
+ }
56
+ }, {
57
+ key: "componentDidMount",
58
+ value: function componentDidMount() {
59
+ var _this2 = this;
60
+ if (process.env.NODE_ENV !== 'production') {
61
+ 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'] || AbstractButton.displayName);
62
+ }
63
+ var ariaLabelledby = this.asProps['aria-labelledby'];
64
+ if (ariaLabelledby) {
65
+ setTimeout(function () {
66
+ var _document$getElementB, _document$getElementB2;
67
+ _this2.setState({
68
+ ariaLabelledByContent: (_document$getElementB = (_document$getElementB2 = document.getElementById(ariaLabelledby)) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.textContent) !== null && _document$getElementB !== void 0 ? _document$getElementB : ''
69
+ });
70
+ }, 0);
71
+ }
72
+ }
73
+ }, {
74
+ key: "renderButton",
75
+ value: function renderButton(_ref6) {
76
+ var _ref = this.asProps,
77
+ _ref3;
78
+ var buttonProps = _ref6.buttonProps,
79
+ children = _ref6.children;
80
+ var styles = this.asProps.styles;
81
+ var SButton = Box;
82
+ return _ref3 = sstyled(styles), /*#__PURE__*/React.createElement(SButton, _ref3.cn("SButton", _objectSpread({}, _assignProps(_objectSpread({}, buttonProps), _ref))), children);
83
+ }
84
+ }, {
85
+ key: "renderButtonWithHint",
86
+ value: function renderButtonWithHint(_ref7) {
87
+ var _ref2 = this.asProps,
88
+ _ref4;
89
+ var buttonProps = _ref7.buttonProps,
90
+ children = _ref7.children,
91
+ hintProps = _ref7.hintProps;
92
+ var styles = this.asProps.styles;
93
+ var SButton = Hint;
94
+ return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SButton, _ref4.cn("SButton", _objectSpread({}, _assignProps2(_objectSpread(_objectSpread({}, buttonProps), hintProps), _ref2))), children);
95
+ }
96
+ }, {
97
+ key: "render",
98
+ value: function render() {
99
+ var _ref8,
100
+ _ref9,
101
+ _this3 = this;
102
+ var _this$asProps = this.asProps,
103
+ styles = _this$asProps.styles,
104
+ use = _this$asProps.use,
105
+ _this$asProps$theme = _this$asProps.theme,
106
+ theme = _this$asProps$theme === void 0 ? typeof use === 'string' && MAP_USE_DEFAULT_THEME[use] : _this$asProps$theme,
107
+ loading = _this$asProps.loading,
108
+ _this$asProps$disable = _this$asProps.disabled,
109
+ disabled = _this$asProps$disable === void 0 ? loading : _this$asProps$disable,
110
+ size = _this$asProps.size,
111
+ neighborLocation = _this$asProps.neighborLocation,
112
+ hasChildren = _this$asProps.children,
113
+ title = _this$asProps.title,
114
+ ariaLabel = _this$asProps['aria-label'],
115
+ Children = _this$asProps.Children,
116
+ AddonLeft = _this$asProps.addonLeft,
117
+ AddonRight = _this$asProps.addonRight,
118
+ hintPlacement = _this$asProps.hintPlacement;
119
+ // @ts-ignore
120
+ var Button = this[CORE_INSTANCE];
121
+ var useTheme = use && theme ? "".concat(use, "-").concat(theme) : false;
122
+ var SInner = Box;
123
+ var SSpin = Box;
124
+ var buttonAriaLabel = (_ref8 = (_ref9 = title !== null && title !== void 0 ? title : ariaLabel) !== null && _ref9 !== void 0 ? _ref9 : this.state.ariaLabelledByContent) !== null && _ref8 !== void 0 ? _ref8 : '';
125
+ var buttonProps = {
126
+ type: 'button',
127
+ tag: 'button',
128
+ disabled: disabled,
129
+ 'use:theme': useTheme,
130
+ ref: this.containerRef,
131
+ 'text-color': this.getTextColor(),
132
+ 'aria-busy': loading,
133
+ 'aria-disabled': disabled,
134
+ __excludeProps: ['title']
135
+ };
136
+ var hintProps = {
137
+ title: buttonAriaLabel,
138
+ timeout: [250, 50],
139
+ placement: hintPlacement,
140
+ theme: theme === 'invert' ? 'invert' : undefined,
141
+ __excludeProps: []
142
+ };
143
+ return /*#__PURE__*/React.createElement(NeighborLocation.Detect, {
144
+ neighborLocation: neighborLocation
145
+ }, function (neighborLocation) {
146
+ var _ref5;
147
+ var children = (_ref5 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SInner, _ref5.cn("SInner", {
148
+ "tag": 'span',
149
+ "loading": loading
150
+ }), AddonLeft ? /*#__PURE__*/React.createElement(Button.Addon, null, /*#__PURE__*/React.createElement(AddonLeft, _ref5.cn("AddonLeft", {}))) : null, addonTextChildren(Children, Button.Text, Button.Addon), AddonRight ? /*#__PURE__*/React.createElement(Button.Addon, null, /*#__PURE__*/React.createElement(AddonRight, _ref5.cn("AddonRight", {}))) : null), loading && /*#__PURE__*/React.createElement(SSpin, _ref5.cn("SSpin", {
151
+ "tag": 'span'
152
+ }), /*#__PURE__*/React.createElement(SpinButton, _ref5.cn("SpinButton", {
153
+ "centered": true,
154
+ "size": size,
155
+ "theme": useTheme
156
+ })))));
157
+ buttonProps.neighborLocation = neighborLocation;
158
+ if (!hasChildren || title) {
159
+ return _this3.renderButtonWithHint({
160
+ buttonProps: buttonProps,
161
+ hintProps: hintProps,
162
+ children: children
163
+ });
164
+ }
165
+ return _this3.renderButton({
166
+ buttonProps: buttonProps,
167
+ children: children
168
+ });
169
+ });
170
+ }
171
+ }]);
172
+ return AbstractButton;
173
+ }(Component);
174
+ _defineProperty(AbstractButton, "displayName", 'AbstractButton');
175
+ //# sourceMappingURL=AbstractButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractButton.js","names":["React","Box","Hint","NeighborLocation","addonTextChildren","logger","SpinButton","hasLabels","Component","CORE_INSTANCE","Root","sstyled","MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","AbstractButton","_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","ariaLabelledby","setTimeout","_document$getElementB","_document$getElementB2","setState","document","getElementById","textContent","renderButton","_ref6","_ref","_ref3","buttonProps","children","styles","SButton","createElement","cn","_objectSpread","_assignProps","renderButtonWithHint","_ref7","_ref2","_ref4","hintProps","_assignProps2","render","_ref8","_ref9","_this3","_this$asProps","use","_this$asProps$theme","theme","loading","_this$asProps$disable","disabled","neighborLocation","hasChildren","ariaLabel","Children","AddonLeft","addonLeft","AddonRight","addonRight","hintPlacement","Button","useTheme","SInner","SSpin","buttonAriaLabel","state","type","tag","ref","getTextColor","__excludeProps","timeout","placement","undefined","Detect","_ref5","Fragment","Addon","Text"],"sources":["../../../../src/component/AbstractButton/AbstractButton.tsx"],"sourcesContent":["import React from 'react';\nimport { Box } from '@semcore/flex-box';\nimport { Hint } from '@semcore/tooltip';\nimport NeighborLocation from '@semcore/neighbor-location';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport logger from '@semcore/utils/lib/logger';\nimport SpinButton from './SpinButton';\nimport hasLabels from '@semcore/utils/lib/hasLabels';\nimport { AbstractButtonProps } from './AbstractButton.type';\nimport { Component, CORE_INSTANCE, Root, sstyled } from '@semcore/core';\n\nexport const MAP_USE_DEFAULT_THEME: Record<string, string> = {\n primary: 'info',\n secondary: 'muted',\n tertiary: 'info',\n};\n\ntype Props = AbstractButtonProps<any, any, any>;\n\nexport abstract class AbstractButton extends Component<Props, {}, {}> {\n static displayName = 'AbstractButton';\n\n containerRef = React.createRef<HTMLButtonElement>();\n\n state = {\n ariaLabelledByContent: null,\n };\n\n protected abstract getTextColor(): string | undefined;\n\n getTextProps() {\n const { size } = this.asProps;\n\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'] || AbstractButton.displayName,\n );\n }\n\n const ariaLabelledby = this.asProps['aria-labelledby'];\n\n if (ariaLabelledby) {\n setTimeout(() => {\n this.setState({\n ariaLabelledByContent: document.getElementById(ariaLabelledby)?.textContent ?? '',\n });\n }, 0);\n }\n }\n\n renderButton({ buttonProps, children }: any) {\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 }: any) {\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 // @ts-ignore\n const Button = this[CORE_INSTANCE];\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: Record<string, any> = {\n type: 'button',\n tag: 'button',\n disabled,\n 'use:theme': useTheme,\n ref: this.containerRef,\n 'text-color': this.getTextColor(),\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 {/* @ts-ignore */}\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"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,GAAG,QAAQ,mBAAmB;AACvC,SAASC,IAAI,QAAQ,kBAAkB;AACvC,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,iBAAiB,MAAM,sCAAsC;AACpE,OAAOC,MAAM,MAAM,2BAA2B;AAC9C,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,SAAS,MAAM,8BAA8B;AAEpD,SAASC,SAAS,EAAEC,aAAa,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AAEvE,OAAO,IAAMC,qBAA6C,GAAG;EAC3DC,OAAO,EAAE,MAAM;EACfC,SAAS,EAAE,OAAO;EAClBC,QAAQ,EAAE;AACZ,CAAC;AAID,WAAsBC,cAAc,0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uB;IAE9B;EAAC;EAAA,OAAAlD,cAAA;AAAA,EApJ0CR,SAAS;AAqJrDwB,eAAA,CArJqBhB,cAAc,iBACb,gBAAgB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AbstractButton.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractButton.type.js","names":[],"sources":["../../../../src/component/AbstractButton/AbstractButton.type.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn } 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 AbstractButtonProps<S, U, T> = BoxProps &\n NeighborItemProps &\n KeyboardFocusProps & {\n /** Button activity state */\n active?: boolean;\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 /** Button type. Defined in Button.type or ButtonLink.type */\n size?: S;\n /** Button usage. Defined in Button.type or ButtonLink.type */\n use?: U;\n /** Button theme. Defined in Button.type or ButtonLink.type */\n theme?: T;\n };\n\nexport type AbstractButtonAddonProps<S> = BoxProps & {\n size?: S;\n};\n\nexport type AbstractButtonTextProps<S> = BoxProps & {\n size?: S;\n};\n\nexport type AbstractButtonContext = {\n getTextProps: PropGetterFn;\n getAddonProps: PropGetterFn;\n};\n"],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":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/component/AbstractButton/SpinButton.tsx"],"sourcesContent":["import React from 'react';\nimport Spin from '@semcore/spin';\n\nexport const SPIN_SIZE_MAP: Record<string, string> = {\n xl: 'm',\n l: 's',\n m: 'xs',\n s: 'xxs',\n};\n\nexport default function SpinButton({ theme, size, ...others }: any) {\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,aAAqC,GAAG;EACnDC,EAAE,EAAE,GAAG;EACPC,CAAC,EAAE,GAAG;EACNC,CAAC,EAAE,IAAI;EACPC,CAAC,EAAE;AACL,CAAC;AAED,eAAe,SAASC,UAAUA,CAAAC,IAAA,EAAkC;EAAA,IAA/BC,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"}
@@ -0,0 +1,87 @@
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 _inherits from "@babel/runtime/helpers/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/createSuper";
6
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
+ import { sstyled as _sstyled } from "@semcore/utils/lib/core/index";
8
+ import { assignProps as _assignProps2 } from "@semcore/core";
9
+ import { assignProps as _assignProps } from "@semcore/core";
10
+ import React from 'react';
11
+ import createComponent, { sstyled, Root } from '@semcore/core';
12
+ import { Box } from '@semcore/flex-box';
13
+ import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
14
+ /*__reshadow-styles__:"./button.shadow.css"*/
15
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SButton_1dunw_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_1dunw_gg_::-moz-focus-inner{padding:0;border:0}.___SButton_1dunw_gg_:active,.___SButton_1dunw_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SButton_1dunw_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SButton_1dunw_gg_.__keyboardFocused_1dunw_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));z-index:1}.___SButton_1dunw_gg_.__disabled_1dunw_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none;box-shadow:none;z-index:0}.___SButton_1dunw_gg_._size_s_1dunw_gg_{width:var(--intergalactic-form-control-s, 20px);height:var(--intergalactic-form-control-s, 20px);border-radius:var(--intergalactic-addon-rounded, 4px)}.___SButton_1dunw_gg_._size_m_1dunw_gg_{height:var(--intergalactic-form-control-m, 28px);border-radius:var(--intergalactic-control-rounded, 6px);font-size:var(--intergalactic-fs-200, 14px)}.___SButton_1dunw_gg_._size_l_1dunw_gg_{height:var(--intergalactic-form-control-l, 40px);border-radius:var(--intergalactic-control-rounded, 6px);font-size:var(--intergalactic-fs-300, 16px)}.___SButton_1dunw_gg_._theme_primary-info_1dunw_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-primary-info, #008ff8)}@media (hover:hover){.___SButton_1dunw_gg_._theme_primary-info_1dunw_gg_:hover{background-color:var(--intergalactic-control-primary-info-hover, #006dca)}}.___SButton_1dunw_gg_._theme_primary-info_1dunw_gg_.__active_1dunw_gg_,.___SButton_1dunw_gg_._theme_primary-info_1dunw_gg_:active{background-color:var(--intergalactic-control-primary-info-active, #044792)}.___SButton_1dunw_gg_._theme_primary-success_1dunw_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-primary-success, #009f81)}@media (hover:hover){.___SButton_1dunw_gg_._theme_primary-success_1dunw_gg_:hover{background-color:var(--intergalactic-control-primary-success-hover, #007c65)}}.___SButton_1dunw_gg_._theme_primary-success_1dunw_gg_.__active_1dunw_gg_,.___SButton_1dunw_gg_._theme_primary-success_1dunw_gg_:active{background-color:var(--intergalactic-control-primary-success-active, #055345)}.___SButton_1dunw_gg_._theme_primary-warning_1dunw_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-primary-brand, #ff642d)}@media (hover:hover){.___SButton_1dunw_gg_._theme_primary-warning_1dunw_gg_:hover{background-color:var(--intergalactic-control-primary-brand-hover, #c33909)}}.___SButton_1dunw_gg_._theme_primary-warning_1dunw_gg_.__active_1dunw_gg_,.___SButton_1dunw_gg_._theme_primary-warning_1dunw_gg_:active{background-color:var(--intergalactic-control-primary-brand-active, #c33909)}.___SButton_1dunw_gg_._theme_primary-danger_1dunw_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-primary-critical, #ff4953)}@media (hover:hover){.___SButton_1dunw_gg_._theme_primary-danger_1dunw_gg_:hover{background-color:var(--intergalactic-control-primary-critical-hover, #d1002f)}}.___SButton_1dunw_gg_._theme_primary-danger_1dunw_gg_.__active_1dunw_gg_,.___SButton_1dunw_gg_._theme_primary-danger_1dunw_gg_:active{background-color:var(--intergalactic-control-primary-critical-active, #8e0016)}.___SButton_1dunw_gg_._theme_primary-invert_1dunw_gg_{color:var(--intergalactic-text-primary, #191b23);background-color:var(--intergalactic-control-primary-invert, #ffffff)}@media (hover:hover){.___SButton_1dunw_gg_._theme_primary-invert_1dunw_gg_:hover{background-color:var(--intergalactic-control-primary-invert-hover, #f4f5f9)}}.___SButton_1dunw_gg_._theme_primary-invert_1dunw_gg_.__active_1dunw_gg_,.___SButton_1dunw_gg_._theme_primary-invert_1dunw_gg_:active{background-color:var(--intergalactic-control-primary-invert-active, #e0e1e9)}.___SButton_1dunw_gg_._theme_secondary-muted_1dunw_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_1dunw_gg_._theme_secondary-muted_1dunw_gg_:hover{background-color:var(--intergalactic-control-secondary-neutral-hover,\n rgba(138, 142, 155, 0.2));color:var(--intergalactic-text-primary, #191b23)}}.___SButton_1dunw_gg_._theme_secondary-muted_1dunw_gg_.__active_1dunw_gg_,.___SButton_1dunw_gg_._theme_secondary-muted_1dunw_gg_:active{background-color:var(--intergalactic-control-secondary-neutral-active,\n rgba(138, 142, 155, 0.3));color:var(--intergalactic-text-primary, #191b23)}.___SButton_1dunw_gg_._theme_secondary-info_1dunw_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_1dunw_gg_._theme_secondary-info_1dunw_gg_:hover{background-color:var(--intergalactic-control-secondary-info-hover, rgba(0, 143, 248, 0.2))}}.___SButton_1dunw_gg_._theme_secondary-info_1dunw_gg_.__active_1dunw_gg_,.___SButton_1dunw_gg_._theme_secondary-info_1dunw_gg_:active{background-color:var(--intergalactic-control-secondary-info-active, rgba(0, 143, 248, 0.3))}.___SButton_1dunw_gg_._theme_secondary-invert_1dunw_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_1dunw_gg_._theme_secondary-invert_1dunw_gg_:hover{background-color:var(--intergalactic-control-secondary-invert-hover, rgba(255, 255, 255, 0.1))}}.___SButton_1dunw_gg_._theme_secondary-invert_1dunw_gg_.__active_1dunw_gg_,.___SButton_1dunw_gg_._theme_secondary-invert_1dunw_gg_:active{background-color:var(--intergalactic-control-secondary-invert-active,\n rgba(255, 255, 255, 0.3))}.___SButton_1dunw_gg_._theme_tertiary-info_1dunw_gg_{color:var(--intergalactic-text-link, #006dca);background-color:var(--intergalactic-control-tertiary-info, rgba(0, 143, 248, 0))}@media (hover:hover){.___SButton_1dunw_gg_._theme_tertiary-info_1dunw_gg_:hover{background-color:var(--intergalactic-control-tertiary-info-hover, rgba(0, 143, 248, 0.2))}}.___SButton_1dunw_gg_._theme_tertiary-info_1dunw_gg_.__active_1dunw_gg_,.___SButton_1dunw_gg_._theme_tertiary-info_1dunw_gg_:active{background-color:var(--intergalactic-control-tertiary-info-active, rgba(0, 143, 248, 0.3))}.___SButton_1dunw_gg_._theme_tertiary-muted_1dunw_gg_{color:var(--intergalactic-text-secondary, #6c6e79);background-color:var(--intergalactic-control-tertiary-neutral, rgba(138, 142, 155, 0))}@media (hover:hover){.___SButton_1dunw_gg_._theme_tertiary-muted_1dunw_gg_:hover{background-color:var(--intergalactic-control-tertiary-neutral-hover, rgba(138, 142, 155, 0.2));color:var(--intergalactic-text-primary, #191b23)}}.___SButton_1dunw_gg_._theme_tertiary-muted_1dunw_gg_.__active_1dunw_gg_,.___SButton_1dunw_gg_._theme_tertiary-muted_1dunw_gg_:active{background-color:var(--intergalactic-control-tertiary-neutral-active,\n rgba(138, 142, 155, 0.3));color:var(--intergalactic-text-primary, #191b23)}.___SButton_1dunw_gg_._theme_tertiary-invert_1dunw_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background-color:var(--intergalactic-control-tertiary-invert, rgba(255, 255, 255, 0))}@media (hover:hover){.___SButton_1dunw_gg_._theme_tertiary-invert_1dunw_gg_:hover{background-color:var(--intergalactic-control-tertiary-invert-hover, rgba(255, 255, 255, 0.1))}}.___SButton_1dunw_gg_._theme_tertiary-invert_1dunw_gg_.__active_1dunw_gg_,.___SButton_1dunw_gg_._theme_tertiary-invert_1dunw_gg_:active{background-color:var(--intergalactic-control-tertiary-invert-active, rgba(255, 255, 255, 0.3))}.___SButton_1dunw_gg_._neighborLocation_right_1dunw_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_1dunw_gg_._neighborLocation_both_1dunw_gg_{border-radius:0;margin-left:-1px}.___SButton_1dunw_gg_._neighborLocation_left_1dunw_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_1dunw_gg_._neighborLocation_both_1dunw_gg_,.___SButton_1dunw_gg_._neighborLocation_left_1dunw_gg_{position:relative}.___SButton_1dunw_gg_._neighborLocation_both_1dunw_gg_:after,.___SButton_1dunw_gg_._neighborLocation_left_1dunw_gg_:after{background-color:var(--intergalactic-text-primary-invert, #ffffff)}.___SButton_1dunw_gg_._neighborLocation_both_1dunw_gg_._theme_secondary-muted_1dunw_gg_:after,.___SButton_1dunw_gg_._neighborLocation_left_1dunw_gg_._theme_secondary-muted_1dunw_gg_:after{background-color:var(--intergalactic-border-primary, #c4c7cf)}.___SButton_1dunw_gg_+.___SButton_1dunw_gg_._neighborLocation_both_1dunw_gg_:after,.___SButton_1dunw_gg_+.___SButton_1dunw_gg_._neighborLocation_left_1dunw_gg_:after{content:\"\";position:absolute;top:-1px;left:-1px;width:1px;height:calc(100% + 2px)}.___SSpin_1dunw_gg_{position:absolute;top:0;left:0;width:100%;height:100%;display:flex}.___SInner_1dunw_gg_{display:inline-flex;align-items:center;justify-content:center;height:100%;width:100%}.___SInner_1dunw_gg_.__loading_1dunw_gg_{visibility:hidden}.___SText_1dunw_gg_{display:inline-flex}.___SText_1dunw_gg_._size_l_1dunw_gg_,.___SText_1dunw_gg_._size_m_1dunw_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SText_1dunw_gg_._size_m_1dunw_gg_{line-height:var(--intergalactic-lh-200, 142%)}.___SText_1dunw_gg_._size_l_1dunw_gg_{line-height:var(--intergalactic-lh-300, 150%)}.___SText_1dunw_gg_._size_l_1dunw_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SText_1dunw_gg_._size_l_1dunw_gg_:first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SText_1dunw_gg_._size_l_1dunw_gg_:last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SAddon_1dunw_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_1dunw_gg_._size_m_1dunw_gg_:not(:only-child):first-child{margin-left:calc(var(--intergalactic-spacing-2x, 8px) - 1px)}.___SAddon_1dunw_gg_._size_m_1dunw_gg_:not(:only-child):last-child{margin-right:calc(var(--intergalactic-spacing-2x, 8px) - 1px)}.___SAddon_1dunw_gg_._size_m_1dunw_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_1dunw_gg_._size_l_1dunw_gg_:not(:only-child):first-child{margin-left:calc(var(--intergalactic-spacing-3x, 12px) - 1px)}.___SAddon_1dunw_gg_._size_l_1dunw_gg_:not(:only-child):last-child{margin-right:calc(var(--intergalactic-spacing-3x, 12px) - 1px)}.___SAddon_1dunw_gg_._size_l_1dunw_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__*/, "1dunw_gg_") /*__reshadow_css_end__*/, {
16
+ "__SButton": "___SButton_1dunw_gg_",
17
+ "_keyboardFocused": "__keyboardFocused_1dunw_gg_",
18
+ "_disabled": "__disabled_1dunw_gg_",
19
+ "_size_s": "_size_s_1dunw_gg_",
20
+ "_size_m": "_size_m_1dunw_gg_",
21
+ "_size_l": "_size_l_1dunw_gg_",
22
+ "_neighborLocation_right": "_neighborLocation_right_1dunw_gg_",
23
+ "_neighborLocation_both": "_neighborLocation_both_1dunw_gg_",
24
+ "_neighborLocation_left": "_neighborLocation_left_1dunw_gg_",
25
+ "__SSpin": "___SSpin_1dunw_gg_",
26
+ "__SInner": "___SInner_1dunw_gg_",
27
+ "_loading": "__loading_1dunw_gg_",
28
+ "__SText": "___SText_1dunw_gg_",
29
+ "__SAddon": "___SAddon_1dunw_gg_",
30
+ "_theme_primary-info": "_theme_primary-info_1dunw_gg_",
31
+ "_active": "__active_1dunw_gg_",
32
+ "_theme_primary-success": "_theme_primary-success_1dunw_gg_",
33
+ "_theme_primary-warning": "_theme_primary-warning_1dunw_gg_",
34
+ "_theme_primary-danger": "_theme_primary-danger_1dunw_gg_",
35
+ "_theme_primary-invert": "_theme_primary-invert_1dunw_gg_",
36
+ "_theme_secondary-muted": "_theme_secondary-muted_1dunw_gg_",
37
+ "_theme_secondary-info": "_theme_secondary-info_1dunw_gg_",
38
+ "_theme_secondary-invert": "_theme_secondary-invert_1dunw_gg_",
39
+ "_theme_tertiary-info": "_theme_tertiary-info_1dunw_gg_",
40
+ "_theme_tertiary-muted": "_theme_tertiary-muted_1dunw_gg_",
41
+ "_theme_tertiary-invert": "_theme_tertiary-invert_1dunw_gg_"
42
+ });
43
+ import { AbstractButton } from '../AbstractButton/AbstractButton';
44
+ var RootButton = /*#__PURE__*/function (_AbstractButton) {
45
+ _inherits(RootButton, _AbstractButton);
46
+ var _super = _createSuper(RootButton);
47
+ function RootButton() {
48
+ _classCallCheck(this, RootButton);
49
+ return _super.apply(this, arguments);
50
+ }
51
+ _createClass(RootButton, [{
52
+ key: "getTextColor",
53
+ value: function getTextColor() {
54
+ return undefined;
55
+ }
56
+ }]);
57
+ return RootButton;
58
+ }(AbstractButton);
59
+ _defineProperty(RootButton, "displayName", 'Button');
60
+ _defineProperty(RootButton, "enhance", [keyboardFocusEnhance()]);
61
+ _defineProperty(RootButton, "style", style);
62
+ _defineProperty(RootButton, "defaultProps", {
63
+ use: 'secondary',
64
+ size: 'm'
65
+ });
66
+ function Text(props) {
67
+ var _ref = arguments[0],
68
+ _ref3;
69
+ var SText = Box;
70
+ return _ref3 = sstyled(props.styles), /*#__PURE__*/React.createElement(SText, _ref3.cn("SText", _objectSpread({}, _assignProps({
71
+ "tag": 'span'
72
+ }, _ref))));
73
+ }
74
+ function Addon(props) {
75
+ var _ref2 = arguments[0],
76
+ _ref4;
77
+ var SAddon = Box;
78
+ return _ref4 = sstyled(props.styles), /*#__PURE__*/React.createElement(SAddon, _ref4.cn("SAddon", _objectSpread({}, _assignProps2({
79
+ "tag": 'span'
80
+ }, _ref2))));
81
+ }
82
+ var Button = createComponent(RootButton, {
83
+ Text: Text,
84
+ Addon: Addon
85
+ });
86
+ export default Button;
87
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.js","names":["React","createComponent","sstyled","Root","Box","keyboardFocusEnhance","style","_sstyled","insert","AbstractButton","RootButton","_AbstractButton","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","getTextColor","undefined","_defineProperty","use","size","Text","props","_ref","arguments[0]","_ref3","SText","styles","createElement","cn","_objectSpread","_assignProps","Addon","_ref2","_ref4","SAddon","_assignProps2","Button"],"sources":["../../../../src/component/Button/Button.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nimport style from './button.shadow.css';\nimport { AbstractButton } from '../AbstractButton/AbstractButton';\nimport {\n ButtonAddonProps,\n ButtonChildren,\n ButtonComponent,\n ButtonProps,\n ButtonTextProps,\n} from './Button.type';\n\nclass RootButton extends AbstractButton {\n static displayName = 'Button';\n static enhance = [keyboardFocusEnhance()];\n static style = style;\n static defaultProps = {\n use: 'secondary',\n size: 'm',\n };\n\n protected getTextColor(): string | undefined {\n return undefined;\n }\n}\n\nfunction Text(props: ButtonTextProps) {\n const SText = Root;\n return sstyled(props.styles)(<SText render={Box} tag='span' />);\n}\n\nfunction Addon(props: ButtonAddonProps) {\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}) as ButtonComponent;\n\nexport default Button;\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAC9D,SAASC,GAAG,QAAQ,mBAAmB;AACvC,OAAOC,oBAAoB,MAAM,kDAAkD;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;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAGpF,SAASC,cAAc,QAAQ,kCAAkC;AAAC,IAS5DC,UAAU,0BAAAC,eAAA;EAAAC,SAAA,CAAAF,UAAA,EAAAC,eAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,UAAA;EAAA,SAAAA,WAAA;IAAAK,eAAA,OAAAL,UAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,UAAA;IAAAS,GAAA;IAAAC,KAAA,EASd,SAAAC,aAAA,EAA6C;MAC3C,OAAOC,SAAS;IAClB;EAAC;EAAA,OAAAZ,UAAA;AAAA,EAXsBD,cAAc;AAAAc,eAAA,CAAjCb,UAAU,iBACO,QAAQ;AAAAa,eAAA,CADzBb,UAAU,aAEG,CAACL,oBAAoB,EAAE,CAAC;AAAAkB,eAAA,CAFrCb,UAAU,WAGCJ,KAAK;AAAAiB,eAAA,CAHhBb,UAAU,kBAIQ;EACpBc,GAAG,EAAE,WAAW;EAChBC,IAAI,EAAE;AACR,CAAC;AAOH,SAASC,IAAIA,CAACC,KAAsB,EAAE;EAAA,IAAAC,IAAA,GAAAC,YAAA;IAAAC,KAAA;EACpC,IAAMC,KAAK,GACiC3B,GAAG;EAA/C,OAAA0B,KAAA,GAAO5B,OAAO,CAACyB,KAAK,CAACK,MAAM,CAAC,eAAChC,KAAA,CAAAiC,aAAA,CAACF,KAAK,EAAAD,KAAA,CAAAI,EAAA,UAAAC,aAAA,KAAAC,YAAA;IAAA,OAAkB;EAAM,GAAAR,IAAA,IAAG;AAChE;AAEA,SAASS,KAAKA,CAACV,KAAuB,EAAE;EAAA,IAAAW,KAAA,GAAAT,YAAA;IAAAU,KAAA;EACtC,IAAMC,MAAM,GACiCpC,GAAG;EAAhD,OAAAmC,KAAA,GAAOrC,OAAO,CAACyB,KAAK,CAACK,MAAM,CAAC,eAAChC,KAAA,CAAAiC,aAAA,CAACO,MAAM,EAAAD,KAAA,CAAAL,EAAA,WAAAC,aAAA,KAAAM,aAAA;IAAA,OAAkB;EAAM,GAAAH,KAAA,IAAG;AACjE;AAEA,IAAMI,MAAM,GAAGzC,eAAe,CAACS,UAAU,EAAE;EACzCgB,IAAI,EAAJA,IAAI;EACJW,KAAK,EAALA;AACF,CAAC,CAAoB;AAErB,eAAeK,MAAM"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Button.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.type.js","names":[],"sources":["../../../../src/component/Button/Button.type.ts"],"sourcesContent":["import { UnknownProperties, Intergalactic } from '@semcore/core';\n\nimport {\n AbstractButtonAddonProps,\n AbstractButtonContext,\n AbstractButtonTextProps,\n AbstractButtonProps,\n} from '../AbstractButton/AbstractButton.type';\n\n/**\n * Button size\n * @default m\n */\nexport type ButtonSize = 'l' | 'm';\n/**\n * Button type\n * @default secondary\n */\ntype Use = 'primary' | 'secondary' | 'tertiary';\n\n/** Button theme */\ntype Theme = 'info' | 'success' | 'warning' | 'danger' | 'muted' | 'invert';\n\n/** @deprecated */\nexport interface IButtonProps extends ButtonProps, UnknownProperties {}\nexport type ButtonProps = AbstractButtonProps<ButtonSize, Use, Theme>;\n\n/** @deprecated */\nexport interface IButtonTextProps extends ButtonTextProps, UnknownProperties {}\nexport type ButtonTextProps = AbstractButtonTextProps<ButtonSize>;\n\n/** @deprecated */\nexport interface IButtonAddonProps extends ButtonAddonProps, UnknownProperties {}\nexport type ButtonAddonProps = AbstractButtonAddonProps<ButtonSize>;\n\n/** @deprecated */\nexport interface IButtonContext extends ButtonContext, UnknownProperties {}\nexport type ButtonContext = AbstractButtonContext;\n\nexport type ButtonChildren = {\n Text: Intergalactic.Component<'span', ButtonTextProps>;\n Addon: Intergalactic.Component<'span', ButtonAddonProps>;\n};\n\nexport type ButtonComponent = Intergalactic.Component<'button', ButtonProps, ButtonContext> & {\n Text: Intergalactic.Component<'span', ButtonTextProps>;\n Addon: Intergalactic.Component<'span', ButtonAddonProps>;\n};\n"],"mappings":""}
@@ -368,4 +368,4 @@ SAddon[size='l'] {
368
368
  margin-right: calc(3 * var(--intergalactic-spacing-1x, 4px) - 1px);
369
369
  /* -1px - for border width */
370
370
  }
371
- }
371
+ }