@cuemath/leap 3.5.44 → 3.5.45
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/dist/features/ui/tabs/tab-tem/tab-item.js +35 -29
- package/dist/features/ui/tabs/tab-tem/tab-item.js.map +1 -1
- package/dist/features/ui/tabs/tabs-styled.js +44 -18
- package/dist/features/ui/tabs/tabs-styled.js.map +1 -1
- package/dist/features/ui/tabs/tabs.js +29 -26
- package/dist/features/ui/tabs/tabs.js.map +1 -1
- package/dist/features/ui/theme/get-theme.js +14 -12
- package/dist/features/ui/theme/get-theme.js.map +1 -1
- package/dist/features/ui/theme/tabs.js +52 -0
- package/dist/features/ui/theme/tabs.js.map +1 -0
- package/dist/index.d.ts +160 -13
- package/package.json +1 -1
|
@@ -1,45 +1,51 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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:
|
|
15
|
-
|
|
16
|
-
}, [
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
|
|
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
|
-
$
|
|
24
|
-
onClick:
|
|
25
|
-
$borderBottomColor:
|
|
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
|
-
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
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:
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
},
|
|
47
|
+
}, w = T(A);
|
|
42
48
|
export {
|
|
43
|
-
|
|
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
|
|
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
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
const { colors:
|
|
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:
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
display: flex;
|
|
7
|
+
border-bottom: 1.5px solid ${r[o]};
|
|
8
|
+
position: relative;
|
|
9
9
|
`;
|
|
10
|
-
}),
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
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
|
|
47
|
+
color: ${e[r]};
|
|
23
48
|
transition: color 0.2s ease-in-out;
|
|
24
49
|
}
|
|
25
|
-
|
|
50
|
+
`;
|
|
51
|
+
});
|
|
26
52
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
|
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
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
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:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
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:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
tab: c(t.gutter),
|
|
25
|
+
tabs: C(),
|
|
26
|
+
text: a(),
|
|
27
|
+
textButton: x(),
|
|
28
|
+
zIndex: T(),
|
|
27
29
|
device: n(e),
|
|
28
|
-
mediaQueries:
|
|
30
|
+
mediaQueries: s()
|
|
29
31
|
};
|
|
30
32
|
};
|
|
31
33
|
export {
|
|
32
|
-
|
|
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":"
|
|
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>;
|
|
@@ -4124,11 +4129,40 @@ declare interface ISyncableWebGameProps {
|
|
|
4124
4129
|
enableSync?: boolean;
|
|
4125
4130
|
}
|
|
4126
4131
|
|
|
4127
|
-
|
|
4128
|
-
|
|
4132
|
+
/**
|
|
4133
|
+
* Configuration for an individual tab item.
|
|
4134
|
+
*
|
|
4135
|
+
* @template TId - The type for tab identifiers (must extend string)
|
|
4136
|
+
*
|
|
4137
|
+
* @example
|
|
4138
|
+
* ```typescript
|
|
4139
|
+
* type TabId = 'home' | 'profile' | 'settings';
|
|
4140
|
+
*
|
|
4141
|
+
* const tabItem: ITabItem<TabId> = {
|
|
4142
|
+
* id: 'home',
|
|
4143
|
+
* label: 'Home',
|
|
4144
|
+
* Icon: HomeIcon,
|
|
4145
|
+
* iconPosition: 'left'
|
|
4146
|
+
* };
|
|
4147
|
+
* ```
|
|
4148
|
+
*/
|
|
4149
|
+
declare interface ITabItem<TId extends string = string> {
|
|
4150
|
+
/** Unique identifier for the tab. Must be type-safe and match the selectedTab type. */
|
|
4151
|
+
id: TId;
|
|
4152
|
+
/** Display text for the tab */
|
|
4129
4153
|
label: string;
|
|
4154
|
+
/** Position of the icon relative to the label. Defaults to 'left' if Icon is provided. */
|
|
4130
4155
|
iconPosition?: 'left' | 'right';
|
|
4156
|
+
/**
|
|
4157
|
+
* Optional React component for the tab icon. Should be an SVG component that accepts SVGProps.
|
|
4158
|
+
* Icons are only shown when the tab is selected and not disabled.
|
|
4159
|
+
*/
|
|
4131
4160
|
Icon?: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
4161
|
+
/**
|
|
4162
|
+
* Whether the tab is disabled. Disabled tabs show a "not-allowed" cursor,
|
|
4163
|
+
* cannot be clicked, and have reduced opacity.
|
|
4164
|
+
*/
|
|
4165
|
+
disabled?: boolean;
|
|
4132
4166
|
}
|
|
4133
4167
|
|
|
4134
4168
|
export declare interface ITable {
|
|
@@ -4198,17 +4232,114 @@ export declare interface ITabSizeConfig {
|
|
|
4198
4232
|
textVariant: TTextVariants;
|
|
4199
4233
|
}
|
|
4200
4234
|
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4235
|
+
/**
|
|
4236
|
+
* Props for the Tabs component - a horizontal tab navigation with theme support.
|
|
4237
|
+
*
|
|
4238
|
+
* @template TId - The type for tab identifiers (must extend string). This ensures
|
|
4239
|
+
* type safety between the selectedTab prop and the ids in the tabs array.
|
|
4240
|
+
*
|
|
4241
|
+
* @example
|
|
4242
|
+
* Basic usage:
|
|
4243
|
+
* ```typescript
|
|
4244
|
+
* type TabId = 'overview' | 'details' | 'settings';
|
|
4245
|
+
*
|
|
4246
|
+
* const [selectedTab, setSelectedTab] = useState<TabId>('overview');
|
|
4247
|
+
*
|
|
4248
|
+
* <Tabs
|
|
4249
|
+
* selectedTab={selectedTab}
|
|
4250
|
+
* onChange={setSelectedTab}
|
|
4251
|
+
* tabs={[
|
|
4252
|
+
* { id: 'overview', label: 'Overview' },
|
|
4253
|
+
* { id: 'details', label: 'Details', Icon: DetailsIcon },
|
|
4254
|
+
* { id: 'settings', label: 'Settings', disabled: true }
|
|
4255
|
+
* ]}
|
|
4256
|
+
* theme="light"
|
|
4257
|
+
* layout="fill"
|
|
4258
|
+
* />
|
|
4259
|
+
* ```
|
|
4260
|
+
*
|
|
4261
|
+
* @example
|
|
4262
|
+
* With icons and positioning:
|
|
4263
|
+
* ```typescript
|
|
4264
|
+
* <Tabs
|
|
4265
|
+
* selectedTab="profile"
|
|
4266
|
+
* onChange={(tabId) => console.log('Selected:', tabId)}
|
|
4267
|
+
* tabs={[
|
|
4268
|
+
* { id: 'home', label: 'Home', Icon: HomeIcon },
|
|
4269
|
+
* { id: 'profile', label: 'Profile', Icon: UserIcon, iconPosition: 'right' },
|
|
4270
|
+
* { id: 'settings', label: 'Settings', Icon: SettingsIcon }
|
|
4271
|
+
* ]}
|
|
4272
|
+
* theme="dark"
|
|
4273
|
+
* />
|
|
4274
|
+
* ```
|
|
4275
|
+
*/
|
|
4276
|
+
declare interface ITabsProps<TId extends string = string> {
|
|
4277
|
+
/**
|
|
4278
|
+
* The currently selected tab ID. Must match one of the IDs in the tabs array.
|
|
4279
|
+
* TypeScript will enforce this relationship when TId is a union type.
|
|
4280
|
+
*/
|
|
4281
|
+
selectedTab: TId;
|
|
4282
|
+
/**
|
|
4283
|
+
* Callback fired when a tab is clicked. Receives the clicked tab's ID.
|
|
4284
|
+
* This will not be called for disabled tabs.
|
|
4285
|
+
*/
|
|
4286
|
+
onChange: (tab: TId) => void;
|
|
4287
|
+
/**
|
|
4288
|
+
* Array of tab configurations. Each tab must have a unique ID that matches
|
|
4289
|
+
* the TId type parameter for type safety.
|
|
4290
|
+
*/
|
|
4291
|
+
tabs: ITabItem<TId>[];
|
|
4292
|
+
/**
|
|
4293
|
+
* Visual theme for the tabs. Affects colors, hover states, and styling.
|
|
4294
|
+
* Defaults to 'dark' if not specified.
|
|
4295
|
+
*
|
|
4296
|
+
* - `light`: Dark text on light background with subtle black hover overlay
|
|
4297
|
+
* - `dark`: Light text on dark background with subtle white hover overlay
|
|
4298
|
+
*/
|
|
4299
|
+
theme?: TTabsTheme;
|
|
4300
|
+
/**
|
|
4301
|
+
* Layout behavior for the tabs container.
|
|
4302
|
+
* Defaults to 'compact' if not specified.
|
|
4303
|
+
*
|
|
4304
|
+
* - `compact`: Tabs only take required space, extra space shows inactive border
|
|
4305
|
+
* - `fill`: Tabs expand evenly to fill the entire container width
|
|
4306
|
+
*/
|
|
4307
|
+
layout?: TTabsLayout;
|
|
4308
|
+
/**
|
|
4309
|
+
* Custom height for individual tabs in pixels.
|
|
4310
|
+
* Defaults to 40px if not specified.
|
|
4311
|
+
*
|
|
4312
|
+
* @example
|
|
4313
|
+
* ```typescript
|
|
4314
|
+
* // Default height (40px)
|
|
4315
|
+
* <Tabs selectedTab="home" onChange={handleChange} tabs={tabsData} />
|
|
4316
|
+
*
|
|
4317
|
+
* // Custom height
|
|
4318
|
+
* <Tabs height={60} selectedTab="home" onChange={handleChange} tabs={tabsData} />
|
|
4319
|
+
* ```
|
|
4320
|
+
*/
|
|
4321
|
+
height?: number;
|
|
4322
|
+
/**
|
|
4323
|
+
* Minimum width for individual tabs in pixels.
|
|
4324
|
+
* Tabs will auto-size based on content if not specified.
|
|
4325
|
+
*
|
|
4326
|
+
* @example
|
|
4327
|
+
* ```typescript
|
|
4328
|
+
* // Auto width (default)
|
|
4329
|
+
* <Tabs selectedTab="home" onChange={handleChange} tabs={tabsData} />
|
|
4330
|
+
*
|
|
4331
|
+
* // Minimum width for consistent sizing
|
|
4332
|
+
* <Tabs minWidth={120} selectedTab="home" onChange={handleChange} tabs={tabsData} />
|
|
4333
|
+
*
|
|
4334
|
+
* // Combined with height for full control
|
|
4335
|
+
* <Tabs height={50} minWidth={100} selectedTab="home" onChange={handleChange} tabs={tabsData} />
|
|
4336
|
+
* ```
|
|
4337
|
+
*/
|
|
4338
|
+
minWidth?: number;
|
|
4210
4339
|
}
|
|
4211
4340
|
|
|
4341
|
+
/* Excluded from this release type: ITabsThemeConfig */
|
|
4342
|
+
|
|
4212
4343
|
export declare interface ITabVariantConfig {
|
|
4213
4344
|
backgroundColorName: {
|
|
4214
4345
|
inactive: TColorNames;
|
|
@@ -4348,6 +4479,7 @@ export declare interface ITheme {
|
|
|
4348
4479
|
input: ReturnType<typeof getInputConfig>;
|
|
4349
4480
|
layout: ReturnType<typeof getLayout>;
|
|
4350
4481
|
tab: ReturnType<typeof getTabConfig>;
|
|
4482
|
+
tabs: ReturnType<typeof getTabsConfig>;
|
|
4351
4483
|
text: ReturnType<typeof getTextTypes>;
|
|
4352
4484
|
textButton: ReturnType<typeof getTextButtonConfig>;
|
|
4353
4485
|
zIndex: ReturnType<typeof getZIndexConfig>;
|
|
@@ -6034,7 +6166,7 @@ declare const TAB_CODES: {
|
|
|
6034
6166
|
|
|
6035
6167
|
export declare const TabComponent: FC<ITabProps>;
|
|
6036
6168
|
|
|
6037
|
-
export declare const Tabs: MemoExoticComponent<({ selectedTab, onChange, tabs,
|
|
6169
|
+
export declare const Tabs: MemoExoticComponent<(<TId extends string = string>({ selectedTab, onChange, tabs, theme, layout, height, minWidth, }: ITabsProps<TId>) => JSX.Element)>;
|
|
6038
6170
|
|
|
6039
6171
|
export declare type TAction = EventToPayload<TInclassMessage>;
|
|
6040
6172
|
|
|
@@ -7165,6 +7297,21 @@ export declare type TTableMode = 'random' | 'sequence' | 'advance' | 'infinite';
|
|
|
7165
7297
|
|
|
7166
7298
|
export declare type TTabSizes = 'xsmall' | 'small' | 'regular' | 'medium';
|
|
7167
7299
|
|
|
7300
|
+
/**
|
|
7301
|
+
* Layout options for the tabs component.
|
|
7302
|
+
* - `compact`: Tabs only take up the space they need, leaving extra space after the last tab
|
|
7303
|
+
* - `fill`: Tabs expand evenly to fill the entire container width
|
|
7304
|
+
*/
|
|
7305
|
+
declare type TTabsLayout = 'compact' | 'fill';
|
|
7306
|
+
|
|
7307
|
+
/**
|
|
7308
|
+
* Theme variants for the Tabs component.
|
|
7309
|
+
*
|
|
7310
|
+
* - `light`: Dark text on light background with black hover overlay
|
|
7311
|
+
* - `dark`: Light text on dark background with white hover overlay
|
|
7312
|
+
*/
|
|
7313
|
+
declare type TTabsTheme = 'light' | 'dark';
|
|
7314
|
+
|
|
7168
7315
|
export declare type TTabVariants = 'primary' | 'secondary';
|
|
7169
7316
|
|
|
7170
7317
|
declare type TTestDifficultyLevel = 'EASY' | 'MODERATE' | 'DIFFICULT';
|