@semcore/tab-line 3.3.25 → 4.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [3.3.25] - 2023-06-30
5
+ ## [4.0.0] - 2023-07-15
6
6
 
7
- ### Changed
7
+ ### Break
8
8
 
9
- - Version patch update due to children dependencies update (`@semcore/flex-box` [4.7.32 ~> 4.7.33], `@semcore/neighbor-location` [3.1.38 ~> 3.1.39], `@semcore/utils` [3.54.0 ~> 3.54.1]).
9
+ - Strict, backward incompatible typings.
10
10
 
11
11
  ## [3.3.24] - 2023-06-27
12
12
 
@@ -21,19 +21,19 @@ var _keyboardFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/e
21
21
  var _a11yEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/a11yEnhance"));
22
22
  var _neighborLocation = _interopRequireDefault(require("@semcore/neighbor-location"));
23
23
  /*__reshadow-styles__:"./style/tab-line.shadow.css"*/
24
- var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___STabLine_o0440_gg_{position:relative;display:flex;width:100%;max-width:100%}.___STabLine_o0440_gg_.__underlined_o0440_gg_{border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___STabLineItem_o0440_gg_{display:inline-flex;align-items:center;justify-content:center;position:relative;touch-action:manipulation;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0;box-shadow:none;text-decoration:none;-webkit-tap-highlight-color:transparent;overflow:visible;outline:0;text-align:center;vertical-align:middle;font-family:inherit;cursor:pointer;border:0;background:0 0;color:var(--intergalactic-text-primary, #191b23);margin-right:var(--intergalactic-spacing-4x, 16px);font-weight:var(--intergalactic-medium, 500)}.___STabLineItem_o0440_gg_::-moz-focus-inner{border:0;padding:0}.___STabLineItem_o0440_gg_:active,.___STabLineItem_o0440_gg_:focus{outline:0;text-decoration:none}@media (hover:hover){.___STabLineItem_o0440_gg_:hover{outline:0;text-decoration:none}}.___STabLineItem_o0440_gg_::after,.___STabLineItem_o0440_gg_::before{content:\"\";position:absolute;left:0;bottom:-1px;height:3px;width:100%;background-color:transparent}.___STabLineItem_o0440_gg_::before{transition:background-color calc(var(--intergalactic-duration-control, 200)*1ms) ease-in-out}@media (hover:hover){.___STabLineItem_o0440_gg_:hover::before{background-color:var(--intergalactic-border-primary, #c4c7cf)}}.___STabLineItem_o0440_gg_.__selected_o0440_gg_::after{transition-delay:calc(var(--intergalactic-duration-control, 200)*1ms);background-color:var(--intergalactic-border-info-active, #006dca)}.___STabLineItem_o0440_gg_ .___SAddon_o0440_gg_:not(:last-child),.___STabLineItem_o0440_gg_ .___SText_o0440_gg_:not(:last-child){margin-right:var(--intergalactic-spacing-2x, 8px)}.___SCaret_o0440_gg_{position:absolute;bottom:-1px;height:3px;background-color:var(--intergalactic-border-info-active, #006dca);transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___STabLineItem_o0440_gg_.__selected_o0440_gg_{flex-shrink:0}.___STabLineItem_o0440_gg_.__disabled_o0440_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___STabLineItem_o0440_gg_.__keyboardFocused_o0440_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SText_o0440_gg_{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SAddon_o0440_gg_{display:inline-flex;align-items:center;justify-content:center}.___STabLineItem_o0440_gg_._size_m_o0440_gg_{height:28px;min-width:18px}.___STabLineItem_o0440_gg_._size_m_o0440_gg_ .___SText_o0440_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___STabLineItem_o0440_gg_._size_l_o0440_gg_{height:40px;min-width:26px}.___STabLineItem_o0440_gg_._size_l_o0440_gg_ .___SText_o0440_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___STabLineItem_o0440_gg_._neighborLocation_left_o0440_gg_{margin-right:0}@media (prefers-reduced-motion){.___STabLineItem_o0440_gg_.__selected_o0440_gg_::after,.___STabLineItem_o0440_gg_::after,.___STabLineItem_o0440_gg_::before{transition:none}.___SCaret_o0440_gg_{display:none}}" /*__inner_css_end__*/, "o0440_gg_") /*__reshadow_css_end__*/, {
25
- "__STabLine": "___STabLine_o0440_gg_",
26
- "_underlined": "__underlined_o0440_gg_",
27
- "__STabLineItem": "___STabLineItem_o0440_gg_",
28
- "_selected": "__selected_o0440_gg_",
29
- "__SText": "___SText_o0440_gg_",
30
- "__SAddon": "___SAddon_o0440_gg_",
31
- "__SCaret": "___SCaret_o0440_gg_",
32
- "_disabled": "__disabled_o0440_gg_",
33
- "_keyboardFocused": "__keyboardFocused_o0440_gg_",
34
- "_size_m": "_size_m_o0440_gg_",
35
- "_size_l": "_size_l_o0440_gg_",
36
- "_neighborLocation_left": "_neighborLocation_left_o0440_gg_"
24
+ var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___STabLine_13zof_gg_{position:relative;display:flex;width:100%;max-width:100%}.___STabLine_13zof_gg_.__underlined_13zof_gg_{border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___STabLineItem_13zof_gg_{display:inline-flex;align-items:center;justify-content:center;position:relative;touch-action:manipulation;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0;box-shadow:none;text-decoration:none;-webkit-tap-highlight-color:transparent;overflow:visible;outline:0;text-align:center;vertical-align:middle;font-family:inherit;cursor:pointer;border:0;background:0 0;color:var(--intergalactic-text-primary, #191b23);margin-right:var(--intergalactic-spacing-4x, 16px);font-weight:var(--intergalactic-medium, 500)}.___STabLineItem_13zof_gg_::-moz-focus-inner{border:0;padding:0}.___STabLineItem_13zof_gg_:active,.___STabLineItem_13zof_gg_:focus{outline:0;text-decoration:none}@media (hover:hover){.___STabLineItem_13zof_gg_:hover{outline:0;text-decoration:none}}.___STabLineItem_13zof_gg_::after,.___STabLineItem_13zof_gg_::before{content:\"\";position:absolute;left:0;bottom:-1px;height:3px;width:100%;background-color:transparent}.___STabLineItem_13zof_gg_::before{transition:background-color calc(var(--intergalactic-duration-control, 200)*1ms) ease-in-out}@media (hover:hover){.___STabLineItem_13zof_gg_:hover::before{background-color:var(--intergalactic-border-primary, #c4c7cf)}}.___STabLineItem_13zof_gg_.__selected_13zof_gg_::after{transition-delay:calc(var(--intergalactic-duration-control, 200)*1ms);background-color:var(--intergalactic-border-info-active, #006dca)}.___STabLineItem_13zof_gg_ .___SAddon_13zof_gg_:not(:last-child),.___STabLineItem_13zof_gg_ .___SText_13zof_gg_:not(:last-child){margin-right:var(--intergalactic-spacing-2x, 8px)}.___SCaret_13zof_gg_{position:absolute;bottom:-1px;height:3px;background-color:var(--intergalactic-border-info-active, #006dca);transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___STabLineItem_13zof_gg_.__selected_13zof_gg_{flex-shrink:0}.___STabLineItem_13zof_gg_.__disabled_13zof_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___STabLineItem_13zof_gg_.__keyboardFocused_13zof_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SText_13zof_gg_{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SAddon_13zof_gg_{display:inline-flex;align-items:center;justify-content:center}.___STabLineItem_13zof_gg_._size_m_13zof_gg_{height:28px;min-width:18px}.___STabLineItem_13zof_gg_._size_m_13zof_gg_ .___SText_13zof_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___STabLineItem_13zof_gg_._size_l_13zof_gg_{height:40px;min-width:26px}.___STabLineItem_13zof_gg_._size_l_13zof_gg_ .___SText_13zof_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___STabLineItem_13zof_gg_._neighborLocation_left_13zof_gg_{margin-right:0}@media (prefers-reduced-motion){.___STabLineItem_13zof_gg_.__selected_13zof_gg_::after,.___STabLineItem_13zof_gg_::after,.___STabLineItem_13zof_gg_::before{transition:none}.___SCaret_13zof_gg_{display:none}}" /*__inner_css_end__*/, "13zof_gg_") /*__reshadow_css_end__*/, {
25
+ "__STabLine": "___STabLine_13zof_gg_",
26
+ "_underlined": "__underlined_13zof_gg_",
27
+ "__STabLineItem": "___STabLineItem_13zof_gg_",
28
+ "_selected": "__selected_13zof_gg_",
29
+ "__SText": "___SText_13zof_gg_",
30
+ "__SAddon": "___SAddon_13zof_gg_",
31
+ "__SCaret": "___SCaret_13zof_gg_",
32
+ "_disabled": "__disabled_13zof_gg_",
33
+ "_keyboardFocused": "__keyboardFocused_13zof_gg_",
34
+ "_size_m": "_size_m_13zof_gg_",
35
+ "_size_l": "_size_l_13zof_gg_",
36
+ "_neighborLocation_left": "_neighborLocation_left_13zof_gg_"
37
37
  });
38
38
  var optionsA11yEnhance = {
39
39
  onNeighborChange: function onNeighborChange(neighborElement) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport { Box, IBoxProps } from '@semcore/flex-box';\nimport { INeighborItemProps, INeighborLocationProps } from '@semcore/neighbor-location';\nimport { IKeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nexport type TabLineValue = string | number | boolean;\n\nexport interface ITabLineProps<T extends TabLineValue = TabLineValue>\n extends IBoxProps,\n INeighborLocationProps {\n /** TabLine size\n * @default m\n * */\n size?: 'm' | 'l' | false;\n /** Adds a bottom border for the entire component\n * @default true\n * */\n underlined?: boolean;\n /** Is invoked when changing the selection */\n onChange?: (value: T, e?: React.SyntheticEvent<HTMLButtonElement>) => void;\n /** Value of the selected tab */\n value?: T;\n /** Default value of the selected tab\n * @default null\n * */\n defaultValue?: T;\n}\n\nexport interface ITabLineItemProps extends IBoxProps, IKeyboardFocusProps, INeighborItemProps {\n /** Makes a tab selected. This property is determined automatically depending on the value. */\n selected?: boolean;\n /** Disabled state */\n disabled?: boolean;\n /** Tab value */\n value?: TabLineValue;\n /** Left addon tag */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n}\n\nexport interface ITabLineContext {\n getItemProps: PropGetterFn;\n}\n\nexport interface ITabLineHandlers {\n value: (value: TabLineValue) => void;\n}\n\ndeclare const TabLine: (<T, V extends TabLineValue = TabLineValue>(\n props: CProps<ITabLineProps<V> & T, ITabLineContext, ITabLineHandlers>,\n) => ReturnEl) & {\n Item: (<T>(props: CProps<ITabLineItemProps & T, {}, ITabLineHandlers>) => ReturnEl) & {\n Text: typeof Box;\n Addon: typeof Box;\n };\n};\n\nexport default TabLine;\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 { INeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';\nimport { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nexport type TabLineValue = string | number | boolean;\n\n/** @deprecated */\nexport interface ITabLineProps<T extends TabLineValue = TabLineValue>\n extends TabLineProps<T>,\n UnknownProperties {}\nexport type TabLineProps<T extends TabLineValue = TabLineValue> = BoxProps &\n NeighborLocationProps & {\n /** TabLine size\n * @default m\n * */\n size?: 'm' | 'l' | false;\n /** Adds a bottom border for the entire component\n * @default true\n * */\n underlined?: boolean;\n /** Is invoked when changing the selection */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLButtonElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Value of the selected tab */\n value?: T;\n /** Default value of the selected tab\n * @default null\n * */\n defaultValue?: T;\n };\n\n/** @deprecated */\nexport interface ITabLineItemProps extends TabLineItemProps, UnknownProperties {}\nexport type TabLineItemProps = BoxProps &\n KeyboardFocusProps &\n INeighborItemProps & {\n /** Makes a tab selected. This property is determined automatically depending on the value. */\n selected?: boolean;\n /** Disabled state */\n disabled?: boolean;\n /** Tab value */\n value?: TabLineValue;\n /** Left addon tag */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n };\n\n/** @deprecated */\nexport interface ITabLineContext extends TabLineContext, UnknownProperties {}\nexport type TabLineContext = {\n getItemProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface ITabLineHandlers extends TabLineHandlers, UnknownProperties {}\nexport type TabLineHandlers = {\n value: (value: TabLineValue) => void;\n};\n\ntype IntergalacticTabLineComponent = (<\n Value extends TabLineValue,\n Tag extends Intergalactic.Tag = 'div',\n>(\n props: Intergalactic.InternalTypings.ComponentProps<\n Tag,\n TabLineProps<Value>,\n TabLineContext,\n [handlers: TabLineHandlers]\n >,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div'>;\n\ndeclare const TabLine: IntergalacticTabLineComponent & {\n Item: Intergalactic.Component<'div', TabLineItemProps, {}, [handlers: TabLineHandlers]> & {\n Text: typeof Box;\n Addon: typeof Box;\n };\n};\n\nexport default TabLine;\n"],"mappings":""}
@@ -18,19 +18,19 @@ import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhan
18
18
  import a11yEnhance from '@semcore/utils/lib/enhances/a11yEnhance';
19
19
  import NeighborLocation from '@semcore/neighbor-location';
20
20
  /*__reshadow-styles__:"./style/tab-line.shadow.css"*/
21
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___STabLine_o0440_gg_{position:relative;display:flex;width:100%;max-width:100%}.___STabLine_o0440_gg_.__underlined_o0440_gg_{border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___STabLineItem_o0440_gg_{display:inline-flex;align-items:center;justify-content:center;position:relative;touch-action:manipulation;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0;box-shadow:none;text-decoration:none;-webkit-tap-highlight-color:transparent;overflow:visible;outline:0;text-align:center;vertical-align:middle;font-family:inherit;cursor:pointer;border:0;background:0 0;color:var(--intergalactic-text-primary, #191b23);margin-right:var(--intergalactic-spacing-4x, 16px);font-weight:var(--intergalactic-medium, 500)}.___STabLineItem_o0440_gg_::-moz-focus-inner{border:0;padding:0}.___STabLineItem_o0440_gg_:active,.___STabLineItem_o0440_gg_:focus{outline:0;text-decoration:none}@media (hover:hover){.___STabLineItem_o0440_gg_:hover{outline:0;text-decoration:none}}.___STabLineItem_o0440_gg_::after,.___STabLineItem_o0440_gg_::before{content:\"\";position:absolute;left:0;bottom:-1px;height:3px;width:100%;background-color:transparent}.___STabLineItem_o0440_gg_::before{transition:background-color calc(var(--intergalactic-duration-control, 200)*1ms) ease-in-out}@media (hover:hover){.___STabLineItem_o0440_gg_:hover::before{background-color:var(--intergalactic-border-primary, #c4c7cf)}}.___STabLineItem_o0440_gg_.__selected_o0440_gg_::after{transition-delay:calc(var(--intergalactic-duration-control, 200)*1ms);background-color:var(--intergalactic-border-info-active, #006dca)}.___STabLineItem_o0440_gg_ .___SAddon_o0440_gg_:not(:last-child),.___STabLineItem_o0440_gg_ .___SText_o0440_gg_:not(:last-child){margin-right:var(--intergalactic-spacing-2x, 8px)}.___SCaret_o0440_gg_{position:absolute;bottom:-1px;height:3px;background-color:var(--intergalactic-border-info-active, #006dca);transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___STabLineItem_o0440_gg_.__selected_o0440_gg_{flex-shrink:0}.___STabLineItem_o0440_gg_.__disabled_o0440_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___STabLineItem_o0440_gg_.__keyboardFocused_o0440_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SText_o0440_gg_{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SAddon_o0440_gg_{display:inline-flex;align-items:center;justify-content:center}.___STabLineItem_o0440_gg_._size_m_o0440_gg_{height:28px;min-width:18px}.___STabLineItem_o0440_gg_._size_m_o0440_gg_ .___SText_o0440_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___STabLineItem_o0440_gg_._size_l_o0440_gg_{height:40px;min-width:26px}.___STabLineItem_o0440_gg_._size_l_o0440_gg_ .___SText_o0440_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___STabLineItem_o0440_gg_._neighborLocation_left_o0440_gg_{margin-right:0}@media (prefers-reduced-motion){.___STabLineItem_o0440_gg_.__selected_o0440_gg_::after,.___STabLineItem_o0440_gg_::after,.___STabLineItem_o0440_gg_::before{transition:none}.___SCaret_o0440_gg_{display:none}}" /*__inner_css_end__*/, "o0440_gg_") /*__reshadow_css_end__*/, {
22
- "__STabLine": "___STabLine_o0440_gg_",
23
- "_underlined": "__underlined_o0440_gg_",
24
- "__STabLineItem": "___STabLineItem_o0440_gg_",
25
- "_selected": "__selected_o0440_gg_",
26
- "__SText": "___SText_o0440_gg_",
27
- "__SAddon": "___SAddon_o0440_gg_",
28
- "__SCaret": "___SCaret_o0440_gg_",
29
- "_disabled": "__disabled_o0440_gg_",
30
- "_keyboardFocused": "__keyboardFocused_o0440_gg_",
31
- "_size_m": "_size_m_o0440_gg_",
32
- "_size_l": "_size_l_o0440_gg_",
33
- "_neighborLocation_left": "_neighborLocation_left_o0440_gg_"
21
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___STabLine_13zof_gg_{position:relative;display:flex;width:100%;max-width:100%}.___STabLine_13zof_gg_.__underlined_13zof_gg_{border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___STabLineItem_13zof_gg_{display:inline-flex;align-items:center;justify-content:center;position:relative;touch-action:manipulation;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0;box-shadow:none;text-decoration:none;-webkit-tap-highlight-color:transparent;overflow:visible;outline:0;text-align:center;vertical-align:middle;font-family:inherit;cursor:pointer;border:0;background:0 0;color:var(--intergalactic-text-primary, #191b23);margin-right:var(--intergalactic-spacing-4x, 16px);font-weight:var(--intergalactic-medium, 500)}.___STabLineItem_13zof_gg_::-moz-focus-inner{border:0;padding:0}.___STabLineItem_13zof_gg_:active,.___STabLineItem_13zof_gg_:focus{outline:0;text-decoration:none}@media (hover:hover){.___STabLineItem_13zof_gg_:hover{outline:0;text-decoration:none}}.___STabLineItem_13zof_gg_::after,.___STabLineItem_13zof_gg_::before{content:\"\";position:absolute;left:0;bottom:-1px;height:3px;width:100%;background-color:transparent}.___STabLineItem_13zof_gg_::before{transition:background-color calc(var(--intergalactic-duration-control, 200)*1ms) ease-in-out}@media (hover:hover){.___STabLineItem_13zof_gg_:hover::before{background-color:var(--intergalactic-border-primary, #c4c7cf)}}.___STabLineItem_13zof_gg_.__selected_13zof_gg_::after{transition-delay:calc(var(--intergalactic-duration-control, 200)*1ms);background-color:var(--intergalactic-border-info-active, #006dca)}.___STabLineItem_13zof_gg_ .___SAddon_13zof_gg_:not(:last-child),.___STabLineItem_13zof_gg_ .___SText_13zof_gg_:not(:last-child){margin-right:var(--intergalactic-spacing-2x, 8px)}.___SCaret_13zof_gg_{position:absolute;bottom:-1px;height:3px;background-color:var(--intergalactic-border-info-active, #006dca);transition:calc(var(--intergalactic-duration-control, 200)*1ms) all ease-in-out}.___STabLineItem_13zof_gg_.__selected_13zof_gg_{flex-shrink:0}.___STabLineItem_13zof_gg_.__disabled_13zof_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___STabLineItem_13zof_gg_.__keyboardFocused_13zof_gg_{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SText_13zof_gg_{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SAddon_13zof_gg_{display:inline-flex;align-items:center;justify-content:center}.___STabLineItem_13zof_gg_._size_m_13zof_gg_{height:28px;min-width:18px}.___STabLineItem_13zof_gg_._size_m_13zof_gg_ .___SText_13zof_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___STabLineItem_13zof_gg_._size_l_13zof_gg_{height:40px;min-width:26px}.___STabLineItem_13zof_gg_._size_l_13zof_gg_ .___SText_13zof_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___STabLineItem_13zof_gg_._neighborLocation_left_13zof_gg_{margin-right:0}@media (prefers-reduced-motion){.___STabLineItem_13zof_gg_.__selected_13zof_gg_::after,.___STabLineItem_13zof_gg_::after,.___STabLineItem_13zof_gg_::before{transition:none}.___SCaret_13zof_gg_{display:none}}" /*__inner_css_end__*/, "13zof_gg_") /*__reshadow_css_end__*/, {
22
+ "__STabLine": "___STabLine_13zof_gg_",
23
+ "_underlined": "__underlined_13zof_gg_",
24
+ "__STabLineItem": "___STabLineItem_13zof_gg_",
25
+ "_selected": "__selected_13zof_gg_",
26
+ "__SText": "___SText_13zof_gg_",
27
+ "__SAddon": "___SAddon_13zof_gg_",
28
+ "__SCaret": "___SCaret_13zof_gg_",
29
+ "_disabled": "__disabled_13zof_gg_",
30
+ "_keyboardFocused": "__keyboardFocused_13zof_gg_",
31
+ "_size_m": "_size_m_13zof_gg_",
32
+ "_size_l": "_size_l_13zof_gg_",
33
+ "_neighborLocation_left": "_neighborLocation_left_13zof_gg_"
34
34
  });
35
35
  var optionsA11yEnhance = {
36
36
  onNeighborChange: function onNeighborChange(neighborElement) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport { Box, IBoxProps } from '@semcore/flex-box';\nimport { INeighborItemProps, INeighborLocationProps } from '@semcore/neighbor-location';\nimport { IKeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nexport type TabLineValue = string | number | boolean;\n\nexport interface ITabLineProps<T extends TabLineValue = TabLineValue>\n extends IBoxProps,\n INeighborLocationProps {\n /** TabLine size\n * @default m\n * */\n size?: 'm' | 'l' | false;\n /** Adds a bottom border for the entire component\n * @default true\n * */\n underlined?: boolean;\n /** Is invoked when changing the selection */\n onChange?: (value: T, e?: React.SyntheticEvent<HTMLButtonElement>) => void;\n /** Value of the selected tab */\n value?: T;\n /** Default value of the selected tab\n * @default null\n * */\n defaultValue?: T;\n}\n\nexport interface ITabLineItemProps extends IBoxProps, IKeyboardFocusProps, INeighborItemProps {\n /** Makes a tab selected. This property is determined automatically depending on the value. */\n selected?: boolean;\n /** Disabled state */\n disabled?: boolean;\n /** Tab value */\n value?: TabLineValue;\n /** Left addon tag */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n}\n\nexport interface ITabLineContext {\n getItemProps: PropGetterFn;\n}\n\nexport interface ITabLineHandlers {\n value: (value: TabLineValue) => void;\n}\n\ndeclare const TabLine: (<T, V extends TabLineValue = TabLineValue>(\n props: CProps<ITabLineProps<V> & T, ITabLineContext, ITabLineHandlers>,\n) => ReturnEl) & {\n Item: (<T>(props: CProps<ITabLineItemProps & T, {}, ITabLineHandlers>) => ReturnEl) & {\n Text: typeof Box;\n Addon: typeof Box;\n };\n};\n\nexport default TabLine;\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 { INeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';\nimport { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nexport type TabLineValue = string | number | boolean;\n\n/** @deprecated */\nexport interface ITabLineProps<T extends TabLineValue = TabLineValue>\n extends TabLineProps<T>,\n UnknownProperties {}\nexport type TabLineProps<T extends TabLineValue = TabLineValue> = BoxProps &\n NeighborLocationProps & {\n /** TabLine size\n * @default m\n * */\n size?: 'm' | 'l' | false;\n /** Adds a bottom border for the entire component\n * @default true\n * */\n underlined?: boolean;\n /** Is invoked when changing the selection */\n onChange?:\n | ((value: T, e?: React.SyntheticEvent<HTMLButtonElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Value of the selected tab */\n value?: T;\n /** Default value of the selected tab\n * @default null\n * */\n defaultValue?: T;\n };\n\n/** @deprecated */\nexport interface ITabLineItemProps extends TabLineItemProps, UnknownProperties {}\nexport type TabLineItemProps = BoxProps &\n KeyboardFocusProps &\n INeighborItemProps & {\n /** Makes a tab selected. This property is determined automatically depending on the value. */\n selected?: boolean;\n /** Disabled state */\n disabled?: boolean;\n /** Tab value */\n value?: TabLineValue;\n /** Left addon tag */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n };\n\n/** @deprecated */\nexport interface ITabLineContext extends TabLineContext, UnknownProperties {}\nexport type TabLineContext = {\n getItemProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface ITabLineHandlers extends TabLineHandlers, UnknownProperties {}\nexport type TabLineHandlers = {\n value: (value: TabLineValue) => void;\n};\n\ntype IntergalacticTabLineComponent = (<\n Value extends TabLineValue,\n Tag extends Intergalactic.Tag = 'div',\n>(\n props: Intergalactic.InternalTypings.ComponentProps<\n Tag,\n TabLineProps<Value>,\n TabLineContext,\n [handlers: TabLineHandlers]\n >,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<'div'>;\n\ndeclare const TabLine: IntergalacticTabLineComponent & {\n Item: Intergalactic.Component<'div', TabLineItemProps, {}, [handlers: TabLineHandlers]> & {\n Text: typeof Box;\n Addon: typeof Box;\n };\n};\n\nexport default TabLine;\n"],"mappings":""}
@@ -1,57 +1,81 @@
1
1
  import React from 'react';
2
- import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
3
- import { Box, IBoxProps } from '@semcore/flex-box';
4
- import { INeighborItemProps, INeighborLocationProps } from '@semcore/neighbor-location';
5
- import { IKeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
2
+ import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';
3
+ import { Box, BoxProps } from '@semcore/flex-box';
4
+ import { INeighborItemProps, NeighborLocationProps } from '@semcore/neighbor-location';
5
+ import { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
6
6
 
7
7
  export type TabLineValue = string | number | boolean;
8
8
 
9
+ /** @deprecated */
9
10
  export interface ITabLineProps<T extends TabLineValue = TabLineValue>
10
- extends IBoxProps,
11
- INeighborLocationProps {
12
- /** TabLine size
13
- * @default m
14
- * */
15
- size?: 'm' | 'l' | false;
16
- /** Adds a bottom border for the entire component
17
- * @default true
18
- * */
19
- underlined?: boolean;
20
- /** Is invoked when changing the selection */
21
- onChange?: (value: T, e?: React.SyntheticEvent<HTMLButtonElement>) => void;
22
- /** Value of the selected tab */
23
- value?: T;
24
- /** Default value of the selected tab
25
- * @default null
26
- * */
27
- defaultValue?: T;
28
- }
29
-
30
- export interface ITabLineItemProps extends IBoxProps, IKeyboardFocusProps, INeighborItemProps {
31
- /** Makes a tab selected. This property is determined automatically depending on the value. */
32
- selected?: boolean;
33
- /** Disabled state */
34
- disabled?: boolean;
35
- /** Tab value */
36
- value?: TabLineValue;
37
- /** Left addon tag */
38
- addonLeft?: React.ElementType;
39
- /** Right addon tag */
40
- addonRight?: React.ElementType;
41
- }
42
-
43
- export interface ITabLineContext {
11
+ extends TabLineProps<T>,
12
+ UnknownProperties {}
13
+ export type TabLineProps<T extends TabLineValue = TabLineValue> = BoxProps &
14
+ NeighborLocationProps & {
15
+ /** TabLine size
16
+ * @default m
17
+ * */
18
+ size?: 'm' | 'l' | false;
19
+ /** Adds a bottom border for the entire component
20
+ * @default true
21
+ * */
22
+ underlined?: boolean;
23
+ /** Is invoked when changing the selection */
24
+ onChange?:
25
+ | ((value: T, e?: React.SyntheticEvent<HTMLButtonElement>) => void)
26
+ | React.Dispatch<React.SetStateAction<T>>;
27
+ /** Value of the selected tab */
28
+ value?: T;
29
+ /** Default value of the selected tab
30
+ * @default null
31
+ * */
32
+ defaultValue?: T;
33
+ };
34
+
35
+ /** @deprecated */
36
+ export interface ITabLineItemProps extends TabLineItemProps, UnknownProperties {}
37
+ export type TabLineItemProps = BoxProps &
38
+ KeyboardFocusProps &
39
+ INeighborItemProps & {
40
+ /** Makes a tab selected. This property is determined automatically depending on the value. */
41
+ selected?: boolean;
42
+ /** Disabled state */
43
+ disabled?: boolean;
44
+ /** Tab value */
45
+ value?: TabLineValue;
46
+ /** Left addon tag */
47
+ addonLeft?: React.ElementType;
48
+ /** Right addon tag */
49
+ addonRight?: React.ElementType;
50
+ };
51
+
52
+ /** @deprecated */
53
+ export interface ITabLineContext extends TabLineContext, UnknownProperties {}
54
+ export type TabLineContext = {
44
55
  getItemProps: PropGetterFn;
45
- }
56
+ };
46
57
 
47
- export interface ITabLineHandlers {
58
+ /** @deprecated */
59
+ export interface ITabLineHandlers extends TabLineHandlers, UnknownProperties {}
60
+ export type TabLineHandlers = {
48
61
  value: (value: TabLineValue) => void;
49
- }
62
+ };
63
+
64
+ type IntergalacticTabLineComponent = (<
65
+ Value extends TabLineValue,
66
+ Tag extends Intergalactic.Tag = 'div',
67
+ >(
68
+ props: Intergalactic.InternalTypings.ComponentProps<
69
+ Tag,
70
+ TabLineProps<Value>,
71
+ TabLineContext,
72
+ [handlers: TabLineHandlers]
73
+ >,
74
+ ) => Intergalactic.InternalTypings.ComponentRenderingResults) &
75
+ Intergalactic.InternalTypings.ComponentAdditive<'div'>;
50
76
 
51
- declare const TabLine: (<T, V extends TabLineValue = TabLineValue>(
52
- props: CProps<ITabLineProps<V> & T, ITabLineContext, ITabLineHandlers>,
53
- ) => ReturnEl) & {
54
- Item: (<T>(props: CProps<ITabLineItemProps & T, {}, ITabLineHandlers>) => ReturnEl) & {
77
+ declare const TabLine: IntergalacticTabLineComponent & {
78
+ Item: Intergalactic.Component<'div', TabLineItemProps, {}, [handlers: TabLineHandlers]> & {
55
79
  Text: typeof Box;
56
80
  Addon: typeof Box;
57
81
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/tab-line",
3
3
  "description": "Semrush TabLine Component",
4
- "version": "3.3.25",
4
+ "version": "4.0.0-beta.1",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -9,13 +9,12 @@
9
9
  "author": "UI-kit team <ui-kit-team@semrush.com>",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@semcore/flex-box": "^4",
13
- "@semcore/neighbor-location": "^3",
14
- "@semcore/utils": "^3.30",
15
- "resize-observer-polyfill": "1.5.1"
12
+ "@semcore/flex-box": "5.0.0-beta.1",
13
+ "@semcore/neighbor-location": "4.0.0-beta.1",
14
+ "@semcore/utils": "4.0.0-beta.1"
16
15
  },
17
16
  "peerDependencies": {
18
- "@semcore/core": "^1.11",
17
+ "@semcore/core": "2.0.0-beta.1",
19
18
  "react": "16.8 - 18",
20
19
  "react-dom": "16.8 - 18"
21
20
  },