@veracity/vui 2.17.1 → 2.17.2-beta.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/cjs/footer/footer.js +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/stepIndicator/index.d.ts.map +1 -0
- package/dist/cjs/stepIndicator/stepIndicator.d.ts.map +1 -0
- package/dist/cjs/{step → stepIndicator}/stepIndicator.js +2 -2
- package/dist/cjs/stepIndicator/stepIndicatorTypes.d.ts.map +1 -0
- package/dist/cjs/stepIndicator/theme.d.ts.map +1 -0
- package/dist/cjs/stepperHorizontal/consts.d.ts +3 -7
- package/dist/cjs/stepperHorizontal/consts.d.ts.map +1 -1
- package/dist/cjs/stepperHorizontal/consts.js +3 -1
- package/dist/cjs/stepperHorizontal/stepHorizontal.js +2 -2
- package/dist/cjs/stepperHorizontal/stepHorizontalTail.d.ts.map +1 -1
- package/dist/cjs/stepperHorizontal/stepHorizontalTail.js +1 -1
- package/dist/cjs/stepperHorizontal/stepperHorizontalBase.d.ts.map +1 -1
- package/dist/cjs/stepperHorizontal/stepperHorizontalBase.js +9 -0
- package/dist/cjs/stepperHorizontal/stepperHorizontalTypes.d.ts +1 -1
- package/dist/cjs/stepperHorizontal/stepperHorizontalTypes.d.ts.map +1 -1
- package/dist/cjs/stepperVertical/stepVertical.js +2 -2
- package/dist/cjs/stepperVertical/stepperVerticalTypes.d.ts +1 -1
- package/dist/cjs/stepperVertical/stepperVerticalTypes.d.ts.map +1 -1
- package/dist/cjs/tabs/tab.d.ts.map +1 -1
- package/dist/cjs/tabs/tabs.d.ts +5 -3
- package/dist/cjs/tabs/tabs.d.ts.map +1 -1
- package/dist/cjs/tabs/tabs.js +19 -15
- package/dist/cjs/tabs/tabs.types.d.ts +12 -6
- package/dist/cjs/tabs/tabs.types.d.ts.map +1 -1
- package/dist/cjs/tabs/tabsNavBar.d.ts.map +1 -1
- package/dist/cjs/tabs/tabsNavBar.js +3 -3
- package/dist/cjs/tabs/useTabsState.d.ts +4 -4
- package/dist/cjs/tabs/useTabsState.d.ts.map +1 -1
- package/dist/cjs/tabs/useTabsState.js +2 -2
- package/dist/cjs/theme/components.js +1 -1
- package/dist/esm/footer/footer.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/stepIndicator/index.d.ts.map +1 -0
- package/dist/esm/stepIndicator/stepIndicator.d.ts.map +1 -0
- package/dist/esm/{step → stepIndicator}/stepIndicator.js +2 -2
- package/dist/esm/stepIndicator/stepIndicatorTypes.d.ts.map +1 -0
- package/dist/esm/stepIndicator/theme.d.ts.map +1 -0
- package/dist/esm/stepperHorizontal/consts.d.ts +3 -7
- package/dist/esm/stepperHorizontal/consts.d.ts.map +1 -1
- package/dist/esm/stepperHorizontal/consts.js +2 -0
- package/dist/esm/stepperHorizontal/stepHorizontal.js +2 -2
- package/dist/esm/stepperHorizontal/stepHorizontalTail.d.ts.map +1 -1
- package/dist/esm/stepperHorizontal/stepHorizontalTail.js +2 -2
- package/dist/esm/stepperHorizontal/stepperHorizontalBase.d.ts.map +1 -1
- package/dist/esm/stepperHorizontal/stepperHorizontalBase.js +10 -1
- package/dist/esm/stepperHorizontal/stepperHorizontalTypes.d.ts +1 -1
- package/dist/esm/stepperHorizontal/stepperHorizontalTypes.d.ts.map +1 -1
- package/dist/esm/stepperVertical/stepVertical.js +1 -1
- package/dist/esm/stepperVertical/stepperVerticalTypes.d.ts +1 -1
- package/dist/esm/stepperVertical/stepperVerticalTypes.d.ts.map +1 -1
- package/dist/esm/tabs/tab.d.ts.map +1 -1
- package/dist/esm/tabs/tabs.d.ts +5 -3
- package/dist/esm/tabs/tabs.d.ts.map +1 -1
- package/dist/esm/tabs/tabs.js +19 -15
- package/dist/esm/tabs/tabs.types.d.ts +12 -6
- package/dist/esm/tabs/tabs.types.d.ts.map +1 -1
- package/dist/esm/tabs/tabsNavBar.d.ts.map +1 -1
- package/dist/esm/tabs/tabsNavBar.js +3 -3
- package/dist/esm/tabs/useTabsState.d.ts +4 -4
- package/dist/esm/tabs/useTabsState.d.ts.map +1 -1
- package/dist/esm/tabs/useTabsState.js +2 -2
- package/dist/esm/theme/components.js +1 -1
- package/package.json +1 -1
- package/src/footer/footer.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/{step → stepIndicator}/stepIndicator.tsx +12 -8
- package/src/stepperHorizontal/consts.ts +5 -1
- package/src/stepperHorizontal/stepHorizontal.tsx +2 -2
- package/src/stepperHorizontal/stepHorizontalTail.tsx +3 -5
- package/src/stepperHorizontal/stepperHorizontalBase.ts +12 -1
- package/src/stepperHorizontal/stepperHorizontalTypes.ts +1 -1
- package/src/stepperVertical/stepVertical.tsx +1 -1
- package/src/stepperVertical/stepperVerticalTypes.ts +1 -1
- package/src/tabs/tab.tsx +0 -2
- package/src/tabs/tabs.tsx +20 -16
- package/src/tabs/tabs.types.ts +13 -7
- package/src/tabs/tabsNavBar.tsx +11 -5
- package/src/tabs/useTabsState.ts +4 -4
- package/src/theme/components.ts +1 -1
- package/dist/cjs/step/index.d.ts.map +0 -1
- package/dist/cjs/step/stepIndicator.d.ts.map +0 -1
- package/dist/cjs/step/stepIndicatorTypes.d.ts.map +0 -1
- package/dist/cjs/step/theme.d.ts.map +0 -1
- package/dist/esm/step/index.d.ts.map +0 -1
- package/dist/esm/step/stepIndicator.d.ts.map +0 -1
- package/dist/esm/step/stepIndicatorTypes.d.ts.map +0 -1
- package/dist/esm/step/theme.d.ts.map +0 -1
- /package/dist/cjs/{step → stepIndicator}/index.d.ts +0 -0
- /package/dist/cjs/{step → stepIndicator}/index.js +0 -0
- /package/dist/cjs/{step → stepIndicator}/stepIndicator.d.ts +0 -0
- /package/dist/cjs/{step → stepIndicator}/stepIndicatorTypes.d.ts +0 -0
- /package/dist/cjs/{step → stepIndicator}/stepIndicatorTypes.js +0 -0
- /package/dist/cjs/{step → stepIndicator}/theme.d.ts +0 -0
- /package/dist/cjs/{step → stepIndicator}/theme.js +0 -0
- /package/dist/esm/{step → stepIndicator}/index.d.ts +0 -0
- /package/dist/esm/{step → stepIndicator}/index.js +0 -0
- /package/dist/esm/{step → stepIndicator}/stepIndicator.d.ts +0 -0
- /package/dist/esm/{step → stepIndicator}/stepIndicatorTypes.d.ts +0 -0
- /package/dist/esm/{step → stepIndicator}/stepIndicatorTypes.js +0 -0
- /package/dist/esm/{step → stepIndicator}/theme.d.ts +0 -0
- /package/dist/esm/{step → stepIndicator}/theme.js +0 -0
- /package/src/{step → stepIndicator}/index.ts +0 -0
- /package/src/{step → stepIndicator}/stepIndicatorTypes.ts +0 -0
- /package/src/{step → stepIndicator}/theme.ts +0 -0
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
export declare const variantColor:
|
|
2
|
-
active: string;
|
|
3
|
-
completed: string;
|
|
4
|
-
optional: string;
|
|
5
|
-
pending: string;
|
|
6
|
-
error: string;
|
|
7
|
-
};
|
|
1
|
+
export declare const variantColor: Record<string, string>;
|
|
8
2
|
export declare const titleColor: {
|
|
9
3
|
active: string;
|
|
10
4
|
completed: string;
|
|
@@ -15,4 +9,6 @@ export declare const titleColor: {
|
|
|
15
9
|
export declare const boldTitles: string[];
|
|
16
10
|
export declare const stepClassName = "vui-stepHorizontal";
|
|
17
11
|
export declare const tailClassName: string;
|
|
12
|
+
export declare const tailClassNameLeft: string;
|
|
13
|
+
export declare const tailClassNameRight: string;
|
|
18
14
|
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../src/stepperHorizontal/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../src/stepperHorizontal/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAM/C,CAAA;AAED,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAA;AAED,eAAO,MAAM,UAAU,UAAsB,CAAA;AAE7C,eAAO,MAAM,aAAa,uBAAuB,CAAA;AAEjD,eAAO,MAAM,aAAa,QAAyB,CAAA;AAEnD,eAAO,MAAM,iBAAiB,QAAyB,CAAA;AAEvD,eAAO,MAAM,kBAAkB,QAA0B,CAAA"}
|
|
@@ -15,3 +15,5 @@ export const titleColor = {
|
|
|
15
15
|
export const boldTitles = ['active', 'error'];
|
|
16
16
|
export const stepClassName = 'vui-stepHorizontal';
|
|
17
17
|
export const tailClassName = stepClassName + 'Tail';
|
|
18
|
+
export const tailClassNameLeft = tailClassName + 'Left';
|
|
19
|
+
export const tailClassNameRight = tailClassName + 'Right';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '../box';
|
|
3
3
|
import { styled, vui } from '../core';
|
|
4
|
-
import { StepIndicator } from '../
|
|
4
|
+
import { StepIndicator } from '../stepIndicator';
|
|
5
5
|
import { cs } from '../utils';
|
|
6
6
|
import { stepClassName } from './consts';
|
|
7
7
|
import { useStepperHorizontalContext } from './context';
|
|
@@ -19,7 +19,7 @@ export const StepHorizontalBase = styled.divBox `
|
|
|
19
19
|
export const StepHorizontal = vui(({ icon, number, size: propSize = 'md', description, title, className, variant, children }, ref) => {
|
|
20
20
|
const context = useStepperHorizontalContext();
|
|
21
21
|
const size = context?.size || propSize;
|
|
22
|
-
return (_jsxs(StepHorizontalBase, { className: cs(stepClassName, className), ref: ref, children: [_jsx(StepHorizontalTail, { size: size, variant: variant }), _jsx(Box, { display: "block", textAlign: "center", children: _jsx(StepIndicator, { icon: icon, number: number, size: size, variant: variant }) }), _jsxs(Box, { display: "block", textAlign: "center", children: [!!title && (_jsx(StepHorizontalTitle, { size: size, variant: variant, children: title })), !!description && (_jsx(Box, { color: "sandstone.45", display: "block", fontSize: `${size === 'md' ? 14 : 12}px`, textAlign: "center", children: description })), _jsx(Box, { display: "block", children: children })] })] }));
|
|
22
|
+
return (_jsxs(StepHorizontalBase, { className: cs(stepClassName, stepClassName + variant, className), ref: ref, children: [_jsx(StepHorizontalTail, { size: size, variant: variant }), _jsx(Box, { display: "block", textAlign: "center", children: _jsx(StepIndicator, { icon: icon, number: number, size: size, variant: variant }) }), _jsxs(Box, { display: "block", textAlign: "center", children: [!!title && (_jsx(StepHorizontalTitle, { size: size, variant: variant, children: title })), !!description && (_jsx(Box, { color: "sandstone.45", display: "block", fontSize: `${size === 'md' ? 14 : 12}px`, textAlign: "center", children: description })), _jsx(Box, { display: "block", children: children })] })] }));
|
|
23
23
|
});
|
|
24
24
|
StepHorizontal.displayName = 'StepHorizontal';
|
|
25
25
|
export default StepHorizontal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepHorizontalTail.d.ts","sourceRoot":"","sources":["../../../src/stepperHorizontal/stepHorizontalTail.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stepHorizontalTail.d.ts","sourceRoot":"","sources":["../../../src/stepperHorizontal/stepHorizontalTail.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAElE;;GAEG;AACH,eAAO,MAAM,kBAAkB,gEAgB7B,CAAA;AAIF,eAAe,kBAAkB,CAAA"}
|
|
@@ -2,13 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box } from '../box';
|
|
3
3
|
import { vui } from '../core';
|
|
4
4
|
import { cs } from '../utils';
|
|
5
|
-
import { tailClassName,
|
|
5
|
+
import { tailClassName, tailClassNameLeft, tailClassNameRight } from './consts';
|
|
6
6
|
/**
|
|
7
7
|
* Implements Horizontal stepper tail (the Horizontal line) **
|
|
8
8
|
*/
|
|
9
9
|
export const StepHorizontalTail = vui((props, ref) => {
|
|
10
10
|
const { children, className, variant = 'active', ...rest } = props;
|
|
11
|
-
return (_jsxs(Box, { className: cs(tailClassName), h: "16px", justifyContent: "space-between", position: "absolute", ref: ref, w: "100%", ...rest, children: [_jsx(Box, {
|
|
11
|
+
return (_jsxs(Box, { className: cs(tailClassName), h: "16px", justifyContent: "space-between", position: "absolute", ref: ref, w: "100%", ...rest, children: [_jsx(Box, { className: cs(tailClassName, tailClassNameLeft, tailClassNameLeft + variant) }), _jsx(Box, { className: cs(tailClassName, tailClassNameRight, tailClassNameLeft + variant) })] }));
|
|
12
12
|
});
|
|
13
13
|
StepHorizontalTail.displayName = 'StepHorizontalTail';
|
|
14
14
|
export default StepHorizontalTail;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepperHorizontalBase.d.ts","sourceRoot":"","sources":["../../../src/stepperHorizontal/stepperHorizontalBase.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"stepperHorizontalBase.d.ts","sourceRoot":"","sources":["../../../src/stepperHorizontal/stepperHorizontalBase.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,qBAAqB,kpJAkB1B,CAAA;AACD,eAAe,qBAAqB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled } from '../core';
|
|
2
|
-
import { stepClassName, tailClassName } from './consts';
|
|
2
|
+
import { stepClassName, tailClassName, tailClassNameLeft, tailClassNameRight, variantColor } from './consts';
|
|
3
3
|
const StepperHorizontalBase = styled.divBox `
|
|
4
4
|
display: flex;
|
|
5
5
|
width: 100%;
|
|
@@ -7,5 +7,14 @@ const StepperHorizontalBase = styled.divBox `
|
|
|
7
7
|
.${stepClassName}:first-of-type .${tailClassName}Left, .${stepClassName}:last-of-type .${tailClassName}Right {
|
|
8
8
|
visibility: hidden;
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
.${tailClassNameLeft}, .${tailClassNameRight} {
|
|
12
|
+
width: 50%;
|
|
13
|
+
}
|
|
14
|
+
${Object.keys(variantColor).map((variant) => `.${tailClassNameLeft + variant},
|
|
15
|
+
.${tailClassNameRight + variant},
|
|
16
|
+
.${stepClassName + variant} + .${stepClassName} .${tailClassNameLeft} {
|
|
17
|
+
border-bottom: 1px solid ${variantColor[variant]};
|
|
18
|
+
}`)}
|
|
10
19
|
`;
|
|
11
20
|
export default StepperHorizontalBase;
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { BoxProps } from '../box';
|
|
3
3
|
import { ChildrenProp } from '../core';
|
|
4
4
|
import { IconProp } from '../icon';
|
|
5
|
-
import { StepIndicatorVariant } from '../
|
|
5
|
+
import { StepIndicatorVariant } from '../stepIndicator/stepIndicatorTypes';
|
|
6
6
|
import { SystemProps } from '../system';
|
|
7
7
|
import { ThemingProps } from '../theme';
|
|
8
8
|
export type StepHorizontalSize = 'md' | 'sm' | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepperHorizontalTypes.d.ts","sourceRoot":"","sources":["../../../src/stepperHorizontal/stepperHorizontalTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"stepperHorizontalTypes.d.ts","sourceRoot":"","sources":["../../../src/stepperHorizontal/stepperHorizontalTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;AAExD,MAAM,MAAM,sBAAsB,GAAG,WAAW,GAAG,YAAY,CAAC,mBAAmB,CAAC,GAAG,YAAY,CAAA;AAEnG,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAC3C,YAAY,GAAG;IACb,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,kBAAkB,CAAA;IACzB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAC/B,CAAA;AAEH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG;IAC/C,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG;IAChD,IAAI,CAAC,EAAE,kBAAkB,CAAA;IACzB,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAC/B,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '../box';
|
|
3
3
|
import { styled, vui } from '../core';
|
|
4
|
-
import { StepIndicator } from '../
|
|
4
|
+
import { StepIndicator } from '../stepIndicator';
|
|
5
5
|
import { cs } from '../utils';
|
|
6
6
|
import { stepClassName } from './consts';
|
|
7
7
|
import { useStepperVerticalContext } from './context';
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { BoxProps } from '../box';
|
|
3
3
|
import { ChildrenProp } from '../core';
|
|
4
4
|
import { IconProp } from '../icon';
|
|
5
|
-
import { StepIndicatorVariant } from '../
|
|
5
|
+
import { StepIndicatorVariant } from '../stepIndicator/stepIndicatorTypes';
|
|
6
6
|
import { SystemProps } from '../system';
|
|
7
7
|
import { ThemingProps } from '../theme';
|
|
8
8
|
export type StepVerticalSize = 'md' | 'sm' | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepperVerticalTypes.d.ts","sourceRoot":"","sources":["../../../src/stepperVertical/stepperVerticalTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"stepperVerticalTypes.d.ts","sourceRoot":"","sources":["../../../src/stepperVertical/stepperVerticalTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;AAEtD,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,YAAY,CAAC,iBAAiB,CAAC,GAAG,YAAY,CAAA;AAE/F,MAAM,MAAM,iBAAiB,GAAG,WAAW,GACzC,YAAY,GAAG;IACb,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAC/B,CAAA;AAEH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG;IAC7C,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG;IAC9C,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAC/B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["../../../src/tabs/tab.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["../../../src/tabs/tab.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,eAAO,MAAM,OAAO,+HAEnB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,GAAG,iDAId,CAAA;AAIF,eAAe,GAAG,CAAA"}
|
package/dist/esm/tabs/tabs.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TabId, TabsProps } from './tabs.types';
|
|
2
3
|
export declare const TabsBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").AnimationProps & import("..").BackgroundColorProps & import("..").BorderProps & import("..").BorderTopProps & import("..").BorderRightProps & import("..").BorderBottomProps & import("..").BorderLeftProps & import("..").BorderColorProps & import("..").BorderTopColorProps & import("..").BorderRightColorProps & import("..").BorderBottomColorProps & import("..").BorderLeftColorProps & import("..").BorderWidthProps & import("..").BorderTopWidthProps & import("..").BorderRightWidthProps & import("..").BorderBottomWidthProps & import("..").BorderLeftWidthProps & import("..").BorderStyleProps & import("..").BorderRadiusProps & import("..").OutlineProps & import("..").OutlineColorProps & import("..").OutlineWidthProps & import("..").OutlineStyleProps & import("..").DivideXProps & import("..").DivideYProps & import("..").DivideXReverseProps & import("..").DivideYReverseProps & import("..").DivideColorProps & import("..").DivideStyleProps & import("..").RingProps & import("..").RingColorProps & import("..").OpacityProps & import("..").BoxShadowProps & import("..").TextShadowProps & import("..").DisplayProps & import("..").AlignItemsProps & import("..").AlignContentProps & import("..").JustifyContentProps & import("..").JustifyItemsProps & import("..").FlexWrapProps & import("..").FlexGrowProps & import("..").FlexShrinkProps & import("..").FlexBasisProps & import("..").FlexDirectionProps & import("..").FlexProps & import("..").JustifySelfProps & import("..").AlignSelfProps & import("..").OrderProps & import("../system/flexboxGrids").RowProps & import("../system/flexboxGrids").ColProps & import("../system/grids").GapProps & import("../system/grids").ColumnGapProps & import("../system/grids").RowGapProps & import("../system/grids").GridColumnProps & import("../system/grids").GridRowProps & import("../system/grids").GridAutoFlowProps & import("../system/grids").GridAutoColumnsProps & import("../system/grids").GridAutoRowsProps & import("../system/grids").GridTemplateColumnsProps & import("../system/grids").GridTemplateRowsProps & import("../system/grids").GridTemplateAreasProps & import("../system/grids").GridAreaProps & import("..").AppearanceProps & import("..").CursorProps & import("..").PointerEventsProps & import("..").ResizeProps & import("..").UserSelectProps & import("..").IsTruncatedProps & import("..").FloatProps & import("..").BoxSizingProps & import("..").OverflowProps & import("..").OverflowXProps & import("..").OverflowYProps & import("..").PositionProps & import("..").ZIndexProps & import("..").TopProps & import("..").RightProps & import("..").BottomProps & import("..").LeftProps & import("..").VisibilityProps & import("..").OverscrollBehaviorProps & import("..").ObjectFitProps & import("..").MaxLinesProps & import("..").WidthProps & import("..").HeightProps & import("..").MaxWidthProps & import("..").MaxHeightProps & import("..").MinWidthProps & import("..").MinHeightProps & import("..").MarginProps & import("..").MarginTopProps & import("..").MarginRightProps & import("..").MarginBottomProps & import("..").MarginLeftProps & import("..").MarginXProps & import("..").MarginYProps & import("..").PaddingProps & import("..").PaddingTopProps & import("..").PaddingRightProps & import("..").PaddingBottomProps & import("..").PaddingLeftProps & import("..").PaddingXProps & import("..").PaddingYProps & import("..").SpaceXProps & import("..").SpaceYProps & import("..").SpaceXReverseProps & import("..").SpaceYReverseProps & import("../system/tables").BorderCollapseProps & import("../system/tables").TableLayoutProps & import("..").TransformProps & import("..").TransformOriginProps & import("..").TranslateXProps & import("..").TranslateYProps & import("..").RotateProps & import("..").SkewXProps & import("..").SkewYProps & import("..").ScaleProps & import("..").ScaleXProps & import("..").ScaleYProps & import("..").TransitionProps & import("..").TransitionPropertyProps & import("..").TransitionDurationProps & import("..").TransitionTimingFunctionProps & import("..").TransitionDelayProps & import("..").FontFamilyProps & import("..").FontSizeProps & import("..").FontStyleProps & import("..").FontWeightProps & import("..").LineHeightProps & import("..").ColorProps & import("..").TextTransformProps & import("..").TextDecorationProps & import("..").TextAlignProps & import("..").VerticalAlignProps & import("..").LetterSpacingProps & import("..").WhiteSpaceProps & import("..").TextOverflowProps & import("..").ListStyleTypeProps & import("..").ListStylePositionProps & import("..").WordBreakProps & import("..").ThemingProps<"Tabs"> & import("../core").ChildrenProp & {
|
|
3
|
-
|
|
4
|
+
actions?: React.ReactNode;
|
|
5
|
+
activeTabId?: TabId | undefined;
|
|
4
6
|
showBorder?: boolean | undefined;
|
|
5
|
-
onTabClick?: ((
|
|
7
|
+
onTabClick?: ((tabId: TabId) => void) | undefined;
|
|
6
8
|
}, never>;
|
|
7
9
|
/**
|
|
8
10
|
* Implements Tabs navigation to switch between views. Implements Tabs navigation to switch between views. **Do not use as a top menu in a page!**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/tabs/tabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/tabs/tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAA;AAMhE,OAAO,EAAE,KAAK,EAA2B,SAAS,EAAE,MAAM,cAAc,CAAA;AAIxE,eAAO,MAAM,QAAQ;;;;;SAEpB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,kDAmEf,CAAA;AAIF,eAAe,IAAI,CAAA"}
|
package/dist/esm/tabs/tabs.js
CHANGED
|
@@ -13,19 +13,21 @@ export const TabsBase = styled.divBox `
|
|
|
13
13
|
* Implements Tabs navigation to switch between views. Implements Tabs navigation to switch between views. **Do not use as a top menu in a page!**
|
|
14
14
|
*/
|
|
15
15
|
export const Tabs = vui((props, ref) => {
|
|
16
|
-
const { activeTabId, showBorder = true, children, className, size, onTabClick, ...rest } = props;
|
|
16
|
+
const { actions, activeTabId, showBorder = true, children, className, size, onTabClick, ...rest } = props;
|
|
17
17
|
const styles = useStyleConfig('Tabs', props);
|
|
18
|
-
const { tabs, setTabs, activeTabIndex, setActiveTabIndex, animationDirection, setAnimationDirection } = useTabsState('fadeIn',
|
|
18
|
+
const { tabs, setTabs, activeTabIndex, setActiveTabIndex, animationDirection, setAnimationDirection } = useTabsState('fadeIn', 0);
|
|
19
19
|
useEffect(() => {
|
|
20
|
-
const
|
|
20
|
+
const _tabs = [];
|
|
21
21
|
if (children) {
|
|
22
22
|
;
|
|
23
23
|
Children.toArray(children).forEach((child, index) => {
|
|
24
24
|
if (child?.props?.title)
|
|
25
|
-
|
|
26
|
-
id:
|
|
25
|
+
_tabs.push({
|
|
26
|
+
id: child.props.id,
|
|
27
|
+
index: index,
|
|
27
28
|
title: child.props.title,
|
|
28
29
|
icon: child.props.icon,
|
|
30
|
+
className: child.props.className,
|
|
29
31
|
children: child.props.children,
|
|
30
32
|
disabled: child.props.disabled,
|
|
31
33
|
onClick: child.props.onClick,
|
|
@@ -33,22 +35,24 @@ export const Tabs = vui((props, ref) => {
|
|
|
33
35
|
});
|
|
34
36
|
});
|
|
35
37
|
}
|
|
36
|
-
setTabs(
|
|
37
|
-
if (activeTabId !== undefined
|
|
38
|
-
|
|
38
|
+
setTabs(_tabs);
|
|
39
|
+
if (activeTabId !== undefined) {
|
|
40
|
+
const tab = _tabs.find((t) => t?.id === activeTabId || t?.index === activeTabId);
|
|
41
|
+
if (tab?.index)
|
|
42
|
+
setActiveTabIndex(tab.index);
|
|
39
43
|
}
|
|
40
44
|
}, [children, activeTabId]);
|
|
41
|
-
const onNavItemClick = (
|
|
42
|
-
const tab = tabs.find(t => t.
|
|
43
|
-
if (tab?.children !== undefined) {
|
|
44
|
-
setAnimationDirection(
|
|
45
|
-
setActiveTabIndex(
|
|
46
|
-
onTabClick?.(id);
|
|
45
|
+
const onNavItemClick = (tabIndex, e) => {
|
|
46
|
+
const tab = tabs.find(t => t.index === tabIndex);
|
|
47
|
+
if (tab?.children !== undefined && tab?.index !== undefined) {
|
|
48
|
+
setAnimationDirection(tab.index < activeTabIndex ? 'fadeLeft' : 'fadeRight');
|
|
49
|
+
setActiveTabIndex(tab.index);
|
|
50
|
+
onTabClick?.(tab.id || tab.index);
|
|
47
51
|
}
|
|
48
52
|
tab?.onClick?.(e);
|
|
49
53
|
};
|
|
50
54
|
const activeTab = tabs?.[activeTabIndex];
|
|
51
|
-
return (_jsxs(TabsBase, { className: cs('vui-tabs', className), ref: ref, ...styles.container, ...rest, children: [!!tabs?.length && (_jsx(TabsNavBar, { activeNavItem: activeTabIndex, animationDirection: animationDirection, onNavItemClick: (
|
|
55
|
+
return (_jsxs(TabsBase, { className: cs('vui-tabs', className), ref: ref, ...styles.container, ...rest, children: [!!tabs?.length && (_jsx(TabsNavBar, { actions: actions, activeNavItem: activeTabIndex, animationDirection: animationDirection, onNavItemClick: (tabIndex, e) => onNavItemClick(tabIndex, e), showBorder: showBorder, size: size, tabs: tabs })), tabs?.length ? (_jsx(Tab, { onClick: activeTab?.onClick, title: activeTab?.title, children: !activeTab?.disabled && activeTab?.children })) : (_jsx(P, { p: 2, children: "Please specify Tabs." }))] }));
|
|
52
56
|
});
|
|
53
57
|
Tabs.displayName = 'Tabs';
|
|
54
58
|
export default Tabs;
|
|
@@ -4,16 +4,18 @@ import { IconProp } from '../icon';
|
|
|
4
4
|
import { SystemProps } from '../system';
|
|
5
5
|
import { ThemingProps } from '../theme';
|
|
6
6
|
export type AnimationDirection = 'fadeLeft' | 'fadeRight' | 'fadeIn';
|
|
7
|
+
export type TabId = string | number;
|
|
7
8
|
export type TabsSize = 'md' | 'sm' | 'lg' | 'xl' | 'xxl';
|
|
8
9
|
export type NavBarIconSize = 'md' | 'xs' | 'sm' | 'lg' | 'xl' | undefined;
|
|
9
10
|
export type TabsProps = SystemProps & ThemingProps<'Tabs'> & ChildrenProp & {
|
|
10
|
-
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
activeTabId?: TabId;
|
|
11
13
|
showBorder?: boolean;
|
|
12
|
-
onTabClick?: (
|
|
14
|
+
onTabClick?: (tabId: TabId) => void;
|
|
13
15
|
};
|
|
14
16
|
export type TabProps = SystemProps & ChildrenProp & {
|
|
15
17
|
icon?: IconProp;
|
|
16
|
-
id?:
|
|
18
|
+
id?: TabId;
|
|
17
19
|
title: ReactNode;
|
|
18
20
|
disabled?: boolean;
|
|
19
21
|
className?: string;
|
|
@@ -21,10 +23,14 @@ export type TabProps = SystemProps & ChildrenProp & {
|
|
|
21
23
|
/** If provided, displays a remove button with this function as onClick. */
|
|
22
24
|
onDelete?: (nativeEvent?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
23
25
|
};
|
|
26
|
+
export type TabIndexProps = TabProps & {
|
|
27
|
+
index?: number;
|
|
28
|
+
};
|
|
24
29
|
export type TabNavBarProps = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
actions?: ReactNode;
|
|
31
|
+
tabs: TabIndexProps[];
|
|
32
|
+
onNavItemClick: (tabIndex: number, e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
|
|
33
|
+
activeNavItem?: TabId;
|
|
28
34
|
animationDirection?: AnimationDirection;
|
|
29
35
|
showBorder?: boolean;
|
|
30
36
|
size?: TabsSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.types.d.ts","sourceRoot":"","sources":["../../../src/tabs/tabs.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"tabs.types.d.ts","sourceRoot":"","sources":["../../../src/tabs/tabs.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAA;AACpE,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;AACnC,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAA;AACxD,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;AAEzE,MAAM,MAAM,SAAS,GAAG,WAAW,GACjC,YAAY,CAAC,MAAM,CAAC,GACpB,YAAY,GAAG;IACb,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CACpC,CAAA;AAEH,MAAM,MAAM,QAAQ,GAAG,WAAW,GAChC,YAAY,GAAG;IACb,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,EAAE,CAAC,EAAE,KAAK,CAAA;IACV,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,KAAK,IAAI,CAAA;IAC7E,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAA;CACnF,CAAA;AAEH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,IAAI,EAAE,aAAa,EAAE,CAAA;IACrB,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,KAAK,IAAI,CAAA;IAC1F,aAAa,CAAC,EAAE,KAAK,CAAA;IACrB,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;IACvC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabsNavBar.d.ts","sourceRoot":"","sources":["../../../src/tabs/tabsNavBar.tsx"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"tabsNavBar.d.ts","sourceRoot":"","sources":["../../../src/tabs/tabsNavBar.tsx"],"names":[],"mappings":"AASA,OAAO,EAAiC,cAAc,EAAE,MAAM,cAAc,CAAA;AAK5E,eAAO,MAAM,UAAU,uDAgFrB,CAAA;AAIF,eAAe,UAAU,CAAA"}
|
|
@@ -9,7 +9,7 @@ import { colors, iconSizeMapper } from './consts';
|
|
|
9
9
|
import theme from './theme';
|
|
10
10
|
const { activeBg, border, color, hover, main } = colors;
|
|
11
11
|
export const TabsNavBar = vui((props, ref) => {
|
|
12
|
-
const { tabs, onNavItemClick, activeNavItem, animationDirection, showBorder, size = 'md' } = props;
|
|
12
|
+
const { actions, tabs, onNavItemClick, activeNavItem, animationDirection, showBorder, size = 'md' } = props;
|
|
13
13
|
const iconSize = iconSizeMapper?.[size] || 'md';
|
|
14
14
|
const { sizes } = theme ?? {};
|
|
15
15
|
const fontSize = sizes[size ?? 'md'].tabsNavBar.fontSize;
|
|
@@ -17,8 +17,8 @@ export const TabsNavBar = vui((props, ref) => {
|
|
|
17
17
|
const borderWidth = sizes[size ?? 'md'].tabsNavBar.borderWidth;
|
|
18
18
|
const py = sizes[size ?? 'md'].tabsNavBar.py;
|
|
19
19
|
const iconMarginRight = size === 'xxl' ? '16px' : '8px';
|
|
20
|
-
const isActive = (tab) => !tab.disabled && tab
|
|
21
|
-
return (
|
|
20
|
+
const isActive = (tab) => !tab.disabled && tab?.index === activeNavItem;
|
|
21
|
+
return (_jsxs(List, { alignItems: "end", borderBottom: showBorder ? `1px solid ${border}` : 'none', className: cs('vui-tabsNavBar'), display: "flex", isInteractive: true, mb: "20px", ref: ref, w: 1, children: [tabs?.map?.(tab => (_jsxs(ListItem, { activeBg: tab.disabled ? undefined : activeBg, bg: "white", className: `vui-tabsNavBarItem vui-tabsNavBarItem-${tab?.id}`, color: isActive(tab) ? main : color, disabled: tab.disabled, display: "inline-flex", fontSize: fontSize, fontWeight: 500, h: h, hoverBg: tab.disabled ? undefined : hover, onClick: e => onNavItemClick?.(tab.index || 0, e), position: "relative", px: "16px", py: py, children: [_jsxs(Box, { alignItems: "center", children: [!!tab.icon && _jsx(Icon, { mr: iconMarginRight, name: tab.icon, size: iconSize }), tab.title] }), !!tab.onDelete && (_jsx(TagButton, { disabled: tab.disabled, hoverBg: "skyBlue.80", hoverColor: "seaBlue.main", isRound: false, ml: 1, onClick: e => tab?.onDelete?.(e), title: "Delete" })), isActive(tab) && (_jsx(Box, { animation: animationDirection, bg: main, bottom: "-1px", h: borderWidth, left: 0, position: "absolute", w: 1, children: "\u00A0" }))] }, tab.index))), !!actions && (_jsx(Box, { ml: "auto", px: 0.75, py: 0.5, children: actions }))] }));
|
|
22
22
|
});
|
|
23
23
|
TabsNavBar.displayName = 'TabsNavBar';
|
|
24
24
|
export default TabsNavBar;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AnimationDirection,
|
|
3
|
-
export declare const useTabsState: (initialAnimation: AnimationDirection,
|
|
4
|
-
tabs:
|
|
5
|
-
setTabs: import("react").Dispatch<import("react").SetStateAction<
|
|
2
|
+
import { AnimationDirection, TabIndexProps } from './tabs.types';
|
|
3
|
+
export declare const useTabsState: (initialAnimation: AnimationDirection, tabIndex?: number) => {
|
|
4
|
+
tabs: TabIndexProps[];
|
|
5
|
+
setTabs: import("react").Dispatch<import("react").SetStateAction<TabIndexProps[]>>;
|
|
6
6
|
activeTabIndex: number;
|
|
7
7
|
setActiveTabIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
8
8
|
animationDirection: AnimationDirection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTabsState.d.ts","sourceRoot":"","sources":["../../../src/tabs/useTabsState.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"useTabsState.d.ts","sourceRoot":"","sources":["../../../src/tabs/useTabsState.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEhE,eAAO,MAAM,YAAY,qBAAsB,kBAAkB,aAAa,MAAM;;;;;;;CAMnF,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
-
export const useTabsState = (initialAnimation,
|
|
2
|
+
export const useTabsState = (initialAnimation, tabIndex) => {
|
|
3
3
|
const [tabs, setTabs] = useState([]);
|
|
4
|
-
const [activeTabIndex, setActiveTabIndex] = useState(
|
|
4
|
+
const [activeTabIndex, setActiveTabIndex] = useState(tabIndex ?? 0);
|
|
5
5
|
const [animationDirection, setAnimationDirection] = useState(initialAnimation);
|
|
6
6
|
return { tabs, setTabs, activeTabIndex, setActiveTabIndex, animationDirection, setAnimationDirection };
|
|
7
7
|
};
|
|
@@ -37,7 +37,7 @@ import Select from '../select/theme';
|
|
|
37
37
|
import Sidemenu from '../sidemenu/theme';
|
|
38
38
|
import Skeleton from '../skeleton/theme';
|
|
39
39
|
import Spinner from '../spinner/theme';
|
|
40
|
-
import StepIndicator from '../
|
|
40
|
+
import StepIndicator from '../stepIndicator/theme';
|
|
41
41
|
import StepperHorizontal from '../stepperHorizontal/theme';
|
|
42
42
|
import StepperVertical from '../stepperVertical/theme';
|
|
43
43
|
import Switch from '../switch/theme';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veracity/vui",
|
|
3
|
-
"version": "2.17.1",
|
|
3
|
+
"version": "2.17.2-beta.1",
|
|
4
4
|
"description": "Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
package/src/footer/footer.tsx
CHANGED
package/src/index.ts
CHANGED
|
@@ -43,7 +43,7 @@ export * from './radio'
|
|
|
43
43
|
export * from './select'
|
|
44
44
|
export * from './sidemenu'
|
|
45
45
|
export * from './skeleton'
|
|
46
|
-
export * from './
|
|
46
|
+
export * from './stepIndicator'
|
|
47
47
|
export * from './stepperHorizontal'
|
|
48
48
|
export * from './stepperVertical'
|
|
49
49
|
export * from './spinner'
|
|
@@ -6,11 +6,15 @@ import T from '../t'
|
|
|
6
6
|
import { cs } from '../utils'
|
|
7
7
|
import { StepIndicatorProps } from './stepIndicatorTypes'
|
|
8
8
|
|
|
9
|
-
const Content = ({ number, variant, size }:
|
|
9
|
+
const Content = ({ number, variant, size }: { number?: number; variant?: string; size?: string }) => {
|
|
10
10
|
if (typeof number === 'undefined') return null
|
|
11
|
-
if (variant === 'completed') return <Icon name="falCheck" size={size} />
|
|
12
|
-
if (variant === 'error') return <Icon name="falTimes" size={size} />
|
|
13
|
-
return
|
|
11
|
+
if (variant === 'completed') return <Icon name="falCheck" size={size as any} />
|
|
12
|
+
if (variant === 'error') return <Icon name="falTimes" size={size as any} />
|
|
13
|
+
return (
|
|
14
|
+
<T fontSize={size === 'md' ? 16 : 14} fontWeight={600}>
|
|
15
|
+
{number}
|
|
16
|
+
</T>
|
|
17
|
+
)
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
/**
|
|
@@ -22,7 +26,7 @@ export const StepIndicator = vui<'div', StepIndicatorProps>((props, ref) => {
|
|
|
22
26
|
|
|
23
27
|
return icon ? (
|
|
24
28
|
<Button
|
|
25
|
-
className={cs('vui-stepIndicator', className)}
|
|
29
|
+
className={cs('vui-stepIndicator', 'vui-stepIndicatorIcon', className)}
|
|
26
30
|
icon={icon}
|
|
27
31
|
ref={ref}
|
|
28
32
|
{...styles.icon}
|
|
@@ -34,7 +38,7 @@ export const StepIndicator = vui<'div', StepIndicatorProps>((props, ref) => {
|
|
|
34
38
|
/>
|
|
35
39
|
) : (
|
|
36
40
|
<Button
|
|
37
|
-
className={cs('vui-stepIndicator', className)}
|
|
41
|
+
className={cs('vui-stepIndicator', 'vui-stepIndicatorNumber', className)}
|
|
38
42
|
ref={ref}
|
|
39
43
|
{...styles.button}
|
|
40
44
|
{...rest}
|
|
@@ -46,8 +50,8 @@ export const StepIndicator = vui<'div', StepIndicatorProps>((props, ref) => {
|
|
|
46
50
|
size={size}
|
|
47
51
|
>
|
|
48
52
|
<Box mx={0.5} position="relative" />
|
|
49
|
-
<Box
|
|
50
|
-
<Content number={number} size={size} variant={variant} />
|
|
53
|
+
<Box mx={0.5} position="absolute">
|
|
54
|
+
<Content number={number} size={String(size)} variant={String(variant)} />
|
|
51
55
|
</Box>
|
|
52
56
|
</Button>
|
|
53
57
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const variantColor = {
|
|
1
|
+
export const variantColor: Record<string, string> = {
|
|
2
2
|
active: 'seaBlue.main',
|
|
3
3
|
completed: 'landGreen.41',
|
|
4
4
|
optional: 'seaBlue.45',
|
|
@@ -19,3 +19,7 @@ export const boldTitles = ['active', 'error']
|
|
|
19
19
|
export const stepClassName = 'vui-stepHorizontal'
|
|
20
20
|
|
|
21
21
|
export const tailClassName = stepClassName + 'Tail'
|
|
22
|
+
|
|
23
|
+
export const tailClassNameLeft = tailClassName + 'Left'
|
|
24
|
+
|
|
25
|
+
export const tailClassNameRight = tailClassName + 'Right'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box } from '../box'
|
|
2
2
|
import { styled, vui } from '../core'
|
|
3
|
-
import { StepIndicator } from '../
|
|
3
|
+
import { StepIndicator } from '../stepIndicator'
|
|
4
4
|
import { cs } from '../utils'
|
|
5
5
|
import { stepClassName } from './consts'
|
|
6
6
|
import { useStepperHorizontalContext } from './context'
|
|
@@ -23,7 +23,7 @@ export const StepHorizontal = vui<'div', StepHorizontalProps>(
|
|
|
23
23
|
const context = useStepperHorizontalContext()
|
|
24
24
|
const size = context?.size || propSize
|
|
25
25
|
return (
|
|
26
|
-
<StepHorizontalBase className={cs(stepClassName, className)} ref={ref}>
|
|
26
|
+
<StepHorizontalBase className={cs(stepClassName, stepClassName + variant, className)} ref={ref}>
|
|
27
27
|
<StepHorizontalTail size={size} variant={variant as any} />
|
|
28
28
|
<Box display="block" textAlign="center">
|
|
29
29
|
<StepIndicator icon={icon} number={number} size={size} variant={variant} />
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
1
|
import { Box } from '../box'
|
|
4
2
|
import { vui } from '../core'
|
|
5
3
|
import { cs } from '../utils'
|
|
6
|
-
import { tailClassName,
|
|
4
|
+
import { tailClassName, tailClassNameLeft, tailClassNameRight } from './consts'
|
|
7
5
|
import { StepHorizontalTailProps } from './stepperHorizontalTypes'
|
|
8
6
|
|
|
9
7
|
/**
|
|
@@ -21,8 +19,8 @@ export const StepHorizontalTail = vui<'div', StepHorizontalTailProps>((props, re
|
|
|
21
19
|
w="100%"
|
|
22
20
|
{...rest}
|
|
23
21
|
>
|
|
24
|
-
<Box
|
|
25
|
-
<Box
|
|
22
|
+
<Box className={cs(tailClassName, tailClassNameLeft, tailClassNameLeft + variant)} />
|
|
23
|
+
<Box className={cs(tailClassName, tailClassNameRight, tailClassNameLeft + variant)} />
|
|
26
24
|
</Box>
|
|
27
25
|
)
|
|
28
26
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled } from '../core'
|
|
2
|
-
import { stepClassName, tailClassName } from './consts'
|
|
2
|
+
import { stepClassName, tailClassName, tailClassNameLeft, tailClassNameRight, variantColor } from './consts'
|
|
3
3
|
import { StepperHorizontalProps } from './stepperHorizontalTypes'
|
|
4
4
|
|
|
5
5
|
const StepperHorizontalBase = styled.divBox<StepperHorizontalProps>`
|
|
@@ -9,5 +9,16 @@ const StepperHorizontalBase = styled.divBox<StepperHorizontalProps>`
|
|
|
9
9
|
.${stepClassName}:first-of-type .${tailClassName}Left, .${stepClassName}:last-of-type .${tailClassName}Right {
|
|
10
10
|
visibility: hidden;
|
|
11
11
|
}
|
|
12
|
+
|
|
13
|
+
.${tailClassNameLeft}, .${tailClassNameRight} {
|
|
14
|
+
width: 50%;
|
|
15
|
+
}
|
|
16
|
+
${Object.keys(variantColor).map(
|
|
17
|
+
(variant: string) => `.${tailClassNameLeft + variant},
|
|
18
|
+
.${tailClassNameRight + variant},
|
|
19
|
+
.${stepClassName + variant} + .${stepClassName} .${tailClassNameLeft} {
|
|
20
|
+
border-bottom: 1px solid ${variantColor[variant]};
|
|
21
|
+
}`
|
|
22
|
+
)}
|
|
12
23
|
`
|
|
13
24
|
export default StepperHorizontalBase
|
|
@@ -3,7 +3,7 @@ import { ReactNode } from 'react'
|
|
|
3
3
|
import { BoxProps } from '../box'
|
|
4
4
|
import { ChildrenProp } from '../core'
|
|
5
5
|
import { IconProp } from '../icon'
|
|
6
|
-
import { StepIndicatorVariant } from '../
|
|
6
|
+
import { StepIndicatorVariant } from '../stepIndicator/stepIndicatorTypes'
|
|
7
7
|
import { SystemProps } from '../system'
|
|
8
8
|
import { ThemingProps } from '../theme'
|
|
9
9
|
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { Box } from '../box'
|
|
4
4
|
import { styled, vui } from '../core'
|
|
5
|
-
import { StepIndicator } from '../
|
|
5
|
+
import { StepIndicator } from '../stepIndicator'
|
|
6
6
|
import { cs } from '../utils'
|
|
7
7
|
import { stepClassName } from './consts'
|
|
8
8
|
import { useStepperVerticalContext } from './context'
|
|
@@ -3,7 +3,7 @@ import { ReactNode } from 'react'
|
|
|
3
3
|
import { BoxProps } from '../box'
|
|
4
4
|
import { ChildrenProp } from '../core'
|
|
5
5
|
import { IconProp } from '../icon'
|
|
6
|
-
import { StepIndicatorVariant } from '../
|
|
6
|
+
import { StepIndicatorVariant } from '../stepIndicator/stepIndicatorTypes'
|
|
7
7
|
import { SystemProps } from '../system'
|
|
8
8
|
import { ThemingProps } from '../theme'
|
|
9
9
|
|