@bikdotai/bik-component-library 0.0.835-beta.2 → 0.0.835
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/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
- package/dist/cjs/components/button/Button.styled.js +2 -7
- package/dist/cjs/components/button/Button.styled.js.map +1 -1
- package/dist/cjs/components/button/themes.js +3 -3
- package/dist/cjs/components/button/themes.js.map +1 -1
- package/dist/cjs/components/checkBox/CheckBox.js +1 -1
- package/dist/cjs/components/checkBox/CheckBox.js.map +1 -1
- package/dist/cjs/components/checkBox/CheckBox.styled.js +10 -7
- package/dist/cjs/components/checkBox/CheckBox.styled.js.map +1 -1
- package/dist/cjs/components/dropdown/ChipInput.js +1 -1
- package/dist/cjs/components/dropdown/ChipInput.js.map +1 -1
- package/dist/cjs/components/dropdown/Dropdown.js +1 -1
- package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/input/Input.js.map +1 -1
- package/dist/cjs/components/input/Input.styled.js +12 -25
- package/dist/cjs/components/input/Input.styled.js.map +1 -1
- package/dist/cjs/components/tabs/Tabs.js +1 -1
- package/dist/cjs/components/tabs/Tabs.js.map +1 -1
- package/dist/cjs/components/tabs/Tabs.styles.js +8 -22
- package/dist/cjs/components/tabs/Tabs.styles.js.map +1 -1
- package/dist/cjs/components/whats-new/WhatsNew.js +1 -1
- package/dist/cjs/components/whats-new/WhatsNew.js.map +1 -1
- package/dist/cjs/components/whats-new/WhatsNewButton.js +2 -2
- package/dist/cjs/components/whats-new/WhatsNewButton.js.map +1 -1
- package/dist/cjs/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -1
- package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
- package/dist/esm/components/button/Button.styled.js +6 -11
- package/dist/esm/components/button/Button.styled.js.map +1 -1
- package/dist/esm/components/button/themes.d.ts +1 -1
- package/dist/esm/components/button/themes.js +1 -1
- package/dist/esm/components/button/themes.js.map +1 -1
- package/dist/esm/components/checkBox/CheckBox.js +16 -17
- package/dist/esm/components/checkBox/CheckBox.js.map +1 -1
- package/dist/esm/components/checkBox/CheckBox.styled.d.ts +0 -1
- package/dist/esm/components/checkBox/CheckBox.styled.js +11 -9
- package/dist/esm/components/checkBox/CheckBox.styled.js.map +1 -1
- package/dist/esm/components/dropdown/ChipInput.d.ts +0 -1
- package/dist/esm/components/dropdown/ChipInput.js +30 -37
- package/dist/esm/components/dropdown/ChipInput.js.map +1 -1
- package/dist/esm/components/dropdown/Dropdown.d.ts +0 -2
- package/dist/esm/components/dropdown/Dropdown.js +88 -95
- package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
- package/dist/esm/components/input/Input.js +101 -104
- package/dist/esm/components/input/Input.js.map +1 -1
- package/dist/esm/components/input/Input.model.d.ts +0 -2
- package/dist/esm/components/input/Input.styled.d.ts +0 -2
- package/dist/esm/components/input/Input.styled.js +25 -38
- package/dist/esm/components/input/Input.styled.js.map +1 -1
- package/dist/esm/components/tabs/Tabs.js +73 -93
- package/dist/esm/components/tabs/Tabs.js.map +1 -1
- package/dist/esm/components/tabs/Tabs.model.d.ts +0 -7
- package/dist/esm/components/tabs/Tabs.styles.d.ts +0 -2
- package/dist/esm/components/tabs/Tabs.styles.js +9 -23
- package/dist/esm/components/tabs/Tabs.styles.js.map +1 -1
- package/dist/esm/components/whats-new/WhatsNew.d.ts +0 -1
- package/dist/esm/components/whats-new/WhatsNew.js +17 -19
- package/dist/esm/components/whats-new/WhatsNew.js.map +1 -1
- package/dist/esm/components/whats-new/WhatsNew.types.d.ts +0 -1
- package/dist/esm/components/whats-new/WhatsNewButton.js +32 -37
- package/dist/esm/components/whats-new/WhatsNewButton.js.map +1 -1
- package/dist/esm/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -1
- package/dist/esm/icons/index.d.ts +25 -25
- package/package.json +2 -2
- package/dist/cjs/utils/rgba.js +0 -2
- package/dist/cjs/utils/rgba.js.map +0 -1
- package/dist/esm/utils/rgba.js +0 -10
- package/dist/esm/utils/rgba.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import i, { css as
|
|
2
|
-
import { BodyCaption as r, BodySecondary as
|
|
1
|
+
import i, { css as o } from "styled-components";
|
|
2
|
+
import { BodyCaption as r, BodySecondary as h, BodyPrimary as n } from "../TypographyStyle.js";
|
|
3
3
|
import { COLORS as e } from "../../constants/Theme.js";
|
|
4
|
-
const
|
|
4
|
+
const d = ({ isActive: t, isInvalid: s, hightlightInputColor: l }) => t ? l || e.stroke.brand : s ? e.stroke.negative.vibrant : e.stroke.primary, x = (t) => t.hideBorder ? 0 : t.version === "2.0" ? 0.5 : 1, p = i.div`
|
|
5
5
|
border-radius: ${(t) => t.version === "2.0" ? 8 : 4}px;
|
|
6
6
|
background: ${(t) => ["disabled", "read-only", "disabled-invalid"].includes(t.state) ? e.background.base : "#fff"};
|
|
7
7
|
border: ${(t) => x(t)}px solid
|
|
8
|
-
${(t) =>
|
|
8
|
+
${(t) => d({
|
|
9
9
|
isActive: t.isActive,
|
|
10
10
|
isInvalid: t.isInvalid,
|
|
11
11
|
hightlightInputColor: t.hightlightInputColor
|
|
@@ -20,22 +20,9 @@ const s = ({ isActive: t, isInvalid: h, hightlightInputColor: o }) => t ? o || e
|
|
|
20
20
|
gap: 8px;
|
|
21
21
|
overflow: hidden;
|
|
22
22
|
|
|
23
|
-
${(t) => t.state === "read-only"
|
|
23
|
+
${(t) => t.state === "read-only" ? "opacity: 0.7" : ""};
|
|
24
24
|
${(t) => t.state === "read-only" ? "pointer-events: none" : ""};
|
|
25
|
-
|
|
26
|
-
input,
|
|
27
|
-
textarea {
|
|
28
|
-
color: ${e.content.secondary};
|
|
29
|
-
-webkit-text-fill-color: ${e.content.secondary};
|
|
30
|
-
opacity: 1;
|
|
31
|
-
&::placeholder {
|
|
32
|
-
color: ${e.content.secondary};
|
|
33
|
-
-webkit-text-fill-color: ${e.content.secondary};
|
|
34
|
-
opacity: 1;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
` : ""};
|
|
38
|
-
`, u = i.div`
|
|
25
|
+
`, v = i.div`
|
|
39
26
|
min-height: ${(t) => t.iconSize};
|
|
40
27
|
min-width: ${(t) => t.iconSize};
|
|
41
28
|
display: flex;
|
|
@@ -43,7 +30,7 @@ const s = ({ isActive: t, isInvalid: h, hightlightInputColor: o }) => t ? o || e
|
|
|
43
30
|
justify-content: center;
|
|
44
31
|
overflow: hidden;
|
|
45
32
|
${(t) => t.isLeft ? `margin-left:${t.variant && ["small", "x-small"].includes(t.variant) ? "0px" : "8px"}` : `margin-right: ${t.variant && ["small", "x-small"].includes(t.variant) ? "0px" : "8px"}`};
|
|
46
|
-
`,
|
|
33
|
+
`, a = o`
|
|
47
34
|
flex-grow: 1;
|
|
48
35
|
overflow: hidden;
|
|
49
36
|
height: 100%;
|
|
@@ -80,8 +67,8 @@ const s = ({ isActive: t, isInvalid: h, hightlightInputColor: o }) => t ? o || e
|
|
|
80
67
|
min-height: 100px;
|
|
81
68
|
resize: none;
|
|
82
69
|
}
|
|
83
|
-
`,
|
|
84
|
-
${
|
|
70
|
+
`, u = i(n)`
|
|
71
|
+
${a};
|
|
85
72
|
${(t) => t.height && t.type !== "multiline" ? { height: t.height } : {}};
|
|
86
73
|
|
|
87
74
|
${(t) => t.autoGrow && t.minHeight && `
|
|
@@ -91,8 +78,8 @@ const s = ({ isActive: t, isInvalid: h, hightlightInputColor: o }) => t ? o || e
|
|
|
91
78
|
max-height: ${t.maxHeight || "100px"};
|
|
92
79
|
}
|
|
93
80
|
`}
|
|
94
|
-
`,
|
|
95
|
-
${
|
|
81
|
+
`, f = i(h)`
|
|
82
|
+
${a};
|
|
96
83
|
input {
|
|
97
84
|
min-height: 20px;
|
|
98
85
|
&::-webkit-outer-spin-button,
|
|
@@ -102,8 +89,8 @@ const s = ({ isActive: t, isInvalid: h, hightlightInputColor: o }) => t ? o || e
|
|
|
102
89
|
}
|
|
103
90
|
}
|
|
104
91
|
${(t) => t.height && t.type !== "multiline" ? { height: t.height } : {}};
|
|
105
|
-
`,
|
|
106
|
-
${
|
|
92
|
+
`, $ = i(r)`
|
|
93
|
+
${a};
|
|
107
94
|
input {
|
|
108
95
|
min-height: 16px;
|
|
109
96
|
&::-webkit-outer-spin-button,
|
|
@@ -131,10 +118,10 @@ const s = ({ isActive: t, isInvalid: h, hightlightInputColor: o }) => t ? o || e
|
|
|
131
118
|
color: ${e.content.negative};
|
|
132
119
|
padding-left: 4px;
|
|
133
120
|
}
|
|
134
|
-
`,
|
|
121
|
+
`, w = i(h)`
|
|
135
122
|
color: ${e.content.secondary} !important;
|
|
136
123
|
margin-top: ${(t) => t.position === "BOTTOM" ? "8px" : "0px"};
|
|
137
|
-
`,
|
|
124
|
+
`, y = i(r)`
|
|
138
125
|
white-space: pre-wrap;
|
|
139
126
|
margin-top: 8px;
|
|
140
127
|
color: ${(t) => t.invalid ? e.content.negative : e.content.secondary} !important;
|
|
@@ -151,8 +138,8 @@ const s = ({ isActive: t, isInvalid: h, hightlightInputColor: o }) => t ? o || e
|
|
|
151
138
|
`, k = i.div`
|
|
152
139
|
${(t) => t.width ? `width: ${t.width}` : ""};
|
|
153
140
|
${(t) => t.height && t.type == "multiline" ? `height: ${t.height}` : ""};
|
|
154
|
-
${(t) => t.state === "disabled" || t.state === "disabled-invalid" ?
|
|
155
|
-
opacity:
|
|
141
|
+
${(t) => t.state === "disabled" || t.state === "disabled-invalid" ? o`
|
|
142
|
+
opacity: 0.5;
|
|
156
143
|
pointer-events: none;
|
|
157
144
|
` : ""};
|
|
158
145
|
display: flex;
|
|
@@ -169,26 +156,26 @@ const s = ({ isActive: t, isInvalid: h, hightlightInputColor: o }) => t ? o || e
|
|
|
169
156
|
align-items: center;
|
|
170
157
|
justify-content: space-between;
|
|
171
158
|
}
|
|
172
|
-
`, I = i(
|
|
159
|
+
`, I = i(n)`
|
|
173
160
|
overflow: unset;
|
|
174
161
|
margin-left: ${(t) => t.variant && ["small", "x-small"].includes(t.variant) ? "" : "16px"};
|
|
175
162
|
font-size: ${(t) => t.variant === "x-small" ? "12px" : t.variant === "small" ? "14px" : "16px"};
|
|
176
163
|
line-height: ${(t) => t.variant === "x-small" ? "16px" : t.variant === "small" ? "20px" : "24px"};
|
|
177
|
-
`, C = i(
|
|
164
|
+
`, C = i(n)`
|
|
178
165
|
overflow: unset;
|
|
179
166
|
margin-right: ${(t) => t.variant && ["small", "x-small"].includes(t.variant) ? "" : "16px"};
|
|
180
167
|
font-size: ${(t) => t.variant === "x-small" ? "12px" : t.variant === "small" ? "14px" : "16px"};
|
|
181
168
|
line-height: ${(t) => t.variant === "x-small" ? "16px" : t.variant === "small" ? "20px" : "24px"};
|
|
182
169
|
`;
|
|
183
170
|
export {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
171
|
+
v as IconHolder,
|
|
172
|
+
u as InputContainer,
|
|
173
|
+
f as InputContainerSmall,
|
|
174
|
+
$ as InputContainerXSmall,
|
|
175
|
+
y as InputFooter,
|
|
189
176
|
b as InputHeader,
|
|
190
177
|
p as InputWrapper,
|
|
191
|
-
|
|
178
|
+
w as MaxCharStyle,
|
|
192
179
|
I as PrefixHolder,
|
|
193
180
|
k as RootContainer,
|
|
194
181
|
C as SuffixHolder
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.styled.js","sources":["../../../../src/components/input/Input.styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport {\n\tBodyCaption,\n\tBodyPrimary,\n\tBodySecondary,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { InputStateI, InputTypeI, InputVariant } from './Input.model';\n\nconst getBorderColor = ({ isActive, isInvalid, hightlightInputColor }) => {\n\tif (isActive) {\n\t\treturn hightlightInputColor ? hightlightInputColor : COLORS.stroke.brand;\n\t} else if (isInvalid) {\n\t\treturn COLORS.stroke.negative.vibrant;\n\t}\n\treturn COLORS.stroke.primary;\n};\n\nconst getBorderWidth = (props: {\n\tversion?: '1.0' | '2.0' | '3.0';\n\thideBorder?: boolean;\n}) => {\n\treturn props.hideBorder ? 0 : props.version === '2.0' ? 0.5 : 1;\n};\n\nexport const InputWrapper = styled.div<{\n\twidth?: string;\n\theight?: string;\n\tisActive?: boolean;\n\tisInvalid?: boolean;\n\tstate?: InputStateI;\n\tvariant?: InputVariant;\n\tversion?: '1.0' | '2.0' | '3.0';\n\thightlightInputColor?: string;\n\thideBorder?: boolean;\n\tsolidDisabled?: boolean;\n}>`\n\tborder-radius: ${(props) => (props.version === '2.0' ? 8 : 4)}px;\n\tbackground: ${(props) =>\n\t\t['disabled', 'read-only', 'disabled-invalid'].includes(props.state!)\n\t\t\t? COLORS.background.base\n\t\t\t: '#fff'};\n\tborder: ${(props) => getBorderWidth(props)}px solid\n\t\t${(props) =>\n\t\t\tgetBorderColor({\n\t\t\t\tisActive: props.isActive,\n\t\t\t\tisInvalid: props.isInvalid,\n\t\t\t\thightlightInputColor: props.hightlightInputColor,\n\t\t\t})};\n\t${(props) =>\n\t\tprops.isActive\n\t\t\t? `box-shadow: inset 0px 0px 0px 1px ${\n\t\t\t\t\tprops.hightlightInputColor\n\t\t\t\t\t\t? props.hightlightInputColor\n\t\t\t\t\t\t: COLORS.stroke.brand\n\t\t\t };`\n\t\t\t: ''};\n\tpadding: ${(props) => (props.variant === 'small' ? '6px' : '8px')};\n\theight: ${(props) => props.height || '100%'};\n\t${(props) =>\n\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t? 'max-height: 44px'\n\t\t\t: 'min-height: 48px'};\n\tdisplay: flex;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tgap: 8px;\n\toverflow: hidden;\n\n\t${(props) =>\n\t\tprops.state === 'read-only' && !props.solidDisabled ? 'opacity: 0.7' : ''};\n\t${(props) => (props.state === 'read-only' ? 'pointer-events: none' : '')};\n\t${(props) =>\n\t\tprops.solidDisabled &&\n\t\t['disabled', 'read-only', 'disabled-invalid'].includes(props.state!)\n\t\t\t? css`\n\t\t\t\t\tinput,\n\t\t\t\t\ttextarea {\n\t\t\t\t\t\tcolor: ${COLORS.content.secondary};\n\t\t\t\t\t\t-webkit-text-fill-color: ${COLORS.content.secondary};\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t&::placeholder {\n\t\t\t\t\t\t\tcolor: ${COLORS.content.secondary};\n\t\t\t\t\t\t\t-webkit-text-fill-color: ${COLORS.content.secondary};\n\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t `\n\t\t\t: ''};\n`;\n\nexport const IconHolder = styled.div<{\n\tisLeft?: boolean;\n\ticonSize?: string;\n\tvariant?: InputVariant;\n}>`\n\tmin-height: ${(props) => props.iconSize};\n\tmin-width: ${(props) => props.iconSize};\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\toverflow: hidden;\n\t${(props) =>\n\t\tprops.isLeft\n\t\t\t? `margin-left:${\n\t\t\t\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t\t\t\t? '0px'\n\t\t\t\t\t\t: '8px'\n\t\t\t }`\n\t\t\t: `margin-right: ${\n\t\t\t\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t\t\t\t? '0px'\n\t\t\t\t\t\t: '8px'\n\t\t\t }`};\n`;\n\nconst inputCss = css`\n\tflex-grow: 1;\n\toverflow: hidden;\n\theight: 100%;\n\n\tinput,\n\ttextarea {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder: none;\n\t\tmin-height: 24px;\n\t\toutline: none;\n\t\tfont-size: inherit;\n\t\tline-height: inherit;\n\t\tfont-weight: inherit;\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t\tbackground: transparent;\n\t\t&::placeholder {\n\t\t\tfont-family: Inter;\n\t\t\tcolor: ${COLORS.content.placeholder};\n\t\t}\n\n\t\t&::-webkit-outer-spin-button,\n\t\t&::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\n\ttextarea {\n\t\theight: 100%;\n\t\tfont-family: Inter;\n\t\tmin-height: 100px;\n\t\tresize: none;\n\t}\n`;\n\nexport const InputContainer = styled(BodyPrimary)<{\n\theight?: string;\n\ttype?: InputTypeI;\n\tautoGrow?: boolean;\n\tminHeight?: string;\n\tmaxHeight?: string;\n}>`\n\t${inputCss};\n\t${(props) =>\n\t\tprops.height && props.type !== 'multiline' ? { height: props.height } : {}};\n\n\t${(props) =>\n\t\tprops.autoGrow &&\n\t\tprops.minHeight &&\n\t\t`\n\ttextarea {\n\t\theight: ${props.minHeight};\n\t\tmin-height: ${props.minHeight};\n\t\tmax-height: ${props.maxHeight || '100px'};\n\t}\n\t`}\n`;\n\nexport const InputContainerSmall = styled(BodySecondary)<{\n\theight?: string;\n\ttype?: InputTypeI;\n}>`\n\t${inputCss};\n\tinput {\n\t\tmin-height: 20px;\n\t\t&::-webkit-outer-spin-button,\n\t\t&::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\t${(props) =>\n\t\tprops.height && props.type !== 'multiline' ? { height: props.height } : {}};\n`;\n\nexport const InputContainerXSmall = styled(BodyCaption)<{\n\theight?: string;\n\ttype?: InputTypeI;\n}>`\n\t${inputCss};\n\tinput {\n\t\tmin-height: 16px;\n\t\t&::-webkit-outer-spin-button,\n\t\t&::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\t${(props) =>\n\t\tprops.height && props.type !== 'multiline' ? { height: props.height } : {}};\n`;\n\nexport const InputHeader = styled.div<{\n\tinvalid?: boolean;\n\tmaxCharAlignment?: boolean;\n}>`\n\tdisplay: flex;\n\tjustify-content: space-between;\n\t${(props) => (props.maxCharAlignment ? 'align-items: flex-end;' : '')}\n\tmargin-bottom: 8px;\n\t.label__container {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 2px;\n\t\t> div:first-of-type {\n\t\t\t${(props) =>\n\t\t\t\tprops.invalid ? `color: ${COLORS.content.negative} !important` : ''};\n\t\t}\n\t}\n\n\tspan {\n\t\tcolor: ${COLORS.content.negative};\n\t\tpadding-left: 4px;\n\t}\n`;\n\nexport const MaxCharStyle = styled(BodySecondary)<{ position?: string }>`\n\tcolor: ${COLORS.content.secondary} !important;\n\tmargin-top: ${(props) => (props.position === 'BOTTOM' ? '8px' : '0px')};\n`;\n\nexport const InputFooter = styled(BodyCaption)<{ invalid?: boolean }>`\n\twhite-space: pre-wrap;\n\tmargin-top: 8px;\n\tcolor: ${(props) =>\n\t\tprops.invalid\n\t\t\t? COLORS.content.negative\n\t\t\t: COLORS.content.secondary} !important;\n\t/* position: absolute; */\n\t/* left: 0px;\n\ttop: 100%; */\n\tdisplay: flex !important;\n\tgap: 6px;\n\tmin-height: 16px;\n\t> svg {\n\t\twidth: 16px;\n\t\theight: 16px;\n\t}\n`;\n\nexport const RootContainer = styled.div<{\n\twidth?: string;\n\theight?: string;\n\tstate?: InputStateI;\n\ttype: InputTypeI;\n\tsolidDisabled?: boolean;\n}>`\n\t${(props) => (props.width ? `width: ${props.width}` : '')};\n\t${(props) =>\n\t\tprops.height && props.type == 'multiline' ? `height: ${props.height}` : ''};\n\t${(props) =>\n\t\tprops.state === 'disabled' || props.state === 'disabled-invalid'\n\t\t\t? css`\n\t\t\t\t\topacity: ${props.solidDisabled ? 1 : 0.5};\n\t\t\t\t\tpointer-events: none;\n\t\t\t `\n\t\t\t: ''};\n\tdisplay: flex;\n\tflex-direction: column-reverse;\n\tposition: relative;\n\t.truncate-class {\n\t\tmax-width: 180px;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\t.flex-align-center {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t}\n`;\n\nexport const PrefixHolder = styled(BodyPrimary)<{ variant?: InputVariant }>`\n\toverflow: unset;\n\tmargin-left: ${(props) =>\n\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t? ''\n\t\t\t: '16px'};\n\tfont-size: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '12px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '14px'\n\t\t\t: '16px'};\n\tline-height: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '16px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '20px'\n\t\t\t: '24px'};\n`;\n\nexport const SuffixHolder = styled(BodyPrimary)<{ variant?: InputVariant }>`\n\toverflow: unset;\n\tmargin-right: ${(props) =>\n\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t? ''\n\t\t\t: '16px'};\n\tfont-size: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '12px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '14px'\n\t\t\t: '16px'};\n\tline-height: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '16px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '20px'\n\t\t\t: '24px'};\n`;\n"],"names":["getBorderColor","isActive","isInvalid","hightlightInputColor","COLORS","getBorderWidth","props","InputWrapper","styled","css","IconHolder","inputCss","InputContainer","BodyPrimary","InputContainerSmall","BodySecondary","InputContainerXSmall","BodyCaption","InputHeader","MaxCharStyle","InputFooter","RootContainer","PrefixHolder","SuffixHolder"],"mappings":";;;AASA,MAAMA,IAAiB,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,sBAAAC,QAC1CF,IACIE,KAA8CC,EAAO,OAAO,QACzDF,IACHE,EA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M,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA,gBACK,CAACA,MACfA,EAAM,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA,GAGEiB,IAAef,EAAOK,CAAW;AAAA;AAAA,iBAE7B,CAACP,MAChBA,EAAM,WAAW,CAAC,SAAS,SAAS,EAAE,SAASA,EAAM,OAAO,IACzD,KACA,MAAM;AAAA,cACG,CAACA,MACbA,EAAM,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA,gBACK,CAACA,MACfA,EAAM,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA;"}
|
|
1
|
+
{"version":3,"file":"Input.styled.js","sources":["../../../../src/components/input/Input.styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport {\n\tBodyCaption,\n\tBodyPrimary,\n\tBodySecondary,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { InputStateI, InputTypeI, InputVariant } from './Input.model';\n\nconst getBorderColor = ({ isActive, isInvalid, hightlightInputColor }) => {\n\tif (isActive) {\n\t\treturn hightlightInputColor ? hightlightInputColor : COLORS.stroke.brand;\n\t} else if (isInvalid) {\n\t\treturn COLORS.stroke.negative.vibrant;\n\t}\n\treturn COLORS.stroke.primary;\n};\n\nconst getBorderWidth = (props: {\n\tversion?: '1.0' | '2.0' | '3.0';\n\thideBorder?: boolean;\n}) => {\n\treturn props.hideBorder ? 0 : props.version === '2.0' ? 0.5 : 1;\n};\n\nexport const InputWrapper = styled.div<{\n\twidth?: string;\n\theight?: string;\n\tisActive?: boolean;\n\tisInvalid?: boolean;\n\tstate?: InputStateI;\n\tvariant?: InputVariant;\n\tversion?: '1.0' | '2.0' | '3.0';\n\thightlightInputColor?: string;\n\thideBorder?: boolean;\n}>`\n\tborder-radius: ${(props) => (props.version === '2.0' ? 8 : 4)}px;\n\tbackground: ${(props) =>\n\t\t['disabled', 'read-only', 'disabled-invalid'].includes(props.state!)\n\t\t\t? COLORS.background.base\n\t\t\t: '#fff'};\n\tborder: ${(props) => getBorderWidth(props)}px solid\n\t\t${(props) =>\n\t\t\tgetBorderColor({\n\t\t\t\tisActive: props.isActive,\n\t\t\t\tisInvalid: props.isInvalid,\n\t\t\t\thightlightInputColor: props.hightlightInputColor,\n\t\t\t})};\n\t${(props) =>\n\t\tprops.isActive\n\t\t\t? `box-shadow: inset 0px 0px 0px 1px ${\n\t\t\t\t\tprops.hightlightInputColor\n\t\t\t\t\t\t? props.hightlightInputColor\n\t\t\t\t\t\t: COLORS.stroke.brand\n\t\t\t };`\n\t\t\t: ''};\n\tpadding: ${(props) => (props.variant === 'small' ? '6px' : '8px')};\n\theight: ${(props) => props.height || '100%'};\n\t${(props) =>\n\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t? 'max-height: 44px'\n\t\t\t: 'min-height: 48px'};\n\tdisplay: flex;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tgap: 8px;\n\toverflow: hidden;\n\n\t${(props) => (props.state === 'read-only' ? 'opacity: 0.7' : '')};\n\t${(props) => (props.state === 'read-only' ? 'pointer-events: none' : '')};\n`;\n\nexport const IconHolder = styled.div<{\n\tisLeft?: boolean;\n\ticonSize?: string;\n\tvariant?: InputVariant;\n}>`\n\tmin-height: ${(props) => props.iconSize};\n\tmin-width: ${(props) => props.iconSize};\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\toverflow: hidden;\n\t${(props) =>\n\t\tprops.isLeft\n\t\t\t? `margin-left:${\n\t\t\t\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t\t\t\t? '0px'\n\t\t\t\t\t\t: '8px'\n\t\t\t }`\n\t\t\t: `margin-right: ${\n\t\t\t\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t\t\t\t? '0px'\n\t\t\t\t\t\t: '8px'\n\t\t\t }`};\n`;\n\nconst inputCss = css`\n\tflex-grow: 1;\n\toverflow: hidden;\n\theight: 100%;\n\n\tinput,\n\ttextarea {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder: none;\n\t\tmin-height: 24px;\n\t\toutline: none;\n\t\tfont-size: inherit;\n\t\tline-height: inherit;\n\t\tfont-weight: inherit;\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t\tbackground: transparent;\n\t\t&::placeholder {\n\t\t\tfont-family: Inter;\n\t\t\tcolor: ${COLORS.content.placeholder};\n\t\t}\n\n\t\t&::-webkit-outer-spin-button,\n\t\t&::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\n\ttextarea {\n\t\theight: 100%;\n\t\tfont-family: Inter;\n\t\tmin-height: 100px;\n\t\tresize: none;\n\t}\n`;\n\nexport const InputContainer = styled(BodyPrimary)<{\n\theight?: string;\n\ttype?: InputTypeI;\n\tautoGrow?: boolean;\n\tminHeight?: string;\n\tmaxHeight?: string;\n}>`\n\t${inputCss};\n\t${(props) =>\n\t\tprops.height && props.type !== 'multiline' ? { height: props.height } : {}};\n\n\t${(props) =>\n\t\tprops.autoGrow &&\n\t\tprops.minHeight &&\n\t\t`\n\ttextarea {\n\t\theight: ${props.minHeight};\n\t\tmin-height: ${props.minHeight};\n\t\tmax-height: ${props.maxHeight || '100px'};\n\t}\n\t`}\n`;\n\nexport const InputContainerSmall = styled(BodySecondary)<{\n\theight?: string;\n\ttype?: InputTypeI;\n}>`\n\t${inputCss};\n\tinput {\n\t\tmin-height: 20px;\n\t\t&::-webkit-outer-spin-button,\n\t\t&::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\t${(props) =>\n\t\tprops.height && props.type !== 'multiline' ? { height: props.height } : {}};\n`;\n\nexport const InputContainerXSmall = styled(BodyCaption)<{\n\theight?: string;\n\ttype?: InputTypeI;\n}>`\n\t${inputCss};\n\tinput {\n\t\tmin-height: 16px;\n\t\t&::-webkit-outer-spin-button,\n\t\t&::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\t${(props) =>\n\t\tprops.height && props.type !== 'multiline' ? { height: props.height } : {}};\n`;\n\nexport const InputHeader = styled.div<{\n\tinvalid?: boolean;\n\tmaxCharAlignment?: boolean;\n}>`\n\tdisplay: flex;\n\tjustify-content: space-between;\n\t${(props) => (props.maxCharAlignment ? 'align-items: flex-end;' : '')}\n\tmargin-bottom: 8px;\n\t.label__container {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 2px;\n\t\t> div:first-of-type {\n\t\t\t${(props) =>\n\t\t\t\tprops.invalid ? `color: ${COLORS.content.negative} !important` : ''};\n\t\t}\n\t}\n\n\tspan {\n\t\tcolor: ${COLORS.content.negative};\n\t\tpadding-left: 4px;\n\t}\n`;\n\nexport const MaxCharStyle = styled(BodySecondary)<{ position?: string }>`\n\tcolor: ${COLORS.content.secondary} !important;\n\tmargin-top: ${(props) => (props.position === 'BOTTOM' ? '8px' : '0px')};\n`;\n\nexport const InputFooter = styled(BodyCaption)<{ invalid?: boolean }>`\n\twhite-space: pre-wrap;\n\tmargin-top: 8px;\n\tcolor: ${(props) =>\n\t\tprops.invalid\n\t\t\t? COLORS.content.negative\n\t\t\t: COLORS.content.secondary} !important;\n\t/* position: absolute; */\n\t/* left: 0px;\n\ttop: 100%; */\n\tdisplay: flex !important;\n\tgap: 6px;\n\tmin-height: 16px;\n\t> svg {\n\t\twidth: 16px;\n\t\theight: 16px;\n\t}\n`;\n\nexport const RootContainer = styled.div<{\n\twidth?: string;\n\theight?: string;\n\tstate?: InputStateI;\n\ttype: InputTypeI;\n}>`\n\t${(props) => (props.width ? `width: ${props.width}` : '')};\n\t${(props) =>\n\t\tprops.height && props.type == 'multiline' ? `height: ${props.height}` : ''};\n\t${(props) =>\n\t\tprops.state === 'disabled' || props.state === 'disabled-invalid'\n\t\t\t? css`\n\t\t\t\t\topacity: 0.5;\n\t\t\t\t\tpointer-events: none;\n\t\t\t `\n\t\t\t: ''};\n\tdisplay: flex;\n\tflex-direction: column-reverse;\n\tposition: relative;\n\t.truncate-class {\n\t\tmax-width: 180px;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\t.flex-align-center {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t}\n`;\n\nexport const PrefixHolder = styled(BodyPrimary)<{ variant?: InputVariant }>`\n\toverflow: unset;\n\tmargin-left: ${(props) =>\n\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t? ''\n\t\t\t: '16px'};\n\tfont-size: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '12px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '14px'\n\t\t\t: '16px'};\n\tline-height: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '16px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '20px'\n\t\t\t: '24px'};\n`;\n\nexport const SuffixHolder = styled(BodyPrimary)<{ variant?: InputVariant }>`\n\toverflow: unset;\n\tmargin-right: ${(props) =>\n\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t? ''\n\t\t\t: '16px'};\n\tfont-size: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '12px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '14px'\n\t\t\t: '16px'};\n\tline-height: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '16px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '20px'\n\t\t\t: '24px'};\n`;\n"],"names":["getBorderColor","isActive","isInvalid","hightlightInputColor","COLORS","getBorderWidth","props","InputWrapper","styled","IconHolder","inputCss","css","InputContainer","BodyPrimary","InputContainerSmall","BodySecondary","InputContainerXSmall","BodyCaption","InputHeader","MaxCharStyle","InputFooter","RootContainer","PrefixHolder","Su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CAAC,SAAS,SAAS,EAAE,SAASA,EAAM,OAAO,IACzD,KACA,MAAM;AAAA,cACG,CAACA,MACbA,EAAM,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA,gBACK,CAACA,MACfA,EAAM,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA;"}
|
|
@@ -1,155 +1,135 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { DEFAULT_THEME as
|
|
4
|
-
import { TabItem as
|
|
5
|
-
import { Tag as
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as h, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as N, useState as q, useEffect as v } from "react";
|
|
3
|
+
import { DEFAULT_THEME as S } from "../../constants/Theme.js";
|
|
4
|
+
import { TabItem as P, TrailingNumberContainer as y, TabItemText as z, TabHeader as F, EmptyTab as L, RightComponent as j } from "./Tabs.styles.js";
|
|
5
|
+
import { Tag as f } from "../tag/Tag.js";
|
|
6
|
+
const H = (e) => {
|
|
7
7
|
const {
|
|
8
8
|
tabs: t,
|
|
9
9
|
initialTab: d,
|
|
10
|
-
onTabSelected:
|
|
10
|
+
onTabSelected: l,
|
|
11
11
|
TabItemStyledProps: m,
|
|
12
|
-
selectedTab:
|
|
12
|
+
selectedTab: a,
|
|
13
13
|
extendedBorder: i,
|
|
14
|
-
rightComponent:
|
|
15
|
-
size:
|
|
14
|
+
rightComponent: b,
|
|
15
|
+
size: u = "default",
|
|
16
16
|
isSquared: T = !1,
|
|
17
|
-
containerStyles: g
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return /* @__PURE__ */ S(
|
|
26
|
-
L,
|
|
17
|
+
containerStyles: g
|
|
18
|
+
} = e, [n, r] = q(d || t[0].key), { colorsV2: c } = S;
|
|
19
|
+
v(() => {
|
|
20
|
+
a && a !== n && r(a);
|
|
21
|
+
}, [a, n]);
|
|
22
|
+
const p = e.backgroundColor, E = e.selectedTextColor ?? c.background.brand, I = e.textColor ?? c.content.secondary;
|
|
23
|
+
return /* @__PURE__ */ h(
|
|
24
|
+
F,
|
|
27
25
|
{
|
|
28
26
|
style: g ?? {},
|
|
29
|
-
bgColor:
|
|
30
|
-
tabGap: r,
|
|
27
|
+
bgColor: p,
|
|
31
28
|
"data-test": e["data-test"],
|
|
32
29
|
children: [
|
|
33
|
-
t.map((s,
|
|
34
|
-
|
|
30
|
+
t.map((s, C) => /* @__PURE__ */ o(
|
|
31
|
+
k,
|
|
35
32
|
{
|
|
36
33
|
hasEqualSpacing: e.hasEqualSpacing,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
textColor: p,
|
|
34
|
+
selectedTextColor: E,
|
|
35
|
+
textColor: I,
|
|
40
36
|
tab: s,
|
|
41
|
-
currentTab:
|
|
37
|
+
currentTab: n,
|
|
42
38
|
TabItemStyledProps: m,
|
|
43
39
|
IconComponent: s.icon,
|
|
44
|
-
size:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
C(f), c && c(f);
|
|
40
|
+
size: u,
|
|
41
|
+
setCurrentTab: (x) => {
|
|
42
|
+
r(x), l && l(x);
|
|
48
43
|
},
|
|
49
44
|
isSquared: T,
|
|
50
|
-
isFirstlement:
|
|
51
|
-
isLastElement:
|
|
45
|
+
isFirstlement: C == 0,
|
|
46
|
+
isLastElement: C == t.length - 1,
|
|
52
47
|
iconPosition: s.iconPosition ?? "left"
|
|
53
48
|
},
|
|
54
49
|
s.key
|
|
55
50
|
)),
|
|
56
|
-
i && /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
51
|
+
i && /* @__PURE__ */ o(L, {}),
|
|
52
|
+
/* @__PURE__ */ o(j, { children: b })
|
|
58
53
|
]
|
|
59
54
|
}
|
|
60
55
|
);
|
|
61
|
-
},
|
|
56
|
+
}, k = (e) => {
|
|
62
57
|
const {
|
|
63
58
|
tab: t,
|
|
64
59
|
currentTab: d,
|
|
65
|
-
setCurrentTab:
|
|
60
|
+
setCurrentTab: l,
|
|
66
61
|
TabItemStyledProps: m,
|
|
67
|
-
IconComponent:
|
|
62
|
+
IconComponent: a,
|
|
68
63
|
iconPosition: i = "left",
|
|
69
|
-
size:
|
|
70
|
-
isSquared:
|
|
64
|
+
size: b = "default",
|
|
65
|
+
isSquared: u = !1,
|
|
71
66
|
isFirstlement: T,
|
|
72
67
|
isLastElement: g
|
|
73
|
-
} = e,
|
|
68
|
+
} = e, n = t.key === d, { colorsV2: r } = S, c = N(() => ({
|
|
74
69
|
...m,
|
|
75
70
|
borderRadius: e.isSquared ? T ? "4px 0px 0px 4px" : g ? "0px 4px 4px 0px" : "" : ""
|
|
76
71
|
}), []);
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
|
|
72
|
+
return /* @__PURE__ */ h(
|
|
73
|
+
P,
|
|
79
74
|
{
|
|
80
|
-
style:
|
|
81
|
-
selected:
|
|
82
|
-
uniformBorder: e.uniformBorder,
|
|
75
|
+
style: c(),
|
|
76
|
+
selected: n,
|
|
83
77
|
hasEqualSpacing: e.hasEqualSpacing,
|
|
84
|
-
onClick: () =>
|
|
78
|
+
onClick: () => l(e.tab.key),
|
|
85
79
|
selectedTextColor: e.selectedTextColor,
|
|
86
|
-
isSquared:
|
|
80
|
+
isSquared: u,
|
|
87
81
|
"data-test": e["data-test"],
|
|
88
82
|
children: [
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
a && i === "left" && /* @__PURE__ */ o(
|
|
84
|
+
a,
|
|
91
85
|
{
|
|
92
|
-
selected:
|
|
86
|
+
selected: n ? r.background.brand : r.content.secondary
|
|
93
87
|
}
|
|
94
88
|
),
|
|
95
|
-
t.leadingNumber !== void 0 && t.leadingNumber !== null && /* @__PURE__ */ n(
|
|
96
|
-
|
|
89
|
+
t.leadingNumber !== void 0 && t.leadingNumber !== null && /* @__PURE__ */ o(y, { selected: n, children: /* @__PURE__ */ o(
|
|
90
|
+
f,
|
|
97
91
|
{
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
tagText: t?.leadingNumber ?? 0,
|
|
104
|
-
theme: "dark",
|
|
105
|
-
type: t.numberTagType,
|
|
106
|
-
variant: "circle",
|
|
107
|
-
color: a.content.primaryInverse
|
|
108
|
-
}
|
|
109
|
-
)
|
|
92
|
+
tagText: t?.leadingNumber ?? 0,
|
|
93
|
+
theme: "dark",
|
|
94
|
+
type: t.numberTagType,
|
|
95
|
+
variant: "circle",
|
|
96
|
+
color: r.content.primaryInverse
|
|
110
97
|
}
|
|
111
|
-
),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
|
|
98
|
+
) }),
|
|
99
|
+
/* @__PURE__ */ o(
|
|
100
|
+
z,
|
|
114
101
|
{
|
|
115
|
-
style:
|
|
102
|
+
style: b === "small" ? { fontSize: 14, fontStyle: "normal", fontWeight: 600 } : void 0,
|
|
116
103
|
textColor: e.textColor,
|
|
117
104
|
selectedTextColor: e.selectedTextColor,
|
|
118
|
-
selected:
|
|
105
|
+
selected: n,
|
|
119
106
|
children: t.title
|
|
120
107
|
}
|
|
121
108
|
),
|
|
122
|
-
t.trailingNumber !== void 0 && t.trailingNumber !== null && /* @__PURE__ */ n(
|
|
123
|
-
|
|
109
|
+
t.trailingNumber !== void 0 && t.trailingNumber !== null && /* @__PURE__ */ o(y, { selected: n, children: /* @__PURE__ */ o(
|
|
110
|
+
f,
|
|
124
111
|
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
tagText: t?.trailingNumber ?? 0,
|
|
131
|
-
theme: "dark",
|
|
132
|
-
type: t.numberTagType,
|
|
133
|
-
variant: "circle",
|
|
134
|
-
color: a.content.primaryInverse
|
|
135
|
-
}
|
|
136
|
-
)
|
|
112
|
+
tagText: t?.trailingNumber ?? 0,
|
|
113
|
+
theme: "dark",
|
|
114
|
+
type: t.numberTagType,
|
|
115
|
+
variant: "circle",
|
|
116
|
+
color: r.content.primaryInverse
|
|
137
117
|
}
|
|
138
|
-
),
|
|
139
|
-
|
|
140
|
-
|
|
118
|
+
) }),
|
|
119
|
+
a && i === "right" && /* @__PURE__ */ o(
|
|
120
|
+
a,
|
|
141
121
|
{
|
|
142
|
-
selected:
|
|
122
|
+
selected: n ? r.background.brand : r.content.secondary
|
|
143
123
|
}
|
|
144
124
|
)
|
|
145
125
|
]
|
|
146
126
|
}
|
|
147
127
|
);
|
|
148
128
|
};
|
|
149
|
-
|
|
150
|
-
|
|
129
|
+
H.displayName = "Tabs";
|
|
130
|
+
k.displayName = "TabItemComponent";
|
|
151
131
|
export {
|
|
152
|
-
|
|
153
|
-
|
|
132
|
+
k as TabItemComponent,
|
|
133
|
+
H as Tabs
|
|
154
134
|
};
|
|
155
135
|
//# sourceMappingURL=Tabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sources":["../../../../src/components/tabs/Tabs.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { DEFAULT_THEME } from '@src/constants/Theme';\nimport { Tag } from '../tag';\nimport { TabItemComponentProps, TabViewHeaderProps } from './Tabs.model';\nimport {\n\tEmptyTab,\n\tRightComponent,\n\tTabHeader,\n\tTabItem,\n\tTabItemText,\n\tTrailingNumberContainer,\n} from './Tabs.styles';\n\nexport const Tabs: React.FC<TabViewHeaderProps> = (props) => {\n\tconst {\n\t\ttabs,\n\t\tinitialTab,\n\t\tonTabSelected,\n\t\tTabItemStyledProps,\n\t\tselectedTab,\n\t\textendedBorder,\n\t\trightComponent,\n\t\tsize = 'default',\n\t\tisSquared = false,\n\t\tcontainerStyles,\n\t
|
|
1
|
+
{"version":3,"file":"Tabs.js","sources":["../../../../src/components/tabs/Tabs.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { DEFAULT_THEME } from '@src/constants/Theme';\nimport { Tag } from '../tag';\nimport { TabItemComponentProps, TabViewHeaderProps } from './Tabs.model';\nimport {\n\tEmptyTab,\n\tRightComponent,\n\tTabHeader,\n\tTabItem,\n\tTabItemText,\n\tTrailingNumberContainer,\n} from './Tabs.styles';\n\nexport const Tabs: React.FC<TabViewHeaderProps> = (props) => {\n\tconst {\n\t\ttabs,\n\t\tinitialTab,\n\t\tonTabSelected,\n\t\tTabItemStyledProps,\n\t\tselectedTab,\n\t\textendedBorder,\n\t\trightComponent,\n\t\tsize = 'default',\n\t\tisSquared = false,\n\t\tcontainerStyles,\n\t} = props;\n\tconst [currentTab, setCurrentTab] = useState(initialTab || tabs[0].key);\n\tconst { colorsV2 } = DEFAULT_THEME;\n\n\tuseEffect(() => {\n\t\tif (selectedTab && selectedTab !== currentTab) {\n\t\t\tsetCurrentTab(selectedTab);\n\t\t}\n\t}, [selectedTab, currentTab]);\n\n\tconst backgroundColor = props.backgroundColor;\n\tconst selectedTextColor =\n\t\tprops.selectedTextColor ?? colorsV2.background.brand;\n\tconst textColor = props.textColor ?? colorsV2.content.secondary;\n\n\treturn (\n\t\t<TabHeader\n\t\t\tstyle={containerStyles ?? {}}\n\t\t\tbgColor={backgroundColor}\n\t\t\tdata-test={props['data-test']}\n\t\t>\n\t\t\t{tabs.map((tab, index) => (\n\t\t\t\t<TabItemComponent\n\t\t\t\t\thasEqualSpacing={props.hasEqualSpacing}\n\t\t\t\t\tselectedTextColor={selectedTextColor}\n\t\t\t\t\ttextColor={textColor}\n\t\t\t\t\tkey={tab.key}\n\t\t\t\t\ttab={tab}\n\t\t\t\t\tcurrentTab={currentTab}\n\t\t\t\t\tTabItemStyledProps={TabItemStyledProps}\n\t\t\t\t\tIconComponent={tab.icon}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tsetCurrentTab={(tabKey) => {\n\t\t\t\t\t\tsetCurrentTab(tabKey);\n\t\t\t\t\t\tif (onTabSelected) {\n\t\t\t\t\t\t\tonTabSelected(tabKey as string);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tisSquared={isSquared}\n\t\t\t\t\tisFirstlement={index == 0}\n\t\t\t\t\tisLastElement={index == tabs.length - 1}\n\t\t\t\t\ticonPosition={tab.iconPosition ?? 'left'}\n\t\t\t\t/>\n\t\t\t))}\n\t\t\t{extendedBorder && <EmptyTab />}\n\t\t\t<RightComponent>{rightComponent}</RightComponent>\n\t\t</TabHeader>\n\t);\n};\n\nexport const TabItemComponent: React.FC<TabItemComponentProps> = (props) => {\n\tconst {\n\t\ttab,\n\t\tcurrentTab,\n\t\tsetCurrentTab,\n\t\tTabItemStyledProps,\n\t\tIconComponent,\n\t\ticonPosition = 'left',\n\t\tsize = 'default',\n\t\tisSquared = false,\n\t\tisFirstlement,\n\t\tisLastElement,\n\t} = props;\n\tconst selected = tab.key === currentTab;\n\tconst { colorsV2 } = DEFAULT_THEME;\n\n\tconst tabStyles = useCallback(() => {\n\t\treturn {\n\t\t\t...TabItemStyledProps,\n\t\t\tborderRadius: props.isSquared\n\t\t\t\t? isFirstlement\n\t\t\t\t\t? '4px 0px 0px 4px'\n\t\t\t\t\t: isLastElement\n\t\t\t\t\t? '0px 4px 4px 0px'\n\t\t\t\t\t: ''\n\t\t\t\t: '',\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\treturn (\n\t\t<TabItem\n\t\t\tstyle={tabStyles()}\n\t\t\tselected={selected}\n\t\t\thasEqualSpacing={props.hasEqualSpacing}\n\t\t\tonClick={() => setCurrentTab(props.tab.key)}\n\t\t\tselectedTextColor={props.selectedTextColor}\n\t\t\tisSquared={isSquared}\n\t\t\tdata-test={props['data-test']}\n\t\t>\n\t\t\t{IconComponent && iconPosition === 'left' && (\n\t\t\t\t<IconComponent\n\t\t\t\t\tselected={\n\t\t\t\t\t\tselected ? colorsV2.background.brand : colorsV2.content.secondary\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{tab.leadingNumber !== undefined && tab.leadingNumber !== null && (\n\t\t\t\t<TrailingNumberContainer selected={selected}>\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttagText={tab?.leadingNumber ?? 0}\n\t\t\t\t\t\ttheme=\"dark\"\n\t\t\t\t\t\ttype={tab.numberTagType}\n\t\t\t\t\t\tvariant=\"circle\"\n\t\t\t\t\t\tcolor={colorsV2.content.primaryInverse}\n\t\t\t\t\t/>\n\t\t\t\t</TrailingNumberContainer>\n\t\t\t)}\n\t\t\t<TabItemText\n\t\t\t\tstyle={\n\t\t\t\t\tsize === 'small'\n\t\t\t\t\t\t? { fontSize: 14, fontStyle: 'normal', fontWeight: 600 }\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\ttextColor={props.textColor}\n\t\t\t\tselectedTextColor={props.selectedTextColor}\n\t\t\t\tselected={selected}\n\t\t\t>\n\t\t\t\t{tab.title}\n\t\t\t</TabItemText>\n\t\t\t{tab.trailingNumber !== undefined && tab.trailingNumber !== null && (\n\t\t\t\t<TrailingNumberContainer selected={selected}>\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttagText={tab?.trailingNumber ?? 0}\n\t\t\t\t\t\ttheme=\"dark\"\n\t\t\t\t\t\ttype={tab.numberTagType}\n\t\t\t\t\t\tvariant=\"circle\"\n\t\t\t\t\t\tcolor={colorsV2.content.primaryInverse}\n\t\t\t\t\t/>\n\t\t\t\t</TrailingNumberContainer>\n\t\t\t)}\n\t\t\t{IconComponent && iconPosition === 'right' && (\n\t\t\t\t<IconComponent\n\t\t\t\t\tselected={\n\t\t\t\t\t\tselected ? colorsV2.background.brand : colorsV2.content.secondary\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</TabItem>\n\t);\n};\n\nTabs.displayName = 'Tabs';\n\nTabItemComponent.displayName = 'TabItemComponent';\n"],"names":["Tabs","props","tabs","initialTab","onTabSelected","TabItemStyledProps","selectedTab","extendedBorder","rightComponent","size","isSquared","containerStyles","currentTab","setCurrentTab","useState","colorsV2","DEFAULT_THEME","useEffect","backgroundColor","selectedTextColor","textColor","jsxs","TabHeader","tab","index","jsx","TabItemComponent","tabKey","EmptyTab","RightComponent","IconComponent","iconPosition","isFirstlement","isLastElement","selected","tabStyles","useCallback","TabItem","TrailingNumberContainer","Tag","TabItemText"],"mappings":";;;;;AAaO,MAAMA,IAAqC,CAACC,MAAU;AAC5D,QAAM;AAAA,IACL,MAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,WAAAC,IAAY;AAAA,IACZ,iBAAAC;AAAA,EAAA,IACGV,GACE,CAACW,GAAYC,CAAa,IAAIC,EAASX,KAAcD,EAAK,CAAC,EAAE,GAAG,GAChE,EAAE,UAAAa,MAAaC;AAErB,EAAAC,EAAU,MAAM;AACf,IAAIX,KAAeA,MAAgBM,KAClCC,EAAcP,CAAW;AAAA,EAE3B,GAAG,CAACA,GAAaM,CAAU,CAAC;AAE5B,QAAMM,IAAkBjB,EAAM,iBACxBkB,IACLlB,EAAM,qBAAqBc,EAAS,WAAW,OAC1CK,IAAYnB,EAAM,aAAac,EAAS,QAAQ;AAEtD,SACC,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACA,OAAOX,KAAmB,CAAA;AAAA,MAC1B,SAASO;AAAA,MACT,aAAWjB,EAAM,WAAW;AAAA,MAE3B,UAAA;AAAA,QAAAC,EAAK,IAAI,CAACqB,GAAKC,MACf,gBAAAC;AAAA,UAACC;AAAA,UAAA;AAAA,YACA,iBAAiBzB,EAAM;AAAA,YACvB,mBAAAkB;AAAA,YACA,WAAAC;AAAA,YAEA,KAAAG;AAAA,YACA,YAAAX;AAAA,YACA,oBAAAP;AAAA,YACA,eAAekB,EAAI;AAAA,YACnB,MAAAd;AAAA,YACA,eAAe,CAACkB,MAAW;AAC1B,cAAAd,E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AA,QAI1DQ,EAAI,kBAAkB,UAAaA,EAAI,kBAAkB,QACzD,gBAAAE,EAACa,KAAwB,UAAAJ,GACxB,UAAA,gBAAAT;AAAA,UAACc;AAAA,UAAA;AAAA,YACA,SAAShB,GAAK,iBAAiB;AAAA,YAC/B,OAAM;AAAA,YACN,MAAMA,EAAI;AAAA,YACV,SAAQ;AAAA,YACR,OAAOR,EAAS,QAAQ;AAAA,UAAA;AAAA,QAAA,GAE1B;AAAA,QAED,gBAAAU;AAAA,UAACe;AAAA,UAAA;AAAA,YACA,OACC/B,MAAS,UACN,EAAE,UAAU,IAAI,WAAW,UAAU,YAAY,IAAA,IACjD;AAAA,YAEJ,WAAWR,EAAM;AAAA,YACjB,mBAAmBA,EAAM;AAAA,YACzB,UAAAiC;AAAA,YAEC,UAAAX,EAAI;AAAA,UAAA;AAAA,QAAA;AAAA,QAELA,EAAI,mBAAmB,UAAaA,EAAI,mBAAmB,QAC3D,gBAAAE,EAACa,KAAwB,UAAAJ,GACxB,UAAA,gBAAAT;AAAA,UAACc;AAAA,UAAA;AAAA,YACA,SAAShB,GAAK,kBAAkB;AAAA,YAChC,OAAM;AAAA,YACN,MAAMA,EAAI;AAAA,YACV,SAAQ;AAAA,YACR,OAAOR,EAAS,QAAQ;AAAA,UAAA;AAAA,QAAA,GAE1B;AAAA,QAEAe,KAAiBC,MAAiB,WAClC,gBAAAN;AAAA,UAACK;AAAA,UAAA;AAAA,YACA,UACCI,IAAWnB,EAAS,WAAW,QAAQA,EAAS,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,MAE1D;AAAA,IAAA;AAAA,EAAA;AAIJ;AAEAf,EAAK,cAAc;AAEnB0B,EAAiB,cAAc;"}
|
|
@@ -5,7 +5,6 @@ export interface TabItemProps {
|
|
|
5
5
|
selected: boolean;
|
|
6
6
|
selectedTextColor: string;
|
|
7
7
|
isSquared?: boolean;
|
|
8
|
-
uniformBorder?: boolean;
|
|
9
8
|
}
|
|
10
9
|
export interface TabItemTextProps {
|
|
11
10
|
selected: boolean;
|
|
@@ -42,14 +41,10 @@ export interface TabViewHeaderProps {
|
|
|
42
41
|
size?: 'small' | 'default';
|
|
43
42
|
isSquared?: boolean;
|
|
44
43
|
containerStyles?: React.CSSProperties;
|
|
45
|
-
gap?: number;
|
|
46
|
-
/** Overrides the background of the leading/trailing number badge on the selected tab. */
|
|
47
|
-
selectedNumberBackground?: string;
|
|
48
44
|
'data-test'?: string;
|
|
49
45
|
}
|
|
50
46
|
export interface TabItemComponentProps {
|
|
51
47
|
hasEqualSpacing?: boolean;
|
|
52
|
-
uniformBorder?: boolean;
|
|
53
48
|
tab: TabInterface;
|
|
54
49
|
currentTab: string;
|
|
55
50
|
setCurrentTab: (tabKey: string) => void;
|
|
@@ -65,6 +60,4 @@ export interface TabItemComponentProps {
|
|
|
65
60
|
isLastElement?: boolean;
|
|
66
61
|
'data-test'?: string;
|
|
67
62
|
iconPosition?: 'left' | 'right';
|
|
68
|
-
/** Overrides the background of the leading/trailing number badge on the selected tab. */
|
|
69
|
-
selectedNumberBackground?: string;
|
|
70
63
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { TabItemProps, TabItemTextProps } from './Tabs.model';
|
|
2
2
|
export declare const TabHeader: import('styled-components').StyledComponent<"div", any, {
|
|
3
3
|
bgColor?: string | undefined;
|
|
4
|
-
tabGap?: number | undefined;
|
|
5
4
|
}, never>;
|
|
6
5
|
export declare const TabItem: import('styled-components').StyledComponent<"div", any, TabItemProps, never>;
|
|
7
6
|
export declare const TrailingNumberContainer: import('styled-components').StyledComponent<"div", any, {
|
|
8
7
|
selected: boolean;
|
|
9
|
-
selectedBackground?: string | undefined;
|
|
10
8
|
}, never>;
|
|
11
9
|
export declare const TabItemText: import('styled-components').StyledComponent<"div", any, {
|
|
12
10
|
numberOfLines?: number | undefined;
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
import t from "styled-components";
|
|
2
2
|
import { DEFAULT_THEME as o } from "../../constants/Theme.js";
|
|
3
3
|
import { ButtonLarge as r } from "../TypographyStyle.js";
|
|
4
|
-
const
|
|
4
|
+
const n = t.div`
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: row;
|
|
7
7
|
background-color: ${(e) => e.bgColor};
|
|
8
|
-
|
|
9
|
-
gap: ${e.tabGap}px;
|
|
10
|
-
position: relative;
|
|
11
|
-
&::after {
|
|
12
|
-
content: '';
|
|
13
|
-
position: absolute;
|
|
14
|
-
bottom: 0;
|
|
15
|
-
left: 0;
|
|
16
|
-
right: 0;
|
|
17
|
-
height: 1px;
|
|
18
|
-
background: ${o.colorsV2.background.inactive};
|
|
19
|
-
z-index: -1;
|
|
20
|
-
}
|
|
21
|
-
` : ""}
|
|
22
|
-
`, a = t.div`
|
|
8
|
+
`, l = t.div`
|
|
23
9
|
display: flex;
|
|
24
10
|
flex-direction: row;
|
|
25
11
|
column-gap: 8px;
|
|
@@ -28,8 +14,8 @@ const c = t.div`
|
|
|
28
14
|
align-items: center;
|
|
29
15
|
justify-content: center;
|
|
30
16
|
width: ${(e) => e.hasEqualSpacing ? "50%" : "auto"};
|
|
31
|
-
border-bottom-color: ${(e) => e.isSquared ? "" : e.selected ? e.selectedTextColor :
|
|
32
|
-
border-bottom-width: ${(e) => e.isSquared ? "" : e.selected
|
|
17
|
+
border-bottom-color: ${(e) => e.isSquared ? "" : e.selected ? e.selectedTextColor : o.colorsV2.background.inactive};
|
|
18
|
+
border-bottom-width: ${(e) => e.isSquared ? "" : e.selected ? "2px" : "1px"};
|
|
33
19
|
border-bottom-style: ${(e) => e.isSquared ? "" : "solid"};
|
|
34
20
|
border: ${(e) => e.isSquared ? e.selected ? `1px solid ${e.selectedTextColor}` : `1px solid ${o.colorsV2.background.inactive}` : ""};
|
|
35
21
|
flex-direction: row;
|
|
@@ -39,7 +25,7 @@ const c = t.div`
|
|
|
39
25
|
background-color: rgba(0, 0, 0, 0.03);
|
|
40
26
|
}
|
|
41
27
|
background-color: ${(e) => e.isSquared && e.selected ? `${o.colorsV2.background.brandLight}` : ""};
|
|
42
|
-
`,
|
|
28
|
+
`, a = t.div`
|
|
43
29
|
display: flex;
|
|
44
30
|
flex-direction: row;
|
|
45
31
|
align-items: center;
|
|
@@ -47,7 +33,7 @@ const c = t.div`
|
|
|
47
33
|
justify-content: center;
|
|
48
34
|
min-width: 20px;
|
|
49
35
|
height: 20px;
|
|
50
|
-
background: ${(e) => e.selected ?
|
|
36
|
+
background: ${(e) => e.selected ? o.colorsV2.background.inverseLight : o.colorsV2.content.secondary};
|
|
51
37
|
color: ${o.colorsV2.content.primaryInverse};
|
|
52
38
|
border-radius: 10px;
|
|
53
39
|
`, s = t(r)`
|
|
@@ -63,9 +49,9 @@ const c = t.div`
|
|
|
63
49
|
export {
|
|
64
50
|
x as EmptyTab,
|
|
65
51
|
b as RightComponent,
|
|
66
|
-
|
|
67
|
-
|
|
52
|
+
n as TabHeader,
|
|
53
|
+
l as TabItem,
|
|
68
54
|
s as TabItemText,
|
|
69
|
-
|
|
55
|
+
a as TrailingNumberContainer
|
|
70
56
|
};
|
|
71
57
|
//# sourceMappingURL=Tabs.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.styles.js","sources":["../../../../src/components/tabs/Tabs.styles.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { DEFAULT_THEME } from '@src/constants/Theme';\nimport { ButtonLarge } from '../TypographyStyle';\nimport { TabItemProps, TabItemTextProps } from './Tabs.model';\n\nexport const TabHeader = styled.div<{ bgColor?: string
|
|
1
|
+
{"version":3,"file":"Tabs.styles.js","sources":["../../../../src/components/tabs/Tabs.styles.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { DEFAULT_THEME } from '@src/constants/Theme';\nimport { ButtonLarge } from '../TypographyStyle';\nimport { TabItemProps, TabItemTextProps } from './Tabs.model';\n\nexport const TabHeader = styled.div<{ bgColor?: string }>`\n\tdisplay: flex;\n\tflex-direction: row;\n\tbackground-color: ${(props) => props.bgColor};\n`;\n\nexport const TabItem = styled.div<TabItemProps>`\n\tdisplay: flex;\n\tflex-direction: row;\n\tcolumn-gap: 8px;\n\tpadding: ${(props) => (props.isSquared ? '8px 24px' : '14px 24px 12px 24px')};\n\tpadding-bottom: ${(props) =>\n\t\tprops.isSquared ? '' : props.selected ? '12px' : '13px'};\n\talign-items: center;\n\tjustify-content: center;\n\twidth: ${(props) => (props.hasEqualSpacing ? '50%' : 'auto')};\n\tborder-bottom-color: ${(props) =>\n\t\tprops.isSquared\n\t\t\t? ''\n\t\t\t: props.selected\n\t\t\t? props.selectedTextColor\n\t\t\t: DEFAULT_THEME.colorsV2.background.inactive};\n\tborder-bottom-width: ${(props) =>\n\t\tprops.isSquared ? '' : props.selected ? '2px' : '1px'};\n\tborder-bottom-style: ${(props) => (props.isSquared ? '' : 'solid')};\n\tborder: ${(props) =>\n\t\tprops.isSquared\n\t\t\t? props.selected\n\t\t\t\t? `1px solid ${props.selectedTextColor}`\n\t\t\t\t: `1px solid ${DEFAULT_THEME.colorsV2.background.inactive}`\n\t\t\t: ''};\n\tflex-direction: row;\n\tcursor: pointer;\n\tmin-width: ${(props) => (props.isSquared ? '120px' : '')};\n\t&:hover {\n\t\tbackground-color: rgba(0, 0, 0, 0.03);\n\t}\n\tbackground-color: ${(props) =>\n\t\tprops.isSquared\n\t\t\t? props.selected\n\t\t\t\t? `${DEFAULT_THEME.colorsV2.background.brandLight}`\n\t\t\t\t: ''\n\t\t\t: ''};\n`;\n\nexport const TrailingNumberContainer = styled.div<{\n\tselected: boolean;\n}>`\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 6px;\n\tjustify-content: center;\n\tmin-width: 20px;\n\theight: 20px;\n\tbackground: ${(props) =>\n\t\tprops.selected\n\t\t\t? DEFAULT_THEME.colorsV2.background.inverseLight\n\t\t\t: DEFAULT_THEME.colorsV2.content.secondary};\n\tcolor: ${DEFAULT_THEME.colorsV2.content.primaryInverse};\n\tborder-radius: 10px;\n`;\n\nexport const TabItemText = styled(ButtonLarge)<TabItemTextProps>`\n\tcolor: ${(props) =>\n\t\tprops.selected ? props.selectedTextColor : props.textColor};\n`;\n\nexport const EmptyTab = styled.div`\n\tflex-grow: 1;\n\tborder-bottom: 1px solid ${DEFAULT_THEME.colorsV2.background.inactive};\n`;\n\nexport const RightComponent = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tborder-bottom: 1px solid ${DEFAULT_THEME.colorsV2.background.inactive};\n`;\n"],"names":["TabHeader","styled","props","TabItem","DEFAULT_THEME","TrailingNumberContainer","TabItemText","ButtonLarge","EmptyTab","RightComponent"],"mappings":";;;AAKO,MAAMA,IAAYC,EAAO;AAAA;AAAA;AAAA,qBAGX,CAACC,MAAUA,EAAM,OAAO;AAAA,GAGhCC,IAAUF,EAAO;AAAA;AAAA;AAAA;AAAA,YAIlB,CAACC,MAAWA,EAAM,YAAY,aAAa,qBAAsB;AAAA,mBAC1D,CAACA,MAClBA,EAAM,YAAY,KAAKA,EAAM,WAAW,SAAS,MAAM;AAAA;AAAA;AAAA,UAG/C,CAACA,MAAWA,EAAM,kBAAkB,QAAQ,MAAO;AAAA,wBACrC,CAACA,MACvBA,EAAM,YACH,KACAA,EAAM,WACNA,EAAM,oBACNE,EAAc,SAAS,WAAW,QAAQ;AAAA,wBACvB,CAACF,MACvBA,EAAM,YAAY,KAAKA,EAAM,WAAW,QAAQ,KAAK;AAAA,wBAC/B,CAACA,MAAWA,EAAM,YAAY,KAAK,OAAQ;AAAA,WACxD,CAACA,MACVA,EAAM,YACHA,EAAM,WACL,aAAaA,EAAM,iBAAiB,KACpC,aAAaE,EAAc,SAAS,WAAW,QAAQ,KACxD,EAAE;AAAA;AAAA;AAAA,cAGO,CAACF,MAAWA,EAAM,YAAY,UAAU,EAAG;AAAA;AAAA;AAAA;AAAA,qBAIpC,CAACA,MACpBA,EAAM,aACHA,EAAM,WACL,GAAGE,EAAc,SAAS,WAAW,UAAU,KAEhD,EAAE;AAAA,GAGMC,IA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