@semcore/pills 4.4.10 → 4.4.11

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.
package/CHANGELOG.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [4.4.10] - 2023-02-21
5
+ ## [4.4.11] - 2023-03-13
6
6
 
7
7
  ### Changed
8
8
 
9
- - Version patch update due to children dependencies update (`@semcore/flex-box` [4.7.9 ~> 4.7.10], `@semcore/neighbor-location` [3.1.15 ~> 3.1.16], `@semcore/utils` [3.47.0 ~> 3.47.1]).
9
+ - Version patch update due to children dependencies update (`@semcore/flex-box` [4.7.10 ~> 4.7.11], `@semcore/neighbor-location` [3.1.16 ~> 3.1.17], `@semcore/utils` [3.47.1 ~> 3.47.2]).
10
10
 
11
11
  ## [4.4.8] - 2023-02-09
12
12
 
package/lib/cjs/Pills.js CHANGED
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
4
 
5
- var _typeof = require("@babel/runtime/helpers/typeof");
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
6
 
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
13
+
12
14
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
15
 
14
16
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -17,9 +19,7 @@ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/hel
17
19
 
18
20
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
21
 
20
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
-
22
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
22
+ var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
23
23
 
24
24
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
25
 
@@ -35,46 +35,34 @@ var _keyboardFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/e
35
35
 
36
36
  var _addonTextChildren = _interopRequireDefault(require("@semcore/utils/lib/addonTextChildren"));
37
37
 
38
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
39
-
40
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
41
-
42
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
43
-
44
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
45
-
46
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
47
-
48
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
49
-
50
38
  /*__reshadow-styles__:"./style/pills.shadow.css"*/
51
39
  var style = (
52
40
  /*__reshadow_css_start__*/
53
41
  _core.sstyled.insert(
54
42
  /*__inner_css_start__*/
55
- ".___SPill_yk7qx_gg_,.___SPills_yk7qx_gg_{display:inline-flex;align-items:center;justify-content:center}.___SPills_yk7qx_gg_{isolation:isolate}.___SPill_yk7qx_gg_{line-height:normal;position:relative;touch-action:manipulation;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0;box-shadow:none;text-decoration:none;-webkit-tap-highlight-color:transparent;overflow:visible;outline:0;text-align:center;vertical-align:middle;font-family:inherit;cursor:pointer;background:var(--intergalactic-bg-primary-neutral, #ffffff);border:1px solid var(--intergalactic-border-primary, #c4c7cf);border-radius:var(--intergalactic-control-rounded, 6px)}.___SPill_yk7qx_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_yk7qx_gg_:active,.___SPill_yk7qx_gg_:focus{outline:0;text-decoration:none}@media (hover:hover){.___SPill_yk7qx_gg_:hover{outline:0;text-decoration:none;background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_yk7qx_gg_.__selected_yk7qx_gg_{background:var(--intergalactic-control-secondary-info-hover, rgba(0, 143, 248, 0.2));border-color:var(--intergalactic-border-info-active, #006dca);z-index:1}.___SPill_yk7qx_gg_.__disabled_yk7qx_gg_{cursor:default;pointer-events:none}.___SPill_yk7qx_gg_.__disabled_yk7qx_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SPill_yk7qx_gg_.__keyboardFocused_yk7qx_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.3))}.___SText_yk7qx_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_yk7qx_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_yk7qx_gg_._size_m_yk7qx_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_yk7qx_gg_._size_l_yk7qx_gg_ .___SText_yk7qx_gg_,.___SPill_yk7qx_gg_._size_m_yk7qx_gg_ .___SText_yk7qx_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_yk7qx_gg_._size_m_yk7qx_gg_ .___SAddon_yk7qx_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_yk7qx_gg_._size_m_yk7qx_gg_ .___SAddon_yk7qx_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_yk7qx_gg_._size_m_yk7qx_gg_ .___SAddon_yk7qx_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_yk7qx_gg_._size_l_yk7qx_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_yk7qx_gg_._size_l_yk7qx_gg_ .___SAddon_yk7qx_gg_:only-child,.___SPill_yk7qx_gg_._size_l_yk7qx_gg_ .___SText_yk7qx_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_yk7qx_gg_._size_l_yk7qx_gg_ .___SAddon_yk7qx_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_yk7qx_gg_._size_l_yk7qx_gg_ .___SAddon_yk7qx_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_yk7qx_gg_._neighborLocation_right_yk7qx_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_yk7qx_gg_._neighborLocation_both_yk7qx_gg_{border-radius:0;margin-left:-1px}.___SPill_yk7qx_gg_._neighborLocation_left_yk7qx_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}"
43
+ ".___SPill_38ctb_gg_,.___SPills_38ctb_gg_{display:inline-flex;align-items:center;justify-content:center}.___SPills_38ctb_gg_{isolation:isolate}.___SPill_38ctb_gg_{line-height:normal;position:relative;touch-action:manipulation;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0;box-shadow:none;text-decoration:none;-webkit-tap-highlight-color:transparent;overflow:visible;outline:0;text-align:center;vertical-align:middle;font-family:inherit;cursor:pointer;background:var(--intergalactic-bg-primary-neutral, #ffffff);border:1px solid var(--intergalactic-border-primary, #c4c7cf);border-radius:var(--intergalactic-control-rounded, 6px)}.___SPill_38ctb_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_38ctb_gg_:active,.___SPill_38ctb_gg_:focus{outline:0;text-decoration:none}@media (hover:hover){.___SPill_38ctb_gg_:hover{outline:0;text-decoration:none;background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_38ctb_gg_.__selected_38ctb_gg_{background:var(--intergalactic-control-secondary-info-hover, rgba(0, 143, 248, 0.2));border-color:var(--intergalactic-border-info-active, #006dca);z-index:1}.___SPill_38ctb_gg_.__disabled_38ctb_gg_{cursor:default;pointer-events:none}.___SPill_38ctb_gg_.__disabled_38ctb_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SPill_38ctb_gg_.__keyboardFocused_38ctb_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.3))}.___SText_38ctb_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_38ctb_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_38ctb_gg_._size_m_38ctb_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_38ctb_gg_._size_l_38ctb_gg_ .___SText_38ctb_gg_,.___SPill_38ctb_gg_._size_m_38ctb_gg_ .___SText_38ctb_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_38ctb_gg_._size_m_38ctb_gg_ .___SAddon_38ctb_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_38ctb_gg_._size_m_38ctb_gg_ .___SAddon_38ctb_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_38ctb_gg_._size_m_38ctb_gg_ .___SAddon_38ctb_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_38ctb_gg_._size_l_38ctb_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_38ctb_gg_._size_l_38ctb_gg_ .___SAddon_38ctb_gg_:only-child,.___SPill_38ctb_gg_._size_l_38ctb_gg_ .___SText_38ctb_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_38ctb_gg_._size_l_38ctb_gg_ .___SAddon_38ctb_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_38ctb_gg_._size_l_38ctb_gg_ .___SAddon_38ctb_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_38ctb_gg_._neighborLocation_right_38ctb_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_38ctb_gg_._neighborLocation_both_38ctb_gg_{border-radius:0;margin-left:-1px}.___SPill_38ctb_gg_._neighborLocation_left_38ctb_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}"
56
44
  /*__inner_css_end__*/
57
- , "yk7qx_gg_")
45
+ , "38ctb_gg_")
58
46
  /*__reshadow_css_end__*/
