@veracity/vui 2.17.2-beta.1 → 2.17.2-beta.3
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.d.ts.map +1 -1
- package/dist/cjs/footer/footer.js +5 -8
- package/dist/cjs/tabs/tabs.d.ts +3 -3
- package/dist/cjs/tabs/tabs.d.ts.map +1 -1
- package/dist/cjs/tabs/tabs.types.d.ts +4 -5
- package/dist/cjs/tabs/tabs.types.d.ts.map +1 -1
- package/dist/cjs/utils/dates.d.ts +1 -0
- package/dist/cjs/utils/dates.d.ts.map +1 -1
- package/dist/cjs/utils/dates.js +6 -1
- package/dist/esm/footer/footer.d.ts.map +1 -1
- package/dist/esm/footer/footer.js +6 -9
- package/dist/esm/tabs/tabs.d.ts +3 -3
- package/dist/esm/tabs/tabs.d.ts.map +1 -1
- package/dist/esm/tabs/tabs.types.d.ts +4 -5
- package/dist/esm/tabs/tabs.types.d.ts.map +1 -1
- package/dist/esm/utils/dates.d.ts +1 -0
- package/dist/esm/utils/dates.d.ts.map +1 -1
- package/dist/esm/utils/dates.js +4 -0
- package/package.json +1 -1
- package/src/footer/footer.tsx +6 -11
- package/src/tabs/tabs.tsx +1 -1
- package/src/tabs/tabs.types.ts +4 -5
- package/src/utils/dates.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../../src/footer/footer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAwC,YAAY,EAAE,MAAM,SAAS,CAAA;AAO5E,OAAO,EAAkB,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAK3C,eAAO,MAAM,UAAU,+HAItB,CAAA;
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../../src/footer/footer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAwC,YAAY,EAAE,MAAM,SAAS,CAAA;AAO5E,OAAO,EAAkB,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAK3C,eAAO,MAAM,UAAU,+HAItB,CAAA;AAKD,oGAAoG;AACpG,eAAO,MAAM,MAAM;YAoNT,mBAAmB;aAClB,oBAAoB;aACpB,oBAAoB;UACvB,iBAAiB;SAClB,gBAAgB;aACZ,oBAAoB;CAC9B,CAAA;AAUD,eAAe,MAAM,CAAA"}
|
|
@@ -39,16 +39,14 @@ exports.FooterBase = core_1.styled.divBox `
|
|
|
39
39
|
padding: 5 3;
|
|
40
40
|
`;
|
|
41
41
|
/*@formatter:on*/
|
|
42
|
+
const currentYear = (0, utils_1.getCurrentYear)();
|
|
42
43
|
/** Branded Veracity Footer with trademark and links sections. Controls max-width of the content. */
|
|
43
44
|
exports.Footer = (0, core_1.vui)((props, ref) => {
|
|
44
45
|
const { applicationLinks, applicationSocialLinks = [], applicationStaticItems = [], children, className, columns, isApplication = false, isDNV = false, linkedIn, size, variant, isSlim } = props, rest = __rest(props, ["applicationLinks", "applicationSocialLinks", "applicationStaticItems", "children", "className", "columns", "isApplication", "isDNV", "linkedIn", "size", "variant", "isSlim"]);
|
|
45
46
|
const context = { size, variant };
|
|
46
47
|
const styles = (0, core_1.useStyleConfig)('Footer', props);
|
|
47
|
-
if (isApplication)
|
|
48
|
-
|
|
49
|
-
console.error('Footer: isApplication is true but applicationLinks is not set.');
|
|
50
|
-
}
|
|
51
|
-
}
|
|
48
|
+
if (isApplication && !applicationLinks)
|
|
49
|
+
console.error('Footer: isApplication is true but applicationLinks not set.');
|
|
52
50
|
const slimLinks = [
|
|
53
51
|
{
|
|
54
52
|
id: 'home',
|
|
@@ -62,15 +60,14 @@ exports.Footer = (0, core_1.vui)((props, ref) => {
|
|
|
62
60
|
(_a = section.links) === null || _a === void 0 ? void 0 : _a.map(link => {
|
|
63
61
|
if (!link)
|
|
64
62
|
return;
|
|
65
|
-
if (['home', 'support', 'status'].includes(link.id || ''))
|
|
63
|
+
if (['home', 'support', 'status'].includes(link.id || ''))
|
|
66
64
|
slimLinks.push(link);
|
|
67
|
-
}
|
|
68
65
|
});
|
|
69
66
|
});
|
|
70
67
|
});
|
|
71
68
|
const downMd = (0, core_1.useDown)('md');
|
|
72
69
|
const downLg = (0, core_1.useDown)('lg');
|
|
73
|
-
return ((0, jsx_runtime_1.jsx)(context_1.FooterProvider, { value: context, children: (0, jsx_runtime_1.jsxs)(exports.FooterBase, Object.assign({ className: (0, utils_1.cs)('vui-footer', isApplication ? 'vui-footer-app' : '', className), px: isApplication ? '40px' : 3, py: isSlim ? (downMd ? '16px' : '9px') : 5, role: "contentinfo" }, styles.container, { ref: ref }, rest, { children: [isApplication && ((0, jsx_runtime_1.jsx)(footerContent_1.default, { alignContent: "center", alignItems: "center", maxW: "100%", children: (0, jsx_runtime_1.jsxs)(footerRow_1.default, { alignContent: "space-between", w: 1, children: [(0, jsx_runtime_1.jsx)(box_1.Box, { alignItems: "self-start", columnGap: 3, flex: { xs: '0 0 100%', sm: '0 0 100%', md: '0 0 100%', lg: '0 0 50%' }, py: { xs: 1, sm: 1, md: 1.25, lg: 1.5 }, wrap: true, children: applicationLinks === null || applicationLinks === void 0 ? void 0 : applicationLinks.map((link, index) => ((0, jsx_runtime_1.jsxs)(box_1.Box, { flex: { xs: '0 0 50%', sm: '0 0 auto' }, children: [link.items && ((0, jsx_runtime_1.jsxs)(menu_1.default, Object.assign({ isLazy: false, offset: [-16, 9], placement: "top-start", size: "lg" }, rest, { children: [(0, jsx_runtime_1.jsx)(menu_1.default.Button, Object.assign({ as: link_1.Link, className: "vui-footerLink-trigger", pt: "3px", role: "button", text: link.text, title: link.text }, styles.link, rest)), (0, jsx_runtime_1.jsx)(menu_1.default.List, Object.assign({ maxH: 400, right: 0, w: 320 }, styles.list, { children: link.items.map(({ text, url }, index) => ((0, jsx_runtime_1.jsx)(menu_1.default.Item, Object.assign({ isTruncated: true, linkProps: { href: url }, text: text, title: text }, styles.item), index))) }))] }))), !link.items && (0, jsx_runtime_1.jsx)(footerLink_1.default, Object.assign({}, link, { href: link.url }))] }, index))) }), downLg && (0, jsx_runtime_1.jsx)(divider_1.Divider, { borderColor: "sandstone.main", mb: 0.5, mt: 1, w: 1 }), (0, jsx_runtime_1.jsxs)(box_1.Box, { centerV: true, columnGap: 3, flex: { xs: '0 0 100%', sm: '0 0 100%', md: '0 0 100%', lg: '0 0 50%' }, justifyContent: { sm: 'center', lg: 'flex-end' }, py: { xs: 1, sm: 1, md: 1.25, lg: 1.5 }, wrap: true, children: [applicationStaticItems === null || applicationStaticItems === void 0 ? void 0 : applicationStaticItems.map((text, index) => ((0, jsx_runtime_1.jsx)(box_1.Box, { children: (0, jsx_runtime_1.jsx)(t_1.T, { size: "sm", children: text }) }, index))), isDNV ? ((0, jsx_runtime_1.jsx)(box_1.Box, { children: (0, jsx_runtime_1.
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(context_1.FooterProvider, { value: context, children: (0, jsx_runtime_1.jsxs)(exports.FooterBase, Object.assign({ className: (0, utils_1.cs)('vui-footer', isApplication ? 'vui-footer-app' : '', className), px: isApplication ? '40px' : 3, py: isSlim ? (downMd ? '16px' : '9px') : 5, role: "contentinfo" }, styles.container, { ref: ref }, rest, { children: [isApplication && ((0, jsx_runtime_1.jsx)(footerContent_1.default, { alignContent: "center", alignItems: "center", maxW: "100%", children: (0, jsx_runtime_1.jsxs)(footerRow_1.default, { alignContent: "space-between", w: 1, children: [(0, jsx_runtime_1.jsx)(box_1.Box, { alignItems: "self-start", columnGap: 3, flex: { xs: '0 0 100%', sm: '0 0 100%', md: '0 0 100%', lg: '0 0 50%' }, py: { xs: 1, sm: 1, md: 1.25, lg: 1.5 }, wrap: true, children: applicationLinks === null || applicationLinks === void 0 ? void 0 : applicationLinks.map((link, index) => ((0, jsx_runtime_1.jsxs)(box_1.Box, { flex: { xs: '0 0 50%', sm: '0 0 auto' }, children: [link.items && ((0, jsx_runtime_1.jsxs)(menu_1.default, Object.assign({ isLazy: false, offset: [-16, 9], placement: "top-start", size: "lg" }, rest, { children: [(0, jsx_runtime_1.jsx)(menu_1.default.Button, Object.assign({ as: link_1.Link, className: "vui-footerLink-trigger", pt: "3px", role: "button", text: link.text, title: link.text }, styles.link, rest)), (0, jsx_runtime_1.jsx)(menu_1.default.List, Object.assign({ maxH: 400, right: 0, w: 320 }, styles.list, { children: link.items.map(({ text, url }, index) => ((0, jsx_runtime_1.jsx)(menu_1.default.Item, Object.assign({ isTruncated: true, linkProps: { href: url }, text: text, title: text }, styles.item), index))) }))] }))), !link.items && (0, jsx_runtime_1.jsx)(footerLink_1.default, Object.assign({}, link, { href: link.url }))] }, index))) }), downLg && (0, jsx_runtime_1.jsx)(divider_1.Divider, { borderColor: "sandstone.main", mb: 0.5, mt: 1, w: 1 }), (0, jsx_runtime_1.jsxs)(box_1.Box, { centerV: true, columnGap: 3, flex: { xs: '0 0 100%', sm: '0 0 100%', md: '0 0 100%', lg: '0 0 50%' }, justifyContent: { sm: 'center', lg: 'flex-end' }, py: { xs: 1, sm: 1, md: 1.25, lg: 1.5 }, wrap: true, children: [applicationStaticItems === null || applicationStaticItems === void 0 ? void 0 : applicationStaticItems.map((text, index) => ((0, jsx_runtime_1.jsx)(box_1.Box, { children: (0, jsx_runtime_1.jsx)(t_1.T, { size: "sm", children: text }) }, index))), isDNV ? ((0, jsx_runtime_1.jsx)(box_1.Box, { children: (0, jsx_runtime_1.jsxs)(t_1.T, { size: "sm", children: ["\u00A9 DNV AS ", currentYear] }) })) : ((0, jsx_runtime_1.jsx)(box_1.Box, { children: (0, jsx_runtime_1.jsxs)(t_1.T, { size: "sm", children: [(0, jsx_runtime_1.jsx)(t_1.T, { weight: "demi", children: "Veracity by DNV" }), ", DNV AS"] }) })), (0, jsx_runtime_1.jsxs)(box_1.Box, { children: [applicationSocialLinks === null || applicationSocialLinks === void 0 ? void 0 : applicationSocialLinks.map((link, index) => ((0, jsx_runtime_1.jsx)(link_1.Link, Object.assign({ "aria-label": link.text, fontWeight: "demi", href: link.url, iconLeft: (0, jsx_runtime_1.jsx)(link_1.Link.Icon, { name: `cubCircle${link.text}`, radius: "50%", size: "xs" }), isExternal: true, mr: 1, size: { _: 'sm', md: 'md' } }, styles.link), index))), (0, jsx_runtime_1.jsx)(link_1.Link, Object.assign({ fontWeight: "demi", href: linkedIn !== null && linkedIn !== void 0 ? linkedIn : footerTrademark_1.defaultLinkedInUrl, isExternal: true, size: { _: 'sm', md: 'md' } }, styles.link, { children: (0, jsx_runtime_1.jsx)(footerHeading_1.default, { fontSize: "16px", mb: 0, text: "Follow us" }) }))] })] })] }) })), !isApplication && isSlim && ((0, jsx_runtime_1.jsx)(footerContent_1.default, { alignContent: "center", alignItems: "center", maxW: { xs: 343, sm: 305, md: 720, lg: 975 }, children: (0, jsx_runtime_1.jsxs)(footerRow_1.default, { children: [slimLinks.map((link, index) => {
|
|
74
71
|
/** if the screen is small drop one specific link */
|
|
75
72
|
if (downLg && (link === null || link === void 0 ? void 0 : link.id) === 'support')
|
|
76
73
|
return;
|
package/dist/cjs/tabs/tabs.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TabsProps } from './tabs.types';
|
|
3
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 & {
|
|
4
4
|
actions?: React.ReactNode;
|
|
5
|
-
activeTabId?:
|
|
5
|
+
activeTabId?: string | number | undefined;
|
|
6
6
|
showBorder?: boolean | undefined;
|
|
7
|
-
onTabClick?: ((
|
|
7
|
+
onTabClick?: ((id?: string | number | undefined) => void) | undefined;
|
|
8
8
|
}, never>;
|
|
9
9
|
/**
|
|
10
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":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAA;AAMhE,OAAO,
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/tabs/tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAA;AAMhE,OAAO,EAA2B,SAAS,EAAE,MAAM,cAAc,CAAA;AAIjE,eAAO,MAAM,QAAQ;;;;;SAEpB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,kDAmEf,CAAA;AAIF,eAAe,IAAI,CAAA"}
|
|
@@ -4,18 +4,17 @@ 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;
|
|
8
7
|
export type TabsSize = 'md' | 'sm' | 'lg' | 'xl' | 'xxl';
|
|
9
8
|
export type NavBarIconSize = 'md' | 'xs' | 'sm' | 'lg' | 'xl' | undefined;
|
|
10
9
|
export type TabsProps = SystemProps & ThemingProps<'Tabs'> & ChildrenProp & {
|
|
11
10
|
actions?: ReactNode;
|
|
12
|
-
activeTabId?:
|
|
11
|
+
activeTabId?: number | string;
|
|
13
12
|
showBorder?: boolean;
|
|
14
|
-
onTabClick?: (
|
|
13
|
+
onTabClick?: (id?: number | string) => void;
|
|
15
14
|
};
|
|
16
15
|
export type TabProps = SystemProps & ChildrenProp & {
|
|
17
16
|
icon?: IconProp;
|
|
18
|
-
id?:
|
|
17
|
+
id?: number | string;
|
|
19
18
|
title: ReactNode;
|
|
20
19
|
disabled?: boolean;
|
|
21
20
|
className?: string;
|
|
@@ -30,7 +29,7 @@ export type TabNavBarProps = {
|
|
|
30
29
|
actions?: ReactNode;
|
|
31
30
|
tabs: TabIndexProps[];
|
|
32
31
|
onNavItemClick: (tabIndex: number, e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
|
|
33
|
-
activeNavItem?:
|
|
32
|
+
activeNavItem?: number | string;
|
|
34
33
|
animationDirection?: AnimationDirection;
|
|
35
34
|
showBorder?: boolean;
|
|
36
35
|
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;AACpE,MAAM,MAAM,
|
|
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,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,MAAM,GAAG,MAAM,CAAA;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAA;CAC5C,CAAA;AAEH,MAAM,MAAM,QAAQ,GAAG,WAAW,GAChC,YAAY,GAAG;IACb,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,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,MAAM,GAAG,MAAM,CAAA;IAC/B,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;IACvC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA"}
|
|
@@ -22,4 +22,5 @@ export declare const sameYearSameMonth: (a?: Date, b?: Date) => boolean;
|
|
|
22
22
|
export declare const sameYear: (a?: Date, b?: Date) => boolean;
|
|
23
23
|
export declare const sameDate: (a?: Date, b?: Date) => boolean;
|
|
24
24
|
export declare const utcDateToLocale: (utcDate?: Date) => string | undefined;
|
|
25
|
+
export declare const getCurrentYear: () => number;
|
|
25
26
|
//# sourceMappingURL=dates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../src/utils/dates.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,WAExD;AAED,mDAAmD;AACnD,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,sBAOzD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,oBAM1C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,2BAGpD;AAGD,eAAO,MAAM,eAAe,SAAU,IAAI;;;;CAIxC,CAAA;AAGF,eAAO,MAAM,sBAAsB,SAAU,MAAM,SAAS,MAAM,QAAQ,MAAM,SAE/E,CAAA;AAED,eAAO,MAAM,iBAAiB,OAAQ,IAAI,MAAM,IAAI,YAInD,CAAA;AAED,eAAO,MAAM,QAAQ,OAAQ,IAAI,MAAM,IAAI,YAG1C,CAAA;AAED,eAAO,MAAM,QAAQ,OAAQ,IAAI,MAAM,IAAI,YAQ1C,CAAA;AAED,eAAO,MAAM,eAAe,aAAc,IAAI,uBAI7C,CAAA"}
|
|
1
|
+
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../src/utils/dates.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,WAExD;AAED,mDAAmD;AACnD,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,sBAOzD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,oBAM1C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,2BAGpD;AAGD,eAAO,MAAM,eAAe,SAAU,IAAI;;;;CAIxC,CAAA;AAGF,eAAO,MAAM,sBAAsB,SAAU,MAAM,SAAS,MAAM,QAAQ,MAAM,SAE/E,CAAA;AAED,eAAO,MAAM,iBAAiB,OAAQ,IAAI,MAAM,IAAI,YAInD,CAAA;AAED,eAAO,MAAM,QAAQ,OAAQ,IAAI,MAAM,IAAI,YAG1C,CAAA;AAED,eAAO,MAAM,QAAQ,OAAQ,IAAI,MAAM,IAAI,YAQ1C,CAAA;AAED,eAAO,MAAM,eAAe,aAAc,IAAI,uBAI7C,CAAA;AAED,eAAO,MAAM,cAAc,cAG1B,CAAA"}
|
package/dist/cjs/utils/dates.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.utcDateToLocale = exports.sameDate = exports.sameYear = exports.sameYearSameMonth = exports.generateDateByUTCValue = exports.getDateUTCValue = exports.validateDateFormat = exports.parseIsoDate = exports.formatIsoDate = exports.isValidDate = void 0;
|
|
3
|
+
exports.getCurrentYear = exports.utcDateToLocale = exports.sameDate = exports.sameYear = exports.sameYearSameMonth = exports.generateDateByUTCValue = exports.getDateUTCValue = exports.validateDateFormat = exports.parseIsoDate = exports.formatIsoDate = exports.isValidDate = void 0;
|
|
4
4
|
/** Checks if the provided value is a valid date */
|
|
5
5
|
function isValidDate(value) {
|
|
6
6
|
return `${new Date(value)}` !== 'Invalid Date';
|
|
@@ -76,3 +76,8 @@ const utcDateToLocale = (utcDate) => {
|
|
|
76
76
|
return localDateSameDay.toLocaleDateString();
|
|
77
77
|
};
|
|
78
78
|
exports.utcDateToLocale = utcDateToLocale;
|
|
79
|
+
const getCurrentYear = () => {
|
|
80
|
+
const currentDate = new Date();
|
|
81
|
+
return currentDate.getFullYear();
|
|
82
|
+
};
|
|
83
|
+
exports.getCurrentYear = getCurrentYear;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../../src/footer/footer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAwC,YAAY,EAAE,MAAM,SAAS,CAAA;AAO5E,OAAO,EAAkB,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAK3C,eAAO,MAAM,UAAU,+HAItB,CAAA;
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../../src/footer/footer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAwC,YAAY,EAAE,MAAM,SAAS,CAAA;AAO5E,OAAO,EAAkB,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAK3C,eAAO,MAAM,UAAU,+HAItB,CAAA;AAKD,oGAAoG;AACpG,eAAO,MAAM,MAAM;YAoNT,mBAAmB;aAClB,oBAAoB;aACpB,oBAAoB;UACvB,iBAAiB;SAClB,gBAAgB;aACZ,oBAAoB;CAC9B,CAAA;AAUD,eAAe,MAAM,CAAA"}
|
|
@@ -5,7 +5,7 @@ import { Divider } from '../divider';
|
|
|
5
5
|
import { Link } from '../link';
|
|
6
6
|
import Menu from '../menu';
|
|
7
7
|
import { T } from '../t';
|
|
8
|
-
import { cs } from '../utils';
|
|
8
|
+
import { cs, getCurrentYear } from '../utils';
|
|
9
9
|
import { FooterProvider } from './context';
|
|
10
10
|
import FooterColumn from './footerColumn';
|
|
11
11
|
import FooterContent from './footerContent';
|
|
@@ -22,16 +22,14 @@ export const FooterBase = styled.divBox `
|
|
|
22
22
|
padding: 5 3;
|
|
23
23
|
`;
|
|
24
24
|
/*@formatter:on*/
|
|
25
|
+
const currentYear = getCurrentYear();
|
|
25
26
|
/** Branded Veracity Footer with trademark and links sections. Controls max-width of the content. */
|
|
26
27
|
export const Footer = vui((props, ref) => {
|
|
27
28
|
const { applicationLinks, applicationSocialLinks = [], applicationStaticItems = [], children, className, columns, isApplication = false, isDNV = false, linkedIn, size, variant, isSlim, ...rest } = props;
|
|
28
29
|
const context = { size, variant };
|
|
29
30
|
const styles = useStyleConfig('Footer', props);
|
|
30
|
-
if (isApplication)
|
|
31
|
-
|
|
32
|
-
console.error('Footer: isApplication is true but applicationLinks is not set.');
|
|
33
|
-
}
|
|
34
|
-
}
|
|
31
|
+
if (isApplication && !applicationLinks)
|
|
32
|
+
console.error('Footer: isApplication is true but applicationLinks not set.');
|
|
35
33
|
const slimLinks = [
|
|
36
34
|
{
|
|
37
35
|
id: 'home',
|
|
@@ -44,15 +42,14 @@ export const Footer = vui((props, ref) => {
|
|
|
44
42
|
section.links?.map(link => {
|
|
45
43
|
if (!link)
|
|
46
44
|
return;
|
|
47
|
-
if (['home', 'support', 'status'].includes(link.id || ''))
|
|
45
|
+
if (['home', 'support', 'status'].includes(link.id || ''))
|
|
48
46
|
slimLinks.push(link);
|
|
49
|
-
}
|
|
50
47
|
});
|
|
51
48
|
});
|
|
52
49
|
});
|
|
53
50
|
const downMd = useDown('md');
|
|
54
51
|
const downLg = useDown('lg');
|
|
55
|
-
return (_jsx(FooterProvider, { value: context, children: _jsxs(FooterBase, { className: cs('vui-footer', isApplication ? 'vui-footer-app' : '', className), px: isApplication ? '40px' : 3, py: isSlim ? (downMd ? '16px' : '9px') : 5, role: "contentinfo", ...styles.container, ref: ref, ...rest, children: [isApplication && (_jsx(FooterContent, { alignContent: "center", alignItems: "center", maxW: "100%", children: _jsxs(FooterRow, { alignContent: "space-between", w: 1, children: [_jsx(Box, { alignItems: "self-start", columnGap: 3, flex: { xs: '0 0 100%', sm: '0 0 100%', md: '0 0 100%', lg: '0 0 50%' }, py: { xs: 1, sm: 1, md: 1.25, lg: 1.5 }, wrap: true, children: applicationLinks?.map((link, index) => (_jsxs(Box, { flex: { xs: '0 0 50%', sm: '0 0 auto' }, children: [link.items && (_jsxs(Menu, { isLazy: false, offset: [-16, 9], placement: "top-start", size: "lg", ...rest, children: [_jsx(Menu.Button, { as: Link, className: "vui-footerLink-trigger", pt: "3px", role: "button", text: link.text, title: link.text, ...styles.link, ...rest }), _jsx(Menu.List, { maxH: 400, right: 0, w: 320, ...styles.list, children: link.items.map(({ text, url }, index) => (_jsx(Menu.Item, { isTruncated: true, linkProps: { href: url }, text: text, title: text, ...styles.item }, index))) })] })), !link.items && _jsx(FooterLink, { ...link, href: link.url })] }, index))) }), downLg && _jsx(Divider, { borderColor: "sandstone.main", mb: 0.5, mt: 1, w: 1 }), _jsxs(Box, { centerV: true, columnGap: 3, flex: { xs: '0 0 100%', sm: '0 0 100%', md: '0 0 100%', lg: '0 0 50%' }, justifyContent: { sm: 'center', lg: 'flex-end' }, py: { xs: 1, sm: 1, md: 1.25, lg: 1.5 }, wrap: true, children: [applicationStaticItems?.map((text, index) => (_jsx(Box, { children: _jsx(T, { size: "sm", children: text }) }, index))), isDNV ? (_jsx(Box, { children:
|
|
52
|
+
return (_jsx(FooterProvider, { value: context, children: _jsxs(FooterBase, { className: cs('vui-footer', isApplication ? 'vui-footer-app' : '', className), px: isApplication ? '40px' : 3, py: isSlim ? (downMd ? '16px' : '9px') : 5, role: "contentinfo", ...styles.container, ref: ref, ...rest, children: [isApplication && (_jsx(FooterContent, { alignContent: "center", alignItems: "center", maxW: "100%", children: _jsxs(FooterRow, { alignContent: "space-between", w: 1, children: [_jsx(Box, { alignItems: "self-start", columnGap: 3, flex: { xs: '0 0 100%', sm: '0 0 100%', md: '0 0 100%', lg: '0 0 50%' }, py: { xs: 1, sm: 1, md: 1.25, lg: 1.5 }, wrap: true, children: applicationLinks?.map((link, index) => (_jsxs(Box, { flex: { xs: '0 0 50%', sm: '0 0 auto' }, children: [link.items && (_jsxs(Menu, { isLazy: false, offset: [-16, 9], placement: "top-start", size: "lg", ...rest, children: [_jsx(Menu.Button, { as: Link, className: "vui-footerLink-trigger", pt: "3px", role: "button", text: link.text, title: link.text, ...styles.link, ...rest }), _jsx(Menu.List, { maxH: 400, right: 0, w: 320, ...styles.list, children: link.items.map(({ text, url }, index) => (_jsx(Menu.Item, { isTruncated: true, linkProps: { href: url }, text: text, title: text, ...styles.item }, index))) })] })), !link.items && _jsx(FooterLink, { ...link, href: link.url })] }, index))) }), downLg && _jsx(Divider, { borderColor: "sandstone.main", mb: 0.5, mt: 1, w: 1 }), _jsxs(Box, { centerV: true, columnGap: 3, flex: { xs: '0 0 100%', sm: '0 0 100%', md: '0 0 100%', lg: '0 0 50%' }, justifyContent: { sm: 'center', lg: 'flex-end' }, py: { xs: 1, sm: 1, md: 1.25, lg: 1.5 }, wrap: true, children: [applicationStaticItems?.map((text, index) => (_jsx(Box, { children: _jsx(T, { size: "sm", children: text }) }, index))), isDNV ? (_jsx(Box, { children: _jsxs(T, { size: "sm", children: ["\u00A9 DNV AS ", currentYear] }) })) : (_jsx(Box, { children: _jsxs(T, { size: "sm", children: [_jsx(T, { weight: "demi", children: "Veracity by DNV" }), ", DNV AS"] }) })), _jsxs(Box, { children: [applicationSocialLinks?.map((link, index) => (_jsx(Link, { "aria-label": link.text, fontWeight: "demi", href: link.url, iconLeft: _jsx(Link.Icon, { name: `cubCircle${link.text}`, radius: "50%", size: "xs" }), isExternal: true, mr: 1, size: { _: 'sm', md: 'md' }, ...styles.link }, index))), _jsx(Link, { fontWeight: "demi", href: linkedIn ?? defaultLinkedInUrl, isExternal: true, size: { _: 'sm', md: 'md' }, ...styles.link, children: _jsx(FooterHeading, { fontSize: "16px", mb: 0, text: "Follow us" }) })] })] })] }) })), !isApplication && isSlim && (_jsx(FooterContent, { alignContent: "center", alignItems: "center", maxW: { xs: 343, sm: 305, md: 720, lg: 975 }, children: _jsxs(FooterRow, { children: [slimLinks.map((link, index) => {
|
|
56
53
|
/** if the screen is small drop one specific link */
|
|
57
54
|
if (downLg && link?.id === 'support')
|
|
58
55
|
return;
|
package/dist/esm/tabs/tabs.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TabsProps } from './tabs.types';
|
|
3
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 & {
|
|
4
4
|
actions?: React.ReactNode;
|
|
5
|
-
activeTabId?:
|
|
5
|
+
activeTabId?: string | number | undefined;
|
|
6
6
|
showBorder?: boolean | undefined;
|
|
7
|
-
onTabClick?: ((
|
|
7
|
+
onTabClick?: ((id?: string | number | undefined) => void) | undefined;
|
|
8
8
|
}, never>;
|
|
9
9
|
/**
|
|
10
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":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAA;AAMhE,OAAO,
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/tabs/tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAA;AAMhE,OAAO,EAA2B,SAAS,EAAE,MAAM,cAAc,CAAA;AAIjE,eAAO,MAAM,QAAQ;;;;;SAEpB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,kDAmEf,CAAA;AAIF,eAAe,IAAI,CAAA"}
|
|
@@ -4,18 +4,17 @@ 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;
|
|
8
7
|
export type TabsSize = 'md' | 'sm' | 'lg' | 'xl' | 'xxl';
|
|
9
8
|
export type NavBarIconSize = 'md' | 'xs' | 'sm' | 'lg' | 'xl' | undefined;
|
|
10
9
|
export type TabsProps = SystemProps & ThemingProps<'Tabs'> & ChildrenProp & {
|
|
11
10
|
actions?: ReactNode;
|
|
12
|
-
activeTabId?:
|
|
11
|
+
activeTabId?: number | string;
|
|
13
12
|
showBorder?: boolean;
|
|
14
|
-
onTabClick?: (
|
|
13
|
+
onTabClick?: (id?: number | string) => void;
|
|
15
14
|
};
|
|
16
15
|
export type TabProps = SystemProps & ChildrenProp & {
|
|
17
16
|
icon?: IconProp;
|
|
18
|
-
id?:
|
|
17
|
+
id?: number | string;
|
|
19
18
|
title: ReactNode;
|
|
20
19
|
disabled?: boolean;
|
|
21
20
|
className?: string;
|
|
@@ -30,7 +29,7 @@ export type TabNavBarProps = {
|
|
|
30
29
|
actions?: ReactNode;
|
|
31
30
|
tabs: TabIndexProps[];
|
|
32
31
|
onNavItemClick: (tabIndex: number, e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
|
|
33
|
-
activeNavItem?:
|
|
32
|
+
activeNavItem?: number | string;
|
|
34
33
|
animationDirection?: AnimationDirection;
|
|
35
34
|
showBorder?: boolean;
|
|
36
35
|
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;AACpE,MAAM,MAAM,
|
|
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,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,MAAM,GAAG,MAAM,CAAA;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAA;CAC5C,CAAA;AAEH,MAAM,MAAM,QAAQ,GAAG,WAAW,GAChC,YAAY,GAAG;IACb,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,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,MAAM,GAAG,MAAM,CAAA;IAC/B,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;IACvC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,CAAA"}
|
|
@@ -22,4 +22,5 @@ export declare const sameYearSameMonth: (a?: Date, b?: Date) => boolean;
|
|
|
22
22
|
export declare const sameYear: (a?: Date, b?: Date) => boolean;
|
|
23
23
|
export declare const sameDate: (a?: Date, b?: Date) => boolean;
|
|
24
24
|
export declare const utcDateToLocale: (utcDate?: Date) => string | undefined;
|
|
25
|
+
export declare const getCurrentYear: () => number;
|
|
25
26
|
//# sourceMappingURL=dates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../src/utils/dates.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,WAExD;AAED,mDAAmD;AACnD,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,sBAOzD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,oBAM1C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,2BAGpD;AAGD,eAAO,MAAM,eAAe,SAAU,IAAI;;;;CAIxC,CAAA;AAGF,eAAO,MAAM,sBAAsB,SAAU,MAAM,SAAS,MAAM,QAAQ,MAAM,SAE/E,CAAA;AAED,eAAO,MAAM,iBAAiB,OAAQ,IAAI,MAAM,IAAI,YAInD,CAAA;AAED,eAAO,MAAM,QAAQ,OAAQ,IAAI,MAAM,IAAI,YAG1C,CAAA;AAED,eAAO,MAAM,QAAQ,OAAQ,IAAI,MAAM,IAAI,YAQ1C,CAAA;AAED,eAAO,MAAM,eAAe,aAAc,IAAI,uBAI7C,CAAA"}
|
|
1
|
+
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../src/utils/dates.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,WAExD;AAED,mDAAmD;AACnD,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,sBAOzD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,oBAM1C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,2BAGpD;AAGD,eAAO,MAAM,eAAe,SAAU,IAAI;;;;CAIxC,CAAA;AAGF,eAAO,MAAM,sBAAsB,SAAU,MAAM,SAAS,MAAM,QAAQ,MAAM,SAE/E,CAAA;AAED,eAAO,MAAM,iBAAiB,OAAQ,IAAI,MAAM,IAAI,YAInD,CAAA;AAED,eAAO,MAAM,QAAQ,OAAQ,IAAI,MAAM,IAAI,YAG1C,CAAA;AAED,eAAO,MAAM,QAAQ,OAAQ,IAAI,MAAM,IAAI,YAQ1C,CAAA;AAED,eAAO,MAAM,eAAe,aAAc,IAAI,uBAI7C,CAAA;AAED,eAAO,MAAM,cAAc,cAG1B,CAAA"}
|
package/dist/esm/utils/dates.js
CHANGED
|
@@ -63,3 +63,7 @@ export const utcDateToLocale = (utcDate) => {
|
|
|
63
63
|
const localDateSameDay = new Date(utcDate.getUTCFullYear(), utcDate.getUTCMonth(), utcDate.getUTCDate());
|
|
64
64
|
return localDateSameDay.toLocaleDateString();
|
|
65
65
|
};
|
|
66
|
+
export const getCurrentYear = () => {
|
|
67
|
+
const currentDate = new Date();
|
|
68
|
+
return currentDate.getFullYear();
|
|
69
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veracity/vui",
|
|
3
|
-
"version": "2.17.2-beta.
|
|
3
|
+
"version": "2.17.2-beta.3",
|
|
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
|
@@ -6,7 +6,7 @@ import { Divider } from '../divider'
|
|
|
6
6
|
import { Link } from '../link'
|
|
7
7
|
import Menu from '../menu'
|
|
8
8
|
import { T } from '../t'
|
|
9
|
-
import { cs } from '../utils'
|
|
9
|
+
import { cs, getCurrentYear } from '../utils'
|
|
10
10
|
import { FooterProvider } from './context'
|
|
11
11
|
import { FooterLinkData, FooterProps } from './footer.types'
|
|
12
12
|
import FooterColumn from './footerColumn'
|
|
@@ -26,6 +26,8 @@ export const FooterBase = styled.divBox`
|
|
|
26
26
|
`
|
|
27
27
|
/*@formatter:on*/
|
|
28
28
|
|
|
29
|
+
const currentYear = getCurrentYear()
|
|
30
|
+
|
|
29
31
|
/** Branded Veracity Footer with trademark and links sections. Controls max-width of the content. */
|
|
30
32
|
export const Footer = vui<'div', FooterProps>((props, ref) => {
|
|
31
33
|
const {
|
|
@@ -48,11 +50,7 @@ export const Footer = vui<'div', FooterProps>((props, ref) => {
|
|
|
48
50
|
|
|
49
51
|
const styles = useStyleConfig('Footer', props)
|
|
50
52
|
|
|
51
|
-
if (isApplication)
|
|
52
|
-
if (!applicationLinks) {
|
|
53
|
-
console.error('Footer: isApplication is true but applicationLinks is not set.')
|
|
54
|
-
}
|
|
55
|
-
}
|
|
53
|
+
if (isApplication && !applicationLinks) console.error('Footer: isApplication is true but applicationLinks not set.')
|
|
56
54
|
|
|
57
55
|
const slimLinks: FooterLinkData[] = [
|
|
58
56
|
{
|
|
@@ -66,10 +64,7 @@ export const Footer = vui<'div', FooterProps>((props, ref) => {
|
|
|
66
64
|
column.map(section => {
|
|
67
65
|
section.links?.map(link => {
|
|
68
66
|
if (!link) return
|
|
69
|
-
|
|
70
|
-
if (['home', 'support', 'status'].includes(link.id || '')) {
|
|
71
|
-
slimLinks.push(link)
|
|
72
|
-
}
|
|
67
|
+
if (['home', 'support', 'status'].includes(link.id || '')) slimLinks.push(link)
|
|
73
68
|
})
|
|
74
69
|
})
|
|
75
70
|
})
|
|
@@ -149,7 +144,7 @@ export const Footer = vui<'div', FooterProps>((props, ref) => {
|
|
|
149
144
|
|
|
150
145
|
{isDNV ? (
|
|
151
146
|
<Box>
|
|
152
|
-
<T size="sm">© DNV AS
|
|
147
|
+
<T size="sm">© DNV AS {currentYear}</T>
|
|
153
148
|
</Box>
|
|
154
149
|
) : (
|
|
155
150
|
<Box>
|
package/src/tabs/tabs.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { styled, useStyleConfig, vui } from '../core'
|
|
|
4
4
|
import { P } from '../p'
|
|
5
5
|
import { cs } from '../utils'
|
|
6
6
|
import Tab from './tab'
|
|
7
|
-
import {
|
|
7
|
+
import { TabIndexProps, TabProps, TabsProps } from './tabs.types'
|
|
8
8
|
import TabsNavBar from './tabsNavBar'
|
|
9
9
|
import { useTabsState } from './useTabsState'
|
|
10
10
|
|
package/src/tabs/tabs.types.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { SystemProps } from '../system'
|
|
|
6
6
|
import { ThemingProps } from '../theme'
|
|
7
7
|
|
|
8
8
|
export type AnimationDirection = 'fadeLeft' | 'fadeRight' | 'fadeIn'
|
|
9
|
-
export type TabId = string | number
|
|
10
9
|
export type TabsSize = 'md' | 'sm' | 'lg' | 'xl' | 'xxl'
|
|
11
10
|
export type NavBarIconSize = 'md' | 'xs' | 'sm' | 'lg' | 'xl' | undefined
|
|
12
11
|
|
|
@@ -14,15 +13,15 @@ export type TabsProps = SystemProps &
|
|
|
14
13
|
ThemingProps<'Tabs'> &
|
|
15
14
|
ChildrenProp & {
|
|
16
15
|
actions?: ReactNode
|
|
17
|
-
activeTabId?:
|
|
16
|
+
activeTabId?: number | string
|
|
18
17
|
showBorder?: boolean
|
|
19
|
-
onTabClick?: (
|
|
18
|
+
onTabClick?: (id?: number | string) => void
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
export type TabProps = SystemProps &
|
|
23
22
|
ChildrenProp & {
|
|
24
23
|
icon?: IconProp
|
|
25
|
-
id?:
|
|
24
|
+
id?: number | string
|
|
26
25
|
title: ReactNode
|
|
27
26
|
disabled?: boolean
|
|
28
27
|
className?: string
|
|
@@ -39,7 +38,7 @@ export type TabNavBarProps = {
|
|
|
39
38
|
actions?: ReactNode
|
|
40
39
|
tabs: TabIndexProps[]
|
|
41
40
|
onNavItemClick: (tabIndex: number, e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void
|
|
42
|
-
activeNavItem?:
|
|
41
|
+
activeNavItem?: number | string
|
|
43
42
|
animationDirection?: AnimationDirection
|
|
44
43
|
showBorder?: boolean
|
|
45
44
|
size?: TabsSize
|
package/src/utils/dates.ts
CHANGED
|
@@ -72,3 +72,8 @@ export const utcDateToLocale = (utcDate?: Date) => {
|
|
|
72
72
|
const localDateSameDay = new Date(utcDate.getUTCFullYear(), utcDate.getUTCMonth(), utcDate.getUTCDate())
|
|
73
73
|
return localDateSameDay.toLocaleDateString()
|
|
74
74
|
}
|
|
75
|
+
|
|
76
|
+
export const getCurrentYear = () => {
|
|
77
|
+
const currentDate = new Date()
|
|
78
|
+
return currentDate.getFullYear()
|
|
79
|
+
}
|