@semcore/tab-panel 3.0.7 → 3.0.9

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,6 +2,18 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [3.0.9] - 2022-09-30
6
+
7
+ ### Added
8
+
9
+ - Added styles for panel consisting only of an icon.
10
+
11
+ ## [3.0.8] - 2022-09-07
12
+
13
+ ### Fixed
14
+
15
+ - Enforced inner text font line height to prevent possible bottom cut.
16
+
5
17
  ## [3.0.7] - 2022-08-30
6
18
 
7
19
  ### Changed
@@ -52,18 +52,18 @@ var style = (
52
52
  /*__reshadow_css_start__*/
53
53
  _core.sstyled.insert(
54
54
  /*__inner_css_start__*/
55
- ".___STabPanel_1fwpm_gg_{display:flex;width:100%;max-width:100%;border-bottom:1px solid #c4c7cf}.___STabPanelItem_1fwpm_gg_{position:relative;bottom:-1px;display:inline-flex;min-width:0;height:32px;font-size:14px;color:#6c6e79;border:1px solid transparent;border-radius:6px 6px 0 0;background:transparent;align-items:center;justify-content:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0;box-shadow:none;outline:none;text-decoration:none;-webkit-tap-highlight-color:transparent;outline:0;text-align:center;vertical-align:middle;font-family:inherit;cursor:pointer}.___STabPanelItem_1fwpm_gg_::-moz-focus-inner{border:none;padding:0}.___STabPanelItem_1fwpm_gg_:active,.___STabPanelItem_1fwpm_gg_:focus,.___STabPanelItem_1fwpm_gg_:hover{outline:0;text-decoration:none}.___STabPanelItem_1fwpm_gg_:hover{color:#191b23}.___STabPanelItem_1fwpm_gg_.__disabled_1fwpm_gg_{opacity:0.3;cursor:default;pointer-events:none}.___STabPanelItem_1fwpm_gg_.__keyboardFocused_1fwpm_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___STabPanelItem_1fwpm_gg_.__selected_1fwpm_gg_{color:#006dca;border-color:#c4c7cf;border-bottom-color:#ffffff;flex-shrink:0}.___STabPanelItem_1fwpm_gg_.__selected_1fwpm_gg_:hover{color:#006dca}.___SText_1fwpm_gg_{display:inline-block;margin:auto 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SAddon_1fwpm_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_1fwpm_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_1fwpm_gg_:not(:only-child):last-child{margin-right:8px}"
55
+ ".___STabPanel_2imgl_gg_{display:flex;width:100%;max-width:100%;border-bottom:1px solid #c4c7cf}.___STabPanelItem_2imgl_gg_{position:relative;bottom:-1px;display:inline-flex;min-width:0;height:32px;color:#6c6e79;border:1px solid transparent;border-radius:6px 6px 0 0;background:transparent;align-items:center;justify-content:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0;box-shadow:none;outline:none;text-decoration:none;-webkit-tap-highlight-color:transparent;outline:0;text-align:center;vertical-align:middle;font-family:inherit;cursor:pointer}.___STabPanelItem_2imgl_gg_ .___SText_2imgl_gg_{font-size:14px;line-height:1.42}.___STabPanelItem_2imgl_gg_::-moz-focus-inner{border:none;padding:0}.___STabPanelItem_2imgl_gg_:active,.___STabPanelItem_2imgl_gg_:focus,.___STabPanelItem_2imgl_gg_:hover{outline:0;text-decoration:none}.___STabPanelItem_2imgl_gg_:hover{color:#191b23}.___STabPanelItem_2imgl_gg_.__disabled_2imgl_gg_{opacity:0.3;cursor:default;pointer-events:none}.___STabPanelItem_2imgl_gg_.__keyboardFocused_2imgl_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___STabPanelItem_2imgl_gg_.__selected_2imgl_gg_{color:#006dca;border-color:#c4c7cf;border-bottom-color:#ffffff;flex-shrink:0}.___STabPanelItem_2imgl_gg_.__selected_2imgl_gg_:hover{color:#006dca}.___SText_2imgl_gg_{display:inline-block;margin:auto 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SAddon_2imgl_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_2imgl_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_2imgl_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_2imgl_gg_:only-child{margin-right:8px;margin-left:8px}"
56
56
  /*__inner_css_end__*/
57
- , "1fwpm_gg_")
57
+ , "2imgl_gg_")
58
58
  /*__reshadow_css_end__*/