59
47
  , {
60
- "__SPills": "___SPills_yk7qx_gg_",
61
- "__SPill": "___SPill_yk7qx_gg_",
62
- "_selected": "__selected_yk7qx_gg_",
63
- "_disabled": "__disabled_yk7qx_gg_",
64
- "_keyboardFocused": "__keyboardFocused_yk7qx_gg_",
65
- "__SText": "___SText_yk7qx_gg_",
66
- "__SAddon": "___SAddon_yk7qx_gg_",
67
- "_size_m": "_size_m_yk7qx_gg_",
68
- "_size_l": "_size_l_yk7qx_gg_",
69
- "_neighborLocation_right": "_neighborLocation_right_yk7qx_gg_",
70
- "_neighborLocation_both": "_neighborLocation_both_yk7qx_gg_",
71
- "_neighborLocation_left": "_neighborLocation_left_yk7qx_gg_"
48
+ "__SPills": "___SPills_38ctb_gg_",
49
+ "__SPill": "___SPill_38ctb_gg_",
50
+ "_selected": "__selected_38ctb_gg_",
51
+ "_disabled": "__disabled_38ctb_gg_",
52
+ "_keyboardFocused": "__keyboardFocused_38ctb_gg_",
53
+ "__SText": "___SText_38ctb_gg_",
54
+ "__SAddon": "___SAddon_38ctb_gg_",
55
+ "_size_m": "_size_m_38ctb_gg_",
56
+ "_size_l": "_size_l_38ctb_gg_",
57
+ "_neighborLocation_right": "_neighborLocation_right_38ctb_gg_",
58
+ "_neighborLocation_both": "_neighborLocation_both_38ctb_gg_",
59
+ "_neighborLocation_left": "_neighborLocation_left_38ctb_gg_"
72
60
  });
