@semcore/pills 16.0.11 → 17.0.0-prerelease.18

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/lib/esm/Pills.mjs CHANGED
@@ -1,166 +1,158 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/esm/createClass";
4
- import _callSuper from "@babel/runtime/helpers/esm/callSuper";
5
- import _inherits from "@babel/runtime/helpers/esm/inherits";
6
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
- import { createComponent, sstyled, assignProps, Component } from "@semcore/core";
2
+ import { createComponent, sstyled, Component, assignProps } from "@semcore/core";
3
+ import { Box, NeighborLocation, useNeighborLocationDetect } from "@semcore/base-components";
8
4
  import addonTextChildren from "@semcore/core/lib/utils/addonTextChildren";
9
5
  import a11yEnhance from "@semcore/core/lib/utils/enhances/a11yEnhance";
10
- import log from "@semcore/core/lib/utils/logger";
11
- import { Box } from "@semcore/flex-box";
12
- import NeighborLocation, { useNeighborLocationDetect } from "@semcore/neighbor-location";
13
6
  import React from "react";
14
7
  /*!__reshadow-styles__:"./style/pills.shadow.css"*/
15
- var style = (
8
+ const style = (
16
9
  /*__reshadow_css_start__*/
17
10
  (sstyled.insert(
18
11
  /*__inner_css_start__*/
19
- ".___SPills_7x4a8_gg_{display:inline-flex;align-items:center;justify-content:center;isolation:isolate;border-radius:var(--intergalactic-control-rounded, 6px)}.___SPills_7x4a8_gg_ .___SPill_7x4a8_gg_.__selected_7x4a8_gg_{background:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));border-color:var(--intergalactic-border-info-active, #006dca);z-index:3}.___SPills_7x4a8_gg_ .___SPill_7x4a8_gg_.__selected_7x4a8_gg_,.___SPills_7x4a8_gg_ .___SPill_7x4a8_gg_:focus-visible{z-index:3}.___SPills_7x4a8_gg_ .___SPill_7x4a8_gg_:active{z-index:2}@media (hover:hover){.___SPills_7x4a8_gg_ .___SPill_7x4a8_gg_:hover{z-index:2}}.___SPill_7x4a8_gg_{display:inline-flex;align-items:center;justify-content:center;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;-webkit-text-decoration:none;text-decoration:none;-webkit-tap-highlight-color:transparent;overflow:visible;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_7x4a8_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_7x4a8_gg_:active{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPill_7x4a8_gg_:hover{background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_7x4a8_gg_.__disabled_7x4a8_gg_{cursor:default;pointer-events:none}.___SPill_7x4a8_gg_.__disabled_7x4a8_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SText_7x4a8_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_7x4a8_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_7x4a8_gg_._size_m_7x4a8_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_7x4a8_gg_._size_l_7x4a8_gg_ .___SText_7x4a8_gg_,.___SPill_7x4a8_gg_._size_m_7x4a8_gg_ .___SText_7x4a8_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_7x4a8_gg_._size_m_7x4a8_gg_ .___SAddon_7x4a8_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_7x4a8_gg_._size_m_7x4a8_gg_ .___SAddon_7x4a8_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_7x4a8_gg_._size_m_7x4a8_gg_ .___SAddon_7x4a8_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_7x4a8_gg_._size_l_7x4a8_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_7x4a8_gg_._size_l_7x4a8_gg_ .___SAddon_7x4a8_gg_:only-child,.___SPill_7x4a8_gg_._size_l_7x4a8_gg_ .___SText_7x4a8_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_7x4a8_gg_._size_l_7x4a8_gg_ .___SAddon_7x4a8_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_7x4a8_gg_._size_l_7x4a8_gg_ .___SAddon_7x4a8_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_7x4a8_gg_._neighborLocation_right_7x4a8_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_7x4a8_gg_._neighborLocation_both_7x4a8_gg_{border-radius:0;margin-left:-1px}.___SPill_7x4a8_gg_._neighborLocation_left_7x4a8_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}",
12
+ ".___SPills_1x82a_gg_{display:inline-flex;align-items:center;justify-content:center;isolation:isolate;border-radius:var(--intergalactic-control-rounded, 6px)}.___SPills_1x82a_gg_ .___SPill_1x82a_gg_.__selected_1x82a_gg_{background:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));border-color:var(--intergalactic-border-info-active, #006dca);z-index:3}.___SPills_1x82a_gg_ .___SPill_1x82a_gg_.__selected_1x82a_gg_,.___SPills_1x82a_gg_ .___SPill_1x82a_gg_:focus-visible{z-index:3}.___SPills_1x82a_gg_ .___SPill_1x82a_gg_:active{z-index:2}@media (hover:hover){.___SPills_1x82a_gg_ .___SPill_1x82a_gg_:hover{z-index:2}}.___SPill_1x82a_gg_{display:inline-flex;align-items:center;justify-content:center;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;-webkit-text-decoration:none;text-decoration:none;-webkit-tap-highlight-color:transparent;overflow:visible;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_1x82a_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_1x82a_gg_:active{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPill_1x82a_gg_:hover{background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_1x82a_gg_.__disabled_1x82a_gg_{cursor:default;pointer-events:none}.___SPill_1x82a_gg_.__disabled_1x82a_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SText_1x82a_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_1x82a_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_1x82a_gg_._size_m_1x82a_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_1x82a_gg_._size_l_1x82a_gg_ .___SText_1x82a_gg_,.___SPill_1x82a_gg_._size_m_1x82a_gg_ .___SText_1x82a_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1x82a_gg_._size_m_1x82a_gg_ .___SAddon_1x82a_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_1x82a_gg_._size_m_1x82a_gg_ .___SAddon_1x82a_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1x82a_gg_._size_m_1x82a_gg_ .___SAddon_1x82a_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1x82a_gg_._size_l_1x82a_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_1x82a_gg_._size_l_1x82a_gg_ .___SAddon_1x82a_gg_:only-child,.___SPill_1x82a_gg_._size_l_1x82a_gg_ .___SText_1x82a_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1x82a_gg_._size_l_1x82a_gg_ .___SAddon_1x82a_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_1x82a_gg_._size_l_1x82a_gg_ .___SAddon_1x82a_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1x82a_gg_._neighborLocation_right_1x82a_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_1x82a_gg_._neighborLocation_both_1x82a_gg_{border-radius:0;margin-left:-1px}.___SPill_1x82a_gg_._neighborLocation_left_1x82a_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}",
20
13
  /*__inner_css_end__*/
21
- "7x4a8_gg_"
14
+ "1x82a_gg_"
22
15
  ), /*__reshadow_css_end__*/
23
16
  {
24
- "__SText": "___SText_7x4a8_gg_",
25
- "__SAddon": "___SAddon_7x4a8_gg_",
26
- "__SPill": "___SPill_7x4a8_gg_",
27
- "_neighborLocation_right": "_neighborLocation_right_7x4a8_gg_",
28
- "_neighborLocation_both": "_neighborLocation_both_7x4a8_gg_",
29
- "_neighborLocation_left": "_neighborLocation_left_7x4a8_gg_",
30
- "__SPills": "___SPills_7x4a8_gg_",
31
- "_selected": "__selected_7x4a8_gg_",
32
- "_disabled": "__disabled_7x4a8_gg_",
33
- "_size_m": "_size_m_7x4a8_gg_",
34
- "_size_l": "_size_l_7x4a8_gg_"
17
+ "__SText": "___SText_1x82a_gg_",
18
+ "__SAddon": "___SAddon_1x82a_gg_",
19
+ "__SPill": "___SPill_1x82a_gg_",
20
+ "_neighborLocation_right": "_neighborLocation_right_1x82a_gg_",
21
+ "_neighborLocation_both": "_neighborLocation_both_1x82a_gg_",
22
+ "_neighborLocation_left": "_neighborLocation_left_1x82a_gg_",
23
+ "__SPills": "___SPills_1x82a_gg_",
24
+ "_selected": "__selected_1x82a_gg_",
25
+ "_disabled": "__disabled_1x82a_gg_",
26
+ "_size_m": "_size_m_1x82a_gg_",
27
+ "_size_l": "_size_l_1x82a_gg_"
35
28
  })
36
29
  );
37
- var optionsA11yEnhance = {
38
- onNeighborChange: function onNeighborChange(neighborElement, props) {
30
+ const optionsA11yEnhance = {
31
+ onNeighborChange: (neighborElement, props) => {
39
32
  if (neighborElement) {
40
33
  neighborElement.focus();
41
- if (props.behavior === "auto" || props.behavior === "radio") {
34
+ if (props.behavior === "auto") {
42
35
  neighborElement.click();
43
36
  }
44
37
  }
45
38
  },
46
- childSelector: function childSelector(props) {
47
- return props.behavior === "auto" || props.behavior === "radio" ? ["role", "radio"] : ["role", "tab"];
48
- }
39
+ childSelector: (props) => props.behavior === "auto" ? ["role", "radio"] : ["role", "tab"]
49
40
  };
50
- var RootPills = /* @__PURE__ */ (function(_Component) {
51
- function RootPills2() {
52
- var _this;
53
- _classCallCheck(this, RootPills2);
54
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
55
- args[_key] = arguments[_key];
56
- }
57
- _this = _callSuper(this, RootPills2, [].concat(args));
58
- _defineProperty(_this, "itemValues", []);
59
- _defineProperty(_this, "bindHandlerClick", function(value) {
60
- return function(e) {
61
- _this.handlers.value(value, e);
62
- };
41
+ class RootPills extends Component {
42
+ constructor(...args) {
43
+ super(...args);
44
+ _defineProperty(this, "itemValues", []);
45
+ _defineProperty(this, "bindHandlerClick", (value) => (e) => {
46
+ this.handlers.value(value, e);
63
47
  });
64
- _defineProperty(_this, "bindHandleKeyDown", function(value) {
65
- return function(event) {
66
- if (event.key === "Enter" || event.key === " ") {
67
- event.preventDefault();
68
- _this.handlers.value(value, event);
69
- }
70
- };
48
+ _defineProperty(this, "bindHandleKeyDown", (value) => (event) => {
49
+ if (event.key === "Enter" || event.key === " ") {
50
+ event.preventDefault();
51
+ this.handlers.value(value, event);
52
+ }
71
53
  });
72
- _defineProperty(_this, "changeIndex", function(startIndex, type) {
73
- var selectable = false;
74
- while (!selectable && startIndex >= 0 && startIndex < _this.itemValues.length) {
54
+ _defineProperty(this, "changeIndex", (startIndex, type) => {
55
+ let selectable = false;
56
+ while (!selectable && startIndex >= 0 && startIndex < this.itemValues.length) {
75
57
  if (type === "increment") startIndex++;
76
58
  if (type === "decrement") startIndex--;
77
- var element = _this.itemRefs[startIndex];
78
- if ((element === null || element === void 0 ? void 0 : element.disabled) === false) {
59
+ const element = this.itemRefs[startIndex];
60
+ if ((element == null ? void 0 : element.disabled) === false) {
79
61
  selectable = true;
80
62
  }
81
63
  }
82
- return startIndex >= 0 && startIndex < _this.itemValues.length ? startIndex : void 0;
64
+ return startIndex >= 0 && startIndex < this.itemValues.length ? startIndex : void 0;
83
65
  });
84
- return _this;
85
66
  }
86
- _inherits(RootPills2, _Component);
87
- return _createClass(RootPills2, [{
88
- key: "componentDidMount",
89
- value: function componentDidMount() {
90
- log.warn(this.asProps.behavior === "tabs", "Use behavior `manual` instead of `tabs`. \n`tabs` is deprecated and will be removed in the next major release.", "Pills");
91
- log.warn(this.asProps.behavior === "radio", "Use behavior `auto` (or nothing, it is default value) instead of `radio`. \n`radio` is deprecated and will be removed in the next major release.", "Pills");
92
- }
93
- }, {
94
- key: "uncontrolledProps",
95
- value: function uncontrolledProps() {
96
- return {
97
- value: null
98
- };
99
- }
100
- }, {
101
- key: "getItemProps",
102
- value: function getItemProps(props, index) {
103
- var _this$asProps = this.asProps, value = _this$asProps.value, size = _this$asProps.size, disabled = _this$asProps.disabled, behavior = _this$asProps.behavior;
104
- var isSelected = value === props.value;
105
- this.itemValues[index] = props.value;
106
- return {
107
- index,
108
- size,
109
- disabled,
110
- selected: isSelected,
111
- behavior,
112
- tabIndex: isSelected ? 0 : -1,
113
- onClick: this.bindHandlerClick(props.value),
114
- onKeyDown: this.bindHandleKeyDown(props.value)
115
- };
116
- }
117
- }, {
118
- key: "render",
119
- value: function render() {
120
- var _ref = this.asProps, _ref5;
121
- var SPills = Box;
122
- var _this$asProps2 = this.asProps, Children = _this$asProps2.Children, styles = _this$asProps2.styles, controlsLength = _this$asProps2.controlsLength, disabled = _this$asProps2.disabled, behavior = _this$asProps2.behavior, value = _this$asProps2.value;
123
- return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SPills, _ref5.cn("SPills", _objectSpread({}, assignProps({
124
- "role": behavior === "radio" || behavior === "auto" ? "radiogroup" : "tablist",
67
+ uncontrolledProps() {
68
+ return {
69
+ value: null
70
+ };
71
+ }
72
+ getItemProps(props, index) {
73
+ const {
74
+ value,
75
+ size,
76
+ disabled,
77
+ behavior
78
+ } = this.asProps;
79
+ const isSelected = value === props.value;
80
+ this.itemValues[index] = props.value;
81
+ return {
82
+ index,
83
+ size,
84
+ disabled,
85
+ selected: isSelected,
86
+ behavior,
87
+ tabIndex: isSelected ? 0 : -1,
88
+ onClick: this.bindHandlerClick(props.value),
89
+ onKeyDown: this.bindHandleKeyDown(props.value)
90
+ };
91
+ }
92
+ render() {
93
+ var _ref = this.asProps, _ref5;
94
+ const SPills = Box;
95
+ const {
96
+ Children,
97
+ styles,
98
+ controlsLength,
99
+ disabled,
100
+ behavior,
101
+ value
102
+ } = this.asProps;
103
+ return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SPills, _ref5.cn("SPills", {
104
+ ...assignProps({
105
+ "role": behavior === "auto" ? "radiogroup" : "tablist",
125
106
  "aria-disabled": disabled,
126
107
  "use:tabIndex": value !== null ? -1 : 0
127
- }, _ref))), /* @__PURE__ */ React.createElement(NeighborLocation, _ref5.cn("NeighborLocation", {
128
- "controlsLength": controlsLength
129
- }), /* @__PURE__ */ React.createElement(Children, _ref5.cn("Children", {}))));
130
- }
131
- }]);
132
- })(Component);
108
+ }, _ref)
109
+ }), /* @__PURE__ */ React.createElement(NeighborLocation, _ref5.cn("NeighborLocation", {
110
+ "controlsLength": controlsLength
111
+ }), /* @__PURE__ */ React.createElement(Children, _ref5.cn("Children", {}))));
112
+ }
113
+ }
133
114
  _defineProperty(RootPills, "displayName", "Pills");
134
115
  _defineProperty(RootPills, "style", style);
135
- _defineProperty(RootPills, "defaultProps", function(_ref9) {
136
- var behavior = _ref9.behavior;
137
- return {
138
- size: "m",
139
- defaultValue: null,
140
- behavior: behavior !== null && behavior !== void 0 ? behavior : "auto"
141
- };
142
- });
116
+ _defineProperty(RootPills, "defaultProps", ({
117
+ behavior
118
+ }) => ({
119
+ size: "m",
120
+ defaultValue: null,
121
+ behavior: behavior ?? "auto"
122
+ }));
143
123
  _defineProperty(RootPills, "enhance", [a11yEnhance(optionsA11yEnhance)]);
144
124
  function Pill(props) {
145
125
  var _ref2 = arguments[0], _ref6;
146
- var SPill = Box;
147
- var Children = props.Children, styles = props.styles, addonLeft = props.addonLeft, addonRight = props.addonRight, selected = props.selected, disabled = props.disabled, index = props.index, behavior = props.behavior;
148
- var neighborLocation = useNeighborLocationDetect(index);
149
- var roleAreaProps = {};
150
- if (behavior === "radio" || behavior === "auto") {
126
+ const SPill = Box;
127
+ const {
128
+ Children,
129
+ styles,
130
+ addonLeft,
131
+ addonRight,
132
+ selected,
133
+ disabled,
134
+ index,
135
+ behavior
136
+ } = props;
137
+ const neighborLocation = useNeighborLocationDetect(index);
138
+ const roleAreaProps = {};
139
+ if (behavior === "auto") {
151
140
  roleAreaProps.role = "radio";
152
141
  roleAreaProps["aria-checked"] = selected;
153
142
  } else {
154
143
  roleAreaProps.role = "tab";
155
144
  roleAreaProps["aria-selected"] = selected;
156
145
  }
157
- return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SPill, _ref6.cn("SPill", _objectSpread({}, assignProps(_objectSpread({
158
- "tag": "button",
159
- "type": "button",
160
- "tabIndex": 0,
161
- "neighborLocation": neighborLocation,
162
- "aria-disabled": disabled
163
- }, roleAreaProps), _ref2))), addonLeft ? /* @__PURE__ */ React.createElement(Pills.Item.Addon, {
146
+ return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SPill, _ref6.cn("SPill", {
147
+ ...assignProps({
148
+ "tag": "button",
149
+ "type": "button",
150
+ "tabIndex": 0,
151
+ "neighborLocation": neighborLocation,
152
+ "aria-disabled": disabled,
153
+ ...roleAreaProps
154
+ }, _ref2)
155
+ }), addonLeft ? /* @__PURE__ */ React.createElement(Pills.Item.Addon, {
164
156
  tag: addonLeft
165
157
  }) : null, addonTextChildren(Children, Pills.Item.Text, Pills.Item.Addon), addonRight ? /* @__PURE__ */ React.createElement(Pills.Item.Addon, {
166
158
  tag: addonRight
@@ -168,27 +160,29 @@ function Pill(props) {
168
160
  }
169
161
  function Text(props) {
170
162
  var _ref3 = arguments[0], _ref7;
171
- var SText = Box;
172
- return _ref7 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SText, _ref7.cn("SText", _objectSpread({}, assignProps({
173
- "tag": "span"
174
- }, _ref3))));
163
+ const SText = Box;
164
+ return _ref7 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SText, _ref7.cn("SText", {
165
+ ...assignProps({
166
+ "tag": "span"
167
+ }, _ref3)
168
+ }));
175
169
  }
176
170
  function Addon(props) {
177
171
  var _ref4 = arguments[0], _ref8;
178
- var SAddon = Box;
179
- return _ref8 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SAddon, _ref8.cn("SAddon", _objectSpread({}, assignProps({
180
- "tag": "span"
181
- }, _ref4))));
172
+ const SAddon = Box;
173
+ return _ref8 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SAddon, _ref8.cn("SAddon", {
174
+ ...assignProps({
175
+ "tag": "span"
176
+ }, _ref4)
177
+ }));
182
178
  }
183
- var Pills = createComponent(RootPills, {
179
+ const Pills = createComponent(RootPills, {
184
180
  Item: [Pill, {
185
181
  Text,
186
182
  Addon
187
183
  }]
188
184
  });
189
- var wrapPills = function wrapPills2(wrapper) {
190
- return wrapper;
191
- };
185
+ const wrapPills = (wrapper) => wrapper;
192
186
  export {
193
187
  Pills as default,
194
188
  wrapPills
@@ -1,25 +1,9 @@
1
- import type { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';
2
- import type { Box, BoxProps } from '@semcore/flex-box';
3
- import type { NeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';
1
+ import type { Box, BoxProps, NeighborItemProps, NeighborLocationProps } from '@semcore/base-components';
2
+ import type { PropGetterFn, Intergalactic } from '@semcore/core';
4
3
  import type React from 'react';
5
4
 
6
5
  export type PillsValue = string | number | boolean | null;
7
6
 
8
- /**
9
- * @deprecated
10
- * use `manual`
11
- */
12
- export type DeprecatedBehaviorTabs = 'tabs';
13
- /**
14
- * @deprecated
15
- * use `auto`
16
- */
17
- export type DeprecatedBehaviorRadio = 'radio';
18
-
19
- /** @deprecated */
20
- export interface IPillsProps<T extends PillsValue = PillsValue>
21
- extends PillsProps<T>,
22
- UnknownProperties {}
23
7
  export type PillsProps<T extends PillsValue = PillsValue> = NeighborLocationProps &
24
8
  BoxProps & {
25
9
  /** Pills size */
@@ -43,13 +27,10 @@ export type PillsProps<T extends PillsValue = PillsValue> = NeighborLocationProp
43
27
  * @default tabs
44
28
  */
45
29
  behavior?:
46
- DeprecatedBehaviorTabs | DeprecatedBehaviorRadio
47
30
  | 'auto'
48
31
  | 'manual';
49
32
  };
50
33
 
51
- /** @deprecated */
52
- export interface IPillProps extends PillProps, UnknownProperties {}
53
34
  export type PillProps = BoxProps &
54
35
  NeighborItemProps & {
55
36
  /** Pill value */
@@ -64,14 +45,10 @@ export type PillProps = BoxProps &
64
45
  addonRight?: React.ElementType;
65
46
  };
66
47
 
67
- /** @deprecated */
68
- export interface IPillsContext extends PillsContext, UnknownProperties {}
69
48
  export type PillsContext = {
70
49
  getItemProps: PropGetterFn;
71
50
  };
72
51
 
73
- /** @deprecated */
74
- export interface IPillsHandlers extends PillsHandlers, UnknownProperties {}
75
52
  export type PillsHandlers = {
76
53
  value: (value: PillsValue) => void;
77
54
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/pills",
3
3
  "description": "Semrush Pills Component",
4
- "version": "16.0.11",
4
+ "version": "17.0.0-prerelease.18",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -13,12 +13,8 @@
13
13
  "import": "./lib/esm/index.mjs",
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
- "dependencies": {
17
- "@semcore/flex-box": "16.0.11",
18
- "@semcore/neighbor-location": "16.0.11"
19
- },
20
16
  "peerDependencies": {
21
- "@semcore/base-components": "^16.0.0"
17
+ "@semcore/base-components": "^17.0.0-prerelease.18"
22
18
  },
23
19
  "repository": {
24
20
  "type": "git",
@@ -26,10 +22,11 @@
26
22
  "directory": "semcore/pills"
27
23
  },
28
24
  "devDependencies": {
29
- "@semcore/core": "16.5.1",
30
- "@semcore/badge": "16.0.7",
25
+ "@semcore/base-components": "17.0.0-prerelease.18",
26
+ "@semcore/badge": "17.0.0-prerelease.18",
31
27
  "@semcore/testing-utils": "1.0.0",
32
- "@semcore/icon": "16.7.2"
28
+ "@semcore/core": "17.0.0-prerelease.18",
29
+ "@semcore/icon": "16.7.2-prerelease.18"
33
30
  },
34
31
  "scripts": {
35
32
  "build": "pnpm semcore-builder --source=js && pnpm vite build"