@edvisor/product-language 0.8.6 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -6683,11 +6683,11 @@ const IconContainer = /*#__PURE__*/styled.div.withConfig({
6683
6683
  const AlertFooter = /*#__PURE__*/styled.footer.withConfig({
6684
6684
  displayName: "alert-banner__AlertFooter",
6685
6685
  componentId: "g6nsx9-2"
6686
- })(["width:100%;padding:", " ", " ", ";bottom:0;box-sizing:border-box;display:flex;gap:", ""], Padding.m, Padding.xl, Padding.none, Gap.xs);
6686
+ })(["width:100%;padding:", " ", " ", ";bottom:0;box-sizing:border-box;display:flex;gap:", ";"], Padding.m, Padding.xl, Padding.none, Gap.xs);
6687
6687
  const Content$1 = /*#__PURE__*/styled(Body).withConfig({
6688
6688
  displayName: "alert-banner__Content",
6689
6689
  componentId: "g6nsx9-3"
6690
- })(["padding-left:", ";flex:1;"], Padding.m);
6690
+ })(["padding-left:", ";flex:1;overflow:auto;"], Padding.m);
6691
6691
  const CloseButton$2 = /*#__PURE__*/styled(IconMinor.Xmark).withConfig({
6692
6692
  displayName: "alert-banner__CloseButton",
6693
6693
  componentId: "g6nsx9-4"
@@ -7843,7 +7843,7 @@ const Thumbnail = props => {
7843
7843
  }));
7844
7844
  };
7845
7845
 
