@cuemath/leap 3.5.43 → 3.5.44-gg1

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.
@@ -1,45 +1,51 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { memo as p, useCallback as I } from "react";
3
- import T from "../../text/text.js";
4
- import { TabWrapper as f, Icon as b } from "../tabs-styled.js";
5
- const u = ({
6
- tab: o,
7
- isSelected: r,
8
- onChange: n,
9
- tabUnderlineColor: c = "WHITE_T_15",
10
- selectedTabUnderlineColor: s = "WHITE",
11
- activeTabTextProps: l = { $renderAs: "ub2-bold" },
12
- inactiveTabTextProps: $ = { $renderAs: "ub2" }
1
+ import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
+ import { memo as T, useMemo as x, useCallback as I } from "react";
3
+ import { useTheme as g } from "styled-components";
4
+ import v from "../../text/text.js";
5
+ import { TabWrapper as j, Icon as k } from "../tabs-styled.js";
6
+ const A = ({
7
+ tab: t,
8
+ isSelected: e,
9
+ onChange: c,
10
+ theme: l,
11
+ layout: m,
12
+ height: d,
13
+ minWidth: $
13
14
  }) => {
14
- const { Icon: t, iconPosition: m = "left" } = o, d = I(() => {
15
- n(o.id);
16
- }, [o.id, n]), i = r ? l : $;
17
- return /* @__PURE__ */ a(
18
- f,
15
+ const { tabs: f } = g(), { Icon: s, iconPosition: u = "left", disabled: o = !1 } = t, i = f[l], n = x(() => o ? "disabled" : e ? "active" : "inactive", [o, e]), a = i.text[n], C = n === "active" ? i.underline[n] : "TRANSPARENT", b = i.icon[n], h = I(() => {
16
+ o || c(t.id);
17
+ }, [t.id, c, o]);
18
+ return /* @__PURE__ */ p(
19
+ j,
19
20
  {
20
21
  $flexDirection: "row",
21
22
  $alignItems: "center",
22
23
  $justifyContent: "center",
23
- $gapX: 0.875,
24
- onClick: d,
25
- $borderBottomColor: r ? s : c,
24
+ $gutterX: 1,
25
+ onClick: h,
26
+ $borderBottomColor: C,
27
+ $disabled: o,
28
+ $layout: m,
29
+ $theme: l,
30
+ $isSelected: e,
31
+ $height: d,
32
+ $minWidth: $,
26
33
  children: [
27
- t ? /* @__PURE__ */ e(b, { $selected: r, $iconPosition: m, children: /* @__PURE__ */ e(t, {}) }) : void 0,
28
- /* @__PURE__ */ e(
29
- T,
34
+ s && e && !o ? /* @__PURE__ */ r(k, { $iconPosition: u, $iconColor: b, children: /* @__PURE__ */ r(s, {}) }) : void 0,
35
+ /* @__PURE__ */ r(
36
+ v,
30
37
  {
31
38
  $align: "center",
32
- $color: "WHITE",
33
- ...i,
34
- $renderAs: i.$renderAs,
35
- children: o.label
39
+ $color: a.color,
40
+ $renderAs: a.variant,
41
+ children: t.label
36
42
  }
37
43
  )
38
44
  ]
39
45
  }
40
46
  );
41
- }, h = p(u);
47
+ }, w = T(A);
42
48
  export {
43
- h as default
49
+ w as default
44
50
  };
45
51
  //# sourceMappingURL=tab-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tab-item.js","sources":["../../../../../src/features/ui/tabs/tab-tem/tab-item.tsx"],"sourcesContent":["import { memo, useCallback } from 'react';\n\nimport Text from '../../text/text';\nimport * as Styled from '../tabs-styled';\nimport type { ITabItemProps } from '../tabs-types';\n\nconst TabItem = ({\n tab,\n isSelected,\n onChange,\n tabUnderlineColor = 'WHITE_T_15',\n selectedTabUnderlineColor = 'WHITE',\n activeTabTextProps = { $renderAs: 'ub2-bold' },\n inactiveTabTextProps = { $renderAs: 'ub2' },\n}: ITabItemProps) => {\n const { Icon, iconPosition = 'left' } = tab;\n\n const handleClick = useCallback(() => {\n onChange(tab.id);\n }, [tab.id, onChange]);\n\n const activeTextProps = isSelected ? activeTabTextProps : inactiveTabTextProps;\n\n return (\n <Styled.TabWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $gapX={0.875}\n onClick={handleClick}\n $borderBottomColor={isSelected ? selectedTabUnderlineColor : tabUnderlineColor}\n >\n {Icon ? (\n <Styled.Icon $selected={isSelected} $iconPosition={iconPosition}>\n <Icon />\n </Styled.Icon>\n ) : undefined}\n <Text\n $align=\"center\"\n $color=\"WHITE\"\n {...activeTextProps}\n $renderAs={activeTextProps.$renderAs}\n >\n {tab.label}\n </Text>\n </Styled.TabWrapper>\n );\n};\n\nexport default memo(TabItem);\n"],"names":["TabItem","tab","isSelected","onChange","tabUnderlineColor","selectedTabUnderlineColor","activeTabTextProps","inactiveTabTextProps","Icon","iconPosition","handleClick","useCallback","activeTextProps","jsxs","Styled.TabWrapper","jsx","Styled.Icon","Text","TabItem$1","memo"],"mappings":";;;;AAMA,MAAMA,IAAU,CAAC;AAAA,EACf,KAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC,IAAoB;AAAA,EACpB,2BAAAC,IAA4B;AAAA,EAC5B,oBAAAC,IAAqB,EAAE,WAAW,WAAW;AAAA,EAC7C,sBAAAC,IAAuB,EAAE,WAAW,MAAM;AAC5C,MAAqB;AACnB,QAAM,EAAEC,MAAAA,GAAM,cAAAC,IAAe,OAAA,IAAWR,GAElCS,IAAcC,EAAY,MAAM;AACpC,IAAAR,EAASF,EAAI,EAAE;AAAA,EACd,GAAA,CAACA,EAAI,IAAIE,CAAQ,CAAC,GAEfS,IAAkBV,IAAaI,IAAqBC;AAGxD,SAAA,gBAAAM;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,gBAAe;AAAA,MACf,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,OAAO;AAAA,MACP,SAASJ;AAAA,MACT,oBAAoBR,IAAaG,IAA4BD;AAAA,MAE5D,UAAA;AAAA,QACCI,IAAA,gBAAAO,EAACC,GAAA,EAAY,WAAWd,GAAY,eAAeO,GACjD,UAAA,gBAAAM,EAACP,GAAK,CAAA,CAAA,EACR,CAAA,IACE;AAAA,QACJ,gBAAAO;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,QAAO;AAAA,YACP,QAAO;AAAA,YACN,GAAGL;AAAA,YACJ,WAAWA,EAAgB;AAAA,YAE1B,UAAIX,EAAA;AAAA,UAAA;AAAA,QACP;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeiB,IAAAC,EAAKnB,CAAO;"}
1
+ {"version":3,"file":"tab-item.js","sources":["../../../../../src/features/ui/tabs/tab-tem/tab-item.tsx"],"sourcesContent":["import { memo, useCallback, useMemo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Text from '../../text/text';\nimport type { TColorNames, TTextVariants } from '../../types';\nimport * as Styled from '../tabs-styled';\nimport type { ITabItemProps } from '../tabs-types';\n\nconst TabItemComponent = <TId extends string = string>({\n tab,\n isSelected,\n onChange,\n theme,\n layout,\n height,\n minWidth,\n}: ITabItemProps<TId>) => {\n const { tabs: tabsTheme } = useTheme();\n const { Icon, iconPosition = 'left', disabled = false } = tab;\n const themeConfig = tabsTheme[theme];\n const tabState = useMemo(() => {\n if (disabled) return 'disabled';\n\n if (isSelected) return 'active';\n\n return 'inactive';\n }, [disabled, isSelected]);\n const textConfig = themeConfig.text[tabState];\n const underlineColor: TColorNames =\n tabState === 'active' ? themeConfig.underline[tabState] : 'TRANSPARENT';\n const iconColor = themeConfig.icon[tabState];\n\n const handleClick = useCallback(() => {\n if (!disabled) {\n onChange(tab.id);\n }\n }, [tab.id, onChange, disabled]);\n\n return (\n <Styled.TabWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $gutterX={1}\n onClick={handleClick}\n $borderBottomColor={underlineColor}\n $disabled={disabled}\n $layout={layout}\n $theme={theme}\n $isSelected={isSelected}\n $height={height}\n $minWidth={minWidth}\n >\n {Icon && isSelected && !disabled ? (\n <Styled.Icon $iconPosition={iconPosition} $iconColor={iconColor}>\n <Icon />\n </Styled.Icon>\n ) : undefined}\n <Text\n $align=\"center\"\n $color={textConfig.color}\n $renderAs={textConfig.variant as TTextVariants}\n >\n {tab.label}\n </Text>\n </Styled.TabWrapper>\n );\n};\n\nconst TabItem = memo(TabItemComponent) as <TId extends string = string>(\n props: ITabItemProps<TId>,\n) => React.ReactElement;\n\nexport default TabItem;\n"],"names":["TabItemComponent","tab","isSelected","onChange","theme","layout","height","minWidth","tabsTheme","useTheme","Icon","iconPosition","disabled","themeConfig","tabState","useMemo","textConfig","underlineColor","iconColor","handleClick","useCallback","jsxs","Styled.TabWrapper","jsx","Styled.Icon","Text","TabItem","memo"],"mappings":";;;;;AAQA,MAAMA,IAAmB,CAA8B;AAAA,EACrD,KAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AACF,MAA0B;AACxB,QAAM,EAAE,MAAMC,EAAU,IAAIC,EAAS,GAC/B,EAAA,MAAEC,GAAM,cAAAC,IAAe,QAAQ,UAAAC,IAAW,GAAU,IAAAX,GACpDY,IAAcL,EAAUJ,CAAK,GAC7BU,IAAWC,EAAQ,MACnBH,IAAiB,aAEjBV,IAAmB,WAEhB,YACN,CAACU,GAAUV,CAAU,CAAC,GACnBc,IAAaH,EAAY,KAAKC,CAAQ,GACtCG,IACJH,MAAa,WAAWD,EAAY,UAAUC,CAAQ,IAAI,eACtDI,IAAYL,EAAY,KAAKC,CAAQ,GAErCK,IAAcC,EAAY,MAAM;AACpC,IAAKR,KACHT,EAASF,EAAI,EAAE;AAAA,KAEhB,CAACA,EAAI,IAAIE,GAAUS,CAAQ,CAAC;AAG7B,SAAA,gBAAAS;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,gBAAe;AAAA,MACf,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,UAAU;AAAA,MACV,SAASH;AAAA,MACT,oBAAoBF;AAAA,MACpB,WAAWL;AAAA,MACX,SAASP;AAAA,MACT,QAAQD;AAAA,MACR,aAAaF;AAAA,MACb,SAASI;AAAA,MACT,WAAWC;AAAA,MAEV,UAAA;AAAA,QAAAG,KAAQR,KAAc,CAACU,IACtB,gBAAAW,EAACC,GAAA,EAAY,eAAeb,GAAc,YAAYO,GACpD,UAAC,gBAAAK,EAAAb,GAAA,CAAA,CAAK,GACR,IACE;AAAA,QACJ,gBAAAa;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,QAAO;AAAA,YACP,QAAQT,EAAW;AAAA,YACnB,WAAWA,EAAW;AAAA,YAErB,UAAIf,EAAA;AAAA,UAAA;AAAA,QACP;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEMyB,IAAUC,EAAK3B,CAAgB;"}
@@ -1,31 +1,57 @@
1
- import e from "styled-components";
2
- import i from "../layout/flex-view.js";
3
- const l = e.div(({ theme: r, $tabsCount: o, $background: t }) => {
4
- const { colors: s } = r;
1
+ import n from "styled-components";
2
+ import g from "../layout/flex-view.js";
3
+ const f = n.div(({ theme: t, $inactiveUnderlineColor: o }) => {
4
+ const { colors: r } = t;
5
5
  return `
6
- display: grid;
7
- background: ${s[t]};
8
- grid-template-columns: repeat(${o}, 1fr);
6
+ display: flex;
7
+ border-bottom: 1.5px solid ${r[o]};
8
+ position: relative;
9
9
  `;
10
- }), a = e(i)(({ $borderBottomColor: r }) => `
11
- cursor: pointer;
12
- border-bottom: 1.5px solid ${r};
10
+ }), m = n(g)(({
11
+ theme: t,
12
+ $borderBottomColor: o,
13
+ $disabled: r,
14
+ $layout: e,
15
+ $theme: l,
16
+ $isSelected: a,
17
+ $height: p,
18
+ $minWidth: s
19
+ }) => {
20
+ const { colors: i, tabs: c } = t, d = c[l], x = i[d.background.hover];
21
+ return `
22
+ cursor: ${r ? "not-allowed" : "pointer"};
23
+ border-bottom: 1.5px solid ${i[o]};
13
24
  transition: all 0.3s ease;
14
- `), d = e.div(({ theme: r, $iconPosition: o, $selected: t }) => `
25
+ height: ${p || 40}px;
26
+ ${s ? `min-width: ${s}px;` : ""}
27
+ position: relative;
28
+ margin-bottom: -1.5px;
29
+ background-color: transparent;
30
+ ${e === "fill" ? "flex: 1;" : "flex-shrink: 0;"}
31
+
32
+ ${!r && !a ? `
33
+ &:hover {
34
+ background-color: ${x};
35
+ }
36
+ ` : ""}
37
+ `;
38
+ }), $ = n.div(({ theme: t, $iconPosition: o, $iconColor: r }) => {
39
+ const { colors: e } = t;
40
+ return `
15
41
  ${o === "left" ? "padding-right" : "padding-left"}: 4px;
16
42
  order: ${o === "left" ? -1 : 1};
17
-
43
+
18
44
  & svg {
19
- display: ${t ? "block" : "none"};
20
45
  width: 16px;
21
46
  height: 16px;
22
- color: ${r.colors.WHITE_1};
47
+ color: ${e[r]};
23
48
  transition: color 0.2s ease-in-out;
24
49
  }
25
- `);
50
+ `;
51
+ });
26
52
  export {
27
- d as Icon,
28
- a as TabWrapper,
29
- l as TabsWrapper
53
+ $ as Icon,
54
+ m as TabWrapper,
55
+ f as TabsWrapper
30
56
  };
31
57
  //# sourceMappingURL=tabs-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs-styled.js","sources":["../../../../src/features/ui/tabs/tabs-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../layout/flex-view';\nimport type { TColorNames } from '../types';\nimport type { ITabItem } from './tabs-types';\n\ninterface TabsWrapperProps {\n $tabsCount: number;\n $background: TColorNames;\n}\n\nconst TabsWrapper = styled.div<TabsWrapperProps>(({ theme, $tabsCount, $background }) => {\n const { colors } = theme;\n\n return `\n display: grid;\n background: ${colors[$background]};\n grid-template-columns: repeat(${$tabsCount}, 1fr);\n `;\n});\n\ninterface ITabsText {\n $borderBottomColor: TColorNames;\n}\n\nconst TabWrapper = styled(FlexView)<ITabsText>(({ $borderBottomColor }) => {\n return `\n cursor: pointer;\n border-bottom: 1.5px solid ${$borderBottomColor};\n transition: all 0.3s ease;\n `;\n});\n\ninterface IStyledIconProps {\n $iconPosition: NonNullable<ITabItem['iconPosition']>;\n $selected: boolean;\n}\n\nconst Icon = styled.div<IStyledIconProps>(({ theme, $iconPosition, $selected }) => {\n return `\n ${$iconPosition === 'left' ? 'padding-right' : 'padding-left'}: 4px;\n order: ${$iconPosition === 'left' ? -1 : 1};\n \n & svg {\n display: ${$selected ? 'block' : 'none'};\n width: 16px;\n height: 16px;\n color: ${theme.colors.WHITE_1};\n transition: color 0.2s ease-in-out;\n }\n `;\n});\n\nexport { TabsWrapper, Icon, TabWrapper };\n"],"names":["TabsWrapper","styled","theme","$tabsCount","$background","colors","TabWrapper","FlexView","$borderBottomColor","Icon","$iconPosition","$selected"],"mappings":";;AAWM,MAAAA,IAAcC,EAAO,IAAsB,CAAC,EAAE,OAAAC,GAAO,YAAAC,GAAY,aAAAC,QAAkB;AACjF,QAAA,EAAE,QAAAC,EAAW,IAAAH;AAEZ,SAAA;AAAA;AAAA,kBAESG,EAAOD,CAAW,CAAC;AAAA,oCACDD,CAAU;AAAA;AAE9C,CAAC,GAMKG,IAAaL,EAAOM,CAAQ,EAAa,CAAC,EAAE,oBAAAC,QACzC;AAAA;AAAA,iCAEwBA,CAAkB;AAAA;AAAA,GAGlD,GAOKC,IAAOR,EAAO,IAAsB,CAAC,EAAE,OAAAC,GAAO,eAAAQ,GAAe,WAAAC,QAC1D;AAAA,MACHD,MAAkB,SAAS,kBAAkB,cAAc;AAAA,aACpDA,MAAkB,SAAS,KAAK,CAAC;AAAA;AAAA;AAAA,iBAG7BC,IAAY,UAAU,MAAM;AAAA;AAAA;AAAA,eAG9BT,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,OAIlC;"}
1
+ {"version":3,"file":"tabs-styled.js","sources":["../../../../src/features/ui/tabs/tabs-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../layout/flex-view';\nimport type { TColorNames } from '../types';\nimport type { ITabItem, TTabsLayout } from './tabs-types';\nimport type { TTabsTheme } from '../theme/tabs';\n\ninterface ITabsWrapperProps {\n $inactiveUnderlineColor: TColorNames;\n}\n\nconst TabsWrapper = styled.div<ITabsWrapperProps>(({ theme, $inactiveUnderlineColor }) => {\n const { colors } = theme;\n\n return `\n display: flex;\n border-bottom: 1.5px solid ${colors[$inactiveUnderlineColor]};\n position: relative;\n `;\n});\n\ninterface ITabWrapperProps {\n $borderBottomColor: TColorNames;\n $disabled?: boolean;\n $layout: TTabsLayout;\n $theme: TTabsTheme;\n $isSelected?: boolean;\n $height?: number;\n $minWidth?: number;\n}\n\nconst TabWrapper = styled(FlexView)<ITabWrapperProps>(({\n theme,\n $borderBottomColor,\n $disabled,\n $layout,\n $theme: tabsTheme,\n $isSelected,\n $height,\n $minWidth,\n}) => {\n const { colors, tabs } = theme;\n const tabsThemeConfig = tabs[tabsTheme];\n const hoverBackgroundColor = colors[tabsThemeConfig.background.hover];\n\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n border-bottom: 1.5px solid ${colors[$borderBottomColor]};\n transition: all 0.3s ease;\n height: ${$height || 40}px;\n ${$minWidth ? `min-width: ${$minWidth}px;` : ''}\n position: relative;\n margin-bottom: -1.5px;\n background-color: transparent;\n ${$layout === 'fill' ? 'flex: 1;' : 'flex-shrink: 0;'}\n\n ${\n !$disabled && !$isSelected\n ? `\n &:hover {\n background-color: ${hoverBackgroundColor};\n }\n `\n : ''\n }\n `;\n});\n\ninterface IStyledIconProps {\n $iconPosition: NonNullable<ITabItem['iconPosition']>;\n $iconColor: TColorNames;\n}\n\nconst Icon = styled.div<IStyledIconProps>(({ theme, $iconPosition, $iconColor }) => {\n const { colors } = theme;\n\n return `\n ${$iconPosition === 'left' ? 'padding-right' : 'padding-left'}: 4px;\n order: ${$iconPosition === 'left' ? -1 : 1};\n\n & svg {\n width: 16px;\n height: 16px;\n color: ${colors[$iconColor]};\n transition: color 0.2s ease-in-out;\n }\n `;\n});\n\nexport { TabsWrapper, Icon, TabWrapper };\n"],"names":["TabsWrapper","styled","theme","$inactiveUnderlineColor","colors","TabWrapper","FlexView","$borderBottomColor","$disabled","$layout","tabsTheme","$isSelected","$height","$minWidth","tabs","tabsThemeConfig","hoverBackgroundColor","Icon","$iconPosition","$iconColor"],"mappings":";;AAWA,MAAMA,IAAcC,EAAO,IAAuB,CAAC,EAAE,OAAAC,GAAO,yBAAAC,QAA8B;AAClF,QAAA,EAAE,QAAAC,EAAW,IAAAF;AAEZ,SAAA;AAAA;AAAA,iCAEwBE,EAAOD,CAAuB,CAAC;AAAA;AAAA;AAGhE,CAAC,GAYKE,IAAaJ,EAAOK,CAAQ,EAAoB,CAAC;AAAA,EACrD,OAAAJ;AAAA,EACA,oBAAAK;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAQC;AAAA,EACR,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AACF,MAAM;AACE,QAAA,EAAE,QAAAT,GAAQ,MAAAU,EAAS,IAAAZ,GACnBa,IAAkBD,EAAKJ,CAAS,GAChCM,IAAuBZ,EAAOW,EAAgB,WAAW,KAAK;AAE7D,SAAA;AAAA,cACKP,IAAY,gBAAgB,SAAS;AAAA,iCAClBJ,EAAOG,CAAkB,CAAC;AAAA;AAAA,cAE7CK,KAAW,EAAE;AAAA,MACrBC,IAAY,cAAcA,CAAS,QAAQ,EAAE;AAAA;AAAA;AAAA;AAAA,MAI7CJ,MAAY,SAAS,aAAa,iBAAiB;AAAA;AAAA,MAGnD,CAACD,KAAa,CAACG,IACX;AAAA;AAAA,4BAEkBK,CAAoB;AAAA;AAAA,QAGtC,EACN;AAAA;AAEJ,CAAC,GAOKC,IAAOhB,EAAO,IAAsB,CAAC,EAAE,OAAAC,GAAO,eAAAgB,GAAe,YAAAC,QAAiB;AAC5E,QAAA,EAAE,QAAAf,EAAW,IAAAF;AAEZ,SAAA;AAAA,MACHgB,MAAkB,SAAS,kBAAkB,cAAc;AAAA,aACpDA,MAAkB,SAAS,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,eAK/Bd,EAAOe,CAAU,CAAC;AAAA;AAAA;AAAA;AAIjC,CAAC;"}
@@ -1,30 +1,33 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { memo as a } from "react";
3
- import b from "./tab-tem/tab-item.js";
4
- import { TabsWrapper as u } from "./tabs-styled.js";
5
- const c = ({
6
- selectedTab: m,
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { memo as d } from "react";
3
+ import { useTheme as f } from "styled-components";
4
+ import l from "./tab-tem/tab-item.js";
5
+ import { TabsWrapper as T } from "./tabs-styled.js";
6
+ const b = d(function({
7
+ selectedTab: i,
7
8
  onChange: t,
8
- tabs: e,
9
- tabUnderlineColor: s,
10
- selectedTabUnderlineColor: d,
11
- background: n = "BLACK_4",
12
- activeTabTextProps: i = { $renderAs: "ub2-bold" },
13
- inactiveTabTextProps: p = { $renderAs: "ub2" }
14
- }) => /* @__PURE__ */ o(u, { $tabsCount: e.length, $background: n, children: e.map((r) => /* @__PURE__ */ o(
15
- b,
16
- {
17
- tab: r,
18
- isSelected: r.id === m,
19
- onChange: t,
20
- inactiveTabTextProps: p,
21
- activeTabTextProps: i,
22
- tabUnderlineColor: s,
23
- selectedTabUnderlineColor: d
24
- },
25
- r.id
26
- )) }), T = a(c);
9
+ tabs: n,
10
+ theme: o = "dark",
11
+ layout: m = "compact",
12
+ height: s,
13
+ minWidth: a
14
+ }) {
15
+ const { tabs: c } = f(), p = c[o].underline.inactive;
16
+ return /* @__PURE__ */ r(T, { $inactiveUnderlineColor: p, children: n.map((e) => /* @__PURE__ */ r(
17
+ l,
18
+ {
19
+ tab: e,
20
+ isSelected: e.id === i,
21
+ onChange: t,
22
+ theme: o,
23
+ layout: m,
24
+ height: s,
25
+ minWidth: a
26
+ },
27
+ e.id
28
+ )) });
29
+ }), $ = b;
27
30
  export {
28
- T as default
31
+ $ as default
29
32
  };
30
33
  //# sourceMappingURL=tabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.js","sources":["../../../../src/features/ui/tabs/tabs.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport TabItem from './tab-tem/tab-item';\nimport * as Styled from './tabs-styled';\nimport type { ITabsProps } from './tabs-types';\n\nconst Tabs = ({\n selectedTab,\n onChange,\n tabs,\n tabUnderlineColor,\n selectedTabUnderlineColor,\n background = 'BLACK_4',\n activeTabTextProps = { $renderAs: 'ub2-bold' },\n inactiveTabTextProps = { $renderAs: 'ub2' },\n}: ITabsProps) => {\n return (\n <Styled.TabsWrapper $tabsCount={tabs.length} $background={background}>\n {tabs.map(tab => (\n <TabItem\n key={tab.id}\n tab={tab}\n isSelected={tab.id === selectedTab}\n onChange={onChange}\n inactiveTabTextProps={inactiveTabTextProps}\n activeTabTextProps={activeTabTextProps}\n tabUnderlineColor={tabUnderlineColor}\n selectedTabUnderlineColor={selectedTabUnderlineColor}\n />\n ))}\n </Styled.TabsWrapper>\n );\n};\n\nexport default memo(Tabs);\n"],"names":["Tabs","selectedTab","onChange","tabs","tabUnderlineColor","selectedTabUnderlineColor","background","activeTabTextProps","inactiveTabTextProps","jsx","Styled.TabsWrapper","tab","TabItem","memo"],"mappings":";;;;AAMA,MAAMA,IAAO,CAAC;AAAA,EACZ,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,oBAAAC,IAAqB,EAAE,WAAW,WAAW;AAAA,EAC7C,sBAAAC,IAAuB,EAAE,WAAW,MAAM;AAC5C,MAEI,gBAAAC,EAACC,GAAA,EAAmB,YAAYP,EAAK,QAAQ,aAAaG,GACvD,UAAKH,EAAA,IAAI,CACRQ,MAAA,gBAAAF;AAAA,EAACG;AAAA,EAAA;AAAA,IAEC,KAAAD;AAAA,IACA,YAAYA,EAAI,OAAOV;AAAA,IACvB,UAAAC;AAAA,IACA,sBAAAM;AAAA,IACA,oBAAAD;AAAA,IACA,mBAAAH;AAAA,IACA,2BAAAC;AAAA,EAAA;AAAA,EAPKM,EAAI;AASZ,CAAA,EACH,CAAA,GAIWR,IAAAU,EAAKb,CAAI;"}
1
+ {"version":3,"file":"tabs.js","sources":["../../../../src/features/ui/tabs/tabs.tsx"],"sourcesContent":["import { memo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport TabItem from './tab-tem/tab-item';\nimport * as Styled from './tabs-styled';\nimport type { ITabsProps } from './tabs-types';\n\nconst Tabs = memo(function Tabs<TId extends string = string>({\n selectedTab,\n onChange,\n tabs,\n theme = 'dark',\n layout = 'compact',\n height,\n minWidth,\n}: ITabsProps<TId>) {\n const { tabs: tabsTheme } = useTheme();\n const themeConfig = tabsTheme[theme];\n const inactiveUnderlineColor = themeConfig.underline.inactive;\n\n return (\n <Styled.TabsWrapper $inactiveUnderlineColor={inactiveUnderlineColor}>\n {tabs.map(tab => (\n <TabItem\n key={tab.id}\n tab={tab}\n isSelected={tab.id === selectedTab}\n onChange={onChange}\n theme={theme}\n layout={layout}\n height={height}\n minWidth={minWidth}\n />\n ))}\n </Styled.TabsWrapper>\n );\n});\n\nexport default Tabs;\n"],"names":["Tabs","memo","selectedTab","onChange","tabs","theme","layout","height","minWidth","tabsTheme","useTheme","inactiveUnderlineColor","jsx","Styled.TabsWrapper","tab","TabItem","Tabs$1"],"mappings":";;;;;AAOA,MAAMA,IAAOC,EAAK,SAA2C;AAAA,EAC3D,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,QAAAC;AAAA,EACA,UAAAC;AACF,GAAoB;AAClB,QAAM,EAAE,MAAMC,EAAU,IAAIC,EAAS,GAE/BC,IADcF,EAAUJ,CAAK,EACQ,UAAU;AAGnD,SAAA,gBAAAO,EAACC,GAAA,EAAmB,yBAAyBF,GAC1C,UAAAP,EAAK,IAAI,CACRU,MAAA,gBAAAF;AAAA,IAACG;AAAA,IAAA;AAAA,MAEC,KAAAD;AAAA,MACA,YAAYA,EAAI,OAAOZ;AAAA,MACvB,UAAAC;AAAA,MACA,OAAAE;AAAA,MACA,QAAAC;AAAA,MACA,QAAAC;AAAA,MACA,UAAAC;AAAA,IAAA;AAAA,IAPKM,EAAI;AAAA,EASZ,CAAA,EACH,CAAA;AAEJ,CAAC,GAEDE,IAAehB;"}
@@ -5,12 +5,13 @@ import g, { hues as f } from "./clrs.js";
5
5
  import { getDevice as n } from "./get-device.js";
6
6
  import p from "./input.js";
7
7
  import u from "./layout.js";
8
- import { getMediaQueries as c } from "./media-queries.js";
9
- import s from "./tab.js";
10
- import x from "./text.js";
11
- import C from "./text-button.js";
12
- import { getZIndexConfig as a } from "./z-index.js";
13
- const z = () => {
8
+ import { getMediaQueries as s } from "./media-queries.js";
9
+ import c from "./tab.js";
10
+ import C from "./tabs.js";
11
+ import a from "./text.js";
12
+ import x from "./text-button.js";
13
+ import { getZIndexConfig as T } from "./z-index.js";
14
+ const D = () => {
14
15
  const t = u(), { gutter: o, deviceWidth: e } = t;
15
16
  return {
16
17
  arrowTooltip: r(),
@@ -20,15 +21,16 @@ const z = () => {
20
21
  input: p(o),
21
22
  checkbox: m(o),
22
23
  layout: t,
23
- tab: s(t.gutter),
24
- text: x(),
25
- textButton: C(),
26
- zIndex: a(),
24
+ tab: c(t.gutter),
25
+ tabs: C(),
26
+ text: a(),
27
+ textButton: x(),
28
+ zIndex: T(),
27
29
  device: n(e),
28
- mediaQueries: c()
30
+ mediaQueries: s()
29
31
  };
30
32
  };
31
33
  export {
32
- z as getTheme
34
+ D as getTheme
33
35
  };
34
36
  //# sourceMappingURL=get-theme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-theme.js","sources":["../../../../src/features/ui/theme/get-theme.ts"],"sourcesContent":["import type { DefaultTheme } from 'styled-components';\n\nimport getArrowTooltipConfig from './arrow-tooltip';\nimport getButtonConfig from './button';\nimport getCheckboxConfig from './checkbox';\nimport getColors, { hues } from './clrs';\nimport { getDevice } from './get-device';\nimport getInputConfig from './input';\nimport getLayout from './layout';\nimport { getMediaQueries } from './media-queries';\nimport getTabConfig from './tab';\nimport getTextTypes from './text';\nimport getTextButtonConfig from './text-button';\nimport { getZIndexConfig } from './z-index';\n\nconst getTheme: () => DefaultTheme = () => {\n const layout = getLayout();\n const { gutter, deviceWidth } = layout;\n\n return {\n arrowTooltip: getArrowTooltipConfig(),\n button: getButtonConfig(gutter),\n colors: getColors(),\n hues: hues,\n input: getInputConfig(gutter),\n checkbox: getCheckboxConfig(gutter),\n layout,\n tab: getTabConfig(layout.gutter),\n text: getTextTypes(),\n textButton: getTextButtonConfig(),\n zIndex: getZIndexConfig(),\n device: getDevice(deviceWidth),\n mediaQueries: getMediaQueries(),\n };\n};\n\nexport { getTheme };\n"],"names":["getTheme","layout","getLayout","gutter","deviceWidth","getArrowTooltipConfig","getButtonConfig","getColors","hues","getInputConfig","getCheckboxConfig","getTabConfig","getTextTypes","getTextButtonConfig","getZIndexConfig","getDevice","getMediaQueries"],"mappings":";;;;;;;;;;;;AAeA,MAAMA,IAA+B,MAAM;AACzC,QAAMC,IAASC,KACT,EAAE,QAAAC,GAAQ,aAAAC,EAAgB,IAAAH;AAEzB,SAAA;AAAA,IACL,cAAcI,EAAsB;AAAA,IACpC,QAAQC,EAAgBH,CAAM;AAAA,IAC9B,QAAQI,EAAU;AAAA,IAClB,MAAAC;AAAA,IACA,OAAOC,EAAeN,CAAM;AAAA,IAC5B,UAAUO,EAAkBP,CAAM;AAAA,IAClC,QAAAF;AAAA,IACA,KAAKU,EAAaV,EAAO,MAAM;AAAA,IAC/B,MAAMW,EAAa;AAAA,IACnB,YAAYC,EAAoB;AAAA,IAChC,QAAQC,EAAgB;AAAA,IACxB,QAAQC,EAAUX,CAAW;AAAA,IAC7B,cAAcY,EAAgB;AAAA,EAAA;AAElC;"}
1
+ {"version":3,"file":"get-theme.js","sources":["../../../../src/features/ui/theme/get-theme.ts"],"sourcesContent":["import type { DefaultTheme } from 'styled-components';\n\nimport getArrowTooltipConfig from './arrow-tooltip';\nimport getButtonConfig from './button';\nimport getCheckboxConfig from './checkbox';\nimport getColors, { hues } from './clrs';\nimport { getDevice } from './get-device';\nimport getInputConfig from './input';\nimport getLayout from './layout';\nimport { getMediaQueries } from './media-queries';\nimport getTabConfig from './tab';\nimport getTabsConfig from './tabs';\nimport getTextTypes from './text';\nimport getTextButtonConfig from './text-button';\nimport { getZIndexConfig } from './z-index';\n\nconst getTheme: () => DefaultTheme = () => {\n const layout = getLayout();\n const { gutter, deviceWidth } = layout;\n\n return {\n arrowTooltip: getArrowTooltipConfig(),\n button: getButtonConfig(gutter),\n colors: getColors(),\n hues: hues,\n input: getInputConfig(gutter),\n checkbox: getCheckboxConfig(gutter),\n layout,\n tab: getTabConfig(layout.gutter),\n tabs: getTabsConfig(),\n text: getTextTypes(),\n textButton: getTextButtonConfig(),\n zIndex: getZIndexConfig(),\n device: getDevice(deviceWidth),\n mediaQueries: getMediaQueries(),\n };\n};\n\nexport { getTheme };\n"],"names":["getTheme","layout","getLayout","gutter","deviceWidth","getArrowTooltipConfig","getButtonConfig","getColors","hues","getInputConfig","getCheckboxConfig","getTabConfig","getTabsConfig","getTextTypes","getTextButtonConfig","getZIndexConfig","getDevice","getMediaQueries"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,IAA+B,MAAM;AACzC,QAAMC,IAASC,KACT,EAAE,QAAAC,GAAQ,aAAAC,EAAgB,IAAAH;AAEzB,SAAA;AAAA,IACL,cAAcI,EAAsB;AAAA,IACpC,QAAQC,EAAgBH,CAAM;AAAA,IAC9B,QAAQI,EAAU;AAAA,IAClB,MAAAC;AAAA,IACA,OAAOC,EAAeN,CAAM;AAAA,IAC5B,UAAUO,EAAkBP,CAAM;AAAA,IAClC,QAAAF;AAAA,IACA,KAAKU,EAAaV,EAAO,MAAM;AAAA,IAC/B,MAAMW,EAAc;AAAA,IACpB,MAAMC,EAAa;AAAA,IACnB,YAAYC,EAAoB;AAAA,IAChC,QAAQC,EAAgB;AAAA,IACxB,QAAQC,EAAUZ,CAAW;AAAA,IAC7B,cAAca,EAAgB;AAAA,EAAA;AAElC;"}
@@ -0,0 +1,52 @@
1
+ const a = () => ({
2
+ light: {
3
+ text: {
4
+ active: { color: "BLACK_1", variant: "ub2-bold" },
5
+ inactive: { color: "BLACK_1", variant: "ub2" },
6
+ hover: { color: "BLACK_1", variant: "ub2" },
7
+ disabled: { color: "BLACK_T_38", variant: "ub2" }
8
+ },
9
+ underline: {
10
+ active: "BLACK_1",
11
+ inactive: "BLACK_T_15",
12
+ hover: "BLACK_T_15",
13
+ disabled: "BLACK_T_15"
14
+ },
15
+ icon: {
16
+ active: "BLACK_1",
17
+ inactive: "BLACK_1",
18
+ hover: "BLACK_1",
19
+ disabled: "BLACK_T_38"
20
+ },
21
+ background: {
22
+ hover: "BLACK_T_08"
23
+ }
24
+ },
25
+ dark: {
26
+ text: {
27
+ active: { color: "WHITE", variant: "ub2-bold" },
28
+ inactive: { color: "WHITE", variant: "ub2" },
29
+ hover: { color: "WHITE", variant: "ub2" },
30
+ disabled: { color: "WHITE_T_38", variant: "ub2" }
31
+ },
32
+ underline: {
33
+ active: "WHITE",
34
+ inactive: "WHITE_T_15",
35
+ hover: "WHITE_T_15",
36
+ disabled: "WHITE_T_15"
37
+ },
38
+ icon: {
39
+ active: "WHITE",
40
+ inactive: "WHITE",
41
+ hover: "WHITE",
42
+ disabled: "WHITE_T_38"
43
+ },
44
+ background: {
45
+ hover: "WHITE_T_10"
46
+ }
47
+ }
48
+ });
49
+ export {
50
+ a as default
51
+ };
52
+ //# sourceMappingURL=tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.js","sources":["../../../../src/features/ui/theme/tabs.ts"],"sourcesContent":["import type { TColorNames } from '../types';\n\n/**\n * Theme variants for the Tabs component.\n *\n * - `light`: Dark text on light background with black hover overlay\n * - `dark`: Light text on dark background with white hover overlay\n */\nexport type TTabsTheme = 'light' | 'dark';\n\n/**\n * Theme configuration interface for tabs styling.\n * Defines colors and styles for different tab states.\n *\n * @internal\n */\ninterface ITabsThemeConfig {\n /** Text styling for different tab states */\n text: {\n active: { color: TColorNames; variant: string };\n inactive: { color: TColorNames; variant: string };\n hover: { color: TColorNames; variant: string };\n disabled: { color: TColorNames; variant: string };\n };\n /** Border bottom colors for different tab states */\n underline: {\n active: TColorNames;\n inactive: TColorNames;\n hover: TColorNames;\n disabled: TColorNames;\n };\n /** Icon colors for different tab states */\n icon: {\n active: TColorNames;\n inactive: TColorNames;\n hover: TColorNames;\n disabled: TColorNames;\n };\n /** Background overlay colors for interactive states */\n background: {\n hover: TColorNames;\n };\n}\n\ninterface IGetTabsConfig {\n (): Record<TTabsTheme, ITabsThemeConfig>;\n}\n\n/**\n * Returns the complete theme configuration for tabs component.\n * Provides styling for both light and dark themes including hover effects.\n *\n * @returns Theme configuration object with light and dark variants\n * @internal\n */\nconst getTabsConfig: IGetTabsConfig = () => ({\n light: {\n text: {\n active: { color: 'BLACK_1', variant: 'ub2-bold' },\n inactive: { color: 'BLACK_1', variant: 'ub2' },\n hover: { color: 'BLACK_1', variant: 'ub2' },\n disabled: { color: 'BLACK_T_38', variant: 'ub2' },\n },\n underline: {\n active: 'BLACK_1',\n inactive: 'BLACK_T_15',\n hover: 'BLACK_T_15',\n disabled: 'BLACK_T_15',\n },\n icon: {\n active: 'BLACK_1',\n inactive: 'BLACK_1',\n hover: 'BLACK_1',\n disabled: 'BLACK_T_38',\n },\n background: {\n hover: 'BLACK_T_08',\n },\n },\n dark: {\n text: {\n active: { color: 'WHITE', variant: 'ub2-bold' },\n inactive: { color: 'WHITE', variant: 'ub2' },\n hover: { color: 'WHITE', variant: 'ub2' },\n disabled: { color: 'WHITE_T_38', variant: 'ub2' },\n },\n underline: {\n active: 'WHITE',\n inactive: 'WHITE_T_15',\n hover: 'WHITE_T_15',\n disabled: 'WHITE_T_15',\n },\n icon: {\n active: 'WHITE',\n inactive: 'WHITE',\n hover: 'WHITE',\n disabled: 'WHITE_T_38',\n },\n background: {\n hover: 'WHITE_T_10',\n },\n },\n});\n\nexport default getTabsConfig;\nexport type { ITabsThemeConfig };\n"],"names":["getTabsConfig"],"mappings":"AAuDA,MAAMA,IAAgC,OAAO;AAAA,EAC3C,OAAO;AAAA,IACL,MAAM;AAAA,MACJ,QAAQ,EAAE,OAAO,WAAW,SAAS,WAAW;AAAA,MAChD,UAAU,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,MAC7C,OAAO,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,MAC1C,UAAU,EAAE,OAAO,cAAc,SAAS,MAAM;AAAA,IAClD;AAAA,IACA,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,IACA,YAAY;AAAA,MACV,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,MACJ,QAAQ,EAAE,OAAO,SAAS,SAAS,WAAW;AAAA,MAC9C,UAAU,EAAE,OAAO,SAAS,SAAS,MAAM;AAAA,MAC3C,OAAO,EAAE,OAAO,SAAS,SAAS,MAAM;AAAA,MACxC,UAAU,EAAE,OAAO,cAAc,SAAS,MAAM;AAAA,IAClD;AAAA,IACA,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,IACA,YAAY;AAAA,MACV,OAAO;AAAA,IACT;AAAA,EACF;AACF;"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { ButtonHTMLAttributes } from 'react';
2
2
  import { Channel } from '@cuemath/cue-message-broker';
3
3
  import { ChannelStatus } from '@cuemath/cue-message-broker';
4
- import { ComponentProps } from 'react';
5
4
  import { ComponentType } from 'react';
6
5
  import { Config } from '@lottiefiles/dotlottie-web';
7
6
  import { Context } from 'react';
@@ -780,6 +779,8 @@ export declare const getPreferencesFromConfig: IGetPreferencesFromConfig;
780
779
 
781
780
  declare const getTabConfig: IGetTabConfig;
782
781
 
782
+ /* Excluded from this release type: getTabsConfig */
783
+
783
784
  declare const getTextButtonConfig: IGetTextButtonConfig;
784
785
 
785
786
  declare function getTextTypes(multiplier?: number): Record<TTextVariants, ITextConfig>;
@@ -1881,6 +1882,10 @@ declare interface IGetTabConfig {
1881
1882
  };
1882
1883
  }
1883
1884
 
1885
+ declare interface IGetTabsConfig {
1886
+ (): Record<TTabsTheme, ITabsThemeConfig>;
1887
+ }
1888
+
1884
1889
  declare interface IGetTextButtonConfig {
1885
1890
  (): {
1886
1891
  sizes: Record<TTextButtonSizes, ITextButtonSizeConfig>;
@@ -4115,11 +4120,40 @@ declare interface ISyncableWebGameProps {
4115
4120
  enableSync?: boolean;
4116
4121
  }
4117
4122
 
4118
- declare interface ITabItem {
4119
- id: string;
4123
+ /**
4124
+ * Configuration for an individual tab item.
4125
+ *
4126
+ * @template TId - The type for tab identifiers (must extend string)
4127
+ *
4128
+ * @example
4129
+ * ```typescript
4130
+ * type TabId = 'home' | 'profile' | 'settings';
4131
+ *
4132
+ * const tabItem: ITabItem<TabId> = {
4133
+ * id: 'home',
4134
+ * label: 'Home',
4135
+ * Icon: HomeIcon,
4136
+ * iconPosition: 'left'
4137
+ * };
4138
+ * ```
4139
+ */
4140
+ declare interface ITabItem<TId extends string = string> {
4141
+ /** Unique identifier for the tab. Must be type-safe and match the selectedTab type. */
4142
+ id: TId;
4143
+ /** Display text for the tab */
4120
4144
  label: string;
4145
+ /** Position of the icon relative to the label. Defaults to 'left' if Icon is provided. */
4121
4146
  iconPosition?: 'left' | 'right';
4147
+ /**
4148
+ * Optional React component for the tab icon. Should be an SVG component that accepts SVGProps.
4149
+ * Icons are only shown when the tab is selected and not disabled.
4150
+ */
4122
4151
  Icon?: React.FC<React.SVGProps<SVGSVGElement>>;
4152
+ /**
4153
+ * Whether the tab is disabled. Disabled tabs show a "not-allowed" cursor,
4154
+ * cannot be clicked, and have reduced opacity.
4155
+ */
4156
+ disabled?: boolean;
4123
4157
  }
4124
4158
 
4125
4159
  export declare interface ITable {
@@ -4189,17 +4223,114 @@ export declare interface ITabSizeConfig {
4189
4223
  textVariant: TTextVariants;
4190
4224
  }
4191
4225
 
4192
- declare interface ITabsProps {
4193
- selectedTab: string;
4194
- onChange: (tab: string) => void;
4195
- tabs: ITabItem[];
4196
- background?: TColorNames;
4197
- tabUnderlineColor?: TColorNames;
4198
- selectedTabUnderlineColor?: TColorNames;
4199
- activeTabTextProps?: ComponentProps<typeof Text_2>;
4200
- inactiveTabTextProps?: ComponentProps<typeof Text_2>;
4226
+ /**
4227
+ * Props for the Tabs component - a horizontal tab navigation with theme support.
4228
+ *
4229
+ * @template TId - The type for tab identifiers (must extend string). This ensures
4230
+ * type safety between the selectedTab prop and the ids in the tabs array.
4231
+ *
4232
+ * @example
4233
+ * Basic usage:
4234
+ * ```typescript
4235
+ * type TabId = 'overview' | 'details' | 'settings';
4236
+ *
4237
+ * const [selectedTab, setSelectedTab] = useState<TabId>('overview');
4238
+ *
4239
+ * <Tabs
4240
+ * selectedTab={selectedTab}
4241
+ * onChange={setSelectedTab}
4242
+ * tabs={[
4243
+ * { id: 'overview', label: 'Overview' },
4244
+ * { id: 'details', label: 'Details', Icon: DetailsIcon },
4245
+ * { id: 'settings', label: 'Settings', disabled: true }
4246
+ * ]}
4247
+ * theme="light"
4248
+ * layout="fill"
4249
+ * />
4250
+ * ```
4251
+ *
4252
+ * @example
4253
+ * With icons and positioning:
4254
+ * ```typescript
4255
+ * <Tabs
4256
+ * selectedTab="profile"
4257
+ * onChange={(tabId) => console.log('Selected:', tabId)}
4258
+ * tabs={[
4259
+ * { id: 'home', label: 'Home', Icon: HomeIcon },
4260
+ * { id: 'profile', label: 'Profile', Icon: UserIcon, iconPosition: 'right' },
4261
+ * { id: 'settings', label: 'Settings', Icon: SettingsIcon }
4262
+ * ]}
4263
+ * theme="dark"
4264
+ * />
4265
+ * ```
4266
+ */
4267
+ declare interface ITabsProps<TId extends string = string> {
4268
+ /**
4269
+ * The currently selected tab ID. Must match one of the IDs in the tabs array.
4270
+ * TypeScript will enforce this relationship when TId is a union type.
4271
+ */
4272
+ selectedTab: TId;
4273
+ /**
4274
+ * Callback fired when a tab is clicked. Receives the clicked tab's ID.
4275
+ * This will not be called for disabled tabs.
4276
+ */
4277
+ onChange: (tab: TId) => void;
4278
+ /**
4279
+ * Array of tab configurations. Each tab must have a unique ID that matches
4280
+ * the TId type parameter for type safety.
4281
+ */
4282
+ tabs: ITabItem<TId>[];
4283
+ /**
4284
+ * Visual theme for the tabs. Affects colors, hover states, and styling.
4285
+ * Defaults to 'dark' if not specified.
4286
+ *
4287
+ * - `light`: Dark text on light background with subtle black hover overlay
4288
+ * - `dark`: Light text on dark background with subtle white hover overlay
4289
+ */
4290
+ theme?: TTabsTheme;
4291
+ /**
4292
+ * Layout behavior for the tabs container.
4293
+ * Defaults to 'compact' if not specified.
4294
+ *
4295
+ * - `compact`: Tabs only take required space, extra space shows inactive border
4296
+ * - `fill`: Tabs expand evenly to fill the entire container width
4297
+ */
4298
+ layout?: TTabsLayout;
4299
+ /**
4300
+ * Custom height for individual tabs in pixels.
4301
+ * Defaults to 40px if not specified.
4302
+ *
4303
+ * @example
4304
+ * ```typescript
4305
+ * // Default height (40px)
4306
+ * <Tabs selectedTab="home" onChange={handleChange} tabs={tabsData} />
4307
+ *
4308
+ * // Custom height
4309
+ * <Tabs height={60} selectedTab="home" onChange={handleChange} tabs={tabsData} />
4310
+ * ```
4311
+ */
4312
+ height?: number;
4313
+ /**
4314
+ * Minimum width for individual tabs in pixels.
4315
+ * Tabs will auto-size based on content if not specified.
4316
+ *
4317
+ * @example
4318
+ * ```typescript
4319
+ * // Auto width (default)
4320
+ * <Tabs selectedTab="home" onChange={handleChange} tabs={tabsData} />
4321
+ *
4322
+ * // Minimum width for consistent sizing
4323
+ * <Tabs minWidth={120} selectedTab="home" onChange={handleChange} tabs={tabsData} />
4324
+ *
4325
+ * // Combined with height for full control
4326
+ * <Tabs height={50} minWidth={100} selectedTab="home" onChange={handleChange} tabs={tabsData} />
4327
+ * ```
4328
+ */
4329
+ minWidth?: number;
4201
4330
  }
4202
4331
 
4332
+ /* Excluded from this release type: ITabsThemeConfig */
4333
+
4203
4334
  export declare interface ITabVariantConfig {
4204
4335
  backgroundColorName: {
4205
4336
  inactive: TColorNames;
@@ -4339,6 +4470,7 @@ export declare interface ITheme {
4339
4470
  input: ReturnType<typeof getInputConfig>;
4340
4471
  layout: ReturnType<typeof getLayout>;
4341
4472
  tab: ReturnType<typeof getTabConfig>;
4473
+ tabs: ReturnType<typeof getTabsConfig>;
4342
4474
  text: ReturnType<typeof getTextTypes>;
4343
4475
  textButton: ReturnType<typeof getTextButtonConfig>;
4344
4476
  zIndex: ReturnType<typeof getZIndexConfig>;
@@ -6023,7 +6155,7 @@ declare const TAB_CODES: {
6023
6155
 
6024
6156
  export declare const TabComponent: FC<ITabProps>;
6025
6157
 
6026
- export declare const Tabs: MemoExoticComponent<({ selectedTab, onChange, tabs, tabUnderlineColor, selectedTabUnderlineColor, background, activeTabTextProps, inactiveTabTextProps, }: ITabsProps) => JSX.Element>;
6158
+ export declare const Tabs: MemoExoticComponent<(<TId extends string = string>({ selectedTab, onChange, tabs, theme, layout, height, minWidth, }: ITabsProps<TId>) => JSX.Element)>;
6027
6159
 
6028
6160
  export declare type TAction = EventToPayload<TInclassMessage>;
6029
6161
 
@@ -7154,6 +7286,21 @@ export declare type TTableMode = 'random' | 'sequence' | 'advance' | 'infinite';
7154
7286
 
7155
7287
  export declare type TTabSizes = 'xsmall' | 'small' | 'regular' | 'medium';
7156
7288
 
7289
+ /**
7290
+ * Layout options for the tabs component.
7291
+ * - `compact`: Tabs only take up the space they need, leaving extra space after the last tab
7292
+ * - `fill`: Tabs expand evenly to fill the entire container width
7293
+ */
7294
+ declare type TTabsLayout = 'compact' | 'fill';
7295
+
7296
+ /**
7297
+ * Theme variants for the Tabs component.
7298
+ *
7299
+ * - `light`: Dark text on light background with black hover overlay
7300
+ * - `dark`: Light text on dark background with white hover overlay
7301
+ */
7302
+ declare type TTabsTheme = 'light' | 'dark';
7303
+
7157
7304
  export declare type TTabVariants = 'primary' | 'secondary';
7158
7305
 
7159
7306
  declare type TTestDifficultyLevel = 'EASY' | 'MODERATE' | 'DIFFICULT';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.5.43",
3
+ "version": "3.5.44-gg1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"