@semcore/pills 16.0.0-prerelease.19 → 16.0.0-prerelease.20

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,12 +2,24 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [16.0.0] - 2025-01-09
5
+ ## [16.0.0] - 2025-05-19
6
6
 
7
- ### Changed
7
+ ### Break
8
8
 
9
9
  - `keyboardFocusEnhance` to css `:focus-visible` property.
10
10
 
11
+ ## [5.43.4] - 2025-05-13
12
+
13
+ ### Changed
14
+
15
+ - Version patch update due to children dependencies update (`@semcore/flex-box` [5.41.3 ~> 5.41.4], `@semcore/neighbor-location` [4.40.3 ~> 4.40.4], `@semcore/utils` [4.48.4 ~> 4.48.5], `@semcore/core` [2.39.3 ~> 2.39.4]).
16
+
17
+ ## [5.43.3] - 2025-05-09
18
+
19
+ ### Changed
20
+
21
+ - Version patch update due to children dependencies update (`@semcore/flex-box` [5.41.2 ~> 5.41.3], `@semcore/neighbor-location` [4.40.2 ~> 4.40.3], `@semcore/utils` [4.48.2 ~> 4.48.4], `@semcore/core` [2.39.2 ~> 2.39.3]).
22
+
11
23
  ## [5.43.2] - 2025-04-04
12
24
 
13
25
  ### Changed