7846
- const styles = ({
7846
+ const getStylesToTypePrimary = ({
7847
7847
  selected
7848
7848
  }) => ({
7849
7849
  display: 'flex',
@@ -7856,13 +7856,40 @@ const styles = ({
7856
7856
  }
7857
7857
  });
7858
7858
 
7859
+ const getStylesToTypeSecondary = ({
7860
+ selected
7861
+ }) => ({
7862
+ display: 'flex',
7863
+ padding: `${Padding.xs} ${Padding.m}`,
7864
+ border: !selected ? `1px solid ${Surface.Default.Depressed}` : '1px solid transparent',
7865
+ cursor: 'pointer',
7866
+ outline: 'none',
7867
+ boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.06)',
7868
+ background: selected ? `${Surface.Default.Depressed}` : `${Surface.Default.Default}`,
7869
+ borderRadius: '18px',
7870
+ alignItems: 'center'
7871
+ });
7872
+
7873
+ const getStylesByType = (secondary, selected) => {
7874
+ if (secondary) {
7875
+ return getStylesToTypeSecondary({
7876
+ selected
7877
+ });
7878
+ }
7879
+
7880
+ return getStylesToTypePrimary({
7881
+ selected
7882
+ });
7883
+ };
7884
+
7859
7885
  const Tab$1 = props => {
7860
7886
  const {
7861
7887
  Prefix,
7862
- selected = false
7888
+ selected = false,
7889
+ secondary = false
7863
7890
  } = props,
7864
7891
  rest = __rest(props // eslint-disable-next-line no-null/no-null
7865
- , ["Prefix", "selected"]); // eslint-disable-next-line no-null/no-null
7892
+ , ["Prefix", "selected", "secondary"]); // eslint-disable-next-line no-null/no-null
7866
7893
 
7867
7894
 
7868
7895
  const ref = useRef(null);
@@ -7890,9 +7917,7 @@ const Tab$1 = props => {
7890
7917
  role: 'tab',
7891
7918
  "aria-selected": selected,
7892
7919
  ref: ref,
7893
- style: styles({
7894
- selected
7895
- })
7920
+ style: getStylesByType(secondary, selected)
7896
7921
  }, {
7897
7922
  children: [isDefined(Prefix) ? jsx(Prefix, {
7898
7923
  style: {
@@ -7900,7 +7925,7 @@ const Tab$1 = props => {
7900
7925
  }
7901
7926
  }) : jsx(Nothing, {}), jsx(Label$1, Object.assign({
7902
7927
  strong: true,
7903
- subdued: !selected
7928
+ subdued: !selected && !secondary
7904
7929
  }, {
7905
7930
  children: props.children
7906
7931
  }))]
@@ -7914,7 +7939,15 @@ const Tab = /*#__PURE__*/styled(Tab$1).withConfig({
7914
7939
  const TabList = /*#__PURE__*/styled(Flex).withConfig({
7915
7940
  displayName: "tabs__TabList",
7916
7941
  componentId: "kpjo9y-1"
7917
- })(["padding-left:", ";border-bottom:1px solid ", ";", "{margin-right:", ";margin-bottom:-1px;flex-shrink:0;}"], Padding.m, Borders.Default.Subdued, Tab, Margin.m);
7942
+ })(["padding-left:", ";", "{margin-right:", ";margin-bottom:-1px;flex-shrink:0;}"], Padding.m, Tab, Margin.m);
7943
+ const TabListSecondary = /*#__PURE__*/styled(TabList).withConfig({
7944
+ displayName: "tabs__TabListSecondary",
7945
+ componentId: "kpjo9y-2"
7946
+ })(["", "{margin-right:", ";}"], Tab, Margin.xs);
7947
+ const TabListPrimary = /*#__PURE__*/styled(TabList).withConfig({
7948
+ displayName: "tabs__TabListPrimary",
7949
+ componentId: "kpjo9y-3"
7950
+ })(["border-bottom:1px solid ", ";"], Borders.Default.Subdued);
7918
7951
 
7919
7952
  class Content extends StylableSlot {}
7920
7953
 
@@ -7936,7 +7969,14 @@ const Tabs = props => {
7936
7969
  const tabs = Children.map(child.props.children, tab => {
7937
7970
  return isTab(tab) ? decorateTab(tab, props, tabCount++) : tab;
7938
7971
  });
7939
- return jsx(TabList, {
7972
+
7973
+ if (is(props.secondary) && props.secondary === true) {
7974
+ return jsx(TabListSecondary, {
7975
+ children: tabs
7976
+ });
7977
+ }
7978
+
7979
+ return jsx(TabListPrimary, {
7940
7980
  children: tabs
7941
7981
  });
7942
7982
  } else {
@@ -7950,9 +7990,11 @@ const Tabs = props => {
7950
7990
 
7951
7991
  function decorateTab(tab, {
7952
7992
  selected,
7993
+ secondary,
7953
7994
  onChange = () => undefined
7954
7995
  }, index) {
7955
7996
  return jsx(Tab, Object.assign({}, tab.props, {
7997
+ secondary: secondary,
7956
7998
  selected: is(tab.props.selected) ? tab.props.selected : index === selected,
7957
7999
  onFocus: e => {
7958
8000
  safeCallback(tab.props.onFocus, e);
@@ -3,5 +3,6 @@ import { FC, PropsWithChildren } from '@helpers';
3
3
  export interface ITabProps extends PropsWithChildren, HTMLAttributes<HTMLDivElement> {
4
4
  Prefix?: FC<HTMLAttributes<HTMLElement>>;
5
5
  selected?: boolean;
6
+ secondary?: boolean;
6
7
  }
7
8
  export declare const Tab: FC<ITabProps>;
@@ -8,6 +8,7 @@ declare type SubComponents = {
8
8
  TabList: typeof Navigation;
9
9
  };
10
10
  interface ITabsProps extends PropsWithChildren {
11
+ secondary?: boolean;
11
12
  selected: number;
12
13
  onChange?: (selected: number) => void;
13
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edvisor/product-language",
3
- "version": "0.8.6",
3
+ "version": "0.9.0",
4
4
  "license": "MIT",
5
5
  "description": "Edvisor.io product-language components",
6
6
  "repository": "https://github.com/edvisor-io/front-end/",