73
61
 
74
62
  var RootPills = /*#__PURE__*/function (_Component) {
75
63
  (0, _inherits2["default"])(RootPills, _Component);
76
64
 
77
- var _super = _createSuper(RootPills);
65
+ var _super = (0, _createSuper2["default"])(RootPills);
78
66
 
79
67
  function RootPills() {
80
68
  var _this;
@@ -128,7 +116,7 @@ var RootPills = /*#__PURE__*/function (_Component) {
128
116
  styles = _this$asProps2.styles,
129
117
  controlsLength = _this$asProps2.controlsLength,
130
118
  disabled = _this$asProps2.disabled;
131
- return _ref5 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SPills, _ref5.cn("SPills", _objectSpread({}, (0, _core.assignProps)({
119
+ return _ref5 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SPills, _ref5.cn("SPills", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
132
120
  "role": "radiogroup",
133
121
  "aria-disabled": disabled
134
122
  }, _ref))), /*#__PURE__*/_react["default"].createElement(_neighborLocation["default"], _ref5.cn("NeighborLocation", {
@@ -159,7 +147,7 @@ function Pill(props) {
159
147
  disabled = props.disabled,
160
148
  index = props.index;
161
149
  var neighborLocation = (0, _neighborLocation.useNeighborLocationDetect)(index);
162
- return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SPill, _ref6.cn("SPill", _objectSpread({}, (0, _core.assignProps)({
150
+ return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SPill, _ref6.cn("SPill", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
163
151
  "tag": "button",
164
152
  "type": "button",
165
153
  "role": "radio",
@@ -180,7 +168,7 @@ function Text(props) {
180
168
  _ref7;
181
169
 
182
170
  var SText = _flexBox.Box;
183
- return _ref7 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SText, _ref7.cn("SText", _objectSpread({}, (0, _core.assignProps)({
171
+ return _ref7 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SText, _ref7.cn("SText", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
184
172
  "tag": "span"
185
173
  }, _ref3))));
186
174
  }
@@ -190,7 +178,7 @@ function Addon(props) {
190
178
  _ref8;
191
179
 
192
180
  var SAddon = _flexBox.Box;
193
- return _ref8 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SAddon, _ref8.cn("SAddon", _objectSpread({}, (0, _core.assignProps)({
181
+ return _ref8 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SAddon, _ref8.cn("SAddon", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
194
182
  "tag": "span"
195
183
  }, _ref4))));
196
184
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Pills.js","names":["RootPills","value","e","handlers","props","i","asProps","size","disabled","index","selected","onClick","bindHandlerClick","SPills","Box","Children","styles","controlsLength","sstyled","Component","style","defaultValue","Pill","SPill","addonLeft","addonRight","neighborLocation","useNeighborLocationDetect","addonTextChildren","Pills","Item","Text","Addon","enhance","keyboardFocusEnhance","SText","SAddon","createComponent"],"sources":["../../src/Pills.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport NeighborLocation, { useNeighborLocationDetect } from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\n\nimport style from './style/pills.shadow.css';\n\nclass RootPills extends Component {\n static displayName = 'Pills';\n static style = style;\n static defaultProps = {\n size: 'm',\n defaultValue: null,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n };\n }\n\n bindHandlerClick = (value) => (e) => {\n this.handlers.value(value, e);\n };\n\n getItemProps(props, i) {\n const { value, size, disabled } = this.asProps;\n return {\n index: i,\n size,\n disabled,\n selected: value === props.value,\n onClick: this.bindHandlerClick(props.value),\n };\n }\n\n render() {\n const SPills = Root;\n const { Children, styles, controlsLength, disabled } = this.asProps;\n\n return sstyled(styles)(\n <SPills render={Box} role=\"radiogroup\" aria-disabled={disabled}>\n <NeighborLocation controlsLength={controlsLength}>\n <Children />\n </NeighborLocation>\n </SPills>,\n );\n }\n}\n\nfunction Pill(props) {\n const SPill = Root;\n const { Children, styles, addonLeft, addonRight, selected, disabled, index } = props;\n const neighborLocation = useNeighborLocationDetect(index);\n return sstyled(styles)(\n <SPill\n render={Box}\n tag=\"button\"\n type=\"button\"\n role=\"radio\"\n neighborLocation={neighborLocation}\n aria-checked={selected}\n aria-disabled={disabled}\n >\n {addonLeft ? <Pills.Item.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Pills.Item.Text, Pills.Item.Addon)}\n {addonRight ? <Pills.Item.Addon tag={addonRight} /> : null}\n </SPill>,\n );\n}\n\nPill.enhance = [keyboardFocusEnhance()];\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 Pills = createComponent(RootPills, {\n Item: [Pill, { Text, Addon }],\n});\n\nexport default Pills;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIMA,S;;;;;;;;;;;;;;;yGAce,UAACC,KAAD;MAAA,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KAAT,CAAe5B,KAAf,EAAsB;EAAA;EAAA;;EACpB,IAAMgC,MAAM,GACiCtB,YAD7C;EACA,eAAO,IAAAI,aAAA,EAAQd,KAAK,CAACY,MAAd,CAAP,eAA6B,gCAAC,MAAD;IAAA,OAAyB;EAAzB,YAA7B;AACD;;AAED,IAAMa,KAAK,GAAG,IAAAQ,gBAAA,EAAgBrC,SAAhB,EAA2B;EACvC8B,IAAI,EAAE,CAACR,IAAD,EAAO;IAAES,IAAI,EAAJA,IAAF;IAAQC,KAAK,EAALA;EAAR,CAAP;AADiC,CAA3B,CAAd;eAIeH,K"}
1
+ {"version":3,"file":"Pills.js","names":["RootPills","value","e","handlers","props","i","asProps","size","disabled","index","selected","onClick","bindHandlerClick","SPills","Box","Children","styles","controlsLength","sstyled","Component","style","defaultValue","Pill","SPill","addonLeft","addonRight","neighborLocation","useNeighborLocationDetect","addonTextChildren","Pills","Item","Text","Addon","enhance","keyboardFocusEnhance","SText","SAddon","createComponent"],"sources":["../../src/Pills.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport NeighborLocation, { useNeighborLocationDetect } from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\n\nimport style from './style/pills.shadow.css';\n\nclass RootPills extends Component {\n static displayName = 'Pills';\n static style = style;\n static defaultProps = {\n size: 'm',\n defaultValue: null,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n };\n }\n\n bindHandlerClick = (value) => (e) => {\n this.handlers.value(value, e);\n };\n\n getItemProps(props, i) {\n const { value, size, disabled } = this.asProps;\n return {\n index: i,\n size,\n disabled,\n selected: value === props.value,\n onClick: this.bindHandlerClick(props.value),\n };\n }\n\n render() {\n const SPills = Root;\n const { Children, styles, controlsLength, disabled } = this.asProps;\n\n return sstyled(styles)(\n <SPills render={Box} role=\"radiogroup\" aria-disabled={disabled}>\n <NeighborLocation controlsLength={controlsLength}>\n <Children />\n </NeighborLocation>\n </SPills>,\n );\n }\n}\n\nfunction Pill(props) {\n const SPill = Root;\n const { Children, styles, addonLeft, addonRight, selected, disabled, index } = props;\n const neighborLocation = useNeighborLocationDetect(index);\n return sstyled(styles)(\n <SPill\n render={Box}\n tag=\"button\"\n type=\"button\"\n role=\"radio\"\n neighborLocation={neighborLocation}\n aria-checked={selected}\n aria-disabled={disabled}\n >\n {addonLeft ? <Pills.Item.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Pills.Item.Text, Pills.Item.Addon)}\n {addonRight ? <Pills.Item.Addon tag={addonRight} /> : null}\n </SPill>,\n );\n}\n\nPill.enhance = [keyboardFocusEnhance()];\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 Pills = createComponent(RootPills, {\n Item: [Pill, { Text, Addon }],\n});\n\nexport default Pills;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;IAIMA,S;;;;;;;;;;;;;;;yGAce,UAACC,KAAD;MAAA,OAAW,UAACC,CAAD,EAAO;QACnC,MAAKC,QAAL,CAAcF,KAAd,CAAoBA,KAApB,EAA2BC,CAA3B;MACD,CAFkB;IAAA,C;;;;;;WANnB,6BAAoB;MAClB,OAAO;QACLD,KAAK,EAAE;MADF,CAAP;IAGD;;;WAMD,sBAAaG,KAAb,EAAoBC,CAApB,EAAuB;MACrB,oBAAkC,KAAKC,OAAvC;MAAA,IAAQL,KAAR,iBAAQA,KAAR;MAAA,IAAeM,IAAf,iBAAeA,IAAf;MAAA,IAAqBC,QAArB,iBAAqBA,QAArB;MACA,OAAO;QACLC,KAAK,EAAEJ,CADF;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pills.js CHANGED
@@ -1,24 +1,15 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
1
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
3
  import _createClass from "@babel/runtime/helpers/createClass";
3
4
  import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
5
  import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _createSuper from "@babel/runtime/helpers/createSuper";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  import { sstyled as _sstyled } from "@semcore/core";
9
9
  import { assignProps as _assignProps4 } from "@semcore/core";
10
10
  import { assignProps as _assignProps3 } from "@semcore/core";
11
11
  import { assignProps as _assignProps2 } from "@semcore/core";
12
12
  import { assignProps as _assignProps } from "@semcore/core";
13
-
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
-
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
-
18
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
19
-
20
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
21
-
22
13
  import React from 'react';
23
14
  import createComponent, { Component, sstyled, Root } from '@semcore/core';
24
15
  import { Box } from '@semcore/flex-box';
@@ -31,23 +22,23 @@ var style = (
31
22
  /*__reshadow_css_start__*/
32
23
  _sstyled.insert(
33
24
  /*__inner_css_start__*/
34
- ".___SPill_yk7qx_gg_,.___SPills_yk7qx_gg_{display:inline-flex;align-items:center;justify-content:center}.___SPills_yk7qx_gg_{isolation:isolate}.___SPill_yk7qx_gg_{line-height:normal;position:relative;touch-action:manipulation;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0;box-shadow:none;text-decoration:none;-webkit-tap-highlight-color:transparent;overflow:visible;outline:0;text-align:center;vertical-align:middle;font-family:inherit;cursor:pointer;background:var(--intergalactic-bg-primary-neutral, #ffffff);border:1px solid var(--intergalactic-border-primary, #c4c7cf);border-radius:var(--intergalactic-control-rounded, 6px)}.___SPill_yk7qx_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_yk7qx_gg_:active,.___SPill_yk7qx_gg_:focus{outline:0;text-decoration:none}@media (hover:hover){.___SPill_yk7qx_gg_:hover{outline:0;text-decoration:none;background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_yk7qx_gg_.__selected_yk7qx_gg_{background:var(--intergalactic-control-secondary-info-hover, rgba(0, 143, 248, 0.2));border-color:var(--intergalactic-border-info-active, #006dca);z-index:1}.___SPill_yk7qx_gg_.__disabled_yk7qx_gg_{cursor:default;pointer-events:none}.___SPill_yk7qx_gg_.__disabled_yk7qx_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SPill_yk7qx_gg_.__keyboardFocused_yk7qx_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.3))}.___SText_yk7qx_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_yk7qx_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_yk7qx_gg_._size_m_yk7qx_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_yk7qx_gg_._size_l_yk7qx_gg_ .___SText_yk7qx_gg_,.___SPill_yk7qx_gg_._size_m_yk7qx_gg_ .___SText_yk7qx_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_yk7qx_gg_._size_m_yk7qx_gg_ .___SAddon_yk7qx_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_yk7qx_gg_._size_m_yk7qx_gg_ .___SAddon_yk7qx_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_yk7qx_gg_._size_m_yk7qx_gg_ .___SAddon_yk7qx_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_yk7qx_gg_._size_l_yk7qx_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_yk7qx_gg_._size_l_yk7qx_gg_ .___SAddon_yk7qx_gg_:only-child,.___SPill_yk7qx_gg_._size_l_yk7qx_gg_ .___SText_yk7qx_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_yk7qx_gg_._size_l_yk7qx_gg_ .___SAddon_yk7qx_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_yk7qx_gg_._size_l_yk7qx_gg_ .___SAddon_yk7qx_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_yk7qx_gg_._neighborLocation_right_yk7qx_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_yk7qx_gg_._neighborLocation_both_yk7qx_gg_{border-radius:0;margin-left:-1px}.___SPill_yk7qx_gg_._neighborLocation_left_yk7qx_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}"
25
+ ".___SPill_38ctb_gg_,.___SPills_38ctb_gg_{display:inline-flex;align-items:center;justify-content:center}.___SPills_38ctb_gg_{isolation:isolate}.___SPill_38ctb_gg_{line-height:normal;position:relative;touch-action:manipulation;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0;box-shadow:none;text-decoration:none;-webkit-tap-highlight-color:transparent;overflow:visible;outline:0;text-align:center;vertical-align:middle;font-family:inherit;cursor:pointer;background:var(--intergalactic-bg-primary-neutral, #ffffff);border:1px solid var(--intergalactic-border-primary, #c4c7cf);border-radius:var(--intergalactic-control-rounded, 6px)}.___SPill_38ctb_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_38ctb_gg_:active,.___SPill_38ctb_gg_:focus{outline:0;text-decoration:none}@media (hover:hover){.___SPill_38ctb_gg_:hover{outline:0;text-decoration:none;background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_38ctb_gg_.__selected_38ctb_gg_{background:var(--intergalactic-control-secondary-info-hover, rgba(0, 143, 248, 0.2));border-color:var(--intergalactic-border-info-active, #006dca);z-index:1}.___SPill_38ctb_gg_.__disabled_38ctb_gg_{cursor:default;pointer-events:none}.___SPill_38ctb_gg_.__disabled_38ctb_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SPill_38ctb_gg_.__keyboardFocused_38ctb_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.3))}.___SText_38ctb_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_38ctb_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_38ctb_gg_._size_m_38ctb_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_38ctb_gg_._size_l_38ctb_gg_ .___SText_38ctb_gg_,.___SPill_38ctb_gg_._size_m_38ctb_gg_ .___SText_38ctb_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_38ctb_gg_._size_m_38ctb_gg_ .___SAddon_38ctb_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_38ctb_gg_._size_m_38ctb_gg_ .___SAddon_38ctb_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_38ctb_gg_._size_m_38ctb_gg_ .___SAddon_38ctb_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_38ctb_gg_._size_l_38ctb_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_38ctb_gg_._size_l_38ctb_gg_ .___SAddon_38ctb_gg_:only-child,.___SPill_38ctb_gg_._size_l_38ctb_gg_ .___SText_38ctb_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_38ctb_gg_._size_l_38ctb_gg_ .___SAddon_38ctb_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_38ctb_gg_._size_l_38ctb_gg_ .___SAddon_38ctb_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_38ctb_gg_._neighborLocation_right_38ctb_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_38ctb_gg_._neighborLocation_both_38ctb_gg_{border-radius:0;margin-left:-1px}.___SPill_38ctb_gg_._neighborLocation_left_38ctb_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}"
35
26
  /*__inner_css_end__*/
36
- , "yk7qx_gg_")
27
+ , "38ctb_gg_")
37
28
  /*__reshadow_css_end__*/
38
29
  , {
39
- "__SPills": "___SPills_yk7qx_gg_",
40
- "__SPill": "___SPill_yk7qx_gg_",
41
- "_selected": "__selected_yk7qx_gg_",
42
- "_disabled": "__disabled_yk7qx_gg_",
43
- "_keyboardFocused": "__keyboardFocused_yk7qx_gg_",
44
- "__SText": "___SText_yk7qx_gg_",
45
- "__SAddon": "___SAddon_yk7qx_gg_",
46
- "_size_m": "_size_m_yk7qx_gg_",
47
- "_size_l": "_size_l_yk7qx_gg_",
48
- "_neighborLocation_right": "_neighborLocation_right_yk7qx_gg_",
49
- "_neighborLocation_both": "_neighborLocation_both_yk7qx_gg_",
50
- "_neighborLocation_left": "_neighborLocation_left_yk7qx_gg_"
30
+ "__SPills": "___SPills_38ctb_gg_",
31
+ "__SPill": "___SPill_38ctb_gg_",
32
+ "_selected": "__selected_38ctb_gg_",
33
+ "_disabled": "__disabled_38ctb_gg_",
34
+ "_keyboardFocused": "__keyboardFocused_38ctb_gg_",
35
+ "__SText": "___SText_38ctb_gg_",
36
+ "__SAddon": "___SAddon_38ctb_gg_",
37
+ "_size_m": "_size_m_38ctb_gg_",
38
+ "_size_l": "_size_l_38ctb_gg_",
39
+ "_neighborLocation_right": "_neighborLocation_right_38ctb_gg_",
40
+ "_neighborLocation_both": "_neighborLocation_both_38ctb_gg_",
41
+ "_neighborLocation_left": "_neighborLocation_left_38ctb_gg_"
51
42
  });
52
43
 
53
44
  var RootPills = /*#__PURE__*/function (_Component) {
@@ -1 +1 @@
1
- {"version":3,"file":"Pills.js","names":["React","createComponent","Component","sstyled","Root","Box","NeighborLocation","useNeighborLocationDetect","keyboardFocusEnhance","addonTextChildren","RootPills","value","e","handlers","props","i","asProps","size","disabled","index","selected","onClick","bindHandlerClick","SPills","Children","styles","controlsLength","style","defaultValue","Pill","SPill","addonLeft","addonRight","neighborLocation","Pills","Item","Text","Addon","enhance","SText","SAddon"],"sources":["../../src/Pills.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport NeighborLocation, { useNeighborLocationDetect } from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\n\nimport style from './style/pills.shadow.css';\n\nclass RootPills extends Component {\n static displayName = 'Pills';\n static style = style;\n static defaultProps = {\n size: 'm',\n defaultValue: null,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n };\n }\n\n bindHandlerClick = (value) => (e) => {\n this.handlers.value(value, e);\n };\n\n getItemProps(props, i) {\n const { value, size, disabled } = this.asProps;\n return {\n index: i,\n size,\n disabled,\n selected: value === props.value,\n onClick: this.bindHandlerClick(props.value),\n };\n }\n\n render() {\n const SPills = Root;\n const { Children, styles, controlsLength, disabled } = this.asProps;\n\n return sstyled(styles)(\n <SPills render={Box} role=\"radiogroup\" aria-disabled={disabled}>\n <NeighborLocation controlsLength={controlsLength}>\n <Children />\n </NeighborLocation>\n </SPills>,\n );\n }\n}\n\nfunction Pill(props) {\n const SPill = Root;\n const { Children, styles, addonLeft, addonRight, selected, disabled, index } = props;\n const neighborLocation = useNeighborLocationDetect(index);\n return sstyled(styles)(\n <SPill\n render={Box}\n tag=\"button\"\n type=\"button\"\n role=\"radio\"\n neighborLocation={neighborLocation}\n aria-checked={selected}\n aria-disabled={disabled}\n >\n {addonLeft ? <Pills.Item.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Pills.Item.Text, Pills.Item.Addon)}\n {addonRight ? <Pills.Item.Addon tag={addonRight} /> : null}\n </SPill>,\n );\n}\n\nPill.enhance = [keyboardFocusEnhance()];\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 Pills = createComponent(RootPills, {\n Item: [Pill, { Text, Addon }],\n});\n\nexport default Pills;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,OAAOC,gBAAP,IAA2BC,yBAA3B,QAA4D,4BAA5D;AACA,OAAOC,oBAAP,MAAiC,kDAAjC;AACA,OAAOC,iBAAP,MAA8B,sCAA9B;;;;;;;;;;;;;;;;;;;;;;;;;;IAIMC,S;;;;;;;;;;;;;;;;uEAce,UAACC,KAAD;MAAA,OAAW,UAACC,CAAD,EAAO;QACnC,MAAKC,QAAL,CAAcF,KAAd,CAAoBA,KAApB,EAA2BC,CAA3B;MACD,CAFkB;IAAA,C;;;;;;;WANnB,6BAAoB;MAClB,OAAO;QACLD,KAAK,EAAE;MADF,CAAP;IAGD;;;WAMD,sBAAaG,KAAb,EAAoBC,CAApB,EAAuB;MACrB,oBAAkC,KAAKC,OAAvC;MAAA,IAAQL,KAAR,iBAAQA,KAAR;MAAA,IAAeM,IAAf,iBAAeA,IAAf;MAAA,IAAqBC,QAArB,iBAAqBA,QAArB;MACA,OAAO;QACLC,KAAK,EAAEJ,CADF;QAELE,IAAI,EAAJA,IAFK;QAGLC,QAAQ,EAARA,QAHK;QAILE,QAAQ,EAAET,KAAK,KAAKG,KAAK,CAACH,KAJrB;QAKLU,OAAO,EAAE,KAAKC,gBAAL,CAAsBR,KAAK,CAACH,KAA5B;MALJ,CAAP;IAOD;;;WAED,kBAAS;MAAA;MAAA;;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Ga,SAAS,gBAAG,oBAAC,KAAD,CAAO,IAAP,CAAY,KAAZ;IAAkB,GAAG,EAAEA;EAAvB,EAAH,GAA0C,IATtD,EAUGtB,iBAAiB,CAACe,QAAD,EAAWU,KAAK,CAACC,IAAN,CAAWC,IAAtB,EAA4BF,KAAK,CAACC,IAAN,CAAWE,KAAvC,CAVpB,EAWGL,UAAU,gBAAG,oBAAC,KAAD,CAAO,IAAP,CAAY,KAAZ;IAAkB,GAAG,EAAEA;EAAvB,EAAH,GAA2C,IAXxD,CADF;AAeD;;AAEDH,IAAI,CAACS,OAAL,GAAe,CAAC9B,oBAAoB,EAArB,CAAf;;AAEA,SAAS4B,IAAT,CAActB,KAAd,EAAqB;EAAA;EAAA;;EACnB,IAAMyB,KAAK,GACiClC,GAD5C;EACA,eAAOF,OAAO,CAACW,KAAK,CAACW,MAAP,CAAd,eAA6B,oBAAC,KAAD;IAAA,OAAwB;EAAxB,YAA7B;AACD;;AAED,SAASY,KAAT,CAAevB,KAAf,EAAsB;EAAA;EAAA;;EACpB,IAAM0B,MAAM,GACiCnC,GAD7C;EACA,eAAOF,OAAO,CAACW,KAAK,CAACW,MAAP,CAAd,eAA6B,oBAAC,MAAD;IAAA,OAAyB;EAAzB,YAA7B;AACD;;AAED,IAAMS,KAAK,GAAGjC,eAAe,CAACS,SAAD,EAAY;EACvCyB,IAAI,EAAE,CAACN,IAAD,EAAO;IAAEO,IAAI,EAAJA,IAAF;IAAQC,KAAK,EAALA;EAAR,CAAP;AADiC,CAAZ,CAA7B;AAIA,eAAeH,KAAf"}
1
+ {"version":3,"file":"Pills.js","names":["React","createComponent","Component","sstyled","Root","Box","NeighborLocation","useNeighborLocationDetect","keyboardFocusEnhance","addonTextChildren","RootPills","value","e","handlers","props","i","asProps","size","disabled","index","selected","onClick","bindHandlerClick","SPills","Children","styles","controlsLength","style","defaultValue","Pill","SPill","addonLeft","addonRight","neighborLocation","Pills","Item","Text","Addon","enhance","SText","SAddon"],"sources":["../../src/Pills.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport NeighborLocation, { useNeighborLocationDetect } from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\n\nimport style from './style/pills.shadow.css';\n\nclass RootPills extends Component {\n static displayName = 'Pills';\n static style = style;\n static defaultProps = {\n size: 'm',\n defaultValue: null,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n };\n }\n\n bindHandlerClick = (value) => (e) => {\n this.handlers.value(value, e);\n };\n\n getItemProps(props, i) {\n const { value, size, disabled } = this.asProps;\n return {\n index: i,\n size,\n disabled,\n selected: value === props.value,\n onClick: this.bindHandlerClick(props.value),\n };\n }\n\n render() {\n const SPills = Root;\n const { Children, styles, controlsLength, disabled } = this.asProps;\n\n return sstyled(styles)(\n <SPills render={Box} role=\"radiogroup\" aria-disabled={disabled}>\n <NeighborLocation controlsLength={controlsLength}>\n <Children />\n </NeighborLocation>\n </SPills>,\n );\n }\n}\n\nfunction Pill(props) {\n const SPill = Root;\n const { Children, styles, addonLeft, addonRight, selected, disabled, index } = props;\n const neighborLocation = useNeighborLocationDetect(index);\n return sstyled(styles)(\n <SPill\n render={Box}\n tag=\"button\"\n type=\"button\"\n role=\"radio\"\n neighborLocation={neighborLocation}\n aria-checked={selected}\n aria-disabled={disabled}\n >\n {addonLeft ? <Pills.Item.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Pills.Item.Text, Pills.Item.Addon)}\n {addonRight ? <Pills.Item.Addon tag={addonRight} /> : null}\n </SPill>,\n );\n}\n\nPill.enhance = [keyboardFocusEnhance()];\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\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AWE,KAAvC,CAVpB,EAWGL,UAAU,gBAAG,oBAAC,KAAD,CAAO,IAAP,CAAY,KAAZ;IAAkB,GAAG,EAAEA;EAAvB,EAAH,GAA2C,IAXxD,CADF;AAeD;;AAEDH,IAAI,CAACS,OAAL,GAAe,CAAC9B,oBAAoB,EAArB,CAAf;;AAEA,SAAS4B,IAAT,CAActB,KAAd,EAAqB;EAAA;EAAA;;EACnB,IAAMyB,KAAK,GACiClC,GAD5C;EACA,eAAOF,OAAO,CAACW,KAAK,CAACW,MAAP,CAAd,eAA6B,oBAAC,KAAD;IAAA,OAAwB;EAAxB,YAA7B;AACD;;AAED,SAASY,KAAT,CAAevB,KAAf,EAAsB;EAAA;EAAA;;EACpB,IAAM0B,MAAM,GACiCnC,GAD7C;EACA,eAAOF,OAAO,CAACW,KAAK,CAACW,MAAP,CAAd,eAA6B,oBAAC,MAAD;IAAA,OAAyB;EAAzB,YAA7B;AACD;;AAED,IAAMS,KAAK,GAAGjC,eAAe,CAACS,SAAD,EAAY;EACvCyB,IAAI,EAAE,CAACN,IAAD,EAAO;IAAEO,IAAI,EAAJA,IAAF;IAAQC,KAAK,EAALA;EAAR,CAAP;AADiC,CAAZ,CAA7B;AAIA,eAAeH,KAAf"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/pills",
3
3
  "description": "Semrush Pills Component",
4
- "version": "4.4.10",
4
+ "version": "4.4.11",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",