59
59
  , {
60
- "__STabPanel": "___STabPanel_1fwpm_gg_",
61
- "__STabPanelItem": "___STabPanelItem_1fwpm_gg_",
62
- "_disabled": "__disabled_1fwpm_gg_",
63
- "_keyboardFocused": "__keyboardFocused_1fwpm_gg_",
64
- "_selected": "__selected_1fwpm_gg_",
65
- "__SText": "___SText_1fwpm_gg_",
66
- "__SAddon": "___SAddon_1fwpm_gg_"
60
+ "__STabPanel": "___STabPanel_2imgl_gg_",
61
+ "__STabPanelItem": "___STabPanelItem_2imgl_gg_",
62
+ "__SText": "___SText_2imgl_gg_",
63
+ "_disabled": "__disabled_2imgl_gg_",
64
+ "_keyboardFocused": "__keyboardFocused_2imgl_gg_",
65
+ "_selected": "__selected_2imgl_gg_",
66
+ "__SAddon": "___SAddon_2imgl_gg_"
67
67
  });
68
68
  var optionsA11yEnhance = {
69
69
  onNeighborChange: function onNeighborChange(neighborElement) {
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +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 { IKeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nexport type TabPanelValue = string | number | boolean;\n\nexport interface ITabPanelProps<T extends TabPanelValue = TabPanelValue> extends IBoxProps {\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 ITabPanelItemProps extends IBoxProps, IKeyboardFocusProps {\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?: TabPanelValue;\n /** Left addon tag */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n}\n\nexport interface ITabPanelContext {\n getItemProps: PropGetterFn;\n}\n\nexport interface ITabPanelHandlers {\n value: (value: TabPanelValue) => void;\n}\n\ndeclare const TabPanel: (<T, V extends TabPanelValue = TabPanelValue>(\n props: CProps<ITabPanelProps<V> & T, ITabPanelContext, ITabPanelHandlers>,\n) => ReturnEl) & {\n Item: (<T>(props: CProps<ITabPanelItemProps & T, {}, ITabPanelHandlers>) => ReturnEl) & {\n Text: typeof Box;\n Addon: typeof Box;\n };\n};\n\nexport default TabPanel;\n"],"mappings":""}
@@ -13,7 +13,6 @@ STabPanelItem {
13
13
  display: inline-flex;
14
14
  min-width: 0;
15
15
  height: 32px;
16
- font-size: var(--fs-200);
17
16
  color: var(--gray-500);
18
17
  border: 1px solid transparent;
19
18
  border-radius: 6px 6px 0 0;
@@ -35,6 +34,11 @@ STabPanelItem {
35
34
  font-family: inherit;
36
35
  cursor: pointer;
37
36
 
37
+ & SText {
38
+ font-size: var(--fs-200);
39
+ line-height: var(--lh-200);
40
+ }
41
+
38
42
  &::-moz-focus-inner {
39
43
  border: none;
40
44
  padding: 0;
@@ -94,3 +98,8 @@ SAddon:not(:only-child):first-child {
94
98
  SAddon:not(:only-child):last-child {
95
99
  margin-right: 8px;
96
100
  }
101
+
102
+ SAddon:only-child {
103
+ margin-right: 8px;
104
+ margin-left: 8px;
105
+ }
@@ -31,18 +31,18 @@ var style = (
31
31
  /*__reshadow_css_start__*/
32
32
  _sstyled.insert(
33
33
  /*__inner_css_start__*/
34
- ".___STabPanel_1fwpm_gg_{display:flex;width:100%;max-width:100%;border-bottom:1px solid #c4c7cf}.___STabPanelItem_1fwpm_gg_{position:relative;bottom:-1px;display:inline-flex;min-width:0;height:32px;font-size:14px;color:#6c6e79;border:1px solid transparent;border-radius:6px 6px 0 0;background:transparent;align-items:center;justify-content:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0;box-shadow:none;outline:none;text-decoration:none;-webkit-tap-highlight-color:transparent;outline:0;text-align:center;vertical-align:middle;font-family:inherit;cursor:pointer}.___STabPanelItem_1fwpm_gg_::-moz-focus-inner{border:none;padding:0}.___STabPanelItem_1fwpm_gg_:active,.___STabPanelItem_1fwpm_gg_:focus,.___STabPanelItem_1fwpm_gg_:hover{outline:0;text-decoration:none}.___STabPanelItem_1fwpm_gg_:hover{color:#191b23}.___STabPanelItem_1fwpm_gg_.__disabled_1fwpm_gg_{opacity:0.3;cursor:default;pointer-events:none}.___STabPanelItem_1fwpm_gg_.__keyboardFocused_1fwpm_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___STabPanelItem_1fwpm_gg_.__selected_1fwpm_gg_{color:#006dca;border-color:#c4c7cf;border-bottom-color:#ffffff;flex-shrink:0}.___STabPanelItem_1fwpm_gg_.__selected_1fwpm_gg_:hover{color:#006dca}.___SText_1fwpm_gg_{display:inline-block;margin:auto 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SAddon_1fwpm_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_1fwpm_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_1fwpm_gg_:not(:only-child):last-child{margin-right:8px}"
34
+ ".___STabPanel_2imgl_gg_{display:flex;width:100%;max-width:100%;border-bottom:1px solid #c4c7cf}.___STabPanelItem_2imgl_gg_{position:relative;bottom:-1px;display:inline-flex;min-width:0;height:32px;color:#6c6e79;border:1px solid transparent;border-radius:6px 6px 0 0;background:transparent;align-items:center;justify-content:center;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box;padding:0;margin:0;box-shadow:none;outline:none;text-decoration:none;-webkit-tap-highlight-color:transparent;outline:0;text-align:center;vertical-align:middle;font-family:inherit;cursor:pointer}.___STabPanelItem_2imgl_gg_ .___SText_2imgl_gg_{font-size:14px;line-height:1.42}.___STabPanelItem_2imgl_gg_::-moz-focus-inner{border:none;padding:0}.___STabPanelItem_2imgl_gg_:active,.___STabPanelItem_2imgl_gg_:focus,.___STabPanelItem_2imgl_gg_:hover{outline:0;text-decoration:none}.___STabPanelItem_2imgl_gg_:hover{color:#191b23}.___STabPanelItem_2imgl_gg_.__disabled_2imgl_gg_{opacity:0.3;cursor:default;pointer-events:none}.___STabPanelItem_2imgl_gg_.__keyboardFocused_2imgl_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___STabPanelItem_2imgl_gg_.__selected_2imgl_gg_{color:#006dca;border-color:#c4c7cf;border-bottom-color:#ffffff;flex-shrink:0}.___STabPanelItem_2imgl_gg_.__selected_2imgl_gg_:hover{color:#006dca}.___SText_2imgl_gg_{display:inline-block;margin:auto 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SAddon_2imgl_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_2imgl_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_2imgl_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_2imgl_gg_:only-child{margin-right:8px;margin-left:8px}"
35
35
  /*__inner_css_end__*/
36
- , "1fwpm_gg_")
36
+ , "2imgl_gg_")
37
37
  /*__reshadow_css_end__*/
38
38
  , {
39
- "__STabPanel": "___STabPanel_1fwpm_gg_",
40
- "__STabPanelItem": "___STabPanelItem_1fwpm_gg_",
41
- "_disabled": "__disabled_1fwpm_gg_",
42
- "_keyboardFocused": "__keyboardFocused_1fwpm_gg_",
43
- "_selected": "__selected_1fwpm_gg_",
44
- "__SText": "___SText_1fwpm_gg_",
45
- "__SAddon": "___SAddon_1fwpm_gg_"
39
+ "__STabPanel": "___STabPanel_2imgl_gg_",
40
+ "__STabPanelItem": "___STabPanelItem_2imgl_gg_",
41
+ "__SText": "___SText_2imgl_gg_",
42
+ "_disabled": "__disabled_2imgl_gg_",
43
+ "_keyboardFocused": "__keyboardFocused_2imgl_gg_",
44
+ "_selected": "__selected_2imgl_gg_",
45
+ "__SAddon": "___SAddon_2imgl_gg_"
46
46
  });
47
47
  var optionsA11yEnhance = {
48
48
  onNeighborChange: function onNeighborChange(neighborElement) {
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +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 { IKeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nexport type TabPanelValue = string | number | boolean;\n\nexport interface ITabPanelProps<T extends TabPanelValue = TabPanelValue> extends IBoxProps {\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 ITabPanelItemProps extends IBoxProps, IKeyboardFocusProps {\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?: TabPanelValue;\n /** Left addon tag */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n}\n\nexport interface ITabPanelContext {\n getItemProps: PropGetterFn;\n}\n\nexport interface ITabPanelHandlers {\n value: (value: TabPanelValue) => void;\n}\n\ndeclare const TabPanel: (<T, V extends TabPanelValue = TabPanelValue>(\n props: CProps<ITabPanelProps<V> & T, ITabPanelContext, ITabPanelHandlers>,\n) => ReturnEl) & {\n Item: (<T>(props: CProps<ITabPanelItemProps & T, {}, ITabPanelHandlers>) => ReturnEl) & {\n Text: typeof Box;\n Addon: typeof Box;\n };\n};\n\nexport default TabPanel;\n"],"mappings":""}
@@ -13,7 +13,6 @@ STabPanelItem {
13
13
  display: inline-flex;
14
14
  min-width: 0;
15
15
  height: 32px;
16
- font-size: var(--fs-200);
17
16
  color: var(--gray-500);
18
17
  border: 1px solid transparent;
19
18
  border-radius: 6px 6px 0 0;
@@ -35,6 +34,11 @@ STabPanelItem {
35
34
  font-family: inherit;
36
35
  cursor: pointer;
37
36
 
37
+ & SText {
38
+ font-size: var(--fs-200);
39
+ line-height: var(--lh-200);
40
+ }
41
+
38
42
  &::-moz-focus-inner {
39
43
  border: none;
40
44
  padding: 0;
@@ -94,3 +98,8 @@ SAddon:not(:only-child):first-child {
94
98
  SAddon:not(:only-child):last-child {
95
99
  margin-right: 8px;
96
100
  }
101
+
102
+ SAddon:only-child {
103
+ margin-right: 8px;
104
+ margin-left: 8px;
105
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/tab-panel",
3
3
  "description": "Semrush TabPanel Component",
4
- "version": "3.0.7",
4
+ "version": "3.0.9",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "author": "UI-kit team <ui-kit-team@semrush.com>",
10
10
  "license": "MIT",
11
11
  "scripts": {
12
- "build": "build --source=js",
12
+ "build": "pnpm semcore-builder --source=js",
13
13
  "test": "jest"
14
14
  },
15
15
  "dependencies": {
@@ -29,6 +29,8 @@
29
29
  "directory": "semcore/tab-panel"
30
30
  },
31
31
  "devDependencies": {
32
- "@semcore/jest-preset-ui": "1.0.0"
32
+ "@types/react": "16.8 - 17",
33
+ "@semcore/jest-preset-ui": "1.0.0",
34
+ "@semcore/icon": "^2.16"
33
35
  }
34
36
  }
@@ -1,49 +0,0 @@
1
- import React from 'react';
2
- import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
3
- import { Box, IBoxProps } from '@semcore/flex-box';
4
- import { IKeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
5
-
6
- export type TabPanelValue = string | number | boolean;
7
-
8
- export interface ITabPanelProps<T extends TabPanelValue = TabPanelValue> extends IBoxProps {
9
- /** Is invoked when changing the selection */
10
- onChange?: (value: T, e?: React.SyntheticEvent<HTMLButtonElement>) => void;
11
- /** Value of the selected tab */
12
- value?: T;
13
- /** Default value of the selected tab
14
- * @default null
15
- * */
16
- defaultValue?: T;
17
- }
18
-
19
- export interface ITabPanelItemProps extends IBoxProps, IKeyboardFocusProps {
20
- /** Makes a tab selected. This property is determined automatically depending on the value. */
21
- selected?: boolean;
22
- /** Disabled state */
23
- disabled?: boolean;
24
- /** Tab value */
25
- value?: TabPanelValue;
26
- /** Left addon tag */
27
- addonLeft?: React.ElementType;
28
- /** Right addon tag */
29
- addonRight?: React.ElementType;
30
- }
31
-
32
- export interface ITabPanelContext {
33
- getItemProps: PropGetterFn;
34
- }
35
-
36
- export interface ITabPanelHandlers {
37
- value: (value: TabPanelValue) => void;
38
- }
39
-
40
- declare const TabPanel: (<T, V extends TabPanelValue = TabPanelValue>(
41
- props: CProps<ITabPanelProps<V> & T, ITabPanelContext, ITabPanelHandlers>,
42
- ) => ReturnEl) & {
43
- Item: (<T>(props: CProps<ITabPanelItemProps & T, {}, ITabPanelHandlers>) => ReturnEl) & {
44
- Text: typeof Box;
45
- Addon: typeof Box;
46
- };
47
- };
48
-
49
- export default TabPanel;
@@ -1,49 +0,0 @@
1
- import React from 'react';
2
- import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
3
- import { Box, IBoxProps } from '@semcore/flex-box';
4
- import { IKeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
5
-
6
- export type TabPanelValue = string | number | boolean;
7
-
8
- export interface ITabPanelProps<T extends TabPanelValue = TabPanelValue> extends IBoxProps {
9
- /** Is invoked when changing the selection */
10
- onChange?: (value: T, e?: React.SyntheticEvent<HTMLButtonElement>) => void;
11
- /** Value of the selected tab */
12
- value?: T;
13
- /** Default value of the selected tab
14
- * @default null
15
- * */
16
- defaultValue?: T;
17
- }
18
-
19
- export interface ITabPanelItemProps extends IBoxProps, IKeyboardFocusProps {
20
- /** Makes a tab selected. This property is determined automatically depending on the value. */
21
- selected?: boolean;
22
- /** Disabled state */
23
- disabled?: boolean;
24
- /** Tab value */
25
- value?: TabPanelValue;
26
- /** Left addon tag */
27
- addonLeft?: React.ElementType;
28
- /** Right addon tag */
29
- addonRight?: React.ElementType;
30
- }
31
-
32
- export interface ITabPanelContext {
33
- getItemProps: PropGetterFn;
34
- }
35
-
36
- export interface ITabPanelHandlers {
37
- value: (value: TabPanelValue) => void;
38
- }
39
-
40
- declare const TabPanel: (<T, V extends TabPanelValue = TabPanelValue>(
41
- props: CProps<ITabPanelProps<V> & T, ITabPanelContext, ITabPanelHandlers>,
42
- ) => ReturnEl) & {
43
- Item: (<T>(props: CProps<ITabPanelItemProps & T, {}, ITabPanelHandlers>) => ReturnEl) & {
44
- Text: typeof Box;
45
- Addon: typeof Box;
46
- };
47
- };
48
-
49
- export default TabPanel;