@frontify/fondue 12.0.0-beta.223 → 12.0.0-beta.224
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,26 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useFocusRing as i } from "@react-aria/focus";
|
|
1
|
+
import o, { useRef as c } from "react";
|
|
3
2
|
import { FOCUS_VISIBLE_STYLE as l } from "../../utilities/focusStyle.es.js";
|
|
4
|
-
import { merge as
|
|
5
|
-
import { checkIfContainInteractiveElements as
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
return /* @__PURE__ */
|
|
3
|
+
import { merge as i } from "../../utilities/merge.es.js";
|
|
4
|
+
import { checkIfContainInteractiveElements as s } from "../../utilities/elements.es.js";
|
|
5
|
+
const I = ({ active: n, disabled: a, children: m, id: e }) => {
|
|
6
|
+
const t = c(null), r = s(t.current);
|
|
7
|
+
return /* @__PURE__ */ o.createElement(
|
|
9
8
|
"div",
|
|
10
9
|
{
|
|
11
10
|
role: "tabpanel",
|
|
12
11
|
ref: t,
|
|
13
12
|
id: `${e}-content`,
|
|
14
13
|
"aria-labelledby": e,
|
|
15
|
-
className:
|
|
16
|
-
tabIndex: r ? -1 : 0
|
|
17
|
-
...m
|
|
14
|
+
className: i([!n || a ? "tw-hidden" : "", !r && l]),
|
|
15
|
+
tabIndex: r ? -1 : 0
|
|
18
16
|
},
|
|
19
|
-
|
|
17
|
+
m
|
|
20
18
|
);
|
|
21
19
|
};
|
|
22
|
-
|
|
20
|
+
I.displayName = "FondueTabItem";
|
|
23
21
|
export {
|
|
24
|
-
|
|
22
|
+
I as TabItem
|
|
25
23
|
};
|
|
26
24
|
//# sourceMappingURL=TabItem.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabItem.es.js","sources":["../../../src/components/Tabs/TabItem.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport React, { ReactElement, ReactNode, useRef } from 'react';\nimport { BadgeProps } from '@components/Badge';\nimport {
|
|
1
|
+
{"version":3,"file":"TabItem.es.js","sources":["../../../src/components/Tabs/TabItem.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport React, { ReactElement, ReactNode, useRef } from 'react';\nimport { BadgeProps } from '@components/Badge';\nimport { FOCUS_VISIBLE_STYLE } from '@utilities/focusStyle';\nimport { merge } from '@utilities/merge';\nimport { checkIfContainInteractiveElements } from '@utilities/elements';\n\nexport type TabItemProps = {\n id: string;\n label: string;\n onClick?: () => void;\n disabled?: boolean;\n decorator?: ReactElement;\n badge?: BadgeProps;\n children: ReactNode;\n};\n\nexport const TabItem = ({ active, disabled, children, id }: TabItemProps & { active?: boolean }): ReactElement => {\n const ref = useRef<HTMLDivElement | null>(null);\n const hasInteractiveElements = checkIfContainInteractiveElements(ref.current);\n\n return (\n <div\n role=\"tabpanel\"\n ref={ref}\n id={`${id}-content`}\n aria-labelledby={id}\n className={merge([!active || disabled ? 'tw-hidden' : '', !hasInteractiveElements && FOCUS_VISIBLE_STYLE])}\n tabIndex={hasInteractiveElements ? -1 : 0}\n >\n {children}\n </div>\n );\n};\nTabItem.displayName = 'FondueTabItem';\n"],"names":["TabItem","active","disabled","children","id","ref","useRef","hasInteractiveElements","checkIfContainInteractiveElements","React","merge","FOCUS_VISIBLE_STYLE"],"mappings":";;;;AAkBO,MAAMA,IAAU,CAAC,EAAE,QAAAC,GAAQ,UAAAC,GAAU,UAAAC,GAAU,IAAAC,QAA4D;AACxG,QAAAC,IAAMC,EAA8B,IAAI,GACxCC,IAAyBC,EAAkCH,EAAI,OAAO;AAGxE,SAAA,gBAAAI,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,MAAK;AAAA,MACL,KAAAJ;AAAA,MACA,IAAI,GAAGD;AAAA,MACP,mBAAiBA;AAAA,MACjB,WAAWM,EAAM,CAAC,CAACT,KAAUC,IAAW,cAAc,IAAI,CAACK,KAA0BI,CAAmB,CAAC;AAAA,MACzG,UAAUJ,IAAyB,KAAK;AAAA,IAAA;AAAA,IAEvCJ;AAAA,EAAA;AAGb;AACAH,EAAQ,cAAc;"}
|