package/lib/cjs/Pills.js CHANGED
@@ -20,19 +20,21 @@ var _neighborLocation = _interopRequireWildcard(require("@semcore/neighbor-locat
20
20
  var _addonTextChildren = _interopRequireDefault(require("@semcore/core/lib/utils/addonTextChildren"));
21
21
  var _a11yEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/a11yEnhance"));
22
22
  var _logger = _interopRequireDefault(require("@semcore/core/lib/utils/logger"));
23
- /*__reshadow-styles__:"./style/pills.shadow.css"*/
24
- var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SPill_1m0ra_gg_,.___SPills_1m0ra_gg_{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--intergalactic-control-rounded, 6px)}.___SPills_1m0ra_gg_{isolation:isolate}.___SPill_1m0ra_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;-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)}.___SPill_1m0ra_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_1m0ra_gg_:active{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPill_1m0ra_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none;background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_1m0ra_gg_.__selected_1m0ra_gg_{background:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));border-color:var(--intergalactic-border-info-active, #006dca)}.___SPill_1m0ra_gg_:active,.___SPill_1m0ra_gg_:focus-visible{z-index:1}@media (hover:hover){.___SPill_1m0ra_gg_:hover{z-index:1}}.___SPill_1m0ra_gg_.__disabled_1m0ra_gg_{cursor:default;pointer-events:none}.___SPill_1m0ra_gg_.__disabled_1m0ra_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SText_1m0ra_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_1m0ra_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_1m0ra_gg_._size_m_1m0ra_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SText_1m0ra_gg_,.___SPill_1m0ra_gg_._size_m_1m0ra_gg_ .___SText_1m0ra_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1m0ra_gg_._size_m_1m0ra_gg_ .___SAddon_1m0ra_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_1m0ra_gg_._size_m_1m0ra_gg_ .___SAddon_1m0ra_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1m0ra_gg_._size_m_1m0ra_gg_ .___SAddon_1m0ra_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SAddon_1m0ra_gg_:only-child,.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SText_1m0ra_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SAddon_1m0ra_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SAddon_1m0ra_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1m0ra_gg_._neighborLocation_right_1m0ra_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_1m0ra_gg_._neighborLocation_both_1m0ra_gg_{border-radius:0;margin-left:-1px}.___SPill_1m0ra_gg_._neighborLocation_left_1m0ra_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}" /*__inner_css_end__*/, "1m0ra_gg_") /*__reshadow_css_end__*/, {
25
- "__SPills": "___SPills_1m0ra_gg_",
26
- "__SPill": "___SPill_1m0ra_gg_",
27
- "_selected": "__selected_1m0ra_gg_",
28
- "__SText": "___SText_1m0ra_gg_",
29
- "__SAddon": "___SAddon_1m0ra_gg_",
30
- "_neighborLocation_right": "_neighborLocation_right_1m0ra_gg_",
31
- "_neighborLocation_both": "_neighborLocation_both_1m0ra_gg_",
32
- "_neighborLocation_left": "_neighborLocation_left_1m0ra_gg_",
33
- "_disabled": "__disabled_1m0ra_gg_",
34
- "_size_m": "_size_m_1m0ra_gg_",
35
- "_size_l": "_size_l_1m0ra_gg_"
23
+ /*!__reshadow-styles__:"./style/pills.shadow.css"*/
24
+ var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SPill_1642b_gg_,.___SPills_1642b_gg_{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--intergalactic-control-rounded, 6px)}.___SPills_1642b_gg_{isolation:isolate}.___SPill_1642b_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;-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)}.___SPill_1642b_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_1642b_gg_:active{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPill_1642b_gg_:hover{background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_1642b_gg_.__selected_1642b_gg_{background:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));border-color:var(--intergalactic-border-info-active, #006dca);z-index:2}.___SPill_1642b_gg_:active,.___SPill_1642b_gg_:focus-visible{z-index:1}@media (hover:hover){.___SPill_1642b_gg_:hover{z-index:1}}.___SPill_1642b_gg_.__disabled_1642b_gg_{cursor:default;pointer-events:none}.___SPill_1642b_gg_.__disabled_1642b_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SText_1642b_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_1642b_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_1642b_gg_._size_m_1642b_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_1642b_gg_._size_l_1642b_gg_ .___SText_1642b_gg_,.___SPill_1642b_gg_._size_m_1642b_gg_ .___SText_1642b_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1642b_gg_._size_m_1642b_gg_ .___SAddon_1642b_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_1642b_gg_._size_m_1642b_gg_ .___SAddon_1642b_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1642b_gg_._size_m_1642b_gg_ .___SAddon_1642b_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1642b_gg_._size_l_1642b_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_1642b_gg_._size_l_1642b_gg_ .___SAddon_1642b_gg_:only-child,.___SPill_1642b_gg_._size_l_1642b_gg_ .___SText_1642b_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1642b_gg_._size_l_1642b_gg_ .___SAddon_1642b_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_1642b_gg_._size_l_1642b_gg_ .___SAddon_1642b_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1642b_gg_._neighborLocation_right_1642b_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_1642b_gg_._neighborLocation_both_1642b_gg_{border-radius:0;margin-left:-1px}.___SPill_1642b_gg_._neighborLocation_left_1642b_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}", /*__inner_css_end__*/"1642b_gg_"),
25
+ /*__reshadow_css_end__*/
26
+ {
27
+ "__SPills": "___SPills_1642b_gg_",
28
+ "__SPill": "___SPill_1642b_gg_",
29
+ "_selected": "__selected_1642b_gg_",
30
+ "__SText": "___SText_1642b_gg_",
31
+ "__SAddon": "___SAddon_1642b_gg_",
32
+ "_neighborLocation_right": "_neighborLocation_right_1642b_gg_",
33
+ "_neighborLocation_both": "_neighborLocation_both_1642b_gg_",
34
+ "_neighborLocation_left": "_neighborLocation_left_1642b_gg_",
35
+ "_disabled": "__disabled_1642b_gg_",
36
+ "_size_m": "_size_m_1642b_gg_",
37
+ "_size_l": "_size_l_1642b_gg_"
36
38
  });
37
39
  var optionsA11yEnhance = {
38
40
  onNeighborChange: function onNeighborChange(neighborElement, props) {
@@ -1 +1 @@
1
- {"version":3,"file":"Pills.js","names":["_core","require","_react","_interopRequireDefault","_flexBox","_neighborLocation","_interopRequireWildcard","_addonTextChildren","_a11yEnhance","_logger","style","sstyled","insert","optionsA11yEnhance","onNeighborChange","neighborElement","props","focus","behavior","click","childSelector","RootPills","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","value","e","handlers","event","key","preventDefault","startIndex","type","selectable","itemValues","element","itemRefs","disabled","undefined","_createClass2","componentDidMount","log","warn","asProps","uncontrolledProps","getItemProps","index","_this$asProps","size","isSelected","selected","tabIndex","onClick","bindHandlerClick","onKeyDown","bindHandleKeyDown","render","_ref","_ref5","SPills","Box","_this$asProps2","Children","styles","controlsLength","createElement","cn","_objectSpread2","assignProps","Component","_ref9","defaultValue","a11yEnhance","Pill","_ref2","arguments[0]","_ref6","SPill","addonLeft","addonRight","neighborLocation","useNeighborLocationDetect","roleAreaProps","role","Pills","Item","Addon","tag","addonTextChildren","Text","_ref3","_ref7","SText","_ref4","_ref8","SAddon","createComponent","wrapPills","wrapper","exports","_default"],"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 addonTextChildren from '@semcore/core/lib/utils/addonTextChildren';\nimport a11yEnhance from '@semcore/core/lib/utils/enhances/a11yEnhance';\nimport log from '@semcore/core/lib/utils/logger';\n\nimport style from './style/pills.shadow.css';\n\nconst optionsA11yEnhance = {\n onNeighborChange: (neighborElement, props) => {\n if (neighborElement) {\n neighborElement.focus();\n if (props.behavior === 'auto' || props.behavior === 'radio') {\n neighborElement.click();\n }\n }\n },\n childSelector: (props) =>\n props.behavior === 'auto' || props.behavior === 'radio' ? ['role', 'radio'] : ['role', 'tab'],\n};\n\nclass RootPills extends Component {\n static displayName = 'Pills';\n static style = style;\n static defaultProps = ({ behavior }) => ({\n size: 'm',\n defaultValue: null,\n behavior: behavior ?? 'auto',\n });\n itemValues = [];\n static enhance = [a11yEnhance(optionsA11yEnhance)];\n\n componentDidMount() {\n log.warn(\n this.asProps.behavior === 'tabs',\n 'Use behavior `manual` instead of `tabs`. \\n`tabs` is deprecated and will be removed in the next major release.',\n 'Pills',\n );\n\n log.warn(\n this.asProps.behavior === 'radio',\n '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.',\n 'Pills',\n );\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 bindHandleKeyDown = (value) => (event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.handlers.value(value, event);\n }\n };\n\n getItemProps(props, index) {\n const { value, size, disabled, behavior } = this.asProps;\n const isSelected = value === props.value;\n\n this.itemValues[index] = props.value;\n return {\n index: index,\n size,\n disabled,\n selected: isSelected,\n behavior,\n tabIndex: isSelected ? 0 : -1,\n onClick: this.bindHandlerClick(props.value),\n onKeyDown: this.bindHandleKeyDown(props.value),\n };\n }\n\n changeIndex = (startIndex, type) => {\n let selectable = false;\n\n while (!selectable && startIndex >= 0 && startIndex < this.itemValues.length) {\n if (type === 'increment') startIndex++;\n if (type === 'decrement') startIndex--;\n\n const element = this.itemRefs[startIndex];\n\n if (element?.disabled === false) {\n selectable = true;\n }\n }\n\n return startIndex >= 0 && startIndex < this.itemValues.length ? startIndex : undefined;\n };\n\n render() {\n const SPills = Root;\n const { Children, styles, controlsLength, disabled, behavior, value } = this.asProps;\n\n return sstyled(styles)(\n <SPills\n render={Box}\n role={behavior === 'radio' || behavior === 'auto' ? 'radiogroup' : 'tablist'}\n aria-disabled={disabled}\n use:tabIndex={value !== null ? -1 : 0}\n >\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, behavior } = props;\n const neighborLocation = useNeighborLocationDetect(index);\n const roleAreaProps = {};\n if (behavior === 'radio' || behavior === 'auto') {\n roleAreaProps.role = 'radio';\n roleAreaProps['aria-checked'] = selected;\n } else {\n roleAreaProps.role = 'tab';\n roleAreaProps['aria-selected'] = selected;\n }\n return sstyled(styles)(\n <SPill\n render={Box}\n tag='button'\n type='button'\n tabIndex={0}\n neighborLocation={neighborLocation}\n aria-disabled={disabled}\n {...roleAreaProps}\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\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 const wrapPills = (wrapper) => wrapper;\n\nexport default Pills;\n"],"mappings":";;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,YAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,OAAA,GAAAN,sBAAA,CAAAF,OAAA;AAAiD;AAAA,IAAAS,KAAA,+BAAAV,KAAA,CAAAW,OAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAIjD,IAAMC,kBAAkB,GAAG;EACzBC,gBAAgB,EAAE,SAAAA,iBAACC,eAAe,EAAEC,KAAK,EAAK;IAC5C,IAAID,eAAe,EAAE;MACnBA,eAAe,CAACE,KAAK,EAAE;MACvB,IAAID,KAAK,CAACE,QAAQ,KAAK,MAAM,IAAIF,KAAK,CAACE,QAAQ,KAAK,OAAO,EAAE;QAC3DH,eAAe,CAACI,KAAK,EAAE;MACzB;IACF;EACF,CAAC;EACDC,aAAa,EAAE,SAAAA,cAACJ,KAAK;IAAA,OACnBA,KAAK,CAACE,QAAQ,KAAK,MAAM,IAAIF,KAAK,CAACE,QAAQ,KAAK,OAAO,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC;EAAA;AACjG,CAAC;AAAC,IAEIG,SAAS,0BAAAC,UAAA;EAAA,IAAAC,UAAA,aAAAF,SAAA,EAAAC,UA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AAK,EAAAD,KAAA,CAAAzB,EAAA,cAAAC,cAAA,qBAAAjF,KAAA,CAAAkF,WAAA;IAAA,OAAkB;EAAM,GAAAsB,KAAA,IAAG;AAChE;AAEA,SAASJ,KAAKA,CAACpF,KAAK,EAAE;EAAA,IAAA2F,KAAA,GAAAlB,YAAA;IAAAmB,KAAA;EACpB,IAAMC,MAAM,GACiCnC,YAAG;EAAhD,OAAAkC,KAAA,GAAO,IAAAjG,aAAO,EAACK,KAAK,CAAC6D,MAAM,CAAC,eAAC3E,MAAA,YAAA6E,aAAA,CAAC8B,MAAM,EAAAD,KAAA,CAAA5B,EAAA,eAAAC,cAAA,qBAAAjF,KAAA,CAAAkF,WAAA;IAAA,OAAkB;EAAM,GAAAyB,KAAA,IAAG;AACjE;AAEA,IAAMT,KAAK,GAAG,IAAAY,qBAAe,EAACzF,SAAS,EAAE;EACvC8E,IAAI,EAAE,CAACZ,IAAI,EAAE;IAAEgB,IAAI,EAAJA,IAAI;IAAEH,KAAK,EAALA;EAAM,CAAC;AAC9B,CAAC,CAAC;AAEK,IAAMW,SAAS,GAAG,SAAZA,SAASA,CAAIC,OAAO;EAAA,OAAKA,OAAO;AAAA;AAACC,OAAA,CAAAF,SAAA,GAAAA,SAAA;AAAA,IAAAG,QAAA,GAE/BhB,KAAK;AAAAe,OAAA,cAAAC,QAAA"}
1
+ {"version":3,"file":"Pills.js","names":["_core","require","_react","_interopRequireDefault","_flexBox","_neighborLocation","_interopRequireWildcard","_addonTextChildren","_a11yEnhance","_logger","style","sstyled","insert","optionsA11yEnhance","onNeighborChange","neighborElement","props","focus","behavior","click","childSelector","RootPills","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","value","e","handlers","event","key","preventDefault","startIndex","type","selectable","itemValues","element","itemRefs","disabled","undefined","_createClass2","componentDidMount","log","warn","asProps","uncontrolledProps","getItemProps","index","_this$asProps","size","isSelected","selected","tabIndex","onClick","bindHandlerClick","onKeyDown","bindHandleKeyDown","render","_ref","_ref5","SPills","Box","_this$asProps2","Children","styles","controlsLength","createElement","cn","_objectSpread2","assignProps","Component","_ref9","defaultValue","a11yEnhance","Pill","_ref2","arguments[0]","_ref6","SPill","addonLeft","addonRight","neighborLocation","useNeighborLocationDetect","roleAreaProps","role","Pills","Item","Addon","tag","addonTextChildren","Text","_ref3","_ref7","SText","_ref4","_ref8","SAddon","createComponent","wrapPills","wrapper","exports","_default"],"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 addonTextChildren from '@semcore/core/lib/utils/addonTextChildren';\nimport a11yEnhance from '@semcore/core/lib/utils/enhances/a11yEnhance';\nimport log from '@semcore/core/lib/utils/logger';\n\nimport style from './style/pills.shadow.css';\n\nconst optionsA11yEnhance = {\n onNeighborChange: (neighborElement, props) => {\n if (neighborElement) {\n neighborElement.focus();\n if (props.behavior === 'auto' || props.behavior === 'radio') {\n neighborElement.click();\n }\n }\n },\n childSelector: (props) =>\n props.behavior === 'auto' || props.behavior === 'radio' ? ['role', 'radio'] : ['role', 'tab'],\n};\n\nclass RootPills extends Component {\n static displayName = 'Pills';\n static style = style;\n static defaultProps = ({ behavior }) => ({\n size: 'm',\n defaultValue: null,\n behavior: behavior ?? 'auto',\n });\n itemValues = [];\n static enhance = [a11yEnhance(optionsA11yEnhance)];\n\n componentDidMount() {\n log.warn(\n this.asProps.behavior === 'tabs',\n 'Use behavior `manual` instead of `tabs`. \\n`tabs` is deprecated and will be removed in the next major release.',\n 'Pills',\n );\n\n log.warn(\n this.asProps.behavior === 'radio',\n '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.',\n 'Pills',\n );\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 bindHandleKeyDown = (value) => (event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.handlers.value(value, event);\n }\n };\n\n getItemProps(props, index) {\n const { value, size, disabled, behavior } = this.asProps;\n const isSelected = value === props.value;\n\n this.itemValues[index] = props.value;\n return {\n index: index,\n size,\n disabled,\n selected: isSelected,\n behavior,\n tabIndex: isSelected ? 0 : -1,\n onClick: this.bindHandlerClick(props.value),\n onKeyDown: this.bindHandleKeyDown(props.value),\n };\n }\n\n changeIndex = (startIndex, type) => {\n let selectable = false;\n\n while (!selectable && startIndex >= 0 && startIndex < this.itemValues.length) {\n if (type === 'increment') startIndex++;\n if (type === 'decrement') startIndex--;\n\n const element = this.itemRefs[startIndex];\n\n if (element?.disabled === false) {\n selectable = true;\n }\n }\n\n return startIndex >= 0 && startIndex < this.itemValues.length ? startIndex : undefined;\n };\n\n render() {\n const SPills = Root;\n const { Children, styles, controlsLength, disabled, behavior, value } = this.asProps;\n\n return sstyled(styles)(\n <SPills\n render={Box}\n role={behavior === 'radio' || behavior === 'auto' ? 'radiogroup' : 'tablist'}\n aria-disabled={disabled}\n use:tabIndex={value !== null ? -1 : 0}\n >\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, behavior } = props;\n const neighborLocation = useNeighborLocationDetect(index);\n const roleAreaProps = {};\n if (behavior === 'radio' || behavior === 'auto') {\n roleAreaProps.role = 'radio';\n roleAreaProps['aria-checked'] = selected;\n } else {\n roleAreaProps.role = 'tab';\n roleAreaProps['aria-selected'] = selected;\n }\n return sstyled(styles)(\n <SPill\n render={Box}\n tag='button'\n type='button'\n tabIndex={0}\n neighborLocation={neighborLocation}\n aria-disabled={disabled}\n {...roleAreaProps}\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\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 const wrapPills = (wrapper) => wrapper;\n\nexport default Pills;\n"],"mappings":";;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,YAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,OAAA,GAAAN,sBAAA,CAAAF,OAAA;AAAiD;AAAA,IAAAS,KAAA,+BAAAV,KAAA,CAAAW,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAIjD,IAAMC,kBAAkB,GAAG;EACzBC,gBAAgB,EAAE,SAAAA,iBAACC,eAAe,EAAEC,KAAK,EAAK;IAC5C,IAAID,eAAe,EAAE;MACnBA,eAAe,CAACE,KAAK,EAAE;MACvB,IAAID,KAAK,CAACE,QAAQ,KAAK,MAAM,IAAIF,KAAK,CAACE,QAAQ,KAAK,OAAO,EAAE;QAC3DH,eAAe,CAACI,KAAK,EAAE;MACzB;IACF;EACF,CAAC;EACDC,aAAa,EAAE,SAAAA,cAACJ,KAAK;IAAA,OACnBA,KAAK,CAACE,QAAQ,KAAK,MAAM,IAAIF,KAAK,CAACE,QAAQ,KAAK,OAAO,GAAG,CAAC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gB,KAAA;EACnB,IAAMC,KAAK,GACiChC,YAAG;EAA/C,OAAA+B,KAAA,GAAO,IAAA9F,aAAO,EAACK,KAAK,CAAC6D,MAAM,CAAC,eAAC3E,MAAA,YAAA6E,aAAA,CAAC2B,KAAK,EAAAD,KAAA,CAAAzB,EAAA,cAAAC,cAAA,qBAAAjF,KAAA,CAAAkF,WAAA;IAAA,OAAkB;EAAM,GAAAsB,KAAA,IAAG;AAChE;AAEA,SAASJ,KAAKA,CAACpF,KAAK,EAAE;EAAA,IAAA2F,KAAA,GAAAlB,YAAA;IAAAmB,KAAA;EACpB,IAAMC,MAAM,GACiCnC,YAAG;EAAhD,OAAAkC,KAAA,GAAO,IAAAjG,aAAO,EAACK,KAAK,CAAC6D,MAAM,CAAC,eAAC3E,MAAA,YAAA6E,aAAA,CAAC8B,MAAM,EAAAD,KAAA,CAAA5B,EAAA,eAAAC,cAAA,qBAAAjF,KAAA,CAAAkF,WAAA;IAAA,OAAkB;EAAM,GAAAyB,KAAA,IAAG;AACjE;AAEA,IAAMT,KAAK,GAAG,IAAAY,qBAAe,EAACzF,SAAS,EAAE;EACvC8E,IAAI,EAAE,CAACZ,IAAI,EAAE;IAAEgB,IAAI,EAAJA,IAAI;IAAEH,KAAK,EAALA;EAAM,CAAC;AAC9B,CAAC,CAAC;AAEK,IAAMW,SAAS,GAAG,SAAZA,SAASA,CAAIC,OAAO;EAAA,OAAKA,OAAO;AAAA;AAACC,OAAA,CAAAF,SAAA,GAAAA,SAAA;AAAA,IAAAG,QAAA,GAE/BhB,KAAK;AAAAe,OAAA,cAAAC,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { NeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';\nimport { KeyboardFocusProps } from '@semcore/core/lib/utils/enhances/keyboardFocusEnhance';\n\nexport type PillsValue = string | number | boolean | null;\n\n/** @deprecated */\nexport interface IPillsProps<T extends PillsValue = PillsValue>\n extends PillsProps<T>,\n UnknownProperties {}\nexport type PillsProps<T extends PillsValue = PillsValue> = NeighborLocationProps &\n KeyboardFocusProps &\n BoxProps & {\n /** Pills size */\n size?: 'l' | 'm';\n /** Disabled state */\n disabled?: boolean;\n /** Called when the selection is changed */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLSpanElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Value for the selected pill */\n value?: T;\n /** Default value for the selected pill */\n defaultValue?: T;\n /** Sets semantic role for corresponding behavior,\n * when set to `auto` pressing left and right arrows\n * selects corresponding sibling pill.\n *\n * It's recommended to use `auto` behavior in forms\n * while `manual` behavior for navigation and layout.\n * @default tabs\n */\n behavior?: /** @deprecated use `manual` */\n | 'tabs'\n /** @deprecated use `auto` */\n | 'radio'\n | 'auto'\n | 'manual';\n };\n\n/** @deprecated */\nexport interface IPillProps extends PillProps, UnknownProperties {}\nexport type PillProps = BoxProps &\n NeighborItemProps &\n KeyboardFocusProps & {\n /** Pill value */\n value?: PillsValue;\n /** Disabled state */\n disabled?: boolean;\n /** Selected state */\n selected?: boolean;\n /** Left addon text */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n };\n\n/** @deprecated */\nexport interface IPillsContext extends PillsContext, UnknownProperties {}\nexport type PillsContext = {\n getItemProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IPillsHandlers extends PillsHandlers, UnknownProperties {}\nexport type PillsHandlers = {\n value: (value: PillsValue) => void;\n};\n\ntype IntergalacticPillsComponent<PropsExtending = {}> = (<\n Value extends PillsValue,\n Tag extends Intergalactic.Tag = 'div',\n>(\n props: Intergalactic.InternalTypings.ComponentProps<\n Tag,\n 'div',\n PillsProps<Value>,\n PillsContext,\n [handlers: PillsHandlers]\n > &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', PillsProps>;\n\ndeclare const Pills: IntergalacticPillsComponent & {\n Item: Intergalactic.Component<'button', PillProps, [handlers: PillsHandlers]> & {\n Text: typeof Box;\n Addon: typeof Box;\n };\n};\n\ndeclare const wrapPills: <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticPillsComponent>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => IntergalacticPillsComponent<PropsExtending>;\nexport { wrapPills };\n\nexport default Pills;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { NeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';\n\nexport type PillsValue = string | number | boolean | null;\n\n/** @deprecated */\nexport interface IPillsProps<T extends PillsValue = PillsValue>\n extends PillsProps<T>,\n UnknownProperties {}\nexport type PillsProps<T extends PillsValue = PillsValue> = NeighborLocationProps &\n BoxProps & {\n /** Pills size */\n size?: 'l' | 'm';\n /** Disabled state */\n disabled?: boolean;\n /** Called when the selection is changed */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLSpanElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Value for the selected pill */\n value?: T;\n /** Default value for the selected pill */\n defaultValue?: T;\n /** Sets semantic role for corresponding behavior,\n * when set to `auto` pressing left and right arrows\n * selects corresponding sibling pill.\n *\n * It's recommended to use `auto` behavior in forms\n * while `manual` behavior for navigation and layout.\n * @default tabs\n */\n behavior?: /** @deprecated use `manual` */\n | 'tabs'\n /** @deprecated use `auto` */\n | 'radio'\n | 'auto'\n | 'manual';\n };\n\n/** @deprecated */\nexport interface IPillProps extends PillProps, UnknownProperties {}\nexport type PillProps = BoxProps &\n NeighborItemProps & {\n /** Pill value */\n value?: PillsValue;\n /** Disabled state */\n disabled?: boolean;\n /** Selected state */\n selected?: boolean;\n /** Left addon text */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n };\n\n/** @deprecated */\nexport interface IPillsContext extends PillsContext, UnknownProperties {}\nexport type PillsContext = {\n getItemProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IPillsHandlers extends PillsHandlers, UnknownProperties {}\nexport type PillsHandlers = {\n value: (value: PillsValue) => void;\n};\n\ntype IntergalacticPillsComponent<PropsExtending = {}> = (<\n Value extends PillsValue,\n Tag extends Intergalactic.Tag = 'div',\n>(\n props: Intergalactic.InternalTypings.ComponentProps<\n Tag,\n 'div',\n PillsProps<Value>,\n PillsContext,\n [handlers: PillsHandlers]\n > &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', PillsProps>;\n\ndeclare const Pills: IntergalacticPillsComponent & {\n Item: Intergalactic.Component<'button', PillProps, [handlers: PillsHandlers]> & {\n Text: typeof Box;\n Addon: typeof Box;\n };\n};\n\ndeclare const wrapPills: <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticPillsComponent>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => IntergalacticPillsComponent<PropsExtending>;\nexport { wrapPills };\n\nexport default Pills;\n"],"mappings":""}
@@ -35,8 +35,7 @@ SPill {
35
35
  padding: 0;
36
36
  }
