@vitality-ds/components 5.6.1-alpha.2 → 5.6.1
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/Tabs/index.js
CHANGED
|
@@ -16,27 +16,37 @@ function Tabs(_ref) {
|
|
|
16
16
|
tabAlignment = _ref.tabAlignment,
|
|
17
17
|
tabsData = _ref.tabsData,
|
|
18
18
|
tabListAriaLabel = _ref.tabListAriaLabel,
|
|
19
|
-
defaultValue = _ref.defaultValue
|
|
19
|
+
defaultValue = _ref.defaultValue,
|
|
20
|
+
value = _ref.value,
|
|
21
|
+
onValueChange = _ref.onValueChange,
|
|
22
|
+
orientation = _ref.orientation,
|
|
23
|
+
dir = _ref.dir,
|
|
24
|
+
activationMode = _ref.activationMode;
|
|
20
25
|
return /*#__PURE__*/_react["default"].createElement(_Root["default"], {
|
|
21
|
-
defaultValue: defaultValue || ((_tabsData$ = tabsData[0]) === null || _tabsData$ === void 0 ? void 0 : _tabsData$.value)
|
|
26
|
+
defaultValue: defaultValue || ((_tabsData$ = tabsData[0]) === null || _tabsData$ === void 0 ? void 0 : _tabsData$.value),
|
|
27
|
+
value: value,
|
|
28
|
+
onValueChange: onValueChange,
|
|
29
|
+
orientation: orientation,
|
|
30
|
+
dir: dir,
|
|
31
|
+
activationMode: activationMode
|
|
22
32
|
}, /*#__PURE__*/_react["default"].createElement(_TabsList.BaseTabsListContainer, null, /*#__PURE__*/_react["default"].createElement(_TabsList.BaseTabsList, {
|
|
23
33
|
tabAlignment: tabAlignment,
|
|
24
34
|
"aria-label": tabListAriaLabel
|
|
25
35
|
}, tabsData.map(function (_ref2) {
|
|
26
|
-
var
|
|
36
|
+
var tabValue = _ref2.value,
|
|
27
37
|
label = _ref2.label,
|
|
28
38
|
disabled = _ref2.disabled;
|
|
29
39
|
return /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
|
|
30
|
-
key:
|
|
31
|
-
value:
|
|
40
|
+
key: tabValue,
|
|
41
|
+
value: tabValue,
|
|
32
42
|
disabled: disabled
|
|
33
43
|
}, label);
|
|
34
44
|
})), additionalActions), tabsData.map(function (_ref3) {
|
|
35
|
-
var
|
|
45
|
+
var tabValue = _ref3.value,
|
|
36
46
|
contentRenderer = _ref3.contentRenderer;
|
|
37
47
|
return /*#__PURE__*/_react["default"].createElement(_TabContent["default"], {
|
|
38
|
-
key:
|
|
39
|
-
value:
|
|
48
|
+
key: tabValue,
|
|
49
|
+
value: tabValue
|
|
40
50
|
}, contentRenderer(tabsData));
|
|
41
51
|
}));
|
|
42
52
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { TabsProps } from "./types";
|
|
3
|
-
declare function Tabs({ additionalActions, tabAlignment, tabsData, tabListAriaLabel, defaultValue, }: TabsProps): JSX.Element;
|
|
3
|
+
declare function Tabs({ additionalActions, tabAlignment, tabsData, tabListAriaLabel, defaultValue, value, onValueChange, orientation, dir, activationMode, }: TabsProps): JSX.Element;
|
|
4
4
|
export default Tabs;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TabsProps as RadixTabsProps } from "@radix-ui/react-tabs";
|
|
1
2
|
import { VariantProps } from "@vitality-ds/system";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { RemoveBreakPointVariants, valueof } from "../helpers/logic/type-helpers";
|
|
@@ -10,7 +11,7 @@ declare type TabData = {
|
|
|
10
11
|
};
|
|
11
12
|
export declare type TabsData = TabData[];
|
|
12
13
|
declare type TabAlignment = valueof<RemoveBreakPointVariants<Pick<VariantProps<typeof BaseTabsList>, "tabAlignment">>>;
|
|
13
|
-
export declare type TabsProps = {
|
|
14
|
+
export declare type TabsProps = Pick<RadixTabsProps, "defaultValue" | "value" | "onValueChange" | "orientation" | "dir" | "activationMode"> & {
|
|
14
15
|
/**
|
|
15
16
|
* Pass any react component to the right side of the tabs list area. This component will also be contained by the underline of the tabs list area.
|
|
16
17
|
*/
|
|
@@ -28,10 +29,5 @@ export declare type TabsProps = {
|
|
|
28
29
|
* aria-label property which describes the tabs list element.
|
|
29
30
|
*/
|
|
30
31
|
tabListAriaLabel: string;
|
|
31
|
-
/**
|
|
32
|
-
* Option to pass in which tab should be displayed by default. Uses the `value` property of tabsData
|
|
33
|
-
* @default tabsData[0].value
|
|
34
|
-
*/
|
|
35
|
-
defaultValue?: string;
|
|
36
32
|
};
|
|
37
33
|
export {};
|
package/dist/esm/Tabs/index.js
CHANGED
|
@@ -9,27 +9,37 @@ function Tabs(_ref) {
|
|
|
9
9
|
tabAlignment = _ref.tabAlignment,
|
|
10
10
|
tabsData = _ref.tabsData,
|
|
11
11
|
tabListAriaLabel = _ref.tabListAriaLabel,
|
|
12
|
-
defaultValue = _ref.defaultValue
|
|
12
|
+
defaultValue = _ref.defaultValue,
|
|
13
|
+
value = _ref.value,
|
|
14
|
+
onValueChange = _ref.onValueChange,
|
|
15
|
+
orientation = _ref.orientation,
|
|
16
|
+
dir = _ref.dir,
|
|
17
|
+
activationMode = _ref.activationMode;
|
|
13
18
|
return /*#__PURE__*/React.createElement(Root, {
|
|
14
|
-
defaultValue: defaultValue || ((_tabsData$ = tabsData[0]) === null || _tabsData$ === void 0 ? void 0 : _tabsData$.value)
|
|
19
|
+
defaultValue: defaultValue || ((_tabsData$ = tabsData[0]) === null || _tabsData$ === void 0 ? void 0 : _tabsData$.value),
|
|
20
|
+
value: value,
|
|
21
|
+
onValueChange: onValueChange,
|
|
22
|
+
orientation: orientation,
|
|
23
|
+
dir: dir,
|
|
24
|
+
activationMode: activationMode
|
|
15
25
|
}, /*#__PURE__*/React.createElement(BaseTabsListContainer, null, /*#__PURE__*/React.createElement(BaseTabsList, {
|
|
16
26
|
tabAlignment: tabAlignment,
|
|
17
27
|
"aria-label": tabListAriaLabel
|
|
18
28
|
}, tabsData.map(function (_ref2) {
|
|
19
|
-
var
|
|
29
|
+
var tabValue = _ref2.value,
|
|
20
30
|
label = _ref2.label,
|
|
21
31
|
disabled = _ref2.disabled;
|
|
22
32
|
return /*#__PURE__*/React.createElement(Tab, {
|
|
23
|
-
key:
|
|
24
|
-
value:
|
|
33
|
+
key: tabValue,
|
|
34
|
+
value: tabValue,
|
|
25
35
|
disabled: disabled
|
|
26
36
|
}, label);
|
|
27
37
|
})), additionalActions), tabsData.map(function (_ref3) {
|
|
28
|
-
var
|
|
38
|
+
var tabValue = _ref3.value,
|
|
29
39
|
contentRenderer = _ref3.contentRenderer;
|
|
30
40
|
return /*#__PURE__*/React.createElement(TabContent, {
|
|
31
|
-
key:
|
|
32
|
-
value:
|
|
41
|
+
key: tabValue,
|
|
42
|
+
value: tabValue
|
|
33
43
|
}, contentRenderer(tabsData));
|
|
34
44
|
}));
|
|
35
45
|
}
|
|
@@ -25,14 +25,10 @@ export interface FontWeightToken extends BaseToken {
|
|
|
25
25
|
name: "regular" | "medium" | "semibold" | "bold";
|
|
26
26
|
data: FontWeightValue;
|
|
27
27
|
}
|
|
28
|
-
declare type FontTypeface = "sans" | "sansDisplay" | "sansMedium" | "sansSemibold" | "sansBold" | "sansDisplayMedium" | "sansDisplaySemibold" | "sansDisplayBold";
|
|
29
28
|
export declare type FontFamilyTokens = {
|
|
30
|
-
|
|
29
|
+
[platform in Platforms]: {
|
|
31
30
|
[x in "sans" | "sansDisplay"]: FontFamilyToken;
|
|
32
31
|
};
|
|
33
|
-
reactNative: {
|
|
34
|
-
[x in FontTypeface]: FontFamilyToken;
|
|
35
|
-
};
|
|
36
32
|
};
|
|
37
33
|
export declare type FontSizeTokens = {
|
|
38
34
|
[platform in Platforms]: {
|