@semcore/pills 5.43.0-prerelease.9 → 5.43.1-prerelease.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -2
- package/lib/cjs/Pills.js +13 -13
- package/lib/es6/Pills.js +13 -13
- package/lib/esm/Pills.mjs +158 -0
- package/lib/esm/index.mjs +5 -0
- package/package.json +11 -6
- package/vite.config.ts +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
-
## [5.43.
|
|
5
|
+
## [5.43.1] - 2025-03-17
|
|
6
6
|
|
|
7
7
|
### Changed
|
|
8
8
|
|
|
9
|
-
- Version
|
|
9
|
+
- Version patch update due to children dependencies update (`@semcore/flex-box` [5.41.0 ~> 5.41.1], `@semcore/neighbor-location` [4.40.0 ~> 4.40.1], `@semcore/utils` [4.48.0 ~> 4.48.1], `@semcore/core` [2.39.0 ~> 2.39.1]).
|
|
10
|
+
|
|
11
|
+
## [5.43.0] - 2025-03-14
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Build for ESM.
|
|
10
16
|
|
|
11
17
|
## [5.42.1] - 2025-02-05
|
|
12
18
|
|
package/lib/cjs/Pills.js
CHANGED
|
@@ -23,19 +23,19 @@ var _addonTextChildren = _interopRequireDefault(require("@semcore/utils/lib/addo
|
|
|
23
23
|
var _a11yEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/a11yEnhance"));
|
|
24
24
|
var _logger = _interopRequireDefault(require("@semcore/utils/lib/logger"));
|
|
25
25
|
/*__reshadow-styles__:"./style/pills.shadow.css"*/
|
|
26
|
-
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".
|
|
27
|
-
"__SPills": "
|
|
28
|
-
"_keyboardFocused": "
|
|
29
|
-
"__SPill": "
|
|
30
|
-
"_selected": "
|
|
31
|
-
"__SText": "
|
|
32
|
-
"__SAddon": "
|
|
33
|
-
"_neighborLocation_right": "
|
|
34
|
-
"_neighborLocation_both": "
|
|
35
|
-
"_neighborLocation_left": "
|
|
36
|
-
"_disabled": "
|
|
37
|
-
"_size_m": "
|
|
38
|
-
"_size_l": "
|
|
26
|
+
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SPills_15aj4_gg_{display:inline-flex;align-items:center;justify-content:center;isolation:isolate;outline:0}.___SPills_15aj4_gg_.__keyboardFocused_15aj4_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));z-index:1}.___SPill_15aj4_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;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_15aj4_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_15aj4_gg_:active,.___SPill_15aj4_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPill_15aj4_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none;background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_15aj4_gg_.__selected_15aj4_gg_{background:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));border-color:var(--intergalactic-border-info-active, #006dca);z-index:1}.___SPill_15aj4_gg_.__disabled_15aj4_gg_{cursor:default;pointer-events:none}.___SPill_15aj4_gg_.__disabled_15aj4_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SPill_15aj4_gg_.__keyboardFocused_15aj4_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));z-index:1}.___SText_15aj4_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_15aj4_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_15aj4_gg_._size_m_15aj4_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SText_15aj4_gg_,.___SPill_15aj4_gg_._size_m_15aj4_gg_ .___SText_15aj4_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_15aj4_gg_._size_m_15aj4_gg_ .___SAddon_15aj4_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_15aj4_gg_._size_m_15aj4_gg_ .___SAddon_15aj4_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_15aj4_gg_._size_m_15aj4_gg_ .___SAddon_15aj4_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SAddon_15aj4_gg_:only-child,.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SText_15aj4_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SAddon_15aj4_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SAddon_15aj4_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_15aj4_gg_._neighborLocation_right_15aj4_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_15aj4_gg_._neighborLocation_both_15aj4_gg_{border-radius:0;margin-left:-1px}.___SPill_15aj4_gg_._neighborLocation_left_15aj4_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}" /*__inner_css_end__*/, "15aj4_gg_") /*__reshadow_css_end__*/, {
|
|
27
|
+
"__SPills": "___SPills_15aj4_gg_",
|
|
28
|
+
"_keyboardFocused": "__keyboardFocused_15aj4_gg_",
|
|
29
|
+
"__SPill": "___SPill_15aj4_gg_",
|
|
30
|
+
"_selected": "__selected_15aj4_gg_",
|
|
31
|
+
"__SText": "___SText_15aj4_gg_",
|
|
32
|
+
"__SAddon": "___SAddon_15aj4_gg_",
|
|
33
|
+
"_neighborLocation_right": "_neighborLocation_right_15aj4_gg_",
|
|
34
|
+
"_neighborLocation_both": "_neighborLocation_both_15aj4_gg_",
|
|
35
|
+
"_neighborLocation_left": "_neighborLocation_left_15aj4_gg_",
|
|
36
|
+
"_disabled": "__disabled_15aj4_gg_",
|
|
37
|
+
"_size_m": "_size_m_15aj4_gg_",
|
|
38
|
+
"_size_l": "_size_l_15aj4_gg_"
|
|
39
39
|
});
|
|
40
40
|
var optionsA11yEnhance = {
|
|
41
41
|
onNeighborChange: function onNeighborChange(neighborElement, props) {
|
package/lib/es6/Pills.js
CHANGED
|
@@ -19,19 +19,19 @@ import addonTextChildren from '@semcore/utils/lib/addonTextChildren';
|
|
|
19
19
|
import a11yEnhance from '@semcore/utils/lib/enhances/a11yEnhance';
|
|
20
20
|
import log from '@semcore/utils/lib/logger';
|
|
21
21
|
/*__reshadow-styles__:"./style/pills.shadow.css"*/
|
|
22
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
23
|
-
"__SPills": "
|
|
24
|
-
"_keyboardFocused": "
|
|
25
|
-
"__SPill": "
|
|
26
|
-
"_selected": "
|
|
27
|
-
"__SText": "
|
|
28
|
-
"__SAddon": "
|
|
29
|
-
"_neighborLocation_right": "
|
|
30
|
-
"_neighborLocation_both": "
|
|
31
|
-
"_neighborLocation_left": "
|
|
32
|
-
"_disabled": "
|
|
33
|
-
"_size_m": "
|
|
34
|
-
"_size_l": "
|
|
22
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPills_15aj4_gg_{display:inline-flex;align-items:center;justify-content:center;isolation:isolate;outline:0}.___SPills_15aj4_gg_.__keyboardFocused_15aj4_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));z-index:1}.___SPill_15aj4_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;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_15aj4_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_15aj4_gg_:active,.___SPill_15aj4_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPill_15aj4_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none;background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_15aj4_gg_.__selected_15aj4_gg_{background:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));border-color:var(--intergalactic-border-info-active, #006dca);z-index:1}.___SPill_15aj4_gg_.__disabled_15aj4_gg_{cursor:default;pointer-events:none}.___SPill_15aj4_gg_.__disabled_15aj4_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SPill_15aj4_gg_.__keyboardFocused_15aj4_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));z-index:1}.___SText_15aj4_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_15aj4_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_15aj4_gg_._size_m_15aj4_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SText_15aj4_gg_,.___SPill_15aj4_gg_._size_m_15aj4_gg_ .___SText_15aj4_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_15aj4_gg_._size_m_15aj4_gg_ .___SAddon_15aj4_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_15aj4_gg_._size_m_15aj4_gg_ .___SAddon_15aj4_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_15aj4_gg_._size_m_15aj4_gg_ .___SAddon_15aj4_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SAddon_15aj4_gg_:only-child,.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SText_15aj4_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SAddon_15aj4_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SAddon_15aj4_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_15aj4_gg_._neighborLocation_right_15aj4_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_15aj4_gg_._neighborLocation_both_15aj4_gg_{border-radius:0;margin-left:-1px}.___SPill_15aj4_gg_._neighborLocation_left_15aj4_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}" /*__inner_css_end__*/, "15aj4_gg_") /*__reshadow_css_end__*/, {
|
|
23
|
+
"__SPills": "___SPills_15aj4_gg_",
|
|
24
|
+
"_keyboardFocused": "__keyboardFocused_15aj4_gg_",
|
|
25
|
+
"__SPill": "___SPill_15aj4_gg_",
|
|
26
|
+
"_selected": "__selected_15aj4_gg_",
|
|
27
|
+
"__SText": "___SText_15aj4_gg_",
|
|
28
|
+
"__SAddon": "___SAddon_15aj4_gg_",
|
|
29
|
+
"_neighborLocation_right": "_neighborLocation_right_15aj4_gg_",
|
|
30
|
+
"_neighborLocation_both": "_neighborLocation_both_15aj4_gg_",
|
|
31
|
+
"_neighborLocation_left": "_neighborLocation_left_15aj4_gg_",
|
|
32
|
+
"_disabled": "__disabled_15aj4_gg_",
|
|
33
|
+
"_size_m": "_size_m_15aj4_gg_",
|
|
34
|
+
"_size_l": "_size_l_15aj4_gg_"
|
|
35
35
|
});
|
|
36
36
|
var optionsA11yEnhance = {
|
|
37
37
|
onNeighborChange: function onNeighborChange(neighborElement, props) {
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import f from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import k from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import w from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import v from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
5
|
+
import L from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
+
import A from "@babel/runtime/helpers/esm/createSuper";
|
|
7
|
+
import d from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
+
import { sstyled as C } from "@semcore/utils/lib/core/index";
|
|
9
|
+
import T, { sstyled as j, assignProps as x, Component as E } from "@semcore/core";
|
|
10
|
+
import s from "react";
|
|
11
|
+
import { Box as P } from "@semcore/flex-box";
|
|
12
|
+
import D, { useNeighborLocationDetect as N } from "@semcore/neighbor-location";
|
|
13
|
+
import y from "@semcore/utils/lib/enhances/keyboardFocusEnhance";
|
|
14
|
+
import R from "@semcore/utils/lib/addonTextChildren";
|
|
15
|
+
import F from "@semcore/utils/lib/enhances/a11yEnhance";
|
|
16
|
+
import S from "@semcore/utils/lib/logger";
|
|
17
|
+
var V = (
|
|
18
|
+
/*__reshadow_css_start__*/
|
|
19
|
+
(C.insert(
|
|
20
|
+
/*__inner_css_start__*/
|
|
21
|
+
".___SPills_15aj4_gg_{display:inline-flex;align-items:center;justify-content:center;isolation:isolate;outline:0}.___SPills_15aj4_gg_.__keyboardFocused_15aj4_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));z-index:1}.___SPill_15aj4_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;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_15aj4_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_15aj4_gg_:active,.___SPill_15aj4_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPill_15aj4_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none;background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_15aj4_gg_.__selected_15aj4_gg_{background:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));border-color:var(--intergalactic-border-info-active, #006dca);z-index:1}.___SPill_15aj4_gg_.__disabled_15aj4_gg_{cursor:default;pointer-events:none}.___SPill_15aj4_gg_.__disabled_15aj4_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SPill_15aj4_gg_.__keyboardFocused_15aj4_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));z-index:1}.___SText_15aj4_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_15aj4_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_15aj4_gg_._size_m_15aj4_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SText_15aj4_gg_,.___SPill_15aj4_gg_._size_m_15aj4_gg_ .___SText_15aj4_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_15aj4_gg_._size_m_15aj4_gg_ .___SAddon_15aj4_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_15aj4_gg_._size_m_15aj4_gg_ .___SAddon_15aj4_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_15aj4_gg_._size_m_15aj4_gg_ .___SAddon_15aj4_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SAddon_15aj4_gg_:only-child,.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SText_15aj4_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SAddon_15aj4_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_15aj4_gg_._size_l_15aj4_gg_ .___SAddon_15aj4_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_15aj4_gg_._neighborLocation_right_15aj4_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_15aj4_gg_._neighborLocation_both_15aj4_gg_{border-radius:0;margin-left:-1px}.___SPill_15aj4_gg_._neighborLocation_left_15aj4_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}",
|
|
22
|
+
"15aj4_gg_"
|
|
23
|
+
), {
|
|
24
|
+
__SPills: "___SPills_15aj4_gg_",
|
|
25
|
+
_keyboardFocused: "__keyboardFocused_15aj4_gg_",
|
|
26
|
+
__SPill: "___SPill_15aj4_gg_",
|
|
27
|
+
_selected: "__selected_15aj4_gg_",
|
|
28
|
+
__SText: "___SText_15aj4_gg_",
|
|
29
|
+
__SAddon: "___SAddon_15aj4_gg_",
|
|
30
|
+
_neighborLocation_right: "_neighborLocation_right_15aj4_gg_",
|
|
31
|
+
_neighborLocation_both: "_neighborLocation_both_15aj4_gg_",
|
|
32
|
+
_neighborLocation_left: "_neighborLocation_left_15aj4_gg_",
|
|
33
|
+
_disabled: "__disabled_15aj4_gg_",
|
|
34
|
+
_size_m: "_size_m_15aj4_gg_",
|
|
35
|
+
_size_l: "_size_l_15aj4_gg_"
|
|
36
|
+
})
|
|
37
|
+
), H = {
|
|
38
|
+
onNeighborChange: function(a, r) {
|
|
39
|
+
a && (a.focus(), (r.behavior === "auto" || r.behavior === "radio") && a.click());
|
|
40
|
+
},
|
|
41
|
+
childSelector: function(a) {
|
|
42
|
+
return a.behavior === "auto" || a.behavior === "radio" ? ["role", "radio"] : ["role", "tab"];
|
|
43
|
+
}
|
|
44
|
+
}, m = /* @__PURE__ */ function(_) {
|
|
45
|
+
L(r, _);
|
|
46
|
+
var a = A(r);
|
|
47
|
+
function r() {
|
|
48
|
+
var i;
|
|
49
|
+
k(this, r);
|
|
50
|
+
for (var l = arguments.length, o = new Array(l), n = 0; n < l; n++)
|
|
51
|
+
o[n] = arguments[n];
|
|
52
|
+
return i = a.call.apply(a, [this].concat(o)), d(v(i), "itemValues", []), d(v(i), "bindHandlerClick", function(e) {
|
|
53
|
+
return function(t) {
|
|
54
|
+
i.handlers.value(e, t);
|
|
55
|
+
};
|
|
56
|
+
}), d(v(i), "bindHandleKeyDown", function(e) {
|
|
57
|
+
return function(t) {
|
|
58
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), i.handlers.value(e, t));
|
|
59
|
+
};
|
|
60
|
+
}), d(v(i), "changeIndex", function(e, t) {
|
|
61
|
+
for (var c = !1; !c && e >= 0 && e < i.itemValues.length; ) {
|
|
62
|
+
t === "increment" && e++, t === "decrement" && e--;
|
|
63
|
+
var g = i.itemRefs[e];
|
|
64
|
+
(g == null ? void 0 : g.disabled) === !1 && (c = !0);
|
|
65
|
+
}
|
|
66
|
+
return e >= 0 && e < i.itemValues.length ? e : void 0;
|
|
67
|
+
}), i;
|
|
68
|
+
}
|
|
69
|
+
return w(r, [{
|
|
70
|
+
key: "componentDidMount",
|
|
71
|
+
value: function() {
|
|
72
|
+
S.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"), S.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");
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "uncontrolledProps",
|
|
76
|
+
value: function() {
|
|
77
|
+
return {
|
|
78
|
+
value: null
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
key: "getItemProps",
|
|
83
|
+
value: function(l, o) {
|
|
84
|
+
var n = this.asProps, e = n.value, t = n.size, c = n.disabled, g = n.behavior, u = e === l.value;
|
|
85
|
+
return this.itemValues[o] = l.value, {
|
|
86
|
+
index: o,
|
|
87
|
+
size: t,
|
|
88
|
+
disabled: c,
|
|
89
|
+
selected: u,
|
|
90
|
+
behavior: g,
|
|
91
|
+
tabIndex: u ? 0 : -1,
|
|
92
|
+
onClick: this.bindHandlerClick(l.value),
|
|
93
|
+
onKeyDown: this.bindHandleKeyDown(l.value)
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "render",
|
|
98
|
+
value: function() {
|
|
99
|
+
var l = this.asProps, o, n = P, e = this.asProps, t = e.Children, c = e.styles, g = e.controlsLength, u = e.disabled, b = e.behavior, h = e.value;
|
|
100
|
+
return o = j(c), /* @__PURE__ */ s.createElement(n, o.cn("SPills", f({}, x({
|
|
101
|
+
role: b === "radio" || b === "auto" ? "radiogroup" : "tablist",
|
|
102
|
+
"aria-disabled": u,
|
|
103
|
+
"use:tabIndex": h !== null ? -1 : 0
|
|
104
|
+
}, l))), /* @__PURE__ */ s.createElement(D, o.cn("NeighborLocation", {
|
|
105
|
+
controlsLength: g
|
|
106
|
+
}), /* @__PURE__ */ s.createElement(t, o.cn("Children", {}))));
|
|
107
|
+
}
|
|
108
|
+
}]), r;
|
|
109
|
+
}(E);
|
|
110
|
+
d(m, "displayName", "Pills");
|
|
111
|
+
d(m, "style", V);
|
|
112
|
+
d(m, "defaultProps", function(_) {
|
|
113
|
+
var a = _.behavior;
|
|
114
|
+
return {
|
|
115
|
+
size: "m",
|
|
116
|
+
defaultValue: null,
|
|
117
|
+
behavior: a ?? "auto"
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
d(m, "enhance", [F(H), y()]);
|
|
121
|
+
function z(_) {
|
|
122
|
+
var a = arguments[0], r, i = P, l = _.Children, o = _.styles, n = _.addonLeft, e = _.addonRight, t = _.selected, c = _.disabled, g = _.index, u = _.behavior, b = N(g), h = {};
|
|
123
|
+
return u === "radio" || u === "auto" ? (h.role = "radio", h["aria-checked"] = t) : (h.role = "tab", h["aria-selected"] = t), r = j(o), /* @__PURE__ */ s.createElement(i, r.cn("SPill", f({}, x(f({
|
|
124
|
+
tag: "button",
|
|
125
|
+
type: "button",
|
|
126
|
+
neighborLocation: b,
|
|
127
|
+
"aria-disabled": c
|
|
128
|
+
}, h), a))), n ? /* @__PURE__ */ s.createElement(p.Item.Addon, {
|
|
129
|
+
tag: n
|
|
130
|
+
}) : null, R(l, p.Item.Text, p.Item.Addon), e ? /* @__PURE__ */ s.createElement(p.Item.Addon, {
|
|
131
|
+
tag: e
|
|
132
|
+
}) : null);
|
|
133
|
+
}
|
|
134
|
+
z.enhance = [y()];
|
|
135
|
+
function I(_) {
|
|
136
|
+
var a = arguments[0], r, i = P;
|
|
137
|
+
return r = j(_.styles), /* @__PURE__ */ s.createElement(i, r.cn("SText", f({}, x({
|
|
138
|
+
tag: "span"
|
|
139
|
+
}, a))));
|
|
140
|
+
}
|
|
141
|
+
function K(_) {
|
|
142
|
+
var a = arguments[0], r, i = P;
|
|
143
|
+
return r = j(_.styles), /* @__PURE__ */ s.createElement(i, r.cn("SAddon", f({}, x({
|
|
144
|
+
tag: "span"
|
|
145
|
+
}, a))));
|
|
146
|
+
}
|
|
147
|
+
var p = T(m, {
|
|
148
|
+
Item: [z, {
|
|
149
|
+
Text: I,
|
|
150
|
+
Addon: K
|
|
151
|
+
}]
|
|
152
|
+
}), _e = function(a) {
|
|
153
|
+
return a;
|
|
154
|
+
};
|
|
155
|
+
export {
|
|
156
|
+
p as default,
|
|
157
|
+
_e as wrapPills
|
|
158
|
+
};
|
package/package.json
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/pills",
|
|
3
3
|
"description": "Semrush Pills Component",
|
|
4
|
-
"version": "5.43.
|
|
4
|
+
"version": "5.43.1-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"author": "UI-kit team <ui-kit-team@semrush.com>",
|
|
10
10
|
"license": "MIT",
|
|
11
|
+
"exports": {
|
|
12
|
+
"require": "./lib/cjs/index.js",
|
|
13
|
+
"import": "./lib/esm/index.mjs",
|
|
14
|
+
"types": "./lib/types/index.d.ts"
|
|
15
|
+
},
|
|
11
16
|
"dependencies": {
|
|
12
|
-
"@semcore/flex-box": "5.41.
|
|
13
|
-
"@semcore/neighbor-location": "4.
|
|
14
|
-
"@semcore/utils": "4.
|
|
17
|
+
"@semcore/flex-box": "5.41.1-prerelease.0",
|
|
18
|
+
"@semcore/neighbor-location": "4.40.1-prerelease.0",
|
|
19
|
+
"@semcore/utils": "4.48.1-prerelease.0"
|
|
15
20
|
},
|
|
16
21
|
"peerDependencies": {
|
|
17
|
-
"@semcore/core": "^2.39.
|
|
22
|
+
"@semcore/core": "^2.39.1-prerelease.0",
|
|
18
23
|
"react": "16.8 - 18",
|
|
19
24
|
"react-dom": "16.8 - 18"
|
|
20
25
|
},
|
|
@@ -30,6 +35,6 @@
|
|
|
30
35
|
"@semcore/testing-utils": "1.0.0"
|
|
31
36
|
},
|
|
32
37
|
"scripts": {
|
|
33
|
-
"build": "pnpm semcore-builder --source=js"
|
|
38
|
+
"build": "pnpm semcore-builder --source=js && pnpm vite build"
|
|
34
39
|
}
|
|
35
40
|
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig, mergeConfig } from 'vite';
|
|
2
|
+
|
|
3
|
+
import viteConfig from '../../commonVite.config';
|
|
4
|
+
|
|
5
|
+
export default mergeConfig(
|
|
6
|
+
viteConfig,
|
|
7
|
+
defineConfig({
|
|
8
|
+
build: {
|
|
9
|
+
lib: {
|
|
10
|
+
entry: './src/index.js',
|
|
11
|
+
},
|
|
12
|
+
rollupOptions: {
|
|
13
|
+
external: ['react', 'react-dom', 'react/jsx-runtime', /@babel\/runtime\/*/, /@semcore\/*/],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
}),
|
|
17
|
+
);
|