37
37
 
38
- &:active,
39
- &:hover {
38
+ &:active {
40
39
  outline: 0;
41
40
  text-decoration: none;
42
41
  }
@@ -49,6 +48,7 @@ SPill {
49
48
  SPill[selected] {
50
49
  background: var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));
51
50
  border-color: var(--intergalactic-border-info-active, #006dca);
51
+ z-index: 2;
52
52
  }
53
53
  SPill:focus-visible, SPill:hover, SPill:active {
54
54
  z-index: 1;
package/lib/es6/Pills.js CHANGED
@@ -17,19 +17,21 @@ import NeighborLocation, { useNeighborLocationDetect } from '@semcore/neighbor-l
17
17
  import addonTextChildren from '@semcore/core/lib/utils/addonTextChildren';
18
18
  import a11yEnhance from '@semcore/core/lib/utils/enhances/a11yEnhance';
19
19
  import log from '@semcore/core/lib/utils/logger';
20
- /*__reshadow-styles__:"./style/pills.shadow.css"*/
21
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPill_1m0ra_gg_,.___SPills_1m0ra_gg_{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--intergalactic-control-rounded, 6px)}.___SPills_1m0ra_gg_{isolation:isolate}.___SPill_1m0ra_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;-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)}.___SPill_1m0ra_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_1m0ra_gg_:active{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPill_1m0ra_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none;background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_1m0ra_gg_.__selected_1m0ra_gg_{background:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));border-color:var(--intergalactic-border-info-active, #006dca)}.___SPill_1m0ra_gg_:active,.___SPill_1m0ra_gg_:focus-visible{z-index:1}@media (hover:hover){.___SPill_1m0ra_gg_:hover{z-index:1}}.___SPill_1m0ra_gg_.__disabled_1m0ra_gg_{cursor:default;pointer-events:none}.___SPill_1m0ra_gg_.__disabled_1m0ra_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SText_1m0ra_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_1m0ra_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_1m0ra_gg_._size_m_1m0ra_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SText_1m0ra_gg_,.___SPill_1m0ra_gg_._size_m_1m0ra_gg_ .___SText_1m0ra_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1m0ra_gg_._size_m_1m0ra_gg_ .___SAddon_1m0ra_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_1m0ra_gg_._size_m_1m0ra_gg_ .___SAddon_1m0ra_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1m0ra_gg_._size_m_1m0ra_gg_ .___SAddon_1m0ra_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SAddon_1m0ra_gg_:only-child,.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SText_1m0ra_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SAddon_1m0ra_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SAddon_1m0ra_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1m0ra_gg_._neighborLocation_right_1m0ra_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_1m0ra_gg_._neighborLocation_both_1m0ra_gg_{border-radius:0;margin-left:-1px}.___SPill_1m0ra_gg_._neighborLocation_left_1m0ra_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}" /*__inner_css_end__*/, "1m0ra_gg_") /*__reshadow_css_end__*/, {
22
- "__SPills": "___SPills_1m0ra_gg_",
23
- "__SPill": "___SPill_1m0ra_gg_",
24
- "_selected": "__selected_1m0ra_gg_",
25
- "__SText": "___SText_1m0ra_gg_",
26
- "__SAddon": "___SAddon_1m0ra_gg_",
27
- "_neighborLocation_right": "_neighborLocation_right_1m0ra_gg_",
28
- "_neighborLocation_both": "_neighborLocation_both_1m0ra_gg_",
29
- "_neighborLocation_left": "_neighborLocation_left_1m0ra_gg_",
30
- "_disabled": "__disabled_1m0ra_gg_",
31
- "_size_m": "_size_m_1m0ra_gg_",
32
- "_size_l": "_size_l_1m0ra_gg_"
20
+ /*!__reshadow-styles__:"./style/pills.shadow.css"*/
21
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPill_1642b_gg_,.___SPills_1642b_gg_{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--intergalactic-control-rounded, 6px)}.___SPills_1642b_gg_{isolation:isolate}.___SPill_1642b_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;-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)}.___SPill_1642b_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_1642b_gg_:active{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPill_1642b_gg_:hover{background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_1642b_gg_.__selected_1642b_gg_{background:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));border-color:var(--intergalactic-border-info-active, #006dca);z-index:2}.___SPill_1642b_gg_:active,.___SPill_1642b_gg_:focus-visible{z-index:1}@media (hover:hover){.___SPill_1642b_gg_:hover{z-index:1}}.___SPill_1642b_gg_.__disabled_1642b_gg_{cursor:default;pointer-events:none}.___SPill_1642b_gg_.__disabled_1642b_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SText_1642b_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_1642b_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_1642b_gg_._size_m_1642b_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_1642b_gg_._size_l_1642b_gg_ .___SText_1642b_gg_,.___SPill_1642b_gg_._size_m_1642b_gg_ .___SText_1642b_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1642b_gg_._size_m_1642b_gg_ .___SAddon_1642b_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_1642b_gg_._size_m_1642b_gg_ .___SAddon_1642b_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1642b_gg_._size_m_1642b_gg_ .___SAddon_1642b_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1642b_gg_._size_l_1642b_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_1642b_gg_._size_l_1642b_gg_ .___SAddon_1642b_gg_:only-child,.___SPill_1642b_gg_._size_l_1642b_gg_ .___SText_1642b_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1642b_gg_._size_l_1642b_gg_ .___SAddon_1642b_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_1642b_gg_._size_l_1642b_gg_ .___SAddon_1642b_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1642b_gg_._neighborLocation_right_1642b_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_1642b_gg_._neighborLocation_both_1642b_gg_{border-radius:0;margin-left:-1px}.___SPill_1642b_gg_._neighborLocation_left_1642b_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}", /*__inner_css_end__*/"1642b_gg_"),
22
+ /*__reshadow_css_end__*/
23
+ {
24
+ "__SPills": "___SPills_1642b_gg_",
25
+ "__SPill": "___SPill_1642b_gg_",
26
+ "_selected": "__selected_1642b_gg_",
27
+ "__SText": "___SText_1642b_gg_",
28
+ "__SAddon": "___SAddon_1642b_gg_",
29
+ "_neighborLocation_right": "_neighborLocation_right_1642b_gg_",
30
+ "_neighborLocation_both": "_neighborLocation_both_1642b_gg_",
31
+ "_neighborLocation_left": "_neighborLocation_left_1642b_gg_",
32
+ "_disabled": "__disabled_1642b_gg_",
33
+ "_size_m": "_size_m_1642b_gg_",
34
+ "_size_l": "_size_l_1642b_gg_"
33
35
  });
34
36
  var optionsA11yEnhance = {
35
37
  onNeighborChange: function onNeighborChange(neighborElement, props) {
@@ -1 +1 @@
1
- {"version":3,"file":"Pills.js","names":["React","createComponent","Component","sstyled","Root","Box","NeighborLocation","useNeighborLocationDetect","addonTextChildren","a11yEnhance","log","style","_sstyled","insert","optionsA11yEnhance","onNeighborChange","neighborElement","props","focus","behavior","click","childSelector","RootPills","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","value","e","handlers","event","key","preventDefault","startIndex","type","selectable","itemValues","element","itemRefs","disabled","undefined","_createClass","componentDidMount","warn","asProps","uncontrolledProps","getItemProps","index","_this$asProps","size","isSelected","selected","tabIndex","onClick","bindHandlerClick","onKeyDown","bindHandleKeyDown","render","_ref","_ref5","SPills","_this$asProps2","Children","styles","controlsLength","createElement","cn","_objectSpread","_assignProps","_ref9","defaultValue","Pill","_ref2","arguments[0]","_ref6","SPill","addonLeft","addonRight","neighborLocation","roleAreaProps","role","_assignProps2","Pills","Item","Addon","tag","Text","_ref3","_ref7","SText","_assignProps3","_ref4","_ref8","SAddon","_assignProps4","wrapPills","wrapper"],"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 addonTextChildren from '@semcore/core/lib/utils/addonTextChildren';\nimport a11yEnhance from '@semcore/core/lib/utils/enhances/a11yEnhance';\nimport log from '@semcore/core/lib/utils/logger';\n\nimport style from './style/pills.shadow.css';\n\nconst optionsA11yEnhance = {\n onNeighborChange: (neighborElement, props) => {\n if (neighborElement) {\n neighborElement.focus();\n if (props.behavior === 'auto' || props.behavior === 'radio') {\n neighborElement.click();\n }\n }\n },\n childSelector: (props) =>\n props.behavior === 'auto' || props.behavior === 'radio' ? ['role', 'radio'] : ['role', 'tab'],\n};\n\nclass RootPills extends Component {\n static displayName = 'Pills';\n static style = style;\n static defaultProps = ({ behavior }) => ({\n size: 'm',\n defaultValue: null,\n behavior: behavior ?? 'auto',\n });\n itemValues = [];\n static enhance = [a11yEnhance(optionsA11yEnhance)];\n\n componentDidMount() {\n log.warn(\n this.asProps.behavior === 'tabs',\n 'Use behavior `manual` instead of `tabs`. \\n`tabs` is deprecated and will be removed in the next major release.',\n 'Pills',\n );\n\n log.warn(\n this.asProps.behavior === 'radio',\n '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.',\n 'Pills',\n );\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 bindHandleKeyDown = (value) => (event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.handlers.value(value, event);\n }\n };\n\n getItemProps(props, index) {\n const { value, size, disabled, behavior } = this.asProps;\n const isSelected = value === props.value;\n\n this.itemValues[index] = props.value;\n return {\n index: index,\n size,\n disabled,\n selected: isSelected,\n behavior,\n tabIndex: isSelected ? 0 : -1,\n onClick: this.bindHandlerClick(props.value),\n onKeyDown: this.bindHandleKeyDown(props.value),\n };\n }\n\n changeIndex = (startIndex, type) => {\n let selectable = false;\n\n while (!selectable && startIndex >= 0 && startIndex < this.itemValues.length) {\n if (type === 'increment') startIndex++;\n if (type === 'decrement') startIndex--;\n\n const element = this.itemRefs[startIndex];\n\n if (element?.disabled === false) {\n selectable = true;\n }\n }\n\n return startIndex >= 0 && startIndex < this.itemValues.length ? startIndex : undefined;\n };\n\n render() {\n const SPills = Root;\n const { Children, styles, controlsLength, disabled, behavior, value } = this.asProps;\n\n return sstyled(styles)(\n <SPills\n render={Box}\n role={behavior === 'radio' || behavior === 'auto' ? 'radiogroup' : 'tablist'}\n aria-disabled={disabled}\n use:tabIndex={value !== null ? -1 : 0}\n >\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, behavior } = props;\n const neighborLocation = useNeighborLocationDetect(index);\n const roleAreaProps = {};\n if (behavior === 'radio' || behavior === 'auto') {\n roleAreaProps.role = 'radio';\n roleAreaProps['aria-checked'] = selected;\n } else {\n roleAreaProps.role = 'tab';\n roleAreaProps['aria-selected'] = selected;\n }\n return sstyled(styles)(\n <SPill\n render={Box}\n tag='button'\n type='button'\n tabIndex={0}\n neighborLocation={neighborLocation}\n aria-disabled={disabled}\n {...roleAreaProps}\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\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 const wrapPills = (wrapper) => wrapper;\n\nexport default Pills;\n"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,GAAG,QAAQ,mBAAmB;AACvC,OAAOC,gBAAgB,IAAIC,yBAAyB,QAAQ,4BAA4B;AACxF,OAAOC,iBAAiB,MAAM,2CAA2C;AACzE,OAAOC,WAAW,MAAM,8CAA8C;AACtE,OAAOC,GAAG,MAAM,gCAAgC;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAIjD,IAAMC,kBAAkB,GAAG;EACzBC,gBAAgB,EAAE,SAAAA,iBAACC,eAAe,EAAEC,KAAK,EAAK;IAC5C,IAAID,eAAe,EAAE;MACnBA,eAAe,CAACE,KAAK,EAAE;MACvB,IAAID,KAAK,CAACE,QAAQ,KAAK,MAAM,IAAIF,KAAK,CAACE,QAAQ,KAAK,OAAO,EAAE;QAC3DH,eAAe,CAAC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AAAd,YAAA;IAAAe,KAAA;EACnB,IAAMC,KAAK,GACiCjG,GAAG;EAA/C,OAAAgG,KAAA,GAAOlG,OAAO,CAACc,KAAK,CAAC2D,MAAM,CAAC,eAAC5E,KAAA,CAAA8E,aAAA,CAACwB,KAAK,EAAAD,KAAA,CAAAtB,EAAA,UAAAC,aAAA,KAAAuB,aAAA;IAAA,OAAkB;EAAM,GAAAH,KAAA,IAAG;AAChE;AAEA,SAASH,KAAKA,CAAChF,KAAK,EAAE;EAAA,IAAAuF,KAAA,GAAAlB,YAAA;IAAAmB,KAAA;EACpB,IAAMC,MAAM,GACiCrG,GAAG;EAAhD,OAAAoG,KAAA,GAAOtG,OAAO,CAACc,KAAK,CAAC2D,MAAM,CAAC,eAAC5E,KAAA,CAAA8E,aAAA,CAAC4B,MAAM,EAAAD,KAAA,CAAA1B,EAAA,WAAAC,aAAA,KAAA2B,aAAA;IAAA,OAAkB;EAAM,GAAAH,KAAA,IAAG;AACjE;AAEA,IAAMT,KAAK,GAAG9F,eAAe,CAACqB,SAAS,EAAE;EACvC0E,IAAI,EAAE,CAACZ,IAAI,EAAE;IAAEe,IAAI,EAAJA,IAAI;IAAEF,KAAK,EAALA;EAAM,CAAC;AAC9B,CAAC,CAAC;AAEF,OAAO,IAAMW,SAAS,GAAG,SAAZA,SAASA,CAAIC,OAAO;EAAA,OAAKA,OAAO;AAAA;AAE7C,eAAed,KAAK"}
1
+ {"version":3,"file":"Pills.js","names":["React","createComponent","Component","sstyled","Root","Box","NeighborLocation","useNeighborLocationDetect","addonTextChildren","a11yEnhance","log","style","_sstyled","insert","optionsA11yEnhance","onNeighborChange","neighborElement","props","focus","behavior","click","childSelector","RootPills","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","value","e","handlers","event","key","preventDefault","startIndex","type","selectable","itemValues","element","itemRefs","disabled","undefined","_createClass","componentDidMount","warn","asProps","uncontrolledProps","getItemProps","index","_this$asProps","size","isSelected","selected","tabIndex","onClick","bindHandlerClick","onKeyDown","bindHandleKeyDown","render","_ref","_ref5","SPills","_this$asProps2","Children","styles","controlsLength","createElement","cn","_objectSpread","_assignProps","_ref9","defaultValue","Pill","_ref2","arguments[0]","_ref6","SPill","addonLeft","addonRight","neighborLocation","roleAreaProps","role","_assignProps2","Pills","Item","Addon","tag","Text","_ref3","_ref7","SText","_assignProps3","_ref4","_ref8","SAddon","_assignProps4","wrapPills","wrapper"],"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 addonTextChildren from '@semcore/core/lib/utils/addonTextChildren';\nimport a11yEnhance from '@semcore/core/lib/utils/enhances/a11yEnhance';\nimport log from '@semcore/core/lib/utils/logger';\n\nimport style from './style/pills.shadow.css';\n\nconst optionsA11yEnhance = {\n onNeighborChange: (neighborElement, props) => {\n if (neighborElement) {\n neighborElement.focus();\n if (props.behavior === 'auto' || props.behavior === 'radio') {\n neighborElement.click();\n }\n }\n },\n childSelector: (props) =>\n props.behavior === 'auto' || props.behavior === 'radio' ? ['role', 'radio'] : ['role', 'tab'],\n};\n\nclass RootPills extends Component {\n static displayName = 'Pills';\n static style = style;\n static defaultProps = ({ behavior }) => ({\n size: 'm',\n defaultValue: null,\n behavior: behavior ?? 'auto',\n });\n itemValues = [];\n static enhance = [a11yEnhance(optionsA11yEnhance)];\n\n componentDidMount() {\n log.warn(\n this.asProps.behavior === 'tabs',\n 'Use behavior `manual` instead of `tabs`. \\n`tabs` is deprecated and will be removed in the next major release.',\n 'Pills',\n );\n\n log.warn(\n this.asProps.behavior === 'radio',\n '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.',\n 'Pills',\n );\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 bindHandleKeyDown = (value) => (event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.handlers.value(value, event);\n }\n };\n\n getItemProps(props, index) {\n const { value, size, disabled, behavior } = this.asProps;\n const isSelected = value === props.value;\n\n this.itemValues[index] = props.value;\n return {\n index: index,\n size,\n disabled,\n selected: isSelected,\n behavior,\n tabIndex: isSelected ? 0 : -1,\n onClick: this.bindHandlerClick(props.value),\n onKeyDown: this.bindHandleKeyDown(props.value),\n };\n }\n\n changeIndex = (startIndex, type) => {\n let selectable = false;\n\n while (!selectable && startIndex >= 0 && startIndex < this.itemValues.length) {\n if (type === 'increment') startIndex++;\n if (type === 'decrement') startIndex--;\n\n const element = this.itemRefs[startIndex];\n\n if (element?.disabled === false) {\n selectable = true;\n }\n }\n\n return startIndex >= 0 && startIndex < this.itemValues.length ? startIndex : undefined;\n };\n\n render() {\n const SPills = Root;\n const { Children, styles, controlsLength, disabled, behavior, value } = this.asProps;\n\n return sstyled(styles)(\n <SPills\n render={Box}\n role={behavior === 'radio' || behavior === 'auto' ? 'radiogroup' : 'tablist'}\n aria-disabled={disabled}\n use:tabIndex={value !== null ? -1 : 0}\n >\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, behavior } = props;\n const neighborLocation = useNeighborLocationDetect(index);\n const roleAreaProps = {};\n if (behavior === 'radio' || behavior === 'auto') {\n roleAreaProps.role = 'radio';\n roleAreaProps['aria-checked'] = selected;\n } else {\n roleAreaProps.role = 'tab';\n roleAreaProps['aria-selected'] = selected;\n }\n return sstyled(styles)(\n <SPill\n render={Box}\n tag='button'\n type='button'\n tabIndex={0}\n neighborLocation={neighborLocation}\n aria-disabled={disabled}\n {...roleAreaProps}\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\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 const wrapPills = (wrapper) => wrapper;\n\nexport default Pills;\n"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,GAAG,QAAQ,mBAAmB;AACvC,OAAOC,gBAAgB,IAAIC,yBAAyB,QAAQ,4BAA4B;AACxF,OAAOC,iBAAiB,MAAM,2CAA2C;AACzE,OAAOC,WAAW,MAAM,8CAA8C;AACtE,OAAOC,GAAG,MAAM,gCAAgC;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAIjD,IAAMC,kBAAkB,GAAG;EACzBC,gBAAgB,EAAE,SAAAA,iBAACC,eAAe,EAAEC,KAAK,EAAK;IAC5C,IAAID,eAAe,EAAE;MACnBA,eAAe,CAACE,KAAK,EAAE;MACvB,IAAID,KAAK,CAACE,QAAQ,KAAK,MAAM,IAAIF,KAAK,CAACE,QAAQ,KAAK,OAAO,EAAE;QAC3DH,eAAe,CAACI,KAAK,EAAE;MACzB;IACF;EACF,CAAC;EACDC,aAAa,EAAE,SAAAA,cAACJ,KAAK;IAAA,OACnBA,KAAK,CAACE,QAAQ,KAAK,MAAM,IAAIF,KAAK,CAACE,QAAQ,KAAK,OAAO,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,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AA,UAAAC,aAAA,KAAAuB,aAAA;IAAA,OAAkB;EAAM,GAAAH,KAAA,IAAG;AAChE;AAEA,SAASH,KAAKA,CAAChF,KAAK,EAAE;EAAA,IAAAuF,KAAA,GAAAlB,YAAA;IAAAmB,KAAA;EACpB,IAAMC,MAAM,GACiCrG,GAAG;EAAhD,OAAAoG,KAAA,GAAOtG,OAAO,CAACc,KAAK,CAAC2D,MAAM,CAAC,eAAC5E,KAAA,CAAA8E,aAAA,CAAC4B,MAAM,EAAAD,KAAA,CAAA1B,EAAA,WAAAC,aAAA,KAAA2B,aAAA;IAAA,OAAkB;EAAM,GAAAH,KAAA,IAAG;AACjE;AAEA,IAAMT,KAAK,GAAG9F,eAAe,CAACqB,SAAS,EAAE;EACvC0E,IAAI,EAAE,CAACZ,IAAI,EAAE;IAAEe,IAAI,EAAJA,IAAI;IAAEF,KAAK,EAALA;EAAM,CAAC;AAC9B,CAAC,CAAC;AAEF,OAAO,IAAMW,SAAS,GAAG,SAAZA,SAASA,CAAIC,OAAO;EAAA,OAAKA,OAAO;AAAA;AAE7C,eAAed,KAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { NeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';\nimport { KeyboardFocusProps } from '@semcore/core/lib/utils/enhances/keyboardFocusEnhance';\n\nexport type PillsValue = string | number | boolean | null;\n\n/** @deprecated */\nexport interface IPillsProps<T extends PillsValue = PillsValue>\n extends PillsProps<T>,\n UnknownProperties {}\nexport type PillsProps<T extends PillsValue = PillsValue> = NeighborLocationProps &\n KeyboardFocusProps &\n BoxProps & {\n /** Pills size */\n size?: 'l' | 'm';\n /** Disabled state */\n disabled?: boolean;\n /** Called when the selection is changed */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLSpanElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Value for the selected pill */\n value?: T;\n /** Default value for the selected pill */\n defaultValue?: T;\n /** Sets semantic role for corresponding behavior,\n * when set to `auto` pressing left and right arrows\n * selects corresponding sibling pill.\n *\n * It's recommended to use `auto` behavior in forms\n * while `manual` behavior for navigation and layout.\n * @default tabs\n */\n behavior?: /** @deprecated use `manual` */\n | 'tabs'\n /** @deprecated use `auto` */\n | 'radio'\n | 'auto'\n | 'manual';\n };\n\n/** @deprecated */\nexport interface IPillProps extends PillProps, UnknownProperties {}\nexport type PillProps = BoxProps &\n NeighborItemProps &\n KeyboardFocusProps & {\n /** Pill value */\n value?: PillsValue;\n /** Disabled state */\n disabled?: boolean;\n /** Selected state */\n selected?: boolean;\n /** Left addon text */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n };\n\n/** @deprecated */\nexport interface IPillsContext extends PillsContext, UnknownProperties {}\nexport type PillsContext = {\n getItemProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IPillsHandlers extends PillsHandlers, UnknownProperties {}\nexport type PillsHandlers = {\n value: (value: PillsValue) => void;\n};\n\ntype IntergalacticPillsComponent<PropsExtending = {}> = (<\n Value extends PillsValue,\n Tag extends Intergalactic.Tag = 'div',\n>(\n props: Intergalactic.InternalTypings.ComponentProps<\n Tag,\n 'div',\n PillsProps<Value>,\n PillsContext,\n [handlers: PillsHandlers]\n > &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', PillsProps>;\n\ndeclare const Pills: IntergalacticPillsComponent & {\n Item: Intergalactic.Component<'button', PillProps, [handlers: PillsHandlers]> & {\n Text: typeof Box;\n Addon: typeof Box;\n };\n};\n\ndeclare const wrapPills: <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticPillsComponent>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => IntergalacticPillsComponent<PropsExtending>;\nexport { wrapPills };\n\nexport default Pills;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { NeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';\n\nexport type PillsValue = string | number | boolean | null;\n\n/** @deprecated */\nexport interface IPillsProps<T extends PillsValue = PillsValue>\n extends PillsProps<T>,\n UnknownProperties {}\nexport type PillsProps<T extends PillsValue = PillsValue> = NeighborLocationProps &\n BoxProps & {\n /** Pills size */\n size?: 'l' | 'm';\n /** Disabled state */\n disabled?: boolean;\n /** Called when the selection is changed */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLSpanElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Value for the selected pill */\n value?: T;\n /** Default value for the selected pill */\n defaultValue?: T;\n /** Sets semantic role for corresponding behavior,\n * when set to `auto` pressing left and right arrows\n * selects corresponding sibling pill.\n *\n * It's recommended to use `auto` behavior in forms\n * while `manual` behavior for navigation and layout.\n * @default tabs\n */\n behavior?: /** @deprecated use `manual` */\n | 'tabs'\n /** @deprecated use `auto` */\n | 'radio'\n | 'auto'\n | 'manual';\n };\n\n/** @deprecated */\nexport interface IPillProps extends PillProps, UnknownProperties {}\nexport type PillProps = BoxProps &\n NeighborItemProps & {\n /** Pill value */\n value?: PillsValue;\n /** Disabled state */\n disabled?: boolean;\n /** Selected state */\n selected?: boolean;\n /** Left addon text */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n };\n\n/** @deprecated */\nexport interface IPillsContext extends PillsContext, UnknownProperties {}\nexport type PillsContext = {\n getItemProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IPillsHandlers extends PillsHandlers, UnknownProperties {}\nexport type PillsHandlers = {\n value: (value: PillsValue) => void;\n};\n\ntype IntergalacticPillsComponent<PropsExtending = {}> = (<\n Value extends PillsValue,\n Tag extends Intergalactic.Tag = 'div',\n>(\n props: Intergalactic.InternalTypings.ComponentProps<\n Tag,\n 'div',\n PillsProps<Value>,\n PillsContext,\n [handlers: PillsHandlers]\n > &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', PillsProps>;\n\ndeclare const Pills: IntergalacticPillsComponent & {\n Item: Intergalactic.Component<'button', PillProps, [handlers: PillsHandlers]> & {\n Text: typeof Box;\n Addon: typeof Box;\n };\n};\n\ndeclare const wrapPills: <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticPillsComponent>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => IntergalacticPillsComponent<PropsExtending>;\nexport { wrapPills };\n\nexport default Pills;\n"],"mappings":""}
@@ -35,8 +35,7 @@ SPill {
35
35
  padding: 0;
36
36
  }
37
37
 
38
- &:active,
39
- &:hover {
38
+ &:active {
40
39
  outline: 0;
41
40
  text-decoration: none;
42
41
  }
@@ -49,6 +48,7 @@ SPill {
49
48
  SPill[selected] {
50
49
  background: var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));
51
50
  border-color: var(--intergalactic-border-info-active, #006dca);
51
+ z-index: 2;
52
52
  }
53
53
  SPill:focus-visible, SPill:hover, SPill:active {
54
54
  z-index: 1;
package/lib/esm/Pills.mjs CHANGED
@@ -12,24 +12,27 @@ import NeighborLocation, { useNeighborLocationDetect } from "@semcore/neighbor-l
12
12
  import addonTextChildren from "@semcore/core/lib/utils/addonTextChildren";
13
13
  import a11yEnhance from "@semcore/core/lib/utils/enhances/a11yEnhance";
14
14
  import log from "@semcore/core/lib/utils/logger";
15
+ /*!__reshadow-styles__:"./style/pills.shadow.css"*/
15
16
  var style = (
16
17
  /*__reshadow_css_start__*/
17
18
  (sstyled.insert(
18
19
  /*__inner_css_start__*/
19
- ".___SPill_1m0ra_gg_,.___SPills_1m0ra_gg_{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--intergalactic-control-rounded, 6px)}.___SPills_1m0ra_gg_{isolation:isolate}.___SPill_1m0ra_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;-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)}.___SPill_1m0ra_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_1m0ra_gg_:active{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPill_1m0ra_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none;background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_1m0ra_gg_.__selected_1m0ra_gg_{background:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));border-color:var(--intergalactic-border-info-active, #006dca)}.___SPill_1m0ra_gg_:active,.___SPill_1m0ra_gg_:focus-visible{z-index:1}@media (hover:hover){.___SPill_1m0ra_gg_:hover{z-index:1}}.___SPill_1m0ra_gg_.__disabled_1m0ra_gg_{cursor:default;pointer-events:none}.___SPill_1m0ra_gg_.__disabled_1m0ra_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SText_1m0ra_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_1m0ra_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_1m0ra_gg_._size_m_1m0ra_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SText_1m0ra_gg_,.___SPill_1m0ra_gg_._size_m_1m0ra_gg_ .___SText_1m0ra_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1m0ra_gg_._size_m_1m0ra_gg_ .___SAddon_1m0ra_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_1m0ra_gg_._size_m_1m0ra_gg_ .___SAddon_1m0ra_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1m0ra_gg_._size_m_1m0ra_gg_ .___SAddon_1m0ra_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SAddon_1m0ra_gg_:only-child,.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SText_1m0ra_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SAddon_1m0ra_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_1m0ra_gg_._size_l_1m0ra_gg_ .___SAddon_1m0ra_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1m0ra_gg_._neighborLocation_right_1m0ra_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_1m0ra_gg_._neighborLocation_both_1m0ra_gg_{border-radius:0;margin-left:-1px}.___SPill_1m0ra_gg_._neighborLocation_left_1m0ra_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}",
20
- "1m0ra_gg_"
21
- ), {
22
- "__SPills": "___SPills_1m0ra_gg_",
23
- "__SPill": "___SPill_1m0ra_gg_",
24
- "_selected": "__selected_1m0ra_gg_",
25
- "__SText": "___SText_1m0ra_gg_",
26
- "__SAddon": "___SAddon_1m0ra_gg_",
27
- "_neighborLocation_right": "_neighborLocation_right_1m0ra_gg_",
28
- "_neighborLocation_both": "_neighborLocation_both_1m0ra_gg_",
29
- "_neighborLocation_left": "_neighborLocation_left_1m0ra_gg_",
30
- "_disabled": "__disabled_1m0ra_gg_",
31
- "_size_m": "_size_m_1m0ra_gg_",
32
- "_size_l": "_size_l_1m0ra_gg_"
20
+ ".___SPill_1642b_gg_,.___SPills_1642b_gg_{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--intergalactic-control-rounded, 6px)}.___SPills_1642b_gg_{isolation:isolate}.___SPill_1642b_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;-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)}.___SPill_1642b_gg_::-moz-focus-inner{border:0;padding:0}.___SPill_1642b_gg_:active{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPill_1642b_gg_:hover{background:var(--intergalactic-bg-primary-neutral-hover, #f4f5f9)}}.___SPill_1642b_gg_.__selected_1642b_gg_{background:var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));border-color:var(--intergalactic-border-info-active, #006dca);z-index:2}.___SPill_1642b_gg_:active,.___SPill_1642b_gg_:focus-visible{z-index:1}@media (hover:hover){.___SPill_1642b_gg_:hover{z-index:1}}.___SPill_1642b_gg_.__disabled_1642b_gg_{cursor:default;pointer-events:none}.___SPill_1642b_gg_.__disabled_1642b_gg_>*{opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SText_1642b_gg_{color:var(--intergalactic-text-primary, #191b23);display:inline-flex}.___SAddon_1642b_gg_{color:var(--intergalactic-text-secondary, #6c6e79);display:inline-flex;align-items:center;justify-content:center}.___SPill_1642b_gg_._size_m_1642b_gg_{height:var(--intergalactic-form-control-m, 28px);min-width:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px)}.___SPill_1642b_gg_._size_l_1642b_gg_ .___SText_1642b_gg_,.___SPill_1642b_gg_._size_m_1642b_gg_ .___SText_1642b_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1642b_gg_._size_m_1642b_gg_ .___SAddon_1642b_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPill_1642b_gg_._size_m_1642b_gg_ .___SAddon_1642b_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1642b_gg_._size_m_1642b_gg_ .___SAddon_1642b_gg_:only-child{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SPill_1642b_gg_._size_l_1642b_gg_{height:var(--intergalactic-form-control-l, 40px);min-width:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px)}.___SPill_1642b_gg_._size_l_1642b_gg_ .___SAddon_1642b_gg_:only-child,.___SPill_1642b_gg_._size_l_1642b_gg_ .___SText_1642b_gg_:only-child{margin-left:var(--intergalactic-spacing-3x, 12px);margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1642b_gg_._size_l_1642b_gg_ .___SAddon_1642b_gg_:not(:only-child):first-child{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SPill_1642b_gg_._size_l_1642b_gg_ .___SAddon_1642b_gg_:not(:only-child):last-child{margin-right:var(--intergalactic-spacing-3x, 12px)}.___SPill_1642b_gg_._neighborLocation_right_1642b_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SPill_1642b_gg_._neighborLocation_both_1642b_gg_{border-radius:0;margin-left:-1px}.___SPill_1642b_gg_._neighborLocation_left_1642b_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}",
21
+ /*__inner_css_end__*/
22
+ "1642b_gg_"
23
+ ), /*__reshadow_css_end__*/
24
+ {
25
+ "__SPills": "___SPills_1642b_gg_",
26
+ "__SPill": "___SPill_1642b_gg_",
27
+ "_selected": "__selected_1642b_gg_",
28
+ "__SText": "___SText_1642b_gg_",
29
+ "__SAddon": "___SAddon_1642b_gg_",
30
+ "_neighborLocation_right": "_neighborLocation_right_1642b_gg_",
31
+ "_neighborLocation_both": "_neighborLocation_both_1642b_gg_",
32
+ "_neighborLocation_left": "_neighborLocation_left_1642b_gg_",
33
+ "_disabled": "__disabled_1642b_gg_",
34
+ "_size_m": "_size_m_1642b_gg_",
35
+ "_size_l": "_size_l_1642b_gg_"
33
36
  })
34
37
  );
35
38
  var optionsA11yEnhance = {
@@ -0,0 +1,152 @@
1
+ SPills {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ isolation: isolate;
6
+ border-radius: var(--intergalactic-control-rounded, 6px);
7
+ }
8
+
9
+ SPill {
10
+ display: inline-flex;
11
+ align-items: center;
12
+ justify-content: center;
13
+ line-height: normal;
14
+ position: relative;
15
+ touch-action: manipulation;
16
+ white-space: nowrap;
17
+ user-select: none;
18
+ box-sizing: border-box;
19
+ padding: 0;
20
+ margin: 0;
21
+ box-shadow: none;
22
+ text-decoration: none;
23
+ -webkit-tap-highlight-color: transparent;
24
+ overflow: visible;
25
+ text-align: center;
26
+ vertical-align: middle;
27
+ font-family: inherit;
28
+ cursor: pointer;
29
+ background: var(--intergalactic-bg-primary-neutral, #ffffff);
30
+ border: 1px solid var(--intergalactic-border-primary, #c4c7cf);
31
+ border-radius: var(--intergalactic-control-rounded, 6px);
32
+
33
+ &::-moz-focus-inner {
34
+ border: none;
35
+ padding: 0;
36
+ }
37
+
38
+ &:active {
39
+ outline: 0;
40
+ text-decoration: none;
41
+ }
42
+
43
+ &:hover {
44
+ background: var(--intergalactic-bg-primary-neutral-hover, #f4f5f9);
45
+ }
46
+ }
47
+
48
+ SPill[selected] {
49
+ background: var(--intergalactic-control-secondary-info, rgba(0, 143, 248, 0.1));
50
+ border-color: var(--intergalactic-border-info-active, #006dca);
51
+ z-index: 2;
52
+ }
53
+ SPill:focus-visible, SPill:hover, SPill:active {
54
+ z-index: 1;
55
+ }
56
+
57
+ SPill[disabled] {
58
+ cursor: default;
59
+ /* Disable link interactions */
60
+ pointer-events: none;
61
+
62
+ &>* {
63
+ opacity: var(--intergalactic-disabled-opacity, 0.3);
64
+ }
65
+ }
66
+
67
+ SText {
68
+ color: var(--intergalactic-text-primary, #191b23);
69
+ display: inline-flex;
70
+ }
71
+
72
+ SAddon {
73
+ color: var(--intergalactic-text-secondary, #6c6e79);
74
+ display: inline-flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ }
78
+
79
+ SPill[size='m'] {
80
+ height: var(--intergalactic-form-control-m, 28px);
81
+ min-width: var(--intergalactic-form-control-m, 28px);
82
+ font-size: var(--intergalactic-fs-200, 14px);
83
+
84
+ & SText {
85
+ margin-left: var(--intergalactic-spacing-2x, 8px);
86
+ margin-right: var(--intergalactic-spacing-2x, 8px);
87
+ }
88
+
89
+ & SAddon {
90
+ &:not(:only-child):first-child {
91
+ margin-left: var(--intergalactic-spacing-2x, 8px);
92
+ }
93
+
94
+ &:not(:only-child):last-child {
95
+ margin-right: var(--intergalactic-spacing-2x, 8px);
96
+ }
97
+
98
+ &:only-child {
99
+ margin-left: var(--intergalactic-spacing-2x, 8px);
100
+ margin-right: var(--intergalactic-spacing-2x, 8px);
101
+ }
102
+ }
103
+ }
104
+
105
+ SPill[size='l'] {
106
+ height: var(--intergalactic-form-control-l, 40px);
107
+ min-width: var(--intergalactic-form-control-l, 40px);
108
+ font-size: var(--intergalactic-fs-300, 16px);
109
+
110
+ & SText {
111
+ margin-left: var(--intergalactic-spacing-2x, 8px);
112
+ margin-right: var(--intergalactic-spacing-2x, 8px);
113
+
114
+ &:only-child {
115
+ margin-left: var(--intergalactic-spacing-3x, 12px);
116
+ margin-right: var(--intergalactic-spacing-3x, 12px);
117
+ }
118
+ }
119
+
120
+ & SAddon {
121
+ &:not(:only-child):first-child {
122
+ margin-left: var(--intergalactic-spacing-3x, 12px);
123
+ }
124
+
125
+ &:not(:only-child):last-child {
126
+ margin-right: var(--intergalactic-spacing-3x, 12px);
127
+ }
128
+
129
+ &:only-child {
130
+ margin-left: var(--intergalactic-spacing-3x, 12px);
131
+ margin-right: var(--intergalactic-spacing-3x, 12px);
132
+ }
133
+ }
134
+ }
135
+
136
+ SPill[neighborLocation='right'] {
137
+ border-top-right-radius: 0;
138
+ border-bottom-right-radius: 0;
139
+ }
140
+
141
+ SPill[neighborLocation='both'] {
142
+ border-radius: 0;
143
+ /* disable-tokens-validator */
144
+ margin-left: -1px;
145
+ }
146
+
147
+ SPill[neighborLocation='left'] {
148
+ border-top-left-radius: 0;
149
+ border-bottom-left-radius: 0;
150
+ /* disable-tokens-validator */
151
+ margin-left: -1px;
152
+ }
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';
3
3
  import { Box, BoxProps } from '@semcore/flex-box';
4
4
  import { NeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';
5
- import { KeyboardFocusProps } from '@semcore/core/lib/utils/enhances/keyboardFocusEnhance';
6
5
 
7
6
  export type PillsValue = string | number | boolean | null;
8
7
 
@@ -11,7 +10,6 @@ export interface IPillsProps<T extends PillsValue = PillsValue>
11
10
  extends PillsProps<T>,
12
11
  UnknownProperties {}
13
12
  export type PillsProps<T extends PillsValue = PillsValue> = NeighborLocationProps &
14
- KeyboardFocusProps &
15
13
  BoxProps & {
16
14
  /** Pills size */
17
15
  size?: 'l' | 'm';
@@ -44,8 +42,7 @@ export type PillsProps<T extends PillsValue = PillsValue> = NeighborLocationProp
44
42
  /** @deprecated */
45
43
  export interface IPillProps extends PillProps, UnknownProperties {}
46
44
  export type PillProps = BoxProps &
47
- NeighborItemProps &
48
- KeyboardFocusProps & {
45
+ NeighborItemProps & {
49
46
  /** Pill value */
50
47
  value?: PillsValue;
51
48
  /** Disabled state */
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.0-prerelease.19",
4
+ "version": "16.0.0-prerelease.20",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,11 +14,11 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/flex-box": "16.0.0-prerelease.19",
18
- "@semcore/neighbor-location": "16.0.0-prerelease.19"
17
+ "@semcore/flex-box": "16.0.0-prerelease.20",
18
+ "@semcore/neighbor-location": "16.0.0-prerelease.20"
19
19
  },
20
20
  "peerDependencies": {
21
- "@semcore/base-components": "^16.0.0-prerelease.19"
21
+ "@semcore/base-components": "^16.0.0-prerelease.20"
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",